UNPKG

5.31 MBJavaScriptView Raw
1#!/usr/bin/env node
2module.exports =
3/******/ (function(modules) { // webpackBootstrap
4/******/ // The module cache
5/******/ var installedModules = {};
6/******/
7/******/ // The require function
8/******/ function __webpack_require__(moduleId) {
9/******/
10/******/ // Check if module is in cache
11/******/ if(installedModules[moduleId]) {
12/******/ return installedModules[moduleId].exports;
13/******/ }
14/******/ // Create a new module (and put it into the cache)
15/******/ var module = installedModules[moduleId] = {
16/******/ i: moduleId,
17/******/ l: false,
18/******/ exports: {}
19/******/ };
20/******/
21/******/ // Execute the module function
22/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
23/******/
24/******/ // Flag the module as loaded
25/******/ module.l = true;
26/******/
27/******/ // Return the exports of the module
28/******/ return module.exports;
29/******/ }
30/******/
31/******/
32/******/ // expose the modules object (__webpack_modules__)
33/******/ __webpack_require__.m = modules;
34/******/
35/******/ // expose the module cache
36/******/ __webpack_require__.c = installedModules;
37/******/
38/******/ // identity function for calling harmony imports with the correct context
39/******/ __webpack_require__.i = function(value) { return value; };
40/******/
41/******/ // define getter function for harmony exports
42/******/ __webpack_require__.d = function(exports, name, getter) {
43/******/ if(!__webpack_require__.o(exports, name)) {
44/******/ Object.defineProperty(exports, name, {
45/******/ configurable: false,
46/******/ enumerable: true,
47/******/ get: getter
48/******/ });
49/******/ }
50/******/ };
51/******/
52/******/ // getDefaultExport function for compatibility with non-harmony modules
53/******/ __webpack_require__.n = function(module) {
54/******/ var getter = module && module.__esModule ?
55/******/ function getDefault() { return module['default']; } :
56/******/ function getModuleExports() { return module; };
57/******/ __webpack_require__.d(getter, 'a', getter);
58/******/ return getter;
59/******/ };
60/******/
61/******/ // Object.prototype.hasOwnProperty.call
62/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
63/******/
64/******/ // __webpack_public_path__
65/******/ __webpack_require__.p = "";
66/******/
67/******/ // Load entry module and return exports
68/******/ return __webpack_require__(__webpack_require__.s = 504);
69/******/ })
70/************************************************************************/
71/******/ ([
72/* 0 */
73/***/ (function(module, __webpack_exports__, __webpack_require__) {
74
75"use strict";
76/* harmony export (immutable) */ __webpack_exports__["a"] = __extends;
77/* unused harmony export __assign */
78/* unused harmony export __rest */
79/* unused harmony export __decorate */
80/* unused harmony export __param */
81/* unused harmony export __metadata */
82/* unused harmony export __awaiter */
83/* unused harmony export __generator */
84/* unused harmony export __exportStar */
85/* unused harmony export __values */
86/* unused harmony export __read */
87/* unused harmony export __spread */
88/* unused harmony export __await */
89/* unused harmony export __asyncGenerator */
90/* unused harmony export __asyncDelegator */
91/* unused harmony export __asyncValues */
92/* unused harmony export __makeTemplateObject */
93/* unused harmony export __importStar */
94/* unused harmony export __importDefault */
95/*! *****************************************************************************
96Copyright (c) Microsoft Corporation. All rights reserved.
97Licensed under the Apache License, Version 2.0 (the "License"); you may not use
98this file except in compliance with the License. You may obtain a copy of the
99License at http://www.apache.org/licenses/LICENSE-2.0
100
101THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
102KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
103WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
104MERCHANTABLITY OR NON-INFRINGEMENT.
105
106See the Apache Version 2.0 License for specific language governing permissions
107and limitations under the License.
108***************************************************************************** */
109/* global Reflect, Promise */
110
111var extendStatics = function(d, b) {
112 extendStatics = Object.setPrototypeOf ||
113 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
114 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
115 return extendStatics(d, b);
116};
117
118function __extends(d, b) {
119 extendStatics(d, b);
120 function __() { this.constructor = d; }
121 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
122}
123
124var __assign = function() {
125 __assign = Object.assign || function __assign(t) {
126 for (var s, i = 1, n = arguments.length; i < n; i++) {
127 s = arguments[i];
128 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
129 }
130 return t;
131 }
132 return __assign.apply(this, arguments);
133}
134
135function __rest(s, e) {
136 var t = {};
137 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
138 t[p] = s[p];
139 if (s != null && typeof Object.getOwnPropertySymbols === "function")
140 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
141 t[p[i]] = s[p[i]];
142 return t;
143}
144
145function __decorate(decorators, target, key, desc) {
146 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
147 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
148 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
149 return c > 3 && r && Object.defineProperty(target, key, r), r;
150}
151
152function __param(paramIndex, decorator) {
153 return function (target, key) { decorator(target, key, paramIndex); }
154}
155
156function __metadata(metadataKey, metadataValue) {
157 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
158}
159
160function __awaiter(thisArg, _arguments, P, generator) {
161 return new (P || (P = Promise))(function (resolve, reject) {
162 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
163 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
164 function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
165 step((generator = generator.apply(thisArg, _arguments || [])).next());
166 });
167}
168
169function __generator(thisArg, body) {
170 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
171 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
172 function verb(n) { return function (v) { return step([n, v]); }; }
173 function step(op) {
174 if (f) throw new TypeError("Generator is already executing.");
175 while (_) try {
176 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
177 if (y = 0, t) op = [op[0] & 2, t.value];
178 switch (op[0]) {
179 case 0: case 1: t = op; break;
180 case 4: _.label++; return { value: op[1], done: false };
181 case 5: _.label++; y = op[1]; op = [0]; continue;
182 case 7: op = _.ops.pop(); _.trys.pop(); continue;
183 default:
184 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
185 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
186 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
187 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
188 if (t[2]) _.ops.pop();
189 _.trys.pop(); continue;
190 }
191 op = body.call(thisArg, _);
192 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
193 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
194 }
195}
196
197function __exportStar(m, exports) {
198 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
199}
200
201function __values(o) {
202 var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
203 if (m) return m.call(o);
204 return {
205 next: function () {
206 if (o && i >= o.length) o = void 0;
207 return { value: o && o[i++], done: !o };
208 }
209 };
210}
211
212function __read(o, n) {
213 var m = typeof Symbol === "function" && o[Symbol.iterator];
214 if (!m) return o;
215 var i = m.call(o), r, ar = [], e;
216 try {
217 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
218 }
219 catch (error) { e = { error: error }; }
220 finally {
221 try {
222 if (r && !r.done && (m = i["return"])) m.call(i);
223 }
224 finally { if (e) throw e.error; }
225 }
226 return ar;
227}
228
229function __spread() {
230 for (var ar = [], i = 0; i < arguments.length; i++)
231 ar = ar.concat(__read(arguments[i]));
232 return ar;
233}
234
235function __await(v) {
236 return this instanceof __await ? (this.v = v, this) : new __await(v);
237}
238
239function __asyncGenerator(thisArg, _arguments, generator) {
240 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
241 var g = generator.apply(thisArg, _arguments || []), i, q = [];
242 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
243 function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
244 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
245 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
246 function fulfill(value) { resume("next", value); }
247 function reject(value) { resume("throw", value); }
248 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
249}
250
251function __asyncDelegator(o) {
252 var i, p;
253 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
254 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
255}
256
257function __asyncValues(o) {
258 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
259 var m = o[Symbol.asyncIterator], i;
260 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
261 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
262 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
263}
264
265function __makeTemplateObject(cooked, raw) {
266 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
267 return cooked;
268};
269
270function __importStar(mod) {
271 if (mod && mod.__esModule) return mod;
272 var result = {};
273 if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
274 result.default = mod;
275 return result;
276}
277
278function __importDefault(mod) {
279 return (mod && mod.__esModule) ? mod : { default: mod };
280}
281
282
283/***/ }),
284/* 1 */
285/***/ (function(module, exports) {
286
287module.exports = require("path");
288
289/***/ }),
290/* 2 */
291/***/ (function(module, exports, __webpack_require__) {
292
293"use strict";
294
295
296exports.__esModule = true;
297
298var _promise = __webpack_require__(7);
299
300var _promise2 = _interopRequireDefault(_promise);
301
302function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
303
304exports.default = function (fn) {
305 return function () {
306 var gen = fn.apply(this, arguments);
307 return new _promise2.default(function (resolve, reject) {
308 function step(key, arg) {
309 try {
310 var info = gen[key](arg);
311 var value = info.value;
312 } catch (error) {
313 reject(error);
314 return;
315 }
316
317 if (info.done) {
318 resolve(value);
319 } else {
320 return _promise2.default.resolve(value).then(function (value) {
321 step("next", value);
322 }, function (err) {
323 step("throw", err);
324 });
325 }
326 }
327
328 return step("next");
329 });
330 };
331};
332
333/***/ }),
334/* 3 */
335/***/ (function(module, exports, __webpack_require__) {
336
337"use strict";
338
339
340exports.__esModule = true;
341
342exports.default = function (instance, Constructor) {
343 if (!(instance instanceof Constructor)) {
344 throw new TypeError("Cannot call a class as a function");
345 }
346};
347
348/***/ }),
349/* 4 */
350/***/ (function(module, exports, __webpack_require__) {
351
352module.exports = { "default": __webpack_require__(591), __esModule: true };
353
354/***/ }),
355/* 5 */
356/***/ (function(module, __webpack_exports__, __webpack_require__) {
357
358"use strict";
359/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscriber; });
360/* unused harmony export SafeSubscriber */
361/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
362/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isFunction__ = __webpack_require__(142);
363/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observer__ = __webpack_require__(390);
364/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(31);
365/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__ = __webpack_require__(261);
366/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config__ = __webpack_require__(176);
367/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_hostReportError__ = __webpack_require__(263);
368/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */
369
370
371
372
373
374
375
376var Subscriber = /*@__PURE__*/ (function (_super) {
377 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Subscriber, _super);
378 function Subscriber(destinationOrNext, error, complete) {
379 var _this = _super.call(this) || this;
380 _this.syncErrorValue = null;
381 _this.syncErrorThrown = false;
382 _this.syncErrorThrowable = false;
383 _this.isStopped = false;
384 _this._parentSubscription = null;
385 switch (arguments.length) {
386 case 0:
387 _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */];
388 break;
389 case 1:
390 if (!destinationOrNext) {
391 _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */];
392 break;
393 }
394 if (typeof destinationOrNext === 'object') {
395 if (destinationOrNext instanceof Subscriber) {
396 _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
397 _this.destination = destinationOrNext;
398 destinationOrNext.add(_this);
399 }
400 else {
401 _this.syncErrorThrowable = true;
402 _this.destination = new SafeSubscriber(_this, destinationOrNext);
403 }
404 break;
405 }
406 default:
407 _this.syncErrorThrowable = true;
408 _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
409 break;
410 }
411 return _this;
412 }
413 Subscriber.prototype[__WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__["a" /* rxSubscriber */]] = function () { return this; };
414 Subscriber.create = function (next, error, complete) {
415 var subscriber = new Subscriber(next, error, complete);
416 subscriber.syncErrorThrowable = false;
417 return subscriber;
418 };
419 Subscriber.prototype.next = function (value) {
420 if (!this.isStopped) {
421 this._next(value);
422 }
423 };
424 Subscriber.prototype.error = function (err) {
425 if (!this.isStopped) {
426 this.isStopped = true;
427 this._error(err);
428 }
429 };
430 Subscriber.prototype.complete = function () {
431 if (!this.isStopped) {
432 this.isStopped = true;
433 this._complete();
434 }
435 };
436 Subscriber.prototype.unsubscribe = function () {
437 if (this.closed) {
438 return;
439 }
440 this.isStopped = true;
441 _super.prototype.unsubscribe.call(this);
442 };
443 Subscriber.prototype._next = function (value) {
444 this.destination.next(value);
445 };
446 Subscriber.prototype._error = function (err) {
447 this.destination.error(err);
448 this.unsubscribe();
449 };
450 Subscriber.prototype._complete = function () {
451 this.destination.complete();
452 this.unsubscribe();
453 };
454 Subscriber.prototype._unsubscribeAndRecycle = function () {
455 var _a = this, _parent = _a._parent, _parents = _a._parents;
456 this._parent = null;
457 this._parents = null;
458 this.unsubscribe();
459 this.closed = false;
460 this.isStopped = false;
461 this._parent = _parent;
462 this._parents = _parents;
463 this._parentSubscription = null;
464 return this;
465 };
466 return Subscriber;
467}(__WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */]));
468
469var SafeSubscriber = /*@__PURE__*/ (function (_super) {
470 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SafeSubscriber, _super);
471 function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
472 var _this = _super.call(this) || this;
473 _this._parentSubscriber = _parentSubscriber;
474 var next;
475 var context = _this;
476 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(observerOrNext)) {
477 next = observerOrNext;
478 }
479 else if (observerOrNext) {
480 next = observerOrNext.next;
481 error = observerOrNext.error;
482 complete = observerOrNext.complete;
483 if (observerOrNext !== __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]) {
484 context = Object.create(observerOrNext);
485 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(context.unsubscribe)) {
486 _this.add(context.unsubscribe.bind(context));
487 }
488 context.unsubscribe = _this.unsubscribe.bind(_this);
489 }
490 }
491 _this._context = context;
492 _this._next = next;
493 _this._error = error;
494 _this._complete = complete;
495 return _this;
496 }
497 SafeSubscriber.prototype.next = function (value) {
498 if (!this.isStopped && this._next) {
499 var _parentSubscriber = this._parentSubscriber;
500 if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
501 this.__tryOrUnsub(this._next, value);
502 }
503 else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
504 this.unsubscribe();
505 }
506 }
507 };
508 SafeSubscriber.prototype.error = function (err) {
509 if (!this.isStopped) {
510 var _parentSubscriber = this._parentSubscriber;
511 var useDeprecatedSynchronousErrorHandling = __WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling;
512 if (this._error) {
513 if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
514 this.__tryOrUnsub(this._error, err);
515 this.unsubscribe();
516 }
517 else {
518 this.__tryOrSetError(_parentSubscriber, this._error, err);
519 this.unsubscribe();
520 }
521 }
522 else if (!_parentSubscriber.syncErrorThrowable) {
523 this.unsubscribe();
524 if (useDeprecatedSynchronousErrorHandling) {
525 throw err;
526 }
527 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err);
528 }
529 else {
530 if (useDeprecatedSynchronousErrorHandling) {
531 _parentSubscriber.syncErrorValue = err;
532 _parentSubscriber.syncErrorThrown = true;
533 }
534 else {
535 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err);
536 }
537 this.unsubscribe();
538 }
539 }
540 };
541 SafeSubscriber.prototype.complete = function () {
542 var _this = this;
543 if (!this.isStopped) {
544 var _parentSubscriber = this._parentSubscriber;
545 if (this._complete) {
546 var wrappedComplete = function () { return _this._complete.call(_this._context); };
547 if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
548 this.__tryOrUnsub(wrappedComplete);
549 this.unsubscribe();
550 }
551 else {
552 this.__tryOrSetError(_parentSubscriber, wrappedComplete);
553 this.unsubscribe();
554 }
555 }
556 else {
557 this.unsubscribe();
558 }
559 }
560 };
561 SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
562 try {
563 fn.call(this._context, value);
564 }
565 catch (err) {
566 this.unsubscribe();
567 if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
568 throw err;
569 }
570 else {
571 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err);
572 }
573 }
574 };
575 SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
576 if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
577 throw new Error('bad call');
578 }
579 try {
580 fn.call(this._context, value);
581 }
582 catch (err) {
583 if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
584 parent.syncErrorValue = err;
585 parent.syncErrorThrown = true;
586 return true;
587 }
588 else {
589 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err);
590 return true;
591 }
592 }
593 return false;
594 };
595 SafeSubscriber.prototype._unsubscribe = function () {
596 var _parentSubscriber = this._parentSubscriber;
597 this._context = null;
598 this._parentSubscriber = null;
599 _parentSubscriber.unsubscribe();
600 };
601 return SafeSubscriber;
602}(Subscriber));
603
604//# sourceMappingURL=Subscriber.js.map
605
606
607/***/ }),
608/* 6 */
609/***/ (function(module, exports, __webpack_require__) {
610
611"use strict";
612
613
614Object.defineProperty(exports, "__esModule", {
615 value: true
616});
617exports.OneTimePasswordError = exports.ResponseError = exports.ProcessTermError = exports.SecurityError = exports.ProcessSpawnError = exports.MessageError = undefined;
618
619var _create;
620
621function _load_create() {
622 return _create = _interopRequireDefault(__webpack_require__(210));
623}
624
625var _getPrototypeOf;
626
627function _load_getPrototypeOf() {
628 return _getPrototypeOf = _interopRequireDefault(__webpack_require__(550));
629}
630
631var _setPrototypeOf;
632
633function _load_setPrototypeOf() {
634 return _setPrototypeOf = _interopRequireDefault(__webpack_require__(211));
635}
636
637var _from;
638
639function _load_from() {
640 return _from = _interopRequireDefault(__webpack_require__(53));
641}
642
643var _construct;
644
645function _load_construct() {
646 return _construct = _interopRequireDefault(__webpack_require__(552));
647}
648
649var _classCallCheck2;
650
651function _load_classCallCheck() {
652 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
653}
654
655var _possibleConstructorReturn2;
656
657function _load_possibleConstructorReturn() {
658 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
659}
660
661var _inherits2;
662
663function _load_inherits() {
664 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
665}
666
667function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
668
669function _extendableBuiltin5(cls) {
670 function ExtendableBuiltin() {
671 var instance = (0, (_construct || _load_construct()).default)(cls, (0, (_from || _load_from()).default)(arguments));
672 (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(instance, (0, (_getPrototypeOf || _load_getPrototypeOf()).default)(this));
673 return instance;
674 }
675
676 ExtendableBuiltin.prototype = (0, (_create || _load_create()).default)(cls.prototype, {
677 constructor: {
678 value: cls,
679 enumerable: false,
680 writable: true,
681 configurable: true
682 }
683 });
684
685 if ((_setPrototypeOf || _load_setPrototypeOf()).default) {
686 (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(ExtendableBuiltin, cls);
687 } else {
688 ExtendableBuiltin.__proto__ = cls;
689 }
690
691 return ExtendableBuiltin;
692}
693
694function _extendableBuiltin3(cls) {
695 function ExtendableBuiltin() {
696 var instance = (0, (_construct || _load_construct()).default)(cls, (0, (_from || _load_from()).default)(arguments));
697 (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(instance, (0, (_getPrototypeOf || _load_getPrototypeOf()).default)(this));
698 return instance;
699 }
700
701 ExtendableBuiltin.prototype = (0, (_create || _load_create()).default)(cls.prototype, {
702 constructor: {
703 value: cls,
704 enumerable: false,
705 writable: true,
706 configurable: true
707 }
708 });
709
710 if ((_setPrototypeOf || _load_setPrototypeOf()).default) {
711 (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(ExtendableBuiltin, cls);
712 } else {
713 ExtendableBuiltin.__proto__ = cls;
714 }
715
716 return ExtendableBuiltin;
717}
718
719function _extendableBuiltin(cls) {
720 function ExtendableBuiltin() {
721 var instance = (0, (_construct || _load_construct()).default)(cls, (0, (_from || _load_from()).default)(arguments));
722 (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(instance, (0, (_getPrototypeOf || _load_getPrototypeOf()).default)(this));
723 return instance;
724 }
725
726 ExtendableBuiltin.prototype = (0, (_create || _load_create()).default)(cls.prototype, {
727 constructor: {
728 value: cls,
729 enumerable: false,
730 writable: true,
731 configurable: true
732 }
733 });
734
735 if ((_setPrototypeOf || _load_setPrototypeOf()).default) {
736 (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(ExtendableBuiltin, cls);
737 } else {
738 ExtendableBuiltin.__proto__ = cls;
739 }
740
741 return ExtendableBuiltin;
742}
743
744var MessageError = exports.MessageError = function (_extendableBuiltin2) {
745 (0, (_inherits2 || _load_inherits()).default)(MessageError, _extendableBuiltin2);
746
747 function MessageError(msg, code) {
748 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, MessageError);
749
750 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _extendableBuiltin2.call(this, msg));
751
752 _this.code = code;
753 return _this;
754 }
755
756 return MessageError;
757}(_extendableBuiltin(Error));
758
759var ProcessSpawnError = exports.ProcessSpawnError = function (_MessageError) {
760 (0, (_inherits2 || _load_inherits()).default)(ProcessSpawnError, _MessageError);
761
762 function ProcessSpawnError(msg, code, process) {
763 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ProcessSpawnError);
764
765 var _this2 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _MessageError.call(this, msg, code));
766
767 _this2.process = process;
768 return _this2;
769 }
770
771 return ProcessSpawnError;
772}(MessageError);
773
774var SecurityError = exports.SecurityError = function (_MessageError2) {
775 (0, (_inherits2 || _load_inherits()).default)(SecurityError, _MessageError2);
776
777 function SecurityError() {
778 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, SecurityError);
779 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _MessageError2.apply(this, arguments));
780 }
781
782 return SecurityError;
783}(MessageError);
784
785var ProcessTermError = exports.ProcessTermError = function (_MessageError3) {
786 (0, (_inherits2 || _load_inherits()).default)(ProcessTermError, _MessageError3);
787
788 function ProcessTermError() {
789 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ProcessTermError);
790 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _MessageError3.apply(this, arguments));
791 }
792
793 return ProcessTermError;
794}(MessageError);
795
796var ResponseError = exports.ResponseError = function (_extendableBuiltin4) {
797 (0, (_inherits2 || _load_inherits()).default)(ResponseError, _extendableBuiltin4);
798
799 function ResponseError(msg, responseCode) {
800 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ResponseError);
801
802 var _this5 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _extendableBuiltin4.call(this, msg));
803
804 _this5.responseCode = responseCode;
805 return _this5;
806 }
807
808 return ResponseError;
809}(_extendableBuiltin3(Error));
810
811var OneTimePasswordError = exports.OneTimePasswordError = function (_extendableBuiltin6) {
812 (0, (_inherits2 || _load_inherits()).default)(OneTimePasswordError, _extendableBuiltin6);
813
814 function OneTimePasswordError() {
815 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, OneTimePasswordError);
816 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _extendableBuiltin6.apply(this, arguments));
817 }
818
819 return OneTimePasswordError;
820}(_extendableBuiltin5(Error));
821
822/***/ }),
823/* 7 */
824/***/ (function(module, exports, __webpack_require__) {
825
826module.exports = { "default": __webpack_require__(600), __esModule: true };
827
828/***/ }),
829/* 8 */
830/***/ (function(module, exports, __webpack_require__) {
831
832"use strict";
833
834
835Object.defineProperty(exports, "__esModule", {
836 value: true
837});
838exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.makeTempDir = exports.hardlinksWork = exports.writeFilePreservingEol = exports.getFileSizeOnDisk = exports.walk = exports.symlink = exports.find = exports.readJsonAndFile = exports.readJson = exports.readFileAny = exports.hardlinkBulk = exports.copyBulk = exports.unlink = exports.glob = exports.link = exports.chmod = exports.lstat = exports.exists = exports.mkdirp = exports.stat = exports.access = exports.rename = exports.readdir = exports.realpath = exports.readlink = exports.writeFile = exports.open = exports.readFileBuffer = exports.lockQueue = exports.constants = undefined;
839
840var _map;
841
842function _load_map() {
843 return _map = _interopRequireDefault(__webpack_require__(42));
844}
845
846var _getIterator2;
847
848function _load_getIterator() {
849 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
850}
851
852var _promise;
853
854function _load_promise() {
855 return _promise = _interopRequireDefault(__webpack_require__(7));
856}
857
858var _set;
859
860function _load_set() {
861 return _set = _interopRequireDefault(__webpack_require__(16));
862}
863
864var _asyncToGenerator2;
865
866function _load_asyncToGenerator() {
867 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
868}
869
870var buildActionsForCopy = function () {
871 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) {
872
873 //
874 var build = function () {
875 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
876 var src = data.src,
877 dest = data.dest,
878 type = data.type;
879
880 var onFresh = data.onFresh || noop;
881 var onDone = data.onDone || noop;
882
883 // TODO https://github.com/yarnpkg/yarn/issues/3751
884 // related to bundled dependencies handling
885 if (files.has(dest.toLowerCase())) {
886 reporter.verbose(`The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy`);
887 } else {
888 files.add(dest.toLowerCase());
889 }
890
891 if (type === 'symlink') {
892 yield mkdirp((_path2 || _load_path()).default.dirname(dest));
893 onFresh();
894 actions.symlink.push({
895 dest,
896 linkname: src
897 });
898 onDone();
899 return;
900 }
901
902 if (events.ignoreBasenames.indexOf((_path2 || _load_path()).default.basename(src)) >= 0) {
903 // ignored file
904 return;
905 }
906
907 var srcStat = yield lstat(src);
908 var srcFiles = void 0;
909
910 if (srcStat.isDirectory()) {
911 srcFiles = yield readdir(src);
912 }
913
914 var destStat = void 0;
915 try {
916 // try accessing the destination
917 destStat = yield lstat(dest);
918 } catch (e) {
919 // proceed if destination doesn't exist, otherwise error
920 if (e.code !== 'ENOENT') {
921 throw e;
922 }
923 }
924
925 // if destination exists
926 if (destStat) {
927 var bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink();
928 var bothFolders = srcStat.isDirectory() && destStat.isDirectory();
929 var bothFiles = srcStat.isFile() && destStat.isFile();
930
931 // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving
932 // us modes that aren't valid. investigate this, it's generally safe to proceed.
933
934 /* if (srcStat.mode !== destStat.mode) {
935 try {
936 await access(dest, srcStat.mode);
937 } catch (err) {}
938 } */
939
940 if (bothFiles && artifactFiles.has(dest)) {
941 // this file gets changed during build, likely by a custom install script. Don't bother checking it.
942 onDone();
943 reporter.verbose(reporter.lang('verboseFileSkipArtifact', src));
944 return;
945 }
946
947 if (bothFiles && srcStat.size === destStat.size && (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)(srcStat.mtime, destStat.mtime)) {
948 // we can safely assume this is the same file
949 onDone();
950 reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.size, +srcStat.mtime));
951 return;
952 }
953
954 if (bothSymlinks) {
955 var srcReallink = yield readlink(src);
956 if (srcReallink === (yield readlink(dest))) {
957 // if both symlinks are the same then we can continue on
958 onDone();
959 reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink));
960 return;
961 }
962 }
963
964 if (bothFolders) {
965 // mark files that aren't in this folder as possibly extraneous
966 var destFiles = yield readdir(dest);
967 invariant(srcFiles, 'src files not initialised');
968
969 for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
970 var _ref6;
971
972 if (_isArray4) {
973 if (_i4 >= _iterator4.length) break;
974 _ref6 = _iterator4[_i4++];
975 } else {
976 _i4 = _iterator4.next();
977 if (_i4.done) break;
978 _ref6 = _i4.value;
979 }
980
981 var _file2 = _ref6;
982
983 if (srcFiles.indexOf(_file2) < 0) {
984 var _loc = (_path2 || _load_path()).default.join(dest, _file2);
985 possibleExtraneous.add(_loc);
986
987 if ((yield lstat(_loc)).isDirectory()) {
988 for (var _iterator5 = yield readdir(_loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
989 var _ref7;
990
991 if (_isArray5) {
992 if (_i5 >= _iterator5.length) break;
993 _ref7 = _iterator5[_i5++];
994 } else {
995 _i5 = _iterator5.next();
996 if (_i5.done) break;
997 _ref7 = _i5.value;
998 }
999
1000 var _file3 = _ref7;
1001
1002 possibleExtraneous.add((_path2 || _load_path()).default.join(_loc, _file3));
1003 }
1004 }
1005 }
1006 }
1007 }
1008 }
1009
1010 if (destStat && destStat.isSymbolicLink()) {
1011 yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest);
1012 destStat = null;
1013 }
1014
1015 if (srcStat.isSymbolicLink()) {
1016 onFresh();
1017 var _linkname = yield readlink(src);
1018 actions.symlink.push({
1019 dest,
1020 linkname: _linkname
1021 });
1022 onDone();
1023 } else if (srcStat.isDirectory()) {
1024 yield* function* () {
1025 if (!destStat) {
1026 reporter.verbose(reporter.lang('verboseFileFolder', dest));
1027 yield mkdirp(dest);
1028 }
1029
1030 var destParts = dest.split((_path2 || _load_path()).default.sep);
1031 while (destParts.length) {
1032 files.add(destParts.join((_path2 || _load_path()).default.sep).toLowerCase());
1033 destParts.pop();
1034 }
1035
1036 // push all files to queue
1037 invariant(srcFiles, 'src files not initialised');
1038 var remaining = srcFiles.length;
1039 if (!remaining) {
1040 onDone();
1041 }
1042 for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
1043 var _ref8;
1044
1045 if (_isArray6) {
1046 if (_i6 >= _iterator6.length) break;
1047 _ref8 = _iterator6[_i6++];
1048 } else {
1049 _i6 = _iterator6.next();
1050 if (_i6.done) break;
1051 _ref8 = _i6.value;
1052 }
1053
1054 var _file4 = _ref8;
1055
1056 queue.push({
1057 dest: (_path2 || _load_path()).default.join(dest, _file4),
1058 onFresh,
1059 onDone: function (_onDone) {
1060 function onDone() {
1061 return _onDone.apply(this, arguments);
1062 }
1063
1064 onDone.toString = function () {
1065 return _onDone.toString();
1066 };
1067
1068 return onDone;
1069 }(function () {
1070 if (--remaining === 0) {
1071 onDone();
1072 }
1073 }),
1074 src: (_path2 || _load_path()).default.join(src, _file4)
1075 });
1076 }
1077 }();
1078 } else if (srcStat.isFile()) {
1079 onFresh();
1080 actions.file.push({
1081 src,
1082 dest,
1083 atime: srcStat.atime,
1084 mtime: srcStat.mtime,
1085 mode: srcStat.mode
1086 });
1087 onDone();
1088 } else {
1089 throw new Error(`unsure how to copy this: ${src}`);
1090 }
1091 });
1092
1093 return function build(_x5) {
1094 return _ref5.apply(this, arguments);
1095 };
1096 }();
1097
1098 var artifactFiles = new (_set || _load_set()).default(events.artifactFiles || []);
1099 var files = new (_set || _load_set()).default();
1100
1101 // initialise events
1102
1103 var _loop = function _loop(item) {
1104 var onDone = item.onDone;
1105 item.onDone = function () {
1106 events.onProgress(item.dest);
1107 if (onDone) {
1108 onDone();
1109 }
1110 };
1111 };
1112
1113 for (var _iterator = queue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
1114 var _ref2;
1115
1116 if (_isArray) {
1117 if (_i >= _iterator.length) break;
1118 _ref2 = _iterator[_i++];
1119 } else {
1120 _i = _iterator.next();
1121 if (_i.done) break;
1122 _ref2 = _i.value;
1123 }
1124
1125 var item = _ref2;
1126
1127 _loop(item);
1128 }
1129 events.onStart(queue.length);
1130
1131 // start building actions
1132 var actions = {
1133 file: [],
1134 symlink: [],
1135 link: []
1136 };
1137
1138 // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items
1139 // at a time due to the requirement to push items onto the queue
1140 while (queue.length) {
1141 var items = queue.splice(0, CONCURRENT_QUEUE_ITEMS);
1142 yield (_promise || _load_promise()).default.all(items.map(build));
1143 }
1144
1145 // simulate the existence of some files to prevent considering them extraneous
1146 for (var _iterator2 = artifactFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
1147 var _ref3;
1148
1149 if (_isArray2) {
1150 if (_i2 >= _iterator2.length) break;
1151 _ref3 = _iterator2[_i2++];
1152 } else {
1153 _i2 = _iterator2.next();
1154 if (_i2.done) break;
1155 _ref3 = _i2.value;
1156 }
1157
1158 var _file = _ref3;
1159
1160 if (possibleExtraneous.has(_file)) {
1161 reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', _file));
1162 possibleExtraneous.delete(_file);
1163 }
1164 }
1165
1166 for (var _iterator3 = possibleExtraneous, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
1167 var _ref4;
1168
1169 if (_isArray3) {
1170 if (_i3 >= _iterator3.length) break;
1171 _ref4 = _iterator3[_i3++];
1172 } else {
1173 _i3 = _iterator3.next();
1174 if (_i3.done) break;
1175 _ref4 = _i3.value;
1176 }
1177
1178 var loc = _ref4;
1179
1180 if (files.has(loc.toLowerCase())) {
1181 possibleExtraneous.delete(loc);
1182 }
1183 }
1184
1185 return actions;
1186 });
1187
1188 return function buildActionsForCopy(_x, _x2, _x3, _x4) {
1189 return _ref.apply(this, arguments);
1190 };
1191}();
1192
1193var buildActionsForHardlink = function () {
1194 var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) {
1195
1196 //
1197 var build = function () {
1198 var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
1199 var src = data.src,
1200 dest = data.dest;
1201
1202 var onFresh = data.onFresh || noop;
1203 var onDone = data.onDone || noop;
1204 if (files.has(dest.toLowerCase())) {
1205 // Fixes issue https://github.com/yarnpkg/yarn/issues/2734
1206 // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1,
1207 // package-linker passes that modules A1 and B1 need to be hardlinked,
1208 // the recursive linking algorithm of A1 ends up scheduling files in B1 to be linked twice which will case
1209 // an exception.
1210 onDone();
1211 return;
1212 }
1213 files.add(dest.toLowerCase());
1214
1215 if (events.ignoreBasenames.indexOf((_path2 || _load_path()).default.basename(src)) >= 0) {
1216 // ignored file
1217 return;
1218 }
1219
1220 var srcStat = yield lstat(src);
1221 var srcFiles = void 0;
1222
1223 if (srcStat.isDirectory()) {
1224 srcFiles = yield readdir(src);
1225 }
1226
1227 var destExists = yield exists(dest);
1228 if (destExists) {
1229 var destStat = yield lstat(dest);
1230
1231 var bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink();
1232 var bothFolders = srcStat.isDirectory() && destStat.isDirectory();
1233 var bothFiles = srcStat.isFile() && destStat.isFile();
1234
1235 if (srcStat.mode !== destStat.mode) {
1236 try {
1237 yield access(dest, srcStat.mode);
1238 } catch (err) {
1239 // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving
1240 // us modes that aren't valid. investigate this, it's generally safe to proceed.
1241 reporter.verbose(err);
1242 }
1243 }
1244
1245 if (bothFiles && artifactFiles.has(dest)) {
1246 // this file gets changed during build, likely by a custom install script. Don't bother checking it.
1247 onDone();
1248 reporter.verbose(reporter.lang('verboseFileSkipArtifact', src));
1249 return;
1250 }
1251
1252 // correct hardlink
1253 if (bothFiles && srcStat.ino !== null && srcStat.ino === destStat.ino) {
1254 onDone();
1255 reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.ino));
1256 return;
1257 }
1258
1259 if (bothSymlinks) {
1260 var srcReallink = yield readlink(src);
1261 if (srcReallink === (yield readlink(dest))) {
1262 // if both symlinks are the same then we can continue on
1263 onDone();
1264 reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink));
1265 return;
1266 }
1267 }
1268
1269 if (bothFolders) {
1270 // mark files that aren't in this folder as possibly extraneous
1271 var destFiles = yield readdir(dest);
1272 invariant(srcFiles, 'src files not initialised');
1273
1274 for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
1275 var _ref14;
1276
1277 if (_isArray10) {
1278 if (_i10 >= _iterator10.length) break;
1279 _ref14 = _iterator10[_i10++];
1280 } else {
1281 _i10 = _iterator10.next();
1282 if (_i10.done) break;
1283 _ref14 = _i10.value;
1284 }
1285
1286 var _file6 = _ref14;
1287
1288 if (srcFiles.indexOf(_file6) < 0) {
1289 var _loc2 = (_path2 || _load_path()).default.join(dest, _file6);
1290 possibleExtraneous.add(_loc2);
1291
1292 if ((yield lstat(_loc2)).isDirectory()) {
1293 for (var _iterator11 = yield readdir(_loc2), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
1294 var _ref15;
1295
1296 if (_isArray11) {
1297 if (_i11 >= _iterator11.length) break;
1298 _ref15 = _iterator11[_i11++];
1299 } else {
1300 _i11 = _iterator11.next();
1301 if (_i11.done) break;
1302 _ref15 = _i11.value;
1303 }
1304
1305 var _file7 = _ref15;
1306
1307 possibleExtraneous.add((_path2 || _load_path()).default.join(_loc2, _file7));
1308 }
1309 }
1310 }
1311 }
1312 }
1313 }
1314
1315 if (srcStat.isSymbolicLink()) {
1316 onFresh();
1317 var _linkname2 = yield readlink(src);
1318 actions.symlink.push({
1319 dest,
1320 linkname: _linkname2
1321 });
1322 onDone();
1323 } else if (srcStat.isDirectory()) {
1324 yield* function* () {
1325 reporter.verbose(reporter.lang('verboseFileFolder', dest));
1326 yield mkdirp(dest);
1327
1328 var destParts = dest.split((_path2 || _load_path()).default.sep);
1329 while (destParts.length) {
1330 files.add(destParts.join((_path2 || _load_path()).default.sep).toLowerCase());
1331 destParts.pop();
1332 }
1333
1334 // push all files to queue
1335 invariant(srcFiles, 'src files not initialised');
1336 var remaining = srcFiles.length;
1337 if (!remaining) {
1338 onDone();
1339 }
1340 for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) {
1341 var _ref16;
1342
1343 if (_isArray12) {
1344 if (_i12 >= _iterator12.length) break;
1345 _ref16 = _iterator12[_i12++];
1346 } else {
1347 _i12 = _iterator12.next();
1348 if (_i12.done) break;
1349 _ref16 = _i12.value;
1350 }
1351
1352 var _file8 = _ref16;
1353
1354 queue.push({
1355 onFresh,
1356 src: (_path2 || _load_path()).default.join(src, _file8),
1357 dest: (_path2 || _load_path()).default.join(dest, _file8),
1358 onDone: function (_onDone2) {
1359 function onDone() {
1360 return _onDone2.apply(this, arguments);
1361 }
1362
1363 onDone.toString = function () {
1364 return _onDone2.toString();
1365 };
1366
1367 return onDone;
1368 }(function () {
1369 if (--remaining === 0) {
1370 onDone();
1371 }
1372 })
1373 });
1374 }
1375 }();
1376 } else if (srcStat.isFile()) {
1377 onFresh();
1378 actions.link.push({
1379 src,
1380 dest,
1381 removeDest: destExists
1382 });
1383 onDone();
1384 } else {
1385 throw new Error(`unsure how to copy this: ${src}`);
1386 }
1387 });
1388
1389 return function build(_x10) {
1390 return _ref13.apply(this, arguments);
1391 };
1392 }();
1393
1394 var artifactFiles = new (_set || _load_set()).default(events.artifactFiles || []);
1395 var files = new (_set || _load_set()).default();
1396
1397 // initialise events
1398
1399 var _loop2 = function _loop2(item) {
1400 var onDone = item.onDone || noop;
1401 item.onDone = function () {
1402 events.onProgress(item.dest);
1403 onDone();
1404 };
1405 };
1406
1407 for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
1408 var _ref10;
1409
1410 if (_isArray7) {
1411 if (_i7 >= _iterator7.length) break;
1412 _ref10 = _iterator7[_i7++];
1413 } else {
1414 _i7 = _iterator7.next();
1415 if (_i7.done) break;
1416 _ref10 = _i7.value;
1417 }
1418
1419 var item = _ref10;
1420
1421 _loop2(item);
1422 }
1423 events.onStart(queue.length);
1424
1425 // start building actions
1426 var actions = {
1427 file: [],
1428 symlink: [],
1429 link: []
1430 };
1431
1432 // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items
1433 // at a time due to the requirement to push items onto the queue
1434 while (queue.length) {
1435 var items = queue.splice(0, CONCURRENT_QUEUE_ITEMS);
1436 yield (_promise || _load_promise()).default.all(items.map(build));
1437 }
1438
1439 // simulate the existence of some files to prevent considering them extraneous
1440 for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
1441 var _ref11;
1442
1443 if (_isArray8) {
1444 if (_i8 >= _iterator8.length) break;
1445 _ref11 = _iterator8[_i8++];
1446 } else {
1447 _i8 = _iterator8.next();
1448 if (_i8.done) break;
1449 _ref11 = _i8.value;
1450 }
1451
1452 var _file5 = _ref11;
1453
1454 if (possibleExtraneous.has(_file5)) {
1455 reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', _file5));
1456 possibleExtraneous.delete(_file5);
1457 }
1458 }
1459
1460 for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
1461 var _ref12;
1462
1463 if (_isArray9) {
1464 if (_i9 >= _iterator9.length) break;
1465 _ref12 = _iterator9[_i9++];
1466 } else {
1467 _i9 = _iterator9.next();
1468 if (_i9.done) break;
1469 _ref12 = _i9.value;
1470 }
1471
1472 var loc = _ref12;
1473
1474 if (files.has(loc.toLowerCase())) {
1475 possibleExtraneous.delete(loc);
1476 }
1477 }
1478
1479 return actions;
1480 });
1481
1482 return function buildActionsForHardlink(_x6, _x7, _x8, _x9) {
1483 return _ref9.apply(this, arguments);
1484 };
1485}();
1486
1487var copyBulk = exports.copyBulk = function () {
1488 var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) {
1489 var events = {
1490 onStart: _events && _events.onStart || noop,
1491 onProgress: _events && _events.onProgress || noop,
1492 possibleExtraneous: _events ? _events.possibleExtraneous : new (_set || _load_set()).default(),
1493 ignoreBasenames: _events && _events.ignoreBasenames || [],
1494 artifactFiles: _events && _events.artifactFiles || []
1495 };
1496
1497 var actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter);
1498 events.onStart(actions.file.length + actions.symlink.length + actions.link.length);
1499
1500 var fileActions = actions.file;
1501
1502 var currentlyWriting = new (_map || _load_map()).default();
1503
1504 yield (_promise2 || _load_promise2()).queue(fileActions, function () {
1505 var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
1506 var writePromise = void 0;
1507 while (writePromise = currentlyWriting.get(data.dest)) {
1508 yield writePromise;
1509 }
1510
1511 reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest));
1512 var copier = (0, (_fsNormalized || _load_fsNormalized()).copyFile)(data, function () {
1513 return currentlyWriting.delete(data.dest);
1514 });
1515 currentlyWriting.set(data.dest, copier);
1516 events.onProgress(data.dest);
1517 return copier;
1518 });
1519
1520 return function (_x14) {
1521 return _ref18.apply(this, arguments);
1522 };
1523 }(), CONCURRENT_QUEUE_ITEMS);
1524
1525 // we need to copy symlinks last as they could reference files we were copying
1526 var symlinkActions = actions.symlink;
1527 yield (_promise2 || _load_promise2()).queue(symlinkActions, function (data) {
1528 var linkname = (_path2 || _load_path()).default.resolve((_path2 || _load_path()).default.dirname(data.dest), data.linkname);
1529 reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname));
1530 return symlink(linkname, data.dest);
1531 });
1532 });
1533
1534 return function copyBulk(_x11, _x12, _x13) {
1535 return _ref17.apply(this, arguments);
1536 };
1537}();
1538
1539var hardlinkBulk = exports.hardlinkBulk = function () {
1540 var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) {
1541 var events = {
1542 onStart: _events && _events.onStart || noop,
1543 onProgress: _events && _events.onProgress || noop,
1544 possibleExtraneous: _events ? _events.possibleExtraneous : new (_set || _load_set()).default(),
1545 artifactFiles: _events && _events.artifactFiles || [],
1546 ignoreBasenames: []
1547 };
1548
1549 var actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter);
1550 events.onStart(actions.file.length + actions.symlink.length + actions.link.length);
1551
1552 var fileActions = actions.link;
1553
1554 yield (_promise2 || _load_promise2()).queue(fileActions, function () {
1555 var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
1556 reporter.verbose(reporter.lang('verboseFileLink', data.src, data.dest));
1557 if (data.removeDest) {
1558 yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(data.dest);
1559 }
1560 yield link(data.src, data.dest);
1561 });
1562
1563 return function (_x18) {
1564 return _ref20.apply(this, arguments);
1565 };
1566 }(), CONCURRENT_QUEUE_ITEMS);
1567
1568 // we need to copy symlinks last as they could reference files we were copying
1569 var symlinkActions = actions.symlink;
1570 yield (_promise2 || _load_promise2()).queue(symlinkActions, function (data) {
1571 var linkname = (_path2 || _load_path()).default.resolve((_path2 || _load_path()).default.dirname(data.dest), data.linkname);
1572 reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname));
1573 return symlink(linkname, data.dest);
1574 });
1575 });
1576
1577 return function hardlinkBulk(_x15, _x16, _x17) {
1578 return _ref19.apply(this, arguments);
1579 };
1580}();
1581
1582var readFileAny = exports.readFileAny = function () {
1583 var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) {
1584 for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) {
1585 var _ref22;
1586
1587 if (_isArray13) {
1588 if (_i13 >= _iterator13.length) break;
1589 _ref22 = _iterator13[_i13++];
1590 } else {
1591 _i13 = _iterator13.next();
1592 if (_i13.done) break;
1593 _ref22 = _i13.value;
1594 }
1595
1596 var _file9 = _ref22;
1597
1598 if (yield exists(_file9)) {
1599 return readFile(_file9);
1600 }
1601 }
1602 return null;
1603 });
1604
1605 return function readFileAny(_x19) {
1606 return _ref21.apply(this, arguments);
1607 };
1608}();
1609
1610var readJson = exports.readJson = function () {
1611 var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
1612 return (yield readJsonAndFile(loc)).object;
1613 });
1614
1615 return function readJson(_x20) {
1616 return _ref23.apply(this, arguments);
1617 };
1618}();
1619
1620var readJsonAndFile = exports.readJsonAndFile = function () {
1621 var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
1622 var file = yield readFile(loc);
1623 try {
1624 return {
1625 object: (0, (_map2 || _load_map2()).default)(JSON.parse(stripBOM(file))),
1626 content: file
1627 };
1628 } catch (err) {
1629 err.message = `${loc}: ${err.message}`;
1630 throw err;
1631 }
1632 });
1633
1634 return function readJsonAndFile(_x21) {
1635 return _ref24.apply(this, arguments);
1636 };
1637}();
1638
1639var find = exports.find = function () {
1640 var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) {
1641 var parts = dir.split((_path2 || _load_path()).default.sep);
1642
1643 while (parts.length) {
1644 var loc = parts.concat(filename).join((_path2 || _load_path()).default.sep);
1645
1646 if (yield exists(loc)) {
1647 return loc;
1648 } else {
1649 parts.pop();
1650 }
1651 }
1652
1653 return false;
1654 });
1655
1656 return function find(_x22, _x23) {
1657 return _ref25.apply(this, arguments);
1658 };
1659}();
1660
1661var symlink = exports.symlink = function () {
1662 var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) {
1663 if (process.platform !== 'win32') {
1664 // use relative paths otherwise which will be retained if the directory is moved
1665 src = (_path2 || _load_path()).default.relative((_path2 || _load_path()).default.dirname(dest), src);
1666 // When path.relative returns an empty string for the current directory, we should instead use
1667 // '.', which is a valid fs.symlink target.
1668 src = src || '.';
1669 }
1670
1671 try {
1672 var stats = yield lstat(dest);
1673 if (stats.isSymbolicLink()) {
1674 var resolved = dest;
1675 if (resolved === src) {
1676 return;
1677 }
1678 }
1679 } catch (err) {
1680 if (err.code !== 'ENOENT') {
1681 throw err;
1682 }
1683 }
1684
1685 // We use rimraf for unlink which never throws an ENOENT on missing target
1686 yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest);
1687
1688 if (process.platform === 'win32') {
1689 // use directory junctions if possible on win32, this requires absolute paths
1690 yield fsSymlink(src, dest, 'junction');
1691 } else {
1692 yield fsSymlink(src, dest);
1693 }
1694 });
1695
1696 return function symlink(_x24, _x25) {
1697 return _ref26.apply(this, arguments);
1698 };
1699}();
1700
1701var walk = exports.walk = function () {
1702 var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir) {
1703 var ignoreBasenames = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_set || _load_set()).default();
1704
1705 var files = [];
1706
1707 var filenames = yield readdir(dir);
1708 if (ignoreBasenames.size) {
1709 filenames = filenames.filter(function (name) {
1710 return !ignoreBasenames.has(name);
1711 });
1712 }
1713
1714 for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) {
1715 var _ref28;
1716
1717 if (_isArray14) {
1718 if (_i14 >= _iterator14.length) break;
1719 _ref28 = _iterator14[_i14++];
1720 } else {
1721 _i14 = _iterator14.next();
1722 if (_i14.done) break;
1723 _ref28 = _i14.value;
1724 }
1725
1726 var name = _ref28;
1727
1728 var _relative = relativeDir ? (_path2 || _load_path()).default.join(relativeDir, name) : name;
1729 var loc = (_path2 || _load_path()).default.join(dir, name);
1730 var _stat = yield lstat(loc);
1731
1732 files.push({
1733 relative: _relative,
1734 basename: name,
1735 absolute: loc,
1736 mtime: +_stat.mtime
1737 });
1738
1739 if (_stat.isDirectory()) {
1740 files = files.concat((yield walk(loc, _relative, ignoreBasenames)));
1741 }
1742 }
1743
1744 return files;
1745 });
1746
1747 return function walk(_x26, _x27) {
1748 return _ref27.apply(this, arguments);
1749 };
1750}();
1751
1752var getFileSizeOnDisk = exports.getFileSizeOnDisk = function () {
1753 var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
1754 var stat = yield lstat(loc);
1755 var size = stat.size,
1756 blockSize = stat.blksize;
1757
1758
1759 return Math.ceil(size / blockSize) * blockSize;
1760 });
1761
1762 return function getFileSizeOnDisk(_x29) {
1763 return _ref29.apply(this, arguments);
1764 };
1765}();
1766
1767var getEolFromFile = function () {
1768 var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) {
1769 if (!(yield exists(path))) {
1770 return undefined;
1771 }
1772
1773 var buffer = yield readFileBuffer(path);
1774
1775 for (var i = 0; i < buffer.length; ++i) {
1776 if (buffer[i] === cr) {
1777 return '\r\n';
1778 }
1779 if (buffer[i] === lf) {
1780 return '\n';
1781 }
1782 }
1783 return undefined;
1784 });
1785
1786 return function getEolFromFile(_x30) {
1787 return _ref30.apply(this, arguments);
1788 };
1789}();
1790
1791var writeFilePreservingEol = exports.writeFilePreservingEol = function () {
1792 var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) {
1793 var eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL;
1794 if (eol !== '\n') {
1795 data = data.replace(/\n/g, eol);
1796 }
1797 yield writeFile(path, data);
1798 });
1799
1800 return function writeFilePreservingEol(_x31, _x32) {
1801 return _ref31.apply(this, arguments);
1802 };
1803}();
1804
1805var hardlinksWork = exports.hardlinksWork = function () {
1806 var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) {
1807 var filename = 'test-file' + Math.random();
1808 var file = (_path2 || _load_path()).default.join(dir, filename);
1809 var fileLink = (_path2 || _load_path()).default.join(dir, filename + '-link');
1810 try {
1811 yield writeFile(file, 'test');
1812 yield link(file, fileLink);
1813 } catch (err) {
1814 return false;
1815 } finally {
1816 yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file);
1817 yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink);
1818 }
1819 return true;
1820 });
1821
1822 return function hardlinksWork(_x33) {
1823 return _ref32.apply(this, arguments);
1824 };
1825}();
1826
1827// not a strict polyfill for Node's fs.mkdtemp
1828
1829
1830var makeTempDir = exports.makeTempDir = function () {
1831 var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) {
1832 var dir = (_path2 || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`);
1833 yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir);
1834 yield mkdirp(dir);
1835 return dir;
1836 });
1837
1838 return function makeTempDir(_x34) {
1839 return _ref33.apply(this, arguments);
1840 };
1841}();
1842
1843var readFirstAvailableStream = exports.readFirstAvailableStream = function () {
1844 var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) {
1845 for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) {
1846 var _ref35;
1847
1848 if (_isArray15) {
1849 if (_i15 >= _iterator15.length) break;
1850 _ref35 = _iterator15[_i15++];
1851 } else {
1852 _i15 = _iterator15.next();
1853 if (_i15.done) break;
1854 _ref35 = _i15.value;
1855 }
1856
1857 var _path = _ref35;
1858
1859 try {
1860 var fd = yield open(_path, 'r');
1861 return (_fs || _load_fs()).default.createReadStream(_path, { fd });
1862 } catch (err) {
1863 // Try the next one
1864 }
1865 }
1866 return null;
1867 });
1868
1869 return function readFirstAvailableStream(_x35) {
1870 return _ref34.apply(this, arguments);
1871 };
1872}();
1873
1874var getFirstSuitableFolder = exports.getFirstSuitableFolder = function () {
1875 var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) {
1876 var mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : constants.W_OK | constants.X_OK;
1877
1878 var result = {
1879 skipped: [],
1880 folder: null
1881 };
1882
1883 for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator16);;) {
1884 var _ref37;
1885
1886 if (_isArray16) {
1887 if (_i16 >= _iterator16.length) break;
1888 _ref37 = _iterator16[_i16++];
1889 } else {
1890 _i16 = _iterator16.next();
1891 if (_i16.done) break;
1892 _ref37 = _i16.value;
1893 }
1894
1895 var _folder = _ref37;
1896
1897 try {
1898 yield mkdirp(_folder);
1899 yield access(_folder, mode);
1900
1901 result.folder = _folder;
1902
1903 return result;
1904 } catch (error) {
1905 result.skipped.push({
1906 error,
1907 folder: _folder
1908 });
1909 }
1910 }
1911 return result;
1912 });
1913
1914 return function getFirstSuitableFolder(_x36) {
1915 return _ref36.apply(this, arguments);
1916 };
1917}();
1918
1919exports.copy = copy;
1920exports.readFile = readFile;
1921exports.readFileRaw = readFileRaw;
1922exports.normalizeOS = normalizeOS;
1923
1924var _fs;
1925
1926function _load_fs() {
1927 return _fs = _interopRequireDefault(__webpack_require__(12));
1928}
1929
1930var _glob;
1931
1932function _load_glob() {
1933 return _glob = _interopRequireDefault(__webpack_require__(234));
1934}
1935
1936var _os;
1937
1938function _load_os() {
1939 return _os = _interopRequireDefault(__webpack_require__(72));
1940}
1941
1942var _path2;
1943
1944function _load_path() {
1945 return _path2 = _interopRequireDefault(__webpack_require__(1));
1946}
1947
1948var _blockingQueue;
1949
1950function _load_blockingQueue() {
1951 return _blockingQueue = _interopRequireDefault(__webpack_require__(157));
1952}
1953
1954var _promise2;
1955
1956function _load_promise2() {
1957 return _promise2 = _interopRequireWildcard(__webpack_require__(86));
1958}
1959
1960var _promise3;
1961
1962function _load_promise3() {
1963 return _promise3 = __webpack_require__(86);
1964}
1965
1966var _map2;
1967
1968function _load_map2() {
1969 return _map2 = _interopRequireDefault(__webpack_require__(51));
1970}
1971
1972var _fsNormalized;
1973
1974function _load_fsNormalized() {
1975 return _fsNormalized = __webpack_require__(535);
1976}
1977
1978function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
1979
1980function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1981
1982var constants = exports.constants = typeof (_fs || _load_fs()).default.constants !== 'undefined' ? (_fs || _load_fs()).default.constants : {
1983 R_OK: (_fs || _load_fs()).default.R_OK,
1984 W_OK: (_fs || _load_fs()).default.W_OK,
1985 X_OK: (_fs || _load_fs()).default.X_OK
1986};
1987
1988var lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock');
1989
1990var readFileBuffer = exports.readFileBuffer = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readFile);
1991var open = exports.open = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.open);
1992var writeFile = exports.writeFile = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.writeFile);
1993var readlink = exports.readlink = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readlink);
1994var realpath = exports.realpath = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.realpath);
1995var readdir = exports.readdir = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.readdir);
1996var rename = exports.rename = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.rename);
1997var access = exports.access = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.access);
1998var stat = exports.stat = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.stat);
1999var mkdirp = exports.mkdirp = (0, (_promise3 || _load_promise3()).promisify)(__webpack_require__(241));
2000var exists = exports.exists = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.exists, true);
2001var lstat = exports.lstat = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.lstat);
2002var chmod = exports.chmod = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.chmod);
2003var link = exports.link = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.link);
2004var glob = exports.glob = (0, (_promise3 || _load_promise3()).promisify)((_glob || _load_glob()).default);
2005exports.unlink = (_fsNormalized || _load_fsNormalized()).unlink;
2006
2007// fs.copyFile uses the native file copying instructions on the system, performing much better
2008// than any JS-based solution and consumes fewer resources. Repeated testing to fine tune the
2009// concurrency level revealed 128 as the sweet spot on a quad-core, 16 CPU Intel system with SSD.
2010
2011var CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4;
2012
2013var fsSymlink = (0, (_promise3 || _load_promise3()).promisify)((_fs || _load_fs()).default.symlink);
2014var invariant = __webpack_require__(15);
2015var stripBOM = __webpack_require__(429);
2016
2017var noop = function noop() {};
2018
2019function copy(src, dest, reporter) {
2020 return copyBulk([{ src, dest }], reporter);
2021}
2022
2023function _readFile(loc, encoding) {
2024 return new (_promise || _load_promise()).default(function (resolve, reject) {
2025 (_fs || _load_fs()).default.readFile(loc, encoding, function (err, content) {
2026 if (err) {
2027 reject(err);
2028 } else {
2029 resolve(content);
2030 }
2031 });
2032 });
2033}
2034
2035function readFile(loc) {
2036 return _readFile(loc, 'utf8').then(normalizeOS);
2037}
2038
2039function readFileRaw(loc) {
2040 return _readFile(loc, 'binary');
2041}
2042
2043function normalizeOS(body) {
2044 return body.replace(/\r\n/g, '\n');
2045}
2046
2047var cr = '\r'.charCodeAt(0);
2048var lf = '\n'.charCodeAt(0);
2049
2050/***/ }),
2051/* 9 */
2052/***/ (function(module, exports) {
2053
2054module.exports = require("util");
2055
2056/***/ }),
2057/* 10 */
2058/***/ (function(module, exports, __webpack_require__) {
2059
2060"use strict";
2061
2062
2063exports.__esModule = true;
2064
2065var _setPrototypeOf = __webpack_require__(211);
2066
2067var _setPrototypeOf2 = _interopRequireDefault(_setPrototypeOf);
2068
2069var _create = __webpack_require__(210);
2070
2071var _create2 = _interopRequireDefault(_create);
2072
2073var _typeof2 = __webpack_require__(316);
2074
2075var _typeof3 = _interopRequireDefault(_typeof2);
2076
2077function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2078
2079exports.default = function (subClass, superClass) {
2080 if (typeof superClass !== "function" && superClass !== null) {
2081 throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
2082 }
2083
2084 subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
2085 constructor: {
2086 value: subClass,
2087 enumerable: false,
2088 writable: true,
2089 configurable: true
2090 }
2091 });
2092 if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
2093};
2094
2095/***/ }),
2096/* 11 */
2097/***/ (function(module, exports, __webpack_require__) {
2098
2099"use strict";
2100
2101
2102exports.__esModule = true;
2103
2104var _typeof2 = __webpack_require__(316);
2105
2106var _typeof3 = _interopRequireDefault(_typeof2);
2107
2108function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2109
2110exports.default = function (self, call) {
2111 if (!self) {
2112 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2113 }
2114
2115 return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
2116};
2117
2118/***/ }),
2119/* 12 */
2120/***/ (function(module, exports) {
2121
2122module.exports = require("fs");
2123
2124/***/ }),
2125/* 13 */
2126/***/ (function(module, exports, __webpack_require__) {
2127
2128"use strict";
2129
2130
2131Object.defineProperty(exports, "__esModule", {
2132 value: true
2133});
2134exports.getPathKey = getPathKey;
2135var os = __webpack_require__(72);
2136var path = __webpack_require__(1);
2137var userHome = __webpack_require__(101).default;
2138
2139var _require = __webpack_require__(549),
2140 getCacheDir = _require.getCacheDir,
2141 getConfigDir = _require.getConfigDir,
2142 getDataDir = _require.getDataDir;
2143
2144var isWebpackBundle = __webpack_require__(792);
2145
2146var DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies'];
2147var OWNED_DEPENDENCY_TYPES = exports.OWNED_DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies'];
2148
2149var RESOLUTIONS = exports.RESOLUTIONS = 'resolutions';
2150var MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS].concat(DEPENDENCY_TYPES);
2151
2152var SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0';
2153
2154var YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com';
2155var NPM_REGISTRY_RE = exports.NPM_REGISTRY_RE = /https?:\/\/registry\.npmjs\.org/g;
2156
2157var YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/';
2158var YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh';
2159var YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi';
2160
2161var SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version';
2162
2163// cache version, bump whenever we make backwards incompatible changes
2164var CACHE_VERSION = exports.CACHE_VERSION = 6;
2165
2166// lockfile version, bump whenever we make backwards incompatible changes
2167var LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1;
2168
2169// max amount of network requests to perform concurrently
2170var NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8;
2171
2172// HTTP timeout used when downloading packages
2173var NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds
2174
2175// max amount of child processes to execute concurrently
2176var CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5;
2177
2178var REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid'];
2179
2180function getPreferredCacheDirectories() {
2181 var preferredCacheDirectories = [getCacheDir()];
2182
2183 if (process.getuid) {
2184 // $FlowFixMe: process.getuid exists, dammit
2185 preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache-${process.getuid()}`));
2186 }
2187
2188 preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache`));
2189
2190 return preferredCacheDirectories;
2191}
2192
2193var PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories();
2194var CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getConfigDir();
2195var DATA_DIRECTORY = exports.DATA_DIRECTORY = getDataDir();
2196var LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, 'link');
2197var GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, 'global');
2198
2199var NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath;
2200var YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath();
2201
2202// Webpack needs to be configured with node.__dirname/__filename = false
2203function getYarnBinPath() {
2204 if (isWebpackBundle) {
2205 return __filename;
2206 } else {
2207 return path.join(__dirname, '..', 'bin', 'yarn.js');
2208 }
2209}
2210
2211var NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules';
2212var NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json';
2213
2214var PNP_FILENAME = exports.PNP_FILENAME = '.pnp.js';
2215
2216var POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`;
2217var FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn');
2218
2219var META_FOLDER = exports.META_FOLDER = '.yarn-meta';
2220var INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity';
2221var LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock';
2222var METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json';
2223var TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz';
2224var CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean';
2225
2226var NPM_LOCK_FILENAME = exports.NPM_LOCK_FILENAME = 'package-lock.json';
2227var NPM_SHRINKWRAP_FILENAME = exports.NPM_SHRINKWRAP_FILENAME = 'npm-shrinkwrap.json';
2228
2229var DEFAULT_INDENT = exports.DEFAULT_INDENT = ' ';
2230var SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997;
2231var SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance';
2232
2233var ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env);
2234
2235function getPathKey(platform, env) {
2236 var pathKey = 'PATH';
2237
2238 // windows calls its path "Path" usually, but this is not guaranteed.
2239 if (platform === 'win32') {
2240 pathKey = 'Path';
2241
2242 for (var _key in env) {
2243 if (_key.toLowerCase() === 'path') {
2244 pathKey = _key;
2245 }
2246 }
2247 }
2248
2249 return pathKey;
2250}
2251
2252var VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = {
2253 major: 'red',
2254 premajor: 'red',
2255 minor: 'yellow',
2256 preminor: 'yellow',
2257 patch: 'green',
2258 prepatch: 'green',
2259 prerelease: 'red',
2260 unchanged: 'white',
2261 unknown: 'red'
2262};
2263
2264/***/ }),
2265/* 14 */
2266/***/ (function(module, exports, __webpack_require__) {
2267
2268module.exports = { "default": __webpack_require__(597), __esModule: true };
2269
2270/***/ }),
2271/* 15 */
2272/***/ (function(module, exports, __webpack_require__) {
2273
2274"use strict";
2275/**
2276 * Copyright (c) 2013-present, Facebook, Inc.
2277 *
2278 * This source code is licensed under the MIT license found in the
2279 * LICENSE file in the root directory of this source tree.
2280 */
2281
2282
2283
2284/**
2285 * Use invariant() to assert state which your program assumes to be true.
2286 *
2287 * Provide sprintf-style format (only %s is supported) and arguments
2288 * to provide information about what broke and what you were
2289 * expecting.
2290 *
2291 * The invariant message will be stripped in production, but the invariant
2292 * will remain to ensure logic does not differ in production.
2293 */
2294
2295var NODE_ENV = process.env.NODE_ENV;
2296
2297var invariant = function(condition, format, a, b, c, d, e, f) {
2298 if (NODE_ENV !== 'production') {
2299 if (format === undefined) {
2300 throw new Error('invariant requires an error message argument');
2301 }
2302 }
2303
2304 if (!condition) {
2305 var error;
2306 if (format === undefined) {
2307 error = new Error(
2308 'Minified exception occurred; use the non-minified dev environment ' +
2309 'for the full error message and additional helpful warnings.'
2310 );
2311 } else {
2312 var args = [a, b, c, d, e, f];
2313 var argIndex = 0;
2314 error = new Error(
2315 format.replace(/%s/g, function() { return args[argIndex++]; })
2316 );
2317 error.name = 'Invariant Violation';
2318 }
2319
2320 error.framesToPop = 1; // we don't care about invariant's own frame
2321 throw error;
2322 }
2323};
2324
2325module.exports = invariant;
2326
2327
2328/***/ }),
2329/* 16 */
2330/***/ (function(module, exports, __webpack_require__) {
2331
2332module.exports = { "default": __webpack_require__(602), __esModule: true };
2333
2334/***/ }),
2335/* 17 */
2336/***/ (function(module, __webpack_exports__, __webpack_require__) {
2337
2338"use strict";
2339/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Observable; });
2340/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_canReportError__ = __webpack_require__(262);
2341/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__ = __webpack_require__(1005);
2342/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__ = __webpack_require__(112);
2343/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(264);
2344/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config__ = __webpack_require__(176);
2345/** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_internal_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */
2346
2347
2348
2349
2350
2351var Observable = /*@__PURE__*/ (function () {
2352 function Observable(subscribe) {
2353 this._isScalar = false;
2354 if (subscribe) {
2355 this._subscribe = subscribe;
2356 }
2357 }
2358 Observable.prototype.lift = function (operator) {
2359 var observable = new Observable();
2360 observable.source = this;
2361 observable.operator = operator;
2362 return observable;
2363 };
2364 Observable.prototype.subscribe = function (observerOrNext, error, complete) {
2365 var operator = this.operator;
2366 var sink = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__["a" /* toSubscriber */])(observerOrNext, error, complete);
2367 if (operator) {
2368 operator.call(sink, this.source);
2369 }
2370 else {
2371 sink.add(this.source || (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
2372 this._subscribe(sink) :
2373 this._trySubscribe(sink));
2374 }
2375 if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
2376 if (sink.syncErrorThrowable) {
2377 sink.syncErrorThrowable = false;
2378 if (sink.syncErrorThrown) {
2379 throw sink.syncErrorValue;
2380 }
2381 }
2382 }
2383 return sink;
2384 };
2385 Observable.prototype._trySubscribe = function (sink) {
2386 try {
2387 return this._subscribe(sink);
2388 }
2389 catch (err) {
2390 if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
2391 sink.syncErrorThrown = true;
2392 sink.syncErrorValue = err;
2393 }
2394 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_canReportError__["a" /* canReportError */])(sink)) {
2395 sink.error(err);
2396 }
2397 else {
2398 console.warn(err);
2399 }
2400 }
2401 };
2402 Observable.prototype.forEach = function (next, promiseCtor) {
2403 var _this = this;
2404 promiseCtor = getPromiseCtor(promiseCtor);
2405 return new promiseCtor(function (resolve, reject) {
2406 var subscription;
2407 subscription = _this.subscribe(function (value) {
2408 try {
2409 next(value);
2410 }
2411 catch (err) {
2412 reject(err);
2413 if (subscription) {
2414 subscription.unsubscribe();
2415 }
2416 }
2417 }, reject, resolve);
2418 });
2419 };
2420 Observable.prototype._subscribe = function (subscriber) {
2421 var source = this.source;
2422 return source && source.subscribe(subscriber);
2423 };
2424 Observable.prototype[__WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__["a" /* observable */]] = function () {
2425 return this;
2426 };
2427 Observable.prototype.pipe = function () {
2428 var operations = [];
2429 for (var _i = 0; _i < arguments.length; _i++) {
2430 operations[_i] = arguments[_i];
2431 }
2432 if (operations.length === 0) {
2433 return this;
2434 }
2435 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["b" /* pipeFromArray */])(operations)(this);
2436 };
2437 Observable.prototype.toPromise = function (promiseCtor) {
2438 var _this = this;
2439 promiseCtor = getPromiseCtor(promiseCtor);
2440 return new promiseCtor(function (resolve, reject) {
2441 var value;
2442 _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
2443 });
2444 };
2445 Observable.create = function (subscribe) {
2446 return new Observable(subscribe);
2447 };
2448 return Observable;
2449}());
2450
2451function getPromiseCtor(promiseCtor) {
2452 if (!promiseCtor) {
2453 promiseCtor = __WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].Promise || Promise;
2454 }
2455 if (!promiseCtor) {
2456 throw new Error('no Promise impl found');
2457 }
2458 return promiseCtor;
2459}
2460//# sourceMappingURL=Observable.js.map
2461
2462
2463/***/ }),
2464/* 18 */
2465/***/ (function(module, __webpack_exports__, __webpack_require__) {
2466
2467"use strict";
2468/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return OuterSubscriber; });
2469/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
2470/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
2471/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
2472
2473
2474var OuterSubscriber = /*@__PURE__*/ (function (_super) {
2475 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](OuterSubscriber, _super);
2476 function OuterSubscriber() {
2477 return _super !== null && _super.apply(this, arguments) || this;
2478 }
2479 OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
2480 this.destination.next(innerValue);
2481 };
2482 OuterSubscriber.prototype.notifyError = function (error, innerSub) {
2483 this.destination.error(error);
2484 };
2485 OuterSubscriber.prototype.notifyComplete = function (innerSub) {
2486 this.destination.complete();
2487 };
2488 return OuterSubscriber;
2489}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
2490
2491//# sourceMappingURL=OuterSubscriber.js.map
2492
2493
2494/***/ }),
2495/* 19 */
2496/***/ (function(module, __webpack_exports__, __webpack_require__) {
2497
2498"use strict";
2499/* harmony export (immutable) */ __webpack_exports__["a"] = subscribeToResult;
2500/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__ = __webpack_require__(80);
2501/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeTo__ = __webpack_require__(416);
2502/** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo PURE_IMPORTS_END */
2503
2504
2505function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, destination) {
2506 if (destination === void 0) {
2507 destination = new __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__["a" /* InnerSubscriber */](outerSubscriber, outerValue, outerIndex);
2508 }
2509 if (destination.closed) {
2510 return;
2511 }
2512 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__subscribeTo__["a" /* subscribeTo */])(result)(destination);
2513}
2514//# sourceMappingURL=subscribeToResult.js.map
2515
2516
2517/***/ }),
2518/* 20 */
2519/***/ (function(module, exports, __webpack_require__) {
2520
2521"use strict";
2522/* eslint-disable node/no-deprecated-api */
2523
2524
2525
2526var buffer = __webpack_require__(94)
2527var Buffer = buffer.Buffer
2528
2529var safer = {}
2530
2531var key
2532
2533for (key in buffer) {
2534 if (!buffer.hasOwnProperty(key)) continue
2535 if (key === 'SlowBuffer' || key === 'Buffer') continue
2536 safer[key] = buffer[key]
2537}
2538
2539var Safer = safer.Buffer = {}
2540for (key in Buffer) {
2541 if (!Buffer.hasOwnProperty(key)) continue
2542 if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue
2543 Safer[key] = Buffer[key]
2544}
2545
2546safer.Buffer.prototype = Buffer.prototype
2547
2548if (!Safer.from || Safer.from === Uint8Array.from) {
2549 Safer.from = function (value, encodingOrOffset, length) {
2550 if (typeof value === 'number') {
2551 throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value)
2552 }
2553 if (value && typeof value.length === 'undefined') {
2554 throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)
2555 }
2556 return Buffer(value, encodingOrOffset, length)
2557 }
2558}
2559
2560if (!Safer.alloc) {
2561 Safer.alloc = function (size, fill, encoding) {
2562 if (typeof size !== 'number') {
2563 throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
2564 }
2565 if (size < 0 || size >= 2 * (1 << 30)) {
2566 throw new RangeError('The value "' + size + '" is invalid for option "size"')
2567 }
2568 var buf = Buffer(size)
2569 if (!fill || fill.length === 0) {
2570 buf.fill(0)
2571 } else if (typeof encoding === 'string') {
2572 buf.fill(fill, encoding)
2573 } else {
2574 buf.fill(fill)
2575 }
2576 return buf
2577 }
2578}
2579
2580if (!safer.kStringMaxLength) {
2581 try {
2582 safer.kStringMaxLength = process.binding('buffer').kStringMaxLength
2583 } catch (e) {
2584 // we can't determine kStringMaxLength in environments where process.binding
2585 // is unsupported, so let's not set it
2586 }
2587}
2588
2589if (!safer.constants) {
2590 safer.constants = {
2591 MAX_LENGTH: safer.kMaxLength
2592 }
2593 if (safer.kStringMaxLength) {
2594 safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength
2595 }
2596}
2597
2598module.exports = safer
2599
2600
2601/***/ }),
2602/* 21 */
2603/***/ (function(module, exports) {
2604
2605module.exports = require("crypto");
2606
2607/***/ }),
2608/* 22 */
2609/***/ (function(module, exports, __webpack_require__) {
2610
2611// Copyright (c) 2012, Mark Cavage. All rights reserved.
2612// Copyright 2015 Joyent, Inc.
2613
2614var assert = __webpack_require__(50);
2615var Stream = __webpack_require__(35).Stream;
2616var util = __webpack_require__(9);
2617
2618
2619///--- Globals
2620
2621/* JSSTYLED */
2622var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
2623
2624
2625///--- Internal
2626
2627function _capitalize(str) {
2628 return (str.charAt(0).toUpperCase() + str.slice(1));
2629}
2630
2631function _toss(name, expected, oper, arg, actual) {
2632 throw new assert.AssertionError({
2633 message: util.format('%s (%s) is required', name, expected),
2634 actual: (actual === undefined) ? typeof (arg) : actual(arg),
2635 expected: expected,
2636 operator: oper || '===',
2637 stackStartFunction: _toss.caller
2638 });
2639}
2640
2641function _getClass(arg) {
2642 return (Object.prototype.toString.call(arg).slice(8, -1));
2643}
2644
2645function noop() {
2646 // Why even bother with asserts?
2647}
2648
2649
2650///--- Exports
2651
2652var types = {
2653 bool: {
2654 check: function (arg) { return typeof (arg) === 'boolean'; }
2655 },
2656 func: {
2657 check: function (arg) { return typeof (arg) === 'function'; }
2658 },
2659 string: {
2660 check: function (arg) { return typeof (arg) === 'string'; }
2661 },
2662 object: {
2663 check: function (arg) {
2664 return typeof (arg) === 'object' && arg !== null;
2665 }
2666 },
2667 number: {
2668 check: function (arg) {
2669 return typeof (arg) === 'number' && !isNaN(arg);
2670 }
2671 },
2672 finite: {
2673 check: function (arg) {
2674 return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg);
2675 }
2676 },
2677 buffer: {
2678 check: function (arg) { return Buffer.isBuffer(arg); },
2679 operator: 'Buffer.isBuffer'
2680 },
2681 array: {
2682 check: function (arg) { return Array.isArray(arg); },
2683 operator: 'Array.isArray'
2684 },
2685 stream: {
2686 check: function (arg) { return arg instanceof Stream; },
2687 operator: 'instanceof',
2688 actual: _getClass
2689 },
2690 date: {
2691 check: function (arg) { return arg instanceof Date; },
2692 operator: 'instanceof',
2693 actual: _getClass
2694 },
2695 regexp: {
2696 check: function (arg) { return arg instanceof RegExp; },
2697 operator: 'instanceof',
2698 actual: _getClass
2699 },
2700 uuid: {
2701 check: function (arg) {
2702 return typeof (arg) === 'string' && UUID_REGEXP.test(arg);
2703 },
2704 operator: 'isUUID'
2705 }
2706};
2707
2708function _setExports(ndebug) {
2709 var keys = Object.keys(types);
2710 var out;
2711
2712 /* re-export standard assert */
2713 if (process.env.NODE_NDEBUG) {
2714 out = noop;
2715 } else {
2716 out = function (arg, msg) {
2717 if (!arg) {
2718 _toss(msg, 'true', arg);
2719 }
2720 };
2721 }
2722
2723 /* standard checks */
2724 keys.forEach(function (k) {
2725 if (ndebug) {
2726 out[k] = noop;
2727 return;
2728 }
2729 var type = types[k];
2730 out[k] = function (arg, msg) {
2731 if (!type.check(arg)) {
2732 _toss(msg, k, type.operator, arg, type.actual);
2733 }
2734 };
2735 });
2736
2737 /* optional checks */
2738 keys.forEach(function (k) {
2739 var name = 'optional' + _capitalize(k);
2740 if (ndebug) {
2741 out[name] = noop;
2742 return;
2743 }
2744 var type = types[k];
2745 out[name] = function (arg, msg) {
2746 if (arg === undefined || arg === null) {
2747 return;
2748 }
2749 if (!type.check(arg)) {
2750 _toss(msg, k, type.operator, arg, type.actual);
2751 }
2752 };
2753 });
2754
2755 /* arrayOf checks */
2756 keys.forEach(function (k) {
2757 var name = 'arrayOf' + _capitalize(k);
2758 if (ndebug) {
2759 out[name] = noop;
2760 return;
2761 }
2762 var type = types[k];
2763 var expected = '[' + k + ']';
2764 out[name] = function (arg, msg) {
2765 if (!Array.isArray(arg)) {
2766 _toss(msg, expected, type.operator, arg, type.actual);
2767 }
2768 var i;
2769 for (i = 0; i < arg.length; i++) {
2770 if (!type.check(arg[i])) {
2771 _toss(msg, expected, type.operator, arg, type.actual);
2772 }
2773 }
2774 };
2775 });
2776
2777 /* optionalArrayOf checks */
2778 keys.forEach(function (k) {
2779 var name = 'optionalArrayOf' + _capitalize(k);
2780 if (ndebug) {
2781 out[name] = noop;
2782 return;
2783 }
2784 var type = types[k];
2785 var expected = '[' + k + ']';
2786 out[name] = function (arg, msg) {
2787 if (arg === undefined || arg === null) {
2788 return;
2789 }
2790 if (!Array.isArray(arg)) {
2791 _toss(msg, expected, type.operator, arg, type.actual);
2792 }
2793 var i;
2794 for (i = 0; i < arg.length; i++) {
2795 if (!type.check(arg[i])) {
2796 _toss(msg, expected, type.operator, arg, type.actual);
2797 }
2798 }
2799 };
2800 });
2801
2802 /* re-export built-in assertions */
2803 Object.keys(assert).forEach(function (k) {
2804 if (k === 'AssertionError') {
2805 out[k] = assert[k];
2806 return;
2807 }
2808 if (ndebug) {
2809 out[k] = noop;
2810 return;
2811 }
2812 out[k] = assert[k];
2813 });
2814
2815 /* export ourselves (for unit tests _only_) */
2816 out._setExports = _setExports;
2817
2818 return out;
2819}
2820
2821module.exports = _setExports(process.env.NODE_NDEBUG);
2822
2823
2824/***/ }),
2825/* 23 */
2826/***/ (function(module, exports, __webpack_require__) {
2827
2828module.exports = { "default": __webpack_require__(594), __esModule: true };
2829
2830/***/ }),
2831/* 24 */
2832/***/ (function(module, exports, __webpack_require__) {
2833
2834"use strict";
2835
2836
2837exports.__esModule = true;
2838
2839var _assign = __webpack_require__(23);
2840
2841var _assign2 = _interopRequireDefault(_assign);
2842
2843function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2844
2845exports.default = _assign2.default || function (target) {
2846 for (var i = 1; i < arguments.length; i++) {
2847 var source = arguments[i];
2848
2849 for (var key in source) {
2850 if (Object.prototype.hasOwnProperty.call(source, key)) {
2851 target[key] = source[key];
2852 }
2853 }
2854 }
2855
2856 return target;
2857};
2858
2859/***/ }),
2860/* 25 */
2861/***/ (function(module, exports, __webpack_require__) {
2862
2863"use strict";
2864
2865
2866Object.defineProperty(exports, "__esModule", {
2867 value: true
2868});
2869exports.stringify = exports.parse = undefined;
2870
2871var _getIterator2;
2872
2873function _load_getIterator() {
2874 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
2875}
2876
2877var _map;
2878
2879function _load_map() {
2880 return _map = _interopRequireDefault(__webpack_require__(42));
2881}
2882
2883var _asyncToGenerator2;
2884
2885function _load_asyncToGenerator() {
2886 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
2887}
2888
2889var _classCallCheck2;
2890
2891function _load_classCallCheck() {
2892 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
2893}
2894
2895var _keys;
2896
2897function _load_keys() {
2898 return _keys = _interopRequireDefault(__webpack_require__(14));
2899}
2900
2901var _parse;
2902
2903function _load_parse() {
2904 return _parse = __webpack_require__(301);
2905}
2906
2907Object.defineProperty(exports, 'parse', {
2908 enumerable: true,
2909 get: function get() {
2910 return _interopRequireDefault(_parse || _load_parse()).default;
2911 }
2912});
2913
2914var _stringify;
2915
2916function _load_stringify() {
2917 return _stringify = __webpack_require__(510);
2918}
2919
2920Object.defineProperty(exports, 'stringify', {
2921 enumerable: true,
2922 get: function get() {
2923 return _interopRequireDefault(_stringify || _load_stringify()).default;
2924 }
2925});
2926exports.implodeEntry = implodeEntry;
2927exports.explodeEntry = explodeEntry;
2928
2929var _misc;
2930
2931function _load_misc() {
2932 return _misc = __webpack_require__(28);
2933}
2934
2935var _normalizePattern;
2936
2937function _load_normalizePattern() {
2938 return _normalizePattern = __webpack_require__(52);
2939}
2940
2941var _parse2;
2942
2943function _load_parse2() {
2944 return _parse2 = _interopRequireDefault(__webpack_require__(301));
2945}
2946
2947var _constants;
2948
2949function _load_constants() {
2950 return _constants = __webpack_require__(13);
2951}
2952
2953var _fs;
2954
2955function _load_fs() {
2956 return _fs = _interopRequireWildcard(__webpack_require__(8));
2957}
2958
2959function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
2960
2961function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
2962
2963var invariant = __webpack_require__(15);
2964
2965var path = __webpack_require__(1);
2966var ssri = __webpack_require__(93);
2967
2968function getName(pattern) {
2969 return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name;
2970}
2971
2972function blankObjectUndefined(obj) {
2973 return obj && (0, (_keys || _load_keys()).default)(obj).length ? obj : undefined;
2974}
2975
2976function keyForRemote(remote) {
2977 return remote.resolved || (remote.reference && remote.hash ? `${remote.reference}#${remote.hash}` : null);
2978}
2979
2980function serializeIntegrity(integrity) {
2981 // We need this because `Integrity.toString()` does not use sorting to ensure a stable string output
2982 // See https://git.io/vx2Hy
2983 return integrity.toString().split(' ').sort().join(' ');
2984}
2985
2986function implodeEntry(pattern, obj) {
2987 var inferredName = getName(pattern);
2988 var integrity = obj.integrity ? serializeIntegrity(obj.integrity) : '';
2989 var imploded = {
2990 name: inferredName === obj.name ? undefined : obj.name,
2991 version: obj.version,
2992 uid: obj.uid === obj.version ? undefined : obj.uid,
2993 resolved: obj.resolved,
2994 registry: obj.registry === 'npm' ? undefined : obj.registry,
2995 dependencies: blankObjectUndefined(obj.dependencies),
2996 optionalDependencies: blankObjectUndefined(obj.optionalDependencies),
2997 permissions: blankObjectUndefined(obj.permissions),
2998 prebuiltVariants: blankObjectUndefined(obj.prebuiltVariants)
2999 };
3000 if (integrity) {
3001 imploded.integrity = integrity;
3002 }
3003 return imploded;
3004}
3005
3006function explodeEntry(pattern, obj) {
3007 obj.optionalDependencies = obj.optionalDependencies || {};
3008 obj.dependencies = obj.dependencies || {};
3009 obj.uid = obj.uid || obj.version;
3010 obj.permissions = obj.permissions || {};
3011 obj.registry = obj.registry || 'npm';
3012 obj.name = obj.name || getName(pattern);
3013 var integrity = obj.integrity;
3014 if (integrity && integrity.isIntegrity) {
3015 obj.integrity = ssri.parse(integrity);
3016 }
3017 return obj;
3018}
3019
3020var Lockfile = function () {
3021 function Lockfile() {
3022 var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
3023 cache = _ref.cache,
3024 source = _ref.source,
3025 parseResultType = _ref.parseResultType;
3026
3027 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Lockfile);
3028
3029 this.source = source || '';
3030 this.cache = cache;
3031 this.parseResultType = parseResultType;
3032 }
3033
3034 // source string if the `cache` was parsed
3035
3036
3037 // if true, we're parsing an old yarn file and need to update integrity fields
3038 Lockfile.prototype.hasEntriesExistWithoutIntegrity = function hasEntriesExistWithoutIntegrity() {
3039 if (!this.cache) {
3040 return false;
3041 }
3042
3043 for (var _key in this.cache) {
3044 // $FlowFixMe - `this.cache` is clearly defined at this point
3045 if (!/^.*@(file:|http)/.test(_key) && this.cache[_key] && !this.cache[_key].integrity) {
3046 return true;
3047 }
3048 }
3049
3050 return false;
3051 };
3052
3053 Lockfile.fromDirectory = function () {
3054 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, reporter) {
3055 // read the manifest in this directory
3056 var lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME);
3057
3058 var lockfile = void 0;
3059 var rawLockfile = '';
3060 var parseResult = void 0;
3061
3062 if (yield (_fs || _load_fs()).exists(lockfileLoc)) {
3063 rawLockfile = yield (_fs || _load_fs()).readFile(lockfileLoc);
3064 parseResult = (0, (_parse2 || _load_parse2()).default)(rawLockfile, lockfileLoc);
3065
3066 if (reporter) {
3067 if (parseResult.type === 'merge') {
3068 reporter.info(reporter.lang('lockfileMerged'));
3069 } else if (parseResult.type === 'conflict') {
3070 reporter.warn(reporter.lang('lockfileConflict'));
3071 }
3072 }
3073
3074 lockfile = parseResult.object;
3075 } else if (reporter) {
3076 reporter.info(reporter.lang('noLockfileFound'));
3077 }
3078
3079 if (lockfile && lockfile.__metadata) {
3080 var lockfilev2 = lockfile;
3081 lockfile = {};
3082 }
3083
3084 return new Lockfile({ cache: lockfile, source: rawLockfile, parseResultType: parseResult && parseResult.type });
3085 });
3086
3087 function fromDirectory(_x2, _x3) {
3088 return _ref2.apply(this, arguments);
3089 }
3090
3091 return fromDirectory;
3092 }();
3093
3094 Lockfile.prototype.getLocked = function getLocked(pattern) {
3095 var cache = this.cache;
3096 if (!cache) {
3097 return undefined;
3098 }
3099
3100 var shrunk = pattern in cache && cache[pattern];
3101
3102 if (typeof shrunk === 'string') {
3103 return this.getLocked(shrunk);
3104 } else if (shrunk) {
3105 explodeEntry(pattern, shrunk);
3106 return shrunk;
3107 }
3108
3109 return undefined;
3110 };
3111
3112 Lockfile.prototype.removePattern = function removePattern(pattern) {
3113 var cache = this.cache;
3114 if (!cache) {
3115 return;
3116 }
3117 delete cache[pattern];
3118 };
3119
3120 Lockfile.prototype.getLockfile = function getLockfile(patterns) {
3121 var lockfile = {};
3122 var seen = new (_map || _load_map()).default();
3123
3124 // order by name so that lockfile manifest is assigned to the first dependency with this manifest
3125 // the others that have the same remoteKey will just refer to the first
3126 // ordering allows for consistency in lockfile when it is serialized
3127 var sortedPatternsKeys = (0, (_keys || _load_keys()).default)(patterns).sort((_misc || _load_misc()).sortAlpha);
3128
3129 for (var _iterator = sortedPatternsKeys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
3130 var _ref3;
3131
3132 if (_isArray) {
3133 if (_i >= _iterator.length) break;
3134 _ref3 = _iterator[_i++];
3135 } else {
3136 _i = _iterator.next();
3137 if (_i.done) break;
3138 _ref3 = _i.value;
3139 }
3140
3141 var pattern = _ref3;
3142
3143 var pkg = patterns[pattern];
3144 var remote = pkg._remote,
3145 ref = pkg._reference;
3146
3147 invariant(ref, 'Package is missing a reference');
3148 invariant(remote, 'Package is missing a remote');
3149
3150 var remoteKey = keyForRemote(remote);
3151 var seenPattern = remoteKey && seen.get(remoteKey);
3152 if (seenPattern) {
3153 // no point in duplicating it
3154 lockfile[pattern] = seenPattern;
3155
3156 // if we're relying on our name being inferred and two of the patterns have
3157 // different inferred names then we need to set it
3158 if (!seenPattern.name && getName(pattern) !== pkg.name) {
3159 seenPattern.name = pkg.name;
3160 }
3161 continue;
3162 }
3163 var obj = implodeEntry(pattern, {
3164 name: pkg.name,
3165 version: pkg.version,
3166 uid: pkg._uid,
3167 resolved: remote.resolved,
3168 integrity: remote.integrity,
3169 registry: remote.registry,
3170 dependencies: pkg.dependencies,
3171 peerDependencies: pkg.peerDependencies,
3172 optionalDependencies: pkg.optionalDependencies,
3173 permissions: ref.permissions,
3174 prebuiltVariants: pkg.prebuiltVariants
3175 });
3176
3177 lockfile[pattern] = obj;
3178
3179 if (remoteKey) {
3180 seen.set(remoteKey, obj);
3181 }
3182 }
3183
3184 return lockfile;
3185 };
3186
3187 return Lockfile;
3188}();
3189
3190exports.default = Lockfile;
3191
3192/***/ }),
3193/* 26 */
3194/***/ (function(module, exports) {
3195
3196var core = module.exports = { version: '2.5.7' };
3197if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
3198
3199
3200/***/ }),
3201/* 27 */
3202/***/ (function(module, exports) {
3203
3204exports = module.exports = SemVer;
3205
3206// The debug function is excluded entirely from the minified version.
3207/* nomin */ var debug;
3208/* nomin */ if (typeof process === 'object' &&
3209 /* nomin */ process.env &&
3210 /* nomin */ process.env.NODE_DEBUG &&
3211 /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG))
3212 /* nomin */ debug = function() {
3213 /* nomin */ var args = Array.prototype.slice.call(arguments, 0);
3214 /* nomin */ args.unshift('SEMVER');
3215 /* nomin */ console.log.apply(console, args);
3216 /* nomin */ };
3217/* nomin */ else
3218 /* nomin */ debug = function() {};
3219
3220// Note: this is the semver.org version of the spec that it implements
3221// Not necessarily the package version of this code.
3222exports.SEMVER_SPEC_VERSION = '2.0.0';
3223
3224var MAX_LENGTH = 256;
3225var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
3226
3227// Max safe segment length for coercion.
3228var MAX_SAFE_COMPONENT_LENGTH = 16;
3229
3230// The actual regexps go on exports.re
3231var re = exports.re = [];
3232var src = exports.src = [];
3233var R = 0;
3234
3235// The following Regular Expressions can be used for tokenizing,
3236// validating, and parsing SemVer version strings.
3237
3238// ## Numeric Identifier
3239// A single `0`, or a non-zero digit followed by zero or more digits.
3240
3241var NUMERICIDENTIFIER = R++;
3242src[NUMERICIDENTIFIER] = '0|[1-9]\\d*';
3243var NUMERICIDENTIFIERLOOSE = R++;
3244src[NUMERICIDENTIFIERLOOSE] = '[0-9]+';
3245
3246
3247// ## Non-numeric Identifier
3248// Zero or more digits, followed by a letter or hyphen, and then zero or
3249// more letters, digits, or hyphens.
3250
3251var NONNUMERICIDENTIFIER = R++;
3252src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*';
3253
3254
3255// ## Main Version
3256// Three dot-separated numeric identifiers.
3257
3258var MAINVERSION = R++;
3259src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
3260 '(' + src[NUMERICIDENTIFIER] + ')\\.' +
3261 '(' + src[NUMERICIDENTIFIER] + ')';
3262
3263var MAINVERSIONLOOSE = R++;
3264src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
3265 '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
3266 '(' + src[NUMERICIDENTIFIERLOOSE] + ')';
3267
3268// ## Pre-release Version Identifier
3269// A numeric identifier, or a non-numeric identifier.
3270
3271var PRERELEASEIDENTIFIER = R++;
3272src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
3273 '|' + src[NONNUMERICIDENTIFIER] + ')';
3274
3275var PRERELEASEIDENTIFIERLOOSE = R++;
3276src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
3277 '|' + src[NONNUMERICIDENTIFIER] + ')';
3278
3279
3280// ## Pre-release Version
3281// Hyphen, followed by one or more dot-separated pre-release version
3282// identifiers.
3283
3284var PRERELEASE = R++;
3285src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
3286 '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))';
3287
3288var PRERELEASELOOSE = R++;
3289src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
3290 '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))';
3291
3292// ## Build Metadata Identifier
3293// Any combination of digits, letters, or hyphens.
3294
3295var BUILDIDENTIFIER = R++;
3296src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+';
3297
3298// ## Build Metadata
3299// Plus sign, followed by one or more period-separated build metadata
3300// identifiers.
3301
3302var BUILD = R++;
3303src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
3304 '(?:\\.' + src[BUILDIDENTIFIER] + ')*))';
3305
3306
3307// ## Full Version String
3308// A main version, followed optionally by a pre-release version and
3309// build metadata.
3310
3311// Note that the only major, minor, patch, and pre-release sections of
3312// the version string are capturing groups. The build metadata is not a
3313// capturing group, because it should not ever be used in version
3314// comparison.
3315
3316var FULL = R++;
3317var FULLPLAIN = 'v?' + src[MAINVERSION] +
3318 src[PRERELEASE] + '?' +
3319 src[BUILD] + '?';
3320
3321src[FULL] = '^' + FULLPLAIN + '$';
3322
3323// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
3324// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
3325// common in the npm registry.
3326var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
3327 src[PRERELEASELOOSE] + '?' +
3328 src[BUILD] + '?';
3329
3330var LOOSE = R++;
3331src[LOOSE] = '^' + LOOSEPLAIN + '$';
3332
3333var GTLT = R++;
3334src[GTLT] = '((?:<|>)?=?)';
3335
3336// Something like "2.*" or "1.2.x".
3337// Note that "x.x" is a valid xRange identifer, meaning "any version"
3338// Only the first item is strictly required.
3339var XRANGEIDENTIFIERLOOSE = R++;
3340src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*';
3341var XRANGEIDENTIFIER = R++;
3342src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*';
3343
3344var XRANGEPLAIN = R++;
3345src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
3346 '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
3347 '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
3348 '(?:' + src[PRERELEASE] + ')?' +
3349 src[BUILD] + '?' +
3350 ')?)?';
3351
3352var XRANGEPLAINLOOSE = R++;
3353src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
3354 '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
3355 '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
3356 '(?:' + src[PRERELEASELOOSE] + ')?' +
3357 src[BUILD] + '?' +
3358 ')?)?';
3359
3360var XRANGE = R++;
3361src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$';
3362var XRANGELOOSE = R++;
3363src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$';
3364
3365// Coercion.
3366// Extract anything that could conceivably be a part of a valid semver
3367var COERCE = R++;
3368src[COERCE] = '(?:^|[^\\d])' +
3369 '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
3370 '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
3371 '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
3372 '(?:$|[^\\d])';
3373
3374// Tilde ranges.
3375// Meaning is "reasonably at or greater than"
3376var LONETILDE = R++;
3377src[LONETILDE] = '(?:~>?)';
3378
3379var TILDETRIM = R++;
3380src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+';
3381re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g');
3382var tildeTrimReplace = '$1~';
3383
3384var TILDE = R++;
3385src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$';
3386var TILDELOOSE = R++;
3387src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$';
3388
3389// Caret ranges.
3390// Meaning is "at least and backwards compatible with"
3391var LONECARET = R++;
3392src[LONECARET] = '(?:\\^)';
3393
3394var CARETTRIM = R++;
3395src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+';
3396re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g');
3397var caretTrimReplace = '$1^';
3398
3399var CARET = R++;
3400src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$';
3401var CARETLOOSE = R++;
3402src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$';
3403
3404// A simple gt/lt/eq thing, or just "" to indicate "any version"
3405var COMPARATORLOOSE = R++;
3406src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$';
3407var COMPARATOR = R++;
3408src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$';
3409
3410
3411// An expression to strip any whitespace between the gtlt and the thing
3412// it modifies, so that `> 1.2.3` ==> `>1.2.3`
3413var COMPARATORTRIM = R++;
3414src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
3415 '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')';
3416
3417// this one has to use the /g flag
3418re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g');
3419var comparatorTrimReplace = '$1$2$3';
3420
3421
3422// Something like `1.2.3 - 1.2.4`
3423// Note that these all use the loose form, because they'll be
3424// checked against either the strict or loose comparator form
3425// later.
3426var HYPHENRANGE = R++;
3427src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
3428 '\\s+-\\s+' +
3429 '(' + src[XRANGEPLAIN] + ')' +
3430 '\\s*$';
3431
3432var HYPHENRANGELOOSE = R++;
3433src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
3434 '\\s+-\\s+' +
3435 '(' + src[XRANGEPLAINLOOSE] + ')' +
3436 '\\s*$';
3437
3438// Star ranges basically just allow anything at all.
3439var STAR = R++;
3440src[STAR] = '(<|>)?=?\\s*\\*';
3441
3442// Compile to actual regexp objects.
3443// All are flag-free, unless they were created above with a flag.
3444for (var i = 0; i < R; i++) {
3445 debug(i, src[i]);
3446 if (!re[i])
3447 re[i] = new RegExp(src[i]);
3448}
3449
3450exports.parse = parse;
3451function parse(version, loose) {
3452 if (version instanceof SemVer)
3453 return version;
3454
3455 if (typeof version !== 'string')
3456 return null;
3457
3458 if (version.length > MAX_LENGTH)
3459 return null;
3460
3461 var r = loose ? re[LOOSE] : re[FULL];
3462 if (!r.test(version))
3463 return null;
3464
3465 try {
3466 return new SemVer(version, loose);
3467 } catch (er) {
3468 return null;
3469 }
3470}
3471
3472exports.valid = valid;
3473function valid(version, loose) {
3474 var v = parse(version, loose);
3475 return v ? v.version : null;
3476}
3477
3478
3479exports.clean = clean;
3480function clean(version, loose) {
3481 var s = parse(version.trim().replace(/^[=v]+/, ''), loose);
3482 return s ? s.version : null;
3483}
3484
3485exports.SemVer = SemVer;
3486
3487function SemVer(version, loose) {
3488 if (version instanceof SemVer) {
3489 if (version.loose === loose)
3490 return version;
3491 else
3492 version = version.version;
3493 } else if (typeof version !== 'string') {
3494 throw new TypeError('Invalid Version: ' + version);
3495 }
3496
3497 if (version.length > MAX_LENGTH)
3498 throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
3499
3500 if (!(this instanceof SemVer))
3501 return new SemVer(version, loose);
3502
3503 debug('SemVer', version, loose);
3504 this.loose = loose;
3505 var m = version.trim().match(loose ? re[LOOSE] : re[FULL]);
3506
3507 if (!m)
3508 throw new TypeError('Invalid Version: ' + version);
3509
3510 this.raw = version;
3511
3512 // these are actually numbers
3513 this.major = +m[1];
3514 this.minor = +m[2];
3515 this.patch = +m[3];
3516
3517 if (this.major > MAX_SAFE_INTEGER || this.major < 0)
3518 throw new TypeError('Invalid major version')
3519
3520 if (this.minor > MAX_SAFE_INTEGER || this.minor < 0)
3521 throw new TypeError('Invalid minor version')
3522
3523 if (this.patch > MAX_SAFE_INTEGER || this.patch < 0)
3524 throw new TypeError('Invalid patch version')
3525
3526 // numberify any prerelease numeric ids
3527 if (!m[4])
3528 this.prerelease = [];
3529 else
3530 this.prerelease = m[4].split('.').map(function(id) {
3531 if (/^[0-9]+$/.test(id)) {
3532 var num = +id;
3533 if (num >= 0 && num < MAX_SAFE_INTEGER)
3534 return num;
3535 }
3536 return id;
3537 });
3538
3539 this.build = m[5] ? m[5].split('.') : [];
3540 this.format();
3541}
3542
3543SemVer.prototype.format = function() {
3544 this.version = this.major + '.' + this.minor + '.' + this.patch;
3545 if (this.prerelease.length)
3546 this.version += '-' + this.prerelease.join('.');
3547 return this.version;
3548};
3549
3550SemVer.prototype.toString = function() {
3551 return this.version;
3552};
3553
3554SemVer.prototype.compare = function(other) {
3555 debug('SemVer.compare', this.version, this.loose, other);
3556 if (!(other instanceof SemVer))
3557 other = new SemVer(other, this.loose);
3558
3559 return this.compareMain(other) || this.comparePre(other);
3560};
3561
3562SemVer.prototype.compareMain = function(other) {
3563 if (!(other instanceof SemVer))
3564 other = new SemVer(other, this.loose);
3565
3566 return compareIdentifiers(this.major, other.major) ||
3567 compareIdentifiers(this.minor, other.minor) ||
3568 compareIdentifiers(this.patch, other.patch);
3569};
3570
3571SemVer.prototype.comparePre = function(other) {
3572 if (!(other instanceof SemVer))
3573 other = new SemVer(other, this.loose);
3574
3575 // NOT having a prerelease is > having one
3576 if (this.prerelease.length && !other.prerelease.length)
3577 return -1;
3578 else if (!this.prerelease.length && other.prerelease.length)
3579 return 1;
3580 else if (!this.prerelease.length && !other.prerelease.length)
3581 return 0;
3582
3583 var i = 0;
3584 do {
3585 var a = this.prerelease[i];
3586 var b = other.prerelease[i];
3587 debug('prerelease compare', i, a, b);
3588 if (a === undefined && b === undefined)
3589 return 0;
3590 else if (b === undefined)
3591 return 1;
3592 else if (a === undefined)
3593 return -1;
3594 else if (a === b)
3595 continue;
3596 else
3597 return compareIdentifiers(a, b);
3598 } while (++i);
3599};
3600
3601// preminor will bump the version up to the next minor release, and immediately
3602// down to pre-release. premajor and prepatch work the same way.
3603SemVer.prototype.inc = function(release, identifier) {
3604 switch (release) {
3605 case 'premajor':
3606 this.prerelease.length = 0;
3607 this.patch = 0;
3608 this.minor = 0;
3609 this.major++;
3610 this.inc('pre', identifier);
3611 break;
3612 case 'preminor':
3613 this.prerelease.length = 0;
3614 this.patch = 0;
3615 this.minor++;
3616 this.inc('pre', identifier);
3617 break;
3618 case 'prepatch':
3619 // If this is already a prerelease, it will bump to the next version
3620 // drop any prereleases that might already exist, since they are not
3621 // relevant at this point.
3622 this.prerelease.length = 0;
3623 this.inc('patch', identifier);
3624 this.inc('pre', identifier);
3625 break;
3626 // If the input is a non-prerelease version, this acts the same as
3627 // prepatch.
3628 case 'prerelease':
3629 if (this.prerelease.length === 0)
3630 this.inc('patch', identifier);
3631 this.inc('pre', identifier);
3632 break;
3633
3634 case 'major':
3635 // If this is a pre-major version, bump up to the same major version.
3636 // Otherwise increment major.
3637 // 1.0.0-5 bumps to 1.0.0
3638 // 1.1.0 bumps to 2.0.0
3639 if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0)
3640 this.major++;
3641 this.minor = 0;
3642 this.patch = 0;
3643 this.prerelease = [];
3644 break;
3645 case 'minor':
3646 // If this is a pre-minor version, bump up to the same minor version.
3647 // Otherwise increment minor.
3648 // 1.2.0-5 bumps to 1.2.0
3649 // 1.2.1 bumps to 1.3.0
3650 if (this.patch !== 0 || this.prerelease.length === 0)
3651 this.minor++;
3652 this.patch = 0;
3653 this.prerelease = [];
3654 break;
3655 case 'patch':
3656 // If this is not a pre-release version, it will increment the patch.
3657 // If it is a pre-release it will bump up to the same patch version.
3658 // 1.2.0-5 patches to 1.2.0
3659 // 1.2.0 patches to 1.2.1
3660 if (this.prerelease.length === 0)
3661 this.patch++;
3662 this.prerelease = [];
3663 break;
3664 // This probably shouldn't be used publicly.
3665 // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
3666 case 'pre':
3667 if (this.prerelease.length === 0)
3668 this.prerelease = [0];
3669 else {
3670 var i = this.prerelease.length;
3671 while (--i >= 0) {
3672 if (typeof this.prerelease[i] === 'number') {
3673 this.prerelease[i]++;
3674 i = -2;
3675 }
3676 }
3677 if (i === -1) // didn't increment anything
3678 this.prerelease.push(0);
3679 }
3680 if (identifier) {
3681 // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
3682 // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
3683 if (this.prerelease[0] === identifier) {
3684 if (isNaN(this.prerelease[1]))
3685 this.prerelease = [identifier, 0];
3686 } else
3687 this.prerelease = [identifier, 0];
3688 }
3689 break;
3690
3691 default:
3692 throw new Error('invalid increment argument: ' + release);
3693 }
3694 this.format();
3695 this.raw = this.version;
3696 return this;
3697};
3698
3699exports.inc = inc;
3700function inc(version, release, loose, identifier) {
3701 if (typeof(loose) === 'string') {
3702 identifier = loose;
3703 loose = undefined;
3704 }
3705
3706 try {
3707 return new SemVer(version, loose).inc(release, identifier).version;
3708 } catch (er) {
3709 return null;
3710 }
3711}
3712
3713exports.diff = diff;
3714function diff(version1, version2) {
3715 if (eq(version1, version2)) {
3716 return null;
3717 } else {
3718 var v1 = parse(version1);
3719 var v2 = parse(version2);
3720 if (v1.prerelease.length || v2.prerelease.length) {
3721 for (var key in v1) {
3722 if (key === 'major' || key === 'minor' || key === 'patch') {
3723 if (v1[key] !== v2[key]) {
3724 return 'pre'+key;
3725 }
3726 }
3727 }
3728 return 'prerelease';
3729 }
3730 for (var key in v1) {
3731 if (key === 'major' || key === 'minor' || key === 'patch') {
3732 if (v1[key] !== v2[key]) {
3733 return key;
3734 }
3735 }
3736 }
3737 }
3738}
3739
3740exports.compareIdentifiers = compareIdentifiers;
3741
3742var numeric = /^[0-9]+$/;
3743function compareIdentifiers(a, b) {
3744 var anum = numeric.test(a);
3745 var bnum = numeric.test(b);
3746
3747 if (anum && bnum) {
3748 a = +a;
3749 b = +b;
3750 }
3751
3752 return (anum && !bnum) ? -1 :
3753 (bnum && !anum) ? 1 :
3754 a < b ? -1 :
3755 a > b ? 1 :
3756 0;
3757}
3758
3759exports.rcompareIdentifiers = rcompareIdentifiers;
3760function rcompareIdentifiers(a, b) {
3761 return compareIdentifiers(b, a);
3762}
3763
3764exports.major = major;
3765function major(a, loose) {
3766 return new SemVer(a, loose).major;
3767}
3768
3769exports.minor = minor;
3770function minor(a, loose) {
3771 return new SemVer(a, loose).minor;
3772}
3773
3774exports.patch = patch;
3775function patch(a, loose) {
3776 return new SemVer(a, loose).patch;
3777}
3778
3779exports.compare = compare;
3780function compare(a, b, loose) {
3781 return new SemVer(a, loose).compare(new SemVer(b, loose));
3782}
3783
3784exports.compareLoose = compareLoose;
3785function compareLoose(a, b) {
3786 return compare(a, b, true);
3787}
3788
3789exports.rcompare = rcompare;
3790function rcompare(a, b, loose) {
3791 return compare(b, a, loose);
3792}
3793
3794exports.sort = sort;
3795function sort(list, loose) {
3796 return list.sort(function(a, b) {
3797 return exports.compare(a, b, loose);
3798 });
3799}
3800
3801exports.rsort = rsort;
3802function rsort(list, loose) {
3803 return list.sort(function(a, b) {
3804 return exports.rcompare(a, b, loose);
3805 });
3806}
3807
3808exports.gt = gt;
3809function gt(a, b, loose) {
3810 return compare(a, b, loose) > 0;
3811}
3812
3813exports.lt = lt;
3814function lt(a, b, loose) {
3815 return compare(a, b, loose) < 0;
3816}
3817
3818exports.eq = eq;
3819function eq(a, b, loose) {
3820 return compare(a, b, loose) === 0;
3821}
3822
3823exports.neq = neq;
3824function neq(a, b, loose) {
3825 return compare(a, b, loose) !== 0;
3826}
3827
3828exports.gte = gte;
3829function gte(a, b, loose) {
3830 return compare(a, b, loose) >= 0;
3831}
3832
3833exports.lte = lte;
3834function lte(a, b, loose) {
3835 return compare(a, b, loose) <= 0;
3836}
3837
3838exports.cmp = cmp;
3839function cmp(a, op, b, loose) {
3840 var ret;
3841 switch (op) {
3842 case '===':
3843 if (typeof a === 'object') a = a.version;
3844 if (typeof b === 'object') b = b.version;
3845 ret = a === b;
3846 break;
3847 case '!==':
3848 if (typeof a === 'object') a = a.version;
3849 if (typeof b === 'object') b = b.version;
3850 ret = a !== b;
3851 break;
3852 case '': case '=': case '==': ret = eq(a, b, loose); break;
3853 case '!=': ret = neq(a, b, loose); break;
3854 case '>': ret = gt(a, b, loose); break;
3855 case '>=': ret = gte(a, b, loose); break;
3856 case '<': ret = lt(a, b, loose); break;
3857 case '<=': ret = lte(a, b, loose); break;
3858 default: throw new TypeError('Invalid operator: ' + op);
3859 }
3860 return ret;
3861}
3862
3863exports.Comparator = Comparator;
3864function Comparator(comp, loose) {
3865 if (comp instanceof Comparator) {
3866 if (comp.loose === loose)
3867 return comp;
3868 else
3869 comp = comp.value;
3870 }
3871
3872 if (!(this instanceof Comparator))
3873 return new Comparator(comp, loose);
3874
3875 debug('comparator', comp, loose);
3876 this.loose = loose;
3877 this.parse(comp);
3878
3879 if (this.semver === ANY)
3880 this.value = '';
3881 else
3882 this.value = this.operator + this.semver.version;
3883
3884 debug('comp', this);
3885}
3886
3887var ANY = {};
3888Comparator.prototype.parse = function(comp) {
3889 var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
3890 var m = comp.match(r);
3891
3892 if (!m)
3893 throw new TypeError('Invalid comparator: ' + comp);
3894
3895 this.operator = m[1];
3896 if (this.operator === '=')
3897 this.operator = '';
3898
3899 // if it literally is just '>' or '' then allow anything.
3900 if (!m[2])
3901 this.semver = ANY;
3902 else
3903 this.semver = new SemVer(m[2], this.loose);
3904};
3905
3906Comparator.prototype.toString = function() {
3907 return this.value;
3908};
3909
3910Comparator.prototype.test = function(version) {
3911 debug('Comparator.test', version, this.loose);
3912
3913 if (this.semver === ANY)
3914 return true;
3915
3916 if (typeof version === 'string')
3917 version = new SemVer(version, this.loose);
3918
3919 return cmp(version, this.operator, this.semver, this.loose);
3920};
3921
3922Comparator.prototype.intersects = function(comp, loose) {
3923 if (!(comp instanceof Comparator)) {
3924 throw new TypeError('a Comparator is required');
3925 }
3926
3927 var rangeTmp;
3928
3929 if (this.operator === '') {
3930 rangeTmp = new Range(comp.value, loose);
3931 return satisfies(this.value, rangeTmp, loose);
3932 } else if (comp.operator === '') {
3933 rangeTmp = new Range(this.value, loose);
3934 return satisfies(comp.semver, rangeTmp, loose);
3935 }
3936
3937 var sameDirectionIncreasing =
3938 (this.operator === '>=' || this.operator === '>') &&
3939 (comp.operator === '>=' || comp.operator === '>');
3940 var sameDirectionDecreasing =
3941 (this.operator === '<=' || this.operator === '<') &&
3942 (comp.operator === '<=' || comp.operator === '<');
3943 var sameSemVer = this.semver.version === comp.semver.version;
3944 var differentDirectionsInclusive =
3945 (this.operator === '>=' || this.operator === '<=') &&
3946 (comp.operator === '>=' || comp.operator === '<=');
3947 var oppositeDirectionsLessThan =
3948 cmp(this.semver, '<', comp.semver, loose) &&
3949 ((this.operator === '>=' || this.operator === '>') &&
3950 (comp.operator === '<=' || comp.operator === '<'));
3951 var oppositeDirectionsGreaterThan =
3952 cmp(this.semver, '>', comp.semver, loose) &&
3953 ((this.operator === '<=' || this.operator === '<') &&
3954 (comp.operator === '>=' || comp.operator === '>'));
3955
3956 return sameDirectionIncreasing || sameDirectionDecreasing ||
3957 (sameSemVer && differentDirectionsInclusive) ||
3958 oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
3959};
3960
3961
3962exports.Range = Range;
3963function Range(range, loose) {
3964 if (range instanceof Range) {
3965 if (range.loose === loose) {
3966 return range;
3967 } else {
3968 return new Range(range.raw, loose);
3969 }
3970 }
3971
3972 if (range instanceof Comparator) {
3973 return new Range(range.value, loose);
3974 }
3975
3976 if (!(this instanceof Range))
3977 return new Range(range, loose);
3978
3979 this.loose = loose;
3980
3981 // First, split based on boolean or ||
3982 this.raw = range;
3983 this.set = range.split(/\s*\|\|\s*/).map(function(range) {
3984 return this.parseRange(range.trim());
3985 }, this).filter(function(c) {
3986 // throw out any that are not relevant for whatever reason
3987 return c.length;
3988 });
3989
3990 if (!this.set.length) {
3991 throw new TypeError('Invalid SemVer Range: ' + range);
3992 }
3993
3994 this.format();
3995}
3996
3997Range.prototype.format = function() {
3998 this.range = this.set.map(function(comps) {
3999 return comps.join(' ').trim();
4000 }).join('||').trim();
4001 return this.range;
4002};
4003
4004Range.prototype.toString = function() {
4005 return this.range;
4006};
4007
4008Range.prototype.parseRange = function(range) {
4009 var loose = this.loose;
4010 range = range.trim();
4011 debug('range', range, loose);
4012 // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
4013 var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE];
4014 range = range.replace(hr, hyphenReplace);
4015 debug('hyphen replace', range);
4016 // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
4017 range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace);
4018 debug('comparator trim', range, re[COMPARATORTRIM]);
4019
4020 // `~ 1.2.3` => `~1.2.3`
4021 range = range.replace(re[TILDETRIM], tildeTrimReplace);
4022
4023 // `^ 1.2.3` => `^1.2.3`
4024 range = range.replace(re[CARETTRIM], caretTrimReplace);
4025
4026 // normalize spaces
4027 range = range.split(/\s+/).join(' ');
4028
4029 // At this point, the range is completely trimmed and
4030 // ready to be split into comparators.
4031
4032 var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
4033 var set = range.split(' ').map(function(comp) {
4034 return parseComparator(comp, loose);
4035 }).join(' ').split(/\s+/);
4036 if (this.loose) {
4037 // in loose mode, throw out any that are not valid comparators
4038 set = set.filter(function(comp) {
4039 return !!comp.match(compRe);
4040 });
4041 }
4042 set = set.map(function(comp) {
4043 return new Comparator(comp, loose);
4044 });
4045
4046 return set;
4047};
4048
4049Range.prototype.intersects = function(range, loose) {
4050 if (!(range instanceof Range)) {
4051 throw new TypeError('a Range is required');
4052 }
4053
4054 return this.set.some(function(thisComparators) {
4055 return thisComparators.every(function(thisComparator) {
4056 return range.set.some(function(rangeComparators) {
4057 return rangeComparators.every(function(rangeComparator) {
4058 return thisComparator.intersects(rangeComparator, loose);
4059 });
4060 });
4061 });
4062 });
4063};
4064
4065// Mostly just for testing and legacy API reasons
4066exports.toComparators = toComparators;
4067function toComparators(range, loose) {
4068 return new Range(range, loose).set.map(function(comp) {
4069 return comp.map(function(c) {
4070 return c.value;
4071 }).join(' ').trim().split(' ');
4072 });
4073}
4074
4075// comprised of xranges, tildes, stars, and gtlt's at this point.
4076// already replaced the hyphen ranges
4077// turn into a set of JUST comparators.
4078function parseComparator(comp, loose) {
4079 debug('comp', comp);
4080 comp = replaceCarets(comp, loose);
4081 debug('caret', comp);
4082 comp = replaceTildes(comp, loose);
4083 debug('tildes', comp);
4084 comp = replaceXRanges(comp, loose);
4085 debug('xrange', comp);
4086 comp = replaceStars(comp, loose);
4087 debug('stars', comp);
4088 return comp;
4089}
4090
4091function isX(id) {
4092 return !id || id.toLowerCase() === 'x' || id === '*';
4093}
4094
4095// ~, ~> --> * (any, kinda silly)
4096// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
4097// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
4098// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
4099// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
4100// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
4101function replaceTildes(comp, loose) {
4102 return comp.trim().split(/\s+/).map(function(comp) {
4103 return replaceTilde(comp, loose);
4104 }).join(' ');
4105}
4106
4107function replaceTilde(comp, loose) {
4108 var r = loose ? re[TILDELOOSE] : re[TILDE];
4109 return comp.replace(r, function(_, M, m, p, pr) {
4110 debug('tilde', comp, _, M, m, p, pr);
4111 var ret;
4112
4113 if (isX(M))
4114 ret = '';
4115 else if (isX(m))
4116 ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
4117 else if (isX(p))
4118 // ~1.2 == >=1.2.0 <1.3.0
4119 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
4120 else if (pr) {
4121 debug('replaceTilde pr', pr);
4122 if (pr.charAt(0) !== '-')
4123 pr = '-' + pr;
4124 ret = '>=' + M + '.' + m + '.' + p + pr +
4125 ' <' + M + '.' + (+m + 1) + '.0';
4126 } else
4127 // ~1.2.3 == >=1.2.3 <1.3.0
4128 ret = '>=' + M + '.' + m + '.' + p +
4129 ' <' + M + '.' + (+m + 1) + '.0';
4130
4131 debug('tilde return', ret);
4132 return ret;
4133 });
4134}
4135
4136// ^ --> * (any, kinda silly)
4137// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
4138// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
4139// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
4140// ^1.2.3 --> >=1.2.3 <2.0.0
4141// ^1.2.0 --> >=1.2.0 <2.0.0
4142function replaceCarets(comp, loose) {
4143 return comp.trim().split(/\s+/).map(function(comp) {
4144 return replaceCaret(comp, loose);
4145 }).join(' ');
4146}
4147
4148function replaceCaret(comp, loose) {
4149 debug('caret', comp, loose);
4150 var r = loose ? re[CARETLOOSE] : re[CARET];
4151 return comp.replace(r, function(_, M, m, p, pr) {
4152 debug('caret', comp, _, M, m, p, pr);
4153 var ret;
4154
4155 if (isX(M))
4156 ret = '';
4157 else if (isX(m))
4158 ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
4159 else if (isX(p)) {
4160 if (M === '0')
4161 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
4162 else
4163 ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0';
4164 } else if (pr) {
4165 debug('replaceCaret pr', pr);
4166 if (pr.charAt(0) !== '-')
4167 pr = '-' + pr;
4168 if (M === '0') {
4169 if (m === '0')
4170 ret = '>=' + M + '.' + m + '.' + p + pr +
4171 ' <' + M + '.' + m + '.' + (+p + 1);
4172 else
4173 ret = '>=' + M + '.' + m + '.' + p + pr +
4174 ' <' + M + '.' + (+m + 1) + '.0';
4175 } else
4176 ret = '>=' + M + '.' + m + '.' + p + pr +
4177 ' <' + (+M + 1) + '.0.0';
4178 } else {
4179 debug('no pr');
4180 if (M === '0') {
4181 if (m === '0')
4182 ret = '>=' + M + '.' + m + '.' + p +
4183 ' <' + M + '.' + m + '.' + (+p + 1);
4184 else
4185 ret = '>=' + M + '.' + m + '.' + p +
4186 ' <' + M + '.' + (+m + 1) + '.0';
4187 } else
4188 ret = '>=' + M + '.' + m + '.' + p +
4189 ' <' + (+M + 1) + '.0.0';
4190 }
4191
4192 debug('caret return', ret);
4193 return ret;
4194 });
4195}
4196
4197function replaceXRanges(comp, loose) {
4198 debug('replaceXRanges', comp, loose);
4199 return comp.split(/\s+/).map(function(comp) {
4200 return replaceXRange(comp, loose);
4201 }).join(' ');
4202}
4203
4204function replaceXRange(comp, loose) {
4205 comp = comp.trim();
4206 var r = loose ? re[XRANGELOOSE] : re[XRANGE];
4207 return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
4208 debug('xRange', comp, ret, gtlt, M, m, p, pr);
4209 var xM = isX(M);
4210 var xm = xM || isX(m);
4211 var xp = xm || isX(p);
4212 var anyX = xp;
4213
4214 if (gtlt === '=' && anyX)
4215 gtlt = '';
4216
4217 if (xM) {
4218 if (gtlt === '>' || gtlt === '<') {
4219 // nothing is allowed
4220 ret = '<0.0.0';
4221 } else {
4222 // nothing is forbidden
4223 ret = '*';
4224 }
4225 } else if (gtlt && anyX) {
4226 // replace X with 0
4227 if (xm)
4228 m = 0;
4229 if (xp)
4230 p = 0;
4231
4232 if (gtlt === '>') {
4233 // >1 => >=2.0.0
4234 // >1.2 => >=1.3.0
4235 // >1.2.3 => >= 1.2.4
4236 gtlt = '>=';
4237 if (xm) {
4238 M = +M + 1;
4239 m = 0;
4240 p = 0;
4241 } else if (xp) {
4242 m = +m + 1;
4243 p = 0;
4244 }
4245 } else if (gtlt === '<=') {
4246 // <=0.7.x is actually <0.8.0, since any 0.7.x should
4247 // pass. Similarly, <=7.x is actually <8.0.0, etc.
4248 gtlt = '<';
4249 if (xm)
4250 M = +M + 1;
4251 else
4252 m = +m + 1;
4253 }
4254
4255 ret = gtlt + M + '.' + m + '.' + p;
4256 } else if (xm) {
4257 ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
4258 } else if (xp) {
4259 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
4260 }
4261
4262 debug('xRange return', ret);
4263
4264 return ret;
4265 });
4266}
4267
4268// Because * is AND-ed with everything else in the comparator,
4269// and '' means "any version", just remove the *s entirely.
4270function replaceStars(comp, loose) {
4271 debug('replaceStars', comp, loose);
4272 // Looseness is ignored here. star is always as loose as it gets!
4273 return comp.trim().replace(re[STAR], '');
4274}
4275
4276// This function is passed to string.replace(re[HYPHENRANGE])
4277// M, m, patch, prerelease, build
4278// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
4279// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
4280// 1.2 - 3.4 => >=1.2.0 <3.5.0
4281function hyphenReplace($0,
4282 from, fM, fm, fp, fpr, fb,
4283 to, tM, tm, tp, tpr, tb) {
4284
4285 if (isX(fM))
4286 from = '';
4287 else if (isX(fm))
4288 from = '>=' + fM + '.0.0';
4289 else if (isX(fp))
4290 from = '>=' + fM + '.' + fm + '.0';
4291 else
4292 from = '>=' + from;
4293
4294 if (isX(tM))
4295 to = '';
4296 else if (isX(tm))
4297 to = '<' + (+tM + 1) + '.0.0';
4298 else if (isX(tp))
4299 to = '<' + tM + '.' + (+tm + 1) + '.0';
4300 else if (tpr)
4301 to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;
4302 else
4303 to = '<=' + to;
4304
4305 return (from + ' ' + to).trim();
4306}
4307
4308
4309// if ANY of the sets match ALL of its comparators, then pass
4310Range.prototype.test = function(version) {
4311 if (!version)
4312 return false;
4313
4314 if (typeof version === 'string')
4315 version = new SemVer(version, this.loose);
4316
4317 for (var i = 0; i < this.set.length; i++) {
4318 if (testSet(this.set[i], version))
4319 return true;
4320 }
4321 return false;
4322};
4323
4324function testSet(set, version) {
4325 for (var i = 0; i < set.length; i++) {
4326 if (!set[i].test(version))
4327 return false;
4328 }
4329
4330 if (version.prerelease.length) {
4331 // Find the set of versions that are allowed to have prereleases
4332 // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
4333 // That should allow `1.2.3-pr.2` to pass.
4334 // However, `1.2.4-alpha.notready` should NOT be allowed,
4335 // even though it's within the range set by the comparators.
4336 for (var i = 0; i < set.length; i++) {
4337 debug(set[i].semver);
4338 if (set[i].semver === ANY)
4339 continue;
4340
4341 if (set[i].semver.prerelease.length > 0) {
4342 var allowed = set[i].semver;
4343 if (allowed.major === version.major &&
4344 allowed.minor === version.minor &&
4345 allowed.patch === version.patch)
4346 return true;
4347 }
4348 }
4349
4350 // Version has a -pre, but it's not one of the ones we like.
4351 return false;
4352 }
4353
4354 return true;
4355}
4356
4357exports.satisfies = satisfies;
4358function satisfies(version, range, loose) {
4359 try {
4360 range = new Range(range, loose);
4361 } catch (er) {
4362 return false;
4363 }
4364 return range.test(version);
4365}
4366
4367exports.maxSatisfying = maxSatisfying;
4368function maxSatisfying(versions, range, loose) {
4369 var max = null;
4370 var maxSV = null;
4371 try {
4372 var rangeObj = new Range(range, loose);
4373 } catch (er) {
4374 return null;
4375 }
4376 versions.forEach(function (v) {
4377 if (rangeObj.test(v)) { // satisfies(v, range, loose)
4378 if (!max || maxSV.compare(v) === -1) { // compare(max, v, true)
4379 max = v;
4380 maxSV = new SemVer(max, loose);
4381 }
4382 }
4383 })
4384 return max;
4385}
4386
4387exports.minSatisfying = minSatisfying;
4388function minSatisfying(versions, range, loose) {
4389 var min = null;
4390 var minSV = null;
4391 try {
4392 var rangeObj = new Range(range, loose);
4393 } catch (er) {
4394 return null;
4395 }
4396 versions.forEach(function (v) {
4397 if (rangeObj.test(v)) { // satisfies(v, range, loose)
4398 if (!min || minSV.compare(v) === 1) { // compare(min, v, true)
4399 min = v;
4400 minSV = new SemVer(min, loose);
4401 }
4402 }
4403 })
4404 return min;
4405}
4406
4407exports.validRange = validRange;
4408function validRange(range, loose) {
4409 try {
4410 // Return '*' instead of '' so that truthiness works.
4411 // This will throw if it's invalid anyway
4412 return new Range(range, loose).range || '*';
4413 } catch (er) {
4414 return null;
4415 }
4416}
4417
4418// Determine if version is less than all the versions possible in the range
4419exports.ltr = ltr;
4420function ltr(version, range, loose) {
4421 return outside(version, range, '<', loose);
4422}
4423
4424// Determine if version is greater than all the versions possible in the range.
4425exports.gtr = gtr;
4426function gtr(version, range, loose) {
4427 return outside(version, range, '>', loose);
4428}
4429
4430exports.outside = outside;
4431function outside(version, range, hilo, loose) {
4432 version = new SemVer(version, loose);
4433 range = new Range(range, loose);
4434
4435 var gtfn, ltefn, ltfn, comp, ecomp;
4436 switch (hilo) {
4437 case '>':
4438 gtfn = gt;
4439 ltefn = lte;
4440 ltfn = lt;
4441 comp = '>';
4442 ecomp = '>=';
4443 break;
4444 case '<':
4445 gtfn = lt;
4446 ltefn = gte;
4447 ltfn = gt;
4448 comp = '<';
4449 ecomp = '<=';
4450 break;
4451 default:
4452 throw new TypeError('Must provide a hilo val of "<" or ">"');
4453 }
4454
4455 // If it satisifes the range it is not outside
4456 if (satisfies(version, range, loose)) {
4457 return false;
4458 }
4459
4460 // From now on, variable terms are as if we're in "gtr" mode.
4461 // but note that everything is flipped for the "ltr" function.
4462
4463 for (var i = 0; i < range.set.length; ++i) {
4464 var comparators = range.set[i];
4465
4466 var high = null;
4467 var low = null;
4468
4469 comparators.forEach(function(comparator) {
4470 if (comparator.semver === ANY) {
4471 comparator = new Comparator('>=0.0.0')
4472 }
4473 high = high || comparator;
4474 low = low || comparator;
4475 if (gtfn(comparator.semver, high.semver, loose)) {
4476 high = comparator;
4477 } else if (ltfn(comparator.semver, low.semver, loose)) {
4478 low = comparator;
4479 }
4480 });
4481
4482 // If the edge version comparator has a operator then our version
4483 // isn't outside it
4484 if (high.operator === comp || high.operator === ecomp) {
4485 return false;
4486 }
4487
4488 // If the lowest version comparator has an operator and our version
4489 // is less than it then it isn't higher than the range
4490 if ((!low.operator || low.operator === comp) &&
4491 ltefn(version, low.semver)) {
4492 return false;
4493 } else if (low.operator === ecomp && ltfn(version, low.semver)) {
4494 return false;
4495 }
4496 }
4497 return true;
4498}
4499
4500exports.prerelease = prerelease;
4501function prerelease(version, loose) {
4502 var parsed = parse(version, loose);
4503 return (parsed && parsed.prerelease.length) ? parsed.prerelease : null;
4504}
4505
4506exports.intersects = intersects;
4507function intersects(r1, r2, loose) {
4508 r1 = new Range(r1, loose)
4509 r2 = new Range(r2, loose)
4510 return r1.intersects(r2)
4511}
4512
4513exports.coerce = coerce;
4514function coerce(version) {
4515 if (version instanceof SemVer)
4516 return version;
4517
4518 if (typeof version !== 'string')
4519 return null;
4520
4521 var match = version.match(re[COERCE]);
4522
4523 if (match == null)
4524 return null;
4525
4526 return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0'));
4527}
4528
4529
4530/***/ }),
4531/* 28 */
4532/***/ (function(module, exports, __webpack_require__) {
4533
4534"use strict";
4535
4536
4537Object.defineProperty(exports, "__esModule", {
4538 value: true
4539});
4540
4541var _promise;
4542
4543function _load_promise() {
4544 return _promise = _interopRequireDefault(__webpack_require__(7));
4545}
4546
4547exports.sortAlpha = sortAlpha;
4548exports.sortOptionsByFlags = sortOptionsByFlags;
4549exports.entries = entries;
4550exports.removePrefix = removePrefix;
4551exports.removeSuffix = removeSuffix;
4552exports.addSuffix = addSuffix;
4553exports.hyphenate = hyphenate;
4554exports.camelCase = camelCase;
4555exports.compareSortedArrays = compareSortedArrays;
4556exports.sleep = sleep;
4557
4558function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4559
4560var _camelCase = __webpack_require__(562);
4561
4562function sortAlpha(a, b) {
4563 // sort alphabetically in a deterministic way
4564 var shortLen = Math.min(a.length, b.length);
4565 for (var i = 0; i < shortLen; i++) {
4566 var aChar = a.charCodeAt(i);
4567 var bChar = b.charCodeAt(i);
4568 if (aChar !== bChar) {
4569 return aChar - bChar;
4570 }
4571 }
4572 return a.length - b.length;
4573}
4574
4575function sortOptionsByFlags(a, b) {
4576 var aOpt = a.flags.replace(/-/g, '');
4577 var bOpt = b.flags.replace(/-/g, '');
4578 return sortAlpha(aOpt, bOpt);
4579}
4580
4581function entries(obj) {
4582 var entries = [];
4583 if (obj) {
4584 for (var _key in obj) {
4585 entries.push([_key, obj[_key]]);
4586 }
4587 }
4588 return entries;
4589}
4590
4591function removePrefix(pattern, prefix) {
4592 if (pattern.startsWith(prefix)) {
4593 pattern = pattern.slice(prefix.length);
4594 }
4595
4596 return pattern;
4597}
4598
4599function removeSuffix(pattern, suffix) {
4600 if (pattern.endsWith(suffix)) {
4601 return pattern.slice(0, -suffix.length);
4602 }
4603
4604 return pattern;
4605}
4606
4607function addSuffix(pattern, suffix) {
4608 if (!pattern.endsWith(suffix)) {
4609 return pattern + suffix;
4610 }
4611
4612 return pattern;
4613}
4614
4615function hyphenate(str) {
4616 return str.replace(/[A-Z]/g, function (match) {
4617 return '-' + match.charAt(0).toLowerCase();
4618 });
4619}
4620
4621function camelCase(str) {
4622 if (/[A-Z]/.test(str)) {
4623 return null;
4624 } else {
4625 return _camelCase(str);
4626 }
4627}
4628
4629function compareSortedArrays(array1, array2) {
4630 if (array1.length !== array2.length) {
4631 return false;
4632 }
4633 for (var i = 0, len = array1.length; i < len; i++) {
4634 if (array1[i] !== array2[i]) {
4635 return false;
4636 }
4637 }
4638 return true;
4639}
4640
4641function sleep(ms) {
4642 return new (_promise || _load_promise()).default(function (resolve) {
4643 setTimeout(resolve, ms);
4644 });
4645}
4646
4647/***/ }),
4648/* 29 */
4649/***/ (function(module, exports) {
4650
4651module.exports = require("url");
4652
4653/***/ }),
4654/* 30 */
4655/***/ (function(module, exports, __webpack_require__) {
4656
4657"use strict";
4658
4659
4660var YAMLException = __webpack_require__(131);
4661
4662var TYPE_CONSTRUCTOR_OPTIONS = [
4663 'kind',
4664 'resolve',
4665 'construct',
4666 'instanceOf',
4667 'predicate',
4668 'represent',
4669 'defaultStyle',
4670 'styleAliases'
4671];
4672
4673var YAML_NODE_KINDS = [
4674 'scalar',
4675 'sequence',
4676 'mapping'
4677];
4678
4679function compileStyleAliases(map) {
4680 var result = {};
4681
4682 if (map !== null) {
4683 Object.keys(map).forEach(function (style) {
4684 map[style].forEach(function (alias) {
4685 result[String(alias)] = style;
4686 });
4687 });
4688 }
4689
4690 return result;
4691}
4692
4693function Type(tag, options) {
4694 options = options || {};
4695
4696 Object.keys(options).forEach(function (name) {
4697 if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
4698 throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
4699 }
4700 });
4701
4702 // TODO: Add tag format check.
4703 this.tag = tag;
4704 this.kind = options['kind'] || null;
4705 this.resolve = options['resolve'] || function () { return true; };
4706 this.construct = options['construct'] || function (data) { return data; };
4707 this.instanceOf = options['instanceOf'] || null;
4708 this.predicate = options['predicate'] || null;
4709 this.represent = options['represent'] || null;
4710 this.defaultStyle = options['defaultStyle'] || null;
4711 this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
4712
4713 if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
4714 throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
4715 }
4716}
4717
4718module.exports = Type;
4719
4720
4721/***/ }),
4722/* 31 */
4723/***/ (function(module, __webpack_exports__, __webpack_require__) {
4724
4725"use strict";
4726/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; });
4727/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(48);
4728/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isObject__ = __webpack_require__(414);
4729/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(142);
4730/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(59);
4731/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(55);
4732/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__ = __webpack_require__(411);
4733/** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_tryCatch,_util_errorObject,_util_UnsubscriptionError PURE_IMPORTS_END */
4734
4735
4736
4737
4738
4739
4740var Subscription = /*@__PURE__*/ (function () {
4741 function Subscription(unsubscribe) {
4742 this.closed = false;
4743 this._parent = null;
4744 this._parents = null;
4745 this._subscriptions = null;
4746 if (unsubscribe) {
4747 this._unsubscribe = unsubscribe;
4748 }
4749 }
4750 Subscription.prototype.unsubscribe = function () {
4751 var hasErrors = false;
4752 var errors;
4753 if (this.closed) {
4754 return;
4755 }
4756 var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
4757 this.closed = true;
4758 this._parent = null;
4759 this._parents = null;
4760 this._subscriptions = null;
4761 var index = -1;
4762 var len = _parents ? _parents.length : 0;
4763 while (_parent) {
4764 _parent.remove(this);
4765 _parent = ++index < len && _parents[index] || null;
4766 }
4767 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(_unsubscribe)) {
4768 var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(_unsubscribe).call(this);
4769 if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) {
4770 hasErrors = true;
4771 errors = errors || (__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */] ?
4772 flattenUnsubscriptionErrors(__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e.errors) : [__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e]);
4773 }
4774 }
4775 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(_subscriptions)) {
4776 index = -1;
4777 len = _subscriptions.length;
4778 while (++index < len) {
4779 var sub = _subscriptions[index];
4780 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isObject__["a" /* isObject */])(sub)) {
4781 var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(sub.unsubscribe).call(sub);
4782 if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) {
4783 hasErrors = true;
4784 errors = errors || [];
4785 var err = __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e;
4786 if (err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) {
4787 errors = errors.concat(flattenUnsubscriptionErrors(err.errors));
4788 }
4789 else {
4790 errors.push(err);
4791 }
4792 }
4793 }
4794 }
4795 }
4796 if (hasErrors) {
4797 throw new __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */](errors);
4798 }
4799 };
4800 Subscription.prototype.add = function (teardown) {
4801 if (!teardown || (teardown === Subscription.EMPTY)) {
4802 return Subscription.EMPTY;
4803 }
4804 if (teardown === this) {
4805 return this;
4806 }
4807 var subscription = teardown;
4808 switch (typeof teardown) {
4809 case 'function':
4810 subscription = new Subscription(teardown);
4811 case 'object':
4812 if (subscription.closed || typeof subscription.unsubscribe !== 'function') {
4813 return subscription;
4814 }
4815 else if (this.closed) {
4816 subscription.unsubscribe();
4817 return subscription;
4818 }
4819 else if (typeof subscription._addParent !== 'function') {
4820 var tmp = subscription;
4821 subscription = new Subscription();
4822 subscription._subscriptions = [tmp];
4823 }
4824 break;
4825 default:
4826 throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
4827 }
4828 var subscriptions = this._subscriptions || (this._subscriptions = []);
4829 subscriptions.push(subscription);
4830 subscription._addParent(this);
4831 return subscription;
4832 };
4833 Subscription.prototype.remove = function (subscription) {
4834 var subscriptions = this._subscriptions;
4835 if (subscriptions) {
4836 var subscriptionIndex = subscriptions.indexOf(subscription);
4837 if (subscriptionIndex !== -1) {
4838 subscriptions.splice(subscriptionIndex, 1);
4839 }
4840 }
4841 };
4842 Subscription.prototype._addParent = function (parent) {
4843 var _a = this, _parent = _a._parent, _parents = _a._parents;
4844 if (!_parent || _parent === parent) {
4845 this._parent = parent;
4846 }
4847 else if (!_parents) {
4848 this._parents = [parent];
4849 }
4850 else if (_parents.indexOf(parent) === -1) {
4851 _parents.push(parent);
4852 }
4853 };
4854 Subscription.EMPTY = (function (empty) {
4855 empty.closed = true;
4856 return empty;
4857 }(new Subscription()));
4858 return Subscription;
4859}());
4860
4861function flattenUnsubscriptionErrors(errors) {
4862 return errors.reduce(function (errs, err) { return errs.concat((err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) ? err.errors : err); }, []);
4863}
4864//# sourceMappingURL=Subscription.js.map
4865
4866
4867/***/ }),
4868/* 32 */
4869/***/ (function(module, exports, __webpack_require__) {
4870
4871// Copyright 2015 Joyent, Inc.
4872
4873module.exports = {
4874 bufferSplit: bufferSplit,
4875 addRSAMissing: addRSAMissing,
4876 calculateDSAPublic: calculateDSAPublic,
4877 calculateED25519Public: calculateED25519Public,
4878 calculateX25519Public: calculateX25519Public,
4879 mpNormalize: mpNormalize,
4880 mpDenormalize: mpDenormalize,
4881 ecNormalize: ecNormalize,
4882 countZeros: countZeros,
4883 assertCompatible: assertCompatible,
4884 isCompatible: isCompatible,
4885 opensslKeyDeriv: opensslKeyDeriv,
4886 opensshCipherInfo: opensshCipherInfo,
4887 publicFromPrivateECDSA: publicFromPrivateECDSA,
4888 zeroPadToLength: zeroPadToLength,
4889 writeBitString: writeBitString,
4890 readBitString: readBitString
4891};
4892
4893var assert = __webpack_require__(22);
4894var Buffer = __webpack_require__(20).Buffer;
4895var PrivateKey = __webpack_require__(40);
4896var Key = __webpack_require__(34);
4897var crypto = __webpack_require__(21);
4898var algs = __webpack_require__(39);
4899var asn1 = __webpack_require__(66);
4900
4901var ec, jsbn;
4902var nacl;
4903
4904var MAX_CLASS_DEPTH = 3;
4905
4906function isCompatible(obj, klass, needVer) {
4907 if (obj === null || typeof (obj) !== 'object')
4908 return (false);
4909 if (needVer === undefined)
4910 needVer = klass.prototype._sshpkApiVersion;
4911 if (obj instanceof klass &&
4912 klass.prototype._sshpkApiVersion[0] == needVer[0])
4913 return (true);
4914 var proto = Object.getPrototypeOf(obj);
4915 var depth = 0;
4916 while (proto.constructor.name !== klass.name) {
4917 proto = Object.getPrototypeOf(proto);
4918 if (!proto || ++depth > MAX_CLASS_DEPTH)
4919 return (false);
4920 }
4921 if (proto.constructor.name !== klass.name)
4922 return (false);
4923 var ver = proto._sshpkApiVersion;
4924 if (ver === undefined)
4925 ver = klass._oldVersionDetect(obj);
4926 if (ver[0] != needVer[0] || ver[1] < needVer[1])
4927 return (false);
4928 return (true);
4929}
4930
4931function assertCompatible(obj, klass, needVer, name) {
4932 if (name === undefined)
4933 name = 'object';
4934 assert.ok(obj, name + ' must not be null');
4935 assert.object(obj, name + ' must be an object');
4936 if (needVer === undefined)
4937 needVer = klass.prototype._sshpkApiVersion;
4938 if (obj instanceof klass &&
4939 klass.prototype._sshpkApiVersion[0] == needVer[0])
4940 return;
4941 var proto = Object.getPrototypeOf(obj);
4942 var depth = 0;
4943 while (proto.constructor.name !== klass.name) {
4944 proto = Object.getPrototypeOf(proto);
4945 assert.ok(proto && ++depth <= MAX_CLASS_DEPTH,
4946 name + ' must be a ' + klass.name + ' instance');
4947 }
4948 assert.strictEqual(proto.constructor.name, klass.name,
4949 name + ' must be a ' + klass.name + ' instance');
4950 var ver = proto._sshpkApiVersion;
4951 if (ver === undefined)
4952 ver = klass._oldVersionDetect(obj);
4953 assert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1],
4954 name + ' must be compatible with ' + klass.name + ' klass ' +
4955 'version ' + needVer[0] + '.' + needVer[1]);
4956}
4957
4958var CIPHER_LEN = {
4959 'des-ede3-cbc': { key: 7, iv: 8 },
4960 'aes-128-cbc': { key: 16, iv: 16 }
4961};
4962var PKCS5_SALT_LEN = 8;
4963
4964function opensslKeyDeriv(cipher, salt, passphrase, count) {
4965 assert.buffer(salt, 'salt');
4966 assert.buffer(passphrase, 'passphrase');
4967 assert.number(count, 'iteration count');
4968
4969 var clen = CIPHER_LEN[cipher];
4970 assert.object(clen, 'supported cipher');
4971
4972 salt = salt.slice(0, PKCS5_SALT_LEN);
4973
4974 var D, D_prev, bufs;
4975 var material = Buffer.alloc(0);
4976 while (material.length < clen.key + clen.iv) {
4977 bufs = [];
4978 if (D_prev)
4979 bufs.push(D_prev);
4980 bufs.push(passphrase);
4981 bufs.push(salt);
4982 D = Buffer.concat(bufs);
4983 for (var j = 0; j < count; ++j)
4984 D = crypto.createHash('md5').update(D).digest();
4985 material = Buffer.concat([material, D]);
4986 D_prev = D;
4987 }
4988
4989 return ({
4990 key: material.slice(0, clen.key),
4991 iv: material.slice(clen.key, clen.key + clen.iv)
4992 });
4993}
4994
4995/* Count leading zero bits on a buffer */
4996function countZeros(buf) {
4997 var o = 0, obit = 8;
4998 while (o < buf.length) {
4999 var mask = (1 << obit);
5000 if ((buf[o] & mask) === mask)
5001 break;
5002 obit--;
5003 if (obit < 0) {
5004 o++;
5005 obit = 8;
5006 }
5007 }
5008 return (o*8 + (8 - obit) - 1);
5009}
5010
5011function bufferSplit(buf, chr) {
5012 assert.buffer(buf);
5013 assert.string(chr);
5014
5015 var parts = [];
5016 var lastPart = 0;
5017 var matches = 0;
5018 for (var i = 0; i < buf.length; ++i) {
5019 if (buf[i] === chr.charCodeAt(matches))
5020 ++matches;
5021 else if (buf[i] === chr.charCodeAt(0))
5022 matches = 1;
5023 else
5024 matches = 0;
5025
5026 if (matches >= chr.length) {
5027 var newPart = i + 1;
5028 parts.push(buf.slice(lastPart, newPart - matches));
5029 lastPart = newPart;
5030 matches = 0;
5031 }
5032 }
5033 if (lastPart <= buf.length)
5034 parts.push(buf.slice(lastPart, buf.length));
5035
5036 return (parts);
5037}
5038
5039function ecNormalize(buf, addZero) {
5040 assert.buffer(buf);
5041 if (buf[0] === 0x00 && buf[1] === 0x04) {
5042 if (addZero)
5043 return (buf);
5044 return (buf.slice(1));
5045 } else if (buf[0] === 0x04) {
5046 if (!addZero)
5047 return (buf);
5048 } else {
5049 while (buf[0] === 0x00)
5050 buf = buf.slice(1);
5051 if (buf[0] === 0x02 || buf[0] === 0x03)
5052 throw (new Error('Compressed elliptic curve points ' +
5053 'are not supported'));
5054 if (buf[0] !== 0x04)
5055 throw (new Error('Not a valid elliptic curve point'));
5056 if (!addZero)
5057 return (buf);
5058 }
5059 var b = Buffer.alloc(buf.length + 1);
5060 b[0] = 0x0;
5061 buf.copy(b, 1);
5062 return (b);
5063}
5064
5065function readBitString(der, tag) {
5066 if (tag === undefined)
5067 tag = asn1.Ber.BitString;
5068 var buf = der.readString(tag, true);
5069 assert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' +
5070 'not supported (0x' + buf[0].toString(16) + ')');
5071 return (buf.slice(1));
5072}
5073
5074function writeBitString(der, buf, tag) {
5075 if (tag === undefined)
5076 tag = asn1.Ber.BitString;
5077 var b = Buffer.alloc(buf.length + 1);
5078 b[0] = 0x00;
5079 buf.copy(b, 1);
5080 der.writeBuffer(b, tag);
5081}
5082
5083function mpNormalize(buf) {
5084 assert.buffer(buf);
5085 while (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00)
5086 buf = buf.slice(1);
5087 if ((buf[0] & 0x80) === 0x80) {
5088 var b = Buffer.alloc(buf.length + 1);
5089 b[0] = 0x00;
5090 buf.copy(b, 1);
5091 buf = b;
5092 }
5093 return (buf);
5094}
5095
5096function mpDenormalize(buf) {
5097 assert.buffer(buf);
5098 while (buf.length > 1 && buf[0] === 0x00)
5099 buf = buf.slice(1);
5100 return (buf);
5101}
5102
5103function zeroPadToLength(buf, len) {
5104 assert.buffer(buf);
5105 assert.number(len);
5106 while (buf.length > len) {
5107 assert.equal(buf[0], 0x00);
5108 buf = buf.slice(1);
5109 }
5110 while (buf.length < len) {
5111 var b = Buffer.alloc(buf.length + 1);
5112 b[0] = 0x00;
5113 buf.copy(b, 1);
5114 buf = b;
5115 }
5116 return (buf);
5117}
5118
5119function bigintToMpBuf(bigint) {
5120 var buf = Buffer.from(bigint.toByteArray());
5121 buf = mpNormalize(buf);
5122 return (buf);
5123}
5124
5125function calculateDSAPublic(g, p, x) {
5126 assert.buffer(g);
5127 assert.buffer(p);
5128 assert.buffer(x);
5129 try {
5130 var bigInt = __webpack_require__(79).BigInteger;
5131 } catch (e) {
5132 throw (new Error('To load a PKCS#8 format DSA private key, ' +
5133 'the node jsbn library is required.'));
5134 }
5135 g = new bigInt(g);
5136 p = new bigInt(p);
5137 x = new bigInt(x);
5138 var y = g.modPow(x, p);
5139 var ybuf = bigintToMpBuf(y);
5140 return (ybuf);
5141}
5142
5143function calculateED25519Public(k) {
5144 assert.buffer(k);
5145
5146 if (nacl === undefined)
5147 nacl = __webpack_require__(71);
5148
5149 var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k));
5150 return (Buffer.from(kp.publicKey));
5151}
5152
5153function calculateX25519Public(k) {
5154 assert.buffer(k);
5155
5156 if (nacl === undefined)
5157 nacl = __webpack_require__(71);
5158
5159 var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k));
5160 return (Buffer.from(kp.publicKey));
5161}
5162
5163function addRSAMissing(key) {
5164 assert.object(key);
5165 assertCompatible(key, PrivateKey, [1, 1]);
5166 try {
5167 var bigInt = __webpack_require__(79).BigInteger;
5168 } catch (e) {
5169 throw (new Error('To write a PEM private key from ' +
5170 'this source, the node jsbn lib is required.'));
5171 }
5172
5173 var d = new bigInt(key.part.d.data);
5174 var buf;
5175
5176 if (!key.part.dmodp) {
5177 var p = new bigInt(key.part.p.data);
5178 var dmodp = d.mod(p.subtract(1));
5179
5180 buf = bigintToMpBuf(dmodp);
5181 key.part.dmodp = {name: 'dmodp', data: buf};
5182 key.parts.push(key.part.dmodp);
5183 }
5184 if (!key.part.dmodq) {
5185 var q = new bigInt(key.part.q.data);
5186 var dmodq = d.mod(q.subtract(1));
5187
5188 buf = bigintToMpBuf(dmodq);
5189 key.part.dmodq = {name: 'dmodq', data: buf};
5190 key.parts.push(key.part.dmodq);
5191 }
5192}
5193
5194function publicFromPrivateECDSA(curveName, priv) {
5195 assert.string(curveName, 'curveName');
5196 assert.buffer(priv);
5197 if (ec === undefined)
5198 ec = __webpack_require__(129);
5199 if (jsbn === undefined)
5200 jsbn = __webpack_require__(79).BigInteger;
5201 var params = algs.curves[curveName];
5202 var p = new jsbn(params.p);
5203 var a = new jsbn(params.a);
5204 var b = new jsbn(params.b);
5205 var curve = new ec.ECCurveFp(p, a, b);
5206 var G = curve.decodePointHex(params.G.toString('hex'));
5207
5208 var d = new jsbn(mpNormalize(priv));
5209 var pub = G.multiply(d);
5210 pub = Buffer.from(curve.encodePointHex(pub), 'hex');
5211
5212 var parts = [];
5213 parts.push({name: 'curve', data: Buffer.from(curveName)});
5214 parts.push({name: 'Q', data: pub});
5215
5216 var key = new Key({type: 'ecdsa', curve: curve, parts: parts});
5217 return (key);
5218}
5219
5220function opensshCipherInfo(cipher) {
5221 var inf = {};
5222 switch (cipher) {
5223 case '3des-cbc':
5224 inf.keySize = 24;
5225 inf.blockSize = 8;
5226 inf.opensslName = 'des-ede3-cbc';
5227 break;
5228 case 'blowfish-cbc':
5229 inf.keySize = 16;
5230 inf.blockSize = 8;
5231 inf.opensslName = 'bf-cbc';
5232 break;
5233 case 'aes128-cbc':
5234 case 'aes128-ctr':
5235 case 'aes128-gcm@openssh.com':
5236 inf.keySize = 16;
5237 inf.blockSize = 16;
5238 inf.opensslName = 'aes-128-' + cipher.slice(7, 10);
5239 break;
5240 case 'aes192-cbc':
5241 case 'aes192-ctr':
5242 case 'aes192-gcm@openssh.com':
5243 inf.keySize = 24;
5244 inf.blockSize = 16;
5245 inf.opensslName = 'aes-192-' + cipher.slice(7, 10);
5246 break;
5247 case 'aes256-cbc':
5248 case 'aes256-ctr':
5249 case 'aes256-gcm@openssh.com':
5250 inf.keySize = 32;
5251 inf.blockSize = 16;
5252 inf.opensslName = 'aes-256-' + cipher.slice(7, 10);
5253 break;
5254 default:
5255 throw (new Error(
5256 'Unsupported openssl cipher "' + cipher + '"'));
5257 }
5258 return (inf);
5259}
5260
5261
5262/***/ }),
5263/* 33 */
5264/***/ (function(module, exports, __webpack_require__) {
5265
5266var global = __webpack_require__(38);
5267var core = __webpack_require__(26);
5268var ctx = __webpack_require__(67);
5269var hide = __webpack_require__(77);
5270var has = __webpack_require__(89);
5271var PROTOTYPE = 'prototype';
5272
5273var $export = function (type, name, source) {
5274 var IS_FORCED = type & $export.F;
5275 var IS_GLOBAL = type & $export.G;
5276 var IS_STATIC = type & $export.S;
5277 var IS_PROTO = type & $export.P;
5278 var IS_BIND = type & $export.B;
5279 var IS_WRAP = type & $export.W;
5280 var exports = IS_GLOBAL ? core : core[name] || (core[name] = {});
5281 var expProto = exports[PROTOTYPE];
5282 var target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE];
5283 var key, own, out;
5284 if (IS_GLOBAL) source = name;
5285 for (key in source) {
5286 // contains in native
5287 own = !IS_FORCED && target && target[key] !== undefined;
5288 if (own && has(exports, key)) continue;
5289 // export native or passed
5290 out = own ? target[key] : source[key];
5291 // prevent global pollution for namespaces
5292 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
5293 // bind timers to global for call from export context
5294 : IS_BIND && own ? ctx(out, global)
5295 // wrap global constructors for prevent change them in library
5296 : IS_WRAP && target[key] == out ? (function (C) {
5297 var F = function (a, b, c) {
5298 if (this instanceof C) {
5299 switch (arguments.length) {
5300 case 0: return new C();
5301 case 1: return new C(a);
5302 case 2: return new C(a, b);
5303 } return new C(a, b, c);
5304 } return C.apply(this, arguments);
5305 };
5306 F[PROTOTYPE] = C[PROTOTYPE];
5307 return F;
5308 // make static versions for prototype methods
5309 })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;
5310 // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
5311 if (IS_PROTO) {
5312 (exports.virtual || (exports.virtual = {}))[key] = out;
5313 // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
5314 if (type & $export.R && expProto && !expProto[key]) hide(expProto, key, out);
5315 }
5316 }
5317};
5318// type bitmap
5319$export.F = 1; // forced
5320$export.G = 2; // global
5321$export.S = 4; // static
5322$export.P = 8; // proto
5323$export.B = 16; // bind
5324$export.W = 32; // wrap
5325$export.U = 64; // safe
5326$export.R = 128; // real proto method for `library`
5327module.exports = $export;
5328
5329
5330/***/ }),
5331/* 34 */
5332/***/ (function(module, exports, __webpack_require__) {
5333
5334// Copyright 2017 Joyent, Inc.
5335
5336module.exports = Key;
5337
5338var assert = __webpack_require__(22);
5339var algs = __webpack_require__(39);
5340var crypto = __webpack_require__(21);
5341var Fingerprint = __webpack_require__(144);
5342var Signature = __webpack_require__(70);
5343var DiffieHellman = __webpack_require__(265).DiffieHellman;
5344var errs = __webpack_require__(69);
5345var utils = __webpack_require__(32);
5346var PrivateKey = __webpack_require__(40);
5347var edCompat;
5348
5349try {
5350 edCompat = __webpack_require__(424);
5351} catch (e) {
5352 /* Just continue through, and bail out if we try to use it. */
5353}
5354
5355var InvalidAlgorithmError = errs.InvalidAlgorithmError;
5356var KeyParseError = errs.KeyParseError;
5357
5358var formats = {};
5359formats['auto'] = __webpack_require__(425);
5360formats['pem'] = __webpack_require__(82);
5361formats['pkcs1'] = __webpack_require__(267);
5362formats['pkcs8'] = __webpack_require__(145);
5363formats['rfc4253'] = __webpack_require__(92);
5364formats['ssh'] = __webpack_require__(426);
5365formats['ssh-private'] = __webpack_require__(183);
5366formats['openssh'] = formats['ssh-private'];
5367formats['dnssec'] = __webpack_require__(266);
5368
5369function Key(opts) {
5370 assert.object(opts, 'options');
5371 assert.arrayOfObject(opts.parts, 'options.parts');
5372 assert.string(opts.type, 'options.type');
5373 assert.optionalString(opts.comment, 'options.comment');
5374
5375 var algInfo = algs.info[opts.type];
5376 if (typeof (algInfo) !== 'object')
5377 throw (new InvalidAlgorithmError(opts.type));
5378
5379 var partLookup = {};
5380 for (var i = 0; i < opts.parts.length; ++i) {
5381 var part = opts.parts[i];
5382 partLookup[part.name] = part;
5383 }
5384
5385 this.type = opts.type;
5386 this.parts = opts.parts;
5387 this.part = partLookup;
5388 this.comment = undefined;
5389 this.source = opts.source;
5390
5391 /* for speeding up hashing/fingerprint operations */
5392 this._rfc4253Cache = opts._rfc4253Cache;
5393 this._hashCache = {};
5394
5395 var sz;
5396 this.curve = undefined;
5397 if (this.type === 'ecdsa') {
5398 var curve = this.part.curve.data.toString();
5399 this.curve = curve;
5400 sz = algs.curves[curve].size;
5401 } else if (this.type === 'ed25519' || this.type === 'curve25519') {
5402 sz = 256;
5403 this.curve = 'curve25519';
5404 } else {
5405 var szPart = this.part[algInfo.sizePart];
5406 sz = szPart.data.length;
5407 sz = sz * 8 - utils.countZeros(szPart.data);
5408 }
5409 this.size = sz;
5410}
5411
5412Key.formats = formats;
5413
5414Key.prototype.toBuffer = function (format, options) {
5415 if (format === undefined)
5416 format = 'ssh';
5417 assert.string(format, 'format');
5418 assert.object(formats[format], 'formats[format]');
5419 assert.optionalObject(options, 'options');
5420
5421 if (format === 'rfc4253') {
5422 if (this._rfc4253Cache === undefined)
5423 this._rfc4253Cache = formats['rfc4253'].write(this);
5424 return (this._rfc4253Cache);
5425 }
5426
5427 return (formats[format].write(this, options));
5428};
5429
5430Key.prototype.toString = function (format, options) {
5431 return (this.toBuffer(format, options).toString());
5432};
5433
5434Key.prototype.hash = function (algo) {
5435 assert.string(algo, 'algorithm');
5436 algo = algo.toLowerCase();
5437 if (algs.hashAlgs[algo] === undefined)
5438 throw (new InvalidAlgorithmError(algo));
5439
5440 if (this._hashCache[algo])
5441 return (this._hashCache[algo]);
5442 var hash = crypto.createHash(algo).
5443 update(this.toBuffer('rfc4253')).digest();
5444 this._hashCache[algo] = hash;
5445 return (hash);
5446};
5447
5448Key.prototype.fingerprint = function (algo) {
5449 if (algo === undefined)
5450 algo = 'sha256';
5451 assert.string(algo, 'algorithm');
5452 var opts = {
5453 type: 'key',
5454 hash: this.hash(algo),
5455 algorithm: algo
5456 };
5457 return (new Fingerprint(opts));
5458};
5459
5460Key.prototype.defaultHashAlgorithm = function () {
5461 var hashAlgo = 'sha1';
5462 if (this.type === 'rsa')
5463 hashAlgo = 'sha256';
5464 if (this.type === 'dsa' && this.size > 1024)
5465 hashAlgo = 'sha256';
5466 if (this.type === 'ed25519')
5467 hashAlgo = 'sha512';
5468 if (this.type === 'ecdsa') {
5469 if (this.size <= 256)
5470 hashAlgo = 'sha256';
5471 else if (this.size <= 384)
5472 hashAlgo = 'sha384';
5473 else
5474 hashAlgo = 'sha512';
5475 }
5476 return (hashAlgo);
5477};
5478
5479Key.prototype.createVerify = function (hashAlgo) {
5480 if (hashAlgo === undefined)
5481 hashAlgo = this.defaultHashAlgorithm();
5482 assert.string(hashAlgo, 'hash algorithm');
5483
5484 /* ED25519 is not supported by OpenSSL, use a javascript impl. */
5485 if (this.type === 'ed25519' && edCompat !== undefined)
5486 return (new edCompat.Verifier(this, hashAlgo));
5487 if (this.type === 'curve25519')
5488 throw (new Error('Curve25519 keys are not suitable for ' +
5489 'signing or verification'));
5490
5491 var v, nm, err;
5492 try {
5493 nm = hashAlgo.toUpperCase();
5494 v = crypto.createVerify(nm);
5495 } catch (e) {
5496 err = e;
5497 }
5498 if (v === undefined || (err instanceof Error &&
5499 err.message.match(/Unknown message digest/))) {
5500 nm = 'RSA-';
5501 nm += hashAlgo.toUpperCase();
5502 v = crypto.createVerify(nm);
5503 }
5504 assert.ok(v, 'failed to create verifier');
5505 var oldVerify = v.verify.bind(v);
5506 var key = this.toBuffer('pkcs8');
5507 var curve = this.curve;
5508 var self = this;
5509 v.verify = function (signature, fmt) {
5510 if (Signature.isSignature(signature, [2, 0])) {
5511 if (signature.type !== self.type)
5512 return (false);
5513 if (signature.hashAlgorithm &&
5514 signature.hashAlgorithm !== hashAlgo)
5515 return (false);
5516 if (signature.curve && self.type === 'ecdsa' &&
5517 signature.curve !== curve)
5518 return (false);
5519 return (oldVerify(key, signature.toBuffer('asn1')));
5520
5521 } else if (typeof (signature) === 'string' ||
5522 Buffer.isBuffer(signature)) {
5523 return (oldVerify(key, signature, fmt));
5524
5525 /*
5526 * Avoid doing this on valid arguments, walking the prototype
5527 * chain can be quite slow.
5528 */
5529 } else if (Signature.isSignature(signature, [1, 0])) {
5530 throw (new Error('signature was created by too old ' +
5531 'a version of sshpk and cannot be verified'));
5532
5533 } else {
5534 throw (new TypeError('signature must be a string, ' +
5535 'Buffer, or Signature object'));
5536 }
5537 };
5538 return (v);
5539};
5540
5541Key.prototype.createDiffieHellman = function () {
5542 if (this.type === 'rsa')
5543 throw (new Error('RSA keys do not support Diffie-Hellman'));
5544
5545 return (new DiffieHellman(this));
5546};
5547Key.prototype.createDH = Key.prototype.createDiffieHellman;
5548
5549Key.parse = function (data, format, options) {
5550 if (typeof (data) !== 'string')
5551 assert.buffer(data, 'data');
5552 if (format === undefined)
5553 format = 'auto';
5554 assert.string(format, 'format');
5555 if (typeof (options) === 'string')
5556 options = { filename: options };
5557 assert.optionalObject(options, 'options');
5558 if (options === undefined)
5559 options = {};
5560 assert.optionalString(options.filename, 'options.filename');
5561 if (options.filename === undefined)
5562 options.filename = '(unnamed)';
5563
5564 assert.object(formats[format], 'formats[format]');
5565
5566 try {
5567 var k = formats[format].read(data, options);
5568 if (k instanceof PrivateKey)
5569 k = k.toPublic();
5570 if (!k.comment)
5571 k.comment = options.filename;
5572 return (k);
5573 } catch (e) {
5574 if (e.name === 'KeyEncryptedError')
5575 throw (e);
5576 throw (new KeyParseError(options.filename, format, e));
5577 }
5578};
5579
5580Key.isKey = function (obj, ver) {
5581 return (utils.isCompatible(obj, Key, ver));
5582};
5583
5584/*
5585 * API versions for Key:
5586 * [1,0] -- initial ver, may take Signature for createVerify or may not
5587 * [1,1] -- added pkcs1, pkcs8 formats
5588 * [1,2] -- added auto, ssh-private, openssh formats
5589 * [1,3] -- added defaultHashAlgorithm
5590 * [1,4] -- added ed support, createDH
5591 * [1,5] -- first explicitly tagged version
5592 * [1,6] -- changed ed25519 part names
5593 */
5594Key.prototype._sshpkApiVersion = [1, 6];
5595
5596Key._oldVersionDetect = function (obj) {
5597 assert.func(obj.toBuffer);
5598 assert.func(obj.fingerprint);
5599 if (obj.createDH)
5600 return ([1, 4]);
5601 if (obj.defaultHashAlgorithm)
5602 return ([1, 3]);
5603 if (obj.formats['auto'])
5604 return ([1, 2]);
5605 if (obj.formats['pkcs1'])
5606 return ([1, 1]);
5607 return ([1, 0]);
5608};
5609
5610
5611/***/ }),
5612/* 35 */
5613/***/ (function(module, exports) {
5614
5615module.exports = require("stream");
5616
5617/***/ }),
5618/* 36 */
5619/***/ (function(module, exports, __webpack_require__) {
5620
5621module.exports = { "default": __webpack_require__(592), __esModule: true };
5622
5623/***/ }),
5624/* 37 */
5625/***/ (function(module, exports, __webpack_require__) {
5626
5627"use strict";
5628
5629const escapeStringRegexp = __webpack_require__(351);
5630const ansiStyles = __webpack_require__(447);
5631const stdoutColor = __webpack_require__(564).stdout;
5632
5633const template = __webpack_require__(565);
5634
5635const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
5636
5637// `supportsColor.level` → `ansiStyles.color[name]` mapping
5638const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
5639
5640// `color-convert` models to exclude from the Chalk API due to conflicts and such
5641const skipModels = new Set(['gray']);
5642
5643const styles = Object.create(null);
5644
5645function applyOptions(obj, options) {
5646 options = options || {};
5647
5648 // Detect level if not set manually
5649 const scLevel = stdoutColor ? stdoutColor.level : 0;
5650 obj.level = options.level === undefined ? scLevel : options.level;
5651 obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
5652}
5653
5654function Chalk(options) {
5655 // We check for this.template here since calling `chalk.constructor()`
5656 // by itself will have a `this` of a previously constructed chalk object
5657 if (!this || !(this instanceof Chalk) || this.template) {
5658 const chalk = {};
5659 applyOptions(chalk, options);
5660
5661 chalk.template = function () {
5662 const args = [].slice.call(arguments);
5663 return chalkTag.apply(null, [chalk.template].concat(args));
5664 };
5665
5666 Object.setPrototypeOf(chalk, Chalk.prototype);
5667 Object.setPrototypeOf(chalk.template, chalk);
5668
5669 chalk.template.constructor = Chalk;
5670
5671 return chalk.template;
5672 }
5673
5674 applyOptions(this, options);
5675}
5676
5677// Use bright blue on Windows as the normal blue color is illegible
5678if (isSimpleWindowsTerm) {
5679 ansiStyles.blue.open = '\u001B[94m';
5680}
5681
5682for (const key of Object.keys(ansiStyles)) {
5683 ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
5684
5685 styles[key] = {
5686 get() {
5687 const codes = ansiStyles[key];
5688 return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
5689 }
5690 };
5691}
5692
5693styles.visible = {
5694 get() {
5695 return build.call(this, this._styles || [], true, 'visible');
5696 }
5697};
5698
5699ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
5700for (const model of Object.keys(ansiStyles.color.ansi)) {
5701 if (skipModels.has(model)) {
5702 continue;
5703 }
5704
5705 styles[model] = {
5706 get() {
5707 const level = this.level;
5708 return function () {
5709 const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
5710 const codes = {
5711 open,
5712 close: ansiStyles.color.close,
5713 closeRe: ansiStyles.color.closeRe
5714 };
5715 return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
5716 };
5717 }
5718 };
5719}
5720
5721ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
5722for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
5723 if (skipModels.has(model)) {
5724 continue;
5725 }
5726
5727 const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
5728 styles[bgModel] = {
5729 get() {
5730 const level = this.level;
5731 return function () {
5732 const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
5733 const codes = {
5734 open,
5735 close: ansiStyles.bgColor.close,
5736 closeRe: ansiStyles.bgColor.closeRe
5737 };
5738 return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
5739 };
5740 }
5741 };
5742}
5743
5744const proto = Object.defineProperties(() => {}, styles);
5745
5746function build(_styles, _empty, key) {
5747 const builder = function () {
5748 return applyStyle.apply(builder, arguments);
5749 };
5750
5751 builder._styles = _styles;
5752 builder._empty = _empty;
5753
5754 const self = this;
5755
5756 Object.defineProperty(builder, 'level', {
5757 enumerable: true,
5758 get() {
5759 return self.level;
5760 },
5761 set(level) {
5762 self.level = level;
5763 }
5764 });
5765
5766 Object.defineProperty(builder, 'enabled', {
5767 enumerable: true,
5768 get() {
5769 return self.enabled;
5770 },
5771 set(enabled) {
5772 self.enabled = enabled;
5773 }
5774 });
5775
5776 // See below for fix regarding invisible grey/dim combination on Windows
5777 builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
5778
5779 // `__proto__` is used because we must return a function, but there is
5780 // no way to create a function with a different prototype
5781 builder.__proto__ = proto; // eslint-disable-line no-proto
5782
5783 return builder;
5784}
5785
5786function applyStyle() {
5787 // Support varags, but simply cast to string in case there's only one arg
5788 const args = arguments;
5789 const argsLen = args.length;
5790 let str = String(arguments[0]);
5791
5792 if (argsLen === 0) {
5793 return '';
5794 }
5795
5796 if (argsLen > 1) {
5797 // Don't slice `arguments`, it prevents V8 optimizations
5798 for (let a = 1; a < argsLen; a++) {
5799 str += ' ' + args[a];
5800 }
5801 }
5802
5803 if (!this.enabled || this.level <= 0 || !str) {
5804 return this._empty ? '' : str;
5805 }
5806
5807 // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
5808 // see https://github.com/chalk/chalk/issues/58
5809 // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
5810 const originalDim = ansiStyles.dim.open;
5811 if (isSimpleWindowsTerm && this.hasGrey) {
5812 ansiStyles.dim.open = '';
5813 }
5814
5815 for (const code of this._styles.slice().reverse()) {
5816 // Replace any instances already present with a re-opening code
5817 // otherwise only the part of the string until said closing code
5818 // will be colored, and the rest will simply be 'plain'.
5819 str = code.open + str.replace(code.closeRe, code.open) + code.close;
5820
5821 // Close the styling before a linebreak and reopen
5822 // after next line to fix a bleed issue on macOS
5823 // https://github.com/chalk/chalk/pull/92
5824 str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
5825 }
5826
5827 // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue
5828 ansiStyles.dim.open = originalDim;
5829
5830 return str;
5831}
5832
5833function chalkTag(chalk, strings) {
5834 if (!Array.isArray(strings)) {
5835 // If chalk() was called by itself or with a string,
5836 // return the string itself as a string.
5837 return [].slice.call(arguments, 1).join(' ');
5838 }
5839
5840 const args = [].slice.call(arguments, 2);
5841 const parts = [strings.raw[0]];
5842
5843 for (let i = 1; i < strings.length; i++) {
5844 parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&'));
5845 parts.push(String(strings.raw[i]));
5846 }
5847
5848 return template(chalk, parts.join(''));
5849}
5850
5851Object.defineProperties(Chalk.prototype, styles);
5852
5853module.exports = Chalk(); // eslint-disable-line new-cap
5854module.exports.supportsColor = stdoutColor;
5855module.exports.default = module.exports; // For TypeScript
5856
5857
5858/***/ }),
5859/* 38 */
5860/***/ (function(module, exports) {
5861
5862// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
5863var global = module.exports = typeof window != 'undefined' && window.Math == Math
5864 ? window : typeof self != 'undefined' && self.Math == Math ? self
5865 // eslint-disable-next-line no-new-func
5866 : Function('return this')();
5867if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
5868
5869
5870/***/ }),
5871/* 39 */
5872/***/ (function(module, exports, __webpack_require__) {
5873
5874// Copyright 2015 Joyent, Inc.
5875
5876var Buffer = __webpack_require__(20).Buffer;
5877
5878var algInfo = {
5879 'dsa': {
5880 parts: ['p', 'q', 'g', 'y'],
5881 sizePart: 'p'
5882 },
5883 'rsa': {
5884 parts: ['e', 'n'],
5885 sizePart: 'n'
5886 },
5887 'ecdsa': {
5888 parts: ['curve', 'Q'],
5889 sizePart: 'Q'
5890 },
5891 'ed25519': {
5892 parts: ['A'],
5893 sizePart: 'A'
5894 }
5895};
5896algInfo['curve25519'] = algInfo['ed25519'];
5897
5898var algPrivInfo = {
5899 'dsa': {
5900 parts: ['p', 'q', 'g', 'y', 'x']
5901 },
5902 'rsa': {
5903 parts: ['n', 'e', 'd', 'iqmp', 'p', 'q']
5904 },
5905 'ecdsa': {
5906 parts: ['curve', 'Q', 'd']
5907 },
5908 'ed25519': {
5909 parts: ['A', 'k']
5910 }
5911};
5912algPrivInfo['curve25519'] = algPrivInfo['ed25519'];
5913
5914var hashAlgs = {
5915 'md5': true,
5916 'sha1': true,
5917 'sha256': true,
5918 'sha384': true,
5919 'sha512': true
5920};
5921
5922/*
5923 * Taken from
5924 * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf
5925 */
5926var curves = {
5927 'nistp256': {
5928 size: 256,
5929 pkcs8oid: '1.2.840.10045.3.1.7',
5930 p: Buffer.from(('00' +
5931 'ffffffff 00000001 00000000 00000000' +
5932 '00000000 ffffffff ffffffff ffffffff').
5933 replace(/ /g, ''), 'hex'),
5934 a: Buffer.from(('00' +
5935 'FFFFFFFF 00000001 00000000 00000000' +
5936 '00000000 FFFFFFFF FFFFFFFF FFFFFFFC').
5937 replace(/ /g, ''), 'hex'),
5938 b: Buffer.from((
5939 '5ac635d8 aa3a93e7 b3ebbd55 769886bc' +
5940 '651d06b0 cc53b0f6 3bce3c3e 27d2604b').
5941 replace(/ /g, ''), 'hex'),
5942 s: Buffer.from(('00' +
5943 'c49d3608 86e70493 6a6678e1 139d26b7' +
5944 '819f7e90').
5945 replace(/ /g, ''), 'hex'),
5946 n: Buffer.from(('00' +
5947 'ffffffff 00000000 ffffffff ffffffff' +
5948 'bce6faad a7179e84 f3b9cac2 fc632551').
5949 replace(/ /g, ''), 'hex'),
5950 G: Buffer.from(('04' +
5951 '6b17d1f2 e12c4247 f8bce6e5 63a440f2' +
5952 '77037d81 2deb33a0 f4a13945 d898c296' +
5953 '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' +
5954 '2bce3357 6b315ece cbb64068 37bf51f5').
5955 replace(/ /g, ''), 'hex')
5956 },
5957 'nistp384': {
5958 size: 384,
5959 pkcs8oid: '1.3.132.0.34',
5960 p: Buffer.from(('00' +
5961 'ffffffff ffffffff ffffffff ffffffff' +
5962 'ffffffff ffffffff ffffffff fffffffe' +
5963 'ffffffff 00000000 00000000 ffffffff').
5964 replace(/ /g, ''), 'hex'),
5965 a: Buffer.from(('00' +
5966 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +
5967 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' +
5968 'FFFFFFFF 00000000 00000000 FFFFFFFC').
5969 replace(/ /g, ''), 'hex'),
5970 b: Buffer.from((
5971 'b3312fa7 e23ee7e4 988e056b e3f82d19' +
5972 '181d9c6e fe814112 0314088f 5013875a' +
5973 'c656398d 8a2ed19d 2a85c8ed d3ec2aef').
5974 replace(/ /g, ''), 'hex'),
5975 s: Buffer.from(('00' +
5976 'a335926a a319a27a 1d00896a 6773a482' +
5977 '7acdac73').
5978 replace(/ /g, ''), 'hex'),
5979 n: Buffer.from(('00' +
5980 'ffffffff ffffffff ffffffff ffffffff' +
5981 'ffffffff ffffffff c7634d81 f4372ddf' +
5982 '581a0db2 48b0a77a ecec196a ccc52973').
5983 replace(/ /g, ''), 'hex'),
5984 G: Buffer.from(('04' +
5985 'aa87ca22 be8b0537 8eb1c71e f320ad74' +
5986 '6e1d3b62 8ba79b98 59f741e0 82542a38' +
5987 '5502f25d bf55296c 3a545e38 72760ab7' +
5988 '3617de4a 96262c6f 5d9e98bf 9292dc29' +
5989 'f8f41dbd 289a147c e9da3113 b5f0b8c0' +
5990 '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f').
5991 replace(/ /g, ''), 'hex')
5992 },
5993 'nistp521': {
5994 size: 521,
5995 pkcs8oid: '1.3.132.0.35',
5996 p: Buffer.from((
5997 '01ffffff ffffffff ffffffff ffffffff' +
5998 'ffffffff ffffffff ffffffff ffffffff' +
5999 'ffffffff ffffffff ffffffff ffffffff' +
6000 'ffffffff ffffffff ffffffff ffffffff' +
6001 'ffff').replace(/ /g, ''), 'hex'),
6002 a: Buffer.from(('01FF' +
6003 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +
6004 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +
6005 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +
6006 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC').
6007 replace(/ /g, ''), 'hex'),
6008 b: Buffer.from(('51' +
6009 '953eb961 8e1c9a1f 929a21a0 b68540ee' +
6010 'a2da725b 99b315f3 b8b48991 8ef109e1' +
6011 '56193951 ec7e937b 1652c0bd 3bb1bf07' +
6012 '3573df88 3d2c34f1 ef451fd4 6b503f00').
6013 replace(/ /g, ''), 'hex'),
6014 s: Buffer.from(('00' +
6015 'd09e8800 291cb853 96cc6717 393284aa' +
6016 'a0da64ba').replace(/ /g, ''), 'hex'),
6017 n: Buffer.from(('01ff' +
6018 'ffffffff ffffffff ffffffff ffffffff' +
6019 'ffffffff ffffffff ffffffff fffffffa' +
6020 '51868783 bf2f966b 7fcc0148 f709a5d0' +
6021 '3bb5c9b8 899c47ae bb6fb71e 91386409').
6022 replace(/ /g, ''), 'hex'),
6023 G: Buffer.from(('04' +
6024 '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' +
6025 '9c648139 053fb521 f828af60 6b4d3dba' +
6026 'a14b5e77 efe75928 fe1dc127 a2ffa8de' +
6027 '3348b3c1 856a429b f97e7e31 c2e5bd66' +
6028 '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' +
6029 '98f54449 579b4468 17afbd17 273e662c' +
6030 '97ee7299 5ef42640 c550b901 3fad0761' +
6031 '353c7086 a272c240 88be9476 9fd16650').
6032 replace(/ /g, ''), 'hex')
6033 }
6034};
6035
6036module.exports = {
6037 info: algInfo,
6038 privInfo: algPrivInfo,
6039 hashAlgs: hashAlgs,
6040 curves: curves
6041};
6042
6043
6044/***/ }),
6045/* 40 */
6046/***/ (function(module, exports, __webpack_require__) {
6047
6048// Copyright 2017 Joyent, Inc.
6049
6050module.exports = PrivateKey;
6051
6052var assert = __webpack_require__(22);
6053var Buffer = __webpack_require__(20).Buffer;
6054var algs = __webpack_require__(39);
6055var crypto = __webpack_require__(21);
6056var Fingerprint = __webpack_require__(144);
6057var Signature = __webpack_require__(70);
6058var errs = __webpack_require__(69);
6059var util = __webpack_require__(9);
6060var utils = __webpack_require__(32);
6061var dhe = __webpack_require__(265);
6062var generateECDSA = dhe.generateECDSA;
6063var generateED25519 = dhe.generateED25519;
6064var edCompat;
6065var nacl;
6066
6067try {
6068 edCompat = __webpack_require__(424);
6069} catch (e) {
6070 /* Just continue through, and bail out if we try to use it. */
6071}
6072
6073var Key = __webpack_require__(34);
6074
6075var InvalidAlgorithmError = errs.InvalidAlgorithmError;
6076var KeyParseError = errs.KeyParseError;
6077var KeyEncryptedError = errs.KeyEncryptedError;
6078
6079var formats = {};
6080formats['auto'] = __webpack_require__(425);
6081formats['pem'] = __webpack_require__(82);
6082formats['pkcs1'] = __webpack_require__(267);
6083formats['pkcs8'] = __webpack_require__(145);
6084formats['rfc4253'] = __webpack_require__(92);
6085formats['ssh-private'] = __webpack_require__(183);
6086formats['openssh'] = formats['ssh-private'];
6087formats['ssh'] = formats['ssh-private'];
6088formats['dnssec'] = __webpack_require__(266);
6089
6090function PrivateKey(opts) {
6091 assert.object(opts, 'options');
6092 Key.call(this, opts);
6093
6094 this._pubCache = undefined;
6095}
6096util.inherits(PrivateKey, Key);
6097
6098PrivateKey.formats = formats;
6099
6100PrivateKey.prototype.toBuffer = function (format, options) {
6101 if (format === undefined)
6102 format = 'pkcs1';
6103 assert.string(format, 'format');
6104 assert.object(formats[format], 'formats[format]');
6105 assert.optionalObject(options, 'options');
6106
6107 return (formats[format].write(this, options));
6108};
6109
6110PrivateKey.prototype.hash = function (algo) {
6111 return (this.toPublic().hash(algo));
6112};
6113
6114PrivateKey.prototype.toPublic = function () {
6115 if (this._pubCache)
6116 return (this._pubCache);
6117
6118 var algInfo = algs.info[this.type];
6119 var pubParts = [];
6120 for (var i = 0; i < algInfo.parts.length; ++i) {
6121 var p = algInfo.parts[i];
6122 pubParts.push(this.part[p]);
6123 }
6124
6125 this._pubCache = new Key({
6126 type: this.type,
6127 source: this,
6128 parts: pubParts
6129 });
6130 if (this.comment)
6131 this._pubCache.comment = this.comment;
6132 return (this._pubCache);
6133};
6134
6135PrivateKey.prototype.derive = function (newType) {
6136 assert.string(newType, 'type');
6137 var priv, pub, pair;
6138
6139 if (this.type === 'ed25519' && newType === 'curve25519') {
6140 if (nacl === undefined)
6141 nacl = __webpack_require__(71);
6142
6143 priv = this.part.k.data;
6144 if (priv[0] === 0x00)
6145 priv = priv.slice(1);
6146
6147 pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv));
6148 pub = Buffer.from(pair.publicKey);
6149
6150 return (new PrivateKey({
6151 type: 'curve25519',
6152 parts: [
6153 { name: 'A', data: utils.mpNormalize(pub) },
6154 { name: 'k', data: utils.mpNormalize(priv) }
6155 ]
6156 }));
6157 } else if (this.type === 'curve25519' && newType === 'ed25519') {
6158 if (nacl === undefined)
6159 nacl = __webpack_require__(71);
6160
6161 priv = this.part.k.data;
6162 if (priv[0] === 0x00)
6163 priv = priv.slice(1);
6164
6165 pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv));
6166 pub = Buffer.from(pair.publicKey);
6167
6168 return (new PrivateKey({
6169 type: 'ed25519',
6170 parts: [
6171 { name: 'A', data: utils.mpNormalize(pub) },
6172 { name: 'k', data: utils.mpNormalize(priv) }
6173 ]
6174 }));
6175 }
6176 throw (new Error('Key derivation not supported from ' + this.type +
6177 ' to ' + newType));
6178};
6179
6180PrivateKey.prototype.createVerify = function (hashAlgo) {
6181 return (this.toPublic().createVerify(hashAlgo));
6182};
6183
6184PrivateKey.prototype.createSign = function (hashAlgo) {
6185 if (hashAlgo === undefined)
6186 hashAlgo = this.defaultHashAlgorithm();
6187 assert.string(hashAlgo, 'hash algorithm');
6188
6189 /* ED25519 is not supported by OpenSSL, use a javascript impl. */
6190 if (this.type === 'ed25519' && edCompat !== undefined)
6191 return (new edCompat.Signer(this, hashAlgo));
6192 if (this.type === 'curve25519')
6193 throw (new Error('Curve25519 keys are not suitable for ' +
6194 'signing or verification'));
6195
6196 var v, nm, err;
6197 try {
6198 nm = hashAlgo.toUpperCase();
6199 v = crypto.createSign(nm);
6200 } catch (e) {
6201 err = e;
6202 }
6203 if (v === undefined || (err instanceof Error &&
6204 err.message.match(/Unknown message digest/))) {
6205 nm = 'RSA-';
6206 nm += hashAlgo.toUpperCase();
6207 v = crypto.createSign(nm);
6208 }
6209 assert.ok(v, 'failed to create verifier');
6210 var oldSign = v.sign.bind(v);
6211 var key = this.toBuffer('pkcs1');
6212 var type = this.type;
6213 var curve = this.curve;
6214 v.sign = function () {
6215 var sig = oldSign(key);
6216 if (typeof (sig) === 'string')
6217 sig = Buffer.from(sig, 'binary');
6218 sig = Signature.parse(sig, type, 'asn1');
6219 sig.hashAlgorithm = hashAlgo;
6220 sig.curve = curve;
6221 return (sig);
6222 };
6223 return (v);
6224};
6225
6226PrivateKey.parse = function (data, format, options) {
6227 if (typeof (data) !== 'string')
6228 assert.buffer(data, 'data');
6229 if (format === undefined)
6230 format = 'auto';
6231 assert.string(format, 'format');
6232 if (typeof (options) === 'string')
6233 options = { filename: options };
6234 assert.optionalObject(options, 'options');
6235 if (options === undefined)
6236 options = {};
6237 assert.optionalString(options.filename, 'options.filename');
6238 if (options.filename === undefined)
6239 options.filename = '(unnamed)';
6240
6241 assert.object(formats[format], 'formats[format]');
6242
6243 try {
6244 var k = formats[format].read(data, options);
6245 assert.ok(k instanceof PrivateKey, 'key is not a private key');
6246 if (!k.comment)
6247 k.comment = options.filename;
6248 return (k);
6249 } catch (e) {
6250 if (e.name === 'KeyEncryptedError')
6251 throw (e);
6252 throw (new KeyParseError(options.filename, format, e));
6253 }
6254};
6255
6256PrivateKey.isPrivateKey = function (obj, ver) {
6257 return (utils.isCompatible(obj, PrivateKey, ver));
6258};
6259
6260PrivateKey.generate = function (type, options) {
6261 if (options === undefined)
6262 options = {};
6263 assert.object(options, 'options');
6264
6265 switch (type) {
6266 case 'ecdsa':
6267 if (options.curve === undefined)
6268 options.curve = 'nistp256';
6269 assert.string(options.curve, 'options.curve');
6270 return (generateECDSA(options.curve));
6271 case 'ed25519':
6272 return (generateED25519());
6273 default:
6274 throw (new Error('Key generation not supported with key ' +
6275 'type "' + type + '"'));
6276 }
6277};
6278
6279/*
6280 * API versions for PrivateKey:
6281 * [1,0] -- initial ver
6282 * [1,1] -- added auto, pkcs[18], openssh/ssh-private formats
6283 * [1,2] -- added defaultHashAlgorithm
6284 * [1,3] -- added derive, ed, createDH
6285 * [1,4] -- first tagged version
6286 * [1,5] -- changed ed25519 part names and format
6287 */
6288PrivateKey.prototype._sshpkApiVersion = [1, 5];
6289
6290PrivateKey._oldVersionDetect = function (obj) {
6291 assert.func(obj.toPublic);
6292 assert.func(obj.createSign);
6293 if (obj.derive)
6294 return ([1, 3]);
6295 if (obj.defaultHashAlgorithm)
6296 return ([1, 2]);
6297 if (obj.formats['auto'])
6298 return ([1, 1]);
6299 return ([1, 0]);
6300};
6301
6302
6303/***/ }),
6304/* 41 */
6305/***/ (function(module, exports, __webpack_require__) {
6306
6307"use strict";
6308
6309
6310Object.defineProperty(exports, "__esModule", {
6311 value: true
6312});
6313exports.wrapLifecycle = exports.run = exports.install = exports.Install = undefined;
6314
6315var _set;
6316
6317function _load_set() {
6318 return _set = _interopRequireDefault(__webpack_require__(16));
6319}
6320
6321var _promise;
6322
6323function _load_promise() {
6324 return _promise = _interopRequireDefault(__webpack_require__(7));
6325}
6326
6327var _values;
6328
6329function _load_values() {
6330 return _values = _interopRequireDefault(__webpack_require__(551));
6331}
6332
6333var _extends2;
6334
6335function _load_extends() {
6336 return _extends2 = _interopRequireDefault(__webpack_require__(24));
6337}
6338
6339var _assign;
6340
6341function _load_assign() {
6342 return _assign = _interopRequireDefault(__webpack_require__(23));
6343}
6344
6345var _keys;
6346
6347function _load_keys() {
6348 return _keys = _interopRequireDefault(__webpack_require__(14));
6349}
6350
6351var _getIterator2;
6352
6353function _load_getIterator() {
6354 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
6355}
6356
6357var _asyncToGenerator2;
6358
6359function _load_asyncToGenerator() {
6360 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
6361}
6362
6363var _classCallCheck2;
6364
6365function _load_classCallCheck() {
6366 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
6367}
6368
6369var install = exports.install = function () {
6370 var _ref43 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile) {
6371 yield wrapLifecycle(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
6372 var install = new Install(flags, config, reporter, lockfile);
6373 yield install.init();
6374 }));
6375 });
6376
6377 return function install(_x16, _x17, _x18, _x19) {
6378 return _ref43.apply(this, arguments);
6379 };
6380}();
6381
6382var run = exports.run = function () {
6383 var _ref45 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
6384 var lockfile = void 0;
6385 var error = 'installCommandRenamed';
6386 if (flags.lockfile === false) {
6387 lockfile = new (_lockfile || _load_lockfile()).default();
6388 } else {
6389 lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
6390 }
6391
6392 if (args.length) {
6393 var exampleArgs = args.slice();
6394
6395 if (flags.saveDev) {
6396 exampleArgs.push('--dev');
6397 }
6398 if (flags.savePeer) {
6399 exampleArgs.push('--peer');
6400 }
6401 if (flags.saveOptional) {
6402 exampleArgs.push('--optional');
6403 }
6404 if (flags.saveExact) {
6405 exampleArgs.push('--exact');
6406 }
6407 if (flags.saveTilde) {
6408 exampleArgs.push('--tilde');
6409 }
6410 var command = 'add';
6411 if (flags.global) {
6412 error = 'globalFlagRemoved';
6413 command = 'global add';
6414 }
6415 throw new (_errors || _load_errors()).MessageError(reporter.lang(error, `yarn ${command} ${exampleArgs.join(' ')}`));
6416 }
6417
6418 yield install(config, reporter, flags, lockfile);
6419 });
6420
6421 return function run(_x20, _x21, _x22, _x23) {
6422 return _ref45.apply(this, arguments);
6423 };
6424}();
6425
6426var wrapLifecycle = exports.wrapLifecycle = function () {
6427 var _ref46 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags, factory) {
6428 yield config.executeLifecycleScript('preinstall');
6429
6430 yield factory();
6431
6432 // npm behaviour, seems kinda funky but yay compatibility
6433 yield config.executeLifecycleScript('install');
6434 yield config.executeLifecycleScript('postinstall');
6435
6436 if (!config.production) {
6437 if (!config.disablePrepublish) {
6438 yield config.executeLifecycleScript('prepublish');
6439 }
6440 yield config.executeLifecycleScript('prepare');
6441 }
6442 });
6443
6444 return function wrapLifecycle(_x24, _x25, _x26) {
6445 return _ref46.apply(this, arguments);
6446 };
6447}();
6448
6449exports.hasWrapper = hasWrapper;
6450exports.setFlags = setFlags;
6451
6452var _objectPath;
6453
6454function _load_objectPath() {
6455 return _objectPath = _interopRequireDefault(__webpack_require__(244));
6456}
6457
6458var _hooks;
6459
6460function _load_hooks() {
6461 return _hooks = __webpack_require__(311);
6462}
6463
6464var _index;
6465
6466function _load_index() {
6467 return _index = _interopRequireDefault(__webpack_require__(206));
6468}
6469
6470var _errors;
6471
6472function _load_errors() {
6473 return _errors = __webpack_require__(6);
6474}
6475
6476var _integrityChecker;
6477
6478function _load_integrityChecker() {
6479 return _integrityChecker = _interopRequireDefault(__webpack_require__(195));
6480}
6481
6482var _lockfile;
6483
6484function _load_lockfile() {
6485 return _lockfile = _interopRequireDefault(__webpack_require__(25));
6486}
6487
6488var _lockfile2;
6489
6490function _load_lockfile2() {
6491 return _lockfile2 = __webpack_require__(25);
6492}
6493
6494var _packageFetcher;
6495
6496function _load_packageFetcher() {
6497 return _packageFetcher = _interopRequireWildcard(__webpack_require__(197));
6498}
6499
6500var _packageInstallScripts;
6501
6502function _load_packageInstallScripts() {
6503 return _packageInstallScripts = _interopRequireDefault(__webpack_require__(513));
6504}
6505
6506var _packageCompatibility;
6507
6508function _load_packageCompatibility() {
6509 return _packageCompatibility = _interopRequireWildcard(__webpack_require__(196));
6510}
6511
6512var _packageResolver;
6513
6514function _load_packageResolver() {
6515 return _packageResolver = _interopRequireDefault(__webpack_require__(303));
6516}
6517
6518var _packageLinker;
6519
6520function _load_packageLinker() {
6521 return _packageLinker = _interopRequireDefault(__webpack_require__(198));
6522}
6523
6524var _index2;
6525
6526function _load_index2() {
6527 return _index2 = __webpack_require__(61);
6528}
6529
6530var _index3;
6531
6532function _load_index3() {
6533 return _index3 = __webpack_require__(75);
6534}
6535
6536var _autoclean;
6537
6538function _load_autoclean() {
6539 return _autoclean = __webpack_require__(290);
6540}
6541
6542var _constants;
6543
6544function _load_constants() {
6545 return _constants = _interopRequireWildcard(__webpack_require__(13));
6546}
6547
6548var _normalizePattern;
6549
6550function _load_normalizePattern() {
6551 return _normalizePattern = __webpack_require__(52);
6552}
6553
6554var _fs;
6555
6556function _load_fs() {
6557 return _fs = _interopRequireWildcard(__webpack_require__(8));
6558}
6559
6560var _map;
6561
6562function _load_map() {
6563 return _map = _interopRequireDefault(__webpack_require__(51));
6564}
6565
6566var _yarnVersion;
6567
6568function _load_yarnVersion() {
6569 return _yarnVersion = __webpack_require__(96);
6570}
6571
6572var _generatePnpMap;
6573
6574function _load_generatePnpMap() {
6575 return _generatePnpMap = __webpack_require__(536);
6576}
6577
6578var _workspaceLayout;
6579
6580function _load_workspaceLayout() {
6581 return _workspaceLayout = _interopRequireDefault(__webpack_require__(87));
6582}
6583
6584var _resolutionMap;
6585
6586function _load_resolutionMap() {
6587 return _resolutionMap = _interopRequireDefault(__webpack_require__(201));
6588}
6589
6590var _guessName;
6591
6592function _load_guessName() {
6593 return _guessName = _interopRequireDefault(__webpack_require__(159));
6594}
6595
6596var _audit;
6597
6598function _load_audit() {
6599 return _audit = _interopRequireDefault(__webpack_require__(289));
6600}
6601
6602function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
6603
6604function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6605
6606var deepEqual = __webpack_require__(654);
6607
6608var emoji = __webpack_require__(242);
6609var invariant = __webpack_require__(15);
6610var path = __webpack_require__(1);
6611var semver = __webpack_require__(27);
6612var uuid = __webpack_require__(114);
6613var ssri = __webpack_require__(93);
6614
6615var ONE_DAY = 1000 * 60 * 60 * 24;
6616
6617/**
6618 * Try and detect the installation method for Yarn and provide a command to update it with.
6619 */
6620
6621function getUpdateCommand(installationMethod) {
6622 if (installationMethod === 'tar') {
6623 return `curl --compressed -o- -L ${(_constants || _load_constants()).YARN_INSTALLER_SH} | bash`;
6624 }
6625
6626 if (installationMethod === 'homebrew') {
6627 return 'brew upgrade yarn';
6628 }
6629
6630 if (installationMethod === 'deb') {
6631 return 'sudo apt-get update && sudo apt-get install yarn';
6632 }
6633
6634 if (installationMethod === 'rpm') {
6635 return 'sudo yum install yarn';
6636 }
6637
6638 if (installationMethod === 'npm') {
6639 return 'npm install --global yarn';
6640 }
6641
6642 if (installationMethod === 'chocolatey') {
6643 return 'choco upgrade yarn';
6644 }
6645
6646 if (installationMethod === 'apk') {
6647 return 'apk update && apk add -u yarn';
6648 }
6649
6650 if (installationMethod === 'portage') {
6651 return 'sudo emerge --sync && sudo emerge -au sys-apps/yarn';
6652 }
6653
6654 return null;
6655}
6656
6657function getUpdateInstaller(installationMethod) {
6658 // Windows
6659 if (installationMethod === 'msi') {
6660 return (_constants || _load_constants()).YARN_INSTALLER_MSI;
6661 }
6662
6663 return null;
6664}
6665
6666function normalizeFlags(config, rawFlags) {
6667 var flags = {
6668 // install
6669 har: !!rawFlags.har,
6670 ignorePlatform: !!rawFlags.ignorePlatform,
6671 ignoreEngines: !!rawFlags.ignoreEngines,
6672 ignoreScripts: !!rawFlags.ignoreScripts,
6673 ignoreOptional: !!rawFlags.ignoreOptional,
6674 force: !!rawFlags.force,
6675 flat: !!rawFlags.flat,
6676 lockfile: rawFlags.lockfile !== false,
6677 pureLockfile: !!rawFlags.pureLockfile,
6678 updateChecksums: !!rawFlags.updateChecksums,
6679 skipIntegrityCheck: !!rawFlags.skipIntegrityCheck,
6680 frozenLockfile: !!rawFlags.frozenLockfile,
6681 linkDuplicates: !!rawFlags.linkDuplicates,
6682 checkFiles: !!rawFlags.checkFiles,
6683 audit: !!rawFlags.audit,
6684
6685 // add
6686 peer: !!rawFlags.peer,
6687 dev: !!rawFlags.dev,
6688 optional: !!rawFlags.optional,
6689 exact: !!rawFlags.exact,
6690 tilde: !!rawFlags.tilde,
6691 ignoreWorkspaceRootCheck: !!rawFlags.ignoreWorkspaceRootCheck,
6692
6693 // outdated, update-interactive
6694 includeWorkspaceDeps: !!rawFlags.includeWorkspaceDeps,
6695
6696 // add, remove, update
6697 workspaceRootIsCwd: rawFlags.workspaceRootIsCwd !== false
6698 };
6699
6700 if (config.getOption('ignore-scripts')) {
6701 flags.ignoreScripts = true;
6702 }
6703
6704 if (config.getOption('ignore-platform')) {
6705 flags.ignorePlatform = true;
6706 }
6707
6708 if (config.getOption('ignore-engines')) {
6709 flags.ignoreEngines = true;
6710 }
6711
6712 if (config.getOption('ignore-optional')) {
6713 flags.ignoreOptional = true;
6714 }
6715
6716 if (config.getOption('force')) {
6717 flags.force = true;
6718 }
6719
6720 return flags;
6721}
6722
6723var Install = exports.Install = function () {
6724 function Install(flags, config, reporter, lockfile) {
6725 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Install);
6726
6727 this.rootManifestRegistries = [];
6728 this.rootPatternsToOrigin = (0, (_map || _load_map()).default)();
6729 this.lockfile = lockfile;
6730 this.reporter = reporter;
6731 this.config = config;
6732 this.flags = normalizeFlags(config, flags);
6733 this.resolutions = (0, (_map || _load_map()).default)(); // Legacy resolutions field used for flat install mode
6734 this.resolutionMap = new (_resolutionMap || _load_resolutionMap()).default(config); // Selective resolutions for nested dependencies
6735 this.resolver = new (_packageResolver || _load_packageResolver()).default(config, lockfile, this.resolutionMap);
6736 this.integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config);
6737 this.linker = new (_packageLinker || _load_packageLinker()).default(config, this.resolver);
6738 this.scripts = new (_packageInstallScripts || _load_packageInstallScripts()).default(config, this.resolver, this.flags.force);
6739 }
6740
6741 /**
6742 * Create a list of dependency requests from the current directories manifests.
6743 */
6744
6745 Install.prototype.fetchRequestFromCwd = function () {
6746 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
6747 var _this = this;
6748
6749 var excludePatterns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6750 var ignoreUnusedPatterns = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6751
6752 var patterns = [];
6753 var deps = [];
6754 var resolutionDeps = [];
6755 var manifest = {};
6756
6757 var ignorePatterns = [];
6758 var usedPatterns = [];
6759 var workspaceLayout = void 0;
6760
6761 // some commands should always run in the context of the entire workspace
6762 var cwd = this.flags.includeWorkspaceDeps || this.flags.workspaceRootIsCwd ? this.config.lockfileFolder : this.config.cwd;
6763
6764 // non-workspaces are always root, otherwise check for workspace root
6765 var cwdIsRoot = !this.config.workspaceRootFolder || this.config.lockfileFolder === cwd;
6766
6767 // exclude package names that are in install args
6768 var excludeNames = [];
6769 for (var _iterator = excludePatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
6770 var _ref2;
6771
6772 if (_isArray) {
6773 if (_i >= _iterator.length) break;
6774 _ref2 = _iterator[_i++];
6775 } else {
6776 _i = _iterator.next();
6777 if (_i.done) break;
6778 _ref2 = _i.value;
6779 }
6780
6781 var _pattern = _ref2;
6782
6783 if ((0, (_index3 || _load_index3()).getExoticResolver)(_pattern)) {
6784 excludeNames.push((0, (_guessName || _load_guessName()).default)(_pattern));
6785 } else {
6786 // extract the name
6787 var parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(_pattern);
6788 excludeNames.push(parts.name);
6789 }
6790 }
6791
6792 var stripExcluded = function stripExcluded(manifest) {
6793 for (var _iterator2 = excludeNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
6794 var _ref3;
6795
6796 if (_isArray2) {
6797 if (_i2 >= _iterator2.length) break;
6798 _ref3 = _iterator2[_i2++];
6799 } else {
6800 _i2 = _iterator2.next();
6801 if (_i2.done) break;
6802 _ref3 = _i2.value;
6803 }
6804
6805 var exclude = _ref3;
6806
6807 if (manifest.dependencies && manifest.dependencies[exclude]) {
6808 delete manifest.dependencies[exclude];
6809 }
6810 if (manifest.devDependencies && manifest.devDependencies[exclude]) {
6811 delete manifest.devDependencies[exclude];
6812 }
6813 if (manifest.optionalDependencies && manifest.optionalDependencies[exclude]) {
6814 delete manifest.optionalDependencies[exclude];
6815 }
6816 }
6817 };
6818
6819 var _loop = function* _loop(registry) {
6820 var filename = (_index2 || _load_index2()).registries[registry].filename;
6821
6822 var loc = path.join(cwd, filename);
6823 if (!(yield (_fs || _load_fs()).exists(loc))) {
6824 return 'continue';
6825 }
6826
6827 _this.rootManifestRegistries.push(registry);
6828
6829 var projectManifestJson = yield _this.config.readJson(loc);
6830 yield (0, (_index || _load_index()).default)(projectManifestJson, cwd, _this.config, cwdIsRoot);
6831
6832 (0, (_assign || _load_assign()).default)(_this.resolutions, projectManifestJson.resolutions);
6833 (0, (_assign || _load_assign()).default)(manifest, projectManifestJson);
6834
6835 _this.resolutionMap.init(_this.resolutions);
6836 for (var _iterator4 = (0, (_keys || _load_keys()).default)(_this.resolutionMap.resolutionsByPackage), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
6837 var _ref5;
6838
6839 if (_isArray4) {
6840 if (_i4 >= _iterator4.length) break;
6841 _ref5 = _iterator4[_i4++];
6842 } else {
6843 _i4 = _iterator4.next();
6844 if (_i4.done) break;
6845 _ref5 = _i4.value;
6846 }
6847
6848 var _packageName = _ref5;
6849
6850 var _optional = (_objectPath || _load_objectPath()).default.has(manifest.optionalDependencies, _packageName) && _this.flags.ignoreOptional;
6851 for (var _iterator8 = _this.resolutionMap.resolutionsByPackage[_packageName], _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
6852 var _ref11;
6853
6854 if (_isArray8) {
6855 if (_i8 >= _iterator8.length) break;
6856 _ref11 = _iterator8[_i8++];
6857 } else {
6858 _i8 = _iterator8.next();
6859 if (_i8.done) break;
6860 _ref11 = _i8.value;
6861 }
6862
6863 var _ref10 = _ref11;
6864 var _pattern3 = _ref10.pattern;
6865
6866 resolutionDeps = [].concat(resolutionDeps, [{ registry, pattern: _pattern3, optional: _optional, hint: 'resolution' }]);
6867 }
6868 }
6869
6870 var pushDeps = function pushDeps(depType, manifest, _ref6, isUsed) {
6871 var hint = _ref6.hint,
6872 optional = _ref6.optional;
6873
6874 if (ignoreUnusedPatterns && !isUsed) {
6875 return;
6876 }
6877 // We only take unused dependencies into consideration to get deterministic hoisting.
6878 // Since flat mode doesn't care about hoisting and everything is top level and specified then we can safely
6879 // leave these out.
6880 if (_this.flags.flat && !isUsed) {
6881 return;
6882 }
6883 var depMap = manifest[depType];
6884 for (var name in depMap) {
6885 if (excludeNames.indexOf(name) >= 0) {
6886 continue;
6887 }
6888
6889 var _pattern2 = name;
6890 if (!_this.lockfile.getLocked(_pattern2)) {
6891 // when we use --save we save the dependency to the lockfile with just the name rather than the
6892 // version combo
6893 _pattern2 += '@' + depMap[name];
6894 }
6895
6896 // normalization made sure packages are mentioned only once
6897 if (isUsed) {
6898 usedPatterns.push(_pattern2);
6899 } else {
6900 ignorePatterns.push(_pattern2);
6901 }
6902
6903 _this.rootPatternsToOrigin[_pattern2] = depType;
6904 patterns.push(_pattern2);
6905 deps.push({ pattern: _pattern2, registry, hint, optional, workspaceName: manifest.name, workspaceLoc: manifest._loc });
6906 }
6907 };
6908
6909 if (cwdIsRoot) {
6910 pushDeps('dependencies', projectManifestJson, { hint: null, optional: false }, true);
6911 pushDeps('devDependencies', projectManifestJson, { hint: 'dev', optional: false }, !_this.config.production);
6912 pushDeps('optionalDependencies', projectManifestJson, { hint: 'optional', optional: true }, true);
6913 }
6914
6915 if (_this.config.workspaceRootFolder) {
6916 var workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename);
6917 var workspacesRoot = path.dirname(workspaceLoc);
6918
6919 var workspaceManifestJson = projectManifestJson;
6920 if (!cwdIsRoot) {
6921 // the manifest we read before was a child workspace, so get the root
6922 workspaceManifestJson = yield _this.config.readJson(workspaceLoc);
6923 yield (0, (_index || _load_index()).default)(workspaceManifestJson, workspacesRoot, _this.config, true);
6924 }
6925
6926 var workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson);
6927 workspaceLayout = new (_workspaceLayout || _load_workspaceLayout()).default(workspaces, _this.config);
6928
6929 // add virtual manifest that depends on all workspaces, this way package hoisters and resolvers will work fine
6930 var workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies);
6931 for (var _iterator5 = (0, (_keys || _load_keys()).default)(workspaces), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
6932 var _ref7;
6933
6934 if (_isArray5) {
6935 if (_i5 >= _iterator5.length) break;
6936 _ref7 = _iterator5[_i5++];
6937 } else {
6938 _i5 = _iterator5.next();
6939 if (_i5.done) break;
6940 _ref7 = _i5.value;
6941 }
6942
6943 var workspaceName = _ref7;
6944
6945 var workspaceManifest = workspaces[workspaceName].manifest;
6946 workspaceDependencies[workspaceName] = workspaceManifest.version;
6947
6948 // include dependencies from all workspaces
6949 if (_this.flags.includeWorkspaceDeps) {
6950 pushDeps('dependencies', workspaceManifest, { hint: null, optional: false }, true);
6951 pushDeps('devDependencies', workspaceManifest, { hint: 'dev', optional: false }, !_this.config.production);
6952 pushDeps('optionalDependencies', workspaceManifest, { hint: 'optional', optional: true }, true);
6953 }
6954 }
6955 var virtualDependencyManifest = {
6956 _uid: '',
6957 name: `workspace-aggregator-${uuid.v4()}`,
6958 version: '1.0.0',
6959 _registry: 'npm',
6960 _loc: workspacesRoot,
6961 dependencies: workspaceDependencies,
6962 devDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.devDependencies),
6963 optionalDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.optionalDependencies),
6964 private: workspaceManifestJson.private,
6965 workspaces: workspaceManifestJson.workspaces
6966 };
6967 workspaceLayout.virtualManifestName = virtualDependencyManifest.name;
6968 var virtualDep = {};
6969 virtualDep[virtualDependencyManifest.name] = virtualDependencyManifest.version;
6970 workspaces[virtualDependencyManifest.name] = { loc: workspacesRoot, manifest: virtualDependencyManifest };
6971
6972 // ensure dependencies that should be excluded are stripped from the correct manifest
6973 stripExcluded(cwdIsRoot ? virtualDependencyManifest : workspaces[projectManifestJson.name].manifest);
6974
6975 pushDeps('workspaces', { workspaces: virtualDep }, { hint: 'workspaces', optional: false }, true);
6976
6977 var implicitWorkspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceDependencies);
6978
6979 for (var _iterator6 = (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
6980 var _ref8;
6981
6982 if (_isArray6) {
6983 if (_i6 >= _iterator6.length) break;
6984 _ref8 = _iterator6[_i6++];
6985 } else {
6986 _i6 = _iterator6.next();
6987 if (_i6.done) break;
6988 _ref8 = _i6.value;
6989 }
6990
6991 var type = _ref8;
6992
6993 for (var _iterator7 = (0, (_keys || _load_keys()).default)(projectManifestJson[type] || {}), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
6994 var _ref9;
6995
6996 if (_isArray7) {
6997 if (_i7 >= _iterator7.length) break;
6998 _ref9 = _iterator7[_i7++];
6999 } else {
7000 _i7 = _iterator7.next();
7001 if (_i7.done) break;
7002 _ref9 = _i7.value;
7003 }
7004
7005 var dependencyName = _ref9;
7006
7007 delete implicitWorkspaceDependencies[dependencyName];
7008 }
7009 }
7010
7011 pushDeps('dependencies', { dependencies: implicitWorkspaceDependencies }, { hint: 'workspaces', optional: false }, true);
7012 }
7013
7014 return 'break';
7015 };
7016
7017 _loop2: for (var _iterator3 = (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
7018 var _ref4;
7019
7020 if (_isArray3) {
7021 if (_i3 >= _iterator3.length) break;
7022 _ref4 = _iterator3[_i3++];
7023 } else {
7024 _i3 = _iterator3.next();
7025 if (_i3.done) break;
7026 _ref4 = _i3.value;
7027 }
7028
7029 var registry = _ref4;
7030
7031 var _ret = yield* _loop(registry);
7032
7033 switch (_ret) {
7034 case 'continue':
7035 continue;
7036
7037 case 'break':
7038 break _loop2;}
7039 }
7040
7041 // inherit root flat flag
7042
7043
7044 if (manifest.flat) {
7045 this.flags.flat = true;
7046 }
7047
7048 return {
7049 requests: [].concat(resolutionDeps, deps),
7050 patterns,
7051 manifest,
7052 usedPatterns,
7053 ignorePatterns,
7054 workspaceLayout
7055 };
7056 });
7057
7058 function fetchRequestFromCwd() {
7059 return _ref.apply(this, arguments);
7060 }
7061
7062 return fetchRequestFromCwd;
7063 }();
7064
7065 /**
7066 * TODO description
7067 */
7068
7069 Install.prototype.prepareRequests = function prepareRequests(requests) {
7070 return requests;
7071 };
7072
7073 Install.prototype.preparePatterns = function preparePatterns(patterns) {
7074 return patterns;
7075 };
7076
7077 Install.prototype.preparePatternsForLinking = function preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) {
7078 return patterns;
7079 };
7080
7081 Install.prototype.prepareManifests = function () {
7082 var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7083 var manifests = yield this.config.getRootManifests();
7084 return manifests;
7085 });
7086
7087 function prepareManifests() {
7088 return _ref12.apply(this, arguments);
7089 }
7090
7091 return prepareManifests;
7092 }();
7093
7094 Install.prototype.bailout = function () {
7095 var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) {
7096 // We don't want to skip the audit - it could yield important errors
7097 if (this.flags.audit) {
7098 return false;
7099 }
7100 // PNP is so fast that the integrity check isn't pertinent
7101 if (this.config.plugnplayEnabled) {
7102 return false;
7103 }
7104 if (this.flags.skipIntegrityCheck || this.flags.force) {
7105 return false;
7106 }
7107 var lockfileCache = this.lockfile.cache;
7108 if (!lockfileCache) {
7109 return false;
7110 }
7111 var lockfileClean = this.lockfile.parseResultType === 'success';
7112 var match = yield this.integrityChecker.check(patterns, lockfileCache, this.flags, workspaceLayout);
7113 if (this.flags.frozenLockfile && (!lockfileClean || match.missingPatterns.length > 0)) {
7114 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('frozenLockfileError'));
7115 }
7116
7117 var haveLockfile = yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME));
7118
7119 var lockfileIntegrityPresent = !this.lockfile.hasEntriesExistWithoutIntegrity();
7120 var integrityBailout = lockfileIntegrityPresent || !this.config.autoAddIntegrity;
7121
7122 if (match.integrityMatches && haveLockfile && lockfileClean && integrityBailout) {
7123 this.reporter.success(this.reporter.lang('upToDate'));
7124 return true;
7125 }
7126
7127 if (match.integrityFileMissing && haveLockfile) {
7128 // Integrity file missing, force script installations
7129 this.scripts.setForce(true);
7130 return false;
7131 }
7132
7133 if (match.hardRefreshRequired) {
7134 // e.g. node version doesn't match, force script installations
7135 this.scripts.setForce(true);
7136 return false;
7137 }
7138
7139 if (!patterns.length && !match.integrityFileMissing) {
7140 this.reporter.success(this.reporter.lang('nothingToInstall'));
7141 yield this.createEmptyManifestFolders();
7142 yield this.saveLockfileAndIntegrity(patterns, workspaceLayout);
7143 return true;
7144 }
7145
7146 return false;
7147 });
7148
7149 function bailout(_x3, _x4) {
7150 return _ref13.apply(this, arguments);
7151 }
7152
7153 return bailout;
7154 }();
7155
7156 /**
7157 * Produce empty folders for all used root manifests.
7158 */
7159
7160 Install.prototype.createEmptyManifestFolders = function () {
7161 var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7162 if (this.config.modulesFolder) {
7163 // already created
7164 return;
7165 }
7166
7167 for (var _iterator9 = this.rootManifestRegistries, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
7168 var _ref15;
7169
7170 if (_isArray9) {
7171 if (_i9 >= _iterator9.length) break;
7172 _ref15 = _iterator9[_i9++];
7173 } else {
7174 _i9 = _iterator9.next();
7175 if (_i9.done) break;
7176 _ref15 = _i9.value;
7177 }
7178
7179 var registryName = _ref15;
7180 var folder = this.config.registries[registryName].folder;
7181
7182 yield (_fs || _load_fs()).mkdirp(path.join(this.config.lockfileFolder, folder));
7183 }
7184 });
7185
7186 function createEmptyManifestFolders() {
7187 return _ref14.apply(this, arguments);
7188 }
7189
7190 return createEmptyManifestFolders;
7191 }();
7192
7193 /**
7194 * TODO description
7195 */
7196
7197 Install.prototype.markIgnored = function markIgnored(patterns) {
7198 for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
7199 var _ref16;
7200
7201 if (_isArray10) {
7202 if (_i10 >= _iterator10.length) break;
7203 _ref16 = _iterator10[_i10++];
7204 } else {
7205 _i10 = _iterator10.next();
7206 if (_i10.done) break;
7207 _ref16 = _i10.value;
7208 }
7209
7210 var _pattern4 = _ref16;
7211
7212 var _manifest = this.resolver.getStrictResolvedPattern(_pattern4);
7213 var ref = _manifest._reference;
7214 invariant(ref, 'expected package reference');
7215
7216 // just mark the package as ignored. if the package is used by a required package, the hoister
7217 // will take care of that.
7218 ref.ignore = true;
7219 }
7220 };
7221
7222 /**
7223 * helper method that gets only recent manifests
7224 * used by global.ls command
7225 */
7226
7227
7228 Install.prototype.getFlattenedDeps = function () {
7229 var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7230 var _ref18 = yield this.fetchRequestFromCwd(),
7231 depRequests = _ref18.requests,
7232 rawPatterns = _ref18.patterns;
7233
7234 yield this.resolver.init(depRequests, {});
7235
7236 var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(this.resolver.getManifests(), this.config);
7237 this.resolver.updateManifests(manifests);
7238
7239 return this.flatten(rawPatterns);
7240 });
7241
7242 function getFlattenedDeps() {
7243 return _ref17.apply(this, arguments);
7244 }
7245
7246 return getFlattenedDeps;
7247 }();
7248
7249 /**
7250 * TODO description
7251 */
7252
7253 Install.prototype.init = function () {
7254 var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7255 var _this2 = this;
7256
7257 this.checkUpdate();
7258
7259 // warn if we have a shrinkwrap
7260 if (yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).NPM_SHRINKWRAP_FILENAME))) {
7261 this.reporter.warn(this.reporter.lang('shrinkwrapWarning'));
7262 }
7263
7264 // warn if we have an npm lockfile
7265 if (yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).NPM_LOCK_FILENAME))) {
7266 this.reporter.warn(this.reporter.lang('npmLockfileWarning'));
7267 }
7268
7269 if (this.config.plugnplayEnabled) {
7270 this.reporter.info(this.reporter.lang('plugnplaySuggestV2L1'));
7271 this.reporter.info(this.reporter.lang('plugnplaySuggestV2L2'));
7272 }
7273
7274 var flattenedTopLevelPatterns = [];
7275 var steps = [];
7276
7277 var _ref20 = yield this.fetchRequestFromCwd(),
7278 depRequests = _ref20.requests,
7279 rawPatterns = _ref20.patterns,
7280 ignorePatterns = _ref20.ignorePatterns,
7281 workspaceLayout = _ref20.workspaceLayout,
7282 manifest = _ref20.manifest;
7283
7284 var topLevelPatterns = [];
7285
7286 var artifacts = yield this.integrityChecker.getArtifacts();
7287 if (artifacts) {
7288 this.linker.setArtifacts(artifacts);
7289 this.scripts.setArtifacts(artifacts);
7290 }
7291
7292 if ((_packageCompatibility || _load_packageCompatibility()).shouldCheck(manifest, this.flags)) {
7293 steps.push(function () {
7294 var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) {
7295 _this2.reporter.step(curr, total, _this2.reporter.lang('checkingManifest'), emoji.get('mag'));
7296 yield _this2.checkCompatibility();
7297 });
7298
7299 return function (_x5, _x6) {
7300 return _ref21.apply(this, arguments);
7301 };
7302 }());
7303 }
7304
7305 var audit = new (_audit || _load_audit()).default(this.config, this.reporter, { groups: (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES });
7306 var auditFoundProblems = false;
7307
7308 steps.push(function (curr, total) {
7309 return (0, (_hooks || _load_hooks()).callThroughHook)('resolveStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7310 _this2.reporter.step(curr, total, _this2.reporter.lang('resolvingPackages'), emoji.get('mag'));
7311 yield _this2.resolver.init(_this2.prepareRequests(depRequests), {
7312 isFlat: _this2.flags.flat,
7313 isFrozen: _this2.flags.frozenLockfile,
7314 workspaceLayout
7315 });
7316 topLevelPatterns = _this2.preparePatterns(rawPatterns);
7317 flattenedTopLevelPatterns = yield _this2.flatten(topLevelPatterns);
7318 return { bailout: !_this2.flags.audit && (yield _this2.bailout(topLevelPatterns, workspaceLayout)) };
7319 }));
7320 });
7321
7322 if (this.flags.audit) {
7323 steps.push(function (curr, total) {
7324 return (0, (_hooks || _load_hooks()).callThroughHook)('auditStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7325 _this2.reporter.step(curr, total, _this2.reporter.lang('auditRunning'), emoji.get('mag'));
7326 if (_this2.flags.offline) {
7327 _this2.reporter.warn(_this2.reporter.lang('auditOffline'));
7328 return { bailout: false };
7329 }
7330 var preparedManifests = yield _this2.prepareManifests();
7331 // $FlowFixMe - Flow considers `m` in the map operation to be "mixed", so does not recognize `m.object`
7332 var mergedManifest = (_assign || _load_assign()).default.apply(Object, [{}].concat((0, (_values || _load_values()).default)(preparedManifests).map(function (m) {
7333 return m.object;
7334 })));
7335 var auditVulnerabilityCounts = yield audit.performAudit(mergedManifest, _this2.lockfile, _this2.resolver, _this2.linker, topLevelPatterns);
7336 auditFoundProblems = auditVulnerabilityCounts.info || auditVulnerabilityCounts.low || auditVulnerabilityCounts.moderate || auditVulnerabilityCounts.high || auditVulnerabilityCounts.critical;
7337 return { bailout: yield _this2.bailout(topLevelPatterns, workspaceLayout) };
7338 }));
7339 });
7340 }
7341
7342 steps.push(function (curr, total) {
7343 return (0, (_hooks || _load_hooks()).callThroughHook)('fetchStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7344 _this2.markIgnored(ignorePatterns);
7345 _this2.reporter.step(curr, total, _this2.reporter.lang('fetchingPackages'), emoji.get('truck'));
7346 var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this2.resolver.getManifests(), _this2.config);
7347 _this2.resolver.updateManifests(manifests);
7348 yield (_packageCompatibility || _load_packageCompatibility()).check(_this2.resolver.getManifests(), _this2.config, _this2.flags.ignoreEngines);
7349 }));
7350 });
7351
7352 steps.push(function (curr, total) {
7353 return (0, (_hooks || _load_hooks()).callThroughHook)('linkStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7354 // remove integrity hash to make this operation atomic
7355 yield _this2.integrityChecker.removeIntegrityFile();
7356 _this2.reporter.step(curr, total, _this2.reporter.lang('linkingDependencies'), emoji.get('link'));
7357 flattenedTopLevelPatterns = _this2.preparePatternsForLinking(flattenedTopLevelPatterns, manifest, _this2.config.lockfileFolder === _this2.config.cwd);
7358 yield _this2.linker.init(flattenedTopLevelPatterns, workspaceLayout, {
7359 linkDuplicates: _this2.flags.linkDuplicates,
7360 ignoreOptional: _this2.flags.ignoreOptional
7361 });
7362 }));
7363 });
7364
7365 if (this.config.plugnplayEnabled) {
7366 steps.push(function (curr, total) {
7367 return (0, (_hooks || _load_hooks()).callThroughHook)('pnpStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7368 var pnpPath = `${_this2.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`;
7369
7370 var code = yield (0, (_generatePnpMap || _load_generatePnpMap()).generatePnpMap)(_this2.config, flattenedTopLevelPatterns, {
7371 resolver: _this2.resolver,
7372 reporter: _this2.reporter,
7373 targetPath: pnpPath,
7374 workspaceLayout
7375 });
7376
7377 try {
7378 var file = yield (_fs || _load_fs()).readFile(pnpPath);
7379 if (file === code) {
7380 return;
7381 }
7382 } catch (error) {}
7383
7384 yield (_fs || _load_fs()).writeFile(pnpPath, code);
7385 yield (_fs || _load_fs()).chmod(pnpPath, 0o755);
7386 }));
7387 });
7388 }
7389
7390 steps.push(function (curr, total) {
7391 return (0, (_hooks || _load_hooks()).callThroughHook)('buildStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7392 _this2.reporter.step(curr, total, _this2.flags.force ? _this2.reporter.lang('rebuildingPackages') : _this2.reporter.lang('buildingFreshPackages'), emoji.get('hammer'));
7393
7394 if (_this2.config.ignoreScripts) {
7395 _this2.reporter.warn(_this2.reporter.lang('ignoredScripts'));
7396 } else {
7397 yield _this2.scripts.init(flattenedTopLevelPatterns);
7398 }
7399 }));
7400 });
7401
7402 if (this.flags.har) {
7403 steps.push(function () {
7404 var _ref28 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) {
7405 var formattedDate = new Date().toISOString().replace(/:/g, '-');
7406 var filename = `yarn-install_${formattedDate}.har`;
7407 _this2.reporter.step(curr, total, _this2.reporter.lang('savingHar', filename), emoji.get('black_circle_for_record'));
7408 yield _this2.config.requestManager.saveHar(filename);
7409 });
7410
7411 return function (_x7, _x8) {
7412 return _ref28.apply(this, arguments);
7413 };
7414 }());
7415 }
7416
7417 if (yield this.shouldClean()) {
7418 steps.push(function () {
7419 var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) {
7420 _this2.reporter.step(curr, total, _this2.reporter.lang('cleaningModules'), emoji.get('recycle'));
7421 yield (0, (_autoclean || _load_autoclean()).clean)(_this2.config, _this2.reporter);
7422 });
7423
7424 return function (_x9, _x10) {
7425 return _ref29.apply(this, arguments);
7426 };
7427 }());
7428 }
7429
7430 var currentStep = 0;
7431 for (var _iterator11 = steps, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
7432 var _ref30;
7433
7434 if (_isArray11) {
7435 if (_i11 >= _iterator11.length) break;
7436 _ref30 = _iterator11[_i11++];
7437 } else {
7438 _i11 = _iterator11.next();
7439 if (_i11.done) break;
7440 _ref30 = _i11.value;
7441 }
7442
7443 var step = _ref30;
7444
7445 var stepResult = yield step(++currentStep, steps.length);
7446 if (stepResult && stepResult.bailout) {
7447 if (this.flags.audit) {
7448 audit.summary();
7449 }
7450 if (auditFoundProblems) {
7451 this.reporter.warn(this.reporter.lang('auditRunAuditForDetails'));
7452 }
7453 this.maybeOutputUpdate();
7454 return flattenedTopLevelPatterns;
7455 }
7456 }
7457
7458 // fin!
7459 if (this.flags.audit) {
7460 audit.summary();
7461 }
7462 if (auditFoundProblems) {
7463 this.reporter.warn(this.reporter.lang('auditRunAuditForDetails'));
7464 }
7465 yield this.saveLockfileAndIntegrity(topLevelPatterns, workspaceLayout);
7466 yield this.persistChanges();
7467 this.maybeOutputUpdate();
7468 this.config.requestManager.clearCache();
7469 return flattenedTopLevelPatterns;
7470 });
7471
7472 function init() {
7473 return _ref19.apply(this, arguments);
7474 }
7475
7476 return init;
7477 }();
7478
7479 Install.prototype.checkCompatibility = function () {
7480 var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7481 var _ref32 = yield this.fetchRequestFromCwd(),
7482 manifest = _ref32.manifest;
7483
7484 yield (_packageCompatibility || _load_packageCompatibility()).checkOne(manifest, this.config, this.flags.ignoreEngines);
7485 });
7486
7487 function checkCompatibility() {
7488 return _ref31.apply(this, arguments);
7489 }
7490
7491 return checkCompatibility;
7492 }();
7493
7494 Install.prototype.persistChanges = function () {
7495 var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7496 // get all the different registry manifests in this folder
7497 var manifests = yield this.config.getRootManifests();
7498
7499 if (yield this.applyChanges(manifests)) {
7500 yield this.config.saveRootManifests(manifests);
7501 }
7502 });
7503
7504 function persistChanges() {
7505 return _ref33.apply(this, arguments);
7506 }
7507
7508 return persistChanges;
7509 }();
7510
7511 Install.prototype.applyChanges = function applyChanges(manifests) {
7512 var hasChanged = false;
7513
7514 if (this.config.plugnplayPersist) {
7515 var object = manifests.npm.object;
7516
7517
7518 if (typeof object.installConfig !== 'object') {
7519 object.installConfig = {};
7520 }
7521
7522 if (this.config.plugnplayEnabled && object.installConfig.pnp !== true) {
7523 object.installConfig.pnp = true;
7524 hasChanged = true;
7525 } else if (!this.config.plugnplayEnabled && typeof object.installConfig.pnp !== 'undefined') {
7526 delete object.installConfig.pnp;
7527 hasChanged = true;
7528 }
7529
7530 if ((0, (_keys || _load_keys()).default)(object.installConfig).length === 0) {
7531 delete object.installConfig;
7532 }
7533 }
7534
7535 return (_promise || _load_promise()).default.resolve(hasChanged);
7536 };
7537
7538 /**
7539 * Check if we should run the cleaning step.
7540 */
7541
7542 Install.prototype.shouldClean = function shouldClean() {
7543 return (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME));
7544 };
7545
7546 /**
7547 * TODO
7548 */
7549
7550 Install.prototype.flatten = function () {
7551 var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns) {
7552 var _this3 = this;
7553
7554 if (!this.flags.flat) {
7555 return patterns;
7556 }
7557
7558 var flattenedPatterns = [];
7559
7560 for (var _iterator12 = this.resolver.getAllDependencyNamesByLevelOrder(patterns), _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) {
7561 var _ref35;
7562
7563 if (_isArray12) {
7564 if (_i12 >= _iterator12.length) break;
7565 _ref35 = _iterator12[_i12++];
7566 } else {
7567 _i12 = _iterator12.next();
7568 if (_i12.done) break;
7569 _ref35 = _i12.value;
7570 }
7571
7572 var name = _ref35;
7573
7574 var infos = this.resolver.getAllInfoForPackageName(name).filter(function (manifest) {
7575 var ref = manifest._reference;
7576 invariant(ref, 'expected package reference');
7577 return !ref.ignore;
7578 });
7579
7580 if (infos.length === 0) {
7581 continue;
7582 }
7583
7584 if (infos.length === 1) {
7585 // single version of this package
7586 // take out a single pattern as multiple patterns may have resolved to this package
7587 flattenedPatterns.push(this.resolver.patternsByPackage[name][0]);
7588 continue;
7589 }
7590
7591 var options = infos.map(function (info) {
7592 var ref = info._reference;
7593 invariant(ref, 'expected reference');
7594 return {
7595 // TODO `and is required by {PARENT}`,
7596 name: _this3.reporter.lang('manualVersionResolutionOption', ref.patterns.join(', '), info.version),
7597
7598 value: info.version
7599 };
7600 });
7601 var versions = infos.map(function (info) {
7602 return info.version;
7603 });
7604 var version = void 0;
7605
7606 var resolutionVersion = this.resolutions[name];
7607 if (resolutionVersion && versions.indexOf(resolutionVersion) >= 0) {
7608 // use json `resolution` version
7609 version = resolutionVersion;
7610 } else {
7611 version = yield this.reporter.select(this.reporter.lang('manualVersionResolution', name), this.reporter.lang('answer'), options);
7612 this.resolutions[name] = version;
7613 }
7614
7615 flattenedPatterns.push(this.resolver.collapseAllVersionsOfPackage(name, version));
7616 }
7617
7618 // save resolutions to their appropriate root manifest
7619 if ((0, (_keys || _load_keys()).default)(this.resolutions).length) {
7620 var manifests = yield this.config.getRootManifests();
7621
7622 for (var _name in this.resolutions) {
7623 var version = this.resolutions[_name];
7624
7625 var _patterns = this.resolver.patternsByPackage[_name];
7626 if (!_patterns) {
7627 continue;
7628 }
7629
7630 var _manifest2 = void 0;
7631 for (var _iterator13 = _patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) {
7632 var _ref36;
7633
7634 if (_isArray13) {
7635 if (_i13 >= _iterator13.length) break;
7636 _ref36 = _iterator13[_i13++];
7637 } else {
7638 _i13 = _iterator13.next();
7639 if (_i13.done) break;
7640 _ref36 = _i13.value;
7641 }
7642
7643 var _pattern5 = _ref36;
7644
7645 _manifest2 = this.resolver.getResolvedPattern(_pattern5);
7646 if (_manifest2) {
7647 break;
7648 }
7649 }
7650 invariant(_manifest2, 'expected manifest');
7651
7652 var ref = _manifest2._reference;
7653 invariant(ref, 'expected reference');
7654
7655 var object = manifests[ref.registry].object;
7656 object.resolutions = object.resolutions || {};
7657 object.resolutions[_name] = version;
7658 }
7659
7660 yield this.config.saveRootManifests(manifests);
7661 }
7662
7663 return flattenedPatterns;
7664 });
7665
7666 function flatten(_x11) {
7667 return _ref34.apply(this, arguments);
7668 }
7669
7670 return flatten;
7671 }();
7672
7673 /**
7674 * Remove offline tarballs that are no longer required
7675 */
7676
7677 Install.prototype.pruneOfflineMirror = function () {
7678 var _ref37 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (lockfile) {
7679 var mirror = this.config.getOfflineMirrorPath();
7680 if (!mirror) {
7681 return;
7682 }
7683
7684 var requiredTarballs = new (_set || _load_set()).default();
7685 for (var dependency in lockfile) {
7686 var resolved = lockfile[dependency].resolved;
7687 if (resolved) {
7688 var basename = path.basename(resolved.split('#')[0]);
7689 if (dependency[0] === '@' && basename[0] !== '@') {
7690 requiredTarballs.add(`${dependency.split('/')[0]}-${basename}`);
7691 }
7692 requiredTarballs.add(basename);
7693 }
7694 }
7695
7696 var mirrorFiles = yield (_fs || _load_fs()).walk(mirror);
7697 for (var _iterator14 = mirrorFiles, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) {
7698 var _ref38;
7699
7700 if (_isArray14) {
7701 if (_i14 >= _iterator14.length) break;
7702 _ref38 = _iterator14[_i14++];
7703 } else {
7704 _i14 = _iterator14.next();
7705 if (_i14.done) break;
7706 _ref38 = _i14.value;
7707 }
7708
7709 var file = _ref38;
7710
7711 var isTarball = path.extname(file.basename) === '.tgz';
7712 // if using experimental-pack-script-packages-in-mirror flag, don't unlink prebuilt packages
7713 var hasPrebuiltPackage = file.relative.startsWith('prebuilt/');
7714 if (isTarball && !hasPrebuiltPackage && !requiredTarballs.has(file.basename)) {
7715 yield (_fs || _load_fs()).unlink(file.absolute);
7716 }
7717 }
7718 });
7719
7720 function pruneOfflineMirror(_x12) {
7721 return _ref37.apply(this, arguments);
7722 }
7723
7724 return pruneOfflineMirror;
7725 }();
7726
7727 /**
7728 * Save updated integrity and lockfiles.
7729 */
7730
7731 Install.prototype.saveLockfileAndIntegrity = function () {
7732 var _ref39 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) {
7733 var _this4 = this;
7734
7735 var resolvedPatterns = {};
7736 (0, (_keys || _load_keys()).default)(this.resolver.patterns).forEach(function (pattern) {
7737 if (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern)) {
7738 resolvedPatterns[pattern] = _this4.resolver.patterns[pattern];
7739 }
7740 });
7741
7742 // TODO this code is duplicated in a few places, need a common way to filter out workspace patterns from lockfile
7743 patterns = patterns.filter(function (p) {
7744 return !workspaceLayout || !workspaceLayout.getManifestByPattern(p);
7745 });
7746
7747 var lockfileBasedOnResolver = this.lockfile.getLockfile(resolvedPatterns);
7748
7749 if (this.config.pruneOfflineMirror) {
7750 yield this.pruneOfflineMirror(lockfileBasedOnResolver);
7751 }
7752
7753 // write integrity hash
7754 if (!this.config.plugnplayEnabled) {
7755 yield this.integrityChecker.save(patterns, lockfileBasedOnResolver, this.flags, workspaceLayout, this.scripts.getArtifacts());
7756 }
7757
7758 // --no-lockfile or --pure-lockfile or --frozen-lockfile
7759 if (this.flags.lockfile === false || this.flags.pureLockfile || this.flags.frozenLockfile) {
7760 return;
7761 }
7762
7763 var lockFileHasAllPatterns = patterns.every(function (p) {
7764 return _this4.lockfile.getLocked(p);
7765 });
7766 var lockfilePatternsMatch = (0, (_keys || _load_keys()).default)(this.lockfile.cache || {}).every(function (p) {
7767 return lockfileBasedOnResolver[p];
7768 });
7769 var resolverPatternsAreSameAsInLockfile = (0, (_keys || _load_keys()).default)(lockfileBasedOnResolver).every(function (pattern) {
7770 var manifest = _this4.lockfile.getLocked(pattern);
7771 return manifest && manifest.resolved === lockfileBasedOnResolver[pattern].resolved && deepEqual(manifest.prebuiltVariants, lockfileBasedOnResolver[pattern].prebuiltVariants);
7772 });
7773 var integrityPatternsAreSameAsInLockfile = (0, (_keys || _load_keys()).default)(lockfileBasedOnResolver).every(function (pattern) {
7774 var existingIntegrityInfo = lockfileBasedOnResolver[pattern].integrity;
7775 if (!existingIntegrityInfo) {
7776 // if this entry does not have an integrity, no need to re-write the lockfile because of it
7777 return true;
7778 }
7779 var manifest = _this4.lockfile.getLocked(pattern);
7780 if (manifest && manifest.integrity) {
7781 var manifestIntegrity = ssri.stringify(manifest.integrity);
7782 return manifestIntegrity === existingIntegrityInfo;
7783 }
7784 return false;
7785 });
7786
7787 // remove command is followed by install with force, lockfile will be rewritten in any case then
7788 if (!this.flags.force && this.lockfile.parseResultType === 'success' && lockFileHasAllPatterns && lockfilePatternsMatch && resolverPatternsAreSameAsInLockfile && integrityPatternsAreSameAsInLockfile && patterns.length) {
7789 return;
7790 }
7791
7792 // build lockfile location
7793 var loc = path.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME);
7794
7795 // write lockfile
7796 var lockSource = (0, (_lockfile2 || _load_lockfile2()).stringify)(lockfileBasedOnResolver, false, this.config.enableLockfileVersions);
7797 yield (_fs || _load_fs()).writeFilePreservingEol(loc, lockSource);
7798
7799 this._logSuccessSaveLockfile();
7800 });
7801
7802 function saveLockfileAndIntegrity(_x13, _x14) {
7803 return _ref39.apply(this, arguments);
7804 }
7805
7806 return saveLockfileAndIntegrity;
7807 }();
7808
7809 Install.prototype._logSuccessSaveLockfile = function _logSuccessSaveLockfile() {
7810 this.reporter.success(this.reporter.lang('savedLockfile'));
7811 };
7812
7813 /**
7814 * Load the dependency graph of the current install. Only does package resolving and wont write to the cwd.
7815 */
7816
7817
7818 Install.prototype.hydrate = function () {
7819 var _ref40 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ignoreUnusedPatterns) {
7820 var request = yield this.fetchRequestFromCwd([], ignoreUnusedPatterns);
7821 var depRequests = request.requests,
7822 rawPatterns = request.patterns,
7823 ignorePatterns = request.ignorePatterns,
7824 workspaceLayout = request.workspaceLayout;
7825
7826
7827 yield this.resolver.init(depRequests, {
7828 isFlat: this.flags.flat,
7829 isFrozen: this.flags.frozenLockfile,
7830 workspaceLayout
7831 });
7832 yield this.flatten(rawPatterns);
7833 this.markIgnored(ignorePatterns);
7834
7835 // fetch packages, should hit cache most of the time
7836 var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(this.resolver.getManifests(), this.config);
7837 this.resolver.updateManifests(manifests);
7838 yield (_packageCompatibility || _load_packageCompatibility()).check(this.resolver.getManifests(), this.config, this.flags.ignoreEngines);
7839
7840 // expand minimal manifests
7841 for (var _iterator15 = this.resolver.getManifests(), _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) {
7842 var _ref41;
7843
7844 if (_isArray15) {
7845 if (_i15 >= _iterator15.length) break;
7846 _ref41 = _iterator15[_i15++];
7847 } else {
7848 _i15 = _iterator15.next();
7849 if (_i15.done) break;
7850 _ref41 = _i15.value;
7851 }
7852
7853 var _manifest3 = _ref41;
7854
7855 var ref = _manifest3._reference;
7856 invariant(ref, 'expected reference');
7857 var type = ref.remote.type;
7858 // link specifier won't ever hit cache
7859
7860 var _loc = '';
7861 if (type === 'link') {
7862 continue;
7863 } else if (type === 'workspace') {
7864 if (!ref.remote.reference) {
7865 continue;
7866 }
7867 _loc = ref.remote.reference;
7868 } else {
7869 _loc = this.config.generateModuleCachePath(ref);
7870 }
7871 var newPkg = yield this.config.readManifest(_loc);
7872 yield this.resolver.updateManifest(ref, newPkg);
7873 }
7874
7875 return request;
7876 });
7877
7878 function hydrate(_x15) {
7879 return _ref40.apply(this, arguments);
7880 }
7881
7882 return hydrate;
7883 }();
7884
7885 /**
7886 * Check for updates every day and output a nag message if there's a newer version.
7887 */
7888
7889 Install.prototype.checkUpdate = function checkUpdate() {
7890 if (this.config.nonInteractive) {
7891 // don't show upgrade dialog on CI or non-TTY terminals
7892 return;
7893 }
7894
7895 // don't check if disabled
7896 if (this.config.getOption('disable-self-update-check')) {
7897 return;
7898 }
7899
7900 // only check for updates once a day
7901 var lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0;
7902 if (lastUpdateCheck && Date.now() - lastUpdateCheck < ONE_DAY) {
7903 return;
7904 }
7905
7906 // don't bug for updates on tagged releases
7907 if ((_yarnVersion || _load_yarnVersion()).version.indexOf('-') >= 0) {
7908 return;
7909 }
7910
7911 this._checkUpdate().catch(function () {
7912 // swallow errors
7913 });
7914 };
7915
7916 Install.prototype._checkUpdate = function () {
7917 var _ref42 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
7918 var _this5 = this;
7919
7920 var latestVersion = yield this.config.requestManager.request({
7921 url: (_constants || _load_constants()).SELF_UPDATE_VERSION_URL
7922 });
7923 invariant(typeof latestVersion === 'string', 'expected string');
7924 latestVersion = latestVersion.trim();
7925 if (!semver.valid(latestVersion)) {
7926 return;
7927 }
7928
7929 // ensure we only check for updates periodically
7930 this.config.registries.yarn.saveHomeConfig({
7931 lastUpdateCheck: Date.now()
7932 });
7933
7934 if (semver.gt(latestVersion, (_yarnVersion || _load_yarnVersion()).version)) {
7935 var installationMethod = yield (0, (_yarnVersion || _load_yarnVersion()).getInstallationMethod)();
7936 this.maybeOutputUpdate = function () {
7937 _this5.reporter.warn(_this5.reporter.lang('yarnOutdated', latestVersion, (_yarnVersion || _load_yarnVersion()).version));
7938
7939 var command = getUpdateCommand(installationMethod);
7940 if (command) {
7941 _this5.reporter.info(_this5.reporter.lang('yarnOutdatedCommand'));
7942 _this5.reporter.command(command);
7943 } else {
7944 var installer = getUpdateInstaller(installationMethod);
7945 if (installer) {
7946 _this5.reporter.info(_this5.reporter.lang('yarnOutdatedInstaller', installer));
7947 }
7948 }
7949 };
7950 }
7951 });
7952
7953 function _checkUpdate() {
7954 return _ref42.apply(this, arguments);
7955 }
7956
7957 return _checkUpdate;
7958 }();
7959
7960 /**
7961 * Method to override with a possible upgrade message.
7962 */
7963
7964 Install.prototype.maybeOutputUpdate = function maybeOutputUpdate() {};
7965
7966 return Install;
7967}();
7968
7969function hasWrapper(commander, args) {
7970 return true;
7971}
7972
7973function setFlags(commander) {
7974 commander.description('Yarn install is used to install all dependencies for a project.');
7975 commander.usage('install [flags]');
7976 commander.option('-A, --audit', 'Run vulnerability audit on installed packages');
7977 commander.option('-g, --global', 'DEPRECATED');
7978 commander.option('-S, --save', 'DEPRECATED - save package to your `dependencies`');
7979 commander.option('-D, --save-dev', 'DEPRECATED - save package to your `devDependencies`');
7980 commander.option('-P, --save-peer', 'DEPRECATED - save package to your `peerDependencies`');
7981 commander.option('-O, --save-optional', 'DEPRECATED - save package to your `optionalDependencies`');
7982 commander.option('-E, --save-exact', 'DEPRECATED');
7983 commander.option('-T, --save-tilde', 'DEPRECATED');
7984}
7985
7986/***/ }),
7987/* 42 */
7988/***/ (function(module, exports, __webpack_require__) {
7989
7990module.exports = { "default": __webpack_require__(593), __esModule: true };
7991
7992/***/ }),
7993/* 43 */
7994/***/ (function(module, __webpack_exports__, __webpack_require__) {
7995
7996"use strict";
7997/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SubjectSubscriber; });
7998/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subject; });
7999/* unused harmony export AnonymousSubject */
8000/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
8001/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(17);
8002/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscriber__ = __webpack_require__(5);
8003/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(31);
8004/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__ = __webpack_require__(180);
8005/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__ = __webpack_require__(392);
8006/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__ = __webpack_require__(261);
8007/** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */
8008
8009
8010
8011
8012
8013
8014
8015var SubjectSubscriber = /*@__PURE__*/ (function (_super) {
8016 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubjectSubscriber, _super);
8017 function SubjectSubscriber(destination) {
8018 var _this = _super.call(this, destination) || this;
8019 _this.destination = destination;
8020 return _this;
8021 }
8022 return SubjectSubscriber;
8023}(__WEBPACK_IMPORTED_MODULE_2__Subscriber__["a" /* Subscriber */]));
8024
8025var Subject = /*@__PURE__*/ (function (_super) {
8026 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Subject, _super);
8027 function Subject() {
8028 var _this = _super.call(this) || this;
8029 _this.observers = [];
8030 _this.closed = false;
8031 _this.isStopped = false;
8032 _this.hasError = false;
8033 _this.thrownError = null;
8034 return _this;
8035 }
8036 Subject.prototype[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__["a" /* rxSubscriber */]] = function () {
8037 return new SubjectSubscriber(this);
8038 };
8039 Subject.prototype.lift = function (operator) {
8040 var subject = new AnonymousSubject(this, this);
8041 subject.operator = operator;
8042 return subject;
8043 };
8044 Subject.prototype.next = function (value) {
8045 if (this.closed) {
8046 throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
8047 }
8048 if (!this.isStopped) {
8049 var observers = this.observers;
8050 var len = observers.length;
8051 var copy = observers.slice();
8052 for (var i = 0; i < len; i++) {
8053 copy[i].next(value);
8054 }
8055 }
8056 };
8057 Subject.prototype.error = function (err) {
8058 if (this.closed) {
8059 throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
8060 }
8061 this.hasError = true;
8062 this.thrownError = err;
8063 this.isStopped = true;
8064 var observers = this.observers;
8065 var len = observers.length;
8066 var copy = observers.slice();
8067 for (var i = 0; i < len; i++) {
8068 copy[i].error(err);
8069 }
8070 this.observers.length = 0;
8071 };
8072 Subject.prototype.complete = function () {
8073 if (this.closed) {
8074 throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
8075 }
8076 this.isStopped = true;
8077 var observers = this.observers;
8078 var len = observers.length;
8079 var copy = observers.slice();
8080 for (var i = 0; i < len; i++) {
8081 copy[i].complete();
8082 }
8083 this.observers.length = 0;
8084 };
8085 Subject.prototype.unsubscribe = function () {
8086 this.isStopped = true;
8087 this.closed = true;
8088 this.observers = null;
8089 };
8090 Subject.prototype._trySubscribe = function (subscriber) {
8091 if (this.closed) {
8092 throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
8093 }
8094 else {
8095 return _super.prototype._trySubscribe.call(this, subscriber);
8096 }
8097 };
8098 Subject.prototype._subscribe = function (subscriber) {
8099 if (this.closed) {
8100 throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
8101 }
8102 else if (this.hasError) {
8103 subscriber.error(this.thrownError);
8104 return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY;
8105 }
8106 else if (this.isStopped) {
8107 subscriber.complete();
8108 return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY;
8109 }
8110 else {
8111 this.observers.push(subscriber);
8112 return new __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__["a" /* SubjectSubscription */](this, subscriber);
8113 }
8114 };
8115 Subject.prototype.asObservable = function () {
8116 var observable = new __WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */]();
8117 observable.source = this;
8118 return observable;
8119 };
8120 Subject.create = function (destination, source) {
8121 return new AnonymousSubject(destination, source);
8122 };
8123 return Subject;
8124}(__WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */]));
8125
8126var AnonymousSubject = /*@__PURE__*/ (function (_super) {
8127 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AnonymousSubject, _super);
8128 function AnonymousSubject(destination, source) {
8129 var _this = _super.call(this) || this;
8130 _this.destination = destination;
8131 _this.source = source;
8132 return _this;
8133 }
8134 AnonymousSubject.prototype.next = function (value) {
8135 var destination = this.destination;
8136 if (destination && destination.next) {
8137 destination.next(value);
8138 }
8139 };
8140 AnonymousSubject.prototype.error = function (err) {
8141 var destination = this.destination;
8142 if (destination && destination.error) {
8143 this.destination.error(err);
8144 }
8145 };
8146 AnonymousSubject.prototype.complete = function () {
8147 var destination = this.destination;
8148 if (destination && destination.complete) {
8149 this.destination.complete();
8150 }
8151 };
8152 AnonymousSubject.prototype._subscribe = function (subscriber) {
8153 var source = this.source;
8154 if (source) {
8155 return this.source.subscribe(subscriber);
8156 }
8157 else {
8158 return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY;
8159 }
8160 };
8161 return AnonymousSubject;
8162}(Subject));
8163
8164//# sourceMappingURL=Subject.js.map
8165
8166
8167/***/ }),
8168/* 44 */
8169/***/ (function(module, exports, __webpack_require__) {
8170
8171var store = __webpack_require__(225)('wks');
8172var uid = __webpack_require__(162);
8173var Symbol = __webpack_require__(38).Symbol;
8174var USE_SYMBOL = typeof Symbol == 'function';
8175
8176var $exports = module.exports = function (name) {
8177 return store[name] || (store[name] =
8178 USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
8179};
8180
8181$exports.store = store;
8182
8183
8184/***/ }),
8185/* 45 */
8186/***/ (function(module, exports, __webpack_require__) {
8187
8188/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
8189 * @license
8190 * Lodash <https://lodash.com/>
8191 * Copyright JS Foundation and other contributors <https://js.foundation/>
8192 * Released under MIT license <https://lodash.com/license>
8193 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
8194 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
8195 */
8196;(function() {
8197
8198 /** Used as a safe reference for `undefined` in pre-ES5 environments. */
8199 var undefined;
8200
8201 /** Used as the semantic version number. */
8202 var VERSION = '4.17.10';
8203
8204 /** Used as the size to enable large array optimizations. */
8205 var LARGE_ARRAY_SIZE = 200;
8206
8207 /** Error message constants. */
8208 var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',
8209 FUNC_ERROR_TEXT = 'Expected a function';
8210
8211 /** Used to stand-in for `undefined` hash values. */
8212 var HASH_UNDEFINED = '__lodash_hash_undefined__';
8213
8214 /** Used as the maximum memoize cache size. */
8215 var MAX_MEMOIZE_SIZE = 500;
8216
8217 /** Used as the internal argument placeholder. */
8218 var PLACEHOLDER = '__lodash_placeholder__';
8219
8220 /** Used to compose bitmasks for cloning. */
8221 var CLONE_DEEP_FLAG = 1,
8222 CLONE_FLAT_FLAG = 2,
8223 CLONE_SYMBOLS_FLAG = 4;
8224
8225 /** Used to compose bitmasks for value comparisons. */
8226 var COMPARE_PARTIAL_FLAG = 1,
8227 COMPARE_UNORDERED_FLAG = 2;
8228
8229 /** Used to compose bitmasks for function metadata. */
8230 var WRAP_BIND_FLAG = 1,
8231 WRAP_BIND_KEY_FLAG = 2,
8232 WRAP_CURRY_BOUND_FLAG = 4,
8233 WRAP_CURRY_FLAG = 8,
8234 WRAP_CURRY_RIGHT_FLAG = 16,
8235 WRAP_PARTIAL_FLAG = 32,
8236 WRAP_PARTIAL_RIGHT_FLAG = 64,
8237 WRAP_ARY_FLAG = 128,
8238 WRAP_REARG_FLAG = 256,
8239 WRAP_FLIP_FLAG = 512;
8240
8241 /** Used as default options for `_.truncate`. */
8242 var DEFAULT_TRUNC_LENGTH = 30,
8243 DEFAULT_TRUNC_OMISSION = '...';
8244
8245 /** Used to detect hot functions by number of calls within a span of milliseconds. */
8246 var HOT_COUNT = 800,
8247 HOT_SPAN = 16;
8248
8249 /** Used to indicate the type of lazy iteratees. */
8250 var LAZY_FILTER_FLAG = 1,
8251 LAZY_MAP_FLAG = 2,
8252 LAZY_WHILE_FLAG = 3;
8253
8254 /** Used as references for various `Number` constants. */
8255 var INFINITY = 1 / 0,
8256 MAX_SAFE_INTEGER = 9007199254740991,
8257 MAX_INTEGER = 1.7976931348623157e+308,
8258 NAN = 0 / 0;
8259
8260 /** Used as references for the maximum length and index of an array. */
8261 var MAX_ARRAY_LENGTH = 4294967295,
8262 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,
8263 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
8264
8265 /** Used to associate wrap methods with their bit flags. */
8266 var wrapFlags = [
8267 ['ary', WRAP_ARY_FLAG],
8268 ['bind', WRAP_BIND_FLAG],
8269 ['bindKey', WRAP_BIND_KEY_FLAG],
8270 ['curry', WRAP_CURRY_FLAG],
8271 ['curryRight', WRAP_CURRY_RIGHT_FLAG],
8272 ['flip', WRAP_FLIP_FLAG],
8273 ['partial', WRAP_PARTIAL_FLAG],
8274 ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],
8275 ['rearg', WRAP_REARG_FLAG]
8276 ];
8277
8278 /** `Object#toString` result references. */
8279 var argsTag = '[object Arguments]',
8280 arrayTag = '[object Array]',
8281 asyncTag = '[object AsyncFunction]',
8282 boolTag = '[object Boolean]',
8283 dateTag = '[object Date]',
8284 domExcTag = '[object DOMException]',
8285 errorTag = '[object Error]',
8286 funcTag = '[object Function]',
8287 genTag = '[object GeneratorFunction]',
8288 mapTag = '[object Map]',
8289 numberTag = '[object Number]',
8290 nullTag = '[object Null]',
8291 objectTag = '[object Object]',
8292 promiseTag = '[object Promise]',
8293 proxyTag = '[object Proxy]',
8294 regexpTag = '[object RegExp]',
8295 setTag = '[object Set]',
8296 stringTag = '[object String]',
8297 symbolTag = '[object Symbol]',
8298 undefinedTag = '[object Undefined]',
8299 weakMapTag = '[object WeakMap]',
8300 weakSetTag = '[object WeakSet]';
8301
8302 var arrayBufferTag = '[object ArrayBuffer]',
8303 dataViewTag = '[object DataView]',
8304 float32Tag = '[object Float32Array]',
8305 float64Tag = '[object Float64Array]',
8306 int8Tag = '[object Int8Array]',
8307 int16Tag = '[object Int16Array]',
8308 int32Tag = '[object Int32Array]',
8309 uint8Tag = '[object Uint8Array]',
8310 uint8ClampedTag = '[object Uint8ClampedArray]',
8311 uint16Tag = '[object Uint16Array]',
8312 uint32Tag = '[object Uint32Array]';
8313
8314 /** Used to match empty string literals in compiled template source. */
8315 var reEmptyStringLeading = /\b__p \+= '';/g,
8316 reEmptyStringMiddle = /\b(__p \+=) '' \+/g,
8317 reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
8318
8319 /** Used to match HTML entities and HTML characters. */
8320 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,
8321 reUnescapedHtml = /[&<>"']/g,
8322 reHasEscapedHtml = RegExp(reEscapedHtml.source),
8323 reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
8324
8325 /** Used to match template delimiters. */
8326 var reEscape = /<%-([\s\S]+?)%>/g,
8327 reEvaluate = /<%([\s\S]+?)%>/g,
8328 reInterpolate = /<%=([\s\S]+?)%>/g;
8329
8330 /** Used to match property names within property paths. */
8331 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
8332 reIsPlainProp = /^\w*$/,
8333 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
8334
8335 /**
8336 * Used to match `RegExp`
8337 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
8338 */
8339 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
8340 reHasRegExpChar = RegExp(reRegExpChar.source);
8341
8342 /** Used to match leading and trailing whitespace. */
8343 var reTrim = /^\s+|\s+$/g,
8344 reTrimStart = /^\s+/,
8345 reTrimEnd = /\s+$/;
8346
8347 /** Used to match wrap detail comments. */
8348 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,
8349 reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/,
8350 reSplitDetails = /,? & /;
8351
8352 /** Used to match words composed of alphanumeric characters. */
8353 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
8354
8355 /** Used to match backslashes in property paths. */
8356 var reEscapeChar = /\\(\\)?/g;
8357
8358 /**
8359 * Used to match
8360 * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).
8361 */
8362 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
8363
8364 /** Used to match `RegExp` flags from their coerced string values. */
8365 var reFlags = /\w*$/;
8366
8367 /** Used to detect bad signed hexadecimal string values. */
8368 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
8369
8370 /** Used to detect binary string values. */
8371 var reIsBinary = /^0b[01]+$/i;
8372
8373 /** Used to detect host constructors (Safari). */
8374 var reIsHostCtor = /^\[object .+?Constructor\]$/;
8375
8376 /** Used to detect octal string values. */
8377 var reIsOctal = /^0o[0-7]+$/i;
8378
8379 /** Used to detect unsigned integer values. */
8380 var reIsUint = /^(?:0|[1-9]\d*)$/;
8381
8382 /** Used to match Latin Unicode letters (excluding mathematical operators). */
8383 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
8384
8385 /** Used to ensure capturing order of template delimiters. */
8386 var reNoMatch = /($^)/;
8387
8388 /** Used to match unescaped characters in compiled string literals. */
8389 var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
8390
8391 /** Used to compose unicode character classes. */
8392 var rsAstralRange = '\\ud800-\\udfff',
8393 rsComboMarksRange = '\\u0300-\\u036f',
8394 reComboHalfMarksRange = '\\ufe20-\\ufe2f',
8395 rsComboSymbolsRange = '\\u20d0-\\u20ff',
8396 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
8397 rsDingbatRange = '\\u2700-\\u27bf',
8398 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
8399 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
8400 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
8401 rsPunctuationRange = '\\u2000-\\u206f',
8402 rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000',
8403 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
8404 rsVarRange = '\\ufe0e\\ufe0f',
8405 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
8406
8407 /** Used to compose unicode capture groups. */
8408 var rsApos = "['\u2019]",
8409 rsAstral = '[' + rsAstralRange + ']',
8410 rsBreak = '[' + rsBreakRange + ']',
8411 rsCombo = '[' + rsComboRange + ']',
8412 rsDigits = '\\d+',
8413 rsDingbat = '[' + rsDingbatRange + ']',
8414 rsLower = '[' + rsLowerRange + ']',
8415 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
8416 rsFitz = '\\ud83c[\\udffb-\\udfff]',
8417 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
8418 rsNonAstral = '[^' + rsAstralRange + ']',
8419 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
8420 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
8421 rsUpper = '[' + rsUpperRange + ']',
8422 rsZWJ = '\\u200d';
8423
8424 /** Used to compose unicode regexes. */
8425 var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
8426 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
8427 rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
8428 rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
8429 reOptMod = rsModifier + '?',
8430 rsOptVar = '[' + rsVarRange + ']?',
8431 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
8432 rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
8433 rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
8434 rsSeq = rsOptVar + reOptMod + rsOptJoin,
8435 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,
8436 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
8437
8438 /** Used to match apostrophes. */
8439 var reApos = RegExp(rsApos, 'g');
8440
8441 /**
8442 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and
8443 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).
8444 */
8445 var reComboMark = RegExp(rsCombo, 'g');
8446
8447 /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
8448 var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
8449
8450 /** Used to match complex or compound words. */
8451 var reUnicodeWord = RegExp([
8452 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',
8453 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',
8454 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,
8455 rsUpper + '+' + rsOptContrUpper,
8456 rsOrdUpper,
8457 rsOrdLower,
8458 rsDigits,
8459 rsEmoji
8460 ].join('|'), 'g');
8461
8462 /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
8463 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
8464
8465 /** Used to detect strings that need a more robust regexp to match words. */
8466 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
8467
8468 /** Used to assign default `context` object properties. */
8469 var contextProps = [
8470 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',
8471 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',
8472 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',
8473 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',
8474 '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'
8475 ];
8476
8477 /** Used to make template sourceURLs easier to identify. */
8478 var templateCounter = -1;
8479
8480 /** Used to identify `toStringTag` values of typed arrays. */
8481 var typedArrayTags = {};
8482 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
8483 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
8484 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
8485 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
8486 typedArrayTags[uint32Tag] = true;
8487 typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
8488 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
8489 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
8490 typedArrayTags[errorTag] = typedArrayTags[funcTag] =
8491 typedArrayTags[mapTag] = typedArrayTags[numberTag] =
8492 typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
8493 typedArrayTags[setTag] = typedArrayTags[stringTag] =
8494 typedArrayTags[weakMapTag] = false;
8495
8496 /** Used to identify `toStringTag` values supported by `_.clone`. */
8497 var cloneableTags = {};
8498 cloneableTags[argsTag] = cloneableTags[arrayTag] =
8499 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
8500 cloneableTags[boolTag] = cloneableTags[dateTag] =
8501 cloneableTags[float32Tag] = cloneableTags[float64Tag] =
8502 cloneableTags[int8Tag] = cloneableTags[int16Tag] =
8503 cloneableTags[int32Tag] = cloneableTags[mapTag] =
8504 cloneableTags[numberTag] = cloneableTags[objectTag] =
8505 cloneableTags[regexpTag] = cloneableTags[setTag] =
8506 cloneableTags[stringTag] = cloneableTags[symbolTag] =
8507 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
8508 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
8509 cloneableTags[errorTag] = cloneableTags[funcTag] =
8510 cloneableTags[weakMapTag] = false;
8511
8512 /** Used to map Latin Unicode letters to basic Latin letters. */
8513 var deburredLetters = {
8514 // Latin-1 Supplement block.
8515 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
8516 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
8517 '\xc7': 'C', '\xe7': 'c',
8518 '\xd0': 'D', '\xf0': 'd',
8519 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
8520 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
8521 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
8522 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
8523 '\xd1': 'N', '\xf1': 'n',
8524 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
8525 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
8526 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
8527 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
8528 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
8529 '\xc6': 'Ae', '\xe6': 'ae',
8530 '\xde': 'Th', '\xfe': 'th',
8531 '\xdf': 'ss',
8532 // Latin Extended-A block.
8533 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
8534 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
8535 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
8536 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
8537 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
8538 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
8539 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
8540 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
8541 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
8542 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
8543 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
8544 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
8545 '\u0134': 'J', '\u0135': 'j',
8546 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
8547 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
8548 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
8549 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
8550 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
8551 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
8552 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
8553 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
8554 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
8555 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
8556 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
8557 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
8558 '\u0163': 't', '\u0165': 't', '\u0167': 't',
8559 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
8560 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
8561 '\u0174': 'W', '\u0175': 'w',
8562 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
8563 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
8564 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
8565 '\u0132': 'IJ', '\u0133': 'ij',
8566 '\u0152': 'Oe', '\u0153': 'oe',
8567 '\u0149': "'n", '\u017f': 's'
8568 };
8569
8570 /** Used to map characters to HTML entities. */
8571 var htmlEscapes = {
8572 '&': '&amp;',
8573 '<': '&lt;',
8574 '>': '&gt;',
8575 '"': '&quot;',
8576 "'": '&#39;'
8577 };
8578
8579 /** Used to map HTML entities to characters. */
8580 var htmlUnescapes = {
8581 '&amp;': '&',
8582 '&lt;': '<',
8583 '&gt;': '>',
8584 '&quot;': '"',
8585 '&#39;': "'"
8586 };
8587
8588 /** Used to escape characters for inclusion in compiled string literals. */
8589 var stringEscapes = {
8590 '\\': '\\',
8591 "'": "'",
8592 '\n': 'n',
8593 '\r': 'r',
8594 '\u2028': 'u2028',
8595 '\u2029': 'u2029'
8596 };
8597
8598 /** Built-in method references without a dependency on `root`. */
8599 var freeParseFloat = parseFloat,
8600 freeParseInt = parseInt;
8601
8602 /** Detect free variable `global` from Node.js. */
8603 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
8604
8605 /** Detect free variable `self`. */
8606 var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
8607
8608 /** Used as a reference to the global object. */
8609 var root = freeGlobal || freeSelf || Function('return this')();
8610
8611 /** Detect free variable `exports`. */
8612 var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
8613
8614 /** Detect free variable `module`. */
8615 var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;
8616
8617 /** Detect the popular CommonJS extension `module.exports`. */
8618 var moduleExports = freeModule && freeModule.exports === freeExports;
8619
8620 /** Detect free variable `process` from Node.js. */
8621 var freeProcess = moduleExports && freeGlobal.process;
8622
8623 /** Used to access faster Node.js helpers. */
8624 var nodeUtil = (function() {
8625 try {
8626 // Use `util.types` for Node.js 10+.
8627 var types = freeModule && freeModule.require && freeModule.require('util').types;
8628
8629 if (types) {
8630 return types;
8631 }
8632
8633 // Legacy `process.binding('util')` for Node.js < 10.
8634 return freeProcess && freeProcess.binding && freeProcess.binding('util');
8635 } catch (e) {}
8636 }());
8637
8638 /* Node.js helper references. */
8639 var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,
8640 nodeIsDate = nodeUtil && nodeUtil.isDate,
8641 nodeIsMap = nodeUtil && nodeUtil.isMap,
8642 nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,
8643 nodeIsSet = nodeUtil && nodeUtil.isSet,
8644 nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
8645
8646 /*--------------------------------------------------------------------------*/
8647
8648 /**
8649 * A faster alternative to `Function#apply`, this function invokes `func`
8650 * with the `this` binding of `thisArg` and the arguments of `args`.
8651 *
8652 * @private
8653 * @param {Function} func The function to invoke.
8654 * @param {*} thisArg The `this` binding of `func`.
8655 * @param {Array} args The arguments to invoke `func` with.
8656 * @returns {*} Returns the result of `func`.
8657 */
8658 function apply(func, thisArg, args) {
8659 switch (args.length) {
8660 case 0: return func.call(thisArg);
8661 case 1: return func.call(thisArg, args[0]);
8662 case 2: return func.call(thisArg, args[0], args[1]);
8663 case 3: return func.call(thisArg, args[0], args[1], args[2]);
8664 }
8665 return func.apply(thisArg, args);
8666 }
8667
8668 /**
8669 * A specialized version of `baseAggregator` for arrays.
8670 *
8671 * @private
8672 * @param {Array} [array] The array to iterate over.
8673 * @param {Function} setter The function to set `accumulator` values.
8674 * @param {Function} iteratee The iteratee to transform keys.
8675 * @param {Object} accumulator The initial aggregated object.
8676 * @returns {Function} Returns `accumulator`.
8677 */
8678 function arrayAggregator(array, setter, iteratee, accumulator) {
8679 var index = -1,
8680 length = array == null ? 0 : array.length;
8681
8682 while (++index < length) {
8683 var value = array[index];
8684 setter(accumulator, value, iteratee(value), array);
8685 }
8686 return accumulator;
8687 }
8688
8689 /**
8690 * A specialized version of `_.forEach` for arrays without support for
8691 * iteratee shorthands.
8692 *
8693 * @private
8694 * @param {Array} [array] The array to iterate over.
8695 * @param {Function} iteratee The function invoked per iteration.
8696 * @returns {Array} Returns `array`.
8697 */
8698 function arrayEach(array, iteratee) {
8699 var index = -1,
8700 length = array == null ? 0 : array.length;
8701
8702 while (++index < length) {
8703 if (iteratee(array[index], index, array) === false) {
8704 break;
8705 }
8706 }
8707 return array;
8708 }
8709
8710 /**
8711 * A specialized version of `_.forEachRight` for arrays without support for
8712 * iteratee shorthands.
8713 *
8714 * @private
8715 * @param {Array} [array] The array to iterate over.
8716 * @param {Function} iteratee The function invoked per iteration.
8717 * @returns {Array} Returns `array`.
8718 */
8719 function arrayEachRight(array, iteratee) {
8720 var length = array == null ? 0 : array.length;
8721
8722 while (length--) {
8723 if (iteratee(array[length], length, array) === false) {
8724 break;
8725 }
8726 }
8727 return array;
8728 }
8729
8730 /**
8731 * A specialized version of `_.every` for arrays without support for
8732 * iteratee shorthands.
8733 *
8734 * @private
8735 * @param {Array} [array] The array to iterate over.
8736 * @param {Function} predicate The function invoked per iteration.
8737 * @returns {boolean} Returns `true` if all elements pass the predicate check,
8738 * else `false`.
8739 */
8740 function arrayEvery(array, predicate) {
8741 var index = -1,
8742 length = array == null ? 0 : array.length;
8743
8744 while (++index < length) {
8745 if (!predicate(array[index], index, array)) {
8746 return false;
8747 }
8748 }
8749 return true;
8750 }
8751
8752 /**
8753 * A specialized version of `_.filter` for arrays without support for
8754 * iteratee shorthands.
8755 *
8756 * @private
8757 * @param {Array} [array] The array to iterate over.
8758 * @param {Function} predicate The function invoked per iteration.
8759 * @returns {Array} Returns the new filtered array.
8760 */
8761 function arrayFilter(array, predicate) {
8762 var index = -1,
8763 length = array == null ? 0 : array.length,
8764 resIndex = 0,
8765 result = [];
8766
8767 while (++index < length) {
8768 var value = array[index];
8769 if (predicate(value, index, array)) {
8770 result[resIndex++] = value;
8771 }
8772 }
8773 return result;
8774 }
8775
8776 /**
8777 * A specialized version of `_.includes` for arrays without support for
8778 * specifying an index to search from.
8779 *
8780 * @private
8781 * @param {Array} [array] The array to inspect.
8782 * @param {*} target The value to search for.
8783 * @returns {boolean} Returns `true` if `target` is found, else `false`.
8784 */
8785 function arrayIncludes(array, value) {
8786 var length = array == null ? 0 : array.length;
8787 return !!length && baseIndexOf(array, value, 0) > -1;
8788 }
8789
8790 /**
8791 * This function is like `arrayIncludes` except that it accepts a comparator.
8792 *
8793 * @private
8794 * @param {Array} [array] The array to inspect.
8795 * @param {*} target The value to search for.
8796 * @param {Function} comparator The comparator invoked per element.
8797 * @returns {boolean} Returns `true` if `target` is found, else `false`.
8798 */
8799 function arrayIncludesWith(array, value, comparator) {
8800 var index = -1,
8801 length = array == null ? 0 : array.length;
8802
8803 while (++index < length) {
8804 if (comparator(value, array[index])) {
8805 return true;
8806 }
8807 }
8808 return false;
8809 }
8810
8811 /**
8812 * A specialized version of `_.map` for arrays without support for iteratee
8813 * shorthands.
8814 *
8815 * @private
8816 * @param {Array} [array] The array to iterate over.
8817 * @param {Function} iteratee The function invoked per iteration.
8818 * @returns {Array} Returns the new mapped array.
8819 */
8820 function arrayMap(array, iteratee) {
8821 var index = -1,
8822 length = array == null ? 0 : array.length,
8823 result = Array(length);
8824
8825 while (++index < length) {
8826 result[index] = iteratee(array[index], index, array);
8827 }
8828 return result;
8829 }
8830
8831 /**
8832 * Appends the elements of `values` to `array`.
8833 *
8834 * @private
8835 * @param {Array} array The array to modify.
8836 * @param {Array} values The values to append.
8837 * @returns {Array} Returns `array`.
8838 */
8839 function arrayPush(array, values) {
8840 var index = -1,
8841 length = values.length,
8842 offset = array.length;
8843
8844 while (++index < length) {
8845 array[offset + index] = values[index];
8846 }
8847 return array;
8848 }
8849
8850 /**
8851 * A specialized version of `_.reduce` for arrays without support for
8852 * iteratee shorthands.
8853 *
8854 * @private
8855 * @param {Array} [array] The array to iterate over.
8856 * @param {Function} iteratee The function invoked per iteration.
8857 * @param {*} [accumulator] The initial value.
8858 * @param {boolean} [initAccum] Specify using the first element of `array` as
8859 * the initial value.
8860 * @returns {*} Returns the accumulated value.
8861 */
8862 function arrayReduce(array, iteratee, accumulator, initAccum) {
8863 var index = -1,
8864 length = array == null ? 0 : array.length;
8865
8866 if (initAccum && length) {
8867 accumulator = array[++index];
8868 }
8869 while (++index < length) {
8870 accumulator = iteratee(accumulator, array[index], index, array);
8871 }
8872 return accumulator;
8873 }
8874
8875 /**
8876 * A specialized version of `_.reduceRight` for arrays without support for
8877 * iteratee shorthands.
8878 *
8879 * @private
8880 * @param {Array} [array] The array to iterate over.
8881 * @param {Function} iteratee The function invoked per iteration.
8882 * @param {*} [accumulator] The initial value.
8883 * @param {boolean} [initAccum] Specify using the last element of `array` as
8884 * the initial value.
8885 * @returns {*} Returns the accumulated value.
8886 */
8887 function arrayReduceRight(array, iteratee, accumulator, initAccum) {
8888 var length = array == null ? 0 : array.length;
8889 if (initAccum && length) {
8890 accumulator = array[--length];
8891 }
8892 while (length--) {
8893 accumulator = iteratee(accumulator, array[length], length, array);
8894 }
8895 return accumulator;
8896 }
8897
8898 /**
8899 * A specialized version of `_.some` for arrays without support for iteratee
8900 * shorthands.
8901 *
8902 * @private
8903 * @param {Array} [array] The array to iterate over.
8904 * @param {Function} predicate The function invoked per iteration.
8905 * @returns {boolean} Returns `true` if any element passes the predicate check,
8906 * else `false`.
8907 */
8908 function arraySome(array, predicate) {
8909 var index = -1,
8910 length = array == null ? 0 : array.length;
8911
8912 while (++index < length) {
8913 if (predicate(array[index], index, array)) {
8914 return true;
8915 }
8916 }
8917 return false;
8918 }
8919
8920 /**
8921 * Gets the size of an ASCII `string`.
8922 *
8923 * @private
8924 * @param {string} string The string inspect.
8925 * @returns {number} Returns the string size.
8926 */
8927 var asciiSize = baseProperty('length');
8928
8929 /**
8930 * Converts an ASCII `string` to an array.
8931 *
8932 * @private
8933 * @param {string} string The string to convert.
8934 * @returns {Array} Returns the converted array.
8935 */
8936 function asciiToArray(string) {
8937 return string.split('');
8938 }
8939
8940 /**
8941 * Splits an ASCII `string` into an array of its words.
8942 *
8943 * @private
8944 * @param {string} The string to inspect.
8945 * @returns {Array} Returns the words of `string`.
8946 */
8947 function asciiWords(string) {
8948 return string.match(reAsciiWord) || [];
8949 }
8950
8951 /**
8952 * The base implementation of methods like `_.findKey` and `_.findLastKey`,
8953 * without support for iteratee shorthands, which iterates over `collection`
8954 * using `eachFunc`.
8955 *
8956 * @private
8957 * @param {Array|Object} collection The collection to inspect.
8958 * @param {Function} predicate The function invoked per iteration.
8959 * @param {Function} eachFunc The function to iterate over `collection`.
8960 * @returns {*} Returns the found element or its key, else `undefined`.
8961 */
8962 function baseFindKey(collection, predicate, eachFunc) {
8963 var result;
8964 eachFunc(collection, function(value, key, collection) {
8965 if (predicate(value, key, collection)) {
8966 result = key;
8967 return false;
8968 }
8969 });
8970 return result;
8971 }
8972
8973 /**
8974 * The base implementation of `_.findIndex` and `_.findLastIndex` without
8975 * support for iteratee shorthands.
8976 *
8977 * @private
8978 * @param {Array} array The array to inspect.
8979 * @param {Function} predicate The function invoked per iteration.
8980 * @param {number} fromIndex The index to search from.
8981 * @param {boolean} [fromRight] Specify iterating from right to left.
8982 * @returns {number} Returns the index of the matched value, else `-1`.
8983 */
8984 function baseFindIndex(array, predicate, fromIndex, fromRight) {
8985 var length = array.length,
8986 index = fromIndex + (fromRight ? 1 : -1);
8987
8988 while ((fromRight ? index-- : ++index < length)) {
8989 if (predicate(array[index], index, array)) {
8990 return index;
8991 }
8992 }
8993 return -1;
8994 }
8995
8996 /**
8997 * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
8998 *
8999 * @private
9000 * @param {Array} array The array to inspect.
9001 * @param {*} value The value to search for.
9002 * @param {number} fromIndex The index to search from.
9003 * @returns {number} Returns the index of the matched value, else `-1`.
9004 */
9005 function baseIndexOf(array, value, fromIndex) {
9006 return value === value
9007 ? strictIndexOf(array, value, fromIndex)
9008 : baseFindIndex(array, baseIsNaN, fromIndex);
9009 }
9010
9011 /**
9012 * This function is like `baseIndexOf` except that it accepts a comparator.
9013 *
9014 * @private
9015 * @param {Array} array The array to inspect.
9016 * @param {*} value The value to search for.
9017 * @param {number} fromIndex The index to search from.
9018 * @param {Function} comparator The comparator invoked per element.
9019 * @returns {number} Returns the index of the matched value, else `-1`.
9020 */
9021 function baseIndexOfWith(array, value, fromIndex, comparator) {
9022 var index = fromIndex - 1,
9023 length = array.length;
9024
9025 while (++index < length) {
9026 if (comparator(array[index], value)) {
9027 return index;
9028 }
9029 }
9030 return -1;
9031 }
9032
9033 /**
9034 * The base implementation of `_.isNaN` without support for number objects.
9035 *
9036 * @private
9037 * @param {*} value The value to check.
9038 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
9039 */
9040 function baseIsNaN(value) {
9041 return value !== value;
9042 }
9043
9044 /**
9045 * The base implementation of `_.mean` and `_.meanBy` without support for
9046 * iteratee shorthands.
9047 *
9048 * @private
9049 * @param {Array} array The array to iterate over.
9050 * @param {Function} iteratee The function invoked per iteration.
9051 * @returns {number} Returns the mean.
9052 */
9053 function baseMean(array, iteratee) {
9054 var length = array == null ? 0 : array.length;
9055 return length ? (baseSum(array, iteratee) / length) : NAN;
9056 }
9057
9058 /**
9059 * The base implementation of `_.property` without support for deep paths.
9060 *
9061 * @private
9062 * @param {string} key The key of the property to get.
9063 * @returns {Function} Returns the new accessor function.
9064 */
9065 function baseProperty(key) {
9066 return function(object) {
9067 return object == null ? undefined : object[key];
9068 };
9069 }
9070
9071 /**
9072 * The base implementation of `_.propertyOf` without support for deep paths.
9073 *
9074 * @private
9075 * @param {Object} object The object to query.
9076 * @returns {Function} Returns the new accessor function.
9077 */
9078 function basePropertyOf(object) {
9079 return function(key) {
9080 return object == null ? undefined : object[key];
9081 };
9082 }
9083
9084 /**
9085 * The base implementation of `_.reduce` and `_.reduceRight`, without support
9086 * for iteratee shorthands, which iterates over `collection` using `eachFunc`.
9087 *
9088 * @private
9089 * @param {Array|Object} collection The collection to iterate over.
9090 * @param {Function} iteratee The function invoked per iteration.
9091 * @param {*} accumulator The initial value.
9092 * @param {boolean} initAccum Specify using the first or last element of
9093 * `collection` as the initial value.
9094 * @param {Function} eachFunc The function to iterate over `collection`.
9095 * @returns {*} Returns the accumulated value.
9096 */
9097 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {
9098 eachFunc(collection, function(value, index, collection) {
9099 accumulator = initAccum
9100 ? (initAccum = false, value)
9101 : iteratee(accumulator, value, index, collection);
9102 });
9103 return accumulator;
9104 }
9105
9106 /**
9107 * The base implementation of `_.sortBy` which uses `comparer` to define the
9108 * sort order of `array` and replaces criteria objects with their corresponding
9109 * values.
9110 *
9111 * @private
9112 * @param {Array} array The array to sort.
9113 * @param {Function} comparer The function to define sort order.
9114 * @returns {Array} Returns `array`.
9115 */
9116 function baseSortBy(array, comparer) {
9117 var length = array.length;
9118
9119 array.sort(comparer);
9120 while (length--) {
9121 array[length] = array[length].value;
9122 }
9123 return array;
9124 }
9125
9126 /**
9127 * The base implementation of `_.sum` and `_.sumBy` without support for
9128 * iteratee shorthands.
9129 *
9130 * @private
9131 * @param {Array} array The array to iterate over.
9132 * @param {Function} iteratee The function invoked per iteration.
9133 * @returns {number} Returns the sum.
9134 */
9135 function baseSum(array, iteratee) {
9136 var result,
9137 index = -1,
9138 length = array.length;
9139
9140 while (++index < length) {
9141 var current = iteratee(array[index]);
9142 if (current !== undefined) {
9143 result = result === undefined ? current : (result + current);
9144 }
9145 }
9146 return result;
9147 }
9148
9149 /**
9150 * The base implementation of `_.times` without support for iteratee shorthands
9151 * or max array length checks.
9152 *
9153 * @private
9154 * @param {number} n The number of times to invoke `iteratee`.
9155 * @param {Function} iteratee The function invoked per iteration.
9156 * @returns {Array} Returns the array of results.
9157 */
9158 function baseTimes(n, iteratee) {
9159 var index = -1,
9160 result = Array(n);
9161
9162 while (++index < n) {
9163 result[index] = iteratee(index);
9164 }
9165 return result;
9166 }
9167
9168 /**
9169 * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array
9170 * of key-value pairs for `object` corresponding to the property names of `props`.
9171 *
9172 * @private
9173 * @param {Object} object The object to query.
9174 * @param {Array} props The property names to get values for.
9175 * @returns {Object} Returns the key-value pairs.
9176 */
9177 function baseToPairs(object, props) {
9178 return arrayMap(props, function(key) {
9179 return [key, object[key]];
9180 });
9181 }
9182
9183 /**
9184 * The base implementation of `_.unary` without support for storing metadata.
9185 *
9186 * @private
9187 * @param {Function} func The function to cap arguments for.
9188 * @returns {Function} Returns the new capped function.
9189 */
9190 function baseUnary(func) {
9191 return function(value) {
9192 return func(value);
9193 };
9194 }
9195
9196 /**
9197 * The base implementation of `_.values` and `_.valuesIn` which creates an
9198 * array of `object` property values corresponding to the property names
9199 * of `props`.
9200 *
9201 * @private
9202 * @param {Object} object The object to query.
9203 * @param {Array} props The property names to get values for.
9204 * @returns {Object} Returns the array of property values.
9205 */
9206 function baseValues(object, props) {
9207 return arrayMap(props, function(key) {
9208 return object[key];
9209 });
9210 }
9211
9212 /**
9213 * Checks if a `cache` value for `key` exists.
9214 *
9215 * @private
9216 * @param {Object} cache The cache to query.
9217 * @param {string} key The key of the entry to check.
9218 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
9219 */
9220 function cacheHas(cache, key) {
9221 return cache.has(key);
9222 }
9223
9224 /**
9225 * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol
9226 * that is not found in the character symbols.
9227 *
9228 * @private
9229 * @param {Array} strSymbols The string symbols to inspect.
9230 * @param {Array} chrSymbols The character symbols to find.
9231 * @returns {number} Returns the index of the first unmatched string symbol.
9232 */
9233 function charsStartIndex(strSymbols, chrSymbols) {
9234 var index = -1,
9235 length = strSymbols.length;
9236
9237 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
9238 return index;
9239 }
9240
9241 /**
9242 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol
9243 * that is not found in the character symbols.
9244 *
9245 * @private
9246 * @param {Array} strSymbols The string symbols to inspect.
9247 * @param {Array} chrSymbols The character symbols to find.
9248 * @returns {number} Returns the index of the last unmatched string symbol.
9249 */
9250 function charsEndIndex(strSymbols, chrSymbols) {
9251 var index = strSymbols.length;
9252
9253 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}
9254 return index;
9255 }
9256
9257 /**
9258 * Gets the number of `placeholder` occurrences in `array`.
9259 *
9260 * @private
9261 * @param {Array} array The array to inspect.
9262 * @param {*} placeholder The placeholder to search for.
9263 * @returns {number} Returns the placeholder count.
9264 */
9265 function countHolders(array, placeholder) {
9266 var length = array.length,
9267 result = 0;
9268
9269 while (length--) {
9270 if (array[length] === placeholder) {
9271 ++result;
9272 }
9273 }
9274 return result;
9275 }
9276
9277 /**
9278 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
9279 * letters to basic Latin letters.
9280 *
9281 * @private
9282 * @param {string} letter The matched letter to deburr.
9283 * @returns {string} Returns the deburred letter.
9284 */
9285 var deburrLetter = basePropertyOf(deburredLetters);
9286
9287 /**
9288 * Used by `_.escape` to convert characters to HTML entities.
9289 *
9290 * @private
9291 * @param {string} chr The matched character to escape.
9292 * @returns {string} Returns the escaped character.
9293 */
9294 var escapeHtmlChar = basePropertyOf(htmlEscapes);
9295
9296 /**
9297 * Used by `_.template` to escape characters for inclusion in compiled string literals.
9298 *
9299 * @private
9300 * @param {string} chr The matched character to escape.
9301 * @returns {string} Returns the escaped character.
9302 */
9303 function escapeStringChar(chr) {
9304 return '\\' + stringEscapes[chr];
9305 }
9306
9307 /**
9308 * Gets the value at `key` of `object`.
9309 *
9310 * @private
9311 * @param {Object} [object] The object to query.
9312 * @param {string} key The key of the property to get.
9313 * @returns {*} Returns the property value.
9314 */
9315 function getValue(object, key) {
9316 return object == null ? undefined : object[key];
9317 }
9318
9319 /**
9320 * Checks if `string` contains Unicode symbols.
9321 *
9322 * @private
9323 * @param {string} string The string to inspect.
9324 * @returns {boolean} Returns `true` if a symbol is found, else `false`.
9325 */
9326 function hasUnicode(string) {
9327 return reHasUnicode.test(string);
9328 }
9329
9330 /**
9331 * Checks if `string` contains a word composed of Unicode symbols.
9332 *
9333 * @private
9334 * @param {string} string The string to inspect.
9335 * @returns {boolean} Returns `true` if a word is found, else `false`.
9336 */
9337 function hasUnicodeWord(string) {
9338 return reHasUnicodeWord.test(string);
9339 }
9340
9341 /**
9342 * Converts `iterator` to an array.
9343 *
9344 * @private
9345 * @param {Object} iterator The iterator to convert.
9346 * @returns {Array} Returns the converted array.
9347 */
9348 function iteratorToArray(iterator) {
9349 var data,
9350 result = [];
9351
9352 while (!(data = iterator.next()).done) {
9353 result.push(data.value);
9354 }
9355 return result;
9356 }
9357
9358 /**
9359 * Converts `map` to its key-value pairs.
9360 *
9361 * @private
9362 * @param {Object} map The map to convert.
9363 * @returns {Array} Returns the key-value pairs.
9364 */
9365 function mapToArray(map) {
9366 var index = -1,
9367 result = Array(map.size);
9368
9369 map.forEach(function(value, key) {
9370 result[++index] = [key, value];
9371 });
9372 return result;
9373 }
9374
9375 /**
9376 * Creates a unary function that invokes `func` with its argument transformed.
9377 *
9378 * @private
9379 * @param {Function} func The function to wrap.
9380 * @param {Function} transform The argument transform.
9381 * @returns {Function} Returns the new function.
9382 */
9383 function overArg(func, transform) {
9384 return function(arg) {
9385 return func(transform(arg));
9386 };
9387 }
9388
9389 /**
9390 * Replaces all `placeholder` elements in `array` with an internal placeholder
9391 * and returns an array of their indexes.
9392 *
9393 * @private
9394 * @param {Array} array The array to modify.
9395 * @param {*} placeholder The placeholder to replace.
9396 * @returns {Array} Returns the new array of placeholder indexes.
9397 */
9398 function replaceHolders(array, placeholder) {
9399 var index = -1,
9400 length = array.length,
9401 resIndex = 0,
9402 result = [];
9403
9404 while (++index < length) {
9405 var value = array[index];
9406 if (value === placeholder || value === PLACEHOLDER) {
9407 array[index] = PLACEHOLDER;
9408 result[resIndex++] = index;
9409 }
9410 }
9411 return result;
9412 }
9413
9414 /**
9415 * Gets the value at `key`, unless `key` is "__proto__".
9416 *
9417 * @private
9418 * @param {Object} object The object to query.
9419 * @param {string} key The key of the property to get.
9420 * @returns {*} Returns the property value.
9421 */
9422 function safeGet(object, key) {
9423 return key == '__proto__'
9424 ? undefined
9425 : object[key];
9426 }
9427
9428 /**
9429 * Converts `set` to an array of its values.
9430 *
9431 * @private
9432 * @param {Object} set The set to convert.
9433 * @returns {Array} Returns the values.
9434 */
9435 function setToArray(set) {
9436 var index = -1,
9437 result = Array(set.size);
9438
9439 set.forEach(function(value) {
9440 result[++index] = value;
9441 });
9442 return result;
9443 }
9444
9445 /**
9446 * Converts `set` to its value-value pairs.
9447 *
9448 * @private
9449 * @param {Object} set The set to convert.
9450 * @returns {Array} Returns the value-value pairs.
9451 */
9452 function setToPairs(set) {
9453 var index = -1,
9454 result = Array(set.size);
9455
9456 set.forEach(function(value) {
9457 result[++index] = [value, value];
9458 });
9459 return result;
9460 }
9461
9462 /**
9463 * A specialized version of `_.indexOf` which performs strict equality
9464 * comparisons of values, i.e. `===`.
9465 *
9466 * @private
9467 * @param {Array} array The array to inspect.
9468 * @param {*} value The value to search for.
9469 * @param {number} fromIndex The index to search from.
9470 * @returns {number} Returns the index of the matched value, else `-1`.
9471 */
9472 function strictIndexOf(array, value, fromIndex) {
9473 var index = fromIndex - 1,
9474 length = array.length;
9475
9476 while (++index < length) {
9477 if (array[index] === value) {
9478 return index;
9479 }
9480 }
9481 return -1;
9482 }
9483
9484 /**
9485 * A specialized version of `_.lastIndexOf` which performs strict equality
9486 * comparisons of values, i.e. `===`.
9487 *
9488 * @private
9489 * @param {Array} array The array to inspect.
9490 * @param {*} value The value to search for.
9491 * @param {number} fromIndex The index to search from.
9492 * @returns {number} Returns the index of the matched value, else `-1`.
9493 */
9494 function strictLastIndexOf(array, value, fromIndex) {
9495 var index = fromIndex + 1;
9496 while (index--) {
9497 if (array[index] === value) {
9498 return index;
9499 }
9500 }
9501 return index;
9502 }
9503
9504 /**
9505 * Gets the number of symbols in `string`.
9506 *
9507 * @private
9508 * @param {string} string The string to inspect.
9509 * @returns {number} Returns the string size.
9510 */
9511 function stringSize(string) {
9512 return hasUnicode(string)
9513 ? unicodeSize(string)
9514 : asciiSize(string);
9515 }
9516
9517 /**
9518 * Converts `string` to an array.
9519 *
9520 * @private
9521 * @param {string} string The string to convert.
9522 * @returns {Array} Returns the converted array.
9523 */
9524 function stringToArray(string) {
9525 return hasUnicode(string)
9526 ? unicodeToArray(string)
9527 : asciiToArray(string);
9528 }
9529
9530 /**
9531 * Used by `_.unescape` to convert HTML entities to characters.
9532 *
9533 * @private
9534 * @param {string} chr The matched character to unescape.
9535 * @returns {string} Returns the unescaped character.
9536 */
9537 var unescapeHtmlChar = basePropertyOf(htmlUnescapes);
9538
9539 /**
9540 * Gets the size of a Unicode `string`.
9541 *
9542 * @private
9543 * @param {string} string The string inspect.
9544 * @returns {number} Returns the string size.
9545 */
9546 function unicodeSize(string) {
9547 var result = reUnicode.lastIndex = 0;
9548 while (reUnicode.test(string)) {
9549 ++result;
9550 }
9551 return result;
9552 }
9553
9554 /**
9555 * Converts a Unicode `string` to an array.
9556 *
9557 * @private
9558 * @param {string} string The string to convert.
9559 * @returns {Array} Returns the converted array.
9560 */
9561 function unicodeToArray(string) {
9562 return string.match(reUnicode) || [];
9563 }
9564
9565 /**
9566 * Splits a Unicode `string` into an array of its words.
9567 *
9568 * @private
9569 * @param {string} The string to inspect.
9570 * @returns {Array} Returns the words of `string`.
9571 */
9572 function unicodeWords(string) {
9573 return string.match(reUnicodeWord) || [];
9574 }
9575
9576 /*--------------------------------------------------------------------------*/
9577
9578 /**
9579 * Create a new pristine `lodash` function using the `context` object.
9580 *
9581 * @static
9582 * @memberOf _
9583 * @since 1.1.0
9584 * @category Util
9585 * @param {Object} [context=root] The context object.
9586 * @returns {Function} Returns a new `lodash` function.
9587 * @example
9588 *
9589 * _.mixin({ 'foo': _.constant('foo') });
9590 *
9591 * var lodash = _.runInContext();
9592 * lodash.mixin({ 'bar': lodash.constant('bar') });
9593 *
9594 * _.isFunction(_.foo);
9595 * // => true
9596 * _.isFunction(_.bar);
9597 * // => false
9598 *
9599 * lodash.isFunction(lodash.foo);
9600 * // => false
9601 * lodash.isFunction(lodash.bar);
9602 * // => true
9603 *
9604 * // Create a suped-up `defer` in Node.js.
9605 * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
9606 */
9607 var runInContext = (function runInContext(context) {
9608 context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));
9609
9610 /** Built-in constructor references. */
9611 var Array = context.Array,
9612 Date = context.Date,
9613 Error = context.Error,
9614 Function = context.Function,
9615 Math = context.Math,
9616 Object = context.Object,
9617 RegExp = context.RegExp,
9618 String = context.String,
9619 TypeError = context.TypeError;
9620
9621 /** Used for built-in method references. */
9622 var arrayProto = Array.prototype,
9623 funcProto = Function.prototype,
9624 objectProto = Object.prototype;
9625
9626 /** Used to detect overreaching core-js shims. */
9627 var coreJsData = context['__core-js_shared__'];
9628
9629 /** Used to resolve the decompiled source of functions. */
9630 var funcToString = funcProto.toString;
9631
9632 /** Used to check objects for own properties. */
9633 var hasOwnProperty = objectProto.hasOwnProperty;
9634
9635 /** Used to generate unique IDs. */
9636 var idCounter = 0;
9637
9638 /** Used to detect methods masquerading as native. */
9639 var maskSrcKey = (function() {
9640 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
9641 return uid ? ('Symbol(src)_1.' + uid) : '';
9642 }());
9643
9644 /**
9645 * Used to resolve the
9646 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
9647 * of values.
9648 */
9649 var nativeObjectToString = objectProto.toString;
9650
9651 /** Used to infer the `Object` constructor. */
9652 var objectCtorString = funcToString.call(Object);
9653
9654 /** Used to restore the original `_` reference in `_.noConflict`. */
9655 var oldDash = root._;
9656
9657 /** Used to detect if a method is native. */
9658 var reIsNative = RegExp('^' +
9659 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
9660 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
9661 );
9662
9663 /** Built-in value references. */
9664 var Buffer = moduleExports ? context.Buffer : undefined,
9665 Symbol = context.Symbol,
9666 Uint8Array = context.Uint8Array,
9667 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,
9668 getPrototype = overArg(Object.getPrototypeOf, Object),
9669 objectCreate = Object.create,
9670 propertyIsEnumerable = objectProto.propertyIsEnumerable,
9671 splice = arrayProto.splice,
9672 spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,
9673 symIterator = Symbol ? Symbol.iterator : undefined,
9674 symToStringTag = Symbol ? Symbol.toStringTag : undefined;
9675
9676 var defineProperty = (function() {
9677 try {
9678 var func = getNative(Object, 'defineProperty');
9679 func({}, '', {});
9680 return func;
9681 } catch (e) {}
9682 }());
9683
9684 /** Mocked built-ins. */
9685 var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,
9686 ctxNow = Date && Date.now !== root.Date.now && Date.now,
9687 ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;
9688
9689 /* Built-in method references for those with the same name as other `lodash` methods. */
9690 var nativeCeil = Math.ceil,
9691 nativeFloor = Math.floor,
9692 nativeGetSymbols = Object.getOwnPropertySymbols,
9693 nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
9694 nativeIsFinite = context.isFinite,
9695 nativeJoin = arrayProto.join,
9696 nativeKeys = overArg(Object.keys, Object),
9697 nativeMax = Math.max,
9698 nativeMin = Math.min,
9699 nativeNow = Date.now,
9700 nativeParseInt = context.parseInt,
9701 nativeRandom = Math.random,
9702 nativeReverse = arrayProto.reverse;
9703
9704 /* Built-in method references that are verified to be native. */
9705 var DataView = getNative(context, 'DataView'),
9706 Map = getNative(context, 'Map'),
9707 Promise = getNative(context, 'Promise'),
9708 Set = getNative(context, 'Set'),
9709 WeakMap = getNative(context, 'WeakMap'),
9710 nativeCreate = getNative(Object, 'create');
9711
9712 /** Used to store function metadata. */
9713 var metaMap = WeakMap && new WeakMap;
9714
9715 /** Used to lookup unminified function names. */
9716 var realNames = {};
9717
9718 /** Used to detect maps, sets, and weakmaps. */
9719 var dataViewCtorString = toSource(DataView),
9720 mapCtorString = toSource(Map),
9721 promiseCtorString = toSource(Promise),
9722 setCtorString = toSource(Set),
9723 weakMapCtorString = toSource(WeakMap);
9724
9725 /** Used to convert symbols to primitives and strings. */
9726 var symbolProto = Symbol ? Symbol.prototype : undefined,
9727 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,
9728 symbolToString = symbolProto ? symbolProto.toString : undefined;
9729
9730 /*------------------------------------------------------------------------*/
9731
9732 /**
9733 * Creates a `lodash` object which wraps `value` to enable implicit method
9734 * chain sequences. Methods that operate on and return arrays, collections,
9735 * and functions can be chained together. Methods that retrieve a single value
9736 * or may return a primitive value will automatically end the chain sequence
9737 * and return the unwrapped value. Otherwise, the value must be unwrapped
9738 * with `_#value`.
9739 *
9740 * Explicit chain sequences, which must be unwrapped with `_#value`, may be
9741 * enabled using `_.chain`.
9742 *
9743 * The execution of chained methods is lazy, that is, it's deferred until
9744 * `_#value` is implicitly or explicitly called.
9745 *
9746 * Lazy evaluation allows several methods to support shortcut fusion.
9747 * Shortcut fusion is an optimization to merge iteratee calls; this avoids
9748 * the creation of intermediate arrays and can greatly reduce the number of
9749 * iteratee executions. Sections of a chain sequence qualify for shortcut
9750 * fusion if the section is applied to an array and iteratees accept only
9751 * one argument. The heuristic for whether a section qualifies for shortcut
9752 * fusion is subject to change.
9753 *
9754 * Chaining is supported in custom builds as long as the `_#value` method is
9755 * directly or indirectly included in the build.
9756 *
9757 * In addition to lodash methods, wrappers have `Array` and `String` methods.
9758 *
9759 * The wrapper `Array` methods are:
9760 * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`
9761 *
9762 * The wrapper `String` methods are:
9763 * `replace` and `split`
9764 *
9765 * The wrapper methods that support shortcut fusion are:
9766 * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,
9767 * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,
9768 * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`
9769 *
9770 * The chainable wrapper methods are:
9771 * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,
9772 * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,
9773 * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,
9774 * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,
9775 * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,
9776 * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,
9777 * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,
9778 * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,
9779 * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,
9780 * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,
9781 * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,
9782 * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,
9783 * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,
9784 * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,
9785 * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,
9786 * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,
9787 * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,
9788 * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,
9789 * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,
9790 * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,
9791 * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,
9792 * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,
9793 * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,
9794 * `zipObject`, `zipObjectDeep`, and `zipWith`
9795 *
9796 * The wrapper methods that are **not** chainable by default are:
9797 * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,
9798 * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,
9799 * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,
9800 * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,
9801 * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,
9802 * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,
9803 * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,
9804 * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,
9805 * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,
9806 * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,
9807 * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,
9808 * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,
9809 * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,
9810 * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,
9811 * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,
9812 * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,
9813 * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,
9814 * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,
9815 * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,
9816 * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,
9817 * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,
9818 * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,
9819 * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,
9820 * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,
9821 * `upperFirst`, `value`, and `words`
9822 *
9823 * @name _
9824 * @constructor
9825 * @category Seq
9826 * @param {*} value The value to wrap in a `lodash` instance.
9827 * @returns {Object} Returns the new `lodash` wrapper instance.
9828 * @example
9829 *
9830 * function square(n) {
9831 * return n * n;
9832 * }
9833 *
9834 * var wrapped = _([1, 2, 3]);
9835 *
9836 * // Returns an unwrapped value.
9837 * wrapped.reduce(_.add);
9838 * // => 6
9839 *
9840 * // Returns a wrapped value.
9841 * var squares = wrapped.map(square);
9842 *
9843 * _.isArray(squares);
9844 * // => false
9845 *
9846 * _.isArray(squares.value());
9847 * // => true
9848 */
9849 function lodash(value) {
9850 if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
9851 if (value instanceof LodashWrapper) {
9852 return value;
9853 }
9854 if (hasOwnProperty.call(value, '__wrapped__')) {
9855 return wrapperClone(value);
9856 }
9857 }
9858 return new LodashWrapper(value);
9859 }
9860
9861 /**
9862 * The base implementation of `_.create` without support for assigning
9863 * properties to the created object.
9864 *
9865 * @private
9866 * @param {Object} proto The object to inherit from.
9867 * @returns {Object} Returns the new object.
9868 */
9869 var baseCreate = (function() {
9870 function object() {}
9871 return function(proto) {
9872 if (!isObject(proto)) {
9873 return {};
9874 }
9875 if (objectCreate) {
9876 return objectCreate(proto);
9877 }
9878 object.prototype = proto;
9879 var result = new object;
9880 object.prototype = undefined;
9881 return result;
9882 };
9883 }());
9884
9885 /**
9886 * The function whose prototype chain sequence wrappers inherit from.
9887 *
9888 * @private
9889 */
9890 function baseLodash() {
9891 // No operation performed.
9892 }
9893
9894 /**
9895 * The base constructor for creating `lodash` wrapper objects.
9896 *
9897 * @private
9898 * @param {*} value The value to wrap.
9899 * @param {boolean} [chainAll] Enable explicit method chain sequences.
9900 */
9901 function LodashWrapper(value, chainAll) {
9902 this.__wrapped__ = value;
9903 this.__actions__ = [];
9904 this.__chain__ = !!chainAll;
9905 this.__index__ = 0;
9906 this.__values__ = undefined;
9907 }
9908
9909 /**
9910 * By default, the template delimiters used by lodash are like those in
9911 * embedded Ruby (ERB) as well as ES2015 template strings. Change the
9912 * following template settings to use alternative delimiters.
9913 *
9914 * @static
9915 * @memberOf _
9916 * @type {Object}
9917 */
9918 lodash.templateSettings = {
9919
9920 /**
9921 * Used to detect `data` property values to be HTML-escaped.
9922 *
9923 * @memberOf _.templateSettings
9924 * @type {RegExp}
9925 */
9926 'escape': reEscape,
9927
9928 /**
9929 * Used to detect code to be evaluated.
9930 *
9931 * @memberOf _.templateSettings
9932 * @type {RegExp}
9933 */
9934 'evaluate': reEvaluate,
9935
9936 /**
9937 * Used to detect `data` property values to inject.
9938 *
9939 * @memberOf _.templateSettings
9940 * @type {RegExp}
9941 */
9942 'interpolate': reInterpolate,
9943
9944 /**
9945 * Used to reference the data object in the template text.
9946 *
9947 * @memberOf _.templateSettings
9948 * @type {string}
9949 */
9950 'variable': '',
9951
9952 /**
9953 * Used to import variables into the compiled template.
9954 *
9955 * @memberOf _.templateSettings
9956 * @type {Object}
9957 */
9958 'imports': {
9959
9960 /**
9961 * A reference to the `lodash` function.
9962 *
9963 * @memberOf _.templateSettings.imports
9964 * @type {Function}
9965 */
9966 '_': lodash
9967 }
9968 };
9969
9970 // Ensure wrappers are instances of `baseLodash`.
9971 lodash.prototype = baseLodash.prototype;
9972 lodash.prototype.constructor = lodash;
9973
9974 LodashWrapper.prototype = baseCreate(baseLodash.prototype);
9975 LodashWrapper.prototype.constructor = LodashWrapper;
9976
9977 /*------------------------------------------------------------------------*/
9978
9979 /**
9980 * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
9981 *
9982 * @private
9983 * @constructor
9984 * @param {*} value The value to wrap.
9985 */
9986 function LazyWrapper(value) {
9987 this.__wrapped__ = value;
9988 this.__actions__ = [];
9989 this.__dir__ = 1;
9990 this.__filtered__ = false;
9991 this.__iteratees__ = [];
9992 this.__takeCount__ = MAX_ARRAY_LENGTH;
9993 this.__views__ = [];
9994 }
9995
9996 /**
9997 * Creates a clone of the lazy wrapper object.
9998 *
9999 * @private
10000 * @name clone
10001 * @memberOf LazyWrapper
10002 * @returns {Object} Returns the cloned `LazyWrapper` object.
10003 */
10004 function lazyClone() {
10005 var result = new LazyWrapper(this.__wrapped__);
10006 result.__actions__ = copyArray(this.__actions__);
10007 result.__dir__ = this.__dir__;
10008 result.__filtered__ = this.__filtered__;
10009 result.__iteratees__ = copyArray(this.__iteratees__);
10010 result.__takeCount__ = this.__takeCount__;
10011 result.__views__ = copyArray(this.__views__);
10012 return result;
10013 }
10014
10015 /**
10016 * Reverses the direction of lazy iteration.
10017 *
10018 * @private
10019 * @name reverse
10020 * @memberOf LazyWrapper
10021 * @returns {Object} Returns the new reversed `LazyWrapper` object.
10022 */
10023 function lazyReverse() {
10024 if (this.__filtered__) {
10025 var result = new LazyWrapper(this);
10026 result.__dir__ = -1;
10027 result.__filtered__ = true;
10028 } else {
10029 result = this.clone();
10030 result.__dir__ *= -1;
10031 }
10032 return result;
10033 }
10034
10035 /**
10036 * Extracts the unwrapped value from its lazy wrapper.
10037 *
10038 * @private
10039 * @name value
10040 * @memberOf LazyWrapper
10041 * @returns {*} Returns the unwrapped value.
10042 */
10043 function lazyValue() {
10044 var array = this.__wrapped__.value(),
10045 dir = this.__dir__,
10046 isArr = isArray(array),
10047 isRight = dir < 0,
10048 arrLength = isArr ? array.length : 0,
10049 view = getView(0, arrLength, this.__views__),
10050 start = view.start,
10051 end = view.end,
10052 length = end - start,
10053 index = isRight ? end : (start - 1),
10054 iteratees = this.__iteratees__,
10055 iterLength = iteratees.length,
10056 resIndex = 0,
10057 takeCount = nativeMin(length, this.__takeCount__);
10058
10059 if (!isArr || (!isRight && arrLength == length && takeCount == length)) {
10060 return baseWrapperValue(array, this.__actions__);
10061 }
10062 var result = [];
10063
10064 outer:
10065 while (length-- && resIndex < takeCount) {
10066 index += dir;
10067
10068 var iterIndex = -1,
10069 value = array[index];
10070
10071 while (++iterIndex < iterLength) {
10072 var data = iteratees[iterIndex],
10073 iteratee = data.iteratee,
10074 type = data.type,
10075 computed = iteratee(value);
10076
10077 if (type == LAZY_MAP_FLAG) {
10078 value = computed;
10079 } else if (!computed) {
10080 if (type == LAZY_FILTER_FLAG) {
10081 continue outer;
10082 } else {
10083 break outer;
10084 }
10085 }
10086 }
10087 result[resIndex++] = value;
10088 }
10089 return result;
10090 }
10091
10092 // Ensure `LazyWrapper` is an instance of `baseLodash`.
10093 LazyWrapper.prototype = baseCreate(baseLodash.prototype);
10094 LazyWrapper.prototype.constructor = LazyWrapper;
10095
10096 /*------------------------------------------------------------------------*/
10097
10098 /**
10099 * Creates a hash object.
10100 *
10101 * @private
10102 * @constructor
10103 * @param {Array} [entries] The key-value pairs to cache.
10104 */
10105 function Hash(entries) {
10106 var index = -1,
10107 length = entries == null ? 0 : entries.length;
10108
10109 this.clear();
10110 while (++index < length) {
10111 var entry = entries[index];
10112 this.set(entry[0], entry[1]);
10113 }
10114 }
10115
10116 /**
10117 * Removes all key-value entries from the hash.
10118 *
10119 * @private
10120 * @name clear
10121 * @memberOf Hash
10122 */
10123 function hashClear() {
10124 this.__data__ = nativeCreate ? nativeCreate(null) : {};
10125 this.size = 0;
10126 }
10127
10128 /**
10129 * Removes `key` and its value from the hash.
10130 *
10131 * @private
10132 * @name delete
10133 * @memberOf Hash
10134 * @param {Object} hash The hash to modify.
10135 * @param {string} key The key of the value to remove.
10136 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
10137 */
10138 function hashDelete(key) {
10139 var result = this.has(key) && delete this.__data__[key];
10140 this.size -= result ? 1 : 0;
10141 return result;
10142 }
10143
10144 /**
10145 * Gets the hash value for `key`.
10146 *
10147 * @private
10148 * @name get
10149 * @memberOf Hash
10150 * @param {string} key The key of the value to get.
10151 * @returns {*} Returns the entry value.
10152 */
10153 function hashGet(key) {
10154 var data = this.__data__;
10155 if (nativeCreate) {
10156 var result = data[key];
10157 return result === HASH_UNDEFINED ? undefined : result;
10158 }
10159 return hasOwnProperty.call(data, key) ? data[key] : undefined;
10160 }
10161
10162 /**
10163 * Checks if a hash value for `key` exists.
10164 *
10165 * @private
10166 * @name has
10167 * @memberOf Hash
10168 * @param {string} key The key of the entry to check.
10169 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
10170 */
10171 function hashHas(key) {
10172 var data = this.__data__;
10173 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
10174 }
10175
10176 /**
10177 * Sets the hash `key` to `value`.
10178 *
10179 * @private
10180 * @name set
10181 * @memberOf Hash
10182 * @param {string} key The key of the value to set.
10183 * @param {*} value The value to set.
10184 * @returns {Object} Returns the hash instance.
10185 */
10186 function hashSet(key, value) {
10187 var data = this.__data__;
10188 this.size += this.has(key) ? 0 : 1;
10189 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
10190 return this;
10191 }
10192
10193 // Add methods to `Hash`.
10194 Hash.prototype.clear = hashClear;
10195 Hash.prototype['delete'] = hashDelete;
10196 Hash.prototype.get = hashGet;
10197 Hash.prototype.has = hashHas;
10198 Hash.prototype.set = hashSet;
10199
10200 /*------------------------------------------------------------------------*/
10201
10202 /**
10203 * Creates an list cache object.
10204 *
10205 * @private
10206 * @constructor
10207 * @param {Array} [entries] The key-value pairs to cache.
10208 */
10209 function ListCache(entries) {
10210 var index = -1,
10211 length = entries == null ? 0 : entries.length;
10212
10213 this.clear();
10214 while (++index < length) {
10215 var entry = entries[index];
10216 this.set(entry[0], entry[1]);
10217 }
10218 }
10219
10220 /**
10221 * Removes all key-value entries from the list cache.
10222 *
10223 * @private
10224 * @name clear
10225 * @memberOf ListCache
10226 */
10227 function listCacheClear() {
10228 this.__data__ = [];
10229 this.size = 0;
10230 }
10231
10232 /**
10233 * Removes `key` and its value from the list cache.
10234 *
10235 * @private
10236 * @name delete
10237 * @memberOf ListCache
10238 * @param {string} key The key of the value to remove.
10239 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
10240 */
10241 function listCacheDelete(key) {
10242 var data = this.__data__,
10243 index = assocIndexOf(data, key);
10244
10245 if (index < 0) {
10246 return false;
10247 }
10248 var lastIndex = data.length - 1;
10249 if (index == lastIndex) {
10250 data.pop();
10251 } else {
10252 splice.call(data, index, 1);
10253 }
10254 --this.size;
10255 return true;
10256 }
10257
10258 /**
10259 * Gets the list cache value for `key`.
10260 *
10261 * @private
10262 * @name get
10263 * @memberOf ListCache
10264 * @param {string} key The key of the value to get.
10265 * @returns {*} Returns the entry value.
10266 */
10267 function listCacheGet(key) {
10268 var data = this.__data__,
10269 index = assocIndexOf(data, key);
10270
10271 return index < 0 ? undefined : data[index][1];
10272 }
10273
10274 /**
10275 * Checks if a list cache value for `key` exists.
10276 *
10277 * @private
10278 * @name has
10279 * @memberOf ListCache
10280 * @param {string} key The key of the entry to check.
10281 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
10282 */
10283 function listCacheHas(key) {
10284 return assocIndexOf(this.__data__, key) > -1;
10285 }
10286
10287 /**
10288 * Sets the list cache `key` to `value`.
10289 *
10290 * @private
10291 * @name set
10292 * @memberOf ListCache
10293 * @param {string} key The key of the value to set.
10294 * @param {*} value The value to set.
10295 * @returns {Object} Returns the list cache instance.
10296 */
10297 function listCacheSet(key, value) {
10298 var data = this.__data__,
10299 index = assocIndexOf(data, key);
10300
10301 if (index < 0) {
10302 ++this.size;
10303 data.push([key, value]);
10304 } else {
10305 data[index][1] = value;
10306 }
10307 return this;
10308 }
10309
10310 // Add methods to `ListCache`.
10311 ListCache.prototype.clear = listCacheClear;
10312 ListCache.prototype['delete'] = listCacheDelete;
10313 ListCache.prototype.get = listCacheGet;
10314 ListCache.prototype.has = listCacheHas;
10315 ListCache.prototype.set = listCacheSet;
10316
10317 /*------------------------------------------------------------------------*/
10318
10319 /**
10320 * Creates a map cache object to store key-value pairs.
10321 *
10322 * @private
10323 * @constructor
10324 * @param {Array} [entries] The key-value pairs to cache.
10325 */
10326 function MapCache(entries) {
10327 var index = -1,
10328 length = entries == null ? 0 : entries.length;
10329
10330 this.clear();
10331 while (++index < length) {
10332 var entry = entries[index];
10333 this.set(entry[0], entry[1]);
10334 }
10335 }
10336
10337 /**
10338 * Removes all key-value entries from the map.
10339 *
10340 * @private
10341 * @name clear
10342 * @memberOf MapCache
10343 */
10344 function mapCacheClear() {
10345 this.size = 0;
10346 this.__data__ = {
10347 'hash': new Hash,
10348 'map': new (Map || ListCache),
10349 'string': new Hash
10350 };
10351 }
10352
10353 /**
10354 * Removes `key` and its value from the map.
10355 *
10356 * @private
10357 * @name delete
10358 * @memberOf MapCache
10359 * @param {string} key The key of the value to remove.
10360 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
10361 */
10362 function mapCacheDelete(key) {
10363 var result = getMapData(this, key)['delete'](key);
10364 this.size -= result ? 1 : 0;
10365 return result;
10366 }
10367
10368 /**
10369 * Gets the map value for `key`.
10370 *
10371 * @private
10372 * @name get
10373 * @memberOf MapCache
10374 * @param {string} key The key of the value to get.
10375 * @returns {*} Returns the entry value.
10376 */
10377 function mapCacheGet(key) {
10378 return getMapData(this, key).get(key);
10379 }
10380
10381 /**
10382 * Checks if a map value for `key` exists.
10383 *
10384 * @private
10385 * @name has
10386 * @memberOf MapCache
10387 * @param {string} key The key of the entry to check.
10388 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
10389 */
10390 function mapCacheHas(key) {
10391 return getMapData(this, key).has(key);
10392 }
10393
10394 /**
10395 * Sets the map `key` to `value`.
10396 *
10397 * @private
10398 * @name set
10399 * @memberOf MapCache
10400 * @param {string} key The key of the value to set.
10401 * @param {*} value The value to set.
10402 * @returns {Object} Returns the map cache instance.
10403 */
10404 function mapCacheSet(key, value) {
10405 var data = getMapData(this, key),
10406 size = data.size;
10407
10408 data.set(key, value);
10409 this.size += data.size == size ? 0 : 1;
10410 return this;
10411 }
10412
10413 // Add methods to `MapCache`.
10414 MapCache.prototype.clear = mapCacheClear;
10415 MapCache.prototype['delete'] = mapCacheDelete;
10416 MapCache.prototype.get = mapCacheGet;
10417 MapCache.prototype.has = mapCacheHas;
10418 MapCache.prototype.set = mapCacheSet;
10419
10420 /*------------------------------------------------------------------------*/
10421
10422 /**
10423 *
10424 * Creates an array cache object to store unique values.
10425 *
10426 * @private
10427 * @constructor
10428 * @param {Array} [values] The values to cache.
10429 */
10430 function SetCache(values) {
10431 var index = -1,
10432 length = values == null ? 0 : values.length;
10433
10434 this.__data__ = new MapCache;
10435 while (++index < length) {
10436 this.add(values[index]);
10437 }
10438 }
10439
10440 /**
10441 * Adds `value` to the array cache.
10442 *
10443 * @private
10444 * @name add
10445 * @memberOf SetCache
10446 * @alias push
10447 * @param {*} value The value to cache.
10448 * @returns {Object} Returns the cache instance.
10449 */
10450 function setCacheAdd(value) {
10451 this.__data__.set(value, HASH_UNDEFINED);
10452 return this;
10453 }
10454
10455 /**
10456 * Checks if `value` is in the array cache.
10457 *
10458 * @private
10459 * @name has
10460 * @memberOf SetCache
10461 * @param {*} value The value to search for.
10462 * @returns {number} Returns `true` if `value` is found, else `false`.
10463 */
10464 function setCacheHas(value) {
10465 return this.__data__.has(value);
10466 }
10467
10468 // Add methods to `SetCache`.
10469 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
10470 SetCache.prototype.has = setCacheHas;
10471
10472 /*------------------------------------------------------------------------*/
10473
10474 /**
10475 * Creates a stack cache object to store key-value pairs.
10476 *
10477 * @private
10478 * @constructor
10479 * @param {Array} [entries] The key-value pairs to cache.
10480 */
10481 function Stack(entries) {
10482 var data = this.__data__ = new ListCache(entries);
10483 this.size = data.size;
10484 }
10485
10486 /**
10487 * Removes all key-value entries from the stack.
10488 *
10489 * @private
10490 * @name clear
10491 * @memberOf Stack
10492 */
10493 function stackClear() {
10494 this.__data__ = new ListCache;
10495 this.size = 0;
10496 }
10497
10498 /**
10499 * Removes `key` and its value from the stack.
10500 *
10501 * @private
10502 * @name delete
10503 * @memberOf Stack
10504 * @param {string} key The key of the value to remove.
10505 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
10506 */
10507 function stackDelete(key) {
10508 var data = this.__data__,
10509 result = data['delete'](key);
10510
10511 this.size = data.size;
10512 return result;
10513 }
10514
10515 /**
10516 * Gets the stack value for `key`.
10517 *
10518 * @private
10519 * @name get
10520 * @memberOf Stack
10521 * @param {string} key The key of the value to get.
10522 * @returns {*} Returns the entry value.
10523 */
10524 function stackGet(key) {
10525 return this.__data__.get(key);
10526 }
10527
10528 /**
10529 * Checks if a stack value for `key` exists.
10530 *
10531 * @private
10532 * @name has
10533 * @memberOf Stack
10534 * @param {string} key The key of the entry to check.
10535 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
10536 */
10537 function stackHas(key) {
10538 return this.__data__.has(key);
10539 }
10540
10541 /**
10542 * Sets the stack `key` to `value`.
10543 *
10544 * @private
10545 * @name set
10546 * @memberOf Stack
10547 * @param {string} key The key of the value to set.
10548 * @param {*} value The value to set.
10549 * @returns {Object} Returns the stack cache instance.
10550 */
10551 function stackSet(key, value) {
10552 var data = this.__data__;
10553 if (data instanceof ListCache) {
10554 var pairs = data.__data__;
10555 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
10556 pairs.push([key, value]);
10557 this.size = ++data.size;
10558 return this;
10559 }
10560 data = this.__data__ = new MapCache(pairs);
10561 }
10562 data.set(key, value);
10563 this.size = data.size;
10564 return this;
10565 }
10566
10567 // Add methods to `Stack`.
10568 Stack.prototype.clear = stackClear;
10569 Stack.prototype['delete'] = stackDelete;
10570 Stack.prototype.get = stackGet;
10571 Stack.prototype.has = stackHas;
10572 Stack.prototype.set = stackSet;
10573
10574 /*------------------------------------------------------------------------*/
10575
10576 /**
10577 * Creates an array of the enumerable property names of the array-like `value`.
10578 *
10579 * @private
10580 * @param {*} value The value to query.
10581 * @param {boolean} inherited Specify returning inherited property names.
10582 * @returns {Array} Returns the array of property names.
10583 */
10584 function arrayLikeKeys(value, inherited) {
10585 var isArr = isArray(value),
10586 isArg = !isArr && isArguments(value),
10587 isBuff = !isArr && !isArg && isBuffer(value),
10588 isType = !isArr && !isArg && !isBuff && isTypedArray(value),
10589 skipIndexes = isArr || isArg || isBuff || isType,
10590 result = skipIndexes ? baseTimes(value.length, String) : [],
10591 length = result.length;
10592
10593 for (var key in value) {
10594 if ((inherited || hasOwnProperty.call(value, key)) &&
10595 !(skipIndexes && (
10596 // Safari 9 has enumerable `arguments.length` in strict mode.
10597 key == 'length' ||
10598 // Node.js 0.10 has enumerable non-index properties on buffers.
10599 (isBuff && (key == 'offset' || key == 'parent')) ||
10600 // PhantomJS 2 has enumerable non-index properties on typed arrays.
10601 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
10602 // Skip index properties.
10603 isIndex(key, length)
10604 ))) {
10605 result.push(key);
10606 }
10607 }
10608 return result;
10609 }
10610
10611 /**
10612 * A specialized version of `_.sample` for arrays.
10613 *
10614 * @private
10615 * @param {Array} array The array to sample.
10616 * @returns {*} Returns the random element.
10617 */
10618 function arraySample(array) {
10619 var length = array.length;
10620 return length ? array[baseRandom(0, length - 1)] : undefined;
10621 }
10622
10623 /**
10624 * A specialized version of `_.sampleSize` for arrays.
10625 *
10626 * @private
10627 * @param {Array} array The array to sample.
10628 * @param {number} n The number of elements to sample.
10629 * @returns {Array} Returns the random elements.
10630 */
10631 function arraySampleSize(array, n) {
10632 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
10633 }
10634
10635 /**
10636 * A specialized version of `_.shuffle` for arrays.
10637 *
10638 * @private
10639 * @param {Array} array The array to shuffle.
10640 * @returns {Array} Returns the new shuffled array.
10641 */
10642 function arrayShuffle(array) {
10643 return shuffleSelf(copyArray(array));
10644 }
10645
10646 /**
10647 * This function is like `assignValue` except that it doesn't assign
10648 * `undefined` values.
10649 *
10650 * @private
10651 * @param {Object} object The object to modify.
10652 * @param {string} key The key of the property to assign.
10653 * @param {*} value The value to assign.
10654 */
10655 function assignMergeValue(object, key, value) {
10656 if ((value !== undefined && !eq(object[key], value)) ||
10657 (value === undefined && !(key in object))) {
10658 baseAssignValue(object, key, value);
10659 }
10660 }
10661
10662 /**
10663 * Assigns `value` to `key` of `object` if the existing value is not equivalent
10664 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
10665 * for equality comparisons.
10666 *
10667 * @private
10668 * @param {Object} object The object to modify.
10669 * @param {string} key The key of the property to assign.
10670 * @param {*} value The value to assign.
10671 */
10672 function assignValue(object, key, value) {
10673 var objValue = object[key];
10674 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
10675 (value === undefined && !(key in object))) {
10676 baseAssignValue(object, key, value);
10677 }
10678 }
10679
10680 /**
10681 * Gets the index at which the `key` is found in `array` of key-value pairs.
10682 *
10683 * @private
10684 * @param {Array} array The array to inspect.
10685 * @param {*} key The key to search for.
10686 * @returns {number} Returns the index of the matched value, else `-1`.
10687 */
10688 function assocIndexOf(array, key) {
10689 var length = array.length;
10690 while (length--) {
10691 if (eq(array[length][0], key)) {
10692 return length;
10693 }
10694 }
10695 return -1;
10696 }
10697
10698 /**
10699 * Aggregates elements of `collection` on `accumulator` with keys transformed
10700 * by `iteratee` and values set by `setter`.
10701 *
10702 * @private
10703 * @param {Array|Object} collection The collection to iterate over.
10704 * @param {Function} setter The function to set `accumulator` values.
10705 * @param {Function} iteratee The iteratee to transform keys.
10706 * @param {Object} accumulator The initial aggregated object.
10707 * @returns {Function} Returns `accumulator`.
10708 */
10709 function baseAggregator(collection, setter, iteratee, accumulator) {
10710 baseEach(collection, function(value, key, collection) {
10711 setter(accumulator, value, iteratee(value), collection);
10712 });
10713 return accumulator;
10714 }
10715
10716 /**
10717 * The base implementation of `_.assign` without support for multiple sources
10718 * or `customizer` functions.
10719 *
10720 * @private
10721 * @param {Object} object The destination object.
10722 * @param {Object} source The source object.
10723 * @returns {Object} Returns `object`.
10724 */
10725 function baseAssign(object, source) {
10726 return object && copyObject(source, keys(source), object);
10727 }
10728
10729 /**
10730 * The base implementation of `_.assignIn` without support for multiple sources
10731 * or `customizer` functions.
10732 *
10733 * @private
10734 * @param {Object} object The destination object.
10735 * @param {Object} source The source object.
10736 * @returns {Object} Returns `object`.
10737 */
10738 function baseAssignIn(object, source) {
10739 return object && copyObject(source, keysIn(source), object);
10740 }
10741
10742 /**
10743 * The base implementation of `assignValue` and `assignMergeValue` without
10744 * value checks.
10745 *
10746 * @private
10747 * @param {Object} object The object to modify.
10748 * @param {string} key The key of the property to assign.
10749 * @param {*} value The value to assign.
10750 */
10751 function baseAssignValue(object, key, value) {
10752 if (key == '__proto__' && defineProperty) {
10753 defineProperty(object, key, {
10754 'configurable': true,
10755 'enumerable': true,
10756 'value': value,
10757 'writable': true
10758 });
10759 } else {
10760 object[key] = value;
10761 }
10762 }
10763
10764 /**
10765 * The base implementation of `_.at` without support for individual paths.
10766 *
10767 * @private
10768 * @param {Object} object The object to iterate over.
10769 * @param {string[]} paths The property paths to pick.
10770 * @returns {Array} Returns the picked elements.
10771 */
10772 function baseAt(object, paths) {
10773 var index = -1,
10774 length = paths.length,
10775 result = Array(length),
10776 skip = object == null;
10777
10778 while (++index < length) {
10779 result[index] = skip ? undefined : get(object, paths[index]);
10780 }
10781 return result;
10782 }
10783
10784 /**
10785 * The base implementation of `_.clamp` which doesn't coerce arguments.
10786 *
10787 * @private
10788 * @param {number} number The number to clamp.
10789 * @param {number} [lower] The lower bound.
10790 * @param {number} upper The upper bound.
10791 * @returns {number} Returns the clamped number.
10792 */
10793 function baseClamp(number, lower, upper) {
10794 if (number === number) {
10795 if (upper !== undefined) {
10796 number = number <= upper ? number : upper;
10797 }
10798 if (lower !== undefined) {
10799 number = number >= lower ? number : lower;
10800 }
10801 }
10802 return number;
10803 }
10804
10805 /**
10806 * The base implementation of `_.clone` and `_.cloneDeep` which tracks
10807 * traversed objects.
10808 *
10809 * @private
10810 * @param {*} value The value to clone.
10811 * @param {boolean} bitmask The bitmask flags.
10812 * 1 - Deep clone
10813 * 2 - Flatten inherited properties
10814 * 4 - Clone symbols
10815 * @param {Function} [customizer] The function to customize cloning.
10816 * @param {string} [key] The key of `value`.
10817 * @param {Object} [object] The parent object of `value`.
10818 * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
10819 * @returns {*} Returns the cloned value.
10820 */
10821 function baseClone(value, bitmask, customizer, key, object, stack) {
10822 var result,
10823 isDeep = bitmask & CLONE_DEEP_FLAG,
10824 isFlat = bitmask & CLONE_FLAT_FLAG,
10825 isFull = bitmask & CLONE_SYMBOLS_FLAG;
10826
10827 if (customizer) {
10828 result = object ? customizer(value, key, object, stack) : customizer(value);
10829 }
10830 if (result !== undefined) {
10831 return result;
10832 }
10833 if (!isObject(value)) {
10834 return value;
10835 }
10836 var isArr = isArray(value);
10837 if (isArr) {
10838 result = initCloneArray(value);
10839 if (!isDeep) {
10840 return copyArray(value, result);
10841 }
10842 } else {
10843 var tag = getTag(value),
10844 isFunc = tag == funcTag || tag == genTag;
10845
10846 if (isBuffer(value)) {
10847 return cloneBuffer(value, isDeep);
10848 }
10849 if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
10850 result = (isFlat || isFunc) ? {} : initCloneObject(value);
10851 if (!isDeep) {
10852 return isFlat
10853 ? copySymbolsIn(value, baseAssignIn(result, value))
10854 : copySymbols(value, baseAssign(result, value));
10855 }
10856 } else {
10857 if (!cloneableTags[tag]) {
10858 return object ? value : {};
10859 }
10860 result = initCloneByTag(value, tag, isDeep);
10861 }
10862 }
10863 // Check for circular references and return its corresponding clone.
10864 stack || (stack = new Stack);
10865 var stacked = stack.get(value);
10866 if (stacked) {
10867 return stacked;
10868 }
10869 stack.set(value, result);
10870
10871 if (isSet(value)) {
10872 value.forEach(function(subValue) {
10873 result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
10874 });
10875
10876 return result;
10877 }
10878
10879 if (isMap(value)) {
10880 value.forEach(function(subValue, key) {
10881 result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
10882 });
10883
10884 return result;
10885 }
10886
10887 var keysFunc = isFull
10888 ? (isFlat ? getAllKeysIn : getAllKeys)
10889 : (isFlat ? keysIn : keys);
10890
10891 var props = isArr ? undefined : keysFunc(value);
10892 arrayEach(props || value, function(subValue, key) {
10893 if (props) {
10894 key = subValue;
10895 subValue = value[key];
10896 }
10897 // Recursively populate clone (susceptible to call stack limits).
10898 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
10899 });
10900 return result;
10901 }
10902
10903 /**
10904 * The base implementation of `_.conforms` which doesn't clone `source`.
10905 *
10906 * @private
10907 * @param {Object} source The object of property predicates to conform to.
10908 * @returns {Function} Returns the new spec function.
10909 */
10910 function baseConforms(source) {
10911 var props = keys(source);
10912 return function(object) {
10913 return baseConformsTo(object, source, props);
10914 };
10915 }
10916
10917 /**
10918 * The base implementation of `_.conformsTo` which accepts `props` to check.
10919 *
10920 * @private
10921 * @param {Object} object The object to inspect.
10922 * @param {Object} source The object of property predicates to conform to.
10923 * @returns {boolean} Returns `true` if `object` conforms, else `false`.
10924 */
10925 function baseConformsTo(object, source, props) {
10926 var length = props.length;
10927 if (object == null) {
10928 return !length;
10929 }
10930 object = Object(object);
10931 while (length--) {
10932 var key = props[length],
10933 predicate = source[key],
10934 value = object[key];
10935
10936 if ((value === undefined && !(key in object)) || !predicate(value)) {
10937 return false;
10938 }
10939 }
10940 return true;
10941 }
10942
10943 /**
10944 * The base implementation of `_.delay` and `_.defer` which accepts `args`
10945 * to provide to `func`.
10946 *
10947 * @private
10948 * @param {Function} func The function to delay.
10949 * @param {number} wait The number of milliseconds to delay invocation.
10950 * @param {Array} args The arguments to provide to `func`.
10951 * @returns {number|Object} Returns the timer id or timeout object.
10952 */
10953 function baseDelay(func, wait, args) {
10954 if (typeof func != 'function') {
10955 throw new TypeError(FUNC_ERROR_TEXT);
10956 }
10957 return setTimeout(function() { func.apply(undefined, args); }, wait);
10958 }
10959
10960 /**
10961 * The base implementation of methods like `_.difference` without support
10962 * for excluding multiple arrays or iteratee shorthands.
10963 *
10964 * @private
10965 * @param {Array} array The array to inspect.
10966 * @param {Array} values The values to exclude.
10967 * @param {Function} [iteratee] The iteratee invoked per element.
10968 * @param {Function} [comparator] The comparator invoked per element.
10969 * @returns {Array} Returns the new array of filtered values.
10970 */
10971 function baseDifference(array, values, iteratee, comparator) {
10972 var index = -1,
10973 includes = arrayIncludes,
10974 isCommon = true,
10975 length = array.length,
10976 result = [],
10977 valuesLength = values.length;
10978
10979 if (!length) {
10980 return result;
10981 }
10982 if (iteratee) {
10983 values = arrayMap(values, baseUnary(iteratee));
10984 }
10985 if (comparator) {
10986 includes = arrayIncludesWith;
10987 isCommon = false;
10988 }
10989 else if (values.length >= LARGE_ARRAY_SIZE) {
10990 includes = cacheHas;
10991 isCommon = false;
10992 values = new SetCache(values);
10993 }
10994 outer:
10995 while (++index < length) {
10996 var value = array[index],
10997 computed = iteratee == null ? value : iteratee(value);
10998
10999 value = (comparator || value !== 0) ? value : 0;
11000 if (isCommon && computed === computed) {
11001 var valuesIndex = valuesLength;
11002 while (valuesIndex--) {
11003 if (values[valuesIndex] === computed) {
11004 continue outer;
11005 }
11006 }
11007 result.push(value);
11008 }
11009 else if (!includes(values, computed, comparator)) {
11010 result.push(value);
11011 }
11012 }
11013 return result;
11014 }
11015
11016 /**
11017 * The base implementation of `_.forEach` without support for iteratee shorthands.
11018 *
11019 * @private
11020 * @param {Array|Object} collection The collection to iterate over.
11021 * @param {Function} iteratee The function invoked per iteration.
11022 * @returns {Array|Object} Returns `collection`.
11023 */
11024 var baseEach = createBaseEach(baseForOwn);
11025
11026 /**
11027 * The base implementation of `_.forEachRight` without support for iteratee shorthands.
11028 *
11029 * @private
11030 * @param {Array|Object} collection The collection to iterate over.
11031 * @param {Function} iteratee The function invoked per iteration.
11032 * @returns {Array|Object} Returns `collection`.
11033 */
11034 var baseEachRight = createBaseEach(baseForOwnRight, true);
11035
11036 /**
11037 * The base implementation of `_.every` without support for iteratee shorthands.
11038 *
11039 * @private
11040 * @param {Array|Object} collection The collection to iterate over.
11041 * @param {Function} predicate The function invoked per iteration.
11042 * @returns {boolean} Returns `true` if all elements pass the predicate check,
11043 * else `false`
11044 */
11045 function baseEvery(collection, predicate) {
11046 var result = true;
11047 baseEach(collection, function(value, index, collection) {
11048 result = !!predicate(value, index, collection);
11049 return result;
11050 });
11051 return result;
11052 }
11053
11054 /**
11055 * The base implementation of methods like `_.max` and `_.min` which accepts a
11056 * `comparator` to determine the extremum value.
11057 *
11058 * @private
11059 * @param {Array} array The array to iterate over.
11060 * @param {Function} iteratee The iteratee invoked per iteration.
11061 * @param {Function} comparator The comparator used to compare values.
11062 * @returns {*} Returns the extremum value.
11063 */
11064 function baseExtremum(array, iteratee, comparator) {
11065 var index = -1,
11066 length = array.length;
11067
11068 while (++index < length) {
11069 var value = array[index],
11070 current = iteratee(value);
11071
11072 if (current != null && (computed === undefined
11073 ? (current === current && !isSymbol(current))
11074 : comparator(current, computed)
11075 )) {
11076 var computed = current,
11077 result = value;
11078 }
11079 }
11080 return result;
11081 }
11082
11083 /**
11084 * The base implementation of `_.fill` without an iteratee call guard.
11085 *
11086 * @private
11087 * @param {Array} array The array to fill.
11088 * @param {*} value The value to fill `array` with.
11089 * @param {number} [start=0] The start position.
11090 * @param {number} [end=array.length] The end position.
11091 * @returns {Array} Returns `array`.
11092 */
11093 function baseFill(array, value, start, end) {
11094 var length = array.length;
11095
11096 start = toInteger(start);
11097 if (start < 0) {
11098 start = -start > length ? 0 : (length + start);
11099 }
11100 end = (end === undefined || end > length) ? length : toInteger(end);
11101 if (end < 0) {
11102 end += length;
11103 }
11104 end = start > end ? 0 : toLength(end);
11105 while (start < end) {
11106 array[start++] = value;
11107 }
11108 return array;
11109 }
11110
11111 /**
11112 * The base implementation of `_.filter` without support for iteratee shorthands.
11113 *
11114 * @private
11115 * @param {Array|Object} collection The collection to iterate over.
11116 * @param {Function} predicate The function invoked per iteration.
11117 * @returns {Array} Returns the new filtered array.
11118 */
11119 function baseFilter(collection, predicate) {
11120 var result = [];
11121 baseEach(collection, function(value, index, collection) {
11122 if (predicate(value, index, collection)) {
11123 result.push(value);
11124 }
11125 });
11126 return result;
11127 }
11128
11129 /**
11130 * The base implementation of `_.flatten` with support for restricting flattening.
11131 *
11132 * @private
11133 * @param {Array} array The array to flatten.
11134 * @param {number} depth The maximum recursion depth.
11135 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.
11136 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.
11137 * @param {Array} [result=[]] The initial result value.
11138 * @returns {Array} Returns the new flattened array.
11139 */
11140 function baseFlatten(array, depth, predicate, isStrict, result) {
11141 var index = -1,
11142 length = array.length;
11143
11144 predicate || (predicate = isFlattenable);
11145 result || (result = []);
11146
11147 while (++index < length) {
11148 var value = array[index];
11149 if (depth > 0 && predicate(value)) {
11150 if (depth > 1) {
11151 // Recursively flatten arrays (susceptible to call stack limits).
11152 baseFlatten(value, depth - 1, predicate, isStrict, result);
11153 } else {
11154 arrayPush(result, value);
11155 }
11156 } else if (!isStrict) {
11157 result[result.length] = value;
11158 }
11159 }
11160 return result;
11161 }
11162
11163 /**
11164 * The base implementation of `baseForOwn` which iterates over `object`
11165 * properties returned by `keysFunc` and invokes `iteratee` for each property.
11166 * Iteratee functions may exit iteration early by explicitly returning `false`.
11167 *
11168 * @private
11169 * @param {Object} object The object to iterate over.
11170 * @param {Function} iteratee The function invoked per iteration.
11171 * @param {Function} keysFunc The function to get the keys of `object`.
11172 * @returns {Object} Returns `object`.
11173 */
11174 var baseFor = createBaseFor();
11175
11176 /**
11177 * This function is like `baseFor` except that it iterates over properties
11178 * in the opposite order.
11179 *
11180 * @private
11181 * @param {Object} object The object to iterate over.
11182 * @param {Function} iteratee The function invoked per iteration.
11183 * @param {Function} keysFunc The function to get the keys of `object`.
11184 * @returns {Object} Returns `object`.
11185 */
11186 var baseForRight = createBaseFor(true);
11187
11188 /**
11189 * The base implementation of `_.forOwn` without support for iteratee shorthands.
11190 *
11191 * @private
11192 * @param {Object} object The object to iterate over.
11193 * @param {Function} iteratee The function invoked per iteration.
11194 * @returns {Object} Returns `object`.
11195 */
11196 function baseForOwn(object, iteratee) {
11197 return object && baseFor(object, iteratee, keys);
11198 }
11199
11200 /**
11201 * The base implementation of `_.forOwnRight` without support for iteratee shorthands.
11202 *
11203 * @private
11204 * @param {Object} object The object to iterate over.
11205 * @param {Function} iteratee The function invoked per iteration.
11206 * @returns {Object} Returns `object`.
11207 */
11208 function baseForOwnRight(object, iteratee) {
11209 return object && baseForRight(object, iteratee, keys);
11210 }
11211
11212 /**
11213 * The base implementation of `_.functions` which creates an array of
11214 * `object` function property names filtered from `props`.
11215 *
11216 * @private
11217 * @param {Object} object The object to inspect.
11218 * @param {Array} props The property names to filter.
11219 * @returns {Array} Returns the function names.
11220 */
11221 function baseFunctions(object, props) {
11222 return arrayFilter(props, function(key) {
11223 return isFunction(object[key]);
11224 });
11225 }
11226
11227 /**
11228 * The base implementation of `_.get` without support for default values.
11229 *
11230 * @private
11231 * @param {Object} object The object to query.
11232 * @param {Array|string} path The path of the property to get.
11233 * @returns {*} Returns the resolved value.
11234 */
11235 function baseGet(object, path) {
11236 path = castPath(path, object);
11237
11238 var index = 0,
11239 length = path.length;
11240
11241 while (object != null && index < length) {
11242 object = object[toKey(path[index++])];
11243 }
11244 return (index && index == length) ? object : undefined;
11245 }
11246
11247 /**
11248 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
11249 * `keysFunc` and `symbolsFunc` to get the enumerable property names and
11250 * symbols of `object`.
11251 *
11252 * @private
11253 * @param {Object} object The object to query.
11254 * @param {Function} keysFunc The function to get the keys of `object`.
11255 * @param {Function} symbolsFunc The function to get the symbols of `object`.
11256 * @returns {Array} Returns the array of property names and symbols.
11257 */
11258 function baseGetAllKeys(object, keysFunc, symbolsFunc) {
11259 var result = keysFunc(object);
11260 return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
11261 }
11262
11263 /**
11264 * The base implementation of `getTag` without fallbacks for buggy environments.
11265 *
11266 * @private
11267 * @param {*} value The value to query.
11268 * @returns {string} Returns the `toStringTag`.
11269 */
11270 function baseGetTag(value) {
11271 if (value == null) {
11272 return value === undefined ? undefinedTag : nullTag;
11273 }
11274 return (symToStringTag && symToStringTag in Object(value))
11275 ? getRawTag(value)
11276 : objectToString(value);
11277 }
11278
11279 /**
11280 * The base implementation of `_.gt` which doesn't coerce arguments.
11281 *
11282 * @private
11283 * @param {*} value The value to compare.
11284 * @param {*} other The other value to compare.
11285 * @returns {boolean} Returns `true` if `value` is greater than `other`,
11286 * else `false`.
11287 */
11288 function baseGt(value, other) {
11289 return value > other;
11290 }
11291
11292 /**
11293 * The base implementation of `_.has` without support for deep paths.
11294 *
11295 * @private
11296 * @param {Object} [object] The object to query.
11297 * @param {Array|string} key The key to check.
11298 * @returns {boolean} Returns `true` if `key` exists, else `false`.
11299 */
11300 function baseHas(object, key) {
11301 return object != null && hasOwnProperty.call(object, key);
11302 }
11303
11304 /**
11305 * The base implementation of `_.hasIn` without support for deep paths.
11306 *
11307 * @private
11308 * @param {Object} [object] The object to query.
11309 * @param {Array|string} key The key to check.
11310 * @returns {boolean} Returns `true` if `key` exists, else `false`.
11311 */
11312 function baseHasIn(object, key) {
11313 return object != null && key in Object(object);
11314 }
11315
11316 /**
11317 * The base implementation of `_.inRange` which doesn't coerce arguments.
11318 *
11319 * @private
11320 * @param {number} number The number to check.
11321 * @param {number} start The start of the range.
11322 * @param {number} end The end of the range.
11323 * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
11324 */
11325 function baseInRange(number, start, end) {
11326 return number >= nativeMin(start, end) && number < nativeMax(start, end);
11327 }
11328
11329 /**
11330 * The base implementation of methods like `_.intersection`, without support
11331 * for iteratee shorthands, that accepts an array of arrays to inspect.
11332 *
11333 * @private
11334 * @param {Array} arrays The arrays to inspect.
11335 * @param {Function} [iteratee] The iteratee invoked per element.
11336 * @param {Function} [comparator] The comparator invoked per element.
11337 * @returns {Array} Returns the new array of shared values.
11338 */
11339 function baseIntersection(arrays, iteratee, comparator) {
11340 var includes = comparator ? arrayIncludesWith : arrayIncludes,
11341 length = arrays[0].length,
11342 othLength = arrays.length,
11343 othIndex = othLength,
11344 caches = Array(othLength),
11345 maxLength = Infinity,
11346 result = [];
11347
11348 while (othIndex--) {
11349 var array = arrays[othIndex];
11350 if (othIndex && iteratee) {
11351 array = arrayMap(array, baseUnary(iteratee));
11352 }
11353 maxLength = nativeMin(array.length, maxLength);
11354 caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))
11355 ? new SetCache(othIndex && array)
11356 : undefined;
11357 }
11358 array = arrays[0];
11359
11360 var index = -1,
11361 seen = caches[0];
11362
11363 outer:
11364 while (++index < length && result.length < maxLength) {
11365 var value = array[index],
11366 computed = iteratee ? iteratee(value) : value;
11367
11368 value = (comparator || value !== 0) ? value : 0;
11369 if (!(seen
11370 ? cacheHas(seen, computed)
11371 : includes(result, computed, comparator)
11372 )) {
11373 othIndex = othLength;
11374 while (--othIndex) {
11375 var cache = caches[othIndex];
11376 if (!(cache
11377 ? cacheHas(cache, computed)
11378 : includes(arrays[othIndex], computed, comparator))
11379 ) {
11380 continue outer;
11381 }
11382 }
11383 if (seen) {
11384 seen.push(computed);
11385 }
11386 result.push(value);
11387 }
11388 }
11389 return result;
11390 }
11391
11392 /**
11393 * The base implementation of `_.invert` and `_.invertBy` which inverts
11394 * `object` with values transformed by `iteratee` and set by `setter`.
11395 *
11396 * @private
11397 * @param {Object} object The object to iterate over.
11398 * @param {Function} setter The function to set `accumulator` values.
11399 * @param {Function} iteratee The iteratee to transform values.
11400 * @param {Object} accumulator The initial inverted object.
11401 * @returns {Function} Returns `accumulator`.
11402 */
11403 function baseInverter(object, setter, iteratee, accumulator) {
11404 baseForOwn(object, function(value, key, object) {
11405 setter(accumulator, iteratee(value), key, object);
11406 });
11407 return accumulator;
11408 }
11409
11410 /**
11411 * The base implementation of `_.invoke` without support for individual
11412 * method arguments.
11413 *
11414 * @private
11415 * @param {Object} object The object to query.
11416 * @param {Array|string} path The path of the method to invoke.
11417 * @param {Array} args The arguments to invoke the method with.
11418 * @returns {*} Returns the result of the invoked method.
11419 */
11420 function baseInvoke(object, path, args) {
11421 path = castPath(path, object);
11422 object = parent(object, path);
11423 var func = object == null ? object : object[toKey(last(path))];
11424 return func == null ? undefined : apply(func, object, args);
11425 }
11426
11427 /**
11428 * The base implementation of `_.isArguments`.
11429 *
11430 * @private
11431 * @param {*} value The value to check.
11432 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
11433 */
11434 function baseIsArguments(value) {
11435 return isObjectLike(value) && baseGetTag(value) == argsTag;
11436 }
11437
11438 /**
11439 * The base implementation of `_.isArrayBuffer` without Node.js optimizations.
11440 *
11441 * @private
11442 * @param {*} value The value to check.
11443 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
11444 */
11445 function baseIsArrayBuffer(value) {
11446 return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;
11447 }
11448
11449 /**
11450 * The base implementation of `_.isDate` without Node.js optimizations.
11451 *
11452 * @private
11453 * @param {*} value The value to check.
11454 * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
11455 */
11456 function baseIsDate(value) {
11457 return isObjectLike(value) && baseGetTag(value) == dateTag;
11458 }
11459
11460 /**
11461 * The base implementation of `_.isEqual` which supports partial comparisons
11462 * and tracks traversed objects.
11463 *
11464 * @private
11465 * @param {*} value The value to compare.
11466 * @param {*} other The other value to compare.
11467 * @param {boolean} bitmask The bitmask flags.
11468 * 1 - Unordered comparison
11469 * 2 - Partial comparison
11470 * @param {Function} [customizer] The function to customize comparisons.
11471 * @param {Object} [stack] Tracks traversed `value` and `other` objects.
11472 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
11473 */
11474 function baseIsEqual(value, other, bitmask, customizer, stack) {
11475 if (value === other) {
11476 return true;
11477 }
11478 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
11479 return value !== value && other !== other;
11480 }
11481 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
11482 }
11483
11484 /**
11485 * A specialized version of `baseIsEqual` for arrays and objects which performs
11486 * deep comparisons and tracks traversed objects enabling objects with circular
11487 * references to be compared.
11488 *
11489 * @private
11490 * @param {Object} object The object to compare.
11491 * @param {Object} other The other object to compare.
11492 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
11493 * @param {Function} customizer The function to customize comparisons.
11494 * @param {Function} equalFunc The function to determine equivalents of values.
11495 * @param {Object} [stack] Tracks traversed `object` and `other` objects.
11496 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
11497 */
11498 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
11499 var objIsArr = isArray(object),
11500 othIsArr = isArray(other),
11501 objTag = objIsArr ? arrayTag : getTag(object),
11502 othTag = othIsArr ? arrayTag : getTag(other);
11503
11504 objTag = objTag == argsTag ? objectTag : objTag;
11505 othTag = othTag == argsTag ? objectTag : othTag;
11506
11507 var objIsObj = objTag == objectTag,
11508 othIsObj = othTag == objectTag,
11509 isSameTag = objTag == othTag;
11510
11511 if (isSameTag && isBuffer(object)) {
11512 if (!isBuffer(other)) {
11513 return false;
11514 }
11515 objIsArr = true;
11516 objIsObj = false;
11517 }
11518 if (isSameTag && !objIsObj) {
11519 stack || (stack = new Stack);
11520 return (objIsArr || isTypedArray(object))
11521 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
11522 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
11523 }
11524 if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
11525 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
11526 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
11527
11528 if (objIsWrapped || othIsWrapped) {
11529 var objUnwrapped = objIsWrapped ? object.value() : object,
11530 othUnwrapped = othIsWrapped ? other.value() : other;
11531
11532 stack || (stack = new Stack);
11533 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
11534 }
11535 }
11536 if (!isSameTag) {
11537 return false;
11538 }
11539 stack || (stack = new Stack);
11540 return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
11541 }
11542
11543 /**
11544 * The base implementation of `_.isMap` without Node.js optimizations.
11545 *
11546 * @private
11547 * @param {*} value The value to check.
11548 * @returns {boolean} Returns `true` if `value` is a map, else `false`.
11549 */
11550 function baseIsMap(value) {
11551 return isObjectLike(value) && getTag(value) == mapTag;
11552 }
11553
11554 /**
11555 * The base implementation of `_.isMatch` without support for iteratee shorthands.
11556 *
11557 * @private
11558 * @param {Object} object The object to inspect.
11559 * @param {Object} source The object of property values to match.
11560 * @param {Array} matchData The property names, values, and compare flags to match.
11561 * @param {Function} [customizer] The function to customize comparisons.
11562 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
11563 */
11564 function baseIsMatch(object, source, matchData, customizer) {
11565 var index = matchData.length,
11566 length = index,
11567 noCustomizer = !customizer;
11568
11569 if (object == null) {
11570 return !length;
11571 }
11572 object = Object(object);
11573 while (index--) {
11574 var data = matchData[index];
11575 if ((noCustomizer && data[2])
11576 ? data[1] !== object[data[0]]
11577 : !(data[0] in object)
11578 ) {
11579 return false;
11580 }
11581 }
11582 while (++index < length) {
11583 data = matchData[index];
11584 var key = data[0],
11585 objValue = object[key],
11586 srcValue = data[1];
11587
11588 if (noCustomizer && data[2]) {
11589 if (objValue === undefined && !(key in object)) {
11590 return false;
11591 }
11592 } else {
11593 var stack = new Stack;
11594 if (customizer) {
11595 var result = customizer(objValue, srcValue, key, object, source, stack);
11596 }
11597 if (!(result === undefined
11598 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)
11599 : result
11600 )) {
11601 return false;
11602 }
11603 }
11604 }
11605 return true;
11606 }
11607
11608 /**
11609 * The base implementation of `_.isNative` without bad shim checks.
11610 *
11611 * @private
11612 * @param {*} value The value to check.
11613 * @returns {boolean} Returns `true` if `value` is a native function,
11614 * else `false`.
11615 */
11616 function baseIsNative(value) {
11617 if (!isObject(value) || isMasked(value)) {
11618 return false;
11619 }
11620 var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
11621 return pattern.test(toSource(value));
11622 }
11623
11624 /**
11625 * The base implementation of `_.isRegExp` without Node.js optimizations.
11626 *
11627 * @private
11628 * @param {*} value The value to check.
11629 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
11630 */
11631 function baseIsRegExp(value) {
11632 return isObjectLike(value) && baseGetTag(value) == regexpTag;
11633 }
11634
11635 /**
11636 * The base implementation of `_.isSet` without Node.js optimizations.
11637 *
11638 * @private
11639 * @param {*} value The value to check.
11640 * @returns {boolean} Returns `true` if `value` is a set, else `false`.
11641 */
11642 function baseIsSet(value) {
11643 return isObjectLike(value) && getTag(value) == setTag;
11644 }
11645
11646 /**
11647 * The base implementation of `_.isTypedArray` without Node.js optimizations.
11648 *
11649 * @private
11650 * @param {*} value The value to check.
11651 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
11652 */
11653 function baseIsTypedArray(value) {
11654 return isObjectLike(value) &&
11655 isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
11656 }
11657
11658 /**
11659 * The base implementation of `_.iteratee`.
11660 *
11661 * @private
11662 * @param {*} [value=_.identity] The value to convert to an iteratee.
11663 * @returns {Function} Returns the iteratee.
11664 */
11665 function baseIteratee(value) {
11666 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.
11667 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.
11668 if (typeof value == 'function') {
11669 return value;
11670 }
11671 if (value == null) {
11672 return identity;
11673 }
11674 if (typeof value == 'object') {
11675 return isArray(value)
11676 ? baseMatchesProperty(value[0], value[1])
11677 : baseMatches(value);
11678 }
11679 return property(value);
11680 }
11681
11682 /**
11683 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
11684 *
11685 * @private
11686 * @param {Object} object The object to query.
11687 * @returns {Array} Returns the array of property names.
11688 */
11689 function baseKeys(object) {
11690 if (!isPrototype(object)) {
11691 return nativeKeys(object);
11692 }
11693 var result = [];
11694 for (var key in Object(object)) {
11695 if (hasOwnProperty.call(object, key) && key != 'constructor') {
11696 result.push(key);
11697 }
11698 }
11699 return result;
11700 }
11701
11702 /**
11703 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
11704 *
11705 * @private
11706 * @param {Object} object The object to query.
11707 * @returns {Array} Returns the array of property names.
11708 */
11709 function baseKeysIn(object) {
11710 if (!isObject(object)) {
11711 return nativeKeysIn(object);
11712 }
11713 var isProto = isPrototype(object),
11714 result = [];
11715
11716 for (var key in object) {
11717 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
11718 result.push(key);
11719 }
11720 }
11721 return result;
11722 }
11723
11724 /**
11725 * The base implementation of `_.lt` which doesn't coerce arguments.
11726 *
11727 * @private
11728 * @param {*} value The value to compare.
11729 * @param {*} other The other value to compare.
11730 * @returns {boolean} Returns `true` if `value` is less than `other`,
11731 * else `false`.
11732 */
11733 function baseLt(value, other) {
11734 return value < other;
11735 }
11736
11737 /**
11738 * The base implementation of `_.map` without support for iteratee shorthands.
11739 *
11740 * @private
11741 * @param {Array|Object} collection The collection to iterate over.
11742 * @param {Function} iteratee The function invoked per iteration.
11743 * @returns {Array} Returns the new mapped array.
11744 */
11745 function baseMap(collection, iteratee) {
11746 var index = -1,
11747 result = isArrayLike(collection) ? Array(collection.length) : [];
11748
11749 baseEach(collection, function(value, key, collection) {
11750 result[++index] = iteratee(value, key, collection);
11751 });
11752 return result;
11753 }
11754
11755 /**
11756 * The base implementation of `_.matches` which doesn't clone `source`.
11757 *
11758 * @private
11759 * @param {Object} source The object of property values to match.
11760 * @returns {Function} Returns the new spec function.
11761 */
11762 function baseMatches(source) {
11763 var matchData = getMatchData(source);
11764 if (matchData.length == 1 && matchData[0][2]) {
11765 return matchesStrictComparable(matchData[0][0], matchData[0][1]);
11766 }
11767 return function(object) {
11768 return object === source || baseIsMatch(object, source, matchData);
11769 };
11770 }
11771
11772 /**
11773 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.
11774 *
11775 * @private
11776 * @param {string} path The path of the property to get.
11777 * @param {*} srcValue The value to match.
11778 * @returns {Function} Returns the new spec function.
11779 */
11780 function baseMatchesProperty(path, srcValue) {
11781 if (isKey(path) && isStrictComparable(srcValue)) {
11782 return matchesStrictComparable(toKey(path), srcValue);
11783 }
11784 return function(object) {
11785 var objValue = get(object, path);
11786 return (objValue === undefined && objValue === srcValue)
11787 ? hasIn(object, path)
11788 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
11789 };
11790 }
11791
11792 /**
11793 * The base implementation of `_.merge` without support for multiple sources.
11794 *
11795 * @private
11796 * @param {Object} object The destination object.
11797 * @param {Object} source The source object.
11798 * @param {number} srcIndex The index of `source`.
11799 * @param {Function} [customizer] The function to customize merged values.
11800 * @param {Object} [stack] Tracks traversed source values and their merged
11801 * counterparts.
11802 */
11803 function baseMerge(object, source, srcIndex, customizer, stack) {
11804 if (object === source) {
11805 return;
11806 }
11807 baseFor(source, function(srcValue, key) {
11808 if (isObject(srcValue)) {
11809 stack || (stack = new Stack);
11810 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
11811 }
11812 else {
11813 var newValue = customizer
11814 ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)
11815 : undefined;
11816
11817 if (newValue === undefined) {
11818 newValue = srcValue;
11819 }
11820 assignMergeValue(object, key, newValue);
11821 }
11822 }, keysIn);
11823 }
11824
11825 /**
11826 * A specialized version of `baseMerge` for arrays and objects which performs
11827 * deep merges and tracks traversed objects enabling objects with circular
11828 * references to be merged.
11829 *
11830 * @private
11831 * @param {Object} object The destination object.
11832 * @param {Object} source The source object.
11833 * @param {string} key The key of the value to merge.
11834 * @param {number} srcIndex The index of `source`.
11835 * @param {Function} mergeFunc The function to merge values.
11836 * @param {Function} [customizer] The function to customize assigned values.
11837 * @param {Object} [stack] Tracks traversed source values and their merged
11838 * counterparts.
11839 */
11840 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
11841 var objValue = safeGet(object, key),
11842 srcValue = safeGet(source, key),
11843 stacked = stack.get(srcValue);
11844
11845 if (stacked) {
11846 assignMergeValue(object, key, stacked);
11847 return;
11848 }
11849 var newValue = customizer
11850 ? customizer(objValue, srcValue, (key + ''), object, source, stack)
11851 : undefined;
11852
11853 var isCommon = newValue === undefined;
11854
11855 if (isCommon) {
11856 var isArr = isArray(srcValue),
11857 isBuff = !isArr && isBuffer(srcValue),
11858 isTyped = !isArr && !isBuff && isTypedArray(srcValue);
11859
11860 newValue = srcValue;
11861 if (isArr || isBuff || isTyped) {
11862 if (isArray(objValue)) {
11863 newValue = objValue;
11864 }
11865 else if (isArrayLikeObject(objValue)) {
11866 newValue = copyArray(objValue);
11867 }
11868 else if (isBuff) {
11869 isCommon = false;
11870 newValue = cloneBuffer(srcValue, true);
11871 }
11872 else if (isTyped) {
11873 isCommon = false;
11874 newValue = cloneTypedArray(srcValue, true);
11875 }
11876 else {
11877 newValue = [];
11878 }
11879 }
11880 else if (isPlainObject(srcValue) || isArguments(srcValue)) {
11881 newValue = objValue;
11882 if (isArguments(objValue)) {
11883 newValue = toPlainObject(objValue);
11884 }
11885 else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) {
11886 newValue = initCloneObject(srcValue);
11887 }
11888 }
11889 else {
11890 isCommon = false;
11891 }
11892 }
11893 if (isCommon) {
11894 // Recursively merge objects and arrays (susceptible to call stack limits).
11895 stack.set(srcValue, newValue);
11896 mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
11897 stack['delete'](srcValue);
11898 }
11899 assignMergeValue(object, key, newValue);
11900 }
11901
11902 /**
11903 * The base implementation of `_.nth` which doesn't coerce arguments.
11904 *
11905 * @private
11906 * @param {Array} array The array to query.
11907 * @param {number} n The index of the element to return.
11908 * @returns {*} Returns the nth element of `array`.
11909 */
11910 function baseNth(array, n) {
11911 var length = array.length;
11912 if (!length) {
11913 return;
11914 }
11915 n += n < 0 ? length : 0;
11916 return isIndex(n, length) ? array[n] : undefined;
11917 }
11918
11919 /**
11920 * The base implementation of `_.orderBy` without param guards.
11921 *
11922 * @private
11923 * @param {Array|Object} collection The collection to iterate over.
11924 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
11925 * @param {string[]} orders The sort orders of `iteratees`.
11926 * @returns {Array} Returns the new sorted array.
11927 */
11928 function baseOrderBy(collection, iteratees, orders) {
11929 var index = -1;
11930 iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));
11931
11932 var result = baseMap(collection, function(value, key, collection) {
11933 var criteria = arrayMap(iteratees, function(iteratee) {
11934 return iteratee(value);
11935 });
11936 return { 'criteria': criteria, 'index': ++index, 'value': value };
11937 });
11938
11939 return baseSortBy(result, function(object, other) {
11940 return compareMultiple(object, other, orders);
11941 });
11942 }
11943
11944 /**
11945 * The base implementation of `_.pick` without support for individual
11946 * property identifiers.
11947 *
11948 * @private
11949 * @param {Object} object The source object.
11950 * @param {string[]} paths The property paths to pick.
11951 * @returns {Object} Returns the new object.
11952 */
11953 function basePick(object, paths) {
11954 return basePickBy(object, paths, function(value, path) {
11955 return hasIn(object, path);
11956 });
11957 }
11958
11959 /**
11960 * The base implementation of `_.pickBy` without support for iteratee shorthands.
11961 *
11962 * @private
11963 * @param {Object} object The source object.
11964 * @param {string[]} paths The property paths to pick.
11965 * @param {Function} predicate The function invoked per property.
11966 * @returns {Object} Returns the new object.
11967 */
11968 function basePickBy(object, paths, predicate) {
11969 var index = -1,
11970 length = paths.length,
11971 result = {};
11972
11973 while (++index < length) {
11974 var path = paths[index],
11975 value = baseGet(object, path);
11976
11977 if (predicate(value, path)) {
11978 baseSet(result, castPath(path, object), value);
11979 }
11980 }
11981 return result;
11982 }
11983
11984 /**
11985 * A specialized version of `baseProperty` which supports deep paths.
11986 *
11987 * @private
11988 * @param {Array|string} path The path of the property to get.
11989 * @returns {Function} Returns the new accessor function.
11990 */
11991 function basePropertyDeep(path) {
11992 return function(object) {
11993 return baseGet(object, path);
11994 };
11995 }
11996
11997 /**
11998 * The base implementation of `_.pullAllBy` without support for iteratee
11999 * shorthands.
12000 *
12001 * @private
12002 * @param {Array} array The array to modify.
12003 * @param {Array} values The values to remove.
12004 * @param {Function} [iteratee] The iteratee invoked per element.
12005 * @param {Function} [comparator] The comparator invoked per element.
12006 * @returns {Array} Returns `array`.
12007 */
12008 function basePullAll(array, values, iteratee, comparator) {
12009 var indexOf = comparator ? baseIndexOfWith : baseIndexOf,
12010 index = -1,
12011 length = values.length,
12012 seen = array;
12013
12014 if (array === values) {
12015 values = copyArray(values);
12016 }
12017 if (iteratee) {
12018 seen = arrayMap(array, baseUnary(iteratee));
12019 }
12020 while (++index < length) {
12021 var fromIndex = 0,
12022 value = values[index],
12023 computed = iteratee ? iteratee(value) : value;
12024
12025 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {
12026 if (seen !== array) {
12027 splice.call(seen, fromIndex, 1);
12028 }
12029 splice.call(array, fromIndex, 1);
12030 }
12031 }
12032 return array;
12033 }
12034
12035 /**
12036 * The base implementation of `_.pullAt` without support for individual
12037 * indexes or capturing the removed elements.
12038 *
12039 * @private
12040 * @param {Array} array The array to modify.
12041 * @param {number[]} indexes The indexes of elements to remove.
12042 * @returns {Array} Returns `array`.
12043 */
12044 function basePullAt(array, indexes) {
12045 var length = array ? indexes.length : 0,
12046 lastIndex = length - 1;
12047
12048 while (length--) {
12049 var index = indexes[length];
12050 if (length == lastIndex || index !== previous) {
12051 var previous = index;
12052 if (isIndex(index)) {
12053 splice.call(array, index, 1);
12054 } else {
12055 baseUnset(array, index);
12056 }
12057 }
12058 }
12059 return array;
12060 }
12061
12062 /**
12063 * The base implementation of `_.random` without support for returning
12064 * floating-point numbers.
12065 *
12066 * @private
12067 * @param {number} lower The lower bound.
12068 * @param {number} upper The upper bound.
12069 * @returns {number} Returns the random number.
12070 */
12071 function baseRandom(lower, upper) {
12072 return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
12073 }
12074
12075 /**
12076 * The base implementation of `_.range` and `_.rangeRight` which doesn't
12077 * coerce arguments.
12078 *
12079 * @private
12080 * @param {number} start The start of the range.
12081 * @param {number} end The end of the range.
12082 * @param {number} step The value to increment or decrement by.
12083 * @param {boolean} [fromRight] Specify iterating from right to left.
12084 * @returns {Array} Returns the range of numbers.
12085 */
12086 function baseRange(start, end, step, fromRight) {
12087 var index = -1,
12088 length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),
12089 result = Array(length);
12090
12091 while (length--) {
12092 result[fromRight ? length : ++index] = start;
12093 start += step;
12094 }
12095 return result;
12096 }
12097
12098 /**
12099 * The base implementation of `_.repeat` which doesn't coerce arguments.
12100 *
12101 * @private
12102 * @param {string} string The string to repeat.
12103 * @param {number} n The number of times to repeat the string.
12104 * @returns {string} Returns the repeated string.
12105 */
12106 function baseRepeat(string, n) {
12107 var result = '';
12108 if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
12109 return result;
12110 }
12111 // Leverage the exponentiation by squaring algorithm for a faster repeat.
12112 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
12113 do {
12114 if (n % 2) {
12115 result += string;
12116 }
12117 n = nativeFloor(n / 2);
12118 if (n) {
12119 string += string;
12120 }
12121 } while (n);
12122
12123 return result;
12124 }
12125
12126 /**
12127 * The base implementation of `_.rest` which doesn't validate or coerce arguments.
12128 *
12129 * @private
12130 * @param {Function} func The function to apply a rest parameter to.
12131 * @param {number} [start=func.length-1] The start position of the rest parameter.
12132 * @returns {Function} Returns the new function.
12133 */
12134 function baseRest(func, start) {
12135 return setToString(overRest(func, start, identity), func + '');
12136 }
12137
12138 /**
12139 * The base implementation of `_.sample`.
12140 *
12141 * @private
12142 * @param {Array|Object} collection The collection to sample.
12143 * @returns {*} Returns the random element.
12144 */
12145 function baseSample(collection) {
12146 return arraySample(values(collection));
12147 }
12148
12149 /**
12150 * The base implementation of `_.sampleSize` without param guards.
12151 *
12152 * @private
12153 * @param {Array|Object} collection The collection to sample.
12154 * @param {number} n The number of elements to sample.
12155 * @returns {Array} Returns the random elements.
12156 */
12157 function baseSampleSize(collection, n) {
12158 var array = values(collection);
12159 return shuffleSelf(array, baseClamp(n, 0, array.length));
12160 }
12161
12162 /**
12163 * The base implementation of `_.set`.
12164 *
12165 * @private
12166 * @param {Object} object The object to modify.
12167 * @param {Array|string} path The path of the property to set.
12168 * @param {*} value The value to set.
12169 * @param {Function} [customizer] The function to customize path creation.
12170 * @returns {Object} Returns `object`.
12171 */
12172 function baseSet(object, path, value, customizer) {
12173 if (!isObject(object)) {
12174 return object;
12175 }
12176 path = castPath(path, object);
12177
12178 var index = -1,
12179 length = path.length,
12180 lastIndex = length - 1,
12181 nested = object;
12182
12183 while (nested != null && ++index < length) {
12184 var key = toKey(path[index]),
12185 newValue = value;
12186
12187 if (index != lastIndex) {
12188 var objValue = nested[key];
12189 newValue = customizer ? customizer(objValue, key, nested) : undefined;
12190 if (newValue === undefined) {
12191 newValue = isObject(objValue)
12192 ? objValue
12193 : (isIndex(path[index + 1]) ? [] : {});
12194 }
12195 }
12196 assignValue(nested, key, newValue);
12197 nested = nested[key];
12198 }
12199 return object;
12200 }
12201
12202 /**
12203 * The base implementation of `setData` without support for hot loop shorting.
12204 *
12205 * @private
12206 * @param {Function} func The function to associate metadata with.
12207 * @param {*} data The metadata.
12208 * @returns {Function} Returns `func`.
12209 */
12210 var baseSetData = !metaMap ? identity : function(func, data) {
12211 metaMap.set(func, data);
12212 return func;
12213 };
12214
12215 /**
12216 * The base implementation of `setToString` without support for hot loop shorting.
12217 *
12218 * @private
12219 * @param {Function} func The function to modify.
12220 * @param {Function} string The `toString` result.
12221 * @returns {Function} Returns `func`.
12222 */
12223 var baseSetToString = !defineProperty ? identity : function(func, string) {
12224 return defineProperty(func, 'toString', {
12225 'configurable': true,
12226 'enumerable': false,
12227 'value': constant(string),
12228 'writable': true
12229 });
12230 };
12231
12232 /**
12233 * The base implementation of `_.shuffle`.
12234 *
12235 * @private
12236 * @param {Array|Object} collection The collection to shuffle.
12237 * @returns {Array} Returns the new shuffled array.
12238 */
12239 function baseShuffle(collection) {
12240 return shuffleSelf(values(collection));
12241 }
12242
12243 /**
12244 * The base implementation of `_.slice` without an iteratee call guard.
12245 *
12246 * @private
12247 * @param {Array} array The array to slice.
12248 * @param {number} [start=0] The start position.
12249 * @param {number} [end=array.length] The end position.
12250 * @returns {Array} Returns the slice of `array`.
12251 */
12252 function baseSlice(array, start, end) {
12253 var index = -1,
12254 length = array.length;
12255
12256 if (start < 0) {
12257 start = -start > length ? 0 : (length + start);
12258 }
12259 end = end > length ? length : end;
12260 if (end < 0) {
12261 end += length;
12262 }
12263 length = start > end ? 0 : ((end - start) >>> 0);
12264 start >>>= 0;
12265
12266 var result = Array(length);
12267 while (++index < length) {
12268 result[index] = array[index + start];
12269 }
12270 return result;
12271 }
12272
12273 /**
12274 * The base implementation of `_.some` without support for iteratee shorthands.
12275 *
12276 * @private
12277 * @param {Array|Object} collection The collection to iterate over.
12278 * @param {Function} predicate The function invoked per iteration.
12279 * @returns {boolean} Returns `true` if any element passes the predicate check,
12280 * else `false`.
12281 */
12282 function baseSome(collection, predicate) {
12283 var result;
12284
12285 baseEach(collection, function(value, index, collection) {
12286 result = predicate(value, index, collection);
12287 return !result;
12288 });
12289 return !!result;
12290 }
12291
12292 /**
12293 * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which
12294 * performs a binary search of `array` to determine the index at which `value`
12295 * should be inserted into `array` in order to maintain its sort order.
12296 *
12297 * @private
12298 * @param {Array} array The sorted array to inspect.
12299 * @param {*} value The value to evaluate.
12300 * @param {boolean} [retHighest] Specify returning the highest qualified index.
12301 * @returns {number} Returns the index at which `value` should be inserted
12302 * into `array`.
12303 */
12304 function baseSortedIndex(array, value, retHighest) {
12305 var low = 0,
12306 high = array == null ? low : array.length;
12307
12308 if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
12309 while (low < high) {
12310 var mid = (low + high) >>> 1,
12311 computed = array[mid];
12312
12313 if (computed !== null && !isSymbol(computed) &&
12314 (retHighest ? (computed <= value) : (computed < value))) {
12315 low = mid + 1;
12316 } else {
12317 high = mid;
12318 }
12319 }
12320 return high;
12321 }
12322 return baseSortedIndexBy(array, value, identity, retHighest);
12323 }
12324
12325 /**
12326 * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`
12327 * which invokes `iteratee` for `value` and each element of `array` to compute
12328 * their sort ranking. The iteratee is invoked with one argument; (value).
12329 *
12330 * @private
12331 * @param {Array} array The sorted array to inspect.
12332 * @param {*} value The value to evaluate.
12333 * @param {Function} iteratee The iteratee invoked per element.
12334 * @param {boolean} [retHighest] Specify returning the highest qualified index.
12335 * @returns {number} Returns the index at which `value` should be inserted
12336 * into `array`.
12337 */
12338 function baseSortedIndexBy(array, value, iteratee, retHighest) {
12339 value = iteratee(value);
12340
12341 var low = 0,
12342 high = array == null ? 0 : array.length,
12343 valIsNaN = value !== value,
12344 valIsNull = value === null,
12345 valIsSymbol = isSymbol(value),
12346 valIsUndefined = value === undefined;
12347
12348 while (low < high) {
12349 var mid = nativeFloor((low + high) / 2),
12350 computed = iteratee(array[mid]),
12351 othIsDefined = computed !== undefined,
12352 othIsNull = computed === null,
12353 othIsReflexive = computed === computed,
12354 othIsSymbol = isSymbol(computed);
12355
12356 if (valIsNaN) {
12357 var setLow = retHighest || othIsReflexive;
12358 } else if (valIsUndefined) {
12359 setLow = othIsReflexive && (retHighest || othIsDefined);
12360 } else if (valIsNull) {
12361 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
12362 } else if (valIsSymbol) {
12363 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
12364 } else if (othIsNull || othIsSymbol) {
12365 setLow = false;
12366 } else {
12367 setLow = retHighest ? (computed <= value) : (computed < value);
12368 }
12369 if (setLow) {
12370 low = mid + 1;
12371 } else {
12372 high = mid;
12373 }
12374 }
12375 return nativeMin(high, MAX_ARRAY_INDEX);
12376 }
12377
12378 /**
12379 * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without
12380 * support for iteratee shorthands.
12381 *
12382 * @private
12383 * @param {Array} array The array to inspect.
12384 * @param {Function} [iteratee] The iteratee invoked per element.
12385 * @returns {Array} Returns the new duplicate free array.
12386 */
12387 function baseSortedUniq(array, iteratee) {
12388 var index = -1,
12389 length = array.length,
12390 resIndex = 0,
12391 result = [];
12392
12393 while (++index < length) {
12394 var value = array[index],
12395 computed = iteratee ? iteratee(value) : value;
12396
12397 if (!index || !eq(computed, seen)) {
12398 var seen = computed;
12399 result[resIndex++] = value === 0 ? 0 : value;
12400 }
12401 }
12402 return result;
12403 }
12404
12405 /**
12406 * The base implementation of `_.toNumber` which doesn't ensure correct
12407 * conversions of binary, hexadecimal, or octal string values.
12408 *
12409 * @private
12410 * @param {*} value The value to process.
12411 * @returns {number} Returns the number.
12412 */
12413 function baseToNumber(value) {
12414 if (typeof value == 'number') {
12415 return value;
12416 }
12417 if (isSymbol(value)) {
12418 return NAN;
12419 }
12420 return +value;
12421 }
12422
12423 /**
12424 * The base implementation of `_.toString` which doesn't convert nullish
12425 * values to empty strings.
12426 *
12427 * @private
12428 * @param {*} value The value to process.
12429 * @returns {string} Returns the string.
12430 */
12431 function baseToString(value) {
12432 // Exit early for strings to avoid a performance hit in some environments.
12433 if (typeof value == 'string') {
12434 return value;
12435 }
12436 if (isArray(value)) {
12437 // Recursively convert values (susceptible to call stack limits).
12438 return arrayMap(value, baseToString) + '';
12439 }
12440 if (isSymbol(value)) {
12441 return symbolToString ? symbolToString.call(value) : '';
12442 }
12443 var result = (value + '');
12444 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
12445 }
12446
12447 /**
12448 * The base implementation of `_.uniqBy` without support for iteratee shorthands.
12449 *
12450 * @private
12451 * @param {Array} array The array to inspect.
12452 * @param {Function} [iteratee] The iteratee invoked per element.
12453 * @param {Function} [comparator] The comparator invoked per element.
12454 * @returns {Array} Returns the new duplicate free array.
12455 */
12456 function baseUniq(array, iteratee, comparator) {
12457 var index = -1,
12458 includes = arrayIncludes,
12459 length = array.length,
12460 isCommon = true,
12461 result = [],
12462 seen = result;
12463
12464 if (comparator) {
12465 isCommon = false;
12466 includes = arrayIncludesWith;
12467 }
12468 else if (length >= LARGE_ARRAY_SIZE) {
12469 var set = iteratee ? null : createSet(array);
12470 if (set) {
12471 return setToArray(set);
12472 }
12473 isCommon = false;
12474 includes = cacheHas;
12475 seen = new SetCache;
12476 }
12477 else {
12478 seen = iteratee ? [] : result;
12479 }
12480 outer:
12481 while (++index < length) {
12482 var value = array[index],
12483 computed = iteratee ? iteratee(value) : value;
12484
12485 value = (comparator || value !== 0) ? value : 0;
12486 if (isCommon && computed === computed) {
12487 var seenIndex = seen.length;
12488 while (seenIndex--) {
12489 if (seen[seenIndex] === computed) {
12490 continue outer;
12491 }
12492 }
12493 if (iteratee) {
12494 seen.push(computed);
12495 }
12496 result.push(value);
12497 }
12498 else if (!includes(seen, computed, comparator)) {
12499 if (seen !== result) {
12500 seen.push(computed);
12501 }
12502 result.push(value);
12503 }
12504 }
12505 return result;
12506 }
12507
12508 /**
12509 * The base implementation of `_.unset`.
12510 *
12511 * @private
12512 * @param {Object} object The object to modify.
12513 * @param {Array|string} path The property path to unset.
12514 * @returns {boolean} Returns `true` if the property is deleted, else `false`.
12515 */
12516 function baseUnset(object, path) {
12517 path = castPath(path, object);
12518 object = parent(object, path);
12519 return object == null || delete object[toKey(last(path))];
12520 }
12521
12522 /**
12523 * The base implementation of `_.update`.
12524 *
12525 * @private
12526 * @param {Object} object The object to modify.
12527 * @param {Array|string} path The path of the property to update.
12528 * @param {Function} updater The function to produce the updated value.
12529 * @param {Function} [customizer] The function to customize path creation.
12530 * @returns {Object} Returns `object`.
12531 */
12532 function baseUpdate(object, path, updater, customizer) {
12533 return baseSet(object, path, updater(baseGet(object, path)), customizer);
12534 }
12535
12536 /**
12537 * The base implementation of methods like `_.dropWhile` and `_.takeWhile`
12538 * without support for iteratee shorthands.
12539 *
12540 * @private
12541 * @param {Array} array The array to query.
12542 * @param {Function} predicate The function invoked per iteration.
12543 * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
12544 * @param {boolean} [fromRight] Specify iterating from right to left.
12545 * @returns {Array} Returns the slice of `array`.
12546 */
12547 function baseWhile(array, predicate, isDrop, fromRight) {
12548 var length = array.length,
12549 index = fromRight ? length : -1;
12550
12551 while ((fromRight ? index-- : ++index < length) &&
12552 predicate(array[index], index, array)) {}
12553
12554 return isDrop
12555 ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))
12556 : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));
12557 }
12558
12559 /**
12560 * The base implementation of `wrapperValue` which returns the result of
12561 * performing a sequence of actions on the unwrapped `value`, where each
12562 * successive action is supplied the return value of the previous.
12563 *
12564 * @private
12565 * @param {*} value The unwrapped value.
12566 * @param {Array} actions Actions to perform to resolve the unwrapped value.
12567 * @returns {*} Returns the resolved value.
12568 */
12569 function baseWrapperValue(value, actions) {
12570 var result = value;
12571 if (result instanceof LazyWrapper) {
12572 result = result.value();
12573 }
12574 return arrayReduce(actions, function(result, action) {
12575 return action.func.apply(action.thisArg, arrayPush([result], action.args));
12576 }, result);
12577 }
12578
12579 /**
12580 * The base implementation of methods like `_.xor`, without support for
12581 * iteratee shorthands, that accepts an array of arrays to inspect.
12582 *
12583 * @private
12584 * @param {Array} arrays The arrays to inspect.
12585 * @param {Function} [iteratee] The iteratee invoked per element.
12586 * @param {Function} [comparator] The comparator invoked per element.
12587 * @returns {Array} Returns the new array of values.
12588 */
12589 function baseXor(arrays, iteratee, comparator) {
12590 var length = arrays.length;
12591 if (length < 2) {
12592 return length ? baseUniq(arrays[0]) : [];
12593 }
12594 var index = -1,
12595 result = Array(length);
12596
12597 while (++index < length) {
12598 var array = arrays[index],
12599 othIndex = -1;
12600
12601 while (++othIndex < length) {
12602 if (othIndex != index) {
12603 result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);
12604 }
12605 }
12606 }
12607 return baseUniq(baseFlatten(result, 1), iteratee, comparator);
12608 }
12609
12610 /**
12611 * This base implementation of `_.zipObject` which assigns values using `assignFunc`.
12612 *
12613 * @private
12614 * @param {Array} props The property identifiers.
12615 * @param {Array} values The property values.
12616 * @param {Function} assignFunc The function to assign values.
12617 * @returns {Object} Returns the new object.
12618 */
12619 function baseZipObject(props, values, assignFunc) {
12620 var index = -1,
12621 length = props.length,
12622 valsLength = values.length,
12623 result = {};
12624
12625 while (++index < length) {
12626 var value = index < valsLength ? values[index] : undefined;
12627 assignFunc(result, props[index], value);
12628 }
12629 return result;
12630 }
12631
12632 /**
12633 * Casts `value` to an empty array if it's not an array like object.
12634 *
12635 * @private
12636 * @param {*} value The value to inspect.
12637 * @returns {Array|Object} Returns the cast array-like object.
12638 */
12639 function castArrayLikeObject(value) {
12640 return isArrayLikeObject(value) ? value : [];
12641 }
12642
12643 /**
12644 * Casts `value` to `identity` if it's not a function.
12645 *
12646 * @private
12647 * @param {*} value The value to inspect.
12648 * @returns {Function} Returns cast function.
12649 */
12650 function castFunction(value) {
12651 return typeof value == 'function' ? value : identity;
12652 }
12653
12654 /**
12655 * Casts `value` to a path array if it's not one.
12656 *
12657 * @private
12658 * @param {*} value The value to inspect.
12659 * @param {Object} [object] The object to query keys on.
12660 * @returns {Array} Returns the cast property path array.
12661 */
12662 function castPath(value, object) {
12663 if (isArray(value)) {
12664 return value;
12665 }
12666 return isKey(value, object) ? [value] : stringToPath(toString(value));
12667 }
12668
12669 /**
12670 * A `baseRest` alias which can be replaced with `identity` by module
12671 * replacement plugins.
12672 *
12673 * @private
12674 * @type {Function}
12675 * @param {Function} func The function to apply a rest parameter to.
12676 * @returns {Function} Returns the new function.
12677 */
12678 var castRest = baseRest;
12679
12680 /**
12681 * Casts `array` to a slice if it's needed.
12682 *
12683 * @private
12684 * @param {Array} array The array to inspect.
12685 * @param {number} start The start position.
12686 * @param {number} [end=array.length] The end position.
12687 * @returns {Array} Returns the cast slice.
12688 */
12689 function castSlice(array, start, end) {
12690 var length = array.length;
12691 end = end === undefined ? length : end;
12692 return (!start && end >= length) ? array : baseSlice(array, start, end);
12693 }
12694
12695 /**
12696 * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).
12697 *
12698 * @private
12699 * @param {number|Object} id The timer id or timeout object of the timer to clear.
12700 */
12701 var clearTimeout = ctxClearTimeout || function(id) {
12702 return root.clearTimeout(id);
12703 };
12704
12705 /**
12706 * Creates a clone of `buffer`.
12707 *
12708 * @private
12709 * @param {Buffer} buffer The buffer to clone.
12710 * @param {boolean} [isDeep] Specify a deep clone.
12711 * @returns {Buffer} Returns the cloned buffer.
12712 */
12713 function cloneBuffer(buffer, isDeep) {
12714 if (isDeep) {
12715 return buffer.slice();
12716 }
12717 var length = buffer.length,
12718 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
12719
12720 buffer.copy(result);
12721 return result;
12722 }
12723
12724 /**
12725 * Creates a clone of `arrayBuffer`.
12726 *
12727 * @private
12728 * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
12729 * @returns {ArrayBuffer} Returns the cloned array buffer.
12730 */
12731 function cloneArrayBuffer(arrayBuffer) {
12732 var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
12733 new Uint8Array(result).set(new Uint8Array(arrayBuffer));
12734 return result;
12735 }
12736
12737 /**
12738 * Creates a clone of `dataView`.
12739 *
12740 * @private
12741 * @param {Object} dataView The data view to clone.
12742 * @param {boolean} [isDeep] Specify a deep clone.
12743 * @returns {Object} Returns the cloned data view.
12744 */
12745 function cloneDataView(dataView, isDeep) {
12746 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
12747 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
12748 }
12749
12750 /**
12751 * Creates a clone of `regexp`.
12752 *
12753 * @private
12754 * @param {Object} regexp The regexp to clone.
12755 * @returns {Object} Returns the cloned regexp.
12756 */
12757 function cloneRegExp(regexp) {
12758 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
12759 result.lastIndex = regexp.lastIndex;
12760 return result;
12761 }
12762
12763 /**
12764 * Creates a clone of the `symbol` object.
12765 *
12766 * @private
12767 * @param {Object} symbol The symbol object to clone.
12768 * @returns {Object} Returns the cloned symbol object.
12769 */
12770 function cloneSymbol(symbol) {
12771 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
12772 }
12773
12774 /**
12775 * Creates a clone of `typedArray`.
12776 *
12777 * @private
12778 * @param {Object} typedArray The typed array to clone.
12779 * @param {boolean} [isDeep] Specify a deep clone.
12780 * @returns {Object} Returns the cloned typed array.
12781 */
12782 function cloneTypedArray(typedArray, isDeep) {
12783 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
12784 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
12785 }
12786
12787 /**
12788 * Compares values to sort them in ascending order.
12789 *
12790 * @private
12791 * @param {*} value The value to compare.
12792 * @param {*} other The other value to compare.
12793 * @returns {number} Returns the sort order indicator for `value`.
12794 */
12795 function compareAscending(value, other) {
12796 if (value !== other) {
12797 var valIsDefined = value !== undefined,
12798 valIsNull = value === null,
12799 valIsReflexive = value === value,
12800 valIsSymbol = isSymbol(value);
12801
12802 var othIsDefined = other !== undefined,
12803 othIsNull = other === null,
12804 othIsReflexive = other === other,
12805 othIsSymbol = isSymbol(other);
12806
12807 if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
12808 (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
12809 (valIsNull && othIsDefined && othIsReflexive) ||
12810 (!valIsDefined && othIsReflexive) ||
12811 !valIsReflexive) {
12812 return 1;
12813 }
12814 if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
12815 (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
12816 (othIsNull && valIsDefined && valIsReflexive) ||
12817 (!othIsDefined && valIsReflexive) ||
12818 !othIsReflexive) {
12819 return -1;
12820 }
12821 }
12822 return 0;
12823 }
12824
12825 /**
12826 * Used by `_.orderBy` to compare multiple properties of a value to another
12827 * and stable sort them.
12828 *
12829 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,
12830 * specify an order of "desc" for descending or "asc" for ascending sort order
12831 * of corresponding values.
12832 *
12833 * @private
12834 * @param {Object} object The object to compare.
12835 * @param {Object} other The other object to compare.
12836 * @param {boolean[]|string[]} orders The order to sort by for each property.
12837 * @returns {number} Returns the sort order indicator for `object`.
12838 */
12839 function compareMultiple(object, other, orders) {
12840 var index = -1,
12841 objCriteria = object.criteria,
12842 othCriteria = other.criteria,
12843 length = objCriteria.length,
12844 ordersLength = orders.length;
12845
12846 while (++index < length) {
12847 var result = compareAscending(objCriteria[index], othCriteria[index]);
12848 if (result) {
12849 if (index >= ordersLength) {
12850 return result;
12851 }
12852 var order = orders[index];
12853 return result * (order == 'desc' ? -1 : 1);
12854 }
12855 }
12856 // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
12857 // that causes it, under certain circumstances, to provide the same value for
12858 // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
12859 // for more details.
12860 //
12861 // This also ensures a stable sort in V8 and other engines.
12862 // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.
12863 return object.index - other.index;
12864 }
12865
12866 /**
12867 * Creates an array that is the composition of partially applied arguments,
12868 * placeholders, and provided arguments into a single array of arguments.
12869 *
12870 * @private
12871 * @param {Array} args The provided arguments.
12872 * @param {Array} partials The arguments to prepend to those provided.
12873 * @param {Array} holders The `partials` placeholder indexes.
12874 * @params {boolean} [isCurried] Specify composing for a curried function.
12875 * @returns {Array} Returns the new array of composed arguments.
12876 */
12877 function composeArgs(args, partials, holders, isCurried) {
12878 var argsIndex = -1,
12879 argsLength = args.length,
12880 holdersLength = holders.length,
12881 leftIndex = -1,
12882 leftLength = partials.length,
12883 rangeLength = nativeMax(argsLength - holdersLength, 0),
12884 result = Array(leftLength + rangeLength),
12885 isUncurried = !isCurried;
12886
12887 while (++leftIndex < leftLength) {
12888 result[leftIndex] = partials[leftIndex];
12889 }
12890 while (++argsIndex < holdersLength) {
12891 if (isUncurried || argsIndex < argsLength) {
12892 result[holders[argsIndex]] = args[argsIndex];
12893 }
12894 }
12895 while (rangeLength--) {
12896 result[leftIndex++] = args[argsIndex++];
12897 }
12898 return result;
12899 }
12900
12901 /**
12902 * This function is like `composeArgs` except that the arguments composition
12903 * is tailored for `_.partialRight`.
12904 *
12905 * @private
12906 * @param {Array} args The provided arguments.
12907 * @param {Array} partials The arguments to append to those provided.
12908 * @param {Array} holders The `partials` placeholder indexes.
12909 * @params {boolean} [isCurried] Specify composing for a curried function.
12910 * @returns {Array} Returns the new array of composed arguments.
12911 */
12912 function composeArgsRight(args, partials, holders, isCurried) {
12913 var argsIndex = -1,
12914 argsLength = args.length,
12915 holdersIndex = -1,
12916 holdersLength = holders.length,
12917 rightIndex = -1,
12918 rightLength = partials.length,
12919 rangeLength = nativeMax(argsLength - holdersLength, 0),
12920 result = Array(rangeLength + rightLength),
12921 isUncurried = !isCurried;
12922
12923 while (++argsIndex < rangeLength) {
12924 result[argsIndex] = args[argsIndex];
12925 }
12926 var offset = argsIndex;
12927 while (++rightIndex < rightLength) {
12928 result[offset + rightIndex] = partials[rightIndex];
12929 }
12930 while (++holdersIndex < holdersLength) {
12931 if (isUncurried || argsIndex < argsLength) {
12932 result[offset + holders[holdersIndex]] = args[argsIndex++];
12933 }
12934 }
12935 return result;
12936 }
12937
12938 /**
12939 * Copies the values of `source` to `array`.
12940 *
12941 * @private
12942 * @param {Array} source The array to copy values from.
12943 * @param {Array} [array=[]] The array to copy values to.
12944 * @returns {Array} Returns `array`.
12945 */
12946 function copyArray(source, array) {
12947 var index = -1,
12948 length = source.length;
12949
12950 array || (array = Array(length));
12951 while (++index < length) {
12952 array[index] = source[index];
12953 }
12954 return array;
12955 }
12956
12957 /**
12958 * Copies properties of `source` to `object`.
12959 *
12960 * @private
12961 * @param {Object} source The object to copy properties from.
12962 * @param {Array} props The property identifiers to copy.
12963 * @param {Object} [object={}] The object to copy properties to.
12964 * @param {Function} [customizer] The function to customize copied values.
12965 * @returns {Object} Returns `object`.
12966 */
12967 function copyObject(source, props, object, customizer) {
12968 var isNew = !object;
12969 object || (object = {});
12970
12971 var index = -1,
12972 length = props.length;
12973
12974 while (++index < length) {
12975 var key = props[index];
12976
12977 var newValue = customizer
12978 ? customizer(object[key], source[key], key, object, source)
12979 : undefined;
12980
12981 if (newValue === undefined) {
12982 newValue = source[key];
12983 }
12984 if (isNew) {
12985 baseAssignValue(object, key, newValue);
12986 } else {
12987 assignValue(object, key, newValue);
12988 }
12989 }
12990 return object;
12991 }
12992
12993 /**
12994 * Copies own symbols of `source` to `object`.
12995 *
12996 * @private
12997 * @param {Object} source The object to copy symbols from.
12998 * @param {Object} [object={}] The object to copy symbols to.
12999 * @returns {Object} Returns `object`.
13000 */
13001 function copySymbols(source, object) {
13002 return copyObject(source, getSymbols(source), object);
13003 }
13004
13005 /**
13006 * Copies own and inherited symbols of `source` to `object`.
13007 *
13008 * @private
13009 * @param {Object} source The object to copy symbols from.
13010 * @param {Object} [object={}] The object to copy symbols to.
13011 * @returns {Object} Returns `object`.
13012 */
13013 function copySymbolsIn(source, object) {
13014 return copyObject(source, getSymbolsIn(source), object);
13015 }
13016
13017 /**
13018 * Creates a function like `_.groupBy`.
13019 *
13020 * @private
13021 * @param {Function} setter The function to set accumulator values.
13022 * @param {Function} [initializer] The accumulator object initializer.
13023 * @returns {Function} Returns the new aggregator function.
13024 */
13025 function createAggregator(setter, initializer) {
13026 return function(collection, iteratee) {
13027 var func = isArray(collection) ? arrayAggregator : baseAggregator,
13028 accumulator = initializer ? initializer() : {};
13029
13030 return func(collection, setter, getIteratee(iteratee, 2), accumulator);
13031 };
13032 }
13033
13034 /**
13035 * Creates a function like `_.assign`.
13036 *
13037 * @private
13038 * @param {Function} assigner The function to assign values.
13039 * @returns {Function} Returns the new assigner function.
13040 */
13041 function createAssigner(assigner) {
13042 return baseRest(function(object, sources) {
13043 var index = -1,
13044 length = sources.length,
13045 customizer = length > 1 ? sources[length - 1] : undefined,
13046 guard = length > 2 ? sources[2] : undefined;
13047
13048 customizer = (assigner.length > 3 && typeof customizer == 'function')
13049 ? (length--, customizer)
13050 : undefined;
13051
13052 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
13053 customizer = length < 3 ? undefined : customizer;
13054 length = 1;
13055 }
13056 object = Object(object);
13057 while (++index < length) {
13058 var source = sources[index];
13059 if (source) {
13060 assigner(object, source, index, customizer);
13061 }
13062 }
13063 return object;
13064 });
13065 }
13066
13067 /**
13068 * Creates a `baseEach` or `baseEachRight` function.
13069 *
13070 * @private
13071 * @param {Function} eachFunc The function to iterate over a collection.
13072 * @param {boolean} [fromRight] Specify iterating from right to left.
13073 * @returns {Function} Returns the new base function.
13074 */
13075 function createBaseEach(eachFunc, fromRight) {
13076 return function(collection, iteratee) {
13077 if (collection == null) {
13078 return collection;
13079 }
13080 if (!isArrayLike(collection)) {
13081 return eachFunc(collection, iteratee);
13082 }
13083 var length = collection.length,
13084 index = fromRight ? length : -1,
13085 iterable = Object(collection);
13086
13087 while ((fromRight ? index-- : ++index < length)) {
13088 if (iteratee(iterable[index], index, iterable) === false) {
13089 break;
13090 }
13091 }
13092 return collection;
13093 };
13094 }
13095
13096 /**
13097 * Creates a base function for methods like `_.forIn` and `_.forOwn`.
13098 *
13099 * @private
13100 * @param {boolean} [fromRight] Specify iterating from right to left.
13101 * @returns {Function} Returns the new base function.
13102 */
13103 function createBaseFor(fromRight) {
13104 return function(object, iteratee, keysFunc) {
13105 var index = -1,
13106 iterable = Object(object),
13107 props = keysFunc(object),
13108 length = props.length;
13109
13110 while (length--) {
13111 var key = props[fromRight ? length : ++index];
13112 if (iteratee(iterable[key], key, iterable) === false) {
13113 break;
13114 }
13115 }
13116 return object;
13117 };
13118 }
13119
13120 /**
13121 * Creates a function that wraps `func` to invoke it with the optional `this`
13122 * binding of `thisArg`.
13123 *
13124 * @private
13125 * @param {Function} func The function to wrap.
13126 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
13127 * @param {*} [thisArg] The `this` binding of `func`.
13128 * @returns {Function} Returns the new wrapped function.
13129 */
13130 function createBind(func, bitmask, thisArg) {
13131 var isBind = bitmask & WRAP_BIND_FLAG,
13132 Ctor = createCtor(func);
13133
13134 function wrapper() {
13135 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
13136 return fn.apply(isBind ? thisArg : this, arguments);
13137 }
13138 return wrapper;
13139 }
13140
13141 /**
13142 * Creates a function like `_.lowerFirst`.
13143 *
13144 * @private
13145 * @param {string} methodName The name of the `String` case method to use.
13146 * @returns {Function} Returns the new case function.
13147 */
13148 function createCaseFirst(methodName) {
13149 return function(string) {
13150 string = toString(string);
13151
13152 var strSymbols = hasUnicode(string)
13153 ? stringToArray(string)
13154 : undefined;
13155
13156 var chr = strSymbols
13157 ? strSymbols[0]
13158 : string.charAt(0);
13159
13160 var trailing = strSymbols
13161 ? castSlice(strSymbols, 1).join('')
13162 : string.slice(1);
13163
13164 return chr[methodName]() + trailing;
13165 };
13166 }
13167
13168 /**
13169 * Creates a function like `_.camelCase`.
13170 *
13171 * @private
13172 * @param {Function} callback The function to combine each word.
13173 * @returns {Function} Returns the new compounder function.
13174 */
13175 function createCompounder(callback) {
13176 return function(string) {
13177 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');
13178 };
13179 }
13180
13181 /**
13182 * Creates a function that produces an instance of `Ctor` regardless of
13183 * whether it was invoked as part of a `new` expression or by `call` or `apply`.
13184 *
13185 * @private
13186 * @param {Function} Ctor The constructor to wrap.
13187 * @returns {Function} Returns the new wrapped function.
13188 */
13189 function createCtor(Ctor) {
13190 return function() {
13191 // Use a `switch` statement to work with class constructors. See
13192 // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
13193 // for more details.
13194 var args = arguments;
13195 switch (args.length) {
13196 case 0: return new Ctor;
13197 case 1: return new Ctor(args[0]);
13198 case 2: return new Ctor(args[0], args[1]);
13199 case 3: return new Ctor(args[0], args[1], args[2]);
13200 case 4: return new Ctor(args[0], args[1], args[2], args[3]);
13201 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);
13202 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
13203 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
13204 }
13205 var thisBinding = baseCreate(Ctor.prototype),
13206 result = Ctor.apply(thisBinding, args);
13207
13208 // Mimic the constructor's `return` behavior.
13209 // See https://es5.github.io/#x13.2.2 for more details.
13210 return isObject(result) ? result : thisBinding;
13211 };
13212 }
13213
13214 /**
13215 * Creates a function that wraps `func` to enable currying.
13216 *
13217 * @private
13218 * @param {Function} func The function to wrap.
13219 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
13220 * @param {number} arity The arity of `func`.
13221 * @returns {Function} Returns the new wrapped function.
13222 */
13223 function createCurry(func, bitmask, arity) {
13224 var Ctor = createCtor(func);
13225
13226 function wrapper() {
13227 var length = arguments.length,
13228 args = Array(length),
13229 index = length,
13230 placeholder = getHolder(wrapper);
13231
13232 while (index--) {
13233 args[index] = arguments[index];
13234 }
13235 var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)
13236 ? []
13237 : replaceHolders(args, placeholder);
13238
13239 length -= holders.length;
13240 if (length < arity) {
13241 return createRecurry(
13242 func, bitmask, createHybrid, wrapper.placeholder, undefined,
13243 args, holders, undefined, undefined, arity - length);
13244 }
13245 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
13246 return apply(fn, this, args);
13247 }
13248 return wrapper;
13249 }
13250
13251 /**
13252 * Creates a `_.find` or `_.findLast` function.
13253 *
13254 * @private
13255 * @param {Function} findIndexFunc The function to find the collection index.
13256 * @returns {Function} Returns the new find function.
13257 */
13258 function createFind(findIndexFunc) {
13259 return function(collection, predicate, fromIndex) {
13260 var iterable = Object(collection);
13261 if (!isArrayLike(collection)) {
13262 var iteratee = getIteratee(predicate, 3);
13263 collection = keys(collection);
13264 predicate = function(key) { return iteratee(iterable[key], key, iterable); };
13265 }
13266 var index = findIndexFunc(collection, predicate, fromIndex);
13267 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;
13268 };
13269 }
13270
13271 /**
13272 * Creates a `_.flow` or `_.flowRight` function.
13273 *
13274 * @private
13275 * @param {boolean} [fromRight] Specify iterating from right to left.
13276 * @returns {Function} Returns the new flow function.
13277 */
13278 function createFlow(fromRight) {
13279 return flatRest(function(funcs) {
13280 var length = funcs.length,
13281 index = length,
13282 prereq = LodashWrapper.prototype.thru;
13283
13284 if (fromRight) {
13285 funcs.reverse();
13286 }
13287 while (index--) {
13288 var func = funcs[index];
13289 if (typeof func != 'function') {
13290 throw new TypeError(FUNC_ERROR_TEXT);
13291 }
13292 if (prereq && !wrapper && getFuncName(func) == 'wrapper') {
13293 var wrapper = new LodashWrapper([], true);
13294 }
13295 }
13296 index = wrapper ? index : length;
13297 while (++index < length) {
13298 func = funcs[index];
13299
13300 var funcName = getFuncName(func),
13301 data = funcName == 'wrapper' ? getData(func) : undefined;
13302
13303 if (data && isLaziable(data[0]) &&
13304 data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&
13305 !data[4].length && data[9] == 1
13306 ) {
13307 wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
13308 } else {
13309 wrapper = (func.length == 1 && isLaziable(func))
13310 ? wrapper[funcName]()
13311 : wrapper.thru(func);
13312 }
13313 }
13314 return function() {
13315 var args = arguments,
13316 value = args[0];
13317
13318 if (wrapper && args.length == 1 && isArray(value)) {
13319 return wrapper.plant(value).value();
13320 }
13321 var index = 0,
13322 result = length ? funcs[index].apply(this, args) : value;
13323
13324 while (++index < length) {
13325 result = funcs[index].call(this, result);
13326 }
13327 return result;
13328 };
13329 });
13330 }
13331
13332 /**
13333 * Creates a function that wraps `func` to invoke it with optional `this`
13334 * binding of `thisArg`, partial application, and currying.
13335 *
13336 * @private
13337 * @param {Function|string} func The function or method name to wrap.
13338 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
13339 * @param {*} [thisArg] The `this` binding of `func`.
13340 * @param {Array} [partials] The arguments to prepend to those provided to
13341 * the new function.
13342 * @param {Array} [holders] The `partials` placeholder indexes.
13343 * @param {Array} [partialsRight] The arguments to append to those provided
13344 * to the new function.
13345 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
13346 * @param {Array} [argPos] The argument positions of the new function.
13347 * @param {number} [ary] The arity cap of `func`.
13348 * @param {number} [arity] The arity of `func`.
13349 * @returns {Function} Returns the new wrapped function.
13350 */
13351 function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
13352 var isAry = bitmask & WRAP_ARY_FLAG,
13353 isBind = bitmask & WRAP_BIND_FLAG,
13354 isBindKey = bitmask & WRAP_BIND_KEY_FLAG,
13355 isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),
13356 isFlip = bitmask & WRAP_FLIP_FLAG,
13357 Ctor = isBindKey ? undefined : createCtor(func);
13358
13359 function wrapper() {
13360 var length = arguments.length,
13361 args = Array(length),
13362 index = length;
13363
13364 while (index--) {
13365 args[index] = arguments[index];
13366 }
13367 if (isCurried) {
13368 var placeholder = getHolder(wrapper),
13369 holdersCount = countHolders(args, placeholder);
13370 }
13371 if (partials) {
13372 args = composeArgs(args, partials, holders, isCurried);
13373 }
13374 if (partialsRight) {
13375 args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
13376 }
13377 length -= holdersCount;
13378 if (isCurried && length < arity) {
13379 var newHolders = replaceHolders(args, placeholder);
13380 return createRecurry(
13381 func, bitmask, createHybrid, wrapper.placeholder, thisArg,
13382 args, newHolders, argPos, ary, arity - length
13383 );
13384 }
13385 var thisBinding = isBind ? thisArg : this,
13386 fn = isBindKey ? thisBinding[func] : func;
13387
13388 length = args.length;
13389 if (argPos) {
13390 args = reorder(args, argPos);
13391 } else if (isFlip && length > 1) {
13392 args.reverse();
13393 }
13394 if (isAry && ary < length) {
13395 args.length = ary;
13396 }
13397 if (this && this !== root && this instanceof wrapper) {
13398 fn = Ctor || createCtor(fn);
13399 }
13400 return fn.apply(thisBinding, args);
13401 }
13402 return wrapper;
13403 }
13404
13405 /**
13406 * Creates a function like `_.invertBy`.
13407 *
13408 * @private
13409 * @param {Function} setter The function to set accumulator values.
13410 * @param {Function} toIteratee The function to resolve iteratees.
13411 * @returns {Function} Returns the new inverter function.
13412 */
13413 function createInverter(setter, toIteratee) {
13414 return function(object, iteratee) {
13415 return baseInverter(object, setter, toIteratee(iteratee), {});
13416 };
13417 }
13418
13419 /**
13420 * Creates a function that performs a mathematical operation on two values.
13421 *
13422 * @private
13423 * @param {Function} operator The function to perform the operation.
13424 * @param {number} [defaultValue] The value used for `undefined` arguments.
13425 * @returns {Function} Returns the new mathematical operation function.
13426 */
13427 function createMathOperation(operator, defaultValue) {
13428 return function(value, other) {
13429 var result;
13430 if (value === undefined && other === undefined) {
13431 return defaultValue;
13432 }
13433 if (value !== undefined) {
13434 result = value;
13435 }
13436 if (other !== undefined) {
13437 if (result === undefined) {
13438 return other;
13439 }
13440 if (typeof value == 'string' || typeof other == 'string') {
13441 value = baseToString(value);
13442 other = baseToString(other);
13443 } else {
13444 value = baseToNumber(value);
13445 other = baseToNumber(other);
13446 }
13447 result = operator(value, other);
13448 }
13449 return result;
13450 };
13451 }
13452
13453 /**
13454 * Creates a function like `_.over`.
13455 *
13456 * @private
13457 * @param {Function} arrayFunc The function to iterate over iteratees.
13458 * @returns {Function} Returns the new over function.
13459 */
13460 function createOver(arrayFunc) {
13461 return flatRest(function(iteratees) {
13462 iteratees = arrayMap(iteratees, baseUnary(getIteratee()));
13463 return baseRest(function(args) {
13464 var thisArg = this;
13465 return arrayFunc(iteratees, function(iteratee) {
13466 return apply(iteratee, thisArg, args);
13467 });
13468 });
13469 });
13470 }
13471
13472 /**
13473 * Creates the padding for `string` based on `length`. The `chars` string
13474 * is truncated if the number of characters exceeds `length`.
13475 *
13476 * @private
13477 * @param {number} length The padding length.
13478 * @param {string} [chars=' '] The string used as padding.
13479 * @returns {string} Returns the padding for `string`.
13480 */
13481 function createPadding(length, chars) {
13482 chars = chars === undefined ? ' ' : baseToString(chars);
13483
13484 var charsLength = chars.length;
13485 if (charsLength < 2) {
13486 return charsLength ? baseRepeat(chars, length) : chars;
13487 }
13488 var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
13489 return hasUnicode(chars)
13490 ? castSlice(stringToArray(result), 0, length).join('')
13491 : result.slice(0, length);
13492 }
13493
13494 /**
13495 * Creates a function that wraps `func` to invoke it with the `this` binding
13496 * of `thisArg` and `partials` prepended to the arguments it receives.
13497 *
13498 * @private
13499 * @param {Function} func The function to wrap.
13500 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
13501 * @param {*} thisArg The `this` binding of `func`.
13502 * @param {Array} partials The arguments to prepend to those provided to
13503 * the new function.
13504 * @returns {Function} Returns the new wrapped function.
13505 */
13506 function createPartial(func, bitmask, thisArg, partials) {
13507 var isBind = bitmask & WRAP_BIND_FLAG,
13508 Ctor = createCtor(func);
13509
13510 function wrapper() {
13511 var argsIndex = -1,
13512 argsLength = arguments.length,
13513 leftIndex = -1,
13514 leftLength = partials.length,
13515 args = Array(leftLength + argsLength),
13516 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
13517
13518 while (++leftIndex < leftLength) {
13519 args[leftIndex] = partials[leftIndex];
13520 }
13521 while (argsLength--) {
13522 args[leftIndex++] = arguments[++argsIndex];
13523 }
13524 return apply(fn, isBind ? thisArg : this, args);
13525 }
13526 return wrapper;
13527 }
13528
13529 /**
13530 * Creates a `_.range` or `_.rangeRight` function.
13531 *
13532 * @private
13533 * @param {boolean} [fromRight] Specify iterating from right to left.
13534 * @returns {Function} Returns the new range function.
13535 */
13536 function createRange(fromRight) {
13537 return function(start, end, step) {
13538 if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {
13539 end = step = undefined;
13540 }
13541 // Ensure the sign of `-0` is preserved.
13542 start = toFinite(start);
13543 if (end === undefined) {
13544 end = start;
13545 start = 0;
13546 } else {
13547 end = toFinite(end);
13548 }
13549 step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);
13550 return baseRange(start, end, step, fromRight);
13551 };
13552 }
13553
13554 /**
13555 * Creates a function that performs a relational operation on two values.
13556 *
13557 * @private
13558 * @param {Function} operator The function to perform the operation.
13559 * @returns {Function} Returns the new relational operation function.
13560 */
13561 function createRelationalOperation(operator) {
13562 return function(value, other) {
13563 if (!(typeof value == 'string' && typeof other == 'string')) {
13564 value = toNumber(value);
13565 other = toNumber(other);
13566 }
13567 return operator(value, other);
13568 };
13569 }
13570
13571 /**
13572 * Creates a function that wraps `func` to continue currying.
13573 *
13574 * @private
13575 * @param {Function} func The function to wrap.
13576 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
13577 * @param {Function} wrapFunc The function to create the `func` wrapper.
13578 * @param {*} placeholder The placeholder value.
13579 * @param {*} [thisArg] The `this` binding of `func`.
13580 * @param {Array} [partials] The arguments to prepend to those provided to
13581 * the new function.
13582 * @param {Array} [holders] The `partials` placeholder indexes.
13583 * @param {Array} [argPos] The argument positions of the new function.
13584 * @param {number} [ary] The arity cap of `func`.
13585 * @param {number} [arity] The arity of `func`.
13586 * @returns {Function} Returns the new wrapped function.
13587 */
13588 function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {
13589 var isCurry = bitmask & WRAP_CURRY_FLAG,
13590 newHolders = isCurry ? holders : undefined,
13591 newHoldersRight = isCurry ? undefined : holders,
13592 newPartials = isCurry ? partials : undefined,
13593 newPartialsRight = isCurry ? undefined : partials;
13594
13595 bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);
13596 bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);
13597
13598 if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {
13599 bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);
13600 }
13601 var newData = [
13602 func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,
13603 newHoldersRight, argPos, ary, arity
13604 ];
13605
13606 var result = wrapFunc.apply(undefined, newData);
13607 if (isLaziable(func)) {
13608 setData(result, newData);
13609 }
13610 result.placeholder = placeholder;
13611 return setWrapToString(result, func, bitmask);
13612 }
13613
13614 /**
13615 * Creates a function like `_.round`.
13616 *
13617 * @private
13618 * @param {string} methodName The name of the `Math` method to use when rounding.
13619 * @returns {Function} Returns the new round function.
13620 */
13621 function createRound(methodName) {
13622 var func = Math[methodName];
13623 return function(number, precision) {
13624 number = toNumber(number);
13625 precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);
13626 if (precision) {
13627 // Shift with exponential notation to avoid floating-point issues.
13628 // See [MDN](https://mdn.io/round#Examples) for more details.
13629 var pair = (toString(number) + 'e').split('e'),
13630 value = func(pair[0] + 'e' + (+pair[1] + precision));
13631
13632 pair = (toString(value) + 'e').split('e');
13633 return +(pair[0] + 'e' + (+pair[1] - precision));
13634 }
13635 return func(number);
13636 };
13637 }
13638
13639 /**
13640 * Creates a set object of `values`.
13641 *
13642 * @private
13643 * @param {Array} values The values to add to the set.
13644 * @returns {Object} Returns the new set.
13645 */
13646 var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
13647 return new Set(values);
13648 };
13649
13650 /**
13651 * Creates a `_.toPairs` or `_.toPairsIn` function.
13652 *
13653 * @private
13654 * @param {Function} keysFunc The function to get the keys of a given object.
13655 * @returns {Function} Returns the new pairs function.
13656 */
13657 function createToPairs(keysFunc) {
13658 return function(object) {
13659 var tag = getTag(object);
13660 if (tag == mapTag) {
13661 return mapToArray(object);
13662 }
13663 if (tag == setTag) {
13664 return setToPairs(object);
13665 }
13666 return baseToPairs(object, keysFunc(object));
13667 };
13668 }
13669
13670 /**
13671 * Creates a function that either curries or invokes `func` with optional
13672 * `this` binding and partially applied arguments.
13673 *
13674 * @private
13675 * @param {Function|string} func The function or method name to wrap.
13676 * @param {number} bitmask The bitmask flags.
13677 * 1 - `_.bind`
13678 * 2 - `_.bindKey`
13679 * 4 - `_.curry` or `_.curryRight` of a bound function
13680 * 8 - `_.curry`
13681 * 16 - `_.curryRight`
13682 * 32 - `_.partial`
13683 * 64 - `_.partialRight`
13684 * 128 - `_.rearg`
13685 * 256 - `_.ary`
13686 * 512 - `_.flip`
13687 * @param {*} [thisArg] The `this` binding of `func`.
13688 * @param {Array} [partials] The arguments to be partially applied.
13689 * @param {Array} [holders] The `partials` placeholder indexes.
13690 * @param {Array} [argPos] The argument positions of the new function.
13691 * @param {number} [ary] The arity cap of `func`.
13692 * @param {number} [arity] The arity of `func`.
13693 * @returns {Function} Returns the new wrapped function.
13694 */
13695 function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
13696 var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;
13697 if (!isBindKey && typeof func != 'function') {
13698 throw new TypeError(FUNC_ERROR_TEXT);
13699 }
13700 var length = partials ? partials.length : 0;
13701 if (!length) {
13702 bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
13703 partials = holders = undefined;
13704 }
13705 ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);
13706 arity = arity === undefined ? arity : toInteger(arity);
13707 length -= holders ? holders.length : 0;
13708
13709 if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
13710 var partialsRight = partials,
13711 holdersRight = holders;
13712
13713 partials = holders = undefined;
13714 }
13715 var data = isBindKey ? undefined : getData(func);
13716
13717 var newData = [
13718 func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,
13719 argPos, ary, arity
13720 ];
13721
13722 if (data) {
13723 mergeData(newData, data);
13724 }
13725 func = newData[0];
13726 bitmask = newData[1];
13727 thisArg = newData[2];
13728 partials = newData[3];
13729 holders = newData[4];
13730 arity = newData[9] = newData[9] === undefined
13731 ? (isBindKey ? 0 : func.length)
13732 : nativeMax(newData[9] - length, 0);
13733
13734 if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
13735 bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
13736 }
13737 if (!bitmask || bitmask == WRAP_BIND_FLAG) {
13738 var result = createBind(func, bitmask, thisArg);
13739 } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {
13740 result = createCurry(func, bitmask, arity);
13741 } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {
13742 result = createPartial(func, bitmask, thisArg, partials);
13743 } else {
13744 result = createHybrid.apply(undefined, newData);
13745 }
13746 var setter = data ? baseSetData : setData;
13747 return setWrapToString(setter(result, newData), func, bitmask);
13748 }
13749
13750 /**
13751 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties
13752 * of source objects to the destination object for all destination properties
13753 * that resolve to `undefined`.
13754 *
13755 * @private
13756 * @param {*} objValue The destination value.
13757 * @param {*} srcValue The source value.
13758 * @param {string} key The key of the property to assign.
13759 * @param {Object} object The parent object of `objValue`.
13760 * @returns {*} Returns the value to assign.
13761 */
13762 function customDefaultsAssignIn(objValue, srcValue, key, object) {
13763 if (objValue === undefined ||
13764 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
13765 return srcValue;
13766 }
13767 return objValue;
13768 }
13769
13770 /**
13771 * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source
13772 * objects into destination objects that are passed thru.
13773 *
13774 * @private
13775 * @param {*} objValue The destination value.
13776 * @param {*} srcValue The source value.
13777 * @param {string} key The key of the property to merge.
13778 * @param {Object} object The parent object of `objValue`.
13779 * @param {Object} source The parent object of `srcValue`.
13780 * @param {Object} [stack] Tracks traversed source values and their merged
13781 * counterparts.
13782 * @returns {*} Returns the value to assign.
13783 */
13784 function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {
13785 if (isObject(objValue) && isObject(srcValue)) {
13786 // Recursively merge objects and arrays (susceptible to call stack limits).
13787 stack.set(srcValue, objValue);
13788 baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);
13789 stack['delete'](srcValue);
13790 }
13791 return objValue;
13792 }
13793
13794 /**
13795 * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain
13796 * objects.
13797 *
13798 * @private
13799 * @param {*} value The value to inspect.
13800 * @param {string} key The key of the property to inspect.
13801 * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.
13802 */
13803 function customOmitClone(value) {
13804 return isPlainObject(value) ? undefined : value;
13805 }
13806
13807 /**
13808 * A specialized version of `baseIsEqualDeep` for arrays with support for
13809 * partial deep comparisons.
13810 *
13811 * @private
13812 * @param {Array} array The array to compare.
13813 * @param {Array} other The other array to compare.
13814 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
13815 * @param {Function} customizer The function to customize comparisons.
13816 * @param {Function} equalFunc The function to determine equivalents of values.
13817 * @param {Object} stack Tracks traversed `array` and `other` objects.
13818 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
13819 */
13820 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
13821 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
13822 arrLength = array.length,
13823 othLength = other.length;
13824
13825 if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
13826 return false;
13827 }
13828 // Assume cyclic values are equal.
13829 var stacked = stack.get(array);
13830 if (stacked && stack.get(other)) {
13831 return stacked == other;
13832 }
13833 var index = -1,
13834 result = true,
13835 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
13836
13837 stack.set(array, other);
13838 stack.set(other, array);
13839
13840 // Ignore non-index properties.
13841 while (++index < arrLength) {
13842 var arrValue = array[index],
13843 othValue = other[index];
13844
13845 if (customizer) {
13846 var compared = isPartial
13847 ? customizer(othValue, arrValue, index, other, array, stack)
13848 : customizer(arrValue, othValue, index, array, other, stack);
13849 }
13850 if (compared !== undefined) {
13851 if (compared) {
13852 continue;
13853 }
13854 result = false;
13855 break;
13856 }
13857 // Recursively compare arrays (susceptible to call stack limits).
13858 if (seen) {
13859 if (!arraySome(other, function(othValue, othIndex) {
13860 if (!cacheHas(seen, othIndex) &&
13861 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
13862 return seen.push(othIndex);
13863 }
13864 })) {
13865 result = false;
13866 break;
13867 }
13868 } else if (!(
13869 arrValue === othValue ||
13870 equalFunc(arrValue, othValue, bitmask, customizer, stack)
13871 )) {
13872 result = false;
13873 break;
13874 }
13875 }
13876 stack['delete'](array);
13877 stack['delete'](other);
13878 return result;
13879 }
13880
13881 /**
13882 * A specialized version of `baseIsEqualDeep` for comparing objects of
13883 * the same `toStringTag`.
13884 *
13885 * **Note:** This function only supports comparing values with tags of
13886 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
13887 *
13888 * @private
13889 * @param {Object} object The object to compare.
13890 * @param {Object} other The other object to compare.
13891 * @param {string} tag The `toStringTag` of the objects to compare.
13892 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
13893 * @param {Function} customizer The function to customize comparisons.
13894 * @param {Function} equalFunc The function to determine equivalents of values.
13895 * @param {Object} stack Tracks traversed `object` and `other` objects.
13896 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
13897 */
13898 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
13899 switch (tag) {
13900 case dataViewTag:
13901 if ((object.byteLength != other.byteLength) ||
13902 (object.byteOffset != other.byteOffset)) {
13903 return false;
13904 }
13905 object = object.buffer;
13906 other = other.buffer;
13907
13908 case arrayBufferTag:
13909 if ((object.byteLength != other.byteLength) ||
13910 !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
13911 return false;
13912 }
13913 return true;
13914
13915 case boolTag:
13916 case dateTag:
13917 case numberTag:
13918 // Coerce booleans to `1` or `0` and dates to milliseconds.
13919 // Invalid dates are coerced to `NaN`.
13920 return eq(+object, +other);
13921
13922 case errorTag:
13923 return object.name == other.name && object.message == other.message;
13924
13925 case regexpTag:
13926 case stringTag:
13927 // Coerce regexes to strings and treat strings, primitives and objects,
13928 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
13929 // for more details.
13930 return object == (other + '');
13931
13932 case mapTag:
13933 var convert = mapToArray;
13934
13935 case setTag:
13936 var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
13937 convert || (convert = setToArray);
13938
13939 if (object.size != other.size && !isPartial) {
13940 return false;
13941 }
13942 // Assume cyclic values are equal.
13943 var stacked = stack.get(object);
13944 if (stacked) {
13945 return stacked == other;
13946 }
13947 bitmask |= COMPARE_UNORDERED_FLAG;
13948
13949 // Recursively compare objects (susceptible to call stack limits).
13950 stack.set(object, other);
13951 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
13952 stack['delete'](object);
13953 return result;
13954
13955 case symbolTag:
13956 if (symbolValueOf) {
13957 return symbolValueOf.call(object) == symbolValueOf.call(other);
13958 }
13959 }
13960 return false;
13961 }
13962
13963 /**
13964 * A specialized version of `baseIsEqualDeep` for objects with support for
13965 * partial deep comparisons.
13966 *
13967 * @private
13968 * @param {Object} object The object to compare.
13969 * @param {Object} other The other object to compare.
13970 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
13971 * @param {Function} customizer The function to customize comparisons.
13972 * @param {Function} equalFunc The function to determine equivalents of values.
13973 * @param {Object} stack Tracks traversed `object` and `other` objects.
13974 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
13975 */
13976 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
13977 var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
13978 objProps = getAllKeys(object),
13979 objLength = objProps.length,
13980 othProps = getAllKeys(other),
13981 othLength = othProps.length;
13982
13983 if (objLength != othLength && !isPartial) {
13984 return false;
13985 }
13986 var index = objLength;
13987 while (index--) {
13988 var key = objProps[index];
13989 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
13990 return false;
13991 }
13992 }
13993 // Assume cyclic values are equal.
13994 var stacked = stack.get(object);
13995 if (stacked && stack.get(other)) {
13996 return stacked == other;
13997 }
13998 var result = true;
13999 stack.set(object, other);
14000 stack.set(other, object);
14001
14002 var skipCtor = isPartial;
14003 while (++index < objLength) {
14004 key = objProps[index];
14005 var objValue = object[key],
14006 othValue = other[key];
14007
14008 if (customizer) {
14009 var compared = isPartial
14010 ? customizer(othValue, objValue, key, other, object, stack)
14011 : customizer(objValue, othValue, key, object, other, stack);
14012 }
14013 // Recursively compare objects (susceptible to call stack limits).
14014 if (!(compared === undefined
14015 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
14016 : compared
14017 )) {
14018 result = false;
14019 break;
14020 }
14021 skipCtor || (skipCtor = key == 'constructor');
14022 }
14023 if (result && !skipCtor) {
14024 var objCtor = object.constructor,
14025 othCtor = other.constructor;
14026
14027 // Non `Object` object instances with different constructors are not equal.
14028 if (objCtor != othCtor &&
14029 ('constructor' in object && 'constructor' in other) &&
14030 !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
14031 typeof othCtor == 'function' && othCtor instanceof othCtor)) {
14032 result = false;
14033 }
14034 }
14035 stack['delete'](object);
14036 stack['delete'](other);
14037 return result;
14038 }
14039
14040 /**
14041 * A specialized version of `baseRest` which flattens the rest array.
14042 *
14043 * @private
14044 * @param {Function} func The function to apply a rest parameter to.
14045 * @returns {Function} Returns the new function.
14046 */
14047 function flatRest(func) {
14048 return setToString(overRest(func, undefined, flatten), func + '');
14049 }
14050
14051 /**
14052 * Creates an array of own enumerable property names and symbols of `object`.
14053 *
14054 * @private
14055 * @param {Object} object The object to query.
14056 * @returns {Array} Returns the array of property names and symbols.
14057 */
14058 function getAllKeys(object) {
14059 return baseGetAllKeys(object, keys, getSymbols);
14060 }
14061
14062 /**
14063 * Creates an array of own and inherited enumerable property names and
14064 * symbols of `object`.
14065 *
14066 * @private
14067 * @param {Object} object The object to query.
14068 * @returns {Array} Returns the array of property names and symbols.
14069 */
14070 function getAllKeysIn(object) {
14071 return baseGetAllKeys(object, keysIn, getSymbolsIn);
14072 }
14073
14074 /**
14075 * Gets metadata for `func`.
14076 *
14077 * @private
14078 * @param {Function} func The function to query.
14079 * @returns {*} Returns the metadata for `func`.
14080 */
14081 var getData = !metaMap ? noop : function(func) {
14082 return metaMap.get(func);
14083 };
14084
14085 /**
14086 * Gets the name of `func`.
14087 *
14088 * @private
14089 * @param {Function} func The function to query.
14090 * @returns {string} Returns the function name.
14091 */
14092 function getFuncName(func) {
14093 var result = (func.name + ''),
14094 array = realNames[result],
14095 length = hasOwnProperty.call(realNames, result) ? array.length : 0;
14096
14097 while (length--) {
14098 var data = array[length],
14099 otherFunc = data.func;
14100 if (otherFunc == null || otherFunc == func) {
14101 return data.name;
14102 }
14103 }
14104 return result;
14105 }
14106
14107 /**
14108 * Gets the argument placeholder value for `func`.
14109 *
14110 * @private
14111 * @param {Function} func The function to inspect.
14112 * @returns {*} Returns the placeholder value.
14113 */
14114 function getHolder(func) {
14115 var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;
14116 return object.placeholder;
14117 }
14118
14119 /**
14120 * Gets the appropriate "iteratee" function. If `_.iteratee` is customized,
14121 * this function returns the custom method, otherwise it returns `baseIteratee`.
14122 * If arguments are provided, the chosen function is invoked with them and
14123 * its result is returned.
14124 *
14125 * @private
14126 * @param {*} [value] The value to convert to an iteratee.
14127 * @param {number} [arity] The arity of the created iteratee.
14128 * @returns {Function} Returns the chosen function or its result.
14129 */
14130 function getIteratee() {
14131 var result = lodash.iteratee || iteratee;
14132 result = result === iteratee ? baseIteratee : result;
14133 return arguments.length ? result(arguments[0], arguments[1]) : result;
14134 }
14135
14136 /**
14137 * Gets the data for `map`.
14138 *
14139 * @private
14140 * @param {Object} map The map to query.
14141 * @param {string} key The reference key.
14142 * @returns {*} Returns the map data.
14143 */
14144 function getMapData(map, key) {
14145 var data = map.__data__;
14146 return isKeyable(key)
14147 ? data[typeof key == 'string' ? 'string' : 'hash']
14148 : data.map;
14149 }
14150
14151 /**
14152 * Gets the property names, values, and compare flags of `object`.
14153 *
14154 * @private
14155 * @param {Object} object The object to query.
14156 * @returns {Array} Returns the match data of `object`.
14157 */
14158 function getMatchData(object) {
14159 var result = keys(object),
14160 length = result.length;
14161
14162 while (length--) {
14163 var key = result[length],
14164 value = object[key];
14165
14166 result[length] = [key, value, isStrictComparable(value)];
14167 }
14168 return result;
14169 }
14170
14171 /**
14172 * Gets the native function at `key` of `object`.
14173 *
14174 * @private
14175 * @param {Object} object The object to query.
14176 * @param {string} key The key of the method to get.
14177 * @returns {*} Returns the function if it's native, else `undefined`.
14178 */
14179 function getNative(object, key) {
14180 var value = getValue(object, key);
14181 return baseIsNative(value) ? value : undefined;
14182 }
14183
14184 /**
14185 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
14186 *
14187 * @private
14188 * @param {*} value The value to query.
14189 * @returns {string} Returns the raw `toStringTag`.
14190 */
14191 function getRawTag(value) {
14192 var isOwn = hasOwnProperty.call(value, symToStringTag),
14193 tag = value[symToStringTag];
14194
14195 try {
14196 value[symToStringTag] = undefined;
14197 var unmasked = true;
14198 } catch (e) {}
14199
14200 var result = nativeObjectToString.call(value);
14201 if (unmasked) {
14202 if (isOwn) {
14203 value[symToStringTag] = tag;
14204 } else {
14205 delete value[symToStringTag];
14206 }
14207 }
14208 return result;
14209 }
14210
14211 /**
14212 * Creates an array of the own enumerable symbols of `object`.
14213 *
14214 * @private
14215 * @param {Object} object The object to query.
14216 * @returns {Array} Returns the array of symbols.
14217 */
14218 var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
14219 if (object == null) {
14220 return [];
14221 }
14222 object = Object(object);
14223 return arrayFilter(nativeGetSymbols(object), function(symbol) {
14224 return propertyIsEnumerable.call(object, symbol);
14225 });
14226 };
14227
14228 /**
14229 * Creates an array of the own and inherited enumerable symbols of `object`.
14230 *
14231 * @private
14232 * @param {Object} object The object to query.
14233 * @returns {Array} Returns the array of symbols.
14234 */
14235 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {
14236 var result = [];
14237 while (object) {
14238 arrayPush(result, getSymbols(object));
14239 object = getPrototype(object);
14240 }
14241 return result;
14242 };
14243
14244 /**
14245 * Gets the `toStringTag` of `value`.
14246 *
14247 * @private
14248 * @param {*} value The value to query.
14249 * @returns {string} Returns the `toStringTag`.
14250 */
14251 var getTag = baseGetTag;
14252
14253 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
14254 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
14255 (Map && getTag(new Map) != mapTag) ||
14256 (Promise && getTag(Promise.resolve()) != promiseTag) ||
14257 (Set && getTag(new Set) != setTag) ||
14258 (WeakMap && getTag(new WeakMap) != weakMapTag)) {
14259 getTag = function(value) {
14260 var result = baseGetTag(value),
14261 Ctor = result == objectTag ? value.constructor : undefined,
14262 ctorString = Ctor ? toSource(Ctor) : '';
14263
14264 if (ctorString) {
14265 switch (ctorString) {
14266 case dataViewCtorString: return dataViewTag;
14267 case mapCtorString: return mapTag;
14268 case promiseCtorString: return promiseTag;
14269 case setCtorString: return setTag;
14270 case weakMapCtorString: return weakMapTag;
14271 }
14272 }
14273 return result;
14274 };
14275 }
14276
14277 /**
14278 * Gets the view, applying any `transforms` to the `start` and `end` positions.
14279 *
14280 * @private
14281 * @param {number} start The start of the view.
14282 * @param {number} end The end of the view.
14283 * @param {Array} transforms The transformations to apply to the view.
14284 * @returns {Object} Returns an object containing the `start` and `end`
14285 * positions of the view.
14286 */
14287 function getView(start, end, transforms) {
14288 var index = -1,
14289 length = transforms.length;
14290
14291 while (++index < length) {
14292 var data = transforms[index],
14293 size = data.size;
14294
14295 switch (data.type) {
14296 case 'drop': start += size; break;
14297 case 'dropRight': end -= size; break;
14298 case 'take': end = nativeMin(end, start + size); break;
14299 case 'takeRight': start = nativeMax(start, end - size); break;
14300 }
14301 }
14302 return { 'start': start, 'end': end };
14303 }
14304
14305 /**
14306 * Extracts wrapper details from the `source` body comment.
14307 *
14308 * @private
14309 * @param {string} source The source to inspect.
14310 * @returns {Array} Returns the wrapper details.
14311 */
14312 function getWrapDetails(source) {
14313 var match = source.match(reWrapDetails);
14314 return match ? match[1].split(reSplitDetails) : [];
14315 }
14316
14317 /**
14318 * Checks if `path` exists on `object`.
14319 *
14320 * @private
14321 * @param {Object} object The object to query.
14322 * @param {Array|string} path The path to check.
14323 * @param {Function} hasFunc The function to check properties.
14324 * @returns {boolean} Returns `true` if `path` exists, else `false`.
14325 */
14326 function hasPath(object, path, hasFunc) {
14327 path = castPath(path, object);
14328
14329 var index = -1,
14330 length = path.length,
14331 result = false;
14332
14333 while (++index < length) {
14334 var key = toKey(path[index]);
14335 if (!(result = object != null && hasFunc(object, key))) {
14336 break;
14337 }
14338 object = object[key];
14339 }
14340 if (result || ++index != length) {
14341 return result;
14342 }
14343 length = object == null ? 0 : object.length;
14344 return !!length && isLength(length) && isIndex(key, length) &&
14345 (isArray(object) || isArguments(object));
14346 }
14347
14348 /**
14349 * Initializes an array clone.
14350 *
14351 * @private
14352 * @param {Array} array The array to clone.
14353 * @returns {Array} Returns the initialized clone.
14354 */
14355 function initCloneArray(array) {
14356 var length = array.length,
14357 result = new array.constructor(length);
14358
14359 // Add properties assigned by `RegExp#exec`.
14360 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
14361 result.index = array.index;
14362 result.input = array.input;
14363 }
14364 return result;
14365 }
14366
14367 /**
14368 * Initializes an object clone.
14369 *
14370 * @private
14371 * @param {Object} object The object to clone.
14372 * @returns {Object} Returns the initialized clone.
14373 */
14374 function initCloneObject(object) {
14375 return (typeof object.constructor == 'function' && !isPrototype(object))
14376 ? baseCreate(getPrototype(object))
14377 : {};
14378 }
14379
14380 /**
14381 * Initializes an object clone based on its `toStringTag`.
14382 *
14383 * **Note:** This function only supports cloning values with tags of
14384 * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
14385 *
14386 * @private
14387 * @param {Object} object The object to clone.
14388 * @param {string} tag The `toStringTag` of the object to clone.
14389 * @param {boolean} [isDeep] Specify a deep clone.
14390 * @returns {Object} Returns the initialized clone.
14391 */
14392 function initCloneByTag(object, tag, isDeep) {
14393 var Ctor = object.constructor;
14394 switch (tag) {
14395 case arrayBufferTag:
14396 return cloneArrayBuffer(object);
14397
14398 case boolTag:
14399 case dateTag:
14400 return new Ctor(+object);
14401
14402 case dataViewTag:
14403 return cloneDataView(object, isDeep);
14404
14405 case float32Tag: case float64Tag:
14406 case int8Tag: case int16Tag: case int32Tag:
14407 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
14408 return cloneTypedArray(object, isDeep);
14409
14410 case mapTag:
14411 return new Ctor;
14412
14413 case numberTag:
14414 case stringTag:
14415 return new Ctor(object);
14416
14417 case regexpTag:
14418 return cloneRegExp(object);
14419
14420 case setTag:
14421 return new Ctor;
14422
14423 case symbolTag:
14424 return cloneSymbol(object);
14425 }
14426 }
14427
14428 /**
14429 * Inserts wrapper `details` in a comment at the top of the `source` body.
14430 *
14431 * @private
14432 * @param {string} source The source to modify.
14433 * @returns {Array} details The details to insert.
14434 * @returns {string} Returns the modified source.
14435 */
14436 function insertWrapDetails(source, details) {
14437 var length = details.length;
14438 if (!length) {
14439 return source;
14440 }
14441 var lastIndex = length - 1;
14442 details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];
14443 details = details.join(length > 2 ? ', ' : ' ');
14444 return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n');
14445 }
14446
14447 /**
14448 * Checks if `value` is a flattenable `arguments` object or array.
14449 *
14450 * @private
14451 * @param {*} value The value to check.
14452 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.
14453 */
14454 function isFlattenable(value) {
14455 return isArray(value) || isArguments(value) ||
14456 !!(spreadableSymbol && value && value[spreadableSymbol]);
14457 }
14458
14459 /**
14460 * Checks if `value` is a valid array-like index.
14461 *
14462 * @private
14463 * @param {*} value The value to check.
14464 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
14465 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
14466 */
14467 function isIndex(value, length) {
14468 var type = typeof value;
14469 length = length == null ? MAX_SAFE_INTEGER : length;
14470
14471 return !!length &&
14472 (type == 'number' ||
14473 (type != 'symbol' && reIsUint.test(value))) &&
14474 (value > -1 && value % 1 == 0 && value < length);
14475 }
14476
14477 /**
14478 * Checks if the given arguments are from an iteratee call.
14479 *
14480 * @private
14481 * @param {*} value The potential iteratee value argument.
14482 * @param {*} index The potential iteratee index or key argument.
14483 * @param {*} object The potential iteratee object argument.
14484 * @returns {boolean} Returns `true` if the arguments are from an iteratee call,
14485 * else `false`.
14486 */
14487 function isIterateeCall(value, index, object) {
14488 if (!isObject(object)) {
14489 return false;
14490 }
14491 var type = typeof index;
14492 if (type == 'number'
14493 ? (isArrayLike(object) && isIndex(index, object.length))
14494 : (type == 'string' && index in object)
14495 ) {
14496 return eq(object[index], value);
14497 }
14498 return false;
14499 }
14500
14501 /**
14502 * Checks if `value` is a property name and not a property path.
14503 *
14504 * @private
14505 * @param {*} value The value to check.
14506 * @param {Object} [object] The object to query keys on.
14507 * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
14508 */
14509 function isKey(value, object) {
14510 if (isArray(value)) {
14511 return false;
14512 }
14513 var type = typeof value;
14514 if (type == 'number' || type == 'symbol' || type == 'boolean' ||
14515 value == null || isSymbol(value)) {
14516 return true;
14517 }
14518 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
14519 (object != null && value in Object(object));
14520 }
14521
14522 /**
14523 * Checks if `value` is suitable for use as unique object key.
14524 *
14525 * @private
14526 * @param {*} value The value to check.
14527 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
14528 */
14529 function isKeyable(value) {
14530 var type = typeof value;
14531 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
14532 ? (value !== '__proto__')
14533 : (value === null);
14534 }
14535
14536 /**
14537 * Checks if `func` has a lazy counterpart.
14538 *
14539 * @private
14540 * @param {Function} func The function to check.
14541 * @returns {boolean} Returns `true` if `func` has a lazy counterpart,
14542 * else `false`.
14543 */
14544 function isLaziable(func) {
14545 var funcName = getFuncName(func),
14546 other = lodash[funcName];
14547
14548 if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
14549 return false;
14550 }
14551 if (func === other) {
14552 return true;
14553 }
14554 var data = getData(other);
14555 return !!data && func === data[0];
14556 }
14557
14558 /**
14559 * Checks if `func` has its source masked.
14560 *
14561 * @private
14562 * @param {Function} func The function to check.
14563 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
14564 */
14565 function isMasked(func) {
14566 return !!maskSrcKey && (maskSrcKey in func);
14567 }
14568
14569 /**
14570 * Checks if `func` is capable of being masked.
14571 *
14572 * @private
14573 * @param {*} value The value to check.
14574 * @returns {boolean} Returns `true` if `func` is maskable, else `false`.
14575 */
14576 var isMaskable = coreJsData ? isFunction : stubFalse;
14577
14578 /**
14579 * Checks if `value` is likely a prototype object.
14580 *
14581 * @private
14582 * @param {*} value The value to check.
14583 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
14584 */
14585 function isPrototype(value) {
14586 var Ctor = value && value.constructor,
14587 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
14588
14589 return value === proto;
14590 }
14591
14592 /**
14593 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
14594 *
14595 * @private
14596 * @param {*} value The value to check.
14597 * @returns {boolean} Returns `true` if `value` if suitable for strict
14598 * equality comparisons, else `false`.
14599 */
14600 function isStrictComparable(value) {
14601 return value === value && !isObject(value);
14602 }
14603
14604 /**
14605 * A specialized version of `matchesProperty` for source values suitable
14606 * for strict equality comparisons, i.e. `===`.
14607 *
14608 * @private
14609 * @param {string} key The key of the property to get.
14610 * @param {*} srcValue The value to match.
14611 * @returns {Function} Returns the new spec function.
14612 */
14613 function matchesStrictComparable(key, srcValue) {
14614 return function(object) {
14615 if (object == null) {
14616 return false;
14617 }
14618 return object[key] === srcValue &&
14619 (srcValue !== undefined || (key in Object(object)));
14620 };
14621 }
14622
14623 /**
14624 * A specialized version of `_.memoize` which clears the memoized function's
14625 * cache when it exceeds `MAX_MEMOIZE_SIZE`.
14626 *
14627 * @private
14628 * @param {Function} func The function to have its output memoized.
14629 * @returns {Function} Returns the new memoized function.
14630 */
14631 function memoizeCapped(func) {
14632 var result = memoize(func, function(key) {
14633 if (cache.size === MAX_MEMOIZE_SIZE) {
14634 cache.clear();
14635 }
14636 return key;
14637 });
14638
14639 var cache = result.cache;
14640 return result;
14641 }
14642
14643 /**
14644 * Merges the function metadata of `source` into `data`.
14645 *
14646 * Merging metadata reduces the number of wrappers used to invoke a function.
14647 * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
14648 * may be applied regardless of execution order. Methods like `_.ary` and
14649 * `_.rearg` modify function arguments, making the order in which they are
14650 * executed important, preventing the merging of metadata. However, we make
14651 * an exception for a safe combined case where curried functions have `_.ary`
14652 * and or `_.rearg` applied.
14653 *
14654 * @private
14655 * @param {Array} data The destination metadata.
14656 * @param {Array} source The source metadata.
14657 * @returns {Array} Returns `data`.
14658 */
14659 function mergeData(data, source) {
14660 var bitmask = data[1],
14661 srcBitmask = source[1],
14662 newBitmask = bitmask | srcBitmask,
14663 isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);
14664
14665 var isCombo =
14666 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||
14667 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||
14668 ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));
14669
14670 // Exit early if metadata can't be merged.
14671 if (!(isCommon || isCombo)) {
14672 return data;
14673 }
14674 // Use source `thisArg` if available.
14675 if (srcBitmask & WRAP_BIND_FLAG) {
14676 data[2] = source[2];
14677 // Set when currying a bound function.
14678 newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;
14679 }
14680 // Compose partial arguments.
14681 var value = source[3];
14682 if (value) {
14683 var partials = data[3];
14684 data[3] = partials ? composeArgs(partials, value, source[4]) : value;
14685 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];
14686 }
14687 // Compose partial right arguments.
14688 value = source[5];
14689 if (value) {
14690 partials = data[5];
14691 data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;
14692 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];
14693 }
14694 // Use source `argPos` if available.
14695 value = source[7];
14696 if (value) {
14697 data[7] = value;
14698 }
14699 // Use source `ary` if it's smaller.
14700 if (srcBitmask & WRAP_ARY_FLAG) {
14701 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
14702 }
14703 // Use source `arity` if one is not provided.
14704 if (data[9] == null) {
14705 data[9] = source[9];
14706 }
14707 // Use source `func` and merge bitmasks.
14708 data[0] = source[0];
14709 data[1] = newBitmask;
14710
14711 return data;
14712 }
14713
14714 /**
14715 * This function is like
14716 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
14717 * except that it includes inherited enumerable properties.
14718 *
14719 * @private
14720 * @param {Object} object The object to query.
14721 * @returns {Array} Returns the array of property names.
14722 */
14723 function nativeKeysIn(object) {
14724 var result = [];
14725 if (object != null) {
14726 for (var key in Object(object)) {
14727 result.push(key);
14728 }
14729 }
14730 return result;
14731 }
14732
14733 /**
14734 * Converts `value` to a string using `Object.prototype.toString`.
14735 *
14736 * @private
14737 * @param {*} value The value to convert.
14738 * @returns {string} Returns the converted string.
14739 */
14740 function objectToString(value) {
14741 return nativeObjectToString.call(value);
14742 }
14743
14744 /**
14745 * A specialized version of `baseRest` which transforms the rest array.
14746 *
14747 * @private
14748 * @param {Function} func The function to apply a rest parameter to.
14749 * @param {number} [start=func.length-1] The start position of the rest parameter.
14750 * @param {Function} transform The rest array transform.
14751 * @returns {Function} Returns the new function.
14752 */
14753 function overRest(func, start, transform) {
14754 start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
14755 return function() {
14756 var args = arguments,
14757 index = -1,
14758 length = nativeMax(args.length - start, 0),
14759 array = Array(length);
14760
14761 while (++index < length) {
14762 array[index] = args[start + index];
14763 }
14764 index = -1;
14765 var otherArgs = Array(start + 1);
14766 while (++index < start) {
14767 otherArgs[index] = args[index];
14768 }
14769 otherArgs[start] = transform(array);
14770 return apply(func, this, otherArgs);
14771 };
14772 }
14773
14774 /**
14775 * Gets the parent value at `path` of `object`.
14776 *
14777 * @private
14778 * @param {Object} object The object to query.
14779 * @param {Array} path The path to get the parent value of.
14780 * @returns {*} Returns the parent value.
14781 */
14782 function parent(object, path) {
14783 return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
14784 }
14785
14786 /**
14787 * Reorder `array` according to the specified indexes where the element at
14788 * the first index is assigned as the first element, the element at
14789 * the second index is assigned as the second element, and so on.
14790 *
14791 * @private
14792 * @param {Array} array The array to reorder.
14793 * @param {Array} indexes The arranged array indexes.
14794 * @returns {Array} Returns `array`.
14795 */
14796 function reorder(array, indexes) {
14797 var arrLength = array.length,
14798 length = nativeMin(indexes.length, arrLength),
14799 oldArray = copyArray(array);
14800
14801 while (length--) {
14802 var index = indexes[length];
14803 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
14804 }
14805 return array;
14806 }
14807
14808 /**
14809 * Sets metadata for `func`.
14810 *
14811 * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
14812 * period of time, it will trip its breaker and transition to an identity
14813 * function to avoid garbage collection pauses in V8. See
14814 * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)
14815 * for more details.
14816 *
14817 * @private
14818 * @param {Function} func The function to associate metadata with.
14819 * @param {*} data The metadata.
14820 * @returns {Function} Returns `func`.
14821 */
14822 var setData = shortOut(baseSetData);
14823
14824 /**
14825 * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).
14826 *
14827 * @private
14828 * @param {Function} func The function to delay.
14829 * @param {number} wait The number of milliseconds to delay invocation.
14830 * @returns {number|Object} Returns the timer id or timeout object.
14831 */
14832 var setTimeout = ctxSetTimeout || function(func, wait) {
14833 return root.setTimeout(func, wait);
14834 };
14835
14836 /**
14837 * Sets the `toString` method of `func` to return `string`.
14838 *
14839 * @private
14840 * @param {Function} func The function to modify.
14841 * @param {Function} string The `toString` result.
14842 * @returns {Function} Returns `func`.
14843 */
14844 var setToString = shortOut(baseSetToString);
14845
14846 /**
14847 * Sets the `toString` method of `wrapper` to mimic the source of `reference`
14848 * with wrapper details in a comment at the top of the source body.
14849 *
14850 * @private
14851 * @param {Function} wrapper The function to modify.
14852 * @param {Function} reference The reference function.
14853 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
14854 * @returns {Function} Returns `wrapper`.
14855 */
14856 function setWrapToString(wrapper, reference, bitmask) {
14857 var source = (reference + '');
14858 return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));
14859 }
14860
14861 /**
14862 * Creates a function that'll short out and invoke `identity` instead
14863 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
14864 * milliseconds.
14865 *
14866 * @private
14867 * @param {Function} func The function to restrict.
14868 * @returns {Function} Returns the new shortable function.
14869 */
14870 function shortOut(func) {
14871 var count = 0,
14872 lastCalled = 0;
14873
14874 return function() {
14875 var stamp = nativeNow(),
14876 remaining = HOT_SPAN - (stamp - lastCalled);
14877
14878 lastCalled = stamp;
14879 if (remaining > 0) {
14880 if (++count >= HOT_COUNT) {
14881 return arguments[0];
14882 }
14883 } else {
14884 count = 0;
14885 }
14886 return func.apply(undefined, arguments);
14887 };
14888 }
14889
14890 /**
14891 * A specialized version of `_.shuffle` which mutates and sets the size of `array`.
14892 *
14893 * @private
14894 * @param {Array} array The array to shuffle.
14895 * @param {number} [size=array.length] The size of `array`.
14896 * @returns {Array} Returns `array`.
14897 */
14898 function shuffleSelf(array, size) {
14899 var index = -1,
14900 length = array.length,
14901 lastIndex = length - 1;
14902
14903 size = size === undefined ? length : size;
14904 while (++index < size) {
14905 var rand = baseRandom(index, lastIndex),
14906 value = array[rand];
14907
14908 array[rand] = array[index];
14909 array[index] = value;
14910 }
14911 array.length = size;
14912 return array;
14913 }
14914
14915 /**
14916 * Converts `string` to a property path array.
14917 *
14918 * @private
14919 * @param {string} string The string to convert.
14920 * @returns {Array} Returns the property path array.
14921 */
14922 var stringToPath = memoizeCapped(function(string) {
14923 var result = [];
14924 if (string.charCodeAt(0) === 46 /* . */) {
14925 result.push('');
14926 }
14927 string.replace(rePropName, function(match, number, quote, subString) {
14928 result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
14929 });
14930 return result;
14931 });
14932
14933 /**
14934 * Converts `value` to a string key if it's not a string or symbol.
14935 *
14936 * @private
14937 * @param {*} value The value to inspect.
14938 * @returns {string|symbol} Returns the key.
14939 */
14940 function toKey(value) {
14941 if (typeof value == 'string' || isSymbol(value)) {
14942 return value;
14943 }
14944 var result = (value + '');
14945 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
14946 }
14947
14948 /**
14949 * Converts `func` to its source code.
14950 *
14951 * @private
14952 * @param {Function} func The function to convert.
14953 * @returns {string} Returns the source code.
14954 */
14955 function toSource(func) {
14956 if (func != null) {
14957 try {
14958 return funcToString.call(func);
14959 } catch (e) {}
14960 try {
14961 return (func + '');
14962 } catch (e) {}
14963 }
14964 return '';
14965 }
14966
14967 /**
14968 * Updates wrapper `details` based on `bitmask` flags.
14969 *
14970 * @private
14971 * @returns {Array} details The details to modify.
14972 * @param {number} bitmask The bitmask flags. See `createWrap` for more details.
14973 * @returns {Array} Returns `details`.
14974 */
14975 function updateWrapDetails(details, bitmask) {
14976 arrayEach(wrapFlags, function(pair) {
14977 var value = '_.' + pair[0];
14978 if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {
14979 details.push(value);
14980 }
14981 });
14982 return details.sort();
14983 }
14984
14985 /**
14986 * Creates a clone of `wrapper`.
14987 *
14988 * @private
14989 * @param {Object} wrapper The wrapper to clone.
14990 * @returns {Object} Returns the cloned wrapper.
14991 */
14992 function wrapperClone(wrapper) {
14993 if (wrapper instanceof LazyWrapper) {
14994 return wrapper.clone();
14995 }
14996 var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);
14997 result.__actions__ = copyArray(wrapper.__actions__);
14998 result.__index__ = wrapper.__index__;
14999 result.__values__ = wrapper.__values__;
15000 return result;
15001 }
15002
15003 /*------------------------------------------------------------------------*/
15004
15005 /**
15006 * Creates an array of elements split into groups the length of `size`.
15007 * If `array` can't be split evenly, the final chunk will be the remaining
15008 * elements.
15009 *
15010 * @static
15011 * @memberOf _
15012 * @since 3.0.0
15013 * @category Array
15014 * @param {Array} array The array to process.
15015 * @param {number} [size=1] The length of each chunk
15016 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15017 * @returns {Array} Returns the new array of chunks.
15018 * @example
15019 *
15020 * _.chunk(['a', 'b', 'c', 'd'], 2);
15021 * // => [['a', 'b'], ['c', 'd']]
15022 *
15023 * _.chunk(['a', 'b', 'c', 'd'], 3);
15024 * // => [['a', 'b', 'c'], ['d']]
15025 */
15026 function chunk(array, size, guard) {
15027 if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {
15028 size = 1;
15029 } else {
15030 size = nativeMax(toInteger(size), 0);
15031 }
15032 var length = array == null ? 0 : array.length;
15033 if (!length || size < 1) {
15034 return [];
15035 }
15036 var index = 0,
15037 resIndex = 0,
15038 result = Array(nativeCeil(length / size));
15039
15040 while (index < length) {
15041 result[resIndex++] = baseSlice(array, index, (index += size));
15042 }
15043 return result;
15044 }
15045
15046 /**
15047 * Creates an array with all falsey values removed. The values `false`, `null`,
15048 * `0`, `""`, `undefined`, and `NaN` are falsey.
15049 *
15050 * @static
15051 * @memberOf _
15052 * @since 0.1.0
15053 * @category Array
15054 * @param {Array} array The array to compact.
15055 * @returns {Array} Returns the new array of filtered values.
15056 * @example
15057 *
15058 * _.compact([0, 1, false, 2, '', 3]);
15059 * // => [1, 2, 3]
15060 */
15061 function compact(array) {
15062 var index = -1,
15063 length = array == null ? 0 : array.length,
15064 resIndex = 0,
15065 result = [];
15066
15067 while (++index < length) {
15068 var value = array[index];
15069 if (value) {
15070 result[resIndex++] = value;
15071 }
15072 }
15073 return result;
15074 }
15075
15076 /**
15077 * Creates a new array concatenating `array` with any additional arrays
15078 * and/or values.
15079 *
15080 * @static
15081 * @memberOf _
15082 * @since 4.0.0
15083 * @category Array
15084 * @param {Array} array The array to concatenate.
15085 * @param {...*} [values] The values to concatenate.
15086 * @returns {Array} Returns the new concatenated array.
15087 * @example
15088 *
15089 * var array = [1];
15090 * var other = _.concat(array, 2, [3], [[4]]);
15091 *
15092 * console.log(other);
15093 * // => [1, 2, 3, [4]]
15094 *
15095 * console.log(array);
15096 * // => [1]
15097 */
15098 function concat() {
15099 var length = arguments.length;
15100 if (!length) {
15101 return [];
15102 }
15103 var args = Array(length - 1),
15104 array = arguments[0],
15105 index = length;
15106
15107 while (index--) {
15108 args[index - 1] = arguments[index];
15109 }
15110 return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));
15111 }
15112
15113 /**
15114 * Creates an array of `array` values not included in the other given arrays
15115 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
15116 * for equality comparisons. The order and references of result values are
15117 * determined by the first array.
15118 *
15119 * **Note:** Unlike `_.pullAll`, this method returns a new array.
15120 *
15121 * @static
15122 * @memberOf _
15123 * @since 0.1.0
15124 * @category Array
15125 * @param {Array} array The array to inspect.
15126 * @param {...Array} [values] The values to exclude.
15127 * @returns {Array} Returns the new array of filtered values.
15128 * @see _.without, _.xor
15129 * @example
15130 *
15131 * _.difference([2, 1], [2, 3]);
15132 * // => [1]
15133 */
15134 var difference = baseRest(function(array, values) {
15135 return isArrayLikeObject(array)
15136 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))
15137 : [];
15138 });
15139
15140 /**
15141 * This method is like `_.difference` except that it accepts `iteratee` which
15142 * is invoked for each element of `array` and `values` to generate the criterion
15143 * by which they're compared. The order and references of result values are
15144 * determined by the first array. The iteratee is invoked with one argument:
15145 * (value).
15146 *
15147 * **Note:** Unlike `_.pullAllBy`, this method returns a new array.
15148 *
15149 * @static
15150 * @memberOf _
15151 * @since 4.0.0
15152 * @category Array
15153 * @param {Array} array The array to inspect.
15154 * @param {...Array} [values] The values to exclude.
15155 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
15156 * @returns {Array} Returns the new array of filtered values.
15157 * @example
15158 *
15159 * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);
15160 * // => [1.2]
15161 *
15162 * // The `_.property` iteratee shorthand.
15163 * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');
15164 * // => [{ 'x': 2 }]
15165 */
15166 var differenceBy = baseRest(function(array, values) {
15167 var iteratee = last(values);
15168 if (isArrayLikeObject(iteratee)) {
15169 iteratee = undefined;
15170 }
15171 return isArrayLikeObject(array)
15172 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))
15173 : [];
15174 });
15175
15176 /**
15177 * This method is like `_.difference` except that it accepts `comparator`
15178 * which is invoked to compare elements of `array` to `values`. The order and
15179 * references of result values are determined by the first array. The comparator
15180 * is invoked with two arguments: (arrVal, othVal).
15181 *
15182 * **Note:** Unlike `_.pullAllWith`, this method returns a new array.
15183 *
15184 * @static
15185 * @memberOf _
15186 * @since 4.0.0
15187 * @category Array
15188 * @param {Array} array The array to inspect.
15189 * @param {...Array} [values] The values to exclude.
15190 * @param {Function} [comparator] The comparator invoked per element.
15191 * @returns {Array} Returns the new array of filtered values.
15192 * @example
15193 *
15194 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
15195 *
15196 * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);
15197 * // => [{ 'x': 2, 'y': 1 }]
15198 */
15199 var differenceWith = baseRest(function(array, values) {
15200 var comparator = last(values);
15201 if (isArrayLikeObject(comparator)) {
15202 comparator = undefined;
15203 }
15204 return isArrayLikeObject(array)
15205 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)
15206 : [];
15207 });
15208
15209 /**
15210 * Creates a slice of `array` with `n` elements dropped from the beginning.
15211 *
15212 * @static
15213 * @memberOf _
15214 * @since 0.5.0
15215 * @category Array
15216 * @param {Array} array The array to query.
15217 * @param {number} [n=1] The number of elements to drop.
15218 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15219 * @returns {Array} Returns the slice of `array`.
15220 * @example
15221 *
15222 * _.drop([1, 2, 3]);
15223 * // => [2, 3]
15224 *
15225 * _.drop([1, 2, 3], 2);
15226 * // => [3]
15227 *
15228 * _.drop([1, 2, 3], 5);
15229 * // => []
15230 *
15231 * _.drop([1, 2, 3], 0);
15232 * // => [1, 2, 3]
15233 */
15234 function drop(array, n, guard) {
15235 var length = array == null ? 0 : array.length;
15236 if (!length) {
15237 return [];
15238 }
15239 n = (guard || n === undefined) ? 1 : toInteger(n);
15240 return baseSlice(array, n < 0 ? 0 : n, length);
15241 }
15242
15243 /**
15244 * Creates a slice of `array` with `n` elements dropped from the end.
15245 *
15246 * @static
15247 * @memberOf _
15248 * @since 3.0.0
15249 * @category Array
15250 * @param {Array} array The array to query.
15251 * @param {number} [n=1] The number of elements to drop.
15252 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
15253 * @returns {Array} Returns the slice of `array`.
15254 * @example
15255 *
15256 * _.dropRight([1, 2, 3]);
15257 * // => [1, 2]
15258 *
15259 * _.dropRight([1, 2, 3], 2);
15260 * // => [1]
15261 *
15262 * _.dropRight([1, 2, 3], 5);
15263 * // => []
15264 *
15265 * _.dropRight([1, 2, 3], 0);
15266 * // => [1, 2, 3]
15267 */
15268 function dropRight(array, n, guard) {
15269 var length = array == null ? 0 : array.length;
15270 if (!length) {
15271 return [];
15272 }
15273 n = (guard || n === undefined) ? 1 : toInteger(n);
15274 n = length - n;
15275 return baseSlice(array, 0, n < 0 ? 0 : n);
15276 }
15277
15278 /**
15279 * Creates a slice of `array` excluding elements dropped from the end.
15280 * Elements are dropped until `predicate` returns falsey. The predicate is
15281 * invoked with three arguments: (value, index, array).
15282 *
15283 * @static
15284 * @memberOf _
15285 * @since 3.0.0
15286 * @category Array
15287 * @param {Array} array The array to query.
15288 * @param {Function} [predicate=_.identity] The function invoked per iteration.
15289 * @returns {Array} Returns the slice of `array`.
15290 * @example
15291 *
15292 * var users = [
15293 * { 'user': 'barney', 'active': true },
15294 * { 'user': 'fred', 'active': false },
15295 * { 'user': 'pebbles', 'active': false }
15296 * ];
15297 *
15298 * _.dropRightWhile(users, function(o) { return !o.active; });
15299 * // => objects for ['barney']
15300 *
15301 * // The `_.matches` iteratee shorthand.
15302 * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });
15303 * // => objects for ['barney', 'fred']
15304 *
15305 * // The `_.matchesProperty` iteratee shorthand.
15306 * _.dropRightWhile(users, ['active', false]);
15307 * // => objects for ['barney']
15308 *
15309 * // The `_.property` iteratee shorthand.
15310 * _.dropRightWhile(users, 'active');
15311 * // => objects for ['barney', 'fred', 'pebbles']
15312 */
15313 function dropRightWhile(array, predicate) {
15314 return (array && array.length)
15315 ? baseWhile(array, getIteratee(predicate, 3), true, true)
15316 : [];
15317 }
15318
15319 /**
15320 * Creates a slice of `array` excluding elements dropped from the beginning.
15321 * Elements are dropped until `predicate` returns falsey. The predicate is
15322 * invoked with three arguments: (value, index, array).
15323 *
15324 * @static
15325 * @memberOf _
15326 * @since 3.0.0
15327 * @category Array
15328 * @param {Array} array The array to query.
15329 * @param {Function} [predicate=_.identity] The function invoked per iteration.
15330 * @returns {Array} Returns the slice of `array`.
15331 * @example
15332 *
15333 * var users = [
15334 * { 'user': 'barney', 'active': false },
15335 * { 'user': 'fred', 'active': false },
15336 * { 'user': 'pebbles', 'active': true }
15337 * ];
15338 *
15339 * _.dropWhile(users, function(o) { return !o.active; });
15340 * // => objects for ['pebbles']
15341 *
15342 * // The `_.matches` iteratee shorthand.
15343 * _.dropWhile(users, { 'user': 'barney', 'active': false });
15344 * // => objects for ['fred', 'pebbles']
15345 *
15346 * // The `_.matchesProperty` iteratee shorthand.
15347 * _.dropWhile(users, ['active', false]);
15348 * // => objects for ['pebbles']
15349 *
15350 * // The `_.property` iteratee shorthand.
15351 * _.dropWhile(users, 'active');
15352 * // => objects for ['barney', 'fred', 'pebbles']
15353 */
15354 function dropWhile(array, predicate) {
15355 return (array && array.length)
15356 ? baseWhile(array, getIteratee(predicate, 3), true)
15357 : [];
15358 }
15359
15360 /**
15361 * Fills elements of `array` with `value` from `start` up to, but not
15362 * including, `end`.
15363 *
15364 * **Note:** This method mutates `array`.
15365 *
15366 * @static
15367 * @memberOf _
15368 * @since 3.2.0
15369 * @category Array
15370 * @param {Array} array The array to fill.
15371 * @param {*} value The value to fill `array` with.
15372 * @param {number} [start=0] The start position.
15373 * @param {number} [end=array.length] The end position.
15374 * @returns {Array} Returns `array`.
15375 * @example
15376 *
15377 * var array = [1, 2, 3];
15378 *
15379 * _.fill(array, 'a');
15380 * console.log(array);
15381 * // => ['a', 'a', 'a']
15382 *
15383 * _.fill(Array(3), 2);
15384 * // => [2, 2, 2]
15385 *
15386 * _.fill([4, 6, 8, 10], '*', 1, 3);
15387 * // => [4, '*', '*', 10]
15388 */
15389 function fill(array, value, start, end) {
15390 var length = array == null ? 0 : array.length;
15391 if (!length) {
15392 return [];
15393 }
15394 if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
15395 start = 0;
15396 end = length;
15397 }
15398 return baseFill(array, value, start, end);
15399 }
15400
15401 /**
15402 * This method is like `_.find` except that it returns the index of the first
15403 * element `predicate` returns truthy for instead of the element itself.
15404 *
15405 * @static
15406 * @memberOf _
15407 * @since 1.1.0
15408 * @category Array
15409 * @param {Array} array The array to inspect.
15410 * @param {Function} [predicate=_.identity] The function invoked per iteration.
15411 * @param {number} [fromIndex=0] The index to search from.
15412 * @returns {number} Returns the index of the found element, else `-1`.
15413 * @example
15414 *
15415 * var users = [
15416 * { 'user': 'barney', 'active': false },
15417 * { 'user': 'fred', 'active': false },
15418 * { 'user': 'pebbles', 'active': true }
15419 * ];
15420 *
15421 * _.findIndex(users, function(o) { return o.user == 'barney'; });
15422 * // => 0
15423 *
15424 * // The `_.matches` iteratee shorthand.
15425 * _.findIndex(users, { 'user': 'fred', 'active': false });
15426 * // => 1
15427 *
15428 * // The `_.matchesProperty` iteratee shorthand.
15429 * _.findIndex(users, ['active', false]);
15430 * // => 0
15431 *
15432 * // The `_.property` iteratee shorthand.
15433 * _.findIndex(users, 'active');
15434 * // => 2
15435 */
15436 function findIndex(array, predicate, fromIndex) {
15437 var length = array == null ? 0 : array.length;
15438 if (!length) {
15439 return -1;
15440 }
15441 var index = fromIndex == null ? 0 : toInteger(fromIndex);
15442 if (index < 0) {
15443 index = nativeMax(length + index, 0);
15444 }
15445 return baseFindIndex(array, getIteratee(predicate, 3), index);
15446 }
15447
15448 /**
15449 * This method is like `_.findIndex` except that it iterates over elements
15450 * of `collection` from right to left.
15451 *
15452 * @static
15453 * @memberOf _
15454 * @since 2.0.0
15455 * @category Array
15456 * @param {Array} array The array to inspect.
15457 * @param {Function} [predicate=_.identity] The function invoked per iteration.
15458 * @param {number} [fromIndex=array.length-1] The index to search from.
15459 * @returns {number} Returns the index of the found element, else `-1`.
15460 * @example
15461 *
15462 * var users = [
15463 * { 'user': 'barney', 'active': true },
15464 * { 'user': 'fred', 'active': false },
15465 * { 'user': 'pebbles', 'active': false }
15466 * ];
15467 *
15468 * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });
15469 * // => 2
15470 *
15471 * // The `_.matches` iteratee shorthand.
15472 * _.findLastIndex(users, { 'user': 'barney', 'active': true });
15473 * // => 0
15474 *
15475 * // The `_.matchesProperty` iteratee shorthand.
15476 * _.findLastIndex(users, ['active', false]);
15477 * // => 2
15478 *
15479 * // The `_.property` iteratee shorthand.
15480 * _.findLastIndex(users, 'active');
15481 * // => 0
15482 */
15483 function findLastIndex(array, predicate, fromIndex) {
15484 var length = array == null ? 0 : array.length;
15485 if (!length) {
15486 return -1;
15487 }
15488 var index = length - 1;
15489 if (fromIndex !== undefined) {
15490 index = toInteger(fromIndex);
15491 index = fromIndex < 0
15492 ? nativeMax(length + index, 0)
15493 : nativeMin(index, length - 1);
15494 }
15495 return baseFindIndex(array, getIteratee(predicate, 3), index, true);
15496 }
15497
15498 /**
15499 * Flattens `array` a single level deep.
15500 *
15501 * @static
15502 * @memberOf _
15503 * @since 0.1.0
15504 * @category Array
15505 * @param {Array} array The array to flatten.
15506 * @returns {Array} Returns the new flattened array.
15507 * @example
15508 *
15509 * _.flatten([1, [2, [3, [4]], 5]]);
15510 * // => [1, 2, [3, [4]], 5]
15511 */
15512 function flatten(array) {
15513 var length = array == null ? 0 : array.length;
15514 return length ? baseFlatten(array, 1) : [];
15515 }
15516
15517 /**
15518 * Recursively flattens `array`.
15519 *
15520 * @static
15521 * @memberOf _
15522 * @since 3.0.0
15523 * @category Array
15524 * @param {Array} array The array to flatten.
15525 * @returns {Array} Returns the new flattened array.
15526 * @example
15527 *
15528 * _.flattenDeep([1, [2, [3, [4]], 5]]);
15529 * // => [1, 2, 3, 4, 5]
15530 */
15531 function flattenDeep(array) {
15532 var length = array == null ? 0 : array.length;
15533 return length ? baseFlatten(array, INFINITY) : [];
15534 }
15535
15536 /**
15537 * Recursively flatten `array` up to `depth` times.
15538 *
15539 * @static
15540 * @memberOf _
15541 * @since 4.4.0
15542 * @category Array
15543 * @param {Array} array The array to flatten.
15544 * @param {number} [depth=1] The maximum recursion depth.
15545 * @returns {Array} Returns the new flattened array.
15546 * @example
15547 *
15548 * var array = [1, [2, [3, [4]], 5]];
15549 *
15550 * _.flattenDepth(array, 1);
15551 * // => [1, 2, [3, [4]], 5]
15552 *
15553 * _.flattenDepth(array, 2);
15554 * // => [1, 2, 3, [4], 5]
15555 */
15556 function flattenDepth(array, depth) {
15557 var length = array == null ? 0 : array.length;
15558 if (!length) {
15559 return [];
15560 }
15561 depth = depth === undefined ? 1 : toInteger(depth);
15562 return baseFlatten(array, depth);
15563 }
15564
15565 /**
15566 * The inverse of `_.toPairs`; this method returns an object composed
15567 * from key-value `pairs`.
15568 *
15569 * @static
15570 * @memberOf _
15571 * @since 4.0.0
15572 * @category Array
15573 * @param {Array} pairs The key-value pairs.
15574 * @returns {Object} Returns the new object.
15575 * @example
15576 *
15577 * _.fromPairs([['a', 1], ['b', 2]]);
15578 * // => { 'a': 1, 'b': 2 }
15579 */
15580 function fromPairs(pairs) {
15581 var index = -1,
15582 length = pairs == null ? 0 : pairs.length,
15583 result = {};
15584
15585 while (++index < length) {
15586 var pair = pairs[index];
15587 result[pair[0]] = pair[1];
15588 }
15589 return result;
15590 }
15591
15592 /**
15593 * Gets the first element of `array`.
15594 *
15595 * @static
15596 * @memberOf _
15597 * @since 0.1.0
15598 * @alias first
15599 * @category Array
15600 * @param {Array} array The array to query.
15601 * @returns {*} Returns the first element of `array`.
15602 * @example
15603 *
15604 * _.head([1, 2, 3]);
15605 * // => 1
15606 *
15607 * _.head([]);
15608 * // => undefined
15609 */
15610 function head(array) {
15611 return (array && array.length) ? array[0] : undefined;
15612 }
15613
15614 /**
15615 * Gets the index at which the first occurrence of `value` is found in `array`
15616 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
15617 * for equality comparisons. If `fromIndex` is negative, it's used as the
15618 * offset from the end of `array`.
15619 *
15620 * @static
15621 * @memberOf _
15622 * @since 0.1.0
15623 * @category Array
15624 * @param {Array} array The array to inspect.
15625 * @param {*} value The value to search for.
15626 * @param {number} [fromIndex=0] The index to search from.
15627 * @returns {number} Returns the index of the matched value, else `-1`.
15628 * @example
15629 *
15630 * _.indexOf([1, 2, 1, 2], 2);
15631 * // => 1
15632 *
15633 * // Search from the `fromIndex`.
15634 * _.indexOf([1, 2, 1, 2], 2, 2);
15635 * // => 3
15636 */
15637 function indexOf(array, value, fromIndex) {
15638 var length = array == null ? 0 : array.length;
15639 if (!length) {
15640 return -1;
15641 }
15642 var index = fromIndex == null ? 0 : toInteger(fromIndex);
15643 if (index < 0) {
15644 index = nativeMax(length + index, 0);
15645 }
15646 return baseIndexOf(array, value, index);
15647 }
15648
15649 /**
15650 * Gets all but the last element of `array`.
15651 *
15652 * @static
15653 * @memberOf _
15654 * @since 0.1.0
15655 * @category Array
15656 * @param {Array} array The array to query.
15657 * @returns {Array} Returns the slice of `array`.
15658 * @example
15659 *
15660 * _.initial([1, 2, 3]);
15661 * // => [1, 2]
15662 */
15663 function initial(array) {
15664 var length = array == null ? 0 : array.length;
15665 return length ? baseSlice(array, 0, -1) : [];
15666 }
15667
15668 /**
15669 * Creates an array of unique values that are included in all given arrays
15670 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
15671 * for equality comparisons. The order and references of result values are
15672 * determined by the first array.
15673 *
15674 * @static
15675 * @memberOf _
15676 * @since 0.1.0
15677 * @category Array
15678 * @param {...Array} [arrays] The arrays to inspect.
15679 * @returns {Array} Returns the new array of intersecting values.
15680 * @example
15681 *
15682 * _.intersection([2, 1], [2, 3]);
15683 * // => [2]
15684 */
15685 var intersection = baseRest(function(arrays) {
15686 var mapped = arrayMap(arrays, castArrayLikeObject);
15687 return (mapped.length && mapped[0] === arrays[0])
15688 ? baseIntersection(mapped)
15689 : [];
15690 });
15691
15692 /**
15693 * This method is like `_.intersection` except that it accepts `iteratee`
15694 * which is invoked for each element of each `arrays` to generate the criterion
15695 * by which they're compared. The order and references of result values are
15696 * determined by the first array. The iteratee is invoked with one argument:
15697 * (value).
15698 *
15699 * @static
15700 * @memberOf _
15701 * @since 4.0.0
15702 * @category Array
15703 * @param {...Array} [arrays] The arrays to inspect.
15704 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
15705 * @returns {Array} Returns the new array of intersecting values.
15706 * @example
15707 *
15708 * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);
15709 * // => [2.1]
15710 *
15711 * // The `_.property` iteratee shorthand.
15712 * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
15713 * // => [{ 'x': 1 }]
15714 */
15715 var intersectionBy = baseRest(function(arrays) {
15716 var iteratee = last(arrays),
15717 mapped = arrayMap(arrays, castArrayLikeObject);
15718
15719 if (iteratee === last(mapped)) {
15720 iteratee = undefined;
15721 } else {
15722 mapped.pop();
15723 }
15724 return (mapped.length && mapped[0] === arrays[0])
15725 ? baseIntersection(mapped, getIteratee(iteratee, 2))
15726 : [];
15727 });
15728
15729 /**
15730 * This method is like `_.intersection` except that it accepts `comparator`
15731 * which is invoked to compare elements of `arrays`. The order and references
15732 * of result values are determined by the first array. The comparator is
15733 * invoked with two arguments: (arrVal, othVal).
15734 *
15735 * @static
15736 * @memberOf _
15737 * @since 4.0.0
15738 * @category Array
15739 * @param {...Array} [arrays] The arrays to inspect.
15740 * @param {Function} [comparator] The comparator invoked per element.
15741 * @returns {Array} Returns the new array of intersecting values.
15742 * @example
15743 *
15744 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
15745 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
15746 *
15747 * _.intersectionWith(objects, others, _.isEqual);
15748 * // => [{ 'x': 1, 'y': 2 }]
15749 */
15750 var intersectionWith = baseRest(function(arrays) {
15751 var comparator = last(arrays),
15752 mapped = arrayMap(arrays, castArrayLikeObject);
15753
15754 comparator = typeof comparator == 'function' ? comparator : undefined;
15755 if (comparator) {
15756 mapped.pop();
15757 }
15758 return (mapped.length && mapped[0] === arrays[0])
15759 ? baseIntersection(mapped, undefined, comparator)
15760 : [];
15761 });
15762
15763 /**
15764 * Converts all elements in `array` into a string separated by `separator`.
15765 *
15766 * @static
15767 * @memberOf _
15768 * @since 4.0.0
15769 * @category Array
15770 * @param {Array} array The array to convert.
15771 * @param {string} [separator=','] The element separator.
15772 * @returns {string} Returns the joined string.
15773 * @example
15774 *
15775 * _.join(['a', 'b', 'c'], '~');
15776 * // => 'a~b~c'
15777 */
15778 function join(array, separator) {
15779 return array == null ? '' : nativeJoin.call(array, separator);
15780 }
15781
15782 /**
15783 * Gets the last element of `array`.
15784 *
15785 * @static
15786 * @memberOf _
15787 * @since 0.1.0
15788 * @category Array
15789 * @param {Array} array The array to query.
15790 * @returns {*} Returns the last element of `array`.
15791 * @example
15792 *
15793 * _.last([1, 2, 3]);
15794 * // => 3
15795 */
15796 function last(array) {
15797 var length = array == null ? 0 : array.length;
15798 return length ? array[length - 1] : undefined;
15799 }
15800
15801 /**
15802 * This method is like `_.indexOf` except that it iterates over elements of
15803 * `array` from right to left.
15804 *
15805 * @static
15806 * @memberOf _
15807 * @since 0.1.0
15808 * @category Array
15809 * @param {Array} array The array to inspect.
15810 * @param {*} value The value to search for.
15811 * @param {number} [fromIndex=array.length-1] The index to search from.
15812 * @returns {number} Returns the index of the matched value, else `-1`.
15813 * @example
15814 *
15815 * _.lastIndexOf([1, 2, 1, 2], 2);
15816 * // => 3
15817 *
15818 * // Search from the `fromIndex`.
15819 * _.lastIndexOf([1, 2, 1, 2], 2, 2);
15820 * // => 1
15821 */
15822 function lastIndexOf(array, value, fromIndex) {
15823 var length = array == null ? 0 : array.length;
15824 if (!length) {
15825 return -1;
15826 }
15827 var index = length;
15828 if (fromIndex !== undefined) {
15829 index = toInteger(fromIndex);
15830 index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);
15831 }
15832 return value === value
15833 ? strictLastIndexOf(array, value, index)
15834 : baseFindIndex(array, baseIsNaN, index, true);
15835 }
15836
15837 /**
15838 * Gets the element at index `n` of `array`. If `n` is negative, the nth
15839 * element from the end is returned.
15840 *
15841 * @static
15842 * @memberOf _
15843 * @since 4.11.0
15844 * @category Array
15845 * @param {Array} array The array to query.
15846 * @param {number} [n=0] The index of the element to return.
15847 * @returns {*} Returns the nth element of `array`.
15848 * @example
15849 *
15850 * var array = ['a', 'b', 'c', 'd'];
15851 *
15852 * _.nth(array, 1);
15853 * // => 'b'
15854 *
15855 * _.nth(array, -2);
15856 * // => 'c';
15857 */
15858 function nth(array, n) {
15859 return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;
15860 }
15861
15862 /**
15863 * Removes all given values from `array` using
15864 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
15865 * for equality comparisons.
15866 *
15867 * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`
15868 * to remove elements from an array by predicate.
15869 *
15870 * @static
15871 * @memberOf _
15872 * @since 2.0.0
15873 * @category Array
15874 * @param {Array} array The array to modify.
15875 * @param {...*} [values] The values to remove.
15876 * @returns {Array} Returns `array`.
15877 * @example
15878 *
15879 * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
15880 *
15881 * _.pull(array, 'a', 'c');
15882 * console.log(array);
15883 * // => ['b', 'b']
15884 */
15885 var pull = baseRest(pullAll);
15886
15887 /**
15888 * This method is like `_.pull` except that it accepts an array of values to remove.
15889 *
15890 * **Note:** Unlike `_.difference`, this method mutates `array`.
15891 *
15892 * @static
15893 * @memberOf _
15894 * @since 4.0.0
15895 * @category Array
15896 * @param {Array} array The array to modify.
15897 * @param {Array} values The values to remove.
15898 * @returns {Array} Returns `array`.
15899 * @example
15900 *
15901 * var array = ['a', 'b', 'c', 'a', 'b', 'c'];
15902 *
15903 * _.pullAll(array, ['a', 'c']);
15904 * console.log(array);
15905 * // => ['b', 'b']
15906 */
15907 function pullAll(array, values) {
15908 return (array && array.length && values && values.length)
15909 ? basePullAll(array, values)
15910 : array;
15911 }
15912
15913 /**
15914 * This method is like `_.pullAll` except that it accepts `iteratee` which is
15915 * invoked for each element of `array` and `values` to generate the criterion
15916 * by which they're compared. The iteratee is invoked with one argument: (value).
15917 *
15918 * **Note:** Unlike `_.differenceBy`, this method mutates `array`.
15919 *
15920 * @static
15921 * @memberOf _
15922 * @since 4.0.0
15923 * @category Array
15924 * @param {Array} array The array to modify.
15925 * @param {Array} values The values to remove.
15926 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
15927 * @returns {Array} Returns `array`.
15928 * @example
15929 *
15930 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];
15931 *
15932 * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');
15933 * console.log(array);
15934 * // => [{ 'x': 2 }]
15935 */
15936 function pullAllBy(array, values, iteratee) {
15937 return (array && array.length && values && values.length)
15938 ? basePullAll(array, values, getIteratee(iteratee, 2))
15939 : array;
15940 }
15941
15942 /**
15943 * This method is like `_.pullAll` except that it accepts `comparator` which
15944 * is invoked to compare elements of `array` to `values`. The comparator is
15945 * invoked with two arguments: (arrVal, othVal).
15946 *
15947 * **Note:** Unlike `_.differenceWith`, this method mutates `array`.
15948 *
15949 * @static
15950 * @memberOf _
15951 * @since 4.6.0
15952 * @category Array
15953 * @param {Array} array The array to modify.
15954 * @param {Array} values The values to remove.
15955 * @param {Function} [comparator] The comparator invoked per element.
15956 * @returns {Array} Returns `array`.
15957 * @example
15958 *
15959 * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
15960 *
15961 * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
15962 * console.log(array);
15963 * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
15964 */
15965 function pullAllWith(array, values, comparator) {
15966 return (array && array.length && values && values.length)
15967 ? basePullAll(array, values, undefined, comparator)
15968 : array;
15969 }
15970
15971 /**
15972 * Removes elements from `array` corresponding to `indexes` and returns an
15973 * array of removed elements.
15974 *
15975 * **Note:** Unlike `_.at`, this method mutates `array`.
15976 *
15977 * @static
15978 * @memberOf _
15979 * @since 3.0.0
15980 * @category Array
15981 * @param {Array} array The array to modify.
15982 * @param {...(number|number[])} [indexes] The indexes of elements to remove.
15983 * @returns {Array} Returns the new array of removed elements.
15984 * @example
15985 *
15986 * var array = ['a', 'b', 'c', 'd'];
15987 * var pulled = _.pullAt(array, [1, 3]);
15988 *
15989 * console.log(array);
15990 * // => ['a', 'c']
15991 *
15992 * console.log(pulled);
15993 * // => ['b', 'd']
15994 */
15995 var pullAt = flatRest(function(array, indexes) {
15996 var length = array == null ? 0 : array.length,
15997 result = baseAt(array, indexes);
15998
15999 basePullAt(array, arrayMap(indexes, function(index) {
16000 return isIndex(index, length) ? +index : index;
16001 }).sort(compareAscending));
16002
16003 return result;
16004 });
16005
16006 /**
16007 * Removes all elements from `array` that `predicate` returns truthy for
16008 * and returns an array of the removed elements. The predicate is invoked
16009 * with three arguments: (value, index, array).
16010 *
16011 * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`
16012 * to pull elements from an array by value.
16013 *
16014 * @static
16015 * @memberOf _
16016 * @since 2.0.0
16017 * @category Array
16018 * @param {Array} array The array to modify.
16019 * @param {Function} [predicate=_.identity] The function invoked per iteration.
16020 * @returns {Array} Returns the new array of removed elements.
16021 * @example
16022 *
16023 * var array = [1, 2, 3, 4];
16024 * var evens = _.remove(array, function(n) {
16025 * return n % 2 == 0;
16026 * });
16027 *
16028 * console.log(array);
16029 * // => [1, 3]
16030 *
16031 * console.log(evens);
16032 * // => [2, 4]
16033 */
16034 function remove(array, predicate) {
16035 var result = [];
16036 if (!(array && array.length)) {
16037 return result;
16038 }
16039 var index = -1,
16040 indexes = [],
16041 length = array.length;
16042
16043 predicate = getIteratee(predicate, 3);
16044 while (++index < length) {
16045 var value = array[index];
16046 if (predicate(value, index, array)) {
16047 result.push(value);
16048 indexes.push(index);
16049 }
16050 }
16051 basePullAt(array, indexes);
16052 return result;
16053 }
16054
16055 /**
16056 * Reverses `array` so that the first element becomes the last, the second
16057 * element becomes the second to last, and so on.
16058 *
16059 * **Note:** This method mutates `array` and is based on
16060 * [`Array#reverse`](https://mdn.io/Array/reverse).
16061 *
16062 * @static
16063 * @memberOf _
16064 * @since 4.0.0
16065 * @category Array
16066 * @param {Array} array The array to modify.
16067 * @returns {Array} Returns `array`.
16068 * @example
16069 *
16070 * var array = [1, 2, 3];
16071 *
16072 * _.reverse(array);
16073 * // => [3, 2, 1]
16074 *
16075 * console.log(array);
16076 * // => [3, 2, 1]
16077 */
16078 function reverse(array) {
16079 return array == null ? array : nativeReverse.call(array);
16080 }
16081
16082 /**
16083 * Creates a slice of `array` from `start` up to, but not including, `end`.
16084 *
16085 * **Note:** This method is used instead of
16086 * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are
16087 * returned.
16088 *
16089 * @static
16090 * @memberOf _
16091 * @since 3.0.0
16092 * @category Array
16093 * @param {Array} array The array to slice.
16094 * @param {number} [start=0] The start position.
16095 * @param {number} [end=array.length] The end position.
16096 * @returns {Array} Returns the slice of `array`.
16097 */
16098 function slice(array, start, end) {
16099 var length = array == null ? 0 : array.length;
16100 if (!length) {
16101 return [];
16102 }
16103 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
16104 start = 0;
16105 end = length;
16106 }
16107 else {
16108 start = start == null ? 0 : toInteger(start);
16109 end = end === undefined ? length : toInteger(end);
16110 }
16111 return baseSlice(array, start, end);
16112 }
16113
16114 /**
16115 * Uses a binary search to determine the lowest index at which `value`
16116 * should be inserted into `array` in order to maintain its sort order.
16117 *
16118 * @static
16119 * @memberOf _
16120 * @since 0.1.0
16121 * @category Array
16122 * @param {Array} array The sorted array to inspect.
16123 * @param {*} value The value to evaluate.
16124 * @returns {number} Returns the index at which `value` should be inserted
16125 * into `array`.
16126 * @example
16127 *
16128 * _.sortedIndex([30, 50], 40);
16129 * // => 1
16130 */
16131 function sortedIndex(array, value) {
16132 return baseSortedIndex(array, value);
16133 }
16134
16135 /**
16136 * This method is like `_.sortedIndex` except that it accepts `iteratee`
16137 * which is invoked for `value` and each element of `array` to compute their
16138 * sort ranking. The iteratee is invoked with one argument: (value).
16139 *
16140 * @static
16141 * @memberOf _
16142 * @since 4.0.0
16143 * @category Array
16144 * @param {Array} array The sorted array to inspect.
16145 * @param {*} value The value to evaluate.
16146 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
16147 * @returns {number} Returns the index at which `value` should be inserted
16148 * into `array`.
16149 * @example
16150 *
16151 * var objects = [{ 'x': 4 }, { 'x': 5 }];
16152 *
16153 * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
16154 * // => 0
16155 *
16156 * // The `_.property` iteratee shorthand.
16157 * _.sortedIndexBy(objects, { 'x': 4 }, 'x');
16158 * // => 0
16159 */
16160 function sortedIndexBy(array, value, iteratee) {
16161 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));
16162 }
16163
16164 /**
16165 * This method is like `_.indexOf` except that it performs a binary
16166 * search on a sorted `array`.
16167 *
16168 * @static
16169 * @memberOf _
16170 * @since 4.0.0
16171 * @category Array
16172 * @param {Array} array The array to inspect.
16173 * @param {*} value The value to search for.
16174 * @returns {number} Returns the index of the matched value, else `-1`.
16175 * @example
16176 *
16177 * _.sortedIndexOf([4, 5, 5, 5, 6], 5);
16178 * // => 1
16179 */
16180 function sortedIndexOf(array, value) {
16181 var length = array == null ? 0 : array.length;
16182 if (length) {
16183 var index = baseSortedIndex(array, value);
16184 if (index < length && eq(array[index], value)) {
16185 return index;
16186 }
16187 }
16188 return -1;
16189 }
16190
16191 /**
16192 * This method is like `_.sortedIndex` except that it returns the highest
16193 * index at which `value` should be inserted into `array` in order to
16194 * maintain its sort order.
16195 *
16196 * @static
16197 * @memberOf _
16198 * @since 3.0.0
16199 * @category Array
16200 * @param {Array} array The sorted array to inspect.
16201 * @param {*} value The value to evaluate.
16202 * @returns {number} Returns the index at which `value` should be inserted
16203 * into `array`.
16204 * @example
16205 *
16206 * _.sortedLastIndex([4, 5, 5, 5, 6], 5);
16207 * // => 4
16208 */
16209 function sortedLastIndex(array, value) {
16210 return baseSortedIndex(array, value, true);
16211 }
16212
16213 /**
16214 * This method is like `_.sortedLastIndex` except that it accepts `iteratee`
16215 * which is invoked for `value` and each element of `array` to compute their
16216 * sort ranking. The iteratee is invoked with one argument: (value).
16217 *
16218 * @static
16219 * @memberOf _
16220 * @since 4.0.0
16221 * @category Array
16222 * @param {Array} array The sorted array to inspect.
16223 * @param {*} value The value to evaluate.
16224 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
16225 * @returns {number} Returns the index at which `value` should be inserted
16226 * into `array`.
16227 * @example
16228 *
16229 * var objects = [{ 'x': 4 }, { 'x': 5 }];
16230 *
16231 * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });
16232 * // => 1
16233 *
16234 * // The `_.property` iteratee shorthand.
16235 * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');
16236 * // => 1
16237 */
16238 function sortedLastIndexBy(array, value, iteratee) {
16239 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);
16240 }
16241
16242 /**
16243 * This method is like `_.lastIndexOf` except that it performs a binary
16244 * search on a sorted `array`.
16245 *
16246 * @static
16247 * @memberOf _
16248 * @since 4.0.0
16249 * @category Array
16250 * @param {Array} array The array to inspect.
16251 * @param {*} value The value to search for.
16252 * @returns {number} Returns the index of the matched value, else `-1`.
16253 * @example
16254 *
16255 * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);
16256 * // => 3
16257 */
16258 function sortedLastIndexOf(array, value) {
16259 var length = array == null ? 0 : array.length;
16260 if (length) {
16261 var index = baseSortedIndex(array, value, true) - 1;
16262 if (eq(array[index], value)) {
16263 return index;
16264 }
16265 }
16266 return -1;
16267 }
16268
16269 /**
16270 * This method is like `_.uniq` except that it's designed and optimized
16271 * for sorted arrays.
16272 *
16273 * @static
16274 * @memberOf _
16275 * @since 4.0.0
16276 * @category Array
16277 * @param {Array} array The array to inspect.
16278 * @returns {Array} Returns the new duplicate free array.
16279 * @example
16280 *
16281 * _.sortedUniq([1, 1, 2]);
16282 * // => [1, 2]
16283 */
16284 function sortedUniq(array) {
16285 return (array && array.length)
16286 ? baseSortedUniq(array)
16287 : [];
16288 }
16289
16290 /**
16291 * This method is like `_.uniqBy` except that it's designed and optimized
16292 * for sorted arrays.
16293 *
16294 * @static
16295 * @memberOf _
16296 * @since 4.0.0
16297 * @category Array
16298 * @param {Array} array The array to inspect.
16299 * @param {Function} [iteratee] The iteratee invoked per element.
16300 * @returns {Array} Returns the new duplicate free array.
16301 * @example
16302 *
16303 * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);
16304 * // => [1.1, 2.3]
16305 */
16306 function sortedUniqBy(array, iteratee) {
16307 return (array && array.length)
16308 ? baseSortedUniq(array, getIteratee(iteratee, 2))
16309 : [];
16310 }
16311
16312 /**
16313 * Gets all but the first element of `array`.
16314 *
16315 * @static
16316 * @memberOf _
16317 * @since 4.0.0
16318 * @category Array
16319 * @param {Array} array The array to query.
16320 * @returns {Array} Returns the slice of `array`.
16321 * @example
16322 *
16323 * _.tail([1, 2, 3]);
16324 * // => [2, 3]
16325 */
16326 function tail(array) {
16327 var length = array == null ? 0 : array.length;
16328 return length ? baseSlice(array, 1, length) : [];
16329 }
16330
16331 /**
16332 * Creates a slice of `array` with `n` elements taken from the beginning.
16333 *
16334 * @static
16335 * @memberOf _
16336 * @since 0.1.0
16337 * @category Array
16338 * @param {Array} array The array to query.
16339 * @param {number} [n=1] The number of elements to take.
16340 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
16341 * @returns {Array} Returns the slice of `array`.
16342 * @example
16343 *
16344 * _.take([1, 2, 3]);
16345 * // => [1]
16346 *
16347 * _.take([1, 2, 3], 2);
16348 * // => [1, 2]
16349 *
16350 * _.take([1, 2, 3], 5);
16351 * // => [1, 2, 3]
16352 *
16353 * _.take([1, 2, 3], 0);
16354 * // => []
16355 */
16356 function take(array, n, guard) {
16357 if (!(array && array.length)) {
16358 return [];
16359 }
16360 n = (guard || n === undefined) ? 1 : toInteger(n);
16361 return baseSlice(array, 0, n < 0 ? 0 : n);
16362 }
16363
16364 /**
16365 * Creates a slice of `array` with `n` elements taken from the end.
16366 *
16367 * @static
16368 * @memberOf _
16369 * @since 3.0.0
16370 * @category Array
16371 * @param {Array} array The array to query.
16372 * @param {number} [n=1] The number of elements to take.
16373 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
16374 * @returns {Array} Returns the slice of `array`.
16375 * @example
16376 *
16377 * _.takeRight([1, 2, 3]);
16378 * // => [3]
16379 *
16380 * _.takeRight([1, 2, 3], 2);
16381 * // => [2, 3]
16382 *
16383 * _.takeRight([1, 2, 3], 5);
16384 * // => [1, 2, 3]
16385 *
16386 * _.takeRight([1, 2, 3], 0);
16387 * // => []
16388 */
16389 function takeRight(array, n, guard) {
16390 var length = array == null ? 0 : array.length;
16391 if (!length) {
16392 return [];
16393 }
16394 n = (guard || n === undefined) ? 1 : toInteger(n);
16395 n = length - n;
16396 return baseSlice(array, n < 0 ? 0 : n, length);
16397 }
16398
16399 /**
16400 * Creates a slice of `array` with elements taken from the end. Elements are
16401 * taken until `predicate` returns falsey. The predicate is invoked with
16402 * three arguments: (value, index, array).
16403 *
16404 * @static
16405 * @memberOf _
16406 * @since 3.0.0
16407 * @category Array
16408 * @param {Array} array The array to query.
16409 * @param {Function} [predicate=_.identity] The function invoked per iteration.
16410 * @returns {Array} Returns the slice of `array`.
16411 * @example
16412 *
16413 * var users = [
16414 * { 'user': 'barney', 'active': true },
16415 * { 'user': 'fred', 'active': false },
16416 * { 'user': 'pebbles', 'active': false }
16417 * ];
16418 *
16419 * _.takeRightWhile(users, function(o) { return !o.active; });
16420 * // => objects for ['fred', 'pebbles']
16421 *
16422 * // The `_.matches` iteratee shorthand.
16423 * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });
16424 * // => objects for ['pebbles']
16425 *
16426 * // The `_.matchesProperty` iteratee shorthand.
16427 * _.takeRightWhile(users, ['active', false]);
16428 * // => objects for ['fred', 'pebbles']
16429 *
16430 * // The `_.property` iteratee shorthand.
16431 * _.takeRightWhile(users, 'active');
16432 * // => []
16433 */
16434 function takeRightWhile(array, predicate) {
16435 return (array && array.length)
16436 ? baseWhile(array, getIteratee(predicate, 3), false, true)
16437 : [];
16438 }
16439
16440 /**
16441 * Creates a slice of `array` with elements taken from the beginning. Elements
16442 * are taken until `predicate` returns falsey. The predicate is invoked with
16443 * three arguments: (value, index, array).
16444 *
16445 * @static
16446 * @memberOf _
16447 * @since 3.0.0
16448 * @category Array
16449 * @param {Array} array The array to query.
16450 * @param {Function} [predicate=_.identity] The function invoked per iteration.
16451 * @returns {Array} Returns the slice of `array`.
16452 * @example
16453 *
16454 * var users = [
16455 * { 'user': 'barney', 'active': false },
16456 * { 'user': 'fred', 'active': false },
16457 * { 'user': 'pebbles', 'active': true }
16458 * ];
16459 *
16460 * _.takeWhile(users, function(o) { return !o.active; });
16461 * // => objects for ['barney', 'fred']
16462 *
16463 * // The `_.matches` iteratee shorthand.
16464 * _.takeWhile(users, { 'user': 'barney', 'active': false });
16465 * // => objects for ['barney']
16466 *
16467 * // The `_.matchesProperty` iteratee shorthand.
16468 * _.takeWhile(users, ['active', false]);
16469 * // => objects for ['barney', 'fred']
16470 *
16471 * // The `_.property` iteratee shorthand.
16472 * _.takeWhile(users, 'active');
16473 * // => []
16474 */
16475 function takeWhile(array, predicate) {
16476 return (array && array.length)
16477 ? baseWhile(array, getIteratee(predicate, 3))
16478 : [];
16479 }
16480
16481 /**
16482 * Creates an array of unique values, in order, from all given arrays using
16483 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
16484 * for equality comparisons.
16485 *
16486 * @static
16487 * @memberOf _
16488 * @since 0.1.0
16489 * @category Array
16490 * @param {...Array} [arrays] The arrays to inspect.
16491 * @returns {Array} Returns the new array of combined values.
16492 * @example
16493 *
16494 * _.union([2], [1, 2]);
16495 * // => [2, 1]
16496 */
16497 var union = baseRest(function(arrays) {
16498 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));
16499 });
16500
16501 /**
16502 * This method is like `_.union` except that it accepts `iteratee` which is
16503 * invoked for each element of each `arrays` to generate the criterion by
16504 * which uniqueness is computed. Result values are chosen from the first
16505 * array in which the value occurs. The iteratee is invoked with one argument:
16506 * (value).
16507 *
16508 * @static
16509 * @memberOf _
16510 * @since 4.0.0
16511 * @category Array
16512 * @param {...Array} [arrays] The arrays to inspect.
16513 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
16514 * @returns {Array} Returns the new array of combined values.
16515 * @example
16516 *
16517 * _.unionBy([2.1], [1.2, 2.3], Math.floor);
16518 * // => [2.1, 1.2]
16519 *
16520 * // The `_.property` iteratee shorthand.
16521 * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
16522 * // => [{ 'x': 1 }, { 'x': 2 }]
16523 */
16524 var unionBy = baseRest(function(arrays) {
16525 var iteratee = last(arrays);
16526 if (isArrayLikeObject(iteratee)) {
16527 iteratee = undefined;
16528 }
16529 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));
16530 });
16531
16532 /**
16533 * This method is like `_.union` except that it accepts `comparator` which
16534 * is invoked to compare elements of `arrays`. Result values are chosen from
16535 * the first array in which the value occurs. The comparator is invoked
16536 * with two arguments: (arrVal, othVal).
16537 *
16538 * @static
16539 * @memberOf _
16540 * @since 4.0.0
16541 * @category Array
16542 * @param {...Array} [arrays] The arrays to inspect.
16543 * @param {Function} [comparator] The comparator invoked per element.
16544 * @returns {Array} Returns the new array of combined values.
16545 * @example
16546 *
16547 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
16548 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
16549 *
16550 * _.unionWith(objects, others, _.isEqual);
16551 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
16552 */
16553 var unionWith = baseRest(function(arrays) {
16554 var comparator = last(arrays);
16555 comparator = typeof comparator == 'function' ? comparator : undefined;
16556 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);
16557 });
16558
16559 /**
16560 * Creates a duplicate-free version of an array, using
16561 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
16562 * for equality comparisons, in which only the first occurrence of each element
16563 * is kept. The order of result values is determined by the order they occur
16564 * in the array.
16565 *
16566 * @static
16567 * @memberOf _
16568 * @since 0.1.0
16569 * @category Array
16570 * @param {Array} array The array to inspect.
16571 * @returns {Array} Returns the new duplicate free array.
16572 * @example
16573 *
16574 * _.uniq([2, 1, 2]);
16575 * // => [2, 1]
16576 */
16577 function uniq(array) {
16578 return (array && array.length) ? baseUniq(array) : [];
16579 }
16580
16581 /**
16582 * This method is like `_.uniq` except that it accepts `iteratee` which is
16583 * invoked for each element in `array` to generate the criterion by which
16584 * uniqueness is computed. The order of result values is determined by the
16585 * order they occur in the array. The iteratee is invoked with one argument:
16586 * (value).
16587 *
16588 * @static
16589 * @memberOf _
16590 * @since 4.0.0
16591 * @category Array
16592 * @param {Array} array The array to inspect.
16593 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
16594 * @returns {Array} Returns the new duplicate free array.
16595 * @example
16596 *
16597 * _.uniqBy([2.1, 1.2, 2.3], Math.floor);
16598 * // => [2.1, 1.2]
16599 *
16600 * // The `_.property` iteratee shorthand.
16601 * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
16602 * // => [{ 'x': 1 }, { 'x': 2 }]
16603 */
16604 function uniqBy(array, iteratee) {
16605 return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];
16606 }
16607
16608 /**
16609 * This method is like `_.uniq` except that it accepts `comparator` which
16610 * is invoked to compare elements of `array`. The order of result values is
16611 * determined by the order they occur in the array.The comparator is invoked
16612 * with two arguments: (arrVal, othVal).
16613 *
16614 * @static
16615 * @memberOf _
16616 * @since 4.0.0
16617 * @category Array
16618 * @param {Array} array The array to inspect.
16619 * @param {Function} [comparator] The comparator invoked per element.
16620 * @returns {Array} Returns the new duplicate free array.
16621 * @example
16622 *
16623 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];
16624 *
16625 * _.uniqWith(objects, _.isEqual);
16626 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]
16627 */
16628 function uniqWith(array, comparator) {
16629 comparator = typeof comparator == 'function' ? comparator : undefined;
16630 return (array && array.length) ? baseUniq(array, undefined, comparator) : [];
16631 }
16632
16633 /**
16634 * This method is like `_.zip` except that it accepts an array of grouped
16635 * elements and creates an array regrouping the elements to their pre-zip
16636 * configuration.
16637 *
16638 * @static
16639 * @memberOf _
16640 * @since 1.2.0
16641 * @category Array
16642 * @param {Array} array The array of grouped elements to process.
16643 * @returns {Array} Returns the new array of regrouped elements.
16644 * @example
16645 *
16646 * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
16647 * // => [['a', 1, true], ['b', 2, false]]
16648 *
16649 * _.unzip(zipped);
16650 * // => [['a', 'b'], [1, 2], [true, false]]
16651 */
16652 function unzip(array) {
16653 if (!(array && array.length)) {
16654 return [];
16655 }
16656 var length = 0;
16657 array = arrayFilter(array, function(group) {
16658 if (isArrayLikeObject(group)) {
16659 length = nativeMax(group.length, length);
16660 return true;
16661 }
16662 });
16663 return baseTimes(length, function(index) {
16664 return arrayMap(array, baseProperty(index));
16665 });
16666 }
16667
16668 /**
16669 * This method is like `_.unzip` except that it accepts `iteratee` to specify
16670 * how regrouped values should be combined. The iteratee is invoked with the
16671 * elements of each group: (...group).
16672 *
16673 * @static
16674 * @memberOf _
16675 * @since 3.8.0
16676 * @category Array
16677 * @param {Array} array The array of grouped elements to process.
16678 * @param {Function} [iteratee=_.identity] The function to combine
16679 * regrouped values.
16680 * @returns {Array} Returns the new array of regrouped elements.
16681 * @example
16682 *
16683 * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
16684 * // => [[1, 10, 100], [2, 20, 200]]
16685 *
16686 * _.unzipWith(zipped, _.add);
16687 * // => [3, 30, 300]
16688 */
16689 function unzipWith(array, iteratee) {
16690 if (!(array && array.length)) {
16691 return [];
16692 }
16693 var result = unzip(array);
16694 if (iteratee == null) {
16695 return result;
16696 }
16697 return arrayMap(result, function(group) {
16698 return apply(iteratee, undefined, group);
16699 });
16700 }
16701
16702 /**
16703 * Creates an array excluding all given values using
16704 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
16705 * for equality comparisons.
16706 *
16707 * **Note:** Unlike `_.pull`, this method returns a new array.
16708 *
16709 * @static
16710 * @memberOf _
16711 * @since 0.1.0
16712 * @category Array
16713 * @param {Array} array The array to inspect.
16714 * @param {...*} [values] The values to exclude.
16715 * @returns {Array} Returns the new array of filtered values.
16716 * @see _.difference, _.xor
16717 * @example
16718 *
16719 * _.without([2, 1, 2, 3], 1, 2);
16720 * // => [3]
16721 */
16722 var without = baseRest(function(array, values) {
16723 return isArrayLikeObject(array)
16724 ? baseDifference(array, values)
16725 : [];
16726 });
16727
16728 /**
16729 * Creates an array of unique values that is the
16730 * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
16731 * of the given arrays. The order of result values is determined by the order
16732 * they occur in the arrays.
16733 *
16734 * @static
16735 * @memberOf _
16736 * @since 2.4.0
16737 * @category Array
16738 * @param {...Array} [arrays] The arrays to inspect.
16739 * @returns {Array} Returns the new array of filtered values.
16740 * @see _.difference, _.without
16741 * @example
16742 *
16743 * _.xor([2, 1], [2, 3]);
16744 * // => [1, 3]
16745 */
16746 var xor = baseRest(function(arrays) {
16747 return baseXor(arrayFilter(arrays, isArrayLikeObject));
16748 });
16749
16750 /**
16751 * This method is like `_.xor` except that it accepts `iteratee` which is
16752 * invoked for each element of each `arrays` to generate the criterion by
16753 * which by which they're compared. The order of result values is determined
16754 * by the order they occur in the arrays. The iteratee is invoked with one
16755 * argument: (value).
16756 *
16757 * @static
16758 * @memberOf _
16759 * @since 4.0.0
16760 * @category Array
16761 * @param {...Array} [arrays] The arrays to inspect.
16762 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
16763 * @returns {Array} Returns the new array of filtered values.
16764 * @example
16765 *
16766 * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);
16767 * // => [1.2, 3.4]
16768 *
16769 * // The `_.property` iteratee shorthand.
16770 * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');
16771 * // => [{ 'x': 2 }]
16772 */
16773 var xorBy = baseRest(function(arrays) {
16774 var iteratee = last(arrays);
16775 if (isArrayLikeObject(iteratee)) {
16776 iteratee = undefined;
16777 }
16778 return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));
16779 });
16780
16781 /**
16782 * This method is like `_.xor` except that it accepts `comparator` which is
16783 * invoked to compare elements of `arrays`. The order of result values is
16784 * determined by the order they occur in the arrays. The comparator is invoked
16785 * with two arguments: (arrVal, othVal).
16786 *
16787 * @static
16788 * @memberOf _
16789 * @since 4.0.0
16790 * @category Array
16791 * @param {...Array} [arrays] The arrays to inspect.
16792 * @param {Function} [comparator] The comparator invoked per element.
16793 * @returns {Array} Returns the new array of filtered values.
16794 * @example
16795 *
16796 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];
16797 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];
16798 *
16799 * _.xorWith(objects, others, _.isEqual);
16800 * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]
16801 */
16802 var xorWith = baseRest(function(arrays) {
16803 var comparator = last(arrays);
16804 comparator = typeof comparator == 'function' ? comparator : undefined;
16805 return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);
16806 });
16807
16808 /**
16809 * Creates an array of grouped elements, the first of which contains the
16810 * first elements of the given arrays, the second of which contains the
16811 * second elements of the given arrays, and so on.
16812 *
16813 * @static
16814 * @memberOf _
16815 * @since 0.1.0
16816 * @category Array
16817 * @param {...Array} [arrays] The arrays to process.
16818 * @returns {Array} Returns the new array of grouped elements.
16819 * @example
16820 *
16821 * _.zip(['a', 'b'], [1, 2], [true, false]);
16822 * // => [['a', 1, true], ['b', 2, false]]
16823 */
16824 var zip = baseRest(unzip);
16825
16826 /**
16827 * This method is like `_.fromPairs` except that it accepts two arrays,
16828 * one of property identifiers and one of corresponding values.
16829 *
16830 * @static
16831 * @memberOf _
16832 * @since 0.4.0
16833 * @category Array
16834 * @param {Array} [props=[]] The property identifiers.
16835 * @param {Array} [values=[]] The property values.
16836 * @returns {Object} Returns the new object.
16837 * @example
16838 *
16839 * _.zipObject(['a', 'b'], [1, 2]);
16840 * // => { 'a': 1, 'b': 2 }
16841 */
16842 function zipObject(props, values) {
16843 return baseZipObject(props || [], values || [], assignValue);
16844 }
16845
16846 /**
16847 * This method is like `_.zipObject` except that it supports property paths.
16848 *
16849 * @static
16850 * @memberOf _
16851 * @since 4.1.0
16852 * @category Array
16853 * @param {Array} [props=[]] The property identifiers.
16854 * @param {Array} [values=[]] The property values.
16855 * @returns {Object} Returns the new object.
16856 * @example
16857 *
16858 * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);
16859 * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }
16860 */
16861 function zipObjectDeep(props, values) {
16862 return baseZipObject(props || [], values || [], baseSet);
16863 }
16864
16865 /**
16866 * This method is like `_.zip` except that it accepts `iteratee` to specify
16867 * how grouped values should be combined. The iteratee is invoked with the
16868 * elements of each group: (...group).
16869 *
16870 * @static
16871 * @memberOf _
16872 * @since 3.8.0
16873 * @category Array
16874 * @param {...Array} [arrays] The arrays to process.
16875 * @param {Function} [iteratee=_.identity] The function to combine
16876 * grouped values.
16877 * @returns {Array} Returns the new array of grouped elements.
16878 * @example
16879 *
16880 * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {
16881 * return a + b + c;
16882 * });
16883 * // => [111, 222]
16884 */
16885 var zipWith = baseRest(function(arrays) {
16886 var length = arrays.length,
16887 iteratee = length > 1 ? arrays[length - 1] : undefined;
16888
16889 iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;
16890 return unzipWith(arrays, iteratee);
16891 });
16892
16893 /*------------------------------------------------------------------------*/
16894
16895 /**
16896 * Creates a `lodash` wrapper instance that wraps `value` with explicit method
16897 * chain sequences enabled. The result of such sequences must be unwrapped
16898 * with `_#value`.
16899 *
16900 * @static
16901 * @memberOf _
16902 * @since 1.3.0
16903 * @category Seq
16904 * @param {*} value The value to wrap.
16905 * @returns {Object} Returns the new `lodash` wrapper instance.
16906 * @example
16907 *
16908 * var users = [
16909 * { 'user': 'barney', 'age': 36 },
16910 * { 'user': 'fred', 'age': 40 },
16911 * { 'user': 'pebbles', 'age': 1 }
16912 * ];
16913 *
16914 * var youngest = _
16915 * .chain(users)
16916 * .sortBy('age')
16917 * .map(function(o) {
16918 * return o.user + ' is ' + o.age;
16919 * })
16920 * .head()
16921 * .value();
16922 * // => 'pebbles is 1'
16923 */
16924 function chain(value) {
16925 var result = lodash(value);
16926 result.__chain__ = true;
16927 return result;
16928 }
16929
16930 /**
16931 * This method invokes `interceptor` and returns `value`. The interceptor
16932 * is invoked with one argument; (value). The purpose of this method is to
16933 * "tap into" a method chain sequence in order to modify intermediate results.
16934 *
16935 * @static
16936 * @memberOf _
16937 * @since 0.1.0
16938 * @category Seq
16939 * @param {*} value The value to provide to `interceptor`.
16940 * @param {Function} interceptor The function to invoke.
16941 * @returns {*} Returns `value`.
16942 * @example
16943 *
16944 * _([1, 2, 3])
16945 * .tap(function(array) {
16946 * // Mutate input array.
16947 * array.pop();
16948 * })
16949 * .reverse()
16950 * .value();
16951 * // => [2, 1]
16952 */
16953 function tap(value, interceptor) {
16954 interceptor(value);
16955 return value;
16956 }
16957
16958 /**
16959 * This method is like `_.tap` except that it returns the result of `interceptor`.
16960 * The purpose of this method is to "pass thru" values replacing intermediate
16961 * results in a method chain sequence.
16962 *
16963 * @static
16964 * @memberOf _
16965 * @since 3.0.0
16966 * @category Seq
16967 * @param {*} value The value to provide to `interceptor`.
16968 * @param {Function} interceptor The function to invoke.
16969 * @returns {*} Returns the result of `interceptor`.
16970 * @example
16971 *
16972 * _(' abc ')
16973 * .chain()
16974 * .trim()
16975 * .thru(function(value) {
16976 * return [value];
16977 * })
16978 * .value();
16979 * // => ['abc']
16980 */
16981 function thru(value, interceptor) {
16982 return interceptor(value);
16983 }
16984
16985 /**
16986 * This method is the wrapper version of `_.at`.
16987 *
16988 * @name at
16989 * @memberOf _
16990 * @since 1.0.0
16991 * @category Seq
16992 * @param {...(string|string[])} [paths] The property paths to pick.
16993 * @returns {Object} Returns the new `lodash` wrapper instance.
16994 * @example
16995 *
16996 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
16997 *
16998 * _(object).at(['a[0].b.c', 'a[1]']).value();
16999 * // => [3, 4]
17000 */
17001 var wrapperAt = flatRest(function(paths) {
17002 var length = paths.length,
17003 start = length ? paths[0] : 0,
17004 value = this.__wrapped__,
17005 interceptor = function(object) { return baseAt(object, paths); };
17006
17007 if (length > 1 || this.__actions__.length ||
17008 !(value instanceof LazyWrapper) || !isIndex(start)) {
17009 return this.thru(interceptor);
17010 }
17011 value = value.slice(start, +start + (length ? 1 : 0));
17012 value.__actions__.push({
17013 'func': thru,
17014 'args': [interceptor],
17015 'thisArg': undefined
17016 });
17017 return new LodashWrapper(value, this.__chain__).thru(function(array) {
17018 if (length && !array.length) {
17019 array.push(undefined);
17020 }
17021 return array;
17022 });
17023 });
17024
17025 /**
17026 * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
17027 *
17028 * @name chain
17029 * @memberOf _
17030 * @since 0.1.0
17031 * @category Seq
17032 * @returns {Object} Returns the new `lodash` wrapper instance.
17033 * @example
17034 *
17035 * var users = [
17036 * { 'user': 'barney', 'age': 36 },
17037 * { 'user': 'fred', 'age': 40 }
17038 * ];
17039 *
17040 * // A sequence without explicit chaining.
17041 * _(users).head();
17042 * // => { 'user': 'barney', 'age': 36 }
17043 *
17044 * // A sequence with explicit chaining.
17045 * _(users)
17046 * .chain()
17047 * .head()
17048 * .pick('user')
17049 * .value();
17050 * // => { 'user': 'barney' }
17051 */
17052 function wrapperChain() {
17053 return chain(this);
17054 }
17055
17056 /**
17057 * Executes the chain sequence and returns the wrapped result.
17058 *
17059 * @name commit
17060 * @memberOf _
17061 * @since 3.2.0
17062 * @category Seq
17063 * @returns {Object} Returns the new `lodash` wrapper instance.
17064 * @example
17065 *
17066 * var array = [1, 2];
17067 * var wrapped = _(array).push(3);
17068 *
17069 * console.log(array);
17070 * // => [1, 2]
17071 *
17072 * wrapped = wrapped.commit();
17073 * console.log(array);
17074 * // => [1, 2, 3]
17075 *
17076 * wrapped.last();
17077 * // => 3
17078 *
17079 * console.log(array);
17080 * // => [1, 2, 3]
17081 */
17082 function wrapperCommit() {
17083 return new LodashWrapper(this.value(), this.__chain__);
17084 }
17085
17086 /**
17087 * Gets the next value on a wrapped object following the
17088 * [iterator protocol](https://mdn.io/iteration_protocols#iterator).
17089 *
17090 * @name next
17091 * @memberOf _
17092 * @since 4.0.0
17093 * @category Seq
17094 * @returns {Object} Returns the next iterator value.
17095 * @example
17096 *
17097 * var wrapped = _([1, 2]);
17098 *
17099 * wrapped.next();
17100 * // => { 'done': false, 'value': 1 }
17101 *
17102 * wrapped.next();
17103 * // => { 'done': false, 'value': 2 }
17104 *
17105 * wrapped.next();
17106 * // => { 'done': true, 'value': undefined }
17107 */
17108 function wrapperNext() {
17109 if (this.__values__ === undefined) {
17110 this.__values__ = toArray(this.value());
17111 }
17112 var done = this.__index__ >= this.__values__.length,
17113 value = done ? undefined : this.__values__[this.__index__++];
17114
17115 return { 'done': done, 'value': value };
17116 }
17117
17118 /**
17119 * Enables the wrapper to be iterable.
17120 *
17121 * @name Symbol.iterator
17122 * @memberOf _
17123 * @since 4.0.0
17124 * @category Seq
17125 * @returns {Object} Returns the wrapper object.
17126 * @example
17127 *
17128 * var wrapped = _([1, 2]);
17129 *
17130 * wrapped[Symbol.iterator]() === wrapped;
17131 * // => true
17132 *
17133 * Array.from(wrapped);
17134 * // => [1, 2]
17135 */
17136 function wrapperToIterator() {
17137 return this;
17138 }
17139
17140 /**
17141 * Creates a clone of the chain sequence planting `value` as the wrapped value.
17142 *
17143 * @name plant
17144 * @memberOf _
17145 * @since 3.2.0
17146 * @category Seq
17147 * @param {*} value The value to plant.
17148 * @returns {Object} Returns the new `lodash` wrapper instance.
17149 * @example
17150 *
17151 * function square(n) {
17152 * return n * n;
17153 * }
17154 *
17155 * var wrapped = _([1, 2]).map(square);
17156 * var other = wrapped.plant([3, 4]);
17157 *
17158 * other.value();
17159 * // => [9, 16]
17160 *
17161 * wrapped.value();
17162 * // => [1, 4]
17163 */
17164 function wrapperPlant(value) {
17165 var result,
17166 parent = this;
17167
17168 while (parent instanceof baseLodash) {
17169 var clone = wrapperClone(parent);
17170 clone.__index__ = 0;
17171 clone.__values__ = undefined;
17172 if (result) {
17173 previous.__wrapped__ = clone;
17174 } else {
17175 result = clone;
17176 }
17177 var previous = clone;
17178 parent = parent.__wrapped__;
17179 }
17180 previous.__wrapped__ = value;
17181 return result;
17182 }
17183
17184 /**
17185 * This method is the wrapper version of `_.reverse`.
17186 *
17187 * **Note:** This method mutates the wrapped array.
17188 *
17189 * @name reverse
17190 * @memberOf _
17191 * @since 0.1.0
17192 * @category Seq
17193 * @returns {Object} Returns the new `lodash` wrapper instance.
17194 * @example
17195 *
17196 * var array = [1, 2, 3];
17197 *
17198 * _(array).reverse().value()
17199 * // => [3, 2, 1]
17200 *
17201 * console.log(array);
17202 * // => [3, 2, 1]
17203 */
17204 function wrapperReverse() {
17205 var value = this.__wrapped__;
17206 if (value instanceof LazyWrapper) {
17207 var wrapped = value;
17208 if (this.__actions__.length) {
17209 wrapped = new LazyWrapper(this);
17210 }
17211 wrapped = wrapped.reverse();
17212 wrapped.__actions__.push({
17213 'func': thru,
17214 'args': [reverse],
17215 'thisArg': undefined
17216 });
17217 return new LodashWrapper(wrapped, this.__chain__);
17218 }
17219 return this.thru(reverse);
17220 }
17221
17222 /**
17223 * Executes the chain sequence to resolve the unwrapped value.
17224 *
17225 * @name value
17226 * @memberOf _
17227 * @since 0.1.0
17228 * @alias toJSON, valueOf
17229 * @category Seq
17230 * @returns {*} Returns the resolved unwrapped value.
17231 * @example
17232 *
17233 * _([1, 2, 3]).value();
17234 * // => [1, 2, 3]
17235 */
17236 function wrapperValue() {
17237 return baseWrapperValue(this.__wrapped__, this.__actions__);
17238 }
17239
17240 /*------------------------------------------------------------------------*/
17241
17242 /**
17243 * Creates an object composed of keys generated from the results of running
17244 * each element of `collection` thru `iteratee`. The corresponding value of
17245 * each key is the number of times the key was returned by `iteratee`. The
17246 * iteratee is invoked with one argument: (value).
17247 *
17248 * @static
17249 * @memberOf _
17250 * @since 0.5.0
17251 * @category Collection
17252 * @param {Array|Object} collection The collection to iterate over.
17253 * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
17254 * @returns {Object} Returns the composed aggregate object.
17255 * @example
17256 *
17257 * _.countBy([6.1, 4.2, 6.3], Math.floor);
17258 * // => { '4': 1, '6': 2 }
17259 *
17260 * // The `_.property` iteratee shorthand.
17261 * _.countBy(['one', 'two', 'three'], 'length');
17262 * // => { '3': 2, '5': 1 }
17263 */
17264 var countBy = createAggregator(function(result, value, key) {
17265 if (hasOwnProperty.call(result, key)) {
17266 ++result[key];
17267 } else {
17268 baseAssignValue(result, key, 1);
17269 }
17270 });
17271
17272 /**
17273 * Checks if `predicate` returns truthy for **all** elements of `collection`.
17274 * Iteration is stopped once `predicate` returns falsey. The predicate is
17275 * invoked with three arguments: (value, index|key, collection).
17276 *
17277 * **Note:** This method returns `true` for
17278 * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because
17279 * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of
17280 * elements of empty collections.
17281 *
17282 * @static
17283 * @memberOf _
17284 * @since 0.1.0
17285 * @category Collection
17286 * @param {Array|Object} collection The collection to iterate over.
17287 * @param {Function} [predicate=_.identity] The function invoked per iteration.
17288 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
17289 * @returns {boolean} Returns `true` if all elements pass the predicate check,
17290 * else `false`.
17291 * @example
17292 *
17293 * _.every([true, 1, null, 'yes'], Boolean);
17294 * // => false
17295 *
17296 * var users = [
17297 * { 'user': 'barney', 'age': 36, 'active': false },
17298 * { 'user': 'fred', 'age': 40, 'active': false }
17299 * ];
17300 *
17301 * // The `_.matches` iteratee shorthand.
17302 * _.every(users, { 'user': 'barney', 'active': false });
17303 * // => false
17304 *
17305 * // The `_.matchesProperty` iteratee shorthand.
17306 * _.every(users, ['active', false]);
17307 * // => true
17308 *
17309 * // The `_.property` iteratee shorthand.
17310 * _.every(users, 'active');
17311 * // => false
17312 */
17313 function every(collection, predicate, guard) {
17314 var func = isArray(collection) ? arrayEvery : baseEvery;
17315 if (guard && isIterateeCall(collection, predicate, guard)) {
17316 predicate = undefined;
17317 }
17318 return func(collection, getIteratee(predicate, 3));
17319 }
17320
17321 /**
17322 * Iterates over elements of `collection`, returning an array of all elements
17323 * `predicate` returns truthy for. The predicate is invoked with three
17324 * arguments: (value, index|key, collection).
17325 *
17326 * **Note:** Unlike `_.remove`, this method returns a new array.
17327 *
17328 * @static
17329 * @memberOf _
17330 * @since 0.1.0
17331 * @category Collection
17332 * @param {Array|Object} collection The collection to iterate over.
17333 * @param {Function} [predicate=_.identity] The function invoked per iteration.
17334 * @returns {Array} Returns the new filtered array.
17335 * @see _.reject
17336 * @example
17337 *
17338 * var users = [
17339 * { 'user': 'barney', 'age': 36, 'active': true },
17340 * { 'user': 'fred', 'age': 40, 'active': false }
17341 * ];
17342 *
17343 * _.filter(users, function(o) { return !o.active; });
17344 * // => objects for ['fred']
17345 *
17346 * // The `_.matches` iteratee shorthand.
17347 * _.filter(users, { 'age': 36, 'active': true });
17348 * // => objects for ['barney']
17349 *
17350 * // The `_.matchesProperty` iteratee shorthand.
17351 * _.filter(users, ['active', false]);
17352 * // => objects for ['fred']
17353 *
17354 * // The `_.property` iteratee shorthand.
17355 * _.filter(users, 'active');
17356 * // => objects for ['barney']
17357 */
17358 function filter(collection, predicate) {
17359 var func = isArray(collection) ? arrayFilter : baseFilter;
17360 return func(collection, getIteratee(predicate, 3));
17361 }
17362
17363 /**
17364 * Iterates over elements of `collection`, returning the first element
17365 * `predicate` returns truthy for. The predicate is invoked with three
17366 * arguments: (value, index|key, collection).
17367 *
17368 * @static
17369 * @memberOf _
17370 * @since 0.1.0
17371 * @category Collection
17372 * @param {Array|Object} collection The collection to inspect.
17373 * @param {Function} [predicate=_.identity] The function invoked per iteration.
17374 * @param {number} [fromIndex=0] The index to search from.
17375 * @returns {*} Returns the matched element, else `undefined`.
17376 * @example
17377 *
17378 * var users = [
17379 * { 'user': 'barney', 'age': 36, 'active': true },
17380 * { 'user': 'fred', 'age': 40, 'active': false },
17381 * { 'user': 'pebbles', 'age': 1, 'active': true }
17382 * ];
17383 *
17384 * _.find(users, function(o) { return o.age < 40; });
17385 * // => object for 'barney'
17386 *
17387 * // The `_.matches` iteratee shorthand.
17388 * _.find(users, { 'age': 1, 'active': true });
17389 * // => object for 'pebbles'
17390 *
17391 * // The `_.matchesProperty` iteratee shorthand.
17392 * _.find(users, ['active', false]);
17393 * // => object for 'fred'
17394 *
17395 * // The `_.property` iteratee shorthand.
17396 * _.find(users, 'active');
17397 * // => object for 'barney'
17398 */
17399 var find = createFind(findIndex);
17400
17401 /**
17402 * This method is like `_.find` except that it iterates over elements of
17403 * `collection` from right to left.
17404 *
17405 * @static
17406 * @memberOf _
17407 * @since 2.0.0
17408 * @category Collection
17409 * @param {Array|Object} collection The collection to inspect.
17410 * @param {Function} [predicate=_.identity] The function invoked per iteration.
17411 * @param {number} [fromIndex=collection.length-1] The index to search from.
17412 * @returns {*} Returns the matched element, else `undefined`.
17413 * @example
17414 *
17415 * _.findLast([1, 2, 3, 4], function(n) {
17416 * return n % 2 == 1;
17417 * });
17418 * // => 3
17419 */
17420 var findLast = createFind(findLastIndex);
17421
17422 /**
17423 * Creates a flattened array of values by running each element in `collection`
17424 * thru `iteratee` and flattening the mapped results. The iteratee is invoked
17425 * with three arguments: (value, index|key, collection).
17426 *
17427 * @static
17428 * @memberOf _
17429 * @since 4.0.0
17430 * @category Collection
17431 * @param {Array|Object} collection The collection to iterate over.
17432 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
17433 * @returns {Array} Returns the new flattened array.
17434 * @example
17435 *
17436 * function duplicate(n) {
17437 * return [n, n];
17438 * }
17439 *
17440 * _.flatMap([1, 2], duplicate);
17441 * // => [1, 1, 2, 2]
17442 */
17443 function flatMap(collection, iteratee) {
17444 return baseFlatten(map(collection, iteratee), 1);
17445 }
17446
17447 /**
17448 * This method is like `_.flatMap` except that it recursively flattens the
17449 * mapped results.
17450 *
17451 * @static
17452 * @memberOf _
17453 * @since 4.7.0
17454 * @category Collection
17455 * @param {Array|Object} collection The collection to iterate over.
17456 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
17457 * @returns {Array} Returns the new flattened array.
17458 * @example
17459 *
17460 * function duplicate(n) {
17461 * return [[[n, n]]];
17462 * }
17463 *
17464 * _.flatMapDeep([1, 2], duplicate);
17465 * // => [1, 1, 2, 2]
17466 */
17467 function flatMapDeep(collection, iteratee) {
17468 return baseFlatten(map(collection, iteratee), INFINITY);
17469 }
17470
17471 /**
17472 * This method is like `_.flatMap` except that it recursively flattens the
17473 * mapped results up to `depth` times.
17474 *
17475 * @static
17476 * @memberOf _
17477 * @since 4.7.0
17478 * @category Collection
17479 * @param {Array|Object} collection The collection to iterate over.
17480 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
17481 * @param {number} [depth=1] The maximum recursion depth.
17482 * @returns {Array} Returns the new flattened array.
17483 * @example
17484 *
17485 * function duplicate(n) {
17486 * return [[[n, n]]];
17487 * }
17488 *
17489 * _.flatMapDepth([1, 2], duplicate, 2);
17490 * // => [[1, 1], [2, 2]]
17491 */
17492 function flatMapDepth(collection, iteratee, depth) {
17493 depth = depth === undefined ? 1 : toInteger(depth);
17494 return baseFlatten(map(collection, iteratee), depth);
17495 }
17496
17497 /**
17498 * Iterates over elements of `collection` and invokes `iteratee` for each element.
17499 * The iteratee is invoked with three arguments: (value, index|key, collection).
17500 * Iteratee functions may exit iteration early by explicitly returning `false`.
17501 *
17502 * **Note:** As with other "Collections" methods, objects with a "length"
17503 * property are iterated like arrays. To avoid this behavior use `_.forIn`
17504 * or `_.forOwn` for object iteration.
17505 *
17506 * @static
17507 * @memberOf _
17508 * @since 0.1.0
17509 * @alias each
17510 * @category Collection
17511 * @param {Array|Object} collection The collection to iterate over.
17512 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
17513 * @returns {Array|Object} Returns `collection`.
17514 * @see _.forEachRight
17515 * @example
17516 *
17517 * _.forEach([1, 2], function(value) {
17518 * console.log(value);
17519 * });
17520 * // => Logs `1` then `2`.
17521 *
17522 * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {
17523 * console.log(key);
17524 * });
17525 * // => Logs 'a' then 'b' (iteration order is not guaranteed).
17526 */
17527 function forEach(collection, iteratee) {
17528 var func = isArray(collection) ? arrayEach : baseEach;
17529 return func(collection, getIteratee(iteratee, 3));
17530 }
17531
17532 /**
17533 * This method is like `_.forEach` except that it iterates over elements of
17534 * `collection` from right to left.
17535 *
17536 * @static
17537 * @memberOf _
17538 * @since 2.0.0
17539 * @alias eachRight
17540 * @category Collection
17541 * @param {Array|Object} collection The collection to iterate over.
17542 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
17543 * @returns {Array|Object} Returns `collection`.
17544 * @see _.forEach
17545 * @example
17546 *
17547 * _.forEachRight([1, 2], function(value) {
17548 * console.log(value);
17549 * });
17550 * // => Logs `2` then `1`.
17551 */
17552 function forEachRight(collection, iteratee) {
17553 var func = isArray(collection) ? arrayEachRight : baseEachRight;
17554 return func(collection, getIteratee(iteratee, 3));
17555 }
17556
17557 /**
17558 * Creates an object composed of keys generated from the results of running
17559 * each element of `collection` thru `iteratee`. The order of grouped values
17560 * is determined by the order they occur in `collection`. The corresponding
17561 * value of each key is an array of elements responsible for generating the
17562 * key. The iteratee is invoked with one argument: (value).
17563 *
17564 * @static
17565 * @memberOf _
17566 * @since 0.1.0
17567 * @category Collection
17568 * @param {Array|Object} collection The collection to iterate over.
17569 * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
17570 * @returns {Object} Returns the composed aggregate object.
17571 * @example
17572 *
17573 * _.groupBy([6.1, 4.2, 6.3], Math.floor);
17574 * // => { '4': [4.2], '6': [6.1, 6.3] }
17575 *
17576 * // The `_.property` iteratee shorthand.
17577 * _.groupBy(['one', 'two', 'three'], 'length');
17578 * // => { '3': ['one', 'two'], '5': ['three'] }
17579 */
17580 var groupBy = createAggregator(function(result, value, key) {
17581 if (hasOwnProperty.call(result, key)) {
17582 result[key].push(value);
17583 } else {
17584 baseAssignValue(result, key, [value]);
17585 }
17586 });
17587
17588 /**
17589 * Checks if `value` is in `collection`. If `collection` is a string, it's
17590 * checked for a substring of `value`, otherwise
17591 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
17592 * is used for equality comparisons. If `fromIndex` is negative, it's used as
17593 * the offset from the end of `collection`.
17594 *
17595 * @static
17596 * @memberOf _
17597 * @since 0.1.0
17598 * @category Collection
17599 * @param {Array|Object|string} collection The collection to inspect.
17600 * @param {*} value The value to search for.
17601 * @param {number} [fromIndex=0] The index to search from.
17602 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
17603 * @returns {boolean} Returns `true` if `value` is found, else `false`.
17604 * @example
17605 *
17606 * _.includes([1, 2, 3], 1);
17607 * // => true
17608 *
17609 * _.includes([1, 2, 3], 1, 2);
17610 * // => false
17611 *
17612 * _.includes({ 'a': 1, 'b': 2 }, 1);
17613 * // => true
17614 *
17615 * _.includes('abcd', 'bc');
17616 * // => true
17617 */
17618 function includes(collection, value, fromIndex, guard) {
17619 collection = isArrayLike(collection) ? collection : values(collection);
17620 fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;
17621
17622 var length = collection.length;
17623 if (fromIndex < 0) {
17624 fromIndex = nativeMax(length + fromIndex, 0);
17625 }
17626 return isString(collection)
17627 ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)
17628 : (!!length && baseIndexOf(collection, value, fromIndex) > -1);
17629 }
17630
17631 /**
17632 * Invokes the method at `path` of each element in `collection`, returning
17633 * an array of the results of each invoked method. Any additional arguments
17634 * are provided to each invoked method. If `path` is a function, it's invoked
17635 * for, and `this` bound to, each element in `collection`.
17636 *
17637 * @static
17638 * @memberOf _
17639 * @since 4.0.0
17640 * @category Collection
17641 * @param {Array|Object} collection The collection to iterate over.
17642 * @param {Array|Function|string} path The path of the method to invoke or
17643 * the function invoked per iteration.
17644 * @param {...*} [args] The arguments to invoke each method with.
17645 * @returns {Array} Returns the array of results.
17646 * @example
17647 *
17648 * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');
17649 * // => [[1, 5, 7], [1, 2, 3]]
17650 *
17651 * _.invokeMap([123, 456], String.prototype.split, '');
17652 * // => [['1', '2', '3'], ['4', '5', '6']]
17653 */
17654 var invokeMap = baseRest(function(collection, path, args) {
17655 var index = -1,
17656 isFunc = typeof path == 'function',
17657 result = isArrayLike(collection) ? Array(collection.length) : [];
17658
17659 baseEach(collection, function(value) {
17660 result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);
17661 });
17662 return result;
17663 });
17664
17665 /**
17666 * Creates an object composed of keys generated from the results of running
17667 * each element of `collection` thru `iteratee`. The corresponding value of
17668 * each key is the last element responsible for generating the key. The
17669 * iteratee is invoked with one argument: (value).
17670 *
17671 * @static
17672 * @memberOf _
17673 * @since 4.0.0
17674 * @category Collection
17675 * @param {Array|Object} collection The collection to iterate over.
17676 * @param {Function} [iteratee=_.identity] The iteratee to transform keys.
17677 * @returns {Object} Returns the composed aggregate object.
17678 * @example
17679 *
17680 * var array = [
17681 * { 'dir': 'left', 'code': 97 },
17682 * { 'dir': 'right', 'code': 100 }
17683 * ];
17684 *
17685 * _.keyBy(array, function(o) {
17686 * return String.fromCharCode(o.code);
17687 * });
17688 * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
17689 *
17690 * _.keyBy(array, 'dir');
17691 * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
17692 */
17693 var keyBy = createAggregator(function(result, value, key) {
17694 baseAssignValue(result, key, value);
17695 });
17696
17697 /**
17698 * Creates an array of values by running each element in `collection` thru
17699 * `iteratee`. The iteratee is invoked with three arguments:
17700 * (value, index|key, collection).
17701 *
17702 * Many lodash methods are guarded to work as iteratees for methods like
17703 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
17704 *
17705 * The guarded methods are:
17706 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,
17707 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,
17708 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,
17709 * `template`, `trim`, `trimEnd`, `trimStart`, and `words`
17710 *
17711 * @static
17712 * @memberOf _
17713 * @since 0.1.0
17714 * @category Collection
17715 * @param {Array|Object} collection The collection to iterate over.
17716 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
17717 * @returns {Array} Returns the new mapped array.
17718 * @example
17719 *
17720 * function square(n) {
17721 * return n * n;
17722 * }
17723 *
17724 * _.map([4, 8], square);
17725 * // => [16, 64]
17726 *
17727 * _.map({ 'a': 4, 'b': 8 }, square);
17728 * // => [16, 64] (iteration order is not guaranteed)
17729 *
17730 * var users = [
17731 * { 'user': 'barney' },
17732 * { 'user': 'fred' }
17733 * ];
17734 *
17735 * // The `_.property` iteratee shorthand.
17736 * _.map(users, 'user');
17737 * // => ['barney', 'fred']
17738 */
17739 function map(collection, iteratee) {
17740 var func = isArray(collection) ? arrayMap : baseMap;
17741 return func(collection, getIteratee(iteratee, 3));
17742 }
17743
17744 /**
17745 * This method is like `_.sortBy` except that it allows specifying the sort
17746 * orders of the iteratees to sort by. If `orders` is unspecified, all values
17747 * are sorted in ascending order. Otherwise, specify an order of "desc" for
17748 * descending or "asc" for ascending sort order of corresponding values.
17749 *
17750 * @static
17751 * @memberOf _
17752 * @since 4.0.0
17753 * @category Collection
17754 * @param {Array|Object} collection The collection to iterate over.
17755 * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]
17756 * The iteratees to sort by.
17757 * @param {string[]} [orders] The sort orders of `iteratees`.
17758 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.
17759 * @returns {Array} Returns the new sorted array.
17760 * @example
17761 *
17762 * var users = [
17763 * { 'user': 'fred', 'age': 48 },
17764 * { 'user': 'barney', 'age': 34 },
17765 * { 'user': 'fred', 'age': 40 },
17766 * { 'user': 'barney', 'age': 36 }
17767 * ];
17768 *
17769 * // Sort by `user` in ascending order and by `age` in descending order.
17770 * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);
17771 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
17772 */
17773 function orderBy(collection, iteratees, orders, guard) {
17774 if (collection == null) {
17775 return [];
17776 }
17777 if (!isArray(iteratees)) {
17778 iteratees = iteratees == null ? [] : [iteratees];
17779 }
17780 orders = guard ? undefined : orders;
17781 if (!isArray(orders)) {
17782 orders = orders == null ? [] : [orders];
17783 }
17784 return baseOrderBy(collection, iteratees, orders);
17785 }
17786
17787 /**
17788 * Creates an array of elements split into two groups, the first of which
17789 * contains elements `predicate` returns truthy for, the second of which
17790 * contains elements `predicate` returns falsey for. The predicate is
17791 * invoked with one argument: (value).
17792 *
17793 * @static
17794 * @memberOf _
17795 * @since 3.0.0
17796 * @category Collection
17797 * @param {Array|Object} collection The collection to iterate over.
17798 * @param {Function} [predicate=_.identity] The function invoked per iteration.
17799 * @returns {Array} Returns the array of grouped elements.
17800 * @example
17801 *
17802 * var users = [
17803 * { 'user': 'barney', 'age': 36, 'active': false },
17804 * { 'user': 'fred', 'age': 40, 'active': true },
17805 * { 'user': 'pebbles', 'age': 1, 'active': false }
17806 * ];
17807 *
17808 * _.partition(users, function(o) { return o.active; });
17809 * // => objects for [['fred'], ['barney', 'pebbles']]
17810 *
17811 * // The `_.matches` iteratee shorthand.
17812 * _.partition(users, { 'age': 1, 'active': false });
17813 * // => objects for [['pebbles'], ['barney', 'fred']]
17814 *
17815 * // The `_.matchesProperty` iteratee shorthand.
17816 * _.partition(users, ['active', false]);
17817 * // => objects for [['barney', 'pebbles'], ['fred']]
17818 *
17819 * // The `_.property` iteratee shorthand.
17820 * _.partition(users, 'active');
17821 * // => objects for [['fred'], ['barney', 'pebbles']]
17822 */
17823 var partition = createAggregator(function(result, value, key) {
17824 result[key ? 0 : 1].push(value);
17825 }, function() { return [[], []]; });
17826
17827 /**
17828 * Reduces `collection` to a value which is the accumulated result of running
17829 * each element in `collection` thru `iteratee`, where each successive
17830 * invocation is supplied the return value of the previous. If `accumulator`
17831 * is not given, the first element of `collection` is used as the initial
17832 * value. The iteratee is invoked with four arguments:
17833 * (accumulator, value, index|key, collection).
17834 *
17835 * Many lodash methods are guarded to work as iteratees for methods like
17836 * `_.reduce`, `_.reduceRight`, and `_.transform`.
17837 *
17838 * The guarded methods are:
17839 * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,
17840 * and `sortBy`
17841 *
17842 * @static
17843 * @memberOf _
17844 * @since 0.1.0
17845 * @category Collection
17846 * @param {Array|Object} collection The collection to iterate over.
17847 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
17848 * @param {*} [accumulator] The initial value.
17849 * @returns {*} Returns the accumulated value.
17850 * @see _.reduceRight
17851 * @example
17852 *
17853 * _.reduce([1, 2], function(sum, n) {
17854 * return sum + n;
17855 * }, 0);
17856 * // => 3
17857 *
17858 * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
17859 * (result[value] || (result[value] = [])).push(key);
17860 * return result;
17861 * }, {});
17862 * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)
17863 */
17864 function reduce(collection, iteratee, accumulator) {
17865 var func = isArray(collection) ? arrayReduce : baseReduce,
17866 initAccum = arguments.length < 3;
17867
17868 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);
17869 }
17870
17871 /**
17872 * This method is like `_.reduce` except that it iterates over elements of
17873 * `collection` from right to left.
17874 *
17875 * @static
17876 * @memberOf _
17877 * @since 0.1.0
17878 * @category Collection
17879 * @param {Array|Object} collection The collection to iterate over.
17880 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
17881 * @param {*} [accumulator] The initial value.
17882 * @returns {*} Returns the accumulated value.
17883 * @see _.reduce
17884 * @example
17885 *
17886 * var array = [[0, 1], [2, 3], [4, 5]];
17887 *
17888 * _.reduceRight(array, function(flattened, other) {
17889 * return flattened.concat(other);
17890 * }, []);
17891 * // => [4, 5, 2, 3, 0, 1]
17892 */
17893 function reduceRight(collection, iteratee, accumulator) {
17894 var func = isArray(collection) ? arrayReduceRight : baseReduce,
17895 initAccum = arguments.length < 3;
17896
17897 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);
17898 }
17899
17900 /**
17901 * The opposite of `_.filter`; this method returns the elements of `collection`
17902 * that `predicate` does **not** return truthy for.
17903 *
17904 * @static
17905 * @memberOf _
17906 * @since 0.1.0
17907 * @category Collection
17908 * @param {Array|Object} collection The collection to iterate over.
17909 * @param {Function} [predicate=_.identity] The function invoked per iteration.
17910 * @returns {Array} Returns the new filtered array.
17911 * @see _.filter
17912 * @example
17913 *
17914 * var users = [
17915 * { 'user': 'barney', 'age': 36, 'active': false },
17916 * { 'user': 'fred', 'age': 40, 'active': true }
17917 * ];
17918 *
17919 * _.reject(users, function(o) { return !o.active; });
17920 * // => objects for ['fred']
17921 *
17922 * // The `_.matches` iteratee shorthand.
17923 * _.reject(users, { 'age': 40, 'active': true });
17924 * // => objects for ['barney']
17925 *
17926 * // The `_.matchesProperty` iteratee shorthand.
17927 * _.reject(users, ['active', false]);
17928 * // => objects for ['fred']
17929 *
17930 * // The `_.property` iteratee shorthand.
17931 * _.reject(users, 'active');
17932 * // => objects for ['barney']
17933 */
17934 function reject(collection, predicate) {
17935 var func = isArray(collection) ? arrayFilter : baseFilter;
17936 return func(collection, negate(getIteratee(predicate, 3)));
17937 }
17938
17939 /**
17940 * Gets a random element from `collection`.
17941 *
17942 * @static
17943 * @memberOf _
17944 * @since 2.0.0
17945 * @category Collection
17946 * @param {Array|Object} collection The collection to sample.
17947 * @returns {*} Returns the random element.
17948 * @example
17949 *
17950 * _.sample([1, 2, 3, 4]);
17951 * // => 2
17952 */
17953 function sample(collection) {
17954 var func = isArray(collection) ? arraySample : baseSample;
17955 return func(collection);
17956 }
17957
17958 /**
17959 * Gets `n` random elements at unique keys from `collection` up to the
17960 * size of `collection`.
17961 *
17962 * @static
17963 * @memberOf _
17964 * @since 4.0.0
17965 * @category Collection
17966 * @param {Array|Object} collection The collection to sample.
17967 * @param {number} [n=1] The number of elements to sample.
17968 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
17969 * @returns {Array} Returns the random elements.
17970 * @example
17971 *
17972 * _.sampleSize([1, 2, 3], 2);
17973 * // => [3, 1]
17974 *
17975 * _.sampleSize([1, 2, 3], 4);
17976 * // => [2, 3, 1]
17977 */
17978 function sampleSize(collection, n, guard) {
17979 if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {
17980 n = 1;
17981 } else {
17982 n = toInteger(n);
17983 }
17984 var func = isArray(collection) ? arraySampleSize : baseSampleSize;
17985 return func(collection, n);
17986 }
17987
17988 /**
17989 * Creates an array of shuffled values, using a version of the
17990 * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
17991 *
17992 * @static
17993 * @memberOf _
17994 * @since 0.1.0
17995 * @category Collection
17996 * @param {Array|Object} collection The collection to shuffle.
17997 * @returns {Array} Returns the new shuffled array.
17998 * @example
17999 *
18000 * _.shuffle([1, 2, 3, 4]);
18001 * // => [4, 1, 3, 2]
18002 */
18003 function shuffle(collection) {
18004 var func = isArray(collection) ? arrayShuffle : baseShuffle;
18005 return func(collection);
18006 }
18007
18008 /**
18009 * Gets the size of `collection` by returning its length for array-like
18010 * values or the number of own enumerable string keyed properties for objects.
18011 *
18012 * @static
18013 * @memberOf _
18014 * @since 0.1.0
18015 * @category Collection
18016 * @param {Array|Object|string} collection The collection to inspect.
18017 * @returns {number} Returns the collection size.
18018 * @example
18019 *
18020 * _.size([1, 2, 3]);
18021 * // => 3
18022 *
18023 * _.size({ 'a': 1, 'b': 2 });
18024 * // => 2
18025 *
18026 * _.size('pebbles');
18027 * // => 7
18028 */
18029 function size(collection) {
18030 if (collection == null) {
18031 return 0;
18032 }
18033 if (isArrayLike(collection)) {
18034 return isString(collection) ? stringSize(collection) : collection.length;
18035 }
18036 var tag = getTag(collection);
18037 if (tag == mapTag || tag == setTag) {
18038 return collection.size;
18039 }
18040 return baseKeys(collection).length;
18041 }
18042
18043 /**
18044 * Checks if `predicate` returns truthy for **any** element of `collection`.
18045 * Iteration is stopped once `predicate` returns truthy. The predicate is
18046 * invoked with three arguments: (value, index|key, collection).
18047 *
18048 * @static
18049 * @memberOf _
18050 * @since 0.1.0
18051 * @category Collection
18052 * @param {Array|Object} collection The collection to iterate over.
18053 * @param {Function} [predicate=_.identity] The function invoked per iteration.
18054 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
18055 * @returns {boolean} Returns `true` if any element passes the predicate check,
18056 * else `false`.
18057 * @example
18058 *
18059 * _.some([null, 0, 'yes', false], Boolean);
18060 * // => true
18061 *
18062 * var users = [
18063 * { 'user': 'barney', 'active': true },
18064 * { 'user': 'fred', 'active': false }
18065 * ];
18066 *
18067 * // The `_.matches` iteratee shorthand.
18068 * _.some(users, { 'user': 'barney', 'active': false });
18069 * // => false
18070 *
18071 * // The `_.matchesProperty` iteratee shorthand.
18072 * _.some(users, ['active', false]);
18073 * // => true
18074 *
18075 * // The `_.property` iteratee shorthand.
18076 * _.some(users, 'active');
18077 * // => true
18078 */
18079 function some(collection, predicate, guard) {
18080 var func = isArray(collection) ? arraySome : baseSome;
18081 if (guard && isIterateeCall(collection, predicate, guard)) {
18082 predicate = undefined;
18083 }
18084 return func(collection, getIteratee(predicate, 3));
18085 }
18086
18087 /**
18088 * Creates an array of elements, sorted in ascending order by the results of
18089 * running each element in a collection thru each iteratee. This method
18090 * performs a stable sort, that is, it preserves the original sort order of
18091 * equal elements. The iteratees are invoked with one argument: (value).
18092 *
18093 * @static
18094 * @memberOf _
18095 * @since 0.1.0
18096 * @category Collection
18097 * @param {Array|Object} collection The collection to iterate over.
18098 * @param {...(Function|Function[])} [iteratees=[_.identity]]
18099 * The iteratees to sort by.
18100 * @returns {Array} Returns the new sorted array.
18101 * @example
18102 *
18103 * var users = [
18104 * { 'user': 'fred', 'age': 48 },
18105 * { 'user': 'barney', 'age': 36 },
18106 * { 'user': 'fred', 'age': 40 },
18107 * { 'user': 'barney', 'age': 34 }
18108 * ];
18109 *
18110 * _.sortBy(users, [function(o) { return o.user; }]);
18111 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]
18112 *
18113 * _.sortBy(users, ['user', 'age']);
18114 * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]
18115 */
18116 var sortBy = baseRest(function(collection, iteratees) {
18117 if (collection == null) {
18118 return [];
18119 }
18120 var length = iteratees.length;
18121 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
18122 iteratees = [];
18123 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
18124 iteratees = [iteratees[0]];
18125 }
18126 return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
18127 });
18128
18129 /*------------------------------------------------------------------------*/
18130
18131 /**
18132 * Gets the timestamp of the number of milliseconds that have elapsed since
18133 * the Unix epoch (1 January 1970 00:00:00 UTC).
18134 *
18135 * @static
18136 * @memberOf _
18137 * @since 2.4.0
18138 * @category Date
18139 * @returns {number} Returns the timestamp.
18140 * @example
18141 *
18142 * _.defer(function(stamp) {
18143 * console.log(_.now() - stamp);
18144 * }, _.now());
18145 * // => Logs the number of milliseconds it took for the deferred invocation.
18146 */
18147 var now = ctxNow || function() {
18148 return root.Date.now();
18149 };
18150
18151 /*------------------------------------------------------------------------*/
18152
18153 /**
18154 * The opposite of `_.before`; this method creates a function that invokes
18155 * `func` once it's called `n` or more times.
18156 *
18157 * @static
18158 * @memberOf _
18159 * @since 0.1.0
18160 * @category Function
18161 * @param {number} n The number of calls before `func` is invoked.
18162 * @param {Function} func The function to restrict.
18163 * @returns {Function} Returns the new restricted function.
18164 * @example
18165 *
18166 * var saves = ['profile', 'settings'];
18167 *
18168 * var done = _.after(saves.length, function() {
18169 * console.log('done saving!');
18170 * });
18171 *
18172 * _.forEach(saves, function(type) {
18173 * asyncSave({ 'type': type, 'complete': done });
18174 * });
18175 * // => Logs 'done saving!' after the two async saves have completed.
18176 */
18177 function after(n, func) {
18178 if (typeof func != 'function') {
18179 throw new TypeError(FUNC_ERROR_TEXT);
18180 }
18181 n = toInteger(n);
18182 return function() {
18183 if (--n < 1) {
18184 return func.apply(this, arguments);
18185 }
18186 };
18187 }
18188
18189 /**
18190 * Creates a function that invokes `func`, with up to `n` arguments,
18191 * ignoring any additional arguments.
18192 *
18193 * @static
18194 * @memberOf _
18195 * @since 3.0.0
18196 * @category Function
18197 * @param {Function} func The function to cap arguments for.
18198 * @param {number} [n=func.length] The arity cap.
18199 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
18200 * @returns {Function} Returns the new capped function.
18201 * @example
18202 *
18203 * _.map(['6', '8', '10'], _.ary(parseInt, 1));
18204 * // => [6, 8, 10]
18205 */
18206 function ary(func, n, guard) {
18207 n = guard ? undefined : n;
18208 n = (func && n == null) ? func.length : n;
18209 return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);
18210 }
18211
18212 /**
18213 * Creates a function that invokes `func`, with the `this` binding and arguments
18214 * of the created function, while it's called less than `n` times. Subsequent
18215 * calls to the created function return the result of the last `func` invocation.
18216 *
18217 * @static
18218 * @memberOf _
18219 * @since 3.0.0
18220 * @category Function
18221 * @param {number} n The number of calls at which `func` is no longer invoked.
18222 * @param {Function} func The function to restrict.
18223 * @returns {Function} Returns the new restricted function.
18224 * @example
18225 *
18226 * jQuery(element).on('click', _.before(5, addContactToList));
18227 * // => Allows adding up to 4 contacts to the list.
18228 */
18229 function before(n, func) {
18230 var result;
18231 if (typeof func != 'function') {
18232 throw new TypeError(FUNC_ERROR_TEXT);
18233 }
18234 n = toInteger(n);
18235 return function() {
18236 if (--n > 0) {
18237 result = func.apply(this, arguments);
18238 }
18239 if (n <= 1) {
18240 func = undefined;
18241 }
18242 return result;
18243 };
18244 }
18245
18246 /**
18247 * Creates a function that invokes `func` with the `this` binding of `thisArg`
18248 * and `partials` prepended to the arguments it receives.
18249 *
18250 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
18251 * may be used as a placeholder for partially applied arguments.
18252 *
18253 * **Note:** Unlike native `Function#bind`, this method doesn't set the "length"
18254 * property of bound functions.
18255 *
18256 * @static
18257 * @memberOf _
18258 * @since 0.1.0
18259 * @category Function
18260 * @param {Function} func The function to bind.
18261 * @param {*} thisArg The `this` binding of `func`.
18262 * @param {...*} [partials] The arguments to be partially applied.
18263 * @returns {Function} Returns the new bound function.
18264 * @example
18265 *
18266 * function greet(greeting, punctuation) {
18267 * return greeting + ' ' + this.user + punctuation;
18268 * }
18269 *
18270 * var object = { 'user': 'fred' };
18271 *
18272 * var bound = _.bind(greet, object, 'hi');
18273 * bound('!');
18274 * // => 'hi fred!'
18275 *
18276 * // Bound with placeholders.
18277 * var bound = _.bind(greet, object, _, '!');
18278 * bound('hi');
18279 * // => 'hi fred!'
18280 */
18281 var bind = baseRest(function(func, thisArg, partials) {
18282 var bitmask = WRAP_BIND_FLAG;
18283 if (partials.length) {
18284 var holders = replaceHolders(partials, getHolder(bind));
18285 bitmask |= WRAP_PARTIAL_FLAG;
18286 }
18287 return createWrap(func, bitmask, thisArg, partials, holders);
18288 });
18289
18290 /**
18291 * Creates a function that invokes the method at `object[key]` with `partials`
18292 * prepended to the arguments it receives.
18293 *
18294 * This method differs from `_.bind` by allowing bound functions to reference
18295 * methods that may be redefined or don't yet exist. See
18296 * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
18297 * for more details.
18298 *
18299 * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
18300 * builds, may be used as a placeholder for partially applied arguments.
18301 *
18302 * @static
18303 * @memberOf _
18304 * @since 0.10.0
18305 * @category Function
18306 * @param {Object} object The object to invoke the method on.
18307 * @param {string} key The key of the method.
18308 * @param {...*} [partials] The arguments to be partially applied.
18309 * @returns {Function} Returns the new bound function.
18310 * @example
18311 *
18312 * var object = {
18313 * 'user': 'fred',
18314 * 'greet': function(greeting, punctuation) {
18315 * return greeting + ' ' + this.user + punctuation;
18316 * }
18317 * };
18318 *
18319 * var bound = _.bindKey(object, 'greet', 'hi');
18320 * bound('!');
18321 * // => 'hi fred!'
18322 *
18323 * object.greet = function(greeting, punctuation) {
18324 * return greeting + 'ya ' + this.user + punctuation;
18325 * };
18326 *
18327 * bound('!');
18328 * // => 'hiya fred!'
18329 *
18330 * // Bound with placeholders.
18331 * var bound = _.bindKey(object, 'greet', _, '!');
18332 * bound('hi');
18333 * // => 'hiya fred!'
18334 */
18335 var bindKey = baseRest(function(object, key, partials) {
18336 var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;
18337 if (partials.length) {
18338 var holders = replaceHolders(partials, getHolder(bindKey));
18339 bitmask |= WRAP_PARTIAL_FLAG;
18340 }
18341 return createWrap(key, bitmask, object, partials, holders);
18342 });
18343
18344 /**
18345 * Creates a function that accepts arguments of `func` and either invokes
18346 * `func` returning its result, if at least `arity` number of arguments have
18347 * been provided, or returns a function that accepts the remaining `func`
18348 * arguments, and so on. The arity of `func` may be specified if `func.length`
18349 * is not sufficient.
18350 *
18351 * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
18352 * may be used as a placeholder for provided arguments.
18353 *
18354 * **Note:** This method doesn't set the "length" property of curried functions.
18355 *
18356 * @static
18357 * @memberOf _
18358 * @since 2.0.0
18359 * @category Function
18360 * @param {Function} func The function to curry.
18361 * @param {number} [arity=func.length] The arity of `func`.
18362 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
18363 * @returns {Function} Returns the new curried function.
18364 * @example
18365 *
18366 * var abc = function(a, b, c) {
18367 * return [a, b, c];
18368 * };
18369 *
18370 * var curried = _.curry(abc);
18371 *
18372 * curried(1)(2)(3);
18373 * // => [1, 2, 3]
18374 *
18375 * curried(1, 2)(3);
18376 * // => [1, 2, 3]
18377 *
18378 * curried(1, 2, 3);
18379 * // => [1, 2, 3]
18380 *
18381 * // Curried with placeholders.
18382 * curried(1)(_, 3)(2);
18383 * // => [1, 2, 3]
18384 */
18385 function curry(func, arity, guard) {
18386 arity = guard ? undefined : arity;
18387 var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
18388 result.placeholder = curry.placeholder;
18389 return result;
18390 }
18391
18392 /**
18393 * This method is like `_.curry` except that arguments are applied to `func`
18394 * in the manner of `_.partialRight` instead of `_.partial`.
18395 *
18396 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
18397 * builds, may be used as a placeholder for provided arguments.
18398 *
18399 * **Note:** This method doesn't set the "length" property of curried functions.
18400 *
18401 * @static
18402 * @memberOf _
18403 * @since 3.0.0
18404 * @category Function
18405 * @param {Function} func The function to curry.
18406 * @param {number} [arity=func.length] The arity of `func`.
18407 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
18408 * @returns {Function} Returns the new curried function.
18409 * @example
18410 *
18411 * var abc = function(a, b, c) {
18412 * return [a, b, c];
18413 * };
18414 *
18415 * var curried = _.curryRight(abc);
18416 *
18417 * curried(3)(2)(1);
18418 * // => [1, 2, 3]
18419 *
18420 * curried(2, 3)(1);
18421 * // => [1, 2, 3]
18422 *
18423 * curried(1, 2, 3);
18424 * // => [1, 2, 3]
18425 *
18426 * // Curried with placeholders.
18427 * curried(3)(1, _)(2);
18428 * // => [1, 2, 3]
18429 */
18430 function curryRight(func, arity, guard) {
18431 arity = guard ? undefined : arity;
18432 var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);
18433 result.placeholder = curryRight.placeholder;
18434 return result;
18435 }
18436
18437 /**
18438 * Creates a debounced function that delays invoking `func` until after `wait`
18439 * milliseconds have elapsed since the last time the debounced function was
18440 * invoked. The debounced function comes with a `cancel` method to cancel
18441 * delayed `func` invocations and a `flush` method to immediately invoke them.
18442 * Provide `options` to indicate whether `func` should be invoked on the
18443 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked
18444 * with the last arguments provided to the debounced function. Subsequent
18445 * calls to the debounced function return the result of the last `func`
18446 * invocation.
18447 *
18448 * **Note:** If `leading` and `trailing` options are `true`, `func` is
18449 * invoked on the trailing edge of the timeout only if the debounced function
18450 * is invoked more than once during the `wait` timeout.
18451 *
18452 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
18453 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
18454 *
18455 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
18456 * for details over the differences between `_.debounce` and `_.throttle`.
18457 *
18458 * @static
18459 * @memberOf _
18460 * @since 0.1.0
18461 * @category Function
18462 * @param {Function} func The function to debounce.
18463 * @param {number} [wait=0] The number of milliseconds to delay.
18464 * @param {Object} [options={}] The options object.
18465 * @param {boolean} [options.leading=false]
18466 * Specify invoking on the leading edge of the timeout.
18467 * @param {number} [options.maxWait]
18468 * The maximum time `func` is allowed to be delayed before it's invoked.
18469 * @param {boolean} [options.trailing=true]
18470 * Specify invoking on the trailing edge of the timeout.
18471 * @returns {Function} Returns the new debounced function.
18472 * @example
18473 *
18474 * // Avoid costly calculations while the window size is in flux.
18475 * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
18476 *
18477 * // Invoke `sendMail` when clicked, debouncing subsequent calls.
18478 * jQuery(element).on('click', _.debounce(sendMail, 300, {
18479 * 'leading': true,
18480 * 'trailing': false
18481 * }));
18482 *
18483 * // Ensure `batchLog` is invoked once after 1 second of debounced calls.
18484 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
18485 * var source = new EventSource('/stream');
18486 * jQuery(source).on('message', debounced);
18487 *
18488 * // Cancel the trailing debounced invocation.
18489 * jQuery(window).on('popstate', debounced.cancel);
18490 */
18491 function debounce(func, wait, options) {
18492 var lastArgs,
18493 lastThis,
18494 maxWait,
18495 result,
18496 timerId,
18497 lastCallTime,
18498 lastInvokeTime = 0,
18499 leading = false,
18500 maxing = false,
18501 trailing = true;
18502
18503 if (typeof func != 'function') {
18504 throw new TypeError(FUNC_ERROR_TEXT);
18505 }
18506 wait = toNumber(wait) || 0;
18507 if (isObject(options)) {
18508 leading = !!options.leading;
18509 maxing = 'maxWait' in options;
18510 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
18511 trailing = 'trailing' in options ? !!options.trailing : trailing;
18512 }
18513
18514 function invokeFunc(time) {
18515 var args = lastArgs,
18516 thisArg = lastThis;
18517
18518 lastArgs = lastThis = undefined;
18519 lastInvokeTime = time;
18520 result = func.apply(thisArg, args);
18521 return result;
18522 }
18523
18524 function leadingEdge(time) {
18525 // Reset any `maxWait` timer.
18526 lastInvokeTime = time;
18527 // Start the timer for the trailing edge.
18528 timerId = setTimeout(timerExpired, wait);
18529 // Invoke the leading edge.
18530 return leading ? invokeFunc(time) : result;
18531 }
18532
18533 function remainingWait(time) {
18534 var timeSinceLastCall = time - lastCallTime,
18535 timeSinceLastInvoke = time - lastInvokeTime,
18536 timeWaiting = wait - timeSinceLastCall;
18537
18538 return maxing
18539 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
18540 : timeWaiting;
18541 }
18542
18543 function shouldInvoke(time) {
18544 var timeSinceLastCall = time - lastCallTime,
18545 timeSinceLastInvoke = time - lastInvokeTime;
18546
18547 // Either this is the first call, activity has stopped and we're at the
18548 // trailing edge, the system time has gone backwards and we're treating
18549 // it as the trailing edge, or we've hit the `maxWait` limit.
18550 return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
18551 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
18552 }
18553
18554 function timerExpired() {
18555 var time = now();
18556 if (shouldInvoke(time)) {
18557 return trailingEdge(time);
18558 }
18559 // Restart the timer.
18560 timerId = setTimeout(timerExpired, remainingWait(time));
18561 }
18562
18563 function trailingEdge(time) {
18564 timerId = undefined;
18565
18566 // Only invoke if we have `lastArgs` which means `func` has been
18567 // debounced at least once.
18568 if (trailing && lastArgs) {
18569 return invokeFunc(time);
18570 }
18571 lastArgs = lastThis = undefined;
18572 return result;
18573 }
18574
18575 function cancel() {
18576 if (timerId !== undefined) {
18577 clearTimeout(timerId);
18578 }
18579 lastInvokeTime = 0;
18580 lastArgs = lastCallTime = lastThis = timerId = undefined;
18581 }
18582
18583 function flush() {
18584 return timerId === undefined ? result : trailingEdge(now());
18585 }
18586
18587 function debounced() {
18588 var time = now(),
18589 isInvoking = shouldInvoke(time);
18590
18591 lastArgs = arguments;
18592 lastThis = this;
18593 lastCallTime = time;
18594
18595 if (isInvoking) {
18596 if (timerId === undefined) {
18597 return leadingEdge(lastCallTime);
18598 }
18599 if (maxing) {
18600 // Handle invocations in a tight loop.
18601 timerId = setTimeout(timerExpired, wait);
18602 return invokeFunc(lastCallTime);
18603 }
18604 }
18605 if (timerId === undefined) {
18606 timerId = setTimeout(timerExpired, wait);
18607 }
18608 return result;
18609 }
18610 debounced.cancel = cancel;
18611 debounced.flush = flush;
18612 return debounced;
18613 }
18614
18615 /**
18616 * Defers invoking the `func` until the current call stack has cleared. Any
18617 * additional arguments are provided to `func` when it's invoked.
18618 *
18619 * @static
18620 * @memberOf _
18621 * @since 0.1.0
18622 * @category Function
18623 * @param {Function} func The function to defer.
18624 * @param {...*} [args] The arguments to invoke `func` with.
18625 * @returns {number} Returns the timer id.
18626 * @example
18627 *
18628 * _.defer(function(text) {
18629 * console.log(text);
18630 * }, 'deferred');
18631 * // => Logs 'deferred' after one millisecond.
18632 */
18633 var defer = baseRest(function(func, args) {
18634 return baseDelay(func, 1, args);
18635 });
18636
18637 /**
18638 * Invokes `func` after `wait` milliseconds. Any additional arguments are
18639 * provided to `func` when it's invoked.
18640 *
18641 * @static
18642 * @memberOf _
18643 * @since 0.1.0
18644 * @category Function
18645 * @param {Function} func The function to delay.
18646 * @param {number} wait The number of milliseconds to delay invocation.
18647 * @param {...*} [args] The arguments to invoke `func` with.
18648 * @returns {number} Returns the timer id.
18649 * @example
18650 *
18651 * _.delay(function(text) {
18652 * console.log(text);
18653 * }, 1000, 'later');
18654 * // => Logs 'later' after one second.
18655 */
18656 var delay = baseRest(function(func, wait, args) {
18657 return baseDelay(func, toNumber(wait) || 0, args);
18658 });
18659
18660 /**
18661 * Creates a function that invokes `func` with arguments reversed.
18662 *
18663 * @static
18664 * @memberOf _
18665 * @since 4.0.0
18666 * @category Function
18667 * @param {Function} func The function to flip arguments for.
18668 * @returns {Function} Returns the new flipped function.
18669 * @example
18670 *
18671 * var flipped = _.flip(function() {
18672 * return _.toArray(arguments);
18673 * });
18674 *
18675 * flipped('a', 'b', 'c', 'd');
18676 * // => ['d', 'c', 'b', 'a']
18677 */
18678 function flip(func) {
18679 return createWrap(func, WRAP_FLIP_FLAG);
18680 }
18681
18682 /**
18683 * Creates a function that memoizes the result of `func`. If `resolver` is
18684 * provided, it determines the cache key for storing the result based on the
18685 * arguments provided to the memoized function. By default, the first argument
18686 * provided to the memoized function is used as the map cache key. The `func`
18687 * is invoked with the `this` binding of the memoized function.
18688 *
18689 * **Note:** The cache is exposed as the `cache` property on the memoized
18690 * function. Its creation may be customized by replacing the `_.memoize.Cache`
18691 * constructor with one whose instances implement the
18692 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
18693 * method interface of `clear`, `delete`, `get`, `has`, and `set`.
18694 *
18695 * @static
18696 * @memberOf _
18697 * @since 0.1.0
18698 * @category Function
18699 * @param {Function} func The function to have its output memoized.
18700 * @param {Function} [resolver] The function to resolve the cache key.
18701 * @returns {Function} Returns the new memoized function.
18702 * @example
18703 *
18704 * var object = { 'a': 1, 'b': 2 };
18705 * var other = { 'c': 3, 'd': 4 };
18706 *
18707 * var values = _.memoize(_.values);
18708 * values(object);
18709 * // => [1, 2]
18710 *
18711 * values(other);
18712 * // => [3, 4]
18713 *
18714 * object.a = 2;
18715 * values(object);
18716 * // => [1, 2]
18717 *
18718 * // Modify the result cache.
18719 * values.cache.set(object, ['a', 'b']);
18720 * values(object);
18721 * // => ['a', 'b']
18722 *
18723 * // Replace `_.memoize.Cache`.
18724 * _.memoize.Cache = WeakMap;
18725 */
18726 function memoize(func, resolver) {
18727 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
18728 throw new TypeError(FUNC_ERROR_TEXT);
18729 }
18730 var memoized = function() {
18731 var args = arguments,
18732 key = resolver ? resolver.apply(this, args) : args[0],
18733 cache = memoized.cache;
18734
18735 if (cache.has(key)) {
18736 return cache.get(key);
18737 }
18738 var result = func.apply(this, args);
18739 memoized.cache = cache.set(key, result) || cache;
18740 return result;
18741 };
18742 memoized.cache = new (memoize.Cache || MapCache);
18743 return memoized;
18744 }
18745
18746 // Expose `MapCache`.
18747 memoize.Cache = MapCache;
18748
18749 /**
18750 * Creates a function that negates the result of the predicate `func`. The
18751 * `func` predicate is invoked with the `this` binding and arguments of the
18752 * created function.
18753 *
18754 * @static
18755 * @memberOf _
18756 * @since 3.0.0
18757 * @category Function
18758 * @param {Function} predicate The predicate to negate.
18759 * @returns {Function} Returns the new negated function.
18760 * @example
18761 *
18762 * function isEven(n) {
18763 * return n % 2 == 0;
18764 * }
18765 *
18766 * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
18767 * // => [1, 3, 5]
18768 */
18769 function negate(predicate) {
18770 if (typeof predicate != 'function') {
18771 throw new TypeError(FUNC_ERROR_TEXT);
18772 }
18773 return function() {
18774 var args = arguments;
18775 switch (args.length) {
18776 case 0: return !predicate.call(this);
18777 case 1: return !predicate.call(this, args[0]);
18778 case 2: return !predicate.call(this, args[0], args[1]);
18779 case 3: return !predicate.call(this, args[0], args[1], args[2]);
18780 }
18781 return !predicate.apply(this, args);
18782 };
18783 }
18784
18785 /**
18786 * Creates a function that is restricted to invoking `func` once. Repeat calls
18787 * to the function return the value of the first invocation. The `func` is
18788 * invoked with the `this` binding and arguments of the created function.
18789 *
18790 * @static
18791 * @memberOf _
18792 * @since 0.1.0
18793 * @category Function
18794 * @param {Function} func The function to restrict.
18795 * @returns {Function} Returns the new restricted function.
18796 * @example
18797 *
18798 * var initialize = _.once(createApplication);
18799 * initialize();
18800 * initialize();
18801 * // => `createApplication` is invoked once
18802 */
18803 function once(func) {
18804 return before(2, func);
18805 }
18806
18807 /**
18808 * Creates a function that invokes `func` with its arguments transformed.
18809 *
18810 * @static
18811 * @since 4.0.0
18812 * @memberOf _
18813 * @category Function
18814 * @param {Function} func The function to wrap.
18815 * @param {...(Function|Function[])} [transforms=[_.identity]]
18816 * The argument transforms.
18817 * @returns {Function} Returns the new function.
18818 * @example
18819 *
18820 * function doubled(n) {
18821 * return n * 2;
18822 * }
18823 *
18824 * function square(n) {
18825 * return n * n;
18826 * }
18827 *
18828 * var func = _.overArgs(function(x, y) {
18829 * return [x, y];
18830 * }, [square, doubled]);
18831 *
18832 * func(9, 3);
18833 * // => [81, 6]
18834 *
18835 * func(10, 5);
18836 * // => [100, 10]
18837 */
18838 var overArgs = castRest(function(func, transforms) {
18839 transforms = (transforms.length == 1 && isArray(transforms[0]))
18840 ? arrayMap(transforms[0], baseUnary(getIteratee()))
18841 : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
18842
18843 var funcsLength = transforms.length;
18844 return baseRest(function(args) {
18845 var index = -1,
18846 length = nativeMin(args.length, funcsLength);
18847
18848 while (++index < length) {
18849 args[index] = transforms[index].call(this, args[index]);
18850 }
18851 return apply(func, this, args);
18852 });
18853 });
18854
18855 /**
18856 * Creates a function that invokes `func` with `partials` prepended to the
18857 * arguments it receives. This method is like `_.bind` except it does **not**
18858 * alter the `this` binding.
18859 *
18860 * The `_.partial.placeholder` value, which defaults to `_` in monolithic
18861 * builds, may be used as a placeholder for partially applied arguments.
18862 *
18863 * **Note:** This method doesn't set the "length" property of partially
18864 * applied functions.
18865 *
18866 * @static
18867 * @memberOf _
18868 * @since 0.2.0
18869 * @category Function
18870 * @param {Function} func The function to partially apply arguments to.
18871 * @param {...*} [partials] The arguments to be partially applied.
18872 * @returns {Function} Returns the new partially applied function.
18873 * @example
18874 *
18875 * function greet(greeting, name) {
18876 * return greeting + ' ' + name;
18877 * }
18878 *
18879 * var sayHelloTo = _.partial(greet, 'hello');
18880 * sayHelloTo('fred');
18881 * // => 'hello fred'
18882 *
18883 * // Partially applied with placeholders.
18884 * var greetFred = _.partial(greet, _, 'fred');
18885 * greetFred('hi');
18886 * // => 'hi fred'
18887 */
18888 var partial = baseRest(function(func, partials) {
18889 var holders = replaceHolders(partials, getHolder(partial));
18890 return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);
18891 });
18892
18893 /**
18894 * This method is like `_.partial` except that partially applied arguments
18895 * are appended to the arguments it receives.
18896 *
18897 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
18898 * builds, may be used as a placeholder for partially applied arguments.
18899 *
18900 * **Note:** This method doesn't set the "length" property of partially
18901 * applied functions.
18902 *
18903 * @static
18904 * @memberOf _
18905 * @since 1.0.0
18906 * @category Function
18907 * @param {Function} func The function to partially apply arguments to.
18908 * @param {...*} [partials] The arguments to be partially applied.
18909 * @returns {Function} Returns the new partially applied function.
18910 * @example
18911 *
18912 * function greet(greeting, name) {
18913 * return greeting + ' ' + name;
18914 * }
18915 *
18916 * var greetFred = _.partialRight(greet, 'fred');
18917 * greetFred('hi');
18918 * // => 'hi fred'
18919 *
18920 * // Partially applied with placeholders.
18921 * var sayHelloTo = _.partialRight(greet, 'hello', _);
18922 * sayHelloTo('fred');
18923 * // => 'hello fred'
18924 */
18925 var partialRight = baseRest(function(func, partials) {
18926 var holders = replaceHolders(partials, getHolder(partialRight));
18927 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);
18928 });
18929
18930 /**
18931 * Creates a function that invokes `func` with arguments arranged according
18932 * to the specified `indexes` where the argument value at the first index is
18933 * provided as the first argument, the argument value at the second index is
18934 * provided as the second argument, and so on.
18935 *
18936 * @static
18937 * @memberOf _
18938 * @since 3.0.0
18939 * @category Function
18940 * @param {Function} func The function to rearrange arguments for.
18941 * @param {...(number|number[])} indexes The arranged argument indexes.
18942 * @returns {Function} Returns the new function.
18943 * @example
18944 *
18945 * var rearged = _.rearg(function(a, b, c) {
18946 * return [a, b, c];
18947 * }, [2, 0, 1]);
18948 *
18949 * rearged('b', 'c', 'a')
18950 * // => ['a', 'b', 'c']
18951 */
18952 var rearg = flatRest(function(func, indexes) {
18953 return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);
18954 });
18955
18956 /**
18957 * Creates a function that invokes `func` with the `this` binding of the
18958 * created function and arguments from `start` and beyond provided as
18959 * an array.
18960 *
18961 * **Note:** This method is based on the
18962 * [rest parameter](https://mdn.io/rest_parameters).
18963 *
18964 * @static
18965 * @memberOf _
18966 * @since 4.0.0
18967 * @category Function
18968 * @param {Function} func The function to apply a rest parameter to.
18969 * @param {number} [start=func.length-1] The start position of the rest parameter.
18970 * @returns {Function} Returns the new function.
18971 * @example
18972 *
18973 * var say = _.rest(function(what, names) {
18974 * return what + ' ' + _.initial(names).join(', ') +
18975 * (_.size(names) > 1 ? ', & ' : '') + _.last(names);
18976 * });
18977 *
18978 * say('hello', 'fred', 'barney', 'pebbles');
18979 * // => 'hello fred, barney, & pebbles'
18980 */
18981 function rest(func, start) {
18982 if (typeof func != 'function') {
18983 throw new TypeError(FUNC_ERROR_TEXT);
18984 }
18985 start = start === undefined ? start : toInteger(start);
18986 return baseRest(func, start);
18987 }
18988
18989 /**
18990 * Creates a function that invokes `func` with the `this` binding of the
18991 * create function and an array of arguments much like
18992 * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).
18993 *
18994 * **Note:** This method is based on the
18995 * [spread operator](https://mdn.io/spread_operator).
18996 *
18997 * @static
18998 * @memberOf _
18999 * @since 3.2.0
19000 * @category Function
19001 * @param {Function} func The function to spread arguments over.
19002 * @param {number} [start=0] The start position of the spread.
19003 * @returns {Function} Returns the new function.
19004 * @example
19005 *
19006 * var say = _.spread(function(who, what) {
19007 * return who + ' says ' + what;
19008 * });
19009 *
19010 * say(['fred', 'hello']);
19011 * // => 'fred says hello'
19012 *
19013 * var numbers = Promise.all([
19014 * Promise.resolve(40),
19015 * Promise.resolve(36)
19016 * ]);
19017 *
19018 * numbers.then(_.spread(function(x, y) {
19019 * return x + y;
19020 * }));
19021 * // => a Promise of 76
19022 */
19023 function spread(func, start) {
19024 if (typeof func != 'function') {
19025 throw new TypeError(FUNC_ERROR_TEXT);
19026 }
19027 start = start == null ? 0 : nativeMax(toInteger(start), 0);
19028 return baseRest(function(args) {
19029 var array = args[start],
19030 otherArgs = castSlice(args, 0, start);
19031
19032 if (array) {
19033 arrayPush(otherArgs, array);
19034 }
19035 return apply(func, this, otherArgs);
19036 });
19037 }
19038
19039 /**
19040 * Creates a throttled function that only invokes `func` at most once per
19041 * every `wait` milliseconds. The throttled function comes with a `cancel`
19042 * method to cancel delayed `func` invocations and a `flush` method to
19043 * immediately invoke them. Provide `options` to indicate whether `func`
19044 * should be invoked on the leading and/or trailing edge of the `wait`
19045 * timeout. The `func` is invoked with the last arguments provided to the
19046 * throttled function. Subsequent calls to the throttled function return the
19047 * result of the last `func` invocation.
19048 *
19049 * **Note:** If `leading` and `trailing` options are `true`, `func` is
19050 * invoked on the trailing edge of the timeout only if the throttled function
19051 * is invoked more than once during the `wait` timeout.
19052 *
19053 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
19054 * until to the next tick, similar to `setTimeout` with a timeout of `0`.
19055 *
19056 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
19057 * for details over the differences between `_.throttle` and `_.debounce`.
19058 *
19059 * @static
19060 * @memberOf _
19061 * @since 0.1.0
19062 * @category Function
19063 * @param {Function} func The function to throttle.
19064 * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
19065 * @param {Object} [options={}] The options object.
19066 * @param {boolean} [options.leading=true]
19067 * Specify invoking on the leading edge of the timeout.
19068 * @param {boolean} [options.trailing=true]
19069 * Specify invoking on the trailing edge of the timeout.
19070 * @returns {Function} Returns the new throttled function.
19071 * @example
19072 *
19073 * // Avoid excessively updating the position while scrolling.
19074 * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
19075 *
19076 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
19077 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
19078 * jQuery(element).on('click', throttled);
19079 *
19080 * // Cancel the trailing throttled invocation.
19081 * jQuery(window).on('popstate', throttled.cancel);
19082 */
19083 function throttle(func, wait, options) {
19084 var leading = true,
19085 trailing = true;
19086
19087 if (typeof func != 'function') {
19088 throw new TypeError(FUNC_ERROR_TEXT);
19089 }
19090 if (isObject(options)) {
19091 leading = 'leading' in options ? !!options.leading : leading;
19092 trailing = 'trailing' in options ? !!options.trailing : trailing;
19093 }
19094 return debounce(func, wait, {
19095 'leading': leading,
19096 'maxWait': wait,
19097 'trailing': trailing
19098 });
19099 }
19100
19101 /**
19102 * Creates a function that accepts up to one argument, ignoring any
19103 * additional arguments.
19104 *
19105 * @static
19106 * @memberOf _
19107 * @since 4.0.0
19108 * @category Function
19109 * @param {Function} func The function to cap arguments for.
19110 * @returns {Function} Returns the new capped function.
19111 * @example
19112 *
19113 * _.map(['6', '8', '10'], _.unary(parseInt));
19114 * // => [6, 8, 10]
19115 */
19116 function unary(func) {
19117 return ary(func, 1);
19118 }
19119
19120 /**
19121 * Creates a function that provides `value` to `wrapper` as its first
19122 * argument. Any additional arguments provided to the function are appended
19123 * to those provided to the `wrapper`. The wrapper is invoked with the `this`
19124 * binding of the created function.
19125 *
19126 * @static
19127 * @memberOf _
19128 * @since 0.1.0
19129 * @category Function
19130 * @param {*} value The value to wrap.
19131 * @param {Function} [wrapper=identity] The wrapper function.
19132 * @returns {Function} Returns the new function.
19133 * @example
19134 *
19135 * var p = _.wrap(_.escape, function(func, text) {
19136 * return '<p>' + func(text) + '</p>';
19137 * });
19138 *
19139 * p('fred, barney, & pebbles');
19140 * // => '<p>fred, barney, &amp; pebbles</p>'
19141 */
19142 function wrap(value, wrapper) {
19143 return partial(castFunction(wrapper), value);
19144 }
19145
19146 /*------------------------------------------------------------------------*/
19147
19148 /**
19149 * Casts `value` as an array if it's not one.
19150 *
19151 * @static
19152 * @memberOf _
19153 * @since 4.4.0
19154 * @category Lang
19155 * @param {*} value The value to inspect.
19156 * @returns {Array} Returns the cast array.
19157 * @example
19158 *
19159 * _.castArray(1);
19160 * // => [1]
19161 *
19162 * _.castArray({ 'a': 1 });
19163 * // => [{ 'a': 1 }]
19164 *
19165 * _.castArray('abc');
19166 * // => ['abc']
19167 *
19168 * _.castArray(null);
19169 * // => [null]
19170 *
19171 * _.castArray(undefined);
19172 * // => [undefined]
19173 *
19174 * _.castArray();
19175 * // => []
19176 *
19177 * var array = [1, 2, 3];
19178 * console.log(_.castArray(array) === array);
19179 * // => true
19180 */
19181 function castArray() {
19182 if (!arguments.length) {
19183 return [];
19184 }
19185 var value = arguments[0];
19186 return isArray(value) ? value : [value];
19187 }
19188
19189 /**
19190 * Creates a shallow clone of `value`.
19191 *
19192 * **Note:** This method is loosely based on the
19193 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
19194 * and supports cloning arrays, array buffers, booleans, date objects, maps,
19195 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
19196 * arrays. The own enumerable properties of `arguments` objects are cloned
19197 * as plain objects. An empty object is returned for uncloneable values such
19198 * as error objects, functions, DOM nodes, and WeakMaps.
19199 *
19200 * @static
19201 * @memberOf _
19202 * @since 0.1.0
19203 * @category Lang
19204 * @param {*} value The value to clone.
19205 * @returns {*} Returns the cloned value.
19206 * @see _.cloneDeep
19207 * @example
19208 *
19209 * var objects = [{ 'a': 1 }, { 'b': 2 }];
19210 *
19211 * var shallow = _.clone(objects);
19212 * console.log(shallow[0] === objects[0]);
19213 * // => true
19214 */
19215 function clone(value) {
19216 return baseClone(value, CLONE_SYMBOLS_FLAG);
19217 }
19218
19219 /**
19220 * This method is like `_.clone` except that it accepts `customizer` which
19221 * is invoked to produce the cloned value. If `customizer` returns `undefined`,
19222 * cloning is handled by the method instead. The `customizer` is invoked with
19223 * up to four arguments; (value [, index|key, object, stack]).
19224 *
19225 * @static
19226 * @memberOf _
19227 * @since 4.0.0
19228 * @category Lang
19229 * @param {*} value The value to clone.
19230 * @param {Function} [customizer] The function to customize cloning.
19231 * @returns {*} Returns the cloned value.
19232 * @see _.cloneDeepWith
19233 * @example
19234 *
19235 * function customizer(value) {
19236 * if (_.isElement(value)) {
19237 * return value.cloneNode(false);
19238 * }
19239 * }
19240 *
19241 * var el = _.cloneWith(document.body, customizer);
19242 *
19243 * console.log(el === document.body);
19244 * // => false
19245 * console.log(el.nodeName);
19246 * // => 'BODY'
19247 * console.log(el.childNodes.length);
19248 * // => 0
19249 */
19250 function cloneWith(value, customizer) {
19251 customizer = typeof customizer == 'function' ? customizer : undefined;
19252 return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);
19253 }
19254
19255 /**
19256 * This method is like `_.clone` except that it recursively clones `value`.
19257 *
19258 * @static
19259 * @memberOf _
19260 * @since 1.0.0
19261 * @category Lang
19262 * @param {*} value The value to recursively clone.
19263 * @returns {*} Returns the deep cloned value.
19264 * @see _.clone
19265 * @example
19266 *
19267 * var objects = [{ 'a': 1 }, { 'b': 2 }];
19268 *
19269 * var deep = _.cloneDeep(objects);
19270 * console.log(deep[0] === objects[0]);
19271 * // => false
19272 */
19273 function cloneDeep(value) {
19274 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);
19275 }
19276
19277 /**
19278 * This method is like `_.cloneWith` except that it recursively clones `value`.
19279 *
19280 * @static
19281 * @memberOf _
19282 * @since 4.0.0
19283 * @category Lang
19284 * @param {*} value The value to recursively clone.
19285 * @param {Function} [customizer] The function to customize cloning.
19286 * @returns {*} Returns the deep cloned value.
19287 * @see _.cloneWith
19288 * @example
19289 *
19290 * function customizer(value) {
19291 * if (_.isElement(value)) {
19292 * return value.cloneNode(true);
19293 * }
19294 * }
19295 *
19296 * var el = _.cloneDeepWith(document.body, customizer);
19297 *
19298 * console.log(el === document.body);
19299 * // => false
19300 * console.log(el.nodeName);
19301 * // => 'BODY'
19302 * console.log(el.childNodes.length);
19303 * // => 20
19304 */
19305 function cloneDeepWith(value, customizer) {
19306 customizer = typeof customizer == 'function' ? customizer : undefined;
19307 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
19308 }
19309
19310 /**
19311 * Checks if `object` conforms to `source` by invoking the predicate
19312 * properties of `source` with the corresponding property values of `object`.
19313 *
19314 * **Note:** This method is equivalent to `_.conforms` when `source` is
19315 * partially applied.
19316 *
19317 * @static
19318 * @memberOf _
19319 * @since 4.14.0
19320 * @category Lang
19321 * @param {Object} object The object to inspect.
19322 * @param {Object} source The object of property predicates to conform to.
19323 * @returns {boolean} Returns `true` if `object` conforms, else `false`.
19324 * @example
19325 *
19326 * var object = { 'a': 1, 'b': 2 };
19327 *
19328 * _.conformsTo(object, { 'b': function(n) { return n > 1; } });
19329 * // => true
19330 *
19331 * _.conformsTo(object, { 'b': function(n) { return n > 2; } });
19332 * // => false
19333 */
19334 function conformsTo(object, source) {
19335 return source == null || baseConformsTo(object, source, keys(source));
19336 }
19337
19338 /**
19339 * Performs a
19340 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
19341 * comparison between two values to determine if they are equivalent.
19342 *
19343 * @static
19344 * @memberOf _
19345 * @since 4.0.0
19346 * @category Lang
19347 * @param {*} value The value to compare.
19348 * @param {*} other The other value to compare.
19349 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
19350 * @example
19351 *
19352 * var object = { 'a': 1 };
19353 * var other = { 'a': 1 };
19354 *
19355 * _.eq(object, object);
19356 * // => true
19357 *
19358 * _.eq(object, other);
19359 * // => false
19360 *
19361 * _.eq('a', 'a');
19362 * // => true
19363 *
19364 * _.eq('a', Object('a'));
19365 * // => false
19366 *
19367 * _.eq(NaN, NaN);
19368 * // => true
19369 */
19370 function eq(value, other) {
19371 return value === other || (value !== value && other !== other);
19372 }
19373
19374 /**
19375 * Checks if `value` is greater than `other`.
19376 *
19377 * @static
19378 * @memberOf _
19379 * @since 3.9.0
19380 * @category Lang
19381 * @param {*} value The value to compare.
19382 * @param {*} other The other value to compare.
19383 * @returns {boolean} Returns `true` if `value` is greater than `other`,
19384 * else `false`.
19385 * @see _.lt
19386 * @example
19387 *
19388 * _.gt(3, 1);
19389 * // => true
19390 *
19391 * _.gt(3, 3);
19392 * // => false
19393 *
19394 * _.gt(1, 3);
19395 * // => false
19396 */
19397 var gt = createRelationalOperation(baseGt);
19398
19399 /**
19400 * Checks if `value` is greater than or equal to `other`.
19401 *
19402 * @static
19403 * @memberOf _
19404 * @since 3.9.0
19405 * @category Lang
19406 * @param {*} value The value to compare.
19407 * @param {*} other The other value to compare.
19408 * @returns {boolean} Returns `true` if `value` is greater than or equal to
19409 * `other`, else `false`.
19410 * @see _.lte
19411 * @example
19412 *
19413 * _.gte(3, 1);
19414 * // => true
19415 *
19416 * _.gte(3, 3);
19417 * // => true
19418 *
19419 * _.gte(1, 3);
19420 * // => false
19421 */
19422 var gte = createRelationalOperation(function(value, other) {
19423 return value >= other;
19424 });
19425
19426 /**
19427 * Checks if `value` is likely an `arguments` object.
19428 *
19429 * @static
19430 * @memberOf _
19431 * @since 0.1.0
19432 * @category Lang
19433 * @param {*} value The value to check.
19434 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
19435 * else `false`.
19436 * @example
19437 *
19438 * _.isArguments(function() { return arguments; }());
19439 * // => true
19440 *
19441 * _.isArguments([1, 2, 3]);
19442 * // => false
19443 */
19444 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
19445 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
19446 !propertyIsEnumerable.call(value, 'callee');
19447 };
19448
19449 /**
19450 * Checks if `value` is classified as an `Array` object.
19451 *
19452 * @static
19453 * @memberOf _
19454 * @since 0.1.0
19455 * @category Lang
19456 * @param {*} value The value to check.
19457 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
19458 * @example
19459 *
19460 * _.isArray([1, 2, 3]);
19461 * // => true
19462 *
19463 * _.isArray(document.body.children);
19464 * // => false
19465 *
19466 * _.isArray('abc');
19467 * // => false
19468 *
19469 * _.isArray(_.noop);
19470 * // => false
19471 */
19472 var isArray = Array.isArray;
19473
19474 /**
19475 * Checks if `value` is classified as an `ArrayBuffer` object.
19476 *
19477 * @static
19478 * @memberOf _
19479 * @since 4.3.0
19480 * @category Lang
19481 * @param {*} value The value to check.
19482 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.
19483 * @example
19484 *
19485 * _.isArrayBuffer(new ArrayBuffer(2));
19486 * // => true
19487 *
19488 * _.isArrayBuffer(new Array(2));
19489 * // => false
19490 */
19491 var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;
19492
19493 /**
19494 * Checks if `value` is array-like. A value is considered array-like if it's
19495 * not a function and has a `value.length` that's an integer greater than or
19496 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
19497 *
19498 * @static
19499 * @memberOf _
19500 * @since 4.0.0
19501 * @category Lang
19502 * @param {*} value The value to check.
19503 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
19504 * @example
19505 *
19506 * _.isArrayLike([1, 2, 3]);
19507 * // => true
19508 *
19509 * _.isArrayLike(document.body.children);
19510 * // => true
19511 *
19512 * _.isArrayLike('abc');
19513 * // => true
19514 *
19515 * _.isArrayLike(_.noop);
19516 * // => false
19517 */
19518 function isArrayLike(value) {
19519 return value != null && isLength(value.length) && !isFunction(value);
19520 }
19521
19522 /**
19523 * This method is like `_.isArrayLike` except that it also checks if `value`
19524 * is an object.
19525 *
19526 * @static
19527 * @memberOf _
19528 * @since 4.0.0
19529 * @category Lang
19530 * @param {*} value The value to check.
19531 * @returns {boolean} Returns `true` if `value` is an array-like object,
19532 * else `false`.
19533 * @example
19534 *
19535 * _.isArrayLikeObject([1, 2, 3]);
19536 * // => true
19537 *
19538 * _.isArrayLikeObject(document.body.children);
19539 * // => true
19540 *
19541 * _.isArrayLikeObject('abc');
19542 * // => false
19543 *
19544 * _.isArrayLikeObject(_.noop);
19545 * // => false
19546 */
19547 function isArrayLikeObject(value) {
19548 return isObjectLike(value) && isArrayLike(value);
19549 }
19550
19551 /**
19552 * Checks if `value` is classified as a boolean primitive or object.
19553 *
19554 * @static
19555 * @memberOf _
19556 * @since 0.1.0
19557 * @category Lang
19558 * @param {*} value The value to check.
19559 * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.
19560 * @example
19561 *
19562 * _.isBoolean(false);
19563 * // => true
19564 *
19565 * _.isBoolean(null);
19566 * // => false
19567 */
19568 function isBoolean(value) {
19569 return value === true || value === false ||
19570 (isObjectLike(value) && baseGetTag(value) == boolTag);
19571 }
19572
19573 /**
19574 * Checks if `value` is a buffer.
19575 *
19576 * @static
19577 * @memberOf _
19578 * @since 4.3.0
19579 * @category Lang
19580 * @param {*} value The value to check.
19581 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
19582 * @example
19583 *
19584 * _.isBuffer(new Buffer(2));
19585 * // => true
19586 *
19587 * _.isBuffer(new Uint8Array(2));
19588 * // => false
19589 */
19590 var isBuffer = nativeIsBuffer || stubFalse;
19591
19592 /**
19593 * Checks if `value` is classified as a `Date` object.
19594 *
19595 * @static
19596 * @memberOf _
19597 * @since 0.1.0
19598 * @category Lang
19599 * @param {*} value The value to check.
19600 * @returns {boolean} Returns `true` if `value` is a date object, else `false`.
19601 * @example
19602 *
19603 * _.isDate(new Date);
19604 * // => true
19605 *
19606 * _.isDate('Mon April 23 2012');
19607 * // => false
19608 */
19609 var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;
19610
19611 /**
19612 * Checks if `value` is likely a DOM element.
19613 *
19614 * @static
19615 * @memberOf _
19616 * @since 0.1.0
19617 * @category Lang
19618 * @param {*} value The value to check.
19619 * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
19620 * @example
19621 *
19622 * _.isElement(document.body);
19623 * // => true
19624 *
19625 * _.isElement('<body>');
19626 * // => false
19627 */
19628 function isElement(value) {
19629 return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);
19630 }
19631
19632 /**
19633 * Checks if `value` is an empty object, collection, map, or set.
19634 *
19635 * Objects are considered empty if they have no own enumerable string keyed
19636 * properties.
19637 *
19638 * Array-like values such as `arguments` objects, arrays, buffers, strings, or
19639 * jQuery-like collections are considered empty if they have a `length` of `0`.
19640 * Similarly, maps and sets are considered empty if they have a `size` of `0`.
19641 *
19642 * @static
19643 * @memberOf _
19644 * @since 0.1.0
19645 * @category Lang
19646 * @param {*} value The value to check.
19647 * @returns {boolean} Returns `true` if `value` is empty, else `false`.
19648 * @example
19649 *
19650 * _.isEmpty(null);
19651 * // => true
19652 *
19653 * _.isEmpty(true);
19654 * // => true
19655 *
19656 * _.isEmpty(1);
19657 * // => true
19658 *
19659 * _.isEmpty([1, 2, 3]);
19660 * // => false
19661 *
19662 * _.isEmpty({ 'a': 1 });
19663 * // => false
19664 */
19665 function isEmpty(value) {
19666 if (value == null) {
19667 return true;
19668 }
19669 if (isArrayLike(value) &&
19670 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||
19671 isBuffer(value) || isTypedArray(value) || isArguments(value))) {
19672 return !value.length;
19673 }
19674 var tag = getTag(value);
19675 if (tag == mapTag || tag == setTag) {
19676 return !value.size;
19677 }
19678 if (isPrototype(value)) {
19679 return !baseKeys(value).length;
19680 }
19681 for (var key in value) {
19682 if (hasOwnProperty.call(value, key)) {
19683 return false;
19684 }
19685 }
19686 return true;
19687 }
19688
19689 /**
19690 * Performs a deep comparison between two values to determine if they are
19691 * equivalent.
19692 *
19693 * **Note:** This method supports comparing arrays, array buffers, booleans,
19694 * date objects, error objects, maps, numbers, `Object` objects, regexes,
19695 * sets, strings, symbols, and typed arrays. `Object` objects are compared
19696 * by their own, not inherited, enumerable properties. Functions and DOM
19697 * nodes are compared by strict equality, i.e. `===`.
19698 *
19699 * @static
19700 * @memberOf _
19701 * @since 0.1.0
19702 * @category Lang
19703 * @param {*} value The value to compare.
19704 * @param {*} other The other value to compare.
19705 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
19706 * @example
19707 *
19708 * var object = { 'a': 1 };
19709 * var other = { 'a': 1 };
19710 *
19711 * _.isEqual(object, other);
19712 * // => true
19713 *
19714 * object === other;
19715 * // => false
19716 */
19717 function isEqual(value, other) {
19718 return baseIsEqual(value, other);
19719 }
19720
19721 /**
19722 * This method is like `_.isEqual` except that it accepts `customizer` which
19723 * is invoked to compare values. If `customizer` returns `undefined`, comparisons
19724 * are handled by the method instead. The `customizer` is invoked with up to
19725 * six arguments: (objValue, othValue [, index|key, object, other, stack]).
19726 *
19727 * @static
19728 * @memberOf _
19729 * @since 4.0.0
19730 * @category Lang
19731 * @param {*} value The value to compare.
19732 * @param {*} other The other value to compare.
19733 * @param {Function} [customizer] The function to customize comparisons.
19734 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
19735 * @example
19736 *
19737 * function isGreeting(value) {
19738 * return /^h(?:i|ello)$/.test(value);
19739 * }
19740 *
19741 * function customizer(objValue, othValue) {
19742 * if (isGreeting(objValue) && isGreeting(othValue)) {
19743 * return true;
19744 * }
19745 * }
19746 *
19747 * var array = ['hello', 'goodbye'];
19748 * var other = ['hi', 'goodbye'];
19749 *
19750 * _.isEqualWith(array, other, customizer);
19751 * // => true
19752 */
19753 function isEqualWith(value, other, customizer) {
19754 customizer = typeof customizer == 'function' ? customizer : undefined;
19755 var result = customizer ? customizer(value, other) : undefined;
19756 return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;
19757 }
19758
19759 /**
19760 * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
19761 * `SyntaxError`, `TypeError`, or `URIError` object.
19762 *
19763 * @static
19764 * @memberOf _
19765 * @since 3.0.0
19766 * @category Lang
19767 * @param {*} value The value to check.
19768 * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
19769 * @example
19770 *
19771 * _.isError(new Error);
19772 * // => true
19773 *
19774 * _.isError(Error);
19775 * // => false
19776 */
19777 function isError(value) {
19778 if (!isObjectLike(value)) {
19779 return false;
19780 }
19781 var tag = baseGetTag(value);
19782 return tag == errorTag || tag == domExcTag ||
19783 (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));
19784 }
19785
19786 /**
19787 * Checks if `value` is a finite primitive number.
19788 *
19789 * **Note:** This method is based on
19790 * [`Number.isFinite`](https://mdn.io/Number/isFinite).
19791 *
19792 * @static
19793 * @memberOf _
19794 * @since 0.1.0
19795 * @category Lang
19796 * @param {*} value The value to check.
19797 * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
19798 * @example
19799 *
19800 * _.isFinite(3);
19801 * // => true
19802 *
19803 * _.isFinite(Number.MIN_VALUE);
19804 * // => true
19805 *
19806 * _.isFinite(Infinity);
19807 * // => false
19808 *
19809 * _.isFinite('3');
19810 * // => false
19811 */
19812 function isFinite(value) {
19813 return typeof value == 'number' && nativeIsFinite(value);
19814 }
19815
19816 /**
19817 * Checks if `value` is classified as a `Function` object.
19818 *
19819 * @static
19820 * @memberOf _
19821 * @since 0.1.0
19822 * @category Lang
19823 * @param {*} value The value to check.
19824 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
19825 * @example
19826 *
19827 * _.isFunction(_);
19828 * // => true
19829 *
19830 * _.isFunction(/abc/);
19831 * // => false
19832 */
19833 function isFunction(value) {
19834 if (!isObject(value)) {
19835 return false;
19836 }
19837 // The use of `Object#toString` avoids issues with the `typeof` operator
19838 // in Safari 9 which returns 'object' for typed arrays and other constructors.
19839 var tag = baseGetTag(value);
19840 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
19841 }
19842
19843 /**
19844 * Checks if `value` is an integer.
19845 *
19846 * **Note:** This method is based on
19847 * [`Number.isInteger`](https://mdn.io/Number/isInteger).
19848 *
19849 * @static
19850 * @memberOf _
19851 * @since 4.0.0
19852 * @category Lang
19853 * @param {*} value The value to check.
19854 * @returns {boolean} Returns `true` if `value` is an integer, else `false`.
19855 * @example
19856 *
19857 * _.isInteger(3);
19858 * // => true
19859 *
19860 * _.isInteger(Number.MIN_VALUE);
19861 * // => false
19862 *
19863 * _.isInteger(Infinity);
19864 * // => false
19865 *
19866 * _.isInteger('3');
19867 * // => false
19868 */
19869 function isInteger(value) {
19870 return typeof value == 'number' && value == toInteger(value);
19871 }
19872
19873 /**
19874 * Checks if `value` is a valid array-like length.
19875 *
19876 * **Note:** This method is loosely based on
19877 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
19878 *
19879 * @static
19880 * @memberOf _
19881 * @since 4.0.0
19882 * @category Lang
19883 * @param {*} value The value to check.
19884 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
19885 * @example
19886 *
19887 * _.isLength(3);
19888 * // => true
19889 *
19890 * _.isLength(Number.MIN_VALUE);
19891 * // => false
19892 *
19893 * _.isLength(Infinity);
19894 * // => false
19895 *
19896 * _.isLength('3');
19897 * // => false
19898 */
19899 function isLength(value) {
19900 return typeof value == 'number' &&
19901 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
19902 }
19903
19904 /**
19905 * Checks if `value` is the
19906 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
19907 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
19908 *
19909 * @static
19910 * @memberOf _
19911 * @since 0.1.0
19912 * @category Lang
19913 * @param {*} value The value to check.
19914 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
19915 * @example
19916 *
19917 * _.isObject({});
19918 * // => true
19919 *
19920 * _.isObject([1, 2, 3]);
19921 * // => true
19922 *
19923 * _.isObject(_.noop);
19924 * // => true
19925 *
19926 * _.isObject(null);
19927 * // => false
19928 */
19929 function isObject(value) {
19930 var type = typeof value;
19931 return value != null && (type == 'object' || type == 'function');
19932 }
19933
19934 /**
19935 * Checks if `value` is object-like. A value is object-like if it's not `null`
19936 * and has a `typeof` result of "object".
19937 *
19938 * @static
19939 * @memberOf _
19940 * @since 4.0.0
19941 * @category Lang
19942 * @param {*} value The value to check.
19943 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
19944 * @example
19945 *
19946 * _.isObjectLike({});
19947 * // => true
19948 *
19949 * _.isObjectLike([1, 2, 3]);
19950 * // => true
19951 *
19952 * _.isObjectLike(_.noop);
19953 * // => false
19954 *
19955 * _.isObjectLike(null);
19956 * // => false
19957 */
19958 function isObjectLike(value) {
19959 return value != null && typeof value == 'object';
19960 }
19961
19962 /**
19963 * Checks if `value` is classified as a `Map` object.
19964 *
19965 * @static
19966 * @memberOf _
19967 * @since 4.3.0
19968 * @category Lang
19969 * @param {*} value The value to check.
19970 * @returns {boolean} Returns `true` if `value` is a map, else `false`.
19971 * @example
19972 *
19973 * _.isMap(new Map);
19974 * // => true
19975 *
19976 * _.isMap(new WeakMap);
19977 * // => false
19978 */
19979 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;
19980
19981 /**
19982 * Performs a partial deep comparison between `object` and `source` to
19983 * determine if `object` contains equivalent property values.
19984 *
19985 * **Note:** This method is equivalent to `_.matches` when `source` is
19986 * partially applied.
19987 *
19988 * Partial comparisons will match empty array and empty object `source`
19989 * values against any array or object value, respectively. See `_.isEqual`
19990 * for a list of supported value comparisons.
19991 *
19992 * @static
19993 * @memberOf _
19994 * @since 3.0.0
19995 * @category Lang
19996 * @param {Object} object The object to inspect.
19997 * @param {Object} source The object of property values to match.
19998 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
19999 * @example
20000 *
20001 * var object = { 'a': 1, 'b': 2 };
20002 *
20003 * _.isMatch(object, { 'b': 2 });
20004 * // => true
20005 *
20006 * _.isMatch(object, { 'b': 1 });
20007 * // => false
20008 */
20009 function isMatch(object, source) {
20010 return object === source || baseIsMatch(object, source, getMatchData(source));
20011 }
20012
20013 /**
20014 * This method is like `_.isMatch` except that it accepts `customizer` which
20015 * is invoked to compare values. If `customizer` returns `undefined`, comparisons
20016 * are handled by the method instead. The `customizer` is invoked with five
20017 * arguments: (objValue, srcValue, index|key, object, source).
20018 *
20019 * @static
20020 * @memberOf _
20021 * @since 4.0.0
20022 * @category Lang
20023 * @param {Object} object The object to inspect.
20024 * @param {Object} source The object of property values to match.
20025 * @param {Function} [customizer] The function to customize comparisons.
20026 * @returns {boolean} Returns `true` if `object` is a match, else `false`.
20027 * @example
20028 *
20029 * function isGreeting(value) {
20030 * return /^h(?:i|ello)$/.test(value);
20031 * }
20032 *
20033 * function customizer(objValue, srcValue) {
20034 * if (isGreeting(objValue) && isGreeting(srcValue)) {
20035 * return true;
20036 * }
20037 * }
20038 *
20039 * var object = { 'greeting': 'hello' };
20040 * var source = { 'greeting': 'hi' };
20041 *
20042 * _.isMatchWith(object, source, customizer);
20043 * // => true
20044 */
20045 function isMatchWith(object, source, customizer) {
20046 customizer = typeof customizer == 'function' ? customizer : undefined;
20047 return baseIsMatch(object, source, getMatchData(source), customizer);
20048 }
20049
20050 /**
20051 * Checks if `value` is `NaN`.
20052 *
20053 * **Note:** This method is based on
20054 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
20055 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
20056 * `undefined` and other non-number values.
20057 *
20058 * @static
20059 * @memberOf _
20060 * @since 0.1.0
20061 * @category Lang
20062 * @param {*} value The value to check.
20063 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
20064 * @example
20065 *
20066 * _.isNaN(NaN);
20067 * // => true
20068 *
20069 * _.isNaN(new Number(NaN));
20070 * // => true
20071 *
20072 * isNaN(undefined);
20073 * // => true
20074 *
20075 * _.isNaN(undefined);
20076 * // => false
20077 */
20078 function isNaN(value) {
20079 // An `NaN` primitive is the only value that is not equal to itself.
20080 // Perform the `toStringTag` check first to avoid errors with some
20081 // ActiveX objects in IE.
20082 return isNumber(value) && value != +value;
20083 }
20084
20085 /**
20086 * Checks if `value` is a pristine native function.
20087 *
20088 * **Note:** This method can't reliably detect native functions in the presence
20089 * of the core-js package because core-js circumvents this kind of detection.
20090 * Despite multiple requests, the core-js maintainer has made it clear: any
20091 * attempt to fix the detection will be obstructed. As a result, we're left
20092 * with little choice but to throw an error. Unfortunately, this also affects
20093 * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),
20094 * which rely on core-js.
20095 *
20096 * @static
20097 * @memberOf _
20098 * @since 3.0.0
20099 * @category Lang
20100 * @param {*} value The value to check.
20101 * @returns {boolean} Returns `true` if `value` is a native function,
20102 * else `false`.
20103 * @example
20104 *
20105 * _.isNative(Array.prototype.push);
20106 * // => true
20107 *
20108 * _.isNative(_);
20109 * // => false
20110 */
20111 function isNative(value) {
20112 if (isMaskable(value)) {
20113 throw new Error(CORE_ERROR_TEXT);
20114 }
20115 return baseIsNative(value);
20116 }
20117
20118 /**
20119 * Checks if `value` is `null`.
20120 *
20121 * @static
20122 * @memberOf _
20123 * @since 0.1.0
20124 * @category Lang
20125 * @param {*} value The value to check.
20126 * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
20127 * @example
20128 *
20129 * _.isNull(null);
20130 * // => true
20131 *
20132 * _.isNull(void 0);
20133 * // => false
20134 */
20135 function isNull(value) {
20136 return value === null;
20137 }
20138
20139 /**
20140 * Checks if `value` is `null` or `undefined`.
20141 *
20142 * @static
20143 * @memberOf _
20144 * @since 4.0.0
20145 * @category Lang
20146 * @param {*} value The value to check.
20147 * @returns {boolean} Returns `true` if `value` is nullish, else `false`.
20148 * @example
20149 *
20150 * _.isNil(null);
20151 * // => true
20152 *
20153 * _.isNil(void 0);
20154 * // => true
20155 *
20156 * _.isNil(NaN);
20157 * // => false
20158 */
20159 function isNil(value) {
20160 return value == null;
20161 }
20162
20163 /**
20164 * Checks if `value` is classified as a `Number` primitive or object.
20165 *
20166 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are
20167 * classified as numbers, use the `_.isFinite` method.
20168 *
20169 * @static
20170 * @memberOf _
20171 * @since 0.1.0
20172 * @category Lang
20173 * @param {*} value The value to check.
20174 * @returns {boolean} Returns `true` if `value` is a number, else `false`.
20175 * @example
20176 *
20177 * _.isNumber(3);
20178 * // => true
20179 *
20180 * _.isNumber(Number.MIN_VALUE);
20181 * // => true
20182 *
20183 * _.isNumber(Infinity);
20184 * // => true
20185 *
20186 * _.isNumber('3');
20187 * // => false
20188 */
20189 function isNumber(value) {
20190 return typeof value == 'number' ||
20191 (isObjectLike(value) && baseGetTag(value) == numberTag);
20192 }
20193
20194 /**
20195 * Checks if `value` is a plain object, that is, an object created by the
20196 * `Object` constructor or one with a `[[Prototype]]` of `null`.
20197 *
20198 * @static
20199 * @memberOf _
20200 * @since 0.8.0
20201 * @category Lang
20202 * @param {*} value The value to check.
20203 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
20204 * @example
20205 *
20206 * function Foo() {
20207 * this.a = 1;
20208 * }
20209 *
20210 * _.isPlainObject(new Foo);
20211 * // => false
20212 *
20213 * _.isPlainObject([1, 2, 3]);
20214 * // => false
20215 *
20216 * _.isPlainObject({ 'x': 0, 'y': 0 });
20217 * // => true
20218 *
20219 * _.isPlainObject(Object.create(null));
20220 * // => true
20221 */
20222 function isPlainObject(value) {
20223 if (!isObjectLike(value) || baseGetTag(value) != objectTag) {
20224 return false;
20225 }
20226 var proto = getPrototype(value);
20227 if (proto === null) {
20228 return true;
20229 }
20230 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
20231 return typeof Ctor == 'function' && Ctor instanceof Ctor &&
20232 funcToString.call(Ctor) == objectCtorString;
20233 }
20234
20235 /**
20236 * Checks if `value` is classified as a `RegExp` object.
20237 *
20238 * @static
20239 * @memberOf _
20240 * @since 0.1.0
20241 * @category Lang
20242 * @param {*} value The value to check.
20243 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.
20244 * @example
20245 *
20246 * _.isRegExp(/abc/);
20247 * // => true
20248 *
20249 * _.isRegExp('/abc/');
20250 * // => false
20251 */
20252 var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;
20253
20254 /**
20255 * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754
20256 * double precision number which isn't the result of a rounded unsafe integer.
20257 *
20258 * **Note:** This method is based on
20259 * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).
20260 *
20261 * @static
20262 * @memberOf _
20263 * @since 4.0.0
20264 * @category Lang
20265 * @param {*} value The value to check.
20266 * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.
20267 * @example
20268 *
20269 * _.isSafeInteger(3);
20270 * // => true
20271 *
20272 * _.isSafeInteger(Number.MIN_VALUE);
20273 * // => false
20274 *
20275 * _.isSafeInteger(Infinity);
20276 * // => false
20277 *
20278 * _.isSafeInteger('3');
20279 * // => false
20280 */
20281 function isSafeInteger(value) {
20282 return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
20283 }
20284
20285 /**
20286 * Checks if `value` is classified as a `Set` object.
20287 *
20288 * @static
20289 * @memberOf _
20290 * @since 4.3.0
20291 * @category Lang
20292 * @param {*} value The value to check.
20293 * @returns {boolean} Returns `true` if `value` is a set, else `false`.
20294 * @example
20295 *
20296 * _.isSet(new Set);
20297 * // => true
20298 *
20299 * _.isSet(new WeakSet);
20300 * // => false
20301 */
20302 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;
20303
20304 /**
20305 * Checks if `value` is classified as a `String` primitive or object.
20306 *
20307 * @static
20308 * @since 0.1.0
20309 * @memberOf _
20310 * @category Lang
20311 * @param {*} value The value to check.
20312 * @returns {boolean} Returns `true` if `value` is a string, else `false`.
20313 * @example
20314 *
20315 * _.isString('abc');
20316 * // => true
20317 *
20318 * _.isString(1);
20319 * // => false
20320 */
20321 function isString(value) {
20322 return typeof value == 'string' ||
20323 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);
20324 }
20325
20326 /**
20327 * Checks if `value` is classified as a `Symbol` primitive or object.
20328 *
20329 * @static
20330 * @memberOf _
20331 * @since 4.0.0
20332 * @category Lang
20333 * @param {*} value The value to check.
20334 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
20335 * @example
20336 *
20337 * _.isSymbol(Symbol.iterator);
20338 * // => true
20339 *
20340 * _.isSymbol('abc');
20341 * // => false
20342 */
20343 function isSymbol(value) {
20344 return typeof value == 'symbol' ||
20345 (isObjectLike(value) && baseGetTag(value) == symbolTag);
20346 }
20347
20348 /**
20349 * Checks if `value` is classified as a typed array.
20350 *
20351 * @static
20352 * @memberOf _
20353 * @since 3.0.0
20354 * @category Lang
20355 * @param {*} value The value to check.
20356 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
20357 * @example
20358 *
20359 * _.isTypedArray(new Uint8Array);
20360 * // => true
20361 *
20362 * _.isTypedArray([]);
20363 * // => false
20364 */
20365 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
20366
20367 /**
20368 * Checks if `value` is `undefined`.
20369 *
20370 * @static
20371 * @since 0.1.0
20372 * @memberOf _
20373 * @category Lang
20374 * @param {*} value The value to check.
20375 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
20376 * @example
20377 *
20378 * _.isUndefined(void 0);
20379 * // => true
20380 *
20381 * _.isUndefined(null);
20382 * // => false
20383 */
20384 function isUndefined(value) {
20385 return value === undefined;
20386 }
20387
20388 /**
20389 * Checks if `value` is classified as a `WeakMap` object.
20390 *
20391 * @static
20392 * @memberOf _
20393 * @since 4.3.0
20394 * @category Lang
20395 * @param {*} value The value to check.
20396 * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.
20397 * @example
20398 *
20399 * _.isWeakMap(new WeakMap);
20400 * // => true
20401 *
20402 * _.isWeakMap(new Map);
20403 * // => false
20404 */
20405 function isWeakMap(value) {
20406 return isObjectLike(value) && getTag(value) == weakMapTag;
20407 }
20408
20409 /**
20410 * Checks if `value` is classified as a `WeakSet` object.
20411 *
20412 * @static
20413 * @memberOf _
20414 * @since 4.3.0
20415 * @category Lang
20416 * @param {*} value The value to check.
20417 * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.
20418 * @example
20419 *
20420 * _.isWeakSet(new WeakSet);
20421 * // => true
20422 *
20423 * _.isWeakSet(new Set);
20424 * // => false
20425 */
20426 function isWeakSet(value) {
20427 return isObjectLike(value) && baseGetTag(value) == weakSetTag;
20428 }
20429
20430 /**
20431 * Checks if `value` is less than `other`.
20432 *
20433 * @static
20434 * @memberOf _
20435 * @since 3.9.0
20436 * @category Lang
20437 * @param {*} value The value to compare.
20438 * @param {*} other The other value to compare.
20439 * @returns {boolean} Returns `true` if `value` is less than `other`,
20440 * else `false`.
20441 * @see _.gt
20442 * @example
20443 *
20444 * _.lt(1, 3);
20445 * // => true
20446 *
20447 * _.lt(3, 3);
20448 * // => false
20449 *
20450 * _.lt(3, 1);
20451 * // => false
20452 */
20453 var lt = createRelationalOperation(baseLt);
20454
20455 /**
20456 * Checks if `value` is less than or equal to `other`.
20457 *
20458 * @static
20459 * @memberOf _
20460 * @since 3.9.0
20461 * @category Lang
20462 * @param {*} value The value to compare.
20463 * @param {*} other The other value to compare.
20464 * @returns {boolean} Returns `true` if `value` is less than or equal to
20465 * `other`, else `false`.
20466 * @see _.gte
20467 * @example
20468 *
20469 * _.lte(1, 3);
20470 * // => true
20471 *
20472 * _.lte(3, 3);
20473 * // => true
20474 *
20475 * _.lte(3, 1);
20476 * // => false
20477 */
20478 var lte = createRelationalOperation(function(value, other) {
20479 return value <= other;
20480 });
20481
20482 /**
20483 * Converts `value` to an array.
20484 *
20485 * @static
20486 * @since 0.1.0
20487 * @memberOf _
20488 * @category Lang
20489 * @param {*} value The value to convert.
20490 * @returns {Array} Returns the converted array.
20491 * @example
20492 *
20493 * _.toArray({ 'a': 1, 'b': 2 });
20494 * // => [1, 2]
20495 *
20496 * _.toArray('abc');
20497 * // => ['a', 'b', 'c']
20498 *
20499 * _.toArray(1);
20500 * // => []
20501 *
20502 * _.toArray(null);
20503 * // => []
20504 */
20505 function toArray(value) {
20506 if (!value) {
20507 return [];
20508 }
20509 if (isArrayLike(value)) {
20510 return isString(value) ? stringToArray(value) : copyArray(value);
20511 }
20512 if (symIterator && value[symIterator]) {
20513 return iteratorToArray(value[symIterator]());
20514 }
20515 var tag = getTag(value),
20516 func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
20517
20518 return func(value);
20519 }
20520
20521 /**
20522 * Converts `value` to a finite number.
20523 *
20524 * @static
20525 * @memberOf _
20526 * @since 4.12.0
20527 * @category Lang
20528 * @param {*} value The value to convert.
20529 * @returns {number} Returns the converted number.
20530 * @example
20531 *
20532 * _.toFinite(3.2);
20533 * // => 3.2
20534 *
20535 * _.toFinite(Number.MIN_VALUE);
20536 * // => 5e-324
20537 *
20538 * _.toFinite(Infinity);
20539 * // => 1.7976931348623157e+308
20540 *
20541 * _.toFinite('3.2');
20542 * // => 3.2
20543 */
20544 function toFinite(value) {
20545 if (!value) {
20546 return value === 0 ? value : 0;
20547 }
20548 value = toNumber(value);
20549 if (value === INFINITY || value === -INFINITY) {
20550 var sign = (value < 0 ? -1 : 1);
20551 return sign * MAX_INTEGER;
20552 }
20553 return value === value ? value : 0;
20554 }
20555
20556 /**
20557 * Converts `value` to an integer.
20558 *
20559 * **Note:** This method is loosely based on
20560 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
20561 *
20562 * @static
20563 * @memberOf _
20564 * @since 4.0.0
20565 * @category Lang
20566 * @param {*} value The value to convert.
20567 * @returns {number} Returns the converted integer.
20568 * @example
20569 *
20570 * _.toInteger(3.2);
20571 * // => 3
20572 *
20573 * _.toInteger(Number.MIN_VALUE);
20574 * // => 0
20575 *
20576 * _.toInteger(Infinity);
20577 * // => 1.7976931348623157e+308
20578 *
20579 * _.toInteger('3.2');
20580 * // => 3
20581 */
20582 function toInteger(value) {
20583 var result = toFinite(value),
20584 remainder = result % 1;
20585
20586 return result === result ? (remainder ? result - remainder : result) : 0;
20587 }
20588
20589 /**
20590 * Converts `value` to an integer suitable for use as the length of an
20591 * array-like object.
20592 *
20593 * **Note:** This method is based on
20594 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
20595 *
20596 * @static
20597 * @memberOf _
20598 * @since 4.0.0
20599 * @category Lang
20600 * @param {*} value The value to convert.
20601 * @returns {number} Returns the converted integer.
20602 * @example
20603 *
20604 * _.toLength(3.2);
20605 * // => 3
20606 *
20607 * _.toLength(Number.MIN_VALUE);
20608 * // => 0
20609 *
20610 * _.toLength(Infinity);
20611 * // => 4294967295
20612 *
20613 * _.toLength('3.2');
20614 * // => 3
20615 */
20616 function toLength(value) {
20617 return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;
20618 }
20619
20620 /**
20621 * Converts `value` to a number.
20622 *
20623 * @static
20624 * @memberOf _
20625 * @since 4.0.0
20626 * @category Lang
20627 * @param {*} value The value to process.
20628 * @returns {number} Returns the number.
20629 * @example
20630 *
20631 * _.toNumber(3.2);
20632 * // => 3.2
20633 *
20634 * _.toNumber(Number.MIN_VALUE);
20635 * // => 5e-324
20636 *
20637 * _.toNumber(Infinity);
20638 * // => Infinity
20639 *
20640 * _.toNumber('3.2');
20641 * // => 3.2
20642 */
20643 function toNumber(value) {
20644 if (typeof value == 'number') {
20645 return value;
20646 }
20647 if (isSymbol(value)) {
20648 return NAN;
20649 }
20650 if (isObject(value)) {
20651 var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
20652 value = isObject(other) ? (other + '') : other;
20653 }
20654 if (typeof value != 'string') {
20655 return value === 0 ? value : +value;
20656 }
20657 value = value.replace(reTrim, '');
20658 var isBinary = reIsBinary.test(value);
20659 return (isBinary || reIsOctal.test(value))
20660 ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
20661 : (reIsBadHex.test(value) ? NAN : +value);
20662 }
20663
20664 /**
20665 * Converts `value` to a plain object flattening inherited enumerable string
20666 * keyed properties of `value` to own properties of the plain object.
20667 *
20668 * @static
20669 * @memberOf _
20670 * @since 3.0.0
20671 * @category Lang
20672 * @param {*} value The value to convert.
20673 * @returns {Object} Returns the converted plain object.
20674 * @example
20675 *
20676 * function Foo() {
20677 * this.b = 2;
20678 * }
20679 *
20680 * Foo.prototype.c = 3;
20681 *
20682 * _.assign({ 'a': 1 }, new Foo);
20683 * // => { 'a': 1, 'b': 2 }
20684 *
20685 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
20686 * // => { 'a': 1, 'b': 2, 'c': 3 }
20687 */
20688 function toPlainObject(value) {
20689 return copyObject(value, keysIn(value));
20690 }
20691
20692 /**
20693 * Converts `value` to a safe integer. A safe integer can be compared and
20694 * represented correctly.
20695 *
20696 * @static
20697 * @memberOf _
20698 * @since 4.0.0
20699 * @category Lang
20700 * @param {*} value The value to convert.
20701 * @returns {number} Returns the converted integer.
20702 * @example
20703 *
20704 * _.toSafeInteger(3.2);
20705 * // => 3
20706 *
20707 * _.toSafeInteger(Number.MIN_VALUE);
20708 * // => 0
20709 *
20710 * _.toSafeInteger(Infinity);
20711 * // => 9007199254740991
20712 *
20713 * _.toSafeInteger('3.2');
20714 * // => 3
20715 */
20716 function toSafeInteger(value) {
20717 return value
20718 ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
20719 : (value === 0 ? value : 0);
20720 }
20721
20722 /**
20723 * Converts `value` to a string. An empty string is returned for `null`
20724 * and `undefined` values. The sign of `-0` is preserved.
20725 *
20726 * @static
20727 * @memberOf _
20728 * @since 4.0.0
20729 * @category Lang
20730 * @param {*} value The value to convert.
20731 * @returns {string} Returns the converted string.
20732 * @example
20733 *
20734 * _.toString(null);
20735 * // => ''
20736 *
20737 * _.toString(-0);
20738 * // => '-0'
20739 *
20740 * _.toString([1, 2, 3]);
20741 * // => '1,2,3'
20742 */
20743 function toString(value) {
20744 return value == null ? '' : baseToString(value);
20745 }
20746
20747 /*------------------------------------------------------------------------*/
20748
20749 /**
20750 * Assigns own enumerable string keyed properties of source objects to the
20751 * destination object. Source objects are applied from left to right.
20752 * Subsequent sources overwrite property assignments of previous sources.
20753 *
20754 * **Note:** This method mutates `object` and is loosely based on
20755 * [`Object.assign`](https://mdn.io/Object/assign).
20756 *
20757 * @static
20758 * @memberOf _
20759 * @since 0.10.0
20760 * @category Object
20761 * @param {Object} object The destination object.
20762 * @param {...Object} [sources] The source objects.
20763 * @returns {Object} Returns `object`.
20764 * @see _.assignIn
20765 * @example
20766 *
20767 * function Foo() {
20768 * this.a = 1;
20769 * }
20770 *
20771 * function Bar() {
20772 * this.c = 3;
20773 * }
20774 *
20775 * Foo.prototype.b = 2;
20776 * Bar.prototype.d = 4;
20777 *
20778 * _.assign({ 'a': 0 }, new Foo, new Bar);
20779 * // => { 'a': 1, 'c': 3 }
20780 */
20781 var assign = createAssigner(function(object, source) {
20782 if (isPrototype(source) || isArrayLike(source)) {
20783 copyObject(source, keys(source), object);
20784 return;
20785 }
20786 for (var key in source) {
20787 if (hasOwnProperty.call(source, key)) {
20788 assignValue(object, key, source[key]);
20789 }
20790 }
20791 });
20792
20793 /**
20794 * This method is like `_.assign` except that it iterates over own and
20795 * inherited source properties.
20796 *
20797 * **Note:** This method mutates `object`.
20798 *
20799 * @static
20800 * @memberOf _
20801 * @since 4.0.0
20802 * @alias extend
20803 * @category Object
20804 * @param {Object} object The destination object.
20805 * @param {...Object} [sources] The source objects.
20806 * @returns {Object} Returns `object`.
20807 * @see _.assign
20808 * @example
20809 *
20810 * function Foo() {
20811 * this.a = 1;
20812 * }
20813 *
20814 * function Bar() {
20815 * this.c = 3;
20816 * }
20817 *
20818 * Foo.prototype.b = 2;
20819 * Bar.prototype.d = 4;
20820 *
20821 * _.assignIn({ 'a': 0 }, new Foo, new Bar);
20822 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }
20823 */
20824 var assignIn = createAssigner(function(object, source) {
20825 copyObject(source, keysIn(source), object);
20826 });
20827
20828 /**
20829 * This method is like `_.assignIn` except that it accepts `customizer`
20830 * which is invoked to produce the assigned values. If `customizer` returns
20831 * `undefined`, assignment is handled by the method instead. The `customizer`
20832 * is invoked with five arguments: (objValue, srcValue, key, object, source).
20833 *
20834 * **Note:** This method mutates `object`.
20835 *
20836 * @static
20837 * @memberOf _
20838 * @since 4.0.0
20839 * @alias extendWith
20840 * @category Object
20841 * @param {Object} object The destination object.
20842 * @param {...Object} sources The source objects.
20843 * @param {Function} [customizer] The function to customize assigned values.
20844 * @returns {Object} Returns `object`.
20845 * @see _.assignWith
20846 * @example
20847 *
20848 * function customizer(objValue, srcValue) {
20849 * return _.isUndefined(objValue) ? srcValue : objValue;
20850 * }
20851 *
20852 * var defaults = _.partialRight(_.assignInWith, customizer);
20853 *
20854 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
20855 * // => { 'a': 1, 'b': 2 }
20856 */
20857 var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {
20858 copyObject(source, keysIn(source), object, customizer);
20859 });
20860
20861 /**
20862 * This method is like `_.assign` except that it accepts `customizer`
20863 * which is invoked to produce the assigned values. If `customizer` returns
20864 * `undefined`, assignment is handled by the method instead. The `customizer`
20865 * is invoked with five arguments: (objValue, srcValue, key, object, source).
20866 *
20867 * **Note:** This method mutates `object`.
20868 *
20869 * @static
20870 * @memberOf _
20871 * @since 4.0.0
20872 * @category Object
20873 * @param {Object} object The destination object.
20874 * @param {...Object} sources The source objects.
20875 * @param {Function} [customizer] The function to customize assigned values.
20876 * @returns {Object} Returns `object`.
20877 * @see _.assignInWith
20878 * @example
20879 *
20880 * function customizer(objValue, srcValue) {
20881 * return _.isUndefined(objValue) ? srcValue : objValue;
20882 * }
20883 *
20884 * var defaults = _.partialRight(_.assignWith, customizer);
20885 *
20886 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
20887 * // => { 'a': 1, 'b': 2 }
20888 */
20889 var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
20890 copyObject(source, keys(source), object, customizer);
20891 });
20892
20893 /**
20894 * Creates an array of values corresponding to `paths` of `object`.
20895 *
20896 * @static
20897 * @memberOf _
20898 * @since 1.0.0
20899 * @category Object
20900 * @param {Object} object The object to iterate over.
20901 * @param {...(string|string[])} [paths] The property paths to pick.
20902 * @returns {Array} Returns the picked values.
20903 * @example
20904 *
20905 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };
20906 *
20907 * _.at(object, ['a[0].b.c', 'a[1]']);
20908 * // => [3, 4]
20909 */
20910 var at = flatRest(baseAt);
20911
20912 /**
20913 * Creates an object that inherits from the `prototype` object. If a
20914 * `properties` object is given, its own enumerable string keyed properties
20915 * are assigned to the created object.
20916 *
20917 * @static
20918 * @memberOf _
20919 * @since 2.3.0
20920 * @category Object
20921 * @param {Object} prototype The object to inherit from.
20922 * @param {Object} [properties] The properties to assign to the object.
20923 * @returns {Object} Returns the new object.
20924 * @example
20925 *
20926 * function Shape() {
20927 * this.x = 0;
20928 * this.y = 0;
20929 * }
20930 *
20931 * function Circle() {
20932 * Shape.call(this);
20933 * }
20934 *
20935 * Circle.prototype = _.create(Shape.prototype, {
20936 * 'constructor': Circle
20937 * });
20938 *
20939 * var circle = new Circle;
20940 * circle instanceof Circle;
20941 * // => true
20942 *
20943 * circle instanceof Shape;
20944 * // => true
20945 */
20946 function create(prototype, properties) {
20947 var result = baseCreate(prototype);
20948 return properties == null ? result : baseAssign(result, properties);
20949 }
20950
20951 /**
20952 * Assigns own and inherited enumerable string keyed properties of source
20953 * objects to the destination object for all destination properties that
20954 * resolve to `undefined`. Source objects are applied from left to right.
20955 * Once a property is set, additional values of the same property are ignored.
20956 *
20957 * **Note:** This method mutates `object`.
20958 *
20959 * @static
20960 * @since 0.1.0
20961 * @memberOf _
20962 * @category Object
20963 * @param {Object} object The destination object.
20964 * @param {...Object} [sources] The source objects.
20965 * @returns {Object} Returns `object`.
20966 * @see _.defaultsDeep
20967 * @example
20968 *
20969 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });
20970 * // => { 'a': 1, 'b': 2 }
20971 */
20972 var defaults = baseRest(function(object, sources) {
20973 object = Object(object);
20974
20975 var index = -1;
20976 var length = sources.length;
20977 var guard = length > 2 ? sources[2] : undefined;
20978
20979 if (guard && isIterateeCall(sources[0], sources[1], guard)) {
20980 length = 1;
20981 }
20982
20983 while (++index < length) {
20984 var source = sources[index];
20985 var props = keysIn(source);
20986 var propsIndex = -1;
20987 var propsLength = props.length;
20988
20989 while (++propsIndex < propsLength) {
20990 var key = props[propsIndex];
20991 var value = object[key];
20992
20993 if (value === undefined ||
20994 (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {
20995 object[key] = source[key];
20996 }
20997 }
20998 }
20999
21000 return object;
21001 });
21002
21003 /**
21004 * This method is like `_.defaults` except that it recursively assigns
21005 * default properties.
21006 *
21007 * **Note:** This method mutates `object`.
21008 *
21009 * @static
21010 * @memberOf _
21011 * @since 3.10.0
21012 * @category Object
21013 * @param {Object} object The destination object.
21014 * @param {...Object} [sources] The source objects.
21015 * @returns {Object} Returns `object`.
21016 * @see _.defaults
21017 * @example
21018 *
21019 * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });
21020 * // => { 'a': { 'b': 2, 'c': 3 } }
21021 */
21022 var defaultsDeep = baseRest(function(args) {
21023 args.push(undefined, customDefaultsMerge);
21024 return apply(mergeWith, undefined, args);
21025 });
21026
21027 /**
21028 * This method is like `_.find` except that it returns the key of the first
21029 * element `predicate` returns truthy for instead of the element itself.
21030 *
21031 * @static
21032 * @memberOf _
21033 * @since 1.1.0
21034 * @category Object
21035 * @param {Object} object The object to inspect.
21036 * @param {Function} [predicate=_.identity] The function invoked per iteration.
21037 * @returns {string|undefined} Returns the key of the matched element,
21038 * else `undefined`.
21039 * @example
21040 *
21041 * var users = {
21042 * 'barney': { 'age': 36, 'active': true },
21043 * 'fred': { 'age': 40, 'active': false },
21044 * 'pebbles': { 'age': 1, 'active': true }
21045 * };
21046 *
21047 * _.findKey(users, function(o) { return o.age < 40; });
21048 * // => 'barney' (iteration order is not guaranteed)
21049 *
21050 * // The `_.matches` iteratee shorthand.
21051 * _.findKey(users, { 'age': 1, 'active': true });
21052 * // => 'pebbles'
21053 *
21054 * // The `_.matchesProperty` iteratee shorthand.
21055 * _.findKey(users, ['active', false]);
21056 * // => 'fred'
21057 *
21058 * // The `_.property` iteratee shorthand.
21059 * _.findKey(users, 'active');
21060 * // => 'barney'
21061 */
21062 function findKey(object, predicate) {
21063 return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);
21064 }
21065
21066 /**
21067 * This method is like `_.findKey` except that it iterates over elements of
21068 * a collection in the opposite order.
21069 *
21070 * @static
21071 * @memberOf _
21072 * @since 2.0.0
21073 * @category Object
21074 * @param {Object} object The object to inspect.
21075 * @param {Function} [predicate=_.identity] The function invoked per iteration.
21076 * @returns {string|undefined} Returns the key of the matched element,
21077 * else `undefined`.
21078 * @example
21079 *
21080 * var users = {
21081 * 'barney': { 'age': 36, 'active': true },
21082 * 'fred': { 'age': 40, 'active': false },
21083 * 'pebbles': { 'age': 1, 'active': true }
21084 * };
21085 *
21086 * _.findLastKey(users, function(o) { return o.age < 40; });
21087 * // => returns 'pebbles' assuming `_.findKey` returns 'barney'
21088 *
21089 * // The `_.matches` iteratee shorthand.
21090 * _.findLastKey(users, { 'age': 36, 'active': true });
21091 * // => 'barney'
21092 *
21093 * // The `_.matchesProperty` iteratee shorthand.
21094 * _.findLastKey(users, ['active', false]);
21095 * // => 'fred'
21096 *
21097 * // The `_.property` iteratee shorthand.
21098 * _.findLastKey(users, 'active');
21099 * // => 'pebbles'
21100 */
21101 function findLastKey(object, predicate) {
21102 return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);
21103 }
21104
21105 /**
21106 * Iterates over own and inherited enumerable string keyed properties of an
21107 * object and invokes `iteratee` for each property. The iteratee is invoked
21108 * with three arguments: (value, key, object). Iteratee functions may exit
21109 * iteration early by explicitly returning `false`.
21110 *
21111 * @static
21112 * @memberOf _
21113 * @since 0.3.0
21114 * @category Object
21115 * @param {Object} object The object to iterate over.
21116 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
21117 * @returns {Object} Returns `object`.
21118 * @see _.forInRight
21119 * @example
21120 *
21121 * function Foo() {
21122 * this.a = 1;
21123 * this.b = 2;
21124 * }
21125 *
21126 * Foo.prototype.c = 3;
21127 *
21128 * _.forIn(new Foo, function(value, key) {
21129 * console.log(key);
21130 * });
21131 * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).
21132 */
21133 function forIn(object, iteratee) {
21134 return object == null
21135 ? object
21136 : baseFor(object, getIteratee(iteratee, 3), keysIn);
21137 }
21138
21139 /**
21140 * This method is like `_.forIn` except that it iterates over properties of
21141 * `object` in the opposite order.
21142 *
21143 * @static
21144 * @memberOf _
21145 * @since 2.0.0
21146 * @category Object
21147 * @param {Object} object The object to iterate over.
21148 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
21149 * @returns {Object} Returns `object`.
21150 * @see _.forIn
21151 * @example
21152 *
21153 * function Foo() {
21154 * this.a = 1;
21155 * this.b = 2;
21156 * }
21157 *
21158 * Foo.prototype.c = 3;
21159 *
21160 * _.forInRight(new Foo, function(value, key) {
21161 * console.log(key);
21162 * });
21163 * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.
21164 */
21165 function forInRight(object, iteratee) {
21166 return object == null
21167 ? object
21168 : baseForRight(object, getIteratee(iteratee, 3), keysIn);
21169 }
21170
21171 /**
21172 * Iterates over own enumerable string keyed properties of an object and
21173 * invokes `iteratee` for each property. The iteratee is invoked with three
21174 * arguments: (value, key, object). Iteratee functions may exit iteration
21175 * early by explicitly returning `false`.
21176 *
21177 * @static
21178 * @memberOf _
21179 * @since 0.3.0
21180 * @category Object
21181 * @param {Object} object The object to iterate over.
21182 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
21183 * @returns {Object} Returns `object`.
21184 * @see _.forOwnRight
21185 * @example
21186 *
21187 * function Foo() {
21188 * this.a = 1;
21189 * this.b = 2;
21190 * }
21191 *
21192 * Foo.prototype.c = 3;
21193 *
21194 * _.forOwn(new Foo, function(value, key) {
21195 * console.log(key);
21196 * });
21197 * // => Logs 'a' then 'b' (iteration order is not guaranteed).
21198 */
21199 function forOwn(object, iteratee) {
21200 return object && baseForOwn(object, getIteratee(iteratee, 3));
21201 }
21202
21203 /**
21204 * This method is like `_.forOwn` except that it iterates over properties of
21205 * `object` in the opposite order.
21206 *
21207 * @static
21208 * @memberOf _
21209 * @since 2.0.0
21210 * @category Object
21211 * @param {Object} object The object to iterate over.
21212 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
21213 * @returns {Object} Returns `object`.
21214 * @see _.forOwn
21215 * @example
21216 *
21217 * function Foo() {
21218 * this.a = 1;
21219 * this.b = 2;
21220 * }
21221 *
21222 * Foo.prototype.c = 3;
21223 *
21224 * _.forOwnRight(new Foo, function(value, key) {
21225 * console.log(key);
21226 * });
21227 * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.
21228 */
21229 function forOwnRight(object, iteratee) {
21230 return object && baseForOwnRight(object, getIteratee(iteratee, 3));
21231 }
21232
21233 /**
21234 * Creates an array of function property names from own enumerable properties
21235 * of `object`.
21236 *
21237 * @static
21238 * @since 0.1.0
21239 * @memberOf _
21240 * @category Object
21241 * @param {Object} object The object to inspect.
21242 * @returns {Array} Returns the function names.
21243 * @see _.functionsIn
21244 * @example
21245 *
21246 * function Foo() {
21247 * this.a = _.constant('a');
21248 * this.b = _.constant('b');
21249 * }
21250 *
21251 * Foo.prototype.c = _.constant('c');
21252 *
21253 * _.functions(new Foo);
21254 * // => ['a', 'b']
21255 */
21256 function functions(object) {
21257 return object == null ? [] : baseFunctions(object, keys(object));
21258 }
21259
21260 /**
21261 * Creates an array of function property names from own and inherited
21262 * enumerable properties of `object`.
21263 *
21264 * @static
21265 * @memberOf _
21266 * @since 4.0.0
21267 * @category Object
21268 * @param {Object} object The object to inspect.
21269 * @returns {Array} Returns the function names.
21270 * @see _.functions
21271 * @example
21272 *
21273 * function Foo() {
21274 * this.a = _.constant('a');
21275 * this.b = _.constant('b');
21276 * }
21277 *
21278 * Foo.prototype.c = _.constant('c');
21279 *
21280 * _.functionsIn(new Foo);
21281 * // => ['a', 'b', 'c']
21282 */
21283 function functionsIn(object) {
21284 return object == null ? [] : baseFunctions(object, keysIn(object));
21285 }
21286
21287 /**
21288 * Gets the value at `path` of `object`. If the resolved value is
21289 * `undefined`, the `defaultValue` is returned in its place.
21290 *
21291 * @static
21292 * @memberOf _
21293 * @since 3.7.0
21294 * @category Object
21295 * @param {Object} object The object to query.
21296 * @param {Array|string} path The path of the property to get.
21297 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
21298 * @returns {*} Returns the resolved value.
21299 * @example
21300 *
21301 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
21302 *
21303 * _.get(object, 'a[0].b.c');
21304 * // => 3
21305 *
21306 * _.get(object, ['a', '0', 'b', 'c']);
21307 * // => 3
21308 *
21309 * _.get(object, 'a.b.c', 'default');
21310 * // => 'default'
21311 */
21312 function get(object, path, defaultValue) {
21313 var result = object == null ? undefined : baseGet(object, path);
21314 return result === undefined ? defaultValue : result;
21315 }
21316
21317 /**
21318 * Checks if `path` is a direct property of `object`.
21319 *
21320 * @static
21321 * @since 0.1.0
21322 * @memberOf _
21323 * @category Object
21324 * @param {Object} object The object to query.
21325 * @param {Array|string} path The path to check.
21326 * @returns {boolean} Returns `true` if `path` exists, else `false`.
21327 * @example
21328 *
21329 * var object = { 'a': { 'b': 2 } };
21330 * var other = _.create({ 'a': _.create({ 'b': 2 }) });
21331 *
21332 * _.has(object, 'a');
21333 * // => true
21334 *
21335 * _.has(object, 'a.b');
21336 * // => true
21337 *
21338 * _.has(object, ['a', 'b']);
21339 * // => true
21340 *
21341 * _.has(other, 'a');
21342 * // => false
21343 */
21344 function has(object, path) {
21345 return object != null && hasPath(object, path, baseHas);
21346 }
21347
21348 /**
21349 * Checks if `path` is a direct or inherited property of `object`.
21350 *
21351 * @static
21352 * @memberOf _
21353 * @since 4.0.0
21354 * @category Object
21355 * @param {Object} object The object to query.
21356 * @param {Array|string} path The path to check.
21357 * @returns {boolean} Returns `true` if `path` exists, else `false`.
21358 * @example
21359 *
21360 * var object = _.create({ 'a': _.create({ 'b': 2 }) });
21361 *
21362 * _.hasIn(object, 'a');
21363 * // => true
21364 *
21365 * _.hasIn(object, 'a.b');
21366 * // => true
21367 *
21368 * _.hasIn(object, ['a', 'b']);
21369 * // => true
21370 *
21371 * _.hasIn(object, 'b');
21372 * // => false
21373 */
21374 function hasIn(object, path) {
21375 return object != null && hasPath(object, path, baseHasIn);
21376 }
21377
21378 /**
21379 * Creates an object composed of the inverted keys and values of `object`.
21380 * If `object` contains duplicate values, subsequent values overwrite
21381 * property assignments of previous values.
21382 *
21383 * @static
21384 * @memberOf _
21385 * @since 0.7.0
21386 * @category Object
21387 * @param {Object} object The object to invert.
21388 * @returns {Object} Returns the new inverted object.
21389 * @example
21390 *
21391 * var object = { 'a': 1, 'b': 2, 'c': 1 };
21392 *
21393 * _.invert(object);
21394 * // => { '1': 'c', '2': 'b' }
21395 */
21396 var invert = createInverter(function(result, value, key) {
21397 if (value != null &&
21398 typeof value.toString != 'function') {
21399 value = nativeObjectToString.call(value);
21400 }
21401
21402 result[value] = key;
21403 }, constant(identity));
21404
21405 /**
21406 * This method is like `_.invert` except that the inverted object is generated
21407 * from the results of running each element of `object` thru `iteratee`. The
21408 * corresponding inverted value of each inverted key is an array of keys
21409 * responsible for generating the inverted value. The iteratee is invoked
21410 * with one argument: (value).
21411 *
21412 * @static
21413 * @memberOf _
21414 * @since 4.1.0
21415 * @category Object
21416 * @param {Object} object The object to invert.
21417 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
21418 * @returns {Object} Returns the new inverted object.
21419 * @example
21420 *
21421 * var object = { 'a': 1, 'b': 2, 'c': 1 };
21422 *
21423 * _.invertBy(object);
21424 * // => { '1': ['a', 'c'], '2': ['b'] }
21425 *
21426 * _.invertBy(object, function(value) {
21427 * return 'group' + value;
21428 * });
21429 * // => { 'group1': ['a', 'c'], 'group2': ['b'] }
21430 */
21431 var invertBy = createInverter(function(result, value, key) {
21432 if (value != null &&
21433 typeof value.toString != 'function') {
21434 value = nativeObjectToString.call(value);
21435 }
21436
21437 if (hasOwnProperty.call(result, value)) {
21438 result[value].push(key);
21439 } else {
21440 result[value] = [key];
21441 }
21442 }, getIteratee);
21443
21444 /**
21445 * Invokes the method at `path` of `object`.
21446 *
21447 * @static
21448 * @memberOf _
21449 * @since 4.0.0
21450 * @category Object
21451 * @param {Object} object The object to query.
21452 * @param {Array|string} path The path of the method to invoke.
21453 * @param {...*} [args] The arguments to invoke the method with.
21454 * @returns {*} Returns the result of the invoked method.
21455 * @example
21456 *
21457 * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };
21458 *
21459 * _.invoke(object, 'a[0].b.c.slice', 1, 3);
21460 * // => [2, 3]
21461 */
21462 var invoke = baseRest(baseInvoke);
21463
21464 /**
21465 * Creates an array of the own enumerable property names of `object`.
21466 *
21467 * **Note:** Non-object values are coerced to objects. See the
21468 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
21469 * for more details.
21470 *
21471 * @static
21472 * @since 0.1.0
21473 * @memberOf _
21474 * @category Object
21475 * @param {Object} object The object to query.
21476 * @returns {Array} Returns the array of property names.
21477 * @example
21478 *
21479 * function Foo() {
21480 * this.a = 1;
21481 * this.b = 2;
21482 * }
21483 *
21484 * Foo.prototype.c = 3;
21485 *
21486 * _.keys(new Foo);
21487 * // => ['a', 'b'] (iteration order is not guaranteed)
21488 *
21489 * _.keys('hi');
21490 * // => ['0', '1']
21491 */
21492 function keys(object) {
21493 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
21494 }
21495
21496 /**
21497 * Creates an array of the own and inherited enumerable property names of `object`.
21498 *
21499 * **Note:** Non-object values are coerced to objects.
21500 *
21501 * @static
21502 * @memberOf _
21503 * @since 3.0.0
21504 * @category Object
21505 * @param {Object} object The object to query.
21506 * @returns {Array} Returns the array of property names.
21507 * @example
21508 *
21509 * function Foo() {
21510 * this.a = 1;
21511 * this.b = 2;
21512 * }
21513 *
21514 * Foo.prototype.c = 3;
21515 *
21516 * _.keysIn(new Foo);
21517 * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
21518 */
21519 function keysIn(object) {
21520 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);
21521 }
21522
21523 /**
21524 * The opposite of `_.mapValues`; this method creates an object with the
21525 * same values as `object` and keys generated by running each own enumerable
21526 * string keyed property of `object` thru `iteratee`. The iteratee is invoked
21527 * with three arguments: (value, key, object).
21528 *
21529 * @static
21530 * @memberOf _
21531 * @since 3.8.0
21532 * @category Object
21533 * @param {Object} object The object to iterate over.
21534 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
21535 * @returns {Object} Returns the new mapped object.
21536 * @see _.mapValues
21537 * @example
21538 *
21539 * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
21540 * return key + value;
21541 * });
21542 * // => { 'a1': 1, 'b2': 2 }
21543 */
21544 function mapKeys(object, iteratee) {
21545 var result = {};
21546 iteratee = getIteratee(iteratee, 3);
21547
21548 baseForOwn(object, function(value, key, object) {
21549 baseAssignValue(result, iteratee(value, key, object), value);
21550 });
21551 return result;
21552 }
21553
21554 /**
21555 * Creates an object with the same keys as `object` and values generated
21556 * by running each own enumerable string keyed property of `object` thru
21557 * `iteratee`. The iteratee is invoked with three arguments:
21558 * (value, key, object).
21559 *
21560 * @static
21561 * @memberOf _
21562 * @since 2.4.0
21563 * @category Object
21564 * @param {Object} object The object to iterate over.
21565 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
21566 * @returns {Object} Returns the new mapped object.
21567 * @see _.mapKeys
21568 * @example
21569 *
21570 * var users = {
21571 * 'fred': { 'user': 'fred', 'age': 40 },
21572 * 'pebbles': { 'user': 'pebbles', 'age': 1 }
21573 * };
21574 *
21575 * _.mapValues(users, function(o) { return o.age; });
21576 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
21577 *
21578 * // The `_.property` iteratee shorthand.
21579 * _.mapValues(users, 'age');
21580 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
21581 */
21582 function mapValues(object, iteratee) {
21583 var result = {};
21584 iteratee = getIteratee(iteratee, 3);
21585
21586 baseForOwn(object, function(value, key, object) {
21587 baseAssignValue(result, key, iteratee(value, key, object));
21588 });
21589 return result;
21590 }
21591
21592 /**
21593 * This method is like `_.assign` except that it recursively merges own and
21594 * inherited enumerable string keyed properties of source objects into the
21595 * destination object. Source properties that resolve to `undefined` are
21596 * skipped if a destination value exists. Array and plain object properties
21597 * are merged recursively. Other objects and value types are overridden by
21598 * assignment. Source objects are applied from left to right. Subsequent
21599 * sources overwrite property assignments of previous sources.
21600 *
21601 * **Note:** This method mutates `object`.
21602 *
21603 * @static
21604 * @memberOf _
21605 * @since 0.5.0
21606 * @category Object
21607 * @param {Object} object The destination object.
21608 * @param {...Object} [sources] The source objects.
21609 * @returns {Object} Returns `object`.
21610 * @example
21611 *
21612 * var object = {
21613 * 'a': [{ 'b': 2 }, { 'd': 4 }]
21614 * };
21615 *
21616 * var other = {
21617 * 'a': [{ 'c': 3 }, { 'e': 5 }]
21618 * };
21619 *
21620 * _.merge(object, other);
21621 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
21622 */
21623 var merge = createAssigner(function(object, source, srcIndex) {
21624 baseMerge(object, source, srcIndex);
21625 });
21626
21627 /**
21628 * This method is like `_.merge` except that it accepts `customizer` which
21629 * is invoked to produce the merged values of the destination and source
21630 * properties. If `customizer` returns `undefined`, merging is handled by the
21631 * method instead. The `customizer` is invoked with six arguments:
21632 * (objValue, srcValue, key, object, source, stack).
21633 *
21634 * **Note:** This method mutates `object`.
21635 *
21636 * @static
21637 * @memberOf _
21638 * @since 4.0.0
21639 * @category Object
21640 * @param {Object} object The destination object.
21641 * @param {...Object} sources The source objects.
21642 * @param {Function} customizer The function to customize assigned values.
21643 * @returns {Object} Returns `object`.
21644 * @example
21645 *
21646 * function customizer(objValue, srcValue) {
21647 * if (_.isArray(objValue)) {
21648 * return objValue.concat(srcValue);
21649 * }
21650 * }
21651 *
21652 * var object = { 'a': [1], 'b': [2] };
21653 * var other = { 'a': [3], 'b': [4] };
21654 *
21655 * _.mergeWith(object, other, customizer);
21656 * // => { 'a': [1, 3], 'b': [2, 4] }
21657 */
21658 var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {
21659 baseMerge(object, source, srcIndex, customizer);
21660 });
21661
21662 /**
21663 * The opposite of `_.pick`; this method creates an object composed of the
21664 * own and inherited enumerable property paths of `object` that are not omitted.
21665 *
21666 * **Note:** This method is considerably slower than `_.pick`.
21667 *
21668 * @static
21669 * @since 0.1.0
21670 * @memberOf _
21671 * @category Object
21672 * @param {Object} object The source object.
21673 * @param {...(string|string[])} [paths] The property paths to omit.
21674 * @returns {Object} Returns the new object.
21675 * @example
21676 *
21677 * var object = { 'a': 1, 'b': '2', 'c': 3 };
21678 *
21679 * _.omit(object, ['a', 'c']);
21680 * // => { 'b': '2' }
21681 */
21682 var omit = flatRest(function(object, paths) {
21683 var result = {};
21684 if (object == null) {
21685 return result;
21686 }
21687 var isDeep = false;
21688 paths = arrayMap(paths, function(path) {
21689 path = castPath(path, object);
21690 isDeep || (isDeep = path.length > 1);
21691 return path;
21692 });
21693 copyObject(object, getAllKeysIn(object), result);
21694 if (isDeep) {
21695 result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
21696 }
21697 var length = paths.length;
21698 while (length--) {
21699 baseUnset(result, paths[length]);
21700 }
21701 return result;
21702 });
21703
21704 /**
21705 * The opposite of `_.pickBy`; this method creates an object composed of
21706 * the own and inherited enumerable string keyed properties of `object` that
21707 * `predicate` doesn't return truthy for. The predicate is invoked with two
21708 * arguments: (value, key).
21709 *
21710 * @static
21711 * @memberOf _
21712 * @since 4.0.0
21713 * @category Object
21714 * @param {Object} object The source object.
21715 * @param {Function} [predicate=_.identity] The function invoked per property.
21716 * @returns {Object} Returns the new object.
21717 * @example
21718 *
21719 * var object = { 'a': 1, 'b': '2', 'c': 3 };
21720 *
21721 * _.omitBy(object, _.isNumber);
21722 * // => { 'b': '2' }
21723 */
21724 function omitBy(object, predicate) {
21725 return pickBy(object, negate(getIteratee(predicate)));
21726 }
21727
21728 /**
21729 * Creates an object composed of the picked `object` properties.
21730 *
21731 * @static
21732 * @since 0.1.0
21733 * @memberOf _
21734 * @category Object
21735 * @param {Object} object The source object.
21736 * @param {...(string|string[])} [paths] The property paths to pick.
21737 * @returns {Object} Returns the new object.
21738 * @example
21739 *
21740 * var object = { 'a': 1, 'b': '2', 'c': 3 };
21741 *
21742 * _.pick(object, ['a', 'c']);
21743 * // => { 'a': 1, 'c': 3 }
21744 */
21745 var pick = flatRest(function(object, paths) {
21746 return object == null ? {} : basePick(object, paths);
21747 });
21748
21749 /**
21750 * Creates an object composed of the `object` properties `predicate` returns
21751 * truthy for. The predicate is invoked with two arguments: (value, key).
21752 *
21753 * @static
21754 * @memberOf _
21755 * @since 4.0.0
21756 * @category Object
21757 * @param {Object} object The source object.
21758 * @param {Function} [predicate=_.identity] The function invoked per property.
21759 * @returns {Object} Returns the new object.
21760 * @example
21761 *
21762 * var object = { 'a': 1, 'b': '2', 'c': 3 };
21763 *
21764 * _.pickBy(object, _.isNumber);
21765 * // => { 'a': 1, 'c': 3 }
21766 */
21767 function pickBy(object, predicate) {
21768 if (object == null) {
21769 return {};
21770 }
21771 var props = arrayMap(getAllKeysIn(object), function(prop) {
21772 return [prop];
21773 });
21774 predicate = getIteratee(predicate);
21775 return basePickBy(object, props, function(value, path) {
21776 return predicate(value, path[0]);
21777 });
21778 }
21779
21780 /**
21781 * This method is like `_.get` except that if the resolved value is a
21782 * function it's invoked with the `this` binding of its parent object and
21783 * its result is returned.
21784 *
21785 * @static
21786 * @since 0.1.0
21787 * @memberOf _
21788 * @category Object
21789 * @param {Object} object The object to query.
21790 * @param {Array|string} path The path of the property to resolve.
21791 * @param {*} [defaultValue] The value returned for `undefined` resolved values.
21792 * @returns {*} Returns the resolved value.
21793 * @example
21794 *
21795 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
21796 *
21797 * _.result(object, 'a[0].b.c1');
21798 * // => 3
21799 *
21800 * _.result(object, 'a[0].b.c2');
21801 * // => 4
21802 *
21803 * _.result(object, 'a[0].b.c3', 'default');
21804 * // => 'default'
21805 *
21806 * _.result(object, 'a[0].b.c3', _.constant('default'));
21807 * // => 'default'
21808 */
21809 function result(object, path, defaultValue) {
21810 path = castPath(path, object);
21811
21812 var index = -1,
21813 length = path.length;
21814
21815 // Ensure the loop is entered when path is empty.
21816 if (!length) {
21817 length = 1;
21818 object = undefined;
21819 }
21820 while (++index < length) {
21821 var value = object == null ? undefined : object[toKey(path[index])];
21822 if (value === undefined) {
21823 index = length;
21824 value = defaultValue;
21825 }
21826 object = isFunction(value) ? value.call(object) : value;
21827 }
21828 return object;
21829 }
21830
21831 /**
21832 * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
21833 * it's created. Arrays are created for missing index properties while objects
21834 * are created for all other missing properties. Use `_.setWith` to customize
21835 * `path` creation.
21836 *
21837 * **Note:** This method mutates `object`.
21838 *
21839 * @static
21840 * @memberOf _
21841 * @since 3.7.0
21842 * @category Object
21843 * @param {Object} object The object to modify.
21844 * @param {Array|string} path The path of the property to set.
21845 * @param {*} value The value to set.
21846 * @returns {Object} Returns `object`.
21847 * @example
21848 *
21849 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
21850 *
21851 * _.set(object, 'a[0].b.c', 4);
21852 * console.log(object.a[0].b.c);
21853 * // => 4
21854 *
21855 * _.set(object, ['x', '0', 'y', 'z'], 5);
21856 * console.log(object.x[0].y.z);
21857 * // => 5
21858 */
21859 function set(object, path, value) {
21860 return object == null ? object : baseSet(object, path, value);
21861 }
21862
21863 /**
21864 * This method is like `_.set` except that it accepts `customizer` which is
21865 * invoked to produce the objects of `path`. If `customizer` returns `undefined`
21866 * path creation is handled by the method instead. The `customizer` is invoked
21867 * with three arguments: (nsValue, key, nsObject).
21868 *
21869 * **Note:** This method mutates `object`.
21870 *
21871 * @static
21872 * @memberOf _
21873 * @since 4.0.0
21874 * @category Object
21875 * @param {Object} object The object to modify.
21876 * @param {Array|string} path The path of the property to set.
21877 * @param {*} value The value to set.
21878 * @param {Function} [customizer] The function to customize assigned values.
21879 * @returns {Object} Returns `object`.
21880 * @example
21881 *
21882 * var object = {};
21883 *
21884 * _.setWith(object, '[0][1]', 'a', Object);
21885 * // => { '0': { '1': 'a' } }
21886 */
21887 function setWith(object, path, value, customizer) {
21888 customizer = typeof customizer == 'function' ? customizer : undefined;
21889 return object == null ? object : baseSet(object, path, value, customizer);
21890 }
21891
21892 /**
21893 * Creates an array of own enumerable string keyed-value pairs for `object`
21894 * which can be consumed by `_.fromPairs`. If `object` is a map or set, its
21895 * entries are returned.
21896 *
21897 * @static
21898 * @memberOf _
21899 * @since 4.0.0
21900 * @alias entries
21901 * @category Object
21902 * @param {Object} object The object to query.
21903 * @returns {Array} Returns the key-value pairs.
21904 * @example
21905 *
21906 * function Foo() {
21907 * this.a = 1;
21908 * this.b = 2;
21909 * }
21910 *
21911 * Foo.prototype.c = 3;
21912 *
21913 * _.toPairs(new Foo);
21914 * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)
21915 */
21916 var toPairs = createToPairs(keys);
21917
21918 /**
21919 * Creates an array of own and inherited enumerable string keyed-value pairs
21920 * for `object` which can be consumed by `_.fromPairs`. If `object` is a map
21921 * or set, its entries are returned.
21922 *
21923 * @static
21924 * @memberOf _
21925 * @since 4.0.0
21926 * @alias entriesIn
21927 * @category Object
21928 * @param {Object} object The object to query.
21929 * @returns {Array} Returns the key-value pairs.
21930 * @example
21931 *
21932 * function Foo() {
21933 * this.a = 1;
21934 * this.b = 2;
21935 * }
21936 *
21937 * Foo.prototype.c = 3;
21938 *
21939 * _.toPairsIn(new Foo);
21940 * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)
21941 */
21942 var toPairsIn = createToPairs(keysIn);
21943
21944 /**
21945 * An alternative to `_.reduce`; this method transforms `object` to a new
21946 * `accumulator` object which is the result of running each of its own
21947 * enumerable string keyed properties thru `iteratee`, with each invocation
21948 * potentially mutating the `accumulator` object. If `accumulator` is not
21949 * provided, a new object with the same `[[Prototype]]` will be used. The
21950 * iteratee is invoked with four arguments: (accumulator, value, key, object).
21951 * Iteratee functions may exit iteration early by explicitly returning `false`.
21952 *
21953 * @static
21954 * @memberOf _
21955 * @since 1.3.0
21956 * @category Object
21957 * @param {Object} object The object to iterate over.
21958 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
21959 * @param {*} [accumulator] The custom accumulator value.
21960 * @returns {*} Returns the accumulated value.
21961 * @example
21962 *
21963 * _.transform([2, 3, 4], function(result, n) {
21964 * result.push(n *= n);
21965 * return n % 2 == 0;
21966 * }, []);
21967 * // => [4, 9]
21968 *
21969 * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {
21970 * (result[value] || (result[value] = [])).push(key);
21971 * }, {});
21972 * // => { '1': ['a', 'c'], '2': ['b'] }
21973 */
21974 function transform(object, iteratee, accumulator) {
21975 var isArr = isArray(object),
21976 isArrLike = isArr || isBuffer(object) || isTypedArray(object);
21977
21978 iteratee = getIteratee(iteratee, 4);
21979 if (accumulator == null) {
21980 var Ctor = object && object.constructor;
21981 if (isArrLike) {
21982 accumulator = isArr ? new Ctor : [];
21983 }
21984 else if (isObject(object)) {
21985 accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};
21986 }
21987 else {
21988 accumulator = {};
21989 }
21990 }
21991 (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {
21992 return iteratee(accumulator, value, index, object);
21993 });
21994 return accumulator;
21995 }
21996
21997 /**
21998 * Removes the property at `path` of `object`.
21999 *
22000 * **Note:** This method mutates `object`.
22001 *
22002 * @static
22003 * @memberOf _
22004 * @since 4.0.0
22005 * @category Object
22006 * @param {Object} object The object to modify.
22007 * @param {Array|string} path The path of the property to unset.
22008 * @returns {boolean} Returns `true` if the property is deleted, else `false`.
22009 * @example
22010 *
22011 * var object = { 'a': [{ 'b': { 'c': 7 } }] };
22012 * _.unset(object, 'a[0].b.c');
22013 * // => true
22014 *
22015 * console.log(object);
22016 * // => { 'a': [{ 'b': {} }] };
22017 *
22018 * _.unset(object, ['a', '0', 'b', 'c']);
22019 * // => true
22020 *
22021 * console.log(object);
22022 * // => { 'a': [{ 'b': {} }] };
22023 */
22024 function unset(object, path) {
22025 return object == null ? true : baseUnset(object, path);
22026 }
22027
22028 /**
22029 * This method is like `_.set` except that accepts `updater` to produce the
22030 * value to set. Use `_.updateWith` to customize `path` creation. The `updater`
22031 * is invoked with one argument: (value).
22032 *
22033 * **Note:** This method mutates `object`.
22034 *
22035 * @static
22036 * @memberOf _
22037 * @since 4.6.0
22038 * @category Object
22039 * @param {Object} object The object to modify.
22040 * @param {Array|string} path The path of the property to set.
22041 * @param {Function} updater The function to produce the updated value.
22042 * @returns {Object} Returns `object`.
22043 * @example
22044 *
22045 * var object = { 'a': [{ 'b': { 'c': 3 } }] };
22046 *
22047 * _.update(object, 'a[0].b.c', function(n) { return n * n; });
22048 * console.log(object.a[0].b.c);
22049 * // => 9
22050 *
22051 * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });
22052 * console.log(object.x[0].y.z);
22053 * // => 0
22054 */
22055 function update(object, path, updater) {
22056 return object == null ? object : baseUpdate(object, path, castFunction(updater));
22057 }
22058
22059 /**
22060 * This method is like `_.update` except that it accepts `customizer` which is
22061 * invoked to produce the objects of `path`. If `customizer` returns `undefined`
22062 * path creation is handled by the method instead. The `customizer` is invoked
22063 * with three arguments: (nsValue, key, nsObject).
22064 *
22065 * **Note:** This method mutates `object`.
22066 *
22067 * @static
22068 * @memberOf _
22069 * @since 4.6.0
22070 * @category Object
22071 * @param {Object} object The object to modify.
22072 * @param {Array|string} path The path of the property to set.
22073 * @param {Function} updater The function to produce the updated value.
22074 * @param {Function} [customizer] The function to customize assigned values.
22075 * @returns {Object} Returns `object`.
22076 * @example
22077 *
22078 * var object = {};
22079 *
22080 * _.updateWith(object, '[0][1]', _.constant('a'), Object);
22081 * // => { '0': { '1': 'a' } }
22082 */
22083 function updateWith(object, path, updater, customizer) {
22084 customizer = typeof customizer == 'function' ? customizer : undefined;
22085 return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);
22086 }
22087
22088 /**
22089 * Creates an array of the own enumerable string keyed property values of `object`.
22090 *
22091 * **Note:** Non-object values are coerced to objects.
22092 *
22093 * @static
22094 * @since 0.1.0
22095 * @memberOf _
22096 * @category Object
22097 * @param {Object} object The object to query.
22098 * @returns {Array} Returns the array of property values.
22099 * @example
22100 *
22101 * function Foo() {
22102 * this.a = 1;
22103 * this.b = 2;
22104 * }
22105 *
22106 * Foo.prototype.c = 3;
22107 *
22108 * _.values(new Foo);
22109 * // => [1, 2] (iteration order is not guaranteed)
22110 *
22111 * _.values('hi');
22112 * // => ['h', 'i']
22113 */
22114 function values(object) {
22115 return object == null ? [] : baseValues(object, keys(object));
22116 }
22117
22118 /**
22119 * Creates an array of the own and inherited enumerable string keyed property
22120 * values of `object`.
22121 *
22122 * **Note:** Non-object values are coerced to objects.
22123 *
22124 * @static
22125 * @memberOf _
22126 * @since 3.0.0
22127 * @category Object
22128 * @param {Object} object The object to query.
22129 * @returns {Array} Returns the array of property values.
22130 * @example
22131 *
22132 * function Foo() {
22133 * this.a = 1;
22134 * this.b = 2;
22135 * }
22136 *
22137 * Foo.prototype.c = 3;
22138 *
22139 * _.valuesIn(new Foo);
22140 * // => [1, 2, 3] (iteration order is not guaranteed)
22141 */
22142 function valuesIn(object) {
22143 return object == null ? [] : baseValues(object, keysIn(object));
22144 }
22145
22146 /*------------------------------------------------------------------------*/
22147
22148 /**
22149 * Clamps `number` within the inclusive `lower` and `upper` bounds.
22150 *
22151 * @static
22152 * @memberOf _
22153 * @since 4.0.0
22154 * @category Number
22155 * @param {number} number The number to clamp.
22156 * @param {number} [lower] The lower bound.
22157 * @param {number} upper The upper bound.
22158 * @returns {number} Returns the clamped number.
22159 * @example
22160 *
22161 * _.clamp(-10, -5, 5);
22162 * // => -5
22163 *
22164 * _.clamp(10, -5, 5);
22165 * // => 5
22166 */
22167 function clamp(number, lower, upper) {
22168 if (upper === undefined) {
22169 upper = lower;
22170 lower = undefined;
22171 }
22172 if (upper !== undefined) {
22173 upper = toNumber(upper);
22174 upper = upper === upper ? upper : 0;
22175 }
22176 if (lower !== undefined) {
22177 lower = toNumber(lower);
22178 lower = lower === lower ? lower : 0;
22179 }
22180 return baseClamp(toNumber(number), lower, upper);
22181 }
22182
22183 /**
22184 * Checks if `n` is between `start` and up to, but not including, `end`. If
22185 * `end` is not specified, it's set to `start` with `start` then set to `0`.
22186 * If `start` is greater than `end` the params are swapped to support
22187 * negative ranges.
22188 *
22189 * @static
22190 * @memberOf _
22191 * @since 3.3.0
22192 * @category Number
22193 * @param {number} number The number to check.
22194 * @param {number} [start=0] The start of the range.
22195 * @param {number} end The end of the range.
22196 * @returns {boolean} Returns `true` if `number` is in the range, else `false`.
22197 * @see _.range, _.rangeRight
22198 * @example
22199 *
22200 * _.inRange(3, 2, 4);
22201 * // => true
22202 *
22203 * _.inRange(4, 8);
22204 * // => true
22205 *
22206 * _.inRange(4, 2);
22207 * // => false
22208 *
22209 * _.inRange(2, 2);
22210 * // => false
22211 *
22212 * _.inRange(1.2, 2);
22213 * // => true
22214 *
22215 * _.inRange(5.2, 4);
22216 * // => false
22217 *
22218 * _.inRange(-3, -2, -6);
22219 * // => true
22220 */
22221 function inRange(number, start, end) {
22222 start = toFinite(start);
22223 if (end === undefined) {
22224 end = start;
22225 start = 0;
22226 } else {
22227 end = toFinite(end);
22228 }
22229 number = toNumber(number);
22230 return baseInRange(number, start, end);
22231 }
22232
22233 /**
22234 * Produces a random number between the inclusive `lower` and `upper` bounds.
22235 * If only one argument is provided a number between `0` and the given number
22236 * is returned. If `floating` is `true`, or either `lower` or `upper` are
22237 * floats, a floating-point number is returned instead of an integer.
22238 *
22239 * **Note:** JavaScript follows the IEEE-754 standard for resolving
22240 * floating-point values which can produce unexpected results.
22241 *
22242 * @static
22243 * @memberOf _
22244 * @since 0.7.0
22245 * @category Number
22246 * @param {number} [lower=0] The lower bound.
22247 * @param {number} [upper=1] The upper bound.
22248 * @param {boolean} [floating] Specify returning a floating-point number.
22249 * @returns {number} Returns the random number.
22250 * @example
22251 *
22252 * _.random(0, 5);
22253 * // => an integer between 0 and 5
22254 *
22255 * _.random(5);
22256 * // => also an integer between 0 and 5
22257 *
22258 * _.random(5, true);
22259 * // => a floating-point number between 0 and 5
22260 *
22261 * _.random(1.2, 5.2);
22262 * // => a floating-point number between 1.2 and 5.2
22263 */
22264 function random(lower, upper, floating) {
22265 if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {
22266 upper = floating = undefined;
22267 }
22268 if (floating === undefined) {
22269 if (typeof upper == 'boolean') {
22270 floating = upper;
22271 upper = undefined;
22272 }
22273 else if (typeof lower == 'boolean') {
22274 floating = lower;
22275 lower = undefined;
22276 }
22277 }
22278 if (lower === undefined && upper === undefined) {
22279 lower = 0;
22280 upper = 1;
22281 }
22282 else {
22283 lower = toFinite(lower);
22284 if (upper === undefined) {
22285 upper = lower;
22286 lower = 0;
22287 } else {
22288 upper = toFinite(upper);
22289 }
22290 }
22291 if (lower > upper) {
22292 var temp = lower;
22293 lower = upper;
22294 upper = temp;
22295 }
22296 if (floating || lower % 1 || upper % 1) {
22297 var rand = nativeRandom();
22298 return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);
22299 }
22300 return baseRandom(lower, upper);
22301 }
22302
22303 /*------------------------------------------------------------------------*/
22304
22305 /**
22306 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
22307 *
22308 * @static
22309 * @memberOf _
22310 * @since 3.0.0
22311 * @category String
22312 * @param {string} [string=''] The string to convert.
22313 * @returns {string} Returns the camel cased string.
22314 * @example
22315 *
22316 * _.camelCase('Foo Bar');
22317 * // => 'fooBar'
22318 *
22319 * _.camelCase('--foo-bar--');
22320 * // => 'fooBar'
22321 *
22322 * _.camelCase('__FOO_BAR__');
22323 * // => 'fooBar'
22324 */
22325 var camelCase = createCompounder(function(result, word, index) {
22326 word = word.toLowerCase();
22327 return result + (index ? capitalize(word) : word);
22328 });
22329
22330 /**
22331 * Converts the first character of `string` to upper case and the remaining
22332 * to lower case.
22333 *
22334 * @static
22335 * @memberOf _
22336 * @since 3.0.0
22337 * @category String
22338 * @param {string} [string=''] The string to capitalize.
22339 * @returns {string} Returns the capitalized string.
22340 * @example
22341 *
22342 * _.capitalize('FRED');
22343 * // => 'Fred'
22344 */
22345 function capitalize(string) {
22346 return upperFirst(toString(string).toLowerCase());
22347 }
22348
22349 /**
22350 * Deburrs `string` by converting
22351 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
22352 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)
22353 * letters to basic Latin letters and removing
22354 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
22355 *
22356 * @static
22357 * @memberOf _
22358 * @since 3.0.0
22359 * @category String
22360 * @param {string} [string=''] The string to deburr.
22361 * @returns {string} Returns the deburred string.
22362 * @example
22363 *
22364 * _.deburr('déjà vu');
22365 * // => 'deja vu'
22366 */
22367 function deburr(string) {
22368 string = toString(string);
22369 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');
22370 }
22371
22372 /**
22373 * Checks if `string` ends with the given target string.
22374 *
22375 * @static
22376 * @memberOf _
22377 * @since 3.0.0
22378 * @category String
22379 * @param {string} [string=''] The string to inspect.
22380 * @param {string} [target] The string to search for.
22381 * @param {number} [position=string.length] The position to search up to.
22382 * @returns {boolean} Returns `true` if `string` ends with `target`,
22383 * else `false`.
22384 * @example
22385 *
22386 * _.endsWith('abc', 'c');
22387 * // => true
22388 *
22389 * _.endsWith('abc', 'b');
22390 * // => false
22391 *
22392 * _.endsWith('abc', 'b', 2);
22393 * // => true
22394 */
22395 function endsWith(string, target, position) {
22396 string = toString(string);
22397 target = baseToString(target);
22398
22399 var length = string.length;
22400 position = position === undefined
22401 ? length
22402 : baseClamp(toInteger(position), 0, length);
22403
22404 var end = position;
22405 position -= target.length;
22406 return position >= 0 && string.slice(position, end) == target;
22407 }
22408
22409 /**
22410 * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
22411 * corresponding HTML entities.
22412 *
22413 * **Note:** No other characters are escaped. To escape additional
22414 * characters use a third-party library like [_he_](https://mths.be/he).
22415 *
22416 * Though the ">" character is escaped for symmetry, characters like
22417 * ">" and "/" don't need escaping in HTML and have no special meaning
22418 * unless they're part of a tag or unquoted attribute value. See
22419 * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
22420 * (under "semi-related fun fact") for more details.
22421 *
22422 * When working with HTML you should always
22423 * [quote attribute values](http://wonko.com/post/html-escaping) to reduce
22424 * XSS vectors.
22425 *
22426 * @static
22427 * @since 0.1.0
22428 * @memberOf _
22429 * @category String
22430 * @param {string} [string=''] The string to escape.
22431 * @returns {string} Returns the escaped string.
22432 * @example
22433 *
22434 * _.escape('fred, barney, & pebbles');
22435 * // => 'fred, barney, &amp; pebbles'
22436 */
22437 function escape(string) {
22438 string = toString(string);
22439 return (string && reHasUnescapedHtml.test(string))
22440 ? string.replace(reUnescapedHtml, escapeHtmlChar)
22441 : string;
22442 }
22443
22444 /**
22445 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
22446 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
22447 *
22448 * @static
22449 * @memberOf _
22450 * @since 3.0.0
22451 * @category String
22452 * @param {string} [string=''] The string to escape.
22453 * @returns {string} Returns the escaped string.
22454 * @example
22455 *
22456 * _.escapeRegExp('[lodash](https://lodash.com/)');
22457 * // => '\[lodash\]\(https://lodash\.com/\)'
22458 */
22459 function escapeRegExp(string) {
22460 string = toString(string);
22461 return (string && reHasRegExpChar.test(string))
22462 ? string.replace(reRegExpChar, '\\$&')
22463 : string;
22464 }
22465
22466 /**
22467 * Converts `string` to
22468 * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
22469 *
22470 * @static
22471 * @memberOf _
22472 * @since 3.0.0
22473 * @category String
22474 * @param {string} [string=''] The string to convert.
22475 * @returns {string} Returns the kebab cased string.
22476 * @example
22477 *
22478 * _.kebabCase('Foo Bar');
22479 * // => 'foo-bar'
22480 *
22481 * _.kebabCase('fooBar');
22482 * // => 'foo-bar'
22483 *
22484 * _.kebabCase('__FOO_BAR__');
22485 * // => 'foo-bar'
22486 */
22487 var kebabCase = createCompounder(function(result, word, index) {
22488 return result + (index ? '-' : '') + word.toLowerCase();
22489 });
22490
22491 /**
22492 * Converts `string`, as space separated words, to lower case.
22493 *
22494 * @static
22495 * @memberOf _
22496 * @since 4.0.0
22497 * @category String
22498 * @param {string} [string=''] The string to convert.
22499 * @returns {string} Returns the lower cased string.
22500 * @example
22501 *
22502 * _.lowerCase('--Foo-Bar--');
22503 * // => 'foo bar'
22504 *
22505 * _.lowerCase('fooBar');
22506 * // => 'foo bar'
22507 *
22508 * _.lowerCase('__FOO_BAR__');
22509 * // => 'foo bar'
22510 */
22511 var lowerCase = createCompounder(function(result, word, index) {
22512 return result + (index ? ' ' : '') + word.toLowerCase();
22513 });
22514
22515 /**
22516 * Converts the first character of `string` to lower case.
22517 *
22518 * @static
22519 * @memberOf _
22520 * @since 4.0.0
22521 * @category String
22522 * @param {string} [string=''] The string to convert.
22523 * @returns {string} Returns the converted string.
22524 * @example
22525 *
22526 * _.lowerFirst('Fred');
22527 * // => 'fred'
22528 *
22529 * _.lowerFirst('FRED');
22530 * // => 'fRED'
22531 */
22532 var lowerFirst = createCaseFirst('toLowerCase');
22533
22534 /**
22535 * Pads `string` on the left and right sides if it's shorter than `length`.
22536 * Padding characters are truncated if they can't be evenly divided by `length`.
22537 *
22538 * @static
22539 * @memberOf _
22540 * @since 3.0.0
22541 * @category String
22542 * @param {string} [string=''] The string to pad.
22543 * @param {number} [length=0] The padding length.
22544 * @param {string} [chars=' '] The string used as padding.
22545 * @returns {string} Returns the padded string.
22546 * @example
22547 *
22548 * _.pad('abc', 8);
22549 * // => ' abc '
22550 *
22551 * _.pad('abc', 8, '_-');
22552 * // => '_-abc_-_'
22553 *
22554 * _.pad('abc', 3);
22555 * // => 'abc'
22556 */
22557 function pad(string, length, chars) {
22558 string = toString(string);
22559 length = toInteger(length);
22560
22561 var strLength = length ? stringSize(string) : 0;
22562 if (!length || strLength >= length) {
22563 return string;
22564 }
22565 var mid = (length - strLength) / 2;
22566 return (
22567 createPadding(nativeFloor(mid), chars) +
22568 string +
22569 createPadding(nativeCeil(mid), chars)
22570 );
22571 }
22572
22573 /**
22574 * Pads `string` on the right side if it's shorter than `length`. Padding
22575 * characters are truncated if they exceed `length`.
22576 *
22577 * @static
22578 * @memberOf _
22579 * @since 4.0.0
22580 * @category String
22581 * @param {string} [string=''] The string to pad.
22582 * @param {number} [length=0] The padding length.
22583 * @param {string} [chars=' '] The string used as padding.
22584 * @returns {string} Returns the padded string.
22585 * @example
22586 *
22587 * _.padEnd('abc', 6);
22588 * // => 'abc '
22589 *
22590 * _.padEnd('abc', 6, '_-');
22591 * // => 'abc_-_'
22592 *
22593 * _.padEnd('abc', 3);
22594 * // => 'abc'
22595 */
22596 function padEnd(string, length, chars) {
22597 string = toString(string);
22598 length = toInteger(length);
22599
22600 var strLength = length ? stringSize(string) : 0;
22601 return (length && strLength < length)
22602 ? (string + createPadding(length - strLength, chars))
22603 : string;
22604 }
22605
22606 /**
22607 * Pads `string` on the left side if it's shorter than `length`. Padding
22608 * characters are truncated if they exceed `length`.
22609 *
22610 * @static
22611 * @memberOf _
22612 * @since 4.0.0
22613 * @category String
22614 * @param {string} [string=''] The string to pad.
22615 * @param {number} [length=0] The padding length.
22616 * @param {string} [chars=' '] The string used as padding.
22617 * @returns {string} Returns the padded string.
22618 * @example
22619 *
22620 * _.padStart('abc', 6);
22621 * // => ' abc'
22622 *
22623 * _.padStart('abc', 6, '_-');
22624 * // => '_-_abc'
22625 *
22626 * _.padStart('abc', 3);
22627 * // => 'abc'
22628 */
22629 function padStart(string, length, chars) {
22630 string = toString(string);
22631 length = toInteger(length);
22632
22633 var strLength = length ? stringSize(string) : 0;
22634 return (length && strLength < length)
22635 ? (createPadding(length - strLength, chars) + string)
22636 : string;
22637 }
22638
22639 /**
22640 * Converts `string` to an integer of the specified radix. If `radix` is
22641 * `undefined` or `0`, a `radix` of `10` is used unless `value` is a
22642 * hexadecimal, in which case a `radix` of `16` is used.
22643 *
22644 * **Note:** This method aligns with the
22645 * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.
22646 *
22647 * @static
22648 * @memberOf _
22649 * @since 1.1.0
22650 * @category String
22651 * @param {string} string The string to convert.
22652 * @param {number} [radix=10] The radix to interpret `value` by.
22653 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
22654 * @returns {number} Returns the converted integer.
22655 * @example
22656 *
22657 * _.parseInt('08');
22658 * // => 8
22659 *
22660 * _.map(['6', '08', '10'], _.parseInt);
22661 * // => [6, 8, 10]
22662 */
22663 function parseInt(string, radix, guard) {
22664 if (guard || radix == null) {
22665 radix = 0;
22666 } else if (radix) {
22667 radix = +radix;
22668 }
22669 return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);
22670 }
22671
22672 /**
22673 * Repeats the given string `n` times.
22674 *
22675 * @static
22676 * @memberOf _
22677 * @since 3.0.0
22678 * @category String
22679 * @param {string} [string=''] The string to repeat.
22680 * @param {number} [n=1] The number of times to repeat the string.
22681 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
22682 * @returns {string} Returns the repeated string.
22683 * @example
22684 *
22685 * _.repeat('*', 3);
22686 * // => '***'
22687 *
22688 * _.repeat('abc', 2);
22689 * // => 'abcabc'
22690 *
22691 * _.repeat('abc', 0);
22692 * // => ''
22693 */
22694 function repeat(string, n, guard) {
22695 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {
22696 n = 1;
22697 } else {
22698 n = toInteger(n);
22699 }
22700 return baseRepeat(toString(string), n);
22701 }
22702
22703 /**
22704 * Replaces matches for `pattern` in `string` with `replacement`.
22705 *
22706 * **Note:** This method is based on
22707 * [`String#replace`](https://mdn.io/String/replace).
22708 *
22709 * @static
22710 * @memberOf _
22711 * @since 4.0.0
22712 * @category String
22713 * @param {string} [string=''] The string to modify.
22714 * @param {RegExp|string} pattern The pattern to replace.
22715 * @param {Function|string} replacement The match replacement.
22716 * @returns {string} Returns the modified string.
22717 * @example
22718 *
22719 * _.replace('Hi Fred', 'Fred', 'Barney');
22720 * // => 'Hi Barney'
22721 */
22722 function replace() {
22723 var args = arguments,
22724 string = toString(args[0]);
22725
22726 return args.length < 3 ? string : string.replace(args[1], args[2]);
22727 }
22728
22729 /**
22730 * Converts `string` to
22731 * [snake case](https://en.wikipedia.org/wiki/Snake_case).
22732 *
22733 * @static
22734 * @memberOf _
22735 * @since 3.0.0
22736 * @category String
22737 * @param {string} [string=''] The string to convert.
22738 * @returns {string} Returns the snake cased string.
22739 * @example
22740 *
22741 * _.snakeCase('Foo Bar');
22742 * // => 'foo_bar'
22743 *
22744 * _.snakeCase('fooBar');
22745 * // => 'foo_bar'
22746 *
22747 * _.snakeCase('--FOO-BAR--');
22748 * // => 'foo_bar'
22749 */
22750 var snakeCase = createCompounder(function(result, word, index) {
22751 return result + (index ? '_' : '') + word.toLowerCase();
22752 });
22753
22754 /**
22755 * Splits `string` by `separator`.
22756 *
22757 * **Note:** This method is based on
22758 * [`String#split`](https://mdn.io/String/split).
22759 *
22760 * @static
22761 * @memberOf _
22762 * @since 4.0.0
22763 * @category String
22764 * @param {string} [string=''] The string to split.
22765 * @param {RegExp|string} separator The separator pattern to split by.
22766 * @param {number} [limit] The length to truncate results to.
22767 * @returns {Array} Returns the string segments.
22768 * @example
22769 *
22770 * _.split('a-b-c', '-', 2);
22771 * // => ['a', 'b']
22772 */
22773 function split(string, separator, limit) {
22774 if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {
22775 separator = limit = undefined;
22776 }
22777 limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;
22778 if (!limit) {
22779 return [];
22780 }
22781 string = toString(string);
22782 if (string && (
22783 typeof separator == 'string' ||
22784 (separator != null && !isRegExp(separator))
22785 )) {
22786 separator = baseToString(separator);
22787 if (!separator && hasUnicode(string)) {
22788 return castSlice(stringToArray(string), 0, limit);
22789 }
22790 }
22791 return string.split(separator, limit);
22792 }
22793
22794 /**
22795 * Converts `string` to
22796 * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
22797 *
22798 * @static
22799 * @memberOf _
22800 * @since 3.1.0
22801 * @category String
22802 * @param {string} [string=''] The string to convert.
22803 * @returns {string} Returns the start cased string.
22804 * @example
22805 *
22806 * _.startCase('--foo-bar--');
22807 * // => 'Foo Bar'
22808 *
22809 * _.startCase('fooBar');
22810 * // => 'Foo Bar'
22811 *
22812 * _.startCase('__FOO_BAR__');
22813 * // => 'FOO BAR'
22814 */
22815 var startCase = createCompounder(function(result, word, index) {
22816 return result + (index ? ' ' : '') + upperFirst(word);
22817 });
22818
22819 /**
22820 * Checks if `string` starts with the given target string.
22821 *
22822 * @static
22823 * @memberOf _
22824 * @since 3.0.0
22825 * @category String
22826 * @param {string} [string=''] The string to inspect.
22827 * @param {string} [target] The string to search for.
22828 * @param {number} [position=0] The position to search from.
22829 * @returns {boolean} Returns `true` if `string` starts with `target`,
22830 * else `false`.
22831 * @example
22832 *
22833 * _.startsWith('abc', 'a');
22834 * // => true
22835 *
22836 * _.startsWith('abc', 'b');
22837 * // => false
22838 *
22839 * _.startsWith('abc', 'b', 1);
22840 * // => true
22841 */
22842 function startsWith(string, target, position) {
22843 string = toString(string);
22844 position = position == null
22845 ? 0
22846 : baseClamp(toInteger(position), 0, string.length);
22847
22848 target = baseToString(target);
22849 return string.slice(position, position + target.length) == target;
22850 }
22851
22852 /**
22853 * Creates a compiled template function that can interpolate data properties
22854 * in "interpolate" delimiters, HTML-escape interpolated data properties in
22855 * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
22856 * properties may be accessed as free variables in the template. If a setting
22857 * object is given, it takes precedence over `_.templateSettings` values.
22858 *
22859 * **Note:** In the development build `_.template` utilizes
22860 * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
22861 * for easier debugging.
22862 *
22863 * For more information on precompiling templates see
22864 * [lodash's custom builds documentation](https://lodash.com/custom-builds).
22865 *
22866 * For more information on Chrome extension sandboxes see
22867 * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
22868 *
22869 * @static
22870 * @since 0.1.0
22871 * @memberOf _
22872 * @category String
22873 * @param {string} [string=''] The template string.
22874 * @param {Object} [options={}] The options object.
22875 * @param {RegExp} [options.escape=_.templateSettings.escape]
22876 * The HTML "escape" delimiter.
22877 * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]
22878 * The "evaluate" delimiter.
22879 * @param {Object} [options.imports=_.templateSettings.imports]
22880 * An object to import into the template as free variables.
22881 * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]
22882 * The "interpolate" delimiter.
22883 * @param {string} [options.sourceURL='lodash.templateSources[n]']
22884 * The sourceURL of the compiled template.
22885 * @param {string} [options.variable='obj']
22886 * The data object variable name.
22887 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
22888 * @returns {Function} Returns the compiled template function.
22889 * @example
22890 *
22891 * // Use the "interpolate" delimiter to create a compiled template.
22892 * var compiled = _.template('hello <%= user %>!');
22893 * compiled({ 'user': 'fred' });
22894 * // => 'hello fred!'
22895 *
22896 * // Use the HTML "escape" delimiter to escape data property values.
22897 * var compiled = _.template('<b><%- value %></b>');
22898 * compiled({ 'value': '<script>' });
22899 * // => '<b>&lt;script&gt;</b>'
22900 *
22901 * // Use the "evaluate" delimiter to execute JavaScript and generate HTML.
22902 * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
22903 * compiled({ 'users': ['fred', 'barney'] });
22904 * // => '<li>fred</li><li>barney</li>'
22905 *
22906 * // Use the internal `print` function in "evaluate" delimiters.
22907 * var compiled = _.template('<% print("hello " + user); %>!');
22908 * compiled({ 'user': 'barney' });
22909 * // => 'hello barney!'
22910 *
22911 * // Use the ES template literal delimiter as an "interpolate" delimiter.
22912 * // Disable support by replacing the "interpolate" delimiter.
22913 * var compiled = _.template('hello ${ user }!');
22914 * compiled({ 'user': 'pebbles' });
22915 * // => 'hello pebbles!'
22916 *
22917 * // Use backslashes to treat delimiters as plain text.
22918 * var compiled = _.template('<%= "\\<%- value %\\>" %>');
22919 * compiled({ 'value': 'ignored' });
22920 * // => '<%- value %>'
22921 *
22922 * // Use the `imports` option to import `jQuery` as `jq`.
22923 * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
22924 * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
22925 * compiled({ 'users': ['fred', 'barney'] });
22926 * // => '<li>fred</li><li>barney</li>'
22927 *
22928 * // Use the `sourceURL` option to specify a custom sourceURL for the template.
22929 * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
22930 * compiled(data);
22931 * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector.
22932 *
22933 * // Use the `variable` option to ensure a with-statement isn't used in the compiled template.
22934 * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
22935 * compiled.source;
22936 * // => function(data) {
22937 * // var __t, __p = '';
22938 * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
22939 * // return __p;
22940 * // }
22941 *
22942 * // Use custom template delimiters.
22943 * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
22944 * var compiled = _.template('hello {{ user }}!');
22945 * compiled({ 'user': 'mustache' });
22946 * // => 'hello mustache!'
22947 *
22948 * // Use the `source` property to inline compiled templates for meaningful
22949 * // line numbers in error messages and stack traces.
22950 * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\
22951 * var JST = {\
22952 * "main": ' + _.template(mainText).source + '\
22953 * };\
22954 * ');
22955 */
22956 function template(string, options, guard) {
22957 // Based on John Resig's `tmpl` implementation
22958 // (http://ejohn.org/blog/javascript-micro-templating/)
22959 // and Laura Doktorova's doT.js (https://github.com/olado/doT).
22960 var settings = lodash.templateSettings;
22961
22962 if (guard && isIterateeCall(string, options, guard)) {
22963 options = undefined;
22964 }
22965 string = toString(string);
22966 options = assignInWith({}, options, settings, customDefaultsAssignIn);
22967
22968 var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn),
22969 importsKeys = keys(imports),
22970 importsValues = baseValues(imports, importsKeys);
22971
22972 var isEscaping,
22973 isEvaluating,
22974 index = 0,
22975 interpolate = options.interpolate || reNoMatch,
22976 source = "__p += '";
22977
22978 // Compile the regexp to match each delimiter.
22979 var reDelimiters = RegExp(
22980 (options.escape || reNoMatch).source + '|' +
22981 interpolate.source + '|' +
22982 (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' +
22983 (options.evaluate || reNoMatch).source + '|$'
22984 , 'g');
22985
22986 // Use a sourceURL for easier debugging.
22987 var sourceURL = '//# sourceURL=' +
22988 ('sourceURL' in options
22989 ? options.sourceURL
22990 : ('lodash.templateSources[' + (++templateCounter) + ']')
22991 ) + '\n';
22992
22993 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
22994 interpolateValue || (interpolateValue = esTemplateValue);
22995
22996 // Escape characters that can't be included in string literals.
22997 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
22998
22999 // Replace delimiters with snippets.
23000 if (escapeValue) {
23001 isEscaping = true;
23002 source += "' +\n__e(" + escapeValue + ") +\n'";
23003 }
23004 if (evaluateValue) {
23005 isEvaluating = true;
23006 source += "';\n" + evaluateValue + ";\n__p += '";
23007 }
23008 if (interpolateValue) {
23009 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'";
23010 }
23011 index = offset + match.length;
23012
23013 // The JS engine embedded in Adobe products needs `match` returned in
23014 // order to produce the correct `offset` value.
23015 return match;
23016 });
23017
23018 source += "';\n";
23019
23020 // If `variable` is not specified wrap a with-statement around the generated
23021 // code to add the data object to the top of the scope chain.
23022 var variable = options.variable;
23023 if (!variable) {
23024 source = 'with (obj) {\n' + source + '\n}\n';
23025 }
23026 // Cleanup code by stripping empty strings.
23027 source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source)
23028 .replace(reEmptyStringMiddle, '$1')
23029 .replace(reEmptyStringTrailing, '$1;');
23030
23031 // Frame code as the function body.
23032 source = 'function(' + (variable || 'obj') + ') {\n' +
23033 (variable
23034 ? ''
23035 : 'obj || (obj = {});\n'
23036 ) +
23037 "var __t, __p = ''" +
23038 (isEscaping
23039 ? ', __e = _.escape'
23040 : ''
23041 ) +
23042 (isEvaluating
23043 ? ', __j = Array.prototype.join;\n' +
23044 "function print() { __p += __j.call(arguments, '') }\n"
23045 : ';\n'
23046 ) +
23047 source +
23048 'return __p\n}';
23049
23050 var result = attempt(function() {
23051 return Function(importsKeys, sourceURL + 'return ' + source)
23052 .apply(undefined, importsValues);
23053 });
23054
23055 // Provide the compiled function's source by its `toString` method or
23056 // the `source` property as a convenience for inlining compiled templates.
23057 result.source = source;
23058 if (isError(result)) {
23059 throw result;
23060 }
23061 return result;
23062 }
23063
23064 /**
23065 * Converts `string`, as a whole, to lower case just like
23066 * [String#toLowerCase](https://mdn.io/toLowerCase).
23067 *
23068 * @static
23069 * @memberOf _
23070 * @since 4.0.0
23071 * @category String
23072 * @param {string} [string=''] The string to convert.
23073 * @returns {string} Returns the lower cased string.
23074 * @example
23075 *
23076 * _.toLower('--Foo-Bar--');
23077 * // => '--foo-bar--'
23078 *
23079 * _.toLower('fooBar');
23080 * // => 'foobar'
23081 *
23082 * _.toLower('__FOO_BAR__');
23083 * // => '__foo_bar__'
23084 */
23085 function toLower(value) {
23086 return toString(value).toLowerCase();
23087 }
23088
23089 /**
23090 * Converts `string`, as a whole, to upper case just like
23091 * [String#toUpperCase](https://mdn.io/toUpperCase).
23092 *
23093 * @static
23094 * @memberOf _
23095 * @since 4.0.0
23096 * @category String
23097 * @param {string} [string=''] The string to convert.
23098 * @returns {string} Returns the upper cased string.
23099 * @example
23100 *
23101 * _.toUpper('--foo-bar--');
23102 * // => '--FOO-BAR--'
23103 *
23104 * _.toUpper('fooBar');
23105 * // => 'FOOBAR'
23106 *
23107 * _.toUpper('__foo_bar__');
23108 * // => '__FOO_BAR__'
23109 */
23110 function toUpper(value) {
23111 return toString(value).toUpperCase();
23112 }
23113
23114 /**
23115 * Removes leading and trailing whitespace or specified characters from `string`.
23116 *
23117 * @static
23118 * @memberOf _
23119 * @since 3.0.0
23120 * @category String
23121 * @param {string} [string=''] The string to trim.
23122 * @param {string} [chars=whitespace] The characters to trim.
23123 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
23124 * @returns {string} Returns the trimmed string.
23125 * @example
23126 *
23127 * _.trim(' abc ');
23128 * // => 'abc'
23129 *
23130 * _.trim('-_-abc-_-', '_-');
23131 * // => 'abc'
23132 *
23133 * _.map([' foo ', ' bar '], _.trim);
23134 * // => ['foo', 'bar']
23135 */
23136 function trim(string, chars, guard) {
23137 string = toString(string);
23138 if (string && (guard || chars === undefined)) {
23139 return string.replace(reTrim, '');
23140 }
23141 if (!string || !(chars = baseToString(chars))) {
23142 return string;
23143 }
23144 var strSymbols = stringToArray(string),
23145 chrSymbols = stringToArray(chars),
23146 start = charsStartIndex(strSymbols, chrSymbols),
23147 end = charsEndIndex(strSymbols, chrSymbols) + 1;
23148
23149 return castSlice(strSymbols, start, end).join('');
23150 }
23151
23152 /**
23153 * Removes trailing whitespace or specified characters from `string`.
23154 *
23155 * @static
23156 * @memberOf _
23157 * @since 4.0.0
23158 * @category String
23159 * @param {string} [string=''] The string to trim.
23160 * @param {string} [chars=whitespace] The characters to trim.
23161 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
23162 * @returns {string} Returns the trimmed string.
23163 * @example
23164 *
23165 * _.trimEnd(' abc ');
23166 * // => ' abc'
23167 *
23168 * _.trimEnd('-_-abc-_-', '_-');
23169 * // => '-_-abc'
23170 */
23171 function trimEnd(string, chars, guard) {
23172 string = toString(string);
23173 if (string && (guard || chars === undefined)) {
23174 return string.replace(reTrimEnd, '');
23175 }
23176 if (!string || !(chars = baseToString(chars))) {
23177 return string;
23178 }
23179 var strSymbols = stringToArray(string),
23180 end = charsEndIndex(strSymbols, stringToArray(chars)) + 1;
23181
23182 return castSlice(strSymbols, 0, end).join('');
23183 }
23184
23185 /**
23186 * Removes leading whitespace or specified characters from `string`.
23187 *
23188 * @static
23189 * @memberOf _
23190 * @since 4.0.0
23191 * @category String
23192 * @param {string} [string=''] The string to trim.
23193 * @param {string} [chars=whitespace] The characters to trim.
23194 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
23195 * @returns {string} Returns the trimmed string.
23196 * @example
23197 *
23198 * _.trimStart(' abc ');
23199 * // => 'abc '
23200 *
23201 * _.trimStart('-_-abc-_-', '_-');
23202 * // => 'abc-_-'
23203 */
23204 function trimStart(string, chars, guard) {
23205 string = toString(string);
23206 if (string && (guard || chars === undefined)) {
23207 return string.replace(reTrimStart, '');
23208 }
23209 if (!string || !(chars = baseToString(chars))) {
23210 return string;
23211 }
23212 var strSymbols = stringToArray(string),
23213 start = charsStartIndex(strSymbols, stringToArray(chars));
23214
23215 return castSlice(strSymbols, start).join('');
23216 }
23217
23218 /**
23219 * Truncates `string` if it's longer than the given maximum string length.
23220 * The last characters of the truncated string are replaced with the omission
23221 * string which defaults to "...".
23222 *
23223 * @static
23224 * @memberOf _
23225 * @since 4.0.0
23226 * @category String
23227 * @param {string} [string=''] The string to truncate.
23228 * @param {Object} [options={}] The options object.
23229 * @param {number} [options.length=30] The maximum string length.
23230 * @param {string} [options.omission='...'] The string to indicate text is omitted.
23231 * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
23232 * @returns {string} Returns the truncated string.
23233 * @example
23234 *
23235 * _.truncate('hi-diddly-ho there, neighborino');
23236 * // => 'hi-diddly-ho there, neighbo...'
23237 *
23238 * _.truncate('hi-diddly-ho there, neighborino', {
23239 * 'length': 24,
23240 * 'separator': ' '
23241 * });
23242 * // => 'hi-diddly-ho there,...'
23243 *
23244 * _.truncate('hi-diddly-ho there, neighborino', {
23245 * 'length': 24,
23246 * 'separator': /,? +/
23247 * });
23248 * // => 'hi-diddly-ho there...'
23249 *
23250 * _.truncate('hi-diddly-ho there, neighborino', {
23251 * 'omission': ' [...]'
23252 * });
23253 * // => 'hi-diddly-ho there, neig [...]'
23254 */
23255 function truncate(string, options) {
23256 var length = DEFAULT_TRUNC_LENGTH,
23257 omission = DEFAULT_TRUNC_OMISSION;
23258
23259 if (isObject(options)) {
23260 var separator = 'separator' in options ? options.separator : separator;
23261 length = 'length' in options ? toInteger(options.length) : length;
23262 omission = 'omission' in options ? baseToString(options.omission) : omission;
23263 }
23264 string = toString(string);
23265
23266 var strLength = string.length;
23267 if (hasUnicode(string)) {
23268 var strSymbols = stringToArray(string);
23269 strLength = strSymbols.length;
23270 }
23271 if (length >= strLength) {
23272 return string;
23273 }
23274 var end = length - stringSize(omission);
23275 if (end < 1) {
23276 return omission;
23277 }
23278 var result = strSymbols
23279 ? castSlice(strSymbols, 0, end).join('')
23280 : string.slice(0, end);
23281
23282 if (separator === undefined) {
23283 return result + omission;
23284 }
23285 if (strSymbols) {
23286 end += (result.length - end);
23287 }
23288 if (isRegExp(separator)) {
23289 if (string.slice(end).search(separator)) {
23290 var match,
23291 substring = result;
23292
23293 if (!separator.global) {
23294 separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g');
23295 }
23296 separator.lastIndex = 0;
23297 while ((match = separator.exec(substring))) {
23298 var newEnd = match.index;
23299 }
23300 result = result.slice(0, newEnd === undefined ? end : newEnd);
23301 }
23302 } else if (string.indexOf(baseToString(separator), end) != end) {
23303 var index = result.lastIndexOf(separator);
23304 if (index > -1) {
23305 result = result.slice(0, index);
23306 }
23307 }
23308 return result + omission;
23309 }
23310
23311 /**
23312 * The inverse of `_.escape`; this method converts the HTML entities
23313 * `&amp;`, `&lt;`, `&gt;`, `&quot;`, and `&#39;` in `string` to
23314 * their corresponding characters.
23315 *
23316 * **Note:** No other HTML entities are unescaped. To unescape additional
23317 * HTML entities use a third-party library like [_he_](https://mths.be/he).
23318 *
23319 * @static
23320 * @memberOf _
23321 * @since 0.6.0
23322 * @category String
23323 * @param {string} [string=''] The string to unescape.
23324 * @returns {string} Returns the unescaped string.
23325 * @example
23326 *
23327 * _.unescape('fred, barney, &amp; pebbles');
23328 * // => 'fred, barney, & pebbles'
23329 */
23330 function unescape(string) {
23331 string = toString(string);
23332 return (string && reHasEscapedHtml.test(string))
23333 ? string.replace(reEscapedHtml, unescapeHtmlChar)
23334 : string;
23335 }
23336
23337 /**
23338 * Converts `string`, as space separated words, to upper case.
23339 *
23340 * @static
23341 * @memberOf _
23342 * @since 4.0.0
23343 * @category String
23344 * @param {string} [string=''] The string to convert.
23345 * @returns {string} Returns the upper cased string.
23346 * @example
23347 *
23348 * _.upperCase('--foo-bar');
23349 * // => 'FOO BAR'
23350 *
23351 * _.upperCase('fooBar');
23352 * // => 'FOO BAR'
23353 *
23354 * _.upperCase('__foo_bar__');
23355 * // => 'FOO BAR'
23356 */
23357 var upperCase = createCompounder(function(result, word, index) {
23358 return result + (index ? ' ' : '') + word.toUpperCase();
23359 });
23360
23361 /**
23362 * Converts the first character of `string` to upper case.
23363 *
23364 * @static
23365 * @memberOf _
23366 * @since 4.0.0
23367 * @category String
23368 * @param {string} [string=''] The string to convert.
23369 * @returns {string} Returns the converted string.
23370 * @example
23371 *
23372 * _.upperFirst('fred');
23373 * // => 'Fred'
23374 *
23375 * _.upperFirst('FRED');
23376 * // => 'FRED'
23377 */
23378 var upperFirst = createCaseFirst('toUpperCase');
23379
23380 /**
23381 * Splits `string` into an array of its words.
23382 *
23383 * @static
23384 * @memberOf _
23385 * @since 3.0.0
23386 * @category String
23387 * @param {string} [string=''] The string to inspect.
23388 * @param {RegExp|string} [pattern] The pattern to match words.
23389 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.
23390 * @returns {Array} Returns the words of `string`.
23391 * @example
23392 *
23393 * _.words('fred, barney, & pebbles');
23394 * // => ['fred', 'barney', 'pebbles']
23395 *
23396 * _.words('fred, barney, & pebbles', /[^, ]+/g);
23397 * // => ['fred', 'barney', '&', 'pebbles']
23398 */
23399 function words(string, pattern, guard) {
23400 string = toString(string);
23401 pattern = guard ? undefined : pattern;
23402
23403 if (pattern === undefined) {
23404 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);
23405 }
23406 return string.match(pattern) || [];
23407 }
23408
23409 /*------------------------------------------------------------------------*/
23410
23411 /**
23412 * Attempts to invoke `func`, returning either the result or the caught error
23413 * object. Any additional arguments are provided to `func` when it's invoked.
23414 *
23415 * @static
23416 * @memberOf _
23417 * @since 3.0.0
23418 * @category Util
23419 * @param {Function} func The function to attempt.
23420 * @param {...*} [args] The arguments to invoke `func` with.
23421 * @returns {*} Returns the `func` result or error object.
23422 * @example
23423 *
23424 * // Avoid throwing errors for invalid selectors.
23425 * var elements = _.attempt(function(selector) {
23426 * return document.querySelectorAll(selector);
23427 * }, '>_>');
23428 *
23429 * if (_.isError(elements)) {
23430 * elements = [];
23431 * }
23432 */
23433 var attempt = baseRest(function(func, args) {
23434 try {
23435 return apply(func, undefined, args);
23436 } catch (e) {
23437 return isError(e) ? e : new Error(e);
23438 }
23439 });
23440
23441 /**
23442 * Binds methods of an object to the object itself, overwriting the existing
23443 * method.
23444 *
23445 * **Note:** This method doesn't set the "length" property of bound functions.
23446 *
23447 * @static
23448 * @since 0.1.0
23449 * @memberOf _
23450 * @category Util
23451 * @param {Object} object The object to bind and assign the bound methods to.
23452 * @param {...(string|string[])} methodNames The object method names to bind.
23453 * @returns {Object} Returns `object`.
23454 * @example
23455 *
23456 * var view = {
23457 * 'label': 'docs',
23458 * 'click': function() {
23459 * console.log('clicked ' + this.label);
23460 * }
23461 * };
23462 *
23463 * _.bindAll(view, ['click']);
23464 * jQuery(element).on('click', view.click);
23465 * // => Logs 'clicked docs' when clicked.
23466 */
23467 var bindAll = flatRest(function(object, methodNames) {
23468 arrayEach(methodNames, function(key) {
23469 key = toKey(key);
23470 baseAssignValue(object, key, bind(object[key], object));
23471 });
23472 return object;
23473 });
23474
23475 /**
23476 * Creates a function that iterates over `pairs` and invokes the corresponding
23477 * function of the first predicate to return truthy. The predicate-function
23478 * pairs are invoked with the `this` binding and arguments of the created
23479 * function.
23480 *
23481 * @static
23482 * @memberOf _
23483 * @since 4.0.0
23484 * @category Util
23485 * @param {Array} pairs The predicate-function pairs.
23486 * @returns {Function} Returns the new composite function.
23487 * @example
23488 *
23489 * var func = _.cond([
23490 * [_.matches({ 'a': 1 }), _.constant('matches A')],
23491 * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')],
23492 * [_.stubTrue, _.constant('no match')]
23493 * ]);
23494 *
23495 * func({ 'a': 1, 'b': 2 });
23496 * // => 'matches A'
23497 *
23498 * func({ 'a': 0, 'b': 1 });
23499 * // => 'matches B'
23500 *
23501 * func({ 'a': '1', 'b': '2' });
23502 * // => 'no match'
23503 */
23504 function cond(pairs) {
23505 var length = pairs == null ? 0 : pairs.length,
23506 toIteratee = getIteratee();
23507
23508 pairs = !length ? [] : arrayMap(pairs, function(pair) {
23509 if (typeof pair[1] != 'function') {
23510 throw new TypeError(FUNC_ERROR_TEXT);
23511 }
23512 return [toIteratee(pair[0]), pair[1]];
23513 });
23514
23515 return baseRest(function(args) {
23516 var index = -1;
23517 while (++index < length) {
23518 var pair = pairs[index];
23519 if (apply(pair[0], this, args)) {
23520 return apply(pair[1], this, args);
23521 }
23522 }
23523 });
23524 }
23525
23526 /**
23527 * Creates a function that invokes the predicate properties of `source` with
23528 * the corresponding property values of a given object, returning `true` if
23529 * all predicates return truthy, else `false`.
23530 *
23531 * **Note:** The created function is equivalent to `_.conformsTo` with
23532 * `source` partially applied.
23533 *
23534 * @static
23535 * @memberOf _
23536 * @since 4.0.0
23537 * @category Util
23538 * @param {Object} source The object of property predicates to conform to.
23539 * @returns {Function} Returns the new spec function.
23540 * @example
23541 *
23542 * var objects = [
23543 * { 'a': 2, 'b': 1 },
23544 * { 'a': 1, 'b': 2 }
23545 * ];
23546 *
23547 * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } }));
23548 * // => [{ 'a': 1, 'b': 2 }]
23549 */
23550 function conforms(source) {
23551 return baseConforms(baseClone(source, CLONE_DEEP_FLAG));
23552 }
23553
23554 /**
23555 * Creates a function that returns `value`.
23556 *
23557 * @static
23558 * @memberOf _
23559 * @since 2.4.0
23560 * @category Util
23561 * @param {*} value The value to return from the new function.
23562 * @returns {Function} Returns the new constant function.
23563 * @example
23564 *
23565 * var objects = _.times(2, _.constant({ 'a': 1 }));
23566 *
23567 * console.log(objects);
23568 * // => [{ 'a': 1 }, { 'a': 1 }]
23569 *
23570 * console.log(objects[0] === objects[1]);
23571 * // => true
23572 */
23573 function constant(value) {
23574 return function() {
23575 return value;
23576 };
23577 }
23578
23579 /**
23580 * Checks `value` to determine whether a default value should be returned in
23581 * its place. The `defaultValue` is returned if `value` is `NaN`, `null`,
23582 * or `undefined`.
23583 *
23584 * @static
23585 * @memberOf _
23586 * @since 4.14.0
23587 * @category Util
23588 * @param {*} value The value to check.
23589 * @param {*} defaultValue The default value.
23590 * @returns {*} Returns the resolved value.
23591 * @example
23592 *
23593 * _.defaultTo(1, 10);
23594 * // => 1
23595 *
23596 * _.defaultTo(undefined, 10);
23597 * // => 10
23598 */
23599 function defaultTo(value, defaultValue) {
23600 return (value == null || value !== value) ? defaultValue : value;
23601 }
23602
23603 /**
23604 * Creates a function that returns the result of invoking the given functions
23605 * with the `this` binding of the created function, where each successive
23606 * invocation is supplied the return value of the previous.
23607 *
23608 * @static
23609 * @memberOf _
23610 * @since 3.0.0
23611 * @category Util
23612 * @param {...(Function|Function[])} [funcs] The functions to invoke.
23613 * @returns {Function} Returns the new composite function.
23614 * @see _.flowRight
23615 * @example
23616 *
23617 * function square(n) {
23618 * return n * n;
23619 * }
23620 *
23621 * var addSquare = _.flow([_.add, square]);
23622 * addSquare(1, 2);
23623 * // => 9
23624 */
23625 var flow = createFlow();
23626
23627 /**
23628 * This method is like `_.flow` except that it creates a function that
23629 * invokes the given functions from right to left.
23630 *
23631 * @static
23632 * @since 3.0.0
23633 * @memberOf _
23634 * @category Util
23635 * @param {...(Function|Function[])} [funcs] The functions to invoke.
23636 * @returns {Function} Returns the new composite function.
23637 * @see _.flow
23638 * @example
23639 *
23640 * function square(n) {
23641 * return n * n;
23642 * }
23643 *
23644 * var addSquare = _.flowRight([square, _.add]);
23645 * addSquare(1, 2);
23646 * // => 9
23647 */
23648 var flowRight = createFlow(true);
23649
23650 /**
23651 * This method returns the first argument it receives.
23652 *
23653 * @static
23654 * @since 0.1.0
23655 * @memberOf _
23656 * @category Util
23657 * @param {*} value Any value.
23658 * @returns {*} Returns `value`.
23659 * @example
23660 *
23661 * var object = { 'a': 1 };
23662 *
23663 * console.log(_.identity(object) === object);
23664 * // => true
23665 */
23666 function identity(value) {
23667 return value;
23668 }
23669
23670 /**
23671 * Creates a function that invokes `func` with the arguments of the created
23672 * function. If `func` is a property name, the created function returns the
23673 * property value for a given element. If `func` is an array or object, the
23674 * created function returns `true` for elements that contain the equivalent
23675 * source properties, otherwise it returns `false`.
23676 *
23677 * @static
23678 * @since 4.0.0
23679 * @memberOf _
23680 * @category Util
23681 * @param {*} [func=_.identity] The value to convert to a callback.
23682 * @returns {Function} Returns the callback.
23683 * @example
23684 *
23685 * var users = [
23686 * { 'user': 'barney', 'age': 36, 'active': true },
23687 * { 'user': 'fred', 'age': 40, 'active': false }
23688 * ];
23689 *
23690 * // The `_.matches` iteratee shorthand.
23691 * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true }));
23692 * // => [{ 'user': 'barney', 'age': 36, 'active': true }]
23693 *
23694 * // The `_.matchesProperty` iteratee shorthand.
23695 * _.filter(users, _.iteratee(['user', 'fred']));
23696 * // => [{ 'user': 'fred', 'age': 40 }]
23697 *
23698 * // The `_.property` iteratee shorthand.
23699 * _.map(users, _.iteratee('user'));
23700 * // => ['barney', 'fred']
23701 *
23702 * // Create custom iteratee shorthands.
23703 * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) {
23704 * return !_.isRegExp(func) ? iteratee(func) : function(string) {
23705 * return func.test(string);
23706 * };
23707 * });
23708 *
23709 * _.filter(['abc', 'def'], /ef/);
23710 * // => ['def']
23711 */
23712 function iteratee(func) {
23713 return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG));
23714 }
23715
23716 /**
23717 * Creates a function that performs a partial deep comparison between a given
23718 * object and `source`, returning `true` if the given object has equivalent
23719 * property values, else `false`.
23720 *
23721 * **Note:** The created function is equivalent to `_.isMatch` with `source`
23722 * partially applied.
23723 *
23724 * Partial comparisons will match empty array and empty object `source`
23725 * values against any array or object value, respectively. See `_.isEqual`
23726 * for a list of supported value comparisons.
23727 *
23728 * @static
23729 * @memberOf _
23730 * @since 3.0.0
23731 * @category Util
23732 * @param {Object} source The object of property values to match.
23733 * @returns {Function} Returns the new spec function.
23734 * @example
23735 *
23736 * var objects = [
23737 * { 'a': 1, 'b': 2, 'c': 3 },
23738 * { 'a': 4, 'b': 5, 'c': 6 }
23739 * ];
23740 *
23741 * _.filter(objects, _.matches({ 'a': 4, 'c': 6 }));
23742 * // => [{ 'a': 4, 'b': 5, 'c': 6 }]
23743 */
23744 function matches(source) {
23745 return baseMatches(baseClone(source, CLONE_DEEP_FLAG));
23746 }
23747
23748 /**
23749 * Creates a function that performs a partial deep comparison between the
23750 * value at `path` of a given object to `srcValue`, returning `true` if the
23751 * object value is equivalent, else `false`.
23752 *
23753 * **Note:** Partial comparisons will match empty array and empty object
23754 * `srcValue` values against any array or object value, respectively. See
23755 * `_.isEqual` for a list of supported value comparisons.
23756 *
23757 * @static
23758 * @memberOf _
23759 * @since 3.2.0
23760 * @category Util
23761 * @param {Array|string} path The path of the property to get.
23762 * @param {*} srcValue The value to match.
23763 * @returns {Function} Returns the new spec function.
23764 * @example
23765 *
23766 * var objects = [
23767 * { 'a': 1, 'b': 2, 'c': 3 },
23768 * { 'a': 4, 'b': 5, 'c': 6 }
23769 * ];
23770 *
23771 * _.find(objects, _.matchesProperty('a', 4));
23772 * // => { 'a': 4, 'b': 5, 'c': 6 }
23773 */
23774 function matchesProperty(path, srcValue) {
23775 return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG));
23776 }
23777
23778 /**
23779 * Creates a function that invokes the method at `path` of a given object.
23780 * Any additional arguments are provided to the invoked method.
23781 *
23782 * @static
23783 * @memberOf _
23784 * @since 3.7.0
23785 * @category Util
23786 * @param {Array|string} path The path of the method to invoke.
23787 * @param {...*} [args] The arguments to invoke the method with.
23788 * @returns {Function} Returns the new invoker function.
23789 * @example
23790 *
23791 * var objects = [
23792 * { 'a': { 'b': _.constant(2) } },
23793 * { 'a': { 'b': _.constant(1) } }
23794 * ];
23795 *
23796 * _.map(objects, _.method('a.b'));
23797 * // => [2, 1]
23798 *
23799 * _.map(objects, _.method(['a', 'b']));
23800 * // => [2, 1]
23801 */
23802 var method = baseRest(function(path, args) {
23803 return function(object) {
23804 return baseInvoke(object, path, args);
23805 };
23806 });
23807
23808 /**
23809 * The opposite of `_.method`; this method creates a function that invokes
23810 * the method at a given path of `object`. Any additional arguments are
23811 * provided to the invoked method.
23812 *
23813 * @static
23814 * @memberOf _
23815 * @since 3.7.0
23816 * @category Util
23817 * @param {Object} object The object to query.
23818 * @param {...*} [args] The arguments to invoke the method with.
23819 * @returns {Function} Returns the new invoker function.
23820 * @example
23821 *
23822 * var array = _.times(3, _.constant),
23823 * object = { 'a': array, 'b': array, 'c': array };
23824 *
23825 * _.map(['a[2]', 'c[0]'], _.methodOf(object));
23826 * // => [2, 0]
23827 *
23828 * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
23829 * // => [2, 0]
23830 */
23831 var methodOf = baseRest(function(object, args) {
23832 return function(path) {
23833 return baseInvoke(object, path, args);
23834 };
23835 });
23836
23837 /**
23838 * Adds all own enumerable string keyed function properties of a source
23839 * object to the destination object. If `object` is a function, then methods
23840 * are added to its prototype as well.
23841 *
23842 * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
23843 * avoid conflicts caused by modifying the original.
23844 *
23845 * @static
23846 * @since 0.1.0
23847 * @memberOf _
23848 * @category Util
23849 * @param {Function|Object} [object=lodash] The destination object.
23850 * @param {Object} source The object of functions to add.
23851 * @param {Object} [options={}] The options object.
23852 * @param {boolean} [options.chain=true] Specify whether mixins are chainable.
23853 * @returns {Function|Object} Returns `object`.
23854 * @example
23855 *
23856 * function vowels(string) {
23857 * return _.filter(string, function(v) {
23858 * return /[aeiou]/i.test(v);
23859 * });
23860 * }
23861 *
23862 * _.mixin({ 'vowels': vowels });
23863 * _.vowels('fred');
23864 * // => ['e']
23865 *
23866 * _('fred').vowels().value();
23867 * // => ['e']
23868 *
23869 * _.mixin({ 'vowels': vowels }, { 'chain': false });
23870 * _('fred').vowels();
23871 * // => ['e']
23872 */
23873 function mixin(object, source, options) {
23874 var props = keys(source),
23875 methodNames = baseFunctions(source, props);
23876
23877 if (options == null &&
23878 !(isObject(source) && (methodNames.length || !props.length))) {
23879 options = source;
23880 source = object;
23881 object = this;
23882 methodNames = baseFunctions(source, keys(source));
23883 }
23884 var chain = !(isObject(options) && 'chain' in options) || !!options.chain,
23885 isFunc = isFunction(object);
23886
23887 arrayEach(methodNames, function(methodName) {
23888 var func = source[methodName];
23889 object[methodName] = func;
23890 if (isFunc) {
23891 object.prototype[methodName] = function() {
23892 var chainAll = this.__chain__;
23893 if (chain || chainAll) {
23894 var result = object(this.__wrapped__),
23895 actions = result.__actions__ = copyArray(this.__actions__);
23896
23897 actions.push({ 'func': func, 'args': arguments, 'thisArg': object });
23898 result.__chain__ = chainAll;
23899 return result;
23900 }
23901 return func.apply(object, arrayPush([this.value()], arguments));
23902 };
23903 }
23904 });
23905
23906 return object;
23907 }
23908
23909 /**
23910 * Reverts the `_` variable to its previous value and returns a reference to
23911 * the `lodash` function.
23912 *
23913 * @static
23914 * @since 0.1.0
23915 * @memberOf _
23916 * @category Util
23917 * @returns {Function} Returns the `lodash` function.
23918 * @example
23919 *
23920 * var lodash = _.noConflict();
23921 */
23922 function noConflict() {
23923 if (root._ === this) {
23924 root._ = oldDash;
23925 }
23926 return this;
23927 }
23928
23929 /**
23930 * This method returns `undefined`.
23931 *
23932 * @static
23933 * @memberOf _
23934 * @since 2.3.0
23935 * @category Util
23936 * @example
23937 *
23938 * _.times(2, _.noop);
23939 * // => [undefined, undefined]
23940 */
23941 function noop() {
23942 // No operation performed.
23943 }
23944
23945 /**
23946 * Creates a function that gets the argument at index `n`. If `n` is negative,
23947 * the nth argument from the end is returned.
23948 *
23949 * @static
23950 * @memberOf _
23951 * @since 4.0.0
23952 * @category Util
23953 * @param {number} [n=0] The index of the argument to return.
23954 * @returns {Function} Returns the new pass-thru function.
23955 * @example
23956 *
23957 * var func = _.nthArg(1);
23958 * func('a', 'b', 'c', 'd');
23959 * // => 'b'
23960 *
23961 * var func = _.nthArg(-2);
23962 * func('a', 'b', 'c', 'd');
23963 * // => 'c'
23964 */
23965 function nthArg(n) {
23966 n = toInteger(n);
23967 return baseRest(function(args) {
23968 return baseNth(args, n);
23969 });
23970 }
23971
23972 /**
23973 * Creates a function that invokes `iteratees` with the arguments it receives
23974 * and returns their results.
23975 *
23976 * @static
23977 * @memberOf _
23978 * @since 4.0.0
23979 * @category Util
23980 * @param {...(Function|Function[])} [iteratees=[_.identity]]
23981 * The iteratees to invoke.
23982 * @returns {Function} Returns the new function.
23983 * @example
23984 *
23985 * var func = _.over([Math.max, Math.min]);
23986 *
23987 * func(1, 2, 3, 4);
23988 * // => [4, 1]
23989 */
23990 var over = createOver(arrayMap);
23991
23992 /**
23993 * Creates a function that checks if **all** of the `predicates` return
23994 * truthy when invoked with the arguments it receives.
23995 *
23996 * @static
23997 * @memberOf _
23998 * @since 4.0.0
23999 * @category Util
24000 * @param {...(Function|Function[])} [predicates=[_.identity]]
24001 * The predicates to check.
24002 * @returns {Function} Returns the new function.
24003 * @example
24004 *
24005 * var func = _.overEvery([Boolean, isFinite]);
24006 *
24007 * func('1');
24008 * // => true
24009 *
24010 * func(null);
24011 * // => false
24012 *
24013 * func(NaN);
24014 * // => false
24015 */
24016 var overEvery = createOver(arrayEvery);
24017
24018 /**
24019 * Creates a function that checks if **any** of the `predicates` return
24020 * truthy when invoked with the arguments it receives.
24021 *
24022 * @static
24023 * @memberOf _
24024 * @since 4.0.0
24025 * @category Util
24026 * @param {...(Function|Function[])} [predicates=[_.identity]]
24027 * The predicates to check.
24028 * @returns {Function} Returns the new function.
24029 * @example
24030 *
24031 * var func = _.overSome([Boolean, isFinite]);
24032 *
24033 * func('1');
24034 * // => true
24035 *
24036 * func(null);
24037 * // => true
24038 *
24039 * func(NaN);
24040 * // => false
24041 */
24042 var overSome = createOver(arraySome);
24043
24044 /**
24045 * Creates a function that returns the value at `path` of a given object.
24046 *
24047 * @static
24048 * @memberOf _
24049 * @since 2.4.0
24050 * @category Util
24051 * @param {Array|string} path The path of the property to get.
24052 * @returns {Function} Returns the new accessor function.
24053 * @example
24054 *
24055 * var objects = [
24056 * { 'a': { 'b': 2 } },
24057 * { 'a': { 'b': 1 } }
24058 * ];
24059 *
24060 * _.map(objects, _.property('a.b'));
24061 * // => [2, 1]
24062 *
24063 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
24064 * // => [1, 2]
24065 */
24066 function property(path) {
24067 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
24068 }
24069
24070 /**
24071 * The opposite of `_.property`; this method creates a function that returns
24072 * the value at a given path of `object`.
24073 *
24074 * @static
24075 * @memberOf _
24076 * @since 3.0.0
24077 * @category Util
24078 * @param {Object} object The object to query.
24079 * @returns {Function} Returns the new accessor function.
24080 * @example
24081 *
24082 * var array = [0, 1, 2],
24083 * object = { 'a': array, 'b': array, 'c': array };
24084 *
24085 * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
24086 * // => [2, 0]
24087 *
24088 * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
24089 * // => [2, 0]
24090 */
24091 function propertyOf(object) {
24092 return function(path) {
24093 return object == null ? undefined : baseGet(object, path);
24094 };
24095 }
24096
24097 /**
24098 * Creates an array of numbers (positive and/or negative) progressing from
24099 * `start` up to, but not including, `end`. A step of `-1` is used if a negative
24100 * `start` is specified without an `end` or `step`. If `end` is not specified,
24101 * it's set to `start` with `start` then set to `0`.
24102 *
24103 * **Note:** JavaScript follows the IEEE-754 standard for resolving
24104 * floating-point values which can produce unexpected results.
24105 *
24106 * @static
24107 * @since 0.1.0
24108 * @memberOf _
24109 * @category Util
24110 * @param {number} [start=0] The start of the range.
24111 * @param {number} end The end of the range.
24112 * @param {number} [step=1] The value to increment or decrement by.
24113 * @returns {Array} Returns the range of numbers.
24114 * @see _.inRange, _.rangeRight
24115 * @example
24116 *
24117 * _.range(4);
24118 * // => [0, 1, 2, 3]
24119 *
24120 * _.range(-4);
24121 * // => [0, -1, -2, -3]
24122 *
24123 * _.range(1, 5);
24124 * // => [1, 2, 3, 4]
24125 *
24126 * _.range(0, 20, 5);
24127 * // => [0, 5, 10, 15]
24128 *
24129 * _.range(0, -4, -1);
24130 * // => [0, -1, -2, -3]
24131 *
24132 * _.range(1, 4, 0);
24133 * // => [1, 1, 1]
24134 *
24135 * _.range(0);
24136 * // => []
24137 */
24138 var range = createRange();
24139
24140 /**
24141 * This method is like `_.range` except that it populates values in
24142 * descending order.
24143 *
24144 * @static
24145 * @memberOf _
24146 * @since 4.0.0
24147 * @category Util
24148 * @param {number} [start=0] The start of the range.
24149 * @param {number} end The end of the range.
24150 * @param {number} [step=1] The value to increment or decrement by.
24151 * @returns {Array} Returns the range of numbers.
24152 * @see _.inRange, _.range
24153 * @example
24154 *
24155 * _.rangeRight(4);
24156 * // => [3, 2, 1, 0]
24157 *
24158 * _.rangeRight(-4);
24159 * // => [-3, -2, -1, 0]
24160 *
24161 * _.rangeRight(1, 5);
24162 * // => [4, 3, 2, 1]
24163 *
24164 * _.rangeRight(0, 20, 5);
24165 * // => [15, 10, 5, 0]
24166 *
24167 * _.rangeRight(0, -4, -1);
24168 * // => [-3, -2, -1, 0]
24169 *
24170 * _.rangeRight(1, 4, 0);
24171 * // => [1, 1, 1]
24172 *
24173 * _.rangeRight(0);
24174 * // => []
24175 */
24176 var rangeRight = createRange(true);
24177
24178 /**
24179 * This method returns a new empty array.
24180 *
24181 * @static
24182 * @memberOf _
24183 * @since 4.13.0
24184 * @category Util
24185 * @returns {Array} Returns the new empty array.
24186 * @example
24187 *
24188 * var arrays = _.times(2, _.stubArray);
24189 *
24190 * console.log(arrays);
24191 * // => [[], []]
24192 *
24193 * console.log(arrays[0] === arrays[1]);
24194 * // => false
24195 */
24196 function stubArray() {
24197 return [];
24198 }
24199
24200 /**
24201 * This method returns `false`.
24202 *
24203 * @static
24204 * @memberOf _
24205 * @since 4.13.0
24206 * @category Util
24207 * @returns {boolean} Returns `false`.
24208 * @example
24209 *
24210 * _.times(2, _.stubFalse);
24211 * // => [false, false]
24212 */
24213 function stubFalse() {
24214 return false;
24215 }
24216
24217 /**
24218 * This method returns a new empty object.
24219 *
24220 * @static
24221 * @memberOf _
24222 * @since 4.13.0
24223 * @category Util
24224 * @returns {Object} Returns the new empty object.
24225 * @example
24226 *
24227 * var objects = _.times(2, _.stubObject);
24228 *
24229 * console.log(objects);
24230 * // => [{}, {}]
24231 *
24232 * console.log(objects[0] === objects[1]);
24233 * // => false
24234 */
24235 function stubObject() {
24236 return {};
24237 }
24238
24239 /**
24240 * This method returns an empty string.
24241 *
24242 * @static
24243 * @memberOf _
24244 * @since 4.13.0
24245 * @category Util
24246 * @returns {string} Returns the empty string.
24247 * @example
24248 *
24249 * _.times(2, _.stubString);
24250 * // => ['', '']
24251 */
24252 function stubString() {
24253 return '';
24254 }
24255
24256 /**
24257 * This method returns `true`.
24258 *
24259 * @static
24260 * @memberOf _
24261 * @since 4.13.0
24262 * @category Util
24263 * @returns {boolean} Returns `true`.
24264 * @example
24265 *
24266 * _.times(2, _.stubTrue);
24267 * // => [true, true]
24268 */
24269 function stubTrue() {
24270 return true;
24271 }
24272
24273 /**
24274 * Invokes the iteratee `n` times, returning an array of the results of
24275 * each invocation. The iteratee is invoked with one argument; (index).
24276 *
24277 * @static
24278 * @since 0.1.0
24279 * @memberOf _
24280 * @category Util
24281 * @param {number} n The number of times to invoke `iteratee`.
24282 * @param {Function} [iteratee=_.identity] The function invoked per iteration.
24283 * @returns {Array} Returns the array of results.
24284 * @example
24285 *
24286 * _.times(3, String);
24287 * // => ['0', '1', '2']
24288 *
24289 * _.times(4, _.constant(0));
24290 * // => [0, 0, 0, 0]
24291 */
24292 function times(n, iteratee) {
24293 n = toInteger(n);
24294 if (n < 1 || n > MAX_SAFE_INTEGER) {
24295 return [];
24296 }
24297 var index = MAX_ARRAY_LENGTH,
24298 length = nativeMin(n, MAX_ARRAY_LENGTH);
24299
24300 iteratee = getIteratee(iteratee);
24301 n -= MAX_ARRAY_LENGTH;
24302
24303 var result = baseTimes(length, iteratee);
24304 while (++index < n) {
24305 iteratee(index);
24306 }
24307 return result;
24308 }
24309
24310 /**
24311 * Converts `value` to a property path array.
24312 *
24313 * @static
24314 * @memberOf _
24315 * @since 4.0.0
24316 * @category Util
24317 * @param {*} value The value to convert.
24318 * @returns {Array} Returns the new property path array.
24319 * @example
24320 *
24321 * _.toPath('a.b.c');
24322 * // => ['a', 'b', 'c']
24323 *
24324 * _.toPath('a[0].b.c');
24325 * // => ['a', '0', 'b', 'c']
24326 */
24327 function toPath(value) {
24328 if (isArray(value)) {
24329 return arrayMap(value, toKey);
24330 }
24331 return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value)));
24332 }
24333
24334 /**
24335 * Generates a unique ID. If `prefix` is given, the ID is appended to it.
24336 *
24337 * @static
24338 * @since 0.1.0
24339 * @memberOf _
24340 * @category Util
24341 * @param {string} [prefix=''] The value to prefix the ID with.
24342 * @returns {string} Returns the unique ID.
24343 * @example
24344 *
24345 * _.uniqueId('contact_');
24346 * // => 'contact_104'
24347 *
24348 * _.uniqueId();
24349 * // => '105'
24350 */
24351 function uniqueId(prefix) {
24352 var id = ++idCounter;
24353 return toString(prefix) + id;
24354 }
24355
24356 /*------------------------------------------------------------------------*/
24357
24358 /**
24359 * Adds two numbers.
24360 *
24361 * @static
24362 * @memberOf _
24363 * @since 3.4.0
24364 * @category Math
24365 * @param {number} augend The first number in an addition.
24366 * @param {number} addend The second number in an addition.
24367 * @returns {number} Returns the total.
24368 * @example
24369 *
24370 * _.add(6, 4);
24371 * // => 10
24372 */
24373 var add = createMathOperation(function(augend, addend) {
24374 return augend + addend;
24375 }, 0);
24376
24377 /**
24378 * Computes `number` rounded up to `precision`.
24379 *
24380 * @static
24381 * @memberOf _
24382 * @since 3.10.0
24383 * @category Math
24384 * @param {number} number The number to round up.
24385 * @param {number} [precision=0] The precision to round up to.
24386 * @returns {number} Returns the rounded up number.
24387 * @example
24388 *
24389 * _.ceil(4.006);
24390 * // => 5
24391 *
24392 * _.ceil(6.004, 2);
24393 * // => 6.01
24394 *
24395 * _.ceil(6040, -2);
24396 * // => 6100
24397 */
24398 var ceil = createRound('ceil');
24399
24400 /**
24401 * Divide two numbers.
24402 *
24403 * @static
24404 * @memberOf _
24405 * @since 4.7.0
24406 * @category Math
24407 * @param {number} dividend The first number in a division.
24408 * @param {number} divisor The second number in a division.
24409 * @returns {number} Returns the quotient.
24410 * @example
24411 *
24412 * _.divide(6, 4);
24413 * // => 1.5
24414 */
24415 var divide = createMathOperation(function(dividend, divisor) {
24416 return dividend / divisor;
24417 }, 1);
24418
24419 /**
24420 * Computes `number` rounded down to `precision`.
24421 *
24422 * @static
24423 * @memberOf _
24424 * @since 3.10.0
24425 * @category Math
24426 * @param {number} number The number to round down.
24427 * @param {number} [precision=0] The precision to round down to.
24428 * @returns {number} Returns the rounded down number.
24429 * @example
24430 *
24431 * _.floor(4.006);
24432 * // => 4
24433 *
24434 * _.floor(0.046, 2);
24435 * // => 0.04
24436 *
24437 * _.floor(4060, -2);
24438 * // => 4000
24439 */
24440 var floor = createRound('floor');
24441
24442 /**
24443 * Computes the maximum value of `array`. If `array` is empty or falsey,
24444 * `undefined` is returned.
24445 *
24446 * @static
24447 * @since 0.1.0
24448 * @memberOf _
24449 * @category Math
24450 * @param {Array} array The array to iterate over.
24451 * @returns {*} Returns the maximum value.
24452 * @example
24453 *
24454 * _.max([4, 2, 8, 6]);
24455 * // => 8
24456 *
24457 * _.max([]);
24458 * // => undefined
24459 */
24460 function max(array) {
24461 return (array && array.length)
24462 ? baseExtremum(array, identity, baseGt)
24463 : undefined;
24464 }
24465
24466 /**
24467 * This method is like `_.max` except that it accepts `iteratee` which is
24468 * invoked for each element in `array` to generate the criterion by which
24469 * the value is ranked. The iteratee is invoked with one argument: (value).
24470 *
24471 * @static
24472 * @memberOf _
24473 * @since 4.0.0
24474 * @category Math
24475 * @param {Array} array The array to iterate over.
24476 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
24477 * @returns {*} Returns the maximum value.
24478 * @example
24479 *
24480 * var objects = [{ 'n': 1 }, { 'n': 2 }];
24481 *
24482 * _.maxBy(objects, function(o) { return o.n; });
24483 * // => { 'n': 2 }
24484 *
24485 * // The `_.property` iteratee shorthand.
24486 * _.maxBy(objects, 'n');
24487 * // => { 'n': 2 }
24488 */
24489 function maxBy(array, iteratee) {
24490 return (array && array.length)
24491 ? baseExtremum(array, getIteratee(iteratee, 2), baseGt)
24492 : undefined;
24493 }
24494
24495 /**
24496 * Computes the mean of the values in `array`.
24497 *
24498 * @static
24499 * @memberOf _
24500 * @since 4.0.0
24501 * @category Math
24502 * @param {Array} array The array to iterate over.
24503 * @returns {number} Returns the mean.
24504 * @example
24505 *
24506 * _.mean([4, 2, 8, 6]);
24507 * // => 5
24508 */
24509 function mean(array) {
24510 return baseMean(array, identity);
24511 }
24512
24513 /**
24514 * This method is like `_.mean` except that it accepts `iteratee` which is
24515 * invoked for each element in `array` to generate the value to be averaged.
24516 * The iteratee is invoked with one argument: (value).
24517 *
24518 * @static
24519 * @memberOf _
24520 * @since 4.7.0
24521 * @category Math
24522 * @param {Array} array The array to iterate over.
24523 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
24524 * @returns {number} Returns the mean.
24525 * @example
24526 *
24527 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
24528 *
24529 * _.meanBy(objects, function(o) { return o.n; });
24530 * // => 5
24531 *
24532 * // The `_.property` iteratee shorthand.
24533 * _.meanBy(objects, 'n');
24534 * // => 5
24535 */
24536 function meanBy(array, iteratee) {
24537 return baseMean(array, getIteratee(iteratee, 2));
24538 }
24539
24540 /**
24541 * Computes the minimum value of `array`. If `array` is empty or falsey,
24542 * `undefined` is returned.
24543 *
24544 * @static
24545 * @since 0.1.0
24546 * @memberOf _
24547 * @category Math
24548 * @param {Array} array The array to iterate over.
24549 * @returns {*} Returns the minimum value.
24550 * @example
24551 *
24552 * _.min([4, 2, 8, 6]);
24553 * // => 2
24554 *
24555 * _.min([]);
24556 * // => undefined
24557 */
24558 function min(array) {
24559 return (array && array.length)
24560 ? baseExtremum(array, identity, baseLt)
24561 : undefined;
24562 }
24563
24564 /**
24565 * This method is like `_.min` except that it accepts `iteratee` which is
24566 * invoked for each element in `array` to generate the criterion by which
24567 * the value is ranked. The iteratee is invoked with one argument: (value).
24568 *
24569 * @static
24570 * @memberOf _
24571 * @since 4.0.0
24572 * @category Math
24573 * @param {Array} array The array to iterate over.
24574 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
24575 * @returns {*} Returns the minimum value.
24576 * @example
24577 *
24578 * var objects = [{ 'n': 1 }, { 'n': 2 }];
24579 *
24580 * _.minBy(objects, function(o) { return o.n; });
24581 * // => { 'n': 1 }
24582 *
24583 * // The `_.property` iteratee shorthand.
24584 * _.minBy(objects, 'n');
24585 * // => { 'n': 1 }
24586 */
24587 function minBy(array, iteratee) {
24588 return (array && array.length)
24589 ? baseExtremum(array, getIteratee(iteratee, 2), baseLt)
24590 : undefined;
24591 }
24592
24593 /**
24594 * Multiply two numbers.
24595 *
24596 * @static
24597 * @memberOf _
24598 * @since 4.7.0
24599 * @category Math
24600 * @param {number} multiplier The first number in a multiplication.
24601 * @param {number} multiplicand The second number in a multiplication.
24602 * @returns {number} Returns the product.
24603 * @example
24604 *
24605 * _.multiply(6, 4);
24606 * // => 24
24607 */
24608 var multiply = createMathOperation(function(multiplier, multiplicand) {
24609 return multiplier * multiplicand;
24610 }, 1);
24611
24612 /**
24613 * Computes `number` rounded to `precision`.
24614 *
24615 * @static
24616 * @memberOf _
24617 * @since 3.10.0
24618 * @category Math
24619 * @param {number} number The number to round.
24620 * @param {number} [precision=0] The precision to round to.
24621 * @returns {number} Returns the rounded number.
24622 * @example
24623 *
24624 * _.round(4.006);
24625 * // => 4
24626 *
24627 * _.round(4.006, 2);
24628 * // => 4.01
24629 *
24630 * _.round(4060, -2);
24631 * // => 4100
24632 */
24633 var round = createRound('round');
24634
24635 /**
24636 * Subtract two numbers.
24637 *
24638 * @static
24639 * @memberOf _
24640 * @since 4.0.0
24641 * @category Math
24642 * @param {number} minuend The first number in a subtraction.
24643 * @param {number} subtrahend The second number in a subtraction.
24644 * @returns {number} Returns the difference.
24645 * @example
24646 *
24647 * _.subtract(6, 4);
24648 * // => 2
24649 */
24650 var subtract = createMathOperation(function(minuend, subtrahend) {
24651 return minuend - subtrahend;
24652 }, 0);
24653
24654 /**
24655 * Computes the sum of the values in `array`.
24656 *
24657 * @static
24658 * @memberOf _
24659 * @since 3.4.0
24660 * @category Math
24661 * @param {Array} array The array to iterate over.
24662 * @returns {number} Returns the sum.
24663 * @example
24664 *
24665 * _.sum([4, 2, 8, 6]);
24666 * // => 20
24667 */
24668 function sum(array) {
24669 return (array && array.length)
24670 ? baseSum(array, identity)
24671 : 0;
24672 }
24673
24674 /**
24675 * This method is like `_.sum` except that it accepts `iteratee` which is
24676 * invoked for each element in `array` to generate the value to be summed.
24677 * The iteratee is invoked with one argument: (value).
24678 *
24679 * @static
24680 * @memberOf _
24681 * @since 4.0.0
24682 * @category Math
24683 * @param {Array} array The array to iterate over.
24684 * @param {Function} [iteratee=_.identity] The iteratee invoked per element.
24685 * @returns {number} Returns the sum.
24686 * @example
24687 *
24688 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }];
24689 *
24690 * _.sumBy(objects, function(o) { return o.n; });
24691 * // => 20
24692 *
24693 * // The `_.property` iteratee shorthand.
24694 * _.sumBy(objects, 'n');
24695 * // => 20
24696 */
24697 function sumBy(array, iteratee) {
24698 return (array && array.length)
24699 ? baseSum(array, getIteratee(iteratee, 2))
24700 : 0;
24701 }
24702
24703 /*------------------------------------------------------------------------*/
24704
24705 // Add methods that return wrapped values in chain sequences.
24706 lodash.after = after;
24707 lodash.ary = ary;
24708 lodash.assign = assign;
24709 lodash.assignIn = assignIn;
24710 lodash.assignInWith = assignInWith;
24711 lodash.assignWith = assignWith;
24712 lodash.at = at;
24713 lodash.before = before;
24714 lodash.bind = bind;
24715 lodash.bindAll = bindAll;
24716 lodash.bindKey = bindKey;
24717 lodash.castArray = castArray;
24718 lodash.chain = chain;
24719 lodash.chunk = chunk;
24720 lodash.compact = compact;
24721 lodash.concat = concat;
24722 lodash.cond = cond;
24723 lodash.conforms = conforms;
24724 lodash.constant = constant;
24725 lodash.countBy = countBy;
24726 lodash.create = create;
24727 lodash.curry = curry;
24728 lodash.curryRight = curryRight;
24729 lodash.debounce = debounce;
24730 lodash.defaults = defaults;
24731 lodash.defaultsDeep = defaultsDeep;
24732 lodash.defer = defer;
24733 lodash.delay = delay;
24734 lodash.difference = difference;
24735 lodash.differenceBy = differenceBy;
24736 lodash.differenceWith = differenceWith;
24737 lodash.drop = drop;
24738 lodash.dropRight = dropRight;
24739 lodash.dropRightWhile = dropRightWhile;
24740 lodash.dropWhile = dropWhile;
24741 lodash.fill = fill;
24742 lodash.filter = filter;
24743 lodash.flatMap = flatMap;
24744 lodash.flatMapDeep = flatMapDeep;
24745 lodash.flatMapDepth = flatMapDepth;
24746 lodash.flatten = flatten;
24747 lodash.flattenDeep = flattenDeep;
24748 lodash.flattenDepth = flattenDepth;
24749 lodash.flip = flip;
24750 lodash.flow = flow;
24751 lodash.flowRight = flowRight;
24752 lodash.fromPairs = fromPairs;
24753 lodash.functions = functions;
24754 lodash.functionsIn = functionsIn;
24755 lodash.groupBy = groupBy;
24756 lodash.initial = initial;
24757 lodash.intersection = intersection;
24758 lodash.intersectionBy = intersectionBy;
24759 lodash.intersectionWith = intersectionWith;
24760 lodash.invert = invert;
24761 lodash.invertBy = invertBy;
24762 lodash.invokeMap = invokeMap;
24763 lodash.iteratee = iteratee;
24764 lodash.keyBy = keyBy;
24765 lodash.keys = keys;
24766 lodash.keysIn = keysIn;
24767 lodash.map = map;
24768 lodash.mapKeys = mapKeys;
24769 lodash.mapValues = mapValues;
24770 lodash.matches = matches;
24771 lodash.matchesProperty = matchesProperty;
24772 lodash.memoize = memoize;
24773 lodash.merge = merge;
24774 lodash.mergeWith = mergeWith;
24775 lodash.method = method;
24776 lodash.methodOf = methodOf;
24777 lodash.mixin = mixin;
24778 lodash.negate = negate;
24779 lodash.nthArg = nthArg;
24780 lodash.omit = omit;
24781 lodash.omitBy = omitBy;
24782 lodash.once = once;
24783 lodash.orderBy = orderBy;
24784 lodash.over = over;
24785 lodash.overArgs = overArgs;
24786 lodash.overEvery = overEvery;
24787 lodash.overSome = overSome;
24788 lodash.partial = partial;
24789 lodash.partialRight = partialRight;
24790 lodash.partition = partition;
24791 lodash.pick = pick;
24792 lodash.pickBy = pickBy;
24793 lodash.property = property;
24794 lodash.propertyOf = propertyOf;
24795 lodash.pull = pull;
24796 lodash.pullAll = pullAll;
24797 lodash.pullAllBy = pullAllBy;
24798 lodash.pullAllWith = pullAllWith;
24799 lodash.pullAt = pullAt;
24800 lodash.range = range;
24801 lodash.rangeRight = rangeRight;
24802 lodash.rearg = rearg;
24803 lodash.reject = reject;
24804 lodash.remove = remove;
24805 lodash.rest = rest;
24806 lodash.reverse = reverse;
24807 lodash.sampleSize = sampleSize;
24808 lodash.set = set;
24809 lodash.setWith = setWith;
24810 lodash.shuffle = shuffle;
24811 lodash.slice = slice;
24812 lodash.sortBy = sortBy;
24813 lodash.sortedUniq = sortedUniq;
24814 lodash.sortedUniqBy = sortedUniqBy;
24815 lodash.split = split;
24816 lodash.spread = spread;
24817 lodash.tail = tail;
24818 lodash.take = take;
24819 lodash.takeRight = takeRight;
24820 lodash.takeRightWhile = takeRightWhile;
24821 lodash.takeWhile = takeWhile;
24822 lodash.tap = tap;
24823 lodash.throttle = throttle;
24824 lodash.thru = thru;
24825 lodash.toArray = toArray;
24826 lodash.toPairs = toPairs;
24827 lodash.toPairsIn = toPairsIn;
24828 lodash.toPath = toPath;
24829 lodash.toPlainObject = toPlainObject;
24830 lodash.transform = transform;
24831 lodash.unary = unary;
24832 lodash.union = union;
24833 lodash.unionBy = unionBy;
24834 lodash.unionWith = unionWith;
24835 lodash.uniq = uniq;
24836 lodash.uniqBy = uniqBy;
24837 lodash.uniqWith = uniqWith;
24838 lodash.unset = unset;
24839 lodash.unzip = unzip;
24840 lodash.unzipWith = unzipWith;
24841 lodash.update = update;
24842 lodash.updateWith = updateWith;
24843 lodash.values = values;
24844 lodash.valuesIn = valuesIn;
24845 lodash.without = without;
24846 lodash.words = words;
24847 lodash.wrap = wrap;
24848 lodash.xor = xor;
24849 lodash.xorBy = xorBy;
24850 lodash.xorWith = xorWith;
24851 lodash.zip = zip;
24852 lodash.zipObject = zipObject;
24853 lodash.zipObjectDeep = zipObjectDeep;
24854 lodash.zipWith = zipWith;
24855
24856 // Add aliases.
24857 lodash.entries = toPairs;
24858 lodash.entriesIn = toPairsIn;
24859 lodash.extend = assignIn;
24860 lodash.extendWith = assignInWith;
24861
24862 // Add methods to `lodash.prototype`.
24863 mixin(lodash, lodash);
24864
24865 /*------------------------------------------------------------------------*/
24866
24867 // Add methods that return unwrapped values in chain sequences.
24868 lodash.add = add;
24869 lodash.attempt = attempt;
24870 lodash.camelCase = camelCase;
24871 lodash.capitalize = capitalize;
24872 lodash.ceil = ceil;
24873 lodash.clamp = clamp;
24874 lodash.clone = clone;
24875 lodash.cloneDeep = cloneDeep;
24876 lodash.cloneDeepWith = cloneDeepWith;
24877 lodash.cloneWith = cloneWith;
24878 lodash.conformsTo = conformsTo;
24879 lodash.deburr = deburr;
24880 lodash.defaultTo = defaultTo;
24881 lodash.divide = divide;
24882 lodash.endsWith = endsWith;
24883 lodash.eq = eq;
24884 lodash.escape = escape;
24885 lodash.escapeRegExp = escapeRegExp;
24886 lodash.every = every;
24887 lodash.find = find;
24888 lodash.findIndex = findIndex;
24889 lodash.findKey = findKey;
24890 lodash.findLast = findLast;
24891 lodash.findLastIndex = findLastIndex;
24892 lodash.findLastKey = findLastKey;
24893 lodash.floor = floor;
24894 lodash.forEach = forEach;
24895 lodash.forEachRight = forEachRight;
24896 lodash.forIn = forIn;
24897 lodash.forInRight = forInRight;
24898 lodash.forOwn = forOwn;
24899 lodash.forOwnRight = forOwnRight;
24900 lodash.get = get;
24901 lodash.gt = gt;
24902 lodash.gte = gte;
24903 lodash.has = has;
24904 lodash.hasIn = hasIn;
24905 lodash.head = head;
24906 lodash.identity = identity;
24907 lodash.includes = includes;
24908 lodash.indexOf = indexOf;
24909 lodash.inRange = inRange;
24910 lodash.invoke = invoke;
24911 lodash.isArguments = isArguments;
24912 lodash.isArray = isArray;
24913 lodash.isArrayBuffer = isArrayBuffer;
24914 lodash.isArrayLike = isArrayLike;
24915 lodash.isArrayLikeObject = isArrayLikeObject;
24916 lodash.isBoolean = isBoolean;
24917 lodash.isBuffer = isBuffer;
24918 lodash.isDate = isDate;
24919 lodash.isElement = isElement;
24920 lodash.isEmpty = isEmpty;
24921 lodash.isEqual = isEqual;
24922 lodash.isEqualWith = isEqualWith;
24923 lodash.isError = isError;
24924 lodash.isFinite = isFinite;
24925 lodash.isFunction = isFunction;
24926 lodash.isInteger = isInteger;
24927 lodash.isLength = isLength;
24928 lodash.isMap = isMap;
24929 lodash.isMatch = isMatch;
24930 lodash.isMatchWith = isMatchWith;
24931 lodash.isNaN = isNaN;
24932 lodash.isNative = isNative;
24933 lodash.isNil = isNil;
24934 lodash.isNull = isNull;
24935 lodash.isNumber = isNumber;
24936 lodash.isObject = isObject;
24937 lodash.isObjectLike = isObjectLike;
24938 lodash.isPlainObject = isPlainObject;
24939 lodash.isRegExp = isRegExp;
24940 lodash.isSafeInteger = isSafeInteger;
24941 lodash.isSet = isSet;
24942 lodash.isString = isString;
24943 lodash.isSymbol = isSymbol;
24944 lodash.isTypedArray = isTypedArray;
24945 lodash.isUndefined = isUndefined;
24946 lodash.isWeakMap = isWeakMap;
24947 lodash.isWeakSet = isWeakSet;
24948 lodash.join = join;
24949 lodash.kebabCase = kebabCase;
24950 lodash.last = last;
24951 lodash.lastIndexOf = lastIndexOf;
24952 lodash.lowerCase = lowerCase;
24953 lodash.lowerFirst = lowerFirst;
24954 lodash.lt = lt;
24955 lodash.lte = lte;
24956 lodash.max = max;
24957 lodash.maxBy = maxBy;
24958 lodash.mean = mean;
24959 lodash.meanBy = meanBy;
24960 lodash.min = min;
24961 lodash.minBy = minBy;
24962 lodash.stubArray = stubArray;
24963 lodash.stubFalse = stubFalse;
24964 lodash.stubObject = stubObject;
24965 lodash.stubString = stubString;
24966 lodash.stubTrue = stubTrue;
24967 lodash.multiply = multiply;
24968 lodash.nth = nth;
24969 lodash.noConflict = noConflict;
24970 lodash.noop = noop;
24971 lodash.now = now;
24972 lodash.pad = pad;
24973 lodash.padEnd = padEnd;
24974 lodash.padStart = padStart;
24975 lodash.parseInt = parseInt;
24976 lodash.random = random;
24977 lodash.reduce = reduce;
24978 lodash.reduceRight = reduceRight;
24979 lodash.repeat = repeat;
24980 lodash.replace = replace;
24981 lodash.result = result;
24982 lodash.round = round;
24983 lodash.runInContext = runInContext;
24984 lodash.sample = sample;
24985 lodash.size = size;
24986 lodash.snakeCase = snakeCase;
24987 lodash.some = some;
24988 lodash.sortedIndex = sortedIndex;
24989 lodash.sortedIndexBy = sortedIndexBy;
24990 lodash.sortedIndexOf = sortedIndexOf;
24991 lodash.sortedLastIndex = sortedLastIndex;
24992 lodash.sortedLastIndexBy = sortedLastIndexBy;
24993 lodash.sortedLastIndexOf = sortedLastIndexOf;
24994 lodash.startCase = startCase;
24995 lodash.startsWith = startsWith;
24996 lodash.subtract = subtract;
24997 lodash.sum = sum;
24998 lodash.sumBy = sumBy;
24999 lodash.template = template;
25000 lodash.times = times;
25001 lodash.toFinite = toFinite;
25002 lodash.toInteger = toInteger;
25003 lodash.toLength = toLength;
25004 lodash.toLower = toLower;
25005 lodash.toNumber = toNumber;
25006 lodash.toSafeInteger = toSafeInteger;
25007 lodash.toString = toString;
25008 lodash.toUpper = toUpper;
25009 lodash.trim = trim;
25010 lodash.trimEnd = trimEnd;
25011 lodash.trimStart = trimStart;
25012 lodash.truncate = truncate;
25013 lodash.unescape = unescape;
25014 lodash.uniqueId = uniqueId;
25015 lodash.upperCase = upperCase;
25016 lodash.upperFirst = upperFirst;
25017
25018 // Add aliases.
25019 lodash.each = forEach;
25020 lodash.eachRight = forEachRight;
25021 lodash.first = head;
25022
25023 mixin(lodash, (function() {
25024 var source = {};
25025 baseForOwn(lodash, function(func, methodName) {
25026 if (!hasOwnProperty.call(lodash.prototype, methodName)) {
25027 source[methodName] = func;
25028 }
25029 });
25030 return source;
25031 }()), { 'chain': false });
25032
25033 /*------------------------------------------------------------------------*/
25034
25035 /**
25036 * The semantic version number.
25037 *
25038 * @static
25039 * @memberOf _
25040 * @type {string}
25041 */
25042 lodash.VERSION = VERSION;
25043
25044 // Assign default placeholders.
25045 arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) {
25046 lodash[methodName].placeholder = lodash;
25047 });
25048
25049 // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
25050 arrayEach(['drop', 'take'], function(methodName, index) {
25051 LazyWrapper.prototype[methodName] = function(n) {
25052 n = n === undefined ? 1 : nativeMax(toInteger(n), 0);
25053
25054 var result = (this.__filtered__ && !index)
25055 ? new LazyWrapper(this)
25056 : this.clone();
25057
25058 if (result.__filtered__) {
25059 result.__takeCount__ = nativeMin(n, result.__takeCount__);
25060 } else {
25061 result.__views__.push({
25062 'size': nativeMin(n, MAX_ARRAY_LENGTH),
25063 'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
25064 });
25065 }
25066 return result;
25067 };
25068
25069 LazyWrapper.prototype[methodName + 'Right'] = function(n) {
25070 return this.reverse()[methodName](n).reverse();
25071 };
25072 });
25073
25074 // Add `LazyWrapper` methods that accept an `iteratee` value.
25075 arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) {
25076 var type = index + 1,
25077 isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG;
25078
25079 LazyWrapper.prototype[methodName] = function(iteratee) {
25080 var result = this.clone();
25081 result.__iteratees__.push({
25082 'iteratee': getIteratee(iteratee, 3),
25083 'type': type
25084 });
25085 result.__filtered__ = result.__filtered__ || isFilter;
25086 return result;
25087 };
25088 });
25089
25090 // Add `LazyWrapper` methods for `_.head` and `_.last`.
25091 arrayEach(['head', 'last'], function(methodName, index) {
25092 var takeName = 'take' + (index ? 'Right' : '');
25093
25094 LazyWrapper.prototype[methodName] = function() {
25095 return this[takeName](1).value()[0];
25096 };
25097 });
25098
25099 // Add `LazyWrapper` methods for `_.initial` and `_.tail`.
25100 arrayEach(['initial', 'tail'], function(methodName, index) {
25101 var dropName = 'drop' + (index ? '' : 'Right');
25102
25103 LazyWrapper.prototype[methodName] = function() {
25104 return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
25105 };
25106 });
25107
25108 LazyWrapper.prototype.compact = function() {
25109 return this.filter(identity);
25110 };
25111
25112 LazyWrapper.prototype.find = function(predicate) {
25113 return this.filter(predicate).head();
25114 };
25115
25116 LazyWrapper.prototype.findLast = function(predicate) {
25117 return this.reverse().find(predicate);
25118 };
25119
25120 LazyWrapper.prototype.invokeMap = baseRest(function(path, args) {
25121 if (typeof path == 'function') {
25122 return new LazyWrapper(this);
25123 }
25124 return this.map(function(value) {
25125 return baseInvoke(value, path, args);
25126 });
25127 });
25128
25129 LazyWrapper.prototype.reject = function(predicate) {
25130 return this.filter(negate(getIteratee(predicate)));
25131 };
25132
25133 LazyWrapper.prototype.slice = function(start, end) {
25134 start = toInteger(start);
25135
25136 var result = this;
25137 if (result.__filtered__ && (start > 0 || end < 0)) {
25138 return new LazyWrapper(result);
25139 }
25140 if (start < 0) {
25141 result = result.takeRight(-start);
25142 } else if (start) {
25143 result = result.drop(start);
25144 }
25145 if (end !== undefined) {
25146 end = toInteger(end);
25147 result = end < 0 ? result.dropRight(-end) : result.take(end - start);
25148 }
25149 return result;
25150 };
25151
25152 LazyWrapper.prototype.takeRightWhile = function(predicate) {
25153 return this.reverse().takeWhile(predicate).reverse();
25154 };
25155
25156 LazyWrapper.prototype.toArray = function() {
25157 return this.take(MAX_ARRAY_LENGTH);
25158 };
25159
25160 // Add `LazyWrapper` methods to `lodash.prototype`.
25161 baseForOwn(LazyWrapper.prototype, function(func, methodName) {
25162 var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName),
25163 isTaker = /^(?:head|last)$/.test(methodName),
25164 lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName],
25165 retUnwrapped = isTaker || /^find/.test(methodName);
25166
25167 if (!lodashFunc) {
25168 return;
25169 }
25170 lodash.prototype[methodName] = function() {
25171 var value = this.__wrapped__,
25172 args = isTaker ? [1] : arguments,
25173 isLazy = value instanceof LazyWrapper,
25174 iteratee = args[0],
25175 useLazy = isLazy || isArray(value);
25176
25177 var interceptor = function(value) {
25178 var result = lodashFunc.apply(lodash, arrayPush([value], args));
25179 return (isTaker && chainAll) ? result[0] : result;
25180 };
25181
25182 if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
25183 // Avoid lazy use if the iteratee has a "length" value other than `1`.
25184 isLazy = useLazy = false;
25185 }
25186 var chainAll = this.__chain__,
25187 isHybrid = !!this.__actions__.length,
25188 isUnwrapped = retUnwrapped && !chainAll,
25189 onlyLazy = isLazy && !isHybrid;
25190
25191 if (!retUnwrapped && useLazy) {
25192 value = onlyLazy ? value : new LazyWrapper(this);
25193 var result = func.apply(value, args);
25194 result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
25195 return new LodashWrapper(result, chainAll);
25196 }
25197 if (isUnwrapped && onlyLazy) {
25198 return func.apply(this, args);
25199 }
25200 result = this.thru(interceptor);
25201 return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result;
25202 };
25203 });
25204
25205 // Add `Array` methods to `lodash.prototype`.
25206 arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) {
25207 var func = arrayProto[methodName],
25208 chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru',
25209 retUnwrapped = /^(?:pop|shift)$/.test(methodName);
25210
25211 lodash.prototype[methodName] = function() {
25212 var args = arguments;
25213 if (retUnwrapped && !this.__chain__) {
25214 var value = this.value();
25215 return func.apply(isArray(value) ? value : [], args);
25216 }
25217 return this[chainName](function(value) {
25218 return func.apply(isArray(value) ? value : [], args);
25219 });
25220 };
25221 });
25222
25223 // Map minified method names to their real names.
25224 baseForOwn(LazyWrapper.prototype, function(func, methodName) {
25225 var lodashFunc = lodash[methodName];
25226 if (lodashFunc) {
25227 var key = (lodashFunc.name + ''),
25228 names = realNames[key] || (realNames[key] = []);
25229
25230 names.push({ 'name': methodName, 'func': lodashFunc });
25231 }
25232 });
25233
25234 realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{
25235 'name': 'wrapper',
25236 'func': undefined
25237 }];
25238
25239 // Add methods to `LazyWrapper`.
25240 LazyWrapper.prototype.clone = lazyClone;
25241 LazyWrapper.prototype.reverse = lazyReverse;
25242 LazyWrapper.prototype.value = lazyValue;
25243
25244 // Add chain sequence methods to the `lodash` wrapper.
25245 lodash.prototype.at = wrapperAt;
25246 lodash.prototype.chain = wrapperChain;
25247 lodash.prototype.commit = wrapperCommit;
25248 lodash.prototype.next = wrapperNext;
25249 lodash.prototype.plant = wrapperPlant;
25250 lodash.prototype.reverse = wrapperReverse;
25251 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
25252
25253 // Add lazy aliases.
25254 lodash.prototype.first = lodash.prototype.head;
25255
25256 if (symIterator) {
25257 lodash.prototype[symIterator] = wrapperToIterator;
25258 }
25259 return lodash;
25260 });
25261
25262 /*--------------------------------------------------------------------------*/
25263
25264 // Export lodash.
25265 var _ = runInContext();
25266
25267 // Some AMD build optimizers, like r.js, check for condition patterns like:
25268 if (true) {
25269 // Expose Lodash on the global object to prevent errors when Lodash is
25270 // loaded by a script tag in the presence of an AMD loader.
25271 // See http://requirejs.org/docs/errors.html#mismatch for more details.
25272 // Use `_.noConflict` to remove Lodash from the global object.
25273 root._ = _;
25274
25275 // Define as an anonymous module so, through path mapping, it can be
25276 // referenced as the "underscore" module.
25277 !(__WEBPACK_AMD_DEFINE_RESULT__ = function() {
25278 return _;
25279 }.call(exports, __webpack_require__, exports, module),
25280 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
25281 }
25282 // Check for `exports` after `define` in case a build optimizer adds it.
25283 else if (freeModule) {
25284 // Export for Node.js.
25285 (freeModule.exports = _)._ = _;
25286 // Export for CommonJS support.
25287 freeExports._ = _;
25288 }
25289 else {
25290 // Export to the global object.
25291 root._ = _;
25292 }
25293}.call(this));
25294
25295/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(150)(module)))
25296
25297/***/ }),
25298/* 46 */
25299/***/ (function(module, __webpack_exports__, __webpack_require__) {
25300
25301"use strict";
25302/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return EMPTY; });
25303/* harmony export (immutable) */ __webpack_exports__["a"] = empty;
25304/* unused harmony export emptyScheduled */
25305/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
25306/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
25307
25308var EMPTY = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return subscriber.complete(); });
25309function empty(scheduler) {
25310 return scheduler ? emptyScheduled(scheduler) : EMPTY;
25311}
25312function emptyScheduled(scheduler) {
25313 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return scheduler.schedule(function () { return subscriber.complete(); }); });
25314}
25315//# sourceMappingURL=empty.js.map
25316
25317
25318/***/ }),
25319/* 47 */
25320/***/ (function(module, __webpack_exports__, __webpack_require__) {
25321
25322"use strict";
25323/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return async; });
25324/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AsyncAction__ = __webpack_require__(137);
25325/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(138);
25326/** PURE_IMPORTS_START _AsyncAction,_AsyncScheduler PURE_IMPORTS_END */
25327
25328
25329var async = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /* AsyncScheduler */](__WEBPACK_IMPORTED_MODULE_0__AsyncAction__["a" /* AsyncAction */]);
25330//# sourceMappingURL=async.js.map
25331
25332
25333/***/ }),
25334/* 48 */
25335/***/ (function(module, __webpack_exports__, __webpack_require__) {
25336
25337"use strict";
25338/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isArray; });
25339/** PURE_IMPORTS_START PURE_IMPORTS_END */
25340var isArray = Array.isArray || (function (x) { return x && typeof x.length === 'number'; });
25341//# sourceMappingURL=isArray.js.map
25342
25343
25344/***/ }),
25345/* 49 */
25346/***/ (function(module, exports) {
25347
25348module.exports = function (it) {
25349 return typeof it === 'object' ? it !== null : typeof it === 'function';
25350};
25351
25352
25353/***/ }),
25354/* 50 */
25355/***/ (function(module, exports) {
25356
25357module.exports = require("assert");
25358
25359/***/ }),
25360/* 51 */
25361/***/ (function(module, exports, __webpack_require__) {
25362
25363"use strict";
25364
25365
25366Object.defineProperty(exports, "__esModule", {
25367 value: true
25368});
25369
25370var _setPrototypeOf;
25371
25372function _load_setPrototypeOf() {
25373 return _setPrototypeOf = _interopRequireDefault(__webpack_require__(211));
25374}
25375
25376var _getIterator2;
25377
25378function _load_getIterator() {
25379 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
25380}
25381
25382exports.default = nullify;
25383
25384function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25385
25386function nullify() {
25387 var obj = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
25388
25389 if (Array.isArray(obj)) {
25390 for (var _iterator = obj, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
25391 var _ref;
25392
25393 if (_isArray) {
25394 if (_i >= _iterator.length) break;
25395 _ref = _iterator[_i++];
25396 } else {
25397 _i = _iterator.next();
25398 if (_i.done) break;
25399 _ref = _i.value;
25400 }
25401
25402 var item = _ref;
25403
25404 nullify(item);
25405 }
25406 } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') {
25407 (0, (_setPrototypeOf || _load_setPrototypeOf()).default)(obj, null);
25408
25409 // for..in can only be applied to 'object', not 'function'
25410 if (typeof obj === 'object') {
25411 for (var key in obj) {
25412 nullify(obj[key]);
25413 }
25414 }
25415 }
25416
25417 return obj;
25418}
25419
25420/***/ }),
25421/* 52 */
25422/***/ (function(module, exports, __webpack_require__) {
25423
25424"use strict";
25425
25426
25427Object.defineProperty(exports, "__esModule", {
25428 value: true
25429});
25430exports.normalizePattern = normalizePattern;
25431
25432/**
25433 * Explode and normalize a pattern into its name and range.
25434 */
25435
25436function normalizePattern(pattern) {
25437 var hasVersion = false;
25438 var range = 'latest';
25439 var name = pattern;
25440
25441 // if we're a scope then remove the @ and add it back later
25442 var isScoped = false;
25443 if (name[0] === '@') {
25444 isScoped = true;
25445 name = name.slice(1);
25446 }
25447
25448 // take first part as the name
25449 var parts = name.split('@');
25450 if (parts.length > 1) {
25451 name = parts.shift();
25452 range = parts.join('@');
25453
25454 if (range) {
25455 hasVersion = true;
25456 } else {
25457 range = '*';
25458 }
25459 }
25460
25461 // add back @ scope suffix
25462 if (isScoped) {
25463 name = `@${name}`;
25464 }
25465
25466 return { name, range, hasVersion };
25467}
25468
25469/***/ }),
25470/* 53 */
25471/***/ (function(module, exports, __webpack_require__) {
25472
25473module.exports = { "default": __webpack_require__(590), __esModule: true };
25474
25475/***/ }),
25476/* 54 */
25477/***/ (function(module, __webpack_exports__, __webpack_require__) {
25478
25479"use strict";
25480/* harmony export (immutable) */ __webpack_exports__["a"] = map;
25481/* unused harmony export MapOperator */
25482/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
25483/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
25484/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
25485
25486
25487function map(project, thisArg) {
25488 return function mapOperation(source) {
25489 if (typeof project !== 'function') {
25490 throw new TypeError('argument is not a function. Are you looking for `mapTo()`?');
25491 }
25492 return source.lift(new MapOperator(project, thisArg));
25493 };
25494}
25495var MapOperator = /*@__PURE__*/ (function () {
25496 function MapOperator(project, thisArg) {
25497 this.project = project;
25498 this.thisArg = thisArg;
25499 }
25500 MapOperator.prototype.call = function (subscriber, source) {
25501 return source.subscribe(new MapSubscriber(subscriber, this.project, this.thisArg));
25502 };
25503 return MapOperator;
25504}());
25505
25506var MapSubscriber = /*@__PURE__*/ (function (_super) {
25507 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MapSubscriber, _super);
25508 function MapSubscriber(destination, project, thisArg) {
25509 var _this = _super.call(this, destination) || this;
25510 _this.project = project;
25511 _this.count = 0;
25512 _this.thisArg = thisArg || _this;
25513 return _this;
25514 }
25515 MapSubscriber.prototype._next = function (value) {
25516 var result;
25517 try {
25518 result = this.project.call(this.thisArg, value, this.count++);
25519 }
25520 catch (err) {
25521 this.destination.error(err);
25522 return;
25523 }
25524 this.destination.next(result);
25525 };
25526 return MapSubscriber;
25527}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
25528//# sourceMappingURL=map.js.map
25529
25530
25531/***/ }),
25532/* 55 */
25533/***/ (function(module, __webpack_exports__, __webpack_require__) {
25534
25535"use strict";
25536/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return errorObject; });
25537/** PURE_IMPORTS_START PURE_IMPORTS_END */
25538var errorObject = { e: {} };
25539//# sourceMappingURL=errorObject.js.map
25540
25541
25542/***/ }),
25543/* 56 */
25544/***/ (function(module, __webpack_exports__, __webpack_require__) {
25545
25546"use strict";
25547/* harmony export (immutable) */ __webpack_exports__["a"] = isScheduler;
25548/** PURE_IMPORTS_START PURE_IMPORTS_END */
25549function isScheduler(value) {
25550 return value && typeof value.schedule === 'function';
25551}
25552//# sourceMappingURL=isScheduler.js.map
25553
25554
25555/***/ }),
25556/* 57 */
25557/***/ (function(module, exports, __webpack_require__) {
25558
25559"use strict";
25560
25561
25562Object.defineProperty(exports, "__esModule", {
25563 value: true
25564});
25565exports.exec = exports.queue = undefined;
25566
25567var _keys;
25568
25569function _load_keys() {
25570 return _keys = _interopRequireDefault(__webpack_require__(14));
25571}
25572
25573var _promise;
25574
25575function _load_promise() {
25576 return _promise = _interopRequireDefault(__webpack_require__(7));
25577}
25578
25579var _getIterator2;
25580
25581function _load_getIterator() {
25582 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
25583}
25584
25585exports.forkp = forkp;
25586exports.spawnp = spawnp;
25587exports.forwardSignalToSpawnedProcesses = forwardSignalToSpawnedProcesses;
25588exports.spawn = spawn;
25589
25590var _constants;
25591
25592function _load_constants() {
25593 return _constants = _interopRequireWildcard(__webpack_require__(13));
25594}
25595
25596var _blockingQueue;
25597
25598function _load_blockingQueue() {
25599 return _blockingQueue = _interopRequireDefault(__webpack_require__(157));
25600}
25601
25602var _errors;
25603
25604function _load_errors() {
25605 return _errors = __webpack_require__(6);
25606}
25607
25608var _promise2;
25609
25610function _load_promise2() {
25611 return _promise2 = __webpack_require__(86);
25612}
25613
25614function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
25615
25616function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25617
25618/* global child_process$spawnOpts */
25619
25620var child = __webpack_require__(270);
25621var fs = __webpack_require__(12);
25622var path = __webpack_require__(1);
25623
25624var queue = exports.queue = new (_blockingQueue || _load_blockingQueue()).default('child', (_constants || _load_constants()).CHILD_CONCURRENCY);
25625
25626// TODO: this uid check is kinda whack
25627var uid = 0;
25628
25629var exec = exports.exec = (0, (_promise2 || _load_promise2()).promisify)(child.exec);
25630
25631function validate(program) {
25632 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25633
25634 if (program.indexOf('/') !== -1) {
25635 return;
25636 }
25637
25638 if (process.platform === 'win32' && process.env.PATHEXT) {
25639 var cwd = opts.cwd || process.cwd();
25640 var pathext = process.env.PATHEXT;
25641
25642 for (var _iterator = pathext.split(';'), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
25643 var _ref;
25644
25645 if (_isArray) {
25646 if (_i >= _iterator.length) break;
25647 _ref = _iterator[_i++];
25648 } else {
25649 _i = _iterator.next();
25650 if (_i.done) break;
25651 _ref = _i.value;
25652 }
25653
25654 var ext = _ref;
25655
25656 var candidate = path.join(cwd, `${program}${ext}`);
25657 if (fs.existsSync(candidate)) {
25658 throw new Error(`Potentially dangerous call to "${program}" in ${cwd}`);
25659 }
25660 }
25661 }
25662}
25663
25664function forkp(program, args, opts) {
25665 validate(program, opts);
25666 var key = String(++uid);
25667 return new (_promise || _load_promise()).default(function (resolve, reject) {
25668 var proc = child.fork(program, args, opts);
25669 spawnedProcesses[key] = proc;
25670
25671 proc.on('error', function (error) {
25672 reject(error);
25673 });
25674
25675 proc.on('close', function (exitCode) {
25676 resolve(exitCode);
25677 });
25678 });
25679}
25680
25681function spawnp(program, args, opts) {
25682 validate(program, opts);
25683 var key = String(++uid);
25684 return new (_promise || _load_promise()).default(function (resolve, reject) {
25685 var proc = child.spawn(program, args, opts);
25686 spawnedProcesses[key] = proc;
25687
25688 proc.on('error', function (error) {
25689 reject(error);
25690 });
25691
25692 proc.on('close', function (exitCode) {
25693 resolve(exitCode);
25694 });
25695 });
25696}
25697
25698var spawnedProcesses = {};
25699
25700function forwardSignalToSpawnedProcesses(signal) {
25701 for (var _iterator2 = (0, (_keys || _load_keys()).default)(spawnedProcesses), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
25702 var _ref2;
25703
25704 if (_isArray2) {
25705 if (_i2 >= _iterator2.length) break;
25706 _ref2 = _iterator2[_i2++];
25707 } else {
25708 _i2 = _iterator2.next();
25709 if (_i2.done) break;
25710 _ref2 = _i2.value;
25711 }
25712
25713 var key = _ref2;
25714
25715 spawnedProcesses[key].kill(signal);
25716 }
25717}
25718
25719function spawn(program, args) {
25720 var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
25721 var onData = arguments[3];
25722
25723 var key = opts.cwd || String(++uid);
25724 return queue.push(key, function () {
25725 return new (_promise || _load_promise()).default(function (resolve, reject) {
25726 validate(program, opts);
25727
25728 var proc = child.spawn(program, args, opts);
25729 spawnedProcesses[key] = proc;
25730
25731 var processingDone = false;
25732 var processClosed = false;
25733 var err = null;
25734
25735 var stdout = '';
25736
25737 proc.on('error', function (err) {
25738 if (err.code === 'ENOENT') {
25739 reject(new (_errors || _load_errors()).ProcessSpawnError(`Couldn't find the binary ${program}`, err.code, program));
25740 } else {
25741 reject(err);
25742 }
25743 });
25744
25745 function updateStdout(chunk) {
25746 stdout += chunk;
25747 if (onData) {
25748 onData(chunk);
25749 }
25750 }
25751
25752 function finish() {
25753 delete spawnedProcesses[key];
25754 if (err) {
25755 reject(err);
25756 } else {
25757 resolve(stdout.trim());
25758 }
25759 }
25760
25761 if (typeof opts.process === 'function') {
25762 opts.process(proc, updateStdout, reject, function () {
25763 if (processClosed) {
25764 finish();
25765 } else {
25766 processingDone = true;
25767 }
25768 });
25769 } else {
25770 if (proc.stderr) {
25771 proc.stderr.on('data', updateStdout);
25772 }
25773
25774 if (proc.stdout) {
25775 proc.stdout.on('data', updateStdout);
25776 }
25777
25778 processingDone = true;
25779 }
25780
25781 proc.on('close', function (code, signal) {
25782 if (signal || code >= 1) {
25783 err = new (_errors || _load_errors()).ProcessTermError(['Command failed.', signal ? `Exit signal: ${signal}` : `Exit code: ${code}`, `Command: ${program}`, `Arguments: ${args.join(' ')}`, `Directory: ${opts.cwd || process.cwd()}`, `Output:\n${stdout.trim()}`].join('\n'));
25784 err.EXIT_SIGNAL = signal;
25785 err.EXIT_CODE = code;
25786 }
25787
25788 if (processingDone || err) {
25789 finish();
25790 } else {
25791 processClosed = true;
25792 }
25793 });
25794 });
25795 });
25796}
25797
25798/***/ }),
25799/* 58 */
25800/***/ (function(module, exports, __webpack_require__) {
25801
25802var isObject = __webpack_require__(49);
25803module.exports = function (it) {
25804 if (!isObject(it)) throw TypeError(it + ' is not an object!');
25805 return it;
25806};
25807
25808
25809/***/ }),
25810/* 59 */
25811/***/ (function(module, __webpack_exports__, __webpack_require__) {
25812
25813"use strict";
25814/* harmony export (immutable) */ __webpack_exports__["a"] = tryCatch;
25815/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__errorObject__ = __webpack_require__(55);
25816/** PURE_IMPORTS_START _errorObject PURE_IMPORTS_END */
25817
25818var tryCatchTarget;
25819function tryCatcher() {
25820 try {
25821 return tryCatchTarget.apply(this, arguments);
25822 }
25823 catch (e) {
25824 __WEBPACK_IMPORTED_MODULE_0__errorObject__["a" /* errorObject */].e = e;
25825 return __WEBPACK_IMPORTED_MODULE_0__errorObject__["a" /* errorObject */];
25826 }
25827}
25828function tryCatch(fn) {
25829 tryCatchTarget = fn;
25830 return tryCatcher;
25831}
25832//# sourceMappingURL=tryCatch.js.map
25833
25834
25835/***/ }),
25836/* 60 */
25837/***/ (function(module, exports, __webpack_require__) {
25838
25839/* eslint-disable node/no-deprecated-api */
25840var buffer = __webpack_require__(94)
25841var Buffer = buffer.Buffer
25842
25843// alternative to using Object.keys for old browsers
25844function copyProps (src, dst) {
25845 for (var key in src) {
25846 dst[key] = src[key]
25847 }
25848}
25849if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
25850 module.exports = buffer
25851} else {
25852 // Copy properties from require('buffer')
25853 copyProps(buffer, exports)
25854 exports.Buffer = SafeBuffer
25855}
25856
25857function SafeBuffer (arg, encodingOrOffset, length) {
25858 return Buffer(arg, encodingOrOffset, length)
25859}
25860
25861// Copy static methods from Buffer
25862copyProps(Buffer, SafeBuffer)
25863
25864SafeBuffer.from = function (arg, encodingOrOffset, length) {
25865 if (typeof arg === 'number') {
25866 throw new TypeError('Argument must not be a number')
25867 }
25868 return Buffer(arg, encodingOrOffset, length)
25869}
25870
25871SafeBuffer.alloc = function (size, fill, encoding) {
25872 if (typeof size !== 'number') {
25873 throw new TypeError('Argument must be a number')
25874 }
25875 var buf = Buffer(size)
25876 if (fill !== undefined) {
25877 if (typeof encoding === 'string') {
25878 buf.fill(fill, encoding)
25879 } else {
25880 buf.fill(fill)
25881 }
25882 } else {
25883 buf.fill(0)
25884 }
25885 return buf
25886}
25887
25888SafeBuffer.allocUnsafe = function (size) {
25889 if (typeof size !== 'number') {
25890 throw new TypeError('Argument must be a number')
25891 }
25892 return Buffer(size)
25893}
25894
25895SafeBuffer.allocUnsafeSlow = function (size) {
25896 if (typeof size !== 'number') {
25897 throw new TypeError('Argument must be a number')
25898 }
25899 return buffer.SlowBuffer(size)
25900}
25901
25902
25903/***/ }),
25904/* 61 */
25905/***/ (function(module, exports, __webpack_require__) {
25906
25907"use strict";
25908
25909
25910Object.defineProperty(exports, "__esModule", {
25911 value: true
25912});
25913exports.registryNames = exports.registries = undefined;
25914
25915var _keys;
25916
25917function _load_keys() {
25918 return _keys = _interopRequireDefault(__webpack_require__(14));
25919}
25920
25921var _yarnRegistry;
25922
25923function _load_yarnRegistry() {
25924 return _yarnRegistry = _interopRequireDefault(__webpack_require__(515));
25925}
25926
25927var _npmRegistry;
25928
25929function _load_npmRegistry() {
25930 return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
25931}
25932
25933function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25934
25935var registries = exports.registries = {
25936 npm: (_npmRegistry || _load_npmRegistry()).default,
25937 yarn: (_yarnRegistry || _load_yarnRegistry()).default
25938};
25939
25940var registryNames = exports.registryNames = (0, (_keys || _load_keys()).default)(registries);
25941
25942/***/ }),
25943/* 62 */
25944/***/ (function(module, exports, __webpack_require__) {
25945
25946"use strict";
25947
25948
25949Object.defineProperty(exports, "__esModule", {
25950 value: true
25951});
25952
25953var _getIterator2;
25954
25955function _load_getIterator() {
25956 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
25957}
25958
25959var _promise;
25960
25961function _load_promise() {
25962 return _promise = _interopRequireDefault(__webpack_require__(7));
25963}
25964
25965var _asyncToGenerator2;
25966
25967function _load_asyncToGenerator() {
25968 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
25969}
25970
25971var _keys;
25972
25973function _load_keys() {
25974 return _keys = _interopRequireDefault(__webpack_require__(14));
25975}
25976
25977exports.default = function (rootCommandName, subCommands) {
25978 var run = function () {
25979 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
25980 var subName = (0, (_misc || _load_misc()).camelCase)(args.shift() || '');
25981 if (subName && subCommands[subName]) {
25982 var command = subCommands[subName];
25983 var res = yield command(config, reporter, flags, args);
25984 if (res !== false) {
25985 return (_promise || _load_promise()).default.resolve();
25986 }
25987 }
25988
25989 if (usage && usage.length) {
25990 reporter.error(`${reporter.lang('usage')}:`);
25991 for (var _iterator = usage, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
25992 var _ref2;
25993
25994 if (_isArray) {
25995 if (_i >= _iterator.length) break;
25996 _ref2 = _iterator[_i++];
25997 } else {
25998 _i = _iterator.next();
25999 if (_i.done) break;
26000 _ref2 = _i.value;
26001 }
26002
26003 var msg = _ref2;
26004
26005 reporter.error(`yarn ${rootCommandName} ${msg}`);
26006 }
26007 }
26008 return (_promise || _load_promise()).default.reject(new (_errors || _load_errors()).MessageError(reporter.lang('invalidCommand', subCommandNames.join(', '))));
26009 });
26010
26011 return function run(_x2, _x3, _x4, _x5) {
26012 return _ref.apply(this, arguments);
26013 };
26014 }();
26015
26016 var usage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
26017
26018 var subCommandNames = (0, (_keys || _load_keys()).default)(subCommands).map((_misc || _load_misc()).hyphenate);
26019
26020 function setFlags(commander) {
26021 commander.usage(`${rootCommandName} [${subCommandNames.join('|')}] [flags]`);
26022 }
26023
26024 function hasWrapper(commander, args) {
26025 return true;
26026 }
26027
26028 var examples = usage.map(function (cmd) {
26029 return `${rootCommandName} ${cmd}`;
26030 });
26031
26032 return { run, setFlags, hasWrapper, examples };
26033};
26034
26035var _errors;
26036
26037function _load_errors() {
26038 return _errors = __webpack_require__(6);
26039}
26040
26041var _misc;
26042
26043function _load_misc() {
26044 return _misc = __webpack_require__(28);
26045}
26046
26047function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26048
26049/***/ }),
26050/* 63 */
26051/***/ (function(module, exports, __webpack_require__) {
26052
26053var anObject = __webpack_require__(58);
26054var IE8_DOM_DEFINE = __webpack_require__(328);
26055var toPrimitive = __webpack_require__(227);
26056var dP = Object.defineProperty;
26057
26058exports.f = __webpack_require__(68) ? Object.defineProperty : function defineProperty(O, P, Attributes) {
26059 anObject(O);
26060 P = toPrimitive(P, true);
26061 anObject(Attributes);
26062 if (IE8_DOM_DEFINE) try {
26063 return dP(O, P, Attributes);
26064 } catch (e) { /* empty */ }
26065 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
26066 if ('value' in Attributes) O[P] = Attributes.value;
26067 return O;
26068};
26069
26070
26071/***/ }),
26072/* 64 */
26073/***/ (function(module, __webpack_exports__, __webpack_require__) {
26074
26075"use strict";
26076/* harmony export (immutable) */ __webpack_exports__["a"] = from;
26077/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
26078/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isPromise__ = __webpack_require__(415);
26079/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArrayLike__ = __webpack_require__(412);
26080/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isInteropObservable__ = __webpack_require__(1001);
26081/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isIterable__ = __webpack_require__(1002);
26082/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fromArray__ = __webpack_require__(81);
26083/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__fromPromise__ = __webpack_require__(903);
26084/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__fromIterable__ = __webpack_require__(901);
26085/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__fromObservable__ = __webpack_require__(902);
26086/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__util_subscribeTo__ = __webpack_require__(416);
26087/** PURE_IMPORTS_START _Observable,_util_isPromise,_util_isArrayLike,_util_isInteropObservable,_util_isIterable,_fromArray,_fromPromise,_fromIterable,_fromObservable,_util_subscribeTo PURE_IMPORTS_END */
26088
26089
26090
26091
26092
26093
26094
26095
26096
26097
26098function from(input, scheduler) {
26099 if (!scheduler) {
26100 if (input instanceof __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */]) {
26101 return input;
26102 }
26103 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_9__util_subscribeTo__["a" /* subscribeTo */])(input));
26104 }
26105 if (input != null) {
26106 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isInteropObservable__["a" /* isInteropObservable */])(input)) {
26107 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_8__fromObservable__["a" /* fromObservable */])(input, scheduler);
26108 }
26109 else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isPromise__["a" /* isPromise */])(input)) {
26110 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__fromPromise__["a" /* fromPromise */])(input, scheduler);
26111 }
26112 else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArrayLike__["a" /* isArrayLike */])(input)) {
26113 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__fromArray__["a" /* fromArray */])(input, scheduler);
26114 }
26115 else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isIterable__["a" /* isIterable */])(input) || typeof input === 'string') {
26116 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__fromIterable__["a" /* fromIterable */])(input, scheduler);
26117 }
26118 }
26119 throw new TypeError((input !== null && typeof input || input) + ' is not observable');
26120}
26121//# sourceMappingURL=from.js.map
26122
26123
26124/***/ }),
26125/* 65 */
26126/***/ (function(module, __webpack_exports__, __webpack_require__) {
26127
26128"use strict";
26129Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
26130/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_operators_audit__ = __webpack_require__(398);
26131/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "audit", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_operators_audit__["a"]; });
26132/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_operators_auditTime__ = __webpack_require__(911);
26133/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "auditTime", function() { return __WEBPACK_IMPORTED_MODULE_1__internal_operators_auditTime__["a"]; });
26134/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_operators_buffer__ = __webpack_require__(912);
26135/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "buffer", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_operators_buffer__["a"]; });
26136/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_operators_bufferCount__ = __webpack_require__(913);
26137/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bufferCount", function() { return __WEBPACK_IMPORTED_MODULE_3__internal_operators_bufferCount__["a"]; });
26138/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_operators_bufferTime__ = __webpack_require__(914);
26139/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bufferTime", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_operators_bufferTime__["a"]; });
26140/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__internal_operators_bufferToggle__ = __webpack_require__(915);
26141/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bufferToggle", function() { return __WEBPACK_IMPORTED_MODULE_5__internal_operators_bufferToggle__["a"]; });
26142/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_operators_bufferWhen__ = __webpack_require__(916);
26143/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bufferWhen", function() { return __WEBPACK_IMPORTED_MODULE_6__internal_operators_bufferWhen__["a"]; });
26144/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__internal_operators_catchError__ = __webpack_require__(917);
26145/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "catchError", function() { return __WEBPACK_IMPORTED_MODULE_7__internal_operators_catchError__["a"]; });
26146/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__internal_operators_combineAll__ = __webpack_require__(918);
26147/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineAll", function() { return __WEBPACK_IMPORTED_MODULE_8__internal_operators_combineAll__["a"]; });
26148/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__internal_operators_combineLatest__ = __webpack_require__(919);
26149/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return __WEBPACK_IMPORTED_MODULE_9__internal_operators_combineLatest__["a"]; });
26150/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__internal_operators_concat__ = __webpack_require__(920);
26151/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return __WEBPACK_IMPORTED_MODULE_10__internal_operators_concat__["a"]; });
26152/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__internal_operators_concatAll__ = __webpack_require__(399);
26153/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concatAll", function() { return __WEBPACK_IMPORTED_MODULE_11__internal_operators_concatAll__["a"]; });
26154/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__internal_operators_concatMap__ = __webpack_require__(400);
26155/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concatMap", function() { return __WEBPACK_IMPORTED_MODULE_12__internal_operators_concatMap__["a"]; });
26156/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__internal_operators_concatMapTo__ = __webpack_require__(921);
26157/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concatMapTo", function() { return __WEBPACK_IMPORTED_MODULE_13__internal_operators_concatMapTo__["a"]; });
26158/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__internal_operators_count__ = __webpack_require__(922);
26159/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "count", function() { return __WEBPACK_IMPORTED_MODULE_14__internal_operators_count__["a"]; });
26160/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__internal_operators_debounce__ = __webpack_require__(923);
26161/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return __WEBPACK_IMPORTED_MODULE_15__internal_operators_debounce__["a"]; });
26162/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__internal_operators_debounceTime__ = __webpack_require__(924);
26163/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "debounceTime", function() { return __WEBPACK_IMPORTED_MODULE_16__internal_operators_debounceTime__["a"]; });
26164/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__internal_operators_defaultIfEmpty__ = __webpack_require__(134);
26165/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defaultIfEmpty", function() { return __WEBPACK_IMPORTED_MODULE_17__internal_operators_defaultIfEmpty__["a"]; });
26166/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__internal_operators_delay__ = __webpack_require__(925);
26167/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delay", function() { return __WEBPACK_IMPORTED_MODULE_18__internal_operators_delay__["a"]; });
26168/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__internal_operators_delayWhen__ = __webpack_require__(926);
26169/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "delayWhen", function() { return __WEBPACK_IMPORTED_MODULE_19__internal_operators_delayWhen__["a"]; });
26170/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__internal_operators_dematerialize__ = __webpack_require__(927);
26171/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "dematerialize", function() { return __WEBPACK_IMPORTED_MODULE_20__internal_operators_dematerialize__["a"]; });
26172/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__internal_operators_distinct__ = __webpack_require__(928);
26173/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "distinct", function() { return __WEBPACK_IMPORTED_MODULE_21__internal_operators_distinct__["a"]; });
26174/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__internal_operators_distinctUntilChanged__ = __webpack_require__(401);
26175/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilChanged", function() { return __WEBPACK_IMPORTED_MODULE_22__internal_operators_distinctUntilChanged__["a"]; });
26176/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__internal_operators_distinctUntilKeyChanged__ = __webpack_require__(929);
26177/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "distinctUntilKeyChanged", function() { return __WEBPACK_IMPORTED_MODULE_23__internal_operators_distinctUntilKeyChanged__["a"]; });
26178/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__internal_operators_elementAt__ = __webpack_require__(930);
26179/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "elementAt", function() { return __WEBPACK_IMPORTED_MODULE_24__internal_operators_elementAt__["a"]; });
26180/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__internal_operators_endWith__ = __webpack_require__(931);
26181/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "endWith", function() { return __WEBPACK_IMPORTED_MODULE_25__internal_operators_endWith__["a"]; });
26182/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__internal_operators_every__ = __webpack_require__(932);
26183/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "every", function() { return __WEBPACK_IMPORTED_MODULE_26__internal_operators_every__["a"]; });
26184/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__internal_operators_exhaust__ = __webpack_require__(933);
26185/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "exhaust", function() { return __WEBPACK_IMPORTED_MODULE_27__internal_operators_exhaust__["a"]; });
26186/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__internal_operators_exhaustMap__ = __webpack_require__(934);
26187/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "exhaustMap", function() { return __WEBPACK_IMPORTED_MODULE_28__internal_operators_exhaustMap__["a"]; });
26188/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__internal_operators_expand__ = __webpack_require__(935);
26189/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "expand", function() { return __WEBPACK_IMPORTED_MODULE_29__internal_operators_expand__["a"]; });
26190/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__internal_operators_filter__ = __webpack_require__(135);
26191/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "filter", function() { return __WEBPACK_IMPORTED_MODULE_30__internal_operators_filter__["a"]; });
26192/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__internal_operators_finalize__ = __webpack_require__(936);
26193/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "finalize", function() { return __WEBPACK_IMPORTED_MODULE_31__internal_operators_finalize__["a"]; });
26194/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__internal_operators_find__ = __webpack_require__(402);
26195/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "find", function() { return __WEBPACK_IMPORTED_MODULE_32__internal_operators_find__["a"]; });
26196/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__internal_operators_findIndex__ = __webpack_require__(937);
26197/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "findIndex", function() { return __WEBPACK_IMPORTED_MODULE_33__internal_operators_findIndex__["a"]; });
26198/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__internal_operators_first__ = __webpack_require__(938);
26199/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "first", function() { return __WEBPACK_IMPORTED_MODULE_34__internal_operators_first__["a"]; });
26200/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__internal_operators_groupBy__ = __webpack_require__(403);
26201/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "groupBy", function() { return __WEBPACK_IMPORTED_MODULE_35__internal_operators_groupBy__["b"]; });
26202/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__internal_operators_ignoreElements__ = __webpack_require__(939);
26203/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ignoreElements", function() { return __WEBPACK_IMPORTED_MODULE_36__internal_operators_ignoreElements__["a"]; });
26204/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__internal_operators_isEmpty__ = __webpack_require__(940);
26205/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_37__internal_operators_isEmpty__["a"]; });
26206/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__internal_operators_last__ = __webpack_require__(941);
26207/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_38__internal_operators_last__["a"]; });
26208/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__internal_operators_map__ = __webpack_require__(54);
26209/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_39__internal_operators_map__["a"]; });
26210/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__internal_operators_mapTo__ = __webpack_require__(942);
26211/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_operators_mapTo__["a"]; });
26212/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__internal_operators_materialize__ = __webpack_require__(943);
26213/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "materialize", function() { return __WEBPACK_IMPORTED_MODULE_41__internal_operators_materialize__["a"]; });
26214/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__internal_operators_max__ = __webpack_require__(944);
26215/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "max", function() { return __WEBPACK_IMPORTED_MODULE_42__internal_operators_max__["a"]; });
26216/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__internal_operators_merge__ = __webpack_require__(945);
26217/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return __WEBPACK_IMPORTED_MODULE_43__internal_operators_merge__["a"]; });
26218/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__internal_operators_mergeAll__ = __webpack_require__(255);
26219/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeAll", function() { return __WEBPACK_IMPORTED_MODULE_44__internal_operators_mergeAll__["a"]; });
26220/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__internal_operators_mergeMap__ = __webpack_require__(136);
26221/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMap", function() { return __WEBPACK_IMPORTED_MODULE_45__internal_operators_mergeMap__["a"]; });
26222/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "flatMap", function() { return __WEBPACK_IMPORTED_MODULE_45__internal_operators_mergeMap__["a"]; });
26223/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__internal_operators_mergeMapTo__ = __webpack_require__(946);
26224/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeMapTo", function() { return __WEBPACK_IMPORTED_MODULE_46__internal_operators_mergeMapTo__["a"]; });
26225/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__internal_operators_mergeScan__ = __webpack_require__(947);
26226/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return __WEBPACK_IMPORTED_MODULE_47__internal_operators_mergeScan__["a"]; });
26227/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__internal_operators_min__ = __webpack_require__(948);
26228/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_48__internal_operators_min__["a"]; });
26229/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__internal_operators_multicast__ = __webpack_require__(111);
26230/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return __WEBPACK_IMPORTED_MODULE_49__internal_operators_multicast__["a"]; });
26231/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__internal_operators_observeOn__ = __webpack_require__(404);
26232/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return __WEBPACK_IMPORTED_MODULE_50__internal_operators_observeOn__["b"]; });
26233/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__internal_operators_onErrorResumeNext__ = __webpack_require__(949);
26234/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return __WEBPACK_IMPORTED_MODULE_51__internal_operators_onErrorResumeNext__["a"]; });
26235/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__internal_operators_pairwise__ = __webpack_require__(950);
26236/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairwise", function() { return __WEBPACK_IMPORTED_MODULE_52__internal_operators_pairwise__["a"]; });
26237/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__internal_operators_partition__ = __webpack_require__(951);
26238/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "partition", function() { return __WEBPACK_IMPORTED_MODULE_53__internal_operators_partition__["a"]; });
26239/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__internal_operators_pluck__ = __webpack_require__(952);
26240/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pluck", function() { return __WEBPACK_IMPORTED_MODULE_54__internal_operators_pluck__["a"]; });
26241/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__internal_operators_publish__ = __webpack_require__(953);
26242/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publish", function() { return __WEBPACK_IMPORTED_MODULE_55__internal_operators_publish__["a"]; });
26243/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__internal_operators_publishBehavior__ = __webpack_require__(954);
26244/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publishBehavior", function() { return __WEBPACK_IMPORTED_MODULE_56__internal_operators_publishBehavior__["a"]; });
26245/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__internal_operators_publishLast__ = __webpack_require__(955);
26246/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publishLast", function() { return __WEBPACK_IMPORTED_MODULE_57__internal_operators_publishLast__["a"]; });
26247/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__internal_operators_publishReplay__ = __webpack_require__(956);
26248/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return __WEBPACK_IMPORTED_MODULE_58__internal_operators_publishReplay__["a"]; });
26249/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__internal_operators_race__ = __webpack_require__(957);
26250/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return __WEBPACK_IMPORTED_MODULE_59__internal_operators_race__["a"]; });
26251/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__internal_operators_reduce__ = __webpack_require__(178);
26252/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_60__internal_operators_reduce__["a"]; });
26253/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__internal_operators_repeat__ = __webpack_require__(958);
26254/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return __WEBPACK_IMPORTED_MODULE_61__internal_operators_repeat__["a"]; });
26255/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__internal_operators_repeatWhen__ = __webpack_require__(959);
26256/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "repeatWhen", function() { return __WEBPACK_IMPORTED_MODULE_62__internal_operators_repeatWhen__["a"]; });
26257/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__internal_operators_retry__ = __webpack_require__(960);
26258/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "retry", function() { return __WEBPACK_IMPORTED_MODULE_63__internal_operators_retry__["a"]; });
26259/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__internal_operators_retryWhen__ = __webpack_require__(961);
26260/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "retryWhen", function() { return __WEBPACK_IMPORTED_MODULE_64__internal_operators_retryWhen__["a"]; });
26261/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__internal_operators_refCount__ = __webpack_require__(256);
26262/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "refCount", function() { return __WEBPACK_IMPORTED_MODULE_65__internal_operators_refCount__["a"]; });
26263/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__internal_operators_sample__ = __webpack_require__(962);
26264/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sample", function() { return __WEBPACK_IMPORTED_MODULE_66__internal_operators_sample__["a"]; });
26265/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__internal_operators_sampleTime__ = __webpack_require__(963);
26266/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sampleTime", function() { return __WEBPACK_IMPORTED_MODULE_67__internal_operators_sampleTime__["a"]; });
26267/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__internal_operators_scan__ = __webpack_require__(257);
26268/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "scan", function() { return __WEBPACK_IMPORTED_MODULE_68__internal_operators_scan__["a"]; });
26269/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__internal_operators_sequenceEqual__ = __webpack_require__(964);
26270/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "sequenceEqual", function() { return __WEBPACK_IMPORTED_MODULE_69__internal_operators_sequenceEqual__["a"]; });
26271/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__internal_operators_share__ = __webpack_require__(965);
26272/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "share", function() { return __WEBPACK_IMPORTED_MODULE_70__internal_operators_share__["a"]; });
26273/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__internal_operators_shareReplay__ = __webpack_require__(966);
26274/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "shareReplay", function() { return __WEBPACK_IMPORTED_MODULE_71__internal_operators_shareReplay__["a"]; });
26275/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__internal_operators_single__ = __webpack_require__(967);
26276/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "single", function() { return __WEBPACK_IMPORTED_MODULE_72__internal_operators_single__["a"]; });
26277/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__internal_operators_skip__ = __webpack_require__(968);
26278/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "skip", function() { return __WEBPACK_IMPORTED_MODULE_73__internal_operators_skip__["a"]; });
26279/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__internal_operators_skipLast__ = __webpack_require__(969);
26280/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "skipLast", function() { return __WEBPACK_IMPORTED_MODULE_74__internal_operators_skipLast__["a"]; });
26281/* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__internal_operators_skipUntil__ = __webpack_require__(970);
26282/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "skipUntil", function() { return __WEBPACK_IMPORTED_MODULE_75__internal_operators_skipUntil__["a"]; });
26283/* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__internal_operators_skipWhile__ = __webpack_require__(971);
26284/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "skipWhile", function() { return __WEBPACK_IMPORTED_MODULE_76__internal_operators_skipWhile__["a"]; });
26285/* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__internal_operators_startWith__ = __webpack_require__(972);
26286/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "startWith", function() { return __WEBPACK_IMPORTED_MODULE_77__internal_operators_startWith__["a"]; });
26287/* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__internal_operators_subscribeOn__ = __webpack_require__(973);
26288/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "subscribeOn", function() { return __WEBPACK_IMPORTED_MODULE_78__internal_operators_subscribeOn__["a"]; });
26289/* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__internal_operators_switchAll__ = __webpack_require__(974);
26290/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "switchAll", function() { return __WEBPACK_IMPORTED_MODULE_79__internal_operators_switchAll__["a"]; });
26291/* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__internal_operators_switchMap__ = __webpack_require__(258);
26292/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "switchMap", function() { return __WEBPACK_IMPORTED_MODULE_80__internal_operators_switchMap__["a"]; });
26293/* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__internal_operators_switchMapTo__ = __webpack_require__(975);
26294/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "switchMapTo", function() { return __WEBPACK_IMPORTED_MODULE_81__internal_operators_switchMapTo__["a"]; });
26295/* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__internal_operators_take__ = __webpack_require__(259);
26296/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "take", function() { return __WEBPACK_IMPORTED_MODULE_82__internal_operators_take__["a"]; });
26297/* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__internal_operators_takeLast__ = __webpack_require__(260);
26298/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeLast", function() { return __WEBPACK_IMPORTED_MODULE_83__internal_operators_takeLast__["a"]; });
26299/* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__internal_operators_takeUntil__ = __webpack_require__(976);
26300/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeUntil", function() { return __WEBPACK_IMPORTED_MODULE_84__internal_operators_takeUntil__["a"]; });
26301/* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__internal_operators_takeWhile__ = __webpack_require__(977);
26302/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "takeWhile", function() { return __WEBPACK_IMPORTED_MODULE_85__internal_operators_takeWhile__["a"]; });
26303/* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__internal_operators_tap__ = __webpack_require__(405);
26304/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "tap", function() { return __WEBPACK_IMPORTED_MODULE_86__internal_operators_tap__["a"]; });
26305/* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__internal_operators_throttle__ = __webpack_require__(406);
26306/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_87__internal_operators_throttle__["a"]; });
26307/* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__internal_operators_throttleTime__ = __webpack_require__(978);
26308/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return __WEBPACK_IMPORTED_MODULE_88__internal_operators_throttleTime__["a"]; });
26309/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__internal_operators_throwIfEmpty__ = __webpack_require__(179);
26310/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return __WEBPACK_IMPORTED_MODULE_89__internal_operators_throwIfEmpty__["a"]; });
26311/* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__internal_operators_timeInterval__ = __webpack_require__(979);
26312/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return __WEBPACK_IMPORTED_MODULE_90__internal_operators_timeInterval__["a"]; });
26313/* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__internal_operators_timeout__ = __webpack_require__(980);
26314/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timeout", function() { return __WEBPACK_IMPORTED_MODULE_91__internal_operators_timeout__["a"]; });
26315/* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__internal_operators_timeoutWith__ = __webpack_require__(407);
26316/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timeoutWith", function() { return __WEBPACK_IMPORTED_MODULE_92__internal_operators_timeoutWith__["a"]; });
26317/* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__internal_operators_timestamp__ = __webpack_require__(981);
26318/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timestamp", function() { return __WEBPACK_IMPORTED_MODULE_93__internal_operators_timestamp__["a"]; });
26319/* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__internal_operators_toArray__ = __webpack_require__(982);
26320/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "toArray", function() { return __WEBPACK_IMPORTED_MODULE_94__internal_operators_toArray__["a"]; });
26321/* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__internal_operators_window__ = __webpack_require__(983);
26322/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "window", function() { return __WEBPACK_IMPORTED_MODULE_95__internal_operators_window__["a"]; });
26323/* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__internal_operators_windowCount__ = __webpack_require__(984);
26324/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "windowCount", function() { return __WEBPACK_IMPORTED_MODULE_96__internal_operators_windowCount__["a"]; });
26325/* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__internal_operators_windowTime__ = __webpack_require__(985);
26326/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "windowTime", function() { return __WEBPACK_IMPORTED_MODULE_97__internal_operators_windowTime__["a"]; });
26327/* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__internal_operators_windowToggle__ = __webpack_require__(986);
26328/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "windowToggle", function() { return __WEBPACK_IMPORTED_MODULE_98__internal_operators_windowToggle__["a"]; });
26329/* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__internal_operators_windowWhen__ = __webpack_require__(987);
26330/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "windowWhen", function() { return __WEBPACK_IMPORTED_MODULE_99__internal_operators_windowWhen__["a"]; });
26331/* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__internal_operators_withLatestFrom__ = __webpack_require__(988);
26332/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "withLatestFrom", function() { return __WEBPACK_IMPORTED_MODULE_100__internal_operators_withLatestFrom__["a"]; });
26333/* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__internal_operators_zip__ = __webpack_require__(989);
26334/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_101__internal_operators_zip__["a"]; });
26335/* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__internal_operators_zipAll__ = __webpack_require__(990);
26336/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zipAll", function() { return __WEBPACK_IMPORTED_MODULE_102__internal_operators_zipAll__["a"]; });
26337/** PURE_IMPORTS_START PURE_IMPORTS_END */
26338
26339
26340
26341
26342
26343
26344
26345
26346
26347
26348
26349
26350
26351
26352
26353
26354
26355
26356
26357
26358
26359
26360
26361
26362
26363
26364
26365
26366
26367
26368
26369
26370
26371
26372
26373
26374
26375
26376
26377
26378
26379
26380
26381
26382
26383
26384
26385
26386
26387
26388
26389
26390
26391
26392
26393
26394
26395
26396
26397
26398
26399
26400
26401
26402
26403
26404
26405
26406
26407
26408
26409
26410
26411
26412
26413
26414
26415
26416
26417
26418
26419
26420
26421
26422
26423
26424
26425
26426
26427
26428
26429
26430
26431
26432
26433
26434
26435
26436
26437
26438
26439
26440
26441
26442//# sourceMappingURL=index.js.map
26443
26444
26445/***/ }),
26446/* 66 */
26447/***/ (function(module, exports, __webpack_require__) {
26448
26449// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
26450
26451// If you have no idea what ASN.1 or BER is, see this:
26452// ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc
26453
26454var Ber = __webpack_require__(455);
26455
26456
26457
26458// --- Exported API
26459
26460module.exports = {
26461
26462 Ber: Ber,
26463
26464 BerReader: Ber.Reader,
26465
26466 BerWriter: Ber.Writer
26467
26468};
26469
26470
26471/***/ }),
26472/* 67 */
26473/***/ (function(module, exports, __webpack_require__) {
26474
26475// optional / simple context binding
26476var aFunction = __webpack_require__(88);
26477module.exports = function (fn, that, length) {
26478 aFunction(fn);
26479 if (that === undefined) return fn;
26480 switch (length) {
26481 case 1: return function (a) {
26482 return fn.call(that, a);
26483 };
26484 case 2: return function (a, b) {
26485 return fn.call(that, a, b);
26486 };
26487 case 3: return function (a, b, c) {
26488 return fn.call(that, a, b, c);
26489 };
26490 }
26491 return function (/* ...args */) {
26492 return fn.apply(that, arguments);
26493 };
26494};
26495
26496
26497/***/ }),
26498/* 68 */
26499/***/ (function(module, exports, __webpack_require__) {
26500
26501// Thank's IE8 for his funny defineProperty
26502module.exports = !__webpack_require__(76)(function () {
26503 return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
26504});
26505
26506
26507/***/ }),
26508/* 69 */
26509/***/ (function(module, exports, __webpack_require__) {
26510
26511// Copyright 2015 Joyent, Inc.
26512
26513var assert = __webpack_require__(22);
26514var util = __webpack_require__(9);
26515
26516function FingerprintFormatError(fp, format) {
26517 if (Error.captureStackTrace)
26518 Error.captureStackTrace(this, FingerprintFormatError);
26519 this.name = 'FingerprintFormatError';
26520 this.fingerprint = fp;
26521 this.format = format;
26522 this.message = 'Fingerprint format is not supported, or is invalid: ';
26523 if (fp !== undefined)
26524 this.message += ' fingerprint = ' + fp;
26525 if (format !== undefined)
26526 this.message += ' format = ' + format;
26527}
26528util.inherits(FingerprintFormatError, Error);
26529
26530function InvalidAlgorithmError(alg) {
26531 if (Error.captureStackTrace)
26532 Error.captureStackTrace(this, InvalidAlgorithmError);
26533 this.name = 'InvalidAlgorithmError';
26534 this.algorithm = alg;
26535 this.message = 'Algorithm "' + alg + '" is not supported';
26536}
26537util.inherits(InvalidAlgorithmError, Error);
26538
26539function KeyParseError(name, format, innerErr) {
26540 if (Error.captureStackTrace)
26541 Error.captureStackTrace(this, KeyParseError);
26542 this.name = 'KeyParseError';
26543 this.format = format;
26544 this.keyName = name;
26545 this.innerErr = innerErr;
26546 this.message = 'Failed to parse ' + name + ' as a valid ' + format +
26547 ' format key: ' + innerErr.message;
26548}
26549util.inherits(KeyParseError, Error);
26550
26551function SignatureParseError(type, format, innerErr) {
26552 if (Error.captureStackTrace)
26553 Error.captureStackTrace(this, SignatureParseError);
26554 this.name = 'SignatureParseError';
26555 this.type = type;
26556 this.format = format;
26557 this.innerErr = innerErr;
26558 this.message = 'Failed to parse the given data as a ' + type +
26559 ' signature in ' + format + ' format: ' + innerErr.message;
26560}
26561util.inherits(SignatureParseError, Error);
26562
26563function CertificateParseError(name, format, innerErr) {
26564 if (Error.captureStackTrace)
26565 Error.captureStackTrace(this, CertificateParseError);
26566 this.name = 'CertificateParseError';
26567 this.format = format;
26568 this.certName = name;
26569 this.innerErr = innerErr;
26570 this.message = 'Failed to parse ' + name + ' as a valid ' + format +
26571 ' format certificate: ' + innerErr.message;
26572}
26573util.inherits(CertificateParseError, Error);
26574
26575function KeyEncryptedError(name, format) {
26576 if (Error.captureStackTrace)
26577 Error.captureStackTrace(this, KeyEncryptedError);
26578 this.name = 'KeyEncryptedError';
26579 this.format = format;
26580 this.keyName = name;
26581 this.message = 'The ' + format + ' format key ' + name + ' is ' +
26582 'encrypted (password-protected), and no passphrase was ' +
26583 'provided in `options`';
26584}
26585util.inherits(KeyEncryptedError, Error);
26586
26587module.exports = {
26588 FingerprintFormatError: FingerprintFormatError,
26589 InvalidAlgorithmError: InvalidAlgorithmError,
26590 KeyParseError: KeyParseError,
26591 SignatureParseError: SignatureParseError,
26592 KeyEncryptedError: KeyEncryptedError,
26593 CertificateParseError: CertificateParseError
26594};
26595
26596
26597/***/ }),
26598/* 70 */
26599/***/ (function(module, exports, __webpack_require__) {
26600
26601// Copyright 2015 Joyent, Inc.
26602
26603module.exports = Signature;
26604
26605var assert = __webpack_require__(22);
26606var Buffer = __webpack_require__(20).Buffer;
26607var algs = __webpack_require__(39);
26608var crypto = __webpack_require__(21);
26609var errs = __webpack_require__(69);
26610var utils = __webpack_require__(32);
26611var asn1 = __webpack_require__(66);
26612var SSHBuffer = __webpack_require__(147);
26613
26614var InvalidAlgorithmError = errs.InvalidAlgorithmError;
26615var SignatureParseError = errs.SignatureParseError;
26616
26617function Signature(opts) {
26618 assert.object(opts, 'options');
26619 assert.arrayOfObject(opts.parts, 'options.parts');
26620 assert.string(opts.type, 'options.type');
26621
26622 var partLookup = {};
26623 for (var i = 0; i < opts.parts.length; ++i) {
26624 var part = opts.parts[i];
26625 partLookup[part.name] = part;
26626 }
26627
26628 this.type = opts.type;
26629 this.hashAlgorithm = opts.hashAlgo;
26630 this.curve = opts.curve;
26631 this.parts = opts.parts;
26632 this.part = partLookup;
26633}
26634
26635Signature.prototype.toBuffer = function (format) {
26636 if (format === undefined)
26637 format = 'asn1';
26638 assert.string(format, 'format');
26639
26640 var buf;
26641 var stype = 'ssh-' + this.type;
26642
26643 switch (this.type) {
26644 case 'rsa':
26645 switch (this.hashAlgorithm) {
26646 case 'sha256':
26647 stype = 'rsa-sha2-256';
26648 break;
26649 case 'sha512':
26650 stype = 'rsa-sha2-512';
26651 break;
26652 case 'sha1':
26653 case undefined:
26654 break;
26655 default:
26656 throw (new Error('SSH signature ' +
26657 'format does not support hash ' +
26658 'algorithm ' + this.hashAlgorithm));
26659 }
26660 if (format === 'ssh') {
26661 buf = new SSHBuffer({});
26662 buf.writeString(stype);
26663 buf.writePart(this.part.sig);
26664 return (buf.toBuffer());
26665 } else {
26666 return (this.part.sig.data);
26667 }
26668 break;
26669
26670 case 'ed25519':
26671 if (format === 'ssh') {
26672 buf = new SSHBuffer({});
26673 buf.writeString(stype);
26674 buf.writePart(this.part.sig);
26675 return (buf.toBuffer());
26676 } else {
26677 return (this.part.sig.data);
26678 }
26679 break;
26680
26681 case 'dsa':
26682 case 'ecdsa':
26683 var r, s;
26684 if (format === 'asn1') {
26685 var der = new asn1.BerWriter();
26686 der.startSequence();
26687 r = utils.mpNormalize(this.part.r.data);
26688 s = utils.mpNormalize(this.part.s.data);
26689 der.writeBuffer(r, asn1.Ber.Integer);
26690 der.writeBuffer(s, asn1.Ber.Integer);
26691 der.endSequence();
26692 return (der.buffer);
26693 } else if (format === 'ssh' && this.type === 'dsa') {
26694 buf = new SSHBuffer({});
26695 buf.writeString('ssh-dss');
26696 r = this.part.r.data;
26697 if (r.length > 20 && r[0] === 0x00)
26698 r = r.slice(1);
26699 s = this.part.s.data;
26700 if (s.length > 20 && s[0] === 0x00)
26701 s = s.slice(1);
26702 if ((this.hashAlgorithm &&
26703 this.hashAlgorithm !== 'sha1') ||
26704 r.length + s.length !== 40) {
26705 throw (new Error('OpenSSH only supports ' +
26706 'DSA signatures with SHA1 hash'));
26707 }
26708 buf.writeBuffer(Buffer.concat([r, s]));
26709 return (buf.toBuffer());
26710 } else if (format === 'ssh' && this.type === 'ecdsa') {
26711 var inner = new SSHBuffer({});
26712 r = this.part.r.data;
26713 inner.writeBuffer(r);
26714 inner.writePart(this.part.s);
26715
26716 buf = new SSHBuffer({});
26717 /* XXX: find a more proper way to do this? */
26718 var curve;
26719 if (r[0] === 0x00)
26720 r = r.slice(1);
26721 var sz = r.length * 8;
26722 if (sz === 256)
26723 curve = 'nistp256';
26724 else if (sz === 384)
26725 curve = 'nistp384';
26726 else if (sz === 528)
26727 curve = 'nistp521';
26728 buf.writeString('ecdsa-sha2-' + curve);
26729 buf.writeBuffer(inner.toBuffer());
26730 return (buf.toBuffer());
26731 }
26732 throw (new Error('Invalid signature format'));
26733 default:
26734 throw (new Error('Invalid signature data'));
26735 }
26736};
26737
26738Signature.prototype.toString = function (format) {
26739 assert.optionalString(format, 'format');
26740 return (this.toBuffer(format).toString('base64'));
26741};
26742
26743Signature.parse = function (data, type, format) {
26744 if (typeof (data) === 'string')
26745 data = Buffer.from(data, 'base64');
26746 assert.buffer(data, 'data');
26747 assert.string(format, 'format');
26748 assert.string(type, 'type');
26749
26750 var opts = {};
26751 opts.type = type.toLowerCase();
26752 opts.parts = [];
26753
26754 try {
26755 assert.ok(data.length > 0, 'signature must not be empty');
26756 switch (opts.type) {
26757 case 'rsa':
26758 return (parseOneNum(data, type, format, opts));
26759 case 'ed25519':
26760 return (parseOneNum(data, type, format, opts));
26761
26762 case 'dsa':
26763 case 'ecdsa':
26764 if (format === 'asn1')
26765 return (parseDSAasn1(data, type, format, opts));
26766 else if (opts.type === 'dsa')
26767 return (parseDSA(data, type, format, opts));
26768 else
26769 return (parseECDSA(data, type, format, opts));
26770
26771 default:
26772 throw (new InvalidAlgorithmError(type));
26773 }
26774
26775 } catch (e) {
26776 if (e instanceof InvalidAlgorithmError)
26777 throw (e);
26778 throw (new SignatureParseError(type, format, e));
26779 }
26780};
26781
26782function parseOneNum(data, type, format, opts) {
26783 if (format === 'ssh') {
26784 try {
26785 var buf = new SSHBuffer({buffer: data});
26786 var head = buf.readString();
26787 } catch (e) {
26788 /* fall through */
26789 }
26790 if (buf !== undefined) {
26791 var msg = 'SSH signature does not match expected ' +
26792 'type (expected ' + type + ', got ' + head + ')';
26793 switch (head) {
26794 case 'ssh-rsa':
26795 assert.strictEqual(type, 'rsa', msg);
26796 opts.hashAlgo = 'sha1';
26797 break;
26798 case 'rsa-sha2-256':
26799 assert.strictEqual(type, 'rsa', msg);
26800 opts.hashAlgo = 'sha256';
26801 break;
26802 case 'rsa-sha2-512':
26803 assert.strictEqual(type, 'rsa', msg);
26804 opts.hashAlgo = 'sha512';
26805 break;
26806 case 'ssh-ed25519':
26807 assert.strictEqual(type, 'ed25519', msg);
26808 opts.hashAlgo = 'sha512';
26809 break;
26810 default:
26811 throw (new Error('Unknown SSH signature ' +
26812 'type: ' + head));
26813 }
26814 var sig = buf.readPart();
26815 assert.ok(buf.atEnd(), 'extra trailing bytes');
26816 sig.name = 'sig';
26817 opts.parts.push(sig);
26818 return (new Signature(opts));
26819 }
26820 }
26821 opts.parts.push({name: 'sig', data: data});
26822 return (new Signature(opts));
26823}
26824
26825function parseDSAasn1(data, type, format, opts) {
26826 var der = new asn1.BerReader(data);
26827 der.readSequence();
26828 var r = der.readString(asn1.Ber.Integer, true);
26829 var s = der.readString(asn1.Ber.Integer, true);
26830
26831 opts.parts.push({name: 'r', data: utils.mpNormalize(r)});
26832 opts.parts.push({name: 's', data: utils.mpNormalize(s)});
26833
26834 return (new Signature(opts));
26835}
26836
26837function parseDSA(data, type, format, opts) {
26838 if (data.length != 40) {
26839 var buf = new SSHBuffer({buffer: data});
26840 var d = buf.readBuffer();
26841 if (d.toString('ascii') === 'ssh-dss')
26842 d = buf.readBuffer();
26843 assert.ok(buf.atEnd(), 'extra trailing bytes');
26844 assert.strictEqual(d.length, 40, 'invalid inner length');
26845 data = d;
26846 }
26847 opts.parts.push({name: 'r', data: data.slice(0, 20)});
26848 opts.parts.push({name: 's', data: data.slice(20, 40)});
26849 return (new Signature(opts));
26850}
26851
26852function parseECDSA(data, type, format, opts) {
26853 var buf = new SSHBuffer({buffer: data});
26854
26855 var r, s;
26856 var inner = buf.readBuffer();
26857 var stype = inner.toString('ascii');
26858 if (stype.slice(0, 6) === 'ecdsa-') {
26859 var parts = stype.split('-');
26860 assert.strictEqual(parts[0], 'ecdsa');
26861 assert.strictEqual(parts[1], 'sha2');
26862 opts.curve = parts[2];
26863 switch (opts.curve) {
26864 case 'nistp256':
26865 opts.hashAlgo = 'sha256';
26866 break;
26867 case 'nistp384':
26868 opts.hashAlgo = 'sha384';
26869 break;
26870 case 'nistp521':
26871 opts.hashAlgo = 'sha512';
26872 break;
26873 default:
26874 throw (new Error('Unsupported ECDSA curve: ' +
26875 opts.curve));
26876 }
26877 inner = buf.readBuffer();
26878 assert.ok(buf.atEnd(), 'extra trailing bytes on outer');
26879 buf = new SSHBuffer({buffer: inner});
26880 r = buf.readPart();
26881 } else {
26882 r = {data: inner};
26883 }
26884
26885 s = buf.readPart();
26886 assert.ok(buf.atEnd(), 'extra trailing bytes');
26887
26888 r.name = 'r';
26889 s.name = 's';
26890
26891 opts.parts.push(r);
26892 opts.parts.push(s);
26893 return (new Signature(opts));
26894}
26895
26896Signature.isSignature = function (obj, ver) {
26897 return (utils.isCompatible(obj, Signature, ver));
26898};
26899
26900/*
26901 * API versions for Signature:
26902 * [1,0] -- initial ver
26903 * [2,0] -- support for rsa in full ssh format, compat with sshpk-agent
26904 * hashAlgorithm property
26905 * [2,1] -- first tagged version
26906 */
26907Signature.prototype._sshpkApiVersion = [2, 1];
26908
26909Signature._oldVersionDetect = function (obj) {
26910 assert.func(obj.toBuffer);
26911 if (obj.hasOwnProperty('hashAlgorithm'))
26912 return ([2, 0]);
26913 return ([1, 0]);
26914};
26915
26916
26917/***/ }),
26918/* 71 */
26919/***/ (function(module, exports, __webpack_require__) {
26920
26921(function(nacl) {
26922'use strict';
26923
26924// Ported in 2014 by Dmitry Chestnykh and Devi Mandiri.
26925// Public domain.
26926//
26927// Implementation derived from TweetNaCl version 20140427.
26928// See for details: http://tweetnacl.cr.yp.to/
26929
26930var gf = function(init) {
26931 var i, r = new Float64Array(16);
26932 if (init) for (i = 0; i < init.length; i++) r[i] = init[i];
26933 return r;
26934};
26935
26936// Pluggable, initialized in high-level API below.
26937var randombytes = function(/* x, n */) { throw new Error('no PRNG'); };
26938
26939var _0 = new Uint8Array(16);
26940var _9 = new Uint8Array(32); _9[0] = 9;
26941
26942var gf0 = gf(),
26943 gf1 = gf([1]),
26944 _121665 = gf([0xdb41, 1]),
26945 D = gf([0x78a3, 0x1359, 0x4dca, 0x75eb, 0xd8ab, 0x4141, 0x0a4d, 0x0070, 0xe898, 0x7779, 0x4079, 0x8cc7, 0xfe73, 0x2b6f, 0x6cee, 0x5203]),
26946 D2 = gf([0xf159, 0x26b2, 0x9b94, 0xebd6, 0xb156, 0x8283, 0x149a, 0x00e0, 0xd130, 0xeef3, 0x80f2, 0x198e, 0xfce7, 0x56df, 0xd9dc, 0x2406]),
26947 X = gf([0xd51a, 0x8f25, 0x2d60, 0xc956, 0xa7b2, 0x9525, 0xc760, 0x692c, 0xdc5c, 0xfdd6, 0xe231, 0xc0a4, 0x53fe, 0xcd6e, 0x36d3, 0x2169]),
26948 Y = gf([0x6658, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666, 0x6666]),
26949 I = gf([0xa0b0, 0x4a0e, 0x1b27, 0xc4ee, 0xe478, 0xad2f, 0x1806, 0x2f43, 0xd7a7, 0x3dfb, 0x0099, 0x2b4d, 0xdf0b, 0x4fc1, 0x2480, 0x2b83]);
26950
26951function ts64(x, i, h, l) {
26952 x[i] = (h >> 24) & 0xff;
26953 x[i+1] = (h >> 16) & 0xff;
26954 x[i+2] = (h >> 8) & 0xff;
26955 x[i+3] = h & 0xff;
26956 x[i+4] = (l >> 24) & 0xff;
26957 x[i+5] = (l >> 16) & 0xff;
26958 x[i+6] = (l >> 8) & 0xff;
26959 x[i+7] = l & 0xff;
26960}
26961
26962function vn(x, xi, y, yi, n) {
26963 var i,d = 0;
26964 for (i = 0; i < n; i++) d |= x[xi+i]^y[yi+i];
26965 return (1 & ((d - 1) >>> 8)) - 1;
26966}
26967
26968function crypto_verify_16(x, xi, y, yi) {
26969 return vn(x,xi,y,yi,16);
26970}
26971
26972function crypto_verify_32(x, xi, y, yi) {
26973 return vn(x,xi,y,yi,32);
26974}
26975
26976function core_salsa20(o, p, k, c) {
26977 var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,
26978 j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,
26979 j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,
26980 j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,
26981 j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,
26982 j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,
26983 j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,
26984 j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,
26985 j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,
26986 j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,
26987 j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,
26988 j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,
26989 j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,
26990 j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,
26991 j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,
26992 j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;
26993
26994 var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,
26995 x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,
26996 x15 = j15, u;
26997
26998 for (var i = 0; i < 20; i += 2) {
26999 u = x0 + x12 | 0;
27000 x4 ^= u<<7 | u>>>(32-7);
27001 u = x4 + x0 | 0;
27002 x8 ^= u<<9 | u>>>(32-9);
27003 u = x8 + x4 | 0;
27004 x12 ^= u<<13 | u>>>(32-13);
27005 u = x12 + x8 | 0;
27006 x0 ^= u<<18 | u>>>(32-18);
27007
27008 u = x5 + x1 | 0;
27009 x9 ^= u<<7 | u>>>(32-7);
27010 u = x9 + x5 | 0;
27011 x13 ^= u<<9 | u>>>(32-9);
27012 u = x13 + x9 | 0;
27013 x1 ^= u<<13 | u>>>(32-13);
27014 u = x1 + x13 | 0;
27015 x5 ^= u<<18 | u>>>(32-18);
27016
27017 u = x10 + x6 | 0;
27018 x14 ^= u<<7 | u>>>(32-7);
27019 u = x14 + x10 | 0;
27020 x2 ^= u<<9 | u>>>(32-9);
27021 u = x2 + x14 | 0;
27022 x6 ^= u<<13 | u>>>(32-13);
27023 u = x6 + x2 | 0;
27024 x10 ^= u<<18 | u>>>(32-18);
27025
27026 u = x15 + x11 | 0;
27027 x3 ^= u<<7 | u>>>(32-7);
27028 u = x3 + x15 | 0;
27029 x7 ^= u<<9 | u>>>(32-9);
27030 u = x7 + x3 | 0;
27031 x11 ^= u<<13 | u>>>(32-13);
27032 u = x11 + x7 | 0;
27033 x15 ^= u<<18 | u>>>(32-18);
27034
27035 u = x0 + x3 | 0;
27036 x1 ^= u<<7 | u>>>(32-7);
27037 u = x1 + x0 | 0;
27038 x2 ^= u<<9 | u>>>(32-9);
27039 u = x2 + x1 | 0;
27040 x3 ^= u<<13 | u>>>(32-13);
27041 u = x3 + x2 | 0;
27042 x0 ^= u<<18 | u>>>(32-18);
27043
27044 u = x5 + x4 | 0;
27045 x6 ^= u<<7 | u>>>(32-7);
27046 u = x6 + x5 | 0;
27047 x7 ^= u<<9 | u>>>(32-9);
27048 u = x7 + x6 | 0;
27049 x4 ^= u<<13 | u>>>(32-13);
27050 u = x4 + x7 | 0;
27051 x5 ^= u<<18 | u>>>(32-18);
27052
27053 u = x10 + x9 | 0;
27054 x11 ^= u<<7 | u>>>(32-7);
27055 u = x11 + x10 | 0;
27056 x8 ^= u<<9 | u>>>(32-9);
27057 u = x8 + x11 | 0;
27058 x9 ^= u<<13 | u>>>(32-13);
27059 u = x9 + x8 | 0;
27060 x10 ^= u<<18 | u>>>(32-18);
27061
27062 u = x15 + x14 | 0;
27063 x12 ^= u<<7 | u>>>(32-7);
27064 u = x12 + x15 | 0;
27065 x13 ^= u<<9 | u>>>(32-9);
27066 u = x13 + x12 | 0;
27067 x14 ^= u<<13 | u>>>(32-13);
27068 u = x14 + x13 | 0;
27069 x15 ^= u<<18 | u>>>(32-18);
27070 }
27071 x0 = x0 + j0 | 0;
27072 x1 = x1 + j1 | 0;
27073 x2 = x2 + j2 | 0;
27074 x3 = x3 + j3 | 0;
27075 x4 = x4 + j4 | 0;
27076 x5 = x5 + j5 | 0;
27077 x6 = x6 + j6 | 0;
27078 x7 = x7 + j7 | 0;
27079 x8 = x8 + j8 | 0;
27080 x9 = x9 + j9 | 0;
27081 x10 = x10 + j10 | 0;
27082 x11 = x11 + j11 | 0;
27083 x12 = x12 + j12 | 0;
27084 x13 = x13 + j13 | 0;
27085 x14 = x14 + j14 | 0;
27086 x15 = x15 + j15 | 0;
27087
27088 o[ 0] = x0 >>> 0 & 0xff;
27089 o[ 1] = x0 >>> 8 & 0xff;
27090 o[ 2] = x0 >>> 16 & 0xff;
27091 o[ 3] = x0 >>> 24 & 0xff;
27092
27093 o[ 4] = x1 >>> 0 & 0xff;
27094 o[ 5] = x1 >>> 8 & 0xff;
27095 o[ 6] = x1 >>> 16 & 0xff;
27096 o[ 7] = x1 >>> 24 & 0xff;
27097
27098 o[ 8] = x2 >>> 0 & 0xff;
27099 o[ 9] = x2 >>> 8 & 0xff;
27100 o[10] = x2 >>> 16 & 0xff;
27101 o[11] = x2 >>> 24 & 0xff;
27102
27103 o[12] = x3 >>> 0 & 0xff;
27104 o[13] = x3 >>> 8 & 0xff;
27105 o[14] = x3 >>> 16 & 0xff;
27106 o[15] = x3 >>> 24 & 0xff;
27107
27108 o[16] = x4 >>> 0 & 0xff;
27109 o[17] = x4 >>> 8 & 0xff;
27110 o[18] = x4 >>> 16 & 0xff;
27111 o[19] = x4 >>> 24 & 0xff;
27112
27113 o[20] = x5 >>> 0 & 0xff;
27114 o[21] = x5 >>> 8 & 0xff;
27115 o[22] = x5 >>> 16 & 0xff;
27116 o[23] = x5 >>> 24 & 0xff;
27117
27118 o[24] = x6 >>> 0 & 0xff;
27119 o[25] = x6 >>> 8 & 0xff;
27120 o[26] = x6 >>> 16 & 0xff;
27121 o[27] = x6 >>> 24 & 0xff;
27122
27123 o[28] = x7 >>> 0 & 0xff;
27124 o[29] = x7 >>> 8 & 0xff;
27125 o[30] = x7 >>> 16 & 0xff;
27126 o[31] = x7 >>> 24 & 0xff;
27127
27128 o[32] = x8 >>> 0 & 0xff;
27129 o[33] = x8 >>> 8 & 0xff;
27130 o[34] = x8 >>> 16 & 0xff;
27131 o[35] = x8 >>> 24 & 0xff;
27132
27133 o[36] = x9 >>> 0 & 0xff;
27134 o[37] = x9 >>> 8 & 0xff;
27135 o[38] = x9 >>> 16 & 0xff;
27136 o[39] = x9 >>> 24 & 0xff;
27137
27138 o[40] = x10 >>> 0 & 0xff;
27139 o[41] = x10 >>> 8 & 0xff;
27140 o[42] = x10 >>> 16 & 0xff;
27141 o[43] = x10 >>> 24 & 0xff;
27142
27143 o[44] = x11 >>> 0 & 0xff;
27144 o[45] = x11 >>> 8 & 0xff;
27145 o[46] = x11 >>> 16 & 0xff;
27146 o[47] = x11 >>> 24 & 0xff;
27147
27148 o[48] = x12 >>> 0 & 0xff;
27149 o[49] = x12 >>> 8 & 0xff;
27150 o[50] = x12 >>> 16 & 0xff;
27151 o[51] = x12 >>> 24 & 0xff;
27152
27153 o[52] = x13 >>> 0 & 0xff;
27154 o[53] = x13 >>> 8 & 0xff;
27155 o[54] = x13 >>> 16 & 0xff;
27156 o[55] = x13 >>> 24 & 0xff;
27157
27158 o[56] = x14 >>> 0 & 0xff;
27159 o[57] = x14 >>> 8 & 0xff;
27160 o[58] = x14 >>> 16 & 0xff;
27161 o[59] = x14 >>> 24 & 0xff;
27162
27163 o[60] = x15 >>> 0 & 0xff;
27164 o[61] = x15 >>> 8 & 0xff;
27165 o[62] = x15 >>> 16 & 0xff;
27166 o[63] = x15 >>> 24 & 0xff;
27167}
27168
27169function core_hsalsa20(o,p,k,c) {
27170 var j0 = c[ 0] & 0xff | (c[ 1] & 0xff)<<8 | (c[ 2] & 0xff)<<16 | (c[ 3] & 0xff)<<24,
27171 j1 = k[ 0] & 0xff | (k[ 1] & 0xff)<<8 | (k[ 2] & 0xff)<<16 | (k[ 3] & 0xff)<<24,
27172 j2 = k[ 4] & 0xff | (k[ 5] & 0xff)<<8 | (k[ 6] & 0xff)<<16 | (k[ 7] & 0xff)<<24,
27173 j3 = k[ 8] & 0xff | (k[ 9] & 0xff)<<8 | (k[10] & 0xff)<<16 | (k[11] & 0xff)<<24,
27174 j4 = k[12] & 0xff | (k[13] & 0xff)<<8 | (k[14] & 0xff)<<16 | (k[15] & 0xff)<<24,
27175 j5 = c[ 4] & 0xff | (c[ 5] & 0xff)<<8 | (c[ 6] & 0xff)<<16 | (c[ 7] & 0xff)<<24,
27176 j6 = p[ 0] & 0xff | (p[ 1] & 0xff)<<8 | (p[ 2] & 0xff)<<16 | (p[ 3] & 0xff)<<24,
27177 j7 = p[ 4] & 0xff | (p[ 5] & 0xff)<<8 | (p[ 6] & 0xff)<<16 | (p[ 7] & 0xff)<<24,
27178 j8 = p[ 8] & 0xff | (p[ 9] & 0xff)<<8 | (p[10] & 0xff)<<16 | (p[11] & 0xff)<<24,
27179 j9 = p[12] & 0xff | (p[13] & 0xff)<<8 | (p[14] & 0xff)<<16 | (p[15] & 0xff)<<24,
27180 j10 = c[ 8] & 0xff | (c[ 9] & 0xff)<<8 | (c[10] & 0xff)<<16 | (c[11] & 0xff)<<24,
27181 j11 = k[16] & 0xff | (k[17] & 0xff)<<8 | (k[18] & 0xff)<<16 | (k[19] & 0xff)<<24,
27182 j12 = k[20] & 0xff | (k[21] & 0xff)<<8 | (k[22] & 0xff)<<16 | (k[23] & 0xff)<<24,
27183 j13 = k[24] & 0xff | (k[25] & 0xff)<<8 | (k[26] & 0xff)<<16 | (k[27] & 0xff)<<24,
27184 j14 = k[28] & 0xff | (k[29] & 0xff)<<8 | (k[30] & 0xff)<<16 | (k[31] & 0xff)<<24,
27185 j15 = c[12] & 0xff | (c[13] & 0xff)<<8 | (c[14] & 0xff)<<16 | (c[15] & 0xff)<<24;
27186
27187 var x0 = j0, x1 = j1, x2 = j2, x3 = j3, x4 = j4, x5 = j5, x6 = j6, x7 = j7,
27188 x8 = j8, x9 = j9, x10 = j10, x11 = j11, x12 = j12, x13 = j13, x14 = j14,
27189 x15 = j15, u;
27190
27191 for (var i = 0; i < 20; i += 2) {
27192 u = x0 + x12 | 0;
27193 x4 ^= u<<7 | u>>>(32-7);
27194 u = x4 + x0 | 0;
27195 x8 ^= u<<9 | u>>>(32-9);
27196 u = x8 + x4 | 0;
27197 x12 ^= u<<13 | u>>>(32-13);
27198 u = x12 + x8 | 0;
27199 x0 ^= u<<18 | u>>>(32-18);
27200
27201 u = x5 + x1 | 0;
27202 x9 ^= u<<7 | u>>>(32-7);
27203 u = x9 + x5 | 0;
27204 x13 ^= u<<9 | u>>>(32-9);
27205 u = x13 + x9 | 0;
27206 x1 ^= u<<13 | u>>>(32-13);
27207 u = x1 + x13 | 0;
27208 x5 ^= u<<18 | u>>>(32-18);
27209
27210 u = x10 + x6 | 0;
27211 x14 ^= u<<7 | u>>>(32-7);
27212 u = x14 + x10 | 0;
27213 x2 ^= u<<9 | u>>>(32-9);
27214 u = x2 + x14 | 0;
27215 x6 ^= u<<13 | u>>>(32-13);
27216 u = x6 + x2 | 0;
27217 x10 ^= u<<18 | u>>>(32-18);
27218
27219 u = x15 + x11 | 0;
27220 x3 ^= u<<7 | u>>>(32-7);
27221 u = x3 + x15 | 0;
27222 x7 ^= u<<9 | u>>>(32-9);
27223 u = x7 + x3 | 0;
27224 x11 ^= u<<13 | u>>>(32-13);
27225 u = x11 + x7 | 0;
27226 x15 ^= u<<18 | u>>>(32-18);
27227
27228 u = x0 + x3 | 0;
27229 x1 ^= u<<7 | u>>>(32-7);
27230 u = x1 + x0 | 0;
27231 x2 ^= u<<9 | u>>>(32-9);
27232 u = x2 + x1 | 0;
27233 x3 ^= u<<13 | u>>>(32-13);
27234 u = x3 + x2 | 0;
27235 x0 ^= u<<18 | u>>>(32-18);
27236
27237 u = x5 + x4 | 0;
27238 x6 ^= u<<7 | u>>>(32-7);
27239 u = x6 + x5 | 0;
27240 x7 ^= u<<9 | u>>>(32-9);
27241 u = x7 + x6 | 0;
27242 x4 ^= u<<13 | u>>>(32-13);
27243 u = x4 + x7 | 0;
27244 x5 ^= u<<18 | u>>>(32-18);
27245
27246 u = x10 + x9 | 0;
27247 x11 ^= u<<7 | u>>>(32-7);
27248 u = x11 + x10 | 0;
27249 x8 ^= u<<9 | u>>>(32-9);
27250 u = x8 + x11 | 0;
27251 x9 ^= u<<13 | u>>>(32-13);
27252 u = x9 + x8 | 0;
27253 x10 ^= u<<18 | u>>>(32-18);
27254
27255 u = x15 + x14 | 0;
27256 x12 ^= u<<7 | u>>>(32-7);
27257 u = x12 + x15 | 0;
27258 x13 ^= u<<9 | u>>>(32-9);
27259 u = x13 + x12 | 0;
27260 x14 ^= u<<13 | u>>>(32-13);
27261 u = x14 + x13 | 0;
27262 x15 ^= u<<18 | u>>>(32-18);
27263 }
27264
27265 o[ 0] = x0 >>> 0 & 0xff;
27266 o[ 1] = x0 >>> 8 & 0xff;
27267 o[ 2] = x0 >>> 16 & 0xff;
27268 o[ 3] = x0 >>> 24 & 0xff;
27269
27270 o[ 4] = x5 >>> 0 & 0xff;
27271 o[ 5] = x5 >>> 8 & 0xff;
27272 o[ 6] = x5 >>> 16 & 0xff;
27273 o[ 7] = x5 >>> 24 & 0xff;
27274
27275 o[ 8] = x10 >>> 0 & 0xff;
27276 o[ 9] = x10 >>> 8 & 0xff;
27277 o[10] = x10 >>> 16 & 0xff;
27278 o[11] = x10 >>> 24 & 0xff;
27279
27280 o[12] = x15 >>> 0 & 0xff;
27281 o[13] = x15 >>> 8 & 0xff;
27282 o[14] = x15 >>> 16 & 0xff;
27283 o[15] = x15 >>> 24 & 0xff;
27284
27285 o[16] = x6 >>> 0 & 0xff;
27286 o[17] = x6 >>> 8 & 0xff;
27287 o[18] = x6 >>> 16 & 0xff;
27288 o[19] = x6 >>> 24 & 0xff;
27289
27290 o[20] = x7 >>> 0 & 0xff;
27291 o[21] = x7 >>> 8 & 0xff;
27292 o[22] = x7 >>> 16 & 0xff;
27293 o[23] = x7 >>> 24 & 0xff;
27294
27295 o[24] = x8 >>> 0 & 0xff;
27296 o[25] = x8 >>> 8 & 0xff;
27297 o[26] = x8 >>> 16 & 0xff;
27298 o[27] = x8 >>> 24 & 0xff;
27299
27300 o[28] = x9 >>> 0 & 0xff;
27301 o[29] = x9 >>> 8 & 0xff;
27302 o[30] = x9 >>> 16 & 0xff;
27303 o[31] = x9 >>> 24 & 0xff;
27304}
27305
27306function crypto_core_salsa20(out,inp,k,c) {
27307 core_salsa20(out,inp,k,c);
27308}
27309
27310function crypto_core_hsalsa20(out,inp,k,c) {
27311 core_hsalsa20(out,inp,k,c);
27312}
27313
27314var sigma = new Uint8Array([101, 120, 112, 97, 110, 100, 32, 51, 50, 45, 98, 121, 116, 101, 32, 107]);
27315 // "expand 32-byte k"
27316
27317function crypto_stream_salsa20_xor(c,cpos,m,mpos,b,n,k) {
27318 var z = new Uint8Array(16), x = new Uint8Array(64);
27319 var u, i;
27320 for (i = 0; i < 16; i++) z[i] = 0;
27321 for (i = 0; i < 8; i++) z[i] = n[i];
27322 while (b >= 64) {
27323 crypto_core_salsa20(x,z,k,sigma);
27324 for (i = 0; i < 64; i++) c[cpos+i] = m[mpos+i] ^ x[i];
27325 u = 1;
27326 for (i = 8; i < 16; i++) {
27327 u = u + (z[i] & 0xff) | 0;
27328 z[i] = u & 0xff;
27329 u >>>= 8;
27330 }
27331 b -= 64;
27332 cpos += 64;
27333 mpos += 64;
27334 }
27335 if (b > 0) {
27336 crypto_core_salsa20(x,z,k,sigma);
27337 for (i = 0; i < b; i++) c[cpos+i] = m[mpos+i] ^ x[i];
27338 }
27339 return 0;
27340}
27341
27342function crypto_stream_salsa20(c,cpos,b,n,k) {
27343 var z = new Uint8Array(16), x = new Uint8Array(64);
27344 var u, i;
27345 for (i = 0; i < 16; i++) z[i] = 0;
27346 for (i = 0; i < 8; i++) z[i] = n[i];
27347 while (b >= 64) {
27348 crypto_core_salsa20(x,z,k,sigma);
27349 for (i = 0; i < 64; i++) c[cpos+i] = x[i];
27350 u = 1;
27351 for (i = 8; i < 16; i++) {
27352 u = u + (z[i] & 0xff) | 0;
27353 z[i] = u & 0xff;
27354 u >>>= 8;
27355 }
27356 b -= 64;
27357 cpos += 64;
27358 }
27359 if (b > 0) {
27360 crypto_core_salsa20(x,z,k,sigma);
27361 for (i = 0; i < b; i++) c[cpos+i] = x[i];
27362 }
27363 return 0;
27364}
27365
27366function crypto_stream(c,cpos,d,n,k) {
27367 var s = new Uint8Array(32);
27368 crypto_core_hsalsa20(s,n,k,sigma);
27369 var sn = new Uint8Array(8);
27370 for (var i = 0; i < 8; i++) sn[i] = n[i+16];
27371 return crypto_stream_salsa20(c,cpos,d,sn,s);
27372}
27373
27374function crypto_stream_xor(c,cpos,m,mpos,d,n,k) {
27375 var s = new Uint8Array(32);
27376 crypto_core_hsalsa20(s,n,k,sigma);
27377 var sn = new Uint8Array(8);
27378 for (var i = 0; i < 8; i++) sn[i] = n[i+16];
27379 return crypto_stream_salsa20_xor(c,cpos,m,mpos,d,sn,s);
27380}
27381
27382/*
27383* Port of Andrew Moon's Poly1305-donna-16. Public domain.
27384* https://github.com/floodyberry/poly1305-donna
27385*/
27386
27387var poly1305 = function(key) {
27388 this.buffer = new Uint8Array(16);
27389 this.r = new Uint16Array(10);
27390 this.h = new Uint16Array(10);
27391 this.pad = new Uint16Array(8);
27392 this.leftover = 0;
27393 this.fin = 0;
27394
27395 var t0, t1, t2, t3, t4, t5, t6, t7;
27396
27397 t0 = key[ 0] & 0xff | (key[ 1] & 0xff) << 8; this.r[0] = ( t0 ) & 0x1fff;
27398 t1 = key[ 2] & 0xff | (key[ 3] & 0xff) << 8; this.r[1] = ((t0 >>> 13) | (t1 << 3)) & 0x1fff;
27399 t2 = key[ 4] & 0xff | (key[ 5] & 0xff) << 8; this.r[2] = ((t1 >>> 10) | (t2 << 6)) & 0x1f03;
27400 t3 = key[ 6] & 0xff | (key[ 7] & 0xff) << 8; this.r[3] = ((t2 >>> 7) | (t3 << 9)) & 0x1fff;
27401 t4 = key[ 8] & 0xff | (key[ 9] & 0xff) << 8; this.r[4] = ((t3 >>> 4) | (t4 << 12)) & 0x00ff;
27402 this.r[5] = ((t4 >>> 1)) & 0x1ffe;
27403 t5 = key[10] & 0xff | (key[11] & 0xff) << 8; this.r[6] = ((t4 >>> 14) | (t5 << 2)) & 0x1fff;
27404 t6 = key[12] & 0xff | (key[13] & 0xff) << 8; this.r[7] = ((t5 >>> 11) | (t6 << 5)) & 0x1f81;
27405 t7 = key[14] & 0xff | (key[15] & 0xff) << 8; this.r[8] = ((t6 >>> 8) | (t7 << 8)) & 0x1fff;
27406 this.r[9] = ((t7 >>> 5)) & 0x007f;
27407
27408 this.pad[0] = key[16] & 0xff | (key[17] & 0xff) << 8;
27409 this.pad[1] = key[18] & 0xff | (key[19] & 0xff) << 8;
27410 this.pad[2] = key[20] & 0xff | (key[21] & 0xff) << 8;
27411 this.pad[3] = key[22] & 0xff | (key[23] & 0xff) << 8;
27412 this.pad[4] = key[24] & 0xff | (key[25] & 0xff) << 8;
27413 this.pad[5] = key[26] & 0xff | (key[27] & 0xff) << 8;
27414 this.pad[6] = key[28] & 0xff | (key[29] & 0xff) << 8;
27415 this.pad[7] = key[30] & 0xff | (key[31] & 0xff) << 8;
27416};
27417
27418poly1305.prototype.blocks = function(m, mpos, bytes) {
27419 var hibit = this.fin ? 0 : (1 << 11);
27420 var t0, t1, t2, t3, t4, t5, t6, t7, c;
27421 var d0, d1, d2, d3, d4, d5, d6, d7, d8, d9;
27422
27423 var h0 = this.h[0],
27424 h1 = this.h[1],
27425 h2 = this.h[2],
27426 h3 = this.h[3],
27427 h4 = this.h[4],
27428 h5 = this.h[5],
27429 h6 = this.h[6],
27430 h7 = this.h[7],
27431 h8 = this.h[8],
27432 h9 = this.h[9];
27433
27434 var r0 = this.r[0],
27435 r1 = this.r[1],
27436 r2 = this.r[2],
27437 r3 = this.r[3],
27438 r4 = this.r[4],
27439 r5 = this.r[5],
27440 r6 = this.r[6],
27441 r7 = this.r[7],
27442 r8 = this.r[8],
27443 r9 = this.r[9];
27444
27445 while (bytes >= 16) {
27446 t0 = m[mpos+ 0] & 0xff | (m[mpos+ 1] & 0xff) << 8; h0 += ( t0 ) & 0x1fff;
27447 t1 = m[mpos+ 2] & 0xff | (m[mpos+ 3] & 0xff) << 8; h1 += ((t0 >>> 13) | (t1 << 3)) & 0x1fff;
27448 t2 = m[mpos+ 4] & 0xff | (m[mpos+ 5] & 0xff) << 8; h2 += ((t1 >>> 10) | (t2 << 6)) & 0x1fff;
27449 t3 = m[mpos+ 6] & 0xff | (m[mpos+ 7] & 0xff) << 8; h3 += ((t2 >>> 7) | (t3 << 9)) & 0x1fff;
27450 t4 = m[mpos+ 8] & 0xff | (m[mpos+ 9] & 0xff) << 8; h4 += ((t3 >>> 4) | (t4 << 12)) & 0x1fff;
27451 h5 += ((t4 >>> 1)) & 0x1fff;
27452 t5 = m[mpos+10] & 0xff | (m[mpos+11] & 0xff) << 8; h6 += ((t4 >>> 14) | (t5 << 2)) & 0x1fff;
27453 t6 = m[mpos+12] & 0xff | (m[mpos+13] & 0xff) << 8; h7 += ((t5 >>> 11) | (t6 << 5)) & 0x1fff;
27454 t7 = m[mpos+14] & 0xff | (m[mpos+15] & 0xff) << 8; h8 += ((t6 >>> 8) | (t7 << 8)) & 0x1fff;
27455 h9 += ((t7 >>> 5)) | hibit;
27456
27457 c = 0;
27458
27459 d0 = c;
27460 d0 += h0 * r0;
27461 d0 += h1 * (5 * r9);
27462 d0 += h2 * (5 * r8);
27463 d0 += h3 * (5 * r7);
27464 d0 += h4 * (5 * r6);
27465 c = (d0 >>> 13); d0 &= 0x1fff;
27466 d0 += h5 * (5 * r5);
27467 d0 += h6 * (5 * r4);
27468 d0 += h7 * (5 * r3);
27469 d0 += h8 * (5 * r2);
27470 d0 += h9 * (5 * r1);
27471 c += (d0 >>> 13); d0 &= 0x1fff;
27472
27473 d1 = c;
27474 d1 += h0 * r1;
27475 d1 += h1 * r0;
27476 d1 += h2 * (5 * r9);
27477 d1 += h3 * (5 * r8);
27478 d1 += h4 * (5 * r7);
27479 c = (d1 >>> 13); d1 &= 0x1fff;
27480 d1 += h5 * (5 * r6);
27481 d1 += h6 * (5 * r5);
27482 d1 += h7 * (5 * r4);
27483 d1 += h8 * (5 * r3);
27484 d1 += h9 * (5 * r2);
27485 c += (d1 >>> 13); d1 &= 0x1fff;
27486
27487 d2 = c;
27488 d2 += h0 * r2;
27489 d2 += h1 * r1;
27490 d2 += h2 * r0;
27491 d2 += h3 * (5 * r9);
27492 d2 += h4 * (5 * r8);
27493 c = (d2 >>> 13); d2 &= 0x1fff;
27494 d2 += h5 * (5 * r7);
27495 d2 += h6 * (5 * r6);
27496 d2 += h7 * (5 * r5);
27497 d2 += h8 * (5 * r4);
27498 d2 += h9 * (5 * r3);
27499 c += (d2 >>> 13); d2 &= 0x1fff;
27500
27501 d3 = c;
27502 d3 += h0 * r3;
27503 d3 += h1 * r2;
27504 d3 += h2 * r1;
27505 d3 += h3 * r0;
27506 d3 += h4 * (5 * r9);
27507 c = (d3 >>> 13); d3 &= 0x1fff;
27508 d3 += h5 * (5 * r8);
27509 d3 += h6 * (5 * r7);
27510 d3 += h7 * (5 * r6);
27511 d3 += h8 * (5 * r5);
27512 d3 += h9 * (5 * r4);
27513 c += (d3 >>> 13); d3 &= 0x1fff;
27514
27515 d4 = c;
27516 d4 += h0 * r4;
27517 d4 += h1 * r3;
27518 d4 += h2 * r2;
27519 d4 += h3 * r1;
27520 d4 += h4 * r0;
27521 c = (d4 >>> 13); d4 &= 0x1fff;
27522 d4 += h5 * (5 * r9);
27523 d4 += h6 * (5 * r8);
27524 d4 += h7 * (5 * r7);
27525 d4 += h8 * (5 * r6);
27526 d4 += h9 * (5 * r5);
27527 c += (d4 >>> 13); d4 &= 0x1fff;
27528
27529 d5 = c;
27530 d5 += h0 * r5;
27531 d5 += h1 * r4;
27532 d5 += h2 * r3;
27533 d5 += h3 * r2;
27534 d5 += h4 * r1;
27535 c = (d5 >>> 13); d5 &= 0x1fff;
27536 d5 += h5 * r0;
27537 d5 += h6 * (5 * r9);
27538 d5 += h7 * (5 * r8);
27539 d5 += h8 * (5 * r7);
27540 d5 += h9 * (5 * r6);
27541 c += (d5 >>> 13); d5 &= 0x1fff;
27542
27543 d6 = c;
27544 d6 += h0 * r6;
27545 d6 += h1 * r5;
27546 d6 += h2 * r4;
27547 d6 += h3 * r3;
27548 d6 += h4 * r2;
27549 c = (d6 >>> 13); d6 &= 0x1fff;
27550 d6 += h5 * r1;
27551 d6 += h6 * r0;
27552 d6 += h7 * (5 * r9);
27553 d6 += h8 * (5 * r8);
27554 d6 += h9 * (5 * r7);
27555 c += (d6 >>> 13); d6 &= 0x1fff;
27556
27557 d7 = c;
27558 d7 += h0 * r7;
27559 d7 += h1 * r6;
27560 d7 += h2 * r5;
27561 d7 += h3 * r4;
27562 d7 += h4 * r3;
27563 c = (d7 >>> 13); d7 &= 0x1fff;
27564 d7 += h5 * r2;
27565 d7 += h6 * r1;
27566 d7 += h7 * r0;
27567 d7 += h8 * (5 * r9);
27568 d7 += h9 * (5 * r8);
27569 c += (d7 >>> 13); d7 &= 0x1fff;
27570
27571 d8 = c;
27572 d8 += h0 * r8;
27573 d8 += h1 * r7;
27574 d8 += h2 * r6;
27575 d8 += h3 * r5;
27576 d8 += h4 * r4;
27577 c = (d8 >>> 13); d8 &= 0x1fff;
27578 d8 += h5 * r3;
27579 d8 += h6 * r2;
27580 d8 += h7 * r1;
27581 d8 += h8 * r0;
27582 d8 += h9 * (5 * r9);
27583 c += (d8 >>> 13); d8 &= 0x1fff;
27584
27585 d9 = c;
27586 d9 += h0 * r9;
27587 d9 += h1 * r8;
27588 d9 += h2 * r7;
27589 d9 += h3 * r6;
27590 d9 += h4 * r5;
27591 c = (d9 >>> 13); d9 &= 0x1fff;
27592 d9 += h5 * r4;
27593 d9 += h6 * r3;
27594 d9 += h7 * r2;
27595 d9 += h8 * r1;
27596 d9 += h9 * r0;
27597 c += (d9 >>> 13); d9 &= 0x1fff;
27598
27599 c = (((c << 2) + c)) | 0;
27600 c = (c + d0) | 0;
27601 d0 = c & 0x1fff;
27602 c = (c >>> 13);
27603 d1 += c;
27604
27605 h0 = d0;
27606 h1 = d1;
27607 h2 = d2;
27608 h3 = d3;
27609 h4 = d4;
27610 h5 = d5;
27611 h6 = d6;
27612 h7 = d7;
27613 h8 = d8;
27614 h9 = d9;
27615
27616 mpos += 16;
27617 bytes -= 16;
27618 }
27619 this.h[0] = h0;
27620 this.h[1] = h1;
27621 this.h[2] = h2;
27622 this.h[3] = h3;
27623 this.h[4] = h4;
27624 this.h[5] = h5;
27625 this.h[6] = h6;
27626 this.h[7] = h7;
27627 this.h[8] = h8;
27628 this.h[9] = h9;
27629};
27630
27631poly1305.prototype.finish = function(mac, macpos) {
27632 var g = new Uint16Array(10);
27633 var c, mask, f, i;
27634
27635 if (this.leftover) {
27636 i = this.leftover;
27637 this.buffer[i++] = 1;
27638 for (; i < 16; i++) this.buffer[i] = 0;
27639 this.fin = 1;
27640 this.blocks(this.buffer, 0, 16);
27641 }
27642
27643 c = this.h[1] >>> 13;
27644 this.h[1] &= 0x1fff;
27645 for (i = 2; i < 10; i++) {
27646 this.h[i] += c;
27647 c = this.h[i] >>> 13;
27648 this.h[i] &= 0x1fff;
27649 }
27650 this.h[0] += (c * 5);
27651 c = this.h[0] >>> 13;
27652 this.h[0] &= 0x1fff;
27653 this.h[1] += c;
27654 c = this.h[1] >>> 13;
27655 this.h[1] &= 0x1fff;
27656 this.h[2] += c;
27657
27658 g[0] = this.h[0] + 5;
27659 c = g[0] >>> 13;
27660 g[0] &= 0x1fff;
27661 for (i = 1; i < 10; i++) {
27662 g[i] = this.h[i] + c;
27663 c = g[i] >>> 13;
27664 g[i] &= 0x1fff;
27665 }
27666 g[9] -= (1 << 13);
27667
27668 mask = (c ^ 1) - 1;
27669 for (i = 0; i < 10; i++) g[i] &= mask;
27670 mask = ~mask;
27671 for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i];
27672
27673 this.h[0] = ((this.h[0] ) | (this.h[1] << 13) ) & 0xffff;
27674 this.h[1] = ((this.h[1] >>> 3) | (this.h[2] << 10) ) & 0xffff;
27675 this.h[2] = ((this.h[2] >>> 6) | (this.h[3] << 7) ) & 0xffff;
27676 this.h[3] = ((this.h[3] >>> 9) | (this.h[4] << 4) ) & 0xffff;
27677 this.h[4] = ((this.h[4] >>> 12) | (this.h[5] << 1) | (this.h[6] << 14)) & 0xffff;
27678 this.h[5] = ((this.h[6] >>> 2) | (this.h[7] << 11) ) & 0xffff;
27679 this.h[6] = ((this.h[7] >>> 5) | (this.h[8] << 8) ) & 0xffff;
27680 this.h[7] = ((this.h[8] >>> 8) | (this.h[9] << 5) ) & 0xffff;
27681
27682 f = this.h[0] + this.pad[0];
27683 this.h[0] = f & 0xffff;
27684 for (i = 1; i < 8; i++) {
27685 f = (((this.h[i] + this.pad[i]) | 0) + (f >>> 16)) | 0;
27686 this.h[i] = f & 0xffff;
27687 }
27688
27689 mac[macpos+ 0] = (this.h[0] >>> 0) & 0xff;
27690 mac[macpos+ 1] = (this.h[0] >>> 8) & 0xff;
27691 mac[macpos+ 2] = (this.h[1] >>> 0) & 0xff;
27692 mac[macpos+ 3] = (this.h[1] >>> 8) & 0xff;
27693 mac[macpos+ 4] = (this.h[2] >>> 0) & 0xff;
27694 mac[macpos+ 5] = (this.h[2] >>> 8) & 0xff;
27695 mac[macpos+ 6] = (this.h[3] >>> 0) & 0xff;
27696 mac[macpos+ 7] = (this.h[3] >>> 8) & 0xff;
27697 mac[macpos+ 8] = (this.h[4] >>> 0) & 0xff;
27698 mac[macpos+ 9] = (this.h[4] >>> 8) & 0xff;
27699 mac[macpos+10] = (this.h[5] >>> 0) & 0xff;
27700 mac[macpos+11] = (this.h[5] >>> 8) & 0xff;
27701 mac[macpos+12] = (this.h[6] >>> 0) & 0xff;
27702 mac[macpos+13] = (this.h[6] >>> 8) & 0xff;
27703 mac[macpos+14] = (this.h[7] >>> 0) & 0xff;
27704 mac[macpos+15] = (this.h[7] >>> 8) & 0xff;
27705};
27706
27707poly1305.prototype.update = function(m, mpos, bytes) {
27708 var i, want;
27709
27710 if (this.leftover) {
27711 want = (16 - this.leftover);
27712 if (want > bytes)
27713 want = bytes;
27714 for (i = 0; i < want; i++)
27715 this.buffer[this.leftover + i] = m[mpos+i];
27716 bytes -= want;
27717 mpos += want;
27718 this.leftover += want;
27719 if (this.leftover < 16)
27720 return;
27721 this.blocks(this.buffer, 0, 16);
27722 this.leftover = 0;
27723 }
27724
27725 if (bytes >= 16) {
27726 want = bytes - (bytes % 16);
27727 this.blocks(m, mpos, want);
27728 mpos += want;
27729 bytes -= want;
27730 }
27731
27732 if (bytes) {
27733 for (i = 0; i < bytes; i++)
27734 this.buffer[this.leftover + i] = m[mpos+i];
27735 this.leftover += bytes;
27736 }
27737};
27738
27739function crypto_onetimeauth(out, outpos, m, mpos, n, k) {
27740 var s = new poly1305(k);
27741 s.update(m, mpos, n);
27742 s.finish(out, outpos);
27743 return 0;
27744}
27745
27746function crypto_onetimeauth_verify(h, hpos, m, mpos, n, k) {
27747 var x = new Uint8Array(16);
27748 crypto_onetimeauth(x,0,m,mpos,n,k);
27749 return crypto_verify_16(h,hpos,x,0);
27750}
27751
27752function crypto_secretbox(c,m,d,n,k) {
27753 var i;
27754 if (d < 32) return -1;
27755 crypto_stream_xor(c,0,m,0,d,n,k);
27756 crypto_onetimeauth(c, 16, c, 32, d - 32, c);
27757 for (i = 0; i < 16; i++) c[i] = 0;
27758 return 0;
27759}
27760
27761function crypto_secretbox_open(m,c,d,n,k) {
27762 var i;
27763 var x = new Uint8Array(32);
27764 if (d < 32) return -1;
27765 crypto_stream(x,0,32,n,k);
27766 if (crypto_onetimeauth_verify(c, 16,c, 32,d - 32,x) !== 0) return -1;
27767 crypto_stream_xor(m,0,c,0,d,n,k);
27768 for (i = 0; i < 32; i++) m[i] = 0;
27769 return 0;
27770}
27771
27772function set25519(r, a) {
27773 var i;
27774 for (i = 0; i < 16; i++) r[i] = a[i]|0;
27775}
27776
27777function car25519(o) {
27778 var i, v, c = 1;
27779 for (i = 0; i < 16; i++) {
27780 v = o[i] + c + 65535;
27781 c = Math.floor(v / 65536);
27782 o[i] = v - c * 65536;
27783 }
27784 o[0] += c-1 + 37 * (c-1);
27785}
27786
27787function sel25519(p, q, b) {
27788 var t, c = ~(b-1);
27789 for (var i = 0; i < 16; i++) {
27790 t = c & (p[i] ^ q[i]);
27791 p[i] ^= t;
27792 q[i] ^= t;
27793 }
27794}
27795
27796function pack25519(o, n) {
27797 var i, j, b;
27798 var m = gf(), t = gf();
27799 for (i = 0; i < 16; i++) t[i] = n[i];
27800 car25519(t);
27801 car25519(t);
27802 car25519(t);
27803 for (j = 0; j < 2; j++) {
27804 m[0] = t[0] - 0xffed;
27805 for (i = 1; i < 15; i++) {
27806 m[i] = t[i] - 0xffff - ((m[i-1]>>16) & 1);
27807 m[i-1] &= 0xffff;
27808 }
27809 m[15] = t[15] - 0x7fff - ((m[14]>>16) & 1);
27810 b = (m[15]>>16) & 1;
27811 m[14] &= 0xffff;
27812 sel25519(t, m, 1-b);
27813 }
27814 for (i = 0; i < 16; i++) {
27815 o[2*i] = t[i] & 0xff;
27816 o[2*i+1] = t[i]>>8;
27817 }
27818}
27819
27820function neq25519(a, b) {
27821 var c = new Uint8Array(32), d = new Uint8Array(32);
27822 pack25519(c, a);
27823 pack25519(d, b);
27824 return crypto_verify_32(c, 0, d, 0);
27825}
27826
27827function par25519(a) {
27828 var d = new Uint8Array(32);
27829 pack25519(d, a);
27830 return d[0] & 1;
27831}
27832
27833function unpack25519(o, n) {
27834 var i;
27835 for (i = 0; i < 16; i++) o[i] = n[2*i] + (n[2*i+1] << 8);
27836 o[15] &= 0x7fff;
27837}
27838
27839function A(o, a, b) {
27840 for (var i = 0; i < 16; i++) o[i] = a[i] + b[i];
27841}
27842
27843function Z(o, a, b) {
27844 for (var i = 0; i < 16; i++) o[i] = a[i] - b[i];
27845}
27846
27847function M(o, a, b) {
27848 var v, c,
27849 t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,
27850 t8 = 0, t9 = 0, t10 = 0, t11 = 0, t12 = 0, t13 = 0, t14 = 0, t15 = 0,
27851 t16 = 0, t17 = 0, t18 = 0, t19 = 0, t20 = 0, t21 = 0, t22 = 0, t23 = 0,
27852 t24 = 0, t25 = 0, t26 = 0, t27 = 0, t28 = 0, t29 = 0, t30 = 0,
27853 b0 = b[0],
27854 b1 = b[1],
27855 b2 = b[2],
27856 b3 = b[3],
27857 b4 = b[4],
27858 b5 = b[5],
27859 b6 = b[6],
27860 b7 = b[7],
27861 b8 = b[8],
27862 b9 = b[9],
27863 b10 = b[10],
27864 b11 = b[11],
27865 b12 = b[12],
27866 b13 = b[13],
27867 b14 = b[14],
27868 b15 = b[15];
27869
27870 v = a[0];
27871 t0 += v * b0;
27872 t1 += v * b1;
27873 t2 += v * b2;
27874 t3 += v * b3;
27875 t4 += v * b4;
27876 t5 += v * b5;
27877 t6 += v * b6;
27878 t7 += v * b7;
27879 t8 += v * b8;
27880 t9 += v * b9;
27881 t10 += v * b10;
27882 t11 += v * b11;
27883 t12 += v * b12;
27884 t13 += v * b13;
27885 t14 += v * b14;
27886 t15 += v * b15;
27887 v = a[1];
27888 t1 += v * b0;
27889 t2 += v * b1;
27890 t3 += v * b2;
27891 t4 += v * b3;
27892 t5 += v * b4;
27893 t6 += v * b5;
27894 t7 += v * b6;
27895 t8 += v * b7;
27896 t9 += v * b8;
27897 t10 += v * b9;
27898 t11 += v * b10;
27899 t12 += v * b11;
27900 t13 += v * b12;
27901 t14 += v * b13;
27902 t15 += v * b14;
27903 t16 += v * b15;
27904 v = a[2];
27905 t2 += v * b0;
27906 t3 += v * b1;
27907 t4 += v * b2;
27908 t5 += v * b3;
27909 t6 += v * b4;
27910 t7 += v * b5;
27911 t8 += v * b6;
27912 t9 += v * b7;
27913 t10 += v * b8;
27914 t11 += v * b9;
27915 t12 += v * b10;
27916 t13 += v * b11;
27917 t14 += v * b12;
27918 t15 += v * b13;
27919 t16 += v * b14;
27920 t17 += v * b15;
27921 v = a[3];
27922 t3 += v * b0;
27923 t4 += v * b1;
27924 t5 += v * b2;
27925 t6 += v * b3;
27926 t7 += v * b4;
27927 t8 += v * b5;
27928 t9 += v * b6;
27929 t10 += v * b7;
27930 t11 += v * b8;
27931 t12 += v * b9;
27932 t13 += v * b10;
27933 t14 += v * b11;
27934 t15 += v * b12;
27935 t16 += v * b13;
27936 t17 += v * b14;
27937 t18 += v * b15;
27938 v = a[4];
27939 t4 += v * b0;
27940 t5 += v * b1;
27941 t6 += v * b2;
27942 t7 += v * b3;
27943 t8 += v * b4;
27944 t9 += v * b5;
27945 t10 += v * b6;
27946 t11 += v * b7;
27947 t12 += v * b8;
27948 t13 += v * b9;
27949 t14 += v * b10;
27950 t15 += v * b11;
27951 t16 += v * b12;
27952 t17 += v * b13;
27953 t18 += v * b14;
27954 t19 += v * b15;
27955 v = a[5];
27956 t5 += v * b0;
27957 t6 += v * b1;
27958 t7 += v * b2;
27959 t8 += v * b3;
27960 t9 += v * b4;
27961 t10 += v * b5;
27962 t11 += v * b6;
27963 t12 += v * b7;
27964 t13 += v * b8;
27965 t14 += v * b9;
27966 t15 += v * b10;
27967 t16 += v * b11;
27968 t17 += v * b12;
27969 t18 += v * b13;
27970 t19 += v * b14;
27971 t20 += v * b15;
27972 v = a[6];
27973 t6 += v * b0;
27974 t7 += v * b1;
27975 t8 += v * b2;
27976 t9 += v * b3;
27977 t10 += v * b4;
27978 t11 += v * b5;
27979 t12 += v * b6;
27980 t13 += v * b7;
27981 t14 += v * b8;
27982 t15 += v * b9;
27983 t16 += v * b10;
27984 t17 += v * b11;
27985 t18 += v * b12;
27986 t19 += v * b13;
27987 t20 += v * b14;
27988 t21 += v * b15;
27989 v = a[7];
27990 t7 += v * b0;
27991 t8 += v * b1;
27992 t9 += v * b2;
27993 t10 += v * b3;
27994 t11 += v * b4;
27995 t12 += v * b5;
27996 t13 += v * b6;
27997 t14 += v * b7;
27998 t15 += v * b8;
27999 t16 += v * b9;
28000 t17 += v * b10;
28001 t18 += v * b11;
28002 t19 += v * b12;
28003 t20 += v * b13;
28004 t21 += v * b14;
28005 t22 += v * b15;
28006 v = a[8];
28007 t8 += v * b0;
28008 t9 += v * b1;
28009 t10 += v * b2;
28010 t11 += v * b3;
28011 t12 += v * b4;
28012 t13 += v * b5;
28013 t14 += v * b6;
28014 t15 += v * b7;
28015 t16 += v * b8;
28016 t17 += v * b9;
28017 t18 += v * b10;
28018 t19 += v * b11;
28019 t20 += v * b12;
28020 t21 += v * b13;
28021 t22 += v * b14;
28022 t23 += v * b15;
28023 v = a[9];
28024 t9 += v * b0;
28025 t10 += v * b1;
28026 t11 += v * b2;
28027 t12 += v * b3;
28028 t13 += v * b4;
28029 t14 += v * b5;
28030 t15 += v * b6;
28031 t16 += v * b7;
28032 t17 += v * b8;
28033 t18 += v * b9;
28034 t19 += v * b10;
28035 t20 += v * b11;
28036 t21 += v * b12;
28037 t22 += v * b13;
28038 t23 += v * b14;
28039 t24 += v * b15;
28040 v = a[10];
28041 t10 += v * b0;
28042 t11 += v * b1;
28043 t12 += v * b2;
28044 t13 += v * b3;
28045 t14 += v * b4;
28046 t15 += v * b5;
28047 t16 += v * b6;
28048 t17 += v * b7;
28049 t18 += v * b8;
28050 t19 += v * b9;
28051 t20 += v * b10;
28052 t21 += v * b11;
28053 t22 += v * b12;
28054 t23 += v * b13;
28055 t24 += v * b14;
28056 t25 += v * b15;
28057 v = a[11];
28058 t11 += v * b0;
28059 t12 += v * b1;
28060 t13 += v * b2;
28061 t14 += v * b3;
28062 t15 += v * b4;
28063 t16 += v * b5;
28064 t17 += v * b6;
28065 t18 += v * b7;
28066 t19 += v * b8;
28067 t20 += v * b9;
28068 t21 += v * b10;
28069 t22 += v * b11;
28070 t23 += v * b12;
28071 t24 += v * b13;
28072 t25 += v * b14;
28073 t26 += v * b15;
28074 v = a[12];
28075 t12 += v * b0;
28076 t13 += v * b1;
28077 t14 += v * b2;
28078 t15 += v * b3;
28079 t16 += v * b4;
28080 t17 += v * b5;
28081 t18 += v * b6;
28082 t19 += v * b7;
28083 t20 += v * b8;
28084 t21 += v * b9;
28085 t22 += v * b10;
28086 t23 += v * b11;
28087 t24 += v * b12;
28088 t25 += v * b13;
28089 t26 += v * b14;
28090 t27 += v * b15;
28091 v = a[13];
28092 t13 += v * b0;
28093 t14 += v * b1;
28094 t15 += v * b2;
28095 t16 += v * b3;
28096 t17 += v * b4;
28097 t18 += v * b5;
28098 t19 += v * b6;
28099 t20 += v * b7;
28100 t21 += v * b8;
28101 t22 += v * b9;
28102 t23 += v * b10;
28103 t24 += v * b11;
28104 t25 += v * b12;
28105 t26 += v * b13;
28106 t27 += v * b14;
28107 t28 += v * b15;
28108 v = a[14];
28109 t14 += v * b0;
28110 t15 += v * b1;
28111 t16 += v * b2;
28112 t17 += v * b3;
28113 t18 += v * b4;
28114 t19 += v * b5;
28115 t20 += v * b6;
28116 t21 += v * b7;
28117 t22 += v * b8;
28118 t23 += v * b9;
28119 t24 += v * b10;
28120 t25 += v * b11;
28121 t26 += v * b12;
28122 t27 += v * b13;
28123 t28 += v * b14;
28124 t29 += v * b15;
28125 v = a[15];
28126 t15 += v * b0;
28127 t16 += v * b1;
28128 t17 += v * b2;
28129 t18 += v * b3;
28130 t19 += v * b4;
28131 t20 += v * b5;
28132 t21 += v * b6;
28133 t22 += v * b7;
28134 t23 += v * b8;
28135 t24 += v * b9;
28136 t25 += v * b10;
28137 t26 += v * b11;
28138 t27 += v * b12;
28139 t28 += v * b13;
28140 t29 += v * b14;
28141 t30 += v * b15;
28142
28143 t0 += 38 * t16;
28144 t1 += 38 * t17;
28145 t2 += 38 * t18;
28146 t3 += 38 * t19;
28147 t4 += 38 * t20;
28148 t5 += 38 * t21;
28149 t6 += 38 * t22;
28150 t7 += 38 * t23;
28151 t8 += 38 * t24;
28152 t9 += 38 * t25;
28153 t10 += 38 * t26;
28154 t11 += 38 * t27;
28155 t12 += 38 * t28;
28156 t13 += 38 * t29;
28157 t14 += 38 * t30;
28158 // t15 left as is
28159
28160 // first car
28161 c = 1;
28162 v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;
28163 v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;
28164 v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;
28165 v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;
28166 v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;
28167 v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;
28168 v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;
28169 v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;
28170 v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;
28171 v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;
28172 v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;
28173 v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;
28174 v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;
28175 v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;
28176 v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;
28177 v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;
28178 t0 += c-1 + 37 * (c-1);
28179
28180 // second car
28181 c = 1;
28182 v = t0 + c + 65535; c = Math.floor(v / 65536); t0 = v - c * 65536;
28183 v = t1 + c + 65535; c = Math.floor(v / 65536); t1 = v - c * 65536;
28184 v = t2 + c + 65535; c = Math.floor(v / 65536); t2 = v - c * 65536;
28185 v = t3 + c + 65535; c = Math.floor(v / 65536); t3 = v - c * 65536;
28186 v = t4 + c + 65535; c = Math.floor(v / 65536); t4 = v - c * 65536;
28187 v = t5 + c + 65535; c = Math.floor(v / 65536); t5 = v - c * 65536;
28188 v = t6 + c + 65535; c = Math.floor(v / 65536); t6 = v - c * 65536;
28189 v = t7 + c + 65535; c = Math.floor(v / 65536); t7 = v - c * 65536;
28190 v = t8 + c + 65535; c = Math.floor(v / 65536); t8 = v - c * 65536;
28191 v = t9 + c + 65535; c = Math.floor(v / 65536); t9 = v - c * 65536;
28192 v = t10 + c + 65535; c = Math.floor(v / 65536); t10 = v - c * 65536;
28193 v = t11 + c + 65535; c = Math.floor(v / 65536); t11 = v - c * 65536;
28194 v = t12 + c + 65535; c = Math.floor(v / 65536); t12 = v - c * 65536;
28195 v = t13 + c + 65535; c = Math.floor(v / 65536); t13 = v - c * 65536;
28196 v = t14 + c + 65535; c = Math.floor(v / 65536); t14 = v - c * 65536;
28197 v = t15 + c + 65535; c = Math.floor(v / 65536); t15 = v - c * 65536;
28198 t0 += c-1 + 37 * (c-1);
28199
28200 o[ 0] = t0;
28201 o[ 1] = t1;
28202 o[ 2] = t2;
28203 o[ 3] = t3;
28204 o[ 4] = t4;
28205 o[ 5] = t5;
28206 o[ 6] = t6;
28207 o[ 7] = t7;
28208 o[ 8] = t8;
28209 o[ 9] = t9;
28210 o[10] = t10;
28211 o[11] = t11;
28212 o[12] = t12;
28213 o[13] = t13;
28214 o[14] = t14;
28215 o[15] = t15;
28216}
28217
28218function S(o, a) {
28219 M(o, a, a);
28220}
28221
28222function inv25519(o, i) {
28223 var c = gf();
28224 var a;
28225 for (a = 0; a < 16; a++) c[a] = i[a];
28226 for (a = 253; a >= 0; a--) {
28227 S(c, c);
28228 if(a !== 2 && a !== 4) M(c, c, i);
28229 }
28230 for (a = 0; a < 16; a++) o[a] = c[a];
28231}
28232
28233function pow2523(o, i) {
28234 var c = gf();
28235 var a;
28236 for (a = 0; a < 16; a++) c[a] = i[a];
28237 for (a = 250; a >= 0; a--) {
28238 S(c, c);
28239 if(a !== 1) M(c, c, i);
28240 }
28241 for (a = 0; a < 16; a++) o[a] = c[a];
28242}
28243
28244function crypto_scalarmult(q, n, p) {
28245 var z = new Uint8Array(32);
28246 var x = new Float64Array(80), r, i;
28247 var a = gf(), b = gf(), c = gf(),
28248 d = gf(), e = gf(), f = gf();
28249 for (i = 0; i < 31; i++) z[i] = n[i];
28250 z[31]=(n[31]&127)|64;
28251 z[0]&=248;
28252 unpack25519(x,p);
28253 for (i = 0; i < 16; i++) {
28254 b[i]=x[i];
28255 d[i]=a[i]=c[i]=0;
28256 }
28257 a[0]=d[0]=1;
28258 for (i=254; i>=0; --i) {
28259 r=(z[i>>>3]>>>(i&7))&1;
28260 sel25519(a,b,r);
28261 sel25519(c,d,r);
28262 A(e,a,c);
28263 Z(a,a,c);
28264 A(c,b,d);
28265 Z(b,b,d);
28266 S(d,e);
28267 S(f,a);
28268 M(a,c,a);
28269 M(c,b,e);
28270 A(e,a,c);
28271 Z(a,a,c);
28272 S(b,a);
28273 Z(c,d,f);
28274 M(a,c,_121665);
28275 A(a,a,d);
28276 M(c,c,a);
28277 M(a,d,f);
28278 M(d,b,x);
28279 S(b,e);
28280 sel25519(a,b,r);
28281 sel25519(c,d,r);
28282 }
28283 for (i = 0; i < 16; i++) {
28284 x[i+16]=a[i];
28285 x[i+32]=c[i];
28286 x[i+48]=b[i];
28287 x[i+64]=d[i];
28288 }
28289 var x32 = x.subarray(32);
28290 var x16 = x.subarray(16);
28291 inv25519(x32,x32);
28292 M(x16,x16,x32);
28293 pack25519(q,x16);
28294 return 0;
28295}
28296
28297function crypto_scalarmult_base(q, n) {
28298 return crypto_scalarmult(q, n, _9);
28299}
28300
28301function crypto_box_keypair(y, x) {
28302 randombytes(x, 32);
28303 return crypto_scalarmult_base(y, x);
28304}
28305
28306function crypto_box_beforenm(k, y, x) {
28307 var s = new Uint8Array(32);
28308 crypto_scalarmult(s, x, y);
28309 return crypto_core_hsalsa20(k, _0, s, sigma);
28310}
28311
28312var crypto_box_afternm = crypto_secretbox;
28313var crypto_box_open_afternm = crypto_secretbox_open;
28314
28315function crypto_box(c, m, d, n, y, x) {
28316 var k = new Uint8Array(32);
28317 crypto_box_beforenm(k, y, x);
28318 return crypto_box_afternm(c, m, d, n, k);
28319}
28320
28321function crypto_box_open(m, c, d, n, y, x) {
28322 var k = new Uint8Array(32);
28323 crypto_box_beforenm(k, y, x);
28324 return crypto_box_open_afternm(m, c, d, n, k);
28325}
28326
28327var K = [
28328 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd,
28329 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc,
28330 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019,
28331 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118,
28332 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe,
28333 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2,
28334 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1,
28335 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694,
28336 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3,
28337 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65,
28338 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483,
28339 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5,
28340 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210,
28341 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4,
28342 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725,
28343 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70,
28344 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926,
28345 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df,
28346 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8,
28347 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b,
28348 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001,
28349 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30,
28350 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910,
28351 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8,
28352 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53,
28353 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8,
28354 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb,
28355 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3,
28356 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60,
28357 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec,
28358 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9,
28359 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b,
28360 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207,
28361 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178,
28362 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6,
28363 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b,
28364 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493,
28365 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c,
28366 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a,
28367 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817
28368];
28369
28370function crypto_hashblocks_hl(hh, hl, m, n) {
28371 var wh = new Int32Array(16), wl = new Int32Array(16),
28372 bh0, bh1, bh2, bh3, bh4, bh5, bh6, bh7,
28373 bl0, bl1, bl2, bl3, bl4, bl5, bl6, bl7,
28374 th, tl, i, j, h, l, a, b, c, d;
28375
28376 var ah0 = hh[0],
28377 ah1 = hh[1],
28378 ah2 = hh[2],
28379 ah3 = hh[3],
28380 ah4 = hh[4],
28381 ah5 = hh[5],
28382 ah6 = hh[6],
28383 ah7 = hh[7],
28384
28385 al0 = hl[0],
28386 al1 = hl[1],
28387 al2 = hl[2],
28388 al3 = hl[3],
28389 al4 = hl[4],
28390 al5 = hl[5],
28391 al6 = hl[6],
28392 al7 = hl[7];
28393
28394 var pos = 0;
28395 while (n >= 128) {
28396 for (i = 0; i < 16; i++) {
28397 j = 8 * i + pos;
28398 wh[i] = (m[j+0] << 24) | (m[j+1] << 16) | (m[j+2] << 8) | m[j+3];
28399 wl[i] = (m[j+4] << 24) | (m[j+5] << 16) | (m[j+6] << 8) | m[j+7];
28400 }
28401 for (i = 0; i < 80; i++) {
28402 bh0 = ah0;
28403 bh1 = ah1;
28404 bh2 = ah2;
28405 bh3 = ah3;
28406 bh4 = ah4;
28407 bh5 = ah5;
28408 bh6 = ah6;
28409 bh7 = ah7;
28410
28411 bl0 = al0;
28412 bl1 = al1;
28413 bl2 = al2;
28414 bl3 = al3;
28415 bl4 = al4;
28416 bl5 = al5;
28417 bl6 = al6;
28418 bl7 = al7;
28419
28420 // add
28421 h = ah7;
28422 l = al7;
28423
28424 a = l & 0xffff; b = l >>> 16;
28425 c = h & 0xffff; d = h >>> 16;
28426
28427 // Sigma1
28428 h = ((ah4 >>> 14) | (al4 << (32-14))) ^ ((ah4 >>> 18) | (al4 << (32-18))) ^ ((al4 >>> (41-32)) | (ah4 << (32-(41-32))));
28429 l = ((al4 >>> 14) | (ah4 << (32-14))) ^ ((al4 >>> 18) | (ah4 << (32-18))) ^ ((ah4 >>> (41-32)) | (al4 << (32-(41-32))));
28430
28431 a += l & 0xffff; b += l >>> 16;
28432 c += h & 0xffff; d += h >>> 16;
28433
28434 // Ch
28435 h = (ah4 & ah5) ^ (~ah4 & ah6);
28436 l = (al4 & al5) ^ (~al4 & al6);
28437
28438 a += l & 0xffff; b += l >>> 16;
28439 c += h & 0xffff; d += h >>> 16;
28440
28441 // K
28442 h = K[i*2];
28443 l = K[i*2+1];
28444
28445 a += l & 0xffff; b += l >>> 16;
28446 c += h & 0xffff; d += h >>> 16;
28447
28448 // w
28449 h = wh[i%16];
28450 l = wl[i%16];
28451
28452 a += l & 0xffff; b += l >>> 16;
28453 c += h & 0xffff; d += h >>> 16;
28454
28455 b += a >>> 16;
28456 c += b >>> 16;
28457 d += c >>> 16;
28458
28459 th = c & 0xffff | d << 16;
28460 tl = a & 0xffff | b << 16;
28461
28462 // add
28463 h = th;
28464 l = tl;
28465
28466 a = l & 0xffff; b = l >>> 16;
28467 c = h & 0xffff; d = h >>> 16;
28468
28469 // Sigma0
28470 h = ((ah0 >>> 28) | (al0 << (32-28))) ^ ((al0 >>> (34-32)) | (ah0 << (32-(34-32)))) ^ ((al0 >>> (39-32)) | (ah0 << (32-(39-32))));
28471 l = ((al0 >>> 28) | (ah0 << (32-28))) ^ ((ah0 >>> (34-32)) | (al0 << (32-(34-32)))) ^ ((ah0 >>> (39-32)) | (al0 << (32-(39-32))));
28472
28473 a += l & 0xffff; b += l >>> 16;
28474 c += h & 0xffff; d += h >>> 16;
28475
28476 // Maj
28477 h = (ah0 & ah1) ^ (ah0 & ah2) ^ (ah1 & ah2);
28478 l = (al0 & al1) ^ (al0 & al2) ^ (al1 & al2);
28479
28480 a += l & 0xffff; b += l >>> 16;
28481 c += h & 0xffff; d += h >>> 16;
28482
28483 b += a >>> 16;
28484 c += b >>> 16;
28485 d += c >>> 16;
28486
28487 bh7 = (c & 0xffff) | (d << 16);
28488 bl7 = (a & 0xffff) | (b << 16);
28489
28490 // add
28491 h = bh3;
28492 l = bl3;
28493
28494 a = l & 0xffff; b = l >>> 16;
28495 c = h & 0xffff; d = h >>> 16;
28496
28497 h = th;
28498 l = tl;
28499
28500 a += l & 0xffff; b += l >>> 16;
28501 c += h & 0xffff; d += h >>> 16;
28502
28503 b += a >>> 16;
28504 c += b >>> 16;
28505 d += c >>> 16;
28506
28507 bh3 = (c & 0xffff) | (d << 16);
28508 bl3 = (a & 0xffff) | (b << 16);
28509
28510 ah1 = bh0;
28511 ah2 = bh1;
28512 ah3 = bh2;
28513 ah4 = bh3;
28514 ah5 = bh4;
28515 ah6 = bh5;
28516 ah7 = bh6;
28517 ah0 = bh7;
28518
28519 al1 = bl0;
28520 al2 = bl1;
28521 al3 = bl2;
28522 al4 = bl3;
28523 al5 = bl4;
28524 al6 = bl5;
28525 al7 = bl6;
28526 al0 = bl7;
28527
28528 if (i%16 === 15) {
28529 for (j = 0; j < 16; j++) {
28530 // add
28531 h = wh[j];
28532 l = wl[j];
28533
28534 a = l & 0xffff; b = l >>> 16;
28535 c = h & 0xffff; d = h >>> 16;
28536
28537 h = wh[(j+9)%16];
28538 l = wl[(j+9)%16];
28539
28540 a += l & 0xffff; b += l >>> 16;
28541 c += h & 0xffff; d += h >>> 16;
28542
28543 // sigma0
28544 th = wh[(j+1)%16];
28545 tl = wl[(j+1)%16];
28546 h = ((th >>> 1) | (tl << (32-1))) ^ ((th >>> 8) | (tl << (32-8))) ^ (th >>> 7);
28547 l = ((tl >>> 1) | (th << (32-1))) ^ ((tl >>> 8) | (th << (32-8))) ^ ((tl >>> 7) | (th << (32-7)));
28548
28549 a += l & 0xffff; b += l >>> 16;
28550 c += h & 0xffff; d += h >>> 16;
28551
28552 // sigma1
28553 th = wh[(j+14)%16];
28554 tl = wl[(j+14)%16];
28555 h = ((th >>> 19) | (tl << (32-19))) ^ ((tl >>> (61-32)) | (th << (32-(61-32)))) ^ (th >>> 6);
28556 l = ((tl >>> 19) | (th << (32-19))) ^ ((th >>> (61-32)) | (tl << (32-(61-32)))) ^ ((tl >>> 6) | (th << (32-6)));
28557
28558 a += l & 0xffff; b += l >>> 16;
28559 c += h & 0xffff; d += h >>> 16;
28560
28561 b += a >>> 16;
28562 c += b >>> 16;
28563 d += c >>> 16;
28564
28565 wh[j] = (c & 0xffff) | (d << 16);
28566 wl[j] = (a & 0xffff) | (b << 16);
28567 }
28568 }
28569 }
28570
28571 // add
28572 h = ah0;
28573 l = al0;
28574
28575 a = l & 0xffff; b = l >>> 16;
28576 c = h & 0xffff; d = h >>> 16;
28577
28578 h = hh[0];
28579 l = hl[0];
28580
28581 a += l & 0xffff; b += l >>> 16;
28582 c += h & 0xffff; d += h >>> 16;
28583
28584 b += a >>> 16;
28585 c += b >>> 16;
28586 d += c >>> 16;
28587
28588 hh[0] = ah0 = (c & 0xffff) | (d << 16);
28589 hl[0] = al0 = (a & 0xffff) | (b << 16);
28590
28591 h = ah1;
28592 l = al1;
28593
28594 a = l & 0xffff; b = l >>> 16;
28595 c = h & 0xffff; d = h >>> 16;
28596
28597 h = hh[1];
28598 l = hl[1];
28599
28600 a += l & 0xffff; b += l >>> 16;
28601 c += h & 0xffff; d += h >>> 16;
28602
28603 b += a >>> 16;
28604 c += b >>> 16;
28605 d += c >>> 16;
28606
28607 hh[1] = ah1 = (c & 0xffff) | (d << 16);
28608 hl[1] = al1 = (a & 0xffff) | (b << 16);
28609
28610 h = ah2;
28611 l = al2;
28612
28613 a = l & 0xffff; b = l >>> 16;
28614 c = h & 0xffff; d = h >>> 16;
28615
28616 h = hh[2];
28617 l = hl[2];
28618
28619 a += l & 0xffff; b += l >>> 16;
28620 c += h & 0xffff; d += h >>> 16;
28621
28622 b += a >>> 16;
28623 c += b >>> 16;
28624 d += c >>> 16;
28625
28626 hh[2] = ah2 = (c & 0xffff) | (d << 16);
28627 hl[2] = al2 = (a & 0xffff) | (b << 16);
28628
28629 h = ah3;
28630 l = al3;
28631
28632 a = l & 0xffff; b = l >>> 16;
28633 c = h & 0xffff; d = h >>> 16;
28634
28635 h = hh[3];
28636 l = hl[3];
28637
28638 a += l & 0xffff; b += l >>> 16;
28639 c += h & 0xffff; d += h >>> 16;
28640
28641 b += a >>> 16;
28642 c += b >>> 16;
28643 d += c >>> 16;
28644
28645 hh[3] = ah3 = (c & 0xffff) | (d << 16);
28646 hl[3] = al3 = (a & 0xffff) | (b << 16);
28647
28648 h = ah4;
28649 l = al4;
28650
28651 a = l & 0xffff; b = l >>> 16;
28652 c = h & 0xffff; d = h >>> 16;
28653
28654 h = hh[4];
28655 l = hl[4];
28656
28657 a += l & 0xffff; b += l >>> 16;
28658 c += h & 0xffff; d += h >>> 16;
28659
28660 b += a >>> 16;
28661 c += b >>> 16;
28662 d += c >>> 16;
28663
28664 hh[4] = ah4 = (c & 0xffff) | (d << 16);
28665 hl[4] = al4 = (a & 0xffff) | (b << 16);
28666
28667 h = ah5;
28668 l = al5;
28669
28670 a = l & 0xffff; b = l >>> 16;
28671 c = h & 0xffff; d = h >>> 16;
28672
28673 h = hh[5];
28674 l = hl[5];
28675
28676 a += l & 0xffff; b += l >>> 16;
28677 c += h & 0xffff; d += h >>> 16;
28678
28679 b += a >>> 16;
28680 c += b >>> 16;
28681 d += c >>> 16;
28682
28683 hh[5] = ah5 = (c & 0xffff) | (d << 16);
28684 hl[5] = al5 = (a & 0xffff) | (b << 16);
28685
28686 h = ah6;
28687 l = al6;
28688
28689 a = l & 0xffff; b = l >>> 16;
28690 c = h & 0xffff; d = h >>> 16;
28691
28692 h = hh[6];
28693 l = hl[6];
28694
28695 a += l & 0xffff; b += l >>> 16;
28696 c += h & 0xffff; d += h >>> 16;
28697
28698 b += a >>> 16;
28699 c += b >>> 16;
28700 d += c >>> 16;
28701
28702 hh[6] = ah6 = (c & 0xffff) | (d << 16);
28703 hl[6] = al6 = (a & 0xffff) | (b << 16);
28704
28705 h = ah7;
28706 l = al7;
28707
28708 a = l & 0xffff; b = l >>> 16;
28709 c = h & 0xffff; d = h >>> 16;
28710
28711 h = hh[7];
28712 l = hl[7];
28713
28714 a += l & 0xffff; b += l >>> 16;
28715 c += h & 0xffff; d += h >>> 16;
28716
28717 b += a >>> 16;
28718 c += b >>> 16;
28719 d += c >>> 16;
28720
28721 hh[7] = ah7 = (c & 0xffff) | (d << 16);
28722 hl[7] = al7 = (a & 0xffff) | (b << 16);
28723
28724 pos += 128;
28725 n -= 128;
28726 }
28727
28728 return n;
28729}
28730
28731function crypto_hash(out, m, n) {
28732 var hh = new Int32Array(8),
28733 hl = new Int32Array(8),
28734 x = new Uint8Array(256),
28735 i, b = n;
28736
28737 hh[0] = 0x6a09e667;
28738 hh[1] = 0xbb67ae85;
28739 hh[2] = 0x3c6ef372;
28740 hh[3] = 0xa54ff53a;
28741 hh[4] = 0x510e527f;
28742 hh[5] = 0x9b05688c;
28743 hh[6] = 0x1f83d9ab;
28744 hh[7] = 0x5be0cd19;
28745
28746 hl[0] = 0xf3bcc908;
28747 hl[1] = 0x84caa73b;
28748 hl[2] = 0xfe94f82b;
28749 hl[3] = 0x5f1d36f1;
28750 hl[4] = 0xade682d1;
28751 hl[5] = 0x2b3e6c1f;
28752 hl[6] = 0xfb41bd6b;
28753 hl[7] = 0x137e2179;
28754
28755 crypto_hashblocks_hl(hh, hl, m, n);
28756 n %= 128;
28757
28758 for (i = 0; i < n; i++) x[i] = m[b-n+i];
28759 x[n] = 128;
28760
28761 n = 256-128*(n<112?1:0);
28762 x[n-9] = 0;
28763 ts64(x, n-8, (b / 0x20000000) | 0, b << 3);
28764 crypto_hashblocks_hl(hh, hl, x, n);
28765
28766 for (i = 0; i < 8; i++) ts64(out, 8*i, hh[i], hl[i]);
28767
28768 return 0;
28769}
28770
28771function add(p, q) {
28772 var a = gf(), b = gf(), c = gf(),
28773 d = gf(), e = gf(), f = gf(),
28774 g = gf(), h = gf(), t = gf();
28775
28776 Z(a, p[1], p[0]);
28777 Z(t, q[1], q[0]);
28778 M(a, a, t);
28779 A(b, p[0], p[1]);
28780 A(t, q[0], q[1]);
28781 M(b, b, t);
28782 M(c, p[3], q[3]);
28783 M(c, c, D2);
28784 M(d, p[2], q[2]);
28785 A(d, d, d);
28786 Z(e, b, a);
28787 Z(f, d, c);
28788 A(g, d, c);
28789 A(h, b, a);
28790
28791 M(p[0], e, f);
28792 M(p[1], h, g);
28793 M(p[2], g, f);
28794 M(p[3], e, h);
28795}
28796
28797function cswap(p, q, b) {
28798 var i;
28799 for (i = 0; i < 4; i++) {
28800 sel25519(p[i], q[i], b);
28801 }
28802}
28803
28804function pack(r, p) {
28805 var tx = gf(), ty = gf(), zi = gf();
28806 inv25519(zi, p[2]);
28807 M(tx, p[0], zi);
28808 M(ty, p[1], zi);
28809 pack25519(r, ty);
28810 r[31] ^= par25519(tx) << 7;
28811}
28812
28813function scalarmult(p, q, s) {
28814 var b, i;
28815 set25519(p[0], gf0);
28816 set25519(p[1], gf1);
28817 set25519(p[2], gf1);
28818 set25519(p[3], gf0);
28819 for (i = 255; i >= 0; --i) {
28820 b = (s[(i/8)|0] >> (i&7)) & 1;
28821 cswap(p, q, b);
28822 add(q, p);
28823 add(p, p);
28824 cswap(p, q, b);
28825 }
28826}
28827
28828function scalarbase(p, s) {
28829 var q = [gf(), gf(), gf(), gf()];
28830 set25519(q[0], X);
28831 set25519(q[1], Y);
28832 set25519(q[2], gf1);
28833 M(q[3], X, Y);
28834 scalarmult(p, q, s);
28835}
28836
28837function crypto_sign_keypair(pk, sk, seeded) {
28838 var d = new Uint8Array(64);
28839 var p = [gf(), gf(), gf(), gf()];
28840 var i;
28841
28842 if (!seeded) randombytes(sk, 32);
28843 crypto_hash(d, sk, 32);
28844 d[0] &= 248;
28845 d[31] &= 127;
28846 d[31] |= 64;
28847
28848 scalarbase(p, d);
28849 pack(pk, p);
28850
28851 for (i = 0; i < 32; i++) sk[i+32] = pk[i];
28852 return 0;
28853}
28854
28855var L = new Float64Array([0xed, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, 0xd6, 0x9c, 0xf7, 0xa2, 0xde, 0xf9, 0xde, 0x14, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x10]);
28856
28857function modL(r, x) {
28858 var carry, i, j, k;
28859 for (i = 63; i >= 32; --i) {
28860 carry = 0;
28861 for (j = i - 32, k = i - 12; j < k; ++j) {
28862 x[j] += carry - 16 * x[i] * L[j - (i - 32)];
28863 carry = (x[j] + 128) >> 8;
28864 x[j] -= carry * 256;
28865 }
28866 x[j] += carry;
28867 x[i] = 0;
28868 }
28869 carry = 0;
28870 for (j = 0; j < 32; j++) {
28871 x[j] += carry - (x[31] >> 4) * L[j];
28872 carry = x[j] >> 8;
28873 x[j] &= 255;
28874 }
28875 for (j = 0; j < 32; j++) x[j] -= carry * L[j];
28876 for (i = 0; i < 32; i++) {
28877 x[i+1] += x[i] >> 8;
28878 r[i] = x[i] & 255;
28879 }
28880}
28881
28882function reduce(r) {
28883 var x = new Float64Array(64), i;
28884 for (i = 0; i < 64; i++) x[i] = r[i];
28885 for (i = 0; i < 64; i++) r[i] = 0;
28886 modL(r, x);
28887}
28888
28889// Note: difference from C - smlen returned, not passed as argument.
28890function crypto_sign(sm, m, n, sk) {
28891 var d = new Uint8Array(64), h = new Uint8Array(64), r = new Uint8Array(64);
28892 var i, j, x = new Float64Array(64);
28893 var p = [gf(), gf(), gf(), gf()];
28894
28895 crypto_hash(d, sk, 32);
28896 d[0] &= 248;
28897 d[31] &= 127;
28898 d[31] |= 64;
28899
28900 var smlen = n + 64;
28901 for (i = 0; i < n; i++) sm[64 + i] = m[i];
28902 for (i = 0; i < 32; i++) sm[32 + i] = d[32 + i];
28903
28904 crypto_hash(r, sm.subarray(32), n+32);
28905 reduce(r);
28906 scalarbase(p, r);
28907 pack(sm, p);
28908
28909 for (i = 32; i < 64; i++) sm[i] = sk[i];
28910 crypto_hash(h, sm, n + 64);
28911 reduce(h);
28912
28913 for (i = 0; i < 64; i++) x[i] = 0;
28914 for (i = 0; i < 32; i++) x[i] = r[i];
28915 for (i = 0; i < 32; i++) {
28916 for (j = 0; j < 32; j++) {
28917 x[i+j] += h[i] * d[j];
28918 }
28919 }
28920
28921 modL(sm.subarray(32), x);
28922 return smlen;
28923}
28924
28925function unpackneg(r, p) {
28926 var t = gf(), chk = gf(), num = gf(),
28927 den = gf(), den2 = gf(), den4 = gf(),
28928 den6 = gf();
28929
28930 set25519(r[2], gf1);
28931 unpack25519(r[1], p);
28932 S(num, r[1]);
28933 M(den, num, D);
28934 Z(num, num, r[2]);
28935 A(den, r[2], den);
28936
28937 S(den2, den);
28938 S(den4, den2);
28939 M(den6, den4, den2);
28940 M(t, den6, num);
28941 M(t, t, den);
28942
28943 pow2523(t, t);
28944 M(t, t, num);
28945 M(t, t, den);
28946 M(t, t, den);
28947 M(r[0], t, den);
28948
28949 S(chk, r[0]);
28950 M(chk, chk, den);
28951 if (neq25519(chk, num)) M(r[0], r[0], I);
28952
28953 S(chk, r[0]);
28954 M(chk, chk, den);
28955 if (neq25519(chk, num)) return -1;
28956
28957 if (par25519(r[0]) === (p[31]>>7)) Z(r[0], gf0, r[0]);
28958
28959 M(r[3], r[0], r[1]);
28960 return 0;
28961}
28962
28963function crypto_sign_open(m, sm, n, pk) {
28964 var i, mlen;
28965 var t = new Uint8Array(32), h = new Uint8Array(64);
28966 var p = [gf(), gf(), gf(), gf()],
28967 q = [gf(), gf(), gf(), gf()];
28968
28969 mlen = -1;
28970 if (n < 64) return -1;
28971
28972 if (unpackneg(q, pk)) return -1;
28973
28974 for (i = 0; i < n; i++) m[i] = sm[i];
28975 for (i = 0; i < 32; i++) m[i+32] = pk[i];
28976 crypto_hash(h, m, n);
28977 reduce(h);
28978 scalarmult(p, q, h);
28979
28980 scalarbase(q, sm.subarray(32));
28981 add(p, q);
28982 pack(t, p);
28983
28984 n -= 64;
28985 if (crypto_verify_32(sm, 0, t, 0)) {
28986 for (i = 0; i < n; i++) m[i] = 0;
28987 return -1;
28988 }
28989
28990 for (i = 0; i < n; i++) m[i] = sm[i + 64];
28991 mlen = n;
28992 return mlen;
28993}
28994
28995var crypto_secretbox_KEYBYTES = 32,
28996 crypto_secretbox_NONCEBYTES = 24,
28997 crypto_secretbox_ZEROBYTES = 32,
28998 crypto_secretbox_BOXZEROBYTES = 16,
28999 crypto_scalarmult_BYTES = 32,
29000 crypto_scalarmult_SCALARBYTES = 32,
29001 crypto_box_PUBLICKEYBYTES = 32,
29002 crypto_box_SECRETKEYBYTES = 32,
29003 crypto_box_BEFORENMBYTES = 32,
29004 crypto_box_NONCEBYTES = crypto_secretbox_NONCEBYTES,
29005 crypto_box_ZEROBYTES = crypto_secretbox_ZEROBYTES,
29006 crypto_box_BOXZEROBYTES = crypto_secretbox_BOXZEROBYTES,
29007 crypto_sign_BYTES = 64,
29008 crypto_sign_PUBLICKEYBYTES = 32,
29009 crypto_sign_SECRETKEYBYTES = 64,
29010 crypto_sign_SEEDBYTES = 32,
29011 crypto_hash_BYTES = 64;
29012
29013nacl.lowlevel = {
29014 crypto_core_hsalsa20: crypto_core_hsalsa20,
29015 crypto_stream_xor: crypto_stream_xor,
29016 crypto_stream: crypto_stream,
29017 crypto_stream_salsa20_xor: crypto_stream_salsa20_xor,
29018 crypto_stream_salsa20: crypto_stream_salsa20,
29019 crypto_onetimeauth: crypto_onetimeauth,
29020 crypto_onetimeauth_verify: crypto_onetimeauth_verify,
29021 crypto_verify_16: crypto_verify_16,
29022 crypto_verify_32: crypto_verify_32,
29023 crypto_secretbox: crypto_secretbox,
29024 crypto_secretbox_open: crypto_secretbox_open,
29025 crypto_scalarmult: crypto_scalarmult,
29026 crypto_scalarmult_base: crypto_scalarmult_base,
29027 crypto_box_beforenm: crypto_box_beforenm,
29028 crypto_box_afternm: crypto_box_afternm,
29029 crypto_box: crypto_box,
29030 crypto_box_open: crypto_box_open,
29031 crypto_box_keypair: crypto_box_keypair,
29032 crypto_hash: crypto_hash,
29033 crypto_sign: crypto_sign,
29034 crypto_sign_keypair: crypto_sign_keypair,
29035 crypto_sign_open: crypto_sign_open,
29036
29037 crypto_secretbox_KEYBYTES: crypto_secretbox_KEYBYTES,
29038 crypto_secretbox_NONCEBYTES: crypto_secretbox_NONCEBYTES,
29039 crypto_secretbox_ZEROBYTES: crypto_secretbox_ZEROBYTES,
29040 crypto_secretbox_BOXZEROBYTES: crypto_secretbox_BOXZEROBYTES,
29041 crypto_scalarmult_BYTES: crypto_scalarmult_BYTES,
29042 crypto_scalarmult_SCALARBYTES: crypto_scalarmult_SCALARBYTES,
29043 crypto_box_PUBLICKEYBYTES: crypto_box_PUBLICKEYBYTES,
29044 crypto_box_SECRETKEYBYTES: crypto_box_SECRETKEYBYTES,
29045 crypto_box_BEFORENMBYTES: crypto_box_BEFORENMBYTES,
29046 crypto_box_NONCEBYTES: crypto_box_NONCEBYTES,
29047 crypto_box_ZEROBYTES: crypto_box_ZEROBYTES,
29048 crypto_box_BOXZEROBYTES: crypto_box_BOXZEROBYTES,
29049 crypto_sign_BYTES: crypto_sign_BYTES,
29050 crypto_sign_PUBLICKEYBYTES: crypto_sign_PUBLICKEYBYTES,
29051 crypto_sign_SECRETKEYBYTES: crypto_sign_SECRETKEYBYTES,
29052 crypto_sign_SEEDBYTES: crypto_sign_SEEDBYTES,
29053 crypto_hash_BYTES: crypto_hash_BYTES
29054};
29055
29056/* High-level API */
29057
29058function checkLengths(k, n) {
29059 if (k.length !== crypto_secretbox_KEYBYTES) throw new Error('bad key size');
29060 if (n.length !== crypto_secretbox_NONCEBYTES) throw new Error('bad nonce size');
29061}
29062
29063function checkBoxLengths(pk, sk) {
29064 if (pk.length !== crypto_box_PUBLICKEYBYTES) throw new Error('bad public key size');
29065 if (sk.length !== crypto_box_SECRETKEYBYTES) throw new Error('bad secret key size');
29066}
29067
29068function checkArrayTypes() {
29069 var t, i;
29070 for (i = 0; i < arguments.length; i++) {
29071 if ((t = Object.prototype.toString.call(arguments[i])) !== '[object Uint8Array]')
29072 throw new TypeError('unexpected type ' + t + ', use Uint8Array');
29073 }
29074}
29075
29076function cleanup(arr) {
29077 for (var i = 0; i < arr.length; i++) arr[i] = 0;
29078}
29079
29080// TODO: Completely remove this in v0.15.
29081if (!nacl.util) {
29082 nacl.util = {};
29083 nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() {
29084 throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js');
29085 };
29086}
29087
29088nacl.randomBytes = function(n) {
29089 var b = new Uint8Array(n);
29090 randombytes(b, n);
29091 return b;
29092};
29093
29094nacl.secretbox = function(msg, nonce, key) {
29095 checkArrayTypes(msg, nonce, key);
29096 checkLengths(key, nonce);
29097 var m = new Uint8Array(crypto_secretbox_ZEROBYTES + msg.length);
29098 var c = new Uint8Array(m.length);
29099 for (var i = 0; i < msg.length; i++) m[i+crypto_secretbox_ZEROBYTES] = msg[i];
29100 crypto_secretbox(c, m, m.length, nonce, key);
29101 return c.subarray(crypto_secretbox_BOXZEROBYTES);
29102};
29103
29104nacl.secretbox.open = function(box, nonce, key) {
29105 checkArrayTypes(box, nonce, key);
29106 checkLengths(key, nonce);
29107 var c = new Uint8Array(crypto_secretbox_BOXZEROBYTES + box.length);
29108 var m = new Uint8Array(c.length);
29109 for (var i = 0; i < box.length; i++) c[i+crypto_secretbox_BOXZEROBYTES] = box[i];
29110 if (c.length < 32) return false;
29111 if (crypto_secretbox_open(m, c, c.length, nonce, key) !== 0) return false;
29112 return m.subarray(crypto_secretbox_ZEROBYTES);
29113};
29114
29115nacl.secretbox.keyLength = crypto_secretbox_KEYBYTES;
29116nacl.secretbox.nonceLength = crypto_secretbox_NONCEBYTES;
29117nacl.secretbox.overheadLength = crypto_secretbox_BOXZEROBYTES;
29118
29119nacl.scalarMult = function(n, p) {
29120 checkArrayTypes(n, p);
29121 if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
29122 if (p.length !== crypto_scalarmult_BYTES) throw new Error('bad p size');
29123 var q = new Uint8Array(crypto_scalarmult_BYTES);
29124 crypto_scalarmult(q, n, p);
29125 return q;
29126};
29127
29128nacl.scalarMult.base = function(n) {
29129 checkArrayTypes(n);
29130 if (n.length !== crypto_scalarmult_SCALARBYTES) throw new Error('bad n size');
29131 var q = new Uint8Array(crypto_scalarmult_BYTES);
29132 crypto_scalarmult_base(q, n);
29133 return q;
29134};
29135
29136nacl.scalarMult.scalarLength = crypto_scalarmult_SCALARBYTES;
29137nacl.scalarMult.groupElementLength = crypto_scalarmult_BYTES;
29138
29139nacl.box = function(msg, nonce, publicKey, secretKey) {
29140 var k = nacl.box.before(publicKey, secretKey);
29141 return nacl.secretbox(msg, nonce, k);
29142};
29143
29144nacl.box.before = function(publicKey, secretKey) {
29145 checkArrayTypes(publicKey, secretKey);
29146 checkBoxLengths(publicKey, secretKey);
29147 var k = new Uint8Array(crypto_box_BEFORENMBYTES);
29148 crypto_box_beforenm(k, publicKey, secretKey);
29149 return k;
29150};
29151
29152nacl.box.after = nacl.secretbox;
29153
29154nacl.box.open = function(msg, nonce, publicKey, secretKey) {
29155 var k = nacl.box.before(publicKey, secretKey);
29156 return nacl.secretbox.open(msg, nonce, k);
29157};
29158
29159nacl.box.open.after = nacl.secretbox.open;
29160
29161nacl.box.keyPair = function() {
29162 var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
29163 var sk = new Uint8Array(crypto_box_SECRETKEYBYTES);
29164 crypto_box_keypair(pk, sk);
29165 return {publicKey: pk, secretKey: sk};
29166};
29167
29168nacl.box.keyPair.fromSecretKey = function(secretKey) {
29169 checkArrayTypes(secretKey);
29170 if (secretKey.length !== crypto_box_SECRETKEYBYTES)
29171 throw new Error('bad secret key size');
29172 var pk = new Uint8Array(crypto_box_PUBLICKEYBYTES);
29173 crypto_scalarmult_base(pk, secretKey);
29174 return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
29175};
29176
29177nacl.box.publicKeyLength = crypto_box_PUBLICKEYBYTES;
29178nacl.box.secretKeyLength = crypto_box_SECRETKEYBYTES;
29179nacl.box.sharedKeyLength = crypto_box_BEFORENMBYTES;
29180nacl.box.nonceLength = crypto_box_NONCEBYTES;
29181nacl.box.overheadLength = nacl.secretbox.overheadLength;
29182
29183nacl.sign = function(msg, secretKey) {
29184 checkArrayTypes(msg, secretKey);
29185 if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
29186 throw new Error('bad secret key size');
29187 var signedMsg = new Uint8Array(crypto_sign_BYTES+msg.length);
29188 crypto_sign(signedMsg, msg, msg.length, secretKey);
29189 return signedMsg;
29190};
29191
29192nacl.sign.open = function(signedMsg, publicKey) {
29193 if (arguments.length !== 2)
29194 throw new Error('nacl.sign.open accepts 2 arguments; did you mean to use nacl.sign.detached.verify?');
29195 checkArrayTypes(signedMsg, publicKey);
29196 if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
29197 throw new Error('bad public key size');
29198 var tmp = new Uint8Array(signedMsg.length);
29199 var mlen = crypto_sign_open(tmp, signedMsg, signedMsg.length, publicKey);
29200 if (mlen < 0) return null;
29201 var m = new Uint8Array(mlen);
29202 for (var i = 0; i < m.length; i++) m[i] = tmp[i];
29203 return m;
29204};
29205
29206nacl.sign.detached = function(msg, secretKey) {
29207 var signedMsg = nacl.sign(msg, secretKey);
29208 var sig = new Uint8Array(crypto_sign_BYTES);
29209 for (var i = 0; i < sig.length; i++) sig[i] = signedMsg[i];
29210 return sig;
29211};
29212
29213nacl.sign.detached.verify = function(msg, sig, publicKey) {
29214 checkArrayTypes(msg, sig, publicKey);
29215 if (sig.length !== crypto_sign_BYTES)
29216 throw new Error('bad signature size');
29217 if (publicKey.length !== crypto_sign_PUBLICKEYBYTES)
29218 throw new Error('bad public key size');
29219 var sm = new Uint8Array(crypto_sign_BYTES + msg.length);
29220 var m = new Uint8Array(crypto_sign_BYTES + msg.length);
29221 var i;
29222 for (i = 0; i < crypto_sign_BYTES; i++) sm[i] = sig[i];
29223 for (i = 0; i < msg.length; i++) sm[i+crypto_sign_BYTES] = msg[i];
29224 return (crypto_sign_open(m, sm, sm.length, publicKey) >= 0);
29225};
29226
29227nacl.sign.keyPair = function() {
29228 var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
29229 var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
29230 crypto_sign_keypair(pk, sk);
29231 return {publicKey: pk, secretKey: sk};
29232};
29233
29234nacl.sign.keyPair.fromSecretKey = function(secretKey) {
29235 checkArrayTypes(secretKey);
29236 if (secretKey.length !== crypto_sign_SECRETKEYBYTES)
29237 throw new Error('bad secret key size');
29238 var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
29239 for (var i = 0; i < pk.length; i++) pk[i] = secretKey[32+i];
29240 return {publicKey: pk, secretKey: new Uint8Array(secretKey)};
29241};
29242
29243nacl.sign.keyPair.fromSeed = function(seed) {
29244 checkArrayTypes(seed);
29245 if (seed.length !== crypto_sign_SEEDBYTES)
29246 throw new Error('bad seed size');
29247 var pk = new Uint8Array(crypto_sign_PUBLICKEYBYTES);
29248 var sk = new Uint8Array(crypto_sign_SECRETKEYBYTES);
29249 for (var i = 0; i < 32; i++) sk[i] = seed[i];
29250 crypto_sign_keypair(pk, sk, true);
29251 return {publicKey: pk, secretKey: sk};
29252};
29253
29254nacl.sign.publicKeyLength = crypto_sign_PUBLICKEYBYTES;
29255nacl.sign.secretKeyLength = crypto_sign_SECRETKEYBYTES;
29256nacl.sign.seedLength = crypto_sign_SEEDBYTES;
29257nacl.sign.signatureLength = crypto_sign_BYTES;
29258
29259nacl.hash = function(msg) {
29260 checkArrayTypes(msg);
29261 var h = new Uint8Array(crypto_hash_BYTES);
29262 crypto_hash(h, msg, msg.length);
29263 return h;
29264};
29265
29266nacl.hash.hashLength = crypto_hash_BYTES;
29267
29268nacl.verify = function(x, y) {
29269 checkArrayTypes(x, y);
29270 // Zero length arguments are considered not equal.
29271 if (x.length === 0 || y.length === 0) return false;
29272 if (x.length !== y.length) return false;
29273 return (vn(x, 0, y, 0, x.length) === 0) ? true : false;
29274};
29275
29276nacl.setPRNG = function(fn) {
29277 randombytes = fn;
29278};
29279
29280(function() {
29281 // Initialize PRNG if environment provides CSPRNG.
29282 // If not, methods calling randombytes will throw.
29283 var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null;
29284 if (crypto && crypto.getRandomValues) {
29285 // Browsers.
29286 var QUOTA = 65536;
29287 nacl.setPRNG(function(x, n) {
29288 var i, v = new Uint8Array(n);
29289 for (i = 0; i < n; i += QUOTA) {
29290 crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA)));
29291 }
29292 for (i = 0; i < n; i++) x[i] = v[i];
29293 cleanup(v);
29294 });
29295 } else if (true) {
29296 // Node.js.
29297 crypto = __webpack_require__(21);
29298 if (crypto && crypto.randomBytes) {
29299 nacl.setPRNG(function(x, n) {
29300 var i, v = crypto.randomBytes(n);
29301 for (i = 0; i < n; i++) x[i] = v[i];
29302 cleanup(v);
29303 });
29304 }
29305 }
29306})();
29307
29308})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {}));
29309
29310
29311/***/ }),
29312/* 72 */
29313/***/ (function(module, exports) {
29314
29315module.exports = require("os");
29316
29317/***/ }),
29318/* 73 */
29319/***/ (function(module, exports, __webpack_require__) {
29320
29321"use strict";
29322
29323/**
29324 * Base prompt implementation
29325 * Should be extended by prompt types.
29326 */
29327
29328var _promise;
29329
29330function _load_promise() {
29331 return _promise = _interopRequireDefault(__webpack_require__(7));
29332}
29333
29334var _classCallCheck2;
29335
29336function _load_classCallCheck() {
29337 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
29338}
29339
29340function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29341
29342var _ = __webpack_require__(45);
29343var chalk = __webpack_require__(37);
29344var runAsync = __webpack_require__(172);
29345
29346var _require = __webpack_require__(65),
29347 filter = _require.filter,
29348 flatMap = _require.flatMap,
29349 share = _require.share,
29350 take = _require.take,
29351 takeUntil = _require.takeUntil;
29352
29353var Choices = __webpack_require__(466);
29354var ScreenManager = __webpack_require__(477);
29355
29356var Prompt = function () {
29357 function Prompt(question, rl, answers) {
29358 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Prompt);
29359
29360 // Setup instance defaults property
29361 _.assign(this, {
29362 answers: answers,
29363 status: 'pending'
29364 });
29365
29366 // Set defaults prompt options
29367 this.opt = _.defaults(_.clone(question), {
29368 validate: function validate() {
29369 return true;
29370 },
29371 filter: function filter(val) {
29372 return val;
29373 },
29374 when: function when() {
29375 return true;
29376 },
29377 suffix: '',
29378 prefix: chalk.green('?')
29379 });
29380
29381 // Make sure name is present
29382 if (!this.opt.name) {
29383 this.throwParamError('name');
29384 }
29385
29386 // Set default message if no message defined
29387 if (!this.opt.message) {
29388 this.opt.message = this.opt.name + ':';
29389 }
29390
29391 // Normalize choices
29392 if (Array.isArray(this.opt.choices)) {
29393 this.opt.choices = new Choices(this.opt.choices, answers);
29394 }
29395
29396 this.rl = rl;
29397 this.screen = new ScreenManager(this.rl);
29398 }
29399
29400 /**
29401 * Start the Inquiry session and manage output value filtering
29402 * @return {Promise}
29403 */
29404
29405 Prompt.prototype.run = function run() {
29406 var _this = this;
29407
29408 return new (_promise || _load_promise()).default(function (resolve) {
29409 _this._run(function (value) {
29410 return resolve(value);
29411 });
29412 });
29413 };
29414
29415 // Default noop (this one should be overwritten in prompts)
29416
29417
29418 Prompt.prototype._run = function _run(cb) {
29419 cb();
29420 };
29421
29422 /**
29423 * Throw an error telling a required parameter is missing
29424 * @param {String} name Name of the missing param
29425 * @return {Throw Error}
29426 */
29427
29428 Prompt.prototype.throwParamError = function throwParamError(name) {
29429 throw new Error('You must provide a `' + name + '` parameter');
29430 };
29431
29432 /**
29433 * Called when the UI closes. Override to do any specific cleanup necessary
29434 */
29435
29436
29437 Prompt.prototype.close = function close() {
29438 this.screen.releaseCursor();
29439 };
29440
29441 /**
29442 * Run the provided validation method each time a submit event occur.
29443 * @param {Rx.Observable} submit - submit event flow
29444 * @return {Object} Object containing two observables: `success` and `error`
29445 */
29446
29447
29448 Prompt.prototype.handleSubmitEvents = function handleSubmitEvents(submit) {
29449 var self = this;
29450 var validate = runAsync(this.opt.validate);
29451 var asyncFilter = runAsync(this.opt.filter);
29452 var validation = submit.pipe(flatMap(function (value) {
29453 return asyncFilter(value, self.answers).then(function (filteredValue) {
29454 return validate(filteredValue, self.answers).then(function (isValid) {
29455 return { isValid: isValid, value: filteredValue };
29456 }, function (err) {
29457 return { isValid: err };
29458 });
29459 }, function (err) {
29460 return { isValid: err };
29461 });
29462 }), share());
29463
29464 var success = validation.pipe(filter(function (state) {
29465 return state.isValid === true;
29466 }), take(1));
29467 var error = validation.pipe(filter(function (state) {
29468 return state.isValid !== true;
29469 }), takeUntil(success));
29470
29471 return {
29472 success: success,
29473 error: error
29474 };
29475 };
29476
29477 /**
29478 * Generate the prompt question string
29479 * @return {String} prompt question string
29480 */
29481
29482 Prompt.prototype.getQuestion = function getQuestion() {
29483 var message = this.opt.prefix + ' ' + chalk.bold(this.opt.message) + this.opt.suffix + chalk.reset(' ');
29484
29485 // Append the default if available, and if question isn't answered
29486 if (this.opt.default != null && this.status !== 'answered') {
29487 // If default password is supplied, hide it
29488 if (this.opt.type === 'password') {
29489 message += chalk.italic.dim('[hidden] ');
29490 } else {
29491 message += chalk.dim('(' + this.opt.default + ') ');
29492 }
29493 }
29494
29495 return message;
29496 };
29497
29498 return Prompt;
29499}();
29500
29501module.exports = Prompt;
29502
29503/***/ }),
29504/* 74 */
29505/***/ (function(module, exports, __webpack_require__) {
29506
29507"use strict";
29508
29509
29510var _require = __webpack_require__(173),
29511 fromEvent = _require.fromEvent;
29512
29513var _require2 = __webpack_require__(65),
29514 filter = _require2.filter,
29515 map = _require2.map,
29516 share = _require2.share;
29517
29518function normalizeKeypressEvents(value, key) {
29519 return { value: value, key: key || {} };
29520}
29521
29522module.exports = function (rl) {
29523 var keypress = fromEvent(rl.input, 'keypress', normalizeKeypressEvents)
29524 // Ignore `enter` key. On the readline, we only care about the `line` event.
29525 .pipe(filter(function (_ref) {
29526 var key = _ref.key;
29527 return key.name !== 'enter' && key.name !== 'return';
29528 }));
29529
29530 return {
29531 line: fromEvent(rl, 'line'),
29532 keypress: keypress,
29533
29534 normalizedUpKey: keypress.pipe(filter(function (_ref2) {
29535 var key = _ref2.key;
29536 return key.name === 'up' || key.name === 'k' || key.name === 'p' && key.ctrl;
29537 }), share()),
29538
29539 normalizedDownKey: keypress.pipe(filter(function (_ref3) {
29540 var key = _ref3.key;
29541 return key.name === 'down' || key.name === 'j' || key.name === 'n' && key.ctrl;
29542 }), share()),
29543
29544 numberKey: keypress.pipe(filter(function (e) {
29545 return e.value && '123456789'.indexOf(e.value) >= 0;
29546 }), map(function (e) {
29547 return Number(e.value);
29548 }), share()),
29549
29550 spaceKey: keypress.pipe(filter(function (_ref4) {
29551 var key = _ref4.key;
29552 return key && key.name === 'space';
29553 }), share()),
29554 aKey: keypress.pipe(filter(function (_ref5) {
29555 var key = _ref5.key;
29556 return key && key.name === 'a';
29557 }), share()),
29558 iKey: keypress.pipe(filter(function (_ref6) {
29559 var key = _ref6.key;
29560 return key && key.name === 'i';
29561 }), share())
29562 };
29563};
29564
29565/***/ }),
29566/* 75 */
29567/***/ (function(module, exports, __webpack_require__) {
29568
29569"use strict";
29570
29571
29572Object.defineProperty(exports, "__esModule", {
29573 value: true
29574});
29575exports.hostedGit = exports.registries = undefined;
29576
29577var _classCallCheck2;
29578
29579function _load_classCallCheck() {
29580 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
29581}
29582
29583var _possibleConstructorReturn2;
29584
29585function _load_possibleConstructorReturn() {
29586 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
29587}
29588
29589var _inherits2;
29590
29591function _load_inherits() {
29592 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
29593}
29594
29595var _getIterator2;
29596
29597function _load_getIterator() {
29598 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
29599}
29600
29601var _set;
29602
29603function _load_set() {
29604 return _set = _interopRequireDefault(__webpack_require__(16));
29605}
29606
29607exports.getExoticResolver = getExoticResolver;
29608exports.hostedGitFragmentToGitUrl = hostedGitFragmentToGitUrl;
29609
29610var _baseResolver;
29611
29612function _load_baseResolver() {
29613 return _baseResolver = _interopRequireDefault(__webpack_require__(117));
29614}
29615
29616var _npmResolver;
29617
29618function _load_npmResolver() {
29619 return _npmResolver = _interopRequireDefault(__webpack_require__(204));
29620}
29621
29622var _yarnResolver;
29623
29624function _load_yarnResolver() {
29625 return _yarnResolver = _interopRequireDefault(__webpack_require__(532));
29626}
29627
29628var _gitResolver;
29629
29630function _load_gitResolver() {
29631 return _gitResolver = _interopRequireDefault(__webpack_require__(118));
29632}
29633
29634var _tarballResolver;
29635
29636function _load_tarballResolver() {
29637 return _tarballResolver = _interopRequireDefault(__webpack_require__(530));
29638}
29639
29640var _githubResolver;
29641
29642function _load_githubResolver() {
29643 return _githubResolver = _interopRequireDefault(__webpack_require__(304));
29644}
29645
29646var _fileResolver;
29647
29648function _load_fileResolver() {
29649 return _fileResolver = _interopRequireDefault(__webpack_require__(202));
29650}
29651
29652var _linkResolver;
29653
29654function _load_linkResolver() {
29655 return _linkResolver = _interopRequireDefault(__webpack_require__(305));
29656}
29657
29658var _gitlabResolver;
29659
29660function _load_gitlabResolver() {
29661 return _gitlabResolver = _interopRequireDefault(__webpack_require__(528));
29662}
29663
29664var _gistResolver;
29665
29666function _load_gistResolver() {
29667 return _gistResolver = _interopRequireDefault(__webpack_require__(203));
29668}
29669
29670var _bitbucketResolver;
29671
29672function _load_bitbucketResolver() {
29673 return _bitbucketResolver = _interopRequireDefault(__webpack_require__(527));
29674}
29675
29676var _hostedGitResolver;
29677
29678function _load_hostedGitResolver() {
29679 return _hostedGitResolver = __webpack_require__(99);
29680}
29681
29682var _registryResolver;
29683
29684function _load_registryResolver() {
29685 return _registryResolver = _interopRequireDefault(__webpack_require__(529));
29686}
29687
29688function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29689
29690var registries = exports.registries = {
29691 npm: (_npmResolver || _load_npmResolver()).default,
29692 yarn: (_yarnResolver || _load_yarnResolver()).default
29693};
29694
29695//
29696
29697var exotics = new (_set || _load_set()).default([(_gitResolver || _load_gitResolver()).default, (_tarballResolver || _load_tarballResolver()).default, (_githubResolver || _load_githubResolver()).default, (_fileResolver || _load_fileResolver()).default, (_linkResolver || _load_linkResolver()).default, (_gitlabResolver || _load_gitlabResolver()).default, (_gistResolver || _load_gistResolver()).default, (_bitbucketResolver || _load_bitbucketResolver()).default]);
29698
29699function getExoticResolver(pattern) {
29700 for (var _iterator = exotics, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
29701 var _ref;
29702
29703 if (_isArray) {
29704 if (_i >= _iterator.length) break;
29705 _ref = _iterator[_i++];
29706 } else {
29707 _i = _iterator.next();
29708 if (_i.done) break;
29709 _ref = _i.value;
29710 }
29711
29712 var Resolver = _ref;
29713
29714 if (Resolver.isVersion(pattern)) {
29715 return Resolver;
29716 }
29717 }
29718 return null;
29719}
29720
29721//
29722
29723var hostedGit = exports.hostedGit = {
29724 github: (_githubResolver || _load_githubResolver()).default,
29725 gitlab: (_gitlabResolver || _load_gitlabResolver()).default,
29726 bitbucket: (_bitbucketResolver || _load_bitbucketResolver()).default
29727};
29728
29729function hostedGitFragmentToGitUrl(fragment, reporter) {
29730 for (var key in hostedGit) {
29731 var Resolver = hostedGit[key];
29732 if (Resolver.isVersion(fragment)) {
29733 return Resolver.getGitHTTPUrl((0, (_hostedGitResolver || _load_hostedGitResolver()).explodeHostedGitFragment)(fragment, reporter));
29734 }
29735 }
29736
29737 return fragment;
29738}
29739
29740//
29741
29742for (var key in registries) {
29743 var _class, _temp;
29744
29745 var RegistryResolver = registries[key];
29746
29747 exotics.add((_temp = _class = function (_ExoticRegistryResolv) {
29748 (0, (_inherits2 || _load_inherits()).default)(_class, _ExoticRegistryResolv);
29749
29750 function _class() {
29751 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, _class);
29752 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticRegistryResolv.apply(this, arguments));
29753 }
29754
29755 return _class;
29756 }((_registryResolver || _load_registryResolver()).default), _class.protocol = key, _class.factory = RegistryResolver, _temp));
29757}
29758
29759/***/ }),
29760/* 76 */
29761/***/ (function(module, exports) {
29762
29763module.exports = function (exec) {
29764 try {
29765 return !!exec();
29766 } catch (e) {
29767 return true;
29768 }
29769};
29770
29771
29772/***/ }),
29773/* 77 */
29774/***/ (function(module, exports, __webpack_require__) {
29775
29776var dP = __webpack_require__(63);
29777var createDesc = __webpack_require__(126);
29778module.exports = __webpack_require__(68) ? function (object, key, value) {
29779 return dP.f(object, key, createDesc(1, value));
29780} : function (object, key, value) {
29781 object[key] = value;
29782 return object;
29783};
29784
29785
29786/***/ }),
29787/* 78 */
29788/***/ (function(module, exports, __webpack_require__) {
29789
29790try {
29791 var util = __webpack_require__(9);
29792 if (typeof util.inherits !== 'function') throw '';
29793 module.exports = util.inherits;
29794} catch (e) {
29795 module.exports = __webpack_require__(746);
29796}
29797
29798
29799/***/ }),
29800/* 79 */
29801/***/ (function(module, exports, __webpack_require__) {
29802
29803(function(){
29804
29805 // Copyright (c) 2005 Tom Wu
29806 // All Rights Reserved.
29807 // See "LICENSE" for details.
29808
29809 // Basic JavaScript BN library - subset useful for RSA encryption.
29810
29811 // Bits per digit
29812 var dbits;
29813
29814 // JavaScript engine analysis
29815 var canary = 0xdeadbeefcafe;
29816 var j_lm = ((canary&0xffffff)==0xefcafe);
29817
29818 // (public) Constructor
29819 function BigInteger(a,b,c) {
29820 if(a != null)
29821 if("number" == typeof a) this.fromNumber(a,b,c);
29822 else if(b == null && "string" != typeof a) this.fromString(a,256);
29823 else this.fromString(a,b);
29824 }
29825
29826 // return new, unset BigInteger
29827 function nbi() { return new BigInteger(null); }
29828
29829 // am: Compute w_j += (x*this_i), propagate carries,
29830 // c is initial carry, returns final carry.
29831 // c < 3*dvalue, x < 2*dvalue, this_i < dvalue
29832 // We need to select the fastest one that works in this environment.
29833
29834 // am1: use a single mult and divide to get the high bits,
29835 // max digit bits should be 26 because
29836 // max internal value = 2*dvalue^2-2*dvalue (< 2^53)
29837 function am1(i,x,w,j,c,n) {
29838 while(--n >= 0) {
29839 var v = x*this[i++]+w[j]+c;
29840 c = Math.floor(v/0x4000000);
29841 w[j++] = v&0x3ffffff;
29842 }
29843 return c;
29844 }
29845 // am2 avoids a big mult-and-extract completely.
29846 // Max digit bits should be <= 30 because we do bitwise ops
29847 // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
29848 function am2(i,x,w,j,c,n) {
29849 var xl = x&0x7fff, xh = x>>15;
29850 while(--n >= 0) {
29851 var l = this[i]&0x7fff;
29852 var h = this[i++]>>15;
29853 var m = xh*l+h*xl;
29854 l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
29855 c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
29856 w[j++] = l&0x3fffffff;
29857 }
29858 return c;
29859 }
29860 // Alternately, set max digit bits to 28 since some
29861 // browsers slow down when dealing with 32-bit numbers.
29862 function am3(i,x,w,j,c,n) {
29863 var xl = x&0x3fff, xh = x>>14;
29864 while(--n >= 0) {
29865 var l = this[i]&0x3fff;
29866 var h = this[i++]>>14;
29867 var m = xh*l+h*xl;
29868 l = xl*l+((m&0x3fff)<<14)+w[j]+c;
29869 c = (l>>28)+(m>>14)+xh*h;
29870 w[j++] = l&0xfffffff;
29871 }
29872 return c;
29873 }
29874 var inBrowser = typeof navigator !== "undefined";
29875 if(inBrowser && j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
29876 BigInteger.prototype.am = am2;
29877 dbits = 30;
29878 }
29879 else if(inBrowser && j_lm && (navigator.appName != "Netscape")) {
29880 BigInteger.prototype.am = am1;
29881 dbits = 26;
29882 }
29883 else { // Mozilla/Netscape seems to prefer am3
29884 BigInteger.prototype.am = am3;
29885 dbits = 28;
29886 }
29887
29888 BigInteger.prototype.DB = dbits;
29889 BigInteger.prototype.DM = ((1<<dbits)-1);
29890 BigInteger.prototype.DV = (1<<dbits);
29891
29892 var BI_FP = 52;
29893 BigInteger.prototype.FV = Math.pow(2,BI_FP);
29894 BigInteger.prototype.F1 = BI_FP-dbits;
29895 BigInteger.prototype.F2 = 2*dbits-BI_FP;
29896
29897 // Digit conversions
29898 var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
29899 var BI_RC = new Array();
29900 var rr,vv;
29901 rr = "0".charCodeAt(0);
29902 for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
29903 rr = "a".charCodeAt(0);
29904 for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
29905 rr = "A".charCodeAt(0);
29906 for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
29907
29908 function int2char(n) { return BI_RM.charAt(n); }
29909 function intAt(s,i) {
29910 var c = BI_RC[s.charCodeAt(i)];
29911 return (c==null)?-1:c;
29912 }
29913
29914 // (protected) copy this to r
29915 function bnpCopyTo(r) {
29916 for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
29917 r.t = this.t;
29918 r.s = this.s;
29919 }
29920
29921 // (protected) set from integer value x, -DV <= x < DV
29922 function bnpFromInt(x) {
29923 this.t = 1;
29924 this.s = (x<0)?-1:0;
29925 if(x > 0) this[0] = x;
29926 else if(x < -1) this[0] = x+this.DV;
29927 else this.t = 0;
29928 }
29929
29930 // return bigint initialized to value
29931 function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
29932
29933 // (protected) set from string and radix
29934 function bnpFromString(s,b) {
29935 var k;
29936 if(b == 16) k = 4;
29937 else if(b == 8) k = 3;
29938 else if(b == 256) k = 8; // byte array
29939 else if(b == 2) k = 1;
29940 else if(b == 32) k = 5;
29941 else if(b == 4) k = 2;
29942 else { this.fromRadix(s,b); return; }
29943 this.t = 0;
29944 this.s = 0;
29945 var i = s.length, mi = false, sh = 0;
29946 while(--i >= 0) {
29947 var x = (k==8)?s[i]&0xff:intAt(s,i);
29948 if(x < 0) {
29949 if(s.charAt(i) == "-") mi = true;
29950 continue;
29951 }
29952 mi = false;
29953 if(sh == 0)
29954 this[this.t++] = x;
29955 else if(sh+k > this.DB) {
29956 this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<<sh;
29957 this[this.t++] = (x>>(this.DB-sh));
29958 }
29959 else
29960 this[this.t-1] |= x<<sh;
29961 sh += k;
29962 if(sh >= this.DB) sh -= this.DB;
29963 }
29964 if(k == 8 && (s[0]&0x80) != 0) {
29965 this.s = -1;
29966 if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)<<sh;
29967 }
29968 this.clamp();
29969 if(mi) BigInteger.ZERO.subTo(this,this);
29970 }
29971
29972 // (protected) clamp off excess high words
29973 function bnpClamp() {
29974 var c = this.s&this.DM;
29975 while(this.t > 0 && this[this.t-1] == c) --this.t;
29976 }
29977
29978 // (public) return string representation in given radix
29979 function bnToString(b) {
29980 if(this.s < 0) return "-"+this.negate().toString(b);
29981 var k;
29982 if(b == 16) k = 4;
29983 else if(b == 8) k = 3;
29984 else if(b == 2) k = 1;
29985 else if(b == 32) k = 5;
29986 else if(b == 4) k = 2;
29987 else return this.toRadix(b);
29988 var km = (1<<k)-1, d, m = false, r = "", i = this.t;
29989 var p = this.DB-(i*this.DB)%k;
29990 if(i-- > 0) {
29991 if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }
29992 while(i >= 0) {
29993 if(p < k) {
29994 d = (this[i]&((1<<p)-1))<<(k-p);
29995 d |= this[--i]>>(p+=this.DB-k);
29996 }
29997 else {
29998 d = (this[i]>>(p-=k))&km;
29999 if(p <= 0) { p += this.DB; --i; }
30000 }
30001 if(d > 0) m = true;
30002 if(m) r += int2char(d);
30003 }
30004 }
30005 return m?r:"0";
30006 }
30007
30008 // (public) -this
30009 function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
30010
30011 // (public) |this|
30012 function bnAbs() { return (this.s<0)?this.negate():this; }
30013
30014 // (public) return + if this > a, - if this < a, 0 if equal
30015 function bnCompareTo(a) {
30016 var r = this.s-a.s;
30017 if(r != 0) return r;
30018 var i = this.t;
30019 r = i-a.t;
30020 if(r != 0) return (this.s<0)?-r:r;
30021 while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
30022 return 0;
30023 }
30024
30025 // returns bit length of the integer x
30026 function nbits(x) {
30027 var r = 1, t;
30028 if((t=x>>>16) != 0) { x = t; r += 16; }
30029 if((t=x>>8) != 0) { x = t; r += 8; }
30030 if((t=x>>4) != 0) { x = t; r += 4; }
30031 if((t=x>>2) != 0) { x = t; r += 2; }
30032 if((t=x>>1) != 0) { x = t; r += 1; }
30033 return r;
30034 }
30035
30036 // (public) return the number of bits in "this"
30037 function bnBitLength() {
30038 if(this.t <= 0) return 0;
30039 return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
30040 }
30041
30042 // (protected) r = this << n*DB
30043 function bnpDLShiftTo(n,r) {
30044 var i;
30045 for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
30046 for(i = n-1; i >= 0; --i) r[i] = 0;
30047 r.t = this.t+n;
30048 r.s = this.s;
30049 }
30050
30051 // (protected) r = this >> n*DB
30052 function bnpDRShiftTo(n,r) {
30053 for(var i = n; i < this.t; ++i) r[i-n] = this[i];
30054 r.t = Math.max(this.t-n,0);
30055 r.s = this.s;
30056 }
30057
30058 // (protected) r = this << n
30059 function bnpLShiftTo(n,r) {
30060 var bs = n%this.DB;
30061 var cbs = this.DB-bs;
30062 var bm = (1<<cbs)-1;
30063 var ds = Math.floor(n/this.DB), c = (this.s<<bs)&this.DM, i;
30064 for(i = this.t-1; i >= 0; --i) {
30065 r[i+ds+1] = (this[i]>>cbs)|c;
30066 c = (this[i]&bm)<<bs;
30067 }
30068 for(i = ds-1; i >= 0; --i) r[i] = 0;
30069 r[ds] = c;
30070 r.t = this.t+ds+1;
30071 r.s = this.s;
30072 r.clamp();
30073 }
30074
30075 // (protected) r = this >> n
30076 function bnpRShiftTo(n,r) {
30077 r.s = this.s;
30078 var ds = Math.floor(n/this.DB);
30079 if(ds >= this.t) { r.t = 0; return; }
30080 var bs = n%this.DB;
30081 var cbs = this.DB-bs;
30082 var bm = (1<<bs)-1;
30083 r[0] = this[ds]>>bs;
30084 for(var i = ds+1; i < this.t; ++i) {
30085 r[i-ds-1] |= (this[i]&bm)<<cbs;
30086 r[i-ds] = this[i]>>bs;
30087 }
30088 if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<<cbs;
30089 r.t = this.t-ds;
30090 r.clamp();
30091 }
30092
30093 // (protected) r = this - a
30094 function bnpSubTo(a,r) {
30095 var i = 0, c = 0, m = Math.min(a.t,this.t);
30096 while(i < m) {
30097 c += this[i]-a[i];
30098 r[i++] = c&this.DM;
30099 c >>= this.DB;
30100 }
30101 if(a.t < this.t) {
30102 c -= a.s;
30103 while(i < this.t) {
30104 c += this[i];
30105 r[i++] = c&this.DM;
30106 c >>= this.DB;
30107 }
30108 c += this.s;
30109 }
30110 else {
30111 c += this.s;
30112 while(i < a.t) {
30113 c -= a[i];
30114 r[i++] = c&this.DM;
30115 c >>= this.DB;
30116 }
30117 c -= a.s;
30118 }
30119 r.s = (c<0)?-1:0;
30120 if(c < -1) r[i++] = this.DV+c;
30121 else if(c > 0) r[i++] = c;
30122 r.t = i;
30123 r.clamp();
30124 }
30125
30126 // (protected) r = this * a, r != this,a (HAC 14.12)
30127 // "this" should be the larger one if appropriate.
30128 function bnpMultiplyTo(a,r) {
30129 var x = this.abs(), y = a.abs();
30130 var i = x.t;
30131 r.t = i+y.t;
30132 while(--i >= 0) r[i] = 0;
30133 for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
30134 r.s = 0;
30135 r.clamp();
30136 if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
30137 }
30138
30139 // (protected) r = this^2, r != this (HAC 14.16)
30140 function bnpSquareTo(r) {
30141 var x = this.abs();
30142 var i = r.t = 2*x.t;
30143 while(--i >= 0) r[i] = 0;
30144 for(i = 0; i < x.t-1; ++i) {
30145 var c = x.am(i,x[i],r,2*i,0,1);
30146 if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
30147 r[i+x.t] -= x.DV;
30148 r[i+x.t+1] = 1;
30149 }
30150 }
30151 if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
30152 r.s = 0;
30153 r.clamp();
30154 }
30155
30156 // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
30157 // r != q, this != m. q or r may be null.
30158 function bnpDivRemTo(m,q,r) {
30159 var pm = m.abs();
30160 if(pm.t <= 0) return;
30161 var pt = this.abs();
30162 if(pt.t < pm.t) {
30163 if(q != null) q.fromInt(0);
30164 if(r != null) this.copyTo(r);
30165 return;
30166 }
30167 if(r == null) r = nbi();
30168 var y = nbi(), ts = this.s, ms = m.s;
30169 var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus
30170 if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
30171 else { pm.copyTo(y); pt.copyTo(r); }
30172 var ys = y.t;
30173 var y0 = y[ys-1];
30174 if(y0 == 0) return;
30175 var yt = y0*(1<<this.F1)+((ys>1)?y[ys-2]>>this.F2:0);
30176 var d1 = this.FV/yt, d2 = (1<<this.F1)/yt, e = 1<<this.F2;
30177 var i = r.t, j = i-ys, t = (q==null)?nbi():q;
30178 y.dlShiftTo(j,t);
30179 if(r.compareTo(t) >= 0) {
30180 r[r.t++] = 1;
30181 r.subTo(t,r);
30182 }
30183 BigInteger.ONE.dlShiftTo(ys,t);
30184 t.subTo(y,y); // "negative" y so we can replace sub with am later
30185 while(y.t < ys) y[y.t++] = 0;
30186 while(--j >= 0) {
30187 // Estimate quotient digit
30188 var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
30189 if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
30190 y.dlShiftTo(j,t);
30191 r.subTo(t,r);
30192 while(r[i] < --qd) r.subTo(t,r);
30193 }
30194 }
30195 if(q != null) {
30196 r.drShiftTo(ys,q);
30197 if(ts != ms) BigInteger.ZERO.subTo(q,q);
30198 }
30199 r.t = ys;
30200 r.clamp();
30201 if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
30202 if(ts < 0) BigInteger.ZERO.subTo(r,r);
30203 }
30204
30205 // (public) this mod a
30206 function bnMod(a) {
30207 var r = nbi();
30208 this.abs().divRemTo(a,null,r);
30209 if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
30210 return r;
30211 }
30212
30213 // Modular reduction using "classic" algorithm
30214 function Classic(m) { this.m = m; }
30215 function cConvert(x) {
30216 if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
30217 else return x;
30218 }
30219 function cRevert(x) { return x; }
30220 function cReduce(x) { x.divRemTo(this.m,null,x); }
30221 function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
30222 function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
30223
30224 Classic.prototype.convert = cConvert;
30225 Classic.prototype.revert = cRevert;
30226 Classic.prototype.reduce = cReduce;
30227 Classic.prototype.mulTo = cMulTo;
30228 Classic.prototype.sqrTo = cSqrTo;
30229
30230 // (protected) return "-1/this % 2^DB"; useful for Mont. reduction
30231 // justification:
30232 // xy == 1 (mod m)
30233 // xy = 1+km
30234 // xy(2-xy) = (1+km)(1-km)
30235 // x[y(2-xy)] = 1-k^2m^2
30236 // x[y(2-xy)] == 1 (mod m^2)
30237 // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
30238 // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
30239 // JS multiply "overflows" differently from C/C++, so care is needed here.
30240 function bnpInvDigit() {
30241 if(this.t < 1) return 0;
30242 var x = this[0];
30243 if((x&1) == 0) return 0;
30244 var y = x&3; // y == 1/x mod 2^2
30245 y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
30246 y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
30247 y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
30248 // last step - calculate inverse mod DV directly;
30249 // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
30250 y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
30251 // we really want the negative inverse, and -DV < y < DV
30252 return (y>0)?this.DV-y:-y;
30253 }
30254
30255 // Montgomery reduction
30256 function Montgomery(m) {
30257 this.m = m;
30258 this.mp = m.invDigit();
30259 this.mpl = this.mp&0x7fff;
30260 this.mph = this.mp>>15;
30261 this.um = (1<<(m.DB-15))-1;
30262 this.mt2 = 2*m.t;
30263 }
30264
30265 // xR mod m
30266 function montConvert(x) {
30267 var r = nbi();
30268 x.abs().dlShiftTo(this.m.t,r);
30269 r.divRemTo(this.m,null,r);
30270 if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
30271 return r;
30272 }
30273
30274 // x/R mod m
30275 function montRevert(x) {
30276 var r = nbi();
30277 x.copyTo(r);
30278 this.reduce(r);
30279 return r;
30280 }
30281
30282 // x = x/R mod m (HAC 14.32)
30283 function montReduce(x) {
30284 while(x.t <= this.mt2) // pad x so am has enough room later
30285 x[x.t++] = 0;
30286 for(var i = 0; i < this.m.t; ++i) {
30287 // faster way of calculating u0 = x[i]*mp mod DV
30288 var j = x[i]&0x7fff;
30289 var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
30290 // use am to combine the multiply-shift-add into one call
30291 j = i+this.m.t;
30292 x[j] += this.m.am(0,u0,x,i,0,this.m.t);
30293 // propagate carry
30294 while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
30295 }
30296 x.clamp();
30297 x.drShiftTo(this.m.t,x);
30298 if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
30299 }
30300
30301 // r = "x^2/R mod m"; x != r
30302 function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
30303
30304 // r = "xy/R mod m"; x,y != r
30305 function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
30306
30307 Montgomery.prototype.convert = montConvert;
30308 Montgomery.prototype.revert = montRevert;
30309 Montgomery.prototype.reduce = montReduce;
30310 Montgomery.prototype.mulTo = montMulTo;
30311 Montgomery.prototype.sqrTo = montSqrTo;
30312
30313 // (protected) true iff this is even
30314 function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
30315
30316 // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
30317 function bnpExp(e,z) {
30318 if(e > 0xffffffff || e < 1) return BigInteger.ONE;
30319 var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
30320 g.copyTo(r);
30321 while(--i >= 0) {
30322 z.sqrTo(r,r2);
30323 if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
30324 else { var t = r; r = r2; r2 = t; }
30325 }
30326 return z.revert(r);
30327 }
30328
30329 // (public) this^e % m, 0 <= e < 2^32
30330 function bnModPowInt(e,m) {
30331 var z;
30332 if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
30333 return this.exp(e,z);
30334 }
30335
30336 // protected
30337 BigInteger.prototype.copyTo = bnpCopyTo;
30338 BigInteger.prototype.fromInt = bnpFromInt;
30339 BigInteger.prototype.fromString = bnpFromString;
30340 BigInteger.prototype.clamp = bnpClamp;
30341 BigInteger.prototype.dlShiftTo = bnpDLShiftTo;
30342 BigInteger.prototype.drShiftTo = bnpDRShiftTo;
30343 BigInteger.prototype.lShiftTo = bnpLShiftTo;
30344 BigInteger.prototype.rShiftTo = bnpRShiftTo;
30345 BigInteger.prototype.subTo = bnpSubTo;
30346 BigInteger.prototype.multiplyTo = bnpMultiplyTo;
30347 BigInteger.prototype.squareTo = bnpSquareTo;
30348 BigInteger.prototype.divRemTo = bnpDivRemTo;
30349 BigInteger.prototype.invDigit = bnpInvDigit;
30350 BigInteger.prototype.isEven = bnpIsEven;
30351 BigInteger.prototype.exp = bnpExp;
30352
30353 // public
30354 BigInteger.prototype.toString = bnToString;
30355 BigInteger.prototype.negate = bnNegate;
30356 BigInteger.prototype.abs = bnAbs;
30357 BigInteger.prototype.compareTo = bnCompareTo;
30358 BigInteger.prototype.bitLength = bnBitLength;
30359 BigInteger.prototype.mod = bnMod;
30360 BigInteger.prototype.modPowInt = bnModPowInt;
30361
30362 // "constants"
30363 BigInteger.ZERO = nbv(0);
30364 BigInteger.ONE = nbv(1);
30365
30366 // Copyright (c) 2005-2009 Tom Wu
30367 // All Rights Reserved.
30368 // See "LICENSE" for details.
30369
30370 // Extended JavaScript BN functions, required for RSA private ops.
30371
30372 // Version 1.1: new BigInteger("0", 10) returns "proper" zero
30373 // Version 1.2: square() API, isProbablePrime fix
30374
30375 // (public)
30376 function bnClone() { var r = nbi(); this.copyTo(r); return r; }
30377
30378 // (public) return value as integer
30379 function bnIntValue() {
30380 if(this.s < 0) {
30381 if(this.t == 1) return this[0]-this.DV;
30382 else if(this.t == 0) return -1;
30383 }
30384 else if(this.t == 1) return this[0];
30385 else if(this.t == 0) return 0;
30386 // assumes 16 < DB < 32
30387 return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];
30388 }
30389
30390 // (public) return value as byte
30391 function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }
30392
30393 // (public) return value as short (assumes DB>=16)
30394 function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }
30395
30396 // (protected) return x s.t. r^x < DV
30397 function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
30398
30399 // (public) 0 if this == 0, 1 if this > 0
30400 function bnSigNum() {
30401 if(this.s < 0) return -1;
30402 else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
30403 else return 1;
30404 }
30405
30406 // (protected) convert to radix string
30407 function bnpToRadix(b) {
30408 if(b == null) b = 10;
30409 if(this.signum() == 0 || b < 2 || b > 36) return "0";
30410 var cs = this.chunkSize(b);
30411 var a = Math.pow(b,cs);
30412 var d = nbv(a), y = nbi(), z = nbi(), r = "";
30413 this.divRemTo(d,y,z);
30414 while(y.signum() > 0) {
30415 r = (a+z.intValue()).toString(b).substr(1) + r;
30416 y.divRemTo(d,y,z);
30417 }
30418 return z.intValue().toString(b) + r;
30419 }
30420
30421 // (protected) convert from radix string
30422 function bnpFromRadix(s,b) {
30423 this.fromInt(0);
30424 if(b == null) b = 10;
30425 var cs = this.chunkSize(b);
30426 var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
30427 for(var i = 0; i < s.length; ++i) {
30428 var x = intAt(s,i);
30429 if(x < 0) {
30430 if(s.charAt(i) == "-" && this.signum() == 0) mi = true;
30431 continue;
30432 }
30433 w = b*w+x;
30434 if(++j >= cs) {
30435 this.dMultiply(d);
30436 this.dAddOffset(w,0);
30437 j = 0;
30438 w = 0;
30439 }
30440 }
30441 if(j > 0) {
30442 this.dMultiply(Math.pow(b,j));
30443 this.dAddOffset(w,0);
30444 }
30445 if(mi) BigInteger.ZERO.subTo(this,this);
30446 }
30447
30448 // (protected) alternate constructor
30449 function bnpFromNumber(a,b,c) {
30450 if("number" == typeof b) {
30451 // new BigInteger(int,int,RNG)
30452 if(a < 2) this.fromInt(1);
30453 else {
30454 this.fromNumber(a,c);
30455 if(!this.testBit(a-1)) // force MSB set
30456 this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);
30457 if(this.isEven()) this.dAddOffset(1,0); // force odd
30458 while(!this.isProbablePrime(b)) {
30459 this.dAddOffset(2,0);
30460 if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);
30461 }
30462 }
30463 }
30464 else {
30465 // new BigInteger(int,RNG)
30466 var x = new Array(), t = a&7;
30467 x.length = (a>>3)+1;
30468 b.nextBytes(x);
30469 if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
30470 this.fromString(x,256);
30471 }
30472 }
30473
30474 // (public) convert to bigendian byte array
30475 function bnToByteArray() {
30476 var i = this.t, r = new Array();
30477 r[0] = this.s;
30478 var p = this.DB-(i*this.DB)%8, d, k = 0;
30479 if(i-- > 0) {
30480 if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)
30481 r[k++] = d|(this.s<<(this.DB-p));
30482 while(i >= 0) {
30483 if(p < 8) {
30484 d = (this[i]&((1<<p)-1))<<(8-p);
30485 d |= this[--i]>>(p+=this.DB-8);
30486 }
30487 else {
30488 d = (this[i]>>(p-=8))&0xff;
30489 if(p <= 0) { p += this.DB; --i; }
30490 }
30491 if((d&0x80) != 0) d |= -256;
30492 if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;
30493 if(k > 0 || d != this.s) r[k++] = d;
30494 }
30495 }
30496 return r;
30497 }
30498
30499 function bnEquals(a) { return(this.compareTo(a)==0); }
30500 function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
30501 function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
30502
30503 // (protected) r = this op a (bitwise)
30504 function bnpBitwiseTo(a,op,r) {
30505 var i, f, m = Math.min(a.t,this.t);
30506 for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);
30507 if(a.t < this.t) {
30508 f = a.s&this.DM;
30509 for(i = m; i < this.t; ++i) r[i] = op(this[i],f);
30510 r.t = this.t;
30511 }
30512 else {
30513 f = this.s&this.DM;
30514 for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);
30515 r.t = a.t;
30516 }
30517 r.s = op(this.s,a.s);
30518 r.clamp();
30519 }
30520
30521 // (public) this & a
30522 function op_and(x,y) { return x&y; }
30523 function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
30524
30525 // (public) this | a
30526 function op_or(x,y) { return x|y; }
30527 function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
30528
30529 // (public) this ^ a
30530 function op_xor(x,y) { return x^y; }
30531 function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
30532
30533 // (public) this & ~a
30534 function op_andnot(x,y) { return x&~y; }
30535 function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
30536
30537 // (public) ~this
30538 function bnNot() {
30539 var r = nbi();
30540 for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];
30541 r.t = this.t;
30542 r.s = ~this.s;
30543 return r;
30544 }
30545
30546 // (public) this << n
30547 function bnShiftLeft(n) {
30548 var r = nbi();
30549 if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
30550 return r;
30551 }
30552
30553 // (public) this >> n
30554 function bnShiftRight(n) {
30555 var r = nbi();
30556 if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
30557 return r;
30558 }
30559
30560 // return index of lowest 1-bit in x, x < 2^31
30561 function lbit(x) {
30562 if(x == 0) return -1;
30563 var r = 0;
30564 if((x&0xffff) == 0) { x >>= 16; r += 16; }
30565 if((x&0xff) == 0) { x >>= 8; r += 8; }
30566 if((x&0xf) == 0) { x >>= 4; r += 4; }
30567 if((x&3) == 0) { x >>= 2; r += 2; }
30568 if((x&1) == 0) ++r;
30569 return r;
30570 }
30571
30572 // (public) returns index of lowest 1-bit (or -1 if none)
30573 function bnGetLowestSetBit() {
30574 for(var i = 0; i < this.t; ++i)
30575 if(this[i] != 0) return i*this.DB+lbit(this[i]);
30576 if(this.s < 0) return this.t*this.DB;
30577 return -1;
30578 }
30579
30580 // return number of 1 bits in x
30581 function cbit(x) {
30582 var r = 0;
30583 while(x != 0) { x &= x-1; ++r; }
30584 return r;
30585 }
30586
30587 // (public) return number of set bits
30588 function bnBitCount() {
30589 var r = 0, x = this.s&this.DM;
30590 for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);
30591 return r;
30592 }
30593
30594 // (public) true iff nth bit is set
30595 function bnTestBit(n) {
30596 var j = Math.floor(n/this.DB);
30597 if(j >= this.t) return(this.s!=0);
30598 return((this[j]&(1<<(n%this.DB)))!=0);
30599 }
30600
30601 // (protected) this op (1<<n)
30602 function bnpChangeBit(n,op) {
30603 var r = BigInteger.ONE.shiftLeft(n);
30604 this.bitwiseTo(r,op,r);
30605 return r;
30606 }
30607
30608 // (public) this | (1<<n)
30609 function bnSetBit(n) { return this.changeBit(n,op_or); }
30610
30611 // (public) this & ~(1<<n)
30612 function bnClearBit(n) { return this.changeBit(n,op_andnot); }
30613
30614 // (public) this ^ (1<<n)
30615 function bnFlipBit(n) { return this.changeBit(n,op_xor); }
30616
30617 // (protected) r = this + a
30618 function bnpAddTo(a,r) {
30619 var i = 0, c = 0, m = Math.min(a.t,this.t);
30620 while(i < m) {
30621 c += this[i]+a[i];
30622 r[i++] = c&this.DM;
30623 c >>= this.DB;
30624 }
30625 if(a.t < this.t) {
30626 c += a.s;
30627 while(i < this.t) {
30628 c += this[i];
30629 r[i++] = c&this.DM;
30630 c >>= this.DB;
30631 }
30632 c += this.s;
30633 }
30634 else {
30635 c += this.s;
30636 while(i < a.t) {
30637 c += a[i];
30638 r[i++] = c&this.DM;
30639 c >>= this.DB;
30640 }
30641 c += a.s;
30642 }
30643 r.s = (c<0)?-1:0;
30644 if(c > 0) r[i++] = c;
30645 else if(c < -1) r[i++] = this.DV+c;
30646 r.t = i;
30647 r.clamp();
30648 }
30649
30650 // (public) this + a
30651 function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
30652
30653 // (public) this - a
30654 function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
30655
30656 // (public) this * a
30657 function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
30658
30659 // (public) this^2
30660 function bnSquare() { var r = nbi(); this.squareTo(r); return r; }
30661
30662 // (public) this / a
30663 function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
30664
30665 // (public) this % a
30666 function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
30667
30668 // (public) [this/a,this%a]
30669 function bnDivideAndRemainder(a) {
30670 var q = nbi(), r = nbi();
30671 this.divRemTo(a,q,r);
30672 return new Array(q,r);
30673 }
30674
30675 // (protected) this *= n, this >= 0, 1 < n < DV
30676 function bnpDMultiply(n) {
30677 this[this.t] = this.am(0,n-1,this,0,0,this.t);
30678 ++this.t;
30679 this.clamp();
30680 }
30681
30682 // (protected) this += n << w words, this >= 0
30683 function bnpDAddOffset(n,w) {
30684 if(n == 0) return;
30685 while(this.t <= w) this[this.t++] = 0;
30686 this[w] += n;
30687 while(this[w] >= this.DV) {
30688 this[w] -= this.DV;
30689 if(++w >= this.t) this[this.t++] = 0;
30690 ++this[w];
30691 }
30692 }
30693
30694 // A "null" reducer
30695 function NullExp() {}
30696 function nNop(x) { return x; }
30697 function nMulTo(x,y,r) { x.multiplyTo(y,r); }
30698 function nSqrTo(x,r) { x.squareTo(r); }
30699
30700 NullExp.prototype.convert = nNop;
30701 NullExp.prototype.revert = nNop;
30702 NullExp.prototype.mulTo = nMulTo;
30703 NullExp.prototype.sqrTo = nSqrTo;
30704
30705 // (public) this^e
30706 function bnPow(e) { return this.exp(e,new NullExp()); }
30707
30708 // (protected) r = lower n words of "this * a", a.t <= n
30709 // "this" should be the larger one if appropriate.
30710 function bnpMultiplyLowerTo(a,n,r) {
30711 var i = Math.min(this.t+a.t,n);
30712 r.s = 0; // assumes a,this >= 0
30713 r.t = i;
30714 while(i > 0) r[--i] = 0;
30715 var j;
30716 for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);
30717 for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);
30718 r.clamp();
30719 }
30720
30721 // (protected) r = "this * a" without lower n words, n > 0
30722 // "this" should be the larger one if appropriate.
30723 function bnpMultiplyUpperTo(a,n,r) {
30724 --n;
30725 var i = r.t = this.t+a.t-n;
30726 r.s = 0; // assumes a,this >= 0
30727 while(--i >= 0) r[i] = 0;
30728 for(i = Math.max(n-this.t,0); i < a.t; ++i)
30729 r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);
30730 r.clamp();
30731 r.drShiftTo(1,r);
30732 }
30733
30734 // Barrett modular reduction
30735 function Barrett(m) {
30736 // setup Barrett
30737 this.r2 = nbi();
30738 this.q3 = nbi();
30739 BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
30740 this.mu = this.r2.divide(m);
30741 this.m = m;
30742 }
30743
30744 function barrettConvert(x) {
30745 if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
30746 else if(x.compareTo(this.m) < 0) return x;
30747 else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
30748 }
30749
30750 function barrettRevert(x) { return x; }
30751
30752 // x = x mod m (HAC 14.42)
30753 function barrettReduce(x) {
30754 x.drShiftTo(this.m.t-1,this.r2);
30755 if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }
30756 this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);
30757 this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);
30758 while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);
30759 x.subTo(this.r2,x);
30760 while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
30761 }
30762
30763 // r = x^2 mod m; x != r
30764 function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
30765
30766 // r = x*y mod m; x,y != r
30767 function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
30768
30769 Barrett.prototype.convert = barrettConvert;
30770 Barrett.prototype.revert = barrettRevert;
30771 Barrett.prototype.reduce = barrettReduce;
30772 Barrett.prototype.mulTo = barrettMulTo;
30773 Barrett.prototype.sqrTo = barrettSqrTo;
30774
30775 // (public) this^e % m (HAC 14.85)
30776 function bnModPow(e,m) {
30777 var i = e.bitLength(), k, r = nbv(1), z;
30778 if(i <= 0) return r;
30779 else if(i < 18) k = 1;
30780 else if(i < 48) k = 3;
30781 else if(i < 144) k = 4;
30782 else if(i < 768) k = 5;
30783 else k = 6;
30784 if(i < 8)
30785 z = new Classic(m);
30786 else if(m.isEven())
30787 z = new Barrett(m);
30788 else
30789 z = new Montgomery(m);
30790
30791 // precomputation
30792 var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;
30793 g[1] = z.convert(this);
30794 if(k > 1) {
30795 var g2 = nbi();
30796 z.sqrTo(g[1],g2);
30797 while(n <= km) {
30798 g[n] = nbi();
30799 z.mulTo(g2,g[n-2],g[n]);
30800 n += 2;
30801 }
30802 }
30803
30804 var j = e.t-1, w, is1 = true, r2 = nbi(), t;
30805 i = nbits(e[j])-1;
30806 while(j >= 0) {
30807 if(i >= k1) w = (e[j]>>(i-k1))&km;
30808 else {
30809 w = (e[j]&((1<<(i+1))-1))<<(k1-i);
30810 if(j > 0) w |= e[j-1]>>(this.DB+i-k1);
30811 }
30812
30813 n = k;
30814 while((w&1) == 0) { w >>= 1; --n; }
30815 if((i -= n) < 0) { i += this.DB; --j; }
30816 if(is1) { // ret == 1, don't bother squaring or multiplying it
30817 g[w].copyTo(r);
30818 is1 = false;
30819 }
30820 else {
30821 while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
30822 if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
30823 z.mulTo(r2,g[w],r);
30824 }
30825
30826 while(j >= 0 && (e[j]&(1<<i)) == 0) {
30827 z.sqrTo(r,r2); t = r; r = r2; r2 = t;
30828 if(--i < 0) { i = this.DB-1; --j; }
30829 }
30830 }
30831 return z.revert(r);
30832 }
30833
30834 // (public) gcd(this,a) (HAC 14.54)
30835 function bnGCD(a) {
30836 var x = (this.s<0)?this.negate():this.clone();
30837 var y = (a.s<0)?a.negate():a.clone();
30838 if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }
30839 var i = x.getLowestSetBit(), g = y.getLowestSetBit();
30840 if(g < 0) return x;
30841 if(i < g) g = i;
30842 if(g > 0) {
30843 x.rShiftTo(g,x);
30844 y.rShiftTo(g,y);
30845 }
30846 while(x.signum() > 0) {
30847 if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
30848 if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
30849 if(x.compareTo(y) >= 0) {
30850 x.subTo(y,x);
30851 x.rShiftTo(1,x);
30852 }
30853 else {
30854 y.subTo(x,y);
30855 y.rShiftTo(1,y);
30856 }
30857 }
30858 if(g > 0) y.lShiftTo(g,y);
30859 return y;
30860 }
30861
30862 // (protected) this % n, n < 2^26
30863 function bnpModInt(n) {
30864 if(n <= 0) return 0;
30865 var d = this.DV%n, r = (this.s<0)?n-1:0;
30866 if(this.t > 0)
30867 if(d == 0) r = this[0]%n;
30868 else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;
30869 return r;
30870 }
30871
30872 // (public) 1/this % m (HAC 14.61)
30873 function bnModInverse(m) {
30874 var ac = m.isEven();
30875 if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
30876 var u = m.clone(), v = this.clone();
30877 var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
30878 while(u.signum() != 0) {
30879 while(u.isEven()) {
30880 u.rShiftTo(1,u);
30881 if(ac) {
30882 if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
30883 a.rShiftTo(1,a);
30884 }
30885 else if(!b.isEven()) b.subTo(m,b);
30886 b.rShiftTo(1,b);
30887 }
30888 while(v.isEven()) {
30889 v.rShiftTo(1,v);
30890 if(ac) {
30891 if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
30892 c.rShiftTo(1,c);
30893 }
30894 else if(!d.isEven()) d.subTo(m,d);
30895 d.rShiftTo(1,d);
30896 }
30897 if(u.compareTo(v) >= 0) {
30898 u.subTo(v,u);
30899 if(ac) a.subTo(c,a);
30900 b.subTo(d,b);
30901 }
30902 else {
30903 v.subTo(u,v);
30904 if(ac) c.subTo(a,c);
30905 d.subTo(b,d);
30906 }
30907 }
30908 if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
30909 if(d.compareTo(m) >= 0) return d.subtract(m);
30910 if(d.signum() < 0) d.addTo(m,d); else return d;
30911 if(d.signum() < 0) return d.add(m); else return d;
30912 }
30913
30914 var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];
30915 var lplim = (1<<26)/lowprimes[lowprimes.length-1];
30916
30917 // (public) test primality with certainty >= 1-.5^t
30918 function bnIsProbablePrime(t) {
30919 var i, x = this.abs();
30920 if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {
30921 for(i = 0; i < lowprimes.length; ++i)
30922 if(x[0] == lowprimes[i]) return true;
30923 return false;
30924 }
30925 if(x.isEven()) return false;
30926 i = 1;
30927 while(i < lowprimes.length) {
30928 var m = lowprimes[i], j = i+1;
30929 while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];
30930 m = x.modInt(m);
30931 while(i < j) if(m%lowprimes[i++] == 0) return false;
30932 }
30933 return x.millerRabin(t);
30934 }
30935
30936 // (protected) true if probably prime (HAC 4.24, Miller-Rabin)
30937 function bnpMillerRabin(t) {
30938 var n1 = this.subtract(BigInteger.ONE);
30939 var k = n1.getLowestSetBit();
30940 if(k <= 0) return false;
30941 var r = n1.shiftRight(k);
30942 t = (t+1)>>1;
30943 if(t > lowprimes.length) t = lowprimes.length;
30944 var a = nbi();
30945 for(var i = 0; i < t; ++i) {
30946 //Pick bases at random, instead of starting at 2
30947 a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);
30948 var y = a.modPow(r,this);
30949 if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {
30950 var j = 1;
30951 while(j++ < k && y.compareTo(n1) != 0) {
30952 y = y.modPowInt(2,this);
30953 if(y.compareTo(BigInteger.ONE) == 0) return false;
30954 }
30955 if(y.compareTo(n1) != 0) return false;
30956 }
30957 }
30958 return true;
30959 }
30960
30961 // protected
30962 BigInteger.prototype.chunkSize = bnpChunkSize;
30963 BigInteger.prototype.toRadix = bnpToRadix;
30964 BigInteger.prototype.fromRadix = bnpFromRadix;
30965 BigInteger.prototype.fromNumber = bnpFromNumber;
30966 BigInteger.prototype.bitwiseTo = bnpBitwiseTo;
30967 BigInteger.prototype.changeBit = bnpChangeBit;
30968 BigInteger.prototype.addTo = bnpAddTo;
30969 BigInteger.prototype.dMultiply = bnpDMultiply;
30970 BigInteger.prototype.dAddOffset = bnpDAddOffset;
30971 BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;
30972 BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;
30973 BigInteger.prototype.modInt = bnpModInt;
30974 BigInteger.prototype.millerRabin = bnpMillerRabin;
30975
30976 // public
30977 BigInteger.prototype.clone = bnClone;
30978 BigInteger.prototype.intValue = bnIntValue;
30979 BigInteger.prototype.byteValue = bnByteValue;
30980 BigInteger.prototype.shortValue = bnShortValue;
30981 BigInteger.prototype.signum = bnSigNum;
30982 BigInteger.prototype.toByteArray = bnToByteArray;
30983 BigInteger.prototype.equals = bnEquals;
30984 BigInteger.prototype.min = bnMin;
30985 BigInteger.prototype.max = bnMax;
30986 BigInteger.prototype.and = bnAnd;
30987 BigInteger.prototype.or = bnOr;
30988 BigInteger.prototype.xor = bnXor;
30989 BigInteger.prototype.andNot = bnAndNot;
30990 BigInteger.prototype.not = bnNot;
30991 BigInteger.prototype.shiftLeft = bnShiftLeft;
30992 BigInteger.prototype.shiftRight = bnShiftRight;
30993 BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;
30994 BigInteger.prototype.bitCount = bnBitCount;
30995 BigInteger.prototype.testBit = bnTestBit;
30996 BigInteger.prototype.setBit = bnSetBit;
30997 BigInteger.prototype.clearBit = bnClearBit;
30998 BigInteger.prototype.flipBit = bnFlipBit;
30999 BigInteger.prototype.add = bnAdd;
31000 BigInteger.prototype.subtract = bnSubtract;
31001 BigInteger.prototype.multiply = bnMultiply;
31002 BigInteger.prototype.divide = bnDivide;
31003 BigInteger.prototype.remainder = bnRemainder;
31004 BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;
31005 BigInteger.prototype.modPow = bnModPow;
31006 BigInteger.prototype.modInverse = bnModInverse;
31007 BigInteger.prototype.pow = bnPow;
31008 BigInteger.prototype.gcd = bnGCD;
31009 BigInteger.prototype.isProbablePrime = bnIsProbablePrime;
31010
31011 // JSBN-specific extension
31012 BigInteger.prototype.square = bnSquare;
31013
31014 // Expose the Barrett function
31015 BigInteger.prototype.Barrett = Barrett
31016
31017 // BigInteger interfaces not implemented in jsbn:
31018
31019 // BigInteger(int signum, byte[] magnitude)
31020 // double doubleValue()
31021 // float floatValue()
31022 // int hashCode()
31023 // long longValue()
31024 // static BigInteger valueOf(long val)
31025
31026 // Random number generator - requires a PRNG backend, e.g. prng4.js
31027
31028 // For best results, put code like
31029 // <body onClick='rng_seed_time();' onKeyPress='rng_seed_time();'>
31030 // in your main HTML document.
31031
31032 var rng_state;
31033 var rng_pool;
31034 var rng_pptr;
31035
31036 // Mix in a 32-bit integer into the pool
31037 function rng_seed_int(x) {
31038 rng_pool[rng_pptr++] ^= x & 255;
31039 rng_pool[rng_pptr++] ^= (x >> 8) & 255;
31040 rng_pool[rng_pptr++] ^= (x >> 16) & 255;
31041 rng_pool[rng_pptr++] ^= (x >> 24) & 255;
31042 if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;
31043 }
31044
31045 // Mix in the current time (w/milliseconds) into the pool
31046 function rng_seed_time() {
31047 rng_seed_int(new Date().getTime());
31048 }
31049
31050 // Initialize the pool with junk if needed.
31051 if(rng_pool == null) {
31052 rng_pool = new Array();
31053 rng_pptr = 0;
31054 var t;
31055 if(typeof window !== "undefined" && window.crypto) {
31056 if (window.crypto.getRandomValues) {
31057 // Use webcrypto if available
31058 var ua = new Uint8Array(32);
31059 window.crypto.getRandomValues(ua);
31060 for(t = 0; t < 32; ++t)
31061 rng_pool[rng_pptr++] = ua[t];
31062 }
31063 else if(navigator.appName == "Netscape" && navigator.appVersion < "5") {
31064 // Extract entropy (256 bits) from NS4 RNG if available
31065 var z = window.crypto.random(32);
31066 for(t = 0; t < z.length; ++t)
31067 rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;
31068 }
31069 }
31070 while(rng_pptr < rng_psize) { // extract some randomness from Math.random()
31071 t = Math.floor(65536 * Math.random());
31072 rng_pool[rng_pptr++] = t >>> 8;
31073 rng_pool[rng_pptr++] = t & 255;
31074 }
31075 rng_pptr = 0;
31076 rng_seed_time();
31077 //rng_seed_int(window.screenX);
31078 //rng_seed_int(window.screenY);
31079 }
31080
31081 function rng_get_byte() {
31082 if(rng_state == null) {
31083 rng_seed_time();
31084 rng_state = prng_newstate();
31085 rng_state.init(rng_pool);
31086 for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)
31087 rng_pool[rng_pptr] = 0;
31088 rng_pptr = 0;
31089 //rng_pool = null;
31090 }
31091 // TODO: allow reseeding after first request
31092 return rng_state.next();
31093 }
31094
31095 function rng_get_bytes(ba) {
31096 var i;
31097 for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();
31098 }
31099
31100 function SecureRandom() {}
31101
31102 SecureRandom.prototype.nextBytes = rng_get_bytes;
31103
31104 // prng4.js - uses Arcfour as a PRNG
31105
31106 function Arcfour() {
31107 this.i = 0;
31108 this.j = 0;
31109 this.S = new Array();
31110 }
31111
31112 // Initialize arcfour context from key, an array of ints, each from [0..255]
31113 function ARC4init(key) {
31114 var i, j, t;
31115 for(i = 0; i < 256; ++i)
31116 this.S[i] = i;
31117 j = 0;
31118 for(i = 0; i < 256; ++i) {
31119 j = (j + this.S[i] + key[i % key.length]) & 255;
31120 t = this.S[i];
31121 this.S[i] = this.S[j];
31122 this.S[j] = t;
31123 }
31124 this.i = 0;
31125 this.j = 0;
31126 }
31127
31128 function ARC4next() {
31129 var t;
31130 this.i = (this.i + 1) & 255;
31131 this.j = (this.j + this.S[this.i]) & 255;
31132 t = this.S[this.i];
31133 this.S[this.i] = this.S[this.j];
31134 this.S[this.j] = t;
31135 return this.S[(t + this.S[this.i]) & 255];
31136 }
31137
31138 Arcfour.prototype.init = ARC4init;
31139 Arcfour.prototype.next = ARC4next;
31140
31141 // Plug in your RNG constructor here
31142 function prng_newstate() {
31143 return new Arcfour();
31144 }
31145
31146 // Pool size must be a multiple of 4 and greater than 32.
31147 // An array of bytes the size of the pool will be passed to init()
31148 var rng_psize = 256;
31149
31150 BigInteger.SecureRandom = SecureRandom;
31151 BigInteger.BigInteger = BigInteger;
31152 if (true) {
31153 exports = module.exports = BigInteger;
31154 } else {
31155 this.BigInteger = BigInteger;
31156 this.SecureRandom = SecureRandom;
31157 }
31158
31159}).call(this);
31160
31161
31162/***/ }),
31163/* 80 */
31164/***/ (function(module, __webpack_exports__, __webpack_require__) {
31165
31166"use strict";
31167/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return InnerSubscriber; });
31168/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
31169/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
31170/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
31171
31172
31173var InnerSubscriber = /*@__PURE__*/ (function (_super) {
31174 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](InnerSubscriber, _super);
31175 function InnerSubscriber(parent, outerValue, outerIndex) {
31176 var _this = _super.call(this) || this;
31177 _this.parent = parent;
31178 _this.outerValue = outerValue;
31179 _this.outerIndex = outerIndex;
31180 _this.index = 0;
31181 return _this;
31182 }
31183 InnerSubscriber.prototype._next = function (value) {
31184 this.parent.notifyNext(this.outerValue, value, this.outerIndex, this.index++, this);
31185 };
31186 InnerSubscriber.prototype._error = function (error) {
31187 this.parent.notifyError(error, this);
31188 this.unsubscribe();
31189 };
31190 InnerSubscriber.prototype._complete = function () {
31191 this.parent.notifyComplete(this);
31192 this.unsubscribe();
31193 };
31194 return InnerSubscriber;
31195}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
31196
31197//# sourceMappingURL=InnerSubscriber.js.map
31198
31199
31200/***/ }),
31201/* 81 */
31202/***/ (function(module, __webpack_exports__, __webpack_require__) {
31203
31204"use strict";
31205/* harmony export (immutable) */ __webpack_exports__["a"] = fromArray;
31206/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
31207/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
31208/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToArray__ = __webpack_require__(417);
31209/** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToArray PURE_IMPORTS_END */
31210
31211
31212
31213function fromArray(input, scheduler) {
31214 if (!scheduler) {
31215 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToArray__["a" /* subscribeToArray */])(input));
31216 }
31217 else {
31218 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
31219 var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
31220 var i = 0;
31221 sub.add(scheduler.schedule(function () {
31222 if (i === input.length) {
31223 subscriber.complete();
31224 return;
31225 }
31226 subscriber.next(input[i++]);
31227 if (!subscriber.closed) {
31228 sub.add(this.schedule());
31229 }
31230 }));
31231 return sub;
31232 });
31233 }
31234}
31235//# sourceMappingURL=fromArray.js.map
31236
31237
31238/***/ }),
31239/* 82 */
31240/***/ (function(module, exports, __webpack_require__) {
31241
31242// Copyright 2015 Joyent, Inc.
31243
31244module.exports = {
31245 read: read,
31246 write: write
31247};
31248
31249var assert = __webpack_require__(22);
31250var asn1 = __webpack_require__(66);
31251var crypto = __webpack_require__(21);
31252var Buffer = __webpack_require__(20).Buffer;
31253var algs = __webpack_require__(39);
31254var utils = __webpack_require__(32);
31255var Key = __webpack_require__(34);
31256var PrivateKey = __webpack_require__(40);
31257
31258var pkcs1 = __webpack_require__(267);
31259var pkcs8 = __webpack_require__(145);
31260var sshpriv = __webpack_require__(183);
31261var rfc4253 = __webpack_require__(92);
31262
31263var errors = __webpack_require__(69);
31264
31265/*
31266 * For reading we support both PKCS#1 and PKCS#8. If we find a private key,
31267 * we just take the public component of it and use that.
31268 */
31269function read(buf, options, forceType) {
31270 var input = buf;
31271 if (typeof (buf) !== 'string') {
31272 assert.buffer(buf, 'buf');
31273 buf = buf.toString('ascii');
31274 }
31275
31276 var lines = buf.trim().split('\n');
31277
31278 var m = lines[0].match(/*JSSTYLED*/
31279 /[-]+[ ]*BEGIN ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);
31280 assert.ok(m, 'invalid PEM header');
31281
31282 var m2 = lines[lines.length - 1].match(/*JSSTYLED*/
31283 /[-]+[ ]*END ([A-Z0-9][A-Za-z0-9]+ )?(PUBLIC|PRIVATE) KEY[ ]*[-]+/);
31284 assert.ok(m2, 'invalid PEM footer');
31285
31286 /* Begin and end banners must match key type */
31287 assert.equal(m[2], m2[2]);
31288 var type = m[2].toLowerCase();
31289
31290 var alg;
31291 if (m[1]) {
31292 /* They also must match algorithms, if given */
31293 assert.equal(m[1], m2[1], 'PEM header and footer mismatch');
31294 alg = m[1].trim();
31295 }
31296
31297 var headers = {};
31298 while (true) {
31299 lines = lines.slice(1);
31300 m = lines[0].match(/*JSSTYLED*/
31301 /^([A-Za-z0-9-]+): (.+)$/);
31302 if (!m)
31303 break;
31304 headers[m[1].toLowerCase()] = m[2];
31305 }
31306
31307 var cipher, key, iv;
31308 if (headers['proc-type']) {
31309 var parts = headers['proc-type'].split(',');
31310 if (parts[0] === '4' && parts[1] === 'ENCRYPTED') {
31311 if (typeof (options.passphrase) === 'string') {
31312 options.passphrase = Buffer.from(
31313 options.passphrase, 'utf-8');
31314 }
31315 if (!Buffer.isBuffer(options.passphrase)) {
31316 throw (new errors.KeyEncryptedError(
31317 options.filename, 'PEM'));
31318 } else {
31319 parts = headers['dek-info'].split(',');
31320 assert.ok(parts.length === 2);
31321 cipher = parts[0].toLowerCase();
31322 iv = Buffer.from(parts[1], 'hex');
31323 key = utils.opensslKeyDeriv(cipher, iv,
31324 options.passphrase, 1).key;
31325 }
31326 }
31327 }
31328
31329 /* Chop off the first and last lines */
31330 lines = lines.slice(0, -1).join('');
31331 buf = Buffer.from(lines, 'base64');
31332
31333 if (cipher && key && iv) {
31334 var cipherStream = crypto.createDecipheriv(cipher, key, iv);
31335 var chunk, chunks = [];
31336 cipherStream.once('error', function (e) {
31337 if (e.toString().indexOf('bad decrypt') !== -1) {
31338 throw (new Error('Incorrect passphrase ' +
31339 'supplied, could not decrypt key'));
31340 }
31341 throw (e);
31342 });
31343 cipherStream.write(buf);
31344 cipherStream.end();
31345 while ((chunk = cipherStream.read()) !== null)
31346 chunks.push(chunk);
31347 buf = Buffer.concat(chunks);
31348 }
31349
31350 /* The new OpenSSH internal format abuses PEM headers */
31351 if (alg && alg.toLowerCase() === 'openssh')
31352 return (sshpriv.readSSHPrivate(type, buf, options));
31353 if (alg && alg.toLowerCase() === 'ssh2')
31354 return (rfc4253.readType(type, buf, options));
31355
31356 var der = new asn1.BerReader(buf);
31357 der.originalInput = input;
31358
31359 /*
31360 * All of the PEM file types start with a sequence tag, so chop it
31361 * off here
31362 */
31363 der.readSequence();
31364
31365 /* PKCS#1 type keys name an algorithm in the banner explicitly */
31366 if (alg) {
31367 if (forceType)
31368 assert.strictEqual(forceType, 'pkcs1');
31369 return (pkcs1.readPkcs1(alg, type, der));
31370 } else {
31371 if (forceType)
31372 assert.strictEqual(forceType, 'pkcs8');
31373 return (pkcs8.readPkcs8(alg, type, der));
31374 }
31375}
31376
31377function write(key, options, type) {
31378 assert.object(key);
31379
31380 var alg = {
31381 'ecdsa': 'EC',
31382 'rsa': 'RSA',
31383 'dsa': 'DSA',
31384 'ed25519': 'EdDSA'
31385 }[key.type];
31386 var header;
31387
31388 var der = new asn1.BerWriter();
31389
31390 if (PrivateKey.isPrivateKey(key)) {
31391 if (type && type === 'pkcs8') {
31392 header = 'PRIVATE KEY';
31393 pkcs8.writePkcs8(der, key);
31394 } else {
31395 if (type)
31396 assert.strictEqual(type, 'pkcs1');
31397 header = alg + ' PRIVATE KEY';
31398 pkcs1.writePkcs1(der, key);
31399 }
31400
31401 } else if (Key.isKey(key)) {
31402 if (type && type === 'pkcs1') {
31403 header = alg + ' PUBLIC KEY';
31404 pkcs1.writePkcs1(der, key);
31405 } else {
31406 if (type)
31407 assert.strictEqual(type, 'pkcs8');
31408 header = 'PUBLIC KEY';
31409 pkcs8.writePkcs8(der, key);
31410 }
31411
31412 } else {
31413 throw (new Error('key is not a Key or PrivateKey'));
31414 }
31415
31416 var tmp = der.buffer.toString('base64');
31417 var len = tmp.length + (tmp.length / 64) +
31418 18 + 16 + header.length*2 + 10;
31419 var buf = Buffer.alloc(len);
31420 var o = 0;
31421 o += buf.write('-----BEGIN ' + header + '-----\n', o);
31422 for (var i = 0; i < tmp.length; ) {
31423 var limit = i + 64;
31424 if (limit > tmp.length)
31425 limit = tmp.length;
31426 o += buf.write(tmp.slice(i, limit), o);
31427 buf[o++] = 10;
31428 i = limit;
31429 }
31430 o += buf.write('-----END ' + header + '-----\n', o);
31431
31432 return (buf.slice(0, o));
31433}
31434
31435
31436/***/ }),
31437/* 83 */
31438/***/ (function(module, exports) {
31439
31440module.exports = require("http");
31441
31442/***/ }),
31443/* 84 */
31444/***/ (function(module, exports, __webpack_require__) {
31445
31446"use strict";
31447
31448
31449Object.defineProperty(exports, "__esModule", {
31450 value: true
31451});
31452exports.SCOPE_SEPARATOR = undefined;
31453
31454var _assign;
31455
31456function _load_assign() {
31457 return _assign = _interopRequireDefault(__webpack_require__(23));
31458}
31459
31460var _getIterator2;
31461
31462function _load_getIterator() {
31463 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
31464}
31465
31466var _keys;
31467
31468function _load_keys() {
31469 return _keys = _interopRequireDefault(__webpack_require__(14));
31470}
31471
31472var _extends2;
31473
31474function _load_extends() {
31475 return _extends2 = _interopRequireDefault(__webpack_require__(24));
31476}
31477
31478var _asyncToGenerator2;
31479
31480function _load_asyncToGenerator() {
31481 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
31482}
31483
31484var _classCallCheck2;
31485
31486function _load_classCallCheck() {
31487 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
31488}
31489
31490var _possibleConstructorReturn2;
31491
31492function _load_possibleConstructorReturn() {
31493 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
31494}
31495
31496var _inherits2;
31497
31498function _load_inherits() {
31499 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
31500}
31501
31502var _set;
31503
31504function _load_set() {
31505 return _set = _interopRequireDefault(__webpack_require__(16));
31506}
31507
31508var _constants;
31509
31510function _load_constants() {
31511 return _constants = __webpack_require__(13);
31512}
31513
31514var _fs;
31515
31516function _load_fs() {
31517 return _fs = _interopRequireWildcard(__webpack_require__(8));
31518}
31519
31520var _npmResolver;
31521
31522function _load_npmResolver() {
31523 return _npmResolver = _interopRequireDefault(__webpack_require__(204));
31524}
31525
31526var _envReplace;
31527
31528function _load_envReplace() {
31529 return _envReplace = _interopRequireDefault(__webpack_require__(533));
31530}
31531
31532var _baseRegistry;
31533
31534function _load_baseRegistry() {
31535 return _baseRegistry = _interopRequireDefault(__webpack_require__(514));
31536}
31537
31538var _misc;
31539
31540function _load_misc() {
31541 return _misc = __webpack_require__(28);
31542}
31543
31544var _path;
31545
31546function _load_path() {
31547 return _path = __webpack_require__(314);
31548}
31549
31550var _normalizeUrl;
31551
31552function _load_normalizeUrl() {
31553 return _normalizeUrl = _interopRequireDefault(__webpack_require__(372));
31554}
31555
31556var _userHomeDir;
31557
31558function _load_userHomeDir() {
31559 return _userHomeDir = _interopRequireDefault(__webpack_require__(101));
31560}
31561
31562var _userHomeDir2;
31563
31564function _load_userHomeDir2() {
31565 return _userHomeDir2 = __webpack_require__(101);
31566}
31567
31568var _errors;
31569
31570function _load_errors() {
31571 return _errors = __webpack_require__(6);
31572}
31573
31574var _login;
31575
31576function _load_login() {
31577 return _login = __webpack_require__(97);
31578}
31579
31580var _path2;
31581
31582function _load_path2() {
31583 return _path2 = _interopRequireDefault(__webpack_require__(1));
31584}
31585
31586var _url;
31587
31588function _load_url() {
31589 return _url = _interopRequireDefault(__webpack_require__(29));
31590}
31591
31592var _ini;
31593
31594function _load_ini() {
31595 return _ini = _interopRequireDefault(__webpack_require__(747));
31596}
31597
31598function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
31599
31600function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31601
31602var DEFAULT_REGISTRY = 'https://registry.npmjs.org/';
31603var REGEX_REGISTRY_ENFORCED_HTTPS = /^https?:\/\/([^\/]+\.)?(yarnpkg\.com|npmjs\.(org|com))(\/|$)/;
31604var REGEX_REGISTRY_HTTP_PROTOCOL = /^https?:/i;
31605var REGEX_REGISTRY_PREFIX = /^(https?:)?\/\//i;
31606var REGEX_REGISTRY_SUFFIX = /registry\/?$/;
31607
31608var SCOPE_SEPARATOR = exports.SCOPE_SEPARATOR = '%2f';
31609// All scoped package names are of the format `@scope%2fpkg` from the use of NpmRegistry.escapeName
31610// `(?:^|\/)` Match either the start of the string or a `/` but don't capture
31611// `[^\/?]+?` Match any character that is not '/' or '?' and capture, up until the first occurrence of:
31612// `(?=%2f|\/)` Match SCOPE_SEPARATOR, the escaped '/', or a raw `/` and don't capture
31613// The reason for matching a plain `/` is NPM registry being inconsistent about escaping `/` in
31614// scoped package names: when you're fetching a tarball, it is not escaped, when you want info
31615// about the package, it is escaped.
31616var SCOPED_PKG_REGEXP = /(?:^|\/)(@[^\/?]+?)(?=%2f|\/)/;
31617
31618// TODO: Use the method from src/cli/commands/global.js for this instead
31619function getGlobalPrefix() {
31620 if (process.env.PREFIX) {
31621 return process.env.PREFIX;
31622 } else if (process.platform === 'win32') {
31623 // c:\node\node.exe --> prefix=c:\node\
31624 return (_path2 || _load_path2()).default.dirname(process.execPath);
31625 } else {
31626 // /usr/local/bin/node --> prefix=/usr/local
31627 var prefix = (_path2 || _load_path2()).default.dirname((_path2 || _load_path2()).default.dirname(process.execPath));
31628
31629 // destdir only is respected on Unix
31630 if (process.env.DESTDIR) {
31631 prefix = (_path2 || _load_path2()).default.join(process.env.DESTDIR, prefix);
31632 }
31633
31634 return prefix;
31635 }
31636}
31637
31638var PATH_CONFIG_OPTIONS = new (_set || _load_set()).default(['cache', 'cafile', 'prefix', 'userconfig']);
31639
31640function isPathConfigOption(key) {
31641 return PATH_CONFIG_OPTIONS.has(key);
31642}
31643
31644function normalizePath(val) {
31645 if (val === undefined) {
31646 return undefined;
31647 }
31648
31649 if (typeof val !== 'string') {
31650 val = String(val);
31651 }
31652
31653 return (0, (_path || _load_path()).resolveWithHome)(val);
31654}
31655
31656function urlParts(requestUrl) {
31657 var normalizedUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(requestUrl);
31658 var parsed = (_url || _load_url()).default.parse(normalizedUrl);
31659 var host = parsed.host || '';
31660 var path = parsed.path || '';
31661 return { host, path };
31662}
31663
31664var NpmRegistry = function (_Registry) {
31665 (0, (_inherits2 || _load_inherits()).default)(NpmRegistry, _Registry);
31666
31667 function NpmRegistry(cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles) {
31668 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NpmRegistry);
31669
31670 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Registry.call(this, cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles));
31671
31672 _this.folder = 'node_modules';
31673 return _this;
31674 }
31675
31676 NpmRegistry.escapeName = function escapeName(name) {
31677 // scoped packages contain slashes and the npm registry expects them to be escaped
31678 return name.replace('/', SCOPE_SEPARATOR);
31679 };
31680
31681 NpmRegistry.prototype.isScopedPackage = function isScopedPackage(packageIdent) {
31682 return SCOPED_PKG_REGEXP.test(packageIdent);
31683 };
31684
31685 NpmRegistry.prototype.getRequestUrl = function getRequestUrl(registry, pathname) {
31686 var resolved = pathname;
31687
31688 if (!REGEX_REGISTRY_PREFIX.test(pathname)) {
31689 resolved = (_url || _load_url()).default.resolve((0, (_misc || _load_misc()).addSuffix)(registry, '/'), pathname);
31690 }
31691
31692 if (REGEX_REGISTRY_ENFORCED_HTTPS.test(resolved)) {
31693 resolved = resolved.replace(/^http:\/\//, 'https://');
31694 }
31695
31696 return resolved;
31697 };
31698
31699 NpmRegistry.prototype.isRequestToRegistry = function isRequestToRegistry(requestUrl, registryUrl) {
31700 var request = urlParts(requestUrl);
31701 var registry = urlParts(registryUrl);
31702 var customHostSuffix = this.getRegistryOrGlobalOption(registryUrl, 'custom-host-suffix');
31703
31704 var requestToRegistryHost = request.host === registry.host;
31705 var requestToYarn = (_constants || _load_constants()).YARN_REGISTRY.indexOf(request.host) !== -1 && DEFAULT_REGISTRY.indexOf(registry.host) !== -1;
31706 var requestToRegistryPath = request.path.startsWith(registry.path);
31707 // For some registries, the package path does not prefix with the registry path
31708 var customHostSuffixInUse = typeof customHostSuffix === 'string' && request.host.endsWith(customHostSuffix);
31709
31710 return (requestToRegistryHost || requestToYarn) && (requestToRegistryPath || customHostSuffixInUse);
31711 };
31712
31713 NpmRegistry.prototype.request = function () {
31714 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pathname) {
31715 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
31716 var packageName = arguments[2];
31717
31718 // packageName needs to be escaped when if it is passed
31719 var packageIdent = packageName && NpmRegistry.escapeName(packageName) || pathname;
31720 var registry = opts.registry || this.getRegistry(packageIdent);
31721 var requestUrl = this.getRequestUrl(registry, pathname);
31722
31723 var alwaysAuth = this.getRegistryOrGlobalOption(registry, 'always-auth');
31724
31725 var headers = (0, (_extends2 || _load_extends()).default)({
31726 Accept:
31727 // This is to use less bandwidth unless we really need to get the full response.
31728 // See https://github.com/npm/npm-registry-client#requests
31729 opts.unfiltered ? 'application/json' : 'application/vnd.npm.install-v1+json; q=1.0, application/json; q=0.8, */*'
31730 }, opts.headers);
31731
31732 var isToRegistry = this.isRequestToRegistry(requestUrl, registry) || this.requestNeedsAuth(requestUrl);
31733
31734 // this.token must be checked to account for publish requests on non-scoped packages
31735 if (this.token || isToRegistry && (alwaysAuth || this.isScopedPackage(packageIdent))) {
31736 var authorization = this.getAuth(packageIdent);
31737 if (authorization) {
31738 headers.authorization = authorization;
31739 }
31740 }
31741
31742 if (this.otp) {
31743 headers['npm-otp'] = this.otp;
31744 }
31745
31746 try {
31747 return yield this.requestManager.request({
31748 url: requestUrl,
31749 method: opts.method,
31750 body: opts.body,
31751 auth: opts.auth,
31752 headers,
31753 json: !opts.buffer,
31754 buffer: opts.buffer,
31755 process: opts.process,
31756 gzip: true
31757 });
31758 } catch (error) {
31759 if (error instanceof (_errors || _load_errors()).OneTimePasswordError) {
31760 if (this.otp) {
31761 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('incorrectOneTimePassword'));
31762 }
31763
31764 this.reporter.info(this.reporter.lang('twoFactorAuthenticationEnabled'));
31765 this.otp = yield (0, (_login || _load_login()).getOneTimePassword)(this.reporter);
31766
31767 this.requestManager.clearCache();
31768
31769 return this.request(pathname, opts, packageName);
31770 } else {
31771 throw error;
31772 }
31773 }
31774 });
31775
31776 function request(_x) {
31777 return _ref.apply(this, arguments);
31778 }
31779
31780 return request;
31781 }();
31782
31783 NpmRegistry.prototype.requestNeedsAuth = function requestNeedsAuth(requestUrl) {
31784 var config = this.config;
31785 var requestParts = urlParts(requestUrl);
31786 return !!(0, (_keys || _load_keys()).default)(config).find(function (option) {
31787 var parts = option.split(':');
31788 if (parts.length === 2 && parts[1] === '_authToken' || parts[1] === '_password') {
31789 var registryParts = urlParts(parts[0]);
31790 if (requestParts.host === registryParts.host && requestParts.path.startsWith(registryParts.path)) {
31791 return true;
31792 }
31793 }
31794 return false;
31795 });
31796 };
31797
31798 NpmRegistry.prototype.checkOutdated = function () {
31799 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, name, range) {
31800 var escapedName = NpmRegistry.escapeName(name);
31801 var req = yield this.request(escapedName, { unfiltered: true });
31802 if (!req) {
31803 throw new Error(`couldn't find ${name}`);
31804 }
31805
31806 // By default use top level 'repository' and 'homepage' values
31807 var repository = req.repository,
31808 homepage = req.homepage;
31809
31810 var wantedPkg = yield (_npmResolver || _load_npmResolver()).default.findVersionInRegistryResponse(config, escapedName, range, req);
31811
31812 // But some local repositories like Verdaccio do not return 'repository' nor 'homepage'
31813 // in top level data structure, so we fallback to wanted package manifest
31814 if (!repository && !homepage) {
31815 repository = wantedPkg.repository;
31816 homepage = wantedPkg.homepage;
31817 }
31818
31819 var latest = req['dist-tags'].latest;
31820 // In certain cases, registries do not return a 'latest' tag.
31821 if (!latest) {
31822 latest = wantedPkg.version;
31823 }
31824
31825 var url = homepage || repository && repository.url || '';
31826
31827 return {
31828 latest,
31829 wanted: wantedPkg.version,
31830 url
31831 };
31832 });
31833
31834 function checkOutdated(_x3, _x4, _x5) {
31835 return _ref2.apply(this, arguments);
31836 }
31837
31838 return checkOutdated;
31839 }();
31840
31841 NpmRegistry.prototype.getPossibleConfigLocations = function () {
31842 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, reporter) {
31843 var possibles = [];
31844
31845 for (var _iterator = this.extraneousRcFiles.slice().reverse(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
31846 var _ref4;
31847
31848 if (_isArray) {
31849 if (_i >= _iterator.length) break;
31850 _ref4 = _iterator[_i++];
31851 } else {
31852 _i = _iterator.next();
31853 if (_i.done) break;
31854 _ref4 = _i.value;
31855 }
31856
31857 var rcFile = _ref4;
31858
31859 possibles.push([false, (_path2 || _load_path2()).default.resolve(process.cwd(), rcFile)]);
31860 }
31861
31862 if (this.enableDefaultRc) {
31863 // npmrc --> ./.npmrc, ~/.npmrc, ${prefix}/etc/npmrc
31864 var localfile = '.' + filename;
31865 possibles = possibles.concat([[false, (_path2 || _load_path2()).default.join(this.cwd, localfile)], [true, this.config.userconfig || (_path2 || _load_path2()).default.join((_userHomeDir || _load_userHomeDir()).default, localfile)], [false, (_path2 || _load_path2()).default.join(getGlobalPrefix(), 'etc', filename)]]);
31866
31867 // When home directory for global install is different from where $HOME/npmrc is stored,
31868 // E.g. /usr/local/share vs /root on linux machines, check the additional location
31869 if ((_userHomeDir2 || _load_userHomeDir2()).home !== (_userHomeDir || _load_userHomeDir()).default) {
31870 possibles.push([true, (_path2 || _load_path2()).default.join((_userHomeDir2 || _load_userHomeDir2()).home, localfile)]);
31871 }
31872
31873 // npmrc --> ../.npmrc, ../../.npmrc, etc.
31874 var foldersFromRootToCwd = (0, (_path || _load_path()).getPosixPath)(this.cwd).split('/');
31875 while (foldersFromRootToCwd.length > 1) {
31876 possibles.push([false, (_path2 || _load_path2()).default.join(foldersFromRootToCwd.join((_path2 || _load_path2()).default.sep), localfile)]);
31877 foldersFromRootToCwd.pop();
31878 }
31879 }
31880
31881 var actuals = [];
31882 for (var _iterator2 = possibles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
31883 var _ref6;
31884
31885 if (_isArray2) {
31886 if (_i2 >= _iterator2.length) break;
31887 _ref6 = _iterator2[_i2++];
31888 } else {
31889 _i2 = _iterator2.next();
31890 if (_i2.done) break;
31891 _ref6 = _i2.value;
31892 }
31893
31894 var _ref5 = _ref6;
31895 var isHome = _ref5[0];
31896 var loc = _ref5[1];
31897
31898 reporter.verbose(reporter.lang('configPossibleFile', loc));
31899 if (yield (_fs || _load_fs()).exists(loc)) {
31900 reporter.verbose(reporter.lang('configFileFound', loc));
31901 actuals.push([isHome, loc, yield (_fs || _load_fs()).readFile(loc)]);
31902 }
31903 }
31904
31905 return actuals;
31906 });
31907
31908 function getPossibleConfigLocations(_x6, _x7) {
31909 return _ref3.apply(this, arguments);
31910 }
31911
31912 return getPossibleConfigLocations;
31913 }();
31914
31915 NpmRegistry.getConfigEnv = function getConfigEnv() {
31916 var env = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : process.env;
31917
31918 // To match NPM's behavior, HOME is always the user's home directory.
31919 var overrideEnv = {
31920 HOME: (_userHomeDir2 || _load_userHomeDir2()).home
31921 };
31922 return (0, (_assign || _load_assign()).default)({}, env, overrideEnv);
31923 };
31924
31925 NpmRegistry.normalizeConfig = function normalizeConfig(config) {
31926 var env = NpmRegistry.getConfigEnv();
31927 config = (_baseRegistry || _load_baseRegistry()).default.normalizeConfig(config);
31928
31929 for (var key in config) {
31930 config[key] = (0, (_envReplace || _load_envReplace()).default)(config[key], env);
31931 if (isPathConfigOption(key)) {
31932 config[key] = normalizePath(config[key]);
31933 }
31934 }
31935
31936 return config;
31937 };
31938
31939 NpmRegistry.prototype.loadConfig = function () {
31940 var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
31941 // docs: https://docs.npmjs.com/misc/config
31942 this.mergeEnv('npm_config_');
31943
31944 for (var _iterator3 = yield this.getPossibleConfigLocations('npmrc', this.reporter), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
31945 var _ref9;
31946
31947 if (_isArray3) {
31948 if (_i3 >= _iterator3.length) break;
31949 _ref9 = _iterator3[_i3++];
31950 } else {
31951 _i3 = _iterator3.next();
31952 if (_i3.done) break;
31953 _ref9 = _i3.value;
31954 }
31955
31956 var _ref8 = _ref9;
31957 var loc = _ref8[1];
31958 var file = _ref8[2];
31959
31960 var config = NpmRegistry.normalizeConfig((_ini || _load_ini()).default.parse(file));
31961
31962 // normalize offline mirror path relative to the current npmrc
31963 var offlineLoc = config['yarn-offline-mirror'];
31964 // don't normalize if we already have a mirror path
31965 if (!this.config['yarn-offline-mirror'] && offlineLoc) {
31966 var mirrorLoc = config['yarn-offline-mirror'] = (_path2 || _load_path2()).default.resolve((_path2 || _load_path2()).default.dirname(loc), offlineLoc);
31967 yield (_fs || _load_fs()).mkdirp(mirrorLoc);
31968 }
31969
31970 this.config = (0, (_assign || _load_assign()).default)({}, config, this.config);
31971 }
31972 });
31973
31974 function loadConfig() {
31975 return _ref7.apply(this, arguments);
31976 }
31977
31978 return loadConfig;
31979 }();
31980
31981 NpmRegistry.prototype.getScope = function getScope(packageIdent) {
31982 var match = packageIdent.match(SCOPED_PKG_REGEXP);
31983 return match && match[1] || '';
31984 };
31985
31986 NpmRegistry.prototype.getRegistry = function getRegistry(packageIdent) {
31987 // Try extracting registry from the url, then scoped registry, and default registry
31988 if (packageIdent.match(REGEX_REGISTRY_PREFIX)) {
31989 var availableRegistries = this.getAvailableRegistries();
31990 var registry = availableRegistries.find(function (registry) {
31991 return packageIdent.startsWith(registry);
31992 });
31993 if (registry) {
31994 return String(registry);
31995 }
31996 }
31997
31998 var _arr = [this.getScope(packageIdent), ''];
31999 for (var _i4 = 0; _i4 < _arr.length; _i4++) {
32000 var scope = _arr[_i4];
32001 var _registry = this.getScopedOption(scope, 'registry') || this.registries.yarn.getScopedOption(scope, 'registry');
32002 if (_registry) {
32003 return String(_registry);
32004 }
32005 }
32006
32007 return DEFAULT_REGISTRY;
32008 };
32009
32010 NpmRegistry.prototype.getAuthByRegistry = function getAuthByRegistry(registry) {
32011 // Check for bearer token.
32012 var authToken = this.getRegistryOrGlobalOption(registry, '_authToken');
32013 if (authToken) {
32014 return `Bearer ${String(authToken)}`;
32015 }
32016
32017 // Check for basic auth token.
32018 var auth = this.getRegistryOrGlobalOption(registry, '_auth');
32019 if (auth) {
32020 return `Basic ${String(auth)}`;
32021 }
32022
32023 // Check for basic username/password auth.
32024 var username = this.getRegistryOrGlobalOption(registry, 'username');
32025 var password = this.getRegistryOrGlobalOption(registry, '_password');
32026 if (username && password) {
32027 var pw = Buffer.from(String(password), 'base64').toString();
32028 return 'Basic ' + Buffer.from(String(username) + ':' + pw).toString('base64');
32029 }
32030
32031 return '';
32032 };
32033
32034 NpmRegistry.prototype.getAuth = function getAuth(packageIdent) {
32035 if (this.token) {
32036 return this.token;
32037 }
32038
32039 var baseRegistry = this.getRegistry(packageIdent);
32040 var registries = [baseRegistry];
32041
32042 // If sending a request to the Yarn registry, we must also send it the auth token for the npm registry
32043 if (baseRegistry === (_constants || _load_constants()).YARN_REGISTRY) {
32044 registries.push(DEFAULT_REGISTRY);
32045 }
32046
32047 for (var _iterator4 = registries, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
32048 var _ref10;
32049
32050 if (_isArray4) {
32051 if (_i5 >= _iterator4.length) break;
32052 _ref10 = _iterator4[_i5++];
32053 } else {
32054 _i5 = _iterator4.next();
32055 if (_i5.done) break;
32056 _ref10 = _i5.value;
32057 }
32058
32059 var registry = _ref10;
32060
32061 var auth = this.getAuthByRegistry(registry);
32062
32063 if (auth) {
32064 return auth;
32065 }
32066 }
32067
32068 return '';
32069 };
32070
32071 NpmRegistry.prototype.getScopedOption = function getScopedOption(scope, option) {
32072 return this.getOption(scope + (scope ? ':' : '') + option);
32073 };
32074
32075 NpmRegistry.prototype.getRegistryOption = function getRegistryOption(registry, option) {
32076 var pre = REGEX_REGISTRY_HTTP_PROTOCOL;
32077 var suf = REGEX_REGISTRY_SUFFIX;
32078
32079 // When registry is used config scope, the trailing '/' is required
32080 var reg = (0, (_misc || _load_misc()).addSuffix)(registry, '/');
32081
32082 // 1st attempt, try to get option for the given registry URL
32083 // 2nd attempt, remove the 'https?:' prefix of the registry URL
32084 // 3nd attempt, remove the 'registry/?' suffix of the registry URL
32085 return this.getScopedOption(reg, option) || pre.test(reg) && this.getRegistryOption(reg.replace(pre, ''), option) || suf.test(reg) && this.getRegistryOption(reg.replace(suf, ''), option);
32086 };
32087
32088 NpmRegistry.prototype.getRegistryOrGlobalOption = function getRegistryOrGlobalOption(registry, option) {
32089 return this.getRegistryOption(registry, option) || this.getOption(option);
32090 };
32091
32092 return NpmRegistry;
32093}((_baseRegistry || _load_baseRegistry()).default);
32094
32095NpmRegistry.filename = 'package.json';
32096exports.default = NpmRegistry;
32097
32098/***/ }),
32099/* 85 */
32100/***/ (function(module, exports, __webpack_require__) {
32101
32102"use strict";
32103
32104
32105Object.defineProperty(exports, "__esModule", {
32106 value: true
32107});
32108
32109var _classCallCheck2;
32110
32111function _load_classCallCheck() {
32112 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
32113}
32114
32115var _possibleConstructorReturn2;
32116
32117function _load_possibleConstructorReturn() {
32118 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
32119}
32120
32121var _inherits2;
32122
32123function _load_inherits() {
32124 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
32125}
32126
32127var _baseResolver;
32128
32129function _load_baseResolver() {
32130 return _baseResolver = _interopRequireDefault(__webpack_require__(117));
32131}
32132
32133function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32134
32135var ExoticResolver = function (_BaseResolver) {
32136 (0, (_inherits2 || _load_inherits()).default)(ExoticResolver, _BaseResolver);
32137
32138 function ExoticResolver() {
32139 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ExoticResolver);
32140 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseResolver.apply(this, arguments));
32141 }
32142
32143 ExoticResolver.isVersion = function isVersion(pattern) {
32144 var proto = this.protocol;
32145 if (proto) {
32146 return pattern.startsWith(`${proto}:`);
32147 } else {
32148 throw new Error('No protocol specified');
32149 }
32150 };
32151
32152 return ExoticResolver;
32153}((_baseResolver || _load_baseResolver()).default);
32154
32155exports.default = ExoticResolver;
32156
32157/***/ }),
32158/* 86 */
32159/***/ (function(module, exports, __webpack_require__) {
32160
32161"use strict";
32162
32163
32164Object.defineProperty(exports, "__esModule", {
32165 value: true
32166});
32167
32168var _promise;
32169
32170function _load_promise() {
32171 return _promise = _interopRequireDefault(__webpack_require__(7));
32172}
32173
32174exports.wait = wait;
32175exports.promisify = promisify;
32176exports.queue = queue;
32177
32178function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32179
32180function wait(delay) {
32181 return new (_promise || _load_promise()).default(function (resolve) {
32182 setTimeout(resolve, delay);
32183 });
32184}
32185
32186function promisify(fn, firstData) {
32187 return function () {
32188 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
32189 args[_key] = arguments[_key];
32190 }
32191
32192 return new (_promise || _load_promise()).default(function (resolve, reject) {
32193 args.push(function (err) {
32194 for (var _len2 = arguments.length, result = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
32195 result[_key2 - 1] = arguments[_key2];
32196 }
32197
32198 var res = result;
32199
32200 if (result.length <= 1) {
32201 res = result[0];
32202 }
32203
32204 if (firstData) {
32205 res = err;
32206 err = null;
32207 }
32208
32209 if (err) {
32210 reject(err);
32211 } else {
32212 resolve(res);
32213 }
32214 });
32215
32216 fn.apply(null, args);
32217 });
32218 };
32219}
32220
32221function queue(arr, promiseProducer) {
32222 var concurrency = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Infinity;
32223
32224 concurrency = Math.min(concurrency, arr.length);
32225
32226 // clone
32227 arr = arr.slice();
32228
32229 var results = [];
32230 var total = arr.length;
32231 if (!total) {
32232 return (_promise || _load_promise()).default.resolve(results);
32233 }
32234
32235 return new (_promise || _load_promise()).default(function (resolve, reject) {
32236 for (var i = 0; i < concurrency; i++) {
32237 next();
32238 }
32239
32240 function next() {
32241 var item = arr.shift();
32242 var promise = promiseProducer(item);
32243
32244 promise.then(function (result) {
32245 results.push(result);
32246
32247 total--;
32248 if (total === 0) {
32249 resolve(results);
32250 } else {
32251 if (arr.length) {
32252 next();
32253 }
32254 }
32255 }, reject);
32256 }
32257 });
32258}
32259
32260/***/ }),
32261/* 87 */
32262/***/ (function(module, exports, __webpack_require__) {
32263
32264"use strict";
32265
32266
32267Object.defineProperty(exports, "__esModule", {
32268 value: true
32269});
32270
32271var _classCallCheck2;
32272
32273function _load_classCallCheck() {
32274 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
32275}
32276
32277var _normalizePattern2;
32278
32279function _load_normalizePattern() {
32280 return _normalizePattern2 = __webpack_require__(52);
32281}
32282
32283function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32284
32285var semver = __webpack_require__(27);
32286
32287var WorkspaceLayout = function () {
32288 function WorkspaceLayout(workspaces, config) {
32289 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, WorkspaceLayout);
32290
32291 this.workspaces = workspaces;
32292 this.config = config;
32293 }
32294
32295 WorkspaceLayout.prototype.getWorkspaceManifest = function getWorkspaceManifest(key) {
32296 return this.workspaces[key];
32297 };
32298
32299 WorkspaceLayout.prototype.getManifestByPattern = function getManifestByPattern(pattern) {
32300 var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern),
32301 name = _normalizePattern.name,
32302 range = _normalizePattern.range;
32303
32304 var workspace = this.getWorkspaceManifest(name);
32305 if (!workspace || !semver.satisfies(workspace.manifest.version, range, this.config.looseSemver)) {
32306 return null;
32307 }
32308 return workspace;
32309 };
32310
32311 return WorkspaceLayout;
32312}();
32313
32314exports.default = WorkspaceLayout;
32315
32316/***/ }),
32317/* 88 */
32318/***/ (function(module, exports) {
32319
32320module.exports = function (it) {
32321 if (typeof it != 'function') throw TypeError(it + ' is not a function!');
32322 return it;
32323};
32324
32325
32326/***/ }),
32327/* 89 */
32328/***/ (function(module, exports) {
32329
32330var hasOwnProperty = {}.hasOwnProperty;
32331module.exports = function (it, key) {
32332 return hasOwnProperty.call(it, key);
32333};
32334
32335
32336/***/ }),
32337/* 90 */
32338/***/ (function(module, exports, __webpack_require__) {
32339
32340// to indexed object, toObject with fallback for non-array-like ES3 strings
32341var IObject = __webpack_require__(218);
32342var defined = __webpack_require__(215);
32343module.exports = function (it) {
32344 return IObject(defined(it));
32345};
32346
32347
32348/***/ }),
32349/* 91 */
32350/***/ (function(module, exports, __webpack_require__) {
32351
32352var Stream = __webpack_require__(35);
32353if (process.env.READABLE_STREAM === 'disable' && Stream) {
32354 module.exports = Stream;
32355 exports = module.exports = Stream.Readable;
32356 exports.Readable = Stream.Readable;
32357 exports.Writable = Stream.Writable;
32358 exports.Duplex = Stream.Duplex;
32359 exports.Transform = Stream.Transform;
32360 exports.PassThrough = Stream.PassThrough;
32361 exports.Stream = Stream;
32362} else {
32363 exports = module.exports = __webpack_require__(376);
32364 exports.Stream = Stream || exports;
32365 exports.Readable = exports;
32366 exports.Writable = __webpack_require__(378);
32367 exports.Duplex = __webpack_require__(110);
32368 exports.Transform = __webpack_require__(377);
32369 exports.PassThrough = __webpack_require__(864);
32370}
32371
32372
32373/***/ }),
32374/* 92 */
32375/***/ (function(module, exports, __webpack_require__) {
32376
32377// Copyright 2015 Joyent, Inc.
32378
32379module.exports = {
32380 read: read.bind(undefined, false, undefined),
32381 readType: read.bind(undefined, false),
32382 write: write,
32383 /* semi-private api, used by sshpk-agent */
32384 readPartial: read.bind(undefined, true),
32385
32386 /* shared with ssh format */
32387 readInternal: read,
32388 keyTypeToAlg: keyTypeToAlg,
32389 algToKeyType: algToKeyType
32390};
32391
32392var assert = __webpack_require__(22);
32393var Buffer = __webpack_require__(20).Buffer;
32394var algs = __webpack_require__(39);
32395var utils = __webpack_require__(32);
32396var Key = __webpack_require__(34);
32397var PrivateKey = __webpack_require__(40);
32398var SSHBuffer = __webpack_require__(147);
32399
32400function algToKeyType(alg) {
32401 assert.string(alg);
32402 if (alg === 'ssh-dss')
32403 return ('dsa');
32404 else if (alg === 'ssh-rsa')
32405 return ('rsa');
32406 else if (alg === 'ssh-ed25519')
32407 return ('ed25519');
32408 else if (alg === 'ssh-curve25519')
32409 return ('curve25519');
32410 else if (alg.match(/^ecdsa-sha2-/))
32411 return ('ecdsa');
32412 else
32413 throw (new Error('Unknown algorithm ' + alg));
32414}
32415
32416function keyTypeToAlg(key) {
32417 assert.object(key);
32418 if (key.type === 'dsa')
32419 return ('ssh-dss');
32420 else if (key.type === 'rsa')
32421 return ('ssh-rsa');
32422 else if (key.type === 'ed25519')
32423 return ('ssh-ed25519');
32424 else if (key.type === 'curve25519')
32425 return ('ssh-curve25519');
32426 else if (key.type === 'ecdsa')
32427 return ('ecdsa-sha2-' + key.part.curve.data.toString());
32428 else
32429 throw (new Error('Unknown key type ' + key.type));
32430}
32431
32432function read(partial, type, buf, options) {
32433 if (typeof (buf) === 'string')
32434 buf = Buffer.from(buf);
32435 assert.buffer(buf, 'buf');
32436
32437 var key = {};
32438
32439 var parts = key.parts = [];
32440 var sshbuf = new SSHBuffer({buffer: buf});
32441
32442 var alg = sshbuf.readString();
32443 assert.ok(!sshbuf.atEnd(), 'key must have at least one part');
32444
32445 key.type = algToKeyType(alg);
32446
32447 var partCount = algs.info[key.type].parts.length;
32448 if (type && type === 'private')
32449 partCount = algs.privInfo[key.type].parts.length;
32450
32451 while (!sshbuf.atEnd() && parts.length < partCount)
32452 parts.push(sshbuf.readPart());
32453 while (!partial && !sshbuf.atEnd())
32454 parts.push(sshbuf.readPart());
32455
32456 assert.ok(parts.length >= 1,
32457 'key must have at least one part');
32458 assert.ok(partial || sshbuf.atEnd(),
32459 'leftover bytes at end of key');
32460
32461 var Constructor = Key;
32462 var algInfo = algs.info[key.type];
32463 if (type === 'private' || algInfo.parts.length !== parts.length) {
32464 algInfo = algs.privInfo[key.type];
32465 Constructor = PrivateKey;
32466 }
32467 assert.strictEqual(algInfo.parts.length, parts.length);
32468
32469 if (key.type === 'ecdsa') {
32470 var res = /^ecdsa-sha2-(.+)$/.exec(alg);
32471 assert.ok(res !== null);
32472 assert.strictEqual(res[1], parts[0].data.toString());
32473 }
32474
32475 var normalized = true;
32476 for (var i = 0; i < algInfo.parts.length; ++i) {
32477 var p = parts[i];
32478 p.name = algInfo.parts[i];
32479 /*
32480 * OpenSSH stores ed25519 "private" keys as seed + public key
32481 * concat'd together (k followed by A). We want to keep them
32482 * separate for other formats that don't do this.
32483 */
32484 if (key.type === 'ed25519' && p.name === 'k')
32485 p.data = p.data.slice(0, 32);
32486
32487 if (p.name !== 'curve' && algInfo.normalize !== false) {
32488 var nd;
32489 if (key.type === 'ed25519') {
32490 nd = utils.zeroPadToLength(p.data, 32);
32491 } else {
32492 nd = utils.mpNormalize(p.data);
32493 }
32494 if (nd.toString('binary') !==
32495 p.data.toString('binary')) {
32496 p.data = nd;
32497 normalized = false;
32498 }
32499 }
32500 }
32501
32502 if (normalized)
32503 key._rfc4253Cache = sshbuf.toBuffer();
32504
32505 if (partial && typeof (partial) === 'object') {
32506 partial.remainder = sshbuf.remainder();
32507 partial.consumed = sshbuf._offset;
32508 }
32509
32510 return (new Constructor(key));
32511}
32512
32513function write(key, options) {
32514 assert.object(key);
32515
32516 var alg = keyTypeToAlg(key);
32517 var i;
32518
32519 var algInfo = algs.info[key.type];
32520 if (PrivateKey.isPrivateKey(key))
32521 algInfo = algs.privInfo[key.type];
32522 var parts = algInfo.parts;
32523
32524 var buf = new SSHBuffer({});
32525
32526 buf.writeString(alg);
32527
32528 for (i = 0; i < parts.length; ++i) {
32529 var data = key.part[parts[i]].data;
32530 if (algInfo.normalize !== false) {
32531 if (key.type === 'ed25519')
32532 data = utils.zeroPadToLength(data, 32);
32533 else
32534 data = utils.mpNormalize(data);
32535 }
32536 if (key.type === 'ed25519' && parts[i] === 'k')
32537 data = Buffer.concat([data, key.part.A.data]);
32538 buf.writeBuffer(data);
32539 }
32540
32541 return (buf.toBuffer());
32542}
32543
32544
32545/***/ }),
32546/* 93 */
32547/***/ (function(module, exports, __webpack_require__) {
32548
32549"use strict";
32550
32551
32552const Buffer = __webpack_require__(60).Buffer
32553
32554const crypto = __webpack_require__(21)
32555const Transform = __webpack_require__(35).Transform
32556
32557const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512']
32558
32559const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i
32560const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/
32561const STRICT_SRI_REGEX = /^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/
32562const VCHAR_REGEX = /^[\x21-\x7E]+$/
32563
32564class Hash {
32565 get isHash () { return true }
32566 constructor (hash, opts) {
32567 const strict = !!(opts && opts.strict)
32568 this.source = hash.trim()
32569 // 3.1. Integrity metadata (called "Hash" by ssri)
32570 // https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description
32571 const match = this.source.match(
32572 strict
32573 ? STRICT_SRI_REGEX
32574 : SRI_REGEX
32575 )
32576 if (!match) { return }
32577 if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return }
32578 this.algorithm = match[1]
32579 this.digest = match[2]
32580
32581 const rawOpts = match[3]
32582 this.options = rawOpts ? rawOpts.slice(1).split('?') : []
32583 }
32584 hexDigest () {
32585 return this.digest && Buffer.from(this.digest, 'base64').toString('hex')
32586 }
32587 toJSON () {
32588 return this.toString()
32589 }
32590 toString (opts) {
32591 if (opts && opts.strict) {
32592 // Strict mode enforces the standard as close to the foot of the
32593 // letter as it can.
32594 if (!(
32595 // The spec has very restricted productions for algorithms.
32596 // https://www.w3.org/TR/CSP2/#source-list-syntax
32597 SPEC_ALGORITHMS.some(x => x === this.algorithm) &&
32598 // Usually, if someone insists on using a "different" base64, we
32599 // leave it as-is, since there's multiple standards, and the
32600 // specified is not a URL-safe variant.
32601 // https://www.w3.org/TR/CSP2/#base64_value
32602 this.digest.match(BASE64_REGEX) &&
32603 // Option syntax is strictly visual chars.
32604 // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression
32605 // https://tools.ietf.org/html/rfc5234#appendix-B.1
32606 (this.options || []).every(opt => opt.match(VCHAR_REGEX))
32607 )) {
32608 return ''
32609 }
32610 }
32611 const options = this.options && this.options.length
32612 ? `?${this.options.join('?')}`
32613 : ''
32614 return `${this.algorithm}-${this.digest}${options}`
32615 }
32616}
32617
32618class Integrity {
32619 get isIntegrity () { return true }
32620 toJSON () {
32621 return this.toString()
32622 }
32623 toString (opts) {
32624 opts = opts || {}
32625 let sep = opts.sep || ' '
32626 if (opts.strict) {
32627 // Entries must be separated by whitespace, according to spec.
32628 sep = sep.replace(/\S+/g, ' ')
32629 }
32630 return Object.keys(this).map(k => {
32631 return this[k].map(hash => {
32632 return Hash.prototype.toString.call(hash, opts)
32633 }).filter(x => x.length).join(sep)
32634 }).filter(x => x.length).join(sep)
32635 }
32636 concat (integrity, opts) {
32637 const other = typeof integrity === 'string'
32638 ? integrity
32639 : stringify(integrity, opts)
32640 return parse(`${this.toString(opts)} ${other}`, opts)
32641 }
32642 hexDigest () {
32643 return parse(this, {single: true}).hexDigest()
32644 }
32645 match (integrity, opts) {
32646 const other = parse(integrity, opts)
32647 const algo = other.pickAlgorithm(opts)
32648 return (
32649 this[algo] &&
32650 other[algo] &&
32651 this[algo].find(hash =>
32652 other[algo].find(otherhash =>
32653 hash.digest === otherhash.digest
32654 )
32655 )
32656 ) || false
32657 }
32658 pickAlgorithm (opts) {
32659 const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash
32660 const keys = Object.keys(this)
32661 if (!keys.length) {
32662 throw new Error(`No algorithms available for ${
32663 JSON.stringify(this.toString())
32664 }`)
32665 }
32666 return keys.reduce((acc, algo) => {
32667 return pickAlgorithm(acc, algo) || acc
32668 })
32669 }
32670}
32671
32672module.exports.parse = parse
32673function parse (sri, opts) {
32674 opts = opts || {}
32675 if (typeof sri === 'string') {
32676 return _parse(sri, opts)
32677 } else if (sri.algorithm && sri.digest) {
32678 const fullSri = new Integrity()
32679 fullSri[sri.algorithm] = [sri]
32680 return _parse(stringify(fullSri, opts), opts)
32681 } else {
32682 return _parse(stringify(sri, opts), opts)
32683 }
32684}
32685
32686function _parse (integrity, opts) {
32687 // 3.4.3. Parse metadata
32688 // https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata
32689 if (opts.single) {
32690 return new Hash(integrity, opts)
32691 }
32692 return integrity.trim().split(/\s+/).reduce((acc, string) => {
32693 const hash = new Hash(string, opts)
32694 if (hash.algorithm && hash.digest) {
32695 const algo = hash.algorithm
32696 if (!acc[algo]) { acc[algo] = [] }
32697 acc[algo].push(hash)
32698 }
32699 return acc
32700 }, new Integrity())
32701}
32702
32703module.exports.stringify = stringify
32704function stringify (obj, opts) {
32705 if (obj.algorithm && obj.digest) {
32706 return Hash.prototype.toString.call(obj, opts)
32707 } else if (typeof obj === 'string') {
32708 return stringify(parse(obj, opts), opts)
32709 } else {
32710 return Integrity.prototype.toString.call(obj, opts)
32711 }
32712}
32713
32714module.exports.fromHex = fromHex
32715function fromHex (hexDigest, algorithm, opts) {
32716 const optString = (opts && opts.options && opts.options.length)
32717 ? `?${opts.options.join('?')}`
32718 : ''
32719 return parse(
32720 `${algorithm}-${
32721 Buffer.from(hexDigest, 'hex').toString('base64')
32722 }${optString}`, opts
32723 )
32724}
32725
32726module.exports.fromData = fromData
32727function fromData (data, opts) {
32728 opts = opts || {}
32729 const algorithms = opts.algorithms || ['sha512']
32730 const optString = opts.options && opts.options.length
32731 ? `?${opts.options.join('?')}`
32732 : ''
32733 return algorithms.reduce((acc, algo) => {
32734 const digest = crypto.createHash(algo).update(data).digest('base64')
32735 const hash = new Hash(
32736 `${algo}-${digest}${optString}`,
32737 opts
32738 )
32739 if (hash.algorithm && hash.digest) {
32740 const algo = hash.algorithm
32741 if (!acc[algo]) { acc[algo] = [] }
32742 acc[algo].push(hash)
32743 }
32744 return acc
32745 }, new Integrity())
32746}
32747
32748module.exports.fromStream = fromStream
32749function fromStream (stream, opts) {
32750 opts = opts || {}
32751 const P = opts.Promise || Promise
32752 const istream = integrityStream(opts)
32753 return new P((resolve, reject) => {
32754 stream.pipe(istream)
32755 stream.on('error', reject)
32756 istream.on('error', reject)
32757 let sri
32758 istream.on('integrity', s => { sri = s })
32759 istream.on('end', () => resolve(sri))
32760 istream.on('data', () => {})
32761 })
32762}
32763
32764module.exports.checkData = checkData
32765function checkData (data, sri, opts) {
32766 opts = opts || {}
32767 sri = parse(sri, opts)
32768 if (!Object.keys(sri).length) {
32769 if (opts.error) {
32770 throw Object.assign(
32771 new Error('No valid integrity hashes to check against'), {
32772 code: 'EINTEGRITY'
32773 }
32774 )
32775 } else {
32776 return false
32777 }
32778 }
32779 const algorithm = sri.pickAlgorithm(opts)
32780 const digest = crypto.createHash(algorithm).update(data).digest('base64')
32781 const newSri = parse({algorithm, digest})
32782 const match = newSri.match(sri, opts)
32783 if (match || !opts.error) {
32784 return match
32785 } else if (typeof opts.size === 'number' && (data.length !== opts.size)) {
32786 const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`)
32787 err.code = 'EBADSIZE'
32788 err.found = data.length
32789 err.expected = opts.size
32790 err.sri = sri
32791 throw err
32792 } else {
32793 const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`)
32794 err.code = 'EINTEGRITY'
32795 err.found = newSri
32796 err.expected = sri
32797 err.algorithm = algorithm
32798 err.sri = sri
32799 throw err
32800 }
32801}
32802
32803module.exports.checkStream = checkStream
32804function checkStream (stream, sri, opts) {
32805 opts = opts || {}
32806 const P = opts.Promise || Promise
32807 const checker = integrityStream(Object.assign({}, opts, {
32808 integrity: sri
32809 }))
32810 return new P((resolve, reject) => {
32811 stream.pipe(checker)
32812 stream.on('error', reject)
32813 checker.on('error', reject)
32814 let sri
32815 checker.on('verified', s => { sri = s })
32816 checker.on('end', () => resolve(sri))
32817 checker.on('data', () => {})
32818 })
32819}
32820
32821module.exports.integrityStream = integrityStream
32822function integrityStream (opts) {
32823 opts = opts || {}
32824 // For verification
32825 const sri = opts.integrity && parse(opts.integrity, opts)
32826 const goodSri = sri && Object.keys(sri).length
32827 const algorithm = goodSri && sri.pickAlgorithm(opts)
32828 const digests = goodSri && sri[algorithm]
32829 // Calculating stream
32830 const algorithms = Array.from(
32831 new Set(
32832 (opts.algorithms || ['sha512'])
32833 .concat(algorithm ? [algorithm] : [])
32834 )
32835 )
32836 const hashes = algorithms.map(crypto.createHash)
32837 let streamSize = 0
32838 const stream = new Transform({
32839 transform (chunk, enc, cb) {
32840 streamSize += chunk.length
32841 hashes.forEach(h => h.update(chunk, enc))
32842 cb(null, chunk, enc)
32843 }
32844 }).on('end', () => {
32845 const optString = (opts.options && opts.options.length)
32846 ? `?${opts.options.join('?')}`
32847 : ''
32848 const newSri = parse(hashes.map((h, i) => {
32849 return `${algorithms[i]}-${h.digest('base64')}${optString}`
32850 }).join(' '), opts)
32851 // Integrity verification mode
32852 const match = goodSri && newSri.match(sri, opts)
32853 if (typeof opts.size === 'number' && streamSize !== opts.size) {
32854 const err = new Error(`stream size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${streamSize}`)
32855 err.code = 'EBADSIZE'
32856 err.found = streamSize
32857 err.expected = opts.size
32858 err.sri = sri
32859 stream.emit('error', err)
32860 } else if (opts.integrity && !match) {
32861 const err = new Error(`${sri} integrity checksum failed when using ${algorithm}: wanted ${digests} but got ${newSri}. (${streamSize} bytes)`)
32862 err.code = 'EINTEGRITY'
32863 err.found = newSri
32864 err.expected = digests
32865 err.algorithm = algorithm
32866 err.sri = sri
32867 stream.emit('error', err)
32868 } else {
32869 stream.emit('size', streamSize)
32870 stream.emit('integrity', newSri)
32871 match && stream.emit('verified', match)
32872 }
32873 })
32874 return stream
32875}
32876
32877module.exports.create = createIntegrity
32878function createIntegrity (opts) {
32879 opts = opts || {}
32880 const algorithms = opts.algorithms || ['sha512']
32881 const optString = opts.options && opts.options.length
32882 ? `?${opts.options.join('?')}`
32883 : ''
32884
32885 const hashes = algorithms.map(crypto.createHash)
32886
32887 return {
32888 update: function (chunk, enc) {
32889 hashes.forEach(h => h.update(chunk, enc))
32890 return this
32891 },
32892 digest: function (enc) {
32893 const integrity = algorithms.reduce((acc, algo) => {
32894 const digest = hashes.shift().digest('base64')
32895 const hash = new Hash(
32896 `${algo}-${digest}${optString}`,
32897 opts
32898 )
32899 if (hash.algorithm && hash.digest) {
32900 const algo = hash.algorithm
32901 if (!acc[algo]) { acc[algo] = [] }
32902 acc[algo].push(hash)
32903 }
32904 return acc
32905 }, new Integrity())
32906
32907 return integrity
32908 }
32909 }
32910}
32911
32912const NODE_HASHES = new Set(crypto.getHashes())
32913
32914// This is a Best Effort™ at a reasonable priority for hash algos
32915const DEFAULT_PRIORITY = [
32916 'md5', 'whirlpool', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512',
32917 // TODO - it's unclear _which_ of these Node will actually use as its name
32918 // for the algorithm, so we guesswork it based on the OpenSSL names.
32919 'sha3',
32920 'sha3-256', 'sha3-384', 'sha3-512',
32921 'sha3_256', 'sha3_384', 'sha3_512'
32922].filter(algo => NODE_HASHES.has(algo))
32923
32924function getPrioritizedHash (algo1, algo2) {
32925 return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase())
32926 ? algo1
32927 : algo2
32928}
32929
32930
32931/***/ }),
32932/* 94 */
32933/***/ (function(module, exports) {
32934
32935module.exports = require("buffer");
32936
32937/***/ }),
32938/* 95 */
32939/***/ (function(module, exports) {
32940
32941module.exports = require("events");
32942
32943/***/ }),
32944/* 96 */
32945/***/ (function(module, exports, __webpack_require__) {
32946
32947"use strict";
32948
32949
32950Object.defineProperty(exports, "__esModule", {
32951 value: true
32952});
32953exports.getInstallationMethod = exports.version = undefined;
32954
32955var _asyncToGenerator2;
32956
32957function _load_asyncToGenerator() {
32958 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
32959}
32960
32961var getInstallationMethod = exports.getInstallationMethod = function () {
32962 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
32963 var installationMethod = originalInstallationMethod;
32964
32965 // If there's a package.json in the parent directory, it could have an
32966 // override for the installation method, so we should prefer that over
32967 // whatever was originally in Yarn's package.json. This is the case with
32968 // systems such as Homebrew, which take the tarball and modify the
32969 // installation method so we're aware of the fact that Yarn was installed via
32970 // Homebrew (so things like update notifications can point out the correct
32971 // command to upgrade).
32972 try {
32973 var manifestPath = (_path || _load_path()).default.join(__dirname, '..', 'package.json');
32974 if ((_fs2 || _load_fs2()).default.existsSync(manifestPath)) {
32975 // non-async version is deprecated
32976 var manifest = yield (0, (_fs || _load_fs()).readJson)(manifestPath);
32977 if (manifest.installationMethod) {
32978 installationMethod = manifest.installationMethod;
32979 }
32980 }
32981 } catch (e) {
32982 // Ignore any errors; this is not critical functionality.
32983 }
32984 return installationMethod;
32985 });
32986
32987 return function getInstallationMethod() {
32988 return _ref.apply(this, arguments);
32989 };
32990}();
32991
32992var _fs;
32993
32994function _load_fs() {
32995 return _fs = __webpack_require__(8);
32996}
32997
32998var _fs2;
32999
33000function _load_fs2() {
33001 return _fs2 = _interopRequireDefault(__webpack_require__(12));
33002}
33003
33004var _path;
33005
33006function _load_path() {
33007 return _path = _interopRequireDefault(__webpack_require__(1));
33008}
33009
33010function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33011
33012// This will be bundled directly in the .js file for production builds
33013var _require = __webpack_require__(438),
33014 version = _require.version,
33015 originalInstallationMethod = _require.installationMethod; /**
33016 * Determines the current version of Yarn itself.
33017 *
33018 */
33019
33020exports.version = version;
33021
33022/***/ }),
33023/* 97 */
33024/***/ (function(module, exports, __webpack_require__) {
33025
33026"use strict";
33027
33028
33029Object.defineProperty(exports, "__esModule", {
33030 value: true
33031});
33032exports.run = exports.getToken = undefined;
33033
33034var _promise;
33035
33036function _load_promise() {
33037 return _promise = _interopRequireDefault(__webpack_require__(7));
33038}
33039
33040var _asyncToGenerator2;
33041
33042function _load_asyncToGenerator() {
33043 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
33044}
33045
33046var getCredentials = function () {
33047 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) {
33048 var _config$registries$ya = config.registries.yarn.config,
33049 username = _config$registries$ya.username,
33050 email = _config$registries$ya.email;
33051
33052
33053 if (username) {
33054 reporter.info(`${reporter.lang('npmUsername')}: ${username}`);
33055 } else {
33056 username = yield reporter.question(reporter.lang('npmUsername'));
33057 if (!username) {
33058 return null;
33059 }
33060 }
33061
33062 if (email) {
33063 reporter.info(`${reporter.lang('npmEmail')}: ${email}`);
33064 } else {
33065 email = yield reporter.question(reporter.lang('npmEmail'));
33066 if (!email) {
33067 return null;
33068 }
33069 }
33070
33071 yield config.registries.yarn.saveHomeConfig({ username, email });
33072
33073 return { username, email };
33074 });
33075
33076 return function getCredentials(_x, _x2) {
33077 return _ref.apply(this, arguments);
33078 };
33079}();
33080
33081var getToken = exports.getToken = function () {
33082 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) {
33083 var name = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
33084 var flags = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
33085 var registry = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '';
33086
33087 var auth = registry ? config.registries.npm.getAuthByRegistry(registry) : config.registries.npm.getAuth(name);
33088
33089 if (config.otp) {
33090 config.registries.npm.setOtp(config.otp);
33091 }
33092
33093 if (auth) {
33094 config.registries.npm.setToken(auth);
33095 return function revoke() {
33096 reporter.info(reporter.lang('notRevokingConfigToken'));
33097 return (_promise || _load_promise()).default.resolve();
33098 };
33099 }
33100
33101 var env = process.env.YARN_AUTH_TOKEN || process.env.NPM_AUTH_TOKEN;
33102 if (env) {
33103 config.registries.npm.setToken(`Bearer ${env}`);
33104 return function revoke() {
33105 reporter.info(reporter.lang('notRevokingEnvToken'));
33106 return (_promise || _load_promise()).default.resolve();
33107 };
33108 }
33109
33110 // make sure we're not running in non-interactive mode before asking for login
33111 if (flags.nonInteractive || config.nonInteractive) {
33112 throw new (_errors || _load_errors()).MessageError(reporter.lang('nonInteractiveNoToken'));
33113 }
33114
33115 //
33116 var creds = yield getCredentials(config, reporter);
33117 if (!creds) {
33118 reporter.warn(reporter.lang('loginAsPublic'));
33119 return function revoke() {
33120 reporter.info(reporter.lang('noTokenToRevoke'));
33121 return (_promise || _load_promise()).default.resolve();
33122 };
33123 }
33124
33125 var username = creds.username,
33126 email = creds.email;
33127
33128 var password = yield reporter.question(reporter.lang('npmPassword'), {
33129 password: true,
33130 required: true
33131 });
33132
33133 //
33134 var userobj = {
33135 _id: `org.couchdb.user:${username}`,
33136 name: username,
33137 password,
33138 email,
33139 type: 'user',
33140 roles: [],
33141 date: new Date().toISOString()
33142 };
33143
33144 //
33145 var res = yield config.registries.npm.request(`-/user/org.couchdb.user:${encodeURIComponent(username)}`, {
33146 method: 'PUT',
33147 registry,
33148 body: userobj,
33149 auth: { username, password, email }
33150 });
33151
33152 if (res && res.ok) {
33153 reporter.success(reporter.lang('loggedIn'));
33154
33155 var token = res.token;
33156 config.registries.npm.setToken(`Bearer ${token}`);
33157
33158 return function () {
33159 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
33160 reporter.success(reporter.lang('revokedToken'));
33161 yield config.registries.npm.request(`-/user/token/${token}`, {
33162 method: 'DELETE',
33163 registry
33164 });
33165 });
33166
33167 function revoke() {
33168 return _ref3.apply(this, arguments);
33169 }
33170
33171 return revoke;
33172 }();
33173 } else {
33174 throw new (_errors || _load_errors()).MessageError(reporter.lang('incorrectCredentials'));
33175 }
33176 });
33177
33178 return function getToken(_x3, _x4) {
33179 return _ref2.apply(this, arguments);
33180 };
33181}();
33182
33183var run = exports.run = function () {
33184 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
33185 yield getCredentials(config, reporter);
33186 });
33187
33188 return function run(_x8, _x9, _x10, _x11) {
33189 return _ref4.apply(this, arguments);
33190 };
33191}();
33192
33193exports.getOneTimePassword = getOneTimePassword;
33194exports.hasWrapper = hasWrapper;
33195exports.setFlags = setFlags;
33196
33197var _errors;
33198
33199function _load_errors() {
33200 return _errors = __webpack_require__(6);
33201}
33202
33203function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33204
33205function getOneTimePassword(reporter) {
33206 return reporter.question(reporter.lang('npmOneTimePassword'));
33207}
33208
33209function hasWrapper(commander, args) {
33210 return true;
33211}
33212
33213function setFlags(commander) {
33214 commander.description('Stores registry username and email.');
33215}
33216
33217/***/ }),
33218/* 98 */
33219/***/ (function(module, exports, __webpack_require__) {
33220
33221"use strict";
33222
33223
33224Object.defineProperty(exports, "__esModule", {
33225 value: true
33226});
33227
33228var _asyncToGenerator2;
33229
33230function _load_asyncToGenerator() {
33231 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
33232}
33233
33234var _promise;
33235
33236function _load_promise() {
33237 return _promise = _interopRequireDefault(__webpack_require__(7));
33238}
33239
33240var _classCallCheck2;
33241
33242function _load_classCallCheck() {
33243 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
33244}
33245
33246var _stringify;
33247
33248function _load_stringify() {
33249 return _stringify = _interopRequireDefault(__webpack_require__(36));
33250}
33251
33252exports.stringifyLangArgs = stringifyLangArgs;
33253
33254var _format;
33255
33256function _load_format() {
33257 return _format = __webpack_require__(522);
33258}
33259
33260var _index;
33261
33262function _load_index() {
33263 return _index = _interopRequireWildcard(__webpack_require__(524));
33264}
33265
33266var _isCi;
33267
33268function _load_isCi() {
33269 return _isCi = _interopRequireDefault(__webpack_require__(365));
33270}
33271
33272var _os;
33273
33274function _load_os() {
33275 return _os = _interopRequireDefault(__webpack_require__(72));
33276}
33277
33278function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
33279
33280function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33281
33282/* eslint no-unused-vars: 0 */
33283
33284var util = __webpack_require__(9);
33285var EventEmitter = __webpack_require__(95).EventEmitter;
33286
33287function stringifyLangArgs(args) {
33288 return args.map(function (val) {
33289 if (val != null && val.inspect) {
33290 return val.inspect();
33291 } else {
33292 try {
33293 var str = (0, (_stringify || _load_stringify()).default)(val) || val + '';
33294 // should match all literal line breaks and
33295 // "u001b" that follow an odd number of backslashes and convert them to ESC
33296 // we do this because the JSON.stringify process has escaped these characters
33297 return str.replace(/((?:^|[^\\])(?:\\{2})*)\\u001[bB]/g, '$1\u001b').replace(/[\\]r[\\]n|([\\])?[\\]n/g, function (match, precededBacklash) {
33298 // precededBacklash not null when "\n" is preceded by a backlash ("\\n")
33299 // match will be "\\n" and we don't replace it with os.EOL
33300 return precededBacklash ? match : (_os || _load_os()).default.EOL;
33301 });
33302 } catch (e) {
33303 return util.inspect(val);
33304 }
33305 }
33306 });
33307}
33308
33309var BaseReporter = function () {
33310 function BaseReporter() {
33311 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
33312 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseReporter);
33313
33314 var lang = 'en';
33315 this.language = lang;
33316
33317 this.stdout = opts.stdout || process.stdout;
33318 this.stderr = opts.stderr || process.stderr;
33319 this.stdin = opts.stdin || this._getStandardInput();
33320 this.emoji = !!opts.emoji;
33321 this.nonInteractive = !!opts.nonInteractive;
33322 this.noProgress = !!opts.noProgress || (_isCi || _load_isCi()).default;
33323 this.isVerbose = !!opts.verbose;
33324
33325 // $FlowFixMe: this is valid!
33326 this.isTTY = this.stdout.isTTY;
33327
33328 this.peakMemory = 0;
33329 this.startTime = Date.now();
33330 this.format = (_format || _load_format()).defaultFormatter;
33331 }
33332
33333 BaseReporter.prototype.lang = function lang(key) {
33334 var msg = (_index || _load_index())[this.language][key] || (_index || _load_index()).en[key];
33335 if (!msg) {
33336 throw new ReferenceError(`No message defined for language key ${key}`);
33337 }
33338
33339 // stringify args
33340
33341 for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
33342 args[_key - 1] = arguments[_key];
33343 }
33344
33345 var stringifiedArgs = stringifyLangArgs(args);
33346
33347 // replace $0 placeholders with args
33348 return msg.replace(/\$(\d+)/g, function (str, i) {
33349 return stringifiedArgs[i];
33350 });
33351 };
33352
33353 /**
33354 * `stringifyLangArgs` run `JSON.stringify` on strings too causing
33355 * them to appear quoted. This marks them as "raw" and prevents
33356 * the quoting and escaping
33357 */
33358
33359
33360 BaseReporter.prototype.rawText = function rawText(str) {
33361 return {
33362 inspect() {
33363 return str;
33364 }
33365 };
33366 };
33367
33368 BaseReporter.prototype.verbose = function verbose(msg) {
33369 if (this.isVerbose) {
33370 this._verbose(msg);
33371 }
33372 };
33373
33374 BaseReporter.prototype.verboseInspect = function verboseInspect(val) {
33375 if (this.isVerbose) {
33376 this._verboseInspect(val);
33377 }
33378 };
33379
33380 BaseReporter.prototype._verbose = function _verbose(msg) {};
33381
33382 BaseReporter.prototype._verboseInspect = function _verboseInspect(val) {};
33383
33384 BaseReporter.prototype._getStandardInput = function _getStandardInput() {
33385 var standardInput = void 0;
33386
33387 // Accessing stdin in a win32 headless process (e.g., Visual Studio) may throw an exception.
33388 try {
33389 standardInput = process.stdin;
33390 } catch (e) {
33391 console.warn(e.message);
33392 delete process.stdin;
33393 // $FlowFixMe: this is valid!
33394 process.stdin = new EventEmitter();
33395 standardInput = process.stdin;
33396 }
33397
33398 return standardInput;
33399 };
33400
33401 BaseReporter.prototype.initPeakMemoryCounter = function initPeakMemoryCounter() {
33402 var _this = this;
33403
33404 this.checkPeakMemory();
33405 this.peakMemoryInterval = setInterval(function () {
33406 _this.checkPeakMemory();
33407 }, 1000);
33408 // $FlowFixMe: Node's setInterval returns a Timeout, not a Number
33409 this.peakMemoryInterval.unref();
33410 };
33411
33412 BaseReporter.prototype.checkPeakMemory = function checkPeakMemory() {
33413 var _process$memoryUsage = process.memoryUsage(),
33414 heapTotal = _process$memoryUsage.heapTotal;
33415
33416 if (heapTotal > this.peakMemory) {
33417 this.peakMemory = heapTotal;
33418 }
33419 };
33420
33421 BaseReporter.prototype.close = function close() {
33422 if (this.peakMemoryInterval) {
33423 clearInterval(this.peakMemoryInterval);
33424 this.peakMemoryInterval = null;
33425 }
33426 };
33427
33428 BaseReporter.prototype.getTotalTime = function getTotalTime() {
33429 return Date.now() - this.startTime;
33430 };
33431
33432 // TODO
33433
33434
33435 BaseReporter.prototype.list = function list(key, items, hints) {};
33436
33437 // Outputs basic tree structure to console
33438
33439
33440 BaseReporter.prototype.tree = function tree(key, obj) {
33441 var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
33442 _ref$force = _ref.force,
33443 force = _ref$force === undefined ? false : _ref$force;
33444 };
33445
33446 // called whenever we begin a step in the CLI.
33447
33448
33449 BaseReporter.prototype.step = function step(current, total, message, emoji) {};
33450
33451 // a error message has been triggered. this however does not always meant an abrupt
33452 // program end.
33453
33454
33455 BaseReporter.prototype.error = function error(message) {};
33456
33457 // an info message has been triggered. this provides things like stats and diagnostics.
33458
33459
33460 BaseReporter.prototype.info = function info(message) {};
33461
33462 // a warning message has been triggered.
33463
33464
33465 BaseReporter.prototype.warn = function warn(message) {};
33466
33467 // a success message has been triggered.
33468
33469
33470 BaseReporter.prototype.success = function success(message) {};
33471
33472 // a simple log message
33473 // TODO: rethink the {force} parameter. In the meantime, please don't use it (cf comments in #4143).
33474
33475
33476 BaseReporter.prototype.log = function log(message) {
33477 var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
33478 _ref2$force = _ref2.force,
33479 force = _ref2$force === undefined ? false : _ref2$force;
33480 };
33481
33482 // a shell command has been executed
33483
33484
33485 BaseReporter.prototype.command = function command(_command) {};
33486
33487 // inspect and pretty-print any value
33488
33489
33490 BaseReporter.prototype.inspect = function inspect(value) {};
33491
33492 // the screen shown at the very start of the CLI
33493
33494
33495 BaseReporter.prototype.header = function header(command, pkg) {};
33496
33497 // the screen shown at the very end of the CLI
33498
33499
33500 BaseReporter.prototype.footer = function footer(showPeakMemory) {};
33501
33502 // a table structure
33503
33504
33505 BaseReporter.prototype.table = function table(head, body) {};
33506
33507 // security audit action to resolve advisories
33508
33509
33510 BaseReporter.prototype.auditAction = function auditAction(recommendation) {};
33511
33512 // security audit requires manual review
33513
33514
33515 BaseReporter.prototype.auditManualReview = function auditManualReview() {};
33516
33517 // security audit advisory
33518
33519
33520 BaseReporter.prototype.auditAdvisory = function auditAdvisory(resolution, _auditAdvisory) {};
33521
33522 // summary for security audit report
33523
33524
33525 BaseReporter.prototype.auditSummary = function auditSummary(auditMetadata) {};
33526
33527 // render an activity spinner and return a function that will trigger an update
33528
33529
33530 BaseReporter.prototype.activity = function activity() {
33531 return {
33532 tick(name) {},
33533 end() {}
33534 };
33535 };
33536
33537 //
33538
33539
33540 BaseReporter.prototype.activitySet = function activitySet(total, workers) {
33541 return {
33542 spinners: Array(workers).fill({
33543 clear() {},
33544 setPrefix() {},
33545 tick() {},
33546 end() {}
33547 }),
33548 end() {}
33549 };
33550 };
33551
33552 //
33553
33554
33555 BaseReporter.prototype.question = function question(_question) {
33556 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
33557
33558 return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
33559 };
33560
33561 //
33562
33563
33564 BaseReporter.prototype.questionAffirm = function () {
33565 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (question) {
33566 var condition = true; // trick eslint
33567 if (this.nonInteractive) {
33568 return true;
33569 }
33570
33571 while (condition) {
33572 var answer = yield this.question(question);
33573 answer = answer.toLowerCase();
33574
33575 if (answer === 'y' || answer === 'yes') {
33576 return true;
33577 }
33578 if (answer === 'n' || answer === 'no') {
33579 return false;
33580 }
33581
33582 this.error('Invalid answer for question');
33583 }
33584
33585 return false;
33586 });
33587
33588 function questionAffirm(_x5) {
33589 return _ref3.apply(this, arguments);
33590 }
33591
33592 return questionAffirm;
33593 }();
33594
33595 // prompt the user to select an option from an array
33596
33597
33598 BaseReporter.prototype.select = function select(header, question, options) {
33599 return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
33600 };
33601
33602 // render a progress bar and return a function which when called will trigger an update
33603
33604
33605 BaseReporter.prototype.progress = function progress(total) {
33606 return function () {};
33607 };
33608
33609 // utility function to disable progress bar
33610
33611
33612 BaseReporter.prototype.disableProgress = function disableProgress() {
33613 this.noProgress = true;
33614 };
33615
33616 //
33617
33618
33619 BaseReporter.prototype.prompt = function prompt(message, choices) {
33620 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
33621
33622 return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
33623 };
33624
33625 return BaseReporter;
33626}();
33627
33628exports.default = BaseReporter;
33629
33630/***/ }),
33631/* 99 */
33632/***/ (function(module, exports, __webpack_require__) {
33633
33634"use strict";
33635
33636
33637Object.defineProperty(exports, "__esModule", {
33638 value: true
33639});
33640
33641var _asyncToGenerator2;
33642
33643function _load_asyncToGenerator() {
33644 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
33645}
33646
33647var _classCallCheck2;
33648
33649function _load_classCallCheck() {
33650 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
33651}
33652
33653var _possibleConstructorReturn2;
33654
33655function _load_possibleConstructorReturn() {
33656 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
33657}
33658
33659var _inherits2;
33660
33661function _load_inherits() {
33662 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
33663}
33664
33665exports.explodeHostedGitFragment = explodeHostedGitFragment;
33666
33667var _errors;
33668
33669function _load_errors() {
33670 return _errors = __webpack_require__(6);
33671}
33672
33673var _index;
33674
33675function _load_index() {
33676 return _index = __webpack_require__(61);
33677}
33678
33679var _gitResolver;
33680
33681function _load_gitResolver() {
33682 return _gitResolver = _interopRequireDefault(__webpack_require__(118));
33683}
33684
33685var _exoticResolver;
33686
33687function _load_exoticResolver() {
33688 return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
33689}
33690
33691var _git;
33692
33693function _load_git() {
33694 return _git = _interopRequireDefault(__webpack_require__(205));
33695}
33696
33697var _guessName;
33698
33699function _load_guessName() {
33700 return _guessName = _interopRequireDefault(__webpack_require__(159));
33701}
33702
33703function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33704
33705function parseHash(fragment) {
33706 var hashPosition = fragment.indexOf('#');
33707 return hashPosition === -1 ? '' : fragment.substr(hashPosition + 1);
33708}
33709
33710function explodeHostedGitFragment(fragment, reporter) {
33711 var hash = parseHash(fragment);
33712
33713 var preParts = fragment.split('@');
33714 if (preParts.length > 2) {
33715 fragment = preParts[1] + '@' + preParts[2];
33716 }
33717
33718 var parts = fragment.replace(/(.*?)#.*/, '$1') // Strip hash
33719 .replace(/.*:(.*)/, '$1') // Strip prefixed protocols
33720 .replace(/.git$/, '') // Strip the .git suffix
33721 .split('/');
33722
33723 var user = parts[parts.length - 2];
33724 var repo = parts[parts.length - 1];
33725
33726 if (user === undefined || repo === undefined) {
33727 throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidHostedGitFragment', fragment));
33728 }
33729
33730 return {
33731 user,
33732 repo,
33733 hash
33734 };
33735}
33736
33737var HostedGitResolver = function (_ExoticResolver) {
33738 (0, (_inherits2 || _load_inherits()).default)(HostedGitResolver, _ExoticResolver);
33739
33740 function HostedGitResolver(request, fragment) {
33741 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, HostedGitResolver);
33742
33743 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
33744
33745 var exploded = _this.exploded = explodeHostedGitFragment(fragment, _this.reporter);
33746 var user = exploded.user,
33747 repo = exploded.repo,
33748 hash = exploded.hash;
33749
33750 _this.user = user;
33751 _this.repo = repo;
33752 _this.hash = hash;
33753 return _this;
33754 }
33755
33756 HostedGitResolver.getTarballUrl = function getTarballUrl(exploded, commit) {
33757 exploded;
33758 commit;
33759 throw new Error('Not implemented');
33760 };
33761
33762 HostedGitResolver.getGitHTTPUrl = function getGitHTTPUrl(exploded) {
33763 exploded;
33764 throw new Error('Not implemented');
33765 };
33766
33767 HostedGitResolver.getGitHTTPBaseUrl = function getGitHTTPBaseUrl(exploded) {
33768 exploded;
33769 throw new Error('Not implemented');
33770 };
33771
33772 HostedGitResolver.getGitSSHUrl = function getGitSSHUrl(exploded) {
33773 exploded;
33774 throw new Error('Not implemented');
33775 };
33776
33777 HostedGitResolver.getHTTPFileUrl = function getHTTPFileUrl(exploded, filename, commit) {
33778 exploded;
33779 filename;
33780 commit;
33781 throw new Error('Not implemented');
33782 };
33783
33784 HostedGitResolver.prototype.getRefOverHTTP = function () {
33785 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) {
33786 var gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url);
33787 var client = new (_git || _load_git()).default(this.config, gitUrl, this.hash);
33788
33789 var out = yield this.config.requestManager.request({
33790 url: `${url}/info/refs?service=git-upload-pack`,
33791 queue: this.resolver.fetchingQueue
33792 });
33793
33794 if (out) {
33795 // clean up output
33796 var lines = out.trim().split('\n');
33797
33798 // remove first two lines which contains compatibility info etc
33799 lines = lines.slice(2);
33800
33801 // remove last line which contains the terminator "0000"
33802 lines.pop();
33803
33804 // remove line lengths from start of each line
33805 lines = lines.map(function (line) {
33806 return line.slice(4);
33807 });
33808
33809 out = lines.join('\n');
33810 } else {
33811 throw new Error(this.reporter.lang('hostedGitResolveError'));
33812 }
33813
33814 return client.setRefHosted(out);
33815 });
33816
33817 function getRefOverHTTP(_x) {
33818 return _ref.apply(this, arguments);
33819 }
33820
33821 return getRefOverHTTP;
33822 }();
33823
33824 HostedGitResolver.prototype.resolveOverHTTP = function () {
33825 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) {
33826 var _this2 = this;
33827
33828 var commit = yield this.getRefOverHTTP(url);
33829 var config = this.config;
33830
33831
33832 var tarballUrl = this.constructor.getTarballUrl(this.exploded, commit);
33833
33834 var tryRegistry = function () {
33835 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) {
33836 var filename = (_index || _load_index()).registries[registry].filename;
33837
33838 var href = _this2.constructor.getHTTPFileUrl(_this2.exploded, filename, commit);
33839 var file = yield config.requestManager.request({
33840 url: href,
33841 queue: _this2.resolver.fetchingQueue
33842 });
33843 if (!file) {
33844 return null;
33845 }
33846
33847 var json = yield config.readJson(href, function () {
33848 return JSON.parse(file);
33849 });
33850 json._uid = commit;
33851 json._remote = {
33852 resolved: tarballUrl,
33853 type: 'tarball',
33854 reference: tarballUrl,
33855 registry
33856 };
33857 return json;
33858 });
33859
33860 return function tryRegistry(_x3) {
33861 return _ref3.apply(this, arguments);
33862 };
33863 }();
33864
33865 var file = yield tryRegistry(this.registry);
33866 if (file) {
33867 return file;
33868 }
33869
33870 for (var registry in (_index || _load_index()).registries) {
33871 if (registry === this.registry) {
33872 continue;
33873 }
33874
33875 var _file = yield tryRegistry(registry);
33876 if (_file) {
33877 return _file;
33878 }
33879 }
33880
33881 return {
33882 name: (0, (_guessName || _load_guessName()).default)(url),
33883 version: '0.0.0',
33884 _uid: commit,
33885 _remote: {
33886 resolved: tarballUrl,
33887 type: 'tarball',
33888 reference: tarballUrl,
33889 registry: 'npm',
33890 hash: undefined
33891 }
33892 };
33893 });
33894
33895 function resolveOverHTTP(_x2) {
33896 return _ref2.apply(this, arguments);
33897 }
33898
33899 return resolveOverHTTP;
33900 }();
33901
33902 HostedGitResolver.prototype.hasHTTPCapability = function () {
33903 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) {
33904 return (yield this.config.requestManager.request({
33905 url,
33906 method: 'HEAD',
33907 queue: this.resolver.fetchingQueue,
33908 followRedirect: false
33909 })) !== false;
33910 });
33911
33912 function hasHTTPCapability(_x4) {
33913 return _ref4.apply(this, arguments);
33914 }
33915
33916 return hasHTTPCapability;
33917 }();
33918
33919 HostedGitResolver.prototype.resolve = function () {
33920 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
33921 // If we already have the tarball, just return it without having to make any HTTP requests.
33922 var shrunk = this.request.getLocked('tarball');
33923 if (shrunk) {
33924 return shrunk;
33925 }
33926
33927 var httpUrl = this.constructor.getGitHTTPUrl(this.exploded);
33928 var httpBaseUrl = this.constructor.getGitHTTPBaseUrl(this.exploded);
33929 var sshUrl = this.constructor.getGitSSHUrl(this.exploded);
33930
33931 // If we can access the files over HTTP then we should as it's MUCH faster than git
33932 // archive and tarball unarchiving. The HTTP API is only available for public repos
33933 // though.
33934 if (yield this.hasHTTPCapability(httpBaseUrl)) {
33935 return this.resolveOverHTTP(httpUrl);
33936 }
33937
33938 // If the url is accessible over git archive then we should immediately delegate to
33939 // the git resolver.
33940 //
33941 // NOTE: Here we use a different url than when we delegate to the git resolver later on.
33942 // This is because `git archive` requires access over ssh and github only allows that
33943 // if you have write permissions
33944 var sshGitUrl = (_git || _load_git()).default.npmUrlToGitUrl(sshUrl);
33945 if (yield (_git || _load_git()).default.hasArchiveCapability(sshGitUrl)) {
33946 var archiveClient = new (_git || _load_git()).default(this.config, sshGitUrl, this.hash);
33947 var commit = yield archiveClient.init();
33948 return this.fork((_gitResolver || _load_gitResolver()).default, true, `${sshUrl}#${commit}`);
33949 }
33950
33951 // fallback to the plain git resolver
33952 return this.fork((_gitResolver || _load_gitResolver()).default, true, sshUrl);
33953 });
33954
33955 function resolve() {
33956 return _ref5.apply(this, arguments);
33957 }
33958
33959 return resolve;
33960 }();
33961
33962 return HostedGitResolver;
33963}((_exoticResolver || _load_exoticResolver()).default);
33964
33965exports.default = HostedGitResolver;
33966
33967/***/ }),
33968/* 100 */
33969/***/ (function(module, exports, __webpack_require__) {
33970
33971"use strict";
33972
33973
33974Object.defineProperty(exports, "__esModule", {
33975 value: true
33976});
33977exports.execCommand = exports.execFromManifest = exports.executeLifecycleScript = exports.makeEnv = exports.getWrappersFolder = exports.IGNORE_MANIFEST_KEYS = undefined;
33978
33979var _promise;
33980
33981function _load_promise() {
33982 return _promise = _interopRequireDefault(__webpack_require__(7));
33983}
33984
33985var _getIterator2;
33986
33987function _load_getIterator() {
33988 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
33989}
33990
33991var _from;
33992
33993function _load_from() {
33994 return _from = _interopRequireDefault(__webpack_require__(53));
33995}
33996
33997var _keys;
33998
33999function _load_keys() {
34000 return _keys = _interopRequireDefault(__webpack_require__(14));
34001}
34002
34003var _stringify;
34004
34005function _load_stringify() {
34006 return _stringify = _interopRequireDefault(__webpack_require__(36));
34007}
34008
34009var _assign;
34010
34011function _load_assign() {
34012 return _assign = _interopRequireDefault(__webpack_require__(23));
34013}
34014
34015var _extends2;
34016
34017function _load_extends() {
34018 return _extends2 = _interopRequireDefault(__webpack_require__(24));
34019}
34020
34021var _asyncToGenerator2;
34022
34023function _load_asyncToGenerator() {
34024 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
34025}
34026
34027var _set;
34028
34029function _load_set() {
34030 return _set = _interopRequireDefault(__webpack_require__(16));
34031}
34032
34033var getWrappersFolder = exports.getWrappersFolder = function () {
34034 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
34035 if (wrappersFolder) {
34036 return wrappersFolder;
34037 }
34038
34039 wrappersFolder = yield (_fs || _load_fs()).makeTempDir();
34040
34041 yield (0, (_portableScript || _load_portableScript()).makePortableProxyScript)(process.execPath, wrappersFolder, {
34042 proxyBasename: 'node'
34043 });
34044
34045 yield (0, (_portableScript || _load_portableScript()).makePortableProxyScript)(process.execPath, wrappersFolder, {
34046 proxyBasename: 'yarn',
34047 prependArguments: [process.argv[1]]
34048 });
34049
34050 return wrappersFolder;
34051 });
34052
34053 return function getWrappersFolder(_x) {
34054 return _ref.apply(this, arguments);
34055 };
34056}();
34057
34058var makeEnv = exports.makeEnv = function () {
34059 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (stage, cwd, config) {
34060 var env = (0, (_extends2 || _load_extends()).default)({
34061 NODE: process.execPath,
34062 INIT_CWD: process.cwd()
34063 }, process.env);
34064
34065 // Merge in the `env` object specified in .yarnrc
34066 var customEnv = config.getOption('env');
34067 if (customEnv && typeof customEnv === 'object') {
34068 (0, (_assign || _load_assign()).default)(env, customEnv);
34069 }
34070
34071 env.npm_lifecycle_event = stage;
34072 env.npm_node_execpath = env.NODE;
34073 env.npm_execpath = env.npm_execpath || process.mainModule && process.mainModule.filename;
34074
34075 // Set the env to production for npm compat if production mode.
34076 // https://github.com/npm/npm/blob/30d75e738b9cb7a6a3f9b50e971adcbe63458ed3/lib/utils/lifecycle.js#L336
34077 if (config.production) {
34078 env.NODE_ENV = 'production';
34079 }
34080
34081 // Note: npm_config_argv environment variable contains output of nopt - command-line
34082 // parser used by npm. Since we use other parser, we just roughly emulate it's output. (See: #684)
34083 env.npm_config_argv = (0, (_stringify || _load_stringify()).default)({
34084 remain: [],
34085 cooked: config.commandName === 'run' ? [config.commandName, stage] : [config.commandName],
34086 original: process.argv.slice(2)
34087 });
34088
34089 var manifest = yield config.maybeReadManifest(cwd);
34090 if (manifest) {
34091 if (manifest.scripts && Object.prototype.hasOwnProperty.call(manifest.scripts, stage)) {
34092 env.npm_lifecycle_script = manifest.scripts[stage];
34093 }
34094
34095 // add npm_package_*
34096 var queue = [['', manifest]];
34097 while (queue.length) {
34098 var _queue$pop = queue.pop(),
34099 _key = _queue$pop[0],
34100 val = _queue$pop[1];
34101
34102 if (typeof val === 'object') {
34103 for (var subKey in val) {
34104 var fullKey = [_key, subKey].filter(Boolean).join('_');
34105 if (fullKey && fullKey[0] !== '_' && !IGNORE_MANIFEST_KEYS.has(fullKey)) {
34106 queue.push([fullKey, val[subKey]]);
34107 }
34108 }
34109 } else {
34110 var cleanVal = String(val);
34111 if (cleanVal.indexOf('\n') >= 0) {
34112 cleanVal = (0, (_stringify || _load_stringify()).default)(cleanVal);
34113 }
34114
34115 //replacing invalid chars with underscore
34116 var cleanKey = _key.replace(INVALID_CHAR_REGEX, '_');
34117
34118 env[`npm_package_${cleanKey}`] = cleanVal;
34119 }
34120 }
34121 }
34122
34123 // add npm_config_* and npm_package_config_* from yarn config
34124 var keys = new (_set || _load_set()).default([].concat((0, (_keys || _load_keys()).default)(config.registries.yarn.config), (0, (_keys || _load_keys()).default)(config.registries.npm.config)));
34125 var cleaned = (0, (_from || _load_from()).default)(keys).filter(function (key) {
34126 return !key.match(/:_/) && IGNORE_CONFIG_KEYS.indexOf(key) === -1;
34127 }).map(function (key) {
34128 var val = config.getOption(key);
34129 if (!val) {
34130 val = '';
34131 } else if (typeof val === 'number') {
34132 val = '' + val;
34133 } else if (typeof val !== 'string') {
34134 val = (0, (_stringify || _load_stringify()).default)(val);
34135 }
34136
34137 if (val.indexOf('\n') >= 0) {
34138 val = (0, (_stringify || _load_stringify()).default)(val);
34139 }
34140 return [key, val];
34141 });
34142 // add npm_config_*
34143 for (var _iterator = cleaned, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
34144 var _ref4;
34145
34146 if (_isArray) {
34147 if (_i >= _iterator.length) break;
34148 _ref4 = _iterator[_i++];
34149 } else {
34150 _i = _iterator.next();
34151 if (_i.done) break;
34152 _ref4 = _i.value;
34153 }
34154
34155 var _ref3 = _ref4;
34156 var _key2 = _ref3[0];
34157 var _val = _ref3[1];
34158
34159 var _cleanKey = _key2.replace(/^_+/, '');
34160 var envKey = `npm_config_${_cleanKey}`.replace(INVALID_CHAR_REGEX, '_');
34161 env[envKey] = _val;
34162 }
34163 // add npm_package_config_*
34164 if (manifest && manifest.name) {
34165 var packageConfigPrefix = `${manifest.name}:`;
34166 for (var _iterator2 = cleaned, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
34167 var _ref6;
34168
34169 if (_isArray2) {
34170 if (_i2 >= _iterator2.length) break;
34171 _ref6 = _iterator2[_i2++];
34172 } else {
34173 _i2 = _iterator2.next();
34174 if (_i2.done) break;
34175 _ref6 = _i2.value;
34176 }
34177
34178 var _ref5 = _ref6;
34179 var _key3 = _ref5[0];
34180 var _val2 = _ref5[1];
34181
34182 if (_key3.indexOf(packageConfigPrefix) !== 0) {
34183 continue;
34184 }
34185 var _cleanKey2 = _key3.replace(/^_+/, '').replace(packageConfigPrefix, '');
34186 var envKey = `npm_package_config_${_cleanKey2}`.replace(INVALID_CHAR_REGEX, '_');
34187 env[envKey] = _val2;
34188 }
34189 }
34190
34191 // split up the path
34192 var envPath = env[(_constants || _load_constants()).ENV_PATH_KEY];
34193 var pathParts = envPath ? envPath.split(path.delimiter) : [];
34194
34195 // Include node-gyp version that was bundled with the current Node.js version,
34196 // if available.
34197 pathParts.unshift(path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'node-gyp-bin'));
34198 pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin'));
34199 // Include node-gyp version from homebrew managed npm, if available.
34200 pathParts.unshift(path.join(path.dirname(process.execPath), '..', 'libexec', 'lib', 'node_modules', 'npm', 'bin', 'node-gyp-bin'));
34201
34202 // Add global bin folder if it is not present already, as some packages depend
34203 // on a globally-installed version of node-gyp.
34204 var globalBin = yield (0, (_global || _load_global()).getBinFolder)(config, {});
34205 if (pathParts.indexOf(globalBin) === -1) {
34206 pathParts.unshift(globalBin);
34207 }
34208
34209 // Add node_modules .bin folders to the PATH
34210 for (var _iterator3 = config.registryFolders, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
34211 var _ref7;
34212
34213 if (_isArray3) {
34214 if (_i3 >= _iterator3.length) break;
34215 _ref7 = _iterator3[_i3++];
34216 } else {
34217 _i3 = _iterator3.next();
34218 if (_i3.done) break;
34219 _ref7 = _i3.value;
34220 }
34221
34222 var registryFolder = _ref7;
34223
34224 var binFolder = path.join(registryFolder, '.bin');
34225 if (config.workspacesEnabled && config.workspaceRootFolder) {
34226 pathParts.unshift(path.join(config.workspaceRootFolder, binFolder));
34227 }
34228 pathParts.unshift(path.join(config.linkFolder, binFolder));
34229 pathParts.unshift(path.join(cwd, binFolder));
34230 }
34231
34232 var pnpFile = void 0;
34233
34234 if (process.versions.pnp) {
34235 pnpFile = (_dynamicRequire || _load_dynamicRequire()).dynamicRequire.resolve('pnpapi');
34236 } else {
34237 var candidate = `${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`;
34238 if (yield (_fs || _load_fs()).exists(candidate)) {
34239 pnpFile = candidate;
34240 }
34241 }
34242
34243 if (pnpFile) {
34244 var pnpApi = (0, (_dynamicRequire || _load_dynamicRequire()).dynamicRequire)(pnpFile);
34245
34246 var packageLocator = pnpApi.findPackageLocator(`${cwd}/`);
34247 var packageInformation = pnpApi.getPackageInformation(packageLocator);
34248
34249 for (var _iterator4 = packageInformation.packageDependencies.entries(), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
34250 var _ref9;
34251
34252 if (_isArray4) {
34253 if (_i4 >= _iterator4.length) break;
34254 _ref9 = _iterator4[_i4++];
34255 } else {
34256 _i4 = _iterator4.next();
34257 if (_i4.done) break;
34258 _ref9 = _i4.value;
34259 }
34260
34261 var _ref8 = _ref9;
34262 var name = _ref8[0];
34263 var reference = _ref8[1];
34264
34265 var dependencyInformation = pnpApi.getPackageInformation({ name, reference });
34266
34267 if (!dependencyInformation || !dependencyInformation.packageLocation) {
34268 continue;
34269 }
34270
34271 var binFolder = `${dependencyInformation.packageLocation}/.bin`;
34272 if (yield (_fs || _load_fs()).exists(binFolder)) {
34273 pathParts.unshift(binFolder);
34274 }
34275 }
34276
34277 // Note that NODE_OPTIONS doesn't support any style of quoting its arguments at the moment
34278 // For this reason, it won't work if the user has a space inside its $PATH
34279 env.NODE_OPTIONS = env.NODE_OPTIONS || '';
34280 env.NODE_OPTIONS = `--require ${pnpFile} ${env.NODE_OPTIONS}`;
34281 }
34282
34283 pathParts.unshift((yield getWrappersFolder(config)));
34284
34285 // join path back together
34286 env[(_constants || _load_constants()).ENV_PATH_KEY] = pathParts.join(path.delimiter);
34287
34288 return env;
34289 });
34290
34291 return function makeEnv(_x2, _x3, _x4) {
34292 return _ref2.apply(this, arguments);
34293 };
34294}();
34295
34296var executeLifecycleScript = exports.executeLifecycleScript = function () {
34297 var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref11) {
34298 var stage = _ref11.stage,
34299 config = _ref11.config,
34300 cwd = _ref11.cwd,
34301 cmd = _ref11.cmd,
34302 isInteractive = _ref11.isInteractive,
34303 onProgress = _ref11.onProgress,
34304 customShell = _ref11.customShell;
34305
34306 var env = yield makeEnv(stage, cwd, config);
34307
34308 yield checkForGypIfNeeded(config, cmd, env[(_constants || _load_constants()).ENV_PATH_KEY].split(path.delimiter));
34309
34310 if (process.platform === 'win32' && (!customShell || customShell === 'cmd')) {
34311 // handle windows run scripts starting with a relative path
34312 cmd = (0, (_fixCmdWinSlashes || _load_fixCmdWinSlashes()).fixCmdWinSlashes)(cmd);
34313 }
34314
34315 // By default (non-interactive), pipe everything to the terminal and run child process detached
34316 // as long as it's not Windows (since windows does not have /dev/tty)
34317 var stdio = ['ignore', 'pipe', 'pipe'];
34318 var detached = process.platform !== 'win32';
34319
34320 if (isInteractive) {
34321 stdio = 'inherit';
34322 detached = false;
34323 }
34324
34325 var shell = customShell || true;
34326 var stdout = yield (_child || _load_child()).spawn(cmd, [], { cwd, env, stdio, detached, shell }, onProgress);
34327
34328 return { cwd, command: cmd, stdout };
34329 });
34330
34331 return function executeLifecycleScript(_x5) {
34332 return _ref10.apply(this, arguments);
34333 };
34334}();
34335
34336var _checkForGyp = function () {
34337 var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, paths) {
34338 var reporter = config.reporter;
34339
34340 // Check every directory in the PATH
34341
34342 var allChecks = yield (_promise || _load_promise()).default.all(paths.map(function (dir) {
34343 return (_fs || _load_fs()).exists(path.join(dir, 'node-gyp'));
34344 }));
34345 if (allChecks.some(Boolean)) {
34346 // node-gyp is available somewhere
34347 return;
34348 }
34349
34350 reporter.info(reporter.lang('packageRequiresNodeGyp'));
34351
34352 try {
34353 yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', 'node-gyp']);
34354 } catch (e) {
34355 throw new (_errors || _load_errors()).MessageError(reporter.lang('nodeGypAutoInstallFailed', e.message));
34356 }
34357 });
34358
34359 return function _checkForGyp(_x6, _x7) {
34360 return _ref12.apply(this, arguments);
34361 };
34362}();
34363
34364var execFromManifest = exports.execFromManifest = function () {
34365 var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, commandName, cwd) {
34366 var pkg = yield config.maybeReadManifest(cwd);
34367 if (!pkg || !pkg.scripts) {
34368 return;
34369 }
34370
34371 var cmd = pkg.scripts[commandName];
34372 if (cmd) {
34373 yield execCommand({ stage: commandName, config, cmd, cwd, isInteractive: true });
34374 }
34375 });
34376
34377 return function execFromManifest(_x8, _x9, _x10) {
34378 return _ref13.apply(this, arguments);
34379 };
34380}();
34381
34382var execCommand = exports.execCommand = function () {
34383 var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref15) {
34384 var stage = _ref15.stage,
34385 config = _ref15.config,
34386 cmd = _ref15.cmd,
34387 cwd = _ref15.cwd,
34388 isInteractive = _ref15.isInteractive,
34389 customShell = _ref15.customShell;
34390 var reporter = config.reporter;
34391
34392 try {
34393 reporter.command(cmd);
34394 yield executeLifecycleScript({ stage, config, cwd, cmd, isInteractive, customShell });
34395 return (_promise || _load_promise()).default.resolve();
34396 } catch (err) {
34397 if (err instanceof (_errors || _load_errors()).ProcessTermError) {
34398 var formattedError = new (_errors || _load_errors()).ProcessTermError(err.EXIT_SIGNAL ? reporter.lang('commandFailedWithSignal', err.EXIT_SIGNAL) : reporter.lang('commandFailedWithCode', err.EXIT_CODE));
34399 formattedError.EXIT_CODE = err.EXIT_CODE;
34400 formattedError.EXIT_SIGNAL = err.EXIT_SIGNAL;
34401 throw formattedError;
34402 } else {
34403 throw err;
34404 }
34405 }
34406 });
34407
34408 return function execCommand(_x11) {
34409 return _ref14.apply(this, arguments);
34410 };
34411}();
34412
34413var _errors;
34414
34415function _load_errors() {
34416 return _errors = __webpack_require__(6);
34417}
34418
34419var _constants;
34420
34421function _load_constants() {
34422 return _constants = _interopRequireWildcard(__webpack_require__(13));
34423}
34424
34425var _child;
34426
34427function _load_child() {
34428 return _child = _interopRequireWildcard(__webpack_require__(57));
34429}
34430
34431var _fs;
34432
34433function _load_fs() {
34434 return _fs = _interopRequireWildcard(__webpack_require__(8));
34435}
34436
34437var _dynamicRequire;
34438
34439function _load_dynamicRequire() {
34440 return _dynamicRequire = __webpack_require__(308);
34441}
34442
34443var _portableScript;
34444
34445function _load_portableScript() {
34446 return _portableScript = __webpack_require__(546);
34447}
34448
34449var _fixCmdWinSlashes;
34450
34451function _load_fixCmdWinSlashes() {
34452 return _fixCmdWinSlashes = __webpack_require__(534);
34453}
34454
34455var _global;
34456
34457function _load_global() {
34458 return _global = __webpack_require__(115);
34459}
34460
34461function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
34462
34463function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
34464
34465var path = __webpack_require__(1);
34466
34467var IGNORE_MANIFEST_KEYS = exports.IGNORE_MANIFEST_KEYS = new (_set || _load_set()).default(['readme', 'notice', 'licenseText', 'activationEvents', 'contributes']);
34468
34469// We treat these configs as internal, thus not expose them to process.env.
34470// This helps us avoid some gyp issues when building native modules.
34471// See https://github.com/yarnpkg/yarn/issues/2286.
34472var IGNORE_CONFIG_KEYS = ['lastUpdateCheck'];
34473
34474var wrappersFolder = null;
34475
34476var INVALID_CHAR_REGEX = /\W/g;
34477
34478exports.default = executeLifecycleScript;
34479
34480
34481var checkGypPromise = null;
34482/**
34483 * Special case: Some packages depend on node-gyp, but don't specify this in
34484 * their package.json dependencies. They assume that node-gyp is available
34485 * globally. We need to detect this case and show an error message.
34486 */
34487function checkForGypIfNeeded(config, cmd, paths) {
34488 if (cmd.substr(0, cmd.indexOf(' ')) !== 'node-gyp') {
34489 return (_promise || _load_promise()).default.resolve();
34490 }
34491
34492 // Ensure this only runs once, rather than multiple times in parallel.
34493 if (!checkGypPromise) {
34494 checkGypPromise = _checkForGyp(config, paths);
34495 }
34496 return checkGypPromise;
34497}
34498
34499/***/ }),
34500/* 101 */
34501/***/ (function(module, exports, __webpack_require__) {
34502
34503"use strict";
34504
34505
34506Object.defineProperty(exports, "__esModule", {
34507 value: true
34508});
34509exports.home = undefined;
34510
34511var _rootUser;
34512
34513function _load_rootUser() {
34514 return _rootUser = _interopRequireDefault(__webpack_require__(548));
34515}
34516
34517function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
34518
34519var path = __webpack_require__(1);
34520
34521var home = exports.home = __webpack_require__(72).homedir();
34522
34523var userHomeDir = (_rootUser || _load_rootUser()).default ? path.resolve('/usr/local/share') : home;
34524
34525exports.default = userHomeDir;
34526
34527/***/ }),
34528/* 102 */
34529/***/ (function(module, exports, __webpack_require__) {
34530
34531// 19.1.2.14 / 15.2.3.14 Object.keys(O)
34532var $keys = __webpack_require__(338);
34533var enumBugKeys = __webpack_require__(217);
34534
34535module.exports = Object.keys || function keys(O) {
34536 return $keys(O, enumBugKeys);
34537};
34538
34539
34540/***/ }),
34541/* 103 */
34542/***/ (function(module, exports, __webpack_require__) {
34543
34544// 7.1.13 ToObject(argument)
34545var defined = __webpack_require__(215);
34546module.exports = function (it) {
34547 return Object(defined(it));
34548};
34549
34550
34551/***/ }),
34552/* 104 */
34553/***/ (function(module, exports, __webpack_require__) {
34554
34555"use strict";
34556
34557var $at = __webpack_require__(621)(true);
34558
34559// 21.1.3.27 String.prototype[@@iterator]()
34560__webpack_require__(219)(String, 'String', function (iterated) {
34561 this._t = String(iterated); // target
34562 this._i = 0; // next index
34563// 21.1.5.2.1 %StringIteratorPrototype%.next()
34564}, function () {
34565 var O = this._t;
34566 var index = this._i;
34567 var point;
34568 if (index >= O.length) return { value: undefined, done: true };
34569 point = $at(O, index);
34570 this._i += point.length;
34571 return { value: point, done: false };
34572});
34573
34574
34575/***/ }),
34576/* 105 */
34577/***/ (function(module, exports) {
34578
34579// Copyright Joyent, Inc. and other Node contributors.
34580//
34581// Permission is hereby granted, free of charge, to any person obtaining a
34582// copy of this software and associated documentation files (the
34583// "Software"), to deal in the Software without restriction, including
34584// without limitation the rights to use, copy, modify, merge, publish,
34585// distribute, sublicense, and/or sell copies of the Software, and to permit
34586// persons to whom the Software is furnished to do so, subject to the
34587// following conditions:
34588//
34589// The above copyright notice and this permission notice shall be included
34590// in all copies or substantial portions of the Software.
34591//
34592// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
34593// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
34594// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
34595// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
34596// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
34597// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
34598// USE OR OTHER DEALINGS IN THE SOFTWARE.
34599
34600// NOTE: These type checking functions intentionally don't use `instanceof`
34601// because it is fragile and can be easily faked with `Object.create()`.
34602
34603function isArray(arg) {
34604 if (Array.isArray) {
34605 return Array.isArray(arg);
34606 }
34607 return objectToString(arg) === '[object Array]';
34608}
34609exports.isArray = isArray;
34610
34611function isBoolean(arg) {
34612 return typeof arg === 'boolean';
34613}
34614exports.isBoolean = isBoolean;
34615
34616function isNull(arg) {
34617 return arg === null;
34618}
34619exports.isNull = isNull;
34620
34621function isNullOrUndefined(arg) {
34622 return arg == null;
34623}
34624exports.isNullOrUndefined = isNullOrUndefined;
34625
34626function isNumber(arg) {
34627 return typeof arg === 'number';
34628}
34629exports.isNumber = isNumber;
34630
34631function isString(arg) {
34632 return typeof arg === 'string';
34633}
34634exports.isString = isString;
34635
34636function isSymbol(arg) {
34637 return typeof arg === 'symbol';
34638}
34639exports.isSymbol = isSymbol;
34640
34641function isUndefined(arg) {
34642 return arg === void 0;
34643}
34644exports.isUndefined = isUndefined;
34645
34646function isRegExp(re) {
34647 return objectToString(re) === '[object RegExp]';
34648}
34649exports.isRegExp = isRegExp;
34650
34651function isObject(arg) {
34652 return typeof arg === 'object' && arg !== null;
34653}
34654exports.isObject = isObject;
34655
34656function isDate(d) {
34657 return objectToString(d) === '[object Date]';
34658}
34659exports.isDate = isDate;
34660
34661function isError(e) {
34662 return (objectToString(e) === '[object Error]' || e instanceof Error);
34663}
34664exports.isError = isError;
34665
34666function isFunction(arg) {
34667 return typeof arg === 'function';
34668}
34669exports.isFunction = isFunction;
34670
34671function isPrimitive(arg) {
34672 return arg === null ||
34673 typeof arg === 'boolean' ||
34674 typeof arg === 'number' ||
34675 typeof arg === 'string' ||
34676 typeof arg === 'symbol' || // ES6 symbol
34677 typeof arg === 'undefined';
34678}
34679exports.isPrimitive = isPrimitive;
34680
34681exports.isBuffer = Buffer.isBuffer;
34682
34683function objectToString(o) {
34684 return Object.prototype.toString.call(o);
34685}
34686
34687
34688/***/ }),
34689/* 106 */
34690/***/ (function(module, exports, __webpack_require__) {
34691
34692"use strict";
34693
34694
34695
34696module.exports = {
34697 copy: copy,
34698 checkDataType: checkDataType,
34699 checkDataTypes: checkDataTypes,
34700 coerceToTypes: coerceToTypes,
34701 toHash: toHash,
34702 getProperty: getProperty,
34703 escapeQuotes: escapeQuotes,
34704 equal: __webpack_require__(237),
34705 ucs2length: __webpack_require__(712),
34706 varOccurences: varOccurences,
34707 varReplace: varReplace,
34708 cleanUpCode: cleanUpCode,
34709 finalCleanUpCode: finalCleanUpCode,
34710 schemaHasRules: schemaHasRules,
34711 schemaHasRulesExcept: schemaHasRulesExcept,
34712 toQuotedString: toQuotedString,
34713 getPathExpr: getPathExpr,
34714 getPath: getPath,
34715 getData: getData,
34716 unescapeFragment: unescapeFragment,
34717 unescapeJsonPointer: unescapeJsonPointer,
34718 escapeFragment: escapeFragment,
34719 escapeJsonPointer: escapeJsonPointer
34720};
34721
34722
34723function copy(o, to) {
34724 to = to || {};
34725 for (var key in o) to[key] = o[key];
34726 return to;
34727}
34728
34729
34730function checkDataType(dataType, data, negate) {
34731 var EQUAL = negate ? ' !== ' : ' === '
34732 , AND = negate ? ' || ' : ' && '
34733 , OK = negate ? '!' : ''
34734 , NOT = negate ? '' : '!';
34735 switch (dataType) {
34736 case 'null': return data + EQUAL + 'null';
34737 case 'array': return OK + 'Array.isArray(' + data + ')';
34738 case 'object': return '(' + OK + data + AND +
34739 'typeof ' + data + EQUAL + '"object"' + AND +
34740 NOT + 'Array.isArray(' + data + '))';
34741 case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND +
34742 NOT + '(' + data + ' % 1)' +
34743 AND + data + EQUAL + data + ')';
34744 default: return 'typeof ' + data + EQUAL + '"' + dataType + '"';
34745 }
34746}
34747
34748
34749function checkDataTypes(dataTypes, data) {
34750 switch (dataTypes.length) {
34751 case 1: return checkDataType(dataTypes[0], data, true);
34752 default:
34753 var code = '';
34754 var types = toHash(dataTypes);
34755 if (types.array && types.object) {
34756 code = types.null ? '(': '(!' + data + ' || ';
34757 code += 'typeof ' + data + ' !== "object")';
34758 delete types.null;
34759 delete types.array;
34760 delete types.object;
34761 }
34762 if (types.number) delete types.integer;
34763 for (var t in types)
34764 code += (code ? ' && ' : '' ) + checkDataType(t, data, true);
34765
34766 return code;
34767 }
34768}
34769
34770
34771var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);
34772function coerceToTypes(optionCoerceTypes, dataTypes) {
34773 if (Array.isArray(dataTypes)) {
34774 var types = [];
34775 for (var i=0; i<dataTypes.length; i++) {
34776 var t = dataTypes[i];
34777 if (COERCE_TO_TYPES[t]) types[types.length] = t;
34778 else if (optionCoerceTypes === 'array' && t === 'array') types[types.length] = t;
34779 }
34780 if (types.length) return types;
34781 } else if (COERCE_TO_TYPES[dataTypes]) {
34782 return [dataTypes];
34783 } else if (optionCoerceTypes === 'array' && dataTypes === 'array') {
34784 return ['array'];
34785 }
34786}
34787
34788
34789function toHash(arr) {
34790 var hash = {};
34791 for (var i=0; i<arr.length; i++) hash[arr[i]] = true;
34792 return hash;
34793}
34794
34795
34796var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
34797var SINGLE_QUOTE = /'|\\/g;
34798function getProperty(key) {
34799 return typeof key == 'number'
34800 ? '[' + key + ']'
34801 : IDENTIFIER.test(key)
34802 ? '.' + key
34803 : "['" + escapeQuotes(key) + "']";
34804}
34805
34806
34807function escapeQuotes(str) {
34808 return str.replace(SINGLE_QUOTE, '\\$&')
34809 .replace(/\n/g, '\\n')
34810 .replace(/\r/g, '\\r')
34811 .replace(/\f/g, '\\f')
34812 .replace(/\t/g, '\\t');
34813}
34814
34815
34816function varOccurences(str, dataVar) {
34817 dataVar += '[^0-9]';
34818 var matches = str.match(new RegExp(dataVar, 'g'));
34819 return matches ? matches.length : 0;
34820}
34821
34822
34823function varReplace(str, dataVar, expr) {
34824 dataVar += '([^0-9])';
34825 expr = expr.replace(/\$/g, '$$$$');
34826 return str.replace(new RegExp(dataVar, 'g'), expr + '$1');
34827}
34828
34829
34830var EMPTY_ELSE = /else\s*{\s*}/g
34831 , EMPTY_IF_NO_ELSE = /if\s*\([^)]+\)\s*\{\s*\}(?!\s*else)/g
34832 , EMPTY_IF_WITH_ELSE = /if\s*\(([^)]+)\)\s*\{\s*\}\s*else(?!\s*if)/g;
34833function cleanUpCode(out) {
34834 return out.replace(EMPTY_ELSE, '')
34835 .replace(EMPTY_IF_NO_ELSE, '')
34836 .replace(EMPTY_IF_WITH_ELSE, 'if (!($1))');
34837}
34838
34839
34840var ERRORS_REGEXP = /[^v.]errors/g
34841 , REMOVE_ERRORS = /var errors = 0;|var vErrors = null;|validate.errors = vErrors;/g
34842 , REMOVE_ERRORS_ASYNC = /var errors = 0;|var vErrors = null;/g
34843 , RETURN_VALID = 'return errors === 0;'
34844 , RETURN_TRUE = 'validate.errors = null; return true;'
34845 , RETURN_ASYNC = /if \(errors === 0\) return data;\s*else throw new ValidationError\(vErrors\);/
34846 , RETURN_DATA_ASYNC = 'return data;'
34847 , ROOTDATA_REGEXP = /[^A-Za-z_$]rootData[^A-Za-z0-9_$]/g
34848 , REMOVE_ROOTDATA = /if \(rootData === undefined\) rootData = data;/;
34849
34850function finalCleanUpCode(out, async) {
34851 var matches = out.match(ERRORS_REGEXP);
34852 if (matches && matches.length == 2) {
34853 out = async
34854 ? out.replace(REMOVE_ERRORS_ASYNC, '')
34855 .replace(RETURN_ASYNC, RETURN_DATA_ASYNC)
34856 : out.replace(REMOVE_ERRORS, '')
34857 .replace(RETURN_VALID, RETURN_TRUE);
34858 }
34859
34860 matches = out.match(ROOTDATA_REGEXP);
34861 if (!matches || matches.length !== 3) return out;
34862 return out.replace(REMOVE_ROOTDATA, '');
34863}
34864
34865
34866function schemaHasRules(schema, rules) {
34867 if (typeof schema == 'boolean') return !schema;
34868 for (var key in schema) if (rules[key]) return true;
34869}
34870
34871
34872function schemaHasRulesExcept(schema, rules, exceptKeyword) {
34873 if (typeof schema == 'boolean') return !schema && exceptKeyword != 'not';
34874 for (var key in schema) if (key != exceptKeyword && rules[key]) return true;
34875}
34876
34877
34878function toQuotedString(str) {
34879 return '\'' + escapeQuotes(str) + '\'';
34880}
34881
34882
34883function getPathExpr(currentPath, expr, jsonPointers, isNumber) {
34884 var path = jsonPointers // false by default
34885 ? '\'/\' + ' + expr + (isNumber ? '' : '.replace(/~/g, \'~0\').replace(/\\//g, \'~1\')')
34886 : (isNumber ? '\'[\' + ' + expr + ' + \']\'' : '\'[\\\'\' + ' + expr + ' + \'\\\']\'');
34887 return joinPaths(currentPath, path);
34888}
34889
34890
34891function getPath(currentPath, prop, jsonPointers) {
34892 var path = jsonPointers // false by default
34893 ? toQuotedString('/' + escapeJsonPointer(prop))
34894 : toQuotedString(getProperty(prop));
34895 return joinPaths(currentPath, path);
34896}
34897
34898
34899var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
34900var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
34901function getData($data, lvl, paths) {
34902 var up, jsonPointer, data, matches;
34903 if ($data === '') return 'rootData';
34904 if ($data[0] == '/') {
34905 if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data);
34906 jsonPointer = $data;
34907 data = 'rootData';
34908 } else {
34909 matches = $data.match(RELATIVE_JSON_POINTER);
34910 if (!matches) throw new Error('Invalid JSON-pointer: ' + $data);
34911 up = +matches[1];
34912 jsonPointer = matches[2];
34913 if (jsonPointer == '#') {
34914 if (up >= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl);
34915 return paths[lvl - up];
34916 }
34917
34918 if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl);
34919 data = 'data' + ((lvl - up) || '');
34920 if (!jsonPointer) return data;
34921 }
34922
34923 var expr = data;
34924 var segments = jsonPointer.split('/');
34925 for (var i=0; i<segments.length; i++) {
34926 var segment = segments[i];
34927 if (segment) {
34928 data += getProperty(unescapeJsonPointer(segment));
34929 expr += ' && ' + data;
34930 }
34931 }
34932 return expr;
34933}
34934
34935
34936function joinPaths (a, b) {
34937 if (a == '""') return b;
34938 return (a + ' + ' + b).replace(/' \+ '/g, '');
34939}
34940
34941
34942function unescapeFragment(str) {
34943 return unescapeJsonPointer(decodeURIComponent(str));
34944}
34945
34946
34947function escapeFragment(str) {
34948 return encodeURIComponent(escapeJsonPointer(str));
34949}
34950
34951
34952function escapeJsonPointer(str) {
34953 return str.replace(/~/g, '~0').replace(/\//g, '~1');
34954}
34955
34956
34957function unescapeJsonPointer(str) {
34958 return str.replace(/~1/g, '/').replace(/~0/g, '~');
34959}
34960
34961
34962/***/ }),
34963/* 107 */
34964/***/ (function(module, exports, __webpack_require__) {
34965
34966"use strict";
34967
34968
34969
34970function isNothing(subject) {
34971 return (typeof subject === 'undefined') || (subject === null);
34972}
34973
34974
34975function isObject(subject) {
34976 return (typeof subject === 'object') && (subject !== null);
34977}
34978
34979
34980function toArray(sequence) {
34981 if (Array.isArray(sequence)) return sequence;
34982 else if (isNothing(sequence)) return [];
34983
34984 return [ sequence ];
34985}
34986
34987
34988function extend(target, source) {
34989 var index, length, key, sourceKeys;
34990
34991 if (source) {
34992 sourceKeys = Object.keys(source);
34993
34994 for (index = 0, length = sourceKeys.length; index < length; index += 1) {
34995 key = sourceKeys[index];
34996 target[key] = source[key];
34997 }
34998 }
34999
35000 return target;
35001}
35002
35003
35004function repeat(string, count) {
35005 var result = '', cycle;
35006
35007 for (cycle = 0; cycle < count; cycle += 1) {
35008 result += string;
35009 }
35010
35011 return result;
35012}
35013
35014
35015function isNegativeZero(number) {
35016 return (number === 0) && (Number.NEGATIVE_INFINITY === 1 / number);
35017}
35018
35019
35020module.exports.isNothing = isNothing;
35021module.exports.isObject = isObject;
35022module.exports.toArray = toArray;
35023module.exports.repeat = repeat;
35024module.exports.isNegativeZero = isNegativeZero;
35025module.exports.extend = extend;
35026
35027
35028/***/ }),
35029/* 108 */
35030/***/ (function(module, exports, __webpack_require__) {
35031
35032"use strict";
35033
35034
35035/*eslint-disable max-len*/
35036
35037var common = __webpack_require__(107);
35038var YAMLException = __webpack_require__(131);
35039var Type = __webpack_require__(30);
35040
35041
35042function compileList(schema, name, result) {
35043 var exclude = [];
35044
35045 schema.include.forEach(function (includedSchema) {
35046 result = compileList(includedSchema, name, result);
35047 });
35048
35049 schema[name].forEach(function (currentType) {
35050 result.forEach(function (previousType, previousIndex) {
35051 if (previousType.tag === currentType.tag && previousType.kind === currentType.kind) {
35052 exclude.push(previousIndex);
35053 }
35054 });
35055
35056 result.push(currentType);
35057 });
35058
35059 return result.filter(function (type, index) {
35060 return exclude.indexOf(index) === -1;
35061 });
35062}
35063
35064
35065function compileMap(/* lists... */) {
35066 var result = {
35067 scalar: {},
35068 sequence: {},
35069 mapping: {},
35070 fallback: {}
35071 }, index, length;
35072
35073 function collectType(type) {
35074 result[type.kind][type.tag] = result['fallback'][type.tag] = type;
35075 }
35076
35077 for (index = 0, length = arguments.length; index < length; index += 1) {
35078 arguments[index].forEach(collectType);
35079 }
35080 return result;
35081}
35082
35083
35084function Schema(definition) {
35085 this.include = definition.include || [];
35086 this.implicit = definition.implicit || [];
35087 this.explicit = definition.explicit || [];
35088
35089 this.implicit.forEach(function (type) {
35090 if (type.loadKind && type.loadKind !== 'scalar') {
35091 throw new YAMLException('There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.');
35092 }
35093 });
35094
35095 this.compiledImplicit = compileList(this, 'implicit', []);
35096 this.compiledExplicit = compileList(this, 'explicit', []);
35097 this.compiledTypeMap = compileMap(this.compiledImplicit, this.compiledExplicit);
35098}
35099
35100
35101Schema.DEFAULT = null;
35102
35103
35104Schema.create = function createSchema() {
35105 var schemas, types;
35106
35107 switch (arguments.length) {
35108 case 1:
35109 schemas = Schema.DEFAULT;
35110 types = arguments[0];
35111 break;
35112
35113 case 2:
35114 schemas = arguments[0];
35115 types = arguments[1];
35116 break;
35117
35118 default:
35119 throw new YAMLException('Wrong number of arguments for Schema.create function');
35120 }
35121
35122 schemas = common.toArray(schemas);
35123 types = common.toArray(types);
35124
35125 if (!schemas.every(function (schema) { return schema instanceof Schema; })) {
35126 throw new YAMLException('Specified list of super schemas (or a single Schema object) contains a non-Schema object.');
35127 }
35128
35129 if (!types.every(function (type) { return type instanceof Type; })) {
35130 throw new YAMLException('Specified list of YAML types (or a single Type object) contains a non-Type object.');
35131 }
35132
35133 return new Schema({
35134 include: schemas,
35135 explicit: types
35136 });
35137};
35138
35139
35140module.exports = Schema;
35141
35142
35143/***/ }),
35144/* 109 */
35145/***/ (function(module, exports, __webpack_require__) {
35146
35147"use strict";
35148/*!
35149 * micromatch <https://github.com/jonschlinkert/micromatch>
35150 *
35151 * Copyright (c) 2014-2015, Jon Schlinkert.
35152 * Licensed under the MIT License.
35153 */
35154
35155
35156
35157var expand = __webpack_require__(824);
35158var utils = __webpack_require__(240);
35159
35160/**
35161 * The main function. Pass an array of filepaths,
35162 * and a string or array of glob patterns
35163 *
35164 * @param {Array|String} `files`
35165 * @param {Array|String} `patterns`
35166 * @param {Object} `opts`
35167 * @return {Array} Array of matches
35168 */
35169
35170function micromatch(files, patterns, opts) {
35171 if (!files || !patterns) return [];
35172 opts = opts || {};
35173
35174 if (typeof opts.cache === 'undefined') {
35175 opts.cache = true;
35176 }
35177
35178 if (!Array.isArray(patterns)) {
35179 return match(files, patterns, opts);
35180 }
35181
35182 var len = patterns.length, i = 0;
35183 var omit = [], keep = [];
35184
35185 while (len--) {
35186 var glob = patterns[i++];
35187 if (typeof glob === 'string' && glob.charCodeAt(0) === 33 /* ! */) {
35188 omit.push.apply(omit, match(files, glob.slice(1), opts));
35189 } else {
35190 keep.push.apply(keep, match(files, glob, opts));
35191 }
35192 }
35193 return utils.diff(keep, omit);
35194}
35195
35196/**
35197 * Return an array of files that match the given glob pattern.
35198 *
35199 * This function is called by the main `micromatch` function If you only
35200 * need to pass a single pattern you might get very minor speed improvements
35201 * using this function.
35202 *
35203 * @param {Array} `files`
35204 * @param {String} `pattern`
35205 * @param {Object} `options`
35206 * @return {Array}
35207 */
35208
35209function match(files, pattern, opts) {
35210 if (utils.typeOf(files) !== 'string' && !Array.isArray(files)) {
35211 throw new Error(msg('match', 'files', 'a string or array'));
35212 }
35213
35214 files = utils.arrayify(files);
35215 opts = opts || {};
35216
35217 var negate = opts.negate || false;
35218 var orig = pattern;
35219
35220 if (typeof pattern === 'string') {
35221 negate = pattern.charAt(0) === '!';
35222 if (negate) {
35223 pattern = pattern.slice(1);
35224 }
35225
35226 // we need to remove the character regardless,
35227 // so the above logic is still needed
35228 if (opts.nonegate === true) {
35229 negate = false;
35230 }
35231 }
35232
35233 var _isMatch = matcher(pattern, opts);
35234 var len = files.length, i = 0;
35235 var res = [];
35236
35237 while (i < len) {
35238 var file = files[i++];
35239 var fp = utils.unixify(file, opts);
35240
35241 if (!_isMatch(fp)) { continue; }
35242 res.push(fp);
35243 }
35244
35245 if (res.length === 0) {
35246 if (opts.failglob === true) {
35247 throw new Error('micromatch.match() found no matches for: "' + orig + '".');
35248 }
35249
35250 if (opts.nonull || opts.nullglob) {
35251 res.push(utils.unescapeGlob(orig));
35252 }
35253 }
35254
35255 // if `negate` was defined, diff negated files
35256 if (negate) { res = utils.diff(files, res); }
35257
35258 // if `ignore` was defined, diff ignored filed
35259 if (opts.ignore && opts.ignore.length) {
35260 pattern = opts.ignore;
35261 opts = utils.omit(opts, ['ignore']);
35262 res = utils.diff(res, micromatch(res, pattern, opts));
35263 }
35264
35265 if (opts.nodupes) {
35266 return utils.unique(res);
35267 }
35268 return res;
35269}
35270
35271/**
35272 * Returns a function that takes a glob pattern or array of glob patterns
35273 * to be used with `Array#filter()`. (Internally this function generates
35274 * the matching function using the [matcher] method).
35275 *
35276 * ```js
35277 * var fn = mm.filter('[a-c]');
35278 * ['a', 'b', 'c', 'd', 'e'].filter(fn);
35279 * //=> ['a', 'b', 'c']
35280 * ```
35281 * @param {String|Array} `patterns` Can be a glob or array of globs.
35282 * @param {Options} `opts` Options to pass to the [matcher] method.
35283 * @return {Function} Filter function to be passed to `Array#filter()`.
35284 */
35285
35286function filter(patterns, opts) {
35287 if (!Array.isArray(patterns) && typeof patterns !== 'string') {
35288 throw new TypeError(msg('filter', 'patterns', 'a string or array'));
35289 }
35290
35291 patterns = utils.arrayify(patterns);
35292 var len = patterns.length, i = 0;
35293 var patternMatchers = Array(len);
35294 while (i < len) {
35295 patternMatchers[i] = matcher(patterns[i++], opts);
35296 }
35297
35298 return function(fp) {
35299 if (fp == null) return [];
35300 var len = patternMatchers.length, i = 0;
35301 var res = true;
35302
35303 fp = utils.unixify(fp, opts);
35304 while (i < len) {
35305 var fn = patternMatchers[i++];
35306 if (!fn(fp)) {
35307 res = false;
35308 break;
35309 }
35310 }
35311 return res;
35312 };
35313}
35314
35315/**
35316 * Returns true if the filepath contains the given
35317 * pattern. Can also return a function for matching.
35318 *
35319 * ```js
35320 * isMatch('foo.md', '*.md', {});
35321 * //=> true
35322 *
35323 * isMatch('*.md', {})('foo.md')
35324 * //=> true
35325 * ```
35326 * @param {String} `fp`
35327 * @param {String} `pattern`
35328 * @param {Object} `opts`
35329 * @return {Boolean}
35330 */
35331
35332function isMatch(fp, pattern, opts) {
35333 if (typeof fp !== 'string') {
35334 throw new TypeError(msg('isMatch', 'filepath', 'a string'));
35335 }
35336
35337 fp = utils.unixify(fp, opts);
35338 if (utils.typeOf(pattern) === 'object') {
35339 return matcher(fp, pattern);
35340 }
35341 return matcher(pattern, opts)(fp);
35342}
35343
35344/**
35345 * Returns true if the filepath matches the
35346 * given pattern.
35347 */
35348
35349function contains(fp, pattern, opts) {
35350 if (typeof fp !== 'string') {
35351 throw new TypeError(msg('contains', 'pattern', 'a string'));
35352 }
35353
35354 opts = opts || {};
35355 opts.contains = (pattern !== '');
35356 fp = utils.unixify(fp, opts);
35357
35358 if (opts.contains && !utils.isGlob(pattern)) {
35359 return fp.indexOf(pattern) !== -1;
35360 }
35361 return matcher(pattern, opts)(fp);
35362}
35363
35364/**
35365 * Returns true if a file path matches any of the
35366 * given patterns.
35367 *
35368 * @param {String} `fp` The filepath to test.
35369 * @param {String|Array} `patterns` Glob patterns to use.
35370 * @param {Object} `opts` Options to pass to the `matcher()` function.
35371 * @return {String}
35372 */
35373
35374function any(fp, patterns, opts) {
35375 if (!Array.isArray(patterns) && typeof patterns !== 'string') {
35376 throw new TypeError(msg('any', 'patterns', 'a string or array'));
35377 }
35378
35379 patterns = utils.arrayify(patterns);
35380 var len = patterns.length;
35381
35382 fp = utils.unixify(fp, opts);
35383 while (len--) {
35384 var isMatch = matcher(patterns[len], opts);
35385 if (isMatch(fp)) {
35386 return true;
35387 }
35388 }
35389 return false;
35390}
35391
35392/**
35393 * Filter the keys of an object with the given `glob` pattern
35394 * and `options`
35395 *
35396 * @param {Object} `object`
35397 * @param {Pattern} `object`
35398 * @return {Array}
35399 */
35400
35401function matchKeys(obj, glob, options) {
35402 if (utils.typeOf(obj) !== 'object') {
35403 throw new TypeError(msg('matchKeys', 'first argument', 'an object'));
35404 }
35405
35406 var fn = matcher(glob, options);
35407 var res = {};
35408
35409 for (var key in obj) {
35410 if (obj.hasOwnProperty(key) && fn(key)) {
35411 res[key] = obj[key];
35412 }
35413 }
35414 return res;
35415}
35416
35417/**
35418 * Return a function for matching based on the
35419 * given `pattern` and `options`.
35420 *
35421 * @param {String} `pattern`
35422 * @param {Object} `options`
35423 * @return {Function}
35424 */
35425
35426function matcher(pattern, opts) {
35427 // pattern is a function
35428 if (typeof pattern === 'function') {
35429 return pattern;
35430 }
35431 // pattern is a regex
35432 if (pattern instanceof RegExp) {
35433 return function(fp) {
35434 return pattern.test(fp);
35435 };
35436 }
35437
35438 if (typeof pattern !== 'string') {
35439 throw new TypeError(msg('matcher', 'pattern', 'a string, regex, or function'));
35440 }
35441
35442 // strings, all the way down...
35443 pattern = utils.unixify(pattern, opts);
35444
35445 // pattern is a non-glob string
35446 if (!utils.isGlob(pattern)) {
35447 return utils.matchPath(pattern, opts);
35448 }
35449 // pattern is a glob string
35450 var re = makeRe(pattern, opts);
35451
35452 // `matchBase` is defined
35453 if (opts && opts.matchBase) {
35454 return utils.hasFilename(re, opts);
35455 }
35456 // `matchBase` is not defined
35457 return function(fp) {
35458 fp = utils.unixify(fp, opts);
35459 return re.test(fp);
35460 };
35461}
35462
35463/**
35464 * Create and cache a regular expression for matching
35465 * file paths.
35466 *
35467 * If the leading character in the `glob` is `!`, a negation
35468 * regex is returned.
35469 *
35470 * @param {String} `glob`
35471 * @param {Object} `options`
35472 * @return {RegExp}
35473 */
35474
35475function toRegex(glob, options) {
35476 // clone options to prevent mutating the original object
35477 var opts = Object.create(options || {});
35478 var flags = opts.flags || '';
35479 if (opts.nocase && flags.indexOf('i') === -1) {
35480 flags += 'i';
35481 }
35482
35483 var parsed = expand(glob, opts);
35484
35485 // pass in tokens to avoid parsing more than once
35486 opts.negated = opts.negated || parsed.negated;
35487 opts.negate = opts.negated;
35488 glob = wrapGlob(parsed.pattern, opts);
35489 var re;
35490
35491 try {
35492 re = new RegExp(glob, flags);
35493 return re;
35494 } catch (err) {
35495 err.reason = 'micromatch invalid regex: (' + re + ')';
35496 if (opts.strict) throw new SyntaxError(err);
35497 }
35498
35499 // we're only here if a bad pattern was used and the user
35500 // passed `options.silent`, so match nothing
35501 return /$^/;
35502}
35503
35504/**
35505 * Create the regex to do the matching. If the leading
35506 * character in the `glob` is `!` a negation regex is returned.
35507 *
35508 * @param {String} `glob`
35509 * @param {Boolean} `negate`
35510 */
35511
35512function wrapGlob(glob, opts) {
35513 var prefix = (opts && !opts.contains) ? '^' : '';
35514 var after = (opts && !opts.contains) ? '$' : '';
35515 glob = ('(?:' + glob + ')' + after);
35516 if (opts && opts.negate) {
35517 return prefix + ('(?!^' + glob + ').*$');
35518 }
35519 return prefix + glob;
35520}
35521
35522/**
35523 * Create and cache a regular expression for matching file paths.
35524 * If the leading character in the `glob` is `!`, a negation
35525 * regex is returned.
35526 *
35527 * @param {String} `glob`
35528 * @param {Object} `options`
35529 * @return {RegExp}
35530 */
35531
35532function makeRe(glob, opts) {
35533 if (utils.typeOf(glob) !== 'string') {
35534 throw new Error(msg('makeRe', 'glob', 'a string'));
35535 }
35536 return utils.cache(toRegex, glob, opts);
35537}
35538
35539/**
35540 * Make error messages consistent. Follows this format:
35541 *
35542 * ```js
35543 * msg(methodName, argNumber, nativeType);
35544 * // example:
35545 * msg('matchKeys', 'first', 'an object');
35546 * ```
35547 *
35548 * @param {String} `method`
35549 * @param {String} `num`
35550 * @param {String} `type`
35551 * @return {String}
35552 */
35553
35554function msg(method, what, type) {
35555 return 'micromatch.' + method + '(): ' + what + ' should be ' + type + '.';
35556}
35557
35558/**
35559 * Public methods
35560 */
35561
35562/* eslint no-multi-spaces: 0 */
35563micromatch.any = any;
35564micromatch.braces = micromatch.braceExpand = utils.braces;
35565micromatch.contains = contains;
35566micromatch.expand = expand;
35567micromatch.filter = filter;
35568micromatch.isMatch = isMatch;
35569micromatch.makeRe = makeRe;
35570micromatch.match = match;
35571micromatch.matcher = matcher;
35572micromatch.matchKeys = matchKeys;
35573
35574/**
35575 * Expose `micromatch`
35576 */
35577
35578module.exports = micromatch;
35579
35580
35581/***/ }),
35582/* 110 */
35583/***/ (function(module, exports, __webpack_require__) {
35584
35585"use strict";
35586// Copyright Joyent, Inc. and other Node contributors.
35587//
35588// Permission is hereby granted, free of charge, to any person obtaining a
35589// copy of this software and associated documentation files (the
35590// "Software"), to deal in the Software without restriction, including
35591// without limitation the rights to use, copy, modify, merge, publish,
35592// distribute, sublicense, and/or sell copies of the Software, and to permit
35593// persons to whom the Software is furnished to do so, subject to the
35594// following conditions:
35595//
35596// The above copyright notice and this permission notice shall be included
35597// in all copies or substantial portions of the Software.
35598//
35599// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
35600// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
35601// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
35602// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
35603// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
35604// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
35605// USE OR OTHER DEALINGS IN THE SOFTWARE.
35606
35607// a duplex stream is just a stream that is both readable and writable.
35608// Since JS doesn't have multiple prototypal inheritance, this class
35609// prototypally inherits from Readable, and then parasitically from
35610// Writable.
35611
35612
35613
35614/*<replacement>*/
35615
35616var pna = __webpack_require__(171);
35617/*</replacement>*/
35618
35619/*<replacement>*/
35620var objectKeys = Object.keys || function (obj) {
35621 var keys = [];
35622 for (var key in obj) {
35623 keys.push(key);
35624 }return keys;
35625};
35626/*</replacement>*/
35627
35628module.exports = Duplex;
35629
35630/*<replacement>*/
35631var util = __webpack_require__(105);
35632util.inherits = __webpack_require__(78);
35633/*</replacement>*/
35634
35635var Readable = __webpack_require__(376);
35636var Writable = __webpack_require__(378);
35637
35638util.inherits(Duplex, Readable);
35639
35640{
35641 // avoid scope creep, the keys array can then be collected
35642 var keys = objectKeys(Writable.prototype);
35643 for (var v = 0; v < keys.length; v++) {
35644 var method = keys[v];
35645 if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
35646 }
35647}
35648
35649function Duplex(options) {
35650 if (!(this instanceof Duplex)) return new Duplex(options);
35651
35652 Readable.call(this, options);
35653 Writable.call(this, options);
35654
35655 if (options && options.readable === false) this.readable = false;
35656
35657 if (options && options.writable === false) this.writable = false;
35658
35659 this.allowHalfOpen = true;
35660 if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
35661
35662 this.once('end', onend);
35663}
35664
35665Object.defineProperty(Duplex.prototype, 'writableHighWaterMark', {
35666 // making it explicit this property is not enumerable
35667 // because otherwise some prototype manipulation in
35668 // userland will fail
35669 enumerable: false,
35670 get: function () {
35671 return this._writableState.highWaterMark;
35672 }
35673});
35674
35675// the no-half-open enforcer
35676function onend() {
35677 // if we allow half-open state, or if the writable side ended,
35678 // then we're ok.
35679 if (this.allowHalfOpen || this._writableState.ended) return;
35680
35681 // no more data can be written.
35682 // But allow more writes to happen in this tick.
35683 pna.nextTick(onEndNT, this);
35684}
35685
35686function onEndNT(self) {
35687 self.end();
35688}
35689
35690Object.defineProperty(Duplex.prototype, 'destroyed', {
35691 get: function () {
35692 if (this._readableState === undefined || this._writableState === undefined) {
35693 return false;
35694 }
35695 return this._readableState.destroyed && this._writableState.destroyed;
35696 },
35697 set: function (value) {
35698 // we ignore the value if the stream
35699 // has not been initialized yet
35700 if (this._readableState === undefined || this._writableState === undefined) {
35701 return;
35702 }
35703
35704 // backward compatibility, the user is explicitly
35705 // managing destroyed
35706 this._readableState.destroyed = value;
35707 this._writableState.destroyed = value;
35708 }
35709});
35710
35711Duplex.prototype._destroy = function (err, cb) {
35712 this.push(null);
35713 this.end();
35714
35715 pna.nextTick(cb, err);
35716};
35717
35718/***/ }),
35719/* 111 */
35720/***/ (function(module, __webpack_exports__, __webpack_require__) {
35721
35722"use strict";
35723/* harmony export (immutable) */ __webpack_exports__["a"] = multicast;
35724/* unused harmony export MulticastOperator */
35725/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_ConnectableObservable__ = __webpack_require__(393);
35726/** PURE_IMPORTS_START _observable_ConnectableObservable PURE_IMPORTS_END */
35727
35728function multicast(subjectOrSubjectFactory, selector) {
35729 return function multicastOperatorFunction(source) {
35730 var subjectFactory;
35731 if (typeof subjectOrSubjectFactory === 'function') {
35732 subjectFactory = subjectOrSubjectFactory;
35733 }
35734 else {
35735 subjectFactory = function subjectFactory() {
35736 return subjectOrSubjectFactory;
35737 };
35738 }
35739 if (typeof selector === 'function') {
35740 return source.lift(new MulticastOperator(subjectFactory, selector));
35741 }
35742 var connectable = Object.create(source, __WEBPACK_IMPORTED_MODULE_0__observable_ConnectableObservable__["b" /* connectableObservableDescriptor */]);
35743 connectable.source = source;
35744 connectable.subjectFactory = subjectFactory;
35745 return connectable;
35746 };
35747}
35748var MulticastOperator = /*@__PURE__*/ (function () {
35749 function MulticastOperator(subjectFactory, selector) {
35750 this.subjectFactory = subjectFactory;
35751 this.selector = selector;
35752 }
35753 MulticastOperator.prototype.call = function (subscriber, source) {
35754 var selector = this.selector;
35755 var subject = this.subjectFactory();
35756 var subscription = selector(subject).subscribe(subscriber);
35757 subscription.add(source.subscribe(subject));
35758 return subscription;
35759 };
35760 return MulticastOperator;
35761}());
35762
35763//# sourceMappingURL=multicast.js.map
35764
35765
35766/***/ }),
35767/* 112 */
35768/***/ (function(module, __webpack_exports__, __webpack_require__) {
35769
35770"use strict";
35771/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return observable; });
35772/** PURE_IMPORTS_START PURE_IMPORTS_END */
35773var observable = typeof Symbol === 'function' && Symbol.observable || '@@observable';
35774//# sourceMappingURL=observable.js.map
35775
35776
35777/***/ }),
35778/* 113 */
35779/***/ (function(module, __webpack_exports__, __webpack_require__) {
35780
35781"use strict";
35782/* harmony export (immutable) */ __webpack_exports__["a"] = identity;
35783/** PURE_IMPORTS_START PURE_IMPORTS_END */
35784function identity(x) {
35785 return x;
35786}
35787//# sourceMappingURL=identity.js.map
35788
35789
35790/***/ }),
35791/* 114 */
35792/***/ (function(module, exports, __webpack_require__) {
35793
35794var v1 = __webpack_require__(1030);
35795var v4 = __webpack_require__(1031);
35796
35797var uuid = v4;
35798uuid.v1 = v1;
35799uuid.v4 = v4;
35800
35801module.exports = uuid;
35802
35803
35804/***/ }),
35805/* 115 */
35806/***/ (function(module, exports, __webpack_require__) {
35807
35808"use strict";
35809
35810
35811Object.defineProperty(exports, "__esModule", {
35812 value: true
35813});
35814exports.run = exports.getBinFolder = undefined;
35815
35816var _keys;
35817
35818function _load_keys() {
35819 return _keys = _interopRequireDefault(__webpack_require__(14));
35820}
35821
35822var _set;
35823
35824function _load_set() {
35825 return _set = _interopRequireDefault(__webpack_require__(16));
35826}
35827
35828var _asyncToGenerator2;
35829
35830function _load_asyncToGenerator() {
35831 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
35832}
35833
35834var _getIterator2;
35835
35836function _load_getIterator() {
35837 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
35838}
35839
35840var _promise;
35841
35842function _load_promise() {
35843 return _promise = _interopRequireDefault(__webpack_require__(7));
35844}
35845
35846var _classCallCheck2;
35847
35848function _load_classCallCheck() {
35849 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
35850}
35851
35852var _possibleConstructorReturn2;
35853
35854function _load_possibleConstructorReturn() {
35855 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
35856}
35857
35858var _inherits2;
35859
35860function _load_inherits() {
35861 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
35862}
35863
35864var updateCwd = function () {
35865 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
35866 yield (_fs || _load_fs()).mkdirp(config.globalFolder);
35867
35868 yield config.init({
35869 cwd: config.globalFolder,
35870 offline: config.offline,
35871 binLinks: true,
35872 globalFolder: config.globalFolder,
35873 cacheFolder: config._cacheRootFolder,
35874 linkFolder: config.linkFolder,
35875 enableDefaultRc: config.enableDefaultRc,
35876 extraneousYarnrcFiles: config.extraneousYarnrcFiles
35877 });
35878 });
35879
35880 return function updateCwd(_x) {
35881 return _ref2.apply(this, arguments);
35882 };
35883}();
35884
35885var getBins = function () {
35886 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
35887 // build up list of registry folders to search for binaries
35888 var dirs = [];
35889 for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index || _load_index()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
35890 var _ref4;
35891
35892 if (_isArray2) {
35893 if (_i2 >= _iterator2.length) break;
35894 _ref4 = _iterator2[_i2++];
35895 } else {
35896 _i2 = _iterator2.next();
35897 if (_i2.done) break;
35898 _ref4 = _i2.value;
35899 }
35900
35901 var registryName = _ref4;
35902
35903 var registry = config.registries[registryName];
35904 dirs.push(registry.loc);
35905 }
35906
35907 // build up list of binary files
35908 var paths = new (_set || _load_set()).default();
35909 for (var _iterator3 = dirs, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
35910 var _ref5;
35911
35912 if (_isArray3) {
35913 if (_i3 >= _iterator3.length) break;
35914 _ref5 = _iterator3[_i3++];
35915 } else {
35916 _i3 = _iterator3.next();
35917 if (_i3.done) break;
35918 _ref5 = _i3.value;
35919 }
35920
35921 var dir = _ref5;
35922
35923 var binDir = path.join(dir, '.bin');
35924 if (!(yield (_fs || _load_fs()).exists(binDir))) {
35925 continue;
35926 }
35927
35928 for (var _iterator4 = yield (_fs || _load_fs()).readdir(binDir), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
35929 var _ref6;
35930
35931 if (_isArray4) {
35932 if (_i4 >= _iterator4.length) break;
35933 _ref6 = _iterator4[_i4++];
35934 } else {
35935 _i4 = _iterator4.next();
35936 if (_i4.done) break;
35937 _ref6 = _i4.value;
35938 }
35939
35940 var name = _ref6;
35941
35942 paths.add(path.join(binDir, name));
35943 }
35944 }
35945 return paths;
35946 });
35947
35948 return function getBins(_x2) {
35949 return _ref3.apply(this, arguments);
35950 };
35951}();
35952
35953var getGlobalPrefix = function () {
35954 var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) {
35955 if (flags.prefix) {
35956 return flags.prefix;
35957 } else if (config.getOption('prefix', true)) {
35958 return String(config.getOption('prefix', true));
35959 } else if (process.env.PREFIX) {
35960 return process.env.PREFIX;
35961 }
35962
35963 var potentialPrefixFolders = [(_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX];
35964 if (process.platform === 'win32') {
35965 // %LOCALAPPDATA%\Yarn --> C:\Users\Alice\AppData\Local\Yarn
35966 if (process.env.LOCALAPPDATA) {
35967 potentialPrefixFolders.unshift(path.join(process.env.LOCALAPPDATA, 'Yarn'));
35968 }
35969 } else {
35970 potentialPrefixFolders.unshift((_constants || _load_constants()).POSIX_GLOBAL_PREFIX);
35971 }
35972
35973 var binFolders = potentialPrefixFolders.map(function (prefix) {
35974 return path.join(prefix, 'bin');
35975 });
35976 var prefixFolderQueryResult = yield (_fs || _load_fs()).getFirstSuitableFolder(binFolders);
35977 var prefix = prefixFolderQueryResult.folder && path.dirname(prefixFolderQueryResult.folder);
35978
35979 if (!prefix) {
35980 config.reporter.warn(config.reporter.lang('noGlobalFolder', prefixFolderQueryResult.skipped.map(function (item) {
35981 return path.dirname(item.folder);
35982 }).join(', ')));
35983
35984 return (_constants || _load_constants()).FALLBACK_GLOBAL_PREFIX;
35985 }
35986
35987 return prefix;
35988 });
35989
35990 return function getGlobalPrefix(_x3, _x4) {
35991 return _ref7.apply(this, arguments);
35992 };
35993}();
35994
35995var getBinFolder = exports.getBinFolder = function () {
35996 var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) {
35997 var prefix = yield getGlobalPrefix(config, flags);
35998 return path.resolve(prefix, 'bin');
35999 });
36000
36001 return function getBinFolder(_x5, _x6) {
36002 return _ref8.apply(this, arguments);
36003 };
36004}();
36005
36006var initUpdateBins = function () {
36007 var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags) {
36008 var beforeBins = yield getBins(config);
36009 var binFolder = yield getBinFolder(config, flags);
36010
36011 function throwPermError(err, dest) {
36012 if (err.code === 'EACCES') {
36013 throw new (_errors || _load_errors()).MessageError(reporter.lang('noPermission', dest));
36014 } else {
36015 throw err;
36016 }
36017 }
36018
36019 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
36020 try {
36021 yield (_fs || _load_fs()).mkdirp(binFolder);
36022 } catch (err) {
36023 throwPermError(err, binFolder);
36024 }
36025
36026 var afterBins = yield getBins(config);
36027
36028 // remove old bins
36029 for (var _iterator5 = beforeBins, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
36030 var _ref11;
36031
36032 if (_isArray5) {
36033 if (_i5 >= _iterator5.length) break;
36034 _ref11 = _iterator5[_i5++];
36035 } else {
36036 _i5 = _iterator5.next();
36037 if (_i5.done) break;
36038 _ref11 = _i5.value;
36039 }
36040
36041 var src = _ref11;
36042
36043 if (afterBins.has(src)) {
36044 // not old
36045 continue;
36046 }
36047
36048 // remove old bin
36049 var dest = path.join(binFolder, path.basename(src));
36050 try {
36051 yield (_fs || _load_fs()).unlink(dest);
36052 } catch (err) {
36053 throwPermError(err, dest);
36054 }
36055 }
36056
36057 // add new bins
36058 for (var _iterator6 = afterBins, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
36059 var _ref12;
36060
36061 if (_isArray6) {
36062 if (_i6 >= _iterator6.length) break;
36063 _ref12 = _iterator6[_i6++];
36064 } else {
36065 _i6 = _iterator6.next();
36066 if (_i6.done) break;
36067 _ref12 = _i6.value;
36068 }
36069
36070 var _src = _ref12;
36071
36072 // insert new bin
36073 var dest = path.join(binFolder, path.basename(_src));
36074 try {
36075 yield (_fs || _load_fs()).unlink(dest);
36076 yield (0, (_packageLinker || _load_packageLinker()).linkBin)(_src, dest);
36077 if (process.platform === 'win32' && dest.indexOf('.cmd') !== -1) {
36078 yield (_fs || _load_fs()).rename(dest + '.cmd', dest);
36079 }
36080 } catch (err) {
36081 throwPermError(err, dest);
36082 }
36083 }
36084 });
36085 });
36086
36087 return function initUpdateBins(_x7, _x8, _x9) {
36088 return _ref9.apply(this, arguments);
36089 };
36090}();
36091
36092var list = function () {
36093 var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
36094 yield updateCwd(config);
36095
36096 // install so we get hard file paths
36097 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd);
36098 var install = new (_install || _load_install()).Install({}, config, new (_baseReporter || _load_baseReporter()).default(), lockfile);
36099 var patterns = yield install.getFlattenedDeps();
36100
36101 // dump global modules
36102 for (var _iterator7 = patterns, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
36103 var _ref14;
36104
36105 if (_isArray7) {
36106 if (_i7 >= _iterator7.length) break;
36107 _ref14 = _iterator7[_i7++];
36108 } else {
36109 _i7 = _iterator7.next();
36110 if (_i7.done) break;
36111 _ref14 = _i7.value;
36112 }
36113
36114 var pattern = _ref14;
36115
36116 var manifest = install.resolver.getStrictResolvedPattern(pattern);
36117 ls(manifest, reporter, false);
36118 }
36119 });
36120
36121 return function list(_x10, _x11, _x12, _x13) {
36122 return _ref13.apply(this, arguments);
36123 };
36124}();
36125
36126exports.hasWrapper = hasWrapper;
36127exports.setFlags = setFlags;
36128
36129var _errors;
36130
36131function _load_errors() {
36132 return _errors = __webpack_require__(6);
36133}
36134
36135var _index;
36136
36137function _load_index() {
36138 return _index = __webpack_require__(61);
36139}
36140
36141var _baseReporter;
36142
36143function _load_baseReporter() {
36144 return _baseReporter = _interopRequireDefault(__webpack_require__(98));
36145}
36146
36147var _buildSubCommands2;
36148
36149function _load_buildSubCommands() {
36150 return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
36151}
36152
36153var _lockfile;
36154
36155function _load_lockfile() {
36156 return _lockfile = _interopRequireDefault(__webpack_require__(25));
36157}
36158
36159var _install;
36160
36161function _load_install() {
36162 return _install = __webpack_require__(41);
36163}
36164
36165var _add;
36166
36167function _load_add() {
36168 return _add = __webpack_require__(154);
36169}
36170
36171var _remove;
36172
36173function _load_remove() {
36174 return _remove = __webpack_require__(295);
36175}
36176
36177var _upgrade;
36178
36179function _load_upgrade() {
36180 return _upgrade = __webpack_require__(194);
36181}
36182
36183var _upgradeInteractive;
36184
36185function _load_upgradeInteractive() {
36186 return _upgradeInteractive = __webpack_require__(298);
36187}
36188
36189var _packageLinker;
36190
36191function _load_packageLinker() {
36192 return _packageLinker = __webpack_require__(198);
36193}
36194
36195var _constants;
36196
36197function _load_constants() {
36198 return _constants = __webpack_require__(13);
36199}
36200
36201var _fs;
36202
36203function _load_fs() {
36204 return _fs = _interopRequireWildcard(__webpack_require__(8));
36205}
36206
36207function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
36208
36209function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
36210
36211var GlobalAdd = function (_Add) {
36212 (0, (_inherits2 || _load_inherits()).default)(GlobalAdd, _Add);
36213
36214 function GlobalAdd(args, flags, config, reporter, lockfile) {
36215 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GlobalAdd);
36216
36217 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Add.call(this, args, flags, config, reporter, lockfile));
36218
36219 _this.linker.setTopLevelBinLinking(false);
36220 return _this;
36221 }
36222
36223 GlobalAdd.prototype.maybeOutputSaveTree = function maybeOutputSaveTree() {
36224 for (var _iterator = this.addedPatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
36225 var _ref;
36226
36227 if (_isArray) {
36228 if (_i >= _iterator.length) break;
36229 _ref = _iterator[_i++];
36230 } else {
36231 _i = _iterator.next();
36232 if (_i.done) break;
36233 _ref = _i.value;
36234 }
36235
36236 var pattern = _ref;
36237
36238 var manifest = this.resolver.getStrictResolvedPattern(pattern);
36239 ls(manifest, this.reporter, true);
36240 }
36241 return (_promise || _load_promise()).default.resolve();
36242 };
36243
36244 GlobalAdd.prototype._logSuccessSaveLockfile = function _logSuccessSaveLockfile() {
36245 // noop
36246 };
36247
36248 return GlobalAdd;
36249}((_add || _load_add()).Add);
36250
36251var path = __webpack_require__(1);
36252
36253function hasWrapper(flags, args) {
36254 return args[0] !== 'bin' && args[0] !== 'dir';
36255}
36256
36257function ls(manifest, reporter, saved) {
36258 var bins = manifest.bin ? (0, (_keys || _load_keys()).default)(manifest.bin) : [];
36259 var human = `${manifest.name}@${manifest.version}`;
36260 if (bins.length) {
36261 if (saved) {
36262 reporter.success(reporter.lang('packageInstalledWithBinaries', human));
36263 } else {
36264 reporter.info(reporter.lang('packageHasBinaries', human));
36265 }
36266 reporter.list(`bins-${manifest.name}`, bins);
36267 } else if (saved) {
36268 reporter.warn(reporter.lang('packageHasNoBinaries', human));
36269 }
36270}
36271
36272var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('global', {
36273 add(config, reporter, flags, args) {
36274 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
36275 yield updateCwd(config);
36276
36277 var updateBins = yield initUpdateBins(config, reporter, flags);
36278 if (args.indexOf('yarn') !== -1) {
36279 reporter.warn(reporter.lang('packageContainsYarnAsGlobal'));
36280 }
36281
36282 // install module
36283 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd);
36284 var install = new GlobalAdd(args, flags, config, reporter, lockfile);
36285 yield install.init();
36286
36287 // link binaries
36288 yield updateBins();
36289 })();
36290 },
36291
36292 bin(config, reporter, flags, args) {
36293 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
36294 reporter.log((yield getBinFolder(config, flags)), { force: true });
36295 })();
36296 },
36297
36298 dir(config, reporter, flags, args) {
36299 reporter.log(config.globalFolder, { force: true });
36300 return (_promise || _load_promise()).default.resolve();
36301 },
36302
36303 ls(config, reporter, flags, args) {
36304 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
36305 reporter.warn(`\`yarn global ls\` is deprecated. Please use \`yarn global list\`.`);
36306 yield list(config, reporter, flags, args);
36307 })();
36308 },
36309
36310 list(config, reporter, flags, args) {
36311 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
36312 yield list(config, reporter, flags, args);
36313 })();
36314 },
36315
36316 remove(config, reporter, flags, args) {
36317 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
36318 yield updateCwd(config);
36319
36320 var updateBins = yield initUpdateBins(config, reporter, flags);
36321
36322 // remove module
36323 yield (0, (_remove || _load_remove()).run)(config, reporter, flags, args);
36324
36325 // remove binaries
36326 yield updateBins();
36327 })();
36328 },
36329
36330 upgrade(config, reporter, flags, args) {
36331 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
36332 yield updateCwd(config);
36333
36334 var updateBins = yield initUpdateBins(config, reporter, flags);
36335
36336 // upgrade module
36337 yield (0, (_upgrade || _load_upgrade()).run)(config, reporter, flags, args);
36338
36339 // update binaries
36340 yield updateBins();
36341 })();
36342 },
36343
36344 upgradeInteractive(config, reporter, flags, args) {
36345 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
36346 yield updateCwd(config);
36347
36348 var updateBins = yield initUpdateBins(config, reporter, flags);
36349
36350 // upgrade module
36351 yield (0, (_upgradeInteractive || _load_upgradeInteractive()).run)(config, reporter, flags, args);
36352
36353 // update binaries
36354 yield updateBins();
36355 })();
36356 }
36357}),
36358 run = _buildSubCommands.run,
36359 _setFlags = _buildSubCommands.setFlags;
36360
36361exports.run = run;
36362function setFlags(commander) {
36363 _setFlags(commander);
36364 commander.description('Installs packages globally on your operating system.');
36365 commander.option('--prefix <prefix>', 'bin prefix to use to install binaries');
36366 commander.option('--latest', 'upgrade to the latest version of packages');
36367}
36368
36369/***/ }),
36370/* 116 */
36371/***/ (function(module, exports, __webpack_require__) {
36372
36373"use strict";
36374
36375
36376Object.defineProperty(exports, "__esModule", {
36377 value: true
36378});
36379
36380var _promise;
36381
36382function _load_promise() {
36383 return _promise = _interopRequireDefault(__webpack_require__(7));
36384}
36385
36386var _getIterator2;
36387
36388function _load_getIterator() {
36389 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
36390}
36391
36392var _assign;
36393
36394function _load_assign() {
36395 return _assign = _interopRequireDefault(__webpack_require__(23));
36396}
36397
36398var _asyncToGenerator2;
36399
36400function _load_asyncToGenerator() {
36401 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
36402}
36403
36404var _classCallCheck2;
36405
36406function _load_classCallCheck() {
36407 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
36408}
36409
36410var _path;
36411
36412function _load_path() {
36413 return _path = _interopRequireDefault(__webpack_require__(1));
36414}
36415
36416var _invariant;
36417
36418function _load_invariant() {
36419 return _invariant = _interopRequireDefault(__webpack_require__(15));
36420}
36421
36422var _semver;
36423
36424function _load_semver() {
36425 return _semver = _interopRequireDefault(__webpack_require__(27));
36426}
36427
36428var _validate;
36429
36430function _load_validate() {
36431 return _validate = __webpack_require__(119);
36432}
36433
36434var _lockfile;
36435
36436function _load_lockfile() {
36437 return _lockfile = _interopRequireDefault(__webpack_require__(25));
36438}
36439
36440var _packageReference;
36441
36442function _load_packageReference() {
36443 return _packageReference = _interopRequireDefault(__webpack_require__(302));
36444}
36445
36446var _index;
36447
36448function _load_index() {
36449 return _index = __webpack_require__(75);
36450}
36451
36452var _errors;
36453
36454function _load_errors() {
36455 return _errors = __webpack_require__(6);
36456}
36457
36458var _constants;
36459
36460function _load_constants() {
36461 return _constants = _interopRequireWildcard(__webpack_require__(13));
36462}
36463
36464var _version;
36465
36466function _load_version() {
36467 return _version = _interopRequireWildcard(__webpack_require__(209));
36468}
36469
36470var _workspaceResolver;
36471
36472function _load_workspaceResolver() {
36473 return _workspaceResolver = _interopRequireDefault(__webpack_require__(526));
36474}
36475
36476var _fs;
36477
36478function _load_fs() {
36479 return _fs = _interopRequireWildcard(__webpack_require__(8));
36480}
36481
36482var _normalizePattern4;
36483
36484function _load_normalizePattern() {
36485 return _normalizePattern4 = __webpack_require__(52);
36486}
36487
36488function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
36489
36490function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
36491
36492var micromatch = __webpack_require__(109);
36493
36494var PackageRequest = function () {
36495 function PackageRequest(req, resolver) {
36496 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageRequest);
36497
36498 this.parentRequest = req.parentRequest;
36499 this.parentNames = req.parentNames || [];
36500 this.lockfile = resolver.lockfile;
36501 this.registry = req.registry;
36502 this.reporter = resolver.reporter;
36503 this.resolver = resolver;
36504 this.optional = req.optional;
36505 this.hint = req.hint;
36506 this.pattern = req.pattern;
36507 this.config = resolver.config;
36508 this.foundInfo = null;
36509 }
36510
36511 PackageRequest.prototype.init = function init() {
36512 this.resolver.usedRegistries.add(this.registry);
36513 };
36514
36515 PackageRequest.prototype.getLocked = function getLocked(remoteType) {
36516 // always prioritise root lockfile
36517 var shrunk = this.lockfile.getLocked(this.pattern);
36518
36519 if (shrunk && shrunk.resolved) {
36520 var resolvedParts = (_version || _load_version()).explodeHashedUrl(shrunk.resolved);
36521
36522 // Detect Git protocols (git://HOST/PATH or git+PROTOCOL://HOST/PATH)
36523 var preferredRemoteType = /^git(\+[a-z0-9]+)?:\/\//.test(resolvedParts.url) ? 'git' : remoteType;
36524
36525 return {
36526 name: shrunk.name,
36527 version: shrunk.version,
36528 _uid: shrunk.uid,
36529 _remote: {
36530 resolved: shrunk.resolved,
36531 type: preferredRemoteType,
36532 reference: resolvedParts.url,
36533 hash: resolvedParts.hash,
36534 integrity: shrunk.integrity,
36535 registry: shrunk.registry,
36536 packageName: shrunk.name
36537 },
36538 optionalDependencies: shrunk.optionalDependencies || {},
36539 dependencies: shrunk.dependencies || {},
36540 prebuiltVariants: shrunk.prebuiltVariants || {}
36541 };
36542 } else {
36543 return null;
36544 }
36545 };
36546
36547 /**
36548 * If the input pattern matches a registry one then attempt to find it on the registry.
36549 * Otherwise fork off to an exotic resolver if one matches.
36550 */
36551
36552 PackageRequest.prototype.findVersionOnRegistry = function () {
36553 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pattern) {
36554 var _ref2 = yield this.normalize(pattern),
36555 range = _ref2.range,
36556 name = _ref2.name;
36557
36558 var exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range);
36559 if (exoticResolver) {
36560 var data = yield this.findExoticVersionInfo(exoticResolver, range);
36561
36562 // clone data as we're manipulating it in place and this could be resolved multiple
36563 // times
36564 data = (0, (_assign || _load_assign()).default)({}, data);
36565
36566 // this is so the returned package response uses the overridden name. ie. if the
36567 // package's actual name is `bar`, but it's been specified in the manifest like:
36568 // "foo": "http://foo.com/bar.tar.gz"
36569 // then we use the foo name
36570 data.name = name;
36571 return data;
36572 }
36573
36574 var Resolver = this.getRegistryResolver();
36575 var resolver = new Resolver(this, name, range);
36576 try {
36577 return yield resolver.resolve();
36578 } catch (err) {
36579 // if it is not an error thrown by yarn and it has a parent request,
36580 // thow a more readable error
36581 if (!(err instanceof (_errors || _load_errors()).MessageError) && this.parentRequest && this.parentRequest.pattern) {
36582 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('requiredPackageNotFoundRegistry', pattern, this.parentRequest.pattern, this.registry));
36583 }
36584 throw err;
36585 }
36586 });
36587
36588 function findVersionOnRegistry(_x) {
36589 return _ref.apply(this, arguments);
36590 }
36591
36592 return findVersionOnRegistry;
36593 }();
36594
36595 /**
36596 * Get the registry resolver associated with this package request.
36597 */
36598
36599 PackageRequest.prototype.getRegistryResolver = function getRegistryResolver() {
36600 var Resolver = (_index || _load_index()).registries[this.registry];
36601 if (Resolver) {
36602 return Resolver;
36603 } else {
36604 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('unknownRegistryResolver', this.registry));
36605 }
36606 };
36607
36608 PackageRequest.prototype.normalizeRange = function () {
36609 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pattern) {
36610 if (pattern.indexOf(':') > -1 || pattern.indexOf('@') > -1 || (0, (_index || _load_index()).getExoticResolver)(pattern)) {
36611 return pattern;
36612 }
36613
36614 if (!(_semver || _load_semver()).default.validRange(pattern)) {
36615 try {
36616 if (yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(this.config.cwd, pattern, (_constants || _load_constants()).NODE_PACKAGE_JSON))) {
36617 this.reporter.warn(this.reporter.lang('implicitFileDeprecated', pattern));
36618 return `file:${pattern}`;
36619 }
36620 } catch (err) {
36621 // pass
36622 }
36623 }
36624
36625 return pattern;
36626 });
36627
36628 function normalizeRange(_x2) {
36629 return _ref3.apply(this, arguments);
36630 }
36631
36632 return normalizeRange;
36633 }();
36634
36635 PackageRequest.prototype.normalize = function () {
36636 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pattern) {
36637 var _normalizePattern = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern),
36638 name = _normalizePattern.name,
36639 range = _normalizePattern.range,
36640 hasVersion = _normalizePattern.hasVersion;
36641
36642 var newRange = yield this.normalizeRange(range);
36643 return { name, range: newRange, hasVersion };
36644 });
36645
36646 function normalize(_x3) {
36647 return _ref4.apply(this, arguments);
36648 }
36649
36650 return normalize;
36651 }();
36652
36653 /**
36654 * Construct an exotic resolver instance with the input `ExoticResolver` and `range`.
36655 */
36656
36657 PackageRequest.prototype.findExoticVersionInfo = function findExoticVersionInfo(ExoticResolver, range) {
36658 var resolver = new ExoticResolver(this, range);
36659 return resolver.resolve();
36660 };
36661
36662 /**
36663 * If the current pattern matches an exotic resolver then delegate to it or else try
36664 * the registry.
36665 */
36666
36667 PackageRequest.prototype.findVersionInfo = function () {
36668 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
36669 var exoticResolver = (0, (_index || _load_index()).getExoticResolver)(this.pattern);
36670 if (exoticResolver) {
36671 return this.findExoticVersionInfo(exoticResolver, this.pattern);
36672 } else if ((_workspaceResolver || _load_workspaceResolver()).default.isWorkspace(this.pattern, this.resolver.workspaceLayout)) {
36673 (0, (_invariant || _load_invariant()).default)(this.resolver.workspaceLayout, 'expected workspaceLayout');
36674 var resolver = new (_workspaceResolver || _load_workspaceResolver()).default(this, this.pattern, this.resolver.workspaceLayout);
36675 var manifest = void 0;
36676 if (this.config.focus && !(this.pattern.indexOf(this.resolver.workspaceLayout.virtualManifestName) !== -1) && !this.pattern.startsWith(this.config.focusedWorkspaceName + '@')) {
36677 var localInfo = this.resolver.workspaceLayout.getManifestByPattern(this.pattern);
36678 (0, (_invariant || _load_invariant()).default)(localInfo, 'expected local info for ' + this.pattern);
36679 var localManifest = localInfo.manifest;
36680 var requestPattern = localManifest.name + '@' + localManifest.version;
36681 manifest = yield this.findVersionOnRegistry(requestPattern);
36682 }
36683 return resolver.resolve(manifest);
36684 } else {
36685 return this.findVersionOnRegistry(this.pattern);
36686 }
36687 });
36688
36689 function findVersionInfo() {
36690 return _ref5.apply(this, arguments);
36691 }
36692
36693 return findVersionInfo;
36694 }();
36695
36696 PackageRequest.prototype.reportResolvedRangeMatch = function reportResolvedRangeMatch(info, resolved) {};
36697
36698 /**
36699 * Do the final resolve of a package that had a match with an existing version.
36700 * After all unique versions have been discovered, so the best available version
36701 * is found.
36702 */
36703
36704
36705 PackageRequest.prototype.resolveToExistingVersion = function resolveToExistingVersion(info) {
36706 // get final resolved version
36707 var _normalizePattern2 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(this.pattern),
36708 range = _normalizePattern2.range,
36709 name = _normalizePattern2.name;
36710
36711 var solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range;
36712 var resolved = this.resolver.getHighestRangeVersionMatch(name, solvedRange, info);
36713 (0, (_invariant || _load_invariant()).default)(resolved, 'should have a resolved reference');
36714
36715 this.reportResolvedRangeMatch(info, resolved);
36716 var ref = resolved._reference;
36717 (0, (_invariant || _load_invariant()).default)(ref, 'Resolved package info has no package reference');
36718 ref.addRequest(this);
36719 ref.addPattern(this.pattern, resolved);
36720 ref.addOptional(this.optional);
36721 };
36722
36723 /**
36724 * TODO description
36725 */
36726
36727
36728 PackageRequest.prototype.find = function () {
36729 var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref7) {
36730 var fresh = _ref7.fresh,
36731 frozen = _ref7.frozen;
36732
36733 // find version info for this package pattern
36734 var info = yield this.findVersionInfo();
36735
36736 if (!(_semver || _load_semver()).default.valid(info.version)) {
36737 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('invalidPackageVersion', info.name, info.version));
36738 }
36739
36740 info.fresh = fresh;
36741 (0, (_validate || _load_validate()).cleanDependencies)(info, false, this.reporter, function () {
36742 // swallow warnings
36743 });
36744
36745 // check if while we were resolving this dep we've already resolved one that satisfies
36746 // the same range
36747
36748 var _normalizePattern3 = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(this.pattern),
36749 range = _normalizePattern3.range,
36750 name = _normalizePattern3.name;
36751
36752 var solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range;
36753 var resolved = !info.fresh || frozen ? this.resolver.getExactVersionMatch(name, solvedRange, info) : this.resolver.getHighestRangeVersionMatch(name, solvedRange, info);
36754
36755 if (resolved) {
36756 this.resolver.reportPackageWithExistingVersion(this, info);
36757 return;
36758 }
36759
36760 if (info.flat && !this.resolver.flat) {
36761 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('flatGlobalError', `${info.name}@${info.version}`));
36762 }
36763
36764 // validate version info
36765 PackageRequest.validateVersionInfo(info, this.reporter);
36766
36767 //
36768 var remote = info._remote;
36769 (0, (_invariant || _load_invariant()).default)(remote, 'Missing remote');
36770
36771 // set package reference
36772 var ref = new (_packageReference || _load_packageReference()).default(this, info, remote);
36773 ref.addPattern(this.pattern, info);
36774 ref.addOptional(this.optional);
36775 ref.setFresh(fresh);
36776 info._reference = ref;
36777 info._remote = remote;
36778 // start installation of dependencies
36779 var promises = [];
36780 var deps = [];
36781 var parentNames = [].concat(this.parentNames, [name]);
36782 // normal deps
36783 for (var depName in info.dependencies) {
36784 var depPattern = depName + '@' + info.dependencies[depName];
36785 deps.push(depPattern);
36786 promises.push(this.resolver.find({
36787 pattern: depPattern,
36788 registry: remote.registry,
36789 // dependencies of optional dependencies should themselves be optional
36790 optional: this.optional,
36791 parentRequest: this,
36792 parentNames
36793 }));
36794 }
36795
36796 // optional deps
36797 for (var _depName in info.optionalDependencies) {
36798 var _depPattern = _depName + '@' + info.optionalDependencies[_depName];
36799 deps.push(_depPattern);
36800 promises.push(this.resolver.find({
36801 hint: 'optional',
36802 pattern: _depPattern,
36803 registry: remote.registry,
36804 optional: true,
36805 parentRequest: this,
36806 parentNames
36807 }));
36808 }
36809 if (remote.type === 'workspace' && !this.config.production) {
36810 // workspaces support dev dependencies
36811 for (var _depName2 in info.devDependencies) {
36812 var _depPattern2 = _depName2 + '@' + info.devDependencies[_depName2];
36813 deps.push(_depPattern2);
36814 promises.push(this.resolver.find({
36815 hint: 'dev',
36816 pattern: _depPattern2,
36817 registry: remote.registry,
36818 optional: false,
36819 parentRequest: this,
36820 parentNames
36821 }));
36822 }
36823 }
36824
36825 for (var _iterator = promises, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
36826 var _ref8;
36827
36828 if (_isArray) {
36829 if (_i >= _iterator.length) break;
36830 _ref8 = _iterator[_i++];
36831 } else {
36832 _i = _iterator.next();
36833 if (_i.done) break;
36834 _ref8 = _i.value;
36835 }
36836
36837 var promise = _ref8;
36838
36839 yield promise;
36840 }
36841
36842 ref.addDependencies(deps);
36843
36844 // Now that we have all dependencies, it's safe to propagate optional
36845 for (var _iterator2 = ref.requests.slice(1), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
36846 var _ref9;
36847
36848 if (_isArray2) {
36849 if (_i2 >= _iterator2.length) break;
36850 _ref9 = _iterator2[_i2++];
36851 } else {
36852 _i2 = _iterator2.next();
36853 if (_i2.done) break;
36854 _ref9 = _i2.value;
36855 }
36856
36857 var otherRequest = _ref9;
36858
36859 ref.addOptional(otherRequest.optional);
36860 }
36861 });
36862
36863 function find(_x4) {
36864 return _ref6.apply(this, arguments);
36865 }
36866
36867 return find;
36868 }();
36869
36870 /**
36871 * TODO description
36872 */
36873
36874 PackageRequest.validateVersionInfo = function validateVersionInfo(info, reporter) {
36875 // human readable name to use in errors
36876 var human = `${info.name}@${info.version}`;
36877
36878 info.version = PackageRequest.getPackageVersion(info);
36879
36880 for (var _iterator3 = (_constants || _load_constants()).REQUIRED_PACKAGE_KEYS, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
36881 var _ref10;
36882
36883 if (_isArray3) {
36884 if (_i3 >= _iterator3.length) break;
36885 _ref10 = _iterator3[_i3++];
36886 } else {
36887 _i3 = _iterator3.next();
36888 if (_i3.done) break;
36889 _ref10 = _i3.value;
36890 }
36891
36892 var key = _ref10;
36893
36894 if (!info[key]) {
36895 throw new (_errors || _load_errors()).MessageError(reporter.lang('missingRequiredPackageKey', human, key));
36896 }
36897 }
36898 };
36899
36900 /**
36901 * Returns the package version if present, else defaults to the uid
36902 */
36903
36904 PackageRequest.getPackageVersion = function getPackageVersion(info) {
36905 // TODO possibly reconsider this behaviour
36906 return info.version === undefined ? info._uid : info.version;
36907 };
36908
36909 /**
36910 * Gets all of the outdated packages and sorts them appropriately
36911 */
36912
36913 PackageRequest.getOutdatedPackages = function () {
36914 var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (lockfile, install, config, reporter, filterByPatterns, flags) {
36915 var _ref12 = yield install.fetchRequestFromCwd(),
36916 reqPatterns = _ref12.requests,
36917 workspaceLayout = _ref12.workspaceLayout;
36918
36919 // Filter out workspace patterns if necessary
36920
36921
36922 var depReqPatterns = workspaceLayout ? reqPatterns.filter(function (p) {
36923 return !workspaceLayout.getManifestByPattern(p.pattern);
36924 }) : reqPatterns;
36925
36926 // filter the list down to just the packages requested.
36927 // prevents us from having to query the metadata for all packages.
36928 if (filterByPatterns && filterByPatterns.length || flags && flags.pattern) {
36929 var filterByNames = filterByPatterns && filterByPatterns.length ? filterByPatterns.map(function (pattern) {
36930 return (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern).name;
36931 }) : [];
36932 depReqPatterns = depReqPatterns.filter(function (dep) {
36933 return filterByNames.indexOf((0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(dep.pattern).name) >= 0 || flags && flags.pattern && micromatch.contains((0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(dep.pattern).name, flags.pattern);
36934 });
36935 }
36936
36937 var deps = yield (_promise || _load_promise()).default.all(depReqPatterns.map(function () {
36938 var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref14) {
36939 var pattern = _ref14.pattern,
36940 hint = _ref14.hint,
36941 workspaceName = _ref14.workspaceName,
36942 workspaceLoc = _ref14.workspaceLoc;
36943
36944 var locked = lockfile.getLocked(pattern);
36945 if (!locked) {
36946 throw new (_errors || _load_errors()).MessageError(reporter.lang('lockfileOutdated'));
36947 }
36948
36949 var name = locked.name,
36950 current = locked.version;
36951
36952 var latest = '';
36953 var wanted = '';
36954 var url = '';
36955
36956 var normalized = (0, (_normalizePattern4 || _load_normalizePattern()).normalizePattern)(pattern);
36957
36958 if ((0, (_index || _load_index()).getExoticResolver)(pattern) || (0, (_index || _load_index()).getExoticResolver)(normalized.range)) {
36959 latest = wanted = 'exotic';
36960 url = normalized.range;
36961 } else {
36962 var registry = config.registries[locked.registry];
36963
36964 var _ref15 = yield registry.checkOutdated(config, name, normalized.range);
36965
36966 latest = _ref15.latest;
36967 wanted = _ref15.wanted;
36968 url = _ref15.url;
36969 }
36970
36971 return {
36972 name,
36973 current,
36974 wanted,
36975 latest,
36976 url,
36977 hint,
36978 range: normalized.range,
36979 upgradeTo: '',
36980 workspaceName: workspaceName || '',
36981 workspaceLoc: workspaceLoc || ''
36982 };
36983 });
36984
36985 return function (_x11) {
36986 return _ref13.apply(this, arguments);
36987 };
36988 }()));
36989
36990 // Make sure to always output `exotic` versions to be compatible with npm
36991 var isDepOld = function isDepOld(_ref16) {
36992 var current = _ref16.current,
36993 latest = _ref16.latest,
36994 wanted = _ref16.wanted;
36995 return latest === 'exotic' || (_semver || _load_semver()).default.lt(current, wanted) || (_semver || _load_semver()).default.lt(current, latest);
36996 };
36997 var orderByName = function orderByName(depA, depB) {
36998 return depA.name.localeCompare(depB.name);
36999 };
37000 return deps.filter(isDepOld).sort(orderByName);
37001 });
37002
37003 function getOutdatedPackages(_x5, _x6, _x7, _x8, _x9, _x10) {
37004 return _ref11.apply(this, arguments);
37005 }
37006
37007 return getOutdatedPackages;
37008 }();
37009
37010 return PackageRequest;
37011}();
37012
37013exports.default = PackageRequest;
37014
37015/***/ }),
37016/* 117 */
37017/***/ (function(module, exports, __webpack_require__) {
37018
37019"use strict";
37020
37021
37022Object.defineProperty(exports, "__esModule", {
37023 value: true
37024});
37025
37026var _classCallCheck2;
37027
37028function _load_classCallCheck() {
37029 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
37030}
37031
37032function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37033
37034var BaseResolver = function () {
37035 function BaseResolver(request, fragment) {
37036 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseResolver);
37037
37038 this.resolver = request.resolver;
37039 this.reporter = request.reporter;
37040 this.fragment = fragment;
37041 this.registry = request.registry;
37042 this.request = request;
37043 this.pattern = request.pattern;
37044 this.config = request.config;
37045 }
37046
37047 BaseResolver.prototype.fork = function fork(Resolver, resolveArg) {
37048 for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
37049 args[_key - 2] = arguments[_key];
37050 }
37051
37052 var resolver = new (Function.prototype.bind.apply(Resolver, [null].concat([this.request], args)))();
37053 resolver.registry = this.registry;
37054 return resolver.resolve(resolveArg);
37055 };
37056
37057 BaseResolver.prototype.resolve = function resolve(resolveArg) {
37058 throw new Error('Not implemented');
37059 };
37060
37061 return BaseResolver;
37062}();
37063
37064exports.default = BaseResolver;
37065
37066/***/ }),
37067/* 118 */
37068/***/ (function(module, exports, __webpack_require__) {
37069
37070"use strict";
37071
37072
37073Object.defineProperty(exports, "__esModule", {
37074 value: true
37075});
37076
37077var _asyncToGenerator2;
37078
37079function _load_asyncToGenerator() {
37080 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
37081}
37082
37083var _getIterator2;
37084
37085function _load_getIterator() {
37086 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
37087}
37088
37089var _classCallCheck2;
37090
37091function _load_classCallCheck() {
37092 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
37093}
37094
37095var _possibleConstructorReturn2;
37096
37097function _load_possibleConstructorReturn() {
37098 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
37099}
37100
37101var _inherits2;
37102
37103function _load_inherits() {
37104 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
37105}
37106
37107var _index;
37108
37109function _load_index() {
37110 return _index = __webpack_require__(75);
37111}
37112
37113var _misc;
37114
37115function _load_misc() {
37116 return _misc = _interopRequireWildcard(__webpack_require__(28));
37117}
37118
37119var _version;
37120
37121function _load_version() {
37122 return _version = _interopRequireWildcard(__webpack_require__(209));
37123}
37124
37125var _guessName;
37126
37127function _load_guessName() {
37128 return _guessName = _interopRequireDefault(__webpack_require__(159));
37129}
37130
37131var _index2;
37132
37133function _load_index2() {
37134 return _index2 = __webpack_require__(61);
37135}
37136
37137var _exoticResolver;
37138
37139function _load_exoticResolver() {
37140 return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
37141}
37142
37143var _git;
37144
37145function _load_git() {
37146 return _git = _interopRequireDefault(__webpack_require__(205));
37147}
37148
37149function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
37150
37151function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37152
37153var urlParse = __webpack_require__(29).parse;
37154
37155var GIT_HOSTS = ['github.com', 'gitlab.com', 'bitbucket.com', 'bitbucket.org'];
37156
37157var GIT_PATTERN_MATCHERS = [/^git:/, /^git\+.+:/, /^ssh:/, /^https?:.+\.git$/, /^https?:.+\.git#.+/];
37158
37159var GitResolver = function (_ExoticResolver) {
37160 (0, (_inherits2 || _load_inherits()).default)(GitResolver, _ExoticResolver);
37161
37162 function GitResolver(request, fragment) {
37163 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GitResolver);
37164
37165 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
37166
37167 var _versionUtil$explodeH = (_version || _load_version()).explodeHashedUrl(fragment),
37168 url = _versionUtil$explodeH.url,
37169 hash = _versionUtil$explodeH.hash;
37170
37171 _this.url = url;
37172 _this.hash = hash;
37173 return _this;
37174 }
37175
37176 GitResolver.isVersion = function isVersion(pattern) {
37177 for (var _iterator = GIT_PATTERN_MATCHERS, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
37178 var _ref;
37179
37180 if (_isArray) {
37181 if (_i >= _iterator.length) break;
37182 _ref = _iterator[_i++];
37183 } else {
37184 _i = _iterator.next();
37185 if (_i.done) break;
37186 _ref = _i.value;
37187 }
37188
37189 var matcher = _ref;
37190
37191 if (matcher.test(pattern)) {
37192 return true;
37193 }
37194 }
37195
37196 var _urlParse = urlParse(pattern),
37197 hostname = _urlParse.hostname,
37198 path = _urlParse.path;
37199
37200 if (hostname && path && GIT_HOSTS.indexOf(hostname) >= 0) {
37201 // only if dependency is pointing to a git repo,
37202 // e.g. facebook/flow and not file in a git repo facebook/flow/archive/v1.0.0.tar.gz
37203 return path.split('/').filter(function (p) {
37204 return !!p;
37205 }).length === 2;
37206 }
37207
37208 return false;
37209 };
37210
37211 GitResolver.prototype.resolve = function () {
37212 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (forked) {
37213 var tryRegistry = function () {
37214 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (registry) {
37215 var filename = (_index2 || _load_index2()).registries[registry].filename;
37216
37217 var file = yield client.getFile(filename);
37218 if (!file) {
37219 return null;
37220 }
37221
37222 var json = yield config.readJson(`${url}/${filename}`, function () {
37223 return JSON.parse(file);
37224 });
37225 json._uid = commit;
37226 json._remote = {
37227 resolved: `${url}#${commit}`,
37228 type: 'git',
37229 reference: url,
37230 hash: commit,
37231 registry
37232 };
37233 return json;
37234 });
37235
37236 return function tryRegistry(_x2) {
37237 return _ref3.apply(this, arguments);
37238 };
37239 }();
37240
37241 var url = this.url;
37242
37243 // shortcut for hosted git. we will fallback to a GitResolver if the hosted git
37244 // optimisations fail which the `forked` flag indicates so we don't get into an
37245 // infinite loop
37246
37247 var parts = urlParse(url);
37248 if (false) {
37249 // check if this git url uses any of the hostnames defined in our hosted git resolvers
37250 for (var name in (_index || _load_index()).hostedGit) {
37251 var Resolver = (_index || _load_index()).hostedGit[name];
37252 if (Resolver.hostname !== parts.hostname) {
37253 continue;
37254 }
37255
37256 // we have a match! clean up the pathname of url artifacts
37257 var pathname = parts.pathname;
37258 pathname = (_misc || _load_misc()).removePrefix(pathname, '/'); // remove prefixed slash
37259 pathname = (_misc || _load_misc()).removeSuffix(pathname, '.git'); // remove .git suffix if present
37260
37261 var _url = `${pathname}${this.hash ? '#' + decodeURIComponent(this.hash) : ''}`;
37262 return this.fork(Resolver, false, _url);
37263 }
37264 }
37265
37266 // get from lockfile
37267 var shrunk = this.request.getLocked('git');
37268 if (shrunk) {
37269 return shrunk;
37270 }
37271
37272 var config = this.config;
37273
37274
37275 var gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(url);
37276 var client = new (_git || _load_git()).default(config, gitUrl, this.hash);
37277 var commit = yield client.init();
37278
37279 var file = yield tryRegistry(this.registry);
37280 if (file) {
37281 return file;
37282 }
37283
37284 for (var registry in (_index2 || _load_index2()).registries) {
37285 if (registry === this.registry) {
37286 continue;
37287 }
37288
37289 var _file = yield tryRegistry(registry);
37290 if (_file) {
37291 return _file;
37292 }
37293 }
37294
37295 return {
37296 // This is just the default, it can be overridden with key of dependencies
37297 name: (0, (_guessName || _load_guessName()).default)(url),
37298 version: '0.0.0',
37299 _uid: commit,
37300 _remote: {
37301 resolved: `${url}#${commit}`,
37302 type: 'git',
37303 reference: url,
37304 hash: commit,
37305 registry: 'npm'
37306 }
37307 };
37308 });
37309
37310 function resolve(_x) {
37311 return _ref2.apply(this, arguments);
37312 }
37313
37314 return resolve;
37315 }();
37316
37317 return GitResolver;
37318}((_exoticResolver || _load_exoticResolver()).default);
37319
37320exports.default = GitResolver;
37321
37322/***/ }),
37323/* 119 */
37324/***/ (function(module, exports, __webpack_require__) {
37325
37326"use strict";
37327
37328
37329Object.defineProperty(exports, "__esModule", {
37330 value: true
37331});
37332
37333var _keys;
37334
37335function _load_keys() {
37336 return _keys = _interopRequireDefault(__webpack_require__(14));
37337}
37338
37339var _set;
37340
37341function _load_set() {
37342 return _set = _interopRequireDefault(__webpack_require__(16));
37343}
37344
37345var _map;
37346
37347function _load_map() {
37348 return _map = _interopRequireDefault(__webpack_require__(42));
37349}
37350
37351var _getIterator2;
37352
37353function _load_getIterator() {
37354 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
37355}
37356
37357exports.isValidPackageName = isValidPackageName;
37358
37359exports.default = function (info, isRoot, reporter, warn) {
37360 if (isRoot) {
37361 for (var key in (_typos || _load_typos()).default) {
37362 if (key in info) {
37363 warn(reporter.lang('manifestPotentialTypo', key, (_typos || _load_typos()).default[key]));
37364 }
37365 }
37366 }
37367
37368 // validate name
37369 var name = info.name;
37370
37371 if (typeof name === 'string') {
37372 if (isRoot && isBuiltinModule(name)) {
37373 warn(reporter.lang('manifestBuiltinModule', name));
37374 }
37375
37376 // cannot start with a dot
37377 if (name[0] === '.') {
37378 throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameDot'));
37379 }
37380
37381 // cannot contain the following characters
37382 if (!isValidPackageName(name)) {
37383 throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameIllegalChars'));
37384 }
37385
37386 // cannot equal node_modules or favicon.ico
37387 var lower = name.toLowerCase();
37388 if (lower === 'node_modules' || lower === 'favicon.ico') {
37389 throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestNameBlacklisted'));
37390 }
37391 }
37392
37393 // validate license
37394 if (isRoot && !info.private) {
37395 if (typeof info.license === 'string') {
37396 var license = info.license.replace(/\*$/g, '');
37397 if (!(0, (_util || _load_util()).isValidLicense)(license)) {
37398 warn(reporter.lang('manifestLicenseInvalid'));
37399 }
37400 } else {
37401 warn(reporter.lang('manifestLicenseNone'));
37402 }
37403 }
37404
37405 // validate strings
37406 for (var _iterator = strings, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
37407 var _ref;
37408
37409 if (_isArray) {
37410 if (_i >= _iterator.length) break;
37411 _ref = _iterator[_i++];
37412 } else {
37413 _i = _iterator.next();
37414 if (_i.done) break;
37415 _ref = _i.value;
37416 }
37417
37418 var _key = _ref;
37419
37420 var val = info[_key];
37421 if (val && typeof val !== 'string') {
37422 throw new (_errors || _load_errors()).MessageError(reporter.lang('manifestStringExpected', _key));
37423 }
37424 }
37425
37426 cleanDependencies(info, isRoot, reporter, warn);
37427};
37428
37429exports.cleanDependencies = cleanDependencies;
37430
37431var _errors;
37432
37433function _load_errors() {
37434 return _errors = __webpack_require__(6);
37435}
37436
37437var _util;
37438
37439function _load_util() {
37440 return _util = __webpack_require__(207);
37441}
37442
37443var _typos;
37444
37445function _load_typos() {
37446 return _typos = _interopRequireDefault(__webpack_require__(544));
37447}
37448
37449function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
37450
37451var isBuiltinModule = __webpack_require__(779);
37452
37453var strings = ['name', 'version'];
37454
37455var dependencyKeys = [
37456// npm registry will include optionalDependencies in dependencies and we'll want to dedupe them from the
37457// other fields first
37458'optionalDependencies',
37459
37460// it's seemingly common to include a dependency in dependencies and devDependencies of the same name but
37461// different ranges, this can cause a lot of issues with our determinism and the behaviour of npm is
37462// currently unspecified.
37463'dependencies', 'devDependencies'];
37464
37465function isValidName(name) {
37466 return !name.match(/[\/@\s\+%:]/) && encodeURIComponent(name) === name;
37467}
37468
37469function isValidScopedName(name) {
37470 if (name[0] !== '@') {
37471 return false;
37472 }
37473
37474 var parts = name.slice(1).split('/');
37475 return parts.length === 2 && isValidName(parts[0]) && isValidName(parts[1]);
37476}
37477
37478function isValidPackageName(name) {
37479 return isValidName(name) || isValidScopedName(name);
37480}
37481
37482function cleanDependencies(info, isRoot, reporter, warn) {
37483 // get dependency objects
37484 var depTypes = [];
37485 for (var _iterator2 = dependencyKeys, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
37486 var _ref2;
37487
37488 if (_isArray2) {
37489 if (_i2 >= _iterator2.length) break;
37490 _ref2 = _iterator2[_i2++];
37491 } else {
37492 _i2 = _iterator2.next();
37493 if (_i2.done) break;
37494 _ref2 = _i2.value;
37495 }
37496
37497 var _type = _ref2;
37498
37499 var deps = info[_type];
37500 if (!deps || typeof deps !== 'object') {
37501 continue;
37502 }
37503 depTypes.push([_type, deps]);
37504 }
37505
37506 // aggregate all non-trivial deps (not '' or '*')
37507 var nonTrivialDeps = new (_map || _load_map()).default();
37508 for (var _iterator3 = depTypes, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
37509 var _ref4;
37510
37511 if (_isArray3) {
37512 if (_i3 >= _iterator3.length) break;
37513 _ref4 = _iterator3[_i3++];
37514 } else {
37515 _i3 = _iterator3.next();
37516 if (_i3.done) break;
37517 _ref4 = _i3.value;
37518 }
37519
37520 var _ref3 = _ref4;
37521 var _type2 = _ref3[0];
37522 var deps = _ref3[1];
37523
37524 for (var _iterator5 = (0, (_keys || _load_keys()).default)(deps), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
37525 var _ref7;
37526
37527 if (_isArray5) {
37528 if (_i5 >= _iterator5.length) break;
37529 _ref7 = _iterator5[_i5++];
37530 } else {
37531 _i5 = _iterator5.next();
37532 if (_i5.done) break;
37533 _ref7 = _i5.value;
37534 }
37535
37536 var name = _ref7;
37537
37538 var _version = deps[name];
37539 if (!nonTrivialDeps.has(name) && _version && _version !== '*') {
37540 nonTrivialDeps.set(name, { type: _type2, version: _version });
37541 }
37542 }
37543 }
37544
37545 // overwrite first dep of package with non-trivial version, remove the rest
37546 var setDeps = new (_set || _load_set()).default();
37547 for (var _iterator4 = depTypes, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
37548 var _ref6;
37549
37550 if (_isArray4) {
37551 if (_i4 >= _iterator4.length) break;
37552 _ref6 = _iterator4[_i4++];
37553 } else {
37554 _i4 = _iterator4.next();
37555 if (_i4.done) break;
37556 _ref6 = _i4.value;
37557 }
37558
37559 var _ref5 = _ref6;
37560 var _type3 = _ref5[0];
37561 var _deps = _ref5[1];
37562
37563 for (var _iterator6 = (0, (_keys || _load_keys()).default)(_deps), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
37564 var _ref8;
37565
37566 if (_isArray6) {
37567 if (_i6 >= _iterator6.length) break;
37568 _ref8 = _iterator6[_i6++];
37569 } else {
37570 _i6 = _iterator6.next();
37571 if (_i6.done) break;
37572 _ref8 = _i6.value;
37573 }
37574
37575 var _name = _ref8;
37576
37577 var _version2 = _deps[_name];
37578
37579 var dep = nonTrivialDeps.get(_name);
37580 if (dep) {
37581 if (_version2 && _version2 !== '*' && _version2 !== dep.version && isRoot) {
37582 // only throw a warning when at the root
37583 warn(reporter.lang('manifestDependencyCollision', dep.type, _name, dep.version, _type3, _version2));
37584 }
37585 _version2 = dep.version;
37586 }
37587
37588 if (setDeps.has(_name)) {
37589 delete _deps[_name];
37590 } else {
37591 _deps[_name] = _version2;
37592 setDeps.add(_name);
37593 }
37594 }
37595 }
37596}
37597
37598/***/ }),
37599/* 120 */
37600/***/ (function(module, exports) {
37601
37602var toString = {}.toString;
37603
37604module.exports = function (it) {
37605 return toString.call(it).slice(8, -1);
37606};
37607
37608
37609/***/ }),
37610/* 121 */
37611/***/ (function(module, exports, __webpack_require__) {
37612
37613var ctx = __webpack_require__(67);
37614var call = __webpack_require__(332);
37615var isArrayIter = __webpack_require__(330);
37616var anObject = __webpack_require__(58);
37617var toLength = __webpack_require__(161);
37618var getIterFn = __webpack_require__(231);
37619var BREAK = {};
37620var RETURN = {};
37621var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
37622 var iterFn = ITERATOR ? function () { return iterable; } : getIterFn(iterable);
37623 var f = ctx(fn, that, entries ? 2 : 1);
37624 var index = 0;
37625 var length, step, iterator, result;
37626 if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
37627 // fast case for arrays with default iterator
37628 if (isArrayIter(iterFn)) for (length = toLength(iterable.length); length > index; index++) {
37629 result = entries ? f(anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
37630 if (result === BREAK || result === RETURN) return result;
37631 } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
37632 result = call(iterator, f, step.value, entries);
37633 if (result === BREAK || result === RETURN) return result;
37634 }
37635};
37636exports.BREAK = BREAK;
37637exports.RETURN = RETURN;
37638
37639
37640/***/ }),
37641/* 122 */
37642/***/ (function(module, exports) {
37643
37644module.exports = {};
37645
37646
37647/***/ }),
37648/* 123 */
37649/***/ (function(module, exports) {
37650
37651module.exports = true;
37652
37653
37654/***/ }),
37655/* 124 */
37656/***/ (function(module, exports, __webpack_require__) {
37657
37658// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
37659var anObject = __webpack_require__(58);
37660var dPs = __webpack_require__(617);
37661var enumBugKeys = __webpack_require__(217);
37662var IE_PROTO = __webpack_require__(224)('IE_PROTO');
37663var Empty = function () { /* empty */ };
37664var PROTOTYPE = 'prototype';
37665
37666// Create object with fake `null` prototype: use iframe Object with cleared prototype
37667var createDict = function () {
37668 // Thrash, waste and sodomy: IE GC bug
37669 var iframe = __webpack_require__(216)('iframe');
37670 var i = enumBugKeys.length;
37671 var lt = '<';
37672 var gt = '>';
37673 var iframeDocument;
37674 iframe.style.display = 'none';
37675 __webpack_require__(327).appendChild(iframe);
37676 iframe.src = 'javascript:'; // eslint-disable-line no-script-url
37677 // createDict = iframe.contentWindow.Object;
37678 // html.removeChild(iframe);
37679 iframeDocument = iframe.contentWindow.document;
37680 iframeDocument.open();
37681 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
37682 iframeDocument.close();
37683 createDict = iframeDocument.F;
37684 while (i--) delete createDict[PROTOTYPE][enumBugKeys[i]];
37685 return createDict();
37686};
37687
37688module.exports = Object.create || function create(O, Properties) {
37689 var result;
37690 if (O !== null) {
37691 Empty[PROTOTYPE] = anObject(O);
37692 result = new Empty();
37693 Empty[PROTOTYPE] = null;
37694 // add "__proto__" for Object.getPrototypeOf polyfill
37695 result[IE_PROTO] = O;
37696 } else result = createDict();
37697 return Properties === undefined ? result : dPs(result, Properties);
37698};
37699
37700
37701/***/ }),
37702/* 125 */
37703/***/ (function(module, exports) {
37704
37705exports.f = {}.propertyIsEnumerable;
37706
37707
37708/***/ }),
37709/* 126 */
37710/***/ (function(module, exports) {
37711
37712module.exports = function (bitmap, value) {
37713 return {
37714 enumerable: !(bitmap & 1),
37715 configurable: !(bitmap & 2),
37716 writable: !(bitmap & 4),
37717 value: value
37718 };
37719};
37720
37721
37722/***/ }),
37723/* 127 */
37724/***/ (function(module, exports, __webpack_require__) {
37725
37726var def = __webpack_require__(63).f;
37727var has = __webpack_require__(89);
37728var TAG = __webpack_require__(44)('toStringTag');
37729
37730module.exports = function (it, tag, stat) {
37731 if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
37732};
37733
37734
37735/***/ }),
37736/* 128 */
37737/***/ (function(module, exports, __webpack_require__) {
37738
37739__webpack_require__(626);
37740var global = __webpack_require__(38);
37741var hide = __webpack_require__(77);
37742var Iterators = __webpack_require__(122);
37743var TO_STRING_TAG = __webpack_require__(44)('toStringTag');
37744
37745var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
37746 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
37747 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
37748 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
37749 'TextTrackList,TouchList').split(',');
37750
37751for (var i = 0; i < DOMIterables.length; i++) {
37752 var NAME = DOMIterables[i];
37753 var Collection = global[NAME];
37754 var proto = Collection && Collection.prototype;
37755 if (proto && !proto[TO_STRING_TAG]) hide(proto, TO_STRING_TAG, NAME);
37756 Iterators[NAME] = Iterators.Array;
37757}
37758
37759
37760/***/ }),
37761/* 129 */
37762/***/ (function(module, exports, __webpack_require__) {
37763
37764// Basic Javascript Elliptic Curve implementation
37765// Ported loosely from BouncyCastle's Java EC code
37766// Only Fp curves implemented for now
37767
37768// Requires jsbn.js and jsbn2.js
37769var BigInteger = __webpack_require__(79).BigInteger
37770var Barrett = BigInteger.prototype.Barrett
37771
37772// ----------------
37773// ECFieldElementFp
37774
37775// constructor
37776function ECFieldElementFp(q,x) {
37777 this.x = x;
37778 // TODO if(x.compareTo(q) >= 0) error
37779 this.q = q;
37780}
37781
37782function feFpEquals(other) {
37783 if(other == this) return true;
37784 return (this.q.equals(other.q) && this.x.equals(other.x));
37785}
37786
37787function feFpToBigInteger() {
37788 return this.x;
37789}
37790
37791function feFpNegate() {
37792 return new ECFieldElementFp(this.q, this.x.negate().mod(this.q));
37793}
37794
37795function feFpAdd(b) {
37796 return new ECFieldElementFp(this.q, this.x.add(b.toBigInteger()).mod(this.q));
37797}
37798
37799function feFpSubtract(b) {
37800 return new ECFieldElementFp(this.q, this.x.subtract(b.toBigInteger()).mod(this.q));
37801}
37802
37803function feFpMultiply(b) {
37804 return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger()).mod(this.q));
37805}
37806
37807function feFpSquare() {
37808 return new ECFieldElementFp(this.q, this.x.square().mod(this.q));
37809}
37810
37811function feFpDivide(b) {
37812 return new ECFieldElementFp(this.q, this.x.multiply(b.toBigInteger().modInverse(this.q)).mod(this.q));
37813}
37814
37815ECFieldElementFp.prototype.equals = feFpEquals;
37816ECFieldElementFp.prototype.toBigInteger = feFpToBigInteger;
37817ECFieldElementFp.prototype.negate = feFpNegate;
37818ECFieldElementFp.prototype.add = feFpAdd;
37819ECFieldElementFp.prototype.subtract = feFpSubtract;
37820ECFieldElementFp.prototype.multiply = feFpMultiply;
37821ECFieldElementFp.prototype.square = feFpSquare;
37822ECFieldElementFp.prototype.divide = feFpDivide;
37823
37824// ----------------
37825// ECPointFp
37826
37827// constructor
37828function ECPointFp(curve,x,y,z) {
37829 this.curve = curve;
37830 this.x = x;
37831 this.y = y;
37832 // Projective coordinates: either zinv == null or z * zinv == 1
37833 // z and zinv are just BigIntegers, not fieldElements
37834 if(z == null) {
37835 this.z = BigInteger.ONE;
37836 }
37837 else {
37838 this.z = z;
37839 }
37840 this.zinv = null;
37841 //TODO: compression flag
37842}
37843
37844function pointFpGetX() {
37845 if(this.zinv == null) {
37846 this.zinv = this.z.modInverse(this.curve.q);
37847 }
37848 var r = this.x.toBigInteger().multiply(this.zinv);
37849 this.curve.reduce(r);
37850 return this.curve.fromBigInteger(r);
37851}
37852
37853function pointFpGetY() {
37854 if(this.zinv == null) {
37855 this.zinv = this.z.modInverse(this.curve.q);
37856 }
37857 var r = this.y.toBigInteger().multiply(this.zinv);
37858 this.curve.reduce(r);
37859 return this.curve.fromBigInteger(r);
37860}
37861
37862function pointFpEquals(other) {
37863 if(other == this) return true;
37864 if(this.isInfinity()) return other.isInfinity();
37865 if(other.isInfinity()) return this.isInfinity();
37866 var u, v;
37867 // u = Y2 * Z1 - Y1 * Z2
37868 u = other.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(other.z)).mod(this.curve.q);
37869 if(!u.equals(BigInteger.ZERO)) return false;
37870 // v = X2 * Z1 - X1 * Z2
37871 v = other.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(other.z)).mod(this.curve.q);
37872 return v.equals(BigInteger.ZERO);
37873}
37874
37875function pointFpIsInfinity() {
37876 if((this.x == null) && (this.y == null)) return true;
37877 return this.z.equals(BigInteger.ZERO) && !this.y.toBigInteger().equals(BigInteger.ZERO);
37878}
37879
37880function pointFpNegate() {
37881 return new ECPointFp(this.curve, this.x, this.y.negate(), this.z);
37882}
37883
37884function pointFpAdd(b) {
37885 if(this.isInfinity()) return b;
37886 if(b.isInfinity()) return this;
37887
37888 // u = Y2 * Z1 - Y1 * Z2
37889 var u = b.y.toBigInteger().multiply(this.z).subtract(this.y.toBigInteger().multiply(b.z)).mod(this.curve.q);
37890 // v = X2 * Z1 - X1 * Z2
37891 var v = b.x.toBigInteger().multiply(this.z).subtract(this.x.toBigInteger().multiply(b.z)).mod(this.curve.q);
37892
37893 if(BigInteger.ZERO.equals(v)) {
37894 if(BigInteger.ZERO.equals(u)) {
37895 return this.twice(); // this == b, so double
37896 }
37897 return this.curve.getInfinity(); // this = -b, so infinity
37898 }
37899
37900 var THREE = new BigInteger("3");
37901 var x1 = this.x.toBigInteger();
37902 var y1 = this.y.toBigInteger();
37903 var x2 = b.x.toBigInteger();
37904 var y2 = b.y.toBigInteger();
37905
37906 var v2 = v.square();
37907 var v3 = v2.multiply(v);
37908 var x1v2 = x1.multiply(v2);
37909 var zu2 = u.square().multiply(this.z);
37910
37911 // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)
37912 var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.q);
37913 // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3
37914 var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.q);
37915 // z3 = v^3 * z1 * z2
37916 var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.q);
37917
37918 return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);
37919}
37920
37921function pointFpTwice() {
37922 if(this.isInfinity()) return this;
37923 if(this.y.toBigInteger().signum() == 0) return this.curve.getInfinity();
37924
37925 // TODO: optimized handling of constants
37926 var THREE = new BigInteger("3");
37927 var x1 = this.x.toBigInteger();
37928 var y1 = this.y.toBigInteger();
37929
37930 var y1z1 = y1.multiply(this.z);
37931 var y1sqz1 = y1z1.multiply(y1).mod(this.curve.q);
37932 var a = this.curve.a.toBigInteger();
37933
37934 // w = 3 * x1^2 + a * z1^2
37935 var w = x1.square().multiply(THREE);
37936 if(!BigInteger.ZERO.equals(a)) {
37937 w = w.add(this.z.square().multiply(a));
37938 }
37939 w = w.mod(this.curve.q);
37940 //this.curve.reduce(w);
37941 // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)
37942 var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.q);
37943 // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3
37944 var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.square().multiply(w)).mod(this.curve.q);
37945 // z3 = 8 * (y1 * z1)^3
37946 var z3 = y1z1.square().multiply(y1z1).shiftLeft(3).mod(this.curve.q);
37947
37948 return new ECPointFp(this.curve, this.curve.fromBigInteger(x3), this.curve.fromBigInteger(y3), z3);
37949}
37950
37951// Simple NAF (Non-Adjacent Form) multiplication algorithm
37952// TODO: modularize the multiplication algorithm
37953function pointFpMultiply(k) {
37954 if(this.isInfinity()) return this;
37955 if(k.signum() == 0) return this.curve.getInfinity();
37956
37957 var e = k;
37958 var h = e.multiply(new BigInteger("3"));
37959
37960 var neg = this.negate();
37961 var R = this;
37962
37963 var i;
37964 for(i = h.bitLength() - 2; i > 0; --i) {
37965 R = R.twice();
37966
37967 var hBit = h.testBit(i);
37968 var eBit = e.testBit(i);
37969
37970 if (hBit != eBit) {
37971 R = R.add(hBit ? this : neg);
37972 }
37973 }
37974
37975 return R;
37976}
37977
37978// Compute this*j + x*k (simultaneous multiplication)
37979function pointFpMultiplyTwo(j,x,k) {
37980 var i;
37981 if(j.bitLength() > k.bitLength())
37982 i = j.bitLength() - 1;
37983 else
37984 i = k.bitLength() - 1;
37985
37986 var R = this.curve.getInfinity();
37987 var both = this.add(x);
37988 while(i >= 0) {
37989 R = R.twice();
37990 if(j.testBit(i)) {
37991 if(k.testBit(i)) {
37992 R = R.add(both);
37993 }
37994 else {
37995 R = R.add(this);
37996 }
37997 }
37998 else {
37999 if(k.testBit(i)) {
38000 R = R.add(x);
38001 }
38002 }
38003 --i;
38004 }
38005
38006 return R;
38007}
38008
38009ECPointFp.prototype.getX = pointFpGetX;
38010ECPointFp.prototype.getY = pointFpGetY;
38011ECPointFp.prototype.equals = pointFpEquals;
38012ECPointFp.prototype.isInfinity = pointFpIsInfinity;
38013ECPointFp.prototype.negate = pointFpNegate;
38014ECPointFp.prototype.add = pointFpAdd;
38015ECPointFp.prototype.twice = pointFpTwice;
38016ECPointFp.prototype.multiply = pointFpMultiply;
38017ECPointFp.prototype.multiplyTwo = pointFpMultiplyTwo;
38018
38019// ----------------
38020// ECCurveFp
38021
38022// constructor
38023function ECCurveFp(q,a,b) {
38024 this.q = q;
38025 this.a = this.fromBigInteger(a);
38026 this.b = this.fromBigInteger(b);
38027 this.infinity = new ECPointFp(this, null, null);
38028 this.reducer = new Barrett(this.q);
38029}
38030
38031function curveFpGetQ() {
38032 return this.q;
38033}
38034
38035function curveFpGetA() {
38036 return this.a;
38037}
38038
38039function curveFpGetB() {
38040 return this.b;
38041}
38042
38043function curveFpEquals(other) {
38044 if(other == this) return true;
38045 return(this.q.equals(other.q) && this.a.equals(other.a) && this.b.equals(other.b));
38046}
38047
38048function curveFpGetInfinity() {
38049 return this.infinity;
38050}
38051
38052function curveFpFromBigInteger(x) {
38053 return new ECFieldElementFp(this.q, x);
38054}
38055
38056function curveReduce(x) {
38057 this.reducer.reduce(x);
38058}
38059
38060// for now, work with hex strings because they're easier in JS
38061function curveFpDecodePointHex(s) {
38062 switch(parseInt(s.substr(0,2), 16)) { // first byte
38063 case 0:
38064 return this.infinity;
38065 case 2:
38066 case 3:
38067 // point compression not supported yet
38068 return null;
38069 case 4:
38070 case 6:
38071 case 7:
38072 var len = (s.length - 2) / 2;
38073 var xHex = s.substr(2, len);
38074 var yHex = s.substr(len+2, len);
38075
38076 return new ECPointFp(this,
38077 this.fromBigInteger(new BigInteger(xHex, 16)),
38078 this.fromBigInteger(new BigInteger(yHex, 16)));
38079
38080 default: // unsupported
38081 return null;
38082 }
38083}
38084
38085function curveFpEncodePointHex(p) {
38086 if (p.isInfinity()) return "00";
38087 var xHex = p.getX().toBigInteger().toString(16);
38088 var yHex = p.getY().toBigInteger().toString(16);
38089 var oLen = this.getQ().toString(16).length;
38090 if ((oLen % 2) != 0) oLen++;
38091 while (xHex.length < oLen) {
38092 xHex = "0" + xHex;
38093 }
38094 while (yHex.length < oLen) {
38095 yHex = "0" + yHex;
38096 }
38097 return "04" + xHex + yHex;
38098}
38099
38100ECCurveFp.prototype.getQ = curveFpGetQ;
38101ECCurveFp.prototype.getA = curveFpGetA;
38102ECCurveFp.prototype.getB = curveFpGetB;
38103ECCurveFp.prototype.equals = curveFpEquals;
38104ECCurveFp.prototype.getInfinity = curveFpGetInfinity;
38105ECCurveFp.prototype.fromBigInteger = curveFpFromBigInteger;
38106ECCurveFp.prototype.reduce = curveReduce;
38107//ECCurveFp.prototype.decodePointHex = curveFpDecodePointHex;
38108ECCurveFp.prototype.encodePointHex = curveFpEncodePointHex;
38109
38110// from: https://github.com/kaielvin/jsbn-ec-point-compression
38111ECCurveFp.prototype.decodePointHex = function(s)
38112{
38113 var yIsEven;
38114 switch(parseInt(s.substr(0,2), 16)) { // first byte
38115 case 0:
38116 return this.infinity;
38117 case 2:
38118 yIsEven = false;
38119 case 3:
38120 if(yIsEven == undefined) yIsEven = true;
38121 var len = s.length - 2;
38122 var xHex = s.substr(2, len);
38123 var x = this.fromBigInteger(new BigInteger(xHex,16));
38124 var alpha = x.multiply(x.square().add(this.getA())).add(this.getB());
38125 var beta = alpha.sqrt();
38126
38127 if (beta == null) throw "Invalid point compression";
38128
38129 var betaValue = beta.toBigInteger();
38130 if (betaValue.testBit(0) != yIsEven)
38131 {
38132 // Use the other root
38133 beta = this.fromBigInteger(this.getQ().subtract(betaValue));
38134 }
38135 return new ECPointFp(this,x,beta);
38136 case 4:
38137 case 6:
38138 case 7:
38139 var len = (s.length - 2) / 2;
38140 var xHex = s.substr(2, len);
38141 var yHex = s.substr(len+2, len);
38142
38143 return new ECPointFp(this,
38144 this.fromBigInteger(new BigInteger(xHex, 16)),
38145 this.fromBigInteger(new BigInteger(yHex, 16)));
38146
38147 default: // unsupported
38148 return null;
38149 }
38150}
38151ECCurveFp.prototype.encodeCompressedPointHex = function(p)
38152{
38153 if (p.isInfinity()) return "00";
38154 var xHex = p.getX().toBigInteger().toString(16);
38155 var oLen = this.getQ().toString(16).length;
38156 if ((oLen % 2) != 0) oLen++;
38157 while (xHex.length < oLen)
38158 xHex = "0" + xHex;
38159 var yPrefix;
38160 if(p.getY().toBigInteger().isEven()) yPrefix = "02";
38161 else yPrefix = "03";
38162
38163 return yPrefix + xHex;
38164}
38165
38166
38167ECFieldElementFp.prototype.getR = function()
38168{
38169 if(this.r != undefined) return this.r;
38170
38171 this.r = null;
38172 var bitLength = this.q.bitLength();
38173 if (bitLength > 128)
38174 {
38175 var firstWord = this.q.shiftRight(bitLength - 64);
38176 if (firstWord.intValue() == -1)
38177 {
38178 this.r = BigInteger.ONE.shiftLeft(bitLength).subtract(this.q);
38179 }
38180 }
38181 return this.r;
38182}
38183ECFieldElementFp.prototype.modMult = function(x1,x2)
38184{
38185 return this.modReduce(x1.multiply(x2));
38186}
38187ECFieldElementFp.prototype.modReduce = function(x)
38188{
38189 if (this.getR() != null)
38190 {
38191 var qLen = q.bitLength();
38192 while (x.bitLength() > (qLen + 1))
38193 {
38194 var u = x.shiftRight(qLen);
38195 var v = x.subtract(u.shiftLeft(qLen));
38196 if (!this.getR().equals(BigInteger.ONE))
38197 {
38198 u = u.multiply(this.getR());
38199 }
38200 x = u.add(v);
38201 }
38202 while (x.compareTo(q) >= 0)
38203 {
38204 x = x.subtract(q);
38205 }
38206 }
38207 else
38208 {
38209 x = x.mod(q);
38210 }
38211 return x;
38212}
38213ECFieldElementFp.prototype.sqrt = function()
38214{
38215 if (!this.q.testBit(0)) throw "unsupported";
38216
38217 // p mod 4 == 3
38218 if (this.q.testBit(1))
38219 {
38220 var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q));
38221 return z.square().equals(this) ? z : null;
38222 }
38223
38224 // p mod 4 == 1
38225 var qMinusOne = this.q.subtract(BigInteger.ONE);
38226
38227 var legendreExponent = qMinusOne.shiftRight(1);
38228 if (!(this.x.modPow(legendreExponent, this.q).equals(BigInteger.ONE)))
38229 {
38230 return null;
38231 }
38232
38233 var u = qMinusOne.shiftRight(2);
38234 var k = u.shiftLeft(1).add(BigInteger.ONE);
38235
38236 var Q = this.x;
38237 var fourQ = modDouble(modDouble(Q));
38238
38239 var U, V;
38240 do
38241 {
38242 var P;
38243 do
38244 {
38245 P = new BigInteger(this.q.bitLength(), new SecureRandom());
38246 }
38247 while (P.compareTo(this.q) >= 0
38248 || !(P.multiply(P).subtract(fourQ).modPow(legendreExponent, this.q).equals(qMinusOne)));
38249
38250 var result = this.lucasSequence(P, Q, k);
38251 U = result[0];
38252 V = result[1];
38253
38254 if (this.modMult(V, V).equals(fourQ))
38255 {
38256 // Integer division by 2, mod q
38257 if (V.testBit(0))
38258 {
38259 V = V.add(q);
38260 }
38261
38262 V = V.shiftRight(1);
38263
38264 return new ECFieldElementFp(q,V);
38265 }
38266 }
38267 while (U.equals(BigInteger.ONE) || U.equals(qMinusOne));
38268
38269 return null;
38270}
38271ECFieldElementFp.prototype.lucasSequence = function(P,Q,k)
38272{
38273 var n = k.bitLength();
38274 var s = k.getLowestSetBit();
38275
38276 var Uh = BigInteger.ONE;
38277 var Vl = BigInteger.TWO;
38278 var Vh = P;
38279 var Ql = BigInteger.ONE;
38280 var Qh = BigInteger.ONE;
38281
38282 for (var j = n - 1; j >= s + 1; --j)
38283 {
38284 Ql = this.modMult(Ql, Qh);
38285
38286 if (k.testBit(j))
38287 {
38288 Qh = this.modMult(Ql, Q);
38289 Uh = this.modMult(Uh, Vh);
38290 Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));
38291 Vh = this.modReduce(Vh.multiply(Vh).subtract(Qh.shiftLeft(1)));
38292 }
38293 else
38294 {
38295 Qh = Ql;
38296 Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));
38297 Vh = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));
38298 Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));
38299 }
38300 }
38301
38302 Ql = this.modMult(Ql, Qh);
38303 Qh = this.modMult(Ql, Q);
38304 Uh = this.modReduce(Uh.multiply(Vl).subtract(Ql));
38305 Vl = this.modReduce(Vh.multiply(Vl).subtract(P.multiply(Ql)));
38306 Ql = this.modMult(Ql, Qh);
38307
38308 for (var j = 1; j <= s; ++j)
38309 {
38310 Uh = this.modMult(Uh, Vl);
38311 Vl = this.modReduce(Vl.multiply(Vl).subtract(Ql.shiftLeft(1)));
38312 Ql = this.modMult(Ql, Ql);
38313 }
38314
38315 return [ Uh, Vl ];
38316}
38317
38318var exports = {
38319 ECCurveFp: ECCurveFp,
38320 ECPointFp: ECPointFp,
38321 ECFieldElementFp: ECFieldElementFp
38322}
38323
38324module.exports = exports
38325
38326
38327/***/ }),
38328/* 130 */
38329/***/ (function(module, exports) {
38330
38331
38332module.exports = function(det, rec, confidence, name, lang) {
38333 this.confidence = confidence;
38334 this.name = name || rec.name(det);
38335 this.lang = lang;
38336};
38337
38338
38339/***/ }),
38340/* 131 */
38341/***/ (function(module, exports, __webpack_require__) {
38342
38343"use strict";
38344// YAML error class. http://stackoverflow.com/questions/8458984
38345//
38346
38347
38348function YAMLException(reason, mark) {
38349 // Super constructor
38350 Error.call(this);
38351
38352 this.name = 'YAMLException';
38353 this.reason = reason;
38354 this.mark = mark;
38355 this.message = (this.reason || '(unknown reason)') + (this.mark ? ' ' + this.mark.toString() : '');
38356
38357 // Include stack trace in error object
38358 if (Error.captureStackTrace) {
38359 // Chrome and NodeJS
38360 Error.captureStackTrace(this, this.constructor);
38361 } else {
38362 // FF, IE 10+ and Safari 6+. Fallback for others
38363 this.stack = (new Error()).stack || '';
38364 }
38365}
38366
38367
38368// Inherit from Error
38369YAMLException.prototype = Object.create(Error.prototype);
38370YAMLException.prototype.constructor = YAMLException;
38371
38372
38373YAMLException.prototype.toString = function toString(compact) {
38374 var result = this.name + ': ';
38375
38376 result += this.reason || '(unknown reason)';
38377
38378 if (!compact && this.mark) {
38379 result += ' ' + this.mark.toString();
38380 }
38381
38382 return result;
38383};
38384
38385
38386module.exports = YAMLException;
38387
38388
38389/***/ }),
38390/* 132 */
38391/***/ (function(module, exports, __webpack_require__) {
38392
38393"use strict";
38394// JS-YAML's default schema for `safeLoad` function.
38395// It is not described in the YAML specification.
38396//
38397// This schema is based on standard YAML's Core schema and includes most of
38398// extra types described at YAML tag repository. (http://yaml.org/type/)
38399
38400
38401
38402
38403
38404var Schema = __webpack_require__(108);
38405
38406
38407module.exports = new Schema({
38408 include: [
38409 __webpack_require__(368)
38410 ],
38411 implicit: [
38412 __webpack_require__(814),
38413 __webpack_require__(807)
38414 ],
38415 explicit: [
38416 __webpack_require__(799),
38417 __webpack_require__(809),
38418 __webpack_require__(810),
38419 __webpack_require__(812)
38420 ]
38421});
38422
38423
38424/***/ }),
38425/* 133 */
38426/***/ (function(module, exports, __webpack_require__) {
38427
38428var wrappy = __webpack_require__(436)
38429module.exports = wrappy(once)
38430module.exports.strict = wrappy(onceStrict)
38431
38432once.proto = once(function () {
38433 Object.defineProperty(Function.prototype, 'once', {
38434 value: function () {
38435 return once(this)
38436 },
38437 configurable: true
38438 })
38439
38440 Object.defineProperty(Function.prototype, 'onceStrict', {
38441 value: function () {
38442 return onceStrict(this)
38443 },
38444 configurable: true
38445 })
38446})
38447
38448function once (fn) {
38449 var f = function () {
38450 if (f.called) return f.value
38451 f.called = true
38452 return f.value = fn.apply(this, arguments)
38453 }
38454 f.called = false
38455 return f
38456}
38457
38458function onceStrict (fn) {
38459 var f = function () {
38460 if (f.called)
38461 throw new Error(f.onceError)
38462 f.called = true
38463 return f.value = fn.apply(this, arguments)
38464 }
38465 var name = fn.name || 'Function wrapped with `once`'
38466 f.onceError = name + " shouldn't be called more than once"
38467 f.called = false
38468 return f
38469}
38470
38471
38472/***/ }),
38473/* 134 */
38474/***/ (function(module, __webpack_exports__, __webpack_require__) {
38475
38476"use strict";
38477/* harmony export (immutable) */ __webpack_exports__["a"] = defaultIfEmpty;
38478/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
38479/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
38480/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
38481
38482
38483function defaultIfEmpty(defaultValue) {
38484 if (defaultValue === void 0) {
38485 defaultValue = null;
38486 }
38487 return function (source) { return source.lift(new DefaultIfEmptyOperator(defaultValue)); };
38488}
38489var DefaultIfEmptyOperator = /*@__PURE__*/ (function () {
38490 function DefaultIfEmptyOperator(defaultValue) {
38491 this.defaultValue = defaultValue;
38492 }
38493 DefaultIfEmptyOperator.prototype.call = function (subscriber, source) {
38494 return source.subscribe(new DefaultIfEmptySubscriber(subscriber, this.defaultValue));
38495 };
38496 return DefaultIfEmptyOperator;
38497}());
38498var DefaultIfEmptySubscriber = /*@__PURE__*/ (function (_super) {
38499 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DefaultIfEmptySubscriber, _super);
38500 function DefaultIfEmptySubscriber(destination, defaultValue) {
38501 var _this = _super.call(this, destination) || this;
38502 _this.defaultValue = defaultValue;
38503 _this.isEmpty = true;
38504 return _this;
38505 }
38506 DefaultIfEmptySubscriber.prototype._next = function (value) {
38507 this.isEmpty = false;
38508 this.destination.next(value);
38509 };
38510 DefaultIfEmptySubscriber.prototype._complete = function () {
38511 if (this.isEmpty) {
38512 this.destination.next(this.defaultValue);
38513 }
38514 this.destination.complete();
38515 };
38516 return DefaultIfEmptySubscriber;
38517}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
38518//# sourceMappingURL=defaultIfEmpty.js.map
38519
38520
38521/***/ }),
38522/* 135 */
38523/***/ (function(module, __webpack_exports__, __webpack_require__) {
38524
38525"use strict";
38526/* harmony export (immutable) */ __webpack_exports__["a"] = filter;
38527/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
38528/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
38529/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
38530
38531
38532function filter(predicate, thisArg) {
38533 return function filterOperatorFunction(source) {
38534 return source.lift(new FilterOperator(predicate, thisArg));
38535 };
38536}
38537var FilterOperator = /*@__PURE__*/ (function () {
38538 function FilterOperator(predicate, thisArg) {
38539 this.predicate = predicate;
38540 this.thisArg = thisArg;
38541 }
38542 FilterOperator.prototype.call = function (subscriber, source) {
38543 return source.subscribe(new FilterSubscriber(subscriber, this.predicate, this.thisArg));
38544 };
38545 return FilterOperator;
38546}());
38547var FilterSubscriber = /*@__PURE__*/ (function (_super) {
38548 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](FilterSubscriber, _super);
38549 function FilterSubscriber(destination, predicate, thisArg) {
38550 var _this = _super.call(this, destination) || this;
38551 _this.predicate = predicate;
38552 _this.thisArg = thisArg;
38553 _this.count = 0;
38554 return _this;
38555 }
38556 FilterSubscriber.prototype._next = function (value) {
38557 var result;
38558 try {
38559 result = this.predicate.call(this.thisArg, value, this.count++);
38560 }
38561 catch (err) {
38562 this.destination.error(err);
38563 return;
38564 }
38565 if (result) {
38566 this.destination.next(value);
38567 }
38568 };
38569 return FilterSubscriber;
38570}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
38571//# sourceMappingURL=filter.js.map
38572
38573
38574/***/ }),
38575/* 136 */
38576/***/ (function(module, __webpack_exports__, __webpack_require__) {
38577
38578"use strict";
38579/* harmony export (immutable) */ __webpack_exports__["a"] = mergeMap;
38580/* unused harmony export MergeMapOperator */
38581/* unused harmony export MergeMapSubscriber */
38582/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
38583/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_subscribeToResult__ = __webpack_require__(19);
38584/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__ = __webpack_require__(18);
38585/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__InnerSubscriber__ = __webpack_require__(80);
38586/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(54);
38587/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__observable_from__ = __webpack_require__(64);
38588/** PURE_IMPORTS_START tslib,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber,_map,_observable_from PURE_IMPORTS_END */
38589
38590
38591
38592
38593
38594
38595function mergeMap(project, resultSelector, concurrent) {
38596 if (concurrent === void 0) {
38597 concurrent = Number.POSITIVE_INFINITY;
38598 }
38599 if (typeof resultSelector === 'function') {
38600 return function (source) { return source.pipe(mergeMap(function (a, i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__observable_from__["a" /* from */])(project(a, i)).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__map__["a" /* map */])(function (b, ii) { return resultSelector(a, b, i, ii); })); }, concurrent)); };
38601 }
38602 else if (typeof resultSelector === 'number') {
38603 concurrent = resultSelector;
38604 }
38605 return function (source) { return source.lift(new MergeMapOperator(project, concurrent)); };
38606}
38607var MergeMapOperator = /*@__PURE__*/ (function () {
38608 function MergeMapOperator(project, concurrent) {
38609 if (concurrent === void 0) {
38610 concurrent = Number.POSITIVE_INFINITY;
38611 }
38612 this.project = project;
38613 this.concurrent = concurrent;
38614 }
38615 MergeMapOperator.prototype.call = function (observer, source) {
38616 return source.subscribe(new MergeMapSubscriber(observer, this.project, this.concurrent));
38617 };
38618 return MergeMapOperator;
38619}());
38620
38621var MergeMapSubscriber = /*@__PURE__*/ (function (_super) {
38622 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MergeMapSubscriber, _super);
38623 function MergeMapSubscriber(destination, project, concurrent) {
38624 if (concurrent === void 0) {
38625 concurrent = Number.POSITIVE_INFINITY;
38626 }
38627 var _this = _super.call(this, destination) || this;
38628 _this.project = project;
38629 _this.concurrent = concurrent;
38630 _this.hasCompleted = false;
38631 _this.buffer = [];
38632 _this.active = 0;
38633 _this.index = 0;
38634 return _this;
38635 }
38636 MergeMapSubscriber.prototype._next = function (value) {
38637 if (this.active < this.concurrent) {
38638 this._tryNext(value);
38639 }
38640 else {
38641 this.buffer.push(value);
38642 }
38643 };
38644 MergeMapSubscriber.prototype._tryNext = function (value) {
38645 var result;
38646 var index = this.index++;
38647 try {
38648 result = this.project(value, index);
38649 }
38650 catch (err) {
38651 this.destination.error(err);
38652 return;
38653 }
38654 this.active++;
38655 this._innerSub(result, value, index);
38656 };
38657 MergeMapSubscriber.prototype._innerSub = function (ish, value, index) {
38658 var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_3__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined);
38659 var destination = this.destination;
38660 destination.add(innerSubscriber);
38661 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_subscribeToResult__["a" /* subscribeToResult */])(this, ish, value, index, innerSubscriber);
38662 };
38663 MergeMapSubscriber.prototype._complete = function () {
38664 this.hasCompleted = true;
38665 if (this.active === 0 && this.buffer.length === 0) {
38666 this.destination.complete();
38667 }
38668 this.unsubscribe();
38669 };
38670 MergeMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
38671 this.destination.next(innerValue);
38672 };
38673 MergeMapSubscriber.prototype.notifyComplete = function (innerSub) {
38674 var buffer = this.buffer;
38675 this.remove(innerSub);
38676 this.active--;
38677 if (buffer.length > 0) {
38678 this._next(buffer.shift());
38679 }
38680 else if (this.active === 0 && this.hasCompleted) {
38681 this.destination.complete();
38682 }
38683 };
38684 return MergeMapSubscriber;
38685}(__WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__["a" /* OuterSubscriber */]));
38686
38687//# sourceMappingURL=mergeMap.js.map
38688
38689
38690/***/ }),
38691/* 137 */
38692/***/ (function(module, __webpack_exports__, __webpack_require__) {
38693
38694"use strict";
38695/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncAction; });
38696/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
38697/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Action__ = __webpack_require__(991);
38698/** PURE_IMPORTS_START tslib,_Action PURE_IMPORTS_END */
38699
38700
38701var AsyncAction = /*@__PURE__*/ (function (_super) {
38702 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsyncAction, _super);
38703 function AsyncAction(scheduler, work) {
38704 var _this = _super.call(this, scheduler, work) || this;
38705 _this.scheduler = scheduler;
38706 _this.work = work;
38707 _this.pending = false;
38708 return _this;
38709 }
38710 AsyncAction.prototype.schedule = function (state, delay) {
38711 if (delay === void 0) {
38712 delay = 0;
38713 }
38714 if (this.closed) {
38715 return this;
38716 }
38717 this.state = state;
38718 var id = this.id;
38719 var scheduler = this.scheduler;
38720 if (id != null) {
38721 this.id = this.recycleAsyncId(scheduler, id, delay);
38722 }
38723 this.pending = true;
38724 this.delay = delay;
38725 this.id = this.id || this.requestAsyncId(scheduler, this.id, delay);
38726 return this;
38727 };
38728 AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) {
38729 if (delay === void 0) {
38730 delay = 0;
38731 }
38732 return setInterval(scheduler.flush.bind(scheduler, this), delay);
38733 };
38734 AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
38735 if (delay === void 0) {
38736 delay = 0;
38737 }
38738 if (delay !== null && this.delay === delay && this.pending === false) {
38739 return id;
38740 }
38741 clearInterval(id);
38742 };
38743 AsyncAction.prototype.execute = function (state, delay) {
38744 if (this.closed) {
38745 return new Error('executing a cancelled action');
38746 }
38747 this.pending = false;
38748 var error = this._execute(state, delay);
38749 if (error) {
38750 return error;
38751 }
38752 else if (this.pending === false && this.id != null) {
38753 this.id = this.recycleAsyncId(this.scheduler, this.id, null);
38754 }
38755 };
38756 AsyncAction.prototype._execute = function (state, delay) {
38757 var errored = false;
38758 var errorValue = undefined;
38759 try {
38760 this.work(state);
38761 }
38762 catch (e) {
38763 errored = true;
38764 errorValue = !!e && e || new Error(e);
38765 }
38766 if (errored) {
38767 this.unsubscribe();
38768 return errorValue;
38769 }
38770 };
38771 AsyncAction.prototype._unsubscribe = function () {
38772 var id = this.id;
38773 var scheduler = this.scheduler;
38774 var actions = scheduler.actions;
38775 var index = actions.indexOf(this);
38776 this.work = null;
38777 this.state = null;
38778 this.pending = false;
38779 this.scheduler = null;
38780 if (index !== -1) {
38781 actions.splice(index, 1);
38782 }
38783 if (id != null) {
38784 this.id = this.recycleAsyncId(scheduler, id, null);
38785 }
38786 this.delay = null;
38787 };
38788 return AsyncAction;
38789}(__WEBPACK_IMPORTED_MODULE_1__Action__["a" /* Action */]));
38790
38791//# sourceMappingURL=AsyncAction.js.map
38792
38793
38794/***/ }),
38795/* 138 */
38796/***/ (function(module, __webpack_exports__, __webpack_require__) {
38797
38798"use strict";
38799/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncScheduler; });
38800/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
38801/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Scheduler__ = __webpack_require__(391);
38802/** PURE_IMPORTS_START tslib,_Scheduler PURE_IMPORTS_END */
38803
38804
38805var AsyncScheduler = /*@__PURE__*/ (function (_super) {
38806 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsyncScheduler, _super);
38807 function AsyncScheduler(SchedulerAction, now) {
38808 if (now === void 0) {
38809 now = __WEBPACK_IMPORTED_MODULE_1__Scheduler__["a" /* Scheduler */].now;
38810 }
38811 var _this = _super.call(this, SchedulerAction, function () {
38812 if (AsyncScheduler.delegate && AsyncScheduler.delegate !== _this) {
38813 return AsyncScheduler.delegate.now();
38814 }
38815 else {
38816 return now();
38817 }
38818 }) || this;
38819 _this.actions = [];
38820 _this.active = false;
38821 _this.scheduled = undefined;
38822 return _this;
38823 }
38824 AsyncScheduler.prototype.schedule = function (work, delay, state) {
38825 if (delay === void 0) {
38826 delay = 0;
38827 }
38828 if (AsyncScheduler.delegate && AsyncScheduler.delegate !== this) {
38829 return AsyncScheduler.delegate.schedule(work, delay, state);
38830 }
38831 else {
38832 return _super.prototype.schedule.call(this, work, delay, state);
38833 }
38834 };
38835 AsyncScheduler.prototype.flush = function (action) {
38836 var actions = this.actions;
38837 if (this.active) {
38838 actions.push(action);
38839 return;
38840 }
38841 var error;
38842 this.active = true;
38843 do {
38844 if (error = action.execute(action.state, action.delay)) {
38845 break;
38846 }
38847 } while (action = actions.shift());
38848 this.active = false;
38849 if (error) {
38850 while (action = actions.shift()) {
38851 action.unsubscribe();
38852 }
38853 throw error;
38854 }
38855 };
38856 return AsyncScheduler;
38857}(__WEBPACK_IMPORTED_MODULE_1__Scheduler__["a" /* Scheduler */]));
38858
38859//# sourceMappingURL=AsyncScheduler.js.map
38860
38861
38862/***/ }),
38863/* 139 */
38864/***/ (function(module, __webpack_exports__, __webpack_require__) {
38865
38866"use strict";
38867/* unused harmony export getSymbolIterator */
38868/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return iterator; });
38869/* unused harmony export $$iterator */
38870/** PURE_IMPORTS_START PURE_IMPORTS_END */
38871function getSymbolIterator() {
38872 if (typeof Symbol !== 'function' || !Symbol.iterator) {
38873 return '@@iterator';
38874 }
38875 return Symbol.iterator;
38876}
38877var iterator = /*@__PURE__*/ getSymbolIterator();
38878var $$iterator = iterator;
38879//# sourceMappingURL=iterator.js.map
38880
38881
38882/***/ }),
38883/* 140 */
38884/***/ (function(module, __webpack_exports__, __webpack_require__) {
38885
38886"use strict";
38887/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ArgumentOutOfRangeError; });
38888/** PURE_IMPORTS_START PURE_IMPORTS_END */
38889function ArgumentOutOfRangeErrorImpl() {
38890 Error.call(this);
38891 this.message = 'argument out of range';
38892 this.name = 'ArgumentOutOfRangeError';
38893 return this;
38894}
38895ArgumentOutOfRangeErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
38896var ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl;
38897//# sourceMappingURL=ArgumentOutOfRangeError.js.map
38898
38899
38900/***/ }),
38901/* 141 */
38902/***/ (function(module, __webpack_exports__, __webpack_require__) {
38903
38904"use strict";
38905/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return EmptyError; });
38906/** PURE_IMPORTS_START PURE_IMPORTS_END */
38907function EmptyErrorImpl() {
38908 Error.call(this);
38909 this.message = 'no elements in sequence';
38910 this.name = 'EmptyError';
38911 return this;
38912}
38913EmptyErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
38914var EmptyError = EmptyErrorImpl;
38915//# sourceMappingURL=EmptyError.js.map
38916
38917
38918/***/ }),
38919/* 142 */
38920/***/ (function(module, __webpack_exports__, __webpack_require__) {
38921
38922"use strict";
38923/* harmony export (immutable) */ __webpack_exports__["a"] = isFunction;
38924/** PURE_IMPORTS_START PURE_IMPORTS_END */
38925function isFunction(x) {
38926 return typeof x === 'function';
38927}
38928//# sourceMappingURL=isFunction.js.map
38929
38930
38931/***/ }),
38932/* 143 */
38933/***/ (function(module, exports, __webpack_require__) {
38934
38935// Copyright 2016 Joyent, Inc.
38936
38937module.exports = Certificate;
38938
38939var assert = __webpack_require__(22);
38940var Buffer = __webpack_require__(20).Buffer;
38941var algs = __webpack_require__(39);
38942var crypto = __webpack_require__(21);
38943var Fingerprint = __webpack_require__(144);
38944var Signature = __webpack_require__(70);
38945var errs = __webpack_require__(69);
38946var util = __webpack_require__(9);
38947var utils = __webpack_require__(32);
38948var Key = __webpack_require__(34);
38949var PrivateKey = __webpack_require__(40);
38950var Identity = __webpack_require__(146);
38951
38952var formats = {};
38953formats['openssh'] = __webpack_require__(1013);
38954formats['x509'] = __webpack_require__(427);
38955formats['pem'] = __webpack_require__(1014);
38956
38957var CertificateParseError = errs.CertificateParseError;
38958var InvalidAlgorithmError = errs.InvalidAlgorithmError;
38959
38960function Certificate(opts) {
38961 assert.object(opts, 'options');
38962 assert.arrayOfObject(opts.subjects, 'options.subjects');
38963 utils.assertCompatible(opts.subjects[0], Identity, [1, 0],
38964 'options.subjects');
38965 utils.assertCompatible(opts.subjectKey, Key, [1, 0],
38966 'options.subjectKey');
38967 utils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer');
38968 if (opts.issuerKey !== undefined) {
38969 utils.assertCompatible(opts.issuerKey, Key, [1, 0],
38970 'options.issuerKey');
38971 }
38972 assert.object(opts.signatures, 'options.signatures');
38973 assert.buffer(opts.serial, 'options.serial');
38974 assert.date(opts.validFrom, 'options.validFrom');
38975 assert.date(opts.validUntil, 'optons.validUntil');
38976
38977 assert.optionalArrayOfString(opts.purposes, 'options.purposes');
38978
38979 this._hashCache = {};
38980
38981 this.subjects = opts.subjects;
38982 this.issuer = opts.issuer;
38983 this.subjectKey = opts.subjectKey;
38984 this.issuerKey = opts.issuerKey;
38985 this.signatures = opts.signatures;
38986 this.serial = opts.serial;
38987 this.validFrom = opts.validFrom;
38988 this.validUntil = opts.validUntil;
38989 this.purposes = opts.purposes;
38990}
38991
38992Certificate.formats = formats;
38993
38994Certificate.prototype.toBuffer = function (format, options) {
38995 if (format === undefined)
38996 format = 'x509';
38997 assert.string(format, 'format');
38998 assert.object(formats[format], 'formats[format]');
38999 assert.optionalObject(options, 'options');
39000
39001 return (formats[format].write(this, options));
39002};
39003
39004Certificate.prototype.toString = function (format, options) {
39005 if (format === undefined)
39006 format = 'pem';
39007 return (this.toBuffer(format, options).toString());
39008};
39009
39010Certificate.prototype.fingerprint = function (algo) {
39011 if (algo === undefined)
39012 algo = 'sha256';
39013 assert.string(algo, 'algorithm');
39014 var opts = {
39015 type: 'certificate',
39016 hash: this.hash(algo),
39017 algorithm: algo
39018 };
39019 return (new Fingerprint(opts));
39020};
39021
39022Certificate.prototype.hash = function (algo) {
39023 assert.string(algo, 'algorithm');
39024 algo = algo.toLowerCase();
39025 if (algs.hashAlgs[algo] === undefined)
39026 throw (new InvalidAlgorithmError(algo));
39027
39028 if (this._hashCache[algo])
39029 return (this._hashCache[algo]);
39030
39031 var hash = crypto.createHash(algo).
39032 update(this.toBuffer('x509')).digest();
39033 this._hashCache[algo] = hash;
39034 return (hash);
39035};
39036
39037Certificate.prototype.isExpired = function (when) {
39038 if (when === undefined)
39039 when = new Date();
39040 return (!((when.getTime() >= this.validFrom.getTime()) &&
39041 (when.getTime() < this.validUntil.getTime())));
39042};
39043
39044Certificate.prototype.isSignedBy = function (issuerCert) {
39045 utils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer');
39046
39047 if (!this.issuer.equals(issuerCert.subjects[0]))
39048 return (false);
39049 if (this.issuer.purposes && this.issuer.purposes.length > 0 &&
39050 this.issuer.purposes.indexOf('ca') === -1) {
39051 return (false);
39052 }
39053
39054 return (this.isSignedByKey(issuerCert.subjectKey));
39055};
39056
39057Certificate.prototype.isSignedByKey = function (issuerKey) {
39058 utils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey');
39059
39060 if (this.issuerKey !== undefined) {
39061 return (this.issuerKey.
39062 fingerprint('sha512').matches(issuerKey));
39063 }
39064
39065 var fmt = Object.keys(this.signatures)[0];
39066 var valid = formats[fmt].verify(this, issuerKey);
39067 if (valid)
39068 this.issuerKey = issuerKey;
39069 return (valid);
39070};
39071
39072Certificate.prototype.signWith = function (key) {
39073 utils.assertCompatible(key, PrivateKey, [1, 2], 'key');
39074 var fmts = Object.keys(formats);
39075 var didOne = false;
39076 for (var i = 0; i < fmts.length; ++i) {
39077 if (fmts[i] !== 'pem') {
39078 var ret = formats[fmts[i]].sign(this, key);
39079 if (ret === true)
39080 didOne = true;
39081 }
39082 }
39083 if (!didOne) {
39084 throw (new Error('Failed to sign the certificate for any ' +
39085 'available certificate formats'));
39086 }
39087};
39088
39089Certificate.createSelfSigned = function (subjectOrSubjects, key, options) {
39090 var subjects;
39091 if (Array.isArray(subjectOrSubjects))
39092 subjects = subjectOrSubjects;
39093 else
39094 subjects = [subjectOrSubjects];
39095
39096 assert.arrayOfObject(subjects);
39097 subjects.forEach(function (subject) {
39098 utils.assertCompatible(subject, Identity, [1, 0], 'subject');
39099 });
39100
39101 utils.assertCompatible(key, PrivateKey, [1, 2], 'private key');
39102
39103 assert.optionalObject(options, 'options');
39104 if (options === undefined)
39105 options = {};
39106 assert.optionalObject(options.validFrom, 'options.validFrom');
39107 assert.optionalObject(options.validUntil, 'options.validUntil');
39108 var validFrom = options.validFrom;
39109 var validUntil = options.validUntil;
39110 if (validFrom === undefined)
39111 validFrom = new Date();
39112 if (validUntil === undefined) {
39113 assert.optionalNumber(options.lifetime, 'options.lifetime');
39114 var lifetime = options.lifetime;
39115 if (lifetime === undefined)
39116 lifetime = 10*365*24*3600;
39117 validUntil = new Date();
39118 validUntil.setTime(validUntil.getTime() + lifetime*1000);
39119 }
39120 assert.optionalBuffer(options.serial, 'options.serial');
39121 var serial = options.serial;
39122 if (serial === undefined)
39123 serial = Buffer.from('0000000000000001', 'hex');
39124
39125 var purposes = options.purposes;
39126 if (purposes === undefined)
39127 purposes = [];
39128
39129 if (purposes.indexOf('signature') === -1)
39130 purposes.push('signature');
39131
39132 /* Self-signed certs are always CAs. */
39133 if (purposes.indexOf('ca') === -1)
39134 purposes.push('ca');
39135 if (purposes.indexOf('crl') === -1)
39136 purposes.push('crl');
39137
39138 /*
39139 * If we weren't explicitly given any other purposes, do the sensible
39140 * thing and add some basic ones depending on the subject type.
39141 */
39142 if (purposes.length <= 3) {
39143 var hostSubjects = subjects.filter(function (subject) {
39144 return (subject.type === 'host');
39145 });
39146 var userSubjects = subjects.filter(function (subject) {
39147 return (subject.type === 'user');
39148 });
39149 if (hostSubjects.length > 0) {
39150 if (purposes.indexOf('serverAuth') === -1)
39151 purposes.push('serverAuth');
39152 }
39153 if (userSubjects.length > 0) {
39154 if (purposes.indexOf('clientAuth') === -1)
39155 purposes.push('clientAuth');
39156 }
39157 if (userSubjects.length > 0 || hostSubjects.length > 0) {
39158 if (purposes.indexOf('keyAgreement') === -1)
39159 purposes.push('keyAgreement');
39160 if (key.type === 'rsa' &&
39161 purposes.indexOf('encryption') === -1)
39162 purposes.push('encryption');
39163 }
39164 }
39165
39166 var cert = new Certificate({
39167 subjects: subjects,
39168 issuer: subjects[0],
39169 subjectKey: key.toPublic(),
39170 issuerKey: key.toPublic(),
39171 signatures: {},
39172 serial: serial,
39173 validFrom: validFrom,
39174 validUntil: validUntil,
39175 purposes: purposes
39176 });
39177 cert.signWith(key);
39178
39179 return (cert);
39180};
39181
39182Certificate.create =
39183 function (subjectOrSubjects, key, issuer, issuerKey, options) {
39184 var subjects;
39185 if (Array.isArray(subjectOrSubjects))
39186 subjects = subjectOrSubjects;
39187 else
39188 subjects = [subjectOrSubjects];
39189
39190 assert.arrayOfObject(subjects);
39191 subjects.forEach(function (subject) {
39192 utils.assertCompatible(subject, Identity, [1, 0], 'subject');
39193 });
39194
39195 utils.assertCompatible(key, Key, [1, 0], 'key');
39196 if (PrivateKey.isPrivateKey(key))
39197 key = key.toPublic();
39198 utils.assertCompatible(issuer, Identity, [1, 0], 'issuer');
39199 utils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key');
39200
39201 assert.optionalObject(options, 'options');
39202 if (options === undefined)
39203 options = {};
39204 assert.optionalObject(options.validFrom, 'options.validFrom');
39205 assert.optionalObject(options.validUntil, 'options.validUntil');
39206 var validFrom = options.validFrom;
39207 var validUntil = options.validUntil;
39208 if (validFrom === undefined)
39209 validFrom = new Date();
39210 if (validUntil === undefined) {
39211 assert.optionalNumber(options.lifetime, 'options.lifetime');
39212 var lifetime = options.lifetime;
39213 if (lifetime === undefined)
39214 lifetime = 10*365*24*3600;
39215 validUntil = new Date();
39216 validUntil.setTime(validUntil.getTime() + lifetime*1000);
39217 }
39218 assert.optionalBuffer(options.serial, 'options.serial');
39219 var serial = options.serial;
39220 if (serial === undefined)
39221 serial = Buffer.from('0000000000000001', 'hex');
39222
39223 var purposes = options.purposes;
39224 if (purposes === undefined)
39225 purposes = [];
39226
39227 if (purposes.indexOf('signature') === -1)
39228 purposes.push('signature');
39229
39230 if (options.ca === true) {
39231 if (purposes.indexOf('ca') === -1)
39232 purposes.push('ca');
39233 if (purposes.indexOf('crl') === -1)
39234 purposes.push('crl');
39235 }
39236
39237 var hostSubjects = subjects.filter(function (subject) {
39238 return (subject.type === 'host');
39239 });
39240 var userSubjects = subjects.filter(function (subject) {
39241 return (subject.type === 'user');
39242 });
39243 if (hostSubjects.length > 0) {
39244 if (purposes.indexOf('serverAuth') === -1)
39245 purposes.push('serverAuth');
39246 }
39247 if (userSubjects.length > 0) {
39248 if (purposes.indexOf('clientAuth') === -1)
39249 purposes.push('clientAuth');
39250 }
39251 if (userSubjects.length > 0 || hostSubjects.length > 0) {
39252 if (purposes.indexOf('keyAgreement') === -1)
39253 purposes.push('keyAgreement');
39254 if (key.type === 'rsa' &&
39255 purposes.indexOf('encryption') === -1)
39256 purposes.push('encryption');
39257 }
39258
39259 var cert = new Certificate({
39260 subjects: subjects,
39261 issuer: issuer,
39262 subjectKey: key,
39263 issuerKey: issuerKey.toPublic(),
39264 signatures: {},
39265 serial: serial,
39266 validFrom: validFrom,
39267 validUntil: validUntil,
39268 purposes: purposes
39269 });
39270 cert.signWith(issuerKey);
39271
39272 return (cert);
39273};
39274
39275Certificate.parse = function (data, format, options) {
39276 if (typeof (data) !== 'string')
39277 assert.buffer(data, 'data');
39278 if (format === undefined)
39279 format = 'auto';
39280 assert.string(format, 'format');
39281 if (typeof (options) === 'string')
39282 options = { filename: options };
39283 assert.optionalObject(options, 'options');
39284 if (options === undefined)
39285 options = {};
39286 assert.optionalString(options.filename, 'options.filename');
39287 if (options.filename === undefined)
39288 options.filename = '(unnamed)';
39289
39290 assert.object(formats[format], 'formats[format]');
39291
39292 try {
39293 var k = formats[format].read(data, options);
39294 return (k);
39295 } catch (e) {
39296 throw (new CertificateParseError(options.filename, format, e));
39297 }
39298};
39299
39300Certificate.isCertificate = function (obj, ver) {
39301 return (utils.isCompatible(obj, Certificate, ver));
39302};
39303
39304/*
39305 * API versions for Certificate:
39306 * [1,0] -- initial ver
39307 */
39308Certificate.prototype._sshpkApiVersion = [1, 0];
39309
39310Certificate._oldVersionDetect = function (obj) {
39311 return ([1, 0]);
39312};
39313
39314
39315/***/ }),
39316/* 144 */
39317/***/ (function(module, exports, __webpack_require__) {
39318
39319// Copyright 2015 Joyent, Inc.
39320
39321module.exports = Fingerprint;
39322
39323var assert = __webpack_require__(22);
39324var Buffer = __webpack_require__(20).Buffer;
39325var algs = __webpack_require__(39);
39326var crypto = __webpack_require__(21);
39327var errs = __webpack_require__(69);
39328var Key = __webpack_require__(34);
39329var Certificate = __webpack_require__(143);
39330var utils = __webpack_require__(32);
39331
39332var FingerprintFormatError = errs.FingerprintFormatError;
39333var InvalidAlgorithmError = errs.InvalidAlgorithmError;
39334
39335function Fingerprint(opts) {
39336 assert.object(opts, 'options');
39337 assert.string(opts.type, 'options.type');
39338 assert.buffer(opts.hash, 'options.hash');
39339 assert.string(opts.algorithm, 'options.algorithm');
39340
39341 this.algorithm = opts.algorithm.toLowerCase();
39342 if (algs.hashAlgs[this.algorithm] !== true)
39343 throw (new InvalidAlgorithmError(this.algorithm));
39344
39345 this.hash = opts.hash;
39346 this.type = opts.type;
39347}
39348
39349Fingerprint.prototype.toString = function (format) {
39350 if (format === undefined) {
39351 if (this.algorithm === 'md5')
39352 format = 'hex';
39353 else
39354 format = 'base64';
39355 }
39356 assert.string(format);
39357
39358 switch (format) {
39359 case 'hex':
39360 return (addColons(this.hash.toString('hex')));
39361 case 'base64':
39362 return (sshBase64Format(this.algorithm,
39363 this.hash.toString('base64')));
39364 default:
39365 throw (new FingerprintFormatError(undefined, format));
39366 }
39367};
39368
39369Fingerprint.prototype.matches = function (other) {
39370 assert.object(other, 'key or certificate');
39371 if (this.type === 'key') {
39372 utils.assertCompatible(other, Key, [1, 0], 'key');
39373 } else {
39374 utils.assertCompatible(other, Certificate, [1, 0],
39375 'certificate');
39376 }
39377
39378 var theirHash = other.hash(this.algorithm);
39379 var theirHash2 = crypto.createHash(this.algorithm).
39380 update(theirHash).digest('base64');
39381
39382 if (this.hash2 === undefined)
39383 this.hash2 = crypto.createHash(this.algorithm).
39384 update(this.hash).digest('base64');
39385
39386 return (this.hash2 === theirHash2);
39387};
39388
39389Fingerprint.parse = function (fp, options) {
39390 assert.string(fp, 'fingerprint');
39391
39392 var alg, hash, enAlgs;
39393 if (Array.isArray(options)) {
39394 enAlgs = options;
39395 options = {};
39396 }
39397 assert.optionalObject(options, 'options');
39398 if (options === undefined)
39399 options = {};
39400 if (options.enAlgs !== undefined)
39401 enAlgs = options.enAlgs;
39402 assert.optionalArrayOfString(enAlgs, 'algorithms');
39403
39404 var parts = fp.split(':');
39405 if (parts.length == 2) {
39406 alg = parts[0].toLowerCase();
39407 /*JSSTYLED*/
39408 var base64RE = /^[A-Za-z0-9+\/=]+$/;
39409 if (!base64RE.test(parts[1]))
39410 throw (new FingerprintFormatError(fp));
39411 try {
39412 hash = Buffer.from(parts[1], 'base64');
39413 } catch (e) {
39414 throw (new FingerprintFormatError(fp));
39415 }
39416 } else if (parts.length > 2) {
39417 alg = 'md5';
39418 if (parts[0].toLowerCase() === 'md5')
39419 parts = parts.slice(1);
39420 parts = parts.join('');
39421 /*JSSTYLED*/
39422 var md5RE = /^[a-fA-F0-9]+$/;
39423 if (!md5RE.test(parts))
39424 throw (new FingerprintFormatError(fp));
39425 try {
39426 hash = Buffer.from(parts, 'hex');
39427 } catch (e) {
39428 throw (new FingerprintFormatError(fp));
39429 }
39430 }
39431
39432 if (alg === undefined)
39433 throw (new FingerprintFormatError(fp));
39434
39435 if (algs.hashAlgs[alg] === undefined)
39436 throw (new InvalidAlgorithmError(alg));
39437
39438 if (enAlgs !== undefined) {
39439 enAlgs = enAlgs.map(function (a) { return a.toLowerCase(); });
39440 if (enAlgs.indexOf(alg) === -1)
39441 throw (new InvalidAlgorithmError(alg));
39442 }
39443
39444 return (new Fingerprint({
39445 algorithm: alg,
39446 hash: hash,
39447 type: options.type || 'key'
39448 }));
39449};
39450
39451function addColons(s) {
39452 /*JSSTYLED*/
39453 return (s.replace(/(.{2})(?=.)/g, '$1:'));
39454}
39455
39456function base64Strip(s) {
39457 /*JSSTYLED*/
39458 return (s.replace(/=*$/, ''));
39459}
39460
39461function sshBase64Format(alg, h) {
39462 return (alg.toUpperCase() + ':' + base64Strip(h));
39463}
39464
39465Fingerprint.isFingerprint = function (obj, ver) {
39466 return (utils.isCompatible(obj, Fingerprint, ver));
39467};
39468
39469/*
39470 * API versions for Fingerprint:
39471 * [1,0] -- initial ver
39472 * [1,1] -- first tagged ver
39473 */
39474Fingerprint.prototype._sshpkApiVersion = [1, 1];
39475
39476Fingerprint._oldVersionDetect = function (obj) {
39477 assert.func(obj.toString);
39478 assert.func(obj.matches);
39479 return ([1, 0]);
39480};
39481
39482
39483/***/ }),
39484/* 145 */
39485/***/ (function(module, exports, __webpack_require__) {
39486
39487// Copyright 2015 Joyent, Inc.
39488
39489module.exports = {
39490 read: read,
39491 readPkcs8: readPkcs8,
39492 write: write,
39493 writePkcs8: writePkcs8,
39494
39495 readECDSACurve: readECDSACurve,
39496 writeECDSACurve: writeECDSACurve
39497};
39498
39499var assert = __webpack_require__(22);
39500var asn1 = __webpack_require__(66);
39501var Buffer = __webpack_require__(20).Buffer;
39502var algs = __webpack_require__(39);
39503var utils = __webpack_require__(32);
39504var Key = __webpack_require__(34);
39505var PrivateKey = __webpack_require__(40);
39506var pem = __webpack_require__(82);
39507
39508function read(buf, options) {
39509 return (pem.read(buf, options, 'pkcs8'));
39510}
39511
39512function write(key, options) {
39513 return (pem.write(key, options, 'pkcs8'));
39514}
39515
39516/* Helper to read in a single mpint */
39517function readMPInt(der, nm) {
39518 assert.strictEqual(der.peek(), asn1.Ber.Integer,
39519 nm + ' is not an Integer');
39520 return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));
39521}
39522
39523function readPkcs8(alg, type, der) {
39524 /* Private keys in pkcs#8 format have a weird extra int */
39525 if (der.peek() === asn1.Ber.Integer) {
39526 assert.strictEqual(type, 'private',
39527 'unexpected Integer at start of public key');
39528 der.readString(asn1.Ber.Integer, true);
39529 }
39530
39531 der.readSequence();
39532 var next = der.offset + der.length;
39533
39534 var oid = der.readOID();
39535 switch (oid) {
39536 case '1.2.840.113549.1.1.1':
39537 der._offset = next;
39538 if (type === 'public')
39539 return (readPkcs8RSAPublic(der));
39540 else
39541 return (readPkcs8RSAPrivate(der));
39542 case '1.2.840.10040.4.1':
39543 if (type === 'public')
39544 return (readPkcs8DSAPublic(der));
39545 else
39546 return (readPkcs8DSAPrivate(der));
39547 case '1.2.840.10045.2.1':
39548 if (type === 'public')
39549 return (readPkcs8ECDSAPublic(der));
39550 else
39551 return (readPkcs8ECDSAPrivate(der));
39552 case '1.3.101.112':
39553 if (type === 'public') {
39554 return (readPkcs8EdDSAPublic(der));
39555 } else {
39556 return (readPkcs8EdDSAPrivate(der));
39557 }
39558 case '1.3.101.110':
39559 if (type === 'public') {
39560 return (readPkcs8X25519Public(der));
39561 } else {
39562 return (readPkcs8X25519Private(der));
39563 }
39564 default:
39565 throw (new Error('Unknown key type OID ' + oid));
39566 }
39567}
39568
39569function readPkcs8RSAPublic(der) {
39570 // bit string sequence
39571 der.readSequence(asn1.Ber.BitString);
39572 der.readByte();
39573 der.readSequence();
39574
39575 // modulus
39576 var n = readMPInt(der, 'modulus');
39577 var e = readMPInt(der, 'exponent');
39578
39579 // now, make the key
39580 var key = {
39581 type: 'rsa',
39582 source: der.originalInput,
39583 parts: [
39584 { name: 'e', data: e },
39585 { name: 'n', data: n }
39586 ]
39587 };
39588
39589 return (new Key(key));
39590}
39591
39592function readPkcs8RSAPrivate(der) {
39593 der.readSequence(asn1.Ber.OctetString);
39594 der.readSequence();
39595
39596 var ver = readMPInt(der, 'version');
39597 assert.equal(ver[0], 0x0, 'unknown RSA private key version');
39598
39599 // modulus then public exponent
39600 var n = readMPInt(der, 'modulus');
39601 var e = readMPInt(der, 'public exponent');
39602 var d = readMPInt(der, 'private exponent');
39603 var p = readMPInt(der, 'prime1');
39604 var q = readMPInt(der, 'prime2');
39605 var dmodp = readMPInt(der, 'exponent1');
39606 var dmodq = readMPInt(der, 'exponent2');
39607 var iqmp = readMPInt(der, 'iqmp');
39608
39609 // now, make the key
39610 var key = {
39611 type: 'rsa',
39612 parts: [
39613 { name: 'n', data: n },
39614 { name: 'e', data: e },
39615 { name: 'd', data: d },
39616 { name: 'iqmp', data: iqmp },
39617 { name: 'p', data: p },
39618 { name: 'q', data: q },
39619 { name: 'dmodp', data: dmodp },
39620 { name: 'dmodq', data: dmodq }
39621 ]
39622 };
39623
39624 return (new PrivateKey(key));
39625}
39626
39627function readPkcs8DSAPublic(der) {
39628 der.readSequence();
39629
39630 var p = readMPInt(der, 'p');
39631 var q = readMPInt(der, 'q');
39632 var g = readMPInt(der, 'g');
39633
39634 // bit string sequence
39635 der.readSequence(asn1.Ber.BitString);
39636 der.readByte();
39637
39638 var y = readMPInt(der, 'y');
39639
39640 // now, make the key
39641 var key = {
39642 type: 'dsa',
39643 parts: [
39644 { name: 'p', data: p },
39645 { name: 'q', data: q },
39646 { name: 'g', data: g },
39647 { name: 'y', data: y }
39648 ]
39649 };
39650
39651 return (new Key(key));
39652}
39653
39654function readPkcs8DSAPrivate(der) {
39655 der.readSequence();
39656
39657 var p = readMPInt(der, 'p');
39658 var q = readMPInt(der, 'q');
39659 var g = readMPInt(der, 'g');
39660
39661 der.readSequence(asn1.Ber.OctetString);
39662 var x = readMPInt(der, 'x');
39663
39664 /* The pkcs#8 format does not include the public key */
39665 var y = utils.calculateDSAPublic(g, p, x);
39666
39667 var key = {
39668 type: 'dsa',
39669 parts: [
39670 { name: 'p', data: p },
39671 { name: 'q', data: q },
39672 { name: 'g', data: g },
39673 { name: 'y', data: y },
39674 { name: 'x', data: x }
39675 ]
39676 };
39677
39678 return (new PrivateKey(key));
39679}
39680
39681function readECDSACurve(der) {
39682 var curveName, curveNames;
39683 var j, c, cd;
39684
39685 if (der.peek() === asn1.Ber.OID) {
39686 var oid = der.readOID();
39687
39688 curveNames = Object.keys(algs.curves);
39689 for (j = 0; j < curveNames.length; ++j) {
39690 c = curveNames[j];
39691 cd = algs.curves[c];
39692 if (cd.pkcs8oid === oid) {
39693 curveName = c;
39694 break;
39695 }
39696 }
39697
39698 } else {
39699 // ECParameters sequence
39700 der.readSequence();
39701 var version = der.readString(asn1.Ber.Integer, true);
39702 assert.strictEqual(version[0], 1, 'ECDSA key not version 1');
39703
39704 var curve = {};
39705
39706 // FieldID sequence
39707 der.readSequence();
39708 var fieldTypeOid = der.readOID();
39709 assert.strictEqual(fieldTypeOid, '1.2.840.10045.1.1',
39710 'ECDSA key is not from a prime-field');
39711 var p = curve.p = utils.mpNormalize(
39712 der.readString(asn1.Ber.Integer, true));
39713 /*
39714 * p always starts with a 1 bit, so count the zeros to get its
39715 * real size.
39716 */
39717 curve.size = p.length * 8 - utils.countZeros(p);
39718
39719 // Curve sequence
39720 der.readSequence();
39721 curve.a = utils.mpNormalize(
39722 der.readString(asn1.Ber.OctetString, true));
39723 curve.b = utils.mpNormalize(
39724 der.readString(asn1.Ber.OctetString, true));
39725 if (der.peek() === asn1.Ber.BitString)
39726 curve.s = der.readString(asn1.Ber.BitString, true);
39727
39728 // Combined Gx and Gy
39729 curve.G = der.readString(asn1.Ber.OctetString, true);
39730 assert.strictEqual(curve.G[0], 0x4,
39731 'uncompressed G is required');
39732
39733 curve.n = utils.mpNormalize(
39734 der.readString(asn1.Ber.Integer, true));
39735 curve.h = utils.mpNormalize(
39736 der.readString(asn1.Ber.Integer, true));
39737 assert.strictEqual(curve.h[0], 0x1, 'a cofactor=1 curve is ' +
39738 'required');
39739
39740 curveNames = Object.keys(algs.curves);
39741 var ks = Object.keys(curve);
39742 for (j = 0; j < curveNames.length; ++j) {
39743 c = curveNames[j];
39744 cd = algs.curves[c];
39745 var equal = true;
39746 for (var i = 0; i < ks.length; ++i) {
39747 var k = ks[i];
39748 if (cd[k] === undefined)
39749 continue;
39750 if (typeof (cd[k]) === 'object' &&
39751 cd[k].equals !== undefined) {
39752 if (!cd[k].equals(curve[k])) {
39753 equal = false;
39754 break;
39755 }
39756 } else if (Buffer.isBuffer(cd[k])) {
39757 if (cd[k].toString('binary')
39758 !== curve[k].toString('binary')) {
39759 equal = false;
39760 break;
39761 }
39762 } else {
39763 if (cd[k] !== curve[k]) {
39764 equal = false;
39765 break;
39766 }
39767 }
39768 }
39769 if (equal) {
39770 curveName = c;
39771 break;
39772 }
39773 }
39774 }
39775 return (curveName);
39776}
39777
39778function readPkcs8ECDSAPrivate(der) {
39779 var curveName = readECDSACurve(der);
39780 assert.string(curveName, 'a known elliptic curve');
39781
39782 der.readSequence(asn1.Ber.OctetString);
39783 der.readSequence();
39784
39785 var version = readMPInt(der, 'version');
39786 assert.equal(version[0], 1, 'unknown version of ECDSA key');
39787
39788 var d = der.readString(asn1.Ber.OctetString, true);
39789 der.readSequence(0xa1);
39790
39791 var Q = der.readString(asn1.Ber.BitString, true);
39792 Q = utils.ecNormalize(Q);
39793
39794 var key = {
39795 type: 'ecdsa',
39796 parts: [
39797 { name: 'curve', data: Buffer.from(curveName) },
39798 { name: 'Q', data: Q },
39799 { name: 'd', data: d }
39800 ]
39801 };
39802
39803 return (new PrivateKey(key));
39804}
39805
39806function readPkcs8ECDSAPublic(der) {
39807 var curveName = readECDSACurve(der);
39808 assert.string(curveName, 'a known elliptic curve');
39809
39810 var Q = der.readString(asn1.Ber.BitString, true);
39811 Q = utils.ecNormalize(Q);
39812
39813 var key = {
39814 type: 'ecdsa',
39815 parts: [
39816 { name: 'curve', data: Buffer.from(curveName) },
39817 { name: 'Q', data: Q }
39818 ]
39819 };
39820
39821 return (new Key(key));
39822}
39823
39824function readPkcs8EdDSAPublic(der) {
39825 if (der.peek() === 0x00)
39826 der.readByte();
39827
39828 var A = utils.readBitString(der);
39829
39830 var key = {
39831 type: 'ed25519',
39832 parts: [
39833 { name: 'A', data: utils.zeroPadToLength(A, 32) }
39834 ]
39835 };
39836
39837 return (new Key(key));
39838}
39839
39840function readPkcs8X25519Public(der) {
39841 var A = utils.readBitString(der);
39842
39843 var key = {
39844 type: 'curve25519',
39845 parts: [
39846 { name: 'A', data: utils.zeroPadToLength(A, 32) }
39847 ]
39848 };
39849
39850 return (new Key(key));
39851}
39852
39853function readPkcs8EdDSAPrivate(der) {
39854 if (der.peek() === 0x00)
39855 der.readByte();
39856
39857 der.readSequence(asn1.Ber.OctetString);
39858 var k = der.readString(asn1.Ber.OctetString, true);
39859 k = utils.zeroPadToLength(k, 32);
39860
39861 var A;
39862 if (der.peek() === asn1.Ber.BitString) {
39863 A = utils.readBitString(der);
39864 A = utils.zeroPadToLength(A, 32);
39865 } else {
39866 A = utils.calculateED25519Public(k);
39867 }
39868
39869 var key = {
39870 type: 'ed25519',
39871 parts: [
39872 { name: 'A', data: utils.zeroPadToLength(A, 32) },
39873 { name: 'k', data: utils.zeroPadToLength(k, 32) }
39874 ]
39875 };
39876
39877 return (new PrivateKey(key));
39878}
39879
39880function readPkcs8X25519Private(der) {
39881 if (der.peek() === 0x00)
39882 der.readByte();
39883
39884 der.readSequence(asn1.Ber.OctetString);
39885 var k = der.readString(asn1.Ber.OctetString, true);
39886 k = utils.zeroPadToLength(k, 32);
39887
39888 var A = utils.calculateX25519Public(k);
39889
39890 var key = {
39891 type: 'curve25519',
39892 parts: [
39893 { name: 'A', data: utils.zeroPadToLength(A, 32) },
39894 { name: 'k', data: utils.zeroPadToLength(k, 32) }
39895 ]
39896 };
39897
39898 return (new PrivateKey(key));
39899}
39900
39901function writePkcs8(der, key) {
39902 der.startSequence();
39903
39904 if (PrivateKey.isPrivateKey(key)) {
39905 var sillyInt = Buffer.from([0]);
39906 der.writeBuffer(sillyInt, asn1.Ber.Integer);
39907 }
39908
39909 der.startSequence();
39910 switch (key.type) {
39911 case 'rsa':
39912 der.writeOID('1.2.840.113549.1.1.1');
39913 if (PrivateKey.isPrivateKey(key))
39914 writePkcs8RSAPrivate(key, der);
39915 else
39916 writePkcs8RSAPublic(key, der);
39917 break;
39918 case 'dsa':
39919 der.writeOID('1.2.840.10040.4.1');
39920 if (PrivateKey.isPrivateKey(key))
39921 writePkcs8DSAPrivate(key, der);
39922 else
39923 writePkcs8DSAPublic(key, der);
39924 break;
39925 case 'ecdsa':
39926 der.writeOID('1.2.840.10045.2.1');
39927 if (PrivateKey.isPrivateKey(key))
39928 writePkcs8ECDSAPrivate(key, der);
39929 else
39930 writePkcs8ECDSAPublic(key, der);
39931 break;
39932 case 'ed25519':
39933 der.writeOID('1.3.101.112');
39934 if (PrivateKey.isPrivateKey(key))
39935 throw (new Error('Ed25519 private keys in pkcs8 ' +
39936 'format are not supported'));
39937 writePkcs8EdDSAPublic(key, der);
39938 break;
39939 default:
39940 throw (new Error('Unsupported key type: ' + key.type));
39941 }
39942
39943 der.endSequence();
39944}
39945
39946function writePkcs8RSAPrivate(key, der) {
39947 der.writeNull();
39948 der.endSequence();
39949
39950 der.startSequence(asn1.Ber.OctetString);
39951 der.startSequence();
39952
39953 var version = Buffer.from([0]);
39954 der.writeBuffer(version, asn1.Ber.Integer);
39955
39956 der.writeBuffer(key.part.n.data, asn1.Ber.Integer);
39957 der.writeBuffer(key.part.e.data, asn1.Ber.Integer);
39958 der.writeBuffer(key.part.d.data, asn1.Ber.Integer);
39959 der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
39960 der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
39961 if (!key.part.dmodp || !key.part.dmodq)
39962 utils.addRSAMissing(key);
39963 der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer);
39964 der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer);
39965 der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer);
39966
39967 der.endSequence();
39968 der.endSequence();
39969}
39970
39971function writePkcs8RSAPublic(key, der) {
39972 der.writeNull();
39973 der.endSequence();
39974
39975 der.startSequence(asn1.Ber.BitString);
39976 der.writeByte(0x00);
39977
39978 der.startSequence();
39979 der.writeBuffer(key.part.n.data, asn1.Ber.Integer);
39980 der.writeBuffer(key.part.e.data, asn1.Ber.Integer);
39981 der.endSequence();
39982
39983 der.endSequence();
39984}
39985
39986function writePkcs8DSAPrivate(key, der) {
39987 der.startSequence();
39988 der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
39989 der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
39990 der.writeBuffer(key.part.g.data, asn1.Ber.Integer);
39991 der.endSequence();
39992
39993 der.endSequence();
39994
39995 der.startSequence(asn1.Ber.OctetString);
39996 der.writeBuffer(key.part.x.data, asn1.Ber.Integer);
39997 der.endSequence();
39998}
39999
40000function writePkcs8DSAPublic(key, der) {
40001 der.startSequence();
40002 der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
40003 der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
40004 der.writeBuffer(key.part.g.data, asn1.Ber.Integer);
40005 der.endSequence();
40006 der.endSequence();
40007
40008 der.startSequence(asn1.Ber.BitString);
40009 der.writeByte(0x00);
40010 der.writeBuffer(key.part.y.data, asn1.Ber.Integer);
40011 der.endSequence();
40012}
40013
40014function writeECDSACurve(key, der) {
40015 var curve = algs.curves[key.curve];
40016 if (curve.pkcs8oid) {
40017 /* This one has a name in pkcs#8, so just write the oid */
40018 der.writeOID(curve.pkcs8oid);
40019
40020 } else {
40021 // ECParameters sequence
40022 der.startSequence();
40023
40024 var version = Buffer.from([1]);
40025 der.writeBuffer(version, asn1.Ber.Integer);
40026
40027 // FieldID sequence
40028 der.startSequence();
40029 der.writeOID('1.2.840.10045.1.1'); // prime-field
40030 der.writeBuffer(curve.p, asn1.Ber.Integer);
40031 der.endSequence();
40032
40033 // Curve sequence
40034 der.startSequence();
40035 var a = curve.p;
40036 if (a[0] === 0x0)
40037 a = a.slice(1);
40038 der.writeBuffer(a, asn1.Ber.OctetString);
40039 der.writeBuffer(curve.b, asn1.Ber.OctetString);
40040 der.writeBuffer(curve.s, asn1.Ber.BitString);
40041 der.endSequence();
40042
40043 der.writeBuffer(curve.G, asn1.Ber.OctetString);
40044 der.writeBuffer(curve.n, asn1.Ber.Integer);
40045 var h = curve.h;
40046 if (!h) {
40047 h = Buffer.from([1]);
40048 }
40049 der.writeBuffer(h, asn1.Ber.Integer);
40050
40051 // ECParameters
40052 der.endSequence();
40053 }
40054}
40055
40056function writePkcs8ECDSAPublic(key, der) {
40057 writeECDSACurve(key, der);
40058 der.endSequence();
40059
40060 var Q = utils.ecNormalize(key.part.Q.data, true);
40061 der.writeBuffer(Q, asn1.Ber.BitString);
40062}
40063
40064function writePkcs8ECDSAPrivate(key, der) {
40065 writeECDSACurve(key, der);
40066 der.endSequence();
40067
40068 der.startSequence(asn1.Ber.OctetString);
40069 der.startSequence();
40070
40071 var version = Buffer.from([1]);
40072 der.writeBuffer(version, asn1.Ber.Integer);
40073
40074 der.writeBuffer(key.part.d.data, asn1.Ber.OctetString);
40075
40076 der.startSequence(0xa1);
40077 var Q = utils.ecNormalize(key.part.Q.data, true);
40078 der.writeBuffer(Q, asn1.Ber.BitString);
40079 der.endSequence();
40080
40081 der.endSequence();
40082 der.endSequence();
40083}
40084
40085function writePkcs8EdDSAPublic(key, der) {
40086 der.endSequence();
40087
40088 utils.writeBitString(der, key.part.A.data);
40089}
40090
40091function writePkcs8EdDSAPrivate(key, der) {
40092 der.endSequence();
40093
40094 var k = utils.mpNormalize(key.part.k.data, true);
40095 der.startSequence(asn1.Ber.OctetString);
40096 der.writeBuffer(k, asn1.Ber.OctetString);
40097 der.endSequence();
40098}
40099
40100
40101/***/ }),
40102/* 146 */
40103/***/ (function(module, exports, __webpack_require__) {
40104
40105// Copyright 2017 Joyent, Inc.
40106
40107module.exports = Identity;
40108
40109var assert = __webpack_require__(22);
40110var algs = __webpack_require__(39);
40111var crypto = __webpack_require__(21);
40112var Fingerprint = __webpack_require__(144);
40113var Signature = __webpack_require__(70);
40114var errs = __webpack_require__(69);
40115var util = __webpack_require__(9);
40116var utils = __webpack_require__(32);
40117var asn1 = __webpack_require__(66);
40118var Buffer = __webpack_require__(20).Buffer;
40119
40120/*JSSTYLED*/
40121var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i;
40122
40123var oids = {};
40124oids.cn = '2.5.4.3';
40125oids.o = '2.5.4.10';
40126oids.ou = '2.5.4.11';
40127oids.l = '2.5.4.7';
40128oids.s = '2.5.4.8';
40129oids.c = '2.5.4.6';
40130oids.sn = '2.5.4.4';
40131oids.dc = '0.9.2342.19200300.100.1.25';
40132oids.uid = '0.9.2342.19200300.100.1.1';
40133oids.mail = '0.9.2342.19200300.100.1.3';
40134
40135var unoids = {};
40136Object.keys(oids).forEach(function (k) {
40137 unoids[oids[k]] = k;
40138});
40139
40140function Identity(opts) {
40141 var self = this;
40142 assert.object(opts, 'options');
40143 assert.arrayOfObject(opts.components, 'options.components');
40144 this.components = opts.components;
40145 this.componentLookup = {};
40146 this.components.forEach(function (c) {
40147 if (c.name && !c.oid)
40148 c.oid = oids[c.name];
40149 if (c.oid && !c.name)
40150 c.name = unoids[c.oid];
40151 if (self.componentLookup[c.name] === undefined)
40152 self.componentLookup[c.name] = [];
40153 self.componentLookup[c.name].push(c);
40154 });
40155 if (this.componentLookup.cn && this.componentLookup.cn.length > 0) {
40156 this.cn = this.componentLookup.cn[0].value;
40157 }
40158 assert.optionalString(opts.type, 'options.type');
40159 if (opts.type === undefined) {
40160 if (this.components.length === 1 &&
40161 this.componentLookup.cn &&
40162 this.componentLookup.cn.length === 1 &&
40163 this.componentLookup.cn[0].value.match(DNS_NAME_RE)) {
40164 this.type = 'host';
40165 this.hostname = this.componentLookup.cn[0].value;
40166
40167 } else if (this.componentLookup.dc &&
40168 this.components.length === this.componentLookup.dc.length) {
40169 this.type = 'host';
40170 this.hostname = this.componentLookup.dc.map(
40171 function (c) {
40172 return (c.value);
40173 }).join('.');
40174
40175 } else if (this.componentLookup.uid &&
40176 this.components.length ===
40177 this.componentLookup.uid.length) {
40178 this.type = 'user';
40179 this.uid = this.componentLookup.uid[0].value;
40180
40181 } else if (this.componentLookup.cn &&
40182 this.componentLookup.cn.length === 1 &&
40183 this.componentLookup.cn[0].value.match(DNS_NAME_RE)) {
40184 this.type = 'host';
40185 this.hostname = this.componentLookup.cn[0].value;
40186
40187 } else if (this.componentLookup.uid &&
40188 this.componentLookup.uid.length === 1) {
40189 this.type = 'user';
40190 this.uid = this.componentLookup.uid[0].value;
40191
40192 } else if (this.componentLookup.mail &&
40193 this.componentLookup.mail.length === 1) {
40194 this.type = 'email';
40195 this.email = this.componentLookup.mail[0].value;
40196
40197 } else if (this.componentLookup.cn &&
40198 this.componentLookup.cn.length === 1) {
40199 this.type = 'user';
40200 this.uid = this.componentLookup.cn[0].value;
40201
40202 } else {
40203 this.type = 'unknown';
40204 }
40205 } else {
40206 this.type = opts.type;
40207 if (this.type === 'host')
40208 this.hostname = opts.hostname;
40209 else if (this.type === 'user')
40210 this.uid = opts.uid;
40211 else if (this.type === 'email')
40212 this.email = opts.email;
40213 else
40214 throw (new Error('Unknown type ' + this.type));
40215 }
40216}
40217
40218Identity.prototype.toString = function () {
40219 return (this.components.map(function (c) {
40220 return (c.name.toUpperCase() + '=' + c.value);
40221 }).join(', '));
40222};
40223
40224/*
40225 * These are from X.680 -- PrintableString allowed chars are in section 37.4
40226 * table 8. Spec for IA5Strings is "1,6 + SPACE + DEL" where 1 refers to
40227 * ISO IR #001 (standard ASCII control characters) and 6 refers to ISO IR #006
40228 * (the basic ASCII character set).
40229 */
40230/* JSSTYLED */
40231var NOT_PRINTABLE = /[^a-zA-Z0-9 '(),+.\/:=?-]/;
40232/* JSSTYLED */
40233var NOT_IA5 = /[^\x00-\x7f]/;
40234
40235Identity.prototype.toAsn1 = function (der, tag) {
40236 der.startSequence(tag);
40237 this.components.forEach(function (c) {
40238 der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set);
40239 der.startSequence();
40240 der.writeOID(c.oid);
40241 /*
40242 * If we fit in a PrintableString, use that. Otherwise use an
40243 * IA5String or UTF8String.
40244 *
40245 * If this identity was parsed from a DN, use the ASN.1 types
40246 * from the original representation (otherwise this might not
40247 * be a full match for the original in some validators).
40248 */
40249 if (c.asn1type === asn1.Ber.Utf8String ||
40250 c.value.match(NOT_IA5)) {
40251 var v = Buffer.from(c.value, 'utf8');
40252 der.writeBuffer(v, asn1.Ber.Utf8String);
40253
40254 } else if (c.asn1type === asn1.Ber.IA5String ||
40255 c.value.match(NOT_PRINTABLE)) {
40256 der.writeString(c.value, asn1.Ber.IA5String);
40257
40258 } else {
40259 var type = asn1.Ber.PrintableString;
40260 if (c.asn1type !== undefined)
40261 type = c.asn1type;
40262 der.writeString(c.value, type);
40263 }
40264 der.endSequence();
40265 der.endSequence();
40266 });
40267 der.endSequence();
40268};
40269
40270function globMatch(a, b) {
40271 if (a === '**' || b === '**')
40272 return (true);
40273 var aParts = a.split('.');
40274 var bParts = b.split('.');
40275 if (aParts.length !== bParts.length)
40276 return (false);
40277 for (var i = 0; i < aParts.length; ++i) {
40278 if (aParts[i] === '*' || bParts[i] === '*')
40279 continue;
40280 if (aParts[i] !== bParts[i])
40281 return (false);
40282 }
40283 return (true);
40284}
40285
40286Identity.prototype.equals = function (other) {
40287 if (!Identity.isIdentity(other, [1, 0]))
40288 return (false);
40289 if (other.components.length !== this.components.length)
40290 return (false);
40291 for (var i = 0; i < this.components.length; ++i) {
40292 if (this.components[i].oid !== other.components[i].oid)
40293 return (false);
40294 if (!globMatch(this.components[i].value,
40295 other.components[i].value)) {
40296 return (false);
40297 }
40298 }
40299 return (true);
40300};
40301
40302Identity.forHost = function (hostname) {
40303 assert.string(hostname, 'hostname');
40304 return (new Identity({
40305 type: 'host',
40306 hostname: hostname,
40307 components: [ { name: 'cn', value: hostname } ]
40308 }));
40309};
40310
40311Identity.forUser = function (uid) {
40312 assert.string(uid, 'uid');
40313 return (new Identity({
40314 type: 'user',
40315 uid: uid,
40316 components: [ { name: 'uid', value: uid } ]
40317 }));
40318};
40319
40320Identity.forEmail = function (email) {
40321 assert.string(email, 'email');
40322 return (new Identity({
40323 type: 'email',
40324 email: email,
40325 components: [ { name: 'mail', value: email } ]
40326 }));
40327};
40328
40329Identity.parseDN = function (dn) {
40330 assert.string(dn, 'dn');
40331 var parts = dn.split(',');
40332 var cmps = parts.map(function (c) {
40333 c = c.trim();
40334 var eqPos = c.indexOf('=');
40335 var name = c.slice(0, eqPos).toLowerCase();
40336 var value = c.slice(eqPos + 1);
40337 return ({ name: name, value: value });
40338 });
40339 return (new Identity({ components: cmps }));
40340};
40341
40342Identity.parseAsn1 = function (der, top) {
40343 var components = [];
40344 der.readSequence(top);
40345 var end = der.offset + der.length;
40346 while (der.offset < end) {
40347 der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set);
40348 var after = der.offset + der.length;
40349 der.readSequence();
40350 var oid = der.readOID();
40351 var type = der.peek();
40352 var value;
40353 switch (type) {
40354 case asn1.Ber.PrintableString:
40355 case asn1.Ber.IA5String:
40356 case asn1.Ber.OctetString:
40357 case asn1.Ber.T61String:
40358 value = der.readString(type);
40359 break;
40360 case asn1.Ber.Utf8String:
40361 value = der.readString(type, true);
40362 value = value.toString('utf8');
40363 break;
40364 case asn1.Ber.CharacterString:
40365 case asn1.Ber.BMPString:
40366 value = der.readString(type, true);
40367 value = value.toString('utf16le');
40368 break;
40369 default:
40370 throw (new Error('Unknown asn1 type ' + type));
40371 }
40372 components.push({ oid: oid, asn1type: type, value: value });
40373 der._offset = after;
40374 }
40375 der._offset = end;
40376 return (new Identity({
40377 components: components
40378 }));
40379};
40380
40381Identity.isIdentity = function (obj, ver) {
40382 return (utils.isCompatible(obj, Identity, ver));
40383};
40384
40385/*
40386 * API versions for Identity:
40387 * [1,0] -- initial ver
40388 */
40389Identity.prototype._sshpkApiVersion = [1, 0];
40390
40391Identity._oldVersionDetect = function (obj) {
40392 return ([1, 0]);
40393};
40394
40395
40396/***/ }),
40397/* 147 */
40398/***/ (function(module, exports, __webpack_require__) {
40399
40400// Copyright 2015 Joyent, Inc.
40401
40402module.exports = SSHBuffer;
40403
40404var assert = __webpack_require__(22);
40405var Buffer = __webpack_require__(20).Buffer;
40406
40407function SSHBuffer(opts) {
40408 assert.object(opts, 'options');
40409 if (opts.buffer !== undefined)
40410 assert.buffer(opts.buffer, 'options.buffer');
40411
40412 this._size = opts.buffer ? opts.buffer.length : 1024;
40413 this._buffer = opts.buffer || Buffer.alloc(this._size);
40414 this._offset = 0;
40415}
40416
40417SSHBuffer.prototype.toBuffer = function () {
40418 return (this._buffer.slice(0, this._offset));
40419};
40420
40421SSHBuffer.prototype.atEnd = function () {
40422 return (this._offset >= this._buffer.length);
40423};
40424
40425SSHBuffer.prototype.remainder = function () {
40426 return (this._buffer.slice(this._offset));
40427};
40428
40429SSHBuffer.prototype.skip = function (n) {
40430 this._offset += n;
40431};
40432
40433SSHBuffer.prototype.expand = function () {
40434 this._size *= 2;
40435 var buf = Buffer.alloc(this._size);
40436 this._buffer.copy(buf, 0);
40437 this._buffer = buf;
40438};
40439
40440SSHBuffer.prototype.readPart = function () {
40441 return ({data: this.readBuffer()});
40442};
40443
40444SSHBuffer.prototype.readBuffer = function () {
40445 var len = this._buffer.readUInt32BE(this._offset);
40446 this._offset += 4;
40447 assert.ok(this._offset + len <= this._buffer.length,
40448 'length out of bounds at +0x' + this._offset.toString(16) +
40449 ' (data truncated?)');
40450 var buf = this._buffer.slice(this._offset, this._offset + len);
40451 this._offset += len;
40452 return (buf);
40453};
40454
40455SSHBuffer.prototype.readString = function () {
40456 return (this.readBuffer().toString());
40457};
40458
40459SSHBuffer.prototype.readCString = function () {
40460 var offset = this._offset;
40461 while (offset < this._buffer.length &&
40462 this._buffer[offset] !== 0x00)
40463 offset++;
40464 assert.ok(offset < this._buffer.length, 'c string does not terminate');
40465 var str = this._buffer.slice(this._offset, offset).toString();
40466 this._offset = offset + 1;
40467 return (str);
40468};
40469
40470SSHBuffer.prototype.readInt = function () {
40471 var v = this._buffer.readUInt32BE(this._offset);
40472 this._offset += 4;
40473 return (v);
40474};
40475
40476SSHBuffer.prototype.readInt64 = function () {
40477 assert.ok(this._offset + 8 < this._buffer.length,
40478 'buffer not long enough to read Int64');
40479 var v = this._buffer.slice(this._offset, this._offset + 8);
40480 this._offset += 8;
40481 return (v);
40482};
40483
40484SSHBuffer.prototype.readChar = function () {
40485 var v = this._buffer[this._offset++];
40486 return (v);
40487};
40488
40489SSHBuffer.prototype.writeBuffer = function (buf) {
40490 while (this._offset + 4 + buf.length > this._size)
40491 this.expand();
40492 this._buffer.writeUInt32BE(buf.length, this._offset);
40493 this._offset += 4;
40494 buf.copy(this._buffer, this._offset);
40495 this._offset += buf.length;
40496};
40497
40498SSHBuffer.prototype.writeString = function (str) {
40499 this.writeBuffer(Buffer.from(str, 'utf8'));
40500};
40501
40502SSHBuffer.prototype.writeCString = function (str) {
40503 while (this._offset + 1 + str.length > this._size)
40504 this.expand();
40505 this._buffer.write(str, this._offset);
40506 this._offset += str.length;
40507 this._buffer[this._offset++] = 0;
40508};
40509
40510SSHBuffer.prototype.writeInt = function (v) {
40511 while (this._offset + 4 > this._size)
40512 this.expand();
40513 this._buffer.writeUInt32BE(v, this._offset);
40514 this._offset += 4;
40515};
40516
40517SSHBuffer.prototype.writeInt64 = function (v) {
40518 assert.buffer(v, 'value');
40519 if (v.length > 8) {
40520 var lead = v.slice(0, v.length - 8);
40521 for (var i = 0; i < lead.length; ++i) {
40522 assert.strictEqual(lead[i], 0,
40523 'must fit in 64 bits of precision');
40524 }
40525 v = v.slice(v.length - 8, v.length);
40526 }
40527 while (this._offset + 8 > this._size)
40528 this.expand();
40529 v.copy(this._buffer, this._offset);
40530 this._offset += 8;
40531};
40532
40533SSHBuffer.prototype.writeChar = function (v) {
40534 while (this._offset + 1 > this._size)
40535 this.expand();
40536 this._buffer[this._offset++] = v;
40537};
40538
40539SSHBuffer.prototype.writePart = function (p) {
40540 this.writeBuffer(p.data);
40541};
40542
40543SSHBuffer.prototype.write = function (buf) {
40544 while (this._offset + buf.length > this._size)
40545 this.expand();
40546 buf.copy(this._buffer, this._offset);
40547 this._offset += buf.length;
40548};
40549
40550
40551/***/ }),
40552/* 148 */
40553/***/ (function(module, exports) {
40554
40555module.exports = require("tty");
40556
40557/***/ }),
40558/* 149 */
40559/***/ (function(module, exports, __webpack_require__) {
40560
40561"use strict";
40562
40563
40564Object.defineProperty(exports, "__esModule", {
40565 value: true
40566});
40567
40568var _stringify;
40569
40570function _load_stringify() {
40571 return _stringify = _interopRequireDefault(__webpack_require__(36));
40572}
40573
40574var _extends2;
40575
40576function _load_extends() {
40577 return _extends2 = _interopRequireDefault(__webpack_require__(24));
40578}
40579
40580var _set;
40581
40582function _load_set() {
40583 return _set = _interopRequireDefault(__webpack_require__(16));
40584}
40585
40586var _promise;
40587
40588function _load_promise() {
40589 return _promise = _interopRequireDefault(__webpack_require__(7));
40590}
40591
40592var _map;
40593
40594function _load_map() {
40595 return _map = _interopRequireDefault(__webpack_require__(42));
40596}
40597
40598var _getIterator2;
40599
40600function _load_getIterator() {
40601 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
40602}
40603
40604var _asyncToGenerator2;
40605
40606function _load_asyncToGenerator() {
40607 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
40608}
40609
40610var _classCallCheck2;
40611
40612function _load_classCallCheck() {
40613 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
40614}
40615
40616var _keys;
40617
40618function _load_keys() {
40619 return _keys = _interopRequireDefault(__webpack_require__(14));
40620}
40621
40622exports.extractWorkspaces = extractWorkspaces;
40623
40624var _executeLifecycleScript;
40625
40626function _load_executeLifecycleScript() {
40627 return _executeLifecycleScript = __webpack_require__(100);
40628}
40629
40630var _path;
40631
40632function _load_path() {
40633 return _path = __webpack_require__(314);
40634}
40635
40636var _conversion;
40637
40638function _load_conversion() {
40639 return _conversion = __webpack_require__(275);
40640}
40641
40642var _index;
40643
40644function _load_index() {
40645 return _index = _interopRequireDefault(__webpack_require__(206));
40646}
40647
40648var _errors;
40649
40650function _load_errors() {
40651 return _errors = __webpack_require__(6);
40652}
40653
40654var _fs;
40655
40656function _load_fs() {
40657 return _fs = _interopRequireWildcard(__webpack_require__(8));
40658}
40659
40660var _constants;
40661
40662function _load_constants() {
40663 return _constants = _interopRequireWildcard(__webpack_require__(13));
40664}
40665
40666var _packageConstraintResolver;
40667
40668function _load_packageConstraintResolver() {
40669 return _packageConstraintResolver = _interopRequireDefault(__webpack_require__(511));
40670}
40671
40672var _requestManager;
40673
40674function _load_requestManager() {
40675 return _requestManager = _interopRequireDefault(__webpack_require__(315));
40676}
40677
40678var _index2;
40679
40680function _load_index2() {
40681 return _index2 = __webpack_require__(61);
40682}
40683
40684var _index3;
40685
40686function _load_index3() {
40687 return _index3 = __webpack_require__(189);
40688}
40689
40690var _map2;
40691
40692function _load_map2() {
40693 return _map2 = _interopRequireDefault(__webpack_require__(51));
40694}
40695
40696function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
40697
40698function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
40699
40700var crypto = __webpack_require__(21);
40701var detectIndent = __webpack_require__(658);
40702var invariant = __webpack_require__(15);
40703var path = __webpack_require__(1);
40704var micromatch = __webpack_require__(109);
40705var isCi = __webpack_require__(365);
40706
40707function sortObject(object) {
40708 var sortedObject = {};
40709 (0, (_keys || _load_keys()).default)(object).sort().forEach(function (item) {
40710 sortedObject[item] = object[item];
40711 });
40712 return sortedObject;
40713}
40714
40715var Config = function () {
40716 function Config(reporter) {
40717 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Config);
40718
40719 this.constraintResolver = new (_packageConstraintResolver || _load_packageConstraintResolver()).default(this, reporter);
40720 this.requestManager = new (_requestManager || _load_requestManager()).default(reporter);
40721 this.reporter = reporter;
40722 this._init({});
40723 }
40724
40725 //
40726
40727
40728 //
40729
40730
40731 // cache packages in offline mirror folder as new .tgz files
40732
40733
40734 //
40735
40736
40737 //
40738
40739
40740 //
40741
40742
40743 //
40744
40745
40746 //
40747
40748
40749 //
40750
40751
40752 //
40753
40754
40755 //
40756
40757
40758 //
40759
40760
40761 //
40762
40763
40764 //
40765
40766
40767 // Whether we should ignore executing lifecycle scripts
40768
40769
40770 //
40771
40772
40773 //
40774
40775
40776 //
40777
40778
40779 //
40780
40781
40782 /**
40783 * Execute a promise produced by factory if it doesn't exist in our cache with
40784 * the associated key.
40785 */
40786
40787 Config.prototype.getCache = function getCache(key, factory) {
40788 var _this = this;
40789
40790 var cached = this.cache[key];
40791 if (cached) {
40792 return cached;
40793 }
40794
40795 return this.cache[key] = factory().catch(function (err) {
40796 _this.cache[key] = null;
40797 throw err;
40798 });
40799 };
40800
40801 /**
40802 * Get a config option from our yarn config.
40803 */
40804
40805 Config.prototype.getOption = function getOption(key) {
40806 var resolve = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
40807
40808 var value = this.registries.yarn.getOption(key);
40809
40810 if (resolve && typeof value === 'string' && value.length) {
40811 return (0, (_path || _load_path()).resolveWithHome)(value);
40812 }
40813
40814 return value;
40815 };
40816
40817 /**
40818 * Reduce a list of versions to a single one based on an input range.
40819 */
40820
40821 Config.prototype.resolveConstraints = function resolveConstraints(versions, range) {
40822 return this.constraintResolver.reduce(versions, range);
40823 };
40824
40825 /**
40826 * Initialise config. Fetch registry options, find package roots.
40827 */
40828
40829 Config.prototype.init = function () {
40830 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
40831 var _this2 = this;
40832
40833 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
40834
40835 this._init(opts);
40836
40837 this.workspaceRootFolder = yield this.findWorkspaceRoot(this.cwd);
40838 this.lockfileFolder = this.workspaceRootFolder || this.cwd;
40839
40840 // using focus in a workspace root is not allowed
40841 if (this.focus && (!this.workspaceRootFolder || this.cwd === this.workspaceRootFolder)) {
40842 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesFocusRootCheck'));
40843 }
40844
40845 if (this.focus) {
40846 var focusedWorkspaceManifest = yield this.readRootManifest();
40847 this.focusedWorkspaceName = focusedWorkspaceManifest.name;
40848 }
40849
40850 this.linkedModules = [];
40851
40852 var linkedModules = void 0;
40853 try {
40854 linkedModules = yield (_fs || _load_fs()).readdir(this.linkFolder);
40855 } catch (err) {
40856 if (err.code === 'ENOENT') {
40857 linkedModules = [];
40858 } else {
40859 throw err;
40860 }
40861 }
40862
40863 var _loop = function* _loop(dir) {
40864 var linkedPath = path.join(_this2.linkFolder, dir);
40865
40866 if (dir[0] === '@') {
40867 var _linkedModules;
40868
40869 // it's a scope, not a package
40870 var scopedLinked = yield (_fs || _load_fs()).readdir(linkedPath);
40871 (_linkedModules = _this2.linkedModules).push.apply(_linkedModules, scopedLinked.map(function (scopedDir) {
40872 return path.join(dir, scopedDir);
40873 }));
40874 } else {
40875 _this2.linkedModules.push(dir);
40876 }
40877 };
40878
40879 for (var _iterator = linkedModules, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
40880 var _ref2;
40881
40882 if (_isArray) {
40883 if (_i >= _iterator.length) break;
40884 _ref2 = _iterator[_i++];
40885 } else {
40886 _i = _iterator.next();
40887 if (_i.done) break;
40888 _ref2 = _i.value;
40889 }
40890
40891 var dir = _ref2;
40892 yield* _loop(dir);
40893 }
40894
40895 for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
40896 var _ref3;
40897
40898 if (_isArray2) {
40899 if (_i2 >= _iterator2.length) break;
40900 _ref3 = _iterator2[_i2++];
40901 } else {
40902 _i2 = _iterator2.next();
40903 if (_i2.done) break;
40904 _ref3 = _i2.value;
40905 }
40906
40907 var _key = _ref3;
40908
40909 var Registry = (_index2 || _load_index2()).registries[_key];
40910
40911 var extraneousRcFiles = Registry === (_index2 || _load_index2()).registries.yarn ? this.extraneousYarnrcFiles : [];
40912
40913 // instantiate registry
40914 var _registry = new Registry(this.cwd, this.registries, this.requestManager, this.reporter, this.enableDefaultRc, extraneousRcFiles);
40915 yield _registry.init({
40916 registry: opts.registry
40917 });
40918
40919 this.registries[_key] = _registry;
40920 if (this.registryFolders.indexOf(_registry.folder) === -1) {
40921 this.registryFolders.push(_registry.folder);
40922 }
40923 }
40924
40925 if (this.modulesFolder) {
40926 this.registryFolders = [this.modulesFolder];
40927 }
40928
40929 this.networkConcurrency = opts.networkConcurrency || Number(this.getOption('network-concurrency')) || (_constants || _load_constants()).NETWORK_CONCURRENCY;
40930
40931 this.childConcurrency = opts.childConcurrency || Number(this.getOption('child-concurrency')) || Number(process.env.CHILD_CONCURRENCY) || (_constants || _load_constants()).CHILD_CONCURRENCY;
40932
40933 this.networkTimeout = opts.networkTimeout || Number(this.getOption('network-timeout')) || (_constants || _load_constants()).NETWORK_TIMEOUT;
40934
40935 var httpProxy = opts.httpProxy || this.getOption('proxy');
40936 var httpsProxy = opts.httpsProxy || this.getOption('https-proxy');
40937 this.requestManager.setOptions({
40938 userAgent: String(this.getOption('user-agent')),
40939 httpProxy: httpProxy === false ? false : String(httpProxy || ''),
40940 httpsProxy: httpsProxy === false ? false : String(httpsProxy || ''),
40941 strictSSL: Boolean(this.getOption('strict-ssl')),
40942 ca: Array.prototype.concat(opts.ca || this.getOption('ca') || []).map(String),
40943 cafile: String(opts.cafile || this.getOption('cafile', true) || ''),
40944 cert: String(opts.cert || this.getOption('cert') || ''),
40945 key: String(opts.key || this.getOption('key') || ''),
40946 networkConcurrency: this.networkConcurrency,
40947 networkTimeout: this.networkTimeout
40948 });
40949
40950 this.globalFolder = opts.globalFolder || String(this.getOption('global-folder', true));
40951 if (this.globalFolder === 'undefined') {
40952 this.globalFolder = (_constants || _load_constants()).GLOBAL_MODULE_DIRECTORY;
40953 }
40954
40955 var cacheRootFolder = opts.cacheFolder || this.getOption('cache-folder', true);
40956
40957 if (!cacheRootFolder) {
40958 var preferredCacheFolders = (_constants || _load_constants()).PREFERRED_MODULE_CACHE_DIRECTORIES;
40959 var preferredCacheFolder = opts.preferredCacheFolder || this.getOption('preferred-cache-folder', true);
40960
40961 if (preferredCacheFolder) {
40962 preferredCacheFolders = [String(preferredCacheFolder)].concat(preferredCacheFolders);
40963 }
40964
40965 var cacheFolderQuery = yield (_fs || _load_fs()).getFirstSuitableFolder(preferredCacheFolders, (_fs || _load_fs()).constants.W_OK | (_fs || _load_fs()).constants.X_OK | (_fs || _load_fs()).constants.R_OK // eslint-disable-line no-bitwise
40966 );
40967 for (var _iterator3 = cacheFolderQuery.skipped, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
40968 var _ref4;
40969
40970 if (_isArray3) {
40971 if (_i3 >= _iterator3.length) break;
40972 _ref4 = _iterator3[_i3++];
40973 } else {
40974 _i3 = _iterator3.next();
40975 if (_i3.done) break;
40976 _ref4 = _i3.value;
40977 }
40978
40979 var skippedEntry = _ref4;
40980
40981 this.reporter.warn(this.reporter.lang('cacheFolderSkipped', skippedEntry.folder));
40982 }
40983
40984 cacheRootFolder = cacheFolderQuery.folder;
40985 if (cacheRootFolder && cacheFolderQuery.skipped.length > 0) {
40986 this.reporter.warn(this.reporter.lang('cacheFolderSelected', cacheRootFolder));
40987 }
40988 }
40989
40990 if (!cacheRootFolder) {
40991 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('cacheFolderMissing'));
40992 } else {
40993 this._cacheRootFolder = String(cacheRootFolder);
40994 }
40995
40996 var manifest = yield this.maybeReadManifest(this.lockfileFolder);
40997
40998 var plugnplayByEnv = this.getOption('plugnplay-override');
40999 if (plugnplayByEnv != null) {
41000 this.plugnplayEnabled = plugnplayByEnv !== 'false' && plugnplayByEnv !== '0';
41001 this.plugnplayPersist = false;
41002 } else if (opts.enablePnp || opts.disablePnp) {
41003 this.plugnplayEnabled = !!opts.enablePnp;
41004 this.plugnplayPersist = true;
41005 } else if (manifest && manifest.installConfig && manifest.installConfig.pnp) {
41006 this.plugnplayEnabled = !!manifest.installConfig.pnp;
41007 this.plugnplayPersist = false;
41008 } else {
41009 this.plugnplayEnabled = false;
41010 this.plugnplayPersist = false;
41011 }
41012
41013 if (process.platform === 'win32') {
41014 var cacheRootFolderDrive = path.parse(this._cacheRootFolder).root.toLowerCase();
41015 var lockfileFolderDrive = path.parse(this.lockfileFolder).root.toLowerCase();
41016
41017 if (cacheRootFolderDrive !== lockfileFolderDrive) {
41018 if (this.plugnplayEnabled) {
41019 this.reporter.warn(this.reporter.lang('plugnplayWindowsSupport'));
41020 }
41021 this.plugnplayEnabled = false;
41022 this.plugnplayPersist = false;
41023 }
41024 }
41025
41026 this.plugnplayShebang = String(this.getOption('plugnplay-shebang') || '') || '/usr/bin/env node';
41027 this.plugnplayBlacklist = String(this.getOption('plugnplay-blacklist') || '') || null;
41028
41029 this.ignoreScripts = opts.ignoreScripts || Boolean(this.getOption('ignore-scripts', false));
41030
41031 this.workspacesEnabled = this.getOption('workspaces-experimental') !== false;
41032 this.workspacesNohoistEnabled = this.getOption('workspaces-nohoist-experimental') !== false;
41033
41034 this.offlineCacheFolder = String(this.getOption('offline-cache-folder') || '') || null;
41035
41036 this.pruneOfflineMirror = Boolean(this.getOption('yarn-offline-mirror-pruning'));
41037 this.enableMetaFolder = Boolean(this.getOption('enable-meta-folder'));
41038 this.enableLockfileVersions = Boolean(this.getOption('yarn-enable-lockfile-versions'));
41039 this.linkFileDependencies = Boolean(this.getOption('yarn-link-file-dependencies'));
41040 this.packBuiltPackages = Boolean(this.getOption('experimental-pack-script-packages-in-mirror'));
41041
41042 this.autoAddIntegrity = !(0, (_conversion || _load_conversion()).boolifyWithDefault)(String(this.getOption('unsafe-disable-integrity-migration')), true);
41043
41044 //init & create cacheFolder, tempFolder
41045 this.cacheFolder = path.join(this._cacheRootFolder, 'v' + String((_constants || _load_constants()).CACHE_VERSION));
41046 this.tempFolder = opts.tempFolder || path.join(this.cacheFolder, '.tmp');
41047 yield (_fs || _load_fs()).mkdirp(this.cacheFolder);
41048 yield (_fs || _load_fs()).mkdirp(this.tempFolder);
41049
41050 if (opts.production !== undefined) {
41051 this.production = Boolean(opts.production);
41052 } else {
41053 this.production = Boolean(this.getOption('production')) || process.env.NODE_ENV === 'production' && process.env.NPM_CONFIG_PRODUCTION !== 'false' && process.env.YARN_PRODUCTION !== 'false';
41054 }
41055
41056 if (this.workspaceRootFolder && !this.workspacesEnabled) {
41057 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesDisabled'));
41058 }
41059 });
41060
41061 function init() {
41062 return _ref.apply(this, arguments);
41063 }
41064
41065 return init;
41066 }();
41067
41068 Config.prototype._init = function _init(opts) {
41069 this.registryFolders = [];
41070 this.linkedModules = [];
41071
41072 this.registries = (0, (_map2 || _load_map2()).default)();
41073 this.cache = (0, (_map2 || _load_map2()).default)();
41074
41075 // Ensure the cwd is always an absolute path.
41076 this.cwd = path.resolve(opts.cwd || this.cwd || process.cwd());
41077
41078 this.looseSemver = opts.looseSemver == undefined ? true : opts.looseSemver;
41079
41080 this.commandName = opts.commandName || '';
41081
41082 this.enableDefaultRc = opts.enableDefaultRc !== false;
41083 this.extraneousYarnrcFiles = opts.extraneousYarnrcFiles || [];
41084
41085 this.preferOffline = !!opts.preferOffline;
41086 this.modulesFolder = opts.modulesFolder;
41087 this.linkFolder = opts.linkFolder || (_constants || _load_constants()).LINK_REGISTRY_DIRECTORY;
41088 this.offline = !!opts.offline;
41089 this.binLinks = !!opts.binLinks;
41090 this.updateChecksums = !!opts.updateChecksums;
41091 this.plugnplayUnplugged = [];
41092 this.plugnplayPurgeUnpluggedPackages = false;
41093
41094 this.ignorePlatform = !!opts.ignorePlatform;
41095 this.ignoreScripts = !!opts.ignoreScripts;
41096
41097 this.disablePrepublish = !!opts.disablePrepublish;
41098
41099 // $FlowFixMe$
41100 this.nonInteractive = !!opts.nonInteractive || isCi || !process.stdout.isTTY;
41101
41102 this.requestManager.setOptions({
41103 offline: !!opts.offline && !opts.preferOffline,
41104 captureHar: !!opts.captureHar
41105 });
41106
41107 this.focus = !!opts.focus;
41108 this.focusedWorkspaceName = '';
41109
41110 this.otp = opts.otp || '';
41111 };
41112
41113 /**
41114 * Generate a name suitable as unique filesystem identifier for the specified package.
41115 */
41116
41117 Config.prototype.generateUniquePackageSlug = function generateUniquePackageSlug(pkg) {
41118 var slug = pkg.name;
41119
41120 slug = slug.replace(/[^@a-z0-9]+/g, '-');
41121 slug = slug.replace(/^-+|-+$/g, '');
41122
41123 if (pkg.registry) {
41124 slug = `${pkg.registry}-${slug}`;
41125 } else {
41126 slug = `unknown-${slug}`;
41127 }
41128
41129 var hash = pkg.remote.hash;
41130
41131
41132 if (pkg.version) {
41133 slug += `-${pkg.version}`;
41134 }
41135
41136 if (pkg.uid && pkg.version !== pkg.uid) {
41137 slug += `-${pkg.uid}`;
41138 } else if (hash) {
41139 slug += `-${hash}`;
41140 }
41141
41142 if (pkg.remote.integrity) {
41143 slug += `-integrity`;
41144 }
41145
41146 return slug;
41147 };
41148
41149 /**
41150 * Generate an absolute module path.
41151 */
41152
41153 Config.prototype.generateModuleCachePath = function generateModuleCachePath(pkg) {
41154 invariant(this.cacheFolder, 'No package root');
41155 invariant(pkg, 'Undefined package');
41156
41157 var slug = this.generateUniquePackageSlug(pkg);
41158 return path.join(this.cacheFolder, slug, 'node_modules', pkg.name);
41159 };
41160
41161 /**
41162 */
41163
41164 Config.prototype.getUnpluggedPath = function getUnpluggedPath() {
41165 return path.join(this.lockfileFolder, '.pnp', 'unplugged');
41166 };
41167
41168 /**
41169 */
41170
41171 Config.prototype.generatePackageUnpluggedPath = function generatePackageUnpluggedPath(pkg) {
41172 var slug = this.generateUniquePackageSlug(pkg);
41173 return path.join(this.getUnpluggedPath(), slug, 'node_modules', pkg.name);
41174 };
41175
41176 /**
41177 */
41178
41179 Config.prototype.listUnpluggedPackageFolders = function () {
41180 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
41181 var unpluggedPackages = new (_map || _load_map()).default();
41182 var unpluggedPath = this.getUnpluggedPath();
41183
41184 if (!(yield (_fs || _load_fs()).exists(unpluggedPath))) {
41185 return unpluggedPackages;
41186 }
41187
41188 for (var _iterator4 = yield (_fs || _load_fs()).readdir(unpluggedPath), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
41189 var _ref6;
41190
41191 if (_isArray4) {
41192 if (_i4 >= _iterator4.length) break;
41193 _ref6 = _iterator4[_i4++];
41194 } else {
41195 _i4 = _iterator4.next();
41196 if (_i4.done) break;
41197 _ref6 = _i4.value;
41198 }
41199
41200 var unpluggedName = _ref6;
41201
41202 var nmListing = yield (_fs || _load_fs()).readdir(path.join(unpluggedPath, unpluggedName, 'node_modules'));
41203 invariant(nmListing.length === 1, 'A single folder should be in the unplugged directory');
41204
41205 var target = path.join(unpluggedPath, unpluggedName, `node_modules`, nmListing[0]);
41206 unpluggedPackages.set(unpluggedName, target);
41207 }
41208
41209 return unpluggedPackages;
41210 });
41211
41212 function listUnpluggedPackageFolders() {
41213 return _ref5.apply(this, arguments);
41214 }
41215
41216 return listUnpluggedPackageFolders;
41217 }();
41218
41219 /**
41220 * Execute lifecycle scripts in the specified directory. Ignoring when the --ignore-scripts flag has been
41221 * passed.
41222 */
41223
41224 Config.prototype.executeLifecycleScript = function executeLifecycleScript(commandName, cwd) {
41225 if (this.ignoreScripts) {
41226 return (_promise || _load_promise()).default.resolve();
41227 } else {
41228 return (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execFromManifest)(this, commandName, cwd || this.cwd);
41229 }
41230 };
41231
41232 /**
41233 * Generate an absolute temporary filename location based on the input filename.
41234 */
41235
41236 Config.prototype.getTemp = function getTemp(filename) {
41237 invariant(this.tempFolder, 'No temp folder');
41238 return path.join(this.tempFolder, filename);
41239 };
41240
41241 /**
41242 * Remote packages may be cached in a file system to be available for offline installation.
41243 * Second time the same package needs to be installed it will be loaded from there.
41244 * Given a package's filename, return a path in the offline mirror location.
41245 */
41246
41247 Config.prototype.getOfflineMirrorPath = function getOfflineMirrorPath(packageFilename) {
41248 var mirrorPath = void 0;
41249
41250 var _arr = ['npm', 'yarn'];
41251 for (var _i5 = 0; _i5 < _arr.length; _i5++) {
41252 var _key2 = _arr[_i5];
41253 var _registry2 = this.registries[_key2];
41254
41255 if (_registry2 == null) {
41256 continue;
41257 }
41258
41259 var registryMirrorPath = _registry2.config['yarn-offline-mirror'];
41260
41261 if (registryMirrorPath === false) {
41262 return null;
41263 }
41264
41265 if (registryMirrorPath == null) {
41266 continue;
41267 }
41268
41269 mirrorPath = registryMirrorPath;
41270 }
41271
41272 if (mirrorPath == null) {
41273 return null;
41274 }
41275
41276 if (packageFilename == null) {
41277 return mirrorPath;
41278 }
41279
41280 return path.join(mirrorPath, path.basename(packageFilename));
41281 };
41282
41283 /**
41284 * Checker whether the folder input is a valid module folder. We output a yarn metadata
41285 * file when we've successfully setup a folder so use this as a marker.
41286 */
41287
41288 Config.prototype.isValidModuleDest = function () {
41289 var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) {
41290 if (!(yield (_fs || _load_fs()).exists(dest))) {
41291 return false;
41292 }
41293
41294 if (!(yield (_fs || _load_fs()).exists(path.join(dest, (_constants || _load_constants()).METADATA_FILENAME)))) {
41295 return false;
41296 }
41297
41298 return true;
41299 });
41300
41301 function isValidModuleDest(_x3) {
41302 return _ref7.apply(this, arguments);
41303 }
41304
41305 return isValidModuleDest;
41306 }();
41307
41308 /**
41309 * Read package metadata and normalized package info.
41310 */
41311
41312 Config.prototype.readPackageMetadata = function readPackageMetadata(dir) {
41313 var _this3 = this;
41314
41315 return this.getCache(`metadata-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
41316 var metadata = yield _this3.readJson(path.join(dir, (_constants || _load_constants()).METADATA_FILENAME));
41317 var pkg = yield _this3.readManifest(dir, metadata.registry);
41318
41319 return {
41320 package: pkg,
41321 artifacts: metadata.artifacts || [],
41322 hash: metadata.hash,
41323 remote: metadata.remote,
41324 registry: metadata.registry
41325 };
41326 }));
41327 };
41328
41329 /**
41330 * Read normalized package info according yarn-metadata.json
41331 * throw an error if package.json was not found
41332 */
41333
41334 Config.prototype.readManifest = function readManifest(dir, priorityRegistry) {
41335 var _this4 = this;
41336
41337 var isRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
41338
41339 return this.getCache(`manifest-${dir}`, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
41340 var manifest = yield _this4.maybeReadManifest(dir, priorityRegistry, isRoot);
41341
41342 if (manifest) {
41343 return manifest;
41344 } else {
41345 throw new (_errors || _load_errors()).MessageError(_this4.reporter.lang('couldntFindPackagejson', dir), 'ENOENT');
41346 }
41347 }));
41348 };
41349
41350 /**
41351 * try get the manifest file by looking
41352 * 1. manifest file in cache
41353 * 2. manifest file in registry
41354 */
41355
41356
41357 Config.prototype.maybeReadManifest = function () {
41358 var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, priorityRegistry) {
41359 var isRoot = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
41360
41361 var metadataLoc = path.join(dir, (_constants || _load_constants()).METADATA_FILENAME);
41362
41363 if (yield (_fs || _load_fs()).exists(metadataLoc)) {
41364 var metadata = yield this.readJson(metadataLoc);
41365
41366 if (!priorityRegistry) {
41367 priorityRegistry = metadata.priorityRegistry;
41368 }
41369
41370 if (typeof metadata.manifest !== 'undefined') {
41371 return metadata.manifest;
41372 }
41373 }
41374
41375 if (priorityRegistry) {
41376 var file = yield this.tryManifest(dir, priorityRegistry, isRoot);
41377 if (file) {
41378 return file;
41379 }
41380 }
41381
41382 for (var _iterator5 = (0, (_keys || _load_keys()).default)((_index2 || _load_index2()).registries), _isArray5 = Array.isArray(_iterator5), _i6 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
41383 var _ref11;
41384
41385 if (_isArray5) {
41386 if (_i6 >= _iterator5.length) break;
41387 _ref11 = _iterator5[_i6++];
41388 } else {
41389 _i6 = _iterator5.next();
41390 if (_i6.done) break;
41391 _ref11 = _i6.value;
41392 }
41393
41394 var _registry3 = _ref11;
41395
41396 if (priorityRegistry === _registry3) {
41397 continue;
41398 }
41399
41400 var _file = yield this.tryManifest(dir, _registry3, isRoot);
41401 if (_file) {
41402 return _file;
41403 }
41404 }
41405
41406 return null;
41407 });
41408
41409 function maybeReadManifest(_x5, _x6) {
41410 return _ref10.apply(this, arguments);
41411 }
41412
41413 return maybeReadManifest;
41414 }();
41415
41416 /**
41417 * Read the root manifest.
41418 */
41419
41420 Config.prototype.readRootManifest = function readRootManifest() {
41421 return this.readManifest(this.cwd, 'npm', true);
41422 };
41423
41424 /**
41425 * Try and find package info with the input directory and registry.
41426 */
41427
41428 Config.prototype.tryManifest = function () {
41429 var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, registry, isRoot) {
41430 var filename = (_index2 || _load_index2()).registries[registry].filename;
41431
41432 var loc = path.join(dir, filename);
41433 if (yield (_fs || _load_fs()).exists(loc)) {
41434 var data = yield this.readJson(loc);
41435 data._registry = registry;
41436 data._loc = loc;
41437 return (0, (_index || _load_index()).default)(data, dir, this, isRoot);
41438 } else {
41439 return null;
41440 }
41441 });
41442
41443 function tryManifest(_x8, _x9, _x10) {
41444 return _ref12.apply(this, arguments);
41445 }
41446
41447 return tryManifest;
41448 }();
41449
41450 Config.prototype.findManifest = function () {
41451 var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, isRoot) {
41452 for (var _iterator6 = (_index2 || _load_index2()).registryNames, _isArray6 = Array.isArray(_iterator6), _i7 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
41453 var _ref14;
41454
41455 if (_isArray6) {
41456 if (_i7 >= _iterator6.length) break;
41457 _ref14 = _iterator6[_i7++];
41458 } else {
41459 _i7 = _iterator6.next();
41460 if (_i7.done) break;
41461 _ref14 = _i7.value;
41462 }
41463
41464 var _registry4 = _ref14;
41465
41466 var manifest = yield this.tryManifest(dir, _registry4, isRoot);
41467
41468 if (manifest) {
41469 return manifest;
41470 }
41471 }
41472
41473 return null;
41474 });
41475
41476 function findManifest(_x11, _x12) {
41477 return _ref13.apply(this, arguments);
41478 }
41479
41480 return findManifest;
41481 }();
41482
41483 Config.prototype.findWorkspaceRoot = function () {
41484 var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (initial) {
41485 var previous = null;
41486 var current = path.normalize(initial);
41487 if (!(yield (_fs || _load_fs()).exists(current))) {
41488 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('folderMissing', current));
41489 }
41490
41491 do {
41492 var manifest = yield this.findManifest(current, true);
41493 var ws = extractWorkspaces(manifest);
41494 if (ws && ws.packages) {
41495 var relativePath = path.relative(current, initial);
41496 if (relativePath === '' || micromatch([relativePath], ws.packages).length > 0) {
41497 return current;
41498 } else {
41499 return null;
41500 }
41501 }
41502
41503 previous = current;
41504 current = path.dirname(current);
41505 } while (current !== previous);
41506
41507 return null;
41508 });
41509
41510 function findWorkspaceRoot(_x13) {
41511 return _ref15.apply(this, arguments);
41512 }
41513
41514 return findWorkspaceRoot;
41515 }();
41516
41517 Config.prototype.resolveWorkspaces = function () {
41518 var _ref16 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (root, rootManifest) {
41519 var _this5 = this;
41520
41521 var workspaces = {};
41522 if (!this.workspacesEnabled) {
41523 return workspaces;
41524 }
41525
41526 var ws = this.getWorkspaces(rootManifest, true);
41527 var patterns = ws && ws.packages ? ws.packages : [];
41528
41529 if (!Array.isArray(patterns)) {
41530 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesSettingMustBeArray'));
41531 }
41532
41533 var registryFilenames = (_index2 || _load_index2()).registryNames.map(function (registryName) {
41534 return _this5.registries[registryName].constructor.filename;
41535 }).join('|');
41536 var trailingPattern = `/+(${registryFilenames})`;
41537 // anything under folder (node_modules) should be ignored, thus use the '**' instead of shallow match "*"
41538 var ignorePatterns = this.registryFolders.map(function (folder) {
41539 return `/${folder}/**/+(${registryFilenames})`;
41540 });
41541
41542 var files = yield (_promise || _load_promise()).default.all(patterns.map(function (pattern) {
41543 return (_fs || _load_fs()).glob(pattern.replace(/\/?$/, trailingPattern), {
41544 cwd: root,
41545 ignore: ignorePatterns.map(function (ignorePattern) {
41546 return pattern.replace(/\/?$/, ignorePattern);
41547 })
41548 });
41549 }));
41550
41551 for (var _iterator7 = new (_set || _load_set()).default((_ref18 = []).concat.apply(_ref18, files)), _isArray7 = Array.isArray(_iterator7), _i8 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
41552 var _ref18;
41553
41554 var _ref17;
41555
41556 if (_isArray7) {
41557 if (_i8 >= _iterator7.length) break;
41558 _ref17 = _iterator7[_i8++];
41559 } else {
41560 _i8 = _iterator7.next();
41561 if (_i8.done) break;
41562 _ref17 = _i8.value;
41563 }
41564
41565 var file = _ref17;
41566
41567 var _loc = path.join(root, path.dirname(file));
41568 var manifest = yield this.findManifest(_loc, false);
41569
41570 if (!manifest) {
41571 continue;
41572 }
41573
41574 if (!manifest.name) {
41575 this.reporter.warn(this.reporter.lang('workspaceNameMandatory', _loc));
41576 continue;
41577 }
41578 if (!manifest.version) {
41579 this.reporter.warn(this.reporter.lang('workspaceVersionMandatory', _loc));
41580 continue;
41581 }
41582
41583 if (Object.prototype.hasOwnProperty.call(workspaces, manifest.name)) {
41584 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspaceNameDuplicate', manifest.name));
41585 }
41586
41587 workspaces[manifest.name] = { loc: _loc, manifest };
41588 }
41589
41590 return workspaces;
41591 });
41592
41593 function resolveWorkspaces(_x14, _x15) {
41594 return _ref16.apply(this, arguments);
41595 }
41596
41597 return resolveWorkspaces;
41598 }();
41599
41600 // workspaces functions
41601
41602
41603 Config.prototype.getWorkspaces = function getWorkspaces(manifest) {
41604 var shouldThrow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
41605
41606 if (!manifest || !this.workspacesEnabled) {
41607 return undefined;
41608 }
41609
41610 var ws = extractWorkspaces(manifest);
41611
41612 if (!ws) {
41613 return ws;
41614 }
41615
41616 // validate eligibility
41617 var wsCopy = (0, (_extends2 || _load_extends()).default)({}, ws);
41618 var warnings = [];
41619 var errors = [];
41620
41621 // packages
41622 if (wsCopy.packages && wsCopy.packages.length > 0 && !manifest.private) {
41623 errors.push(this.reporter.lang('workspacesRequirePrivateProjects'));
41624 wsCopy = undefined;
41625 }
41626 // nohoist
41627 if (wsCopy && wsCopy.nohoist && wsCopy.nohoist.length > 0) {
41628 if (!this.workspacesNohoistEnabled) {
41629 warnings.push(this.reporter.lang('workspacesNohoistDisabled', manifest.name));
41630 wsCopy.nohoist = undefined;
41631 } else if (!manifest.private) {
41632 errors.push(this.reporter.lang('workspacesNohoistRequirePrivatePackages', manifest.name));
41633 wsCopy.nohoist = undefined;
41634 }
41635 }
41636
41637 if (errors.length > 0 && shouldThrow) {
41638 throw new (_errors || _load_errors()).MessageError(errors.join('\n'));
41639 }
41640
41641 var msg = errors.concat(warnings).join('\n');
41642 if (msg.length > 0) {
41643 this.reporter.warn(msg);
41644 }
41645
41646 return wsCopy;
41647 };
41648
41649 /**
41650 * Description
41651 */
41652
41653 Config.prototype.getFolder = function getFolder(pkg) {
41654 var registryName = pkg._registry;
41655 if (!registryName) {
41656 var ref = pkg._reference;
41657 invariant(ref, 'expected reference');
41658 registryName = ref.registry;
41659 }
41660 return this.registries[registryName].folder;
41661 };
41662
41663 /**
41664 * Get root manifests.
41665 */
41666
41667 Config.prototype.getRootManifests = function () {
41668 var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
41669 var manifests = {};
41670 for (var _iterator8 = (_index2 || _load_index2()).registryNames, _isArray8 = Array.isArray(_iterator8), _i9 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
41671 var _ref20;
41672
41673 if (_isArray8) {
41674 if (_i9 >= _iterator8.length) break;
41675 _ref20 = _iterator8[_i9++];
41676 } else {
41677 _i9 = _iterator8.next();
41678 if (_i9.done) break;
41679 _ref20 = _i9.value;
41680 }
41681
41682 var _registryName = _ref20;
41683
41684 var _registry5 = (_index2 || _load_index2()).registries[_registryName];
41685 var jsonLoc = path.join(this.cwd, _registry5.filename);
41686
41687 var _object = {};
41688 var _exists = false;
41689 var _indent = void 0;
41690 if (yield (_fs || _load_fs()).exists(jsonLoc)) {
41691 _exists = true;
41692
41693 var info = yield this.readJson(jsonLoc, (_fs || _load_fs()).readJsonAndFile);
41694 _object = info.object;
41695 _indent = detectIndent(info.content).indent || undefined;
41696 }
41697 manifests[_registryName] = { loc: jsonLoc, object: _object, exists: _exists, indent: _indent };
41698 }
41699 return manifests;
41700 });
41701
41702 function getRootManifests() {
41703 return _ref19.apply(this, arguments);
41704 }
41705
41706 return getRootManifests;
41707 }();
41708
41709 /**
41710 * Save root manifests.
41711 */
41712
41713 Config.prototype.saveRootManifests = function () {
41714 var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (manifests) {
41715 for (var _iterator9 = (_index2 || _load_index2()).registryNames, _isArray9 = Array.isArray(_iterator9), _i10 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
41716 var _ref22;
41717
41718 if (_isArray9) {
41719 if (_i10 >= _iterator9.length) break;
41720 _ref22 = _iterator9[_i10++];
41721 } else {
41722 _i10 = _iterator9.next();
41723 if (_i10.done) break;
41724 _ref22 = _i10.value;
41725 }
41726
41727 var _registryName2 = _ref22;
41728 var _manifests$_registryN = manifests[_registryName2],
41729 _loc2 = _manifests$_registryN.loc,
41730 _object2 = _manifests$_registryN.object,
41731 _exists2 = _manifests$_registryN.exists,
41732 _indent2 = _manifests$_registryN.indent;
41733
41734 if (!_exists2 && !(0, (_keys || _load_keys()).default)(_object2).length) {
41735 continue;
41736 }
41737
41738 for (var _iterator10 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray10 = Array.isArray(_iterator10), _i11 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
41739 var _ref23;
41740
41741 if (_isArray10) {
41742 if (_i11 >= _iterator10.length) break;
41743 _ref23 = _iterator10[_i11++];
41744 } else {
41745 _i11 = _iterator10.next();
41746 if (_i11.done) break;
41747 _ref23 = _i11.value;
41748 }
41749
41750 var field = _ref23;
41751
41752 if (_object2[field]) {
41753 _object2[field] = sortObject(_object2[field]);
41754 }
41755 }
41756
41757 yield (_fs || _load_fs()).writeFilePreservingEol(_loc2, (0, (_stringify || _load_stringify()).default)(_object2, null, _indent2 || (_constants || _load_constants()).DEFAULT_INDENT) + '\n');
41758 }
41759 });
41760
41761 function saveRootManifests(_x17) {
41762 return _ref21.apply(this, arguments);
41763 }
41764
41765 return saveRootManifests;
41766 }();
41767
41768 /**
41769 * Call the passed factory (defaults to fs.readJson) and rethrow a pretty error message if it was the result
41770 * of a syntax error.
41771 */
41772
41773 Config.prototype.readJson = function readJson(loc) {
41774 var factory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_fs || _load_fs()).readJson;
41775
41776 try {
41777 return factory(loc);
41778 } catch (err) {
41779 if (err instanceof SyntaxError) {
41780 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('jsonError', loc, err.message));
41781 } else {
41782 throw err;
41783 }
41784 }
41785 };
41786
41787 Config.create = function () {
41788 var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
41789 var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
41790 var reporter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new (_index3 || _load_index3()).NoopReporter();
41791
41792 var config = new Config(reporter);
41793 yield config.init(opts);
41794 return config;
41795 });
41796
41797 function create() {
41798 return _ref24.apply(this, arguments);
41799 }
41800
41801 return create;
41802 }();
41803
41804 return Config;
41805}();
41806
41807exports.default = Config;
41808function extractWorkspaces(manifest) {
41809 if (!manifest || !manifest.workspaces) {
41810 return undefined;
41811 }
41812
41813 if (Array.isArray(manifest.workspaces)) {
41814 return { packages: manifest.workspaces };
41815 }
41816
41817 if (manifest.workspaces.packages && Array.isArray(manifest.workspaces.packages) || manifest.workspaces.nohoist && Array.isArray(manifest.workspaces.nohoist)) {
41818 return manifest.workspaces;
41819 }
41820
41821 return undefined;
41822}
41823
41824/***/ }),
41825/* 150 */
41826/***/ (function(module, exports) {
41827
41828module.exports = function(module) {
41829 if(!module.webpackPolyfill) {
41830 module.deprecate = function() {};
41831 module.paths = [];
41832 // module.parent = undefined by default
41833 if(!module.children) module.children = [];
41834 Object.defineProperty(module, "loaded", {
41835 enumerable: true,
41836 get: function() {
41837 return module.l;
41838 }
41839 });
41840 Object.defineProperty(module, "id", {
41841 enumerable: true,
41842 get: function() {
41843 return module.i;
41844 }
41845 });
41846 module.webpackPolyfill = 1;
41847 }
41848 return module;
41849};
41850
41851
41852/***/ }),
41853/* 151 */
41854/***/ (function(module, exports) {
41855
41856module.exports = require("net");
41857
41858/***/ }),
41859/* 152 */
41860/***/ (function(module, exports, __webpack_require__) {
41861
41862"use strict";
41863
41864
41865var _classCallCheck2;
41866
41867function _load_classCallCheck() {
41868 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
41869}
41870
41871function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41872
41873var chalk = __webpack_require__(37);
41874var figures = __webpack_require__(233);
41875
41876/**
41877 * Separator object
41878 * Used to space/separate choices group
41879 * @constructor
41880 * @param {String} line Separation line content (facultative)
41881 */
41882
41883var Separator = function () {
41884 function Separator(line) {
41885 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Separator);
41886
41887 this.type = 'separator';
41888 this.line = chalk.dim(line || new Array(15).join(figures.line));
41889 }
41890
41891 /**
41892 * Stringify separator
41893 * @return {String} the separator display string
41894 */
41895
41896
41897 Separator.prototype.toString = function toString() {
41898 return this.line;
41899 };
41900
41901 return Separator;
41902}();
41903
41904/**
41905 * Helper function returning false if object is a separator
41906 * @param {Object} obj object to test against
41907 * @return {Boolean} `false` if object is a separator
41908 */
41909
41910Separator.exclude = function (obj) {
41911 return obj.type !== 'separator';
41912};
41913
41914module.exports = Separator;
41915
41916/***/ }),
41917/* 153 */
41918/***/ (function(module, exports, __webpack_require__) {
41919
41920"use strict";
41921
41922
41923var _classCallCheck2;
41924
41925function _load_classCallCheck() {
41926 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
41927}
41928
41929function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
41930
41931var _ = __webpack_require__(45);
41932var chalk = __webpack_require__(37);
41933
41934/**
41935 * The paginator keeps track of a pointer index in a list and returns
41936 * a subset of the choices if the list is too long.
41937 */
41938
41939var Paginator = function () {
41940 function Paginator(screen) {
41941 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Paginator);
41942
41943 this.pointer = 0;
41944 this.lastIndex = 0;
41945 this.screen = screen;
41946 }
41947
41948 Paginator.prototype.paginate = function paginate(output, active, pageSize) {
41949 pageSize = pageSize || 7;
41950 var middleOfList = Math.floor(pageSize / 2);
41951 var lines = output.split('\n');
41952
41953 if (this.screen) {
41954 lines = this.screen.breakLines(lines);
41955 active = _.sum(lines.map(function (lineParts) {
41956 return lineParts.length;
41957 }).splice(0, active));
41958 lines = _.flatten(lines);
41959 }
41960
41961 // Make sure there's enough lines to paginate
41962 if (lines.length <= pageSize) {
41963 return output;
41964 }
41965
41966 // Move the pointer only when the user go down and limit it to the middle of the list
41967 if (this.pointer < middleOfList && this.lastIndex < active && active - this.lastIndex < pageSize) {
41968 this.pointer = Math.min(middleOfList, this.pointer + active - this.lastIndex);
41969 }
41970 this.lastIndex = active;
41971
41972 // Duplicate the lines so it give an infinite list look
41973 var infinite = _.flatten([lines, lines, lines]);
41974 var topIndex = Math.max(0, active + lines.length - this.pointer);
41975
41976 var section = infinite.splice(topIndex, pageSize).join('\n');
41977 return section + '\n' + chalk.dim('(Move up and down to reveal more choices)');
41978 };
41979
41980 return Paginator;
41981}();
41982
41983module.exports = Paginator;
41984
41985/***/ }),
41986/* 154 */
41987/***/ (function(module, exports, __webpack_require__) {
41988
41989"use strict";
41990
41991
41992Object.defineProperty(exports, "__esModule", {
41993 value: true
41994});
41995exports.run = exports.Add = undefined;
41996
41997var _keys;
41998
41999function _load_keys() {
42000 return _keys = _interopRequireDefault(__webpack_require__(14));
42001}
42002
42003var _set;
42004
42005function _load_set() {
42006 return _set = _interopRequireDefault(__webpack_require__(16));
42007}
42008
42009var _asyncToGenerator2;
42010
42011function _load_asyncToGenerator() {
42012 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
42013}
42014
42015var _getIterator2;
42016
42017function _load_getIterator() {
42018 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
42019}
42020
42021var _extends2;
42022
42023function _load_extends() {
42024 return _extends2 = _interopRequireDefault(__webpack_require__(24));
42025}
42026
42027var _classCallCheck2;
42028
42029function _load_classCallCheck() {
42030 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
42031}
42032
42033var _possibleConstructorReturn2;
42034
42035function _load_possibleConstructorReturn() {
42036 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
42037}
42038
42039var _inherits2;
42040
42041function _load_inherits() {
42042 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
42043}
42044
42045var run = exports.run = function () {
42046 var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
42047 if (!args.length) {
42048 throw new (_errors || _load_errors()).MessageError(reporter.lang('missingAddDependencies'));
42049 }
42050
42051 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
42052
42053 yield (0, (_install || _load_install()).wrapLifecycle)(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
42054 var install = new Add(args, flags, config, reporter, lockfile);
42055 yield install.init();
42056 }));
42057 });
42058
42059 return function run(_x5, _x6, _x7, _x8) {
42060 return _ref13.apply(this, arguments);
42061 };
42062}();
42063
42064exports.hasWrapper = hasWrapper;
42065exports.setFlags = setFlags;
42066
42067var _lockfile;
42068
42069function _load_lockfile() {
42070 return _lockfile = _interopRequireDefault(__webpack_require__(25));
42071}
42072
42073var _normalizePattern2;
42074
42075function _load_normalizePattern() {
42076 return _normalizePattern2 = __webpack_require__(52);
42077}
42078
42079var _workspaceLayout;
42080
42081function _load_workspaceLayout() {
42082 return _workspaceLayout = _interopRequireDefault(__webpack_require__(87));
42083}
42084
42085var _index;
42086
42087function _load_index() {
42088 return _index = __webpack_require__(75);
42089}
42090
42091var _list;
42092
42093function _load_list() {
42094 return _list = __webpack_require__(294);
42095}
42096
42097var _install;
42098
42099function _load_install() {
42100 return _install = __webpack_require__(41);
42101}
42102
42103var _errors;
42104
42105function _load_errors() {
42106 return _errors = __webpack_require__(6);
42107}
42108
42109var _constants;
42110
42111function _load_constants() {
42112 return _constants = _interopRequireWildcard(__webpack_require__(13));
42113}
42114
42115var _fs;
42116
42117function _load_fs() {
42118 return _fs = _interopRequireWildcard(__webpack_require__(8));
42119}
42120
42121var _invariant;
42122
42123function _load_invariant() {
42124 return _invariant = _interopRequireDefault(__webpack_require__(15));
42125}
42126
42127var _path;
42128
42129function _load_path() {
42130 return _path = _interopRequireDefault(__webpack_require__(1));
42131}
42132
42133var _semver;
42134
42135function _load_semver() {
42136 return _semver = _interopRequireDefault(__webpack_require__(27));
42137}
42138
42139function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
42140
42141function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
42142
42143var SILENCE_DEPENDENCY_TYPE_WARNINGS = ['upgrade', 'upgrade-interactive'];
42144
42145var Add = exports.Add = function (_Install) {
42146 (0, (_inherits2 || _load_inherits()).default)(Add, _Install);
42147
42148 function Add(args, flags, config, reporter, lockfile) {
42149 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Add);
42150
42151 var workspaceRootIsCwd = config.cwd === config.lockfileFolder;
42152 var _flags = flags ? (0, (_extends2 || _load_extends()).default)({}, flags, { workspaceRootIsCwd }) : { workspaceRootIsCwd };
42153
42154 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Install.call(this, _flags, config, reporter, lockfile));
42155
42156 _this.args = args;
42157 // only one flag is supported, so we can figure out which one was passed to `yarn add`
42158 _this.flagToOrigin = [flags.dev && 'devDependencies', flags.optional && 'optionalDependencies', flags.peer && 'peerDependencies', 'dependencies'].filter(Boolean).shift();
42159 return _this;
42160 }
42161
42162 /**
42163 * TODO
42164 */
42165
42166 Add.prototype.prepareRequests = function prepareRequests(requests) {
42167 var requestsWithArgs = requests.slice();
42168
42169 for (var _iterator = this.args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
42170 var _ref;
42171
42172 if (_isArray) {
42173 if (_i >= _iterator.length) break;
42174 _ref = _iterator[_i++];
42175 } else {
42176 _i = _iterator.next();
42177 if (_i.done) break;
42178 _ref = _i.value;
42179 }
42180
42181 var _pattern = _ref;
42182
42183 requestsWithArgs.push({
42184 pattern: _pattern,
42185 registry: 'npm',
42186 optional: false
42187 });
42188 }
42189 return requestsWithArgs;
42190 };
42191
42192 /**
42193 * returns version for a pattern based on Manifest
42194 */
42195
42196
42197 Add.prototype.getPatternVersion = function getPatternVersion(pattern, pkg) {
42198 var tilde = this.flags.tilde;
42199 var configPrefix = String(this.config.getOption('save-prefix'));
42200 var exact = this.flags.exact || Boolean(this.config.getOption('save-exact')) || configPrefix === '';
42201
42202 var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern),
42203 hasVersion = _normalizePattern.hasVersion,
42204 range = _normalizePattern.range;
42205
42206 var version = void 0;
42207
42208 if ((0, (_index || _load_index()).getExoticResolver)(pattern)) {
42209 // wasn't a name/range tuple so this is just a raw exotic pattern
42210 version = pattern;
42211 } else if (hasVersion && range && ((_semver || _load_semver()).default.satisfies(pkg.version, range) || (0, (_index || _load_index()).getExoticResolver)(range))) {
42212 // if the user specified a range then use it verbatim
42213 version = range;
42214 }
42215
42216 if (!version || (_semver || _load_semver()).default.valid(version)) {
42217 var prefix = configPrefix || '^';
42218
42219 if (tilde) {
42220 prefix = '~';
42221 } else if (version || exact) {
42222 prefix = '';
42223 }
42224 version = `${prefix}${pkg.version}`;
42225 }
42226
42227 return version;
42228 };
42229
42230 Add.prototype.preparePatterns = function preparePatterns(patterns) {
42231 var preparedPatterns = patterns.slice();
42232 for (var _iterator2 = this.resolver.dedupePatterns(this.args), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
42233 var _ref2;
42234
42235 if (_isArray2) {
42236 if (_i2 >= _iterator2.length) break;
42237 _ref2 = _iterator2[_i2++];
42238 } else {
42239 _i2 = _iterator2.next();
42240 if (_i2.done) break;
42241 _ref2 = _i2.value;
42242 }
42243
42244 var _pattern2 = _ref2;
42245
42246 var pkg = this.resolver.getResolvedPattern(_pattern2);
42247 (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${_pattern2}`);
42248 var _version = this.getPatternVersion(_pattern2, pkg);
42249 var newPattern = `${pkg.name}@${_version}`;
42250 preparedPatterns.push(newPattern);
42251 this.addedPatterns.push(newPattern);
42252 if (newPattern === _pattern2) {
42253 continue;
42254 }
42255 this.resolver.replacePattern(_pattern2, newPattern);
42256 }
42257 return preparedPatterns;
42258 };
42259
42260 Add.prototype.preparePatternsForLinking = function preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) {
42261 // remove the newly added patterns if cwd != root and update the in-memory package dependency instead
42262 if (cwdIsRoot) {
42263 return patterns;
42264 }
42265
42266 var manifest = void 0;
42267 var cwdPackage = `${cwdManifest.name}@${cwdManifest.version}`;
42268 try {
42269 manifest = this.resolver.getStrictResolvedPattern(cwdPackage);
42270 } catch (e) {
42271 this.reporter.warn(this.reporter.lang('unknownPackage', cwdPackage));
42272 return patterns;
42273 }
42274
42275 var newPatterns = patterns;
42276 this._iterateAddedPackages(function (pattern, registry, dependencyType, pkgName, version) {
42277 // remove added package from patterns list
42278 var filtered = newPatterns.filter(function (p) {
42279 return p !== pattern;
42280 });
42281 (0, (_invariant || _load_invariant()).default)(newPatterns.length - filtered.length > 0, `expect added pattern '${pattern}' in the list: ${patterns.toString()}`);
42282 newPatterns = filtered;
42283
42284 // add new package into in-memory manifest so they can be linked properly
42285 manifest[dependencyType] = manifest[dependencyType] || {};
42286 if (manifest[dependencyType][pkgName] === version) {
42287 // package already existed
42288 return;
42289 }
42290
42291 // update dependencies in the manifest
42292 (0, (_invariant || _load_invariant()).default)(manifest._reference, 'manifest._reference should not be null');
42293 var ref = manifest._reference;
42294
42295 ref['dependencies'] = ref['dependencies'] || [];
42296 ref['dependencies'].push(pattern);
42297 });
42298
42299 return newPatterns;
42300 };
42301
42302 Add.prototype.bailout = function () {
42303 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) {
42304 var lockfileCache = this.lockfile.cache;
42305 if (!lockfileCache) {
42306 return false;
42307 }
42308 var match = yield this.integrityChecker.check(patterns, lockfileCache, this.flags, workspaceLayout);
42309 var haveLockfile = yield (_fs || _load_fs()).exists((_path || _load_path()).default.join(this.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME));
42310 if (match.integrityFileMissing && haveLockfile) {
42311 // Integrity file missing, force script installations
42312 this.scripts.setForce(true);
42313 }
42314 return false;
42315 });
42316
42317 function bailout(_x, _x2) {
42318 return _ref3.apply(this, arguments);
42319 }
42320
42321 return bailout;
42322 }();
42323
42324 /**
42325 * Description
42326 */
42327
42328 Add.prototype.init = function () {
42329 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
42330 var isWorkspaceRoot = this.config.workspaceRootFolder && this.config.cwd === this.config.workspaceRootFolder;
42331
42332 // running "yarn add something" in a workspace root is often a mistake
42333 if (isWorkspaceRoot && !this.flags.ignoreWorkspaceRootCheck) {
42334 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('workspacesAddRootCheck'));
42335 }
42336
42337 this.addedPatterns = [];
42338 var patterns = yield (_install || _load_install()).Install.prototype.init.call(this);
42339 yield this.maybeOutputSaveTree(patterns);
42340 return patterns;
42341 });
42342
42343 function init() {
42344 return _ref4.apply(this, arguments);
42345 }
42346
42347 return init;
42348 }();
42349
42350 Add.prototype.applyChanges = function () {
42351 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (manifests) {
42352 var _this2 = this;
42353
42354 yield (_install || _load_install()).Install.prototype.applyChanges.call(this, manifests);
42355
42356 // fill rootPatternsToOrigin without `excludePatterns`
42357 yield (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(this);
42358
42359 this._iterateAddedPackages(function (pattern, registry, dependencyType, pkgName, version) {
42360 // add it to manifest
42361 var object = manifests[registry].object;
42362
42363
42364 object[dependencyType] = object[dependencyType] || {};
42365 object[dependencyType][pkgName] = version;
42366 if (SILENCE_DEPENDENCY_TYPE_WARNINGS.indexOf(_this2.config.commandName) === -1 && dependencyType !== _this2.flagToOrigin) {
42367 _this2.reporter.warn(_this2.reporter.lang('moduleAlreadyInManifest', pkgName, dependencyType, _this2.flagToOrigin));
42368 }
42369 });
42370
42371 return true;
42372 });
42373
42374 function applyChanges(_x3) {
42375 return _ref5.apply(this, arguments);
42376 }
42377
42378 return applyChanges;
42379 }();
42380
42381 /**
42382 * Description
42383 */
42384
42385 Add.prototype.fetchRequestFromCwd = function fetchRequestFromCwd() {
42386 return (_install || _load_install()).Install.prototype.fetchRequestFromCwd.call(this, this.args);
42387 };
42388
42389 /**
42390 * Output a tree of any newly added dependencies.
42391 */
42392
42393 Add.prototype.maybeOutputSaveTree = function () {
42394 var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns) {
42395 // don't limit the shown tree depth
42396 var opts = {
42397 reqDepth: 0
42398 };
42399
42400 // restore the original patterns
42401 var merged = [].concat(patterns, this.addedPatterns);
42402
42403 var _ref7 = yield (0, (_list || _load_list()).buildTree)(this.resolver, this.linker, merged, opts, true, true),
42404 trees = _ref7.trees,
42405 count = _ref7.count;
42406
42407 if (count === 1) {
42408 this.reporter.success(this.reporter.lang('savedNewDependency'));
42409 } else {
42410 this.reporter.success(this.reporter.lang('savedNewDependencies', count));
42411 }
42412
42413 if (!count) {
42414 return;
42415 }
42416
42417 var resolverPatterns = new (_set || _load_set()).default();
42418 for (var _iterator3 = patterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
42419 var _ref8;
42420
42421 if (_isArray3) {
42422 if (_i3 >= _iterator3.length) break;
42423 _ref8 = _iterator3[_i3++];
42424 } else {
42425 _i3 = _iterator3.next();
42426 if (_i3.done) break;
42427 _ref8 = _i3.value;
42428 }
42429
42430 var _pattern3 = _ref8;
42431
42432 var _ref10 = this.resolver.getResolvedPattern(_pattern3) || {},
42433 _version2 = _ref10.version,
42434 name = _ref10.name;
42435
42436 resolverPatterns.add(`${name}@${_version2}`);
42437 }
42438 var directRequireDependencies = trees.filter(function (_ref9) {
42439 var name = _ref9.name;
42440 return resolverPatterns.has(name);
42441 });
42442
42443 this.reporter.info(this.reporter.lang('directDependencies'));
42444 this.reporter.tree('newDirectDependencies', directRequireDependencies);
42445 this.reporter.info(this.reporter.lang('allDependencies'));
42446 this.reporter.tree('newAllDependencies', trees);
42447 });
42448
42449 function maybeOutputSaveTree(_x4) {
42450 return _ref6.apply(this, arguments);
42451 }
42452
42453 return maybeOutputSaveTree;
42454 }();
42455
42456 /**
42457 * Save added packages to manifest if any of the --save flags were used.
42458 */
42459
42460 Add.prototype.savePackages = function () {
42461 var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {});
42462
42463 function savePackages() {
42464 return _ref11.apply(this, arguments);
42465 }
42466
42467 return savePackages;
42468 }();
42469
42470 Add.prototype._iterateAddedPackages = function _iterateAddedPackages(f) {
42471 var _this3 = this;
42472
42473 var patternOrigins = (0, (_keys || _load_keys()).default)(this.rootPatternsToOrigin);
42474
42475 // add new patterns to their appropriate registry manifest
42476
42477 var _loop = function _loop(_pattern4) {
42478 var pkg = _this3.resolver.getResolvedPattern(_pattern4);
42479 (0, (_invariant || _load_invariant()).default)(pkg, `missing package ${_pattern4}`);
42480 var version = _this3.getPatternVersion(_pattern4, pkg);
42481 var ref = pkg._reference;
42482 (0, (_invariant || _load_invariant()).default)(ref, 'expected package reference');
42483 // lookup the package to determine dependency type; used during `yarn upgrade`
42484 var depType = patternOrigins.reduce(function (acc, prev) {
42485 if (prev.indexOf(`${pkg.name}@`) === 0) {
42486 return _this3.rootPatternsToOrigin[prev];
42487 }
42488 return acc;
42489 }, null);
42490
42491 // depType is calculated when `yarn upgrade` command is used
42492 var target = depType || _this3.flagToOrigin;
42493
42494 f(_pattern4, ref.registry, target, pkg.name, version);
42495 };
42496
42497 for (var _iterator4 = this.addedPatterns, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
42498 var _ref12;
42499
42500 if (_isArray4) {
42501 if (_i4 >= _iterator4.length) break;
42502 _ref12 = _iterator4[_i4++];
42503 } else {
42504 _i4 = _iterator4.next();
42505 if (_i4.done) break;
42506 _ref12 = _i4.value;
42507 }
42508
42509 var _pattern4 = _ref12;
42510
42511 _loop(_pattern4);
42512 }
42513 };
42514
42515 return Add;
42516}((_install || _load_install()).Install);
42517
42518function hasWrapper(commander) {
42519 return true;
42520}
42521
42522function setFlags(commander) {
42523 commander.description('Installs a package and any packages that it depends on.');
42524 commander.usage('add [packages ...] [flags]');
42525 commander.option('-W, --ignore-workspace-root-check', 'required to run yarn add inside a workspace root');
42526 commander.option('-D, --dev', 'save package to your `devDependencies`');
42527 commander.option('-P, --peer', 'save package to your `peerDependencies`');
42528 commander.option('-O, --optional', 'save package to your `optionalDependencies`');
42529 commander.option('-E, --exact', 'install exact version');
42530 commander.option('-T, --tilde', 'install most recent release with the same minor version');
42531 commander.option('-A, --audit', 'Run vulnerability audit on installed packages');
42532}
42533
42534/***/ }),
42535/* 155 */
42536/***/ (function(module, exports, __webpack_require__) {
42537
42538"use strict";
42539
42540
42541Object.defineProperty(exports, "__esModule", {
42542 value: true
42543});
42544exports.run = exports.pack = exports.packTarball = undefined;
42545
42546var _promise;
42547
42548function _load_promise() {
42549 return _promise = _interopRequireDefault(__webpack_require__(7));
42550}
42551
42552var _from;
42553
42554function _load_from() {
42555 return _from = _interopRequireDefault(__webpack_require__(53));
42556}
42557
42558var _set;
42559
42560function _load_set() {
42561 return _set = _interopRequireDefault(__webpack_require__(16));
42562}
42563
42564var _getIterator2;
42565
42566function _load_getIterator() {
42567 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
42568}
42569
42570var _asyncToGenerator2;
42571
42572function _load_asyncToGenerator() {
42573 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
42574}
42575
42576var packTarball = exports.packTarball = function () {
42577 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
42578 var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
42579 mapHeader = _ref2.mapHeader;
42580
42581 var pkg = yield config.readRootManifest();
42582 var bundleDependencies = pkg.bundleDependencies,
42583 main = pkg.main,
42584 onlyFiles = pkg.files;
42585
42586 // include required files
42587
42588 var filters = NEVER_IGNORE.slice();
42589 // include default filters unless `files` is used
42590 if (!onlyFiles) {
42591 filters = filters.concat(DEFAULT_IGNORE);
42592 }
42593 if (main) {
42594 filters = filters.concat((0, (_filter || _load_filter()).ignoreLinesToRegex)(['!/' + main]));
42595 }
42596
42597 // include bundleDependencies
42598 var bundleDependenciesFiles = [];
42599 if (bundleDependencies) {
42600 for (var _iterator = bundleDependencies, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
42601 var _ref3;
42602
42603 if (_isArray) {
42604 if (_i >= _iterator.length) break;
42605 _ref3 = _iterator[_i++];
42606 } else {
42607 _i = _iterator.next();
42608 if (_i.done) break;
42609 _ref3 = _i.value;
42610 }
42611
42612 var dependency = _ref3;
42613
42614 var dependencyList = depsFor(dependency, config.cwd);
42615
42616 for (var _iterator2 = dependencyList, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
42617 var _ref4;
42618
42619 if (_isArray2) {
42620 if (_i2 >= _iterator2.length) break;
42621 _ref4 = _iterator2[_i2++];
42622 } else {
42623 _i2 = _iterator2.next();
42624 if (_i2.done) break;
42625 _ref4 = _i2.value;
42626 }
42627
42628 var dep = _ref4;
42629
42630 var filesForBundledDep = yield (_fs || _load_fs()).walk(dep.baseDir, null, new (_set || _load_set()).default(FOLDERS_IGNORE));
42631 bundleDependenciesFiles = bundleDependenciesFiles.concat(filesForBundledDep);
42632 }
42633 }
42634 }
42635
42636 // `files` field
42637 if (onlyFiles) {
42638 var lines = ['*'];
42639 lines = lines.concat(onlyFiles.map(function (filename) {
42640 return `!${filename}`;
42641 }), onlyFiles.map(function (filename) {
42642 return `!${path.join(filename, '**')}`;
42643 }));
42644 var regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines, './');
42645 filters = filters.concat(regexes);
42646 }
42647
42648 var files = yield (_fs || _load_fs()).walk(config.cwd, null, new (_set || _load_set()).default(FOLDERS_IGNORE));
42649 var dotIgnoreFiles = (0, (_filter || _load_filter()).filterOverridenGitignores)(files);
42650
42651 // create ignores
42652 for (var _iterator3 = dotIgnoreFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
42653 var _ref5;
42654
42655 if (_isArray3) {
42656 if (_i3 >= _iterator3.length) break;
42657 _ref5 = _iterator3[_i3++];
42658 } else {
42659 _i3 = _iterator3.next();
42660 if (_i3.done) break;
42661 _ref5 = _i3.value;
42662 }
42663
42664 var file = _ref5;
42665
42666 var raw = yield (_fs || _load_fs()).readFile(file.absolute);
42667 var _lines = raw.split('\n');
42668
42669 var _regexes = (0, (_filter || _load_filter()).ignoreLinesToRegex)(_lines, path.dirname(file.relative));
42670 filters = filters.concat(_regexes);
42671 }
42672
42673 // files to definitely keep, takes precedence over ignore filter
42674 var keepFiles = new (_set || _load_set()).default();
42675
42676 // files to definitely ignore
42677 var ignoredFiles = new (_set || _load_set()).default();
42678
42679 // list of files that didn't match any of our patterns, if a directory in the chain above was matched
42680 // then we should inherit it
42681 var possibleKeepFiles = new (_set || _load_set()).default();
42682
42683 // apply filters
42684 (0, (_filter || _load_filter()).sortFilter)(files, filters, keepFiles, possibleKeepFiles, ignoredFiles);
42685
42686 // add the files for the bundled dependencies to the set of files to keep
42687 for (var _iterator4 = bundleDependenciesFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
42688 var _ref6;
42689
42690 if (_isArray4) {
42691 if (_i4 >= _iterator4.length) break;
42692 _ref6 = _iterator4[_i4++];
42693 } else {
42694 _i4 = _iterator4.next();
42695 if (_i4.done) break;
42696 _ref6 = _i4.value;
42697 }
42698
42699 var _file = _ref6;
42700
42701 var realPath = yield (_fs || _load_fs()).realpath(config.cwd);
42702 keepFiles.add(path.relative(realPath, _file.absolute));
42703 }
42704
42705 return packWithIgnoreAndHeaders(config.cwd, function (name) {
42706 var relative = path.relative(config.cwd, name);
42707 // Don't ignore directories, since we need to recurse inside them to check for unignored files.
42708 if (fs2.lstatSync(name).isDirectory()) {
42709 var isParentOfKeptFile = (0, (_from || _load_from()).default)(keepFiles).some(function (name) {
42710 return !path.relative(relative, name).startsWith('..');
42711 });
42712 return !isParentOfKeptFile;
42713 }
42714 // Otherwise, ignore a file if we're not supposed to keep it.
42715 return !keepFiles.has(relative);
42716 }, { mapHeader });
42717 });
42718
42719 return function packTarball(_x) {
42720 return _ref.apply(this, arguments);
42721 };
42722}();
42723
42724var pack = exports.pack = function () {
42725 var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
42726 var packer = yield packTarball(config);
42727 var compressor = packer.pipe(new zlib.Gzip());
42728
42729 return compressor;
42730 });
42731
42732 return function pack(_x4) {
42733 return _ref8.apply(this, arguments);
42734 };
42735}();
42736
42737var run = exports.run = function () {
42738 var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
42739 var pkg = yield config.readRootManifest();
42740 if (!pkg.name) {
42741 throw new (_errors || _load_errors()).MessageError(reporter.lang('noName'));
42742 }
42743 if (!pkg.version) {
42744 throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion'));
42745 }
42746
42747 var normaliseScope = function normaliseScope(name) {
42748 return name[0] === '@' ? name.substr(1).replace('/', '-') : name;
42749 };
42750 var filename = flags.filename || path.join(config.cwd, `${normaliseScope(pkg.name)}-v${pkg.version}.tgz`);
42751
42752 yield config.executeLifecycleScript('prepack');
42753
42754 var stream = yield pack(config);
42755
42756 yield new (_promise || _load_promise()).default(function (resolve, reject) {
42757 stream.pipe(fs2.createWriteStream(filename));
42758 stream.on('error', reject);
42759 stream.on('close', resolve);
42760 });
42761
42762 yield config.executeLifecycleScript('postpack');
42763
42764 reporter.success(reporter.lang('packWroteTarball', filename));
42765 });
42766
42767 return function run(_x5, _x6, _x7, _x8) {
42768 return _ref9.apply(this, arguments);
42769 };
42770}();
42771
42772exports.packWithIgnoreAndHeaders = packWithIgnoreAndHeaders;
42773exports.setFlags = setFlags;
42774exports.hasWrapper = hasWrapper;
42775
42776var _fs;
42777
42778function _load_fs() {
42779 return _fs = _interopRequireWildcard(__webpack_require__(8));
42780}
42781
42782var _filter;
42783
42784function _load_filter() {
42785 return _filter = __webpack_require__(309);
42786}
42787
42788var _errors;
42789
42790function _load_errors() {
42791 return _errors = __webpack_require__(6);
42792}
42793
42794function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
42795
42796function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
42797
42798var zlib = __webpack_require__(188);
42799var path = __webpack_require__(1);
42800var tar = __webpack_require__(184);
42801var fs2 = __webpack_require__(12);
42802var depsFor = __webpack_require__(738);
42803
42804var FOLDERS_IGNORE = [
42805// never allow version control folders
42806'.git', 'CVS', '.svn', '.hg', 'node_modules'];
42807
42808var DEFAULT_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([].concat(FOLDERS_IGNORE, [
42809
42810// ignore cruft
42811'yarn.lock', '.lock-wscript', '.wafpickle-{0..9}', '*.swp', '._*', 'npm-debug.log', 'yarn-error.log', '.npmrc', '.yarnrc', '.yarnrc.yml', '.npmignore', '.gitignore', '.DS_Store']));
42812
42813var NEVER_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([
42814// never ignore these files
42815'!/package.json', '!/readme*', '!/+(license|licence)*', '!/+(changes|changelog|history)*']);
42816
42817function packWithIgnoreAndHeaders(cwd, ignoreFunction) {
42818 var _ref7 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
42819 mapHeader = _ref7.mapHeader;
42820
42821 return tar.pack(cwd, {
42822 ignore: ignoreFunction,
42823 sort: true,
42824 map: function map(header) {
42825 var suffix = header.name === '.' ? '' : `/${header.name}`;
42826 header.name = `package${suffix}`;
42827 delete header.uid;
42828 delete header.gid;
42829 return mapHeader ? mapHeader(header) : header;
42830 }
42831 });
42832}
42833
42834function setFlags(commander) {
42835 commander.description('Creates a compressed gzip archive of package dependencies.');
42836 commander.option('-f, --filename <filename>', 'filename');
42837}
42838
42839function hasWrapper(commander, args) {
42840 return true;
42841}
42842
42843/***/ }),
42844/* 156 */
42845/***/ (function(module, exports, __webpack_require__) {
42846
42847"use strict";
42848
42849
42850Object.defineProperty(exports, "__esModule", {
42851 value: true
42852});
42853
42854var _stringify;
42855
42856function _load_stringify() {
42857 return _stringify = _interopRequireDefault(__webpack_require__(36));
42858}
42859
42860var _getIterator2;
42861
42862function _load_getIterator() {
42863 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
42864}
42865
42866var _keys;
42867
42868function _load_keys() {
42869 return _keys = _interopRequireDefault(__webpack_require__(14));
42870}
42871
42872var _asyncToGenerator2;
42873
42874function _load_asyncToGenerator() {
42875 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
42876}
42877
42878var _promise;
42879
42880function _load_promise() {
42881 return _promise = _interopRequireDefault(__webpack_require__(7));
42882}
42883
42884var _classCallCheck2;
42885
42886function _load_classCallCheck() {
42887 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
42888}
42889
42890var _index;
42891
42892function _load_index() {
42893 return _index = _interopRequireDefault(__webpack_require__(206));
42894}
42895
42896var _constants;
42897
42898function _load_constants() {
42899 return _constants = _interopRequireWildcard(__webpack_require__(13));
42900}
42901
42902var _fs;
42903
42904function _load_fs() {
42905 return _fs = _interopRequireWildcard(__webpack_require__(8));
42906}
42907
42908var _mutex;
42909
42910function _load_mutex() {
42911 return _mutex = _interopRequireDefault(__webpack_require__(312));
42912}
42913
42914function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
42915
42916function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
42917
42918/* eslint no-unused-vars: 0 */
42919
42920var cmdShim = __webpack_require__(190);
42921var path = __webpack_require__(1);
42922
42923var BaseFetcher = function () {
42924 function BaseFetcher(dest, remote, config) {
42925 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseFetcher);
42926
42927 this.reporter = config.reporter;
42928 this.packageName = remote.packageName;
42929 this.reference = remote.reference;
42930 this.registry = remote.registry;
42931 this.hash = remote.hash;
42932 this.remote = remote;
42933 this.config = config;
42934 this.dest = dest;
42935 }
42936
42937 BaseFetcher.prototype.setupMirrorFromCache = function setupMirrorFromCache() {
42938 // fetcher subclasses may use this to perform actions such as copying over a cached tarball to the offline
42939 // mirror etc
42940 return (_promise || _load_promise()).default.resolve();
42941 };
42942
42943 BaseFetcher.prototype._fetch = function _fetch() {
42944 return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
42945 };
42946
42947 BaseFetcher.prototype.fetch = function fetch(defaultManifest) {
42948 var _this = this;
42949
42950 return (_fs || _load_fs()).lockQueue.push(this.dest, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
42951 yield (_fs || _load_fs()).mkdirp(_this.dest);
42952
42953 // fetch package and get the hash
42954
42955 var _ref2 = yield _this._fetch(),
42956 hash = _ref2.hash;
42957
42958 var pkg = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
42959 // load the new normalized manifest
42960 try {
42961 return yield _this.config.readManifest(_this.dest, _this.registry);
42962 } catch (e) {
42963 if (e.code === 'ENOENT' && defaultManifest) {
42964 return (0, (_index || _load_index()).default)(defaultManifest, _this.dest, _this.config, false);
42965 } else {
42966 throw e;
42967 }
42968 }
42969 })();
42970
42971 if (pkg.bin) {
42972 for (var _iterator = (0, (_keys || _load_keys()).default)(pkg.bin), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
42973 var _ref4;
42974
42975 if (_isArray) {
42976 if (_i >= _iterator.length) break;
42977 _ref4 = _iterator[_i++];
42978 } else {
42979 _i = _iterator.next();
42980 if (_i.done) break;
42981 _ref4 = _i.value;
42982 }
42983
42984 var binName = _ref4;
42985
42986 var binDest = `${_this.dest}/.bin`;
42987
42988 // Using any sort of absolute path here would prevent makePortableProxyScript from preserving symlinks when
42989 // calling the binary
42990 var src = path.resolve(_this.dest, pkg.bin[binName]);
42991
42992 if (yield (_fs || _load_fs()).exists(src)) {
42993 // We ensure that the target is executable
42994 yield (_fs || _load_fs()).chmod(src, 0o755);
42995 }
42996
42997 yield (_fs || _load_fs()).mkdirp(binDest);
42998 if (process.platform === 'win32') {
42999 var unlockMutex = yield (0, (_mutex || _load_mutex()).default)(src);
43000 try {
43001 yield cmdShim.ifExists(src, `${binDest}/${binName}`, { createPwshFile: false });
43002 } finally {
43003 unlockMutex();
43004 }
43005 } else {
43006 yield (_fs || _load_fs()).symlink(src, `${binDest}/${binName}`);
43007 }
43008 }
43009 }
43010
43011 yield (_fs || _load_fs()).writeFile(path.join(_this.dest, (_constants || _load_constants()).METADATA_FILENAME), (0, (_stringify || _load_stringify()).default)({
43012 manifest: pkg,
43013 artifacts: [],
43014 remote: _this.remote,
43015 registry: _this.registry,
43016 hash
43017 }, null, ' '));
43018
43019 return {
43020 hash,
43021 dest: _this.dest,
43022 package: pkg,
43023 cached: false
43024 };
43025 }));
43026 };
43027
43028 return BaseFetcher;
43029}();
43030
43031exports.default = BaseFetcher;
43032
43033/***/ }),
43034/* 157 */
43035/***/ (function(module, exports, __webpack_require__) {
43036
43037"use strict";
43038
43039
43040Object.defineProperty(exports, "__esModule", {
43041 value: true
43042});
43043
43044var _promise;
43045
43046function _load_promise() {
43047 return _promise = _interopRequireDefault(__webpack_require__(7));
43048}
43049
43050var _keys;
43051
43052function _load_keys() {
43053 return _keys = _interopRequireDefault(__webpack_require__(14));
43054}
43055
43056var _stringify;
43057
43058function _load_stringify() {
43059 return _stringify = _interopRequireDefault(__webpack_require__(36));
43060}
43061
43062var _classCallCheck2;
43063
43064function _load_classCallCheck() {
43065 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
43066}
43067
43068var _map;
43069
43070function _load_map() {
43071 return _map = _interopRequireDefault(__webpack_require__(51));
43072}
43073
43074function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43075
43076var debug = __webpack_require__(651)('yarn');
43077
43078var BlockingQueue = function () {
43079 function BlockingQueue(alias) {
43080 var maxConcurrency = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Infinity;
43081 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BlockingQueue);
43082
43083 this.concurrencyQueue = [];
43084 this.maxConcurrency = maxConcurrency;
43085 this.runningCount = 0;
43086 this.warnedStuck = false;
43087 this.alias = alias;
43088 this.first = true;
43089
43090 this.running = (0, (_map || _load_map()).default)();
43091 this.queue = (0, (_map || _load_map()).default)();
43092
43093 this.stuckTick = this.stuckTick.bind(this);
43094 }
43095
43096 BlockingQueue.prototype.stillActive = function stillActive() {
43097 if (this.stuckTimer) {
43098 clearTimeout(this.stuckTimer);
43099 }
43100
43101 this.stuckTimer = setTimeout(this.stuckTick, 5000);
43102
43103 // We need to check the existence of unref because of https://github.com/facebook/jest/issues/4559
43104 // $FlowFixMe: Node's setInterval returns a Timeout, not a Number
43105 this.stuckTimer.unref && this.stuckTimer.unref();
43106 };
43107
43108 BlockingQueue.prototype.stuckTick = function stuckTick() {
43109 if (this.runningCount === 1) {
43110 this.warnedStuck = true;
43111 debug(`The ${(0, (_stringify || _load_stringify()).default)(this.alias)} blocking queue may be stuck. 5 seconds ` + `without any activity with 1 worker: ${(0, (_keys || _load_keys()).default)(this.running)[0]}`);
43112 }
43113 };
43114
43115 BlockingQueue.prototype.push = function push(key, factory) {
43116 var _this = this;
43117
43118 if (this.first) {
43119 this.first = false;
43120 } else {
43121 this.stillActive();
43122 }
43123
43124 return new (_promise || _load_promise()).default(function (resolve, reject) {
43125 // we're already running so push ourselves to the queue
43126 var queue = _this.queue[key] = _this.queue[key] || [];
43127 queue.push({ factory, resolve, reject });
43128
43129 if (!_this.running[key]) {
43130 _this.shift(key);
43131 }
43132 });
43133 };
43134
43135 BlockingQueue.prototype.shift = function shift(key) {
43136 var _this2 = this;
43137
43138 if (this.running[key]) {
43139 delete this.running[key];
43140 this.runningCount--;
43141
43142 if (this.stuckTimer) {
43143 clearTimeout(this.stuckTimer);
43144 this.stuckTimer = null;
43145 }
43146
43147 if (this.warnedStuck) {
43148 this.warnedStuck = false;
43149 debug(`${(0, (_stringify || _load_stringify()).default)(this.alias)} blocking queue finally resolved. Nothing to worry about.`);
43150 }
43151 }
43152
43153 var queue = this.queue[key];
43154 if (!queue) {
43155 return;
43156 }
43157
43158 var _queue$shift = queue.shift(),
43159 resolve = _queue$shift.resolve,
43160 reject = _queue$shift.reject,
43161 factory = _queue$shift.factory;
43162
43163 if (!queue.length) {
43164 delete this.queue[key];
43165 }
43166
43167 var next = function next() {
43168 _this2.shift(key);
43169 _this2.shiftConcurrencyQueue();
43170 };
43171
43172 var run = function run() {
43173 _this2.running[key] = true;
43174 _this2.runningCount++;
43175
43176 factory().then(function (val) {
43177 resolve(val);
43178 next();
43179 return null;
43180 }).catch(function (err) {
43181 reject(err);
43182 next();
43183 });
43184 };
43185
43186 this.maybePushConcurrencyQueue(run);
43187 };
43188
43189 BlockingQueue.prototype.maybePushConcurrencyQueue = function maybePushConcurrencyQueue(run) {
43190 if (this.runningCount < this.maxConcurrency) {
43191 run();
43192 } else {
43193 this.concurrencyQueue.push(run);
43194 }
43195 };
43196
43197 BlockingQueue.prototype.shiftConcurrencyQueue = function shiftConcurrencyQueue() {
43198 if (this.runningCount < this.maxConcurrency) {
43199 var fn = this.concurrencyQueue.shift();
43200 if (fn) {
43201 fn();
43202 }
43203 }
43204 };
43205
43206 return BlockingQueue;
43207}();
43208
43209exports.default = BlockingQueue;
43210
43211/***/ }),
43212/* 158 */
43213/***/ (function(module, exports, __webpack_require__) {
43214
43215"use strict";
43216
43217
43218Object.defineProperty(exports, "__esModule", {
43219 value: true
43220});
43221exports.HashStream = undefined;
43222
43223var _classCallCheck2;
43224
43225function _load_classCallCheck() {
43226 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
43227}
43228
43229var _possibleConstructorReturn2;
43230
43231function _load_possibleConstructorReturn() {
43232 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
43233}
43234
43235var _inherits2;
43236
43237function _load_inherits() {
43238 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
43239}
43240
43241exports.hash = hash;
43242
43243function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43244
43245var crypto = __webpack_require__(21);
43246var stream = __webpack_require__(35);
43247
43248function hash(content) {
43249 var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'md5';
43250
43251 return crypto.createHash(type).update(content).digest('hex');
43252}
43253
43254var HashStream = exports.HashStream = function (_stream$Transform) {
43255 (0, (_inherits2 || _load_inherits()).default)(HashStream, _stream$Transform);
43256
43257 function HashStream(options) {
43258 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, HashStream);
43259
43260 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _stream$Transform.call(this, options));
43261
43262 _this._hash = crypto.createHash('sha1');
43263 _this._updated = false;
43264 return _this;
43265 }
43266
43267 HashStream.prototype._transform = function _transform(chunk, encoding, callback) {
43268 this._updated = true;
43269 this._hash.update(chunk);
43270 callback(null, chunk);
43271 };
43272
43273 HashStream.prototype.getHash = function getHash() {
43274 return this._hash.digest('hex');
43275 };
43276
43277 HashStream.prototype.test = function test(sum) {
43278 return this._updated && sum === this.getHash();
43279 };
43280
43281 return HashStream;
43282}(stream.Transform);
43283
43284/***/ }),
43285/* 159 */
43286/***/ (function(module, exports, __webpack_require__) {
43287
43288"use strict";
43289
43290
43291Object.defineProperty(exports, "__esModule", {
43292 value: true
43293});
43294
43295var _getIterator2;
43296
43297function _load_getIterator() {
43298 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
43299}
43300
43301exports.default = guessName;
43302
43303var _url;
43304
43305function _load_url() {
43306 return _url = _interopRequireDefault(__webpack_require__(29));
43307}
43308
43309function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43310
43311function cleanup(name) {
43312 name = name.replace(/-\d+\.\d+\.\d+/, '');
43313 return name.replace(/\.git$|\.zip$|\.tar\.gz$|\.tar\.bz2$/, '');
43314}
43315
43316function guessNameFallback(source) {
43317 // If cannot parse as url, just return cleaned up last part
43318 var parts = source.split('/');
43319 return cleanup(parts[parts.length - 1]);
43320}
43321
43322function guessName(source) {
43323 try {
43324 var parsed = (_url || _load_url()).default.parse(source);
43325
43326 if (!parsed.pathname) {
43327 return guessNameFallback(source);
43328 }
43329
43330 var parts = parsed.pathname.split('/');
43331
43332 // Priority goes to part that ends with .git
43333 for (var _iterator = parts, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
43334 var _ref;
43335
43336 if (_isArray) {
43337 if (_i >= _iterator.length) break;
43338 _ref = _iterator[_i++];
43339 } else {
43340 _i = _iterator.next();
43341 if (_i.done) break;
43342 _ref = _i.value;
43343 }
43344
43345 var part = _ref;
43346
43347 if (part.match(/\.git$/)) {
43348 return cleanup(part);
43349 }
43350 }
43351
43352 // Most likely a directory
43353 if (parsed.host == null) {
43354 return cleanup(parts[parts.length - 1]);
43355 }
43356
43357 // A site like github or gitlab
43358 if (parts.length > 2) {
43359 return cleanup(parts[2]);
43360 }
43361
43362 // Privately hosted package?
43363 if (parts.length > 1) {
43364 return cleanup(parts[1]);
43365 }
43366
43367 return guessNameFallback(source);
43368 } catch (e) {
43369 return guessNameFallback(source);
43370 }
43371}
43372
43373/***/ }),
43374/* 160 */
43375/***/ (function(module, exports, __webpack_require__) {
43376
43377"use strict";
43378
43379
43380Object.defineProperty(exports, "__esModule", {
43381 value: true
43382});
43383exports.satisfiesWithPrereleases = satisfiesWithPrereleases;
43384exports.diffWithUnstable = diffWithUnstable;
43385
43386var _semver;
43387
43388function _load_semver() {
43389 return _semver = _interopRequireDefault(__webpack_require__(27));
43390}
43391
43392function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
43393
43394/**
43395 * Returns whether the given semver version satisfies the given range. Notably this supports
43396 * prerelease versions so that "2.0.0-rc.0" satisfies the range ">=1.0.0", for example.
43397 */
43398
43399function satisfiesWithPrereleases(version, range) {
43400 var loose = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
43401
43402 var semverRange = void 0;
43403 try {
43404 // $FlowFixMe: Add a definition for the Range class
43405 semverRange = new (_semver || _load_semver()).default.Range(range, loose);
43406 } catch (err) {
43407 return false;
43408 }
43409
43410 if (!version) {
43411 return false;
43412 }
43413 var semverVersion = void 0;
43414 try {
43415 semverVersion = new (_semver || _load_semver()).default.SemVer(version, semverRange.loose);
43416 } catch (err) {
43417 return false;
43418 }
43419
43420 // A range has multiple sets of comparators. A version must satisfy all comparators in a set
43421 // and at least one set to satisfy the range.
43422 return semverRange.set.some(function (comparatorSet) {
43423 // node-semver converts ~ and ^ ranges into pairs of >= and < ranges but the upper bounds don't
43424 // properly exclude prerelease versions. For example, "^1.0.0" is converted to ">=1.0.0 <2.0.0",
43425 // which includes "2.0.0-pre" since prerelease versions are lower than their non-prerelease
43426 // counterparts. As a practical workaround we make upper-bound ranges exclude prereleases and
43427 // convert "<2.0.0" to "<2.0.0-0", for example.
43428 comparatorSet = comparatorSet.map(function (comparator) {
43429 if (comparator.operator !== '<' || !comparator.value || comparator.semver.prerelease.length) {
43430 return comparator;
43431 }
43432
43433 // "0" is the lowest prerelease version
43434 comparator.semver.inc('pre', 0);
43435
43436 var comparatorString = comparator.operator + comparator.semver.version;
43437 // $FlowFixMe: Add a definition for the Comparator class
43438 return new (_semver || _load_semver()).default.Comparator(comparatorString, comparator.loose);
43439 });
43440
43441 return !comparatorSet.some(function (comparator) {
43442 return !comparator.test(semverVersion);
43443 });
43444 });
43445}
43446
43447var PRE_RELEASES = {
43448 major: 'premajor',
43449 minor: 'preminor',
43450 patch: 'prepatch'
43451};
43452
43453/**
43454 * Returns the difference between two versions as a semantic string representation.
43455 * Similar to the `diff` method in node-semver, but it also accounts for unstable versions,
43456 * like 0.x.x or 0.0.x.
43457 */
43458
43459function diffWithUnstable(version1, version2) {
43460 if ((_semver || _load_semver()).default.eq(version1, version2) === false) {
43461 var v1 = (_semver || _load_semver()).default.parse(version1);
43462 var v2 = (_semver || _load_semver()).default.parse(version2);
43463
43464 if (v1 != null && v2 != null) {
43465 var isPreRelease = v1.prerelease.length > 0 || v2.prerelease.length > 0;
43466 var preMajor = v1.major === 0 || v2.major === 0;
43467 var preMinor = preMajor && (v1.minor === 0 || v2.minor === 0);
43468
43469 var diff = null;
43470
43471 if (v1.major !== v2.major) {
43472 diff = 'major';
43473 } else if (v1.minor !== v2.minor) {
43474 if (preMajor) {
43475 // If the major version number is zero (0.x.x), treat a change
43476 // of the minor version number as a major change.
43477 diff = 'major';
43478 } else {
43479 diff = 'minor';
43480 }
43481 } else if (v1.patch !== v2.patch) {
43482 if (preMinor) {
43483 // If the major & minor version numbers are zero (0.0.x), treat a change
43484 // of the patch version number as a major change.
43485 diff = 'major';
43486 } else if (preMajor) {
43487 // If the major version number is zero (0.x.x), treat a change
43488 // of the patch version number as a minor change.
43489 diff = 'minor';
43490 } else {
43491 diff = 'patch';
43492 }
43493 }
43494
43495 if (isPreRelease) {
43496 if (diff != null) {
43497 diff = PRE_RELEASES[diff];
43498 } else {
43499 diff = 'prerelease';
43500 }
43501 }
43502
43503 return diff;
43504 }
43505 }
43506
43507 return null;
43508}
43509
43510/***/ }),
43511/* 161 */
43512/***/ (function(module, exports, __webpack_require__) {
43513
43514// 7.1.15 ToLength
43515var toInteger = __webpack_require__(226);
43516var min = Math.min;
43517module.exports = function (it) {
43518 return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
43519};
43520
43521
43522/***/ }),
43523/* 162 */
43524/***/ (function(module, exports) {
43525
43526var id = 0;
43527var px = Math.random();
43528module.exports = function (key) {
43529 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
43530};
43531
43532
43533/***/ }),
43534/* 163 */
43535/***/ (function(module, exports) {
43536
43537
43538
43539/***/ }),
43540/* 164 */
43541/***/ (function(module, exports, __webpack_require__) {
43542
43543var once = __webpack_require__(133);
43544
43545var noop = function() {};
43546
43547var isRequest = function(stream) {
43548 return stream.setHeader && typeof stream.abort === 'function';
43549};
43550
43551var isChildProcess = function(stream) {
43552 return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
43553};
43554
43555var eos = function(stream, opts, callback) {
43556 if (typeof opts === 'function') return eos(stream, null, opts);
43557 if (!opts) opts = {};
43558
43559 callback = once(callback || noop);
43560
43561 var ws = stream._writableState;
43562 var rs = stream._readableState;
43563 var readable = opts.readable || (opts.readable !== false && stream.readable);
43564 var writable = opts.writable || (opts.writable !== false && stream.writable);
43565
43566 var onlegacyfinish = function() {
43567 if (!stream.writable) onfinish();
43568 };
43569
43570 var onfinish = function() {
43571 writable = false;
43572 if (!readable) callback.call(stream);
43573 };
43574
43575 var onend = function() {
43576 readable = false;
43577 if (!writable) callback.call(stream);
43578 };
43579
43580 var onexit = function(exitCode) {
43581 callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
43582 };
43583
43584 var onerror = function(err) {
43585 callback.call(stream, err);
43586 };
43587
43588 var onclose = function() {
43589 if (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close'));
43590 if (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close'));
43591 };
43592
43593 var onrequest = function() {
43594 stream.req.on('finish', onfinish);
43595 };
43596
43597 if (isRequest(stream)) {
43598 stream.on('complete', onfinish);
43599 stream.on('abort', onclose);
43600 if (stream.req) onrequest();
43601 else stream.on('request', onrequest);
43602 } else if (writable && !ws) { // legacy streams
43603 stream.on('end', onlegacyfinish);
43604 stream.on('close', onlegacyfinish);
43605 }
43606
43607 if (isChildProcess(stream)) stream.on('exit', onexit);
43608
43609 stream.on('end', onend);
43610 stream.on('finish', onfinish);
43611 if (opts.error !== false) stream.on('error', onerror);
43612 stream.on('close', onclose);
43613
43614 return function() {
43615 stream.removeListener('complete', onfinish);
43616 stream.removeListener('abort', onclose);
43617 stream.removeListener('request', onrequest);
43618 if (stream.req) stream.req.removeListener('finish', onfinish);
43619 stream.removeListener('end', onlegacyfinish);
43620 stream.removeListener('close', onlegacyfinish);
43621 stream.removeListener('finish', onfinish);
43622 stream.removeListener('exit', onexit);
43623 stream.removeListener('end', onend);
43624 stream.removeListener('error', onerror);
43625 stream.removeListener('close', onclose);
43626 };
43627};
43628
43629module.exports = eos;
43630
43631
43632/***/ }),
43633/* 165 */
43634/***/ (function(module, exports, __webpack_require__) {
43635
43636// Copyright 2012 Joyent, Inc. All rights reserved.
43637
43638var assert = __webpack_require__(22);
43639var sshpk = __webpack_require__(268);
43640var util = __webpack_require__(9);
43641
43642var HASH_ALGOS = {
43643 'sha1': true,
43644 'sha256': true,
43645 'sha512': true
43646};
43647
43648var PK_ALGOS = {
43649 'rsa': true,
43650 'dsa': true,
43651 'ecdsa': true
43652};
43653
43654function HttpSignatureError(message, caller) {
43655 if (Error.captureStackTrace)
43656 Error.captureStackTrace(this, caller || HttpSignatureError);
43657
43658 this.message = message;
43659 this.name = caller.name;
43660}
43661util.inherits(HttpSignatureError, Error);
43662
43663function InvalidAlgorithmError(message) {
43664 HttpSignatureError.call(this, message, InvalidAlgorithmError);
43665}
43666util.inherits(InvalidAlgorithmError, HttpSignatureError);
43667
43668function validateAlgorithm(algorithm) {
43669 var alg = algorithm.toLowerCase().split('-');
43670
43671 if (alg.length !== 2) {
43672 throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' is not a ' +
43673 'valid algorithm'));
43674 }
43675
43676 if (alg[0] !== 'hmac' && !PK_ALGOS[alg[0]]) {
43677 throw (new InvalidAlgorithmError(alg[0].toUpperCase() + ' type keys ' +
43678 'are not supported'));
43679 }
43680
43681 if (!HASH_ALGOS[alg[1]]) {
43682 throw (new InvalidAlgorithmError(alg[1].toUpperCase() + ' is not a ' +
43683 'supported hash algorithm'));
43684 }
43685
43686 return (alg);
43687}
43688
43689///--- API
43690
43691module.exports = {
43692
43693 HASH_ALGOS: HASH_ALGOS,
43694 PK_ALGOS: PK_ALGOS,
43695
43696 HttpSignatureError: HttpSignatureError,
43697 InvalidAlgorithmError: InvalidAlgorithmError,
43698
43699 validateAlgorithm: validateAlgorithm,
43700
43701 /**
43702 * Converts an OpenSSH public key (rsa only) to a PKCS#8 PEM file.
43703 *
43704 * The intent of this module is to interoperate with OpenSSL only,
43705 * specifically the node crypto module's `verify` method.
43706 *
43707 * @param {String} key an OpenSSH public key.
43708 * @return {String} PEM encoded form of the RSA public key.
43709 * @throws {TypeError} on bad input.
43710 * @throws {Error} on invalid ssh key formatted data.
43711 */
43712 sshKeyToPEM: function sshKeyToPEM(key) {
43713 assert.string(key, 'ssh_key');
43714
43715 var k = sshpk.parseKey(key, 'ssh');
43716 return (k.toString('pem'));
43717 },
43718
43719
43720 /**
43721 * Generates an OpenSSH fingerprint from an ssh public key.
43722 *
43723 * @param {String} key an OpenSSH public key.
43724 * @return {String} key fingerprint.
43725 * @throws {TypeError} on bad input.
43726 * @throws {Error} if what you passed doesn't look like an ssh public key.
43727 */
43728 fingerprint: function fingerprint(key) {
43729 assert.string(key, 'ssh_key');
43730
43731 var k = sshpk.parseKey(key, 'ssh');
43732 return (k.fingerprint('md5').toString('hex'));
43733 },
43734
43735 /**
43736 * Converts a PKGCS#8 PEM file to an OpenSSH public key (rsa)
43737 *
43738 * The reverse of the above function.
43739 */
43740 pemToRsaSSHKey: function pemToRsaSSHKey(pem, comment) {
43741 assert.equal('string', typeof (pem), 'typeof pem');
43742
43743 var k = sshpk.parseKey(pem, 'pem');
43744 k.comment = comment;
43745 return (k.toString('ssh'));
43746 }
43747};
43748
43749
43750/***/ }),
43751/* 166 */
43752/***/ (function(module, exports) {
43753
43754/*!
43755 * is-extglob <https://github.com/jonschlinkert/is-extglob>
43756 *
43757 * Copyright (c) 2014-2015, Jon Schlinkert.
43758 * Licensed under the MIT License.
43759 */
43760
43761module.exports = function isExtglob(str) {
43762 return typeof str === 'string'
43763 && /[@?!+*]\(/.test(str);
43764};
43765
43766
43767/***/ }),
43768/* 167 */
43769/***/ (function(module, exports, __webpack_require__) {
43770
43771/*!
43772 * is-glob <https://github.com/jonschlinkert/is-glob>
43773 *
43774 * Copyright (c) 2014-2015, Jon Schlinkert.
43775 * Licensed under the MIT License.
43776 */
43777
43778var isExtglob = __webpack_require__(166);
43779
43780module.exports = function isGlob(str) {
43781 return typeof str === 'string'
43782 && (/[*!?{}(|)[\]]/.test(str)
43783 || isExtglob(str));
43784};
43785
43786/***/ }),
43787/* 168 */
43788/***/ (function(module, exports, __webpack_require__) {
43789
43790"use strict";
43791// JS-YAML's default schema for `load` function.
43792// It is not described in the YAML specification.
43793//
43794// This schema is based on JS-YAML's default safe schema and includes
43795// JavaScript-specific types: !!js/undefined, !!js/regexp and !!js/function.
43796//
43797// Also this schema is used as default base schema at `Schema.create` function.
43798
43799
43800
43801
43802
43803var Schema = __webpack_require__(108);
43804
43805
43806module.exports = Schema.DEFAULT = new Schema({
43807 include: [
43808 __webpack_require__(132)
43809 ],
43810 explicit: [
43811 __webpack_require__(805),
43812 __webpack_require__(804),
43813 __webpack_require__(803)
43814 ]
43815});
43816
43817
43818/***/ }),
43819/* 169 */
43820/***/ (function(module, exports, __webpack_require__) {
43821
43822var isBuffer = __webpack_require__(778);
43823var toString = Object.prototype.toString;
43824
43825/**
43826 * Get the native `typeof` a value.
43827 *
43828 * @param {*} `val`
43829 * @return {*} Native javascript type
43830 */
43831
43832module.exports = function kindOf(val) {
43833 // primitivies
43834 if (typeof val === 'undefined') {
43835 return 'undefined';
43836 }
43837 if (val === null) {
43838 return 'null';
43839 }
43840 if (val === true || val === false || val instanceof Boolean) {
43841 return 'boolean';
43842 }
43843 if (typeof val === 'string' || val instanceof String) {
43844 return 'string';
43845 }
43846 if (typeof val === 'number' || val instanceof Number) {
43847 return 'number';
43848 }
43849
43850 // functions
43851 if (typeof val === 'function' || val instanceof Function) {
43852 return 'function';
43853 }
43854
43855 // array
43856 if (typeof Array.isArray !== 'undefined' && Array.isArray(val)) {
43857 return 'array';
43858 }
43859
43860 // check for instances of RegExp and Date before calling `toString`
43861 if (val instanceof RegExp) {
43862 return 'regexp';
43863 }
43864 if (val instanceof Date) {
43865 return 'date';
43866 }
43867
43868 // other objects
43869 var type = toString.call(val);
43870
43871 if (type === '[object RegExp]') {
43872 return 'regexp';
43873 }
43874 if (type === '[object Date]') {
43875 return 'date';
43876 }
43877 if (type === '[object Arguments]') {
43878 return 'arguments';
43879 }
43880 if (type === '[object Error]') {
43881 return 'error';
43882 }
43883
43884 // buffer
43885 if (isBuffer(val)) {
43886 return 'buffer';
43887 }
43888
43889 // es6: Map, WeakMap, Set, WeakSet
43890 if (type === '[object Set]') {
43891 return 'set';
43892 }
43893 if (type === '[object WeakSet]') {
43894 return 'weakset';
43895 }
43896 if (type === '[object Map]') {
43897 return 'map';
43898 }
43899 if (type === '[object WeakMap]') {
43900 return 'weakmap';
43901 }
43902 if (type === '[object Symbol]') {
43903 return 'symbol';
43904 }
43905
43906 // typed arrays
43907 if (type === '[object Int8Array]') {
43908 return 'int8array';
43909 }
43910 if (type === '[object Uint8Array]') {
43911 return 'uint8array';
43912 }
43913 if (type === '[object Uint8ClampedArray]') {
43914 return 'uint8clampedarray';
43915 }
43916 if (type === '[object Int16Array]') {
43917 return 'int16array';
43918 }
43919 if (type === '[object Uint16Array]') {
43920 return 'uint16array';
43921 }
43922 if (type === '[object Int32Array]') {
43923 return 'int32array';
43924 }
43925 if (type === '[object Uint32Array]') {
43926 return 'uint32array';
43927 }
43928 if (type === '[object Float32Array]') {
43929 return 'float32array';
43930 }
43931 if (type === '[object Float64Array]') {
43932 return 'float64array';
43933 }
43934
43935 // must be a plain object
43936 return 'object';
43937};
43938
43939
43940/***/ }),
43941/* 170 */
43942/***/ (function(module, exports, __webpack_require__) {
43943
43944module.exports = minimatch
43945minimatch.Minimatch = Minimatch
43946
43947var path = { sep: '/' }
43948try {
43949 path = __webpack_require__(1)
43950} catch (er) {}
43951
43952var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {}
43953var expand = __webpack_require__(557)
43954
43955var plTypes = {
43956 '!': { open: '(?:(?!(?:', close: '))[^/]*?)'},
43957 '?': { open: '(?:', close: ')?' },
43958 '+': { open: '(?:', close: ')+' },
43959 '*': { open: '(?:', close: ')*' },
43960 '@': { open: '(?:', close: ')' }
43961}
43962
43963// any single thing other than /
43964// don't need to escape / when using new RegExp()
43965var qmark = '[^/]'
43966
43967// * => any number of characters
43968var star = qmark + '*?'
43969
43970// ** when dots are allowed. Anything goes, except .. and .
43971// not (^ or / followed by one or two dots followed by $ or /),
43972// followed by anything, any number of times.
43973var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?'
43974
43975// not a ^ or / followed by a dot,
43976// followed by anything, any number of times.
43977var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?'
43978
43979// characters that need to be escaped in RegExp.
43980var reSpecials = charSet('().*{}+?[]^$\\!')
43981
43982// "abc" -> { a:true, b:true, c:true }
43983function charSet (s) {
43984 return s.split('').reduce(function (set, c) {
43985 set[c] = true
43986 return set
43987 }, {})
43988}
43989
43990// normalizes slashes.
43991var slashSplit = /\/+/
43992
43993minimatch.filter = filter
43994function filter (pattern, options) {
43995 options = options || {}
43996 return function (p, i, list) {
43997 return minimatch(p, pattern, options)
43998 }
43999}
44000
44001function ext (a, b) {
44002 a = a || {}
44003 b = b || {}
44004 var t = {}
44005 Object.keys(b).forEach(function (k) {
44006 t[k] = b[k]
44007 })
44008 Object.keys(a).forEach(function (k) {
44009 t[k] = a[k]
44010 })
44011 return t
44012}
44013
44014minimatch.defaults = function (def) {
44015 if (!def || !Object.keys(def).length) return minimatch
44016
44017 var orig = minimatch
44018
44019 var m = function minimatch (p, pattern, options) {
44020 return orig.minimatch(p, pattern, ext(def, options))
44021 }
44022
44023 m.Minimatch = function Minimatch (pattern, options) {
44024 return new orig.Minimatch(pattern, ext(def, options))
44025 }
44026
44027 return m
44028}
44029
44030Minimatch.defaults = function (def) {
44031 if (!def || !Object.keys(def).length) return Minimatch
44032 return minimatch.defaults(def).Minimatch
44033}
44034
44035function minimatch (p, pattern, options) {
44036 if (typeof pattern !== 'string') {
44037 throw new TypeError('glob pattern string required')
44038 }
44039
44040 if (!options) options = {}
44041
44042 // shortcut: comments match nothing.
44043 if (!options.nocomment && pattern.charAt(0) === '#') {
44044 return false
44045 }
44046
44047 // "" only matches ""
44048 if (pattern.trim() === '') return p === ''
44049
44050 return new Minimatch(pattern, options).match(p)
44051}
44052
44053function Minimatch (pattern, options) {
44054 if (!(this instanceof Minimatch)) {
44055 return new Minimatch(pattern, options)
44056 }
44057
44058 if (typeof pattern !== 'string') {
44059 throw new TypeError('glob pattern string required')
44060 }
44061
44062 if (!options) options = {}
44063 pattern = pattern.trim()
44064
44065 // windows support: need to use /, not \
44066 if (path.sep !== '/') {
44067 pattern = pattern.split(path.sep).join('/')
44068 }
44069
44070 this.options = options
44071 this.set = []
44072 this.pattern = pattern
44073 this.regexp = null
44074 this.negate = false
44075 this.comment = false
44076 this.empty = false
44077
44078 // make the set of regexps etc.
44079 this.make()
44080}
44081
44082Minimatch.prototype.debug = function () {}
44083
44084Minimatch.prototype.make = make
44085function make () {
44086 // don't do it more than once.
44087 if (this._made) return
44088
44089 var pattern = this.pattern
44090 var options = this.options
44091
44092 // empty patterns and comments match nothing.
44093 if (!options.nocomment && pattern.charAt(0) === '#') {
44094 this.comment = true
44095 return
44096 }
44097 if (!pattern) {
44098 this.empty = true
44099 return
44100 }
44101
44102 // step 1: figure out negation, etc.
44103 this.parseNegate()
44104
44105 // step 2: expand braces
44106 var set = this.globSet = this.braceExpand()
44107
44108 if (options.debug) this.debug = console.error
44109
44110 this.debug(this.pattern, set)
44111
44112 // step 3: now we have a set, so turn each one into a series of path-portion
44113 // matching patterns.
44114 // These will be regexps, except in the case of "**", which is
44115 // set to the GLOBSTAR object for globstar behavior,
44116 // and will not contain any / characters
44117 set = this.globParts = set.map(function (s) {
44118 return s.split(slashSplit)
44119 })
44120
44121 this.debug(this.pattern, set)
44122
44123 // glob --> regexps
44124 set = set.map(function (s, si, set) {
44125 return s.map(this.parse, this)
44126 }, this)
44127
44128 this.debug(this.pattern, set)
44129
44130 // filter out everything that didn't compile properly.
44131 set = set.filter(function (s) {
44132 return s.indexOf(false) === -1
44133 })
44134
44135 this.debug(this.pattern, set)
44136
44137 this.set = set
44138}
44139
44140Minimatch.prototype.parseNegate = parseNegate
44141function parseNegate () {
44142 var pattern = this.pattern
44143 var negate = false
44144 var options = this.options
44145 var negateOffset = 0
44146
44147 if (options.nonegate) return
44148
44149 for (var i = 0, l = pattern.length
44150 ; i < l && pattern.charAt(i) === '!'
44151 ; i++) {
44152 negate = !negate
44153 negateOffset++
44154 }
44155
44156 if (negateOffset) this.pattern = pattern.substr(negateOffset)
44157 this.negate = negate
44158}
44159
44160// Brace expansion:
44161// a{b,c}d -> abd acd
44162// a{b,}c -> abc ac
44163// a{0..3}d -> a0d a1d a2d a3d
44164// a{b,c{d,e}f}g -> abg acdfg acefg
44165// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
44166//
44167// Invalid sets are not expanded.
44168// a{2..}b -> a{2..}b
44169// a{b}c -> a{b}c
44170minimatch.braceExpand = function (pattern, options) {
44171 return braceExpand(pattern, options)
44172}
44173
44174Minimatch.prototype.braceExpand = braceExpand
44175
44176function braceExpand (pattern, options) {
44177 if (!options) {
44178 if (this instanceof Minimatch) {
44179 options = this.options
44180 } else {
44181 options = {}
44182 }
44183 }
44184
44185 pattern = typeof pattern === 'undefined'
44186 ? this.pattern : pattern
44187
44188 if (typeof pattern === 'undefined') {
44189 throw new TypeError('undefined pattern')
44190 }
44191
44192 if (options.nobrace ||
44193 !pattern.match(/\{.*\}/)) {
44194 // shortcut. no need to expand.
44195 return [pattern]
44196 }
44197
44198 return expand(pattern)
44199}
44200
44201// parse a component of the expanded set.
44202// At this point, no pattern may contain "/" in it
44203// so we're going to return a 2d array, where each entry is the full
44204// pattern, split on '/', and then turned into a regular expression.
44205// A regexp is made at the end which joins each array with an
44206// escaped /, and another full one which joins each regexp with |.
44207//
44208// Following the lead of Bash 4.1, note that "**" only has special meaning
44209// when it is the *only* thing in a path portion. Otherwise, any series
44210// of * is equivalent to a single *. Globstar behavior is enabled by
44211// default, and can be disabled by setting options.noglobstar.
44212Minimatch.prototype.parse = parse
44213var SUBPARSE = {}
44214function parse (pattern, isSub) {
44215 if (pattern.length > 1024 * 64) {
44216 throw new TypeError('pattern is too long')
44217 }
44218
44219 var options = this.options
44220
44221 // shortcuts
44222 if (!options.noglobstar && pattern === '**') return GLOBSTAR
44223 if (pattern === '') return ''
44224
44225 var re = ''
44226 var hasMagic = !!options.nocase
44227 var escaping = false
44228 // ? => one single character
44229 var patternListStack = []
44230 var negativeLists = []
44231 var stateChar
44232 var inClass = false
44233 var reClassStart = -1
44234 var classStart = -1
44235 // . and .. never match anything that doesn't start with .,
44236 // even when options.dot is set.
44237 var patternStart = pattern.charAt(0) === '.' ? '' // anything
44238 // not (start or / followed by . or .. followed by / or end)
44239 : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))'
44240 : '(?!\\.)'
44241 var self = this
44242
44243 function clearStateChar () {
44244 if (stateChar) {
44245 // we had some state-tracking character
44246 // that wasn't consumed by this pass.
44247 switch (stateChar) {
44248 case '*':
44249 re += star
44250 hasMagic = true
44251 break
44252 case '?':
44253 re += qmark
44254 hasMagic = true
44255 break
44256 default:
44257 re += '\\' + stateChar
44258 break
44259 }
44260 self.debug('clearStateChar %j %j', stateChar, re)
44261 stateChar = false
44262 }
44263 }
44264
44265 for (var i = 0, len = pattern.length, c
44266 ; (i < len) && (c = pattern.charAt(i))
44267 ; i++) {
44268 this.debug('%s\t%s %s %j', pattern, i, re, c)
44269
44270 // skip over any that are escaped.
44271 if (escaping && reSpecials[c]) {
44272 re += '\\' + c
44273 escaping = false
44274 continue
44275 }
44276
44277 switch (c) {
44278 case '/':
44279 // completely not allowed, even escaped.
44280 // Should already be path-split by now.
44281 return false
44282
44283 case '\\':
44284 clearStateChar()
44285 escaping = true
44286 continue
44287
44288 // the various stateChar values
44289 // for the "extglob" stuff.
44290 case '?':
44291 case '*':
44292 case '+':
44293 case '@':
44294 case '!':
44295 this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c)
44296
44297 // all of those are literals inside a class, except that
44298 // the glob [!a] means [^a] in regexp
44299 if (inClass) {
44300 this.debug(' in class')
44301 if (c === '!' && i === classStart + 1) c = '^'
44302 re += c
44303 continue
44304 }
44305
44306 // if we already have a stateChar, then it means
44307 // that there was something like ** or +? in there.
44308 // Handle the stateChar, then proceed with this one.
44309 self.debug('call clearStateChar %j', stateChar)
44310 clearStateChar()
44311 stateChar = c
44312 // if extglob is disabled, then +(asdf|foo) isn't a thing.
44313 // just clear the statechar *now*, rather than even diving into
44314 // the patternList stuff.
44315 if (options.noext) clearStateChar()
44316 continue
44317
44318 case '(':
44319 if (inClass) {
44320 re += '('
44321 continue
44322 }
44323
44324 if (!stateChar) {
44325 re += '\\('
44326 continue
44327 }
44328
44329 patternListStack.push({
44330 type: stateChar,
44331 start: i - 1,
44332 reStart: re.length,
44333 open: plTypes[stateChar].open,
44334 close: plTypes[stateChar].close
44335 })
44336 // negation is (?:(?!js)[^/]*)
44337 re += stateChar === '!' ? '(?:(?!(?:' : '(?:'
44338 this.debug('plType %j %j', stateChar, re)
44339 stateChar = false
44340 continue
44341
44342 case ')':
44343 if (inClass || !patternListStack.length) {
44344 re += '\\)'
44345 continue
44346 }
44347
44348 clearStateChar()
44349 hasMagic = true
44350 var pl = patternListStack.pop()
44351 // negation is (?:(?!js)[^/]*)
44352 // The others are (?:<pattern>)<type>
44353 re += pl.close
44354 if (pl.type === '!') {
44355 negativeLists.push(pl)
44356 }
44357 pl.reEnd = re.length
44358 continue
44359
44360 case '|':
44361 if (inClass || !patternListStack.length || escaping) {
44362 re += '\\|'
44363 escaping = false
44364 continue
44365 }
44366
44367 clearStateChar()
44368 re += '|'
44369 continue
44370
44371 // these are mostly the same in regexp and glob
44372 case '[':
44373 // swallow any state-tracking char before the [
44374 clearStateChar()
44375
44376 if (inClass) {
44377 re += '\\' + c
44378 continue
44379 }
44380
44381 inClass = true
44382 classStart = i
44383 reClassStart = re.length
44384 re += c
44385 continue
44386
44387 case ']':
44388 // a right bracket shall lose its special
44389 // meaning and represent itself in
44390 // a bracket expression if it occurs
44391 // first in the list. -- POSIX.2 2.8.3.2
44392 if (i === classStart + 1 || !inClass) {
44393 re += '\\' + c
44394 escaping = false
44395 continue
44396 }
44397
44398 // handle the case where we left a class open.
44399 // "[z-a]" is valid, equivalent to "\[z-a\]"
44400 if (inClass) {
44401 // split where the last [ was, make sure we don't have
44402 // an invalid re. if so, re-walk the contents of the
44403 // would-be class to re-translate any characters that
44404 // were passed through as-is
44405 // TODO: It would probably be faster to determine this
44406 // without a try/catch and a new RegExp, but it's tricky
44407 // to do safely. For now, this is safe and works.
44408 var cs = pattern.substring(classStart + 1, i)
44409 try {
44410 RegExp('[' + cs + ']')
44411 } catch (er) {
44412 // not a valid class!
44413 var sp = this.parse(cs, SUBPARSE)
44414 re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]'
44415 hasMagic = hasMagic || sp[1]
44416 inClass = false
44417 continue
44418 }
44419 }
44420
44421 // finish up the class.
44422 hasMagic = true
44423 inClass = false
44424 re += c
44425 continue
44426
44427 default:
44428 // swallow any state char that wasn't consumed
44429 clearStateChar()
44430
44431 if (escaping) {
44432 // no need
44433 escaping = false
44434 } else if (reSpecials[c]
44435 && !(c === '^' && inClass)) {
44436 re += '\\'
44437 }
44438
44439 re += c
44440
44441 } // switch
44442 } // for
44443
44444 // handle the case where we left a class open.
44445 // "[abc" is valid, equivalent to "\[abc"
44446 if (inClass) {
44447 // split where the last [ was, and escape it
44448 // this is a huge pita. We now have to re-walk
44449 // the contents of the would-be class to re-translate
44450 // any characters that were passed through as-is
44451 cs = pattern.substr(classStart + 1)
44452 sp = this.parse(cs, SUBPARSE)
44453 re = re.substr(0, reClassStart) + '\\[' + sp[0]
44454 hasMagic = hasMagic || sp[1]
44455 }
44456
44457 // handle the case where we had a +( thing at the *end*
44458 // of the pattern.
44459 // each pattern list stack adds 3 chars, and we need to go through
44460 // and escape any | chars that were passed through as-is for the regexp.
44461 // Go through and escape them, taking care not to double-escape any
44462 // | chars that were already escaped.
44463 for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
44464 var tail = re.slice(pl.reStart + pl.open.length)
44465 this.debug('setting tail', re, pl)
44466 // maybe some even number of \, then maybe 1 \, followed by a |
44467 tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) {
44468 if (!$2) {
44469 // the | isn't already escaped, so escape it.
44470 $2 = '\\'
44471 }
44472
44473 // need to escape all those slashes *again*, without escaping the
44474 // one that we need for escaping the | character. As it works out,
44475 // escaping an even number of slashes can be done by simply repeating
44476 // it exactly after itself. That's why this trick works.
44477 //
44478 // I am sorry that you have to see this.
44479 return $1 + $1 + $2 + '|'
44480 })
44481
44482 this.debug('tail=%j\n %s', tail, tail, pl, re)
44483 var t = pl.type === '*' ? star
44484 : pl.type === '?' ? qmark
44485 : '\\' + pl.type
44486
44487 hasMagic = true
44488 re = re.slice(0, pl.reStart) + t + '\\(' + tail
44489 }
44490
44491 // handle trailing things that only matter at the very end.
44492 clearStateChar()
44493 if (escaping) {
44494 // trailing \\
44495 re += '\\\\'
44496 }
44497
44498 // only need to apply the nodot start if the re starts with
44499 // something that could conceivably capture a dot
44500 var addPatternStart = false
44501 switch (re.charAt(0)) {
44502 case '.':
44503 case '[':
44504 case '(': addPatternStart = true
44505 }
44506
44507 // Hack to work around lack of negative lookbehind in JS
44508 // A pattern like: *.!(x).!(y|z) needs to ensure that a name
44509 // like 'a.xyz.yz' doesn't match. So, the first negative
44510 // lookahead, has to look ALL the way ahead, to the end of
44511 // the pattern.
44512 for (var n = negativeLists.length - 1; n > -1; n--) {
44513 var nl = negativeLists[n]
44514
44515 var nlBefore = re.slice(0, nl.reStart)
44516 var nlFirst = re.slice(nl.reStart, nl.reEnd - 8)
44517 var nlLast = re.slice(nl.reEnd - 8, nl.reEnd)
44518 var nlAfter = re.slice(nl.reEnd)
44519
44520 nlLast += nlAfter
44521
44522 // Handle nested stuff like *(*.js|!(*.json)), where open parens
44523 // mean that we should *not* include the ) in the bit that is considered
44524 // "after" the negated section.
44525 var openParensBefore = nlBefore.split('(').length - 1
44526 var cleanAfter = nlAfter
44527 for (i = 0; i < openParensBefore; i++) {
44528 cleanAfter = cleanAfter.replace(/\)[+*?]?/, '')
44529 }
44530 nlAfter = cleanAfter
44531
44532 var dollar = ''
44533 if (nlAfter === '' && isSub !== SUBPARSE) {
44534 dollar = '$'
44535 }
44536 var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast
44537 re = newRe
44538 }
44539
44540 // if the re is not "" at this point, then we need to make sure
44541 // it doesn't match against an empty path part.
44542 // Otherwise a/* will match a/, which it should not.
44543 if (re !== '' && hasMagic) {
44544 re = '(?=.)' + re
44545 }
44546
44547 if (addPatternStart) {
44548 re = patternStart + re
44549 }
44550
44551 // parsing just a piece of a larger pattern.
44552 if (isSub === SUBPARSE) {
44553 return [re, hasMagic]
44554 }
44555
44556 // skip the regexp for non-magical patterns
44557 // unescape anything in it, though, so that it'll be
44558 // an exact match against a file etc.
44559 if (!hasMagic) {
44560 return globUnescape(pattern)
44561 }
44562
44563 var flags = options.nocase ? 'i' : ''
44564 try {
44565 var regExp = new RegExp('^' + re + '$', flags)
44566 } catch (er) {
44567 // If it was an invalid regular expression, then it can't match
44568 // anything. This trick looks for a character after the end of
44569 // the string, which is of course impossible, except in multi-line
44570 // mode, but it's not a /m regex.
44571 return new RegExp('$.')
44572 }
44573
44574 regExp._glob = pattern
44575 regExp._src = re
44576
44577 return regExp
44578}
44579
44580minimatch.makeRe = function (pattern, options) {
44581 return new Minimatch(pattern, options || {}).makeRe()
44582}
44583
44584Minimatch.prototype.makeRe = makeRe
44585function makeRe () {
44586 if (this.regexp || this.regexp === false) return this.regexp
44587
44588 // at this point, this.set is a 2d array of partial
44589 // pattern strings, or "**".
44590 //
44591 // It's better to use .match(). This function shouldn't
44592 // be used, really, but it's pretty convenient sometimes,
44593 // when you just want to work with a regex.
44594 var set = this.set
44595
44596 if (!set.length) {
44597 this.regexp = false
44598 return this.regexp
44599 }
44600 var options = this.options
44601
44602 var twoStar = options.noglobstar ? star
44603 : options.dot ? twoStarDot
44604 : twoStarNoDot
44605 var flags = options.nocase ? 'i' : ''
44606
44607 var re = set.map(function (pattern) {
44608 return pattern.map(function (p) {
44609 return (p === GLOBSTAR) ? twoStar
44610 : (typeof p === 'string') ? regExpEscape(p)
44611 : p._src
44612 }).join('\\\/')
44613 }).join('|')
44614
44615 // must match entire pattern
44616 // ending in a * or ** will make it less strict.
44617 re = '^(?:' + re + ')$'
44618
44619 // can match anything, as long as it's not this.
44620 if (this.negate) re = '^(?!' + re + ').*$'
44621
44622 try {
44623 this.regexp = new RegExp(re, flags)
44624 } catch (ex) {
44625 this.regexp = false
44626 }
44627 return this.regexp
44628}
44629
44630minimatch.match = function (list, pattern, options) {
44631 options = options || {}
44632 var mm = new Minimatch(pattern, options)
44633 list = list.filter(function (f) {
44634 return mm.match(f)
44635 })
44636 if (mm.options.nonull && !list.length) {
44637 list.push(pattern)
44638 }
44639 return list
44640}
44641
44642Minimatch.prototype.match = match
44643function match (f, partial) {
44644 this.debug('match', f, this.pattern)
44645 // short-circuit in the case of busted things.
44646 // comments, etc.
44647 if (this.comment) return false
44648 if (this.empty) return f === ''
44649
44650 if (f === '/' && partial) return true
44651
44652 var options = this.options
44653
44654 // windows: need to use /, not \
44655 if (path.sep !== '/') {
44656 f = f.split(path.sep).join('/')
44657 }
44658
44659 // treat the test path as a set of pathparts.
44660 f = f.split(slashSplit)
44661 this.debug(this.pattern, 'split', f)
44662
44663 // just ONE of the pattern sets in this.set needs to match
44664 // in order for it to be valid. If negating, then just one
44665 // match means that we have failed.
44666 // Either way, return on the first hit.
44667
44668 var set = this.set
44669 this.debug(this.pattern, 'set', set)
44670
44671 // Find the basename of the path by looking for the last non-empty segment
44672 var filename
44673 var i
44674 for (i = f.length - 1; i >= 0; i--) {
44675 filename = f[i]
44676 if (filename) break
44677 }
44678
44679 for (i = 0; i < set.length; i++) {
44680 var pattern = set[i]
44681 var file = f
44682 if (options.matchBase && pattern.length === 1) {
44683 file = [filename]
44684 }
44685 var hit = this.matchOne(file, pattern, partial)
44686 if (hit) {
44687 if (options.flipNegate) return true
44688 return !this.negate
44689 }
44690 }
44691
44692 // didn't get any hits. this is success if it's a negative
44693 // pattern, failure otherwise.
44694 if (options.flipNegate) return false
44695 return this.negate
44696}
44697
44698// set partial to true to test if, for example,
44699// "/a/b" matches the start of "/*/b/*/d"
44700// Partial means, if you run out of file before you run
44701// out of pattern, then that's fine, as long as all
44702// the parts match.
44703Minimatch.prototype.matchOne = function (file, pattern, partial) {
44704 var options = this.options
44705
44706 this.debug('matchOne',
44707 { 'this': this, file: file, pattern: pattern })
44708
44709 this.debug('matchOne', file.length, pattern.length)
44710
44711 for (var fi = 0,
44712 pi = 0,
44713 fl = file.length,
44714 pl = pattern.length
44715 ; (fi < fl) && (pi < pl)
44716 ; fi++, pi++) {
44717 this.debug('matchOne loop')
44718 var p = pattern[pi]
44719 var f = file[fi]
44720
44721 this.debug(pattern, p, f)
44722
44723 // should be impossible.
44724 // some invalid regexp stuff in the set.
44725 if (p === false) return false
44726
44727 if (p === GLOBSTAR) {
44728 this.debug('GLOBSTAR', [pattern, p, f])
44729
44730 // "**"
44731 // a/**/b/**/c would match the following:
44732 // a/b/x/y/z/c
44733 // a/x/y/z/b/c
44734 // a/b/x/b/x/c
44735 // a/b/c
44736 // To do this, take the rest of the pattern after
44737 // the **, and see if it would match the file remainder.
44738 // If so, return success.
44739 // If not, the ** "swallows" a segment, and try again.
44740 // This is recursively awful.
44741 //
44742 // a/**/b/**/c matching a/b/x/y/z/c
44743 // - a matches a
44744 // - doublestar
44745 // - matchOne(b/x/y/z/c, b/**/c)
44746 // - b matches b
44747 // - doublestar
44748 // - matchOne(x/y/z/c, c) -> no
44749 // - matchOne(y/z/c, c) -> no
44750 // - matchOne(z/c, c) -> no
44751 // - matchOne(c, c) yes, hit
44752 var fr = fi
44753 var pr = pi + 1
44754 if (pr === pl) {
44755 this.debug('** at the end')
44756 // a ** at the end will just swallow the rest.
44757 // We have found a match.
44758 // however, it will not swallow /.x, unless
44759 // options.dot is set.
44760 // . and .. are *never* matched by **, for explosively
44761 // exponential reasons.
44762 for (; fi < fl; fi++) {
44763 if (file[fi] === '.' || file[fi] === '..' ||
44764 (!options.dot && file[fi].charAt(0) === '.')) return false
44765 }
44766 return true
44767 }
44768
44769 // ok, let's see if we can swallow whatever we can.
44770 while (fr < fl) {
44771 var swallowee = file[fr]
44772
44773 this.debug('\nglobstar while', file, fr, pattern, pr, swallowee)
44774
44775 // XXX remove this slice. Just pass the start index.
44776 if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
44777 this.debug('globstar found match!', fr, fl, swallowee)
44778 // found a match.
44779 return true
44780 } else {
44781 // can't swallow "." or ".." ever.
44782 // can only swallow ".foo" when explicitly asked.
44783 if (swallowee === '.' || swallowee === '..' ||
44784 (!options.dot && swallowee.charAt(0) === '.')) {
44785 this.debug('dot detected!', file, fr, pattern, pr)
44786 break
44787 }
44788
44789 // ** swallows a segment, and continue.
44790 this.debug('globstar swallow a segment, and continue')
44791 fr++
44792 }
44793 }
44794
44795 // no match was found.
44796 // However, in partial mode, we can't say this is necessarily over.
44797 // If there's more *pattern* left, then
44798 if (partial) {
44799 // ran out of file
44800 this.debug('\n>>> no match, partial?', file, fr, pattern, pr)
44801 if (fr === fl) return true
44802 }
44803 return false
44804 }
44805
44806 // something other than **
44807 // non-magic patterns just have to match exactly
44808 // patterns with magic have been turned into regexps.
44809 var hit
44810 if (typeof p === 'string') {
44811 if (options.nocase) {
44812 hit = f.toLowerCase() === p.toLowerCase()
44813 } else {
44814 hit = f === p
44815 }
44816 this.debug('string match', p, f, hit)
44817 } else {
44818 hit = f.match(p)
44819 this.debug('pattern match', p, f, hit)
44820 }
44821
44822 if (!hit) return false
44823 }
44824
44825 // Note: ending in / means that we'll get a final ""
44826 // at the end of the pattern. This can only match a
44827 // corresponding "" at the end of the file.
44828 // If the file ends in /, then it can only match a
44829 // a pattern that ends in /, unless the pattern just
44830 // doesn't have any more for it. But, a/b/ should *not*
44831 // match "a/b/*", even though "" matches against the
44832 // [^/]*? pattern, except in partial mode, where it might
44833 // simply not be reached yet.
44834 // However, a/b/ should still satisfy a/*
44835
44836 // now either we fell off the end of the pattern, or we're done.
44837 if (fi === fl && pi === pl) {
44838 // ran out of pattern and filename at the same time.
44839 // an exact hit!
44840 return true
44841 } else if (fi === fl) {
44842 // ran out of file, but still had pattern left.
44843 // this is ok if we're doing the match as part of
44844 // a glob fs traversal.
44845 return partial
44846 } else if (pi === pl) {
44847 // ran out of pattern, still have file left.
44848 // this is only acceptable if we're on the very last
44849 // empty segment of a file with a trailing slash.
44850 // a/* should match a/b/
44851 var emptyFileEnd = (fi === fl - 1) && (file[fi] === '')
44852 return emptyFileEnd
44853 }
44854
44855 // should be unreachable.
44856 throw new Error('wtf?')
44857}
44858
44859// replace stuff like \* with *
44860function globUnescape (s) {
44861 return s.replace(/\\(.)/g, '$1')
44862}
44863
44864function regExpEscape (s) {
44865 return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&')
44866}
44867
44868
44869/***/ }),
44870/* 171 */
44871/***/ (function(module, exports, __webpack_require__) {
44872
44873"use strict";
44874
44875
44876if (!process.version ||
44877 process.version.indexOf('v0.') === 0 ||
44878 process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
44879 module.exports = { nextTick: nextTick };
44880} else {
44881 module.exports = process
44882}
44883
44884function nextTick(fn, arg1, arg2, arg3) {
44885 if (typeof fn !== 'function') {
44886 throw new TypeError('"callback" argument must be a function');
44887 }
44888 var len = arguments.length;
44889 var args, i;
44890 switch (len) {
44891 case 0:
44892 case 1:
44893 return process.nextTick(fn);
44894 case 2:
44895 return process.nextTick(function afterTickOne() {
44896 fn.call(null, arg1);
44897 });
44898 case 3:
44899 return process.nextTick(function afterTickTwo() {
44900 fn.call(null, arg1, arg2);
44901 });
44902 case 4:
44903 return process.nextTick(function afterTickThree() {
44904 fn.call(null, arg1, arg2, arg3);
44905 });
44906 default:
44907 args = new Array(len - 1);
44908 i = 0;
44909 while (i < args.length) {
44910 args[i++] = arguments[i];
44911 }
44912 return process.nextTick(function afterTick() {
44913 fn.apply(null, args);
44914 });
44915 }
44916}
44917
44918
44919
44920/***/ }),
44921/* 172 */
44922/***/ (function(module, exports, __webpack_require__) {
44923
44924"use strict";
44925
44926
44927var isPromise = __webpack_require__(790);
44928
44929/**
44930 * Return a function that will run a function asynchronously or synchronously
44931 *
44932 * example:
44933 * runAsync(wrappedFunction, callback)(...args);
44934 *
44935 * @param {Function} func Function to run
44936 * @param {Function} cb Callback function passed the `func` returned value
44937 * @return {Function(arguments)} Arguments to pass to `func`. This function will in turn
44938 * return a Promise (Node >= 0.12) or call the callbacks.
44939 */
44940
44941var runAsync = module.exports = function (func, cb) {
44942 cb = cb || function () {};
44943
44944 return function () {
44945 var async = false;
44946 var args = arguments;
44947
44948 var promise = new Promise(function (resolve, reject) {
44949 var answer = func.apply({
44950 async: function () {
44951 async = true;
44952 return function (err, value) {
44953 if (err) {
44954 reject(err);
44955 } else {
44956 resolve(value);
44957 }
44958 };
44959 }
44960 }, Array.prototype.slice.call(args));
44961
44962 if (!async) {
44963 if (isPromise(answer)) {
44964 answer.then(resolve, reject);
44965 } else {
44966 resolve(answer);
44967 }
44968 }
44969 });
44970
44971 promise.then(cb.bind(null, null), cb);
44972
44973 return promise;
44974 }
44975};
44976
44977runAsync.cb = function (func, cb) {
44978 return runAsync(function () {
44979 var args = Array.prototype.slice.call(arguments);
44980 if (args.length === func.length - 1) {
44981 args.push(this.async());
44982 }
44983 return func.apply(this, args);
44984 }, cb);
44985};
44986
44987
44988/***/ }),
44989/* 173 */
44990/***/ (function(module, __webpack_exports__, __webpack_require__) {
44991
44992"use strict";
44993Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
44994/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_Observable__ = __webpack_require__(17);
44995/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_Observable__["a"]; });
44996/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_observable_ConnectableObservable__ = __webpack_require__(393);
44997/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return __WEBPACK_IMPORTED_MODULE_1__internal_observable_ConnectableObservable__["a"]; });
44998/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_operators_groupBy__ = __webpack_require__(403);
44999/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_operators_groupBy__["a"]; });
45000/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_symbol_observable__ = __webpack_require__(112);
45001/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return __WEBPACK_IMPORTED_MODULE_3__internal_symbol_observable__["a"]; });
45002/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_Subject__ = __webpack_require__(43);
45003/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_Subject__["a"]; });
45004/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__internal_BehaviorSubject__ = __webpack_require__(389);
45005/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return __WEBPACK_IMPORTED_MODULE_5__internal_BehaviorSubject__["a"]; });
45006/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_ReplaySubject__ = __webpack_require__(248);
45007/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return __WEBPACK_IMPORTED_MODULE_6__internal_ReplaySubject__["a"]; });
45008/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__internal_AsyncSubject__ = __webpack_require__(174);
45009/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return __WEBPACK_IMPORTED_MODULE_7__internal_AsyncSubject__["a"]; });
45010/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__internal_scheduler_asap__ = __webpack_require__(408);
45011/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return __WEBPACK_IMPORTED_MODULE_8__internal_scheduler_asap__["a"]; });
45012/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__internal_scheduler_async__ = __webpack_require__(47);
45013/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "asyncScheduler", function() { return __WEBPACK_IMPORTED_MODULE_9__internal_scheduler_async__["a"]; });
45014/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__internal_scheduler_queue__ = __webpack_require__(409);
45015/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "queueScheduler", function() { return __WEBPACK_IMPORTED_MODULE_10__internal_scheduler_queue__["a"]; });
45016/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__internal_scheduler_animationFrame__ = __webpack_require__(999);
45017/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "animationFrameScheduler", function() { return __WEBPACK_IMPORTED_MODULE_11__internal_scheduler_animationFrame__["a"]; });
45018/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__internal_scheduler_VirtualTimeScheduler__ = __webpack_require__(998);
45019/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualTimeScheduler", function() { return __WEBPACK_IMPORTED_MODULE_12__internal_scheduler_VirtualTimeScheduler__["a"]; });
45020/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "VirtualAction", function() { return __WEBPACK_IMPORTED_MODULE_12__internal_scheduler_VirtualTimeScheduler__["b"]; });
45021/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__internal_Scheduler__ = __webpack_require__(391);
45022/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Scheduler", function() { return __WEBPACK_IMPORTED_MODULE_13__internal_Scheduler__["a"]; });
45023/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__internal_Subscription__ = __webpack_require__(31);
45024/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return __WEBPACK_IMPORTED_MODULE_14__internal_Subscription__["a"]; });
45025/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__internal_Subscriber__ = __webpack_require__(5);
45026/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return __WEBPACK_IMPORTED_MODULE_15__internal_Subscriber__["a"]; });
45027/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__internal_Notification__ = __webpack_require__(175);
45028/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return __WEBPACK_IMPORTED_MODULE_16__internal_Notification__["a"]; });
45029/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__internal_util_pipe__ = __webpack_require__(264);
45030/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return __WEBPACK_IMPORTED_MODULE_17__internal_util_pipe__["a"]; });
45031/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__internal_util_noop__ = __webpack_require__(182);
45032/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_18__internal_util_noop__["a"]; });
45033/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__internal_util_identity__ = __webpack_require__(113);
45034/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_19__internal_util_identity__["a"]; });
45035/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__internal_util_isObservable__ = __webpack_require__(1003);
45036/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return __WEBPACK_IMPORTED_MODULE_20__internal_util_isObservable__["a"]; });
45037/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__internal_util_ArgumentOutOfRangeError__ = __webpack_require__(140);
45038/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return __WEBPACK_IMPORTED_MODULE_21__internal_util_ArgumentOutOfRangeError__["a"]; });
45039/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__internal_util_EmptyError__ = __webpack_require__(141);
45040/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return __WEBPACK_IMPORTED_MODULE_22__internal_util_EmptyError__["a"]; });
45041/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__internal_util_ObjectUnsubscribedError__ = __webpack_require__(180);
45042/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return __WEBPACK_IMPORTED_MODULE_23__internal_util_ObjectUnsubscribedError__["a"]; });
45043/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__internal_util_UnsubscriptionError__ = __webpack_require__(411);
45044/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return __WEBPACK_IMPORTED_MODULE_24__internal_util_UnsubscriptionError__["a"]; });
45045/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__internal_util_TimeoutError__ = __webpack_require__(410);
45046/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "TimeoutError", function() { return __WEBPACK_IMPORTED_MODULE_25__internal_util_TimeoutError__["a"]; });
45047/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__internal_observable_bindCallback__ = __webpack_require__(896);
45048/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindCallback", function() { return __WEBPACK_IMPORTED_MODULE_26__internal_observable_bindCallback__["a"]; });
45049/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__internal_observable_bindNodeCallback__ = __webpack_require__(897);
45050/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return __WEBPACK_IMPORTED_MODULE_27__internal_observable_bindNodeCallback__["a"]; });
45051/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__internal_observable_combineLatest__ = __webpack_require__(249);
45052/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return __WEBPACK_IMPORTED_MODULE_28__internal_observable_combineLatest__["a"]; });
45053/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__internal_observable_concat__ = __webpack_require__(177);
45054/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return __WEBPACK_IMPORTED_MODULE_29__internal_observable_concat__["a"]; });
45055/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__internal_observable_defer__ = __webpack_require__(250);
45056/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_30__internal_observable_defer__["a"]; });
45057/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__ = __webpack_require__(46);
45058/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "empty", function() { return __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__["a"]; });
45059/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__internal_observable_forkJoin__ = __webpack_require__(898);
45060/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "forkJoin", function() { return __WEBPACK_IMPORTED_MODULE_32__internal_observable_forkJoin__["a"]; });
45061/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__internal_observable_from__ = __webpack_require__(64);
45062/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "from", function() { return __WEBPACK_IMPORTED_MODULE_33__internal_observable_from__["a"]; });
45063/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__internal_observable_fromEvent__ = __webpack_require__(899);
45064/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "fromEvent", function() { return __WEBPACK_IMPORTED_MODULE_34__internal_observable_fromEvent__["a"]; });
45065/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__internal_observable_fromEventPattern__ = __webpack_require__(900);
45066/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "fromEventPattern", function() { return __WEBPACK_IMPORTED_MODULE_35__internal_observable_fromEventPattern__["a"]; });
45067/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__internal_observable_generate__ = __webpack_require__(904);
45068/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "generate", function() { return __WEBPACK_IMPORTED_MODULE_36__internal_observable_generate__["a"]; });
45069/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__internal_observable_iif__ = __webpack_require__(905);
45070/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "iif", function() { return __WEBPACK_IMPORTED_MODULE_37__internal_observable_iif__["a"]; });
45071/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__internal_observable_interval__ = __webpack_require__(906);
45072/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "interval", function() { return __WEBPACK_IMPORTED_MODULE_38__internal_observable_interval__["a"]; });
45073/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__internal_observable_merge__ = __webpack_require__(394);
45074/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "merge", function() { return __WEBPACK_IMPORTED_MODULE_39__internal_observable_merge__["a"]; });
45075/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__ = __webpack_require__(395);
45076/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "never", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__["a"]; });
45077/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__internal_observable_of__ = __webpack_require__(251);
45078/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "of", function() { return __WEBPACK_IMPORTED_MODULE_41__internal_observable_of__["a"]; });
45079/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__internal_observable_onErrorResumeNext__ = __webpack_require__(907);
45080/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "onErrorResumeNext", function() { return __WEBPACK_IMPORTED_MODULE_42__internal_observable_onErrorResumeNext__["a"]; });
45081/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__internal_observable_pairs__ = __webpack_require__(908);
45082/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pairs", function() { return __WEBPACK_IMPORTED_MODULE_43__internal_observable_pairs__["a"]; });
45083/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__internal_observable_race__ = __webpack_require__(396);
45084/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return __WEBPACK_IMPORTED_MODULE_44__internal_observable_race__["a"]; });
45085/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__internal_observable_range__ = __webpack_require__(909);
45086/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "range", function() { return __WEBPACK_IMPORTED_MODULE_45__internal_observable_range__["a"]; });
45087/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__internal_observable_throwError__ = __webpack_require__(253);
45088/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throwError", function() { return __WEBPACK_IMPORTED_MODULE_46__internal_observable_throwError__["a"]; });
45089/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__internal_observable_timer__ = __webpack_require__(397);
45090/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timer", function() { return __WEBPACK_IMPORTED_MODULE_47__internal_observable_timer__["a"]; });
45091/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__internal_observable_using__ = __webpack_require__(910);
45092/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "using", function() { return __WEBPACK_IMPORTED_MODULE_48__internal_observable_using__["a"]; });
45093/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__internal_observable_zip__ = __webpack_require__(254);
45094/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_49__internal_observable_zip__["a"]; });
45095/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__["b"]; });
45096/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__["b"]; });
45097/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__internal_config__ = __webpack_require__(176);
45098/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return __WEBPACK_IMPORTED_MODULE_50__internal_config__["a"]; });
45099/** PURE_IMPORTS_START PURE_IMPORTS_END */
45100
45101
45102
45103
45104
45105
45106
45107
45108
45109
45110
45111
45112
45113
45114
45115
45116
45117
45118
45119
45120
45121
45122
45123
45124
45125
45126
45127
45128
45129
45130
45131
45132
45133
45134
45135
45136
45137
45138
45139
45140
45141
45142
45143
45144
45145
45146
45147
45148
45149
45150
45151
45152
45153//# sourceMappingURL=index.js.map
45154
45155
45156/***/ }),
45157/* 174 */
45158/***/ (function(module, __webpack_exports__, __webpack_require__) {
45159
45160"use strict";
45161/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsyncSubject; });
45162/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
45163/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
45164/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(31);
45165/** PURE_IMPORTS_START tslib,_Subject,_Subscription PURE_IMPORTS_END */
45166
45167
45168
45169var AsyncSubject = /*@__PURE__*/ (function (_super) {
45170 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsyncSubject, _super);
45171 function AsyncSubject() {
45172 var _this = _super !== null && _super.apply(this, arguments) || this;
45173 _this.value = null;
45174 _this.hasNext = false;
45175 _this.hasCompleted = false;
45176 return _this;
45177 }
45178 AsyncSubject.prototype._subscribe = function (subscriber) {
45179 if (this.hasError) {
45180 subscriber.error(this.thrownError);
45181 return __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */].EMPTY;
45182 }
45183 else if (this.hasCompleted && this.hasNext) {
45184 subscriber.next(this.value);
45185 subscriber.complete();
45186 return __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */].EMPTY;
45187 }
45188 return _super.prototype._subscribe.call(this, subscriber);
45189 };
45190 AsyncSubject.prototype.next = function (value) {
45191 if (!this.hasCompleted) {
45192 this.value = value;
45193 this.hasNext = true;
45194 }
45195 };
45196 AsyncSubject.prototype.error = function (error) {
45197 if (!this.hasCompleted) {
45198 _super.prototype.error.call(this, error);
45199 }
45200 };
45201 AsyncSubject.prototype.complete = function () {
45202 this.hasCompleted = true;
45203 if (this.hasNext) {
45204 _super.prototype.next.call(this, this.value);
45205 }
45206 _super.prototype.complete.call(this);
45207 };
45208 return AsyncSubject;
45209}(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]));
45210
45211//# sourceMappingURL=AsyncSubject.js.map
45212
45213
45214/***/ }),
45215/* 175 */
45216/***/ (function(module, __webpack_exports__, __webpack_require__) {
45217
45218"use strict";
45219/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Notification; });
45220/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_empty__ = __webpack_require__(46);
45221/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_of__ = __webpack_require__(251);
45222/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_throwError__ = __webpack_require__(253);
45223/** PURE_IMPORTS_START _observable_empty,_observable_of,_observable_throwError PURE_IMPORTS_END */
45224
45225
45226
45227var Notification = /*@__PURE__*/ (function () {
45228 function Notification(kind, value, error) {
45229 this.kind = kind;
45230 this.value = value;
45231 this.error = error;
45232 this.hasValue = kind === 'N';
45233 }
45234 Notification.prototype.observe = function (observer) {
45235 switch (this.kind) {
45236 case 'N':
45237 return observer.next && observer.next(this.value);
45238 case 'E':
45239 return observer.error && observer.error(this.error);
45240 case 'C':
45241 return observer.complete && observer.complete();
45242 }
45243 };
45244 Notification.prototype.do = function (next, error, complete) {
45245 var kind = this.kind;
45246 switch (kind) {
45247 case 'N':
45248 return next && next(this.value);
45249 case 'E':
45250 return error && error(this.error);
45251 case 'C':
45252 return complete && complete();
45253 }
45254 };
45255 Notification.prototype.accept = function (nextOrObserver, error, complete) {
45256 if (nextOrObserver && typeof nextOrObserver.next === 'function') {
45257 return this.observe(nextOrObserver);
45258 }
45259 else {
45260 return this.do(nextOrObserver, error, complete);
45261 }
45262 };
45263 Notification.prototype.toObservable = function () {
45264 var kind = this.kind;
45265 switch (kind) {
45266 case 'N':
45267 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_of__["a" /* of */])(this.value);
45268 case 'E':
45269 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_throwError__["a" /* throwError */])(this.error);
45270 case 'C':
45271 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__observable_empty__["a" /* empty */])();
45272 }
45273 throw new Error('unexpected notification kind value');
45274 };
45275 Notification.createNext = function (value) {
45276 if (typeof value !== 'undefined') {
45277 return new Notification('N', value);
45278 }
45279 return Notification.undefinedValueNotification;
45280 };
45281 Notification.createError = function (err) {
45282 return new Notification('E', undefined, err);
45283 };
45284 Notification.createComplete = function () {
45285 return Notification.completeNotification;
45286 };
45287 Notification.completeNotification = new Notification('C');
45288 Notification.undefinedValueNotification = new Notification('N', undefined);
45289 return Notification;
45290}());
45291
45292//# sourceMappingURL=Notification.js.map
45293
45294
45295/***/ }),
45296/* 176 */
45297/***/ (function(module, __webpack_exports__, __webpack_require__) {
45298
45299"use strict";
45300/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return config; });
45301/** PURE_IMPORTS_START PURE_IMPORTS_END */
45302var _enable_super_gross_mode_that_will_cause_bad_things = false;
45303var config = {
45304 Promise: undefined,
45305 set useDeprecatedSynchronousErrorHandling(value) {
45306 if (value) {
45307 var error = /*@__PURE__*/ new Error();
45308 /*@__PURE__*/ console.warn('DEPRECATED! RxJS was set to use deprecated synchronous error handling behavior by code at: \n' + error.stack);
45309 }
45310 else if (_enable_super_gross_mode_that_will_cause_bad_things) {
45311 /*@__PURE__*/ console.log('RxJS: Back to a better error behavior. Thank you. <3');
45312 }
45313 _enable_super_gross_mode_that_will_cause_bad_things = value;
45314 },
45315 get useDeprecatedSynchronousErrorHandling() {
45316 return _enable_super_gross_mode_that_will_cause_bad_things;
45317 },
45318};
45319//# sourceMappingURL=config.js.map
45320
45321
45322/***/ }),
45323/* 177 */
45324/***/ (function(module, __webpack_exports__, __webpack_require__) {
45325
45326"use strict";
45327/* harmony export (immutable) */ __webpack_exports__["a"] = concat;
45328/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isScheduler__ = __webpack_require__(56);
45329/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__of__ = __webpack_require__(251);
45330/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__from__ = __webpack_require__(64);
45331/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__operators_concatAll__ = __webpack_require__(399);
45332/** PURE_IMPORTS_START _util_isScheduler,_of,_from,_operators_concatAll PURE_IMPORTS_END */
45333
45334
45335
45336
45337function concat() {
45338 var observables = [];
45339 for (var _i = 0; _i < arguments.length; _i++) {
45340 observables[_i] = arguments[_i];
45341 }
45342 if (observables.length === 1 || (observables.length === 2 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isScheduler__["a" /* isScheduler */])(observables[1]))) {
45343 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__from__["a" /* from */])(observables[0]);
45344 }
45345 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__operators_concatAll__["a" /* concatAll */])()(__WEBPACK_IMPORTED_MODULE_1__of__["a" /* of */].apply(void 0, observables));
45346}
45347//# sourceMappingURL=concat.js.map
45348
45349
45350/***/ }),
45351/* 178 */
45352/***/ (function(module, __webpack_exports__, __webpack_require__) {
45353
45354"use strict";
45355/* harmony export (immutable) */ __webpack_exports__["a"] = reduce;
45356/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scan__ = __webpack_require__(257);
45357/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__takeLast__ = __webpack_require__(260);
45358/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__defaultIfEmpty__ = __webpack_require__(134);
45359/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(264);
45360/** PURE_IMPORTS_START _scan,_takeLast,_defaultIfEmpty,_util_pipe PURE_IMPORTS_END */
45361
45362
45363
45364
45365function reduce(accumulator, seed) {
45366 if (arguments.length >= 2) {
45367 return function reduceOperatorFunctionWithSeed(source) {
45368 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["a" /* pipe */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__scan__["a" /* scan */])(accumulator, seed), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__takeLast__["a" /* takeLast */])(1), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__defaultIfEmpty__["a" /* defaultIfEmpty */])(seed))(source);
45369 };
45370 }
45371 return function reduceOperatorFunction(source) {
45372 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["a" /* pipe */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__scan__["a" /* scan */])(function (acc, value, index) { return accumulator(acc, value, index + 1); }), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__takeLast__["a" /* takeLast */])(1))(source);
45373 };
45374}
45375//# sourceMappingURL=reduce.js.map
45376
45377
45378/***/ }),
45379/* 179 */
45380/***/ (function(module, __webpack_exports__, __webpack_require__) {
45381
45382"use strict";
45383/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return throwIfEmpty; });
45384/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__tap__ = __webpack_require__(405);
45385/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_EmptyError__ = __webpack_require__(141);
45386/** PURE_IMPORTS_START _tap,_util_EmptyError PURE_IMPORTS_END */
45387
45388
45389var throwIfEmpty = function (errorFactory) {
45390 if (errorFactory === void 0) {
45391 errorFactory = defaultErrorFactory;
45392 }
45393 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__tap__["a" /* tap */])({
45394 hasValue: false,
45395 next: function () { this.hasValue = true; },
45396 complete: function () {
45397 if (!this.hasValue) {
45398 throw errorFactory();
45399 }
45400 }
45401 });
45402};
45403function defaultErrorFactory() {
45404 return new __WEBPACK_IMPORTED_MODULE_1__util_EmptyError__["a" /* EmptyError */]();
45405}
45406//# sourceMappingURL=throwIfEmpty.js.map
45407
45408
45409/***/ }),
45410/* 180 */
45411/***/ (function(module, __webpack_exports__, __webpack_require__) {
45412
45413"use strict";
45414/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ObjectUnsubscribedError; });
45415/** PURE_IMPORTS_START PURE_IMPORTS_END */
45416function ObjectUnsubscribedErrorImpl() {
45417 Error.call(this);
45418 this.message = 'object unsubscribed';
45419 this.name = 'ObjectUnsubscribedError';
45420 return this;
45421}
45422ObjectUnsubscribedErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
45423var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;
45424//# sourceMappingURL=ObjectUnsubscribedError.js.map
45425
45426
45427/***/ }),
45428/* 181 */
45429/***/ (function(module, __webpack_exports__, __webpack_require__) {
45430
45431"use strict";
45432/* harmony export (immutable) */ __webpack_exports__["a"] = isNumeric;
45433/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__isArray__ = __webpack_require__(48);
45434/** PURE_IMPORTS_START _isArray PURE_IMPORTS_END */
45435
45436function isNumeric(val) {
45437 return !__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__isArray__["a" /* isArray */])(val) && (val - parseFloat(val) + 1) >= 0;
45438}
45439//# sourceMappingURL=isNumeric.js.map
45440
45441
45442/***/ }),
45443/* 182 */
45444/***/ (function(module, __webpack_exports__, __webpack_require__) {
45445
45446"use strict";
45447/* harmony export (immutable) */ __webpack_exports__["a"] = noop;
45448/** PURE_IMPORTS_START PURE_IMPORTS_END */
45449function noop() { }
45450//# sourceMappingURL=noop.js.map
45451
45452
45453/***/ }),
45454/* 183 */
45455/***/ (function(module, exports, __webpack_require__) {
45456
45457// Copyright 2015 Joyent, Inc.
45458
45459module.exports = {
45460 read: read,
45461 readSSHPrivate: readSSHPrivate,
45462 write: write
45463};
45464
45465var assert = __webpack_require__(22);
45466var asn1 = __webpack_require__(66);
45467var Buffer = __webpack_require__(20).Buffer;
45468var algs = __webpack_require__(39);
45469var utils = __webpack_require__(32);
45470var crypto = __webpack_require__(21);
45471
45472var Key = __webpack_require__(34);
45473var PrivateKey = __webpack_require__(40);
45474var pem = __webpack_require__(82);
45475var rfc4253 = __webpack_require__(92);
45476var SSHBuffer = __webpack_require__(147);
45477var errors = __webpack_require__(69);
45478
45479var bcrypt;
45480
45481function read(buf, options) {
45482 return (pem.read(buf, options));
45483}
45484
45485var MAGIC = 'openssh-key-v1';
45486
45487function readSSHPrivate(type, buf, options) {
45488 buf = new SSHBuffer({buffer: buf});
45489
45490 var magic = buf.readCString();
45491 assert.strictEqual(magic, MAGIC, 'bad magic string');
45492
45493 var cipher = buf.readString();
45494 var kdf = buf.readString();
45495 var kdfOpts = buf.readBuffer();
45496
45497 var nkeys = buf.readInt();
45498 if (nkeys !== 1) {
45499 throw (new Error('OpenSSH-format key file contains ' +
45500 'multiple keys: this is unsupported.'));
45501 }
45502
45503 var pubKey = buf.readBuffer();
45504
45505 if (type === 'public') {
45506 assert.ok(buf.atEnd(), 'excess bytes left after key');
45507 return (rfc4253.read(pubKey));
45508 }
45509
45510 var privKeyBlob = buf.readBuffer();
45511 assert.ok(buf.atEnd(), 'excess bytes left after key');
45512
45513 var kdfOptsBuf = new SSHBuffer({ buffer: kdfOpts });
45514 switch (kdf) {
45515 case 'none':
45516 if (cipher !== 'none') {
45517 throw (new Error('OpenSSH-format key uses KDF "none" ' +
45518 'but specifies a cipher other than "none"'));
45519 }
45520 break;
45521 case 'bcrypt':
45522 var salt = kdfOptsBuf.readBuffer();
45523 var rounds = kdfOptsBuf.readInt();
45524 var cinf = utils.opensshCipherInfo(cipher);
45525 if (bcrypt === undefined) {
45526 bcrypt = __webpack_require__(317);
45527 }
45528
45529 if (typeof (options.passphrase) === 'string') {
45530 options.passphrase = Buffer.from(options.passphrase,
45531 'utf-8');
45532 }
45533 if (!Buffer.isBuffer(options.passphrase)) {
45534 throw (new errors.KeyEncryptedError(
45535 options.filename, 'OpenSSH'));
45536 }
45537
45538 var pass = new Uint8Array(options.passphrase);
45539 var salti = new Uint8Array(salt);
45540 /* Use the pbkdf to derive both the key and the IV. */
45541 var out = new Uint8Array(cinf.keySize + cinf.blockSize);
45542 var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length,
45543 out, out.length, rounds);
45544 if (res !== 0) {
45545 throw (new Error('bcrypt_pbkdf function returned ' +
45546 'failure, parameters invalid'));
45547 }
45548 out = Buffer.from(out);
45549 var ckey = out.slice(0, cinf.keySize);
45550 var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);
45551 var cipherStream = crypto.createDecipheriv(cinf.opensslName,
45552 ckey, iv);
45553 cipherStream.setAutoPadding(false);
45554 var chunk, chunks = [];
45555 cipherStream.once('error', function (e) {
45556 if (e.toString().indexOf('bad decrypt') !== -1) {
45557 throw (new Error('Incorrect passphrase ' +
45558 'supplied, could not decrypt key'));
45559 }
45560 throw (e);
45561 });
45562 cipherStream.write(privKeyBlob);
45563 cipherStream.end();
45564 while ((chunk = cipherStream.read()) !== null)
45565 chunks.push(chunk);
45566 privKeyBlob = Buffer.concat(chunks);
45567 break;
45568 default:
45569 throw (new Error(
45570 'OpenSSH-format key uses unknown KDF "' + kdf + '"'));
45571 }
45572
45573 buf = new SSHBuffer({buffer: privKeyBlob});
45574
45575 var checkInt1 = buf.readInt();
45576 var checkInt2 = buf.readInt();
45577 if (checkInt1 !== checkInt2) {
45578 throw (new Error('Incorrect passphrase supplied, could not ' +
45579 'decrypt key'));
45580 }
45581
45582 var ret = {};
45583 var key = rfc4253.readInternal(ret, 'private', buf.remainder());
45584
45585 buf.skip(ret.consumed);
45586
45587 var comment = buf.readString();
45588 key.comment = comment;
45589
45590 return (key);
45591}
45592
45593function write(key, options) {
45594 var pubKey;
45595 if (PrivateKey.isPrivateKey(key))
45596 pubKey = key.toPublic();
45597 else
45598 pubKey = key;
45599
45600 var cipher = 'none';
45601 var kdf = 'none';
45602 var kdfopts = Buffer.alloc(0);
45603 var cinf = { blockSize: 8 };
45604 var passphrase;
45605 if (options !== undefined) {
45606 passphrase = options.passphrase;
45607 if (typeof (passphrase) === 'string')
45608 passphrase = Buffer.from(passphrase, 'utf-8');
45609 if (passphrase !== undefined) {
45610 assert.buffer(passphrase, 'options.passphrase');
45611 assert.optionalString(options.cipher, 'options.cipher');
45612 cipher = options.cipher;
45613 if (cipher === undefined)
45614 cipher = 'aes128-ctr';
45615 cinf = utils.opensshCipherInfo(cipher);
45616 kdf = 'bcrypt';
45617 }
45618 }
45619
45620 var privBuf;
45621 if (PrivateKey.isPrivateKey(key)) {
45622 privBuf = new SSHBuffer({});
45623 var checkInt = crypto.randomBytes(4).readUInt32BE(0);
45624 privBuf.writeInt(checkInt);
45625 privBuf.writeInt(checkInt);
45626 privBuf.write(key.toBuffer('rfc4253'));
45627 privBuf.writeString(key.comment || '');
45628
45629 var n = 1;
45630 while (privBuf._offset % cinf.blockSize !== 0)
45631 privBuf.writeChar(n++);
45632 privBuf = privBuf.toBuffer();
45633 }
45634
45635 switch (kdf) {
45636 case 'none':
45637 break;
45638 case 'bcrypt':
45639 var salt = crypto.randomBytes(16);
45640 var rounds = 16;
45641 var kdfssh = new SSHBuffer({});
45642 kdfssh.writeBuffer(salt);
45643 kdfssh.writeInt(rounds);
45644 kdfopts = kdfssh.toBuffer();
45645
45646 if (bcrypt === undefined) {
45647 bcrypt = __webpack_require__(317);
45648 }
45649 var pass = new Uint8Array(passphrase);
45650 var salti = new Uint8Array(salt);
45651 /* Use the pbkdf to derive both the key and the IV. */
45652 var out = new Uint8Array(cinf.keySize + cinf.blockSize);
45653 var res = bcrypt.pbkdf(pass, pass.length, salti, salti.length,
45654 out, out.length, rounds);
45655 if (res !== 0) {
45656 throw (new Error('bcrypt_pbkdf function returned ' +
45657 'failure, parameters invalid'));
45658 }
45659 out = Buffer.from(out);
45660 var ckey = out.slice(0, cinf.keySize);
45661 var iv = out.slice(cinf.keySize, cinf.keySize + cinf.blockSize);
45662
45663 var cipherStream = crypto.createCipheriv(cinf.opensslName,
45664 ckey, iv);
45665 cipherStream.setAutoPadding(false);
45666 var chunk, chunks = [];
45667 cipherStream.once('error', function (e) {
45668 throw (e);
45669 });
45670 cipherStream.write(privBuf);
45671 cipherStream.end();
45672 while ((chunk = cipherStream.read()) !== null)
45673 chunks.push(chunk);
45674 privBuf = Buffer.concat(chunks);
45675 break;
45676 default:
45677 throw (new Error('Unsupported kdf ' + kdf));
45678 }
45679
45680 var buf = new SSHBuffer({});
45681
45682 buf.writeCString(MAGIC);
45683 buf.writeString(cipher); /* cipher */
45684 buf.writeString(kdf); /* kdf */
45685 buf.writeBuffer(kdfopts); /* kdfoptions */
45686
45687 buf.writeInt(1); /* nkeys */
45688 buf.writeBuffer(pubKey.toBuffer('rfc4253'));
45689
45690 if (privBuf)
45691 buf.writeBuffer(privBuf);
45692
45693 buf = buf.toBuffer();
45694
45695 var header;
45696 if (PrivateKey.isPrivateKey(key))
45697 header = 'OPENSSH PRIVATE KEY';
45698 else
45699 header = 'OPENSSH PUBLIC KEY';
45700
45701 var tmp = buf.toString('base64');
45702 var len = tmp.length + (tmp.length / 70) +
45703 18 + 16 + header.length*2 + 10;
45704 buf = Buffer.alloc(len);
45705 var o = 0;
45706 o += buf.write('-----BEGIN ' + header + '-----\n', o);
45707 for (var i = 0; i < tmp.length; ) {
45708 var limit = i + 70;
45709 if (limit > tmp.length)
45710 limit = tmp.length;
45711 o += buf.write(tmp.slice(i, limit), o);
45712 buf[o++] = 10;
45713 i = limit;
45714 }
45715 o += buf.write('-----END ' + header + '-----\n', o);
45716
45717 return (buf.slice(0, o));
45718}
45719
45720
45721/***/ }),
45722/* 184 */
45723/***/ (function(module, exports, __webpack_require__) {
45724
45725var chownr = __webpack_require__(566)
45726var tar = __webpack_require__(431)
45727var pump = __webpack_require__(853)
45728var mkdirp = __webpack_require__(241)
45729var fs = __webpack_require__(12)
45730var path = __webpack_require__(1)
45731var os = __webpack_require__(72)
45732
45733var win32 = os.platform() === 'win32'
45734
45735var noop = function () {}
45736
45737var echo = function (name) {
45738 return name
45739}
45740
45741var normalize = !win32 ? echo : function (name) {
45742 return name.replace(/\\/g, '/').replace(/[:?<>|]/g, '_')
45743}
45744
45745var statAll = function (fs, stat, cwd, ignore, entries, sort) {
45746 var queue = entries || ['.']
45747
45748 return function loop (callback) {
45749 if (!queue.length) return callback()
45750 var next = queue.shift()
45751 var nextAbs = path.join(cwd, next)
45752
45753 stat(nextAbs, function (err, stat) {
45754 if (err) return callback(err)
45755
45756 if (!stat.isDirectory()) return callback(null, next, stat)
45757
45758 fs.readdir(nextAbs, function (err, files) {
45759 if (err) return callback(err)
45760
45761 if (sort) files.sort()
45762 for (var i = 0; i < files.length; i++) {
45763 if (!ignore(path.join(cwd, next, files[i]))) queue.push(path.join(next, files[i]))
45764 }
45765
45766 callback(null, next, stat)
45767 })
45768 })
45769 }
45770}
45771
45772var strip = function (map, level) {
45773 return function (header) {
45774 header.name = header.name.split('/').slice(level).join('/')
45775
45776 var linkname = header.linkname
45777 if (linkname && (header.type === 'link' || path.isAbsolute(linkname))) {
45778 header.linkname = linkname.split('/').slice(level).join('/')
45779 }
45780
45781 return map(header)
45782 }
45783}
45784
45785exports.pack = function (cwd, opts) {
45786 if (!cwd) cwd = '.'
45787 if (!opts) opts = {}
45788
45789 var xfs = opts.fs || fs
45790 var ignore = opts.ignore || opts.filter || noop
45791 var map = opts.map || noop
45792 var mapStream = opts.mapStream || echo
45793 var statNext = statAll(xfs, opts.dereference ? xfs.stat : xfs.lstat, cwd, ignore, opts.entries, opts.sort)
45794 var strict = opts.strict !== false
45795 var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask()
45796 var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0
45797 var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0
45798 var pack = opts.pack || tar.pack()
45799 var finish = opts.finish || noop
45800
45801 if (opts.strip) map = strip(map, opts.strip)
45802
45803 if (opts.readable) {
45804 dmode |= parseInt(555, 8)
45805 fmode |= parseInt(444, 8)
45806 }
45807 if (opts.writable) {
45808 dmode |= parseInt(333, 8)
45809 fmode |= parseInt(222, 8)
45810 }
45811
45812 var onsymlink = function (filename, header) {
45813 xfs.readlink(path.join(cwd, filename), function (err, linkname) {
45814 if (err) return pack.destroy(err)
45815 header.linkname = normalize(linkname)
45816 pack.entry(header, onnextentry)
45817 })
45818 }
45819
45820 var onstat = function (err, filename, stat) {
45821 if (err) return pack.destroy(err)
45822 if (!filename) {
45823 if (opts.finalize !== false) pack.finalize()
45824 return finish(pack)
45825 }
45826
45827 if (stat.isSocket()) return onnextentry() // tar does not support sockets...
45828
45829 var header = {
45830 name: normalize(filename),
45831 mode: (stat.mode | (stat.isDirectory() ? dmode : fmode)) & umask,
45832 mtime: stat.mtime,
45833 size: stat.size,
45834 type: 'file',
45835 uid: stat.uid,
45836 gid: stat.gid
45837 }
45838
45839 if (stat.isDirectory()) {
45840 header.size = 0
45841 header.type = 'directory'
45842 header = map(header) || header
45843 return pack.entry(header, onnextentry)
45844 }
45845
45846 if (stat.isSymbolicLink()) {
45847 header.size = 0
45848 header.type = 'symlink'
45849 header = map(header) || header
45850 return onsymlink(filename, header)
45851 }
45852
45853 // TODO: add fifo etc...
45854
45855 header = map(header) || header
45856
45857 if (!stat.isFile()) {
45858 if (strict) return pack.destroy(new Error('unsupported type for ' + filename))
45859 return onnextentry()
45860 }
45861
45862 var entry = pack.entry(header, onnextentry)
45863 if (!entry) return
45864
45865 var rs = mapStream(xfs.createReadStream(path.join(cwd, filename)), header)
45866
45867 rs.on('error', function (err) { // always forward errors on destroy
45868 entry.destroy(err)
45869 })
45870
45871 pump(rs, entry)
45872 }
45873
45874 var onnextentry = function (err) {
45875 if (err) return pack.destroy(err)
45876 statNext(onstat)
45877 }
45878
45879 onnextentry()
45880
45881 return pack
45882}
45883
45884var head = function (list) {
45885 return list.length ? list[list.length - 1] : null
45886}
45887
45888var processGetuid = function () {
45889 return process.getuid ? process.getuid() : -1
45890}
45891
45892var processUmask = function () {
45893 return process.umask ? process.umask() : 0
45894}
45895
45896exports.extract = function (cwd, opts) {
45897 if (!cwd) cwd = '.'
45898 if (!opts) opts = {}
45899
45900 var xfs = opts.fs || fs
45901 var ignore = opts.ignore || opts.filter || noop
45902 var map = opts.map || noop
45903 var mapStream = opts.mapStream || echo
45904 var own = opts.chown !== false && !win32 && processGetuid() === 0
45905 var extract = opts.extract || tar.extract()
45906 var stack = []
45907 var now = new Date()
45908 var umask = typeof opts.umask === 'number' ? ~opts.umask : ~processUmask()
45909 var dmode = typeof opts.dmode === 'number' ? opts.dmode : 0
45910 var fmode = typeof opts.fmode === 'number' ? opts.fmode : 0
45911 var strict = opts.strict !== false
45912
45913 if (opts.strip) map = strip(map, opts.strip)
45914
45915 if (opts.readable) {
45916 dmode |= parseInt(555, 8)
45917 fmode |= parseInt(444, 8)
45918 }
45919 if (opts.writable) {
45920 dmode |= parseInt(333, 8)
45921 fmode |= parseInt(222, 8)
45922 }
45923
45924 var utimesParent = function (name, cb) { // we just set the mtime on the parent dir again everytime we write an entry
45925 var top
45926 while ((top = head(stack)) && name.slice(0, top[0].length) !== top[0]) stack.pop()
45927 if (!top) return cb()
45928 xfs.utimes(top[0], now, top[1], cb)
45929 }
45930
45931 var utimes = function (name, header, cb) {
45932 if (opts.utimes === false) return cb()
45933
45934 if (header.type === 'directory') return xfs.utimes(name, now, header.mtime, cb)
45935 if (header.type === 'symlink') return utimesParent(name, cb) // TODO: how to set mtime on link?
45936
45937 xfs.utimes(name, now, header.mtime, function (err) {
45938 if (err) return cb(err)
45939 utimesParent(name, cb)
45940 })
45941 }
45942
45943 var chperm = function (name, header, cb) {
45944 var link = header.type === 'symlink'
45945 var chmod = link ? xfs.lchmod : xfs.chmod
45946 var chown = link ? xfs.lchown : xfs.chown
45947
45948 if (!chmod) return cb()
45949
45950 var mode = (header.mode | (header.type === 'directory' ? dmode : fmode)) & umask
45951 chmod(name, mode, function (err) {
45952 if (err) return cb(err)
45953 if (!own) return cb()
45954 if (!chown) return cb()
45955 chown(name, header.uid, header.gid, cb)
45956 })
45957 }
45958
45959 extract.on('entry', function (header, stream, next) {
45960 header = map(header) || header
45961 header.name = normalize(header.name)
45962 var name = path.join(cwd, path.join('/', header.name))
45963
45964 if (ignore(name, header)) {
45965 stream.resume()
45966 return next()
45967 }
45968
45969 var stat = function (err) {
45970 if (err) return next(err)
45971 utimes(name, header, function (err) {
45972 if (err) return next(err)
45973 if (win32) return next()
45974 chperm(name, header, next)
45975 })
45976 }
45977
45978 var onsymlink = function () {
45979 if (win32) return next() // skip symlinks on win for now before it can be tested
45980 xfs.unlink(name, function () {
45981 xfs.symlink(header.linkname, name, stat)
45982 })
45983 }
45984
45985 var onlink = function () {
45986 if (win32) return next() // skip links on win for now before it can be tested
45987 xfs.unlink(name, function () {
45988 var srcpath = path.join(cwd, path.join('/', header.linkname))
45989
45990 xfs.link(srcpath, name, function (err) {
45991 if (err && err.code === 'EPERM' && opts.hardlinkAsFilesFallback) {
45992 stream = xfs.createReadStream(srcpath)
45993 return onfile()
45994 }
45995
45996 stat(err)
45997 })
45998 })
45999 }
46000
46001 var onfile = function () {
46002 var ws = xfs.createWriteStream(name)
46003 var rs = mapStream(stream, header)
46004
46005 ws.on('error', function (err) { // always forward errors on destroy
46006 rs.destroy(err)
46007 })
46008
46009 pump(rs, ws, function (err) {
46010 if (err) return next(err)
46011 ws.on('close', stat)
46012 })
46013 }
46014
46015 if (header.type === 'directory') {
46016 stack.push([name, header.mtime])
46017 return mkdirfix(name, {
46018 fs: xfs, own: own, uid: header.uid, gid: header.gid
46019 }, stat)
46020 }
46021
46022 var dir = path.dirname(name)
46023
46024 validate(xfs, dir, path.join(cwd, '.'), function (err, valid) {
46025 if (err) return next(err)
46026 if (!valid) return next(new Error(dir + ' is not a valid path'))
46027
46028 mkdirfix(dir, {
46029 fs: xfs, own: own, uid: header.uid, gid: header.gid
46030 }, function (err) {
46031 if (err) return next(err)
46032
46033 switch (header.type) {
46034 case 'file': return onfile()
46035 case 'link': return onlink()
46036 case 'symlink': return onsymlink()
46037 }
46038
46039 if (strict) return next(new Error('unsupported type for ' + name + ' (' + header.type + ')'))
46040
46041 stream.resume()
46042 next()
46043 })
46044 })
46045 })
46046
46047 if (opts.finish) extract.on('finish', opts.finish)
46048
46049 return extract
46050}
46051
46052function validate (fs, name, root, cb) {
46053 if (name === root) return cb(null, true)
46054 fs.lstat(name, function (err, st) {
46055 if (err && err.code !== 'ENOENT') return cb(err)
46056 if (err || st.isDirectory()) return validate(fs, path.join(name, '..'), root, cb)
46057 cb(null, false)
46058 })
46059}
46060
46061function mkdirfix (name, opts, cb) {
46062 mkdirp(name, {fs: opts.fs}, function (err, made) {
46063 if (!err && made && opts.own) {
46064 chownr(made, opts.uid, opts.gid, cb)
46065 } else {
46066 cb(err)
46067 }
46068 })
46069}
46070
46071
46072/***/ }),
46073/* 185 */
46074/***/ (function(module, exports) {
46075
46076module.exports = require("https");
46077
46078/***/ }),
46079/* 186 */
46080/***/ (function(module, exports) {
46081
46082module.exports = require("querystring");
46083
46084/***/ }),
46085/* 187 */
46086/***/ (function(module, exports) {
46087
46088module.exports = require("readline");
46089
46090/***/ }),
46091/* 188 */
46092/***/ (function(module, exports) {
46093
46094module.exports = require("zlib");
46095
46096/***/ }),
46097/* 189 */
46098/***/ (function(module, exports, __webpack_require__) {
46099
46100"use strict";
46101
46102
46103Object.defineProperty(exports, "__esModule", {
46104 value: true
46105});
46106
46107var _consoleReporter;
46108
46109function _load_consoleReporter() {
46110 return _consoleReporter = __webpack_require__(517);
46111}
46112
46113Object.defineProperty(exports, 'ConsoleReporter', {
46114 enumerable: true,
46115 get: function get() {
46116 return _interopRequireDefault(_consoleReporter || _load_consoleReporter()).default;
46117 }
46118});
46119
46120var _bufferReporter;
46121
46122function _load_bufferReporter() {
46123 return _bufferReporter = __webpack_require__(516);
46124}
46125
46126Object.defineProperty(exports, 'BufferReporter', {
46127 enumerable: true,
46128 get: function get() {
46129 return _interopRequireDefault(_bufferReporter || _load_bufferReporter()).default;
46130 }
46131});
46132
46133var _eventReporter;
46134
46135function _load_eventReporter() {
46136 return _eventReporter = __webpack_require__(521);
46137}
46138
46139Object.defineProperty(exports, 'EventReporter', {
46140 enumerable: true,
46141 get: function get() {
46142 return _interopRequireDefault(_eventReporter || _load_eventReporter()).default;
46143 }
46144});
46145
46146var _jsonReporter;
46147
46148function _load_jsonReporter() {
46149 return _jsonReporter = __webpack_require__(200);
46150}
46151
46152Object.defineProperty(exports, 'JSONReporter', {
46153 enumerable: true,
46154 get: function get() {
46155 return _interopRequireDefault(_jsonReporter || _load_jsonReporter()).default;
46156 }
46157});
46158
46159var _noopReporter;
46160
46161function _load_noopReporter() {
46162 return _noopReporter = __webpack_require__(525);
46163}
46164
46165Object.defineProperty(exports, 'NoopReporter', {
46166 enumerable: true,
46167 get: function get() {
46168 return _interopRequireDefault(_noopReporter || _load_noopReporter()).default;
46169 }
46170});
46171
46172var _baseReporter;
46173
46174function _load_baseReporter() {
46175 return _baseReporter = __webpack_require__(98);
46176}
46177
46178Object.defineProperty(exports, 'Reporter', {
46179 enumerable: true,
46180 get: function get() {
46181 return _interopRequireDefault(_baseReporter || _load_baseReporter()).default;
46182 }
46183});
46184
46185function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
46186
46187/***/ }),
46188/* 190 */
46189/***/ (function(module, exports, __webpack_require__) {
46190
46191"use strict";
46192
46193// On windows, create a .cmd file.
46194// Read the #! in the file to see what it uses. The vast majority
46195// of the time, this will be either:
46196// "#!/usr/bin/env <prog> <args...>"
46197// or:
46198// "#!<prog> <args...>"
46199//
46200// Write a binroot/pkg.bin + ".cmd" file that has this line in it:
46201// @<prog> <args...> %~dp0<target> %*
46202
46203module.exports = cmdShim
46204cmdShim.ifExists = cmdShimIfExists
46205
46206const fs = __webpack_require__(834)
46207
46208const mkdir = __webpack_require__(832)
46209const path = __webpack_require__(1)
46210const isWindows = __webpack_require__(793)
46211const shebangExpr = /^#!\s*(?:\/usr\/bin\/env)?\s*([^ \t]+)(.*)$/
46212const DEFAULT_OPTIONS = {
46213 // Create PowerShell file by default if the option hasn't been specified
46214 createPwshFile: true,
46215 createCmdFile: isWindows()
46216}
46217
46218function cmdShimIfExists (src, to, opts) {
46219 opts = Object.assign({}, DEFAULT_OPTIONS, opts)
46220 return fs.stat(src)
46221 .then(() => cmdShim(src, to, opts))
46222 .catch(() => {})
46223}
46224
46225// Try to unlink, but ignore errors.
46226// Any problems will surface later.
46227function rm (path) {
46228 return fs.unlink(path).catch(() => {})
46229}
46230
46231function cmdShim (src, to, opts) {
46232 opts = Object.assign({}, DEFAULT_OPTIONS, opts)
46233 return fs.stat(src)
46234 .then(() => cmdShim_(src, to, opts))
46235}
46236
46237function cmdShim_ (src, to, opts) {
46238 return Promise.all([
46239 rm(to),
46240 rm(`${to}.ps1`),
46241 opts.createCmdFile && rm(`${to}.cmd`)
46242 ])
46243 .then(() => writeShim(src, to, opts))
46244}
46245
46246function writeShim (src, to, opts) {
46247 opts = Object.assign({}, DEFAULT_OPTIONS, opts)
46248 const defaultArgs = opts.preserveSymlinks ? '--preserve-symlinks' : ''
46249 // make a cmd file and a sh script
46250 // First, check if the bin is a #! of some sort.
46251 // If not, then assume it's something that'll be compiled, or some other
46252 // sort of script, and just call it directly.
46253 return mkdir(path.dirname(to))
46254 .then(() => {
46255 return fs.readFile(src, 'utf8')
46256 .then(data => {
46257 const firstLine = data.trim().split(/\r*\n/)[0]
46258 const shebang = firstLine.match(shebangExpr)
46259 if (!shebang) return writeShim_(src, to, Object.assign({}, opts, {args: defaultArgs}))
46260 const prog = shebang[1]
46261 const args = (shebang[2] && ((defaultArgs && (shebang[2] + ' ' + defaultArgs)) || shebang[2])) || defaultArgs
46262 return writeShim_(src, to, Object.assign({}, opts, {prog, args}))
46263 })
46264 .catch(() => writeShim_(src, to, Object.assign({}, opts, {args: defaultArgs})))
46265 })
46266}
46267
46268function writeShim_ (src, to, opts) {
46269 opts = Object.assign({}, DEFAULT_OPTIONS, opts)
46270 let shTarget = path.relative(path.dirname(to), src)
46271 let target = shTarget.split('/').join('\\')
46272 let longProg
46273 let prog = opts.prog
46274 let shProg = prog && prog.split('\\').join('/')
46275 let shLongProg
46276 let pwshProg = shProg && `"${shProg}$exe"`
46277 let pwshLongProg
46278 shTarget = shTarget.split('\\').join('/')
46279 let args = opts.args || ''
46280 let {
46281 win32: nodePath,
46282 posix: shNodePath
46283 } = normalizePathEnvVar(opts.nodePath)
46284 if (!prog) {
46285 prog = `"%~dp0\\${target}"`
46286 shProg = `"$basedir/${shTarget}"`
46287 pwshProg = shProg
46288 args = ''
46289 target = ''
46290 shTarget = ''
46291 } else {
46292 longProg = `"%~dp0\\${prog}.exe"`
46293 shLongProg = '"$basedir/' + prog + '"'
46294 pwshLongProg = `"$basedir/${prog}$exe"`
46295 target = `"%~dp0\\${target}"`
46296 shTarget = `"$basedir/${shTarget}"`
46297 }
46298
46299 let cmd
46300 if (opts.createCmdFile) {
46301 // @IF EXIST "%~dp0\node.exe" (
46302 // "%~dp0\node.exe" "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
46303 // ) ELSE (
46304 // SETLOCAL
46305 // SET PATHEXT=%PATHEXT:;.JS;=;%
46306 // node "%~dp0\.\node_modules\npm\bin\npm-cli.js" %*
46307 // )
46308 cmd = nodePath ? `@SET NODE_PATH=${nodePath}\r\n` : ''
46309 if (longProg) {
46310 cmd += '@IF EXIST ' + longProg + ' (\r\n' +
46311 ' ' + longProg + ' ' + args + ' ' + target + ' %*\r\n' +
46312 ') ELSE (\r\n' +
46313 ' @SETLOCAL\r\n' +
46314 ' @SET PATHEXT=%PATHEXT:;.JS;=;%\r\n' +
46315 ' ' + prog + ' ' + args + ' ' + target + ' %*\r\n' +
46316 ')'
46317 } else {
46318 cmd += `@${prog} ${args} ${target} %*\r\n`
46319 }
46320 }
46321
46322 // #!/bin/sh
46323 // basedir=`dirname "$0"`
46324 //
46325 // case `uname` in
46326 // *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
46327 // esac
46328 //
46329 // if [ -x "$basedir/node.exe" ]; then
46330 // "$basedir/node.exe" "$basedir/node_modules/npm/bin/npm-cli.js" "$@"
46331 // ret=$?
46332 // else
46333 // node "$basedir/node_modules/npm/bin/npm-cli.js" "$@"
46334 // ret=$?
46335 // fi
46336 // exit $ret
46337
46338 let sh = '#!/bin/sh\n'
46339 sh = sh +
46340 "basedir=$(dirname \"$(echo \"$0\" | sed -e 's,\\\\,/,g')\")\n" +
46341 '\n' +
46342 'case `uname` in\n' +
46343 ' *CYGWIN*) basedir=`cygpath -w "$basedir"`;;\n' +
46344 'esac\n' +
46345 '\n'
46346 const env = opts.nodePath ? `NODE_PATH="${shNodePath}" ` : ''
46347
46348 if (shLongProg) {
46349 sh = sh +
46350 'if [ -x ' + shLongProg + ' ]; then\n' +
46351 ' ' + env + shLongProg + ' ' + args + ' ' + shTarget + ' "$@"\n' +
46352 ' ret=$?\n' +
46353 'else \n' +
46354 ' ' + env + shProg + ' ' + args + ' ' + shTarget + ' "$@"\n' +
46355 ' ret=$?\n' +
46356 'fi\n' +
46357 'exit $ret\n'
46358 } else {
46359 sh = sh + env + shProg + ' ' + args + ' ' + shTarget + ' "$@"\n' +
46360 'exit $?\n'
46361 }
46362
46363 // #!/usr/bin/env pwsh
46364 // $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
46365 //
46366 // $ret=0
46367 // $exe = ""
46368 // if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
46369 // # Fix case when both the Windows and Linux builds of Node
46370 // # are installed in the same directory
46371 // $exe = ".exe"
46372 // }
46373 // if (Test-Path "$basedir/node") {
46374 // & "$basedir/node$exe" "$basedir/node_modules/npm/bin/npm-cli.js" $args
46375 // $ret=$LASTEXITCODE
46376 // } else {
46377 // & "node$exe" "$basedir/node_modules/npm/bin/npm-cli.js" $args
46378 // $ret=$LASTEXITCODE
46379 // }
46380 // exit $ret
46381 let pwsh = '#!/usr/bin/env pwsh\n' +
46382 '$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent\n' +
46383 '\n' +
46384 '$exe=""\n' +
46385 (opts.nodePath ? '$env_node_path=$env:NODE_PATH\n' +
46386 `$env:NODE_PATH="${nodePath}"\n` : '') +
46387 'if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {\n' +
46388 ' # Fix case when both the Windows and Linux builds of Node\n' +
46389 ' # are installed in the same directory\n' +
46390 ' $exe=".exe"\n' +
46391 '}'
46392 if (opts.nodePath) {
46393 pwsh = pwsh +
46394 ' else {\n' +
46395 ` $env:NODE_PATH="${shNodePath}"\n` +
46396 '}'
46397 }
46398 pwsh += '\n'
46399 if (shLongProg) {
46400 pwsh = pwsh +
46401 '$ret=0\n' +
46402 `if (Test-Path ${pwshLongProg}) {\n` +
46403 ` & ${pwshLongProg} ${args} ${shTarget} $args\n` +
46404 ' $ret=$LASTEXITCODE\n' +
46405 '} else {\n' +
46406 ` & ${pwshProg} ${args} ${shTarget} $args\n` +
46407 ' $ret=$LASTEXITCODE\n' +
46408 '}\n' +
46409 (opts.nodePath ? '$env:NODE_PATH=$env_node_path\n' : '') +
46410 'exit $ret\n'
46411 } else {
46412 pwsh = pwsh +
46413 `& ${pwshProg} ${args} ${shTarget} $args\n` +
46414 (opts.nodePath ? '$env:NODE_PATH=$env_node_path\n' : '') +
46415 'exit $LASTEXITCODE\n'
46416 }
46417
46418 return Promise.all([
46419 opts.createCmdFile && fs.writeFile(to + '.cmd', cmd, 'utf8'),
46420 opts.createPwshFile && fs.writeFile(`${to}.ps1`, pwsh, 'utf8'),
46421 fs.writeFile(to, sh, 'utf8')
46422 ])
46423 .then(() => chmodShim(to, opts))
46424}
46425
46426function chmodShim (to, {createCmdFile, createPwshFile}) {
46427 return Promise.all([
46428 fs.chmod(to, 0o755),
46429 createPwshFile && fs.chmod(`${to}.ps1`, 0o755),
46430 createCmdFile && fs.chmod(`${to}.cmd`, 0o755)
46431 ])
46432}
46433
46434/**
46435 * @param {string|string[]} nodePath
46436 * @returns {{win32:string,posix:string}}
46437 */
46438function normalizePathEnvVar (nodePath) {
46439 if (!nodePath) {
46440 return {
46441 win32: nodePath,
46442 posix: nodePath
46443 }
46444 }
46445 let split = (typeof nodePath === 'string' ? nodePath.split(path.delimiter) : Array.from(nodePath))
46446 let result = {}
46447 for (let i = 0; i < split.length; i++) {
46448 const win32 = split[i].split('/').join('\\')
46449 const posix = isWindows() ? split[i].split('\\').join('/').replace(/^([^:\\/]*):/, (_, $1) => `/mnt/${$1.toLowerCase()}`) : split[i]
46450
46451 result.win32 = result.win32 ? `${result.win32};${win32}` : win32
46452 result.posix = result.posix ? `${result.posix}:${posix}` : posix
46453
46454 result[i] = {win32, posix}
46455 }
46456 return result
46457}
46458
46459
46460/***/ }),
46461/* 191 */
46462/***/ (function(module, exports) {
46463
46464// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
46465
46466
46467module.exports = {
46468
46469 newInvalidAsn1Error: function (msg) {
46470 var e = new Error();
46471 e.name = 'InvalidAsn1Error';
46472 e.message = msg || '';
46473 return e;
46474 }
46475
46476};
46477
46478
46479/***/ }),
46480/* 192 */
46481/***/ (function(module, exports) {
46482
46483// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
46484
46485
46486module.exports = {
46487 EOC: 0,
46488 Boolean: 1,
46489 Integer: 2,
46490 BitString: 3,
46491 OctetString: 4,
46492 Null: 5,
46493 OID: 6,
46494 ObjectDescriptor: 7,
46495 External: 8,
46496 Real: 9, // float
46497 Enumeration: 10,
46498 PDV: 11,
46499 Utf8String: 12,
46500 RelativeOID: 13,
46501 Sequence: 16,
46502 Set: 17,
46503 NumericString: 18,
46504 PrintableString: 19,
46505 T61String: 20,
46506 VideotexString: 21,
46507 IA5String: 22,
46508 UTCTime: 23,
46509 GeneralizedTime: 24,
46510 GraphicString: 25,
46511 VisibleString: 26,
46512 GeneralString: 28,
46513 UniversalString: 29,
46514 CharacterString: 30,
46515 BMPString: 31,
46516 Constructor: 32,
46517 Context: 128
46518};
46519
46520
46521/***/ }),
46522/* 193 */
46523/***/ (function(module, exports, __webpack_require__) {
46524
46525"use strict";
46526
46527/**
46528 * Inquirer.js
46529 * A collection of common interactive command line user interfaces.
46530 */
46531
46532var inquirer = module.exports;
46533
46534/**
46535 * Client interfaces
46536 */
46537
46538inquirer.prompts = {};
46539
46540inquirer.Separator = __webpack_require__(152);
46541
46542inquirer.ui = {
46543 BottomBar: __webpack_require__(475),
46544 Prompt: __webpack_require__(476)
46545};
46546
46547/**
46548 * Create a new self-contained prompt module.
46549 */
46550inquirer.createPromptModule = function (opt) {
46551 var promptModule = function promptModule(questions) {
46552 var ui = new inquirer.ui.Prompt(promptModule.prompts, opt);
46553 var promise = ui.run(questions);
46554
46555 // Monkey patch the UI on the promise object so
46556 // that it remains publicly accessible.
46557 promise.ui = ui;
46558
46559 return promise;
46560 };
46561 promptModule.prompts = {};
46562
46563 /**
46564 * Register a prompt type
46565 * @param {String} name Prompt type name
46566 * @param {Function} prompt Prompt constructor
46567 * @return {inquirer}
46568 */
46569
46570 promptModule.registerPrompt = function (name, prompt) {
46571 promptModule.prompts[name] = prompt;
46572 return this;
46573 };
46574
46575 /**
46576 * Register the defaults provider prompts
46577 */
46578
46579 promptModule.restoreDefaultPrompts = function () {
46580 this.registerPrompt('list', __webpack_require__(471));
46581 this.registerPrompt('input', __webpack_require__(285));
46582 this.registerPrompt('number', __webpack_require__(472));
46583 this.registerPrompt('confirm', __webpack_require__(468));
46584 this.registerPrompt('rawlist', __webpack_require__(474));
46585 this.registerPrompt('expand', __webpack_require__(470));
46586 this.registerPrompt('checkbox', __webpack_require__(467));
46587 this.registerPrompt('password', __webpack_require__(473));
46588 this.registerPrompt('editor', __webpack_require__(469));
46589 };
46590
46591 promptModule.restoreDefaultPrompts();
46592
46593 return promptModule;
46594};
46595
46596/**
46597 * Public CLI helper interface
46598 * @param {Array|Object|Rx.Observable} questions - Questions settings array
46599 * @param {Function} cb - Callback being passed the user answers
46600 * @return {inquirer.ui.Prompt}
46601 */
46602
46603inquirer.prompt = inquirer.createPromptModule();
46604
46605// Expose helper functions on the top level for easiest usage by common users
46606inquirer.registerPrompt = function (name, prompt) {
46607 inquirer.prompt.registerPrompt(name, prompt);
46608};
46609inquirer.restoreDefaultPrompts = function () {
46610 inquirer.prompt.restoreDefaultPrompts();
46611};
46612
46613/***/ }),
46614/* 194 */
46615/***/ (function(module, exports, __webpack_require__) {
46616
46617"use strict";
46618
46619
46620Object.defineProperty(exports, "__esModule", {
46621 value: true
46622});
46623exports.getOutdated = exports.run = exports.requireLockfile = undefined;
46624
46625var _asyncToGenerator2;
46626
46627function _load_asyncToGenerator() {
46628 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
46629}
46630
46631var _keys;
46632
46633function _load_keys() {
46634 return _keys = _interopRequireDefault(__webpack_require__(14));
46635}
46636
46637var _assign;
46638
46639function _load_assign() {
46640 return _assign = _interopRequireDefault(__webpack_require__(23));
46641}
46642
46643var run = exports.run = function () {
46644 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
46645 var addArgs = [];
46646 var upgradeAll = args.length === 0 && typeof flags.scope === 'undefined' && typeof flags.pattern === 'undefined';
46647 var addFlags = (0, (_assign || _load_assign()).default)({}, flags, {
46648 force: true,
46649 ignoreWorkspaceRootCheck: true,
46650 workspaceRootIsCwd: config.cwd === config.lockfileFolder
46651 });
46652 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
46653 var deps = yield getOutdated(config, reporter, flags, lockfile, args);
46654 var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
46655
46656 var _ref2 = yield install.fetchRequestFromCwd(),
46657 packagePatterns = _ref2.requests;
46658
46659 setUserRequestedPackageVersions(deps, args, flags.latest, packagePatterns, reporter);
46660 cleanLockfile(lockfile, deps, packagePatterns, reporter);
46661 addArgs = deps.map(function (dep) {
46662 return dep.upgradeTo;
46663 });
46664
46665 if (flags.scope && validScopeRegex.test(flags.scope)) {
46666 addArgs = addArgs.filter(function (depName) {
46667 return depName.startsWith(flags.scope);
46668 });
46669 }
46670
46671 var add = new (_add || _load_add()).Add(addArgs, addFlags, config, reporter, upgradeAll ? new (_lockfile || _load_lockfile()).default() : lockfile);
46672 yield add.init();
46673 });
46674
46675 return function run(_x, _x2, _x3, _x4) {
46676 return _ref.apply(this, arguments);
46677 };
46678}();
46679
46680var getOutdated = exports.getOutdated = function () {
46681 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile, patterns) {
46682 var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
46683 var outdatedFieldName = flags.latest ? 'latest' : 'wanted';
46684
46685 // ensure scope is of the form `@scope/`
46686 var normalizeScope = function normalizeScope() {
46687 if (flags.scope) {
46688 if (!flags.scope.startsWith('@')) {
46689 flags.scope = '@' + flags.scope;
46690 }
46691
46692 if (!flags.scope.endsWith('/')) {
46693 flags.scope += '/';
46694 }
46695 }
46696 };
46697
46698 var versionFilter = function versionFilter(dep) {
46699 return dep.current !== dep[outdatedFieldName];
46700 };
46701
46702 if (!flags.latest) {
46703 // these flags only have an affect when --latest is used
46704 flags.tilde = false;
46705 flags.exact = false;
46706 flags.caret = false;
46707 }
46708
46709 normalizeScope();
46710
46711 var deps = (yield (_packageRequest || _load_packageRequest()).default.getOutdatedPackages(lockfile, install, config, reporter, patterns, flags)).filter(versionFilter).filter(scopeFilter.bind(this, flags));
46712 deps.forEach(function (dep) {
46713 dep.upgradeTo = buildPatternToUpgradeTo(dep, flags);
46714 reporter.verbose(reporter.lang('verboseUpgradeBecauseOutdated', dep.name, dep.upgradeTo));
46715 });
46716
46717 return deps;
46718 });
46719
46720 return function getOutdated(_x5, _x6, _x7, _x8, _x9) {
46721 return _ref3.apply(this, arguments);
46722 };
46723}();
46724
46725exports.cleanLockfile = cleanLockfile;
46726exports.setFlags = setFlags;
46727exports.hasWrapper = hasWrapper;
46728
46729var _add;
46730
46731function _load_add() {
46732 return _add = __webpack_require__(154);
46733}
46734
46735var _lockfile;
46736
46737function _load_lockfile() {
46738 return _lockfile = _interopRequireDefault(__webpack_require__(25));
46739}
46740
46741var _packageRequest;
46742
46743function _load_packageRequest() {
46744 return _packageRequest = _interopRequireDefault(__webpack_require__(116));
46745}
46746
46747var _normalizePattern;
46748
46749function _load_normalizePattern() {
46750 return _normalizePattern = __webpack_require__(52);
46751}
46752
46753var _install;
46754
46755function _load_install() {
46756 return _install = __webpack_require__(41);
46757}
46758
46759function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
46760
46761// used to detect whether a semver range is simple enough to preserve when doing a --latest upgrade.
46762// when not matched, the upgraded version range will default to `^` the same as the `add` command would.
46763var basicSemverOperatorRegex = new RegExp('^(\\^|~|>=|<=)?[^ |&,]+$');
46764
46765// used to detect if a passed parameter is a scope or a package name.
46766
46767
46768var validScopeRegex = /^@[a-zA-Z0-9-][a-zA-Z0-9_.-]*\/$/;
46769
46770// If specific versions were requested for packages, override what getOutdated reported as the latest to install
46771// Also add ones that are missing, since the requested packages may not have been outdated at all.
46772function setUserRequestedPackageVersions(deps, args, latest, packagePatterns, reporter) {
46773 args.forEach(function (requestedPattern) {
46774 var found = false;
46775 var normalized = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(requestedPattern);
46776
46777 // if the user specified a package name without a version range, then that implies "latest"
46778 // but if the latest flag is not passed then we need to use the version range from package.json
46779 if (!normalized.hasVersion && !latest) {
46780 packagePatterns.forEach(function (packagePattern) {
46781 var packageNormalized = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(packagePattern.pattern);
46782 if (packageNormalized.name === normalized.name) {
46783 normalized = packageNormalized;
46784 }
46785 });
46786 }
46787
46788 var newPattern = `${normalized.name}@${normalized.range}`;
46789
46790 // if this dependency is already in the outdated list,
46791 // just update the upgradeTo to whatever version the user requested.
46792 deps.forEach(function (dep) {
46793 if (normalized.hasVersion && dep.name === normalized.name) {
46794 found = true;
46795 dep.upgradeTo = newPattern;
46796 reporter.verbose(reporter.lang('verboseUpgradeBecauseRequested', requestedPattern, newPattern));
46797 }
46798 });
46799
46800 // if this dependency was not in the outdated list,
46801 // then add a new entry
46802 if (normalized.hasVersion && !found) {
46803 deps.push({
46804 name: normalized.name,
46805 wanted: '',
46806 latest: '',
46807 url: '',
46808 hint: '',
46809 range: '',
46810 current: '',
46811 upgradeTo: newPattern,
46812 workspaceName: '',
46813 workspaceLoc: ''
46814 });
46815 reporter.verbose(reporter.lang('verboseUpgradeBecauseRequested', requestedPattern, newPattern));
46816 }
46817 });
46818}
46819
46820// this function attempts to determine the range operator on the semver range.
46821// this will only handle the simple cases of a semver starting with '^', '~', '>=', '<=', or an exact version.
46822// "exotic" semver ranges will not be handled.
46823function getRangeOperator(version) {
46824 var result = basicSemverOperatorRegex.exec(version);
46825 return result ? result[1] || '' : '^';
46826}
46827
46828// Attempt to preserve the range operator from the package.json specified semver range.
46829// If an explicit operator was specified using --exact, --tilde, --caret, then that will take precedence.
46830function buildPatternToUpgradeTo(dep, flags) {
46831 if (dep.latest === 'exotic') {
46832 return `${dep.name}@${dep.url}`;
46833 }
46834
46835 var toLatest = flags.latest;
46836 var toVersion = toLatest ? dep.latest : dep.range;
46837 var rangeOperator = '';
46838
46839 if (toLatest) {
46840 if (flags.caret) {
46841 rangeOperator = '^';
46842 } else if (flags.tilde) {
46843 rangeOperator = '~';
46844 } else if (flags.exact) {
46845 rangeOperator = '';
46846 } else {
46847 rangeOperator = getRangeOperator(dep.range);
46848 }
46849 }
46850
46851 return `${dep.name}@${rangeOperator}${toVersion}`;
46852}
46853
46854function scopeFilter(flags, dep) {
46855 if (validScopeRegex.test(flags.scope)) {
46856 return dep.name.startsWith(flags.scope);
46857 }
46858 return true;
46859}
46860
46861// Remove deps being upgraded from the lockfile, or else Add will use the already-installed version
46862// instead of the latest for the range.
46863// We do this recursively so that when Yarn installs the potentially updated transitive deps,
46864// it may upgrade them too instead of just using the "locked" version from the lockfile.
46865// Transitive dependencies that are also a direct dependency are skipped.
46866function cleanLockfile(lockfile, deps, packagePatterns, reporter) {
46867 function cleanDepFromLockfile(pattern, depth) {
46868 var lockManifest = lockfile.getLocked(pattern);
46869 if (!lockManifest || depth > 1 && packagePatterns.some(function (packagePattern) {
46870 return packagePattern.pattern === pattern;
46871 })) {
46872 reporter.verbose(reporter.lang('verboseUpgradeNotUnlocking', pattern));
46873 return;
46874 }
46875
46876 var dependencies = (0, (_assign || _load_assign()).default)({}, lockManifest.dependencies || {}, lockManifest.optionalDependencies || {});
46877 var depPatterns = (0, (_keys || _load_keys()).default)(dependencies).map(function (key) {
46878 return `${key}@${dependencies[key]}`;
46879 });
46880 reporter.verbose(reporter.lang('verboseUpgradeUnlocking', pattern));
46881 lockfile.removePattern(pattern);
46882 depPatterns.forEach(function (pattern) {
46883 return cleanDepFromLockfile(pattern, depth + 1);
46884 });
46885 }
46886
46887 var patterns = deps.map(function (dep) {
46888 return dep.upgradeTo;
46889 });
46890 patterns.forEach(function (pattern) {
46891 return cleanDepFromLockfile(pattern, 1);
46892 });
46893}
46894
46895function setFlags(commander) {
46896 commander.description('Upgrades packages to their latest version based on the specified range.');
46897 commander.usage('upgrade [flags]');
46898 commander.option('-S, --scope <scope>', 'upgrade packages under the specified scope');
46899 commander.option('-L, --latest', 'list the latest version of packages, ignoring version ranges in package.json');
46900 commander.option('-E, --exact', 'install exact version. Only used when --latest is specified.');
46901 commander.option('-P, --pattern [pattern]', 'upgrade packages that match pattern');
46902 commander.option('-T, --tilde', 'install most recent release with the same minor version. Only used when --latest is specified.');
46903 commander.option('-C, --caret', 'install most recent release with the same major version. Only used when --latest is specified.');
46904 commander.option('-A, --audit', 'Run vulnerability audit on installed packages');
46905}
46906
46907function hasWrapper(commander, args) {
46908 return true;
46909}
46910
46911var requireLockfile = exports.requireLockfile = true;
46912
46913/***/ }),
46914/* 195 */
46915/***/ (function(module, exports, __webpack_require__) {
46916
46917"use strict";
46918
46919
46920Object.defineProperty(exports, "__esModule", {
46921 value: true
46922});
46923exports.integrityErrors = undefined;
46924
46925var _stringify;
46926
46927function _load_stringify() {
46928 return _stringify = _interopRequireDefault(__webpack_require__(36));
46929}
46930
46931var _extends2;
46932
46933function _load_extends() {
46934 return _extends2 = _interopRequireDefault(__webpack_require__(24));
46935}
46936
46937var _getIterator2;
46938
46939function _load_getIterator() {
46940 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
46941}
46942
46943var _keys;
46944
46945function _load_keys() {
46946 return _keys = _interopRequireDefault(__webpack_require__(14));
46947}
46948
46949var _asyncToGenerator2;
46950
46951function _load_asyncToGenerator() {
46952 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
46953}
46954
46955var _classCallCheck2;
46956
46957function _load_classCallCheck() {
46958 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
46959}
46960
46961var _constants;
46962
46963function _load_constants() {
46964 return _constants = _interopRequireWildcard(__webpack_require__(13));
46965}
46966
46967var _fs;
46968
46969function _load_fs() {
46970 return _fs = _interopRequireWildcard(__webpack_require__(8));
46971}
46972
46973var _misc;
46974
46975function _load_misc() {
46976 return _misc = __webpack_require__(28);
46977}
46978
46979var _packageNameUtils;
46980
46981function _load_packageNameUtils() {
46982 return _packageNameUtils = __webpack_require__(208);
46983}
46984
46985var _workspaceLayout;
46986
46987function _load_workspaceLayout() {
46988 return _workspaceLayout = _interopRequireDefault(__webpack_require__(87));
46989}
46990
46991function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
46992
46993function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
46994
46995var invariant = __webpack_require__(15);
46996
46997var path = __webpack_require__(1);
46998
46999var integrityErrors = exports.integrityErrors = {
47000 EXPECTED_IS_NOT_A_JSON: 'integrityFailedExpectedIsNotAJSON',
47001 FILES_MISSING: 'integrityFailedFilesMissing',
47002 LOCKFILE_DONT_MATCH: 'integrityLockfilesDontMatch',
47003 FLAGS_DONT_MATCH: 'integrityFlagsDontMatch',
47004 LINKED_MODULES_DONT_MATCH: 'integrityCheckLinkedModulesDontMatch',
47005 PATTERNS_DONT_MATCH: 'integrityPatternsDontMatch',
47006 MODULES_FOLDERS_MISSING: 'integrityModulesFoldersMissing',
47007 SYSTEM_PARAMS_DONT_MATCH: 'integritySystemParamsDontMatch'
47008};
47009
47010var INTEGRITY_FILE_DEFAULTS = function INTEGRITY_FILE_DEFAULTS() {
47011 return {
47012 systemParams: (0, (_packageNameUtils || _load_packageNameUtils()).getSystemParams)(),
47013 modulesFolders: [],
47014 flags: [],
47015 linkedModules: [],
47016 topLevelPatterns: [],
47017 lockfileEntries: {},
47018 files: []
47019 };
47020};
47021
47022/**
47023 *
47024 */
47025
47026var InstallationIntegrityChecker = function () {
47027 function InstallationIntegrityChecker(config) {
47028 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, InstallationIntegrityChecker);
47029
47030 this.config = config;
47031 }
47032
47033 /**
47034 * Get the common ancestor of every node_modules - it may be a node_modules directory itself, but isn't required to.
47035 */
47036
47037 InstallationIntegrityChecker.prototype._getModulesRootFolder = function _getModulesRootFolder() {
47038 if (this.config.modulesFolder) {
47039 return this.config.modulesFolder;
47040 } else if (this.config.workspaceRootFolder) {
47041 return this.config.workspaceRootFolder;
47042 } else {
47043 return path.join(this.config.lockfileFolder, (_constants || _load_constants()).NODE_MODULES_FOLDER);
47044 }
47045 };
47046
47047 /**
47048 * Get the directory in which the yarn-integrity file should be written.
47049 */
47050
47051 InstallationIntegrityChecker.prototype._getIntegrityFileFolder = function _getIntegrityFileFolder() {
47052 if (this.config.modulesFolder) {
47053 return this.config.modulesFolder;
47054 } else if (this.config.enableMetaFolder) {
47055 return path.join(this.config.lockfileFolder, (_constants || _load_constants()).META_FOLDER);
47056 } else {
47057 return path.join(this.config.lockfileFolder, (_constants || _load_constants()).NODE_MODULES_FOLDER);
47058 }
47059 };
47060
47061 /**
47062 * Get the full path of the yarn-integrity file.
47063 */
47064
47065 InstallationIntegrityChecker.prototype._getIntegrityFileLocation = function () {
47066 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
47067 var locationFolder = this._getIntegrityFileFolder();
47068 var locationPath = path.join(locationFolder, (_constants || _load_constants()).INTEGRITY_FILENAME);
47069
47070 var exists = yield (_fs || _load_fs()).exists(locationPath);
47071
47072 return {
47073 locationFolder,
47074 locationPath,
47075 exists
47076 };
47077 });
47078
47079 function _getIntegrityFileLocation() {
47080 return _ref.apply(this, arguments);
47081 }
47082
47083 return _getIntegrityFileLocation;
47084 }();
47085
47086 /**
47087 * Get the list of the directories that contain our modules (there might be multiple such folders b/c of workspaces).
47088 */
47089
47090 InstallationIntegrityChecker.prototype._getModulesFolders = function _getModulesFolders() {
47091 var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
47092 workspaceLayout = _ref2.workspaceLayout;
47093
47094 var locations = [];
47095
47096 if (this.config.modulesFolder) {
47097 locations.push(this.config.modulesFolder);
47098 } else {
47099 locations.push(path.join(this.config.lockfileFolder, (_constants || _load_constants()).NODE_MODULES_FOLDER));
47100 }
47101
47102 if (workspaceLayout) {
47103 for (var _iterator = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
47104 var _ref3;
47105
47106 if (_isArray) {
47107 if (_i >= _iterator.length) break;
47108 _ref3 = _iterator[_i++];
47109 } else {
47110 _i = _iterator.next();
47111 if (_i.done) break;
47112 _ref3 = _i.value;
47113 }
47114
47115 var workspaceName = _ref3;
47116
47117 var loc = workspaceLayout.workspaces[workspaceName].loc;
47118
47119 if (loc) {
47120 locations.push(path.join(loc, (_constants || _load_constants()).NODE_MODULES_FOLDER));
47121 }
47122 }
47123 }
47124
47125 return locations.sort((_misc || _load_misc()).sortAlpha);
47126 };
47127
47128 /**
47129 * Get a list of the files that are located inside our module folders.
47130 */
47131
47132
47133 InstallationIntegrityChecker.prototype._getIntegrityListing = function () {
47134 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
47135 var _ref5 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
47136 workspaceLayout = _ref5.workspaceLayout;
47137
47138 var files = [];
47139
47140 var recurse = function () {
47141 var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) {
47142 for (var _iterator2 = yield (_fs || _load_fs()).readdir(dir), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
47143 var _ref7;
47144
47145 if (_isArray2) {
47146 if (_i2 >= _iterator2.length) break;
47147 _ref7 = _iterator2[_i2++];
47148 } else {
47149 _i2 = _iterator2.next();
47150 if (_i2.done) break;
47151 _ref7 = _i2.value;
47152 }
47153
47154 var file = _ref7;
47155
47156 var entry = path.join(dir, file);
47157 var stat = yield (_fs || _load_fs()).lstat(entry);
47158
47159 if (stat.isDirectory()) {
47160 yield recurse(entry);
47161 } else {
47162 files.push(entry);
47163 }
47164 }
47165 });
47166
47167 return function recurse(_x3) {
47168 return _ref6.apply(this, arguments);
47169 };
47170 }();
47171
47172 for (var _iterator3 = this._getModulesFolders({ workspaceLayout }), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
47173 var _ref8;
47174
47175 if (_isArray3) {
47176 if (_i3 >= _iterator3.length) break;
47177 _ref8 = _iterator3[_i3++];
47178 } else {
47179 _i3 = _iterator3.next();
47180 if (_i3.done) break;
47181 _ref8 = _i3.value;
47182 }
47183
47184 var modulesFolder = _ref8;
47185
47186 if (yield (_fs || _load_fs()).exists(modulesFolder)) {
47187 yield recurse(modulesFolder);
47188 }
47189 }
47190
47191 return files;
47192 });
47193
47194 function _getIntegrityListing() {
47195 return _ref4.apply(this, arguments);
47196 }
47197
47198 return _getIntegrityListing;
47199 }();
47200
47201 /**
47202 * Generate integrity hash of input lockfile.
47203 */
47204
47205 InstallationIntegrityChecker.prototype._generateIntegrityFile = function () {
47206 var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (lockfile, patterns, flags, workspaceLayout, artifacts) {
47207 var result = (0, (_extends2 || _load_extends()).default)({}, INTEGRITY_FILE_DEFAULTS(), {
47208 artifacts
47209 });
47210
47211 result.topLevelPatterns = patterns;
47212
47213 // If using workspaces, we also need to add the workspaces patterns to the top-level, so that we'll know if a
47214 // dependency is added or removed into one of them. We must take care not to read the aggregator (if !loc).
47215 //
47216 // Also note that we can't use of workspaceLayout.workspaces[].manifest._reference.patterns, because when
47217 // doing a "yarn check", the _reference property hasn't yet been properly initialized.
47218
47219 if (workspaceLayout) {
47220 result.topLevelPatterns = result.topLevelPatterns.filter(function (p) {
47221 // $FlowFixMe
47222 return !workspaceLayout.getManifestByPattern(p);
47223 });
47224
47225 for (var _iterator4 = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
47226 var _ref10;
47227
47228 if (_isArray4) {
47229 if (_i4 >= _iterator4.length) break;
47230 _ref10 = _iterator4[_i4++];
47231 } else {
47232 _i4 = _iterator4.next();
47233 if (_i4.done) break;
47234 _ref10 = _i4.value;
47235 }
47236
47237 var name = _ref10;
47238
47239 if (!workspaceLayout.workspaces[name].loc) {
47240 continue;
47241 }
47242
47243 var manifest = workspaceLayout.workspaces[name].manifest;
47244
47245 if (manifest) {
47246 for (var _iterator5 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
47247 var _ref11;
47248
47249 if (_isArray5) {
47250 if (_i5 >= _iterator5.length) break;
47251 _ref11 = _iterator5[_i5++];
47252 } else {
47253 _i5 = _iterator5.next();
47254 if (_i5.done) break;
47255 _ref11 = _i5.value;
47256 }
47257
47258 var dependencyType = _ref11;
47259
47260 var dependencies = manifest[dependencyType];
47261
47262 if (!dependencies) {
47263 continue;
47264 }
47265
47266 for (var _iterator6 = (0, (_keys || _load_keys()).default)(dependencies), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
47267 var _ref12;
47268
47269 if (_isArray6) {
47270 if (_i6 >= _iterator6.length) break;
47271 _ref12 = _iterator6[_i6++];
47272 } else {
47273 _i6 = _iterator6.next();
47274 if (_i6.done) break;
47275 _ref12 = _i6.value;
47276 }
47277
47278 var dep = _ref12;
47279
47280 result.topLevelPatterns.push(`${dep}@${dependencies[dep]}`);
47281 }
47282 }
47283 }
47284 }
47285 }
47286
47287 result.topLevelPatterns.sort((_misc || _load_misc()).sortAlpha);
47288
47289 if (flags.checkFiles) {
47290 result.flags.push('checkFiles');
47291 }
47292
47293 if (flags.flat) {
47294 result.flags.push('flat');
47295 }
47296
47297 if (this.config.ignoreScripts) {
47298 result.flags.push('ignoreScripts');
47299 }
47300 if (this.config.focus) {
47301 result.flags.push('focus: ' + this.config.focusedWorkspaceName);
47302 }
47303
47304 if (this.config.production) {
47305 result.flags.push('production');
47306 }
47307
47308 if (this.config.plugnplayEnabled) {
47309 result.flags.push('plugnplay');
47310 }
47311
47312 var linkedModules = this.config.linkedModules;
47313
47314 if (linkedModules.length) {
47315 result.linkedModules = linkedModules.sort((_misc || _load_misc()).sortAlpha);
47316 }
47317
47318 for (var _iterator7 = (0, (_keys || _load_keys()).default)(lockfile), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
47319 var _ref13;
47320
47321 if (_isArray7) {
47322 if (_i7 >= _iterator7.length) break;
47323 _ref13 = _iterator7[_i7++];
47324 } else {
47325 _i7 = _iterator7.next();
47326 if (_i7.done) break;
47327 _ref13 = _i7.value;
47328 }
47329
47330 var _key = _ref13;
47331
47332 result.lockfileEntries[_key] = lockfile[_key].resolved || '';
47333 }
47334
47335 for (var _iterator8 = this._getModulesFolders({ workspaceLayout }), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
47336 var _ref14;
47337
47338 if (_isArray8) {
47339 if (_i8 >= _iterator8.length) break;
47340 _ref14 = _iterator8[_i8++];
47341 } else {
47342 _i8 = _iterator8.next();
47343 if (_i8.done) break;
47344 _ref14 = _i8.value;
47345 }
47346
47347 var modulesFolder = _ref14;
47348
47349 if (yield (_fs || _load_fs()).exists(modulesFolder)) {
47350 result.modulesFolders.push(path.relative(this.config.lockfileFolder, modulesFolder));
47351 }
47352 }
47353
47354 if (flags.checkFiles) {
47355 var modulesRoot = this._getModulesRootFolder();
47356
47357 result.files = (yield this._getIntegrityListing({ workspaceLayout })).map(function (entry) {
47358 return path.relative(modulesRoot, entry);
47359 }).sort((_misc || _load_misc()).sortAlpha);
47360 }
47361
47362 return result;
47363 });
47364
47365 function _generateIntegrityFile(_x4, _x5, _x6, _x7, _x8) {
47366 return _ref9.apply(this, arguments);
47367 }
47368
47369 return _generateIntegrityFile;
47370 }();
47371
47372 InstallationIntegrityChecker.prototype._getIntegrityFile = function () {
47373 var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (locationPath) {
47374 var expectedRaw = yield (_fs || _load_fs()).readFile(locationPath);
47375 try {
47376 return (0, (_extends2 || _load_extends()).default)({}, INTEGRITY_FILE_DEFAULTS(), JSON.parse(expectedRaw));
47377 } catch (e) {
47378 // ignore JSON parsing for legacy text integrity files compatibility
47379 }
47380 return null;
47381 });
47382
47383 function _getIntegrityFile(_x9) {
47384 return _ref15.apply(this, arguments);
47385 }
47386
47387 return _getIntegrityFile;
47388 }();
47389
47390 InstallationIntegrityChecker.prototype._compareIntegrityFiles = function _compareIntegrityFiles(actual, expected, checkFiles, workspaceLayout) {
47391 if (!expected) {
47392 return 'EXPECTED_IS_NOT_A_JSON';
47393 }
47394
47395 if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.linkedModules, expected.linkedModules)) {
47396 return 'LINKED_MODULES_DONT_MATCH';
47397 }
47398
47399 if (actual.systemParams !== expected.systemParams) {
47400 return 'SYSTEM_PARAMS_DONT_MATCH';
47401 }
47402
47403 var relevantExpectedFlags = expected.flags.slice();
47404
47405 // If we run "yarn" after "yarn --check-files", we shouldn't fail the less strict validation
47406 if (actual.flags.indexOf('checkFiles') === -1) {
47407 relevantExpectedFlags = relevantExpectedFlags.filter(function (flag) {
47408 return flag !== 'checkFiles';
47409 });
47410 }
47411
47412 if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.flags, relevantExpectedFlags)) {
47413 return 'FLAGS_DONT_MATCH';
47414 }
47415
47416 if (!(0, (_misc || _load_misc()).compareSortedArrays)(actual.topLevelPatterns, expected.topLevelPatterns || [])) {
47417 return 'PATTERNS_DONT_MATCH';
47418 }
47419
47420 for (var _iterator9 = (0, (_keys || _load_keys()).default)(actual.lockfileEntries), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
47421 var _ref16;
47422
47423 if (_isArray9) {
47424 if (_i9 >= _iterator9.length) break;
47425 _ref16 = _iterator9[_i9++];
47426 } else {
47427 _i9 = _iterator9.next();
47428 if (_i9.done) break;
47429 _ref16 = _i9.value;
47430 }
47431
47432 var _key2 = _ref16;
47433
47434 if (actual.lockfileEntries[_key2] !== expected.lockfileEntries[_key2]) {
47435 return 'LOCKFILE_DONT_MATCH';
47436 }
47437 }
47438
47439 for (var _iterator10 = (0, (_keys || _load_keys()).default)(expected.lockfileEntries), _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
47440 var _ref17;
47441
47442 if (_isArray10) {
47443 if (_i10 >= _iterator10.length) break;
47444 _ref17 = _iterator10[_i10++];
47445 } else {
47446 _i10 = _iterator10.next();
47447 if (_i10.done) break;
47448 _ref17 = _i10.value;
47449 }
47450
47451 var _key3 = _ref17;
47452
47453 if (actual.lockfileEntries[_key3] !== expected.lockfileEntries[_key3]) {
47454 return 'LOCKFILE_DONT_MATCH';
47455 }
47456 }
47457
47458 if (checkFiles) {
47459 // Early bailout if we expect more files than what we have
47460 if (expected.files.length > actual.files.length) {
47461 return 'FILES_MISSING';
47462 }
47463
47464 // Since we know the "files" array is sorted (alphabetically), we can optimize the thing
47465 // Instead of storing the files in a Set, we can just iterate both arrays at once. O(n)!
47466 for (var u = 0, v = 0; u < expected.files.length; ++u) {
47467 // Index that, if reached, means that we won't have enough food to match the remaining expected entries anyway
47468 var max = v + (actual.files.length - v) - (expected.files.length - u) + 1;
47469
47470 // Skip over files that have been added (ie not present in 'expected')
47471 while (v < max && actual.files[v] !== expected.files[u]) {
47472 v += 1;
47473 }
47474
47475 // If we've reached the index defined above, the file is either missing or we can early exit
47476 if (v === max) {
47477 return 'FILES_MISSING';
47478 }
47479 }
47480 }
47481 return 'OK';
47482 };
47483
47484 InstallationIntegrityChecker.prototype.check = function () {
47485 var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, lockfile, flags, workspaceLayout) {
47486 // check if patterns exist in lockfile
47487 var missingPatterns = patterns.filter(function (p) {
47488 return !lockfile[p] && (!workspaceLayout || !workspaceLayout.getManifestByPattern(p));
47489 });
47490
47491 var loc = yield this._getIntegrityFileLocation();
47492 if (missingPatterns.length || !loc.exists) {
47493 return {
47494 integrityFileMissing: !loc.exists,
47495 missingPatterns
47496 };
47497 }
47498
47499 var actual = yield this._generateIntegrityFile(lockfile, patterns, flags, workspaceLayout);
47500
47501 var expected = yield this._getIntegrityFile(loc.locationPath);
47502 var integrityMatches = this._compareIntegrityFiles(actual, expected, flags.checkFiles, workspaceLayout);
47503
47504 if (integrityMatches === 'OK') {
47505 invariant(expected, "The integrity shouldn't pass without integrity file");
47506 for (var _iterator11 = expected.modulesFolders, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
47507 var _ref19;
47508
47509 if (_isArray11) {
47510 if (_i11 >= _iterator11.length) break;
47511 _ref19 = _iterator11[_i11++];
47512 } else {
47513 _i11 = _iterator11.next();
47514 if (_i11.done) break;
47515 _ref19 = _i11.value;
47516 }
47517
47518 var modulesFolder = _ref19;
47519
47520 if (!(yield (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, modulesFolder)))) {
47521 integrityMatches = 'MODULES_FOLDERS_MISSING';
47522 }
47523 }
47524 }
47525
47526 return {
47527 integrityFileMissing: false,
47528 integrityMatches: integrityMatches === 'OK',
47529 integrityError: integrityMatches === 'OK' ? undefined : integrityMatches,
47530 missingPatterns,
47531 hardRefreshRequired: integrityMatches === 'SYSTEM_PARAMS_DONT_MATCH'
47532 };
47533 });
47534
47535 function check(_x10, _x11, _x12, _x13) {
47536 return _ref18.apply(this, arguments);
47537 }
47538
47539 return check;
47540 }();
47541
47542 /**
47543 * Get artifacts from integrity file if it exists.
47544 */
47545
47546
47547 InstallationIntegrityChecker.prototype.getArtifacts = function () {
47548 var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
47549 var loc = yield this._getIntegrityFileLocation();
47550 if (!loc.exists) {
47551 return null;
47552 }
47553
47554 var expectedRaw = yield (_fs || _load_fs()).readFile(loc.locationPath);
47555 var expected = void 0;
47556 try {
47557 expected = JSON.parse(expectedRaw);
47558 } catch (e) {
47559 // ignore JSON parsing for legacy text integrity files compatibility
47560 }
47561
47562 return expected ? expected.artifacts : null;
47563 });
47564
47565 function getArtifacts() {
47566 return _ref20.apply(this, arguments);
47567 }
47568
47569 return getArtifacts;
47570 }();
47571
47572 /**
47573 * Write the integrity hash of the current install to disk.
47574 */
47575
47576
47577 InstallationIntegrityChecker.prototype.save = function () {
47578 var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, lockfile, flags, workspaceLayout, artifacts) {
47579 var integrityFile = yield this._generateIntegrityFile(lockfile, patterns, flags, workspaceLayout, artifacts);
47580
47581 var loc = yield this._getIntegrityFileLocation();
47582 invariant(loc.locationPath, 'expected integrity hash location');
47583
47584 yield (_fs || _load_fs()).mkdirp(path.dirname(loc.locationPath));
47585 yield (_fs || _load_fs()).writeFile(loc.locationPath, (0, (_stringify || _load_stringify()).default)(integrityFile, null, 2));
47586 });
47587
47588 function save(_x14, _x15, _x16, _x17, _x18) {
47589 return _ref21.apply(this, arguments);
47590 }
47591
47592 return save;
47593 }();
47594
47595 InstallationIntegrityChecker.prototype.removeIntegrityFile = function () {
47596 var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
47597 var loc = yield this._getIntegrityFileLocation();
47598 if (loc.exists) {
47599 yield (_fs || _load_fs()).unlink(loc.locationPath);
47600 }
47601 });
47602
47603 function removeIntegrityFile() {
47604 return _ref22.apply(this, arguments);
47605 }
47606
47607 return removeIntegrityFile;
47608 }();
47609
47610 return InstallationIntegrityChecker;
47611}();
47612
47613exports.default = InstallationIntegrityChecker;
47614
47615/***/ }),
47616/* 196 */
47617/***/ (function(module, exports, __webpack_require__) {
47618
47619"use strict";
47620
47621
47622Object.defineProperty(exports, "__esModule", {
47623 value: true
47624});
47625
47626var _getIterator2;
47627
47628function _load_getIterator() {
47629 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
47630}
47631
47632var _assign;
47633
47634function _load_assign() {
47635 return _assign = _interopRequireDefault(__webpack_require__(23));
47636}
47637
47638exports.testEngine = testEngine;
47639exports.checkOne = checkOne;
47640exports.check = check;
47641exports.shouldCheck = shouldCheck;
47642
47643var _errors;
47644
47645function _load_errors() {
47646 return _errors = __webpack_require__(6);
47647}
47648
47649var _map;
47650
47651function _load_map() {
47652 return _map = _interopRequireDefault(__webpack_require__(51));
47653}
47654
47655var _misc;
47656
47657function _load_misc() {
47658 return _misc = __webpack_require__(28);
47659}
47660
47661var _yarnVersion;
47662
47663function _load_yarnVersion() {
47664 return _yarnVersion = __webpack_require__(96);
47665}
47666
47667var _semver;
47668
47669function _load_semver() {
47670 return _semver = __webpack_require__(160);
47671}
47672
47673function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
47674
47675var semver = __webpack_require__(27);
47676
47677var VERSIONS = (0, (_assign || _load_assign()).default)({}, process.versions, {
47678 yarn: (_yarnVersion || _load_yarnVersion()).version
47679});
47680
47681function isValid(items, actual) {
47682 var isNotWhitelist = true;
47683 var isBlacklist = false;
47684
47685 for (var _iterator = items, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
47686 var _ref;
47687
47688 if (_isArray) {
47689 if (_i >= _iterator.length) break;
47690 _ref = _iterator[_i++];
47691 } else {
47692 _i = _iterator.next();
47693 if (_i.done) break;
47694 _ref = _i.value;
47695 }
47696
47697 var item = _ref;
47698
47699 // blacklist
47700 if (item[0] === '!') {
47701 isBlacklist = true;
47702
47703 if (actual === item.slice(1)) {
47704 return false;
47705 }
47706 // whitelist
47707 } else {
47708 isNotWhitelist = false;
47709
47710 if (item === actual) {
47711 return true;
47712 }
47713 }
47714 }
47715
47716 // npm allows blacklists and whitelists to be mixed. Blacklists with
47717 // whitelisted items should be treated as whitelists.
47718 return isBlacklist && isNotWhitelist;
47719}
47720
47721var aliases = (0, (_map || _load_map()).default)({
47722 iojs: 'node' // we should probably prompt these libraries to fix this
47723});
47724
47725var ignore = ['npm', // we'll never satisfy this for obvious reasons
47726'teleport', // a module bundler used by some modules
47727'rhino', // once a target for older modules
47728'cordovaDependencies', // http://bit.ly/2tkUePg
47729'parcel'];
47730
47731function testEngine(name, range, versions, looseSemver) {
47732 var actual = versions[name];
47733 if (!actual) {
47734 return false;
47735 }
47736
47737 if (!semver.valid(actual, looseSemver)) {
47738 return false;
47739 }
47740
47741 if (semver.satisfies(actual, range, looseSemver)) {
47742 return true;
47743 }
47744
47745 if (name === 'yarn' && (0, (_semver || _load_semver()).satisfiesWithPrereleases)(actual, range, looseSemver)) {
47746 return true;
47747 }
47748
47749 if (name === 'node' && semver.gt(actual, '1.0.0', looseSemver)) {
47750 // WARNING: this is a massive hack and is super gross but necessary for compatibility
47751 // some modules have the `engines.node` field set to a caret version below semver major v1
47752 // eg. ^0.12.0. this is problematic as we enforce engines checks and node is now on version >=1
47753 // to allow this pattern we transform the node version to fake ones in the minor range 10-13
47754 var major = semver.major(actual, looseSemver);
47755 var fakes = [`0.10.${major}`, `0.11.${major}`, `0.12.${major}`, `0.13.${major}`];
47756 for (var _iterator2 = fakes, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
47757 var _ref2;
47758
47759 if (_isArray2) {
47760 if (_i2 >= _iterator2.length) break;
47761 _ref2 = _iterator2[_i2++];
47762 } else {
47763 _i2 = _iterator2.next();
47764 if (_i2.done) break;
47765 _ref2 = _i2.value;
47766 }
47767
47768 var actualFake = _ref2;
47769
47770 if (semver.satisfies(actualFake, range, looseSemver)) {
47771 return true;
47772 }
47773 }
47774 }
47775
47776 // incompatible version
47777 return false;
47778}
47779
47780function isValidArch(archs) {
47781 return isValid(archs, process.arch);
47782}
47783
47784function isValidPlatform(platforms) {
47785 return isValid(platforms, process.platform);
47786}
47787
47788function checkOne(info, config, ignoreEngines) {
47789 var didIgnore = false;
47790 var didError = false;
47791 var reporter = config.reporter;
47792 var human = `${info.name}@${info.version}`;
47793
47794 var pushError = function pushError(msg) {
47795 var ref = info._reference;
47796
47797 if (ref && ref.optional) {
47798 ref.ignore = true;
47799 ref.incompatible = true;
47800
47801 reporter.info(`${human}: ${msg}`);
47802 if (!didIgnore) {
47803 reporter.info(reporter.lang('optionalCompatibilityExcluded', human));
47804 didIgnore = true;
47805 }
47806 } else {
47807 reporter.error(`${human}: ${msg}`);
47808 didError = true;
47809 }
47810 };
47811
47812 var os = info.os,
47813 cpu = info.cpu,
47814 engines = info.engines;
47815
47816
47817 if (shouldCheckPlatform(os, config.ignorePlatform) && !isValidPlatform(os)) {
47818 pushError(reporter.lang('incompatibleOS', process.platform));
47819 }
47820
47821 if (shouldCheckCpu(cpu, config.ignorePlatform) && !isValidArch(cpu)) {
47822 pushError(reporter.lang('incompatibleCPU', process.arch));
47823 }
47824
47825 if (shouldCheckEngines(engines, ignoreEngines)) {
47826 for (var _iterator3 = (0, (_misc || _load_misc()).entries)(info.engines), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
47827 var _ref3;
47828
47829 if (_isArray3) {
47830 if (_i3 >= _iterator3.length) break;
47831 _ref3 = _iterator3[_i3++];
47832 } else {
47833 _i3 = _iterator3.next();
47834 if (_i3.done) break;
47835 _ref3 = _i3.value;
47836 }
47837
47838 var entry = _ref3;
47839
47840 var name = entry[0];
47841 var range = entry[1];
47842
47843 if (aliases[name]) {
47844 name = aliases[name];
47845 }
47846
47847 if (VERSIONS[name]) {
47848 if (!testEngine(name, range, VERSIONS, config.looseSemver)) {
47849 pushError(reporter.lang('incompatibleEngine', name, range, VERSIONS[name]));
47850 }
47851 } else if (ignore.indexOf(name) < 0) {
47852 reporter.warn(`${human}: ${reporter.lang('invalidEngine', name)}`);
47853 }
47854 }
47855 }
47856
47857 if (didError) {
47858 throw new (_errors || _load_errors()).MessageError(reporter.lang('foundIncompatible'));
47859 }
47860}
47861
47862function check(infos, config, ignoreEngines) {
47863 for (var _iterator4 = infos, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
47864 var _ref4;
47865
47866 if (_isArray4) {
47867 if (_i4 >= _iterator4.length) break;
47868 _ref4 = _iterator4[_i4++];
47869 } else {
47870 _i4 = _iterator4.next();
47871 if (_i4.done) break;
47872 _ref4 = _i4.value;
47873 }
47874
47875 var info = _ref4;
47876
47877 checkOne(info, config, ignoreEngines);
47878 }
47879}
47880
47881function shouldCheckCpu(cpu, ignorePlatform) {
47882 return !ignorePlatform && Array.isArray(cpu) && cpu.length > 0;
47883}
47884
47885function shouldCheckPlatform(os, ignorePlatform) {
47886 return !ignorePlatform && Array.isArray(os) && os.length > 0;
47887}
47888
47889function shouldCheckEngines(engines, ignoreEngines) {
47890 return !ignoreEngines && typeof engines === 'object';
47891}
47892
47893function shouldCheck(manifest, options) {
47894 return shouldCheckCpu(manifest.cpu, options.ignorePlatform) || shouldCheckPlatform(manifest.os, options.ignorePlatform) || shouldCheckEngines(manifest.engines, options.ignoreEngines);
47895}
47896
47897/***/ }),
47898/* 197 */
47899/***/ (function(module, exports, __webpack_require__) {
47900
47901"use strict";
47902
47903
47904Object.defineProperty(exports, "__esModule", {
47905 value: true
47906});
47907exports.fetchOneRemote = undefined;
47908
47909var _keys;
47910
47911function _load_keys() {
47912 return _keys = _interopRequireDefault(__webpack_require__(14));
47913}
47914
47915var _map;
47916
47917function _load_map() {
47918 return _map = _interopRequireDefault(__webpack_require__(42));
47919}
47920
47921var _promise;
47922
47923function _load_promise() {
47924 return _promise = _interopRequireDefault(__webpack_require__(7));
47925}
47926
47927var _asyncToGenerator2;
47928
47929function _load_asyncToGenerator() {
47930 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
47931}
47932
47933var fetchCache = function () {
47934 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest, fetcher, config, remote) {
47935 // $FlowFixMe: This error doesn't make sense
47936 var _ref2 = yield config.readPackageMetadata(dest),
47937 hash = _ref2.hash,
47938 pkg = _ref2.package,
47939 cacheRemote = _ref2.remote;
47940
47941 var cacheIntegrity = cacheRemote.cacheIntegrity || cacheRemote.integrity;
47942 var cacheHash = cacheRemote.hash;
47943
47944 if (remote.integrity) {
47945 if (!cacheIntegrity || !ssri.parse(cacheIntegrity).match(remote.integrity)) {
47946 throw new (_errors || _load_errors()).SecurityError(config.reporter.lang('fetchBadIntegrityCache', pkg.name, cacheIntegrity, remote.integrity));
47947 }
47948 }
47949
47950 if (remote.hash) {
47951 if (!cacheHash || cacheHash !== remote.hash) {
47952 throw new (_errors || _load_errors()).SecurityError(config.reporter.lang('fetchBadHashCache', pkg.name, cacheHash, remote.hash));
47953 }
47954 }
47955
47956 yield fetcher.setupMirrorFromCache();
47957 return {
47958 package: pkg,
47959 hash,
47960 dest,
47961 cached: true
47962 };
47963 });
47964
47965 return function fetchCache(_x, _x2, _x3, _x4) {
47966 return _ref.apply(this, arguments);
47967 };
47968}();
47969
47970var fetchOneRemote = exports.fetchOneRemote = function () {
47971 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (remote, name, version, dest, config) {
47972 // Mock metadata for symlinked dependencies
47973 if (remote.type === 'link') {
47974 var mockPkg = { _uid: '', name: '', version: '0.0.0' };
47975 return (_promise || _load_promise()).default.resolve({ resolved: null, hash: '', dest, package: mockPkg, cached: false });
47976 }
47977
47978 var Fetcher = (_index || _load_index())[remote.type];
47979 if (!Fetcher) {
47980 throw new (_errors || _load_errors()).MessageError(config.reporter.lang('unknownFetcherFor', remote.type));
47981 }
47982
47983 var fetcher = new Fetcher(dest, remote, config);
47984 if (yield config.isValidModuleDest(dest)) {
47985 return fetchCache(dest, fetcher, config, remote);
47986 }
47987
47988 // remove as the module may be invalid
47989 yield (_fs || _load_fs()).unlink(dest);
47990
47991 try {
47992 return yield fetcher.fetch({
47993 name,
47994 version
47995 });
47996 } catch (err) {
47997 try {
47998 yield (_fs || _load_fs()).unlink(dest);
47999 } catch (err2) {
48000 // what do?
48001 }
48002 throw err;
48003 }
48004 });
48005
48006 return function fetchOneRemote(_x5, _x6, _x7, _x8, _x9) {
48007 return _ref3.apply(this, arguments);
48008 };
48009}();
48010
48011var maybeFetchOne = function () {
48012 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref, config) {
48013 try {
48014 return yield fetchOne(ref, config);
48015 } catch (err) {
48016 if (ref.optional) {
48017 config.reporter.error(err.message);
48018 return null;
48019 } else {
48020 throw err;
48021 }
48022 }
48023 });
48024
48025 return function maybeFetchOne(_x10, _x11) {
48026 return _ref4.apply(this, arguments);
48027 };
48028}();
48029
48030exports.fetch = fetch;
48031
48032var _errors;
48033
48034function _load_errors() {
48035 return _errors = __webpack_require__(6);
48036}
48037
48038var _index;
48039
48040function _load_index() {
48041 return _index = _interopRequireWildcard(__webpack_require__(507));
48042}
48043
48044var _fs;
48045
48046function _load_fs() {
48047 return _fs = _interopRequireWildcard(__webpack_require__(8));
48048}
48049
48050var _promise2;
48051
48052function _load_promise2() {
48053 return _promise2 = _interopRequireWildcard(__webpack_require__(86));
48054}
48055
48056function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
48057
48058function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
48059
48060var ssri = __webpack_require__(93);
48061
48062function fetchOne(ref, config) {
48063 var dest = config.generateModuleCachePath(ref);
48064
48065 return fetchOneRemote(ref.remote, ref.name, ref.version, dest, config);
48066}
48067
48068function fetch(pkgs, config) {
48069 var pkgsPerDest = new (_map || _load_map()).default();
48070 pkgs = pkgs.filter(function (pkg) {
48071 var ref = pkg._reference;
48072 if (!ref) {
48073 return false;
48074 }
48075 var dest = config.generateModuleCachePath(ref);
48076 var otherPkg = pkgsPerDest.get(dest);
48077 if (otherPkg) {
48078 config.reporter.warn(config.reporter.lang('multiplePackagesCantUnpackInSameDestination', ref.patterns, dest, otherPkg.patterns));
48079 return false;
48080 }
48081 pkgsPerDest.set(dest, ref);
48082 return true;
48083 });
48084 var tick = config.reporter.progress(pkgs.length);
48085
48086 return (_promise2 || _load_promise2()).queue(pkgs, function () {
48087 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg) {
48088 var ref = pkg._reference;
48089 if (!ref) {
48090 return pkg;
48091 }
48092
48093 var res = yield maybeFetchOne(ref, config);
48094 var newPkg = void 0;
48095
48096 if (res) {
48097 newPkg = res.package;
48098
48099 // update with new remote
48100 // but only if there was a hash previously as the tarball fetcher does not provide a hash.
48101 if (ref.remote.hash) {
48102 // if the checksum was updated, also update resolved and cache
48103 if (ref.remote.hash !== res.hash && config.updateChecksums) {
48104 var oldHash = ref.remote.hash;
48105 if (ref.remote.resolved) {
48106 ref.remote.resolved = ref.remote.resolved.replace(oldHash, res.hash);
48107 }
48108 ref.config.cache = (0, (_keys || _load_keys()).default)(ref.config.cache).reduce(function (cache, entry) {
48109 var entryWithNewHash = entry.replace(oldHash, res.hash);
48110 cache[entryWithNewHash] = ref.config.cache[entry];
48111 return cache;
48112 }, {});
48113 }
48114 ref.remote.hash = res.hash || ref.remote.hash;
48115 }
48116 }
48117
48118 if (tick) {
48119 tick();
48120 }
48121
48122 if (newPkg) {
48123 newPkg._reference = ref;
48124 newPkg._remote = ref.remote;
48125 newPkg.name = pkg.name;
48126 newPkg.fresh = pkg.fresh;
48127 return newPkg;
48128 }
48129
48130 return pkg;
48131 });
48132
48133 return function (_x12) {
48134 return _ref5.apply(this, arguments);
48135 };
48136 }(), config.networkConcurrency);
48137}
48138
48139/***/ }),
48140/* 198 */
48141/***/ (function(module, exports, __webpack_require__) {
48142
48143"use strict";
48144
48145
48146Object.defineProperty(exports, "__esModule", {
48147 value: true
48148});
48149exports.linkBin = undefined;
48150
48151var _from;
48152
48153function _load_from() {
48154 return _from = _interopRequireDefault(__webpack_require__(53));
48155}
48156
48157var _set;
48158
48159function _load_set() {
48160 return _set = _interopRequireDefault(__webpack_require__(16));
48161}
48162
48163var _map;
48164
48165function _load_map() {
48166 return _map = _interopRequireDefault(__webpack_require__(42));
48167}
48168
48169var _promise;
48170
48171function _load_promise() {
48172 return _promise = _interopRequireDefault(__webpack_require__(7));
48173}
48174
48175var _keys;
48176
48177function _load_keys() {
48178 return _keys = _interopRequireDefault(__webpack_require__(14));
48179}
48180
48181var _getIterator2;
48182
48183function _load_getIterator() {
48184 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
48185}
48186
48187var _classCallCheck2;
48188
48189function _load_classCallCheck() {
48190 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
48191}
48192
48193var _asyncToGenerator2;
48194
48195function _load_asyncToGenerator() {
48196 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
48197}
48198
48199var linkBin = exports.linkBin = function () {
48200 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) {
48201 if (process.platform === 'win32') {
48202 var unlockMutex = yield (0, (_mutex || _load_mutex()).default)(src);
48203 try {
48204 yield cmdShim(src, dest, { createPwshFile: false });
48205 } finally {
48206 unlockMutex();
48207 }
48208 } else {
48209 yield (_fs || _load_fs()).mkdirp(path.dirname(dest));
48210 yield (_fs || _load_fs()).symlink(src, dest);
48211 yield (_fs || _load_fs()).chmod(dest, '755');
48212 }
48213 });
48214
48215 return function linkBin(_x, _x2) {
48216 return _ref.apply(this, arguments);
48217 };
48218}();
48219
48220var _packageHoister;
48221
48222function _load_packageHoister() {
48223 return _packageHoister = _interopRequireDefault(__webpack_require__(512));
48224}
48225
48226var _constants;
48227
48228function _load_constants() {
48229 return _constants = _interopRequireWildcard(__webpack_require__(13));
48230}
48231
48232var _promise2;
48233
48234function _load_promise2() {
48235 return _promise2 = _interopRequireWildcard(__webpack_require__(86));
48236}
48237
48238var _normalizePattern2;
48239
48240function _load_normalizePattern() {
48241 return _normalizePattern2 = __webpack_require__(52);
48242}
48243
48244var _misc;
48245
48246function _load_misc() {
48247 return _misc = __webpack_require__(28);
48248}
48249
48250var _fs;
48251
48252function _load_fs() {
48253 return _fs = _interopRequireWildcard(__webpack_require__(8));
48254}
48255
48256var _mutex;
48257
48258function _load_mutex() {
48259 return _mutex = _interopRequireDefault(__webpack_require__(312));
48260}
48261
48262var _semver;
48263
48264function _load_semver() {
48265 return _semver = __webpack_require__(160);
48266}
48267
48268var _workspaceLayout;
48269
48270function _load_workspaceLayout() {
48271 return _workspaceLayout = _interopRequireDefault(__webpack_require__(87));
48272}
48273
48274function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
48275
48276function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
48277
48278var invariant = __webpack_require__(15);
48279
48280var cmdShim = __webpack_require__(190);
48281var path = __webpack_require__(1);
48282var semver = __webpack_require__(27);
48283// Concurrency for creating bin links disabled because of the issue #1961
48284var linkBinConcurrency = 1;
48285
48286var PackageLinker = function () {
48287 function PackageLinker(config, resolver) {
48288 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageLinker);
48289
48290 this.resolver = resolver;
48291 this.reporter = config.reporter;
48292 this.config = config;
48293 this.artifacts = {};
48294 this.topLevelBinLinking = true;
48295 this.unplugged = [];
48296 }
48297
48298 PackageLinker.prototype.setArtifacts = function setArtifacts(artifacts) {
48299 this.artifacts = artifacts;
48300 };
48301
48302 PackageLinker.prototype.setTopLevelBinLinking = function setTopLevelBinLinking(topLevelBinLinking) {
48303 this.topLevelBinLinking = topLevelBinLinking;
48304 };
48305
48306 PackageLinker.prototype.linkSelfDependencies = function () {
48307 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, pkgLoc, targetBinLoc) {
48308 var override = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
48309
48310 targetBinLoc = path.join(targetBinLoc, '.bin');
48311 yield (_fs || _load_fs()).mkdirp(targetBinLoc);
48312 targetBinLoc = yield (_fs || _load_fs()).realpath(targetBinLoc);
48313 pkgLoc = yield (_fs || _load_fs()).realpath(pkgLoc);
48314 for (var _iterator = (0, (_misc || _load_misc()).entries)(pkg.bin), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
48315 var _ref4;
48316
48317 if (_isArray) {
48318 if (_i >= _iterator.length) break;
48319 _ref4 = _iterator[_i++];
48320 } else {
48321 _i = _iterator.next();
48322 if (_i.done) break;
48323 _ref4 = _i.value;
48324 }
48325
48326 var _ref3 = _ref4;
48327 var scriptName = _ref3[0];
48328 var scriptCmd = _ref3[1];
48329
48330 var dest = path.join(targetBinLoc, scriptName);
48331 var src = path.join(pkgLoc, scriptCmd);
48332 if (!(yield (_fs || _load_fs()).exists(src))) {
48333 if (!override) {
48334 // TODO maybe throw an error
48335 continue;
48336 }
48337 }
48338 yield linkBin(src, dest);
48339 }
48340 });
48341
48342 function linkSelfDependencies(_x3, _x4, _x5) {
48343 return _ref2.apply(this, arguments);
48344 }
48345
48346 return linkSelfDependencies;
48347 }();
48348
48349 PackageLinker.prototype.linkBinDependencies = function () {
48350 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, dir) {
48351 var _this = this;
48352
48353 var deps = [];
48354
48355 var ref = pkg._reference;
48356 invariant(ref, 'Package reference is missing');
48357
48358 var remote = pkg._remote;
48359 invariant(remote, 'Package remote is missing');
48360
48361 // link up `bin scripts` in `dependencies`
48362 for (var _iterator2 = ref.dependencies, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
48363 var _ref6;
48364
48365 if (_isArray2) {
48366 if (_i2 >= _iterator2.length) break;
48367 _ref6 = _iterator2[_i2++];
48368 } else {
48369 _i2 = _iterator2.next();
48370 if (_i2.done) break;
48371 _ref6 = _i2.value;
48372 }
48373
48374 var pattern = _ref6;
48375
48376 var _dep = this.resolver.getStrictResolvedPattern(pattern);
48377 if (
48378 // Missing locations means not installed inside node_modules
48379 _dep._reference && _dep._reference.locations.length && _dep.bin && (0, (_keys || _load_keys()).default)(_dep.bin).length) {
48380 var _loc2 = yield this.findNearestInstalledVersionOfPackage(_dep, dir);
48381 deps.push({ dep: _dep, loc: _loc2 });
48382 }
48383 }
48384
48385 // link up the `bin` scripts in bundled dependencies
48386 if (pkg.bundleDependencies) {
48387 var _loop = function* _loop(depName) {
48388 var locs = ref.locations.map(function (loc) {
48389 return path.join(loc, _this.config.getFolder(pkg), depName);
48390 });
48391 try {
48392 var _dep2 = yield _this.config.readManifest(locs[0], remote.registry); //all of them should be the same
48393
48394 if (_dep2.bin && (0, (_keys || _load_keys()).default)(_dep2.bin).length) {
48395 deps.push.apply(deps, locs.map(function (loc) {
48396 return { dep: _dep2, loc };
48397 }));
48398 }
48399 } catch (ex) {
48400 if (ex.code !== 'ENOENT') {
48401 throw ex;
48402 }
48403 // intentionally ignoring ENOENT error.
48404 // bundledDependency either does not exist or does not contain a package.json
48405 }
48406 };
48407
48408 for (var _iterator3 = pkg.bundleDependencies, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
48409 var _ref7;
48410
48411 if (_isArray3) {
48412 if (_i3 >= _iterator3.length) break;
48413 _ref7 = _iterator3[_i3++];
48414 } else {
48415 _i3 = _iterator3.next();
48416 if (_i3.done) break;
48417 _ref7 = _i3.value;
48418 }
48419
48420 var depName = _ref7;
48421 yield* _loop(depName);
48422 }
48423 }
48424
48425 // no deps to link
48426 if (!deps.length) {
48427 return;
48428 }
48429
48430 // write the executables
48431 for (var _iterator4 = deps, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
48432 var _ref9;
48433
48434 if (_isArray4) {
48435 if (_i4 >= _iterator4.length) break;
48436 _ref9 = _iterator4[_i4++];
48437 } else {
48438 _i4 = _iterator4.next();
48439 if (_i4.done) break;
48440 _ref9 = _i4.value;
48441 }
48442
48443 var _ref8 = _ref9;
48444 var _dep3 = _ref8.dep,
48445 _loc = _ref8.loc;
48446
48447 if (_dep3._reference && _dep3._reference.locations.length) {
48448 invariant(!_dep3._reference.isPlugnplay, "Plug'n'play packages should not be referenced here");
48449 yield this.linkSelfDependencies(_dep3, _loc, dir);
48450 }
48451 }
48452 });
48453
48454 function linkBinDependencies(_x7, _x8) {
48455 return _ref5.apply(this, arguments);
48456 }
48457
48458 return linkBinDependencies;
48459 }();
48460
48461 //find the installation location of ref that would be used in binLoc based on node module resolution
48462
48463
48464 PackageLinker.prototype.findNearestInstalledVersionOfPackage = function () {
48465 var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, binLoc) {
48466 var ref = pkg._reference;
48467 invariant(ref, 'expected pkg reference for ' + pkg.name);
48468 var moduleFolder = this.config.getFolder(pkg);
48469 yield (_fs || _load_fs()).mkdirp(binLoc);
48470 var realBinLoc = yield (_fs || _load_fs()).realpath(binLoc);
48471
48472 var allLocations = [].concat(ref.locations);
48473 var realLocations = yield (_promise || _load_promise()).default.all(ref.locations.map(function (loc) {
48474 return (_fs || _load_fs()).realpath(loc);
48475 }));
48476 realLocations.forEach(function (loc) {
48477 return allLocations.indexOf(loc) !== -1 || allLocations.push(loc);
48478 });
48479
48480 var locationBinLocPairs = allLocations.map(function (loc) {
48481 return [loc, binLoc];
48482 });
48483 if (binLoc !== realBinLoc) {
48484 locationBinLocPairs.push.apply(locationBinLocPairs, allLocations.map(function (loc) {
48485 return [loc, realBinLoc];
48486 }));
48487 }
48488
48489 var distancePairs = locationBinLocPairs.map(function (_ref11) {
48490 var loc = _ref11[0],
48491 curBinLoc = _ref11[1];
48492
48493 var distance = 0;
48494 var curLoc = curBinLoc;
48495 var notFound = false;
48496
48497 while (path.join(curLoc, ref.name) !== loc && path.join(curLoc, moduleFolder, ref.name) !== loc) {
48498 var next = path.dirname(curLoc);
48499 if (curLoc === next) {
48500 notFound = true;
48501 break;
48502 }
48503
48504 distance++;
48505 curLoc = next;
48506 }
48507 return notFound ? null : [loc, distance];
48508 });
48509
48510 //remove items where path was not found
48511 var filteredDistancePairs = distancePairs.filter(function (d) {
48512 return d;
48513 });
48514 filteredDistancePairs;
48515
48516 invariant(filteredDistancePairs.length > 0, `could not find a copy of ${pkg.name} to link in ${binLoc}`);
48517
48518 //get smallest distance from package location
48519 var minItem = filteredDistancePairs.reduce(function (min, cur) {
48520 return cur[1] < min[1] ? cur : min;
48521 });
48522
48523 invariant(minItem[1] >= 0, 'could not find a target for bin dir of ' + minItem.toString());
48524 return minItem[0];
48525 });
48526
48527 function findNearestInstalledVersionOfPackage(_x9, _x10) {
48528 return _ref10.apply(this, arguments);
48529 }
48530
48531 return findNearestInstalledVersionOfPackage;
48532 }();
48533
48534 PackageLinker.prototype.getFlatHoistedTree = function getFlatHoistedTree(patterns, workspaceLayout) {
48535 var _ref12 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
48536 ignoreOptional = _ref12.ignoreOptional;
48537
48538 var hoister = new (_packageHoister || _load_packageHoister()).default(this.config, this.resolver, { ignoreOptional, workspaceLayout });
48539 hoister.seed(patterns);
48540 if (this.config.focus) {
48541 hoister.markShallowWorkspaceEntries();
48542 }
48543 return hoister.init();
48544 };
48545
48546 PackageLinker.prototype.copyModules = function () {
48547 var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) {
48548 var _this2 = this;
48549
48550 var _ref14 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
48551 linkDuplicates = _ref14.linkDuplicates,
48552 ignoreOptional = _ref14.ignoreOptional;
48553
48554 var flatTree = this.getFlatHoistedTree(patterns, workspaceLayout, { ignoreOptional });
48555 // sorted tree makes file creation and copying not to interfere with each other
48556 flatTree = flatTree.sort(function (dep1, dep2) {
48557 return dep1[0].localeCompare(dep2[0]);
48558 });
48559
48560 // list of artifacts in modules to remove from extraneous removal
48561 var artifactFiles = [];
48562
48563 var copyQueue = new (_map || _load_map()).default();
48564 var hardlinkQueue = new (_map || _load_map()).default();
48565 var hardlinksEnabled = linkDuplicates && (yield (_fs || _load_fs()).hardlinksWork(this.config.cwd));
48566
48567 var copiedSrcs = new (_map || _load_map()).default();
48568 var symlinkPaths = new (_map || _load_map()).default();
48569
48570 var _loop2 = function* _loop2(folder, pkg, isShallow, _loc3) {
48571 var remote = pkg._remote || { type: '' };
48572 var ref = pkg._reference;
48573 var dest = folder;
48574 invariant(ref, 'expected package reference');
48575
48576 var src = _loc3;
48577 var type = '';
48578 if (remote.type === 'link') {
48579 // replace package source from incorrect cache location (workspaces and link: are not cached)
48580 // with a symlink source
48581 src = remote.reference;
48582 type = 'symlink';
48583 } else if (workspaceLayout && remote.type === 'workspace' && !isShallow) {
48584 src = remote.reference;
48585 type = 'symlink';
48586 // to get real path for non hoisted dependencies
48587 symlinkPaths.set(dest, src);
48588 } else {
48589 // backwards compatibility: get build artifacts from metadata
48590 // does not apply to symlinked dependencies
48591 var metadata = yield _this2.config.readPackageMetadata(src);
48592 for (var _iterator15 = metadata.artifacts, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) {
48593 var _ref32;
48594
48595 if (_isArray15) {
48596 if (_i15 >= _iterator15.length) break;
48597 _ref32 = _iterator15[_i15++];
48598 } else {
48599 _i15 = _iterator15.next();
48600 if (_i15.done) break;
48601 _ref32 = _i15.value;
48602 }
48603
48604 var file = _ref32;
48605
48606 artifactFiles.push(path.join(dest, file));
48607 }
48608 }
48609
48610 for (var _iterator16 = symlinkPaths.entries(), _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator16);;) {
48611 var _ref34;
48612
48613 if (_isArray16) {
48614 if (_i16 >= _iterator16.length) break;
48615 _ref34 = _iterator16[_i16++];
48616 } else {
48617 _i16 = _iterator16.next();
48618 if (_i16.done) break;
48619 _ref34 = _i16.value;
48620 }
48621
48622 var _ref33 = _ref34;
48623 var symlink = _ref33[0];
48624 var realpath = _ref33[1];
48625
48626 if (dest.indexOf(symlink + path.sep) === 0) {
48627 // after hoisting we end up with this structure
48628 // root/node_modules/workspace-package(symlink)/node_modules/package-a
48629 // fs.copy operations can't copy files through a symlink, so all the paths under workspace-package
48630 // need to be replaced with a real path, except for the symlink root/node_modules/workspace-package
48631 dest = dest.replace(symlink, realpath);
48632 }
48633 }
48634
48635 if (_this2.config.plugnplayEnabled) {
48636 ref.isPlugnplay = true;
48637 if (yield _this2._isUnplugged(pkg, ref)) {
48638 dest = _this2.config.generatePackageUnpluggedPath(ref);
48639
48640 // We don't skip the copy if the unplugged package isn't materialized yet
48641 if (yield (_fs || _load_fs()).exists(dest)) {
48642 ref.addLocation(dest);
48643 return 'continue';
48644 }
48645 } else {
48646 ref.addLocation(src);
48647 return 'continue';
48648 }
48649 }
48650
48651 ref.addLocation(dest);
48652
48653 var integrityArtifacts = _this2.artifacts[`${pkg.name}@${pkg.version}`];
48654 if (integrityArtifacts) {
48655 for (var _iterator17 = integrityArtifacts, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator17);;) {
48656 var _ref35;
48657
48658 if (_isArray17) {
48659 if (_i17 >= _iterator17.length) break;
48660 _ref35 = _iterator17[_i17++];
48661 } else {
48662 _i17 = _iterator17.next();
48663 if (_i17.done) break;
48664 _ref35 = _i17.value;
48665 }
48666
48667 var _file = _ref35;
48668
48669 artifactFiles.push(path.join(dest, _file));
48670 }
48671 }
48672
48673 var copiedDest = copiedSrcs.get(src);
48674 if (!copiedDest) {
48675 // no point to hardlink to a symlink
48676 if (hardlinksEnabled && type !== 'symlink') {
48677 copiedSrcs.set(src, dest);
48678 }
48679 copyQueue.set(dest, {
48680 src,
48681 dest,
48682 type,
48683 onFresh() {
48684 if (ref) {
48685 ref.setFresh(true);
48686 }
48687 }
48688 });
48689 } else {
48690 hardlinkQueue.set(dest, {
48691 src: copiedDest,
48692 dest,
48693 onFresh() {
48694 if (ref) {
48695 ref.setFresh(true);
48696 }
48697 }
48698 });
48699 }
48700 };
48701
48702 for (var _iterator5 = flatTree, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
48703 var _ref16;
48704
48705 if (_isArray5) {
48706 if (_i5 >= _iterator5.length) break;
48707 _ref16 = _iterator5[_i5++];
48708 } else {
48709 _i5 = _iterator5.next();
48710 if (_i5.done) break;
48711 _ref16 = _i5.value;
48712 }
48713
48714 var _ref15 = _ref16;
48715 var folder = _ref15[0];
48716 var _ref15$ = _ref15[1];
48717 var pkg = _ref15$.pkg;
48718 var _loc3 = _ref15$.loc;
48719 var isShallow = _ref15$.isShallow;
48720
48721 var _ret2 = yield* _loop2(folder, pkg, isShallow, _loc3);
48722
48723 if (_ret2 === 'continue') continue;
48724 }
48725
48726 var possibleExtraneous = new (_set || _load_set()).default();
48727 var scopedPaths = new (_set || _load_set()).default();
48728
48729 var findExtraneousFiles = function () {
48730 var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (basePath) {
48731 for (var _iterator6 = _this2.config.registryFolders, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
48732 var _ref18;
48733
48734 if (_isArray6) {
48735 if (_i6 >= _iterator6.length) break;
48736 _ref18 = _iterator6[_i6++];
48737 } else {
48738 _i6 = _iterator6.next();
48739 if (_i6.done) break;
48740 _ref18 = _i6.value;
48741 }
48742
48743 var folder = _ref18;
48744
48745 var _loc4 = path.resolve(basePath, folder);
48746
48747 if (yield (_fs || _load_fs()).exists(_loc4)) {
48748 var files = yield (_fs || _load_fs()).readdir(_loc4);
48749
48750 for (var _iterator7 = files, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
48751 var _ref19;
48752
48753 if (_isArray7) {
48754 if (_i7 >= _iterator7.length) break;
48755 _ref19 = _iterator7[_i7++];
48756 } else {
48757 _i7 = _iterator7.next();
48758 if (_i7.done) break;
48759 _ref19 = _i7.value;
48760 }
48761
48762 var file = _ref19;
48763
48764 var filepath = path.join(_loc4, file);
48765
48766 // it's a scope, not a package
48767 if (file[0] === '@') {
48768 scopedPaths.add(filepath);
48769
48770 for (var _iterator8 = yield (_fs || _load_fs()).readdir(filepath), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
48771 var _ref20;
48772
48773 if (_isArray8) {
48774 if (_i8 >= _iterator8.length) break;
48775 _ref20 = _iterator8[_i8++];
48776 } else {
48777 _i8 = _iterator8.next();
48778 if (_i8.done) break;
48779 _ref20 = _i8.value;
48780 }
48781
48782 var subfile = _ref20;
48783
48784 possibleExtraneous.add(path.join(filepath, subfile));
48785 }
48786 } else if (file[0] === '.' && file !== '.bin') {
48787 if (!(yield (_fs || _load_fs()).lstat(filepath)).isDirectory()) {
48788 possibleExtraneous.add(filepath);
48789 }
48790 } else {
48791 possibleExtraneous.add(filepath);
48792 }
48793 }
48794 }
48795 }
48796 });
48797
48798 return function findExtraneousFiles(_x15) {
48799 return _ref17.apply(this, arguments);
48800 };
48801 }();
48802
48803 yield findExtraneousFiles(this.config.lockfileFolder);
48804 if (workspaceLayout) {
48805 for (var _iterator9 = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
48806 var _ref21;
48807
48808 if (_isArray9) {
48809 if (_i9 >= _iterator9.length) break;
48810 _ref21 = _iterator9[_i9++];
48811 } else {
48812 _i9 = _iterator9.next();
48813 if (_i9.done) break;
48814 _ref21 = _i9.value;
48815 }
48816
48817 var workspaceName = _ref21;
48818
48819 yield findExtraneousFiles(workspaceLayout.workspaces[workspaceName].loc);
48820 }
48821 }
48822
48823 // If an Extraneous is an entry created via "yarn link", we prevent it from being overwritten.
48824 // Unfortunately, the only way we can know if they have been created this way is to check if they
48825 // are symlinks - problem is that it then conflicts with the newly introduced "link:" protocol,
48826 // which also creates symlinks :( a somewhat weak fix is to check if the symlink target is registered
48827 // inside the linkFolder, in which case we assume it has been created via "yarn link". Otherwise, we
48828 // assume it's a link:-managed dependency, and overwrite it as usual.
48829 var linkTargets = new (_map || _load_map()).default();
48830
48831 var linkedModules = void 0;
48832 try {
48833 linkedModules = yield (_fs || _load_fs()).readdir(this.config.linkFolder);
48834 } catch (err) {
48835 if (err.code === 'ENOENT') {
48836 linkedModules = [];
48837 } else {
48838 throw err;
48839 }
48840 }
48841
48842 // TODO: Consolidate this logic with `this.config.linkedModules` logic
48843 for (var _iterator10 = linkedModules, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
48844 var _ref22;
48845
48846 if (_isArray10) {
48847 if (_i10 >= _iterator10.length) break;
48848 _ref22 = _iterator10[_i10++];
48849 } else {
48850 _i10 = _iterator10.next();
48851 if (_i10.done) break;
48852 _ref22 = _i10.value;
48853 }
48854
48855 var entry = _ref22;
48856
48857 var entryPath = path.join(this.config.linkFolder, entry);
48858 var stat = yield (_fs || _load_fs()).lstat(entryPath);
48859
48860 if (stat.isSymbolicLink()) {
48861 try {
48862 var entryTarget = yield (_fs || _load_fs()).realpath(entryPath);
48863 linkTargets.set(entry, entryTarget);
48864 } catch (err) {
48865 this.reporter.warn(this.reporter.lang('linkTargetMissing', entry));
48866 yield (_fs || _load_fs()).unlink(entryPath);
48867 }
48868 } else if (stat.isDirectory() && entry[0] === '@') {
48869 // if the entry is directory beginning with '@', then we're dealing with a package scope, which
48870 // means we must iterate inside to retrieve the package names it contains
48871 var scopeName = entry;
48872
48873 for (var _iterator18 = yield (_fs || _load_fs()).readdir(entryPath), _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator18);;) {
48874 var _ref36;
48875
48876 if (_isArray18) {
48877 if (_i18 >= _iterator18.length) break;
48878 _ref36 = _iterator18[_i18++];
48879 } else {
48880 _i18 = _iterator18.next();
48881 if (_i18.done) break;
48882 _ref36 = _i18.value;
48883 }
48884
48885 var entry2 = _ref36;
48886
48887 var entryPath2 = path.join(entryPath, entry2);
48888 var stat2 = yield (_fs || _load_fs()).lstat(entryPath2);
48889
48890 if (stat2.isSymbolicLink()) {
48891 var packageName = `${scopeName}/${entry2}`;
48892 try {
48893 var _entryTarget = yield (_fs || _load_fs()).realpath(entryPath2);
48894 linkTargets.set(packageName, _entryTarget);
48895 } catch (err) {
48896 this.reporter.warn(this.reporter.lang('linkTargetMissing', packageName));
48897 yield (_fs || _load_fs()).unlink(entryPath2);
48898 }
48899 }
48900 }
48901 }
48902 }
48903
48904 for (var _iterator11 = possibleExtraneous, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
48905 var _ref23;
48906
48907 if (_isArray11) {
48908 if (_i11 >= _iterator11.length) break;
48909 _ref23 = _iterator11[_i11++];
48910 } else {
48911 _i11 = _iterator11.next();
48912 if (_i11.done) break;
48913 _ref23 = _i11.value;
48914 }
48915
48916 var _loc5 = _ref23;
48917
48918 var packageName = path.basename(_loc5);
48919 var scopeName = path.basename(path.dirname(_loc5));
48920
48921 if (scopeName[0] === `@`) {
48922 packageName = `${scopeName}/${packageName}`;
48923 }
48924
48925 if ((yield (_fs || _load_fs()).lstat(_loc5)).isSymbolicLink() && linkTargets.has(packageName) && linkTargets.get(packageName) === (yield (_fs || _load_fs()).realpath(_loc5))) {
48926 possibleExtraneous.delete(_loc5);
48927 copyQueue.delete(_loc5);
48928 }
48929 }
48930
48931 //
48932 var tick = void 0;
48933 yield (_fs || _load_fs()).copyBulk((0, (_from || _load_from()).default)(copyQueue.values()), this.reporter, {
48934 possibleExtraneous,
48935 artifactFiles,
48936
48937 ignoreBasenames: [(_constants || _load_constants()).METADATA_FILENAME, (_constants || _load_constants()).TARBALL_FILENAME, '.bin'],
48938
48939 onStart: function onStart(num) {
48940 tick = _this2.reporter.progress(num);
48941 },
48942
48943 onProgress(src) {
48944 if (tick) {
48945 tick();
48946 }
48947 }
48948 });
48949
48950 yield (_fs || _load_fs()).hardlinkBulk((0, (_from || _load_from()).default)(hardlinkQueue.values()), this.reporter, {
48951 possibleExtraneous,
48952 artifactFiles,
48953
48954 onStart: function onStart(num) {
48955 tick = _this2.reporter.progress(num);
48956 },
48957
48958 onProgress(src) {
48959 if (tick) {
48960 tick();
48961 }
48962 }
48963 });
48964
48965 // remove all extraneous files that weren't in the tree
48966 for (var _iterator12 = possibleExtraneous, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) {
48967 var _ref24;
48968
48969 if (_isArray12) {
48970 if (_i12 >= _iterator12.length) break;
48971 _ref24 = _iterator12[_i12++];
48972 } else {
48973 _i12 = _iterator12.next();
48974 if (_i12.done) break;
48975 _ref24 = _i12.value;
48976 }
48977
48978 var _loc6 = _ref24;
48979
48980 this.reporter.verbose(this.reporter.lang('verboseFileRemoveExtraneous', _loc6));
48981 yield (_fs || _load_fs()).unlink(_loc6);
48982 }
48983
48984 // remove any empty scoped directories
48985 for (var _iterator13 = scopedPaths, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) {
48986 var _ref25;
48987
48988 if (_isArray13) {
48989 if (_i13 >= _iterator13.length) break;
48990 _ref25 = _iterator13[_i13++];
48991 } else {
48992 _i13 = _iterator13.next();
48993 if (_i13.done) break;
48994 _ref25 = _i13.value;
48995 }
48996
48997 var scopedPath = _ref25;
48998
48999 var files = yield (_fs || _load_fs()).readdir(scopedPath);
49000 if (files.length === 0) {
49001 yield (_fs || _load_fs()).unlink(scopedPath);
49002 }
49003 }
49004
49005 // create binary links
49006 if (this.config.getOption('bin-links') && this.config.binLinks !== false) {
49007 var topLevelDependencies = this.determineTopLevelBinLinkOrder(flatTree);
49008 var tickBin = this.reporter.progress(flatTree.length + topLevelDependencies.length);
49009
49010 // create links in transient dependencies
49011 yield (_promise2 || _load_promise2()).queue(flatTree, function () {
49012 var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref27) {
49013 var dest = _ref27[0],
49014 _ref27$ = _ref27[1],
49015 pkg = _ref27$.pkg,
49016 isNohoist = _ref27$.isNohoist,
49017 parts = _ref27$.parts;
49018
49019 if (pkg._reference && pkg._reference.locations.length && !pkg._reference.isPlugnplay) {
49020 var binLoc = path.join(dest, _this2.config.getFolder(pkg));
49021 yield _this2.linkBinDependencies(pkg, binLoc);
49022 if (isNohoist) {
49023 // if nohoist, we need to override the binLink to point to the local destination
49024 var parentBinLoc = _this2.getParentBinLoc(parts, flatTree);
49025 yield _this2.linkSelfDependencies(pkg, dest, parentBinLoc, true);
49026 }
49027 tickBin();
49028 }
49029 tickBin();
49030 });
49031
49032 return function (_x16) {
49033 return _ref26.apply(this, arguments);
49034 };
49035 }(), linkBinConcurrency);
49036
49037 // create links at top level for all dependencies.
49038 yield (_promise2 || _load_promise2()).queue(topLevelDependencies, function () {
49039 var _ref28 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref29) {
49040 var dest = _ref29[0],
49041 pkg = _ref29[1].pkg;
49042
49043 if (pkg._reference && pkg._reference.locations.length && !pkg._reference.isPlugnplay && pkg.bin && (0, (_keys || _load_keys()).default)(pkg.bin).length) {
49044 var binLoc = void 0;
49045 if (_this2.config.modulesFolder) {
49046 binLoc = path.join(_this2.config.modulesFolder);
49047 } else {
49048 binLoc = path.join(_this2.config.lockfileFolder, _this2.config.getFolder(pkg));
49049 }
49050 yield _this2.linkSelfDependencies(pkg, dest, binLoc);
49051 }
49052 tickBin();
49053 });
49054
49055 return function (_x17) {
49056 return _ref28.apply(this, arguments);
49057 };
49058 }(), linkBinConcurrency);
49059 }
49060
49061 for (var _iterator14 = flatTree, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) {
49062 var _ref31;
49063
49064 if (_isArray14) {
49065 if (_i14 >= _iterator14.length) break;
49066 _ref31 = _iterator14[_i14++];
49067 } else {
49068 _i14 = _iterator14.next();
49069 if (_i14.done) break;
49070 _ref31 = _i14.value;
49071 }
49072
49073 var _ref30 = _ref31;
49074 var pkg = _ref30[1].pkg;
49075
49076 yield this._warnForMissingBundledDependencies(pkg);
49077 }
49078 });
49079
49080 function copyModules(_x12, _x13) {
49081 return _ref13.apply(this, arguments);
49082 }
49083
49084 return copyModules;
49085 }();
49086
49087 PackageLinker.prototype._buildTreeHash = function _buildTreeHash(flatTree) {
49088 var hash = new (_map || _load_map()).default();
49089 for (var _iterator19 = flatTree, _isArray19 = Array.isArray(_iterator19), _i19 = 0, _iterator19 = _isArray19 ? _iterator19 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator19);;) {
49090 var _ref38;
49091
49092 if (_isArray19) {
49093 if (_i19 >= _iterator19.length) break;
49094 _ref38 = _iterator19[_i19++];
49095 } else {
49096 _i19 = _iterator19.next();
49097 if (_i19.done) break;
49098 _ref38 = _i19.value;
49099 }
49100
49101 var _ref37 = _ref38;
49102 var _dest = _ref37[0];
49103 var hoistManifest = _ref37[1];
49104
49105 var key = hoistManifest.parts.join('#');
49106 hash.set(key, [_dest, hoistManifest]);
49107 }
49108 this._treeHash = hash;
49109 return hash;
49110 };
49111
49112 PackageLinker.prototype.getParentBinLoc = function getParentBinLoc(parts, flatTree) {
49113 var hash = this._treeHash || this._buildTreeHash(flatTree);
49114 var parent = parts.slice(0, -1).join('#');
49115 var tuple = hash.get(parent);
49116 if (!tuple) {
49117 throw new Error(`failed to get parent '${parent}' binLoc`);
49118 }
49119 var dest = tuple[0],
49120 hoistManifest = tuple[1];
49121
49122 var parentBinLoc = path.join(dest, this.config.getFolder(hoistManifest.pkg));
49123
49124 return parentBinLoc;
49125 };
49126
49127 PackageLinker.prototype.determineTopLevelBinLinkOrder = function determineTopLevelBinLinkOrder(flatTree) {
49128 var linksToCreate = new (_map || _load_map()).default();
49129 for (var _iterator20 = flatTree, _isArray20 = Array.isArray(_iterator20), _i20 = 0, _iterator20 = _isArray20 ? _iterator20 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator20);;) {
49130 var _ref40;
49131
49132 if (_isArray20) {
49133 if (_i20 >= _iterator20.length) break;
49134 _ref40 = _iterator20[_i20++];
49135 } else {
49136 _i20 = _iterator20.next();
49137 if (_i20.done) break;
49138 _ref40 = _i20.value;
49139 }
49140
49141 var _ref39 = _ref40;
49142 var _dest2 = _ref39[0];
49143 var hoistManifest = _ref39[1];
49144 var pkg = hoistManifest.pkg,
49145 isDirectRequire = hoistManifest.isDirectRequire,
49146 isNohoist = hoistManifest.isNohoist,
49147 isShallow = hoistManifest.isShallow;
49148 var name = pkg.name;
49149
49150 // nohoist and shallow packages should not be linked at topLevel bin
49151
49152 if (!isNohoist && !isShallow && (isDirectRequire || this.topLevelBinLinking && !linksToCreate.has(name))) {
49153 linksToCreate.set(name, [_dest2, hoistManifest]);
49154 }
49155 }
49156
49157 // Sort the array so that direct dependencies will be linked last.
49158 // Bin links are overwritten if they already exist, so this will cause direct deps to take precedence.
49159 // If someone finds this to be incorrect later, you could also consider sorting descending by
49160 // `linkToCreate.level` which is the dependency tree depth. Direct deps will have level 0 and transitive
49161 // deps will have level > 0.
49162 var transientBins = [];
49163 var topLevelBins = [];
49164 for (var _iterator21 = (0, (_from || _load_from()).default)(linksToCreate.values()), _isArray21 = Array.isArray(_iterator21), _i21 = 0, _iterator21 = _isArray21 ? _iterator21 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator21);;) {
49165 var _ref41;
49166
49167 if (_isArray21) {
49168 if (_i21 >= _iterator21.length) break;
49169 _ref41 = _iterator21[_i21++];
49170 } else {
49171 _i21 = _iterator21.next();
49172 if (_i21.done) break;
49173 _ref41 = _i21.value;
49174 }
49175
49176 var linkToCreate = _ref41;
49177
49178 if (linkToCreate[1].isDirectRequire) {
49179 topLevelBins.push(linkToCreate);
49180 } else {
49181 transientBins.push(linkToCreate);
49182 }
49183 }
49184 return [].concat(transientBins, topLevelBins);
49185 };
49186
49187 PackageLinker.prototype.resolvePeerModules = function resolvePeerModules() {
49188 var _this3 = this;
49189
49190 var _loop3 = function _loop3(pkg) {
49191 var peerDeps = pkg.peerDependencies;
49192 var peerDepsMeta = pkg.peerDependenciesMeta;
49193
49194 if (!peerDeps) {
49195 return 'continue';
49196 }
49197
49198 var ref = pkg._reference;
49199 invariant(ref, 'Package reference is missing');
49200
49201 // TODO: We are taking the "shortest" ref tree but there may be multiple ref trees with the same length
49202 var refTree = ref.requests.map(function (req) {
49203 return req.parentNames;
49204 }).sort(function (arr1, arr2) {
49205 return arr1.length - arr2.length;
49206 })[0];
49207
49208 var getLevelDistance = function getLevelDistance(pkgRef) {
49209 var minDistance = Infinity;
49210 for (var _iterator23 = pkgRef.requests, _isArray23 = Array.isArray(_iterator23), _i23 = 0, _iterator23 = _isArray23 ? _iterator23 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator23);;) {
49211 var _ref43;
49212
49213 if (_isArray23) {
49214 if (_i23 >= _iterator23.length) break;
49215 _ref43 = _iterator23[_i23++];
49216 } else {
49217 _i23 = _iterator23.next();
49218 if (_i23.done) break;
49219 _ref43 = _i23.value;
49220 }
49221
49222 var req = _ref43;
49223
49224 var distance = refTree.length - req.parentNames.length;
49225
49226 if (distance >= 0 && distance < minDistance && req.parentNames.every(function (name, idx) {
49227 return name === refTree[idx];
49228 })) {
49229 minDistance = distance;
49230 }
49231 }
49232
49233 return minDistance;
49234 };
49235
49236 for (var peerDepName in peerDeps) {
49237 var range = peerDeps[peerDepName];
49238 var meta = peerDepsMeta && peerDepsMeta[peerDepName];
49239
49240 var isOptional = !!(meta && meta.optional);
49241
49242 var peerPkgs = _this3.resolver.getAllInfoForPackageName(peerDepName);
49243
49244 var peerError = 'unmetPeer';
49245 var resolvedLevelDistance = Infinity;
49246 var resolvedPeerPkg = void 0;
49247 for (var _iterator24 = peerPkgs, _isArray24 = Array.isArray(_iterator24), _i24 = 0, _iterator24 = _isArray24 ? _iterator24 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator24);;) {
49248 var _ref44;
49249
49250 if (_isArray24) {
49251 if (_i24 >= _iterator24.length) break;
49252 _ref44 = _iterator24[_i24++];
49253 } else {
49254 _i24 = _iterator24.next();
49255 if (_i24.done) break;
49256 _ref44 = _i24.value;
49257 }
49258
49259 var peerPkg = _ref44;
49260
49261 var peerPkgRef = peerPkg._reference;
49262 if (!(peerPkgRef && peerPkgRef.patterns)) {
49263 continue;
49264 }
49265 var levelDistance = getLevelDistance(peerPkgRef);
49266 if (isFinite(levelDistance) && levelDistance < resolvedLevelDistance) {
49267 if (_this3._satisfiesPeerDependency(range, peerPkgRef.version)) {
49268 resolvedLevelDistance = levelDistance;
49269 resolvedPeerPkg = peerPkgRef;
49270 } else {
49271 peerError = 'incorrectPeer';
49272 }
49273 }
49274 }
49275
49276 if (resolvedPeerPkg) {
49277 ref.addDependencies(resolvedPeerPkg.patterns);
49278 _this3.reporter.verbose(_this3.reporter.lang('selectedPeer', `${pkg.name}@${pkg.version}`, `${peerDepName}@${resolvedPeerPkg.version}`, resolvedPeerPkg.level));
49279 } else if (!isOptional) {
49280 _this3.reporter.warn(_this3.reporter.lang(peerError, `${refTree.join(' > ')} > ${pkg.name}@${pkg.version}`, `${peerDepName}@${range}`));
49281 }
49282 }
49283 };
49284
49285 for (var _iterator22 = this.resolver.getManifests(), _isArray22 = Array.isArray(_iterator22), _i22 = 0, _iterator22 = _isArray22 ? _iterator22 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator22);;) {
49286 var _ref42;
49287
49288 if (_isArray22) {
49289 if (_i22 >= _iterator22.length) break;
49290 _ref42 = _iterator22[_i22++];
49291 } else {
49292 _i22 = _iterator22.next();
49293 if (_i22.done) break;
49294 _ref42 = _i22.value;
49295 }
49296
49297 var pkg = _ref42;
49298
49299 var _ret3 = _loop3(pkg);
49300
49301 if (_ret3 === 'continue') continue;
49302 }
49303 };
49304
49305 PackageLinker.prototype._satisfiesPeerDependency = function _satisfiesPeerDependency(range, version) {
49306 return range === '*' || (0, (_semver || _load_semver()).satisfiesWithPrereleases)(version, range, this.config.looseSemver);
49307 };
49308
49309 PackageLinker.prototype._warnForMissingBundledDependencies = function () {
49310 var _ref45 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg) {
49311 var _this4 = this;
49312
49313 var ref = pkg._reference;
49314 invariant(ref, 'missing package ref ' + pkg.name);
49315
49316 if (pkg.bundleDependencies) {
49317 var _loop4 = function* _loop4(depName) {
49318 var locs = ref.locations.map(function (loc) {
49319 return path.join(loc, _this4.config.getFolder(pkg), depName);
49320 });
49321 var locsExist = yield (_promise || _load_promise()).default.all(locs.map(function (loc) {
49322 return (_fs || _load_fs()).exists(loc);
49323 }));
49324 if (locsExist.some(function (e) {
49325 return !e;
49326 })) {
49327 //if any of the locs do not exist
49328 var pkgHuman = `${pkg.name}@${pkg.version}`;
49329 _this4.reporter.warn(_this4.reporter.lang('missingBundledDependency', pkgHuman, depName));
49330 }
49331 };
49332
49333 for (var _iterator25 = pkg.bundleDependencies, _isArray25 = Array.isArray(_iterator25), _i25 = 0, _iterator25 = _isArray25 ? _iterator25 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator25);;) {
49334 var _ref46;
49335
49336 if (_isArray25) {
49337 if (_i25 >= _iterator25.length) break;
49338 _ref46 = _iterator25[_i25++];
49339 } else {
49340 _i25 = _iterator25.next();
49341 if (_i25.done) break;
49342 _ref46 = _i25.value;
49343 }
49344
49345 var depName = _ref46;
49346 yield* _loop4(depName);
49347 }
49348 }
49349 });
49350
49351 function _warnForMissingBundledDependencies(_x18) {
49352 return _ref45.apply(this, arguments);
49353 }
49354
49355 return _warnForMissingBundledDependencies;
49356 }();
49357
49358 PackageLinker.prototype._isUnplugged = function () {
49359 var _ref47 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (pkg, ref) {
49360 // If an unplugged folder exists for the specified package, we simply use it
49361 if (yield (_fs || _load_fs()).exists(this.config.generatePackageUnpluggedPath(ref))) {
49362 return true;
49363 }
49364
49365 // If the package has a postinstall script, we also unplug it (otherwise they would run into the cache)
49366 if (!this.config.ignoreScripts && pkg.scripts && (pkg.scripts.preinstall || pkg.scripts.install || pkg.scripts.postinstall)) {
49367 return true;
49368 }
49369
49370 // Check whether the user explicitly requested for the package to be unplugged
49371 return this.unplugged.some(function (patternToUnplug) {
49372 var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(patternToUnplug),
49373 name = _normalizePattern.name,
49374 range = _normalizePattern.range,
49375 hasVersion = _normalizePattern.hasVersion;
49376
49377 var satisfiesSemver = hasVersion ? semver.satisfies(ref.version, range) : true;
49378 return name === ref.name && satisfiesSemver;
49379 });
49380 });
49381
49382 function _isUnplugged(_x19, _x20) {
49383 return _ref47.apply(this, arguments);
49384 }
49385
49386 return _isUnplugged;
49387 }();
49388
49389 PackageLinker.prototype.init = function () {
49390 var _ref48 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (patterns, workspaceLayout) {
49391 var _ref49 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
49392 linkDuplicates = _ref49.linkDuplicates,
49393 ignoreOptional = _ref49.ignoreOptional;
49394
49395 this.resolvePeerModules();
49396 yield this.copyModules(patterns, workspaceLayout, { linkDuplicates, ignoreOptional });
49397
49398 if (!this.config.plugnplayEnabled) {
49399 yield (_fs || _load_fs()).unlink(`${this.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`);
49400 }
49401 });
49402
49403 function init(_x21, _x22) {
49404 return _ref48.apply(this, arguments);
49405 }
49406
49407 return init;
49408 }();
49409
49410 return PackageLinker;
49411}();
49412
49413exports.default = PackageLinker;
49414
49415/***/ }),
49416/* 199 */
49417/***/ (function(module, exports, __webpack_require__) {
49418
49419"use strict";
49420
49421
49422Object.defineProperty(exports, "__esModule", {
49423 value: true
49424});
49425exports.clearLine = clearLine;
49426exports.toStartOfLine = toStartOfLine;
49427exports.writeOnNthLine = writeOnNthLine;
49428exports.clearNthLine = clearNthLine;
49429
49430var _tty;
49431
49432function _load_tty() {
49433 return _tty = _interopRequireDefault(__webpack_require__(148));
49434}
49435
49436function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
49437
49438var readline = __webpack_require__(187);
49439
49440var _require = __webpack_require__(37),
49441 supportsColor = _require.supportsColor;
49442
49443var CLEAR_WHOLE_LINE = 0;
49444var CLEAR_RIGHT_OF_CURSOR = 1;
49445
49446function clearLine(stdout) {
49447 if (!supportsColor) {
49448 if (stdout instanceof (_tty || _load_tty()).default.WriteStream) {
49449 if (stdout.columns > 0) {
49450 stdout.write(`\r${' '.repeat(stdout.columns - 1)}`);
49451 }
49452 stdout.write(`\r`);
49453 }
49454 return;
49455 }
49456
49457 readline.clearLine(stdout, CLEAR_WHOLE_LINE);
49458 readline.cursorTo(stdout, 0);
49459}
49460
49461function toStartOfLine(stdout) {
49462 if (!supportsColor) {
49463 stdout.write('\r');
49464 return;
49465 }
49466
49467 readline.cursorTo(stdout, 0);
49468}
49469
49470function writeOnNthLine(stdout, n, msg) {
49471 if (!supportsColor) {
49472 return;
49473 }
49474
49475 if (n == 0) {
49476 readline.cursorTo(stdout, 0);
49477 stdout.write(msg);
49478 readline.clearLine(stdout, CLEAR_RIGHT_OF_CURSOR);
49479 return;
49480 }
49481 readline.cursorTo(stdout, 0);
49482 readline.moveCursor(stdout, 0, -n);
49483 stdout.write(msg);
49484 readline.clearLine(stdout, CLEAR_RIGHT_OF_CURSOR);
49485 readline.cursorTo(stdout, 0);
49486 readline.moveCursor(stdout, 0, n);
49487}
49488
49489function clearNthLine(stdout, n) {
49490 if (!supportsColor) {
49491 return;
49492 }
49493
49494 if (n == 0) {
49495 clearLine(stdout);
49496 return;
49497 }
49498 readline.cursorTo(stdout, 0);
49499 readline.moveCursor(stdout, 0, -n);
49500 readline.clearLine(stdout, CLEAR_WHOLE_LINE);
49501 readline.moveCursor(stdout, 0, n);
49502}
49503
49504/***/ }),
49505/* 200 */
49506/***/ (function(module, exports, __webpack_require__) {
49507
49508"use strict";
49509
49510
49511Object.defineProperty(exports, "__esModule", {
49512 value: true
49513});
49514
49515var _extends2;
49516
49517function _load_extends() {
49518 return _extends2 = _interopRequireDefault(__webpack_require__(24));
49519}
49520
49521var _stringify;
49522
49523function _load_stringify() {
49524 return _stringify = _interopRequireDefault(__webpack_require__(36));
49525}
49526
49527var _classCallCheck2;
49528
49529function _load_classCallCheck() {
49530 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
49531}
49532
49533var _possibleConstructorReturn2;
49534
49535function _load_possibleConstructorReturn() {
49536 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
49537}
49538
49539var _inherits2;
49540
49541function _load_inherits() {
49542 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
49543}
49544
49545var _baseReporter;
49546
49547function _load_baseReporter() {
49548 return _baseReporter = _interopRequireDefault(__webpack_require__(98));
49549}
49550
49551function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
49552
49553var JSONReporter = function (_BaseReporter) {
49554 (0, (_inherits2 || _load_inherits()).default)(JSONReporter, _BaseReporter);
49555
49556 function JSONReporter(opts) {
49557 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, JSONReporter);
49558
49559 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseReporter.call(this, opts));
49560
49561 _this._activityId = 0;
49562 _this._progressId = 0;
49563 return _this;
49564 }
49565
49566 JSONReporter.prototype._dump = function _dump(type, data, error) {
49567 var stdout = this.stdout;
49568 if (error) {
49569 stdout = this.stderr;
49570 }
49571 stdout.write(`${(0, (_stringify || _load_stringify()).default)({ type, data })}\n`);
49572 };
49573
49574 JSONReporter.prototype._verbose = function _verbose(msg) {
49575 this._dump('verbose', msg);
49576 };
49577
49578 JSONReporter.prototype.list = function list(type, items, hints) {
49579 this._dump('list', { type, items, hints });
49580 };
49581
49582 JSONReporter.prototype.tree = function tree(type, trees) {
49583 this._dump('tree', { type, trees });
49584 };
49585
49586 JSONReporter.prototype.step = function step(current, total, message) {
49587 this._dump('step', { message, current, total });
49588 };
49589
49590 JSONReporter.prototype.inspect = function inspect(value) {
49591 this._dump('inspect', value);
49592 };
49593
49594 JSONReporter.prototype.footer = function footer(showPeakMemory) {
49595 this._dump('finished', this.getTotalTime());
49596 };
49597
49598 JSONReporter.prototype.log = function log(msg) {
49599 this._dump('log', msg);
49600 };
49601
49602 JSONReporter.prototype.command = function command(msg) {
49603 this._dump('command', msg);
49604 };
49605
49606 JSONReporter.prototype.table = function table(head, body) {
49607 this._dump('table', { head, body });
49608 };
49609
49610 JSONReporter.prototype.success = function success(msg) {
49611 this._dump('success', msg);
49612 };
49613
49614 JSONReporter.prototype.error = function error(msg) {
49615 this._dump('error', msg, true);
49616 };
49617
49618 JSONReporter.prototype.warn = function warn(msg) {
49619 this._dump('warning', msg, true);
49620 };
49621
49622 JSONReporter.prototype.info = function info(msg) {
49623 this._dump('info', msg);
49624 };
49625
49626 JSONReporter.prototype.activitySet = function activitySet(total, workers) {
49627 var _this2 = this;
49628
49629 if (!this.isTTY || this.noProgress) {
49630 return _BaseReporter.prototype.activitySet.call(this, total, workers);
49631 }
49632
49633 var id = this._activityId++;
49634 this._dump('activitySetStart', { id, total, workers });
49635
49636 var spinners = [];
49637
49638 var _loop = function _loop(i) {
49639 var current = 0;
49640 var header = '';
49641
49642 spinners.push({
49643 clear() {},
49644 setPrefix(_current, _header) {
49645 current = _current;
49646 header = _header;
49647 },
49648 tick: function tick(msg) {
49649 _this2._dump('activitySetTick', {
49650 id,
49651 header,
49652 current,
49653 worker: i,
49654 message: msg
49655 });
49656 },
49657 end() {}
49658 });
49659 };
49660
49661 for (var i = 0; i < workers; i++) {
49662 _loop(i);
49663 }
49664
49665 return {
49666 spinners,
49667 end: function end() {
49668 _this2._dump('activitySetEnd', { id });
49669 }
49670 };
49671 };
49672
49673 JSONReporter.prototype.activity = function activity() {
49674 return this._activity({});
49675 };
49676
49677 JSONReporter.prototype._activity = function _activity(data) {
49678 var _this3 = this;
49679
49680 if (!this.isTTY || this.noProgress) {
49681 return {
49682 tick() {},
49683 end() {}
49684 };
49685 }
49686
49687 var id = this._activityId++;
49688 this._dump('activityStart', (0, (_extends2 || _load_extends()).default)({ id }, data));
49689
49690 return {
49691 tick: function tick(name) {
49692 _this3._dump('activityTick', { id, name });
49693 },
49694
49695 end: function end() {
49696 _this3._dump('activityEnd', { id });
49697 }
49698 };
49699 };
49700
49701 JSONReporter.prototype.progress = function progress(total) {
49702 var _this4 = this;
49703
49704 if (this.noProgress) {
49705 return function () {
49706 // noop
49707 };
49708 }
49709
49710 var id = this._progressId++;
49711 var current = 0;
49712 this._dump('progressStart', { id, total });
49713
49714 return function () {
49715 current++;
49716 _this4._dump('progressTick', { id, current });
49717
49718 if (current === total) {
49719 _this4._dump('progressFinish', { id });
49720 }
49721 };
49722 };
49723
49724 JSONReporter.prototype.auditAction = function auditAction(recommendation) {
49725 this._dump('auditAction', recommendation);
49726 };
49727
49728 JSONReporter.prototype.auditAdvisory = function auditAdvisory(resolution, _auditAdvisory) {
49729 this._dump('auditAdvisory', { resolution, advisory: _auditAdvisory });
49730 };
49731
49732 JSONReporter.prototype.auditSummary = function auditSummary(auditMetadata) {
49733 this._dump('auditSummary', auditMetadata);
49734 };
49735
49736 return JSONReporter;
49737}((_baseReporter || _load_baseReporter()).default);
49738
49739exports.default = JSONReporter;
49740
49741/***/ }),
49742/* 201 */
49743/***/ (function(module, exports, __webpack_require__) {
49744
49745"use strict";
49746
49747
49748Object.defineProperty(exports, "__esModule", {
49749 value: true
49750});
49751exports.shouldUpdateLockfile = undefined;
49752
49753var _set;
49754
49755function _load_set() {
49756 return _set = _interopRequireDefault(__webpack_require__(16));
49757}
49758
49759var _classCallCheck2;
49760
49761function _load_classCallCheck() {
49762 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
49763}
49764
49765var _semver;
49766
49767function _load_semver() {
49768 return _semver = _interopRequireDefault(__webpack_require__(27));
49769}
49770
49771var _minimatch;
49772
49773function _load_minimatch() {
49774 return _minimatch = _interopRequireDefault(__webpack_require__(170));
49775}
49776
49777var _map;
49778
49779function _load_map() {
49780 return _map = _interopRequireDefault(__webpack_require__(51));
49781}
49782
49783var _normalizePattern2;
49784
49785function _load_normalizePattern() {
49786 return _normalizePattern2 = __webpack_require__(52);
49787}
49788
49789var _parsePackagePath;
49790
49791function _load_parsePackagePath() {
49792 return _parsePackagePath = _interopRequireDefault(__webpack_require__(313));
49793}
49794
49795var _parsePackagePath2;
49796
49797function _load_parsePackagePath2() {
49798 return _parsePackagePath2 = __webpack_require__(313);
49799}
49800
49801var _resolvers;
49802
49803function _load_resolvers() {
49804 return _resolvers = __webpack_require__(75);
49805}
49806
49807function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
49808
49809var DIRECTORY_SEPARATOR = '/';
49810var GLOBAL_NESTED_DEP_PATTERN = '**/';
49811
49812var ResolutionMap = function () {
49813 function ResolutionMap(config) {
49814 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ResolutionMap);
49815
49816 this.resolutionsByPackage = (0, (_map || _load_map()).default)();
49817 this.config = config;
49818 this.reporter = config.reporter;
49819 this.delayQueue = new (_set || _load_set()).default();
49820 }
49821
49822 ResolutionMap.prototype.init = function init() {
49823 var resolutions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
49824
49825 for (var _globPattern in resolutions) {
49826 var info = this.parsePatternInfo(_globPattern, resolutions[_globPattern]);
49827
49828 if (info) {
49829 var resolution = this.resolutionsByPackage[info.name] || [];
49830 this.resolutionsByPackage[info.name] = [].concat(resolution, [info]);
49831 }
49832 }
49833 };
49834
49835 ResolutionMap.prototype.addToDelayQueue = function addToDelayQueue(req) {
49836 this.delayQueue.add(req);
49837 };
49838
49839 ResolutionMap.prototype.parsePatternInfo = function parsePatternInfo(globPattern, range) {
49840 if (!(0, (_parsePackagePath2 || _load_parsePackagePath2()).isValidPackagePath)(globPattern)) {
49841 this.reporter.warn(this.reporter.lang('invalidResolutionName', globPattern));
49842 return null;
49843 }
49844
49845 var directories = (0, (_parsePackagePath || _load_parsePackagePath()).default)(globPattern);
49846 var name = directories.pop();
49847
49848 if (!(_semver || _load_semver()).default.validRange(range) && !(0, (_resolvers || _load_resolvers()).getExoticResolver)(range)) {
49849 this.reporter.warn(this.reporter.lang('invalidResolutionVersion', range));
49850 return null;
49851 }
49852
49853 // For legacy support of resolutions, replace `name` with `**/name`
49854 if (name === globPattern) {
49855 globPattern = `${GLOBAL_NESTED_DEP_PATTERN}${name}`;
49856 }
49857
49858 return {
49859 name,
49860 range,
49861 globPattern,
49862 pattern: `${name}@${range}`
49863 };
49864 };
49865
49866 ResolutionMap.prototype.find = function find(reqPattern, parentNames) {
49867 var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(reqPattern),
49868 name = _normalizePattern.name,
49869 reqRange = _normalizePattern.range;
49870
49871 var resolutions = this.resolutionsByPackage[name];
49872
49873 if (!resolutions) {
49874 return '';
49875 }
49876
49877 var modulePath = [].concat(parentNames, [name]).join(DIRECTORY_SEPARATOR);
49878
49879 var _ref = resolutions.find(function (_ref2) {
49880 var globPattern = _ref2.globPattern;
49881 return (0, (_minimatch || _load_minimatch()).default)(modulePath, globPattern);
49882 }) || {},
49883 pattern = _ref.pattern,
49884 range = _ref.range;
49885
49886 if (pattern) {
49887 if ((_semver || _load_semver()).default.validRange(reqRange) && (_semver || _load_semver()).default.valid(range) && !(_semver || _load_semver()).default.satisfies(range, reqRange)) {
49888 this.reporter.warn(this.reporter.lang('incompatibleResolutionVersion', pattern, reqPattern));
49889 }
49890 }
49891
49892 return pattern;
49893 };
49894
49895 return ResolutionMap;
49896}();
49897
49898exports.default = ResolutionMap;
49899var shouldUpdateLockfile = exports.shouldUpdateLockfile = function shouldUpdateLockfile(lockfileEntry, resolutionEntry) {
49900 if (!lockfileEntry || !resolutionEntry) {
49901 return false;
49902 }
49903
49904 return lockfileEntry.resolved !== resolutionEntry.remote.resolved;
49905};
49906
49907/***/ }),
49908/* 202 */
49909/***/ (function(module, exports, __webpack_require__) {
49910
49911"use strict";
49912
49913
49914Object.defineProperty(exports, "__esModule", {
49915 value: true
49916});
49917exports.FILE_PROTOCOL_PREFIX = undefined;
49918
49919var _asyncToGenerator2;
49920
49921function _load_asyncToGenerator() {
49922 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
49923}
49924
49925var _classCallCheck2;
49926
49927function _load_classCallCheck() {
49928 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
49929}
49930
49931var _possibleConstructorReturn2;
49932
49933function _load_possibleConstructorReturn() {
49934 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
49935}
49936
49937var _inherits2;
49938
49939function _load_inherits() {
49940 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
49941}
49942
49943var _path;
49944
49945function _load_path() {
49946 return _path = _interopRequireDefault(__webpack_require__(1));
49947}
49948
49949var _invariant;
49950
49951function _load_invariant() {
49952 return _invariant = _interopRequireDefault(__webpack_require__(15));
49953}
49954
49955var _uuid;
49956
49957function _load_uuid() {
49958 return _uuid = _interopRequireDefault(__webpack_require__(114));
49959}
49960
49961var _errors;
49962
49963function _load_errors() {
49964 return _errors = __webpack_require__(6);
49965}
49966
49967var _exoticResolver;
49968
49969function _load_exoticResolver() {
49970 return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
49971}
49972
49973var _misc;
49974
49975function _load_misc() {
49976 return _misc = _interopRequireWildcard(__webpack_require__(28));
49977}
49978
49979var _fs;
49980
49981function _load_fs() {
49982 return _fs = _interopRequireWildcard(__webpack_require__(8));
49983}
49984
49985function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
49986
49987function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
49988
49989var FILE_PROTOCOL_PREFIX = exports.FILE_PROTOCOL_PREFIX = 'file:';
49990
49991var FileResolver = function (_ExoticResolver) {
49992 (0, (_inherits2 || _load_inherits()).default)(FileResolver, _ExoticResolver);
49993
49994 function FileResolver(request, fragment) {
49995 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, FileResolver);
49996
49997 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
49998
49999 _this.loc = (_misc || _load_misc()).removePrefix(fragment, FILE_PROTOCOL_PREFIX);
50000 return _this;
50001 }
50002
50003 FileResolver.isVersion = function isVersion(pattern) {
50004 return _ExoticResolver.isVersion.call(this, pattern) || this.prefixMatcher.test(pattern) || (_path || _load_path()).default.isAbsolute(pattern);
50005 };
50006
50007 FileResolver.prototype.resolve = function () {
50008 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
50009 var _this2 = this;
50010
50011 var loc = this.loc;
50012 if (!(_path || _load_path()).default.isAbsolute(loc)) {
50013 loc = (_path || _load_path()).default.resolve(this.config.lockfileFolder, loc);
50014 }
50015
50016 if (this.config.linkFileDependencies) {
50017 var _registry = 'npm';
50018 var _manifest = { _uid: '', name: '', version: '0.0.0', _registry: _registry };
50019 _manifest._remote = {
50020 type: 'link',
50021 registry: _registry,
50022 hash: null,
50023 reference: loc
50024 };
50025 _manifest._uid = _manifest.version;
50026 return _manifest;
50027 }
50028 if (!(yield (_fs || _load_fs()).exists(loc))) {
50029 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('doesntExist', loc, this.pattern.split('@')[0]));
50030 }
50031
50032 var manifest = yield (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
50033 try {
50034 return yield _this2.config.readManifest(loc, _this2.registry);
50035 } catch (e) {
50036 if (e.code === 'ENOENT') {
50037 return {
50038 // This is just the default, it can be overridden with key of dependencies
50039 name: (_path || _load_path()).default.dirname(loc),
50040 version: '0.0.0',
50041 _uid: '0.0.0',
50042 _registry: 'npm'
50043 };
50044 }
50045
50046 throw e;
50047 }
50048 })();
50049 var registry = manifest._registry;
50050 (0, (_invariant || _load_invariant()).default)(registry, 'expected registry');
50051
50052 manifest._remote = {
50053 type: 'copy',
50054 registry,
50055 hash: `${(_uuid || _load_uuid()).default.v4()}-${new Date().getTime()}`,
50056 reference: loc
50057 };
50058
50059 manifest._uid = manifest.version;
50060
50061 return manifest;
50062 });
50063
50064 function resolve() {
50065 return _ref.apply(this, arguments);
50066 }
50067
50068 return resolve;
50069 }();
50070
50071 return FileResolver;
50072}((_exoticResolver || _load_exoticResolver()).default);
50073
50074FileResolver.protocol = 'file';
50075FileResolver.prefixMatcher = /^\.{1,2}\//;
50076exports.default = FileResolver;
50077
50078/***/ }),
50079/* 203 */
50080/***/ (function(module, exports, __webpack_require__) {
50081
50082"use strict";
50083
50084
50085Object.defineProperty(exports, "__esModule", {
50086 value: true
50087});
50088
50089var _classCallCheck2;
50090
50091function _load_classCallCheck() {
50092 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
50093}
50094
50095var _possibleConstructorReturn2;
50096
50097function _load_possibleConstructorReturn() {
50098 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
50099}
50100
50101var _inherits2;
50102
50103function _load_inherits() {
50104 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
50105}
50106
50107exports.explodeGistFragment = explodeGistFragment;
50108
50109var _errors;
50110
50111function _load_errors() {
50112 return _errors = __webpack_require__(6);
50113}
50114
50115var _gitResolver;
50116
50117function _load_gitResolver() {
50118 return _gitResolver = _interopRequireDefault(__webpack_require__(118));
50119}
50120
50121var _exoticResolver;
50122
50123function _load_exoticResolver() {
50124 return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
50125}
50126
50127var _misc;
50128
50129function _load_misc() {
50130 return _misc = _interopRequireWildcard(__webpack_require__(28));
50131}
50132
50133function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
50134
50135function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
50136
50137function explodeGistFragment(fragment, reporter) {
50138 fragment = (_misc || _load_misc()).removePrefix(fragment, 'gist:');
50139
50140 var parts = fragment.split('#');
50141
50142 if (parts.length <= 2) {
50143 return {
50144 id: parts[0],
50145 hash: parts[1] || ''
50146 };
50147 } else {
50148 throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidGistFragment', fragment));
50149 }
50150}
50151
50152var GistResolver = function (_ExoticResolver) {
50153 (0, (_inherits2 || _load_inherits()).default)(GistResolver, _ExoticResolver);
50154
50155 function GistResolver(request, fragment) {
50156 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GistResolver);
50157
50158 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
50159
50160 var _explodeGistFragment = explodeGistFragment(fragment, _this.reporter),
50161 id = _explodeGistFragment.id,
50162 hash = _explodeGistFragment.hash;
50163
50164 _this.id = id;
50165 _this.hash = hash;
50166 return _this;
50167 }
50168
50169 GistResolver.prototype.resolve = function resolve() {
50170 return this.fork((_gitResolver || _load_gitResolver()).default, false, `https://gist.github.com/${this.id}.git#${this.hash}`);
50171 };
50172
50173 return GistResolver;
50174}((_exoticResolver || _load_exoticResolver()).default);
50175
50176GistResolver.protocol = 'gist';
50177exports.default = GistResolver;
50178
50179/***/ }),
50180/* 204 */
50181/***/ (function(module, exports, __webpack_require__) {
50182
50183"use strict";
50184
50185
50186Object.defineProperty(exports, "__esModule", {
50187 value: true
50188});
50189
50190var _assign;
50191
50192function _load_assign() {
50193 return _assign = _interopRequireDefault(__webpack_require__(23));
50194}
50195
50196var _getIterator2;
50197
50198function _load_getIterator() {
50199 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
50200}
50201
50202var _keys;
50203
50204function _load_keys() {
50205 return _keys = _interopRequireDefault(__webpack_require__(14));
50206}
50207
50208var _asyncToGenerator2;
50209
50210function _load_asyncToGenerator() {
50211 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
50212}
50213
50214var _classCallCheck2;
50215
50216function _load_classCallCheck() {
50217 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
50218}
50219
50220var _possibleConstructorReturn2;
50221
50222function _load_possibleConstructorReturn() {
50223 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
50224}
50225
50226var _inherits2;
50227
50228function _load_inherits() {
50229 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
50230}
50231
50232var _cache;
50233
50234function _load_cache() {
50235 return _cache = __webpack_require__(291);
50236}
50237
50238var _errors;
50239
50240function _load_errors() {
50241 return _errors = __webpack_require__(6);
50242}
50243
50244var _registryResolver;
50245
50246function _load_registryResolver() {
50247 return _registryResolver = _interopRequireDefault(__webpack_require__(531));
50248}
50249
50250var _npmRegistry;
50251
50252function _load_npmRegistry() {
50253 return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
50254}
50255
50256var _map;
50257
50258function _load_map() {
50259 return _map = _interopRequireDefault(__webpack_require__(51));
50260}
50261
50262var _fs;
50263
50264function _load_fs() {
50265 return _fs = _interopRequireWildcard(__webpack_require__(8));
50266}
50267
50268var _constants;
50269
50270function _load_constants() {
50271 return _constants = __webpack_require__(13);
50272}
50273
50274var _packageNameUtils;
50275
50276function _load_packageNameUtils() {
50277 return _packageNameUtils = __webpack_require__(208);
50278}
50279
50280function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
50281
50282function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
50283
50284var inquirer = __webpack_require__(193);
50285var tty = __webpack_require__(148);
50286var path = __webpack_require__(1);
50287var semver = __webpack_require__(27);
50288var ssri = __webpack_require__(93);
50289
50290var NPM_REGISTRY_ID = 'npm';
50291
50292var NpmResolver = function (_RegistryResolver) {
50293 (0, (_inherits2 || _load_inherits()).default)(NpmResolver, _RegistryResolver);
50294
50295 function NpmResolver() {
50296 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NpmResolver);
50297 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _RegistryResolver.apply(this, arguments));
50298 }
50299
50300 NpmResolver.findVersionInRegistryResponse = function () {
50301 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, name, range, body, request) {
50302 if (body.versions && (0, (_keys || _load_keys()).default)(body.versions).length === 0) {
50303 throw new (_errors || _load_errors()).MessageError(config.reporter.lang('registryNoVersions', body.name));
50304 }
50305
50306 if (!body['dist-tags'] || !body.versions) {
50307 throw new (_errors || _load_errors()).MessageError(config.reporter.lang('malformedRegistryResponse', name));
50308 }
50309
50310 if (range in body['dist-tags']) {
50311 range = body['dist-tags'][range];
50312 }
50313
50314 // If the latest tag in the registry satisfies the requested range, then use that.
50315 // Otherwise we will fall back to semver maxSatisfying.
50316 // This mimics logic in NPM. See issue #3560
50317 var latestVersion = body['dist-tags'] ? body['dist-tags'].latest : undefined;
50318 if (latestVersion && semver.satisfies(latestVersion, range)) {
50319 return body.versions[latestVersion];
50320 }
50321
50322 var satisfied = yield config.resolveConstraints((0, (_keys || _load_keys()).default)(body.versions), range);
50323 if (satisfied) {
50324 return body.versions[satisfied];
50325 } else if (request && !config.nonInteractive) {
50326 if (request.resolver && request.resolver.activity) {
50327 request.resolver.activity.end();
50328 }
50329 config.reporter.log(config.reporter.lang('couldntFindVersionThatMatchesRange', body.name, range));
50330 var pageSize = void 0;
50331 if (process.stdout instanceof tty.WriteStream) {
50332 pageSize = process.stdout.rows - 2;
50333 }
50334 var response = yield inquirer.prompt([{
50335 name: 'package',
50336 type: 'list',
50337 message: config.reporter.lang('chooseVersionFromList', body.name),
50338 choices: semver.rsort((0, (_keys || _load_keys()).default)(body.versions)),
50339 pageSize
50340 }]);
50341 if (response && response.package) {
50342 return body.versions[response.package];
50343 }
50344 }
50345 throw new (_errors || _load_errors()).MessageError(config.reporter.lang('couldntFindVersionThatMatchesRange', body.name, range));
50346 });
50347
50348 function findVersionInRegistryResponse(_x, _x2, _x3, _x4, _x5) {
50349 return _ref.apply(this, arguments);
50350 }
50351
50352 return findVersionInRegistryResponse;
50353 }();
50354
50355 NpmResolver.prototype.resolveRequest = function () {
50356 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (desiredVersion) {
50357 if (this.config.offline) {
50358 var res = yield this.resolveRequestOffline();
50359 if (res != null) {
50360 return res;
50361 }
50362 }
50363
50364 var escapedName = (_npmRegistry || _load_npmRegistry()).default.escapeName(this.name);
50365 var desiredRange = desiredVersion || this.range;
50366 var body = yield this.config.registries.npm.request(escapedName);
50367
50368 if (body) {
50369 return NpmResolver.findVersionInRegistryResponse(this.config, escapedName, desiredRange, body, this.request);
50370 } else {
50371 return null;
50372 }
50373 });
50374
50375 function resolveRequest(_x6) {
50376 return _ref2.apply(this, arguments);
50377 }
50378
50379 return resolveRequest;
50380 }();
50381
50382 NpmResolver.prototype.resolveRequestOffline = function () {
50383 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
50384 var _this2 = this;
50385
50386 var packageDirs = yield this.config.getCache('cachedPackages', function () {
50387 return (0, (_cache || _load_cache()).getCachedPackagesDirs)(_this2.config, _this2.config.cacheFolder);
50388 });
50389
50390 var versions = (0, (_map || _load_map()).default)();
50391
50392 for (var _iterator = packageDirs, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
50393 var _ref4;
50394
50395 if (_isArray) {
50396 if (_i >= _iterator.length) break;
50397 _ref4 = _iterator[_i++];
50398 } else {
50399 _i = _iterator.next();
50400 if (_i.done) break;
50401 _ref4 = _i.value;
50402 }
50403
50404 var dir = _ref4;
50405
50406 // check if folder contains the registry prefix
50407 if (dir.indexOf(`${NPM_REGISTRY_ID}-`) === -1) {
50408 continue;
50409 }
50410
50411 // read manifest and validate correct name
50412 var pkg = yield this.config.readManifest(dir, NPM_REGISTRY_ID);
50413 if (pkg.name !== this.name) {
50414 continue;
50415 }
50416
50417 // read package metadata
50418 var metadata = yield this.config.readPackageMetadata(dir);
50419 if (!metadata.remote) {
50420 continue; // old yarn metadata
50421 }
50422
50423 versions[pkg.version] = (0, (_assign || _load_assign()).default)({}, pkg, {
50424 _remote: metadata.remote
50425 });
50426 }
50427
50428 var satisfied = yield this.config.resolveConstraints((0, (_keys || _load_keys()).default)(versions), this.range);
50429 if (satisfied) {
50430 return versions[satisfied];
50431 } else if (!this.config.preferOffline) {
50432 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('couldntFindPackageInCache', this.name, this.range, (0, (_keys || _load_keys()).default)(versions).join(', ')));
50433 } else {
50434 return null;
50435 }
50436 });
50437
50438 function resolveRequestOffline() {
50439 return _ref3.apply(this, arguments);
50440 }
50441
50442 return resolveRequestOffline;
50443 }();
50444
50445 NpmResolver.prototype.cleanRegistry = function cleanRegistry(url) {
50446 if (this.config.getOption('registry') === (_constants || _load_constants()).YARN_REGISTRY) {
50447 return url.replace((_constants || _load_constants()).NPM_REGISTRY_RE, (_constants || _load_constants()).YARN_REGISTRY);
50448 } else {
50449 return url;
50450 }
50451 };
50452
50453 NpmResolver.prototype.resolve = function () {
50454 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
50455 // lockfile
50456 var shrunk = this.request.getLocked('tarball');
50457 if (shrunk) {
50458 if (this.config.packBuiltPackages && shrunk.prebuiltVariants && shrunk._remote) {
50459 var prebuiltVariants = shrunk.prebuiltVariants;
50460 var prebuiltName = (0, (_packageNameUtils || _load_packageNameUtils()).getPlatformSpecificPackageFilename)(shrunk);
50461 var offlineMirrorPath = this.config.getOfflineMirrorPath();
50462 if (prebuiltVariants[prebuiltName] && offlineMirrorPath) {
50463 var filename = path.join(offlineMirrorPath, 'prebuilt', prebuiltName + '.tgz');
50464 var _remote = shrunk._remote;
50465
50466 if (_remote && (yield (_fs || _load_fs()).exists(filename))) {
50467 _remote.reference = `file:${filename}`;
50468 _remote.hash = prebuiltVariants[prebuiltName];
50469 _remote.integrity = ssri.fromHex(_remote.hash, 'sha1').toString();
50470 }
50471 }
50472 }
50473 }
50474 if (shrunk && shrunk._remote && (shrunk._remote.integrity || this.config.offline || !this.config.autoAddIntegrity)) {
50475 // if the integrity field does not exist, we're not network-restricted, and the
50476 // migration hasn't been disabled, it needs to be created
50477 return shrunk;
50478 }
50479
50480 var desiredVersion = shrunk && shrunk.version ? shrunk.version : null;
50481 var info = yield this.resolveRequest(desiredVersion);
50482 if (info == null) {
50483 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('packageNotFoundRegistry', this.name, NPM_REGISTRY_ID));
50484 }
50485
50486 var deprecated = info.deprecated,
50487 dist = info.dist;
50488
50489 if (shrunk && shrunk._remote) {
50490 shrunk._remote.integrity = dist && dist.integrity ? ssri.parse(dist.integrity) : ssri.fromHex(dist && dist.shasum ? dist.shasum : '', 'sha1');
50491 return shrunk;
50492 }
50493
50494 if (typeof deprecated === 'string') {
50495 var human = `${info.name}@${info.version}`;
50496 var parentNames = this.request.parentNames;
50497 if (parentNames.length) {
50498 human = parentNames.concat(human).join(' > ');
50499 }
50500 this.reporter.warn(`${human}: ${deprecated}`);
50501 }
50502
50503 if (dist != null && dist.tarball) {
50504 info._remote = {
50505 resolved: `${this.cleanRegistry(dist.tarball)}#${dist.shasum}`,
50506 type: 'tarball',
50507 reference: this.cleanRegistry(dist.tarball),
50508 hash: dist.shasum,
50509 integrity: dist.integrity ? ssri.parse(dist.integrity) : ssri.fromHex(dist.shasum, 'sha1'),
50510 registry: NPM_REGISTRY_ID,
50511 packageName: info.name
50512 };
50513 }
50514
50515 info._uid = info.version;
50516
50517 return info;
50518 });
50519
50520 function resolve() {
50521 return _ref5.apply(this, arguments);
50522 }
50523
50524 return resolve;
50525 }();
50526
50527 return NpmResolver;
50528}((_registryResolver || _load_registryResolver()).default);
50529
50530NpmResolver.registry = NPM_REGISTRY_ID;
50531exports.default = NpmResolver;
50532
50533/***/ }),
50534/* 205 */
50535/***/ (function(module, exports, __webpack_require__) {
50536
50537"use strict";
50538
50539
50540Object.defineProperty(exports, "__esModule", {
50541 value: true
50542});
50543
50544var _from;
50545
50546function _load_from() {
50547 return _from = _interopRequireDefault(__webpack_require__(53));
50548}
50549
50550var _asyncToGenerator2;
50551
50552function _load_asyncToGenerator() {
50553 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
50554}
50555
50556var _classCallCheck2;
50557
50558function _load_classCallCheck() {
50559 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
50560}
50561
50562var _extends2;
50563
50564function _load_extends() {
50565 return _extends2 = _interopRequireDefault(__webpack_require__(24));
50566}
50567
50568var _invariant;
50569
50570function _load_invariant() {
50571 return _invariant = _interopRequireDefault(__webpack_require__(15));
50572}
50573
50574var _string_decoder;
50575
50576function _load_string_decoder() {
50577 return _string_decoder = __webpack_require__(272);
50578}
50579
50580var _tarFs;
50581
50582function _load_tarFs() {
50583 return _tarFs = _interopRequireDefault(__webpack_require__(184));
50584}
50585
50586var _tarStream;
50587
50588function _load_tarStream() {
50589 return _tarStream = _interopRequireDefault(__webpack_require__(431));
50590}
50591
50592var _url;
50593
50594function _load_url() {
50595 return _url = _interopRequireDefault(__webpack_require__(29));
50596}
50597
50598var _fs;
50599
50600function _load_fs() {
50601 return _fs = __webpack_require__(12);
50602}
50603
50604var _errors;
50605
50606function _load_errors() {
50607 return _errors = __webpack_require__(6);
50608}
50609
50610var _gitSpawn;
50611
50612function _load_gitSpawn() {
50613 return _gitSpawn = __webpack_require__(310);
50614}
50615
50616var _gitRefResolver;
50617
50618function _load_gitRefResolver() {
50619 return _gitRefResolver = __webpack_require__(538);
50620}
50621
50622var _crypto;
50623
50624function _load_crypto() {
50625 return _crypto = _interopRequireWildcard(__webpack_require__(158));
50626}
50627
50628var _fs2;
50629
50630function _load_fs2() {
50631 return _fs2 = _interopRequireWildcard(__webpack_require__(8));
50632}
50633
50634var _map;
50635
50636function _load_map() {
50637 return _map = _interopRequireDefault(__webpack_require__(51));
50638}
50639
50640var _misc;
50641
50642function _load_misc() {
50643 return _misc = __webpack_require__(28);
50644}
50645
50646function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
50647
50648function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
50649
50650var GIT_PROTOCOL_PREFIX = 'git+';
50651
50652var SSH_PROTOCOL = 'ssh:';
50653var SCP_PATH_PREFIX = '/:';
50654var FILE_PROTOCOL = 'file:';
50655var GIT_VALID_REF_LINE_REGEXP = /^([a-fA-F0-9]+|ref)/;
50656
50657var validRef = function validRef(line) {
50658 return GIT_VALID_REF_LINE_REGEXP.exec(line);
50659};
50660
50661var supportsArchiveCache = (0, (_map || _load_map()).default)({
50662 'github.com': false // not support, doubt they will ever support it
50663});
50664
50665var handleSpawnError = function handleSpawnError(err) {
50666 if (err instanceof (_errors || _load_errors()).ProcessSpawnError) {
50667 throw err;
50668 }
50669};
50670
50671var SHORTHAND_SERVICES = (0, (_map || _load_map()).default)({
50672 'github:': function github(parsedUrl) {
50673 return (0, (_extends2 || _load_extends()).default)({}, parsedUrl, {
50674 slashes: true,
50675 auth: 'git',
50676 protocol: SSH_PROTOCOL,
50677 host: 'github.com',
50678 hostname: 'github.com',
50679 pathname: `/${parsedUrl.hostname}${parsedUrl.pathname}`
50680 });
50681 },
50682 'bitbucket:': function bitbucket(parsedUrl) {
50683 return (0, (_extends2 || _load_extends()).default)({}, parsedUrl, {
50684 slashes: true,
50685 auth: 'git',
50686 protocol: SSH_PROTOCOL,
50687 host: 'bitbucket.com',
50688 hostname: 'bitbucket.com',
50689 pathname: `/${parsedUrl.hostname}${parsedUrl.pathname}`
50690 });
50691 }
50692});
50693
50694var Git = function () {
50695 function Git(config, gitUrl, hash) {
50696 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Git);
50697
50698 this.supportsArchive = false;
50699 this.fetched = false;
50700 this.config = config;
50701 this.reporter = config.reporter;
50702 this.hash = hash;
50703 this.ref = hash;
50704 this.gitUrl = gitUrl;
50705 this.cwd = this.config.getTemp((_crypto || _load_crypto()).hash(this.gitUrl.repository));
50706 }
50707
50708 /**
50709 * npm URLs contain a 'git+' scheme prefix, which is not understood by git.
50710 * git "URLs" also allow an alternative scp-like syntax, so they're not standard URLs.
50711 */
50712 Git.npmUrlToGitUrl = function npmUrlToGitUrl(npmUrl) {
50713 npmUrl = (0, (_misc || _load_misc()).removePrefix)(npmUrl, GIT_PROTOCOL_PREFIX);
50714
50715 var parsed = (_url || _load_url()).default.parse(npmUrl);
50716 var expander = parsed.protocol && SHORTHAND_SERVICES[parsed.protocol];
50717
50718 if (expander) {
50719 parsed = expander(parsed);
50720 }
50721
50722 // Special case in npm, where ssh:// prefix is stripped to pass scp-like syntax
50723 // which in git works as remote path only if there are no slashes before ':'.
50724 // See #3146.
50725 if (parsed.protocol === SSH_PROTOCOL && parsed.hostname && parsed.path && parsed.path.startsWith(SCP_PATH_PREFIX) && parsed.port === null) {
50726 var auth = parsed.auth ? parsed.auth + '@' : '';
50727 var pathname = parsed.path.slice(SCP_PATH_PREFIX.length);
50728 return {
50729 hostname: parsed.hostname,
50730 protocol: parsed.protocol,
50731 repository: `${auth}${parsed.hostname}:${pathname}`
50732 };
50733 }
50734
50735 // git local repos are specified as `git+file:` and a filesystem path, not a url.
50736 var repository = void 0;
50737 if (parsed.protocol === FILE_PROTOCOL) {
50738 repository = parsed.path;
50739 } else {
50740 repository = (_url || _load_url()).default.format((0, (_extends2 || _load_extends()).default)({}, parsed, { hash: '' }));
50741 }
50742
50743 return {
50744 hostname: parsed.hostname || null,
50745 protocol: parsed.protocol || FILE_PROTOCOL,
50746 repository: repository || ''
50747 };
50748 };
50749
50750 /**
50751 * Check if the host specified in the input `gitUrl` has archive capability.
50752 */
50753
50754 Git.hasArchiveCapability = function () {
50755 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref) {
50756 var hostname = ref.hostname;
50757 if (ref.protocol !== 'ssh:' || hostname == null) {
50758 return false;
50759 }
50760
50761 if (hostname in supportsArchiveCache) {
50762 return supportsArchiveCache[hostname];
50763 }
50764
50765 try {
50766 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${ref.repository}`, 'HEAD', Date.now() + '']);
50767 throw new Error();
50768 } catch (err) {
50769 handleSpawnError(err);
50770 var supports = err.message.indexOf('did not match any files') >= 0;
50771 return supportsArchiveCache[hostname] = supports;
50772 }
50773 });
50774
50775 function hasArchiveCapability(_x) {
50776 return _ref.apply(this, arguments);
50777 }
50778
50779 return hasArchiveCapability;
50780 }();
50781
50782 /**
50783 * Check if the input `target` is a 5-40 character hex commit hash.
50784 */
50785
50786 Git.repoExists = function () {
50787 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref) {
50788 var isLocal = ref.protocol === FILE_PROTOCOL;
50789
50790 try {
50791 if (isLocal) {
50792 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', '-t'], { cwd: ref.repository });
50793 } else {
50794 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '-t', ref.repository]);
50795 }
50796 return true;
50797 } catch (err) {
50798 handleSpawnError(err);
50799 return false;
50800 }
50801 });
50802
50803 function repoExists(_x2) {
50804 return _ref2.apply(this, arguments);
50805 }
50806
50807 return repoExists;
50808 }();
50809
50810 Git.replaceProtocol = function replaceProtocol(ref, protocol) {
50811 return {
50812 hostname: ref.hostname,
50813 protocol,
50814 repository: ref.repository.replace(/^(?:git|http):/, protocol)
50815 };
50816 };
50817
50818 /**
50819 * Attempt to upgrade insecure protocols to secure protocol
50820 */
50821
50822
50823 Git.secureGitUrl = function () {
50824 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (ref, hash, reporter) {
50825 if ((0, (_gitRefResolver || _load_gitRefResolver()).isCommitSha)(hash)) {
50826 // this is cryptographically secure
50827 return ref;
50828 }
50829
50830 if (ref.protocol === 'git:') {
50831 var secureUrl = Git.replaceProtocol(ref, 'https:');
50832 if (yield Git.repoExists(secureUrl)) {
50833 return secureUrl;
50834 } else {
50835 reporter.warn(reporter.lang('downloadGitWithoutCommit', ref.repository));
50836 return ref;
50837 }
50838 }
50839
50840 if (ref.protocol === 'http:') {
50841 var secureRef = Git.replaceProtocol(ref, 'https:');
50842 if (yield Git.repoExists(secureRef)) {
50843 return secureRef;
50844 } else {
50845 reporter.warn(reporter.lang('downloadHTTPWithoutCommit', ref.repository));
50846 return ref;
50847 }
50848 }
50849
50850 return ref;
50851 });
50852
50853 function secureGitUrl(_x3, _x4, _x5) {
50854 return _ref3.apply(this, arguments);
50855 }
50856
50857 return secureGitUrl;
50858 }();
50859
50860 /**
50861 * Archive a repo to destination
50862 */
50863
50864 Git.prototype.archive = function archive(dest) {
50865 if (this.supportsArchive) {
50866 return this._archiveViaRemoteArchive(dest);
50867 } else {
50868 return this._archiveViaLocalFetched(dest);
50869 }
50870 };
50871
50872 Git.prototype._archiveViaRemoteArchive = function () {
50873 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) {
50874 var hashStream = new (_crypto || _load_crypto()).HashStream();
50875 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${this.gitUrl.repository}`, this.ref], {
50876 process(proc, resolve, reject, done) {
50877 var writeStream = (0, (_fs || _load_fs()).createWriteStream)(dest);
50878 proc.on('error', reject);
50879 writeStream.on('error', reject);
50880 writeStream.on('end', done);
50881 writeStream.on('open', function () {
50882 proc.stdout.pipe(hashStream).pipe(writeStream);
50883 });
50884 writeStream.once('finish', done);
50885 }
50886 });
50887 return hashStream.getHash();
50888 });
50889
50890 function _archiveViaRemoteArchive(_x6) {
50891 return _ref4.apply(this, arguments);
50892 }
50893
50894 return _archiveViaRemoteArchive;
50895 }();
50896
50897 Git.prototype._archiveViaLocalFetched = function () {
50898 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) {
50899 var hashStream = new (_crypto || _load_crypto()).HashStream();
50900 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', this.hash], {
50901 cwd: this.cwd,
50902 process(proc, resolve, reject, done) {
50903 var writeStream = (0, (_fs || _load_fs()).createWriteStream)(dest);
50904 proc.on('error', reject);
50905 writeStream.on('error', reject);
50906 writeStream.on('open', function () {
50907 proc.stdout.pipe(hashStream).pipe(writeStream);
50908 });
50909 writeStream.once('finish', done);
50910 }
50911 });
50912 return hashStream.getHash();
50913 });
50914
50915 function _archiveViaLocalFetched(_x7) {
50916 return _ref5.apply(this, arguments);
50917 }
50918
50919 return _archiveViaLocalFetched;
50920 }();
50921
50922 /**
50923 * Clone a repo to the input `dest`. Use `git archive` if it's available, otherwise fall
50924 * back to `git clone`.
50925 */
50926
50927 Git.prototype.clone = function clone(dest) {
50928 if (this.supportsArchive) {
50929 return this._cloneViaRemoteArchive(dest);
50930 } else {
50931 return this._cloneViaLocalFetched(dest);
50932 }
50933 };
50934
50935 Git.prototype._cloneViaRemoteArchive = function () {
50936 var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) {
50937 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${this.gitUrl.repository}`, this.ref], {
50938 process(proc, update, reject, done) {
50939 var extractor = (_tarFs || _load_tarFs()).default.extract(dest, {
50940 dmode: 0o555, // all dirs should be readable
50941 fmode: 0o444 // all files should be readable
50942 });
50943 extractor.on('error', reject);
50944 extractor.on('finish', done);
50945
50946 proc.stdout.pipe(extractor);
50947 proc.on('error', reject);
50948 }
50949 });
50950 });
50951
50952 function _cloneViaRemoteArchive(_x8) {
50953 return _ref6.apply(this, arguments);
50954 }
50955
50956 return _cloneViaRemoteArchive;
50957 }();
50958
50959 Git.prototype._cloneViaLocalFetched = function () {
50960 var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest) {
50961 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', this.hash], {
50962 cwd: this.cwd,
50963 process(proc, resolve, reject, done) {
50964 var extractor = (_tarFs || _load_tarFs()).default.extract(dest, {
50965 dmode: 0o555, // all dirs should be readable
50966 fmode: 0o444 // all files should be readable
50967 });
50968
50969 extractor.on('error', reject);
50970 extractor.on('finish', done);
50971
50972 proc.stdout.pipe(extractor);
50973 }
50974 });
50975 });
50976
50977 function _cloneViaLocalFetched(_x9) {
50978 return _ref7.apply(this, arguments);
50979 }
50980
50981 return _cloneViaLocalFetched;
50982 }();
50983
50984 /**
50985 * Clone this repo.
50986 */
50987
50988 Git.prototype.fetch = function fetch() {
50989 var _this = this;
50990
50991 var gitUrl = this.gitUrl,
50992 cwd = this.cwd;
50993
50994
50995 return (_fs2 || _load_fs2()).lockQueue.push(gitUrl.repository, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
50996 if (yield (_fs2 || _load_fs2()).exists(cwd)) {
50997 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['fetch', '--tags'], { cwd });
50998 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['pull'], { cwd });
50999 } else {
51000 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['clone', gitUrl.repository, cwd]);
51001 }
51002
51003 _this.fetched = true;
51004 }));
51005 };
51006
51007 /**
51008 * Fetch the file by cloning the repo and reading it.
51009 */
51010
51011 Git.prototype.getFile = function getFile(filename) {
51012 if (this.supportsArchive) {
51013 return this._getFileFromArchive(filename);
51014 } else {
51015 return this._getFileFromClone(filename);
51016 }
51017 };
51018
51019 Git.prototype._getFileFromArchive = function () {
51020 var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename) {
51021 try {
51022 return yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['archive', `--remote=${this.gitUrl.repository}`, this.ref, filename], {
51023 process(proc, update, reject, done) {
51024 var parser = (_tarStream || _load_tarStream()).default.extract();
51025
51026 parser.on('error', reject);
51027 parser.on('finish', done);
51028
51029 parser.on('entry', function (header, stream, next) {
51030 var decoder = new (_string_decoder || _load_string_decoder()).StringDecoder('utf8');
51031 var fileContent = '';
51032
51033 stream.on('data', function (buffer) {
51034 fileContent += decoder.write(buffer);
51035 });
51036 stream.on('end', function () {
51037 var remaining = decoder.end();
51038 update(fileContent + remaining);
51039 next();
51040 });
51041 stream.resume();
51042 });
51043
51044 proc.stdout.pipe(parser);
51045 }
51046 });
51047 } catch (err) {
51048 if (err.message.indexOf('did not match any files') >= 0) {
51049 return false;
51050 } else {
51051 throw err;
51052 }
51053 }
51054 });
51055
51056 function _getFileFromArchive(_x10) {
51057 return _ref9.apply(this, arguments);
51058 }
51059
51060 return _getFileFromArchive;
51061 }();
51062
51063 Git.prototype._getFileFromClone = function () {
51064 var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename) {
51065 (0, (_invariant || _load_invariant()).default)(this.fetched, 'Repo not fetched');
51066
51067 try {
51068 return yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show', `${this.hash}:${filename}`], {
51069 cwd: this.cwd
51070 });
51071 } catch (err) {
51072 handleSpawnError(err);
51073 // file doesn't exist
51074 return false;
51075 }
51076 });
51077
51078 function _getFileFromClone(_x11) {
51079 return _ref10.apply(this, arguments);
51080 }
51081
51082 return _getFileFromClone;
51083 }();
51084
51085 /**
51086 * Initialize the repo, find a secure url to use and
51087 * set the ref to match an input `target`.
51088 */
51089
51090
51091 Git.prototype.init = function () {
51092 var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
51093 this.gitUrl = yield Git.secureGitUrl(this.gitUrl, this.hash, this.reporter);
51094
51095 yield this.setRefRemote();
51096
51097 // check capabilities
51098 if (this.ref !== '' && (yield Git.hasArchiveCapability(this.gitUrl))) {
51099 this.supportsArchive = true;
51100 } else {
51101 yield this.fetch();
51102 }
51103
51104 return this.hash;
51105 });
51106
51107 function init() {
51108 return _ref11.apply(this, arguments);
51109 }
51110
51111 return init;
51112 }();
51113
51114 Git.prototype.setRefRemote = function () {
51115 var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
51116 var isLocal = this.gitUrl.protocol === FILE_PROTOCOL;
51117 var stdout = void 0;
51118
51119 if (isLocal) {
51120 stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', '--tags', '--heads'], { cwd: this.gitUrl.repository });
51121 } else {
51122 stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--tags', '--heads', this.gitUrl.repository]);
51123 }
51124
51125 var refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(stdout);
51126 return this.setRef(refs);
51127 });
51128
51129 function setRefRemote() {
51130 return _ref12.apply(this, arguments);
51131 }
51132
51133 return setRefRemote;
51134 }();
51135
51136 Git.prototype.setRefHosted = function setRefHosted(hostedRefsList) {
51137 var refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(hostedRefsList);
51138 return this.setRef(refs);
51139 };
51140
51141 /**
51142 * Resolves the default branch of a remote repository (not always "master")
51143 */
51144
51145 Git.prototype.resolveDefaultBranch = function () {
51146 var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
51147 var isLocal = this.gitUrl.protocol === FILE_PROTOCOL;
51148
51149 try {
51150 var stdout = void 0;
51151 if (isLocal) {
51152 stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['show-ref', 'HEAD'], { cwd: this.gitUrl.repository });
51153 var refs = (0, (_gitRefResolver || _load_gitRefResolver()).parseRefs)(stdout);
51154 var sha = refs.values().next().value;
51155 if (sha) {
51156 return { sha, ref: undefined };
51157 } else {
51158 throw new Error('Unable to find SHA for git HEAD');
51159 }
51160 } else {
51161 stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', '--symref', this.gitUrl.repository, 'HEAD']);
51162 var lines = stdout.split('\n').filter(validRef);
51163
51164 var _lines$0$split = lines[0].split(/\s+/),
51165 ref = _lines$0$split[1];
51166
51167 var _lines$1$split = lines[1].split(/\s+/),
51168 _sha = _lines$1$split[0];
51169
51170 return { sha: _sha, ref };
51171 }
51172 } catch (err) {
51173 handleSpawnError(err);
51174 // older versions of git don't support "--symref"
51175 var _stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['ls-remote', this.gitUrl.repository, 'HEAD']);
51176 var _lines = _stdout.split('\n').filter(validRef);
51177
51178 var _lines$0$split2 = _lines[0].split(/\s+/),
51179 _sha2 = _lines$0$split2[0];
51180
51181 return { sha: _sha2, ref: undefined };
51182 }
51183 });
51184
51185 function resolveDefaultBranch() {
51186 return _ref13.apply(this, arguments);
51187 }
51188
51189 return resolveDefaultBranch;
51190 }();
51191
51192 /**
51193 * Resolve a git commit to it's 40-chars format and ensure it exists in the repository
51194 * We need to use the 40-chars format to avoid multiple folders in the cache
51195 */
51196
51197 Git.prototype.resolveCommit = function () {
51198 var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (shaToResolve) {
51199 try {
51200 yield this.fetch();
51201 var revListArgs = ['rev-list', '-n', '1', '--no-abbrev-commit', '--format=oneline', shaToResolve];
51202 var stdout = yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(revListArgs, { cwd: this.cwd });
51203
51204 var _stdout$split = stdout.split(/\s+/),
51205 sha = _stdout$split[0];
51206
51207 return { sha, ref: undefined };
51208 } catch (err) {
51209 handleSpawnError(err);
51210 // assuming commit not found, let's try something else
51211 return null;
51212 }
51213 });
51214
51215 function resolveCommit(_x12) {
51216 return _ref14.apply(this, arguments);
51217 }
51218
51219 return resolveCommit;
51220 }();
51221
51222 /**
51223 * Resolves the input hash / ref / semver range to a valid commit sha
51224 * If possible also resolves the sha to a valid ref in order to use "git archive"
51225 */
51226
51227 Git.prototype.setRef = function () {
51228 var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (refs) {
51229 // get commit ref
51230 var version = this.hash;
51231
51232
51233 var resolvedResult = yield (0, (_gitRefResolver || _load_gitRefResolver()).resolveVersion)({
51234 config: this.config,
51235 git: this,
51236 version,
51237 refs
51238 });
51239 if (!resolvedResult) {
51240 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('couldntFindMatch', version, (0, (_from || _load_from()).default)(refs.keys()).join(','), this.gitUrl.repository));
51241 }
51242
51243 this.hash = resolvedResult.sha;
51244 this.ref = resolvedResult.ref || '';
51245 return this.hash;
51246 });
51247
51248 function setRef(_x13) {
51249 return _ref15.apply(this, arguments);
51250 }
51251
51252 return setRef;
51253 }();
51254
51255 return Git;
51256}();
51257
51258exports.default = Git;
51259
51260/***/ }),
51261/* 206 */
51262/***/ (function(module, exports, __webpack_require__) {
51263
51264"use strict";
51265
51266
51267Object.defineProperty(exports, "__esModule", {
51268 value: true
51269});
51270
51271var _asyncToGenerator2;
51272
51273function _load_asyncToGenerator() {
51274 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
51275}
51276
51277var _resolveRelative;
51278
51279function _load_resolveRelative() {
51280 return _resolveRelative = _interopRequireDefault(__webpack_require__(543));
51281}
51282
51283var _validate;
51284
51285function _load_validate() {
51286 return _validate = _interopRequireDefault(__webpack_require__(119));
51287}
51288
51289var _fix;
51290
51291function _load_fix() {
51292 return _fix = _interopRequireDefault(__webpack_require__(540));
51293}
51294
51295function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
51296
51297var path = __webpack_require__(1);
51298
51299exports.default = function () {
51300 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (info, moduleLoc, config, isRoot) {
51301 // create human readable name
51302 var name = info.name,
51303 version = info.version;
51304
51305 var human = void 0;
51306 if (typeof name === 'string') {
51307 human = name;
51308 }
51309 if (human && typeof version === 'string' && version) {
51310 human += `@${version}`;
51311 }
51312 if (isRoot && info._loc) {
51313 human = path.relative(config.cwd, info._loc);
51314 }
51315
51316 function warn(msg) {
51317 if (human) {
51318 msg = `${human}: ${msg}`;
51319 }
51320 config.reporter.warn(msg);
51321 }
51322
51323 yield (0, (_fix || _load_fix()).default)(info, moduleLoc, config.reporter, warn, config.looseSemver);
51324 (0, (_resolveRelative || _load_resolveRelative()).default)(info, moduleLoc, config.lockfileFolder);
51325
51326 if (config.cwd === config.globalFolder) {
51327 return info;
51328 }
51329
51330 try {
51331 (0, (_validate || _load_validate()).default)(info, isRoot, config.reporter, warn);
51332 } catch (err) {
51333 if (human) {
51334 err.message = `${human}: ${err.message}`;
51335 }
51336 throw err;
51337 }
51338
51339 return info;
51340 });
51341
51342 return function (_x, _x2, _x3, _x4) {
51343 return _ref.apply(this, arguments);
51344 };
51345}();
51346
51347/***/ }),
51348/* 207 */
51349/***/ (function(module, exports, __webpack_require__) {
51350
51351"use strict";
51352
51353
51354Object.defineProperty(exports, "__esModule", {
51355 value: true
51356});
51357exports.isValidLicense = isValidLicense;
51358exports.isValidBin = isValidBin;
51359exports.stringifyPerson = stringifyPerson;
51360exports.parsePerson = parsePerson;
51361exports.normalizePerson = normalizePerson;
51362exports.extractDescription = extractDescription;
51363exports.extractRepositoryUrl = extractRepositoryUrl;
51364
51365
51366var path = __webpack_require__(1);
51367
51368var validateLicense = __webpack_require__(1032);
51369
51370var PARENT_PATH = /^\.\.([\\\/]|$)/;
51371
51372function isValidLicense(license) {
51373 return !!license && validateLicense(license).validForNewPackages;
51374}
51375
51376function isValidBin(bin) {
51377 return !path.isAbsolute(bin) && !PARENT_PATH.test(path.normalize(bin));
51378}
51379
51380function stringifyPerson(person) {
51381 if (!person || typeof person !== 'object') {
51382 return person;
51383 }
51384
51385 var parts = [];
51386 if (person.name) {
51387 parts.push(person.name);
51388 }
51389
51390 var email = person.email || person.mail;
51391 if (typeof email === 'string') {
51392 parts.push(`<${email}>`);
51393 }
51394
51395 var url = person.url || person.web;
51396 if (typeof url === 'string') {
51397 parts.push(`(${url})`);
51398 }
51399
51400 return parts.join(' ');
51401}
51402
51403function parsePerson(person) {
51404 if (typeof person !== 'string') {
51405 return person;
51406 }
51407
51408 // format: name (url) <email>
51409 var obj = {};
51410
51411 var name = person.match(/^([^\(<]+)/);
51412 if (name) {
51413 name = name[0].trim();
51414 if (name) {
51415 obj.name = name;
51416 }
51417 }
51418
51419 var email = person.match(/<([^>]+)>/);
51420 if (email) {
51421 obj.email = email[1];
51422 }
51423
51424 var url = person.match(/\(([^\)]+)\)/);
51425 if (url) {
51426 obj.url = url[1];
51427 }
51428
51429 return obj;
51430}
51431
51432function normalizePerson(person) {
51433 return parsePerson(stringifyPerson(person));
51434}
51435
51436function extractDescription(readme) {
51437 if (typeof readme !== 'string' || readme === '') {
51438 return undefined;
51439 }
51440
51441 // split into lines
51442 var lines = readme.trim().split('\n').map(function (line) {
51443 return line.trim();
51444 });
51445
51446 // find the start of the first paragraph, ignore headings
51447 var start = 0;
51448 for (; start < lines.length; start++) {
51449 var line = lines[start];
51450 if (line && line.match(/^(#|$)/)) {
51451 // line isn't empty and isn't a heading so this is the start of a paragraph
51452 start++;
51453 break;
51454 }
51455 }
51456
51457 // skip newlines from the header to the first line
51458 while (start < lines.length && !lines[start]) {
51459 start++;
51460 }
51461
51462 // continue to the first non empty line
51463 var end = start;
51464 while (end < lines.length && lines[end]) {
51465 end++;
51466 }
51467
51468 return lines.slice(start, end).join(' ');
51469}
51470
51471function extractRepositoryUrl(repository) {
51472 if (!repository || typeof repository !== 'object') {
51473 return repository;
51474 }
51475 return repository.url;
51476}
51477
51478/***/ }),
51479/* 208 */
51480/***/ (function(module, exports, __webpack_require__) {
51481
51482"use strict";
51483
51484
51485Object.defineProperty(exports, "__esModule", {
51486 value: true
51487});
51488exports.getPlatformSpecificPackageFilename = getPlatformSpecificPackageFilename;
51489exports.getSystemParams = getSystemParams;
51490function getPlatformSpecificPackageFilename(pkg) {
51491 // TODO support hash for all subdependencies that have installs scripts
51492 var normalizeScope = function normalizeScope(name) {
51493 return name[0] === '@' ? name.substr(1).replace('/', '-') : name;
51494 };
51495 var suffix = getSystemParams();
51496 return `${normalizeScope(pkg.name)}-v${pkg.version}-${suffix}`;
51497}
51498
51499function getSystemParams() {
51500 // TODO support platform variant for linux
51501 return `${process.platform}-${process.arch}-${process.versions.modules || ''}`;
51502}
51503
51504/***/ }),
51505/* 209 */
51506/***/ (function(module, exports, __webpack_require__) {
51507
51508"use strict";
51509
51510
51511Object.defineProperty(exports, "__esModule", {
51512 value: true
51513});
51514exports.explodeHashedUrl = explodeHashedUrl;
51515function explodeHashedUrl(url) {
51516 var parts = url.split('#');
51517
51518 return {
51519 hash: parts[1] || '',
51520 url: parts[0]
51521 };
51522}
51523
51524/***/ }),
51525/* 210 */
51526/***/ (function(module, exports, __webpack_require__) {
51527
51528module.exports = { "default": __webpack_require__(595), __esModule: true };
51529
51530/***/ }),
51531/* 211 */
51532/***/ (function(module, exports, __webpack_require__) {
51533
51534module.exports = { "default": __webpack_require__(598), __esModule: true };
51535
51536/***/ }),
51537/* 212 */
51538/***/ (function(module, exports) {
51539
51540function Caseless (dict) {
51541 this.dict = dict || {}
51542}
51543Caseless.prototype.set = function (name, value, clobber) {
51544 if (typeof name === 'object') {
51545 for (var i in name) {
51546 this.set(i, name[i], value)
51547 }
51548 } else {
51549 if (typeof clobber === 'undefined') clobber = true
51550 var has = this.has(name)
51551
51552 if (!clobber && has) this.dict[has] = this.dict[has] + ',' + value
51553 else this.dict[has || name] = value
51554 return has
51555 }
51556}
51557Caseless.prototype.has = function (name) {
51558 var keys = Object.keys(this.dict)
51559 , name = name.toLowerCase()
51560 ;
51561 for (var i=0;i<keys.length;i++) {
51562 if (keys[i].toLowerCase() === name) return keys[i]
51563 }
51564 return false
51565}
51566Caseless.prototype.get = function (name) {
51567 name = name.toLowerCase()
51568 var result, _key
51569 var headers = this.dict
51570 Object.keys(headers).forEach(function (key) {
51571 _key = key.toLowerCase()
51572 if (name === _key) result = headers[key]
51573 })
51574 return result
51575}
51576Caseless.prototype.swap = function (name) {
51577 var has = this.has(name)
51578 if (has === name) return
51579 if (!has) throw new Error('There is no header than matches "'+name+'"')
51580 this.dict[name] = this.dict[has]
51581 delete this.dict[has]
51582}
51583Caseless.prototype.del = function (name) {
51584 var has = this.has(name)
51585 return delete this.dict[has || name]
51586}
51587
51588module.exports = function (dict) {return new Caseless(dict)}
51589module.exports.httpify = function (resp, headers) {
51590 var c = new Caseless(headers)
51591 resp.setHeader = function (key, value, clobber) {
51592 if (typeof value === 'undefined') return
51593 return c.set(key, value, clobber)
51594 }
51595 resp.hasHeader = function (key) {
51596 return c.has(key)
51597 }
51598 resp.getHeader = function (key) {
51599 return c.get(key)
51600 }
51601 resp.removeHeader = function (key) {
51602 return c.del(key)
51603 }
51604 resp.headers = c.dict
51605 return c
51606}
51607
51608
51609/***/ }),
51610/* 213 */
51611/***/ (function(module, exports) {
51612
51613module.exports = function (it, Constructor, name, forbiddenField) {
51614 if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
51615 throw TypeError(name + ': incorrect invocation!');
51616 } return it;
51617};
51618
51619
51620/***/ }),
51621/* 214 */
51622/***/ (function(module, exports, __webpack_require__) {
51623
51624// getting tag from 19.1.3.6 Object.prototype.toString()
51625var cof = __webpack_require__(120);
51626var TAG = __webpack_require__(44)('toStringTag');
51627// ES3 wrong here
51628var ARG = cof(function () { return arguments; }()) == 'Arguments';
51629
51630// fallback for IE11 Script Access Denied error
51631var tryGet = function (it, key) {
51632 try {
51633 return it[key];
51634 } catch (e) { /* empty */ }
51635};
51636
51637module.exports = function (it) {
51638 var O, T, B;
51639 return it === undefined ? 'Undefined' : it === null ? 'Null'
51640 // @@toStringTag case
51641 : typeof (T = tryGet(O = Object(it), TAG)) == 'string' ? T
51642 // builtinTag case
51643 : ARG ? cof(O)
51644 // ES3 arguments fallback
51645 : (B = cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
51646};
51647
51648
51649/***/ }),
51650/* 215 */
51651/***/ (function(module, exports) {
51652
51653// 7.2.1 RequireObjectCoercible(argument)
51654module.exports = function (it) {
51655 if (it == undefined) throw TypeError("Can't call method on " + it);
51656 return it;
51657};
51658
51659
51660/***/ }),
51661/* 216 */
51662/***/ (function(module, exports, __webpack_require__) {
51663
51664var isObject = __webpack_require__(49);
51665var document = __webpack_require__(38).document;
51666// typeof document.createElement is 'object' in old IE
51667var is = isObject(document) && isObject(document.createElement);
51668module.exports = function (it) {
51669 return is ? document.createElement(it) : {};
51670};
51671
51672
51673/***/ }),
51674/* 217 */
51675/***/ (function(module, exports) {
51676
51677// IE 8- don't enum bug keys
51678module.exports = (
51679 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
51680).split(',');
51681
51682
51683/***/ }),
51684/* 218 */
51685/***/ (function(module, exports, __webpack_require__) {
51686
51687// fallback for non-array-like ES3 and non-enumerable old V8 strings
51688var cof = __webpack_require__(120);
51689// eslint-disable-next-line no-prototype-builtins
51690module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
51691 return cof(it) == 'String' ? it.split('') : Object(it);
51692};
51693
51694
51695/***/ }),
51696/* 219 */
51697/***/ (function(module, exports, __webpack_require__) {
51698
51699"use strict";
51700
51701var LIBRARY = __webpack_require__(123);
51702var $export = __webpack_require__(33);
51703var redefine = __webpack_require__(342);
51704var hide = __webpack_require__(77);
51705var Iterators = __webpack_require__(122);
51706var $iterCreate = __webpack_require__(614);
51707var setToStringTag = __webpack_require__(127);
51708var getPrototypeOf = __webpack_require__(337);
51709var ITERATOR = __webpack_require__(44)('iterator');
51710var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
51711var FF_ITERATOR = '@@iterator';
51712var KEYS = 'keys';
51713var VALUES = 'values';
51714
51715var returnThis = function () { return this; };
51716
51717module.exports = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
51718 $iterCreate(Constructor, NAME, next);
51719 var getMethod = function (kind) {
51720 if (!BUGGY && kind in proto) return proto[kind];
51721 switch (kind) {
51722 case KEYS: return function keys() { return new Constructor(this, kind); };
51723 case VALUES: return function values() { return new Constructor(this, kind); };
51724 } return function entries() { return new Constructor(this, kind); };
51725 };
51726 var TAG = NAME + ' Iterator';
51727 var DEF_VALUES = DEFAULT == VALUES;
51728 var VALUES_BUG = false;
51729 var proto = Base.prototype;
51730 var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
51731 var $default = $native || getMethod(DEFAULT);
51732 var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
51733 var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
51734 var methods, key, IteratorPrototype;
51735 // Fix native
51736 if ($anyNative) {
51737 IteratorPrototype = getPrototypeOf($anyNative.call(new Base()));
51738 if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
51739 // Set @@toStringTag to native iterators
51740 setToStringTag(IteratorPrototype, TAG, true);
51741 // fix for some old engines
51742 if (!LIBRARY && typeof IteratorPrototype[ITERATOR] != 'function') hide(IteratorPrototype, ITERATOR, returnThis);
51743 }
51744 }
51745 // fix Array#{values, @@iterator}.name in V8 / FF
51746 if (DEF_VALUES && $native && $native.name !== VALUES) {
51747 VALUES_BUG = true;
51748 $default = function values() { return $native.call(this); };
51749 }
51750 // Define iterator
51751 if ((!LIBRARY || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
51752 hide(proto, ITERATOR, $default);
51753 }
51754 // Plug for library
51755 Iterators[NAME] = $default;
51756 Iterators[TAG] = returnThis;
51757 if (DEFAULT) {
51758 methods = {
51759 values: DEF_VALUES ? $default : getMethod(VALUES),
51760 keys: IS_SET ? $default : getMethod(KEYS),
51761 entries: $entries
51762 };
51763 if (FORCED) for (key in methods) {
51764 if (!(key in proto)) redefine(proto, key, methods[key]);
51765 } else $export($export.P + $export.F * (BUGGY || VALUES_BUG), NAME, methods);
51766 }
51767 return methods;
51768};
51769
51770
51771/***/ }),
51772/* 220 */
51773/***/ (function(module, exports, __webpack_require__) {
51774
51775var META = __webpack_require__(162)('meta');
51776var isObject = __webpack_require__(49);
51777var has = __webpack_require__(89);
51778var setDesc = __webpack_require__(63).f;
51779var id = 0;
51780var isExtensible = Object.isExtensible || function () {
51781 return true;
51782};
51783var FREEZE = !__webpack_require__(76)(function () {
51784 return isExtensible(Object.preventExtensions({}));
51785});
51786var setMeta = function (it) {
51787 setDesc(it, META, { value: {
51788 i: 'O' + ++id, // object ID
51789 w: {} // weak collections IDs
51790 } });
51791};
51792var fastKey = function (it, create) {
51793 // return primitive with prefix
51794 if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
51795 if (!has(it, META)) {
51796 // can't set metadata to uncaught frozen object
51797 if (!isExtensible(it)) return 'F';
51798 // not necessary to add metadata
51799 if (!create) return 'E';
51800 // add missing metadata
51801 setMeta(it);
51802 // return object ID
51803 } return it[META].i;
51804};
51805var getWeak = function (it, create) {
51806 if (!has(it, META)) {
51807 // can't set metadata to uncaught frozen object
51808 if (!isExtensible(it)) return true;
51809 // not necessary to add metadata
51810 if (!create) return false;
51811 // add missing metadata
51812 setMeta(it);
51813 // return hash weak collections IDs
51814 } return it[META].w;
51815};
51816// add metadata on freeze-family methods calling
51817var onFreeze = function (it) {
51818 if (FREEZE && meta.NEED && isExtensible(it) && !has(it, META)) setMeta(it);
51819 return it;
51820};
51821var meta = module.exports = {
51822 KEY: META,
51823 NEED: false,
51824 fastKey: fastKey,
51825 getWeak: getWeak,
51826 onFreeze: onFreeze
51827};
51828
51829
51830/***/ }),
51831/* 221 */
51832/***/ (function(module, exports, __webpack_require__) {
51833
51834"use strict";
51835
51836// 25.4.1.5 NewPromiseCapability(C)
51837var aFunction = __webpack_require__(88);
51838
51839function PromiseCapability(C) {
51840 var resolve, reject;
51841 this.promise = new C(function ($$resolve, $$reject) {
51842 if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
51843 resolve = $$resolve;
51844 reject = $$reject;
51845 });
51846 this.resolve = aFunction(resolve);
51847 this.reject = aFunction(reject);
51848}
51849
51850module.exports.f = function (C) {
51851 return new PromiseCapability(C);
51852};
51853
51854
51855/***/ }),
51856/* 222 */
51857/***/ (function(module, exports) {
51858
51859exports.f = Object.getOwnPropertySymbols;
51860
51861
51862/***/ }),
51863/* 223 */
51864/***/ (function(module, exports, __webpack_require__) {
51865
51866var hide = __webpack_require__(77);
51867module.exports = function (target, src, safe) {
51868 for (var key in src) {
51869 if (safe && target[key]) target[key] = src[key];
51870 else hide(target, key, src[key]);
51871 } return target;
51872};
51873
51874
51875/***/ }),
51876/* 224 */
51877/***/ (function(module, exports, __webpack_require__) {
51878
51879var shared = __webpack_require__(225)('keys');
51880var uid = __webpack_require__(162);
51881module.exports = function (key) {
51882 return shared[key] || (shared[key] = uid(key));
51883};
51884
51885
51886/***/ }),
51887/* 225 */
51888/***/ (function(module, exports, __webpack_require__) {
51889
51890var core = __webpack_require__(26);
51891var global = __webpack_require__(38);
51892var SHARED = '__core-js_shared__';
51893var store = global[SHARED] || (global[SHARED] = {});
51894
51895(module.exports = function (key, value) {
51896 return store[key] || (store[key] = value !== undefined ? value : {});
51897})('versions', []).push({
51898 version: core.version,
51899 mode: __webpack_require__(123) ? 'pure' : 'global',
51900 copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
51901});
51902
51903
51904/***/ }),
51905/* 226 */
51906/***/ (function(module, exports) {
51907
51908// 7.1.4 ToInteger
51909var ceil = Math.ceil;
51910var floor = Math.floor;
51911module.exports = function (it) {
51912 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
51913};
51914
51915
51916/***/ }),
51917/* 227 */
51918/***/ (function(module, exports, __webpack_require__) {
51919
51920// 7.1.1 ToPrimitive(input [, PreferredType])
51921var isObject = __webpack_require__(49);
51922// instead of the ES6 spec version, we didn't implement @@toPrimitive case
51923// and the second argument - flag - preferred type is a string
51924module.exports = function (it, S) {
51925 if (!isObject(it)) return it;
51926 var fn, val;
51927 if (S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
51928 if (typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it))) return val;
51929 if (!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it))) return val;
51930 throw TypeError("Can't convert object to primitive value");
51931};
51932
51933
51934/***/ }),
51935/* 228 */
51936/***/ (function(module, exports, __webpack_require__) {
51937
51938var isObject = __webpack_require__(49);
51939module.exports = function (it, TYPE) {
51940 if (!isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
51941 return it;
51942};
51943
51944
51945/***/ }),
51946/* 229 */
51947/***/ (function(module, exports, __webpack_require__) {
51948
51949var global = __webpack_require__(38);
51950var core = __webpack_require__(26);
51951var LIBRARY = __webpack_require__(123);
51952var wksExt = __webpack_require__(230);
51953var defineProperty = __webpack_require__(63).f;
51954module.exports = function (name) {
51955 var $Symbol = core.Symbol || (core.Symbol = LIBRARY ? {} : global.Symbol || {});
51956 if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: wksExt.f(name) });
51957};
51958
51959
51960/***/ }),
51961/* 230 */
51962/***/ (function(module, exports, __webpack_require__) {
51963
51964exports.f = __webpack_require__(44);
51965
51966
51967/***/ }),
51968/* 231 */
51969/***/ (function(module, exports, __webpack_require__) {
51970
51971var classof = __webpack_require__(214);
51972var ITERATOR = __webpack_require__(44)('iterator');
51973var Iterators = __webpack_require__(122);
51974module.exports = __webpack_require__(26).getIteratorMethod = function (it) {
51975 if (it != undefined) return it[ITERATOR]
51976 || it['@@iterator']
51977 || Iterators[classof(it)];
51978};
51979
51980
51981/***/ }),
51982/* 232 */
51983/***/ (function(module, exports, __webpack_require__) {
51984
51985"use strict";
51986
51987
51988var hasOwn = Object.prototype.hasOwnProperty;
51989var toStr = Object.prototype.toString;
51990var defineProperty = Object.defineProperty;
51991var gOPD = Object.getOwnPropertyDescriptor;
51992
51993var isArray = function isArray(arr) {
51994 if (typeof Array.isArray === 'function') {
51995 return Array.isArray(arr);
51996 }
51997
51998 return toStr.call(arr) === '[object Array]';
51999};
52000
52001var isPlainObject = function isPlainObject(obj) {
52002 if (!obj || toStr.call(obj) !== '[object Object]') {
52003 return false;
52004 }
52005
52006 var hasOwnConstructor = hasOwn.call(obj, 'constructor');
52007 var hasIsPrototypeOf = obj.constructor && obj.constructor.prototype && hasOwn.call(obj.constructor.prototype, 'isPrototypeOf');
52008 // Not own constructor property must be Object
52009 if (obj.constructor && !hasOwnConstructor && !hasIsPrototypeOf) {
52010 return false;
52011 }
52012
52013 // Own properties are enumerated firstly, so to speed up,
52014 // if last one is own, then all properties are own.
52015 var key;
52016 for (key in obj) { /**/ }
52017
52018 return typeof key === 'undefined' || hasOwn.call(obj, key);
52019};
52020
52021// If name is '__proto__', and Object.defineProperty is available, define __proto__ as an own property on target
52022var setProperty = function setProperty(target, options) {
52023 if (defineProperty && options.name === '__proto__') {
52024 defineProperty(target, options.name, {
52025 enumerable: true,
52026 configurable: true,
52027 value: options.newValue,
52028 writable: true
52029 });
52030 } else {
52031 target[options.name] = options.newValue;
52032 }
52033};
52034
52035// Return undefined instead of __proto__ if '__proto__' is not an own property
52036var getProperty = function getProperty(obj, name) {
52037 if (name === '__proto__') {
52038 if (!hasOwn.call(obj, name)) {
52039 return void 0;
52040 } else if (gOPD) {
52041 // In early versions of node, obj['__proto__'] is buggy when obj has
52042 // __proto__ as an own property. Object.getOwnPropertyDescriptor() works.
52043 return gOPD(obj, name).value;
52044 }
52045 }
52046
52047 return obj[name];
52048};
52049
52050module.exports = function extend() {
52051 var options, name, src, copy, copyIsArray, clone;
52052 var target = arguments[0];
52053 var i = 1;
52054 var length = arguments.length;
52055 var deep = false;
52056
52057 // Handle a deep copy situation
52058 if (typeof target === 'boolean') {
52059 deep = target;
52060 target = arguments[1] || {};
52061 // skip the boolean and the target
52062 i = 2;
52063 }
52064 if (target == null || (typeof target !== 'object' && typeof target !== 'function')) {
52065 target = {};
52066 }
52067
52068 for (; i < length; ++i) {
52069 options = arguments[i];
52070 // Only deal with non-null/undefined values
52071 if (options != null) {
52072 // Extend the base object
52073 for (name in options) {
52074 src = getProperty(target, name);
52075 copy = getProperty(options, name);
52076
52077 // Prevent never-ending loop
52078 if (target !== copy) {
52079 // Recurse if we're merging plain objects or arrays
52080 if (deep && copy && (isPlainObject(copy) || (copyIsArray = isArray(copy)))) {
52081 if (copyIsArray) {
52082 copyIsArray = false;
52083 clone = src && isArray(src) ? src : [];
52084 } else {
52085 clone = src && isPlainObject(src) ? src : {};
52086 }
52087
52088 // Never move original objects, clone them
52089 setProperty(target, { name: name, newValue: extend(deep, clone, copy) });
52090
52091 // Don't bring in undefined values
52092 } else if (typeof copy !== 'undefined') {
52093 setProperty(target, { name: name, newValue: copy });
52094 }
52095 }
52096 }
52097 }
52098 }
52099
52100 // Return the modified object
52101 return target;
52102};
52103
52104
52105/***/ }),
52106/* 233 */
52107/***/ (function(module, exports, __webpack_require__) {
52108
52109"use strict";
52110
52111const escapeStringRegexp = __webpack_require__(351);
52112
52113const platform = process.platform;
52114
52115const main = {
52116 tick: '✔',
52117 cross: '✖',
52118 star: '★',
52119 square: '▇',
52120 squareSmall: '◻',
52121 squareSmallFilled: '◼',
52122 play: '▶',
52123 circle: '◯',
52124 circleFilled: '◉',
52125 circleDotted: '◌',
52126 circleDouble: '◎',
52127 circleCircle: 'ⓞ',
52128 circleCross: 'ⓧ',
52129 circlePipe: 'Ⓘ',
52130 circleQuestionMark: '?⃝',
52131 bullet: '●',
52132 dot: '․',
52133 line: '─',
52134 ellipsis: '…',
52135 pointer: '❯',
52136 pointerSmall: '›',
52137 info: 'ℹ',
52138 warning: '⚠',
52139 hamburger: '☰',
52140 smiley: '㋡',
52141 mustache: '෴',
52142 heart: '♥',
52143 arrowUp: '↑',
52144 arrowDown: '↓',
52145 arrowLeft: '←',
52146 arrowRight: '→',
52147 radioOn: '◉',
52148 radioOff: '◯',
52149 checkboxOn: '☒',
52150 checkboxOff: '☐',
52151 checkboxCircleOn: 'ⓧ',
52152 checkboxCircleOff: 'Ⓘ',
52153 questionMarkPrefix: '?⃝',
52154 oneHalf: '½',
52155 oneThird: '⅓',
52156 oneQuarter: '¼',
52157 oneFifth: '⅕',
52158 oneSixth: '⅙',
52159 oneSeventh: '⅐',
52160 oneEighth: '⅛',
52161 oneNinth: '⅑',
52162 oneTenth: '⅒',
52163 twoThirds: '⅔',
52164 twoFifths: '⅖',
52165 threeQuarters: '¾',
52166 threeFifths: '⅗',
52167 threeEighths: '⅜',
52168 fourFifths: '⅘',
52169 fiveSixths: '⅚',
52170 fiveEighths: '⅝',
52171 sevenEighths: '⅞'
52172};
52173
52174const win = {
52175 tick: '√',
52176 cross: '×',
52177 star: '*',
52178 square: '█',
52179 squareSmall: '[ ]',
52180 squareSmallFilled: '[█]',
52181 play: '►',
52182 circle: '( )',
52183 circleFilled: '(*)',
52184 circleDotted: '( )',
52185 circleDouble: '( )',
52186 circleCircle: '(○)',
52187 circleCross: '(×)',
52188 circlePipe: '(│)',
52189 circleQuestionMark: '(?)',
52190 bullet: '*',
52191 dot: '.',
52192 line: '─',
52193 ellipsis: '...',
52194 pointer: '>',
52195 pointerSmall: '»',
52196 info: 'i',
52197 warning: '‼',
52198 hamburger: '≡',
52199 smiley: '☺',
52200 mustache: '┌─┐',
52201 heart: main.heart,
52202 arrowUp: main.arrowUp,
52203 arrowDown: main.arrowDown,
52204 arrowLeft: main.arrowLeft,
52205 arrowRight: main.arrowRight,
52206 radioOn: '(*)',
52207 radioOff: '( )',
52208 checkboxOn: '[×]',
52209 checkboxOff: '[ ]',
52210 checkboxCircleOn: '(×)',
52211 checkboxCircleOff: '( )',
52212 questionMarkPrefix: '?',
52213 oneHalf: '1/2',
52214 oneThird: '1/3',
52215 oneQuarter: '1/4',
52216 oneFifth: '1/5',
52217 oneSixth: '1/6',
52218 oneSeventh: '1/7',
52219 oneEighth: '1/8',
52220 oneNinth: '1/9',
52221 oneTenth: '1/10',
52222 twoThirds: '2/3',
52223 twoFifths: '2/5',
52224 threeQuarters: '3/4',
52225 threeFifths: '3/5',
52226 threeEighths: '3/8',
52227 fourFifths: '4/5',
52228 fiveSixths: '5/6',
52229 fiveEighths: '5/8',
52230 sevenEighths: '7/8'
52231};
52232
52233if (platform === 'linux') {
52234 // the main one doesn't look that good on Ubuntu
52235 main.questionMarkPrefix = '?';
52236}
52237
52238const figures = platform === 'win32' ? win : main;
52239
52240const fn = str => {
52241 if (figures === main) {
52242 return str;
52243 }
52244
52245 Object.keys(main).forEach(key => {
52246 if (main[key] === figures[key]) {
52247 return;
52248 }
52249
52250 str = str.replace(new RegExp(escapeStringRegexp(main[key]), 'g'), figures[key]);
52251 });
52252
52253 return str;
52254};
52255
52256module.exports = Object.assign(fn, figures);
52257
52258
52259/***/ }),
52260/* 234 */
52261/***/ (function(module, exports, __webpack_require__) {
52262
52263// Approach:
52264//
52265// 1. Get the minimatch set
52266// 2. For each pattern in the set, PROCESS(pattern, false)
52267// 3. Store matches per-set, then uniq them
52268//
52269// PROCESS(pattern, inGlobStar)
52270// Get the first [n] items from pattern that are all strings
52271// Join these together. This is PREFIX.
52272// If there is no more remaining, then stat(PREFIX) and
52273// add to matches if it succeeds. END.
52274//
52275// If inGlobStar and PREFIX is symlink and points to dir
52276// set ENTRIES = []
52277// else readdir(PREFIX) as ENTRIES
52278// If fail, END
52279//
52280// with ENTRIES
52281// If pattern[n] is GLOBSTAR
52282// // handle the case where the globstar match is empty
52283// // by pruning it out, and testing the resulting pattern
52284// PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
52285// // handle other cases.
52286// for ENTRY in ENTRIES (not dotfiles)
52287// // attach globstar + tail onto the entry
52288// // Mark that this entry is a globstar match
52289// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
52290//
52291// else // not globstar
52292// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
52293// Test ENTRY against pattern[n]
52294// If fails, continue
52295// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
52296//
52297// Caveat:
52298// Cache all stats and readdirs results to minimize syscall. Since all
52299// we ever care about is existence and directory-ness, we can just keep
52300// `true` for files, and [children,...] for directories, or `false` for
52301// things that don't exist.
52302
52303module.exports = glob
52304
52305var fs = __webpack_require__(12)
52306var rp = __webpack_require__(353)
52307var minimatch = __webpack_require__(170)
52308var Minimatch = minimatch.Minimatch
52309var inherits = __webpack_require__(78)
52310var EE = __webpack_require__(95).EventEmitter
52311var path = __webpack_require__(1)
52312var assert = __webpack_require__(50)
52313var isAbsolute = __webpack_require__(245)
52314var globSync = __webpack_require__(679)
52315var common = __webpack_require__(354)
52316var alphasort = common.alphasort
52317var alphasorti = common.alphasorti
52318var setopts = common.setopts
52319var ownProp = common.ownProp
52320var inflight = __webpack_require__(745)
52321var util = __webpack_require__(9)
52322var childrenIgnored = common.childrenIgnored
52323var isIgnored = common.isIgnored
52324
52325var once = __webpack_require__(133)
52326
52327function glob (pattern, options, cb) {
52328 if (typeof options === 'function') cb = options, options = {}
52329 if (!options) options = {}
52330
52331 if (options.sync) {
52332 if (cb)
52333 throw new TypeError('callback provided to sync glob')
52334 return globSync(pattern, options)
52335 }
52336
52337 return new Glob(pattern, options, cb)
52338}
52339
52340glob.sync = globSync
52341var GlobSync = glob.GlobSync = globSync.GlobSync
52342
52343// old api surface
52344glob.glob = glob
52345
52346function extend (origin, add) {
52347 if (add === null || typeof add !== 'object') {
52348 return origin
52349 }
52350
52351 var keys = Object.keys(add)
52352 var i = keys.length
52353 while (i--) {
52354 origin[keys[i]] = add[keys[i]]
52355 }
52356 return origin
52357}
52358
52359glob.hasMagic = function (pattern, options_) {
52360 var options = extend({}, options_)
52361 options.noprocess = true
52362
52363 var g = new Glob(pattern, options)
52364 var set = g.minimatch.set
52365
52366 if (!pattern)
52367 return false
52368
52369 if (set.length > 1)
52370 return true
52371
52372 for (var j = 0; j < set[0].length; j++) {
52373 if (typeof set[0][j] !== 'string')
52374 return true
52375 }
52376
52377 return false
52378}
52379
52380glob.Glob = Glob
52381inherits(Glob, EE)
52382function Glob (pattern, options, cb) {
52383 if (typeof options === 'function') {
52384 cb = options
52385 options = null
52386 }
52387
52388 if (options && options.sync) {
52389 if (cb)
52390 throw new TypeError('callback provided to sync glob')
52391 return new GlobSync(pattern, options)
52392 }
52393
52394 if (!(this instanceof Glob))
52395 return new Glob(pattern, options, cb)
52396
52397 setopts(this, pattern, options)
52398 this._didRealPath = false
52399
52400 // process each pattern in the minimatch set
52401 var n = this.minimatch.set.length
52402
52403 // The matches are stored as {<filename>: true,...} so that
52404 // duplicates are automagically pruned.
52405 // Later, we do an Object.keys() on these.
52406 // Keep them as a list so we can fill in when nonull is set.
52407 this.matches = new Array(n)
52408
52409 if (typeof cb === 'function') {
52410 cb = once(cb)
52411 this.on('error', cb)
52412 this.on('end', function (matches) {
52413 cb(null, matches)
52414 })
52415 }
52416
52417 var self = this
52418 this._processing = 0
52419
52420 this._emitQueue = []
52421 this._processQueue = []
52422 this.paused = false
52423
52424 if (this.noprocess)
52425 return this
52426
52427 if (n === 0)
52428 return done()
52429
52430 var sync = true
52431 for (var i = 0; i < n; i ++) {
52432 this._process(this.minimatch.set[i], i, false, done)
52433 }
52434 sync = false
52435
52436 function done () {
52437 --self._processing
52438 if (self._processing <= 0) {
52439 if (sync) {
52440 process.nextTick(function () {
52441 self._finish()
52442 })
52443 } else {
52444 self._finish()
52445 }
52446 }
52447 }
52448}
52449
52450Glob.prototype._finish = function () {
52451 assert(this instanceof Glob)
52452 if (this.aborted)
52453 return
52454
52455 if (this.realpath && !this._didRealpath)
52456 return this._realpath()
52457
52458 common.finish(this)
52459 this.emit('end', this.found)
52460}
52461
52462Glob.prototype._realpath = function () {
52463 if (this._didRealpath)
52464 return
52465
52466 this._didRealpath = true
52467
52468 var n = this.matches.length
52469 if (n === 0)
52470 return this._finish()
52471
52472 var self = this
52473 for (var i = 0; i < this.matches.length; i++)
52474 this._realpathSet(i, next)
52475
52476 function next () {
52477 if (--n === 0)
52478 self._finish()
52479 }
52480}
52481
52482Glob.prototype._realpathSet = function (index, cb) {
52483 var matchset = this.matches[index]
52484 if (!matchset)
52485 return cb()
52486
52487 var found = Object.keys(matchset)
52488 var self = this
52489 var n = found.length
52490
52491 if (n === 0)
52492 return cb()
52493
52494 var set = this.matches[index] = Object.create(null)
52495 found.forEach(function (p, i) {
52496 // If there's a problem with the stat, then it means that
52497 // one or more of the links in the realpath couldn't be
52498 // resolved. just return the abs value in that case.
52499 p = self._makeAbs(p)
52500 rp.realpath(p, self.realpathCache, function (er, real) {
52501 if (!er)
52502 set[real] = true
52503 else if (er.syscall === 'stat')
52504 set[p] = true
52505 else
52506 self.emit('error', er) // srsly wtf right here
52507
52508 if (--n === 0) {
52509 self.matches[index] = set
52510 cb()
52511 }
52512 })
52513 })
52514}
52515
52516Glob.prototype._mark = function (p) {
52517 return common.mark(this, p)
52518}
52519
52520Glob.prototype._makeAbs = function (f) {
52521 return common.makeAbs(this, f)
52522}
52523
52524Glob.prototype.abort = function () {
52525 this.aborted = true
52526 this.emit('abort')
52527}
52528
52529Glob.prototype.pause = function () {
52530 if (!this.paused) {
52531 this.paused = true
52532 this.emit('pause')
52533 }
52534}
52535
52536Glob.prototype.resume = function () {
52537 if (this.paused) {
52538 this.emit('resume')
52539 this.paused = false
52540 if (this._emitQueue.length) {
52541 var eq = this._emitQueue.slice(0)
52542 this._emitQueue.length = 0
52543 for (var i = 0; i < eq.length; i ++) {
52544 var e = eq[i]
52545 this._emitMatch(e[0], e[1])
52546 }
52547 }
52548 if (this._processQueue.length) {
52549 var pq = this._processQueue.slice(0)
52550 this._processQueue.length = 0
52551 for (var i = 0; i < pq.length; i ++) {
52552 var p = pq[i]
52553 this._processing--
52554 this._process(p[0], p[1], p[2], p[3])
52555 }
52556 }
52557 }
52558}
52559
52560Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
52561 assert(this instanceof Glob)
52562 assert(typeof cb === 'function')
52563
52564 if (this.aborted)
52565 return
52566
52567 this._processing++
52568 if (this.paused) {
52569 this._processQueue.push([pattern, index, inGlobStar, cb])
52570 return
52571 }
52572
52573 //console.error('PROCESS %d', this._processing, pattern)
52574
52575 // Get the first [n] parts of pattern that are all strings.
52576 var n = 0
52577 while (typeof pattern[n] === 'string') {
52578 n ++
52579 }
52580 // now n is the index of the first one that is *not* a string.
52581
52582 // see if there's anything else
52583 var prefix
52584 switch (n) {
52585 // if not, then this is rather simple
52586 case pattern.length:
52587 this._processSimple(pattern.join('/'), index, cb)
52588 return
52589
52590 case 0:
52591 // pattern *starts* with some non-trivial item.
52592 // going to readdir(cwd), but not include the prefix in matches.
52593 prefix = null
52594 break
52595
52596 default:
52597 // pattern has some string bits in the front.
52598 // whatever it starts with, whether that's 'absolute' like /foo/bar,
52599 // or 'relative' like '../baz'
52600 prefix = pattern.slice(0, n).join('/')
52601 break
52602 }
52603
52604 var remain = pattern.slice(n)
52605
52606 // get the list of entries.
52607 var read
52608 if (prefix === null)
52609 read = '.'
52610 else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
52611 if (!prefix || !isAbsolute(prefix))
52612 prefix = '/' + prefix
52613 read = prefix
52614 } else
52615 read = prefix
52616
52617 var abs = this._makeAbs(read)
52618
52619 //if ignored, skip _processing
52620 if (childrenIgnored(this, read))
52621 return cb()
52622
52623 var isGlobStar = remain[0] === minimatch.GLOBSTAR
52624 if (isGlobStar)
52625 this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
52626 else
52627 this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
52628}
52629
52630Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
52631 var self = this
52632 this._readdir(abs, inGlobStar, function (er, entries) {
52633 return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
52634 })
52635}
52636
52637Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
52638
52639 // if the abs isn't a dir, then nothing can match!
52640 if (!entries)
52641 return cb()
52642
52643 // It will only match dot entries if it starts with a dot, or if
52644 // dot is set. Stuff like @(.foo|.bar) isn't allowed.
52645 var pn = remain[0]
52646 var negate = !!this.minimatch.negate
52647 var rawGlob = pn._glob
52648 var dotOk = this.dot || rawGlob.charAt(0) === '.'
52649
52650 var matchedEntries = []
52651 for (var i = 0; i < entries.length; i++) {
52652 var e = entries[i]
52653 if (e.charAt(0) !== '.' || dotOk) {
52654 var m
52655 if (negate && !prefix) {
52656 m = !e.match(pn)
52657 } else {
52658 m = e.match(pn)
52659 }
52660 if (m)
52661 matchedEntries.push(e)
52662 }
52663 }
52664
52665 //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
52666
52667 var len = matchedEntries.length
52668 // If there are no matched entries, then nothing matches.
52669 if (len === 0)
52670 return cb()
52671
52672 // if this is the last remaining pattern bit, then no need for
52673 // an additional stat *unless* the user has specified mark or
52674 // stat explicitly. We know they exist, since readdir returned
52675 // them.
52676
52677 if (remain.length === 1 && !this.mark && !this.stat) {
52678 if (!this.matches[index])
52679 this.matches[index] = Object.create(null)
52680
52681 for (var i = 0; i < len; i ++) {
52682 var e = matchedEntries[i]
52683 if (prefix) {
52684 if (prefix !== '/')
52685 e = prefix + '/' + e
52686 else
52687 e = prefix + e
52688 }
52689
52690 if (e.charAt(0) === '/' && !this.nomount) {
52691 e = path.join(this.root, e)
52692 }
52693 this._emitMatch(index, e)
52694 }
52695 // This was the last one, and no stats were needed
52696 return cb()
52697 }
52698
52699 // now test all matched entries as stand-ins for that part
52700 // of the pattern.
52701 remain.shift()
52702 for (var i = 0; i < len; i ++) {
52703 var e = matchedEntries[i]
52704 var newPattern
52705 if (prefix) {
52706 if (prefix !== '/')
52707 e = prefix + '/' + e
52708 else
52709 e = prefix + e
52710 }
52711 this._process([e].concat(remain), index, inGlobStar, cb)
52712 }
52713 cb()
52714}
52715
52716Glob.prototype._emitMatch = function (index, e) {
52717 if (this.aborted)
52718 return
52719
52720 if (isIgnored(this, e))
52721 return
52722
52723 if (this.paused) {
52724 this._emitQueue.push([index, e])
52725 return
52726 }
52727
52728 var abs = isAbsolute(e) ? e : this._makeAbs(e)
52729
52730 if (this.mark)
52731 e = this._mark(e)
52732
52733 if (this.absolute)
52734 e = abs
52735
52736 if (this.matches[index][e])
52737 return
52738
52739 if (this.nodir) {
52740 var c = this.cache[abs]
52741 if (c === 'DIR' || Array.isArray(c))
52742 return
52743 }
52744
52745 this.matches[index][e] = true
52746
52747 var st = this.statCache[abs]
52748 if (st)
52749 this.emit('stat', e, st)
52750
52751 this.emit('match', e)
52752}
52753
52754Glob.prototype._readdirInGlobStar = function (abs, cb) {
52755 if (this.aborted)
52756 return
52757
52758 // follow all symlinked directories forever
52759 // just proceed as if this is a non-globstar situation
52760 if (this.follow)
52761 return this._readdir(abs, false, cb)
52762
52763 var lstatkey = 'lstat\0' + abs
52764 var self = this
52765 var lstatcb = inflight(lstatkey, lstatcb_)
52766
52767 if (lstatcb)
52768 fs.lstat(abs, lstatcb)
52769
52770 function lstatcb_ (er, lstat) {
52771 if (er && er.code === 'ENOENT')
52772 return cb()
52773
52774 var isSym = lstat && lstat.isSymbolicLink()
52775 self.symlinks[abs] = isSym
52776
52777 // If it's not a symlink or a dir, then it's definitely a regular file.
52778 // don't bother doing a readdir in that case.
52779 if (!isSym && lstat && !lstat.isDirectory()) {
52780 self.cache[abs] = 'FILE'
52781 cb()
52782 } else
52783 self._readdir(abs, false, cb)
52784 }
52785}
52786
52787Glob.prototype._readdir = function (abs, inGlobStar, cb) {
52788 if (this.aborted)
52789 return
52790
52791 cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
52792 if (!cb)
52793 return
52794
52795 //console.error('RD %j %j', +inGlobStar, abs)
52796 if (inGlobStar && !ownProp(this.symlinks, abs))
52797 return this._readdirInGlobStar(abs, cb)
52798
52799 if (ownProp(this.cache, abs)) {
52800 var c = this.cache[abs]
52801 if (!c || c === 'FILE')
52802 return cb()
52803
52804 if (Array.isArray(c))
52805 return cb(null, c)
52806 }
52807
52808 var self = this
52809 fs.readdir(abs, readdirCb(this, abs, cb))
52810}
52811
52812function readdirCb (self, abs, cb) {
52813 return function (er, entries) {
52814 if (er)
52815 self._readdirError(abs, er, cb)
52816 else
52817 self._readdirEntries(abs, entries, cb)
52818 }
52819}
52820
52821Glob.prototype._readdirEntries = function (abs, entries, cb) {
52822 if (this.aborted)
52823 return
52824
52825 // if we haven't asked to stat everything, then just
52826 // assume that everything in there exists, so we can avoid
52827 // having to stat it a second time.
52828 if (!this.mark && !this.stat) {
52829 for (var i = 0; i < entries.length; i ++) {
52830 var e = entries[i]
52831 if (abs === '/')
52832 e = abs + e
52833 else
52834 e = abs + '/' + e
52835 this.cache[e] = true
52836 }
52837 }
52838
52839 this.cache[abs] = entries
52840 return cb(null, entries)
52841}
52842
52843Glob.prototype._readdirError = function (f, er, cb) {
52844 if (this.aborted)
52845 return
52846
52847 // handle errors, and cache the information
52848 switch (er.code) {
52849 case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
52850 case 'ENOTDIR': // totally normal. means it *does* exist.
52851 var abs = this._makeAbs(f)
52852 this.cache[abs] = 'FILE'
52853 if (abs === this.cwdAbs) {
52854 var error = new Error(er.code + ' invalid cwd ' + this.cwd)
52855 error.path = this.cwd
52856 error.code = er.code
52857 this.emit('error', error)
52858 this.abort()
52859 }
52860 break
52861
52862 case 'ENOENT': // not terribly unusual
52863 case 'ELOOP':
52864 case 'ENAMETOOLONG':
52865 case 'UNKNOWN':
52866 this.cache[this._makeAbs(f)] = false
52867 break
52868
52869 default: // some unusual error. Treat as failure.
52870 this.cache[this._makeAbs(f)] = false
52871 if (this.strict) {
52872 this.emit('error', er)
52873 // If the error is handled, then we abort
52874 // if not, we threw out of here
52875 this.abort()
52876 }
52877 if (!this.silent)
52878 console.error('glob error', er)
52879 break
52880 }
52881
52882 return cb()
52883}
52884
52885Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
52886 var self = this
52887 this._readdir(abs, inGlobStar, function (er, entries) {
52888 self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
52889 })
52890}
52891
52892
52893Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
52894 //console.error('pgs2', prefix, remain[0], entries)
52895
52896 // no entries means not a dir, so it can never have matches
52897 // foo.txt/** doesn't match foo.txt
52898 if (!entries)
52899 return cb()
52900
52901 // test without the globstar, and with every child both below
52902 // and replacing the globstar.
52903 var remainWithoutGlobStar = remain.slice(1)
52904 var gspref = prefix ? [ prefix ] : []
52905 var noGlobStar = gspref.concat(remainWithoutGlobStar)
52906
52907 // the noGlobStar pattern exits the inGlobStar state
52908 this._process(noGlobStar, index, false, cb)
52909
52910 var isSym = this.symlinks[abs]
52911 var len = entries.length
52912
52913 // If it's a symlink, and we're in a globstar, then stop
52914 if (isSym && inGlobStar)
52915 return cb()
52916
52917 for (var i = 0; i < len; i++) {
52918 var e = entries[i]
52919 if (e.charAt(0) === '.' && !this.dot)
52920 continue
52921
52922 // these two cases enter the inGlobStar state
52923 var instead = gspref.concat(entries[i], remainWithoutGlobStar)
52924 this._process(instead, index, true, cb)
52925
52926 var below = gspref.concat(entries[i], remain)
52927 this._process(below, index, true, cb)
52928 }
52929
52930 cb()
52931}
52932
52933Glob.prototype._processSimple = function (prefix, index, cb) {
52934 // XXX review this. Shouldn't it be doing the mounting etc
52935 // before doing stat? kinda weird?
52936 var self = this
52937 this._stat(prefix, function (er, exists) {
52938 self._processSimple2(prefix, index, er, exists, cb)
52939 })
52940}
52941Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
52942
52943 //console.error('ps2', prefix, exists)
52944
52945 if (!this.matches[index])
52946 this.matches[index] = Object.create(null)
52947
52948 // If it doesn't exist, then just mark the lack of results
52949 if (!exists)
52950 return cb()
52951
52952 if (prefix && isAbsolute(prefix) && !this.nomount) {
52953 var trail = /[\/\\]$/.test(prefix)
52954 if (prefix.charAt(0) === '/') {
52955 prefix = path.join(this.root, prefix)
52956 } else {
52957 prefix = path.resolve(this.root, prefix)
52958 if (trail)
52959 prefix += '/'
52960 }
52961 }
52962
52963 if (process.platform === 'win32')
52964 prefix = prefix.replace(/\\/g, '/')
52965
52966 // Mark this as a match
52967 this._emitMatch(index, prefix)
52968 cb()
52969}
52970
52971// Returns either 'DIR', 'FILE', or false
52972Glob.prototype._stat = function (f, cb) {
52973 var abs = this._makeAbs(f)
52974 var needDir = f.slice(-1) === '/'
52975
52976 if (f.length > this.maxLength)
52977 return cb()
52978
52979 if (!this.stat && ownProp(this.cache, abs)) {
52980 var c = this.cache[abs]
52981
52982 if (Array.isArray(c))
52983 c = 'DIR'
52984
52985 // It exists, but maybe not how we need it
52986 if (!needDir || c === 'DIR')
52987 return cb(null, c)
52988
52989 if (needDir && c === 'FILE')
52990 return cb()
52991
52992 // otherwise we have to stat, because maybe c=true
52993 // if we know it exists, but not what it is.
52994 }
52995
52996 var exists
52997 var stat = this.statCache[abs]
52998 if (stat !== undefined) {
52999 if (stat === false)
53000 return cb(null, stat)
53001 else {
53002 var type = stat.isDirectory() ? 'DIR' : 'FILE'
53003 if (needDir && type === 'FILE')
53004 return cb()
53005 else
53006 return cb(null, type, stat)
53007 }
53008 }
53009
53010 var self = this
53011 var statcb = inflight('stat\0' + abs, lstatcb_)
53012 if (statcb)
53013 fs.lstat(abs, statcb)
53014
53015 function lstatcb_ (er, lstat) {
53016 if (lstat && lstat.isSymbolicLink()) {
53017 // If it's a symlink, then treat it as the target, unless
53018 // the target does not exist, then treat it as a file.
53019 return fs.stat(abs, function (er, stat) {
53020 if (er)
53021 self._stat2(f, abs, null, lstat, cb)
53022 else
53023 self._stat2(f, abs, er, stat, cb)
53024 })
53025 } else {
53026 self._stat2(f, abs, er, lstat, cb)
53027 }
53028 }
53029}
53030
53031Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
53032 if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
53033 this.statCache[abs] = false
53034 return cb()
53035 }
53036
53037 var needDir = f.slice(-1) === '/'
53038 this.statCache[abs] = stat
53039
53040 if (abs.slice(-1) === '/' && stat && !stat.isDirectory())
53041 return cb(null, false, stat)
53042
53043 var c = true
53044 if (stat)
53045 c = stat.isDirectory() ? 'DIR' : 'FILE'
53046 this.cache[abs] = this.cache[abs] || c
53047
53048 if (needDir && c === 'FILE')
53049 return cb()
53050
53051 return cb(null, c, stat)
53052}
53053
53054
53055/***/ }),
53056/* 235 */
53057/***/ (function(module, exports, __webpack_require__) {
53058
53059"use strict";
53060
53061
53062var resolve = __webpack_require__(236);
53063
53064module.exports = {
53065 Validation: errorSubclass(ValidationError),
53066 MissingRef: errorSubclass(MissingRefError)
53067};
53068
53069
53070function ValidationError(errors) {
53071 this.message = 'validation failed';
53072 this.errors = errors;
53073 this.ajv = this.validation = true;
53074}
53075
53076
53077MissingRefError.message = function (baseId, ref) {
53078 return 'can\'t resolve reference ' + ref + ' from id ' + baseId;
53079};
53080
53081
53082function MissingRefError(baseId, ref, message) {
53083 this.message = message || MissingRefError.message(baseId, ref);
53084 this.missingRef = resolve.url(baseId, ref);
53085 this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef));
53086}
53087
53088
53089function errorSubclass(Subclass) {
53090 Subclass.prototype = Object.create(Error.prototype);
53091 Subclass.prototype.constructor = Subclass;
53092 return Subclass;
53093}
53094
53095
53096/***/ }),
53097/* 236 */
53098/***/ (function(module, exports, __webpack_require__) {
53099
53100"use strict";
53101
53102
53103var url = __webpack_require__(29)
53104 , equal = __webpack_require__(237)
53105 , util = __webpack_require__(106)
53106 , SchemaObject = __webpack_require__(357)
53107 , traverse = __webpack_require__(735);
53108
53109module.exports = resolve;
53110
53111resolve.normalizeId = normalizeId;
53112resolve.fullPath = getFullPath;
53113resolve.url = resolveUrl;
53114resolve.ids = resolveIds;
53115resolve.inlineRef = inlineRef;
53116resolve.schema = resolveSchema;
53117
53118/**
53119 * [resolve and compile the references ($ref)]
53120 * @this Ajv
53121 * @param {Function} compile reference to schema compilation funciton (localCompile)
53122 * @param {Object} root object with information about the root schema for the current schema
53123 * @param {String} ref reference to resolve
53124 * @return {Object|Function} schema object (if the schema can be inlined) or validation function
53125 */
53126function resolve(compile, root, ref) {
53127 /* jshint validthis: true */
53128 var refVal = this._refs[ref];
53129 if (typeof refVal == 'string') {
53130 if (this._refs[refVal]) refVal = this._refs[refVal];
53131 else return resolve.call(this, compile, root, refVal);
53132 }
53133
53134 refVal = refVal || this._schemas[ref];
53135 if (refVal instanceof SchemaObject) {
53136 return inlineRef(refVal.schema, this._opts.inlineRefs)
53137 ? refVal.schema
53138 : refVal.validate || this._compile(refVal);
53139 }
53140
53141 var res = resolveSchema.call(this, root, ref);
53142 var schema, v, baseId;
53143 if (res) {
53144 schema = res.schema;
53145 root = res.root;
53146 baseId = res.baseId;
53147 }
53148
53149 if (schema instanceof SchemaObject) {
53150 v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId);
53151 } else if (schema !== undefined) {
53152 v = inlineRef(schema, this._opts.inlineRefs)
53153 ? schema
53154 : compile.call(this, schema, root, undefined, baseId);
53155 }
53156
53157 return v;
53158}
53159
53160
53161/**
53162 * Resolve schema, its root and baseId
53163 * @this Ajv
53164 * @param {Object} root root object with properties schema, refVal, refs
53165 * @param {String} ref reference to resolve
53166 * @return {Object} object with properties schema, root, baseId
53167 */
53168function resolveSchema(root, ref) {
53169 /* jshint validthis: true */
53170 var p = url.parse(ref, false, true)
53171 , refPath = _getFullPath(p)
53172 , baseId = getFullPath(this._getId(root.schema));
53173 if (refPath !== baseId) {
53174 var id = normalizeId(refPath);
53175 var refVal = this._refs[id];
53176 if (typeof refVal == 'string') {
53177 return resolveRecursive.call(this, root, refVal, p);
53178 } else if (refVal instanceof SchemaObject) {
53179 if (!refVal.validate) this._compile(refVal);
53180 root = refVal;
53181 } else {
53182 refVal = this._schemas[id];
53183 if (refVal instanceof SchemaObject) {
53184 if (!refVal.validate) this._compile(refVal);
53185 if (id == normalizeId(ref))
53186 return { schema: refVal, root: root, baseId: baseId };
53187 root = refVal;
53188 } else {
53189 return;
53190 }
53191 }
53192 if (!root.schema) return;
53193 baseId = getFullPath(this._getId(root.schema));
53194 }
53195 return getJsonPointer.call(this, p, baseId, root.schema, root);
53196}
53197
53198
53199/* @this Ajv */
53200function resolveRecursive(root, ref, parsedRef) {
53201 /* jshint validthis: true */
53202 var res = resolveSchema.call(this, root, ref);
53203 if (res) {
53204 var schema = res.schema;
53205 var baseId = res.baseId;
53206 root = res.root;
53207 var id = this._getId(schema);
53208 if (id) baseId = resolveUrl(baseId, id);
53209 return getJsonPointer.call(this, parsedRef, baseId, schema, root);
53210 }
53211}
53212
53213
53214var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);
53215/* @this Ajv */
53216function getJsonPointer(parsedRef, baseId, schema, root) {
53217 /* jshint validthis: true */
53218 parsedRef.hash = parsedRef.hash || '';
53219 if (parsedRef.hash.slice(0,2) != '#/') return;
53220 var parts = parsedRef.hash.split('/');
53221
53222 for (var i = 1; i < parts.length; i++) {
53223 var part = parts[i];
53224 if (part) {
53225 part = util.unescapeFragment(part);
53226 schema = schema[part];
53227 if (schema === undefined) break;
53228 var id;
53229 if (!PREVENT_SCOPE_CHANGE[part]) {
53230 id = this._getId(schema);
53231 if (id) baseId = resolveUrl(baseId, id);
53232 if (schema.$ref) {
53233 var $ref = resolveUrl(baseId, schema.$ref);
53234 var res = resolveSchema.call(this, root, $ref);
53235 if (res) {
53236 schema = res.schema;
53237 root = res.root;
53238 baseId = res.baseId;
53239 }
53240 }
53241 }
53242 }
53243 }
53244 if (schema !== undefined && schema !== root.schema)
53245 return { schema: schema, root: root, baseId: baseId };
53246}
53247
53248
53249var SIMPLE_INLINED = util.toHash([
53250 'type', 'format', 'pattern',
53251 'maxLength', 'minLength',
53252 'maxProperties', 'minProperties',
53253 'maxItems', 'minItems',
53254 'maximum', 'minimum',
53255 'uniqueItems', 'multipleOf',
53256 'required', 'enum'
53257]);
53258function inlineRef(schema, limit) {
53259 if (limit === false) return false;
53260 if (limit === undefined || limit === true) return checkNoRef(schema);
53261 else if (limit) return countKeys(schema) <= limit;
53262}
53263
53264
53265function checkNoRef(schema) {
53266 var item;
53267 if (Array.isArray(schema)) {
53268 for (var i=0; i<schema.length; i++) {
53269 item = schema[i];
53270 if (typeof item == 'object' && !checkNoRef(item)) return false;
53271 }
53272 } else {
53273 for (var key in schema) {
53274 if (key == '$ref') return false;
53275 item = schema[key];
53276 if (typeof item == 'object' && !checkNoRef(item)) return false;
53277 }
53278 }
53279 return true;
53280}
53281
53282
53283function countKeys(schema) {
53284 var count = 0, item;
53285 if (Array.isArray(schema)) {
53286 for (var i=0; i<schema.length; i++) {
53287 item = schema[i];
53288 if (typeof item == 'object') count += countKeys(item);
53289 if (count == Infinity) return Infinity;
53290 }
53291 } else {
53292 for (var key in schema) {
53293 if (key == '$ref') return Infinity;
53294 if (SIMPLE_INLINED[key]) {
53295 count++;
53296 } else {
53297 item = schema[key];
53298 if (typeof item == 'object') count += countKeys(item) + 1;
53299 if (count == Infinity) return Infinity;
53300 }
53301 }
53302 }
53303 return count;
53304}
53305
53306
53307function getFullPath(id, normalize) {
53308 if (normalize !== false) id = normalizeId(id);
53309 var p = url.parse(id, false, true);
53310 return _getFullPath(p);
53311}
53312
53313
53314function _getFullPath(p) {
53315 var protocolSeparator = p.protocol || p.href.slice(0,2) == '//' ? '//' : '';
53316 return (p.protocol||'') + protocolSeparator + (p.host||'') + (p.path||'') + '#';
53317}
53318
53319
53320var TRAILING_SLASH_HASH = /#\/?$/;
53321function normalizeId(id) {
53322 return id ? id.replace(TRAILING_SLASH_HASH, '') : '';
53323}
53324
53325
53326function resolveUrl(baseId, id) {
53327 id = normalizeId(id);
53328 return url.resolve(baseId, id);
53329}
53330
53331
53332/* @this Ajv */
53333function resolveIds(schema) {
53334 var schemaId = normalizeId(this._getId(schema));
53335 var baseIds = {'': schemaId};
53336 var fullPaths = {'': getFullPath(schemaId, false)};
53337 var localRefs = {};
53338 var self = this;
53339
53340 traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
53341 if (jsonPtr === '') return;
53342 var id = self._getId(sch);
53343 var baseId = baseIds[parentJsonPtr];
53344 var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword;
53345 if (keyIndex !== undefined)
53346 fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex));
53347
53348 if (typeof id == 'string') {
53349 id = baseId = normalizeId(baseId ? url.resolve(baseId, id) : id);
53350
53351 var refVal = self._refs[id];
53352 if (typeof refVal == 'string') refVal = self._refs[refVal];
53353 if (refVal && refVal.schema) {
53354 if (!equal(sch, refVal.schema))
53355 throw new Error('id "' + id + '" resolves to more than one schema');
53356 } else if (id != normalizeId(fullPath)) {
53357 if (id[0] == '#') {
53358 if (localRefs[id] && !equal(sch, localRefs[id]))
53359 throw new Error('id "' + id + '" resolves to more than one schema');
53360 localRefs[id] = sch;
53361 } else {
53362 self._refs[id] = fullPath;
53363 }
53364 }
53365 }
53366 baseIds[jsonPtr] = baseId;
53367 fullPaths[jsonPtr] = fullPath;
53368 });
53369
53370 return localRefs;
53371}
53372
53373
53374/***/ }),
53375/* 237 */
53376/***/ (function(module, exports, __webpack_require__) {
53377
53378"use strict";
53379
53380
53381var isArray = Array.isArray;
53382var keyList = Object.keys;
53383var hasProp = Object.prototype.hasOwnProperty;
53384
53385module.exports = function equal(a, b) {
53386 if (a === b) return true;
53387
53388 var arrA = isArray(a)
53389 , arrB = isArray(b)
53390 , i
53391 , length
53392 , key;
53393
53394 if (arrA && arrB) {
53395 length = a.length;
53396 if (length != b.length) return false;
53397 for (i = 0; i < length; i++)
53398 if (!equal(a[i], b[i])) return false;
53399 return true;
53400 }
53401
53402 if (arrA != arrB) return false;
53403
53404 var dateA = a instanceof Date
53405 , dateB = b instanceof Date;
53406 if (dateA != dateB) return false;
53407 if (dateA && dateB) return a.getTime() == b.getTime();
53408
53409 var regexpA = a instanceof RegExp
53410 , regexpB = b instanceof RegExp;
53411 if (regexpA != regexpB) return false;
53412 if (regexpA && regexpB) return a.toString() == b.toString();
53413
53414 if (a instanceof Object && b instanceof Object) {
53415 var keys = keyList(a);
53416 length = keys.length;
53417
53418 if (length !== keyList(b).length)
53419 return false;
53420
53421 for (i = 0; i < length; i++)
53422 if (!hasProp.call(b, keys[i])) return false;
53423
53424 for (i = 0; i < length; i++) {
53425 key = keys[i];
53426 if (!equal(a[key], b[key])) return false;
53427 }
53428
53429 return true;
53430 }
53431
53432 return false;
53433};
53434
53435
53436/***/ }),
53437/* 238 */
53438/***/ (function(module, exports) {
53439
53440module.exports = [["0","\u0000",127,"€"],["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"],["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"],["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11],["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"],["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"],["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5],["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"],["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"],["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"],["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"],["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"],["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"],["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4],["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6],["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"],["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7],["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"],["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"],["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"],["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5],["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"],["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6],["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"],["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4],["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4],["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"],["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"],["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6],["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"],["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"],["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"],["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6],["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"],["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"],["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"],["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"],["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"],["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"],["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8],["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"],["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"],["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"],["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"],["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5],["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"],["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"],["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"],["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"],["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5],["9980","檧檨檪檭",114,"欥欦欨",6],["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"],["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"],["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"],["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"],["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"],["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5],["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"],["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"],["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6],["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"],["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"],["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4],["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19],["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"],["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"],["a2a1","ⅰ",9],["a2b1","⒈",19,"⑴",19,"①",9],["a2e5","㈠",9],["a2f1","Ⅰ",11],["a3a1","!"#¥%",88," ̄"],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"],["a6ee","︻︼︷︸︱"],["a6f4","︳︴"],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6],["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"],["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"],["a8bd","ńň"],["a8c0","ɡ"],["a8c5","ㄅ",36],["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"],["a959","℡㈱"],["a95c","‐"],["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8],["a980","﹢",4,"﹨﹩﹪﹫"],["a996","〇"],["a9a4","─",75],["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8],["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"],["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4],["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4],["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11],["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"],["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12],["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"],["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"],["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"],["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"],["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"],["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"],["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"],["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"],["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"],["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4],["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"],["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"],["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"],["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9],["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"],["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"],["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"],["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"],["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"],["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16],["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"],["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"],["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"],["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"],["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"],["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"],["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"],["bb40","籃",9,"籎",36,"籵",5,"籾",9],["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"],["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5],["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"],["bd40","紷",54,"絯",7],["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"],["be40","継",12,"綧",6,"綯",42],["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"],["bf40","緻",62],["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"],["c040","繞",35,"纃",23,"纜纝纞"],["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"],["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"],["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"],["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"],["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"],["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"],["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"],["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"],["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"],["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"],["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"],["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"],["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"],["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"],["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"],["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"],["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"],["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"],["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"],["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10],["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"],["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"],["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"],["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"],["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"],["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"],["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"],["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"],["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"],["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9],["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"],["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"],["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"],["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5],["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"],["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"],["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"],["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6],["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"],["d440","訞",31,"訿",8,"詉",21],["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"],["d540","誁",7,"誋",7,"誔",46],["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"],["d640","諤",34,"謈",27],["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"],["d740","譆",31,"譧",4,"譭",25],["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"],["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"],["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"],["d940","貮",62],["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"],["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"],["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"],["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"],["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"],["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7],["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"],["dd40","軥",62],["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"],["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"],["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"],["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"],["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"],["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"],["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"],["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"],["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"],["e240","釦",62],["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"],["e340","鉆",45,"鉵",16],["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"],["e440","銨",5,"銯",24,"鋉",31],["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"],["e540","錊",51,"錿",10],["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"],["e640","鍬",34,"鎐",27],["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"],["e740","鏎",7,"鏗",54],["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"],["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"],["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"],["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42],["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"],["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"],["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"],["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"],["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"],["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7],["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"],["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46],["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"],["ee40","頏",62],["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"],["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4],["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"],["f040","餈",4,"餎餏餑",28,"餯",26],["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"],["f140","馌馎馚",10,"馦馧馩",47],["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"],["f240","駺",62],["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"],["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"],["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"],["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5],["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"],["f540","魼",62],["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"],["f640","鯜",62],["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"],["f740","鰼",62],["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"],["f840","鳣",62],["f880","鴢",32],["f940","鵃",62],["f980","鶂",32],["fa40","鶣",62],["fa80","鷢",32],["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"],["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"],["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6],["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"],["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38],["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"],["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"]]
53441
53442/***/ }),
53443/* 239 */
53444/***/ (function(module, exports, __webpack_require__) {
53445
53446"use strict";
53447// Standard YAML's Failsafe schema.
53448// http://www.yaml.org/spec/1.2/spec.html#id2802346
53449
53450
53451
53452
53453
53454var Schema = __webpack_require__(108);
53455
53456
53457module.exports = new Schema({
53458 explicit: [
53459 __webpack_require__(813),
53460 __webpack_require__(811),
53461 __webpack_require__(806)
53462 ]
53463});
53464
53465
53466/***/ }),
53467/* 240 */
53468/***/ (function(module, exports, __webpack_require__) {
53469
53470"use strict";
53471
53472
53473var win32 = process && process.platform === 'win32';
53474var path = __webpack_require__(1);
53475var fileRe = __webpack_require__(670);
53476var utils = module.exports;
53477
53478/**
53479 * Module dependencies
53480 */
53481
53482utils.diff = __webpack_require__(826);
53483utils.unique = __webpack_require__(827);
53484utils.braces = __webpack_require__(828);
53485utils.brackets = __webpack_require__(663);
53486utils.extglob = __webpack_require__(668);
53487utils.isExtglob = __webpack_require__(166);
53488utils.isGlob = __webpack_require__(167);
53489utils.typeOf = __webpack_require__(169);
53490utils.normalize = __webpack_require__(837);
53491utils.omit = __webpack_require__(841);
53492utils.parseGlob = __webpack_require__(845);
53493utils.cache = __webpack_require__(867);
53494
53495/**
53496 * Get the filename of a filepath
53497 *
53498 * @param {String} `string`
53499 * @return {String}
53500 */
53501
53502utils.filename = function filename(fp) {
53503 var seg = fp.match(fileRe());
53504 return seg && seg[0];
53505};
53506
53507/**
53508 * Returns a function that returns true if the given
53509 * pattern is the same as a given `filepath`
53510 *
53511 * @param {String} `pattern`
53512 * @return {Function}
53513 */
53514
53515utils.isPath = function isPath(pattern, opts) {
53516 opts = opts || {};
53517 return function(fp) {
53518 var unixified = utils.unixify(fp, opts);
53519 if(opts.nocase){
53520 return pattern.toLowerCase() === unixified.toLowerCase();
53521 }
53522 return pattern === unixified;
53523 };
53524};
53525
53526/**
53527 * Returns a function that returns true if the given
53528 * pattern contains a `filepath`
53529 *
53530 * @param {String} `pattern`
53531 * @return {Function}
53532 */
53533
53534utils.hasPath = function hasPath(pattern, opts) {
53535 return function(fp) {
53536 return utils.unixify(pattern, opts).indexOf(fp) !== -1;
53537 };
53538};
53539
53540/**
53541 * Returns a function that returns true if the given
53542 * pattern matches or contains a `filepath`
53543 *
53544 * @param {String} `pattern`
53545 * @return {Function}
53546 */
53547
53548utils.matchPath = function matchPath(pattern, opts) {
53549 var fn = (opts && opts.contains)
53550 ? utils.hasPath(pattern, opts)
53551 : utils.isPath(pattern, opts);
53552 return fn;
53553};
53554
53555/**
53556 * Returns a function that returns true if the given
53557 * regex matches the `filename` of a file path.
53558 *
53559 * @param {RegExp} `re`
53560 * @return {Boolean}
53561 */
53562
53563utils.hasFilename = function hasFilename(re) {
53564 return function(fp) {
53565 var name = utils.filename(fp);
53566 return name && re.test(name);
53567 };
53568};
53569
53570/**
53571 * Coerce `val` to an array
53572 *
53573 * @param {*} val
53574 * @return {Array}
53575 */
53576
53577utils.arrayify = function arrayify(val) {
53578 return !Array.isArray(val)
53579 ? [val]
53580 : val;
53581};
53582
53583/**
53584 * Normalize all slashes in a file path or glob pattern to
53585 * forward slashes.
53586 */
53587
53588utils.unixify = function unixify(fp, opts) {
53589 if (opts && opts.unixify === false) return fp;
53590 if (opts && opts.unixify === true || win32 || path.sep === '\\') {
53591 return utils.normalize(fp, false);
53592 }
53593 if (opts && opts.unescape === true) {
53594 return fp ? fp.toString().replace(/\\(\w)/g, '$1') : '';
53595 }
53596 return fp;
53597};
53598
53599/**
53600 * Escape/unescape utils
53601 */
53602
53603utils.escapePath = function escapePath(fp) {
53604 return fp.replace(/[\\.]/g, '\\$&');
53605};
53606
53607utils.unescapeGlob = function unescapeGlob(fp) {
53608 return fp.replace(/[\\"']/g, '');
53609};
53610
53611utils.escapeRe = function escapeRe(str) {
53612 return str.replace(/[-[\\$*+?.#^\s{}(|)\]]/g, '\\$&');
53613};
53614
53615/**
53616 * Expose `utils`
53617 */
53618
53619module.exports = utils;
53620
53621
53622/***/ }),
53623/* 241 */
53624/***/ (function(module, exports, __webpack_require__) {
53625
53626var path = __webpack_require__(1);
53627var fs = __webpack_require__(12);
53628var _0777 = parseInt('0777', 8);
53629
53630module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
53631
53632function mkdirP (p, opts, f, made) {
53633 if (typeof opts === 'function') {
53634 f = opts;
53635 opts = {};
53636 }
53637 else if (!opts || typeof opts !== 'object') {
53638 opts = { mode: opts };
53639 }
53640
53641 var mode = opts.mode;
53642 var xfs = opts.fs || fs;
53643
53644 if (mode === undefined) {
53645 mode = _0777 & (~process.umask());
53646 }
53647 if (!made) made = null;
53648
53649 var cb = f || function () {};
53650 p = path.resolve(p);
53651
53652 xfs.mkdir(p, mode, function (er) {
53653 if (!er) {
53654 made = made || p;
53655 return cb(null, made);
53656 }
53657 switch (er.code) {
53658 case 'ENOENT':
53659 mkdirP(path.dirname(p), opts, function (er, made) {
53660 if (er) cb(er, made);
53661 else mkdirP(p, opts, cb, made);
53662 });
53663 break;
53664
53665 // In the case of any other error, just see if there's a dir
53666 // there already. If so, then hooray! If not, then something
53667 // is borked.
53668 default:
53669 xfs.stat(p, function (er2, stat) {
53670 // if the stat fails, then that's super weird.
53671 // let the original error be the failure reason.
53672 if (er2 || !stat.isDirectory()) cb(er, made)
53673 else cb(null, made);
53674 });
53675 break;
53676 }
53677 });
53678}
53679
53680mkdirP.sync = function sync (p, opts, made) {
53681 if (!opts || typeof opts !== 'object') {
53682 opts = { mode: opts };
53683 }
53684
53685 var mode = opts.mode;
53686 var xfs = opts.fs || fs;
53687
53688 if (mode === undefined) {
53689 mode = _0777 & (~process.umask());
53690 }
53691 if (!made) made = null;
53692
53693 p = path.resolve(p);
53694
53695 try {
53696 xfs.mkdirSync(p, mode);
53697 made = made || p;
53698 }
53699 catch (err0) {
53700 switch (err0.code) {
53701 case 'ENOENT' :
53702 made = sync(path.dirname(p), opts, made);
53703 sync(p, opts, made);
53704 break;
53705
53706 // In the case of any other error, just see if there's a dir
53707 // there already. If so, then hooray! If not, then something
53708 // is borked.
53709 default:
53710 var stat;
53711 try {
53712 stat = xfs.statSync(p);
53713 }
53714 catch (err1) {
53715 throw err0;
53716 }
53717 if (!stat.isDirectory()) throw err0;
53718 break;
53719 }
53720 }
53721
53722 return made;
53723};
53724
53725
53726/***/ }),
53727/* 242 */
53728/***/ (function(module, exports, __webpack_require__) {
53729
53730module.exports = __webpack_require__(835);
53731
53732/***/ }),
53733/* 243 */
53734/***/ (function(module, exports, __webpack_require__) {
53735
53736"use strict";
53737/*
53738object-assign
53739(c) Sindre Sorhus
53740@license MIT
53741*/
53742
53743
53744/* eslint-disable no-unused-vars */
53745var getOwnPropertySymbols = Object.getOwnPropertySymbols;
53746var hasOwnProperty = Object.prototype.hasOwnProperty;
53747var propIsEnumerable = Object.prototype.propertyIsEnumerable;
53748
53749function toObject(val) {
53750 if (val === null || val === undefined) {
53751 throw new TypeError('Object.assign cannot be called with null or undefined');
53752 }
53753
53754 return Object(val);
53755}
53756
53757function shouldUseNative() {
53758 try {
53759 if (!Object.assign) {
53760 return false;
53761 }
53762
53763 // Detect buggy property enumeration order in older V8 versions.
53764
53765 // https://bugs.chromium.org/p/v8/issues/detail?id=4118
53766 var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
53767 test1[5] = 'de';
53768 if (Object.getOwnPropertyNames(test1)[0] === '5') {
53769 return false;
53770 }
53771
53772 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
53773 var test2 = {};
53774 for (var i = 0; i < 10; i++) {
53775 test2['_' + String.fromCharCode(i)] = i;
53776 }
53777 var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
53778 return test2[n];
53779 });
53780 if (order2.join('') !== '0123456789') {
53781 return false;
53782 }
53783
53784 // https://bugs.chromium.org/p/v8/issues/detail?id=3056
53785 var test3 = {};
53786 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
53787 test3[letter] = letter;
53788 });
53789 if (Object.keys(Object.assign({}, test3)).join('') !==
53790 'abcdefghijklmnopqrst') {
53791 return false;
53792 }
53793
53794 return true;
53795 } catch (err) {
53796 // We don't expect any of the above to throw, but better to be safe.
53797 return false;
53798 }
53799}
53800
53801module.exports = shouldUseNative() ? Object.assign : function (target, source) {
53802 var from;
53803 var to = toObject(target);
53804 var symbols;
53805
53806 for (var s = 1; s < arguments.length; s++) {
53807 from = Object(arguments[s]);
53808
53809 for (var key in from) {
53810 if (hasOwnProperty.call(from, key)) {
53811 to[key] = from[key];
53812 }
53813 }
53814
53815 if (getOwnPropertySymbols) {
53816 symbols = getOwnPropertySymbols(from);
53817 for (var i = 0; i < symbols.length; i++) {
53818 if (propIsEnumerable.call(from, symbols[i])) {
53819 to[symbols[i]] = from[symbols[i]];
53820 }
53821 }
53822 }
53823 }
53824
53825 return to;
53826};
53827
53828
53829/***/ }),
53830/* 244 */
53831/***/ (function(module, exports, __webpack_require__) {
53832
53833var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;(function (root, factory){
53834 'use strict';
53835
53836 /*istanbul ignore next:cant test*/
53837 if (typeof module === 'object' && typeof module.exports === 'object') {
53838 module.exports = factory();
53839 } else if (true) {
53840 // AMD. Register as an anonymous module.
53841 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
53842 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
53843 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
53844 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
53845 } else {
53846 // Browser globals
53847 root.objectPath = factory();
53848 }
53849})(this, function(){
53850 'use strict';
53851
53852 var toStr = Object.prototype.toString;
53853 function hasOwnProperty(obj, prop) {
53854 if(obj == null) {
53855 return false
53856 }
53857 //to handle objects with null prototypes (too edge case?)
53858 return Object.prototype.hasOwnProperty.call(obj, prop)
53859 }
53860
53861 function isEmpty(value){
53862 if (!value) {
53863 return true;
53864 }
53865 if (isArray(value) && value.length === 0) {
53866 return true;
53867 } else if (typeof value !== 'string') {
53868 for (var i in value) {
53869 if (hasOwnProperty(value, i)) {
53870 return false;
53871 }
53872 }
53873 return true;
53874 }
53875 return false;
53876 }
53877
53878 function toString(type){
53879 return toStr.call(type);
53880 }
53881
53882 function isObject(obj){
53883 return typeof obj === 'object' && toString(obj) === "[object Object]";
53884 }
53885
53886 var isArray = Array.isArray || function(obj){
53887 /*istanbul ignore next:cant test*/
53888 return toStr.call(obj) === '[object Array]';
53889 }
53890
53891 function isBoolean(obj){
53892 return typeof obj === 'boolean' || toString(obj) === '[object Boolean]';
53893 }
53894
53895 function getKey(key){
53896 var intKey = parseInt(key);
53897 if (intKey.toString() === key) {
53898 return intKey;
53899 }
53900 return key;
53901 }
53902
53903 function factory(options) {
53904 options = options || {}
53905
53906 var objectPath = function(obj) {
53907 return Object.keys(objectPath).reduce(function(proxy, prop) {
53908 if(prop === 'create') {
53909 return proxy;
53910 }
53911
53912 /*istanbul ignore else*/
53913 if (typeof objectPath[prop] === 'function') {
53914 proxy[prop] = objectPath[prop].bind(objectPath, obj);
53915 }
53916
53917 return proxy;
53918 }, {});
53919 };
53920
53921 function hasShallowProperty(obj, prop) {
53922 return (options.includeInheritedProps || (typeof prop === 'number' && Array.isArray(obj)) || hasOwnProperty(obj, prop))
53923 }
53924
53925 function getShallowProperty(obj, prop) {
53926 if (hasShallowProperty(obj, prop)) {
53927 return obj[prop];
53928 }
53929 }
53930
53931 function set(obj, path, value, doNotReplace){
53932 if (typeof path === 'number') {
53933 path = [path];
53934 }
53935 if (!path || path.length === 0) {
53936 return obj;
53937 }
53938 if (typeof path === 'string') {
53939 return set(obj, path.split('.').map(getKey), value, doNotReplace);
53940 }
53941 var currentPath = path[0];
53942 var currentValue = getShallowProperty(obj, currentPath);
53943 if (path.length === 1) {
53944 if (currentValue === void 0 || !doNotReplace) {
53945 obj[currentPath] = value;
53946 }
53947 return currentValue;
53948 }
53949
53950 if (currentValue === void 0) {
53951 //check if we assume an array
53952 if(typeof path[1] === 'number') {
53953 obj[currentPath] = [];
53954 } else {
53955 obj[currentPath] = {};
53956 }
53957 }
53958
53959 return set(obj[currentPath], path.slice(1), value, doNotReplace);
53960 }
53961
53962 objectPath.has = function (obj, path) {
53963 if (typeof path === 'number') {
53964 path = [path];
53965 } else if (typeof path === 'string') {
53966 path = path.split('.');
53967 }
53968
53969 if (!path || path.length === 0) {
53970 return !!obj;
53971 }
53972
53973 for (var i = 0; i < path.length; i++) {
53974 var j = getKey(path[i]);
53975
53976 if((typeof j === 'number' && isArray(obj) && j < obj.length) ||
53977 (options.includeInheritedProps ? (j in Object(obj)) : hasOwnProperty(obj, j))) {
53978 obj = obj[j];
53979 } else {
53980 return false;
53981 }
53982 }
53983
53984 return true;
53985 };
53986
53987 objectPath.ensureExists = function (obj, path, value){
53988 return set(obj, path, value, true);
53989 };
53990
53991 objectPath.set = function (obj, path, value, doNotReplace){
53992 return set(obj, path, value, doNotReplace);
53993 };
53994
53995 objectPath.insert = function (obj, path, value, at){
53996 var arr = objectPath.get(obj, path);
53997 at = ~~at;
53998 if (!isArray(arr)) {
53999 arr = [];
54000 objectPath.set(obj, path, arr);
54001 }
54002 arr.splice(at, 0, value);
54003 };
54004
54005 objectPath.empty = function(obj, path) {
54006 if (isEmpty(path)) {
54007 return void 0;
54008 }
54009 if (obj == null) {
54010 return void 0;
54011 }
54012
54013 var value, i;
54014 if (!(value = objectPath.get(obj, path))) {
54015 return void 0;
54016 }
54017
54018 if (typeof value === 'string') {
54019 return objectPath.set(obj, path, '');
54020 } else if (isBoolean(value)) {
54021 return objectPath.set(obj, path, false);
54022 } else if (typeof value === 'number') {
54023 return objectPath.set(obj, path, 0);
54024 } else if (isArray(value)) {
54025 value.length = 0;
54026 } else if (isObject(value)) {
54027 for (i in value) {
54028 if (hasShallowProperty(value, i)) {
54029 delete value[i];
54030 }
54031 }
54032 } else {
54033 return objectPath.set(obj, path, null);
54034 }
54035 };
54036
54037 objectPath.push = function (obj, path /*, values */){
54038 var arr = objectPath.get(obj, path);
54039 if (!isArray(arr)) {
54040 arr = [];
54041 objectPath.set(obj, path, arr);
54042 }
54043
54044 arr.push.apply(arr, Array.prototype.slice.call(arguments, 2));
54045 };
54046
54047 objectPath.coalesce = function (obj, paths, defaultValue) {
54048 var value;
54049
54050 for (var i = 0, len = paths.length; i < len; i++) {
54051 if ((value = objectPath.get(obj, paths[i])) !== void 0) {
54052 return value;
54053 }
54054 }
54055
54056 return defaultValue;
54057 };
54058
54059 objectPath.get = function (obj, path, defaultValue){
54060 if (typeof path === 'number') {
54061 path = [path];
54062 }
54063 if (!path || path.length === 0) {
54064 return obj;
54065 }
54066 if (obj == null) {
54067 return defaultValue;
54068 }
54069 if (typeof path === 'string') {
54070 return objectPath.get(obj, path.split('.'), defaultValue);
54071 }
54072
54073 var currentPath = getKey(path[0]);
54074 var nextObj = getShallowProperty(obj, currentPath)
54075 if (nextObj === void 0) {
54076 return defaultValue;
54077 }
54078
54079 if (path.length === 1) {
54080 return nextObj;
54081 }
54082
54083 return objectPath.get(obj[currentPath], path.slice(1), defaultValue);
54084 };
54085
54086 objectPath.del = function del(obj, path) {
54087 if (typeof path === 'number') {
54088 path = [path];
54089 }
54090
54091 if (obj == null) {
54092 return obj;
54093 }
54094
54095 if (isEmpty(path)) {
54096 return obj;
54097 }
54098 if(typeof path === 'string') {
54099 return objectPath.del(obj, path.split('.'));
54100 }
54101
54102 var currentPath = getKey(path[0]);
54103 if (!hasShallowProperty(obj, currentPath)) {
54104 return obj;
54105 }
54106
54107 if(path.length === 1) {
54108 if (isArray(obj)) {
54109 obj.splice(currentPath, 1);
54110 } else {
54111 delete obj[currentPath];
54112 }
54113 } else {
54114 return objectPath.del(obj[currentPath], path.slice(1));
54115 }
54116
54117 return obj;
54118 }
54119
54120 return objectPath;
54121 }
54122
54123 var mod = factory();
54124 mod.create = factory;
54125 mod.withInheritedProps = factory({includeInheritedProps: true})
54126 return mod;
54127});
54128
54129
54130/***/ }),
54131/* 245 */
54132/***/ (function(module, exports, __webpack_require__) {
54133
54134"use strict";
54135
54136
54137function posix(path) {
54138 return path.charAt(0) === '/';
54139}
54140
54141function win32(path) {
54142 // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
54143 var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
54144 var result = splitDeviceRe.exec(path);
54145 var device = result[1] || '';
54146 var isUnc = Boolean(device && device.charAt(1) !== ':');
54147
54148 // UNC paths are always absolute
54149 return Boolean(result[2] || isUnc);
54150}
54151
54152module.exports = process.platform === 'win32' ? win32 : posix;
54153module.exports.posix = posix;
54154module.exports.win32 = win32;
54155
54156
54157/***/ }),
54158/* 246 */
54159/***/ (function(module, exports, __webpack_require__) {
54160
54161"use strict";
54162
54163
54164var jsonSafeStringify = __webpack_require__(816)
54165var crypto = __webpack_require__(21)
54166var Buffer = __webpack_require__(60).Buffer
54167
54168var defer = typeof setImmediate === 'undefined'
54169 ? process.nextTick
54170 : setImmediate
54171
54172function paramsHaveRequestBody (params) {
54173 return (
54174 params.body ||
54175 params.requestBodyStream ||
54176 (params.json && typeof params.json !== 'boolean') ||
54177 params.multipart
54178 )
54179}
54180
54181function safeStringify (obj, replacer) {
54182 var ret
54183 try {
54184 ret = JSON.stringify(obj, replacer)
54185 } catch (e) {
54186 ret = jsonSafeStringify(obj, replacer)
54187 }
54188 return ret
54189}
54190
54191function md5 (str) {
54192 return crypto.createHash('md5').update(str).digest('hex')
54193}
54194
54195function isReadStream (rs) {
54196 return rs.readable && rs.path && rs.mode
54197}
54198
54199function toBase64 (str) {
54200 return Buffer.from(str || '', 'utf8').toString('base64')
54201}
54202
54203function copy (obj) {
54204 var o = {}
54205 Object.keys(obj).forEach(function (i) {
54206 o[i] = obj[i]
54207 })
54208 return o
54209}
54210
54211function version () {
54212 var numbers = process.version.replace('v', '').split('.')
54213 return {
54214 major: parseInt(numbers[0], 10),
54215 minor: parseInt(numbers[1], 10),
54216 patch: parseInt(numbers[2], 10)
54217 }
54218}
54219
54220exports.paramsHaveRequestBody = paramsHaveRequestBody
54221exports.safeStringify = safeStringify
54222exports.md5 = md5
54223exports.isReadStream = isReadStream
54224exports.toBase64 = toBase64
54225exports.copy = copy
54226exports.version = version
54227exports.defer = defer
54228
54229
54230/***/ }),
54231/* 247 */
54232/***/ (function(module, exports, __webpack_require__) {
54233
54234var current = (process.versions && process.versions.node && process.versions.node.split('.')) || [];
54235
54236function specifierIncluded(specifier) {
54237 var parts = specifier.split(' ');
54238 var op = parts.length > 1 ? parts[0] : '=';
54239 var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split('.');
54240
54241 for (var i = 0; i < 3; ++i) {
54242 var cur = Number(current[i] || 0);
54243 var ver = Number(versionParts[i] || 0);
54244 if (cur === ver) {
54245 continue; // eslint-disable-line no-restricted-syntax, no-continue
54246 }
54247 if (op === '<') {
54248 return cur < ver;
54249 } else if (op === '>=') {
54250 return cur >= ver;
54251 } else {
54252 return false;
54253 }
54254 }
54255 return op === '>=';
54256}
54257
54258function matchesRange(range) {
54259 var specifiers = range.split(/ ?&& ?/);
54260 if (specifiers.length === 0) { return false; }
54261 for (var i = 0; i < specifiers.length; ++i) {
54262 if (!specifierIncluded(specifiers[i])) { return false; }
54263 }
54264 return true;
54265}
54266
54267function versionIncluded(specifierValue) {
54268 if (typeof specifierValue === 'boolean') { return specifierValue; }
54269 if (specifierValue && typeof specifierValue === 'object') {
54270 for (var i = 0; i < specifierValue.length; ++i) {
54271 if (matchesRange(specifierValue[i])) { return true; }
54272 }
54273 return false;
54274 }
54275 return matchesRange(specifierValue);
54276}
54277
54278var data = __webpack_require__(888);
54279
54280var core = {};
54281for (var mod in data) { // eslint-disable-line no-restricted-syntax
54282 if (Object.prototype.hasOwnProperty.call(data, mod)) {
54283 core[mod] = versionIncluded(data[mod]);
54284 }
54285}
54286module.exports = core;
54287
54288
54289/***/ }),
54290/* 248 */
54291/***/ (function(module, __webpack_exports__, __webpack_require__) {
54292
54293"use strict";
54294/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ReplaySubject; });
54295/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
54296/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
54297/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_queue__ = __webpack_require__(409);
54298/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(31);
54299/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__operators_observeOn__ = __webpack_require__(404);
54300/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_ObjectUnsubscribedError__ = __webpack_require__(180);
54301/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__SubjectSubscription__ = __webpack_require__(392);
54302/** PURE_IMPORTS_START tslib,_Subject,_scheduler_queue,_Subscription,_operators_observeOn,_util_ObjectUnsubscribedError,_SubjectSubscription PURE_IMPORTS_END */
54303
54304
54305
54306
54307
54308
54309
54310var ReplaySubject = /*@__PURE__*/ (function (_super) {
54311 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ReplaySubject, _super);
54312 function ReplaySubject(bufferSize, windowTime, scheduler) {
54313 if (bufferSize === void 0) {
54314 bufferSize = Number.POSITIVE_INFINITY;
54315 }
54316 if (windowTime === void 0) {
54317 windowTime = Number.POSITIVE_INFINITY;
54318 }
54319 var _this = _super.call(this) || this;
54320 _this.scheduler = scheduler;
54321 _this._events = [];
54322 _this._infiniteTimeWindow = false;
54323 _this._bufferSize = bufferSize < 1 ? 1 : bufferSize;
54324 _this._windowTime = windowTime < 1 ? 1 : windowTime;
54325 if (windowTime === Number.POSITIVE_INFINITY) {
54326 _this._infiniteTimeWindow = true;
54327 _this.next = _this.nextInfiniteTimeWindow;
54328 }
54329 else {
54330 _this.next = _this.nextTimeWindow;
54331 }
54332 return _this;
54333 }
54334 ReplaySubject.prototype.nextInfiniteTimeWindow = function (value) {
54335 var _events = this._events;
54336 _events.push(value);
54337 if (_events.length > this._bufferSize) {
54338 _events.shift();
54339 }
54340 _super.prototype.next.call(this, value);
54341 };
54342 ReplaySubject.prototype.nextTimeWindow = function (value) {
54343 this._events.push(new ReplayEvent(this._getNow(), value));
54344 this._trimBufferThenGetEvents();
54345 _super.prototype.next.call(this, value);
54346 };
54347 ReplaySubject.prototype._subscribe = function (subscriber) {
54348 var _infiniteTimeWindow = this._infiniteTimeWindow;
54349 var _events = _infiniteTimeWindow ? this._events : this._trimBufferThenGetEvents();
54350 var scheduler = this.scheduler;
54351 var len = _events.length;
54352 var subscription;
54353 if (this.closed) {
54354 throw new __WEBPACK_IMPORTED_MODULE_5__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
54355 }
54356 else if (this.isStopped || this.hasError) {
54357 subscription = __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY;
54358 }
54359 else {
54360 this.observers.push(subscriber);
54361 subscription = new __WEBPACK_IMPORTED_MODULE_6__SubjectSubscription__["a" /* SubjectSubscription */](this, subscriber);
54362 }
54363 if (scheduler) {
54364 subscriber.add(subscriber = new __WEBPACK_IMPORTED_MODULE_4__operators_observeOn__["a" /* ObserveOnSubscriber */](subscriber, scheduler));
54365 }
54366 if (_infiniteTimeWindow) {
54367 for (var i = 0; i < len && !subscriber.closed; i++) {
54368 subscriber.next(_events[i]);
54369 }
54370 }
54371 else {
54372 for (var i = 0; i < len && !subscriber.closed; i++) {
54373 subscriber.next(_events[i].value);
54374 }
54375 }
54376 if (this.hasError) {
54377 subscriber.error(this.thrownError);
54378 }
54379 else if (this.isStopped) {
54380 subscriber.complete();
54381 }
54382 return subscription;
54383 };
54384 ReplaySubject.prototype._getNow = function () {
54385 return (this.scheduler || __WEBPACK_IMPORTED_MODULE_2__scheduler_queue__["a" /* queue */]).now();
54386 };
54387 ReplaySubject.prototype._trimBufferThenGetEvents = function () {
54388 var now = this._getNow();
54389 var _bufferSize = this._bufferSize;
54390 var _windowTime = this._windowTime;
54391 var _events = this._events;
54392 var eventsCount = _events.length;
54393 var spliceCount = 0;
54394 while (spliceCount < eventsCount) {
54395 if ((now - _events[spliceCount].time) < _windowTime) {
54396 break;
54397 }
54398 spliceCount++;
54399 }
54400 if (eventsCount > _bufferSize) {
54401 spliceCount = Math.max(spliceCount, eventsCount - _bufferSize);
54402 }
54403 if (spliceCount > 0) {
54404 _events.splice(0, spliceCount);
54405 }
54406 return _events;
54407 };
54408 return ReplaySubject;
54409}(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]));
54410
54411var ReplayEvent = /*@__PURE__*/ (function () {
54412 function ReplayEvent(time, value) {
54413 this.time = time;
54414 this.value = value;
54415 }
54416 return ReplayEvent;
54417}());
54418//# sourceMappingURL=ReplaySubject.js.map
54419
54420
54421/***/ }),
54422/* 249 */
54423/***/ (function(module, __webpack_exports__, __webpack_require__) {
54424
54425"use strict";
54426/* harmony export (immutable) */ __webpack_exports__["a"] = combineLatest;
54427/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return CombineLatestOperator; });
54428/* unused harmony export CombineLatestSubscriber */
54429/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
54430/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isScheduler__ = __webpack_require__(56);
54431/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(48);
54432/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
54433/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
54434/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__fromArray__ = __webpack_require__(81);
54435/** PURE_IMPORTS_START tslib,_util_isScheduler,_util_isArray,_OuterSubscriber,_util_subscribeToResult,_fromArray PURE_IMPORTS_END */
54436
54437
54438
54439
54440
54441
54442var NONE = {};
54443function combineLatest() {
54444 var observables = [];
54445 for (var _i = 0; _i < arguments.length; _i++) {
54446 observables[_i] = arguments[_i];
54447 }
54448 var resultSelector = null;
54449 var scheduler = null;
54450 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isScheduler__["a" /* isScheduler */])(observables[observables.length - 1])) {
54451 scheduler = observables.pop();
54452 }
54453 if (typeof observables[observables.length - 1] === 'function') {
54454 resultSelector = observables.pop();
54455 }
54456 if (observables.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(observables[0])) {
54457 observables = observables[0];
54458 }
54459 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__fromArray__["a" /* fromArray */])(observables, scheduler).lift(new CombineLatestOperator(resultSelector));
54460}
54461var CombineLatestOperator = /*@__PURE__*/ (function () {
54462 function CombineLatestOperator(resultSelector) {
54463 this.resultSelector = resultSelector;
54464 }
54465 CombineLatestOperator.prototype.call = function (subscriber, source) {
54466 return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));
54467 };
54468 return CombineLatestOperator;
54469}());
54470
54471var CombineLatestSubscriber = /*@__PURE__*/ (function (_super) {
54472 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](CombineLatestSubscriber, _super);
54473 function CombineLatestSubscriber(destination, resultSelector) {
54474 var _this = _super.call(this, destination) || this;
54475 _this.resultSelector = resultSelector;
54476 _this.active = 0;
54477 _this.values = [];
54478 _this.observables = [];
54479 return _this;
54480 }
54481 CombineLatestSubscriber.prototype._next = function (observable) {
54482 this.values.push(NONE);
54483 this.observables.push(observable);
54484 };
54485 CombineLatestSubscriber.prototype._complete = function () {
54486 var observables = this.observables;
54487 var len = observables.length;
54488 if (len === 0) {
54489 this.destination.complete();
54490 }
54491 else {
54492 this.active = len;
54493 this.toRespond = len;
54494 for (var i = 0; i < len; i++) {
54495 var observable = observables[i];
54496 this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, observable, observable, i));
54497 }
54498 }
54499 };
54500 CombineLatestSubscriber.prototype.notifyComplete = function (unused) {
54501 if ((this.active -= 1) === 0) {
54502 this.destination.complete();
54503 }
54504 };
54505 CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
54506 var values = this.values;
54507 var oldVal = values[outerIndex];
54508 var toRespond = !this.toRespond
54509 ? 0
54510 : oldVal === NONE ? --this.toRespond : this.toRespond;
54511 values[outerIndex] = innerValue;
54512 if (toRespond === 0) {
54513 if (this.resultSelector) {
54514 this._tryResultSelector(values);
54515 }
54516 else {
54517 this.destination.next(values.slice());
54518 }
54519 }
54520 };
54521 CombineLatestSubscriber.prototype._tryResultSelector = function (values) {
54522 var result;
54523 try {
54524 result = this.resultSelector.apply(this, values);
54525 }
54526 catch (err) {
54527 this.destination.error(err);
54528 return;
54529 }
54530 this.destination.next(result);
54531 };
54532 return CombineLatestSubscriber;
54533}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
54534
54535//# sourceMappingURL=combineLatest.js.map
54536
54537
54538/***/ }),
54539/* 250 */
54540/***/ (function(module, __webpack_exports__, __webpack_require__) {
54541
54542"use strict";
54543/* harmony export (immutable) */ __webpack_exports__["a"] = defer;
54544/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
54545/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__from__ = __webpack_require__(64);
54546/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__empty__ = __webpack_require__(46);
54547/** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */
54548
54549
54550
54551function defer(observableFactory) {
54552 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
54553 var input;
54554 try {
54555 input = observableFactory();
54556 }
54557 catch (err) {
54558 subscriber.error(err);
54559 return undefined;
54560 }
54561 var source = input ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__from__["a" /* from */])(input) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__empty__["a" /* empty */])();
54562 return source.subscribe(subscriber);
54563 });
54564}
54565//# sourceMappingURL=defer.js.map
54566
54567
54568/***/ }),
54569/* 251 */
54570/***/ (function(module, __webpack_exports__, __webpack_require__) {
54571
54572"use strict";
54573/* harmony export (immutable) */ __webpack_exports__["a"] = of;
54574/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isScheduler__ = __webpack_require__(56);
54575/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__fromArray__ = __webpack_require__(81);
54576/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__empty__ = __webpack_require__(46);
54577/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__scalar__ = __webpack_require__(252);
54578/** PURE_IMPORTS_START _util_isScheduler,_fromArray,_empty,_scalar PURE_IMPORTS_END */
54579
54580
54581
54582
54583function of() {
54584 var args = [];
54585 for (var _i = 0; _i < arguments.length; _i++) {
54586 args[_i] = arguments[_i];
54587 }
54588 var scheduler = args[args.length - 1];
54589 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isScheduler__["a" /* isScheduler */])(scheduler)) {
54590 args.pop();
54591 }
54592 else {
54593 scheduler = undefined;
54594 }
54595 switch (args.length) {
54596 case 0:
54597 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__empty__["a" /* empty */])(scheduler);
54598 case 1:
54599 return scheduler ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__fromArray__["a" /* fromArray */])(args, scheduler) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__scalar__["a" /* scalar */])(args[0]);
54600 default:
54601 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__fromArray__["a" /* fromArray */])(args, scheduler);
54602 }
54603}
54604//# sourceMappingURL=of.js.map
54605
54606
54607/***/ }),
54608/* 252 */
54609/***/ (function(module, __webpack_exports__, __webpack_require__) {
54610
54611"use strict";
54612/* harmony export (immutable) */ __webpack_exports__["a"] = scalar;
54613/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
54614/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
54615
54616function scalar(value) {
54617 var result = new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
54618 subscriber.next(value);
54619 subscriber.complete();
54620 });
54621 result._isScalar = true;
54622 result.value = value;
54623 return result;
54624}
54625//# sourceMappingURL=scalar.js.map
54626
54627
54628/***/ }),
54629/* 253 */
54630/***/ (function(module, __webpack_exports__, __webpack_require__) {
54631
54632"use strict";
54633/* harmony export (immutable) */ __webpack_exports__["a"] = throwError;
54634/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
54635/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
54636
54637function throwError(error, scheduler) {
54638 if (!scheduler) {
54639 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return subscriber.error(error); });
54640 }
54641 else {
54642 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return scheduler.schedule(dispatch, 0, { error: error, subscriber: subscriber }); });
54643 }
54644}
54645function dispatch(_a) {
54646 var error = _a.error, subscriber = _a.subscriber;
54647 subscriber.error(error);
54648}
54649//# sourceMappingURL=throwError.js.map
54650
54651
54652/***/ }),
54653/* 254 */
54654/***/ (function(module, __webpack_exports__, __webpack_require__) {
54655
54656"use strict";
54657/* harmony export (immutable) */ __webpack_exports__["a"] = zip;
54658/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return ZipOperator; });
54659/* unused harmony export ZipSubscriber */
54660/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
54661/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__fromArray__ = __webpack_require__(81);
54662/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(48);
54663/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(5);
54664/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18);
54665/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19);
54666/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__ = __webpack_require__(139);
54667/** PURE_IMPORTS_START tslib,_fromArray,_util_isArray,_Subscriber,_OuterSubscriber,_util_subscribeToResult,_.._internal_symbol_iterator PURE_IMPORTS_END */
54668
54669
54670
54671
54672
54673
54674
54675function zip() {
54676 var observables = [];
54677 for (var _i = 0; _i < arguments.length; _i++) {
54678 observables[_i] = arguments[_i];
54679 }
54680 var resultSelector = observables[observables.length - 1];
54681 if (typeof resultSelector === 'function') {
54682 observables.pop();
54683 }
54684 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__fromArray__["a" /* fromArray */])(observables, undefined).lift(new ZipOperator(resultSelector));
54685}
54686var ZipOperator = /*@__PURE__*/ (function () {
54687 function ZipOperator(resultSelector) {
54688 this.resultSelector = resultSelector;
54689 }
54690 ZipOperator.prototype.call = function (subscriber, source) {
54691 return source.subscribe(new ZipSubscriber(subscriber, this.resultSelector));
54692 };
54693 return ZipOperator;
54694}());
54695
54696var ZipSubscriber = /*@__PURE__*/ (function (_super) {
54697 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ZipSubscriber, _super);
54698 function ZipSubscriber(destination, resultSelector, values) {
54699 if (values === void 0) {
54700 values = Object.create(null);
54701 }
54702 var _this = _super.call(this, destination) || this;
54703 _this.iterators = [];
54704 _this.active = 0;
54705 _this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : null;
54706 _this.values = values;
54707 return _this;
54708 }
54709 ZipSubscriber.prototype._next = function (value) {
54710 var iterators = this.iterators;
54711 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(value)) {
54712 iterators.push(new StaticArrayIterator(value));
54713 }
54714 else if (typeof value[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__["a" /* iterator */]] === 'function') {
54715 iterators.push(new StaticIterator(value[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__["a" /* iterator */]]()));
54716 }
54717 else {
54718 iterators.push(new ZipBufferIterator(this.destination, this, value));
54719 }
54720 };
54721 ZipSubscriber.prototype._complete = function () {
54722 var iterators = this.iterators;
54723 var len = iterators.length;
54724 this.unsubscribe();
54725 if (len === 0) {
54726 this.destination.complete();
54727 return;
54728 }
54729 this.active = len;
54730 for (var i = 0; i < len; i++) {
54731 var iterator = iterators[i];
54732 if (iterator.stillUnsubscribed) {
54733 var destination = this.destination;
54734 destination.add(iterator.subscribe(iterator, i));
54735 }
54736 else {
54737 this.active--;
54738 }
54739 }
54740 };
54741 ZipSubscriber.prototype.notifyInactive = function () {
54742 this.active--;
54743 if (this.active === 0) {
54744 this.destination.complete();
54745 }
54746 };
54747 ZipSubscriber.prototype.checkIterators = function () {
54748 var iterators = this.iterators;
54749 var len = iterators.length;
54750 var destination = this.destination;
54751 for (var i = 0; i < len; i++) {
54752 var iterator = iterators[i];
54753 if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) {
54754 return;
54755 }
54756 }
54757 var shouldComplete = false;
54758 var args = [];
54759 for (var i = 0; i < len; i++) {
54760 var iterator = iterators[i];
54761 var result = iterator.next();
54762 if (iterator.hasCompleted()) {
54763 shouldComplete = true;
54764 }
54765 if (result.done) {
54766 destination.complete();
54767 return;
54768 }
54769 args.push(result.value);
54770 }
54771 if (this.resultSelector) {
54772 this._tryresultSelector(args);
54773 }
54774 else {
54775 destination.next(args);
54776 }
54777 if (shouldComplete) {
54778 destination.complete();
54779 }
54780 };
54781 ZipSubscriber.prototype._tryresultSelector = function (args) {
54782 var result;
54783 try {
54784 result = this.resultSelector.apply(this, args);
54785 }
54786 catch (err) {
54787 this.destination.error(err);
54788 return;
54789 }
54790 this.destination.next(result);
54791 };
54792 return ZipSubscriber;
54793}(__WEBPACK_IMPORTED_MODULE_3__Subscriber__["a" /* Subscriber */]));
54794
54795var StaticIterator = /*@__PURE__*/ (function () {
54796 function StaticIterator(iterator) {
54797 this.iterator = iterator;
54798 this.nextResult = iterator.next();
54799 }
54800 StaticIterator.prototype.hasValue = function () {
54801 return true;
54802 };
54803 StaticIterator.prototype.next = function () {
54804 var result = this.nextResult;
54805 this.nextResult = this.iterator.next();
54806 return result;
54807 };
54808 StaticIterator.prototype.hasCompleted = function () {
54809 var nextResult = this.nextResult;
54810 return nextResult && nextResult.done;
54811 };
54812 return StaticIterator;
54813}());
54814var StaticArrayIterator = /*@__PURE__*/ (function () {
54815 function StaticArrayIterator(array) {
54816 this.array = array;
54817 this.index = 0;
54818 this.length = 0;
54819 this.length = array.length;
54820 }
54821 StaticArrayIterator.prototype[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__["a" /* iterator */]] = function () {
54822 return this;
54823 };
54824 StaticArrayIterator.prototype.next = function (value) {
54825 var i = this.index++;
54826 var array = this.array;
54827 return i < this.length ? { value: array[i], done: false } : { value: null, done: true };
54828 };
54829 StaticArrayIterator.prototype.hasValue = function () {
54830 return this.array.length > this.index;
54831 };
54832 StaticArrayIterator.prototype.hasCompleted = function () {
54833 return this.array.length === this.index;
54834 };
54835 return StaticArrayIterator;
54836}());
54837var ZipBufferIterator = /*@__PURE__*/ (function (_super) {
54838 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ZipBufferIterator, _super);
54839 function ZipBufferIterator(destination, parent, observable) {
54840 var _this = _super.call(this, destination) || this;
54841 _this.parent = parent;
54842 _this.observable = observable;
54843 _this.stillUnsubscribed = true;
54844 _this.buffer = [];
54845 _this.isComplete = false;
54846 return _this;
54847 }
54848 ZipBufferIterator.prototype[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_iterator__["a" /* iterator */]] = function () {
54849 return this;
54850 };
54851 ZipBufferIterator.prototype.next = function () {
54852 var buffer = this.buffer;
54853 if (buffer.length === 0 && this.isComplete) {
54854 return { value: null, done: true };
54855 }
54856 else {
54857 return { value: buffer.shift(), done: false };
54858 }
54859 };
54860 ZipBufferIterator.prototype.hasValue = function () {
54861 return this.buffer.length > 0;
54862 };
54863 ZipBufferIterator.prototype.hasCompleted = function () {
54864 return this.buffer.length === 0 && this.isComplete;
54865 };
54866 ZipBufferIterator.prototype.notifyComplete = function () {
54867 if (this.buffer.length > 0) {
54868 this.isComplete = true;
54869 this.parent.notifyInactive();
54870 }
54871 else {
54872 this.destination.complete();
54873 }
54874 };
54875 ZipBufferIterator.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
54876 this.buffer.push(innerValue);
54877 this.parent.checkIterators();
54878 };
54879 ZipBufferIterator.prototype.subscribe = function (value, index) {
54880 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, this.observable, this, index);
54881 };
54882 return ZipBufferIterator;
54883}(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */]));
54884//# sourceMappingURL=zip.js.map
54885
54886
54887/***/ }),
54888/* 255 */
54889/***/ (function(module, __webpack_exports__, __webpack_require__) {
54890
54891"use strict";
54892/* harmony export (immutable) */ __webpack_exports__["a"] = mergeAll;
54893/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mergeMap__ = __webpack_require__(136);
54894/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_identity__ = __webpack_require__(113);
54895/** PURE_IMPORTS_START _mergeMap,_util_identity PURE_IMPORTS_END */
54896
54897
54898function mergeAll(concurrent) {
54899 if (concurrent === void 0) {
54900 concurrent = Number.POSITIVE_INFINITY;
54901 }
54902 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeMap__["a" /* mergeMap */])(__WEBPACK_IMPORTED_MODULE_1__util_identity__["a" /* identity */], concurrent);
54903}
54904//# sourceMappingURL=mergeAll.js.map
54905
54906
54907/***/ }),
54908/* 256 */
54909/***/ (function(module, __webpack_exports__, __webpack_require__) {
54910
54911"use strict";
54912/* harmony export (immutable) */ __webpack_exports__["a"] = refCount;
54913/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
54914/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
54915/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
54916
54917
54918function refCount() {
54919 return function refCountOperatorFunction(source) {
54920 return source.lift(new RefCountOperator(source));
54921 };
54922}
54923var RefCountOperator = /*@__PURE__*/ (function () {
54924 function RefCountOperator(connectable) {
54925 this.connectable = connectable;
54926 }
54927 RefCountOperator.prototype.call = function (subscriber, source) {
54928 var connectable = this.connectable;
54929 connectable._refCount++;
54930 var refCounter = new RefCountSubscriber(subscriber, connectable);
54931 var subscription = source.subscribe(refCounter);
54932 if (!refCounter.closed) {
54933 refCounter.connection = connectable.connect();
54934 }
54935 return subscription;
54936 };
54937 return RefCountOperator;
54938}());
54939var RefCountSubscriber = /*@__PURE__*/ (function (_super) {
54940 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RefCountSubscriber, _super);
54941 function RefCountSubscriber(destination, connectable) {
54942 var _this = _super.call(this, destination) || this;
54943 _this.connectable = connectable;
54944 return _this;
54945 }
54946 RefCountSubscriber.prototype._unsubscribe = function () {
54947 var connectable = this.connectable;
54948 if (!connectable) {
54949 this.connection = null;
54950 return;
54951 }
54952 this.connectable = null;
54953 var refCount = connectable._refCount;
54954 if (refCount <= 0) {
54955 this.connection = null;
54956 return;
54957 }
54958 connectable._refCount = refCount - 1;
54959 if (refCount > 1) {
54960 this.connection = null;
54961 return;
54962 }
54963 var connection = this.connection;
54964 var sharedConnection = connectable._connection;
54965 this.connection = null;
54966 if (sharedConnection && (!connection || sharedConnection === connection)) {
54967 sharedConnection.unsubscribe();
54968 }
54969 };
54970 return RefCountSubscriber;
54971}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
54972//# sourceMappingURL=refCount.js.map
54973
54974
54975/***/ }),
54976/* 257 */
54977/***/ (function(module, __webpack_exports__, __webpack_require__) {
54978
54979"use strict";
54980/* harmony export (immutable) */ __webpack_exports__["a"] = scan;
54981/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
54982/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
54983/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
54984
54985
54986function scan(accumulator, seed) {
54987 var hasSeed = false;
54988 if (arguments.length >= 2) {
54989 hasSeed = true;
54990 }
54991 return function scanOperatorFunction(source) {
54992 return source.lift(new ScanOperator(accumulator, seed, hasSeed));
54993 };
54994}
54995var ScanOperator = /*@__PURE__*/ (function () {
54996 function ScanOperator(accumulator, seed, hasSeed) {
54997 if (hasSeed === void 0) {
54998 hasSeed = false;
54999 }
55000 this.accumulator = accumulator;
55001 this.seed = seed;
55002 this.hasSeed = hasSeed;
55003 }
55004 ScanOperator.prototype.call = function (subscriber, source) {
55005 return source.subscribe(new ScanSubscriber(subscriber, this.accumulator, this.seed, this.hasSeed));
55006 };
55007 return ScanOperator;
55008}());
55009var ScanSubscriber = /*@__PURE__*/ (function (_super) {
55010 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ScanSubscriber, _super);
55011 function ScanSubscriber(destination, accumulator, _seed, hasSeed) {
55012 var _this = _super.call(this, destination) || this;
55013 _this.accumulator = accumulator;
55014 _this._seed = _seed;
55015 _this.hasSeed = hasSeed;
55016 _this.index = 0;
55017 return _this;
55018 }
55019 Object.defineProperty(ScanSubscriber.prototype, "seed", {
55020 get: function () {
55021 return this._seed;
55022 },
55023 set: function (value) {
55024 this.hasSeed = true;
55025 this._seed = value;
55026 },
55027 enumerable: true,
55028 configurable: true
55029 });
55030 ScanSubscriber.prototype._next = function (value) {
55031 if (!this.hasSeed) {
55032 this.seed = value;
55033 this.destination.next(value);
55034 }
55035 else {
55036 return this._tryNext(value);
55037 }
55038 };
55039 ScanSubscriber.prototype._tryNext = function (value) {
55040 var index = this.index++;
55041 var result;
55042 try {
55043 result = this.accumulator(this.seed, value, index);
55044 }
55045 catch (err) {
55046 this.destination.error(err);
55047 }
55048 this.seed = result;
55049 this.destination.next(result);
55050 };
55051 return ScanSubscriber;
55052}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
55053//# sourceMappingURL=scan.js.map
55054
55055
55056/***/ }),
55057/* 258 */
55058/***/ (function(module, __webpack_exports__, __webpack_require__) {
55059
55060"use strict";
55061/* harmony export (immutable) */ __webpack_exports__["a"] = switchMap;
55062/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
55063/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
55064/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__ = __webpack_require__(80);
55065/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19);
55066/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(54);
55067/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__observable_from__ = __webpack_require__(64);
55068/** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */
55069
55070
55071
55072
55073
55074
55075function switchMap(project, resultSelector) {
55076 if (typeof resultSelector === 'function') {
55077 return function (source) { return source.pipe(switchMap(function (a, i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__observable_from__["a" /* from */])(project(a, i)).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__map__["a" /* map */])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };
55078 }
55079 return function (source) { return source.lift(new SwitchMapOperator(project)); };
55080}
55081var SwitchMapOperator = /*@__PURE__*/ (function () {
55082 function SwitchMapOperator(project) {
55083 this.project = project;
55084 }
55085 SwitchMapOperator.prototype.call = function (subscriber, source) {
55086 return source.subscribe(new SwitchMapSubscriber(subscriber, this.project));
55087 };
55088 return SwitchMapOperator;
55089}());
55090var SwitchMapSubscriber = /*@__PURE__*/ (function (_super) {
55091 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SwitchMapSubscriber, _super);
55092 function SwitchMapSubscriber(destination, project) {
55093 var _this = _super.call(this, destination) || this;
55094 _this.project = project;
55095 _this.index = 0;
55096 return _this;
55097 }
55098 SwitchMapSubscriber.prototype._next = function (value) {
55099 var result;
55100 var index = this.index++;
55101 try {
55102 result = this.project(value, index);
55103 }
55104 catch (error) {
55105 this.destination.error(error);
55106 return;
55107 }
55108 this._innerSub(result, value, index);
55109 };
55110 SwitchMapSubscriber.prototype._innerSub = function (result, value, index) {
55111 var innerSubscription = this.innerSubscription;
55112 if (innerSubscription) {
55113 innerSubscription.unsubscribe();
55114 }
55115 var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined);
55116 var destination = this.destination;
55117 destination.add(innerSubscriber);
55118 this.innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(this, result, value, index, innerSubscriber);
55119 };
55120 SwitchMapSubscriber.prototype._complete = function () {
55121 var innerSubscription = this.innerSubscription;
55122 if (!innerSubscription || innerSubscription.closed) {
55123 _super.prototype._complete.call(this);
55124 }
55125 this.unsubscribe();
55126 };
55127 SwitchMapSubscriber.prototype._unsubscribe = function () {
55128 this.innerSubscription = null;
55129 };
55130 SwitchMapSubscriber.prototype.notifyComplete = function (innerSub) {
55131 var destination = this.destination;
55132 destination.remove(innerSub);
55133 this.innerSubscription = null;
55134 if (this.isStopped) {
55135 _super.prototype._complete.call(this);
55136 }
55137 };
55138 SwitchMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
55139 this.destination.next(innerValue);
55140 };
55141 return SwitchMapSubscriber;
55142}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
55143//# sourceMappingURL=switchMap.js.map
55144
55145
55146/***/ }),
55147/* 259 */
55148/***/ (function(module, __webpack_exports__, __webpack_require__) {
55149
55150"use strict";
55151/* harmony export (immutable) */ __webpack_exports__["a"] = take;
55152/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
55153/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
55154/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__ = __webpack_require__(140);
55155/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_empty__ = __webpack_require__(46);
55156/** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */
55157
55158
55159
55160
55161function take(count) {
55162 return function (source) {
55163 if (count === 0) {
55164 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_empty__["a" /* empty */])();
55165 }
55166 else {
55167 return source.lift(new TakeOperator(count));
55168 }
55169 };
55170}
55171var TakeOperator = /*@__PURE__*/ (function () {
55172 function TakeOperator(total) {
55173 this.total = total;
55174 if (this.total < 0) {
55175 throw new __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */];
55176 }
55177 }
55178 TakeOperator.prototype.call = function (subscriber, source) {
55179 return source.subscribe(new TakeSubscriber(subscriber, this.total));
55180 };
55181 return TakeOperator;
55182}());
55183var TakeSubscriber = /*@__PURE__*/ (function (_super) {
55184 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TakeSubscriber, _super);
55185 function TakeSubscriber(destination, total) {
55186 var _this = _super.call(this, destination) || this;
55187 _this.total = total;
55188 _this.count = 0;
55189 return _this;
55190 }
55191 TakeSubscriber.prototype._next = function (value) {
55192 var total = this.total;
55193 var count = ++this.count;
55194 if (count <= total) {
55195 this.destination.next(value);
55196 if (count === total) {
55197 this.destination.complete();
55198 this.unsubscribe();
55199 }
55200 }
55201 };
55202 return TakeSubscriber;
55203}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
55204//# sourceMappingURL=take.js.map
55205
55206
55207/***/ }),
55208/* 260 */
55209/***/ (function(module, __webpack_exports__, __webpack_require__) {
55210
55211"use strict";
55212/* harmony export (immutable) */ __webpack_exports__["a"] = takeLast;
55213/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
55214/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
55215/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__ = __webpack_require__(140);
55216/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_empty__ = __webpack_require__(46);
55217/** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError,_observable_empty PURE_IMPORTS_END */
55218
55219
55220
55221
55222function takeLast(count) {
55223 return function takeLastOperatorFunction(source) {
55224 if (count === 0) {
55225 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_empty__["a" /* empty */])();
55226 }
55227 else {
55228 return source.lift(new TakeLastOperator(count));
55229 }
55230 };
55231}
55232var TakeLastOperator = /*@__PURE__*/ (function () {
55233 function TakeLastOperator(total) {
55234 this.total = total;
55235 if (this.total < 0) {
55236 throw new __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */];
55237 }
55238 }
55239 TakeLastOperator.prototype.call = function (subscriber, source) {
55240 return source.subscribe(new TakeLastSubscriber(subscriber, this.total));
55241 };
55242 return TakeLastOperator;
55243}());
55244var TakeLastSubscriber = /*@__PURE__*/ (function (_super) {
55245 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TakeLastSubscriber, _super);
55246 function TakeLastSubscriber(destination, total) {
55247 var _this = _super.call(this, destination) || this;
55248 _this.total = total;
55249 _this.ring = new Array();
55250 _this.count = 0;
55251 return _this;
55252 }
55253 TakeLastSubscriber.prototype._next = function (value) {
55254 var ring = this.ring;
55255 var total = this.total;
55256 var count = this.count++;
55257 if (ring.length < total) {
55258 ring.push(value);
55259 }
55260 else {
55261 var index = count % total;
55262 ring[index] = value;
55263 }
55264 };
55265 TakeLastSubscriber.prototype._complete = function () {
55266 var destination = this.destination;
55267 var count = this.count;
55268 if (count > 0) {
55269 var total = this.count >= this.total ? this.total : this.count;
55270 var ring = this.ring;
55271 for (var i = 0; i < total; i++) {
55272 var idx = (count++) % total;
55273 destination.next(ring[idx]);
55274 }
55275 }
55276 destination.complete();
55277 };
55278 return TakeLastSubscriber;
55279}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
55280//# sourceMappingURL=takeLast.js.map
55281
55282
55283/***/ }),
55284/* 261 */
55285/***/ (function(module, __webpack_exports__, __webpack_require__) {
55286
55287"use strict";
55288/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return rxSubscriber; });
55289/* unused harmony export $$rxSubscriber */
55290/** PURE_IMPORTS_START PURE_IMPORTS_END */
55291var rxSubscriber = typeof Symbol === 'function'
55292 ? /*@__PURE__*/ Symbol('rxSubscriber')
55293 : '@@rxSubscriber_' + /*@__PURE__*/ Math.random();
55294var $$rxSubscriber = rxSubscriber;
55295//# sourceMappingURL=rxSubscriber.js.map
55296
55297
55298/***/ }),
55299/* 262 */
55300/***/ (function(module, __webpack_exports__, __webpack_require__) {
55301
55302"use strict";
55303/* harmony export (immutable) */ __webpack_exports__["a"] = canReportError;
55304/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Subscriber__ = __webpack_require__(5);
55305/** PURE_IMPORTS_START _Subscriber PURE_IMPORTS_END */
55306
55307function canReportError(observer) {
55308 while (observer) {
55309 var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;
55310 if (closed_1 || isStopped) {
55311 return false;
55312 }
55313 else if (destination && destination instanceof __WEBPACK_IMPORTED_MODULE_0__Subscriber__["a" /* Subscriber */]) {
55314 observer = destination;
55315 }
55316 else {
55317 observer = null;
55318 }
55319 }
55320 return true;
55321}
55322//# sourceMappingURL=canReportError.js.map
55323
55324
55325/***/ }),
55326/* 263 */
55327/***/ (function(module, __webpack_exports__, __webpack_require__) {
55328
55329"use strict";
55330/* harmony export (immutable) */ __webpack_exports__["a"] = hostReportError;
55331/** PURE_IMPORTS_START PURE_IMPORTS_END */
55332function hostReportError(err) {
55333 setTimeout(function () { throw err; });
55334}
55335//# sourceMappingURL=hostReportError.js.map
55336
55337
55338/***/ }),
55339/* 264 */
55340/***/ (function(module, __webpack_exports__, __webpack_require__) {
55341
55342"use strict";
55343/* harmony export (immutable) */ __webpack_exports__["a"] = pipe;
55344/* harmony export (immutable) */ __webpack_exports__["b"] = pipeFromArray;
55345/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__noop__ = __webpack_require__(182);
55346/** PURE_IMPORTS_START _noop PURE_IMPORTS_END */
55347
55348function pipe() {
55349 var fns = [];
55350 for (var _i = 0; _i < arguments.length; _i++) {
55351 fns[_i] = arguments[_i];
55352 }
55353 return pipeFromArray(fns);
55354}
55355function pipeFromArray(fns) {
55356 if (!fns) {
55357 return __WEBPACK_IMPORTED_MODULE_0__noop__["a" /* noop */];
55358 }
55359 if (fns.length === 1) {
55360 return fns[0];
55361 }
55362 return function piped(input) {
55363 return fns.reduce(function (prev, fn) { return fn(prev); }, input);
55364 };
55365}
55366//# sourceMappingURL=pipe.js.map
55367
55368
55369/***/ }),
55370/* 265 */
55371/***/ (function(module, exports, __webpack_require__) {
55372
55373// Copyright 2017 Joyent, Inc.
55374
55375module.exports = {
55376 DiffieHellman: DiffieHellman,
55377 generateECDSA: generateECDSA,
55378 generateED25519: generateED25519
55379};
55380
55381var assert = __webpack_require__(22);
55382var crypto = __webpack_require__(21);
55383var Buffer = __webpack_require__(20).Buffer;
55384var algs = __webpack_require__(39);
55385var utils = __webpack_require__(32);
55386var nacl;
55387
55388var Key = __webpack_require__(34);
55389var PrivateKey = __webpack_require__(40);
55390
55391var CRYPTO_HAVE_ECDH = (crypto.createECDH !== undefined);
55392
55393var ecdh, ec, jsbn;
55394
55395function DiffieHellman(key) {
55396 utils.assertCompatible(key, Key, [1, 4], 'key');
55397 this._isPriv = PrivateKey.isPrivateKey(key, [1, 3]);
55398 this._algo = key.type;
55399 this._curve = key.curve;
55400 this._key = key;
55401 if (key.type === 'dsa') {
55402 if (!CRYPTO_HAVE_ECDH) {
55403 throw (new Error('Due to bugs in the node 0.10 ' +
55404 'crypto API, node 0.12.x or later is required ' +
55405 'to use DH'));
55406 }
55407 this._dh = crypto.createDiffieHellman(
55408 key.part.p.data, undefined,
55409 key.part.g.data, undefined);
55410 this._p = key.part.p;
55411 this._g = key.part.g;
55412 if (this._isPriv)
55413 this._dh.setPrivateKey(key.part.x.data);
55414 this._dh.setPublicKey(key.part.y.data);
55415
55416 } else if (key.type === 'ecdsa') {
55417 if (!CRYPTO_HAVE_ECDH) {
55418 if (ecdh === undefined)
55419 ecdh = __webpack_require__(350);
55420 if (ec === undefined)
55421 ec = __webpack_require__(129);
55422 if (jsbn === undefined)
55423 jsbn = __webpack_require__(79).BigInteger;
55424
55425 this._ecParams = new X9ECParameters(this._curve);
55426
55427 if (this._isPriv) {
55428 this._priv = new ECPrivate(
55429 this._ecParams, key.part.d.data);
55430 }
55431 return;
55432 }
55433
55434 var curve = {
55435 'nistp256': 'prime256v1',
55436 'nistp384': 'secp384r1',
55437 'nistp521': 'secp521r1'
55438 }[key.curve];
55439 this._dh = crypto.createECDH(curve);
55440 if (typeof (this._dh) !== 'object' ||
55441 typeof (this._dh.setPrivateKey) !== 'function') {
55442 CRYPTO_HAVE_ECDH = false;
55443 DiffieHellman.call(this, key);
55444 return;
55445 }
55446 if (this._isPriv)
55447 this._dh.setPrivateKey(key.part.d.data);
55448 this._dh.setPublicKey(key.part.Q.data);
55449
55450 } else if (key.type === 'curve25519') {
55451 if (nacl === undefined)
55452 nacl = __webpack_require__(71);
55453
55454 if (this._isPriv) {
55455 utils.assertCompatible(key, PrivateKey, [1, 5], 'key');
55456 this._priv = key.part.k.data;
55457 }
55458
55459 } else {
55460 throw (new Error('DH not supported for ' + key.type + ' keys'));
55461 }
55462}
55463
55464DiffieHellman.prototype.getPublicKey = function () {
55465 if (this._isPriv)
55466 return (this._key.toPublic());
55467 return (this._key);
55468};
55469
55470DiffieHellman.prototype.getPrivateKey = function () {
55471 if (this._isPriv)
55472 return (this._key);
55473 else
55474 return (undefined);
55475};
55476DiffieHellman.prototype.getKey = DiffieHellman.prototype.getPrivateKey;
55477
55478DiffieHellman.prototype._keyCheck = function (pk, isPub) {
55479 assert.object(pk, 'key');
55480 if (!isPub)
55481 utils.assertCompatible(pk, PrivateKey, [1, 3], 'key');
55482 utils.assertCompatible(pk, Key, [1, 4], 'key');
55483
55484 if (pk.type !== this._algo) {
55485 throw (new Error('A ' + pk.type + ' key cannot be used in ' +
55486 this._algo + ' Diffie-Hellman'));
55487 }
55488
55489 if (pk.curve !== this._curve) {
55490 throw (new Error('A key from the ' + pk.curve + ' curve ' +
55491 'cannot be used with a ' + this._curve +
55492 ' Diffie-Hellman'));
55493 }
55494
55495 if (pk.type === 'dsa') {
55496 assert.deepEqual(pk.part.p, this._p,
55497 'DSA key prime does not match');
55498 assert.deepEqual(pk.part.g, this._g,
55499 'DSA key generator does not match');
55500 }
55501};
55502
55503DiffieHellman.prototype.setKey = function (pk) {
55504 this._keyCheck(pk);
55505
55506 if (pk.type === 'dsa') {
55507 this._dh.setPrivateKey(pk.part.x.data);
55508 this._dh.setPublicKey(pk.part.y.data);
55509
55510 } else if (pk.type === 'ecdsa') {
55511 if (CRYPTO_HAVE_ECDH) {
55512 this._dh.setPrivateKey(pk.part.d.data);
55513 this._dh.setPublicKey(pk.part.Q.data);
55514 } else {
55515 this._priv = new ECPrivate(
55516 this._ecParams, pk.part.d.data);
55517 }
55518
55519 } else if (pk.type === 'curve25519') {
55520 var k = pk.part.k;
55521 if (!pk.part.k)
55522 k = pk.part.r;
55523 this._priv = k.data;
55524 if (this._priv[0] === 0x00)
55525 this._priv = this._priv.slice(1);
55526 this._priv = this._priv.slice(0, 32);
55527 }
55528 this._key = pk;
55529 this._isPriv = true;
55530};
55531DiffieHellman.prototype.setPrivateKey = DiffieHellman.prototype.setKey;
55532
55533DiffieHellman.prototype.computeSecret = function (otherpk) {
55534 this._keyCheck(otherpk, true);
55535 if (!this._isPriv)
55536 throw (new Error('DH exchange has not been initialized with ' +
55537 'a private key yet'));
55538
55539 var pub;
55540 if (this._algo === 'dsa') {
55541 return (this._dh.computeSecret(
55542 otherpk.part.y.data));
55543
55544 } else if (this._algo === 'ecdsa') {
55545 if (CRYPTO_HAVE_ECDH) {
55546 return (this._dh.computeSecret(
55547 otherpk.part.Q.data));
55548 } else {
55549 pub = new ECPublic(
55550 this._ecParams, otherpk.part.Q.data);
55551 return (this._priv.deriveSharedSecret(pub));
55552 }
55553
55554 } else if (this._algo === 'curve25519') {
55555 pub = otherpk.part.A.data;
55556 while (pub[0] === 0x00 && pub.length > 32)
55557 pub = pub.slice(1);
55558 var priv = this._priv;
55559 assert.strictEqual(pub.length, 32);
55560 assert.strictEqual(priv.length, 32);
55561
55562 var secret = nacl.box.before(new Uint8Array(pub),
55563 new Uint8Array(priv));
55564
55565 return (Buffer.from(secret));
55566 }
55567
55568 throw (new Error('Invalid algorithm: ' + this._algo));
55569};
55570
55571DiffieHellman.prototype.generateKey = function () {
55572 var parts = [];
55573 var priv, pub;
55574 if (this._algo === 'dsa') {
55575 this._dh.generateKeys();
55576
55577 parts.push({name: 'p', data: this._p.data});
55578 parts.push({name: 'q', data: this._key.part.q.data});
55579 parts.push({name: 'g', data: this._g.data});
55580 parts.push({name: 'y', data: this._dh.getPublicKey()});
55581 parts.push({name: 'x', data: this._dh.getPrivateKey()});
55582 this._key = new PrivateKey({
55583 type: 'dsa',
55584 parts: parts
55585 });
55586 this._isPriv = true;
55587 return (this._key);
55588
55589 } else if (this._algo === 'ecdsa') {
55590 if (CRYPTO_HAVE_ECDH) {
55591 this._dh.generateKeys();
55592
55593 parts.push({name: 'curve',
55594 data: Buffer.from(this._curve)});
55595 parts.push({name: 'Q', data: this._dh.getPublicKey()});
55596 parts.push({name: 'd', data: this._dh.getPrivateKey()});
55597 this._key = new PrivateKey({
55598 type: 'ecdsa',
55599 curve: this._curve,
55600 parts: parts
55601 });
55602 this._isPriv = true;
55603 return (this._key);
55604
55605 } else {
55606 var n = this._ecParams.getN();
55607 var r = new jsbn(crypto.randomBytes(n.bitLength()));
55608 var n1 = n.subtract(jsbn.ONE);
55609 priv = r.mod(n1).add(jsbn.ONE);
55610 pub = this._ecParams.getG().multiply(priv);
55611
55612 priv = Buffer.from(priv.toByteArray());
55613 pub = Buffer.from(this._ecParams.getCurve().
55614 encodePointHex(pub), 'hex');
55615
55616 this._priv = new ECPrivate(this._ecParams, priv);
55617
55618 parts.push({name: 'curve',
55619 data: Buffer.from(this._curve)});
55620 parts.push({name: 'Q', data: pub});
55621 parts.push({name: 'd', data: priv});
55622
55623 this._key = new PrivateKey({
55624 type: 'ecdsa',
55625 curve: this._curve,
55626 parts: parts
55627 });
55628 this._isPriv = true;
55629 return (this._key);
55630 }
55631
55632 } else if (this._algo === 'curve25519') {
55633 var pair = nacl.box.keyPair();
55634 priv = Buffer.from(pair.secretKey);
55635 pub = Buffer.from(pair.publicKey);
55636 priv = Buffer.concat([priv, pub]);
55637 assert.strictEqual(priv.length, 64);
55638 assert.strictEqual(pub.length, 32);
55639
55640 parts.push({name: 'A', data: pub});
55641 parts.push({name: 'k', data: priv});
55642 this._key = new PrivateKey({
55643 type: 'curve25519',
55644 parts: parts
55645 });
55646 this._isPriv = true;
55647 return (this._key);
55648 }
55649
55650 throw (new Error('Invalid algorithm: ' + this._algo));
55651};
55652DiffieHellman.prototype.generateKeys = DiffieHellman.prototype.generateKey;
55653
55654/* These are helpers for using ecc-jsbn (for node 0.10 compatibility). */
55655
55656function X9ECParameters(name) {
55657 var params = algs.curves[name];
55658 assert.object(params);
55659
55660 var p = new jsbn(params.p);
55661 var a = new jsbn(params.a);
55662 var b = new jsbn(params.b);
55663 var n = new jsbn(params.n);
55664 var h = jsbn.ONE;
55665 var curve = new ec.ECCurveFp(p, a, b);
55666 var G = curve.decodePointHex(params.G.toString('hex'));
55667
55668 this.curve = curve;
55669 this.g = G;
55670 this.n = n;
55671 this.h = h;
55672}
55673X9ECParameters.prototype.getCurve = function () { return (this.curve); };
55674X9ECParameters.prototype.getG = function () { return (this.g); };
55675X9ECParameters.prototype.getN = function () { return (this.n); };
55676X9ECParameters.prototype.getH = function () { return (this.h); };
55677
55678function ECPublic(params, buffer) {
55679 this._params = params;
55680 if (buffer[0] === 0x00)
55681 buffer = buffer.slice(1);
55682 this._pub = params.getCurve().decodePointHex(buffer.toString('hex'));
55683}
55684
55685function ECPrivate(params, buffer) {
55686 this._params = params;
55687 this._priv = new jsbn(utils.mpNormalize(buffer));
55688}
55689ECPrivate.prototype.deriveSharedSecret = function (pubKey) {
55690 assert.ok(pubKey instanceof ECPublic);
55691 var S = pubKey._pub.multiply(this._priv);
55692 return (Buffer.from(S.getX().toBigInteger().toByteArray()));
55693};
55694
55695function generateED25519() {
55696 if (nacl === undefined)
55697 nacl = __webpack_require__(71);
55698
55699 var pair = nacl.sign.keyPair();
55700 var priv = Buffer.from(pair.secretKey);
55701 var pub = Buffer.from(pair.publicKey);
55702 assert.strictEqual(priv.length, 64);
55703 assert.strictEqual(pub.length, 32);
55704
55705 var parts = [];
55706 parts.push({name: 'A', data: pub});
55707 parts.push({name: 'k', data: priv.slice(0, 32)});
55708 var key = new PrivateKey({
55709 type: 'ed25519',
55710 parts: parts
55711 });
55712 return (key);
55713}
55714
55715/* Generates a new ECDSA private key on a given curve. */
55716function generateECDSA(curve) {
55717 var parts = [];
55718 var key;
55719
55720 if (CRYPTO_HAVE_ECDH) {
55721 /*
55722 * Node crypto doesn't expose key generation directly, but the
55723 * ECDH instances can generate keys. It turns out this just
55724 * calls into the OpenSSL generic key generator, and we can
55725 * read its output happily without doing an actual DH. So we
55726 * use that here.
55727 */
55728 var osCurve = {
55729 'nistp256': 'prime256v1',
55730 'nistp384': 'secp384r1',
55731 'nistp521': 'secp521r1'
55732 }[curve];
55733
55734 var dh = crypto.createECDH(osCurve);
55735 dh.generateKeys();
55736
55737 parts.push({name: 'curve',
55738 data: Buffer.from(curve)});
55739 parts.push({name: 'Q', data: dh.getPublicKey()});
55740 parts.push({name: 'd', data: dh.getPrivateKey()});
55741
55742 key = new PrivateKey({
55743 type: 'ecdsa',
55744 curve: curve,
55745 parts: parts
55746 });
55747 return (key);
55748 } else {
55749 if (ecdh === undefined)
55750 ecdh = __webpack_require__(350);
55751 if (ec === undefined)
55752 ec = __webpack_require__(129);
55753 if (jsbn === undefined)
55754 jsbn = __webpack_require__(79).BigInteger;
55755
55756 var ecParams = new X9ECParameters(curve);
55757
55758 /* This algorithm taken from FIPS PUB 186-4 (section B.4.1) */
55759 var n = ecParams.getN();
55760 /*
55761 * The crypto.randomBytes() function can only give us whole
55762 * bytes, so taking a nod from X9.62, we round up.
55763 */
55764 var cByteLen = Math.ceil((n.bitLength() + 64) / 8);
55765 var c = new jsbn(crypto.randomBytes(cByteLen));
55766
55767 var n1 = n.subtract(jsbn.ONE);
55768 var priv = c.mod(n1).add(jsbn.ONE);
55769 var pub = ecParams.getG().multiply(priv);
55770
55771 priv = Buffer.from(priv.toByteArray());
55772 pub = Buffer.from(ecParams.getCurve().
55773 encodePointHex(pub), 'hex');
55774
55775 parts.push({name: 'curve', data: Buffer.from(curve)});
55776 parts.push({name: 'Q', data: pub});
55777 parts.push({name: 'd', data: priv});
55778
55779 key = new PrivateKey({
55780 type: 'ecdsa',
55781 curve: curve,
55782 parts: parts
55783 });
55784 return (key);
55785 }
55786}
55787
55788
55789/***/ }),
55790/* 266 */
55791/***/ (function(module, exports, __webpack_require__) {
55792
55793// Copyright 2017 Joyent, Inc.
55794
55795module.exports = {
55796 read: read,
55797 write: write
55798};
55799
55800var assert = __webpack_require__(22);
55801var Buffer = __webpack_require__(20).Buffer;
55802var Key = __webpack_require__(34);
55803var PrivateKey = __webpack_require__(40);
55804var utils = __webpack_require__(32);
55805var SSHBuffer = __webpack_require__(147);
55806var Dhe = __webpack_require__(265);
55807
55808var supportedAlgos = {
55809 'rsa-sha1' : 5,
55810 'rsa-sha256' : 8,
55811 'rsa-sha512' : 10,
55812 'ecdsa-p256-sha256' : 13,
55813 'ecdsa-p384-sha384' : 14
55814 /*
55815 * ed25519 is hypothetically supported with id 15
55816 * but the common tools available don't appear to be
55817 * capable of generating/using ed25519 keys
55818 */
55819};
55820
55821var supportedAlgosById = {};
55822Object.keys(supportedAlgos).forEach(function (k) {
55823 supportedAlgosById[supportedAlgos[k]] = k.toUpperCase();
55824});
55825
55826function read(buf, options) {
55827 if (typeof (buf) !== 'string') {
55828 assert.buffer(buf, 'buf');
55829 buf = buf.toString('ascii');
55830 }
55831 var lines = buf.split('\n');
55832 if (lines[0].match(/^Private-key-format\: v1/)) {
55833 var algElems = lines[1].split(' ');
55834 var algoNum = parseInt(algElems[1], 10);
55835 var algoName = algElems[2];
55836 if (!supportedAlgosById[algoNum])
55837 throw (new Error('Unsupported algorithm: ' + algoName));
55838 return (readDNSSECPrivateKey(algoNum, lines.slice(2)));
55839 }
55840
55841 // skip any comment-lines
55842 var line = 0;
55843 /* JSSTYLED */
55844 while (lines[line].match(/^\;/))
55845 line++;
55846 // we should now have *one single* line left with our KEY on it.
55847 if ((lines[line].match(/\. IN KEY /) ||
55848 lines[line].match(/\. IN DNSKEY /)) && lines[line+1].length === 0) {
55849 return (readRFC3110(lines[line]));
55850 }
55851 throw (new Error('Cannot parse dnssec key'));
55852}
55853
55854function readRFC3110(keyString) {
55855 var elems = keyString.split(' ');
55856 //unused var flags = parseInt(elems[3], 10);
55857 //unused var protocol = parseInt(elems[4], 10);
55858 var algorithm = parseInt(elems[5], 10);
55859 if (!supportedAlgosById[algorithm])
55860 throw (new Error('Unsupported algorithm: ' + algorithm));
55861 var base64key = elems.slice(6, elems.length).join();
55862 var keyBuffer = Buffer.from(base64key, 'base64');
55863 if (supportedAlgosById[algorithm].match(/^RSA-/)) {
55864 // join the rest of the body into a single base64-blob
55865 var publicExponentLen = keyBuffer.readUInt8(0);
55866 if (publicExponentLen != 3 && publicExponentLen != 1)
55867 throw (new Error('Cannot parse dnssec key: ' +
55868 'unsupported exponent length'));
55869
55870 var publicExponent = keyBuffer.slice(1, publicExponentLen+1);
55871 publicExponent = utils.mpNormalize(publicExponent);
55872 var modulus = keyBuffer.slice(1+publicExponentLen);
55873 modulus = utils.mpNormalize(modulus);
55874 // now, make the key
55875 var rsaKey = {
55876 type: 'rsa',
55877 parts: []
55878 };
55879 rsaKey.parts.push({ name: 'e', data: publicExponent});
55880 rsaKey.parts.push({ name: 'n', data: modulus});
55881 return (new Key(rsaKey));
55882 }
55883 if (supportedAlgosById[algorithm] === 'ECDSA-P384-SHA384' ||
55884 supportedAlgosById[algorithm] === 'ECDSA-P256-SHA256') {
55885 var curve = 'nistp384';
55886 var size = 384;
55887 if (supportedAlgosById[algorithm].match(/^ECDSA-P256-SHA256/)) {
55888 curve = 'nistp256';
55889 size = 256;
55890 }
55891
55892 var ecdsaKey = {
55893 type: 'ecdsa',
55894 curve: curve,
55895 size: size,
55896 parts: [
55897 {name: 'curve', data: Buffer.from(curve) },
55898 {name: 'Q', data: utils.ecNormalize(keyBuffer) }
55899 ]
55900 };
55901 return (new Key(ecdsaKey));
55902 }
55903 throw (new Error('Unsupported algorithm: ' +
55904 supportedAlgosById[algorithm]));
55905}
55906
55907function elementToBuf(e) {
55908 return (Buffer.from(e.split(' ')[1], 'base64'));
55909}
55910
55911function readDNSSECRSAPrivateKey(elements) {
55912 var rsaParams = {};
55913 elements.forEach(function (element) {
55914 if (element.split(' ')[0] === 'Modulus:')
55915 rsaParams['n'] = elementToBuf(element);
55916 else if (element.split(' ')[0] === 'PublicExponent:')
55917 rsaParams['e'] = elementToBuf(element);
55918 else if (element.split(' ')[0] === 'PrivateExponent:')
55919 rsaParams['d'] = elementToBuf(element);
55920 else if (element.split(' ')[0] === 'Prime1:')
55921 rsaParams['p'] = elementToBuf(element);
55922 else if (element.split(' ')[0] === 'Prime2:')
55923 rsaParams['q'] = elementToBuf(element);
55924 else if (element.split(' ')[0] === 'Exponent1:')
55925 rsaParams['dmodp'] = elementToBuf(element);
55926 else if (element.split(' ')[0] === 'Exponent2:')
55927 rsaParams['dmodq'] = elementToBuf(element);
55928 else if (element.split(' ')[0] === 'Coefficient:')
55929 rsaParams['iqmp'] = elementToBuf(element);
55930 });
55931 // now, make the key
55932 var key = {
55933 type: 'rsa',
55934 parts: [
55935 { name: 'e', data: utils.mpNormalize(rsaParams['e'])},
55936 { name: 'n', data: utils.mpNormalize(rsaParams['n'])},
55937 { name: 'd', data: utils.mpNormalize(rsaParams['d'])},
55938 { name: 'p', data: utils.mpNormalize(rsaParams['p'])},
55939 { name: 'q', data: utils.mpNormalize(rsaParams['q'])},
55940 { name: 'dmodp',
55941 data: utils.mpNormalize(rsaParams['dmodp'])},
55942 { name: 'dmodq',
55943 data: utils.mpNormalize(rsaParams['dmodq'])},
55944 { name: 'iqmp',
55945 data: utils.mpNormalize(rsaParams['iqmp'])}
55946 ]
55947 };
55948 return (new PrivateKey(key));
55949}
55950
55951function readDNSSECPrivateKey(alg, elements) {
55952 if (supportedAlgosById[alg].match(/^RSA-/)) {
55953 return (readDNSSECRSAPrivateKey(elements));
55954 }
55955 if (supportedAlgosById[alg] === 'ECDSA-P384-SHA384' ||
55956 supportedAlgosById[alg] === 'ECDSA-P256-SHA256') {
55957 var d = Buffer.from(elements[0].split(' ')[1], 'base64');
55958 var curve = 'nistp384';
55959 var size = 384;
55960 if (supportedAlgosById[alg] === 'ECDSA-P256-SHA256') {
55961 curve = 'nistp256';
55962 size = 256;
55963 }
55964 // DNSSEC generates the public-key on the fly (go calculate it)
55965 var publicKey = utils.publicFromPrivateECDSA(curve, d);
55966 var Q = publicKey.part['Q'].data;
55967 var ecdsaKey = {
55968 type: 'ecdsa',
55969 curve: curve,
55970 size: size,
55971 parts: [
55972 {name: 'curve', data: Buffer.from(curve) },
55973 {name: 'd', data: d },
55974 {name: 'Q', data: Q }
55975 ]
55976 };
55977 return (new PrivateKey(ecdsaKey));
55978 }
55979 throw (new Error('Unsupported algorithm: ' + supportedAlgosById[alg]));
55980}
55981
55982function dnssecTimestamp(date) {
55983 var year = date.getFullYear() + ''; //stringify
55984 var month = (date.getMonth() + 1);
55985 var timestampStr = year + month + date.getUTCDate();
55986 timestampStr += '' + date.getUTCHours() + date.getUTCMinutes();
55987 timestampStr += date.getUTCSeconds();
55988 return (timestampStr);
55989}
55990
55991function rsaAlgFromOptions(opts) {
55992 if (!opts || !opts.hashAlgo || opts.hashAlgo === 'sha1')
55993 return ('5 (RSASHA1)');
55994 else if (opts.hashAlgo === 'sha256')
55995 return ('8 (RSASHA256)');
55996 else if (opts.hashAlgo === 'sha512')
55997 return ('10 (RSASHA512)');
55998 else
55999 throw (new Error('Unknown or unsupported hash: ' +
56000 opts.hashAlgo));
56001}
56002
56003function writeRSA(key, options) {
56004 // if we're missing parts, add them.
56005 if (!key.part.dmodp || !key.part.dmodq) {
56006 utils.addRSAMissing(key);
56007 }
56008
56009 var out = '';
56010 out += 'Private-key-format: v1.3\n';
56011 out += 'Algorithm: ' + rsaAlgFromOptions(options) + '\n';
56012 var n = utils.mpDenormalize(key.part['n'].data);
56013 out += 'Modulus: ' + n.toString('base64') + '\n';
56014 var e = utils.mpDenormalize(key.part['e'].data);
56015 out += 'PublicExponent: ' + e.toString('base64') + '\n';
56016 var d = utils.mpDenormalize(key.part['d'].data);
56017 out += 'PrivateExponent: ' + d.toString('base64') + '\n';
56018 var p = utils.mpDenormalize(key.part['p'].data);
56019 out += 'Prime1: ' + p.toString('base64') + '\n';
56020 var q = utils.mpDenormalize(key.part['q'].data);
56021 out += 'Prime2: ' + q.toString('base64') + '\n';
56022 var dmodp = utils.mpDenormalize(key.part['dmodp'].data);
56023 out += 'Exponent1: ' + dmodp.toString('base64') + '\n';
56024 var dmodq = utils.mpDenormalize(key.part['dmodq'].data);
56025 out += 'Exponent2: ' + dmodq.toString('base64') + '\n';
56026 var iqmp = utils.mpDenormalize(key.part['iqmp'].data);
56027 out += 'Coefficient: ' + iqmp.toString('base64') + '\n';
56028 // Assume that we're valid as-of now
56029 var timestamp = new Date();
56030 out += 'Created: ' + dnssecTimestamp(timestamp) + '\n';
56031 out += 'Publish: ' + dnssecTimestamp(timestamp) + '\n';
56032 out += 'Activate: ' + dnssecTimestamp(timestamp) + '\n';
56033 return (Buffer.from(out, 'ascii'));
56034}
56035
56036function writeECDSA(key, options) {
56037 var out = '';
56038 out += 'Private-key-format: v1.3\n';
56039
56040 if (key.curve === 'nistp256') {
56041 out += 'Algorithm: 13 (ECDSAP256SHA256)\n';
56042 } else if (key.curve === 'nistp384') {
56043 out += 'Algorithm: 14 (ECDSAP384SHA384)\n';
56044 } else {
56045 throw (new Error('Unsupported curve'));
56046 }
56047 var base64Key = key.part['d'].data.toString('base64');
56048 out += 'PrivateKey: ' + base64Key + '\n';
56049
56050 // Assume that we're valid as-of now
56051 var timestamp = new Date();
56052 out += 'Created: ' + dnssecTimestamp(timestamp) + '\n';
56053 out += 'Publish: ' + dnssecTimestamp(timestamp) + '\n';
56054 out += 'Activate: ' + dnssecTimestamp(timestamp) + '\n';
56055
56056 return (Buffer.from(out, 'ascii'));
56057}
56058
56059function write(key, options) {
56060 if (PrivateKey.isPrivateKey(key)) {
56061 if (key.type === 'rsa') {
56062 return (writeRSA(key, options));
56063 } else if (key.type === 'ecdsa') {
56064 return (writeECDSA(key, options));
56065 } else {
56066 throw (new Error('Unsupported algorithm: ' + key.type));
56067 }
56068 } else if (Key.isKey(key)) {
56069 /*
56070 * RFC3110 requires a keyname, and a keytype, which we
56071 * don't really have a mechanism for specifying such
56072 * additional metadata.
56073 */
56074 throw (new Error('Format "dnssec" only supports ' +
56075 'writing private keys'));
56076 } else {
56077 throw (new Error('key is not a Key or PrivateKey'));
56078 }
56079}
56080
56081
56082/***/ }),
56083/* 267 */
56084/***/ (function(module, exports, __webpack_require__) {
56085
56086// Copyright 2015 Joyent, Inc.
56087
56088module.exports = {
56089 read: read,
56090 readPkcs1: readPkcs1,
56091 write: write,
56092 writePkcs1: writePkcs1
56093};
56094
56095var assert = __webpack_require__(22);
56096var asn1 = __webpack_require__(66);
56097var Buffer = __webpack_require__(20).Buffer;
56098var algs = __webpack_require__(39);
56099var utils = __webpack_require__(32);
56100
56101var Key = __webpack_require__(34);
56102var PrivateKey = __webpack_require__(40);
56103var pem = __webpack_require__(82);
56104
56105var pkcs8 = __webpack_require__(145);
56106var readECDSACurve = pkcs8.readECDSACurve;
56107
56108function read(buf, options) {
56109 return (pem.read(buf, options, 'pkcs1'));
56110}
56111
56112function write(key, options) {
56113 return (pem.write(key, options, 'pkcs1'));
56114}
56115
56116/* Helper to read in a single mpint */
56117function readMPInt(der, nm) {
56118 assert.strictEqual(der.peek(), asn1.Ber.Integer,
56119 nm + ' is not an Integer');
56120 return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));
56121}
56122
56123function readPkcs1(alg, type, der) {
56124 switch (alg) {
56125 case 'RSA':
56126 if (type === 'public')
56127 return (readPkcs1RSAPublic(der));
56128 else if (type === 'private')
56129 return (readPkcs1RSAPrivate(der));
56130 throw (new Error('Unknown key type: ' + type));
56131 case 'DSA':
56132 if (type === 'public')
56133 return (readPkcs1DSAPublic(der));
56134 else if (type === 'private')
56135 return (readPkcs1DSAPrivate(der));
56136 throw (new Error('Unknown key type: ' + type));
56137 case 'EC':
56138 case 'ECDSA':
56139 if (type === 'private')
56140 return (readPkcs1ECDSAPrivate(der));
56141 else if (type === 'public')
56142 return (readPkcs1ECDSAPublic(der));
56143 throw (new Error('Unknown key type: ' + type));
56144 case 'EDDSA':
56145 case 'EdDSA':
56146 if (type === 'private')
56147 return (readPkcs1EdDSAPrivate(der));
56148 throw (new Error(type + ' keys not supported with EdDSA'));
56149 default:
56150 throw (new Error('Unknown key algo: ' + alg));
56151 }
56152}
56153
56154function readPkcs1RSAPublic(der) {
56155 // modulus and exponent
56156 var n = readMPInt(der, 'modulus');
56157 var e = readMPInt(der, 'exponent');
56158
56159 // now, make the key
56160 var key = {
56161 type: 'rsa',
56162 parts: [
56163 { name: 'e', data: e },
56164 { name: 'n', data: n }
56165 ]
56166 };
56167
56168 return (new Key(key));
56169}
56170
56171function readPkcs1RSAPrivate(der) {
56172 var version = readMPInt(der, 'version');
56173 assert.strictEqual(version[0], 0);
56174
56175 // modulus then public exponent
56176 var n = readMPInt(der, 'modulus');
56177 var e = readMPInt(der, 'public exponent');
56178 var d = readMPInt(der, 'private exponent');
56179 var p = readMPInt(der, 'prime1');
56180 var q = readMPInt(der, 'prime2');
56181 var dmodp = readMPInt(der, 'exponent1');
56182 var dmodq = readMPInt(der, 'exponent2');
56183 var iqmp = readMPInt(der, 'iqmp');
56184
56185 // now, make the key
56186 var key = {
56187 type: 'rsa',
56188 parts: [
56189 { name: 'n', data: n },
56190 { name: 'e', data: e },
56191 { name: 'd', data: d },
56192 { name: 'iqmp', data: iqmp },
56193 { name: 'p', data: p },
56194 { name: 'q', data: q },
56195 { name: 'dmodp', data: dmodp },
56196 { name: 'dmodq', data: dmodq }
56197 ]
56198 };
56199
56200 return (new PrivateKey(key));
56201}
56202
56203function readPkcs1DSAPrivate(der) {
56204 var version = readMPInt(der, 'version');
56205 assert.strictEqual(version.readUInt8(0), 0);
56206
56207 var p = readMPInt(der, 'p');
56208 var q = readMPInt(der, 'q');
56209 var g = readMPInt(der, 'g');
56210 var y = readMPInt(der, 'y');
56211 var x = readMPInt(der, 'x');
56212
56213 // now, make the key
56214 var key = {
56215 type: 'dsa',
56216 parts: [
56217 { name: 'p', data: p },
56218 { name: 'q', data: q },
56219 { name: 'g', data: g },
56220 { name: 'y', data: y },
56221 { name: 'x', data: x }
56222 ]
56223 };
56224
56225 return (new PrivateKey(key));
56226}
56227
56228function readPkcs1EdDSAPrivate(der) {
56229 var version = readMPInt(der, 'version');
56230 assert.strictEqual(version.readUInt8(0), 1);
56231
56232 // private key
56233 var k = der.readString(asn1.Ber.OctetString, true);
56234
56235 der.readSequence(0xa0);
56236 var oid = der.readOID();
56237 assert.strictEqual(oid, '1.3.101.112', 'the ed25519 curve identifier');
56238
56239 der.readSequence(0xa1);
56240 var A = utils.readBitString(der);
56241
56242 var key = {
56243 type: 'ed25519',
56244 parts: [
56245 { name: 'A', data: utils.zeroPadToLength(A, 32) },
56246 { name: 'k', data: k }
56247 ]
56248 };
56249
56250 return (new PrivateKey(key));
56251}
56252
56253function readPkcs1DSAPublic(der) {
56254 var y = readMPInt(der, 'y');
56255 var p = readMPInt(der, 'p');
56256 var q = readMPInt(der, 'q');
56257 var g = readMPInt(der, 'g');
56258
56259 var key = {
56260 type: 'dsa',
56261 parts: [
56262 { name: 'y', data: y },
56263 { name: 'p', data: p },
56264 { name: 'q', data: q },
56265 { name: 'g', data: g }
56266 ]
56267 };
56268
56269 return (new Key(key));
56270}
56271
56272function readPkcs1ECDSAPublic(der) {
56273 der.readSequence();
56274
56275 var oid = der.readOID();
56276 assert.strictEqual(oid, '1.2.840.10045.2.1', 'must be ecPublicKey');
56277
56278 var curveOid = der.readOID();
56279
56280 var curve;
56281 var curves = Object.keys(algs.curves);
56282 for (var j = 0; j < curves.length; ++j) {
56283 var c = curves[j];
56284 var cd = algs.curves[c];
56285 if (cd.pkcs8oid === curveOid) {
56286 curve = c;
56287 break;
56288 }
56289 }
56290 assert.string(curve, 'a known ECDSA named curve');
56291
56292 var Q = der.readString(asn1.Ber.BitString, true);
56293 Q = utils.ecNormalize(Q);
56294
56295 var key = {
56296 type: 'ecdsa',
56297 parts: [
56298 { name: 'curve', data: Buffer.from(curve) },
56299 { name: 'Q', data: Q }
56300 ]
56301 };
56302
56303 return (new Key(key));
56304}
56305
56306function readPkcs1ECDSAPrivate(der) {
56307 var version = readMPInt(der, 'version');
56308 assert.strictEqual(version.readUInt8(0), 1);
56309
56310 // private key
56311 var d = der.readString(asn1.Ber.OctetString, true);
56312
56313 der.readSequence(0xa0);
56314 var curve = readECDSACurve(der);
56315 assert.string(curve, 'a known elliptic curve');
56316
56317 der.readSequence(0xa1);
56318 var Q = der.readString(asn1.Ber.BitString, true);
56319 Q = utils.ecNormalize(Q);
56320
56321 var key = {
56322 type: 'ecdsa',
56323 parts: [
56324 { name: 'curve', data: Buffer.from(curve) },
56325 { name: 'Q', data: Q },
56326 { name: 'd', data: d }
56327 ]
56328 };
56329
56330 return (new PrivateKey(key));
56331}
56332
56333function writePkcs1(der, key) {
56334 der.startSequence();
56335
56336 switch (key.type) {
56337 case 'rsa':
56338 if (PrivateKey.isPrivateKey(key))
56339 writePkcs1RSAPrivate(der, key);
56340 else
56341 writePkcs1RSAPublic(der, key);
56342 break;
56343 case 'dsa':
56344 if (PrivateKey.isPrivateKey(key))
56345 writePkcs1DSAPrivate(der, key);
56346 else
56347 writePkcs1DSAPublic(der, key);
56348 break;
56349 case 'ecdsa':
56350 if (PrivateKey.isPrivateKey(key))
56351 writePkcs1ECDSAPrivate(der, key);
56352 else
56353 writePkcs1ECDSAPublic(der, key);
56354 break;
56355 case 'ed25519':
56356 if (PrivateKey.isPrivateKey(key))
56357 writePkcs1EdDSAPrivate(der, key);
56358 else
56359 writePkcs1EdDSAPublic(der, key);
56360 break;
56361 default:
56362 throw (new Error('Unknown key algo: ' + key.type));
56363 }
56364
56365 der.endSequence();
56366}
56367
56368function writePkcs1RSAPublic(der, key) {
56369 der.writeBuffer(key.part.n.data, asn1.Ber.Integer);
56370 der.writeBuffer(key.part.e.data, asn1.Ber.Integer);
56371}
56372
56373function writePkcs1RSAPrivate(der, key) {
56374 var ver = Buffer.from([0]);
56375 der.writeBuffer(ver, asn1.Ber.Integer);
56376
56377 der.writeBuffer(key.part.n.data, asn1.Ber.Integer);
56378 der.writeBuffer(key.part.e.data, asn1.Ber.Integer);
56379 der.writeBuffer(key.part.d.data, asn1.Ber.Integer);
56380 der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
56381 der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
56382 if (!key.part.dmodp || !key.part.dmodq)
56383 utils.addRSAMissing(key);
56384 der.writeBuffer(key.part.dmodp.data, asn1.Ber.Integer);
56385 der.writeBuffer(key.part.dmodq.data, asn1.Ber.Integer);
56386 der.writeBuffer(key.part.iqmp.data, asn1.Ber.Integer);
56387}
56388
56389function writePkcs1DSAPrivate(der, key) {
56390 var ver = Buffer.from([0]);
56391 der.writeBuffer(ver, asn1.Ber.Integer);
56392
56393 der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
56394 der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
56395 der.writeBuffer(key.part.g.data, asn1.Ber.Integer);
56396 der.writeBuffer(key.part.y.data, asn1.Ber.Integer);
56397 der.writeBuffer(key.part.x.data, asn1.Ber.Integer);
56398}
56399
56400function writePkcs1DSAPublic(der, key) {
56401 der.writeBuffer(key.part.y.data, asn1.Ber.Integer);
56402 der.writeBuffer(key.part.p.data, asn1.Ber.Integer);
56403 der.writeBuffer(key.part.q.data, asn1.Ber.Integer);
56404 der.writeBuffer(key.part.g.data, asn1.Ber.Integer);
56405}
56406
56407function writePkcs1ECDSAPublic(der, key) {
56408 der.startSequence();
56409
56410 der.writeOID('1.2.840.10045.2.1'); /* ecPublicKey */
56411 var curve = key.part.curve.data.toString();
56412 var curveOid = algs.curves[curve].pkcs8oid;
56413 assert.string(curveOid, 'a known ECDSA named curve');
56414 der.writeOID(curveOid);
56415
56416 der.endSequence();
56417
56418 var Q = utils.ecNormalize(key.part.Q.data, true);
56419 der.writeBuffer(Q, asn1.Ber.BitString);
56420}
56421
56422function writePkcs1ECDSAPrivate(der, key) {
56423 var ver = Buffer.from([1]);
56424 der.writeBuffer(ver, asn1.Ber.Integer);
56425
56426 der.writeBuffer(key.part.d.data, asn1.Ber.OctetString);
56427
56428 der.startSequence(0xa0);
56429 var curve = key.part.curve.data.toString();
56430 var curveOid = algs.curves[curve].pkcs8oid;
56431 assert.string(curveOid, 'a known ECDSA named curve');
56432 der.writeOID(curveOid);
56433 der.endSequence();
56434
56435 der.startSequence(0xa1);
56436 var Q = utils.ecNormalize(key.part.Q.data, true);
56437 der.writeBuffer(Q, asn1.Ber.BitString);
56438 der.endSequence();
56439}
56440
56441function writePkcs1EdDSAPrivate(der, key) {
56442 var ver = Buffer.from([1]);
56443 der.writeBuffer(ver, asn1.Ber.Integer);
56444
56445 der.writeBuffer(key.part.k.data, asn1.Ber.OctetString);
56446
56447 der.startSequence(0xa0);
56448 der.writeOID('1.3.101.112');
56449 der.endSequence();
56450
56451 der.startSequence(0xa1);
56452 utils.writeBitString(der, key.part.A.data);
56453 der.endSequence();
56454}
56455
56456function writePkcs1EdDSAPublic(der, key) {
56457 throw (new Error('Public keys are not supported for EdDSA PKCS#1'));
56458}
56459
56460
56461/***/ }),
56462/* 268 */
56463/***/ (function(module, exports, __webpack_require__) {
56464
56465// Copyright 2015 Joyent, Inc.
56466
56467var Key = __webpack_require__(34);
56468var Fingerprint = __webpack_require__(144);
56469var Signature = __webpack_require__(70);
56470var PrivateKey = __webpack_require__(40);
56471var Certificate = __webpack_require__(143);
56472var Identity = __webpack_require__(146);
56473var errs = __webpack_require__(69);
56474
56475module.exports = {
56476 /* top-level classes */
56477 Key: Key,
56478 parseKey: Key.parse,
56479 Fingerprint: Fingerprint,
56480 parseFingerprint: Fingerprint.parse,
56481 Signature: Signature,
56482 parseSignature: Signature.parse,
56483 PrivateKey: PrivateKey,
56484 parsePrivateKey: PrivateKey.parse,
56485 generatePrivateKey: PrivateKey.generate,
56486 Certificate: Certificate,
56487 parseCertificate: Certificate.parse,
56488 createSelfSignedCertificate: Certificate.createSelfSigned,
56489 createCertificate: Certificate.create,
56490 Identity: Identity,
56491 identityFromDN: Identity.parseDN,
56492 identityForHost: Identity.forHost,
56493 identityForUser: Identity.forUser,
56494 identityForEmail: Identity.forEmail,
56495
56496 /* errors */
56497 FingerprintFormatError: errs.FingerprintFormatError,
56498 InvalidAlgorithmError: errs.InvalidAlgorithmError,
56499 KeyParseError: errs.KeyParseError,
56500 SignatureParseError: errs.SignatureParseError,
56501 KeyEncryptedError: errs.KeyEncryptedError,
56502 CertificateParseError: errs.CertificateParseError
56503};
56504
56505
56506/***/ }),
56507/* 269 */
56508/***/ (function(module, exports, __webpack_require__) {
56509
56510"use strict";
56511
56512const ansiRegex = __webpack_require__(1020);
56513
56514module.exports = input => typeof input === 'string' ? input.replace(ansiRegex(), '') : input;
56515
56516
56517/***/ }),
56518/* 270 */
56519/***/ (function(module, exports) {
56520
56521module.exports = require("child_process");
56522
56523/***/ }),
56524/* 271 */
56525/***/ (function(module, exports) {
56526
56527module.exports = require("punycode");
56528
56529/***/ }),
56530/* 272 */
56531/***/ (function(module, exports) {
56532
56533module.exports = require("string_decoder");
56534
56535/***/ }),
56536/* 273 */
56537/***/ (function(module, exports, __webpack_require__) {
56538
56539"use strict";
56540
56541
56542Object.defineProperty(exports, "__esModule", {
56543 value: true
56544});
56545
56546var _constants;
56547
56548function _load_constants() {
56549 return _constants = _interopRequireWildcard(__webpack_require__(13));
56550}
56551
56552var _access;
56553
56554function _load_access() {
56555 return _access = _interopRequireWildcard(__webpack_require__(480));
56556}
56557
56558var _add;
56559
56560function _load_add() {
56561 return _add = _interopRequireWildcard(__webpack_require__(154));
56562}
56563
56564var _audit;
56565
56566function _load_audit() {
56567 return _audit = _interopRequireWildcard(__webpack_require__(289));
56568}
56569
56570var _autoclean;
56571
56572function _load_autoclean() {
56573 return _autoclean = _interopRequireWildcard(__webpack_require__(290));
56574}
56575
56576var _bin;
56577
56578function _load_bin() {
56579 return _bin = _interopRequireWildcard(__webpack_require__(481));
56580}
56581
56582var _cache;
56583
56584function _load_cache() {
56585 return _cache = _interopRequireWildcard(__webpack_require__(291));
56586}
56587
56588var _check;
56589
56590function _load_check() {
56591 return _check = _interopRequireWildcard(__webpack_require__(292));
56592}
56593
56594var _config;
56595
56596function _load_config() {
56597 return _config = _interopRequireWildcard(__webpack_require__(482));
56598}
56599
56600var _create;
56601
56602function _load_create() {
56603 return _create = _interopRequireWildcard(__webpack_require__(483));
56604}
56605
56606var _exec;
56607
56608function _load_exec() {
56609 return _exec = _interopRequireWildcard(__webpack_require__(484));
56610}
56611
56612var _generateLockEntry;
56613
56614function _load_generateLockEntry() {
56615 return _generateLockEntry = _interopRequireWildcard(__webpack_require__(485));
56616}
56617
56618var _global;
56619
56620function _load_global() {
56621 return _global = _interopRequireWildcard(__webpack_require__(115));
56622}
56623
56624var _help;
56625
56626function _load_help() {
56627 return _help = _interopRequireWildcard(__webpack_require__(486));
56628}
56629
56630var _import;
56631
56632function _load_import() {
56633 return _import = _interopRequireWildcard(__webpack_require__(487));
56634}
56635
56636var _info;
56637
56638function _load_info() {
56639 return _info = _interopRequireWildcard(__webpack_require__(488));
56640}
56641
56642var _init;
56643
56644function _load_init() {
56645 return _init = _interopRequireWildcard(__webpack_require__(489));
56646}
56647
56648var _install;
56649
56650function _load_install() {
56651 return _install = _interopRequireWildcard(__webpack_require__(41));
56652}
56653
56654var _licenses;
56655
56656function _load_licenses() {
56657 return _licenses = _interopRequireWildcard(__webpack_require__(490));
56658}
56659
56660var _link;
56661
56662function _load_link() {
56663 return _link = _interopRequireWildcard(__webpack_require__(293));
56664}
56665
56666var _login;
56667
56668function _load_login() {
56669 return _login = _interopRequireWildcard(__webpack_require__(97));
56670}
56671
56672var _logout;
56673
56674function _load_logout() {
56675 return _logout = _interopRequireWildcard(__webpack_require__(491));
56676}
56677
56678var _list;
56679
56680function _load_list() {
56681 return _list = _interopRequireWildcard(__webpack_require__(294));
56682}
56683
56684var _node;
56685
56686function _load_node() {
56687 return _node = _interopRequireWildcard(__webpack_require__(492));
56688}
56689
56690var _outdated;
56691
56692function _load_outdated() {
56693 return _outdated = _interopRequireWildcard(__webpack_require__(493));
56694}
56695
56696var _owner;
56697
56698function _load_owner() {
56699 return _owner = _interopRequireWildcard(__webpack_require__(494));
56700}
56701
56702var _pack;
56703
56704function _load_pack() {
56705 return _pack = _interopRequireWildcard(__webpack_require__(155));
56706}
56707
56708var _policies;
56709
56710function _load_policies() {
56711 return _policies = _interopRequireWildcard(__webpack_require__(495));
56712}
56713
56714var _publish;
56715
56716function _load_publish() {
56717 return _publish = _interopRequireWildcard(__webpack_require__(496));
56718}
56719
56720var _remove;
56721
56722function _load_remove() {
56723 return _remove = _interopRequireWildcard(__webpack_require__(295));
56724}
56725
56726var _run;
56727
56728function _load_run() {
56729 return _run = _interopRequireWildcard(__webpack_require__(296));
56730}
56731
56732var _tag;
56733
56734function _load_tag() {
56735 return _tag = _interopRequireWildcard(__webpack_require__(297));
56736}
56737
56738var _team;
56739
56740function _load_team() {
56741 return _team = _interopRequireWildcard(__webpack_require__(497));
56742}
56743
56744var _unplug;
56745
56746function _load_unplug() {
56747 return _unplug = _interopRequireWildcard(__webpack_require__(499));
56748}
56749
56750var _unlink;
56751
56752function _load_unlink() {
56753 return _unlink = _interopRequireWildcard(__webpack_require__(498));
56754}
56755
56756var _upgrade;
56757
56758function _load_upgrade() {
56759 return _upgrade = _interopRequireWildcard(__webpack_require__(194));
56760}
56761
56762var _version;
56763
56764function _load_version() {
56765 return _version = _interopRequireWildcard(__webpack_require__(299));
56766}
56767
56768var _versions;
56769
56770function _load_versions() {
56771 return _versions = _interopRequireWildcard(__webpack_require__(500));
56772}
56773
56774var _why;
56775
56776function _load_why() {
56777 return _why = _interopRequireWildcard(__webpack_require__(501));
56778}
56779
56780var _workspaces;
56781
56782function _load_workspaces() {
56783 return _workspaces = _interopRequireWildcard(__webpack_require__(503));
56784}
56785
56786var _workspace;
56787
56788function _load_workspace() {
56789 return _workspace = _interopRequireWildcard(__webpack_require__(502));
56790}
56791
56792var _upgradeInteractive;
56793
56794function _load_upgradeInteractive() {
56795 return _upgradeInteractive = _interopRequireWildcard(__webpack_require__(298));
56796}
56797
56798var _useless;
56799
56800function _load_useless() {
56801 return _useless = _interopRequireDefault(__webpack_require__(479));
56802}
56803
56804var _aliases;
56805
56806function _load_aliases() {
56807 return _aliases = _interopRequireDefault(__webpack_require__(288));
56808}
56809
56810function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
56811
56812function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
56813
56814var chalk = __webpack_require__(37);
56815
56816
56817var getDocsLink = function getDocsLink(name) {
56818 return `${(_constants || _load_constants()).YARN_DOCS}${name || ''}`;
56819};
56820var getDocsInfo = function getDocsInfo(name) {
56821 return 'Visit ' + chalk.bold(getDocsLink(name)) + ' for documentation about this command.';
56822};
56823
56824var commands = {
56825 access: _access || _load_access(),
56826 add: _add || _load_add(),
56827 audit: _audit || _load_audit(),
56828 autoclean: _autoclean || _load_autoclean(),
56829 bin: _bin || _load_bin(),
56830 cache: _cache || _load_cache(),
56831 check: _check || _load_check(),
56832 config: _config || _load_config(),
56833 create: _create || _load_create(),
56834 dedupe: (0, (_useless || _load_useless()).default)("The dedupe command isn't necessary. `yarn install` will already dedupe."),
56835 exec: _exec || _load_exec(),
56836 generateLockEntry: _generateLockEntry || _load_generateLockEntry(),
56837 global: _global || _load_global(),
56838 help: _help || _load_help(),
56839 import: _import || _load_import(),
56840 info: _info || _load_info(),
56841 init: _init || _load_init(),
56842 install: _install || _load_install(),
56843 licenses: _licenses || _load_licenses(),
56844 link: _link || _load_link(),
56845 lockfile: (0, (_useless || _load_useless()).default)("The lockfile command isn't necessary. `yarn install` will produce a lockfile."),
56846 login: _login || _load_login(),
56847 logout: _logout || _load_logout(),
56848 list: _list || _load_list(),
56849 node: _node || _load_node(),
56850 outdated: _outdated || _load_outdated(),
56851 owner: _owner || _load_owner(),
56852 pack: _pack || _load_pack(),
56853 policies: _policies || _load_policies(),
56854 prune: (0, (_useless || _load_useless()).default)("The prune command isn't necessary. `yarn install` will prune extraneous packages."),
56855 publish: _publish || _load_publish(),
56856 remove: _remove || _load_remove(),
56857 run: _run || _load_run(),
56858 tag: _tag || _load_tag(),
56859 team: _team || _load_team(),
56860 unplug: _unplug || _load_unplug(),
56861 unlink: _unlink || _load_unlink(),
56862 upgrade: _upgrade || _load_upgrade(),
56863 version: _version || _load_version(),
56864 versions: _versions || _load_versions(),
56865 why: _why || _load_why(),
56866 workspaces: _workspaces || _load_workspaces(),
56867 workspace: _workspace || _load_workspace(),
56868 upgradeInteractive: _upgradeInteractive || _load_upgradeInteractive()
56869};
56870
56871for (var key in commands) {
56872 commands[key].getDocsInfo = getDocsInfo(key);
56873}
56874
56875for (var _key in (_aliases || _load_aliases()).default) {
56876 commands[_key] = commands[(_aliases || _load_aliases()).default[_key]];
56877 commands[_key].getDocsInfo = getDocsInfo(_key);
56878}
56879
56880exports.default = commands;
56881
56882/***/ }),
56883/* 274 */
56884/***/ (function(module, exports, __webpack_require__) {
56885
56886"use strict";
56887
56888
56889Object.defineProperty(exports, "__esModule", {
56890 value: true
56891});
56892
56893var _map;
56894
56895function _load_map() {
56896 return _map = _interopRequireDefault(__webpack_require__(42));
56897}
56898
56899var _assign;
56900
56901function _load_assign() {
56902 return _assign = _interopRequireDefault(__webpack_require__(23));
56903}
56904
56905var _set;
56906
56907function _load_set() {
56908 return _set = _interopRequireDefault(__webpack_require__(16));
56909}
56910
56911exports.getRcConfigForCwd = getRcConfigForCwd;
56912exports.getRcConfigForFolder = getRcConfigForFolder;
56913exports.getRcArgs = getRcArgs;
56914
56915var _fs;
56916
56917function _load_fs() {
56918 return _fs = __webpack_require__(12);
56919}
56920
56921var _path;
56922
56923function _load_path() {
56924 return _path = __webpack_require__(1);
56925}
56926
56927var _commander;
56928
56929function _load_commander() {
56930 return _commander = _interopRequireDefault(__webpack_require__(277));
56931}
56932
56933var _lockfile;
56934
56935function _load_lockfile() {
56936 return _lockfile = __webpack_require__(25);
56937}
56938
56939var _rc;
56940
56941function _load_rc() {
56942 return _rc = _interopRequireWildcard(__webpack_require__(547));
56943}
56944
56945function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
56946
56947function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
56948
56949// Keys that will get resolved relative to the path of the rc file they belong to
56950var PATH_KEYS = new (_set || _load_set()).default(['yarn-path', 'cache-folder', 'global-folder', 'modules-folder', 'cwd', 'offline-cache-folder']);
56951
56952// given a cwd, load all .yarnrc files relative to it
56953
56954
56955function getRcConfigForCwd(cwd, args) {
56956 var config = {};
56957
56958 if (args.indexOf('--no-default-rc') === -1) {
56959 (0, (_assign || _load_assign()).default)(config, (_rc || _load_rc()).findRc('yarn', cwd, function (fileText, filePath) {
56960 return loadRcFile(fileText, filePath);
56961 }));
56962 }
56963
56964 for (var index = args.indexOf('--use-yarnrc'); index !== -1; index = args.indexOf('--use-yarnrc', index + 1)) {
56965 var value = args[index + 1];
56966
56967 if (value && value.charAt(0) !== '-') {
56968 (0, (_assign || _load_assign()).default)(config, loadRcFile((0, (_fs || _load_fs()).readFileSync)(value, 'utf8'), value));
56969 }
56970 }
56971
56972 return config;
56973}
56974
56975function getRcConfigForFolder(cwd) {
56976 var filePath = (0, (_path || _load_path()).resolve)(cwd, '.yarnrc');
56977 if (!(0, (_fs || _load_fs()).existsSync)(filePath)) {
56978 return {};
56979 }
56980
56981 var fileText = (0, (_fs || _load_fs()).readFileSync)(filePath, 'utf8');
56982 return loadRcFile(fileText, filePath);
56983}
56984
56985function loadRcFile(fileText, filePath) {
56986 var _parse = (0, (_lockfile || _load_lockfile()).parse)(fileText, filePath),
56987 values = _parse.object;
56988
56989 if (filePath.match(/\.yml$/) && typeof values.yarnPath === 'string') {
56990 values = { 'yarn-path': values.yarnPath };
56991 }
56992
56993 // some keys reference directories so keep their relativity
56994 for (var _key in values) {
56995 if (PATH_KEYS.has(_key.replace(/^(--)?([^.]+\.)*/, ''))) {
56996 values[_key] = (0, (_path || _load_path()).resolve)((0, (_path || _load_path()).dirname)(filePath), values[_key]);
56997 }
56998 }
56999
57000 return values;
57001}
57002
57003// get the built of arguments of a .yarnrc chain of the passed cwd
57004function buildRcArgs(cwd, args) {
57005 var config = getRcConfigForCwd(cwd, args);
57006
57007 var argsForCommands = new (_map || _load_map()).default();
57008
57009 for (var _key2 in config) {
57010 // args can be prefixed with the command name they're meant for, eg.
57011 // `--install.check-files true`
57012 var keyMatch = _key2.match(/^--(?:([^.]+)\.)?(.*)$/);
57013 if (!keyMatch) {
57014 continue;
57015 }
57016
57017 var commandName = keyMatch[1] || '*';
57018 var arg = keyMatch[2];
57019 var value = config[_key2];
57020
57021 // create args for this command name if we didn't previously have them
57022 var _args = argsForCommands.get(commandName) || [];
57023 argsForCommands.set(commandName, _args);
57024
57025 // turn config value into appropriate cli flag
57026 var option = (_commander || _load_commander()).default.optionFor(`--${arg}`);
57027
57028 // If commander doesn't recognize the option or it takes a value after it
57029 if (!option || option.optional || option.required) {
57030 _args.push(`--${arg}`, value);
57031 } else if (value === true) {
57032 // we can't force remove an arg from cli
57033 _args.push(`--${arg}`);
57034 }
57035 }
57036
57037 return argsForCommands;
57038}
57039
57040// extract the value of a --cwd arg if present
57041function extractCwdArg(args) {
57042 for (var i = 0, I = args.length; i < I; ++i) {
57043 var arg = args[i];
57044 if (arg === '--') {
57045 return null;
57046 } else if (arg === '--cwd') {
57047 return args[i + 1];
57048 }
57049 }
57050 return null;
57051}
57052
57053// get a list of arguments from .yarnrc that apply to this commandName
57054function getRcArgs(commandName, args) {
57055 var previousCwds = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
57056
57057 // for the cwd, use the --cwd arg if it was passed or else use process.cwd()
57058 var origCwd = extractCwdArg(args) || process.cwd();
57059
57060 // get a map of command names and their arguments
57061 var argMap = buildRcArgs(origCwd, args);
57062
57063 // concat wildcard arguments and arguments meant for this specific command
57064 var newArgs = [].concat(argMap.get('*') || [], argMap.get(commandName) || []);
57065
57066 // check if the .yarnrc args specified a cwd
57067 var newCwd = extractCwdArg(newArgs);
57068 if (newCwd && newCwd !== origCwd) {
57069 // ensure that we don't enter into a loop
57070 if (previousCwds.indexOf(newCwd) !== -1) {
57071 throw new Error(`Recursive .yarnrc files specifying --cwd flags. Bailing out.`);
57072 }
57073
57074 // if we have a new cwd then let's refetch the .yarnrc args relative to it
57075 return getRcArgs(commandName, newArgs, previousCwds.concat(origCwd));
57076 }
57077
57078 return newArgs;
57079}
57080
57081/***/ }),
57082/* 275 */
57083/***/ (function(module, exports, __webpack_require__) {
57084
57085"use strict";
57086
57087
57088Object.defineProperty(exports, "__esModule", {
57089 value: true
57090});
57091
57092var _set;
57093
57094function _load_set() {
57095 return _set = _interopRequireDefault(__webpack_require__(16));
57096}
57097
57098exports.boolify = boolify;
57099exports.boolifyWithDefault = boolifyWithDefault;
57100
57101function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
57102
57103var FALSY_STRINGS = new (_set || _load_set()).default(['0', 'false']);
57104
57105function boolify(val) {
57106 return !FALSY_STRINGS.has(val.toString().toLowerCase());
57107}
57108
57109function boolifyWithDefault(val, defaultResult) {
57110 return val === '' || val === null || val === undefined ? defaultResult : boolify(val);
57111}
57112
57113/***/ }),
57114/* 276 */
57115/***/ (function(module, exports, __webpack_require__) {
57116
57117"use strict";
57118
57119
57120Object.defineProperty(exports, "__esModule", {
57121 value: true
57122});
57123
57124var _getIterator2;
57125
57126function _load_getIterator() {
57127 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
57128}
57129
57130exports.isOffline = isOffline;
57131
57132function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
57133
57134var os = __webpack_require__(72);
57135
57136var IGNORE_INTERFACES = ['lo0', 'awdl0', 'bridge0'];
57137var LOCAL_IPS = ['127.0.0.1', '::1'];
57138
57139function isOffline() {
57140 var interfaces = void 0;
57141
57142 try {
57143 interfaces = os.networkInterfaces();
57144 } catch (e) {
57145 // As of October 2016, Windows Subsystem for Linux (WSL) does not support
57146 // the os.networkInterfaces() call and throws instead. For this platform,
57147 // assume we are online.
57148 if (e.syscall === 'uv_interface_addresses') {
57149 return false;
57150 } else {
57151 throw e;
57152 }
57153 }
57154
57155 for (var name in interfaces) {
57156 if (IGNORE_INTERFACES.indexOf(name) >= 0) {
57157 continue;
57158 }
57159
57160 var addrs = interfaces[name];
57161 for (var _iterator = addrs, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
57162 var _ref;
57163
57164 if (_isArray) {
57165 if (_i >= _iterator.length) break;
57166 _ref = _iterator[_i++];
57167 } else {
57168 _i = _iterator.next();
57169 if (_i.done) break;
57170 _ref = _i.value;
57171 }
57172
57173 var addr = _ref;
57174
57175 if (LOCAL_IPS.indexOf(addr.address) < 0) {
57176 // found a possible remote ip
57177 return false;
57178 }
57179 }
57180 }
57181
57182 return true;
57183}
57184
57185/***/ }),
57186/* 277 */
57187/***/ (function(module, exports, __webpack_require__) {
57188
57189/**
57190 * Module dependencies.
57191 */
57192
57193var EventEmitter = __webpack_require__(95).EventEmitter;
57194var spawn = __webpack_require__(270).spawn;
57195var path = __webpack_require__(1);
57196var dirname = path.dirname;
57197var basename = path.basename;
57198var fs = __webpack_require__(12);
57199
57200/**
57201 * Inherit `Command` from `EventEmitter.prototype`.
57202 */
57203
57204__webpack_require__(9).inherits(Command, EventEmitter);
57205
57206/**
57207 * Expose the root command.
57208 */
57209
57210exports = module.exports = new Command();
57211
57212/**
57213 * Expose `Command`.
57214 */
57215
57216exports.Command = Command;
57217
57218/**
57219 * Expose `Option`.
57220 */
57221
57222exports.Option = Option;
57223
57224/**
57225 * Initialize a new `Option` with the given `flags` and `description`.
57226 *
57227 * @param {String} flags
57228 * @param {String} description
57229 * @api public
57230 */
57231
57232function Option(flags, description) {
57233 this.flags = flags;
57234 this.required = flags.indexOf('<') >= 0;
57235 this.optional = flags.indexOf('[') >= 0;
57236 this.bool = flags.indexOf('-no-') === -1;
57237 flags = flags.split(/[ ,|]+/);
57238 if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
57239 this.long = flags.shift();
57240 this.description = description || '';
57241}
57242
57243/**
57244 * Return option name.
57245 *
57246 * @return {String}
57247 * @api private
57248 */
57249
57250Option.prototype.name = function() {
57251 return this.long
57252 .replace('--', '')
57253 .replace('no-', '');
57254};
57255
57256/**
57257 * Return option name, in a camelcase format that can be used
57258 * as a object attribute key.
57259 *
57260 * @return {String}
57261 * @api private
57262 */
57263
57264Option.prototype.attributeName = function() {
57265 return camelcase(this.name());
57266};
57267
57268/**
57269 * Check if `arg` matches the short or long flag.
57270 *
57271 * @param {String} arg
57272 * @return {Boolean}
57273 * @api private
57274 */
57275
57276Option.prototype.is = function(arg) {
57277 return this.short === arg || this.long === arg;
57278};
57279
57280/**
57281 * Initialize a new `Command`.
57282 *
57283 * @param {String} name
57284 * @api public
57285 */
57286
57287function Command(name) {
57288 this.commands = [];
57289 this.options = [];
57290 this._execs = {};
57291 this._allowUnknownOption = false;
57292 this._args = [];
57293 this._name = name || '';
57294}
57295
57296/**
57297 * Add command `name`.
57298 *
57299 * The `.action()` callback is invoked when the
57300 * command `name` is specified via __ARGV__,
57301 * and the remaining arguments are applied to the
57302 * function for access.
57303 *
57304 * When the `name` is "*" an un-matched command
57305 * will be passed as the first arg, followed by
57306 * the rest of __ARGV__ remaining.
57307 *
57308 * Examples:
57309 *
57310 * program
57311 * .version('0.0.1')
57312 * .option('-C, --chdir <path>', 'change the working directory')
57313 * .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')
57314 * .option('-T, --no-tests', 'ignore test hook')
57315 *
57316 * program
57317 * .command('setup')
57318 * .description('run remote setup commands')
57319 * .action(function() {
57320 * console.log('setup');
57321 * });
57322 *
57323 * program
57324 * .command('exec <cmd>')
57325 * .description('run the given remote command')
57326 * .action(function(cmd) {
57327 * console.log('exec "%s"', cmd);
57328 * });
57329 *
57330 * program
57331 * .command('teardown <dir> [otherDirs...]')
57332 * .description('run teardown commands')
57333 * .action(function(dir, otherDirs) {
57334 * console.log('dir "%s"', dir);
57335 * if (otherDirs) {
57336 * otherDirs.forEach(function (oDir) {
57337 * console.log('dir "%s"', oDir);
57338 * });
57339 * }
57340 * });
57341 *
57342 * program
57343 * .command('*')
57344 * .description('deploy the given env')
57345 * .action(function(env) {
57346 * console.log('deploying "%s"', env);
57347 * });
57348 *
57349 * program.parse(process.argv);
57350 *
57351 * @param {String} name
57352 * @param {String} [desc] for git-style sub-commands
57353 * @return {Command} the new command
57354 * @api public
57355 */
57356
57357Command.prototype.command = function(name, desc, opts) {
57358 if (typeof desc === 'object' && desc !== null) {
57359 opts = desc;
57360 desc = null;
57361 }
57362 opts = opts || {};
57363 var args = name.split(/ +/);
57364 var cmd = new Command(args.shift());
57365
57366 if (desc) {
57367 cmd.description(desc);
57368 this.executables = true;
57369 this._execs[cmd._name] = true;
57370 if (opts.isDefault) this.defaultExecutable = cmd._name;
57371 }
57372 cmd._noHelp = !!opts.noHelp;
57373 this.commands.push(cmd);
57374 cmd.parseExpectedArgs(args);
57375 cmd.parent = this;
57376
57377 if (desc) return this;
57378 return cmd;
57379};
57380
57381/**
57382 * Define argument syntax for the top-level command.
57383 *
57384 * @api public
57385 */
57386
57387Command.prototype.arguments = function(desc) {
57388 return this.parseExpectedArgs(desc.split(/ +/));
57389};
57390
57391/**
57392 * Add an implicit `help [cmd]` subcommand
57393 * which invokes `--help` for the given command.
57394 *
57395 * @api private
57396 */
57397
57398Command.prototype.addImplicitHelpCommand = function() {
57399 this.command('help [cmd]', 'display help for [cmd]');
57400};
57401
57402/**
57403 * Parse expected `args`.
57404 *
57405 * For example `["[type]"]` becomes `[{ required: false, name: 'type' }]`.
57406 *
57407 * @param {Array} args
57408 * @return {Command} for chaining
57409 * @api public
57410 */
57411
57412Command.prototype.parseExpectedArgs = function(args) {
57413 if (!args.length) return;
57414 var self = this;
57415 args.forEach(function(arg) {
57416 var argDetails = {
57417 required: false,
57418 name: '',
57419 variadic: false
57420 };
57421
57422 switch (arg[0]) {
57423 case '<':
57424 argDetails.required = true;
57425 argDetails.name = arg.slice(1, -1);
57426 break;
57427 case '[':
57428 argDetails.name = arg.slice(1, -1);
57429 break;
57430 }
57431
57432 if (argDetails.name.length > 3 && argDetails.name.slice(-3) === '...') {
57433 argDetails.variadic = true;
57434 argDetails.name = argDetails.name.slice(0, -3);
57435 }
57436 if (argDetails.name) {
57437 self._args.push(argDetails);
57438 }
57439 });
57440 return this;
57441};
57442
57443/**
57444 * Register callback `fn` for the command.
57445 *
57446 * Examples:
57447 *
57448 * program
57449 * .command('help')
57450 * .description('display verbose help')
57451 * .action(function() {
57452 * // output help here
57453 * });
57454 *
57455 * @param {Function} fn
57456 * @return {Command} for chaining
57457 * @api public
57458 */
57459
57460Command.prototype.action = function(fn) {
57461 var self = this;
57462 var listener = function(args, unknown) {
57463 // Parse any so-far unknown options
57464 args = args || [];
57465 unknown = unknown || [];
57466
57467 var parsed = self.parseOptions(unknown);
57468
57469 // Output help if necessary
57470 outputHelpIfNecessary(self, parsed.unknown);
57471
57472 // If there are still any unknown options, then we simply
57473 // die, unless someone asked for help, in which case we give it
57474 // to them, and then we die.
57475 if (parsed.unknown.length > 0) {
57476 self.unknownOption(parsed.unknown[0]);
57477 }
57478
57479 // Leftover arguments need to be pushed back. Fixes issue #56
57480 if (parsed.args.length) args = parsed.args.concat(args);
57481
57482 self._args.forEach(function(arg, i) {
57483 if (arg.required && args[i] == null) {
57484 self.missingArgument(arg.name);
57485 } else if (arg.variadic) {
57486 if (i !== self._args.length - 1) {
57487 self.variadicArgNotLast(arg.name);
57488 }
57489
57490 args[i] = args.splice(i);
57491 }
57492 });
57493
57494 // Always append ourselves to the end of the arguments,
57495 // to make sure we match the number of arguments the user
57496 // expects
57497 if (self._args.length) {
57498 args[self._args.length] = self;
57499 } else {
57500 args.push(self);
57501 }
57502
57503 fn.apply(self, args);
57504 };
57505 var parent = this.parent || this;
57506 var name = parent === this ? '*' : this._name;
57507 parent.on('command:' + name, listener);
57508 if (this._alias) parent.on('command:' + this._alias, listener);
57509 return this;
57510};
57511
57512/**
57513 * Define option with `flags`, `description` and optional
57514 * coercion `fn`.
57515 *
57516 * The `flags` string should contain both the short and long flags,
57517 * separated by comma, a pipe or space. The following are all valid
57518 * all will output this way when `--help` is used.
57519 *
57520 * "-p, --pepper"
57521 * "-p|--pepper"
57522 * "-p --pepper"
57523 *
57524 * Examples:
57525 *
57526 * // simple boolean defaulting to false
57527 * program.option('-p, --pepper', 'add pepper');
57528 *
57529 * --pepper
57530 * program.pepper
57531 * // => Boolean
57532 *
57533 * // simple boolean defaulting to true
57534 * program.option('-C, --no-cheese', 'remove cheese');
57535 *
57536 * program.cheese
57537 * // => true
57538 *
57539 * --no-cheese
57540 * program.cheese
57541 * // => false
57542 *
57543 * // required argument
57544 * program.option('-C, --chdir <path>', 'change the working directory');
57545 *
57546 * --chdir /tmp
57547 * program.chdir
57548 * // => "/tmp"
57549 *
57550 * // optional argument
57551 * program.option('-c, --cheese [type]', 'add cheese [marble]');
57552 *
57553 * @param {String} flags
57554 * @param {String} description
57555 * @param {Function|*} [fn] or default
57556 * @param {*} [defaultValue]
57557 * @return {Command} for chaining
57558 * @api public
57559 */
57560
57561Command.prototype.option = function(flags, description, fn, defaultValue) {
57562 var self = this,
57563 option = new Option(flags, description),
57564 oname = option.name(),
57565 name = option.attributeName();
57566
57567 // default as 3rd arg
57568 if (typeof fn !== 'function') {
57569 if (fn instanceof RegExp) {
57570 var regex = fn;
57571 fn = function(val, def) {
57572 var m = regex.exec(val);
57573 return m ? m[0] : def;
57574 };
57575 } else {
57576 defaultValue = fn;
57577 fn = null;
57578 }
57579 }
57580
57581 // preassign default value only for --no-*, [optional], or <required>
57582 if (!option.bool || option.optional || option.required) {
57583 // when --no-* we make sure default is true
57584 if (!option.bool) defaultValue = true;
57585 // preassign only if we have a default
57586 if (defaultValue !== undefined) {
57587 self[name] = defaultValue;
57588 option.defaultValue = defaultValue;
57589 }
57590 }
57591
57592 // register the option
57593 this.options.push(option);
57594
57595 // when it's passed assign the value
57596 // and conditionally invoke the callback
57597 this.on('option:' + oname, function(val) {
57598 // coercion
57599 if (val !== null && fn) {
57600 val = fn(val, self[name] === undefined ? defaultValue : self[name]);
57601 }
57602
57603 // unassigned or bool
57604 if (typeof self[name] === 'boolean' || typeof self[name] === 'undefined') {
57605 // if no value, bool true, and we have a default, then use it!
57606 if (val == null) {
57607 self[name] = option.bool
57608 ? defaultValue || true
57609 : false;
57610 } else {
57611 self[name] = val;
57612 }
57613 } else if (val !== null) {
57614 // reassign
57615 self[name] = val;
57616 }
57617 });
57618
57619 return this;
57620};
57621
57622/**
57623 * Allow unknown options on the command line.
57624 *
57625 * @param {Boolean} arg if `true` or omitted, no error will be thrown
57626 * for unknown options.
57627 * @api public
57628 */
57629Command.prototype.allowUnknownOption = function(arg) {
57630 this._allowUnknownOption = arguments.length === 0 || arg;
57631 return this;
57632};
57633
57634/**
57635 * Parse `argv`, settings options and invoking commands when defined.
57636 *
57637 * @param {Array} argv
57638 * @return {Command} for chaining
57639 * @api public
57640 */
57641
57642Command.prototype.parse = function(argv) {
57643 // implicit help
57644 if (this.executables) this.addImplicitHelpCommand();
57645
57646 // store raw args
57647 this.rawArgs = argv;
57648
57649 // guess name
57650 this._name = this._name || basename(argv[1], '.js');
57651
57652 // github-style sub-commands with no sub-command
57653 if (this.executables && argv.length < 3 && !this.defaultExecutable) {
57654 // this user needs help
57655 argv.push('--help');
57656 }
57657
57658 // process argv
57659 var parsed = this.parseOptions(this.normalize(argv.slice(2)));
57660 var args = this.args = parsed.args;
57661
57662 var result = this.parseArgs(this.args, parsed.unknown);
57663
57664 // executable sub-commands
57665 var name = result.args[0];
57666
57667 var aliasCommand = null;
57668 // check alias of sub commands
57669 if (name) {
57670 aliasCommand = this.commands.filter(function(command) {
57671 return command.alias() === name;
57672 })[0];
57673 }
57674
57675 if (this._execs[name] && typeof this._execs[name] !== 'function') {
57676 return this.executeSubCommand(argv, args, parsed.unknown);
57677 } else if (aliasCommand) {
57678 // is alias of a subCommand
57679 args[0] = aliasCommand._name;
57680 return this.executeSubCommand(argv, args, parsed.unknown);
57681 } else if (this.defaultExecutable) {
57682 // use the default subcommand
57683 args.unshift(this.defaultExecutable);
57684 return this.executeSubCommand(argv, args, parsed.unknown);
57685 }
57686
57687 return result;
57688};
57689
57690/**
57691 * Execute a sub-command executable.
57692 *
57693 * @param {Array} argv
57694 * @param {Array} args
57695 * @param {Array} unknown
57696 * @api private
57697 */
57698
57699Command.prototype.executeSubCommand = function(argv, args, unknown) {
57700 args = args.concat(unknown);
57701
57702 if (!args.length) this.help();
57703 if (args[0] === 'help' && args.length === 1) this.help();
57704
57705 // <cmd> --help
57706 if (args[0] === 'help') {
57707 args[0] = args[1];
57708 args[1] = '--help';
57709 }
57710
57711 // executable
57712 var f = argv[1];
57713 // name of the subcommand, link `pm-install`
57714 var bin = basename(f, '.js') + '-' + args[0];
57715
57716 // In case of globally installed, get the base dir where executable
57717 // subcommand file should be located at
57718 var baseDir,
57719 link = fs.lstatSync(f).isSymbolicLink() ? fs.readlinkSync(f) : f;
57720
57721 // when symbolink is relative path
57722 if (link !== f && link.charAt(0) !== '/') {
57723 link = path.join(dirname(f), link);
57724 }
57725 baseDir = dirname(link);
57726
57727 // prefer local `./<bin>` to bin in the $PATH
57728 var localBin = path.join(baseDir, bin);
57729
57730 // whether bin file is a js script with explicit `.js` extension
57731 var isExplicitJS = false;
57732 if (exists(localBin + '.js')) {
57733 bin = localBin + '.js';
57734 isExplicitJS = true;
57735 } else if (exists(localBin)) {
57736 bin = localBin;
57737 }
57738
57739 args = args.slice(1);
57740
57741 var proc;
57742 if (process.platform !== 'win32') {
57743 if (isExplicitJS) {
57744 args.unshift(bin);
57745 // add executable arguments to spawn
57746 args = (process.execArgv || []).concat(args);
57747
57748 proc = spawn(process.argv[0], args, { stdio: 'inherit', customFds: [0, 1, 2] });
57749 } else {
57750 proc = spawn(bin, args, { stdio: 'inherit', customFds: [0, 1, 2] });
57751 }
57752 } else {
57753 args.unshift(bin);
57754 proc = spawn(process.execPath, args, { stdio: 'inherit' });
57755 }
57756
57757 var signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];
57758 signals.forEach(function(signal) {
57759 process.on(signal, function() {
57760 if (proc.killed === false && proc.exitCode === null) {
57761 proc.kill(signal);
57762 }
57763 });
57764 });
57765 proc.on('close', process.exit.bind(process));
57766 proc.on('error', function(err) {
57767 if (err.code === 'ENOENT') {
57768 console.error('\n %s(1) does not exist, try --help\n', bin);
57769 } else if (err.code === 'EACCES') {
57770 console.error('\n %s(1) not executable. try chmod or run with root\n', bin);
57771 }
57772 process.exit(1);
57773 });
57774
57775 // Store the reference to the child process
57776 this.runningCommand = proc;
57777};
57778
57779/**
57780 * Normalize `args`, splitting joined short flags. For example
57781 * the arg "-abc" is equivalent to "-a -b -c".
57782 * This also normalizes equal sign and splits "--abc=def" into "--abc def".
57783 *
57784 * @param {Array} args
57785 * @return {Array}
57786 * @api private
57787 */
57788
57789Command.prototype.normalize = function(args) {
57790 var ret = [],
57791 arg,
57792 lastOpt,
57793 index;
57794
57795 for (var i = 0, len = args.length; i < len; ++i) {
57796 arg = args[i];
57797 if (i > 0) {
57798 lastOpt = this.optionFor(args[i - 1]);
57799 }
57800
57801 if (arg === '--') {
57802 // Honor option terminator
57803 ret = ret.concat(args.slice(i));
57804 break;
57805 } else if (lastOpt && lastOpt.required) {
57806 ret.push(arg);
57807 } else if (arg.length > 1 && arg[0] === '-' && arg[1] !== '-') {
57808 arg.slice(1).split('').forEach(function(c) {
57809 ret.push('-' + c);
57810 });
57811 } else if (/^--/.test(arg) && ~(index = arg.indexOf('='))) {
57812 ret.push(arg.slice(0, index), arg.slice(index + 1));
57813 } else {
57814 ret.push(arg);
57815 }
57816 }
57817
57818 return ret;
57819};
57820
57821/**
57822 * Parse command `args`.
57823 *
57824 * When listener(s) are available those
57825 * callbacks are invoked, otherwise the "*"
57826 * event is emitted and those actions are invoked.
57827 *
57828 * @param {Array} args
57829 * @return {Command} for chaining
57830 * @api private
57831 */
57832
57833Command.prototype.parseArgs = function(args, unknown) {
57834 var name;
57835
57836 if (args.length) {
57837 name = args[0];
57838 if (this.listeners('command:' + name).length) {
57839 this.emit('command:' + args.shift(), args, unknown);
57840 } else {
57841 this.emit('command:*', args);
57842 }
57843 } else {
57844 outputHelpIfNecessary(this, unknown);
57845
57846 // If there were no args and we have unknown options,
57847 // then they are extraneous and we need to error.
57848 if (unknown.length > 0) {
57849 this.unknownOption(unknown[0]);
57850 }
57851 }
57852
57853 return this;
57854};
57855
57856/**
57857 * Return an option matching `arg` if any.
57858 *
57859 * @param {String} arg
57860 * @return {Option}
57861 * @api private
57862 */
57863
57864Command.prototype.optionFor = function(arg) {
57865 for (var i = 0, len = this.options.length; i < len; ++i) {
57866 if (this.options[i].is(arg)) {
57867 return this.options[i];
57868 }
57869 }
57870};
57871
57872/**
57873 * Parse options from `argv` returning `argv`
57874 * void of these options.
57875 *
57876 * @param {Array} argv
57877 * @return {Array}
57878 * @api public
57879 */
57880
57881Command.prototype.parseOptions = function(argv) {
57882 var args = [],
57883 len = argv.length,
57884 literal,
57885 option,
57886 arg;
57887
57888 var unknownOptions = [];
57889
57890 // parse options
57891 for (var i = 0; i < len; ++i) {
57892 arg = argv[i];
57893
57894 // literal args after --
57895 if (literal) {
57896 args.push(arg);
57897 continue;
57898 }
57899
57900 if (arg === '--') {
57901 literal = true;
57902 continue;
57903 }
57904
57905 // find matching Option
57906 option = this.optionFor(arg);
57907
57908 // option is defined
57909 if (option) {
57910 // requires arg
57911 if (option.required) {
57912 arg = argv[++i];
57913 if (arg == null) return this.optionMissingArgument(option);
57914 this.emit('option:' + option.name(), arg);
57915 // optional arg
57916 } else if (option.optional) {
57917 arg = argv[i + 1];
57918 if (arg == null || (arg[0] === '-' && arg !== '-')) {
57919 arg = null;
57920 } else {
57921 ++i;
57922 }
57923 this.emit('option:' + option.name(), arg);
57924 // bool
57925 } else {
57926 this.emit('option:' + option.name());
57927 }
57928 continue;
57929 }
57930
57931 // looks like an option
57932 if (arg.length > 1 && arg[0] === '-') {
57933 unknownOptions.push(arg);
57934
57935 // If the next argument looks like it might be
57936 // an argument for this option, we pass it on.
57937 // If it isn't, then it'll simply be ignored
57938 if ((i + 1) < argv.length && argv[i + 1][0] !== '-') {
57939 unknownOptions.push(argv[++i]);
57940 }
57941 continue;
57942 }
57943
57944 // arg
57945 args.push(arg);
57946 }
57947
57948 return { args: args, unknown: unknownOptions };
57949};
57950
57951/**
57952 * Return an object containing options as key-value pairs
57953 *
57954 * @return {Object}
57955 * @api public
57956 */
57957Command.prototype.opts = function() {
57958 var result = {},
57959 len = this.options.length;
57960
57961 for (var i = 0; i < len; i++) {
57962 var key = this.options[i].attributeName();
57963 result[key] = key === this._versionOptionName ? this._version : this[key];
57964 }
57965 return result;
57966};
57967
57968/**
57969 * Argument `name` is missing.
57970 *
57971 * @param {String} name
57972 * @api private
57973 */
57974
57975Command.prototype.missingArgument = function(name) {
57976 console.error();
57977 console.error(" error: missing required argument `%s'", name);
57978 console.error();
57979 process.exit(1);
57980};
57981
57982/**
57983 * `Option` is missing an argument, but received `flag` or nothing.
57984 *
57985 * @param {String} option
57986 * @param {String} flag
57987 * @api private
57988 */
57989
57990Command.prototype.optionMissingArgument = function(option, flag) {
57991 console.error();
57992 if (flag) {
57993 console.error(" error: option `%s' argument missing, got `%s'", option.flags, flag);
57994 } else {
57995 console.error(" error: option `%s' argument missing", option.flags);
57996 }
57997 console.error();
57998 process.exit(1);
57999};
58000
58001/**
58002 * Unknown option `flag`.
58003 *
58004 * @param {String} flag
58005 * @api private
58006 */
58007
58008Command.prototype.unknownOption = function(flag) {
58009 if (this._allowUnknownOption) return;
58010 console.error();
58011 console.error(" error: unknown option `%s'", flag);
58012 console.error();
58013 process.exit(1);
58014};
58015
58016/**
58017 * Variadic argument with `name` is not the last argument as required.
58018 *
58019 * @param {String} name
58020 * @api private
58021 */
58022
58023Command.prototype.variadicArgNotLast = function(name) {
58024 console.error();
58025 console.error(" error: variadic arguments must be last `%s'", name);
58026 console.error();
58027 process.exit(1);
58028};
58029
58030/**
58031 * Set the program version to `str`.
58032 *
58033 * This method auto-registers the "-V, --version" flag
58034 * which will print the version number when passed.
58035 *
58036 * @param {String} str
58037 * @param {String} [flags]
58038 * @return {Command} for chaining
58039 * @api public
58040 */
58041
58042Command.prototype.version = function(str, flags) {
58043 if (arguments.length === 0) return this._version;
58044 this._version = str;
58045 flags = flags || '-V, --version';
58046 var versionOption = new Option(flags, 'output the version number');
58047 this._versionOptionName = versionOption.long.substr(2) || 'version';
58048 this.options.push(versionOption);
58049 this.on('option:' + this._versionOptionName, function() {
58050 process.stdout.write(str + '\n');
58051 process.exit(0);
58052 });
58053 return this;
58054};
58055
58056/**
58057 * Set the description to `str`.
58058 *
58059 * @param {String} str
58060 * @param {Object} argsDescription
58061 * @return {String|Command}
58062 * @api public
58063 */
58064
58065Command.prototype.description = function(str, argsDescription) {
58066 if (arguments.length === 0) return this._description;
58067 this._description = str;
58068 this._argsDescription = argsDescription;
58069 return this;
58070};
58071
58072/**
58073 * Set an alias for the command
58074 *
58075 * @param {String} alias
58076 * @return {String|Command}
58077 * @api public
58078 */
58079
58080Command.prototype.alias = function(alias) {
58081 var command = this;
58082 if (this.commands.length !== 0) {
58083 command = this.commands[this.commands.length - 1];
58084 }
58085
58086 if (arguments.length === 0) return command._alias;
58087
58088 if (alias === command._name) throw new Error('Command alias can\'t be the same as its name');
58089
58090 command._alias = alias;
58091 return this;
58092};
58093
58094/**
58095 * Set / get the command usage `str`.
58096 *
58097 * @param {String} str
58098 * @return {String|Command}
58099 * @api public
58100 */
58101
58102Command.prototype.usage = function(str) {
58103 var args = this._args.map(function(arg) {
58104 return humanReadableArgName(arg);
58105 });
58106
58107 var usage = '[options]' +
58108 (this.commands.length ? ' [command]' : '') +
58109 (this._args.length ? ' ' + args.join(' ') : '');
58110
58111 if (arguments.length === 0) return this._usage || usage;
58112 this._usage = str;
58113
58114 return this;
58115};
58116
58117/**
58118 * Get or set the name of the command
58119 *
58120 * @param {String} str
58121 * @return {String|Command}
58122 * @api public
58123 */
58124
58125Command.prototype.name = function(str) {
58126 if (arguments.length === 0) return this._name;
58127 this._name = str;
58128 return this;
58129};
58130
58131/**
58132 * Return prepared commands.
58133 *
58134 * @return {Array}
58135 * @api private
58136 */
58137
58138Command.prototype.prepareCommands = function() {
58139 return this.commands.filter(function(cmd) {
58140 return !cmd._noHelp;
58141 }).map(function(cmd) {
58142 var args = cmd._args.map(function(arg) {
58143 return humanReadableArgName(arg);
58144 }).join(' ');
58145
58146 return [
58147 cmd._name +
58148 (cmd._alias ? '|' + cmd._alias : '') +
58149 (cmd.options.length ? ' [options]' : '') +
58150 (args ? ' ' + args : ''),
58151 cmd._description
58152 ];
58153 });
58154};
58155
58156/**
58157 * Return the largest command length.
58158 *
58159 * @return {Number}
58160 * @api private
58161 */
58162
58163Command.prototype.largestCommandLength = function() {
58164 var commands = this.prepareCommands();
58165 return commands.reduce(function(max, command) {
58166 return Math.max(max, command[0].length);
58167 }, 0);
58168};
58169
58170/**
58171 * Return the largest option length.
58172 *
58173 * @return {Number}
58174 * @api private
58175 */
58176
58177Command.prototype.largestOptionLength = function() {
58178 var options = [].slice.call(this.options);
58179 options.push({
58180 flags: '-h, --help'
58181 });
58182 return options.reduce(function(max, option) {
58183 return Math.max(max, option.flags.length);
58184 }, 0);
58185};
58186
58187/**
58188 * Return the largest arg length.
58189 *
58190 * @return {Number}
58191 * @api private
58192 */
58193
58194Command.prototype.largestArgLength = function() {
58195 return this._args.reduce(function(max, arg) {
58196 return Math.max(max, arg.name.length);
58197 }, 0);
58198};
58199
58200/**
58201 * Return the pad width.
58202 *
58203 * @return {Number}
58204 * @api private
58205 */
58206
58207Command.prototype.padWidth = function() {
58208 var width = this.largestOptionLength();
58209 if (this._argsDescription && this._args.length) {
58210 if (this.largestArgLength() > width) {
58211 width = this.largestArgLength();
58212 }
58213 }
58214
58215 if (this.commands && this.commands.length) {
58216 if (this.largestCommandLength() > width) {
58217 width = this.largestCommandLength();
58218 }
58219 }
58220
58221 return width;
58222};
58223
58224/**
58225 * Return help for options.
58226 *
58227 * @return {String}
58228 * @api private
58229 */
58230
58231Command.prototype.optionHelp = function() {
58232 var width = this.padWidth();
58233
58234 // Append the help information
58235 return this.options.map(function(option) {
58236 return pad(option.flags, width) + ' ' + option.description +
58237 ((option.bool && option.defaultValue !== undefined) ? ' (default: ' + option.defaultValue + ')' : '');
58238 }).concat([pad('-h, --help', width) + ' ' + 'output usage information'])
58239 .join('\n');
58240};
58241
58242/**
58243 * Return command help documentation.
58244 *
58245 * @return {String}
58246 * @api private
58247 */
58248
58249Command.prototype.commandHelp = function() {
58250 if (!this.commands.length) return '';
58251
58252 var commands = this.prepareCommands();
58253 var width = this.padWidth();
58254
58255 return [
58256 ' Commands:',
58257 '',
58258 commands.map(function(cmd) {
58259 var desc = cmd[1] ? ' ' + cmd[1] : '';
58260 return (desc ? pad(cmd[0], width) : cmd[0]) + desc;
58261 }).join('\n').replace(/^/gm, ' '),
58262 ''
58263 ].join('\n');
58264};
58265
58266/**
58267 * Return program help documentation.
58268 *
58269 * @return {String}
58270 * @api private
58271 */
58272
58273Command.prototype.helpInformation = function() {
58274 var desc = [];
58275 if (this._description) {
58276 desc = [
58277 ' ' + this._description,
58278 ''
58279 ];
58280
58281 var argsDescription = this._argsDescription;
58282 if (argsDescription && this._args.length) {
58283 var width = this.padWidth();
58284 desc.push(' Arguments:');
58285 desc.push('');
58286 this._args.forEach(function(arg) {
58287 desc.push(' ' + pad(arg.name, width) + ' ' + argsDescription[arg.name]);
58288 });
58289 desc.push('');
58290 }
58291 }
58292
58293 var cmdName = this._name;
58294 if (this._alias) {
58295 cmdName = cmdName + '|' + this._alias;
58296 }
58297 var usage = [
58298 '',
58299 ' Usage: ' + cmdName + ' ' + this.usage(),
58300 ''
58301 ];
58302
58303 var cmds = [];
58304 var commandHelp = this.commandHelp();
58305 if (commandHelp) cmds = [commandHelp];
58306
58307 var options = [
58308 ' Options:',
58309 '',
58310 '' + this.optionHelp().replace(/^/gm, ' '),
58311 ''
58312 ];
58313
58314 return usage
58315 .concat(desc)
58316 .concat(options)
58317 .concat(cmds)
58318 .join('\n');
58319};
58320
58321/**
58322 * Output help information for this command
58323 *
58324 * @api public
58325 */
58326
58327Command.prototype.outputHelp = function(cb) {
58328 if (!cb) {
58329 cb = function(passthru) {
58330 return passthru;
58331 };
58332 }
58333 process.stdout.write(cb(this.helpInformation()));
58334 this.emit('--help');
58335};
58336
58337/**
58338 * Output help information and exit.
58339 *
58340 * @api public
58341 */
58342
58343Command.prototype.help = function(cb) {
58344 this.outputHelp(cb);
58345 process.exit();
58346};
58347
58348/**
58349 * Camel-case the given `flag`
58350 *
58351 * @param {String} flag
58352 * @return {String}
58353 * @api private
58354 */
58355
58356function camelcase(flag) {
58357 return flag.split('-').reduce(function(str, word) {
58358 return str + word[0].toUpperCase() + word.slice(1);
58359 });
58360}
58361
58362/**
58363 * Pad `str` to `width`.
58364 *
58365 * @param {String} str
58366 * @param {Number} width
58367 * @return {String}
58368 * @api private
58369 */
58370
58371function pad(str, width) {
58372 var len = Math.max(0, width - str.length);
58373 return str + Array(len + 1).join(' ');
58374}
58375
58376/**
58377 * Output help information if necessary
58378 *
58379 * @param {Command} command to output help for
58380 * @param {Array} array of options to search for -h or --help
58381 * @api private
58382 */
58383
58384function outputHelpIfNecessary(cmd, options) {
58385 options = options || [];
58386 for (var i = 0; i < options.length; i++) {
58387 if (options[i] === '--help' || options[i] === '-h') {
58388 cmd.outputHelp();
58389 process.exit(0);
58390 }
58391 }
58392}
58393
58394/**
58395 * Takes an argument an returns its human readable equivalent for help usage.
58396 *
58397 * @param {Object} arg
58398 * @return {String}
58399 * @api private
58400 */
58401
58402function humanReadableArgName(arg) {
58403 var nameOutput = arg.name + (arg.variadic === true ? '...' : '');
58404
58405 return arg.required
58406 ? '<' + nameOutput + '>'
58407 : '[' + nameOutput + ']';
58408}
58409
58410// for versions before node v0.8 when there weren't `fs.existsSync`
58411function exists(file) {
58412 try {
58413 if (fs.statSync(file).isFile()) {
58414 return true;
58415 }
58416 } catch (e) {
58417 return false;
58418 }
58419}
58420
58421
58422/***/ }),
58423/* 278 */
58424/***/ (function(module, exports, __webpack_require__) {
58425
58426module.exports = __webpack_require__(450)().Promise
58427
58428
58429/***/ }),
58430/* 279 */
58431/***/ (function(module, exports) {
58432
58433// API
58434module.exports = abort;
58435
58436/**
58437 * Aborts leftover active jobs
58438 *
58439 * @param {object} state - current state object
58440 */
58441function abort(state)
58442{
58443 Object.keys(state.jobs).forEach(clean.bind(state));
58444
58445 // reset leftover jobs
58446 state.jobs = {};
58447}
58448
58449/**
58450 * Cleans up leftover job by invoking abort function for the provided job id
58451 *
58452 * @this state
58453 * @param {string|number} key - job id to abort
58454 */
58455function clean(key)
58456{
58457 if (typeof this.jobs[key] == 'function')
58458 {
58459 this.jobs[key]();
58460 }
58461}
58462
58463
58464/***/ }),
58465/* 280 */
58466/***/ (function(module, exports, __webpack_require__) {
58467
58468var defer = __webpack_require__(459);
58469
58470// API
58471module.exports = async;
58472
58473/**
58474 * Runs provided callback asynchronously
58475 * even if callback itself is not
58476 *
58477 * @param {function} callback - callback to invoke
58478 * @returns {function} - augmented callback
58479 */
58480function async(callback)
58481{
58482 var isAsync = false;
58483
58484 // check if async happened
58485 defer(function() { isAsync = true; });
58486
58487 return function async_callback(err, result)
58488 {
58489 if (isAsync)
58490 {
58491 callback(err, result);
58492 }
58493 else
58494 {
58495 defer(function nextTick_callback()
58496 {
58497 callback(err, result);
58498 });
58499 }
58500 };
58501}
58502
58503
58504/***/ }),
58505/* 281 */
58506/***/ (function(module, exports, __webpack_require__) {
58507
58508var async = __webpack_require__(280)
58509 , abort = __webpack_require__(279)
58510 ;
58511
58512// API
58513module.exports = iterate;
58514
58515/**
58516 * Iterates over each job object
58517 *
58518 * @param {array|object} list - array or object (named list) to iterate over
58519 * @param {function} iterator - iterator to run
58520 * @param {object} state - current job status
58521 * @param {function} callback - invoked when all elements processed
58522 */
58523function iterate(list, iterator, state, callback)
58524{
58525 // store current index
58526 var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
58527
58528 state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
58529 {
58530 // don't repeat yourself
58531 // skip secondary callbacks
58532 if (!(key in state.jobs))
58533 {
58534 return;
58535 }
58536
58537 // clean up jobs
58538 delete state.jobs[key];
58539
58540 if (error)
58541 {
58542 // don't process rest of the results
58543 // stop still active jobs
58544 // and reset the list
58545 abort(state);
58546 }
58547 else
58548 {
58549 state.results[key] = output;
58550 }
58551
58552 // return salvaged results
58553 callback(error, state.results);
58554 });
58555}
58556
58557/**
58558 * Runs iterator over provided job element
58559 *
58560 * @param {function} iterator - iterator to invoke
58561 * @param {string|number} key - key/index of the element in the list of jobs
58562 * @param {mixed} item - job description
58563 * @param {function} callback - invoked after iterator is done with the job
58564 * @returns {function|mixed} - job abort function or something else
58565 */
58566function runJob(iterator, key, item, callback)
58567{
58568 var aborter;
58569
58570 // allow shortcut if iterator expects only two arguments
58571 if (iterator.length == 2)
58572 {
58573 aborter = iterator(item, async(callback));
58574 }
58575 // otherwise go with full three arguments
58576 else
58577 {
58578 aborter = iterator(item, key, async(callback));
58579 }
58580
58581 return aborter;
58582}
58583
58584
58585/***/ }),
58586/* 282 */
58587/***/ (function(module, exports) {
58588
58589// API
58590module.exports = state;
58591
58592/**
58593 * Creates initial state object
58594 * for iteration over list
58595 *
58596 * @param {array|object} list - list to iterate over
58597 * @param {function|null} sortMethod - function to use for keys sort,
58598 * or `null` to keep them as is
58599 * @returns {object} - initial state object
58600 */
58601function state(list, sortMethod)
58602{
58603 var isNamedList = !Array.isArray(list)
58604 , initState =
58605 {
58606 index : 0,
58607 keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
58608 jobs : {},
58609 results : isNamedList ? {} : [],
58610 size : isNamedList ? Object.keys(list).length : list.length
58611 }
58612 ;
58613
58614 if (sortMethod)
58615 {
58616 // sort array keys based on it's values
58617 // sort object's keys just on own merit
58618 initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)
58619 {
58620 return sortMethod(list[a], list[b]);
58621 });
58622 }
58623
58624 return initState;
58625}
58626
58627
58628/***/ }),
58629/* 283 */
58630/***/ (function(module, exports, __webpack_require__) {
58631
58632var abort = __webpack_require__(279)
58633 , async = __webpack_require__(280)
58634 ;
58635
58636// API
58637module.exports = terminator;
58638
58639/**
58640 * Terminates jobs in the attached state context
58641 *
58642 * @this AsyncKitState#
58643 * @param {function} callback - final callback to invoke after termination
58644 */
58645function terminator(callback)
58646{
58647 if (!Object.keys(this.jobs).length)
58648 {
58649 return;
58650 }
58651
58652 // fast forward iteration index
58653 this.index = this.size;
58654
58655 // abort jobs
58656 abort(this);
58657
58658 // send back results we have so far
58659 async(callback)(null, this.results);
58660}
58661
58662
58663/***/ }),
58664/* 284 */
58665/***/ (function(module, exports, __webpack_require__) {
58666
58667var iterate = __webpack_require__(281)
58668 , initState = __webpack_require__(282)
58669 , terminator = __webpack_require__(283)
58670 ;
58671
58672// Public API
58673module.exports = serialOrdered;
58674// sorting helpers
58675module.exports.ascending = ascending;
58676module.exports.descending = descending;
58677
58678/**
58679 * Runs iterator over provided sorted array elements in series
58680 *
58681 * @param {array|object} list - array or object (named list) to iterate over
58682 * @param {function} iterator - iterator to run
58683 * @param {function} sortMethod - custom sort function
58684 * @param {function} callback - invoked when all elements processed
58685 * @returns {function} - jobs terminator
58686 */
58687function serialOrdered(list, iterator, sortMethod, callback)
58688{
58689 var state = initState(list, sortMethod);
58690
58691 iterate(list, iterator, state, function iteratorHandler(error, result)
58692 {
58693 if (error)
58694 {
58695 callback(error, result);
58696 return;
58697 }
58698
58699 state.index++;
58700
58701 // are we there yet?
58702 if (state.index < (state['keyedList'] || list).length)
58703 {
58704 iterate(list, iterator, state, iteratorHandler);
58705 return;
58706 }
58707
58708 // done here
58709 callback(null, state.results);
58710 });
58711
58712 return terminator.bind(state, callback);
58713}
58714
58715/*
58716 * -- Sort methods
58717 */
58718
58719/**
58720 * sort helper to sort array elements in ascending order
58721 *
58722 * @param {mixed} a - an item to compare
58723 * @param {mixed} b - an item to compare
58724 * @returns {number} - comparison result
58725 */
58726function ascending(a, b)
58727{
58728 return a < b ? -1 : a > b ? 1 : 0;
58729}
58730
58731/**
58732 * sort helper to sort array elements in descending order
58733 *
58734 * @param {mixed} a - an item to compare
58735 * @param {mixed} b - an item to compare
58736 * @returns {number} - comparison result
58737 */
58738function descending(a, b)
58739{
58740 return -1 * ascending(a, b);
58741}
58742
58743
58744/***/ }),
58745/* 285 */
58746/***/ (function(module, exports, __webpack_require__) {
58747
58748"use strict";
58749
58750/**
58751 * `input` type prompt
58752 */
58753
58754var _classCallCheck2;
58755
58756function _load_classCallCheck() {
58757 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
58758}
58759
58760var _possibleConstructorReturn2;
58761
58762function _load_possibleConstructorReturn() {
58763 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
58764}
58765
58766var _inherits2;
58767
58768function _load_inherits() {
58769 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
58770}
58771
58772function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
58773
58774var chalk = __webpack_require__(37);
58775
58776var _require = __webpack_require__(65),
58777 map = _require.map,
58778 takeUntil = _require.takeUntil;
58779
58780var Base = __webpack_require__(73);
58781var observe = __webpack_require__(74);
58782
58783var InputPrompt = function (_Base) {
58784 (0, (_inherits2 || _load_inherits()).default)(InputPrompt, _Base);
58785
58786 function InputPrompt() {
58787 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, InputPrompt);
58788 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.apply(this, arguments));
58789 }
58790
58791 /**
58792 * Start the Inquiry session
58793 * @param {Function} cb Callback when prompt is done
58794 * @return {this}
58795 */
58796
58797 InputPrompt.prototype._run = function _run(cb) {
58798 this.done = cb;
58799
58800 // Once user confirm (enter key)
58801 var events = observe(this.rl);
58802 var submit = events.line.pipe(map(this.filterInput.bind(this)));
58803
58804 var validation = this.handleSubmitEvents(submit);
58805 validation.success.forEach(this.onEnd.bind(this));
58806 validation.error.forEach(this.onError.bind(this));
58807
58808 events.keypress.pipe(takeUntil(validation.success)).forEach(this.onKeypress.bind(this));
58809
58810 // Init
58811 this.render();
58812
58813 return this;
58814 };
58815
58816 /**
58817 * Render the prompt to screen
58818 * @return {InputPrompt} self
58819 */
58820
58821 InputPrompt.prototype.render = function render(error) {
58822 var bottomContent = '';
58823 var appendContent = '';
58824 var message = this.getQuestion();
58825 var transformer = this.opt.transformer;
58826 var isFinal = this.status === 'answered';
58827
58828 if (isFinal) {
58829 appendContent = this.answer;
58830 } else {
58831 appendContent = this.rl.line;
58832 }
58833
58834 if (transformer) {
58835 message += transformer(appendContent, this.answers, { isFinal });
58836 } else {
58837 message += isFinal ? chalk.cyan(appendContent) : appendContent;
58838 }
58839
58840 if (error) {
58841 bottomContent = chalk.red('>> ') + error;
58842 }
58843
58844 this.screen.render(message, bottomContent);
58845 };
58846
58847 /**
58848 * When user press `enter` key
58849 */
58850
58851 InputPrompt.prototype.filterInput = function filterInput(input) {
58852 if (!input) {
58853 return this.opt.default == null ? '' : this.opt.default;
58854 }
58855 return input;
58856 };
58857
58858 InputPrompt.prototype.onEnd = function onEnd(state) {
58859 this.answer = state.value;
58860 this.status = 'answered';
58861
58862 // Re-render prompt
58863 this.render();
58864
58865 this.screen.done();
58866 this.done(state.value);
58867 };
58868
58869 InputPrompt.prototype.onError = function onError(state) {
58870 this.render(state.isValid);
58871 };
58872
58873 /**
58874 * When user press a key
58875 */
58876
58877 InputPrompt.prototype.onKeypress = function onKeypress() {
58878 // If user press a key, just clear the default value
58879 if (this.opt.default) {
58880 this.opt.default = undefined;
58881 }
58882
58883 this.render();
58884 };
58885
58886 return InputPrompt;
58887}(Base);
58888
58889module.exports = InputPrompt;
58890
58891/***/ }),
58892/* 286 */
58893/***/ (function(module, exports, __webpack_require__) {
58894
58895"use strict";
58896
58897
58898var _classCallCheck2;
58899
58900function _load_classCallCheck() {
58901 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
58902}
58903
58904function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
58905
58906var _ = __webpack_require__(45);
58907var MuteStream = __webpack_require__(371);
58908var readline = __webpack_require__(187);
58909
58910/**
58911 * Base interface class other can inherits from
58912 */
58913
58914var UI = function () {
58915 function UI(opt) {
58916 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, UI);
58917
58918 // Instantiate the Readline interface
58919 // @Note: Don't reassign if already present (allow test to override the Stream)
58920 if (!this.rl) {
58921 this.rl = readline.createInterface(setupReadlineOptions(opt));
58922 }
58923 this.rl.resume();
58924
58925 this.onForceClose = this.onForceClose.bind(this);
58926
58927 // Make sure new prompt start on a newline when closing
58928 process.on('exit', this.onForceClose);
58929
58930 // Terminate process on SIGINT (which will call process.on('exit') in return)
58931 this.rl.on('SIGINT', this.onForceClose);
58932 }
58933
58934 /**
58935 * Handle the ^C exit
58936 * @return {null}
58937 */
58938
58939 UI.prototype.onForceClose = function onForceClose() {
58940 this.close();
58941 process.kill(process.pid, 'SIGINT');
58942 console.log('');
58943 };
58944
58945 /**
58946 * Close the interface and cleanup listeners
58947 */
58948
58949 UI.prototype.close = function close() {
58950 // Remove events listeners
58951 this.rl.removeListener('SIGINT', this.onForceClose);
58952 process.removeListener('exit', this.onForceClose);
58953
58954 this.rl.output.unmute();
58955
58956 if (this.activePrompt && typeof this.activePrompt.close === 'function') {
58957 this.activePrompt.close();
58958 }
58959
58960 // Close the readline
58961 this.rl.output.end();
58962 this.rl.pause();
58963 this.rl.close();
58964 };
58965
58966 return UI;
58967}();
58968
58969function setupReadlineOptions(opt) {
58970 opt = opt || {};
58971
58972 // Default `input` to stdin
58973 var input = opt.input || process.stdin;
58974
58975 // Add mute capabilities to the output
58976 var ms = new MuteStream();
58977 ms.pipe(opt.output || process.stdout);
58978 var output = ms;
58979
58980 return _.extend({
58981 terminal: true,
58982 input: input,
58983 output: output
58984 }, _.omit(opt, ['input', 'output']));
58985}
58986
58987module.exports = UI;
58988
58989/***/ }),
58990/* 287 */
58991/***/ (function(module, exports, __webpack_require__) {
58992
58993"use strict";
58994
58995
58996var ansiEscapes = __webpack_require__(445);
58997
58998/**
58999 * Move cursor left by `x`
59000 * @param {Readline} rl - Readline instance
59001 * @param {Number} x - How far to go left (default to 1)
59002 */
59003
59004exports.left = function (rl, x) {
59005 rl.output.write(ansiEscapes.cursorBackward(x));
59006};
59007
59008/**
59009 * Move cursor right by `x`
59010 * @param {Readline} rl - Readline instance
59011 * @param {Number} x - How far to go left (default to 1)
59012 */
59013
59014exports.right = function (rl, x) {
59015 rl.output.write(ansiEscapes.cursorForward(x));
59016};
59017
59018/**
59019 * Move cursor up by `x`
59020 * @param {Readline} rl - Readline instance
59021 * @param {Number} x - How far to go up (default to 1)
59022 */
59023
59024exports.up = function (rl, x) {
59025 rl.output.write(ansiEscapes.cursorUp(x));
59026};
59027
59028/**
59029 * Move cursor down by `x`
59030 * @param {Readline} rl - Readline instance
59031 * @param {Number} x - How far to go down (default to 1)
59032 */
59033
59034exports.down = function (rl, x) {
59035 rl.output.write(ansiEscapes.cursorDown(x));
59036};
59037
59038/**
59039 * Clear current line
59040 * @param {Readline} rl - Readline instance
59041 * @param {Number} len - number of line to delete
59042 */
59043exports.clearLine = function (rl, len) {
59044 rl.output.write(ansiEscapes.eraseLines(len));
59045};
59046
59047/***/ }),
59048/* 288 */
59049/***/ (function(module, exports, __webpack_require__) {
59050
59051"use strict";
59052
59053
59054Object.defineProperty(exports, "__esModule", {
59055 value: true
59056});
59057exports.default = {
59058 'upgrade-interactive': 'upgradeInteractive',
59059 'generate-lock-entry': 'generateLockEntry'
59060};
59061
59062/***/ }),
59063/* 289 */
59064/***/ (function(module, exports, __webpack_require__) {
59065
59066"use strict";
59067
59068
59069Object.defineProperty(exports, "__esModule", {
59070 value: true
59071});
59072exports.run = undefined;
59073
59074var _stringify;
59075
59076function _load_stringify() {
59077 return _stringify = _interopRequireDefault(__webpack_require__(36));
59078}
59079
59080var _keys;
59081
59082function _load_keys() {
59083 return _keys = _interopRequireDefault(__webpack_require__(14));
59084}
59085
59086var _assign;
59087
59088function _load_assign() {
59089 return _assign = _interopRequireDefault(__webpack_require__(23));
59090}
59091
59092var _getIterator2;
59093
59094function _load_getIterator() {
59095 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
59096}
59097
59098var _classCallCheck2;
59099
59100function _load_classCallCheck() {
59101 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
59102}
59103
59104var _asyncToGenerator2;
59105
59106function _load_asyncToGenerator() {
59107 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
59108}
59109
59110var run = exports.run = function () {
59111 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
59112 var DEFAULT_LOG_LEVEL = 'info';
59113 var audit = new Audit(config, reporter, {
59114 groups: flags.groups || (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES,
59115 level: flags.level || DEFAULT_LOG_LEVEL
59116 });
59117 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
59118 var install = new (_install || _load_install()).Install({}, config, reporter, lockfile);
59119
59120 var _ref2 = yield install.fetchRequestFromCwd(),
59121 manifest = _ref2.manifest,
59122 requests = _ref2.requests,
59123 patterns = _ref2.patterns,
59124 workspaceLayout = _ref2.workspaceLayout;
59125
59126 yield install.resolver.init(requests, {
59127 workspaceLayout
59128 });
59129
59130 var vulnerabilities = yield audit.performAudit(manifest, lockfile, install.resolver, install.linker, patterns);
59131
59132 var EXIT_INFO = 1;
59133 var EXIT_LOW = 2;
59134 var EXIT_MODERATE = 4;
59135 var EXIT_HIGH = 8;
59136 var EXIT_CRITICAL = 16;
59137
59138 var exitCode = (vulnerabilities.info ? EXIT_INFO : 0) + (vulnerabilities.low ? EXIT_LOW : 0) + (vulnerabilities.moderate ? EXIT_MODERATE : 0) + (vulnerabilities.high ? EXIT_HIGH : 0) + (vulnerabilities.critical ? EXIT_CRITICAL : 0);
59139
59140 if (flags.summary) {
59141 audit.summary();
59142 } else {
59143 audit.report();
59144 }
59145
59146 return exitCode;
59147 });
59148
59149 return function run(_x, _x2, _x3, _x4) {
59150 return _ref.apply(this, arguments);
59151 };
59152}();
59153
59154exports.setFlags = setFlags;
59155exports.hasWrapper = hasWrapper;
59156
59157var _promise;
59158
59159function _load_promise() {
59160 return _promise = __webpack_require__(86);
59161}
59162
59163var _hoistedTreeBuilder;
59164
59165function _load_hoistedTreeBuilder() {
59166 return _hoistedTreeBuilder = __webpack_require__(509);
59167}
59168
59169var _getTransitiveDevDependencies;
59170
59171function _load_getTransitiveDevDependencies() {
59172 return _getTransitiveDevDependencies = __webpack_require__(537);
59173}
59174
59175var _install;
59176
59177function _load_install() {
59178 return _install = __webpack_require__(41);
59179}
59180
59181var _lockfile;
59182
59183function _load_lockfile() {
59184 return _lockfile = _interopRequireDefault(__webpack_require__(25));
59185}
59186
59187var _constants;
59188
59189function _load_constants() {
59190 return _constants = __webpack_require__(13);
59191}
59192
59193function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
59194
59195var zlib = __webpack_require__(188);
59196
59197var gzip = (0, (_promise || _load_promise()).promisify)(zlib.gzip);
59198
59199function setFlags(commander) {
59200 commander.description('Checks for known security issues with the installed packages.');
59201 commander.option('--summary', 'Only print the summary.');
59202 commander.option('--groups <group_name> [<group_name> ...]', `Only audit dependencies from listed groups. Default: ${(_constants || _load_constants()).OWNED_DEPENDENCY_TYPES.join(', ')}`, function (groups) {
59203 return groups.split(' ');
59204 }, (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES);
59205 commander.option('--level <severity>', `Only print advisories with severity greater than or equal to one of the following: \
59206 info|low|moderate|high|critical. Default: info`, 'info');
59207}
59208
59209function hasWrapper(commander, args) {
59210 return true;
59211}
59212
59213var Audit = function () {
59214 function Audit(config, reporter, options) {
59215 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Audit);
59216 this.severityLevels = ['info', 'low', 'moderate', 'high', 'critical'];
59217
59218 this.config = config;
59219 this.reporter = reporter;
59220 this.options = options;
59221 }
59222
59223 Audit.prototype._mapHoistedNodes = function _mapHoistedNodes(auditNode, hoistedNodes, transitiveDevDeps) {
59224 for (var _iterator = hoistedNodes, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
59225 var _ref3;
59226
59227 if (_isArray) {
59228 if (_i >= _iterator.length) break;
59229 _ref3 = _iterator[_i++];
59230 } else {
59231 _i = _iterator.next();
59232 if (_i.done) break;
59233 _ref3 = _i.value;
59234 }
59235
59236 var node = _ref3;
59237
59238 var pkg = node.manifest.pkg;
59239 var _requires = (0, (_assign || _load_assign()).default)({}, pkg.dependencies || {}, pkg.optionalDependencies || {});
59240 for (var _iterator2 = (0, (_keys || _load_keys()).default)(_requires), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
59241 var _ref4;
59242
59243 if (_isArray2) {
59244 if (_i2 >= _iterator2.length) break;
59245 _ref4 = _iterator2[_i2++];
59246 } else {
59247 _i2 = _iterator2.next();
59248 if (_i2.done) break;
59249 _ref4 = _i2.value;
59250 }
59251
59252 var _name = _ref4;
59253
59254 if (!_requires[_name]) {
59255 _requires[_name] = '*';
59256 }
59257 }
59258 auditNode.dependencies[node.name] = {
59259 version: node.version,
59260 integrity: pkg._remote ? pkg._remote.integrity || '' : '',
59261 requires: _requires,
59262 dependencies: {},
59263 dev: transitiveDevDeps.has(`${node.name}@${node.version}`)
59264 };
59265 if (node.children) {
59266 this._mapHoistedNodes(auditNode.dependencies[node.name], node.children, transitiveDevDeps);
59267 }
59268 }
59269 };
59270
59271 Audit.prototype._mapHoistedTreesToAuditTree = function _mapHoistedTreesToAuditTree(manifest, hoistedTrees, transitiveDevDeps) {
59272 var requiresGroups = this.options.groups.map(function (group) {
59273 return manifest[group] || {};
59274 });
59275
59276 var auditTree = {
59277 name: manifest.name || undefined,
59278 version: manifest.version || undefined,
59279 install: [],
59280 remove: [],
59281 metadata: {
59282 //TODO: What do we send here? npm sends npm version, node version, etc.
59283 },
59284 requires: (_assign || _load_assign()).default.apply(Object, [{}].concat(requiresGroups)),
59285 integrity: undefined,
59286 dependencies: {},
59287 dev: false
59288 };
59289
59290 this._mapHoistedNodes(auditTree, hoistedTrees, transitiveDevDeps);
59291 return auditTree;
59292 };
59293
59294 Audit.prototype._fetchAudit = function () {
59295 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (auditTree) {
59296 var responseJson = void 0;
59297 var registry = (_constants || _load_constants()).YARN_REGISTRY;
59298 this.reporter.verbose(`Audit Request: ${(0, (_stringify || _load_stringify()).default)(auditTree, null, 2)}`);
59299 var requestBody = yield gzip((0, (_stringify || _load_stringify()).default)(auditTree));
59300 var response = yield this.config.requestManager.request({
59301 url: `${registry}/-/npm/v1/security/audits`,
59302 method: 'POST',
59303 body: requestBody,
59304 headers: {
59305 'Content-Encoding': 'gzip',
59306 'Content-Type': 'application/json',
59307 Accept: 'application/json'
59308 }
59309 });
59310
59311 try {
59312 responseJson = JSON.parse(response);
59313 } catch (ex) {
59314 throw new Error(`Unexpected audit response (Invalid JSON): ${response}`);
59315 }
59316 if (!responseJson.metadata) {
59317 throw new Error(`Unexpected audit response (Missing Metadata): ${(0, (_stringify || _load_stringify()).default)(responseJson, null, 2)}`);
59318 }
59319 this.reporter.verbose(`Audit Response: ${(0, (_stringify || _load_stringify()).default)(responseJson, null, 2)}`);
59320 return responseJson;
59321 });
59322
59323 function _fetchAudit(_x5) {
59324 return _ref5.apply(this, arguments);
59325 }
59326
59327 return _fetchAudit;
59328 }();
59329
59330 Audit.prototype._insertWorkspacePackagesIntoManifest = function _insertWorkspacePackagesIntoManifest(manifest, resolver) {
59331 if (resolver.workspaceLayout) {
59332 var workspaceAggregatorName = resolver.workspaceLayout.virtualManifestName;
59333 var workspaceManifest = resolver.workspaceLayout.workspaces[workspaceAggregatorName].manifest;
59334
59335 manifest.dependencies = (0, (_assign || _load_assign()).default)(manifest.dependencies || {}, workspaceManifest.dependencies);
59336 manifest.devDependencies = (0, (_assign || _load_assign()).default)(manifest.devDependencies || {}, workspaceManifest.devDependencies);
59337 manifest.optionalDependencies = (0, (_assign || _load_assign()).default)(manifest.optionalDependencies || {}, workspaceManifest.optionalDependencies);
59338 }
59339 };
59340
59341 Audit.prototype.performAudit = function () {
59342 var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (manifest, lockfile, resolver, linker, patterns) {
59343 this._insertWorkspacePackagesIntoManifest(manifest, resolver);
59344 var transitiveDevDeps = (0, (_getTransitiveDevDependencies || _load_getTransitiveDevDependencies()).getTransitiveDevDependencies)(manifest, resolver.workspaceLayout, lockfile);
59345 var hoistedTrees = yield (0, (_hoistedTreeBuilder || _load_hoistedTreeBuilder()).buildTree)(resolver, linker, patterns);
59346 var auditTree = this._mapHoistedTreesToAuditTree(manifest, hoistedTrees, transitiveDevDeps);
59347 this.auditData = yield this._fetchAudit(auditTree);
59348 return this.auditData.metadata.vulnerabilities;
59349 });
59350
59351 function performAudit(_x6, _x7, _x8, _x9, _x10) {
59352 return _ref6.apply(this, arguments);
59353 }
59354
59355 return performAudit;
59356 }();
59357
59358 Audit.prototype.summary = function summary() {
59359 if (!this.auditData) {
59360 return;
59361 }
59362 this.reporter.auditSummary(this.auditData.metadata);
59363 };
59364
59365 Audit.prototype.report = function report() {
59366 var _this = this;
59367
59368 if (!this.auditData) {
59369 return;
59370 }
59371
59372 var startLoggingAt = Math.max(0, this.severityLevels.indexOf(this.options.level));
59373
59374 var reportAdvisory = function reportAdvisory(resolution) {
59375 var advisory = _this.auditData.advisories[resolution.id.toString()];
59376
59377 if (_this.severityLevels.indexOf(advisory.severity) >= startLoggingAt) {
59378 _this.reporter.auditAdvisory(resolution, advisory);
59379 }
59380 };
59381
59382 if ((0, (_keys || _load_keys()).default)(this.auditData.advisories).length !== 0) {
59383 // let printedManualReviewHeader = false;
59384
59385 this.auditData.actions.forEach(function (action) {
59386 action.resolves.forEach(reportAdvisory);
59387
59388 /* The following block has been temporarily removed
59389 * because the actions returned by npm are not valid for yarn.
59390 * Removing this action reporting until we can come up with a way
59391 * to correctly resolve issues.
59392 */
59393 // if (action.action === 'update' || action.action === 'install') {
59394 // // these advisories can be resolved automatically by running a yarn command
59395 // const recommendation: AuditActionRecommendation = {
59396 // cmd: `yarn upgrade ${action.module}@${action.target}`,
59397 // isBreaking: action.isMajor,
59398 // action,
59399 // };
59400 // this.reporter.auditAction(recommendation);
59401 // action.resolves.forEach(reportAdvisory);
59402 // }
59403
59404 // if (action.action === 'review') {
59405 // // these advisories cannot be resolved automatically and require manual review
59406 // if (!printedManualReviewHeader) {
59407 // this.reporter.auditManualReview();
59408 // }
59409 // printedManualReviewHeader = true;
59410 // action.resolves.forEach(reportAdvisory);
59411 // }
59412 });
59413 }
59414
59415 this.summary();
59416 };
59417
59418 return Audit;
59419}();
59420
59421exports.default = Audit;
59422
59423/***/ }),
59424/* 290 */
59425/***/ (function(module, exports, __webpack_require__) {
59426
59427"use strict";
59428
59429
59430Object.defineProperty(exports, "__esModule", {
59431 value: true
59432});
59433exports.run = exports.clean = exports.noArguments = exports.requireLockfile = undefined;
59434
59435var _getIterator2;
59436
59437function _load_getIterator() {
59438 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
59439}
59440
59441var _keys;
59442
59443function _load_keys() {
59444 return _keys = _interopRequireDefault(__webpack_require__(14));
59445}
59446
59447var _set;
59448
59449function _load_set() {
59450 return _set = _interopRequireDefault(__webpack_require__(16));
59451}
59452
59453var _asyncToGenerator2;
59454
59455function _load_asyncToGenerator() {
59456 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
59457}
59458
59459var clean = exports.clean = function () {
59460 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) {
59461 var loc = path.join(config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME);
59462 var file = yield (_fs || _load_fs()).readFile(loc);
59463 var lines = file.split('\n');
59464 var filters = (0, (_filter || _load_filter()).ignoreLinesToRegex)(lines);
59465
59466 var removedFiles = 0;
59467 var removedSize = 0;
59468
59469 // build list of possible module folders
59470 var locs = new (_set || _load_set()).default();
59471 for (var _iterator = config.registryFolders, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
59472 var _ref2;
59473
59474 if (_isArray) {
59475 if (_i >= _iterator.length) break;
59476 _ref2 = _iterator[_i++];
59477 } else {
59478 _i = _iterator.next();
59479 if (_i.done) break;
59480 _ref2 = _i.value;
59481 }
59482
59483 var registryFolder = _ref2;
59484
59485 locs.add(path.resolve(config.lockfileFolder, registryFolder));
59486 }
59487
59488 var workspaceRootFolder = config.workspaceRootFolder;
59489 if (workspaceRootFolder) {
59490 var manifest = yield config.findManifest(workspaceRootFolder, false);
59491 invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property');
59492
59493 var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest);
59494
59495 for (var _iterator2 = (0, (_keys || _load_keys()).default)(workspaces), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
59496 var _ref3;
59497
59498 if (_isArray2) {
59499 if (_i2 >= _iterator2.length) break;
59500 _ref3 = _iterator2[_i2++];
59501 } else {
59502 _i2 = _iterator2.next();
59503 if (_i2.done) break;
59504 _ref3 = _i2.value;
59505 }
59506
59507 var workspaceName = _ref3;
59508
59509 for (var _iterator3 = (_index || _load_index()).registryNames, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
59510 var _ref4;
59511
59512 if (_isArray3) {
59513 if (_i3 >= _iterator3.length) break;
59514 _ref4 = _iterator3[_i3++];
59515 } else {
59516 _i3 = _iterator3.next();
59517 if (_i3.done) break;
59518 _ref4 = _i3.value;
59519 }
59520
59521 var name = _ref4;
59522
59523 var registry = config.registries[name];
59524 locs.add(path.join(workspaces[workspaceName].loc, registry.folder));
59525 }
59526 }
59527 }
59528
59529 for (var _iterator4 = locs, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
59530 var _ref5;
59531
59532 if (_isArray4) {
59533 if (_i4 >= _iterator4.length) break;
59534 _ref5 = _iterator4[_i4++];
59535 } else {
59536 _i4 = _iterator4.next();
59537 if (_i4.done) break;
59538 _ref5 = _i4.value;
59539 }
59540
59541 var folder = _ref5;
59542
59543 if (!(yield (_fs || _load_fs()).exists(folder))) {
59544 continue;
59545 }
59546
59547 var spinner = reporter.activity();
59548 var files = yield (_fs || _load_fs()).walk(folder);
59549
59550 var _sortFilter = (0, (_filter || _load_filter()).sortFilter)(files, filters),
59551 ignoreFiles = _sortFilter.ignoreFiles;
59552
59553 spinner.end();
59554
59555 var tick = reporter.progress(ignoreFiles.size);
59556 // TODO make sure `main` field of all modules isn't ignored
59557
59558 for (var _iterator5 = ignoreFiles, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
59559 var _ref6;
59560
59561 if (_isArray5) {
59562 if (_i5 >= _iterator5.length) break;
59563 _ref6 = _iterator5[_i5++];
59564 } else {
59565 _i5 = _iterator5.next();
59566 if (_i5.done) break;
59567 _ref6 = _i5.value;
59568 }
59569
59570 var _file = _ref6;
59571
59572 var _loc = path.join(folder, _file);
59573 var stat = yield (_fs || _load_fs()).lstat(_loc);
59574 removedSize += stat.size;
59575 removedFiles++;
59576 }
59577
59578 for (var _iterator6 = ignoreFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
59579 var _ref7;
59580
59581 if (_isArray6) {
59582 if (_i6 >= _iterator6.length) break;
59583 _ref7 = _iterator6[_i6++];
59584 } else {
59585 _i6 = _iterator6.next();
59586 if (_i6.done) break;
59587 _ref7 = _i6.value;
59588 }
59589
59590 var _file2 = _ref7;
59591
59592 var _loc2 = path.join(folder, _file2);
59593 yield (_fs || _load_fs()).unlink(_loc2);
59594 tick();
59595 }
59596 }
59597
59598 return { removedFiles, removedSize };
59599 });
59600
59601 return function clean(_x, _x2) {
59602 return _ref.apply(this, arguments);
59603 };
59604}();
59605
59606var runInit = function () {
59607 var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (cwd, reporter) {
59608 reporter.step(1, 1, reporter.lang('cleanCreatingFile', (_constants || _load_constants()).CLEAN_FILENAME));
59609 var cleanLoc = path.join(cwd, (_constants || _load_constants()).CLEAN_FILENAME);
59610 yield (_fs || _load_fs()).writeFile(cleanLoc, `${DEFAULT_FILTER}\n`, { flag: 'wx' });
59611 reporter.info(reporter.lang('cleanCreatedFile', (_constants || _load_constants()).CLEAN_FILENAME));
59612 });
59613
59614 return function runInit(_x3, _x4) {
59615 return _ref8.apply(this, arguments);
59616 };
59617}();
59618
59619var runAutoClean = function () {
59620 var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter) {
59621 reporter.step(1, 1, reporter.lang('cleaning'));
59622
59623 var _ref10 = yield clean(config, reporter),
59624 removedFiles = _ref10.removedFiles,
59625 removedSize = _ref10.removedSize;
59626
59627 reporter.info(reporter.lang('cleanRemovedFiles', removedFiles));
59628 reporter.info(reporter.lang('cleanSavedSize', Number((removedSize / 1024 / 1024).toFixed(2))));
59629 });
59630
59631 return function runAutoClean(_x5, _x6) {
59632 return _ref9.apply(this, arguments);
59633 };
59634}();
59635
59636var checkForCleanFile = function () {
59637 var _ref11 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (cwd) {
59638 var cleanLoc = path.join(cwd, (_constants || _load_constants()).CLEAN_FILENAME);
59639 var exists = yield (_fs || _load_fs()).exists(cleanLoc);
59640 return exists;
59641 });
59642
59643 return function checkForCleanFile(_x7) {
59644 return _ref11.apply(this, arguments);
59645 };
59646}();
59647
59648var run = exports.run = function () {
59649 var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
59650 var cleanFileExists = yield checkForCleanFile(config.cwd);
59651
59652 if (flags.init && cleanFileExists) {
59653 reporter.info(reporter.lang('cleanAlreadyExists', (_constants || _load_constants()).CLEAN_FILENAME));
59654 } else if (flags.init) {
59655 yield runInit(config.cwd, reporter);
59656 } else if (flags.force && cleanFileExists) {
59657 yield runAutoClean(config, reporter);
59658 } else if (cleanFileExists) {
59659 reporter.info(reporter.lang('cleanRequiresForce', (_constants || _load_constants()).CLEAN_FILENAME));
59660 } else {
59661 reporter.info(reporter.lang('cleanDoesNotExist', (_constants || _load_constants()).CLEAN_FILENAME));
59662 }
59663 });
59664
59665 return function run(_x8, _x9, _x10, _x11) {
59666 return _ref12.apply(this, arguments);
59667 };
59668}();
59669
59670exports.setFlags = setFlags;
59671exports.hasWrapper = hasWrapper;
59672
59673var _index;
59674
59675function _load_index() {
59676 return _index = __webpack_require__(61);
59677}
59678
59679var _filter;
59680
59681function _load_filter() {
59682 return _filter = __webpack_require__(309);
59683}
59684
59685var _constants;
59686
59687function _load_constants() {
59688 return _constants = __webpack_require__(13);
59689}
59690
59691var _fs;
59692
59693function _load_fs() {
59694 return _fs = _interopRequireWildcard(__webpack_require__(8));
59695}
59696
59697function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
59698
59699function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
59700
59701var invariant = __webpack_require__(15);
59702var path = __webpack_require__(1);
59703
59704var requireLockfile = exports.requireLockfile = true;
59705var noArguments = exports.noArguments = true;
59706
59707var DEFAULT_FILTER = `
59708# test directories
59709__tests__
59710test
59711tests
59712powered-test
59713
59714# asset directories
59715docs
59716doc
59717website
59718images
59719assets
59720
59721# examples
59722example
59723examples
59724
59725# code coverage directories
59726coverage
59727.nyc_output
59728
59729# build scripts
59730Makefile
59731Gulpfile.js
59732Gruntfile.js
59733
59734# configs
59735appveyor.yml
59736circle.yml
59737codeship-services.yml
59738codeship-steps.yml
59739wercker.yml
59740.tern-project
59741.gitattributes
59742.editorconfig
59743.*ignore
59744.eslintrc
59745.jshintrc
59746.flowconfig
59747.documentup.json
59748.yarn-metadata.json
59749.travis.yml
59750
59751# misc
59752*.md
59753`.trim();
59754
59755function setFlags(commander) {
59756 commander.description('Cleans and removes unnecessary files from package dependencies.');
59757 commander.usage('autoclean [flags]');
59758 commander.option('-I, --init', `Create "${(_constants || _load_constants()).CLEAN_FILENAME}" file with the default entries.`);
59759 commander.option('-F, --force', `Run autoclean using the existing "${(_constants || _load_constants()).CLEAN_FILENAME}" file.`);
59760}
59761
59762function hasWrapper(commander) {
59763 return true;
59764}
59765
59766/***/ }),
59767/* 291 */
59768/***/ (function(module, exports, __webpack_require__) {
59769
59770"use strict";
59771
59772
59773Object.defineProperty(exports, "__esModule", {
59774 value: true
59775});
59776exports.examples = exports.run = exports.getCachedPackagesDirs = undefined;
59777
59778var _promise;
59779
59780function _load_promise() {
59781 return _promise = _interopRequireDefault(__webpack_require__(7));
59782}
59783
59784var _getIterator2;
59785
59786function _load_getIterator() {
59787 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
59788}
59789
59790var _asyncToGenerator2;
59791
59792function _load_asyncToGenerator() {
59793 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
59794}
59795
59796var getCachedPackagesDirs = exports.getCachedPackagesDirs = function () {
59797 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, currentPath) {
59798 var results = [];
59799 var stat = yield (_fs || _load_fs()).lstat(currentPath);
59800
59801 if (!stat.isDirectory()) {
59802 return results;
59803 }
59804
59805 var folders = yield (_fs || _load_fs()).readdir(currentPath);
59806 for (var _iterator = folders, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
59807 var _ref2;
59808
59809 if (_isArray) {
59810 if (_i >= _iterator.length) break;
59811 _ref2 = _iterator[_i++];
59812 } else {
59813 _i = _iterator.next();
59814 if (_i.done) break;
59815 _ref2 = _i.value;
59816 }
59817
59818 var folder = _ref2;
59819
59820 if (folder[0] === '.') {
59821 continue;
59822 }
59823 var packageParentPath = path.join(currentPath, folder, 'node_modules');
59824
59825 var candidates = yield (_fs || _load_fs()).readdir(packageParentPath);
59826 invariant(candidates.length === 1, `There should only be one folder in a package cache (got ${candidates.join(',')} in ${packageParentPath})`);
59827
59828 for (var _iterator2 = candidates, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
59829 var _ref3;
59830
59831 if (_isArray2) {
59832 if (_i2 >= _iterator2.length) break;
59833 _ref3 = _iterator2[_i2++];
59834 } else {
59835 _i2 = _iterator2.next();
59836 if (_i2.done) break;
59837 _ref3 = _i2.value;
59838 }
59839
59840 var candidate = _ref3;
59841
59842 var candidatePath = path.join(packageParentPath, candidate);
59843 if (candidate.charAt(0) === '@') {
59844 var subCandidates = yield (_fs || _load_fs()).readdir(candidatePath);
59845 invariant(subCandidates.length === 1, `There should only be one folder in a package cache (got ${subCandidates.join(',')} in ${candidatePath})`);
59846
59847 for (var _iterator3 = subCandidates, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
59848 var _ref4;
59849
59850 if (_isArray3) {
59851 if (_i3 >= _iterator3.length) break;
59852 _ref4 = _iterator3[_i3++];
59853 } else {
59854 _i3 = _iterator3.next();
59855 if (_i3.done) break;
59856 _ref4 = _i3.value;
59857 }
59858
59859 var subCandidate = _ref4;
59860
59861 var subCandidatePath = path.join(candidatePath, subCandidate);
59862 results.push(subCandidatePath);
59863 }
59864 } else {
59865 results.push(candidatePath);
59866 }
59867 }
59868 }
59869
59870 return results;
59871 });
59872
59873 return function getCachedPackagesDirs(_x, _x2) {
59874 return _ref.apply(this, arguments);
59875 };
59876}();
59877
59878var getCachedPackages = function () {
59879 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
59880 var paths = yield getCachedPackagesDirs(config, config.cacheFolder);
59881 return _getMetadataWithPath(config.readPackageMetadata.bind(config), paths).then(function (packages) {
59882 return packages.filter(function (p) {
59883 return !!p;
59884 });
59885 });
59886 });
59887
59888 return function getCachedPackages(_x3) {
59889 return _ref5.apply(this, arguments);
59890 };
59891}();
59892
59893var list = function () {
59894 var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
59895 var filterOut = function filterOut() {
59896 var _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
59897 registry = _ref7.registry,
59898 manifest = _ref7.package,
59899 remote = _ref7.remote;
59900
59901 if (flags.pattern && !micromatch.contains(manifest.name, flags.pattern)) {
59902 return false;
59903 }
59904 return true;
59905 };
59906
59907 var forReport = function forReport() {
59908 var _ref8 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
59909 registry = _ref8.registry,
59910 manifest = _ref8.package,
59911 remote = _ref8.remote;
59912
59913 return [manifest.name, manifest.version, registry, remote && remote.resolved || ''];
59914 };
59915
59916 var packages = yield getCachedPackages(config);
59917 var body = packages.filter(filterOut).map(forReport);
59918 reporter.table(['Name', 'Version', 'Registry', 'Resolved'], body);
59919 });
59920
59921 return function list(_x4, _x5, _x6, _x7) {
59922 return _ref6.apply(this, arguments);
59923 };
59924}();
59925
59926var clean = function () {
59927 var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
59928 if (config.cacheFolder) {
59929 var activity = reporter.activity();
59930
59931 if (args.length > 0) {
59932 // Clear named packages from cache
59933 var packages = yield getCachedPackages(config);
59934 var shouldDelete = function shouldDelete() {
59935 var _ref10 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
59936 registry = _ref10.registry,
59937 manifest = _ref10.package,
59938 remote = _ref10.remote;
59939
59940 return args.indexOf(manifest.name) !== -1;
59941 };
59942 var packagesToDelete = packages.filter(shouldDelete);
59943
59944 for (var _iterator4 = packagesToDelete, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
59945 var _ref11;
59946
59947 if (_isArray4) {
59948 if (_i4 >= _iterator4.length) break;
59949 _ref11 = _iterator4[_i4++];
59950 } else {
59951 _i4 = _iterator4.next();
59952 if (_i4.done) break;
59953 _ref11 = _i4.value;
59954 }
59955
59956 var manifest = _ref11;
59957
59958 var relativePath = path.relative(config.cacheFolder, manifest._path);
59959 while (relativePath && relativePath !== '.') {
59960 yield (_fs || _load_fs()).unlink(path.resolve(config.cacheFolder, relativePath));
59961 relativePath = path.dirname(relativePath);
59962 }
59963 }
59964
59965 activity.end();
59966 reporter.success(reporter.lang('clearedPackageFromCache', args[0]));
59967 } else {
59968 // Clear all cache
59969 yield (_fs || _load_fs()).unlink(config._cacheRootFolder);
59970 yield (_fs || _load_fs()).mkdirp(config.cacheFolder);
59971 activity.end();
59972 reporter.success(reporter.lang('clearedCache'));
59973 }
59974 }
59975 });
59976
59977 return function clean(_x10, _x11, _x12, _x13) {
59978 return _ref9.apply(this, arguments);
59979 };
59980}();
59981
59982exports.hasWrapper = hasWrapper;
59983exports.setFlags = setFlags;
59984
59985var _buildSubCommands2;
59986
59987function _load_buildSubCommands() {
59988 return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
59989}
59990
59991var _fs;
59992
59993function _load_fs() {
59994 return _fs = _interopRequireWildcard(__webpack_require__(8));
59995}
59996
59997function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
59998
59999function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
60000
60001var invariant = __webpack_require__(15);
60002var path = __webpack_require__(1);
60003var micromatch = __webpack_require__(109);
60004
60005function hasWrapper(flags, args) {
60006 return args[0] !== 'dir';
60007}
60008
60009function _getMetadataWithPath(getMetadataFn, paths) {
60010 return (_promise || _load_promise()).default.all(paths.map(function (path) {
60011 return getMetadataFn(path).then(function (r) {
60012 r._path = path;
60013 return r;
60014 }).catch(function (error) {
60015 return undefined;
60016 });
60017 }));
60018}
60019
60020var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('cache', {
60021 ls(config, reporter, flags, args) {
60022 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
60023 reporter.warn(`\`yarn cache ls\` is deprecated. Please use \`yarn cache list\`.`);
60024 yield list(config, reporter, flags, args);
60025 })();
60026 },
60027 list,
60028 clean,
60029 dir(config, reporter) {
60030 reporter.log(config.cacheFolder, { force: true });
60031 }
60032}),
60033 run = _buildSubCommands.run,
60034 _setFlags = _buildSubCommands.setFlags,
60035 examples = _buildSubCommands.examples;
60036
60037exports.run = run;
60038exports.examples = examples;
60039function setFlags(commander) {
60040 _setFlags(commander);
60041 commander.description('Yarn cache list will print out every cached package.');
60042 commander.option('--pattern [pattern]', 'filter cached packages by pattern');
60043}
60044
60045/***/ }),
60046/* 292 */
60047/***/ (function(module, exports, __webpack_require__) {
60048
60049"use strict";
60050
60051
60052Object.defineProperty(exports, "__esModule", {
60053 value: true
60054});
60055exports.run = exports.verifyTreeCheck = exports.noArguments = exports.requireLockfile = undefined;
60056
60057var _assign;
60058
60059function _load_assign() {
60060 return _assign = _interopRequireDefault(__webpack_require__(23));
60061}
60062
60063var _getIterator2;
60064
60065function _load_getIterator() {
60066 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
60067}
60068
60069var _set;
60070
60071function _load_set() {
60072 return _set = _interopRequireDefault(__webpack_require__(16));
60073}
60074
60075var _asyncToGenerator2;
60076
60077function _load_asyncToGenerator() {
60078 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
60079}
60080
60081var verifyTreeCheck = exports.verifyTreeCheck = function () {
60082 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
60083 var errCount = 0;
60084 function reportError(msg) {
60085 for (var _len = arguments.length, vars = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
60086 vars[_key - 1] = arguments[_key];
60087 }
60088
60089 reporter.error(reporter.lang.apply(reporter, [msg].concat(vars)));
60090 errCount++;
60091 }
60092 // check all dependencies recursively without relying on internal resolver
60093 var registryName = 'yarn';
60094 var registryFolder = config.registryFolders[0];
60095 var cwd = config.workspaceRootFolder ? config.lockfileFolder : config.cwd;
60096 var rootManifest = yield config.readManifest(cwd, registryName);
60097
60098 var dependenciesToCheckVersion = [];
60099 if (rootManifest.dependencies) {
60100 for (var _name in rootManifest.dependencies) {
60101 var _version = rootManifest.dependencies[_name];
60102 // skip linked dependencies
60103 var isLinkedDependency = /^link:/i.test(_version) || /^file:/i.test(_version) && config.linkFileDependencies;
60104 if (isLinkedDependency) {
60105 continue;
60106 }
60107 dependenciesToCheckVersion.push({
60108 name: _name,
60109 originalKey: _name,
60110 parentCwd: cwd,
60111 version: _version
60112 });
60113 }
60114 }
60115 if (rootManifest.devDependencies && !config.production) {
60116 for (var _name2 in rootManifest.devDependencies) {
60117 var _version2 = rootManifest.devDependencies[_name2];
60118 // skip linked dependencies
60119 var _isLinkedDependency = /^link:/i.test(_version2) || /^file:/i.test(_version2) && config.linkFileDependencies;
60120 if (_isLinkedDependency) {
60121 continue;
60122 }
60123 dependenciesToCheckVersion.push({
60124 name: _name2,
60125 originalKey: _name2,
60126 parentCwd: cwd,
60127 version: _version2
60128 });
60129 }
60130 }
60131
60132 var locationsVisited = new (_set || _load_set()).default();
60133 while (dependenciesToCheckVersion.length) {
60134 var dep = dependenciesToCheckVersion.shift();
60135 var manifestLoc = path.resolve(dep.parentCwd, registryFolder, dep.name);
60136 if (locationsVisited.has(manifestLoc + `@${dep.version}`)) {
60137 continue;
60138 }
60139 locationsVisited.add(manifestLoc + `@${dep.version}`);
60140 // When plugnplay is enabled, packages aren't copied to the node_modules folder, so this check doesn't make sense
60141 // TODO: We ideally should check that the packages are located inside the cache instead
60142 if (config.plugnplayEnabled) {
60143 continue;
60144 }
60145 if (!(yield (_fs || _load_fs()).exists(manifestLoc))) {
60146 reportError('packageNotInstalled', `${dep.originalKey}`);
60147 continue;
60148 }
60149 if (!(yield (_fs || _load_fs()).exists(path.join(manifestLoc, 'package.json')))) {
60150 continue;
60151 }
60152 var pkg = yield config.readManifest(manifestLoc, registryName);
60153 if (semver.validRange(dep.version, config.looseSemver) && !semver.satisfies(pkg.version, dep.version, config.looseSemver)) {
60154 reportError('packageWrongVersion', dep.originalKey, dep.version, pkg.version);
60155 continue;
60156 }
60157 var dependencies = pkg.dependencies;
60158 if (dependencies) {
60159 for (var subdep in dependencies) {
60160 var subDepPath = path.resolve(manifestLoc, registryFolder, subdep);
60161 var found = false;
60162 var relative = path.relative(cwd, subDepPath);
60163 var locations = path.normalize(relative).split(registryFolder + path.sep).filter(function (dir) {
60164 return !!dir;
60165 });
60166 locations.pop();
60167 while (locations.length >= 0) {
60168 var possiblePath = void 0;
60169 if (locations.length > 0) {
60170 possiblePath = path.join(cwd, registryFolder, locations.join(path.sep + registryFolder + path.sep));
60171 } else {
60172 possiblePath = cwd;
60173 }
60174 if (yield (_fs || _load_fs()).exists(path.resolve(possiblePath, registryFolder, subdep))) {
60175 dependenciesToCheckVersion.push({
60176 name: subdep,
60177 originalKey: `${dep.originalKey}#${subdep}`,
60178 parentCwd: possiblePath,
60179 version: dependencies[subdep]
60180 });
60181 found = true;
60182 break;
60183 }
60184 if (!locations.length) {
60185 break;
60186 }
60187 locations.pop();
60188 }
60189 if (!found) {
60190 reportError('packageNotInstalled', `${dep.originalKey}#${subdep}`);
60191 }
60192 }
60193 }
60194 }
60195
60196 if (errCount > 0) {
60197 throw new (_errors || _load_errors()).MessageError(reporter.lang('foundErrors', errCount));
60198 } else {
60199 reporter.success(reporter.lang('folderInSync'));
60200 }
60201 });
60202
60203 return function verifyTreeCheck(_x, _x2, _x3, _x4) {
60204 return _ref.apply(this, arguments);
60205 };
60206}();
60207
60208var integrityHashCheck = function () {
60209 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
60210 var errCount = 0;
60211 function reportError(msg) {
60212 for (var _len2 = arguments.length, vars = Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
60213 vars[_key2 - 1] = arguments[_key2];
60214 }
60215
60216 reporter.error(reporter.lang.apply(reporter, [msg].concat(vars)));
60217 errCount++;
60218 }
60219 var integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config);
60220
60221 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd);
60222 var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
60223
60224 // get patterns that are installed when running `yarn install`
60225
60226 var _ref3 = yield install.fetchRequestFromCwd(),
60227 patterns = _ref3.patterns,
60228 workspaceLayout = _ref3.workspaceLayout;
60229
60230 var match = yield integrityChecker.check(patterns, lockfile.cache, flags, workspaceLayout);
60231 for (var _iterator = match.missingPatterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
60232 var _ref4;
60233
60234 if (_isArray) {
60235 if (_i >= _iterator.length) break;
60236 _ref4 = _iterator[_i++];
60237 } else {
60238 _i = _iterator.next();
60239 if (_i.done) break;
60240 _ref4 = _i.value;
60241 }
60242
60243 var pattern = _ref4;
60244
60245 reportError('lockfileNotContainPattern', pattern);
60246 }
60247 if (match.integrityFileMissing) {
60248 reportError('noIntegrityFile');
60249 }
60250 if (match.integrityMatches === false) {
60251 reporter.warn(reporter.lang((_integrityChecker2 || _load_integrityChecker2()).integrityErrors[match.integrityError]));
60252 reportError('integrityCheckFailed');
60253 }
60254
60255 if (errCount > 0) {
60256 throw new (_errors || _load_errors()).MessageError(reporter.lang('foundErrors', errCount));
60257 } else {
60258 reporter.success(reporter.lang('folderInSync'));
60259 }
60260 });
60261
60262 return function integrityHashCheck(_x5, _x6, _x7, _x8) {
60263 return _ref2.apply(this, arguments);
60264 };
60265}();
60266
60267var run = exports.run = function () {
60268 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
60269 if (flags.verifyTree) {
60270 yield verifyTreeCheck(config, reporter, flags, args);
60271 return;
60272 } else if (flags.integrity) {
60273 yield integrityHashCheck(config, reporter, flags, args);
60274 return;
60275 }
60276
60277 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd);
60278 var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
60279
60280 function humaniseLocation(loc) {
60281 var relative = path.relative(path.join(config.cwd, 'node_modules'), loc);
60282 var normalized = path.normalize(relative).split(path.sep);
60283 return normalized.filter(function (p) {
60284 return p !== 'node_modules';
60285 }).reduce(function (result, part) {
60286 var length = result.length;
60287 if (length && result[length - 1].startsWith('@') && result[length - 1].indexOf(path.sep) === -1) {
60288 result[length - 1] += path.sep + part;
60289 } else {
60290 result.push(part);
60291 }
60292 return result;
60293 }, []);
60294 }
60295
60296 var warningCount = 0;
60297 var errCount = 0;
60298 function reportError(msg) {
60299 for (var _len3 = arguments.length, vars = Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
60300 vars[_key3 - 1] = arguments[_key3];
60301 }
60302
60303 reporter.error(reporter.lang.apply(reporter, [msg].concat(vars)));
60304 errCount++;
60305 }
60306
60307 // get patterns that are installed when running `yarn install`
60308
60309 var _ref6 = yield install.hydrate(),
60310 rawPatterns = _ref6.patterns,
60311 workspaceLayout = _ref6.workspaceLayout;
60312
60313 var patterns = yield install.flatten(rawPatterns);
60314
60315 // check if patterns exist in lockfile
60316 for (var _iterator2 = patterns, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
60317 var _ref7;
60318
60319 if (_isArray2) {
60320 if (_i2 >= _iterator2.length) break;
60321 _ref7 = _iterator2[_i2++];
60322 } else {
60323 _i2 = _iterator2.next();
60324 if (_i2.done) break;
60325 _ref7 = _i2.value;
60326 }
60327
60328 var pattern = _ref7;
60329
60330 if (!lockfile.getLocked(pattern) && (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern))) {
60331 reportError('lockfileNotContainPattern', pattern);
60332 }
60333 }
60334
60335 var bundledDeps = {};
60336 // check if any of the node_modules are out of sync
60337 var res = yield install.linker.getFlatHoistedTree(patterns, workspaceLayout);
60338 for (var _iterator3 = res, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
60339 var _ref9;
60340
60341 if (_isArray3) {
60342 if (_i3 >= _iterator3.length) break;
60343 _ref9 = _iterator3[_i3++];
60344 } else {
60345 _i3 = _iterator3.next();
60346 if (_i3.done) break;
60347 _ref9 = _i3.value;
60348 }
60349
60350 var _ref8 = _ref9;
60351 var loc = _ref8[0];
60352 var _ref8$ = _ref8[1];
60353 var _originalKey = _ref8$.originalKey;
60354 var pkg = _ref8$.pkg;
60355 var ignore = _ref8$.ignore;
60356
60357 if (ignore) {
60358 continue;
60359 }
60360
60361 var parts = humaniseLocation(loc);
60362
60363 // grey out hoisted portions of key
60364 var human = _originalKey;
60365 var hoistedParts = parts.slice();
60366 var hoistedKey = parts.join('#');
60367 if (human !== hoistedKey) {
60368 var humanParts = human.split('#');
60369
60370 for (var i = 0; i < humanParts.length; i++) {
60371 var humanPart = humanParts[i];
60372
60373 if (hoistedParts[0] === humanPart) {
60374 hoistedParts.shift();
60375
60376 if (i < humanParts.length - 1) {
60377 humanParts[i] += '#';
60378 }
60379 } else {
60380 humanParts[i] = reporter.format.dim(`${humanPart}#`);
60381 }
60382 }
60383
60384 human = humanParts.join('');
60385 }
60386
60387 // skip unnecessary checks for linked dependencies
60388 var remoteType = pkg._reference.remote.type;
60389 var isLinkedDependency = remoteType === 'link' || remoteType === 'workspace' || remoteType === 'file' && config.linkFileDependencies;
60390 var isResolution = pkg._reference.hint === 'resolution';
60391 if (isLinkedDependency || isResolution) {
60392 continue;
60393 }
60394
60395 if (!(yield (_fs || _load_fs()).exists(loc))) {
60396 if (pkg._reference.optional) {
60397 reporter.warn(reporter.lang('optionalDepNotInstalled', human));
60398 } else {
60399 reportError('packageNotInstalled', human);
60400 }
60401 continue;
60402 }
60403
60404 var pkgLoc = path.join(loc, 'package.json');
60405
60406 if (yield (_fs || _load_fs()).exists(pkgLoc)) {
60407 var packageJson = yield config.readJson(pkgLoc);
60408 packageJson.version = semver.clean(packageJson.version);
60409
60410 if (pkg.version !== packageJson.version) {
60411 // node_modules contains wrong version
60412 reportError('packageWrongVersion', human, pkg.version, packageJson.version);
60413 }
60414
60415 var deps = (0, (_assign || _load_assign()).default)({}, packageJson.dependencies, packageJson.peerDependencies);
60416 bundledDeps[packageJson.name] = packageJson.bundledDependencies || [];
60417
60418 for (var _name3 in deps) {
60419 var range = deps[_name3];
60420 if (!semver.validRange(range, config.looseSemver)) {
60421 continue; // exotic
60422 }
60423
60424 var subHuman = `${human}#${_name3}@${range}`;
60425
60426 // find the package that this will resolve to, factoring in hoisting
60427 var possibles = [];
60428 var depLoc = void 0;
60429 for (var _i4 = parts.length; _i4 >= 0; _i4--) {
60430 var myParts = parts.slice(0, _i4).concat(_name3);
60431
60432 // build package.json location for this position
60433 var myDepPkgLoc = path.join(config.cwd, 'node_modules', myParts.join(`${path.sep}node_modules${path.sep}`));
60434
60435 possibles.push(myDepPkgLoc);
60436 }
60437 while (possibles.length) {
60438 var _myDepPkgLoc = possibles.shift();
60439 if (yield (_fs || _load_fs()).exists(_myDepPkgLoc)) {
60440 depLoc = _myDepPkgLoc;
60441 break;
60442 }
60443 }
60444 if (!depLoc) {
60445 // we'll hit the module not install error above when this module is hit
60446 continue;
60447 }
60448
60449 var depPkgLoc = path.join(depLoc, 'package.json');
60450
60451 if (yield (_fs || _load_fs()).exists(depPkgLoc)) {
60452 var depPkg = yield config.readJson(depPkgLoc);
60453 var foundHuman = `${humaniseLocation(path.dirname(depPkgLoc)).join('#')}@${depPkg.version}`;
60454 if (!semver.satisfies(depPkg.version, range, config.looseSemver)) {
60455 // module isn't correct semver
60456 var resPattern = install.resolutionMap.find(_name3, _originalKey.split('#'));
60457 if (resPattern) {
60458 var resHuman = `${human}#${resPattern}`;
60459
60460 var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(resPattern),
60461 resRange = _normalizePattern.range;
60462
60463 if (semver.satisfies(depPkg.version, resRange, config.looseSemver)) {
60464 reporter.warn(reporter.lang('incompatibleResolutionVersion', foundHuman, subHuman));
60465 warningCount++;
60466 } else {
60467 reportError('packageDontSatisfy', resHuman, foundHuman);
60468 }
60469 } else {
60470 reportError('packageDontSatisfy', subHuman, foundHuman);
60471 }
60472
60473 continue;
60474 }
60475
60476 // check for modules above us that this could be deduped to
60477 for (var _iterator4 = possibles, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
60478 var _ref10;
60479
60480 if (_isArray4) {
60481 if (_i5 >= _iterator4.length) break;
60482 _ref10 = _iterator4[_i5++];
60483 } else {
60484 _i5 = _iterator4.next();
60485 if (_i5.done) break;
60486 _ref10 = _i5.value;
60487 }
60488
60489 var _loc = _ref10;
60490
60491 var locPkg = path.join(_loc, 'package.json');
60492
60493 if (!(yield (_fs || _load_fs()).exists(locPkg))) {
60494 continue;
60495 }
60496
60497 var _packageJson = yield config.readJson(locPkg);
60498 var packagePath = _originalKey.split('#');
60499 var rootDep = packagePath[0];
60500 var packageName = packagePath[1] || _packageJson.name;
60501
60502 var bundledDep = bundledDeps[rootDep] && bundledDeps[rootDep].indexOf(packageName) !== -1;
60503 if (!bundledDep && (_packageJson.version === depPkg.version || semver.satisfies(_packageJson.version, range, config.looseSemver) && semver.gt(_packageJson.version, depPkg.version, config.looseSemver))) {
60504 reporter.warn(reporter.lang('couldBeDeduped', subHuman, _packageJson.version, `${humaniseLocation(path.dirname(locPkg)).join('#')}@${_packageJson.version}`));
60505 warningCount++;
60506 }
60507 break;
60508 }
60509 }
60510 }
60511 }
60512 }
60513
60514 if (warningCount > 1) {
60515 reporter.info(reporter.lang('foundWarnings', warningCount));
60516 }
60517
60518 if (errCount > 0) {
60519 throw new (_errors || _load_errors()).MessageError(reporter.lang('foundErrors', errCount));
60520 } else {
60521 reporter.success(reporter.lang('folderInSync'));
60522 }
60523 });
60524
60525 return function run(_x9, _x10, _x11, _x12) {
60526 return _ref5.apply(this, arguments);
60527 };
60528}();
60529
60530exports.hasWrapper = hasWrapper;
60531exports.setFlags = setFlags;
60532
60533var _errors;
60534
60535function _load_errors() {
60536 return _errors = __webpack_require__(6);
60537}
60538
60539var _integrityChecker;
60540
60541function _load_integrityChecker() {
60542 return _integrityChecker = _interopRequireDefault(__webpack_require__(195));
60543}
60544
60545var _integrityChecker2;
60546
60547function _load_integrityChecker2() {
60548 return _integrityChecker2 = __webpack_require__(195);
60549}
60550
60551var _lockfile;
60552
60553function _load_lockfile() {
60554 return _lockfile = _interopRequireDefault(__webpack_require__(25));
60555}
60556
60557var _fs;
60558
60559function _load_fs() {
60560 return _fs = _interopRequireWildcard(__webpack_require__(8));
60561}
60562
60563var _install;
60564
60565function _load_install() {
60566 return _install = __webpack_require__(41);
60567}
60568
60569var _normalizePattern2;
60570
60571function _load_normalizePattern() {
60572 return _normalizePattern2 = __webpack_require__(52);
60573}
60574
60575function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
60576
60577function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
60578
60579var semver = __webpack_require__(27);
60580var path = __webpack_require__(1);
60581
60582var requireLockfile = exports.requireLockfile = false;
60583var noArguments = exports.noArguments = true;
60584
60585function hasWrapper(commander) {
60586 return true;
60587}
60588
60589function setFlags(commander) {
60590 commander.description('Verifies if versions in the current project’s package.json match that of yarn’s lock file.');
60591 commander.option('--integrity');
60592 commander.option('--verify-tree');
60593}
60594
60595/***/ }),
60596/* 293 */
60597/***/ (function(module, exports, __webpack_require__) {
60598
60599"use strict";
60600
60601
60602Object.defineProperty(exports, "__esModule", {
60603 value: true
60604});
60605exports.run = exports.getRegistryFolder = undefined;
60606
60607var _getIterator2;
60608
60609function _load_getIterator() {
60610 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
60611}
60612
60613var _asyncToGenerator2;
60614
60615function _load_asyncToGenerator() {
60616 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
60617}
60618
60619var getRegistryFolder = exports.getRegistryFolder = function () {
60620 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, name) {
60621 if (config.modulesFolder) {
60622 return config.modulesFolder;
60623 }
60624
60625 var src = path.join(config.linkFolder, name);
60626
60627 var _ref2 = yield config.readManifest(src),
60628 _registry = _ref2._registry;
60629
60630 invariant(_registry, 'expected registry');
60631
60632 var registryFolder = config.registries[_registry].folder;
60633 return path.join(config.cwd, registryFolder);
60634 });
60635
60636 return function getRegistryFolder(_x, _x2) {
60637 return _ref.apply(this, arguments);
60638 };
60639}();
60640
60641var run = exports.run = function () {
60642 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
60643 if (args.length) {
60644 for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
60645 var _ref4;
60646
60647 if (_isArray) {
60648 if (_i >= _iterator.length) break;
60649 _ref4 = _iterator[_i++];
60650 } else {
60651 _i = _iterator.next();
60652 if (_i.done) break;
60653 _ref4 = _i.value;
60654 }
60655
60656 var name = _ref4;
60657
60658 var src = path.join(config.linkFolder, name);
60659
60660 if (yield (_fs || _load_fs()).exists(src)) {
60661 var folder = yield getRegistryFolder(config, name);
60662 var dest = path.join(folder, name);
60663
60664 yield (_fs || _load_fs()).unlink(dest);
60665 yield (_fs || _load_fs()).mkdirp(path.dirname(dest));
60666 yield (_fs || _load_fs()).symlink(src, dest);
60667 reporter.success(reporter.lang('linkUsing', name));
60668 } else {
60669 throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', name));
60670 }
60671 }
60672 } else {
60673 // add cwd module to the global registry
60674 var manifest = yield config.readRootManifest();
60675 var _name = manifest.name;
60676 if (!_name) {
60677 throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownPackageName'));
60678 }
60679
60680 var linkLoc = path.join(config.linkFolder, _name);
60681 if (yield (_fs || _load_fs()).exists(linkLoc)) {
60682 reporter.warn(reporter.lang('linkCollision', _name));
60683 } else {
60684 yield (_fs || _load_fs()).mkdirp(path.dirname(linkLoc));
60685 yield (_fs || _load_fs()).symlink(config.cwd, linkLoc);
60686
60687 // If there is a `bin` defined in the package.json,
60688 // link each bin to the global bin
60689 if (manifest.bin) {
60690 var globalBinFolder = yield (0, (_global || _load_global()).getBinFolder)(config, flags);
60691 for (var binName in manifest.bin) {
60692 var binSrc = manifest.bin[binName];
60693 var binSrcLoc = path.join(linkLoc, binSrc);
60694 var binDestLoc = path.join(globalBinFolder, binName);
60695 if (yield (_fs || _load_fs()).exists(binDestLoc)) {
60696 reporter.warn(reporter.lang('binLinkCollision', binName));
60697 } else {
60698 if (process.platform === 'win32') {
60699 yield cmdShim(binSrcLoc, binDestLoc, { createPwshFile: false });
60700 } else {
60701 yield (_fs || _load_fs()).symlink(binSrcLoc, binDestLoc);
60702 }
60703 }
60704 }
60705 }
60706
60707 reporter.success(reporter.lang('linkRegistered', _name));
60708 reporter.info(reporter.lang('linkRegisteredMessage', _name));
60709 }
60710 }
60711 });
60712
60713 return function run(_x3, _x4, _x5, _x6) {
60714 return _ref3.apply(this, arguments);
60715 };
60716}();
60717
60718exports.hasWrapper = hasWrapper;
60719exports.setFlags = setFlags;
60720
60721var _errors;
60722
60723function _load_errors() {
60724 return _errors = __webpack_require__(6);
60725}
60726
60727var _fs;
60728
60729function _load_fs() {
60730 return _fs = _interopRequireWildcard(__webpack_require__(8));
60731}
60732
60733var _global;
60734
60735function _load_global() {
60736 return _global = __webpack_require__(115);
60737}
60738
60739function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
60740
60741function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
60742
60743var invariant = __webpack_require__(15);
60744
60745var cmdShim = __webpack_require__(190);
60746var path = __webpack_require__(1);
60747
60748function hasWrapper(commander, args) {
60749 return true;
60750}
60751
60752function setFlags(commander) {
60753 commander.description('Symlink a package folder during development.');
60754}
60755
60756/***/ }),
60757/* 294 */
60758/***/ (function(module, exports, __webpack_require__) {
60759
60760"use strict";
60761
60762
60763Object.defineProperty(exports, "__esModule", {
60764 value: true
60765});
60766exports.run = exports.buildTree = exports.requireLockfile = undefined;
60767
60768var _keys;
60769
60770function _load_keys() {
60771 return _keys = _interopRequireDefault(__webpack_require__(14));
60772}
60773
60774var _set;
60775
60776function _load_set() {
60777 return _set = _interopRequireDefault(__webpack_require__(16));
60778}
60779
60780var _asyncToGenerator2;
60781
60782function _load_asyncToGenerator() {
60783 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
60784}
60785
60786var _getIterator2;
60787
60788function _load_getIterator() {
60789 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
60790}
60791
60792var buildTree = exports.buildTree = function () {
60793 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (resolver, linker, patterns, opts, onlyFresh, ignoreHoisted) {
60794 var treesByKey = {};
60795 var trees = [];
60796 var flatTree = yield linker.getFlatHoistedTree(patterns);
60797
60798 // If using workspaces, filter out the virtual manifest
60799 var workspaceLayout = resolver.workspaceLayout;
60800
60801 var hoisted = workspaceLayout && workspaceLayout.virtualManifestName ? flatTree.filter(function (_ref3) {
60802 var key = _ref3[0];
60803 return key.indexOf(workspaceLayout.virtualManifestName) === -1;
60804 }) : flatTree;
60805
60806 var hoistedByKey = {};
60807 for (var _iterator2 = hoisted, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
60808 var _ref5;
60809
60810 if (_isArray2) {
60811 if (_i2 >= _iterator2.length) break;
60812 _ref5 = _iterator2[_i2++];
60813 } else {
60814 _i2 = _iterator2.next();
60815 if (_i2.done) break;
60816 _ref5 = _i2.value;
60817 }
60818
60819 var _ref4 = _ref5;
60820 var key = _ref4[0];
60821 var info = _ref4[1];
60822
60823 hoistedByKey[key] = info;
60824 }
60825
60826 // build initial trees
60827 for (var _iterator3 = hoisted, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
60828 var _ref7;
60829
60830 if (_isArray3) {
60831 if (_i3 >= _iterator3.length) break;
60832 _ref7 = _iterator3[_i3++];
60833 } else {
60834 _i3 = _iterator3.next();
60835 if (_i3.done) break;
60836 _ref7 = _i3.value;
60837 }
60838
60839 var _ref6 = _ref7;
60840 var _info = _ref6[1];
60841
60842 var ref = _info.pkg._reference;
60843 var hint = null;
60844 var parent = getParent(_info.key, treesByKey);
60845 var children = [];
60846 var depth = 0;
60847 var color = 'bold';
60848 invariant(ref, 'expected reference');
60849
60850 if (onlyFresh) {
60851 var isFresh = false;
60852 for (var _iterator5 = ref.patterns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
60853 var _ref10;
60854
60855 if (_isArray5) {
60856 if (_i5 >= _iterator5.length) break;
60857 _ref10 = _iterator5[_i5++];
60858 } else {
60859 _i5 = _iterator5.next();
60860 if (_i5.done) break;
60861 _ref10 = _i5.value;
60862 }
60863
60864 var pattern = _ref10;
60865
60866 if (resolver.isNewPattern(pattern)) {
60867 isFresh = true;
60868 break;
60869 }
60870 }
60871 if (!isFresh) {
60872 continue;
60873 }
60874 }
60875
60876 if (_info.originalKey !== _info.key || opts.reqDepth === 0) {
60877 // was hoisted
60878 color = null;
60879 }
60880 // check parent to obtain next depth
60881 if (parent && parent.depth > 0) {
60882 depth = parent.depth + 1;
60883 } else {
60884 depth = 0;
60885 }
60886
60887 var topLevel = opts.reqDepth === 0 && !parent;
60888 var showAll = opts.reqDepth === -1;
60889 var nextDepthIsValid = depth + 1 <= Number(opts.reqDepth);
60890
60891 if (topLevel || nextDepthIsValid || showAll) {
60892 treesByKey[_info.key] = {
60893 name: `${_info.pkg.name}@${_info.pkg.version}`,
60894 children,
60895 hint,
60896 color,
60897 depth
60898 };
60899 }
60900
60901 // add in dummy children for hoisted dependencies
60902 var nextChildDepthIsValid = depth + 1 < Number(opts.reqDepth);
60903 invariant(ref, 'expected reference');
60904 if (!ignoreHoisted && nextDepthIsValid || showAll) {
60905 for (var _iterator6 = resolver.dedupePatterns(ref.dependencies), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
60906 var _ref11;
60907
60908 if (_isArray6) {
60909 if (_i6 >= _iterator6.length) break;
60910 _ref11 = _iterator6[_i6++];
60911 } else {
60912 _i6 = _iterator6.next();
60913 if (_i6.done) break;
60914 _ref11 = _i6.value;
60915 }
60916
60917 var _pattern = _ref11;
60918
60919 var pkg = resolver.getStrictResolvedPattern(_pattern);
60920
60921 if (!hoistedByKey[`${_info.key}#${pkg.name}`] && (nextChildDepthIsValid || showAll)) {
60922 children.push({
60923 name: _pattern,
60924 color: 'dim',
60925 shadow: true
60926 });
60927 }
60928 }
60929 }
60930 }
60931
60932 // add children
60933 for (var _iterator4 = hoisted, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
60934 var _ref9;
60935
60936 if (_isArray4) {
60937 if (_i4 >= _iterator4.length) break;
60938 _ref9 = _iterator4[_i4++];
60939 } else {
60940 _i4 = _iterator4.next();
60941 if (_i4.done) break;
60942 _ref9 = _i4.value;
60943 }
60944
60945 var _ref8 = _ref9;
60946 var _info2 = _ref8[1];
60947
60948 var tree = treesByKey[_info2.key];
60949 var parent = getParent(_info2.key, treesByKey);
60950 if (!tree) {
60951 continue;
60952 }
60953
60954 if (_info2.key.split('#').length === 1) {
60955 trees.push(tree);
60956 continue;
60957 }
60958
60959 if (parent) {
60960 parent.children.push(tree);
60961 }
60962 }
60963
60964 return { trees, count: buildCount(trees) };
60965 });
60966
60967 return function buildTree(_x, _x2, _x3, _x4, _x5, _x6) {
60968 return _ref2.apply(this, arguments);
60969 };
60970}();
60971
60972var run = exports.run = function () {
60973 var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
60974 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
60975 var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
60976
60977 var _ref13 = yield install.fetchRequestFromCwd(),
60978 depRequests = _ref13.requests,
60979 patterns = _ref13.patterns,
60980 manifest = _ref13.manifest,
60981 workspaceLayout = _ref13.workspaceLayout;
60982
60983 yield install.resolver.init(depRequests, {
60984 isFlat: install.flags.flat,
60985 isFrozen: install.flags.frozenLockfile,
60986 workspaceLayout
60987 });
60988
60989 var activePatterns = [];
60990 if (config.production) {
60991 var devDeps = getDevDeps(manifest);
60992 activePatterns = patterns.filter(function (pattern) {
60993 return !devDeps.has(pattern);
60994 });
60995 } else {
60996 activePatterns = patterns;
60997 }
60998
60999 var opts = {
61000 reqDepth: getReqDepth(flags.depth)
61001 };
61002
61003 var _ref14 = yield buildTree(install.resolver, install.linker, activePatterns, opts),
61004 trees = _ref14.trees;
61005
61006 if (args.length) {
61007 reporter.warn(reporter.lang('deprecatedListArgs'));
61008 }
61009 if (args.length || flags.pattern) {
61010 trees = trees.filter(function (tree) {
61011 return filterTree(tree, args, flags.pattern);
61012 });
61013 }
61014
61015 reporter.tree('list', trees, { force: true });
61016 });
61017
61018 return function run(_x8, _x9, _x10, _x11) {
61019 return _ref12.apply(this, arguments);
61020 };
61021}();
61022
61023exports.getParent = getParent;
61024exports.hasWrapper = hasWrapper;
61025exports.setFlags = setFlags;
61026exports.getReqDepth = getReqDepth;
61027exports.filterTree = filterTree;
61028exports.getDevDeps = getDevDeps;
61029
61030var _install;
61031
61032function _load_install() {
61033 return _install = __webpack_require__(41);
61034}
61035
61036var _lockfile;
61037
61038function _load_lockfile() {
61039 return _lockfile = _interopRequireDefault(__webpack_require__(25));
61040}
61041
61042function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
61043
61044var invariant = __webpack_require__(15);
61045
61046var micromatch = __webpack_require__(109);
61047
61048var requireLockfile = exports.requireLockfile = true;
61049
61050function buildCount(trees) {
61051 if (!trees || !trees.length) {
61052 return 0;
61053 }
61054
61055 var count = 0;
61056
61057 for (var _iterator = trees, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
61058 var _ref;
61059
61060 if (_isArray) {
61061 if (_i >= _iterator.length) break;
61062 _ref = _iterator[_i++];
61063 } else {
61064 _i = _iterator.next();
61065 if (_i.done) break;
61066 _ref = _i.value;
61067 }
61068
61069 var tree = _ref;
61070
61071 if (tree.shadow) {
61072 continue;
61073 }
61074
61075 count++;
61076 count += buildCount(tree.children);
61077 }
61078
61079 return count;
61080}
61081
61082function getParent(key, treesByKey) {
61083 var parentKey = key.slice(0, key.lastIndexOf('#'));
61084 return treesByKey[parentKey];
61085}
61086
61087function hasWrapper(commander, args) {
61088 return true;
61089}
61090
61091function setFlags(commander) {
61092 commander.description('Lists installed packages.');
61093 commander.option('--depth [depth]', 'Limit the depth of the shown dependencies');
61094 commander.option('--pattern [pattern]', 'Filter dependencies by pattern');
61095}
61096
61097function getReqDepth(inputDepth) {
61098 return inputDepth && /^\d+$/.test(inputDepth) ? Number(inputDepth) : -1;
61099}
61100
61101function filterTree(tree, filters) {
61102 var pattern = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
61103
61104 if (tree.children) {
61105 tree.children = tree.children.filter(function (child) {
61106 return filterTree(child, filters, pattern);
61107 });
61108 }
61109
61110 var notDim = tree.color !== 'dim';
61111 var hasChildren = tree.children == null ? false : tree.children.length > 0;
61112 var name = tree.name.slice(0, tree.name.lastIndexOf('@'));
61113 var found = micromatch.any(name, filters) || micromatch.contains(name, pattern);
61114
61115 return notDim && (found || hasChildren);
61116}
61117
61118function getDevDeps(manifest) {
61119 if (manifest.devDependencies) {
61120 return new (_set || _load_set()).default((0, (_keys || _load_keys()).default)(manifest.devDependencies).map(function (key) {
61121 return `${key}@${manifest.devDependencies[key]}`;
61122 }));
61123 } else {
61124 return new (_set || _load_set()).default();
61125 }
61126}
61127
61128/***/ }),
61129/* 295 */
61130/***/ (function(module, exports, __webpack_require__) {
61131
61132"use strict";
61133
61134
61135Object.defineProperty(exports, "__esModule", {
61136 value: true
61137});
61138exports.run = exports.requireLockfile = undefined;
61139
61140var _keys;
61141
61142function _load_keys() {
61143 return _keys = _interopRequireDefault(__webpack_require__(14));
61144}
61145
61146var _getIterator2;
61147
61148function _load_getIterator() {
61149 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
61150}
61151
61152var _extends2;
61153
61154function _load_extends() {
61155 return _extends2 = _interopRequireDefault(__webpack_require__(24));
61156}
61157
61158var _asyncToGenerator2;
61159
61160function _load_asyncToGenerator() {
61161 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
61162}
61163
61164var run = exports.run = function () {
61165 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
61166 var isWorkspaceRoot = config.workspaceRootFolder && config.cwd === config.workspaceRootFolder;
61167
61168 if (!args.length) {
61169 throw new (_errors || _load_errors()).MessageError(reporter.lang('tooFewArguments', 1));
61170 }
61171
61172 // running "yarn remove something" in a workspace root is often a mistake
61173 if (isWorkspaceRoot && !flags.ignoreWorkspaceRootCheck) {
61174 throw new (_errors || _load_errors()).MessageError(reporter.lang('workspacesRemoveRootCheck'));
61175 }
61176
61177 var totalSteps = args.length + 1;
61178 var step = 0;
61179
61180 // load manifests
61181 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder);
61182 var rootManifests = yield config.getRootManifests();
61183 var manifests = [];
61184
61185 for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
61186 var _ref2;
61187
61188 if (_isArray) {
61189 if (_i >= _iterator.length) break;
61190 _ref2 = _iterator[_i++];
61191 } else {
61192 _i = _iterator.next();
61193 if (_i.done) break;
61194 _ref2 = _i.value;
61195 }
61196
61197 var name = _ref2;
61198
61199 reporter.step(++step, totalSteps, `Removing module ${name}`, emoji.get('wastebasket'));
61200
61201 var found = false;
61202
61203 for (var _iterator2 = (0, (_keys || _load_keys()).default)((_index || _load_index()).registries), _isArray2 = Array.isArray(_iterator2), _i3 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
61204 var _ref3;
61205
61206 if (_isArray2) {
61207 if (_i3 >= _iterator2.length) break;
61208 _ref3 = _iterator2[_i3++];
61209 } else {
61210 _i3 = _iterator2.next();
61211 if (_i3.done) break;
61212 _ref3 = _i3.value;
61213 }
61214
61215 var registryName = _ref3;
61216
61217 var registry = config.registries[registryName];
61218 var object = rootManifests[registryName].object;
61219
61220 for (var _iterator3 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray3 = Array.isArray(_iterator3), _i4 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
61221 var _ref4;
61222
61223 if (_isArray3) {
61224 if (_i4 >= _iterator3.length) break;
61225 _ref4 = _iterator3[_i4++];
61226 } else {
61227 _i4 = _iterator3.next();
61228 if (_i4.done) break;
61229 _ref4 = _i4.value;
61230 }
61231
61232 var type = _ref4;
61233
61234 var deps = object[type];
61235 if (deps && deps[name]) {
61236 found = true;
61237 delete deps[name];
61238 }
61239 }
61240
61241 var possibleManifestLoc = path.join(config.cwd, registry.folder, name);
61242 if (yield (_fs || _load_fs()).exists(possibleManifestLoc)) {
61243 var manifest = yield config.maybeReadManifest(possibleManifestLoc, registryName);
61244 if (manifest) {
61245 manifests.push([possibleManifestLoc, manifest]);
61246 }
61247 }
61248 }
61249
61250 if (!found) {
61251 throw new (_errors || _load_errors()).MessageError(reporter.lang('moduleNotInManifest'));
61252 }
61253 }
61254
61255 // save manifests
61256 yield config.saveRootManifests(rootManifests);
61257
61258 // run hooks - npm runs these one after another
61259 var _arr = ['preuninstall', 'uninstall', 'postuninstall'];
61260 for (var _i2 = 0; _i2 < _arr.length; _i2++) {
61261 var action = _arr[_i2];
61262 for (var _iterator4 = manifests, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
61263 var _ref6;
61264
61265 if (_isArray4) {
61266 if (_i5 >= _iterator4.length) break;
61267 _ref6 = _iterator4[_i5++];
61268 } else {
61269 _i5 = _iterator4.next();
61270 if (_i5.done) break;
61271 _ref6 = _i5.value;
61272 }
61273
61274 var _ref5 = _ref6;
61275 var loc = _ref5[0];
61276
61277 yield config.executeLifecycleScript(action, loc);
61278 }
61279 }
61280
61281 // reinstall so we can get the updated lockfile
61282 reporter.step(++step, totalSteps, reporter.lang('uninstallRegenerate'), emoji.get('hammer'));
61283 var installFlags = (0, (_extends2 || _load_extends()).default)({ force: true, workspaceRootIsCwd: true }, flags);
61284 var reinstall = new (_install || _load_install()).Install(installFlags, config, new (_index2 || _load_index2()).NoopReporter(), lockfile);
61285 yield reinstall.init();
61286
61287 //
61288 reporter.success(reporter.lang('uninstalledPackages'));
61289 });
61290
61291 return function run(_x, _x2, _x3, _x4) {
61292 return _ref.apply(this, arguments);
61293 };
61294}();
61295
61296exports.setFlags = setFlags;
61297exports.hasWrapper = hasWrapper;
61298
61299var _lockfile;
61300
61301function _load_lockfile() {
61302 return _lockfile = _interopRequireDefault(__webpack_require__(25));
61303}
61304
61305var _index;
61306
61307function _load_index() {
61308 return _index = __webpack_require__(61);
61309}
61310
61311var _install;
61312
61313function _load_install() {
61314 return _install = __webpack_require__(41);
61315}
61316
61317var _errors;
61318
61319function _load_errors() {
61320 return _errors = __webpack_require__(6);
61321}
61322
61323var _index2;
61324
61325function _load_index2() {
61326 return _index2 = __webpack_require__(189);
61327}
61328
61329var _fs;
61330
61331function _load_fs() {
61332 return _fs = _interopRequireWildcard(__webpack_require__(8));
61333}
61334
61335var _constants;
61336
61337function _load_constants() {
61338 return _constants = _interopRequireWildcard(__webpack_require__(13));
61339}
61340
61341function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
61342
61343function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
61344
61345var path = __webpack_require__(1);
61346
61347var emoji = __webpack_require__(242);
61348
61349var requireLockfile = exports.requireLockfile = true;
61350
61351function setFlags(commander) {
61352 commander.description('Removes a package from your direct dependencies updating your package.json and yarn.lock.');
61353 commander.usage('remove [packages ...] [flags]');
61354 commander.option('-W, --ignore-workspace-root-check', 'required to run yarn remove inside a workspace root');
61355}
61356
61357function hasWrapper(commander, args) {
61358 return true;
61359}
61360
61361/***/ }),
61362/* 296 */
61363/***/ (function(module, exports, __webpack_require__) {
61364
61365"use strict";
61366
61367
61368Object.defineProperty(exports, "__esModule", {
61369 value: true
61370});
61371exports.run = exports.getBinEntries = undefined;
61372
61373var _promise;
61374
61375function _load_promise() {
61376 return _promise = _interopRequireDefault(__webpack_require__(7));
61377}
61378
61379var _from;
61380
61381function _load_from() {
61382 return _from = _interopRequireDefault(__webpack_require__(53));
61383}
61384
61385var _stringify;
61386
61387function _load_stringify() {
61388 return _stringify = _interopRequireDefault(__webpack_require__(36));
61389}
61390
61391var _keys;
61392
61393function _load_keys() {
61394 return _keys = _interopRequireDefault(__webpack_require__(14));
61395}
61396
61397var _map;
61398
61399function _load_map() {
61400 return _map = _interopRequireDefault(__webpack_require__(42));
61401}
61402
61403var _set;
61404
61405function _load_set() {
61406 return _set = _interopRequireDefault(__webpack_require__(16));
61407}
61408
61409var _asyncToGenerator2;
61410
61411function _load_asyncToGenerator() {
61412 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
61413}
61414
61415var _getIterator2;
61416
61417function _load_getIterator() {
61418 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
61419}
61420
61421var _create;
61422
61423function _load_create() {
61424 return _create = _interopRequireDefault(__webpack_require__(210));
61425}
61426
61427var getBinEntries = exports.getBinEntries = function () {
61428 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
61429 var binFolders = new (_set || _load_set()).default();
61430 var binEntries = new (_map || _load_map()).default();
61431
61432 // Setup the node_modules/.bin folders for analysis
61433 for (var _iterator2 = config.registryFolders, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
61434 var _ref4;
61435
61436 if (_isArray2) {
61437 if (_i2 >= _iterator2.length) break;
61438 _ref4 = _iterator2[_i2++];
61439 } else {
61440 _i2 = _iterator2.next();
61441 if (_i2.done) break;
61442 _ref4 = _i2.value;
61443 }
61444
61445 var registryFolder = _ref4;
61446
61447 binFolders.add(path.resolve(config.cwd, registryFolder, '.bin'));
61448 binFolders.add(path.resolve(config.lockfileFolder, registryFolder, '.bin'));
61449 }
61450
61451 // Same thing, but for the pnp dependencies, located inside the cache
61452 if (yield (_fs || _load_fs()).exists(`${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`)) {
61453 var pnpApi = (0, (_dynamicRequire || _load_dynamicRequire()).dynamicRequire)(`${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`);
61454
61455 var packageLocator = pnpApi.findPackageLocator(`${config.cwd}/`);
61456 var packageInformation = pnpApi.getPackageInformation(packageLocator);
61457
61458 for (var _iterator3 = packageInformation.packageDependencies.entries(), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
61459 var _ref6;
61460
61461 if (_isArray3) {
61462 if (_i3 >= _iterator3.length) break;
61463 _ref6 = _iterator3[_i3++];
61464 } else {
61465 _i3 = _iterator3.next();
61466 if (_i3.done) break;
61467 _ref6 = _i3.value;
61468 }
61469
61470 var _ref5 = _ref6;
61471 var name = _ref5[0];
61472 var reference = _ref5[1];
61473
61474 var dependencyInformation = pnpApi.getPackageInformation({ name, reference });
61475
61476 if (dependencyInformation.packageLocation) {
61477 binFolders.add(`${dependencyInformation.packageLocation}/.bin`);
61478 }
61479 }
61480 }
61481
61482 // Build up a list of possible scripts by exploring the folders marked for analysis
61483 for (var _iterator4 = binFolders, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
61484 var _ref7;
61485
61486 if (_isArray4) {
61487 if (_i4 >= _iterator4.length) break;
61488 _ref7 = _iterator4[_i4++];
61489 } else {
61490 _i4 = _iterator4.next();
61491 if (_i4.done) break;
61492 _ref7 = _i4.value;
61493 }
61494
61495 var binFolder = _ref7;
61496
61497 if (yield (_fs || _load_fs()).exists(binFolder)) {
61498 for (var _iterator5 = yield (_fs || _load_fs()).readdir(binFolder), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
61499 var _ref8;
61500
61501 if (_isArray5) {
61502 if (_i5 >= _iterator5.length) break;
61503 _ref8 = _iterator5[_i5++];
61504 } else {
61505 _i5 = _iterator5.next();
61506 if (_i5.done) break;
61507 _ref8 = _i5.value;
61508 }
61509
61510 var _name = _ref8;
61511
61512 binEntries.set(_name, path.join(binFolder, _name));
61513 }
61514 }
61515 }
61516
61517 return binEntries;
61518 });
61519
61520 return function getBinEntries(_x) {
61521 return _ref3.apply(this, arguments);
61522 };
61523}();
61524
61525var run = exports.run = function () {
61526 var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
61527 var realRunCommand = function () {
61528 var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (action, args) {
61529 // build up list of commands
61530 var cmds = [];
61531
61532 if (pkgScripts && action in pkgScripts) {
61533 var preAction = `pre${action}`;
61534 if (preAction in pkgScripts) {
61535 cmds.push([preAction, pkgScripts[preAction]]);
61536 }
61537
61538 var script = scripts.get(action);
61539 invariant(script, 'Script must exist');
61540 cmds.push([action, script]);
61541
61542 var postAction = `post${action}`;
61543 if (postAction in pkgScripts) {
61544 cmds.push([postAction, pkgScripts[postAction]]);
61545 }
61546 } else if (scripts.has(action)) {
61547 var _script = scripts.get(action);
61548 invariant(_script, 'Script must exist');
61549 cmds.push([action, _script]);
61550 }
61551
61552 if (cmds.length) {
61553 var ignoreEngines = !!(flags.ignoreEngines || config.getOption('ignore-engines'));
61554 try {
61555 yield (0, (_packageCompatibility || _load_packageCompatibility()).checkOne)(pkg, config, ignoreEngines);
61556 } catch (err) {
61557 throw err instanceof (_errors || _load_errors()).MessageError ? new (_errors || _load_errors()).MessageError(reporter.lang('cannotRunWithIncompatibleEnv')) : err;
61558 }
61559
61560 // Disable wrapper in executed commands
61561 process.env.YARN_WRAP_OUTPUT = 'false';
61562 for (var _iterator8 = cmds, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
61563 var _ref16;
61564
61565 if (_isArray8) {
61566 if (_i8 >= _iterator8.length) break;
61567 _ref16 = _iterator8[_i8++];
61568 } else {
61569 _i8 = _iterator8.next();
61570 if (_i8.done) break;
61571 _ref16 = _i8.value;
61572 }
61573
61574 var _ref15 = _ref16;
61575 var stage = _ref15[0];
61576 var cmd = _ref15[1];
61577
61578 // only tack on trailing arguments for default script, ignore for pre and post - #1595
61579 var cmdWithArgs = stage === action ? sh`${unquoted(cmd)} ${args}` : cmd;
61580 var customShell = config.getOption('script-shell');
61581 yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execCommand)({
61582 stage,
61583 config,
61584 cmd: cmdWithArgs,
61585 cwd: flags.into || config.cwd,
61586 isInteractive: true,
61587 customShell: customShell ? String(customShell) : undefined
61588 });
61589 }
61590 } else if (action === 'env') {
61591 reporter.log((0, (_stringify || _load_stringify()).default)((yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)('env', config.cwd, config)), null, 2), { force: true });
61592 } else {
61593 var suggestion = void 0;
61594
61595 for (var _iterator9 = scripts.keys(), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
61596 var _ref17;
61597
61598 if (_isArray9) {
61599 if (_i9 >= _iterator9.length) break;
61600 _ref17 = _iterator9[_i9++];
61601 } else {
61602 _i9 = _iterator9.next();
61603 if (_i9.done) break;
61604 _ref17 = _i9.value;
61605 }
61606
61607 var commandName = _ref17;
61608
61609 var steps = leven(commandName, action);
61610 if (steps < 2) {
61611 suggestion = commandName;
61612 }
61613 }
61614
61615 var msg = `Command ${(0, (_stringify || _load_stringify()).default)(action)} not found.`;
61616 if (suggestion) {
61617 msg += ` Did you mean ${(0, (_stringify || _load_stringify()).default)(suggestion)}?`;
61618 }
61619 throw new (_errors || _load_errors()).MessageError(msg);
61620 }
61621 });
61622
61623 return function realRunCommand(_x6, _x7) {
61624 return _ref14.apply(this, arguments);
61625 };
61626 }();
61627
61628 // list possible scripts if none specified
61629
61630
61631 var pkg = yield config.readManifest(config.cwd);
61632
61633 var binCommands = new (_set || _load_set()).default();
61634 var pkgCommands = new (_set || _load_set()).default();
61635
61636 var scripts = new (_map || _load_map()).default();
61637
61638 for (var _iterator6 = yield getBinEntries(config), _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
61639 var _ref11;
61640
61641 if (_isArray6) {
61642 if (_i6 >= _iterator6.length) break;
61643 _ref11 = _iterator6[_i6++];
61644 } else {
61645 _i6 = _iterator6.next();
61646 if (_i6.done) break;
61647 _ref11 = _i6.value;
61648 }
61649
61650 var _ref10 = _ref11;
61651 var name = _ref10[0];
61652 var loc = _ref10[1];
61653
61654 scripts.set(name, quoteForShell(loc));
61655 binCommands.add(name);
61656 }
61657
61658 var pkgScripts = pkg.scripts;
61659
61660 if (pkgScripts) {
61661 for (var _iterator7 = (0, (_keys || _load_keys()).default)(pkgScripts).sort(), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
61662 var _ref12;
61663
61664 if (_isArray7) {
61665 if (_i7 >= _iterator7.length) break;
61666 _ref12 = _iterator7[_i7++];
61667 } else {
61668 _i7 = _iterator7.next();
61669 if (_i7.done) break;
61670 _ref12 = _i7.value;
61671 }
61672
61673 var _name2 = _ref12;
61674
61675 scripts.set(_name2, pkgScripts[_name2] || '');
61676 pkgCommands.add(_name2);
61677 }
61678 }
61679
61680 function runCommand(_ref13) {
61681 var action = _ref13[0],
61682 args = _ref13.slice(1);
61683
61684 return (0, (_hooks || _load_hooks()).callThroughHook)('runScript', function () {
61685 return realRunCommand(action, args);
61686 }, { action, args });
61687 }
61688
61689 if (args.length === 0) {
61690 if (binCommands.size > 0) {
61691 reporter.info(`${reporter.lang('binCommands') + (0, (_from || _load_from()).default)(binCommands).join(', ')}`);
61692 } else {
61693 reporter.error(reporter.lang('noBinAvailable'));
61694 }
61695
61696 var printedCommands = new (_map || _load_map()).default();
61697
61698 for (var _iterator10 = pkgCommands, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
61699 var _ref18;
61700
61701 if (_isArray10) {
61702 if (_i10 >= _iterator10.length) break;
61703 _ref18 = _iterator10[_i10++];
61704 } else {
61705 _i10 = _iterator10.next();
61706 if (_i10.done) break;
61707 _ref18 = _i10.value;
61708 }
61709
61710 var pkgCommand = _ref18;
61711
61712 var action = scripts.get(pkgCommand);
61713 invariant(action, 'Action must exists');
61714 printedCommands.set(pkgCommand, action);
61715 }
61716
61717 if (pkgCommands.size > 0) {
61718 reporter.info(`${reporter.lang('possibleCommands')}`);
61719 reporter.list('possibleCommands', (0, (_from || _load_from()).default)(pkgCommands), toObject(printedCommands));
61720 if (!flags.nonInteractive) {
61721 yield reporter.question(reporter.lang('commandQuestion')).then(function (answer) {
61722 return runCommand(answer.trim().split(' '));
61723 }, function () {
61724 return reporter.error(reporter.lang('commandNotSpecified'));
61725 });
61726 }
61727 } else {
61728 reporter.error(reporter.lang('noScriptsAvailable'));
61729 }
61730 return (_promise || _load_promise()).default.resolve();
61731 } else {
61732 return runCommand(args);
61733 }
61734 });
61735
61736 return function run(_x2, _x3, _x4, _x5) {
61737 return _ref9.apply(this, arguments);
61738 };
61739}();
61740
61741exports.setFlags = setFlags;
61742exports.hasWrapper = hasWrapper;
61743
61744var _executeLifecycleScript;
61745
61746function _load_executeLifecycleScript() {
61747 return _executeLifecycleScript = __webpack_require__(100);
61748}
61749
61750var _dynamicRequire;
61751
61752function _load_dynamicRequire() {
61753 return _dynamicRequire = __webpack_require__(308);
61754}
61755
61756var _hooks;
61757
61758function _load_hooks() {
61759 return _hooks = __webpack_require__(311);
61760}
61761
61762var _errors;
61763
61764function _load_errors() {
61765 return _errors = __webpack_require__(6);
61766}
61767
61768var _packageCompatibility;
61769
61770function _load_packageCompatibility() {
61771 return _packageCompatibility = __webpack_require__(196);
61772}
61773
61774var _fs;
61775
61776function _load_fs() {
61777 return _fs = _interopRequireWildcard(__webpack_require__(8));
61778}
61779
61780var _constants;
61781
61782function _load_constants() {
61783 return _constants = _interopRequireWildcard(__webpack_require__(13));
61784}
61785
61786function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
61787
61788function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
61789
61790var invariant = __webpack_require__(15);
61791
61792var leven = __webpack_require__(818);
61793var path = __webpack_require__(1);
61794
61795var _require = __webpack_require__(852),
61796 quoteForShell = _require.quoteForShell,
61797 sh = _require.sh,
61798 unquoted = _require.unquoted;
61799
61800function toObject(input) {
61801 var output = (0, (_create || _load_create()).default)(null);
61802
61803 for (var _iterator = input.entries(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
61804 var _ref2;
61805
61806 if (_isArray) {
61807 if (_i >= _iterator.length) break;
61808 _ref2 = _iterator[_i++];
61809 } else {
61810 _i = _iterator.next();
61811 if (_i.done) break;
61812 _ref2 = _i.value;
61813 }
61814
61815 var _ref = _ref2;
61816 var key = _ref[0];
61817 var val = _ref[1];
61818
61819 output[key] = val;
61820 }
61821
61822 return output;
61823}
61824
61825function setFlags(commander) {
61826 commander.description('Runs a defined package script.');
61827}
61828
61829function hasWrapper(commander, args) {
61830 return true;
61831}
61832
61833/***/ }),
61834/* 297 */
61835/***/ (function(module, exports, __webpack_require__) {
61836
61837"use strict";
61838
61839
61840Object.defineProperty(exports, "__esModule", {
61841 value: true
61842});
61843exports.examples = exports.hasWrapper = exports.run = exports.getName = undefined;
61844
61845var _asyncToGenerator2;
61846
61847function _load_asyncToGenerator() {
61848 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
61849}
61850
61851var getName = exports.getName = function () {
61852 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (args, config) {
61853 var name = args.shift();
61854
61855 if (!name) {
61856 var pkg = yield config.readRootManifest();
61857 name = pkg.name;
61858 }
61859
61860 if (name) {
61861 if (!(0, (_validate || _load_validate()).isValidPackageName)(name)) {
61862 throw new (_errors || _load_errors()).MessageError(config.reporter.lang('invalidPackageName'));
61863 }
61864
61865 return (_npmRegistry || _load_npmRegistry()).default.escapeName(name);
61866 } else {
61867 throw new (_errors || _load_errors()).MessageError(config.reporter.lang('unknownPackageName'));
61868 }
61869 });
61870
61871 return function getName(_x, _x2) {
61872 return _ref.apply(this, arguments);
61873 };
61874}();
61875
61876var list = function () {
61877 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
61878 var name = yield getName(args, config);
61879
61880 reporter.step(1, 1, reporter.lang('gettingTags'));
61881 var tags = yield config.registries.npm.request(`-/package/${name}/dist-tags`);
61882
61883 if (tags) {
61884 reporter.info(`Package ${name}`);
61885 for (var _name in tags) {
61886 reporter.info(`${_name}: ${tags[_name]}`);
61887 }
61888 }
61889
61890 if (!tags) {
61891 throw new (_errors || _load_errors()).MessageError(reporter.lang('packageNotFoundRegistry', name, 'npm'));
61892 }
61893 });
61894
61895 return function list(_x3, _x4, _x5, _x6) {
61896 return _ref2.apply(this, arguments);
61897 };
61898}();
61899
61900var remove = function () {
61901 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
61902 if (args.length !== 2) {
61903 return false;
61904 }
61905
61906 var name = yield getName(args, config);
61907 var tag = args.shift();
61908
61909 reporter.step(1, 3, reporter.lang('loggingIn'));
61910 var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name);
61911
61912 reporter.step(2, 3, reporter.lang('deletingTags'));
61913 var result = yield config.registries.npm.request(`-/package/${name}/dist-tags/${encodeURI(tag)}`, {
61914 method: 'DELETE'
61915 });
61916
61917 if (result === false) {
61918 reporter.error(reporter.lang('deletedTagFail'));
61919 } else {
61920 reporter.success(reporter.lang('deletedTag'));
61921 }
61922
61923 reporter.step(3, 3, reporter.lang('revokingToken'));
61924 yield revoke();
61925
61926 if (result === false) {
61927 throw new Error();
61928 } else {
61929 return true;
61930 }
61931 });
61932
61933 return function remove(_x7, _x8, _x9, _x10) {
61934 return _ref3.apply(this, arguments);
61935 };
61936}();
61937
61938exports.setFlags = setFlags;
61939
61940var _buildSubCommands2;
61941
61942function _load_buildSubCommands() {
61943 return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
61944}
61945
61946var _login;
61947
61948function _load_login() {
61949 return _login = __webpack_require__(97);
61950}
61951
61952var _npmRegistry;
61953
61954function _load_npmRegistry() {
61955 return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
61956}
61957
61958var _errors;
61959
61960function _load_errors() {
61961 return _errors = __webpack_require__(6);
61962}
61963
61964var _normalizePattern2;
61965
61966function _load_normalizePattern() {
61967 return _normalizePattern2 = __webpack_require__(52);
61968}
61969
61970var _validate;
61971
61972function _load_validate() {
61973 return _validate = __webpack_require__(119);
61974}
61975
61976function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
61977
61978function setFlags(commander) {
61979 commander.description('Add, remove, or list tags on a package.');
61980}
61981
61982var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('tag', {
61983 add(config, reporter, flags, args) {
61984 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
61985 if (args.length !== 2) {
61986 return false;
61987 }
61988
61989 var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(args.shift()),
61990 name = _normalizePattern.name,
61991 range = _normalizePattern.range,
61992 hasVersion = _normalizePattern.hasVersion;
61993
61994 if (!hasVersion) {
61995 throw new (_errors || _load_errors()).MessageError(reporter.lang('requiredVersionInRange'));
61996 }
61997 if (!(0, (_validate || _load_validate()).isValidPackageName)(name)) {
61998 throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName'));
61999 }
62000
62001 var tag = args.shift();
62002
62003 reporter.step(1, 3, reporter.lang('loggingIn'));
62004 var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name);
62005
62006 reporter.step(2, 3, reporter.lang('creatingTag', tag, range));
62007 var result = yield config.registries.npm.request(`-/package/${(_npmRegistry || _load_npmRegistry()).default.escapeName(name)}/dist-tags/${encodeURI(tag)}`, {
62008 method: 'PUT',
62009 body: range
62010 });
62011
62012 if (result != null && result.ok) {
62013 reporter.success(reporter.lang('createdTag'));
62014 } else {
62015 reporter.error(reporter.lang('createdTagFail'));
62016 }
62017
62018 reporter.step(3, 3, reporter.lang('revokingToken'));
62019 yield revoke();
62020
62021 if (result != null && result.ok) {
62022 return true;
62023 } else {
62024 throw new Error();
62025 }
62026 })();
62027 },
62028
62029 rm(config, reporter, flags, args) {
62030 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
62031 reporter.warn(`\`yarn tag rm\` is deprecated. Please use \`yarn tag remove\`.`);
62032 yield remove(config, reporter, flags, args);
62033 })();
62034 },
62035
62036 remove(config, reporter, flags, args) {
62037 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
62038 yield remove(config, reporter, flags, args);
62039 })();
62040 },
62041
62042 ls(config, reporter, flags, args) {
62043 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
62044 reporter.warn(`\`yarn tag ls\` is deprecated. Please use \`yarn tag list\`.`);
62045 yield list(config, reporter, flags, args);
62046 })();
62047 },
62048
62049 list(config, reporter, flags, args) {
62050 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
62051 yield list(config, reporter, flags, args);
62052 })();
62053 }
62054}, ['add <pkg>@<version> [<tag>]', 'remove <pkg> <tag>', 'list [<pkg>]']),
62055 run = _buildSubCommands.run,
62056 hasWrapper = _buildSubCommands.hasWrapper,
62057 examples = _buildSubCommands.examples;
62058
62059exports.run = run;
62060exports.hasWrapper = hasWrapper;
62061exports.examples = examples;
62062
62063/***/ }),
62064/* 298 */
62065/***/ (function(module, exports, __webpack_require__) {
62066
62067"use strict";
62068
62069
62070Object.defineProperty(exports, "__esModule", {
62071 value: true
62072});
62073exports.run = exports.requireLockfile = undefined;
62074
62075var _promise;
62076
62077function _load_promise() {
62078 return _promise = _interopRequireDefault(__webpack_require__(7));
62079}
62080
62081var _getIterator2;
62082
62083function _load_getIterator() {
62084 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
62085}
62086
62087var _keys;
62088
62089function _load_keys() {
62090 return _keys = _interopRequireDefault(__webpack_require__(14));
62091}
62092
62093var _extends2;
62094
62095function _load_extends() {
62096 return _extends2 = _interopRequireDefault(__webpack_require__(24));
62097}
62098
62099var _asyncToGenerator2;
62100
62101function _load_asyncToGenerator() {
62102 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
62103}
62104
62105var run = exports.run = function () {
62106 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
62107 var outdatedFieldName = flags.latest ? 'latest' : 'wanted';
62108 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder);
62109
62110 var deps = yield (0, (_upgrade || _load_upgrade()).getOutdated)(config, reporter, (0, (_extends2 || _load_extends()).default)({}, flags, { includeWorkspaceDeps: true }), lockfile, args);
62111
62112 if (deps.length === 0) {
62113 reporter.success(reporter.lang('allDependenciesUpToDate'));
62114 return;
62115 }
62116
62117 // Fail early with runtime compatibility checks so that it doesn't fail after you've made your selections
62118 var install = new (_install2 || _load_install()).Install(flags, config, reporter, lockfile);
62119 yield install.checkCompatibility();
62120
62121 var usesWorkspaces = !!config.workspaceRootFolder;
62122
62123 var maxLengthArr = {
62124 name: 'name'.length,
62125 current: 'from'.length,
62126 range: 'latest'.length,
62127 [outdatedFieldName]: 'to'.length,
62128 workspaceName: 'workspace'.length
62129 };
62130
62131 var keysWithDynamicLength = ['name', 'current', outdatedFieldName];
62132
62133 if (!flags.latest) {
62134 maxLengthArr.range = 'range'.length;
62135 keysWithDynamicLength.push('range');
62136 }
62137
62138 if (usesWorkspaces) {
62139 keysWithDynamicLength.push('workspaceName');
62140 }
62141
62142 deps.forEach(function (dep) {
62143 return keysWithDynamicLength.forEach(function (key) {
62144 maxLengthArr[key] = Math.max(maxLengthArr[key], dep[key].length);
62145 });
62146 });
62147
62148 // Depends on maxLengthArr
62149 var addPadding = function addPadding(dep) {
62150 return function (key) {
62151 return `${dep[key]}${' '.repeat(maxLengthArr[key] - dep[key].length)}`;
62152 };
62153 };
62154 var headerPadding = function headerPadding(header, key) {
62155 return `${reporter.format.bold.underline(header)}${' '.repeat(maxLengthArr[key] - header.length)}`;
62156 };
62157
62158 var colorizeName = function colorizeName(from, to) {
62159 return reporter.format[(0, (_colorForVersions || _load_colorForVersions()).default)(from, to)];
62160 };
62161
62162 var getNameFromHint = function getNameFromHint(hint) {
62163 return hint ? `${hint}Dependencies` : 'dependencies';
62164 };
62165
62166 var makeRow = function makeRow(dep) {
62167 var padding = addPadding(dep);
62168 var name = colorizeName(dep.current, dep[outdatedFieldName])(padding('name'));
62169 var current = reporter.format.blue(padding('current'));
62170 var latest = (0, (_colorizeDiff || _load_colorizeDiff()).default)(dep.current, padding(outdatedFieldName), reporter);
62171 var url = reporter.format.cyan(dep.url);
62172 var range = reporter.format.blue(flags.latest ? 'latest' : padding('range'));
62173 if (usesWorkspaces) {
62174 var workspace = padding('workspaceName');
62175 return `${name} ${range} ${current} ❯ ${latest} ${workspace} ${url}`;
62176 } else {
62177 return `${name} ${range} ${current} ❯ ${latest} ${url}`;
62178 }
62179 };
62180
62181 var makeHeaderRow = function makeHeaderRow() {
62182 var name = headerPadding('name', 'name');
62183 var range = headerPadding('range', 'range');
62184 var from = headerPadding('from', 'current');
62185 var to = headerPadding('to', outdatedFieldName);
62186 var url = reporter.format.bold.underline('url');
62187 if (usesWorkspaces) {
62188 var workspace = headerPadding('workspace', 'workspaceName');
62189 return ` ${name} ${range} ${from} ${to} ${workspace} ${url}`;
62190 } else {
62191 return ` ${name} ${range} ${from} ${to} ${url}`;
62192 }
62193 };
62194
62195 var groupedDeps = deps.reduce(function (acc, dep) {
62196 var hint = dep.hint,
62197 name = dep.name,
62198 upgradeTo = dep.upgradeTo;
62199
62200 var version = dep[outdatedFieldName];
62201 var key = getNameFromHint(hint);
62202 var xs = acc[key] || [];
62203 acc[key] = xs.concat({
62204 name: makeRow(dep),
62205 value: dep,
62206 short: `${name}@${version}`,
62207 upgradeTo
62208 });
62209 return acc;
62210 }, {});
62211
62212 var flatten = function flatten(xs) {
62213 return xs.reduce(function (ys, y) {
62214 return ys.concat(Array.isArray(y) ? flatten(y) : y);
62215 }, []);
62216 };
62217
62218 var choices = flatten((0, (_keys || _load_keys()).default)(groupedDeps).map(function (key) {
62219 return [new (_inquirer || _load_inquirer()).default.Separator(reporter.format.bold.underline.green(key)), new (_inquirer || _load_inquirer()).default.Separator(makeHeaderRow()), groupedDeps[key], new (_inquirer || _load_inquirer()).default.Separator(' ')];
62220 }));
62221
62222 try {
62223 var red = reporter.format.red('<red>');
62224 var yellow = reporter.format.yellow('<yellow>');
62225 var green = reporter.format.green('<green>');
62226 reporter.info(reporter.lang('legendColorsForVersionUpdates', red, yellow, green));
62227
62228 var answers = yield reporter.prompt('Choose which packages to update.', choices, {
62229 name: 'packages',
62230 type: 'checkbox',
62231 validate: function validate(answer) {
62232 return !!answer.length || 'You must choose at least one package.';
62233 }
62234 });
62235
62236 var getPattern = function getPattern(_ref2) {
62237 var upgradeTo = _ref2.upgradeTo;
62238 return upgradeTo;
62239 };
62240 var isHint = function isHint(x) {
62241 return function (_ref3) {
62242 var hint = _ref3.hint;
62243 return hint === x;
62244 };
62245 };
62246
62247 var _arr = [null, 'dev', 'optional', 'peer'];
62248 for (var _i = 0; _i < _arr.length; _i++) {
62249 var hint = _arr[_i];
62250 // Reset dependency flags
62251 flags.dev = hint === 'dev';
62252 flags.peer = hint === 'peer';
62253 flags.optional = hint === 'optional';
62254 flags.ignoreWorkspaceRootCheck = true;
62255 flags.includeWorkspaceDeps = false;
62256 flags.workspaceRootIsCwd = false;
62257 var _deps = answers.filter(isHint(hint));
62258 if (_deps.length) {
62259 var _install = new (_install2 || _load_install()).Install(flags, config, reporter, lockfile);
62260
62261 var _ref4 = yield _install.fetchRequestFromCwd(),
62262 packagePatterns = _ref4.requests;
62263
62264 var depsByWorkspace = _deps.reduce(function (acc, dep) {
62265 var workspaceLoc = dep.workspaceLoc;
62266
62267 var xs = acc[workspaceLoc] || [];
62268 acc[workspaceLoc] = xs.concat(dep);
62269 return acc;
62270 }, {});
62271 var cwd = config.cwd;
62272 for (var _iterator = (0, (_keys || _load_keys()).default)(depsByWorkspace), _isArray = Array.isArray(_iterator), _i2 = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
62273 var _ref5;
62274
62275 if (_isArray) {
62276 if (_i2 >= _iterator.length) break;
62277 _ref5 = _iterator[_i2++];
62278 } else {
62279 _i2 = _iterator.next();
62280 if (_i2.done) break;
62281 _ref5 = _i2.value;
62282 }
62283
62284 var loc = _ref5;
62285
62286 var patterns = depsByWorkspace[loc].map(getPattern);
62287 (0, (_upgrade || _load_upgrade()).cleanLockfile)(lockfile, _deps, packagePatterns, reporter);
62288 reporter.info(reporter.lang('updateInstalling', getNameFromHint(hint)));
62289 if (loc !== '') {
62290 config.cwd = path.resolve(path.dirname(loc));
62291 }
62292 var add = new (_add || _load_add()).Add(patterns, flags, config, reporter, lockfile);
62293 yield add.init();
62294 config.cwd = cwd;
62295 }
62296 }
62297 }
62298 } catch (e) {
62299 (_promise || _load_promise()).default.reject(e);
62300 }
62301 });
62302
62303 return function run(_x, _x2, _x3, _x4) {
62304 return _ref.apply(this, arguments);
62305 };
62306}();
62307
62308exports.setFlags = setFlags;
62309exports.hasWrapper = hasWrapper;
62310
62311var _inquirer;
62312
62313function _load_inquirer() {
62314 return _inquirer = _interopRequireDefault(__webpack_require__(193));
62315}
62316
62317var _lockfile;
62318
62319function _load_lockfile() {
62320 return _lockfile = _interopRequireDefault(__webpack_require__(25));
62321}
62322
62323var _add;
62324
62325function _load_add() {
62326 return _add = __webpack_require__(154);
62327}
62328
62329var _upgrade;
62330
62331function _load_upgrade() {
62332 return _upgrade = __webpack_require__(194);
62333}
62334
62335var _colorForVersions;
62336
62337function _load_colorForVersions() {
62338 return _colorForVersions = _interopRequireDefault(__webpack_require__(306));
62339}
62340
62341var _colorizeDiff;
62342
62343function _load_colorizeDiff() {
62344 return _colorizeDiff = _interopRequireDefault(__webpack_require__(307));
62345}
62346
62347var _install2;
62348
62349function _load_install() {
62350 return _install2 = __webpack_require__(41);
62351}
62352
62353function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
62354
62355var path = __webpack_require__(1);
62356
62357var requireLockfile = exports.requireLockfile = true;
62358
62359function setFlags(commander) {
62360 commander.description('Provides an easy way to update outdated packages.');
62361 commander.usage('upgrade-interactive [flags]');
62362 commander.option('-S, --scope <scope>', 'upgrade packages under the specified scope');
62363 commander.option('--latest', 'list the latest version of packages, ignoring version ranges in package.json');
62364 commander.option('-E, --exact', 'install exact version. Only used when --latest is specified.');
62365 commander.option('-T, --tilde', 'install most recent release with the same minor version. Only used when --latest is specified.');
62366 commander.option('-C, --caret', 'install most recent release with the same major version. Only used when --latest is specified.');
62367}
62368
62369function hasWrapper(commander, args) {
62370 return true;
62371}
62372
62373/***/ }),
62374/* 299 */
62375/***/ (function(module, exports, __webpack_require__) {
62376
62377"use strict";
62378
62379
62380Object.defineProperty(exports, "__esModule", {
62381 value: true
62382});
62383exports.run = exports.setVersion = undefined;
62384
62385var _getIterator2;
62386
62387function _load_getIterator() {
62388 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
62389}
62390
62391var _assign;
62392
62393function _load_assign() {
62394 return _assign = _interopRequireDefault(__webpack_require__(23));
62395}
62396
62397var _promise;
62398
62399function _load_promise() {
62400 return _promise = _interopRequireDefault(__webpack_require__(7));
62401}
62402
62403var _asyncToGenerator2;
62404
62405function _load_asyncToGenerator() {
62406 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
62407}
62408
62409var setVersion = exports.setVersion = function () {
62410 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args, required) {
62411 var pkg = yield config.readRootManifest();
62412 var pkgLoc = pkg._loc;
62413 var scripts = (0, (_map || _load_map()).default)();
62414 var newVersion = flags.newVersion;
62415 var identifier = undefined;
62416 if (flags.preid) {
62417 identifier = flags.preid;
62418 }
62419 invariant(pkgLoc, 'expected package location');
62420
62421 if (args.length && !newVersion) {
62422 throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidVersionArgument', NEW_VERSION_FLAG));
62423 }
62424
62425 function runLifecycle(lifecycle) {
62426 if (scripts[lifecycle]) {
62427 return (0, (_executeLifecycleScript || _load_executeLifecycleScript()).execCommand)({ stage: lifecycle, config, cmd: scripts[lifecycle], cwd: config.cwd, isInteractive: true });
62428 }
62429
62430 return (_promise || _load_promise()).default.resolve();
62431 }
62432
62433 function isCommitHooksDisabled() {
62434 return flags.commitHooks === false || config.getOption('version-commit-hooks') === false;
62435 }
62436
62437 if (pkg.scripts) {
62438 // inherit `scripts` from manifest
62439 (0, (_assign || _load_assign()).default)(scripts, pkg.scripts);
62440 }
62441
62442 // get old version
62443 var oldVersion = pkg.version;
62444 if (oldVersion) {
62445 reporter.info(`${reporter.lang('currentVersion')}: ${oldVersion}`);
62446 } else {
62447 oldVersion = '0.0.0';
62448 }
62449
62450 // get new version
62451 if (newVersion && !isValidNewVersion(oldVersion, newVersion, config.looseSemver, identifier)) {
62452 throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidVersion'));
62453 }
62454
62455 // get new version by bumping old version, if requested
62456 if (!newVersion) {
62457 if (flags.major) {
62458 newVersion = semver.inc(oldVersion, 'major');
62459 } else if (flags.minor) {
62460 newVersion = semver.inc(oldVersion, 'minor');
62461 } else if (flags.patch) {
62462 newVersion = semver.inc(oldVersion, 'patch');
62463 } else if (flags.premajor) {
62464 newVersion = semver.inc(oldVersion, 'premajor', identifier);
62465 } else if (flags.preminor) {
62466 newVersion = semver.inc(oldVersion, 'preminor', identifier);
62467 } else if (flags.prepatch) {
62468 newVersion = semver.inc(oldVersion, 'prepatch', identifier);
62469 } else if (flags.prerelease) {
62470 newVersion = semver.inc(oldVersion, 'prerelease', identifier);
62471 }
62472 }
62473
62474 // wasn't passed a version arg so ask interactively
62475 while (!newVersion) {
62476 // make sure we're not running in non-interactive mode before asking for new version
62477 if (flags.nonInteractive || config.nonInteractive) {
62478 // if no version is specified, use current version in package.json
62479 newVersion = oldVersion;
62480 break;
62481 }
62482
62483 // Make sure we dont exit with an error message when pressing Ctrl-C or enter to abort
62484 try {
62485 newVersion = yield reporter.question(reporter.lang('newVersion'));
62486 if (!newVersion) {
62487 newVersion = oldVersion;
62488 }
62489 } catch (err) {
62490 newVersion = oldVersion;
62491 }
62492
62493 if (!required && !newVersion) {
62494 reporter.info(`${reporter.lang('noVersionOnPublish')}: ${oldVersion}`);
62495 return function () {
62496 return (_promise || _load_promise()).default.resolve();
62497 };
62498 }
62499
62500 if (isValidNewVersion(oldVersion, newVersion, config.looseSemver, identifier)) {
62501 break;
62502 } else {
62503 newVersion = null;
62504 reporter.error(reporter.lang('invalidSemver'));
62505 }
62506 }
62507 if (newVersion) {
62508 newVersion = semver.inc(oldVersion, newVersion, config.looseSemver, identifier) || newVersion;
62509 }
62510 invariant(newVersion, 'expected new version');
62511
62512 if (newVersion === pkg.version) {
62513 return function () {
62514 return (_promise || _load_promise()).default.resolve();
62515 };
62516 }
62517
62518 yield runLifecycle('preversion');
62519
62520 // update version
62521 reporter.info(`${reporter.lang('newVersion')}: ${newVersion}`);
62522 pkg.version = newVersion;
62523
62524 // update versions in manifests
62525 var manifests = yield config.getRootManifests();
62526 for (var _iterator = (_index || _load_index()).registryNames, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
62527 var _ref2;
62528
62529 if (_isArray) {
62530 if (_i >= _iterator.length) break;
62531 _ref2 = _iterator[_i++];
62532 } else {
62533 _i = _iterator.next();
62534 if (_i.done) break;
62535 _ref2 = _i.value;
62536 }
62537
62538 var registryName = _ref2;
62539
62540 var manifest = manifests[registryName];
62541 if (manifest.exists) {
62542 manifest.object.version = newVersion;
62543 }
62544 }
62545 yield config.saveRootManifests(manifests);
62546
62547 yield runLifecycle('version');
62548
62549 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
62550 invariant(newVersion, 'expected version');
62551
62552 // check if a new git tag should be created
62553 if (flags.gitTagVersion && config.getOption('version-git-tag')) {
62554 // add git commit and tag
62555 var isGit = false;
62556 var parts = config.cwd.split(path.sep);
62557 while (parts.length) {
62558 isGit = yield (_fs || _load_fs()).exists(path.join(parts.join(path.sep), '.git'));
62559 if (isGit) {
62560 break;
62561 } else {
62562 parts.pop();
62563 }
62564 }
62565
62566 if (isGit) {
62567 var message = (flags.message || String(config.getOption('version-git-message'))).replace(/%s/g, newVersion);
62568 var sign = Boolean(config.getOption('version-sign-git-tag'));
62569 var flag = sign ? '-sm' : '-am';
62570 var prefix = String(config.getOption('version-tag-prefix'));
62571 var _args = ['commit', '-m', message].concat(isCommitHooksDisabled() ? ['-n'] : []);
62572
62573 var gitRoot = (yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['rev-parse', '--show-toplevel'], { cwd: config.cwd })).trim();
62574
62575 // add manifest
62576 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['add', path.relative(gitRoot, pkgLoc)], { cwd: gitRoot });
62577
62578 // create git commit
62579 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(_args, { cwd: gitRoot });
62580
62581 // create git tag
62582 yield (0, (_gitSpawn || _load_gitSpawn()).spawn)(['tag', `${prefix}${newVersion}`, flag, message], { cwd: gitRoot });
62583 }
62584 }
62585
62586 yield runLifecycle('postversion');
62587 });
62588 });
62589
62590 return function setVersion(_x, _x2, _x3, _x4, _x5) {
62591 return _ref.apply(this, arguments);
62592 };
62593}();
62594
62595var run = exports.run = function () {
62596 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
62597 var commit = yield setVersion(config, reporter, flags, args, true);
62598 yield commit();
62599 });
62600
62601 return function run(_x6, _x7, _x8, _x9) {
62602 return _ref4.apply(this, arguments);
62603 };
62604}();
62605
62606exports.setFlags = setFlags;
62607exports.hasWrapper = hasWrapper;
62608
62609var _index;
62610
62611function _load_index() {
62612 return _index = __webpack_require__(61);
62613}
62614
62615var _executeLifecycleScript;
62616
62617function _load_executeLifecycleScript() {
62618 return _executeLifecycleScript = __webpack_require__(100);
62619}
62620
62621var _errors;
62622
62623function _load_errors() {
62624 return _errors = __webpack_require__(6);
62625}
62626
62627var _gitSpawn;
62628
62629function _load_gitSpawn() {
62630 return _gitSpawn = __webpack_require__(310);
62631}
62632
62633var _fs;
62634
62635function _load_fs() {
62636 return _fs = _interopRequireWildcard(__webpack_require__(8));
62637}
62638
62639var _map;
62640
62641function _load_map() {
62642 return _map = _interopRequireDefault(__webpack_require__(51));
62643}
62644
62645function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
62646
62647function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
62648
62649var invariant = __webpack_require__(15);
62650var semver = __webpack_require__(27);
62651var path = __webpack_require__(1);
62652
62653var NEW_VERSION_FLAG = '--new-version [version]';
62654function isValidNewVersion(oldVersion, newVersion, looseSemver, identifier) {
62655 return !!(semver.valid(newVersion, looseSemver) || semver.inc(oldVersion, newVersion, looseSemver, identifier));
62656}
62657
62658function setFlags(commander) {
62659 commander.description('Update the version of your package via the command line.');
62660 commander.option(NEW_VERSION_FLAG, 'new version');
62661 commander.option('--major', 'auto-increment major version number');
62662 commander.option('--minor', 'auto-increment minor version number');
62663 commander.option('--patch', 'auto-increment patch version number');
62664 commander.option('--premajor', 'auto-increment premajor version number');
62665 commander.option('--preminor', 'auto-increment preminor version number');
62666 commander.option('--prepatch', 'auto-increment prepatch version number');
62667 commander.option('--prerelease', 'auto-increment prerelease version number');
62668 commander.option('--preid [preid]', 'add a custom identifier to the prerelease');
62669 commander.option('--message [message]', 'message');
62670 commander.option('--no-git-tag-version', 'no git tag version');
62671 commander.option('--no-commit-hooks', 'bypass git hooks when committing new version');
62672}
62673
62674function hasWrapper(commander, args) {
62675 return true;
62676}
62677
62678/***/ }),
62679/* 300 */
62680/***/ (function(module, exports, __webpack_require__) {
62681
62682"use strict";
62683
62684
62685Object.defineProperty(exports, "__esModule", {
62686 value: true
62687});
62688exports.LocalTarballFetcher = undefined;
62689
62690var _getIterator2;
62691
62692function _load_getIterator() {
62693 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
62694}
62695
62696var _from;
62697
62698function _load_from() {
62699 return _from = _interopRequireDefault(__webpack_require__(53));
62700}
62701
62702var _set;
62703
62704function _load_set() {
62705 return _set = _interopRequireDefault(__webpack_require__(16));
62706}
62707
62708var _extends2;
62709
62710function _load_extends() {
62711 return _extends2 = _interopRequireDefault(__webpack_require__(24));
62712}
62713
62714var _promise;
62715
62716function _load_promise() {
62717 return _promise = _interopRequireDefault(__webpack_require__(7));
62718}
62719
62720var _keys;
62721
62722function _load_keys() {
62723 return _keys = _interopRequireDefault(__webpack_require__(14));
62724}
62725
62726var _assign;
62727
62728function _load_assign() {
62729 return _assign = _interopRequireDefault(__webpack_require__(23));
62730}
62731
62732var _asyncToGenerator2;
62733
62734function _load_asyncToGenerator() {
62735 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
62736}
62737
62738var _classCallCheck2;
62739
62740function _load_classCallCheck() {
62741 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
62742}
62743
62744var _possibleConstructorReturn2;
62745
62746function _load_possibleConstructorReturn() {
62747 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
62748}
62749
62750var _inherits2;
62751
62752function _load_inherits() {
62753 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
62754}
62755
62756var _errors;
62757
62758function _load_errors() {
62759 return _errors = __webpack_require__(6);
62760}
62761
62762var _constants;
62763
62764function _load_constants() {
62765 return _constants = _interopRequireWildcard(__webpack_require__(13));
62766}
62767
62768var _baseFetcher;
62769
62770function _load_baseFetcher() {
62771 return _baseFetcher = _interopRequireDefault(__webpack_require__(156));
62772}
62773
62774var _fs;
62775
62776function _load_fs() {
62777 return _fs = _interopRequireWildcard(__webpack_require__(8));
62778}
62779
62780var _misc;
62781
62782function _load_misc() {
62783 return _misc = __webpack_require__(28);
62784}
62785
62786var _normalizeUrl;
62787
62788function _load_normalizeUrl() {
62789 return _normalizeUrl = _interopRequireDefault(__webpack_require__(372));
62790}
62791
62792function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
62793
62794function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
62795
62796var crypto = __webpack_require__(21);
62797var path = __webpack_require__(1);
62798var tarFs = __webpack_require__(184);
62799var url = __webpack_require__(29);
62800var fs = __webpack_require__(12);
62801var stream = __webpack_require__(35);
62802var gunzip = __webpack_require__(682);
62803var invariant = __webpack_require__(15);
62804var ssri = __webpack_require__(93);
62805
62806var RE_URL_NAME_MATCH = /\/(?:(@[^/]+)(?:\/|%2f))?[^/]+\/(?:-|_attachments)\/(?:@[^/]+\/)?([^/]+)$/;
62807
62808var isHashAlgorithmSupported = function isHashAlgorithmSupported(name) {
62809 var cachedResult = isHashAlgorithmSupported.__cache[name];
62810 if (cachedResult != null) {
62811 return cachedResult;
62812 }
62813 var supported = true;
62814 try {
62815 crypto.createHash(name);
62816 } catch (error) {
62817 if (error.message !== 'Digest method not supported') {
62818 throw error;
62819 }
62820 supported = false;
62821 }
62822
62823 isHashAlgorithmSupported.__cache[name] = supported;
62824 return supported;
62825};
62826isHashAlgorithmSupported.__cache = {};
62827
62828var TarballFetcher = function (_BaseFetcher) {
62829 (0, (_inherits2 || _load_inherits()).default)(TarballFetcher, _BaseFetcher);
62830
62831 function TarballFetcher() {
62832 var _temp, _this, _ret;
62833
62834 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, TarballFetcher);
62835
62836 for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
62837 args[_key] = arguments[_key];
62838 }
62839
62840 return _ret = (_temp = (_this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseFetcher.call.apply(_BaseFetcher, [this].concat(args))), _this), _this.validateError = null, _this.validateIntegrity = null, _temp), (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(_this, _ret);
62841 }
62842
62843 TarballFetcher.prototype.setupMirrorFromCache = function () {
62844 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
62845 var tarballMirrorPath = this.getTarballMirrorPath();
62846 var tarballCachePath = this.getTarballCachePath();
62847
62848 if (tarballMirrorPath == null) {
62849 return;
62850 }
62851
62852 if (!(yield (_fs || _load_fs()).exists(tarballMirrorPath)) && (yield (_fs || _load_fs()).exists(tarballCachePath))) {
62853 // The tarball doesn't exists in the offline cache but does in the cache; we import it to the mirror
62854 yield (_fs || _load_fs()).mkdirp(path.dirname(tarballMirrorPath));
62855 yield (_fs || _load_fs()).copy(tarballCachePath, tarballMirrorPath, this.reporter);
62856 }
62857 });
62858
62859 function setupMirrorFromCache() {
62860 return _ref.apply(this, arguments);
62861 }
62862
62863 return setupMirrorFromCache;
62864 }();
62865
62866 TarballFetcher.prototype.getTarballCachePath = function getTarballCachePath() {
62867 return path.join(this.dest, (_constants || _load_constants()).TARBALL_FILENAME);
62868 };
62869
62870 TarballFetcher.prototype.getTarballMirrorPath = function getTarballMirrorPath() {
62871 var _url$parse = url.parse(this.reference),
62872 pathname = _url$parse.pathname;
62873
62874 if (pathname == null) {
62875 return null;
62876 }
62877
62878 var match = pathname.match(RE_URL_NAME_MATCH);
62879
62880 var packageFilename = void 0;
62881 if (match) {
62882 var scope = match[1],
62883 tarballBasename = match[2];
62884
62885 packageFilename = scope ? `${scope}-${tarballBasename}` : tarballBasename;
62886 } else {
62887 // fallback to base name
62888 packageFilename = path.basename(pathname);
62889 }
62890
62891 return this.config.getOfflineMirrorPath(packageFilename);
62892 };
62893
62894 TarballFetcher.prototype.createExtractor = function createExtractor(resolve, reject, tarballPath) {
62895 var _this2 = this;
62896
62897 var hashInfo = this._supportedIntegrity({ hashOnly: true });
62898 var integrityInfo = this._supportedIntegrity({ hashOnly: false });
62899
62900 var now = new Date();
62901
62902 var fs = __webpack_require__(12);
62903 var patchedFs = (0, (_assign || _load_assign()).default)({}, fs, {
62904 utimes: function utimes(path, atime, mtime, cb) {
62905 fs.stat(path, function (err, stat) {
62906 if (err) {
62907 cb(err);
62908 return;
62909 }
62910 if (stat.isDirectory()) {
62911 fs.utimes(path, atime, mtime, cb);
62912 return;
62913 }
62914 fs.open(path, 'a', function (err, fd) {
62915 if (err) {
62916 cb(err);
62917 return;
62918 }
62919 fs.futimes(fd, atime, mtime, function (err) {
62920 if (err) {
62921 fs.close(fd, function () {
62922 return cb(err);
62923 });
62924 } else {
62925 fs.close(fd, function (err) {
62926 return cb(err);
62927 });
62928 }
62929 });
62930 });
62931 });
62932 }
62933 });
62934
62935 var hashValidateStream = new ssri.integrityStream(hashInfo);
62936 var integrityValidateStream = new ssri.integrityStream(integrityInfo);
62937
62938 var untarStream = tarFs.extract(this.dest, {
62939 strip: 1,
62940 dmode: 0o755, // all dirs should be readable
62941 fmode: 0o644, // all files should be readable
62942 chown: false, // don't chown. just leave as it is
62943 map: function map(header) {
62944 header.mtime = now;
62945 if (header.linkname) {
62946 var basePath = path.posix.dirname(path.join('/', header.name));
62947 var jailPath = path.posix.join(basePath, header.linkname);
62948 header.linkname = path.posix.relative('/', jailPath);
62949 }
62950 return header;
62951 },
62952 fs: patchedFs
62953 });
62954 var extractorStream = gunzip();
62955
62956 hashValidateStream.once('error', function (err) {
62957 _this2.validateError = err;
62958 });
62959 integrityValidateStream.once('error', function (err) {
62960 _this2.validateError = err;
62961 });
62962 integrityValidateStream.once('integrity', function (sri) {
62963 _this2.validateIntegrity = sri;
62964 });
62965
62966 untarStream.on('error', function (err) {
62967 reject(new (_errors || _load_errors()).MessageError(_this2.config.reporter.lang('errorExtractingTarball', err.message, tarballPath)));
62968 });
62969
62970 extractorStream.pipe(untarStream).on('finish', function () {
62971 var error = _this2.validateError;
62972 var hexDigest = _this2.validateIntegrity ? _this2.validateIntegrity.hexDigest() : '';
62973 if (_this2.config.updateChecksums && _this2.remote.integrity && _this2.validateIntegrity && _this2.remote.integrity !== _this2.validateIntegrity.toString()) {
62974 _this2.remote.integrity = _this2.validateIntegrity.toString();
62975 } else if (_this2.validateIntegrity) {
62976 _this2.remote.cacheIntegrity = _this2.validateIntegrity.toString();
62977 }
62978
62979 if (integrityInfo.integrity && (0, (_keys || _load_keys()).default)(integrityInfo.integrity).length === 0) {
62980 return reject(new (_errors || _load_errors()).SecurityError(_this2.config.reporter.lang('fetchBadIntegrityAlgorithm', _this2.packageName, _this2.remote.reference)));
62981 }
62982
62983 if (error) {
62984 if (_this2.config.updateChecksums) {
62985 _this2.remote.integrity = error.found.toString();
62986 } else {
62987 return reject(new (_errors || _load_errors()).SecurityError(_this2.config.reporter.lang('fetchBadHashWithPath', _this2.packageName, _this2.remote.reference, error.found.toString(), error.expected.toString())));
62988 }
62989 }
62990
62991 return resolve({
62992 hash: _this2.hash || hexDigest
62993 });
62994 });
62995
62996 return { hashValidateStream, integrityValidateStream, extractorStream };
62997 };
62998
62999 TarballFetcher.prototype.getLocalPaths = function getLocalPaths(override) {
63000 var paths = [override ? path.resolve(this.config.cwd, override) : null, this.getTarballMirrorPath(), this.getTarballCachePath()];
63001 // $FlowFixMe: https://github.com/facebook/flow/issues/1414
63002 return paths.filter(function (path) {
63003 return path != null;
63004 });
63005 };
63006
63007 TarballFetcher.prototype.fetchFromLocal = function () {
63008 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (override) {
63009 var _this3 = this;
63010
63011 var tarPaths = this.getLocalPaths(override);
63012 var stream = yield (_fs || _load_fs()).readFirstAvailableStream(tarPaths);
63013
63014 return new (_promise || _load_promise()).default(function (resolve, reject) {
63015 if (!stream) {
63016 reject(new (_errors || _load_errors()).MessageError(_this3.reporter.lang('tarballNotInNetworkOrCache', _this3.reference, tarPaths)));
63017 return;
63018 }
63019 invariant(stream, 'stream should be available at this point');
63020 // $FlowFixMe - This is available https://nodejs.org/api/fs.html#fs_readstream_path
63021 var tarballPath = stream.path;
63022
63023 var _createExtractor = _this3.createExtractor(resolve, reject, tarballPath),
63024 hashValidateStream = _createExtractor.hashValidateStream,
63025 integrityValidateStream = _createExtractor.integrityValidateStream,
63026 extractorStream = _createExtractor.extractorStream;
63027
63028 stream.pipe(hashValidateStream);
63029 hashValidateStream.pipe(integrityValidateStream);
63030
63031 integrityValidateStream.pipe(extractorStream).on('error', function (err) {
63032 reject(new (_errors || _load_errors()).MessageError(_this3.config.reporter.lang('fetchErrorCorrupt', err.message, tarballPath)));
63033 });
63034 });
63035 });
63036
63037 function fetchFromLocal(_x) {
63038 return _ref2.apply(this, arguments);
63039 }
63040
63041 return fetchFromLocal;
63042 }();
63043
63044 TarballFetcher.prototype.fetchFromExternal = function () {
63045 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
63046 var _this4 = this;
63047
63048 var registry = this.config.registries[this.registry];
63049
63050 try {
63051 var headers = this.requestHeaders();
63052 return yield registry.request(this.reference, {
63053 headers: (0, (_extends2 || _load_extends()).default)({
63054 'Accept-Encoding': 'gzip'
63055 }, headers),
63056 buffer: true,
63057 process: function process(req, resolve, reject) {
63058 // should we save this to the offline cache?
63059 var tarballMirrorPath = _this4.getTarballMirrorPath();
63060 var tarballCachePath = _this4.getTarballCachePath();
63061
63062 var _createExtractor2 = _this4.createExtractor(resolve, reject),
63063 hashValidateStream = _createExtractor2.hashValidateStream,
63064 integrityValidateStream = _createExtractor2.integrityValidateStream,
63065 extractorStream = _createExtractor2.extractorStream;
63066
63067 req.pipe(hashValidateStream);
63068 hashValidateStream.pipe(integrityValidateStream);
63069
63070 if (tarballMirrorPath) {
63071 integrityValidateStream.pipe(fs.createWriteStream(tarballMirrorPath)).on('error', reject);
63072 }
63073
63074 if (tarballCachePath) {
63075 integrityValidateStream.pipe(fs.createWriteStream(tarballCachePath)).on('error', reject);
63076 }
63077
63078 integrityValidateStream.pipe(extractorStream).on('error', reject);
63079 }
63080 }, this.packageName);
63081 } catch (err) {
63082 var tarballMirrorPath = this.getTarballMirrorPath();
63083 var tarballCachePath = this.getTarballCachePath();
63084
63085 if (tarballMirrorPath && (yield (_fs || _load_fs()).exists(tarballMirrorPath))) {
63086 yield (_fs || _load_fs()).unlink(tarballMirrorPath);
63087 }
63088
63089 if (tarballCachePath && (yield (_fs || _load_fs()).exists(tarballCachePath))) {
63090 yield (_fs || _load_fs()).unlink(tarballCachePath);
63091 }
63092
63093 throw err;
63094 }
63095 });
63096
63097 function fetchFromExternal() {
63098 return _ref3.apply(this, arguments);
63099 }
63100
63101 return fetchFromExternal;
63102 }();
63103
63104 TarballFetcher.prototype.requestHeaders = function requestHeaders() {
63105 var registry = this.config.registries.yarn;
63106 var config = registry.config;
63107 var requestParts = urlParts(this.reference);
63108 return (0, (_keys || _load_keys()).default)(config).reduce(function (headers, option) {
63109 var parts = option.split(':');
63110 if (parts.length === 3 && parts[1] === '_header') {
63111 var registryParts = urlParts(parts[0]);
63112 if (requestParts.host === registryParts.host && requestParts.path.startsWith(registryParts.path)) {
63113 var headerName = parts[2];
63114 var headerValue = config[option];
63115 headers[headerName] = headerValue;
63116 }
63117 }
63118 return headers;
63119 }, {});
63120 };
63121
63122 TarballFetcher.prototype._fetch = function _fetch() {
63123 var _this5 = this;
63124
63125 var isFilePath = this.reference.startsWith('file:');
63126 this.reference = (0, (_misc || _load_misc()).removePrefix)(this.reference, 'file:');
63127 var urlParse = url.parse(this.reference);
63128
63129 // legacy support for local paths in yarn.lock entries
63130 var isRelativePath = urlParse.protocol ? urlParse.protocol.match(/^[a-z]:$/i) : urlParse.pathname ? urlParse.pathname.match(/^(?:\.{1,2})?[\\\/]/) : false;
63131
63132 if (isFilePath || isRelativePath) {
63133 return this.fetchFromLocal(this.reference);
63134 }
63135
63136 return this.fetchFromLocal().catch(function (err) {
63137 return _this5.fetchFromExternal();
63138 });
63139 };
63140
63141 TarballFetcher.prototype._findIntegrity = function _findIntegrity(_ref4) {
63142 var hashOnly = _ref4.hashOnly;
63143
63144 if (this.remote.integrity && !hashOnly) {
63145 return ssri.parse(this.remote.integrity);
63146 }
63147 if (this.hash) {
63148 return ssri.fromHex(this.hash, 'sha1');
63149 }
63150 return null;
63151 };
63152
63153 TarballFetcher.prototype._supportedIntegrity = function _supportedIntegrity(_ref5) {
63154 var hashOnly = _ref5.hashOnly;
63155
63156 var expectedIntegrity = this._findIntegrity({ hashOnly }) || {};
63157 var expectedIntegrityAlgorithms = (0, (_keys || _load_keys()).default)(expectedIntegrity);
63158 var shouldValidateIntegrity = (this.hash || this.remote.integrity) && !this.config.updateChecksums;
63159
63160 if (expectedIntegrityAlgorithms.length === 0 && (!shouldValidateIntegrity || hashOnly)) {
63161 var _algorithms = this.config.updateChecksums ? ['sha512'] : ['sha1'];
63162 // for consistency, return sha1 for packages without a remote integrity (eg. github)
63163 return { integrity: null, algorithms: _algorithms };
63164 }
63165
63166 var algorithms = new (_set || _load_set()).default(['sha512', 'sha1']);
63167 var integrity = {};
63168 for (var _iterator = expectedIntegrityAlgorithms, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
63169 var _ref6;
63170
63171 if (_isArray) {
63172 if (_i >= _iterator.length) break;
63173 _ref6 = _iterator[_i++];
63174 } else {
63175 _i = _iterator.next();
63176 if (_i.done) break;
63177 _ref6 = _i.value;
63178 }
63179
63180 var algorithm = _ref6;
63181
63182 if (isHashAlgorithmSupported(algorithm)) {
63183 algorithms.add(algorithm);
63184 integrity[algorithm] = expectedIntegrity[algorithm];
63185 }
63186 }
63187
63188 return { integrity, algorithms: (0, (_from || _load_from()).default)(algorithms) };
63189 };
63190
63191 return TarballFetcher;
63192}((_baseFetcher || _load_baseFetcher()).default);
63193
63194exports.default = TarballFetcher;
63195
63196var LocalTarballFetcher = exports.LocalTarballFetcher = function (_TarballFetcher) {
63197 (0, (_inherits2 || _load_inherits()).default)(LocalTarballFetcher, _TarballFetcher);
63198
63199 function LocalTarballFetcher() {
63200 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, LocalTarballFetcher);
63201 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _TarballFetcher.apply(this, arguments));
63202 }
63203
63204 LocalTarballFetcher.prototype._fetch = function _fetch() {
63205 return this.fetchFromLocal(this.reference);
63206 };
63207
63208 return LocalTarballFetcher;
63209}(TarballFetcher);
63210
63211function urlParts(requestUrl) {
63212 var normalizedUrl = (0, (_normalizeUrl || _load_normalizeUrl()).default)(requestUrl);
63213 var parsed = url.parse(normalizedUrl);
63214 var host = parsed.host || '';
63215 var path = parsed.path || '';
63216 return { host, path };
63217}
63218
63219/***/ }),
63220/* 301 */
63221/***/ (function(module, exports, __webpack_require__) {
63222
63223"use strict";
63224
63225
63226Object.defineProperty(exports, "__esModule", {
63227 value: true
63228});
63229
63230var _assign;
63231
63232function _load_assign() {
63233 return _assign = _interopRequireDefault(__webpack_require__(23));
63234}
63235
63236var _getIterator2;
63237
63238function _load_getIterator() {
63239 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
63240}
63241
63242var _classCallCheck2;
63243
63244function _load_classCallCheck() {
63245 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
63246}
63247
63248exports.default = function (str) {
63249 var fileLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'lockfile';
63250
63251 str = (0, (_stripBom || _load_stripBom()).default)(str);
63252 return hasMergeConflicts(str) ? parseWithConflict(str, fileLoc) : { type: 'success', object: parse(str, fileLoc) };
63253};
63254
63255var _util;
63256
63257function _load_util() {
63258 return _util = _interopRequireDefault(__webpack_require__(9));
63259}
63260
63261var _invariant;
63262
63263function _load_invariant() {
63264 return _invariant = _interopRequireDefault(__webpack_require__(15));
63265}
63266
63267var _stripBom;
63268
63269function _load_stripBom() {
63270 return _stripBom = _interopRequireDefault(__webpack_require__(429));
63271}
63272
63273var _constants;
63274
63275function _load_constants() {
63276 return _constants = __webpack_require__(13);
63277}
63278
63279var _errors;
63280
63281function _load_errors() {
63282 return _errors = __webpack_require__(6);
63283}
63284
63285var _map;
63286
63287function _load_map() {
63288 return _map = _interopRequireDefault(__webpack_require__(51));
63289}
63290
63291function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
63292
63293/* eslint quotes: 0 */
63294
63295var _require = __webpack_require__(794),
63296 safeLoad = _require.safeLoad,
63297 FAILSAFE_SCHEMA = _require.FAILSAFE_SCHEMA;
63298
63299var VERSION_REGEX = /^yarn lockfile v(\d+)$/;
63300
63301var TOKEN_TYPES = {
63302 boolean: 'BOOLEAN',
63303 string: 'STRING',
63304 identifier: 'IDENTIFIER',
63305 eof: 'EOF',
63306 colon: 'COLON',
63307 newline: 'NEWLINE',
63308 comment: 'COMMENT',
63309 indent: 'INDENT',
63310 invalid: 'INVALID',
63311 number: 'NUMBER',
63312 comma: 'COMMA'
63313};
63314
63315var VALID_PROP_VALUE_TOKENS = [TOKEN_TYPES.boolean, TOKEN_TYPES.string, TOKEN_TYPES.number];
63316
63317function isValidPropValueToken(token) {
63318 return VALID_PROP_VALUE_TOKENS.indexOf(token.type) >= 0;
63319}
63320
63321function* tokenise(input) {
63322 var lastNewline = false;
63323 var line = 1;
63324 var col = 0;
63325
63326 function buildToken(type, value) {
63327 return { line, col, type, value };
63328 }
63329
63330 while (input.length) {
63331 var chop = 0;
63332
63333 if (input[0] === '\n' || input[0] === '\r') {
63334 chop++;
63335 // If this is a \r\n line, ignore both chars but only add one new line
63336 if (input[1] === '\n') {
63337 chop++;
63338 }
63339 line++;
63340 col = 0;
63341 yield buildToken(TOKEN_TYPES.newline);
63342 } else if (input[0] === '#') {
63343 chop++;
63344
63345 var nextNewline = input.indexOf('\n', chop);
63346 if (nextNewline === -1) {
63347 nextNewline = input.length;
63348 }
63349 var val = input.substring(chop, nextNewline);
63350 chop = nextNewline;
63351 yield buildToken(TOKEN_TYPES.comment, val);
63352 } else if (input[0] === ' ') {
63353 if (lastNewline) {
63354 var indentSize = 1;
63355 for (var i = 1; input[i] === ' '; i++) {
63356 indentSize++;
63357 }
63358
63359 if (indentSize % 2) {
63360 throw new TypeError('Invalid number of spaces');
63361 } else {
63362 chop = indentSize;
63363 yield buildToken(TOKEN_TYPES.indent, indentSize / 2);
63364 }
63365 } else {
63366 chop++;
63367 }
63368 } else if (input[0] === '"') {
63369 var _i = 1;
63370 for (; _i < input.length; _i++) {
63371 if (input[_i] === '"') {
63372 var isEscaped = input[_i - 1] === '\\' && input[_i - 2] !== '\\';
63373 if (!isEscaped) {
63374 _i++;
63375 break;
63376 }
63377 }
63378 }
63379 var _val = input.substring(0, _i);
63380
63381 chop = _i;
63382
63383 try {
63384 yield buildToken(TOKEN_TYPES.string, JSON.parse(_val));
63385 } catch (err) {
63386 if (err instanceof SyntaxError) {
63387 yield buildToken(TOKEN_TYPES.invalid);
63388 } else {
63389 throw err;
63390 }
63391 }
63392 } else if (/^[0-9]/.test(input)) {
63393 var _val2 = /^[0-9]+/.exec(input)[0];
63394 chop = _val2.length;
63395
63396 yield buildToken(TOKEN_TYPES.number, +_val2);
63397 } else if (/^true/.test(input)) {
63398 yield buildToken(TOKEN_TYPES.boolean, true);
63399 chop = 4;
63400 } else if (/^false/.test(input)) {
63401 yield buildToken(TOKEN_TYPES.boolean, false);
63402 chop = 5;
63403 } else if (input[0] === ':') {
63404 yield buildToken(TOKEN_TYPES.colon);
63405 chop++;
63406 } else if (input[0] === ',') {
63407 yield buildToken(TOKEN_TYPES.comma);
63408 chop++;
63409 } else if (/^[a-zA-Z\/.-]/g.test(input)) {
63410 var _i2 = 0;
63411 for (; _i2 < input.length; _i2++) {
63412 var char = input[_i2];
63413 if (char === ':' || char === ' ' || char === '\n' || char === '\r' || char === ',') {
63414 break;
63415 }
63416 }
63417 var name = input.substring(0, _i2);
63418 chop = _i2;
63419
63420 yield buildToken(TOKEN_TYPES.string, name);
63421 } else {
63422 yield buildToken(TOKEN_TYPES.invalid);
63423 }
63424
63425 if (!chop) {
63426 // will trigger infinite recursion
63427 yield buildToken(TOKEN_TYPES.invalid);
63428 }
63429
63430 col += chop;
63431 lastNewline = input[0] === '\n' || input[0] === '\r' && input[1] === '\n';
63432 input = input.slice(chop);
63433 }
63434
63435 yield buildToken(TOKEN_TYPES.eof);
63436}
63437
63438var Parser = function () {
63439 function Parser(input) {
63440 var fileLoc = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'lockfile';
63441 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Parser);
63442
63443 this.comments = [];
63444 this.tokens = tokenise(input);
63445 this.fileLoc = fileLoc;
63446 }
63447
63448 Parser.prototype.onComment = function onComment(token) {
63449 var value = token.value;
63450 (0, (_invariant || _load_invariant()).default)(typeof value === 'string', 'expected token value to be a string');
63451
63452 var comment = value.trim();
63453
63454 var versionMatch = comment.match(VERSION_REGEX);
63455 if (versionMatch) {
63456 var version = +versionMatch[1];
63457 if (version > (_constants || _load_constants()).LOCKFILE_VERSION) {
63458 throw new (_errors || _load_errors()).MessageError(`Can't install from a lockfile of version ${version} as you're on an old yarn version that only supports ` + `versions up to ${(_constants || _load_constants()).LOCKFILE_VERSION}. Run \`$ yarn self-update\` to upgrade to the latest version.`);
63459 }
63460 }
63461
63462 this.comments.push(comment);
63463 };
63464
63465 Parser.prototype.next = function next() {
63466 var item = this.tokens.next();
63467 (0, (_invariant || _load_invariant()).default)(item, 'expected a token');
63468
63469 var done = item.done,
63470 value = item.value;
63471
63472 if (done || !value) {
63473 throw new Error('No more tokens');
63474 } else if (value.type === TOKEN_TYPES.comment) {
63475 this.onComment(value);
63476 return this.next();
63477 } else {
63478 return this.token = value;
63479 }
63480 };
63481
63482 Parser.prototype.unexpected = function unexpected() {
63483 var msg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Unexpected token';
63484
63485 throw new SyntaxError(`${msg} ${this.token.line}:${this.token.col} in ${this.fileLoc}`);
63486 };
63487
63488 Parser.prototype.expect = function expect(tokType) {
63489 if (this.token.type === tokType) {
63490 this.next();
63491 } else {
63492 this.unexpected();
63493 }
63494 };
63495
63496 Parser.prototype.eat = function eat(tokType) {
63497 if (this.token.type === tokType) {
63498 this.next();
63499 return true;
63500 } else {
63501 return false;
63502 }
63503 };
63504
63505 Parser.prototype.parse = function parse() {
63506 var indent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
63507
63508 var obj = (0, (_map || _load_map()).default)();
63509
63510 while (true) {
63511 var propToken = this.token;
63512
63513 if (propToken.type === TOKEN_TYPES.newline) {
63514 var nextToken = this.next();
63515 if (!indent) {
63516 // if we have 0 indentation then the next token doesn't matter
63517 continue;
63518 }
63519
63520 if (nextToken.type !== TOKEN_TYPES.indent) {
63521 // if we have no indentation after a newline then we've gone down a level
63522 break;
63523 }
63524
63525 if (nextToken.value === indent) {
63526 // all is good, the indent is on our level
63527 this.next();
63528 } else {
63529 // the indentation is less than our level
63530 break;
63531 }
63532 } else if (propToken.type === TOKEN_TYPES.indent) {
63533 if (propToken.value === indent) {
63534 this.next();
63535 } else {
63536 break;
63537 }
63538 } else if (propToken.type === TOKEN_TYPES.eof) {
63539 break;
63540 } else if (propToken.type === TOKEN_TYPES.string) {
63541 // property key
63542 var key = propToken.value;
63543 (0, (_invariant || _load_invariant()).default)(key, 'Expected a key');
63544
63545 var keys = [key];
63546 this.next();
63547
63548 // support multiple keys
63549 while (this.token.type === TOKEN_TYPES.comma) {
63550 this.next(); // skip comma
63551
63552 var keyToken = this.token;
63553 if (keyToken.type !== TOKEN_TYPES.string) {
63554 this.unexpected('Expected string');
63555 }
63556
63557 var _key = keyToken.value;
63558 (0, (_invariant || _load_invariant()).default)(_key, 'Expected a key');
63559 keys.push(_key);
63560 this.next();
63561 }
63562
63563 var wasColon = this.token.type === TOKEN_TYPES.colon;
63564 if (wasColon) {
63565 this.next();
63566 }
63567
63568 if (isValidPropValueToken(this.token)) {
63569 // plain value
63570 for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i3 = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
63571 var _ref;
63572
63573 if (_isArray) {
63574 if (_i3 >= _iterator.length) break;
63575 _ref = _iterator[_i3++];
63576 } else {
63577 _i3 = _iterator.next();
63578 if (_i3.done) break;
63579 _ref = _i3.value;
63580 }
63581
63582 var _key2 = _ref;
63583
63584 obj[_key2] = this.token.value;
63585 }
63586
63587 this.next();
63588 } else if (wasColon) {
63589 // parse object
63590 var val = this.parse(indent + 1);
63591
63592 for (var _iterator2 = keys, _isArray2 = Array.isArray(_iterator2), _i4 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
63593 var _ref2;
63594
63595 if (_isArray2) {
63596 if (_i4 >= _iterator2.length) break;
63597 _ref2 = _iterator2[_i4++];
63598 } else {
63599 _i4 = _iterator2.next();
63600 if (_i4.done) break;
63601 _ref2 = _i4.value;
63602 }
63603
63604 var _key3 = _ref2;
63605
63606 obj[_key3] = val;
63607 }
63608
63609 if (indent && this.token.type !== TOKEN_TYPES.indent) {
63610 break;
63611 }
63612 } else {
63613 this.unexpected('Invalid value type');
63614 }
63615 } else {
63616 this.unexpected(`Unknown token: ${(_util || _load_util()).default.inspect(propToken)}`);
63617 }
63618 }
63619
63620 return obj;
63621 };
63622
63623 return Parser;
63624}();
63625
63626var MERGE_CONFLICT_ANCESTOR = '|||||||';
63627var MERGE_CONFLICT_END = '>>>>>>>';
63628var MERGE_CONFLICT_SEP = '=======';
63629var MERGE_CONFLICT_START = '<<<<<<<';
63630
63631/**
63632 * Extract the two versions of the lockfile from a merge conflict.
63633 */
63634function extractConflictVariants(str) {
63635 var variants = [[], []];
63636 var lines = str.split(/\r?\n/g);
63637 var skip = false;
63638
63639 while (lines.length) {
63640 var _line = lines.shift();
63641 if (_line.startsWith(MERGE_CONFLICT_START)) {
63642 // get the first variant
63643 while (lines.length) {
63644 var conflictLine = lines.shift();
63645 if (conflictLine === MERGE_CONFLICT_SEP) {
63646 skip = false;
63647 break;
63648 } else if (skip || conflictLine.startsWith(MERGE_CONFLICT_ANCESTOR)) {
63649 skip = true;
63650 continue;
63651 } else {
63652 variants[0].push(conflictLine);
63653 }
63654 }
63655
63656 // get the second variant
63657 while (lines.length) {
63658 var _conflictLine = lines.shift();
63659 if (_conflictLine.startsWith(MERGE_CONFLICT_END)) {
63660 break;
63661 } else {
63662 variants[1].push(_conflictLine);
63663 }
63664 }
63665 } else {
63666 variants[0].push(_line);
63667 variants[1].push(_line);
63668 }
63669 }
63670
63671 return [variants[0].join('\n'), variants[1].join('\n')];
63672}
63673
63674/**
63675 * Check if a lockfile has merge conflicts.
63676 */
63677function hasMergeConflicts(str) {
63678 return str.indexOf(MERGE_CONFLICT_START) !== -1 && str.indexOf(MERGE_CONFLICT_SEP) !== -1 && str.indexOf(MERGE_CONFLICT_END) !== -1;
63679}
63680
63681/**
63682 * Parse the lockfile.
63683 */
63684function parse(str, fileLoc) {
63685 var parser = new Parser(str, fileLoc);
63686 parser.next();
63687
63688 if (!fileLoc.endsWith(`.yml`)) {
63689 try {
63690 return parser.parse();
63691 } catch (error1) {
63692 try {
63693 return safeLoad(str, {
63694 schema: FAILSAFE_SCHEMA
63695 });
63696 } catch (error2) {
63697 throw error1;
63698 }
63699 }
63700 } else {
63701 var result = safeLoad(str, {
63702 schema: FAILSAFE_SCHEMA
63703 });
63704 if (typeof result === 'object') {
63705 return result;
63706 } else {
63707 return {};
63708 }
63709 }
63710}
63711
63712/**
63713 * Parse and merge the two variants in a conflicted lockfile.
63714 */
63715function parseWithConflict(str, fileLoc) {
63716 var variants = extractConflictVariants(str);
63717 try {
63718 return { type: 'merge', object: (0, (_assign || _load_assign()).default)({}, parse(variants[0], fileLoc), parse(variants[1], fileLoc)) };
63719 } catch (err) {
63720 if (err instanceof SyntaxError) {
63721 return { type: 'conflict', object: {} };
63722 } else {
63723 throw err;
63724 }
63725 }
63726}
63727
63728/***/ }),
63729/* 302 */
63730/***/ (function(module, exports, __webpack_require__) {
63731
63732"use strict";
63733
63734
63735Object.defineProperty(exports, "__esModule", {
63736 value: true
63737});
63738
63739var _getIterator2;
63740
63741function _load_getIterator() {
63742 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
63743}
63744
63745var _classCallCheck2;
63746
63747function _load_classCallCheck() {
63748 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
63749}
63750
63751var _misc;
63752
63753function _load_misc() {
63754 return _misc = __webpack_require__(28);
63755}
63756
63757function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
63758
63759var PackageReference = function () {
63760 function PackageReference(request, info, remote) {
63761 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageReference);
63762
63763 this.resolver = request.resolver;
63764 this.lockfile = request.lockfile;
63765 this.requests = [];
63766 this.config = request.config;
63767 this.hint = request.hint;
63768
63769 this.isPlugnplay = false;
63770
63771 this.registry = remote.registry;
63772 this.version = info.version;
63773 this.name = info.name;
63774 this.uid = info._uid;
63775
63776 this.remote = remote;
63777
63778 this.dependencies = [];
63779
63780 this.permissions = {};
63781 this.patterns = [];
63782 this.optional = null;
63783 this.level = Infinity;
63784 this.ignore = false;
63785 this.incompatible = false;
63786 this.fresh = false;
63787 this.locations = [];
63788 this.addRequest(request);
63789 }
63790
63791 PackageReference.prototype.setFresh = function setFresh(fresh) {
63792 this.fresh = fresh;
63793 };
63794
63795 PackageReference.prototype.addLocation = function addLocation(loc) {
63796 if (this.locations.indexOf(loc) === -1) {
63797 this.locations.push(loc);
63798 }
63799 };
63800
63801 PackageReference.prototype.addRequest = function addRequest(request) {
63802 this.requests.push(request);
63803
63804 this.level = Math.min(this.level, request.parentNames.length);
63805 };
63806
63807 PackageReference.prototype.prune = function prune() {
63808 for (var _iterator = this.patterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
63809 var _ref;
63810
63811 if (_isArray) {
63812 if (_i >= _iterator.length) break;
63813 _ref = _iterator[_i++];
63814 } else {
63815 _i = _iterator.next();
63816 if (_i.done) break;
63817 _ref = _i.value;
63818 }
63819
63820 var selfPattern = _ref;
63821
63822 // remove ourselves from the resolver
63823 this.resolver.removePattern(selfPattern);
63824 }
63825 };
63826
63827 PackageReference.prototype.addDependencies = function addDependencies(deps) {
63828 this.dependencies = this.dependencies.concat(deps);
63829 };
63830
63831 PackageReference.prototype.setPermission = function setPermission(key, val) {
63832 this.permissions[key] = val;
63833 };
63834
63835 PackageReference.prototype.hasPermission = function hasPermission(key) {
63836 if (key in this.permissions) {
63837 return this.permissions[key];
63838 } else {
63839 return false;
63840 }
63841 };
63842
63843 PackageReference.prototype.addPattern = function addPattern(pattern, manifest) {
63844 this.resolver.addPattern(pattern, manifest);
63845
63846 this.patterns.push(pattern);
63847
63848 var shrunk = this.lockfile.getLocked(pattern);
63849 if (shrunk && shrunk.permissions) {
63850 for (var _iterator2 = (0, (_misc || _load_misc()).entries)(shrunk.permissions), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
63851 var _ref3;
63852
63853 if (_isArray2) {
63854 if (_i2 >= _iterator2.length) break;
63855 _ref3 = _iterator2[_i2++];
63856 } else {
63857 _i2 = _iterator2.next();
63858 if (_i2.done) break;
63859 _ref3 = _i2.value;
63860 }
63861
63862 var _ref2 = _ref3;
63863 var _key = _ref2[0];
63864 var perm = _ref2[1];
63865
63866 this.setPermission(_key, perm);
63867 }
63868 }
63869 };
63870
63871 PackageReference.prototype.addOptional = function addOptional(optional) {
63872 if (this.optional == null) {
63873 // optional is uninitialised
63874 this.optional = optional;
63875 } else if (!optional) {
63876 // otherwise, ignore all subsequent optional assignments and only accept ones making
63877 // this not optional
63878 this.optional = false;
63879 }
63880 };
63881
63882 return PackageReference;
63883}();
63884
63885exports.default = PackageReference;
63886
63887/***/ }),
63888/* 303 */
63889/***/ (function(module, exports, __webpack_require__) {
63890
63891"use strict";
63892
63893
63894Object.defineProperty(exports, "__esModule", {
63895 value: true
63896});
63897
63898var _asyncToGenerator2;
63899
63900function _load_asyncToGenerator() {
63901 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
63902}
63903
63904var _getIterator2;
63905
63906function _load_getIterator() {
63907 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
63908}
63909
63910var _promise;
63911
63912function _load_promise() {
63913 return _promise = _interopRequireDefault(__webpack_require__(7));
63914}
63915
63916var _set;
63917
63918function _load_set() {
63919 return _set = _interopRequireDefault(__webpack_require__(16));
63920}
63921
63922var _classCallCheck2;
63923
63924function _load_classCallCheck() {
63925 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
63926}
63927
63928var _index;
63929
63930function _load_index() {
63931 return _index = __webpack_require__(75);
63932}
63933
63934var _packageRequest;
63935
63936function _load_packageRequest() {
63937 return _packageRequest = _interopRequireDefault(__webpack_require__(116));
63938}
63939
63940var _normalizePattern2;
63941
63942function _load_normalizePattern() {
63943 return _normalizePattern2 = __webpack_require__(52);
63944}
63945
63946var _requestManager;
63947
63948function _load_requestManager() {
63949 return _requestManager = _interopRequireDefault(__webpack_require__(315));
63950}
63951
63952var _blockingQueue;
63953
63954function _load_blockingQueue() {
63955 return _blockingQueue = _interopRequireDefault(__webpack_require__(157));
63956}
63957
63958var _lockfile;
63959
63960function _load_lockfile() {
63961 return _lockfile = _interopRequireDefault(__webpack_require__(25));
63962}
63963
63964var _map;
63965
63966function _load_map() {
63967 return _map = _interopRequireDefault(__webpack_require__(51));
63968}
63969
63970var _workspaceLayout;
63971
63972function _load_workspaceLayout() {
63973 return _workspaceLayout = _interopRequireDefault(__webpack_require__(87));
63974}
63975
63976var _resolutionMap;
63977
63978function _load_resolutionMap() {
63979 return _resolutionMap = _interopRequireDefault(__webpack_require__(201));
63980}
63981
63982var _resolutionMap2;
63983
63984function _load_resolutionMap2() {
63985 return _resolutionMap2 = __webpack_require__(201);
63986}
63987
63988function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
63989
63990var invariant = __webpack_require__(15);
63991
63992var semver = __webpack_require__(27);
63993
63994var PackageResolver = function () {
63995 function PackageResolver(config, lockfile) {
63996 var resolutionMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_resolutionMap || _load_resolutionMap()).default(config);
63997 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageResolver);
63998
63999 this.patternsByPackage = (0, (_map || _load_map()).default)();
64000 this.fetchingPatterns = new (_set || _load_set()).default();
64001 this.fetchingQueue = new (_blockingQueue || _load_blockingQueue()).default('resolver fetching');
64002 this.patterns = (0, (_map || _load_map()).default)();
64003 this.resolutionMap = resolutionMap;
64004 this.usedRegistries = new (_set || _load_set()).default();
64005 this.flat = false;
64006
64007 this.reporter = config.reporter;
64008 this.lockfile = lockfile;
64009 this.config = config;
64010 this.delayedResolveQueue = [];
64011 }
64012
64013 // whether the dependency graph will be flattened
64014
64015
64016 // list of registries that have been used in this resolution
64017
64018
64019 // activity monitor
64020
64021
64022 // patterns we've already resolved or are in the process of resolving
64023
64024
64025 // TODO
64026
64027
64028 // manages and throttles json api http requests
64029
64030
64031 // list of patterns associated with a package
64032
64033
64034 // lockfile instance which we can use to retrieve version info
64035
64036
64037 // a map of dependency patterns to packages
64038
64039
64040 // reporter instance, abstracts out display logic
64041
64042
64043 // environment specific config methods and options
64044
64045
64046 // list of packages need to be resolved later (they found a matching version in the
64047 // resolver, but better matches can still arrive later in the resolve process)
64048
64049
64050 /**
64051 * TODO description
64052 */
64053
64054 PackageResolver.prototype.isNewPattern = function isNewPattern(pattern) {
64055 return !!this.patterns[pattern].fresh;
64056 };
64057
64058 PackageResolver.prototype.updateManifest = function updateManifest(ref, newPkg) {
64059 // inherit fields
64060 var oldPkg = this.patterns[ref.patterns[0]];
64061 newPkg._reference = ref;
64062 newPkg._remote = ref.remote;
64063 newPkg.name = oldPkg.name;
64064 newPkg.fresh = oldPkg.fresh;
64065 newPkg.prebuiltVariants = oldPkg.prebuiltVariants;
64066
64067 // update patterns
64068 for (var _iterator = ref.patterns, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
64069 var _ref;
64070
64071 if (_isArray) {
64072 if (_i >= _iterator.length) break;
64073 _ref = _iterator[_i++];
64074 } else {
64075 _i = _iterator.next();
64076 if (_i.done) break;
64077 _ref = _i.value;
64078 }
64079
64080 var pattern = _ref;
64081
64082 this.patterns[pattern] = newPkg;
64083 }
64084
64085 return (_promise || _load_promise()).default.resolve();
64086 };
64087
64088 PackageResolver.prototype.updateManifests = function updateManifests(newPkgs) {
64089 for (var _iterator2 = newPkgs, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
64090 var _ref2;
64091
64092 if (_isArray2) {
64093 if (_i2 >= _iterator2.length) break;
64094 _ref2 = _iterator2[_i2++];
64095 } else {
64096 _i2 = _iterator2.next();
64097 if (_i2.done) break;
64098 _ref2 = _i2.value;
64099 }
64100
64101 var newPkg = _ref2;
64102
64103 if (newPkg._reference) {
64104 for (var _iterator3 = newPkg._reference.patterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
64105 var _ref3;
64106
64107 if (_isArray3) {
64108 if (_i3 >= _iterator3.length) break;
64109 _ref3 = _iterator3[_i3++];
64110 } else {
64111 _i3 = _iterator3.next();
64112 if (_i3.done) break;
64113 _ref3 = _i3.value;
64114 }
64115
64116 var pattern = _ref3;
64117
64118 var oldPkg = this.patterns[pattern];
64119 newPkg.prebuiltVariants = oldPkg.prebuiltVariants;
64120
64121 this.patterns[pattern] = newPkg;
64122 }
64123 }
64124 }
64125
64126 return (_promise || _load_promise()).default.resolve();
64127 };
64128
64129 /**
64130 * Given a list of patterns, dedupe them to a list of unique patterns.
64131 */
64132
64133 PackageResolver.prototype.dedupePatterns = function dedupePatterns(patterns) {
64134 var deduped = [];
64135 var seen = new (_set || _load_set()).default();
64136
64137 for (var _iterator4 = patterns, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
64138 var _ref4;
64139
64140 if (_isArray4) {
64141 if (_i4 >= _iterator4.length) break;
64142 _ref4 = _iterator4[_i4++];
64143 } else {
64144 _i4 = _iterator4.next();
64145 if (_i4.done) break;
64146 _ref4 = _i4.value;
64147 }
64148
64149 var pattern = _ref4;
64150
64151 var _info = this.getResolvedPattern(pattern);
64152 if (seen.has(_info)) {
64153 continue;
64154 }
64155
64156 seen.add(_info);
64157 deduped.push(pattern);
64158 }
64159
64160 return deduped;
64161 };
64162
64163 /**
64164 * Get a list of all manifests by topological order.
64165 */
64166
64167 PackageResolver.prototype.getTopologicalManifests = function getTopologicalManifests(seedPatterns) {
64168 var _this = this;
64169
64170 var pkgs = new (_set || _load_set()).default();
64171 var skip = new (_set || _load_set()).default();
64172
64173 var add = function add(seedPatterns) {
64174 for (var _iterator5 = seedPatterns, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
64175 var _ref5;
64176
64177 if (_isArray5) {
64178 if (_i5 >= _iterator5.length) break;
64179 _ref5 = _iterator5[_i5++];
64180 } else {
64181 _i5 = _iterator5.next();
64182 if (_i5.done) break;
64183 _ref5 = _i5.value;
64184 }
64185
64186 var pattern = _ref5;
64187
64188 var pkg = _this.getStrictResolvedPattern(pattern);
64189 if (skip.has(pkg)) {
64190 continue;
64191 }
64192
64193 var ref = pkg._reference;
64194 invariant(ref, 'expected reference');
64195 skip.add(pkg);
64196 add(ref.dependencies);
64197 pkgs.add(pkg);
64198 }
64199 };
64200
64201 add(seedPatterns);
64202
64203 return pkgs;
64204 };
64205
64206 /**
64207 * Get a list of all manifests by level sort order.
64208 */
64209
64210 PackageResolver.prototype.getLevelOrderManifests = function getLevelOrderManifests(seedPatterns) {
64211 var _this2 = this;
64212
64213 var pkgs = new (_set || _load_set()).default();
64214 var skip = new (_set || _load_set()).default();
64215
64216 var add = function add(seedPatterns) {
64217 var refs = [];
64218
64219 for (var _iterator6 = seedPatterns, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
64220 var _ref6;
64221
64222 if (_isArray6) {
64223 if (_i6 >= _iterator6.length) break;
64224 _ref6 = _iterator6[_i6++];
64225 } else {
64226 _i6 = _iterator6.next();
64227 if (_i6.done) break;
64228 _ref6 = _i6.value;
64229 }
64230
64231 var pattern = _ref6;
64232
64233 var pkg = _this2.getStrictResolvedPattern(pattern);
64234 if (skip.has(pkg)) {
64235 continue;
64236 }
64237
64238 var ref = pkg._reference;
64239 invariant(ref, 'expected reference');
64240
64241 refs.push(ref);
64242 skip.add(pkg);
64243 pkgs.add(pkg);
64244 }
64245
64246 for (var _iterator7 = refs, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
64247 var _ref7;
64248
64249 if (_isArray7) {
64250 if (_i7 >= _iterator7.length) break;
64251 _ref7 = _iterator7[_i7++];
64252 } else {
64253 _i7 = _iterator7.next();
64254 if (_i7.done) break;
64255 _ref7 = _i7.value;
64256 }
64257
64258 var ref = _ref7;
64259
64260 add(ref.dependencies);
64261 }
64262 };
64263
64264 add(seedPatterns);
64265
64266 return pkgs;
64267 };
64268
64269 /**
64270 * Get a list of all package names in the dependency graph.
64271 */
64272
64273 PackageResolver.prototype.getAllDependencyNamesByLevelOrder = function getAllDependencyNamesByLevelOrder(seedPatterns) {
64274 var names = new (_set || _load_set()).default();
64275 for (var _iterator8 = this.getLevelOrderManifests(seedPatterns), _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
64276 var _ref9;
64277
64278 if (_isArray8) {
64279 if (_i8 >= _iterator8.length) break;
64280 _ref9 = _iterator8[_i8++];
64281 } else {
64282 _i8 = _iterator8.next();
64283 if (_i8.done) break;
64284 _ref9 = _i8.value;
64285 }
64286
64287 var _ref8 = _ref9;
64288 var _name = _ref8.name;
64289
64290 names.add(_name);
64291 }
64292 return names;
64293 };
64294
64295 /**
64296 * Retrieve all the package info stored for this package name.
64297 */
64298
64299 PackageResolver.prototype.getAllInfoForPackageName = function getAllInfoForPackageName(name) {
64300 var patterns = this.patternsByPackage[name] || [];
64301 return this.getAllInfoForPatterns(patterns);
64302 };
64303
64304 /**
64305 * Retrieve all the package info stored for a list of patterns.
64306 */
64307
64308 PackageResolver.prototype.getAllInfoForPatterns = function getAllInfoForPatterns(patterns) {
64309 var infos = [];
64310 var seen = new (_set || _load_set()).default();
64311
64312 for (var _iterator9 = patterns, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
64313 var _ref10;
64314
64315 if (_isArray9) {
64316 if (_i9 >= _iterator9.length) break;
64317 _ref10 = _iterator9[_i9++];
64318 } else {
64319 _i9 = _iterator9.next();
64320 if (_i9.done) break;
64321 _ref10 = _i9.value;
64322 }
64323
64324 var pattern = _ref10;
64325
64326 var _info2 = this.patterns[pattern];
64327 if (seen.has(_info2)) {
64328 continue;
64329 }
64330
64331 seen.add(_info2);
64332 infos.push(_info2);
64333 }
64334
64335 return infos;
64336 };
64337
64338 /**
64339 * Get a flat list of all package info.
64340 */
64341
64342 PackageResolver.prototype.getManifests = function getManifests() {
64343 var infos = [];
64344 var seen = new (_set || _load_set()).default();
64345
64346 for (var pattern in this.patterns) {
64347 var _info3 = this.patterns[pattern];
64348 if (seen.has(_info3)) {
64349 continue;
64350 }
64351
64352 infos.push(_info3);
64353 seen.add(_info3);
64354 }
64355
64356 return infos;
64357 };
64358
64359 /**
64360 * replace pattern in resolver, e.g. `name` is replaced with `name@^1.0.1`
64361 */
64362
64363
64364 PackageResolver.prototype.replacePattern = function replacePattern(pattern, newPattern) {
64365 var pkg = this.getResolvedPattern(pattern);
64366 invariant(pkg, `missing package ${pattern}`);
64367 var ref = pkg._reference;
64368 invariant(ref, 'expected package reference');
64369 ref.patterns = [newPattern];
64370 this.addPattern(newPattern, pkg);
64371 this.removePattern(pattern);
64372 };
64373
64374 /**
64375 * Make all versions of this package resolve to it.
64376 */
64377
64378 PackageResolver.prototype.collapseAllVersionsOfPackage = function collapseAllVersionsOfPackage(name, version) {
64379 var patterns = this.dedupePatterns(this.patternsByPackage[name]);
64380 return this.collapsePackageVersions(name, version, patterns);
64381 };
64382
64383 /**
64384 * Make all given patterns resolve to version.
64385 */
64386
64387
64388 PackageResolver.prototype.collapsePackageVersions = function collapsePackageVersions(name, version, patterns) {
64389 var human = `${name}@${version}`;
64390
64391 // get manifest that matches the version we're collapsing too
64392 var collapseToReference = void 0;
64393 var collapseToManifest = void 0;
64394 var collapseToPattern = void 0;
64395 for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
64396 var _ref11;
64397
64398 if (_isArray10) {
64399 if (_i10 >= _iterator10.length) break;
64400 _ref11 = _iterator10[_i10++];
64401 } else {
64402 _i10 = _iterator10.next();
64403 if (_i10.done) break;
64404 _ref11 = _i10.value;
64405 }
64406
64407 var pattern = _ref11;
64408
64409 var _manifest = this.patterns[pattern];
64410 if (_manifest.version === version) {
64411 collapseToReference = _manifest._reference;
64412 collapseToManifest = _manifest;
64413 collapseToPattern = pattern;
64414 break;
64415 }
64416 }
64417
64418 invariant(collapseToReference && collapseToManifest && collapseToPattern, `Couldn't find package manifest for ${human}`);
64419
64420 for (var _iterator11 = patterns, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
64421 var _ref12;
64422
64423 if (_isArray11) {
64424 if (_i11 >= _iterator11.length) break;
64425 _ref12 = _iterator11[_i11++];
64426 } else {
64427 _i11 = _iterator11.next();
64428 if (_i11.done) break;
64429 _ref12 = _i11.value;
64430 }
64431
64432 var _pattern = _ref12;
64433
64434 // don't touch the pattern we're collapsing to
64435 if (_pattern === collapseToPattern) {
64436 continue;
64437 }
64438
64439 // remove this pattern
64440 var ref = this.getStrictResolvedPattern(_pattern)._reference;
64441 invariant(ref, 'expected package reference');
64442 var refPatterns = ref.patterns.slice();
64443 ref.prune();
64444
64445 // add pattern to the manifest we're collapsing to
64446 for (var _iterator12 = refPatterns, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) {
64447 var _ref13;
64448
64449 if (_isArray12) {
64450 if (_i12 >= _iterator12.length) break;
64451 _ref13 = _iterator12[_i12++];
64452 } else {
64453 _i12 = _iterator12.next();
64454 if (_i12.done) break;
64455 _ref13 = _i12.value;
64456 }
64457
64458 var _pattern2 = _ref13;
64459
64460 collapseToReference.addPattern(_pattern2, collapseToManifest);
64461 }
64462 }
64463
64464 return collapseToPattern;
64465 };
64466
64467 /**
64468 * TODO description
64469 */
64470
64471 PackageResolver.prototype.addPattern = function addPattern(pattern, info) {
64472 this.patterns[pattern] = info;
64473
64474 var byName = this.patternsByPackage[info.name] = this.patternsByPackage[info.name] || [];
64475 if (byName.indexOf(pattern) === -1) {
64476 byName.push(pattern);
64477 }
64478 };
64479
64480 /**
64481 * TODO description
64482 */
64483
64484 PackageResolver.prototype.removePattern = function removePattern(pattern) {
64485 var pkg = this.patterns[pattern];
64486 if (!pkg) {
64487 return;
64488 }
64489
64490 var byName = this.patternsByPackage[pkg.name];
64491 if (!byName) {
64492 return;
64493 }
64494
64495 byName.splice(byName.indexOf(pattern), 1);
64496 delete this.patterns[pattern];
64497 };
64498
64499 /**
64500 * TODO description
64501 */
64502
64503 PackageResolver.prototype.getResolvedPattern = function getResolvedPattern(pattern) {
64504 return this.patterns[pattern];
64505 };
64506
64507 /**
64508 * TODO description
64509 */
64510
64511 PackageResolver.prototype.getStrictResolvedPattern = function getStrictResolvedPattern(pattern) {
64512 var manifest = this.getResolvedPattern(pattern);
64513 invariant(manifest, 'expected manifest');
64514 return manifest;
64515 };
64516
64517 /**
64518 * TODO description
64519 */
64520
64521 PackageResolver.prototype.getExactVersionMatch = function getExactVersionMatch(name, version, manifest) {
64522 var patterns = this.patternsByPackage[name];
64523 if (!patterns) {
64524 return null;
64525 }
64526
64527 for (var _iterator13 = patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) {
64528 var _ref14;
64529
64530 if (_isArray13) {
64531 if (_i13 >= _iterator13.length) break;
64532 _ref14 = _iterator13[_i13++];
64533 } else {
64534 _i13 = _iterator13.next();
64535 if (_i13.done) break;
64536 _ref14 = _i13.value;
64537 }
64538
64539 var pattern = _ref14;
64540
64541 var _info4 = this.getStrictResolvedPattern(pattern);
64542 if (_info4.version === version) {
64543 return _info4;
64544 }
64545 }
64546
64547 if (manifest && (0, (_index || _load_index()).getExoticResolver)(version)) {
64548 return this.exoticRangeMatch(patterns.map(this.getStrictResolvedPattern.bind(this)), manifest);
64549 }
64550
64551 return null;
64552 };
64553
64554 /**
64555 * Get the manifest of the highest known version that satisfies a package range
64556 */
64557
64558 PackageResolver.prototype.getHighestRangeVersionMatch = function getHighestRangeVersionMatch(name, range, manifest) {
64559 var _this3 = this;
64560
64561 var patterns = this.patternsByPackage[name];
64562
64563 if (!patterns) {
64564 return null;
64565 }
64566
64567 var versionNumbers = [];
64568 var resolvedPatterns = patterns.map(function (pattern) {
64569 var info = _this3.getStrictResolvedPattern(pattern);
64570 versionNumbers.push(info.version);
64571
64572 return info;
64573 });
64574
64575 var maxValidRange = semver.maxSatisfying(versionNumbers, range);
64576
64577 if (!maxValidRange) {
64578 return manifest && (0, (_index || _load_index()).getExoticResolver)(range) ? this.exoticRangeMatch(resolvedPatterns, manifest) : null;
64579 }
64580
64581 var indexOfmaxValidRange = versionNumbers.indexOf(maxValidRange);
64582 var maxValidRangeManifest = resolvedPatterns[indexOfmaxValidRange];
64583
64584 return maxValidRangeManifest;
64585 };
64586
64587 /**
64588 * Get the manifest of the package that matches an exotic range
64589 */
64590
64591 PackageResolver.prototype.exoticRangeMatch = function exoticRangeMatch(resolvedPkgs, manifest) {
64592 var remote = manifest._remote;
64593 if (!(remote && remote.reference && remote.type === 'copy')) {
64594 return null;
64595 }
64596
64597 var matchedPkg = resolvedPkgs.find(function (_ref15) {
64598 var pkgRemote = _ref15._remote;
64599 return pkgRemote && pkgRemote.reference === remote.reference && pkgRemote.type === 'copy';
64600 });
64601
64602 if (matchedPkg) {
64603 manifest._remote = matchedPkg._remote;
64604 }
64605
64606 return matchedPkg;
64607 };
64608
64609 /**
64610 * Determine if LockfileEntry is incorrect, remove it from lockfile cache and consider the pattern as new
64611 */
64612
64613
64614 PackageResolver.prototype.isLockfileEntryOutdated = function isLockfileEntryOutdated(version, range, hasVersion) {
64615 return !!(semver.validRange(range) && semver.valid(version) && !(0, (_index || _load_index()).getExoticResolver)(range) && hasVersion && !semver.satisfies(version, range));
64616 };
64617
64618 /**
64619 * TODO description
64620 */
64621
64622 PackageResolver.prototype.find = function () {
64623 var _ref16 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (initialReq) {
64624 var req = this.resolveToResolution(initialReq);
64625
64626 // we've already resolved it with a resolution
64627 if (!req) {
64628 return;
64629 }
64630
64631 var request = new (_packageRequest || _load_packageRequest()).default(req, this);
64632 var fetchKey = `${req.registry}:${req.pattern}:${String(req.optional)}`;
64633 var initialFetch = !this.fetchingPatterns.has(fetchKey);
64634 var fresh = false;
64635
64636 if (this.activity) {
64637 this.activity.tick(req.pattern);
64638 }
64639
64640 if (initialFetch) {
64641 this.fetchingPatterns.add(fetchKey);
64642
64643 var lockfileEntry = this.lockfile.getLocked(req.pattern);
64644
64645 if (lockfileEntry) {
64646 var _normalizePattern = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(req.pattern),
64647 range = _normalizePattern.range,
64648 hasVersion = _normalizePattern.hasVersion;
64649
64650 if (this.isLockfileEntryOutdated(lockfileEntry.version, range, hasVersion)) {
64651 this.reporter.warn(this.reporter.lang('incorrectLockfileEntry', req.pattern));
64652 this.removePattern(req.pattern);
64653 this.lockfile.removePattern(req.pattern);
64654 fresh = true;
64655 }
64656 } else {
64657 fresh = true;
64658 }
64659
64660 request.init();
64661 }
64662
64663 yield request.find({ fresh, frozen: this.frozen });
64664 });
64665
64666 function find(_x2) {
64667 return _ref16.apply(this, arguments);
64668 }
64669
64670 return find;
64671 }();
64672
64673 /**
64674 * TODO description
64675 */
64676
64677 PackageResolver.prototype.init = function () {
64678 var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (deps) {
64679 var _ref18 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
64680 isFlat: false,
64681 isFrozen: false,
64682 workspaceLayout: undefined
64683 },
64684 isFlat = _ref18.isFlat,
64685 isFrozen = _ref18.isFrozen,
64686 workspaceLayout = _ref18.workspaceLayout;
64687
64688 this.flat = Boolean(isFlat);
64689 this.frozen = Boolean(isFrozen);
64690 this.workspaceLayout = workspaceLayout;
64691 var activity = this.activity = this.reporter.activity();
64692
64693 for (var _iterator14 = deps, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) {
64694 var _ref19;
64695
64696 if (_isArray14) {
64697 if (_i14 >= _iterator14.length) break;
64698 _ref19 = _iterator14[_i14++];
64699 } else {
64700 _i14 = _iterator14.next();
64701 if (_i14.done) break;
64702 _ref19 = _i14.value;
64703 }
64704
64705 var _req = _ref19;
64706
64707 yield this.find(_req);
64708 }
64709
64710 // all required package versions have been discovered, so now packages that
64711 // resolved to existing versions can be resolved to their best available version
64712 this.resolvePackagesWithExistingVersions();
64713
64714 for (var _iterator15 = this.resolutionMap.delayQueue, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) {
64715 var _ref20;
64716
64717 if (_isArray15) {
64718 if (_i15 >= _iterator15.length) break;
64719 _ref20 = _iterator15[_i15++];
64720 } else {
64721 _i15 = _iterator15.next();
64722 if (_i15.done) break;
64723 _ref20 = _i15.value;
64724 }
64725
64726 var _req2 = _ref20;
64727
64728 this.resolveToResolution(_req2);
64729 }
64730
64731 if (isFlat) {
64732 for (var _iterator16 = deps, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator16);;) {
64733 var _ref21;
64734
64735 if (_isArray16) {
64736 if (_i16 >= _iterator16.length) break;
64737 _ref21 = _iterator16[_i16++];
64738 } else {
64739 _i16 = _iterator16.next();
64740 if (_i16.done) break;
64741 _ref21 = _i16.value;
64742 }
64743
64744 var dep = _ref21;
64745
64746 var _name2 = (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(dep.pattern).name;
64747 this.optimizeResolutions(_name2);
64748 }
64749 }
64750
64751 activity.end();
64752 this.activity = null;
64753 });
64754
64755 function init(_x3) {
64756 return _ref17.apply(this, arguments);
64757 }
64758
64759 return init;
64760 }();
64761
64762 // for a given package, see if a single manifest can satisfy all ranges
64763
64764
64765 PackageResolver.prototype.optimizeResolutions = function optimizeResolutions(name) {
64766 var _this4 = this;
64767
64768 var patterns = this.dedupePatterns(this.patternsByPackage[name] || []);
64769
64770 // don't optimize things that already have a lockfile entry:
64771 // https://github.com/yarnpkg/yarn/issues/79
64772 var collapsablePatterns = patterns.filter(function (pattern) {
64773 var remote = _this4.patterns[pattern]._remote;
64774 return !_this4.lockfile.getLocked(pattern) && (!remote || remote.type !== 'workspace');
64775 });
64776 if (collapsablePatterns.length < 2) {
64777 return;
64778 }
64779
64780 // reverse sort, so we'll find the maximum satisfying version first
64781 var availableVersions = this.getAllInfoForPatterns(collapsablePatterns).map(function (manifest) {
64782 return manifest.version;
64783 });
64784 availableVersions.sort(semver.rcompare);
64785
64786 var ranges = collapsablePatterns.map(function (pattern) {
64787 return (0, (_normalizePattern2 || _load_normalizePattern()).normalizePattern)(pattern).range;
64788 });
64789
64790 // find the most recent version that satisfies all patterns (if one exists), and
64791 // collapse to that version.
64792
64793 var _loop = function _loop(version) {
64794 if (ranges.every(function (range) {
64795 return semver.satisfies(version, range);
64796 })) {
64797 _this4.collapsePackageVersions(name, version, collapsablePatterns);
64798 return {
64799 v: void 0
64800 };
64801 }
64802 };
64803
64804 for (var _iterator17 = availableVersions, _isArray17 = Array.isArray(_iterator17), _i17 = 0, _iterator17 = _isArray17 ? _iterator17 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator17);;) {
64805 var _ref22;
64806
64807 if (_isArray17) {
64808 if (_i17 >= _iterator17.length) break;
64809 _ref22 = _iterator17[_i17++];
64810 } else {
64811 _i17 = _iterator17.next();
64812 if (_i17.done) break;
64813 _ref22 = _i17.value;
64814 }
64815
64816 var version = _ref22;
64817
64818 var _ret = _loop(version);
64819
64820 if (typeof _ret === "object") return _ret.v;
64821 }
64822 };
64823
64824 /**
64825 * Called by the package requester for packages that this resolver already had
64826 * a matching version for. Delay the resolve, because better matches can still be
64827 * discovered.
64828 */
64829
64830 PackageResolver.prototype.reportPackageWithExistingVersion = function reportPackageWithExistingVersion(req, info) {
64831 this.delayedResolveQueue.push({ req, info });
64832 };
64833
64834 /**
64835 * Executes the resolve to existing versions for packages after the find process,
64836 * when all versions that are going to be used have been discovered.
64837 */
64838
64839 PackageResolver.prototype.resolvePackagesWithExistingVersions = function resolvePackagesWithExistingVersions() {
64840 for (var _iterator18 = this.delayedResolveQueue, _isArray18 = Array.isArray(_iterator18), _i18 = 0, _iterator18 = _isArray18 ? _iterator18 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator18);;) {
64841 var _ref24;
64842
64843 if (_isArray18) {
64844 if (_i18 >= _iterator18.length) break;
64845 _ref24 = _iterator18[_i18++];
64846 } else {
64847 _i18 = _iterator18.next();
64848 if (_i18.done) break;
64849 _ref24 = _i18.value;
64850 }
64851
64852 var _ref23 = _ref24;
64853 var _req3 = _ref23.req,
64854 _info5 = _ref23.info;
64855
64856 _req3.resolveToExistingVersion(_info5);
64857 }
64858 };
64859
64860 PackageResolver.prototype.resolveToResolution = function resolveToResolution(req) {
64861 var parentNames = req.parentNames,
64862 pattern = req.pattern;
64863
64864
64865 if (!parentNames || this.flat) {
64866 return req;
64867 }
64868
64869 var resolution = this.resolutionMap.find(pattern, parentNames);
64870
64871 if (resolution) {
64872 var resolutionManifest = this.getResolvedPattern(resolution);
64873
64874 if (resolutionManifest) {
64875 invariant(resolutionManifest._reference, 'resolutions should have a resolved reference');
64876 resolutionManifest._reference.patterns.push(pattern);
64877 this.addPattern(pattern, resolutionManifest);
64878 var lockManifest = this.lockfile.getLocked(pattern);
64879 if ((0, (_resolutionMap2 || _load_resolutionMap2()).shouldUpdateLockfile)(lockManifest, resolutionManifest._reference)) {
64880 this.lockfile.removePattern(pattern);
64881 }
64882 } else {
64883 this.resolutionMap.addToDelayQueue(req);
64884 }
64885 return null;
64886 }
64887
64888 return req;
64889 };
64890
64891 return PackageResolver;
64892}();
64893
64894exports.default = PackageResolver;
64895
64896/***/ }),
64897/* 304 */
64898/***/ (function(module, exports, __webpack_require__) {
64899
64900"use strict";
64901
64902
64903Object.defineProperty(exports, "__esModule", {
64904 value: true
64905});
64906
64907var _classCallCheck2;
64908
64909function _load_classCallCheck() {
64910 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
64911}
64912
64913var _possibleConstructorReturn2;
64914
64915function _load_possibleConstructorReturn() {
64916 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
64917}
64918
64919var _inherits2;
64920
64921function _load_inherits() {
64922 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
64923}
64924
64925var _hostedGitResolver;
64926
64927function _load_hostedGitResolver() {
64928 return _hostedGitResolver = _interopRequireDefault(__webpack_require__(99));
64929}
64930
64931function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
64932
64933var GitHubResolver = function (_HostedGitResolver) {
64934 (0, (_inherits2 || _load_inherits()).default)(GitHubResolver, _HostedGitResolver);
64935
64936 function GitHubResolver() {
64937 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GitHubResolver);
64938 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _HostedGitResolver.apply(this, arguments));
64939 }
64940
64941 GitHubResolver.isVersion = function isVersion(pattern) {
64942 // github proto
64943 if (pattern.startsWith('github:')) {
64944 return true;
64945 }
64946
64947 // github shorthand
64948 if (/^[^:@%/\s.-][^:@%/\s]*[/][^:@\s/%]+(?:#.*)?$/.test(pattern)) {
64949 return true;
64950 }
64951
64952 return false;
64953 };
64954
64955 GitHubResolver.getTarballUrl = function getTarballUrl(parts, hash) {
64956 return `https://codeload.${this.hostname}/${parts.user}/${parts.repo}/tar.gz/${hash}`;
64957 };
64958
64959 GitHubResolver.getGitSSHUrl = function getGitSSHUrl(parts) {
64960 return `git+ssh://git@${this.hostname}/${parts.user}/${parts.repo}.git` + `${parts.hash ? '#' + decodeURIComponent(parts.hash) : ''}`;
64961 };
64962
64963 GitHubResolver.getGitHTTPBaseUrl = function getGitHTTPBaseUrl(parts) {
64964 return `https://${this.hostname}/${parts.user}/${parts.repo}`;
64965 };
64966
64967 GitHubResolver.getGitHTTPUrl = function getGitHTTPUrl(parts) {
64968 return `${GitHubResolver.getGitHTTPBaseUrl(parts)}.git`;
64969 };
64970
64971 GitHubResolver.getHTTPFileUrl = function getHTTPFileUrl(parts, filename, commit) {
64972 return `https://raw.githubusercontent.com/${parts.user}/${parts.repo}/${commit}/${filename}`;
64973 };
64974
64975 return GitHubResolver;
64976}((_hostedGitResolver || _load_hostedGitResolver()).default);
64977
64978GitHubResolver.protocol = 'github';
64979GitHubResolver.hostname = 'github.com';
64980exports.default = GitHubResolver;
64981
64982/***/ }),
64983/* 305 */
64984/***/ (function(module, exports, __webpack_require__) {
64985
64986"use strict";
64987
64988
64989Object.defineProperty(exports, "__esModule", {
64990 value: true
64991});
64992exports.LINK_PROTOCOL_PREFIX = undefined;
64993
64994var _asyncToGenerator2;
64995
64996function _load_asyncToGenerator() {
64997 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
64998}
64999
65000var _classCallCheck2;
65001
65002function _load_classCallCheck() {
65003 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
65004}
65005
65006var _possibleConstructorReturn2;
65007
65008function _load_possibleConstructorReturn() {
65009 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
65010}
65011
65012var _inherits2;
65013
65014function _load_inherits() {
65015 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
65016}
65017
65018var _exoticResolver;
65019
65020function _load_exoticResolver() {
65021 return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
65022}
65023
65024var _misc;
65025
65026function _load_misc() {
65027 return _misc = _interopRequireWildcard(__webpack_require__(28));
65028}
65029
65030var _fs;
65031
65032function _load_fs() {
65033 return _fs = _interopRequireWildcard(__webpack_require__(8));
65034}
65035
65036function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
65037
65038function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
65039
65040var path = __webpack_require__(1);
65041
65042var LINK_PROTOCOL_PREFIX = exports.LINK_PROTOCOL_PREFIX = 'link:';
65043
65044var LinkResolver = function (_ExoticResolver) {
65045 (0, (_inherits2 || _load_inherits()).default)(LinkResolver, _ExoticResolver);
65046
65047 function LinkResolver(request, fragment) {
65048 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, LinkResolver);
65049
65050 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
65051
65052 _this.loc = (_misc || _load_misc()).removePrefix(fragment, LINK_PROTOCOL_PREFIX);
65053 return _this;
65054 }
65055
65056 LinkResolver.prototype.resolve = function () {
65057 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
65058 var loc = this.loc;
65059 if (!path.isAbsolute(loc)) {
65060 loc = path.resolve(this.config.lockfileFolder, loc);
65061 }
65062
65063 var name = path.basename(loc);
65064 var registry = 'npm';
65065
65066 var manifest = !(yield (_fs || _load_fs()).exists(`${loc}/package.json`)) || loc === this.config.lockfileFolder ? { _uid: '', name, version: '0.0.0', _registry: registry } : yield this.config.readManifest(loc, this.registry);
65067
65068 manifest._remote = {
65069 type: 'link',
65070 registry,
65071 hash: null,
65072 reference: loc
65073 };
65074
65075 manifest._uid = manifest.version;
65076
65077 return manifest;
65078 });
65079
65080 function resolve() {
65081 return _ref.apply(this, arguments);
65082 }
65083
65084 return resolve;
65085 }();
65086
65087 return LinkResolver;
65088}((_exoticResolver || _load_exoticResolver()).default);
65089
65090LinkResolver.protocol = 'link';
65091exports.default = LinkResolver;
65092
65093/***/ }),
65094/* 306 */
65095/***/ (function(module, exports, __webpack_require__) {
65096
65097"use strict";
65098
65099
65100Object.defineProperty(exports, "__esModule", {
65101 value: true
65102});
65103
65104exports.default = function (from, to) {
65105 var validFrom = (_semver || _load_semver()).default.valid(from);
65106 var validTo = (_semver || _load_semver()).default.valid(to);
65107 var versionBump = 'unknown';
65108 if (validFrom && validTo) {
65109 versionBump = (0, (_semver2 || _load_semver2()).diffWithUnstable)(validFrom, validTo) || 'unchanged';
65110 }
65111 return (_constants || _load_constants()).VERSION_COLOR_SCHEME[versionBump];
65112};
65113
65114var _semver;
65115
65116function _load_semver() {
65117 return _semver = _interopRequireDefault(__webpack_require__(27));
65118}
65119
65120var _semver2;
65121
65122function _load_semver2() {
65123 return _semver2 = __webpack_require__(160);
65124}
65125
65126var _constants;
65127
65128function _load_constants() {
65129 return _constants = __webpack_require__(13);
65130}
65131
65132function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
65133
65134/***/ }),
65135/* 307 */
65136/***/ (function(module, exports, __webpack_require__) {
65137
65138"use strict";
65139
65140
65141Object.defineProperty(exports, "__esModule", {
65142 value: true
65143});
65144
65145exports.default = function (from, to, reporter) {
65146 var parts = to.split('.');
65147 var fromParts = from.split('.');
65148
65149 var splitIndex = parts.findIndex(function (part, i) {
65150 return part !== fromParts[i];
65151 });
65152 if (splitIndex === -1) {
65153 return from;
65154 }
65155
65156 var colorized = reporter.format.green(parts.slice(splitIndex).join('.'));
65157 return parts.slice(0, splitIndex).concat(colorized).join('.');
65158};
65159
65160/***/ }),
65161/* 308 */
65162/***/ (function(module, exports, __webpack_require__) {
65163
65164"use strict";
65165
65166
65167// $FlowFixMe We want this require to be dynamic
65168exports.dynamicRequire = true ? require : require; // eslint-disable-line
65169
65170/***/ }),
65171/* 309 */
65172/***/ (function(module, exports, __webpack_require__) {
65173
65174"use strict";
65175
65176
65177Object.defineProperty(exports, "__esModule", {
65178 value: true
65179});
65180
65181var _getIterator2;
65182
65183function _load_getIterator() {
65184 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
65185}
65186
65187var _set;
65188
65189function _load_set() {
65190 return _set = _interopRequireDefault(__webpack_require__(16));
65191}
65192
65193exports.sortFilter = sortFilter;
65194exports.matchesFilter = matchesFilter;
65195exports.ignoreLinesToRegex = ignoreLinesToRegex;
65196exports.filterOverridenGitignores = filterOverridenGitignores;
65197
65198var _misc;
65199
65200function _load_misc() {
65201 return _misc = __webpack_require__(28);
65202}
65203
65204function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
65205
65206var mm = __webpack_require__(109);
65207var path = __webpack_require__(1);
65208
65209var WHITESPACE_RE = /^\s+$/;
65210
65211function sortFilter(files, filters) {
65212 var keepFiles = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_set || _load_set()).default();
65213 var possibleKeepFiles = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new (_set || _load_set()).default();
65214 var ignoreFiles = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : new (_set || _load_set()).default();
65215
65216 for (var _iterator = files, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
65217 var _ref;
65218
65219 if (_isArray) {
65220 if (_i >= _iterator.length) break;
65221 _ref = _iterator[_i++];
65222 } else {
65223 _i = _iterator.next();
65224 if (_i.done) break;
65225 _ref = _i.value;
65226 }
65227
65228 var file = _ref;
65229
65230 var keep = false;
65231
65232 // always keep a file if a ! pattern matches it
65233 for (var _iterator5 = filters, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
65234 var _ref5;
65235
65236 if (_isArray5) {
65237 if (_i5 >= _iterator5.length) break;
65238 _ref5 = _iterator5[_i5++];
65239 } else {
65240 _i5 = _iterator5.next();
65241 if (_i5.done) break;
65242 _ref5 = _i5.value;
65243 }
65244
65245 var filter = _ref5;
65246
65247 if (filter.isNegation && matchesFilter(filter, file.basename, file.relative)) {
65248 keep = true;
65249 break;
65250 }
65251 }
65252
65253 //
65254 if (keep) {
65255 keepFiles.add(file.relative);
65256 continue;
65257 }
65258
65259 // otherwise don't keep it if a pattern matches it
65260 keep = true;
65261 for (var _iterator6 = filters, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
65262 var _ref6;
65263
65264 if (_isArray6) {
65265 if (_i6 >= _iterator6.length) break;
65266 _ref6 = _iterator6[_i6++];
65267 } else {
65268 _i6 = _iterator6.next();
65269 if (_i6.done) break;
65270 _ref6 = _i6.value;
65271 }
65272
65273 var _filter = _ref6;
65274
65275 if (!_filter.isNegation && matchesFilter(_filter, file.basename, file.relative)) {
65276 keep = false;
65277 break;
65278 }
65279 }
65280
65281 if (keep) {
65282 possibleKeepFiles.add(file.relative);
65283 } else {
65284 ignoreFiles.add(file.relative);
65285 }
65286 }
65287
65288 // exclude file
65289 for (var _iterator2 = possibleKeepFiles, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
65290 var _ref2;
65291
65292 if (_isArray2) {
65293 if (_i2 >= _iterator2.length) break;
65294 _ref2 = _iterator2[_i2++];
65295 } else {
65296 _i2 = _iterator2.next();
65297 if (_i2.done) break;
65298 _ref2 = _i2.value;
65299 }
65300
65301 var _file = _ref2;
65302
65303 var parts = path.dirname(_file).split(path.sep);
65304
65305 while (parts.length) {
65306 var folder = parts.join(path.sep);
65307 if (ignoreFiles.has(folder)) {
65308 ignoreFiles.add(_file);
65309 break;
65310 }
65311 parts.pop();
65312 }
65313 }
65314
65315 //
65316 for (var _iterator3 = possibleKeepFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
65317 var _ref3;
65318
65319 if (_isArray3) {
65320 if (_i3 >= _iterator3.length) break;
65321 _ref3 = _iterator3[_i3++];
65322 } else {
65323 _i3 = _iterator3.next();
65324 if (_i3.done) break;
65325 _ref3 = _i3.value;
65326 }
65327
65328 var _file2 = _ref3;
65329
65330 if (!ignoreFiles.has(_file2)) {
65331 keepFiles.add(_file2);
65332 }
65333 }
65334
65335 //
65336 for (var _iterator4 = keepFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
65337 var _ref4;
65338
65339 if (_isArray4) {
65340 if (_i4 >= _iterator4.length) break;
65341 _ref4 = _iterator4[_i4++];
65342 } else {
65343 _i4 = _iterator4.next();
65344 if (_i4.done) break;
65345 _ref4 = _i4.value;
65346 }
65347
65348 var _file3 = _ref4;
65349
65350 var parts = path.dirname(_file3).split(path.sep);
65351
65352 while (parts.length) {
65353 // deregister this folder from being ignored, any files inside
65354 // will still be marked as ignored
65355 ignoreFiles.delete(parts.join(path.sep));
65356 parts.pop();
65357 }
65358 }
65359
65360 return { ignoreFiles, keepFiles };
65361}
65362
65363function matchesFilter(filter, basename, loc) {
65364 var filterByBasename = true;
65365 if (filter.base && filter.base !== '.') {
65366 loc = path.relative(filter.base, loc);
65367 filterByBasename = false;
65368 }
65369 // the micromatch regex expects unix path separators
65370 loc = loc.replace(/\\/g, '/');
65371
65372 return filter.regex.test(loc) || filter.regex.test(`/${loc}`) || filterByBasename && filter.regex.test(basename) || mm.isMatch(loc, filter.pattern);
65373}
65374
65375function ignoreLinesToRegex(lines) {
65376 var base = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';
65377
65378 return lines
65379 // create regex
65380 .map(function (line) {
65381 // remove empty lines, comments, etc
65382 if (line === '' || line === '!' || line[0] === '#' || WHITESPACE_RE.test(line)) {
65383 return null;
65384 }
65385
65386 var pattern = line;
65387 var isNegation = false;
65388
65389 // hide the fact that it's a negation from minimatch since we'll handle this specifically
65390 // ourselves
65391 if (pattern[0] === '!') {
65392 isNegation = true;
65393 pattern = pattern.slice(1);
65394 }
65395
65396 // remove trailing slash
65397 pattern = (0, (_misc || _load_misc()).removeSuffix)(pattern, '/');
65398
65399 var regex = mm.makeRe(pattern.trim(), { dot: true, nocase: true });
65400
65401 if (regex) {
65402 return {
65403 base,
65404 isNegation,
65405 pattern,
65406 regex
65407 };
65408 } else {
65409 return null;
65410 }
65411 }).filter(Boolean);
65412}
65413
65414function filterOverridenGitignores(files) {
65415 var IGNORE_FILENAMES = ['.yarnignore', '.npmignore', '.gitignore'];
65416 var GITIGNORE_NAME = IGNORE_FILENAMES[2];
65417 return files.filter(function (file) {
65418 return IGNORE_FILENAMES.indexOf(file.basename) > -1;
65419 }).reduce(function (acc, file) {
65420 if (file.basename !== GITIGNORE_NAME) {
65421 return [].concat(acc, [file]);
65422 } else {
65423 //don't include .gitignore if .npmignore or .yarnignore are present
65424 var dir = path.dirname(file.absolute);
65425 var higherPriorityIgnoreFilePaths = [path.join(dir, IGNORE_FILENAMES[0]), path.join(dir, IGNORE_FILENAMES[1])];
65426 var hasHigherPriorityFiles = files.find(function (file) {
65427 return higherPriorityIgnoreFilePaths.indexOf(path.normalize(file.absolute)) > -1;
65428 });
65429 if (!hasHigherPriorityFiles) {
65430 return [].concat(acc, [file]);
65431 }
65432 }
65433 return acc;
65434 }, []);
65435}
65436
65437/***/ }),
65438/* 310 */
65439/***/ (function(module, exports, __webpack_require__) {
65440
65441"use strict";
65442
65443
65444Object.defineProperty(exports, "__esModule", {
65445 value: true
65446});
65447exports.spawn = undefined;
65448
65449var _extends2;
65450
65451function _load_extends() {
65452 return _extends2 = _interopRequireDefault(__webpack_require__(24));
65453}
65454
65455var _map;
65456
65457function _load_map() {
65458 return _map = _interopRequireDefault(__webpack_require__(42));
65459}
65460
65461var _path;
65462
65463function _load_path() {
65464 return _path = _interopRequireDefault(__webpack_require__(1));
65465}
65466
65467var _child;
65468
65469function _load_child() {
65470 return _child = _interopRequireWildcard(__webpack_require__(57));
65471}
65472
65473function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
65474
65475function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
65476
65477var BATCH_MODE_ARGS = new (_map || _load_map()).default([['ssh', '-oBatchMode=yes'], ['plink', '-batch']]);
65478
65479// Suppress any password prompts since we run these in the background
65480var env = (0, (_extends2 || _load_extends()).default)({
65481 GIT_ASKPASS: '',
65482 GIT_TERMINAL_PROMPT: 0
65483}, process.env);
65484
65485var sshCommand = env.GIT_SSH || 'ssh';
65486var sshExecutable = (_path || _load_path()).default.basename(sshCommand.toLowerCase(), '.exe');
65487var sshBatchArgs = BATCH_MODE_ARGS.get(sshExecutable);
65488
65489if (!env.GIT_SSH_COMMAND && sshBatchArgs) {
65490 // We have to manually specify `GIT_SSH_VARIANT`,
65491 // because it's not automatically set when using `GIT_SSH_COMMAND` instead of `GIT_SSH`
65492 // See: https://github.com/yarnpkg/yarn/issues/4729
65493 env.GIT_SSH_VARIANT = sshExecutable;
65494 env.GIT_SSH_COMMAND = `"${sshCommand}" ${sshBatchArgs}`;
65495}
65496
65497var spawn = exports.spawn = function spawn(args) {
65498 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
65499
65500 return (_child || _load_child()).spawn('git', args, (0, (_extends2 || _load_extends()).default)({}, opts, { env }));
65501};
65502
65503/***/ }),
65504/* 311 */
65505/***/ (function(module, exports, __webpack_require__) {
65506
65507"use strict";
65508
65509
65510Object.defineProperty(exports, "__esModule", {
65511 value: true
65512});
65513exports.callThroughHook = callThroughHook;
65514
65515
65516var YARN_HOOKS_KEY = 'experimentalYarnHooks';
65517
65518function callThroughHook(type, fn, context) {
65519 if (typeof global === 'undefined') {
65520 return fn();
65521 }
65522
65523 if (typeof global[YARN_HOOKS_KEY] !== 'object' || !global[YARN_HOOKS_KEY]) {
65524 return fn();
65525 }
65526
65527 var hook = global[YARN_HOOKS_KEY][type];
65528
65529 if (!hook) {
65530 return fn();
65531 }
65532
65533 return hook(fn, context);
65534}
65535
65536/***/ }),
65537/* 312 */
65538/***/ (function(module, exports, __webpack_require__) {
65539
65540"use strict";
65541
65542
65543Object.defineProperty(exports, "__esModule", {
65544 value: true
65545});
65546
65547var _promise;
65548
65549function _load_promise() {
65550 return _promise = _interopRequireDefault(__webpack_require__(7));
65551}
65552
65553var _map;
65554
65555function _load_map() {
65556 return _map = _interopRequireDefault(__webpack_require__(42));
65557}
65558
65559function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
65560
65561var lockPromises = new (_map || _load_map()).default();
65562
65563/**
65564 * Acquires a mutex lock over the given key. If the lock can't be acquired, it waits until it's available.
65565 * @param key Key to get the lock for.
65566 * @return {Promise.<Function>} A Promise that resolves when the lock is acquired, with the function that
65567 * must be called to release the lock.
65568 */
65569
65570exports.default = function (key) {
65571 var unlockNext = void 0;
65572 var willLock = new (_promise || _load_promise()).default(function (resolve) {
65573 return unlockNext = resolve;
65574 });
65575 var lockPromise = lockPromises.get(key) || (_promise || _load_promise()).default.resolve();
65576 var willUnlock = lockPromise.then(function () {
65577 return unlockNext;
65578 });
65579 lockPromises.set(key, lockPromise.then(function () {
65580 return willLock;
65581 }));
65582 return willUnlock;
65583};
65584
65585/***/ }),
65586/* 313 */
65587/***/ (function(module, exports, __webpack_require__) {
65588
65589"use strict";
65590
65591
65592Object.defineProperty(exports, "__esModule", {
65593 value: true
65594});
65595exports.default = parsePackagePath;
65596exports.isValidPackagePath = isValidPackagePath;
65597
65598
65599/**
65600 * Parse input strings like `package-1/package-2` to an array of packages
65601 */
65602function parsePackagePath(input) {
65603 return input.match(/(@[^\/]+\/)?([^/]+)/g) || [];
65604}
65605
65606var WRONG_PATTERNS = /\/$|\/{2,}|\*+$/;
65607
65608function isValidPackagePath(input) {
65609 return !WRONG_PATTERNS.test(input);
65610}
65611
65612/***/ }),
65613/* 314 */
65614/***/ (function(module, exports, __webpack_require__) {
65615
65616"use strict";
65617
65618
65619Object.defineProperty(exports, "__esModule", {
65620 value: true
65621});
65622exports.getPosixPath = getPosixPath;
65623exports.resolveWithHome = resolveWithHome;
65624
65625var _path;
65626
65627function _load_path() {
65628 return _path = __webpack_require__(1);
65629}
65630
65631var userHome = __webpack_require__(101).default;
65632
65633function getPosixPath(path) {
65634 return path.replace(/\\/g, '/');
65635}
65636
65637function resolveWithHome(path) {
65638 var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//;
65639 if (homePattern.test(path)) {
65640 return (0, (_path || _load_path()).resolve)(userHome, path.substr(2));
65641 }
65642
65643 return (0, (_path || _load_path()).resolve)(path);
65644}
65645
65646/***/ }),
65647/* 315 */
65648/***/ (function(module, exports, __webpack_require__) {
65649
65650"use strict";
65651
65652
65653Object.defineProperty(exports, "__esModule", {
65654 value: true
65655});
65656
65657var _getIterator2;
65658
65659function _load_getIterator() {
65660 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
65661}
65662
65663var _assign;
65664
65665function _load_assign() {
65666 return _assign = _interopRequireDefault(__webpack_require__(23));
65667}
65668
65669var _promise;
65670
65671function _load_promise() {
65672 return _promise = _interopRequireDefault(__webpack_require__(7));
65673}
65674
65675var _classCallCheck2;
65676
65677function _load_classCallCheck() {
65678 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
65679}
65680
65681var _fs;
65682
65683function _load_fs() {
65684 return _fs = _interopRequireDefault(__webpack_require__(12));
65685}
65686
65687var _http;
65688
65689function _load_http() {
65690 return _http = _interopRequireDefault(__webpack_require__(83));
65691}
65692
65693var _url;
65694
65695function _load_url() {
65696 return _url = _interopRequireDefault(__webpack_require__(29));
65697}
65698
65699var _dnscache;
65700
65701function _load_dnscache() {
65702 return _dnscache = _interopRequireDefault(__webpack_require__(660));
65703}
65704
65705var _invariant;
65706
65707function _load_invariant() {
65708 return _invariant = _interopRequireDefault(__webpack_require__(15));
65709}
65710
65711var _requestCaptureHar;
65712
65713function _load_requestCaptureHar() {
65714 return _requestCaptureHar = _interopRequireDefault(__webpack_require__(871));
65715}
65716
65717var _errors;
65718
65719function _load_errors() {
65720 return _errors = __webpack_require__(6);
65721}
65722
65723var _blockingQueue;
65724
65725function _load_blockingQueue() {
65726 return _blockingQueue = _interopRequireDefault(__webpack_require__(157));
65727}
65728
65729var _constants;
65730
65731function _load_constants() {
65732 return _constants = _interopRequireWildcard(__webpack_require__(13));
65733}
65734
65735var _network;
65736
65737function _load_network() {
65738 return _network = _interopRequireWildcard(__webpack_require__(276));
65739}
65740
65741var _map;
65742
65743function _load_map() {
65744 return _map = _interopRequireDefault(__webpack_require__(51));
65745}
65746
65747function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
65748
65749function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
65750
65751// Initialize DNS cache so we don't look up the same
65752// domains like registry.yarnpkg.com over and over again
65753// for each request.
65754(0, (_dnscache || _load_dnscache()).default)({
65755 enable: true,
65756 ttl: 300,
65757 cachesize: 10
65758});
65759
65760var successHosts = (0, (_map || _load_map()).default)();
65761var controlOffline = (_network || _load_network()).isOffline();
65762
65763var RequestManager = function () {
65764 function RequestManager(reporter) {
65765 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, RequestManager);
65766
65767 this.offlineNoRequests = false;
65768 this._requestCaptureHar = null;
65769 this._requestModule = null;
65770 this.offlineQueue = [];
65771 this.captureHar = false;
65772 this.httpsProxy = '';
65773 this.ca = null;
65774 this.httpProxy = '';
65775 this.strictSSL = true;
65776 this.userAgent = '';
65777 this.reporter = reporter;
65778 this.running = 0;
65779 this.queue = [];
65780 this.cache = {};
65781 this.max = (_constants || _load_constants()).NETWORK_CONCURRENCY;
65782 this.maxRetryAttempts = 5;
65783 }
65784
65785 RequestManager.prototype.setOptions = function setOptions(opts) {
65786 if (opts.userAgent != null) {
65787 this.userAgent = opts.userAgent;
65788 }
65789
65790 if (opts.offline != null) {
65791 this.offlineNoRequests = opts.offline;
65792 }
65793
65794 if (opts.captureHar != null) {
65795 this.captureHar = opts.captureHar;
65796 }
65797
65798 if (opts.httpProxy != null) {
65799 this.httpProxy = opts.httpProxy || '';
65800 }
65801
65802 if (opts.httpsProxy === '') {
65803 this.httpsProxy = opts.httpProxy || '';
65804 } else if (opts.httpsProxy === false) {
65805 this.httpsProxy = false;
65806 } else {
65807 this.httpsProxy = opts.httpsProxy || '';
65808 }
65809
65810 if (opts.strictSSL !== null && typeof opts.strictSSL !== 'undefined') {
65811 this.strictSSL = opts.strictSSL;
65812 }
65813
65814 if (opts.ca != null && opts.ca.length > 0) {
65815 this.ca = opts.ca;
65816 }
65817
65818 if (opts.networkConcurrency != null) {
65819 this.max = opts.networkConcurrency;
65820 }
65821
65822 if (opts.networkTimeout != null) {
65823 this.timeout = opts.networkTimeout;
65824 }
65825
65826 if (opts.maxRetryAttempts != null) {
65827 this.maxRetryAttempts = opts.maxRetryAttempts;
65828 }
65829
65830 if (opts.cafile != null && opts.cafile != '') {
65831 // The CA bundle file can contain one or more certificates with comments/text between each PEM block.
65832 // tls.connect wants an array of certificates without any comments/text, so we need to split the string
65833 // and strip out any text in between the certificates
65834 try {
65835 var bundle = (_fs || _load_fs()).default.readFileSync(opts.cafile).toString();
65836 var hasPemPrefix = function hasPemPrefix(block) {
65837 return block.startsWith('-----BEGIN ');
65838 };
65839 // opts.cafile overrides opts.ca, this matches with npm behavior
65840 this.ca = bundle.split(/(-----BEGIN .*\r?\n[^-]+\r?\n--.*)/).filter(hasPemPrefix);
65841 } catch (err) {
65842 this.reporter.error(`Could not open cafile: ${err.message}`);
65843 }
65844 }
65845
65846 if (opts.cert != null) {
65847 this.cert = opts.cert;
65848 }
65849
65850 if (opts.key != null) {
65851 this.key = opts.key;
65852 }
65853 };
65854
65855 /**
65856 * Lazy load `request` since it is exceptionally expensive to load and is
65857 * often not needed at all.
65858 */
65859
65860 RequestManager.prototype._getRequestModule = function _getRequestModule() {
65861 if (!this._requestModule) {
65862 var request = __webpack_require__(872);
65863 if (this.captureHar) {
65864 this._requestCaptureHar = new (_requestCaptureHar || _load_requestCaptureHar()).default(request);
65865 this._requestModule = this._requestCaptureHar.request.bind(this._requestCaptureHar);
65866 } else {
65867 this._requestModule = request;
65868 }
65869 }
65870 return this._requestModule;
65871 };
65872
65873 /**
65874 * Queue up a request.
65875 */
65876
65877 RequestManager.prototype.request = function request(params) {
65878 var _this = this;
65879
65880 if (this.offlineNoRequests) {
65881 return (_promise || _load_promise()).default.reject(new (_errors || _load_errors()).MessageError(this.reporter.lang('cantRequestOffline', params.url)));
65882 }
65883
65884 var cached = this.cache[params.url];
65885 if (cached) {
65886 return cached;
65887 }
65888
65889 params.method = params.method || 'GET';
65890 params.forever = true;
65891 params.retryAttempts = 0;
65892 params.strictSSL = this.strictSSL;
65893 params.headers = (0, (_assign || _load_assign()).default)({
65894 'User-Agent': this.userAgent
65895 }, params.headers);
65896
65897 var promise = new (_promise || _load_promise()).default(function (resolve, reject) {
65898 _this.queue.push({ params, reject, resolve });
65899 _this.shiftQueue();
65900 });
65901
65902 // we can't cache a request with a processor
65903 if (!params.process) {
65904 this.cache[params.url] = promise;
65905 }
65906
65907 return promise;
65908 };
65909
65910 /**
65911 * Clear the request cache. This is important as we cache all HTTP requests so you'll
65912 * want to do this as soon as you can.
65913 */
65914
65915 RequestManager.prototype.clearCache = function clearCache() {
65916 this.cache = {};
65917 if (this._requestCaptureHar != null) {
65918 this._requestCaptureHar.clear();
65919 }
65920 };
65921
65922 /**
65923 * Check if an error is possibly due to lost or poor network connectivity.
65924 */
65925
65926 RequestManager.prototype.isPossibleOfflineError = function isPossibleOfflineError(err) {
65927 var code = err.code,
65928 hostname = err.hostname;
65929
65930 if (!code) {
65931 return false;
65932 }
65933
65934 // network was previously online but now we're offline
65935 var possibleOfflineChange = !controlOffline && !(_network || _load_network()).isOffline();
65936 if (code === 'ENOTFOUND' && possibleOfflineChange) {
65937 // can't resolve a domain
65938 return true;
65939 }
65940
65941 // used to be able to resolve this domain! something is wrong
65942 if (code === 'ENOTFOUND' && hostname && successHosts[hostname]) {
65943 // can't resolve this domain but we've successfully resolved it before
65944 return true;
65945 }
65946
65947 // network was previously offline and we can't resolve the domain
65948 if (code === 'ENOTFOUND' && controlOffline) {
65949 return true;
65950 }
65951
65952 // connection was reset or dropped
65953 if (code === 'ECONNRESET') {
65954 return true;
65955 }
65956
65957 // TCP timeout
65958 if (code === 'ESOCKETTIMEDOUT' || code === 'ETIMEDOUT') {
65959 return true;
65960 }
65961
65962 return false;
65963 };
65964
65965 /**
65966 * Queue up request arguments to be retried. Start a network connectivity timer if there
65967 * isn't already one.
65968 */
65969
65970 RequestManager.prototype.queueForRetry = function queueForRetry(opts) {
65971 if (opts.retryReason) {
65972 var containsReason = false;
65973
65974 for (var _iterator = this.offlineQueue, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
65975 var _ref;
65976
65977 if (_isArray) {
65978 if (_i >= _iterator.length) break;
65979 _ref = _iterator[_i++];
65980 } else {
65981 _i = _iterator.next();
65982 if (_i.done) break;
65983 _ref = _i.value;
65984 }
65985
65986 var queuedOpts = _ref;
65987
65988 if (queuedOpts.retryReason === opts.retryReason) {
65989 containsReason = true;
65990 break;
65991 }
65992 }
65993
65994 if (!containsReason) {
65995 this.reporter.info(opts.retryReason);
65996 }
65997 }
65998
65999 if (!this.offlineQueue.length) {
66000 this.initOfflineRetry();
66001 }
66002
66003 this.offlineQueue.push(opts);
66004 };
66005
66006 /**
66007 * Begin timers to retry failed requests when we possibly establish network connectivity
66008 * again.
66009 */
66010
66011 RequestManager.prototype.initOfflineRetry = function initOfflineRetry() {
66012 var _this2 = this;
66013
66014 setTimeout(function () {
66015 var queue = _this2.offlineQueue;
66016 _this2.offlineQueue = [];
66017 for (var _iterator2 = queue, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
66018 var _ref2;
66019
66020 if (_isArray2) {
66021 if (_i2 >= _iterator2.length) break;
66022 _ref2 = _iterator2[_i2++];
66023 } else {
66024 _i2 = _iterator2.next();
66025 if (_i2.done) break;
66026 _ref2 = _i2.value;
66027 }
66028
66029 var opts = _ref2;
66030
66031 _this2.execute(opts);
66032 }
66033 }, 3000);
66034 };
66035
66036 /**
66037 * Execute a request.
66038 */
66039
66040 RequestManager.prototype.execute = function execute(opts) {
66041 var _this3 = this;
66042
66043 var params = opts.params;
66044 var reporter = this.reporter;
66045
66046
66047 var buildNext = function buildNext(fn) {
66048 return function (data) {
66049 fn(data);
66050 _this3.running--;
66051 _this3.shiftQueue();
66052 };
66053 };
66054
66055 var resolve = buildNext(opts.resolve);
66056
66057 var rejectNext = buildNext(opts.reject);
66058 var reject = function reject(err) {
66059 err.message = `${params.url}: ${err.message}`;
66060 rejectNext(err);
66061 };
66062
66063 var rejectWithoutUrl = function rejectWithoutUrl(err) {
66064 err.message = err.message;
66065 rejectNext(err);
66066 };
66067
66068 var queueForRetry = function queueForRetry(reason) {
66069 var attempts = params.retryAttempts || 0;
66070 if (attempts >= _this3.maxRetryAttempts - 1) {
66071 return false;
66072 }
66073 if (opts.params.method && opts.params.method.toUpperCase() !== 'GET') {
66074 return false;
66075 }
66076 params.retryAttempts = attempts + 1;
66077 if (typeof params.cleanup === 'function') {
66078 params.cleanup();
66079 }
66080 opts.retryReason = reason;
66081 _this3.queueForRetry(opts);
66082 return true;
66083 };
66084
66085 var calledOnError = false;
66086 var onError = function onError(err) {
66087 if (calledOnError) {
66088 return;
66089 }
66090 calledOnError = true;
66091
66092 if (_this3.isPossibleOfflineError(err)) {
66093 if (!queueForRetry(_this3.reporter.lang('offlineRetrying'))) {
66094 reject(err);
66095 }
66096 } else {
66097 reject(err);
66098 }
66099 };
66100
66101 if (!params.process) {
66102 var parts = (_url || _load_url()).default.parse(params.url);
66103
66104 params.callback = function (err, res, body) {
66105 if (err) {
66106 onError(err);
66107 return;
66108 }
66109
66110 successHosts[parts.hostname] = true;
66111
66112 _this3.reporter.verbose(_this3.reporter.lang('verboseRequestFinish', params.url, res.statusCode));
66113
66114 if (res.statusCode === 408 || res.statusCode >= 500) {
66115 var description = `${res.statusCode} ${(_http || _load_http()).default.STATUS_CODES[res.statusCode]}`;
66116 if (!queueForRetry(_this3.reporter.lang('internalServerErrorRetrying', description))) {
66117 throw new (_errors || _load_errors()).ResponseError(_this3.reporter.lang('requestFailed', description), res.statusCode);
66118 } else {
66119 return;
66120 }
66121 }
66122
66123 if (res.statusCode === 401 && res.caseless && res.caseless.get('server') === 'GitHub.com') {
66124 var message = `${res.body.message}. If using GITHUB_TOKEN in your env, check that it is valid.`;
66125 rejectWithoutUrl(new Error(_this3.reporter.lang('unauthorizedResponse', res.caseless.get('server'), message)));
66126 }
66127
66128 if (res.statusCode === 401 && res.headers['www-authenticate']) {
66129 var authMethods = res.headers['www-authenticate'].split(/,\s*/).map(function (s) {
66130 return s.toLowerCase();
66131 });
66132
66133 if (authMethods.indexOf('otp') !== -1) {
66134 reject(new (_errors || _load_errors()).OneTimePasswordError());
66135 return;
66136 }
66137 }
66138
66139 if (body && typeof body.error === 'string') {
66140 reject(new Error(body.error));
66141 return;
66142 }
66143
66144 if ([400, 401, 404].concat(params.rejectStatusCode || []).indexOf(res.statusCode) !== -1) {
66145 // So this is actually a rejection ... the hosted git resolver uses this to know whether http is supported
66146 resolve(false);
66147 } else if (res.statusCode >= 400) {
66148 var errMsg = body && body.message || reporter.lang('requestError', params.url, res.statusCode);
66149 reject(new Error(errMsg));
66150 } else {
66151 resolve(body);
66152 }
66153 };
66154 }
66155
66156 if (params.buffer) {
66157 params.encoding = null;
66158 }
66159
66160 var proxy = this.httpProxy;
66161 if (params.url.startsWith('https:')) {
66162 proxy = this.httpsProxy;
66163 }
66164
66165 if (proxy) {
66166 // if no proxy is set, do not pass a proxy down to request.
66167 // the request library will internally check the HTTP_PROXY and HTTPS_PROXY env vars.
66168 params.proxy = String(proxy);
66169 } else if (proxy === false) {
66170 // passing empty string prevents the underlying library from falling back to the env vars.
66171 // an explicit false in the yarn config should override the env var. See #4546.
66172 params.proxy = '';
66173 }
66174
66175 if (this.ca != null) {
66176 params.ca = this.ca;
66177 }
66178
66179 if (this.cert != null) {
66180 params.cert = this.cert;
66181 }
66182
66183 if (this.key != null) {
66184 params.key = this.key;
66185 }
66186
66187 if (this.timeout != null) {
66188 params.timeout = this.timeout;
66189 }
66190
66191 var request = this._getRequestModule();
66192 var req = request(params);
66193 this.reporter.verbose(this.reporter.lang('verboseRequestStart', params.method, params.url));
66194
66195 req.on('error', onError);
66196
66197 var queue = params.queue;
66198 if (queue) {
66199 req.on('data', queue.stillActive.bind(queue));
66200 }
66201
66202 var process = params.process;
66203 if (process) {
66204 req.on('response', function (res) {
66205 if (res.statusCode >= 200 && res.statusCode < 300) {
66206 return;
66207 }
66208
66209 var description = `${res.statusCode} ${(_http || _load_http()).default.STATUS_CODES[res.statusCode]}`;
66210 reject(new (_errors || _load_errors()).ResponseError(_this3.reporter.lang('requestFailed', description), res.statusCode));
66211
66212 req.abort();
66213 });
66214 process(req, resolve, reject);
66215 }
66216 };
66217
66218 /**
66219 * Remove an item from the queue. Create it's request options and execute it.
66220 */
66221
66222 RequestManager.prototype.shiftQueue = function shiftQueue() {
66223 if (this.running >= this.max || !this.queue.length) {
66224 return;
66225 }
66226
66227 var opts = this.queue.shift();
66228
66229 this.running++;
66230 this.execute(opts);
66231 };
66232
66233 RequestManager.prototype.saveHar = function saveHar(filename) {
66234 if (!this.captureHar) {
66235 throw new Error(this.reporter.lang('requestManagerNotSetupHAR'));
66236 }
66237 // No request may have occurred at all.
66238 this._getRequestModule();
66239 (0, (_invariant || _load_invariant()).default)(this._requestCaptureHar != null, 'request-capture-har not setup');
66240 this._requestCaptureHar.saveHar(filename);
66241 };
66242
66243 return RequestManager;
66244}();
66245
66246exports.default = RequestManager;
66247
66248/***/ }),
66249/* 316 */
66250/***/ (function(module, exports, __webpack_require__) {
66251
66252"use strict";
66253
66254
66255exports.__esModule = true;
66256
66257var _iterator = __webpack_require__(554);
66258
66259var _iterator2 = _interopRequireDefault(_iterator);
66260
66261var _symbol = __webpack_require__(553);
66262
66263var _symbol2 = _interopRequireDefault(_symbol);
66264
66265var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
66266
66267function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
66268
66269exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
66270 return typeof obj === "undefined" ? "undefined" : _typeof(obj);
66271} : function (obj) {
66272 return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
66273};
66274
66275/***/ }),
66276/* 317 */
66277/***/ (function(module, exports, __webpack_require__) {
66278
66279"use strict";
66280
66281
66282var crypto_hash_sha512 = __webpack_require__(71).lowlevel.crypto_hash;
66283
66284/*
66285 * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a
66286 * result, it retains the original copyright and license. The two files are
66287 * under slightly different (but compatible) licenses, and are here combined in
66288 * one file.
66289 *
66290 * Credit for the actual porting work goes to:
66291 * Devi Mandiri <me@devi.web.id>
66292 */
66293
66294/*
66295 * The Blowfish portions are under the following license:
66296 *
66297 * Blowfish block cipher for OpenBSD
66298 * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
66299 * All rights reserved.
66300 *
66301 * Implementation advice by David Mazieres <dm@lcs.mit.edu>.
66302 *
66303 * Redistribution and use in source and binary forms, with or without
66304 * modification, are permitted provided that the following conditions
66305 * are met:
66306 * 1. Redistributions of source code must retain the above copyright
66307 * notice, this list of conditions and the following disclaimer.
66308 * 2. Redistributions in binary form must reproduce the above copyright
66309 * notice, this list of conditions and the following disclaimer in the
66310 * documentation and/or other materials provided with the distribution.
66311 * 3. The name of the author may not be used to endorse or promote products
66312 * derived from this software without specific prior written permission.
66313 *
66314 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
66315 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
66316 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
66317 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
66318 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
66319 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
66320 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
66321 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
66322 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
66323 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
66324 */
66325
66326/*
66327 * The bcrypt_pbkdf portions are under the following license:
66328 *
66329 * Copyright (c) 2013 Ted Unangst <tedu@openbsd.org>
66330 *
66331 * Permission to use, copy, modify, and distribute this software for any
66332 * purpose with or without fee is hereby granted, provided that the above
66333 * copyright notice and this permission notice appear in all copies.
66334 *
66335 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
66336 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
66337 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
66338 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
66339 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
66340 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
66341 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
66342 */
66343
66344/*
66345 * Performance improvements (Javascript-specific):
66346 *
66347 * Copyright 2016, Joyent Inc
66348 * Author: Alex Wilson <alex.wilson@joyent.com>
66349 *
66350 * Permission to use, copy, modify, and distribute this software for any
66351 * purpose with or without fee is hereby granted, provided that the above
66352 * copyright notice and this permission notice appear in all copies.
66353 *
66354 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
66355 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
66356 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
66357 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
66358 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
66359 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
66360 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
66361 */
66362
66363// Ported from OpenBSD bcrypt_pbkdf.c v1.9
66364
66365var BLF_J = 0;
66366
66367var Blowfish = function() {
66368 this.S = [
66369 new Uint32Array([
66370 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7,
66371 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99,
66372 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
66373 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e,
66374 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee,
66375 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
66376 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef,
66377 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e,
66378 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
66379 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440,
66380 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce,
66381 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
66382 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e,
66383 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677,
66384 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
66385 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032,
66386 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88,
66387 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
66388 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e,
66389 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0,
66390 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
66391 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98,
66392 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88,
66393 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
66394 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6,
66395 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d,
66396 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
66397 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7,
66398 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba,
66399 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
66400 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f,
66401 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09,
66402 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
66403 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb,
66404 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279,
66405 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
66406 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab,
66407 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82,
66408 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
66409 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573,
66410 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0,
66411 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
66412 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790,
66413 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8,
66414 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
66415 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0,
66416 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7,
66417 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
66418 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad,
66419 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1,
66420 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
66421 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9,
66422 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477,
66423 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
66424 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49,
66425 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af,
66426 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
66427 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5,
66428 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41,
66429 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
66430 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400,
66431 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915,
66432 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
66433 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a]),
66434 new Uint32Array([
66435 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623,
66436 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266,
66437 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
66438 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e,
66439 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6,
66440 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
66441 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e,
66442 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1,
66443 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
66444 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8,
66445 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff,
66446 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
66447 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701,
66448 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7,
66449 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
66450 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331,
66451 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf,
66452 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
66453 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e,
66454 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87,
66455 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
66456 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2,
66457 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16,
66458 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
66459 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b,
66460 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509,
66461 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
66462 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3,
66463 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f,
66464 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
66465 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4,
66466 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960,
66467 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
66468 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28,
66469 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802,
66470 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
66471 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510,
66472 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf,
66473 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
66474 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e,
66475 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50,
66476 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
66477 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8,
66478 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281,
66479 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
66480 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696,
66481 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128,
66482 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
66483 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0,
66484 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0,
66485 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
66486 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250,
66487 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3,
66488 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
66489 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00,
66490 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061,
66491 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
66492 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e,
66493 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735,
66494 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
66495 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9,
66496 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340,
66497 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
66498 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7]),
66499 new Uint32Array([
66500 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934,
66501 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068,
66502 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
66503 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840,
66504 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45,
66505 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
66506 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a,
66507 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb,
66508 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
66509 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6,
66510 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42,
66511 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
66512 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2,
66513 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb,
66514 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
66515 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b,
66516 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33,
66517 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
66518 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3,
66519 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc,
66520 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
66521 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564,
66522 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b,
66523 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
66524 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922,
66525 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728,
66526 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
66527 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e,
66528 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37,
66529 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
66530 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804,
66531 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b,
66532 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
66533 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb,
66534 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d,
66535 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
66536 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350,
66537 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9,
66538 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
66539 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe,
66540 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d,
66541 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
66542 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f,
66543 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61,
66544 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
66545 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9,
66546 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2,
66547 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
66548 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e,
66549 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633,
66550 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
66551 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169,
66552 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52,
66553 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
66554 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5,
66555 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62,
66556 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
66557 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76,
66558 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24,
66559 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
66560 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4,
66561 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c,
66562 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
66563 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0]),
66564 new Uint32Array([
66565 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b,
66566 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe,
66567 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
66568 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4,
66569 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8,
66570 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
66571 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304,
66572 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22,
66573 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
66574 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6,
66575 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9,
66576 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
66577 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593,
66578 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51,
66579 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
66580 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c,
66581 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b,
66582 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
66583 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c,
66584 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd,
66585 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
66586 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319,
66587 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb,
66588 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
66589 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991,
66590 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32,
66591 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
66592 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166,
66593 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae,
66594 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
66595 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5,
66596 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47,
66597 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
66598 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d,
66599 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84,
66600 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
66601 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8,
66602 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd,
66603 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
66604 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7,
66605 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38,
66606 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
66607 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c,
66608 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525,
66609 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
66610 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442,
66611 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964,
66612 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
66613 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8,
66614 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d,
66615 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
66616 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299,
66617 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02,
66618 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
66619 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614,
66620 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a,
66621 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
66622 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b,
66623 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0,
66624 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
66625 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e,
66626 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9,
66627 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
66628 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6])
66629 ];
66630 this.P = new Uint32Array([
66631 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344,
66632 0xa4093822, 0x299f31d0, 0x082efa98, 0xec4e6c89,
66633 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
66634 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917,
66635 0x9216d5d9, 0x8979fb1b]);
66636};
66637
66638function F(S, x8, i) {
66639 return (((S[0][x8[i+3]] +
66640 S[1][x8[i+2]]) ^
66641 S[2][x8[i+1]]) +
66642 S[3][x8[i]]);
66643};
66644
66645Blowfish.prototype.encipher = function(x, x8) {
66646 if (x8 === undefined) {
66647 x8 = new Uint8Array(x.buffer);
66648 if (x.byteOffset !== 0)
66649 x8 = x8.subarray(x.byteOffset);
66650 }
66651 x[0] ^= this.P[0];
66652 for (var i = 1; i < 16; i += 2) {
66653 x[1] ^= F(this.S, x8, 0) ^ this.P[i];
66654 x[0] ^= F(this.S, x8, 4) ^ this.P[i+1];
66655 }
66656 var t = x[0];
66657 x[0] = x[1] ^ this.P[17];
66658 x[1] = t;
66659};
66660
66661Blowfish.prototype.decipher = function(x) {
66662 var x8 = new Uint8Array(x.buffer);
66663 if (x.byteOffset !== 0)
66664 x8 = x8.subarray(x.byteOffset);
66665 x[0] ^= this.P[17];
66666 for (var i = 16; i > 0; i -= 2) {
66667 x[1] ^= F(this.S, x8, 0) ^ this.P[i];
66668 x[0] ^= F(this.S, x8, 4) ^ this.P[i-1];
66669 }
66670 var t = x[0];
66671 x[0] = x[1] ^ this.P[0];
66672 x[1] = t;
66673};
66674
66675function stream2word(data, databytes){
66676 var i, temp = 0;
66677 for (i = 0; i < 4; i++, BLF_J++) {
66678 if (BLF_J >= databytes) BLF_J = 0;
66679 temp = (temp << 8) | data[BLF_J];
66680 }
66681 return temp;
66682};
66683
66684Blowfish.prototype.expand0state = function(key, keybytes) {
66685 var d = new Uint32Array(2), i, k;
66686 var d8 = new Uint8Array(d.buffer);
66687
66688 for (i = 0, BLF_J = 0; i < 18; i++) {
66689 this.P[i] ^= stream2word(key, keybytes);
66690 }
66691 BLF_J = 0;
66692
66693 for (i = 0; i < 18; i += 2) {
66694 this.encipher(d, d8);
66695 this.P[i] = d[0];
66696 this.P[i+1] = d[1];
66697 }
66698
66699 for (i = 0; i < 4; i++) {
66700 for (k = 0; k < 256; k += 2) {
66701 this.encipher(d, d8);
66702 this.S[i][k] = d[0];
66703 this.S[i][k+1] = d[1];
66704 }
66705 }
66706};
66707
66708Blowfish.prototype.expandstate = function(data, databytes, key, keybytes) {
66709 var d = new Uint32Array(2), i, k;
66710
66711 for (i = 0, BLF_J = 0; i < 18; i++) {
66712 this.P[i] ^= stream2word(key, keybytes);
66713 }
66714
66715 for (i = 0, BLF_J = 0; i < 18; i += 2) {
66716 d[0] ^= stream2word(data, databytes);
66717 d[1] ^= stream2word(data, databytes);
66718 this.encipher(d);
66719 this.P[i] = d[0];
66720 this.P[i+1] = d[1];
66721 }
66722
66723 for (i = 0; i < 4; i++) {
66724 for (k = 0; k < 256; k += 2) {
66725 d[0] ^= stream2word(data, databytes);
66726 d[1] ^= stream2word(data, databytes);
66727 this.encipher(d);
66728 this.S[i][k] = d[0];
66729 this.S[i][k+1] = d[1];
66730 }
66731 }
66732 BLF_J = 0;
66733};
66734
66735Blowfish.prototype.enc = function(data, blocks) {
66736 for (var i = 0; i < blocks; i++) {
66737 this.encipher(data.subarray(i*2));
66738 }
66739};
66740
66741Blowfish.prototype.dec = function(data, blocks) {
66742 for (var i = 0; i < blocks; i++) {
66743 this.decipher(data.subarray(i*2));
66744 }
66745};
66746
66747var BCRYPT_BLOCKS = 8,
66748 BCRYPT_HASHSIZE = 32;
66749
66750function bcrypt_hash(sha2pass, sha2salt, out) {
66751 var state = new Blowfish(),
66752 cdata = new Uint32Array(BCRYPT_BLOCKS), i,
66753 ciphertext = new Uint8Array([79,120,121,99,104,114,111,109,97,116,105,
66754 99,66,108,111,119,102,105,115,104,83,119,97,116,68,121,110,97,109,
66755 105,116,101]); //"OxychromaticBlowfishSwatDynamite"
66756
66757 state.expandstate(sha2salt, 64, sha2pass, 64);
66758 for (i = 0; i < 64; i++) {
66759 state.expand0state(sha2salt, 64);
66760 state.expand0state(sha2pass, 64);
66761 }
66762
66763 for (i = 0; i < BCRYPT_BLOCKS; i++)
66764 cdata[i] = stream2word(ciphertext, ciphertext.byteLength);
66765 for (i = 0; i < 64; i++)
66766 state.enc(cdata, cdata.byteLength / 8);
66767
66768 for (i = 0; i < BCRYPT_BLOCKS; i++) {
66769 out[4*i+3] = cdata[i] >>> 24;
66770 out[4*i+2] = cdata[i] >>> 16;
66771 out[4*i+1] = cdata[i] >>> 8;
66772 out[4*i+0] = cdata[i];
66773 }
66774};
66775
66776function bcrypt_pbkdf(pass, passlen, salt, saltlen, key, keylen, rounds) {
66777 var sha2pass = new Uint8Array(64),
66778 sha2salt = new Uint8Array(64),
66779 out = new Uint8Array(BCRYPT_HASHSIZE),
66780 tmpout = new Uint8Array(BCRYPT_HASHSIZE),
66781 countsalt = new Uint8Array(saltlen+4),
66782 i, j, amt, stride, dest, count,
66783 origkeylen = keylen;
66784
66785 if (rounds < 1)
66786 return -1;
66787 if (passlen === 0 || saltlen === 0 || keylen === 0 ||
66788 keylen > (out.byteLength * out.byteLength) || saltlen > (1<<20))
66789 return -1;
66790
66791 stride = Math.floor((keylen + out.byteLength - 1) / out.byteLength);
66792 amt = Math.floor((keylen + stride - 1) / stride);
66793
66794 for (i = 0; i < saltlen; i++)
66795 countsalt[i] = salt[i];
66796
66797 crypto_hash_sha512(sha2pass, pass, passlen);
66798
66799 for (count = 1; keylen > 0; count++) {
66800 countsalt[saltlen+0] = count >>> 24;
66801 countsalt[saltlen+1] = count >>> 16;
66802 countsalt[saltlen+2] = count >>> 8;
66803 countsalt[saltlen+3] = count;
66804
66805 crypto_hash_sha512(sha2salt, countsalt, saltlen + 4);
66806 bcrypt_hash(sha2pass, sha2salt, tmpout);
66807 for (i = out.byteLength; i--;)
66808 out[i] = tmpout[i];
66809
66810 for (i = 1; i < rounds; i++) {
66811 crypto_hash_sha512(sha2salt, tmpout, tmpout.byteLength);
66812 bcrypt_hash(sha2pass, sha2salt, tmpout);
66813 for (j = 0; j < out.byteLength; j++)
66814 out[j] ^= tmpout[j];
66815 }
66816
66817 amt = Math.min(amt, keylen);
66818 for (i = 0; i < amt; i++) {
66819 dest = i * stride + (count - 1);
66820 if (dest >= origkeylen)
66821 break;
66822 key[dest] = out[i];
66823 }
66824 keylen -= i;
66825 }
66826
66827 return 0;
66828};
66829
66830module.exports = {
66831 BLOCKS: BCRYPT_BLOCKS,
66832 HASHSIZE: BCRYPT_HASHSIZE,
66833 hash: bcrypt_hash,
66834 pbkdf: bcrypt_pbkdf
66835};
66836
66837
66838/***/ }),
66839/* 318 */
66840/***/ (function(module, exports, __webpack_require__) {
66841
66842var bufferFill = __webpack_require__(559)
66843var allocUnsafe = __webpack_require__(558)
66844
66845module.exports = function alloc (size, fill, encoding) {
66846 if (typeof size !== 'number') {
66847 throw new TypeError('"size" argument must be a number')
66848 }
66849
66850 if (size < 0) {
66851 throw new RangeError('"size" argument must not be negative')
66852 }
66853
66854 if (Buffer.alloc) {
66855 return Buffer.alloc(size, fill, encoding)
66856 }
66857
66858 var buffer = allocUnsafe(size)
66859
66860 if (size === 0) {
66861 return buffer
66862 }
66863
66864 if (fill === undefined) {
66865 return bufferFill(buffer, 0)
66866 }
66867
66868 if (typeof encoding !== 'string') {
66869 encoding = undefined
66870 }
66871
66872 return bufferFill(buffer, fill, encoding)
66873}
66874
66875
66876/***/ }),
66877/* 319 */
66878/***/ (function(module, exports, __webpack_require__) {
66879
66880"use strict";
66881
66882const restoreCursor = __webpack_require__(890);
66883
66884let hidden = false;
66885
66886exports.show = stream => {
66887 const s = stream || process.stderr;
66888
66889 if (!s.isTTY) {
66890 return;
66891 }
66892
66893 hidden = false;
66894 s.write('\u001b[?25h');
66895};
66896
66897exports.hide = stream => {
66898 const s = stream || process.stderr;
66899
66900 if (!s.isTTY) {
66901 return;
66902 }
66903
66904 restoreCursor();
66905 hidden = true;
66906 s.write('\u001b[?25l');
66907};
66908
66909exports.toggle = (force, stream) => {
66910 if (force !== undefined) {
66911 hidden = force;
66912 }
66913
66914 if (hidden) {
66915 exports.show(stream);
66916 } else {
66917 exports.hide(stream);
66918 }
66919};
66920
66921
66922/***/ }),
66923/* 320 */
66924/***/ (function(module, exports, __webpack_require__) {
66925
66926var objectAssign = __webpack_require__(243);
66927var stringWidth = __webpack_require__(1017);
66928
66929function codeRegex(capture){
66930 return capture ? /\u001b\[((?:\d*;){0,5}\d*)m/g : /\u001b\[(?:\d*;){0,5}\d*m/g
66931}
66932
66933function strlen(str){
66934 var code = codeRegex();
66935 var stripped = ("" + str).replace(code,'');
66936 var split = stripped.split("\n");
66937 return split.reduce(function (memo, s) { return (stringWidth(s) > memo) ? stringWidth(s) : memo }, 0);
66938}
66939
66940function repeat(str,times){
66941 return Array(times + 1).join(str);
66942}
66943
66944function pad(str, len, pad, dir) {
66945 var length = strlen(str);
66946 if (len + 1 >= length) {
66947 var padlen = len - length;
66948 switch (dir) {
66949 case 'right':
66950 str = repeat(pad, padlen) + str;
66951 break;
66952
66953 case 'center':
66954 var right = Math.ceil((padlen) / 2);
66955 var left = padlen - right;
66956 str = repeat(pad, left) + str + repeat(pad, right);
66957 break;
66958
66959 default :
66960 str = str + repeat(pad,padlen);
66961 break;
66962 }
66963 }
66964 return str;
66965}
66966
66967var codeCache = {};
66968
66969function addToCodeCache(name,on,off){
66970 on = '\u001b[' + on + 'm';
66971 off = '\u001b[' + off + 'm';
66972 codeCache[on] = {set:name,to:true};
66973 codeCache[off] = {set:name,to:false};
66974 codeCache[name] = {on:on,off:off};
66975}
66976
66977//https://github.com/Marak/colors.js/blob/master/lib/styles.js
66978addToCodeCache('bold', 1, 22);
66979addToCodeCache('italics', 3, 23);
66980addToCodeCache('underline', 4, 24);
66981addToCodeCache('inverse', 7, 27);
66982addToCodeCache('strikethrough', 9, 29);
66983
66984
66985function updateState(state, controlChars){
66986 var controlCode = controlChars[1] ? parseInt(controlChars[1].split(';')[0]) : 0;
66987 if ( (controlCode >= 30 && controlCode <= 39)
66988 || (controlCode >= 90 && controlCode <= 97)
66989 ) {
66990 state.lastForegroundAdded = controlChars[0];
66991 return;
66992 }
66993 if ( (controlCode >= 40 && controlCode <= 49)
66994 || (controlCode >= 100 && controlCode <= 107)
66995 ) {
66996 state.lastBackgroundAdded = controlChars[0];
66997 return;
66998 }
66999 if (controlCode === 0) {
67000 for (var i in state) {
67001 /* istanbul ignore else */
67002 if (state.hasOwnProperty(i)) {
67003 delete state[i];
67004 }
67005 }
67006 return;
67007 }
67008 var info = codeCache[controlChars[0]];
67009 if (info) {
67010 state[info.set] = info.to;
67011 }
67012}
67013
67014function readState(line){
67015 var code = codeRegex(true);
67016 var controlChars = code.exec(line);
67017 var state = {};
67018 while(controlChars !== null){
67019 updateState(state, controlChars);
67020 controlChars = code.exec(line);
67021 }
67022 return state;
67023}
67024
67025function unwindState(state,ret){
67026 var lastBackgroundAdded = state.lastBackgroundAdded;
67027 var lastForegroundAdded = state.lastForegroundAdded;
67028
67029 delete state.lastBackgroundAdded;
67030 delete state.lastForegroundAdded;
67031
67032 Object.keys(state).forEach(function(key){
67033 if(state[key]){
67034 ret += codeCache[key].off;
67035 }
67036 });
67037
67038 if(lastBackgroundAdded && (lastBackgroundAdded != '\u001b[49m')){
67039 ret += '\u001b[49m';
67040 }
67041 if(lastForegroundAdded && (lastForegroundAdded != '\u001b[39m')){
67042 ret += '\u001b[39m';
67043 }
67044
67045 return ret;
67046}
67047
67048function rewindState(state,ret){
67049 var lastBackgroundAdded = state.lastBackgroundAdded;
67050 var lastForegroundAdded = state.lastForegroundAdded;
67051
67052 delete state.lastBackgroundAdded;
67053 delete state.lastForegroundAdded;
67054
67055 Object.keys(state).forEach(function(key){
67056 if(state[key]){
67057 ret = codeCache[key].on + ret;
67058 }
67059 });
67060
67061 if(lastBackgroundAdded && (lastBackgroundAdded != '\u001b[49m')){
67062 ret = lastBackgroundAdded + ret;
67063 }
67064 if(lastForegroundAdded && (lastForegroundAdded != '\u001b[39m')){
67065 ret = lastForegroundAdded + ret;
67066 }
67067
67068 return ret;
67069}
67070
67071function truncateWidth(str, desiredLength){
67072 if (str.length === strlen(str)) {
67073 return str.substr(0, desiredLength);
67074 }
67075
67076 while (strlen(str) > desiredLength){
67077 str = str.slice(0, -1);
67078 }
67079
67080 return str;
67081}
67082
67083function truncateWidthWithAnsi(str, desiredLength){
67084 var code = codeRegex(true);
67085 var split = str.split(codeRegex());
67086 var splitIndex = 0;
67087 var retLen = 0;
67088 var ret = '';
67089 var myArray;
67090 var state = {};
67091
67092 while(retLen < desiredLength){
67093 myArray = code.exec(str);
67094 var toAdd = split[splitIndex];
67095 splitIndex++;
67096 if (retLen + strlen(toAdd) > desiredLength){
67097 toAdd = truncateWidth(toAdd, desiredLength - retLen);
67098 }
67099 ret += toAdd;
67100 retLen += strlen(toAdd);
67101
67102 if(retLen < desiredLength){
67103 if (!myArray) { break; } // full-width chars may cause a whitespace which cannot be filled
67104 ret += myArray[0];
67105 updateState(state,myArray);
67106 }
67107 }
67108
67109 return unwindState(state,ret);
67110}
67111
67112function truncate(str, desiredLength, truncateChar){
67113 truncateChar = truncateChar || '…';
67114 var lengthOfStr = strlen(str);
67115 if(lengthOfStr <= desiredLength){
67116 return str;
67117 }
67118 desiredLength -= strlen(truncateChar);
67119
67120 var ret = truncateWidthWithAnsi(str, desiredLength);
67121
67122 return ret + truncateChar;
67123}
67124
67125
67126function defaultOptions(){
67127 return{
67128 chars: {
67129 'top': '─'
67130 , 'top-mid': '┬'
67131 , 'top-left': '┌'
67132 , 'top-right': '┐'
67133 , 'bottom': '─'
67134 , 'bottom-mid': '┴'
67135 , 'bottom-left': '└'
67136 , 'bottom-right': '┘'
67137 , 'left': '│'
67138 , 'left-mid': '├'
67139 , 'mid': '─'
67140 , 'mid-mid': '┼'
67141 , 'right': '│'
67142 , 'right-mid': '┤'
67143 , 'middle': '│'
67144 }
67145 , truncate: '…'
67146 , colWidths: []
67147 , rowHeights: []
67148 , colAligns: []
67149 , rowAligns: []
67150 , style: {
67151 'padding-left': 1
67152 , 'padding-right': 1
67153 , head: ['red']
67154 , border: ['grey']
67155 , compact : false
67156 }
67157 , head: []
67158 };
67159}
67160
67161function mergeOptions(options,defaults){
67162 options = options || {};
67163 defaults = defaults || defaultOptions();
67164 var ret = objectAssign({}, defaults, options);
67165 ret.chars = objectAssign({}, defaults.chars, options.chars);
67166 ret.style = objectAssign({}, defaults.style, options.style);
67167 return ret;
67168}
67169
67170function wordWrap(maxLength,input){
67171 var lines = [];
67172 var split = input.split(/(\s+)/g);
67173 var line = [];
67174 var lineLength = 0;
67175 var whitespace;
67176 for (var i = 0; i < split.length; i += 2) {
67177 var word = split[i];
67178 var newLength = lineLength + strlen(word);
67179 if (lineLength > 0 && whitespace) {
67180 newLength += whitespace.length;
67181 }
67182 if(newLength > maxLength){
67183 if(lineLength !== 0){
67184 lines.push(line.join(''));
67185 }
67186 line = [word];
67187 lineLength = strlen(word);
67188 } else {
67189 line.push(whitespace || '', word);
67190 lineLength = newLength;
67191 }
67192 whitespace = split[i+1];
67193 }
67194 if(lineLength){
67195 lines.push(line.join(''));
67196 }
67197 return lines;
67198}
67199
67200function multiLineWordWrap(maxLength, input){
67201 var output = [];
67202 input = input.split('\n');
67203 for(var i = 0; i < input.length; i++){
67204 output.push.apply(output,wordWrap(maxLength,input[i]));
67205 }
67206 return output;
67207}
67208
67209function colorizeLines(input){
67210 var state = {};
67211 var output = [];
67212 for(var i = 0; i < input.length; i++){
67213 var line = rewindState(state,input[i]) ;
67214 state = readState(line);
67215 var temp = objectAssign({},state);
67216 output.push(unwindState(temp,line));
67217 }
67218 return output;
67219}
67220
67221module.exports = {
67222 strlen:strlen,
67223 repeat:repeat,
67224 pad:pad,
67225 truncate:truncate,
67226 mergeOptions:mergeOptions,
67227 wordWrap:multiLineWordWrap,
67228 colorizeLines:colorizeLines
67229};
67230
67231
67232/***/ }),
67233/* 321 */
67234/***/ (function(module, exports) {
67235
67236
67237/**
67238 * slice() reference.
67239 */
67240
67241var slice = Array.prototype.slice;
67242
67243/**
67244 * Expose `co`.
67245 */
67246
67247module.exports = co['default'] = co.co = co;
67248
67249/**
67250 * Wrap the given generator `fn` into a
67251 * function that returns a promise.
67252 * This is a separate function so that
67253 * every `co()` call doesn't create a new,
67254 * unnecessary closure.
67255 *
67256 * @param {GeneratorFunction} fn
67257 * @return {Function}
67258 * @api public
67259 */
67260
67261co.wrap = function (fn) {
67262 createPromise.__generatorFunction__ = fn;
67263 return createPromise;
67264 function createPromise() {
67265 return co.call(this, fn.apply(this, arguments));
67266 }
67267};
67268
67269/**
67270 * Execute the generator function or a generator
67271 * and return a promise.
67272 *
67273 * @param {Function} fn
67274 * @return {Promise}
67275 * @api public
67276 */
67277
67278function co(gen) {
67279 var ctx = this;
67280 var args = slice.call(arguments, 1)
67281
67282 // we wrap everything in a promise to avoid promise chaining,
67283 // which leads to memory leak errors.
67284 // see https://github.com/tj/co/issues/180
67285 return new Promise(function(resolve, reject) {
67286 if (typeof gen === 'function') gen = gen.apply(ctx, args);
67287 if (!gen || typeof gen.next !== 'function') return resolve(gen);
67288
67289 onFulfilled();
67290
67291 /**
67292 * @param {Mixed} res
67293 * @return {Promise}
67294 * @api private
67295 */
67296
67297 function onFulfilled(res) {
67298 var ret;
67299 try {
67300 ret = gen.next(res);
67301 } catch (e) {
67302 return reject(e);
67303 }
67304 next(ret);
67305 }
67306
67307 /**
67308 * @param {Error} err
67309 * @return {Promise}
67310 * @api private
67311 */
67312
67313 function onRejected(err) {
67314 var ret;
67315 try {
67316 ret = gen.throw(err);
67317 } catch (e) {
67318 return reject(e);
67319 }
67320 next(ret);
67321 }
67322
67323 /**
67324 * Get the next value in the generator,
67325 * return a promise.
67326 *
67327 * @param {Object} ret
67328 * @return {Promise}
67329 * @api private
67330 */
67331
67332 function next(ret) {
67333 if (ret.done) return resolve(ret.value);
67334 var value = toPromise.call(ctx, ret.value);
67335 if (value && isPromise(value)) return value.then(onFulfilled, onRejected);
67336 return onRejected(new TypeError('You may only yield a function, promise, generator, array, or object, '
67337 + 'but the following object was passed: "' + String(ret.value) + '"'));
67338 }
67339 });
67340}
67341
67342/**
67343 * Convert a `yield`ed value into a promise.
67344 *
67345 * @param {Mixed} obj
67346 * @return {Promise}
67347 * @api private
67348 */
67349
67350function toPromise(obj) {
67351 if (!obj) return obj;
67352 if (isPromise(obj)) return obj;
67353 if (isGeneratorFunction(obj) || isGenerator(obj)) return co.call(this, obj);
67354 if ('function' == typeof obj) return thunkToPromise.call(this, obj);
67355 if (Array.isArray(obj)) return arrayToPromise.call(this, obj);
67356 if (isObject(obj)) return objectToPromise.call(this, obj);
67357 return obj;
67358}
67359
67360/**
67361 * Convert a thunk to a promise.
67362 *
67363 * @param {Function}
67364 * @return {Promise}
67365 * @api private
67366 */
67367
67368function thunkToPromise(fn) {
67369 var ctx = this;
67370 return new Promise(function (resolve, reject) {
67371 fn.call(ctx, function (err, res) {
67372 if (err) return reject(err);
67373 if (arguments.length > 2) res = slice.call(arguments, 1);
67374 resolve(res);
67375 });
67376 });
67377}
67378
67379/**
67380 * Convert an array of "yieldables" to a promise.
67381 * Uses `Promise.all()` internally.
67382 *
67383 * @param {Array} obj
67384 * @return {Promise}
67385 * @api private
67386 */
67387
67388function arrayToPromise(obj) {
67389 return Promise.all(obj.map(toPromise, this));
67390}
67391
67392/**
67393 * Convert an object of "yieldables" to a promise.
67394 * Uses `Promise.all()` internally.
67395 *
67396 * @param {Object} obj
67397 * @return {Promise}
67398 * @api private
67399 */
67400
67401function objectToPromise(obj){
67402 var results = new obj.constructor();
67403 var keys = Object.keys(obj);
67404 var promises = [];
67405 for (var i = 0; i < keys.length; i++) {
67406 var key = keys[i];
67407 var promise = toPromise.call(this, obj[key]);
67408 if (promise && isPromise(promise)) defer(promise, key);
67409 else results[key] = obj[key];
67410 }
67411 return Promise.all(promises).then(function () {
67412 return results;
67413 });
67414
67415 function defer(promise, key) {
67416 // predefine the key in the result
67417 results[key] = undefined;
67418 promises.push(promise.then(function (res) {
67419 results[key] = res;
67420 }));
67421 }
67422}
67423
67424/**
67425 * Check if `obj` is a promise.
67426 *
67427 * @param {Object} obj
67428 * @return {Boolean}
67429 * @api private
67430 */
67431
67432function isPromise(obj) {
67433 return 'function' == typeof obj.then;
67434}
67435
67436/**
67437 * Check if `obj` is a generator.
67438 *
67439 * @param {Mixed} obj
67440 * @return {Boolean}
67441 * @api private
67442 */
67443
67444function isGenerator(obj) {
67445 return 'function' == typeof obj.next && 'function' == typeof obj.throw;
67446}
67447
67448/**
67449 * Check if `obj` is a generator function.
67450 *
67451 * @param {Mixed} obj
67452 * @return {Boolean}
67453 * @api private
67454 */
67455function isGeneratorFunction(obj) {
67456 var constructor = obj.constructor;
67457 if (!constructor) return false;
67458 if ('GeneratorFunction' === constructor.name || 'GeneratorFunction' === constructor.displayName) return true;
67459 return isGenerator(constructor.prototype);
67460}
67461
67462/**
67463 * Check for plain object.
67464 *
67465 * @param {Mixed} val
67466 * @return {Boolean}
67467 * @api private
67468 */
67469
67470function isObject(val) {
67471 return Object == val.constructor;
67472}
67473
67474
67475/***/ }),
67476/* 322 */
67477/***/ (function(module, exports, __webpack_require__) {
67478
67479/* MIT license */
67480var cssKeywords = __webpack_require__(576);
67481
67482// NOTE: conversions should only return primitive values (i.e. arrays, or
67483// values that give correct `typeof` results).
67484// do not use box values types (i.e. Number(), String(), etc.)
67485
67486var reverseKeywords = {};
67487for (var key in cssKeywords) {
67488 if (cssKeywords.hasOwnProperty(key)) {
67489 reverseKeywords[cssKeywords[key]] = key;
67490 }
67491}
67492
67493var convert = module.exports = {
67494 rgb: {channels: 3, labels: 'rgb'},
67495 hsl: {channels: 3, labels: 'hsl'},
67496 hsv: {channels: 3, labels: 'hsv'},
67497 hwb: {channels: 3, labels: 'hwb'},
67498 cmyk: {channels: 4, labels: 'cmyk'},
67499 xyz: {channels: 3, labels: 'xyz'},
67500 lab: {channels: 3, labels: 'lab'},
67501 lch: {channels: 3, labels: 'lch'},
67502 hex: {channels: 1, labels: ['hex']},
67503 keyword: {channels: 1, labels: ['keyword']},
67504 ansi16: {channels: 1, labels: ['ansi16']},
67505 ansi256: {channels: 1, labels: ['ansi256']},
67506 hcg: {channels: 3, labels: ['h', 'c', 'g']},
67507 apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
67508 gray: {channels: 1, labels: ['gray']}
67509};
67510
67511// hide .channels and .labels properties
67512for (var model in convert) {
67513 if (convert.hasOwnProperty(model)) {
67514 if (!('channels' in convert[model])) {
67515 throw new Error('missing channels property: ' + model);
67516 }
67517
67518 if (!('labels' in convert[model])) {
67519 throw new Error('missing channel labels property: ' + model);
67520 }
67521
67522 if (convert[model].labels.length !== convert[model].channels) {
67523 throw new Error('channel and label counts mismatch: ' + model);
67524 }
67525
67526 var channels = convert[model].channels;
67527 var labels = convert[model].labels;
67528 delete convert[model].channels;
67529 delete convert[model].labels;
67530 Object.defineProperty(convert[model], 'channels', {value: channels});
67531 Object.defineProperty(convert[model], 'labels', {value: labels});
67532 }
67533}
67534
67535convert.rgb.hsl = function (rgb) {
67536 var r = rgb[0] / 255;
67537 var g = rgb[1] / 255;
67538 var b = rgb[2] / 255;
67539 var min = Math.min(r, g, b);
67540 var max = Math.max(r, g, b);
67541 var delta = max - min;
67542 var h;
67543 var s;
67544 var l;
67545
67546 if (max === min) {
67547 h = 0;
67548 } else if (r === max) {
67549 h = (g - b) / delta;
67550 } else if (g === max) {
67551 h = 2 + (b - r) / delta;
67552 } else if (b === max) {
67553 h = 4 + (r - g) / delta;
67554 }
67555
67556 h = Math.min(h * 60, 360);
67557
67558 if (h < 0) {
67559 h += 360;
67560 }
67561
67562 l = (min + max) / 2;
67563
67564 if (max === min) {
67565 s = 0;
67566 } else if (l <= 0.5) {
67567 s = delta / (max + min);
67568 } else {
67569 s = delta / (2 - max - min);
67570 }
67571
67572 return [h, s * 100, l * 100];
67573};
67574
67575convert.rgb.hsv = function (rgb) {
67576 var rdif;
67577 var gdif;
67578 var bdif;
67579 var h;
67580 var s;
67581
67582 var r = rgb[0] / 255;
67583 var g = rgb[1] / 255;
67584 var b = rgb[2] / 255;
67585 var v = Math.max(r, g, b);
67586 var diff = v - Math.min(r, g, b);
67587 var diffc = function (c) {
67588 return (v - c) / 6 / diff + 1 / 2;
67589 };
67590
67591 if (diff === 0) {
67592 h = s = 0;
67593 } else {
67594 s = diff / v;
67595 rdif = diffc(r);
67596 gdif = diffc(g);
67597 bdif = diffc(b);
67598
67599 if (r === v) {
67600 h = bdif - gdif;
67601 } else if (g === v) {
67602 h = (1 / 3) + rdif - bdif;
67603 } else if (b === v) {
67604 h = (2 / 3) + gdif - rdif;
67605 }
67606 if (h < 0) {
67607 h += 1;
67608 } else if (h > 1) {
67609 h -= 1;
67610 }
67611 }
67612
67613 return [
67614 h * 360,
67615 s * 100,
67616 v * 100
67617 ];
67618};
67619
67620convert.rgb.hwb = function (rgb) {
67621 var r = rgb[0];
67622 var g = rgb[1];
67623 var b = rgb[2];
67624 var h = convert.rgb.hsl(rgb)[0];
67625 var w = 1 / 255 * Math.min(r, Math.min(g, b));
67626
67627 b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
67628
67629 return [h, w * 100, b * 100];
67630};
67631
67632convert.rgb.cmyk = function (rgb) {
67633 var r = rgb[0] / 255;
67634 var g = rgb[1] / 255;
67635 var b = rgb[2] / 255;
67636 var c;
67637 var m;
67638 var y;
67639 var k;
67640
67641 k = Math.min(1 - r, 1 - g, 1 - b);
67642 c = (1 - r - k) / (1 - k) || 0;
67643 m = (1 - g - k) / (1 - k) || 0;
67644 y = (1 - b - k) / (1 - k) || 0;
67645
67646 return [c * 100, m * 100, y * 100, k * 100];
67647};
67648
67649/**
67650 * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
67651 * */
67652function comparativeDistance(x, y) {
67653 return (
67654 Math.pow(x[0] - y[0], 2) +
67655 Math.pow(x[1] - y[1], 2) +
67656 Math.pow(x[2] - y[2], 2)
67657 );
67658}
67659
67660convert.rgb.keyword = function (rgb) {
67661 var reversed = reverseKeywords[rgb];
67662 if (reversed) {
67663 return reversed;
67664 }
67665
67666 var currentClosestDistance = Infinity;
67667 var currentClosestKeyword;
67668
67669 for (var keyword in cssKeywords) {
67670 if (cssKeywords.hasOwnProperty(keyword)) {
67671 var value = cssKeywords[keyword];
67672
67673 // Compute comparative distance
67674 var distance = comparativeDistance(rgb, value);
67675
67676 // Check if its less, if so set as closest
67677 if (distance < currentClosestDistance) {
67678 currentClosestDistance = distance;
67679 currentClosestKeyword = keyword;
67680 }
67681 }
67682 }
67683
67684 return currentClosestKeyword;
67685};
67686
67687convert.keyword.rgb = function (keyword) {
67688 return cssKeywords[keyword];
67689};
67690
67691convert.rgb.xyz = function (rgb) {
67692 var r = rgb[0] / 255;
67693 var g = rgb[1] / 255;
67694 var b = rgb[2] / 255;
67695
67696 // assume sRGB
67697 r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
67698 g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
67699 b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
67700
67701 var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
67702 var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
67703 var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
67704
67705 return [x * 100, y * 100, z * 100];
67706};
67707
67708convert.rgb.lab = function (rgb) {
67709 var xyz = convert.rgb.xyz(rgb);
67710 var x = xyz[0];
67711 var y = xyz[1];
67712 var z = xyz[2];
67713 var l;
67714 var a;
67715 var b;
67716
67717 x /= 95.047;
67718 y /= 100;
67719 z /= 108.883;
67720
67721 x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
67722 y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
67723 z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
67724
67725 l = (116 * y) - 16;
67726 a = 500 * (x - y);
67727 b = 200 * (y - z);
67728
67729 return [l, a, b];
67730};
67731
67732convert.hsl.rgb = function (hsl) {
67733 var h = hsl[0] / 360;
67734 var s = hsl[1] / 100;
67735 var l = hsl[2] / 100;
67736 var t1;
67737 var t2;
67738 var t3;
67739 var rgb;
67740 var val;
67741
67742 if (s === 0) {
67743 val = l * 255;
67744 return [val, val, val];
67745 }
67746
67747 if (l < 0.5) {
67748 t2 = l * (1 + s);
67749 } else {
67750 t2 = l + s - l * s;
67751 }
67752
67753 t1 = 2 * l - t2;
67754
67755 rgb = [0, 0, 0];
67756 for (var i = 0; i < 3; i++) {
67757 t3 = h + 1 / 3 * -(i - 1);
67758 if (t3 < 0) {
67759 t3++;
67760 }
67761 if (t3 > 1) {
67762 t3--;
67763 }
67764
67765 if (6 * t3 < 1) {
67766 val = t1 + (t2 - t1) * 6 * t3;
67767 } else if (2 * t3 < 1) {
67768 val = t2;
67769 } else if (3 * t3 < 2) {
67770 val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
67771 } else {
67772 val = t1;
67773 }
67774
67775 rgb[i] = val * 255;
67776 }
67777
67778 return rgb;
67779};
67780
67781convert.hsl.hsv = function (hsl) {
67782 var h = hsl[0];
67783 var s = hsl[1] / 100;
67784 var l = hsl[2] / 100;
67785 var smin = s;
67786 var lmin = Math.max(l, 0.01);
67787 var sv;
67788 var v;
67789
67790 l *= 2;
67791 s *= (l <= 1) ? l : 2 - l;
67792 smin *= lmin <= 1 ? lmin : 2 - lmin;
67793 v = (l + s) / 2;
67794 sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
67795
67796 return [h, sv * 100, v * 100];
67797};
67798
67799convert.hsv.rgb = function (hsv) {
67800 var h = hsv[0] / 60;
67801 var s = hsv[1] / 100;
67802 var v = hsv[2] / 100;
67803 var hi = Math.floor(h) % 6;
67804
67805 var f = h - Math.floor(h);
67806 var p = 255 * v * (1 - s);
67807 var q = 255 * v * (1 - (s * f));
67808 var t = 255 * v * (1 - (s * (1 - f)));
67809 v *= 255;
67810
67811 switch (hi) {
67812 case 0:
67813 return [v, t, p];
67814 case 1:
67815 return [q, v, p];
67816 case 2:
67817 return [p, v, t];
67818 case 3:
67819 return [p, q, v];
67820 case 4:
67821 return [t, p, v];
67822 case 5:
67823 return [v, p, q];
67824 }
67825};
67826
67827convert.hsv.hsl = function (hsv) {
67828 var h = hsv[0];
67829 var s = hsv[1] / 100;
67830 var v = hsv[2] / 100;
67831 var vmin = Math.max(v, 0.01);
67832 var lmin;
67833 var sl;
67834 var l;
67835
67836 l = (2 - s) * v;
67837 lmin = (2 - s) * vmin;
67838 sl = s * vmin;
67839 sl /= (lmin <= 1) ? lmin : 2 - lmin;
67840 sl = sl || 0;
67841 l /= 2;
67842
67843 return [h, sl * 100, l * 100];
67844};
67845
67846// http://dev.w3.org/csswg/css-color/#hwb-to-rgb
67847convert.hwb.rgb = function (hwb) {
67848 var h = hwb[0] / 360;
67849 var wh = hwb[1] / 100;
67850 var bl = hwb[2] / 100;
67851 var ratio = wh + bl;
67852 var i;
67853 var v;
67854 var f;
67855 var n;
67856
67857 // wh + bl cant be > 1
67858 if (ratio > 1) {
67859 wh /= ratio;
67860 bl /= ratio;
67861 }
67862
67863 i = Math.floor(6 * h);
67864 v = 1 - bl;
67865 f = 6 * h - i;
67866
67867 if ((i & 0x01) !== 0) {
67868 f = 1 - f;
67869 }
67870
67871 n = wh + f * (v - wh); // linear interpolation
67872
67873 var r;
67874 var g;
67875 var b;
67876 switch (i) {
67877 default:
67878 case 6:
67879 case 0: r = v; g = n; b = wh; break;
67880 case 1: r = n; g = v; b = wh; break;
67881 case 2: r = wh; g = v; b = n; break;
67882 case 3: r = wh; g = n; b = v; break;
67883 case 4: r = n; g = wh; b = v; break;
67884 case 5: r = v; g = wh; b = n; break;
67885 }
67886
67887 return [r * 255, g * 255, b * 255];
67888};
67889
67890convert.cmyk.rgb = function (cmyk) {
67891 var c = cmyk[0] / 100;
67892 var m = cmyk[1] / 100;
67893 var y = cmyk[2] / 100;
67894 var k = cmyk[3] / 100;
67895 var r;
67896 var g;
67897 var b;
67898
67899 r = 1 - Math.min(1, c * (1 - k) + k);
67900 g = 1 - Math.min(1, m * (1 - k) + k);
67901 b = 1 - Math.min(1, y * (1 - k) + k);
67902
67903 return [r * 255, g * 255, b * 255];
67904};
67905
67906convert.xyz.rgb = function (xyz) {
67907 var x = xyz[0] / 100;
67908 var y = xyz[1] / 100;
67909 var z = xyz[2] / 100;
67910 var r;
67911 var g;
67912 var b;
67913
67914 r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
67915 g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
67916 b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
67917
67918 // assume sRGB
67919 r = r > 0.0031308
67920 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
67921 : r * 12.92;
67922
67923 g = g > 0.0031308
67924 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
67925 : g * 12.92;
67926
67927 b = b > 0.0031308
67928 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
67929 : b * 12.92;
67930
67931 r = Math.min(Math.max(0, r), 1);
67932 g = Math.min(Math.max(0, g), 1);
67933 b = Math.min(Math.max(0, b), 1);
67934
67935 return [r * 255, g * 255, b * 255];
67936};
67937
67938convert.xyz.lab = function (xyz) {
67939 var x = xyz[0];
67940 var y = xyz[1];
67941 var z = xyz[2];
67942 var l;
67943 var a;
67944 var b;
67945
67946 x /= 95.047;
67947 y /= 100;
67948 z /= 108.883;
67949
67950 x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
67951 y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
67952 z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
67953
67954 l = (116 * y) - 16;
67955 a = 500 * (x - y);
67956 b = 200 * (y - z);
67957
67958 return [l, a, b];
67959};
67960
67961convert.lab.xyz = function (lab) {
67962 var l = lab[0];
67963 var a = lab[1];
67964 var b = lab[2];
67965 var x;
67966 var y;
67967 var z;
67968
67969 y = (l + 16) / 116;
67970 x = a / 500 + y;
67971 z = y - b / 200;
67972
67973 var y2 = Math.pow(y, 3);
67974 var x2 = Math.pow(x, 3);
67975 var z2 = Math.pow(z, 3);
67976 y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
67977 x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
67978 z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
67979
67980 x *= 95.047;
67981 y *= 100;
67982 z *= 108.883;
67983
67984 return [x, y, z];
67985};
67986
67987convert.lab.lch = function (lab) {
67988 var l = lab[0];
67989 var a = lab[1];
67990 var b = lab[2];
67991 var hr;
67992 var h;
67993 var c;
67994
67995 hr = Math.atan2(b, a);
67996 h = hr * 360 / 2 / Math.PI;
67997
67998 if (h < 0) {
67999 h += 360;
68000 }
68001
68002 c = Math.sqrt(a * a + b * b);
68003
68004 return [l, c, h];
68005};
68006
68007convert.lch.lab = function (lch) {
68008 var l = lch[0];
68009 var c = lch[1];
68010 var h = lch[2];
68011 var a;
68012 var b;
68013 var hr;
68014
68015 hr = h / 360 * 2 * Math.PI;
68016 a = c * Math.cos(hr);
68017 b = c * Math.sin(hr);
68018
68019 return [l, a, b];
68020};
68021
68022convert.rgb.ansi16 = function (args) {
68023 var r = args[0];
68024 var g = args[1];
68025 var b = args[2];
68026 var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
68027
68028 value = Math.round(value / 50);
68029
68030 if (value === 0) {
68031 return 30;
68032 }
68033
68034 var ansi = 30
68035 + ((Math.round(b / 255) << 2)
68036 | (Math.round(g / 255) << 1)
68037 | Math.round(r / 255));
68038
68039 if (value === 2) {
68040 ansi += 60;
68041 }
68042
68043 return ansi;
68044};
68045
68046convert.hsv.ansi16 = function (args) {
68047 // optimization here; we already know the value and don't need to get
68048 // it converted for us.
68049 return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
68050};
68051
68052convert.rgb.ansi256 = function (args) {
68053 var r = args[0];
68054 var g = args[1];
68055 var b = args[2];
68056
68057 // we use the extended greyscale palette here, with the exception of
68058 // black and white. normal palette only has 4 greyscale shades.
68059 if (r === g && g === b) {
68060 if (r < 8) {
68061 return 16;
68062 }
68063
68064 if (r > 248) {
68065 return 231;
68066 }
68067
68068 return Math.round(((r - 8) / 247) * 24) + 232;
68069 }
68070
68071 var ansi = 16
68072 + (36 * Math.round(r / 255 * 5))
68073 + (6 * Math.round(g / 255 * 5))
68074 + Math.round(b / 255 * 5);
68075
68076 return ansi;
68077};
68078
68079convert.ansi16.rgb = function (args) {
68080 var color = args % 10;
68081
68082 // handle greyscale
68083 if (color === 0 || color === 7) {
68084 if (args > 50) {
68085 color += 3.5;
68086 }
68087
68088 color = color / 10.5 * 255;
68089
68090 return [color, color, color];
68091 }
68092
68093 var mult = (~~(args > 50) + 1) * 0.5;
68094 var r = ((color & 1) * mult) * 255;
68095 var g = (((color >> 1) & 1) * mult) * 255;
68096 var b = (((color >> 2) & 1) * mult) * 255;
68097
68098 return [r, g, b];
68099};
68100
68101convert.ansi256.rgb = function (args) {
68102 // handle greyscale
68103 if (args >= 232) {
68104 var c = (args - 232) * 10 + 8;
68105 return [c, c, c];
68106 }
68107
68108 args -= 16;
68109
68110 var rem;
68111 var r = Math.floor(args / 36) / 5 * 255;
68112 var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
68113 var b = (rem % 6) / 5 * 255;
68114
68115 return [r, g, b];
68116};
68117
68118convert.rgb.hex = function (args) {
68119 var integer = ((Math.round(args[0]) & 0xFF) << 16)
68120 + ((Math.round(args[1]) & 0xFF) << 8)
68121 + (Math.round(args[2]) & 0xFF);
68122
68123 var string = integer.toString(16).toUpperCase();
68124 return '000000'.substring(string.length) + string;
68125};
68126
68127convert.hex.rgb = function (args) {
68128 var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
68129 if (!match) {
68130 return [0, 0, 0];
68131 }
68132
68133 var colorString = match[0];
68134
68135 if (match[0].length === 3) {
68136 colorString = colorString.split('').map(function (char) {
68137 return char + char;
68138 }).join('');
68139 }
68140
68141 var integer = parseInt(colorString, 16);
68142 var r = (integer >> 16) & 0xFF;
68143 var g = (integer >> 8) & 0xFF;
68144 var b = integer & 0xFF;
68145
68146 return [r, g, b];
68147};
68148
68149convert.rgb.hcg = function (rgb) {
68150 var r = rgb[0] / 255;
68151 var g = rgb[1] / 255;
68152 var b = rgb[2] / 255;
68153 var max = Math.max(Math.max(r, g), b);
68154 var min = Math.min(Math.min(r, g), b);
68155 var chroma = (max - min);
68156 var grayscale;
68157 var hue;
68158
68159 if (chroma < 1) {
68160 grayscale = min / (1 - chroma);
68161 } else {
68162 grayscale = 0;
68163 }
68164
68165 if (chroma <= 0) {
68166 hue = 0;
68167 } else
68168 if (max === r) {
68169 hue = ((g - b) / chroma) % 6;
68170 } else
68171 if (max === g) {
68172 hue = 2 + (b - r) / chroma;
68173 } else {
68174 hue = 4 + (r - g) / chroma + 4;
68175 }
68176
68177 hue /= 6;
68178 hue %= 1;
68179
68180 return [hue * 360, chroma * 100, grayscale * 100];
68181};
68182
68183convert.hsl.hcg = function (hsl) {
68184 var s = hsl[1] / 100;
68185 var l = hsl[2] / 100;
68186 var c = 1;
68187 var f = 0;
68188
68189 if (l < 0.5) {
68190 c = 2.0 * s * l;
68191 } else {
68192 c = 2.0 * s * (1.0 - l);
68193 }
68194
68195 if (c < 1.0) {
68196 f = (l - 0.5 * c) / (1.0 - c);
68197 }
68198
68199 return [hsl[0], c * 100, f * 100];
68200};
68201
68202convert.hsv.hcg = function (hsv) {
68203 var s = hsv[1] / 100;
68204 var v = hsv[2] / 100;
68205
68206 var c = s * v;
68207 var f = 0;
68208
68209 if (c < 1.0) {
68210 f = (v - c) / (1 - c);
68211 }
68212
68213 return [hsv[0], c * 100, f * 100];
68214};
68215
68216convert.hcg.rgb = function (hcg) {
68217 var h = hcg[0] / 360;
68218 var c = hcg[1] / 100;
68219 var g = hcg[2] / 100;
68220
68221 if (c === 0.0) {
68222 return [g * 255, g * 255, g * 255];
68223 }
68224
68225 var pure = [0, 0, 0];
68226 var hi = (h % 1) * 6;
68227 var v = hi % 1;
68228 var w = 1 - v;
68229 var mg = 0;
68230
68231 switch (Math.floor(hi)) {
68232 case 0:
68233 pure[0] = 1; pure[1] = v; pure[2] = 0; break;
68234 case 1:
68235 pure[0] = w; pure[1] = 1; pure[2] = 0; break;
68236 case 2:
68237 pure[0] = 0; pure[1] = 1; pure[2] = v; break;
68238 case 3:
68239 pure[0] = 0; pure[1] = w; pure[2] = 1; break;
68240 case 4:
68241 pure[0] = v; pure[1] = 0; pure[2] = 1; break;
68242 default:
68243 pure[0] = 1; pure[1] = 0; pure[2] = w;
68244 }
68245
68246 mg = (1.0 - c) * g;
68247
68248 return [
68249 (c * pure[0] + mg) * 255,
68250 (c * pure[1] + mg) * 255,
68251 (c * pure[2] + mg) * 255
68252 ];
68253};
68254
68255convert.hcg.hsv = function (hcg) {
68256 var c = hcg[1] / 100;
68257 var g = hcg[2] / 100;
68258
68259 var v = c + g * (1.0 - c);
68260 var f = 0;
68261
68262 if (v > 0.0) {
68263 f = c / v;
68264 }
68265
68266 return [hcg[0], f * 100, v * 100];
68267};
68268
68269convert.hcg.hsl = function (hcg) {
68270 var c = hcg[1] / 100;
68271 var g = hcg[2] / 100;
68272
68273 var l = g * (1.0 - c) + 0.5 * c;
68274 var s = 0;
68275
68276 if (l > 0.0 && l < 0.5) {
68277 s = c / (2 * l);
68278 } else
68279 if (l >= 0.5 && l < 1.0) {
68280 s = c / (2 * (1 - l));
68281 }
68282
68283 return [hcg[0], s * 100, l * 100];
68284};
68285
68286convert.hcg.hwb = function (hcg) {
68287 var c = hcg[1] / 100;
68288 var g = hcg[2] / 100;
68289 var v = c + g * (1.0 - c);
68290 return [hcg[0], (v - c) * 100, (1 - v) * 100];
68291};
68292
68293convert.hwb.hcg = function (hwb) {
68294 var w = hwb[1] / 100;
68295 var b = hwb[2] / 100;
68296 var v = 1 - b;
68297 var c = v - w;
68298 var g = 0;
68299
68300 if (c < 1) {
68301 g = (v - c) / (1 - c);
68302 }
68303
68304 return [hwb[0], c * 100, g * 100];
68305};
68306
68307convert.apple.rgb = function (apple) {
68308 return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
68309};
68310
68311convert.rgb.apple = function (rgb) {
68312 return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
68313};
68314
68315convert.gray.rgb = function (args) {
68316 return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
68317};
68318
68319convert.gray.hsl = convert.gray.hsv = function (args) {
68320 return [0, 0, args[0]];
68321};
68322
68323convert.gray.hwb = function (gray) {
68324 return [0, 100, gray[0]];
68325};
68326
68327convert.gray.cmyk = function (gray) {
68328 return [0, 0, 0, gray[0]];
68329};
68330
68331convert.gray.lab = function (gray) {
68332 return [gray[0], 0, 0];
68333};
68334
68335convert.gray.hex = function (gray) {
68336 var val = Math.round(gray[0] / 100 * 255) & 0xFF;
68337 var integer = (val << 16) + (val << 8) + val;
68338
68339 var string = integer.toString(16).toUpperCase();
68340 return '000000'.substring(string.length) + string;
68341};
68342
68343convert.rgb.gray = function (rgb) {
68344 var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
68345 return [val / 255 * 100];
68346};
68347
68348
68349/***/ }),
68350/* 323 */
68351/***/ (function(module, exports, __webpack_require__) {
68352
68353var util = __webpack_require__(9);
68354var Stream = __webpack_require__(35).Stream;
68355var DelayedStream = __webpack_require__(657);
68356var defer = __webpack_require__(588);
68357
68358module.exports = CombinedStream;
68359function CombinedStream() {
68360 this.writable = false;
68361 this.readable = true;
68362 this.dataSize = 0;
68363 this.maxDataSize = 2 * 1024 * 1024;
68364 this.pauseStreams = true;
68365
68366 this._released = false;
68367 this._streams = [];
68368 this._currentStream = null;
68369}
68370util.inherits(CombinedStream, Stream);
68371
68372CombinedStream.create = function(options) {
68373 var combinedStream = new this();
68374
68375 options = options || {};
68376 for (var option in options) {
68377 combinedStream[option] = options[option];
68378 }
68379
68380 return combinedStream;
68381};
68382
68383CombinedStream.isStreamLike = function(stream) {
68384 return (typeof stream !== 'function')
68385 && (typeof stream !== 'string')
68386 && (typeof stream !== 'boolean')
68387 && (typeof stream !== 'number')
68388 && (!Buffer.isBuffer(stream));
68389};
68390
68391CombinedStream.prototype.append = function(stream) {
68392 var isStreamLike = CombinedStream.isStreamLike(stream);
68393
68394 if (isStreamLike) {
68395 if (!(stream instanceof DelayedStream)) {
68396 var newStream = DelayedStream.create(stream, {
68397 maxDataSize: Infinity,
68398 pauseStream: this.pauseStreams,
68399 });
68400 stream.on('data', this._checkDataSize.bind(this));
68401 stream = newStream;
68402 }
68403
68404 this._handleErrors(stream);
68405
68406 if (this.pauseStreams) {
68407 stream.pause();
68408 }
68409 }
68410
68411 this._streams.push(stream);
68412 return this;
68413};
68414
68415CombinedStream.prototype.pipe = function(dest, options) {
68416 Stream.prototype.pipe.call(this, dest, options);
68417 this.resume();
68418 return dest;
68419};
68420
68421CombinedStream.prototype._getNext = function() {
68422 this._currentStream = null;
68423 var stream = this._streams.shift();
68424
68425
68426 if (typeof stream == 'undefined') {
68427 this.end();
68428 return;
68429 }
68430
68431 if (typeof stream !== 'function') {
68432 this._pipeNext(stream);
68433 return;
68434 }
68435
68436 var getStream = stream;
68437 getStream(function(stream) {
68438 var isStreamLike = CombinedStream.isStreamLike(stream);
68439 if (isStreamLike) {
68440 stream.on('data', this._checkDataSize.bind(this));
68441 this._handleErrors(stream);
68442 }
68443
68444 defer(this._pipeNext.bind(this, stream));
68445 }.bind(this));
68446};
68447
68448CombinedStream.prototype._pipeNext = function(stream) {
68449 this._currentStream = stream;
68450
68451 var isStreamLike = CombinedStream.isStreamLike(stream);
68452 if (isStreamLike) {
68453 stream.on('end', this._getNext.bind(this));
68454 stream.pipe(this, {end: false});
68455 return;
68456 }
68457
68458 var value = stream;
68459 this.write(value);
68460 this._getNext();
68461};
68462
68463CombinedStream.prototype._handleErrors = function(stream) {
68464 var self = this;
68465 stream.on('error', function(err) {
68466 self._emitError(err);
68467 });
68468};
68469
68470CombinedStream.prototype.write = function(data) {
68471 this.emit('data', data);
68472};
68473
68474CombinedStream.prototype.pause = function() {
68475 if (!this.pauseStreams) {
68476 return;
68477 }
68478
68479 if(this.pauseStreams && this._currentStream && typeof(this._currentStream.pause) == 'function') this._currentStream.pause();
68480 this.emit('pause');
68481};
68482
68483CombinedStream.prototype.resume = function() {
68484 if (!this._released) {
68485 this._released = true;
68486 this.writable = true;
68487 this._getNext();
68488 }
68489
68490 if(this.pauseStreams && this._currentStream && typeof(this._currentStream.resume) == 'function') this._currentStream.resume();
68491 this.emit('resume');
68492};
68493
68494CombinedStream.prototype.end = function() {
68495 this._reset();
68496 this.emit('end');
68497};
68498
68499CombinedStream.prototype.destroy = function() {
68500 this._reset();
68501 this.emit('close');
68502};
68503
68504CombinedStream.prototype._reset = function() {
68505 this.writable = false;
68506 this._streams = [];
68507 this._currentStream = null;
68508};
68509
68510CombinedStream.prototype._checkDataSize = function() {
68511 this._updateDataSize();
68512 if (this.dataSize <= this.maxDataSize) {
68513 return;
68514 }
68515
68516 var message =
68517 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.';
68518 this._emitError(new Error(message));
68519};
68520
68521CombinedStream.prototype._updateDataSize = function() {
68522 this.dataSize = 0;
68523
68524 var self = this;
68525 this._streams.forEach(function(stream) {
68526 if (!stream.dataSize) {
68527 return;
68528 }
68529
68530 self.dataSize += stream.dataSize;
68531 });
68532
68533 if (this._currentStream && this._currentStream.dataSize) {
68534 this.dataSize += this._currentStream.dataSize;
68535 }
68536};
68537
68538CombinedStream.prototype._emitError = function(err) {
68539 this._reset();
68540 this.emit('error', err);
68541};
68542
68543
68544/***/ }),
68545/* 324 */
68546/***/ (function(module, exports, __webpack_require__) {
68547
68548"use strict";
68549
68550var dP = __webpack_require__(63).f;
68551var create = __webpack_require__(124);
68552var redefineAll = __webpack_require__(223);
68553var ctx = __webpack_require__(67);
68554var anInstance = __webpack_require__(213);
68555var forOf = __webpack_require__(121);
68556var $iterDefine = __webpack_require__(219);
68557var step = __webpack_require__(334);
68558var setSpecies = __webpack_require__(345);
68559var DESCRIPTORS = __webpack_require__(68);
68560var fastKey = __webpack_require__(220).fastKey;
68561var validate = __webpack_require__(228);
68562var SIZE = DESCRIPTORS ? '_s' : 'size';
68563
68564var getEntry = function (that, key) {
68565 // fast case
68566 var index = fastKey(key);
68567 var entry;
68568 if (index !== 'F') return that._i[index];
68569 // frozen object case
68570 for (entry = that._f; entry; entry = entry.n) {
68571 if (entry.k == key) return entry;
68572 }
68573};
68574
68575module.exports = {
68576 getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
68577 var C = wrapper(function (that, iterable) {
68578 anInstance(that, C, NAME, '_i');
68579 that._t = NAME; // collection type
68580 that._i = create(null); // index
68581 that._f = undefined; // first entry
68582 that._l = undefined; // last entry
68583 that[SIZE] = 0; // size
68584 if (iterable != undefined) forOf(iterable, IS_MAP, that[ADDER], that);
68585 });
68586 redefineAll(C.prototype, {
68587 // 23.1.3.1 Map.prototype.clear()
68588 // 23.2.3.2 Set.prototype.clear()
68589 clear: function clear() {
68590 for (var that = validate(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
68591 entry.r = true;
68592 if (entry.p) entry.p = entry.p.n = undefined;
68593 delete data[entry.i];
68594 }
68595 that._f = that._l = undefined;
68596 that[SIZE] = 0;
68597 },
68598 // 23.1.3.3 Map.prototype.delete(key)
68599 // 23.2.3.4 Set.prototype.delete(value)
68600 'delete': function (key) {
68601 var that = validate(this, NAME);
68602 var entry = getEntry(that, key);
68603 if (entry) {
68604 var next = entry.n;
68605 var prev = entry.p;
68606 delete that._i[entry.i];
68607 entry.r = true;
68608 if (prev) prev.n = next;
68609 if (next) next.p = prev;
68610 if (that._f == entry) that._f = next;
68611 if (that._l == entry) that._l = prev;
68612 that[SIZE]--;
68613 } return !!entry;
68614 },
68615 // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
68616 // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
68617 forEach: function forEach(callbackfn /* , that = undefined */) {
68618 validate(this, NAME);
68619 var f = ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
68620 var entry;
68621 while (entry = entry ? entry.n : this._f) {
68622 f(entry.v, entry.k, this);
68623 // revert to the last existing entry
68624 while (entry && entry.r) entry = entry.p;
68625 }
68626 },
68627 // 23.1.3.7 Map.prototype.has(key)
68628 // 23.2.3.7 Set.prototype.has(value)
68629 has: function has(key) {
68630 return !!getEntry(validate(this, NAME), key);
68631 }
68632 });
68633 if (DESCRIPTORS) dP(C.prototype, 'size', {
68634 get: function () {
68635 return validate(this, NAME)[SIZE];
68636 }
68637 });
68638 return C;
68639 },
68640 def: function (that, key, value) {
68641 var entry = getEntry(that, key);
68642 var prev, index;
68643 // change existing entry
68644 if (entry) {
68645 entry.v = value;
68646 // create new entry
68647 } else {
68648 that._l = entry = {
68649 i: index = fastKey(key, true), // <- index
68650 k: key, // <- key
68651 v: value, // <- value
68652 p: prev = that._l, // <- previous entry
68653 n: undefined, // <- next entry
68654 r: false // <- removed
68655 };
68656 if (!that._f) that._f = entry;
68657 if (prev) prev.n = entry;
68658 that[SIZE]++;
68659 // add to index
68660 if (index !== 'F') that._i[index] = entry;
68661 } return that;
68662 },
68663 getEntry: getEntry,
68664 setStrong: function (C, NAME, IS_MAP) {
68665 // add .keys, .values, .entries, [@@iterator]
68666 // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
68667 $iterDefine(C, NAME, function (iterated, kind) {
68668 this._t = validate(iterated, NAME); // target
68669 this._k = kind; // kind
68670 this._l = undefined; // previous
68671 }, function () {
68672 var that = this;
68673 var kind = that._k;
68674 var entry = that._l;
68675 // revert to the last existing entry
68676 while (entry && entry.r) entry = entry.p;
68677 // get next entry
68678 if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
68679 // or finish the iteration
68680 that._t = undefined;
68681 return step(1);
68682 }
68683 // return step by kind
68684 if (kind == 'keys') return step(0, entry.k);
68685 if (kind == 'values') return step(0, entry.v);
68686 return step(0, [entry.k, entry.v]);
68687 }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
68688
68689 // add [@@species], 23.1.2.2, 23.2.2.2
68690 setSpecies(NAME);
68691 }
68692};
68693
68694
68695/***/ }),
68696/* 325 */
68697/***/ (function(module, exports, __webpack_require__) {
68698
68699// https://github.com/DavidBruant/Map-Set.prototype.toJSON
68700var classof = __webpack_require__(214);
68701var from = __webpack_require__(606);
68702module.exports = function (NAME) {
68703 return function toJSON() {
68704 if (classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
68705 return from(this);
68706 };
68707};
68708
68709
68710/***/ }),
68711/* 326 */
68712/***/ (function(module, exports, __webpack_require__) {
68713
68714"use strict";
68715
68716var global = __webpack_require__(38);
68717var $export = __webpack_require__(33);
68718var meta = __webpack_require__(220);
68719var fails = __webpack_require__(76);
68720var hide = __webpack_require__(77);
68721var redefineAll = __webpack_require__(223);
68722var forOf = __webpack_require__(121);
68723var anInstance = __webpack_require__(213);
68724var isObject = __webpack_require__(49);
68725var setToStringTag = __webpack_require__(127);
68726var dP = __webpack_require__(63).f;
68727var each = __webpack_require__(608)(0);
68728var DESCRIPTORS = __webpack_require__(68);
68729
68730module.exports = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
68731 var Base = global[NAME];
68732 var C = Base;
68733 var ADDER = IS_MAP ? 'set' : 'add';
68734 var proto = C && C.prototype;
68735 var O = {};
68736 if (!DESCRIPTORS || typeof C != 'function' || !(IS_WEAK || proto.forEach && !fails(function () {
68737 new C().entries().next();
68738 }))) {
68739 // create collection constructor
68740 C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
68741 redefineAll(C.prototype, methods);
68742 meta.NEED = true;
68743 } else {
68744 C = wrapper(function (target, iterable) {
68745 anInstance(target, C, NAME, '_c');
68746 target._c = new Base();
68747 if (iterable != undefined) forOf(iterable, IS_MAP, target[ADDER], target);
68748 });
68749 each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {
68750 var IS_ADDER = KEY == 'add' || KEY == 'set';
68751 if (KEY in proto && !(IS_WEAK && KEY == 'clear')) hide(C.prototype, KEY, function (a, b) {
68752 anInstance(this, C, KEY);
68753 if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
68754 var result = this._c[KEY](a === 0 ? 0 : a, b);
68755 return IS_ADDER ? this : result;
68756 });
68757 });
68758 IS_WEAK || dP(C.prototype, 'size', {
68759 get: function () {
68760 return this._c.size;
68761 }
68762 });
68763 }
68764
68765 setToStringTag(C, NAME);
68766
68767 O[NAME] = C;
68768 $export($export.G + $export.W + $export.F, O);
68769
68770 if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
68771
68772 return C;
68773};
68774
68775
68776/***/ }),
68777/* 327 */
68778/***/ (function(module, exports, __webpack_require__) {
68779
68780var document = __webpack_require__(38).document;
68781module.exports = document && document.documentElement;
68782
68783
68784/***/ }),
68785/* 328 */
68786/***/ (function(module, exports, __webpack_require__) {
68787
68788module.exports = !__webpack_require__(68) && !__webpack_require__(76)(function () {
68789 return Object.defineProperty(__webpack_require__(216)('div'), 'a', { get: function () { return 7; } }).a != 7;
68790});
68791
68792
68793/***/ }),
68794/* 329 */
68795/***/ (function(module, exports) {
68796
68797// fast apply, http://jsperf.lnkit.com/fast-apply/5
68798module.exports = function (fn, args, that) {
68799 var un = that === undefined;
68800 switch (args.length) {
68801 case 0: return un ? fn()
68802 : fn.call(that);
68803 case 1: return un ? fn(args[0])
68804 : fn.call(that, args[0]);
68805 case 2: return un ? fn(args[0], args[1])
68806 : fn.call(that, args[0], args[1]);
68807 case 3: return un ? fn(args[0], args[1], args[2])
68808 : fn.call(that, args[0], args[1], args[2]);
68809 case 4: return un ? fn(args[0], args[1], args[2], args[3])
68810 : fn.call(that, args[0], args[1], args[2], args[3]);
68811 } return fn.apply(that, args);
68812};
68813
68814
68815/***/ }),
68816/* 330 */
68817/***/ (function(module, exports, __webpack_require__) {
68818
68819// check on default Array iterator
68820var Iterators = __webpack_require__(122);
68821var ITERATOR = __webpack_require__(44)('iterator');
68822var ArrayProto = Array.prototype;
68823
68824module.exports = function (it) {
68825 return it !== undefined && (Iterators.Array === it || ArrayProto[ITERATOR] === it);
68826};
68827
68828
68829/***/ }),
68830/* 331 */
68831/***/ (function(module, exports, __webpack_require__) {
68832
68833// 7.2.2 IsArray(argument)
68834var cof = __webpack_require__(120);
68835module.exports = Array.isArray || function isArray(arg) {
68836 return cof(arg) == 'Array';
68837};
68838
68839
68840/***/ }),
68841/* 332 */
68842/***/ (function(module, exports, __webpack_require__) {
68843
68844// call something on iterator step with safe closing on error
68845var anObject = __webpack_require__(58);
68846module.exports = function (iterator, fn, value, entries) {
68847 try {
68848 return entries ? fn(anObject(value)[0], value[1]) : fn(value);
68849 // 7.4.6 IteratorClose(iterator, completion)
68850 } catch (e) {
68851 var ret = iterator['return'];
68852 if (ret !== undefined) anObject(ret.call(iterator));
68853 throw e;
68854 }
68855};
68856
68857
68858/***/ }),
68859/* 333 */
68860/***/ (function(module, exports, __webpack_require__) {
68861
68862var ITERATOR = __webpack_require__(44)('iterator');
68863var SAFE_CLOSING = false;
68864
68865try {
68866 var riter = [7][ITERATOR]();
68867 riter['return'] = function () { SAFE_CLOSING = true; };
68868 // eslint-disable-next-line no-throw-literal
68869 Array.from(riter, function () { throw 2; });
68870} catch (e) { /* empty */ }
68871
68872module.exports = function (exec, skipClosing) {
68873 if (!skipClosing && !SAFE_CLOSING) return false;
68874 var safe = false;
68875 try {
68876 var arr = [7];
68877 var iter = arr[ITERATOR]();
68878 iter.next = function () { return { done: safe = true }; };
68879 arr[ITERATOR] = function () { return iter; };
68880 exec(arr);
68881 } catch (e) { /* empty */ }
68882 return safe;
68883};
68884
68885
68886/***/ }),
68887/* 334 */
68888/***/ (function(module, exports) {
68889
68890module.exports = function (done, value) {
68891 return { value: value, done: !!done };
68892};
68893
68894
68895/***/ }),
68896/* 335 */
68897/***/ (function(module, exports, __webpack_require__) {
68898
68899var pIE = __webpack_require__(125);
68900var createDesc = __webpack_require__(126);
68901var toIObject = __webpack_require__(90);
68902var toPrimitive = __webpack_require__(227);
68903var has = __webpack_require__(89);
68904var IE8_DOM_DEFINE = __webpack_require__(328);
68905var gOPD = Object.getOwnPropertyDescriptor;
68906
68907exports.f = __webpack_require__(68) ? gOPD : function getOwnPropertyDescriptor(O, P) {
68908 O = toIObject(O);
68909 P = toPrimitive(P, true);
68910 if (IE8_DOM_DEFINE) try {
68911 return gOPD(O, P);
68912 } catch (e) { /* empty */ }
68913 if (has(O, P)) return createDesc(!pIE.f.call(O, P), O[P]);
68914};
68915
68916
68917/***/ }),
68918/* 336 */
68919/***/ (function(module, exports, __webpack_require__) {
68920
68921// 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
68922var $keys = __webpack_require__(338);
68923var hiddenKeys = __webpack_require__(217).concat('length', 'prototype');
68924
68925exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
68926 return $keys(O, hiddenKeys);
68927};
68928
68929
68930/***/ }),
68931/* 337 */
68932/***/ (function(module, exports, __webpack_require__) {
68933
68934// 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
68935var has = __webpack_require__(89);
68936var toObject = __webpack_require__(103);
68937var IE_PROTO = __webpack_require__(224)('IE_PROTO');
68938var ObjectProto = Object.prototype;
68939
68940module.exports = Object.getPrototypeOf || function (O) {
68941 O = toObject(O);
68942 if (has(O, IE_PROTO)) return O[IE_PROTO];
68943 if (typeof O.constructor == 'function' && O instanceof O.constructor) {
68944 return O.constructor.prototype;
68945 } return O instanceof Object ? ObjectProto : null;
68946};
68947
68948
68949/***/ }),
68950/* 338 */
68951/***/ (function(module, exports, __webpack_require__) {
68952
68953var has = __webpack_require__(89);
68954var toIObject = __webpack_require__(90);
68955var arrayIndexOf = __webpack_require__(607)(false);
68956var IE_PROTO = __webpack_require__(224)('IE_PROTO');
68957
68958module.exports = function (object, names) {
68959 var O = toIObject(object);
68960 var i = 0;
68961 var result = [];
68962 var key;
68963 for (key in O) if (key != IE_PROTO) has(O, key) && result.push(key);
68964 // Don't enum bug & hidden keys
68965 while (names.length > i) if (has(O, key = names[i++])) {
68966 ~arrayIndexOf(result, key) || result.push(key);
68967 }
68968 return result;
68969};
68970
68971
68972/***/ }),
68973/* 339 */
68974/***/ (function(module, exports, __webpack_require__) {
68975
68976// most Object methods by ES6 should accept primitives
68977var $export = __webpack_require__(33);
68978var core = __webpack_require__(26);
68979var fails = __webpack_require__(76);
68980module.exports = function (KEY, exec) {
68981 var fn = (core.Object || {})[KEY] || Object[KEY];
68982 var exp = {};
68983 exp[KEY] = exec(fn);
68984 $export($export.S + $export.F * fails(function () { fn(1); }), 'Object', exp);
68985};
68986
68987
68988/***/ }),
68989/* 340 */
68990/***/ (function(module, exports) {
68991
68992module.exports = function (exec) {
68993 try {
68994 return { e: false, v: exec() };
68995 } catch (e) {
68996 return { e: true, v: e };
68997 }
68998};
68999
69000
69001/***/ }),
69002/* 341 */
69003/***/ (function(module, exports, __webpack_require__) {
69004
69005var anObject = __webpack_require__(58);
69006var isObject = __webpack_require__(49);
69007var newPromiseCapability = __webpack_require__(221);
69008
69009module.exports = function (C, x) {
69010 anObject(C);
69011 if (isObject(x) && x.constructor === C) return x;
69012 var promiseCapability = newPromiseCapability.f(C);
69013 var resolve = promiseCapability.resolve;
69014 resolve(x);
69015 return promiseCapability.promise;
69016};
69017
69018
69019/***/ }),
69020/* 342 */
69021/***/ (function(module, exports, __webpack_require__) {
69022
69023module.exports = __webpack_require__(77);
69024
69025
69026/***/ }),
69027/* 343 */
69028/***/ (function(module, exports, __webpack_require__) {
69029
69030"use strict";
69031
69032// https://tc39.github.io/proposal-setmap-offrom/
69033var $export = __webpack_require__(33);
69034var aFunction = __webpack_require__(88);
69035var ctx = __webpack_require__(67);
69036var forOf = __webpack_require__(121);
69037
69038module.exports = function (COLLECTION) {
69039 $export($export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
69040 var mapFn = arguments[1];
69041 var mapping, A, n, cb;
69042 aFunction(this);
69043 mapping = mapFn !== undefined;
69044 if (mapping) aFunction(mapFn);
69045 if (source == undefined) return new this();
69046 A = [];
69047 if (mapping) {
69048 n = 0;
69049 cb = ctx(mapFn, arguments[2], 2);
69050 forOf(source, false, function (nextItem) {
69051 A.push(cb(nextItem, n++));
69052 });
69053 } else {
69054 forOf(source, false, A.push, A);
69055 }
69056 return new this(A);
69057 } });
69058};
69059
69060
69061/***/ }),
69062/* 344 */
69063/***/ (function(module, exports, __webpack_require__) {
69064
69065"use strict";
69066
69067// https://tc39.github.io/proposal-setmap-offrom/
69068var $export = __webpack_require__(33);
69069
69070module.exports = function (COLLECTION) {
69071 $export($export.S, COLLECTION, { of: function of() {
69072 var length = arguments.length;
69073 var A = new Array(length);
69074 while (length--) A[length] = arguments[length];
69075 return new this(A);
69076 } });
69077};
69078
69079
69080/***/ }),
69081/* 345 */
69082/***/ (function(module, exports, __webpack_require__) {
69083
69084"use strict";
69085
69086var global = __webpack_require__(38);
69087var core = __webpack_require__(26);
69088var dP = __webpack_require__(63);
69089var DESCRIPTORS = __webpack_require__(68);
69090var SPECIES = __webpack_require__(44)('species');
69091
69092module.exports = function (KEY) {
69093 var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY];
69094 if (DESCRIPTORS && C && !C[SPECIES]) dP.f(C, SPECIES, {
69095 configurable: true,
69096 get: function () { return this; }
69097 });
69098};
69099
69100
69101/***/ }),
69102/* 346 */
69103/***/ (function(module, exports, __webpack_require__) {
69104
69105// 7.3.20 SpeciesConstructor(O, defaultConstructor)
69106var anObject = __webpack_require__(58);
69107var aFunction = __webpack_require__(88);
69108var SPECIES = __webpack_require__(44)('species');
69109module.exports = function (O, D) {
69110 var C = anObject(O).constructor;
69111 var S;
69112 return C === undefined || (S = anObject(C)[SPECIES]) == undefined ? D : aFunction(S);
69113};
69114
69115
69116/***/ }),
69117/* 347 */
69118/***/ (function(module, exports, __webpack_require__) {
69119
69120var ctx = __webpack_require__(67);
69121var invoke = __webpack_require__(329);
69122var html = __webpack_require__(327);
69123var cel = __webpack_require__(216);
69124var global = __webpack_require__(38);
69125var process = global.process;
69126var setTask = global.setImmediate;
69127var clearTask = global.clearImmediate;
69128var MessageChannel = global.MessageChannel;
69129var Dispatch = global.Dispatch;
69130var counter = 0;
69131var queue = {};
69132var ONREADYSTATECHANGE = 'onreadystatechange';
69133var defer, channel, port;
69134var run = function () {
69135 var id = +this;
69136 // eslint-disable-next-line no-prototype-builtins
69137 if (queue.hasOwnProperty(id)) {
69138 var fn = queue[id];
69139 delete queue[id];
69140 fn();
69141 }
69142};
69143var listener = function (event) {
69144 run.call(event.data);
69145};
69146// Node.js 0.9+ & IE10+ has setImmediate, otherwise:
69147if (!setTask || !clearTask) {
69148 setTask = function setImmediate(fn) {
69149 var args = [];
69150 var i = 1;
69151 while (arguments.length > i) args.push(arguments[i++]);
69152 queue[++counter] = function () {
69153 // eslint-disable-next-line no-new-func
69154 invoke(typeof fn == 'function' ? fn : Function(fn), args);
69155 };
69156 defer(counter);
69157 return counter;
69158 };
69159 clearTask = function clearImmediate(id) {
69160 delete queue[id];
69161 };
69162 // Node.js 0.8-
69163 if (__webpack_require__(120)(process) == 'process') {
69164 defer = function (id) {
69165 process.nextTick(ctx(run, id, 1));
69166 };
69167 // Sphere (JS game engine) Dispatch API
69168 } else if (Dispatch && Dispatch.now) {
69169 defer = function (id) {
69170 Dispatch.now(ctx(run, id, 1));
69171 };
69172 // Browsers with MessageChannel, includes WebWorkers
69173 } else if (MessageChannel) {
69174 channel = new MessageChannel();
69175 port = channel.port2;
69176 channel.port1.onmessage = listener;
69177 defer = ctx(port.postMessage, port, 1);
69178 // Browsers with postMessage, skip WebWorkers
69179 // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
69180 } else if (global.addEventListener && typeof postMessage == 'function' && !global.importScripts) {
69181 defer = function (id) {
69182 global.postMessage(id + '', '*');
69183 };
69184 global.addEventListener('message', listener, false);
69185 // IE8-
69186 } else if (ONREADYSTATECHANGE in cel('script')) {
69187 defer = function (id) {
69188 html.appendChild(cel('script'))[ONREADYSTATECHANGE] = function () {
69189 html.removeChild(this);
69190 run.call(id);
69191 };
69192 };
69193 // Rest old browsers
69194 } else {
69195 defer = function (id) {
69196 setTimeout(ctx(run, id, 1), 0);
69197 };
69198 }
69199}
69200module.exports = {
69201 set: setTask,
69202 clear: clearTask
69203};
69204
69205
69206/***/ }),
69207/* 348 */
69208/***/ (function(module, exports, __webpack_require__) {
69209
69210
69211/**
69212 * This is the common logic for both the Node.js and web browser
69213 * implementations of `debug()`.
69214 *
69215 * Expose `debug()` as the module.
69216 */
69217
69218exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
69219exports.coerce = coerce;
69220exports.disable = disable;
69221exports.enable = enable;
69222exports.enabled = enabled;
69223exports.humanize = __webpack_require__(833);
69224
69225/**
69226 * Active `debug` instances.
69227 */
69228exports.instances = [];
69229
69230/**
69231 * The currently active debug mode names, and names to skip.
69232 */
69233
69234exports.names = [];
69235exports.skips = [];
69236
69237/**
69238 * Map of special "%n" handling functions, for the debug "format" argument.
69239 *
69240 * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
69241 */
69242
69243exports.formatters = {};
69244
69245/**
69246 * Select a color.
69247 * @param {String} namespace
69248 * @return {Number}
69249 * @api private
69250 */
69251
69252function selectColor(namespace) {
69253 var hash = 0, i;
69254
69255 for (i in namespace) {
69256 hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
69257 hash |= 0; // Convert to 32bit integer
69258 }
69259
69260 return exports.colors[Math.abs(hash) % exports.colors.length];
69261}
69262
69263/**
69264 * Create a debugger with the given `namespace`.
69265 *
69266 * @param {String} namespace
69267 * @return {Function}
69268 * @api public
69269 */
69270
69271function createDebug(namespace) {
69272
69273 var prevTime;
69274
69275 function debug() {
69276 // disabled?
69277 if (!debug.enabled) return;
69278
69279 var self = debug;
69280
69281 // set `diff` timestamp
69282 var curr = +new Date();
69283 var ms = curr - (prevTime || curr);
69284 self.diff = ms;
69285 self.prev = prevTime;
69286 self.curr = curr;
69287 prevTime = curr;
69288
69289 // turn the `arguments` into a proper Array
69290 var args = new Array(arguments.length);
69291 for (var i = 0; i < args.length; i++) {
69292 args[i] = arguments[i];
69293 }
69294
69295 args[0] = exports.coerce(args[0]);
69296
69297 if ('string' !== typeof args[0]) {
69298 // anything else let's inspect with %O
69299 args.unshift('%O');
69300 }
69301
69302 // apply any `formatters` transformations
69303 var index = 0;
69304 args[0] = args[0].replace(/%([a-zA-Z%])/g, function(match, format) {
69305 // if we encounter an escaped % then don't increase the array index
69306 if (match === '%%') return match;
69307 index++;
69308 var formatter = exports.formatters[format];
69309 if ('function' === typeof formatter) {
69310 var val = args[index];
69311 match = formatter.call(self, val);
69312
69313 // now we need to remove `args[index]` since it's inlined in the `format`
69314 args.splice(index, 1);
69315 index--;
69316 }
69317 return match;
69318 });
69319
69320 // apply env-specific formatting (colors, etc.)
69321 exports.formatArgs.call(self, args);
69322
69323 var logFn = debug.log || exports.log || console.log.bind(console);
69324 logFn.apply(self, args);
69325 }
69326
69327 debug.namespace = namespace;
69328 debug.enabled = exports.enabled(namespace);
69329 debug.useColors = exports.useColors();
69330 debug.color = selectColor(namespace);
69331 debug.destroy = destroy;
69332
69333 // env-specific initialization logic for debug instances
69334 if ('function' === typeof exports.init) {
69335 exports.init(debug);
69336 }
69337
69338 exports.instances.push(debug);
69339
69340 return debug;
69341}
69342
69343function destroy () {
69344 var index = exports.instances.indexOf(this);
69345 if (index !== -1) {
69346 exports.instances.splice(index, 1);
69347 return true;
69348 } else {
69349 return false;
69350 }
69351}
69352
69353/**
69354 * Enables a debug mode by namespaces. This can include modes
69355 * separated by a colon and wildcards.
69356 *
69357 * @param {String} namespaces
69358 * @api public
69359 */
69360
69361function enable(namespaces) {
69362 exports.save(namespaces);
69363
69364 exports.names = [];
69365 exports.skips = [];
69366
69367 var i;
69368 var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
69369 var len = split.length;
69370
69371 for (i = 0; i < len; i++) {
69372 if (!split[i]) continue; // ignore empty strings
69373 namespaces = split[i].replace(/\*/g, '.*?');
69374 if (namespaces[0] === '-') {
69375 exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
69376 } else {
69377 exports.names.push(new RegExp('^' + namespaces + '$'));
69378 }
69379 }
69380
69381 for (i = 0; i < exports.instances.length; i++) {
69382 var instance = exports.instances[i];
69383 instance.enabled = exports.enabled(instance.namespace);
69384 }
69385}
69386
69387/**
69388 * Disable debug output.
69389 *
69390 * @api public
69391 */
69392
69393function disable() {
69394 exports.enable('');
69395}
69396
69397/**
69398 * Returns true if the given mode name is enabled, false otherwise.
69399 *
69400 * @param {String} name
69401 * @return {Boolean}
69402 * @api public
69403 */
69404
69405function enabled(name) {
69406 if (name[name.length - 1] === '*') {
69407 return true;
69408 }
69409 var i, len;
69410 for (i = 0, len = exports.skips.length; i < len; i++) {
69411 if (exports.skips[i].test(name)) {
69412 return false;
69413 }
69414 }
69415 for (i = 0, len = exports.names.length; i < len; i++) {
69416 if (exports.names[i].test(name)) {
69417 return true;
69418 }
69419 }
69420 return false;
69421}
69422
69423/**
69424 * Coerce `val`.
69425 *
69426 * @param {Mixed} val
69427 * @return {Mixed}
69428 * @api private
69429 */
69430
69431function coerce(val) {
69432 if (val instanceof Error) return val.stack || val.message;
69433 return val;
69434}
69435
69436
69437/***/ }),
69438/* 349 */
69439/***/ (function(module, exports, __webpack_require__) {
69440
69441var stream = __webpack_require__(91)
69442var eos = __webpack_require__(164)
69443var inherits = __webpack_require__(78)
69444var shift = __webpack_require__(1015)
69445
69446var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from)
69447 ? Buffer.from([0])
69448 : new Buffer([0])
69449
69450var onuncork = function(self, fn) {
69451 if (self._corked) self.once('uncork', fn)
69452 else fn()
69453}
69454
69455var autoDestroy = function (self, err) {
69456 if (self._autoDestroy) self.destroy(err)
69457}
69458
69459var destroyer = function(self, end) {
69460 return function(err) {
69461 if (err) autoDestroy(self, err.message === 'premature close' ? null : err)
69462 else if (end && !self._ended) self.end()
69463 }
69464}
69465
69466var end = function(ws, fn) {
69467 if (!ws) return fn()
69468 if (ws._writableState && ws._writableState.finished) return fn()
69469 if (ws._writableState) return ws.end(fn)
69470 ws.end()
69471 fn()
69472}
69473
69474var toStreams2 = function(rs) {
69475 return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs)
69476}
69477
69478var Duplexify = function(writable, readable, opts) {
69479 if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts)
69480 stream.Duplex.call(this, opts)
69481
69482 this._writable = null
69483 this._readable = null
69484 this._readable2 = null
69485
69486 this._autoDestroy = !opts || opts.autoDestroy !== false
69487 this._forwardDestroy = !opts || opts.destroy !== false
69488 this._forwardEnd = !opts || opts.end !== false
69489 this._corked = 1 // start corked
69490 this._ondrain = null
69491 this._drained = false
69492 this._forwarding = false
69493 this._unwrite = null
69494 this._unread = null
69495 this._ended = false
69496
69497 this.destroyed = false
69498
69499 if (writable) this.setWritable(writable)
69500 if (readable) this.setReadable(readable)
69501}
69502
69503inherits(Duplexify, stream.Duplex)
69504
69505Duplexify.obj = function(writable, readable, opts) {
69506 if (!opts) opts = {}
69507 opts.objectMode = true
69508 opts.highWaterMark = 16
69509 return new Duplexify(writable, readable, opts)
69510}
69511
69512Duplexify.prototype.cork = function() {
69513 if (++this._corked === 1) this.emit('cork')
69514}
69515
69516Duplexify.prototype.uncork = function() {
69517 if (this._corked && --this._corked === 0) this.emit('uncork')
69518}
69519
69520Duplexify.prototype.setWritable = function(writable) {
69521 if (this._unwrite) this._unwrite()
69522
69523 if (this.destroyed) {
69524 if (writable && writable.destroy) writable.destroy()
69525 return
69526 }
69527
69528 if (writable === null || writable === false) {
69529 this.end()
69530 return
69531 }
69532
69533 var self = this
69534 var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd))
69535
69536 var ondrain = function() {
69537 var ondrain = self._ondrain
69538 self._ondrain = null
69539 if (ondrain) ondrain()
69540 }
69541
69542 var clear = function() {
69543 self._writable.removeListener('drain', ondrain)
69544 unend()
69545 }
69546
69547 if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks
69548
69549 this._writable = writable
69550 this._writable.on('drain', ondrain)
69551 this._unwrite = clear
69552
69553 this.uncork() // always uncork setWritable
69554}
69555
69556Duplexify.prototype.setReadable = function(readable) {
69557 if (this._unread) this._unread()
69558
69559 if (this.destroyed) {
69560 if (readable && readable.destroy) readable.destroy()
69561 return
69562 }
69563
69564 if (readable === null || readable === false) {
69565 this.push(null)
69566 this.resume()
69567 return
69568 }
69569
69570 var self = this
69571 var unend = eos(readable, {writable:false, readable:true}, destroyer(this))
69572
69573 var onreadable = function() {
69574 self._forward()
69575 }
69576
69577 var onend = function() {
69578 self.push(null)
69579 }
69580
69581 var clear = function() {
69582 self._readable2.removeListener('readable', onreadable)
69583 self._readable2.removeListener('end', onend)
69584 unend()
69585 }
69586
69587 this._drained = true
69588 this._readable = readable
69589 this._readable2 = readable._readableState ? readable : toStreams2(readable)
69590 this._readable2.on('readable', onreadable)
69591 this._readable2.on('end', onend)
69592 this._unread = clear
69593
69594 this._forward()
69595}
69596
69597Duplexify.prototype._read = function() {
69598 this._drained = true
69599 this._forward()
69600}
69601
69602Duplexify.prototype._forward = function() {
69603 if (this._forwarding || !this._readable2 || !this._drained) return
69604 this._forwarding = true
69605
69606 var data
69607
69608 while (this._drained && (data = shift(this._readable2)) !== null) {
69609 if (this.destroyed) continue
69610 this._drained = this.push(data)
69611 }
69612
69613 this._forwarding = false
69614}
69615
69616Duplexify.prototype.destroy = function(err) {
69617 if (this.destroyed) return
69618 this.destroyed = true
69619
69620 var self = this
69621 process.nextTick(function() {
69622 self._destroy(err)
69623 })
69624}
69625
69626Duplexify.prototype._destroy = function(err) {
69627 if (err) {
69628 var ondrain = this._ondrain
69629 this._ondrain = null
69630 if (ondrain) ondrain(err)
69631 else this.emit('error', err)
69632 }
69633
69634 if (this._forwardDestroy) {
69635 if (this._readable && this._readable.destroy) this._readable.destroy()
69636 if (this._writable && this._writable.destroy) this._writable.destroy()
69637 }
69638
69639 this.emit('close')
69640}
69641
69642Duplexify.prototype._write = function(data, enc, cb) {
69643 if (this.destroyed) return cb()
69644 if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb))
69645 if (data === SIGNAL_FLUSH) return this._finish(cb)
69646 if (!this._writable) return cb()
69647
69648 if (this._writable.write(data) === false) this._ondrain = cb
69649 else cb()
69650}
69651
69652
69653Duplexify.prototype._finish = function(cb) {
69654 var self = this
69655 this.emit('preend')
69656 onuncork(this, function() {
69657 end(self._forwardEnd && self._writable, function() {
69658 // haxx to not emit prefinish twice
69659 if (self._writableState.prefinished === false) self._writableState.prefinished = true
69660 self.emit('prefinish')
69661 onuncork(self, cb)
69662 })
69663 })
69664}
69665
69666Duplexify.prototype.end = function(data, enc, cb) {
69667 if (typeof data === 'function') return this.end(null, null, data)
69668 if (typeof enc === 'function') return this.end(data, null, enc)
69669 this._ended = true
69670 if (data) this.write(data)
69671 if (!this._writableState.ending) this.write(SIGNAL_FLUSH)
69672 return stream.Writable.prototype.end.call(this, cb)
69673}
69674
69675module.exports = Duplexify
69676
69677
69678/***/ }),
69679/* 350 */
69680/***/ (function(module, exports, __webpack_require__) {
69681
69682var crypto = __webpack_require__(21);
69683var BigInteger = __webpack_require__(79).BigInteger;
69684var ECPointFp = __webpack_require__(129).ECPointFp;
69685var Buffer = __webpack_require__(20).Buffer;
69686exports.ECCurves = __webpack_require__(661);
69687
69688// zero prepad
69689function unstupid(hex,len)
69690{
69691 return (hex.length >= len) ? hex : unstupid("0"+hex,len);
69692}
69693
69694exports.ECKey = function(curve, key, isPublic)
69695{
69696 var priv;
69697 var c = curve();
69698 var n = c.getN();
69699 var bytes = Math.floor(n.bitLength()/8);
69700
69701 if(key)
69702 {
69703 if(isPublic)
69704 {
69705 var curve = c.getCurve();
69706// var x = key.slice(1,bytes+1); // skip the 04 for uncompressed format
69707// var y = key.slice(bytes+1);
69708// this.P = new ECPointFp(curve,
69709// curve.fromBigInteger(new BigInteger(x.toString("hex"), 16)),
69710// curve.fromBigInteger(new BigInteger(y.toString("hex"), 16)));
69711 this.P = curve.decodePointHex(key.toString("hex"));
69712 }else{
69713 if(key.length != bytes) return false;
69714 priv = new BigInteger(key.toString("hex"), 16);
69715 }
69716 }else{
69717 var n1 = n.subtract(BigInteger.ONE);
69718 var r = new BigInteger(crypto.randomBytes(n.bitLength()));
69719 priv = r.mod(n1).add(BigInteger.ONE);
69720 this.P = c.getG().multiply(priv);
69721 }
69722 if(this.P)
69723 {
69724// var pubhex = unstupid(this.P.getX().toBigInteger().toString(16),bytes*2)+unstupid(this.P.getY().toBigInteger().toString(16),bytes*2);
69725// this.PublicKey = Buffer.from("04"+pubhex,"hex");
69726 this.PublicKey = Buffer.from(c.getCurve().encodeCompressedPointHex(this.P),"hex");
69727 }
69728 if(priv)
69729 {
69730 this.PrivateKey = Buffer.from(unstupid(priv.toString(16),bytes*2),"hex");
69731 this.deriveSharedSecret = function(key)
69732 {
69733 if(!key || !key.P) return false;
69734 var S = key.P.multiply(priv);
69735 return Buffer.from(unstupid(S.getX().toBigInteger().toString(16),bytes*2),"hex");
69736 }
69737 }
69738}
69739
69740
69741
69742/***/ }),
69743/* 351 */
69744/***/ (function(module, exports, __webpack_require__) {
69745
69746"use strict";
69747
69748
69749var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
69750
69751module.exports = function (str) {
69752 if (typeof str !== 'string') {
69753 throw new TypeError('Expected a string');
69754 }
69755
69756 return str.replace(matchOperatorsRe, '\\$&');
69757};
69758
69759
69760/***/ }),
69761/* 352 */
69762/***/ (function(module, exports, __webpack_require__) {
69763
69764"use strict";
69765
69766
69767module.exports = function (data, opts) {
69768 if (!opts) opts = {};
69769 if (typeof opts === 'function') opts = { cmp: opts };
69770 var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;
69771
69772 var cmp = opts.cmp && (function (f) {
69773 return function (node) {
69774 return function (a, b) {
69775 var aobj = { key: a, value: node[a] };
69776 var bobj = { key: b, value: node[b] };
69777 return f(aobj, bobj);
69778 };
69779 };
69780 })(opts.cmp);
69781
69782 var seen = [];
69783 return (function stringify (node) {
69784 if (node && node.toJSON && typeof node.toJSON === 'function') {
69785 node = node.toJSON();
69786 }
69787
69788 if (node === undefined) return;
69789 if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';
69790 if (typeof node !== 'object') return JSON.stringify(node);
69791
69792 var i, out;
69793 if (Array.isArray(node)) {
69794 out = '[';
69795 for (i = 0; i < node.length; i++) {
69796 if (i) out += ',';
69797 out += stringify(node[i]) || 'null';
69798 }
69799 return out + ']';
69800 }
69801
69802 if (node === null) return 'null';
69803
69804 if (seen.indexOf(node) !== -1) {
69805 if (cycles) return JSON.stringify('__cycle__');
69806 throw new TypeError('Converting circular structure to JSON');
69807 }
69808
69809 var seenIndex = seen.push(node) - 1;
69810 var keys = Object.keys(node).sort(cmp && cmp(node));
69811 out = '';
69812 for (i = 0; i < keys.length; i++) {
69813 var key = keys[i];
69814 var value = stringify(node[key]);
69815
69816 if (!value) continue;
69817 if (out) out += ',';
69818 out += JSON.stringify(key) + ':' + value;
69819 }
69820 seen.splice(seenIndex, 1);
69821 return '{' + out + '}';
69822 })(data);
69823};
69824
69825
69826/***/ }),
69827/* 353 */
69828/***/ (function(module, exports, __webpack_require__) {
69829
69830module.exports = realpath
69831realpath.realpath = realpath
69832realpath.sync = realpathSync
69833realpath.realpathSync = realpathSync
69834realpath.monkeypatch = monkeypatch
69835realpath.unmonkeypatch = unmonkeypatch
69836
69837var fs = __webpack_require__(12)
69838var origRealpath = fs.realpath
69839var origRealpathSync = fs.realpathSync
69840
69841var version = process.version
69842var ok = /^v[0-5]\./.test(version)
69843var old = __webpack_require__(676)
69844
69845function newError (er) {
69846 return er && er.syscall === 'realpath' && (
69847 er.code === 'ELOOP' ||
69848 er.code === 'ENOMEM' ||
69849 er.code === 'ENAMETOOLONG'
69850 )
69851}
69852
69853function realpath (p, cache, cb) {
69854 if (ok) {
69855 return origRealpath(p, cache, cb)
69856 }
69857
69858 if (typeof cache === 'function') {
69859 cb = cache
69860 cache = null
69861 }
69862 origRealpath(p, cache, function (er, result) {
69863 if (newError(er)) {
69864 old.realpath(p, cache, cb)
69865 } else {
69866 cb(er, result)
69867 }
69868 })
69869}
69870
69871function realpathSync (p, cache) {
69872 if (ok) {
69873 return origRealpathSync(p, cache)
69874 }
69875
69876 try {
69877 return origRealpathSync(p, cache)
69878 } catch (er) {
69879 if (newError(er)) {
69880 return old.realpathSync(p, cache)
69881 } else {
69882 throw er
69883 }
69884 }
69885}
69886
69887function monkeypatch () {
69888 fs.realpath = realpath
69889 fs.realpathSync = realpathSync
69890}
69891
69892function unmonkeypatch () {
69893 fs.realpath = origRealpath
69894 fs.realpathSync = origRealpathSync
69895}
69896
69897
69898/***/ }),
69899/* 354 */
69900/***/ (function(module, exports, __webpack_require__) {
69901
69902exports.alphasort = alphasort
69903exports.alphasorti = alphasorti
69904exports.setopts = setopts
69905exports.ownProp = ownProp
69906exports.makeAbs = makeAbs
69907exports.finish = finish
69908exports.mark = mark
69909exports.isIgnored = isIgnored
69910exports.childrenIgnored = childrenIgnored
69911
69912function ownProp (obj, field) {
69913 return Object.prototype.hasOwnProperty.call(obj, field)
69914}
69915
69916var path = __webpack_require__(1)
69917var minimatch = __webpack_require__(170)
69918var isAbsolute = __webpack_require__(245)
69919var Minimatch = minimatch.Minimatch
69920
69921function alphasorti (a, b) {
69922 return a.toLowerCase().localeCompare(b.toLowerCase())
69923}
69924
69925function alphasort (a, b) {
69926 return a.localeCompare(b)
69927}
69928
69929function setupIgnores (self, options) {
69930 self.ignore = options.ignore || []
69931
69932 if (!Array.isArray(self.ignore))
69933 self.ignore = [self.ignore]
69934
69935 if (self.ignore.length) {
69936 self.ignore = self.ignore.map(ignoreMap)
69937 }
69938}
69939
69940// ignore patterns are always in dot:true mode.
69941function ignoreMap (pattern) {
69942 var gmatcher = null
69943 if (pattern.slice(-3) === '/**') {
69944 var gpattern = pattern.replace(/(\/\*\*)+$/, '')
69945 gmatcher = new Minimatch(gpattern, { dot: true })
69946 }
69947
69948 return {
69949 matcher: new Minimatch(pattern, { dot: true }),
69950 gmatcher: gmatcher
69951 }
69952}
69953
69954function setopts (self, pattern, options) {
69955 if (!options)
69956 options = {}
69957
69958 // base-matching: just use globstar for that.
69959 if (options.matchBase && -1 === pattern.indexOf("/")) {
69960 if (options.noglobstar) {
69961 throw new Error("base matching requires globstar")
69962 }
69963 pattern = "**/" + pattern
69964 }
69965
69966 self.silent = !!options.silent
69967 self.pattern = pattern
69968 self.strict = options.strict !== false
69969 self.realpath = !!options.realpath
69970 self.realpathCache = options.realpathCache || Object.create(null)
69971 self.follow = !!options.follow
69972 self.dot = !!options.dot
69973 self.mark = !!options.mark
69974 self.nodir = !!options.nodir
69975 if (self.nodir)
69976 self.mark = true
69977 self.sync = !!options.sync
69978 self.nounique = !!options.nounique
69979 self.nonull = !!options.nonull
69980 self.nosort = !!options.nosort
69981 self.nocase = !!options.nocase
69982 self.stat = !!options.stat
69983 self.noprocess = !!options.noprocess
69984 self.absolute = !!options.absolute
69985
69986 self.maxLength = options.maxLength || Infinity
69987 self.cache = options.cache || Object.create(null)
69988 self.statCache = options.statCache || Object.create(null)
69989 self.symlinks = options.symlinks || Object.create(null)
69990
69991 setupIgnores(self, options)
69992
69993 self.changedCwd = false
69994 var cwd = process.cwd()
69995 if (!ownProp(options, "cwd"))
69996 self.cwd = cwd
69997 else {
69998 self.cwd = path.resolve(options.cwd)
69999 self.changedCwd = self.cwd !== cwd
70000 }
70001
70002 self.root = options.root || path.resolve(self.cwd, "/")
70003 self.root = path.resolve(self.root)
70004 if (process.platform === "win32")
70005 self.root = self.root.replace(/\\/g, "/")
70006
70007 // TODO: is an absolute `cwd` supposed to be resolved against `root`?
70008 // e.g. { cwd: '/test', root: __dirname } === path.join(__dirname, '/test')
70009 self.cwdAbs = isAbsolute(self.cwd) ? self.cwd : makeAbs(self, self.cwd)
70010 if (process.platform === "win32")
70011 self.cwdAbs = self.cwdAbs.replace(/\\/g, "/")
70012 self.nomount = !!options.nomount
70013
70014 // disable comments and negation in Minimatch.
70015 // Note that they are not supported in Glob itself anyway.
70016 options.nonegate = true
70017 options.nocomment = true
70018
70019 self.minimatch = new Minimatch(pattern, options)
70020 self.options = self.minimatch.options
70021}
70022
70023function finish (self) {
70024 var nou = self.nounique
70025 var all = nou ? [] : Object.create(null)
70026
70027 for (var i = 0, l = self.matches.length; i < l; i ++) {
70028 var matches = self.matches[i]
70029 if (!matches || Object.keys(matches).length === 0) {
70030 if (self.nonull) {
70031 // do like the shell, and spit out the literal glob
70032 var literal = self.minimatch.globSet[i]
70033 if (nou)
70034 all.push(literal)
70035 else
70036 all[literal] = true
70037 }
70038 } else {
70039 // had matches
70040 var m = Object.keys(matches)
70041 if (nou)
70042 all.push.apply(all, m)
70043 else
70044 m.forEach(function (m) {
70045 all[m] = true
70046 })
70047 }
70048 }
70049
70050 if (!nou)
70051 all = Object.keys(all)
70052
70053 if (!self.nosort)
70054 all = all.sort(self.nocase ? alphasorti : alphasort)
70055
70056 // at *some* point we statted all of these
70057 if (self.mark) {
70058 for (var i = 0; i < all.length; i++) {
70059 all[i] = self._mark(all[i])
70060 }
70061 if (self.nodir) {
70062 all = all.filter(function (e) {
70063 var notDir = !(/\/$/.test(e))
70064 var c = self.cache[e] || self.cache[makeAbs(self, e)]
70065 if (notDir && c)
70066 notDir = c !== 'DIR' && !Array.isArray(c)
70067 return notDir
70068 })
70069 }
70070 }
70071
70072 if (self.ignore.length)
70073 all = all.filter(function(m) {
70074 return !isIgnored(self, m)
70075 })
70076
70077 self.found = all
70078}
70079
70080function mark (self, p) {
70081 var abs = makeAbs(self, p)
70082 var c = self.cache[abs]
70083 var m = p
70084 if (c) {
70085 var isDir = c === 'DIR' || Array.isArray(c)
70086 var slash = p.slice(-1) === '/'
70087
70088 if (isDir && !slash)
70089 m += '/'
70090 else if (!isDir && slash)
70091 m = m.slice(0, -1)
70092
70093 if (m !== p) {
70094 var mabs = makeAbs(self, m)
70095 self.statCache[mabs] = self.statCache[abs]
70096 self.cache[mabs] = self.cache[abs]
70097 }
70098 }
70099
70100 return m
70101}
70102
70103// lotta situps...
70104function makeAbs (self, f) {
70105 var abs = f
70106 if (f.charAt(0) === '/') {
70107 abs = path.join(self.root, f)
70108 } else if (isAbsolute(f) || f === '') {
70109 abs = f
70110 } else if (self.changedCwd) {
70111 abs = path.resolve(self.cwd, f)
70112 } else {
70113 abs = path.resolve(f)
70114 }
70115
70116 if (process.platform === 'win32')
70117 abs = abs.replace(/\\/g, '/')
70118
70119 return abs
70120}
70121
70122
70123// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
70124// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
70125function isIgnored (self, path) {
70126 if (!self.ignore.length)
70127 return false
70128
70129 return self.ignore.some(function(item) {
70130 return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
70131 })
70132}
70133
70134function childrenIgnored (self, path) {
70135 if (!self.ignore.length)
70136 return false
70137
70138 return self.ignore.some(function(item) {
70139 return !!(item.gmatcher && item.gmatcher.match(path))
70140 })
70141}
70142
70143
70144/***/ }),
70145/* 355 */
70146/***/ (function(module, exports, __webpack_require__) {
70147
70148"use strict";
70149
70150
70151var fs = __webpack_require__(12)
70152
70153module.exports = clone(fs)
70154
70155function clone (obj) {
70156 if (obj === null || typeof obj !== 'object')
70157 return obj
70158
70159 if (obj instanceof Object)
70160 var copy = { __proto__: obj.__proto__ }
70161 else
70162 var copy = Object.create(null)
70163
70164 Object.getOwnPropertyNames(obj).forEach(function (key) {
70165 Object.defineProperty(copy, key, Object.getOwnPropertyDescriptor(obj, key))
70166 })
70167
70168 return copy
70169}
70170
70171
70172/***/ }),
70173/* 356 */
70174/***/ (function(module, exports, __webpack_require__) {
70175
70176var fs = __webpack_require__(12)
70177var polyfills = __webpack_require__(681)
70178var legacy = __webpack_require__(680)
70179var queue = []
70180
70181var util = __webpack_require__(9)
70182
70183function noop () {}
70184
70185var debug = noop
70186if (util.debuglog)
70187 debug = util.debuglog('gfs4')
70188else if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || ''))
70189 debug = function() {
70190 var m = util.format.apply(util, arguments)
70191 m = 'GFS4: ' + m.split(/\n/).join('\nGFS4: ')
70192 console.error(m)
70193 }
70194
70195if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) {
70196 process.on('exit', function() {
70197 debug(queue)
70198 __webpack_require__(50).equal(queue.length, 0)
70199 })
70200}
70201
70202module.exports = patch(__webpack_require__(355))
70203if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) {
70204 module.exports = patch(fs)
70205}
70206
70207// Always patch fs.close/closeSync, because we want to
70208// retry() whenever a close happens *anywhere* in the program.
70209// This is essential when multiple graceful-fs instances are
70210// in play at the same time.
70211module.exports.close =
70212fs.close = (function (fs$close) { return function (fd, cb) {
70213 return fs$close.call(fs, fd, function (err) {
70214 if (!err)
70215 retry()
70216
70217 if (typeof cb === 'function')
70218 cb.apply(this, arguments)
70219 })
70220}})(fs.close)
70221
70222module.exports.closeSync =
70223fs.closeSync = (function (fs$closeSync) { return function (fd) {
70224 // Note that graceful-fs also retries when fs.closeSync() fails.
70225 // Looks like a bug to me, although it's probably a harmless one.
70226 var rval = fs$closeSync.apply(fs, arguments)
70227 retry()
70228 return rval
70229}})(fs.closeSync)
70230
70231function patch (fs) {
70232 // Everything that references the open() function needs to be in here
70233 polyfills(fs)
70234 fs.gracefulify = patch
70235 fs.FileReadStream = ReadStream; // Legacy name.
70236 fs.FileWriteStream = WriteStream; // Legacy name.
70237 fs.createReadStream = createReadStream
70238 fs.createWriteStream = createWriteStream
70239 var fs$readFile = fs.readFile
70240 fs.readFile = readFile
70241 function readFile (path, options, cb) {
70242 if (typeof options === 'function')
70243 cb = options, options = null
70244
70245 return go$readFile(path, options, cb)
70246
70247 function go$readFile (path, options, cb) {
70248 return fs$readFile(path, options, function (err) {
70249 if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
70250 enqueue([go$readFile, [path, options, cb]])
70251 else {
70252 if (typeof cb === 'function')
70253 cb.apply(this, arguments)
70254 retry()
70255 }
70256 })
70257 }
70258 }
70259
70260 var fs$writeFile = fs.writeFile
70261 fs.writeFile = writeFile
70262 function writeFile (path, data, options, cb) {
70263 if (typeof options === 'function')
70264 cb = options, options = null
70265
70266 return go$writeFile(path, data, options, cb)
70267
70268 function go$writeFile (path, data, options, cb) {
70269 return fs$writeFile(path, data, options, function (err) {
70270 if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
70271 enqueue([go$writeFile, [path, data, options, cb]])
70272 else {
70273 if (typeof cb === 'function')
70274 cb.apply(this, arguments)
70275 retry()
70276 }
70277 })
70278 }
70279 }
70280
70281 var fs$appendFile = fs.appendFile
70282 if (fs$appendFile)
70283 fs.appendFile = appendFile
70284 function appendFile (path, data, options, cb) {
70285 if (typeof options === 'function')
70286 cb = options, options = null
70287
70288 return go$appendFile(path, data, options, cb)
70289
70290 function go$appendFile (path, data, options, cb) {
70291 return fs$appendFile(path, data, options, function (err) {
70292 if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
70293 enqueue([go$appendFile, [path, data, options, cb]])
70294 else {
70295 if (typeof cb === 'function')
70296 cb.apply(this, arguments)
70297 retry()
70298 }
70299 })
70300 }
70301 }
70302
70303 var fs$readdir = fs.readdir
70304 fs.readdir = readdir
70305 function readdir (path, options, cb) {
70306 var args = [path]
70307 if (typeof options !== 'function') {
70308 args.push(options)
70309 } else {
70310 cb = options
70311 }
70312 args.push(go$readdir$cb)
70313
70314 return go$readdir(args)
70315
70316 function go$readdir$cb (err, files) {
70317 if (files && files.sort)
70318 files.sort()
70319
70320 if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
70321 enqueue([go$readdir, [args]])
70322 else {
70323 if (typeof cb === 'function')
70324 cb.apply(this, arguments)
70325 retry()
70326 }
70327 }
70328 }
70329
70330 function go$readdir (args) {
70331 return fs$readdir.apply(fs, args)
70332 }
70333
70334 if (process.version.substr(0, 4) === 'v0.8') {
70335 var legStreams = legacy(fs)
70336 ReadStream = legStreams.ReadStream
70337 WriteStream = legStreams.WriteStream
70338 }
70339
70340 var fs$ReadStream = fs.ReadStream
70341 ReadStream.prototype = Object.create(fs$ReadStream.prototype)
70342 ReadStream.prototype.open = ReadStream$open
70343
70344 var fs$WriteStream = fs.WriteStream
70345 WriteStream.prototype = Object.create(fs$WriteStream.prototype)
70346 WriteStream.prototype.open = WriteStream$open
70347
70348 fs.ReadStream = ReadStream
70349 fs.WriteStream = WriteStream
70350
70351 function ReadStream (path, options) {
70352 if (this instanceof ReadStream)
70353 return fs$ReadStream.apply(this, arguments), this
70354 else
70355 return ReadStream.apply(Object.create(ReadStream.prototype), arguments)
70356 }
70357
70358 function ReadStream$open () {
70359 var that = this
70360 open(that.path, that.flags, that.mode, function (err, fd) {
70361 if (err) {
70362 if (that.autoClose)
70363 that.destroy()
70364
70365 that.emit('error', err)
70366 } else {
70367 that.fd = fd
70368 that.emit('open', fd)
70369 that.read()
70370 }
70371 })
70372 }
70373
70374 function WriteStream (path, options) {
70375 if (this instanceof WriteStream)
70376 return fs$WriteStream.apply(this, arguments), this
70377 else
70378 return WriteStream.apply(Object.create(WriteStream.prototype), arguments)
70379 }
70380
70381 function WriteStream$open () {
70382 var that = this
70383 open(that.path, that.flags, that.mode, function (err, fd) {
70384 if (err) {
70385 that.destroy()
70386 that.emit('error', err)
70387 } else {
70388 that.fd = fd
70389 that.emit('open', fd)
70390 }
70391 })
70392 }
70393
70394 function createReadStream (path, options) {
70395 return new ReadStream(path, options)
70396 }
70397
70398 function createWriteStream (path, options) {
70399 return new WriteStream(path, options)
70400 }
70401
70402 var fs$open = fs.open
70403 fs.open = open
70404 function open (path, flags, mode, cb) {
70405 if (typeof mode === 'function')
70406 cb = mode, mode = null
70407
70408 return go$open(path, flags, mode, cb)
70409
70410 function go$open (path, flags, mode, cb) {
70411 return fs$open(path, flags, mode, function (err, fd) {
70412 if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
70413 enqueue([go$open, [path, flags, mode, cb]])
70414 else {
70415 if (typeof cb === 'function')
70416 cb.apply(this, arguments)
70417 retry()
70418 }
70419 })
70420 }
70421 }
70422
70423 return fs
70424}
70425
70426function enqueue (elem) {
70427 debug('ENQUEUE', elem[0].name, elem[1])
70428 queue.push(elem)
70429}
70430
70431function retry () {
70432 var elem = queue.shift()
70433 if (elem) {
70434 debug('RETRY', elem[0].name, elem[1])
70435 elem[0].apply(null, elem[1])
70436 }
70437}
70438
70439
70440/***/ }),
70441/* 357 */
70442/***/ (function(module, exports, __webpack_require__) {
70443
70444"use strict";
70445
70446
70447var util = __webpack_require__(106);
70448
70449module.exports = SchemaObject;
70450
70451function SchemaObject(obj) {
70452 util.copy(obj, this);
70453}
70454
70455
70456/***/ }),
70457/* 358 */
70458/***/ (function(module, exports, __webpack_require__) {
70459
70460"use strict";
70461
70462module.exports = function generate__limit(it, $keyword, $ruleType) {
70463 var out = ' ';
70464 var $lvl = it.level;
70465 var $dataLvl = it.dataLevel;
70466 var $schema = it.schema[$keyword];
70467 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
70468 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
70469 var $breakOnError = !it.opts.allErrors;
70470 var $errorKeyword;
70471 var $data = 'data' + ($dataLvl || '');
70472 var $isData = it.opts.$data && $schema && $schema.$data,
70473 $schemaValue;
70474 if ($isData) {
70475 out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
70476 $schemaValue = 'schema' + $lvl;
70477 } else {
70478 $schemaValue = $schema;
70479 }
70480 var $isMax = $keyword == 'maximum',
70481 $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum',
70482 $schemaExcl = it.schema[$exclusiveKeyword],
70483 $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data,
70484 $op = $isMax ? '<' : '>',
70485 $notOp = $isMax ? '>' : '<',
70486 $errorKeyword = undefined;
70487 if ($isDataExcl) {
70488 var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr),
70489 $exclusive = 'exclusive' + $lvl,
70490 $exclType = 'exclType' + $lvl,
70491 $exclIsNumber = 'exclIsNumber' + $lvl,
70492 $opExpr = 'op' + $lvl,
70493 $opStr = '\' + ' + $opExpr + ' + \'';
70494 out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; ';
70495 $schemaValueExcl = 'schemaExcl' + $lvl;
70496 out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { ';
70497 var $errorKeyword = $exclusiveKeyword;
70498 var $$outStack = $$outStack || [];
70499 $$outStack.push(out);
70500 out = ''; /* istanbul ignore else */
70501 if (it.createErrors !== false) {
70502 out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
70503 if (it.opts.messages !== false) {
70504 out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' ';
70505 }
70506 if (it.opts.verbose) {
70507 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
70508 }
70509 out += ' } ';
70510 } else {
70511 out += ' {} ';
70512 }
70513 var __err = out;
70514 out = $$outStack.pop();
70515 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
70516 if (it.async) {
70517 out += ' throw new ValidationError([' + (__err) + ']); ';
70518 } else {
70519 out += ' validate.errors = [' + (__err) + ']; return false; ';
70520 }
70521 } else {
70522 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
70523 }
70524 out += ' } else if ( ';
70525 if ($isData) {
70526 out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
70527 }
70528 out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';';
70529 } else {
70530 var $exclIsNumber = typeof $schemaExcl == 'number',
70531 $opStr = $op;
70532 if ($exclIsNumber && $isData) {
70533 var $opExpr = '\'' + $opStr + '\'';
70534 out += ' if ( ';
70535 if ($isData) {
70536 out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
70537 }
70538 out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { ';
70539 } else {
70540 if ($exclIsNumber && $schema === undefined) {
70541 $exclusive = true;
70542 $errorKeyword = $exclusiveKeyword;
70543 $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
70544 $schemaValue = $schemaExcl;
70545 $notOp += '=';
70546 } else {
70547 if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema);
70548 if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) {
70549 $exclusive = true;
70550 $errorKeyword = $exclusiveKeyword;
70551 $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
70552 $notOp += '=';
70553 } else {
70554 $exclusive = false;
70555 $opStr += '=';
70556 }
70557 }
70558 var $opExpr = '\'' + $opStr + '\'';
70559 out += ' if ( ';
70560 if ($isData) {
70561 out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
70562 }
70563 out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { ';
70564 }
70565 }
70566 $errorKeyword = $errorKeyword || $keyword;
70567 var $$outStack = $$outStack || [];
70568 $$outStack.push(out);
70569 out = ''; /* istanbul ignore else */
70570 if (it.createErrors !== false) {
70571 out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } ';
70572 if (it.opts.messages !== false) {
70573 out += ' , message: \'should be ' + ($opStr) + ' ';
70574 if ($isData) {
70575 out += '\' + ' + ($schemaValue);
70576 } else {
70577 out += '' + ($schemaValue) + '\'';
70578 }
70579 }
70580 if (it.opts.verbose) {
70581 out += ' , schema: ';
70582 if ($isData) {
70583 out += 'validate.schema' + ($schemaPath);
70584 } else {
70585 out += '' + ($schema);
70586 }
70587 out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
70588 }
70589 out += ' } ';
70590 } else {
70591 out += ' {} ';
70592 }
70593 var __err = out;
70594 out = $$outStack.pop();
70595 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
70596 if (it.async) {
70597 out += ' throw new ValidationError([' + (__err) + ']); ';
70598 } else {
70599 out += ' validate.errors = [' + (__err) + ']; return false; ';
70600 }
70601 } else {
70602 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
70603 }
70604 out += ' } ';
70605 if ($breakOnError) {
70606 out += ' else { ';
70607 }
70608 return out;
70609}
70610
70611
70612/***/ }),
70613/* 359 */
70614/***/ (function(module, exports, __webpack_require__) {
70615
70616"use strict";
70617
70618module.exports = function generate__limitItems(it, $keyword, $ruleType) {
70619 var out = ' ';
70620 var $lvl = it.level;
70621 var $dataLvl = it.dataLevel;
70622 var $schema = it.schema[$keyword];
70623 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
70624 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
70625 var $breakOnError = !it.opts.allErrors;
70626 var $errorKeyword;
70627 var $data = 'data' + ($dataLvl || '');
70628 var $isData = it.opts.$data && $schema && $schema.$data,
70629 $schemaValue;
70630 if ($isData) {
70631 out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
70632 $schemaValue = 'schema' + $lvl;
70633 } else {
70634 $schemaValue = $schema;
70635 }
70636 var $op = $keyword == 'maxItems' ? '>' : '<';
70637 out += 'if ( ';
70638 if ($isData) {
70639 out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
70640 }
70641 out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { ';
70642 var $errorKeyword = $keyword;
70643 var $$outStack = $$outStack || [];
70644 $$outStack.push(out);
70645 out = ''; /* istanbul ignore else */
70646 if (it.createErrors !== false) {
70647 out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
70648 if (it.opts.messages !== false) {
70649 out += ' , message: \'should NOT have ';
70650 if ($keyword == 'maxItems') {
70651 out += 'more';
70652 } else {
70653 out += 'less';
70654 }
70655 out += ' than ';
70656 if ($isData) {
70657 out += '\' + ' + ($schemaValue) + ' + \'';
70658 } else {
70659 out += '' + ($schema);
70660 }
70661 out += ' items\' ';
70662 }
70663 if (it.opts.verbose) {
70664 out += ' , schema: ';
70665 if ($isData) {
70666 out += 'validate.schema' + ($schemaPath);
70667 } else {
70668 out += '' + ($schema);
70669 }
70670 out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
70671 }
70672 out += ' } ';
70673 } else {
70674 out += ' {} ';
70675 }
70676 var __err = out;
70677 out = $$outStack.pop();
70678 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
70679 if (it.async) {
70680 out += ' throw new ValidationError([' + (__err) + ']); ';
70681 } else {
70682 out += ' validate.errors = [' + (__err) + ']; return false; ';
70683 }
70684 } else {
70685 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
70686 }
70687 out += '} ';
70688 if ($breakOnError) {
70689 out += ' else { ';
70690 }
70691 return out;
70692}
70693
70694
70695/***/ }),
70696/* 360 */
70697/***/ (function(module, exports, __webpack_require__) {
70698
70699"use strict";
70700
70701module.exports = function generate__limitLength(it, $keyword, $ruleType) {
70702 var out = ' ';
70703 var $lvl = it.level;
70704 var $dataLvl = it.dataLevel;
70705 var $schema = it.schema[$keyword];
70706 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
70707 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
70708 var $breakOnError = !it.opts.allErrors;
70709 var $errorKeyword;
70710 var $data = 'data' + ($dataLvl || '');
70711 var $isData = it.opts.$data && $schema && $schema.$data,
70712 $schemaValue;
70713 if ($isData) {
70714 out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
70715 $schemaValue = 'schema' + $lvl;
70716 } else {
70717 $schemaValue = $schema;
70718 }
70719 var $op = $keyword == 'maxLength' ? '>' : '<';
70720 out += 'if ( ';
70721 if ($isData) {
70722 out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
70723 }
70724 if (it.opts.unicode === false) {
70725 out += ' ' + ($data) + '.length ';
70726 } else {
70727 out += ' ucs2length(' + ($data) + ') ';
70728 }
70729 out += ' ' + ($op) + ' ' + ($schemaValue) + ') { ';
70730 var $errorKeyword = $keyword;
70731 var $$outStack = $$outStack || [];
70732 $$outStack.push(out);
70733 out = ''; /* istanbul ignore else */
70734 if (it.createErrors !== false) {
70735 out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
70736 if (it.opts.messages !== false) {
70737 out += ' , message: \'should NOT be ';
70738 if ($keyword == 'maxLength') {
70739 out += 'longer';
70740 } else {
70741 out += 'shorter';
70742 }
70743 out += ' than ';
70744 if ($isData) {
70745 out += '\' + ' + ($schemaValue) + ' + \'';
70746 } else {
70747 out += '' + ($schema);
70748 }
70749 out += ' characters\' ';
70750 }
70751 if (it.opts.verbose) {
70752 out += ' , schema: ';
70753 if ($isData) {
70754 out += 'validate.schema' + ($schemaPath);
70755 } else {
70756 out += '' + ($schema);
70757 }
70758 out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
70759 }
70760 out += ' } ';
70761 } else {
70762 out += ' {} ';
70763 }
70764 var __err = out;
70765 out = $$outStack.pop();
70766 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
70767 if (it.async) {
70768 out += ' throw new ValidationError([' + (__err) + ']); ';
70769 } else {
70770 out += ' validate.errors = [' + (__err) + ']; return false; ';
70771 }
70772 } else {
70773 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
70774 }
70775 out += '} ';
70776 if ($breakOnError) {
70777 out += ' else { ';
70778 }
70779 return out;
70780}
70781
70782
70783/***/ }),
70784/* 361 */
70785/***/ (function(module, exports, __webpack_require__) {
70786
70787"use strict";
70788
70789module.exports = function generate__limitProperties(it, $keyword, $ruleType) {
70790 var out = ' ';
70791 var $lvl = it.level;
70792 var $dataLvl = it.dataLevel;
70793 var $schema = it.schema[$keyword];
70794 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
70795 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
70796 var $breakOnError = !it.opts.allErrors;
70797 var $errorKeyword;
70798 var $data = 'data' + ($dataLvl || '');
70799 var $isData = it.opts.$data && $schema && $schema.$data,
70800 $schemaValue;
70801 if ($isData) {
70802 out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
70803 $schemaValue = 'schema' + $lvl;
70804 } else {
70805 $schemaValue = $schema;
70806 }
70807 var $op = $keyword == 'maxProperties' ? '>' : '<';
70808 out += 'if ( ';
70809 if ($isData) {
70810 out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
70811 }
70812 out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { ';
70813 var $errorKeyword = $keyword;
70814 var $$outStack = $$outStack || [];
70815 $$outStack.push(out);
70816 out = ''; /* istanbul ignore else */
70817 if (it.createErrors !== false) {
70818 out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
70819 if (it.opts.messages !== false) {
70820 out += ' , message: \'should NOT have ';
70821 if ($keyword == 'maxProperties') {
70822 out += 'more';
70823 } else {
70824 out += 'less';
70825 }
70826 out += ' than ';
70827 if ($isData) {
70828 out += '\' + ' + ($schemaValue) + ' + \'';
70829 } else {
70830 out += '' + ($schema);
70831 }
70832 out += ' properties\' ';
70833 }
70834 if (it.opts.verbose) {
70835 out += ' , schema: ';
70836 if ($isData) {
70837 out += 'validate.schema' + ($schemaPath);
70838 } else {
70839 out += '' + ($schema);
70840 }
70841 out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
70842 }
70843 out += ' } ';
70844 } else {
70845 out += ' {} ';
70846 }
70847 var __err = out;
70848 out = $$outStack.pop();
70849 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
70850 if (it.async) {
70851 out += ' throw new ValidationError([' + (__err) + ']); ';
70852 } else {
70853 out += ' validate.errors = [' + (__err) + ']; return false; ';
70854 }
70855 } else {
70856 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
70857 }
70858 out += '} ';
70859 if ($breakOnError) {
70860 out += ' else { ';
70861 }
70862 return out;
70863}
70864
70865
70866/***/ }),
70867/* 362 */
70868/***/ (function(module, exports, __webpack_require__) {
70869
70870"use strict";
70871
70872module.exports = function generate_validate(it, $keyword, $ruleType) {
70873 var out = '';
70874 var $async = it.schema.$async === true,
70875 $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'),
70876 $id = it.self._getId(it.schema);
70877 if (it.isTop) {
70878 if ($async) {
70879 it.async = true;
70880 var $es7 = it.opts.async == 'es7';
70881 it.yieldAwait = $es7 ? 'await' : 'yield';
70882 }
70883 out += ' var validate = ';
70884 if ($async) {
70885 if ($es7) {
70886 out += ' (async function ';
70887 } else {
70888 if (it.opts.async != '*') {
70889 out += 'co.wrap';
70890 }
70891 out += '(function* ';
70892 }
70893 } else {
70894 out += ' (function ';
70895 }
70896 out += ' (data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; ';
70897 if ($id && (it.opts.sourceCode || it.opts.processCode)) {
70898 out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' ';
70899 }
70900 }
70901 if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) {
70902 var $keyword = 'false schema';
70903 var $lvl = it.level;
70904 var $dataLvl = it.dataLevel;
70905 var $schema = it.schema[$keyword];
70906 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
70907 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
70908 var $breakOnError = !it.opts.allErrors;
70909 var $errorKeyword;
70910 var $data = 'data' + ($dataLvl || '');
70911 var $valid = 'valid' + $lvl;
70912 if (it.schema === false) {
70913 if (it.isTop) {
70914 $breakOnError = true;
70915 } else {
70916 out += ' var ' + ($valid) + ' = false; ';
70917 }
70918 var $$outStack = $$outStack || [];
70919 $$outStack.push(out);
70920 out = ''; /* istanbul ignore else */
70921 if (it.createErrors !== false) {
70922 out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
70923 if (it.opts.messages !== false) {
70924 out += ' , message: \'boolean schema is false\' ';
70925 }
70926 if (it.opts.verbose) {
70927 out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
70928 }
70929 out += ' } ';
70930 } else {
70931 out += ' {} ';
70932 }
70933 var __err = out;
70934 out = $$outStack.pop();
70935 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
70936 if (it.async) {
70937 out += ' throw new ValidationError([' + (__err) + ']); ';
70938 } else {
70939 out += ' validate.errors = [' + (__err) + ']; return false; ';
70940 }
70941 } else {
70942 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
70943 }
70944 } else {
70945 if (it.isTop) {
70946 if ($async) {
70947 out += ' return data; ';
70948 } else {
70949 out += ' validate.errors = null; return true; ';
70950 }
70951 } else {
70952 out += ' var ' + ($valid) + ' = true; ';
70953 }
70954 }
70955 if (it.isTop) {
70956 out += ' }); return validate; ';
70957 }
70958 return out;
70959 }
70960 if (it.isTop) {
70961 var $top = it.isTop,
70962 $lvl = it.level = 0,
70963 $dataLvl = it.dataLevel = 0,
70964 $data = 'data';
70965 it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));
70966 it.baseId = it.baseId || it.rootId;
70967 delete it.isTop;
70968 it.dataPathArr = [undefined];
70969 out += ' var vErrors = null; ';
70970 out += ' var errors = 0; ';
70971 out += ' if (rootData === undefined) rootData = data; ';
70972 } else {
70973 var $lvl = it.level,
70974 $dataLvl = it.dataLevel,
70975 $data = 'data' + ($dataLvl || '');
70976 if ($id) it.baseId = it.resolve.url(it.baseId, $id);
70977 if ($async && !it.async) throw new Error('async schema in sync schema');
70978 out += ' var errs_' + ($lvl) + ' = errors;';
70979 }
70980 var $valid = 'valid' + $lvl,
70981 $breakOnError = !it.opts.allErrors,
70982 $closingBraces1 = '',
70983 $closingBraces2 = '';
70984 var $errorKeyword;
70985 var $typeSchema = it.schema.type,
70986 $typeIsArray = Array.isArray($typeSchema);
70987 if ($typeIsArray && $typeSchema.length == 1) {
70988 $typeSchema = $typeSchema[0];
70989 $typeIsArray = false;
70990 }
70991 if (it.schema.$ref && $refKeywords) {
70992 if (it.opts.extendRefs == 'fail') {
70993 throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)');
70994 } else if (it.opts.extendRefs !== true) {
70995 $refKeywords = false;
70996 it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"');
70997 }
70998 }
70999 if ($typeSchema) {
71000 if (it.opts.coerceTypes) {
71001 var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema);
71002 }
71003 var $rulesGroup = it.RULES.types[$typeSchema];
71004 if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) {
71005 var $schemaPath = it.schemaPath + '.type',
71006 $errSchemaPath = it.errSchemaPath + '/type';
71007 var $schemaPath = it.schemaPath + '.type',
71008 $errSchemaPath = it.errSchemaPath + '/type',
71009 $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';
71010 out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { ';
71011 if ($coerceToTypes) {
71012 var $dataType = 'dataType' + $lvl,
71013 $coerced = 'coerced' + $lvl;
71014 out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; ';
71015 if (it.opts.coerceTypes == 'array') {
71016 out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; ';
71017 }
71018 out += ' var ' + ($coerced) + ' = undefined; ';
71019 var $bracesCoercion = '';
71020 var arr1 = $coerceToTypes;
71021 if (arr1) {
71022 var $type, $i = -1,
71023 l1 = arr1.length - 1;
71024 while ($i < l1) {
71025 $type = arr1[$i += 1];
71026 if ($i) {
71027 out += ' if (' + ($coerced) + ' === undefined) { ';
71028 $bracesCoercion += '}';
71029 }
71030 if (it.opts.coerceTypes == 'array' && $type != 'array') {
71031 out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } ';
71032 }
71033 if ($type == 'string') {
71034 out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; ';
71035 } else if ($type == 'number' || $type == 'integer') {
71036 out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';
71037 if ($type == 'integer') {
71038 out += ' && !(' + ($data) + ' % 1)';
71039 }
71040 out += ')) ' + ($coerced) + ' = +' + ($data) + '; ';
71041 } else if ($type == 'boolean') {
71042 out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';
71043 } else if ($type == 'null') {
71044 out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';
71045 } else if (it.opts.coerceTypes == 'array' && $type == 'array') {
71046 out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';
71047 }
71048 }
71049 }
71050 out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { ';
71051 var $$outStack = $$outStack || [];
71052 $$outStack.push(out);
71053 out = ''; /* istanbul ignore else */
71054 if (it.createErrors !== false) {
71055 out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
71056 if ($typeIsArray) {
71057 out += '' + ($typeSchema.join(","));
71058 } else {
71059 out += '' + ($typeSchema);
71060 }
71061 out += '\' } ';
71062 if (it.opts.messages !== false) {
71063 out += ' , message: \'should be ';
71064 if ($typeIsArray) {
71065 out += '' + ($typeSchema.join(","));
71066 } else {
71067 out += '' + ($typeSchema);
71068 }
71069 out += '\' ';
71070 }
71071 if (it.opts.verbose) {
71072 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
71073 }
71074 out += ' } ';
71075 } else {
71076 out += ' {} ';
71077 }
71078 var __err = out;
71079 out = $$outStack.pop();
71080 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
71081 if (it.async) {
71082 out += ' throw new ValidationError([' + (__err) + ']); ';
71083 } else {
71084 out += ' validate.errors = [' + (__err) + ']; return false; ';
71085 }
71086 } else {
71087 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
71088 }
71089 out += ' } else { ';
71090 var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
71091 $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
71092 out += ' ' + ($data) + ' = ' + ($coerced) + '; ';
71093 if (!$dataLvl) {
71094 out += 'if (' + ($parentData) + ' !== undefined)';
71095 }
71096 out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } ';
71097 } else {
71098 var $$outStack = $$outStack || [];
71099 $$outStack.push(out);
71100 out = ''; /* istanbul ignore else */
71101 if (it.createErrors !== false) {
71102 out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
71103 if ($typeIsArray) {
71104 out += '' + ($typeSchema.join(","));
71105 } else {
71106 out += '' + ($typeSchema);
71107 }
71108 out += '\' } ';
71109 if (it.opts.messages !== false) {
71110 out += ' , message: \'should be ';
71111 if ($typeIsArray) {
71112 out += '' + ($typeSchema.join(","));
71113 } else {
71114 out += '' + ($typeSchema);
71115 }
71116 out += '\' ';
71117 }
71118 if (it.opts.verbose) {
71119 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
71120 }
71121 out += ' } ';
71122 } else {
71123 out += ' {} ';
71124 }
71125 var __err = out;
71126 out = $$outStack.pop();
71127 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
71128 if (it.async) {
71129 out += ' throw new ValidationError([' + (__err) + ']); ';
71130 } else {
71131 out += ' validate.errors = [' + (__err) + ']; return false; ';
71132 }
71133 } else {
71134 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
71135 }
71136 }
71137 out += ' } ';
71138 }
71139 }
71140 if (it.schema.$ref && !$refKeywords) {
71141 out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' ';
71142 if ($breakOnError) {
71143 out += ' } if (errors === ';
71144 if ($top) {
71145 out += '0';
71146 } else {
71147 out += 'errs_' + ($lvl);
71148 }
71149 out += ') { ';
71150 $closingBraces2 += '}';
71151 }
71152 } else {
71153 if (it.opts.v5 && it.schema.patternGroups) {
71154 it.logger.warn('keyword "patternGroups" is deprecated and disabled. Use option patternGroups: true to enable.');
71155 }
71156 var arr2 = it.RULES;
71157 if (arr2) {
71158 var $rulesGroup, i2 = -1,
71159 l2 = arr2.length - 1;
71160 while (i2 < l2) {
71161 $rulesGroup = arr2[i2 += 1];
71162 if ($shouldUseGroup($rulesGroup)) {
71163 if ($rulesGroup.type) {
71164 out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { ';
71165 }
71166 if (it.opts.useDefaults && !it.compositeRule) {
71167 if ($rulesGroup.type == 'object' && it.schema.properties) {
71168 var $schema = it.schema.properties,
71169 $schemaKeys = Object.keys($schema);
71170 var arr3 = $schemaKeys;
71171 if (arr3) {
71172 var $propertyKey, i3 = -1,
71173 l3 = arr3.length - 1;
71174 while (i3 < l3) {
71175 $propertyKey = arr3[i3 += 1];
71176 var $sch = $schema[$propertyKey];
71177 if ($sch.default !== undefined) {
71178 var $passData = $data + it.util.getProperty($propertyKey);
71179 out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = ';
71180 if (it.opts.useDefaults == 'shared') {
71181 out += ' ' + (it.useDefault($sch.default)) + ' ';
71182 } else {
71183 out += ' ' + (JSON.stringify($sch.default)) + ' ';
71184 }
71185 out += '; ';
71186 }
71187 }
71188 }
71189 } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) {
71190 var arr4 = it.schema.items;
71191 if (arr4) {
71192 var $sch, $i = -1,
71193 l4 = arr4.length - 1;
71194 while ($i < l4) {
71195 $sch = arr4[$i += 1];
71196 if ($sch.default !== undefined) {
71197 var $passData = $data + '[' + $i + ']';
71198 out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = ';
71199 if (it.opts.useDefaults == 'shared') {
71200 out += ' ' + (it.useDefault($sch.default)) + ' ';
71201 } else {
71202 out += ' ' + (JSON.stringify($sch.default)) + ' ';
71203 }
71204 out += '; ';
71205 }
71206 }
71207 }
71208 }
71209 }
71210 var arr5 = $rulesGroup.rules;
71211 if (arr5) {
71212 var $rule, i5 = -1,
71213 l5 = arr5.length - 1;
71214 while (i5 < l5) {
71215 $rule = arr5[i5 += 1];
71216 if ($shouldUseRule($rule)) {
71217 var $code = $rule.code(it, $rule.keyword, $rulesGroup.type);
71218 if ($code) {
71219 out += ' ' + ($code) + ' ';
71220 if ($breakOnError) {
71221 $closingBraces1 += '}';
71222 }
71223 }
71224 }
71225 }
71226 }
71227 if ($breakOnError) {
71228 out += ' ' + ($closingBraces1) + ' ';
71229 $closingBraces1 = '';
71230 }
71231 if ($rulesGroup.type) {
71232 out += ' } ';
71233 if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) {
71234 out += ' else { ';
71235 var $schemaPath = it.schemaPath + '.type',
71236 $errSchemaPath = it.errSchemaPath + '/type';
71237 var $$outStack = $$outStack || [];
71238 $$outStack.push(out);
71239 out = ''; /* istanbul ignore else */
71240 if (it.createErrors !== false) {
71241 out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
71242 if ($typeIsArray) {
71243 out += '' + ($typeSchema.join(","));
71244 } else {
71245 out += '' + ($typeSchema);
71246 }
71247 out += '\' } ';
71248 if (it.opts.messages !== false) {
71249 out += ' , message: \'should be ';
71250 if ($typeIsArray) {
71251 out += '' + ($typeSchema.join(","));
71252 } else {
71253 out += '' + ($typeSchema);
71254 }
71255 out += '\' ';
71256 }
71257 if (it.opts.verbose) {
71258 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
71259 }
71260 out += ' } ';
71261 } else {
71262 out += ' {} ';
71263 }
71264 var __err = out;
71265 out = $$outStack.pop();
71266 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
71267 if (it.async) {
71268 out += ' throw new ValidationError([' + (__err) + ']); ';
71269 } else {
71270 out += ' validate.errors = [' + (__err) + ']; return false; ';
71271 }
71272 } else {
71273 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
71274 }
71275 out += ' } ';
71276 }
71277 }
71278 if ($breakOnError) {
71279 out += ' if (errors === ';
71280 if ($top) {
71281 out += '0';
71282 } else {
71283 out += 'errs_' + ($lvl);
71284 }
71285 out += ') { ';
71286 $closingBraces2 += '}';
71287 }
71288 }
71289 }
71290 }
71291 }
71292 if ($breakOnError) {
71293 out += ' ' + ($closingBraces2) + ' ';
71294 }
71295 if ($top) {
71296 if ($async) {
71297 out += ' if (errors === 0) return data; ';
71298 out += ' else throw new ValidationError(vErrors); ';
71299 } else {
71300 out += ' validate.errors = vErrors; ';
71301 out += ' return errors === 0; ';
71302 }
71303 out += ' }); return validate;';
71304 } else {
71305 out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';';
71306 }
71307 out = it.util.cleanUpCode(out);
71308 if ($top) {
71309 out = it.util.finalCleanUpCode(out, $async);
71310 }
71311
71312 function $shouldUseGroup($rulesGroup) {
71313 var rules = $rulesGroup.rules;
71314 for (var i = 0; i < rules.length; i++)
71315 if ($shouldUseRule(rules[i])) return true;
71316 }
71317
71318 function $shouldUseRule($rule) {
71319 return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule));
71320 }
71321
71322 function $ruleImplementsSomeKeyword($rule) {
71323 var impl = $rule.implements;
71324 for (var i = 0; i < impl.length; i++)
71325 if (it.schema[impl[i]] !== undefined) return true;
71326 }
71327 return out;
71328}
71329
71330
71331/***/ }),
71332/* 363 */
71333/***/ (function(module, exports) {
71334
71335module.exports = [["0","\u0000",127],["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"],["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"],["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"],["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21],["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10],["a3a1","ㄐ",25,"˙ˉˊˇˋ"],["a3e1","€"],["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"],["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"],["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"],["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"],["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"],["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"],["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"],["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"],["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"],["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"],["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"],["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"],["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"],["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"],["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"],["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"],["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"],["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"],["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"],["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"],["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"],["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"],["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"],["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"],["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"],["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"],["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"],["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"],["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"],["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"],["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"],["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"],["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"],["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"],["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"],["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"],["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"],["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"],["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"],["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"],["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"],["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"],["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"],["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"],["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"],["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"],["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"],["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"],["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"],["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"],["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"],["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"],["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"],["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"],["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"],["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"],["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"],["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"],["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"],["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"],["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"],["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"],["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"],["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"],["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"],["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"],["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"],["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"],["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"],["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"],["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"],["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"],["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"],["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"],["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"],["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"],["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"],["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"],["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"],["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"],["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"],["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"],["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"],["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"],["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"],["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"],["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"],["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"],["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"],["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"],["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"],["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"],["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"],["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"],["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"],["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"],["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"],["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"],["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"],["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"],["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"],["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"],["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"],["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"],["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"],["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"],["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"],["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"],["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"],["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"],["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"],["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"],["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"],["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"],["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"],["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"],["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"],["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"],["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"],["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"],["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"],["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"],["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"],["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"],["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"],["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"],["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"],["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"],["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"],["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"],["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"],["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"],["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"],["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"],["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"],["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"],["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"],["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"],["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"],["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"],["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"],["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"],["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"],["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"],["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"],["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"],["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"],["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"],["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"],["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"],["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"],["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"],["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"],["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"],["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"],["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"],["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"],["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"],["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"],["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"],["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"],["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"],["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"],["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"],["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"],["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"],["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"]]
71336
71337/***/ }),
71338/* 364 */
71339/***/ (function(module, exports) {
71340
71341module.exports = [["a140","",62],["a180","",32],["a240","",62],["a280","",32],["a2ab","",5],["a2e3","€"],["a2ef",""],["a2fd",""],["a340","",62],["a380","",31," "],["a440","",62],["a480","",32],["a4f4","",10],["a540","",62],["a580","",32],["a5f7","",7],["a640","",62],["a680","",32],["a6b9","",7],["a6d9","",6],["a6ec",""],["a6f3",""],["a6f6","",8],["a740","",62],["a780","",32],["a7c2","",14],["a7f2","",12],["a896","",10],["a8bc",""],["a8bf","ǹ"],["a8c1",""],["a8ea","",20],["a958",""],["a95b",""],["a95d",""],["a989","〾⿰",11],["a997","",12],["a9f0","",14],["aaa1","",93],["aba1","",93],["aca1","",93],["ada1","",93],["aea1","",93],["afa1","",93],["d7fa","",4],["f8a1","",93],["f9a1","",93],["faa1","",93],["fba1","",93],["fca1","",93],["fda1","",93],["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"],["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93]]
71342
71343/***/ }),
71344/* 365 */
71345/***/ (function(module, exports, __webpack_require__) {
71346
71347"use strict";
71348
71349
71350module.exports = __webpack_require__(567).isCI
71351
71352
71353/***/ }),
71354/* 366 */
71355/***/ (function(module, exports) {
71356
71357var toString = {}.toString;
71358
71359module.exports = Array.isArray || function (arr) {
71360 return toString.call(arr) == '[object Array]';
71361};
71362
71363
71364/***/ }),
71365/* 367 */
71366/***/ (function(module, exports, __webpack_require__) {
71367
71368var stream = __webpack_require__(35)
71369
71370
71371function isStream (obj) {
71372 return obj instanceof stream.Stream
71373}
71374
71375
71376function isReadable (obj) {
71377 return isStream(obj) && typeof obj._read == 'function' && typeof obj._readableState == 'object'
71378}
71379
71380
71381function isWritable (obj) {
71382 return isStream(obj) && typeof obj._write == 'function' && typeof obj._writableState == 'object'
71383}
71384
71385
71386function isDuplex (obj) {
71387 return isReadable(obj) && isWritable(obj)
71388}
71389
71390
71391module.exports = isStream
71392module.exports.isReadable = isReadable
71393module.exports.isWritable = isWritable
71394module.exports.isDuplex = isDuplex
71395
71396
71397/***/ }),
71398/* 368 */
71399/***/ (function(module, exports, __webpack_require__) {
71400
71401"use strict";
71402// Standard YAML's Core schema.
71403// http://www.yaml.org/spec/1.2/spec.html#id2804923
71404//
71405// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
71406// So, Core schema has no distinctions from JSON schema is JS-YAML.
71407
71408
71409
71410
71411
71412var Schema = __webpack_require__(108);
71413
71414
71415module.exports = new Schema({
71416 include: [
71417 __webpack_require__(369)
71418 ]
71419});
71420
71421
71422/***/ }),
71423/* 369 */
71424/***/ (function(module, exports, __webpack_require__) {
71425
71426"use strict";
71427// Standard YAML's JSON schema.
71428// http://www.yaml.org/spec/1.2/spec.html#id2803231
71429//
71430// NOTE: JS-YAML does not support schema-specific tag resolution restrictions.
71431// So, this schema is not such strict as defined in the YAML specification.
71432// It allows numbers in binary notaion, use `Null` and `NULL` as `null`, etc.
71433
71434
71435
71436
71437
71438var Schema = __webpack_require__(108);
71439
71440
71441module.exports = new Schema({
71442 include: [
71443 __webpack_require__(239)
71444 ],
71445 implicit: [
71446 __webpack_require__(808),
71447 __webpack_require__(800),
71448 __webpack_require__(802),
71449 __webpack_require__(801)
71450 ]
71451});
71452
71453
71454/***/ }),
71455/* 370 */
71456/***/ (function(module, exports, __webpack_require__) {
71457
71458"use strict";
71459/*!
71460 * mime-types
71461 * Copyright(c) 2014 Jonathan Ong
71462 * Copyright(c) 2015 Douglas Christopher Wilson
71463 * MIT Licensed
71464 */
71465
71466
71467
71468/**
71469 * Module dependencies.
71470 * @private
71471 */
71472
71473var db = __webpack_require__(830)
71474var extname = __webpack_require__(1).extname
71475
71476/**
71477 * Module variables.
71478 * @private
71479 */
71480
71481var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/
71482var TEXT_TYPE_REGEXP = /^text\//i
71483
71484/**
71485 * Module exports.
71486 * @public
71487 */
71488
71489exports.charset = charset
71490exports.charsets = { lookup: charset }
71491exports.contentType = contentType
71492exports.extension = extension
71493exports.extensions = Object.create(null)
71494exports.lookup = lookup
71495exports.types = Object.create(null)
71496
71497// Populate the extensions/types maps
71498populateMaps(exports.extensions, exports.types)
71499
71500/**
71501 * Get the default charset for a MIME type.
71502 *
71503 * @param {string} type
71504 * @return {boolean|string}
71505 */
71506
71507function charset (type) {
71508 if (!type || typeof type !== 'string') {
71509 return false
71510 }
71511
71512 // TODO: use media-typer
71513 var match = EXTRACT_TYPE_REGEXP.exec(type)
71514 var mime = match && db[match[1].toLowerCase()]
71515
71516 if (mime && mime.charset) {
71517 return mime.charset
71518 }
71519
71520 // default text/* to utf-8
71521 if (match && TEXT_TYPE_REGEXP.test(match[1])) {
71522 return 'UTF-8'
71523 }
71524
71525 return false
71526}
71527
71528/**
71529 * Create a full Content-Type header given a MIME type or extension.
71530 *
71531 * @param {string} str
71532 * @return {boolean|string}
71533 */
71534
71535function contentType (str) {
71536 // TODO: should this even be in this module?
71537 if (!str || typeof str !== 'string') {
71538 return false
71539 }
71540
71541 var mime = str.indexOf('/') === -1
71542 ? exports.lookup(str)
71543 : str
71544
71545 if (!mime) {
71546 return false
71547 }
71548
71549 // TODO: use content-type or other module
71550 if (mime.indexOf('charset') === -1) {
71551 var charset = exports.charset(mime)
71552 if (charset) mime += '; charset=' + charset.toLowerCase()
71553 }
71554
71555 return mime
71556}
71557
71558/**
71559 * Get the default extension for a MIME type.
71560 *
71561 * @param {string} type
71562 * @return {boolean|string}
71563 */
71564
71565function extension (type) {
71566 if (!type || typeof type !== 'string') {
71567 return false
71568 }
71569
71570 // TODO: use media-typer
71571 var match = EXTRACT_TYPE_REGEXP.exec(type)
71572
71573 // get extensions
71574 var exts = match && exports.extensions[match[1].toLowerCase()]
71575
71576 if (!exts || !exts.length) {
71577 return false
71578 }
71579
71580 return exts[0]
71581}
71582
71583/**
71584 * Lookup the MIME type for a file path/extension.
71585 *
71586 * @param {string} path
71587 * @return {boolean|string}
71588 */
71589
71590function lookup (path) {
71591 if (!path || typeof path !== 'string') {
71592 return false
71593 }
71594
71595 // get the extension ("ext" or ".ext" or full path)
71596 var extension = extname('x.' + path)
71597 .toLowerCase()
71598 .substr(1)
71599
71600 if (!extension) {
71601 return false
71602 }
71603
71604 return exports.types[extension] || false
71605}
71606
71607/**
71608 * Populate the extensions and types maps.
71609 * @private
71610 */
71611
71612function populateMaps (extensions, types) {
71613 // source preference (least -> most)
71614 var preference = ['nginx', 'apache', undefined, 'iana']
71615
71616 Object.keys(db).forEach(function forEachMimeType (type) {
71617 var mime = db[type]
71618 var exts = mime.extensions
71619
71620 if (!exts || !exts.length) {
71621 return
71622 }
71623
71624 // mime -> extensions
71625 extensions[type] = exts
71626
71627 // extension -> mime
71628 for (var i = 0; i < exts.length; i++) {
71629 var extension = exts[i]
71630
71631 if (types[extension]) {
71632 var from = preference.indexOf(db[types[extension]].source)
71633 var to = preference.indexOf(mime.source)
71634
71635 if (types[extension] !== 'application/octet-stream' &&
71636 (from > to || (from === to && types[extension].substr(0, 12) === 'application/'))) {
71637 // skip the remapping
71638 continue
71639 }
71640 }
71641
71642 // set the extension -> mime
71643 types[extension] = type
71644 }
71645 })
71646}
71647
71648
71649/***/ }),
71650/* 371 */
71651/***/ (function(module, exports, __webpack_require__) {
71652
71653var Stream = __webpack_require__(35)
71654
71655module.exports = MuteStream
71656
71657// var out = new MuteStream(process.stdout)
71658// argument auto-pipes
71659function MuteStream (opts) {
71660 Stream.apply(this)
71661 opts = opts || {}
71662 this.writable = this.readable = true
71663 this.muted = false
71664 this.on('pipe', this._onpipe)
71665 this.replace = opts.replace
71666
71667 // For readline-type situations
71668 // This much at the start of a line being redrawn after a ctrl char
71669 // is seen (such as backspace) won't be redrawn as the replacement
71670 this._prompt = opts.prompt || null
71671 this._hadControl = false
71672}
71673
71674MuteStream.prototype = Object.create(Stream.prototype)
71675
71676Object.defineProperty(MuteStream.prototype, 'constructor', {
71677 value: MuteStream,
71678 enumerable: false
71679})
71680
71681MuteStream.prototype.mute = function () {
71682 this.muted = true
71683}
71684
71685MuteStream.prototype.unmute = function () {
71686 this.muted = false
71687}
71688
71689Object.defineProperty(MuteStream.prototype, '_onpipe', {
71690 value: onPipe,
71691 enumerable: false,
71692 writable: true,
71693 configurable: true
71694})
71695
71696function onPipe (src) {
71697 this._src = src
71698}
71699
71700Object.defineProperty(MuteStream.prototype, 'isTTY', {
71701 get: getIsTTY,
71702 set: setIsTTY,
71703 enumerable: true,
71704 configurable: true
71705})
71706
71707function getIsTTY () {
71708 return( (this._dest) ? this._dest.isTTY
71709 : (this._src) ? this._src.isTTY
71710 : false
71711 )
71712}
71713
71714// basically just get replace the getter/setter with a regular value
71715function setIsTTY (isTTY) {
71716 Object.defineProperty(this, 'isTTY', {
71717 value: isTTY,
71718 enumerable: true,
71719 writable: true,
71720 configurable: true
71721 })
71722}
71723
71724Object.defineProperty(MuteStream.prototype, 'rows', {
71725 get: function () {
71726 return( this._dest ? this._dest.rows
71727 : this._src ? this._src.rows
71728 : undefined )
71729 }, enumerable: true, configurable: true })
71730
71731Object.defineProperty(MuteStream.prototype, 'columns', {
71732 get: function () {
71733 return( this._dest ? this._dest.columns
71734 : this._src ? this._src.columns
71735 : undefined )
71736 }, enumerable: true, configurable: true })
71737
71738
71739MuteStream.prototype.pipe = function (dest, options) {
71740 this._dest = dest
71741 return Stream.prototype.pipe.call(this, dest, options)
71742}
71743
71744MuteStream.prototype.pause = function () {
71745 if (this._src) return this._src.pause()
71746}
71747
71748MuteStream.prototype.resume = function () {
71749 if (this._src) return this._src.resume()
71750}
71751
71752MuteStream.prototype.write = function (c) {
71753 if (this.muted) {
71754 if (!this.replace) return true
71755 if (c.match(/^\u001b/)) {
71756 if(c.indexOf(this._prompt) === 0) {
71757 c = c.substr(this._prompt.length);
71758 c = c.replace(/./g, this.replace);
71759 c = this._prompt + c;
71760 }
71761 this._hadControl = true
71762 return this.emit('data', c)
71763 } else {
71764 if (this._prompt && this._hadControl &&
71765 c.indexOf(this._prompt) === 0) {
71766 this._hadControl = false
71767 this.emit('data', this._prompt)
71768 c = c.substr(this._prompt.length)
71769 }
71770 c = c.toString().replace(/./g, this.replace)
71771 }
71772 }
71773 this.emit('data', c)
71774}
71775
71776MuteStream.prototype.end = function (c) {
71777 if (this.muted) {
71778 if (c && this.replace) {
71779 c = c.toString().replace(/./g, this.replace)
71780 } else {
71781 c = null
71782 }
71783 }
71784 if (c) this.emit('data', c)
71785 this.emit('end')
71786}
71787
71788function proxy (fn) { return function () {
71789 var d = this._dest
71790 var s = this._src
71791 if (d && d[fn]) d[fn].apply(d, arguments)
71792 if (s && s[fn]) s[fn].apply(s, arguments)
71793}}
71794
71795MuteStream.prototype.destroy = proxy('destroy')
71796MuteStream.prototype.destroySoon = proxy('destroySoon')
71797MuteStream.prototype.close = proxy('close')
71798
71799
71800/***/ }),
71801/* 372 */
71802/***/ (function(module, exports, __webpack_require__) {
71803
71804"use strict";
71805
71806const url = __webpack_require__(29);
71807const punycode = __webpack_require__(271);
71808const queryString = __webpack_require__(858);
71809const prependHttp = __webpack_require__(849);
71810const sortKeys = __webpack_require__(1007);
71811
71812const DEFAULT_PORTS = {
71813 'http:': 80,
71814 'https:': 443,
71815 'ftp:': 21
71816};
71817
71818// Protocols that always contain a `//`` bit
71819const slashedProtocol = {
71820 http: true,
71821 https: true,
71822 ftp: true,
71823 gopher: true,
71824 file: true,
71825 'http:': true,
71826 'https:': true,
71827 'ftp:': true,
71828 'gopher:': true,
71829 'file:': true
71830};
71831
71832function testParameter(name, filters) {
71833 return filters.some(filter => filter instanceof RegExp ? filter.test(name) : filter === name);
71834}
71835
71836module.exports = (str, opts) => {
71837 opts = Object.assign({
71838 normalizeProtocol: true,
71839 normalizeHttps: false,
71840 stripFragment: true,
71841 stripWWW: true,
71842 removeQueryParameters: [/^utm_\w+/i],
71843 removeTrailingSlash: true,
71844 removeDirectoryIndex: false,
71845 sortQueryParameters: true
71846 }, opts);
71847
71848 if (typeof str !== 'string') {
71849 throw new TypeError('Expected a string');
71850 }
71851
71852 const hasRelativeProtocol = str.startsWith('//');
71853
71854 // Prepend protocol
71855 str = prependHttp(str.trim()).replace(/^\/\//, 'http://');
71856
71857 const urlObj = url.parse(str);
71858
71859 if (opts.normalizeHttps && urlObj.protocol === 'https:') {
71860 urlObj.protocol = 'http:';
71861 }
71862
71863 if (!urlObj.hostname && !urlObj.pathname) {
71864 throw new Error('Invalid URL');
71865 }
71866
71867 // Prevent these from being used by `url.format`
71868 delete urlObj.host;
71869 delete urlObj.query;
71870
71871 // Remove fragment
71872 if (opts.stripFragment) {
71873 delete urlObj.hash;
71874 }
71875
71876 // Remove default port
71877 const port = DEFAULT_PORTS[urlObj.protocol];
71878 if (Number(urlObj.port) === port) {
71879 delete urlObj.port;
71880 }
71881
71882 // Remove duplicate slashes
71883 if (urlObj.pathname) {
71884 urlObj.pathname = urlObj.pathname.replace(/\/{2,}/g, '/');
71885 }
71886
71887 // Decode URI octets
71888 if (urlObj.pathname) {
71889 urlObj.pathname = decodeURI(urlObj.pathname);
71890 }
71891
71892 // Remove directory index
71893 if (opts.removeDirectoryIndex === true) {
71894 opts.removeDirectoryIndex = [/^index\.[a-z]+$/];
71895 }
71896
71897 if (Array.isArray(opts.removeDirectoryIndex) && opts.removeDirectoryIndex.length > 0) {
71898 let pathComponents = urlObj.pathname.split('/');
71899 const lastComponent = pathComponents[pathComponents.length - 1];
71900
71901 if (testParameter(lastComponent, opts.removeDirectoryIndex)) {
71902 pathComponents = pathComponents.slice(0, pathComponents.length - 1);
71903 urlObj.pathname = pathComponents.slice(1).join('/') + '/';
71904 }
71905 }
71906
71907 // Resolve relative paths, but only for slashed protocols
71908 if (slashedProtocol[urlObj.protocol]) {
71909 const domain = urlObj.protocol + '//' + urlObj.hostname;
71910 const relative = url.resolve(domain, urlObj.pathname);
71911 urlObj.pathname = relative.replace(domain, '');
71912 }
71913
71914 if (urlObj.hostname) {
71915 // IDN to Unicode
71916 urlObj.hostname = punycode.toUnicode(urlObj.hostname).toLowerCase();
71917
71918 // Remove trailing dot
71919 urlObj.hostname = urlObj.hostname.replace(/\.$/, '');
71920
71921 // Remove `www.`
71922 if (opts.stripWWW) {
71923 urlObj.hostname = urlObj.hostname.replace(/^www\./, '');
71924 }
71925 }
71926
71927 // Remove URL with empty query string
71928 if (urlObj.search === '?') {
71929 delete urlObj.search;
71930 }
71931
71932 const queryParameters = queryString.parse(urlObj.search);
71933
71934 // Remove query unwanted parameters
71935 if (Array.isArray(opts.removeQueryParameters)) {
71936 for (const key in queryParameters) {
71937 if (testParameter(key, opts.removeQueryParameters)) {
71938 delete queryParameters[key];
71939 }
71940 }
71941 }
71942
71943 // Sort query parameters
71944 if (opts.sortQueryParameters) {
71945 urlObj.search = queryString.stringify(sortKeys(queryParameters));
71946 }
71947
71948 // Decode query parameters
71949 if (urlObj.search !== null) {
71950 urlObj.search = decodeURIComponent(urlObj.search);
71951 }
71952
71953 // Take advantage of many of the Node `url` normalizations
71954 str = url.format(urlObj);
71955
71956 // Remove ending `/`
71957 if (opts.removeTrailingSlash || urlObj.pathname === '/') {
71958 str = str.replace(/\/$/, '');
71959 }
71960
71961 // Restore relative protocol, if applicable
71962 if (hasRelativeProtocol && !opts.normalizeProtocol) {
71963 str = str.replace(/^http:\/\//, '//');
71964 }
71965
71966 return str;
71967};
71968
71969
71970/***/ }),
71971/* 373 */
71972/***/ (function(module, exports, __webpack_require__) {
71973
71974"use strict";
71975
71976
71977var replace = String.prototype.replace;
71978var percentTwenties = /%20/g;
71979
71980module.exports = {
71981 'default': 'RFC3986',
71982 formatters: {
71983 RFC1738: function (value) {
71984 return replace.call(value, percentTwenties, '+');
71985 },
71986 RFC3986: function (value) {
71987 return value;
71988 }
71989 },
71990 RFC1738: 'RFC1738',
71991 RFC3986: 'RFC3986'
71992};
71993
71994
71995/***/ }),
71996/* 374 */
71997/***/ (function(module, exports, __webpack_require__) {
71998
71999"use strict";
72000
72001
72002var stringify = __webpack_require__(857);
72003var parse = __webpack_require__(856);
72004var formats = __webpack_require__(373);
72005
72006module.exports = {
72007 formats: formats,
72008 parse: parse,
72009 stringify: stringify
72010};
72011
72012
72013/***/ }),
72014/* 375 */
72015/***/ (function(module, exports, __webpack_require__) {
72016
72017"use strict";
72018
72019
72020var has = Object.prototype.hasOwnProperty;
72021
72022var hexTable = (function () {
72023 var array = [];
72024 for (var i = 0; i < 256; ++i) {
72025 array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
72026 }
72027
72028 return array;
72029}());
72030
72031var compactQueue = function compactQueue(queue) {
72032 var obj;
72033
72034 while (queue.length) {
72035 var item = queue.pop();
72036 obj = item.obj[item.prop];
72037
72038 if (Array.isArray(obj)) {
72039 var compacted = [];
72040
72041 for (var j = 0; j < obj.length; ++j) {
72042 if (typeof obj[j] !== 'undefined') {
72043 compacted.push(obj[j]);
72044 }
72045 }
72046
72047 item.obj[item.prop] = compacted;
72048 }
72049 }
72050
72051 return obj;
72052};
72053
72054var arrayToObject = function arrayToObject(source, options) {
72055 var obj = options && options.plainObjects ? Object.create(null) : {};
72056 for (var i = 0; i < source.length; ++i) {
72057 if (typeof source[i] !== 'undefined') {
72058 obj[i] = source[i];
72059 }
72060 }
72061
72062 return obj;
72063};
72064
72065var merge = function merge(target, source, options) {
72066 if (!source) {
72067 return target;
72068 }
72069
72070 if (typeof source !== 'object') {
72071 if (Array.isArray(target)) {
72072 target.push(source);
72073 } else if (typeof target === 'object') {
72074 if (options.plainObjects || options.allowPrototypes || !has.call(Object.prototype, source)) {
72075 target[source] = true;
72076 }
72077 } else {
72078 return [target, source];
72079 }
72080
72081 return target;
72082 }
72083
72084 if (typeof target !== 'object') {
72085 return [target].concat(source);
72086 }
72087
72088 var mergeTarget = target;
72089 if (Array.isArray(target) && !Array.isArray(source)) {
72090 mergeTarget = arrayToObject(target, options);
72091 }
72092
72093 if (Array.isArray(target) && Array.isArray(source)) {
72094 source.forEach(function (item, i) {
72095 if (has.call(target, i)) {
72096 if (target[i] && typeof target[i] === 'object') {
72097 target[i] = merge(target[i], item, options);
72098 } else {
72099 target.push(item);
72100 }
72101 } else {
72102 target[i] = item;
72103 }
72104 });
72105 return target;
72106 }
72107
72108 return Object.keys(source).reduce(function (acc, key) {
72109 var value = source[key];
72110
72111 if (has.call(acc, key)) {
72112 acc[key] = merge(acc[key], value, options);
72113 } else {
72114 acc[key] = value;
72115 }
72116 return acc;
72117 }, mergeTarget);
72118};
72119
72120var assign = function assignSingleSource(target, source) {
72121 return Object.keys(source).reduce(function (acc, key) {
72122 acc[key] = source[key];
72123 return acc;
72124 }, target);
72125};
72126
72127var decode = function (str) {
72128 try {
72129 return decodeURIComponent(str.replace(/\+/g, ' '));
72130 } catch (e) {
72131 return str;
72132 }
72133};
72134
72135var encode = function encode(str) {
72136 // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
72137 // It has been adapted here for stricter adherence to RFC 3986
72138 if (str.length === 0) {
72139 return str;
72140 }
72141
72142 var string = typeof str === 'string' ? str : String(str);
72143
72144 var out = '';
72145 for (var i = 0; i < string.length; ++i) {
72146 var c = string.charCodeAt(i);
72147
72148 if (
72149 c === 0x2D // -
72150 || c === 0x2E // .
72151 || c === 0x5F // _
72152 || c === 0x7E // ~
72153 || (c >= 0x30 && c <= 0x39) // 0-9
72154 || (c >= 0x41 && c <= 0x5A) // a-z
72155 || (c >= 0x61 && c <= 0x7A) // A-Z
72156 ) {
72157 out += string.charAt(i);
72158 continue;
72159 }
72160
72161 if (c < 0x80) {
72162 out = out + hexTable[c];
72163 continue;
72164 }
72165
72166 if (c < 0x800) {
72167 out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
72168 continue;
72169 }
72170
72171 if (c < 0xD800 || c >= 0xE000) {
72172 out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
72173 continue;
72174 }
72175
72176 i += 1;
72177 c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
72178 out += hexTable[0xF0 | (c >> 18)]
72179 + hexTable[0x80 | ((c >> 12) & 0x3F)]
72180 + hexTable[0x80 | ((c >> 6) & 0x3F)]
72181 + hexTable[0x80 | (c & 0x3F)];
72182 }
72183
72184 return out;
72185};
72186
72187var compact = function compact(value) {
72188 var queue = [{ obj: { o: value }, prop: 'o' }];
72189 var refs = [];
72190
72191 for (var i = 0; i < queue.length; ++i) {
72192 var item = queue[i];
72193 var obj = item.obj[item.prop];
72194
72195 var keys = Object.keys(obj);
72196 for (var j = 0; j < keys.length; ++j) {
72197 var key = keys[j];
72198 var val = obj[key];
72199 if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
72200 queue.push({ obj: obj, prop: key });
72201 refs.push(val);
72202 }
72203 }
72204 }
72205
72206 return compactQueue(queue);
72207};
72208
72209var isRegExp = function isRegExp(obj) {
72210 return Object.prototype.toString.call(obj) === '[object RegExp]';
72211};
72212
72213var isBuffer = function isBuffer(obj) {
72214 if (obj === null || typeof obj === 'undefined') {
72215 return false;
72216 }
72217
72218 return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
72219};
72220
72221module.exports = {
72222 arrayToObject: arrayToObject,
72223 assign: assign,
72224 compact: compact,
72225 decode: decode,
72226 encode: encode,
72227 isBuffer: isBuffer,
72228 isRegExp: isRegExp,
72229 merge: merge
72230};
72231
72232
72233/***/ }),
72234/* 376 */
72235/***/ (function(module, exports, __webpack_require__) {
72236
72237"use strict";
72238// Copyright Joyent, Inc. and other Node contributors.
72239//
72240// Permission is hereby granted, free of charge, to any person obtaining a
72241// copy of this software and associated documentation files (the
72242// "Software"), to deal in the Software without restriction, including
72243// without limitation the rights to use, copy, modify, merge, publish,
72244// distribute, sublicense, and/or sell copies of the Software, and to permit
72245// persons to whom the Software is furnished to do so, subject to the
72246// following conditions:
72247//
72248// The above copyright notice and this permission notice shall be included
72249// in all copies or substantial portions of the Software.
72250//
72251// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
72252// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
72253// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
72254// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
72255// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
72256// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
72257// USE OR OTHER DEALINGS IN THE SOFTWARE.
72258
72259
72260
72261/*<replacement>*/
72262
72263var pna = __webpack_require__(171);
72264/*</replacement>*/
72265
72266module.exports = Readable;
72267
72268/*<replacement>*/
72269var isArray = __webpack_require__(366);
72270/*</replacement>*/
72271
72272/*<replacement>*/
72273var Duplex;
72274/*</replacement>*/
72275
72276Readable.ReadableState = ReadableState;
72277
72278/*<replacement>*/
72279var EE = __webpack_require__(95).EventEmitter;
72280
72281var EElistenerCount = function (emitter, type) {
72282 return emitter.listeners(type).length;
72283};
72284/*</replacement>*/
72285
72286/*<replacement>*/
72287var Stream = __webpack_require__(380);
72288/*</replacement>*/
72289
72290/*<replacement>*/
72291
72292var Buffer = __webpack_require__(60).Buffer;
72293var OurUint8Array = global.Uint8Array || function () {};
72294function _uint8ArrayToBuffer(chunk) {
72295 return Buffer.from(chunk);
72296}
72297function _isUint8Array(obj) {
72298 return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
72299}
72300
72301/*</replacement>*/
72302
72303/*<replacement>*/
72304var util = __webpack_require__(105);
72305util.inherits = __webpack_require__(78);
72306/*</replacement>*/
72307
72308/*<replacement>*/
72309var debugUtil = __webpack_require__(9);
72310var debug = void 0;
72311if (debugUtil && debugUtil.debuglog) {
72312 debug = debugUtil.debuglog('stream');
72313} else {
72314 debug = function () {};
72315}
72316/*</replacement>*/
72317
72318var BufferList = __webpack_require__(865);
72319var destroyImpl = __webpack_require__(379);
72320var StringDecoder;
72321
72322util.inherits(Readable, Stream);
72323
72324var kProxyEvents = ['error', 'close', 'destroy', 'pause', 'resume'];
72325
72326function prependListener(emitter, event, fn) {
72327 // Sadly this is not cacheable as some libraries bundle their own
72328 // event emitter implementation with them.
72329 if (typeof emitter.prependListener === 'function') return emitter.prependListener(event, fn);
72330
72331 // This is a hack to make sure that our error handler is attached before any
72332 // userland ones. NEVER DO THIS. This is here only because this code needs
72333 // to continue to work with older versions of Node.js that do not include
72334 // the prependListener() method. The goal is to eventually remove this hack.
72335 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]];
72336}
72337
72338function ReadableState(options, stream) {
72339 Duplex = Duplex || __webpack_require__(110);
72340
72341 options = options || {};
72342
72343 // Duplex streams are both readable and writable, but share
72344 // the same options object.
72345 // However, some cases require setting options to different
72346 // values for the readable and the writable sides of the duplex stream.
72347 // These options can be provided separately as readableXXX and writableXXX.
72348 var isDuplex = stream instanceof Duplex;
72349
72350 // object stream flag. Used to make read(n) ignore n and to
72351 // make all the buffer merging and length checks go away
72352 this.objectMode = !!options.objectMode;
72353
72354 if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
72355
72356 // the point at which it stops calling _read() to fill the buffer
72357 // Note: 0 is a valid value, means "don't call _read preemptively ever"
72358 var hwm = options.highWaterMark;
72359 var readableHwm = options.readableHighWaterMark;
72360 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
72361
72362 if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;else this.highWaterMark = defaultHwm;
72363
72364 // cast to ints.
72365 this.highWaterMark = Math.floor(this.highWaterMark);
72366
72367 // A linked list is used to store data chunks instead of an array because the
72368 // linked list can remove elements from the beginning faster than
72369 // array.shift()
72370 this.buffer = new BufferList();
72371 this.length = 0;
72372 this.pipes = null;
72373 this.pipesCount = 0;
72374 this.flowing = null;
72375 this.ended = false;
72376 this.endEmitted = false;
72377 this.reading = false;
72378
72379 // a flag to be able to tell if the event 'readable'/'data' is emitted
72380 // immediately, or on a later tick. We set this to true at first, because
72381 // any actions that shouldn't happen until "later" should generally also
72382 // not happen before the first read call.
72383 this.sync = true;
72384
72385 // whenever we return null, then we set a flag to say
72386 // that we're awaiting a 'readable' event emission.
72387 this.needReadable = false;
72388 this.emittedReadable = false;
72389 this.readableListening = false;
72390 this.resumeScheduled = false;
72391
72392 // has it been destroyed
72393 this.destroyed = false;
72394
72395 // Crypto is kind of old and crusty. Historically, its default string
72396 // encoding is 'binary' so we have to make this configurable.
72397 // Everything else in the universe uses 'utf8', though.
72398 this.defaultEncoding = options.defaultEncoding || 'utf8';
72399
72400 // the number of writers that are awaiting a drain event in .pipe()s
72401 this.awaitDrain = 0;
72402
72403 // if true, a maybeReadMore has been scheduled
72404 this.readingMore = false;
72405
72406 this.decoder = null;
72407 this.encoding = null;
72408 if (options.encoding) {
72409 if (!StringDecoder) StringDecoder = __webpack_require__(428).StringDecoder;
72410 this.decoder = new StringDecoder(options.encoding);
72411 this.encoding = options.encoding;
72412 }
72413}
72414
72415function Readable(options) {
72416 Duplex = Duplex || __webpack_require__(110);
72417
72418 if (!(this instanceof Readable)) return new Readable(options);
72419
72420 this._readableState = new ReadableState(options, this);
72421
72422 // legacy
72423 this.readable = true;
72424
72425 if (options) {
72426 if (typeof options.read === 'function') this._read = options.read;
72427
72428 if (typeof options.destroy === 'function') this._destroy = options.destroy;
72429 }
72430
72431 Stream.call(this);
72432}
72433
72434Object.defineProperty(Readable.prototype, 'destroyed', {
72435 get: function () {
72436 if (this._readableState === undefined) {
72437 return false;
72438 }
72439 return this._readableState.destroyed;
72440 },
72441 set: function (value) {
72442 // we ignore the value if the stream
72443 // has not been initialized yet
72444 if (!this._readableState) {
72445 return;
72446 }
72447
72448 // backward compatibility, the user is explicitly
72449 // managing destroyed
72450 this._readableState.destroyed = value;
72451 }
72452});
72453
72454Readable.prototype.destroy = destroyImpl.destroy;
72455Readable.prototype._undestroy = destroyImpl.undestroy;
72456Readable.prototype._destroy = function (err, cb) {
72457 this.push(null);
72458 cb(err);
72459};
72460
72461// Manually shove something into the read() buffer.
72462// This returns true if the highWaterMark has not been hit yet,
72463// similar to how Writable.write() returns true if you should
72464// write() some more.
72465Readable.prototype.push = function (chunk, encoding) {
72466 var state = this._readableState;
72467 var skipChunkCheck;
72468
72469 if (!state.objectMode) {
72470 if (typeof chunk === 'string') {
72471 encoding = encoding || state.defaultEncoding;
72472 if (encoding !== state.encoding) {
72473 chunk = Buffer.from(chunk, encoding);
72474 encoding = '';
72475 }
72476 skipChunkCheck = true;
72477 }
72478 } else {
72479 skipChunkCheck = true;
72480 }
72481
72482 return readableAddChunk(this, chunk, encoding, false, skipChunkCheck);
72483};
72484
72485// Unshift should *always* be something directly out of read()
72486Readable.prototype.unshift = function (chunk) {
72487 return readableAddChunk(this, chunk, null, true, false);
72488};
72489
72490function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
72491 var state = stream._readableState;
72492 if (chunk === null) {
72493 state.reading = false;
72494 onEofChunk(stream, state);
72495 } else {
72496 var er;
72497 if (!skipChunkCheck) er = chunkInvalid(state, chunk);
72498 if (er) {
72499 stream.emit('error', er);
72500 } else if (state.objectMode || chunk && chunk.length > 0) {
72501 if (typeof chunk !== 'string' && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
72502 chunk = _uint8ArrayToBuffer(chunk);
72503 }
72504
72505 if (addToFront) {
72506 if (state.endEmitted) stream.emit('error', new Error('stream.unshift() after end event'));else addChunk(stream, state, chunk, true);
72507 } else if (state.ended) {
72508 stream.emit('error', new Error('stream.push() after EOF'));
72509 } else {
72510 state.reading = false;
72511 if (state.decoder && !encoding) {
72512 chunk = state.decoder.write(chunk);
72513 if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);else maybeReadMore(stream, state);
72514 } else {
72515 addChunk(stream, state, chunk, false);
72516 }
72517 }
72518 } else if (!addToFront) {
72519 state.reading = false;
72520 }
72521 }
72522
72523 return needMoreData(state);
72524}
72525
72526function addChunk(stream, state, chunk, addToFront) {
72527 if (state.flowing && state.length === 0 && !state.sync) {
72528 stream.emit('data', chunk);
72529 stream.read(0);
72530 } else {
72531 // update the buffer info.
72532 state.length += state.objectMode ? 1 : chunk.length;
72533 if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
72534
72535 if (state.needReadable) emitReadable(stream);
72536 }
72537 maybeReadMore(stream, state);
72538}
72539
72540function chunkInvalid(state, chunk) {
72541 var er;
72542 if (!_isUint8Array(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
72543 er = new TypeError('Invalid non-string/buffer chunk');
72544 }
72545 return er;
72546}
72547
72548// if it's past the high water mark, we can push in some more.
72549// Also, if we have no data yet, we can stand some
72550// more bytes. This is to work around cases where hwm=0,
72551// such as the repl. Also, if the push() triggered a
72552// readable event, and the user called read(largeNumber) such that
72553// needReadable was set, then we ought to push more, so that another
72554// 'readable' event will be triggered.
72555function needMoreData(state) {
72556 return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
72557}
72558
72559Readable.prototype.isPaused = function () {
72560 return this._readableState.flowing === false;
72561};
72562
72563// backwards compatibility.
72564Readable.prototype.setEncoding = function (enc) {
72565 if (!StringDecoder) StringDecoder = __webpack_require__(428).StringDecoder;
72566 this._readableState.decoder = new StringDecoder(enc);
72567 this._readableState.encoding = enc;
72568 return this;
72569};
72570
72571// Don't raise the hwm > 8MB
72572var MAX_HWM = 0x800000;
72573function computeNewHighWaterMark(n) {
72574 if (n >= MAX_HWM) {
72575 n = MAX_HWM;
72576 } else {
72577 // Get the next highest power of 2 to prevent increasing hwm excessively in
72578 // tiny amounts
72579 n--;
72580 n |= n >>> 1;
72581 n |= n >>> 2;
72582 n |= n >>> 4;
72583 n |= n >>> 8;
72584 n |= n >>> 16;
72585 n++;
72586 }
72587 return n;
72588}
72589
72590// This function is designed to be inlinable, so please take care when making
72591// changes to the function body.
72592function howMuchToRead(n, state) {
72593 if (n <= 0 || state.length === 0 && state.ended) return 0;
72594 if (state.objectMode) return 1;
72595 if (n !== n) {
72596 // Only flow one buffer at a time
72597 if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
72598 }
72599 // If we're asking for more than the current hwm, then raise the hwm.
72600 if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
72601 if (n <= state.length) return n;
72602 // Don't have enough
72603 if (!state.ended) {
72604 state.needReadable = true;
72605 return 0;
72606 }
72607 return state.length;
72608}
72609
72610// you can override either this method, or the async _read(n) below.
72611Readable.prototype.read = function (n) {
72612 debug('read', n);
72613 n = parseInt(n, 10);
72614 var state = this._readableState;
72615 var nOrig = n;
72616
72617 if (n !== 0) state.emittedReadable = false;
72618
72619 // if we're doing read(0) to trigger a readable event, but we
72620 // already have a bunch of data in the buffer, then just trigger
72621 // the 'readable' event and move on.
72622 if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
72623 debug('read: emitReadable', state.length, state.ended);
72624 if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
72625 return null;
72626 }
72627
72628 n = howMuchToRead(n, state);
72629
72630 // if we've ended, and we're now clear, then finish it up.
72631 if (n === 0 && state.ended) {
72632 if (state.length === 0) endReadable(this);
72633 return null;
72634 }
72635
72636 // All the actual chunk generation logic needs to be
72637 // *below* the call to _read. The reason is that in certain
72638 // synthetic stream cases, such as passthrough streams, _read
72639 // may be a completely synchronous operation which may change
72640 // the state of the read buffer, providing enough data when
72641 // before there was *not* enough.
72642 //
72643 // So, the steps are:
72644 // 1. Figure out what the state of things will be after we do
72645 // a read from the buffer.
72646 //
72647 // 2. If that resulting state will trigger a _read, then call _read.
72648 // Note that this may be asynchronous, or synchronous. Yes, it is
72649 // deeply ugly to write APIs this way, but that still doesn't mean
72650 // that the Readable class should behave improperly, as streams are
72651 // designed to be sync/async agnostic.
72652 // Take note if the _read call is sync or async (ie, if the read call
72653 // has returned yet), so that we know whether or not it's safe to emit
72654 // 'readable' etc.
72655 //
72656 // 3. Actually pull the requested chunks out of the buffer and return.
72657
72658 // if we need a readable event, then we need to do some reading.
72659 var doRead = state.needReadable;
72660 debug('need readable', doRead);
72661
72662 // if we currently have less than the highWaterMark, then also read some
72663 if (state.length === 0 || state.length - n < state.highWaterMark) {
72664 doRead = true;
72665 debug('length less than watermark', doRead);
72666 }
72667
72668 // however, if we've ended, then there's no point, and if we're already
72669 // reading, then it's unnecessary.
72670 if (state.ended || state.reading) {
72671 doRead = false;
72672 debug('reading or ended', doRead);
72673 } else if (doRead) {
72674 debug('do read');
72675 state.reading = true;
72676 state.sync = true;
72677 // if the length is currently zero, then we *need* a readable event.
72678 if (state.length === 0) state.needReadable = true;
72679 // call internal read method
72680 this._read(state.highWaterMark);
72681 state.sync = false;
72682 // If _read pushed data synchronously, then `reading` will be false,
72683 // and we need to re-evaluate how much data we can return to the user.
72684 if (!state.reading) n = howMuchToRead(nOrig, state);
72685 }
72686
72687 var ret;
72688 if (n > 0) ret = fromList(n, state);else ret = null;
72689
72690 if (ret === null) {
72691 state.needReadable = true;
72692 n = 0;
72693 } else {
72694 state.length -= n;
72695 }
72696
72697 if (state.length === 0) {
72698 // If we have nothing in the buffer, then we want to know
72699 // as soon as we *do* get something into the buffer.
72700 if (!state.ended) state.needReadable = true;
72701
72702 // If we tried to read() past the EOF, then emit end on the next tick.
72703 if (nOrig !== n && state.ended) endReadable(this);
72704 }
72705
72706 if (ret !== null) this.emit('data', ret);
72707
72708 return ret;
72709};
72710
72711function onEofChunk(stream, state) {
72712 if (state.ended) return;
72713 if (state.decoder) {
72714 var chunk = state.decoder.end();
72715 if (chunk && chunk.length) {
72716 state.buffer.push(chunk);
72717 state.length += state.objectMode ? 1 : chunk.length;
72718 }
72719 }
72720 state.ended = true;
72721
72722 // emit 'readable' now to make sure it gets picked up.
72723 emitReadable(stream);
72724}
72725
72726// Don't emit readable right away in sync mode, because this can trigger
72727// another read() call => stack overflow. This way, it might trigger
72728// a nextTick recursion warning, but that's not so bad.
72729function emitReadable(stream) {
72730 var state = stream._readableState;
72731 state.needReadable = false;
72732 if (!state.emittedReadable) {
72733 debug('emitReadable', state.flowing);
72734 state.emittedReadable = true;
72735 if (state.sync) pna.nextTick(emitReadable_, stream);else emitReadable_(stream);
72736 }
72737}
72738
72739function emitReadable_(stream) {
72740 debug('emit readable');
72741 stream.emit('readable');
72742 flow(stream);
72743}
72744
72745// at this point, the user has presumably seen the 'readable' event,
72746// and called read() to consume some data. that may have triggered
72747// in turn another _read(n) call, in which case reading = true if
72748// it's in progress.
72749// However, if we're not ended, or reading, and the length < hwm,
72750// then go ahead and try to read some more preemptively.
72751function maybeReadMore(stream, state) {
72752 if (!state.readingMore) {
72753 state.readingMore = true;
72754 pna.nextTick(maybeReadMore_, stream, state);
72755 }
72756}
72757
72758function maybeReadMore_(stream, state) {
72759 var len = state.length;
72760 while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
72761 debug('maybeReadMore read 0');
72762 stream.read(0);
72763 if (len === state.length)
72764 // didn't get any data, stop spinning.
72765 break;else len = state.length;
72766 }
72767 state.readingMore = false;
72768}
72769
72770// abstract method. to be overridden in specific implementation classes.
72771// call cb(er, data) where data is <= n in length.
72772// for virtual (non-string, non-buffer) streams, "length" is somewhat
72773// arbitrary, and perhaps not very meaningful.
72774Readable.prototype._read = function (n) {
72775 this.emit('error', new Error('_read() is not implemented'));
72776};
72777
72778Readable.prototype.pipe = function (dest, pipeOpts) {
72779 var src = this;
72780 var state = this._readableState;
72781
72782 switch (state.pipesCount) {
72783 case 0:
72784 state.pipes = dest;
72785 break;
72786 case 1:
72787 state.pipes = [state.pipes, dest];
72788 break;
72789 default:
72790 state.pipes.push(dest);
72791 break;
72792 }
72793 state.pipesCount += 1;
72794 debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
72795
72796 var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
72797
72798 var endFn = doEnd ? onend : unpipe;
72799 if (state.endEmitted) pna.nextTick(endFn);else src.once('end', endFn);
72800
72801 dest.on('unpipe', onunpipe);
72802 function onunpipe(readable, unpipeInfo) {
72803 debug('onunpipe');
72804 if (readable === src) {
72805 if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
72806 unpipeInfo.hasUnpiped = true;
72807 cleanup();
72808 }
72809 }
72810 }
72811
72812 function onend() {
72813 debug('onend');
72814 dest.end();
72815 }
72816
72817 // when the dest drains, it reduces the awaitDrain counter
72818 // on the source. This would be more elegant with a .once()
72819 // handler in flow(), but adding and removing repeatedly is
72820 // too slow.
72821 var ondrain = pipeOnDrain(src);
72822 dest.on('drain', ondrain);
72823
72824 var cleanedUp = false;
72825 function cleanup() {
72826 debug('cleanup');
72827 // cleanup event handlers once the pipe is broken
72828 dest.removeListener('close', onclose);
72829 dest.removeListener('finish', onfinish);
72830 dest.removeListener('drain', ondrain);
72831 dest.removeListener('error', onerror);
72832 dest.removeListener('unpipe', onunpipe);
72833 src.removeListener('end', onend);
72834 src.removeListener('end', unpipe);
72835 src.removeListener('data', ondata);
72836
72837 cleanedUp = true;
72838
72839 // if the reader is waiting for a drain event from this
72840 // specific writer, then it would cause it to never start
72841 // flowing again.
72842 // So, if this is awaiting a drain, then we just call it now.
72843 // If we don't know, then assume that we are waiting for one.
72844 if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
72845 }
72846
72847 // If the user pushes more data while we're writing to dest then we'll end up
72848 // in ondata again. However, we only want to increase awaitDrain once because
72849 // dest will only emit one 'drain' event for the multiple writes.
72850 // => Introduce a guard on increasing awaitDrain.
72851 var increasedAwaitDrain = false;
72852 src.on('data', ondata);
72853 function ondata(chunk) {
72854 debug('ondata');
72855 increasedAwaitDrain = false;
72856 var ret = dest.write(chunk);
72857 if (false === ret && !increasedAwaitDrain) {
72858 // If the user unpiped during `dest.write()`, it is possible
72859 // to get stuck in a permanently paused state if that write
72860 // also returned false.
72861 // => Check whether `dest` is still a piping destination.
72862 if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
72863 debug('false write response, pause', src._readableState.awaitDrain);
72864 src._readableState.awaitDrain++;
72865 increasedAwaitDrain = true;
72866 }
72867 src.pause();
72868 }
72869 }
72870
72871 // if the dest has an error, then stop piping into it.
72872 // however, don't suppress the throwing behavior for this.
72873 function onerror(er) {
72874 debug('onerror', er);
72875 unpipe();
72876 dest.removeListener('error', onerror);
72877 if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
72878 }
72879
72880 // Make sure our error handler is attached before userland ones.
72881 prependListener(dest, 'error', onerror);
72882
72883 // Both close and finish should trigger unpipe, but only once.
72884 function onclose() {
72885 dest.removeListener('finish', onfinish);
72886 unpipe();
72887 }
72888 dest.once('close', onclose);
72889 function onfinish() {
72890 debug('onfinish');
72891 dest.removeListener('close', onclose);
72892 unpipe();
72893 }
72894 dest.once('finish', onfinish);
72895
72896 function unpipe() {
72897 debug('unpipe');
72898 src.unpipe(dest);
72899 }
72900
72901 // tell the dest that it's being piped to
72902 dest.emit('pipe', src);
72903
72904 // start the flow if it hasn't been started already.
72905 if (!state.flowing) {
72906 debug('pipe resume');
72907 src.resume();
72908 }
72909
72910 return dest;
72911};
72912
72913function pipeOnDrain(src) {
72914 return function () {
72915 var state = src._readableState;
72916 debug('pipeOnDrain', state.awaitDrain);
72917 if (state.awaitDrain) state.awaitDrain--;
72918 if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
72919 state.flowing = true;
72920 flow(src);
72921 }
72922 };
72923}
72924
72925Readable.prototype.unpipe = function (dest) {
72926 var state = this._readableState;
72927 var unpipeInfo = { hasUnpiped: false };
72928
72929 // if we're not piping anywhere, then do nothing.
72930 if (state.pipesCount === 0) return this;
72931
72932 // just one destination. most common case.
72933 if (state.pipesCount === 1) {
72934 // passed in one, but it's not the right one.
72935 if (dest && dest !== state.pipes) return this;
72936
72937 if (!dest) dest = state.pipes;
72938
72939 // got a match.
72940 state.pipes = null;
72941 state.pipesCount = 0;
72942 state.flowing = false;
72943 if (dest) dest.emit('unpipe', this, unpipeInfo);
72944 return this;
72945 }
72946
72947 // slow case. multiple pipe destinations.
72948
72949 if (!dest) {
72950 // remove all.
72951 var dests = state.pipes;
72952 var len = state.pipesCount;
72953 state.pipes = null;
72954 state.pipesCount = 0;
72955 state.flowing = false;
72956
72957 for (var i = 0; i < len; i++) {
72958 dests[i].emit('unpipe', this, unpipeInfo);
72959 }return this;
72960 }
72961
72962 // try to find the right one.
72963 var index = indexOf(state.pipes, dest);
72964 if (index === -1) return this;
72965
72966 state.pipes.splice(index, 1);
72967 state.pipesCount -= 1;
72968 if (state.pipesCount === 1) state.pipes = state.pipes[0];
72969
72970 dest.emit('unpipe', this, unpipeInfo);
72971
72972 return this;
72973};
72974
72975// set up data events if they are asked for
72976// Ensure readable listeners eventually get something
72977Readable.prototype.on = function (ev, fn) {
72978 var res = Stream.prototype.on.call(this, ev, fn);
72979
72980 if (ev === 'data') {
72981 // Start flowing on next tick if stream isn't explicitly paused
72982 if (this._readableState.flowing !== false) this.resume();
72983 } else if (ev === 'readable') {
72984 var state = this._readableState;
72985 if (!state.endEmitted && !state.readableListening) {
72986 state.readableListening = state.needReadable = true;
72987 state.emittedReadable = false;
72988 if (!state.reading) {
72989 pna.nextTick(nReadingNextTick, this);
72990 } else if (state.length) {
72991 emitReadable(this);
72992 }
72993 }
72994 }
72995
72996 return res;
72997};
72998Readable.prototype.addListener = Readable.prototype.on;
72999
73000function nReadingNextTick(self) {
73001 debug('readable nexttick read 0');
73002 self.read(0);
73003}
73004
73005// pause() and resume() are remnants of the legacy readable stream API
73006// If the user uses them, then switch into old mode.
73007Readable.prototype.resume = function () {
73008 var state = this._readableState;
73009 if (!state.flowing) {
73010 debug('resume');
73011 state.flowing = true;
73012 resume(this, state);
73013 }
73014 return this;
73015};
73016
73017function resume(stream, state) {
73018 if (!state.resumeScheduled) {
73019 state.resumeScheduled = true;
73020 pna.nextTick(resume_, stream, state);
73021 }
73022}
73023
73024function resume_(stream, state) {
73025 if (!state.reading) {
73026 debug('resume read 0');
73027 stream.read(0);
73028 }
73029
73030 state.resumeScheduled = false;
73031 state.awaitDrain = 0;
73032 stream.emit('resume');
73033 flow(stream);
73034 if (state.flowing && !state.reading) stream.read(0);
73035}
73036
73037Readable.prototype.pause = function () {
73038 debug('call pause flowing=%j', this._readableState.flowing);
73039 if (false !== this._readableState.flowing) {
73040 debug('pause');
73041 this._readableState.flowing = false;
73042 this.emit('pause');
73043 }
73044 return this;
73045};
73046
73047function flow(stream) {
73048 var state = stream._readableState;
73049 debug('flow', state.flowing);
73050 while (state.flowing && stream.read() !== null) {}
73051}
73052
73053// wrap an old-style stream as the async data source.
73054// This is *not* part of the readable stream interface.
73055// It is an ugly unfortunate mess of history.
73056Readable.prototype.wrap = function (stream) {
73057 var _this = this;
73058
73059 var state = this._readableState;
73060 var paused = false;
73061
73062 stream.on('end', function () {
73063 debug('wrapped end');
73064 if (state.decoder && !state.ended) {
73065 var chunk = state.decoder.end();
73066 if (chunk && chunk.length) _this.push(chunk);
73067 }
73068
73069 _this.push(null);
73070 });
73071
73072 stream.on('data', function (chunk) {
73073 debug('wrapped data');
73074 if (state.decoder) chunk = state.decoder.write(chunk);
73075
73076 // don't skip over falsy values in objectMode
73077 if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
73078
73079 var ret = _this.push(chunk);
73080 if (!ret) {
73081 paused = true;
73082 stream.pause();
73083 }
73084 });
73085
73086 // proxy all the other methods.
73087 // important when wrapping filters and duplexes.
73088 for (var i in stream) {
73089 if (this[i] === undefined && typeof stream[i] === 'function') {
73090 this[i] = function (method) {
73091 return function () {
73092 return stream[method].apply(stream, arguments);
73093 };
73094 }(i);
73095 }
73096 }
73097
73098 // proxy certain important events.
73099 for (var n = 0; n < kProxyEvents.length; n++) {
73100 stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
73101 }
73102
73103 // when we try to consume some more bytes, simply unpause the
73104 // underlying stream.
73105 this._read = function (n) {
73106 debug('wrapped _read', n);
73107 if (paused) {
73108 paused = false;
73109 stream.resume();
73110 }
73111 };
73112
73113 return this;
73114};
73115
73116Object.defineProperty(Readable.prototype, 'readableHighWaterMark', {
73117 // making it explicit this property is not enumerable
73118 // because otherwise some prototype manipulation in
73119 // userland will fail
73120 enumerable: false,
73121 get: function () {
73122 return this._readableState.highWaterMark;
73123 }
73124});
73125
73126// exposed for testing purposes only.
73127Readable._fromList = fromList;
73128
73129// Pluck off n bytes from an array of buffers.
73130// Length is the combined lengths of all the buffers in the list.
73131// This function is designed to be inlinable, so please take care when making
73132// changes to the function body.
73133function fromList(n, state) {
73134 // nothing buffered
73135 if (state.length === 0) return null;
73136
73137 var ret;
73138 if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
73139 // read it all, truncate the list
73140 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);
73141 state.buffer.clear();
73142 } else {
73143 // read part of list
73144 ret = fromListPartial(n, state.buffer, state.decoder);
73145 }
73146
73147 return ret;
73148}
73149
73150// Extracts only enough buffered data to satisfy the amount requested.
73151// This function is designed to be inlinable, so please take care when making
73152// changes to the function body.
73153function fromListPartial(n, list, hasStrings) {
73154 var ret;
73155 if (n < list.head.data.length) {
73156 // slice is the same for buffers and strings
73157 ret = list.head.data.slice(0, n);
73158 list.head.data = list.head.data.slice(n);
73159 } else if (n === list.head.data.length) {
73160 // first chunk is a perfect match
73161 ret = list.shift();
73162 } else {
73163 // result spans more than one buffer
73164 ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
73165 }
73166 return ret;
73167}
73168
73169// Copies a specified amount of characters from the list of buffered data
73170// chunks.
73171// This function is designed to be inlinable, so please take care when making
73172// changes to the function body.
73173function copyFromBufferString(n, list) {
73174 var p = list.head;
73175 var c = 1;
73176 var ret = p.data;
73177 n -= ret.length;
73178 while (p = p.next) {
73179 var str = p.data;
73180 var nb = n > str.length ? str.length : n;
73181 if (nb === str.length) ret += str;else ret += str.slice(0, n);
73182 n -= nb;
73183 if (n === 0) {
73184 if (nb === str.length) {
73185 ++c;
73186 if (p.next) list.head = p.next;else list.head = list.tail = null;
73187 } else {
73188 list.head = p;
73189 p.data = str.slice(nb);
73190 }
73191 break;
73192 }
73193 ++c;
73194 }
73195 list.length -= c;
73196 return ret;
73197}
73198
73199// Copies a specified amount of bytes from the list of buffered data chunks.
73200// This function is designed to be inlinable, so please take care when making
73201// changes to the function body.
73202function copyFromBuffer(n, list) {
73203 var ret = Buffer.allocUnsafe(n);
73204 var p = list.head;
73205 var c = 1;
73206 p.data.copy(ret);
73207 n -= p.data.length;
73208 while (p = p.next) {
73209 var buf = p.data;
73210 var nb = n > buf.length ? buf.length : n;
73211 buf.copy(ret, ret.length - n, 0, nb);
73212 n -= nb;
73213 if (n === 0) {
73214 if (nb === buf.length) {
73215 ++c;
73216 if (p.next) list.head = p.next;else list.head = list.tail = null;
73217 } else {
73218 list.head = p;
73219 p.data = buf.slice(nb);
73220 }
73221 break;
73222 }
73223 ++c;
73224 }
73225 list.length -= c;
73226 return ret;
73227}
73228
73229function endReadable(stream) {
73230 var state = stream._readableState;
73231
73232 // If we get here before consuming all the bytes, then that is a
73233 // bug in node. Should never happen.
73234 if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
73235
73236 if (!state.endEmitted) {
73237 state.ended = true;
73238 pna.nextTick(endReadableNT, state, stream);
73239 }
73240}
73241
73242function endReadableNT(state, stream) {
73243 // Check that we didn't get one last unshift.
73244 if (!state.endEmitted && state.length === 0) {
73245 state.endEmitted = true;
73246 stream.readable = false;
73247 stream.emit('end');
73248 }
73249}
73250
73251function indexOf(xs, x) {
73252 for (var i = 0, l = xs.length; i < l; i++) {
73253 if (xs[i] === x) return i;
73254 }
73255 return -1;
73256}
73257
73258/***/ }),
73259/* 377 */
73260/***/ (function(module, exports, __webpack_require__) {
73261
73262"use strict";
73263// Copyright Joyent, Inc. and other Node contributors.
73264//
73265// Permission is hereby granted, free of charge, to any person obtaining a
73266// copy of this software and associated documentation files (the
73267// "Software"), to deal in the Software without restriction, including
73268// without limitation the rights to use, copy, modify, merge, publish,
73269// distribute, sublicense, and/or sell copies of the Software, and to permit
73270// persons to whom the Software is furnished to do so, subject to the
73271// following conditions:
73272//
73273// The above copyright notice and this permission notice shall be included
73274// in all copies or substantial portions of the Software.
73275//
73276// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
73277// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
73278// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
73279// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
73280// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
73281// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
73282// USE OR OTHER DEALINGS IN THE SOFTWARE.
73283
73284// a transform stream is a readable/writable stream where you do
73285// something with the data. Sometimes it's called a "filter",
73286// but that's not a great name for it, since that implies a thing where
73287// some bits pass through, and others are simply ignored. (That would
73288// be a valid example of a transform, of course.)
73289//
73290// While the output is causally related to the input, it's not a
73291// necessarily symmetric or synchronous transformation. For example,
73292// a zlib stream might take multiple plain-text writes(), and then
73293// emit a single compressed chunk some time in the future.
73294//
73295// Here's how this works:
73296//
73297// The Transform stream has all the aspects of the readable and writable
73298// stream classes. When you write(chunk), that calls _write(chunk,cb)
73299// internally, and returns false if there's a lot of pending writes
73300// buffered up. When you call read(), that calls _read(n) until
73301// there's enough pending readable data buffered up.
73302//
73303// In a transform stream, the written data is placed in a buffer. When
73304// _read(n) is called, it transforms the queued up data, calling the
73305// buffered _write cb's as it consumes chunks. If consuming a single
73306// written chunk would result in multiple output chunks, then the first
73307// outputted bit calls the readcb, and subsequent chunks just go into
73308// the read buffer, and will cause it to emit 'readable' if necessary.
73309//
73310// This way, back-pressure is actually determined by the reading side,
73311// since _read has to be called to start processing a new chunk. However,
73312// a pathological inflate type of transform can cause excessive buffering
73313// here. For example, imagine a stream where every byte of input is
73314// interpreted as an integer from 0-255, and then results in that many
73315// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in
73316// 1kb of data being output. In this case, you could write a very small
73317// amount of input, and end up with a very large amount of output. In
73318// such a pathological inflating mechanism, there'd be no way to tell
73319// the system to stop doing the transform. A single 4MB write could
73320// cause the system to run out of memory.
73321//
73322// However, even in such a pathological case, only a single written chunk
73323// would be consumed, and then the rest would wait (un-transformed) until
73324// the results of the previous transformed chunk were consumed.
73325
73326
73327
73328module.exports = Transform;
73329
73330var Duplex = __webpack_require__(110);
73331
73332/*<replacement>*/
73333var util = __webpack_require__(105);
73334util.inherits = __webpack_require__(78);
73335/*</replacement>*/
73336
73337util.inherits(Transform, Duplex);
73338
73339function afterTransform(er, data) {
73340 var ts = this._transformState;
73341 ts.transforming = false;
73342
73343 var cb = ts.writecb;
73344
73345 if (!cb) {
73346 return this.emit('error', new Error('write callback called multiple times'));
73347 }
73348
73349 ts.writechunk = null;
73350 ts.writecb = null;
73351
73352 if (data != null) // single equals check for both `null` and `undefined`
73353 this.push(data);
73354
73355 cb(er);
73356
73357 var rs = this._readableState;
73358 rs.reading = false;
73359 if (rs.needReadable || rs.length < rs.highWaterMark) {
73360 this._read(rs.highWaterMark);
73361 }
73362}
73363
73364function Transform(options) {
73365 if (!(this instanceof Transform)) return new Transform(options);
73366
73367 Duplex.call(this, options);
73368
73369 this._transformState = {
73370 afterTransform: afterTransform.bind(this),
73371 needTransform: false,
73372 transforming: false,
73373 writecb: null,
73374 writechunk: null,
73375 writeencoding: null
73376 };
73377
73378 // start out asking for a readable event once data is transformed.
73379 this._readableState.needReadable = true;
73380
73381 // we have implemented the _read method, and done the other things
73382 // that Readable wants before the first _read call, so unset the
73383 // sync guard flag.
73384 this._readableState.sync = false;
73385
73386 if (options) {
73387 if (typeof options.transform === 'function') this._transform = options.transform;
73388
73389 if (typeof options.flush === 'function') this._flush = options.flush;
73390 }
73391
73392 // When the writable side finishes, then flush out anything remaining.
73393 this.on('prefinish', prefinish);
73394}
73395
73396function prefinish() {
73397 var _this = this;
73398
73399 if (typeof this._flush === 'function') {
73400 this._flush(function (er, data) {
73401 done(_this, er, data);
73402 });
73403 } else {
73404 done(this, null, null);
73405 }
73406}
73407
73408Transform.prototype.push = function (chunk, encoding) {
73409 this._transformState.needTransform = false;
73410 return Duplex.prototype.push.call(this, chunk, encoding);
73411};
73412
73413// This is the part where you do stuff!
73414// override this function in implementation classes.
73415// 'chunk' is an input chunk.
73416//
73417// Call `push(newChunk)` to pass along transformed output
73418// to the readable side. You may call 'push' zero or more times.
73419//
73420// Call `cb(err)` when you are done with this chunk. If you pass
73421// an error, then that'll put the hurt on the whole operation. If you
73422// never call cb(), then you'll never get another chunk.
73423Transform.prototype._transform = function (chunk, encoding, cb) {
73424 throw new Error('_transform() is not implemented');
73425};
73426
73427Transform.prototype._write = function (chunk, encoding, cb) {
73428 var ts = this._transformState;
73429 ts.writecb = cb;
73430 ts.writechunk = chunk;
73431 ts.writeencoding = encoding;
73432 if (!ts.transforming) {
73433 var rs = this._readableState;
73434 if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
73435 }
73436};
73437
73438// Doesn't matter what the args are here.
73439// _transform does all the work.
73440// That we got here means that the readable side wants more data.
73441Transform.prototype._read = function (n) {
73442 var ts = this._transformState;
73443
73444 if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
73445 ts.transforming = true;
73446 this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
73447 } else {
73448 // mark that we need a transform, so that any data that comes in
73449 // will get processed, now that we've asked for it.
73450 ts.needTransform = true;
73451 }
73452};
73453
73454Transform.prototype._destroy = function (err, cb) {
73455 var _this2 = this;
73456
73457 Duplex.prototype._destroy.call(this, err, function (err2) {
73458 cb(err2);
73459 _this2.emit('close');
73460 });
73461};
73462
73463function done(stream, er, data) {
73464 if (er) return stream.emit('error', er);
73465
73466 if (data != null) // single equals check for both `null` and `undefined`
73467 stream.push(data);
73468
73469 // if there's nothing in the write buffer, then that means
73470 // that nothing more will ever be provided
73471 if (stream._writableState.length) throw new Error('Calling transform done when ws.length != 0');
73472
73473 if (stream._transformState.transforming) throw new Error('Calling transform done when still transforming');
73474
73475 return stream.push(null);
73476}
73477
73478/***/ }),
73479/* 378 */
73480/***/ (function(module, exports, __webpack_require__) {
73481
73482"use strict";
73483// Copyright Joyent, Inc. and other Node contributors.
73484//
73485// Permission is hereby granted, free of charge, to any person obtaining a
73486// copy of this software and associated documentation files (the
73487// "Software"), to deal in the Software without restriction, including
73488// without limitation the rights to use, copy, modify, merge, publish,
73489// distribute, sublicense, and/or sell copies of the Software, and to permit
73490// persons to whom the Software is furnished to do so, subject to the
73491// following conditions:
73492//
73493// The above copyright notice and this permission notice shall be included
73494// in all copies or substantial portions of the Software.
73495//
73496// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
73497// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
73498// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
73499// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
73500// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
73501// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
73502// USE OR OTHER DEALINGS IN THE SOFTWARE.
73503
73504// A bit simpler than readable streams.
73505// Implement an async ._write(chunk, encoding, cb), and it'll handle all
73506// the drain event emission and buffering.
73507
73508
73509
73510/*<replacement>*/
73511
73512var pna = __webpack_require__(171);
73513/*</replacement>*/
73514
73515module.exports = Writable;
73516
73517/* <replacement> */
73518function WriteReq(chunk, encoding, cb) {
73519 this.chunk = chunk;
73520 this.encoding = encoding;
73521 this.callback = cb;
73522 this.next = null;
73523}
73524
73525// It seems a linked list but it is not
73526// there will be only 2 of these for each stream
73527function CorkedRequest(state) {
73528 var _this = this;
73529
73530 this.next = null;
73531 this.entry = null;
73532 this.finish = function () {
73533 onCorkedFinish(_this, state);
73534 };
73535}
73536/* </replacement> */
73537
73538/*<replacement>*/
73539var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
73540/*</replacement>*/
73541
73542/*<replacement>*/
73543var Duplex;
73544/*</replacement>*/
73545
73546Writable.WritableState = WritableState;
73547
73548/*<replacement>*/
73549var util = __webpack_require__(105);
73550util.inherits = __webpack_require__(78);
73551/*</replacement>*/
73552
73553/*<replacement>*/
73554var internalUtil = {
73555 deprecate: __webpack_require__(1029)
73556};
73557/*</replacement>*/
73558
73559/*<replacement>*/
73560var Stream = __webpack_require__(380);
73561/*</replacement>*/
73562
73563/*<replacement>*/
73564
73565var Buffer = __webpack_require__(60).Buffer;
73566var OurUint8Array = global.Uint8Array || function () {};
73567function _uint8ArrayToBuffer(chunk) {
73568 return Buffer.from(chunk);
73569}
73570function _isUint8Array(obj) {
73571 return Buffer.isBuffer(obj) || obj instanceof OurUint8Array;
73572}
73573
73574/*</replacement>*/
73575
73576var destroyImpl = __webpack_require__(379);
73577
73578util.inherits(Writable, Stream);
73579
73580function nop() {}
73581
73582function WritableState(options, stream) {
73583 Duplex = Duplex || __webpack_require__(110);
73584
73585 options = options || {};
73586
73587 // Duplex streams are both readable and writable, but share
73588 // the same options object.
73589 // However, some cases require setting options to different
73590 // values for the readable and the writable sides of the duplex stream.
73591 // These options can be provided separately as readableXXX and writableXXX.
73592 var isDuplex = stream instanceof Duplex;
73593
73594 // object stream flag to indicate whether or not this stream
73595 // contains buffers or objects.
73596 this.objectMode = !!options.objectMode;
73597
73598 if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
73599
73600 // the point at which write() starts returning false
73601 // Note: 0 is a valid value, means that we always return false if
73602 // the entire buffer is not flushed immediately on write()
73603 var hwm = options.highWaterMark;
73604 var writableHwm = options.writableHighWaterMark;
73605 var defaultHwm = this.objectMode ? 16 : 16 * 1024;
73606
73607 if (hwm || hwm === 0) this.highWaterMark = hwm;else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;else this.highWaterMark = defaultHwm;
73608
73609 // cast to ints.
73610 this.highWaterMark = Math.floor(this.highWaterMark);
73611
73612 // if _final has been called
73613 this.finalCalled = false;
73614
73615 // drain event flag.
73616 this.needDrain = false;
73617 // at the start of calling end()
73618 this.ending = false;
73619 // when end() has been called, and returned
73620 this.ended = false;
73621 // when 'finish' is emitted
73622 this.finished = false;
73623
73624 // has it been destroyed
73625 this.destroyed = false;
73626
73627 // should we decode strings into buffers before passing to _write?
73628 // this is here so that some node-core streams can optimize string
73629 // handling at a lower level.
73630 var noDecode = options.decodeStrings === false;
73631 this.decodeStrings = !noDecode;
73632
73633 // Crypto is kind of old and crusty. Historically, its default string
73634 // encoding is 'binary' so we have to make this configurable.
73635 // Everything else in the universe uses 'utf8', though.
73636 this.defaultEncoding = options.defaultEncoding || 'utf8';
73637
73638 // not an actual buffer we keep track of, but a measurement
73639 // of how much we're waiting to get pushed to some underlying
73640 // socket or file.
73641 this.length = 0;
73642
73643 // a flag to see when we're in the middle of a write.
73644 this.writing = false;
73645
73646 // when true all writes will be buffered until .uncork() call
73647 this.corked = 0;
73648
73649 // a flag to be able to tell if the onwrite cb is called immediately,
73650 // or on a later tick. We set this to true at first, because any
73651 // actions that shouldn't happen until "later" should generally also
73652 // not happen before the first write call.
73653 this.sync = true;
73654
73655 // a flag to know if we're processing previously buffered items, which
73656 // may call the _write() callback in the same tick, so that we don't
73657 // end up in an overlapped onwrite situation.
73658 this.bufferProcessing = false;
73659
73660 // the callback that's passed to _write(chunk,cb)
73661 this.onwrite = function (er) {
73662 onwrite(stream, er);
73663 };
73664
73665 // the callback that the user supplies to write(chunk,encoding,cb)
73666 this.writecb = null;
73667
73668 // the amount that is being written when _write is called.
73669 this.writelen = 0;
73670
73671 this.bufferedRequest = null;
73672 this.lastBufferedRequest = null;
73673
73674 // number of pending user-supplied write callbacks
73675 // this must be 0 before 'finish' can be emitted
73676 this.pendingcb = 0;
73677
73678 // emit prefinish if the only thing we're waiting for is _write cbs
73679 // This is relevant for synchronous Transform streams
73680 this.prefinished = false;
73681
73682 // True if the error was already emitted and should not be thrown again
73683 this.errorEmitted = false;
73684
73685 // count buffered requests
73686 this.bufferedRequestCount = 0;
73687
73688 // allocate the first CorkedRequest, there is always
73689 // one allocated and free to use, and we maintain at most two
73690 this.corkedRequestsFree = new CorkedRequest(this);
73691}
73692
73693WritableState.prototype.getBuffer = function getBuffer() {
73694 var current = this.bufferedRequest;
73695 var out = [];
73696 while (current) {
73697 out.push(current);
73698 current = current.next;
73699 }
73700 return out;
73701};
73702
73703(function () {
73704 try {
73705 Object.defineProperty(WritableState.prototype, 'buffer', {
73706 get: internalUtil.deprecate(function () {
73707 return this.getBuffer();
73708 }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.', 'DEP0003')
73709 });
73710 } catch (_) {}
73711})();
73712
73713// Test _writableState for inheritance to account for Duplex streams,
73714// whose prototype chain only points to Readable.
73715var realHasInstance;
73716if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === 'function') {
73717 realHasInstance = Function.prototype[Symbol.hasInstance];
73718 Object.defineProperty(Writable, Symbol.hasInstance, {
73719 value: function (object) {
73720 if (realHasInstance.call(this, object)) return true;
73721 if (this !== Writable) return false;
73722
73723 return object && object._writableState instanceof WritableState;
73724 }
73725 });
73726} else {
73727 realHasInstance = function (object) {
73728 return object instanceof this;
73729 };
73730}
73731
73732function Writable(options) {
73733 Duplex = Duplex || __webpack_require__(110);
73734
73735 // Writable ctor is applied to Duplexes, too.
73736 // `realHasInstance` is necessary because using plain `instanceof`
73737 // would return false, as no `_writableState` property is attached.
73738
73739 // Trying to use the custom `instanceof` for Writable here will also break the
73740 // Node.js LazyTransform implementation, which has a non-trivial getter for
73741 // `_writableState` that would lead to infinite recursion.
73742 if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
73743 return new Writable(options);
73744 }
73745
73746 this._writableState = new WritableState(options, this);
73747
73748 // legacy.
73749 this.writable = true;
73750
73751 if (options) {
73752 if (typeof options.write === 'function') this._write = options.write;
73753
73754 if (typeof options.writev === 'function') this._writev = options.writev;
73755
73756 if (typeof options.destroy === 'function') this._destroy = options.destroy;
73757
73758 if (typeof options.final === 'function') this._final = options.final;
73759 }
73760
73761 Stream.call(this);
73762}
73763
73764// Otherwise people can pipe Writable streams, which is just wrong.
73765Writable.prototype.pipe = function () {
73766 this.emit('error', new Error('Cannot pipe, not readable'));
73767};
73768
73769function writeAfterEnd(stream, cb) {
73770 var er = new Error('write after end');
73771 // TODO: defer error events consistently everywhere, not just the cb
73772 stream.emit('error', er);
73773 pna.nextTick(cb, er);
73774}
73775
73776// Checks that a user-supplied chunk is valid, especially for the particular
73777// mode the stream is in. Currently this means that `null` is never accepted
73778// and undefined/non-string values are only allowed in object mode.
73779function validChunk(stream, state, chunk, cb) {
73780 var valid = true;
73781 var er = false;
73782
73783 if (chunk === null) {
73784 er = new TypeError('May not write null values to stream');
73785 } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
73786 er = new TypeError('Invalid non-string/buffer chunk');
73787 }
73788 if (er) {
73789 stream.emit('error', er);
73790 pna.nextTick(cb, er);
73791 valid = false;
73792 }
73793 return valid;
73794}
73795
73796Writable.prototype.write = function (chunk, encoding, cb) {
73797 var state = this._writableState;
73798 var ret = false;
73799 var isBuf = !state.objectMode && _isUint8Array(chunk);
73800
73801 if (isBuf && !Buffer.isBuffer(chunk)) {
73802 chunk = _uint8ArrayToBuffer(chunk);
73803 }
73804
73805 if (typeof encoding === 'function') {
73806 cb = encoding;
73807 encoding = null;
73808 }
73809
73810 if (isBuf) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
73811
73812 if (typeof cb !== 'function') cb = nop;
73813
73814 if (state.ended) writeAfterEnd(this, cb);else if (isBuf || validChunk(this, state, chunk, cb)) {
73815 state.pendingcb++;
73816 ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb);
73817 }
73818
73819 return ret;
73820};
73821
73822Writable.prototype.cork = function () {
73823 var state = this._writableState;
73824
73825 state.corked++;
73826};
73827
73828Writable.prototype.uncork = function () {
73829 var state = this._writableState;
73830
73831 if (state.corked) {
73832 state.corked--;
73833
73834 if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
73835 }
73836};
73837
73838Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
73839 // node::ParseEncoding() requires lower case.
73840 if (typeof encoding === 'string') encoding = encoding.toLowerCase();
73841 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);
73842 this._writableState.defaultEncoding = encoding;
73843 return this;
73844};
73845
73846function decodeChunk(state, chunk, encoding) {
73847 if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
73848 chunk = Buffer.from(chunk, encoding);
73849 }
73850 return chunk;
73851}
73852
73853Object.defineProperty(Writable.prototype, 'writableHighWaterMark', {
73854 // making it explicit this property is not enumerable
73855 // because otherwise some prototype manipulation in
73856 // userland will fail
73857 enumerable: false,
73858 get: function () {
73859 return this._writableState.highWaterMark;
73860 }
73861});
73862
73863// if we're already writing something, then just put this
73864// in the queue, and wait our turn. Otherwise, call _write
73865// If we return false, then we need a drain event, so set that flag.
73866function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
73867 if (!isBuf) {
73868 var newChunk = decodeChunk(state, chunk, encoding);
73869 if (chunk !== newChunk) {
73870 isBuf = true;
73871 encoding = 'buffer';
73872 chunk = newChunk;
73873 }
73874 }
73875 var len = state.objectMode ? 1 : chunk.length;
73876
73877 state.length += len;
73878
73879 var ret = state.length < state.highWaterMark;
73880 // we must ensure that previous needDrain will not be reset to false.
73881 if (!ret) state.needDrain = true;
73882
73883 if (state.writing || state.corked) {
73884 var last = state.lastBufferedRequest;
73885 state.lastBufferedRequest = {
73886 chunk: chunk,
73887 encoding: encoding,
73888 isBuf: isBuf,
73889 callback: cb,
73890 next: null
73891 };
73892 if (last) {
73893 last.next = state.lastBufferedRequest;
73894 } else {
73895 state.bufferedRequest = state.lastBufferedRequest;
73896 }
73897 state.bufferedRequestCount += 1;
73898 } else {
73899 doWrite(stream, state, false, len, chunk, encoding, cb);
73900 }
73901
73902 return ret;
73903}
73904
73905function doWrite(stream, state, writev, len, chunk, encoding, cb) {
73906 state.writelen = len;
73907 state.writecb = cb;
73908 state.writing = true;
73909 state.sync = true;
73910 if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
73911 state.sync = false;
73912}
73913
73914function onwriteError(stream, state, sync, er, cb) {
73915 --state.pendingcb;
73916
73917 if (sync) {
73918 // defer the callback if we are being called synchronously
73919 // to avoid piling up things on the stack
73920 pna.nextTick(cb, er);
73921 // this can emit finish, and it will always happen
73922 // after error
73923 pna.nextTick(finishMaybe, stream, state);
73924 stream._writableState.errorEmitted = true;
73925 stream.emit('error', er);
73926 } else {
73927 // the caller expect this to happen before if
73928 // it is async
73929 cb(er);
73930 stream._writableState.errorEmitted = true;
73931 stream.emit('error', er);
73932 // this can emit finish, but finish must
73933 // always follow error
73934 finishMaybe(stream, state);
73935 }
73936}
73937
73938function onwriteStateUpdate(state) {
73939 state.writing = false;
73940 state.writecb = null;
73941 state.length -= state.writelen;
73942 state.writelen = 0;
73943}
73944
73945function onwrite(stream, er) {
73946 var state = stream._writableState;
73947 var sync = state.sync;
73948 var cb = state.writecb;
73949
73950 onwriteStateUpdate(state);
73951
73952 if (er) onwriteError(stream, state, sync, er, cb);else {
73953 // Check if we're actually ready to finish, but don't emit yet
73954 var finished = needFinish(state);
73955
73956 if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
73957 clearBuffer(stream, state);
73958 }
73959
73960 if (sync) {
73961 /*<replacement>*/
73962 asyncWrite(afterWrite, stream, state, finished, cb);
73963 /*</replacement>*/
73964 } else {
73965 afterWrite(stream, state, finished, cb);
73966 }
73967 }
73968}
73969
73970function afterWrite(stream, state, finished, cb) {
73971 if (!finished) onwriteDrain(stream, state);
73972 state.pendingcb--;
73973 cb();
73974 finishMaybe(stream, state);
73975}
73976
73977// Must force callback to be called on nextTick, so that we don't
73978// emit 'drain' before the write() consumer gets the 'false' return
73979// value, and has a chance to attach a 'drain' listener.
73980function onwriteDrain(stream, state) {
73981 if (state.length === 0 && state.needDrain) {
73982 state.needDrain = false;
73983 stream.emit('drain');
73984 }
73985}
73986
73987// if there's something in the buffer waiting, then process it
73988function clearBuffer(stream, state) {
73989 state.bufferProcessing = true;
73990 var entry = state.bufferedRequest;
73991
73992 if (stream._writev && entry && entry.next) {
73993 // Fast case, write everything using _writev()
73994 var l = state.bufferedRequestCount;
73995 var buffer = new Array(l);
73996 var holder = state.corkedRequestsFree;
73997 holder.entry = entry;
73998
73999 var count = 0;
74000 var allBuffers = true;
74001 while (entry) {
74002 buffer[count] = entry;
74003 if (!entry.isBuf) allBuffers = false;
74004 entry = entry.next;
74005 count += 1;
74006 }
74007 buffer.allBuffers = allBuffers;
74008
74009 doWrite(stream, state, true, state.length, buffer, '', holder.finish);
74010
74011 // doWrite is almost always async, defer these to save a bit of time
74012 // as the hot path ends with doWrite
74013 state.pendingcb++;
74014 state.lastBufferedRequest = null;
74015 if (holder.next) {
74016 state.corkedRequestsFree = holder.next;
74017 holder.next = null;
74018 } else {
74019 state.corkedRequestsFree = new CorkedRequest(state);
74020 }
74021 state.bufferedRequestCount = 0;
74022 } else {
74023 // Slow case, write chunks one-by-one
74024 while (entry) {
74025 var chunk = entry.chunk;
74026 var encoding = entry.encoding;
74027 var cb = entry.callback;
74028 var len = state.objectMode ? 1 : chunk.length;
74029
74030 doWrite(stream, state, false, len, chunk, encoding, cb);
74031 entry = entry.next;
74032 state.bufferedRequestCount--;
74033 // if we didn't call the onwrite immediately, then
74034 // it means that we need to wait until it does.
74035 // also, that means that the chunk and cb are currently
74036 // being processed, so move the buffer counter past them.
74037 if (state.writing) {
74038 break;
74039 }
74040 }
74041
74042 if (entry === null) state.lastBufferedRequest = null;
74043 }
74044
74045 state.bufferedRequest = entry;
74046 state.bufferProcessing = false;
74047}
74048
74049Writable.prototype._write = function (chunk, encoding, cb) {
74050 cb(new Error('_write() is not implemented'));
74051};
74052
74053Writable.prototype._writev = null;
74054
74055Writable.prototype.end = function (chunk, encoding, cb) {
74056 var state = this._writableState;
74057
74058 if (typeof chunk === 'function') {
74059 cb = chunk;
74060 chunk = null;
74061 encoding = null;
74062 } else if (typeof encoding === 'function') {
74063 cb = encoding;
74064 encoding = null;
74065 }
74066
74067 if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
74068
74069 // .end() fully uncorks
74070 if (state.corked) {
74071 state.corked = 1;
74072 this.uncork();
74073 }
74074
74075 // ignore unnecessary end() calls.
74076 if (!state.ending && !state.finished) endWritable(this, state, cb);
74077};
74078
74079function needFinish(state) {
74080 return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
74081}
74082function callFinal(stream, state) {
74083 stream._final(function (err) {
74084 state.pendingcb--;
74085 if (err) {
74086 stream.emit('error', err);
74087 }
74088 state.prefinished = true;
74089 stream.emit('prefinish');
74090 finishMaybe(stream, state);
74091 });
74092}
74093function prefinish(stream, state) {
74094 if (!state.prefinished && !state.finalCalled) {
74095 if (typeof stream._final === 'function') {
74096 state.pendingcb++;
74097 state.finalCalled = true;
74098 pna.nextTick(callFinal, stream, state);
74099 } else {
74100 state.prefinished = true;
74101 stream.emit('prefinish');
74102 }
74103 }
74104}
74105
74106function finishMaybe(stream, state) {
74107 var need = needFinish(state);
74108 if (need) {
74109 prefinish(stream, state);
74110 if (state.pendingcb === 0) {
74111 state.finished = true;
74112 stream.emit('finish');
74113 }
74114 }
74115 return need;
74116}
74117
74118function endWritable(stream, state, cb) {
74119 state.ending = true;
74120 finishMaybe(stream, state);
74121 if (cb) {
74122 if (state.finished) pna.nextTick(cb);else stream.once('finish', cb);
74123 }
74124 state.ended = true;
74125 stream.writable = false;
74126}
74127
74128function onCorkedFinish(corkReq, state, err) {
74129 var entry = corkReq.entry;
74130 corkReq.entry = null;
74131 while (entry) {
74132 var cb = entry.callback;
74133 state.pendingcb--;
74134 cb(err);
74135 entry = entry.next;
74136 }
74137 if (state.corkedRequestsFree) {
74138 state.corkedRequestsFree.next = corkReq;
74139 } else {
74140 state.corkedRequestsFree = corkReq;
74141 }
74142}
74143
74144Object.defineProperty(Writable.prototype, 'destroyed', {
74145 get: function () {
74146 if (this._writableState === undefined) {
74147 return false;
74148 }
74149 return this._writableState.destroyed;
74150 },
74151 set: function (value) {
74152 // we ignore the value if the stream
74153 // has not been initialized yet
74154 if (!this._writableState) {
74155 return;
74156 }
74157
74158 // backward compatibility, the user is explicitly
74159 // managing destroyed
74160 this._writableState.destroyed = value;
74161 }
74162});
74163
74164Writable.prototype.destroy = destroyImpl.destroy;
74165Writable.prototype._undestroy = destroyImpl.undestroy;
74166Writable.prototype._destroy = function (err, cb) {
74167 this.end();
74168 cb(err);
74169};
74170
74171/***/ }),
74172/* 379 */
74173/***/ (function(module, exports, __webpack_require__) {
74174
74175"use strict";
74176
74177
74178/*<replacement>*/
74179
74180var pna = __webpack_require__(171);
74181/*</replacement>*/
74182
74183// undocumented cb() API, needed for core, not for public API
74184function destroy(err, cb) {
74185 var _this = this;
74186
74187 var readableDestroyed = this._readableState && this._readableState.destroyed;
74188 var writableDestroyed = this._writableState && this._writableState.destroyed;
74189
74190 if (readableDestroyed || writableDestroyed) {
74191 if (cb) {
74192 cb(err);
74193 } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
74194 pna.nextTick(emitErrorNT, this, err);
74195 }
74196 return this;
74197 }
74198
74199 // we set destroyed to true before firing error callbacks in order
74200 // to make it re-entrance safe in case destroy() is called within callbacks
74201
74202 if (this._readableState) {
74203 this._readableState.destroyed = true;
74204 }
74205
74206 // if this is a duplex stream mark the writable part as destroyed as well
74207 if (this._writableState) {
74208 this._writableState.destroyed = true;
74209 }
74210
74211 this._destroy(err || null, function (err) {
74212 if (!cb && err) {
74213 pna.nextTick(emitErrorNT, _this, err);
74214 if (_this._writableState) {
74215 _this._writableState.errorEmitted = true;
74216 }
74217 } else if (cb) {
74218 cb(err);
74219 }
74220 });
74221
74222 return this;
74223}
74224
74225function undestroy() {
74226 if (this._readableState) {
74227 this._readableState.destroyed = false;
74228 this._readableState.reading = false;
74229 this._readableState.ended = false;
74230 this._readableState.endEmitted = false;
74231 }
74232
74233 if (this._writableState) {
74234 this._writableState.destroyed = false;
74235 this._writableState.ended = false;
74236 this._writableState.ending = false;
74237 this._writableState.finished = false;
74238 this._writableState.errorEmitted = false;
74239 }
74240}
74241
74242function emitErrorNT(self, err) {
74243 self.emit('error', err);
74244}
74245
74246module.exports = {
74247 destroy: destroy,
74248 undestroy: undestroy
74249};
74250
74251/***/ }),
74252/* 380 */
74253/***/ (function(module, exports, __webpack_require__) {
74254
74255module.exports = __webpack_require__(35);
74256
74257
74258/***/ }),
74259/* 381 */
74260/***/ (function(module, exports, __webpack_require__) {
74261
74262"use strict";
74263/*!
74264 * repeat-element <https://github.com/jonschlinkert/repeat-element>
74265 *
74266 * Copyright (c) 2015 Jon Schlinkert.
74267 * Licensed under the MIT license.
74268 */
74269
74270
74271
74272module.exports = function repeat(ele, num) {
74273 var arr = new Array(num);
74274
74275 for (var i = 0; i < num; i++) {
74276 arr[i] = ele;
74277 }
74278
74279 return arr;
74280};
74281
74282
74283/***/ }),
74284/* 382 */
74285/***/ (function(module, exports, __webpack_require__) {
74286
74287"use strict";
74288
74289
74290var tough = __webpack_require__(882)
74291
74292var Cookie = tough.Cookie
74293var CookieJar = tough.CookieJar
74294
74295exports.parse = function (str) {
74296 if (str && str.uri) {
74297 str = str.uri
74298 }
74299 if (typeof str !== 'string') {
74300 throw new Error('The cookie function only accepts STRING as param')
74301 }
74302 return Cookie.parse(str, {loose: true})
74303}
74304
74305// Adapt the sometimes-Async api of tough.CookieJar to our requirements
74306function RequestJar (store) {
74307 var self = this
74308 self._jar = new CookieJar(store, {looseMode: true})
74309}
74310RequestJar.prototype.setCookie = function (cookieOrStr, uri, options) {
74311 var self = this
74312 return self._jar.setCookieSync(cookieOrStr, uri, options || {})
74313}
74314RequestJar.prototype.getCookieString = function (uri) {
74315 var self = this
74316 return self._jar.getCookieStringSync(uri)
74317}
74318RequestJar.prototype.getCookies = function (uri) {
74319 var self = this
74320 return self._jar.getCookiesSync(uri)
74321}
74322
74323exports.jar = function (store) {
74324 return new RequestJar(store)
74325}
74326
74327
74328/***/ }),
74329/* 383 */
74330/***/ (function(module, exports, __webpack_require__) {
74331
74332"use strict";
74333/*!
74334 * Copyright (c) 2015, Salesforce.com, Inc.
74335 * All rights reserved.
74336 *
74337 * Redistribution and use in source and binary forms, with or without
74338 * modification, are permitted provided that the following conditions are met:
74339 *
74340 * 1. Redistributions of source code must retain the above copyright notice,
74341 * this list of conditions and the following disclaimer.
74342 *
74343 * 2. Redistributions in binary form must reproduce the above copyright notice,
74344 * this list of conditions and the following disclaimer in the documentation
74345 * and/or other materials provided with the distribution.
74346 *
74347 * 3. Neither the name of Salesforce.com nor the names of its contributors may
74348 * be used to endorse or promote products derived from this software without
74349 * specific prior written permission.
74350 *
74351 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
74352 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
74353 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
74354 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
74355 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
74356 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
74357 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
74358 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
74359 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
74360 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
74361 * POSSIBILITY OF SUCH DAMAGE.
74362 */
74363
74364/*
74365 * "A request-path path-matches a given cookie-path if at least one of the
74366 * following conditions holds:"
74367 */
74368function pathMatch (reqPath, cookiePath) {
74369 // "o The cookie-path and the request-path are identical."
74370 if (cookiePath === reqPath) {
74371 return true;
74372 }
74373
74374 var idx = reqPath.indexOf(cookiePath);
74375 if (idx === 0) {
74376 // "o The cookie-path is a prefix of the request-path, and the last
74377 // character of the cookie-path is %x2F ("/")."
74378 if (cookiePath.substr(-1) === "/") {
74379 return true;
74380 }
74381
74382 // " o The cookie-path is a prefix of the request-path, and the first
74383 // character of the request-path that is not included in the cookie- path
74384 // is a %x2F ("/") character."
74385 if (reqPath.substr(cookiePath.length, 1) === "/") {
74386 return true;
74387 }
74388 }
74389
74390 return false;
74391}
74392
74393exports.pathMatch = pathMatch;
74394
74395
74396/***/ }),
74397/* 384 */
74398/***/ (function(module, exports, __webpack_require__) {
74399
74400"use strict";
74401/*!
74402 * Copyright (c) 2015, Salesforce.com, Inc.
74403 * All rights reserved.
74404 *
74405 * Redistribution and use in source and binary forms, with or without
74406 * modification, are permitted provided that the following conditions are met:
74407 *
74408 * 1. Redistributions of source code must retain the above copyright notice,
74409 * this list of conditions and the following disclaimer.
74410 *
74411 * 2. Redistributions in binary form must reproduce the above copyright notice,
74412 * this list of conditions and the following disclaimer in the documentation
74413 * and/or other materials provided with the distribution.
74414 *
74415 * 3. Neither the name of Salesforce.com nor the names of its contributors may
74416 * be used to endorse or promote products derived from this software without
74417 * specific prior written permission.
74418 *
74419 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
74420 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
74421 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
74422 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
74423 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
74424 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
74425 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
74426 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
74427 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
74428 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
74429 * POSSIBILITY OF SUCH DAMAGE.
74430 */
74431
74432var pubsuffix = __webpack_require__(385);
74433
74434// Gives the permutation of all possible domainMatch()es of a given domain. The
74435// array is in shortest-to-longest order. Handy for indexing.
74436function permuteDomain (domain) {
74437 var pubSuf = pubsuffix.getPublicSuffix(domain);
74438 if (!pubSuf) {
74439 return null;
74440 }
74441 if (pubSuf == domain) {
74442 return [domain];
74443 }
74444
74445 var prefix = domain.slice(0, -(pubSuf.length + 1)); // ".example.com"
74446 var parts = prefix.split('.').reverse();
74447 var cur = pubSuf;
74448 var permutations = [cur];
74449 while (parts.length) {
74450 cur = parts.shift() + '.' + cur;
74451 permutations.push(cur);
74452 }
74453 return permutations;
74454}
74455
74456exports.permuteDomain = permuteDomain;
74457
74458
74459/***/ }),
74460/* 385 */
74461/***/ (function(module, exports, __webpack_require__) {
74462
74463"use strict";
74464/****************************************************
74465 * AUTOMATICALLY GENERATED by generate-pubsuffix.js *
74466 * DO NOT EDIT! *
74467 ****************************************************/
74468
74469
74470
74471var punycode = __webpack_require__(271);
74472
74473module.exports.getPublicSuffix = function getPublicSuffix(domain) {
74474 /*!
74475 * Copyright (c) 2015, Salesforce.com, Inc.
74476 * All rights reserved.
74477 *
74478 * Redistribution and use in source and binary forms, with or without
74479 * modification, are permitted provided that the following conditions are met:
74480 *
74481 * 1. Redistributions of source code must retain the above copyright notice,
74482 * this list of conditions and the following disclaimer.
74483 *
74484 * 2. Redistributions in binary form must reproduce the above copyright notice,
74485 * this list of conditions and the following disclaimer in the documentation
74486 * and/or other materials provided with the distribution.
74487 *
74488 * 3. Neither the name of Salesforce.com nor the names of its contributors may
74489 * be used to endorse or promote products derived from this software without
74490 * specific prior written permission.
74491 *
74492 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
74493 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
74494 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
74495 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
74496 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
74497 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
74498 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
74499 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
74500 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
74501 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
74502 * POSSIBILITY OF SUCH DAMAGE.
74503 */
74504 if (!domain) {
74505 return null;
74506 }
74507 if (domain.match(/^\./)) {
74508 return null;
74509 }
74510 var asciiDomain = punycode.toASCII(domain);
74511 var converted = false;
74512 if (asciiDomain !== domain) {
74513 domain = asciiDomain;
74514 converted = true;
74515 }
74516 if (index[domain]) {
74517 return null;
74518 }
74519
74520 domain = domain.toLowerCase();
74521 var parts = domain.split('.').reverse();
74522
74523 var suffix = '';
74524 var suffixLen = 0;
74525 for (var i=0; i<parts.length; i++) {
74526 var part = parts[i];
74527 var starstr = '*'+suffix;
74528 var partstr = part+suffix;
74529
74530 if (index[starstr]) { // star rule matches
74531 suffixLen = i+1;
74532 if (index[partstr] === false) { // exception rule matches (NB: false, not undefined)
74533 suffixLen--;
74534 }
74535 } else if (index[partstr]) { // exact match, not exception
74536 suffixLen = i+1;
74537 }
74538
74539 suffix = '.'+partstr;
74540 }
74541
74542 if (index['*'+suffix]) { // *.domain exists (e.g. *.kyoto.jp for domain='kyoto.jp');
74543 return null;
74544 }
74545
74546 suffixLen = suffixLen || 1;
74547 if (parts.length > suffixLen) {
74548 var publicSuffix = parts.slice(0,suffixLen+1).reverse().join('.');
74549 return converted ? punycode.toUnicode(publicSuffix) : publicSuffix;
74550 }
74551
74552 return null;
74553};
74554
74555// The following generated structure is used under the MPL version 2.0
74556// See public-suffix.txt for more information
74557
74558var index = module.exports.index = Object.freeze(
74559{"ac":true,"com.ac":true,"edu.ac":true,"gov.ac":true,"net.ac":true,"mil.ac":true,"org.ac":true,"ad":true,"nom.ad":true,"ae":true,"co.ae":true,"net.ae":true,"org.ae":true,"sch.ae":true,"ac.ae":true,"gov.ae":true,"mil.ae":true,"aero":true,"accident-investigation.aero":true,"accident-prevention.aero":true,"aerobatic.aero":true,"aeroclub.aero":true,"aerodrome.aero":true,"agents.aero":true,"aircraft.aero":true,"airline.aero":true,"airport.aero":true,"air-surveillance.aero":true,"airtraffic.aero":true,"air-traffic-control.aero":true,"ambulance.aero":true,"amusement.aero":true,"association.aero":true,"author.aero":true,"ballooning.aero":true,"broker.aero":true,"caa.aero":true,"cargo.aero":true,"catering.aero":true,"certification.aero":true,"championship.aero":true,"charter.aero":true,"civilaviation.aero":true,"club.aero":true,"conference.aero":true,"consultant.aero":true,"consulting.aero":true,"control.aero":true,"council.aero":true,"crew.aero":true,"design.aero":true,"dgca.aero":true,"educator.aero":true,"emergency.aero":true,"engine.aero":true,"engineer.aero":true,"entertainment.aero":true,"equipment.aero":true,"exchange.aero":true,"express.aero":true,"federation.aero":true,"flight.aero":true,"freight.aero":true,"fuel.aero":true,"gliding.aero":true,"government.aero":true,"groundhandling.aero":true,"group.aero":true,"hanggliding.aero":true,"homebuilt.aero":true,"insurance.aero":true,"journal.aero":true,"journalist.aero":true,"leasing.aero":true,"logistics.aero":true,"magazine.aero":true,"maintenance.aero":true,"media.aero":true,"microlight.aero":true,"modelling.aero":true,"navigation.aero":true,"parachuting.aero":true,"paragliding.aero":true,"passenger-association.aero":true,"pilot.aero":true,"press.aero":true,"production.aero":true,"recreation.aero":true,"repbody.aero":true,"res.aero":true,"research.aero":true,"rotorcraft.aero":true,"safety.aero":true,"scientist.aero":true,"services.aero":true,"show.aero":true,"skydiving.aero":true,"software.aero":true,"student.aero":true,"trader.aero":true,"trading.aero":true,"trainer.aero":true,"union.aero":true,"workinggroup.aero":true,"works.aero":true,"af":true,"gov.af":true,"com.af":true,"org.af":true,"net.af":true,"edu.af":true,"ag":true,"com.ag":true,"org.ag":true,"net.ag":true,"co.ag":true,"nom.ag":true,"ai":true,"off.ai":true,"com.ai":true,"net.ai":true,"org.ai":true,"al":true,"com.al":true,"edu.al":true,"gov.al":true,"mil.al":true,"net.al":true,"org.al":true,"am":true,"ao":true,"ed.ao":true,"gv.ao":true,"og.ao":true,"co.ao":true,"pb.ao":true,"it.ao":true,"aq":true,"ar":true,"com.ar":true,"edu.ar":true,"gob.ar":true,"gov.ar":true,"int.ar":true,"mil.ar":true,"musica.ar":true,"net.ar":true,"org.ar":true,"tur.ar":true,"arpa":true,"e164.arpa":true,"in-addr.arpa":true,"ip6.arpa":true,"iris.arpa":true,"uri.arpa":true,"urn.arpa":true,"as":true,"gov.as":true,"asia":true,"at":true,"ac.at":true,"co.at":true,"gv.at":true,"or.at":true,"au":true,"com.au":true,"net.au":true,"org.au":true,"edu.au":true,"gov.au":true,"asn.au":true,"id.au":true,"info.au":true,"conf.au":true,"oz.au":true,"act.au":true,"nsw.au":true,"nt.au":true,"qld.au":true,"sa.au":true,"tas.au":true,"vic.au":true,"wa.au":true,"act.edu.au":true,"nsw.edu.au":true,"nt.edu.au":true,"qld.edu.au":true,"sa.edu.au":true,"tas.edu.au":true,"vic.edu.au":true,"wa.edu.au":true,"qld.gov.au":true,"sa.gov.au":true,"tas.gov.au":true,"vic.gov.au":true,"wa.gov.au":true,"aw":true,"com.aw":true,"ax":true,"az":true,"com.az":true,"net.az":true,"int.az":true,"gov.az":true,"org.az":true,"edu.az":true,"info.az":true,"pp.az":true,"mil.az":true,"name.az":true,"pro.az":true,"biz.az":true,"ba":true,"com.ba":true,"edu.ba":true,"gov.ba":true,"mil.ba":true,"net.ba":true,"org.ba":true,"bb":true,"biz.bb":true,"co.bb":true,"com.bb":true,"edu.bb":true,"gov.bb":true,"info.bb":true,"net.bb":true,"org.bb":true,"store.bb":true,"tv.bb":true,"*.bd":true,"be":true,"ac.be":true,"bf":true,"gov.bf":true,"bg":true,"a.bg":true,"b.bg":true,"c.bg":true,"d.bg":true,"e.bg":true,"f.bg":true,"g.bg":true,"h.bg":true,"i.bg":true,"j.bg":true,"k.bg":true,"l.bg":true,"m.bg":true,"n.bg":true,"o.bg":true,"p.bg":true,"q.bg":true,"r.bg":true,"s.bg":true,"t.bg":true,"u.bg":true,"v.bg":true,"w.bg":true,"x.bg":true,"y.bg":true,"z.bg":true,"0.bg":true,"1.bg":true,"2.bg":true,"3.bg":true,"4.bg":true,"5.bg":true,"6.bg":true,"7.bg":true,"8.bg":true,"9.bg":true,"bh":true,"com.bh":true,"edu.bh":true,"net.bh":true,"org.bh":true,"gov.bh":true,"bi":true,"co.bi":true,"com.bi":true,"edu.bi":true,"or.bi":true,"org.bi":true,"biz":true,"bj":true,"asso.bj":true,"barreau.bj":true,"gouv.bj":true,"bm":true,"com.bm":true,"edu.bm":true,"gov.bm":true,"net.bm":true,"org.bm":true,"*.bn":true,"bo":true,"com.bo":true,"edu.bo":true,"gob.bo":true,"int.bo":true,"org.bo":true,"net.bo":true,"mil.bo":true,"tv.bo":true,"web.bo":true,"academia.bo":true,"agro.bo":true,"arte.bo":true,"blog.bo":true,"bolivia.bo":true,"ciencia.bo":true,"cooperativa.bo":true,"democracia.bo":true,"deporte.bo":true,"ecologia.bo":true,"economia.bo":true,"empresa.bo":true,"indigena.bo":true,"industria.bo":true,"info.bo":true,"medicina.bo":true,"movimiento.bo":true,"musica.bo":true,"natural.bo":true,"nombre.bo":true,"noticias.bo":true,"patria.bo":true,"politica.bo":true,"profesional.bo":true,"plurinacional.bo":true,"pueblo.bo":true,"revista.bo":true,"salud.bo":true,"tecnologia.bo":true,"tksat.bo":true,"transporte.bo":true,"wiki.bo":true,"br":true,"9guacu.br":true,"abc.br":true,"adm.br":true,"adv.br":true,"agr.br":true,"aju.br":true,"am.br":true,"anani.br":true,"aparecida.br":true,"arq.br":true,"art.br":true,"ato.br":true,"b.br":true,"belem.br":true,"bhz.br":true,"bio.br":true,"blog.br":true,"bmd.br":true,"boavista.br":true,"bsb.br":true,"campinagrande.br":true,"campinas.br":true,"caxias.br":true,"cim.br":true,"cng.br":true,"cnt.br":true,"com.br":true,"contagem.br":true,"coop.br":true,"cri.br":true,"cuiaba.br":true,"curitiba.br":true,"def.br":true,"ecn.br":true,"eco.br":true,"edu.br":true,"emp.br":true,"eng.br":true,"esp.br":true,"etc.br":true,"eti.br":true,"far.br":true,"feira.br":true,"flog.br":true,"floripa.br":true,"fm.br":true,"fnd.br":true,"fortal.br":true,"fot.br":true,"foz.br":true,"fst.br":true,"g12.br":true,"ggf.br":true,"goiania.br":true,"gov.br":true,"ac.gov.br":true,"al.gov.br":true,"am.gov.br":true,"ap.gov.br":true,"ba.gov.br":true,"ce.gov.br":true,"df.gov.br":true,"es.gov.br":true,"go.gov.br":true,"ma.gov.br":true,"mg.gov.br":true,"ms.gov.br":true,"mt.gov.br":true,"pa.gov.br":true,"pb.gov.br":true,"pe.gov.br":true,"pi.gov.br":true,"pr.gov.br":true,"rj.gov.br":true,"rn.gov.br":true,"ro.gov.br":true,"rr.gov.br":true,"rs.gov.br":true,"sc.gov.br":true,"se.gov.br":true,"sp.gov.br":true,"to.gov.br":true,"gru.br":true,"imb.br":true,"ind.br":true,"inf.br":true,"jab.br":true,"jampa.br":true,"jdf.br":true,"joinville.br":true,"jor.br":true,"jus.br":true,"leg.br":true,"lel.br":true,"londrina.br":true,"macapa.br":true,"maceio.br":true,"manaus.br":true,"maringa.br":true,"mat.br":true,"med.br":true,"mil.br":true,"morena.br":true,"mp.br":true,"mus.br":true,"natal.br":true,"net.br":true,"niteroi.br":true,"*.nom.br":true,"not.br":true,"ntr.br":true,"odo.br":true,"org.br":true,"osasco.br":true,"palmas.br":true,"poa.br":true,"ppg.br":true,"pro.br":true,"psc.br":true,"psi.br":true,"pvh.br":true,"qsl.br":true,"radio.br":true,"rec.br":true,"recife.br":true,"ribeirao.br":true,"rio.br":true,"riobranco.br":true,"riopreto.br":true,"salvador.br":true,"sampa.br":true,"santamaria.br":true,"santoandre.br":true,"saobernardo.br":true,"saogonca.br":true,"sjc.br":true,"slg.br":true,"slz.br":true,"sorocaba.br":true,"srv.br":true,"taxi.br":true,"teo.br":true,"the.br":true,"tmp.br":true,"trd.br":true,"tur.br":true,"tv.br":true,"udi.br":true,"vet.br":true,"vix.br":true,"vlog.br":true,"wiki.br":true,"zlg.br":true,"bs":true,"com.bs":true,"net.bs":true,"org.bs":true,"edu.bs":true,"gov.bs":true,"bt":true,"com.bt":true,"edu.bt":true,"gov.bt":true,"net.bt":true,"org.bt":true,"bv":true,"bw":true,"co.bw":true,"org.bw":true,"by":true,"gov.by":true,"mil.by":true,"com.by":true,"of.by":true,"bz":true,"com.bz":true,"net.bz":true,"org.bz":true,"edu.bz":true,"gov.bz":true,"ca":true,"ab.ca":true,"bc.ca":true,"mb.ca":true,"nb.ca":true,"nf.ca":true,"nl.ca":true,"ns.ca":true,"nt.ca":true,"nu.ca":true,"on.ca":true,"pe.ca":true,"qc.ca":true,"sk.ca":true,"yk.ca":true,"gc.ca":true,"cat":true,"cc":true,"cd":true,"gov.cd":true,"cf":true,"cg":true,"ch":true,"ci":true,"org.ci":true,"or.ci":true,"com.ci":true,"co.ci":true,"edu.ci":true,"ed.ci":true,"ac.ci":true,"net.ci":true,"go.ci":true,"asso.ci":true,"xn--aroport-bya.ci":true,"int.ci":true,"presse.ci":true,"md.ci":true,"gouv.ci":true,"*.ck":true,"www.ck":false,"cl":true,"gov.cl":true,"gob.cl":true,"co.cl":true,"mil.cl":true,"cm":true,"co.cm":true,"com.cm":true,"gov.cm":true,"net.cm":true,"cn":true,"ac.cn":true,"com.cn":true,"edu.cn":true,"gov.cn":true,"net.cn":true,"org.cn":true,"mil.cn":true,"xn--55qx5d.cn":true,"xn--io0a7i.cn":true,"xn--od0alg.cn":true,"ah.cn":true,"bj.cn":true,"cq.cn":true,"fj.cn":true,"gd.cn":true,"gs.cn":true,"gz.cn":true,"gx.cn":true,"ha.cn":true,"hb.cn":true,"he.cn":true,"hi.cn":true,"hl.cn":true,"hn.cn":true,"jl.cn":true,"js.cn":true,"jx.cn":true,"ln.cn":true,"nm.cn":true,"nx.cn":true,"qh.cn":true,"sc.cn":true,"sd.cn":true,"sh.cn":true,"sn.cn":true,"sx.cn":true,"tj.cn":true,"xj.cn":true,"xz.cn":true,"yn.cn":true,"zj.cn":true,"hk.cn":true,"mo.cn":true,"tw.cn":true,"co":true,"arts.co":true,"com.co":true,"edu.co":true,"firm.co":true,"gov.co":true,"info.co":true,"int.co":true,"mil.co":true,"net.co":true,"nom.co":true,"org.co":true,"rec.co":true,"web.co":true,"com":true,"coop":true,"cr":true,"ac.cr":true,"co.cr":true,"ed.cr":true,"fi.cr":true,"go.cr":true,"or.cr":true,"sa.cr":true,"cu":true,"com.cu":true,"edu.cu":true,"org.cu":true,"net.cu":true,"gov.cu":true,"inf.cu":true,"cv":true,"cw":true,"com.cw":true,"edu.cw":true,"net.cw":true,"org.cw":true,"cx":true,"gov.cx":true,"cy":true,"ac.cy":true,"biz.cy":true,"com.cy":true,"ekloges.cy":true,"gov.cy":true,"ltd.cy":true,"name.cy":true,"net.cy":true,"org.cy":true,"parliament.cy":true,"press.cy":true,"pro.cy":true,"tm.cy":true,"cz":true,"de":true,"dj":true,"dk":true,"dm":true,"com.dm":true,"net.dm":true,"org.dm":true,"edu.dm":true,"gov.dm":true,"do":true,"art.do":true,"com.do":true,"edu.do":true,"gob.do":true,"gov.do":true,"mil.do":true,"net.do":true,"org.do":true,"sld.do":true,"web.do":true,"dz":true,"com.dz":true,"org.dz":true,"net.dz":true,"gov.dz":true,"edu.dz":true,"asso.dz":true,"pol.dz":true,"art.dz":true,"ec":true,"com.ec":true,"info.ec":true,"net.ec":true,"fin.ec":true,"k12.ec":true,"med.ec":true,"pro.ec":true,"org.ec":true,"edu.ec":true,"gov.ec":true,"gob.ec":true,"mil.ec":true,"edu":true,"ee":true,"edu.ee":true,"gov.ee":true,"riik.ee":true,"lib.ee":true,"med.ee":true,"com.ee":true,"pri.ee":true,"aip.ee":true,"org.ee":true,"fie.ee":true,"eg":true,"com.eg":true,"edu.eg":true,"eun.eg":true,"gov.eg":true,"mil.eg":true,"name.eg":true,"net.eg":true,"org.eg":true,"sci.eg":true,"*.er":true,"es":true,"com.es":true,"nom.es":true,"org.es":true,"gob.es":true,"edu.es":true,"et":true,"com.et":true,"gov.et":true,"org.et":true,"edu.et":true,"biz.et":true,"name.et":true,"info.et":true,"net.et":true,"eu":true,"fi":true,"aland.fi":true,"*.fj":true,"*.fk":true,"fm":true,"fo":true,"fr":true,"com.fr":true,"asso.fr":true,"nom.fr":true,"prd.fr":true,"presse.fr":true,"tm.fr":true,"aeroport.fr":true,"assedic.fr":true,"avocat.fr":true,"avoues.fr":true,"cci.fr":true,"chambagri.fr":true,"chirurgiens-dentistes.fr":true,"experts-comptables.fr":true,"geometre-expert.fr":true,"gouv.fr":true,"greta.fr":true,"huissier-justice.fr":true,"medecin.fr":true,"notaires.fr":true,"pharmacien.fr":true,"port.fr":true,"veterinaire.fr":true,"ga":true,"gb":true,"gd":true,"ge":true,"com.ge":true,"edu.ge":true,"gov.ge":true,"org.ge":true,"mil.ge":true,"net.ge":true,"pvt.ge":true,"gf":true,"gg":true,"co.gg":true,"net.gg":true,"org.gg":true,"gh":true,"com.gh":true,"edu.gh":true,"gov.gh":true,"org.gh":true,"mil.gh":true,"gi":true,"com.gi":true,"ltd.gi":true,"gov.gi":true,"mod.gi":true,"edu.gi":true,"org.gi":true,"gl":true,"co.gl":true,"com.gl":true,"edu.gl":true,"net.gl":true,"org.gl":true,"gm":true,"gn":true,"ac.gn":true,"com.gn":true,"edu.gn":true,"gov.gn":true,"org.gn":true,"net.gn":true,"gov":true,"gp":true,"com.gp":true,"net.gp":true,"mobi.gp":true,"edu.gp":true,"org.gp":true,"asso.gp":true,"gq":true,"gr":true,"com.gr":true,"edu.gr":true,"net.gr":true,"org.gr":true,"gov.gr":true,"gs":true,"gt":true,"com.gt":true,"edu.gt":true,"gob.gt":true,"ind.gt":true,"mil.gt":true,"net.gt":true,"org.gt":true,"*.gu":true,"gw":true,"gy":true,"co.gy":true,"com.gy":true,"edu.gy":true,"gov.gy":true,"net.gy":true,"org.gy":true,"hk":true,"com.hk":true,"edu.hk":true,"gov.hk":true,"idv.hk":true,"net.hk":true,"org.hk":true,"xn--55qx5d.hk":true,"xn--wcvs22d.hk":true,"xn--lcvr32d.hk":true,"xn--mxtq1m.hk":true,"xn--gmqw5a.hk":true,"xn--ciqpn.hk":true,"xn--gmq050i.hk":true,"xn--zf0avx.hk":true,"xn--io0a7i.hk":true,"xn--mk0axi.hk":true,"xn--od0alg.hk":true,"xn--od0aq3b.hk":true,"xn--tn0ag.hk":true,"xn--uc0atv.hk":true,"xn--uc0ay4a.hk":true,"hm":true,"hn":true,"com.hn":true,"edu.hn":true,"org.hn":true,"net.hn":true,"mil.hn":true,"gob.hn":true,"hr":true,"iz.hr":true,"from.hr":true,"name.hr":true,"com.hr":true,"ht":true,"com.ht":true,"shop.ht":true,"firm.ht":true,"info.ht":true,"adult.ht":true,"net.ht":true,"pro.ht":true,"org.ht":true,"med.ht":true,"art.ht":true,"coop.ht":true,"pol.ht":true,"asso.ht":true,"edu.ht":true,"rel.ht":true,"gouv.ht":true,"perso.ht":true,"hu":true,"co.hu":true,"info.hu":true,"org.hu":true,"priv.hu":true,"sport.hu":true,"tm.hu":true,"2000.hu":true,"agrar.hu":true,"bolt.hu":true,"casino.hu":true,"city.hu":true,"erotica.hu":true,"erotika.hu":true,"film.hu":true,"forum.hu":true,"games.hu":true,"hotel.hu":true,"ingatlan.hu":true,"jogasz.hu":true,"konyvelo.hu":true,"lakas.hu":true,"media.hu":true,"news.hu":true,"reklam.hu":true,"sex.hu":true,"shop.hu":true,"suli.hu":true,"szex.hu":true,"tozsde.hu":true,"utazas.hu":true,"video.hu":true,"id":true,"ac.id":true,"biz.id":true,"co.id":true,"desa.id":true,"go.id":true,"mil.id":true,"my.id":true,"net.id":true,"or.id":true,"sch.id":true,"web.id":true,"ie":true,"gov.ie":true,"il":true,"ac.il":true,"co.il":true,"gov.il":true,"idf.il":true,"k12.il":true,"muni.il":true,"net.il":true,"org.il":true,"im":true,"ac.im":true,"co.im":true,"com.im":true,"ltd.co.im":true,"net.im":true,"org.im":true,"plc.co.im":true,"tt.im":true,"tv.im":true,"in":true,"co.in":true,"firm.in":true,"net.in":true,"org.in":true,"gen.in":true,"ind.in":true,"nic.in":true,"ac.in":true,"edu.in":true,"res.in":true,"gov.in":true,"mil.in":true,"info":true,"int":true,"eu.int":true,"io":true,"com.io":true,"iq":true,"gov.iq":true,"edu.iq":true,"mil.iq":true,"com.iq":true,"org.iq":true,"net.iq":true,"ir":true,"ac.ir":true,"co.ir":true,"gov.ir":true,"id.ir":true,"net.ir":true,"org.ir":true,"sch.ir":true,"xn--mgba3a4f16a.ir":true,"xn--mgba3a4fra.ir":true,"is":true,"net.is":true,"com.is":true,"edu.is":true,"gov.is":true,"org.is":true,"int.is":true,"it":true,"gov.it":true,"edu.it":true,"abr.it":true,"abruzzo.it":true,"aosta-valley.it":true,"aostavalley.it":true,"bas.it":true,"basilicata.it":true,"cal.it":true,"calabria.it":true,"cam.it":true,"campania.it":true,"emilia-romagna.it":true,"emiliaromagna.it":true,"emr.it":true,"friuli-v-giulia.it":true,"friuli-ve-giulia.it":true,"friuli-vegiulia.it":true,"friuli-venezia-giulia.it":true,"friuli-veneziagiulia.it":true,"friuli-vgiulia.it":true,"friuliv-giulia.it":true,"friulive-giulia.it":true,"friulivegiulia.it":true,"friulivenezia-giulia.it":true,"friuliveneziagiulia.it":true,"friulivgiulia.it":true,"fvg.it":true,"laz.it":true,"lazio.it":true,"lig.it":true,"liguria.it":true,"lom.it":true,"lombardia.it":true,"lombardy.it":true,"lucania.it":true,"mar.it":true,"marche.it":true,"mol.it":true,"molise.it":true,"piedmont.it":true,"piemonte.it":true,"pmn.it":true,"pug.it":true,"puglia.it":true,"sar.it":true,"sardegna.it":true,"sardinia.it":true,"sic.it":true,"sicilia.it":true,"sicily.it":true,"taa.it":true,"tos.it":true,"toscana.it":true,"trentino-a-adige.it":true,"trentino-aadige.it":true,"trentino-alto-adige.it":true,"trentino-altoadige.it":true,"trentino-s-tirol.it":true,"trentino-stirol.it":true,"trentino-sud-tirol.it":true,"trentino-sudtirol.it":true,"trentino-sued-tirol.it":true,"trentino-suedtirol.it":true,"trentinoa-adige.it":true,"trentinoaadige.it":true,"trentinoalto-adige.it":true,"trentinoaltoadige.it":true,"trentinos-tirol.it":true,"trentinostirol.it":true,"trentinosud-tirol.it":true,"trentinosudtirol.it":true,"trentinosued-tirol.it":true,"trentinosuedtirol.it":true,"tuscany.it":true,"umb.it":true,"umbria.it":true,"val-d-aosta.it":true,"val-daosta.it":true,"vald-aosta.it":true,"valdaosta.it":true,"valle-aosta.it":true,"valle-d-aosta.it":true,"valle-daosta.it":true,"valleaosta.it":true,"valled-aosta.it":true,"valledaosta.it":true,"vallee-aoste.it":true,"valleeaoste.it":true,"vao.it":true,"vda.it":true,"ven.it":true,"veneto.it":true,"ag.it":true,"agrigento.it":true,"al.it":true,"alessandria.it":true,"alto-adige.it":true,"altoadige.it":true,"an.it":true,"ancona.it":true,"andria-barletta-trani.it":true,"andria-trani-barletta.it":true,"andriabarlettatrani.it":true,"andriatranibarletta.it":true,"ao.it":true,"aosta.it":true,"aoste.it":true,"ap.it":true,"aq.it":true,"aquila.it":true,"ar.it":true,"arezzo.it":true,"ascoli-piceno.it":true,"ascolipiceno.it":true,"asti.it":true,"at.it":true,"av.it":true,"avellino.it":true,"ba.it":true,"balsan.it":true,"bari.it":true,"barletta-trani-andria.it":true,"barlettatraniandria.it":true,"belluno.it":true,"benevento.it":true,"bergamo.it":true,"bg.it":true,"bi.it":true,"biella.it":true,"bl.it":true,"bn.it":true,"bo.it":true,"bologna.it":true,"bolzano.it":true,"bozen.it":true,"br.it":true,"brescia.it":true,"brindisi.it":true,"bs.it":true,"bt.it":true,"bz.it":true,"ca.it":true,"cagliari.it":true,"caltanissetta.it":true,"campidano-medio.it":true,"campidanomedio.it":true,"campobasso.it":true,"carbonia-iglesias.it":true,"carboniaiglesias.it":true,"carrara-massa.it":true,"carraramassa.it":true,"caserta.it":true,"catania.it":true,"catanzaro.it":true,"cb.it":true,"ce.it":true,"cesena-forli.it":true,"cesenaforli.it":true,"ch.it":true,"chieti.it":true,"ci.it":true,"cl.it":true,"cn.it":true,"co.it":true,"como.it":true,"cosenza.it":true,"cr.it":true,"cremona.it":true,"crotone.it":true,"cs.it":true,"ct.it":true,"cuneo.it":true,"cz.it":true,"dell-ogliastra.it":true,"dellogliastra.it":true,"en.it":true,"enna.it":true,"fc.it":true,"fe.it":true,"fermo.it":true,"ferrara.it":true,"fg.it":true,"fi.it":true,"firenze.it":true,"florence.it":true,"fm.it":true,"foggia.it":true,"forli-cesena.it":true,"forlicesena.it":true,"fr.it":true,"frosinone.it":true,"ge.it":true,"genoa.it":true,"genova.it":true,"go.it":true,"gorizia.it":true,"gr.it":true,"grosseto.it":true,"iglesias-carbonia.it":true,"iglesiascarbonia.it":true,"im.it":true,"imperia.it":true,"is.it":true,"isernia.it":true,"kr.it":true,"la-spezia.it":true,"laquila.it":true,"laspezia.it":true,"latina.it":true,"lc.it":true,"le.it":true,"lecce.it":true,"lecco.it":true,"li.it":true,"livorno.it":true,"lo.it":true,"lodi.it":true,"lt.it":true,"lu.it":true,"lucca.it":true,"macerata.it":true,"mantova.it":true,"massa-carrara.it":true,"massacarrara.it":true,"matera.it":true,"mb.it":true,"mc.it":true,"me.it":true,"medio-campidano.it":true,"mediocampidano.it":true,"messina.it":true,"mi.it":true,"milan.it":true,"milano.it":true,"mn.it":true,"mo.it":true,"modena.it":true,"monza-brianza.it":true,"monza-e-della-brianza.it":true,"monza.it":true,"monzabrianza.it":true,"monzaebrianza.it":true,"monzaedellabrianza.it":true,"ms.it":true,"mt.it":true,"na.it":true,"naples.it":true,"napoli.it":true,"no.it":true,"novara.it":true,"nu.it":true,"nuoro.it":true,"og.it":true,"ogliastra.it":true,"olbia-tempio.it":true,"olbiatempio.it":true,"or.it":true,"oristano.it":true,"ot.it":true,"pa.it":true,"padova.it":true,"padua.it":true,"palermo.it":true,"parma.it":true,"pavia.it":true,"pc.it":true,"pd.it":true,"pe.it":true,"perugia.it":true,"pesaro-urbino.it":true,"pesarourbino.it":true,"pescara.it":true,"pg.it":true,"pi.it":true,"piacenza.it":true,"pisa.it":true,"pistoia.it":true,"pn.it":true,"po.it":true,"pordenone.it":true,"potenza.it":true,"pr.it":true,"prato.it":true,"pt.it":true,"pu.it":true,"pv.it":true,"pz.it":true,"ra.it":true,"ragusa.it":true,"ravenna.it":true,"rc.it":true,"re.it":true,"reggio-calabria.it":true,"reggio-emilia.it":true,"reggiocalabria.it":true,"reggioemilia.it":true,"rg.it":true,"ri.it":true,"rieti.it":true,"rimini.it":true,"rm.it":true,"rn.it":true,"ro.it":true,"roma.it":true,"rome.it":true,"rovigo.it":true,"sa.it":true,"salerno.it":true,"sassari.it":true,"savona.it":true,"si.it":true,"siena.it":true,"siracusa.it":true,"so.it":true,"sondrio.it":true,"sp.it":true,"sr.it":true,"ss.it":true,"suedtirol.it":true,"sv.it":true,"ta.it":true,"taranto.it":true,"te.it":true,"tempio-olbia.it":true,"tempioolbia.it":true,"teramo.it":true,"terni.it":true,"tn.it":true,"to.it":true,"torino.it":true,"tp.it":true,"tr.it":true,"trani-andria-barletta.it":true,"trani-barletta-andria.it":true,"traniandriabarletta.it":true,"tranibarlettaandria.it":true,"trapani.it":true,"trentino.it":true,"trento.it":true,"treviso.it":true,"trieste.it":true,"ts.it":true,"turin.it":true,"tv.it":true,"ud.it":true,"udine.it":true,"urbino-pesaro.it":true,"urbinopesaro.it":true,"va.it":true,"varese.it":true,"vb.it":true,"vc.it":true,"ve.it":true,"venezia.it":true,"venice.it":true,"verbania.it":true,"vercelli.it":true,"verona.it":true,"vi.it":true,"vibo-valentia.it":true,"vibovalentia.it":true,"vicenza.it":true,"viterbo.it":true,"vr.it":true,"vs.it":true,"vt.it":true,"vv.it":true,"je":true,"co.je":true,"net.je":true,"org.je":true,"*.jm":true,"jo":true,"com.jo":true,"org.jo":true,"net.jo":true,"edu.jo":true,"sch.jo":true,"gov.jo":true,"mil.jo":true,"name.jo":true,"jobs":true,"jp":true,"ac.jp":true,"ad.jp":true,"co.jp":true,"ed.jp":true,"go.jp":true,"gr.jp":true,"lg.jp":true,"ne.jp":true,"or.jp":true,"aichi.jp":true,"akita.jp":true,"aomori.jp":true,"chiba.jp":true,"ehime.jp":true,"fukui.jp":true,"fukuoka.jp":true,"fukushima.jp":true,"gifu.jp":true,"gunma.jp":true,"hiroshima.jp":true,"hokkaido.jp":true,"hyogo.jp":true,"ibaraki.jp":true,"ishikawa.jp":true,"iwate.jp":true,"kagawa.jp":true,"kagoshima.jp":true,"kanagawa.jp":true,"kochi.jp":true,"kumamoto.jp":true,"kyoto.jp":true,"mie.jp":true,"miyagi.jp":true,"miyazaki.jp":true,"nagano.jp":true,"nagasaki.jp":true,"nara.jp":true,"niigata.jp":true,"oita.jp":true,"okayama.jp":true,"okinawa.jp":true,"osaka.jp":true,"saga.jp":true,"saitama.jp":true,"shiga.jp":true,"shimane.jp":true,"shizuoka.jp":true,"tochigi.jp":true,"tokushima.jp":true,"tokyo.jp":true,"tottori.jp":true,"toyama.jp":true,"wakayama.jp":true,"yamagata.jp":true,"yamaguchi.jp":true,"yamanashi.jp":true,"xn--4pvxs.jp":true,"xn--vgu402c.jp":true,"xn--c3s14m.jp":true,"xn--f6qx53a.jp":true,"xn--8pvr4u.jp":true,"xn--uist22h.jp":true,"xn--djrs72d6uy.jp":true,"xn--mkru45i.jp":true,"xn--0trq7p7nn.jp":true,"xn--8ltr62k.jp":true,"xn--2m4a15e.jp":true,"xn--efvn9s.jp":true,"xn--32vp30h.jp":true,"xn--4it797k.jp":true,"xn--1lqs71d.jp":true,"xn--5rtp49c.jp":true,"xn--5js045d.jp":true,"xn--ehqz56n.jp":true,"xn--1lqs03n.jp":true,"xn--qqqt11m.jp":true,"xn--kbrq7o.jp":true,"xn--pssu33l.jp":true,"xn--ntsq17g.jp":true,"xn--uisz3g.jp":true,"xn--6btw5a.jp":true,"xn--1ctwo.jp":true,"xn--6orx2r.jp":true,"xn--rht61e.jp":true,"xn--rht27z.jp":true,"xn--djty4k.jp":true,"xn--nit225k.jp":true,"xn--rht3d.jp":true,"xn--klty5x.jp":true,"xn--kltx9a.jp":true,"xn--kltp7d.jp":true,"xn--uuwu58a.jp":true,"xn--zbx025d.jp":true,"xn--ntso0iqx3a.jp":true,"xn--elqq16h.jp":true,"xn--4it168d.jp":true,"xn--klt787d.jp":true,"xn--rny31h.jp":true,"xn--7t0a264c.jp":true,"xn--5rtq34k.jp":true,"xn--k7yn95e.jp":true,"xn--tor131o.jp":true,"xn--d5qv7z876c.jp":true,"*.kawasaki.jp":true,"*.kitakyushu.jp":true,"*.kobe.jp":true,"*.nagoya.jp":true,"*.sapporo.jp":true,"*.sendai.jp":true,"*.yokohama.jp":true,"city.kawasaki.jp":false,"city.kitakyushu.jp":false,"city.kobe.jp":false,"city.nagoya.jp":false,"city.sapporo.jp":false,"city.sendai.jp":false,"city.yokohama.jp":false,"aisai.aichi.jp":true,"ama.aichi.jp":true,"anjo.aichi.jp":true,"asuke.aichi.jp":true,"chiryu.aichi.jp":true,"chita.aichi.jp":true,"fuso.aichi.jp":true,"gamagori.aichi.jp":true,"handa.aichi.jp":true,"hazu.aichi.jp":true,"hekinan.aichi.jp":true,"higashiura.aichi.jp":true,"ichinomiya.aichi.jp":true,"inazawa.aichi.jp":true,"inuyama.aichi.jp":true,"isshiki.aichi.jp":true,"iwakura.aichi.jp":true,"kanie.aichi.jp":true,"kariya.aichi.jp":true,"kasugai.aichi.jp":true,"kira.aichi.jp":true,"kiyosu.aichi.jp":true,"komaki.aichi.jp":true,"konan.aichi.jp":true,"kota.aichi.jp":true,"mihama.aichi.jp":true,"miyoshi.aichi.jp":true,"nishio.aichi.jp":true,"nisshin.aichi.jp":true,"obu.aichi.jp":true,"oguchi.aichi.jp":true,"oharu.aichi.jp":true,"okazaki.aichi.jp":true,"owariasahi.aichi.jp":true,"seto.aichi.jp":true,"shikatsu.aichi.jp":true,"shinshiro.aichi.jp":true,"shitara.aichi.jp":true,"tahara.aichi.jp":true,"takahama.aichi.jp":true,"tobishima.aichi.jp":true,"toei.aichi.jp":true,"togo.aichi.jp":true,"tokai.aichi.jp":true,"tokoname.aichi.jp":true,"toyoake.aichi.jp":true,"toyohashi.aichi.jp":true,"toyokawa.aichi.jp":true,"toyone.aichi.jp":true,"toyota.aichi.jp":true,"tsushima.aichi.jp":true,"yatomi.aichi.jp":true,"akita.akita.jp":true,"daisen.akita.jp":true,"fujisato.akita.jp":true,"gojome.akita.jp":true,"hachirogata.akita.jp":true,"happou.akita.jp":true,"higashinaruse.akita.jp":true,"honjo.akita.jp":true,"honjyo.akita.jp":true,"ikawa.akita.jp":true,"kamikoani.akita.jp":true,"kamioka.akita.jp":true,"katagami.akita.jp":true,"kazuno.akita.jp":true,"kitaakita.akita.jp":true,"kosaka.akita.jp":true,"kyowa.akita.jp":true,"misato.akita.jp":true,"mitane.akita.jp":true,"moriyoshi.akita.jp":true,"nikaho.akita.jp":true,"noshiro.akita.jp":true,"odate.akita.jp":true,"oga.akita.jp":true,"ogata.akita.jp":true,"semboku.akita.jp":true,"yokote.akita.jp":true,"yurihonjo.akita.jp":true,"aomori.aomori.jp":true,"gonohe.aomori.jp":true,"hachinohe.aomori.jp":true,"hashikami.aomori.jp":true,"hiranai.aomori.jp":true,"hirosaki.aomori.jp":true,"itayanagi.aomori.jp":true,"kuroishi.aomori.jp":true,"misawa.aomori.jp":true,"mutsu.aomori.jp":true,"nakadomari.aomori.jp":true,"noheji.aomori.jp":true,"oirase.aomori.jp":true,"owani.aomori.jp":true,"rokunohe.aomori.jp":true,"sannohe.aomori.jp":true,"shichinohe.aomori.jp":true,"shingo.aomori.jp":true,"takko.aomori.jp":true,"towada.aomori.jp":true,"tsugaru.aomori.jp":true,"tsuruta.aomori.jp":true,"abiko.chiba.jp":true,"asahi.chiba.jp":true,"chonan.chiba.jp":true,"chosei.chiba.jp":true,"choshi.chiba.jp":true,"chuo.chiba.jp":true,"funabashi.chiba.jp":true,"futtsu.chiba.jp":true,"hanamigawa.chiba.jp":true,"ichihara.chiba.jp":true,"ichikawa.chiba.jp":true,"ichinomiya.chiba.jp":true,"inzai.chiba.jp":true,"isumi.chiba.jp":true,"kamagaya.chiba.jp":true,"kamogawa.chiba.jp":true,"kashiwa.chiba.jp":true,"katori.chiba.jp":true,"katsuura.chiba.jp":true,"kimitsu.chiba.jp":true,"kisarazu.chiba.jp":true,"kozaki.chiba.jp":true,"kujukuri.chiba.jp":true,"kyonan.chiba.jp":true,"matsudo.chiba.jp":true,"midori.chiba.jp":true,"mihama.chiba.jp":true,"minamiboso.chiba.jp":true,"mobara.chiba.jp":true,"mutsuzawa.chiba.jp":true,"nagara.chiba.jp":true,"nagareyama.chiba.jp":true,"narashino.chiba.jp":true,"narita.chiba.jp":true,"noda.chiba.jp":true,"oamishirasato.chiba.jp":true,"omigawa.chiba.jp":true,"onjuku.chiba.jp":true,"otaki.chiba.jp":true,"sakae.chiba.jp":true,"sakura.chiba.jp":true,"shimofusa.chiba.jp":true,"shirako.chiba.jp":true,"shiroi.chiba.jp":true,"shisui.chiba.jp":true,"sodegaura.chiba.jp":true,"sosa.chiba.jp":true,"tako.chiba.jp":true,"tateyama.chiba.jp":true,"togane.chiba.jp":true,"tohnosho.chiba.jp":true,"tomisato.chiba.jp":true,"urayasu.chiba.jp":true,"yachimata.chiba.jp":true,"yachiyo.chiba.jp":true,"yokaichiba.chiba.jp":true,"yokoshibahikari.chiba.jp":true,"yotsukaido.chiba.jp":true,"ainan.ehime.jp":true,"honai.ehime.jp":true,"ikata.ehime.jp":true,"imabari.ehime.jp":true,"iyo.ehime.jp":true,"kamijima.ehime.jp":true,"kihoku.ehime.jp":true,"kumakogen.ehime.jp":true,"masaki.ehime.jp":true,"matsuno.ehime.jp":true,"matsuyama.ehime.jp":true,"namikata.ehime.jp":true,"niihama.ehime.jp":true,"ozu.ehime.jp":true,"saijo.ehime.jp":true,"seiyo.ehime.jp":true,"shikokuchuo.ehime.jp":true,"tobe.ehime.jp":true,"toon.ehime.jp":true,"uchiko.ehime.jp":true,"uwajima.ehime.jp":true,"yawatahama.ehime.jp":true,"echizen.fukui.jp":true,"eiheiji.fukui.jp":true,"fukui.fukui.jp":true,"ikeda.fukui.jp":true,"katsuyama.fukui.jp":true,"mihama.fukui.jp":true,"minamiechizen.fukui.jp":true,"obama.fukui.jp":true,"ohi.fukui.jp":true,"ono.fukui.jp":true,"sabae.fukui.jp":true,"sakai.fukui.jp":true,"takahama.fukui.jp":true,"tsuruga.fukui.jp":true,"wakasa.fukui.jp":true,"ashiya.fukuoka.jp":true,"buzen.fukuoka.jp":true,"chikugo.fukuoka.jp":true,"chikuho.fukuoka.jp":true,"chikujo.fukuoka.jp":true,"chikushino.fukuoka.jp":true,"chikuzen.fukuoka.jp":true,"chuo.fukuoka.jp":true,"dazaifu.fukuoka.jp":true,"fukuchi.fukuoka.jp":true,"hakata.fukuoka.jp":true,"higashi.fukuoka.jp":true,"hirokawa.fukuoka.jp":true,"hisayama.fukuoka.jp":true,"iizuka.fukuoka.jp":true,"inatsuki.fukuoka.jp":true,"kaho.fukuoka.jp":true,"kasuga.fukuoka.jp":true,"kasuya.fukuoka.jp":true,"kawara.fukuoka.jp":true,"keisen.fukuoka.jp":true,"koga.fukuoka.jp":true,"kurate.fukuoka.jp":true,"kurogi.fukuoka.jp":true,"kurume.fukuoka.jp":true,"minami.fukuoka.jp":true,"miyako.fukuoka.jp":true,"miyama.fukuoka.jp":true,"miyawaka.fukuoka.jp":true,"mizumaki.fukuoka.jp":true,"munakata.fukuoka.jp":true,"nakagawa.fukuoka.jp":true,"nakama.fukuoka.jp":true,"nishi.fukuoka.jp":true,"nogata.fukuoka.jp":true,"ogori.fukuoka.jp":true,"okagaki.fukuoka.jp":true,"okawa.fukuoka.jp":true,"oki.fukuoka.jp":true,"omuta.fukuoka.jp":true,"onga.fukuoka.jp":true,"onojo.fukuoka.jp":true,"oto.fukuoka.jp":true,"saigawa.fukuoka.jp":true,"sasaguri.fukuoka.jp":true,"shingu.fukuoka.jp":true,"shinyoshitomi.fukuoka.jp":true,"shonai.fukuoka.jp":true,"soeda.fukuoka.jp":true,"sue.fukuoka.jp":true,"tachiarai.fukuoka.jp":true,"tagawa.fukuoka.jp":true,"takata.fukuoka.jp":true,"toho.fukuoka.jp":true,"toyotsu.fukuoka.jp":true,"tsuiki.fukuoka.jp":true,"ukiha.fukuoka.jp":true,"umi.fukuoka.jp":true,"usui.fukuoka.jp":true,"yamada.fukuoka.jp":true,"yame.fukuoka.jp":true,"yanagawa.fukuoka.jp":true,"yukuhashi.fukuoka.jp":true,"aizubange.fukushima.jp":true,"aizumisato.fukushima.jp":true,"aizuwakamatsu.fukushima.jp":true,"asakawa.fukushima.jp":true,"bandai.fukushima.jp":true,"date.fukushima.jp":true,"fukushima.fukushima.jp":true,"furudono.fukushima.jp":true,"futaba.fukushima.jp":true,"hanawa.fukushima.jp":true,"higashi.fukushima.jp":true,"hirata.fukushima.jp":true,"hirono.fukushima.jp":true,"iitate.fukushima.jp":true,"inawashiro.fukushima.jp":true,"ishikawa.fukushima.jp":true,"iwaki.fukushima.jp":true,"izumizaki.fukushima.jp":true,"kagamiishi.fukushima.jp":true,"kaneyama.fukushima.jp":true,"kawamata.fukushima.jp":true,"kitakata.fukushima.jp":true,"kitashiobara.fukushima.jp":true,"koori.fukushima.jp":true,"koriyama.fukushima.jp":true,"kunimi.fukushima.jp":true,"miharu.fukushima.jp":true,"mishima.fukushima.jp":true,"namie.fukushima.jp":true,"nango.fukushima.jp":true,"nishiaizu.fukushima.jp":true,"nishigo.fukushima.jp":true,"okuma.fukushima.jp":true,"omotego.fukushima.jp":true,"ono.fukushima.jp":true,"otama.fukushima.jp":true,"samegawa.fukushima.jp":true,"shimogo.fukushima.jp":true,"shirakawa.fukushima.jp":true,"showa.fukushima.jp":true,"soma.fukushima.jp":true,"sukagawa.fukushima.jp":true,"taishin.fukushima.jp":true,"tamakawa.fukushima.jp":true,"tanagura.fukushima.jp":true,"tenei.fukushima.jp":true,"yabuki.fukushima.jp":true,"yamato.fukushima.jp":true,"yamatsuri.fukushima.jp":true,"yanaizu.fukushima.jp":true,"yugawa.fukushima.jp":true,"anpachi.gifu.jp":true,"ena.gifu.jp":true,"gifu.gifu.jp":true,"ginan.gifu.jp":true,"godo.gifu.jp":true,"gujo.gifu.jp":true,"hashima.gifu.jp":true,"hichiso.gifu.jp":true,"hida.gifu.jp":true,"higashishirakawa.gifu.jp":true,"ibigawa.gifu.jp":true,"ikeda.gifu.jp":true,"kakamigahara.gifu.jp":true,"kani.gifu.jp":true,"kasahara.gifu.jp":true,"kasamatsu.gifu.jp":true,"kawaue.gifu.jp":true,"kitagata.gifu.jp":true,"mino.gifu.jp":true,"minokamo.gifu.jp":true,"mitake.gifu.jp":true,"mizunami.gifu.jp":true,"motosu.gifu.jp":true,"nakatsugawa.gifu.jp":true,"ogaki.gifu.jp":true,"sakahogi.gifu.jp":true,"seki.gifu.jp":true,"sekigahara.gifu.jp":true,"shirakawa.gifu.jp":true,"tajimi.gifu.jp":true,"takayama.gifu.jp":true,"tarui.gifu.jp":true,"toki.gifu.jp":true,"tomika.gifu.jp":true,"wanouchi.gifu.jp":true,"yamagata.gifu.jp":true,"yaotsu.gifu.jp":true,"yoro.gifu.jp":true,"annaka.gunma.jp":true,"chiyoda.gunma.jp":true,"fujioka.gunma.jp":true,"higashiagatsuma.gunma.jp":true,"isesaki.gunma.jp":true,"itakura.gunma.jp":true,"kanna.gunma.jp":true,"kanra.gunma.jp":true,"katashina.gunma.jp":true,"kawaba.gunma.jp":true,"kiryu.gunma.jp":true,"kusatsu.gunma.jp":true,"maebashi.gunma.jp":true,"meiwa.gunma.jp":true,"midori.gunma.jp":true,"minakami.gunma.jp":true,"naganohara.gunma.jp":true,"nakanojo.gunma.jp":true,"nanmoku.gunma.jp":true,"numata.gunma.jp":true,"oizumi.gunma.jp":true,"ora.gunma.jp":true,"ota.gunma.jp":true,"shibukawa.gunma.jp":true,"shimonita.gunma.jp":true,"shinto.gunma.jp":true,"showa.gunma.jp":true,"takasaki.gunma.jp":true,"takayama.gunma.jp":true,"tamamura.gunma.jp":true,"tatebayashi.gunma.jp":true,"tomioka.gunma.jp":true,"tsukiyono.gunma.jp":true,"tsumagoi.gunma.jp":true,"ueno.gunma.jp":true,"yoshioka.gunma.jp":true,"asaminami.hiroshima.jp":true,"daiwa.hiroshima.jp":true,"etajima.hiroshima.jp":true,"fuchu.hiroshima.jp":true,"fukuyama.hiroshima.jp":true,"hatsukaichi.hiroshima.jp":true,"higashihiroshima.hiroshima.jp":true,"hongo.hiroshima.jp":true,"jinsekikogen.hiroshima.jp":true,"kaita.hiroshima.jp":true,"kui.hiroshima.jp":true,"kumano.hiroshima.jp":true,"kure.hiroshima.jp":true,"mihara.hiroshima.jp":true,"miyoshi.hiroshima.jp":true,"naka.hiroshima.jp":true,"onomichi.hiroshima.jp":true,"osakikamijima.hiroshima.jp":true,"otake.hiroshima.jp":true,"saka.hiroshima.jp":true,"sera.hiroshima.jp":true,"seranishi.hiroshima.jp":true,"shinichi.hiroshima.jp":true,"shobara.hiroshima.jp":true,"takehara.hiroshima.jp":true,"abashiri.hokkaido.jp":true,"abira.hokkaido.jp":true,"aibetsu.hokkaido.jp":true,"akabira.hokkaido.jp":true,"akkeshi.hokkaido.jp":true,"asahikawa.hokkaido.jp":true,"ashibetsu.hokkaido.jp":true,"ashoro.hokkaido.jp":true,"assabu.hokkaido.jp":true,"atsuma.hokkaido.jp":true,"bibai.hokkaido.jp":true,"biei.hokkaido.jp":true,"bifuka.hokkaido.jp":true,"bihoro.hokkaido.jp":true,"biratori.hokkaido.jp":true,"chippubetsu.hokkaido.jp":true,"chitose.hokkaido.jp":true,"date.hokkaido.jp":true,"ebetsu.hokkaido.jp":true,"embetsu.hokkaido.jp":true,"eniwa.hokkaido.jp":true,"erimo.hokkaido.jp":true,"esan.hokkaido.jp":true,"esashi.hokkaido.jp":true,"fukagawa.hokkaido.jp":true,"fukushima.hokkaido.jp":true,"furano.hokkaido.jp":true,"furubira.hokkaido.jp":true,"haboro.hokkaido.jp":true,"hakodate.hokkaido.jp":true,"hamatonbetsu.hokkaido.jp":true,"hidaka.hokkaido.jp":true,"higashikagura.hokkaido.jp":true,"higashikawa.hokkaido.jp":true,"hiroo.hokkaido.jp":true,"hokuryu.hokkaido.jp":true,"hokuto.hokkaido.jp":true,"honbetsu.hokkaido.jp":true,"horokanai.hokkaido.jp":true,"horonobe.hokkaido.jp":true,"ikeda.hokkaido.jp":true,"imakane.hokkaido.jp":true,"ishikari.hokkaido.jp":true,"iwamizawa.hokkaido.jp":true,"iwanai.hokkaido.jp":true,"kamifurano.hokkaido.jp":true,"kamikawa.hokkaido.jp":true,"kamishihoro.hokkaido.jp":true,"kamisunagawa.hokkaido.jp":true,"kamoenai.hokkaido.jp":true,"kayabe.hokkaido.jp":true,"kembuchi.hokkaido.jp":true,"kikonai.hokkaido.jp":true,"kimobetsu.hokkaido.jp":true,"kitahiroshima.hokkaido.jp":true,"kitami.hokkaido.jp":true,"kiyosato.hokkaido.jp":true,"koshimizu.hokkaido.jp":true,"kunneppu.hokkaido.jp":true,"kuriyama.hokkaido.jp":true,"kuromatsunai.hokkaido.jp":true,"kushiro.hokkaido.jp":true,"kutchan.hokkaido.jp":true,"kyowa.hokkaido.jp":true,"mashike.hokkaido.jp":true,"matsumae.hokkaido.jp":true,"mikasa.hokkaido.jp":true,"minamifurano.hokkaido.jp":true,"mombetsu.hokkaido.jp":true,"moseushi.hokkaido.jp":true,"mukawa.hokkaido.jp":true,"muroran.hokkaido.jp":true,"naie.hokkaido.jp":true,"nakagawa.hokkaido.jp":true,"nakasatsunai.hokkaido.jp":true,"nakatombetsu.hokkaido.jp":true,"nanae.hokkaido.jp":true,"nanporo.hokkaido.jp":true,"nayoro.hokkaido.jp":true,"nemuro.hokkaido.jp":true,"niikappu.hokkaido.jp":true,"niki.hokkaido.jp":true,"nishiokoppe.hokkaido.jp":true,"noboribetsu.hokkaido.jp":true,"numata.hokkaido.jp":true,"obihiro.hokkaido.jp":true,"obira.hokkaido.jp":true,"oketo.hokkaido.jp":true,"okoppe.hokkaido.jp":true,"otaru.hokkaido.jp":true,"otobe.hokkaido.jp":true,"otofuke.hokkaido.jp":true,"otoineppu.hokkaido.jp":true,"oumu.hokkaido.jp":true,"ozora.hokkaido.jp":true,"pippu.hokkaido.jp":true,"rankoshi.hokkaido.jp":true,"rebun.hokkaido.jp":true,"rikubetsu.hokkaido.jp":true,"rishiri.hokkaido.jp":true,"rishirifuji.hokkaido.jp":true,"saroma.hokkaido.jp":true,"sarufutsu.hokkaido.jp":true,"shakotan.hokkaido.jp":true,"shari.hokkaido.jp":true,"shibecha.hokkaido.jp":true,"shibetsu.hokkaido.jp":true,"shikabe.hokkaido.jp":true,"shikaoi.hokkaido.jp":true,"shimamaki.hokkaido.jp":true,"shimizu.hokkaido.jp":true,"shimokawa.hokkaido.jp":true,"shinshinotsu.hokkaido.jp":true,"shintoku.hokkaido.jp":true,"shiranuka.hokkaido.jp":true,"shiraoi.hokkaido.jp":true,"shiriuchi.hokkaido.jp":true,"sobetsu.hokkaido.jp":true,"sunagawa.hokkaido.jp":true,"taiki.hokkaido.jp":true,"takasu.hokkaido.jp":true,"takikawa.hokkaido.jp":true,"takinoue.hokkaido.jp":true,"teshikaga.hokkaido.jp":true,"tobetsu.hokkaido.jp":true,"tohma.hokkaido.jp":true,"tomakomai.hokkaido.jp":true,"tomari.hokkaido.jp":true,"toya.hokkaido.jp":true,"toyako.hokkaido.jp":true,"toyotomi.hokkaido.jp":true,"toyoura.hokkaido.jp":true,"tsubetsu.hokkaido.jp":true,"tsukigata.hokkaido.jp":true,"urakawa.hokkaido.jp":true,"urausu.hokkaido.jp":true,"uryu.hokkaido.jp":true,"utashinai.hokkaido.jp":true,"wakkanai.hokkaido.jp":true,"wassamu.hokkaido.jp":true,"yakumo.hokkaido.jp":true,"yoichi.hokkaido.jp":true,"aioi.hyogo.jp":true,"akashi.hyogo.jp":true,"ako.hyogo.jp":true,"amagasaki.hyogo.jp":true,"aogaki.hyogo.jp":true,"asago.hyogo.jp":true,"ashiya.hyogo.jp":true,"awaji.hyogo.jp":true,"fukusaki.hyogo.jp":true,"goshiki.hyogo.jp":true,"harima.hyogo.jp":true,"himeji.hyogo.jp":true,"ichikawa.hyogo.jp":true,"inagawa.hyogo.jp":true,"itami.hyogo.jp":true,"kakogawa.hyogo.jp":true,"kamigori.hyogo.jp":true,"kamikawa.hyogo.jp":true,"kasai.hyogo.jp":true,"kasuga.hyogo.jp":true,"kawanishi.hyogo.jp":true,"miki.hyogo.jp":true,"minamiawaji.hyogo.jp":true,"nishinomiya.hyogo.jp":true,"nishiwaki.hyogo.jp":true,"ono.hyogo.jp":true,"sanda.hyogo.jp":true,"sannan.hyogo.jp":true,"sasayama.hyogo.jp":true,"sayo.hyogo.jp":true,"shingu.hyogo.jp":true,"shinonsen.hyogo.jp":true,"shiso.hyogo.jp":true,"sumoto.hyogo.jp":true,"taishi.hyogo.jp":true,"taka.hyogo.jp":true,"takarazuka.hyogo.jp":true,"takasago.hyogo.jp":true,"takino.hyogo.jp":true,"tamba.hyogo.jp":true,"tatsuno.hyogo.jp":true,"toyooka.hyogo.jp":true,"yabu.hyogo.jp":true,"yashiro.hyogo.jp":true,"yoka.hyogo.jp":true,"yokawa.hyogo.jp":true,"ami.ibaraki.jp":true,"asahi.ibaraki.jp":true,"bando.ibaraki.jp":true,"chikusei.ibaraki.jp":true,"daigo.ibaraki.jp":true,"fujishiro.ibaraki.jp":true,"hitachi.ibaraki.jp":true,"hitachinaka.ibaraki.jp":true,"hitachiomiya.ibaraki.jp":true,"hitachiota.ibaraki.jp":true,"ibaraki.ibaraki.jp":true,"ina.ibaraki.jp":true,"inashiki.ibaraki.jp":true,"itako.ibaraki.jp":true,"iwama.ibaraki.jp":true,"joso.ibaraki.jp":true,"kamisu.ibaraki.jp":true,"kasama.ibaraki.jp":true,"kashima.ibaraki.jp":true,"kasumigaura.ibaraki.jp":true,"koga.ibaraki.jp":true,"miho.ibaraki.jp":true,"mito.ibaraki.jp":true,"moriya.ibaraki.jp":true,"naka.ibaraki.jp":true,"namegata.ibaraki.jp":true,"oarai.ibaraki.jp":true,"ogawa.ibaraki.jp":true,"omitama.ibaraki.jp":true,"ryugasaki.ibaraki.jp":true,"sakai.ibaraki.jp":true,"sakuragawa.ibaraki.jp":true,"shimodate.ibaraki.jp":true,"shimotsuma.ibaraki.jp":true,"shirosato.ibaraki.jp":true,"sowa.ibaraki.jp":true,"suifu.ibaraki.jp":true,"takahagi.ibaraki.jp":true,"tamatsukuri.ibaraki.jp":true,"tokai.ibaraki.jp":true,"tomobe.ibaraki.jp":true,"tone.ibaraki.jp":true,"toride.ibaraki.jp":true,"tsuchiura.ibaraki.jp":true,"tsukuba.ibaraki.jp":true,"uchihara.ibaraki.jp":true,"ushiku.ibaraki.jp":true,"yachiyo.ibaraki.jp":true,"yamagata.ibaraki.jp":true,"yawara.ibaraki.jp":true,"yuki.ibaraki.jp":true,"anamizu.ishikawa.jp":true,"hakui.ishikawa.jp":true,"hakusan.ishikawa.jp":true,"kaga.ishikawa.jp":true,"kahoku.ishikawa.jp":true,"kanazawa.ishikawa.jp":true,"kawakita.ishikawa.jp":true,"komatsu.ishikawa.jp":true,"nakanoto.ishikawa.jp":true,"nanao.ishikawa.jp":true,"nomi.ishikawa.jp":true,"nonoichi.ishikawa.jp":true,"noto.ishikawa.jp":true,"shika.ishikawa.jp":true,"suzu.ishikawa.jp":true,"tsubata.ishikawa.jp":true,"tsurugi.ishikawa.jp":true,"uchinada.ishikawa.jp":true,"wajima.ishikawa.jp":true,"fudai.iwate.jp":true,"fujisawa.iwate.jp":true,"hanamaki.iwate.jp":true,"hiraizumi.iwate.jp":true,"hirono.iwate.jp":true,"ichinohe.iwate.jp":true,"ichinoseki.iwate.jp":true,"iwaizumi.iwate.jp":true,"iwate.iwate.jp":true,"joboji.iwate.jp":true,"kamaishi.iwate.jp":true,"kanegasaki.iwate.jp":true,"karumai.iwate.jp":true,"kawai.iwate.jp":true,"kitakami.iwate.jp":true,"kuji.iwate.jp":true,"kunohe.iwate.jp":true,"kuzumaki.iwate.jp":true,"miyako.iwate.jp":true,"mizusawa.iwate.jp":true,"morioka.iwate.jp":true,"ninohe.iwate.jp":true,"noda.iwate.jp":true,"ofunato.iwate.jp":true,"oshu.iwate.jp":true,"otsuchi.iwate.jp":true,"rikuzentakata.iwate.jp":true,"shiwa.iwate.jp":true,"shizukuishi.iwate.jp":true,"sumita.iwate.jp":true,"tanohata.iwate.jp":true,"tono.iwate.jp":true,"yahaba.iwate.jp":true,"yamada.iwate.jp":true,"ayagawa.kagawa.jp":true,"higashikagawa.kagawa.jp":true,"kanonji.kagawa.jp":true,"kotohira.kagawa.jp":true,"manno.kagawa.jp":true,"marugame.kagawa.jp":true,"mitoyo.kagawa.jp":true,"naoshima.kagawa.jp":true,"sanuki.kagawa.jp":true,"tadotsu.kagawa.jp":true,"takamatsu.kagawa.jp":true,"tonosho.kagawa.jp":true,"uchinomi.kagawa.jp":true,"utazu.kagawa.jp":true,"zentsuji.kagawa.jp":true,"akune.kagoshima.jp":true,"amami.kagoshima.jp":true,"hioki.kagoshima.jp":true,"isa.kagoshima.jp":true,"isen.kagoshima.jp":true,"izumi.kagoshima.jp":true,"kagoshima.kagoshima.jp":true,"kanoya.kagoshima.jp":true,"kawanabe.kagoshima.jp":true,"kinko.kagoshima.jp":true,"kouyama.kagoshima.jp":true,"makurazaki.kagoshima.jp":true,"matsumoto.kagoshima.jp":true,"minamitane.kagoshima.jp":true,"nakatane.kagoshima.jp":true,"nishinoomote.kagoshima.jp":true,"satsumasendai.kagoshima.jp":true,"soo.kagoshima.jp":true,"tarumizu.kagoshima.jp":true,"yusui.kagoshima.jp":true,"aikawa.kanagawa.jp":true,"atsugi.kanagawa.jp":true,"ayase.kanagawa.jp":true,"chigasaki.kanagawa.jp":true,"ebina.kanagawa.jp":true,"fujisawa.kanagawa.jp":true,"hadano.kanagawa.jp":true,"hakone.kanagawa.jp":true,"hiratsuka.kanagawa.jp":true,"isehara.kanagawa.jp":true,"kaisei.kanagawa.jp":true,"kamakura.kanagawa.jp":true,"kiyokawa.kanagawa.jp":true,"matsuda.kanagawa.jp":true,"minamiashigara.kanagawa.jp":true,"miura.kanagawa.jp":true,"nakai.kanagawa.jp":true,"ninomiya.kanagawa.jp":true,"odawara.kanagawa.jp":true,"oi.kanagawa.jp":true,"oiso.kanagawa.jp":true,"sagamihara.kanagawa.jp":true,"samukawa.kanagawa.jp":true,"tsukui.kanagawa.jp":true,"yamakita.kanagawa.jp":true,"yamato.kanagawa.jp":true,"yokosuka.kanagawa.jp":true,"yugawara.kanagawa.jp":true,"zama.kanagawa.jp":true,"zushi.kanagawa.jp":true,"aki.kochi.jp":true,"geisei.kochi.jp":true,"hidaka.kochi.jp":true,"higashitsuno.kochi.jp":true,"ino.kochi.jp":true,"kagami.kochi.jp":true,"kami.kochi.jp":true,"kitagawa.kochi.jp":true,"kochi.kochi.jp":true,"mihara.kochi.jp":true,"motoyama.kochi.jp":true,"muroto.kochi.jp":true,"nahari.kochi.jp":true,"nakamura.kochi.jp":true,"nankoku.kochi.jp":true,"nishitosa.kochi.jp":true,"niyodogawa.kochi.jp":true,"ochi.kochi.jp":true,"okawa.kochi.jp":true,"otoyo.kochi.jp":true,"otsuki.kochi.jp":true,"sakawa.kochi.jp":true,"sukumo.kochi.jp":true,"susaki.kochi.jp":true,"tosa.kochi.jp":true,"tosashimizu.kochi.jp":true,"toyo.kochi.jp":true,"tsuno.kochi.jp":true,"umaji.kochi.jp":true,"yasuda.kochi.jp":true,"yusuhara.kochi.jp":true,"amakusa.kumamoto.jp":true,"arao.kumamoto.jp":true,"aso.kumamoto.jp":true,"choyo.kumamoto.jp":true,"gyokuto.kumamoto.jp":true,"kamiamakusa.kumamoto.jp":true,"kikuchi.kumamoto.jp":true,"kumamoto.kumamoto.jp":true,"mashiki.kumamoto.jp":true,"mifune.kumamoto.jp":true,"minamata.kumamoto.jp":true,"minamioguni.kumamoto.jp":true,"nagasu.kumamoto.jp":true,"nishihara.kumamoto.jp":true,"oguni.kumamoto.jp":true,"ozu.kumamoto.jp":true,"sumoto.kumamoto.jp":true,"takamori.kumamoto.jp":true,"uki.kumamoto.jp":true,"uto.kumamoto.jp":true,"yamaga.kumamoto.jp":true,"yamato.kumamoto.jp":true,"yatsushiro.kumamoto.jp":true,"ayabe.kyoto.jp":true,"fukuchiyama.kyoto.jp":true,"higashiyama.kyoto.jp":true,"ide.kyoto.jp":true,"ine.kyoto.jp":true,"joyo.kyoto.jp":true,"kameoka.kyoto.jp":true,"kamo.kyoto.jp":true,"kita.kyoto.jp":true,"kizu.kyoto.jp":true,"kumiyama.kyoto.jp":true,"kyotamba.kyoto.jp":true,"kyotanabe.kyoto.jp":true,"kyotango.kyoto.jp":true,"maizuru.kyoto.jp":true,"minami.kyoto.jp":true,"minamiyamashiro.kyoto.jp":true,"miyazu.kyoto.jp":true,"muko.kyoto.jp":true,"nagaokakyo.kyoto.jp":true,"nakagyo.kyoto.jp":true,"nantan.kyoto.jp":true,"oyamazaki.kyoto.jp":true,"sakyo.kyoto.jp":true,"seika.kyoto.jp":true,"tanabe.kyoto.jp":true,"uji.kyoto.jp":true,"ujitawara.kyoto.jp":true,"wazuka.kyoto.jp":true,"yamashina.kyoto.jp":true,"yawata.kyoto.jp":true,"asahi.mie.jp":true,"inabe.mie.jp":true,"ise.mie.jp":true,"kameyama.mie.jp":true,"kawagoe.mie.jp":true,"kiho.mie.jp":true,"kisosaki.mie.jp":true,"kiwa.mie.jp":true,"komono.mie.jp":true,"kumano.mie.jp":true,"kuwana.mie.jp":true,"matsusaka.mie.jp":true,"meiwa.mie.jp":true,"mihama.mie.jp":true,"minamiise.mie.jp":true,"misugi.mie.jp":true,"miyama.mie.jp":true,"nabari.mie.jp":true,"shima.mie.jp":true,"suzuka.mie.jp":true,"tado.mie.jp":true,"taiki.mie.jp":true,"taki.mie.jp":true,"tamaki.mie.jp":true,"toba.mie.jp":true,"tsu.mie.jp":true,"udono.mie.jp":true,"ureshino.mie.jp":true,"watarai.mie.jp":true,"yokkaichi.mie.jp":true,"furukawa.miyagi.jp":true,"higashimatsushima.miyagi.jp":true,"ishinomaki.miyagi.jp":true,"iwanuma.miyagi.jp":true,"kakuda.miyagi.jp":true,"kami.miyagi.jp":true,"kawasaki.miyagi.jp":true,"marumori.miyagi.jp":true,"matsushima.miyagi.jp":true,"minamisanriku.miyagi.jp":true,"misato.miyagi.jp":true,"murata.miyagi.jp":true,"natori.miyagi.jp":true,"ogawara.miyagi.jp":true,"ohira.miyagi.jp":true,"onagawa.miyagi.jp":true,"osaki.miyagi.jp":true,"rifu.miyagi.jp":true,"semine.miyagi.jp":true,"shibata.miyagi.jp":true,"shichikashuku.miyagi.jp":true,"shikama.miyagi.jp":true,"shiogama.miyagi.jp":true,"shiroishi.miyagi.jp":true,"tagajo.miyagi.jp":true,"taiwa.miyagi.jp":true,"tome.miyagi.jp":true,"tomiya.miyagi.jp":true,"wakuya.miyagi.jp":true,"watari.miyagi.jp":true,"yamamoto.miyagi.jp":true,"zao.miyagi.jp":true,"aya.miyazaki.jp":true,"ebino.miyazaki.jp":true,"gokase.miyazaki.jp":true,"hyuga.miyazaki.jp":true,"kadogawa.miyazaki.jp":true,"kawaminami.miyazaki.jp":true,"kijo.miyazaki.jp":true,"kitagawa.miyazaki.jp":true,"kitakata.miyazaki.jp":true,"kitaura.miyazaki.jp":true,"kobayashi.miyazaki.jp":true,"kunitomi.miyazaki.jp":true,"kushima.miyazaki.jp":true,"mimata.miyazaki.jp":true,"miyakonojo.miyazaki.jp":true,"miyazaki.miyazaki.jp":true,"morotsuka.miyazaki.jp":true,"nichinan.miyazaki.jp":true,"nishimera.miyazaki.jp":true,"nobeoka.miyazaki.jp":true,"saito.miyazaki.jp":true,"shiiba.miyazaki.jp":true,"shintomi.miyazaki.jp":true,"takaharu.miyazaki.jp":true,"takanabe.miyazaki.jp":true,"takazaki.miyazaki.jp":true,"tsuno.miyazaki.jp":true,"achi.nagano.jp":true,"agematsu.nagano.jp":true,"anan.nagano.jp":true,"aoki.nagano.jp":true,"asahi.nagano.jp":true,"azumino.nagano.jp":true,"chikuhoku.nagano.jp":true,"chikuma.nagano.jp":true,"chino.nagano.jp":true,"fujimi.nagano.jp":true,"hakuba.nagano.jp":true,"hara.nagano.jp":true,"hiraya.nagano.jp":true,"iida.nagano.jp":true,"iijima.nagano.jp":true,"iiyama.nagano.jp":true,"iizuna.nagano.jp":true,"ikeda.nagano.jp":true,"ikusaka.nagano.jp":true,"ina.nagano.jp":true,"karuizawa.nagano.jp":true,"kawakami.nagano.jp":true,"kiso.nagano.jp":true,"kisofukushima.nagano.jp":true,"kitaaiki.nagano.jp":true,"komagane.nagano.jp":true,"komoro.nagano.jp":true,"matsukawa.nagano.jp":true,"matsumoto.nagano.jp":true,"miasa.nagano.jp":true,"minamiaiki.nagano.jp":true,"minamimaki.nagano.jp":true,"minamiminowa.nagano.jp":true,"minowa.nagano.jp":true,"miyada.nagano.jp":true,"miyota.nagano.jp":true,"mochizuki.nagano.jp":true,"nagano.nagano.jp":true,"nagawa.nagano.jp":true,"nagiso.nagano.jp":true,"nakagawa.nagano.jp":true,"nakano.nagano.jp":true,"nozawaonsen.nagano.jp":true,"obuse.nagano.jp":true,"ogawa.nagano.jp":true,"okaya.nagano.jp":true,"omachi.nagano.jp":true,"omi.nagano.jp":true,"ookuwa.nagano.jp":true,"ooshika.nagano.jp":true,"otaki.nagano.jp":true,"otari.nagano.jp":true,"sakae.nagano.jp":true,"sakaki.nagano.jp":true,"saku.nagano.jp":true,"sakuho.nagano.jp":true,"shimosuwa.nagano.jp":true,"shinanomachi.nagano.jp":true,"shiojiri.nagano.jp":true,"suwa.nagano.jp":true,"suzaka.nagano.jp":true,"takagi.nagano.jp":true,"takamori.nagano.jp":true,"takayama.nagano.jp":true,"tateshina.nagano.jp":true,"tatsuno.nagano.jp":true,"togakushi.nagano.jp":true,"togura.nagano.jp":true,"tomi.nagano.jp":true,"ueda.nagano.jp":true,"wada.nagano.jp":true,"yamagata.nagano.jp":true,"yamanouchi.nagano.jp":true,"yasaka.nagano.jp":true,"yasuoka.nagano.jp":true,"chijiwa.nagasaki.jp":true,"futsu.nagasaki.jp":true,"goto.nagasaki.jp":true,"hasami.nagasaki.jp":true,"hirado.nagasaki.jp":true,"iki.nagasaki.jp":true,"isahaya.nagasaki.jp":true,"kawatana.nagasaki.jp":true,"kuchinotsu.nagasaki.jp":true,"matsuura.nagasaki.jp":true,"nagasaki.nagasaki.jp":true,"obama.nagasaki.jp":true,"omura.nagasaki.jp":true,"oseto.nagasaki.jp":true,"saikai.nagasaki.jp":true,"sasebo.nagasaki.jp":true,"seihi.nagasaki.jp":true,"shimabara.nagasaki.jp":true,"shinkamigoto.nagasaki.jp":true,"togitsu.nagasaki.jp":true,"tsushima.nagasaki.jp":true,"unzen.nagasaki.jp":true,"ando.nara.jp":true,"gose.nara.jp":true,"heguri.nara.jp":true,"higashiyoshino.nara.jp":true,"ikaruga.nara.jp":true,"ikoma.nara.jp":true,"kamikitayama.nara.jp":true,"kanmaki.nara.jp":true,"kashiba.nara.jp":true,"kashihara.nara.jp":true,"katsuragi.nara.jp":true,"kawai.nara.jp":true,"kawakami.nara.jp":true,"kawanishi.nara.jp":true,"koryo.nara.jp":true,"kurotaki.nara.jp":true,"mitsue.nara.jp":true,"miyake.nara.jp":true,"nara.nara.jp":true,"nosegawa.nara.jp":true,"oji.nara.jp":true,"ouda.nara.jp":true,"oyodo.nara.jp":true,"sakurai.nara.jp":true,"sango.nara.jp":true,"shimoichi.nara.jp":true,"shimokitayama.nara.jp":true,"shinjo.nara.jp":true,"soni.nara.jp":true,"takatori.nara.jp":true,"tawaramoto.nara.jp":true,"tenkawa.nara.jp":true,"tenri.nara.jp":true,"uda.nara.jp":true,"yamatokoriyama.nara.jp":true,"yamatotakada.nara.jp":true,"yamazoe.nara.jp":true,"yoshino.nara.jp":true,"aga.niigata.jp":true,"agano.niigata.jp":true,"gosen.niigata.jp":true,"itoigawa.niigata.jp":true,"izumozaki.niigata.jp":true,"joetsu.niigata.jp":true,"kamo.niigata.jp":true,"kariwa.niigata.jp":true,"kashiwazaki.niigata.jp":true,"minamiuonuma.niigata.jp":true,"mitsuke.niigata.jp":true,"muika.niigata.jp":true,"murakami.niigata.jp":true,"myoko.niigata.jp":true,"nagaoka.niigata.jp":true,"niigata.niigata.jp":true,"ojiya.niigata.jp":true,"omi.niigata.jp":true,"sado.niigata.jp":true,"sanjo.niigata.jp":true,"seiro.niigata.jp":true,"seirou.niigata.jp":true,"sekikawa.niigata.jp":true,"shibata.niigata.jp":true,"tagami.niigata.jp":true,"tainai.niigata.jp":true,"tochio.niigata.jp":true,"tokamachi.niigata.jp":true,"tsubame.niigata.jp":true,"tsunan.niigata.jp":true,"uonuma.niigata.jp":true,"yahiko.niigata.jp":true,"yoita.niigata.jp":true,"yuzawa.niigata.jp":true,"beppu.oita.jp":true,"bungoono.oita.jp":true,"bungotakada.oita.jp":true,"hasama.oita.jp":true,"hiji.oita.jp":true,"himeshima.oita.jp":true,"hita.oita.jp":true,"kamitsue.oita.jp":true,"kokonoe.oita.jp":true,"kuju.oita.jp":true,"kunisaki.oita.jp":true,"kusu.oita.jp":true,"oita.oita.jp":true,"saiki.oita.jp":true,"taketa.oita.jp":true,"tsukumi.oita.jp":true,"usa.oita.jp":true,"usuki.oita.jp":true,"yufu.oita.jp":true,"akaiwa.okayama.jp":true,"asakuchi.okayama.jp":true,"bizen.okayama.jp":true,"hayashima.okayama.jp":true,"ibara.okayama.jp":true,"kagamino.okayama.jp":true,"kasaoka.okayama.jp":true,"kibichuo.okayama.jp":true,"kumenan.okayama.jp":true,"kurashiki.okayama.jp":true,"maniwa.okayama.jp":true,"misaki.okayama.jp":true,"nagi.okayama.jp":true,"niimi.okayama.jp":true,"nishiawakura.okayama.jp":true,"okayama.okayama.jp":true,"satosho.okayama.jp":true,"setouchi.okayama.jp":true,"shinjo.okayama.jp":true,"shoo.okayama.jp":true,"soja.okayama.jp":true,"takahashi.okayama.jp":true,"tamano.okayama.jp":true,"tsuyama.okayama.jp":true,"wake.okayama.jp":true,"yakage.okayama.jp":true,"aguni.okinawa.jp":true,"ginowan.okinawa.jp":true,"ginoza.okinawa.jp":true,"gushikami.okinawa.jp":true,"haebaru.okinawa.jp":true,"higashi.okinawa.jp":true,"hirara.okinawa.jp":true,"iheya.okinawa.jp":true,"ishigaki.okinawa.jp":true,"ishikawa.okinawa.jp":true,"itoman.okinawa.jp":true,"izena.okinawa.jp":true,"kadena.okinawa.jp":true,"kin.okinawa.jp":true,"kitadaito.okinawa.jp":true,"kitanakagusuku.okinawa.jp":true,"kumejima.okinawa.jp":true,"kunigami.okinawa.jp":true,"minamidaito.okinawa.jp":true,"motobu.okinawa.jp":true,"nago.okinawa.jp":true,"naha.okinawa.jp":true,"nakagusuku.okinawa.jp":true,"nakijin.okinawa.jp":true,"nanjo.okinawa.jp":true,"nishihara.okinawa.jp":true,"ogimi.okinawa.jp":true,"okinawa.okinawa.jp":true,"onna.okinawa.jp":true,"shimoji.okinawa.jp":true,"taketomi.okinawa.jp":true,"tarama.okinawa.jp":true,"tokashiki.okinawa.jp":true,"tomigusuku.okinawa.jp":true,"tonaki.okinawa.jp":true,"urasoe.okinawa.jp":true,"uruma.okinawa.jp":true,"yaese.okinawa.jp":true,"yomitan.okinawa.jp":true,"yonabaru.okinawa.jp":true,"yonaguni.okinawa.jp":true,"zamami.okinawa.jp":true,"abeno.osaka.jp":true,"chihayaakasaka.osaka.jp":true,"chuo.osaka.jp":true,"daito.osaka.jp":true,"fujiidera.osaka.jp":true,"habikino.osaka.jp":true,"hannan.osaka.jp":true,"higashiosaka.osaka.jp":true,"higashisumiyoshi.osaka.jp":true,"higashiyodogawa.osaka.jp":true,"hirakata.osaka.jp":true,"ibaraki.osaka.jp":true,"ikeda.osaka.jp":true,"izumi.osaka.jp":true,"izumiotsu.osaka.jp":true,"izumisano.osaka.jp":true,"kadoma.osaka.jp":true,"kaizuka.osaka.jp":true,"kanan.osaka.jp":true,"kashiwara.osaka.jp":true,"katano.osaka.jp":true,"kawachinagano.osaka.jp":true,"kishiwada.osaka.jp":true,"kita.osaka.jp":true,"kumatori.osaka.jp":true,"matsubara.osaka.jp":true,"minato.osaka.jp":true,"minoh.osaka.jp":true,"misaki.osaka.jp":true,"moriguchi.osaka.jp":true,"neyagawa.osaka.jp":true,"nishi.osaka.jp":true,"nose.osaka.jp":true,"osakasayama.osaka.jp":true,"sakai.osaka.jp":true,"sayama.osaka.jp":true,"sennan.osaka.jp":true,"settsu.osaka.jp":true,"shijonawate.osaka.jp":true,"shimamoto.osaka.jp":true,"suita.osaka.jp":true,"tadaoka.osaka.jp":true,"taishi.osaka.jp":true,"tajiri.osaka.jp":true,"takaishi.osaka.jp":true,"takatsuki.osaka.jp":true,"tondabayashi.osaka.jp":true,"toyonaka.osaka.jp":true,"toyono.osaka.jp":true,"yao.osaka.jp":true,"ariake.saga.jp":true,"arita.saga.jp":true,"fukudomi.saga.jp":true,"genkai.saga.jp":true,"hamatama.saga.jp":true,"hizen.saga.jp":true,"imari.saga.jp":true,"kamimine.saga.jp":true,"kanzaki.saga.jp":true,"karatsu.saga.jp":true,"kashima.saga.jp":true,"kitagata.saga.jp":true,"kitahata.saga.jp":true,"kiyama.saga.jp":true,"kouhoku.saga.jp":true,"kyuragi.saga.jp":true,"nishiarita.saga.jp":true,"ogi.saga.jp":true,"omachi.saga.jp":true,"ouchi.saga.jp":true,"saga.saga.jp":true,"shiroishi.saga.jp":true,"taku.saga.jp":true,"tara.saga.jp":true,"tosu.saga.jp":true,"yoshinogari.saga.jp":true,"arakawa.saitama.jp":true,"asaka.saitama.jp":true,"chichibu.saitama.jp":true,"fujimi.saitama.jp":true,"fujimino.saitama.jp":true,"fukaya.saitama.jp":true,"hanno.saitama.jp":true,"hanyu.saitama.jp":true,"hasuda.saitama.jp":true,"hatogaya.saitama.jp":true,"hatoyama.saitama.jp":true,"hidaka.saitama.jp":true,"higashichichibu.saitama.jp":true,"higashimatsuyama.saitama.jp":true,"honjo.saitama.jp":true,"ina.saitama.jp":true,"iruma.saitama.jp":true,"iwatsuki.saitama.jp":true,"kamiizumi.saitama.jp":true,"kamikawa.saitama.jp":true,"kamisato.saitama.jp":true,"kasukabe.saitama.jp":true,"kawagoe.saitama.jp":true,"kawaguchi.saitama.jp":true,"kawajima.saitama.jp":true,"kazo.saitama.jp":true,"kitamoto.saitama.jp":true,"koshigaya.saitama.jp":true,"kounosu.saitama.jp":true,"kuki.saitama.jp":true,"kumagaya.saitama.jp":true,"matsubushi.saitama.jp":true,"minano.saitama.jp":true,"misato.saitama.jp":true,"miyashiro.saitama.jp":true,"miyoshi.saitama.jp":true,"moroyama.saitama.jp":true,"nagatoro.saitama.jp":true,"namegawa.saitama.jp":true,"niiza.saitama.jp":true,"ogano.saitama.jp":true,"ogawa.saitama.jp":true,"ogose.saitama.jp":true,"okegawa.saitama.jp":true,"omiya.saitama.jp":true,"otaki.saitama.jp":true,"ranzan.saitama.jp":true,"ryokami.saitama.jp":true,"saitama.saitama.jp":true,"sakado.saitama.jp":true,"satte.saitama.jp":true,"sayama.saitama.jp":true,"shiki.saitama.jp":true,"shiraoka.saitama.jp":true,"soka.saitama.jp":true,"sugito.saitama.jp":true,"toda.saitama.jp":true,"tokigawa.saitama.jp":true,"tokorozawa.saitama.jp":true,"tsurugashima.saitama.jp":true,"urawa.saitama.jp":true,"warabi.saitama.jp":true,"yashio.saitama.jp":true,"yokoze.saitama.jp":true,"yono.saitama.jp":true,"yorii.saitama.jp":true,"yoshida.saitama.jp":true,"yoshikawa.saitama.jp":true,"yoshimi.saitama.jp":true,"aisho.shiga.jp":true,"gamo.shiga.jp":true,"higashiomi.shiga.jp":true,"hikone.shiga.jp":true,"koka.shiga.jp":true,"konan.shiga.jp":true,"kosei.shiga.jp":true,"koto.shiga.jp":true,"kusatsu.shiga.jp":true,"maibara.shiga.jp":true,"moriyama.shiga.jp":true,"nagahama.shiga.jp":true,"nishiazai.shiga.jp":true,"notogawa.shiga.jp":true,"omihachiman.shiga.jp":true,"otsu.shiga.jp":true,"ritto.shiga.jp":true,"ryuoh.shiga.jp":true,"takashima.shiga.jp":true,"takatsuki.shiga.jp":true,"torahime.shiga.jp":true,"toyosato.shiga.jp":true,"yasu.shiga.jp":true,"akagi.shimane.jp":true,"ama.shimane.jp":true,"gotsu.shimane.jp":true,"hamada.shimane.jp":true,"higashiizumo.shimane.jp":true,"hikawa.shimane.jp":true,"hikimi.shimane.jp":true,"izumo.shimane.jp":true,"kakinoki.shimane.jp":true,"masuda.shimane.jp":true,"matsue.shimane.jp":true,"misato.shimane.jp":true,"nishinoshima.shimane.jp":true,"ohda.shimane.jp":true,"okinoshima.shimane.jp":true,"okuizumo.shimane.jp":true,"shimane.shimane.jp":true,"tamayu.shimane.jp":true,"tsuwano.shimane.jp":true,"unnan.shimane.jp":true,"yakumo.shimane.jp":true,"yasugi.shimane.jp":true,"yatsuka.shimane.jp":true,"arai.shizuoka.jp":true,"atami.shizuoka.jp":true,"fuji.shizuoka.jp":true,"fujieda.shizuoka.jp":true,"fujikawa.shizuoka.jp":true,"fujinomiya.shizuoka.jp":true,"fukuroi.shizuoka.jp":true,"gotemba.shizuoka.jp":true,"haibara.shizuoka.jp":true,"hamamatsu.shizuoka.jp":true,"higashiizu.shizuoka.jp":true,"ito.shizuoka.jp":true,"iwata.shizuoka.jp":true,"izu.shizuoka.jp":true,"izunokuni.shizuoka.jp":true,"kakegawa.shizuoka.jp":true,"kannami.shizuoka.jp":true,"kawanehon.shizuoka.jp":true,"kawazu.shizuoka.jp":true,"kikugawa.shizuoka.jp":true,"kosai.shizuoka.jp":true,"makinohara.shizuoka.jp":true,"matsuzaki.shizuoka.jp":true,"minamiizu.shizuoka.jp":true,"mishima.shizuoka.jp":true,"morimachi.shizuoka.jp":true,"nishiizu.shizuoka.jp":true,"numazu.shizuoka.jp":true,"omaezaki.shizuoka.jp":true,"shimada.shizuoka.jp":true,"shimizu.shizuoka.jp":true,"shimoda.shizuoka.jp":true,"shizuoka.shizuoka.jp":true,"susono.shizuoka.jp":true,"yaizu.shizuoka.jp":true,"yoshida.shizuoka.jp":true,"ashikaga.tochigi.jp":true,"bato.tochigi.jp":true,"haga.tochigi.jp":true,"ichikai.tochigi.jp":true,"iwafune.tochigi.jp":true,"kaminokawa.tochigi.jp":true,"kanuma.tochigi.jp":true,"karasuyama.tochigi.jp":true,"kuroiso.tochigi.jp":true,"mashiko.tochigi.jp":true,"mibu.tochigi.jp":true,"moka.tochigi.jp":true,"motegi.tochigi.jp":true,"nasu.tochigi.jp":true,"nasushiobara.tochigi.jp":true,"nikko.tochigi.jp":true,"nishikata.tochigi.jp":true,"nogi.tochigi.jp":true,"ohira.tochigi.jp":true,"ohtawara.tochigi.jp":true,"oyama.tochigi.jp":true,"sakura.tochigi.jp":true,"sano.tochigi.jp":true,"shimotsuke.tochigi.jp":true,"shioya.tochigi.jp":true,"takanezawa.tochigi.jp":true,"tochigi.tochigi.jp":true,"tsuga.tochigi.jp":true,"ujiie.tochigi.jp":true,"utsunomiya.tochigi.jp":true,"yaita.tochigi.jp":true,"aizumi.tokushima.jp":true,"anan.tokushima.jp":true,"ichiba.tokushima.jp":true,"itano.tokushima.jp":true,"kainan.tokushima.jp":true,"komatsushima.tokushima.jp":true,"matsushige.tokushima.jp":true,"mima.tokushima.jp":true,"minami.tokushima.jp":true,"miyoshi.tokushima.jp":true,"mugi.tokushima.jp":true,"nakagawa.tokushima.jp":true,"naruto.tokushima.jp":true,"sanagochi.tokushima.jp":true,"shishikui.tokushima.jp":true,"tokushima.tokushima.jp":true,"wajiki.tokushima.jp":true,"adachi.tokyo.jp":true,"akiruno.tokyo.jp":true,"akishima.tokyo.jp":true,"aogashima.tokyo.jp":true,"arakawa.tokyo.jp":true,"bunkyo.tokyo.jp":true,"chiyoda.tokyo.jp":true,"chofu.tokyo.jp":true,"chuo.tokyo.jp":true,"edogawa.tokyo.jp":true,"fuchu.tokyo.jp":true,"fussa.tokyo.jp":true,"hachijo.tokyo.jp":true,"hachioji.tokyo.jp":true,"hamura.tokyo.jp":true,"higashikurume.tokyo.jp":true,"higashimurayama.tokyo.jp":true,"higashiyamato.tokyo.jp":true,"hino.tokyo.jp":true,"hinode.tokyo.jp":true,"hinohara.tokyo.jp":true,"inagi.tokyo.jp":true,"itabashi.tokyo.jp":true,"katsushika.tokyo.jp":true,"kita.tokyo.jp":true,"kiyose.tokyo.jp":true,"kodaira.tokyo.jp":true,"koganei.tokyo.jp":true,"kokubunji.tokyo.jp":true,"komae.tokyo.jp":true,"koto.tokyo.jp":true,"kouzushima.tokyo.jp":true,"kunitachi.tokyo.jp":true,"machida.tokyo.jp":true,"meguro.tokyo.jp":true,"minato.tokyo.jp":true,"mitaka.tokyo.jp":true,"mizuho.tokyo.jp":true,"musashimurayama.tokyo.jp":true,"musashino.tokyo.jp":true,"nakano.tokyo.jp":true,"nerima.tokyo.jp":true,"ogasawara.tokyo.jp":true,"okutama.tokyo.jp":true,"ome.tokyo.jp":true,"oshima.tokyo.jp":true,"ota.tokyo.jp":true,"setagaya.tokyo.jp":true,"shibuya.tokyo.jp":true,"shinagawa.tokyo.jp":true,"shinjuku.tokyo.jp":true,"suginami.tokyo.jp":true,"sumida.tokyo.jp":true,"tachikawa.tokyo.jp":true,"taito.tokyo.jp":true,"tama.tokyo.jp":true,"toshima.tokyo.jp":true,"chizu.tottori.jp":true,"hino.tottori.jp":true,"kawahara.tottori.jp":true,"koge.tottori.jp":true,"kotoura.tottori.jp":true,"misasa.tottori.jp":true,"nanbu.tottori.jp":true,"nichinan.tottori.jp":true,"sakaiminato.tottori.jp":true,"tottori.tottori.jp":true,"wakasa.tottori.jp":true,"yazu.tottori.jp":true,"yonago.tottori.jp":true,"asahi.toyama.jp":true,"fuchu.toyama.jp":true,"fukumitsu.toyama.jp":true,"funahashi.toyama.jp":true,"himi.toyama.jp":true,"imizu.toyama.jp":true,"inami.toyama.jp":true,"johana.toyama.jp":true,"kamiichi.toyama.jp":true,"kurobe.toyama.jp":true,"nakaniikawa.toyama.jp":true,"namerikawa.toyama.jp":true,"nanto.toyama.jp":true,"nyuzen.toyama.jp":true,"oyabe.toyama.jp":true,"taira.toyama.jp":true,"takaoka.toyama.jp":true,"tateyama.toyama.jp":true,"toga.toyama.jp":true,"tonami.toyama.jp":true,"toyama.toyama.jp":true,"unazuki.toyama.jp":true,"uozu.toyama.jp":true,"yamada.toyama.jp":true,"arida.wakayama.jp":true,"aridagawa.wakayama.jp":true,"gobo.wakayama.jp":true,"hashimoto.wakayama.jp":true,"hidaka.wakayama.jp":true,"hirogawa.wakayama.jp":true,"inami.wakayama.jp":true,"iwade.wakayama.jp":true,"kainan.wakayama.jp":true,"kamitonda.wakayama.jp":true,"katsuragi.wakayama.jp":true,"kimino.wakayama.jp":true,"kinokawa.wakayama.jp":true,"kitayama.wakayama.jp":true,"koya.wakayama.jp":true,"koza.wakayama.jp":true,"kozagawa.wakayama.jp":true,"kudoyama.wakayama.jp":true,"kushimoto.wakayama.jp":true,"mihama.wakayama.jp":true,"misato.wakayama.jp":true,"nachikatsuura.wakayama.jp":true,"shingu.wakayama.jp":true,"shirahama.wakayama.jp":true,"taiji.wakayama.jp":true,"tanabe.wakayama.jp":true,"wakayama.wakayama.jp":true,"yuasa.wakayama.jp":true,"yura.wakayama.jp":true,"asahi.yamagata.jp":true,"funagata.yamagata.jp":true,"higashine.yamagata.jp":true,"iide.yamagata.jp":true,"kahoku.yamagata.jp":true,"kaminoyama.yamagata.jp":true,"kaneyama.yamagata.jp":true,"kawanishi.yamagata.jp":true,"mamurogawa.yamagata.jp":true,"mikawa.yamagata.jp":true,"murayama.yamagata.jp":true,"nagai.yamagata.jp":true,"nakayama.yamagata.jp":true,"nanyo.yamagata.jp":true,"nishikawa.yamagata.jp":true,"obanazawa.yamagata.jp":true,"oe.yamagata.jp":true,"oguni.yamagata.jp":true,"ohkura.yamagata.jp":true,"oishida.yamagata.jp":true,"sagae.yamagata.jp":true,"sakata.yamagata.jp":true,"sakegawa.yamagata.jp":true,"shinjo.yamagata.jp":true,"shirataka.yamagata.jp":true,"shonai.yamagata.jp":true,"takahata.yamagata.jp":true,"tendo.yamagata.jp":true,"tozawa.yamagata.jp":true,"tsuruoka.yamagata.jp":true,"yamagata.yamagata.jp":true,"yamanobe.yamagata.jp":true,"yonezawa.yamagata.jp":true,"yuza.yamagata.jp":true,"abu.yamaguchi.jp":true,"hagi.yamaguchi.jp":true,"hikari.yamaguchi.jp":true,"hofu.yamaguchi.jp":true,"iwakuni.yamaguchi.jp":true,"kudamatsu.yamaguchi.jp":true,"mitou.yamaguchi.jp":true,"nagato.yamaguchi.jp":true,"oshima.yamaguchi.jp":true,"shimonoseki.yamaguchi.jp":true,"shunan.yamaguchi.jp":true,"tabuse.yamaguchi.jp":true,"tokuyama.yamaguchi.jp":true,"toyota.yamaguchi.jp":true,"ube.yamaguchi.jp":true,"yuu.yamaguchi.jp":true,"chuo.yamanashi.jp":true,"doshi.yamanashi.jp":true,"fuefuki.yamanashi.jp":true,"fujikawa.yamanashi.jp":true,"fujikawaguchiko.yamanashi.jp":true,"fujiyoshida.yamanashi.jp":true,"hayakawa.yamanashi.jp":true,"hokuto.yamanashi.jp":true,"ichikawamisato.yamanashi.jp":true,"kai.yamanashi.jp":true,"kofu.yamanashi.jp":true,"koshu.yamanashi.jp":true,"kosuge.yamanashi.jp":true,"minami-alps.yamanashi.jp":true,"minobu.yamanashi.jp":true,"nakamichi.yamanashi.jp":true,"nanbu.yamanashi.jp":true,"narusawa.yamanashi.jp":true,"nirasaki.yamanashi.jp":true,"nishikatsura.yamanashi.jp":true,"oshino.yamanashi.jp":true,"otsuki.yamanashi.jp":true,"showa.yamanashi.jp":true,"tabayama.yamanashi.jp":true,"tsuru.yamanashi.jp":true,"uenohara.yamanashi.jp":true,"yamanakako.yamanashi.jp":true,"yamanashi.yamanashi.jp":true,"ke":true,"ac.ke":true,"co.ke":true,"go.ke":true,"info.ke":true,"me.ke":true,"mobi.ke":true,"ne.ke":true,"or.ke":true,"sc.ke":true,"kg":true,"org.kg":true,"net.kg":true,"com.kg":true,"edu.kg":true,"gov.kg":true,"mil.kg":true,"*.kh":true,"ki":true,"edu.ki":true,"biz.ki":true,"net.ki":true,"org.ki":true,"gov.ki":true,"info.ki":true,"com.ki":true,"km":true,"org.km":true,"nom.km":true,"gov.km":true,"prd.km":true,"tm.km":true,"edu.km":true,"mil.km":true,"ass.km":true,"com.km":true,"coop.km":true,"asso.km":true,"presse.km":true,"medecin.km":true,"notaires.km":true,"pharmaciens.km":true,"veterinaire.km":true,"gouv.km":true,"kn":true,"net.kn":true,"org.kn":true,"edu.kn":true,"gov.kn":true,"kp":true,"com.kp":true,"edu.kp":true,"gov.kp":true,"org.kp":true,"rep.kp":true,"tra.kp":true,"kr":true,"ac.kr":true,"co.kr":true,"es.kr":true,"go.kr":true,"hs.kr":true,"kg.kr":true,"mil.kr":true,"ms.kr":true,"ne.kr":true,"or.kr":true,"pe.kr":true,"re.kr":true,"sc.kr":true,"busan.kr":true,"chungbuk.kr":true,"chungnam.kr":true,"daegu.kr":true,"daejeon.kr":true,"gangwon.kr":true,"gwangju.kr":true,"gyeongbuk.kr":true,"gyeonggi.kr":true,"gyeongnam.kr":true,"incheon.kr":true,"jeju.kr":true,"jeonbuk.kr":true,"jeonnam.kr":true,"seoul.kr":true,"ulsan.kr":true,"*.kw":true,"ky":true,"edu.ky":true,"gov.ky":true,"com.ky":true,"org.ky":true,"net.ky":true,"kz":true,"org.kz":true,"edu.kz":true,"net.kz":true,"gov.kz":true,"mil.kz":true,"com.kz":true,"la":true,"int.la":true,"net.la":true,"info.la":true,"edu.la":true,"gov.la":true,"per.la":true,"com.la":true,"org.la":true,"lb":true,"com.lb":true,"edu.lb":true,"gov.lb":true,"net.lb":true,"org.lb":true,"lc":true,"com.lc":true,"net.lc":true,"co.lc":true,"org.lc":true,"edu.lc":true,"gov.lc":true,"li":true,"lk":true,"gov.lk":true,"sch.lk":true,"net.lk":true,"int.lk":true,"com.lk":true,"org.lk":true,"edu.lk":true,"ngo.lk":true,"soc.lk":true,"web.lk":true,"ltd.lk":true,"assn.lk":true,"grp.lk":true,"hotel.lk":true,"ac.lk":true,"lr":true,"com.lr":true,"edu.lr":true,"gov.lr":true,"org.lr":true,"net.lr":true,"ls":true,"co.ls":true,"org.ls":true,"lt":true,"gov.lt":true,"lu":true,"lv":true,"com.lv":true,"edu.lv":true,"gov.lv":true,"org.lv":true,"mil.lv":true,"id.lv":true,"net.lv":true,"asn.lv":true,"conf.lv":true,"ly":true,"com.ly":true,"net.ly":true,"gov.ly":true,"plc.ly":true,"edu.ly":true,"sch.ly":true,"med.ly":true,"org.ly":true,"id.ly":true,"ma":true,"co.ma":true,"net.ma":true,"gov.ma":true,"org.ma":true,"ac.ma":true,"press.ma":true,"mc":true,"tm.mc":true,"asso.mc":true,"md":true,"me":true,"co.me":true,"net.me":true,"org.me":true,"edu.me":true,"ac.me":true,"gov.me":true,"its.me":true,"priv.me":true,"mg":true,"org.mg":true,"nom.mg":true,"gov.mg":true,"prd.mg":true,"tm.mg":true,"edu.mg":true,"mil.mg":true,"com.mg":true,"co.mg":true,"mh":true,"mil":true,"mk":true,"com.mk":true,"org.mk":true,"net.mk":true,"edu.mk":true,"gov.mk":true,"inf.mk":true,"name.mk":true,"ml":true,"com.ml":true,"edu.ml":true,"gouv.ml":true,"gov.ml":true,"net.ml":true,"org.ml":true,"presse.ml":true,"*.mm":true,"mn":true,"gov.mn":true,"edu.mn":true,"org.mn":true,"mo":true,"com.mo":true,"net.mo":true,"org.mo":true,"edu.mo":true,"gov.mo":true,"mobi":true,"mp":true,"mq":true,"mr":true,"gov.mr":true,"ms":true,"com.ms":true,"edu.ms":true,"gov.ms":true,"net.ms":true,"org.ms":true,"mt":true,"com.mt":true,"edu.mt":true,"net.mt":true,"org.mt":true,"mu":true,"com.mu":true,"net.mu":true,"org.mu":true,"gov.mu":true,"ac.mu":true,"co.mu":true,"or.mu":true,"museum":true,"academy.museum":true,"agriculture.museum":true,"air.museum":true,"airguard.museum":true,"alabama.museum":true,"alaska.museum":true,"amber.museum":true,"ambulance.museum":true,"american.museum":true,"americana.museum":true,"americanantiques.museum":true,"americanart.museum":true,"amsterdam.museum":true,"and.museum":true,"annefrank.museum":true,"anthro.museum":true,"anthropology.museum":true,"antiques.museum":true,"aquarium.museum":true,"arboretum.museum":true,"archaeological.museum":true,"archaeology.museum":true,"architecture.museum":true,"art.museum":true,"artanddesign.museum":true,"artcenter.museum":true,"artdeco.museum":true,"arteducation.museum":true,"artgallery.museum":true,"arts.museum":true,"artsandcrafts.museum":true,"asmatart.museum":true,"assassination.museum":true,"assisi.museum":true,"association.museum":true,"astronomy.museum":true,"atlanta.museum":true,"austin.museum":true,"australia.museum":true,"automotive.museum":true,"aviation.museum":true,"axis.museum":true,"badajoz.museum":true,"baghdad.museum":true,"bahn.museum":true,"bale.museum":true,"baltimore.museum":true,"barcelona.museum":true,"baseball.museum":true,"basel.museum":true,"baths.museum":true,"bauern.museum":true,"beauxarts.museum":true,"beeldengeluid.museum":true,"bellevue.museum":true,"bergbau.museum":true,"berkeley.museum":true,"berlin.museum":true,"bern.museum":true,"bible.museum":true,"bilbao.museum":true,"bill.museum":true,"birdart.museum":true,"birthplace.museum":true,"bonn.museum":true,"boston.museum":true,"botanical.museum":true,"botanicalgarden.museum":true,"botanicgarden.museum":true,"botany.museum":true,"brandywinevalley.museum":true,"brasil.museum":true,"bristol.museum":true,"british.museum":true,"britishcolumbia.museum":true,"broadcast.museum":true,"brunel.museum":true,"brussel.museum":true,"brussels.museum":true,"bruxelles.museum":true,"building.museum":true,"burghof.museum":true,"bus.museum":true,"bushey.museum":true,"cadaques.museum":true,"california.museum":true,"cambridge.museum":true,"can.museum":true,"canada.museum":true,"capebreton.museum":true,"carrier.museum":true,"cartoonart.museum":true,"casadelamoneda.museum":true,"castle.museum":true,"castres.museum":true,"celtic.museum":true,"center.museum":true,"chattanooga.museum":true,"cheltenham.museum":true,"chesapeakebay.museum":true,"chicago.museum":true,"children.museum":true,"childrens.museum":true,"childrensgarden.museum":true,"chiropractic.museum":true,"chocolate.museum":true,"christiansburg.museum":true,"cincinnati.museum":true,"cinema.museum":true,"circus.museum":true,"civilisation.museum":true,"civilization.museum":true,"civilwar.museum":true,"clinton.museum":true,"clock.museum":true,"coal.museum":true,"coastaldefence.museum":true,"cody.museum":true,"coldwar.museum":true,"collection.museum":true,"colonialwilliamsburg.museum":true,"coloradoplateau.museum":true,"columbia.museum":true,"columbus.museum":true,"communication.museum":true,"communications.museum":true,"community.museum":true,"computer.museum":true,"computerhistory.museum":true,"xn--comunicaes-v6a2o.museum":true,"contemporary.museum":true,"contemporaryart.museum":true,"convent.museum":true,"copenhagen.museum":true,"corporation.museum":true,"xn--correios-e-telecomunicaes-ghc29a.museum":true,"corvette.museum":true,"costume.museum":true,"countryestate.museum":true,"county.museum":true,"crafts.museum":true,"cranbrook.museum":true,"creation.museum":true,"cultural.museum":true,"culturalcenter.museum":true,"culture.museum":true,"cyber.museum":true,"cymru.museum":true,"dali.museum":true,"dallas.museum":true,"database.museum":true,"ddr.museum":true,"decorativearts.museum":true,"delaware.museum":true,"delmenhorst.museum":true,"denmark.museum":true,"depot.museum":true,"design.museum":true,"detroit.museum":true,"dinosaur.museum":true,"discovery.museum":true,"dolls.museum":true,"donostia.museum":true,"durham.museum":true,"eastafrica.museum":true,"eastcoast.museum":true,"education.museum":true,"educational.museum":true,"egyptian.museum":true,"eisenbahn.museum":true,"elburg.museum":true,"elvendrell.museum":true,"embroidery.museum":true,"encyclopedic.museum":true,"england.museum":true,"entomology.museum":true,"environment.museum":true,"environmentalconservation.museum":true,"epilepsy.museum":true,"essex.museum":true,"estate.museum":true,"ethnology.museum":true,"exeter.museum":true,"exhibition.museum":true,"family.museum":true,"farm.museum":true,"farmequipment.museum":true,"farmers.museum":true,"farmstead.museum":true,"field.museum":true,"figueres.museum":true,"filatelia.museum":true,"film.museum":true,"fineart.museum":true,"finearts.museum":true,"finland.museum":true,"flanders.museum":true,"florida.museum":true,"force.museum":true,"fortmissoula.museum":true,"fortworth.museum":true,"foundation.museum":true,"francaise.museum":true,"frankfurt.museum":true,"franziskaner.museum":true,"freemasonry.museum":true,"freiburg.museum":true,"fribourg.museum":true,"frog.museum":true,"fundacio.museum":true,"furniture.museum":true,"gallery.museum":true,"garden.museum":true,"gateway.museum":true,"geelvinck.museum":true,"gemological.museum":true,"geology.museum":true,"georgia.museum":true,"giessen.museum":true,"glas.museum":true,"glass.museum":true,"gorge.museum":true,"grandrapids.museum":true,"graz.museum":true,"guernsey.museum":true,"halloffame.museum":true,"hamburg.museum":true,"handson.museum":true,"harvestcelebration.museum":true,"hawaii.museum":true,"health.museum":true,"heimatunduhren.museum":true,"hellas.museum":true,"helsinki.museum":true,"hembygdsforbund.museum":true,"heritage.museum":true,"histoire.museum":true,"historical.museum":true,"historicalsociety.museum":true,"historichouses.museum":true,"historisch.museum":true,"historisches.museum":true,"history.museum":true,"historyofscience.museum":true,"horology.museum":true,"house.museum":true,"humanities.museum":true,"illustration.museum":true,"imageandsound.museum":true,"indian.museum":true,"indiana.museum":true,"indianapolis.museum":true,"indianmarket.museum":true,"intelligence.museum":true,"interactive.museum":true,"iraq.museum":true,"iron.museum":true,"isleofman.museum":true,"jamison.museum":true,"jefferson.museum":true,"jerusalem.museum":true,"jewelry.museum":true,"jewish.museum":true,"jewishart.museum":true,"jfk.museum":true,"journalism.museum":true,"judaica.museum":true,"judygarland.museum":true,"juedisches.museum":true,"juif.museum":true,"karate.museum":true,"karikatur.museum":true,"kids.museum":true,"koebenhavn.museum":true,"koeln.museum":true,"kunst.museum":true,"kunstsammlung.museum":true,"kunstunddesign.museum":true,"labor.museum":true,"labour.museum":true,"lajolla.museum":true,"lancashire.museum":true,"landes.museum":true,"lans.museum":true,"xn--lns-qla.museum":true,"larsson.museum":true,"lewismiller.museum":true,"lincoln.museum":true,"linz.museum":true,"living.museum":true,"livinghistory.museum":true,"localhistory.museum":true,"london.museum":true,"losangeles.museum":true,"louvre.museum":true,"loyalist.museum":true,"lucerne.museum":true,"luxembourg.museum":true,"luzern.museum":true,"mad.museum":true,"madrid.museum":true,"mallorca.museum":true,"manchester.museum":true,"mansion.museum":true,"mansions.museum":true,"manx.museum":true,"marburg.museum":true,"maritime.museum":true,"maritimo.museum":true,"maryland.museum":true,"marylhurst.museum":true,"media.museum":true,"medical.museum":true,"medizinhistorisches.museum":true,"meeres.museum":true,"memorial.museum":true,"mesaverde.museum":true,"michigan.museum":true,"midatlantic.museum":true,"military.museum":true,"mill.museum":true,"miners.museum":true,"mining.museum":true,"minnesota.museum":true,"missile.museum":true,"missoula.museum":true,"modern.museum":true,"moma.museum":true,"money.museum":true,"monmouth.museum":true,"monticello.museum":true,"montreal.museum":true,"moscow.museum":true,"motorcycle.museum":true,"muenchen.museum":true,"muenster.museum":true,"mulhouse.museum":true,"muncie.museum":true,"museet.museum":true,"museumcenter.museum":true,"museumvereniging.museum":true,"music.museum":true,"national.museum":true,"nationalfirearms.museum":true,"nationalheritage.museum":true,"nativeamerican.museum":true,"naturalhistory.museum":true,"naturalhistorymuseum.museum":true,"naturalsciences.museum":true,"nature.museum":true,"naturhistorisches.museum":true,"natuurwetenschappen.museum":true,"naumburg.museum":true,"naval.museum":true,"nebraska.museum":true,"neues.museum":true,"newhampshire.museum":true,"newjersey.museum":true,"newmexico.museum":true,"newport.museum":true,"newspaper.museum":true,"newyork.museum":true,"niepce.museum":true,"norfolk.museum":true,"north.museum":true,"nrw.museum":true,"nuernberg.museum":true,"nuremberg.museum":true,"nyc.museum":true,"nyny.museum":true,"oceanographic.museum":true,"oceanographique.museum":true,"omaha.museum":true,"online.museum":true,"ontario.museum":true,"openair.museum":true,"oregon.museum":true,"oregontrail.museum":true,"otago.museum":true,"oxford.museum":true,"pacific.museum":true,"paderborn.museum":true,"palace.museum":true,"paleo.museum":true,"palmsprings.museum":true,"panama.museum":true,"paris.museum":true,"pasadena.museum":true,"pharmacy.museum":true,"philadelphia.museum":true,"philadelphiaarea.museum":true,"philately.museum":true,"phoenix.museum":true,"photography.museum":true,"pilots.museum":true,"pittsburgh.museum":true,"planetarium.museum":true,"plantation.museum":true,"plants.museum":true,"plaza.museum":true,"portal.museum":true,"portland.museum":true,"portlligat.museum":true,"posts-and-telecommunications.museum":true,"preservation.museum":true,"presidio.museum":true,"press.museum":true,"project.museum":true,"public.museum":true,"pubol.museum":true,"quebec.museum":true,"railroad.museum":true,"railway.museum":true,"research.museum":true,"resistance.museum":true,"riodejaneiro.museum":true,"rochester.museum":true,"rockart.museum":true,"roma.museum":true,"russia.museum":true,"saintlouis.museum":true,"salem.museum":true,"salvadordali.museum":true,"salzburg.museum":true,"sandiego.museum":true,"sanfrancisco.museum":true,"santabarbara.museum":true,"santacruz.museum":true,"santafe.museum":true,"saskatchewan.museum":true,"satx.museum":true,"savannahga.museum":true,"schlesisches.museum":true,"schoenbrunn.museum":true,"schokoladen.museum":true,"school.museum":true,"schweiz.museum":true,"science.museum":true,"scienceandhistory.museum":true,"scienceandindustry.museum":true,"sciencecenter.museum":true,"sciencecenters.museum":true,"science-fiction.museum":true,"sciencehistory.museum":true,"sciences.museum":true,"sciencesnaturelles.museum":true,"scotland.museum":true,"seaport.museum":true,"settlement.museum":true,"settlers.museum":true,"shell.museum":true,"sherbrooke.museum":true,"sibenik.museum":true,"silk.museum":true,"ski.museum":true,"skole.museum":true,"society.museum":true,"sologne.museum":true,"soundandvision.museum":true,"southcarolina.museum":true,"southwest.museum":true,"space.museum":true,"spy.museum":true,"square.museum":true,"stadt.museum":true,"stalbans.museum":true,"starnberg.museum":true,"state.museum":true,"stateofdelaware.museum":true,"station.museum":true,"steam.museum":true,"steiermark.museum":true,"stjohn.museum":true,"stockholm.museum":true,"stpetersburg.museum":true,"stuttgart.museum":true,"suisse.museum":true,"surgeonshall.museum":true,"surrey.museum":true,"svizzera.museum":true,"sweden.museum":true,"sydney.museum":true,"tank.museum":true,"tcm.museum":true,"technology.museum":true,"telekommunikation.museum":true,"television.museum":true,"texas.museum":true,"textile.museum":true,"theater.museum":true,"time.museum":true,"timekeeping.museum":true,"topology.museum":true,"torino.museum":true,"touch.museum":true,"town.museum":true,"transport.museum":true,"tree.museum":true,"trolley.museum":true,"trust.museum":true,"trustee.museum":true,"uhren.museum":true,"ulm.museum":true,"undersea.museum":true,"university.museum":true,"usa.museum":true,"usantiques.museum":true,"usarts.museum":true,"uscountryestate.museum":true,"usculture.museum":true,"usdecorativearts.museum":true,"usgarden.museum":true,"ushistory.museum":true,"ushuaia.museum":true,"uslivinghistory.museum":true,"utah.museum":true,"uvic.museum":true,"valley.museum":true,"vantaa.museum":true,"versailles.museum":true,"viking.museum":true,"village.museum":true,"virginia.museum":true,"virtual.museum":true,"virtuel.museum":true,"vlaanderen.museum":true,"volkenkunde.museum":true,"wales.museum":true,"wallonie.museum":true,"war.museum":true,"washingtondc.museum":true,"watchandclock.museum":true,"watch-and-clock.museum":true,"western.museum":true,"westfalen.museum":true,"whaling.museum":true,"wildlife.museum":true,"williamsburg.museum":true,"windmill.museum":true,"workshop.museum":true,"york.museum":true,"yorkshire.museum":true,"yosemite.museum":true,"youth.museum":true,"zoological.museum":true,"zoology.museum":true,"xn--9dbhblg6di.museum":true,"xn--h1aegh.museum":true,"mv":true,"aero.mv":true,"biz.mv":true,"com.mv":true,"coop.mv":true,"edu.mv":true,"gov.mv":true,"info.mv":true,"int.mv":true,"mil.mv":true,"museum.mv":true,"name.mv":true,"net.mv":true,"org.mv":true,"pro.mv":true,"mw":true,"ac.mw":true,"biz.mw":true,"co.mw":true,"com.mw":true,"coop.mw":true,"edu.mw":true,"gov.mw":true,"int.mw":true,"museum.mw":true,"net.mw":true,"org.mw":true,"mx":true,"com.mx":true,"org.mx":true,"gob.mx":true,"edu.mx":true,"net.mx":true,"my":true,"com.my":true,"net.my":true,"org.my":true,"gov.my":true,"edu.my":true,"mil.my":true,"name.my":true,"mz":true,"ac.mz":true,"adv.mz":true,"co.mz":true,"edu.mz":true,"gov.mz":true,"mil.mz":true,"net.mz":true,"org.mz":true,"na":true,"info.na":true,"pro.na":true,"name.na":true,"school.na":true,"or.na":true,"dr.na":true,"us.na":true,"mx.na":true,"ca.na":true,"in.na":true,"cc.na":true,"tv.na":true,"ws.na":true,"mobi.na":true,"co.na":true,"com.na":true,"org.na":true,"name":true,"nc":true,"asso.nc":true,"nom.nc":true,"ne":true,"net":true,"nf":true,"com.nf":true,"net.nf":true,"per.nf":true,"rec.nf":true,"web.nf":true,"arts.nf":true,"firm.nf":true,"info.nf":true,"other.nf":true,"store.nf":true,"ng":true,"com.ng":true,"edu.ng":true,"gov.ng":true,"i.ng":true,"mil.ng":true,"mobi.ng":true,"name.ng":true,"net.ng":true,"org.ng":true,"sch.ng":true,"ni":true,"ac.ni":true,"biz.ni":true,"co.ni":true,"com.ni":true,"edu.ni":true,"gob.ni":true,"in.ni":true,"info.ni":true,"int.ni":true,"mil.ni":true,"net.ni":true,"nom.ni":true,"org.ni":true,"web.ni":true,"nl":true,"bv.nl":true,"no":true,"fhs.no":true,"vgs.no":true,"fylkesbibl.no":true,"folkebibl.no":true,"museum.no":true,"idrett.no":true,"priv.no":true,"mil.no":true,"stat.no":true,"dep.no":true,"kommune.no":true,"herad.no":true,"aa.no":true,"ah.no":true,"bu.no":true,"fm.no":true,"hl.no":true,"hm.no":true,"jan-mayen.no":true,"mr.no":true,"nl.no":true,"nt.no":true,"of.no":true,"ol.no":true,"oslo.no":true,"rl.no":true,"sf.no":true,"st.no":true,"svalbard.no":true,"tm.no":true,"tr.no":true,"va.no":true,"vf.no":true,"gs.aa.no":true,"gs.ah.no":true,"gs.bu.no":true,"gs.fm.no":true,"gs.hl.no":true,"gs.hm.no":true,"gs.jan-mayen.no":true,"gs.mr.no":true,"gs.nl.no":true,"gs.nt.no":true,"gs.of.no":true,"gs.ol.no":true,"gs.oslo.no":true,"gs.rl.no":true,"gs.sf.no":true,"gs.st.no":true,"gs.svalbard.no":true,"gs.tm.no":true,"gs.tr.no":true,"gs.va.no":true,"gs.vf.no":true,"akrehamn.no":true,"xn--krehamn-dxa.no":true,"algard.no":true,"xn--lgrd-poac.no":true,"arna.no":true,"brumunddal.no":true,"bryne.no":true,"bronnoysund.no":true,"xn--brnnysund-m8ac.no":true,"drobak.no":true,"xn--drbak-wua.no":true,"egersund.no":true,"fetsund.no":true,"floro.no":true,"xn--flor-jra.no":true,"fredrikstad.no":true,"hokksund.no":true,"honefoss.no":true,"xn--hnefoss-q1a.no":true,"jessheim.no":true,"jorpeland.no":true,"xn--jrpeland-54a.no":true,"kirkenes.no":true,"kopervik.no":true,"krokstadelva.no":true,"langevag.no":true,"xn--langevg-jxa.no":true,"leirvik.no":true,"mjondalen.no":true,"xn--mjndalen-64a.no":true,"mo-i-rana.no":true,"mosjoen.no":true,"xn--mosjen-eya.no":true,"nesoddtangen.no":true,"orkanger.no":true,"osoyro.no":true,"xn--osyro-wua.no":true,"raholt.no":true,"xn--rholt-mra.no":true,"sandnessjoen.no":true,"xn--sandnessjen-ogb.no":true,"skedsmokorset.no":true,"slattum.no":true,"spjelkavik.no":true,"stathelle.no":true,"stavern.no":true,"stjordalshalsen.no":true,"xn--stjrdalshalsen-sqb.no":true,"tananger.no":true,"tranby.no":true,"vossevangen.no":true,"afjord.no":true,"xn--fjord-lra.no":true,"agdenes.no":true,"al.no":true,"xn--l-1fa.no":true,"alesund.no":true,"xn--lesund-hua.no":true,"alstahaug.no":true,"alta.no":true,"xn--lt-liac.no":true,"alaheadju.no":true,"xn--laheadju-7ya.no":true,"alvdal.no":true,"amli.no":true,"xn--mli-tla.no":true,"amot.no":true,"xn--mot-tla.no":true,"andebu.no":true,"andoy.no":true,"xn--andy-ira.no":true,"andasuolo.no":true,"ardal.no":true,"xn--rdal-poa.no":true,"aremark.no":true,"arendal.no":true,"xn--s-1fa.no":true,"aseral.no":true,"xn--seral-lra.no":true,"asker.no":true,"askim.no":true,"askvoll.no":true,"askoy.no":true,"xn--asky-ira.no":true,"asnes.no":true,"xn--snes-poa.no":true,"audnedaln.no":true,"aukra.no":true,"aure.no":true,"aurland.no":true,"aurskog-holand.no":true,"xn--aurskog-hland-jnb.no":true,"austevoll.no":true,"austrheim.no":true,"averoy.no":true,"xn--avery-yua.no":true,"balestrand.no":true,"ballangen.no":true,"balat.no":true,"xn--blt-elab.no":true,"balsfjord.no":true,"bahccavuotna.no":true,"xn--bhccavuotna-k7a.no":true,"bamble.no":true,"bardu.no":true,"beardu.no":true,"beiarn.no":true,"bajddar.no":true,"xn--bjddar-pta.no":true,"baidar.no":true,"xn--bidr-5nac.no":true,"berg.no":true,"bergen.no":true,"berlevag.no":true,"xn--berlevg-jxa.no":true,"bearalvahki.no":true,"xn--bearalvhki-y4a.no":true,"bindal.no":true,"birkenes.no":true,"bjarkoy.no":true,"xn--bjarky-fya.no":true,"bjerkreim.no":true,"bjugn.no":true,"bodo.no":true,"xn--bod-2na.no":true,"badaddja.no":true,"xn--bdddj-mrabd.no":true,"budejju.no":true,"bokn.no":true,"bremanger.no":true,"bronnoy.no":true,"xn--brnny-wuac.no":true,"bygland.no":true,"bykle.no":true,"barum.no":true,"xn--brum-voa.no":true,"bo.telemark.no":true,"xn--b-5ga.telemark.no":true,"bo.nordland.no":true,"xn--b-5ga.nordland.no":true,"bievat.no":true,"xn--bievt-0qa.no":true,"bomlo.no":true,"xn--bmlo-gra.no":true,"batsfjord.no":true,"xn--btsfjord-9za.no":true,"bahcavuotna.no":true,"xn--bhcavuotna-s4a.no":true,"dovre.no":true,"drammen.no":true,"drangedal.no":true,"dyroy.no":true,"xn--dyry-ira.no":true,"donna.no":true,"xn--dnna-gra.no":true,"eid.no":true,"eidfjord.no":true,"eidsberg.no":true,"eidskog.no":true,"eidsvoll.no":true,"eigersund.no":true,"elverum.no":true,"enebakk.no":true,"engerdal.no":true,"etne.no":true,"etnedal.no":true,"evenes.no":true,"evenassi.no":true,"xn--eveni-0qa01ga.no":true,"evje-og-hornnes.no":true,"farsund.no":true,"fauske.no":true,"fuossko.no":true,"fuoisku.no":true,"fedje.no":true,"fet.no":true,"finnoy.no":true,"xn--finny-yua.no":true,"fitjar.no":true,"fjaler.no":true,"fjell.no":true,"flakstad.no":true,"flatanger.no":true,"flekkefjord.no":true,"flesberg.no":true,"flora.no":true,"fla.no":true,"xn--fl-zia.no":true,"folldal.no":true,"forsand.no":true,"fosnes.no":true,"frei.no":true,"frogn.no":true,"froland.no":true,"frosta.no":true,"frana.no":true,"xn--frna-woa.no":true,"froya.no":true,"xn--frya-hra.no":true,"fusa.no":true,"fyresdal.no":true,"forde.no":true,"xn--frde-gra.no":true,"gamvik.no":true,"gangaviika.no":true,"xn--ggaviika-8ya47h.no":true,"gaular.no":true,"gausdal.no":true,"gildeskal.no":true,"xn--gildeskl-g0a.no":true,"giske.no":true,"gjemnes.no":true,"gjerdrum.no":true,"gjerstad.no":true,"gjesdal.no":true,"gjovik.no":true,"xn--gjvik-wua.no":true,"gloppen.no":true,"gol.no":true,"gran.no":true,"grane.no":true,"granvin.no":true,"gratangen.no":true,"grimstad.no":true,"grong.no":true,"kraanghke.no":true,"xn--kranghke-b0a.no":true,"grue.no":true,"gulen.no":true,"hadsel.no":true,"halden.no":true,"halsa.no":true,"hamar.no":true,"hamaroy.no":true,"habmer.no":true,"xn--hbmer-xqa.no":true,"hapmir.no":true,"xn--hpmir-xqa.no":true,"hammerfest.no":true,"hammarfeasta.no":true,"xn--hmmrfeasta-s4ac.no":true,"haram.no":true,"hareid.no":true,"harstad.no":true,"hasvik.no":true,"aknoluokta.no":true,"xn--koluokta-7ya57h.no":true,"hattfjelldal.no":true,"aarborte.no":true,"haugesund.no":true,"hemne.no":true,"hemnes.no":true,"hemsedal.no":true,"heroy.more-og-romsdal.no":true,"xn--hery-ira.xn--mre-og-romsdal-qqb.no":true,"heroy.nordland.no":true,"xn--hery-ira.nordland.no":true,"hitra.no":true,"hjartdal.no":true,"hjelmeland.no":true,"hobol.no":true,"xn--hobl-ira.no":true,"hof.no":true,"hol.no":true,"hole.no":true,"holmestrand.no":true,"holtalen.no":true,"xn--holtlen-hxa.no":true,"hornindal.no":true,"horten.no":true,"hurdal.no":true,"hurum.no":true,"hvaler.no":true,"hyllestad.no":true,"hagebostad.no":true,"xn--hgebostad-g3a.no":true,"hoyanger.no":true,"xn--hyanger-q1a.no":true,"hoylandet.no":true,"xn--hylandet-54a.no":true,"ha.no":true,"xn--h-2fa.no":true,"ibestad.no":true,"inderoy.no":true,"xn--indery-fya.no":true,"iveland.no":true,"jevnaker.no":true,"jondal.no":true,"jolster.no":true,"xn--jlster-bya.no":true,"karasjok.no":true,"karasjohka.no":true,"xn--krjohka-hwab49j.no":true,"karlsoy.no":true,"galsa.no":true,"xn--gls-elac.no":true,"karmoy.no":true,"xn--karmy-yua.no":true,"kautokeino.no":true,"guovdageaidnu.no":true,"klepp.no":true,"klabu.no":true,"xn--klbu-woa.no":true,"kongsberg.no":true,"kongsvinger.no":true,"kragero.no":true,"xn--krager-gya.no":true,"kristiansand.no":true,"kristiansund.no":true,"krodsherad.no":true,"xn--krdsherad-m8a.no":true,"kvalsund.no":true,"rahkkeravju.no":true,"xn--rhkkervju-01af.no":true,"kvam.no":true,"kvinesdal.no":true,"kvinnherad.no":true,"kviteseid.no":true,"kvitsoy.no":true,"xn--kvitsy-fya.no":true,"kvafjord.no":true,"xn--kvfjord-nxa.no":true,"giehtavuoatna.no":true,"kvanangen.no":true,"xn--kvnangen-k0a.no":true,"navuotna.no":true,"xn--nvuotna-hwa.no":true,"kafjord.no":true,"xn--kfjord-iua.no":true,"gaivuotna.no":true,"xn--givuotna-8ya.no":true,"larvik.no":true,"lavangen.no":true,"lavagis.no":true,"loabat.no":true,"xn--loabt-0qa.no":true,"lebesby.no":true,"davvesiida.no":true,"leikanger.no":true,"leirfjord.no":true,"leka.no":true,"leksvik.no":true,"lenvik.no":true,"leangaviika.no":true,"xn--leagaviika-52b.no":true,"lesja.no":true,"levanger.no":true,"lier.no":true,"lierne.no":true,"lillehammer.no":true,"lillesand.no":true,"lindesnes.no":true,"lindas.no":true,"xn--linds-pra.no":true,"lom.no":true,"loppa.no":true,"lahppi.no":true,"xn--lhppi-xqa.no":true,"lund.no":true,"lunner.no":true,"luroy.no":true,"xn--lury-ira.no":true,"luster.no":true,"lyngdal.no":true,"lyngen.no":true,"ivgu.no":true,"lardal.no":true,"lerdal.no":true,"xn--lrdal-sra.no":true,"lodingen.no":true,"xn--ldingen-q1a.no":true,"lorenskog.no":true,"xn--lrenskog-54a.no":true,"loten.no":true,"xn--lten-gra.no":true,"malvik.no":true,"masoy.no":true,"xn--msy-ula0h.no":true,"muosat.no":true,"xn--muost-0qa.no":true,"mandal.no":true,"marker.no":true,"marnardal.no":true,"masfjorden.no":true,"meland.no":true,"meldal.no":true,"melhus.no":true,"meloy.no":true,"xn--mely-ira.no":true,"meraker.no":true,"xn--merker-kua.no":true,"moareke.no":true,"xn--moreke-jua.no":true,"midsund.no":true,"midtre-gauldal.no":true,"modalen.no":true,"modum.no":true,"molde.no":true,"moskenes.no":true,"moss.no":true,"mosvik.no":true,"malselv.no":true,"xn--mlselv-iua.no":true,"malatvuopmi.no":true,"xn--mlatvuopmi-s4a.no":true,"namdalseid.no":true,"aejrie.no":true,"namsos.no":true,"namsskogan.no":true,"naamesjevuemie.no":true,"xn--nmesjevuemie-tcba.no":true,"laakesvuemie.no":true,"nannestad.no":true,"narvik.no":true,"narviika.no":true,"naustdal.no":true,"nedre-eiker.no":true,"nes.akershus.no":true,"nes.buskerud.no":true,"nesna.no":true,"nesodden.no":true,"nesseby.no":true,"unjarga.no":true,"xn--unjrga-rta.no":true,"nesset.no":true,"nissedal.no":true,"nittedal.no":true,"nord-aurdal.no":true,"nord-fron.no":true,"nord-odal.no":true,"norddal.no":true,"nordkapp.no":true,"davvenjarga.no":true,"xn--davvenjrga-y4a.no":true,"nordre-land.no":true,"nordreisa.no":true,"raisa.no":true,"xn--risa-5na.no":true,"nore-og-uvdal.no":true,"notodden.no":true,"naroy.no":true,"xn--nry-yla5g.no":true,"notteroy.no":true,"xn--nttery-byae.no":true,"odda.no":true,"oksnes.no":true,"xn--ksnes-uua.no":true,"oppdal.no":true,"oppegard.no":true,"xn--oppegrd-ixa.no":true,"orkdal.no":true,"orland.no":true,"xn--rland-uua.no":true,"orskog.no":true,"xn--rskog-uua.no":true,"orsta.no":true,"xn--rsta-fra.no":true,"os.hedmark.no":true,"os.hordaland.no":true,"osen.no":true,"osteroy.no":true,"xn--ostery-fya.no":true,"ostre-toten.no":true,"xn--stre-toten-zcb.no":true,"overhalla.no":true,"ovre-eiker.no":true,"xn--vre-eiker-k8a.no":true,"oyer.no":true,"xn--yer-zna.no":true,"oygarden.no":true,"xn--ygarden-p1a.no":true,"oystre-slidre.no":true,"xn--ystre-slidre-ujb.no":true,"porsanger.no":true,"porsangu.no":true,"xn--porsgu-sta26f.no":true,"porsgrunn.no":true,"radoy.no":true,"xn--rady-ira.no":true,"rakkestad.no":true,"rana.no":true,"ruovat.no":true,"randaberg.no":true,"rauma.no":true,"rendalen.no":true,"rennebu.no":true,"rennesoy.no":true,"xn--rennesy-v1a.no":true,"rindal.no":true,"ringebu.no":true,"ringerike.no":true,"ringsaker.no":true,"rissa.no":true,"risor.no":true,"xn--risr-ira.no":true,"roan.no":true,"rollag.no":true,"rygge.no":true,"ralingen.no":true,"xn--rlingen-mxa.no":true,"rodoy.no":true,"xn--rdy-0nab.no":true,"romskog.no":true,"xn--rmskog-bya.no":true,"roros.no":true,"xn--rros-gra.no":true,"rost.no":true,"xn--rst-0na.no":true,"royken.no":true,"xn--ryken-vua.no":true,"royrvik.no":true,"xn--ryrvik-bya.no":true,"rade.no":true,"xn--rde-ula.no":true,"salangen.no":true,"siellak.no":true,"saltdal.no":true,"salat.no":true,"xn--slt-elab.no":true,"xn--slat-5na.no":true,"samnanger.no":true,"sande.more-og-romsdal.no":true,"sande.xn--mre-og-romsdal-qqb.no":true,"sande.vestfold.no":true,"sandefjord.no":true,"sandnes.no":true,"sandoy.no":true,"xn--sandy-yua.no":true,"sarpsborg.no":true,"sauda.no":true,"sauherad.no":true,"sel.no":true,"selbu.no":true,"selje.no":true,"seljord.no":true,"sigdal.no":true,"siljan.no":true,"sirdal.no":true,"skaun.no":true,"skedsmo.no":true,"ski.no":true,"skien.no":true,"skiptvet.no":true,"skjervoy.no":true,"xn--skjervy-v1a.no":true,"skierva.no":true,"xn--skierv-uta.no":true,"skjak.no":true,"xn--skjk-soa.no":true,"skodje.no":true,"skanland.no":true,"xn--sknland-fxa.no":true,"skanit.no":true,"xn--sknit-yqa.no":true,"smola.no":true,"xn--smla-hra.no":true,"snillfjord.no":true,"snasa.no":true,"xn--snsa-roa.no":true,"snoasa.no":true,"snaase.no":true,"xn--snase-nra.no":true,"sogndal.no":true,"sokndal.no":true,"sola.no":true,"solund.no":true,"songdalen.no":true,"sortland.no":true,"spydeberg.no":true,"stange.no":true,"stavanger.no":true,"steigen.no":true,"steinkjer.no":true,"stjordal.no":true,"xn--stjrdal-s1a.no":true,"stokke.no":true,"stor-elvdal.no":true,"stord.no":true,"stordal.no":true,"storfjord.no":true,"omasvuotna.no":true,"strand.no":true,"stranda.no":true,"stryn.no":true,"sula.no":true,"suldal.no":true,"sund.no":true,"sunndal.no":true,"surnadal.no":true,"sveio.no":true,"svelvik.no":true,"sykkylven.no":true,"sogne.no":true,"xn--sgne-gra.no":true,"somna.no":true,"xn--smna-gra.no":true,"sondre-land.no":true,"xn--sndre-land-0cb.no":true,"sor-aurdal.no":true,"xn--sr-aurdal-l8a.no":true,"sor-fron.no":true,"xn--sr-fron-q1a.no":true,"sor-odal.no":true,"xn--sr-odal-q1a.no":true,"sor-varanger.no":true,"xn--sr-varanger-ggb.no":true,"matta-varjjat.no":true,"xn--mtta-vrjjat-k7af.no":true,"sorfold.no":true,"xn--srfold-bya.no":true,"sorreisa.no":true,"xn--srreisa-q1a.no":true,"sorum.no":true,"xn--srum-gra.no":true,"tana.no":true,"deatnu.no":true,"time.no":true,"tingvoll.no":true,"tinn.no":true,"tjeldsund.no":true,"dielddanuorri.no":true,"tjome.no":true,"xn--tjme-hra.no":true,"tokke.no":true,"tolga.no":true,"torsken.no":true,"tranoy.no":true,"xn--trany-yua.no":true,"tromso.no":true,"xn--troms-zua.no":true,"tromsa.no":true,"romsa.no":true,"trondheim.no":true,"troandin.no":true,"trysil.no":true,"trana.no":true,"xn--trna-woa.no":true,"trogstad.no":true,"xn--trgstad-r1a.no":true,"tvedestrand.no":true,"tydal.no":true,"tynset.no":true,"tysfjord.no":true,"divtasvuodna.no":true,"divttasvuotna.no":true,"tysnes.no":true,"tysvar.no":true,"xn--tysvr-vra.no":true,"tonsberg.no":true,"xn--tnsberg-q1a.no":true,"ullensaker.no":true,"ullensvang.no":true,"ulvik.no":true,"utsira.no":true,"vadso.no":true,"xn--vads-jra.no":true,"cahcesuolo.no":true,"xn--hcesuolo-7ya35b.no":true,"vaksdal.no":true,"valle.no":true,"vang.no":true,"vanylven.no":true,"vardo.no":true,"xn--vard-jra.no":true,"varggat.no":true,"xn--vrggt-xqad.no":true,"vefsn.no":true,"vaapste.no":true,"vega.no":true,"vegarshei.no":true,"xn--vegrshei-c0a.no":true,"vennesla.no":true,"verdal.no":true,"verran.no":true,"vestby.no":true,"vestnes.no":true,"vestre-slidre.no":true,"vestre-toten.no":true,"vestvagoy.no":true,"xn--vestvgy-ixa6o.no":true,"vevelstad.no":true,"vik.no":true,"vikna.no":true,"vindafjord.no":true,"volda.no":true,"voss.no":true,"varoy.no":true,"xn--vry-yla5g.no":true,"vagan.no":true,"xn--vgan-qoa.no":true,"voagat.no":true,"vagsoy.no":true,"xn--vgsy-qoa0j.no":true,"vaga.no":true,"xn--vg-yiab.no":true,"valer.ostfold.no":true,"xn--vler-qoa.xn--stfold-9xa.no":true,"valer.hedmark.no":true,"xn--vler-qoa.hedmark.no":true,"*.np":true,"nr":true,"biz.nr":true,"info.nr":true,"gov.nr":true,"edu.nr":true,"org.nr":true,"net.nr":true,"com.nr":true,"nu":true,"nz":true,"ac.nz":true,"co.nz":true,"cri.nz":true,"geek.nz":true,"gen.nz":true,"govt.nz":true,"health.nz":true,"iwi.nz":true,"kiwi.nz":true,"maori.nz":true,"mil.nz":true,"xn--mori-qsa.nz":true,"net.nz":true,"org.nz":true,"parliament.nz":true,"school.nz":true,"om":true,"co.om":true,"com.om":true,"edu.om":true,"gov.om":true,"med.om":true,"museum.om":true,"net.om":true,"org.om":true,"pro.om":true,"onion":true,"org":true,"pa":true,"ac.pa":true,"gob.pa":true,"com.pa":true,"org.pa":true,"sld.pa":true,"edu.pa":true,"net.pa":true,"ing.pa":true,"abo.pa":true,"med.pa":true,"nom.pa":true,"pe":true,"edu.pe":true,"gob.pe":true,"nom.pe":true,"mil.pe":true,"org.pe":true,"com.pe":true,"net.pe":true,"pf":true,"com.pf":true,"org.pf":true,"edu.pf":true,"*.pg":true,"ph":true,"com.ph":true,"net.ph":true,"org.ph":true,"gov.ph":true,"edu.ph":true,"ngo.ph":true,"mil.ph":true,"i.ph":true,"pk":true,"com.pk":true,"net.pk":true,"edu.pk":true,"org.pk":true,"fam.pk":true,"biz.pk":true,"web.pk":true,"gov.pk":true,"gob.pk":true,"gok.pk":true,"gon.pk":true,"gop.pk":true,"gos.pk":true,"info.pk":true,"pl":true,"com.pl":true,"net.pl":true,"org.pl":true,"aid.pl":true,"agro.pl":true,"atm.pl":true,"auto.pl":true,"biz.pl":true,"edu.pl":true,"gmina.pl":true,"gsm.pl":true,"info.pl":true,"mail.pl":true,"miasta.pl":true,"media.pl":true,"mil.pl":true,"nieruchomosci.pl":true,"nom.pl":true,"pc.pl":true,"powiat.pl":true,"priv.pl":true,"realestate.pl":true,"rel.pl":true,"sex.pl":true,"shop.pl":true,"sklep.pl":true,"sos.pl":true,"szkola.pl":true,"targi.pl":true,"tm.pl":true,"tourism.pl":true,"travel.pl":true,"turystyka.pl":true,"gov.pl":true,"ap.gov.pl":true,"ic.gov.pl":true,"is.gov.pl":true,"us.gov.pl":true,"kmpsp.gov.pl":true,"kppsp.gov.pl":true,"kwpsp.gov.pl":true,"psp.gov.pl":true,"wskr.gov.pl":true,"kwp.gov.pl":true,"mw.gov.pl":true,"ug.gov.pl":true,"um.gov.pl":true,"umig.gov.pl":true,"ugim.gov.pl":true,"upow.gov.pl":true,"uw.gov.pl":true,"starostwo.gov.pl":true,"pa.gov.pl":true,"po.gov.pl":true,"psse.gov.pl":true,"pup.gov.pl":true,"rzgw.gov.pl":true,"sa.gov.pl":true,"so.gov.pl":true,"sr.gov.pl":true,"wsa.gov.pl":true,"sko.gov.pl":true,"uzs.gov.pl":true,"wiih.gov.pl":true,"winb.gov.pl":true,"pinb.gov.pl":true,"wios.gov.pl":true,"witd.gov.pl":true,"wzmiuw.gov.pl":true,"piw.gov.pl":true,"wiw.gov.pl":true,"griw.gov.pl":true,"wif.gov.pl":true,"oum.gov.pl":true,"sdn.gov.pl":true,"zp.gov.pl":true,"uppo.gov.pl":true,"mup.gov.pl":true,"wuoz.gov.pl":true,"konsulat.gov.pl":true,"oirm.gov.pl":true,"augustow.pl":true,"babia-gora.pl":true,"bedzin.pl":true,"beskidy.pl":true,"bialowieza.pl":true,"bialystok.pl":true,"bielawa.pl":true,"bieszczady.pl":true,"boleslawiec.pl":true,"bydgoszcz.pl":true,"bytom.pl":true,"cieszyn.pl":true,"czeladz.pl":true,"czest.pl":true,"dlugoleka.pl":true,"elblag.pl":true,"elk.pl":true,"glogow.pl":true,"gniezno.pl":true,"gorlice.pl":true,"grajewo.pl":true,"ilawa.pl":true,"jaworzno.pl":true,"jelenia-gora.pl":true,"jgora.pl":true,"kalisz.pl":true,"kazimierz-dolny.pl":true,"karpacz.pl":true,"kartuzy.pl":true,"kaszuby.pl":true,"katowice.pl":true,"kepno.pl":true,"ketrzyn.pl":true,"klodzko.pl":true,"kobierzyce.pl":true,"kolobrzeg.pl":true,"konin.pl":true,"konskowola.pl":true,"kutno.pl":true,"lapy.pl":true,"lebork.pl":true,"legnica.pl":true,"lezajsk.pl":true,"limanowa.pl":true,"lomza.pl":true,"lowicz.pl":true,"lubin.pl":true,"lukow.pl":true,"malbork.pl":true,"malopolska.pl":true,"mazowsze.pl":true,"mazury.pl":true,"mielec.pl":true,"mielno.pl":true,"mragowo.pl":true,"naklo.pl":true,"nowaruda.pl":true,"nysa.pl":true,"olawa.pl":true,"olecko.pl":true,"olkusz.pl":true,"olsztyn.pl":true,"opoczno.pl":true,"opole.pl":true,"ostroda.pl":true,"ostroleka.pl":true,"ostrowiec.pl":true,"ostrowwlkp.pl":true,"pila.pl":true,"pisz.pl":true,"podhale.pl":true,"podlasie.pl":true,"polkowice.pl":true,"pomorze.pl":true,"pomorskie.pl":true,"prochowice.pl":true,"pruszkow.pl":true,"przeworsk.pl":true,"pulawy.pl":true,"radom.pl":true,"rawa-maz.pl":true,"rybnik.pl":true,"rzeszow.pl":true,"sanok.pl":true,"sejny.pl":true,"slask.pl":true,"slupsk.pl":true,"sosnowiec.pl":true,"stalowa-wola.pl":true,"skoczow.pl":true,"starachowice.pl":true,"stargard.pl":true,"suwalki.pl":true,"swidnica.pl":true,"swiebodzin.pl":true,"swinoujscie.pl":true,"szczecin.pl":true,"szczytno.pl":true,"tarnobrzeg.pl":true,"tgory.pl":true,"turek.pl":true,"tychy.pl":true,"ustka.pl":true,"walbrzych.pl":true,"warmia.pl":true,"warszawa.pl":true,"waw.pl":true,"wegrow.pl":true,"wielun.pl":true,"wlocl.pl":true,"wloclawek.pl":true,"wodzislaw.pl":true,"wolomin.pl":true,"wroclaw.pl":true,"zachpomor.pl":true,"zagan.pl":true,"zarow.pl":true,"zgora.pl":true,"zgorzelec.pl":true,"pm":true,"pn":true,"gov.pn":true,"co.pn":true,"org.pn":true,"edu.pn":true,"net.pn":true,"post":true,"pr":true,"com.pr":true,"net.pr":true,"org.pr":true,"gov.pr":true,"edu.pr":true,"isla.pr":true,"pro.pr":true,"biz.pr":true,"info.pr":true,"name.pr":true,"est.pr":true,"prof.pr":true,"ac.pr":true,"pro":true,"aaa.pro":true,"aca.pro":true,"acct.pro":true,"avocat.pro":true,"bar.pro":true,"cpa.pro":true,"eng.pro":true,"jur.pro":true,"law.pro":true,"med.pro":true,"recht.pro":true,"ps":true,"edu.ps":true,"gov.ps":true,"sec.ps":true,"plo.ps":true,"com.ps":true,"org.ps":true,"net.ps":true,"pt":true,"net.pt":true,"gov.pt":true,"org.pt":true,"edu.pt":true,"int.pt":true,"publ.pt":true,"com.pt":true,"nome.pt":true,"pw":true,"co.pw":true,"ne.pw":true,"or.pw":true,"ed.pw":true,"go.pw":true,"belau.pw":true,"py":true,"com.py":true,"coop.py":true,"edu.py":true,"gov.py":true,"mil.py":true,"net.py":true,"org.py":true,"qa":true,"com.qa":true,"edu.qa":true,"gov.qa":true,"mil.qa":true,"name.qa":true,"net.qa":true,"org.qa":true,"sch.qa":true,"re":true,"asso.re":true,"com.re":true,"nom.re":true,"ro":true,"arts.ro":true,"com.ro":true,"firm.ro":true,"info.ro":true,"nom.ro":true,"nt.ro":true,"org.ro":true,"rec.ro":true,"store.ro":true,"tm.ro":true,"www.ro":true,"rs":true,"ac.rs":true,"co.rs":true,"edu.rs":true,"gov.rs":true,"in.rs":true,"org.rs":true,"ru":true,"ac.ru":true,"edu.ru":true,"gov.ru":true,"int.ru":true,"mil.ru":true,"test.ru":true,"rw":true,"gov.rw":true,"net.rw":true,"edu.rw":true,"ac.rw":true,"com.rw":true,"co.rw":true,"int.rw":true,"mil.rw":true,"gouv.rw":true,"sa":true,"com.sa":true,"net.sa":true,"org.sa":true,"gov.sa":true,"med.sa":true,"pub.sa":true,"edu.sa":true,"sch.sa":true,"sb":true,"com.sb":true,"edu.sb":true,"gov.sb":true,"net.sb":true,"org.sb":true,"sc":true,"com.sc":true,"gov.sc":true,"net.sc":true,"org.sc":true,"edu.sc":true,"sd":true,"com.sd":true,"net.sd":true,"org.sd":true,"edu.sd":true,"med.sd":true,"tv.sd":true,"gov.sd":true,"info.sd":true,"se":true,"a.se":true,"ac.se":true,"b.se":true,"bd.se":true,"brand.se":true,"c.se":true,"d.se":true,"e.se":true,"f.se":true,"fh.se":true,"fhsk.se":true,"fhv.se":true,"g.se":true,"h.se":true,"i.se":true,"k.se":true,"komforb.se":true,"kommunalforbund.se":true,"komvux.se":true,"l.se":true,"lanbib.se":true,"m.se":true,"n.se":true,"naturbruksgymn.se":true,"o.se":true,"org.se":true,"p.se":true,"parti.se":true,"pp.se":true,"press.se":true,"r.se":true,"s.se":true,"t.se":true,"tm.se":true,"u.se":true,"w.se":true,"x.se":true,"y.se":true,"z.se":true,"sg":true,"com.sg":true,"net.sg":true,"org.sg":true,"gov.sg":true,"edu.sg":true,"per.sg":true,"sh":true,"com.sh":true,"net.sh":true,"gov.sh":true,"org.sh":true,"mil.sh":true,"si":true,"sj":true,"sk":true,"sl":true,"com.sl":true,"net.sl":true,"edu.sl":true,"gov.sl":true,"org.sl":true,"sm":true,"sn":true,"art.sn":true,"com.sn":true,"edu.sn":true,"gouv.sn":true,"org.sn":true,"perso.sn":true,"univ.sn":true,"so":true,"com.so":true,"net.so":true,"org.so":true,"sr":true,"st":true,"co.st":true,"com.st":true,"consulado.st":true,"edu.st":true,"embaixada.st":true,"gov.st":true,"mil.st":true,"net.st":true,"org.st":true,"principe.st":true,"saotome.st":true,"store.st":true,"su":true,"sv":true,"com.sv":true,"edu.sv":true,"gob.sv":true,"org.sv":true,"red.sv":true,"sx":true,"gov.sx":true,"sy":true,"edu.sy":true,"gov.sy":true,"net.sy":true,"mil.sy":true,"com.sy":true,"org.sy":true,"sz":true,"co.sz":true,"ac.sz":true,"org.sz":true,"tc":true,"td":true,"tel":true,"tf":true,"tg":true,"th":true,"ac.th":true,"co.th":true,"go.th":true,"in.th":true,"mi.th":true,"net.th":true,"or.th":true,"tj":true,"ac.tj":true,"biz.tj":true,"co.tj":true,"com.tj":true,"edu.tj":true,"go.tj":true,"gov.tj":true,"int.tj":true,"mil.tj":true,"name.tj":true,"net.tj":true,"nic.tj":true,"org.tj":true,"test.tj":true,"web.tj":true,"tk":true,"tl":true,"gov.tl":true,"tm":true,"com.tm":true,"co.tm":true,"org.tm":true,"net.tm":true,"nom.tm":true,"gov.tm":true,"mil.tm":true,"edu.tm":true,"tn":true,"com.tn":true,"ens.tn":true,"fin.tn":true,"gov.tn":true,"ind.tn":true,"intl.tn":true,"nat.tn":true,"net.tn":true,"org.tn":true,"info.tn":true,"perso.tn":true,"tourism.tn":true,"edunet.tn":true,"rnrt.tn":true,"rns.tn":true,"rnu.tn":true,"mincom.tn":true,"agrinet.tn":true,"defense.tn":true,"turen.tn":true,"to":true,"com.to":true,"gov.to":true,"net.to":true,"org.to":true,"edu.to":true,"mil.to":true,"tr":true,"com.tr":true,"info.tr":true,"biz.tr":true,"net.tr":true,"org.tr":true,"web.tr":true,"gen.tr":true,"tv.tr":true,"av.tr":true,"dr.tr":true,"bbs.tr":true,"name.tr":true,"tel.tr":true,"gov.tr":true,"bel.tr":true,"pol.tr":true,"mil.tr":true,"k12.tr":true,"edu.tr":true,"kep.tr":true,"nc.tr":true,"gov.nc.tr":true,"travel":true,"tt":true,"co.tt":true,"com.tt":true,"org.tt":true,"net.tt":true,"biz.tt":true,"info.tt":true,"pro.tt":true,"int.tt":true,"coop.tt":true,"jobs.tt":true,"mobi.tt":true,"travel.tt":true,"museum.tt":true,"aero.tt":true,"name.tt":true,"gov.tt":true,"edu.tt":true,"tv":true,"tw":true,"edu.tw":true,"gov.tw":true,"mil.tw":true,"com.tw":true,"net.tw":true,"org.tw":true,"idv.tw":true,"game.tw":true,"ebiz.tw":true,"club.tw":true,"xn--zf0ao64a.tw":true,"xn--uc0atv.tw":true,"xn--czrw28b.tw":true,"tz":true,"ac.tz":true,"co.tz":true,"go.tz":true,"hotel.tz":true,"info.tz":true,"me.tz":true,"mil.tz":true,"mobi.tz":true,"ne.tz":true,"or.tz":true,"sc.tz":true,"tv.tz":true,"ua":true,"com.ua":true,"edu.ua":true,"gov.ua":true,"in.ua":true,"net.ua":true,"org.ua":true,"cherkassy.ua":true,"cherkasy.ua":true,"chernigov.ua":true,"chernihiv.ua":true,"chernivtsi.ua":true,"chernovtsy.ua":true,"ck.ua":true,"cn.ua":true,"cr.ua":true,"crimea.ua":true,"cv.ua":true,"dn.ua":true,"dnepropetrovsk.ua":true,"dnipropetrovsk.ua":true,"dominic.ua":true,"donetsk.ua":true,"dp.ua":true,"if.ua":true,"ivano-frankivsk.ua":true,"kh.ua":true,"kharkiv.ua":true,"kharkov.ua":true,"kherson.ua":true,"khmelnitskiy.ua":true,"khmelnytskyi.ua":true,"kiev.ua":true,"kirovograd.ua":true,"km.ua":true,"kr.ua":true,"krym.ua":true,"ks.ua":true,"kv.ua":true,"kyiv.ua":true,"lg.ua":true,"lt.ua":true,"lugansk.ua":true,"lutsk.ua":true,"lv.ua":true,"lviv.ua":true,"mk.ua":true,"mykolaiv.ua":true,"nikolaev.ua":true,"od.ua":true,"odesa.ua":true,"odessa.ua":true,"pl.ua":true,"poltava.ua":true,"rivne.ua":true,"rovno.ua":true,"rv.ua":true,"sb.ua":true,"sebastopol.ua":true,"sevastopol.ua":true,"sm.ua":true,"sumy.ua":true,"te.ua":true,"ternopil.ua":true,"uz.ua":true,"uzhgorod.ua":true,"vinnica.ua":true,"vinnytsia.ua":true,"vn.ua":true,"volyn.ua":true,"yalta.ua":true,"zaporizhzhe.ua":true,"zaporizhzhia.ua":true,"zhitomir.ua":true,"zhytomyr.ua":true,"zp.ua":true,"zt.ua":true,"ug":true,"co.ug":true,"or.ug":true,"ac.ug":true,"sc.ug":true,"go.ug":true,"ne.ug":true,"com.ug":true,"org.ug":true,"uk":true,"ac.uk":true,"co.uk":true,"gov.uk":true,"ltd.uk":true,"me.uk":true,"net.uk":true,"nhs.uk":true,"org.uk":true,"plc.uk":true,"police.uk":true,"*.sch.uk":true,"us":true,"dni.us":true,"fed.us":true,"isa.us":true,"kids.us":true,"nsn.us":true,"ak.us":true,"al.us":true,"ar.us":true,"as.us":true,"az.us":true,"ca.us":true,"co.us":true,"ct.us":true,"dc.us":true,"de.us":true,"fl.us":true,"ga.us":true,"gu.us":true,"hi.us":true,"ia.us":true,"id.us":true,"il.us":true,"in.us":true,"ks.us":true,"ky.us":true,"la.us":true,"ma.us":true,"md.us":true,"me.us":true,"mi.us":true,"mn.us":true,"mo.us":true,"ms.us":true,"mt.us":true,"nc.us":true,"nd.us":true,"ne.us":true,"nh.us":true,"nj.us":true,"nm.us":true,"nv.us":true,"ny.us":true,"oh.us":true,"ok.us":true,"or.us":true,"pa.us":true,"pr.us":true,"ri.us":true,"sc.us":true,"sd.us":true,"tn.us":true,"tx.us":true,"ut.us":true,"vi.us":true,"vt.us":true,"va.us":true,"wa.us":true,"wi.us":true,"wv.us":true,"wy.us":true,"k12.ak.us":true,"k12.al.us":true,"k12.ar.us":true,"k12.as.us":true,"k12.az.us":true,"k12.ca.us":true,"k12.co.us":true,"k12.ct.us":true,"k12.dc.us":true,"k12.de.us":true,"k12.fl.us":true,"k12.ga.us":true,"k12.gu.us":true,"k12.ia.us":true,"k12.id.us":true,"k12.il.us":true,"k12.in.us":true,"k12.ks.us":true,"k12.ky.us":true,"k12.la.us":true,"k12.ma.us":true,"k12.md.us":true,"k12.me.us":true,"k12.mi.us":true,"k12.mn.us":true,"k12.mo.us":true,"k12.ms.us":true,"k12.mt.us":true,"k12.nc.us":true,"k12.ne.us":true,"k12.nh.us":true,"k12.nj.us":true,"k12.nm.us":true,"k12.nv.us":true,"k12.ny.us":true,"k12.oh.us":true,"k12.ok.us":true,"k12.or.us":true,"k12.pa.us":true,"k12.pr.us":true,"k12.ri.us":true,"k12.sc.us":true,"k12.tn.us":true,"k12.tx.us":true,"k12.ut.us":true,"k12.vi.us":true,"k12.vt.us":true,"k12.va.us":true,"k12.wa.us":true,"k12.wi.us":true,"k12.wy.us":true,"cc.ak.us":true,"cc.al.us":true,"cc.ar.us":true,"cc.as.us":true,"cc.az.us":true,"cc.ca.us":true,"cc.co.us":true,"cc.ct.us":true,"cc.dc.us":true,"cc.de.us":true,"cc.fl.us":true,"cc.ga.us":true,"cc.gu.us":true,"cc.hi.us":true,"cc.ia.us":true,"cc.id.us":true,"cc.il.us":true,"cc.in.us":true,"cc.ks.us":true,"cc.ky.us":true,"cc.la.us":true,"cc.ma.us":true,"cc.md.us":true,"cc.me.us":true,"cc.mi.us":true,"cc.mn.us":true,"cc.mo.us":true,"cc.ms.us":true,"cc.mt.us":true,"cc.nc.us":true,"cc.nd.us":true,"cc.ne.us":true,"cc.nh.us":true,"cc.nj.us":true,"cc.nm.us":true,"cc.nv.us":true,"cc.ny.us":true,"cc.oh.us":true,"cc.ok.us":true,"cc.or.us":true,"cc.pa.us":true,"cc.pr.us":true,"cc.ri.us":true,"cc.sc.us":true,"cc.sd.us":true,"cc.tn.us":true,"cc.tx.us":true,"cc.ut.us":true,"cc.vi.us":true,"cc.vt.us":true,"cc.va.us":true,"cc.wa.us":true,"cc.wi.us":true,"cc.wv.us":true,"cc.wy.us":true,"lib.ak.us":true,"lib.al.us":true,"lib.ar.us":true,"lib.as.us":true,"lib.az.us":true,"lib.ca.us":true,"lib.co.us":true,"lib.ct.us":true,"lib.dc.us":true,"lib.fl.us":true,"lib.ga.us":true,"lib.gu.us":true,"lib.hi.us":true,"lib.ia.us":true,"lib.id.us":true,"lib.il.us":true,"lib.in.us":true,"lib.ks.us":true,"lib.ky.us":true,"lib.la.us":true,"lib.ma.us":true,"lib.md.us":true,"lib.me.us":true,"lib.mi.us":true,"lib.mn.us":true,"lib.mo.us":true,"lib.ms.us":true,"lib.mt.us":true,"lib.nc.us":true,"lib.nd.us":true,"lib.ne.us":true,"lib.nh.us":true,"lib.nj.us":true,"lib.nm.us":true,"lib.nv.us":true,"lib.ny.us":true,"lib.oh.us":true,"lib.ok.us":true,"lib.or.us":true,"lib.pa.us":true,"lib.pr.us":true,"lib.ri.us":true,"lib.sc.us":true,"lib.sd.us":true,"lib.tn.us":true,"lib.tx.us":true,"lib.ut.us":true,"lib.vi.us":true,"lib.vt.us":true,"lib.va.us":true,"lib.wa.us":true,"lib.wi.us":true,"lib.wy.us":true,"pvt.k12.ma.us":true,"chtr.k12.ma.us":true,"paroch.k12.ma.us":true,"ann-arbor.mi.us":true,"cog.mi.us":true,"dst.mi.us":true,"eaton.mi.us":true,"gen.mi.us":true,"mus.mi.us":true,"tec.mi.us":true,"washtenaw.mi.us":true,"uy":true,"com.uy":true,"edu.uy":true,"gub.uy":true,"mil.uy":true,"net.uy":true,"org.uy":true,"uz":true,"co.uz":true,"com.uz":true,"net.uz":true,"org.uz":true,"va":true,"vc":true,"com.vc":true,"net.vc":true,"org.vc":true,"gov.vc":true,"mil.vc":true,"edu.vc":true,"ve":true,"arts.ve":true,"co.ve":true,"com.ve":true,"e12.ve":true,"edu.ve":true,"firm.ve":true,"gob.ve":true,"gov.ve":true,"info.ve":true,"int.ve":true,"mil.ve":true,"net.ve":true,"org.ve":true,"rec.ve":true,"store.ve":true,"tec.ve":true,"web.ve":true,"vg":true,"vi":true,"co.vi":true,"com.vi":true,"k12.vi":true,"net.vi":true,"org.vi":true,"vn":true,"com.vn":true,"net.vn":true,"org.vn":true,"edu.vn":true,"gov.vn":true,"int.vn":true,"ac.vn":true,"biz.vn":true,"info.vn":true,"name.vn":true,"pro.vn":true,"health.vn":true,"vu":true,"com.vu":true,"edu.vu":true,"net.vu":true,"org.vu":true,"wf":true,"ws":true,"com.ws":true,"net.ws":true,"org.ws":true,"gov.ws":true,"edu.ws":true,"yt":true,"xn--mgbaam7a8h":true,"xn--y9a3aq":true,"xn--54b7fta0cc":true,"xn--90ae":true,"xn--90ais":true,"xn--fiqs8s":true,"xn--fiqz9s":true,"xn--lgbbat1ad8j":true,"xn--wgbh1c":true,"xn--e1a4c":true,"xn--node":true,"xn--qxam":true,"xn--j6w193g":true,"xn--2scrj9c":true,"xn--3hcrj9c":true,"xn--45br5cyl":true,"xn--h2breg3eve":true,"xn--h2brj9c8c":true,"xn--mgbgu82a":true,"xn--rvc1e0am3e":true,"xn--h2brj9c":true,"xn--mgbbh1a71e":true,"xn--fpcrj9c3d":true,"xn--gecrj9c":true,"xn--s9brj9c":true,"xn--45brj9c":true,"xn--xkc2dl3a5ee0h":true,"xn--mgba3a4f16a":true,"xn--mgba3a4fra":true,"xn--mgbtx2b":true,"xn--mgbayh7gpa":true,"xn--3e0b707e":true,"xn--80ao21a":true,"xn--fzc2c9e2c":true,"xn--xkc2al3hye2a":true,"xn--mgbc0a9azcg":true,"xn--d1alf":true,"xn--l1acc":true,"xn--mix891f":true,"xn--mix082f":true,"xn--mgbx4cd0ab":true,"xn--mgb9awbf":true,"xn--mgbai9azgqp6j":true,"xn--mgbai9a5eva00b":true,"xn--ygbi2ammx":true,"xn--90a3ac":true,"xn--o1ac.xn--90a3ac":true,"xn--c1avg.xn--90a3ac":true,"xn--90azh.xn--90a3ac":true,"xn--d1at.xn--90a3ac":true,"xn--o1ach.xn--90a3ac":true,"xn--80au.xn--90a3ac":true,"xn--p1ai":true,"xn--wgbl6a":true,"xn--mgberp4a5d4ar":true,"xn--mgberp4a5d4a87g":true,"xn--mgbqly7c0a67fbc":true,"xn--mgbqly7cvafr":true,"xn--mgbpl2fh":true,"xn--yfro4i67o":true,"xn--clchc0ea0b2g2a9gcd":true,"xn--ogbpf8fl":true,"xn--mgbtf8fl":true,"xn--o3cw4h":true,"xn--12c1fe0br.xn--o3cw4h":true,"xn--12co0c3b4eva.xn--o3cw4h":true,"xn--h3cuzk1di.xn--o3cw4h":true,"xn--o3cyx2a.xn--o3cw4h":true,"xn--m3ch0j3a.xn--o3cw4h":true,"xn--12cfi8ixb8l.xn--o3cw4h":true,"xn--pgbs0dh":true,"xn--kpry57d":true,"xn--kprw13d":true,"xn--nnx388a":true,"xn--j1amh":true,"xn--mgb2ddes":true,"xxx":true,"*.ye":true,"ac.za":true,"agric.za":true,"alt.za":true,"co.za":true,"edu.za":true,"gov.za":true,"grondar.za":true,"law.za":true,"mil.za":true,"net.za":true,"ngo.za":true,"nis.za":true,"nom.za":true,"org.za":true,"school.za":true,"tm.za":true,"web.za":true,"zm":true,"ac.zm":true,"biz.zm":true,"co.zm":true,"com.zm":true,"edu.zm":true,"gov.zm":true,"info.zm":true,"mil.zm":true,"net.zm":true,"org.zm":true,"sch.zm":true,"zw":true,"ac.zw":true,"co.zw":true,"gov.zw":true,"mil.zw":true,"org.zw":true,"aaa":true,"aarp":true,"abarth":true,"abb":true,"abbott":true,"abbvie":true,"abc":true,"able":true,"abogado":true,"abudhabi":true,"academy":true,"accenture":true,"accountant":true,"accountants":true,"aco":true,"active":true,"actor":true,"adac":true,"ads":true,"adult":true,"aeg":true,"aetna":true,"afamilycompany":true,"afl":true,"africa":true,"agakhan":true,"agency":true,"aig":true,"aigo":true,"airbus":true,"airforce":true,"airtel":true,"akdn":true,"alfaromeo":true,"alibaba":true,"alipay":true,"allfinanz":true,"allstate":true,"ally":true,"alsace":true,"alstom":true,"americanexpress":true,"americanfamily":true,"amex":true,"amfam":true,"amica":true,"amsterdam":true,"analytics":true,"android":true,"anquan":true,"anz":true,"aol":true,"apartments":true,"app":true,"apple":true,"aquarelle":true,"arab":true,"aramco":true,"archi":true,"army":true,"art":true,"arte":true,"asda":true,"associates":true,"athleta":true,"attorney":true,"auction":true,"audi":true,"audible":true,"audio":true,"auspost":true,"author":true,"auto":true,"autos":true,"avianca":true,"aws":true,"axa":true,"azure":true,"baby":true,"baidu":true,"banamex":true,"bananarepublic":true,"band":true,"bank":true,"bar":true,"barcelona":true,"barclaycard":true,"barclays":true,"barefoot":true,"bargains":true,"baseball":true,"basketball":true,"bauhaus":true,"bayern":true,"bbc":true,"bbt":true,"bbva":true,"bcg":true,"bcn":true,"beats":true,"beauty":true,"beer":true,"bentley":true,"berlin":true,"best":true,"bestbuy":true,"bet":true,"bharti":true,"bible":true,"bid":true,"bike":true,"bing":true,"bingo":true,"bio":true,"black":true,"blackfriday":true,"blanco":true,"blockbuster":true,"blog":true,"bloomberg":true,"blue":true,"bms":true,"bmw":true,"bnl":true,"bnpparibas":true,"boats":true,"boehringer":true,"bofa":true,"bom":true,"bond":true,"boo":true,"book":true,"booking":true,"boots":true,"bosch":true,"bostik":true,"boston":true,"bot":true,"boutique":true,"box":true,"bradesco":true,"bridgestone":true,"broadway":true,"broker":true,"brother":true,"brussels":true,"budapest":true,"bugatti":true,"build":true,"builders":true,"business":true,"buy":true,"buzz":true,"bzh":true,"cab":true,"cafe":true,"cal":true,"call":true,"calvinklein":true,"cam":true,"camera":true,"camp":true,"cancerresearch":true,"canon":true,"capetown":true,"capital":true,"capitalone":true,"car":true,"caravan":true,"cards":true,"care":true,"career":true,"careers":true,"cars":true,"cartier":true,"casa":true,"case":true,"caseih":true,"cash":true,"casino":true,"catering":true,"catholic":true,"cba":true,"cbn":true,"cbre":true,"cbs":true,"ceb":true,"center":true,"ceo":true,"cern":true,"cfa":true,"cfd":true,"chanel":true,"channel":true,"chase":true,"chat":true,"cheap":true,"chintai":true,"christmas":true,"chrome":true,"chrysler":true,"church":true,"cipriani":true,"circle":true,"cisco":true,"citadel":true,"citi":true,"citic":true,"city":true,"cityeats":true,"claims":true,"cleaning":true,"click":true,"clinic":true,"clinique":true,"clothing":true,"cloud":true,"club":true,"clubmed":true,"coach":true,"codes":true,"coffee":true,"college":true,"cologne":true,"comcast":true,"commbank":true,"community":true,"company":true,"compare":true,"computer":true,"comsec":true,"condos":true,"construction":true,"consulting":true,"contact":true,"contractors":true,"cooking":true,"cookingchannel":true,"cool":true,"corsica":true,"country":true,"coupon":true,"coupons":true,"courses":true,"credit":true,"creditcard":true,"creditunion":true,"cricket":true,"crown":true,"crs":true,"cruise":true,"cruises":true,"csc":true,"cuisinella":true,"cymru":true,"cyou":true,"dabur":true,"dad":true,"dance":true,"data":true,"date":true,"dating":true,"datsun":true,"day":true,"dclk":true,"dds":true,"deal":true,"dealer":true,"deals":true,"degree":true,"delivery":true,"dell":true,"deloitte":true,"delta":true,"democrat":true,"dental":true,"dentist":true,"desi":true,"design":true,"dev":true,"dhl":true,"diamonds":true,"diet":true,"digital":true,"direct":true,"directory":true,"discount":true,"discover":true,"dish":true,"diy":true,"dnp":true,"docs":true,"doctor":true,"dodge":true,"dog":true,"doha":true,"domains":true,"dot":true,"download":true,"drive":true,"dtv":true,"dubai":true,"duck":true,"dunlop":true,"duns":true,"dupont":true,"durban":true,"dvag":true,"dvr":true,"earth":true,"eat":true,"eco":true,"edeka":true,"education":true,"email":true,"emerck":true,"energy":true,"engineer":true,"engineering":true,"enterprises":true,"epost":true,"epson":true,"equipment":true,"ericsson":true,"erni":true,"esq":true,"estate":true,"esurance":true,"etisalat":true,"eurovision":true,"eus":true,"events":true,"everbank":true,"exchange":true,"expert":true,"exposed":true,"express":true,"extraspace":true,"fage":true,"fail":true,"fairwinds":true,"faith":true,"family":true,"fan":true,"fans":true,"farm":true,"farmers":true,"fashion":true,"fast":true,"fedex":true,"feedback":true,"ferrari":true,"ferrero":true,"fiat":true,"fidelity":true,"fido":true,"film":true,"final":true,"finance":true,"financial":true,"fire":true,"firestone":true,"firmdale":true,"fish":true,"fishing":true,"fit":true,"fitness":true,"flickr":true,"flights":true,"flir":true,"florist":true,"flowers":true,"fly":true,"foo":true,"food":true,"foodnetwork":true,"football":true,"ford":true,"forex":true,"forsale":true,"forum":true,"foundation":true,"fox":true,"free":true,"fresenius":true,"frl":true,"frogans":true,"frontdoor":true,"frontier":true,"ftr":true,"fujitsu":true,"fujixerox":true,"fun":true,"fund":true,"furniture":true,"futbol":true,"fyi":true,"gal":true,"gallery":true,"gallo":true,"gallup":true,"game":true,"games":true,"gap":true,"garden":true,"gbiz":true,"gdn":true,"gea":true,"gent":true,"genting":true,"george":true,"ggee":true,"gift":true,"gifts":true,"gives":true,"giving":true,"glade":true,"glass":true,"gle":true,"global":true,"globo":true,"gmail":true,"gmbh":true,"gmo":true,"gmx":true,"godaddy":true,"gold":true,"goldpoint":true,"golf":true,"goo":true,"goodhands":true,"goodyear":true,"goog":true,"google":true,"gop":true,"got":true,"grainger":true,"graphics":true,"gratis":true,"green":true,"gripe":true,"grocery":true,"group":true,"guardian":true,"gucci":true,"guge":true,"guide":true,"guitars":true,"guru":true,"hair":true,"hamburg":true,"hangout":true,"haus":true,"hbo":true,"hdfc":true,"hdfcbank":true,"health":true,"healthcare":true,"help":true,"helsinki":true,"here":true,"hermes":true,"hgtv":true,"hiphop":true,"hisamitsu":true,"hitachi":true,"hiv":true,"hkt":true,"hockey":true,"holdings":true,"holiday":true,"homedepot":true,"homegoods":true,"homes":true,"homesense":true,"honda":true,"honeywell":true,"horse":true,"hospital":true,"host":true,"hosting":true,"hot":true,"hoteles":true,"hotels":true,"hotmail":true,"house":true,"how":true,"hsbc":true,"hughes":true,"hyatt":true,"hyundai":true,"ibm":true,"icbc":true,"ice":true,"icu":true,"ieee":true,"ifm":true,"ikano":true,"imamat":true,"imdb":true,"immo":true,"immobilien":true,"industries":true,"infiniti":true,"ing":true,"ink":true,"institute":true,"insurance":true,"insure":true,"intel":true,"international":true,"intuit":true,"investments":true,"ipiranga":true,"irish":true,"iselect":true,"ismaili":true,"ist":true,"istanbul":true,"itau":true,"itv":true,"iveco":true,"iwc":true,"jaguar":true,"java":true,"jcb":true,"jcp":true,"jeep":true,"jetzt":true,"jewelry":true,"jio":true,"jlc":true,"jll":true,"jmp":true,"jnj":true,"joburg":true,"jot":true,"joy":true,"jpmorgan":true,"jprs":true,"juegos":true,"juniper":true,"kaufen":true,"kddi":true,"kerryhotels":true,"kerrylogistics":true,"kerryproperties":true,"kfh":true,"kia":true,"kim":true,"kinder":true,"kindle":true,"kitchen":true,"kiwi":true,"koeln":true,"komatsu":true,"kosher":true,"kpmg":true,"kpn":true,"krd":true,"kred":true,"kuokgroup":true,"kyoto":true,"lacaixa":true,"ladbrokes":true,"lamborghini":true,"lamer":true,"lancaster":true,"lancia":true,"lancome":true,"land":true,"landrover":true,"lanxess":true,"lasalle":true,"lat":true,"latino":true,"latrobe":true,"law":true,"lawyer":true,"lds":true,"lease":true,"leclerc":true,"lefrak":true,"legal":true,"lego":true,"lexus":true,"lgbt":true,"liaison":true,"lidl":true,"life":true,"lifeinsurance":true,"lifestyle":true,"lighting":true,"like":true,"lilly":true,"limited":true,"limo":true,"lincoln":true,"linde":true,"link":true,"lipsy":true,"live":true,"living":true,"lixil":true,"loan":true,"loans":true,"locker":true,"locus":true,"loft":true,"lol":true,"london":true,"lotte":true,"lotto":true,"love":true,"lpl":true,"lplfinancial":true,"ltd":true,"ltda":true,"lundbeck":true,"lupin":true,"luxe":true,"luxury":true,"macys":true,"madrid":true,"maif":true,"maison":true,"makeup":true,"man":true,"management":true,"mango":true,"map":true,"market":true,"marketing":true,"markets":true,"marriott":true,"marshalls":true,"maserati":true,"mattel":true,"mba":true,"mckinsey":true,"med":true,"media":true,"meet":true,"melbourne":true,"meme":true,"memorial":true,"men":true,"menu":true,"meo":true,"merckmsd":true,"metlife":true,"miami":true,"microsoft":true,"mini":true,"mint":true,"mit":true,"mitsubishi":true,"mlb":true,"mls":true,"mma":true,"mobile":true,"mobily":true,"moda":true,"moe":true,"moi":true,"mom":true,"monash":true,"money":true,"monster":true,"mopar":true,"mormon":true,"mortgage":true,"moscow":true,"moto":true,"motorcycles":true,"mov":true,"movie":true,"movistar":true,"msd":true,"mtn":true,"mtpc":true,"mtr":true,"mutual":true,"nab":true,"nadex":true,"nagoya":true,"nationwide":true,"natura":true,"navy":true,"nba":true,"nec":true,"netbank":true,"netflix":true,"network":true,"neustar":true,"new":true,"newholland":true,"news":true,"next":true,"nextdirect":true,"nexus":true,"nfl":true,"ngo":true,"nhk":true,"nico":true,"nike":true,"nikon":true,"ninja":true,"nissan":true,"nissay":true,"nokia":true,"northwesternmutual":true,"norton":true,"now":true,"nowruz":true,"nowtv":true,"nra":true,"nrw":true,"ntt":true,"nyc":true,"obi":true,"observer":true,"off":true,"office":true,"okinawa":true,"olayan":true,"olayangroup":true,"oldnavy":true,"ollo":true,"omega":true,"one":true,"ong":true,"onl":true,"online":true,"onyourside":true,"ooo":true,"open":true,"oracle":true,"orange":true,"organic":true,"origins":true,"osaka":true,"otsuka":true,"ott":true,"ovh":true,"page":true,"panasonic":true,"panerai":true,"paris":true,"pars":true,"partners":true,"parts":true,"party":true,"passagens":true,"pay":true,"pccw":true,"pet":true,"pfizer":true,"pharmacy":true,"phd":true,"philips":true,"phone":true,"photo":true,"photography":true,"photos":true,"physio":true,"piaget":true,"pics":true,"pictet":true,"pictures":true,"pid":true,"pin":true,"ping":true,"pink":true,"pioneer":true,"pizza":true,"place":true,"play":true,"playstation":true,"plumbing":true,"plus":true,"pnc":true,"pohl":true,"poker":true,"politie":true,"porn":true,"pramerica":true,"praxi":true,"press":true,"prime":true,"prod":true,"productions":true,"prof":true,"progressive":true,"promo":true,"properties":true,"property":true,"protection":true,"pru":true,"prudential":true,"pub":true,"pwc":true,"qpon":true,"quebec":true,"quest":true,"qvc":true,"racing":true,"radio":true,"raid":true,"read":true,"realestate":true,"realtor":true,"realty":true,"recipes":true,"red":true,"redstone":true,"redumbrella":true,"rehab":true,"reise":true,"reisen":true,"reit":true,"reliance":true,"ren":true,"rent":true,"rentals":true,"repair":true,"report":true,"republican":true,"rest":true,"restaurant":true,"review":true,"reviews":true,"rexroth":true,"rich":true,"richardli":true,"ricoh":true,"rightathome":true,"ril":true,"rio":true,"rip":true,"rmit":true,"rocher":true,"rocks":true,"rodeo":true,"rogers":true,"room":true,"rsvp":true,"rugby":true,"ruhr":true,"run":true,"rwe":true,"ryukyu":true,"saarland":true,"safe":true,"safety":true,"sakura":true,"sale":true,"salon":true,"samsclub":true,"samsung":true,"sandvik":true,"sandvikcoromant":true,"sanofi":true,"sap":true,"sapo":true,"sarl":true,"sas":true,"save":true,"saxo":true,"sbi":true,"sbs":true,"sca":true,"scb":true,"schaeffler":true,"schmidt":true,"scholarships":true,"school":true,"schule":true,"schwarz":true,"science":true,"scjohnson":true,"scor":true,"scot":true,"search":true,"seat":true,"secure":true,"security":true,"seek":true,"select":true,"sener":true,"services":true,"ses":true,"seven":true,"sew":true,"sex":true,"sexy":true,"sfr":true,"shangrila":true,"sharp":true,"shaw":true,"shell":true,"shia":true,"shiksha":true,"shoes":true,"shop":true,"shopping":true,"shouji":true,"show":true,"showtime":true,"shriram":true,"silk":true,"sina":true,"singles":true,"site":true,"ski":true,"skin":true,"sky":true,"skype":true,"sling":true,"smart":true,"smile":true,"sncf":true,"soccer":true,"social":true,"softbank":true,"software":true,"sohu":true,"solar":true,"solutions":true,"song":true,"sony":true,"soy":true,"space":true,"spiegel":true,"spot":true,"spreadbetting":true,"srl":true,"srt":true,"stada":true,"staples":true,"star":true,"starhub":true,"statebank":true,"statefarm":true,"statoil":true,"stc":true,"stcgroup":true,"stockholm":true,"storage":true,"store":true,"stream":true,"studio":true,"study":true,"style":true,"sucks":true,"supplies":true,"supply":true,"support":true,"surf":true,"surgery":true,"suzuki":true,"swatch":true,"swiftcover":true,"swiss":true,"sydney":true,"symantec":true,"systems":true,"tab":true,"taipei":true,"talk":true,"taobao":true,"target":true,"tatamotors":true,"tatar":true,"tattoo":true,"tax":true,"taxi":true,"tci":true,"tdk":true,"team":true,"tech":true,"technology":true,"telecity":true,"telefonica":true,"temasek":true,"tennis":true,"teva":true,"thd":true,"theater":true,"theatre":true,"tiaa":true,"tickets":true,"tienda":true,"tiffany":true,"tips":true,"tires":true,"tirol":true,"tjmaxx":true,"tjx":true,"tkmaxx":true,"tmall":true,"today":true,"tokyo":true,"tools":true,"top":true,"toray":true,"toshiba":true,"total":true,"tours":true,"town":true,"toyota":true,"toys":true,"trade":true,"trading":true,"training":true,"travelchannel":true,"travelers":true,"travelersinsurance":true,"trust":true,"trv":true,"tube":true,"tui":true,"tunes":true,"tushu":true,"tvs":true,"ubank":true,"ubs":true,"uconnect":true,"unicom":true,"university":true,"uno":true,"uol":true,"ups":true,"vacations":true,"vana":true,"vanguard":true,"vegas":true,"ventures":true,"verisign":true,"versicherung":true,"vet":true,"viajes":true,"video":true,"vig":true,"viking":true,"villas":true,"vin":true,"vip":true,"virgin":true,"visa":true,"vision":true,"vista":true,"vistaprint":true,"viva":true,"vivo":true,"vlaanderen":true,"vodka":true,"volkswagen":true,"volvo":true,"vote":true,"voting":true,"voto":true,"voyage":true,"vuelos":true,"wales":true,"walmart":true,"walter":true,"wang":true,"wanggou":true,"warman":true,"watch":true,"watches":true,"weather":true,"weatherchannel":true,"webcam":true,"weber":true,"website":true,"wed":true,"wedding":true,"weibo":true,"weir":true,"whoswho":true,"wien":true,"wiki":true,"williamhill":true,"win":true,"windows":true,"wine":true,"winners":true,"wme":true,"wolterskluwer":true,"woodside":true,"work":true,"works":true,"world":true,"wow":true,"wtc":true,"wtf":true,"xbox":true,"xerox":true,"xfinity":true,"xihuan":true,"xin":true,"xn--11b4c3d":true,"xn--1ck2e1b":true,"xn--1qqw23a":true,"xn--30rr7y":true,"xn--3bst00m":true,"xn--3ds443g":true,"xn--3oq18vl8pn36a":true,"xn--3pxu8k":true,"xn--42c2d9a":true,"xn--45q11c":true,"xn--4gbrim":true,"xn--55qw42g":true,"xn--55qx5d":true,"xn--5su34j936bgsg":true,"xn--5tzm5g":true,"xn--6frz82g":true,"xn--6qq986b3xl":true,"xn--80adxhks":true,"xn--80aqecdr1a":true,"xn--80asehdb":true,"xn--80aswg":true,"xn--8y0a063a":true,"xn--9dbq2a":true,"xn--9et52u":true,"xn--9krt00a":true,"xn--b4w605ferd":true,"xn--bck1b9a5dre4c":true,"xn--c1avg":true,"xn--c2br7g":true,"xn--cck2b3b":true,"xn--cg4bki":true,"xn--czr694b":true,"xn--czrs0t":true,"xn--czru2d":true,"xn--d1acj3b":true,"xn--eckvdtc9d":true,"xn--efvy88h":true,"xn--estv75g":true,"xn--fct429k":true,"xn--fhbei":true,"xn--fiq228c5hs":true,"xn--fiq64b":true,"xn--fjq720a":true,"xn--flw351e":true,"xn--fzys8d69uvgm":true,"xn--g2xx48c":true,"xn--gckr3f0f":true,"xn--gk3at1e":true,"xn--hxt814e":true,"xn--i1b6b1a6a2e":true,"xn--imr513n":true,"xn--io0a7i":true,"xn--j1aef":true,"xn--jlq61u9w7b":true,"xn--jvr189m":true,"xn--kcrx77d1x4a":true,"xn--kpu716f":true,"xn--kput3i":true,"xn--mgba3a3ejt":true,"xn--mgba7c0bbn0a":true,"xn--mgbaakc7dvf":true,"xn--mgbab2bd":true,"xn--mgbb9fbpob":true,"xn--mgbca7dzdo":true,"xn--mgbi4ecexp":true,"xn--mgbt3dhd":true,"xn--mk1bu44c":true,"xn--mxtq1m":true,"xn--ngbc5azd":true,"xn--ngbe9e0a":true,"xn--ngbrx":true,"xn--nqv7f":true,"xn--nqv7fs00ema":true,"xn--nyqy26a":true,"xn--p1acf":true,"xn--pbt977c":true,"xn--pssy2u":true,"xn--q9jyb4c":true,"xn--qcka1pmc":true,"xn--rhqv96g":true,"xn--rovu88b":true,"xn--ses554g":true,"xn--t60b56a":true,"xn--tckwe":true,"xn--tiq49xqyj":true,"xn--unup4y":true,"xn--vermgensberater-ctb":true,"xn--vermgensberatung-pwb":true,"xn--vhquv":true,"xn--vuq861b":true,"xn--w4r85el8fhu5dnra":true,"xn--w4rs40l":true,"xn--xhq521b":true,"xn--zfr164b":true,"xperia":true,"xyz":true,"yachts":true,"yahoo":true,"yamaxun":true,"yandex":true,"yodobashi":true,"yoga":true,"yokohama":true,"you":true,"youtube":true,"yun":true,"zappos":true,"zara":true,"zero":true,"zip":true,"zippo":true,"zone":true,"zuerich":true,"cc.ua":true,"inf.ua":true,"ltd.ua":true,"1password.ca":true,"1password.com":true,"1password.eu":true,"beep.pl":true,"*.compute.estate":true,"*.alces.network":true,"alwaysdata.net":true,"cloudfront.net":true,"*.compute.amazonaws.com":true,"*.compute-1.amazonaws.com":true,"*.compute.amazonaws.com.cn":true,"us-east-1.amazonaws.com":true,"cn-north-1.eb.amazonaws.com.cn":true,"elasticbeanstalk.com":true,"ap-northeast-1.elasticbeanstalk.com":true,"ap-northeast-2.elasticbeanstalk.com":true,"ap-south-1.elasticbeanstalk.com":true,"ap-southeast-1.elasticbeanstalk.com":true,"ap-southeast-2.elasticbeanstalk.com":true,"ca-central-1.elasticbeanstalk.com":true,"eu-central-1.elasticbeanstalk.com":true,"eu-west-1.elasticbeanstalk.com":true,"eu-west-2.elasticbeanstalk.com":true,"eu-west-3.elasticbeanstalk.com":true,"sa-east-1.elasticbeanstalk.com":true,"us-east-1.elasticbeanstalk.com":true,"us-east-2.elasticbeanstalk.com":true,"us-gov-west-1.elasticbeanstalk.com":true,"us-west-1.elasticbeanstalk.com":true,"us-west-2.elasticbeanstalk.com":true,"*.elb.amazonaws.com":true,"*.elb.amazonaws.com.cn":true,"s3.amazonaws.com":true,"s3-ap-northeast-1.amazonaws.com":true,"s3-ap-northeast-2.amazonaws.com":true,"s3-ap-south-1.amazonaws.com":true,"s3-ap-southeast-1.amazonaws.com":true,"s3-ap-southeast-2.amazonaws.com":true,"s3-ca-central-1.amazonaws.com":true,"s3-eu-central-1.amazonaws.com":true,"s3-eu-west-1.amazonaws.com":true,"s3-eu-west-2.amazonaws.com":true,"s3-eu-west-3.amazonaws.com":true,"s3-external-1.amazonaws.com":true,"s3-fips-us-gov-west-1.amazonaws.com":true,"s3-sa-east-1.amazonaws.com":true,"s3-us-gov-west-1.amazonaws.com":true,"s3-us-east-2.amazonaws.com":true,"s3-us-west-1.amazonaws.com":true,"s3-us-west-2.amazonaws.com":true,"s3.ap-northeast-2.amazonaws.com":true,"s3.ap-south-1.amazonaws.com":true,"s3.cn-north-1.amazonaws.com.cn":true,"s3.ca-central-1.amazonaws.com":true,"s3.eu-central-1.amazonaws.com":true,"s3.eu-west-2.amazonaws.com":true,"s3.eu-west-3.amazonaws.com":true,"s3.us-east-2.amazonaws.com":true,"s3.dualstack.ap-northeast-1.amazonaws.com":true,"s3.dualstack.ap-northeast-2.amazonaws.com":true,"s3.dualstack.ap-south-1.amazonaws.com":true,"s3.dualstack.ap-southeast-1.amazonaws.com":true,"s3.dualstack.ap-southeast-2.amazonaws.com":true,"s3.dualstack.ca-central-1.amazonaws.com":true,"s3.dualstack.eu-central-1.amazonaws.com":true,"s3.dualstack.eu-west-1.amazonaws.com":true,"s3.dualstack.eu-west-2.amazonaws.com":true,"s3.dualstack.eu-west-3.amazonaws.com":true,"s3.dualstack.sa-east-1.amazonaws.com":true,"s3.dualstack.us-east-1.amazonaws.com":true,"s3.dualstack.us-east-2.amazonaws.com":true,"s3-website-us-east-1.amazonaws.com":true,"s3-website-us-west-1.amazonaws.com":true,"s3-website-us-west-2.amazonaws.com":true,"s3-website-ap-northeast-1.amazonaws.com":true,"s3-website-ap-southeast-1.amazonaws.com":true,"s3-website-ap-southeast-2.amazonaws.com":true,"s3-website-eu-west-1.amazonaws.com":true,"s3-website-sa-east-1.amazonaws.com":true,"s3-website.ap-northeast-2.amazonaws.com":true,"s3-website.ap-south-1.amazonaws.com":true,"s3-website.ca-central-1.amazonaws.com":true,"s3-website.eu-central-1.amazonaws.com":true,"s3-website.eu-west-2.amazonaws.com":true,"s3-website.eu-west-3.amazonaws.com":true,"s3-website.us-east-2.amazonaws.com":true,"t3l3p0rt.net":true,"tele.amune.org":true,"on-aptible.com":true,"user.party.eus":true,"pimienta.org":true,"poivron.org":true,"potager.org":true,"sweetpepper.org":true,"myasustor.com":true,"myfritz.net":true,"*.awdev.ca":true,"*.advisor.ws":true,"backplaneapp.io":true,"betainabox.com":true,"bnr.la":true,"boomla.net":true,"boxfuse.io":true,"square7.ch":true,"bplaced.com":true,"bplaced.de":true,"square7.de":true,"bplaced.net":true,"square7.net":true,"browsersafetymark.io":true,"mycd.eu":true,"ae.org":true,"ar.com":true,"br.com":true,"cn.com":true,"com.de":true,"com.se":true,"de.com":true,"eu.com":true,"gb.com":true,"gb.net":true,"hu.com":true,"hu.net":true,"jp.net":true,"jpn.com":true,"kr.com":true,"mex.com":true,"no.com":true,"qc.com":true,"ru.com":true,"sa.com":true,"se.com":true,"se.net":true,"uk.com":true,"uk.net":true,"us.com":true,"uy.com":true,"za.bz":true,"za.com":true,"africa.com":true,"gr.com":true,"in.net":true,"us.org":true,"co.com":true,"c.la":true,"certmgr.org":true,"xenapponazure.com":true,"virtueeldomein.nl":true,"c66.me":true,"cloud66.ws":true,"jdevcloud.com":true,"wpdevcloud.com":true,"cloudaccess.host":true,"freesite.host":true,"cloudaccess.net":true,"cloudcontrolled.com":true,"cloudcontrolapp.com":true,"co.ca":true,"co.cz":true,"c.cdn77.org":true,"cdn77-ssl.net":true,"r.cdn77.net":true,"rsc.cdn77.org":true,"ssl.origin.cdn77-secure.org":true,"cloudns.asia":true,"cloudns.biz":true,"cloudns.club":true,"cloudns.cc":true,"cloudns.eu":true,"cloudns.in":true,"cloudns.info":true,"cloudns.org":true,"cloudns.pro":true,"cloudns.pw":true,"cloudns.us":true,"co.nl":true,"co.no":true,"webhosting.be":true,"hosting-cluster.nl":true,"dyn.cosidns.de":true,"dynamisches-dns.de":true,"dnsupdater.de":true,"internet-dns.de":true,"l-o-g-i-n.de":true,"dynamic-dns.info":true,"feste-ip.net":true,"knx-server.net":true,"static-access.net":true,"realm.cz":true,"*.cryptonomic.net":true,"cupcake.is":true,"cyon.link":true,"cyon.site":true,"daplie.me":true,"localhost.daplie.me":true,"biz.dk":true,"co.dk":true,"firm.dk":true,"reg.dk":true,"store.dk":true,"debian.net":true,"dedyn.io":true,"dnshome.de":true,"drayddns.com":true,"dreamhosters.com":true,"mydrobo.com":true,"drud.io":true,"drud.us":true,"duckdns.org":true,"dy.fi":true,"tunk.org":true,"dyndns-at-home.com":true,"dyndns-at-work.com":true,"dyndns-blog.com":true,"dyndns-free.com":true,"dyndns-home.com":true,"dyndns-ip.com":true,"dyndns-mail.com":true,"dyndns-office.com":true,"dyndns-pics.com":true,"dyndns-remote.com":true,"dyndns-server.com":true,"dyndns-web.com":true,"dyndns-wiki.com":true,"dyndns-work.com":true,"dyndns.biz":true,"dyndns.info":true,"dyndns.org":true,"dyndns.tv":true,"at-band-camp.net":true,"ath.cx":true,"barrel-of-knowledge.info":true,"barrell-of-knowledge.info":true,"better-than.tv":true,"blogdns.com":true,"blogdns.net":true,"blogdns.org":true,"blogsite.org":true,"boldlygoingnowhere.org":true,"broke-it.net":true,"buyshouses.net":true,"cechire.com":true,"dnsalias.com":true,"dnsalias.net":true,"dnsalias.org":true,"dnsdojo.com":true,"dnsdojo.net":true,"dnsdojo.org":true,"does-it.net":true,"doesntexist.com":true,"doesntexist.org":true,"dontexist.com":true,"dontexist.net":true,"dontexist.org":true,"doomdns.com":true,"doomdns.org":true,"dvrdns.org":true,"dyn-o-saur.com":true,"dynalias.com":true,"dynalias.net":true,"dynalias.org":true,"dynathome.net":true,"dyndns.ws":true,"endofinternet.net":true,"endofinternet.org":true,"endoftheinternet.org":true,"est-a-la-maison.com":true,"est-a-la-masion.com":true,"est-le-patron.com":true,"est-mon-blogueur.com":true,"for-better.biz":true,"for-more.biz":true,"for-our.info":true,"for-some.biz":true,"for-the.biz":true,"forgot.her.name":true,"forgot.his.name":true,"from-ak.com":true,"from-al.com":true,"from-ar.com":true,"from-az.net":true,"from-ca.com":true,"from-co.net":true,"from-ct.com":true,"from-dc.com":true,"from-de.com":true,"from-fl.com":true,"from-ga.com":true,"from-hi.com":true,"from-ia.com":true,"from-id.com":true,"from-il.com":true,"from-in.com":true,"from-ks.com":true,"from-ky.com":true,"from-la.net":true,"from-ma.com":true,"from-md.com":true,"from-me.org":true,"from-mi.com":true,"from-mn.com":true,"from-mo.com":true,"from-ms.com":true,"from-mt.com":true,"from-nc.com":true,"from-nd.com":true,"from-ne.com":true,"from-nh.com":true,"from-nj.com":true,"from-nm.com":true,"from-nv.com":true,"from-ny.net":true,"from-oh.com":true,"from-ok.com":true,"from-or.com":true,"from-pa.com":true,"from-pr.com":true,"from-ri.com":true,"from-sc.com":true,"from-sd.com":true,"from-tn.com":true,"from-tx.com":true,"from-ut.com":true,"from-va.com":true,"from-vt.com":true,"from-wa.com":true,"from-wi.com":true,"from-wv.com":true,"from-wy.com":true,"ftpaccess.cc":true,"fuettertdasnetz.de":true,"game-host.org":true,"game-server.cc":true,"getmyip.com":true,"gets-it.net":true,"go.dyndns.org":true,"gotdns.com":true,"gotdns.org":true,"groks-the.info":true,"groks-this.info":true,"ham-radio-op.net":true,"here-for-more.info":true,"hobby-site.com":true,"hobby-site.org":true,"home.dyndns.org":true,"homedns.org":true,"homeftp.net":true,"homeftp.org":true,"homeip.net":true,"homelinux.com":true,"homelinux.net":true,"homelinux.org":true,"homeunix.com":true,"homeunix.net":true,"homeunix.org":true,"iamallama.com":true,"in-the-band.net":true,"is-a-anarchist.com":true,"is-a-blogger.com":true,"is-a-bookkeeper.com":true,"is-a-bruinsfan.org":true,"is-a-bulls-fan.com":true,"is-a-candidate.org":true,"is-a-caterer.com":true,"is-a-celticsfan.org":true,"is-a-chef.com":true,"is-a-chef.net":true,"is-a-chef.org":true,"is-a-conservative.com":true,"is-a-cpa.com":true,"is-a-cubicle-slave.com":true,"is-a-democrat.com":true,"is-a-designer.com":true,"is-a-doctor.com":true,"is-a-financialadvisor.com":true,"is-a-geek.com":true,"is-a-geek.net":true,"is-a-geek.org":true,"is-a-green.com":true,"is-a-guru.com":true,"is-a-hard-worker.com":true,"is-a-hunter.com":true,"is-a-knight.org":true,"is-a-landscaper.com":true,"is-a-lawyer.com":true,"is-a-liberal.com":true,"is-a-libertarian.com":true,"is-a-linux-user.org":true,"is-a-llama.com":true,"is-a-musician.com":true,"is-a-nascarfan.com":true,"is-a-nurse.com":true,"is-a-painter.com":true,"is-a-patsfan.org":true,"is-a-personaltrainer.com":true,"is-a-photographer.com":true,"is-a-player.com":true,"is-a-republican.com":true,"is-a-rockstar.com":true,"is-a-socialist.com":true,"is-a-soxfan.org":true,"is-a-student.com":true,"is-a-teacher.com":true,"is-a-techie.com":true,"is-a-therapist.com":true,"is-an-accountant.com":true,"is-an-actor.com":true,"is-an-actress.com":true,"is-an-anarchist.com":true,"is-an-artist.com":true,"is-an-engineer.com":true,"is-an-entertainer.com":true,"is-by.us":true,"is-certified.com":true,"is-found.org":true,"is-gone.com":true,"is-into-anime.com":true,"is-into-cars.com":true,"is-into-cartoons.com":true,"is-into-games.com":true,"is-leet.com":true,"is-lost.org":true,"is-not-certified.com":true,"is-saved.org":true,"is-slick.com":true,"is-uberleet.com":true,"is-very-bad.org":true,"is-very-evil.org":true,"is-very-good.org":true,"is-very-nice.org":true,"is-very-sweet.org":true,"is-with-theband.com":true,"isa-geek.com":true,"isa-geek.net":true,"isa-geek.org":true,"isa-hockeynut.com":true,"issmarterthanyou.com":true,"isteingeek.de":true,"istmein.de":true,"kicks-ass.net":true,"kicks-ass.org":true,"knowsitall.info":true,"land-4-sale.us":true,"lebtimnetz.de":true,"leitungsen.de":true,"likes-pie.com":true,"likescandy.com":true,"merseine.nu":true,"mine.nu":true,"misconfused.org":true,"mypets.ws":true,"myphotos.cc":true,"neat-url.com":true,"office-on-the.net":true,"on-the-web.tv":true,"podzone.net":true,"podzone.org":true,"readmyblog.org":true,"saves-the-whales.com":true,"scrapper-site.net":true,"scrapping.cc":true,"selfip.biz":true,"selfip.com":true,"selfip.info":true,"selfip.net":true,"selfip.org":true,"sells-for-less.com":true,"sells-for-u.com":true,"sells-it.net":true,"sellsyourhome.org":true,"servebbs.com":true,"servebbs.net":true,"servebbs.org":true,"serveftp.net":true,"serveftp.org":true,"servegame.org":true,"shacknet.nu":true,"simple-url.com":true,"space-to-rent.com":true,"stuff-4-sale.org":true,"stuff-4-sale.us":true,"teaches-yoga.com":true,"thruhere.net":true,"traeumtgerade.de":true,"webhop.biz":true,"webhop.info":true,"webhop.net":true,"webhop.org":true,"worse-than.tv":true,"writesthisblog.com":true,"ddnss.de":true,"dyn.ddnss.de":true,"dyndns.ddnss.de":true,"dyndns1.de":true,"dyn-ip24.de":true,"home-webserver.de":true,"dyn.home-webserver.de":true,"myhome-server.de":true,"ddnss.org":true,"definima.net":true,"definima.io":true,"ddnsfree.com":true,"ddnsgeek.com":true,"giize.com":true,"gleeze.com":true,"kozow.com":true,"loseyourip.com":true,"ooguy.com":true,"theworkpc.com":true,"casacam.net":true,"dynu.net":true,"accesscam.org":true,"camdvr.org":true,"freeddns.org":true,"mywire.org":true,"webredirect.org":true,"myddns.rocks":true,"blogsite.xyz":true,"dynv6.net":true,"e4.cz":true,"mytuleap.com":true,"enonic.io":true,"customer.enonic.io":true,"eu.org":true,"al.eu.org":true,"asso.eu.org":true,"at.eu.org":true,"au.eu.org":true,"be.eu.org":true,"bg.eu.org":true,"ca.eu.org":true,"cd.eu.org":true,"ch.eu.org":true,"cn.eu.org":true,"cy.eu.org":true,"cz.eu.org":true,"de.eu.org":true,"dk.eu.org":true,"edu.eu.org":true,"ee.eu.org":true,"es.eu.org":true,"fi.eu.org":true,"fr.eu.org":true,"gr.eu.org":true,"hr.eu.org":true,"hu.eu.org":true,"ie.eu.org":true,"il.eu.org":true,"in.eu.org":true,"int.eu.org":true,"is.eu.org":true,"it.eu.org":true,"jp.eu.org":true,"kr.eu.org":true,"lt.eu.org":true,"lu.eu.org":true,"lv.eu.org":true,"mc.eu.org":true,"me.eu.org":true,"mk.eu.org":true,"mt.eu.org":true,"my.eu.org":true,"net.eu.org":true,"ng.eu.org":true,"nl.eu.org":true,"no.eu.org":true,"nz.eu.org":true,"paris.eu.org":true,"pl.eu.org":true,"pt.eu.org":true,"q-a.eu.org":true,"ro.eu.org":true,"ru.eu.org":true,"se.eu.org":true,"si.eu.org":true,"sk.eu.org":true,"tr.eu.org":true,"uk.eu.org":true,"us.eu.org":true,"eu-1.evennode.com":true,"eu-2.evennode.com":true,"eu-3.evennode.com":true,"eu-4.evennode.com":true,"us-1.evennode.com":true,"us-2.evennode.com":true,"us-3.evennode.com":true,"us-4.evennode.com":true,"twmail.cc":true,"twmail.net":true,"twmail.org":true,"mymailer.com.tw":true,"url.tw":true,"apps.fbsbx.com":true,"ru.net":true,"adygeya.ru":true,"bashkiria.ru":true,"bir.ru":true,"cbg.ru":true,"com.ru":true,"dagestan.ru":true,"grozny.ru":true,"kalmykia.ru":true,"kustanai.ru":true,"marine.ru":true,"mordovia.ru":true,"msk.ru":true,"mytis.ru":true,"nalchik.ru":true,"nov.ru":true,"pyatigorsk.ru":true,"spb.ru":true,"vladikavkaz.ru":true,"vladimir.ru":true,"abkhazia.su":true,"adygeya.su":true,"aktyubinsk.su":true,"arkhangelsk.su":true,"armenia.su":true,"ashgabad.su":true,"azerbaijan.su":true,"balashov.su":true,"bashkiria.su":true,"bryansk.su":true,"bukhara.su":true,"chimkent.su":true,"dagestan.su":true,"east-kazakhstan.su":true,"exnet.su":true,"georgia.su":true,"grozny.su":true,"ivanovo.su":true,"jambyl.su":true,"kalmykia.su":true,"kaluga.su":true,"karacol.su":true,"karaganda.su":true,"karelia.su":true,"khakassia.su":true,"krasnodar.su":true,"kurgan.su":true,"kustanai.su":true,"lenug.su":true,"mangyshlak.su":true,"mordovia.su":true,"msk.su":true,"murmansk.su":true,"nalchik.su":true,"navoi.su":true,"north-kazakhstan.su":true,"nov.su":true,"obninsk.su":true,"penza.su":true,"pokrovsk.su":true,"sochi.su":true,"spb.su":true,"tashkent.su":true,"termez.su":true,"togliatti.su":true,"troitsk.su":true,"tselinograd.su":true,"tula.su":true,"tuva.su":true,"vladikavkaz.su":true,"vladimir.su":true,"vologda.su":true,"channelsdvr.net":true,"fastlylb.net":true,"map.fastlylb.net":true,"freetls.fastly.net":true,"map.fastly.net":true,"a.prod.fastly.net":true,"global.prod.fastly.net":true,"a.ssl.fastly.net":true,"b.ssl.fastly.net":true,"global.ssl.fastly.net":true,"fhapp.xyz":true,"fedorainfracloud.org":true,"fedorapeople.org":true,"cloud.fedoraproject.org":true,"app.os.fedoraproject.org":true,"app.os.stg.fedoraproject.org":true,"filegear.me":true,"firebaseapp.com":true,"flynnhub.com":true,"flynnhosting.net":true,"freebox-os.com":true,"freeboxos.com":true,"fbx-os.fr":true,"fbxos.fr":true,"freebox-os.fr":true,"freeboxos.fr":true,"*.futurecms.at":true,"futurehosting.at":true,"futuremailing.at":true,"*.ex.ortsinfo.at":true,"*.kunden.ortsinfo.at":true,"*.statics.cloud":true,"service.gov.uk":true,"github.io":true,"githubusercontent.com":true,"gitlab.io":true,"homeoffice.gov.uk":true,"ro.im":true,"shop.ro":true,"goip.de":true,"*.0emm.com":true,"appspot.com":true,"blogspot.ae":true,"blogspot.al":true,"blogspot.am":true,"blogspot.ba":true,"blogspot.be":true,"blogspot.bg":true,"blogspot.bj":true,"blogspot.ca":true,"blogspot.cf":true,"blogspot.ch":true,"blogspot.cl":true,"blogspot.co.at":true,"blogspot.co.id":true,"blogspot.co.il":true,"blogspot.co.ke":true,"blogspot.co.nz":true,"blogspot.co.uk":true,"blogspot.co.za":true,"blogspot.com":true,"blogspot.com.ar":true,"blogspot.com.au":true,"blogspot.com.br":true,"blogspot.com.by":true,"blogspot.com.co":true,"blogspot.com.cy":true,"blogspot.com.ee":true,"blogspot.com.eg":true,"blogspot.com.es":true,"blogspot.com.mt":true,"blogspot.com.ng":true,"blogspot.com.tr":true,"blogspot.com.uy":true,"blogspot.cv":true,"blogspot.cz":true,"blogspot.de":true,"blogspot.dk":true,"blogspot.fi":true,"blogspot.fr":true,"blogspot.gr":true,"blogspot.hk":true,"blogspot.hr":true,"blogspot.hu":true,"blogspot.ie":true,"blogspot.in":true,"blogspot.is":true,"blogspot.it":true,"blogspot.jp":true,"blogspot.kr":true,"blogspot.li":true,"blogspot.lt":true,"blogspot.lu":true,"blogspot.md":true,"blogspot.mk":true,"blogspot.mr":true,"blogspot.mx":true,"blogspot.my":true,"blogspot.nl":true,"blogspot.no":true,"blogspot.pe":true,"blogspot.pt":true,"blogspot.qa":true,"blogspot.re":true,"blogspot.ro":true,"blogspot.rs":true,"blogspot.ru":true,"blogspot.se":true,"blogspot.sg":true,"blogspot.si":true,"blogspot.sk":true,"blogspot.sn":true,"blogspot.td":true,"blogspot.tw":true,"blogspot.ug":true,"blogspot.vn":true,"cloudfunctions.net":true,"cloud.goog":true,"codespot.com":true,"googleapis.com":true,"googlecode.com":true,"pagespeedmobilizer.com":true,"publishproxy.com":true,"withgoogle.com":true,"withyoutube.com":true,"hashbang.sh":true,"hasura-app.io":true,"hepforge.org":true,"herokuapp.com":true,"herokussl.com":true,"moonscale.net":true,"iki.fi":true,"biz.at":true,"info.at":true,"info.cx":true,"ac.leg.br":true,"al.leg.br":true,"am.leg.br":true,"ap.leg.br":true,"ba.leg.br":true,"ce.leg.br":true,"df.leg.br":true,"es.leg.br":true,"go.leg.br":true,"ma.leg.br":true,"mg.leg.br":true,"ms.leg.br":true,"mt.leg.br":true,"pa.leg.br":true,"pb.leg.br":true,"pe.leg.br":true,"pi.leg.br":true,"pr.leg.br":true,"rj.leg.br":true,"rn.leg.br":true,"ro.leg.br":true,"rr.leg.br":true,"rs.leg.br":true,"sc.leg.br":true,"se.leg.br":true,"sp.leg.br":true,"to.leg.br":true,"pixolino.com":true,"ipifony.net":true,"*.triton.zone":true,"*.cns.joyent.com":true,"js.org":true,"keymachine.de":true,"knightpoint.systems":true,"co.krd":true,"edu.krd":true,"git-repos.de":true,"lcube-server.de":true,"svn-repos.de":true,"linkyard.cloud":true,"linkyard-cloud.ch":true,"we.bs":true,"barsy.bg":true,"barsyonline.com":true,"barsy.de":true,"barsy.eu":true,"barsy.in":true,"barsy.net":true,"barsy.online":true,"barsy.support":true,"*.magentosite.cloud":true,"hb.cldmail.ru":true,"cloud.metacentrum.cz":true,"custom.metacentrum.cz":true,"meteorapp.com":true,"eu.meteorapp.com":true,"co.pl":true,"azurewebsites.net":true,"azure-mobile.net":true,"cloudapp.net":true,"mozilla-iot.org":true,"bmoattachments.org":true,"net.ru":true,"org.ru":true,"pp.ru":true,"bitballoon.com":true,"netlify.com":true,"4u.com":true,"ngrok.io":true,"nh-serv.co.uk":true,"nfshost.com":true,"nsupdate.info":true,"nerdpol.ovh":true,"blogsyte.com":true,"brasilia.me":true,"cable-modem.org":true,"ciscofreak.com":true,"collegefan.org":true,"couchpotatofries.org":true,"damnserver.com":true,"ddns.me":true,"ditchyourip.com":true,"dnsfor.me":true,"dnsiskinky.com":true,"dvrcam.info":true,"dynns.com":true,"eating-organic.net":true,"fantasyleague.cc":true,"geekgalaxy.com":true,"golffan.us":true,"health-carereform.com":true,"homesecuritymac.com":true,"homesecuritypc.com":true,"hopto.me":true,"ilovecollege.info":true,"loginto.me":true,"mlbfan.org":true,"mmafan.biz":true,"myactivedirectory.com":true,"mydissent.net":true,"myeffect.net":true,"mymediapc.net":true,"mypsx.net":true,"mysecuritycamera.com":true,"mysecuritycamera.net":true,"mysecuritycamera.org":true,"net-freaks.com":true,"nflfan.org":true,"nhlfan.net":true,"no-ip.ca":true,"no-ip.co.uk":true,"no-ip.net":true,"noip.us":true,"onthewifi.com":true,"pgafan.net":true,"point2this.com":true,"pointto.us":true,"privatizehealthinsurance.net":true,"quicksytes.com":true,"read-books.org":true,"securitytactics.com":true,"serveexchange.com":true,"servehumour.com":true,"servep2p.com":true,"servesarcasm.com":true,"stufftoread.com":true,"ufcfan.org":true,"unusualperson.com":true,"workisboring.com":true,"3utilities.com":true,"bounceme.net":true,"ddns.net":true,"ddnsking.com":true,"gotdns.ch":true,"hopto.org":true,"myftp.biz":true,"myftp.org":true,"myvnc.com":true,"no-ip.biz":true,"no-ip.info":true,"no-ip.org":true,"noip.me":true,"redirectme.net":true,"servebeer.com":true,"serveblog.net":true,"servecounterstrike.com":true,"serveftp.com":true,"servegame.com":true,"servehalflife.com":true,"servehttp.com":true,"serveirc.com":true,"serveminecraft.net":true,"servemp3.com":true,"servepics.com":true,"servequake.com":true,"sytes.net":true,"webhop.me":true,"zapto.org":true,"stage.nodeart.io":true,"nodum.co":true,"nodum.io":true,"nyc.mn":true,"nom.ae":true,"nom.ai":true,"nom.al":true,"nym.by":true,"nym.bz":true,"nom.cl":true,"nom.gd":true,"nom.gl":true,"nym.gr":true,"nom.gt":true,"nom.hn":true,"nom.im":true,"nym.kz":true,"nym.la":true,"nom.li":true,"nym.li":true,"nym.lt":true,"nym.lu":true,"nym.me":true,"nom.mk":true,"nym.mx":true,"nom.nu":true,"nym.nz":true,"nym.pe":true,"nym.pt":true,"nom.pw":true,"nom.qa":true,"nom.rs":true,"nom.si":true,"nym.sk":true,"nym.su":true,"nym.sx":true,"nym.tw":true,"nom.ug":true,"nom.uy":true,"nom.vc":true,"nom.vg":true,"cya.gg":true,"nid.io":true,"opencraft.hosting":true,"operaunite.com":true,"outsystemscloud.com":true,"ownprovider.com":true,"oy.lc":true,"pgfog.com":true,"pagefrontapp.com":true,"art.pl":true,"gliwice.pl":true,"krakow.pl":true,"poznan.pl":true,"wroc.pl":true,"zakopane.pl":true,"pantheonsite.io":true,"gotpantheon.com":true,"mypep.link":true,"on-web.fr":true,"*.platform.sh":true,"*.platformsh.site":true,"xen.prgmr.com":true,"priv.at":true,"protonet.io":true,"chirurgiens-dentistes-en-france.fr":true,"byen.site":true,"qa2.com":true,"dev-myqnapcloud.com":true,"alpha-myqnapcloud.com":true,"myqnapcloud.com":true,"*.quipelements.com":true,"vapor.cloud":true,"vaporcloud.io":true,"rackmaze.com":true,"rackmaze.net":true,"rhcloud.com":true,"resindevice.io":true,"devices.resinstaging.io":true,"hzc.io":true,"wellbeingzone.eu":true,"ptplus.fit":true,"wellbeingzone.co.uk":true,"sandcats.io":true,"logoip.de":true,"logoip.com":true,"schokokeks.net":true,"scrysec.com":true,"firewall-gateway.com":true,"firewall-gateway.de":true,"my-gateway.de":true,"my-router.de":true,"spdns.de":true,"spdns.eu":true,"firewall-gateway.net":true,"my-firewall.org":true,"myfirewall.org":true,"spdns.org":true,"*.s5y.io":true,"*.sensiosite.cloud":true,"biz.ua":true,"co.ua":true,"pp.ua":true,"shiftedit.io":true,"myshopblocks.com":true,"1kapp.com":true,"appchizi.com":true,"applinzi.com":true,"sinaapp.com":true,"vipsinaapp.com":true,"bounty-full.com":true,"alpha.bounty-full.com":true,"beta.bounty-full.com":true,"static.land":true,"dev.static.land":true,"sites.static.land":true,"apps.lair.io":true,"*.stolos.io":true,"spacekit.io":true,"stackspace.space":true,"storj.farm":true,"temp-dns.com":true,"diskstation.me":true,"dscloud.biz":true,"dscloud.me":true,"dscloud.mobi":true,"dsmynas.com":true,"dsmynas.net":true,"dsmynas.org":true,"familyds.com":true,"familyds.net":true,"familyds.org":true,"i234.me":true,"myds.me":true,"synology.me":true,"vpnplus.to":true,"taifun-dns.de":true,"gda.pl":true,"gdansk.pl":true,"gdynia.pl":true,"med.pl":true,"sopot.pl":true,"cust.dev.thingdust.io":true,"cust.disrec.thingdust.io":true,"cust.prod.thingdust.io":true,"cust.testing.thingdust.io":true,"bloxcms.com":true,"townnews-staging.com":true,"12hp.at":true,"2ix.at":true,"4lima.at":true,"lima-city.at":true,"12hp.ch":true,"2ix.ch":true,"4lima.ch":true,"lima-city.ch":true,"trafficplex.cloud":true,"de.cool":true,"12hp.de":true,"2ix.de":true,"4lima.de":true,"lima-city.de":true,"1337.pictures":true,"clan.rip":true,"lima-city.rocks":true,"webspace.rocks":true,"lima.zone":true,"*.transurl.be":true,"*.transurl.eu":true,"*.transurl.nl":true,"tuxfamily.org":true,"dd-dns.de":true,"diskstation.eu":true,"diskstation.org":true,"dray-dns.de":true,"draydns.de":true,"dyn-vpn.de":true,"dynvpn.de":true,"mein-vigor.de":true,"my-vigor.de":true,"my-wan.de":true,"syno-ds.de":true,"synology-diskstation.de":true,"synology-ds.de":true,"uber.space":true,"hk.com":true,"hk.org":true,"ltd.hk":true,"inc.hk":true,"lib.de.us":true,"2038.io":true,"router.management":true,"v-info.info":true,"wedeploy.io":true,"wedeploy.me":true,"wedeploy.sh":true,"remotewd.com":true,"wmflabs.org":true,"cistron.nl":true,"demon.nl":true,"xs4all.space":true,"official.academy":true,"yolasite.com":true,"ybo.faith":true,"yombo.me":true,"homelink.one":true,"ybo.party":true,"ybo.review":true,"ybo.science":true,"ybo.trade":true,"za.net":true,"za.org":true,"now.sh":true});
74560
74561// END of automatically generated file
74562
74563
74564/***/ }),
74565/* 386 */
74566/***/ (function(module, exports, __webpack_require__) {
74567
74568"use strict";
74569/*!
74570 * Copyright (c) 2015, Salesforce.com, Inc.
74571 * All rights reserved.
74572 *
74573 * Redistribution and use in source and binary forms, with or without
74574 * modification, are permitted provided that the following conditions are met:
74575 *
74576 * 1. Redistributions of source code must retain the above copyright notice,
74577 * this list of conditions and the following disclaimer.
74578 *
74579 * 2. Redistributions in binary form must reproduce the above copyright notice,
74580 * this list of conditions and the following disclaimer in the documentation
74581 * and/or other materials provided with the distribution.
74582 *
74583 * 3. Neither the name of Salesforce.com nor the names of its contributors may
74584 * be used to endorse or promote products derived from this software without
74585 * specific prior written permission.
74586 *
74587 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
74588 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
74589 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
74590 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
74591 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
74592 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
74593 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
74594 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
74595 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
74596 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
74597 * POSSIBILITY OF SUCH DAMAGE.
74598 */
74599
74600/*jshint unused:false */
74601
74602function Store() {
74603}
74604exports.Store = Store;
74605
74606// Stores may be synchronous, but are still required to use a
74607// Continuation-Passing Style API. The CookieJar itself will expose a "*Sync"
74608// API that converts from synchronous-callbacks to imperative style.
74609Store.prototype.synchronous = false;
74610
74611Store.prototype.findCookie = function(domain, path, key, cb) {
74612 throw new Error('findCookie is not implemented');
74613};
74614
74615Store.prototype.findCookies = function(domain, path, cb) {
74616 throw new Error('findCookies is not implemented');
74617};
74618
74619Store.prototype.putCookie = function(cookie, cb) {
74620 throw new Error('putCookie is not implemented');
74621};
74622
74623Store.prototype.updateCookie = function(oldCookie, newCookie, cb) {
74624 // recommended default implementation:
74625 // return this.putCookie(newCookie, cb);
74626 throw new Error('updateCookie is not implemented');
74627};
74628
74629Store.prototype.removeCookie = function(domain, path, key, cb) {
74630 throw new Error('removeCookie is not implemented');
74631};
74632
74633Store.prototype.removeCookies = function(domain, path, cb) {
74634 throw new Error('removeCookies is not implemented');
74635};
74636
74637Store.prototype.getAllCookies = function(cb) {
74638 throw new Error('getAllCookies is not implemented (therefore jar cannot be serialized)');
74639};
74640
74641
74642/***/ }),
74643/* 387 */
74644/***/ (function(module, exports) {
74645
74646module.exports = function () {
74647 // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi
74648 var origPrepareStackTrace = Error.prepareStackTrace;
74649 Error.prepareStackTrace = function (_, stack) { return stack; };
74650 var stack = (new Error()).stack;
74651 Error.prepareStackTrace = origPrepareStackTrace;
74652 return stack[2].getFileName();
74653};
74654
74655
74656/***/ }),
74657/* 388 */
74658/***/ (function(module, exports, __webpack_require__) {
74659
74660var path = __webpack_require__(1);
74661var fs = __webpack_require__(12);
74662var parse = path.parse || __webpack_require__(846);
74663
74664module.exports = function nodeModulesPaths(start, opts) {
74665 var modules = opts && opts.moduleDirectory
74666 ? [].concat(opts.moduleDirectory)
74667 : ['node_modules'];
74668
74669 // ensure that `start` is an absolute path at this point,
74670 // resolving against the process' current working directory
74671 var absoluteStart = path.resolve(start);
74672
74673 if (opts && opts.preserveSymlinks === false) {
74674 try {
74675 absoluteStart = fs.realpathSync(absoluteStart);
74676 } catch (err) {
74677 if (err.code !== 'ENOENT') {
74678 throw err;
74679 }
74680 }
74681 }
74682
74683 var prefix = '/';
74684 if (/^([A-Za-z]:)/.test(absoluteStart)) {
74685 prefix = '';
74686 } else if (/^\\\\/.test(absoluteStart)) {
74687 prefix = '\\\\';
74688 }
74689
74690 var paths = [absoluteStart];
74691 var parsed = parse(absoluteStart);
74692 while (parsed.dir !== paths[paths.length - 1]) {
74693 paths.push(parsed.dir);
74694 parsed = parse(parsed.dir);
74695 }
74696
74697 var dirs = paths.reduce(function (dirs, aPath) {
74698 return dirs.concat(modules.map(function (moduleDir) {
74699 return path.join(prefix, aPath, moduleDir);
74700 }));
74701 }, []);
74702
74703 return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
74704};
74705
74706
74707/***/ }),
74708/* 389 */
74709/***/ (function(module, __webpack_exports__, __webpack_require__) {
74710
74711"use strict";
74712/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BehaviorSubject; });
74713/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
74714/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
74715/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ObjectUnsubscribedError__ = __webpack_require__(180);
74716/** PURE_IMPORTS_START tslib,_Subject,_util_ObjectUnsubscribedError PURE_IMPORTS_END */
74717
74718
74719
74720var BehaviorSubject = /*@__PURE__*/ (function (_super) {
74721 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BehaviorSubject, _super);
74722 function BehaviorSubject(_value) {
74723 var _this = _super.call(this) || this;
74724 _this._value = _value;
74725 return _this;
74726 }
74727 Object.defineProperty(BehaviorSubject.prototype, "value", {
74728 get: function () {
74729 return this.getValue();
74730 },
74731 enumerable: true,
74732 configurable: true
74733 });
74734 BehaviorSubject.prototype._subscribe = function (subscriber) {
74735 var subscription = _super.prototype._subscribe.call(this, subscriber);
74736 if (subscription && !subscription.closed) {
74737 subscriber.next(this._value);
74738 }
74739 return subscription;
74740 };
74741 BehaviorSubject.prototype.getValue = function () {
74742 if (this.hasError) {
74743 throw this.thrownError;
74744 }
74745 else if (this.closed) {
74746 throw new __WEBPACK_IMPORTED_MODULE_2__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
74747 }
74748 else {
74749 return this._value;
74750 }
74751 };
74752 BehaviorSubject.prototype.next = function (value) {
74753 _super.prototype.next.call(this, this._value = value);
74754 };
74755 return BehaviorSubject;
74756}(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]));
74757
74758//# sourceMappingURL=BehaviorSubject.js.map
74759
74760
74761/***/ }),
74762/* 390 */
74763/***/ (function(module, __webpack_exports__, __webpack_require__) {
74764
74765"use strict";
74766/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return empty; });
74767/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__config__ = __webpack_require__(176);
74768/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_hostReportError__ = __webpack_require__(263);
74769/** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */
74770
74771
74772var empty = {
74773 closed: true,
74774 next: function (value) { },
74775 error: function (err) {
74776 if (__WEBPACK_IMPORTED_MODULE_0__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
74777 throw err;
74778 }
74779 else {
74780 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_hostReportError__["a" /* hostReportError */])(err);
74781 }
74782 },
74783 complete: function () { }
74784};
74785//# sourceMappingURL=Observer.js.map
74786
74787
74788/***/ }),
74789/* 391 */
74790/***/ (function(module, __webpack_exports__, __webpack_require__) {
74791
74792"use strict";
74793/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Scheduler; });
74794var Scheduler = /*@__PURE__*/ (function () {
74795 function Scheduler(SchedulerAction, now) {
74796 if (now === void 0) {
74797 now = Scheduler.now;
74798 }
74799 this.SchedulerAction = SchedulerAction;
74800 this.now = now;
74801 }
74802 Scheduler.prototype.schedule = function (work, delay, state) {
74803 if (delay === void 0) {
74804 delay = 0;
74805 }
74806 return new this.SchedulerAction(this, work).schedule(state, delay);
74807 };
74808 Scheduler.now = function () { return Date.now(); };
74809 return Scheduler;
74810}());
74811
74812//# sourceMappingURL=Scheduler.js.map
74813
74814
74815/***/ }),
74816/* 392 */
74817/***/ (function(module, __webpack_exports__, __webpack_require__) {
74818
74819"use strict";
74820/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SubjectSubscription; });
74821/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
74822/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
74823/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */
74824
74825
74826var SubjectSubscription = /*@__PURE__*/ (function (_super) {
74827 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubjectSubscription, _super);
74828 function SubjectSubscription(subject, subscriber) {
74829 var _this = _super.call(this) || this;
74830 _this.subject = subject;
74831 _this.subscriber = subscriber;
74832 _this.closed = false;
74833 return _this;
74834 }
74835 SubjectSubscription.prototype.unsubscribe = function () {
74836 if (this.closed) {
74837 return;
74838 }
74839 this.closed = true;
74840 var subject = this.subject;
74841 var observers = subject.observers;
74842 this.subject = null;
74843 if (!observers || observers.length === 0 || subject.isStopped || subject.closed) {
74844 return;
74845 }
74846 var subscriberIndex = observers.indexOf(this.subscriber);
74847 if (subscriberIndex !== -1) {
74848 observers.splice(subscriberIndex, 1);
74849 }
74850 };
74851 return SubjectSubscription;
74852}(__WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]));
74853
74854//# sourceMappingURL=SubjectSubscription.js.map
74855
74856
74857/***/ }),
74858/* 393 */
74859/***/ (function(module, __webpack_exports__, __webpack_require__) {
74860
74861"use strict";
74862/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ConnectableObservable; });
74863/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return connectableObservableDescriptor; });
74864/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
74865/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
74866/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observable__ = __webpack_require__(17);
74867/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(5);
74868/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Subscription__ = __webpack_require__(31);
74869/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__operators_refCount__ = __webpack_require__(256);
74870/** PURE_IMPORTS_START tslib,_Subject,_Observable,_Subscriber,_Subscription,_operators_refCount PURE_IMPORTS_END */
74871
74872
74873
74874
74875
74876
74877var ConnectableObservable = /*@__PURE__*/ (function (_super) {
74878 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ConnectableObservable, _super);
74879 function ConnectableObservable(source, subjectFactory) {
74880 var _this = _super.call(this) || this;
74881 _this.source = source;
74882 _this.subjectFactory = subjectFactory;
74883 _this._refCount = 0;
74884 _this._isComplete = false;
74885 return _this;
74886 }
74887 ConnectableObservable.prototype._subscribe = function (subscriber) {
74888 return this.getSubject().subscribe(subscriber);
74889 };
74890 ConnectableObservable.prototype.getSubject = function () {
74891 var subject = this._subject;
74892 if (!subject || subject.isStopped) {
74893 this._subject = this.subjectFactory();
74894 }
74895 return this._subject;
74896 };
74897 ConnectableObservable.prototype.connect = function () {
74898 var connection = this._connection;
74899 if (!connection) {
74900 this._isComplete = false;
74901 connection = this._connection = new __WEBPACK_IMPORTED_MODULE_4__Subscription__["a" /* Subscription */]();
74902 connection.add(this.source
74903 .subscribe(new ConnectableSubscriber(this.getSubject(), this)));
74904 if (connection.closed) {
74905 this._connection = null;
74906 connection = __WEBPACK_IMPORTED_MODULE_4__Subscription__["a" /* Subscription */].EMPTY;
74907 }
74908 else {
74909 this._connection = connection;
74910 }
74911 }
74912 return connection;
74913 };
74914 ConnectableObservable.prototype.refCount = function () {
74915 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__operators_refCount__["a" /* refCount */])()(this);
74916 };
74917 return ConnectableObservable;
74918}(__WEBPACK_IMPORTED_MODULE_2__Observable__["a" /* Observable */]));
74919
74920var connectableProto = ConnectableObservable.prototype;
74921var connectableObservableDescriptor = {
74922 operator: { value: null },
74923 _refCount: { value: 0, writable: true },
74924 _subject: { value: null, writable: true },
74925 _connection: { value: null, writable: true },
74926 _subscribe: { value: connectableProto._subscribe },
74927 _isComplete: { value: connectableProto._isComplete, writable: true },
74928 getSubject: { value: connectableProto.getSubject },
74929 connect: { value: connectableProto.connect },
74930 refCount: { value: connectableProto.refCount }
74931};
74932var ConnectableSubscriber = /*@__PURE__*/ (function (_super) {
74933 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ConnectableSubscriber, _super);
74934 function ConnectableSubscriber(destination, connectable) {
74935 var _this = _super.call(this, destination) || this;
74936 _this.connectable = connectable;
74937 return _this;
74938 }
74939 ConnectableSubscriber.prototype._error = function (err) {
74940 this._unsubscribe();
74941 _super.prototype._error.call(this, err);
74942 };
74943 ConnectableSubscriber.prototype._complete = function () {
74944 this.connectable._isComplete = true;
74945 this._unsubscribe();
74946 _super.prototype._complete.call(this);
74947 };
74948 ConnectableSubscriber.prototype._unsubscribe = function () {
74949 var connectable = this.connectable;
74950 if (connectable) {
74951 this.connectable = null;
74952 var connection = connectable._connection;
74953 connectable._refCount = 0;
74954 connectable._subject = null;
74955 connectable._connection = null;
74956 if (connection) {
74957 connection.unsubscribe();
74958 }
74959 }
74960 };
74961 return ConnectableSubscriber;
74962}(__WEBPACK_IMPORTED_MODULE_1__Subject__["b" /* SubjectSubscriber */]));
74963var RefCountOperator = /*@__PURE__*/ (function () {
74964 function RefCountOperator(connectable) {
74965 this.connectable = connectable;
74966 }
74967 RefCountOperator.prototype.call = function (subscriber, source) {
74968 var connectable = this.connectable;
74969 connectable._refCount++;
74970 var refCounter = new RefCountSubscriber(subscriber, connectable);
74971 var subscription = source.subscribe(refCounter);
74972 if (!refCounter.closed) {
74973 refCounter.connection = connectable.connect();
74974 }
74975 return subscription;
74976 };
74977 return RefCountOperator;
74978}());
74979var RefCountSubscriber = /*@__PURE__*/ (function (_super) {
74980 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RefCountSubscriber, _super);
74981 function RefCountSubscriber(destination, connectable) {
74982 var _this = _super.call(this, destination) || this;
74983 _this.connectable = connectable;
74984 return _this;
74985 }
74986 RefCountSubscriber.prototype._unsubscribe = function () {
74987 var connectable = this.connectable;
74988 if (!connectable) {
74989 this.connection = null;
74990 return;
74991 }
74992 this.connectable = null;
74993 var refCount = connectable._refCount;
74994 if (refCount <= 0) {
74995 this.connection = null;
74996 return;
74997 }
74998 connectable._refCount = refCount - 1;
74999 if (refCount > 1) {
75000 this.connection = null;
75001 return;
75002 }
75003 var connection = this.connection;
75004 var sharedConnection = connectable._connection;
75005 this.connection = null;
75006 if (sharedConnection && (!connection || sharedConnection === connection)) {
75007 sharedConnection.unsubscribe();
75008 }
75009 };
75010 return RefCountSubscriber;
75011}(__WEBPACK_IMPORTED_MODULE_3__Subscriber__["a" /* Subscriber */]));
75012//# sourceMappingURL=ConnectableObservable.js.map
75013
75014
75015/***/ }),
75016/* 394 */
75017/***/ (function(module, __webpack_exports__, __webpack_require__) {
75018
75019"use strict";
75020/* harmony export (immutable) */ __webpack_exports__["a"] = merge;
75021/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
75022/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isScheduler__ = __webpack_require__(56);
75023/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__operators_mergeAll__ = __webpack_require__(255);
75024/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__fromArray__ = __webpack_require__(81);
75025/** PURE_IMPORTS_START _Observable,_util_isScheduler,_operators_mergeAll,_fromArray PURE_IMPORTS_END */
75026
75027
75028
75029
75030function merge() {
75031 var observables = [];
75032 for (var _i = 0; _i < arguments.length; _i++) {
75033 observables[_i] = arguments[_i];
75034 }
75035 var concurrent = Number.POSITIVE_INFINITY;
75036 var scheduler = null;
75037 var last = observables[observables.length - 1];
75038 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isScheduler__["a" /* isScheduler */])(last)) {
75039 scheduler = observables.pop();
75040 if (observables.length > 1 && typeof observables[observables.length - 1] === 'number') {
75041 concurrent = observables.pop();
75042 }
75043 }
75044 else if (typeof last === 'number') {
75045 concurrent = observables.pop();
75046 }
75047 if (scheduler === null && observables.length === 1 && observables[0] instanceof __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */]) {
75048 return observables[0];
75049 }
75050 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__operators_mergeAll__["a" /* mergeAll */])(concurrent)(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__fromArray__["a" /* fromArray */])(observables, scheduler));
75051}
75052//# sourceMappingURL=merge.js.map
75053
75054
75055/***/ }),
75056/* 395 */
75057/***/ (function(module, __webpack_exports__, __webpack_require__) {
75058
75059"use strict";
75060/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NEVER; });
75061/* harmony export (immutable) */ __webpack_exports__["a"] = never;
75062/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
75063/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_noop__ = __webpack_require__(182);
75064/** PURE_IMPORTS_START _Observable,_util_noop PURE_IMPORTS_END */
75065
75066
75067var NEVER = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__WEBPACK_IMPORTED_MODULE_1__util_noop__["a" /* noop */]);
75068function never() {
75069 return NEVER;
75070}
75071//# sourceMappingURL=never.js.map
75072
75073
75074/***/ }),
75075/* 396 */
75076/***/ (function(module, __webpack_exports__, __webpack_require__) {
75077
75078"use strict";
75079/* harmony export (immutable) */ __webpack_exports__["a"] = race;
75080/* unused harmony export RaceOperator */
75081/* unused harmony export RaceSubscriber */
75082/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
75083/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isArray__ = __webpack_require__(48);
75084/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__fromArray__ = __webpack_require__(81);
75085/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
75086/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
75087/** PURE_IMPORTS_START tslib,_util_isArray,_fromArray,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
75088
75089
75090
75091
75092
75093function race() {
75094 var observables = [];
75095 for (var _i = 0; _i < arguments.length; _i++) {
75096 observables[_i] = arguments[_i];
75097 }
75098 if (observables.length === 1) {
75099 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isArray__["a" /* isArray */])(observables[0])) {
75100 observables = observables[0];
75101 }
75102 else {
75103 return observables[0];
75104 }
75105 }
75106 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__fromArray__["a" /* fromArray */])(observables, undefined).lift(new RaceOperator());
75107}
75108var RaceOperator = /*@__PURE__*/ (function () {
75109 function RaceOperator() {
75110 }
75111 RaceOperator.prototype.call = function (subscriber, source) {
75112 return source.subscribe(new RaceSubscriber(subscriber));
75113 };
75114 return RaceOperator;
75115}());
75116
75117var RaceSubscriber = /*@__PURE__*/ (function (_super) {
75118 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RaceSubscriber, _super);
75119 function RaceSubscriber(destination) {
75120 var _this = _super.call(this, destination) || this;
75121 _this.hasFirst = false;
75122 _this.observables = [];
75123 _this.subscriptions = [];
75124 return _this;
75125 }
75126 RaceSubscriber.prototype._next = function (observable) {
75127 this.observables.push(observable);
75128 };
75129 RaceSubscriber.prototype._complete = function () {
75130 var observables = this.observables;
75131 var len = observables.length;
75132 if (len === 0) {
75133 this.destination.complete();
75134 }
75135 else {
75136 for (var i = 0; i < len && !this.hasFirst; i++) {
75137 var observable = observables[i];
75138 var subscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, observable, observable, i);
75139 if (this.subscriptions) {
75140 this.subscriptions.push(subscription);
75141 }
75142 this.add(subscription);
75143 }
75144 this.observables = null;
75145 }
75146 };
75147 RaceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
75148 if (!this.hasFirst) {
75149 this.hasFirst = true;
75150 for (var i = 0; i < this.subscriptions.length; i++) {
75151 if (i !== outerIndex) {
75152 var subscription = this.subscriptions[i];
75153 subscription.unsubscribe();
75154 this.remove(subscription);
75155 }
75156 }
75157 this.subscriptions = null;
75158 }
75159 this.destination.next(innerValue);
75160 };
75161 return RaceSubscriber;
75162}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
75163
75164//# sourceMappingURL=race.js.map
75165
75166
75167/***/ }),
75168/* 397 */
75169/***/ (function(module, __webpack_exports__, __webpack_require__) {
75170
75171"use strict";
75172/* harmony export (immutable) */ __webpack_exports__["a"] = timer;
75173/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
75174/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(47);
75175/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isNumeric__ = __webpack_require__(181);
75176/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isScheduler__ = __webpack_require__(56);
75177/** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */
75178
75179
75180
75181
75182function timer(dueTime, periodOrScheduler, scheduler) {
75183 if (dueTime === void 0) {
75184 dueTime = 0;
75185 }
75186 var period = -1;
75187 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isNumeric__["a" /* isNumeric */])(periodOrScheduler)) {
75188 period = Number(periodOrScheduler) < 1 && 1 || Number(periodOrScheduler);
75189 }
75190 else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isScheduler__["a" /* isScheduler */])(periodOrScheduler)) {
75191 scheduler = periodOrScheduler;
75192 }
75193 if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isScheduler__["a" /* isScheduler */])(scheduler)) {
75194 scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */];
75195 }
75196 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
75197 var due = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isNumeric__["a" /* isNumeric */])(dueTime)
75198 ? dueTime
75199 : (+dueTime - scheduler.now());
75200 return scheduler.schedule(dispatch, due, {
75201 index: 0, period: period, subscriber: subscriber
75202 });
75203 });
75204}
75205function dispatch(state) {
75206 var index = state.index, period = state.period, subscriber = state.subscriber;
75207 subscriber.next(index);
75208 if (subscriber.closed) {
75209 return;
75210 }
75211 else if (period === -1) {
75212 return subscriber.complete();
75213 }
75214 state.index = index + 1;
75215 this.schedule(state, period);
75216}
75217//# sourceMappingURL=timer.js.map
75218
75219
75220/***/ }),
75221/* 398 */
75222/***/ (function(module, __webpack_exports__, __webpack_require__) {
75223
75224"use strict";
75225/* harmony export (immutable) */ __webpack_exports__["a"] = audit;
75226/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
75227/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_tryCatch__ = __webpack_require__(59);
75228/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_errorObject__ = __webpack_require__(55);
75229/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
75230/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
75231/** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
75232
75233
75234
75235
75236
75237function audit(durationSelector) {
75238 return function auditOperatorFunction(source) {
75239 return source.lift(new AuditOperator(durationSelector));
75240 };
75241}
75242var AuditOperator = /*@__PURE__*/ (function () {
75243 function AuditOperator(durationSelector) {
75244 this.durationSelector = durationSelector;
75245 }
75246 AuditOperator.prototype.call = function (subscriber, source) {
75247 return source.subscribe(new AuditSubscriber(subscriber, this.durationSelector));
75248 };
75249 return AuditOperator;
75250}());
75251var AuditSubscriber = /*@__PURE__*/ (function (_super) {
75252 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AuditSubscriber, _super);
75253 function AuditSubscriber(destination, durationSelector) {
75254 var _this = _super.call(this, destination) || this;
75255 _this.durationSelector = durationSelector;
75256 _this.hasValue = false;
75257 return _this;
75258 }
75259 AuditSubscriber.prototype._next = function (value) {
75260 this.value = value;
75261 this.hasValue = true;
75262 if (!this.throttled) {
75263 var duration = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_tryCatch__["a" /* tryCatch */])(this.durationSelector)(value);
75264 if (duration === __WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */]) {
75265 this.destination.error(__WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */].e);
75266 }
75267 else {
75268 var innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, duration);
75269 if (!innerSubscription || innerSubscription.closed) {
75270 this.clearThrottle();
75271 }
75272 else {
75273 this.add(this.throttled = innerSubscription);
75274 }
75275 }
75276 }
75277 };
75278 AuditSubscriber.prototype.clearThrottle = function () {
75279 var _a = this, value = _a.value, hasValue = _a.hasValue, throttled = _a.throttled;
75280 if (throttled) {
75281 this.remove(throttled);
75282 this.throttled = null;
75283 throttled.unsubscribe();
75284 }
75285 if (hasValue) {
75286 this.value = null;
75287 this.hasValue = false;
75288 this.destination.next(value);
75289 }
75290 };
75291 AuditSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex) {
75292 this.clearThrottle();
75293 };
75294 AuditSubscriber.prototype.notifyComplete = function () {
75295 this.clearThrottle();
75296 };
75297 return AuditSubscriber;
75298}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
75299//# sourceMappingURL=audit.js.map
75300
75301
75302/***/ }),
75303/* 399 */
75304/***/ (function(module, __webpack_exports__, __webpack_require__) {
75305
75306"use strict";
75307/* harmony export (immutable) */ __webpack_exports__["a"] = concatAll;
75308/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mergeAll__ = __webpack_require__(255);
75309/** PURE_IMPORTS_START _mergeAll PURE_IMPORTS_END */
75310
75311function concatAll() {
75312 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeAll__["a" /* mergeAll */])(1);
75313}
75314//# sourceMappingURL=concatAll.js.map
75315
75316
75317/***/ }),
75318/* 400 */
75319/***/ (function(module, __webpack_exports__, __webpack_require__) {
75320
75321"use strict";
75322/* harmony export (immutable) */ __webpack_exports__["a"] = concatMap;
75323/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mergeMap__ = __webpack_require__(136);
75324/** PURE_IMPORTS_START _mergeMap PURE_IMPORTS_END */
75325
75326function concatMap(project, resultSelector) {
75327 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeMap__["a" /* mergeMap */])(project, resultSelector, 1);
75328}
75329//# sourceMappingURL=concatMap.js.map
75330
75331
75332/***/ }),
75333/* 401 */
75334/***/ (function(module, __webpack_exports__, __webpack_require__) {
75335
75336"use strict";
75337/* harmony export (immutable) */ __webpack_exports__["a"] = distinctUntilChanged;
75338/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
75339/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
75340/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(59);
75341/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55);
75342/** PURE_IMPORTS_START tslib,_Subscriber,_util_tryCatch,_util_errorObject PURE_IMPORTS_END */
75343
75344
75345
75346
75347function distinctUntilChanged(compare, keySelector) {
75348 return function (source) { return source.lift(new DistinctUntilChangedOperator(compare, keySelector)); };
75349}
75350var DistinctUntilChangedOperator = /*@__PURE__*/ (function () {
75351 function DistinctUntilChangedOperator(compare, keySelector) {
75352 this.compare = compare;
75353 this.keySelector = keySelector;
75354 }
75355 DistinctUntilChangedOperator.prototype.call = function (subscriber, source) {
75356 return source.subscribe(new DistinctUntilChangedSubscriber(subscriber, this.compare, this.keySelector));
75357 };
75358 return DistinctUntilChangedOperator;
75359}());
75360var DistinctUntilChangedSubscriber = /*@__PURE__*/ (function (_super) {
75361 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DistinctUntilChangedSubscriber, _super);
75362 function DistinctUntilChangedSubscriber(destination, compare, keySelector) {
75363 var _this = _super.call(this, destination) || this;
75364 _this.keySelector = keySelector;
75365 _this.hasKey = false;
75366 if (typeof compare === 'function') {
75367 _this.compare = compare;
75368 }
75369 return _this;
75370 }
75371 DistinctUntilChangedSubscriber.prototype.compare = function (x, y) {
75372 return x === y;
75373 };
75374 DistinctUntilChangedSubscriber.prototype._next = function (value) {
75375 var keySelector = this.keySelector;
75376 var key = value;
75377 if (keySelector) {
75378 key = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.keySelector)(value);
75379 if (key === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
75380 return this.destination.error(__WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e);
75381 }
75382 }
75383 var result = false;
75384 if (this.hasKey) {
75385 result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.compare)(this.key, key);
75386 if (result === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
75387 return this.destination.error(__WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e);
75388 }
75389 }
75390 else {
75391 this.hasKey = true;
75392 }
75393 if (Boolean(result) === false) {
75394 this.key = key;
75395 this.destination.next(value);
75396 }
75397 };
75398 return DistinctUntilChangedSubscriber;
75399}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
75400//# sourceMappingURL=distinctUntilChanged.js.map
75401
75402
75403/***/ }),
75404/* 402 */
75405/***/ (function(module, __webpack_exports__, __webpack_require__) {
75406
75407"use strict";
75408/* harmony export (immutable) */ __webpack_exports__["a"] = find;
75409/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return FindValueOperator; });
75410/* unused harmony export FindValueSubscriber */
75411/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
75412/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
75413/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
75414
75415
75416function find(predicate, thisArg) {
75417 if (typeof predicate !== 'function') {
75418 throw new TypeError('predicate is not a function');
75419 }
75420 return function (source) { return source.lift(new FindValueOperator(predicate, source, false, thisArg)); };
75421}
75422var FindValueOperator = /*@__PURE__*/ (function () {
75423 function FindValueOperator(predicate, source, yieldIndex, thisArg) {
75424 this.predicate = predicate;
75425 this.source = source;
75426 this.yieldIndex = yieldIndex;
75427 this.thisArg = thisArg;
75428 }
75429 FindValueOperator.prototype.call = function (observer, source) {
75430 return source.subscribe(new FindValueSubscriber(observer, this.predicate, this.source, this.yieldIndex, this.thisArg));
75431 };
75432 return FindValueOperator;
75433}());
75434
75435var FindValueSubscriber = /*@__PURE__*/ (function (_super) {
75436 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](FindValueSubscriber, _super);
75437 function FindValueSubscriber(destination, predicate, source, yieldIndex, thisArg) {
75438 var _this = _super.call(this, destination) || this;
75439 _this.predicate = predicate;
75440 _this.source = source;
75441 _this.yieldIndex = yieldIndex;
75442 _this.thisArg = thisArg;
75443 _this.index = 0;
75444 return _this;
75445 }
75446 FindValueSubscriber.prototype.notifyComplete = function (value) {
75447 var destination = this.destination;
75448 destination.next(value);
75449 destination.complete();
75450 this.unsubscribe();
75451 };
75452 FindValueSubscriber.prototype._next = function (value) {
75453 var _a = this, predicate = _a.predicate, thisArg = _a.thisArg;
75454 var index = this.index++;
75455 try {
75456 var result = predicate.call(thisArg || this, value, index, this.source);
75457 if (result) {
75458 this.notifyComplete(this.yieldIndex ? index : value);
75459 }
75460 }
75461 catch (err) {
75462 this.destination.error(err);
75463 }
75464 };
75465 FindValueSubscriber.prototype._complete = function () {
75466 this.notifyComplete(this.yieldIndex ? -1 : undefined);
75467 };
75468 return FindValueSubscriber;
75469}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
75470
75471//# sourceMappingURL=find.js.map
75472
75473
75474/***/ }),
75475/* 403 */
75476/***/ (function(module, __webpack_exports__, __webpack_require__) {
75477
75478"use strict";
75479/* harmony export (immutable) */ __webpack_exports__["b"] = groupBy;
75480/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return GroupedObservable; });
75481/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
75482/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
75483/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(31);
75484/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Observable__ = __webpack_require__(17);
75485/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Subject__ = __webpack_require__(43);
75486/** PURE_IMPORTS_START tslib,_Subscriber,_Subscription,_Observable,_Subject PURE_IMPORTS_END */
75487
75488
75489
75490
75491
75492function groupBy(keySelector, elementSelector, durationSelector, subjectSelector) {
75493 return function (source) {
75494 return source.lift(new GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector));
75495 };
75496}
75497var GroupByOperator = /*@__PURE__*/ (function () {
75498 function GroupByOperator(keySelector, elementSelector, durationSelector, subjectSelector) {
75499 this.keySelector = keySelector;
75500 this.elementSelector = elementSelector;
75501 this.durationSelector = durationSelector;
75502 this.subjectSelector = subjectSelector;
75503 }
75504 GroupByOperator.prototype.call = function (subscriber, source) {
75505 return source.subscribe(new GroupBySubscriber(subscriber, this.keySelector, this.elementSelector, this.durationSelector, this.subjectSelector));
75506 };
75507 return GroupByOperator;
75508}());
75509var GroupBySubscriber = /*@__PURE__*/ (function (_super) {
75510 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](GroupBySubscriber, _super);
75511 function GroupBySubscriber(destination, keySelector, elementSelector, durationSelector, subjectSelector) {
75512 var _this = _super.call(this, destination) || this;
75513 _this.keySelector = keySelector;
75514 _this.elementSelector = elementSelector;
75515 _this.durationSelector = durationSelector;
75516 _this.subjectSelector = subjectSelector;
75517 _this.groups = null;
75518 _this.attemptedToUnsubscribe = false;
75519 _this.count = 0;
75520 return _this;
75521 }
75522 GroupBySubscriber.prototype._next = function (value) {
75523 var key;
75524 try {
75525 key = this.keySelector(value);
75526 }
75527 catch (err) {
75528 this.error(err);
75529 return;
75530 }
75531 this._group(value, key);
75532 };
75533 GroupBySubscriber.prototype._group = function (value, key) {
75534 var groups = this.groups;
75535 if (!groups) {
75536 groups = this.groups = new Map();
75537 }
75538 var group = groups.get(key);
75539 var element;
75540 if (this.elementSelector) {
75541 try {
75542 element = this.elementSelector(value);
75543 }
75544 catch (err) {
75545 this.error(err);
75546 }
75547 }
75548 else {
75549 element = value;
75550 }
75551 if (!group) {
75552 group = (this.subjectSelector ? this.subjectSelector() : new __WEBPACK_IMPORTED_MODULE_4__Subject__["a" /* Subject */]());
75553 groups.set(key, group);
75554 var groupedObservable = new GroupedObservable(key, group, this);
75555 this.destination.next(groupedObservable);
75556 if (this.durationSelector) {
75557 var duration = void 0;
75558 try {
75559 duration = this.durationSelector(new GroupedObservable(key, group));
75560 }
75561 catch (err) {
75562 this.error(err);
75563 return;
75564 }
75565 this.add(duration.subscribe(new GroupDurationSubscriber(key, group, this)));
75566 }
75567 }
75568 if (!group.closed) {
75569 group.next(element);
75570 }
75571 };
75572 GroupBySubscriber.prototype._error = function (err) {
75573 var groups = this.groups;
75574 if (groups) {
75575 groups.forEach(function (group, key) {
75576 group.error(err);
75577 });
75578 groups.clear();
75579 }
75580 this.destination.error(err);
75581 };
75582 GroupBySubscriber.prototype._complete = function () {
75583 var groups = this.groups;
75584 if (groups) {
75585 groups.forEach(function (group, key) {
75586 group.complete();
75587 });
75588 groups.clear();
75589 }
75590 this.destination.complete();
75591 };
75592 GroupBySubscriber.prototype.removeGroup = function (key) {
75593 this.groups.delete(key);
75594 };
75595 GroupBySubscriber.prototype.unsubscribe = function () {
75596 if (!this.closed) {
75597 this.attemptedToUnsubscribe = true;
75598 if (this.count === 0) {
75599 _super.prototype.unsubscribe.call(this);
75600 }
75601 }
75602 };
75603 return GroupBySubscriber;
75604}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
75605var GroupDurationSubscriber = /*@__PURE__*/ (function (_super) {
75606 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](GroupDurationSubscriber, _super);
75607 function GroupDurationSubscriber(key, group, parent) {
75608 var _this = _super.call(this, group) || this;
75609 _this.key = key;
75610 _this.group = group;
75611 _this.parent = parent;
75612 return _this;
75613 }
75614 GroupDurationSubscriber.prototype._next = function (value) {
75615 this.complete();
75616 };
75617 GroupDurationSubscriber.prototype._unsubscribe = function () {
75618 var _a = this, parent = _a.parent, key = _a.key;
75619 this.key = this.parent = null;
75620 if (parent) {
75621 parent.removeGroup(key);
75622 }
75623 };
75624 return GroupDurationSubscriber;
75625}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
75626var GroupedObservable = /*@__PURE__*/ (function (_super) {
75627 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](GroupedObservable, _super);
75628 function GroupedObservable(key, groupSubject, refCountSubscription) {
75629 var _this = _super.call(this) || this;
75630 _this.key = key;
75631 _this.groupSubject = groupSubject;
75632 _this.refCountSubscription = refCountSubscription;
75633 return _this;
75634 }
75635 GroupedObservable.prototype._subscribe = function (subscriber) {
75636 var subscription = new __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */]();
75637 var _a = this, refCountSubscription = _a.refCountSubscription, groupSubject = _a.groupSubject;
75638 if (refCountSubscription && !refCountSubscription.closed) {
75639 subscription.add(new InnerRefCountSubscription(refCountSubscription));
75640 }
75641 subscription.add(groupSubject.subscribe(subscriber));
75642 return subscription;
75643 };
75644 return GroupedObservable;
75645}(__WEBPACK_IMPORTED_MODULE_3__Observable__["a" /* Observable */]));
75646
75647var InnerRefCountSubscription = /*@__PURE__*/ (function (_super) {
75648 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](InnerRefCountSubscription, _super);
75649 function InnerRefCountSubscription(parent) {
75650 var _this = _super.call(this) || this;
75651 _this.parent = parent;
75652 parent.count++;
75653 return _this;
75654 }
75655 InnerRefCountSubscription.prototype.unsubscribe = function () {
75656 var parent = this.parent;
75657 if (!parent.closed && !this.closed) {
75658 _super.prototype.unsubscribe.call(this);
75659 parent.count -= 1;
75660 if (parent.count === 0 && parent.attemptedToUnsubscribe) {
75661 parent.unsubscribe();
75662 }
75663 }
75664 };
75665 return InnerRefCountSubscription;
75666}(__WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */]));
75667//# sourceMappingURL=groupBy.js.map
75668
75669
75670/***/ }),
75671/* 404 */
75672/***/ (function(module, __webpack_exports__, __webpack_require__) {
75673
75674"use strict";
75675/* harmony export (immutable) */ __webpack_exports__["b"] = observeOn;
75676/* unused harmony export ObserveOnOperator */
75677/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return ObserveOnSubscriber; });
75678/* unused harmony export ObserveOnMessage */
75679/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
75680/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
75681/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Notification__ = __webpack_require__(175);
75682/** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */
75683
75684
75685
75686function observeOn(scheduler, delay) {
75687 if (delay === void 0) {
75688 delay = 0;
75689 }
75690 return function observeOnOperatorFunction(source) {
75691 return source.lift(new ObserveOnOperator(scheduler, delay));
75692 };
75693}
75694var ObserveOnOperator = /*@__PURE__*/ (function () {
75695 function ObserveOnOperator(scheduler, delay) {
75696 if (delay === void 0) {
75697 delay = 0;
75698 }
75699 this.scheduler = scheduler;
75700 this.delay = delay;
75701 }
75702 ObserveOnOperator.prototype.call = function (subscriber, source) {
75703 return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));
75704 };
75705 return ObserveOnOperator;
75706}());
75707
75708var ObserveOnSubscriber = /*@__PURE__*/ (function (_super) {
75709 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ObserveOnSubscriber, _super);
75710 function ObserveOnSubscriber(destination, scheduler, delay) {
75711 if (delay === void 0) {
75712 delay = 0;
75713 }
75714 var _this = _super.call(this, destination) || this;
75715 _this.scheduler = scheduler;
75716 _this.delay = delay;
75717 return _this;
75718 }
75719 ObserveOnSubscriber.dispatch = function (arg) {
75720 var notification = arg.notification, destination = arg.destination;
75721 notification.observe(destination);
75722 this.unsubscribe();
75723 };
75724 ObserveOnSubscriber.prototype.scheduleMessage = function (notification) {
75725 var destination = this.destination;
75726 destination.add(this.scheduler.schedule(ObserveOnSubscriber.dispatch, this.delay, new ObserveOnMessage(notification, this.destination)));
75727 };
75728 ObserveOnSubscriber.prototype._next = function (value) {
75729 this.scheduleMessage(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createNext(value));
75730 };
75731 ObserveOnSubscriber.prototype._error = function (err) {
75732 this.scheduleMessage(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createError(err));
75733 this.unsubscribe();
75734 };
75735 ObserveOnSubscriber.prototype._complete = function () {
75736 this.scheduleMessage(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createComplete());
75737 this.unsubscribe();
75738 };
75739 return ObserveOnSubscriber;
75740}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
75741
75742var ObserveOnMessage = /*@__PURE__*/ (function () {
75743 function ObserveOnMessage(notification, destination) {
75744 this.notification = notification;
75745 this.destination = destination;
75746 }
75747 return ObserveOnMessage;
75748}());
75749
75750//# sourceMappingURL=observeOn.js.map
75751
75752
75753/***/ }),
75754/* 405 */
75755/***/ (function(module, __webpack_exports__, __webpack_require__) {
75756
75757"use strict";
75758/* harmony export (immutable) */ __webpack_exports__["a"] = tap;
75759/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
75760/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
75761/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_noop__ = __webpack_require__(182);
75762/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isFunction__ = __webpack_require__(142);
75763/** PURE_IMPORTS_START tslib,_Subscriber,_util_noop,_util_isFunction PURE_IMPORTS_END */
75764
75765
75766
75767
75768function tap(nextOrObserver, error, complete) {
75769 return function tapOperatorFunction(source) {
75770 return source.lift(new DoOperator(nextOrObserver, error, complete));
75771 };
75772}
75773var DoOperator = /*@__PURE__*/ (function () {
75774 function DoOperator(nextOrObserver, error, complete) {
75775 this.nextOrObserver = nextOrObserver;
75776 this.error = error;
75777 this.complete = complete;
75778 }
75779 DoOperator.prototype.call = function (subscriber, source) {
75780 return source.subscribe(new TapSubscriber(subscriber, this.nextOrObserver, this.error, this.complete));
75781 };
75782 return DoOperator;
75783}());
75784var TapSubscriber = /*@__PURE__*/ (function (_super) {
75785 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TapSubscriber, _super);
75786 function TapSubscriber(destination, observerOrNext, error, complete) {
75787 var _this = _super.call(this, destination) || this;
75788 _this._tapNext = __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
75789 _this._tapError = __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
75790 _this._tapComplete = __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
75791 _this._tapError = error || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
75792 _this._tapComplete = complete || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
75793 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isFunction__["a" /* isFunction */])(observerOrNext)) {
75794 _this._context = _this;
75795 _this._tapNext = observerOrNext;
75796 }
75797 else if (observerOrNext) {
75798 _this._context = observerOrNext;
75799 _this._tapNext = observerOrNext.next || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
75800 _this._tapError = observerOrNext.error || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
75801 _this._tapComplete = observerOrNext.complete || __WEBPACK_IMPORTED_MODULE_2__util_noop__["a" /* noop */];
75802 }
75803 return _this;
75804 }
75805 TapSubscriber.prototype._next = function (value) {
75806 try {
75807 this._tapNext.call(this._context, value);
75808 }
75809 catch (err) {
75810 this.destination.error(err);
75811 return;
75812 }
75813 this.destination.next(value);
75814 };
75815 TapSubscriber.prototype._error = function (err) {
75816 try {
75817 this._tapError.call(this._context, err);
75818 }
75819 catch (err) {
75820 this.destination.error(err);
75821 return;
75822 }
75823 this.destination.error(err);
75824 };
75825 TapSubscriber.prototype._complete = function () {
75826 try {
75827 this._tapComplete.call(this._context);
75828 }
75829 catch (err) {
75830 this.destination.error(err);
75831 return;
75832 }
75833 return this.destination.complete();
75834 };
75835 return TapSubscriber;
75836}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
75837//# sourceMappingURL=tap.js.map
75838
75839
75840/***/ }),
75841/* 406 */
75842/***/ (function(module, __webpack_exports__, __webpack_require__) {
75843
75844"use strict";
75845/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return defaultThrottleConfig; });
75846/* harmony export (immutable) */ __webpack_exports__["a"] = throttle;
75847/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
75848/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
75849/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
75850/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
75851
75852
75853
75854var defaultThrottleConfig = {
75855 leading: true,
75856 trailing: false
75857};
75858function throttle(durationSelector, config) {
75859 if (config === void 0) {
75860 config = defaultThrottleConfig;
75861 }
75862 return function (source) { return source.lift(new ThrottleOperator(durationSelector, config.leading, config.trailing)); };
75863}
75864var ThrottleOperator = /*@__PURE__*/ (function () {
75865 function ThrottleOperator(durationSelector, leading, trailing) {
75866 this.durationSelector = durationSelector;
75867 this.leading = leading;
75868 this.trailing = trailing;
75869 }
75870 ThrottleOperator.prototype.call = function (subscriber, source) {
75871 return source.subscribe(new ThrottleSubscriber(subscriber, this.durationSelector, this.leading, this.trailing));
75872 };
75873 return ThrottleOperator;
75874}());
75875var ThrottleSubscriber = /*@__PURE__*/ (function (_super) {
75876 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ThrottleSubscriber, _super);
75877 function ThrottleSubscriber(destination, durationSelector, _leading, _trailing) {
75878 var _this = _super.call(this, destination) || this;
75879 _this.destination = destination;
75880 _this.durationSelector = durationSelector;
75881 _this._leading = _leading;
75882 _this._trailing = _trailing;
75883 _this._hasValue = false;
75884 return _this;
75885 }
75886 ThrottleSubscriber.prototype._next = function (value) {
75887 this._hasValue = true;
75888 this._sendValue = value;
75889 if (!this._throttled) {
75890 if (this._leading) {
75891 this.send();
75892 }
75893 else {
75894 this.throttle(value);
75895 }
75896 }
75897 };
75898 ThrottleSubscriber.prototype.send = function () {
75899 var _a = this, _hasValue = _a._hasValue, _sendValue = _a._sendValue;
75900 if (_hasValue) {
75901 this.destination.next(_sendValue);
75902 this.throttle(_sendValue);
75903 }
75904 this._hasValue = false;
75905 this._sendValue = null;
75906 };
75907 ThrottleSubscriber.prototype.throttle = function (value) {
75908 var duration = this.tryDurationSelector(value);
75909 if (duration) {
75910 this.add(this._throttled = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(this, duration));
75911 }
75912 };
75913 ThrottleSubscriber.prototype.tryDurationSelector = function (value) {
75914 try {
75915 return this.durationSelector(value);
75916 }
75917 catch (err) {
75918 this.destination.error(err);
75919 return null;
75920 }
75921 };
75922 ThrottleSubscriber.prototype.throttlingDone = function () {
75923 var _a = this, _throttled = _a._throttled, _trailing = _a._trailing;
75924 if (_throttled) {
75925 _throttled.unsubscribe();
75926 }
75927 this._throttled = null;
75928 if (_trailing) {
75929 this.send();
75930 }
75931 };
75932 ThrottleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
75933 this.throttlingDone();
75934 };
75935 ThrottleSubscriber.prototype.notifyComplete = function () {
75936 this.throttlingDone();
75937 };
75938 return ThrottleSubscriber;
75939}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
75940//# sourceMappingURL=throttle.js.map
75941
75942
75943/***/ }),
75944/* 407 */
75945/***/ (function(module, __webpack_exports__, __webpack_require__) {
75946
75947"use strict";
75948/* harmony export (immutable) */ __webpack_exports__["a"] = timeoutWith;
75949/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
75950/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(47);
75951/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isDate__ = __webpack_require__(413);
75952/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
75953/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
75954/** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
75955
75956
75957
75958
75959
75960function timeoutWith(due, withObservable, scheduler) {
75961 if (scheduler === void 0) {
75962 scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */];
75963 }
75964 return function (source) {
75965 var absoluteTimeout = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isDate__["a" /* isDate */])(due);
75966 var waitFor = absoluteTimeout ? (+due - scheduler.now()) : Math.abs(due);
75967 return source.lift(new TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler));
75968 };
75969}
75970var TimeoutWithOperator = /*@__PURE__*/ (function () {
75971 function TimeoutWithOperator(waitFor, absoluteTimeout, withObservable, scheduler) {
75972 this.waitFor = waitFor;
75973 this.absoluteTimeout = absoluteTimeout;
75974 this.withObservable = withObservable;
75975 this.scheduler = scheduler;
75976 }
75977 TimeoutWithOperator.prototype.call = function (subscriber, source) {
75978 return source.subscribe(new TimeoutWithSubscriber(subscriber, this.absoluteTimeout, this.waitFor, this.withObservable, this.scheduler));
75979 };
75980 return TimeoutWithOperator;
75981}());
75982var TimeoutWithSubscriber = /*@__PURE__*/ (function (_super) {
75983 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TimeoutWithSubscriber, _super);
75984 function TimeoutWithSubscriber(destination, absoluteTimeout, waitFor, withObservable, scheduler) {
75985 var _this = _super.call(this, destination) || this;
75986 _this.absoluteTimeout = absoluteTimeout;
75987 _this.waitFor = waitFor;
75988 _this.withObservable = withObservable;
75989 _this.scheduler = scheduler;
75990 _this.action = null;
75991 _this.scheduleTimeout();
75992 return _this;
75993 }
75994 TimeoutWithSubscriber.dispatchTimeout = function (subscriber) {
75995 var withObservable = subscriber.withObservable;
75996 subscriber._unsubscribeAndRecycle();
75997 subscriber.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(subscriber, withObservable));
75998 };
75999 TimeoutWithSubscriber.prototype.scheduleTimeout = function () {
76000 var action = this.action;
76001 if (action) {
76002 this.action = action.schedule(this, this.waitFor);
76003 }
76004 else {
76005 this.add(this.action = this.scheduler.schedule(TimeoutWithSubscriber.dispatchTimeout, this.waitFor, this));
76006 }
76007 };
76008 TimeoutWithSubscriber.prototype._next = function (value) {
76009 if (!this.absoluteTimeout) {
76010 this.scheduleTimeout();
76011 }
76012 _super.prototype._next.call(this, value);
76013 };
76014 TimeoutWithSubscriber.prototype._unsubscribe = function () {
76015 this.action = null;
76016 this.scheduler = null;
76017 this.withObservable = null;
76018 };
76019 return TimeoutWithSubscriber;
76020}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
76021//# sourceMappingURL=timeoutWith.js.map
76022
76023
76024/***/ }),
76025/* 408 */
76026/***/ (function(module, __webpack_exports__, __webpack_require__) {
76027
76028"use strict";
76029/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return asap; });
76030/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AsapAction__ = __webpack_require__(994);
76031/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsapScheduler__ = __webpack_require__(995);
76032/** PURE_IMPORTS_START _AsapAction,_AsapScheduler PURE_IMPORTS_END */
76033
76034
76035var asap = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__AsapScheduler__["a" /* AsapScheduler */](__WEBPACK_IMPORTED_MODULE_0__AsapAction__["a" /* AsapAction */]);
76036//# sourceMappingURL=asap.js.map
76037
76038
76039/***/ }),
76040/* 409 */
76041/***/ (function(module, __webpack_exports__, __webpack_require__) {
76042
76043"use strict";
76044/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return queue; });
76045/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__QueueAction__ = __webpack_require__(996);
76046/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__QueueScheduler__ = __webpack_require__(997);
76047/** PURE_IMPORTS_START _QueueAction,_QueueScheduler PURE_IMPORTS_END */
76048
76049
76050var queue = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__QueueScheduler__["a" /* QueueScheduler */](__WEBPACK_IMPORTED_MODULE_0__QueueAction__["a" /* QueueAction */]);
76051//# sourceMappingURL=queue.js.map
76052
76053
76054/***/ }),
76055/* 410 */
76056/***/ (function(module, __webpack_exports__, __webpack_require__) {
76057
76058"use strict";
76059/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return TimeoutError; });
76060/** PURE_IMPORTS_START PURE_IMPORTS_END */
76061function TimeoutErrorImpl() {
76062 Error.call(this);
76063 this.message = 'Timeout has occurred';
76064 this.name = 'TimeoutError';
76065 return this;
76066}
76067TimeoutErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
76068var TimeoutError = TimeoutErrorImpl;
76069//# sourceMappingURL=TimeoutError.js.map
76070
76071
76072/***/ }),
76073/* 411 */
76074/***/ (function(module, __webpack_exports__, __webpack_require__) {
76075
76076"use strict";
76077/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return UnsubscriptionError; });
76078/** PURE_IMPORTS_START PURE_IMPORTS_END */
76079function UnsubscriptionErrorImpl(errors) {
76080 Error.call(this);
76081 this.message = errors ?
76082 errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ') : '';
76083 this.name = 'UnsubscriptionError';
76084 this.errors = errors;
76085 return this;
76086}
76087UnsubscriptionErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
76088var UnsubscriptionError = UnsubscriptionErrorImpl;
76089//# sourceMappingURL=UnsubscriptionError.js.map
76090
76091
76092/***/ }),
76093/* 412 */
76094/***/ (function(module, __webpack_exports__, __webpack_require__) {
76095
76096"use strict";
76097/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return isArrayLike; });
76098/** PURE_IMPORTS_START PURE_IMPORTS_END */
76099var isArrayLike = (function (x) { return x && typeof x.length === 'number' && typeof x !== 'function'; });
76100//# sourceMappingURL=isArrayLike.js.map
76101
76102
76103/***/ }),
76104/* 413 */
76105/***/ (function(module, __webpack_exports__, __webpack_require__) {
76106
76107"use strict";
76108/* harmony export (immutable) */ __webpack_exports__["a"] = isDate;
76109/** PURE_IMPORTS_START PURE_IMPORTS_END */
76110function isDate(value) {
76111 return value instanceof Date && !isNaN(+value);
76112}
76113//# sourceMappingURL=isDate.js.map
76114
76115
76116/***/ }),
76117/* 414 */
76118/***/ (function(module, __webpack_exports__, __webpack_require__) {
76119
76120"use strict";
76121/* harmony export (immutable) */ __webpack_exports__["a"] = isObject;
76122/** PURE_IMPORTS_START PURE_IMPORTS_END */
76123function isObject(x) {
76124 return x != null && typeof x === 'object';
76125}
76126//# sourceMappingURL=isObject.js.map
76127
76128
76129/***/ }),
76130/* 415 */
76131/***/ (function(module, __webpack_exports__, __webpack_require__) {
76132
76133"use strict";
76134/* harmony export (immutable) */ __webpack_exports__["a"] = isPromise;
76135/** PURE_IMPORTS_START PURE_IMPORTS_END */
76136function isPromise(value) {
76137 return value && typeof value.subscribe !== 'function' && typeof value.then === 'function';
76138}
76139//# sourceMappingURL=isPromise.js.map
76140
76141
76142/***/ }),
76143/* 416 */
76144/***/ (function(module, __webpack_exports__, __webpack_require__) {
76145
76146"use strict";
76147/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeTo; });
76148/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
76149/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeToArray__ = __webpack_require__(417);
76150/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__subscribeToPromise__ = __webpack_require__(420);
76151/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__subscribeToIterable__ = __webpack_require__(418);
76152/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__subscribeToObservable__ = __webpack_require__(419);
76153/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__isArrayLike__ = __webpack_require__(412);
76154/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isPromise__ = __webpack_require__(415);
76155/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isObject__ = __webpack_require__(414);
76156/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__symbol_iterator__ = __webpack_require__(139);
76157/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__symbol_observable__ = __webpack_require__(112);
76158/** PURE_IMPORTS_START _Observable,_subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */
76159
76160
76161
76162
76163
76164
76165
76166
76167
76168
76169var subscribeTo = function (result) {
76170 if (result instanceof __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */]) {
76171 return function (subscriber) {
76172 if (result._isScalar) {
76173 subscriber.next(result.value);
76174 subscriber.complete();
76175 return undefined;
76176 }
76177 else {
76178 return result.subscribe(subscriber);
76179 }
76180 };
76181 }
76182 else if (result && typeof result[__WEBPACK_IMPORTED_MODULE_9__symbol_observable__["a" /* observable */]] === 'function') {
76183 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__subscribeToObservable__["a" /* subscribeToObservable */])(result);
76184 }
76185 else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__isArrayLike__["a" /* isArrayLike */])(result)) {
76186 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__subscribeToArray__["a" /* subscribeToArray */])(result);
76187 }
76188 else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__isPromise__["a" /* isPromise */])(result)) {
76189 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__subscribeToPromise__["a" /* subscribeToPromise */])(result);
76190 }
76191 else if (result && typeof result[__WEBPACK_IMPORTED_MODULE_8__symbol_iterator__["a" /* iterator */]] === 'function') {
76192 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__subscribeToIterable__["a" /* subscribeToIterable */])(result);
76193 }
76194 else {
76195 var value = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__isObject__["a" /* isObject */])(result) ? 'an invalid object' : "'" + result + "'";
76196 var msg = "You provided " + value + " where a stream was expected."
76197 + ' You can provide an Observable, Promise, Array, or Iterable.';
76198 throw new TypeError(msg);
76199 }
76200};
76201//# sourceMappingURL=subscribeTo.js.map
76202
76203
76204/***/ }),
76205/* 417 */
76206/***/ (function(module, __webpack_exports__, __webpack_require__) {
76207
76208"use strict";
76209/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToArray; });
76210/** PURE_IMPORTS_START PURE_IMPORTS_END */
76211var subscribeToArray = function (array) {
76212 return function (subscriber) {
76213 for (var i = 0, len = array.length; i < len && !subscriber.closed; i++) {
76214 subscriber.next(array[i]);
76215 }
76216 if (!subscriber.closed) {
76217 subscriber.complete();
76218 }
76219 };
76220};
76221//# sourceMappingURL=subscribeToArray.js.map
76222
76223
76224/***/ }),
76225/* 418 */
76226/***/ (function(module, __webpack_exports__, __webpack_require__) {
76227
76228"use strict";
76229/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToIterable; });
76230/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_iterator__ = __webpack_require__(139);
76231/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */
76232
76233var subscribeToIterable = function (iterable) {
76234 return function (subscriber) {
76235 var iterator = iterable[__WEBPACK_IMPORTED_MODULE_0__symbol_iterator__["a" /* iterator */]]();
76236 do {
76237 var item = iterator.next();
76238 if (item.done) {
76239 subscriber.complete();
76240 break;
76241 }
76242 subscriber.next(item.value);
76243 if (subscriber.closed) {
76244 break;
76245 }
76246 } while (true);
76247 if (typeof iterator.return === 'function') {
76248 subscriber.add(function () {
76249 if (iterator.return) {
76250 iterator.return();
76251 }
76252 });
76253 }
76254 return subscriber;
76255 };
76256};
76257//# sourceMappingURL=subscribeToIterable.js.map
76258
76259
76260/***/ }),
76261/* 419 */
76262/***/ (function(module, __webpack_exports__, __webpack_require__) {
76263
76264"use strict";
76265/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToObservable; });
76266/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_observable__ = __webpack_require__(112);
76267/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */
76268
76269var subscribeToObservable = function (obj) {
76270 return function (subscriber) {
76271 var obs = obj[__WEBPACK_IMPORTED_MODULE_0__symbol_observable__["a" /* observable */]]();
76272 if (typeof obs.subscribe !== 'function') {
76273 throw new TypeError('Provided object does not correctly implement Symbol.observable');
76274 }
76275 else {
76276 return obs.subscribe(subscriber);
76277 }
76278 };
76279};
76280//# sourceMappingURL=subscribeToObservable.js.map
76281
76282
76283/***/ }),
76284/* 420 */
76285/***/ (function(module, __webpack_exports__, __webpack_require__) {
76286
76287"use strict";
76288/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToPromise; });
76289/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__hostReportError__ = __webpack_require__(263);
76290/** PURE_IMPORTS_START _hostReportError PURE_IMPORTS_END */
76291
76292var subscribeToPromise = function (promise) {
76293 return function (subscriber) {
76294 promise.then(function (value) {
76295 if (!subscriber.closed) {
76296 subscriber.next(value);
76297 subscriber.complete();
76298 }
76299 }, function (err) { return subscriber.error(err); })
76300 .then(null, __WEBPACK_IMPORTED_MODULE_0__hostReportError__["a" /* hostReportError */]);
76301 return subscriber;
76302 };
76303};
76304//# sourceMappingURL=subscribeToPromise.js.map
76305
76306
76307/***/ }),
76308/* 421 */
76309/***/ (function(module, exports, __webpack_require__) {
76310
76311// Note: since nyc uses this module to output coverage, any lines
76312// that are in the direct sync flow of nyc's outputCoverage are
76313// ignored, since we can never get coverage for them.
76314var assert = __webpack_require__(50)
76315var signals = __webpack_require__(1006)
76316
76317var EE = __webpack_require__(95)
76318/* istanbul ignore if */
76319if (typeof EE !== 'function') {
76320 EE = EE.EventEmitter
76321}
76322
76323var emitter
76324if (process.__signal_exit_emitter__) {
76325 emitter = process.__signal_exit_emitter__
76326} else {
76327 emitter = process.__signal_exit_emitter__ = new EE()
76328 emitter.count = 0
76329 emitter.emitted = {}
76330}
76331
76332// Because this emitter is a global, we have to check to see if a
76333// previous version of this library failed to enable infinite listeners.
76334// I know what you're about to say. But literally everything about
76335// signal-exit is a compromise with evil. Get used to it.
76336if (!emitter.infinite) {
76337 emitter.setMaxListeners(Infinity)
76338 emitter.infinite = true
76339}
76340
76341module.exports = function (cb, opts) {
76342 assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
76343
76344 if (loaded === false) {
76345 load()
76346 }
76347
76348 var ev = 'exit'
76349 if (opts && opts.alwaysLast) {
76350 ev = 'afterexit'
76351 }
76352
76353 var remove = function () {
76354 emitter.removeListener(ev, cb)
76355 if (emitter.listeners('exit').length === 0 &&
76356 emitter.listeners('afterexit').length === 0) {
76357 unload()
76358 }
76359 }
76360 emitter.on(ev, cb)
76361
76362 return remove
76363}
76364
76365module.exports.unload = unload
76366function unload () {
76367 if (!loaded) {
76368 return
76369 }
76370 loaded = false
76371
76372 signals.forEach(function (sig) {
76373 try {
76374 process.removeListener(sig, sigListeners[sig])
76375 } catch (er) {}
76376 })
76377 process.emit = originalProcessEmit
76378 process.reallyExit = originalProcessReallyExit
76379 emitter.count -= 1
76380}
76381
76382function emit (event, code, signal) {
76383 if (emitter.emitted[event]) {
76384 return
76385 }
76386 emitter.emitted[event] = true
76387 emitter.emit(event, code, signal)
76388}
76389
76390// { <signal>: <listener fn>, ... }
76391var sigListeners = {}
76392signals.forEach(function (sig) {
76393 sigListeners[sig] = function listener () {
76394 // If there are no other listeners, an exit is coming!
76395 // Simplest way: remove us and then re-send the signal.
76396 // We know that this will kill the process, so we can
76397 // safely emit now.
76398 var listeners = process.listeners(sig)
76399 if (listeners.length === emitter.count) {
76400 unload()
76401 emit('exit', null, sig)
76402 /* istanbul ignore next */
76403 emit('afterexit', null, sig)
76404 /* istanbul ignore next */
76405 process.kill(process.pid, sig)
76406 }
76407 }
76408})
76409
76410module.exports.signals = function () {
76411 return signals
76412}
76413
76414module.exports.load = load
76415
76416var loaded = false
76417
76418function load () {
76419 if (loaded) {
76420 return
76421 }
76422 loaded = true
76423
76424 // This is the number of onSignalExit's that are in play.
76425 // It's important so that we can count the correct number of
76426 // listeners on signals, and don't wait for the other one to
76427 // handle it instead of us.
76428 emitter.count += 1
76429
76430 signals = signals.filter(function (sig) {
76431 try {
76432 process.on(sig, sigListeners[sig])
76433 return true
76434 } catch (er) {
76435 return false
76436 }
76437 })
76438
76439 process.emit = processEmit
76440 process.reallyExit = processReallyExit
76441}
76442
76443var originalProcessReallyExit = process.reallyExit
76444function processReallyExit (code) {
76445 process.exitCode = code || 0
76446 emit('exit', process.exitCode, null)
76447 /* istanbul ignore next */
76448 emit('afterexit', process.exitCode, null)
76449 /* istanbul ignore next */
76450 originalProcessReallyExit.call(process, process.exitCode)
76451}
76452
76453var originalProcessEmit = process.emit
76454function processEmit (ev, arg) {
76455 if (ev === 'exit') {
76456 if (arg !== undefined) {
76457 process.exitCode = arg
76458 }
76459 var ret = originalProcessEmit.apply(this, arguments)
76460 emit('exit', process.exitCode, null)
76461 /* istanbul ignore next */
76462 emit('afterexit', process.exitCode, null)
76463 return ret
76464 } else {
76465 return originalProcessEmit.apply(this, arguments)
76466 }
76467}
76468
76469
76470/***/ }),
76471/* 422 */
76472/***/ (function(module, exports, __webpack_require__) {
76473
76474"use strict";
76475
76476
76477var scan = __webpack_require__(1011)
76478var parse = __webpack_require__(1010)
76479
76480module.exports = function (source) {
76481 return parse(scan(source))
76482}
76483
76484
76485/***/ }),
76486/* 423 */
76487/***/ (function(module, exports) {
76488
76489module.exports = ["0BSD","AAL","Abstyles","Adobe-2006","Adobe-Glyph","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","Afmparse","AGPL-1.0","AGPL-3.0-only","AGPL-3.0-or-later","Aladdin","AMDPLPA","AML","AMPAS","ANTLR-PD","Apache-1.0","Apache-1.1","Apache-2.0","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","Artistic-1.0-cl8","Artistic-1.0-Perl","Artistic-1.0","Artistic-2.0","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Borceux","BSD-1-Clause","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","BSD-2-Clause-Patent","BSD-2-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-LBNL","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause","BSD-4-Clause-UC","BSD-4-Clause","BSD-Protection","BSD-Source-Code","BSL-1.0","bzip2-1.0.5","bzip2-1.0.6","Caldera","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-3.0","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-4.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDLA-Permissive-1.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","ClArtistic","CNRI-Jython","CNRI-Python-GPL-Compatible","CNRI-Python","Condor-1.1","CPAL-1.0","CPL-1.0","CPOL-1.02","Crossword","CrystalStacker","CUA-OPL-1.0","Cube","curl","D-FSL-1.0","diffmark","DOC","Dotseqn","DSDP","dvipdfm","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","eGenix","Entessa","EPL-1.0","EPL-2.0","ErlPL-1.1","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Eurosym","Fair","Frameworx-1.0","FreeImage","FSFAP","FSFUL","FSFULLR","FTL","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-only","GFDL-1.3-or-later","Giftware","GL2PS","Glide","Glulxe","gnuplot","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","gSOAP-1.3b","HaskellReport","HPND","IBM-pibs","ICU","IJG","ImageMagick","iMatix","Imlib2","Info-ZIP","Intel-ACPI","Intel","Interbase-1.0","IPA","IPL-1.0","ISC","JasPer-2.0","JSON","LAL-1.2","LAL-1.3","Latex2e","Leptonica","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","Libpng","libtiff","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","MakeIndex","MirOS","MIT-advertising","MIT-CMU","MIT-enna","MIT-feh","MIT","MITNFA","Motosoto","mpich2","MPL-1.0","MPL-1.1","MPL-2.0-no-copyleft-exception","MPL-2.0","MS-PL","MS-RL","MTLL","Multics","Mup","NASA-1.3","Naumen","NBPL-1.0","NCSA","Net-SNMP","NetCDF","Newsletr","NGPL","NLOD-1.0","NLPL","Nokia","NOSL","Noweb","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTP","OCCT-PL","OCLC-2.0","ODbL-1.0","OFL-1.0","OFL-1.1","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0.1","OLDAP-2.0","OLDAP-2.1","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OML","OpenSSL","OPL-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","PDDL-1.0","PHP-3.0","PHP-3.01","Plexus","PostgreSQL","psfrag","psutils","Python-2.0","Qhull","QPL-1.0","Rdisc","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Ruby","SAX-PD","Saxpath","SCEA","Sendmail","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SimPL-2.0","SISSL-1.2","SISSL","Sleepycat","SMLNJ","SMPPL","SNIA","Spencer-86","Spencer-94","Spencer-99","SPL-1.0","SugarCRM-1.1.3","SWL","TCL","TCP-wrappers","TMate","TORQUE-1.1","TOSL","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","Unlicense","UPL-1.0","Vim","VOSTROM","VSL-1.0","W3C-19980720","W3C-20150513","W3C","Watcom-1.0","Wsuipa","WTFPL","X11","Xerox","XFree86-1.1","xinetd","Xnet","xpp","XSkat","YPL-1.0","YPL-1.1","Zed","Zend-2.0","Zimbra-1.3","Zimbra-1.4","zlib-acknowledgement","Zlib","ZPL-1.1","ZPL-2.0","ZPL-2.1"]
76490
76491/***/ }),
76492/* 424 */
76493/***/ (function(module, exports, __webpack_require__) {
76494
76495// Copyright 2015 Joyent, Inc.
76496
76497module.exports = {
76498 Verifier: Verifier,
76499 Signer: Signer
76500};
76501
76502var nacl;
76503var stream = __webpack_require__(35);
76504var util = __webpack_require__(9);
76505var assert = __webpack_require__(22);
76506var Buffer = __webpack_require__(20).Buffer;
76507var Signature = __webpack_require__(70);
76508
76509function Verifier(key, hashAlgo) {
76510 if (nacl === undefined)
76511 nacl = __webpack_require__(71);
76512
76513 if (hashAlgo.toLowerCase() !== 'sha512')
76514 throw (new Error('ED25519 only supports the use of ' +
76515 'SHA-512 hashes'));
76516
76517 this.key = key;
76518 this.chunks = [];
76519
76520 stream.Writable.call(this, {});
76521}
76522util.inherits(Verifier, stream.Writable);
76523
76524Verifier.prototype._write = function (chunk, enc, cb) {
76525 this.chunks.push(chunk);
76526 cb();
76527};
76528
76529Verifier.prototype.update = function (chunk) {
76530 if (typeof (chunk) === 'string')
76531 chunk = Buffer.from(chunk, 'binary');
76532 this.chunks.push(chunk);
76533};
76534
76535Verifier.prototype.verify = function (signature, fmt) {
76536 var sig;
76537 if (Signature.isSignature(signature, [2, 0])) {
76538 if (signature.type !== 'ed25519')
76539 return (false);
76540 sig = signature.toBuffer('raw');
76541
76542 } else if (typeof (signature) === 'string') {
76543 sig = Buffer.from(signature, 'base64');
76544
76545 } else if (Signature.isSignature(signature, [1, 0])) {
76546 throw (new Error('signature was created by too old ' +
76547 'a version of sshpk and cannot be verified'));
76548 }
76549
76550 assert.buffer(sig);
76551 return (nacl.sign.detached.verify(
76552 new Uint8Array(Buffer.concat(this.chunks)),
76553 new Uint8Array(sig),
76554 new Uint8Array(this.key.part.A.data)));
76555};
76556
76557function Signer(key, hashAlgo) {
76558 if (nacl === undefined)
76559 nacl = __webpack_require__(71);
76560
76561 if (hashAlgo.toLowerCase() !== 'sha512')
76562 throw (new Error('ED25519 only supports the use of ' +
76563 'SHA-512 hashes'));
76564
76565 this.key = key;
76566 this.chunks = [];
76567
76568 stream.Writable.call(this, {});
76569}
76570util.inherits(Signer, stream.Writable);
76571
76572Signer.prototype._write = function (chunk, enc, cb) {
76573 this.chunks.push(chunk);
76574 cb();
76575};
76576
76577Signer.prototype.update = function (chunk) {
76578 if (typeof (chunk) === 'string')
76579 chunk = Buffer.from(chunk, 'binary');
76580 this.chunks.push(chunk);
76581};
76582
76583Signer.prototype.sign = function () {
76584 var sig = nacl.sign.detached(
76585 new Uint8Array(Buffer.concat(this.chunks)),
76586 new Uint8Array(Buffer.concat([
76587 this.key.part.k.data, this.key.part.A.data])));
76588 var sigBuf = Buffer.from(sig);
76589 var sigObj = Signature.parse(sigBuf, 'ed25519', 'raw');
76590 sigObj.hashAlgorithm = 'sha512';
76591 return (sigObj);
76592};
76593
76594
76595/***/ }),
76596/* 425 */
76597/***/ (function(module, exports, __webpack_require__) {
76598
76599// Copyright 2015 Joyent, Inc.
76600
76601module.exports = {
76602 read: read,
76603 write: write
76604};
76605
76606var assert = __webpack_require__(22);
76607var Buffer = __webpack_require__(20).Buffer;
76608var utils = __webpack_require__(32);
76609var Key = __webpack_require__(34);
76610var PrivateKey = __webpack_require__(40);
76611
76612var pem = __webpack_require__(82);
76613var ssh = __webpack_require__(426);
76614var rfc4253 = __webpack_require__(92);
76615var dnssec = __webpack_require__(266);
76616
76617var DNSSEC_PRIVKEY_HEADER_PREFIX = 'Private-key-format: v1';
76618
76619function read(buf, options) {
76620 if (typeof (buf) === 'string') {
76621 if (buf.trim().match(/^[-]+[ ]*BEGIN/))
76622 return (pem.read(buf, options));
76623 if (buf.match(/^\s*ssh-[a-z]/))
76624 return (ssh.read(buf, options));
76625 if (buf.match(/^\s*ecdsa-/))
76626 return (ssh.read(buf, options));
76627 if (findDNSSECHeader(buf))
76628 return (dnssec.read(buf, options));
76629 buf = Buffer.from(buf, 'binary');
76630 } else {
76631 assert.buffer(buf);
76632 if (findPEMHeader(buf))
76633 return (pem.read(buf, options));
76634 if (findSSHHeader(buf))
76635 return (ssh.read(buf, options));
76636 if (findDNSSECHeader(buf))
76637 return (dnssec.read(buf, options));
76638 }
76639 if (buf.readUInt32BE(0) < buf.length)
76640 return (rfc4253.read(buf, options));
76641 throw (new Error('Failed to auto-detect format of key'));
76642}
76643
76644function findSSHHeader(buf) {
76645 var offset = 0;
76646 while (offset < buf.length &&
76647 (buf[offset] === 32 || buf[offset] === 10 || buf[offset] === 9))
76648 ++offset;
76649 if (offset + 4 <= buf.length &&
76650 buf.slice(offset, offset + 4).toString('ascii') === 'ssh-')
76651 return (true);
76652 if (offset + 6 <= buf.length &&
76653 buf.slice(offset, offset + 6).toString('ascii') === 'ecdsa-')
76654 return (true);
76655 return (false);
76656}
76657
76658function findPEMHeader(buf) {
76659 var offset = 0;
76660 while (offset < buf.length &&
76661 (buf[offset] === 32 || buf[offset] === 10))
76662 ++offset;
76663 if (buf[offset] !== 45)
76664 return (false);
76665 while (offset < buf.length &&
76666 (buf[offset] === 45))
76667 ++offset;
76668 while (offset < buf.length &&
76669 (buf[offset] === 32))
76670 ++offset;
76671 if (offset + 5 > buf.length ||
76672 buf.slice(offset, offset + 5).toString('ascii') !== 'BEGIN')
76673 return (false);
76674 return (true);
76675}
76676
76677function findDNSSECHeader(buf) {
76678 // private case first
76679 if (buf.length <= DNSSEC_PRIVKEY_HEADER_PREFIX.length)
76680 return (false);
76681 var headerCheck = buf.slice(0, DNSSEC_PRIVKEY_HEADER_PREFIX.length);
76682 if (headerCheck.toString('ascii') === DNSSEC_PRIVKEY_HEADER_PREFIX)
76683 return (true);
76684
76685 // public-key RFC3110 ?
76686 // 'domain.com. IN KEY ...' or 'domain.com. IN DNSKEY ...'
76687 // skip any comment-lines
76688 if (typeof (buf) !== 'string') {
76689 buf = buf.toString('ascii');
76690 }
76691 var lines = buf.split('\n');
76692 var line = 0;
76693 /* JSSTYLED */
76694 while (lines[line].match(/^\;/))
76695 line++;
76696 if (lines[line].toString('ascii').match(/\. IN KEY /))
76697 return (true);
76698 if (lines[line].toString('ascii').match(/\. IN DNSKEY /))
76699 return (true);
76700 return (false);
76701}
76702
76703function write(key, options) {
76704 throw (new Error('"auto" format cannot be used for writing'));
76705}
76706
76707
76708/***/ }),
76709/* 426 */
76710/***/ (function(module, exports, __webpack_require__) {
76711
76712// Copyright 2015 Joyent, Inc.
76713
76714module.exports = {
76715 read: read,
76716 write: write
76717};
76718
76719var assert = __webpack_require__(22);
76720var Buffer = __webpack_require__(20).Buffer;
76721var rfc4253 = __webpack_require__(92);
76722var utils = __webpack_require__(32);
76723var Key = __webpack_require__(34);
76724var PrivateKey = __webpack_require__(40);
76725
76726var sshpriv = __webpack_require__(183);
76727
76728/*JSSTYLED*/
76729var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/;
76730/*JSSTYLED*/
76731var SSHKEY_RE2 = /^([a-z0-9-]+)[ \t\n]+([a-zA-Z0-9+\/][a-zA-Z0-9+\/ \t\n=]*)([^a-zA-Z0-9+\/ \t\n=].*)?$/;
76732
76733function read(buf, options) {
76734 if (typeof (buf) !== 'string') {
76735 assert.buffer(buf, 'buf');
76736 buf = buf.toString('ascii');
76737 }
76738
76739 var trimmed = buf.trim().replace(/[\\\r]/g, '');
76740 var m = trimmed.match(SSHKEY_RE);
76741 if (!m)
76742 m = trimmed.match(SSHKEY_RE2);
76743 assert.ok(m, 'key must match regex');
76744
76745 var type = rfc4253.algToKeyType(m[1]);
76746 var kbuf = Buffer.from(m[2], 'base64');
76747
76748 /*
76749 * This is a bit tricky. If we managed to parse the key and locate the
76750 * key comment with the regex, then do a non-partial read and assert
76751 * that we have consumed all bytes. If we couldn't locate the key
76752 * comment, though, there may be whitespace shenanigans going on that
76753 * have conjoined the comment to the rest of the key. We do a partial
76754 * read in this case to try to make the best out of a sorry situation.
76755 */
76756 var key;
76757 var ret = {};
76758 if (m[4]) {
76759 try {
76760 key = rfc4253.read(kbuf);
76761
76762 } catch (e) {
76763 m = trimmed.match(SSHKEY_RE2);
76764 assert.ok(m, 'key must match regex');
76765 kbuf = Buffer.from(m[2], 'base64');
76766 key = rfc4253.readInternal(ret, 'public', kbuf);
76767 }
76768 } else {
76769 key = rfc4253.readInternal(ret, 'public', kbuf);
76770 }
76771
76772 assert.strictEqual(type, key.type);
76773
76774 if (m[4] && m[4].length > 0) {
76775 key.comment = m[4];
76776
76777 } else if (ret.consumed) {
76778 /*
76779 * Now the magic: trying to recover the key comment when it's
76780 * gotten conjoined to the key or otherwise shenanigan'd.
76781 *
76782 * Work out how much base64 we used, then drop all non-base64
76783 * chars from the beginning up to this point in the the string.
76784 * Then offset in this and try to make up for missing = chars.
76785 */
76786 var data = m[2] + (m[3] ? m[3] : '');
76787 var realOffset = Math.ceil(ret.consumed / 3) * 4;
76788 data = data.slice(0, realOffset - 2). /*JSSTYLED*/
76789 replace(/[^a-zA-Z0-9+\/=]/g, '') +
76790 data.slice(realOffset - 2);
76791
76792 var padding = ret.consumed % 3;
76793 if (padding > 0 &&
76794 data.slice(realOffset - 1, realOffset) !== '=')
76795 realOffset--;
76796 while (data.slice(realOffset, realOffset + 1) === '=')
76797 realOffset++;
76798
76799 /* Finally, grab what we think is the comment & clean it up. */
76800 var trailer = data.slice(realOffset);
76801 trailer = trailer.replace(/[\r\n]/g, ' ').
76802 replace(/^\s+/, '');
76803 if (trailer.match(/^[a-zA-Z0-9]/))
76804 key.comment = trailer;
76805 }
76806
76807 return (key);
76808}
76809
76810function write(key, options) {
76811 assert.object(key);
76812 if (!Key.isKey(key))
76813 throw (new Error('Must be a public key'));
76814
76815 var parts = [];
76816 var alg = rfc4253.keyTypeToAlg(key);
76817 parts.push(alg);
76818
76819 var buf = rfc4253.write(key);
76820 parts.push(buf.toString('base64'));
76821
76822 if (key.comment)
76823 parts.push(key.comment);
76824
76825 return (Buffer.from(parts.join(' ')));
76826}
76827
76828
76829/***/ }),
76830/* 427 */
76831/***/ (function(module, exports, __webpack_require__) {
76832
76833// Copyright 2017 Joyent, Inc.
76834
76835module.exports = {
76836 read: read,
76837 verify: verify,
76838 sign: sign,
76839 signAsync: signAsync,
76840 write: write
76841};
76842
76843var assert = __webpack_require__(22);
76844var asn1 = __webpack_require__(66);
76845var Buffer = __webpack_require__(20).Buffer;
76846var algs = __webpack_require__(39);
76847var utils = __webpack_require__(32);
76848var Key = __webpack_require__(34);
76849var PrivateKey = __webpack_require__(40);
76850var pem = __webpack_require__(82);
76851var Identity = __webpack_require__(146);
76852var Signature = __webpack_require__(70);
76853var Certificate = __webpack_require__(143);
76854var pkcs8 = __webpack_require__(145);
76855
76856/*
76857 * This file is based on RFC5280 (X.509).
76858 */
76859
76860/* Helper to read in a single mpint */
76861function readMPInt(der, nm) {
76862 assert.strictEqual(der.peek(), asn1.Ber.Integer,
76863 nm + ' is not an Integer');
76864 return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true)));
76865}
76866
76867function verify(cert, key) {
76868 var sig = cert.signatures.x509;
76869 assert.object(sig, 'x509 signature');
76870
76871 var algParts = sig.algo.split('-');
76872 if (algParts[0] !== key.type)
76873 return (false);
76874
76875 var blob = sig.cache;
76876 if (blob === undefined) {
76877 var der = new asn1.BerWriter();
76878 writeTBSCert(cert, der);
76879 blob = der.buffer;
76880 }
76881
76882 var verifier = key.createVerify(algParts[1]);
76883 verifier.write(blob);
76884 return (verifier.verify(sig.signature));
76885}
76886
76887function Local(i) {
76888 return (asn1.Ber.Context | asn1.Ber.Constructor | i);
76889}
76890
76891function Context(i) {
76892 return (asn1.Ber.Context | i);
76893}
76894
76895var SIGN_ALGS = {
76896 'rsa-md5': '1.2.840.113549.1.1.4',
76897 'rsa-sha1': '1.2.840.113549.1.1.5',
76898 'rsa-sha256': '1.2.840.113549.1.1.11',
76899 'rsa-sha384': '1.2.840.113549.1.1.12',
76900 'rsa-sha512': '1.2.840.113549.1.1.13',
76901 'dsa-sha1': '1.2.840.10040.4.3',
76902 'dsa-sha256': '2.16.840.1.101.3.4.3.2',
76903 'ecdsa-sha1': '1.2.840.10045.4.1',
76904 'ecdsa-sha256': '1.2.840.10045.4.3.2',
76905 'ecdsa-sha384': '1.2.840.10045.4.3.3',
76906 'ecdsa-sha512': '1.2.840.10045.4.3.4',
76907 'ed25519-sha512': '1.3.101.112'
76908};
76909Object.keys(SIGN_ALGS).forEach(function (k) {
76910 SIGN_ALGS[SIGN_ALGS[k]] = k;
76911});
76912SIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5';
76913SIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1';
76914
76915var EXTS = {
76916 'issuerKeyId': '2.5.29.35',
76917 'altName': '2.5.29.17',
76918 'basicConstraints': '2.5.29.19',
76919 'keyUsage': '2.5.29.15',
76920 'extKeyUsage': '2.5.29.37'
76921};
76922
76923function read(buf, options) {
76924 if (typeof (buf) === 'string') {
76925 buf = Buffer.from(buf, 'binary');
76926 }
76927 assert.buffer(buf, 'buf');
76928
76929 var der = new asn1.BerReader(buf);
76930
76931 der.readSequence();
76932 if (Math.abs(der.length - der.remain) > 1) {
76933 throw (new Error('DER sequence does not contain whole byte ' +
76934 'stream'));
76935 }
76936
76937 var tbsStart = der.offset;
76938 der.readSequence();
76939 var sigOffset = der.offset + der.length;
76940 var tbsEnd = sigOffset;
76941
76942 if (der.peek() === Local(0)) {
76943 der.readSequence(Local(0));
76944 var version = der.readInt();
76945 assert.ok(version <= 3,
76946 'only x.509 versions up to v3 supported');
76947 }
76948
76949 var cert = {};
76950 cert.signatures = {};
76951 var sig = (cert.signatures.x509 = {});
76952 sig.extras = {};
76953
76954 cert.serial = readMPInt(der, 'serial');
76955
76956 der.readSequence();
76957 var after = der.offset + der.length;
76958 var certAlgOid = der.readOID();
76959 var certAlg = SIGN_ALGS[certAlgOid];
76960 if (certAlg === undefined)
76961 throw (new Error('unknown signature algorithm ' + certAlgOid));
76962
76963 der._offset = after;
76964 cert.issuer = Identity.parseAsn1(der);
76965
76966 der.readSequence();
76967 cert.validFrom = readDate(der);
76968 cert.validUntil = readDate(der);
76969
76970 cert.subjects = [Identity.parseAsn1(der)];
76971
76972 der.readSequence();
76973 after = der.offset + der.length;
76974 cert.subjectKey = pkcs8.readPkcs8(undefined, 'public', der);
76975 der._offset = after;
76976
76977 /* issuerUniqueID */
76978 if (der.peek() === Local(1)) {
76979 der.readSequence(Local(1));
76980 sig.extras.issuerUniqueID =
76981 buf.slice(der.offset, der.offset + der.length);
76982 der._offset += der.length;
76983 }
76984
76985 /* subjectUniqueID */
76986 if (der.peek() === Local(2)) {
76987 der.readSequence(Local(2));
76988 sig.extras.subjectUniqueID =
76989 buf.slice(der.offset, der.offset + der.length);
76990 der._offset += der.length;
76991 }
76992
76993 /* extensions */
76994 if (der.peek() === Local(3)) {
76995 der.readSequence(Local(3));
76996 var extEnd = der.offset + der.length;
76997 der.readSequence();
76998
76999 while (der.offset < extEnd)
77000 readExtension(cert, buf, der);
77001
77002 assert.strictEqual(der.offset, extEnd);
77003 }
77004
77005 assert.strictEqual(der.offset, sigOffset);
77006
77007 der.readSequence();
77008 after = der.offset + der.length;
77009 var sigAlgOid = der.readOID();
77010 var sigAlg = SIGN_ALGS[sigAlgOid];
77011 if (sigAlg === undefined)
77012 throw (new Error('unknown signature algorithm ' + sigAlgOid));
77013 der._offset = after;
77014
77015 var sigData = der.readString(asn1.Ber.BitString, true);
77016 if (sigData[0] === 0)
77017 sigData = sigData.slice(1);
77018 var algParts = sigAlg.split('-');
77019
77020 sig.signature = Signature.parse(sigData, algParts[0], 'asn1');
77021 sig.signature.hashAlgorithm = algParts[1];
77022 sig.algo = sigAlg;
77023 sig.cache = buf.slice(tbsStart, tbsEnd);
77024
77025 return (new Certificate(cert));
77026}
77027
77028function readDate(der) {
77029 if (der.peek() === asn1.Ber.UTCTime) {
77030 return (utcTimeToDate(der.readString(asn1.Ber.UTCTime)));
77031 } else if (der.peek() === asn1.Ber.GeneralizedTime) {
77032 return (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime)));
77033 } else {
77034 throw (new Error('Unsupported date format'));
77035 }
77036}
77037
77038/* RFC5280, section 4.2.1.6 (GeneralName type) */
77039var ALTNAME = {
77040 OtherName: Local(0),
77041 RFC822Name: Context(1),
77042 DNSName: Context(2),
77043 X400Address: Local(3),
77044 DirectoryName: Local(4),
77045 EDIPartyName: Local(5),
77046 URI: Context(6),
77047 IPAddress: Context(7),
77048 OID: Context(8)
77049};
77050
77051/* RFC5280, section 4.2.1.12 (KeyPurposeId) */
77052var EXTPURPOSE = {
77053 'serverAuth': '1.3.6.1.5.5.7.3.1',
77054 'clientAuth': '1.3.6.1.5.5.7.3.2',
77055 'codeSigning': '1.3.6.1.5.5.7.3.3',
77056
77057 /* See https://github.com/joyent/oid-docs/blob/master/root.md */
77058 'joyentDocker': '1.3.6.1.4.1.38678.1.4.1',
77059 'joyentCmon': '1.3.6.1.4.1.38678.1.4.2'
77060};
77061var EXTPURPOSE_REV = {};
77062Object.keys(EXTPURPOSE).forEach(function (k) {
77063 EXTPURPOSE_REV[EXTPURPOSE[k]] = k;
77064});
77065
77066var KEYUSEBITS = [
77067 'signature', 'identity', 'keyEncryption',
77068 'encryption', 'keyAgreement', 'ca', 'crl'
77069];
77070
77071function readExtension(cert, buf, der) {
77072 der.readSequence();
77073 var after = der.offset + der.length;
77074 var extId = der.readOID();
77075 var id;
77076 var sig = cert.signatures.x509;
77077 sig.extras.exts = [];
77078
77079 var critical;
77080 if (der.peek() === asn1.Ber.Boolean)
77081 critical = der.readBoolean();
77082
77083 switch (extId) {
77084 case (EXTS.basicConstraints):
77085 der.readSequence(asn1.Ber.OctetString);
77086 der.readSequence();
77087 var bcEnd = der.offset + der.length;
77088 var ca = false;
77089 if (der.peek() === asn1.Ber.Boolean)
77090 ca = der.readBoolean();
77091 if (cert.purposes === undefined)
77092 cert.purposes = [];
77093 if (ca === true)
77094 cert.purposes.push('ca');
77095 var bc = { oid: extId, critical: critical };
77096 if (der.offset < bcEnd && der.peek() === asn1.Ber.Integer)
77097 bc.pathLen = der.readInt();
77098 sig.extras.exts.push(bc);
77099 break;
77100 case (EXTS.extKeyUsage):
77101 der.readSequence(asn1.Ber.OctetString);
77102 der.readSequence();
77103 if (cert.purposes === undefined)
77104 cert.purposes = [];
77105 var ekEnd = der.offset + der.length;
77106 while (der.offset < ekEnd) {
77107 var oid = der.readOID();
77108 cert.purposes.push(EXTPURPOSE_REV[oid] || oid);
77109 }
77110 /*
77111 * This is a bit of a hack: in the case where we have a cert
77112 * that's only allowed to do serverAuth or clientAuth (and not
77113 * the other), we want to make sure all our Subjects are of
77114 * the right type. But we already parsed our Subjects and
77115 * decided if they were hosts or users earlier (since it appears
77116 * first in the cert).
77117 *
77118 * So we go through and mutate them into the right kind here if
77119 * it doesn't match. This might not be hugely beneficial, as it
77120 * seems that single-purpose certs are not often seen in the
77121 * wild.
77122 */
77123 if (cert.purposes.indexOf('serverAuth') !== -1 &&
77124 cert.purposes.indexOf('clientAuth') === -1) {
77125 cert.subjects.forEach(function (ide) {
77126 if (ide.type !== 'host') {
77127 ide.type = 'host';
77128 ide.hostname = ide.uid ||
77129 ide.email ||
77130 ide.components[0].value;
77131 }
77132 });
77133 } else if (cert.purposes.indexOf('clientAuth') !== -1 &&
77134 cert.purposes.indexOf('serverAuth') === -1) {
77135 cert.subjects.forEach(function (ide) {
77136 if (ide.type !== 'user') {
77137 ide.type = 'user';
77138 ide.uid = ide.hostname ||
77139 ide.email ||
77140 ide.components[0].value;
77141 }
77142 });
77143 }
77144 sig.extras.exts.push({ oid: extId, critical: critical });
77145 break;
77146 case (EXTS.keyUsage):
77147 der.readSequence(asn1.Ber.OctetString);
77148 var bits = der.readString(asn1.Ber.BitString, true);
77149 var setBits = readBitField(bits, KEYUSEBITS);
77150 setBits.forEach(function (bit) {
77151 if (cert.purposes === undefined)
77152 cert.purposes = [];
77153 if (cert.purposes.indexOf(bit) === -1)
77154 cert.purposes.push(bit);
77155 });
77156 sig.extras.exts.push({ oid: extId, critical: critical,
77157 bits: bits });
77158 break;
77159 case (EXTS.altName):
77160 der.readSequence(asn1.Ber.OctetString);
77161 der.readSequence();
77162 var aeEnd = der.offset + der.length;
77163 while (der.offset < aeEnd) {
77164 switch (der.peek()) {
77165 case ALTNAME.OtherName:
77166 case ALTNAME.EDIPartyName:
77167 der.readSequence();
77168 der._offset += der.length;
77169 break;
77170 case ALTNAME.OID:
77171 der.readOID(ALTNAME.OID);
77172 break;
77173 case ALTNAME.RFC822Name:
77174 /* RFC822 specifies email addresses */
77175 var email = der.readString(ALTNAME.RFC822Name);
77176 id = Identity.forEmail(email);
77177 if (!cert.subjects[0].equals(id))
77178 cert.subjects.push(id);
77179 break;
77180 case ALTNAME.DirectoryName:
77181 der.readSequence(ALTNAME.DirectoryName);
77182 id = Identity.parseAsn1(der);
77183 if (!cert.subjects[0].equals(id))
77184 cert.subjects.push(id);
77185 break;
77186 case ALTNAME.DNSName:
77187 var host = der.readString(
77188 ALTNAME.DNSName);
77189 id = Identity.forHost(host);
77190 if (!cert.subjects[0].equals(id))
77191 cert.subjects.push(id);
77192 break;
77193 default:
77194 der.readString(der.peek());
77195 break;
77196 }
77197 }
77198 sig.extras.exts.push({ oid: extId, critical: critical });
77199 break;
77200 default:
77201 sig.extras.exts.push({
77202 oid: extId,
77203 critical: critical,
77204 data: der.readString(asn1.Ber.OctetString, true)
77205 });
77206 break;
77207 }
77208
77209 der._offset = after;
77210}
77211
77212var UTCTIME_RE =
77213 /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;
77214function utcTimeToDate(t) {
77215 var m = t.match(UTCTIME_RE);
77216 assert.ok(m, 'timestamps must be in UTC');
77217 var d = new Date();
77218
77219 var thisYear = d.getUTCFullYear();
77220 var century = Math.floor(thisYear / 100) * 100;
77221
77222 var year = parseInt(m[1], 10);
77223 if (thisYear % 100 < 50 && year >= 60)
77224 year += (century - 1);
77225 else
77226 year += century;
77227 d.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10));
77228 d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10));
77229 if (m[6] && m[6].length > 0)
77230 d.setUTCSeconds(parseInt(m[6], 10));
77231 return (d);
77232}
77233
77234var GTIME_RE =
77235 /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/;
77236function gTimeToDate(t) {
77237 var m = t.match(GTIME_RE);
77238 assert.ok(m);
77239 var d = new Date();
77240
77241 d.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1,
77242 parseInt(m[3], 10));
77243 d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10));
77244 if (m[6] && m[6].length > 0)
77245 d.setUTCSeconds(parseInt(m[6], 10));
77246 return (d);
77247}
77248
77249function zeroPad(n) {
77250 var s = '' + n;
77251 while (s.length < 2)
77252 s = '0' + s;
77253 return (s);
77254}
77255
77256function dateToUTCTime(d) {
77257 var s = '';
77258 s += zeroPad(d.getUTCFullYear() % 100);
77259 s += zeroPad(d.getUTCMonth() + 1);
77260 s += zeroPad(d.getUTCDate());
77261 s += zeroPad(d.getUTCHours());
77262 s += zeroPad(d.getUTCMinutes());
77263 s += zeroPad(d.getUTCSeconds());
77264 s += 'Z';
77265 return (s);
77266}
77267
77268function sign(cert, key) {
77269 if (cert.signatures.x509 === undefined)
77270 cert.signatures.x509 = {};
77271 var sig = cert.signatures.x509;
77272
77273 sig.algo = key.type + '-' + key.defaultHashAlgorithm();
77274 if (SIGN_ALGS[sig.algo] === undefined)
77275 return (false);
77276
77277 var der = new asn1.BerWriter();
77278 writeTBSCert(cert, der);
77279 var blob = der.buffer;
77280 sig.cache = blob;
77281
77282 var signer = key.createSign();
77283 signer.write(blob);
77284 cert.signatures.x509.signature = signer.sign();
77285
77286 return (true);
77287}
77288
77289function signAsync(cert, signer, done) {
77290 if (cert.signatures.x509 === undefined)
77291 cert.signatures.x509 = {};
77292 var sig = cert.signatures.x509;
77293
77294 var der = new asn1.BerWriter();
77295 writeTBSCert(cert, der);
77296 var blob = der.buffer;
77297 sig.cache = blob;
77298
77299 signer(blob, function (err, signature) {
77300 if (err) {
77301 done(err);
77302 return;
77303 }
77304 sig.algo = signature.type + '-' + signature.hashAlgorithm;
77305 if (SIGN_ALGS[sig.algo] === undefined) {
77306 done(new Error('Invalid signing algorithm "' +
77307 sig.algo + '"'));
77308 return;
77309 }
77310 sig.signature = signature;
77311 done();
77312 });
77313}
77314
77315function write(cert, options) {
77316 var sig = cert.signatures.x509;
77317 assert.object(sig, 'x509 signature');
77318
77319 var der = new asn1.BerWriter();
77320 der.startSequence();
77321 if (sig.cache) {
77322 der._ensure(sig.cache.length);
77323 sig.cache.copy(der._buf, der._offset);
77324 der._offset += sig.cache.length;
77325 } else {
77326 writeTBSCert(cert, der);
77327 }
77328
77329 der.startSequence();
77330 der.writeOID(SIGN_ALGS[sig.algo]);
77331 if (sig.algo.match(/^rsa-/))
77332 der.writeNull();
77333 der.endSequence();
77334
77335 var sigData = sig.signature.toBuffer('asn1');
77336 var data = Buffer.alloc(sigData.length + 1);
77337 data[0] = 0;
77338 sigData.copy(data, 1);
77339 der.writeBuffer(data, asn1.Ber.BitString);
77340 der.endSequence();
77341
77342 return (der.buffer);
77343}
77344
77345function writeTBSCert(cert, der) {
77346 var sig = cert.signatures.x509;
77347 assert.object(sig, 'x509 signature');
77348
77349 der.startSequence();
77350
77351 der.startSequence(Local(0));
77352 der.writeInt(2);
77353 der.endSequence();
77354
77355 der.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer);
77356
77357 der.startSequence();
77358 der.writeOID(SIGN_ALGS[sig.algo]);
77359 if (sig.algo.match(/^rsa-/))
77360 der.writeNull();
77361 der.endSequence();
77362
77363 cert.issuer.toAsn1(der);
77364
77365 der.startSequence();
77366 der.writeString(dateToUTCTime(cert.validFrom), asn1.Ber.UTCTime);
77367 der.writeString(dateToUTCTime(cert.validUntil), asn1.Ber.UTCTime);
77368 der.endSequence();
77369
77370 var subject = cert.subjects[0];
77371 var altNames = cert.subjects.slice(1);
77372 subject.toAsn1(der);
77373
77374 pkcs8.writePkcs8(der, cert.subjectKey);
77375
77376 if (sig.extras && sig.extras.issuerUniqueID) {
77377 der.writeBuffer(sig.extras.issuerUniqueID, Local(1));
77378 }
77379
77380 if (sig.extras && sig.extras.subjectUniqueID) {
77381 der.writeBuffer(sig.extras.subjectUniqueID, Local(2));
77382 }
77383
77384 if (altNames.length > 0 || subject.type === 'host' ||
77385 (cert.purposes !== undefined && cert.purposes.length > 0) ||
77386 (sig.extras && sig.extras.exts)) {
77387 der.startSequence(Local(3));
77388 der.startSequence();
77389
77390 var exts = [];
77391 if (cert.purposes !== undefined && cert.purposes.length > 0) {
77392 exts.push({
77393 oid: EXTS.basicConstraints,
77394 critical: true
77395 });
77396 exts.push({
77397 oid: EXTS.keyUsage,
77398 critical: true
77399 });
77400 exts.push({
77401 oid: EXTS.extKeyUsage,
77402 critical: true
77403 });
77404 }
77405 exts.push({ oid: EXTS.altName });
77406 if (sig.extras && sig.extras.exts)
77407 exts = sig.extras.exts;
77408
77409 for (var i = 0; i < exts.length; ++i) {
77410 der.startSequence();
77411 der.writeOID(exts[i].oid);
77412
77413 if (exts[i].critical !== undefined)
77414 der.writeBoolean(exts[i].critical);
77415
77416 if (exts[i].oid === EXTS.altName) {
77417 der.startSequence(asn1.Ber.OctetString);
77418 der.startSequence();
77419 if (subject.type === 'host') {
77420 der.writeString(subject.hostname,
77421 Context(2));
77422 }
77423 for (var j = 0; j < altNames.length; ++j) {
77424 if (altNames[j].type === 'host') {
77425 der.writeString(
77426 altNames[j].hostname,
77427 ALTNAME.DNSName);
77428 } else if (altNames[j].type ===
77429 'email') {
77430 der.writeString(
77431 altNames[j].email,
77432 ALTNAME.RFC822Name);
77433 } else {
77434 /*
77435 * Encode anything else as a
77436 * DN style name for now.
77437 */
77438 der.startSequence(
77439 ALTNAME.DirectoryName);
77440 altNames[j].toAsn1(der);
77441 der.endSequence();
77442 }
77443 }
77444 der.endSequence();
77445 der.endSequence();
77446 } else if (exts[i].oid === EXTS.basicConstraints) {
77447 der.startSequence(asn1.Ber.OctetString);
77448 der.startSequence();
77449 var ca = (cert.purposes.indexOf('ca') !== -1);
77450 var pathLen = exts[i].pathLen;
77451 der.writeBoolean(ca);
77452 if (pathLen !== undefined)
77453 der.writeInt(pathLen);
77454 der.endSequence();
77455 der.endSequence();
77456 } else if (exts[i].oid === EXTS.extKeyUsage) {
77457 der.startSequence(asn1.Ber.OctetString);
77458 der.startSequence();
77459 cert.purposes.forEach(function (purpose) {
77460 if (purpose === 'ca')
77461 return;
77462 if (KEYUSEBITS.indexOf(purpose) !== -1)
77463 return;
77464 var oid = purpose;
77465 if (EXTPURPOSE[purpose] !== undefined)
77466 oid = EXTPURPOSE[purpose];
77467 der.writeOID(oid);
77468 });
77469 der.endSequence();
77470 der.endSequence();
77471 } else if (exts[i].oid === EXTS.keyUsage) {
77472 der.startSequence(asn1.Ber.OctetString);
77473 /*
77474 * If we parsed this certificate from a byte
77475 * stream (i.e. we didn't generate it in sshpk)
77476 * then we'll have a ".bits" property on the
77477 * ext with the original raw byte contents.
77478 *
77479 * If we have this, use it here instead of
77480 * regenerating it. This guarantees we output
77481 * the same data we parsed, so signatures still
77482 * validate.
77483 */
77484 if (exts[i].bits !== undefined) {
77485 der.writeBuffer(exts[i].bits,
77486 asn1.Ber.BitString);
77487 } else {
77488 var bits = writeBitField(cert.purposes,
77489 KEYUSEBITS);
77490 der.writeBuffer(bits,
77491 asn1.Ber.BitString);
77492 }
77493 der.endSequence();
77494 } else {
77495 der.writeBuffer(exts[i].data,
77496 asn1.Ber.OctetString);
77497 }
77498
77499 der.endSequence();
77500 }
77501
77502 der.endSequence();
77503 der.endSequence();
77504 }
77505
77506 der.endSequence();
77507}
77508
77509/*
77510 * Reads an ASN.1 BER bitfield out of the Buffer produced by doing
77511 * `BerReader#readString(asn1.Ber.BitString)`. That function gives us the raw
77512 * contents of the BitString tag, which is a count of unused bits followed by
77513 * the bits as a right-padded byte string.
77514 *
77515 * `bits` is the Buffer, `bitIndex` should contain an array of string names
77516 * for the bits in the string, ordered starting with bit #0 in the ASN.1 spec.
77517 *
77518 * Returns an array of Strings, the names of the bits that were set to 1.
77519 */
77520function readBitField(bits, bitIndex) {
77521 var bitLen = 8 * (bits.length - 1) - bits[0];
77522 var setBits = {};
77523 for (var i = 0; i < bitLen; ++i) {
77524 var byteN = 1 + Math.floor(i / 8);
77525 var bit = 7 - (i % 8);
77526 var mask = 1 << bit;
77527 var bitVal = ((bits[byteN] & mask) !== 0);
77528 var name = bitIndex[i];
77529 if (bitVal && typeof (name) === 'string') {
77530 setBits[name] = true;
77531 }
77532 }
77533 return (Object.keys(setBits));
77534}
77535
77536/*
77537 * `setBits` is an array of strings, containing the names for each bit that
77538 * sould be set to 1. `bitIndex` is same as in `readBitField()`.
77539 *
77540 * Returns a Buffer, ready to be written out with `BerWriter#writeString()`.
77541 */
77542function writeBitField(setBits, bitIndex) {
77543 var bitLen = bitIndex.length;
77544 var blen = Math.ceil(bitLen / 8);
77545 var unused = blen * 8 - bitLen;
77546 var bits = Buffer.alloc(1 + blen); // zero-filled
77547 bits[0] = unused;
77548 for (var i = 0; i < bitLen; ++i) {
77549 var byteN = 1 + Math.floor(i / 8);
77550 var bit = 7 - (i % 8);
77551 var mask = 1 << bit;
77552 var name = bitIndex[i];
77553 if (name === undefined)
77554 continue;
77555 var bitVal = (setBits.indexOf(name) !== -1);
77556 if (bitVal) {
77557 bits[byteN] |= mask;
77558 }
77559 }
77560 return (bits);
77561}
77562
77563
77564/***/ }),
77565/* 428 */
77566/***/ (function(module, exports, __webpack_require__) {
77567
77568"use strict";
77569// Copyright Joyent, Inc. and other Node contributors.
77570//
77571// Permission is hereby granted, free of charge, to any person obtaining a
77572// copy of this software and associated documentation files (the
77573// "Software"), to deal in the Software without restriction, including
77574// without limitation the rights to use, copy, modify, merge, publish,
77575// distribute, sublicense, and/or sell copies of the Software, and to permit
77576// persons to whom the Software is furnished to do so, subject to the
77577// following conditions:
77578//
77579// The above copyright notice and this permission notice shall be included
77580// in all copies or substantial portions of the Software.
77581//
77582// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
77583// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
77584// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
77585// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
77586// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
77587// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
77588// USE OR OTHER DEALINGS IN THE SOFTWARE.
77589
77590
77591
77592/*<replacement>*/
77593
77594var Buffer = __webpack_require__(60).Buffer;
77595/*</replacement>*/
77596
77597var isEncoding = Buffer.isEncoding || function (encoding) {
77598 encoding = '' + encoding;
77599 switch (encoding && encoding.toLowerCase()) {
77600 case 'hex':case 'utf8':case 'utf-8':case 'ascii':case 'binary':case 'base64':case 'ucs2':case 'ucs-2':case 'utf16le':case 'utf-16le':case 'raw':
77601 return true;
77602 default:
77603 return false;
77604 }
77605};
77606
77607function _normalizeEncoding(enc) {
77608 if (!enc) return 'utf8';
77609 var retried;
77610 while (true) {
77611 switch (enc) {
77612 case 'utf8':
77613 case 'utf-8':
77614 return 'utf8';
77615 case 'ucs2':
77616 case 'ucs-2':
77617 case 'utf16le':
77618 case 'utf-16le':
77619 return 'utf16le';
77620 case 'latin1':
77621 case 'binary':
77622 return 'latin1';
77623 case 'base64':
77624 case 'ascii':
77625 case 'hex':
77626 return enc;
77627 default:
77628 if (retried) return; // undefined
77629 enc = ('' + enc).toLowerCase();
77630 retried = true;
77631 }
77632 }
77633};
77634
77635// Do not cache `Buffer.isEncoding` when checking encoding names as some
77636// modules monkey-patch it to support additional encodings
77637function normalizeEncoding(enc) {
77638 var nenc = _normalizeEncoding(enc);
77639 if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc);
77640 return nenc || enc;
77641}
77642
77643// StringDecoder provides an interface for efficiently splitting a series of
77644// buffers into a series of JS strings without breaking apart multi-byte
77645// characters.
77646exports.StringDecoder = StringDecoder;
77647function StringDecoder(encoding) {
77648 this.encoding = normalizeEncoding(encoding);
77649 var nb;
77650 switch (this.encoding) {
77651 case 'utf16le':
77652 this.text = utf16Text;
77653 this.end = utf16End;
77654 nb = 4;
77655 break;
77656 case 'utf8':
77657 this.fillLast = utf8FillLast;
77658 nb = 4;
77659 break;
77660 case 'base64':
77661 this.text = base64Text;
77662 this.end = base64End;
77663 nb = 3;
77664 break;
77665 default:
77666 this.write = simpleWrite;
77667 this.end = simpleEnd;
77668 return;
77669 }
77670 this.lastNeed = 0;
77671 this.lastTotal = 0;
77672 this.lastChar = Buffer.allocUnsafe(nb);
77673}
77674
77675StringDecoder.prototype.write = function (buf) {
77676 if (buf.length === 0) return '';
77677 var r;
77678 var i;
77679 if (this.lastNeed) {
77680 r = this.fillLast(buf);
77681 if (r === undefined) return '';
77682 i = this.lastNeed;
77683 this.lastNeed = 0;
77684 } else {
77685 i = 0;
77686 }
77687 if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
77688 return r || '';
77689};
77690
77691StringDecoder.prototype.end = utf8End;
77692
77693// Returns only complete characters in a Buffer
77694StringDecoder.prototype.text = utf8Text;
77695
77696// Attempts to complete a partial non-UTF-8 character using bytes from a Buffer
77697StringDecoder.prototype.fillLast = function (buf) {
77698 if (this.lastNeed <= buf.length) {
77699 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
77700 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
77701 }
77702 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
77703 this.lastNeed -= buf.length;
77704};
77705
77706// Checks the type of a UTF-8 byte, whether it's ASCII, a leading byte, or a
77707// continuation byte. If an invalid byte is detected, -2 is returned.
77708function utf8CheckByte(byte) {
77709 if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;
77710 return byte >> 6 === 0x02 ? -1 : -2;
77711}
77712
77713// Checks at most 3 bytes at the end of a Buffer in order to detect an
77714// incomplete multi-byte UTF-8 character. The total number of bytes (2, 3, or 4)
77715// needed to complete the UTF-8 character (if applicable) are returned.
77716function utf8CheckIncomplete(self, buf, i) {
77717 var j = buf.length - 1;
77718 if (j < i) return 0;
77719 var nb = utf8CheckByte(buf[j]);
77720 if (nb >= 0) {
77721 if (nb > 0) self.lastNeed = nb - 1;
77722 return nb;
77723 }
77724 if (--j < i || nb === -2) return 0;
77725 nb = utf8CheckByte(buf[j]);
77726 if (nb >= 0) {
77727 if (nb > 0) self.lastNeed = nb - 2;
77728 return nb;
77729 }
77730 if (--j < i || nb === -2) return 0;
77731 nb = utf8CheckByte(buf[j]);
77732 if (nb >= 0) {
77733 if (nb > 0) {
77734 if (nb === 2) nb = 0;else self.lastNeed = nb - 3;
77735 }
77736 return nb;
77737 }
77738 return 0;
77739}
77740
77741// Validates as many continuation bytes for a multi-byte UTF-8 character as
77742// needed or are available. If we see a non-continuation byte where we expect
77743// one, we "replace" the validated continuation bytes we've seen so far with
77744// a single UTF-8 replacement character ('\ufffd'), to match v8's UTF-8 decoding
77745// behavior. The continuation byte check is included three times in the case
77746// where all of the continuation bytes for a character exist in the same buffer.
77747// It is also done this way as a slight performance increase instead of using a
77748// loop.
77749function utf8CheckExtraBytes(self, buf, p) {
77750 if ((buf[0] & 0xC0) !== 0x80) {
77751 self.lastNeed = 0;
77752 return '\ufffd';
77753 }
77754 if (self.lastNeed > 1 && buf.length > 1) {
77755 if ((buf[1] & 0xC0) !== 0x80) {
77756 self.lastNeed = 1;
77757 return '\ufffd';
77758 }
77759 if (self.lastNeed > 2 && buf.length > 2) {
77760 if ((buf[2] & 0xC0) !== 0x80) {
77761 self.lastNeed = 2;
77762 return '\ufffd';
77763 }
77764 }
77765 }
77766}
77767
77768// Attempts to complete a multi-byte UTF-8 character using bytes from a Buffer.
77769function utf8FillLast(buf) {
77770 var p = this.lastTotal - this.lastNeed;
77771 var r = utf8CheckExtraBytes(this, buf, p);
77772 if (r !== undefined) return r;
77773 if (this.lastNeed <= buf.length) {
77774 buf.copy(this.lastChar, p, 0, this.lastNeed);
77775 return this.lastChar.toString(this.encoding, 0, this.lastTotal);
77776 }
77777 buf.copy(this.lastChar, p, 0, buf.length);
77778 this.lastNeed -= buf.length;
77779}
77780
77781// Returns all complete UTF-8 characters in a Buffer. If the Buffer ended on a
77782// partial character, the character's bytes are buffered until the required
77783// number of bytes are available.
77784function utf8Text(buf, i) {
77785 var total = utf8CheckIncomplete(this, buf, i);
77786 if (!this.lastNeed) return buf.toString('utf8', i);
77787 this.lastTotal = total;
77788 var end = buf.length - (total - this.lastNeed);
77789 buf.copy(this.lastChar, 0, end);
77790 return buf.toString('utf8', i, end);
77791}
77792
77793// For UTF-8, a replacement character is added when ending on a partial
77794// character.
77795function utf8End(buf) {
77796 var r = buf && buf.length ? this.write(buf) : '';
77797 if (this.lastNeed) return r + '\ufffd';
77798 return r;
77799}
77800
77801// UTF-16LE typically needs two bytes per character, but even if we have an even
77802// number of bytes available, we need to check if we end on a leading/high
77803// surrogate. In that case, we need to wait for the next two bytes in order to
77804// decode the last character properly.
77805function utf16Text(buf, i) {
77806 if ((buf.length - i) % 2 === 0) {
77807 var r = buf.toString('utf16le', i);
77808 if (r) {
77809 var c = r.charCodeAt(r.length - 1);
77810 if (c >= 0xD800 && c <= 0xDBFF) {
77811 this.lastNeed = 2;
77812 this.lastTotal = 4;
77813 this.lastChar[0] = buf[buf.length - 2];
77814 this.lastChar[1] = buf[buf.length - 1];
77815 return r.slice(0, -1);
77816 }
77817 }
77818 return r;
77819 }
77820 this.lastNeed = 1;
77821 this.lastTotal = 2;
77822 this.lastChar[0] = buf[buf.length - 1];
77823 return buf.toString('utf16le', i, buf.length - 1);
77824}
77825
77826// For UTF-16LE we do not explicitly append special replacement characters if we
77827// end on a partial character, we simply let v8 handle that.
77828function utf16End(buf) {
77829 var r = buf && buf.length ? this.write(buf) : '';
77830 if (this.lastNeed) {
77831 var end = this.lastTotal - this.lastNeed;
77832 return r + this.lastChar.toString('utf16le', 0, end);
77833 }
77834 return r;
77835}
77836
77837function base64Text(buf, i) {
77838 var n = (buf.length - i) % 3;
77839 if (n === 0) return buf.toString('base64', i);
77840 this.lastNeed = 3 - n;
77841 this.lastTotal = 3;
77842 if (n === 1) {
77843 this.lastChar[0] = buf[buf.length - 1];
77844 } else {
77845 this.lastChar[0] = buf[buf.length - 2];
77846 this.lastChar[1] = buf[buf.length - 1];
77847 }
77848 return buf.toString('base64', i, buf.length - n);
77849}
77850
77851function base64End(buf) {
77852 var r = buf && buf.length ? this.write(buf) : '';
77853 if (this.lastNeed) return r + this.lastChar.toString('base64', 0, 3 - this.lastNeed);
77854 return r;
77855}
77856
77857// Pass bytes on through for single-byte encodings (e.g. ascii, latin1, hex)
77858function simpleWrite(buf) {
77859 return buf.toString(this.encoding);
77860}
77861
77862function simpleEnd(buf) {
77863 return buf && buf.length ? this.write(buf) : '';
77864}
77865
77866/***/ }),
77867/* 429 */
77868/***/ (function(module, exports, __webpack_require__) {
77869
77870"use strict";
77871
77872module.exports = x => {
77873 if (typeof x !== 'string') {
77874 throw new TypeError('Expected a string, got ' + typeof x);
77875 }
77876
77877 // Catches EFBBBF (UTF-8 BOM) because the buffer-to-string
77878 // conversion translates it to FEFF (UTF-16 BOM)
77879 if (x.charCodeAt(0) === 0xFEFF) {
77880 return x.slice(1);
77881 }
77882
77883 return x;
77884};
77885
77886
77887/***/ }),
77888/* 430 */
77889/***/ (function(module, exports, __webpack_require__) {
77890
77891var toBuffer = __webpack_require__(433)
77892var alloc = __webpack_require__(318)
77893
77894var ZEROS = '0000000000000000000'
77895var SEVENS = '7777777777777777777'
77896var ZERO_OFFSET = '0'.charCodeAt(0)
77897var USTAR = 'ustar\x0000'
77898var MASK = parseInt('7777', 8)
77899
77900var clamp = function (index, len, defaultValue) {
77901 if (typeof index !== 'number') return defaultValue
77902 index = ~~index // Coerce to integer.
77903 if (index >= len) return len
77904 if (index >= 0) return index
77905 index += len
77906 if (index >= 0) return index
77907 return 0
77908}
77909
77910var toType = function (flag) {
77911 switch (flag) {
77912 case 0:
77913 return 'file'
77914 case 1:
77915 return 'link'
77916 case 2:
77917 return 'symlink'
77918 case 3:
77919 return 'character-device'
77920 case 4:
77921 return 'block-device'
77922 case 5:
77923 return 'directory'
77924 case 6:
77925 return 'fifo'
77926 case 7:
77927 return 'contiguous-file'
77928 case 72:
77929 return 'pax-header'
77930 case 55:
77931 return 'pax-global-header'
77932 case 27:
77933 return 'gnu-long-link-path'
77934 case 28:
77935 case 30:
77936 return 'gnu-long-path'
77937 }
77938
77939 return null
77940}
77941
77942var toTypeflag = function (flag) {
77943 switch (flag) {
77944 case 'file':
77945 return 0
77946 case 'link':
77947 return 1
77948 case 'symlink':
77949 return 2
77950 case 'character-device':
77951 return 3
77952 case 'block-device':
77953 return 4
77954 case 'directory':
77955 return 5
77956 case 'fifo':
77957 return 6
77958 case 'contiguous-file':
77959 return 7
77960 case 'pax-header':
77961 return 72
77962 }
77963
77964 return 0
77965}
77966
77967var indexOf = function (block, num, offset, end) {
77968 for (; offset < end; offset++) {
77969 if (block[offset] === num) return offset
77970 }
77971 return end
77972}
77973
77974var cksum = function (block) {
77975 var sum = 8 * 32
77976 for (var i = 0; i < 148; i++) sum += block[i]
77977 for (var j = 156; j < 512; j++) sum += block[j]
77978 return sum
77979}
77980
77981var encodeOct = function (val, n) {
77982 val = val.toString(8)
77983 if (val.length > n) return SEVENS.slice(0, n) + ' '
77984 else return ZEROS.slice(0, n - val.length) + val + ' '
77985}
77986
77987/* Copied from the node-tar repo and modified to meet
77988 * tar-stream coding standard.
77989 *
77990 * Source: https://github.com/npm/node-tar/blob/51b6627a1f357d2eb433e7378e5f05e83b7aa6cd/lib/header.js#L349
77991 */
77992function parse256 (buf) {
77993 // first byte MUST be either 80 or FF
77994 // 80 for positive, FF for 2's comp
77995 var positive
77996 if (buf[0] === 0x80) positive = true
77997 else if (buf[0] === 0xFF) positive = false
77998 else return null
77999
78000 // build up a base-256 tuple from the least sig to the highest
78001 var zero = false
78002 var tuple = []
78003 for (var i = buf.length - 1; i > 0; i--) {
78004 var byte = buf[i]
78005 if (positive) tuple.push(byte)
78006 else if (zero && byte === 0) tuple.push(0)
78007 else if (zero) {
78008 zero = false
78009 tuple.push(0x100 - byte)
78010 } else tuple.push(0xFF - byte)
78011 }
78012
78013 var sum = 0
78014 var l = tuple.length
78015 for (i = 0; i < l; i++) {
78016 sum += tuple[i] * Math.pow(256, i)
78017 }
78018
78019 return positive ? sum : -1 * sum
78020}
78021
78022var decodeOct = function (val, offset, length) {
78023 val = val.slice(offset, offset + length)
78024 offset = 0
78025
78026 // If prefixed with 0x80 then parse as a base-256 integer
78027 if (val[offset] & 0x80) {
78028 return parse256(val)
78029 } else {
78030 // Older versions of tar can prefix with spaces
78031 while (offset < val.length && val[offset] === 32) offset++
78032 var end = clamp(indexOf(val, 32, offset, val.length), val.length, val.length)
78033 while (offset < end && val[offset] === 0) offset++
78034 if (end === offset) return 0
78035 return parseInt(val.slice(offset, end).toString(), 8)
78036 }
78037}
78038
78039var decodeStr = function (val, offset, length, encoding) {
78040 return val.slice(offset, indexOf(val, 0, offset, offset + length)).toString(encoding)
78041}
78042
78043var addLength = function (str) {
78044 var len = Buffer.byteLength(str)
78045 var digits = Math.floor(Math.log(len) / Math.log(10)) + 1
78046 if (len + digits >= Math.pow(10, digits)) digits++
78047
78048 return (len + digits) + str
78049}
78050
78051exports.decodeLongPath = function (buf, encoding) {
78052 return decodeStr(buf, 0, buf.length, encoding)
78053}
78054
78055exports.encodePax = function (opts) { // TODO: encode more stuff in pax
78056 var result = ''
78057 if (opts.name) result += addLength(' path=' + opts.name + '\n')
78058 if (opts.linkname) result += addLength(' linkpath=' + opts.linkname + '\n')
78059 var pax = opts.pax
78060 if (pax) {
78061 for (var key in pax) {
78062 result += addLength(' ' + key + '=' + pax[key] + '\n')
78063 }
78064 }
78065 return toBuffer(result)
78066}
78067
78068exports.decodePax = function (buf) {
78069 var result = {}
78070
78071 while (buf.length) {
78072 var i = 0
78073 while (i < buf.length && buf[i] !== 32) i++
78074 var len = parseInt(buf.slice(0, i).toString(), 10)
78075 if (!len) return result
78076
78077 var b = buf.slice(i + 1, len - 1).toString()
78078 var keyIndex = b.indexOf('=')
78079 if (keyIndex === -1) return result
78080 result[b.slice(0, keyIndex)] = b.slice(keyIndex + 1)
78081
78082 buf = buf.slice(len)
78083 }
78084
78085 return result
78086}
78087
78088exports.encode = function (opts) {
78089 var buf = alloc(512)
78090 var name = opts.name
78091 var prefix = ''
78092
78093 if (opts.typeflag === 5 && name[name.length - 1] !== '/') name += '/'
78094 if (Buffer.byteLength(name) !== name.length) return null // utf-8
78095
78096 while (Buffer.byteLength(name) > 100) {
78097 var i = name.indexOf('/')
78098 if (i === -1) return null
78099 prefix += prefix ? '/' + name.slice(0, i) : name.slice(0, i)
78100 name = name.slice(i + 1)
78101 }
78102
78103 if (Buffer.byteLength(name) > 100 || Buffer.byteLength(prefix) > 155) return null
78104 if (opts.linkname && Buffer.byteLength(opts.linkname) > 100) return null
78105
78106 buf.write(name)
78107 buf.write(encodeOct(opts.mode & MASK, 6), 100)
78108 buf.write(encodeOct(opts.uid, 6), 108)
78109 buf.write(encodeOct(opts.gid, 6), 116)
78110 buf.write(encodeOct(opts.size, 11), 124)
78111 buf.write(encodeOct((opts.mtime.getTime() / 1000) | 0, 11), 136)
78112
78113 buf[156] = ZERO_OFFSET + toTypeflag(opts.type)
78114
78115 if (opts.linkname) buf.write(opts.linkname, 157)
78116
78117 buf.write(USTAR, 257)
78118 if (opts.uname) buf.write(opts.uname, 265)
78119 if (opts.gname) buf.write(opts.gname, 297)
78120 buf.write(encodeOct(opts.devmajor || 0, 6), 329)
78121 buf.write(encodeOct(opts.devminor || 0, 6), 337)
78122
78123 if (prefix) buf.write(prefix, 345)
78124
78125 buf.write(encodeOct(cksum(buf), 6), 148)
78126
78127 return buf
78128}
78129
78130exports.decode = function (buf, filenameEncoding) {
78131 var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET
78132
78133 var name = decodeStr(buf, 0, 100, filenameEncoding)
78134 var mode = decodeOct(buf, 100, 8)
78135 var uid = decodeOct(buf, 108, 8)
78136 var gid = decodeOct(buf, 116, 8)
78137 var size = decodeOct(buf, 124, 12)
78138 var mtime = decodeOct(buf, 136, 12)
78139 var type = toType(typeflag)
78140 var linkname = buf[157] === 0 ? null : decodeStr(buf, 157, 100, filenameEncoding)
78141 var uname = decodeStr(buf, 265, 32)
78142 var gname = decodeStr(buf, 297, 32)
78143 var devmajor = decodeOct(buf, 329, 8)
78144 var devminor = decodeOct(buf, 337, 8)
78145
78146 if (buf[345]) name = decodeStr(buf, 345, 155, filenameEncoding) + '/' + name
78147
78148 // to support old tar versions that use trailing / to indicate dirs
78149 if (typeflag === 0 && name && name[name.length - 1] === '/') typeflag = 5
78150
78151 var c = cksum(buf)
78152
78153 // checksum is still initial value if header was null.
78154 if (c === 8 * 32) return null
78155
78156 // valid checksum
78157 if (c !== decodeOct(buf, 148, 8)) throw new Error('Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?')
78158
78159 return {
78160 name: name,
78161 mode: mode,
78162 uid: uid,
78163 gid: gid,
78164 size: size,
78165 mtime: new Date(1000 * mtime),
78166 type: type,
78167 linkname: linkname,
78168 uname: uname,
78169 gname: gname,
78170 devmajor: devmajor,
78171 devminor: devminor
78172 }
78173}
78174
78175
78176/***/ }),
78177/* 431 */
78178/***/ (function(module, exports, __webpack_require__) {
78179
78180exports.extract = __webpack_require__(1022)
78181exports.pack = __webpack_require__(1023)
78182
78183
78184/***/ }),
78185/* 432 */
78186/***/ (function(module, exports, __webpack_require__) {
78187
78188var Transform = __webpack_require__(866)
78189 , inherits = __webpack_require__(9).inherits
78190 , xtend = __webpack_require__(437)
78191
78192function DestroyableTransform(opts) {
78193 Transform.call(this, opts)
78194 this._destroyed = false
78195}
78196
78197inherits(DestroyableTransform, Transform)
78198
78199DestroyableTransform.prototype.destroy = function(err) {
78200 if (this._destroyed) return
78201 this._destroyed = true
78202
78203 var self = this
78204 process.nextTick(function() {
78205 if (err)
78206 self.emit('error', err)
78207 self.emit('close')
78208 })
78209}
78210
78211// a noop _transform function
78212function noop (chunk, enc, callback) {
78213 callback(null, chunk)
78214}
78215
78216
78217// create a new export function, used by both the main export and
78218// the .ctor export, contains common logic for dealing with arguments
78219function through2 (construct) {
78220 return function (options, transform, flush) {
78221 if (typeof options == 'function') {
78222 flush = transform
78223 transform = options
78224 options = {}
78225 }
78226
78227 if (typeof transform != 'function')
78228 transform = noop
78229
78230 if (typeof flush != 'function')
78231 flush = null
78232
78233 return construct(options, transform, flush)
78234 }
78235}
78236
78237
78238// main export, just make me a transform stream!
78239module.exports = through2(function (options, transform, flush) {
78240 var t2 = new DestroyableTransform(options)
78241
78242 t2._transform = transform
78243
78244 if (flush)
78245 t2._flush = flush
78246
78247 return t2
78248})
78249
78250
78251// make me a reusable prototype that I can `new`, or implicitly `new`
78252// with a constructor call
78253module.exports.ctor = through2(function (options, transform, flush) {
78254 function Through2 (override) {
78255 if (!(this instanceof Through2))
78256 return new Through2(override)
78257
78258 this.options = xtend(options, override)
78259
78260 DestroyableTransform.call(this, this.options)
78261 }
78262
78263 inherits(Through2, DestroyableTransform)
78264
78265 Through2.prototype._transform = transform
78266
78267 if (flush)
78268 Through2.prototype._flush = flush
78269
78270 return Through2
78271})
78272
78273
78274module.exports.obj = through2(function (options, transform, flush) {
78275 var t2 = new DestroyableTransform(xtend({ objectMode: true, highWaterMark: 16 }, options))
78276
78277 t2._transform = transform
78278
78279 if (flush)
78280 t2._flush = flush
78281
78282 return t2
78283})
78284
78285
78286/***/ }),
78287/* 433 */
78288/***/ (function(module, exports) {
78289
78290module.exports = toBuffer
78291
78292var makeBuffer = Buffer.from && Buffer.from !== Uint8Array.from ? Buffer.from : bufferFrom
78293
78294function bufferFrom (buf, enc) {
78295 return new Buffer(buf, enc)
78296}
78297
78298function toBuffer (buf, enc) {
78299 if (Buffer.isBuffer(buf)) return buf
78300 if (typeof buf === 'string') return makeBuffer(buf, enc)
78301 if (Array.isArray(buf)) return makeBuffer(buf)
78302 throw new Error('Input should be a buffer or a string')
78303}
78304
78305
78306/***/ }),
78307/* 434 */
78308/***/ (function(module, exports) {
78309
78310/**
78311 * Convert array of 16 byte values to UUID string format of the form:
78312 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
78313 */
78314var byteToHex = [];
78315for (var i = 0; i < 256; ++i) {
78316 byteToHex[i] = (i + 0x100).toString(16).substr(1);
78317}
78318
78319function bytesToUuid(buf, offset) {
78320 var i = offset || 0;
78321 var bth = byteToHex;
78322 // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
78323 return ([bth[buf[i++]], bth[buf[i++]],
78324 bth[buf[i++]], bth[buf[i++]], '-',
78325 bth[buf[i++]], bth[buf[i++]], '-',
78326 bth[buf[i++]], bth[buf[i++]], '-',
78327 bth[buf[i++]], bth[buf[i++]], '-',
78328 bth[buf[i++]], bth[buf[i++]],
78329 bth[buf[i++]], bth[buf[i++]],
78330 bth[buf[i++]], bth[buf[i++]]]).join('');
78331}
78332
78333module.exports = bytesToUuid;
78334
78335
78336/***/ }),
78337/* 435 */
78338/***/ (function(module, exports, __webpack_require__) {
78339
78340// Unique ID creation requires a high quality random # generator. In node.js
78341// this is pretty straight-forward - we use the crypto API.
78342
78343var crypto = __webpack_require__(21);
78344
78345module.exports = function nodeRNG() {
78346 return crypto.randomBytes(16);
78347};
78348
78349
78350/***/ }),
78351/* 436 */
78352/***/ (function(module, exports) {
78353
78354// Returns a wrapper function that returns a wrapped callback
78355// The wrapper function should do some stuff, and return a
78356// presumably different callback function.
78357// This makes sure that own properties are retained, so that
78358// decorations and such are not lost along the way.
78359module.exports = wrappy
78360function wrappy (fn, cb) {
78361 if (fn && cb) return wrappy(fn)(cb)
78362
78363 if (typeof fn !== 'function')
78364 throw new TypeError('need wrapper function')
78365
78366 Object.keys(fn).forEach(function (k) {
78367 wrapper[k] = fn[k]
78368 })
78369
78370 return wrapper
78371
78372 function wrapper() {
78373 var args = new Array(arguments.length)
78374 for (var i = 0; i < args.length; i++) {
78375 args[i] = arguments[i]
78376 }
78377 var ret = fn.apply(this, args)
78378 var cb = args[args.length-1]
78379 if (typeof ret === 'function' && ret !== cb) {
78380 Object.keys(cb).forEach(function (k) {
78381 ret[k] = cb[k]
78382 })
78383 }
78384 return ret
78385 }
78386}
78387
78388
78389/***/ }),
78390/* 437 */
78391/***/ (function(module, exports) {
78392
78393module.exports = extend
78394
78395var hasOwnProperty = Object.prototype.hasOwnProperty;
78396
78397function extend() {
78398 var target = {}
78399
78400 for (var i = 0; i < arguments.length; i++) {
78401 var source = arguments[i]
78402
78403 for (var key in source) {
78404 if (hasOwnProperty.call(source, key)) {
78405 target[key] = source[key]
78406 }
78407 }
78408 }
78409
78410 return target
78411}
78412
78413
78414/***/ }),
78415/* 438 */
78416/***/ (function(module, exports) {
78417
78418module.exports = {"name":"yarn","installationMethod":"unknown","version":"1.22.14","license":"BSD-2-Clause","preferGlobal":true,"description":"📦🐈 Fast, reliable, and secure dependency management.","dependencies":{"@zkochan/cmd-shim":"^3.1.0","babel-runtime":"^6.26.0","bytes":"^3.0.0","camelcase":"^4.0.0","chalk":"^2.1.0","cli-table3":"^0.4.0","commander":"^2.9.0","death":"^1.0.0","debug":"^3.0.0","deep-equal":"^1.0.1","detect-indent":"^5.0.0","dnscache":"^1.0.1","glob":"^7.1.1","gunzip-maybe":"^1.4.0","hash-for-dep":"^1.2.3","imports-loader":"^0.8.0","ini":"^1.3.4","inquirer":"^6.2.0","invariant":"^2.2.0","is-builtin-module":"^2.0.0","is-ci":"^1.0.10","is-webpack-bundle":"^1.0.0","js-yaml":"^3.13.1","leven":"^2.0.0","loud-rejection":"^1.2.0","micromatch":"^2.3.11","mkdirp":"^0.5.1","node-emoji":"^1.6.1","normalize-url":"^2.0.0","npm-logical-tree":"^1.2.1","object-path":"^0.11.2","proper-lockfile":"^2.0.0","puka":"^1.0.0","read":"^1.0.7","request":"^2.87.0","request-capture-har":"^1.2.2","rimraf":"^2.5.0","semver":"^5.1.0","ssri":"^5.3.0","strip-ansi":"^4.0.0","strip-bom":"^3.0.0","tar-fs":"^1.16.0","tar-stream":"^1.6.1","uuid":"^3.0.1","v8-compile-cache":"^2.0.0","validate-npm-package-license":"^3.0.4","yn":"^2.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-eslint":"^7.2.3","babel-loader":"^6.2.5","babel-plugin-array-includes":"^2.0.3","babel-plugin-inline-import":"^3.0.0","babel-plugin-transform-builtin-extend":"^1.1.2","babel-plugin-transform-inline-imports-commonjs":"^1.0.0","babel-plugin-transform-runtime":"^6.4.3","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","babel-preset-stage-0":"^6.0.0","babylon":"^6.5.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.3.0","eslint-config-fb-strict":"^22.0.0","eslint-plugin-babel":"^5.0.0","eslint-plugin-flowtype":"^2.35.0","eslint-plugin-jasmine":"^2.6.2","eslint-plugin-jest":"^21.0.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-prefer-object-spread":"^1.2.1","eslint-plugin-prettier":"^2.1.2","eslint-plugin-react":"^7.1.0","eslint-plugin-relay":"^0.0.28","eslint-plugin-yarn-internal":"file:scripts/eslint-rules","execa":"^0.11.0","fancy-log":"^1.3.2","flow-bin":"^0.66.0","git-release-notes":"^3.0.0","gulp":"^4.0.0","gulp-babel":"^7.0.0","gulp-if":"^2.0.1","gulp-newer":"^1.0.0","gulp-plumber":"^1.0.1","gulp-sourcemaps":"^2.2.0","jest":"^22.4.4","jsinspect":"^0.12.6","minimatch":"^3.0.4","mock-stdin":"^0.3.0","prettier":"^1.5.2","string-replace-loader":"^2.1.1","temp":"^0.8.3","webpack":"^2.1.0-beta.25","yargs":"^6.3.0"},"resolutions":{"sshpk":"^1.14.2"},"engines":{"node":">=4.0.0"},"repository":"yarnpkg/yarn","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"scripts":{"build":"gulp build","build-bundle":"node ./scripts/build-webpack.js","build-chocolatey":"powershell ./scripts/build-chocolatey.ps1","build-deb":"./scripts/build-deb.sh","build-dist":"bash ./scripts/build-dist.sh","build-win-installer":"scripts\\build-windows-installer.bat","changelog":"git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md","dupe-check":"yarn jsinspect ./src","lint":"eslint . && flow check","pkg-tests":"yarn --cwd packages/pkg-tests jest yarn.test.js","prettier":"eslint src __tests__ --fix","release-branch":"./scripts/release-branch.sh","test":"yarn lint && yarn test-only","test-only":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose","test-only-debug":"node --inspect-brk --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --verbose","test-coverage":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose","watch":"gulp watch","commit":"git-cz"},"jest":{"collectCoverageFrom":["src/**/*.js"],"testEnvironment":"node","modulePathIgnorePatterns":["__tests__/fixtures/","packages/pkg-tests/pkg-tests-fixtures","dist/"],"testPathIgnorePatterns":["__tests__/(fixtures|__mocks__)/","updates/","_(temp|mock|install|init|helpers).js$","packages/pkg-tests"]},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}}
78419
78420/***/ }),
78421/* 439 */
78422/***/ (function(module, exports) {
78423
78424module.exports = require("constants");
78425
78426/***/ }),
78427/* 440 */
78428/***/ (function(module, exports) {
78429
78430module.exports = require("tls");
78431
78432/***/ }),
78433/* 441 */
78434/***/ (function(module, exports, __webpack_require__) {
78435
78436"use strict";
78437
78438
78439Object.defineProperty(exports, "__esModule", {
78440 value: true
78441});
78442exports.default = handleSignals;
78443
78444var _child;
78445
78446function _load_child() {
78447 return _child = __webpack_require__(57);
78448}
78449
78450function forwardSignalAndExit(signal) {
78451 (0, (_child || _load_child()).forwardSignalToSpawnedProcesses)(signal);
78452 // We want to exit immediately here since `SIGTERM` means that
78453 // If we lose stdout messages due to abrupt exit, shoot the messenger?
78454 process.exit(1); // eslint-disable-line no-process-exit
78455}
78456function handleSignals() {
78457 process.on('SIGTERM', function () {
78458 forwardSignalAndExit('SIGTERM');
78459 });
78460}
78461
78462/***/ }),
78463/* 442 */
78464/***/ (function(module, exports) {
78465
78466
78467var defaultConfig = {
78468 uncaughtException: false,
78469 SIGINT: true,
78470 SIGTERM: true,
78471 SIGQUIT: true
78472}
78473
78474var DEBUG = false
78475
78476function ON_DEATH (callback) {
78477 var handlers = [];
78478 Object.keys(defaultConfig).forEach(function(key) {
78479 var val = defaultConfig[key]
78480 var handler = null;
78481 if (val) {
78482 if (DEBUG) {
78483 handler = function() {
78484 var args = Array.prototype.slice.call(arguments, 0)
78485 args.unshift(key)
78486 console.log('Trapped ' + key)
78487 callback.apply(null, args)
78488 };
78489 process.on(key, handler)
78490 } else {
78491 handler = function() {
78492 var args = Array.prototype.slice.call(arguments, 0)
78493 args.unshift(key)
78494 callback.apply(null, args)
78495 }
78496 process.on(key, handler)
78497 }
78498 handlers.push([key, handler])
78499 }
78500 })
78501 return function OFF_DEATH() {
78502 handlers.forEach(function (args) {
78503 var key = args[0];
78504 var handler = args[1];
78505 process.removeListener(key, handler);
78506 })
78507 }
78508}
78509
78510module.exports = function (arg) {
78511 if (typeof arg === 'object') {
78512 if (arg['debug'])
78513 DEBUG = arg.debug
78514 if (arg['DEBUG'])
78515 DEBUG = arg.DEBUG
78516 delete arg.debug; delete arg.DEBUG;
78517
78518 Object.keys(arg).forEach(function(key) {
78519 defaultConfig[key] = arg[key]
78520 })
78521
78522 if (DEBUG)
78523 console.log('ON_DEATH: debug mode enabled for pid [%d]', process.pid)
78524
78525 return ON_DEATH
78526 } else if (typeof arg === 'function') {
78527 return ON_DEATH(arg)
78528 }
78529}
78530
78531
78532
78533/***/ }),
78534/* 443 */
78535/***/ (function(module, exports, __webpack_require__) {
78536
78537"use strict";
78538
78539var util = __webpack_require__(9);
78540var onExit = __webpack_require__(421);
78541var currentlyUnhandled = __webpack_require__(649);
78542
78543var installed = false;
78544
78545module.exports = function (log) {
78546 if (installed) {
78547 return;
78548 }
78549
78550 installed = true;
78551
78552 log = log || console.error;
78553
78554 var listUnhandled = currentlyUnhandled();
78555
78556 onExit(function () {
78557 var unhandledRejections = listUnhandled();
78558
78559 if (unhandledRejections.length > 0) {
78560 unhandledRejections.forEach(function (x) {
78561 var err = x.reason;
78562
78563 if (!(err instanceof Error)) {
78564 err = new Error('Promise rejected with value: ' + util.inspect(err));
78565 }
78566
78567 log(err.stack);
78568 });
78569
78570 process.exitCode = 1;
78571 }
78572 });
78573};
78574
78575
78576/***/ }),
78577/* 444 */
78578/***/ (function(module, exports, __webpack_require__) {
78579
78580"use strict";
78581
78582
78583const fs = __webpack_require__(356);
78584const path = __webpack_require__(1);
78585const retry = __webpack_require__(891);
78586const syncFs = __webpack_require__(851);
78587
78588const locks = {};
78589
78590function getLockFile(file) {
78591 return `${file}.lock`;
78592}
78593
78594function canonicalPath(file, options, callback) {
78595 if (!options.realpath) {
78596 return callback(null, path.resolve(file));
78597 }
78598
78599 // Use realpath to resolve symlinks
78600 // It also resolves relative paths
78601 options.fs.realpath(file, callback);
78602}
78603
78604function acquireLock(file, options, callback) {
78605 // Use mkdir to create the lockfile (atomic operation)
78606 options.fs.mkdir(getLockFile(file), (err) => {
78607 // If successful, we are done
78608 if (!err) {
78609 return callback();
78610 }
78611
78612 // If error is not EEXIST then some other error occurred while locking
78613 if (err.code !== 'EEXIST') {
78614 return callback(err);
78615 }
78616
78617 // Otherwise, check if lock is stale by analyzing the file mtime
78618 if (options.stale <= 0) {
78619 return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file }));
78620 }
78621
78622 options.fs.stat(getLockFile(file), (err, stat) => {
78623 if (err) {
78624 // Retry if the lockfile has been removed (meanwhile)
78625 // Skip stale check to avoid recursiveness
78626 if (err.code === 'ENOENT') {
78627 return acquireLock(file, Object.assign({}, options, { stale: 0 }), callback);
78628 }
78629
78630 return callback(err);
78631 }
78632
78633 if (!isLockStale(stat, options)) {
78634 return callback(Object.assign(new Error('Lock file is already being hold'), { code: 'ELOCKED', file }));
78635 }
78636
78637 // If it's stale, remove it and try again!
78638 // Skip stale check to avoid recursiveness
78639 removeLock(file, options, (err) => {
78640 if (err) {
78641 return callback(err);
78642 }
78643
78644 acquireLock(file, Object.assign({}, options, { stale: 0 }), callback);
78645 });
78646 });
78647 });
78648}
78649
78650function isLockStale(stat, options) {
78651 return stat.mtime.getTime() < Date.now() - options.stale;
78652}
78653
78654function removeLock(file, options, callback) {
78655 // Remove lockfile, ignoring ENOENT errors
78656 options.fs.rmdir(getLockFile(file), (err) => {
78657 if (err && err.code !== 'ENOENT') {
78658 return callback(err);
78659 }
78660
78661 callback();
78662 });
78663}
78664
78665function updateLock(file, options) {
78666 const lock = locks[file];
78667
78668 /* istanbul ignore next */
78669 if (lock.updateTimeout) {
78670 return;
78671 }
78672
78673 lock.updateDelay = lock.updateDelay || options.update;
78674 lock.updateTimeout = setTimeout(() => {
78675 const mtime = Date.now() / 1000;
78676
78677 lock.updateTimeout = null;
78678
78679 options.fs.utimes(getLockFile(file), mtime, mtime, (err) => {
78680 // Ignore if the lock was released
78681 if (lock.released) {
78682 return;
78683 }
78684
78685 // Verify if we are within the stale threshold
78686 if (lock.lastUpdate <= Date.now() - options.stale &&
78687 lock.lastUpdate > Date.now() - options.stale * 2) {
78688 return compromisedLock(file, lock, Object.assign(new Error(lock.updateError || 'Unable to update lock within the stale \
78689threshold'), { code: 'ECOMPROMISED' }));
78690 }
78691
78692 // If the file is older than (stale * 2), we assume the clock is moved manually,
78693 // which we consider a valid case
78694
78695 // If it failed to update the lockfile, keep trying unless
78696 // the lockfile was deleted!
78697 if (err) {
78698 if (err.code === 'ENOENT') {
78699 return compromisedLock(file, lock, Object.assign(err, { code: 'ECOMPROMISED' }));
78700 }
78701
78702 lock.updateError = err;
78703 lock.updateDelay = 1000;
78704 return updateLock(file, options);
78705 }
78706
78707 // All ok, keep updating..
78708 lock.lastUpdate = Date.now();
78709 lock.updateError = null;
78710 lock.updateDelay = null;
78711 updateLock(file, options);
78712 });
78713 }, lock.updateDelay);
78714
78715 // Unref the timer so that the nodejs process can exit freely
78716 // This is safe because all acquired locks will be automatically released
78717 // on process exit
78718
78719 // We first check that `lock.updateTimeout.unref` exists because some users
78720 // may be using this module outside of NodeJS (e.g., in an electron app),
78721 // and in those cases `setTimeout` return an integer.
78722 if (lock.updateTimeout.unref) {
78723 lock.updateTimeout.unref();
78724 }
78725}
78726
78727function compromisedLock(file, lock, err) {
78728 lock.released = true; // Signal the lock has been released
78729 /* istanbul ignore next */
78730 lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update
78731
78732 if (locks[file] === lock) {
78733 delete locks[file];
78734 }
78735
78736 lock.compromised(err);
78737}
78738
78739// -----------------------------------------
78740
78741function lock(file, options, compromised, callback) {
78742 if (typeof options === 'function') {
78743 callback = compromised;
78744 compromised = options;
78745 options = null;
78746 }
78747
78748 if (!callback) {
78749 callback = compromised;
78750 compromised = null;
78751 }
78752
78753 options = Object.assign({
78754 stale: 10000,
78755 update: null,
78756 realpath: true,
78757 retries: 0,
78758 fs,
78759 }, options);
78760
78761 options.retries = options.retries || 0;
78762 options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries;
78763 options.stale = Math.max(options.stale || 0, 2000);
78764 options.update = options.update == null ? options.stale / 2 : options.update || 0;
78765 options.update = Math.max(Math.min(options.update, options.stale / 2), 1000);
78766 compromised = compromised || function (err) { throw err; };
78767
78768 // Resolve to a canonical file path
78769 canonicalPath(file, options, (err, file) => {
78770 if (err) {
78771 return callback(err);
78772 }
78773
78774 // Attempt to acquire the lock
78775 const operation = retry.operation(options.retries);
78776
78777 operation.attempt(() => {
78778 acquireLock(file, options, (err) => {
78779 if (operation.retry(err)) {
78780 return;
78781 }
78782
78783 if (err) {
78784 return callback(operation.mainError());
78785 }
78786
78787 // We now own the lock
78788 const lock = locks[file] = {
78789 options,
78790 compromised,
78791 lastUpdate: Date.now(),
78792 };
78793
78794 // We must keep the lock fresh to avoid staleness
78795 updateLock(file, options);
78796
78797 callback(null, (releasedCallback) => {
78798 if (lock.released) {
78799 return releasedCallback &&
78800 releasedCallback(Object.assign(new Error('Lock is already released'), { code: 'ERELEASED' }));
78801 }
78802
78803 // Not necessary to use realpath twice when unlocking
78804 unlock(file, Object.assign({}, options, { realpath: false }), releasedCallback);
78805 });
78806 });
78807 });
78808 });
78809}
78810
78811function unlock(file, options, callback) {
78812 if (typeof options === 'function') {
78813 callback = options;
78814 options = null;
78815 }
78816
78817 options = Object.assign({
78818 fs,
78819 realpath: true,
78820 }, options);
78821
78822 callback = callback || function () {};
78823
78824 // Resolve to a canonical file path
78825 canonicalPath(file, options, (err, file) => {
78826 if (err) {
78827 return callback(err);
78828 }
78829
78830 // Skip if the lock is not acquired
78831 const lock = locks[file];
78832
78833 if (!lock) {
78834 return callback(Object.assign(new Error('Lock is not acquired/owned by you'), { code: 'ENOTACQUIRED' }));
78835 }
78836
78837 lock.updateTimeout && clearTimeout(lock.updateTimeout); // Cancel lock mtime update
78838 lock.released = true; // Signal the lock has been released
78839 delete locks[file]; // Delete from locks
78840
78841 removeLock(file, options, callback);
78842 });
78843}
78844
78845function lockSync(file, options, compromised) {
78846 if (typeof options === 'function') {
78847 compromised = options;
78848 options = null;
78849 }
78850
78851 options = options || {};
78852 options.fs = syncFs(options.fs || fs);
78853 options.retries = options.retries || 0;
78854 options.retries = typeof options.retries === 'number' ? { retries: options.retries } : options.retries;
78855
78856 // Retries are not allowed because it requires the flow to be sync
78857 if (options.retries.retries) {
78858 throw Object.assign(new Error('Cannot use retries with the sync api'), { code: 'ESYNC' });
78859 }
78860
78861 let err;
78862 let release;
78863
78864 lock(file, options, compromised, (_err, _release) => {
78865 err = _err;
78866 release = _release;
78867 });
78868
78869 if (err) {
78870 throw err;
78871 }
78872
78873 return release;
78874}
78875
78876function unlockSync(file, options) {
78877 options = options || {};
78878 options.fs = syncFs(options.fs || fs);
78879
78880 let err;
78881
78882 unlock(file, options, (_err) => {
78883 err = _err;
78884 });
78885
78886 if (err) {
78887 throw err;
78888 }
78889}
78890
78891function check(file, options, callback) {
78892 if (typeof options === 'function') {
78893 callback = options;
78894 options = null;
78895 }
78896
78897 options = Object.assign({
78898 stale: 10000,
78899 realpath: true,
78900 fs,
78901 }, options);
78902
78903 options.stale = Math.max(options.stale || 0, 2000);
78904
78905 // Resolve to a canonical file path
78906 canonicalPath(file, options, (err, file) => {
78907 if (err) {
78908 return callback(err);
78909 }
78910
78911 // Check if lockfile exists
78912 options.fs.stat(getLockFile(file), (err, stat) => {
78913 if (err) {
78914 // if does not exist, file is not locked. Otherwise, callback with error
78915 return (err.code === 'ENOENT') ? callback(null, false) : callback(err);
78916 }
78917
78918 if (options.stale <= 0) { return callback(null, true); }
78919
78920 // Otherwise, check if lock is stale by analyzing the file mtime
78921 return callback(null, !isLockStale(stat, options));
78922 });
78923 });
78924}
78925
78926function checkSync(file, options) {
78927 options = options || {};
78928 options.fs = syncFs(options.fs || fs);
78929
78930 let err;
78931 let locked;
78932
78933 check(file, options, (_err, _locked) => {
78934 err = _err;
78935 locked = _locked;
78936 });
78937
78938 if (err) {
78939 throw err;
78940 }
78941
78942 return locked;
78943}
78944
78945
78946// Remove acquired locks on exit
78947/* istanbul ignore next */
78948process.on('exit', () => {
78949 Object.keys(locks).forEach((file) => {
78950 try { locks[file].options.fs.rmdirSync(getLockFile(file)); } catch (e) { /* empty */ }
78951 });
78952});
78953
78954module.exports = lock;
78955module.exports.lock = lock;
78956module.exports.unlock = unlock;
78957module.exports.lockSync = lockSync;
78958module.exports.unlockSync = unlockSync;
78959module.exports.check = check;
78960module.exports.checkSync = checkSync;
78961
78962
78963/***/ }),
78964/* 445 */
78965/***/ (function(module, exports, __webpack_require__) {
78966
78967"use strict";
78968
78969const x = module.exports;
78970const ESC = '\u001B[';
78971const OSC = '\u001B]';
78972const BEL = '\u0007';
78973const SEP = ';';
78974const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';
78975
78976x.cursorTo = (x, y) => {
78977 if (typeof x !== 'number') {
78978 throw new TypeError('The `x` argument is required');
78979 }
78980
78981 if (typeof y !== 'number') {
78982 return ESC + (x + 1) + 'G';
78983 }
78984
78985 return ESC + (y + 1) + ';' + (x + 1) + 'H';
78986};
78987
78988x.cursorMove = (x, y) => {
78989 if (typeof x !== 'number') {
78990 throw new TypeError('The `x` argument is required');
78991 }
78992
78993 let ret = '';
78994
78995 if (x < 0) {
78996 ret += ESC + (-x) + 'D';
78997 } else if (x > 0) {
78998 ret += ESC + x + 'C';
78999 }
79000
79001 if (y < 0) {
79002 ret += ESC + (-y) + 'A';
79003 } else if (y > 0) {
79004 ret += ESC + y + 'B';
79005 }
79006
79007 return ret;
79008};
79009
79010x.cursorUp = count => ESC + (typeof count === 'number' ? count : 1) + 'A';
79011x.cursorDown = count => ESC + (typeof count === 'number' ? count : 1) + 'B';
79012x.cursorForward = count => ESC + (typeof count === 'number' ? count : 1) + 'C';
79013x.cursorBackward = count => ESC + (typeof count === 'number' ? count : 1) + 'D';
79014
79015x.cursorLeft = ESC + 'G';
79016x.cursorSavePosition = ESC + (isTerminalApp ? '7' : 's');
79017x.cursorRestorePosition = ESC + (isTerminalApp ? '8' : 'u');
79018x.cursorGetPosition = ESC + '6n';
79019x.cursorNextLine = ESC + 'E';
79020x.cursorPrevLine = ESC + 'F';
79021x.cursorHide = ESC + '?25l';
79022x.cursorShow = ESC + '?25h';
79023
79024x.eraseLines = count => {
79025 let clear = '';
79026
79027 for (let i = 0; i < count; i++) {
79028 clear += x.eraseLine + (i < count - 1 ? x.cursorUp() : '');
79029 }
79030
79031 if (count) {
79032 clear += x.cursorLeft;
79033 }
79034
79035 return clear;
79036};
79037
79038x.eraseEndLine = ESC + 'K';
79039x.eraseStartLine = ESC + '1K';
79040x.eraseLine = ESC + '2K';
79041x.eraseDown = ESC + 'J';
79042x.eraseUp = ESC + '1J';
79043x.eraseScreen = ESC + '2J';
79044x.scrollUp = ESC + 'S';
79045x.scrollDown = ESC + 'T';
79046
79047x.clearScreen = '\u001Bc';
79048x.beep = BEL;
79049
79050x.link = (text, url) => {
79051 return [
79052 OSC,
79053 '8',
79054 SEP,
79055 SEP,
79056 url,
79057 BEL,
79058 text,
79059 OSC,
79060 '8',
79061 SEP,
79062 SEP,
79063 BEL
79064 ].join('');
79065};
79066
79067x.image = (buf, opts) => {
79068 opts = opts || {};
79069
79070 let ret = OSC + '1337;File=inline=1';
79071
79072 if (opts.width) {
79073 ret += `;width=${opts.width}`;
79074 }
79075
79076 if (opts.height) {
79077 ret += `;height=${opts.height}`;
79078 }
79079
79080 if (opts.preserveAspectRatio === false) {
79081 ret += ';preserveAspectRatio=0';
79082 }
79083
79084 return ret + ':' + buf.toString('base64') + BEL;
79085};
79086
79087x.iTerm = {};
79088
79089x.iTerm.setCwd = cwd => OSC + '50;CurrentDir=' + (cwd || process.cwd()) + BEL;
79090
79091
79092/***/ }),
79093/* 446 */
79094/***/ (function(module, exports, __webpack_require__) {
79095
79096"use strict";
79097
79098module.exports = function () {
79099 return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g;
79100};
79101
79102
79103/***/ }),
79104/* 447 */
79105/***/ (function(module, exports, __webpack_require__) {
79106
79107"use strict";
79108/* WEBPACK VAR INJECTION */(function(module) {
79109const colorConvert = __webpack_require__(574);
79110
79111const wrapAnsi16 = (fn, offset) => function () {
79112 const code = fn.apply(colorConvert, arguments);
79113 return `\u001B[${code + offset}m`;
79114};
79115
79116const wrapAnsi256 = (fn, offset) => function () {
79117 const code = fn.apply(colorConvert, arguments);
79118 return `\u001B[${38 + offset};5;${code}m`;
79119};
79120
79121const wrapAnsi16m = (fn, offset) => function () {
79122 const rgb = fn.apply(colorConvert, arguments);
79123 return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
79124};
79125
79126function assembleStyles() {
79127 const codes = new Map();
79128 const styles = {
79129 modifier: {
79130 reset: [0, 0],
79131 // 21 isn't widely supported and 22 does the same thing
79132 bold: [1, 22],
79133 dim: [2, 22],
79134 italic: [3, 23],
79135 underline: [4, 24],
79136 inverse: [7, 27],
79137 hidden: [8, 28],
79138 strikethrough: [9, 29]
79139 },
79140 color: {
79141 black: [30, 39],
79142 red: [31, 39],
79143 green: [32, 39],
79144 yellow: [33, 39],
79145 blue: [34, 39],
79146 magenta: [35, 39],
79147 cyan: [36, 39],
79148 white: [37, 39],
79149 gray: [90, 39],
79150
79151 // Bright color
79152 redBright: [91, 39],
79153 greenBright: [92, 39],
79154 yellowBright: [93, 39],
79155 blueBright: [94, 39],
79156 magentaBright: [95, 39],
79157 cyanBright: [96, 39],
79158 whiteBright: [97, 39]
79159 },
79160 bgColor: {
79161 bgBlack: [40, 49],
79162 bgRed: [41, 49],
79163 bgGreen: [42, 49],
79164 bgYellow: [43, 49],
79165 bgBlue: [44, 49],
79166 bgMagenta: [45, 49],
79167 bgCyan: [46, 49],
79168 bgWhite: [47, 49],
79169
79170 // Bright color
79171 bgBlackBright: [100, 49],
79172 bgRedBright: [101, 49],
79173 bgGreenBright: [102, 49],
79174 bgYellowBright: [103, 49],
79175 bgBlueBright: [104, 49],
79176 bgMagentaBright: [105, 49],
79177 bgCyanBright: [106, 49],
79178 bgWhiteBright: [107, 49]
79179 }
79180 };
79181
79182 // Fix humans
79183 styles.color.grey = styles.color.gray;
79184
79185 for (const groupName of Object.keys(styles)) {
79186 const group = styles[groupName];
79187
79188 for (const styleName of Object.keys(group)) {
79189 const style = group[styleName];
79190
79191 styles[styleName] = {
79192 open: `\u001B[${style[0]}m`,
79193 close: `\u001B[${style[1]}m`
79194 };
79195
79196 group[styleName] = styles[styleName];
79197
79198 codes.set(style[0], style[1]);
79199 }
79200
79201 Object.defineProperty(styles, groupName, {
79202 value: group,
79203 enumerable: false
79204 });
79205
79206 Object.defineProperty(styles, 'codes', {
79207 value: codes,
79208 enumerable: false
79209 });
79210 }
79211
79212 const ansi2ansi = n => n;
79213 const rgb2rgb = (r, g, b) => [r, g, b];
79214
79215 styles.color.close = '\u001B[39m';
79216 styles.bgColor.close = '\u001B[49m';
79217
79218 styles.color.ansi = {
79219 ansi: wrapAnsi16(ansi2ansi, 0)
79220 };
79221 styles.color.ansi256 = {
79222 ansi256: wrapAnsi256(ansi2ansi, 0)
79223 };
79224 styles.color.ansi16m = {
79225 rgb: wrapAnsi16m(rgb2rgb, 0)
79226 };
79227
79228 styles.bgColor.ansi = {
79229 ansi: wrapAnsi16(ansi2ansi, 10)
79230 };
79231 styles.bgColor.ansi256 = {
79232 ansi256: wrapAnsi256(ansi2ansi, 10)
79233 };
79234 styles.bgColor.ansi16m = {
79235 rgb: wrapAnsi16m(rgb2rgb, 10)
79236 };
79237
79238 for (let key of Object.keys(colorConvert)) {
79239 if (typeof colorConvert[key] !== 'object') {
79240 continue;
79241 }
79242
79243 const suite = colorConvert[key];
79244
79245 if (key === 'ansi16') {
79246 key = 'ansi';
79247 }
79248
79249 if ('ansi16' in suite) {
79250 styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
79251 styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
79252 }
79253
79254 if ('ansi256' in suite) {
79255 styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
79256 styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
79257 }
79258
79259 if ('rgb' in suite) {
79260 styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
79261 styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
79262 }
79263 }
79264
79265 return styles;
79266}
79267
79268// Make the export immutable
79269Object.defineProperty(module, 'exports', {
79270 enumerable: true,
79271 get: assembleStyles
79272});
79273
79274/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(150)(module)))
79275
79276/***/ }),
79277/* 448 */
79278/***/ (function(module, exports) {
79279
79280function webpackEmptyContext(req) {
79281 throw new Error("Cannot find module '" + req + "'.");
79282}
79283webpackEmptyContext.keys = function() { return []; };
79284webpackEmptyContext.resolve = webpackEmptyContext;
79285module.exports = webpackEmptyContext;
79286webpackEmptyContext.id = 448;
79287
79288/***/ }),
79289/* 449 */
79290/***/ (function(module, exports, __webpack_require__) {
79291
79292"use strict";
79293
79294 // global key for user preferred registration
79295var REGISTRATION_KEY = '@@any-promise/REGISTRATION',
79296 // Prior registration (preferred or detected)
79297 registered = null
79298
79299/**
79300 * Registers the given implementation. An implementation must
79301 * be registered prior to any call to `require("any-promise")`,
79302 * typically on application load.
79303 *
79304 * If called with no arguments, will return registration in
79305 * following priority:
79306 *
79307 * For Node.js:
79308 *
79309 * 1. Previous registration
79310 * 2. global.Promise if node.js version >= 0.12
79311 * 3. Auto detected promise based on first sucessful require of
79312 * known promise libraries. Note this is a last resort, as the
79313 * loaded library is non-deterministic. node.js >= 0.12 will
79314 * always use global.Promise over this priority list.
79315 * 4. Throws error.
79316 *
79317 * For Browser:
79318 *
79319 * 1. Previous registration
79320 * 2. window.Promise
79321 * 3. Throws error.
79322 *
79323 * Options:
79324 *
79325 * Promise: Desired Promise constructor
79326 * global: Boolean - Should the registration be cached in a global variable to
79327 * allow cross dependency/bundle registration? (default true)
79328 */
79329module.exports = function(root, loadImplementation){
79330 return function register(implementation, opts){
79331 implementation = implementation || null
79332 opts = opts || {}
79333 // global registration unless explicitly {global: false} in options (default true)
79334 var registerGlobal = opts.global !== false;
79335
79336 // load any previous global registration
79337 if(registered === null && registerGlobal){
79338 registered = root[REGISTRATION_KEY] || null
79339 }
79340
79341 if(registered !== null
79342 && implementation !== null
79343 && registered.implementation !== implementation){
79344 // Throw error if attempting to redefine implementation
79345 throw new Error('any-promise already defined as "'+registered.implementation+
79346 '". You can only register an implementation before the first '+
79347 ' call to require("any-promise") and an implementation cannot be changed')
79348 }
79349
79350 if(registered === null){
79351 // use provided implementation
79352 if(implementation !== null && typeof opts.Promise !== 'undefined'){
79353 registered = {
79354 Promise: opts.Promise,
79355 implementation: implementation
79356 }
79357 } else {
79358 // require implementation if implementation is specified but not provided
79359 registered = loadImplementation(implementation)
79360 }
79361
79362 if(registerGlobal){
79363 // register preference globally in case multiple installations
79364 root[REGISTRATION_KEY] = registered
79365 }
79366 }
79367
79368 return registered
79369 }
79370}
79371
79372
79373/***/ }),
79374/* 450 */
79375/***/ (function(module, exports, __webpack_require__) {
79376
79377"use strict";
79378
79379module.exports = __webpack_require__(449)(global, loadImplementation);
79380
79381/**
79382 * Node.js version of loadImplementation.
79383 *
79384 * Requires the given implementation and returns the registration
79385 * containing {Promise, implementation}
79386 *
79387 * If implementation is undefined or global.Promise, loads it
79388 * Otherwise uses require
79389 */
79390function loadImplementation(implementation){
79391 var impl = null
79392
79393 if(shouldPreferGlobalPromise(implementation)){
79394 // if no implementation or env specified use global.Promise
79395 impl = {
79396 Promise: global.Promise,
79397 implementation: 'global.Promise'
79398 }
79399 } else if(implementation){
79400 // if implementation specified, require it
79401 var lib = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }())
79402 impl = {
79403 Promise: lib.Promise || lib,
79404 implementation: implementation
79405 }
79406 } else {
79407 // try to auto detect implementation. This is non-deterministic
79408 // and should prefer other branches, but this is our last chance
79409 // to load something without throwing error
79410 impl = tryAutoDetect()
79411 }
79412
79413 if(impl === null){
79414 throw new Error('Cannot find any-promise implementation nor'+
79415 ' global.Promise. You must install polyfill or call'+
79416 ' require("any-promise/register") with your preferred'+
79417 ' implementation, e.g. require("any-promise/register/bluebird")'+
79418 ' on application load prior to any require("any-promise").')
79419 }
79420
79421 return impl
79422}
79423
79424/**
79425 * Determines if the global.Promise should be preferred if an implementation
79426 * has not been registered.
79427 */
79428function shouldPreferGlobalPromise(implementation){
79429 if(implementation){
79430 return implementation === 'global.Promise'
79431 } else if(typeof global.Promise !== 'undefined'){
79432 // Load global promise if implementation not specified
79433 // Versions < 0.11 did not have global Promise
79434 // Do not use for version < 0.12 as version 0.11 contained buggy versions
79435 var version = (/v(\d+)\.(\d+)\.(\d+)/).exec(process.version)
79436 return !(version && +version[1] == 0 && +version[2] < 12)
79437 }
79438
79439 // do not have global.Promise or another implementation was specified
79440 return false
79441}
79442
79443/**
79444 * Look for common libs as last resort there is no guarantee that
79445 * this will return a desired implementation or even be deterministic.
79446 * The priority is also nearly arbitrary. We are only doing this
79447 * for older versions of Node.js <0.12 that do not have a reasonable
79448 * global.Promise implementation and we the user has not registered
79449 * the preference. This preserves the behavior of any-promise <= 0.1
79450 * and may be deprecated or removed in the future
79451 */
79452function tryAutoDetect(){
79453 var libs = [
79454 "es6-promise",
79455 "promise",
79456 "native-promise-only",
79457 "bluebird",
79458 "rsvp",
79459 "when",
79460 "q",
79461 "pinkie",
79462 "lie",
79463 "vow"]
79464 var i = 0, len = libs.length
79465 for(; i < len; i++){
79466 try {
79467 return loadImplementation(libs[i])
79468 } catch(e){}
79469 }
79470 return null
79471}
79472
79473
79474/***/ }),
79475/* 451 */
79476/***/ (function(module, exports, __webpack_require__) {
79477
79478"use strict";
79479/*!
79480 * arr-flatten <https://github.com/jonschlinkert/arr-flatten>
79481 *
79482 * Copyright (c) 2014-2017, Jon Schlinkert.
79483 * Released under the MIT License.
79484 */
79485
79486
79487
79488module.exports = function (arr) {
79489 return flat(arr, []);
79490};
79491
79492function flat(arr, res) {
79493 var i = 0, cur;
79494 var len = arr.length;
79495 for (; i < len; i++) {
79496 cur = arr[i];
79497 Array.isArray(cur) ? flat(cur, res) : res.push(cur);
79498 }
79499 return res;
79500}
79501
79502
79503/***/ }),
79504/* 452 */
79505/***/ (function(module, exports, __webpack_require__) {
79506
79507"use strict";
79508
79509module.exports = function (arr, predicate, ctx) {
79510 if (typeof Array.prototype.findIndex === 'function') {
79511 return arr.findIndex(predicate, ctx);
79512 }
79513
79514 if (typeof predicate !== 'function') {
79515 throw new TypeError('predicate must be a function');
79516 }
79517
79518 var list = Object(arr);
79519 var len = list.length;
79520
79521 if (len === 0) {
79522 return -1;
79523 }
79524
79525 for (var i = 0; i < len; i++) {
79526 if (predicate.call(ctx, list[i], i, list)) {
79527 return i;
79528 }
79529 }
79530
79531 return -1;
79532};
79533
79534
79535/***/ }),
79536/* 453 */
79537/***/ (function(module, exports, __webpack_require__) {
79538
79539"use strict";
79540
79541
79542var rawAsap = __webpack_require__(454);
79543var freeTasks = [];
79544
79545/**
79546 * Calls a task as soon as possible after returning, in its own event, with
79547 * priority over IO events. An exception thrown in a task can be handled by
79548 * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise
79549 * crash the process. If the error is handled, all subsequent tasks will
79550 * resume.
79551 *
79552 * @param {{call}} task A callable object, typically a function that takes no
79553 * arguments.
79554 */
79555module.exports = asap;
79556function asap(task) {
79557 var rawTask;
79558 if (freeTasks.length) {
79559 rawTask = freeTasks.pop();
79560 } else {
79561 rawTask = new RawTask();
79562 }
79563 rawTask.task = task;
79564 rawTask.domain = process.domain;
79565 rawAsap(rawTask);
79566}
79567
79568function RawTask() {
79569 this.task = null;
79570 this.domain = null;
79571}
79572
79573RawTask.prototype.call = function () {
79574 if (this.domain) {
79575 this.domain.enter();
79576 }
79577 var threw = true;
79578 try {
79579 this.task.call();
79580 threw = false;
79581 // If the task throws an exception (presumably) Node.js restores the
79582 // domain stack for the next event.
79583 if (this.domain) {
79584 this.domain.exit();
79585 }
79586 } finally {
79587 // We use try/finally and a threw flag to avoid messing up stack traces
79588 // when we catch and release errors.
79589 if (threw) {
79590 // In Node.js, uncaught exceptions are considered fatal errors.
79591 // Re-throw them to interrupt flushing!
79592 // Ensure that flushing continues if an uncaught exception is
79593 // suppressed listening process.on("uncaughtException") or
79594 // domain.on("error").
79595 rawAsap.requestFlush();
79596 }
79597 // If the task threw an error, we do not want to exit the domain here.
79598 // Exiting the domain would prevent the domain from catching the error.
79599 this.task = null;
79600 this.domain = null;
79601 freeTasks.push(this);
79602 }
79603};
79604
79605
79606
79607/***/ }),
79608/* 454 */
79609/***/ (function(module, exports, __webpack_require__) {
79610
79611"use strict";
79612
79613
79614var domain; // The domain module is executed on demand
79615var hasSetImmediate = typeof setImmediate === "function";
79616
79617// Use the fastest means possible to execute a task in its own turn, with
79618// priority over other events including network IO events in Node.js.
79619//
79620// An exception thrown by a task will permanently interrupt the processing of
79621// subsequent tasks. The higher level `asap` function ensures that if an
79622// exception is thrown by a task, that the task queue will continue flushing as
79623// soon as possible, but if you use `rawAsap` directly, you are responsible to
79624// either ensure that no exceptions are thrown from your task, or to manually
79625// call `rawAsap.requestFlush` if an exception is thrown.
79626module.exports = rawAsap;
79627function rawAsap(task) {
79628 if (!queue.length) {
79629 requestFlush();
79630 flushing = true;
79631 }
79632 // Avoids a function call
79633 queue[queue.length] = task;
79634}
79635
79636var queue = [];
79637// Once a flush has been requested, no further calls to `requestFlush` are
79638// necessary until the next `flush` completes.
79639var flushing = false;
79640// The position of the next task to execute in the task queue. This is
79641// preserved between calls to `flush` so that it can be resumed if
79642// a task throws an exception.
79643var index = 0;
79644// If a task schedules additional tasks recursively, the task queue can grow
79645// unbounded. To prevent memory excaustion, the task queue will periodically
79646// truncate already-completed tasks.
79647var capacity = 1024;
79648
79649// The flush function processes all tasks that have been scheduled with
79650// `rawAsap` unless and until one of those tasks throws an exception.
79651// If a task throws an exception, `flush` ensures that its state will remain
79652// consistent and will resume where it left off when called again.
79653// However, `flush` does not make any arrangements to be called again if an
79654// exception is thrown.
79655function flush() {
79656 while (index < queue.length) {
79657 var currentIndex = index;
79658 // Advance the index before calling the task. This ensures that we will
79659 // begin flushing on the next task the task throws an error.
79660 index = index + 1;
79661 queue[currentIndex].call();
79662 // Prevent leaking memory for long chains of recursive calls to `asap`.
79663 // If we call `asap` within tasks scheduled by `asap`, the queue will
79664 // grow, but to avoid an O(n) walk for every task we execute, we don't
79665 // shift tasks off the queue after they have been executed.
79666 // Instead, we periodically shift 1024 tasks off the queue.
79667 if (index > capacity) {
79668 // Manually shift all values starting at the index back to the
79669 // beginning of the queue.
79670 for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) {
79671 queue[scan] = queue[scan + index];
79672 }
79673 queue.length -= index;
79674 index = 0;
79675 }
79676 }
79677 queue.length = 0;
79678 index = 0;
79679 flushing = false;
79680}
79681
79682rawAsap.requestFlush = requestFlush;
79683function requestFlush() {
79684 // Ensure flushing is not bound to any domain.
79685 // It is not sufficient to exit the domain, because domains exist on a stack.
79686 // To execute code outside of any domain, the following dance is necessary.
79687 var parentDomain = process.domain;
79688 if (parentDomain) {
79689 if (!domain) {
79690 // Lazy execute the domain module.
79691 // Only employed if the user elects to use domains.
79692 domain = __webpack_require__(1038);
79693 }
79694 domain.active = process.domain = null;
79695 }
79696
79697 // `setImmediate` is slower that `process.nextTick`, but `process.nextTick`
79698 // cannot handle recursion.
79699 // `requestFlush` will only be called recursively from `asap.js`, to resume
79700 // flushing after an error is thrown into a domain.
79701 // Conveniently, `setImmediate` was introduced in the same version
79702 // `process.nextTick` started throwing recursion errors.
79703 if (flushing && hasSetImmediate) {
79704 setImmediate(flush);
79705 } else {
79706 process.nextTick(flush);
79707 }
79708
79709 if (parentDomain) {
79710 domain.active = process.domain = parentDomain;
79711 }
79712}
79713
79714
79715/***/ }),
79716/* 455 */
79717/***/ (function(module, exports, __webpack_require__) {
79718
79719// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
79720
79721var errors = __webpack_require__(191);
79722var types = __webpack_require__(192);
79723
79724var Reader = __webpack_require__(456);
79725var Writer = __webpack_require__(457);
79726
79727
79728// --- Exports
79729
79730module.exports = {
79731
79732 Reader: Reader,
79733
79734 Writer: Writer
79735
79736};
79737
79738for (var t in types) {
79739 if (types.hasOwnProperty(t))
79740 module.exports[t] = types[t];
79741}
79742for (var e in errors) {
79743 if (errors.hasOwnProperty(e))
79744 module.exports[e] = errors[e];
79745}
79746
79747
79748/***/ }),
79749/* 456 */
79750/***/ (function(module, exports, __webpack_require__) {
79751
79752// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
79753
79754var assert = __webpack_require__(50);
79755var Buffer = __webpack_require__(20).Buffer;
79756
79757var ASN1 = __webpack_require__(192);
79758var errors = __webpack_require__(191);
79759
79760
79761// --- Globals
79762
79763var newInvalidAsn1Error = errors.newInvalidAsn1Error;
79764
79765
79766
79767// --- API
79768
79769function Reader(data) {
79770 if (!data || !Buffer.isBuffer(data))
79771 throw new TypeError('data must be a node Buffer');
79772
79773 this._buf = data;
79774 this._size = data.length;
79775
79776 // These hold the "current" state
79777 this._len = 0;
79778 this._offset = 0;
79779}
79780
79781Object.defineProperty(Reader.prototype, 'length', {
79782 enumerable: true,
79783 get: function () { return (this._len); }
79784});
79785
79786Object.defineProperty(Reader.prototype, 'offset', {
79787 enumerable: true,
79788 get: function () { return (this._offset); }
79789});
79790
79791Object.defineProperty(Reader.prototype, 'remain', {
79792 get: function () { return (this._size - this._offset); }
79793});
79794
79795Object.defineProperty(Reader.prototype, 'buffer', {
79796 get: function () { return (this._buf.slice(this._offset)); }
79797});
79798
79799
79800/**
79801 * Reads a single byte and advances offset; you can pass in `true` to make this
79802 * a "peek" operation (i.e., get the byte, but don't advance the offset).
79803 *
79804 * @param {Boolean} peek true means don't move offset.
79805 * @return {Number} the next byte, null if not enough data.
79806 */
79807Reader.prototype.readByte = function (peek) {
79808 if (this._size - this._offset < 1)
79809 return null;
79810
79811 var b = this._buf[this._offset] & 0xff;
79812
79813 if (!peek)
79814 this._offset += 1;
79815
79816 return b;
79817};
79818
79819
79820Reader.prototype.peek = function () {
79821 return this.readByte(true);
79822};
79823
79824
79825/**
79826 * Reads a (potentially) variable length off the BER buffer. This call is
79827 * not really meant to be called directly, as callers have to manipulate
79828 * the internal buffer afterwards.
79829 *
79830 * As a result of this call, you can call `Reader.length`, until the
79831 * next thing called that does a readLength.
79832 *
79833 * @return {Number} the amount of offset to advance the buffer.
79834 * @throws {InvalidAsn1Error} on bad ASN.1
79835 */
79836Reader.prototype.readLength = function (offset) {
79837 if (offset === undefined)
79838 offset = this._offset;
79839
79840 if (offset >= this._size)
79841 return null;
79842
79843 var lenB = this._buf[offset++] & 0xff;
79844 if (lenB === null)
79845 return null;
79846
79847 if ((lenB & 0x80) === 0x80) {
79848 lenB &= 0x7f;
79849
79850 if (lenB === 0)
79851 throw newInvalidAsn1Error('Indefinite length not supported');
79852
79853 if (lenB > 4)
79854 throw newInvalidAsn1Error('encoding too long');
79855
79856 if (this._size - offset < lenB)
79857 return null;
79858
79859 this._len = 0;
79860 for (var i = 0; i < lenB; i++)
79861 this._len = (this._len << 8) + (this._buf[offset++] & 0xff);
79862
79863 } else {
79864 // Wasn't a variable length
79865 this._len = lenB;
79866 }
79867
79868 return offset;
79869};
79870
79871
79872/**
79873 * Parses the next sequence in this BER buffer.
79874 *
79875 * To get the length of the sequence, call `Reader.length`.
79876 *
79877 * @return {Number} the sequence's tag.
79878 */
79879Reader.prototype.readSequence = function (tag) {
79880 var seq = this.peek();
79881 if (seq === null)
79882 return null;
79883 if (tag !== undefined && tag !== seq)
79884 throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
79885 ': got 0x' + seq.toString(16));
79886
79887 var o = this.readLength(this._offset + 1); // stored in `length`
79888 if (o === null)
79889 return null;
79890
79891 this._offset = o;
79892 return seq;
79893};
79894
79895
79896Reader.prototype.readInt = function () {
79897 return this._readTag(ASN1.Integer);
79898};
79899
79900
79901Reader.prototype.readBoolean = function () {
79902 return (this._readTag(ASN1.Boolean) === 0 ? false : true);
79903};
79904
79905
79906Reader.prototype.readEnumeration = function () {
79907 return this._readTag(ASN1.Enumeration);
79908};
79909
79910
79911Reader.prototype.readString = function (tag, retbuf) {
79912 if (!tag)
79913 tag = ASN1.OctetString;
79914
79915 var b = this.peek();
79916 if (b === null)
79917 return null;
79918
79919 if (b !== tag)
79920 throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
79921 ': got 0x' + b.toString(16));
79922
79923 var o = this.readLength(this._offset + 1); // stored in `length`
79924
79925 if (o === null)
79926 return null;
79927
79928 if (this.length > this._size - o)
79929 return null;
79930
79931 this._offset = o;
79932
79933 if (this.length === 0)
79934 return retbuf ? Buffer.alloc(0) : '';
79935
79936 var str = this._buf.slice(this._offset, this._offset + this.length);
79937 this._offset += this.length;
79938
79939 return retbuf ? str : str.toString('utf8');
79940};
79941
79942Reader.prototype.readOID = function (tag) {
79943 if (!tag)
79944 tag = ASN1.OID;
79945
79946 var b = this.readString(tag, true);
79947 if (b === null)
79948 return null;
79949
79950 var values = [];
79951 var value = 0;
79952
79953 for (var i = 0; i < b.length; i++) {
79954 var byte = b[i] & 0xff;
79955
79956 value <<= 7;
79957 value += byte & 0x7f;
79958 if ((byte & 0x80) === 0) {
79959 values.push(value);
79960 value = 0;
79961 }
79962 }
79963
79964 value = values.shift();
79965 values.unshift(value % 40);
79966 values.unshift((value / 40) >> 0);
79967
79968 return values.join('.');
79969};
79970
79971
79972Reader.prototype._readTag = function (tag) {
79973 assert.ok(tag !== undefined);
79974
79975 var b = this.peek();
79976
79977 if (b === null)
79978 return null;
79979
79980 if (b !== tag)
79981 throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) +
79982 ': got 0x' + b.toString(16));
79983
79984 var o = this.readLength(this._offset + 1); // stored in `length`
79985 if (o === null)
79986 return null;
79987
79988 if (this.length > 4)
79989 throw newInvalidAsn1Error('Integer too long: ' + this.length);
79990
79991 if (this.length > this._size - o)
79992 return null;
79993 this._offset = o;
79994
79995 var fb = this._buf[this._offset];
79996 var value = 0;
79997
79998 for (var i = 0; i < this.length; i++) {
79999 value <<= 8;
80000 value |= (this._buf[this._offset++] & 0xff);
80001 }
80002
80003 if ((fb & 0x80) === 0x80 && i !== 4)
80004 value -= (1 << (i * 8));
80005
80006 return value >> 0;
80007};
80008
80009
80010
80011// --- Exported API
80012
80013module.exports = Reader;
80014
80015
80016/***/ }),
80017/* 457 */
80018/***/ (function(module, exports, __webpack_require__) {
80019
80020// Copyright 2011 Mark Cavage <mcavage@gmail.com> All rights reserved.
80021
80022var assert = __webpack_require__(50);
80023var Buffer = __webpack_require__(20).Buffer;
80024var ASN1 = __webpack_require__(192);
80025var errors = __webpack_require__(191);
80026
80027
80028// --- Globals
80029
80030var newInvalidAsn1Error = errors.newInvalidAsn1Error;
80031
80032var DEFAULT_OPTS = {
80033 size: 1024,
80034 growthFactor: 8
80035};
80036
80037
80038// --- Helpers
80039
80040function merge(from, to) {
80041 assert.ok(from);
80042 assert.equal(typeof (from), 'object');
80043 assert.ok(to);
80044 assert.equal(typeof (to), 'object');
80045
80046 var keys = Object.getOwnPropertyNames(from);
80047 keys.forEach(function (key) {
80048 if (to[key])
80049 return;
80050
80051 var value = Object.getOwnPropertyDescriptor(from, key);
80052 Object.defineProperty(to, key, value);
80053 });
80054
80055 return to;
80056}
80057
80058
80059
80060// --- API
80061
80062function Writer(options) {
80063 options = merge(DEFAULT_OPTS, options || {});
80064
80065 this._buf = Buffer.alloc(options.size || 1024);
80066 this._size = this._buf.length;
80067 this._offset = 0;
80068 this._options = options;
80069
80070 // A list of offsets in the buffer where we need to insert
80071 // sequence tag/len pairs.
80072 this._seq = [];
80073}
80074
80075Object.defineProperty(Writer.prototype, 'buffer', {
80076 get: function () {
80077 if (this._seq.length)
80078 throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)');
80079
80080 return (this._buf.slice(0, this._offset));
80081 }
80082});
80083
80084Writer.prototype.writeByte = function (b) {
80085 if (typeof (b) !== 'number')
80086 throw new TypeError('argument must be a Number');
80087
80088 this._ensure(1);
80089 this._buf[this._offset++] = b;
80090};
80091
80092
80093Writer.prototype.writeInt = function (i, tag) {
80094 if (typeof (i) !== 'number')
80095 throw new TypeError('argument must be a Number');
80096 if (typeof (tag) !== 'number')
80097 tag = ASN1.Integer;
80098
80099 var sz = 4;
80100
80101 while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) &&
80102 (sz > 1)) {
80103 sz--;
80104 i <<= 8;
80105 }
80106
80107 if (sz > 4)
80108 throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff');
80109
80110 this._ensure(2 + sz);
80111 this._buf[this._offset++] = tag;
80112 this._buf[this._offset++] = sz;
80113
80114 while (sz-- > 0) {
80115 this._buf[this._offset++] = ((i & 0xff000000) >>> 24);
80116 i <<= 8;
80117 }
80118
80119};
80120
80121
80122Writer.prototype.writeNull = function () {
80123 this.writeByte(ASN1.Null);
80124 this.writeByte(0x00);
80125};
80126
80127
80128Writer.prototype.writeEnumeration = function (i, tag) {
80129 if (typeof (i) !== 'number')
80130 throw new TypeError('argument must be a Number');
80131 if (typeof (tag) !== 'number')
80132 tag = ASN1.Enumeration;
80133
80134 return this.writeInt(i, tag);
80135};
80136
80137
80138Writer.prototype.writeBoolean = function (b, tag) {
80139 if (typeof (b) !== 'boolean')
80140 throw new TypeError('argument must be a Boolean');
80141 if (typeof (tag) !== 'number')
80142 tag = ASN1.Boolean;
80143
80144 this._ensure(3);
80145 this._buf[this._offset++] = tag;
80146 this._buf[this._offset++] = 0x01;
80147 this._buf[this._offset++] = b ? 0xff : 0x00;
80148};
80149
80150
80151Writer.prototype.writeString = function (s, tag) {
80152 if (typeof (s) !== 'string')
80153 throw new TypeError('argument must be a string (was: ' + typeof (s) + ')');
80154 if (typeof (tag) !== 'number')
80155 tag = ASN1.OctetString;
80156
80157 var len = Buffer.byteLength(s);
80158 this.writeByte(tag);
80159 this.writeLength(len);
80160 if (len) {
80161 this._ensure(len);
80162 this._buf.write(s, this._offset);
80163 this._offset += len;
80164 }
80165};
80166
80167
80168Writer.prototype.writeBuffer = function (buf, tag) {
80169 if (typeof (tag) !== 'number')
80170 throw new TypeError('tag must be a number');
80171 if (!Buffer.isBuffer(buf))
80172 throw new TypeError('argument must be a buffer');
80173
80174 this.writeByte(tag);
80175 this.writeLength(buf.length);
80176 this._ensure(buf.length);
80177 buf.copy(this._buf, this._offset, 0, buf.length);
80178 this._offset += buf.length;
80179};
80180
80181
80182Writer.prototype.writeStringArray = function (strings) {
80183 if ((!strings instanceof Array))
80184 throw new TypeError('argument must be an Array[String]');
80185
80186 var self = this;
80187 strings.forEach(function (s) {
80188 self.writeString(s);
80189 });
80190};
80191
80192// This is really to solve DER cases, but whatever for now
80193Writer.prototype.writeOID = function (s, tag) {
80194 if (typeof (s) !== 'string')
80195 throw new TypeError('argument must be a string');
80196 if (typeof (tag) !== 'number')
80197 tag = ASN1.OID;
80198
80199 if (!/^([0-9]+\.){3,}[0-9]+$/.test(s))
80200 throw new Error('argument is not a valid OID string');
80201
80202 function encodeOctet(bytes, octet) {
80203 if (octet < 128) {
80204 bytes.push(octet);
80205 } else if (octet < 16384) {
80206 bytes.push((octet >>> 7) | 0x80);
80207 bytes.push(octet & 0x7F);
80208 } else if (octet < 2097152) {
80209 bytes.push((octet >>> 14) | 0x80);
80210 bytes.push(((octet >>> 7) | 0x80) & 0xFF);
80211 bytes.push(octet & 0x7F);
80212 } else if (octet < 268435456) {
80213 bytes.push((octet >>> 21) | 0x80);
80214 bytes.push(((octet >>> 14) | 0x80) & 0xFF);
80215 bytes.push(((octet >>> 7) | 0x80) & 0xFF);
80216 bytes.push(octet & 0x7F);
80217 } else {
80218 bytes.push(((octet >>> 28) | 0x80) & 0xFF);
80219 bytes.push(((octet >>> 21) | 0x80) & 0xFF);
80220 bytes.push(((octet >>> 14) | 0x80) & 0xFF);
80221 bytes.push(((octet >>> 7) | 0x80) & 0xFF);
80222 bytes.push(octet & 0x7F);
80223 }
80224 }
80225
80226 var tmp = s.split('.');
80227 var bytes = [];
80228 bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10));
80229 tmp.slice(2).forEach(function (b) {
80230 encodeOctet(bytes, parseInt(b, 10));
80231 });
80232
80233 var self = this;
80234 this._ensure(2 + bytes.length);
80235 this.writeByte(tag);
80236 this.writeLength(bytes.length);
80237 bytes.forEach(function (b) {
80238 self.writeByte(b);
80239 });
80240};
80241
80242
80243Writer.prototype.writeLength = function (len) {
80244 if (typeof (len) !== 'number')
80245 throw new TypeError('argument must be a Number');
80246
80247 this._ensure(4);
80248
80249 if (len <= 0x7f) {
80250 this._buf[this._offset++] = len;
80251 } else if (len <= 0xff) {
80252 this._buf[this._offset++] = 0x81;
80253 this._buf[this._offset++] = len;
80254 } else if (len <= 0xffff) {
80255 this._buf[this._offset++] = 0x82;
80256 this._buf[this._offset++] = len >> 8;
80257 this._buf[this._offset++] = len;
80258 } else if (len <= 0xffffff) {
80259 this._buf[this._offset++] = 0x83;
80260 this._buf[this._offset++] = len >> 16;
80261 this._buf[this._offset++] = len >> 8;
80262 this._buf[this._offset++] = len;
80263 } else {
80264 throw newInvalidAsn1Error('Length too long (> 4 bytes)');
80265 }
80266};
80267
80268Writer.prototype.startSequence = function (tag) {
80269 if (typeof (tag) !== 'number')
80270 tag = ASN1.Sequence | ASN1.Constructor;
80271
80272 this.writeByte(tag);
80273 this._seq.push(this._offset);
80274 this._ensure(3);
80275 this._offset += 3;
80276};
80277
80278
80279Writer.prototype.endSequence = function () {
80280 var seq = this._seq.pop();
80281 var start = seq + 3;
80282 var len = this._offset - start;
80283
80284 if (len <= 0x7f) {
80285 this._shift(start, len, -2);
80286 this._buf[seq] = len;
80287 } else if (len <= 0xff) {
80288 this._shift(start, len, -1);
80289 this._buf[seq] = 0x81;
80290 this._buf[seq + 1] = len;
80291 } else if (len <= 0xffff) {
80292 this._buf[seq] = 0x82;
80293 this._buf[seq + 1] = len >> 8;
80294 this._buf[seq + 2] = len;
80295 } else if (len <= 0xffffff) {
80296 this._shift(start, len, 1);
80297 this._buf[seq] = 0x83;
80298 this._buf[seq + 1] = len >> 16;
80299 this._buf[seq + 2] = len >> 8;
80300 this._buf[seq + 3] = len;
80301 } else {
80302 throw newInvalidAsn1Error('Sequence too long');
80303 }
80304};
80305
80306
80307Writer.prototype._shift = function (start, len, shift) {
80308 assert.ok(start !== undefined);
80309 assert.ok(len !== undefined);
80310 assert.ok(shift);
80311
80312 this._buf.copy(this._buf, start + shift, start, start + len);
80313 this._offset += shift;
80314};
80315
80316Writer.prototype._ensure = function (len) {
80317 assert.ok(len);
80318
80319 if (this._size - this._offset < len) {
80320 var sz = this._size * this._options.growthFactor;
80321 if (sz - this._offset < len)
80322 sz += len;
80323
80324 var buf = Buffer.alloc(sz);
80325
80326 this._buf.copy(buf, 0, 0, this._offset);
80327 this._buf = buf;
80328 this._size = sz;
80329 }
80330};
80331
80332
80333
80334// --- Exported API
80335
80336module.exports = Writer;
80337
80338
80339/***/ }),
80340/* 458 */
80341/***/ (function(module, exports, __webpack_require__) {
80342
80343module.exports =
80344{
80345 parallel : __webpack_require__(460),
80346 serial : __webpack_require__(461),
80347 serialOrdered : __webpack_require__(284)
80348};
80349
80350
80351/***/ }),
80352/* 459 */
80353/***/ (function(module, exports) {
80354
80355module.exports = defer;
80356
80357/**
80358 * Runs provided function on next iteration of the event loop
80359 *
80360 * @param {function} fn - function to run
80361 */
80362function defer(fn)
80363{
80364 var nextTick = typeof setImmediate == 'function'
80365 ? setImmediate
80366 : (
80367 typeof process == 'object' && typeof process.nextTick == 'function'
80368 ? process.nextTick
80369 : null
80370 );
80371
80372 if (nextTick)
80373 {
80374 nextTick(fn);
80375 }
80376 else
80377 {
80378 setTimeout(fn, 0);
80379 }
80380}
80381
80382
80383/***/ }),
80384/* 460 */
80385/***/ (function(module, exports, __webpack_require__) {
80386
80387var iterate = __webpack_require__(281)
80388 , initState = __webpack_require__(282)
80389 , terminator = __webpack_require__(283)
80390 ;
80391
80392// Public API
80393module.exports = parallel;
80394
80395/**
80396 * Runs iterator over provided array elements in parallel
80397 *
80398 * @param {array|object} list - array or object (named list) to iterate over
80399 * @param {function} iterator - iterator to run
80400 * @param {function} callback - invoked when all elements processed
80401 * @returns {function} - jobs terminator
80402 */
80403function parallel(list, iterator, callback)
80404{
80405 var state = initState(list);
80406
80407 while (state.index < (state['keyedList'] || list).length)
80408 {
80409 iterate(list, iterator, state, function(error, result)
80410 {
80411 if (error)
80412 {
80413 callback(error, result);
80414 return;
80415 }
80416
80417 // looks like it's the last one
80418 if (Object.keys(state.jobs).length === 0)
80419 {
80420 callback(null, state.results);
80421 return;
80422 }
80423 });
80424
80425 state.index++;
80426 }
80427
80428 return terminator.bind(state, callback);
80429}
80430
80431
80432/***/ }),
80433/* 461 */
80434/***/ (function(module, exports, __webpack_require__) {
80435
80436var serialOrdered = __webpack_require__(284);
80437
80438// Public API
80439module.exports = serial;
80440
80441/**
80442 * Runs iterator over provided array elements in series
80443 *
80444 * @param {array|object} list - array or object (named list) to iterate over
80445 * @param {function} iterator - iterator to run
80446 * @param {function} callback - invoked when all elements processed
80447 * @returns {function} - jobs terminator
80448 */
80449function serial(list, iterator, callback)
80450{
80451 return serialOrdered(list, iterator, null, callback);
80452}
80453
80454
80455/***/ }),
80456/* 462 */
80457/***/ (function(module, exports, __webpack_require__) {
80458
80459
80460/*!
80461 * Copyright 2010 LearnBoost <dev@learnboost.com>
80462 *
80463 * Licensed under the Apache License, Version 2.0 (the "License");
80464 * you may not use this file except in compliance with the License.
80465 * You may obtain a copy of the License at
80466 *
80467 * http://www.apache.org/licenses/LICENSE-2.0
80468 *
80469 * Unless required by applicable law or agreed to in writing, software
80470 * distributed under the License is distributed on an "AS IS" BASIS,
80471 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
80472 * See the License for the specific language governing permissions and
80473 * limitations under the License.
80474 */
80475
80476/**
80477 * Module dependencies.
80478 */
80479
80480var crypto = __webpack_require__(21)
80481 , parse = __webpack_require__(29).parse
80482 ;
80483
80484/**
80485 * Valid keys.
80486 */
80487
80488var keys =
80489 [ 'acl'
80490 , 'location'
80491 , 'logging'
80492 , 'notification'
80493 , 'partNumber'
80494 , 'policy'
80495 , 'requestPayment'
80496 , 'torrent'
80497 , 'uploadId'
80498 , 'uploads'
80499 , 'versionId'
80500 , 'versioning'
80501 , 'versions'
80502 , 'website'
80503 ]
80504
80505/**
80506 * Return an "Authorization" header value with the given `options`
80507 * in the form of "AWS <key>:<signature>"
80508 *
80509 * @param {Object} options
80510 * @return {String}
80511 * @api private
80512 */
80513
80514function authorization (options) {
80515 return 'AWS ' + options.key + ':' + sign(options)
80516}
80517
80518module.exports = authorization
80519module.exports.authorization = authorization
80520
80521/**
80522 * Simple HMAC-SHA1 Wrapper
80523 *
80524 * @param {Object} options
80525 * @return {String}
80526 * @api private
80527 */
80528
80529function hmacSha1 (options) {
80530 return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64')
80531}
80532
80533module.exports.hmacSha1 = hmacSha1
80534
80535/**
80536 * Create a base64 sha1 HMAC for `options`.
80537 *
80538 * @param {Object} options
80539 * @return {String}
80540 * @api private
80541 */
80542
80543function sign (options) {
80544 options.message = stringToSign(options)
80545 return hmacSha1(options)
80546}
80547module.exports.sign = sign
80548
80549/**
80550 * Create a base64 sha1 HMAC for `options`.
80551 *
80552 * Specifically to be used with S3 presigned URLs
80553 *
80554 * @param {Object} options
80555 * @return {String}
80556 * @api private
80557 */
80558
80559function signQuery (options) {
80560 options.message = queryStringToSign(options)
80561 return hmacSha1(options)
80562}
80563module.exports.signQuery= signQuery
80564
80565/**
80566 * Return a string for sign() with the given `options`.
80567 *
80568 * Spec:
80569 *
80570 * <verb>\n
80571 * <md5>\n
80572 * <content-type>\n
80573 * <date>\n
80574 * [headers\n]
80575 * <resource>
80576 *
80577 * @param {Object} options
80578 * @return {String}
80579 * @api private
80580 */
80581
80582function stringToSign (options) {
80583 var headers = options.amazonHeaders || ''
80584 if (headers) headers += '\n'
80585 var r =
80586 [ options.verb
80587 , options.md5
80588 , options.contentType
80589 , options.date ? options.date.toUTCString() : ''
80590 , headers + options.resource
80591 ]
80592 return r.join('\n')
80593}
80594module.exports.stringToSign = stringToSign
80595
80596/**
80597 * Return a string for sign() with the given `options`, but is meant exclusively
80598 * for S3 presigned URLs
80599 *
80600 * Spec:
80601 *
80602 * <date>\n
80603 * <resource>
80604 *
80605 * @param {Object} options
80606 * @return {String}
80607 * @api private
80608 */
80609
80610function queryStringToSign (options){
80611 return 'GET\n\n\n' + options.date + '\n' + options.resource
80612}
80613module.exports.queryStringToSign = queryStringToSign
80614
80615/**
80616 * Perform the following:
80617 *
80618 * - ignore non-amazon headers
80619 * - lowercase fields
80620 * - sort lexicographically
80621 * - trim whitespace between ":"
80622 * - join with newline
80623 *
80624 * @param {Object} headers
80625 * @return {String}
80626 * @api private
80627 */
80628
80629function canonicalizeHeaders (headers) {
80630 var buf = []
80631 , fields = Object.keys(headers)
80632 ;
80633 for (var i = 0, len = fields.length; i < len; ++i) {
80634 var field = fields[i]
80635 , val = headers[field]
80636 , field = field.toLowerCase()
80637 ;
80638 if (0 !== field.indexOf('x-amz')) continue
80639 buf.push(field + ':' + val)
80640 }
80641 return buf.sort().join('\n')
80642}
80643module.exports.canonicalizeHeaders = canonicalizeHeaders
80644
80645/**
80646 * Perform the following:
80647 *
80648 * - ignore non sub-resources
80649 * - sort lexicographically
80650 *
80651 * @param {String} resource
80652 * @return {String}
80653 * @api private
80654 */
80655
80656function canonicalizeResource (resource) {
80657 var url = parse(resource, true)
80658 , path = url.pathname
80659 , buf = []
80660 ;
80661
80662 Object.keys(url.query).forEach(function(key){
80663 if (!~keys.indexOf(key)) return
80664 var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key])
80665 buf.push(key + val)
80666 })
80667
80668 return path + (buf.length ? '?' + buf.sort().join('&') : '')
80669}
80670module.exports.canonicalizeResource = canonicalizeResource
80671
80672
80673/***/ }),
80674/* 463 */
80675/***/ (function(module, exports, __webpack_require__) {
80676
80677var aws4 = exports,
80678 url = __webpack_require__(29),
80679 querystring = __webpack_require__(186),
80680 crypto = __webpack_require__(21),
80681 lru = __webpack_require__(464),
80682 credentialsCache = lru(1000)
80683
80684// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html
80685
80686function hmac(key, string, encoding) {
80687 return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding)
80688}
80689
80690function hash(string, encoding) {
80691 return crypto.createHash('sha256').update(string, 'utf8').digest(encoding)
80692}
80693
80694// This function assumes the string has already been percent encoded
80695function encodeRfc3986(urlEncodedString) {
80696 return urlEncodedString.replace(/[!'()*]/g, function(c) {
80697 return '%' + c.charCodeAt(0).toString(16).toUpperCase()
80698 })
80699}
80700
80701// request: { path | body, [host], [method], [headers], [service], [region] }
80702// credentials: { accessKeyId, secretAccessKey, [sessionToken] }
80703function RequestSigner(request, credentials) {
80704
80705 if (typeof request === 'string') request = url.parse(request)
80706
80707 var headers = request.headers = (request.headers || {}),
80708 hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host)
80709
80710 this.request = request
80711 this.credentials = credentials || this.defaultCredentials()
80712
80713 this.service = request.service || hostParts[0] || ''
80714 this.region = request.region || hostParts[1] || 'us-east-1'
80715
80716 // SES uses a different domain from the service name
80717 if (this.service === 'email') this.service = 'ses'
80718
80719 if (!request.method && request.body)
80720 request.method = 'POST'
80721
80722 if (!headers.Host && !headers.host) {
80723 headers.Host = request.hostname || request.host || this.createHost()
80724
80725 // If a port is specified explicitly, use it as is
80726 if (request.port)
80727 headers.Host += ':' + request.port
80728 }
80729 if (!request.hostname && !request.host)
80730 request.hostname = headers.Host || headers.host
80731
80732 this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT'
80733}
80734
80735RequestSigner.prototype.matchHost = function(host) {
80736 var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/)
80737 var hostParts = (match || []).slice(1, 3)
80738
80739 // ES's hostParts are sometimes the other way round, if the value that is expected
80740 // to be region equals ‘es’ switch them back
80741 // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com
80742 if (hostParts[1] === 'es')
80743 hostParts = hostParts.reverse()
80744
80745 return hostParts
80746}
80747
80748// http://docs.aws.amazon.com/general/latest/gr/rande.html
80749RequestSigner.prototype.isSingleRegion = function() {
80750 // Special case for S3 and SimpleDB in us-east-1
80751 if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true
80752
80753 return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts']
80754 .indexOf(this.service) >= 0
80755}
80756
80757RequestSigner.prototype.createHost = function() {
80758 var region = this.isSingleRegion() ? '' :
80759 (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region,
80760 service = this.service === 'ses' ? 'email' : this.service
80761 return service + region + '.amazonaws.com'
80762}
80763
80764RequestSigner.prototype.prepareRequest = function() {
80765 this.parsePath()
80766
80767 var request = this.request, headers = request.headers, query
80768
80769 if (request.signQuery) {
80770
80771 this.parsedPath.query = query = this.parsedPath.query || {}
80772
80773 if (this.credentials.sessionToken)
80774 query['X-Amz-Security-Token'] = this.credentials.sessionToken
80775
80776 if (this.service === 's3' && !query['X-Amz-Expires'])
80777 query['X-Amz-Expires'] = 86400
80778
80779 if (query['X-Amz-Date'])
80780 this.datetime = query['X-Amz-Date']
80781 else
80782 query['X-Amz-Date'] = this.getDateTime()
80783
80784 query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'
80785 query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString()
80786 query['X-Amz-SignedHeaders'] = this.signedHeaders()
80787
80788 } else {
80789
80790 if (!request.doNotModifyHeaders && !this.isCodeCommitGit) {
80791 if (request.body && !headers['Content-Type'] && !headers['content-type'])
80792 headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'
80793
80794 if (request.body && !headers['Content-Length'] && !headers['content-length'])
80795 headers['Content-Length'] = Buffer.byteLength(request.body)
80796
80797 if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token'])
80798 headers['X-Amz-Security-Token'] = this.credentials.sessionToken
80799
80800 if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256'])
80801 headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex')
80802
80803 if (headers['X-Amz-Date'] || headers['x-amz-date'])
80804 this.datetime = headers['X-Amz-Date'] || headers['x-amz-date']
80805 else
80806 headers['X-Amz-Date'] = this.getDateTime()
80807 }
80808
80809 delete headers.Authorization
80810 delete headers.authorization
80811 }
80812}
80813
80814RequestSigner.prototype.sign = function() {
80815 if (!this.parsedPath) this.prepareRequest()
80816
80817 if (this.request.signQuery) {
80818 this.parsedPath.query['X-Amz-Signature'] = this.signature()
80819 } else {
80820 this.request.headers.Authorization = this.authHeader()
80821 }
80822
80823 this.request.path = this.formatPath()
80824
80825 return this.request
80826}
80827
80828RequestSigner.prototype.getDateTime = function() {
80829 if (!this.datetime) {
80830 var headers = this.request.headers,
80831 date = new Date(headers.Date || headers.date || new Date)
80832
80833 this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '')
80834
80835 // Remove the trailing 'Z' on the timestamp string for CodeCommit git access
80836 if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1)
80837 }
80838 return this.datetime
80839}
80840
80841RequestSigner.prototype.getDate = function() {
80842 return this.getDateTime().substr(0, 8)
80843}
80844
80845RequestSigner.prototype.authHeader = function() {
80846 return [
80847 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(),
80848 'SignedHeaders=' + this.signedHeaders(),
80849 'Signature=' + this.signature(),
80850 ].join(', ')
80851}
80852
80853RequestSigner.prototype.signature = function() {
80854 var date = this.getDate(),
80855 cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(),
80856 kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey)
80857 if (!kCredentials) {
80858 kDate = hmac('AWS4' + this.credentials.secretAccessKey, date)
80859 kRegion = hmac(kDate, this.region)
80860 kService = hmac(kRegion, this.service)
80861 kCredentials = hmac(kService, 'aws4_request')
80862 credentialsCache.set(cacheKey, kCredentials)
80863 }
80864 return hmac(kCredentials, this.stringToSign(), 'hex')
80865}
80866
80867RequestSigner.prototype.stringToSign = function() {
80868 return [
80869 'AWS4-HMAC-SHA256',
80870 this.getDateTime(),
80871 this.credentialString(),
80872 hash(this.canonicalString(), 'hex'),
80873 ].join('\n')
80874}
80875
80876RequestSigner.prototype.canonicalString = function() {
80877 if (!this.parsedPath) this.prepareRequest()
80878
80879 var pathStr = this.parsedPath.path,
80880 query = this.parsedPath.query,
80881 headers = this.request.headers,
80882 queryStr = '',
80883 normalizePath = this.service !== 's3',
80884 decodePath = this.service === 's3' || this.request.doNotEncodePath,
80885 decodeSlashesInPath = this.service === 's3',
80886 firstValOnly = this.service === 's3',
80887 bodyHash
80888
80889 if (this.service === 's3' && this.request.signQuery) {
80890 bodyHash = 'UNSIGNED-PAYLOAD'
80891 } else if (this.isCodeCommitGit) {
80892 bodyHash = ''
80893 } else {
80894 bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] ||
80895 hash(this.request.body || '', 'hex')
80896 }
80897
80898 if (query) {
80899 queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) {
80900 if (!key) return obj
80901 obj[key] = !Array.isArray(query[key]) ? query[key] :
80902 (firstValOnly ? query[key][0] : query[key].slice().sort())
80903 return obj
80904 }, {})))
80905 }
80906 if (pathStr !== '/') {
80907 if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/')
80908 pathStr = pathStr.split('/').reduce(function(path, piece) {
80909 if (normalizePath && piece === '..') {
80910 path.pop()
80911 } else if (!normalizePath || piece !== '.') {
80912 if (decodePath) piece = decodeURIComponent(piece)
80913 path.push(encodeRfc3986(encodeURIComponent(piece)))
80914 }
80915 return path
80916 }, []).join('/')
80917 if (pathStr[0] !== '/') pathStr = '/' + pathStr
80918 if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/')
80919 }
80920
80921 return [
80922 this.request.method || 'GET',
80923 pathStr,
80924 queryStr,
80925 this.canonicalHeaders() + '\n',
80926 this.signedHeaders(),
80927 bodyHash,
80928 ].join('\n')
80929}
80930
80931RequestSigner.prototype.canonicalHeaders = function() {
80932 var headers = this.request.headers
80933 function trimAll(header) {
80934 return header.toString().trim().replace(/\s+/g, ' ')
80935 }
80936 return Object.keys(headers)
80937 .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 })
80938 .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) })
80939 .join('\n')
80940}
80941
80942RequestSigner.prototype.signedHeaders = function() {
80943 return Object.keys(this.request.headers)
80944 .map(function(key) { return key.toLowerCase() })
80945 .sort()
80946 .join(';')
80947}
80948
80949RequestSigner.prototype.credentialString = function() {
80950 return [
80951 this.getDate(),
80952 this.region,
80953 this.service,
80954 'aws4_request',
80955 ].join('/')
80956}
80957
80958RequestSigner.prototype.defaultCredentials = function() {
80959 var env = process.env
80960 return {
80961 accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY,
80962 secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY,
80963 sessionToken: env.AWS_SESSION_TOKEN,
80964 }
80965}
80966
80967RequestSigner.prototype.parsePath = function() {
80968 var path = this.request.path || '/',
80969 queryIx = path.indexOf('?'),
80970 query = null
80971
80972 if (queryIx >= 0) {
80973 query = querystring.parse(path.slice(queryIx + 1))
80974 path = path.slice(0, queryIx)
80975 }
80976
80977 // S3 doesn't always encode characters > 127 correctly and
80978 // all services don't encode characters > 255 correctly
80979 // So if there are non-reserved chars (and it's not already all % encoded), just encode them all
80980 if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) {
80981 path = path.split('/').map(function(piece) {
80982 return encodeURIComponent(decodeURIComponent(piece))
80983 }).join('/')
80984 }
80985
80986 this.parsedPath = {
80987 path: path,
80988 query: query,
80989 }
80990}
80991
80992RequestSigner.prototype.formatPath = function() {
80993 var path = this.parsedPath.path,
80994 query = this.parsedPath.query
80995
80996 if (!query) return path
80997
80998 // Services don't support empty query string keys
80999 if (query[''] != null) delete query['']
81000
81001 return path + '?' + encodeRfc3986(querystring.stringify(query))
81002}
81003
81004aws4.RequestSigner = RequestSigner
81005
81006aws4.sign = function(request, credentials) {
81007 return new RequestSigner(request, credentials).sign()
81008}
81009
81010
81011/***/ }),
81012/* 464 */
81013/***/ (function(module, exports) {
81014
81015module.exports = function(size) {
81016 return new LruCache(size)
81017}
81018
81019function LruCache(size) {
81020 this.capacity = size | 0
81021 this.map = Object.create(null)
81022 this.list = new DoublyLinkedList()
81023}
81024
81025LruCache.prototype.get = function(key) {
81026 var node = this.map[key]
81027 if (node == null) return undefined
81028 this.used(node)
81029 return node.val
81030}
81031
81032LruCache.prototype.set = function(key, val) {
81033 var node = this.map[key]
81034 if (node != null) {
81035 node.val = val
81036 } else {
81037 if (!this.capacity) this.prune()
81038 if (!this.capacity) return false
81039 node = new DoublyLinkedNode(key, val)
81040 this.map[key] = node
81041 this.capacity--
81042 }
81043 this.used(node)
81044 return true
81045}
81046
81047LruCache.prototype.used = function(node) {
81048 this.list.moveToFront(node)
81049}
81050
81051LruCache.prototype.prune = function() {
81052 var node = this.list.pop()
81053 if (node != null) {
81054 delete this.map[node.key]
81055 this.capacity++
81056 }
81057}
81058
81059
81060function DoublyLinkedList() {
81061 this.firstNode = null
81062 this.lastNode = null
81063}
81064
81065DoublyLinkedList.prototype.moveToFront = function(node) {
81066 if (this.firstNode == node) return
81067
81068 this.remove(node)
81069
81070 if (this.firstNode == null) {
81071 this.firstNode = node
81072 this.lastNode = node
81073 node.prev = null
81074 node.next = null
81075 } else {
81076 node.prev = null
81077 node.next = this.firstNode
81078 node.next.prev = node
81079 this.firstNode = node
81080 }
81081}
81082
81083DoublyLinkedList.prototype.pop = function() {
81084 var lastNode = this.lastNode
81085 if (lastNode != null) {
81086 this.remove(lastNode)
81087 }
81088 return lastNode
81089}
81090
81091DoublyLinkedList.prototype.remove = function(node) {
81092 if (this.firstNode == node) {
81093 this.firstNode = node.next
81094 } else if (node.prev != null) {
81095 node.prev.next = node.next
81096 }
81097 if (this.lastNode == node) {
81098 this.lastNode = node.prev
81099 } else if (node.next != null) {
81100 node.next.prev = node.prev
81101 }
81102}
81103
81104
81105function DoublyLinkedNode(key, val) {
81106 this.key = key
81107 this.val = val
81108 this.prev = null
81109 this.next = null
81110}
81111
81112
81113/***/ }),
81114/* 465 */
81115/***/ (function(module, exports, __webpack_require__) {
81116
81117"use strict";
81118
81119
81120var _classCallCheck2;
81121
81122function _load_classCallCheck() {
81123 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
81124}
81125
81126function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
81127
81128var _ = __webpack_require__(45);
81129
81130/**
81131 * Choice object
81132 * Normalize input as choice object
81133 * @constructor
81134 * @param {String|Object} val Choice value. If an object is passed, it should contains
81135 * at least one of `value` or `name` property
81136 */
81137
81138module.exports = function Choice(val, answers) {
81139 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Choice);
81140
81141 // Don't process Choice and Separator object
81142 if (val instanceof Choice || val.type === 'separator') {
81143 return val;
81144 }
81145
81146 if (_.isString(val)) {
81147 this.name = val;
81148 this.value = val;
81149 this.short = val;
81150 } else {
81151 _.extend(this, val, {
81152 name: val.name || val.value,
81153 value: 'value' in val ? val.value : val.name,
81154 short: val.short || val.name || val.value
81155 });
81156 }
81157
81158 if (_.isFunction(val.disabled)) {
81159 this.disabled = val.disabled(answers);
81160 } else {
81161 this.disabled = val.disabled;
81162 }
81163};
81164
81165/***/ }),
81166/* 466 */
81167/***/ (function(module, exports, __webpack_require__) {
81168
81169"use strict";
81170
81171
81172var _classCallCheck2;
81173
81174function _load_classCallCheck() {
81175 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
81176}
81177
81178function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
81179
81180var assert = __webpack_require__(50);
81181var _ = __webpack_require__(45);
81182var Separator = __webpack_require__(152);
81183var Choice = __webpack_require__(465);
81184
81185/**
81186 * Choices collection
81187 * Collection of multiple `choice` object
81188 * @constructor
81189 * @param {Array} choices All `choice` to keep in the collection
81190 */
81191
81192module.exports = function () {
81193 function Choices(choices, answers) {
81194 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Choices);
81195
81196 this.choices = choices.map(function (val) {
81197 if (val.type === 'separator') {
81198 if (!(val instanceof Separator)) {
81199 val = new Separator(val.line);
81200 }
81201 return val;
81202 }
81203 return new Choice(val, answers);
81204 });
81205
81206 this.realChoices = this.choices.filter(Separator.exclude).filter(function (item) {
81207 return !item.disabled;
81208 });
81209
81210 Object.defineProperty(this, 'length', {
81211 get() {
81212 return this.choices.length;
81213 },
81214 set(val) {
81215 this.choices.length = val;
81216 }
81217 });
81218
81219 Object.defineProperty(this, 'realLength', {
81220 get() {
81221 return this.realChoices.length;
81222 },
81223 set() {
81224 throw new Error('Cannot set `realLength` of a Choices collection');
81225 }
81226 });
81227 }
81228
81229 /**
81230 * Get a valid choice from the collection
81231 * @param {Number} selector The selected choice index
81232 * @return {Choice|Undefined} Return the matched choice or undefined
81233 */
81234
81235 Choices.prototype.getChoice = function getChoice(selector) {
81236 assert(_.isNumber(selector));
81237 return this.realChoices[selector];
81238 };
81239
81240 /**
81241 * Get a raw element from the collection
81242 * @param {Number} selector The selected index value
81243 * @return {Choice|Undefined} Return the matched choice or undefined
81244 */
81245
81246 Choices.prototype.get = function get(selector) {
81247 assert(_.isNumber(selector));
81248 return this.choices[selector];
81249 };
81250
81251 /**
81252 * Match the valid choices against a where clause
81253 * @param {Object} whereClause Lodash `where` clause
81254 * @return {Array} Matching choices or empty array
81255 */
81256
81257 Choices.prototype.where = function where(whereClause) {
81258 return _.filter(this.realChoices, whereClause);
81259 };
81260
81261 /**
81262 * Pluck a particular key from the choices
81263 * @param {String} propertyName Property name to select
81264 * @return {Array} Selected properties
81265 */
81266
81267 Choices.prototype.pluck = function pluck(propertyName) {
81268 return _.map(this.realChoices, propertyName);
81269 };
81270
81271 // Expose usual Array methods
81272
81273
81274 Choices.prototype.indexOf = function indexOf() {
81275 return this.choices.indexOf.apply(this.choices, arguments);
81276 };
81277
81278 Choices.prototype.forEach = function forEach() {
81279 return this.choices.forEach.apply(this.choices, arguments);
81280 };
81281
81282 Choices.prototype.filter = function filter() {
81283 return this.choices.filter.apply(this.choices, arguments);
81284 };
81285
81286 Choices.prototype.find = function find(func) {
81287 return _.find(this.choices, func);
81288 };
81289
81290 Choices.prototype.push = function push() {
81291 var objs = _.map(arguments, function (val) {
81292 return new Choice(val);
81293 });
81294 this.choices.push.apply(this.choices, objs);
81295 this.realChoices = this.choices.filter(Separator.exclude);
81296 return this.choices;
81297 };
81298
81299 return Choices;
81300}();
81301
81302/***/ }),
81303/* 467 */
81304/***/ (function(module, exports, __webpack_require__) {
81305
81306"use strict";
81307
81308/**
81309 * `list` type prompt
81310 */
81311
81312var _classCallCheck2;
81313
81314function _load_classCallCheck() {
81315 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
81316}
81317
81318var _possibleConstructorReturn2;
81319
81320function _load_possibleConstructorReturn() {
81321 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
81322}
81323
81324var _inherits2;
81325
81326function _load_inherits() {
81327 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
81328}
81329
81330function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
81331
81332var _ = __webpack_require__(45);
81333var chalk = __webpack_require__(37);
81334var cliCursor = __webpack_require__(319);
81335var figures = __webpack_require__(233);
81336
81337var _require = __webpack_require__(65),
81338 map = _require.map,
81339 takeUntil = _require.takeUntil;
81340
81341var Base = __webpack_require__(73);
81342var observe = __webpack_require__(74);
81343var Paginator = __webpack_require__(153);
81344
81345var CheckboxPrompt = function (_Base) {
81346 (0, (_inherits2 || _load_inherits()).default)(CheckboxPrompt, _Base);
81347
81348 function CheckboxPrompt(questions, rl, answers) {
81349 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, CheckboxPrompt);
81350
81351 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers));
81352
81353 if (!_this.opt.choices) {
81354 _this.throwParamError('choices');
81355 }
81356
81357 if (_.isArray(_this.opt.default)) {
81358 _this.opt.choices.forEach(function (choice) {
81359 if (this.opt.default.indexOf(choice.value) >= 0) {
81360 choice.checked = true;
81361 }
81362 }, _this);
81363 }
81364
81365 _this.pointer = 0;
81366 _this.firstRender = true;
81367
81368 // Make sure no default is set (so it won't be printed)
81369 _this.opt.default = null;
81370
81371 _this.paginator = new Paginator(_this.screen);
81372 return _this;
81373 }
81374
81375 /**
81376 * Start the Inquiry session
81377 * @param {Function} cb Callback when prompt is done
81378 * @return {this}
81379 */
81380
81381 CheckboxPrompt.prototype._run = function _run(cb) {
81382 this.done = cb;
81383
81384 var events = observe(this.rl);
81385
81386 var validation = this.handleSubmitEvents(events.line.pipe(map(this.getCurrentValue.bind(this))));
81387 validation.success.forEach(this.onEnd.bind(this));
81388 validation.error.forEach(this.onError.bind(this));
81389
81390 events.normalizedUpKey.pipe(takeUntil(validation.success)).forEach(this.onUpKey.bind(this));
81391 events.normalizedDownKey.pipe(takeUntil(validation.success)).forEach(this.onDownKey.bind(this));
81392 events.numberKey.pipe(takeUntil(validation.success)).forEach(this.onNumberKey.bind(this));
81393 events.spaceKey.pipe(takeUntil(validation.success)).forEach(this.onSpaceKey.bind(this));
81394 events.aKey.pipe(takeUntil(validation.success)).forEach(this.onAllKey.bind(this));
81395 events.iKey.pipe(takeUntil(validation.success)).forEach(this.onInverseKey.bind(this));
81396
81397 // Init the prompt
81398 cliCursor.hide();
81399 this.render();
81400 this.firstRender = false;
81401
81402 return this;
81403 };
81404
81405 /**
81406 * Render the prompt to screen
81407 * @return {CheckboxPrompt} self
81408 */
81409
81410 CheckboxPrompt.prototype.render = function render(error) {
81411 // Render question
81412 var message = this.getQuestion();
81413 var bottomContent = '';
81414
81415 if (this.firstRender) {
81416 message += '(Press ' + chalk.cyan.bold('<space>') + ' to select, ' + chalk.cyan.bold('<a>') + ' to toggle all, ' + chalk.cyan.bold('<i>') + ' to invert selection)';
81417 }
81418
81419 // Render choices or answer depending on the state
81420 if (this.status === 'answered') {
81421 message += chalk.cyan(this.selection.join(', '));
81422 } else {
81423 var choicesStr = renderChoices(this.opt.choices, this.pointer);
81424 var indexPosition = this.opt.choices.indexOf(this.opt.choices.getChoice(this.pointer));
81425 message += '\n' + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize);
81426 }
81427
81428 if (error) {
81429 bottomContent = chalk.red('>> ') + error;
81430 }
81431
81432 this.screen.render(message, bottomContent);
81433 };
81434
81435 /**
81436 * When user press `enter` key
81437 */
81438
81439 CheckboxPrompt.prototype.onEnd = function onEnd(state) {
81440 this.status = 'answered';
81441
81442 // Rerender prompt (and clean subline error)
81443 this.render();
81444
81445 this.screen.done();
81446 cliCursor.show();
81447 this.done(state.value);
81448 };
81449
81450 CheckboxPrompt.prototype.onError = function onError(state) {
81451 this.render(state.isValid);
81452 };
81453
81454 CheckboxPrompt.prototype.getCurrentValue = function getCurrentValue() {
81455 var choices = this.opt.choices.filter(function (choice) {
81456 return Boolean(choice.checked) && !choice.disabled;
81457 });
81458
81459 this.selection = _.map(choices, 'short');
81460 return _.map(choices, 'value');
81461 };
81462
81463 CheckboxPrompt.prototype.onUpKey = function onUpKey() {
81464 var len = this.opt.choices.realLength;
81465 this.pointer = this.pointer > 0 ? this.pointer - 1 : len - 1;
81466 this.render();
81467 };
81468
81469 CheckboxPrompt.prototype.onDownKey = function onDownKey() {
81470 var len = this.opt.choices.realLength;
81471 this.pointer = this.pointer < len - 1 ? this.pointer + 1 : 0;
81472 this.render();
81473 };
81474
81475 CheckboxPrompt.prototype.onNumberKey = function onNumberKey(input) {
81476 if (input <= this.opt.choices.realLength) {
81477 this.pointer = input - 1;
81478 this.toggleChoice(this.pointer);
81479 }
81480 this.render();
81481 };
81482
81483 CheckboxPrompt.prototype.onSpaceKey = function onSpaceKey() {
81484 this.toggleChoice(this.pointer);
81485 this.render();
81486 };
81487
81488 CheckboxPrompt.prototype.onAllKey = function onAllKey() {
81489 var shouldBeChecked = Boolean(this.opt.choices.find(function (choice) {
81490 return choice.type !== 'separator' && !choice.checked;
81491 }));
81492
81493 this.opt.choices.forEach(function (choice) {
81494 if (choice.type !== 'separator') {
81495 choice.checked = shouldBeChecked;
81496 }
81497 });
81498
81499 this.render();
81500 };
81501
81502 CheckboxPrompt.prototype.onInverseKey = function onInverseKey() {
81503 this.opt.choices.forEach(function (choice) {
81504 if (choice.type !== 'separator') {
81505 choice.checked = !choice.checked;
81506 }
81507 });
81508
81509 this.render();
81510 };
81511
81512 CheckboxPrompt.prototype.toggleChoice = function toggleChoice(index) {
81513 var item = this.opt.choices.getChoice(index);
81514 if (item !== undefined) {
81515 this.opt.choices.getChoice(index).checked = !item.checked;
81516 }
81517 };
81518
81519 return CheckboxPrompt;
81520}(Base);
81521
81522/**
81523 * Function for rendering checkbox choices
81524 * @param {Number} pointer Position of the pointer
81525 * @return {String} Rendered content
81526 */
81527
81528function renderChoices(choices, pointer) {
81529 var output = '';
81530 var separatorOffset = 0;
81531
81532 choices.forEach(function (choice, i) {
81533 if (choice.type === 'separator') {
81534 separatorOffset++;
81535 output += ' ' + choice + '\n';
81536 return;
81537 }
81538
81539 if (choice.disabled) {
81540 separatorOffset++;
81541 output += ' - ' + choice.name;
81542 output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')';
81543 } else {
81544 var line = getCheckbox(choice.checked) + ' ' + choice.name;
81545 if (i - separatorOffset === pointer) {
81546 output += chalk.cyan(figures.pointer + line);
81547 } else {
81548 output += ' ' + line;
81549 }
81550 }
81551
81552 output += '\n';
81553 });
81554
81555 return output.replace(/\n$/, '');
81556}
81557
81558/**
81559 * Get the checkbox
81560 * @param {Boolean} checked - add a X or not to the checkbox
81561 * @return {String} Composited checkbox string
81562 */
81563
81564function getCheckbox(checked) {
81565 return checked ? chalk.green(figures.radioOn) : figures.radioOff;
81566}
81567
81568module.exports = CheckboxPrompt;
81569
81570/***/ }),
81571/* 468 */
81572/***/ (function(module, exports, __webpack_require__) {
81573
81574"use strict";
81575
81576/**
81577 * `confirm` type prompt
81578 */
81579
81580var _classCallCheck2;
81581
81582function _load_classCallCheck() {
81583 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
81584}
81585
81586var _possibleConstructorReturn2;
81587
81588function _load_possibleConstructorReturn() {
81589 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
81590}
81591
81592var _inherits2;
81593
81594function _load_inherits() {
81595 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
81596}
81597
81598function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
81599
81600var _ = __webpack_require__(45);
81601var chalk = __webpack_require__(37);
81602
81603var _require = __webpack_require__(65),
81604 take = _require.take,
81605 takeUntil = _require.takeUntil;
81606
81607var Base = __webpack_require__(73);
81608var observe = __webpack_require__(74);
81609
81610var ConfirmPrompt = function (_Base) {
81611 (0, (_inherits2 || _load_inherits()).default)(ConfirmPrompt, _Base);
81612
81613 function ConfirmPrompt(questions, rl, answers) {
81614 var _ret;
81615
81616 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ConfirmPrompt);
81617
81618 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers));
81619
81620 var rawDefault = true;
81621
81622 _.extend(_this.opt, {
81623 filter: function filter(input) {
81624 var value = rawDefault;
81625 if (input != null && input !== '') {
81626 value = /^y(es)?/i.test(input);
81627 }
81628 return value;
81629 }
81630 });
81631
81632 if (_.isBoolean(_this.opt.default)) {
81633 rawDefault = _this.opt.default;
81634 }
81635
81636 _this.opt.default = rawDefault ? 'Y/n' : 'y/N';
81637
81638 return _ret = _this, (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(_this, _ret);
81639 }
81640
81641 /**
81642 * Start the Inquiry session
81643 * @param {Function} cb Callback when prompt is done
81644 * @return {this}
81645 */
81646
81647 ConfirmPrompt.prototype._run = function _run(cb) {
81648 this.done = cb;
81649
81650 // Once user confirm (enter key)
81651 var events = observe(this.rl);
81652 events.keypress.pipe(takeUntil(events.line)).forEach(this.onKeypress.bind(this));
81653
81654 events.line.pipe(take(1)).forEach(this.onEnd.bind(this));
81655
81656 // Init
81657 this.render();
81658
81659 return this;
81660 };
81661
81662 /**
81663 * Render the prompt to screen
81664 * @return {ConfirmPrompt} self
81665 */
81666
81667 ConfirmPrompt.prototype.render = function render(answer) {
81668 var message = this.getQuestion();
81669
81670 if (typeof answer === 'boolean') {
81671 message += chalk.cyan(answer ? 'Yes' : 'No');
81672 } else {
81673 message += this.rl.line;
81674 }
81675
81676 this.screen.render(message);
81677
81678 return this;
81679 };
81680
81681 /**
81682 * When user press `enter` key
81683 */
81684
81685 ConfirmPrompt.prototype.onEnd = function onEnd(input) {
81686 this.status = 'answered';
81687
81688 var output = this.opt.filter(input);
81689 this.render(output);
81690
81691 this.screen.done();
81692 this.done(output);
81693 };
81694
81695 /**
81696 * When user press a key
81697 */
81698
81699 ConfirmPrompt.prototype.onKeypress = function onKeypress() {
81700 this.render();
81701 };
81702
81703 return ConfirmPrompt;
81704}(Base);
81705
81706module.exports = ConfirmPrompt;
81707
81708/***/ }),
81709/* 469 */
81710/***/ (function(module, exports, __webpack_require__) {
81711
81712"use strict";
81713
81714/**
81715 * `editor` type prompt
81716 */
81717
81718var _classCallCheck2;
81719
81720function _load_classCallCheck() {
81721 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
81722}
81723
81724var _possibleConstructorReturn2;
81725
81726function _load_possibleConstructorReturn() {
81727 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
81728}
81729
81730var _inherits2;
81731
81732function _load_inherits() {
81733 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
81734}
81735
81736function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
81737
81738var chalk = __webpack_require__(37);
81739var editAsync = __webpack_require__(758).editAsync;
81740var Base = __webpack_require__(73);
81741var observe = __webpack_require__(74);
81742
81743var _require = __webpack_require__(173),
81744 Subject = _require.Subject;
81745
81746var EditorPrompt = function (_Base) {
81747 (0, (_inherits2 || _load_inherits()).default)(EditorPrompt, _Base);
81748
81749 function EditorPrompt() {
81750 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, EditorPrompt);
81751 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.apply(this, arguments));
81752 }
81753
81754 /**
81755 * Start the Inquiry session
81756 * @param {Function} cb Callback when prompt is done
81757 * @return {this}
81758 */
81759
81760 EditorPrompt.prototype._run = function _run(cb) {
81761 this.done = cb;
81762
81763 this.editorResult = new Subject();
81764
81765 // Open Editor on "line" (Enter Key)
81766 var events = observe(this.rl);
81767 this.lineSubscription = events.line.subscribe(this.startExternalEditor.bind(this));
81768
81769 // Trigger Validation when editor closes
81770 var validation = this.handleSubmitEvents(this.editorResult);
81771 validation.success.forEach(this.onEnd.bind(this));
81772 validation.error.forEach(this.onError.bind(this));
81773
81774 // Prevents default from being printed on screen (can look weird with multiple lines)
81775 this.currentText = this.opt.default;
81776 this.opt.default = null;
81777
81778 // Init
81779 this.render();
81780
81781 return this;
81782 };
81783
81784 /**
81785 * Render the prompt to screen
81786 * @return {EditorPrompt} self
81787 */
81788
81789 EditorPrompt.prototype.render = function render(error) {
81790 var bottomContent = '';
81791 var message = this.getQuestion();
81792
81793 if (this.status === 'answered') {
81794 message += chalk.dim('Received');
81795 } else {
81796 message += chalk.dim('Press <enter> to launch your preferred editor.');
81797 }
81798
81799 if (error) {
81800 bottomContent = chalk.red('>> ') + error;
81801 }
81802
81803 this.screen.render(message, bottomContent);
81804 };
81805
81806 /**
81807 * Launch $EDITOR on user press enter
81808 */
81809
81810 EditorPrompt.prototype.startExternalEditor = function startExternalEditor() {
81811 // Pause Readline to prevent stdin and stdout from being modified while the editor is showing
81812 this.rl.pause();
81813 editAsync(this.currentText, this.endExternalEditor.bind(this));
81814 };
81815
81816 EditorPrompt.prototype.endExternalEditor = function endExternalEditor(error, result) {
81817 this.rl.resume();
81818 if (error) {
81819 this.editorResult.error(error);
81820 } else {
81821 this.editorResult.next(result);
81822 }
81823 };
81824
81825 EditorPrompt.prototype.onEnd = function onEnd(state) {
81826 this.editorResult.unsubscribe();
81827 this.lineSubscription.unsubscribe();
81828 this.answer = state.value;
81829 this.status = 'answered';
81830 // Re-render prompt
81831 this.render();
81832 this.screen.done();
81833 this.done(this.answer);
81834 };
81835
81836 EditorPrompt.prototype.onError = function onError(state) {
81837 this.render(state.isValid);
81838 };
81839
81840 return EditorPrompt;
81841}(Base);
81842
81843module.exports = EditorPrompt;
81844
81845/***/ }),
81846/* 470 */
81847/***/ (function(module, exports, __webpack_require__) {
81848
81849"use strict";
81850
81851/**
81852 * `rawlist` type prompt
81853 */
81854
81855var _classCallCheck2;
81856
81857function _load_classCallCheck() {
81858 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
81859}
81860
81861var _possibleConstructorReturn2;
81862
81863function _load_possibleConstructorReturn() {
81864 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
81865}
81866
81867var _inherits2;
81868
81869function _load_inherits() {
81870 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
81871}
81872
81873function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
81874
81875var _ = __webpack_require__(45);
81876var chalk = __webpack_require__(37);
81877
81878var _require = __webpack_require__(65),
81879 map = _require.map,
81880 takeUntil = _require.takeUntil;
81881
81882var Base = __webpack_require__(73);
81883var Separator = __webpack_require__(152);
81884var observe = __webpack_require__(74);
81885var Paginator = __webpack_require__(153);
81886
81887var ExpandPrompt = function (_Base) {
81888 (0, (_inherits2 || _load_inherits()).default)(ExpandPrompt, _Base);
81889
81890 function ExpandPrompt(questions, rl, answers) {
81891 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ExpandPrompt);
81892
81893 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers));
81894
81895 if (!_this.opt.choices) {
81896 _this.throwParamError('choices');
81897 }
81898
81899 _this.validateChoices(_this.opt.choices);
81900
81901 // Add the default `help` (/expand) option
81902 _this.opt.choices.push({
81903 key: 'h',
81904 name: 'Help, list all options',
81905 value: 'help'
81906 });
81907
81908 _this.opt.validate = function (choice) {
81909 if (choice == null) {
81910 return 'Please enter a valid command';
81911 }
81912
81913 return choice !== 'help';
81914 };
81915
81916 // Setup the default string (capitalize the default key)
81917 _this.opt.default = _this.generateChoicesString(_this.opt.choices, _this.opt.default);
81918
81919 _this.paginator = new Paginator(_this.screen);
81920 return _this;
81921 }
81922
81923 /**
81924 * Start the Inquiry session
81925 * @param {Function} cb Callback when prompt is done
81926 * @return {this}
81927 */
81928
81929 ExpandPrompt.prototype._run = function _run(cb) {
81930 this.done = cb;
81931
81932 // Save user answer and update prompt to show selected option.
81933 var events = observe(this.rl);
81934 var validation = this.handleSubmitEvents(events.line.pipe(map(this.getCurrentValue.bind(this))));
81935 validation.success.forEach(this.onSubmit.bind(this));
81936 validation.error.forEach(this.onError.bind(this));
81937 this.keypressObs = events.keypress.pipe(takeUntil(validation.success)).forEach(this.onKeypress.bind(this));
81938
81939 // Init the prompt
81940 this.render();
81941
81942 return this;
81943 };
81944
81945 /**
81946 * Render the prompt to screen
81947 * @return {ExpandPrompt} self
81948 */
81949
81950 ExpandPrompt.prototype.render = function render(error, hint) {
81951 var message = this.getQuestion();
81952 var bottomContent = '';
81953
81954 if (this.status === 'answered') {
81955 message += chalk.cyan(this.answer);
81956 } else if (this.status === 'expanded') {
81957 var choicesStr = renderChoices(this.opt.choices, this.selectedKey);
81958 message += this.paginator.paginate(choicesStr, this.selectedKey, this.opt.pageSize);
81959 message += '\n Answer: ';
81960 }
81961
81962 message += this.rl.line;
81963
81964 if (error) {
81965 bottomContent = chalk.red('>> ') + error;
81966 }
81967
81968 if (hint) {
81969 bottomContent = chalk.cyan('>> ') + hint;
81970 }
81971
81972 this.screen.render(message, bottomContent);
81973 };
81974
81975 ExpandPrompt.prototype.getCurrentValue = function getCurrentValue(input) {
81976 if (!input) {
81977 input = this.rawDefault;
81978 }
81979 var selected = this.opt.choices.where({ key: input.toLowerCase().trim() })[0];
81980 if (!selected) {
81981 return null;
81982 }
81983
81984 return selected.value;
81985 };
81986
81987 /**
81988 * Generate the prompt choices string
81989 * @return {String} Choices string
81990 */
81991
81992 ExpandPrompt.prototype.getChoices = function getChoices() {
81993 var _this2 = this;
81994
81995 var output = '';
81996
81997 this.opt.choices.forEach(function (choice) {
81998 output += '\n ';
81999
82000 if (choice.type === 'separator') {
82001 output += ' ' + choice;
82002 return;
82003 }
82004
82005 var choiceStr = choice.key + ') ' + choice.name;
82006 if (_this2.selectedKey === choice.key) {
82007 choiceStr = chalk.cyan(choiceStr);
82008 }
82009 output += choiceStr;
82010 });
82011
82012 return output;
82013 };
82014
82015 ExpandPrompt.prototype.onError = function onError(state) {
82016 if (state.value === 'help') {
82017 this.selectedKey = '';
82018 this.status = 'expanded';
82019 this.render();
82020 return;
82021 }
82022 this.render(state.isValid);
82023 };
82024
82025 /**
82026 * When user press `enter` key
82027 */
82028
82029 ExpandPrompt.prototype.onSubmit = function onSubmit(state) {
82030 this.status = 'answered';
82031 var choice = this.opt.choices.where({ value: state.value })[0];
82032 this.answer = choice.short || choice.name;
82033
82034 // Re-render prompt
82035 this.render();
82036 this.screen.done();
82037 this.done(state.value);
82038 };
82039
82040 /**
82041 * When user press a key
82042 */
82043
82044 ExpandPrompt.prototype.onKeypress = function onKeypress() {
82045 this.selectedKey = this.rl.line.toLowerCase();
82046 var selected = this.opt.choices.where({ key: this.selectedKey })[0];
82047 if (this.status === 'expanded') {
82048 this.render();
82049 } else {
82050 this.render(null, selected ? selected.name : null);
82051 }
82052 };
82053
82054 /**
82055 * Validate the choices
82056 * @param {Array} choices
82057 */
82058
82059 ExpandPrompt.prototype.validateChoices = function validateChoices(choices) {
82060 var formatError;
82061 var errors = [];
82062 var keymap = {};
82063 choices.filter(Separator.exclude).forEach(function (choice) {
82064 if (!choice.key || choice.key.length !== 1) {
82065 formatError = true;
82066 }
82067 if (keymap[choice.key]) {
82068 errors.push(choice.key);
82069 }
82070 keymap[choice.key] = true;
82071 choice.key = String(choice.key).toLowerCase();
82072 });
82073
82074 if (formatError) {
82075 throw new Error('Format error: `key` param must be a single letter and is required.');
82076 }
82077 if (keymap.h) {
82078 throw new Error('Reserved key error: `key` param cannot be `h` - this value is reserved.');
82079 }
82080 if (errors.length) {
82081 throw new Error('Duplicate key error: `key` param must be unique. Duplicates: ' + _.uniq(errors).join(', '));
82082 }
82083 };
82084
82085 /**
82086 * Generate a string out of the choices keys
82087 * @param {Array} choices
82088 * @param {Number|String} default - the choice index or name to capitalize
82089 * @return {String} The rendered choices key string
82090 */
82091
82092
82093 ExpandPrompt.prototype.generateChoicesString = function generateChoicesString(choices, defaultChoice) {
82094 var defIndex = choices.realLength - 1;
82095 if (_.isNumber(defaultChoice) && this.opt.choices.getChoice(defaultChoice)) {
82096 defIndex = defaultChoice;
82097 } else if (_.isString(defaultChoice)) {
82098 var index = _.findIndex(choices.realChoices, function (_ref) {
82099 var value = _ref.value;
82100 return value === defaultChoice;
82101 });
82102 defIndex = index === -1 ? defIndex : index;
82103 }
82104 var defStr = this.opt.choices.pluck('key');
82105 this.rawDefault = defStr[defIndex];
82106 defStr[defIndex] = String(defStr[defIndex]).toUpperCase();
82107 return defStr.join('');
82108 };
82109
82110 return ExpandPrompt;
82111}(Base);
82112
82113/**
82114 * Function for rendering checkbox choices
82115 * @param {String} pointer Selected key
82116 * @return {String} Rendered content
82117 */
82118
82119function renderChoices(choices, pointer) {
82120 var output = '';
82121
82122 choices.forEach(function (choice) {
82123 output += '\n ';
82124
82125 if (choice.type === 'separator') {
82126 output += ' ' + choice;
82127 return;
82128 }
82129
82130 var choiceStr = choice.key + ') ' + choice.name;
82131 if (pointer === choice.key) {
82132 choiceStr = chalk.cyan(choiceStr);
82133 }
82134 output += choiceStr;
82135 });
82136
82137 return output;
82138}
82139
82140module.exports = ExpandPrompt;
82141
82142/***/ }),
82143/* 471 */
82144/***/ (function(module, exports, __webpack_require__) {
82145
82146"use strict";
82147
82148/**
82149 * `list` type prompt
82150 */
82151
82152var _classCallCheck2;
82153
82154function _load_classCallCheck() {
82155 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
82156}
82157
82158var _possibleConstructorReturn2;
82159
82160function _load_possibleConstructorReturn() {
82161 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
82162}
82163
82164var _inherits2;
82165
82166function _load_inherits() {
82167 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
82168}
82169
82170function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
82171
82172var _ = __webpack_require__(45);
82173var chalk = __webpack_require__(37);
82174var figures = __webpack_require__(233);
82175var cliCursor = __webpack_require__(319);
82176var runAsync = __webpack_require__(172);
82177
82178var _require = __webpack_require__(65),
82179 flatMap = _require.flatMap,
82180 map = _require.map,
82181 take = _require.take,
82182 takeUntil = _require.takeUntil;
82183
82184var Base = __webpack_require__(73);
82185var observe = __webpack_require__(74);
82186var Paginator = __webpack_require__(153);
82187
82188var ListPrompt = function (_Base) {
82189 (0, (_inherits2 || _load_inherits()).default)(ListPrompt, _Base);
82190
82191 function ListPrompt(questions, rl, answers) {
82192 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ListPrompt);
82193
82194 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers));
82195
82196 if (!_this.opt.choices) {
82197 _this.throwParamError('choices');
82198 }
82199
82200 _this.firstRender = true;
82201 _this.selected = 0;
82202
82203 var def = _this.opt.default;
82204
82205 // If def is a Number, then use as index. Otherwise, check for value.
82206 if (_.isNumber(def) && def >= 0 && def < _this.opt.choices.realLength) {
82207 _this.selected = def;
82208 } else if (!_.isNumber(def) && def != null) {
82209 var index = _.findIndex(_this.opt.choices.realChoices, function (_ref) {
82210 var value = _ref.value;
82211 return value === def;
82212 });
82213 _this.selected = Math.max(index, 0);
82214 }
82215
82216 // Make sure no default is set (so it won't be printed)
82217 _this.opt.default = null;
82218
82219 _this.paginator = new Paginator(_this.screen);
82220 return _this;
82221 }
82222
82223 /**
82224 * Start the Inquiry session
82225 * @param {Function} cb Callback when prompt is done
82226 * @return {this}
82227 */
82228
82229 ListPrompt.prototype._run = function _run(cb) {
82230 this.done = cb;
82231
82232 var self = this;
82233
82234 var events = observe(this.rl);
82235 events.normalizedUpKey.pipe(takeUntil(events.line)).forEach(this.onUpKey.bind(this));
82236 events.normalizedDownKey.pipe(takeUntil(events.line)).forEach(this.onDownKey.bind(this));
82237 events.numberKey.pipe(takeUntil(events.line)).forEach(this.onNumberKey.bind(this));
82238 events.line.pipe(take(1), map(this.getCurrentValue.bind(this)), flatMap(function (value) {
82239 return runAsync(self.opt.filter)(value).catch(function (err) {
82240 return err;
82241 });
82242 })).forEach(this.onSubmit.bind(this));
82243
82244 // Init the prompt
82245 cliCursor.hide();
82246 this.render();
82247
82248 return this;
82249 };
82250
82251 /**
82252 * Render the prompt to screen
82253 * @return {ListPrompt} self
82254 */
82255
82256 ListPrompt.prototype.render = function render() {
82257 // Render question
82258 var message = this.getQuestion();
82259
82260 if (this.firstRender) {
82261 message += chalk.dim('(Use arrow keys)');
82262 }
82263
82264 // Render choices or answer depending on the state
82265 if (this.status === 'answered') {
82266 message += chalk.cyan(this.opt.choices.getChoice(this.selected).short);
82267 } else {
82268 var choicesStr = listRender(this.opt.choices, this.selected);
82269 var indexPosition = this.opt.choices.indexOf(this.opt.choices.getChoice(this.selected));
82270 message += '\n' + this.paginator.paginate(choicesStr, indexPosition, this.opt.pageSize);
82271 }
82272
82273 this.firstRender = false;
82274
82275 this.screen.render(message);
82276 };
82277
82278 /**
82279 * When user press `enter` key
82280 */
82281
82282 ListPrompt.prototype.onSubmit = function onSubmit(value) {
82283 this.status = 'answered';
82284
82285 // Rerender prompt
82286 this.render();
82287
82288 this.screen.done();
82289 cliCursor.show();
82290 this.done(value);
82291 };
82292
82293 ListPrompt.prototype.getCurrentValue = function getCurrentValue() {
82294 return this.opt.choices.getChoice(this.selected).value;
82295 };
82296
82297 /**
82298 * When user press a key
82299 */
82300
82301
82302 ListPrompt.prototype.onUpKey = function onUpKey() {
82303 var len = this.opt.choices.realLength;
82304 this.selected = this.selected > 0 ? this.selected - 1 : len - 1;
82305 this.render();
82306 };
82307
82308 ListPrompt.prototype.onDownKey = function onDownKey() {
82309 var len = this.opt.choices.realLength;
82310 this.selected = this.selected < len - 1 ? this.selected + 1 : 0;
82311 this.render();
82312 };
82313
82314 ListPrompt.prototype.onNumberKey = function onNumberKey(input) {
82315 if (input <= this.opt.choices.realLength) {
82316 this.selected = input - 1;
82317 }
82318 this.render();
82319 };
82320
82321 return ListPrompt;
82322}(Base);
82323
82324/**
82325 * Function for rendering list choices
82326 * @param {Number} pointer Position of the pointer
82327 * @return {String} Rendered content
82328 */
82329
82330
82331function listRender(choices, pointer) {
82332 var output = '';
82333 var separatorOffset = 0;
82334
82335 choices.forEach(function (choice, i) {
82336 if (choice.type === 'separator') {
82337 separatorOffset++;
82338 output += ' ' + choice + '\n';
82339 return;
82340 }
82341
82342 if (choice.disabled) {
82343 separatorOffset++;
82344 output += ' - ' + choice.name;
82345 output += ' (' + (_.isString(choice.disabled) ? choice.disabled : 'Disabled') + ')';
82346 output += '\n';
82347 return;
82348 }
82349
82350 var isSelected = i - separatorOffset === pointer;
82351 var line = (isSelected ? figures.pointer + ' ' : ' ') + choice.name;
82352 if (isSelected) {
82353 line = chalk.cyan(line);
82354 }
82355 output += line + ' \n';
82356 });
82357
82358 return output.replace(/\n$/, '');
82359}
82360
82361module.exports = ListPrompt;
82362
82363/***/ }),
82364/* 472 */
82365/***/ (function(module, exports, __webpack_require__) {
82366
82367"use strict";
82368
82369/**
82370 * `input` type prompt
82371 */
82372
82373var _classCallCheck2;
82374
82375function _load_classCallCheck() {
82376 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
82377}
82378
82379var _possibleConstructorReturn2;
82380
82381function _load_possibleConstructorReturn() {
82382 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
82383}
82384
82385var _inherits2;
82386
82387function _load_inherits() {
82388 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
82389}
82390
82391function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
82392
82393var Input = __webpack_require__(285);
82394
82395/**
82396 * Extention of the Input prompt specifically for use with number inputs.
82397 */
82398
82399var NumberPrompt = function (_Input) {
82400 (0, (_inherits2 || _load_inherits()).default)(NumberPrompt, _Input);
82401
82402 function NumberPrompt() {
82403 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NumberPrompt);
82404 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Input.apply(this, arguments));
82405 }
82406
82407 NumberPrompt.prototype.filterInput = function filterInput(input) {
82408 if (input && typeof input === 'string') {
82409 input = input.trim();
82410 // Match a number in the input
82411 var numberMatch = input.match(/(^-?\d+|^\d+\.\d*|^\d*\.\d+)(e\d+)?$/);
82412 // If a number is found, return that input.
82413 if (numberMatch) {
82414 return Number(numberMatch[0]);
82415 }
82416 }
82417 // If the input was invalid return the default value.
82418 return this.opt.default == null ? NaN : this.opt.default;
82419 };
82420
82421 return NumberPrompt;
82422}(Input);
82423
82424module.exports = NumberPrompt;
82425
82426/***/ }),
82427/* 473 */
82428/***/ (function(module, exports, __webpack_require__) {
82429
82430"use strict";
82431
82432/**
82433 * `password` type prompt
82434 */
82435
82436var _classCallCheck2;
82437
82438function _load_classCallCheck() {
82439 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
82440}
82441
82442var _possibleConstructorReturn2;
82443
82444function _load_possibleConstructorReturn() {
82445 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
82446}
82447
82448var _inherits2;
82449
82450function _load_inherits() {
82451 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
82452}
82453
82454function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
82455
82456var chalk = __webpack_require__(37);
82457
82458var _require = __webpack_require__(65),
82459 map = _require.map,
82460 takeUntil = _require.takeUntil;
82461
82462var Base = __webpack_require__(73);
82463var observe = __webpack_require__(74);
82464
82465function mask(input, maskChar) {
82466 input = String(input);
82467 maskChar = typeof maskChar === 'string' ? maskChar : '*';
82468 if (input.length === 0) {
82469 return '';
82470 }
82471
82472 return new Array(input.length + 1).join(maskChar);
82473}
82474
82475var PasswordPrompt = function (_Base) {
82476 (0, (_inherits2 || _load_inherits()).default)(PasswordPrompt, _Base);
82477
82478 function PasswordPrompt() {
82479 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PasswordPrompt);
82480 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.apply(this, arguments));
82481 }
82482
82483 /**
82484 * Start the Inquiry session
82485 * @param {Function} cb Callback when prompt is done
82486 * @return {this}
82487 */
82488
82489 PasswordPrompt.prototype._run = function _run(cb) {
82490 this.done = cb;
82491
82492 var events = observe(this.rl);
82493
82494 // Once user confirm (enter key)
82495 var submit = events.line.pipe(map(this.filterInput.bind(this)));
82496
82497 var validation = this.handleSubmitEvents(submit);
82498 validation.success.forEach(this.onEnd.bind(this));
82499 validation.error.forEach(this.onError.bind(this));
82500
82501 if (this.opt.mask) {
82502 events.keypress.pipe(takeUntil(validation.success)).forEach(this.onKeypress.bind(this));
82503 }
82504
82505 // Init
82506 this.render();
82507
82508 return this;
82509 };
82510
82511 /**
82512 * Render the prompt to screen
82513 * @return {PasswordPrompt} self
82514 */
82515
82516 PasswordPrompt.prototype.render = function render(error) {
82517 var message = this.getQuestion();
82518 var bottomContent = '';
82519
82520 if (this.status === 'answered') {
82521 message += this.opt.mask ? chalk.cyan(mask(this.answer, this.opt.mask)) : chalk.italic.dim('[hidden]');
82522 } else if (this.opt.mask) {
82523 message += mask(this.rl.line || '', this.opt.mask);
82524 } else {
82525 message += chalk.italic.dim('[input is hidden] ');
82526 }
82527
82528 if (error) {
82529 bottomContent = '\n' + chalk.red('>> ') + error;
82530 }
82531
82532 this.screen.render(message, bottomContent);
82533 };
82534
82535 /**
82536 * When user press `enter` key
82537 */
82538
82539 PasswordPrompt.prototype.filterInput = function filterInput(input) {
82540 if (!input) {
82541 return this.opt.default == null ? '' : this.opt.default;
82542 }
82543 return input;
82544 };
82545
82546 PasswordPrompt.prototype.onEnd = function onEnd(state) {
82547 this.status = 'answered';
82548 this.answer = state.value;
82549
82550 // Re-render prompt
82551 this.render();
82552
82553 this.screen.done();
82554 this.done(state.value);
82555 };
82556
82557 PasswordPrompt.prototype.onError = function onError(state) {
82558 this.render(state.isValid);
82559 };
82560
82561 PasswordPrompt.prototype.onKeypress = function onKeypress() {
82562 this.render();
82563 };
82564
82565 return PasswordPrompt;
82566}(Base);
82567
82568module.exports = PasswordPrompt;
82569
82570/***/ }),
82571/* 474 */
82572/***/ (function(module, exports, __webpack_require__) {
82573
82574"use strict";
82575
82576/**
82577 * `rawlist` type prompt
82578 */
82579
82580var _classCallCheck2;
82581
82582function _load_classCallCheck() {
82583 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
82584}
82585
82586var _possibleConstructorReturn2;
82587
82588function _load_possibleConstructorReturn() {
82589 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
82590}
82591
82592var _inherits2;
82593
82594function _load_inherits() {
82595 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
82596}
82597
82598function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
82599
82600var _ = __webpack_require__(45);
82601var chalk = __webpack_require__(37);
82602
82603var _require = __webpack_require__(65),
82604 map = _require.map,
82605 takeUntil = _require.takeUntil;
82606
82607var Base = __webpack_require__(73);
82608var Separator = __webpack_require__(152);
82609var observe = __webpack_require__(74);
82610var Paginator = __webpack_require__(153);
82611
82612var RawListPrompt = function (_Base) {
82613 (0, (_inherits2 || _load_inherits()).default)(RawListPrompt, _Base);
82614
82615 function RawListPrompt(questions, rl, answers) {
82616 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, RawListPrompt);
82617
82618 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, questions, rl, answers));
82619
82620 if (!_this.opt.choices) {
82621 _this.throwParamError('choices');
82622 }
82623
82624 _this.opt.validChoices = _this.opt.choices.filter(Separator.exclude);
82625
82626 _this.selected = 0;
82627 _this.rawDefault = 0;
82628
82629 _.extend(_this.opt, {
82630 validate: function validate(val) {
82631 return val != null;
82632 }
82633 });
82634
82635 var def = _this.opt.default;
82636 if (_.isNumber(def) && def >= 0 && def < _this.opt.choices.realLength) {
82637 _this.selected = def;
82638 _this.rawDefault = def;
82639 } else if (!_.isNumber(def) && def != null) {
82640 var index = _.findIndex(_this.opt.choices.realChoices, function (_ref) {
82641 var value = _ref.value;
82642 return value === def;
82643 });
82644 var safeIndex = Math.max(index, 0);
82645 _this.selected = safeIndex;
82646 _this.rawDefault = safeIndex;
82647 }
82648
82649 // Make sure no default is set (so it won't be printed)
82650 _this.opt.default = null;
82651
82652 _this.paginator = new Paginator();
82653 return _this;
82654 }
82655
82656 /**
82657 * Start the Inquiry session
82658 * @param {Function} cb Callback when prompt is done
82659 * @return {this}
82660 */
82661
82662 RawListPrompt.prototype._run = function _run(cb) {
82663 this.done = cb;
82664
82665 // Once user confirm (enter key)
82666 var events = observe(this.rl);
82667 var submit = events.line.pipe(map(this.getCurrentValue.bind(this)));
82668
82669 var validation = this.handleSubmitEvents(submit);
82670 validation.success.forEach(this.onEnd.bind(this));
82671 validation.error.forEach(this.onError.bind(this));
82672
82673 events.keypress.pipe(takeUntil(validation.success)).forEach(this.onKeypress.bind(this));
82674
82675 // Init the prompt
82676 this.render();
82677
82678 return this;
82679 };
82680
82681 /**
82682 * Render the prompt to screen
82683 * @return {RawListPrompt} self
82684 */
82685
82686 RawListPrompt.prototype.render = function render(error) {
82687 // Render question
82688 var message = this.getQuestion();
82689 var bottomContent = '';
82690
82691 if (this.status === 'answered') {
82692 message += chalk.cyan(this.answer);
82693 } else {
82694 var choicesStr = renderChoices(this.opt.choices, this.selected);
82695 message += this.paginator.paginate(choicesStr, this.selected, this.opt.pageSize);
82696 message += '\n Answer: ';
82697 }
82698
82699 message += this.rl.line;
82700
82701 if (error) {
82702 bottomContent = '\n' + chalk.red('>> ') + error;
82703 }
82704
82705 this.screen.render(message, bottomContent);
82706 };
82707
82708 /**
82709 * When user press `enter` key
82710 */
82711
82712 RawListPrompt.prototype.getCurrentValue = function getCurrentValue(index) {
82713 if (index == null || index === '') {
82714 index = this.rawDefault;
82715 } else {
82716 index -= 1;
82717 }
82718
82719 var choice = this.opt.choices.getChoice(index);
82720 return choice ? choice.value : null;
82721 };
82722
82723 RawListPrompt.prototype.onEnd = function onEnd(state) {
82724 this.status = 'answered';
82725 this.answer = state.value;
82726
82727 // Re-render prompt
82728 this.render();
82729
82730 this.screen.done();
82731 this.done(state.value);
82732 };
82733
82734 RawListPrompt.prototype.onError = function onError() {
82735 this.render('Please enter a valid index');
82736 };
82737
82738 /**
82739 * When user press a key
82740 */
82741
82742 RawListPrompt.prototype.onKeypress = function onKeypress() {
82743 var index = this.rl.line.length ? Number(this.rl.line) - 1 : 0;
82744
82745 if (this.opt.choices.getChoice(index)) {
82746 this.selected = index;
82747 } else {
82748 this.selected = undefined;
82749 }
82750
82751 this.render();
82752 };
82753
82754 return RawListPrompt;
82755}(Base);
82756
82757/**
82758 * Function for rendering list choices
82759 * @param {Number} pointer Position of the pointer
82760 * @return {String} Rendered content
82761 */
82762
82763function renderChoices(choices, pointer) {
82764 var output = '';
82765 var separatorOffset = 0;
82766
82767 choices.forEach(function (choice, i) {
82768 output += '\n ';
82769
82770 if (choice.type === 'separator') {
82771 separatorOffset++;
82772 output += ' ' + choice;
82773 return;
82774 }
82775
82776 var index = i - separatorOffset;
82777 var display = index + 1 + ') ' + choice.name;
82778 if (index === pointer) {
82779 display = chalk.cyan(display);
82780 }
82781 output += display;
82782 });
82783
82784 return output;
82785}
82786
82787module.exports = RawListPrompt;
82788
82789/***/ }),
82790/* 475 */
82791/***/ (function(module, exports, __webpack_require__) {
82792
82793"use strict";
82794
82795/**
82796 * Sticky bottom bar user interface
82797 */
82798
82799var _classCallCheck2;
82800
82801function _load_classCallCheck() {
82802 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
82803}
82804
82805var _possibleConstructorReturn2;
82806
82807function _load_possibleConstructorReturn() {
82808 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
82809}
82810
82811var _inherits2;
82812
82813function _load_inherits() {
82814 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
82815}
82816
82817function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
82818
82819var through = __webpack_require__(1026);
82820var Base = __webpack_require__(286);
82821var rlUtils = __webpack_require__(287);
82822var _ = __webpack_require__(45);
82823
82824var BottomBar = function (_Base) {
82825 (0, (_inherits2 || _load_inherits()).default)(BottomBar, _Base);
82826
82827 function BottomBar(opt) {
82828 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BottomBar);
82829
82830 opt = opt || {};
82831
82832 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, opt));
82833
82834 _this.log = through(_this.writeLog.bind(_this));
82835 _this.bottomBar = opt.bottomBar || '';
82836 _this.render();
82837 return _this;
82838 }
82839
82840 /**
82841 * Render the prompt to screen
82842 * @return {BottomBar} self
82843 */
82844
82845 BottomBar.prototype.render = function render() {
82846 this.write(this.bottomBar);
82847 return this;
82848 };
82849
82850 BottomBar.prototype.clean = function clean() {
82851 rlUtils.clearLine(this.rl, this.bottomBar.split('\n').length);
82852 return this;
82853 };
82854
82855 /**
82856 * Update the bottom bar content and rerender
82857 * @param {String} bottomBar Bottom bar content
82858 * @return {BottomBar} self
82859 */
82860
82861 BottomBar.prototype.updateBottomBar = function updateBottomBar(bottomBar) {
82862 rlUtils.clearLine(this.rl, 1);
82863 this.rl.output.unmute();
82864 this.clean();
82865 this.bottomBar = bottomBar;
82866 this.render();
82867 this.rl.output.mute();
82868 return this;
82869 };
82870
82871 /**
82872 * Write out log data
82873 * @param {String} data - The log data to be output
82874 * @return {BottomBar} self
82875 */
82876
82877 BottomBar.prototype.writeLog = function writeLog(data) {
82878 this.rl.output.unmute();
82879 this.clean();
82880 this.rl.output.write(this.enforceLF(data.toString()));
82881 this.render();
82882 this.rl.output.mute();
82883 return this;
82884 };
82885
82886 /**
82887 * Make sure line end on a line feed
82888 * @param {String} str Input string
82889 * @return {String} The input string with a final line feed
82890 */
82891
82892 BottomBar.prototype.enforceLF = function enforceLF(str) {
82893 return str.match(/[\r\n]$/) ? str : str + '\n';
82894 };
82895
82896 /**
82897 * Helper for writing message in Prompt
82898 * @param {BottomBar} prompt - The Prompt object that extends tty
82899 * @param {String} message - The message to be output
82900 */
82901
82902
82903 BottomBar.prototype.write = function write(message) {
82904 var msgLines = message.split(/\n/);
82905 this.height = msgLines.length;
82906
82907 // Write message to screen and setPrompt to control backspace
82908 this.rl.setPrompt(_.last(msgLines));
82909
82910 if (this.rl.output.rows === 0 && this.rl.output.columns === 0) {
82911 /* When it's a tty through serial port there's no terminal info and the render will malfunction,
82912 so we need enforce the cursor to locate to the leftmost position for rendering. */
82913 rlUtils.left(this.rl, message.length + this.rl.line.length);
82914 }
82915 this.rl.output.write(message);
82916 };
82917
82918 return BottomBar;
82919}(Base);
82920
82921module.exports = BottomBar;
82922
82923/***/ }),
82924/* 476 */
82925/***/ (function(module, exports, __webpack_require__) {
82926
82927"use strict";
82928
82929
82930var _promise;
82931
82932function _load_promise() {
82933 return _promise = _interopRequireDefault(__webpack_require__(7));
82934}
82935
82936var _classCallCheck2;
82937
82938function _load_classCallCheck() {
82939 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
82940}
82941
82942var _possibleConstructorReturn2;
82943
82944function _load_possibleConstructorReturn() {
82945 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
82946}
82947
82948var _inherits2;
82949
82950function _load_inherits() {
82951 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
82952}
82953
82954function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
82955
82956var _ = __webpack_require__(45);
82957
82958var _require = __webpack_require__(173),
82959 defer = _require.defer,
82960 empty = _require.empty,
82961 from = _require.from,
82962 of = _require.of;
82963
82964var _require2 = __webpack_require__(65),
82965 concatMap = _require2.concatMap,
82966 filter = _require2.filter,
82967 publish = _require2.publish,
82968 reduce = _require2.reduce;
82969
82970var runAsync = __webpack_require__(172);
82971var utils = __webpack_require__(478);
82972var Base = __webpack_require__(286);
82973
82974/**
82975 * Base interface class other can inherits from
82976 */
82977
82978var PromptUI = function (_Base) {
82979 (0, (_inherits2 || _load_inherits()).default)(PromptUI, _Base);
82980
82981 function PromptUI(prompts, opt) {
82982 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PromptUI);
82983
82984 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Base.call(this, opt));
82985
82986 _this.prompts = prompts;
82987 return _this;
82988 }
82989
82990 PromptUI.prototype.run = function run(questions) {
82991 var _this2 = this;
82992
82993 // Keep global reference to the answers
82994 this.answers = {};
82995
82996 // Make sure questions is an array.
82997 if (_.isPlainObject(questions)) {
82998 questions = [questions];
82999 }
83000
83001 // Create an observable, unless we received one as parameter.
83002 // Note: As this is a public interface, we cannot do an instanceof check as we won't
83003 // be using the exact same object in memory.
83004 var obs = _.isArray(questions) ? from(questions) : questions;
83005
83006 this.process = obs.pipe(concatMap(this.processQuestion.bind(this)), publish() // Creates a hot Observable. It prevents duplicating prompts.
83007 );
83008
83009 this.process.connect();
83010
83011 return this.process.pipe(reduce(function (answers, answer) {
83012 _.set(_this2.answers, answer.name, answer.answer);
83013 return _this2.answers;
83014 }, {})).toPromise((_promise || _load_promise()).default).then(this.onCompletion.bind(this));
83015 };
83016
83017 /**
83018 * Once all prompt are over
83019 */
83020
83021 PromptUI.prototype.onCompletion = function onCompletion() {
83022 this.close();
83023
83024 return this.answers;
83025 };
83026
83027 PromptUI.prototype.processQuestion = function processQuestion(question) {
83028 var _this3 = this;
83029
83030 question = _.clone(question);
83031 return defer(function () {
83032 var obs = of(question);
83033
83034 return obs.pipe(concatMap(_this3.setDefaultType.bind(_this3)), concatMap(_this3.filterIfRunnable.bind(_this3)), concatMap(function () {
83035 return utils.fetchAsyncQuestionProperty(question, 'message', _this3.answers);
83036 }), concatMap(function () {
83037 return utils.fetchAsyncQuestionProperty(question, 'default', _this3.answers);
83038 }), concatMap(function () {
83039 return utils.fetchAsyncQuestionProperty(question, 'choices', _this3.answers);
83040 }), concatMap(_this3.fetchAnswer.bind(_this3)));
83041 });
83042 };
83043
83044 PromptUI.prototype.fetchAnswer = function fetchAnswer(question) {
83045 var _this4 = this;
83046
83047 var Prompt = this.prompts[question.type];
83048 this.activePrompt = new Prompt(question, this.rl, this.answers);
83049 return defer(function () {
83050 return from(_this4.activePrompt.run().then(function (answer) {
83051 return { name: question.name, answer: answer };
83052 }));
83053 });
83054 };
83055
83056 PromptUI.prototype.setDefaultType = function setDefaultType(question) {
83057 // Default type to input
83058 if (!this.prompts[question.type]) {
83059 question.type = 'input';
83060 }
83061 return defer(function () {
83062 return of(question);
83063 });
83064 };
83065
83066 PromptUI.prototype.filterIfRunnable = function filterIfRunnable(question) {
83067 if (question.when === false) {
83068 return empty();
83069 }
83070
83071 if (!_.isFunction(question.when)) {
83072 return of(question);
83073 }
83074
83075 var answers = this.answers;
83076 return defer(function () {
83077 return from(runAsync(question.when)(answers).then(function (shouldRun) {
83078 if (shouldRun) {
83079 return question;
83080 }
83081 })).pipe(filter(function (val) {
83082 return val != null;
83083 }));
83084 });
83085 };
83086
83087 return PromptUI;
83088}(Base);
83089
83090module.exports = PromptUI;
83091
83092/***/ }),
83093/* 477 */
83094/***/ (function(module, exports, __webpack_require__) {
83095
83096"use strict";
83097
83098
83099var _classCallCheck2;
83100
83101function _load_classCallCheck() {
83102 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
83103}
83104
83105function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
83106
83107var _ = __webpack_require__(45);
83108var util = __webpack_require__(287);
83109var cliWidth = __webpack_require__(572);
83110var stripAnsi = __webpack_require__(269);
83111var stringWidth = __webpack_require__(777);
83112
83113function height(content) {
83114 return content.split('\n').length;
83115}
83116
83117function lastLine(content) {
83118 return _.last(content.split('\n'));
83119}
83120
83121var ScreenManager = function () {
83122 function ScreenManager(rl) {
83123 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ScreenManager);
83124
83125 // These variables are keeping information to allow correct prompt re-rendering
83126 this.height = 0;
83127 this.extraLinesUnderPrompt = 0;
83128
83129 this.rl = rl;
83130 }
83131
83132 ScreenManager.prototype.render = function render(content, bottomContent) {
83133 this.rl.output.unmute();
83134 this.clean(this.extraLinesUnderPrompt);
83135
83136 /**
83137 * Write message to screen and setPrompt to control backspace
83138 */
83139
83140 var promptLine = lastLine(content);
83141 var rawPromptLine = stripAnsi(promptLine);
83142
83143 // Remove the rl.line from our prompt. We can't rely on the content of
83144 // rl.line (mainly because of the password prompt), so just rely on it's
83145 // length.
83146 var prompt = rawPromptLine;
83147 if (this.rl.line.length) {
83148 prompt = prompt.slice(0, -this.rl.line.length);
83149 }
83150 this.rl.setPrompt(prompt);
83151
83152 // SetPrompt will change cursor position, now we can get correct value
83153 var cursorPos = this.rl._getCursorPos();
83154 var width = this.normalizedCliWidth();
83155
83156 content = this.forceLineReturn(content, width);
83157 if (bottomContent) {
83158 bottomContent = this.forceLineReturn(bottomContent, width);
83159 }
83160 // Manually insert an extra line if we're at the end of the line.
83161 // This prevent the cursor from appearing at the beginning of the
83162 // current line.
83163 if (rawPromptLine.length % width === 0) {
83164 content += '\n';
83165 }
83166 var fullContent = content + (bottomContent ? '\n' + bottomContent : '');
83167 this.rl.output.write(fullContent);
83168
83169 /**
83170 * Re-adjust the cursor at the correct position.
83171 */
83172
83173 // We need to consider parts of the prompt under the cursor as part of the bottom
83174 // content in order to correctly cleanup and re-render.
83175 var promptLineUpDiff = Math.floor(rawPromptLine.length / width) - cursorPos.rows;
83176 var bottomContentHeight = promptLineUpDiff + (bottomContent ? height(bottomContent) : 0);
83177 if (bottomContentHeight > 0) {
83178 util.up(this.rl, bottomContentHeight);
83179 }
83180
83181 // Reset cursor at the beginning of the line
83182 util.left(this.rl, stringWidth(lastLine(fullContent)));
83183
83184 // Adjust cursor on the right
83185 if (cursorPos.cols > 0) {
83186 util.right(this.rl, cursorPos.cols);
83187 }
83188
83189 /**
83190 * Set up state for next re-rendering
83191 */
83192 this.extraLinesUnderPrompt = bottomContentHeight;
83193 this.height = height(fullContent);
83194
83195 this.rl.output.mute();
83196 };
83197
83198 ScreenManager.prototype.clean = function clean(extraLines) {
83199 if (extraLines > 0) {
83200 util.down(this.rl, extraLines);
83201 }
83202 util.clearLine(this.rl, this.height);
83203 };
83204
83205 ScreenManager.prototype.done = function done() {
83206 this.rl.setPrompt('');
83207 this.rl.output.unmute();
83208 this.rl.output.write('\n');
83209 };
83210
83211 ScreenManager.prototype.releaseCursor = function releaseCursor() {
83212 if (this.extraLinesUnderPrompt > 0) {
83213 util.down(this.rl, this.extraLinesUnderPrompt);
83214 }
83215 };
83216
83217 ScreenManager.prototype.normalizedCliWidth = function normalizedCliWidth() {
83218 var width = cliWidth({
83219 defaultWidth: 80,
83220 output: this.rl.output
83221 });
83222 return width;
83223 };
83224
83225 ScreenManager.prototype.breakLines = function breakLines(lines, width) {
83226 // Break lines who're longer than the cli width so we can normalize the natural line
83227 // returns behavior across terminals.
83228 width = width || this.normalizedCliWidth();
83229 var regex = new RegExp('(?:(?:\\033[[0-9;]*m)*.?){1,' + width + '}', 'g');
83230 return lines.map(function (line) {
83231 var chunk = line.match(regex);
83232 // Last match is always empty
83233 chunk.pop();
83234 return chunk || '';
83235 });
83236 };
83237
83238 ScreenManager.prototype.forceLineReturn = function forceLineReturn(content, width) {
83239 width = width || this.normalizedCliWidth();
83240 return _.flatten(this.breakLines(content.split('\n'), width)).join('\n');
83241 };
83242
83243 return ScreenManager;
83244}();
83245
83246module.exports = ScreenManager;
83247
83248/***/ }),
83249/* 478 */
83250/***/ (function(module, exports, __webpack_require__) {
83251
83252"use strict";
83253
83254
83255var _ = __webpack_require__(45);
83256
83257var _require = __webpack_require__(173),
83258 from = _require.from,
83259 of = _require.of;
83260
83261var runAsync = __webpack_require__(172);
83262
83263/**
83264 * Resolve a question property value if it is passed as a function.
83265 * This method will overwrite the property on the question object with the received value.
83266 * @param {Object} question - Question object
83267 * @param {String} prop - Property to fetch name
83268 * @param {Object} answers - Answers object
83269 * @return {Rx.Observable} - Observable emitting once value is known
83270 */
83271
83272exports.fetchAsyncQuestionProperty = function (question, prop, answers) {
83273 if (!_.isFunction(question[prop])) {
83274 return of(question);
83275 }
83276
83277 return from(runAsync(question[prop])(answers).then(function (value) {
83278 question[prop] = value;
83279 return question;
83280 }));
83281};
83282
83283/***/ }),
83284/* 479 */
83285/***/ (function(module, exports, __webpack_require__) {
83286
83287"use strict";
83288
83289
83290Object.defineProperty(exports, "__esModule", {
83291 value: true
83292});
83293
83294exports.default = function (message) {
83295 return {
83296 useless: true,
83297 run() {
83298 throw new (_errors || _load_errors()).MessageError(message);
83299 },
83300 setFlags: function setFlags() {},
83301 hasWrapper: function hasWrapper() {
83302 return true;
83303 }
83304 };
83305};
83306
83307var _errors;
83308
83309function _load_errors() {
83310 return _errors = __webpack_require__(6);
83311}
83312
83313/***/ }),
83314/* 480 */
83315/***/ (function(module, exports, __webpack_require__) {
83316
83317"use strict";
83318
83319
83320Object.defineProperty(exports, "__esModule", {
83321 value: true
83322});
83323exports.examples = exports.hasWrapper = exports.run = undefined;
83324
83325var _promise;
83326
83327function _load_promise() {
83328 return _promise = _interopRequireDefault(__webpack_require__(7));
83329}
83330
83331exports.setFlags = setFlags;
83332
83333var _buildSubCommands2;
83334
83335function _load_buildSubCommands() {
83336 return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
83337}
83338
83339function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
83340
83341var notYetImplemented = function notYetImplemented() {
83342 return (_promise || _load_promise()).default.reject(new Error('This command is not implemented yet.'));
83343};
83344
83345function setFlags(commander) {
83346 commander.description('Has not been implemented yet');
83347}
83348
83349var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('access', {
83350 public: notYetImplemented,
83351 restricted: notYetImplemented,
83352 grant: notYetImplemented,
83353 revoke: notYetImplemented,
83354 lsPackages: notYetImplemented,
83355 lsCollaborators: notYetImplemented,
83356 edit: notYetImplemented
83357}, ['WARNING: This command yet to be implemented.', 'public [<package>]', 'restricted [<package>]', 'grant <read-only|read-write> <scope:team> [<package>]', 'revoke <scope:team> [<package>]', 'ls-packages [<user>|<scope>|<scope:team>]', 'ls-collaborators [<package> [<user>]]', 'edit [<package>]']),
83358 run = _buildSubCommands.run,
83359 hasWrapper = _buildSubCommands.hasWrapper,
83360 examples = _buildSubCommands.examples;
83361
83362exports.run = run;
83363exports.hasWrapper = hasWrapper;
83364exports.examples = examples;
83365
83366/***/ }),
83367/* 481 */
83368/***/ (function(module, exports, __webpack_require__) {
83369
83370"use strict";
83371
83372
83373Object.defineProperty(exports, "__esModule", {
83374 value: true
83375});
83376exports.run = undefined;
83377
83378var _asyncToGenerator2;
83379
83380function _load_asyncToGenerator() {
83381 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
83382}
83383
83384var run = exports.run = function () {
83385 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
83386 var binFolder = path.join(config.cwd, config.registryFolders[0], '.bin');
83387 if (args.length === 0) {
83388 reporter.log(binFolder, { force: true });
83389 } else {
83390 var binEntries = yield (0, (_run || _load_run()).getBinEntries)(config);
83391
83392 var binName = args[0];
83393 var binPath = binEntries.get(binName);
83394
83395 if (binPath) {
83396 reporter.log(binPath, { force: true });
83397 } else {
83398 reporter.error(reporter.lang('packageBinaryNotFound', binName));
83399 }
83400 }
83401 });
83402
83403 return function run(_x, _x2, _x3, _x4) {
83404 return _ref.apply(this, arguments);
83405 };
83406}();
83407
83408exports.hasWrapper = hasWrapper;
83409exports.setFlags = setFlags;
83410
83411var _run;
83412
83413function _load_run() {
83414 return _run = __webpack_require__(296);
83415}
83416
83417function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
83418
83419var path = __webpack_require__(1);
83420
83421function hasWrapper(commander) {
83422 return false;
83423}
83424
83425function setFlags(commander) {
83426 commander.description('Displays the location of the yarn bin folder.');
83427}
83428
83429/***/ }),
83430/* 482 */
83431/***/ (function(module, exports, __webpack_require__) {
83432
83433"use strict";
83434
83435
83436Object.defineProperty(exports, "__esModule", {
83437 value: true
83438});
83439exports.examples = exports.run = undefined;
83440
83441var _stringify;
83442
83443function _load_stringify() {
83444 return _stringify = _interopRequireDefault(__webpack_require__(36));
83445}
83446
83447var _asyncToGenerator2;
83448
83449function _load_asyncToGenerator() {
83450 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
83451}
83452
83453exports.hasWrapper = hasWrapper;
83454exports.setFlags = setFlags;
83455
83456var _buildSubCommands2;
83457
83458function _load_buildSubCommands() {
83459 return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
83460}
83461
83462function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
83463
83464var CONFIG_KEYS = [
83465// 'reporter',
83466'registryFolders', 'linkedModules',
83467// 'registries',
83468'cache', 'cwd', 'looseSemver', 'commandName', 'preferOffline', 'modulesFolder', 'globalFolder', 'linkFolder', 'offline', 'binLinks', 'ignorePlatform', 'ignoreScripts', 'disablePrepublish', 'nonInteractive', 'workspaceRootFolder', 'lockfileFolder', 'networkConcurrency', 'childConcurrency', 'networkTimeout', 'workspacesEnabled', 'workspacesNohoistEnabled', 'pruneOfflineMirror', 'enableMetaFolder', 'enableLockfileVersions', 'linkFileDependencies', 'cacheFolder', 'tempFolder', 'production'];
83469/* eslint object-shorthand: 0 */
83470
83471function hasWrapper(flags, args) {
83472 return args[0] !== 'get';
83473}
83474
83475function setFlags(commander) {
83476 commander.description('Manages the yarn configuration files.');
83477}
83478
83479var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('config', {
83480 set(config, reporter, flags, args) {
83481 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
83482 if (args.length === 0 || args.length > 2) {
83483 return false;
83484 }
83485 var key = args[0],
83486 _args$ = args[1],
83487 val = _args$ === undefined ? true : _args$;
83488
83489 var yarnConfig = config.registries.yarn;
83490 yield yarnConfig.saveHomeConfig({ [key]: val });
83491 reporter.success(reporter.lang('configSet', key, val));
83492 return true;
83493 })();
83494 },
83495
83496 get(config, reporter, flags, args) {
83497 if (args.length !== 1) {
83498 return false;
83499 }
83500
83501 reporter.log(String(config.getOption(args[0])), { force: true });
83502 return true;
83503 },
83504
83505 delete: function () {
83506 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
83507 if (args.length !== 1) {
83508 return false;
83509 }
83510
83511 var key = args[0];
83512 var yarnConfig = config.registries.yarn;
83513 yield yarnConfig.saveHomeConfig({ [key]: undefined });
83514 reporter.success(reporter.lang('configDelete', key));
83515 return true;
83516 });
83517
83518 function _delete(_x, _x2, _x3, _x4) {
83519 return _ref.apply(this, arguments);
83520 }
83521
83522 return _delete;
83523 }(),
83524
83525 list(config, reporter, flags, args) {
83526 if (args.length) {
83527 return false;
83528 }
83529
83530 reporter.info(reporter.lang('configYarn'));
83531 reporter.inspect(config.registries.yarn.config);
83532
83533 reporter.info(reporter.lang('configNpm'));
83534 reporter.inspect(config.registries.npm.config);
83535
83536 return true;
83537 },
83538
83539 current(config, reporter, flags, args) {
83540 if (args.length) {
83541 return false;
83542 }
83543
83544 reporter.log((0, (_stringify || _load_stringify()).default)(config, CONFIG_KEYS, 2), { force: true });
83545
83546 return true;
83547 }
83548}),
83549 run = _buildSubCommands.run,
83550 examples = _buildSubCommands.examples;
83551
83552exports.run = run;
83553exports.examples = examples;
83554
83555/***/ }),
83556/* 483 */
83557/***/ (function(module, exports, __webpack_require__) {
83558
83559"use strict";
83560
83561
83562Object.defineProperty(exports, "__esModule", {
83563 value: true
83564});
83565exports.run = undefined;
83566
83567var _asyncToGenerator2;
83568
83569function _load_asyncToGenerator() {
83570 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
83571}
83572
83573var _extends2;
83574
83575function _load_extends() {
83576 return _extends2 = _interopRequireDefault(__webpack_require__(24));
83577}
83578
83579var run = exports.run = function () {
83580 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
83581 var builderName = args[0],
83582 rest = args.slice(1);
83583
83584
83585 if (!builderName) {
83586 throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName'));
83587 }
83588
83589 var _coerceCreatePackageN = coerceCreatePackageName(builderName),
83590 packageName = _coerceCreatePackageN.fullName,
83591 commandName = _coerceCreatePackageN.name;
83592
83593 var linkLoc = path.join(config.linkFolder, commandName);
83594 if (yield (_fs || _load_fs()).exists(linkLoc)) {
83595 reporter.info(reporter.lang('linkUsing', packageName));
83596 } else {
83597 yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', packageName]);
83598 }
83599
83600 var binFolder = yield (0, (_global || _load_global()).getBinFolder)(config, {});
83601 var command = path.resolve(binFolder, commandName);
83602 var env = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)('create', config.cwd, config);
83603
83604 yield (_child || _load_child()).spawn(command, rest, { stdio: `inherit`, shell: true, env });
83605 });
83606
83607 return function run(_x, _x2, _x3, _x4) {
83608 return _ref.apply(this, arguments);
83609 };
83610}();
83611
83612exports.setFlags = setFlags;
83613exports.hasWrapper = hasWrapper;
83614exports.parsePackageName = parsePackageName;
83615exports.coerceCreatePackageName = coerceCreatePackageName;
83616
83617var _errors;
83618
83619function _load_errors() {
83620 return _errors = __webpack_require__(6);
83621}
83622
83623var _child;
83624
83625function _load_child() {
83626 return _child = _interopRequireWildcard(__webpack_require__(57));
83627}
83628
83629var _executeLifecycleScript;
83630
83631function _load_executeLifecycleScript() {
83632 return _executeLifecycleScript = __webpack_require__(100);
83633}
83634
83635var _fs;
83636
83637function _load_fs() {
83638 return _fs = _interopRequireWildcard(__webpack_require__(8));
83639}
83640
83641var _global;
83642
83643function _load_global() {
83644 return _global = __webpack_require__(115);
83645}
83646
83647function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
83648
83649function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
83650
83651var path = __webpack_require__(1);
83652
83653function setFlags(commander) {
83654 commander.description('Creates new projects from any create-* starter kits.');
83655}
83656
83657function hasWrapper(commander, args) {
83658 return true;
83659}
83660
83661function parsePackageName(str) {
83662 if (str.charAt(0) === '/') {
83663 throw new Error(`Name should not start with "/", got "${str}"`);
83664 }
83665 if (str.charAt(0) === '.') {
83666 throw new Error(`Name should not start with ".", got "${str}"`);
83667 }
83668 var parts = str.split('/');
83669 var isScoped = str.charAt(0) === '@';
83670 if (isScoped && parts[0] === '@') {
83671 throw new Error(`Scope should not be empty, got "${str}"`);
83672 }
83673 var scope = isScoped ? parts[0] : '';
83674 var name = parts[isScoped ? 1 : 0] || '';
83675 var path = parts.slice(isScoped ? 2 : 1).join('/');
83676 var fullName = [scope, name].filter(Boolean).join('/');
83677 var full = [scope, name, path].filter(Boolean).join('/');
83678
83679 return { fullName, name, scope, path, full };
83680}
83681
83682function coerceCreatePackageName(str) {
83683 var pkgNameObj = parsePackageName(str);
83684 var coercedName = pkgNameObj.name !== '' ? `create-${pkgNameObj.name}` : `create`;
83685 var coercedPkgNameObj = (0, (_extends2 || _load_extends()).default)({}, pkgNameObj, {
83686 name: coercedName,
83687 fullName: [pkgNameObj.scope, coercedName].filter(Boolean).join('/'),
83688 full: [pkgNameObj.scope, coercedName, pkgNameObj.path].filter(Boolean).join('/')
83689 });
83690 return coercedPkgNameObj;
83691}
83692
83693/***/ }),
83694/* 484 */
83695/***/ (function(module, exports, __webpack_require__) {
83696
83697"use strict";
83698
83699
83700Object.defineProperty(exports, "__esModule", {
83701 value: true
83702});
83703exports.run = undefined;
83704
83705var _asyncToGenerator2;
83706
83707function _load_asyncToGenerator() {
83708 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
83709}
83710
83711var run = exports.run = function () {
83712 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
83713 var env = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)(`exec`, config.cwd, config);
83714
83715 if (args.length < 1) {
83716 throw new (_errors || _load_errors()).MessageError(reporter.lang('execMissingCommand'));
83717 }
83718
83719 var execName = args[0],
83720 rest = args.slice(1);
83721
83722 yield (_child || _load_child()).spawn(execName, rest, { stdio: 'inherit', env });
83723 });
83724
83725 return function run(_x, _x2, _x3, _x4) {
83726 return _ref.apply(this, arguments);
83727 };
83728}();
83729
83730exports.setFlags = setFlags;
83731exports.hasWrapper = hasWrapper;
83732
83733var _errors;
83734
83735function _load_errors() {
83736 return _errors = __webpack_require__(6);
83737}
83738
83739var _child;
83740
83741function _load_child() {
83742 return _child = _interopRequireWildcard(__webpack_require__(57));
83743}
83744
83745var _executeLifecycleScript;
83746
83747function _load_executeLifecycleScript() {
83748 return _executeLifecycleScript = __webpack_require__(100);
83749}
83750
83751function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
83752
83753function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
83754
83755function setFlags(commander) {}
83756
83757function hasWrapper(commander, args) {
83758 return true;
83759}
83760
83761/***/ }),
83762/* 485 */
83763/***/ (function(module, exports, __webpack_require__) {
83764
83765"use strict";
83766
83767
83768Object.defineProperty(exports, "__esModule", {
83769 value: true
83770});
83771exports.examples = exports.run = undefined;
83772
83773var _asyncToGenerator2;
83774
83775function _load_asyncToGenerator() {
83776 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
83777}
83778
83779var run = exports.run = function () {
83780 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
83781 var manifest = void 0;
83782 if (flags.useManifest) {
83783 manifest = yield config.readJson(flags.useManifest);
83784 } else {
83785 manifest = yield config.readRootManifest();
83786 }
83787 if (!manifest.name) {
83788 throw new (_errors || _load_errors()).MessageError(reporter.lang('noName'));
83789 }
83790 if (!manifest.version) {
83791 throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion'));
83792 }
83793
83794 var entry = {
83795 name: manifest.name,
83796 version: manifest.version,
83797 resolved: flags.resolved,
83798 registry: flags.registry || manifest._registry,
83799 optionalDependencies: manifest.optionalDependencies,
83800 dependencies: manifest.dependencies
83801 };
83802 var pattern = flags.pattern || `${entry.name}@${entry.version}`;
83803 reporter.log((0, (_lockfile || _load_lockfile()).stringify)({
83804 [pattern]: (0, (_lockfile || _load_lockfile()).implodeEntry)(pattern, entry)
83805 }));
83806 });
83807
83808 return function run(_x, _x2, _x3, _x4) {
83809 return _ref.apply(this, arguments);
83810 };
83811}();
83812
83813exports.hasWrapper = hasWrapper;
83814exports.setFlags = setFlags;
83815
83816var _errors;
83817
83818function _load_errors() {
83819 return _errors = __webpack_require__(6);
83820}
83821
83822var _lockfile;
83823
83824function _load_lockfile() {
83825 return _lockfile = __webpack_require__(25);
83826}
83827
83828function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
83829
83830function hasWrapper(commander, args) {
83831 return false;
83832}
83833
83834function setFlags(commander) {
83835 commander.description('Generates a lock file entry.');
83836 commander.option('--use-manifest <location>', 'description');
83837 commander.option('--resolved <resolved>', 'description');
83838 commander.option('--registry <registry>', 'description');
83839}
83840
83841var examples = exports.examples = ['generate-lock-entry', 'generate-lock-entry --use-manifest ./package.json', 'generate-lock-entry --resolved local-file.tgz#hash'];
83842
83843/***/ }),
83844/* 486 */
83845/***/ (function(module, exports, __webpack_require__) {
83846
83847"use strict";
83848
83849
83850Object.defineProperty(exports, "__esModule", {
83851 value: true
83852});
83853
83854var _getIterator2;
83855
83856function _load_getIterator() {
83857 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
83858}
83859
83860var _keys;
83861
83862function _load_keys() {
83863 return _keys = _interopRequireDefault(__webpack_require__(14));
83864}
83865
83866var _promise;
83867
83868function _load_promise() {
83869 return _promise = _interopRequireDefault(__webpack_require__(7));
83870}
83871
83872exports.hasWrapper = hasWrapper;
83873exports.setFlags = setFlags;
83874exports.run = run;
83875
83876var _index;
83877
83878function _load_index() {
83879 return _index = _interopRequireDefault(__webpack_require__(273));
83880}
83881
83882var _constants;
83883
83884function _load_constants() {
83885 return _constants = _interopRequireWildcard(__webpack_require__(13));
83886}
83887
83888var _misc;
83889
83890function _load_misc() {
83891 return _misc = __webpack_require__(28);
83892}
83893
83894var _aliases;
83895
83896function _load_aliases() {
83897 return _aliases = _interopRequireDefault(__webpack_require__(288));
83898}
83899
83900function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
83901
83902function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
83903
83904var chalk = __webpack_require__(37);
83905
83906function hasWrapper(flags, args) {
83907 return false;
83908}
83909
83910function setFlags(commander) {
83911 commander.description('Displays help information.');
83912}
83913
83914function run(config, reporter, commander, args) {
83915 if (args.length) {
83916 var commandName = args.shift();
83917 if (Object.prototype.hasOwnProperty.call((_index || _load_index()).default, commandName)) {
83918 var command = (_index || _load_index()).default[commandName];
83919 if (command) {
83920 command.setFlags(commander);
83921 var examples = (command.examples || []).map(function (example) {
83922 return ` $ yarn ${example}`;
83923 });
83924 if (examples.length) {
83925 commander.on('--help', function () {
83926 reporter.log(reporter.lang('helpExamples', reporter.rawText(examples.join('\n'))));
83927 });
83928 }
83929 // eslint-disable-next-line yarn-internal/warn-language
83930 commander.on('--help', function () {
83931 return reporter.log(' ' + command.getDocsInfo + '\n');
83932 });
83933 commander.help();
83934 return (_promise || _load_promise()).default.resolve();
83935 }
83936 }
83937 }
83938
83939 commander.on('--help', function () {
83940 var commandsText = [];
83941 for (var _iterator = (0, (_keys || _load_keys()).default)((_index || _load_index()).default).sort((_misc || _load_misc()).sortAlpha), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
83942 var _ref;
83943
83944 if (_isArray) {
83945 if (_i >= _iterator.length) break;
83946 _ref = _iterator[_i++];
83947 } else {
83948 _i = _iterator.next();
83949 if (_i.done) break;
83950 _ref = _i.value;
83951 }
83952
83953 var name = _ref;
83954
83955 if ((_index || _load_index()).default[name].useless || (0, (_keys || _load_keys()).default)((_aliases || _load_aliases()).default).map(function (key) {
83956 return (_aliases || _load_aliases()).default[key];
83957 }).indexOf(name) > -1) {
83958 continue;
83959 }
83960 if ((_aliases || _load_aliases()).default[name]) {
83961 commandsText.push(` - ${(0, (_misc || _load_misc()).hyphenate)(name)} / ${(_aliases || _load_aliases()).default[name]}`);
83962 } else {
83963 commandsText.push(` - ${(0, (_misc || _load_misc()).hyphenate)(name)}`);
83964 }
83965 }
83966 reporter.log(reporter.lang('helpCommands', reporter.rawText(commandsText.join('\n'))));
83967 reporter.log(reporter.lang('helpCommandsMore', reporter.rawText(chalk.bold('yarn help COMMAND'))));
83968 reporter.log(reporter.lang('helpLearnMore', reporter.rawText(chalk.bold((_constants || _load_constants()).YARN_DOCS))));
83969 });
83970
83971 commander.options.sort((_misc || _load_misc()).sortOptionsByFlags);
83972
83973 commander.help();
83974 return (_promise || _load_promise()).default.resolve();
83975}
83976
83977/***/ }),
83978/* 487 */
83979/***/ (function(module, exports, __webpack_require__) {
83980
83981"use strict";
83982
83983
83984Object.defineProperty(exports, "__esModule", {
83985 value: true
83986});
83987exports.run = exports.Import = exports.noArguments = undefined;
83988
83989var _getIterator2;
83990
83991function _load_getIterator() {
83992 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
83993}
83994
83995var _promise;
83996
83997function _load_promise() {
83998 return _promise = _interopRequireDefault(__webpack_require__(7));
83999}
84000
84001var _asyncToGenerator2;
84002
84003function _load_asyncToGenerator() {
84004 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
84005}
84006
84007var _classCallCheck2;
84008
84009function _load_classCallCheck() {
84010 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
84011}
84012
84013var _possibleConstructorReturn2;
84014
84015function _load_possibleConstructorReturn() {
84016 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
84017}
84018
84019var _inherits2;
84020
84021function _load_inherits() {
84022 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
84023}
84024
84025var run = exports.run = function () {
84026 var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
84027 var imp = new Import(flags, config, reporter, new (_lockfile || _load_lockfile()).default({ cache: {} }));
84028 yield imp.init();
84029 });
84030
84031 return function run(_x7, _x8, _x9, _x10) {
84032 return _ref15.apply(this, arguments);
84033 };
84034}();
84035
84036exports.setFlags = setFlags;
84037exports.hasWrapper = hasWrapper;
84038
84039var _install;
84040
84041function _load_install() {
84042 return _install = __webpack_require__(41);
84043}
84044
84045var _check;
84046
84047function _load_check() {
84048 return _check = __webpack_require__(292);
84049}
84050
84051var _errors;
84052
84053function _load_errors() {
84054 return _errors = __webpack_require__(6);
84055}
84056
84057var _index;
84058
84059function _load_index() {
84060 return _index = __webpack_require__(75);
84061}
84062
84063var _baseResolver;
84064
84065function _load_baseResolver() {
84066 return _baseResolver = _interopRequireDefault(__webpack_require__(117));
84067}
84068
84069var _hostedGitResolver;
84070
84071function _load_hostedGitResolver() {
84072 return _hostedGitResolver = _interopRequireDefault(__webpack_require__(99));
84073}
84074
84075var _hostedGitResolver2;
84076
84077function _load_hostedGitResolver2() {
84078 return _hostedGitResolver2 = __webpack_require__(99);
84079}
84080
84081var _gistResolver;
84082
84083function _load_gistResolver() {
84084 return _gistResolver = _interopRequireDefault(__webpack_require__(203));
84085}
84086
84087var _gistResolver2;
84088
84089function _load_gistResolver2() {
84090 return _gistResolver2 = __webpack_require__(203);
84091}
84092
84093var _gitResolver;
84094
84095function _load_gitResolver() {
84096 return _gitResolver = _interopRequireDefault(__webpack_require__(118));
84097}
84098
84099var _fileResolver;
84100
84101function _load_fileResolver() {
84102 return _fileResolver = _interopRequireDefault(__webpack_require__(202));
84103}
84104
84105var _packageResolver;
84106
84107function _load_packageResolver() {
84108 return _packageResolver = _interopRequireDefault(__webpack_require__(303));
84109}
84110
84111var _packageRequest;
84112
84113function _load_packageRequest() {
84114 return _packageRequest = _interopRequireDefault(__webpack_require__(116));
84115}
84116
84117var _packageReference;
84118
84119function _load_packageReference() {
84120 return _packageReference = _interopRequireDefault(__webpack_require__(302));
84121}
84122
84123var _packageFetcher;
84124
84125function _load_packageFetcher() {
84126 return _packageFetcher = _interopRequireWildcard(__webpack_require__(197));
84127}
84128
84129var _packageLinker;
84130
84131function _load_packageLinker() {
84132 return _packageLinker = _interopRequireDefault(__webpack_require__(198));
84133}
84134
84135var _packageCompatibility;
84136
84137function _load_packageCompatibility() {
84138 return _packageCompatibility = _interopRequireWildcard(__webpack_require__(196));
84139}
84140
84141var _lockfile;
84142
84143function _load_lockfile() {
84144 return _lockfile = _interopRequireDefault(__webpack_require__(25));
84145}
84146
84147var _normalizePattern9;
84148
84149function _load_normalizePattern() {
84150 return _normalizePattern9 = __webpack_require__(52);
84151}
84152
84153var _logicalDependencyTree;
84154
84155function _load_logicalDependencyTree() {
84156 return _logicalDependencyTree = __webpack_require__(539);
84157}
84158
84159var _fs;
84160
84161function _load_fs() {
84162 return _fs = _interopRequireWildcard(__webpack_require__(8));
84163}
84164
84165var _misc;
84166
84167function _load_misc() {
84168 return _misc = _interopRequireWildcard(__webpack_require__(28));
84169}
84170
84171var _constants;
84172
84173function _load_constants() {
84174 return _constants = __webpack_require__(13);
84175}
84176
84177var _semver;
84178
84179function _load_semver() {
84180 return _semver = _interopRequireDefault(__webpack_require__(27));
84181}
84182
84183function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
84184
84185function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
84186
84187var invariant = __webpack_require__(15);
84188var path = __webpack_require__(1);
84189var uuid = __webpack_require__(114);
84190var ssri = __webpack_require__(93);
84191var nodeVersion = process.versions.node.split('-')[0];
84192
84193var noArguments = exports.noArguments = true;
84194
84195var ImportResolver = function (_BaseResolver) {
84196 (0, (_inherits2 || _load_inherits()).default)(ImportResolver, _BaseResolver);
84197
84198 function ImportResolver() {
84199 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ImportResolver);
84200 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseResolver.apply(this, arguments));
84201 }
84202
84203 ImportResolver.prototype.getCwd = function getCwd() {
84204 if (this.request.parentRequest) {
84205 var parent = this.resolver.getStrictResolvedPattern(this.request.parentRequest.pattern);
84206 invariant(parent._loc, 'expected package location');
84207 return path.dirname(parent._loc);
84208 }
84209 return this.config.cwd;
84210 };
84211
84212 ImportResolver.prototype.resolveHostedGit = function resolveHostedGit(info, Resolver) {
84213 var _normalizePattern = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
84214 range = _normalizePattern.range;
84215
84216 var exploded = (0, (_hostedGitResolver2 || _load_hostedGitResolver2()).explodeHostedGitFragment)(range, this.reporter);
84217 var hash = info.gitHead;
84218 invariant(hash, 'expected package gitHead');
84219 var url = Resolver.getTarballUrl(exploded, hash);
84220 info._uid = hash;
84221 info._remote = {
84222 resolved: url,
84223 type: 'tarball',
84224 registry: this.registry,
84225 reference: url,
84226 hash: null
84227 };
84228 return info;
84229 };
84230
84231 ImportResolver.prototype.resolveGist = function resolveGist(info, Resolver) {
84232 var _normalizePattern2 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
84233 range = _normalizePattern2.range;
84234
84235 var _explodeGistFragment = (0, (_gistResolver2 || _load_gistResolver2()).explodeGistFragment)(range, this.reporter),
84236 id = _explodeGistFragment.id;
84237
84238 var hash = info.gitHead;
84239 invariant(hash, 'expected package gitHead');
84240 var url = `https://gist.github.com/${id}.git`;
84241 info._uid = hash;
84242 info._remote = {
84243 resolved: `${url}#${hash}`,
84244 type: 'git',
84245 registry: this.registry,
84246 reference: url,
84247 hash
84248 };
84249 return info;
84250 };
84251
84252 ImportResolver.prototype.resolveGit = function resolveGit(info, Resolver) {
84253 var url = info._resolved;
84254 var hash = info.gitHead;
84255 invariant(url, 'expected package _resolved');
84256 invariant(hash, 'expected package gitHead');
84257 info._uid = hash;
84258 info._remote = {
84259 resolved: `${url}#${hash}`,
84260 type: 'git',
84261 registry: this.registry,
84262 reference: url,
84263 hash
84264 };
84265 return info;
84266 };
84267
84268 ImportResolver.prototype.resolveFile = function resolveFile(info, Resolver) {
84269 var _normalizePattern3 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
84270 range = _normalizePattern3.range;
84271
84272 var loc = (_misc || _load_misc()).removePrefix(range, 'file:');
84273 if (!path.isAbsolute(loc)) {
84274 loc = path.join(this.config.cwd, loc);
84275 }
84276 info._uid = info.version;
84277 info._remote = {
84278 type: 'copy',
84279 registry: this.registry,
84280 hash: `${uuid.v4()}-${new Date().getTime()}`,
84281 reference: loc
84282 };
84283 return info;
84284 };
84285
84286 ImportResolver.prototype.resolveRegistry = function resolveRegistry(info) {
84287 var url = info._resolved;
84288 var hash = info._shasum;
84289 invariant(url, 'expected package _resolved');
84290 invariant(hash, 'expected package _shasum');
84291 if (this.config.getOption('registry') === (_constants || _load_constants()).YARN_REGISTRY) {
84292 url = url.replace((_constants || _load_constants()).NPM_REGISTRY_RE, (_constants || _load_constants()).YARN_REGISTRY);
84293 }
84294 info._uid = info.version;
84295 info._remote = {
84296 resolved: `${url}#${hash}`,
84297 type: 'tarball',
84298 registry: this.registry,
84299 reference: url,
84300 integrity: info._integrity ? ssri.parse(info._integrity) : ssri.fromHex(hash, 'sha1'),
84301 hash
84302 };
84303 return info;
84304 };
84305
84306 ImportResolver.prototype.resolveImport = function resolveImport(info) {
84307 var _normalizePattern4 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
84308 range = _normalizePattern4.range;
84309
84310 var Resolver = (0, (_index || _load_index()).getExoticResolver)(range);
84311 if (Resolver && Resolver.prototype instanceof (_hostedGitResolver || _load_hostedGitResolver()).default) {
84312 return this.resolveHostedGit(info, Resolver);
84313 } else if (Resolver && Resolver === (_gistResolver || _load_gistResolver()).default) {
84314 return this.resolveGist(info, Resolver);
84315 } else if (Resolver && Resolver === (_gitResolver || _load_gitResolver()).default) {
84316 return this.resolveGit(info, Resolver);
84317 } else if (Resolver && Resolver === (_fileResolver || _load_fileResolver()).default) {
84318 return this.resolveFile(info, Resolver);
84319 }
84320 return this.resolveRegistry(info);
84321 };
84322
84323 ImportResolver.prototype.resolveLocation = function () {
84324 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
84325 var info = yield this.config.tryManifest(loc, 'npm', false);
84326 if (!info) {
84327 return null;
84328 }
84329 return this.resolveImport(info);
84330 });
84331
84332 function resolveLocation(_x) {
84333 return _ref.apply(this, arguments);
84334 }
84335
84336 return resolveLocation;
84337 }();
84338
84339 ImportResolver.prototype.resolveFixedVersion = function () {
84340 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (fixedVersionPattern) {
84341 var _normalizePattern5 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(fixedVersionPattern),
84342 range = _normalizePattern5.range;
84343
84344 var exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range);
84345 var manifest = exoticResolver ? yield this.request.findExoticVersionInfo(exoticResolver, range) : yield this.request.findVersionOnRegistry(fixedVersionPattern);
84346 return manifest;
84347 });
84348
84349 function resolveFixedVersion(_x2) {
84350 return _ref2.apply(this, arguments);
84351 }
84352
84353 return resolveFixedVersion;
84354 }();
84355
84356 ImportResolver.prototype._resolveFromFixedVersions = function () {
84357 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
84358 var _this2 = this;
84359
84360 invariant(this.request instanceof ImportPackageRequest, 'request must be ImportPackageRequest');
84361
84362 var _normalizePattern6 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
84363 name = _normalizePattern6.name;
84364
84365 invariant(this.request.dependencyTree instanceof (_logicalDependencyTree || _load_logicalDependencyTree()).LogicalDependencyTree, 'dependencyTree on request must be LogicalDependencyTree');
84366 var fixedVersionPattern = this.request.dependencyTree.getFixedVersionPattern(name, this.request.parentNames);
84367 var info = yield this.config.getCache(`import-resolver-${fixedVersionPattern}`, function () {
84368 return _this2.resolveFixedVersion(fixedVersionPattern);
84369 });
84370 if (info) {
84371 return info;
84372 }
84373 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('importResolveFailed', name, this.getCwd()));
84374 });
84375
84376 function _resolveFromFixedVersions() {
84377 return _ref3.apply(this, arguments);
84378 }
84379
84380 return _resolveFromFixedVersions;
84381 }();
84382
84383 ImportResolver.prototype._resolveFromNodeModules = function () {
84384 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
84385 var _this3 = this;
84386
84387 var _normalizePattern7 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
84388 name = _normalizePattern7.name;
84389
84390 var cwd = this.getCwd();
84391
84392 var _loop = function* _loop() {
84393 var loc = path.join(cwd, 'node_modules', name);
84394 var info = yield _this3.config.getCache(`import-resolver-${loc}`, function () {
84395 return _this3.resolveLocation(loc);
84396 });
84397 if (info) {
84398 return {
84399 v: info
84400 };
84401 }
84402 cwd = path.resolve(cwd, '../..');
84403 };
84404
84405 while (!path.relative(this.config.cwd, cwd).startsWith('..')) {
84406 var _ret = yield* _loop();
84407
84408 if (typeof _ret === "object") return _ret.v;
84409 }
84410 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('importResolveFailed', name, this.getCwd()));
84411 });
84412
84413 function _resolveFromNodeModules() {
84414 return _ref4.apply(this, arguments);
84415 }
84416
84417 return _resolveFromNodeModules;
84418 }();
84419
84420 ImportResolver.prototype.resolve = function resolve() {
84421 if (this.request instanceof ImportPackageRequest && this.request.dependencyTree) {
84422 return this._resolveFromFixedVersions();
84423 } else {
84424 return this._resolveFromNodeModules();
84425 }
84426 };
84427
84428 return ImportResolver;
84429}((_baseResolver || _load_baseResolver()).default);
84430
84431var ImportPackageRequest = function (_PackageRequest) {
84432 (0, (_inherits2 || _load_inherits()).default)(ImportPackageRequest, _PackageRequest);
84433
84434 function ImportPackageRequest(req, dependencyTree, resolver) {
84435 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ImportPackageRequest);
84436
84437 var _this4 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _PackageRequest.call(this, req, resolver));
84438
84439 _this4.import = _this4.parentRequest instanceof ImportPackageRequest ? _this4.parentRequest.import : true;
84440 _this4.dependencyTree = dependencyTree;
84441 return _this4;
84442 }
84443
84444 ImportPackageRequest.prototype.getRootName = function getRootName() {
84445 return this.resolver instanceof ImportPackageResolver && this.resolver.rootName || 'root';
84446 };
84447
84448 ImportPackageRequest.prototype.getParentHumanName = function getParentHumanName() {
84449 return [this.getRootName()].concat(this.parentNames).join(' > ');
84450 };
84451
84452 ImportPackageRequest.prototype.reportResolvedRangeMatch = function reportResolvedRangeMatch(info, resolved) {
84453 if (info.version === resolved.version) {
84454 return;
84455 }
84456 this.reporter.warn(this.reporter.lang('importResolvedRangeMatch', resolved.version, resolved.name, info.version, this.getParentHumanName()));
84457 };
84458
84459 ImportPackageRequest.prototype._findResolvedManifest = function _findResolvedManifest(info) {
84460 var _normalizePattern8 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern),
84461 range = _normalizePattern8.range,
84462 name = _normalizePattern8.name;
84463
84464 var solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range;
84465 var resolved = this.resolver.getExactVersionMatch(name, solvedRange, info);
84466 if (resolved) {
84467 return resolved;
84468 }
84469 invariant(info._remote, 'expected package remote');
84470 var ref = new (_packageReference || _load_packageReference()).default(this, info, info._remote);
84471 info._reference = ref;
84472 return info;
84473 };
84474
84475 ImportPackageRequest.prototype.resolveToExistingVersion = function resolveToExistingVersion(info) {
84476 var resolved = this._findResolvedManifest(info);
84477 invariant(resolved, 'should have found a resolved reference');
84478 var ref = resolved._reference;
84479 invariant(ref, 'should have a package reference');
84480 ref.addRequest(this);
84481 ref.addPattern(this.pattern, resolved);
84482 ref.addOptional(this.optional);
84483 };
84484
84485 ImportPackageRequest.prototype.findVersionInfo = function findVersionInfo() {
84486 var _this5 = this;
84487
84488 if (!this.import) {
84489 this.reporter.verbose(this.reporter.lang('skippingImport', this.pattern, this.getParentHumanName()));
84490 return _PackageRequest.prototype.findVersionInfo.call(this);
84491 }
84492 var resolver = new ImportResolver(this, this.pattern);
84493 return resolver.resolve().catch(function () {
84494 _this5.import = false;
84495 _this5.reporter.warn(_this5.reporter.lang('importFailed', _this5.pattern, _this5.getParentHumanName()));
84496 return _PackageRequest.prototype.findVersionInfo.call(_this5);
84497 });
84498 };
84499
84500 return ImportPackageRequest;
84501}((_packageRequest || _load_packageRequest()).default);
84502
84503var ImportPackageResolver = function (_PackageResolver) {
84504 (0, (_inherits2 || _load_inherits()).default)(ImportPackageResolver, _PackageResolver);
84505
84506 function ImportPackageResolver(config, lockfile) {
84507 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ImportPackageResolver);
84508
84509 var _this6 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _PackageResolver.call(this, config, lockfile));
84510
84511 _this6.next = [];
84512 _this6.rootName = 'root';
84513 return _this6;
84514 }
84515
84516 ImportPackageResolver.prototype.find = function find(req) {
84517 this.next.push(req);
84518 return (_promise || _load_promise()).default.resolve();
84519 };
84520
84521 ImportPackageResolver.prototype.findOne = function () {
84522 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (req) {
84523 if (this.activity) {
84524 this.activity.tick(req.pattern);
84525 }
84526 var request = new ImportPackageRequest(req, this.dependencyTree, this);
84527 yield request.find({ fresh: false });
84528 });
84529
84530 function findOne(_x3) {
84531 return _ref5.apply(this, arguments);
84532 }
84533
84534 return findOne;
84535 }();
84536
84537 ImportPackageResolver.prototype.findAll = function () {
84538 var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (deps) {
84539 var _this7 = this;
84540
84541 yield (_promise || _load_promise()).default.all(deps.map(function (dep) {
84542 return _this7.findOne(dep);
84543 }));
84544 deps = this.next;
84545 this.next = [];
84546 if (!deps.length) {
84547 // all required package versions have been discovered, so now packages that
84548 // resolved to existing versions can be resolved to their best available version
84549 this.resolvePackagesWithExistingVersions();
84550 return;
84551 }
84552 yield this.findAll(deps);
84553 });
84554
84555 function findAll(_x4) {
84556 return _ref6.apply(this, arguments);
84557 }
84558
84559 return findAll;
84560 }();
84561
84562 ImportPackageResolver.prototype.resetOptional = function resetOptional() {
84563 for (var pattern in this.patterns) {
84564 var ref = this.patterns[pattern]._reference;
84565 invariant(ref, 'expected reference');
84566 ref.optional = null;
84567 for (var _iterator = ref.requests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
84568 var _ref7;
84569
84570 if (_isArray) {
84571 if (_i >= _iterator.length) break;
84572 _ref7 = _iterator[_i++];
84573 } else {
84574 _i = _iterator.next();
84575 if (_i.done) break;
84576 _ref7 = _i.value;
84577 }
84578
84579 var req = _ref7;
84580
84581 ref.addOptional(req.optional);
84582 }
84583 }
84584 };
84585
84586 ImportPackageResolver.prototype.init = function () {
84587 var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (deps) {
84588 var _ref9 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { isFlat: false, isFrozen: false, workspaceLayout: undefined },
84589 isFlat = _ref9.isFlat,
84590 isFrozen = _ref9.isFrozen,
84591 workspaceLayout = _ref9.workspaceLayout;
84592
84593 this.flat = Boolean(isFlat);
84594 var activity = this.activity = this.reporter.activity();
84595 yield this.findAll(deps);
84596 this.resetOptional();
84597 activity.end();
84598 this.activity = null;
84599 });
84600
84601 function init(_x5) {
84602 return _ref8.apply(this, arguments);
84603 }
84604
84605 return init;
84606 }();
84607
84608 return ImportPackageResolver;
84609}((_packageResolver || _load_packageResolver()).default);
84610
84611var Import = exports.Import = function (_Install) {
84612 (0, (_inherits2 || _load_inherits()).default)(Import, _Install);
84613
84614 function Import(flags, config, reporter, lockfile) {
84615 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Import);
84616
84617 var _this8 = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _Install.call(this, flags, config, reporter, lockfile));
84618
84619 _this8.resolver = new ImportPackageResolver(_this8.config, _this8.lockfile);
84620 _this8.linker = new (_packageLinker || _load_packageLinker()).default(config, _this8.resolver);
84621 return _this8;
84622 }
84623
84624 Import.prototype.createLogicalDependencyTree = function createLogicalDependencyTree(packageJson, packageLock) {
84625 invariant(packageJson, 'package.json should exist');
84626 invariant(packageLock, 'package-lock.json should exist');
84627 invariant(this.resolver instanceof ImportPackageResolver, 'resolver should be an ImportPackageResolver');
84628 try {
84629 this.resolver.dependencyTree = new (_logicalDependencyTree || _load_logicalDependencyTree()).LogicalDependencyTree(packageJson, packageLock);
84630 } catch (e) {
84631 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('importSourceFilesCorrupted'));
84632 }
84633 };
84634
84635 Import.prototype.getExternalLockfileContents = function () {
84636 var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
84637 try {
84638 var _ref11 = yield (_promise || _load_promise()).default.all([(_fs || _load_fs()).readFile(path.join(this.config.cwd, (_constants || _load_constants()).NODE_PACKAGE_JSON)), (_fs || _load_fs()).readFile(path.join(this.config.cwd, (_constants || _load_constants()).NPM_LOCK_FILENAME))]),
84639 _packageJson = _ref11[0],
84640 _packageLock = _ref11[1];
84641
84642 return { packageJson: _packageJson, packageLock: _packageLock };
84643 } catch (e) {
84644 return { packageJson: null, packageLock: null };
84645 }
84646 });
84647
84648 function getExternalLockfileContents() {
84649 return _ref10.apply(this, arguments);
84650 }
84651
84652 return getExternalLockfileContents;
84653 }();
84654
84655 Import.prototype.init = function () {
84656 var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
84657 if (yield (_fs || _load_fs()).exists(path.join(this.config.cwd, (_constants || _load_constants()).LOCKFILE_FILENAME))) {
84658 throw new (_errors || _load_errors()).MessageError(this.reporter.lang('lockfileExists'));
84659 }
84660
84661 var _ref13 = yield this.getExternalLockfileContents(),
84662 packageJson = _ref13.packageJson,
84663 packageLock = _ref13.packageLock;
84664
84665 var importSource = packageJson && packageLock && (_semver || _load_semver()).default.satisfies(nodeVersion, '>=5.0.0') ? 'package-lock.json' : 'node_modules';
84666 if (importSource === 'package-lock.json') {
84667 this.reporter.info(this.reporter.lang('importPackageLock'));
84668 this.createLogicalDependencyTree(packageJson, packageLock);
84669 }
84670 if (importSource === 'node_modules') {
84671 this.reporter.info(this.reporter.lang('importNodeModules'));
84672 yield (0, (_check || _load_check()).verifyTreeCheck)(this.config, this.reporter, {}, []);
84673 }
84674
84675 var _ref14 = yield this.fetchRequestFromCwd(),
84676 requests = _ref14.requests,
84677 patterns = _ref14.patterns,
84678 manifest = _ref14.manifest;
84679
84680 if (manifest.name && this.resolver instanceof ImportPackageResolver) {
84681 this.resolver.rootName = manifest.name;
84682 }
84683 yield this.resolver.init(requests, { isFlat: this.flags.flat, isFrozen: this.flags.frozenLockfile });
84684 var manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(this.resolver.getManifests(), this.config);
84685 this.resolver.updateManifests(manifests);
84686 yield (_packageCompatibility || _load_packageCompatibility()).check(this.resolver.getManifests(), this.config, this.flags.ignoreEngines);
84687 yield this.linker.resolvePeerModules();
84688 yield this.saveLockfileAndIntegrity(patterns);
84689 return patterns;
84690 });
84691
84692 function init() {
84693 return _ref12.apply(this, arguments);
84694 }
84695
84696 return init;
84697 }();
84698
84699 return Import;
84700}((_install || _load_install()).Install);
84701
84702function setFlags(commander) {
84703 commander.description('Generates yarn.lock from an npm package-lock.json file or an existing npm-installed node_modules folder.');
84704}
84705
84706function hasWrapper(commander, args) {
84707 return true;
84708}
84709
84710/***/ }),
84711/* 488 */
84712/***/ (function(module, exports, __webpack_require__) {
84713
84714"use strict";
84715
84716
84717Object.defineProperty(exports, "__esModule", {
84718 value: true
84719});
84720exports.run = undefined;
84721
84722var _assign;
84723
84724function _load_assign() {
84725 return _assign = _interopRequireDefault(__webpack_require__(23));
84726}
84727
84728var _keys;
84729
84730function _load_keys() {
84731 return _keys = _interopRequireDefault(__webpack_require__(14));
84732}
84733
84734var _asyncToGenerator2;
84735
84736function _load_asyncToGenerator() {
84737 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
84738}
84739
84740var run = exports.run = function () {
84741 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
84742 if (args.length > 2) {
84743 reporter.error(reporter.lang('tooManyArguments', 2));
84744 return;
84745 }
84746
84747 var packageName = args.shift() || '.';
84748
84749 // Handle the case when we are referencing a local package.
84750 if (packageName === '.') {
84751 packageName = (yield config.readRootManifest()).name;
84752 }
84753
84754 var packageInput = (_npmRegistry || _load_npmRegistry()).default.escapeName(packageName);
84755
84756 var _parsePackageName = (0, (_parsePackageName2 || _load_parsePackageName()).default)(packageInput),
84757 name = _parsePackageName.name,
84758 version = _parsePackageName.version;
84759
84760 var result = void 0;
84761 try {
84762 result = yield config.registries.npm.request(name, { unfiltered: true });
84763 } catch (e) {
84764 reporter.error(reporter.lang('infoFail'));
84765 return;
84766 }
84767 if (!result) {
84768 reporter.error(reporter.lang('infoFail'));
84769 return;
84770 }
84771
84772 result = clean(result);
84773
84774 var versions = result.versions;
84775 // $FlowFixMe
84776 result.versions = (0, (_keys || _load_keys()).default)(versions).sort(semver.compareLoose);
84777 result.version = version || result['dist-tags'].latest;
84778 result = (0, (_assign || _load_assign()).default)(result, versions[result.version]);
84779
84780 var fieldPath = args.shift();
84781 var fields = fieldPath ? fieldPath.split('.') : [];
84782
84783 // Readmes can be long so exclude them unless explicitly asked for.
84784 if (fields[0] !== 'readme') {
84785 delete result.readme;
84786 }
84787
84788 result = fields.reduce(function (prev, cur) {
84789 return prev && prev[cur];
84790 }, result);
84791 reporter.inspect(result);
84792 });
84793
84794 return function run(_x, _x2, _x3, _x4) {
84795 return _ref.apply(this, arguments);
84796 };
84797}();
84798
84799exports.setFlags = setFlags;
84800exports.hasWrapper = hasWrapper;
84801
84802var _npmRegistry;
84803
84804function _load_npmRegistry() {
84805 return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
84806}
84807
84808var _parsePackageName2;
84809
84810function _load_parsePackageName() {
84811 return _parsePackageName2 = _interopRequireDefault(__webpack_require__(545));
84812}
84813
84814function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
84815
84816var semver = __webpack_require__(27);
84817
84818function clean(object) {
84819 if (Array.isArray(object)) {
84820 var result = [];
84821 object.forEach(function (item) {
84822 item = clean(item);
84823 if (item) {
84824 result.push(item);
84825 }
84826 });
84827 return result;
84828 } else if (typeof object === 'object') {
84829 var _result = {};
84830 for (var key in object) {
84831 if (key.startsWith('_')) {
84832 continue;
84833 }
84834
84835 var item = clean(object[key]);
84836 if (item) {
84837 _result[key] = item;
84838 }
84839 }
84840 return _result;
84841 } else if (object) {
84842 return object;
84843 } else {
84844 return null;
84845 }
84846}
84847
84848function setFlags(commander) {
84849 commander.description('Shows information about a package.');
84850}
84851
84852function hasWrapper(commander, args) {
84853 return true;
84854}
84855
84856/***/ }),
84857/* 489 */
84858/***/ (function(module, exports, __webpack_require__) {
84859
84860"use strict";
84861
84862
84863Object.defineProperty(exports, "__esModule", {
84864 value: true
84865});
84866exports.getGitConfigInfo = exports.run = exports.shouldRunInCurrentCwd = undefined;
84867
84868var _assign;
84869
84870function _load_assign() {
84871 return _assign = _interopRequireDefault(__webpack_require__(23));
84872}
84873
84874var _getIterator2;
84875
84876function _load_getIterator() {
84877 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
84878}
84879
84880var _asyncToGenerator2;
84881
84882function _load_asyncToGenerator() {
84883 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
84884}
84885
84886var run = exports.run = function () {
84887 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
84888 var installVersion = flags[`2`] ? `berry` : flags.install;
84889 var forwardedArgs = process.argv.slice(process.argv.indexOf('init', 2) + 1);
84890
84891 if (installVersion) {
84892 if (flags[`2`] && process.env.COREPACK_ROOT) {
84893 yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [path.join(process.env.COREPACK_ROOT, 'dist/corepack.js'), `yarn@${flags.install || `stable`}`, `init`].concat(forwardedArgs, [`--install=self`]), {
84894 stdio: 'inherit',
84895 cwd: config.cwd
84896 });
84897 } else {
84898 var lockfilePath = path.resolve(config.cwd, 'yarn.lock');
84899 if (!(yield (_fs || _load_fs()).exists(lockfilePath))) {
84900 yield (_fs || _load_fs()).writeFile(lockfilePath, '');
84901 }
84902 yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [process.argv[1], 'policies', 'set-version', installVersion, '--silent'], {
84903 stdio: 'inherit',
84904 cwd: config.cwd
84905 });
84906 yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [process.argv[1], 'init'].concat(forwardedArgs), {
84907 stdio: 'inherit',
84908 cwd: config.cwd
84909 });
84910 }
84911 return;
84912 }
84913
84914 var manifests = yield config.getRootManifests();
84915
84916 var repository = {};
84917 var author = {
84918 name: config.getOption('init-author-name'),
84919 email: config.getOption('init-author-email'),
84920 url: config.getOption('init-author-url')
84921 };
84922 if (yield (_fs || _load_fs()).exists(path.join(config.cwd, '.git'))) {
84923 // get git origin of the cwd
84924 try {
84925 repository = {
84926 type: 'git',
84927 url: yield (_child || _load_child()).spawn('git', ['config', 'remote.origin.url'], {
84928 cwd: config.cwd
84929 })
84930 };
84931 } catch (ex) {
84932 // Ignore - Git repo may not have an origin URL yet (eg. if it only exists locally)
84933 }
84934
84935 if (author.name === undefined) {
84936 author.name = yield getGitConfigInfo('user.name');
84937 }
84938
84939 if (author.email === undefined) {
84940 author.email = yield getGitConfigInfo('user.email');
84941 }
84942 }
84943
84944 var keys = [{
84945 key: 'name',
84946 question: 'name',
84947 default: path.basename(config.cwd),
84948 validation: (_validate || _load_validate()).isValidPackageName,
84949 validationError: 'invalidPackageName'
84950 }, {
84951 key: 'version',
84952 question: 'version',
84953 default: String(config.getOption('init-version'))
84954 }, {
84955 key: 'description',
84956 question: 'description',
84957 default: ''
84958 }, {
84959 key: 'main',
84960 question: 'entry point',
84961 default: 'index.js'
84962 }, {
84963 key: 'repository',
84964 question: 'repository url',
84965 default: (0, (_util || _load_util()).extractRepositoryUrl)(repository)
84966 }, {
84967 key: 'author',
84968 question: 'author',
84969 default: (0, (_util || _load_util()).stringifyPerson)(author)
84970 }, {
84971 key: 'license',
84972 question: 'license',
84973 default: String(config.getOption('init-license'))
84974 }, {
84975 key: 'private',
84976 question: 'private',
84977 default: config.getOption('init-private') || '',
84978 inputFormatter: yn
84979 }];
84980
84981 // get answers
84982 var pkg = {};
84983 for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
84984 var _ref2;
84985
84986 if (_isArray) {
84987 if (_i >= _iterator.length) break;
84988 _ref2 = _iterator[_i++];
84989 } else {
84990 _i = _iterator.next();
84991 if (_i.done) break;
84992 _ref2 = _i.value;
84993 }
84994
84995 var entry = _ref2;
84996 var yes = flags.yes,
84997 privateFlag = flags.private;
84998 var manifestKey = entry.key;
84999 var question = entry.question,
85000 def = entry.default;
85001
85002
85003 for (var _iterator4 = (_index || _load_index()).registryNames, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
85004 var _ref5;
85005
85006 if (_isArray4) {
85007 if (_i4 >= _iterator4.length) break;
85008 _ref5 = _iterator4[_i4++];
85009 } else {
85010 _i4 = _iterator4.next();
85011 if (_i4.done) break;
85012 _ref5 = _i4.value;
85013 }
85014
85015 var _registryName = _ref5;
85016 var object = manifests[_registryName].object;
85017
85018 var val = objectPath.get(object, manifestKey);
85019 if (!val) {
85020 break;
85021 }
85022 if (typeof val === 'object') {
85023 if (manifestKey === 'author') {
85024 val = (0, (_util || _load_util()).stringifyPerson)(val);
85025 } else if (manifestKey === 'repository') {
85026 val = (0, (_util || _load_util()).extractRepositoryUrl)(val);
85027 }
85028 }
85029 def = val;
85030 }
85031
85032 if (manifestKey === 'private' && privateFlag) {
85033 def = true;
85034 }
85035
85036 if (def) {
85037 question += ` (${String(def)})`;
85038 }
85039
85040 var answer = void 0;
85041 var validAnswer = false;
85042
85043 if (yes) {
85044 answer = def;
85045 } else {
85046 // loop until a valid answer is provided, if validation is on entry
85047 if (entry.validation) {
85048 while (!validAnswer) {
85049 answer = (yield reporter.question(question)) || def;
85050 // validate answer
85051 if (entry.validation(String(answer))) {
85052 validAnswer = true;
85053 } else {
85054 reporter.error(reporter.lang('invalidPackageName'));
85055 }
85056 }
85057 } else {
85058 answer = (yield reporter.question(question)) || def;
85059 }
85060 }
85061
85062 if (answer) {
85063 if (entry.inputFormatter) {
85064 answer = entry.inputFormatter(answer);
85065 }
85066 objectPath.set(pkg, manifestKey, answer);
85067 }
85068 }
85069
85070 if (pkg.repository && (_githubResolver || _load_githubResolver()).default.isVersion(pkg.repository)) {
85071 pkg.repository = `https://github.com/${pkg.repository}`;
85072 }
85073
85074 // save answers
85075 var targetManifests = [];
85076 for (var _iterator2 = (_index || _load_index()).registryNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
85077 var _ref3;
85078
85079 if (_isArray2) {
85080 if (_i2 >= _iterator2.length) break;
85081 _ref3 = _iterator2[_i2++];
85082 } else {
85083 _i2 = _iterator2.next();
85084 if (_i2.done) break;
85085 _ref3 = _i2.value;
85086 }
85087
85088 var registryName = _ref3;
85089
85090 var info = manifests[registryName];
85091 if (info.exists) {
85092 targetManifests.push(info);
85093 }
85094 }
85095 if (!targetManifests.length) {
85096 targetManifests.push(manifests.npm);
85097 }
85098 for (var _iterator3 = targetManifests, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
85099 var _ref4;
85100
85101 if (_isArray3) {
85102 if (_i3 >= _iterator3.length) break;
85103 _ref4 = _iterator3[_i3++];
85104 } else {
85105 _i3 = _iterator3.next();
85106 if (_i3.done) break;
85107 _ref4 = _i3.value;
85108 }
85109
85110 var targetManifest = _ref4;
85111
85112 (0, (_assign || _load_assign()).default)(targetManifest.object, pkg);
85113 reporter.success(`Saved ${path.basename(targetManifest.loc)}`);
85114 }
85115
85116 yield config.saveRootManifests(manifests);
85117 });
85118
85119 return function run(_x, _x2, _x3, _x4) {
85120 return _ref.apply(this, arguments);
85121 };
85122}();
85123
85124var getGitConfigInfo = exports.getGitConfigInfo = function () {
85125 var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (credential) {
85126 var spawn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (_child || _load_child()).spawn;
85127
85128 try {
85129 // try to get author default based on git config
85130 return yield spawn('git', ['config', credential]);
85131 } catch (e) {
85132 return '';
85133 }
85134 });
85135
85136 return function getGitConfigInfo(_x5) {
85137 return _ref6.apply(this, arguments);
85138 };
85139}();
85140
85141exports.setFlags = setFlags;
85142exports.hasWrapper = hasWrapper;
85143
85144var _util;
85145
85146function _load_util() {
85147 return _util = __webpack_require__(207);
85148}
85149
85150var _index;
85151
85152function _load_index() {
85153 return _index = __webpack_require__(61);
85154}
85155
85156var _githubResolver;
85157
85158function _load_githubResolver() {
85159 return _githubResolver = _interopRequireDefault(__webpack_require__(304));
85160}
85161
85162var _child;
85163
85164function _load_child() {
85165 return _child = _interopRequireWildcard(__webpack_require__(57));
85166}
85167
85168var _fs;
85169
85170function _load_fs() {
85171 return _fs = _interopRequireWildcard(__webpack_require__(8));
85172}
85173
85174var _validate;
85175
85176function _load_validate() {
85177 return _validate = _interopRequireWildcard(__webpack_require__(119));
85178}
85179
85180var _constants;
85181
85182function _load_constants() {
85183 return _constants = __webpack_require__(13);
85184}
85185
85186function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
85187
85188function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
85189
85190var objectPath = __webpack_require__(244);
85191
85192var path = __webpack_require__(1);
85193var yn = __webpack_require__(1035);
85194
85195function setFlags(commander) {
85196 commander.description('Interactively creates or updates a package.json file.');
85197 commander.option('-y, --yes', 'use default options');
85198 commander.option('-p, --private', 'use default options and private true');
85199 commander.option('-i, --install <value>', 'install a specific Yarn release');
85200 commander.option('-2', 'generates the project using Yarn 2');
85201}
85202
85203function hasWrapper(commander, args) {
85204 return true;
85205}
85206
85207var shouldRunInCurrentCwd = exports.shouldRunInCurrentCwd = true;
85208
85209/***/ }),
85210/* 490 */
85211/***/ (function(module, exports, __webpack_require__) {
85212
85213"use strict";
85214
85215
85216Object.defineProperty(exports, "__esModule", {
85217 value: true
85218});
85219exports.examples = exports.run = undefined;
85220
85221var _getIterator2;
85222
85223function _load_getIterator() {
85224 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
85225}
85226
85227var _map;
85228
85229function _load_map() {
85230 return _map = _interopRequireDefault(__webpack_require__(42));
85231}
85232
85233var _extends2;
85234
85235function _load_extends() {
85236 return _extends2 = _interopRequireDefault(__webpack_require__(24));
85237}
85238
85239var _asyncToGenerator2;
85240
85241function _load_asyncToGenerator() {
85242 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
85243}
85244
85245var getManifests = function () {
85246 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) {
85247 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd);
85248 var install = new (_install || _load_install()).Install((0, (_extends2 || _load_extends()).default)({ skipIntegrityCheck: true }, flags), config, new (_baseReporter || _load_baseReporter()).default(), lockfile);
85249 yield install.hydrate(true);
85250
85251 var manifests = install.resolver.getManifests();
85252
85253 // sort by name
85254 manifests = manifests.sort(function (a, b) {
85255 if (!a.name && !b.name) {
85256 return 0;
85257 }
85258
85259 if (!a.name) {
85260 return 1;
85261 }
85262
85263 if (!b.name) {
85264 return -1;
85265 }
85266
85267 return a.name.localeCompare(b.name);
85268 });
85269
85270 // filter ignored manifests
85271 manifests = manifests.filter(function (manifest) {
85272 var ref = manifest._reference;
85273 return !!ref && !ref.ignore;
85274 });
85275
85276 return manifests;
85277 });
85278
85279 return function getManifests(_x, _x2) {
85280 return _ref.apply(this, arguments);
85281 };
85282}();
85283
85284var list = function () {
85285 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
85286 var manifests = yield getManifests(config, flags);
85287 var manifestsByLicense = new (_map || _load_map()).default();
85288
85289 for (var _iterator = manifests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
85290 var _ref4;
85291
85292 if (_isArray) {
85293 if (_i >= _iterator.length) break;
85294 _ref4 = _iterator[_i++];
85295 } else {
85296 _i = _iterator.next();
85297 if (_i.done) break;
85298 _ref4 = _i.value;
85299 }
85300
85301 var _ref3 = _ref4;
85302 var name = _ref3.name,
85303 version = _ref3.version,
85304 license = _ref3.license,
85305 repository = _ref3.repository,
85306 homepage = _ref3.homepage,
85307 author = _ref3.author;
85308
85309 var licenseKey = license || 'UNKNOWN';
85310 var url = repository ? repository.url : homepage;
85311 var vendorUrl = homepage || author && author.url;
85312 var vendorName = author && author.name;
85313
85314 if (!manifestsByLicense.has(licenseKey)) {
85315 manifestsByLicense.set(licenseKey, new (_map || _load_map()).default());
85316 }
85317
85318 var byLicense = manifestsByLicense.get(licenseKey);
85319 invariant(byLicense, 'expected value');
85320 byLicense.set(`${name}@${version}`, {
85321 name,
85322 version,
85323 url,
85324 vendorUrl,
85325 vendorName
85326 });
85327 }
85328
85329 if (flags.json) {
85330 var body = [];
85331
85332 manifestsByLicense.forEach(function (license, licenseKey) {
85333 license.forEach(function (_ref5) {
85334 var name = _ref5.name,
85335 version = _ref5.version,
85336 url = _ref5.url,
85337 vendorUrl = _ref5.vendorUrl,
85338 vendorName = _ref5.vendorName;
85339
85340 body.push([name, version, licenseKey, url || 'Unknown', vendorUrl || 'Unknown', vendorName || 'Unknown']);
85341 });
85342 });
85343
85344 reporter.table(['Name', 'Version', 'License', 'URL', 'VendorUrl', 'VendorName'], body);
85345 } else {
85346 var trees = [];
85347
85348 manifestsByLicense.forEach(function (license, licenseKey) {
85349 var licenseTree = [];
85350
85351 license.forEach(function (_ref6) {
85352 var name = _ref6.name,
85353 version = _ref6.version,
85354 url = _ref6.url,
85355 vendorUrl = _ref6.vendorUrl,
85356 vendorName = _ref6.vendorName;
85357
85358 var children = [];
85359
85360 if (url) {
85361 children.push({ name: `${reporter.format.bold('URL:')} ${url}` });
85362 }
85363
85364 if (vendorUrl) {
85365 children.push({ name: `${reporter.format.bold('VendorUrl:')} ${vendorUrl}` });
85366 }
85367
85368 if (vendorName) {
85369 children.push({ name: `${reporter.format.bold('VendorName:')} ${vendorName}` });
85370 }
85371
85372 licenseTree.push({
85373 name: `${name}@${version}`,
85374 children
85375 });
85376 });
85377
85378 trees.push({
85379 name: licenseKey,
85380 children: licenseTree
85381 });
85382 });
85383
85384 reporter.tree('licenses', trees, { force: true });
85385 }
85386 });
85387
85388 return function list(_x3, _x4, _x5, _x6) {
85389 return _ref2.apply(this, arguments);
85390 };
85391}();
85392
85393exports.hasWrapper = hasWrapper;
85394exports.setFlags = setFlags;
85395
85396var _baseReporter;
85397
85398function _load_baseReporter() {
85399 return _baseReporter = _interopRequireDefault(__webpack_require__(98));
85400}
85401
85402var _install;
85403
85404function _load_install() {
85405 return _install = __webpack_require__(41);
85406}
85407
85408var _lockfile;
85409
85410function _load_lockfile() {
85411 return _lockfile = _interopRequireDefault(__webpack_require__(25));
85412}
85413
85414var _buildSubCommands2;
85415
85416function _load_buildSubCommands() {
85417 return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
85418}
85419
85420function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
85421
85422var invariant = __webpack_require__(15);
85423
85424function hasWrapper(flags, args) {
85425 return args[0] != 'generate-disclaimer';
85426}
85427
85428function setFlags(commander) {
85429 commander.description('Lists licenses for installed packages.');
85430}
85431
85432var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('licenses', {
85433 ls(config, reporter, flags, args) {
85434 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
85435 reporter.warn(`\`yarn licenses ls\` is deprecated. Please use \`yarn licenses list\`.`);
85436 yield list(config, reporter, flags, args);
85437 })();
85438 },
85439
85440 list(config, reporter, flags, args) {
85441 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
85442 yield list(config, reporter, flags, args);
85443 })();
85444 },
85445
85446 generateDisclaimer(config, reporter, flags, args) {
85447 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
85448 /* eslint-disable no-console */
85449
85450 // `reporter.log` dumps a bunch of ANSI escapes to clear the current line and
85451 // is for abstracting the console output so it can be consumed by other tools
85452 // (JSON output being the primary one). This command is only for text consumption
85453 // and you should just be dumping it to a TXT file. Using a reporter here has the
85454 // potential to mess up the output since it might print ansi escapes.
85455 var manifests = yield getManifests(config, flags);
85456 var manifest = yield config.readRootManifest();
85457
85458 // Create a map of license text to manifest so that packages with exactly
85459 // the same license text are grouped together.
85460 var manifestsByLicense = new (_map || _load_map()).default();
85461 for (var _iterator2 = manifests, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
85462 var _ref7;
85463
85464 if (_isArray2) {
85465 if (_i2 >= _iterator2.length) break;
85466 _ref7 = _iterator2[_i2++];
85467 } else {
85468 _i2 = _iterator2.next();
85469 if (_i2.done) break;
85470 _ref7 = _i2.value;
85471 }
85472
85473 var _manifest = _ref7;
85474 var licenseText = _manifest.licenseText,
85475 noticeText = _manifest.noticeText;
85476
85477 var licenseKey = void 0;
85478 if (!licenseText) {
85479 continue;
85480 }
85481
85482 if (!noticeText) {
85483 licenseKey = licenseText;
85484 } else {
85485 licenseKey = `${licenseText}\n\nNOTICE\n\n${noticeText}`;
85486 }
85487
85488 if (!manifestsByLicense.has(licenseKey)) {
85489 manifestsByLicense.set(licenseKey, new (_map || _load_map()).default());
85490 }
85491
85492 var byLicense = manifestsByLicense.get(licenseKey);
85493 invariant(byLicense, 'expected value');
85494 byLicense.set(_manifest.name, _manifest);
85495 }
85496
85497 console.log('THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED ' + `IN PORTIONS OF THE ${String(manifest.name).toUpperCase().replace(/-/g, ' ')} PRODUCT.`);
85498 console.log();
85499
85500 for (var _iterator3 = manifestsByLicense, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
85501 var _ref9;
85502
85503 if (_isArray3) {
85504 if (_i3 >= _iterator3.length) break;
85505 _ref9 = _iterator3[_i3++];
85506 } else {
85507 _i3 = _iterator3.next();
85508 if (_i3.done) break;
85509 _ref9 = _i3.value;
85510 }
85511
85512 var _ref8 = _ref9;
85513 var licenseKey = _ref8[0];
85514 var _manifests = _ref8[1];
85515
85516 console.log('-----');
85517 console.log();
85518
85519 var names = [];
85520 var urls = [];
85521 for (var _iterator4 = _manifests, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
85522 var _ref11;
85523
85524 if (_isArray4) {
85525 if (_i4 >= _iterator4.length) break;
85526 _ref11 = _iterator4[_i4++];
85527 } else {
85528 _i4 = _iterator4.next();
85529 if (_i4.done) break;
85530 _ref11 = _i4.value;
85531 }
85532
85533 var _ref10 = _ref11;
85534 var name = _ref10[0];
85535 var repository = _ref10[1].repository;
85536
85537 names.push(name);
85538 if (repository && repository.url) {
85539 urls.push(_manifests.size === 1 ? repository.url : `${repository.url} (${name})`);
85540 }
85541 }
85542
85543 var heading = [];
85544 heading.push(`The following software may be included in this product: ${names.join(', ')}.`);
85545 if (urls.length > 0) {
85546 heading.push(`A copy of the source code may be downloaded from ${urls.join(', ')}.`);
85547 }
85548 heading.push('This software contains the following license and notice below:');
85549
85550 console.log(heading.join(' '));
85551 console.log();
85552
85553 if (licenseKey) {
85554 console.log(licenseKey.trim());
85555 } else {
85556 // what do we do here? base it on `license`?
85557 }
85558
85559 console.log();
85560 }
85561 })();
85562 }
85563}),
85564 run = _buildSubCommands.run,
85565 examples = _buildSubCommands.examples;
85566
85567exports.run = run;
85568exports.examples = examples;
85569
85570/***/ }),
85571/* 491 */
85572/***/ (function(module, exports, __webpack_require__) {
85573
85574"use strict";
85575
85576
85577Object.defineProperty(exports, "__esModule", {
85578 value: true
85579});
85580exports.run = undefined;
85581
85582var _asyncToGenerator2;
85583
85584function _load_asyncToGenerator() {
85585 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
85586}
85587
85588var run = exports.run = function () {
85589 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
85590 yield config.registries.yarn.saveHomeConfig({
85591 username: undefined,
85592 email: undefined
85593 });
85594
85595 reporter.success(reporter.lang('clearedCredentials'));
85596 });
85597
85598 return function run(_x, _x2, _x3, _x4) {
85599 return _ref.apply(this, arguments);
85600 };
85601}();
85602
85603exports.setFlags = setFlags;
85604exports.hasWrapper = hasWrapper;
85605
85606function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
85607
85608function setFlags(commander) {
85609 commander.description('Clears registry username and email.');
85610}
85611
85612function hasWrapper(commander, args) {
85613 return true;
85614}
85615
85616/***/ }),
85617/* 492 */
85618/***/ (function(module, exports, __webpack_require__) {
85619
85620"use strict";
85621
85622
85623Object.defineProperty(exports, "__esModule", {
85624 value: true
85625});
85626exports.run = undefined;
85627
85628var _extends2;
85629
85630function _load_extends() {
85631 return _extends2 = _interopRequireDefault(__webpack_require__(24));
85632}
85633
85634var _asyncToGenerator2;
85635
85636function _load_asyncToGenerator() {
85637 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
85638}
85639
85640var run = exports.run = function () {
85641 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
85642 var pnpPath = `${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`;
85643
85644 var nodeOptions = process.env.NODE_OPTIONS || '';
85645 if (yield (_fs || _load_fs()).exists(pnpPath)) {
85646 nodeOptions = `--require ${pnpPath} ${nodeOptions}`;
85647 }
85648
85649 try {
85650 yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, args, {
85651 stdio: 'inherit',
85652 cwd: flags.into || config.cwd,
85653 env: (0, (_extends2 || _load_extends()).default)({}, process.env, { NODE_OPTIONS: nodeOptions })
85654 });
85655 } catch (err) {
85656 throw err;
85657 }
85658 });
85659
85660 return function run(_x, _x2, _x3, _x4) {
85661 return _ref.apply(this, arguments);
85662 };
85663}();
85664
85665exports.setFlags = setFlags;
85666exports.hasWrapper = hasWrapper;
85667
85668var _child;
85669
85670function _load_child() {
85671 return _child = _interopRequireWildcard(__webpack_require__(57));
85672}
85673
85674var _fs;
85675
85676function _load_fs() {
85677 return _fs = _interopRequireWildcard(__webpack_require__(8));
85678}
85679
85680var _constants;
85681
85682function _load_constants() {
85683 return _constants = __webpack_require__(13);
85684}
85685
85686function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
85687
85688function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
85689
85690function setFlags(commander) {
85691 commander.description('Runs Node with the same version that the one used by Yarn itself, and by default from the project root');
85692 commander.usage('node [--into PATH] [... args]');
85693 commander.option('--into <path>', 'Sets the cwd to the specified location');
85694}
85695
85696function hasWrapper(commander, args) {
85697 return true;
85698}
85699
85700/***/ }),
85701/* 493 */
85702/***/ (function(module, exports, __webpack_require__) {
85703
85704"use strict";
85705
85706
85707Object.defineProperty(exports, "__esModule", {
85708 value: true
85709});
85710exports.run = exports.requireLockfile = undefined;
85711
85712var _set;
85713
85714function _load_set() {
85715 return _set = _interopRequireDefault(__webpack_require__(16));
85716}
85717
85718var _extends2;
85719
85720function _load_extends() {
85721 return _extends2 = _interopRequireDefault(__webpack_require__(24));
85722}
85723
85724var _asyncToGenerator2;
85725
85726function _load_asyncToGenerator() {
85727 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
85728}
85729
85730var run = exports.run = function () {
85731 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
85732 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder);
85733 var install = new (_install || _load_install()).Install((0, (_extends2 || _load_extends()).default)({}, flags, { includeWorkspaceDeps: true }), config, reporter, lockfile);
85734 var deps = yield (_packageRequest || _load_packageRequest()).default.getOutdatedPackages(lockfile, install, config, reporter);
85735
85736 if (args.length) {
85737 var requested = new (_set || _load_set()).default(args);
85738
85739 deps = deps.filter(function (_ref2) {
85740 var name = _ref2.name;
85741 return requested.has(name);
85742 });
85743 }
85744
85745 var getNameFromHint = function getNameFromHint(hint) {
85746 return hint ? `${hint}Dependencies` : 'dependencies';
85747 };
85748 var colorizeName = function colorizeName(_ref3) {
85749 var current = _ref3.current,
85750 latest = _ref3.latest,
85751 name = _ref3.name;
85752 return reporter.format[(0, (_colorForVersions || _load_colorForVersions()).default)(current, latest)](name);
85753 };
85754
85755 if (deps.length) {
85756 var usesWorkspaces = !!config.workspaceRootFolder;
85757 var body = deps.map(function (info) {
85758 var row = [colorizeName(info), info.current, (0, (_colorizeDiff || _load_colorizeDiff()).default)(info.current, info.wanted, reporter), reporter.format.cyan(info.latest), info.workspaceName || '', getNameFromHint(info.hint), reporter.format.cyan(info.url)];
85759 if (!usesWorkspaces) {
85760 row.splice(4, 1);
85761 }
85762 return row;
85763 });
85764
85765 var red = reporter.format.red('<red>');
85766 var yellow = reporter.format.yellow('<yellow>');
85767 var green = reporter.format.green('<green>');
85768 reporter.info(reporter.lang('legendColorsForVersionUpdates', red, yellow, green));
85769
85770 var header = ['Package', 'Current', 'Wanted', 'Latest', 'Workspace', 'Package Type', 'URL'];
85771 if (!usesWorkspaces) {
85772 header.splice(4, 1);
85773 }
85774 reporter.table(header, body);
85775
85776 return 1;
85777 }
85778 return 0;
85779 });
85780
85781 return function run(_x, _x2, _x3, _x4) {
85782 return _ref.apply(this, arguments);
85783 };
85784}();
85785
85786exports.setFlags = setFlags;
85787exports.hasWrapper = hasWrapper;
85788
85789var _packageRequest;
85790
85791function _load_packageRequest() {
85792 return _packageRequest = _interopRequireDefault(__webpack_require__(116));
85793}
85794
85795var _lockfile;
85796
85797function _load_lockfile() {
85798 return _lockfile = _interopRequireDefault(__webpack_require__(25));
85799}
85800
85801var _install;
85802
85803function _load_install() {
85804 return _install = __webpack_require__(41);
85805}
85806
85807var _colorForVersions;
85808
85809function _load_colorForVersions() {
85810 return _colorForVersions = _interopRequireDefault(__webpack_require__(306));
85811}
85812
85813var _colorizeDiff;
85814
85815function _load_colorizeDiff() {
85816 return _colorizeDiff = _interopRequireDefault(__webpack_require__(307));
85817}
85818
85819function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
85820
85821var requireLockfile = exports.requireLockfile = true;
85822
85823function setFlags(commander) {
85824 commander.description('Checks for outdated package dependencies.');
85825 commander.usage('outdated [packages ...]');
85826}
85827
85828function hasWrapper(commander, args) {
85829 return true;
85830}
85831
85832/***/ }),
85833/* 494 */
85834/***/ (function(module, exports, __webpack_require__) {
85835
85836"use strict";
85837
85838
85839Object.defineProperty(exports, "__esModule", {
85840 value: true
85841});
85842exports.examples = exports.hasWrapper = exports.run = exports.mutate = undefined;
85843
85844var _getIterator2;
85845
85846function _load_getIterator() {
85847 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
85848}
85849
85850var _asyncToGenerator2;
85851
85852function _load_asyncToGenerator() {
85853 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
85854}
85855
85856var mutate = exports.mutate = function () {
85857 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (args, config, reporter, buildMessages, mutator) {
85858 if (args.length !== 2 && args.length !== 1) {
85859 return false;
85860 }
85861
85862 var username = args.shift();
85863 var name = yield (0, (_tag || _load_tag()).getName)(args, config);
85864 if (!(0, (_validate || _load_validate()).isValidPackageName)(name)) {
85865 throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName'));
85866 }
85867
85868 var msgs = buildMessages(username, name);
85869 reporter.step(1, 3, reporter.lang('loggingIn'));
85870 var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name);
85871
85872 reporter.step(2, 3, msgs.info);
85873 var user = yield config.registries.npm.request(`-/user/org.couchdb.user:${username}`);
85874 var error = false;
85875 if (user) {
85876 // get package
85877 var _pkg = yield config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(name));
85878 if (_pkg) {
85879 _pkg.maintainers = _pkg.maintainers || [];
85880 error = mutator({ name: user.name, email: user.email }, _pkg);
85881 } else {
85882 error = true;
85883 reporter.error(reporter.lang('unknownPackage', name));
85884 }
85885
85886 // update package
85887 if (_pkg && !error) {
85888 var res = yield config.registries.npm.request(`${(_npmRegistry || _load_npmRegistry()).default.escapeName(name)}/-rev/${_pkg._rev}`, {
85889 method: 'PUT',
85890 body: {
85891 _id: _pkg._id,
85892 _rev: _pkg._rev,
85893 maintainers: _pkg.maintainers
85894 }
85895 });
85896
85897 if (res != null && res.success) {
85898 reporter.success(msgs.success);
85899 } else {
85900 error = true;
85901 reporter.error(msgs.error);
85902 }
85903 }
85904 } else {
85905 error = true;
85906 reporter.error(reporter.lang('unknownUser', username));
85907 }
85908
85909 reporter.step(3, 3, reporter.lang('revokingToken'));
85910 yield revoke();
85911
85912 if (error) {
85913 throw new Error();
85914 } else {
85915 return true;
85916 }
85917 });
85918
85919 return function mutate(_x, _x2, _x3, _x4, _x5) {
85920 return _ref.apply(this, arguments);
85921 };
85922}();
85923
85924var list = function () {
85925 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
85926 if (args.length > 1) {
85927 return false;
85928 }
85929 var name = yield (0, (_tag || _load_tag()).getName)(args, config);
85930 reporter.step(1, 1, reporter.lang('ownerGetting', name));
85931 var pkg = yield config.registries.npm.request(name, { unfiltered: true });
85932 if (pkg) {
85933 var owners = pkg.maintainers;
85934 if (!owners || !owners.length) {
85935 reporter.warn(reporter.lang('ownerNone'));
85936 } else {
85937 for (var _iterator = owners, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
85938 var _ref3;
85939
85940 if (_isArray) {
85941 if (_i >= _iterator.length) break;
85942 _ref3 = _iterator[_i++];
85943 } else {
85944 _i = _iterator.next();
85945 if (_i.done) break;
85946 _ref3 = _i.value;
85947 }
85948
85949 var owner = _ref3;
85950
85951 reporter.info(`${owner.name} <${owner.email}>`);
85952 }
85953 }
85954 } else {
85955 reporter.error(reporter.lang('ownerGettingFailed'));
85956 }
85957
85958 if (pkg) {
85959 return true;
85960 } else {
85961 throw new Error();
85962 }
85963 });
85964
85965 return function list(_x6, _x7, _x8, _x9) {
85966 return _ref2.apply(this, arguments);
85967 };
85968}();
85969
85970exports.setFlags = setFlags;
85971
85972var _errors;
85973
85974function _load_errors() {
85975 return _errors = __webpack_require__(6);
85976}
85977
85978var _buildSubCommands2;
85979
85980function _load_buildSubCommands() {
85981 return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
85982}
85983
85984var _validate;
85985
85986function _load_validate() {
85987 return _validate = __webpack_require__(119);
85988}
85989
85990var _tag;
85991
85992function _load_tag() {
85993 return _tag = __webpack_require__(297);
85994}
85995
85996var _login;
85997
85998function _load_login() {
85999 return _login = __webpack_require__(97);
86000}
86001
86002var _npmRegistry;
86003
86004function _load_npmRegistry() {
86005 return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
86006}
86007
86008function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
86009
86010function remove(config, reporter, flags, args) {
86011 return mutate(args, config, reporter, function (username, name) {
86012 return {
86013 info: reporter.lang('ownerRemoving', username, name),
86014 success: reporter.lang('ownerRemoved'),
86015 error: reporter.lang('ownerRemoveError')
86016 };
86017 }, function (user, pkg) {
86018 var found = false;
86019
86020 pkg.maintainers = pkg.maintainers.filter(function (o) {
86021 var match = o.name === user.name;
86022 found = found || match;
86023 return !match;
86024 });
86025
86026 if (!found) {
86027 reporter.error(reporter.lang('userNotAnOwner', user.name));
86028 }
86029
86030 return found;
86031 });
86032}
86033
86034function setFlags(commander) {
86035 commander.description('Manages package owners.');
86036}
86037
86038var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('owner', {
86039 add(config, reporter, flags, args) {
86040 return mutate(args, config, reporter, function (username, name) {
86041 return {
86042 info: reporter.lang('ownerAdding', username, name),
86043 success: reporter.lang('ownerAdded'),
86044 error: reporter.lang('ownerAddingFailed')
86045 };
86046 }, function (user, pkg) {
86047 for (var _iterator2 = pkg.maintainers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
86048 var _ref4;
86049
86050 if (_isArray2) {
86051 if (_i2 >= _iterator2.length) break;
86052 _ref4 = _iterator2[_i2++];
86053 } else {
86054 _i2 = _iterator2.next();
86055 if (_i2.done) break;
86056 _ref4 = _i2.value;
86057 }
86058
86059 var owner = _ref4;
86060
86061 if (owner.name === user) {
86062 reporter.error(reporter.lang('ownerAlready'));
86063 return true;
86064 }
86065 }
86066
86067 pkg.maintainers.push(user);
86068
86069 return false;
86070 });
86071 },
86072
86073 rm(config, reporter, flags, args) {
86074 reporter.warn(`\`yarn owner rm\` is deprecated. Please use \`yarn owner remove\`.`);
86075 return remove(config, reporter, flags, args);
86076 },
86077
86078 remove(config, reporter, flags, args) {
86079 return remove(config, reporter, flags, args);
86080 },
86081
86082 ls(config, reporter, flags, args) {
86083 reporter.warn(`\`yarn owner ls\` is deprecated. Please use \`yarn owner list\`.`);
86084 return list(config, reporter, flags, args);
86085 },
86086
86087 list(config, reporter, flags, args) {
86088 return list(config, reporter, flags, args);
86089 }
86090}, ['add <user> [[<@scope>/]<pkg>]', 'remove <user> [[<@scope>/]<pkg>]', 'list [<@scope>/]<pkg>']),
86091 run = _buildSubCommands.run,
86092 hasWrapper = _buildSubCommands.hasWrapper,
86093 examples = _buildSubCommands.examples;
86094
86095exports.run = run;
86096exports.hasWrapper = hasWrapper;
86097exports.examples = examples;
86098
86099/***/ }),
86100/* 495 */
86101/***/ (function(module, exports, __webpack_require__) {
86102
86103"use strict";
86104
86105
86106Object.defineProperty(exports, "__esModule", {
86107 value: true
86108});
86109exports.examples = exports.setFlags = exports.run = undefined;
86110
86111var _stringify;
86112
86113function _load_stringify() {
86114 return _stringify = _interopRequireDefault(__webpack_require__(36));
86115}
86116
86117var _extends2;
86118
86119function _load_extends() {
86120 return _extends2 = _interopRequireDefault(__webpack_require__(24));
86121}
86122
86123var _asyncToGenerator2;
86124
86125function _load_asyncToGenerator() {
86126 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
86127}
86128
86129var fetchReleases = function () {
86130 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
86131 var _ref2 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
86132 _ref2$includePrerelea = _ref2.includePrereleases,
86133 includePrereleases = _ref2$includePrerelea === undefined ? false : _ref2$includePrerelea;
86134
86135 var token = process.env.GITHUB_TOKEN;
86136 var tokenUrlParameter = token ? `?access_token=${token}` : '';
86137
86138 var request = yield config.requestManager.request({
86139 url: `https://api.github.com/repos/yarnpkg/yarn/releases${tokenUrlParameter}`,
86140 json: true
86141 });
86142
86143 var releases = request.filter(function (release) {
86144 if (release.draft) {
86145 return false;
86146 }
86147
86148 if (release.prerelease && !includePrereleases) {
86149 return false;
86150 }
86151
86152 // $FlowFixMe
86153 release.version = semver.coerce(release.tag_name);
86154
86155 if (!release.version) {
86156 return false;
86157 }
86158
86159 if (!getBundleAsset(release)) {
86160 return false;
86161 }
86162
86163 return true;
86164 });
86165
86166 releases.sort(function (a, b) {
86167 // $FlowFixMe
86168 return -semver.compare(a.version, b.version);
86169 });
86170
86171 return releases;
86172 });
86173
86174 return function fetchReleases(_x) {
86175 return _ref.apply(this, arguments);
86176 };
86177}();
86178
86179exports.hasWrapper = hasWrapper;
86180
86181var _yarnVersion;
86182
86183function _load_yarnVersion() {
86184 return _yarnVersion = __webpack_require__(96);
86185}
86186
86187var _child;
86188
86189function _load_child() {
86190 return _child = _interopRequireWildcard(__webpack_require__(57));
86191}
86192
86193var _buildSubCommands2;
86194
86195function _load_buildSubCommands() {
86196 return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
86197}
86198
86199var _rc;
86200
86201function _load_rc() {
86202 return _rc = __webpack_require__(274);
86203}
86204
86205var _fs;
86206
86207function _load_fs() {
86208 return _fs = _interopRequireWildcard(__webpack_require__(8));
86209}
86210
86211var _lockfile;
86212
86213function _load_lockfile() {
86214 return _lockfile = __webpack_require__(25);
86215}
86216
86217var _semver;
86218
86219function _load_semver() {
86220 return _semver = __webpack_require__(160);
86221}
86222
86223var _constants;
86224
86225function _load_constants() {
86226 return _constants = __webpack_require__(13);
86227}
86228
86229function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
86230
86231function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
86232
86233/* eslint-disable max-len */
86234
86235var V2_NAMES = ['stable', 'berry', 'stable', 'canary', 'v2', '2'];
86236
86237var isLocalFile = function isLocalFile(version) {
86238 return version.match(/^\.{0,2}[\\/]/) || path.isAbsolute(version);
86239};
86240var isV2Version = function isV2Version(version) {
86241 return (0, (_semver || _load_semver()).satisfiesWithPrereleases)(version, '>=2.0.0');
86242};
86243
86244var chalk = __webpack_require__(37);
86245var invariant = __webpack_require__(15);
86246var path = __webpack_require__(1);
86247var semver = __webpack_require__(27);
86248
86249function getBundleAsset(release) {
86250 return release.assets.find(function (asset) {
86251 return asset.name.match(/^yarn-[0-9]+\.[0-9]+\.[0-9]+\.js$/);
86252 });
86253}
86254
86255function fetchBundle(config, url) {
86256 return config.requestManager.request({
86257 url,
86258 buffer: true
86259 });
86260}
86261
86262function hasWrapper(flags, args) {
86263 return false;
86264}
86265
86266var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('policies', {
86267 setVersion(config, reporter, flags, args) {
86268 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
86269 var initialRange = args[0] || 'latest';
86270 var range = initialRange;
86271
86272 var allowRc = flags.rc;
86273
86274 if (range === 'rc') {
86275 reporter.log(`${chalk.yellow(`Warning:`)} Your current Yarn binary is currently Yarn ${(_yarnVersion || _load_yarnVersion()).version}; to avoid potential breaking changes, 'set version rc' won't receive upgrades past the 1.22.x branch.\n To upgrade to the latest versions, run ${chalk.cyan(`yarn set version`)} ${chalk.yellow.underline(`canary`)} instead. Sorry for the inconvenience.\n`);
86276
86277 range = '*';
86278 allowRc = true;
86279 }
86280
86281 if (range === 'latest') {
86282 reporter.log(`${chalk.yellow(`Warning:`)} Your current Yarn binary is currently Yarn ${(_yarnVersion || _load_yarnVersion()).version}; to avoid potential breaking changes, 'set version latest' won't receive upgrades past the 1.22.x branch.\n To upgrade to the latest versions, run ${chalk.cyan(`yarn set version`)} ${chalk.yellow.underline(`stable`)} instead. Sorry for the inconvenience.\n`);
86283
86284 range = '*';
86285 }
86286
86287 if (range === 'classic') {
86288 range = '*';
86289 }
86290
86291 var bundleUrl = void 0;
86292 var bundleVersion = void 0;
86293 var isV2 = false;
86294
86295 if (range === 'nightly' || range === 'nightlies') {
86296 reporter.log(`${chalk.yellow(`Warning:`)} Nightlies only exist for Yarn 1.x; starting from 2.x onwards, you should use 'canary' instead`);
86297
86298 bundleUrl = 'https://nightly.yarnpkg.com/latest.js';
86299 bundleVersion = 'nightly';
86300 } else if (V2_NAMES.indexOf(range) !== -1 || isLocalFile(range) || isV2Version(range)) {
86301 var normalizedRange = range === `canary` ? `canary` : `stable`;
86302
86303 if (process.env.COREPACK_ROOT) {
86304 yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [path.join(process.env.COREPACK_ROOT, 'dist/corepack.js'), `yarn@${normalizedRange}`, `set`, `version`, normalizedRange], {
86305 stdio: 'inherit',
86306 cwd: config.cwd
86307 });
86308
86309 return;
86310 } else {
86311 var _bundle = yield fetchBundle(config, 'https://github.com/yarnpkg/berry/raw/master/packages/yarnpkg-cli/bin/yarn.js');
86312
86313 var _yarnPath = path.resolve(config.lockfileFolder, `.yarn/releases/yarn-stable-temp.cjs`);
86314 yield (_fs || _load_fs()).mkdirp(path.dirname(_yarnPath));
86315 yield (_fs || _load_fs()).writeFile(_yarnPath, _bundle);
86316 yield (_fs || _load_fs()).chmod(_yarnPath, 0o755);
86317
86318 try {
86319 yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [_yarnPath, 'set', 'version', range], {
86320 stdio: 'inherit',
86321 cwd: config.lockfileFolder,
86322 env: (0, (_extends2 || _load_extends()).default)({}, process.env, {
86323 YARN_IGNORE_PATH: `1`
86324 })
86325 });
86326 } catch (err) {
86327 // eslint-disable-next-line no-process-exit
86328 process.exit(1);
86329 }
86330
86331 return;
86332 }
86333 } else {
86334 reporter.log(`Resolving ${chalk.yellow(initialRange)} to a url...`);
86335
86336 var releases = [];
86337
86338 try {
86339 releases = yield fetchReleases(config, {
86340 includePrereleases: allowRc
86341 });
86342 } catch (e) {
86343 reporter.error(e.message);
86344 return;
86345 }
86346
86347 var release = releases.find(function (release) {
86348 // $FlowFixMe
86349 return semver.satisfies(release.version, range);
86350 });
86351
86352 if (!release) {
86353 throw new Error(`Release not found: ${range}`);
86354 }
86355
86356 var asset = getBundleAsset(release);
86357 invariant(asset, 'The bundle asset should exist');
86358
86359 bundleUrl = asset.browser_download_url;
86360 bundleVersion = release.version.version;
86361 }
86362
86363 reporter.log(`Downloading ${chalk.green(bundleUrl)}...`);
86364
86365 var bundle = yield fetchBundle(config, bundleUrl);
86366
86367 var yarnPath = path.resolve(config.lockfileFolder, `.yarn/releases/yarn-${bundleVersion}.cjs`);
86368 reporter.log(`Saving it into ${chalk.magenta(yarnPath)}...`);
86369 yield (_fs || _load_fs()).mkdirp(path.dirname(yarnPath));
86370 yield (_fs || _load_fs()).writeFile(yarnPath, bundle);
86371 yield (_fs || _load_fs()).chmod(yarnPath, 0o755);
86372
86373 var targetPath = path.relative(config.lockfileFolder, yarnPath).replace(/\\/g, '/');
86374
86375 if (isV2) {
86376 var rcPath = `${config.lockfileFolder}/.yarnrc.yml`;
86377 reporter.log(`Updating ${chalk.magenta(rcPath)}...`);
86378
86379 yield (_fs || _load_fs()).writeFilePreservingEol(rcPath, `yarnPath: ${(0, (_stringify || _load_stringify()).default)(targetPath)}\n`);
86380 } else {
86381 var _rcPath = `${config.lockfileFolder}/.yarnrc`;
86382 reporter.log(`Updating ${chalk.magenta(_rcPath)}...`);
86383
86384 var rc = (0, (_rc || _load_rc()).getRcConfigForFolder)(config.lockfileFolder);
86385 rc['yarn-path'] = targetPath;
86386
86387 yield (_fs || _load_fs()).writeFilePreservingEol(_rcPath, `${(0, (_lockfile || _load_lockfile()).stringify)(rc)}\n`);
86388 }
86389
86390 reporter.log(`Done!`);
86391 })();
86392 }
86393}),
86394 run = _buildSubCommands.run,
86395 setFlags = _buildSubCommands.setFlags,
86396 examples = _buildSubCommands.examples;
86397
86398exports.run = run;
86399exports.setFlags = setFlags;
86400exports.examples = examples;
86401
86402/***/ }),
86403/* 496 */
86404/***/ (function(module, exports, __webpack_require__) {
86405
86406"use strict";
86407
86408
86409Object.defineProperty(exports, "__esModule", {
86410 value: true
86411});
86412exports.run = undefined;
86413
86414var _assign;
86415
86416function _load_assign() {
86417 return _assign = _interopRequireDefault(__webpack_require__(23));
86418}
86419
86420var _promise;
86421
86422function _load_promise() {
86423 return _promise = _interopRequireDefault(__webpack_require__(7));
86424}
86425
86426var _asyncToGenerator2;
86427
86428function _load_asyncToGenerator() {
86429 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
86430}
86431
86432var publish = function () {
86433 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, pkg, flags, dir) {
86434 var access = flags.access;
86435
86436 // if no access level is provided, check package.json for `publishConfig.access`
86437 // see: https://docs.npmjs.com/files/package.json#publishconfig
86438 if (!access && pkg && pkg.publishConfig && pkg.publishConfig.access) {
86439 access = pkg.publishConfig.access;
86440 }
86441
86442 // validate access argument
86443 if (access && access !== 'public' && access !== 'restricted') {
86444 throw new (_errors || _load_errors()).MessageError(config.reporter.lang('invalidAccess'));
86445 }
86446
86447 // TODO this might modify package.json, do we need to reload it?
86448 yield config.executeLifecycleScript('prepublish');
86449 yield config.executeLifecycleScript('prepare');
86450 yield config.executeLifecycleScript('prepublishOnly');
86451 yield config.executeLifecycleScript('prepack');
86452
86453 // get tarball stream
86454 var stat = yield (_fs || _load_fs()).lstat(dir);
86455 var stream = void 0;
86456 if (stat.isDirectory()) {
86457 stream = yield (0, (_pack || _load_pack()).pack)(config);
86458 } else if (stat.isFile()) {
86459 stream = fs2.createReadStream(dir);
86460 } else {
86461 throw new Error("Don't know how to handle this file type");
86462 }
86463 var buffer = yield new (_promise || _load_promise()).default(function (resolve, reject) {
86464 var data = [];
86465 invariant(stream, 'expected stream');
86466 stream.on('data', data.push.bind(data)).on('end', function () {
86467 return resolve(Buffer.concat(data));
86468 }).on('error', reject);
86469 });
86470
86471 yield config.executeLifecycleScript('postpack');
86472
86473 // copy normalized package and remove internal keys as they may be sensitive or yarn specific
86474 pkg = (0, (_assign || _load_assign()).default)({}, pkg);
86475 for (var key in pkg) {
86476 if (key[0] === '_') {
86477 delete pkg[key];
86478 }
86479 }
86480
86481 var tag = flags.tag || 'latest';
86482 var tbName = `${pkg.name}-${pkg.version}.tgz`;
86483 var tbURI = `${pkg.name}/-/${tbName}`;
86484
86485 // create body
86486 var root = {
86487 _id: pkg.name,
86488 access,
86489 name: pkg.name,
86490 description: pkg.description,
86491 'dist-tags': {
86492 [tag]: pkg.version
86493 },
86494 versions: {
86495 [pkg.version]: pkg
86496 },
86497 readme: pkg.readme || '',
86498 _attachments: {
86499 [tbName]: {
86500 content_type: 'application/octet-stream',
86501 data: buffer.toString('base64'),
86502 length: buffer.length
86503 }
86504 }
86505 };
86506
86507 pkg._id = `${pkg.name}@${pkg.version}`;
86508 pkg.dist = pkg.dist || {};
86509 pkg.dist.shasum = crypto.createHash('sha1').update(buffer).digest('hex');
86510 pkg.dist.integrity = ssri.fromData(buffer).toString();
86511
86512 var registry = String(config.getOption('registry'));
86513 pkg.dist.tarball = url.resolve(registry, tbURI).replace(/^https:\/\//, 'http://');
86514
86515 // publish package
86516 try {
86517 yield config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(pkg.name), {
86518 registry: pkg && pkg.publishConfig && pkg.publishConfig.registry,
86519 method: 'PUT',
86520 body: root
86521 });
86522 } catch (error) {
86523 throw new (_errors || _load_errors()).MessageError(config.reporter.lang('publishFail', error.message));
86524 }
86525
86526 yield config.executeLifecycleScript('publish');
86527 yield config.executeLifecycleScript('postpublish');
86528 });
86529
86530 return function publish(_x, _x2, _x3, _x4) {
86531 return _ref.apply(this, arguments);
86532 };
86533}();
86534
86535var run = exports.run = function () {
86536 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
86537 // validate arguments
86538 var dir = args[0] ? (_path || _load_path()).default.resolve(config.cwd, args[0]) : config.cwd;
86539 if (args.length > 1) {
86540 throw new (_errors || _load_errors()).MessageError(reporter.lang('tooManyArguments', 1));
86541 }
86542 if (!(yield (_fs || _load_fs()).exists(dir))) {
86543 throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownFolderOrTarball'));
86544 }
86545
86546 var stat = yield (_fs || _load_fs()).lstat(dir);
86547 var publishPath = dir;
86548 if (stat.isDirectory()) {
86549 config.cwd = (_path || _load_path()).default.resolve(dir);
86550 publishPath = config.cwd;
86551 }
86552
86553 // validate package fields that are required for publishing
86554 // $FlowFixMe
86555 var pkg = yield config.readRootManifest();
86556 if (pkg.private) {
86557 throw new (_errors || _load_errors()).MessageError(reporter.lang('publishPrivate'));
86558 }
86559 if (!pkg.name) {
86560 throw new (_errors || _load_errors()).MessageError(reporter.lang('noName'));
86561 }
86562
86563 var registry = '';
86564
86565 if (pkg && pkg.publishConfig && pkg.publishConfig.registry) {
86566 registry = pkg.publishConfig.registry;
86567 }
86568
86569 reporter.step(1, 4, reporter.lang('bumpingVersion'));
86570 var commitVersion = yield (0, (_version || _load_version()).setVersion)(config, reporter, flags, [], false);
86571
86572 //
86573 reporter.step(2, 4, reporter.lang('loggingIn'));
86574 var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, pkg.name, flags, registry);
86575
86576 //
86577 reporter.step(3, 4, reporter.lang('publishing'));
86578 yield publish(config, pkg, flags, publishPath);
86579 yield commitVersion();
86580 reporter.success(reporter.lang('published'));
86581
86582 //
86583 reporter.step(4, 4, reporter.lang('revokingToken'));
86584 yield revoke();
86585 });
86586
86587 return function run(_x5, _x6, _x7, _x8) {
86588 return _ref2.apply(this, arguments);
86589 };
86590}();
86591
86592exports.setFlags = setFlags;
86593exports.hasWrapper = hasWrapper;
86594
86595var _npmRegistry;
86596
86597function _load_npmRegistry() {
86598 return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
86599}
86600
86601var _errors;
86602
86603function _load_errors() {
86604 return _errors = __webpack_require__(6);
86605}
86606
86607var _version;
86608
86609function _load_version() {
86610 return _version = __webpack_require__(299);
86611}
86612
86613var _fs;
86614
86615function _load_fs() {
86616 return _fs = _interopRequireWildcard(__webpack_require__(8));
86617}
86618
86619var _pack;
86620
86621function _load_pack() {
86622 return _pack = __webpack_require__(155);
86623}
86624
86625var _login;
86626
86627function _load_login() {
86628 return _login = __webpack_require__(97);
86629}
86630
86631var _path;
86632
86633function _load_path() {
86634 return _path = _interopRequireDefault(__webpack_require__(1));
86635}
86636
86637function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
86638
86639function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
86640
86641var invariant = __webpack_require__(15);
86642
86643var crypto = __webpack_require__(21);
86644var url = __webpack_require__(29);
86645var fs2 = __webpack_require__(12);
86646var ssri = __webpack_require__(93);
86647
86648function setFlags(commander) {
86649 (0, (_version || _load_version()).setFlags)(commander);
86650 commander.description('Publishes a package to the npm registry.');
86651 commander.usage('publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>]');
86652 commander.option('--access [access]', 'access');
86653 commander.option('--tag [tag]', 'tag');
86654}
86655
86656function hasWrapper(commander, args) {
86657 return true;
86658}
86659
86660/***/ }),
86661/* 497 */
86662/***/ (function(module, exports, __webpack_require__) {
86663
86664"use strict";
86665
86666
86667Object.defineProperty(exports, "__esModule", {
86668 value: true
86669});
86670exports.examples = exports.hasWrapper = exports.run = undefined;
86671
86672var _extends2;
86673
86674function _load_extends() {
86675 return _extends2 = _interopRequireDefault(__webpack_require__(24));
86676}
86677
86678var _asyncToGenerator2;
86679
86680function _load_asyncToGenerator() {
86681 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
86682}
86683
86684var removeTeamUser = function () {
86685 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter) {
86686 reporter.step(2, 3, reporter.lang('teamRemovingUser'));
86687 reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user`, {
86688 method: 'DELETE',
86689 body: {
86690 user: parts.user
86691 }
86692 })));
86693 return true;
86694 });
86695
86696 return function removeTeamUser(_x6, _x7, _x8) {
86697 return _ref2.apply(this, arguments);
86698 };
86699}();
86700
86701var list = function () {
86702 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter) {
86703 reporter.step(2, 3, reporter.lang('teamListing'));
86704 var uriParams = '?format=cli';
86705 if (parts.team) {
86706 reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user${uriParams}`)));
86707 } else {
86708 reporter.inspect((yield config.registries.npm.request(`org/${parts.scope}/team${uriParams}`)));
86709 }
86710 return true;
86711 });
86712
86713 return function list(_x9, _x10, _x11) {
86714 return _ref3.apply(this, arguments);
86715 };
86716}();
86717
86718exports.setFlags = setFlags;
86719
86720var _buildSubCommands2;
86721
86722function _load_buildSubCommands() {
86723 return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
86724}
86725
86726var _login;
86727
86728function _load_login() {
86729 return _login = __webpack_require__(97);
86730}
86731
86732function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
86733
86734function explodeScopeTeam(arg, requireTeam, reporter) {
86735 var _arg$split = arg.split(':'),
86736 scope = _arg$split[0],
86737 team = _arg$split[1],
86738 parts = _arg$split.slice(2);
86739
86740 if (parts.length) {
86741 return false;
86742 }
86743
86744 if (requireTeam && !team) {
86745 return false;
86746 }
86747
86748 return {
86749 scope: scope || '',
86750 team: team || '',
86751 user: ''
86752 };
86753}
86754
86755function warnDeprecation(reporter, deprecationWarning) {
86756 var command = 'yarn team';
86757 reporter.warn(reporter.lang('deprecatedCommand', `${command} ${deprecationWarning.deprecatedCommand}`, `${command} ${deprecationWarning.currentCommand}`));
86758}
86759
86760function wrapRequired(callback, requireTeam, deprecationInfo) {
86761 return function () {
86762 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
86763 if (deprecationInfo) {
86764 warnDeprecation(reporter, deprecationInfo);
86765 }
86766
86767 if (!args.length) {
86768 return false;
86769 }
86770
86771 var parts = explodeScopeTeam(args[0], requireTeam, reporter);
86772 if (!parts) {
86773 return false;
86774 }
86775
86776 reporter.step(1, 3, reporter.lang('loggingIn'));
86777 var revoke = yield (0, (_login || _load_login()).getToken)(config, reporter);
86778
86779 var res = yield callback(parts, config, reporter, flags, args);
86780 if (!res) {
86781 return res;
86782 }
86783
86784 reporter.step(3, 3, reporter.lang('revokingToken'));
86785 yield revoke();
86786 return true;
86787 });
86788
86789 return function (_x, _x2, _x3, _x4) {
86790 return _ref.apply(this, arguments);
86791 };
86792 }();
86793}
86794
86795function wrapRequiredTeam(callback) {
86796 var requireTeam = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
86797 var subCommandDeprecated = arguments[2];
86798
86799 return wrapRequired(function (parts, config, reporter, flags, args) {
86800 if (args.length === 1) {
86801 return callback(parts, config, reporter, flags, args);
86802 } else {
86803 return false;
86804 }
86805 }, requireTeam, subCommandDeprecated);
86806}
86807
86808function wrapRequiredUser(callback, subCommandDeprecated) {
86809 return wrapRequired(function (parts, config, reporter, flags, args) {
86810 if (args.length === 2) {
86811 return callback((0, (_extends2 || _load_extends()).default)({
86812 user: args[1]
86813 }, parts), config, reporter, flags, args);
86814 } else {
86815 return false;
86816 }
86817 }, true, subCommandDeprecated);
86818}
86819
86820function setFlags(commander) {
86821 commander.description('Maintain team memberships');
86822}
86823
86824var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('team', {
86825 create: wrapRequiredTeam(function () {
86826 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) {
86827 reporter.step(2, 3, reporter.lang('teamCreating'));
86828 reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}`, {
86829 method: 'PUT',
86830 body: {
86831 team: parts.team
86832 }
86833 })));
86834 return true;
86835 });
86836
86837 return function (_x12, _x13, _x14, _x15, _x16) {
86838 return _ref4.apply(this, arguments);
86839 };
86840 }()),
86841
86842 destroy: wrapRequiredTeam(function () {
86843 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) {
86844 reporter.step(2, 3, reporter.lang('teamRemoving'));
86845 reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}`, {
86846 method: 'DELETE'
86847 })));
86848 return true;
86849 });
86850
86851 return function (_x17, _x18, _x19, _x20, _x21) {
86852 return _ref5.apply(this, arguments);
86853 };
86854 }()),
86855
86856 add: wrapRequiredUser(function () {
86857 var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) {
86858 reporter.step(2, 3, reporter.lang('teamAddingUser'));
86859 reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user`, {
86860 method: 'PUT',
86861 body: {
86862 user: parts.user
86863 }
86864 })));
86865 return true;
86866 });
86867
86868 return function (_x22, _x23, _x24, _x25, _x26) {
86869 return _ref6.apply(this, arguments);
86870 };
86871 }()),
86872
86873 rm: wrapRequiredUser(function (parts, config, reporter, flags, args) {
86874 removeTeamUser(parts, config, reporter);
86875 }, {
86876 deprecatedCommand: 'rm',
86877 currentCommand: 'remove'
86878 }),
86879
86880 remove: wrapRequiredUser(function (parts, config, reporter, flags, args) {
86881 removeTeamUser(parts, config, reporter);
86882 }),
86883
86884 ls: wrapRequiredTeam(function (parts, config, reporter, flags, args) {
86885 list(parts, config, reporter);
86886 }, false, {
86887 deprecatedCommand: 'ls',
86888 currentCommand: 'list'
86889 }),
86890
86891 list: wrapRequiredTeam(function (parts, config, reporter, flags, args) {
86892 list(parts, config, reporter);
86893 }, false)
86894}, ['create <scope:team>', 'destroy <scope:team>', 'add <scope:team> <user>', 'remove <scope:team> <user>', 'list <scope>|<scope:team>']),
86895 run = _buildSubCommands.run,
86896 hasWrapper = _buildSubCommands.hasWrapper,
86897 examples = _buildSubCommands.examples;
86898
86899exports.run = run;
86900exports.hasWrapper = hasWrapper;
86901exports.examples = examples;
86902
86903/***/ }),
86904/* 498 */
86905/***/ (function(module, exports, __webpack_require__) {
86906
86907"use strict";
86908
86909
86910Object.defineProperty(exports, "__esModule", {
86911 value: true
86912});
86913exports.run = undefined;
86914
86915var _getIterator2;
86916
86917function _load_getIterator() {
86918 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
86919}
86920
86921var _asyncToGenerator2;
86922
86923function _load_asyncToGenerator() {
86924 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
86925}
86926
86927var run = exports.run = function () {
86928 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
86929 if (args.length) {
86930 for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
86931 var _ref2;
86932
86933 if (_isArray) {
86934 if (_i >= _iterator.length) break;
86935 _ref2 = _iterator[_i++];
86936 } else {
86937 _i = _iterator.next();
86938 if (_i.done) break;
86939 _ref2 = _i.value;
86940 }
86941
86942 var name = _ref2;
86943
86944 var linkLoc = path.join(config.linkFolder, name);
86945 if (yield (_fs || _load_fs()).exists(linkLoc)) {
86946 yield (_fs || _load_fs()).unlink(path.join((yield (0, (_link || _load_link()).getRegistryFolder)(config, name)), name));
86947 reporter.success(reporter.lang('linkDisusing', name));
86948 reporter.info(reporter.lang('linkDisusingMessage', name));
86949 } else {
86950 throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', name));
86951 }
86952 }
86953 } else {
86954 // remove from registry
86955 var manifest = yield config.readRootManifest();
86956 var _name = manifest.name;
86957 if (!_name) {
86958 throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownPackageName'));
86959 }
86960
86961 var _linkLoc = path.join(config.linkFolder, _name);
86962 if (yield (_fs || _load_fs()).exists(_linkLoc)) {
86963 // If there is a `bin` defined in the package.json,
86964 // link each bin to the global bin
86965 if (manifest.bin) {
86966 var globalBinFolder = yield (0, (_global || _load_global()).getBinFolder)(config, flags);
86967 for (var binName in manifest.bin) {
86968 var binDestLoc = path.join(globalBinFolder, binName);
86969 if (yield (_fs || _load_fs()).exists(binDestLoc)) {
86970 yield (_fs || _load_fs()).unlink(binDestLoc);
86971 if (process.platform === 'win32') {
86972 yield (_fs || _load_fs()).unlink(binDestLoc + '.cmd');
86973 }
86974 }
86975 }
86976 }
86977
86978 yield (_fs || _load_fs()).unlink(_linkLoc);
86979
86980 reporter.success(reporter.lang('linkUnregistered', _name));
86981 reporter.info(reporter.lang('linkUnregisteredMessage', _name));
86982 } else {
86983 throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', _name));
86984 }
86985 }
86986 });
86987
86988 return function run(_x, _x2, _x3, _x4) {
86989 return _ref.apply(this, arguments);
86990 };
86991}();
86992
86993exports.setFlags = setFlags;
86994exports.hasWrapper = hasWrapper;
86995
86996var _errors;
86997
86998function _load_errors() {
86999 return _errors = __webpack_require__(6);
87000}
87001
87002var _fs;
87003
87004function _load_fs() {
87005 return _fs = _interopRequireWildcard(__webpack_require__(8));
87006}
87007
87008var _link;
87009
87010function _load_link() {
87011 return _link = __webpack_require__(293);
87012}
87013
87014var _global;
87015
87016function _load_global() {
87017 return _global = __webpack_require__(115);
87018}
87019
87020function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
87021
87022function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
87023
87024var path = __webpack_require__(1);
87025
87026function setFlags(commander) {
87027 commander.description('Unlink a previously created symlink for a package.');
87028}
87029
87030function hasWrapper(commander, args) {
87031 return true;
87032}
87033
87034/***/ }),
87035/* 499 */
87036/***/ (function(module, exports, __webpack_require__) {
87037
87038"use strict";
87039
87040
87041Object.defineProperty(exports, "__esModule", {
87042 value: true
87043});
87044exports.clearAll = exports.clearSome = exports.run = undefined;
87045
87046var _getIterator2;
87047
87048function _load_getIterator() {
87049 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
87050}
87051
87052var _set;
87053
87054function _load_set() {
87055 return _set = _interopRequireDefault(__webpack_require__(16));
87056}
87057
87058var _asyncToGenerator2;
87059
87060function _load_asyncToGenerator() {
87061 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
87062}
87063
87064var run = exports.run = function () {
87065 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
87066 if (!config.plugnplayEnabled) {
87067 throw new (_errors || _load_errors()).MessageError(reporter.lang('unplugDisabled'));
87068 }
87069 if (!args.length && flags.clear) {
87070 throw new (_errors || _load_errors()).MessageError(reporter.lang('tooFewArguments', 1));
87071 }
87072 if (args.length && flags.clearAll) {
87073 throw new (_errors || _load_errors()).MessageError(reporter.lang('noArguments'));
87074 }
87075
87076 if (flags.clearAll) {
87077 yield clearAll(config);
87078 } else if (flags.clear) {
87079 yield clearSome(config, new (_set || _load_set()).default(args));
87080 } else if (args.length > 0) {
87081 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
87082 yield (0, (_install || _load_install()).wrapLifecycle)(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
87083 var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
87084 install.linker.unplugged = args;
87085 yield install.init();
87086 }));
87087 }
87088
87089 var unpluggedPackageFolders = yield config.listUnpluggedPackageFolders();
87090
87091 for (var _iterator = unpluggedPackageFolders.values(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
87092 var _ref3;
87093
87094 if (_isArray) {
87095 if (_i >= _iterator.length) break;
87096 _ref3 = _iterator[_i++];
87097 } else {
87098 _i = _iterator.next();
87099 if (_i.done) break;
87100 _ref3 = _i.value;
87101 }
87102
87103 var target = _ref3;
87104
87105 reporter.log(target, { force: true });
87106 }
87107 });
87108
87109 return function run(_x, _x2, _x3, _x4) {
87110 return _ref.apply(this, arguments);
87111 };
87112}();
87113
87114var clearSome = exports.clearSome = function () {
87115 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, filters) {
87116 var unpluggedPackageFolders = yield config.listUnpluggedPackageFolders();
87117 var removeList = [];
87118
87119 for (var _iterator2 = unpluggedPackageFolders.entries(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
87120 var _ref6;
87121
87122 if (_isArray2) {
87123 if (_i2 >= _iterator2.length) break;
87124 _ref6 = _iterator2[_i2++];
87125 } else {
87126 _i2 = _iterator2.next();
87127 if (_i2.done) break;
87128 _ref6 = _i2.value;
87129 }
87130
87131 var _ref5 = _ref6;
87132 var unpluggedName = _ref5[0];
87133 var target = _ref5[1];
87134
87135 var _ref8 = yield (_fs || _load_fs()).readJson(path.join(target, 'package.json')),
87136 name = _ref8.name;
87137
87138 var toBeRemoved = filters.has(name);
87139
87140 if (toBeRemoved) {
87141 removeList.push(path.join(config.getUnpluggedPath(), unpluggedName));
87142 }
87143 }
87144
87145 if (removeList.length === unpluggedPackageFolders.size) {
87146 yield (_fs || _load_fs()).unlink(config.getUnpluggedPath());
87147 } else {
87148 for (var _iterator3 = removeList, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
87149 var _ref7;
87150
87151 if (_isArray3) {
87152 if (_i3 >= _iterator3.length) break;
87153 _ref7 = _iterator3[_i3++];
87154 } else {
87155 _i3 = _iterator3.next();
87156 if (_i3.done) break;
87157 _ref7 = _i3.value;
87158 }
87159
87160 var unpluggedPackagePath = _ref7;
87161
87162 yield (_fs || _load_fs()).unlink(unpluggedPackagePath);
87163 }
87164 }
87165 });
87166
87167 return function clearSome(_x5, _x6) {
87168 return _ref4.apply(this, arguments);
87169 };
87170}();
87171
87172var clearAll = exports.clearAll = function () {
87173 var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
87174 yield (_fs || _load_fs()).unlink(config.getUnpluggedPath());
87175 });
87176
87177 return function clearAll(_x7) {
87178 return _ref9.apply(this, arguments);
87179 };
87180}();
87181
87182exports.hasWrapper = hasWrapper;
87183exports.setFlags = setFlags;
87184
87185var _lockfile;
87186
87187function _load_lockfile() {
87188 return _lockfile = _interopRequireDefault(__webpack_require__(25));
87189}
87190
87191var _install;
87192
87193function _load_install() {
87194 return _install = __webpack_require__(41);
87195}
87196
87197var _errors;
87198
87199function _load_errors() {
87200 return _errors = __webpack_require__(6);
87201}
87202
87203var _fs;
87204
87205function _load_fs() {
87206 return _fs = _interopRequireWildcard(__webpack_require__(8));
87207}
87208
87209function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
87210
87211function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
87212
87213var path = __webpack_require__(1);
87214
87215function hasWrapper(commander) {
87216 return true;
87217}
87218
87219function setFlags(commander) {
87220 commander.description('Temporarily copies a package (with an optional @range suffix) outside of the global cache for debugging purposes');
87221 commander.usage('unplug [packages ...] [flags]');
87222 commander.option('--clear', 'Delete the selected packages');
87223 commander.option('--clear-all', 'Delete all unplugged packages');
87224}
87225
87226/***/ }),
87227/* 500 */
87228/***/ (function(module, exports, __webpack_require__) {
87229
87230"use strict";
87231
87232
87233Object.defineProperty(exports, "__esModule", {
87234 value: true
87235});
87236exports.run = undefined;
87237
87238var _assign;
87239
87240function _load_assign() {
87241 return _assign = _interopRequireDefault(__webpack_require__(23));
87242}
87243
87244var _asyncToGenerator2;
87245
87246function _load_asyncToGenerator() {
87247 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
87248}
87249
87250var run = exports.run = function () {
87251 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
87252 var versions = { yarn: (_yarnVersion || _load_yarnVersion()).version };
87253
87254 var pkg = yield config.maybeReadManifest(config.cwd);
87255 if (pkg && pkg.name && pkg.version) {
87256 versions[pkg.name] = pkg.version;
87257 }
87258
87259 (0, (_assign || _load_assign()).default)(versions, process.versions);
87260
87261 reporter.inspect(versions);
87262 });
87263
87264 return function run(_x, _x2, _x3, _x4) {
87265 return _ref.apply(this, arguments);
87266 };
87267}();
87268
87269exports.setFlags = setFlags;
87270exports.hasWrapper = hasWrapper;
87271
87272var _yarnVersion;
87273
87274function _load_yarnVersion() {
87275 return _yarnVersion = __webpack_require__(96);
87276}
87277
87278function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
87279
87280function setFlags(commander) {
87281 commander.description('Displays version information of currently installed Yarn, Node.js, and its dependencies.');
87282}
87283
87284function hasWrapper(commander, args) {
87285 return true;
87286}
87287
87288/***/ }),
87289/* 501 */
87290/***/ (function(module, exports, __webpack_require__) {
87291
87292"use strict";
87293
87294
87295Object.defineProperty(exports, "__esModule", {
87296 value: true
87297});
87298exports.run = exports.requireLockfile = undefined;
87299
87300var _from;
87301
87302function _load_from() {
87303 return _from = _interopRequireDefault(__webpack_require__(53));
87304}
87305
87306var _getIterator2;
87307
87308function _load_getIterator() {
87309 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
87310}
87311
87312var _keys;
87313
87314function _load_keys() {
87315 return _keys = _interopRequireDefault(__webpack_require__(14));
87316}
87317
87318var _promise;
87319
87320function _load_promise() {
87321 return _promise = _interopRequireDefault(__webpack_require__(7));
87322}
87323
87324var _set;
87325
87326function _load_set() {
87327 return _set = _interopRequireDefault(__webpack_require__(16));
87328}
87329
87330var _asyncToGenerator2;
87331
87332function _load_asyncToGenerator() {
87333 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
87334}
87335
87336var cleanQuery = function () {
87337 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, query) {
87338 // if a location was passed then turn it into a hash query
87339 if (path.isAbsolute(query) && (yield (_fs || _load_fs()).exists(query))) {
87340 // absolute path
87341 query = path.relative(config.cwd, query);
87342 }
87343
87344 // remove references to node_modules with hashes
87345 query = query.replace(/([\\/]|^)node_modules[\\/]/g, '#');
87346
87347 // remove trailing hashes
87348 query = query.replace(/^#+/g, '');
87349
87350 // remove trailing paths from each part of the query, skip second part of path for scoped packages
87351 var queryParts = query.split('#');
87352 queryParts = queryParts.map(function (part) {
87353 var parts = part.split(/[\\/]/g);
87354
87355 if (part[0] === '@') {
87356 parts = parts.slice(0, 2);
87357 } else {
87358 parts = parts.slice(0, 1);
87359 }
87360
87361 return parts.join('/');
87362 });
87363 query = queryParts.join('#');
87364
87365 return query;
87366 });
87367
87368 return function cleanQuery(_x, _x2) {
87369 return _ref.apply(this, arguments);
87370 };
87371}();
87372
87373var getPackageSize = function () {
87374 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (tuple) {
87375 var loc = tuple[0];
87376
87377
87378 var files = yield (_fs || _load_fs()).walk(loc, null, new (_set || _load_set()).default([(_constants || _load_constants()).METADATA_FILENAME, (_constants || _load_constants()).TARBALL_FILENAME]));
87379
87380 var sizes = yield (_promise || _load_promise()).default.all(files.map(function (walkFile) {
87381 return (_fs || _load_fs()).getFileSizeOnDisk(walkFile.absolute);
87382 }));
87383
87384 return sum(sizes);
87385 });
87386
87387 return function getPackageSize(_x3) {
87388 return _ref2.apply(this, arguments);
87389 };
87390}();
87391
87392var run = exports.run = function () {
87393 var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
87394 if (!args.length) {
87395 throw new (_errors || _load_errors()).MessageError(reporter.lang('missingWhyDependency'));
87396 }
87397 if (args.length > 1) {
87398 throw new (_errors || _load_errors()).MessageError(reporter.lang('tooManyArguments', 1));
87399 }
87400
87401 var query = yield cleanQuery(config, args[0]);
87402
87403 reporter.step(1, 4, reporter.lang('whyStart', args[0]), emoji.get('thinking_face'));
87404
87405 // init
87406 reporter.step(2, 4, reporter.lang('whyInitGraph'), emoji.get('truck'));
87407 var lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
87408 var install = new (_install || _load_install()).Install(flags, config, reporter, lockfile);
87409
87410 var _ref8 = yield install.fetchRequestFromCwd(),
87411 depRequests = _ref8.requests,
87412 patterns = _ref8.patterns,
87413 workspaceLayout = _ref8.workspaceLayout;
87414
87415 yield install.resolver.init(depRequests, {
87416 isFlat: install.flags.flat,
87417 isFrozen: install.flags.frozenLockfile,
87418 workspaceLayout
87419 });
87420 var hoisted = yield install.linker.getFlatHoistedTree(patterns);
87421
87422 // finding
87423 reporter.step(3, 4, reporter.lang('whyFinding'), emoji.get('mag'));
87424
87425 var matches = queryWhy(query, hoisted);
87426
87427 if (matches.length <= 0) {
87428 reporter.error(reporter.lang('whyUnknownMatch'));
87429 return;
87430 }
87431
87432 var processMatch = function () {
87433 var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (match) {
87434 var matchInfo = match[1];
87435
87436 var matchRef = matchInfo.pkg._reference;
87437 invariant(matchRef, 'expected reference');
87438
87439 var distinctMatchPatterns = new (_set || _load_set()).default(matchRef.patterns);
87440 var reasons = [];
87441
87442 // reason: dependency of these modules
87443 if (matchInfo.originalParentPath.length > 0) {
87444 reasons.push({
87445 type: 'whyDependedOn',
87446 typeSimple: 'whyDependedOnSimple',
87447 value: toStandardPathString(matchInfo.originalParentPath)
87448 });
87449 }
87450
87451 // reason: exists in manifest
87452 var rootType = void 0;
87453 for (var _iterator3 = distinctMatchPatterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
87454 var _ref10;
87455
87456 if (_isArray3) {
87457 if (_i3 >= _iterator3.length) break;
87458 _ref10 = _iterator3[_i3++];
87459 } else {
87460 _i3 = _iterator3.next();
87461 if (_i3.done) break;
87462 _ref10 = _i3.value;
87463 }
87464
87465 var pattern = _ref10;
87466
87467 rootType = install.rootPatternsToOrigin[pattern];
87468 if (rootType) {
87469 reasons.push({
87470 type: 'whySpecified',
87471 typeSimple: 'whySpecifiedSimple',
87472 value: rootType
87473 });
87474 }
87475 }
87476
87477 // reason: this is hoisted from these modules
87478 for (var _iterator4 = matchInfo.previousPaths, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
87479 var _ref11;
87480
87481 if (_isArray4) {
87482 if (_i4 >= _iterator4.length) break;
87483 _ref11 = _iterator4[_i4++];
87484 } else {
87485 _i4 = _iterator4.next();
87486 if (_i4.done) break;
87487 _ref11 = _i4.value;
87488 }
87489
87490 var _path = _ref11;
87491
87492 reasons.push({
87493 type: 'whyHoistedFrom',
87494 typeSimple: 'whyHoistedFromSimple',
87495 value: toStandardPathString(_path)
87496 });
87497 }
87498
87499 // package sizes
87500 var packageSize = 0;
87501 var directSizes = [];
87502 var transitiveSizes = [];
87503 try {
87504 packageSize = yield getPackageSize(match);
87505 } catch (e) {}
87506
87507 var dependencies = (0, (_from || _load_from()).default)(collect(hoisted, new (_set || _load_set()).default(), match));
87508 var transitiveDependencies = (0, (_from || _load_from()).default)(collect(hoisted, new (_set || _load_set()).default(), match, { recursive: true }));
87509
87510 try {
87511 directSizes = yield (_promise || _load_promise()).default.all(dependencies.map(getPackageSize));
87512 transitiveSizes = yield (_promise || _load_promise()).default.all(transitiveDependencies.map(getPackageSize));
87513 } catch (e) {}
87514
87515 var transitiveKeys = new (_set || _load_set()).default(transitiveDependencies.map(function (_ref12) {
87516 var info = _ref12[1];
87517 return info.key;
87518 }));
87519 var sharedDependencies = getSharedDependencies(hoisted, transitiveKeys);
87520
87521 // prepare output: populate reporter
87522 reporter.info(reporter.lang('whyMatch', `${matchInfo.key}@${matchInfo.pkg.version}`));
87523 //
87524 // reason: hoisted/nohoist
87525 if (matchInfo.isNohoist) {
87526 reasons.push({
87527 type: 'whyNotHoisted',
87528 typeSimple: 'whyNotHoistedSimple',
87529 value: matchInfo.nohoistList
87530 });
87531 } else if (query === matchInfo.originalKey) {
87532 reporter.info(reporter.lang('whyHoistedTo', matchInfo.key));
87533 }
87534
87535 if (reasons.length === 1) {
87536 reporter.info(reporter.lang(reasons[0].typeSimple, reasons[0].value));
87537 } else if (reasons.length > 1) {
87538 reporter.info(reporter.lang('whyReasons'));
87539 reporter.list('reasons', reasons.map(function (reason) {
87540 return reporter.lang(reason.type, reason.value);
87541 }));
87542 } else {
87543 reporter.error(reporter.lang('whyWhoKnows'));
87544 }
87545
87546 if (packageSize) {
87547 // stats: file size of this dependency without any dependencies
87548 reporter.info(reporter.lang('whyDiskSizeWithout', bytes(packageSize)));
87549
87550 // stats: file size of this dependency including dependencies that aren't shared
87551 reporter.info(reporter.lang('whyDiskSizeUnique', bytes(packageSize + sum(directSizes))));
87552
87553 // stats: file size of this dependency including dependencies
87554 reporter.info(reporter.lang('whyDiskSizeTransitive', bytes(packageSize + sum(transitiveSizes))));
87555
87556 // stats: shared transitive dependencies
87557 reporter.info(reporter.lang('whySharedDependencies', sharedDependencies.size));
87558 }
87559 });
87560
87561 return function processMatch(_x9) {
87562 return _ref9.apply(this, arguments);
87563 };
87564 }();
87565
87566 reporter.step(4, 4, reporter.lang('whyCalculating'), emoji.get('aerial_tramway'));
87567 for (var _iterator5 = matches, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
87568 var _ref13;
87569
87570 if (_isArray5) {
87571 if (_i5 >= _iterator5.length) break;
87572 _ref13 = _iterator5[_i5++];
87573 } else {
87574 _i5 = _iterator5.next();
87575 if (_i5.done) break;
87576 _ref13 = _i5.value;
87577 }
87578
87579 var match = _ref13;
87580
87581 yield processMatch(match);
87582 }
87583 });
87584
87585 return function run(_x5, _x6, _x7, _x8) {
87586 return _ref7.apply(this, arguments);
87587 };
87588}();
87589
87590exports.setFlags = setFlags;
87591exports.hasWrapper = hasWrapper;
87592exports.queryWhy = queryWhy;
87593
87594var _install;
87595
87596function _load_install() {
87597 return _install = __webpack_require__(41);
87598}
87599
87600var _constants;
87601
87602function _load_constants() {
87603 return _constants = __webpack_require__(13);
87604}
87605
87606var _fs;
87607
87608function _load_fs() {
87609 return _fs = _interopRequireWildcard(__webpack_require__(8));
87610}
87611
87612var _lockfile;
87613
87614function _load_lockfile() {
87615 return _lockfile = _interopRequireDefault(__webpack_require__(25));
87616}
87617
87618var _errors;
87619
87620function _load_errors() {
87621 return _errors = __webpack_require__(6);
87622}
87623
87624function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
87625
87626function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
87627
87628var requireLockfile = exports.requireLockfile = true;
87629
87630var invariant = __webpack_require__(15);
87631var bytes = __webpack_require__(561);
87632var emoji = __webpack_require__(242);
87633var path = __webpack_require__(1);
87634
87635function sum(array) {
87636 return array.length ? array.reduce(function (a, b) {
87637 return a + b;
87638 }, 0) : 0;
87639}
87640
87641function collect(hoistManifests, allDependencies, dependency) {
87642 var _ref3 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { recursive: false },
87643 recursive = _ref3.recursive;
87644
87645 var depInfo = dependency[1];
87646
87647 var deps = depInfo.pkg.dependencies;
87648
87649 if (!deps) {
87650 return allDependencies;
87651 }
87652
87653 var dependencyKeys = new (_set || _load_set()).default((0, (_keys || _load_keys()).default)(deps));
87654 var directDependencies = [];
87655
87656 for (var _iterator = hoistManifests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
87657 var _ref4;
87658
87659 if (_isArray) {
87660 if (_i >= _iterator.length) break;
87661 _ref4 = _iterator[_i++];
87662 } else {
87663 _i = _iterator.next();
87664 if (_i.done) break;
87665 _ref4 = _i.value;
87666 }
87667
87668 var dep = _ref4;
87669 var info = dep[1];
87670
87671
87672 if (!allDependencies.has(dep) && dependencyKeys.has(info.key)) {
87673 allDependencies.add(dep);
87674 directDependencies.push(dep);
87675 }
87676 }
87677
87678 if (recursive) {
87679 directDependencies.forEach(function (dependency) {
87680 return collect(hoistManifests, allDependencies, dependency, { recursive: true });
87681 });
87682 }
87683
87684 return allDependencies;
87685}
87686
87687function getSharedDependencies(hoistManifests, transitiveKeys) {
87688 var sharedDependencies = new (_set || _load_set()).default();
87689 for (var _iterator2 = hoistManifests, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
87690 var _ref6;
87691
87692 if (_isArray2) {
87693 if (_i2 >= _iterator2.length) break;
87694 _ref6 = _iterator2[_i2++];
87695 } else {
87696 _i2 = _iterator2.next();
87697 if (_i2.done) break;
87698 _ref6 = _i2.value;
87699 }
87700
87701 var _ref5 = _ref6;
87702 var info = _ref5[1];
87703
87704 if (!transitiveKeys.has(info.key) && info.pkg.dependencies) {
87705 (0, (_keys || _load_keys()).default)(info.pkg.dependencies).forEach(function (dependency) {
87706 if (transitiveKeys.has(dependency) && !sharedDependencies.has(dependency)) {
87707 sharedDependencies.add(dependency);
87708 }
87709 });
87710 }
87711 }
87712 return sharedDependencies;
87713}
87714
87715function setFlags(commander) {
87716 commander.description('Identifies why a package has been installed, detailing which other packages depend on it.');
87717}
87718
87719function hasWrapper(commander, args) {
87720 return true;
87721}
87722
87723// to conform to the current standard '#' as package tree separator
87724function toStandardPathString(pathString) {
87725 var str = pathString.replace(/\//g, '#');
87726 if (str[0] === '#') {
87727 return str.slice(1);
87728 }
87729 return str;
87730}
87731
87732function queryWhy(pattern, hoisted) {
87733 var nohoistPattern = `#${pattern}`;
87734 var found = [];
87735 for (var _iterator6 = hoisted, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
87736 var _ref15;
87737
87738 if (_isArray6) {
87739 if (_i6 >= _iterator6.length) break;
87740 _ref15 = _iterator6[_i6++];
87741 } else {
87742 _i6 = _iterator6.next();
87743 if (_i6.done) break;
87744 _ref15 = _i6.value;
87745 }
87746
87747 var _ref14 = _ref15;
87748 var loc = _ref14[0];
87749 var info = _ref14[1];
87750
87751 if (info.key === pattern || info.previousPaths.indexOf(pattern) >= 0 || info.key.endsWith(nohoistPattern)) {
87752 found.push([loc, info]);
87753 }
87754 }
87755 return found;
87756}
87757
87758/***/ }),
87759/* 502 */
87760/***/ (function(module, exports, __webpack_require__) {
87761
87762"use strict";
87763
87764
87765Object.defineProperty(exports, "__esModule", {
87766 value: true
87767});
87768exports.run = undefined;
87769
87770var _asyncToGenerator2;
87771
87772function _load_asyncToGenerator() {
87773 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
87774}
87775
87776var run = exports.run = function () {
87777 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
87778 var workspaceRootFolder = config.workspaceRootFolder;
87779
87780
87781 if (!workspaceRootFolder) {
87782 throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd));
87783 }
87784
87785 if (args.length < 1) {
87786 throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceMissingWorkspace'));
87787 }
87788
87789 if (args.length < 2) {
87790 throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceMissingCommand'));
87791 }
87792
87793 var manifest = yield config.findManifest(workspaceRootFolder, false);
87794 invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property');
87795
87796 var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest);
87797
87798 var _ref2 = args || [],
87799 workspaceName = _ref2[0],
87800 rest = _ref2.slice(1);
87801
87802 if (!Object.prototype.hasOwnProperty.call(workspaces, workspaceName)) {
87803 throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceUnknownWorkspace', workspaceName));
87804 }
87805
87806 var workspace = workspaces[workspaceName];
87807
87808 try {
87809 yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [(_constants || _load_constants()).YARN_BIN_PATH].concat(rest), {
87810 stdio: 'inherit',
87811 cwd: workspace.loc
87812 });
87813 } catch (err) {
87814 throw err;
87815 }
87816 });
87817
87818 return function run(_x, _x2, _x3, _x4) {
87819 return _ref.apply(this, arguments);
87820 };
87821}();
87822
87823exports.setFlags = setFlags;
87824exports.hasWrapper = hasWrapper;
87825
87826var _errors;
87827
87828function _load_errors() {
87829 return _errors = __webpack_require__(6);
87830}
87831
87832var _child;
87833
87834function _load_child() {
87835 return _child = _interopRequireWildcard(__webpack_require__(57));
87836}
87837
87838var _constants;
87839
87840function _load_constants() {
87841 return _constants = __webpack_require__(13);
87842}
87843
87844function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
87845
87846function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
87847
87848var invariant = __webpack_require__(15);
87849
87850function setFlags(commander) {}
87851
87852function hasWrapper(commander, args) {
87853 return true;
87854}
87855
87856/***/ }),
87857/* 503 */
87858/***/ (function(module, exports, __webpack_require__) {
87859
87860"use strict";
87861
87862
87863Object.defineProperty(exports, "__esModule", {
87864 value: true
87865});
87866exports.examples = exports.setFlags = exports.run = exports.runScript = exports.info = undefined;
87867
87868var _from;
87869
87870function _load_from() {
87871 return _from = _interopRequireDefault(__webpack_require__(53));
87872}
87873
87874var _set;
87875
87876function _load_set() {
87877 return _set = _interopRequireDefault(__webpack_require__(16));
87878}
87879
87880var _getIterator2;
87881
87882function _load_getIterator() {
87883 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
87884}
87885
87886var _keys;
87887
87888function _load_keys() {
87889 return _keys = _interopRequireDefault(__webpack_require__(14));
87890}
87891
87892var _stringify;
87893
87894function _load_stringify() {
87895 return _stringify = _interopRequireDefault(__webpack_require__(36));
87896}
87897
87898var _asyncToGenerator2;
87899
87900function _load_asyncToGenerator() {
87901 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
87902}
87903
87904var info = exports.info = function () {
87905 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
87906 var workspaceRootFolder = config.workspaceRootFolder;
87907
87908
87909 if (!workspaceRootFolder) {
87910 throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd));
87911 }
87912
87913 var manifest = yield config.findManifest(workspaceRootFolder, false);
87914 invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property');
87915
87916 var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest);
87917
87918 var publicData = {};
87919
87920 for (var _iterator = (0, (_keys || _load_keys()).default)(workspaces), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
87921 var _ref2;
87922
87923 if (_isArray) {
87924 if (_i >= _iterator.length) break;
87925 _ref2 = _iterator[_i++];
87926 } else {
87927 _i = _iterator.next();
87928 if (_i.done) break;
87929 _ref2 = _i.value;
87930 }
87931
87932 var workspaceName = _ref2;
87933 var _workspaces$workspace = workspaces[workspaceName],
87934 loc = _workspaces$workspace.loc,
87935 _manifest = _workspaces$workspace.manifest;
87936
87937
87938 var workspaceDependencies = new (_set || _load_set()).default();
87939 var mismatchedWorkspaceDependencies = new (_set || _load_set()).default();
87940
87941 for (var _iterator2 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
87942 var _ref3;
87943
87944 if (_isArray2) {
87945 if (_i2 >= _iterator2.length) break;
87946 _ref3 = _iterator2[_i2++];
87947 } else {
87948 _i2 = _iterator2.next();
87949 if (_i2.done) break;
87950 _ref3 = _i2.value;
87951 }
87952
87953 var dependencyType = _ref3;
87954
87955 if (dependencyType !== 'peerDependencies') {
87956 for (var _iterator3 = (0, (_keys || _load_keys()).default)(_manifest[dependencyType] || {}), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
87957 var _ref4;
87958
87959 if (_isArray3) {
87960 if (_i3 >= _iterator3.length) break;
87961 _ref4 = _iterator3[_i3++];
87962 } else {
87963 _i3 = _iterator3.next();
87964 if (_i3.done) break;
87965 _ref4 = _i3.value;
87966 }
87967
87968 var dependencyName = _ref4;
87969
87970 if (Object.prototype.hasOwnProperty.call(workspaces, dependencyName)) {
87971 invariant(_manifest && _manifest[dependencyType], 'The request should exist');
87972 var requestedRange = _manifest[dependencyType][dependencyName];
87973 if (semver.satisfies(workspaces[dependencyName].manifest.version, requestedRange)) {
87974 workspaceDependencies.add(dependencyName);
87975 } else {
87976 mismatchedWorkspaceDependencies.add(dependencyName);
87977 }
87978 }
87979 }
87980 }
87981 }
87982
87983 publicData[workspaceName] = {
87984 location: path.relative(config.lockfileFolder, loc).replace(/\\/g, '/'),
87985 workspaceDependencies: (0, (_from || _load_from()).default)(workspaceDependencies),
87986 mismatchedWorkspaceDependencies: (0, (_from || _load_from()).default)(mismatchedWorkspaceDependencies)
87987 };
87988 }
87989
87990 reporter.log((0, (_stringify || _load_stringify()).default)(publicData, null, 2), { force: true });
87991 });
87992
87993 return function info(_x, _x2, _x3, _x4) {
87994 return _ref.apply(this, arguments);
87995 };
87996}();
87997
87998var runScript = exports.runScript = function () {
87999 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
88000 var workspaceRootFolder = config.workspaceRootFolder;
88001
88002
88003 if (!workspaceRootFolder) {
88004 throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd));
88005 }
88006
88007 var manifest = yield config.findManifest(workspaceRootFolder, false);
88008 invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property');
88009
88010 var workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest);
88011
88012 try {
88013 for (var _iterator4 = (0, (_keys || _load_keys()).default)(workspaces), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
88014 var _ref6;
88015
88016 if (_isArray4) {
88017 if (_i4 >= _iterator4.length) break;
88018 _ref6 = _iterator4[_i4++];
88019 } else {
88020 _i4 = _iterator4.next();
88021 if (_i4.done) break;
88022 _ref6 = _i4.value;
88023 }
88024
88025 var workspaceName = _ref6;
88026 var loc = workspaces[workspaceName].loc;
88027
88028 reporter.log(`${os.EOL}> ${workspaceName}`);
88029 yield (_child || _load_child()).spawn((_constants2 || _load_constants2()).NODE_BIN_PATH, [(_constants2 || _load_constants2()).YARN_BIN_PATH, 'run'].concat(args), {
88030 stdio: 'inherit',
88031 cwd: loc
88032 });
88033 }
88034 } catch (err) {
88035 throw err;
88036 }
88037 });
88038
88039 return function runScript(_x5, _x6, _x7, _x8) {
88040 return _ref5.apply(this, arguments);
88041 };
88042}();
88043
88044exports.hasWrapper = hasWrapper;
88045
88046var _errors;
88047
88048function _load_errors() {
88049 return _errors = __webpack_require__(6);
88050}
88051
88052var _buildSubCommands2;
88053
88054function _load_buildSubCommands() {
88055 return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(62));
88056}
88057
88058var _constants;
88059
88060function _load_constants() {
88061 return _constants = __webpack_require__(13);
88062}
88063
88064var _child;
88065
88066function _load_child() {
88067 return _child = _interopRequireWildcard(__webpack_require__(57));
88068}
88069
88070var _constants2;
88071
88072function _load_constants2() {
88073 return _constants2 = __webpack_require__(13);
88074}
88075
88076function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
88077
88078function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
88079
88080var invariant = __webpack_require__(15);
88081var path = __webpack_require__(1);
88082var os = __webpack_require__(72);
88083var semver = __webpack_require__(27);
88084
88085function hasWrapper(commander, args) {
88086 return true;
88087}
88088
88089var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('workspaces', {
88090 info(config, reporter, flags, args) {
88091 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
88092 yield info(config, reporter, flags, args);
88093 })();
88094 },
88095 run(config, reporter, flags, args) {
88096 return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
88097 yield runScript(config, reporter, flags, args);
88098 })();
88099 }
88100}),
88101 run = _buildSubCommands.run,
88102 setFlags = _buildSubCommands.setFlags,
88103 examples = _buildSubCommands.examples;
88104
88105exports.run = run;
88106exports.setFlags = setFlags;
88107exports.examples = examples;
88108
88109/***/ }),
88110/* 504 */
88111/***/ (function(module, exports, __webpack_require__) {
88112
88113"use strict";
88114/* WEBPACK VAR INJECTION */(function(module) {
88115
88116Object.defineProperty(exports, "__esModule", {
88117 value: true
88118});
88119exports.autoRun = exports.main = undefined;
88120
88121var _assign;
88122
88123function _load_assign() {
88124 return _assign = _interopRequireDefault(__webpack_require__(23));
88125}
88126
88127var _extends2;
88128
88129function _load_extends() {
88130 return _extends2 = _interopRequireDefault(__webpack_require__(24));
88131}
88132
88133var _getIterator2;
88134
88135function _load_getIterator() {
88136 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
88137}
88138
88139var _stringify;
88140
88141function _load_stringify() {
88142 return _stringify = _interopRequireDefault(__webpack_require__(36));
88143}
88144
88145var _set;
88146
88147function _load_set() {
88148 return _set = _interopRequireDefault(__webpack_require__(16));
88149}
88150
88151var _promise;
88152
88153function _load_promise() {
88154 return _promise = _interopRequireDefault(__webpack_require__(7));
88155}
88156
88157var _asyncToGenerator2;
88158
88159function _load_asyncToGenerator() {
88160 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
88161}
88162
88163var main = exports.main = function () {
88164 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref2) {
88165 var startArgs = _ref2.startArgs,
88166 args = _ref2.args,
88167 endArgs = _ref2.endArgs;
88168
88169 var collect = function collect(val, acc) {
88170 acc.push(val);
88171 return acc;
88172 };
88173
88174 (0, (_loudRejection || _load_loudRejection()).default)();
88175 (0, (_signalHandler || _load_signalHandler()).default)();
88176
88177 // set global options
88178 (_commander || _load_commander()).default.version((_yarnVersion || _load_yarnVersion()).version, '-v, --version');
88179 (_commander || _load_commander()).default.usage('[command] [flags]');
88180 (_commander || _load_commander()).default.option('--no-default-rc', 'prevent Yarn from automatically detecting yarnrc and npmrc files');
88181 (_commander || _load_commander()).default.option('--use-yarnrc <path>', 'specifies a yarnrc file that Yarn should use (.yarnrc only, not .npmrc)', collect, []);
88182 (_commander || _load_commander()).default.option('--verbose', 'output verbose messages on internal operations');
88183 (_commander || _load_commander()).default.option('--offline', 'trigger an error if any required dependencies are not available in local cache');
88184 (_commander || _load_commander()).default.option('--prefer-offline', 'use network only if dependencies are not available in local cache');
88185 (_commander || _load_commander()).default.option('--enable-pnp, --pnp', "enable the Plug'n'Play installation");
88186 (_commander || _load_commander()).default.option('--disable-pnp', "disable the Plug'n'Play installation");
88187 (_commander || _load_commander()).default.option('--strict-semver');
88188 (_commander || _load_commander()).default.option('--json', 'format Yarn log messages as lines of JSON (see jsonlines.org)');
88189 (_commander || _load_commander()).default.option('--ignore-scripts', "don't run lifecycle scripts");
88190 (_commander || _load_commander()).default.option('--har', 'save HAR output of network traffic');
88191 (_commander || _load_commander()).default.option('--ignore-platform', 'ignore platform checks');
88192 (_commander || _load_commander()).default.option('--ignore-engines', 'ignore engines check');
88193 (_commander || _load_commander()).default.option('--ignore-optional', 'ignore optional dependencies');
88194 (_commander || _load_commander()).default.option('--force', 'install and build packages even if they were built before, overwrite lockfile');
88195 (_commander || _load_commander()).default.option('--skip-integrity-check', 'run install without checking if node_modules is installed');
88196 (_commander || _load_commander()).default.option('--check-files', 'install will verify file tree of packages for consistency');
88197 (_commander || _load_commander()).default.option('--no-bin-links', "don't generate bin links when setting up packages");
88198 (_commander || _load_commander()).default.option('--flat', 'only allow one version of a package');
88199 (_commander || _load_commander()).default.option('--prod, --production [prod]', '', (_conversion || _load_conversion()).boolify);
88200 (_commander || _load_commander()).default.option('--no-lockfile', "don't read or generate a lockfile");
88201 (_commander || _load_commander()).default.option('--pure-lockfile', "don't generate a lockfile");
88202 (_commander || _load_commander()).default.option('--frozen-lockfile', "don't generate a lockfile and fail if an update is needed");
88203 (_commander || _load_commander()).default.option('--update-checksums', 'update package checksums from current repository');
88204 (_commander || _load_commander()).default.option('--link-duplicates', 'create hardlinks to the repeated modules in node_modules');
88205 (_commander || _load_commander()).default.option('--link-folder <path>', 'specify a custom folder to store global links');
88206 (_commander || _load_commander()).default.option('--global-folder <path>', 'specify a custom folder to store global packages');
88207 (_commander || _load_commander()).default.option('--modules-folder <path>', 'rather than installing modules into the node_modules folder relative to the cwd, output them here');
88208 (_commander || _load_commander()).default.option('--preferred-cache-folder <path>', 'specify a custom folder to store the yarn cache if possible');
88209 (_commander || _load_commander()).default.option('--cache-folder <path>', 'specify a custom folder that must be used to store the yarn cache');
88210 (_commander || _load_commander()).default.option('--mutex <type>[:specifier]', 'use a mutex to ensure only one yarn instance is executing');
88211 (_commander || _load_commander()).default.option('--emoji [bool]', 'enable emoji in output', (_conversion || _load_conversion()).boolify, process.platform === 'darwin' || process.env.TERM_PROGRAM === 'Hyper' || process.env.TERM_PROGRAM === 'HyperTerm' || process.env.TERM_PROGRAM === 'Terminus');
88212 (_commander || _load_commander()).default.option('-s, --silent', 'skip Yarn console logs, other types of logs (script output) will be printed');
88213 (_commander || _load_commander()).default.option('--cwd <cwd>', 'working directory to use', process.cwd());
88214 (_commander || _load_commander()).default.option('--proxy <host>', '');
88215 (_commander || _load_commander()).default.option('--https-proxy <host>', '');
88216 (_commander || _load_commander()).default.option('--registry <url>', 'override configuration registry');
88217 (_commander || _load_commander()).default.option('--no-progress', 'disable progress bar');
88218 (_commander || _load_commander()).default.option('--network-concurrency <number>', 'maximum number of concurrent network requests', parseInt);
88219 (_commander || _load_commander()).default.option('--network-timeout <milliseconds>', 'TCP timeout for network requests', parseInt);
88220 (_commander || _load_commander()).default.option('--non-interactive', 'do not show interactive prompts');
88221 (_commander || _load_commander()).default.option('--scripts-prepend-node-path [bool]', 'prepend the node executable dir to the PATH in scripts', (_conversion || _load_conversion()).boolify);
88222 (_commander || _load_commander()).default.option('--no-node-version-check', 'do not warn when using a potentially unsupported Node version');
88223 (_commander || _load_commander()).default.option('--focus', 'Focus on a single workspace by installing remote copies of its sibling workspaces.');
88224 (_commander || _load_commander()).default.option('--otp <otpcode>', 'one-time password for two factor authentication');
88225
88226 // if -v is the first command, then always exit after returning the version
88227 if (args[0] === '-v') {
88228 console.log((_yarnVersion || _load_yarnVersion()).version.trim());
88229 process.exitCode = 0;
88230 return;
88231 }
88232
88233 // get command name
88234 var firstNonFlagIndex = args.findIndex(function (arg, idx, arr) {
88235 var isOption = arg.startsWith('-');
88236 var prev = idx > 0 && arr[idx - 1];
88237 var prevOption = prev && prev.startsWith('-') && (_commander || _load_commander()).default.optionFor(prev);
88238 var boundToPrevOption = prevOption && (prevOption.optional || prevOption.required);
88239
88240 return !isOption && !boundToPrevOption;
88241 });
88242 var preCommandArgs = void 0;
88243 var commandName = '';
88244 if (firstNonFlagIndex > -1) {
88245 preCommandArgs = args.slice(0, firstNonFlagIndex);
88246 commandName = args[firstNonFlagIndex];
88247 args = args.slice(firstNonFlagIndex + 1);
88248 } else {
88249 preCommandArgs = args;
88250 args = [];
88251 }
88252
88253 var isKnownCommand = Object.prototype.hasOwnProperty.call((_index3 || _load_index3()).default, commandName);
88254 var isHelp = function isHelp(arg) {
88255 return arg === '--help' || arg === '-h';
88256 };
88257 var helpInPre = preCommandArgs.findIndex(isHelp);
88258 var helpInArgs = args.findIndex(isHelp);
88259 var setHelpMode = function setHelpMode() {
88260 if (isKnownCommand) {
88261 args.unshift(commandName);
88262 }
88263 commandName = 'help';
88264 isKnownCommand = true;
88265 };
88266
88267 if (helpInPre > -1) {
88268 preCommandArgs.splice(helpInPre);
88269 setHelpMode();
88270 } else if (isKnownCommand && helpInArgs === 0) {
88271 args.splice(helpInArgs);
88272 setHelpMode();
88273 }
88274
88275 if (!commandName) {
88276 commandName = 'install';
88277 isKnownCommand = true;
88278 }
88279 if (commandName === 'set' && args[0] === 'version') {
88280 commandName = 'policies';
88281 args.splice(0, 1, 'set-version');
88282 isKnownCommand = true;
88283 }
88284 if (!isKnownCommand) {
88285 // if command is not recognized, then set default to `run`
88286 args.unshift(commandName);
88287 commandName = 'run';
88288 }
88289 var command = (_index3 || _load_index3()).default[commandName];
88290
88291 var warnAboutRunDashDash = false;
88292 // we are using "yarn <script> -abc", "yarn run <script> -abc", or "yarn node -abc", we want -abc
88293 // to be script options, not yarn options
88294
88295 // PROXY_COMMANDS is a map of command name to the number of preservedArgs
88296 var PROXY_COMMANDS = {
88297 run: 1, // yarn run {command}
88298 create: 1, // yarn create {project}
88299 node: 0, // yarn node
88300 workspaces: 1, // yarn workspaces {command}
88301 workspace: 2 // yarn workspace {package} {command}
88302 };
88303 if (PROXY_COMMANDS.hasOwnProperty(commandName)) {
88304 if (endArgs.length === 0) {
88305 // $FlowFixMe doesn't like that PROXY_COMMANDS doesn't have keys for all commands.
88306 var preservedArgs = PROXY_COMMANDS[commandName];
88307
88308 // If the --into option immediately follows the command (or the script name in the "run/create"
88309 // case), we parse them as regular options so that we can cd into them
88310 if (args[preservedArgs] === `--into`) {
88311 preservedArgs += 2;
88312 }
88313 endArgs = ['--'].concat(args.splice(preservedArgs));
88314 } else {
88315 warnAboutRunDashDash = true;
88316 }
88317 }
88318
88319 args = [].concat(preCommandArgs, args);
88320
88321 command.setFlags((_commander || _load_commander()).default);
88322 (_commander || _load_commander()).default.parse([].concat(startArgs, [
88323 // we use this for https://github.com/tj/commander.js/issues/346, otherwise
88324 // it will strip some args that match with any options
88325 'this-arg-will-get-stripped-later'], (0, (_rc || _load_rc()).getRcArgs)(commandName, args), args));
88326 (_commander || _load_commander()).default.args = (_commander || _load_commander()).default.args.concat(endArgs.slice(1));
88327
88328 // we strip cmd
88329 console.assert((_commander || _load_commander()).default.args.length >= 1);
88330 console.assert((_commander || _load_commander()).default.args[0] === 'this-arg-will-get-stripped-later');
88331 (_commander || _load_commander()).default.args.shift();
88332
88333 //
88334 var Reporter = (_commander || _load_commander()).default.json ? (_index || _load_index()).JSONReporter : (_index || _load_index()).ConsoleReporter;
88335 var reporter = new Reporter({
88336 emoji: process.stdout.isTTY && (_commander || _load_commander()).default.emoji,
88337 verbose: (_commander || _load_commander()).default.verbose,
88338 noProgress: !(_commander || _load_commander()).default.progress,
88339 isSilent: (0, (_conversion || _load_conversion()).boolifyWithDefault)(process.env.YARN_SILENT, false) || (_commander || _load_commander()).default.silent,
88340 nonInteractive: (_commander || _load_commander()).default.nonInteractive
88341 });
88342
88343 var exit = function exit(exitCode) {
88344 process.exitCode = exitCode || 0;
88345 reporter.close();
88346 };
88347
88348 reporter.initPeakMemoryCounter();
88349
88350 var config = new (_config || _load_config()).default(reporter);
88351 var outputWrapperEnabled = (0, (_conversion || _load_conversion()).boolifyWithDefault)(process.env.YARN_WRAP_OUTPUT, true);
88352 var shouldWrapOutput = outputWrapperEnabled && !(_commander || _load_commander()).default.json && command.hasWrapper((_commander || _load_commander()).default, (_commander || _load_commander()).default.args) && !(commandName === 'init' && (_commander || _load_commander()).default[`2`]);
88353
88354 if (shouldWrapOutput) {
88355 reporter.header(commandName, { name: 'yarn', version: (_yarnVersion || _load_yarnVersion()).version });
88356 }
88357
88358 if ((_commander || _load_commander()).default.nodeVersionCheck && !(_semver || _load_semver()).default.satisfies(process.versions.node, (_constants || _load_constants()).SUPPORTED_NODE_VERSIONS)) {
88359 reporter.warn(reporter.lang('unsupportedNodeVersion', process.versions.node, (_constants || _load_constants()).SUPPORTED_NODE_VERSIONS));
88360 }
88361
88362 if (command.noArguments && (_commander || _load_commander()).default.args.length) {
88363 reporter.error(reporter.lang('noArguments'));
88364 reporter.info(command.getDocsInfo);
88365 exit(1);
88366 return;
88367 }
88368
88369 //
88370 if ((_commander || _load_commander()).default.yes) {
88371 reporter.warn(reporter.lang('yesWarning'));
88372 }
88373
88374 //
88375 if (!(_commander || _load_commander()).default.offline && (_network || _load_network()).isOffline()) {
88376 reporter.warn(reporter.lang('networkWarning'));
88377 }
88378
88379 //
88380 var run = function run() {
88381 (0, (_invariant || _load_invariant()).default)(command, 'missing command');
88382
88383 if (warnAboutRunDashDash) {
88384 reporter.warn(reporter.lang('dashDashDeprecation'));
88385 }
88386
88387 return command.run(config, reporter, (_commander || _load_commander()).default, (_commander || _load_commander()).default.args).then(function (exitCode) {
88388 if (shouldWrapOutput) {
88389 reporter.footer(false);
88390 }
88391 return exitCode;
88392 });
88393 };
88394
88395 //
88396 var runEventuallyWithFile = function runEventuallyWithFile(mutexFilename, isFirstTime) {
88397 return new (_promise || _load_promise()).default(function (resolve) {
88398 var lockFilename = mutexFilename || (_path || _load_path()).default.join(config.cwd, (_constants || _load_constants()).SINGLE_INSTANCE_FILENAME);
88399 (_properLockfile || _load_properLockfile()).default.lock(lockFilename, { realpath: false }, function (err, release) {
88400 if (err) {
88401 if (isFirstTime) {
88402 reporter.warn(reporter.lang('waitingInstance'));
88403 }
88404 setTimeout(function () {
88405 resolve(runEventuallyWithFile(mutexFilename, false));
88406 }, 200); // do not starve the CPU
88407 } else {
88408 (0, (_death || _load_death()).default)(function () {
88409 process.exitCode = 1;
88410 });
88411 resolve(run().then(function () {
88412 return new (_promise || _load_promise()).default(function (resolve) {
88413 return release(resolve);
88414 });
88415 }));
88416 }
88417 });
88418 });
88419 };
88420
88421 var runEventuallyWithNetwork = function runEventuallyWithNetwork(mutexPort) {
88422 return new (_promise || _load_promise()).default(function (resolve, reject) {
88423 var connectionOptions = {
88424 port: +mutexPort || (_constants || _load_constants()).SINGLE_INSTANCE_PORT,
88425 host: 'localhost'
88426 };
88427
88428 function startServer() {
88429 var clients = new (_set || _load_set()).default();
88430 var server = (_http || _load_http()).default.createServer(manager);
88431
88432 // The server must not prevent us from exiting
88433 server.unref();
88434
88435 // No socket must timeout, so that they aren't closed before we exit
88436 server.timeout = 0;
88437
88438 // If we fail to setup the server, we ask the existing one for its name
88439 server.on('error', function () {
88440 reportServerName();
88441 });
88442
88443 // If we succeed, keep track of all the connected sockets to close them later
88444 server.on('connection', function (socket) {
88445 clients.add(socket);
88446 socket.on('close', function () {
88447 clients.delete(socket);
88448 });
88449 });
88450
88451 server.listen(connectionOptions, function () {
88452 // Don't forget to kill the sockets if we're being killed via signals
88453 (0, (_death || _load_death()).default)(killSockets);
88454
88455 // Also kill the sockets if we finish, whether it's a success or a failure
88456 run().then(function (res) {
88457 killSockets();
88458 resolve(res);
88459 }, function (err) {
88460 killSockets();
88461 reject(err);
88462 });
88463 });
88464
88465 function manager(request, response) {
88466 response.writeHead(200);
88467 response.end((0, (_stringify || _load_stringify()).default)({ cwd: config.cwd, pid: process.pid }));
88468 }
88469
88470 function killSockets() {
88471 try {
88472 server.close();
88473 } catch (err) {
88474 // best effort
88475 }
88476
88477 for (var _iterator = clients, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
88478 var _ref3;
88479
88480 if (_isArray) {
88481 if (_i >= _iterator.length) break;
88482 _ref3 = _iterator[_i++];
88483 } else {
88484 _i = _iterator.next();
88485 if (_i.done) break;
88486 _ref3 = _i.value;
88487 }
88488
88489 var socket = _ref3;
88490
88491 try {
88492 socket.destroy();
88493 } catch (err) {
88494 // best effort
88495 }
88496 }
88497
88498 // If the process hasn't exited in the next 5s, it has stalled and we abort
88499 var timeout = setTimeout(function () {
88500 console.error('Process stalled');
88501 if (process._getActiveHandles) {
88502 console.error('Active handles:');
88503 // $FlowFixMe: getActiveHandles is undocumented, but it exists
88504 for (var _iterator2 = process._getActiveHandles(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
88505 var _ref4;
88506
88507 if (_isArray2) {
88508 if (_i2 >= _iterator2.length) break;
88509 _ref4 = _iterator2[_i2++];
88510 } else {
88511 _i2 = _iterator2.next();
88512 if (_i2.done) break;
88513 _ref4 = _i2.value;
88514 }
88515
88516 var handle = _ref4;
88517
88518 console.error(` - ${handle.constructor.name}`);
88519 }
88520 }
88521 // eslint-disable-next-line no-process-exit
88522 process.exit(1);
88523 }, 5000);
88524
88525 // This timeout must not prevent us from exiting
88526 // $FlowFixMe: Node's setTimeout returns a Timeout, not a Number
88527 timeout.unref();
88528 }
88529 }
88530
88531 function reportServerName() {
88532 var request = (_http || _load_http()).default.get(connectionOptions, function (response) {
88533 var buffers = [];
88534
88535 response.on('data', function (buffer) {
88536 buffers.push(buffer);
88537 });
88538
88539 response.on('end', function () {
88540 try {
88541 var _JSON$parse = JSON.parse(Buffer.concat(buffers).toString()),
88542 _cwd = _JSON$parse.cwd,
88543 pid = _JSON$parse.pid;
88544
88545 reporter.warn(reporter.lang('waitingNamedInstance', pid, _cwd));
88546 } catch (error) {
88547 reporter.verbose(error);
88548 reject(new Error(reporter.lang('mutexPortBusy', connectionOptions.port)));
88549 return;
88550 }
88551 waitForTheNetwork();
88552 });
88553
88554 response.on('error', function () {
88555 startServer();
88556 });
88557 });
88558
88559 request.on('error', function () {
88560 startServer();
88561 });
88562 }
88563
88564 function waitForTheNetwork() {
88565 var socket = (_net || _load_net()).default.createConnection(connectionOptions);
88566
88567 socket.on('error', function () {
88568 // catch & ignore, the retry is handled in 'close'
88569 });
88570
88571 socket.on('close', function () {
88572 startServer();
88573 });
88574 }
88575
88576 startServer();
88577 });
88578 };
88579
88580 function onUnexpectedError(err) {
88581 function indent(str) {
88582 return '\n ' + str.trim().split('\n').join('\n ');
88583 }
88584
88585 var log = [];
88586 log.push(`Arguments: ${indent(process.argv.join(' '))}`);
88587 log.push(`PATH: ${indent(process.env.PATH || 'undefined')}`);
88588 log.push(`Yarn version: ${indent((_yarnVersion || _load_yarnVersion()).version)}`);
88589 log.push(`Node version: ${indent(process.versions.node)}`);
88590 log.push(`Platform: ${indent(process.platform + ' ' + process.arch)}`);
88591
88592 log.push(`Trace: ${indent(err.stack)}`);
88593
88594 // add manifests
88595 for (var _iterator3 = (_index2 || _load_index2()).registryNames, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
88596 var _ref5;
88597
88598 if (_isArray3) {
88599 if (_i3 >= _iterator3.length) break;
88600 _ref5 = _iterator3[_i3++];
88601 } else {
88602 _i3 = _iterator3.next();
88603 if (_i3.done) break;
88604 _ref5 = _i3.value;
88605 }
88606
88607 var registryName = _ref5;
88608
88609 var possibleLoc = (_path || _load_path()).default.join(config.cwd, (_index2 || _load_index2()).registries[registryName].filename);
88610 var manifest = (_fs || _load_fs()).default.existsSync(possibleLoc) ? (_fs || _load_fs()).default.readFileSync(possibleLoc, 'utf8') : 'No manifest';
88611 log.push(`${registryName} manifest: ${indent(manifest)}`);
88612 }
88613
88614 // lockfile
88615 var lockLoc = (_path || _load_path()).default.join(config.lockfileFolder || config.cwd, // lockfileFolder might not be set at this point
88616 (_constants || _load_constants()).LOCKFILE_FILENAME);
88617 var lockfile = (_fs || _load_fs()).default.existsSync(lockLoc) ? (_fs || _load_fs()).default.readFileSync(lockLoc, 'utf8') : 'No lockfile';
88618 log.push(`Lockfile: ${indent(lockfile)}`);
88619
88620 var errorReportLoc = writeErrorReport(log);
88621
88622 reporter.error(reporter.lang('unexpectedError', err.message));
88623
88624 if (errorReportLoc) {
88625 reporter.info(reporter.lang('bugReport', errorReportLoc));
88626 }
88627 }
88628
88629 function writeErrorReport(log) {
88630 var errorReportLoc = config.enableMetaFolder ? (_path || _load_path()).default.join(config.cwd, (_constants || _load_constants()).META_FOLDER, 'yarn-error.log') : (_path || _load_path()).default.join(config.cwd, 'yarn-error.log');
88631
88632 try {
88633 (_fs || _load_fs()).default.writeFileSync(errorReportLoc, log.join('\n\n') + '\n');
88634 } catch (err) {
88635 reporter.error(reporter.lang('fileWriteError', errorReportLoc, err.message));
88636 return undefined;
88637 }
88638
88639 return errorReportLoc;
88640 }
88641
88642 var cwd = command.shouldRunInCurrentCwd ? (_commander || _load_commander()).default.cwd : findProjectRoot((_commander || _load_commander()).default.cwd);
88643
88644 var folderOptionKeys = ['linkFolder', 'globalFolder', 'preferredCacheFolder', 'cacheFolder', 'modulesFolder'];
88645
88646 // Resolve all folder options relative to cwd
88647 var resolvedFolderOptions = {};
88648 folderOptionKeys.forEach(function (folderOptionKey) {
88649 var folderOption = (_commander || _load_commander()).default[folderOptionKey];
88650 var resolvedFolderOption = folderOption ? (_path || _load_path()).default.resolve((_commander || _load_commander()).default.cwd, folderOption) : folderOption;
88651 resolvedFolderOptions[folderOptionKey] = resolvedFolderOption;
88652 });
88653
88654 yield config.init((0, (_extends2 || _load_extends()).default)({
88655 cwd,
88656 commandName
88657 }, resolvedFolderOptions, {
88658 enablePnp: (_commander || _load_commander()).default.pnp,
88659 disablePnp: (_commander || _load_commander()).default.disablePnp,
88660 enableDefaultRc: (_commander || _load_commander()).default.defaultRc,
88661 extraneousYarnrcFiles: (_commander || _load_commander()).default.useYarnrc,
88662 binLinks: (_commander || _load_commander()).default.binLinks,
88663 preferOffline: (_commander || _load_commander()).default.preferOffline,
88664 captureHar: (_commander || _load_commander()).default.har,
88665 ignorePlatform: (_commander || _load_commander()).default.ignorePlatform,
88666 ignoreEngines: (_commander || _load_commander()).default.ignoreEngines,
88667 ignoreScripts: (_commander || _load_commander()).default.ignoreScripts,
88668 offline: (_commander || _load_commander()).default.preferOffline || (_commander || _load_commander()).default.offline,
88669 looseSemver: !(_commander || _load_commander()).default.strictSemver,
88670 production: (_commander || _load_commander()).default.production,
88671 httpProxy: (_commander || _load_commander()).default.proxy,
88672 httpsProxy: (_commander || _load_commander()).default.httpsProxy,
88673 registry: (_commander || _load_commander()).default.registry,
88674 networkConcurrency: (_commander || _load_commander()).default.networkConcurrency,
88675 networkTimeout: (_commander || _load_commander()).default.networkTimeout,
88676 nonInteractive: (_commander || _load_commander()).default.nonInteractive,
88677 updateChecksums: (_commander || _load_commander()).default.updateChecksums,
88678 focus: (_commander || _load_commander()).default.focus,
88679 otp: (_commander || _load_commander()).default.otp
88680 })).then(function () {
88681 // lockfile check must happen after config.init sets lockfileFolder
88682 if (command.requireLockfile && !(_fs || _load_fs()).default.existsSync((_path || _load_path()).default.join(config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME))) {
88683 throw new (_errors || _load_errors()).MessageError(reporter.lang('noRequiredLockfile'));
88684 }
88685
88686 // option "no-progress" stored in yarn config
88687 var noProgressConfig = config.registries.yarn.getOption('no-progress');
88688
88689 if (noProgressConfig) {
88690 reporter.disableProgress();
88691 }
88692
88693 // verbose logs outputs process.uptime() with this line we can sync uptime to absolute time on the computer
88694 reporter.verbose(`current time: ${new Date().toISOString()}`);
88695
88696 var mutex = (_commander || _load_commander()).default.mutex;
88697 if (mutex && typeof mutex === 'string') {
88698 var separatorLoc = mutex.indexOf(':');
88699 var mutexType = void 0;
88700 var mutexSpecifier = void 0;
88701 if (separatorLoc === -1) {
88702 mutexType = mutex;
88703 mutexSpecifier = undefined;
88704 } else {
88705 mutexType = mutex.substring(0, separatorLoc);
88706 mutexSpecifier = mutex.substring(separatorLoc + 1);
88707 }
88708
88709 if (mutexType === 'file') {
88710 return runEventuallyWithFile(mutexSpecifier, true).then(exit);
88711 } else if (mutexType === 'network') {
88712 return runEventuallyWithNetwork(mutexSpecifier).then(exit);
88713 } else {
88714 throw new (_errors || _load_errors()).MessageError(`Unknown single instance type ${mutexType}`);
88715 }
88716 } else {
88717 return run().then(exit);
88718 }
88719 }).catch(function (err) {
88720 reporter.verbose(err.stack);
88721
88722 if (err instanceof (_errors2 || _load_errors2()).ProcessTermError && reporter.isSilent) {
88723 return exit(err.EXIT_CODE || 1);
88724 }
88725
88726 if (err instanceof (_errors || _load_errors()).MessageError) {
88727 reporter.error(err.message);
88728 } else {
88729 onUnexpectedError(err);
88730 }
88731
88732 if (command.getDocsInfo) {
88733 reporter.info(command.getDocsInfo);
88734 }
88735
88736 if (err instanceof (_errors2 || _load_errors2()).ProcessTermError) {
88737 return exit(err.EXIT_CODE || 1);
88738 }
88739
88740 return exit(1);
88741 });
88742 });
88743
88744 return function main(_x) {
88745 return _ref.apply(this, arguments);
88746 };
88747}();
88748
88749var start = function () {
88750 var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
88751 var rc = (0, (_rc || _load_rc()).getRcConfigForCwd)(process.cwd(), process.argv.slice(2));
88752 var yarnPath = rc['yarn-path'] || rc['yarnPath'];
88753
88754 if (yarnPath && !(0, (_conversion || _load_conversion()).boolifyWithDefault)(process.env.YARN_IGNORE_PATH, false)) {
88755 var argv = process.argv.slice(2);
88756 var opts = { stdio: 'inherit', env: (0, (_assign || _load_assign()).default)({}, process.env, { YARN_IGNORE_PATH: 1 }) };
88757 var exitCode = 0;
88758
88759 process.on(`SIGINT`, function () {
88760 // We don't want SIGINT to kill our process; we want it to kill the
88761 // innermost process, whose end will cause our own to exit.
88762 });
88763
88764 (0, (_signalHandler || _load_signalHandler()).default)();
88765
88766 try {
88767 if (/\.[cm]?js$/.test(yarnPath)) {
88768 exitCode = yield (0, (_child || _load_child()).spawnp)(process.execPath, [yarnPath].concat(argv), opts);
88769 } else {
88770 exitCode = yield (0, (_child || _load_child()).spawnp)(yarnPath, argv, opts);
88771 }
88772 } catch (firstError) {
88773 try {
88774 exitCode = yield (0, (_child || _load_child()).forkp)(yarnPath, argv, opts);
88775 } catch (error) {
88776 throw firstError;
88777 }
88778 }
88779
88780 process.exitCode = exitCode;
88781 } else {
88782 // ignore all arguments after a --
88783 var doubleDashIndex = process.argv.findIndex(function (element) {
88784 return element === '--';
88785 });
88786 var startArgs = process.argv.slice(0, 2);
88787 var args = process.argv.slice(2, doubleDashIndex === -1 ? process.argv.length : doubleDashIndex);
88788 var endArgs = doubleDashIndex === -1 ? [] : process.argv.slice(doubleDashIndex);
88789
88790 yield main({ startArgs, args, endArgs });
88791 }
88792 });
88793
88794 return function start() {
88795 return _ref6.apply(this, arguments);
88796 };
88797}();
88798
88799// When this module is compiled via Webpack, its child
88800// count will be 0 since it is a single-file bundle.
88801
88802
88803var _http;
88804
88805function _load_http() {
88806 return _http = _interopRequireDefault(__webpack_require__(83));
88807}
88808
88809var _net;
88810
88811function _load_net() {
88812 return _net = _interopRequireDefault(__webpack_require__(151));
88813}
88814
88815var _path;
88816
88817function _load_path() {
88818 return _path = _interopRequireDefault(__webpack_require__(1));
88819}
88820
88821var _commander;
88822
88823function _load_commander() {
88824 return _commander = _interopRequireDefault(__webpack_require__(277));
88825}
88826
88827var _fs;
88828
88829function _load_fs() {
88830 return _fs = _interopRequireDefault(__webpack_require__(12));
88831}
88832
88833var _invariant;
88834
88835function _load_invariant() {
88836 return _invariant = _interopRequireDefault(__webpack_require__(15));
88837}
88838
88839var _properLockfile;
88840
88841function _load_properLockfile() {
88842 return _properLockfile = _interopRequireDefault(__webpack_require__(444));
88843}
88844
88845var _loudRejection;
88846
88847function _load_loudRejection() {
88848 return _loudRejection = _interopRequireDefault(__webpack_require__(443));
88849}
88850
88851var _death;
88852
88853function _load_death() {
88854 return _death = _interopRequireDefault(__webpack_require__(442));
88855}
88856
88857var _semver;
88858
88859function _load_semver() {
88860 return _semver = _interopRequireDefault(__webpack_require__(27));
88861}
88862
88863var _index;
88864
88865function _load_index() {
88866 return _index = __webpack_require__(189);
88867}
88868
88869var _index2;
88870
88871function _load_index2() {
88872 return _index2 = __webpack_require__(61);
88873}
88874
88875var _index3;
88876
88877function _load_index3() {
88878 return _index3 = _interopRequireDefault(__webpack_require__(273));
88879}
88880
88881var _constants;
88882
88883function _load_constants() {
88884 return _constants = _interopRequireWildcard(__webpack_require__(13));
88885}
88886
88887var _network;
88888
88889function _load_network() {
88890 return _network = _interopRequireWildcard(__webpack_require__(276));
88891}
88892
88893var _errors;
88894
88895function _load_errors() {
88896 return _errors = __webpack_require__(6);
88897}
88898
88899var _config;
88900
88901function _load_config() {
88902 return _config = _interopRequireDefault(__webpack_require__(149));
88903}
88904
88905var _rc;
88906
88907function _load_rc() {
88908 return _rc = __webpack_require__(274);
88909}
88910
88911var _child;
88912
88913function _load_child() {
88914 return _child = __webpack_require__(57);
88915}
88916
88917var _yarnVersion;
88918
88919function _load_yarnVersion() {
88920 return _yarnVersion = __webpack_require__(96);
88921}
88922
88923var _signalHandler;
88924
88925function _load_signalHandler() {
88926 return _signalHandler = _interopRequireDefault(__webpack_require__(441));
88927}
88928
88929var _conversion;
88930
88931function _load_conversion() {
88932 return _conversion = __webpack_require__(275);
88933}
88934
88935var _errors2;
88936
88937function _load_errors2() {
88938 return _errors2 = __webpack_require__(6);
88939}
88940
88941function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
88942
88943function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
88944
88945process.stdout.prependListener('error', function (err) {
88946 // swallow err only if downstream consumer process closed pipe early
88947 if (err.code === 'EPIPE' || err.code === 'ERR_STREAM_DESTROYED') {
88948 return;
88949 }
88950 throw err;
88951});
88952
88953function findProjectRoot(base) {
88954 var prev = null;
88955 var dir = base;
88956
88957 do {
88958 if ((_fs || _load_fs()).default.existsSync((_path || _load_path()).default.join(dir, (_constants || _load_constants()).NODE_PACKAGE_JSON))) {
88959 return dir;
88960 }
88961
88962 prev = dir;
88963 dir = (_path || _load_path()).default.dirname(dir);
88964 } while (dir !== prev);
88965
88966 return base;
88967}
88968
88969var autoRun = exports.autoRun = module.children.length === 0;
88970
88971if (__webpack_require__.c[__webpack_require__.s] === module) {
88972 start().catch(function (error) {
88973 console.error(error.stack || error.message || error);
88974 process.exitCode = 1;
88975 });
88976}
88977
88978exports.default = start;
88979/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(150)(module)))
88980
88981/***/ }),
88982/* 505 */
88983/***/ (function(module, exports, __webpack_require__) {
88984
88985"use strict";
88986
88987
88988Object.defineProperty(exports, "__esModule", {
88989 value: true
88990});
88991
88992var _asyncToGenerator2;
88993
88994function _load_asyncToGenerator() {
88995 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
88996}
88997
88998var _classCallCheck2;
88999
89000function _load_classCallCheck() {
89001 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
89002}
89003
89004var _possibleConstructorReturn2;
89005
89006function _load_possibleConstructorReturn() {
89007 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
89008}
89009
89010var _inherits2;
89011
89012function _load_inherits() {
89013 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
89014}
89015
89016var _baseFetcher;
89017
89018function _load_baseFetcher() {
89019 return _baseFetcher = _interopRequireDefault(__webpack_require__(156));
89020}
89021
89022var _fs;
89023
89024function _load_fs() {
89025 return _fs = _interopRequireWildcard(__webpack_require__(8));
89026}
89027
89028function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
89029
89030function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
89031
89032var CopyFetcher = function (_BaseFetcher) {
89033 (0, (_inherits2 || _load_inherits()).default)(CopyFetcher, _BaseFetcher);
89034
89035 function CopyFetcher() {
89036 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, CopyFetcher);
89037 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseFetcher.apply(this, arguments));
89038 }
89039
89040 CopyFetcher.prototype._fetch = function () {
89041 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
89042 yield (_fs || _load_fs()).copy(this.reference, this.dest, this.reporter);
89043 return {
89044 hash: this.hash || '',
89045 resolved: null
89046 };
89047 });
89048
89049 function _fetch() {
89050 return _ref.apply(this, arguments);
89051 }
89052
89053 return _fetch;
89054 }();
89055
89056 return CopyFetcher;
89057}((_baseFetcher || _load_baseFetcher()).default);
89058
89059exports.default = CopyFetcher;
89060
89061/***/ }),
89062/* 506 */
89063/***/ (function(module, exports, __webpack_require__) {
89064
89065"use strict";
89066
89067
89068Object.defineProperty(exports, "__esModule", {
89069 value: true
89070});
89071
89072var _promise;
89073
89074function _load_promise() {
89075 return _promise = _interopRequireDefault(__webpack_require__(7));
89076}
89077
89078var _asyncToGenerator2;
89079
89080function _load_asyncToGenerator() {
89081 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
89082}
89083
89084var _classCallCheck2;
89085
89086function _load_classCallCheck() {
89087 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
89088}
89089
89090var _possibleConstructorReturn2;
89091
89092function _load_possibleConstructorReturn() {
89093 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
89094}
89095
89096var _inherits2;
89097
89098function _load_inherits() {
89099 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
89100}
89101
89102var _errors;
89103
89104function _load_errors() {
89105 return _errors = __webpack_require__(6);
89106}
89107
89108var _baseFetcher;
89109
89110function _load_baseFetcher() {
89111 return _baseFetcher = _interopRequireDefault(__webpack_require__(156));
89112}
89113
89114var _git;
89115
89116function _load_git() {
89117 return _git = _interopRequireDefault(__webpack_require__(205));
89118}
89119
89120var _fs;
89121
89122function _load_fs() {
89123 return _fs = _interopRequireWildcard(__webpack_require__(8));
89124}
89125
89126var _constants;
89127
89128function _load_constants() {
89129 return _constants = _interopRequireWildcard(__webpack_require__(13));
89130}
89131
89132var _crypto;
89133
89134function _load_crypto() {
89135 return _crypto = _interopRequireWildcard(__webpack_require__(158));
89136}
89137
89138var _install;
89139
89140function _load_install() {
89141 return _install = __webpack_require__(41);
89142}
89143
89144var _lockfile;
89145
89146function _load_lockfile() {
89147 return _lockfile = _interopRequireDefault(__webpack_require__(25));
89148}
89149
89150var _config;
89151
89152function _load_config() {
89153 return _config = _interopRequireDefault(__webpack_require__(149));
89154}
89155
89156var _pack;
89157
89158function _load_pack() {
89159 return _pack = __webpack_require__(155);
89160}
89161
89162function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
89163
89164function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
89165
89166var tarFs = __webpack_require__(184);
89167var url = __webpack_require__(29);
89168var path = __webpack_require__(1);
89169var fs = __webpack_require__(12);
89170
89171var invariant = __webpack_require__(15);
89172
89173var PACKED_FLAG = '1';
89174
89175var GitFetcher = function (_BaseFetcher) {
89176 (0, (_inherits2 || _load_inherits()).default)(GitFetcher, _BaseFetcher);
89177
89178 function GitFetcher() {
89179 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GitFetcher);
89180 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseFetcher.apply(this, arguments));
89181 }
89182
89183 GitFetcher.prototype.setupMirrorFromCache = function () {
89184 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
89185 var tarballMirrorPath = this.getTarballMirrorPath();
89186 var tarballCachePath = this.getTarballCachePath();
89187
89188 if (tarballMirrorPath == null) {
89189 return;
89190 }
89191
89192 if (!(yield (_fs || _load_fs()).exists(tarballMirrorPath)) && (yield (_fs || _load_fs()).exists(tarballCachePath))) {
89193 // The tarball doesn't exists in the offline cache but does in the cache; we import it to the mirror
89194 yield (_fs || _load_fs()).mkdirp(path.dirname(tarballMirrorPath));
89195 yield (_fs || _load_fs()).copy(tarballCachePath, tarballMirrorPath, this.reporter);
89196 }
89197 });
89198
89199 function setupMirrorFromCache() {
89200 return _ref.apply(this, arguments);
89201 }
89202
89203 return setupMirrorFromCache;
89204 }();
89205
89206 GitFetcher.prototype.getTarballMirrorPath = function getTarballMirrorPath() {
89207 var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
89208 _ref2$withCommit = _ref2.withCommit,
89209 withCommit = _ref2$withCommit === undefined ? true : _ref2$withCommit;
89210
89211 var _url$parse = url.parse(this.reference),
89212 pathname = _url$parse.pathname;
89213
89214 if (pathname == null) {
89215 return null;
89216 }
89217
89218 var hash = this.hash;
89219
89220 var packageFilename = withCommit && hash ? `${path.basename(pathname)}-${hash}` : `${path.basename(pathname)}`;
89221
89222 if (packageFilename.startsWith(':')) {
89223 packageFilename = packageFilename.substr(1);
89224 }
89225
89226 return this.config.getOfflineMirrorPath(packageFilename);
89227 };
89228
89229 GitFetcher.prototype.getTarballCachePath = function getTarballCachePath() {
89230 return path.join(this.dest, (_constants || _load_constants()).TARBALL_FILENAME);
89231 };
89232
89233 GitFetcher.prototype.getLocalPaths = function getLocalPaths(override) {
89234 var paths = [override ? path.resolve(this.config.cwd, override) : null, this.getTarballMirrorPath(), this.getTarballMirrorPath({ withCommit: false }), this.getTarballCachePath()];
89235 // $FlowFixMe: https://github.com/facebook/flow/issues/1414
89236 return paths.filter(function (path) {
89237 return path != null;
89238 });
89239 };
89240
89241 GitFetcher.prototype.fetchFromLocal = function () {
89242 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (override) {
89243 var _this2 = this;
89244
89245 var tarPaths = this.getLocalPaths(override);
89246 var stream = yield (_fs || _load_fs()).readFirstAvailableStream(tarPaths);
89247
89248 return new (_promise || _load_promise()).default(function (resolve, reject) {
89249 if (!stream) {
89250 reject(new (_errors || _load_errors()).MessageError(_this2.reporter.lang('tarballNotInNetworkOrCache', _this2.reference, tarPaths)));
89251 return;
89252 }
89253 invariant(stream, 'cachedStream should be available at this point');
89254 // $FlowFixMe - This is available https://nodejs.org/api/fs.html#fs_readstream_path
89255 var tarballPath = stream.path;
89256
89257 var untarStream = _this2._createUntarStream(_this2.dest);
89258
89259 var hashStream = new (_crypto || _load_crypto()).HashStream();
89260 stream.pipe(hashStream).pipe(untarStream).on('finish', function () {
89261 var expectHash = _this2.hash;
89262 invariant(expectHash, 'Commit hash required');
89263
89264 var actualHash = hashStream.getHash();
89265
89266 // This condition is disabled because "expectHash" actually is the commit hash
89267 // This is a design issue that we'll need to fix (https://github.com/yarnpkg/yarn/pull/3449)
89268 if (true) {
89269 resolve({
89270 hash: expectHash
89271 });
89272 } else {
89273 reject(new (_errors || _load_errors()).SecurityError(_this2.config.reporter.lang('fetchBadHashWithPath', _this2.packageName, _this2.remote.reference, expectHash, actualHash)));
89274 }
89275 }).on('error', function (err) {
89276 reject(new (_errors || _load_errors()).MessageError(this.reporter.lang('fetchErrorCorrupt', err.message, tarballPath)));
89277 });
89278 });
89279 });
89280
89281 function fetchFromLocal(_x2) {
89282 return _ref3.apply(this, arguments);
89283 }
89284
89285 return fetchFromLocal;
89286 }();
89287
89288 GitFetcher.prototype.hasPrepareScript = function () {
89289 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (git) {
89290 var manifestFile = yield git.getFile('package.json');
89291
89292 if (manifestFile) {
89293 var scripts = JSON.parse(manifestFile).scripts;
89294 var _hasPrepareScript = Boolean(scripts && scripts.prepare);
89295 return _hasPrepareScript;
89296 }
89297
89298 return false;
89299 });
89300
89301 function hasPrepareScript(_x3) {
89302 return _ref4.apply(this, arguments);
89303 }
89304
89305 return hasPrepareScript;
89306 }();
89307
89308 GitFetcher.prototype.fetchFromExternal = function () {
89309 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
89310 var hash = this.hash;
89311 invariant(hash, 'Commit hash required');
89312
89313 var gitUrl = (_git || _load_git()).default.npmUrlToGitUrl(this.reference);
89314 var git = new (_git || _load_git()).default(this.config, gitUrl, hash);
89315 yield git.init();
89316
89317 if (yield this.hasPrepareScript(git)) {
89318 yield this.fetchFromInstallAndPack(git);
89319 } else {
89320 yield this.fetchFromGitArchive(git);
89321 }
89322
89323 return {
89324 hash
89325 };
89326 });
89327
89328 function fetchFromExternal() {
89329 return _ref5.apply(this, arguments);
89330 }
89331
89332 return fetchFromExternal;
89333 }();
89334
89335 GitFetcher.prototype.fetchFromInstallAndPack = function () {
89336 var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (git) {
89337 var prepareDirectory = this.config.getTemp(`${(_crypto || _load_crypto()).hash(git.gitUrl.repository)}.${git.hash}.prepare`);
89338 yield (_fs || _load_fs()).unlink(prepareDirectory);
89339
89340 yield git.clone(prepareDirectory);
89341
89342 var _ref7 = yield (_promise || _load_promise()).default.all([(_config || _load_config()).default.create({
89343 binLinks: true,
89344 cwd: prepareDirectory,
89345 disablePrepublish: true,
89346 production: false
89347 }, this.reporter), (_lockfile || _load_lockfile()).default.fromDirectory(prepareDirectory, this.reporter)]),
89348 prepareConfig = _ref7[0],
89349 prepareLockFile = _ref7[1];
89350
89351 yield (0, (_install || _load_install()).install)(prepareConfig, this.reporter, {}, prepareLockFile);
89352
89353 var tarballMirrorPath = this.getTarballMirrorPath();
89354 var tarballCachePath = this.getTarballCachePath();
89355
89356 if (tarballMirrorPath) {
89357 yield this._packToTarball(prepareConfig, tarballMirrorPath);
89358 }
89359 if (tarballCachePath) {
89360 yield this._packToTarball(prepareConfig, tarballCachePath);
89361 }
89362
89363 yield this._packToDirectory(prepareConfig, this.dest);
89364
89365 yield (_fs || _load_fs()).unlink(prepareDirectory);
89366 });
89367
89368 function fetchFromInstallAndPack(_x4) {
89369 return _ref6.apply(this, arguments);
89370 }
89371
89372 return fetchFromInstallAndPack;
89373 }();
89374
89375 GitFetcher.prototype._packToTarball = function () {
89376 var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, path) {
89377 var tarballStream = yield this._createTarballStream(config);
89378 yield new (_promise || _load_promise()).default(function (resolve, reject) {
89379 var writeStream = fs.createWriteStream(path);
89380 tarballStream.on('error', reject);
89381 writeStream.on('error', reject);
89382 writeStream.on('end', resolve);
89383 writeStream.on('open', function () {
89384 tarballStream.pipe(writeStream);
89385 });
89386 writeStream.once('finish', resolve);
89387 });
89388 });
89389
89390 function _packToTarball(_x5, _x6) {
89391 return _ref8.apply(this, arguments);
89392 }
89393
89394 return _packToTarball;
89395 }();
89396
89397 GitFetcher.prototype._packToDirectory = function () {
89398 var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, dest) {
89399 var _this3 = this;
89400
89401 var tarballStream = yield this._createTarballStream(config);
89402 yield new (_promise || _load_promise()).default(function (resolve, reject) {
89403 var untarStream = _this3._createUntarStream(dest);
89404 tarballStream.on('error', reject);
89405 untarStream.on('error', reject);
89406 untarStream.on('end', resolve);
89407 untarStream.once('finish', resolve);
89408 tarballStream.pipe(untarStream);
89409 });
89410 });
89411
89412 function _packToDirectory(_x7, _x8) {
89413 return _ref9.apply(this, arguments);
89414 }
89415
89416 return _packToDirectory;
89417 }();
89418
89419 GitFetcher.prototype._createTarballStream = function _createTarballStream(config) {
89420 var savedPackedHeader = false;
89421 return (0, (_pack || _load_pack()).packTarball)(config, {
89422 mapHeader(header) {
89423 if (!savedPackedHeader) {
89424 savedPackedHeader = true;
89425 header.pax = header.pax || {};
89426 // add a custom data on the first header
89427 // in order to distinguish a tar from "git archive" and a tar from "pack" command
89428 header.pax.packed = PACKED_FLAG;
89429 }
89430 return header;
89431 }
89432 });
89433 };
89434
89435 GitFetcher.prototype._createUntarStream = function _createUntarStream(dest) {
89436 var PREFIX = 'package/';
89437 var isPackedTarball = undefined;
89438 return tarFs.extract(dest, {
89439 dmode: 0o555, // all dirs should be readable
89440 fmode: 0o444, // all files should be readable
89441 chown: false, // don't chown. just leave as it is
89442 map: function map(header) {
89443 if (isPackedTarball === undefined) {
89444 isPackedTarball = header.pax && header.pax.packed === PACKED_FLAG;
89445 }
89446 if (isPackedTarball) {
89447 header.name = header.name.substr(PREFIX.length);
89448 }
89449 }
89450 });
89451 };
89452
89453 GitFetcher.prototype.fetchFromGitArchive = function () {
89454 var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (git) {
89455 yield git.clone(this.dest);
89456 var tarballMirrorPath = this.getTarballMirrorPath();
89457 var tarballCachePath = this.getTarballCachePath();
89458
89459 if (tarballMirrorPath) {
89460 yield git.archive(tarballMirrorPath);
89461 }
89462
89463 if (tarballCachePath) {
89464 yield git.archive(tarballCachePath);
89465 }
89466 });
89467
89468 function fetchFromGitArchive(_x9) {
89469 return _ref10.apply(this, arguments);
89470 }
89471
89472 return fetchFromGitArchive;
89473 }();
89474
89475 GitFetcher.prototype._fetch = function _fetch() {
89476 var _this4 = this;
89477
89478 return this.fetchFromLocal().catch(function (err) {
89479 return _this4.fetchFromExternal();
89480 });
89481 };
89482
89483 return GitFetcher;
89484}((_baseFetcher || _load_baseFetcher()).default);
89485
89486exports.default = GitFetcher;
89487
89488/***/ }),
89489/* 507 */
89490/***/ (function(module, exports, __webpack_require__) {
89491
89492"use strict";
89493
89494
89495Object.defineProperty(exports, "__esModule", {
89496 value: true
89497});
89498exports.workspace = exports.tarball = exports.git = exports.copy = exports.base = undefined;
89499
89500var _baseFetcher;
89501
89502function _load_baseFetcher() {
89503 return _baseFetcher = _interopRequireDefault(__webpack_require__(156));
89504}
89505
89506var _copyFetcher;
89507
89508function _load_copyFetcher() {
89509 return _copyFetcher = _interopRequireDefault(__webpack_require__(505));
89510}
89511
89512var _gitFetcher;
89513
89514function _load_gitFetcher() {
89515 return _gitFetcher = _interopRequireDefault(__webpack_require__(506));
89516}
89517
89518var _tarballFetcher;
89519
89520function _load_tarballFetcher() {
89521 return _tarballFetcher = _interopRequireDefault(__webpack_require__(300));
89522}
89523
89524var _workspaceFetcher;
89525
89526function _load_workspaceFetcher() {
89527 return _workspaceFetcher = _interopRequireDefault(__webpack_require__(508));
89528}
89529
89530function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
89531
89532exports.base = (_baseFetcher || _load_baseFetcher()).default;
89533exports.copy = (_copyFetcher || _load_copyFetcher()).default;
89534exports.git = (_gitFetcher || _load_gitFetcher()).default;
89535exports.tarball = (_tarballFetcher || _load_tarballFetcher()).default;
89536exports.workspace = (_workspaceFetcher || _load_workspaceFetcher()).default;
89537
89538/***/ }),
89539/* 508 */
89540/***/ (function(module, exports, __webpack_require__) {
89541
89542"use strict";
89543
89544
89545Object.defineProperty(exports, "__esModule", {
89546 value: true
89547});
89548
89549var _extends2;
89550
89551function _load_extends() {
89552 return _extends2 = _interopRequireDefault(__webpack_require__(24));
89553}
89554
89555var _asyncToGenerator2;
89556
89557function _load_asyncToGenerator() {
89558 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
89559}
89560
89561var _promise;
89562
89563function _load_promise() {
89564 return _promise = _interopRequireDefault(__webpack_require__(7));
89565}
89566
89567var _classCallCheck2;
89568
89569function _load_classCallCheck() {
89570 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
89571}
89572
89573var _packageFetcher;
89574
89575function _load_packageFetcher() {
89576 return _packageFetcher = __webpack_require__(197);
89577}
89578
89579function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
89580
89581var WorkspaceFetcher = function () {
89582 function WorkspaceFetcher(dest, remote, config) {
89583 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, WorkspaceFetcher);
89584
89585 this.config = config;
89586 this.dest = dest;
89587 this.registry = remote.registry;
89588 this.workspaceDir = remote.reference;
89589 this.registryRemote = remote.registryRemote;
89590 }
89591
89592 WorkspaceFetcher.prototype.setupMirrorFromCache = function setupMirrorFromCache() {
89593 return (_promise || _load_promise()).default.resolve();
89594 };
89595
89596 WorkspaceFetcher.prototype.fetch = function () {
89597 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
89598 var pkg = yield this.config.readManifest(this.workspaceDir, this.registry);
89599
89600 if (this.registryRemote) {
89601 yield this.fetchRemoteWorkspace(this.registryRemote, pkg);
89602 }
89603
89604 return {
89605 resolved: null,
89606 hash: '',
89607 cached: false,
89608 dest: this.dest,
89609 package: (0, (_extends2 || _load_extends()).default)({}, pkg, {
89610 _uid: pkg.version
89611 })
89612 };
89613 });
89614
89615 function fetch() {
89616 return _ref.apply(this, arguments);
89617 }
89618
89619 return fetch;
89620 }();
89621
89622 WorkspaceFetcher.prototype.fetchRemoteWorkspace = function fetchRemoteWorkspace(remote, manifest) {
89623 return (0, (_packageFetcher || _load_packageFetcher()).fetchOneRemote)(remote, manifest.name, manifest.version, this.dest, this.config);
89624 };
89625
89626 return WorkspaceFetcher;
89627}();
89628
89629exports.default = WorkspaceFetcher;
89630
89631/***/ }),
89632/* 509 */
89633/***/ (function(module, exports, __webpack_require__) {
89634
89635"use strict";
89636
89637
89638Object.defineProperty(exports, "__esModule", {
89639 value: true
89640});
89641exports.buildTree = undefined;
89642
89643var _getIterator2;
89644
89645function _load_getIterator() {
89646 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
89647}
89648
89649var _asyncToGenerator2;
89650
89651function _load_asyncToGenerator() {
89652 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
89653}
89654
89655var buildTree = exports.buildTree = function () {
89656 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (resolver, linker, patterns, ignoreHoisted) {
89657 var treesByKey = {};
89658 var trees = [];
89659 var flatTree = yield linker.getFlatHoistedTree(patterns);
89660
89661 // If using workspaces, filter out the virtual manifest
89662 var workspaceLayout = resolver.workspaceLayout;
89663
89664 var hoisted = workspaceLayout && workspaceLayout.virtualManifestName ? flatTree.filter(function (_ref2) {
89665 var key = _ref2[0];
89666 return key.indexOf(workspaceLayout.virtualManifestName) === -1;
89667 }) : flatTree;
89668
89669 var hoistedByKey = {};
89670 for (var _iterator = hoisted, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
89671 var _ref4;
89672
89673 if (_isArray) {
89674 if (_i >= _iterator.length) break;
89675 _ref4 = _iterator[_i++];
89676 } else {
89677 _i = _iterator.next();
89678 if (_i.done) break;
89679 _ref4 = _i.value;
89680 }
89681
89682 var _ref3 = _ref4;
89683 var key = _ref3[0];
89684 var info = _ref3[1];
89685
89686 hoistedByKey[key] = info;
89687 }
89688
89689 // build initial trees
89690 for (var _iterator2 = hoisted, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
89691 var _ref6;
89692
89693 if (_isArray2) {
89694 if (_i2 >= _iterator2.length) break;
89695 _ref6 = _iterator2[_i2++];
89696 } else {
89697 _i2 = _iterator2.next();
89698 if (_i2.done) break;
89699 _ref6 = _i2.value;
89700 }
89701
89702 var _ref5 = _ref6;
89703 var _info = _ref5[1];
89704
89705 var ref = _info.pkg._reference;
89706 // const parent = getParent(info.key, treesByKey);
89707 var _children = [];
89708 // let depth = 0;
89709 invariant(ref, 'expected reference');
89710
89711 // check parent to obtain next depth
89712 // if (parent && parent.depth > 0) {
89713 // depth = parent.depth + 1;
89714 // } else {
89715 // depth = 0;
89716 // }
89717
89718 treesByKey[_info.key] = {
89719 name: _info.pkg.name,
89720 version: _info.pkg.version,
89721 children: _children,
89722 manifest: _info
89723 };
89724 }
89725
89726 // add children
89727 for (var _iterator3 = hoisted, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
89728 var _ref8;
89729
89730 if (_isArray3) {
89731 if (_i3 >= _iterator3.length) break;
89732 _ref8 = _iterator3[_i3++];
89733 } else {
89734 _i3 = _iterator3.next();
89735 if (_i3.done) break;
89736 _ref8 = _i3.value;
89737 }
89738
89739 var _ref7 = _ref8;
89740 var _info2 = _ref7[1];
89741
89742 var tree = treesByKey[_info2.key];
89743 var parent = getParent(_info2.key, treesByKey);
89744 if (!tree) {
89745 continue;
89746 }
89747
89748 if (_info2.key.split('#').length === 1) {
89749 trees.push(tree);
89750 continue;
89751 }
89752
89753 if (parent) {
89754 parent.children.push(tree);
89755 }
89756 }
89757
89758 return trees;
89759 });
89760
89761 return function buildTree(_x, _x2, _x3, _x4) {
89762 return _ref.apply(this, arguments);
89763 };
89764}();
89765
89766exports.getParent = getParent;
89767
89768function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
89769
89770var invariant = __webpack_require__(15);
89771
89772function getParent(key, treesByKey) {
89773 var parentKey = key.slice(0, key.lastIndexOf('#'));
89774 return treesByKey[parentKey];
89775}
89776
89777/***/ }),
89778/* 510 */
89779/***/ (function(module, exports, __webpack_require__) {
89780
89781"use strict";
89782
89783
89784Object.defineProperty(exports, "__esModule", {
89785 value: true
89786});
89787
89788var _keys;
89789
89790function _load_keys() {
89791 return _keys = _interopRequireDefault(__webpack_require__(14));
89792}
89793
89794var _stringify2;
89795
89796function _load_stringify() {
89797 return _stringify2 = _interopRequireDefault(__webpack_require__(36));
89798}
89799
89800exports.default = stringify;
89801
89802var _misc;
89803
89804function _load_misc() {
89805 return _misc = __webpack_require__(28);
89806}
89807
89808var _constants;
89809
89810function _load_constants() {
89811 return _constants = __webpack_require__(13);
89812}
89813
89814var _package;
89815
89816function _load_package() {
89817 return _package = __webpack_require__(438);
89818}
89819
89820function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
89821
89822var NODE_VERSION = process.version;
89823
89824function shouldWrapKey(str) {
89825 return str.indexOf('true') === 0 || str.indexOf('false') === 0 || /[:\s\n\\",\[\]]/g.test(str) || /^[0-9]/g.test(str) || !/^[a-zA-Z]/g.test(str);
89826}
89827
89828function maybeWrap(str) {
89829 if (typeof str === 'boolean' || typeof str === 'number' || shouldWrapKey(str)) {
89830 return (0, (_stringify2 || _load_stringify()).default)(str);
89831 } else {
89832 return str;
89833 }
89834}
89835
89836var priorities = {
89837 name: 1,
89838 version: 2,
89839 uid: 3,
89840 resolved: 4,
89841 integrity: 5,
89842 registry: 6,
89843 dependencies: 7
89844};
89845
89846function priorityThenAlphaSort(a, b) {
89847 if (priorities[a] || priorities[b]) {
89848 return (priorities[a] || 100) > (priorities[b] || 100) ? 1 : -1;
89849 } else {
89850 return (0, (_misc || _load_misc()).sortAlpha)(a, b);
89851 }
89852}
89853
89854function _stringify(obj, options) {
89855 if (typeof obj !== 'object') {
89856 throw new TypeError();
89857 }
89858
89859 var indent = options.indent;
89860 var lines = [];
89861
89862 // Sorting order needs to be consistent between runs, we run native sort by name because there are no
89863 // problems with it being unstable because there are no to keys the same
89864 // However priorities can be duplicated and native sort can shuffle things from run to run
89865 var keys = (0, (_keys || _load_keys()).default)(obj).sort(priorityThenAlphaSort);
89866
89867 var addedKeys = [];
89868
89869 for (var i = 0; i < keys.length; i++) {
89870 var _key = keys[i];
89871 var val = obj[_key];
89872 if (val == null || addedKeys.indexOf(_key) >= 0) {
89873 continue;
89874 }
89875
89876 var valKeys = [_key];
89877
89878 // get all keys that have the same value equality, we only want this for objects
89879 if (typeof val === 'object') {
89880 for (var j = i + 1; j < keys.length; j++) {
89881 var _key2 = keys[j];
89882 if (val === obj[_key2]) {
89883 valKeys.push(_key2);
89884 }
89885 }
89886 }
89887
89888 var keyLine = valKeys.sort((_misc || _load_misc()).sortAlpha).map(maybeWrap).join(', ');
89889
89890 if (typeof val === 'string' || typeof val === 'boolean' || typeof val === 'number') {
89891 lines.push(`${keyLine} ${maybeWrap(val)}`);
89892 } else if (typeof val === 'object') {
89893 lines.push(`${keyLine}:\n${_stringify(val, { indent: indent + ' ' })}` + (options.topLevel ? '\n' : ''));
89894 } else {
89895 throw new TypeError();
89896 }
89897
89898 addedKeys = addedKeys.concat(valKeys);
89899 }
89900
89901 return indent + lines.join(`\n${indent}`);
89902}
89903
89904function stringify(obj, noHeader, enableVersions) {
89905 var val = _stringify(obj, {
89906 indent: '',
89907 topLevel: true
89908 });
89909 if (noHeader) {
89910 return val;
89911 }
89912
89913 var lines = [];
89914 lines.push('# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.');
89915 lines.push(`# yarn lockfile v${(_constants || _load_constants()).LOCKFILE_VERSION}`);
89916 if (enableVersions) {
89917 lines.push(`# yarn v${(_package || _load_package()).version}`);
89918 lines.push(`# node ${NODE_VERSION}`);
89919 }
89920 lines.push('\n');
89921 lines.push(val);
89922
89923 return lines.join('\n');
89924}
89925
89926/***/ }),
89927/* 511 */
89928/***/ (function(module, exports, __webpack_require__) {
89929
89930"use strict";
89931
89932
89933Object.defineProperty(exports, "__esModule", {
89934 value: true
89935});
89936
89937var _promise;
89938
89939function _load_promise() {
89940 return _promise = _interopRequireDefault(__webpack_require__(7));
89941}
89942
89943var _classCallCheck2;
89944
89945function _load_classCallCheck() {
89946 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
89947}
89948
89949function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
89950
89951var semver = __webpack_require__(27);
89952
89953// This isn't really a "proper" constraint resolver. We just return the highest semver
89954// version in the versions passed that satisfies the input range. This vastly reduces
89955// the complexity and is very efficient for package resolution.
89956
89957var PackageConstraintResolver = function () {
89958 function PackageConstraintResolver(config, reporter) {
89959 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageConstraintResolver);
89960
89961 this.reporter = reporter;
89962 this.config = config;
89963 }
89964
89965 PackageConstraintResolver.prototype.reduce = function reduce(versions, range) {
89966 if (range === 'latest') {
89967 // Usually versions are already ordered and the last one is the latest
89968 return (_promise || _load_promise()).default.resolve(versions[versions.length - 1]);
89969 } else {
89970 return (_promise || _load_promise()).default.resolve(semver.maxSatisfying(versions, range, this.config.looseSemver));
89971 }
89972 };
89973
89974 return PackageConstraintResolver;
89975}();
89976
89977exports.default = PackageConstraintResolver;
89978
89979/***/ }),
89980/* 512 */
89981/***/ (function(module, exports, __webpack_require__) {
89982
89983"use strict";
89984
89985
89986Object.defineProperty(exports, "__esModule", {
89987 value: true
89988});
89989exports.NohoistResolver = exports.HoistManifest = undefined;
89990
89991var _extends2;
89992
89993function _load_extends() {
89994 return _extends2 = _interopRequireDefault(__webpack_require__(24));
89995}
89996
89997var _from;
89998
89999function _load_from() {
90000 return _from = _interopRequireDefault(__webpack_require__(53));
90001}
90002
90003var _keys;
90004
90005function _load_keys() {
90006 return _keys = _interopRequireDefault(__webpack_require__(14));
90007}
90008
90009var _getIterator2;
90010
90011function _load_getIterator() {
90012 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
90013}
90014
90015var _map;
90016
90017function _load_map() {
90018 return _map = _interopRequireDefault(__webpack_require__(42));
90019}
90020
90021var _classCallCheck2;
90022
90023function _load_classCallCheck() {
90024 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
90025}
90026
90027var _set;
90028
90029function _load_set() {
90030 return _set = _interopRequireDefault(__webpack_require__(16));
90031}
90032
90033var _config;
90034
90035function _load_config() {
90036 return _config = _interopRequireDefault(__webpack_require__(149));
90037}
90038
90039var _misc;
90040
90041function _load_misc() {
90042 return _misc = __webpack_require__(28);
90043}
90044
90045var _micromatch;
90046
90047function _load_micromatch() {
90048 return _micromatch = _interopRequireDefault(__webpack_require__(109));
90049}
90050
90051var _workspaceLayout2;
90052
90053function _load_workspaceLayout() {
90054 return _workspaceLayout2 = _interopRequireDefault(__webpack_require__(87));
90055}
90056
90057function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
90058
90059var invariant = __webpack_require__(15);
90060
90061var path = __webpack_require__(1);
90062
90063var historyCounter = 0;
90064
90065var LINK_TYPES = new (_set || _load_set()).default(['workspace', 'link']);
90066
90067var HoistManifest = exports.HoistManifest = function () {
90068 function HoistManifest(key, parts, pkg, loc, isDirectRequire, isRequired, isIncompatible) {
90069 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, HoistManifest);
90070
90071 this.isDirectRequire = isDirectRequire;
90072 this.isRequired = isRequired;
90073 this.isIncompatible = isIncompatible;
90074
90075 this.loc = loc;
90076 this.pkg = pkg;
90077 this.key = key;
90078 this.parts = parts;
90079 this.originalKey = key;
90080 this.previousPaths = [];
90081
90082 this.history = [];
90083 this.addHistory(`Start position = ${key}`);
90084
90085 this.isNohoist = false;
90086 this.originalParentPath = '';
90087
90088 this.shallowPaths = [];
90089 this.isShallow = false;
90090 }
90091
90092 //focus
90093
90094
90095 // nohoist info
90096
90097
90098 HoistManifest.prototype.addHistory = function addHistory(msg) {
90099 this.history.push(`${++historyCounter}: ${msg}`);
90100 };
90101
90102 return HoistManifest;
90103}();
90104
90105var PackageHoister = function () {
90106 function PackageHoister(config, resolver) {
90107 var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
90108 ignoreOptional = _ref.ignoreOptional,
90109 workspaceLayout = _ref.workspaceLayout;
90110
90111 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageHoister);
90112
90113 this.resolver = resolver;
90114 this.config = config;
90115
90116 this.ignoreOptional = ignoreOptional;
90117
90118 this.taintedKeys = new (_map || _load_map()).default();
90119 this.levelQueue = [];
90120 this.tree = new (_map || _load_map()).default();
90121
90122 this.workspaceLayout = workspaceLayout;
90123
90124 this.nohoistResolver = new NohoistResolver(config, resolver);
90125 }
90126
90127 /**
90128 * Taint this key and prevent any modules from being hoisted to it.
90129 */
90130
90131 PackageHoister.prototype.taintKey = function taintKey(key, info) {
90132 var existingTaint = this.taintedKeys.get(key);
90133 if (existingTaint && existingTaint.loc !== info.loc) {
90134 return false;
90135 } else {
90136 this.taintedKeys.set(key, info);
90137 return true;
90138 }
90139 };
90140
90141 /**
90142 * Implode an array of ancestry parts into a key.
90143 */
90144
90145 PackageHoister.prototype.implodeKey = function implodeKey(parts) {
90146 return parts.join('#');
90147 };
90148
90149 /**
90150 * Seed the hoister with patterns taken from the included resolver.
90151 */
90152
90153 PackageHoister.prototype.seed = function seed(patterns) {
90154 var _this = this;
90155
90156 this.prepass(patterns);
90157
90158 for (var _iterator = this.resolver.dedupePatterns(patterns), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
90159 var _ref2;
90160
90161 if (_isArray) {
90162 if (_i >= _iterator.length) break;
90163 _ref2 = _iterator[_i++];
90164 } else {
90165 _i = _iterator.next();
90166 if (_i.done) break;
90167 _ref2 = _i.value;
90168 }
90169
90170 var _pattern = _ref2;
90171
90172 this._seed(_pattern, { isDirectRequire: true });
90173 }
90174
90175 var _loop = function _loop() {
90176 var queue = _this.levelQueue;
90177 if (!queue.length) {
90178 _this._propagateRequired();
90179 return {
90180 v: void 0
90181 };
90182 }
90183
90184 _this.levelQueue = [];
90185
90186 // sort queue to get determinism between runs
90187 queue = queue.sort(function (_ref3, _ref4) {
90188 var aPattern = _ref3[0];
90189 var bPattern = _ref4[0];
90190
90191 return (0, (_misc || _load_misc()).sortAlpha)(aPattern, bPattern);
90192 });
90193
90194 // sort the queue again to hoist packages without peer dependencies first
90195 var sortedQueue = [];
90196 var availableSet = new (_set || _load_set()).default();
90197
90198 var hasChanged = true;
90199 while (queue.length > 0 && hasChanged) {
90200 hasChanged = false;
90201
90202 var queueCopy = queue;
90203 queue = [];
90204 for (var t = 0; t < queueCopy.length; ++t) {
90205 var queueItem = queueCopy[t];
90206 var _pattern2 = queueItem[0];
90207 var _pkg = _this.resolver.getStrictResolvedPattern(_pattern2);
90208
90209 var peerDependencies = (0, (_keys || _load_keys()).default)(_pkg.peerDependencies || {});
90210 var areDependenciesFulfilled = peerDependencies.every(function (peerDependency) {
90211 return availableSet.has(peerDependency);
90212 });
90213
90214 if (areDependenciesFulfilled) {
90215 // Move the package inside our sorted queue
90216 sortedQueue.push(queueItem);
90217
90218 // Add it to our set, so that we know it is available
90219 availableSet.add(_pattern2);
90220
90221 // Schedule a next pass, in case other packages had peer dependencies on this one
90222 hasChanged = true;
90223 } else {
90224 queue.push(queueItem);
90225 }
90226 }
90227 }
90228
90229 // We might end up with some packages left in the queue, that have not been sorted. We reach this codepath if two
90230 // packages have a cyclic dependency, or if the peer dependency is provided by a parent package. In these case,
90231 // nothing we can do, so we just add all of these packages to the end of the sorted queue.
90232 sortedQueue = sortedQueue.concat(queue);
90233
90234 for (var _iterator2 = sortedQueue, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
90235 var _ref6;
90236
90237 if (_isArray2) {
90238 if (_i2 >= _iterator2.length) break;
90239 _ref6 = _iterator2[_i2++];
90240 } else {
90241 _i2 = _iterator2.next();
90242 if (_i2.done) break;
90243 _ref6 = _i2.value;
90244 }
90245
90246 var _ref5 = _ref6;
90247 var _pattern3 = _ref5[0];
90248 var parent = _ref5[1];
90249
90250 var info = _this._seed(_pattern3, { isDirectRequire: false, parent });
90251 if (info) {
90252 _this.hoist(info);
90253 }
90254 }
90255 };
90256
90257 while (true) {
90258 var _ret = _loop();
90259
90260 if (typeof _ret === "object") return _ret.v;
90261 }
90262 };
90263
90264 /**
90265 * Seed the hoister with a specific pattern.
90266 */
90267
90268 PackageHoister.prototype._seed = function _seed(pattern, _ref7) {
90269 var isDirectRequire = _ref7.isDirectRequire,
90270 parent = _ref7.parent;
90271
90272 //
90273 var pkg = this.resolver.getStrictResolvedPattern(pattern);
90274 var ref = pkg._reference;
90275 invariant(ref, 'expected reference');
90276
90277 //
90278 var parentParts = [];
90279
90280 var isIncompatible = ref.incompatible;
90281 var isMarkedAsOptional = ref.optional && this.ignoreOptional;
90282
90283 var isRequired = isDirectRequire && !ref.ignore && !isIncompatible && !isMarkedAsOptional;
90284
90285 if (parent) {
90286 if (!this.tree.get(parent.key)) {
90287 return null;
90288 }
90289 // non ignored dependencies inherit parent's ignored status
90290 // parent may transition from ignored to non ignored when hoisted if it is used in another non ignored branch
90291 if (!isDirectRequire && !isIncompatible && parent.isRequired && !isMarkedAsOptional) {
90292 isRequired = true;
90293 }
90294 parentParts = parent.parts;
90295 }
90296
90297 //
90298 var loc = this.config.generateModuleCachePath(ref);
90299 var parts = parentParts.concat(pkg.name);
90300 var key = this.implodeKey(parts);
90301 var info = new HoistManifest(key, parts, pkg, loc, isDirectRequire, isRequired, isIncompatible);
90302
90303 this.nohoistResolver.initNohoist(info, parent);
90304
90305 this.tree.set(key, info);
90306 this.taintKey(key, info);
90307
90308 //
90309 var pushed = new (_set || _load_set()).default();
90310 for (var _iterator3 = ref.dependencies, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
90311 var _ref8;
90312
90313 if (_isArray3) {
90314 if (_i3 >= _iterator3.length) break;
90315 _ref8 = _iterator3[_i3++];
90316 } else {
90317 _i3 = _iterator3.next();
90318 if (_i3.done) break;
90319 _ref8 = _i3.value;
90320 }
90321
90322 var depPattern = _ref8;
90323
90324 if (!pushed.has(depPattern)) {
90325 this.levelQueue.push([depPattern, info]);
90326 pushed.add(depPattern);
90327 }
90328 }
90329
90330 return info;
90331 };
90332
90333 /**
90334 * Propagate inherited ignore statuses from non-ignored to ignored packages
90335 */
90336
90337 PackageHoister.prototype._propagateRequired = function _propagateRequired() {
90338 //
90339 var toVisit = [];
90340
90341 // enumerate all non-ignored packages
90342 for (var _iterator4 = this.tree.entries(), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
90343 var _ref9;
90344
90345 if (_isArray4) {
90346 if (_i4 >= _iterator4.length) break;
90347 _ref9 = _iterator4[_i4++];
90348 } else {
90349 _i4 = _iterator4.next();
90350 if (_i4.done) break;
90351 _ref9 = _i4.value;
90352 }
90353
90354 var entry = _ref9;
90355
90356 if (entry[1].isRequired) {
90357 toVisit.push(entry[1]);
90358 }
90359 }
90360
90361 // visit them
90362 while (toVisit.length) {
90363 var info = toVisit.shift();
90364 var ref = info.pkg._reference;
90365 invariant(ref, 'expected reference');
90366
90367 for (var _iterator5 = ref.dependencies, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
90368 var _ref10;
90369
90370 if (_isArray5) {
90371 if (_i5 >= _iterator5.length) break;
90372 _ref10 = _iterator5[_i5++];
90373 } else {
90374 _i5 = _iterator5.next();
90375 if (_i5.done) break;
90376 _ref10 = _i5.value;
90377 }
90378
90379 var depPattern = _ref10;
90380
90381 var depinfo = this._lookupDependency(info, depPattern);
90382
90383 if (!depinfo) {
90384 continue;
90385 }
90386
90387 var depRef = depinfo.pkg._reference;
90388
90389 // If it's marked as optional, but the parent is required and the
90390 // dependency was not listed in `optionalDependencies`, then we mark the
90391 // dependency as required.
90392 var isMarkedAsOptional = depRef && depRef.optional && this.ignoreOptional && !(info.isRequired && depRef.hint !== 'optional');
90393
90394 if (!depinfo.isRequired && !depinfo.isIncompatible && !isMarkedAsOptional) {
90395 depinfo.isRequired = true;
90396 depinfo.addHistory(`Mark as non-ignored because of usage by ${info.key}`);
90397 toVisit.push(depinfo);
90398 }
90399 }
90400 }
90401 };
90402
90403 /**
90404 * Looks up the package a dependency resolves to
90405 */
90406
90407 PackageHoister.prototype._lookupDependency = function _lookupDependency(info, depPattern) {
90408 //
90409 var pkg = this.resolver.getStrictResolvedPattern(depPattern);
90410 var ref = pkg._reference;
90411 invariant(ref, 'expected reference');
90412
90413 //
90414 for (var i = info.parts.length; i >= 0; i--) {
90415 var checkParts = info.parts.slice(0, i).concat(pkg.name);
90416 var checkKey = this.implodeKey(checkParts);
90417 var existing = this.tree.get(checkKey);
90418 if (existing) {
90419 return existing;
90420 }
90421 }
90422
90423 return null;
90424 };
90425
90426 /**
90427 * Find the highest position we can hoist this module to.
90428 */
90429
90430 PackageHoister.prototype.getNewParts = function getNewParts(key, info, parts) {
90431 var _this2 = this;
90432
90433 var stepUp = false;
90434
90435 var highestHoistingPoint = this.nohoistResolver.highestHoistingPoint(info) || 0;
90436 var fullKey = this.implodeKey(parts);
90437 var stack = []; // stack of removed parts
90438 var name = parts.pop();
90439
90440 if (info.isNohoist) {
90441 info.addHistory(`Marked as nohoist, will not be hoisted above '${parts[highestHoistingPoint]}'`);
90442 }
90443
90444 for (var i = parts.length - 1; i >= highestHoistingPoint; i--) {
90445 var checkParts = parts.slice(0, i).concat(name);
90446 var checkKey = this.implodeKey(checkParts);
90447 info.addHistory(`Looked at ${checkKey} for a match`);
90448
90449 var existing = this.tree.get(checkKey);
90450
90451 if (existing) {
90452 if (existing.loc === info.loc) {
90453 // switch to non ignored if earlier deduped version was ignored (must be compatible)
90454 if (!existing.isRequired && info.isRequired) {
90455 existing.addHistory(`Deduped ${fullKey} to this item, marking as required`);
90456 existing.isRequired = true;
90457 } else {
90458 existing.addHistory(`Deduped ${fullKey} to this item`);
90459 }
90460
90461 return { parts: checkParts, duplicate: true };
90462 } else {
90463 // everything above will be shadowed and this is a conflict
90464 info.addHistory(`Found a collision at ${checkKey}`);
90465 break;
90466 }
90467 }
90468
90469 var existingTaint = this.taintedKeys.get(checkKey);
90470 if (existingTaint && existingTaint.loc !== info.loc) {
90471 info.addHistory(`Broken by ${checkKey}`);
90472 break;
90473 }
90474 }
90475
90476 var peerDependencies = (0, (_keys || _load_keys()).default)(info.pkg.peerDependencies || {});
90477
90478 // remove redundant parts that wont collide
90479 hoistLoop: while (parts.length > highestHoistingPoint) {
90480 // we must not hoist a package higher than its peer dependencies
90481 for (var _iterator6 = peerDependencies, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
90482 var _ref11;
90483
90484 if (_isArray6) {
90485 if (_i6 >= _iterator6.length) break;
90486 _ref11 = _iterator6[_i6++];
90487 } else {
90488 _i6 = _iterator6.next();
90489 if (_i6.done) break;
90490 _ref11 = _i6.value;
90491 }
90492
90493 var peerDependency = _ref11;
90494
90495 var _checkParts2 = parts.concat(peerDependency);
90496 var _checkKey2 = this.implodeKey(_checkParts2);
90497 info.addHistory(`Looked at ${_checkKey2} for a peer dependency match`);
90498
90499 var _existing2 = this.tree.get(_checkKey2);
90500
90501 if (_existing2) {
90502 info.addHistory(`Found a peer dependency requirement at ${_checkKey2}`);
90503 break hoistLoop;
90504 }
90505 }
90506
90507 var _checkParts = parts.concat(name);
90508 var _checkKey = this.implodeKey(_checkParts);
90509
90510 //
90511 var _existing = this.tree.get(_checkKey);
90512 if (_existing) {
90513 stepUp = true;
90514 break;
90515 }
90516
90517 // check if we're trying to hoist ourselves to a previously unflattened module key,
90518 // this will result in a conflict and we'll need to move ourselves up
90519 if (key !== _checkKey && this.taintedKeys.has(_checkKey)) {
90520 stepUp = true;
90521 break;
90522 }
90523
90524 //
90525 stack.push(parts.pop());
90526 }
90527
90528 //
90529 parts.push(name);
90530
90531 //
90532 var isValidPosition = function isValidPosition(parts) {
90533 // nohoist package can't be hoisted to the "root"
90534 if (parts.length <= highestHoistingPoint) {
90535 return false;
90536 }
90537 var key = _this2.implodeKey(parts);
90538 var existing = _this2.tree.get(key);
90539 if (existing && existing.loc === info.loc) {
90540 return true;
90541 }
90542
90543 // ensure there's no taint or the taint is us
90544 var existingTaint = _this2.taintedKeys.get(key);
90545 if (existingTaint && existingTaint.loc !== info.loc) {
90546 return false;
90547 }
90548
90549 return true;
90550 };
90551
90552 // we need to special case when we attempt to hoist to the top level as the `existing` logic
90553 // wont be hit in the above `while` loop and we could conflict
90554 if (!isValidPosition(parts)) {
90555 stepUp = true;
90556 }
90557
90558 // sometimes we need to step up to a parent module to install ourselves
90559 while (stepUp && stack.length) {
90560 info.addHistory(`Stepping up from ${this.implodeKey(parts)}`);
90561
90562 parts.pop(); // remove `name`
90563 parts.push(stack.pop(), name);
90564
90565 if (isValidPosition(parts)) {
90566 info.addHistory(`Found valid position ${this.implodeKey(parts)}`);
90567 stepUp = false;
90568 }
90569 }
90570
90571 return { parts, duplicate: false };
90572 };
90573
90574 /**
90575 * Hoist all seeded patterns to their highest positions.
90576 */
90577
90578 PackageHoister.prototype.hoist = function hoist(info) {
90579 var oldKey = info.key,
90580 rawParts = info.parts;
90581
90582 // remove this item from the `tree` map so we can ignore it
90583
90584 this.tree.delete(oldKey);
90585
90586 var _getNewParts = this.getNewParts(oldKey, info, rawParts.slice()),
90587 parts = _getNewParts.parts,
90588 duplicate = _getNewParts.duplicate;
90589
90590 var newKey = this.implodeKey(parts);
90591 if (duplicate) {
90592 info.addHistory(`Satisfied from above by ${newKey}`);
90593 this.declareRename(info, rawParts, parts);
90594 this.updateHoistHistory(this.nohoistResolver._originalPath(info), this.implodeKey(parts));
90595 return;
90596 }
90597
90598 // update to the new key
90599 if (oldKey === newKey) {
90600 info.addHistory(`Didn't hoist - see reason above`);
90601 this.setKey(info, oldKey, rawParts);
90602 return;
90603 }
90604
90605 //
90606 this.declareRename(info, rawParts, parts);
90607 this.setKey(info, newKey, parts);
90608 };
90609
90610 /**
90611 * Declare that a module has been hoisted and update our internal references.
90612 */
90613
90614 PackageHoister.prototype.declareRename = function declareRename(info, oldParts, newParts) {
90615 // go down the tree from our new position reserving our name
90616 this.taintParents(info, oldParts.slice(0, -1), newParts.length - 1);
90617 };
90618
90619 /**
90620 * Crawl upwards through a list of ancestry parts and taint a package name.
90621 */
90622
90623 PackageHoister.prototype.taintParents = function taintParents(info, processParts, start) {
90624 for (var i = start; i < processParts.length; i++) {
90625 var _parts = processParts.slice(0, i).concat(info.pkg.name);
90626 var key = this.implodeKey(_parts);
90627
90628 if (this.taintKey(key, info)) {
90629 info.addHistory(`Tainted ${key} to prevent collisions`);
90630 }
90631 }
90632 };
90633
90634 PackageHoister.prototype.updateHoistHistory = function updateHoistHistory(fromPath, toKey) {
90635 var info = this.tree.get(toKey);
90636 invariant(info, `expect to find hoist-to ${toKey}`);
90637 info.previousPaths.push(fromPath);
90638 };
90639
90640 /**
90641 * Update the key of a module and update our references.
90642 */
90643
90644 PackageHoister.prototype.setKey = function setKey(info, newKey, parts) {
90645 var oldKey = info.key;
90646
90647 info.key = newKey;
90648 info.parts = parts;
90649 this.tree.set(newKey, info);
90650
90651 if (oldKey === newKey) {
90652 return;
90653 }
90654
90655 var fromInfo = this.tree.get(newKey);
90656 invariant(fromInfo, `expect to find hoist-from ${newKey}`);
90657 info.previousPaths.push(this.nohoistResolver._originalPath(fromInfo));
90658 info.addHistory(`New position = ${newKey}`);
90659 };
90660
90661 /**
90662 * Perform a prepass and if there's multiple versions of the same package, hoist the one with
90663 * the most dependents to the top.
90664 */
90665
90666 PackageHoister.prototype.prepass = function prepass(patterns) {
90667 var _this3 = this;
90668
90669 patterns = this.resolver.dedupePatterns(patterns).sort();
90670
90671 var visited = new (_map || _load_map()).default();
90672
90673 var occurences = {};
90674
90675 // visitor to be used inside add() to mark occurences of packages
90676 var visitAdd = function visitAdd(pkg, ancestry, pattern) {
90677 var versions = occurences[pkg.name] = occurences[pkg.name] || {};
90678 var version = versions[pkg.version] = versions[pkg.version] || {
90679 occurences: new (_set || _load_set()).default(),
90680 pattern
90681 };
90682
90683 if (ancestry.length) {
90684 version.occurences.add(ancestry[ancestry.length - 1]);
90685 }
90686 };
90687
90688 // add an occurring package to the above data structure
90689 var add = function add(pattern, ancestry, ancestryPatterns) {
90690 var pkg = _this3.resolver.getStrictResolvedPattern(pattern);
90691 if (ancestry.indexOf(pkg) >= 0) {
90692 // prevent recursive dependencies
90693 return;
90694 }
90695
90696 var visitedPattern = visited.get(pattern);
90697
90698 if (visitedPattern) {
90699 // if a package has been visited before, simply increment occurrences of packages
90700 // like last time this package was visited
90701 visitedPattern.forEach(function (visitPkg) {
90702 visitAdd(visitPkg.pkg, visitPkg.ancestry, visitPkg.pattern);
90703 });
90704
90705 visitAdd(pkg, ancestry, pattern);
90706
90707 return;
90708 }
90709
90710 var ref = pkg._reference;
90711 invariant(ref, 'expected reference');
90712
90713 visitAdd(pkg, ancestry, pattern);
90714
90715 for (var _iterator7 = ref.dependencies, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
90716 var _ref12;
90717
90718 if (_isArray7) {
90719 if (_i7 >= _iterator7.length) break;
90720 _ref12 = _iterator7[_i7++];
90721 } else {
90722 _i7 = _iterator7.next();
90723 if (_i7.done) break;
90724 _ref12 = _i7.value;
90725 }
90726
90727 var depPattern = _ref12;
90728
90729 var depAncestry = ancestry.concat(pkg);
90730 var depAncestryPatterns = ancestryPatterns.concat(depPattern);
90731 add(depPattern, depAncestry, depAncestryPatterns);
90732 }
90733
90734 visitedPattern = visited.get(pattern) || [];
90735 visited.set(pattern, visitedPattern);
90736 visitedPattern.push({ pkg, ancestry, pattern });
90737
90738 ancestryPatterns.forEach(function (ancestryPattern) {
90739 var visitedAncestryPattern = visited.get(ancestryPattern);
90740 if (visitedAncestryPattern) {
90741 visitedAncestryPattern.push({ pkg, ancestry, pattern });
90742 }
90743 });
90744 };
90745
90746 // get a list of root package names since we can't hoist other dependencies to these spots!
90747 var rootPackageNames = new (_set || _load_set()).default();
90748 for (var _iterator8 = patterns, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
90749 var _ref13;
90750
90751 if (_isArray8) {
90752 if (_i8 >= _iterator8.length) break;
90753 _ref13 = _iterator8[_i8++];
90754 } else {
90755 _i8 = _iterator8.next();
90756 if (_i8.done) break;
90757 _ref13 = _i8.value;
90758 }
90759
90760 var _pattern4 = _ref13;
90761
90762 var _pkg2 = this.resolver.getStrictResolvedPattern(_pattern4);
90763 rootPackageNames.add(_pkg2.name);
90764 add(_pattern4, [], []);
90765 }
90766
90767 for (var _iterator9 = (0, (_keys || _load_keys()).default)(occurences).sort(), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
90768 var _ref14;
90769
90770 if (_isArray9) {
90771 if (_i9 >= _iterator9.length) break;
90772 _ref14 = _iterator9[_i9++];
90773 } else {
90774 _i9 = _iterator9.next();
90775 if (_i9.done) break;
90776 _ref14 = _i9.value;
90777 }
90778
90779 var _packageName = _ref14;
90780
90781 var versionOccurences = occurences[_packageName];
90782 var versions = (0, (_keys || _load_keys()).default)(versionOccurences);
90783
90784 if (versions.length === 1) {
90785 // only one package type so we'll hoist this to the top anyway
90786 continue;
90787 }
90788
90789 if (this.tree.get(_packageName)) {
90790 // a transitive dependency of a previously hoisted dependency exists
90791 continue;
90792 }
90793
90794 if (rootPackageNames.has(_packageName)) {
90795 // can't replace top level packages
90796 continue;
90797 }
90798
90799 var mostOccurenceCount = void 0;
90800 var mostOccurencePattern = void 0;
90801 for (var _iterator10 = (0, (_keys || _load_keys()).default)(versionOccurences).sort(), _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
90802 var _ref15;
90803
90804 if (_isArray10) {
90805 if (_i10 >= _iterator10.length) break;
90806 _ref15 = _iterator10[_i10++];
90807 } else {
90808 _i10 = _iterator10.next();
90809 if (_i10.done) break;
90810 _ref15 = _i10.value;
90811 }
90812
90813 var _version = _ref15;
90814 var _versionOccurences$_v = versionOccurences[_version],
90815 _occurences = _versionOccurences$_v.occurences,
90816 _pattern5 = _versionOccurences$_v.pattern;
90817
90818 var occurenceCount = _occurences.size;
90819
90820 if (!mostOccurenceCount || occurenceCount > mostOccurenceCount) {
90821 mostOccurenceCount = occurenceCount;
90822 mostOccurencePattern = _pattern5;
90823 }
90824 }
90825 invariant(mostOccurencePattern, 'expected most occurring pattern');
90826 invariant(mostOccurenceCount, 'expected most occurring count');
90827
90828 // only hoist this module if it occured more than once
90829 if (mostOccurenceCount > 1) {
90830 this._seed(mostOccurencePattern, { isDirectRequire: false });
90831 }
90832 }
90833 };
90834
90835 PackageHoister.prototype.markShallowWorkspaceEntries = function markShallowWorkspaceEntries() {
90836 var _this4 = this;
90837
90838 var targetWorkspace = this.config.focusedWorkspaceName;
90839 var targetHoistManifest = this.tree.get(targetWorkspace);
90840 invariant(targetHoistManifest, `targetHoistManifest from ${targetWorkspace} missing`);
90841
90842 //dedupe with a set
90843 var dependentWorkspaces = (0, (_from || _load_from()).default)(new (_set || _load_set()).default(this._getDependentWorkspaces(targetHoistManifest)));
90844
90845 var entries = (0, (_from || _load_from()).default)(this.tree);
90846 entries.forEach(function (_ref16) {
90847 var key = _ref16[0],
90848 info = _ref16[1];
90849
90850 var splitPath = key.split('#');
90851
90852 //mark the workspace and any un-hoisted dependencies it has for shallow installation
90853 var isShallowDependency = dependentWorkspaces.some(function (w) {
90854 if (splitPath[0] !== w) {
90855 //entry is not related to the workspace
90856 return false;
90857 }
90858 if (!splitPath[1]) {
90859 //entry is the workspace
90860 return true;
90861 }
90862 //don't bother marking dev dependencies or nohoist packages for shallow installation
90863 var treeEntry = _this4.tree.get(w);
90864 invariant(treeEntry, 'treeEntry is not defined for ' + w);
90865 var pkg = treeEntry.pkg;
90866 return !info.isNohoist && (!pkg.devDependencies || !(splitPath[1] in pkg.devDependencies));
90867 });
90868
90869 if (isShallowDependency) {
90870 info.shallowPaths = [null];
90871 return;
90872 }
90873
90874 //if package foo is at TARGET_WORKSPACE/node_modules/foo, the hoisted version of foo
90875 //should be installed under each shallow workspace that uses it
90876 //(unless that workspace has its own version of foo, in which case that should be installed)
90877 if (splitPath.length !== 2 || splitPath[0] !== targetWorkspace) {
90878 return;
90879 }
90880 var unhoistedDependency = splitPath[1];
90881 var unhoistedInfo = _this4.tree.get(unhoistedDependency);
90882 if (!unhoistedInfo) {
90883 return;
90884 }
90885 dependentWorkspaces.forEach(function (w) {
90886 if (_this4._packageDependsOnHoistedPackage(w, unhoistedDependency, false)) {
90887 unhoistedInfo.shallowPaths.push(w);
90888 }
90889 });
90890 });
90891 };
90892
90893 PackageHoister.prototype._getDependentWorkspaces = function _getDependentWorkspaces(parent) {
90894 var _this5 = this;
90895
90896 var allowDevDeps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
90897 var alreadySeen = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : new (_set || _load_set()).default();
90898
90899 var parentName = parent.pkg.name;
90900 if (alreadySeen.has(parentName)) {
90901 return [];
90902 }
90903
90904 alreadySeen.add(parentName);
90905 invariant(this.workspaceLayout, 'missing workspaceLayout');
90906 var _workspaceLayout = this.workspaceLayout,
90907 virtualManifestName = _workspaceLayout.virtualManifestName,
90908 workspaces = _workspaceLayout.workspaces;
90909
90910
90911 var directDependencies = [];
90912 var ignored = [];
90913 (0, (_keys || _load_keys()).default)(workspaces).forEach(function (workspace) {
90914 if (alreadySeen.has(workspace) || workspace === virtualManifestName) {
90915 return;
90916 }
90917
90918 //skip a workspace if a different version of it is already being installed under the parent workspace
90919 var info = _this5.tree.get(`${parentName}#${workspace}`);
90920 if (info) {
90921 var workspaceVersion = workspaces[workspace].manifest.version;
90922 if (info.isNohoist && info.originalParentPath.startsWith(`/${WS_ROOT_ALIAS}/${parentName}`) && info.pkg.version === workspaceVersion) {
90923 //nohoist installations are exceptions
90924 directDependencies.push(info.key);
90925 } else {
90926 ignored.push(workspace);
90927 }
90928 return;
90929 }
90930
90931 var searchPath = `/${WS_ROOT_ALIAS}/${parentName}`;
90932 info = _this5.tree.get(workspace);
90933 invariant(info, 'missing workspace tree entry ' + workspace);
90934 if (!info.previousPaths.some(function (p) {
90935 return p.startsWith(searchPath);
90936 })) {
90937 return;
90938 }
90939 if (allowDevDeps || !parent.pkg.devDependencies || !(workspace in parent.pkg.devDependencies)) {
90940 directDependencies.push(workspace);
90941 }
90942 });
90943
90944 var nested = directDependencies.map(function (d) {
90945 var dependencyEntry = _this5.tree.get(d);
90946 invariant(dependencyEntry, 'missing dependencyEntry ' + d);
90947 return _this5._getDependentWorkspaces(dependencyEntry, false, alreadySeen);
90948 });
90949 nested = [].concat.apply([], nested); //flatten
90950
90951 var directDependencyNames = directDependencies.map(function (d) {
90952 return d.split('#').slice(-1)[0];
90953 });
90954
90955 return directDependencyNames.concat(nested).filter(function (w) {
90956 return ignored.indexOf(w) === -1;
90957 });
90958 };
90959
90960 PackageHoister.prototype._packageDependsOnHoistedPackage = function _packageDependsOnHoistedPackage(p, hoisted) {
90961 var _this6 = this;
90962
90963 var checkDevDeps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
90964 var checked = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new (_set || _load_set()).default();
90965
90966 //don't check the same package more than once, and ignore any package that has its own version of hoisted
90967 if (checked.has(p) || this.tree.has(`${p}#${hoisted}`)) {
90968 return false;
90969 }
90970 checked.add(p);
90971 var info = this.tree.get(p);
90972 if (!info) {
90973 return false;
90974 }
90975
90976 var pkg = info.pkg;
90977 if (!pkg) {
90978 return false;
90979 }
90980
90981 var deps = [];
90982 if (pkg.dependencies) {
90983 deps = deps.concat((0, (_keys || _load_keys()).default)(pkg.dependencies));
90984 }
90985 if (checkDevDeps && pkg.devDependencies) {
90986 deps = deps.concat((0, (_keys || _load_keys()).default)(pkg.devDependencies));
90987 }
90988
90989 if (deps.indexOf(hoisted) !== -1) {
90990 return true;
90991 }
90992 return deps.some(function (dep) {
90993 return _this6._packageDependsOnHoistedPackage(dep, hoisted, false, checked);
90994 });
90995 };
90996
90997 /**
90998 * Produce a flattened list of module locations and manifests.
90999 */
91000
91001 PackageHoister.prototype.init = function init() {
91002 var _this7 = this;
91003
91004 var flatTree = [];
91005
91006 //
91007
91008 var _loop2 = function _loop2(key, info) {
91009 // decompress the location and push it to the flat tree. this path could be made
91010 var parts = [];
91011 var keyParts = key.split('#');
91012 var isWorkspaceEntry = _this7.workspaceLayout && keyParts[0] === _this7.workspaceLayout.virtualManifestName;
91013
91014 // Don't add the virtual manifest (keyParts.length === 1)
91015 // or ws childs which were not hoisted to the root (keyParts.length === 2).
91016 // If a ws child was hoisted its key would not contain the virtual manifest name
91017 if (isWorkspaceEntry && keyParts.length <= 2) {
91018 return 'continue';
91019 }
91020
91021 for (var i = 0; i < keyParts.length; i++) {
91022 var _key = keyParts.slice(0, i + 1).join('#');
91023 var hoisted = _this7.tree.get(_key);
91024 invariant(hoisted, `expected hoisted manifest for "${_key}"`);
91025 parts.push(_this7.config.getFolder(hoisted.pkg));
91026 parts.push(keyParts[i]);
91027 }
91028
91029 // Check if the destination is pointing to a sub folder of the virtualManifestName
91030 // e.g. _project_/node_modules/workspace-aggregator-123456/node_modules/workspaceChild/node_modules/dependency
91031 // This probably happened because the hoister was not able to hoist the workspace child to the root
91032 // So we have to change the folder to the workspace package location
91033 if (_this7.workspaceLayout && isWorkspaceEntry) {
91034 var wspPkg = _this7.workspaceLayout.workspaces[keyParts[1]];
91035 invariant(wspPkg, `expected workspace package to exist for "${keyParts[1]}"`);
91036 parts.splice(0, 4, wspPkg.loc);
91037 } else {
91038 if (_this7.config.modulesFolder) {
91039 // remove the first part which will be the folder name and replace it with a
91040 // hardcoded modules folder
91041 parts.splice(0, 1, _this7.config.modulesFolder);
91042 } else {
91043 // first part will be the registry-specific module folder
91044 parts.splice(0, 0, _this7.config.lockfileFolder);
91045 }
91046 }
91047
91048 var shallowLocs = [];
91049 info.shallowPaths.forEach(function (shallowPath) {
91050 var shallowCopyParts = parts.slice();
91051 shallowCopyParts[0] = _this7.config.cwd;
91052 if (_this7.config.modulesFolder) {
91053 //add back the module folder name for the shallow installation
91054 var treeEntry = _this7.tree.get(keyParts[0]);
91055 invariant(treeEntry, 'expected treeEntry for ' + keyParts[0]);
91056 var moduleFolderName = _this7.config.getFolder(treeEntry.pkg);
91057 shallowCopyParts.splice(1, 0, moduleFolderName);
91058 }
91059
91060 if (shallowPath) {
91061 var targetWorkspace = _this7.config.focusedWorkspaceName;
91062 var _treeEntry = _this7.tree.get(`${targetWorkspace}#${shallowPath}`) || _this7.tree.get(shallowPath);
91063 invariant(_treeEntry, 'expected treeEntry for ' + shallowPath);
91064 var _moduleFolderName = _this7.config.getFolder(_treeEntry.pkg);
91065 shallowCopyParts.splice(1, 0, _moduleFolderName, shallowPath);
91066 }
91067 shallowLocs.push(path.join.apply(path, shallowCopyParts));
91068 });
91069
91070 var loc = path.join.apply(path, parts);
91071 flatTree.push([loc, info]);
91072 shallowLocs.forEach(function (shallowLoc) {
91073 var newManifest = (0, (_extends2 || _load_extends()).default)({}, info, { isShallow: true });
91074 flatTree.push([shallowLoc, newManifest]);
91075 });
91076 };
91077
91078 for (var _iterator11 = this.tree.entries(), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
91079 var _ref18;
91080
91081 if (_isArray11) {
91082 if (_i11 >= _iterator11.length) break;
91083 _ref18 = _iterator11[_i11++];
91084 } else {
91085 _i11 = _iterator11.next();
91086 if (_i11.done) break;
91087 _ref18 = _i11.value;
91088 }
91089
91090 var _ref17 = _ref18;
91091 var key = _ref17[0];
91092 var info = _ref17[1];
91093
91094 var _ret2 = _loop2(key, info);
91095
91096 if (_ret2 === 'continue') continue;
91097 }
91098
91099 // remove ignored modules from the tree
91100 var visibleFlatTree = [];
91101 for (var _iterator12 = flatTree, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) {
91102 var _ref20;
91103
91104 if (_isArray12) {
91105 if (_i12 >= _iterator12.length) break;
91106 _ref20 = _iterator12[_i12++];
91107 } else {
91108 _i12 = _iterator12.next();
91109 if (_i12.done) break;
91110 _ref20 = _i12.value;
91111 }
91112
91113 var _ref19 = _ref20;
91114 var loc = _ref19[0];
91115 var info = _ref19[1];
91116
91117 var ref = info.pkg._reference;
91118 invariant(ref, 'expected reference');
91119 if (!info.isRequired) {
91120 info.addHistory('Deleted as this module was ignored');
91121 } else {
91122 visibleFlatTree.push([loc, info]);
91123 }
91124 }
91125 return visibleFlatTree;
91126 };
91127
91128 return PackageHoister;
91129}();
91130
91131exports.default = PackageHoister;
91132
91133
91134var WS_ROOT_ALIAS = '_project_';
91135
91136var NohoistResolver = exports.NohoistResolver = function () {
91137 function NohoistResolver(config, resolver) {
91138 var _this8 = this;
91139
91140 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NohoistResolver);
91141
91142 this.initNohoist = function (info, parent) {
91143 var parentNohoistList = void 0;
91144 var originalParentPath = info.originalParentPath;
91145
91146 if (parent) {
91147 parentNohoistList = parent.nohoistList;
91148 originalParentPath = _this8._originalPath(parent);
91149 } else {
91150 invariant(_this8._isTopPackage(info), `${info.key} doesn't have parent nor a top package`);
91151 if (info.pkg.name !== _this8._wsRootPackageName) {
91152 parentNohoistList = _this8._wsRootNohoistList;
91153 originalParentPath = _this8._wsRootPackageName || '';
91154 }
91155 }
91156
91157 info.originalParentPath = originalParentPath;
91158 var nohoistList = _this8._extractNohoistList(info.pkg, _this8._originalPath(info)) || [];
91159 if (parentNohoistList) {
91160 nohoistList = nohoistList.concat(parentNohoistList);
91161 }
91162 info.nohoistList = nohoistList.length > 0 ? nohoistList : null;
91163 info.isNohoist = _this8._isNohoist(info);
91164 };
91165
91166 this.highestHoistingPoint = function (info) {
91167 return info.isNohoist && info.parts.length > 1 ? 1 : null;
91168 };
91169
91170 this._isNohoist = function (info) {
91171 if (_this8._isTopPackage(info)) {
91172 return false;
91173 }
91174 if (info.nohoistList && info.nohoistList.length > 0 && (_micromatch || _load_micromatch()).default.any(_this8._originalPath(info), info.nohoistList)) {
91175 return true;
91176 }
91177 if (_this8._config.plugnplayEnabled) {
91178 return true;
91179 }
91180 return false;
91181 };
91182
91183 this._isRootPackage = function (pkg) {
91184 return pkg.name === _this8._wsRootPackageName;
91185 };
91186
91187 this._originalPath = function (info) {
91188 return _this8._makePath(info.originalParentPath, info.pkg.name);
91189 };
91190
91191 this._isTopPackage = function (info) {
91192 var parentParts = info.parts.slice(0, -1);
91193 var result = !parentParts || parentParts.length <= 0 || parentParts.length === 1 && parentParts[0] === _this8._wsRootPackageName;
91194 return result;
91195 };
91196
91197 this._isLink = function (info) {
91198 return info.pkg._remote != null && LINK_TYPES.has(info.pkg._remote.type);
91199 };
91200
91201 this._extractNohoistList = function (pkg, pathPrefix) {
91202 var nohoistList = void 0;
91203 var ws = _this8._config.getWorkspaces(pkg);
91204
91205 if (ws && ws.nohoist) {
91206 nohoistList = ws.nohoist.map(function (p) {
91207 return _this8._makePath(pathPrefix, p);
91208 });
91209 }
91210 return nohoistList;
91211 };
91212
91213 this._resolver = resolver;
91214 this._config = config;
91215 if (resolver.workspaceLayout) {
91216 this._wsRootPackageName = resolver.workspaceLayout.virtualManifestName;
91217
91218 var _resolver$workspaceLa = resolver.workspaceLayout.getWorkspaceManifest(this._wsRootPackageName),
91219 manifest = _resolver$workspaceLa.manifest;
91220
91221 this._wsRootNohoistList = this._extractNohoistList(manifest, manifest.name);
91222 }
91223 }
91224
91225 /**
91226 * examine the top level packages to find the root package
91227 */
91228
91229
91230 /**
91231 * find the highest hoisting point for the given HoistManifest.
91232 * algorithm: a nohoist package should never be hoisted beyond the top of its branch, i.e.
91233 * the first element of its parts. Therefore the highest possible hoisting index is 1,
91234 * unless the package has only 1 part (itself), in such case returns null just like any hoisted package
91235 *
91236 */
91237
91238 // private functions
91239
91240
91241 NohoistResolver.prototype._makePath = function _makePath() {
91242 var _this9 = this;
91243
91244 for (var _len = arguments.length, args = Array(_len), _key2 = 0; _key2 < _len; _key2++) {
91245 args[_key2] = arguments[_key2];
91246 }
91247
91248 var parts = args.map(function (s) {
91249 return s === _this9._wsRootPackageName ? WS_ROOT_ALIAS : s;
91250 });
91251 var result = parts.join('/');
91252 return result[0] === '/' ? result : '/' + result;
91253 };
91254
91255 // extract nohoist from package.json then prefix them with branch path
91256 // so we can matched against the branch tree ("originalPath") later
91257
91258
91259 return NohoistResolver;
91260}();
91261
91262/***/ }),
91263/* 513 */
91264/***/ (function(module, exports, __webpack_require__) {
91265
91266"use strict";
91267
91268
91269Object.defineProperty(exports, "__esModule", {
91270 value: true
91271});
91272
91273var _promise;
91274
91275function _load_promise() {
91276 return _promise = _interopRequireDefault(__webpack_require__(7));
91277}
91278
91279var _map;
91280
91281function _load_map() {
91282 return _map = _interopRequireDefault(__webpack_require__(42));
91283}
91284
91285var _set;
91286
91287function _load_set() {
91288 return _set = _interopRequireDefault(__webpack_require__(16));
91289}
91290
91291var _asyncToGenerator2;
91292
91293function _load_asyncToGenerator() {
91294 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
91295}
91296
91297var _getIterator2;
91298
91299function _load_getIterator() {
91300 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
91301}
91302
91303var _classCallCheck2;
91304
91305function _load_classCallCheck() {
91306 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
91307}
91308
91309var _config;
91310
91311function _load_config() {
91312 return _config = _interopRequireDefault(__webpack_require__(149));
91313}
91314
91315var _executeLifecycleScript;
91316
91317function _load_executeLifecycleScript() {
91318 return _executeLifecycleScript = _interopRequireDefault(__webpack_require__(100));
91319}
91320
91321var _crypto;
91322
91323function _load_crypto() {
91324 return _crypto = _interopRequireWildcard(__webpack_require__(158));
91325}
91326
91327var _fs;
91328
91329function _load_fs() {
91330 return _fs = _interopRequireWildcard(__webpack_require__(8));
91331}
91332
91333var _packageNameUtils;
91334
91335function _load_packageNameUtils() {
91336 return _packageNameUtils = __webpack_require__(208);
91337}
91338
91339var _pack;
91340
91341function _load_pack() {
91342 return _pack = __webpack_require__(155);
91343}
91344
91345function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
91346
91347function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
91348
91349var fs = __webpack_require__(12);
91350
91351var invariant = __webpack_require__(15);
91352var path = __webpack_require__(1);
91353
91354var INSTALL_STAGES = ['preinstall', 'install', 'postinstall'];
91355
91356var PackageInstallScripts = function () {
91357 function PackageInstallScripts(config, resolver, force) {
91358 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, PackageInstallScripts);
91359
91360 this.installed = 0;
91361 this.resolver = resolver;
91362 this.reporter = config.reporter;
91363 this.config = config;
91364 this.force = force;
91365 this.artifacts = {};
91366 }
91367
91368 PackageInstallScripts.prototype.setForce = function setForce(force) {
91369 this.force = force;
91370 };
91371
91372 PackageInstallScripts.prototype.setArtifacts = function setArtifacts(artifacts) {
91373 this.artifacts = artifacts;
91374 };
91375
91376 PackageInstallScripts.prototype.getArtifacts = function getArtifacts() {
91377 return this.artifacts;
91378 };
91379
91380 PackageInstallScripts.prototype.getInstallCommands = function getInstallCommands(pkg) {
91381 var scripts = pkg.scripts;
91382 if (scripts) {
91383 var cmds = [];
91384 for (var _iterator = INSTALL_STAGES, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
91385 var _ref;
91386
91387 if (_isArray) {
91388 if (_i >= _iterator.length) break;
91389 _ref = _iterator[_i++];
91390 } else {
91391 _i = _iterator.next();
91392 if (_i.done) break;
91393 _ref = _i.value;
91394 }
91395
91396 var stage = _ref;
91397
91398 var cmd = scripts[stage];
91399 if (cmd) {
91400 cmds.push([stage, cmd]);
91401 }
91402 }
91403 return cmds;
91404 } else {
91405 return [];
91406 }
91407 };
91408
91409 PackageInstallScripts.prototype.walk = function () {
91410 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
91411 var files = yield (_fs || _load_fs()).walk(loc, null, new (_set || _load_set()).default(this.config.registryFolders));
91412 var mtimes = new (_map || _load_map()).default();
91413 for (var _iterator2 = files, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
91414 var _ref3;
91415
91416 if (_isArray2) {
91417 if (_i2 >= _iterator2.length) break;
91418 _ref3 = _iterator2[_i2++];
91419 } else {
91420 _i2 = _iterator2.next();
91421 if (_i2.done) break;
91422 _ref3 = _i2.value;
91423 }
91424
91425 var file = _ref3;
91426
91427 mtimes.set(file.relative, file.mtime);
91428 }
91429 return mtimes;
91430 });
91431
91432 function walk(_x) {
91433 return _ref2.apply(this, arguments);
91434 }
91435
91436 return walk;
91437 }();
91438
91439 PackageInstallScripts.prototype.saveBuildArtifacts = function () {
91440 var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc, pkg, beforeFiles, spinner) {
91441 var afterFiles = yield this.walk(loc);
91442
91443 // work out what files have been created/modified
91444 var buildArtifacts = [];
91445 for (var _iterator3 = afterFiles, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
91446 var _ref6;
91447
91448 if (_isArray3) {
91449 if (_i3 >= _iterator3.length) break;
91450 _ref6 = _iterator3[_i3++];
91451 } else {
91452 _i3 = _iterator3.next();
91453 if (_i3.done) break;
91454 _ref6 = _i3.value;
91455 }
91456
91457 var _ref5 = _ref6;
91458 var file = _ref5[0];
91459 var mtime = _ref5[1];
91460
91461 if (!beforeFiles.has(file) || beforeFiles.get(file) !== mtime) {
91462 buildArtifacts.push(file);
91463 }
91464 }
91465
91466 if (!buildArtifacts.length) {
91467 // nothing else to do here since we have no build artifacts
91468 return;
91469 }
91470
91471 // set build artifacts
91472 var ref = pkg._reference;
91473 invariant(ref, 'expected reference');
91474 this.artifacts[`${pkg.name}@${pkg.version}`] = buildArtifacts;
91475 });
91476
91477 function saveBuildArtifacts(_x2, _x3, _x4, _x5) {
91478 return _ref4.apply(this, arguments);
91479 }
91480
91481 return saveBuildArtifacts;
91482 }();
91483
91484 PackageInstallScripts.prototype.install = function () {
91485 var _ref7 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (cmds, pkg, spinner) {
91486 var _this = this;
91487
91488 var ref = pkg._reference;
91489 invariant(ref, 'expected reference');
91490 var locs = ref.locations;
91491
91492 var updateProgress = void 0;
91493
91494 if (cmds.length > 0) {
91495 updateProgress = function updateProgress(data) {
91496 var dataStr = data.toString() // turn buffer into string
91497 .trim(); // trim whitespace
91498
91499 invariant(spinner && spinner.tick, 'We should have spinner and its ticker here');
91500 if (dataStr) {
91501 spinner.tick(dataStr
91502 // Only get the last line
91503 .substr(dataStr.lastIndexOf('\n') + 1)
91504 // change tabs to spaces as they can interfere with the console
91505 .replace(/\t/g, ' '));
91506 }
91507 };
91508 }
91509
91510 try {
91511 var _loop = function* _loop(stage, cmd) {
91512 yield (_promise || _load_promise()).default.all(locs.map(function () {
91513 var _ref10 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
91514 var _ref11 = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).default)({
91515 stage,
91516 config: _this.config,
91517 cwd: loc,
91518 cmd,
91519 isInteractive: false,
91520 updateProgress
91521 }),
91522 stdout = _ref11.stdout;
91523
91524 _this.reporter.verbose(stdout);
91525 });
91526
91527 return function (_x9) {
91528 return _ref10.apply(this, arguments);
91529 };
91530 }()));
91531 };
91532
91533 for (var _iterator4 = cmds, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
91534 var _ref9;
91535
91536 if (_isArray4) {
91537 if (_i4 >= _iterator4.length) break;
91538 _ref9 = _iterator4[_i4++];
91539 } else {
91540 _i4 = _iterator4.next();
91541 if (_i4.done) break;
91542 _ref9 = _i4.value;
91543 }
91544
91545 var _ref8 = _ref9;
91546 var stage = _ref8[0];
91547 var cmd = _ref8[1];
91548 yield* _loop(stage, cmd);
91549 }
91550 } catch (err) {
91551 err.message = `${locs.join(', ')}: ${err.message}`;
91552
91553 invariant(ref, 'expected reference');
91554
91555 if (ref.optional) {
91556 ref.ignore = true;
91557 ref.incompatible = true;
91558 this.reporter.warn(this.reporter.lang('optionalModuleScriptFail', err.message));
91559 this.reporter.info(this.reporter.lang('optionalModuleFail'));
91560
91561 // Cleanup node_modules
91562 try {
91563 yield (_promise || _load_promise()).default.all(locs.map(function () {
91564 var _ref12 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
91565 yield (_fs || _load_fs()).unlink(loc);
91566 });
91567
91568 return function (_x10) {
91569 return _ref12.apply(this, arguments);
91570 };
91571 }()));
91572 } catch (e) {
91573 this.reporter.error(this.reporter.lang('optionalModuleCleanupFail', e.message));
91574 }
91575 } else {
91576 throw err;
91577 }
91578 }
91579 });
91580
91581 function install(_x6, _x7, _x8) {
91582 return _ref7.apply(this, arguments);
91583 }
91584
91585 return install;
91586 }();
91587
91588 PackageInstallScripts.prototype.packageCanBeInstalled = function packageCanBeInstalled(pkg) {
91589 var cmds = this.getInstallCommands(pkg);
91590 if (!cmds.length) {
91591 return false;
91592 }
91593 if (this.config.packBuiltPackages && pkg.prebuiltVariants) {
91594 for (var variant in pkg.prebuiltVariants) {
91595 if (pkg._remote && pkg._remote.reference && pkg._remote.reference.indexOf(variant) !== -1) {
91596 return false;
91597 }
91598 }
91599 }
91600 var ref = pkg._reference;
91601 invariant(ref, 'Missing package reference');
91602 if (!ref.fresh && !this.force) {
91603 // this package hasn't been touched
91604 return false;
91605 }
91606
91607 // Don't run lifecycle scripts for hoisted packages
91608 if (!ref.locations.length) {
91609 return false;
91610 }
91611
91612 // we haven't actually written this module out
91613 if (ref.ignore) {
91614 return false;
91615 }
91616 return true;
91617 };
91618
91619 PackageInstallScripts.prototype.runCommand = function () {
91620 var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (spinner, pkg) {
91621 var cmds = this.getInstallCommands(pkg);
91622 spinner.setPrefix(++this.installed, pkg.name);
91623 yield this.install(cmds, pkg, spinner);
91624 });
91625
91626 function runCommand(_x11, _x12) {
91627 return _ref13.apply(this, arguments);
91628 }
91629
91630 return runCommand;
91631 }();
91632
91633 // detect if there is a circularDependency in the dependency tree
91634
91635
91636 PackageInstallScripts.prototype.detectCircularDependencies = function detectCircularDependencies(root, seenManifests, pkg) {
91637 var ref = pkg._reference;
91638 invariant(ref, 'expected reference');
91639
91640 var deps = ref.dependencies;
91641 for (var _iterator5 = deps, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
91642 var _ref14;
91643
91644 if (_isArray5) {
91645 if (_i5 >= _iterator5.length) break;
91646 _ref14 = _iterator5[_i5++];
91647 } else {
91648 _i5 = _iterator5.next();
91649 if (_i5.done) break;
91650 _ref14 = _i5.value;
91651 }
91652
91653 var dep = _ref14;
91654
91655 var pkgDep = this.resolver.getStrictResolvedPattern(dep);
91656 if (seenManifests.has(pkgDep)) {
91657 // there is a cycle but not with the root
91658 continue;
91659 }
91660 seenManifests.add(pkgDep);
91661 // found a dependency pointing to root
91662 if (pkgDep == root) {
91663 return true;
91664 }
91665 if (this.detectCircularDependencies(root, seenManifests, pkgDep)) {
91666 return true;
91667 }
91668 }
91669 return false;
91670 };
91671
91672 // find the next package to be installed
91673
91674
91675 PackageInstallScripts.prototype.findInstallablePackage = function findInstallablePackage(workQueue, installed) {
91676 for (var _iterator6 = workQueue, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
91677 var _ref15;
91678
91679 if (_isArray6) {
91680 if (_i6 >= _iterator6.length) break;
91681 _ref15 = _iterator6[_i6++];
91682 } else {
91683 _i6 = _iterator6.next();
91684 if (_i6.done) break;
91685 _ref15 = _i6.value;
91686 }
91687
91688 var pkg = _ref15;
91689
91690 var ref = pkg._reference;
91691 invariant(ref, 'expected reference');
91692 var deps = ref.dependencies;
91693
91694 var dependenciesFulfilled = true;
91695 for (var _iterator7 = deps, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
91696 var _ref16;
91697
91698 if (_isArray7) {
91699 if (_i7 >= _iterator7.length) break;
91700 _ref16 = _iterator7[_i7++];
91701 } else {
91702 _i7 = _iterator7.next();
91703 if (_i7.done) break;
91704 _ref16 = _i7.value;
91705 }
91706
91707 var dep = _ref16;
91708
91709 var pkgDep = this.resolver.getStrictResolvedPattern(dep);
91710 if (!installed.has(pkgDep)) {
91711 dependenciesFulfilled = false;
91712 break;
91713 }
91714 }
91715
91716 // all dependencies are installed
91717 if (dependenciesFulfilled) {
91718 return pkg;
91719 }
91720
91721 // detect circular dependency, mark this pkg as installable to break the circle
91722 if (this.detectCircularDependencies(pkg, new (_set || _load_set()).default(), pkg)) {
91723 return pkg;
91724 }
91725 }
91726 return null;
91727 };
91728
91729 PackageInstallScripts.prototype.worker = function () {
91730 var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (spinner, workQueue, installed, waitQueue) {
91731 while (workQueue.size > 0) {
91732 // find a installable package
91733 var pkg = this.findInstallablePackage(workQueue, installed);
91734
91735 // can't find a package to install, register into waitQueue
91736 if (pkg == null) {
91737 spinner.clear();
91738 yield new (_promise || _load_promise()).default(function (resolve) {
91739 return waitQueue.add(resolve);
91740 });
91741 continue;
91742 }
91743
91744 // found a package to install
91745 workQueue.delete(pkg);
91746 if (this.packageCanBeInstalled(pkg)) {
91747 yield this.runCommand(spinner, pkg);
91748 }
91749 installed.add(pkg);
91750 for (var _iterator8 = waitQueue, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
91751 var _ref18;
91752
91753 if (_isArray8) {
91754 if (_i8 >= _iterator8.length) break;
91755 _ref18 = _iterator8[_i8++];
91756 } else {
91757 _i8 = _iterator8.next();
91758 if (_i8.done) break;
91759 _ref18 = _i8.value;
91760 }
91761
91762 var workerResolve = _ref18;
91763
91764 workerResolve();
91765 }
91766 waitQueue.clear();
91767 }
91768 });
91769
91770 function worker(_x13, _x14, _x15, _x16) {
91771 return _ref17.apply(this, arguments);
91772 }
91773
91774 return worker;
91775 }();
91776
91777 PackageInstallScripts.prototype.init = function () {
91778 var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (seedPatterns) {
91779 var _this2 = this;
91780
91781 var workQueue = new (_set || _load_set()).default();
91782 var installed = new (_set || _load_set()).default();
91783 var pkgs = this.resolver.getTopologicalManifests(seedPatterns);
91784 var installablePkgs = 0;
91785 // A map to keep track of what files exist before installation
91786 var beforeFilesMap = new (_map || _load_map()).default();
91787 for (var _iterator9 = pkgs, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
91788 var _ref20;
91789
91790 if (_isArray9) {
91791 if (_i9 >= _iterator9.length) break;
91792 _ref20 = _iterator9[_i9++];
91793 } else {
91794 _i9 = _iterator9.next();
91795 if (_i9.done) break;
91796 _ref20 = _i9.value;
91797 }
91798
91799 var pkg = _ref20;
91800
91801 if (this.packageCanBeInstalled(pkg)) {
91802 var ref = pkg._reference;
91803 invariant(ref, 'expected reference');
91804 yield (_promise || _load_promise()).default.all(ref.locations.map(function () {
91805 var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
91806 beforeFilesMap.set(loc, (yield _this2.walk(loc)));
91807 installablePkgs += 1;
91808 });
91809
91810 return function (_x21) {
91811 return _ref25.apply(this, arguments);
91812 };
91813 }()));
91814 }
91815 workQueue.add(pkg);
91816 }
91817
91818 var set = this.reporter.activitySet(installablePkgs, Math.min(installablePkgs, this.config.childConcurrency));
91819
91820 // waitQueue acts like a semaphore to allow workers to register to be notified
91821 // when there are more work added to the work queue
91822 var waitQueue = new (_set || _load_set()).default();
91823 yield (_promise || _load_promise()).default.all(set.spinners.map(function (spinner) {
91824 return _this2.worker(spinner, workQueue, installed, waitQueue);
91825 }));
91826 // generate built package as prebuilt one for offline mirror
91827 var offlineMirrorPath = this.config.getOfflineMirrorPath();
91828 if (this.config.packBuiltPackages && offlineMirrorPath) {
91829 var _loop2 = function* _loop2(_pkg) {
91830 if (_this2.packageCanBeInstalled(_pkg)) {
91831 var prebuiltPath = path.join(offlineMirrorPath, 'prebuilt');
91832 yield (_fs || _load_fs()).mkdirp(prebuiltPath);
91833 var prebuiltFilename = (0, (_packageNameUtils || _load_packageNameUtils()).getPlatformSpecificPackageFilename)(_pkg);
91834 prebuiltPath = path.join(prebuiltPath, prebuiltFilename + '.tgz');
91835 var ref = _pkg._reference;
91836 invariant(ref, 'expected reference');
91837 var builtPackagePaths = ref.locations;
91838
91839 yield (_promise || _load_promise()).default.all(builtPackagePaths.map(function () {
91840 var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (builtPackagePath) {
91841 // don't use pack command, we want to avoid the file filters logic
91842 var stream = yield (0, (_pack || _load_pack()).packWithIgnoreAndHeaders)(builtPackagePath);
91843
91844 var hash = yield new (_promise || _load_promise()).default(function (resolve, reject) {
91845 var validateStream = new (_crypto || _load_crypto()).HashStream();
91846 stream.pipe(validateStream).pipe(fs.createWriteStream(prebuiltPath)).on('error', reject).on('close', function () {
91847 return resolve(validateStream.getHash());
91848 });
91849 });
91850 _pkg.prebuiltVariants = _pkg.prebuiltVariants || {};
91851 _pkg.prebuiltVariants[prebuiltFilename] = hash;
91852 });
91853
91854 return function (_x18) {
91855 return _ref22.apply(this, arguments);
91856 };
91857 }()));
91858 }
91859 };
91860
91861 for (var _iterator10 = pkgs, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
91862 var _ref21;
91863
91864 if (_isArray10) {
91865 if (_i10 >= _iterator10.length) break;
91866 _ref21 = _iterator10[_i10++];
91867 } else {
91868 _i10 = _iterator10.next();
91869 if (_i10.done) break;
91870 _ref21 = _i10.value;
91871 }
91872
91873 var _pkg = _ref21;
91874 yield* _loop2(_pkg);
91875 }
91876 } else {
91877 var _loop3 = function* _loop3(_pkg2) {
91878 if (_this2.packageCanBeInstalled(_pkg2)) {
91879 var ref = _pkg2._reference;
91880 invariant(ref, 'expected reference');
91881 var beforeFiles = ref.locations.map(function (loc) {
91882 return beforeFilesMap.get(loc);
91883 });
91884 yield (_promise || _load_promise()).default.all(beforeFiles.map(function () {
91885 var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (b, index) {
91886 invariant(b, 'files before installation should always be recorded');
91887 yield _this2.saveBuildArtifacts(ref.locations[index], _pkg2, b, set.spinners[0]);
91888 });
91889
91890 return function (_x19, _x20) {
91891 return _ref24.apply(this, arguments);
91892 };
91893 }()));
91894 }
91895 };
91896
91897 // cache all build artifacts
91898 for (var _iterator11 = pkgs, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
91899 var _ref23;
91900
91901 if (_isArray11) {
91902 if (_i11 >= _iterator11.length) break;
91903 _ref23 = _iterator11[_i11++];
91904 } else {
91905 _i11 = _iterator11.next();
91906 if (_i11.done) break;
91907 _ref23 = _i11.value;
91908 }
91909
91910 var _pkg2 = _ref23;
91911 yield* _loop3(_pkg2);
91912 }
91913 }
91914
91915 set.end();
91916 });
91917
91918 function init(_x17) {
91919 return _ref19.apply(this, arguments);
91920 }
91921
91922 return init;
91923 }();
91924
91925 return PackageInstallScripts;
91926}();
91927
91928exports.default = PackageInstallScripts;
91929
91930/***/ }),
91931/* 514 */
91932/***/ (function(module, exports, __webpack_require__) {
91933
91934"use strict";
91935
91936
91937Object.defineProperty(exports, "__esModule", {
91938 value: true
91939});
91940
91941var _getIterator2;
91942
91943function _load_getIterator() {
91944 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
91945}
91946
91947var _asyncToGenerator2;
91948
91949function _load_asyncToGenerator() {
91950 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
91951}
91952
91953var _extends2;
91954
91955function _load_extends() {
91956 return _extends2 = _interopRequireDefault(__webpack_require__(24));
91957}
91958
91959var _promise;
91960
91961function _load_promise() {
91962 return _promise = _interopRequireDefault(__webpack_require__(7));
91963}
91964
91965var _keys;
91966
91967function _load_keys() {
91968 return _keys = _interopRequireDefault(__webpack_require__(14));
91969}
91970
91971var _classCallCheck2;
91972
91973function _load_classCallCheck() {
91974 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
91975}
91976
91977var _misc;
91978
91979function _load_misc() {
91980 return _misc = __webpack_require__(28);
91981}
91982
91983function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
91984
91985var objectPath = __webpack_require__(244);
91986
91987var path = __webpack_require__(1);
91988
91989var BaseRegistry = function () {
91990 function BaseRegistry(cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles) {
91991 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BaseRegistry);
91992
91993 this.reporter = reporter;
91994 this.requestManager = requestManager;
91995 this.registries = registries;
91996 this.config = {};
91997 this.folder = '';
91998 this.token = '';
91999 this.loc = '';
92000 this.cwd = cwd;
92001 this.enableDefaultRc = enableDefaultRc;
92002 this.extraneousRcFiles = extraneousRcFiles;
92003 }
92004
92005 // the filename to use for package metadata
92006
92007
92008 //
92009
92010
92011 //
92012
92013 //
92014
92015
92016 //
92017
92018
92019 //
92020
92021
92022 //
92023
92024
92025 //
92026
92027
92028 //
92029
92030
92031 // absolute folder name to insert modules
92032
92033
92034 // relative folder name to put these modules
92035
92036
92037 BaseRegistry.prototype.setToken = function setToken(token) {
92038 this.token = token;
92039 };
92040
92041 BaseRegistry.prototype.setOtp = function setOtp(otp) {
92042 this.otp = otp;
92043 };
92044
92045 BaseRegistry.prototype.getOption = function getOption(key) {
92046 return this.config[key];
92047 };
92048
92049 BaseRegistry.prototype.getAvailableRegistries = function getAvailableRegistries() {
92050 var config = this.config;
92051 return (0, (_keys || _load_keys()).default)(config).reduce(function (registries, option) {
92052 if (option === 'registry' || option.split(':')[1] === 'registry') {
92053 registries.push(config[option]);
92054 }
92055 return registries;
92056 }, []);
92057 };
92058
92059 BaseRegistry.prototype.loadConfig = function loadConfig() {
92060 return (_promise || _load_promise()).default.resolve();
92061 };
92062
92063 BaseRegistry.prototype.checkOutdated = function checkOutdated(config, name, range) {
92064 return (_promise || _load_promise()).default.reject(new Error('unimplemented'));
92065 };
92066
92067 BaseRegistry.prototype.saveHomeConfig = function saveHomeConfig(config) {
92068 return (_promise || _load_promise()).default.reject(new Error('unimplemented'));
92069 };
92070
92071 BaseRegistry.prototype.request = function request(pathname) {
92072 var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
92073
92074 return this.requestManager.request((0, (_extends2 || _load_extends()).default)({
92075 url: pathname
92076 }, opts));
92077 };
92078
92079 BaseRegistry.prototype.init = function () {
92080 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
92081 var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
92082
92083 this.mergeEnv('yarn_');
92084 yield this.loadConfig();
92085
92086 for (var _iterator = (0, (_keys || _load_keys()).default)(overrides), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
92087 var _ref2;
92088
92089 if (_isArray) {
92090 if (_i >= _iterator.length) break;
92091 _ref2 = _iterator[_i++];
92092 } else {
92093 _i = _iterator.next();
92094 if (_i.done) break;
92095 _ref2 = _i.value;
92096 }
92097
92098 var override = _ref2;
92099
92100 var val = overrides[override];
92101
92102 if (val !== undefined) {
92103 this.config[override] = val;
92104 }
92105 }
92106 this.loc = path.join(this.cwd, this.folder);
92107 });
92108
92109 function init() {
92110 return _ref.apply(this, arguments);
92111 }
92112
92113 return init;
92114 }();
92115
92116 BaseRegistry.normalizeConfig = function normalizeConfig(config) {
92117 for (var key in config) {
92118 config[key] = BaseRegistry.normalizeConfigOption(config[key]);
92119 }
92120 return config;
92121 };
92122
92123 BaseRegistry.normalizeConfigOption = function normalizeConfigOption(val) {
92124 if (val === 'true') {
92125 return true;
92126 } else if (val === 'false') {
92127 return false;
92128 } else {
92129 return val;
92130 }
92131 };
92132
92133 BaseRegistry.prototype.mergeEnv = function mergeEnv(prefix) {
92134 // try environment variables
92135 for (var envKey in process.env) {
92136 var key = envKey.toLowerCase();
92137
92138 // only accept keys prefixed with the prefix
92139 if (key.indexOf(prefix.toLowerCase()) !== 0) {
92140 continue;
92141 }
92142
92143 var val = BaseRegistry.normalizeConfigOption(process.env[envKey]);
92144
92145 // remove config prefix
92146 key = (0, (_misc || _load_misc()).removePrefix)(key, prefix.toLowerCase());
92147
92148 // replace dunders with dots
92149 key = key.replace(/__/g, '.');
92150
92151 // replace underscores with dashes ignoring keys that start with an underscore
92152 key = key.replace(/([^_])_/g, '$1-');
92153
92154 // set it via a path
92155 objectPath.set(this.config, key, val);
92156 }
92157 };
92158
92159 return BaseRegistry;
92160}();
92161
92162exports.default = BaseRegistry;
92163
92164/***/ }),
92165/* 515 */
92166/***/ (function(module, exports, __webpack_require__) {
92167
92168"use strict";
92169
92170
92171Object.defineProperty(exports, "__esModule", {
92172 value: true
92173});
92174exports.DEFAULTS = undefined;
92175
92176var _getIterator2;
92177
92178function _load_getIterator() {
92179 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
92180}
92181
92182var _assign;
92183
92184function _load_assign() {
92185 return _assign = _interopRequireDefault(__webpack_require__(23));
92186}
92187
92188var _asyncToGenerator2;
92189
92190function _load_asyncToGenerator() {
92191 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
92192}
92193
92194var _classCallCheck2;
92195
92196function _load_classCallCheck() {
92197 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
92198}
92199
92200var _possibleConstructorReturn2;
92201
92202function _load_possibleConstructorReturn() {
92203 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
92204}
92205
92206var _inherits2;
92207
92208function _load_inherits() {
92209 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
92210}
92211
92212var _constants;
92213
92214function _load_constants() {
92215 return _constants = __webpack_require__(13);
92216}
92217
92218var _npmRegistry;
92219
92220function _load_npmRegistry() {
92221 return _npmRegistry = _interopRequireDefault(__webpack_require__(84));
92222}
92223
92224var _lockfile;
92225
92226function _load_lockfile() {
92227 return _lockfile = __webpack_require__(25);
92228}
92229
92230var _fs;
92231
92232function _load_fs() {
92233 return _fs = _interopRequireWildcard(__webpack_require__(8));
92234}
92235
92236var _yarnVersion;
92237
92238function _load_yarnVersion() {
92239 return _yarnVersion = __webpack_require__(96);
92240}
92241
92242function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
92243
92244function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
92245
92246var userHome = __webpack_require__(101).default;
92247var path = __webpack_require__(1);
92248
92249var DEFAULTS = exports.DEFAULTS = {
92250 'version-tag-prefix': 'v',
92251 'version-git-tag': true,
92252 'version-commit-hooks': true,
92253 'version-git-sign': false,
92254 'version-git-message': 'v%s',
92255
92256 'init-version': '1.0.0',
92257 'init-license': 'MIT',
92258
92259 'save-prefix': '^',
92260 'bin-links': true,
92261 'ignore-scripts': false,
92262 'ignore-optional': false,
92263 registry: (_constants || _load_constants()).YARN_REGISTRY,
92264 'strict-ssl': true,
92265 'user-agent': [`yarn/${(_yarnVersion || _load_yarnVersion()).version}`, 'npm/?', `node/${process.version}`, process.platform, process.arch].join(' ')
92266};
92267
92268var RELATIVE_KEYS = ['yarn-offline-mirror', 'cache-folder', 'global-folder', 'offline-cache-folder', 'yarn-path'];
92269var FOLDER_KEY = ['yarn-offline-mirror', 'cache-folder', 'global-folder', 'offline-cache-folder'];
92270
92271var npmMap = {
92272 'version-git-sign': 'sign-git-tag',
92273 'version-tag-prefix': 'tag-version-prefix',
92274 'version-git-tag': 'git-tag-version',
92275 'version-commit-hooks': 'commit-hooks',
92276 'version-git-message': 'message'
92277};
92278
92279var YarnRegistry = function (_NpmRegistry) {
92280 (0, (_inherits2 || _load_inherits()).default)(YarnRegistry, _NpmRegistry);
92281
92282 function YarnRegistry(cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles) {
92283 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, YarnRegistry);
92284
92285 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _NpmRegistry.call(this, cwd, registries, requestManager, reporter, enableDefaultRc, extraneousRcFiles));
92286
92287 _this.homeConfigLoc = path.join(userHome, '.yarnrc');
92288 _this.homeConfig = {};
92289 return _this;
92290 }
92291
92292 YarnRegistry.prototype.getOption = function getOption(key) {
92293 var val = this.config[key];
92294
92295 // if this isn't set in a yarn config, then use npm
92296 if (typeof val === 'undefined') {
92297 val = this.registries.npm.getOption(npmMap[key]);
92298 }
92299
92300 if (typeof val === 'undefined') {
92301 val = this.registries.npm.getOption(key);
92302 }
92303
92304 // if this isn't set in a yarn config or npm config, then use the default (or undefined)
92305 if (typeof val === 'undefined') {
92306 val = DEFAULTS[key];
92307 }
92308
92309 return val;
92310 };
92311
92312 YarnRegistry.prototype.loadConfig = function () {
92313 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
92314 var locations = yield this.getPossibleConfigLocations('yarnrc', this.reporter);
92315
92316 for (var _iterator = locations, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
92317 var _ref3;
92318
92319 if (_isArray) {
92320 if (_i >= _iterator.length) break;
92321 _ref3 = _iterator[_i++];
92322 } else {
92323 _i = _iterator.next();
92324 if (_i.done) break;
92325 _ref3 = _i.value;
92326 }
92327
92328 var _ref2 = _ref3;
92329 var isHome = _ref2[0];
92330 var loc = _ref2[1];
92331 var file = _ref2[2];
92332
92333 var _parse = (0, (_lockfile || _load_lockfile()).parse)(file, loc),
92334 config = _parse.object;
92335
92336 if (isHome) {
92337 this.homeConfig = config;
92338 }
92339
92340 for (var _iterator2 = RELATIVE_KEYS, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
92341 var _ref4;
92342
92343 if (_isArray2) {
92344 if (_i2 >= _iterator2.length) break;
92345 _ref4 = _iterator2[_i2++];
92346 } else {
92347 _i2 = _iterator2.next();
92348 if (_i2.done) break;
92349 _ref4 = _i2.value;
92350 }
92351
92352 var key = _ref4;
92353
92354 var valueLoc = config[key];
92355
92356 if (!this.config[key] && valueLoc) {
92357 var resolvedLoc = config[key] = path.resolve(path.dirname(loc), valueLoc);
92358
92359 if (FOLDER_KEY.indexOf(key) !== -1) {
92360 yield (_fs || _load_fs()).mkdirp(resolvedLoc);
92361 }
92362 }
92363 }
92364
92365 // merge with any existing environment variables
92366 var env = config.env;
92367 if (env) {
92368 var existingEnv = this.config.env;
92369 if (existingEnv) {
92370 this.config.env = (0, (_assign || _load_assign()).default)({}, env, existingEnv);
92371 }
92372 }
92373
92374 this.config = (0, (_assign || _load_assign()).default)({}, config, this.config);
92375 }
92376
92377 // default yarn config
92378 this.config = (0, (_assign || _load_assign()).default)({}, DEFAULTS, this.config);
92379 });
92380
92381 function loadConfig() {
92382 return _ref.apply(this, arguments);
92383 }
92384
92385 return loadConfig;
92386 }();
92387
92388 YarnRegistry.prototype.saveHomeConfig = function () {
92389 var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) {
92390 YarnRegistry.normalizeConfig(config);
92391
92392 for (var key in config) {
92393 var val = config[key];
92394
92395 // if the current config key was taken from home config then update
92396 // the global config
92397 if (this.homeConfig[key] === this.config[key]) {
92398 this.config[key] = val;
92399 }
92400
92401 // update just the home config
92402 this.homeConfig[key] = config[key];
92403 }
92404
92405 yield (_fs || _load_fs()).writeFilePreservingEol(this.homeConfigLoc, `${(0, (_lockfile || _load_lockfile()).stringify)(this.homeConfig)}\n`);
92406 });
92407
92408 function saveHomeConfig(_x) {
92409 return _ref5.apply(this, arguments);
92410 }
92411
92412 return saveHomeConfig;
92413 }();
92414
92415 return YarnRegistry;
92416}((_npmRegistry || _load_npmRegistry()).default);
92417
92418YarnRegistry.filename = 'yarn.json';
92419exports.default = YarnRegistry;
92420
92421/***/ }),
92422/* 516 */
92423/***/ (function(module, exports, __webpack_require__) {
92424
92425"use strict";
92426
92427
92428Object.defineProperty(exports, "__esModule", {
92429 value: true
92430});
92431
92432var _stringify;
92433
92434function _load_stringify() {
92435 return _stringify = _interopRequireDefault(__webpack_require__(36));
92436}
92437
92438var _classCallCheck2;
92439
92440function _load_classCallCheck() {
92441 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
92442}
92443
92444var _possibleConstructorReturn2;
92445
92446function _load_possibleConstructorReturn() {
92447 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
92448}
92449
92450var _inherits2;
92451
92452function _load_inherits() {
92453 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
92454}
92455
92456var _jsonReporter;
92457
92458function _load_jsonReporter() {
92459 return _jsonReporter = _interopRequireDefault(__webpack_require__(200));
92460}
92461
92462function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
92463
92464var BufferReporter = function (_JSONReporter) {
92465 (0, (_inherits2 || _load_inherits()).default)(BufferReporter, _JSONReporter);
92466
92467 function BufferReporter(opts) {
92468 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BufferReporter);
92469
92470 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _JSONReporter.call(this, opts));
92471
92472 _this._buffer = [];
92473 return _this;
92474 }
92475
92476 BufferReporter.prototype._dump = function _dump(type, data, error) {
92477 this._buffer.push({
92478 type,
92479 data,
92480 error: !!error
92481 });
92482 };
92483
92484 BufferReporter.prototype.getBuffer = function getBuffer() {
92485 return this._buffer;
92486 };
92487
92488 BufferReporter.prototype.getBufferText = function getBufferText() {
92489 return this._buffer.map(function (_ref) {
92490 var data = _ref.data;
92491 return typeof data === 'string' ? data : (0, (_stringify || _load_stringify()).default)(data);
92492 }).join('');
92493 };
92494
92495 BufferReporter.prototype.getBufferJson = function getBufferJson() {
92496 return JSON.parse(this.getBufferText());
92497 };
92498
92499 return BufferReporter;
92500}((_jsonReporter || _load_jsonReporter()).default);
92501
92502exports.default = BufferReporter;
92503
92504/***/ }),
92505/* 517 */
92506/***/ (function(module, exports, __webpack_require__) {
92507
92508"use strict";
92509
92510
92511Object.defineProperty(exports, "__esModule", {
92512 value: true
92513});
92514
92515var _asyncToGenerator2;
92516
92517function _load_asyncToGenerator() {
92518 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
92519}
92520
92521var _promise;
92522
92523function _load_promise() {
92524 return _promise = _interopRequireDefault(__webpack_require__(7));
92525}
92526
92527var _getIterator2;
92528
92529function _load_getIterator() {
92530 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
92531}
92532
92533var _set;
92534
92535function _load_set() {
92536 return _set = _interopRequireDefault(__webpack_require__(16));
92537}
92538
92539var _classCallCheck2;
92540
92541function _load_classCallCheck() {
92542 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
92543}
92544
92545var _possibleConstructorReturn2;
92546
92547function _load_possibleConstructorReturn() {
92548 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
92549}
92550
92551var _inherits2;
92552
92553function _load_inherits() {
92554 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
92555}
92556
92557var _baseReporter;
92558
92559function _load_baseReporter() {
92560 return _baseReporter = _interopRequireDefault(__webpack_require__(98));
92561}
92562
92563var _progressBar;
92564
92565function _load_progressBar() {
92566 return _progressBar = _interopRequireDefault(__webpack_require__(519));
92567}
92568
92569var _spinnerProgress;
92570
92571function _load_spinnerProgress() {
92572 return _spinnerProgress = _interopRequireDefault(__webpack_require__(520));
92573}
92574
92575var _util;
92576
92577function _load_util() {
92578 return _util = __webpack_require__(199);
92579}
92580
92581var _misc;
92582
92583function _load_misc() {
92584 return _misc = __webpack_require__(28);
92585}
92586
92587var _treeHelper;
92588
92589function _load_treeHelper() {
92590 return _treeHelper = __webpack_require__(518);
92591}
92592
92593var _inquirer;
92594
92595function _load_inquirer() {
92596 return _inquirer = _interopRequireDefault(__webpack_require__(193));
92597}
92598
92599var _cliTable;
92600
92601function _load_cliTable() {
92602 return _cliTable = _interopRequireDefault(__webpack_require__(568));
92603}
92604
92605function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
92606
92607var _require = __webpack_require__(9),
92608 _inspect = _require.inspect;
92609
92610var readline = __webpack_require__(187);
92611var chalk = __webpack_require__(37);
92612var stripAnsi = __webpack_require__(269);
92613var read = __webpack_require__(862);
92614var tty = __webpack_require__(148);
92615
92616var AUDIT_COL_WIDTHS = [15, 62];
92617
92618var auditSeverityColors = {
92619 info: chalk.bold,
92620 low: chalk.bold,
92621 moderate: chalk.yellow,
92622 high: chalk.red,
92623 critical: chalk.bgRed
92624};
92625
92626// fixes bold on windows
92627if (process.platform === 'win32' && !(process.env.TERM && /^xterm/i.test(process.env.TERM))) {
92628 chalk.bold._styles[0].close += '\u001b[m';
92629}
92630
92631var ConsoleReporter = function (_BaseReporter) {
92632 (0, (_inherits2 || _load_inherits()).default)(ConsoleReporter, _BaseReporter);
92633
92634 function ConsoleReporter(opts) {
92635 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ConsoleReporter);
92636
92637 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseReporter.call(this, opts));
92638
92639 _this._lastCategorySize = 0;
92640 _this._spinners = new (_set || _load_set()).default();
92641 _this.format = chalk;
92642 _this.format.stripColor = stripAnsi;
92643 _this.isSilent = !!opts.isSilent;
92644 return _this;
92645 }
92646
92647 ConsoleReporter.prototype._prependEmoji = function _prependEmoji(msg, emoji) {
92648 if (this.emoji && emoji && this.isTTY) {
92649 msg = `${emoji} ${msg}`;
92650 }
92651 return msg;
92652 };
92653
92654 ConsoleReporter.prototype._logCategory = function _logCategory(category, color, msg) {
92655 this._lastCategorySize = category.length;
92656 this._log(`${this.format[color](category)} ${msg}`);
92657 };
92658
92659 ConsoleReporter.prototype._verbose = function _verbose(msg) {
92660 this._logCategory('verbose', 'grey', `${process.uptime()} ${msg}`);
92661 };
92662
92663 ConsoleReporter.prototype._verboseInspect = function _verboseInspect(obj) {
92664 this.inspect(obj);
92665 };
92666
92667 ConsoleReporter.prototype.close = function close() {
92668 for (var _iterator = this._spinners, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
92669 var _ref;
92670
92671 if (_isArray) {
92672 if (_i >= _iterator.length) break;
92673 _ref = _iterator[_i++];
92674 } else {
92675 _i = _iterator.next();
92676 if (_i.done) break;
92677 _ref = _i.value;
92678 }
92679
92680 var spinner = _ref;
92681
92682 spinner.stop();
92683 }
92684 this._spinners.clear();
92685 this.stopProgress();
92686 _BaseReporter.prototype.close.call(this);
92687 };
92688
92689 ConsoleReporter.prototype.table = function table(head, body) {
92690 var _this2 = this;
92691
92692 //
92693 head = head.map(function (field) {
92694 return _this2.format.underline(field);
92695 });
92696
92697 //
92698 var rows = [head].concat(body);
92699
92700 // get column widths
92701 var cols = [];
92702
92703 var _loop = function _loop(i) {
92704 var widths = rows.map(function (row) {
92705 return _this2.format.stripColor(row[i]).length;
92706 });
92707 cols[i] = Math.max.apply(Math, widths);
92708 };
92709
92710 for (var i = 0; i < head.length; i++) {
92711 _loop(i);
92712 }
92713
92714 //
92715 var builtRows = rows.map(function (row) {
92716 for (var i = 0; i < row.length; i++) {
92717 var field = row[i];
92718 var padding = cols[i] - _this2.format.stripColor(field).length;
92719
92720 row[i] = field + ' '.repeat(padding);
92721 }
92722 return row.join(' ');
92723 });
92724
92725 this.log(builtRows.join('\n'));
92726 };
92727
92728 ConsoleReporter.prototype.step = function step(current, total, msg, emoji) {
92729 msg = this._prependEmoji(msg, emoji);
92730
92731 if (msg.endsWith('?')) {
92732 msg = `${(0, (_misc || _load_misc()).removeSuffix)(msg, '?')}...?`;
92733 } else {
92734 msg += '...';
92735 }
92736
92737 this.log(`${this.format.dim(`[${current}/${total}]`)} ${msg}`);
92738 };
92739
92740 ConsoleReporter.prototype.inspect = function inspect(value) {
92741 if (typeof value !== 'number' && typeof value !== 'string') {
92742 value = _inspect(value, {
92743 breakLength: 0,
92744 colors: this.isTTY,
92745 depth: null,
92746 maxArrayLength: null
92747 });
92748 }
92749
92750 this.log(String(value), { force: true });
92751 };
92752
92753 ConsoleReporter.prototype.list = function list(key, items, hints) {
92754 var gutterWidth = (this._lastCategorySize || 2) - 1;
92755
92756 if (hints) {
92757 for (var _iterator2 = items, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
92758 var _ref2;
92759
92760 if (_isArray2) {
92761 if (_i2 >= _iterator2.length) break;
92762 _ref2 = _iterator2[_i2++];
92763 } else {
92764 _i2 = _iterator2.next();
92765 if (_i2.done) break;
92766 _ref2 = _i2.value;
92767 }
92768
92769 var item = _ref2;
92770
92771 this._log(`${' '.repeat(gutterWidth)}- ${this.format.bold(item)}`);
92772 this._log(` ${' '.repeat(gutterWidth)} ${hints[item]}`);
92773 }
92774 } else {
92775 for (var _iterator3 = items, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
92776 var _ref3;
92777
92778 if (_isArray3) {
92779 if (_i3 >= _iterator3.length) break;
92780 _ref3 = _iterator3[_i3++];
92781 } else {
92782 _i3 = _iterator3.next();
92783 if (_i3.done) break;
92784 _ref3 = _i3.value;
92785 }
92786
92787 var _item = _ref3;
92788
92789 this._log(`${' '.repeat(gutterWidth)}- ${_item}`);
92790 }
92791 }
92792 };
92793
92794 ConsoleReporter.prototype.header = function header(command, pkg) {
92795 this.log(this.format.bold(`${pkg.name} ${command} v${pkg.version}`));
92796 };
92797
92798 ConsoleReporter.prototype.footer = function footer(showPeakMemory) {
92799 this.stopProgress();
92800
92801 var totalTime = (this.getTotalTime() / 1000).toFixed(2);
92802 var msg = `Done in ${totalTime}s.`;
92803 if (showPeakMemory) {
92804 var peakMemory = (this.peakMemory / 1024 / 1024).toFixed(2);
92805 msg += ` Peak memory usage ${peakMemory}MB.`;
92806 }
92807 this.log(this._prependEmoji(msg, '✨'));
92808 };
92809
92810 ConsoleReporter.prototype.log = function log(msg) {
92811 var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
92812 _ref4$force = _ref4.force,
92813 force = _ref4$force === undefined ? false : _ref4$force;
92814
92815 this._lastCategorySize = 0;
92816 this._log(msg, { force });
92817 };
92818
92819 ConsoleReporter.prototype._log = function _log(msg) {
92820 var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
92821 _ref5$force = _ref5.force,
92822 force = _ref5$force === undefined ? false : _ref5$force;
92823
92824 if (this.isSilent && !force) {
92825 return;
92826 }
92827 (0, (_util || _load_util()).clearLine)(this.stdout);
92828 this.stdout.write(`${msg}\n`);
92829 };
92830
92831 ConsoleReporter.prototype.success = function success(msg) {
92832 this._logCategory('success', 'green', msg);
92833 };
92834
92835 ConsoleReporter.prototype.error = function error(msg) {
92836 (0, (_util || _load_util()).clearLine)(this.stderr);
92837 this.stderr.write(`${this.format.red('error')} ${msg}\n`);
92838 };
92839
92840 ConsoleReporter.prototype.info = function info(msg) {
92841 this._logCategory('info', 'blue', msg);
92842 };
92843
92844 ConsoleReporter.prototype.command = function command(_command) {
92845 this.log(this.format.dim(`$ ${_command}`));
92846 };
92847
92848 ConsoleReporter.prototype.warn = function warn(msg) {
92849 (0, (_util || _load_util()).clearLine)(this.stderr);
92850 this.stderr.write(`${this.format.yellow('warning')} ${msg}\n`);
92851 };
92852
92853 ConsoleReporter.prototype.question = function question(_question) {
92854 var _this3 = this;
92855
92856 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
92857
92858 if (!process.stdout.isTTY) {
92859 return (_promise || _load_promise()).default.reject(new Error("Can't answer a question unless a user TTY"));
92860 }
92861
92862 return new (_promise || _load_promise()).default(function (resolve, reject) {
92863 read({
92864 prompt: `${_this3.format.dim('question')} ${_question}: `,
92865 silent: !!options.password,
92866 output: _this3.stdout,
92867 input: _this3.stdin
92868 }, function (err, answer) {
92869 if (err) {
92870 if (err.message === 'canceled') {
92871 process.exitCode = 1;
92872 }
92873 reject(err);
92874 } else {
92875 if (!answer && options.required) {
92876 _this3.error(_this3.lang('answerRequired'));
92877 resolve(_this3.question(_question, options));
92878 } else {
92879 resolve(answer);
92880 }
92881 }
92882 });
92883 });
92884 };
92885 // handles basic tree output to console
92886
92887
92888 ConsoleReporter.prototype.tree = function tree(key, trees) {
92889 var _this4 = this;
92890
92891 var _ref6 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {},
92892 _ref6$force = _ref6.force,
92893 force = _ref6$force === undefined ? false : _ref6$force;
92894
92895 this.stopProgress();
92896 //
92897 if (this.isSilent && !force) {
92898 return;
92899 }
92900 var output = function output(_ref7, titlePrefix, childrenPrefix) {
92901 var name = _ref7.name,
92902 children = _ref7.children,
92903 hint = _ref7.hint,
92904 color = _ref7.color;
92905
92906 var formatter = _this4.format;
92907 var out = (0, (_treeHelper || _load_treeHelper()).getFormattedOutput)({
92908 prefix: titlePrefix,
92909 hint,
92910 color,
92911 name,
92912 formatter
92913 });
92914 _this4.stdout.write(out);
92915
92916 if (children && children.length) {
92917 (0, (_treeHelper || _load_treeHelper()).recurseTree)((0, (_treeHelper || _load_treeHelper()).sortTrees)(children), childrenPrefix, output);
92918 }
92919 };
92920 (0, (_treeHelper || _load_treeHelper()).recurseTree)((0, (_treeHelper || _load_treeHelper()).sortTrees)(trees), '', output);
92921 };
92922
92923 ConsoleReporter.prototype.activitySet = function activitySet(total, workers) {
92924 var _this5 = this;
92925
92926 if (!this.isTTY || this.noProgress) {
92927 return _BaseReporter.prototype.activitySet.call(this, total, workers);
92928 }
92929
92930 var spinners = [];
92931 var reporterSpinners = this._spinners;
92932
92933 for (var i = 1; i < workers; i++) {
92934 this.log('');
92935 }
92936
92937 var _loop2 = function _loop2(_i4) {
92938 var spinner = new (_spinnerProgress || _load_spinnerProgress()).default(_this5.stderr, _i4);
92939 reporterSpinners.add(spinner);
92940 spinner.start();
92941
92942 var prefix = null;
92943 var current = 0;
92944 var updatePrefix = function updatePrefix() {
92945 spinner.setPrefix(`${_this5.format.dim(`[${current === 0 ? '-' : current}/${total}]`)} `);
92946 };
92947 var clear = function clear() {
92948 prefix = null;
92949 current = 0;
92950 updatePrefix();
92951 spinner.setText('waiting...');
92952 };
92953 clear();
92954
92955 spinners.unshift({
92956 clear,
92957
92958 setPrefix(_current, _prefix) {
92959 current = _current;
92960 prefix = _prefix;
92961 spinner.setText(prefix);
92962 updatePrefix();
92963 },
92964
92965 tick(msg) {
92966 if (prefix) {
92967 msg = `${prefix}: ${msg}`;
92968 }
92969 spinner.setText(msg);
92970 },
92971
92972 end() {
92973 spinner.stop();
92974 reporterSpinners.delete(spinner);
92975 }
92976 });
92977 };
92978
92979 for (var _i4 = 0; _i4 < workers; _i4++) {
92980 _loop2(_i4);
92981 }
92982
92983 return {
92984 spinners,
92985 end: function end() {
92986 for (var _iterator4 = spinners, _isArray4 = Array.isArray(_iterator4), _i5 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
92987 var _ref8;
92988
92989 if (_isArray4) {
92990 if (_i5 >= _iterator4.length) break;
92991 _ref8 = _iterator4[_i5++];
92992 } else {
92993 _i5 = _iterator4.next();
92994 if (_i5.done) break;
92995 _ref8 = _i5.value;
92996 }
92997
92998 var _spinner = _ref8;
92999
93000 _spinner.end();
93001 }
93002 readline.moveCursor(_this5.stdout, 0, -workers + 1);
93003 }
93004 };
93005 };
93006
93007 ConsoleReporter.prototype.activity = function activity() {
93008 if (!this.isTTY) {
93009 return {
93010 tick() {},
93011 end() {}
93012 };
93013 }
93014 var reporterSpinners = this._spinners;
93015
93016 var spinner = new (_spinnerProgress || _load_spinnerProgress()).default(this.stderr);
93017 spinner.start();
93018
93019 reporterSpinners.add(spinner);
93020
93021 return {
93022 tick(name) {
93023 spinner.setText(name);
93024 },
93025
93026 end() {
93027 spinner.stop();
93028 reporterSpinners.delete(spinner);
93029 }
93030 };
93031 };
93032
93033 ConsoleReporter.prototype.select = function select(header, question, options) {
93034 var _this6 = this;
93035
93036 if (!this.isTTY) {
93037 return (_promise || _load_promise()).default.reject(new Error("Can't answer a question unless a user TTY"));
93038 }
93039
93040 var rl = readline.createInterface({
93041 input: this.stdin,
93042 output: this.stdout,
93043 terminal: true
93044 });
93045
93046 var questions = options.map(function (opt) {
93047 return opt.name;
93048 });
93049 var answers = options.map(function (opt) {
93050 return opt.value;
93051 });
93052
93053 function toIndex(input) {
93054 var index = answers.indexOf(input);
93055
93056 if (index >= 0) {
93057 return index;
93058 } else {
93059 return +input;
93060 }
93061 }
93062
93063 return new (_promise || _load_promise()).default(function (resolve) {
93064 _this6.info(header);
93065
93066 for (var i = 0; i < questions.length; i++) {
93067 _this6.log(` ${_this6.format.dim(`${i + 1})`)} ${questions[i]}`);
93068 }
93069
93070 var ask = function ask() {
93071 rl.question(`${question}: `, function (input) {
93072 var index = toIndex(input);
93073
93074 if (isNaN(index)) {
93075 _this6.log('Not a number');
93076 ask();
93077 return;
93078 }
93079
93080 if (index <= 0 || index > options.length) {
93081 _this6.log('Outside answer range');
93082 ask();
93083 return;
93084 }
93085
93086 // get index
93087 index--;
93088 rl.close();
93089 resolve(answers[index]);
93090 });
93091 };
93092
93093 ask();
93094 });
93095 };
93096
93097 ConsoleReporter.prototype.progress = function progress(count) {
93098 var _this7 = this;
93099
93100 if (this.noProgress || count <= 0) {
93101 return function () {
93102 // noop
93103 };
93104 }
93105
93106 if (!this.isTTY) {
93107 return function () {
93108 // TODO what should the behaviour here be? we could buffer progress messages maybe
93109 };
93110 }
93111
93112 // Clear any potentially old progress bars
93113 this.stopProgress();
93114
93115 var bar = this._progressBar = new (_progressBar || _load_progressBar()).default(count, this.stderr, function (progress) {
93116 if (progress === _this7._progressBar) {
93117 _this7._progressBar = null;
93118 }
93119 });
93120
93121 bar.render();
93122
93123 return function () {
93124 bar.tick();
93125 };
93126 };
93127
93128 ConsoleReporter.prototype.stopProgress = function stopProgress() {
93129 if (this._progressBar) {
93130 this._progressBar.stop();
93131 }
93132 };
93133
93134 ConsoleReporter.prototype.prompt = function () {
93135 var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (message, choices) {
93136 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
93137
93138 if (!process.stdout.isTTY) {
93139 return (_promise || _load_promise()).default.reject(new Error("Can't answer a question unless a user TTY"));
93140 }
93141
93142 var pageSize = void 0;
93143 if (process.stdout instanceof tty.WriteStream) {
93144 pageSize = process.stdout.rows - 2;
93145 }
93146
93147 var rl = readline.createInterface({
93148 input: this.stdin,
93149 output: this.stdout,
93150 terminal: true
93151 });
93152
93153 // $FlowFixMe: Need to update the type of Inquirer
93154 var prompt = (_inquirer || _load_inquirer()).default.createPromptModule({
93155 input: this.stdin,
93156 output: this.stdout
93157 });
93158
93159 var _options$name = options.name,
93160 name = _options$name === undefined ? 'prompt' : _options$name,
93161 _options$type = options.type,
93162 type = _options$type === undefined ? 'input' : _options$type,
93163 validate = options.validate;
93164
93165 var answers = yield prompt([{ name, type, message, choices, pageSize, validate }]);
93166
93167 rl.close();
93168
93169 return answers[name];
93170 });
93171
93172 function prompt(_x5, _x6) {
93173 return _ref9.apply(this, arguments);
93174 }
93175
93176 return prompt;
93177 }();
93178
93179 ConsoleReporter.prototype.auditSummary = function auditSummary(auditMetadata) {
93180 var totalDependencies = auditMetadata.totalDependencies,
93181 vulnerabilities = auditMetadata.vulnerabilities;
93182
93183 var totalVulnerabilities = vulnerabilities.info + vulnerabilities.low + vulnerabilities.moderate + vulnerabilities.high + vulnerabilities.critical;
93184 var summary = this.lang('auditSummary', totalVulnerabilities > 0 ? this.rawText(chalk.red(totalVulnerabilities.toString())) : totalVulnerabilities, totalDependencies);
93185 this._log(summary);
93186
93187 if (totalVulnerabilities) {
93188 var severities = [];
93189 if (vulnerabilities.info) {
93190 severities.push(this.lang('auditInfo', vulnerabilities.info));
93191 }
93192 if (vulnerabilities.low) {
93193 severities.push(this.lang('auditLow', vulnerabilities.low));
93194 }
93195 if (vulnerabilities.moderate) {
93196 severities.push(this.lang('auditModerate', vulnerabilities.moderate));
93197 }
93198 if (vulnerabilities.high) {
93199 severities.push(this.lang('auditHigh', vulnerabilities.high));
93200 }
93201 if (vulnerabilities.critical) {
93202 severities.push(this.lang('auditCritical', vulnerabilities.critical));
93203 }
93204 this._log(`${this.lang('auditSummarySeverity')} ${severities.join(' | ')}`);
93205 }
93206 };
93207
93208 ConsoleReporter.prototype.auditAction = function auditAction(recommendation) {
93209 var label = recommendation.action.resolves.length === 1 ? 'vulnerability' : 'vulnerabilities';
93210 this._log(this.lang('auditResolveCommand', this.rawText(chalk.inverse(recommendation.cmd)), recommendation.action.resolves.length, this.rawText(label)));
93211 if (recommendation.isBreaking) {
93212 this._log(this.lang('auditSemverMajorChange'));
93213 }
93214 };
93215
93216 ConsoleReporter.prototype.auditManualReview = function auditManualReview() {
93217 var tableOptions = {
93218 colWidths: [78]
93219 };
93220 var table = new (_cliTable || _load_cliTable()).default(tableOptions);
93221 table.push([{
93222 content: this.lang('auditManualReview'),
93223 vAlign: 'center',
93224 hAlign: 'center'
93225 }]);
93226
93227 this._log(table.toString());
93228 };
93229
93230 ConsoleReporter.prototype.auditAdvisory = function auditAdvisory(resolution, _auditAdvisory) {
93231 function colorSeverity(severity, message) {
93232 return auditSeverityColors[severity](message || severity);
93233 }
93234
93235 function makeAdvisoryTableRow(patchedIn) {
93236 var patchRows = [];
93237
93238 if (patchedIn) {
93239 patchRows.push({ 'Patched in': patchedIn });
93240 }
93241
93242 return [{ [chalk.bold(colorSeverity(_auditAdvisory.severity))]: chalk.bold(_auditAdvisory.title) }, { Package: _auditAdvisory.module_name }].concat(patchRows, [{ 'Dependency of': `${resolution.path.split('>')[0]} ${resolution.dev ? '[dev]' : ''}` }, { Path: resolution.path.split('>').join(' > ') }, { 'More info': `https://www.npmjs.com/advisories/${_auditAdvisory.id}` }]);
93243 }
93244
93245 var tableOptions = {
93246 colWidths: AUDIT_COL_WIDTHS,
93247 wordWrap: true
93248 };
93249 var table = new (_cliTable || _load_cliTable()).default(tableOptions);
93250 var patchedIn = _auditAdvisory.patched_versions.replace(' ', '') === '<0.0.0' ? 'No patch available' : _auditAdvisory.patched_versions;
93251 table.push.apply(table, makeAdvisoryTableRow(patchedIn));
93252 this._log(table.toString());
93253 };
93254
93255 return ConsoleReporter;
93256}((_baseReporter || _load_baseReporter()).default);
93257
93258exports.default = ConsoleReporter;
93259
93260/***/ }),
93261/* 518 */
93262/***/ (function(module, exports, __webpack_require__) {
93263
93264"use strict";
93265
93266
93267Object.defineProperty(exports, "__esModule", {
93268 value: true
93269});
93270exports.sortTrees = sortTrees;
93271exports.recurseTree = recurseTree;
93272exports.getFormattedOutput = getFormattedOutput;
93273
93274
93275// public
93276
93277
93278// types
93279function sortTrees(trees) {
93280 return trees.sort(function (tree1, tree2) {
93281 return tree1.name.localeCompare(tree2.name);
93282 });
93283}
93284
93285function recurseTree(tree, prefix, recurseFunc) {
93286 var treeLen = tree.length;
93287 var treeEnd = treeLen - 1;
93288 for (var i = 0; i < treeLen; i++) {
93289 var atEnd = i === treeEnd;
93290 recurseFunc(tree[i], prefix + getLastIndentChar(atEnd), prefix + getNextIndentChar(atEnd));
93291 }
93292}
93293
93294function getFormattedOutput(fmt) {
93295 var item = formatColor(fmt.color, fmt.name, fmt.formatter);
93296 var suffix = getSuffix(fmt.hint, fmt.formatter);
93297 return `${fmt.prefix}─ ${item}${suffix}\n`;
93298}
93299
93300function getNextIndentChar(end) {
93301 return end ? ' ' : '│ ';
93302}
93303
93304function getLastIndentChar(end) {
93305 return end ? '└' : '├';
93306}
93307
93308function getSuffix(hint, formatter) {
93309 return hint ? ` (${formatter.grey(hint)})` : '';
93310}
93311
93312function formatColor(color, strToFormat, formatter) {
93313 return color ? formatter[color](strToFormat) : strToFormat;
93314}
93315
93316/***/ }),
93317/* 519 */
93318/***/ (function(module, exports, __webpack_require__) {
93319
93320"use strict";
93321
93322
93323Object.defineProperty(exports, "__esModule", {
93324 value: true
93325});
93326
93327var _classCallCheck2;
93328
93329function _load_classCallCheck() {
93330 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
93331}
93332
93333var _util;
93334
93335function _load_util() {
93336 return _util = __webpack_require__(199);
93337}
93338
93339function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
93340
93341var ProgressBar = function () {
93342 function ProgressBar(total) {
93343 var stdout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.stderr;
93344 var callback = arguments[2];
93345 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, ProgressBar);
93346
93347 this.stdout = stdout;
93348 this.total = total;
93349 this.chars = ProgressBar.bars[0];
93350 this.delay = 60;
93351 this.curr = 0;
93352 this._callback = callback;
93353 (0, (_util || _load_util()).clearLine)(stdout);
93354 }
93355
93356 ProgressBar.prototype.tick = function tick() {
93357 var _this = this;
93358
93359 if (this.curr >= this.total) {
93360 return;
93361 }
93362
93363 this.curr++;
93364
93365 // schedule render
93366 if (!this.id) {
93367 this.id = setTimeout(function () {
93368 return _this.render();
93369 }, this.delay);
93370 }
93371 };
93372
93373 ProgressBar.prototype.cancelTick = function cancelTick() {
93374 if (this.id) {
93375 clearTimeout(this.id);
93376 this.id = null;
93377 }
93378 };
93379
93380 ProgressBar.prototype.stop = function stop() {
93381 // "stop" by setting current to end so `tick` becomes noop
93382 this.curr = this.total;
93383
93384 this.cancelTick();
93385 (0, (_util || _load_util()).clearLine)(this.stdout);
93386 if (this._callback) {
93387 this._callback(this);
93388 }
93389 };
93390
93391 ProgressBar.prototype.render = function render() {
93392 // clear throttle
93393 this.cancelTick();
93394
93395 var ratio = this.curr / this.total;
93396 ratio = Math.min(Math.max(ratio, 0), 1);
93397
93398 // progress without bar
93399 var bar = ` ${this.curr}/${this.total}`;
93400
93401 // calculate size of actual bar
93402 // $FlowFixMe: investigate process.stderr.columns flow error
93403 var availableSpace = Math.max(0, this.stdout.columns - bar.length - 3);
93404 var width = Math.min(this.total, availableSpace);
93405 var completeLength = Math.round(width * ratio);
93406 var complete = this.chars[0].repeat(completeLength);
93407 var incomplete = this.chars[1].repeat(width - completeLength);
93408 bar = `[${complete}${incomplete}]${bar}`;
93409
93410 (0, (_util || _load_util()).toStartOfLine)(this.stdout);
93411 this.stdout.write(bar);
93412 };
93413
93414 return ProgressBar;
93415}();
93416
93417ProgressBar.bars = [['#', '-']];
93418exports.default = ProgressBar;
93419
93420/***/ }),
93421/* 520 */
93422/***/ (function(module, exports, __webpack_require__) {
93423
93424"use strict";
93425
93426
93427Object.defineProperty(exports, "__esModule", {
93428 value: true
93429});
93430
93431var _classCallCheck2;
93432
93433function _load_classCallCheck() {
93434 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
93435}
93436
93437var _util;
93438
93439function _load_util() {
93440 return _util = __webpack_require__(199);
93441}
93442
93443function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
93444
93445var Spinner = function () {
93446 function Spinner() {
93447 var stdout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : process.stderr;
93448 var lineNumber = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
93449 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, Spinner);
93450
93451 this.current = 0;
93452 this.prefix = '';
93453 this.lineNumber = lineNumber;
93454 this.stdout = stdout;
93455 this.delay = 60;
93456 this.chars = Spinner.spinners[28].split('');
93457 this.text = '';
93458 this.id = null;
93459 }
93460
93461 Spinner.prototype.setPrefix = function setPrefix(prefix) {
93462 this.prefix = prefix;
93463 };
93464
93465 Spinner.prototype.setText = function setText(text) {
93466 this.text = text;
93467 };
93468
93469 Spinner.prototype.start = function start() {
93470 this.current = 0;
93471 this.render();
93472 };
93473
93474 Spinner.prototype.render = function render() {
93475 var _this = this;
93476
93477 if (this.id) {
93478 clearTimeout(this.id);
93479 }
93480 // build line ensuring we don't wrap to the next line
93481 var msg = `${this.prefix}${this.chars[this.current]} ${this.text}`;
93482 var columns = typeof this.stdout.columns === 'number' ? this.stdout.columns : 100;
93483 msg = msg.slice(0, columns);
93484 (0, (_util || _load_util()).writeOnNthLine)(this.stdout, this.lineNumber, msg);
93485 this.current = ++this.current % this.chars.length;
93486 this.id = setTimeout(function () {
93487 return _this.render();
93488 }, this.delay);
93489 };
93490
93491 Spinner.prototype.stop = function stop() {
93492 if (this.id) {
93493 clearTimeout(this.id);
93494 this.id = null;
93495 }
93496 (0, (_util || _load_util()).clearNthLine)(this.stdout, this.lineNumber);
93497 };
93498
93499 return Spinner;
93500}();
93501
93502Spinner.spinners = ['|/-\\', '⠂-–—–-', '◐◓◑◒', '◴◷◶◵', '◰◳◲◱', '▖▘▝▗', '■□▪▫', '▌▀▐▄', '▉▊▋▌▍▎▏▎▍▌▋▊▉', '▁▃▄▅▆▇█▇▆▅▄▃', '←↖↑↗→↘↓↙', '┤┘┴└├┌┬┐', '◢◣◤◥', '.oO°Oo.', '.oO@*', '🌍🌎🌏', '◡◡ ⊙⊙ ◠◠', '☱☲☴', '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏', '⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓', '⠄⠆⠇⠋⠙⠸⠰⠠⠰⠸⠙⠋⠇⠆', '⠋⠙⠚⠒⠂⠂⠒⠲⠴⠦⠖⠒⠐⠐⠒⠓⠋', '⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠴⠲⠒⠂⠂⠒⠚⠙⠉⠁', '⠈⠉⠋⠓⠒⠐⠐⠒⠖⠦⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈', '⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈', '⢄⢂⢁⡁⡈⡐⡠', '⢹⢺⢼⣸⣇⡧⡗⡏', '⣾⣽⣻⢿⡿⣟⣯⣷', '⠁⠂⠄⡀⢀⠠⠐⠈'];
93503exports.default = Spinner;
93504
93505/***/ }),
93506/* 521 */
93507/***/ (function(module, exports, __webpack_require__) {
93508
93509"use strict";
93510
93511
93512Object.defineProperty(exports, "__esModule", {
93513 value: true
93514});
93515
93516var _assign;
93517
93518function _load_assign() {
93519 return _assign = _interopRequireDefault(__webpack_require__(23));
93520}
93521
93522var _classCallCheck2;
93523
93524function _load_classCallCheck() {
93525 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
93526}
93527
93528var _possibleConstructorReturn2;
93529
93530function _load_possibleConstructorReturn() {
93531 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
93532}
93533
93534var _inherits2;
93535
93536function _load_inherits() {
93537 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
93538}
93539
93540var _jsonReporter;
93541
93542function _load_jsonReporter() {
93543 return _jsonReporter = _interopRequireDefault(__webpack_require__(200));
93544}
93545
93546function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
93547
93548var _require = __webpack_require__(95),
93549 EventEmitter = _require.EventEmitter;
93550
93551var EventReporter = function (_JSONReporter) {
93552 (0, (_inherits2 || _load_inherits()).default)(EventReporter, _JSONReporter);
93553
93554 function EventReporter(opts) {
93555 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, EventReporter);
93556
93557 // $FlowFixMe: looks like a flow bug
93558 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _JSONReporter.call(this, opts));
93559
93560 EventEmitter.call(_this);
93561 return _this;
93562 }
93563
93564 EventReporter.prototype._dump = function _dump(type, data) {
93565 this.emit(type, data);
93566 };
93567
93568 return EventReporter;
93569}((_jsonReporter || _load_jsonReporter()).default);
93570
93571exports.default = EventReporter;
93572
93573
93574(0, (_assign || _load_assign()).default)(EventReporter.prototype, EventEmitter.prototype);
93575
93576/***/ }),
93577/* 522 */
93578/***/ (function(module, exports, __webpack_require__) {
93579
93580"use strict";
93581
93582
93583Object.defineProperty(exports, "__esModule", {
93584 value: true
93585});
93586function formatFunction() {
93587 for (var _len = arguments.length, strs = Array(_len), _key = 0; _key < _len; _key++) {
93588 strs[_key] = arguments[_key];
93589 }
93590
93591 return strs.join(' ');
93592}
93593
93594var defaultFormatter = exports.defaultFormatter = {
93595 bold: formatFunction,
93596 dim: formatFunction,
93597 italic: formatFunction,
93598 underline: formatFunction,
93599 inverse: formatFunction,
93600 strikethrough: formatFunction,
93601 black: formatFunction,
93602 red: formatFunction,
93603 green: formatFunction,
93604 yellow: formatFunction,
93605 blue: formatFunction,
93606 magenta: formatFunction,
93607 cyan: formatFunction,
93608 white: formatFunction,
93609 gray: formatFunction,
93610 grey: formatFunction,
93611 stripColor: formatFunction
93612};
93613
93614/***/ }),
93615/* 523 */
93616/***/ (function(module, exports, __webpack_require__) {
93617
93618"use strict";
93619
93620
93621Object.defineProperty(exports, "__esModule", {
93622 value: true
93623});
93624
93625/* eslint max-len: 0 */
93626
93627var messages = {
93628 upToDate: 'Already up-to-date.',
93629 folderInSync: 'Folder in sync.',
93630 nothingToInstall: 'Nothing to install.',
93631 resolvingPackages: 'Resolving packages',
93632 checkingManifest: 'Validating package.json',
93633 fetchingPackages: 'Fetching packages',
93634 linkingDependencies: 'Linking dependencies',
93635 rebuildingPackages: 'Rebuilding all packages',
93636 buildingFreshPackages: 'Building fresh packages',
93637 cleaningModules: 'Cleaning modules',
93638 bumpingVersion: 'Bumping version',
93639 savingHar: 'Saving HAR file: $0',
93640 answer: 'Answer?',
93641 usage: 'Usage',
93642 installCommandRenamed: '`install` has been replaced with `add` to add new dependencies. Run $0 instead.',
93643 globalFlagRemoved: '`--global` has been deprecated. Please run $0 instead.',
93644 waitingInstance: 'Waiting for the other yarn instance to finish (pid $0, inside $1)',
93645 waitingNamedInstance: 'Waiting for the other yarn instance to finish ($0)',
93646 offlineRetrying: 'There appears to be trouble with your network connection. Retrying...',
93647 internalServerErrorRetrying: 'There appears to be trouble with the npm registry (returned $1). Retrying...',
93648 clearedCache: 'Cleared cache.',
93649 couldntClearPackageFromCache: "Couldn't clear package $0 from cache",
93650 clearedPackageFromCache: 'Cleared package $0 from cache',
93651 packWroteTarball: 'Wrote tarball to $0.',
93652 invalidBinField: 'Invalid bin field for $0.',
93653 invalidBinEntry: 'Invalid bin entry for $1 (in $0).',
93654 helpExamples: ' Examples:\n$0\n',
93655 helpCommands: ' Commands:\n$0\n',
93656 helpCommandsMore: ' Run `$0` for more information on specific commands.',
93657 helpLearnMore: ' Visit $0 to learn more about Yarn.\n',
93658
93659 manifestPotentialTypo: 'Potential typo $0, did you mean $1?',
93660 manifestBuiltinModule: '$0 is also the name of a node core module',
93661 manifestNameDot: "Name can't start with a dot",
93662 manifestNameIllegalChars: 'Name contains illegal characters',
93663 manifestNameBlacklisted: 'Name is blacklisted',
93664 manifestLicenseInvalid: 'License should be a valid SPDX license expression',
93665 manifestLicenseNone: 'No license field',
93666 manifestStringExpected: '$0 is not a string',
93667 manifestDependencyCollision: '$0 has dependency $1 with range $2 that collides with a dependency in $3 of the same name with version $4',
93668 manifestDirectoryNotFound: 'Unable to read $0 directory of module $1',
93669
93670 verboseFileCopy: 'Copying $0 to $1.',
93671 verboseFileLink: 'Creating hardlink at $0 to $1.',
93672 verboseFileSymlink: 'Creating symlink at $0 to $1.',
93673 verboseFileSkip: 'Skipping copying of file $0 as the file at $1 is the same size ($2) and mtime ($3).',
93674 verboseFileSkipSymlink: 'Skipping copying of $0 as the file at $1 is the same symlink ($2).',
93675 verboseFileSkipHardlink: 'Skipping copying of $0 as the file at $1 is the same hardlink ($2).',
93676 verboseFileRemoveExtraneous: 'Removing extraneous file $0.',
93677 verboseFilePhantomExtraneous: "File $0 would be marked as extraneous but has been removed as it's listed as a phantom file.",
93678 verboseFileSkipArtifact: 'Skipping copying of $0 as the file is marked as a built artifact and subject to change.',
93679 verboseFileFolder: 'Creating directory $0.',
93680
93681 verboseRequestStart: 'Performing $0 request to $1.',
93682 verboseRequestFinish: 'Request $0 finished with status code $1.',
93683
93684 configSet: 'Set $0 to $1.',
93685 configDelete: 'Deleted $0.',
93686 configNpm: 'npm config',
93687 configYarn: 'yarn config',
93688
93689 couldntFindPackagejson: "Couldn't find a package.json file in $0",
93690 couldntFindMatch: "Couldn't find match for $0 in $1 for $2.",
93691 couldntFindPackageInCache: "Couldn't find any versions for $0 that matches $1 in our cache (possible versions are $2). This is usually caused by a missing entry in the lockfile, running Yarn without the --offline flag may help fix this issue.",
93692 couldntFindVersionThatMatchesRange: "Couldn't find any versions for $0 that matches $1",
93693 chooseVersionFromList: 'Please choose a version of $0 from this list:',
93694 moduleNotInManifest: "This module isn't specified in a package.json file.",
93695 moduleAlreadyInManifest: '$0 is already in $1. Please remove existing entry first before adding it to $2.',
93696 unknownFolderOrTarball: "Passed folder/tarball doesn't exist,",
93697 unknownPackage: "Couldn't find package $0.",
93698 unknownPackageName: "Couldn't find package name.",
93699 unknownUser: "Couldn't find user $0.",
93700 unknownRegistryResolver: 'Unknown registry resolver $0',
93701 userNotAnOwner: "User $0 isn't an owner of this package.",
93702 invalidVersionArgument: 'Use the $0 flag to create a new version.',
93703 invalidVersion: 'Invalid version supplied.',
93704 requiredVersionInRange: 'Required version in range.',
93705 packageNotFoundRegistry: "Couldn't find package $0 on the $1 registry.",
93706 requiredPackageNotFoundRegistry: "Couldn't find package $0 required by $1 on the $2 registry.",
93707 doesntExist: "Package $1 refers to a non-existing file '$0'.",
93708 missingRequiredPackageKey: `Package $0 doesn't have a $1.`,
93709 invalidAccess: 'Invalid argument for access, expected public or restricted.',
93710 invalidCommand: 'Invalid subcommand. Try $0',
93711 invalidGistFragment: 'Invalid gist fragment $0.',
93712 invalidHostedGitFragment: 'Invalid hosted git fragment $0.',
93713 invalidFragment: 'Invalid fragment $0.',
93714 invalidPackageName: 'Invalid package name.',
93715 invalidPackageVersion: "Can't add $0: invalid package version $1.",
93716 couldntFindManifestIn: "Couldn't find manifest in $0.",
93717 shrinkwrapWarning: 'npm-shrinkwrap.json found. This will not be updated or respected. See https://yarnpkg.com/en/docs/migrating-from-npm for more information.',
93718 npmLockfileWarning: 'package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.',
93719 lockfileOutdated: 'Outdated lockfile. Please run `yarn install` and try again.',
93720 lockfileMerged: 'Merge conflict detected in yarn.lock and successfully merged.',
93721 lockfileConflict: 'A merge conflict was found in yarn.lock but it could not be successfully merged, regenerating yarn.lock from scratch.',
93722 ignoredScripts: 'Ignored scripts due to flag.',
93723 missingAddDependencies: 'Missing list of packages to add to your project.',
93724 yesWarning: 'The yes flag has been set. This will automatically answer yes to all questions, which may have security implications.',
93725 networkWarning: "You don't appear to have an internet connection. Try the --offline flag to use the cache for registry queries.",
93726 flatGlobalError: 'The package $0 requires a flat dependency graph. Add `"flat": true` to your package.json and try again.',
93727 noName: `Package doesn't have a name.`,
93728 noVersion: `Package doesn't have a version.`,
93729 answerRequired: 'An answer is required.',
93730 missingWhyDependency: 'Missing package name, folder or path to file to identify why a package has been installed',
93731 bugReport: 'If you think this is a bug, please open a bug report with the information provided in $0.',
93732 unexpectedError: 'An unexpected error occurred: $0.',
93733 jsonError: 'Error parsing JSON at $0, $1.',
93734 noPermission: 'Cannot create $0 due to insufficient permissions.',
93735 noGlobalFolder: 'Cannot find a suitable global folder. Tried these: $0',
93736 allDependenciesUpToDate: 'All of your dependencies are up to date.',
93737 legendColorsForVersionUpdates: 'Color legend : \n $0 : Major Update backward-incompatible updates \n $1 : Minor Update backward-compatible features \n $2 : Patch Update backward-compatible bug fixes',
93738 frozenLockfileError: 'Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.',
93739 fileWriteError: 'Could not write file $0: $1',
93740 multiplePackagesCantUnpackInSameDestination: 'Pattern $0 is trying to unpack in the same destination $1 as pattern $2. This could result in non-deterministic behavior, skipping.',
93741 incorrectLockfileEntry: 'Lockfile has incorrect entry for $0. Ignoring it.',
93742
93743 invalidResolutionName: 'Resolution field $0 does not end with a valid package name and will be ignored',
93744 invalidResolutionVersion: 'Resolution field $0 has an invalid version entry and may be ignored',
93745 incompatibleResolutionVersion: 'Resolution field $0 is incompatible with requested version $1',
93746
93747 yarnOutdated: "Your current version of Yarn is out of date. The latest version is $0, while you're on $1.",
93748 yarnOutdatedInstaller: 'To upgrade, download the latest installer at $0.',
93749 yarnOutdatedCommand: 'To upgrade, run the following command:',
93750
93751 tooManyArguments: 'Too many arguments, maximum of $0.',
93752 tooFewArguments: 'Not enough arguments, expected at least $0.',
93753 noArguments: "This command doesn't require any arguments.",
93754
93755 ownerRemoving: 'Removing owner $0 from package $1.',
93756 ownerRemoved: 'Owner removed.',
93757 ownerRemoveError: "Couldn't remove owner.",
93758 ownerGetting: 'Getting owners for package $0',
93759 ownerGettingFailed: "Couldn't get list of owners.",
93760 ownerAlready: 'This user is already an owner of this package.',
93761 ownerAdded: 'Added owner.',
93762 ownerAdding: 'Adding owner $0 to package $1',
93763 ownerAddingFailed: "Couldn't add owner.",
93764 ownerNone: 'No owners.',
93765
93766 teamCreating: 'Creating team',
93767 teamRemoving: 'Removing team',
93768 teamAddingUser: 'Adding user to team',
93769 teamRemovingUser: 'Removing user from team',
93770 teamListing: 'Listing teams',
93771
93772 cleaning: 'Cleaning modules',
93773 cleanCreatingFile: 'Creating $0',
93774 cleanCreatedFile: 'Created $0. Please review the contents of this file then run "yarn autoclean --force" to perform a clean.',
93775 cleanAlreadyExists: '$0 already exists. To revert to the default file, delete $0 then rerun this command.',
93776 cleanRequiresForce: 'This command required the "--force" flag to perform the clean. This is a destructive operation. Files specified in $0 will be deleted.',
93777 cleanDoesNotExist: '$0 does not exist. Autoclean will delete files specified by $0. Run "autoclean --init" to create $0 with the default entries.',
93778
93779 binLinkCollision: "There's already a linked binary called $0 in your global Yarn bin. Could not link this package's $0 bin entry.",
93780 linkCollision: "There's already a package called $0 registered. This command has had no effect. If this command was run in another folder with the same name, the other folder is still linked. Please run yarn unlink in the other folder if you want to register this folder.",
93781 linkMissing: 'No registered package found called $0.',
93782 linkRegistered: 'Registered $0.',
93783 linkRegisteredMessage: 'You can now run `yarn link $0` in the projects where you want to use this package and it will be used instead.',
93784 linkUnregistered: 'Unregistered $0.',
93785 linkUnregisteredMessage: 'You can now run `yarn unlink $0` in the projects where you no longer want to use this package.',
93786 linkUsing: 'Using linked package for $0.',
93787 linkDisusing: 'Removed linked package $0.',
93788 linkDisusingMessage: 'You will need to run `yarn install --force` to re-install the package that was linked.',
93789 linkTargetMissing: 'The target of linked package $0 is missing. Removing link.',
93790
93791 createInvalidBin: 'Invalid bin entry found in package $0.',
93792 createMissingPackage: 'Package not found - this is probably an internal error, and should be reported at https://github.com/yarnpkg/yarn/issues.',
93793
93794 workspacesAddRootCheck: 'Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).',
93795 workspacesRemoveRootCheck: 'Running this command will remove the dependency from the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).',
93796 workspacesFocusRootCheck: 'This command can only be run inside an individual workspace.',
93797 workspacesRequirePrivateProjects: 'Workspaces can only be enabled in private projects.',
93798 workspacesSettingMustBeArray: 'The workspaces field in package.json must be an array.',
93799 workspacesDisabled: 'Your project root defines workspaces but the feature is disabled in your Yarn config. Please check "workspaces-experimental" in your .yarnrc file.',
93800
93801 workspacesNohoistRequirePrivatePackages: 'nohoist config is ignored in $0 because it is not a private package. If you think nohoist should be allowed in public packages, please submit an issue for your use case.',
93802 workspacesNohoistDisabled: `$0 defines nohoist but the feature is disabled in your Yarn config ("workspaces-nohoist-experimental" in .yarnrc file)`,
93803
93804 workspaceRootNotFound: "Cannot find the root of your workspace - are you sure you're currently in a workspace?",
93805 workspaceMissingWorkspace: 'Missing workspace name.',
93806 workspaceMissingCommand: 'Missing command name.',
93807 workspaceUnknownWorkspace: 'Unknown workspace $0.',
93808 workspaceVersionMandatory: 'Missing version in workspace at $0, ignoring.',
93809 workspaceNameMandatory: 'Missing name in workspace at $0, ignoring.',
93810 workspaceNameDuplicate: 'There are more than one workspace with name $0',
93811
93812 cacheFolderSkipped: 'Skipping preferred cache folder $0 because it is not writable.',
93813 cacheFolderMissing: "Yarn hasn't been able to find a cache folder it can use. Please use the explicit --cache-folder option to tell it what location to use, or make one of the preferred locations writable.",
93814 cacheFolderSelected: 'Selected the next writable cache folder in the list, will be $0.',
93815
93816 execMissingCommand: 'Missing command name.',
93817
93818 noScriptsAvailable: 'There are no scripts specified inside package.json.',
93819 noBinAvailable: 'There are no binary scripts available.',
93820 dashDashDeprecation: `From Yarn 1.0 onwards, scripts don't require "--" for options to be forwarded. In a future version, any explicit "--" will be forwarded as-is to the scripts.`,
93821 commandNotSpecified: 'No command specified.',
93822 binCommands: 'Commands available from binary scripts: ',
93823 possibleCommands: 'Project commands',
93824 commandQuestion: 'Which command would you like to run?',
93825 commandFailedWithCode: 'Command failed with exit code $0.',
93826 commandFailedWithSignal: 'Command failed with signal $0.',
93827 packageRequiresNodeGyp: 'This package requires node-gyp, which is not currently installed. Yarn will attempt to automatically install it. If this fails, you can run "yarn global add node-gyp" to manually install it.',
93828 nodeGypAutoInstallFailed: 'Failed to auto-install node-gyp. Please run "yarn global add node-gyp" manually. Error: $0',
93829
93830 foundIncompatible: 'Found incompatible module.',
93831 incompatibleEngine: 'The engine $0 is incompatible with this module. Expected version $1. Got $2',
93832 incompatibleCPU: 'The CPU architecture $0 is incompatible with this module.',
93833 incompatibleOS: 'The platform $0 is incompatible with this module.',
93834 invalidEngine: 'The engine $0 appears to be invalid.',
93835 cannotRunWithIncompatibleEnv: 'Commands cannot run with an incompatible environment.',
93836
93837 optionalCompatibilityExcluded: '$0 is an optional dependency and failed compatibility check. Excluding it from installation.',
93838 optionalModuleFail: 'This module is OPTIONAL, you can safely ignore this error',
93839 optionalModuleScriptFail: 'Error running install script for optional dependency: $0',
93840 optionalModuleCleanupFail: 'Could not cleanup build artifacts from failed install: $0',
93841
93842 unmetPeer: '$0 has unmet peer dependency $1.',
93843 incorrectPeer: '$0 has incorrect peer dependency $1.',
93844 selectedPeer: 'Selecting $1 at level $2 as the peer dependency of $0.',
93845 missingBundledDependency: '$0 is missing a bundled dependency $1. This should be reported to the package maintainer.',
93846
93847 savedNewDependency: 'Saved 1 new dependency.',
93848 savedNewDependencies: 'Saved $0 new dependencies.',
93849 directDependencies: 'Direct dependencies',
93850 allDependencies: 'All dependencies',
93851
93852 foundWarnings: 'Found $0 warnings.',
93853 foundErrors: 'Found $0 errors.',
93854
93855 savedLockfile: 'Saved lockfile.',
93856 noRequiredLockfile: 'No lockfile in this directory. Run `yarn install` to generate one.',
93857 noLockfileFound: 'No lockfile found.',
93858
93859 invalidSemver: 'Invalid semver version',
93860 newVersion: 'New version',
93861 currentVersion: 'Current version',
93862 noVersionOnPublish: 'Proceeding with current version',
93863
93864 manualVersionResolution: 'Unable to find a suitable version for $0, please choose one by typing one of the numbers below:',
93865 manualVersionResolutionOption: '$0 which resolved to $1',
93866
93867 createdTag: 'Created tag.',
93868 createdTagFail: "Couldn't add tag.",
93869 deletedTag: 'Deleted tag.',
93870 deletedTagFail: "Couldn't delete tag.",
93871 gettingTags: 'Getting tags',
93872 deletingTags: 'Deleting tag',
93873 creatingTag: 'Creating tag $0 = $1',
93874
93875 whyStart: 'Why do we have the module $0?',
93876 whyFinding: 'Finding dependency',
93877 whyCalculating: 'Calculating file sizes',
93878 whyUnknownMatch: "We couldn't find a match!",
93879 whyInitGraph: 'Initialising dependency graph',
93880 whyWhoKnows: "We don't know why this module exists",
93881 whyDiskSizeWithout: 'Disk size without dependencies: $0',
93882 whyDiskSizeUnique: 'Disk size with unique dependencies: $0',
93883 whyDiskSizeTransitive: 'Disk size with transitive dependencies: $0',
93884 whySharedDependencies: 'Number of shared dependencies: $0',
93885 whyHoistedTo: `Has been hoisted to $0`,
93886
93887 whyHoistedFromSimple: `This module exists because it's hoisted from $0.`,
93888 whyNotHoistedSimple: `This module exists here because it's in the nohoist list $0.`,
93889 whyDependedOnSimple: `This module exists because $0 depends on it.`,
93890 whySpecifiedSimple: `This module exists because it's specified in $0.`,
93891 whyReasons: 'Reasons this module exists',
93892 whyHoistedFrom: 'Hoisted from $0',
93893 whyNotHoisted: `in the nohoist list $0`,
93894 whyDependedOn: '$0 depends on it',
93895 whySpecified: `Specified in $0`,
93896
93897 whyMatch: `\r=> Found $0`,
93898
93899 uninstalledPackages: 'Uninstalled packages.',
93900 uninstallRegenerate: 'Regenerating lockfile and installing missing dependencies',
93901
93902 cleanRemovedFiles: 'Removed $0 files',
93903 cleanSavedSize: 'Saved $0 MB.',
93904
93905 configFileFound: 'Found configuration file $0.',
93906 configPossibleFile: 'Checking for configuration file $0.',
93907
93908 npmUsername: 'npm username',
93909 npmPassword: 'npm password',
93910 npmEmail: 'npm email',
93911 npmOneTimePassword: 'npm one-time password',
93912
93913 loggingIn: 'Logging in',
93914 loggedIn: 'Logged in.',
93915 notRevokingEnvToken: 'Not revoking login token, specified via environment variable.',
93916 notRevokingConfigToken: 'Not revoking login token, specified via config file.',
93917 noTokenToRevoke: 'No login token to revoke.',
93918 revokingToken: 'Revoking token',
93919 revokedToken: 'Revoked login token.',
93920
93921 loginAsPublic: 'Logging in as public',
93922 incorrectCredentials: 'Incorrect username or password.',
93923 incorrectOneTimePassword: 'Incorrect one-time password.',
93924 twoFactorAuthenticationEnabled: 'Two factor authentication enabled.',
93925 clearedCredentials: 'Cleared login credentials.',
93926
93927 publishFail: "Couldn't publish package: $0",
93928 publishPrivate: 'Package marked as private, not publishing.',
93929 published: 'Published.',
93930 publishing: 'Publishing',
93931
93932 nonInteractiveNoVersionSpecified: 'You must specify a new version with --new-version when running with --non-interactive.',
93933 nonInteractiveNoToken: "No token found and can't prompt for login when running with --non-interactive.",
93934
93935 infoFail: 'Received invalid response from npm.',
93936 malformedRegistryResponse: 'Received malformed response from registry for $0. The registry may be down.',
93937 registryNoVersions: 'No valid versions found for $0. The package may be unpublished.',
93938
93939 cantRequestOffline: "Can't make a request in offline mode ($0)",
93940 requestManagerNotSetupHAR: 'RequestManager was not setup to capture HAR files',
93941 requestError: 'Request $0 returned a $1',
93942 requestFailed: 'Request failed $0',
93943 tarballNotInNetworkOrCache: '$0: Tarball is not in network and can not be located in cache ($1)',
93944 fetchBadIntegrityCache: 'Incorrect integrity when fetching from the cache for $0. Cache has $1 and remote has $2. Run `yarn cache clean` to fix the problem',
93945 fetchBadHashCache: 'Incorrect hash when fetching from the cache for $0. Cache has $1 and remote has $2. Run `yarn cache clean` to fix the problem',
93946 fetchBadHashWithPath: "Integrity check failed for $0 (computed integrity doesn't match our records, got $2)",
93947 fetchBadIntegrityAlgorithm: 'Integrity checked failed for $0 (none of the specified algorithms are supported)',
93948 fetchErrorCorrupt: '$0. Mirror tarball appears to be corrupt. You can resolve this by running:\n\n rm -rf $1\n yarn install',
93949 errorExtractingTarball: 'Extracting tar content of $1 failed, the file appears to be corrupt: $0',
93950 updateInstalling: 'Installing $0...',
93951 hostedGitResolveError: 'Error connecting to repository. Please, check the url.',
93952 unauthorizedResponse: 'Received a 401 from $0. $1',
93953
93954 unknownFetcherFor: 'Unknown fetcher for $0',
93955
93956 downloadGitWithoutCommit: 'Downloading the git repo $0 over plain git without a commit hash',
93957 downloadHTTPWithoutCommit: 'Downloading the git repo $0 over HTTP without a commit hash',
93958
93959 unplugDisabled: "Packages can only be unplugged when Plug'n'Play is enabled.",
93960
93961 plugnplaySuggestV2L1: "Plug'n'Play support has been greatly improved on the Yarn v2 development branch.",
93962 plugnplaySuggestV2L2: 'Please give it a try and tell us what you think! - https://next.yarnpkg.com/getting-started/install',
93963 plugnplayWindowsSupport: "Plug'n'Play on Windows doesn't support the cache and project to be kept on separate drives",
93964
93965 packageInstalledWithBinaries: 'Installed $0 with binaries:',
93966 packageHasBinaries: '$0 has binaries:',
93967 packageHasNoBinaries: '$0 has no binaries',
93968 packageBinaryNotFound: "Couldn't find a binary named $0",
93969
93970 couldBeDeduped: '$0 could be deduped from $1 to $2',
93971 lockfileNotContainPattern: 'Lockfile does not contain pattern: $0',
93972 integrityCheckFailed: 'Integrity check failed',
93973 noIntegrityFile: "Couldn't find an integrity file",
93974 integrityFailedExpectedIsNotAJSON: 'Integrity check: integrity file is not a json',
93975 integrityCheckLinkedModulesDontMatch: "Integrity check: Linked modules don't match",
93976 integrityFlagsDontMatch: "Integrity check: Flags don't match",
93977 integrityLockfilesDontMatch: "Integrity check: Lock files don't match",
93978 integrityFailedFilesMissing: 'Integrity check: Files are missing',
93979 integrityPatternsDontMatch: "Integrity check: Top level patterns don't match",
93980 integrityModulesFoldersMissing: 'Integrity check: Some module folders are missing',
93981 integritySystemParamsDontMatch: "Integrity check: System parameters don't match",
93982 packageNotInstalled: '$0 not installed',
93983 optionalDepNotInstalled: 'Optional dependency $0 not installed',
93984 packageWrongVersion: '$0 is wrong version: expected $1, got $2',
93985 packageDontSatisfy: "$0 doesn't satisfy found match of $1",
93986
93987 lockfileExists: 'Lockfile already exists, not importing.',
93988 skippingImport: 'Skipping import of $0 for $1',
93989 importFailed: 'Import of $0 for $1 failed, resolving normally.',
93990 importResolveFailed: 'Import of $0 failed starting in $1',
93991 importResolvedRangeMatch: 'Using version $0 of $1 instead of $2 for $3',
93992 importSourceFilesCorrupted: 'Failed to import from package-lock.json, source file(s) corrupted',
93993 importPackageLock: 'found npm package-lock.json, converting to yarn.lock',
93994 importNodeModules: 'creating yarn.lock from local node_modules folder',
93995 packageContainsYarnAsGlobal: 'Installing Yarn via Yarn will result in you having two separate versions of Yarn installed at the same time, which is not recommended. To update Yarn please follow https://yarnpkg.com/en/docs/install .',
93996
93997 scopeNotValid: 'The specified scope is not valid.',
93998
93999 deprecatedCommand: '$0 is deprecated. Please use $1.',
94000 deprecatedListArgs: 'Filtering by arguments is deprecated. Please use the pattern option instead.',
94001 implicitFileDeprecated: 'Using the "file:" protocol implicitly is deprecated. Please either prepend the protocol or prepend the path $0 with "./".',
94002 unsupportedNodeVersion: 'You are using Node $0 which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: $1',
94003
94004 verboseUpgradeBecauseRequested: 'Considering upgrade of $0 to $1 because it was directly requested.',
94005 verboseUpgradeBecauseOutdated: 'Considering upgrade of $0 to $1 because a newer version exists in the registry.',
94006 verboseUpgradeNotUnlocking: 'Not unlocking $0 in the lockfile because it is a new or direct dependency.',
94007 verboseUpgradeUnlocking: 'Unlocking $0 in the lockfile.',
94008 folderMissing: "Directory $0 doesn't exist",
94009 mutexPortBusy: 'Cannot use the network mutex on port $0. It is probably used by another app.',
94010
94011 auditRunning: 'Auditing packages',
94012 auditSummary: '$0 vulnerabilities found - Packages audited: $1',
94013 auditSummarySeverity: 'Severity:',
94014 auditCritical: '$0 Critical',
94015 auditHigh: '$0 High',
94016 auditModerate: '$0 Moderate',
94017 auditLow: '$0 Low',
94018 auditInfo: '$0 Info',
94019 auditResolveCommand: '# Run $0 to resolve $1 $2',
94020 auditSemverMajorChange: 'SEMVER WARNING: Recommended action is a potentially breaking change',
94021 auditManualReview: 'Manual Review\nSome vulnerabilities require your attention to resolve\n\nVisit https://go.npm.me/audit-guide for additional guidance',
94022 auditRunAuditForDetails: 'Security audit found potential problems. Run "yarn audit" for additional details.',
94023 auditOffline: 'Skipping audit. Security audit cannot be performed in offline mode.'
94024};
94025
94026exports.default = messages;
94027
94028/***/ }),
94029/* 524 */
94030/***/ (function(module, exports, __webpack_require__) {
94031
94032"use strict";
94033
94034
94035Object.defineProperty(exports, "__esModule", {
94036 value: true
94037});
94038exports.en = undefined;
94039
94040var _en;
94041
94042function _load_en() {
94043 return _en = _interopRequireDefault(__webpack_require__(523));
94044}
94045
94046function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
94047
94048exports.en = (_en || _load_en()).default;
94049
94050/***/ }),
94051/* 525 */
94052/***/ (function(module, exports, __webpack_require__) {
94053
94054"use strict";
94055
94056
94057Object.defineProperty(exports, "__esModule", {
94058 value: true
94059});
94060
94061var _asyncToGenerator2;
94062
94063function _load_asyncToGenerator() {
94064 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
94065}
94066
94067var _promise;
94068
94069function _load_promise() {
94070 return _promise = _interopRequireDefault(__webpack_require__(7));
94071}
94072
94073var _classCallCheck2;
94074
94075function _load_classCallCheck() {
94076 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
94077}
94078
94079var _possibleConstructorReturn2;
94080
94081function _load_possibleConstructorReturn() {
94082 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
94083}
94084
94085var _inherits2;
94086
94087function _load_inherits() {
94088 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
94089}
94090
94091var _baseReporter;
94092
94093function _load_baseReporter() {
94094 return _baseReporter = _interopRequireDefault(__webpack_require__(98));
94095}
94096
94097function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
94098
94099/* eslint no-unused-vars: 0 */
94100
94101var NoopReporter = function (_BaseReporter) {
94102 (0, (_inherits2 || _load_inherits()).default)(NoopReporter, _BaseReporter);
94103
94104 function NoopReporter() {
94105 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, NoopReporter);
94106 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseReporter.apply(this, arguments));
94107 }
94108
94109 NoopReporter.prototype.lang = function lang(key) {
94110 return 'do nothing';
94111 };
94112
94113 NoopReporter.prototype.verbose = function verbose(msg) {};
94114
94115 NoopReporter.prototype.verboseInspect = function verboseInspect(val) {};
94116
94117 NoopReporter.prototype.initPeakMemoryCounter = function initPeakMemoryCounter() {};
94118
94119 NoopReporter.prototype.checkPeakMemory = function checkPeakMemory() {};
94120
94121 NoopReporter.prototype.close = function close() {};
94122
94123 NoopReporter.prototype.getTotalTime = function getTotalTime() {
94124 return 0;
94125 };
94126
94127 NoopReporter.prototype.list = function list(key, items, hints) {};
94128
94129 NoopReporter.prototype.tree = function tree(key, obj) {};
94130
94131 NoopReporter.prototype.step = function step(current, total, message, emoji) {};
94132
94133 NoopReporter.prototype.error = function error(message) {};
94134
94135 NoopReporter.prototype.info = function info(message) {};
94136
94137 NoopReporter.prototype.warn = function warn(message) {};
94138
94139 NoopReporter.prototype.success = function success(message) {};
94140
94141 NoopReporter.prototype.log = function log(message) {};
94142
94143 NoopReporter.prototype.command = function command(_command) {};
94144
94145 NoopReporter.prototype.inspect = function inspect(value) {};
94146
94147 NoopReporter.prototype.header = function header(command, pkg) {};
94148
94149 NoopReporter.prototype.footer = function footer(showPeakMemory) {};
94150
94151 NoopReporter.prototype.table = function table(head, body) {};
94152
94153 NoopReporter.prototype.activity = function activity() {
94154 return {
94155 tick(name) {},
94156 end() {}
94157 };
94158 };
94159
94160 NoopReporter.prototype.activitySet = function activitySet(total, workers) {
94161 return {
94162 spinners: Array(workers).fill({
94163 clear() {},
94164 setPrefix() {},
94165 tick() {},
94166 end() {}
94167 }),
94168 end() {}
94169 };
94170 };
94171
94172 NoopReporter.prototype.question = function question(_question) {
94173 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
94174
94175 return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
94176 };
94177
94178 NoopReporter.prototype.questionAffirm = function () {
94179 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (question) {
94180 yield this.question(question);
94181 return false;
94182 });
94183
94184 function questionAffirm(_x2) {
94185 return _ref.apply(this, arguments);
94186 }
94187
94188 return questionAffirm;
94189 }();
94190
94191 NoopReporter.prototype.select = function select(header, question, options) {
94192 return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
94193 };
94194
94195 NoopReporter.prototype.progress = function progress(total) {
94196 return function () {};
94197 };
94198
94199 NoopReporter.prototype.disableProgress = function disableProgress() {
94200 this.noProgress = true;
94201 };
94202
94203 NoopReporter.prototype.prompt = function prompt(message, choices) {
94204 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
94205
94206 return (_promise || _load_promise()).default.reject(new Error('Not implemented'));
94207 };
94208
94209 return NoopReporter;
94210}((_baseReporter || _load_baseReporter()).default);
94211
94212exports.default = NoopReporter;
94213
94214/***/ }),
94215/* 526 */
94216/***/ (function(module, exports, __webpack_require__) {
94217
94218"use strict";
94219
94220
94221Object.defineProperty(exports, "__esModule", {
94222 value: true
94223});
94224
94225var _extends2;
94226
94227function _load_extends() {
94228 return _extends2 = _interopRequireDefault(__webpack_require__(24));
94229}
94230
94231var _assign;
94232
94233function _load_assign() {
94234 return _assign = _interopRequireDefault(__webpack_require__(23));
94235}
94236
94237var _keys;
94238
94239function _load_keys() {
94240 return _keys = _interopRequireDefault(__webpack_require__(14));
94241}
94242
94243var _promise;
94244
94245function _load_promise() {
94246 return _promise = _interopRequireDefault(__webpack_require__(7));
94247}
94248
94249var _classCallCheck2;
94250
94251function _load_classCallCheck() {
94252 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
94253}
94254
94255var _possibleConstructorReturn2;
94256
94257function _load_possibleConstructorReturn() {
94258 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
94259}
94260
94261var _inherits2;
94262
94263function _load_inherits() {
94264 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
94265}
94266
94267var _packageRequest;
94268
94269function _load_packageRequest() {
94270 return _packageRequest = _interopRequireDefault(__webpack_require__(116));
94271}
94272
94273var _baseResolver;
94274
94275function _load_baseResolver() {
94276 return _baseResolver = _interopRequireDefault(__webpack_require__(117));
94277}
94278
94279var _workspaceLayout;
94280
94281function _load_workspaceLayout() {
94282 return _workspaceLayout = _interopRequireDefault(__webpack_require__(87));
94283}
94284
94285function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
94286
94287var invariant = __webpack_require__(15);
94288
94289var WorkspaceResolver = function (_BaseResolver) {
94290 (0, (_inherits2 || _load_inherits()).default)(WorkspaceResolver, _BaseResolver);
94291
94292 WorkspaceResolver.isWorkspace = function isWorkspace(pattern, workspaceLayout) {
94293 return !!workspaceLayout && !!workspaceLayout.getManifestByPattern(pattern);
94294 };
94295
94296 function WorkspaceResolver(request, fragment, workspaceLayout) {
94297 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, WorkspaceResolver);
94298
94299 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseResolver.call(this, request, fragment));
94300
94301 _this.workspaceLayout = workspaceLayout;
94302 return _this;
94303 }
94304
94305 WorkspaceResolver.prototype.resolve = function resolve(downloadedManifest) {
94306 var workspace = this.workspaceLayout.getManifestByPattern(this.request.pattern);
94307 invariant(workspace, 'expected workspace');
94308 var manifest = workspace.manifest,
94309 loc = workspace.loc;
94310
94311 if (manifest._remote && manifest._remote.registryRemote) {
94312 return (_promise || _load_promise()).default.resolve(manifest); //already downloaded
94313 }
94314 var registry = manifest._registry;
94315 invariant(registry, 'expected reference');
94316 var hash = '';
94317 var registryRemote = void 0;
94318 if (downloadedManifest && manifest.version === downloadedManifest.version) {
94319 registryRemote = downloadedManifest._remote;
94320 invariant(registryRemote, 'missing remote info');
94321 hash = registryRemote.hash;
94322 //override any local changes to manifest
94323 (0, (_keys || _load_keys()).default)(manifest).forEach(function (k) {
94324 return k.startsWith('_') || delete manifest[k];
94325 });
94326 (0, (_assign || _load_assign()).default)(manifest, downloadedManifest);
94327 } else if (manifest._remote && manifest._remote.hash) {
94328 invariant(workspace.manifest._remote, 'missing remote info');
94329 registryRemote = workspace.manifest._remote.registryRemote;
94330 hash = manifest._remote.hash;
94331 }
94332 if (registryRemote) {
94333 registryRemote = (0, (_extends2 || _load_extends()).default)({}, registryRemote);
94334 }
94335
94336 manifest._remote = (0, (_assign || _load_assign()).default)(manifest._remote || {}, {
94337 type: 'workspace',
94338 registryRemote,
94339 registry,
94340 hash,
94341 reference: loc
94342 });
94343
94344 manifest._uid = manifest.version;
94345
94346 return (_promise || _load_promise()).default.resolve(manifest);
94347 };
94348
94349 return WorkspaceResolver;
94350}((_baseResolver || _load_baseResolver()).default);
94351
94352exports.default = WorkspaceResolver;
94353
94354/***/ }),
94355/* 527 */
94356/***/ (function(module, exports, __webpack_require__) {
94357
94358"use strict";
94359
94360
94361Object.defineProperty(exports, "__esModule", {
94362 value: true
94363});
94364
94365var _asyncToGenerator2;
94366
94367function _load_asyncToGenerator() {
94368 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
94369}
94370
94371var _classCallCheck2;
94372
94373function _load_classCallCheck() {
94374 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
94375}
94376
94377var _possibleConstructorReturn2;
94378
94379function _load_possibleConstructorReturn() {
94380 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
94381}
94382
94383var _inherits2;
94384
94385function _load_inherits() {
94386 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
94387}
94388
94389var _hostedGitResolver;
94390
94391function _load_hostedGitResolver() {
94392 return _hostedGitResolver = _interopRequireDefault(__webpack_require__(99));
94393}
94394
94395function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
94396
94397var BitbucketResolver = function (_HostedGitResolver) {
94398 (0, (_inherits2 || _load_inherits()).default)(BitbucketResolver, _HostedGitResolver);
94399
94400 function BitbucketResolver() {
94401 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, BitbucketResolver);
94402 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _HostedGitResolver.apply(this, arguments));
94403 }
94404
94405 BitbucketResolver.getTarballUrl = function getTarballUrl(parts, hash) {
94406 return `https://${this.hostname}/${parts.user}/${parts.repo}/get/${hash}.tar.gz`;
94407 };
94408
94409 BitbucketResolver.getGitHTTPBaseUrl = function getGitHTTPBaseUrl(parts) {
94410 return `https://${this.hostname}/${parts.user}/${parts.repo}`;
94411 };
94412
94413 BitbucketResolver.getGitHTTPUrl = function getGitHTTPUrl(parts) {
94414 return `${BitbucketResolver.getGitHTTPBaseUrl(parts)}.git`;
94415 };
94416
94417 BitbucketResolver.getGitSSHUrl = function getGitSSHUrl(parts) {
94418 return `git+ssh://git@${this.hostname}/${parts.user}/${parts.repo}.git` + `${parts.hash ? '#' + decodeURIComponent(parts.hash) : ''}`;
94419 };
94420
94421 BitbucketResolver.getHTTPFileUrl = function getHTTPFileUrl(parts, filename, commit) {
94422 return `https://${this.hostname}/${parts.user}/${parts.repo}/raw/${commit}/${filename}`;
94423 };
94424
94425 BitbucketResolver.prototype.hasHTTPCapability = function () {
94426 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (url) {
94427 // We don't follow redirects and reject a 302 since this means BitBucket
94428 // won't allow us to use the HTTP protocol for `git` access.
94429 // Most probably a private repo and this 302 is to a login page.
94430 var bitbucketHTTPSupport = yield this.config.requestManager.request({
94431 url,
94432 method: 'HEAD',
94433 queue: this.resolver.fetchingQueue,
94434 followRedirect: false,
94435 rejectStatusCode: 302
94436 });
94437 return bitbucketHTTPSupport !== false;
94438 });
94439
94440 function hasHTTPCapability(_x) {
94441 return _ref.apply(this, arguments);
94442 }
94443
94444 return hasHTTPCapability;
94445 }();
94446
94447 return BitbucketResolver;
94448}((_hostedGitResolver || _load_hostedGitResolver()).default);
94449
94450BitbucketResolver.hostname = 'bitbucket.org';
94451BitbucketResolver.protocol = 'bitbucket';
94452exports.default = BitbucketResolver;
94453
94454/***/ }),
94455/* 528 */
94456/***/ (function(module, exports, __webpack_require__) {
94457
94458"use strict";
94459
94460
94461Object.defineProperty(exports, "__esModule", {
94462 value: true
94463});
94464
94465var _classCallCheck2;
94466
94467function _load_classCallCheck() {
94468 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
94469}
94470
94471var _possibleConstructorReturn2;
94472
94473function _load_possibleConstructorReturn() {
94474 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
94475}
94476
94477var _inherits2;
94478
94479function _load_inherits() {
94480 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
94481}
94482
94483var _hostedGitResolver;
94484
94485function _load_hostedGitResolver() {
94486 return _hostedGitResolver = _interopRequireDefault(__webpack_require__(99));
94487}
94488
94489function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
94490
94491var GitLabResolver = function (_HostedGitResolver) {
94492 (0, (_inherits2 || _load_inherits()).default)(GitLabResolver, _HostedGitResolver);
94493
94494 function GitLabResolver() {
94495 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, GitLabResolver);
94496 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _HostedGitResolver.apply(this, arguments));
94497 }
94498
94499 GitLabResolver.getTarballUrl = function getTarballUrl(parts, hash) {
94500 return `https://${this.hostname}/${parts.user}/${parts.repo}/repository/archive.tar.gz?ref=${hash}`;
94501 };
94502
94503 GitLabResolver.getGitHTTPBaseUrl = function getGitHTTPBaseUrl(parts) {
94504 return `https://${this.hostname}/${parts.user}/${parts.repo}`;
94505 };
94506
94507 GitLabResolver.getGitHTTPUrl = function getGitHTTPUrl(parts) {
94508 return `${GitLabResolver.getGitHTTPBaseUrl(parts)}.git`;
94509 };
94510
94511 GitLabResolver.getGitSSHUrl = function getGitSSHUrl(parts) {
94512 return `git+ssh://git@${this.hostname}/${parts.user}/${parts.repo}.git` + `${parts.hash ? '#' + decodeURIComponent(parts.hash) : ''}`;
94513 };
94514
94515 GitLabResolver.getHTTPFileUrl = function getHTTPFileUrl(parts, filename, commit) {
94516 return `https://${this.hostname}/${parts.user}/${parts.repo}/raw/${commit}/${filename}`;
94517 };
94518
94519 return GitLabResolver;
94520}((_hostedGitResolver || _load_hostedGitResolver()).default);
94521
94522GitLabResolver.hostname = 'gitlab.com';
94523GitLabResolver.protocol = 'gitlab';
94524exports.default = GitLabResolver;
94525
94526/***/ }),
94527/* 529 */
94528/***/ (function(module, exports, __webpack_require__) {
94529
94530"use strict";
94531
94532
94533Object.defineProperty(exports, "__esModule", {
94534 value: true
94535});
94536
94537var _classCallCheck2;
94538
94539function _load_classCallCheck() {
94540 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
94541}
94542
94543var _possibleConstructorReturn2;
94544
94545function _load_possibleConstructorReturn() {
94546 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
94547}
94548
94549var _inherits2;
94550
94551function _load_inherits() {
94552 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
94553}
94554
94555var _errors;
94556
94557function _load_errors() {
94558 return _errors = __webpack_require__(6);
94559}
94560
94561var _exoticResolver;
94562
94563function _load_exoticResolver() {
94564 return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
94565}
94566
94567function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
94568
94569var RegistryResolver = function (_ExoticResolver) {
94570 (0, (_inherits2 || _load_inherits()).default)(RegistryResolver, _ExoticResolver);
94571
94572 function RegistryResolver(request, fragment) {
94573 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, RegistryResolver);
94574
94575 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
94576
94577 var match = fragment.match(/^(\S+):(@?.*?)(@(.*?)|)$/);
94578 if (match) {
94579 _this.range = match[4] || 'latest';
94580 _this.name = match[2];
94581 } else {
94582 throw new (_errors || _load_errors()).MessageError(_this.reporter.lang('invalidFragment', fragment));
94583 }
94584
94585 // $FlowFixMe
94586 _this.registry = _this.constructor.protocol;
94587 return _this;
94588 }
94589
94590 RegistryResolver.prototype.resolve = function resolve() {
94591 return this.fork(this.constructor.factory, false, this.name, this.range);
94592 };
94593
94594 return RegistryResolver;
94595}((_exoticResolver || _load_exoticResolver()).default);
94596
94597exports.default = RegistryResolver;
94598
94599/***/ }),
94600/* 530 */
94601/***/ (function(module, exports, __webpack_require__) {
94602
94603"use strict";
94604
94605
94606Object.defineProperty(exports, "__esModule", {
94607 value: true
94608});
94609
94610var _asyncToGenerator2;
94611
94612function _load_asyncToGenerator() {
94613 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
94614}
94615
94616var _classCallCheck2;
94617
94618function _load_classCallCheck() {
94619 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
94620}
94621
94622var _possibleConstructorReturn2;
94623
94624function _load_possibleConstructorReturn() {
94625 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
94626}
94627
94628var _inherits2;
94629
94630function _load_inherits() {
94631 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
94632}
94633
94634var _tarballFetcher;
94635
94636function _load_tarballFetcher() {
94637 return _tarballFetcher = _interopRequireDefault(__webpack_require__(300));
94638}
94639
94640var _exoticResolver;
94641
94642function _load_exoticResolver() {
94643 return _exoticResolver = _interopRequireDefault(__webpack_require__(85));
94644}
94645
94646var _gitResolver;
94647
94648function _load_gitResolver() {
94649 return _gitResolver = _interopRequireDefault(__webpack_require__(118));
94650}
94651
94652var _guessName;
94653
94654function _load_guessName() {
94655 return _guessName = _interopRequireDefault(__webpack_require__(159));
94656}
94657
94658var _version;
94659
94660function _load_version() {
94661 return _version = _interopRequireWildcard(__webpack_require__(209));
94662}
94663
94664var _crypto;
94665
94666function _load_crypto() {
94667 return _crypto = _interopRequireWildcard(__webpack_require__(158));
94668}
94669
94670var _fs;
94671
94672function _load_fs() {
94673 return _fs = _interopRequireWildcard(__webpack_require__(8));
94674}
94675
94676function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
94677
94678function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
94679
94680var invariant = __webpack_require__(15);
94681
94682var TarballResolver = function (_ExoticResolver) {
94683 (0, (_inherits2 || _load_inherits()).default)(TarballResolver, _ExoticResolver);
94684
94685 function TarballResolver(request, fragment) {
94686 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, TarballResolver);
94687
94688 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _ExoticResolver.call(this, request, fragment));
94689
94690 var _versionUtil$explodeH = (_version || _load_version()).explodeHashedUrl(fragment),
94691 hash = _versionUtil$explodeH.hash,
94692 url = _versionUtil$explodeH.url;
94693
94694 _this.hash = hash;
94695 _this.url = url;
94696 return _this;
94697 }
94698
94699 TarballResolver.isVersion = function isVersion(pattern) {
94700 // we can sometimes match git urls which we don't want
94701 if ((_gitResolver || _load_gitResolver()).default.isVersion(pattern)) {
94702 return false;
94703 }
94704
94705 // full http url
94706 if (pattern.startsWith('http://') || pattern.startsWith('https://')) {
94707 return true;
94708 }
94709
94710 // local file reference - ignore patterns with names
94711 if (pattern.indexOf('@') < 0) {
94712 if (pattern.endsWith('.tgz') || pattern.endsWith('.tar.gz')) {
94713 return true;
94714 }
94715 }
94716
94717 return false;
94718 };
94719
94720 TarballResolver.prototype.resolve = function () {
94721 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
94722 var shrunk = this.request.getLocked('tarball');
94723 if (shrunk) {
94724 return shrunk;
94725 }
94726
94727 var url = this.url;
94728 var hash = this.hash,
94729 registry = this.registry;
94730
94731 var pkgJson = void 0;
94732
94733 // generate temp directory
94734 var dest = this.config.getTemp((_crypto || _load_crypto()).hash(url));
94735
94736 if (yield this.config.isValidModuleDest(dest)) {
94737 var _ref2 = yield this.config.readPackageMetadata(dest);
94738 // load from local cache
94739
94740
94741 pkgJson = _ref2.package;
94742 hash = _ref2.hash;
94743 registry = _ref2.registry;
94744 } else {
94745 // delete if invalid
94746 yield (_fs || _load_fs()).unlink(dest);
94747
94748 var fetcher = new (_tarballFetcher || _load_tarballFetcher()).default(dest, {
94749 type: 'tarball',
94750 reference: url,
94751 registry,
94752 hash
94753 }, this.config);
94754
94755 // fetch file and get it's hash
94756 var fetched = yield fetcher.fetch({
94757 name: (0, (_guessName || _load_guessName()).default)(url),
94758 version: '0.0.0',
94759 _registry: 'npm'
94760 });
94761 pkgJson = fetched.package;
94762 hash = fetched.hash;
94763
94764 registry = pkgJson._registry;
94765 invariant(registry, 'expected registry');
94766 }
94767
94768 // use the commit/tarball hash as the uid as we can't rely on the version as it's not
94769 // in the registry
94770 pkgJson._uid = hash;
94771
94772 // set remote so it can be "fetched"
94773 pkgJson._remote = {
94774 type: 'copy',
94775 resolved: `${url}#${hash}`,
94776 hash,
94777 registry,
94778 reference: dest
94779 };
94780
94781 return pkgJson;
94782 });
94783
94784 function resolve() {
94785 return _ref.apply(this, arguments);
94786 }
94787
94788 return resolve;
94789 }();
94790
94791 return TarballResolver;
94792}((_exoticResolver || _load_exoticResolver()).default);
94793
94794exports.default = TarballResolver;
94795
94796/***/ }),
94797/* 531 */
94798/***/ (function(module, exports, __webpack_require__) {
94799
94800"use strict";
94801
94802
94803Object.defineProperty(exports, "__esModule", {
94804 value: true
94805});
94806
94807var _classCallCheck2;
94808
94809function _load_classCallCheck() {
94810 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
94811}
94812
94813var _possibleConstructorReturn2;
94814
94815function _load_possibleConstructorReturn() {
94816 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
94817}
94818
94819var _inherits2;
94820
94821function _load_inherits() {
94822 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
94823}
94824
94825var _baseResolver;
94826
94827function _load_baseResolver() {
94828 return _baseResolver = _interopRequireDefault(__webpack_require__(117));
94829}
94830
94831function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
94832
94833var RegistryResolver = function (_BaseResolver) {
94834 (0, (_inherits2 || _load_inherits()).default)(RegistryResolver, _BaseResolver);
94835
94836 function RegistryResolver(request, name, range) {
94837 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, RegistryResolver);
94838
94839 var _this = (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _BaseResolver.call(this, request, `${name}@${range}`));
94840
94841 _this.name = name;
94842 _this.range = range;
94843
94844 _this.registryConfig = request.config.registries[_this.constructor.registry].config;
94845 return _this;
94846 }
94847
94848 return RegistryResolver;
94849}((_baseResolver || _load_baseResolver()).default);
94850
94851exports.default = RegistryResolver;
94852
94853/***/ }),
94854/* 532 */
94855/***/ (function(module, exports, __webpack_require__) {
94856
94857"use strict";
94858
94859
94860Object.defineProperty(exports, "__esModule", {
94861 value: true
94862});
94863
94864var _classCallCheck2;
94865
94866function _load_classCallCheck() {
94867 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
94868}
94869
94870var _possibleConstructorReturn2;
94871
94872function _load_possibleConstructorReturn() {
94873 return _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(11));
94874}
94875
94876var _inherits2;
94877
94878function _load_inherits() {
94879 return _inherits2 = _interopRequireDefault(__webpack_require__(10));
94880}
94881
94882var _npmResolver;
94883
94884function _load_npmResolver() {
94885 return _npmResolver = _interopRequireDefault(__webpack_require__(204));
94886}
94887
94888function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
94889
94890var YarnResolver = function (_NpmResolver) {
94891 (0, (_inherits2 || _load_inherits()).default)(YarnResolver, _NpmResolver);
94892
94893 function YarnResolver() {
94894 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, YarnResolver);
94895 return (0, (_possibleConstructorReturn2 || _load_possibleConstructorReturn()).default)(this, _NpmResolver.apply(this, arguments));
94896 }
94897
94898 return YarnResolver;
94899}((_npmResolver || _load_npmResolver()).default);
94900
94901exports.default = YarnResolver;
94902
94903/***/ }),
94904/* 533 */
94905/***/ (function(module, exports, __webpack_require__) {
94906
94907"use strict";
94908
94909
94910Object.defineProperty(exports, "__esModule", {
94911 value: true
94912});
94913exports.default = envReplace;
94914var ENV_EXPR = /(\\*)\$\{([^}]+)\}/g;
94915
94916function envReplace(value) {
94917 var env = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : process.env;
94918
94919 if (typeof value !== 'string' || !value) {
94920 return value;
94921 }
94922
94923 return value.replace(ENV_EXPR, function (match, esc, envVarName) {
94924 if (esc.length && esc.length % 2) {
94925 return match;
94926 }
94927 if (undefined === env[envVarName]) {
94928 throw new Error('Failed to replace env in config: ' + match);
94929 }
94930 return env[envVarName] || '';
94931 });
94932}
94933
94934/***/ }),
94935/* 534 */
94936/***/ (function(module, exports, __webpack_require__) {
94937
94938"use strict";
94939
94940
94941Object.defineProperty(exports, "__esModule", {
94942 value: true
94943});
94944exports.fixCmdWinSlashes = fixCmdWinSlashes;
94945function fixCmdWinSlashes(cmd) {
94946 function findQuotes(quoteSymbol) {
94947 var quotes = [];
94948 var addQuote = function addQuote(_, index) {
94949 quotes.push({ from: index, to: index + _.length });
94950 return _;
94951 };
94952 var regEx = new RegExp(quoteSymbol + '.*' + quoteSymbol);
94953 cmd.replace(regEx, addQuote);
94954 return quotes;
94955 }
94956 var quotes = findQuotes('"').concat(findQuotes("'"));
94957
94958 function isInsideQuotes(index) {
94959 return quotes.reduce(function (result, quote) {
94960 return result || quote.from <= index && index <= quote.to;
94961 }, false);
94962 }
94963
94964 var cmdPrePattern = '((?:^|&&|&|\\|\\||\\|)\\s*)';
94965 var cmdPattern = '(".*?"|\'.*?\'|\\S*)';
94966 var regExp = new RegExp(`${cmdPrePattern}${cmdPattern}`, 'g');
94967 return cmd.replace(regExp, function (whole, pre, cmd, index) {
94968 if ((pre[0] === '&' || pre[0] === '|') && isInsideQuotes(index)) {
94969 return whole;
94970 }
94971 return pre + cmd.replace(/\//g, '\\');
94972 });
94973}
94974
94975/***/ }),
94976/* 535 */
94977/***/ (function(module, exports, __webpack_require__) {
94978
94979"use strict";
94980
94981
94982Object.defineProperty(exports, "__esModule", {
94983 value: true
94984});
94985exports.fileDatesEqual = exports.copyFile = exports.unlink = undefined;
94986
94987var _promise;
94988
94989function _load_promise() {
94990 return _promise = _interopRequireDefault(__webpack_require__(7));
94991}
94992
94993var _asyncToGenerator2;
94994
94995function _load_asyncToGenerator() {
94996 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
94997}
94998
94999// We want to preserve file timestamps when copying a file, since yarn uses them to decide if a file has
95000// changed compared to the cache.
95001// There are some OS specific cases here:
95002// * On linux, fs.copyFile does not preserve timestamps, but does on OSX and Win.
95003// * On windows, you must open a file with write permissions to call `fs.futimes`.
95004// * On OSX you can open with read permissions and still call `fs.futimes`.
95005var fixTimes = function () {
95006 var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (fd, dest, data) {
95007 var doOpen = fd === undefined;
95008 var openfd = fd ? fd : -1;
95009
95010 if (disableTimestampCorrection === undefined) {
95011 // if timestamps match already, no correction is needed.
95012 // the need to correct timestamps varies based on OS and node versions.
95013 var destStat = yield lstat(dest);
95014 disableTimestampCorrection = fileDatesEqual(destStat.mtime, data.mtime);
95015 }
95016
95017 if (disableTimestampCorrection) {
95018 return;
95019 }
95020
95021 if (doOpen) {
95022 try {
95023 openfd = yield open(dest, 'a', data.mode);
95024 } catch (er) {
95025 // file is likely read-only
95026 try {
95027 openfd = yield open(dest, 'r', data.mode);
95028 } catch (err) {
95029 // We can't even open this file for reading.
95030 return;
95031 }
95032 }
95033 }
95034
95035 try {
95036 if (openfd) {
95037 yield futimes(openfd, data.atime, data.mtime);
95038 }
95039 } catch (er) {
95040 // If `futimes` throws an exception, we probably have a case of a read-only file on Windows.
95041 // In this case we can just return. The incorrect timestamp will just cause that file to be recopied
95042 // on subsequent installs, which will effect yarn performance but not break anything.
95043 } finally {
95044 if (doOpen && openfd) {
95045 yield close(openfd);
95046 }
95047 }
95048 });
95049
95050 return function fixTimes(_x7, _x8, _x9) {
95051 return _ref3.apply(this, arguments);
95052 };
95053}();
95054
95055// Compare file timestamps.
95056// Some versions of Node on windows zero the milliseconds when utime is used.
95057
95058
95059var _fs;
95060
95061function _load_fs() {
95062 return _fs = _interopRequireDefault(__webpack_require__(12));
95063}
95064
95065var _promise2;
95066
95067function _load_promise2() {
95068 return _promise2 = __webpack_require__(86);
95069}
95070
95071var _fs2;
95072
95073function _load_fs2() {
95074 return _fs2 = __webpack_require__(8);
95075}
95076
95077function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
95078
95079var disableTimestampCorrection = undefined; // OS dependent. will be detected on first file copy.
95080
95081// This module serves as a wrapper for file operations that are inconsistant across node and OS versions.
95082
95083var readFileBuffer = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readFile);
95084var close = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.close);
95085var lstat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.lstat);
95086var open = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.open);
95087var futimes = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.futimes);
95088
95089var write = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.write);
95090
95091var unlink = exports.unlink = (0, (_promise2 || _load_promise2()).promisify)(__webpack_require__(894));
95092
95093/**
95094 * Unlinks the destination to force a recreation. This is needed on case-insensitive file systems
95095 * to force the correct naming when the filename has changed only in character-casing. (Jest -> jest).
95096 */
95097var copyFile = exports.copyFile = function () {
95098 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data, cleanup) {
95099 // $FlowFixMe: Flow doesn't currently support COPYFILE_FICLONE
95100 var ficloneFlag = (_fs2 || _load_fs2()).constants.COPYFILE_FICLONE || 0;
95101 try {
95102 yield unlink(data.dest);
95103 yield copyFilePoly(data.src, data.dest, ficloneFlag, data);
95104 } finally {
95105 if (cleanup) {
95106 cleanup();
95107 }
95108 }
95109 });
95110
95111 return function copyFile(_x, _x2) {
95112 return _ref.apply(this, arguments);
95113 };
95114}();
95115
95116// Node 8.5.0 introduced `fs.copyFile` which is much faster, so use that when available.
95117// Otherwise we fall back to reading and writing files as buffers.
95118var copyFilePoly = function copyFilePoly(src, dest, flags, data) {
95119 if ((_fs || _load_fs()).default.copyFile) {
95120 return new (_promise || _load_promise()).default(function (resolve, reject) {
95121 return (_fs || _load_fs()).default.copyFile(src, dest, flags, function (err) {
95122 if (err) {
95123 reject(err);
95124 } else {
95125 fixTimes(undefined, dest, data).then(function () {
95126 return resolve();
95127 }).catch(function (ex) {
95128 return reject(ex);
95129 });
95130 }
95131 });
95132 });
95133 } else {
95134 return copyWithBuffer(src, dest, flags, data);
95135 }
95136};
95137
95138var copyWithBuffer = function () {
95139 var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest, flags, data) {
95140 // Use open -> write -> futimes -> close sequence to avoid opening the file twice:
95141 // one with writeFile and one with utimes
95142 var fd = yield open(dest, 'w', data.mode);
95143 try {
95144 var _buffer = yield readFileBuffer(src);
95145 yield write(fd, _buffer, 0, _buffer.length);
95146 yield fixTimes(fd, dest, data);
95147 } finally {
95148 yield close(fd);
95149 }
95150 });
95151
95152 return function copyWithBuffer(_x3, _x4, _x5, _x6) {
95153 return _ref2.apply(this, arguments);
95154 };
95155}();var fileDatesEqual = exports.fileDatesEqual = function fileDatesEqual(a, b) {
95156 var aTime = a.getTime();
95157 var bTime = b.getTime();
95158
95159 if (process.platform !== 'win32') {
95160 return aTime === bTime;
95161 }
95162
95163 // See https://github.com/nodejs/node/pull/12607
95164 // Submillisecond times from stat and utimes are truncated on Windows,
95165 // causing a file with mtime 8.0079998 and 8.0081144 to become 8.007 and 8.008
95166 // and making it impossible to update these files to their correct timestamps.
95167 if (Math.abs(aTime - bTime) <= 1) {
95168 return true;
95169 }
95170
95171 var aTimeSec = Math.floor(aTime / 1000);
95172 var bTimeSec = Math.floor(bTime / 1000);
95173
95174 // See https://github.com/nodejs/node/issues/2069
95175 // Some versions of Node on windows zero the milliseconds when utime is used
95176 // So if any of the time has a milliseconds part of zero we suspect that the
95177 // bug is present and compare only seconds.
95178 if (aTime - aTimeSec * 1000 === 0 || bTime - bTimeSec * 1000 === 0) {
95179 return aTimeSec === bTimeSec;
95180 }
95181
95182 return aTime === bTime;
95183};
95184
95185/***/ }),
95186/* 536 */
95187/***/ (function(module, exports, __webpack_require__) {
95188
95189"use strict";
95190
95191
95192Object.defineProperty(exports, "__esModule", {
95193 value: true
95194});
95195exports.generatePnpMap = undefined;
95196
95197var _keys;
95198
95199function _load_keys() {
95200 return _keys = _interopRequireDefault(__webpack_require__(14));
95201}
95202
95203var _set;
95204
95205function _load_set() {
95206 return _set = _interopRequireDefault(__webpack_require__(16));
95207}
95208
95209var _asyncToGenerator2;
95210
95211function _load_asyncToGenerator() {
95212 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
95213}
95214
95215var _from;
95216
95217function _load_from() {
95218 return _from = _interopRequireDefault(__webpack_require__(53));
95219}
95220
95221var _map;
95222
95223function _load_map() {
95224 return _map = _interopRequireDefault(__webpack_require__(42));
95225}
95226
95227var _stringify;
95228
95229function _load_stringify() {
95230 return _stringify = _interopRequireDefault(__webpack_require__(36));
95231}
95232
95233var _getIterator2;
95234
95235function _load_getIterator() {
95236 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
95237}
95238
95239var getPackageInformationStores = function () {
95240 var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, seedPatterns, _ref18) {
95241 var resolver = _ref18.resolver,
95242 reporter = _ref18.reporter,
95243 targetPath = _ref18.targetPath,
95244 workspaceLayout = _ref18.workspaceLayout;
95245
95246 var targetDirectory = path.dirname(targetPath);
95247 var offlineCacheFolder = config.offlineCacheFolder;
95248
95249 var packageInformationStores = new (_map || _load_map()).default();
95250 var blacklistedLocations = new (_set || _load_set()).default();
95251
95252 var getCachePath = function getCachePath(fsPath) {
95253 var cacheRelativePath = normalizePath(path.relative(config.cacheFolder, fsPath));
95254
95255 // if fsPath is not inside cacheRelativePath, we just skip it
95256 if (cacheRelativePath.match(/^\.\.\//)) {
95257 return null;
95258 }
95259
95260 return cacheRelativePath;
95261 };
95262
95263 var resolveOfflineCacheFolder = function resolveOfflineCacheFolder(fsPath) {
95264 if (!offlineCacheFolder) {
95265 return fsPath;
95266 }
95267
95268 var cacheRelativePath = getCachePath(fsPath);
95269
95270 // if fsPath is not inside the cache, we shouldn't replace it (workspace)
95271 if (!cacheRelativePath) {
95272 return fsPath;
95273 }
95274
95275 var components = cacheRelativePath.split(/\//g);
95276 var cacheEntry = components[0],
95277 internalPath = components.slice(1);
95278
95279
95280 return path.resolve(offlineCacheFolder, `${cacheEntry}${OFFLINE_CACHE_EXTENSION}`, internalPath.join('/'));
95281 };
95282
95283 var normalizePath = function normalizePath(fsPath) {
95284 return process.platform === 'win32' ? fsPath.replace(backwardSlashRegExp, '/') : fsPath;
95285 };
95286
95287 var normalizeDirectoryPath = function normalizeDirectoryPath(fsPath) {
95288 var relativePath = normalizePath(path.relative(targetDirectory, resolveOfflineCacheFolder(fsPath)));
95289
95290 if (!relativePath.match(/^\.{0,2}\//) && !path.isAbsolute(relativePath)) {
95291 relativePath = `./${relativePath}`;
95292 }
95293
95294 return relativePath.replace(/\/?$/, '/');
95295 };
95296
95297 var getHashFrom = function getHashFrom(data) {
95298 var hashGenerator = crypto.createHash('sha1');
95299
95300 for (var _iterator10 = data, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator10);;) {
95301 var _ref19;
95302
95303 if (_isArray10) {
95304 if (_i10 >= _iterator10.length) break;
95305 _ref19 = _iterator10[_i10++];
95306 } else {
95307 _i10 = _iterator10.next();
95308 if (_i10.done) break;
95309 _ref19 = _i10.value;
95310 }
95311
95312 var datum = _ref19;
95313
95314 hashGenerator.update(datum);
95315 }
95316
95317 return hashGenerator.digest('hex');
95318 };
95319
95320 var getResolverEntry = function getResolverEntry(pattern) {
95321 var pkg = resolver.getStrictResolvedPattern(pattern);
95322 var ref = pkg._reference;
95323
95324 if (!ref) {
95325 return null;
95326 }
95327
95328 invariant(ref.locations.length <= 1, 'Must have at most one location (usually in the cache)');
95329 var loc = ref.locations[0];
95330
95331 if (!loc) {
95332 return null;
95333 }
95334
95335 return { pkg, ref, loc };
95336 };
95337
95338 var visit = function () {
95339 var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (precomputedResolutions, seedPatterns) {
95340 var parentData = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
95341
95342 var resolutions = new (_map || _load_map()).default(precomputedResolutions);
95343 var locations = new (_map || _load_map()).default();
95344
95345 // This first pass will compute the package reference of each of the given patterns
95346 // They will usually be the package version, but not always. We need to do this in a pre-process pass, because the
95347 // dependencies might depend on one another, so if we need to replace one of them, we need to compute it first
95348
95349 var _loop = function* _loop(pattern) {
95350 var entry = getResolverEntry(pattern);
95351
95352 if (!entry) {
95353 return 'continue';
95354 }
95355
95356 var pkg = entry.pkg,
95357 ref = entry.ref;
95358 var loc = entry.loc;
95359
95360
95361 var packageName = pkg.name;
95362 var packageReference = pkg.version;
95363
95364 // If we have peer dependencies, then we generate a new virtual reference based on the parent one
95365 // We cannot generate this reference based on what those peer references resolve to, because they might not have
95366 // been computed yet (for example, consider the case where A has a peer dependency on B, and B a peer dependency
95367 // on A; it's valid, but it prevents us from computing A and B - and it's even worse with 3+ packages involved)
95368 var peerDependencies = new (_set || _load_set()).default((0, (_from || _load_from()).default)((0, (_keys || _load_keys()).default)(pkg.peerDependencies || {})));
95369
95370 // As an optimization, we only setup virtual packages if their underlying packages are referenced multiple times
95371 // in the tree. This allow us to avoid having to create symlinks in the majority of cases
95372 if (peerDependencies.size > 0 && ref.requests.length > 1) {
95373 var hash = getHashFrom([].concat(parentData, [packageName, packageReference]));
95374
95375 var symlinkSource = void 0;
95376 var symlinkFile = void 0;
95377
95378 switch (ref.remote.type) {
95379 case 'workspace':
95380 {
95381 symlinkSource = loc;
95382 symlinkFile = path.resolve(config.lockfileFolder, '.pnp', 'workspaces', `pnp-${hash}`, packageName);
95383
95384 loc = symlinkFile;
95385 }
95386 break;
95387
95388 default:
95389 {
95390 var isFromCache = getCachePath(loc);
95391
95392 var hashName = isFromCache && offlineCacheFolder ? `pnp-${hash}${OFFLINE_CACHE_EXTENSION}` : `pnp-${hash}`;
95393 var newLoc = path.resolve(config.lockfileFolder, '.pnp', 'externals', hashName, 'node_modules', packageName);
95394
95395 // The `node_modules/<pkgName>` part is already there when the package comes from the cache
95396 if (isFromCache) {
95397 var getBase = function getBase(source) {
95398 return path.resolve(source, '../'.repeat(1 + packageName.split('/').length));
95399 };
95400 symlinkSource = resolveOfflineCacheFolder(getBase(loc));
95401 symlinkFile = getBase(newLoc);
95402 } else {
95403 symlinkSource = loc;
95404 symlinkFile = newLoc;
95405 }
95406
95407 loc = newLoc;
95408 }
95409 break;
95410 }
95411
95412 yield (_fs || _load_fs()).mkdirp(path.dirname(symlinkFile));
95413 yield (_fs || _load_fs()).symlink(symlinkSource, symlinkFile);
95414
95415 packageReference = `pnp:${hash}`;
95416
95417 // We blacklist this path so that we can print a nicer error message if someone tries to require it (it usually
95418 // means that they're using realpath on the return value of require.resolve)
95419 blacklistedLocations.add(normalizeDirectoryPath(loc));
95420 }
95421
95422 // Now that we have the final reference, we need to store it
95423 resolutions.set(packageName, packageReference);
95424 locations.set(packageName, loc);
95425 };
95426
95427 for (var _iterator11 = seedPatterns, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator11);;) {
95428 var _ref21;
95429
95430 if (_isArray11) {
95431 if (_i11 >= _iterator11.length) break;
95432 _ref21 = _iterator11[_i11++];
95433 } else {
95434 _i11 = _iterator11.next();
95435 if (_i11.done) break;
95436 _ref21 = _i11.value;
95437 }
95438
95439 var pattern = _ref21;
95440
95441 var _ret = yield* _loop(pattern);
95442
95443 if (_ret === 'continue') continue;
95444 }
95445
95446 // Now that we have the final references, we can start the main loop, which will insert the packages into the store
95447 // if they aren't already there, and recurse over their own children
95448
95449 var _loop2 = function* _loop2(pattern) {
95450 var entry = getResolverEntry(pattern);
95451
95452 if (!entry) {
95453 return 'continue';
95454 }
95455
95456 var pkg = entry.pkg,
95457 ref = entry.ref;
95458
95459
95460 var packageName = pkg.name;
95461
95462 var packageReference = resolutions.get(packageName);
95463 invariant(packageReference, `Package reference should have been computed during the pre-pass`);
95464
95465 var loc = locations.get(packageName);
95466 invariant(loc, `Package location should have been computed during the pre-pass`);
95467
95468 // We can early exit if the package is already registered with the exact same name and reference, since even if
95469 // we might get slightly different dependencies (depending on how things were optimized), both sets are valid
95470 var packageInformationStore = packageInformationStores.get(packageName);
95471
95472 if (!packageInformationStore) {
95473 packageInformationStore = new (_map || _load_map()).default();
95474 packageInformationStores.set(packageName, packageInformationStore);
95475 }
95476
95477 var packageInformation = packageInformationStore.get(packageReference);
95478
95479 if (packageInformation) {
95480 return 'continue';
95481 }
95482
95483 packageInformation = {
95484 packageLocation: normalizeDirectoryPath(loc),
95485 packageDependencies: new (_map || _load_map()).default()
95486 };
95487
95488 // Split the dependencies between direct/peer - we will only recurse on the former
95489 var peerDependencies = new (_set || _load_set()).default((0, (_from || _load_from()).default)((0, (_keys || _load_keys()).default)(pkg.peerDependencies || {})));
95490 var directDependencies = ref.dependencies.filter(function (pattern) {
95491 var pkg = resolver.getStrictResolvedPattern(pattern);
95492 return !pkg || !peerDependencies.has(pkg.name);
95493 });
95494
95495 // We inject the partial information in the store right now so that we won't cycle indefinitely
95496 packageInformationStore.set(packageReference, packageInformation);
95497
95498 // We must inject the peer dependencies before iterating; one of our dependencies might have a peer dependency
95499 // on one of our peer dependencies, so it must be available from the start (we don't have to do that for direct
95500 // dependencies, because the "visit" function that will iterate over them will automatically add the to the
95501 // candidate resolutions as part of the first step, cf above)
95502
95503 for (var _iterator13 = peerDependencies, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator13);;) {
95504 var _ref23;
95505
95506 if (_isArray13) {
95507 if (_i13 >= _iterator13.length) break;
95508 _ref23 = _iterator13[_i13++];
95509 } else {
95510 _i13 = _iterator13.next();
95511 if (_i13.done) break;
95512 _ref23 = _i13.value;
95513 }
95514
95515 var dependencyName = _ref23;
95516
95517 var dependencyReference = resolutions.get(dependencyName);
95518
95519 if (dependencyReference) {
95520 packageInformation.packageDependencies.set(dependencyName, dependencyReference);
95521 }
95522 }
95523
95524 var childResolutions = yield visit(packageInformation.packageDependencies, directDependencies, [packageName, packageReference]);
95525
95526 // We can now inject into our package the resolutions we got from the visit function
95527 for (var _iterator14 = childResolutions.entries(), _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator14);;) {
95528 var _ref25;
95529
95530 if (_isArray14) {
95531 if (_i14 >= _iterator14.length) break;
95532 _ref25 = _iterator14[_i14++];
95533 } else {
95534 _i14 = _iterator14.next();
95535 if (_i14.done) break;
95536 _ref25 = _i14.value;
95537 }
95538
95539 var _ref24 = _ref25;
95540 var name = _ref24[0];
95541 var reference = _ref24[1];
95542
95543 packageInformation.packageDependencies.set(name, reference);
95544 }
95545
95546 // Finally, unless a package depends on a previous version of itself (that would be weird but correct...), we
95547 // inject them an implicit dependency to themselves (so that they can require themselves)
95548 if (!packageInformation.packageDependencies.has(packageName)) {
95549 packageInformation.packageDependencies.set(packageName, packageReference);
95550 }
95551 };
95552
95553 for (var _iterator12 = seedPatterns, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator12);;) {
95554 var _ref22;
95555
95556 if (_isArray12) {
95557 if (_i12 >= _iterator12.length) break;
95558 _ref22 = _iterator12[_i12++];
95559 } else {
95560 _i12 = _iterator12.next();
95561 if (_i12.done) break;
95562 _ref22 = _i12.value;
95563 }
95564
95565 var pattern = _ref22;
95566
95567 var _ret2 = yield* _loop2(pattern);
95568
95569 if (_ret2 === 'continue') continue;
95570 }
95571
95572 return resolutions;
95573 });
95574
95575 return function visit(_x4, _x5) {
95576 return _ref20.apply(this, arguments);
95577 };
95578 }();
95579
95580 // If we have workspaces, we need to iterate over them all in order to add them to the map
95581 // This is because they might not be declared as dependencies of the top-level project (and with reason, since the
95582 // top-level package might depend on a different than the one provided in the workspaces - cf Babel, which depends
95583 // on an old version of itself in order to compile itself)
95584 if (workspaceLayout) {
95585 for (var _iterator15 = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator15);;) {
95586 var _ref27;
95587
95588 if (_isArray15) {
95589 if (_i15 >= _iterator15.length) break;
95590 _ref27 = _iterator15[_i15++];
95591 } else {
95592 _i15 = _iterator15.next();
95593 if (_i15.done) break;
95594 _ref27 = _i15.value;
95595 }
95596
95597 var name = _ref27;
95598
95599 var pkg = workspaceLayout.workspaces[name].manifest;
95600
95601 // Skip the aggregator, since it's essentially a duplicate of the top-level package that we'll iterate later on
95602 if (pkg.workspaces) {
95603 continue;
95604 }
95605
95606 var _ref26 = pkg._reference;
95607 invariant(_ref26, `Workspaces should have a reference`);
95608
95609 invariant(_ref26.locations.length === 1, `Workspaces should have exactly one location`);
95610 var _loc = _ref26.locations[0];
95611 invariant(_loc, `Workspaces should have a location`);
95612
95613 var _packageInformationStore2 = packageInformationStores.get(name);
95614
95615 if (!_packageInformationStore2) {
95616 _packageInformationStore2 = new (_map || _load_map()).default();
95617 packageInformationStores.set(name, _packageInformationStore2);
95618 }
95619
95620 _packageInformationStore2.set(pkg.version, {
95621 packageLocation: normalizeDirectoryPath(_loc),
95622 packageDependencies: yield visit(new (_map || _load_map()).default(), _ref26.dependencies, [name, pkg.version])
95623 });
95624 }
95625 }
95626
95627 // Register the top-level package in our map
95628 // This will recurse on each of its dependencies as well.
95629 packageInformationStores.set(null, new (_map || _load_map()).default([[null, {
95630 packageLocation: normalizeDirectoryPath(config.lockfileFolder),
95631 packageDependencies: yield visit(new (_map || _load_map()).default(), seedPatterns)
95632 }]]));
95633
95634 return [packageInformationStores, blacklistedLocations];
95635 });
95636
95637 return function getPackageInformationStores(_x, _x2, _x3) {
95638 return _ref17.apply(this, arguments);
95639 };
95640}();
95641
95642var generatePnpMap = exports.generatePnpMap = function () {
95643 var _ref28 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, seedPatterns, _ref29) {
95644 var resolver = _ref29.resolver,
95645 reporter = _ref29.reporter,
95646 workspaceLayout = _ref29.workspaceLayout,
95647 targetPath = _ref29.targetPath;
95648
95649 var _ref30 = yield getPackageInformationStores(config, seedPatterns, {
95650 resolver,
95651 reporter,
95652 targetPath,
95653 workspaceLayout
95654 }),
95655 packageInformationStores = _ref30[0],
95656 blacklistedLocations = _ref30[1];
95657
95658 var setupStaticTables = [generateMaps(packageInformationStores, blacklistedLocations), generateFindPackageLocator(packageInformationStores)].join(``);
95659
95660 return pnpApi.replace(/\$\$SHEBANG/g, config.plugnplayShebang).replace(/\$\$BLACKLIST/g, (0, (_stringify || _load_stringify()).default)(config.plugnplayBlacklist)).replace(/\$\$SETUP_STATIC_TABLES\(\);/g, setupStaticTables);
95661 });
95662
95663 return function generatePnpMap(_x7, _x8, _x9) {
95664 return _ref28.apply(this, arguments);
95665 };
95666}();
95667
95668var _fs;
95669
95670function _load_fs() {
95671 return _fs = _interopRequireWildcard(__webpack_require__(8));
95672}
95673
95674function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
95675
95676function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
95677
95678/* babel-plugin-inline-import './generate-pnp-map-api.tpl.js' */var pnpApi = '#!$$SHEBANG\n\n/* eslint-disable max-len, flowtype/require-valid-file-annotation, flowtype/require-return-type */\n/* global packageInformationStores, $$BLACKLIST, $$SETUP_STATIC_TABLES */\n\n// Used for the resolveUnqualified part of the resolution (ie resolving folder/index.js & file extensions)\n// Deconstructed so that they aren\'t affected by any fs monkeypatching occuring later during the execution\nconst {statSync, lstatSync, readlinkSync, readFileSync, existsSync, realpathSync} = require(\'fs\');\n\nconst Module = require(\'module\');\nconst path = require(\'path\');\nconst StringDecoder = require(\'string_decoder\');\n\nconst ignorePattern = $$BLACKLIST ? new RegExp($$BLACKLIST) : null;\n\nconst pnpFile = path.resolve(__dirname, __filename);\nconst builtinModules = new Set(Module.builtinModules || Object.keys(process.binding(\'natives\')));\n\nconst topLevelLocator = {name: null, reference: null};\nconst blacklistedLocator = {name: NaN, reference: NaN};\n\n// Used for compatibility purposes - cf setupCompatibilityLayer\nconst patchedModules = [];\nconst fallbackLocators = [topLevelLocator];\n\n// Matches backslashes of Windows paths\nconst backwardSlashRegExp = /\\\\/g;\n\n// Matches if the path must point to a directory (ie ends with /)\nconst isDirRegExp = /\\/$/;\n\n// Matches if the path starts with a valid path qualifier (./, ../, /)\n// eslint-disable-next-line no-unused-vars\nconst isStrictRegExp = /^\\.{0,2}\\//;\n\n// Splits a require request into its components, or return null if the request is a file path\nconst pathRegExp = /^(?![a-zA-Z]:[\\\\\\/]|\\\\\\\\|\\.{0,2}(?:\\/|$))((?:@[^\\/]+\\/)?[^\\/]+)\\/?(.*|)$/;\n\n// Keep a reference around ("module" is a common name in this context, so better rename it to something more significant)\nconst pnpModule = module;\n\n/**\n * Used to disable the resolution hooks (for when we want to fallback to the previous resolution - we then need\n * a way to "reset" the environment temporarily)\n */\n\nlet enableNativeHooks = true;\n\n/**\n * Simple helper function that assign an error code to an error, so that it can more easily be caught and used\n * by third-parties.\n */\n\nfunction makeError(code, message, data = {}) {\n const error = new Error(message);\n return Object.assign(error, {code, data});\n}\n\n/**\n * Ensures that the returned locator isn\'t a blacklisted one.\n *\n * Blacklisted packages are packages that cannot be used because their dependencies cannot be deduced. This only\n * happens with peer dependencies, which effectively have different sets of dependencies depending on their parents.\n *\n * In order to deambiguate those different sets of dependencies, the Yarn implementation of PnP will generate a\n * symlink for each combination of <package name>/<package version>/<dependent package> it will find, and will\n * blacklist the target of those symlinks. By doing this, we ensure that files loaded through a specific path\n * will always have the same set of dependencies, provided the symlinks are correctly preserved.\n *\n * Unfortunately, some tools do not preserve them, and when it happens PnP isn\'t able anymore to deduce the set of\n * dependencies based on the path of the file that makes the require calls. But since we\'ve blacklisted those paths,\n * we\'re able to print a more helpful error message that points out that a third-party package is doing something\n * incompatible!\n */\n\n// eslint-disable-next-line no-unused-vars\nfunction blacklistCheck(locator) {\n if (locator === blacklistedLocator) {\n throw makeError(\n `BLACKLISTED`,\n [\n `A package has been resolved through a blacklisted path - this is usually caused by one of your tools calling`,\n `"realpath" on the return value of "require.resolve". Since the returned values use symlinks to disambiguate`,\n `peer dependencies, they must be passed untransformed to "require".`,\n ].join(` `)\n );\n }\n\n return locator;\n}\n\n$$SETUP_STATIC_TABLES();\n\n/**\n * Returns the module that should be used to resolve require calls. It\'s usually the direct parent, except if we\'re\n * inside an eval expression.\n */\n\nfunction getIssuerModule(parent) {\n let issuer = parent;\n\n while (issuer && (issuer.id === \'[eval]\' || issuer.id === \'<repl>\' || !issuer.filename)) {\n issuer = issuer.parent;\n }\n\n return issuer;\n}\n\n/**\n * Returns information about a package in a safe way (will throw if they cannot be retrieved)\n */\n\nfunction getPackageInformationSafe(packageLocator) {\n const packageInformation = exports.getPackageInformation(packageLocator);\n\n if (!packageInformation) {\n throw makeError(\n `INTERNAL`,\n `Couldn\'t find a matching entry in the dependency tree for the specified parent (this is probably an internal error)`\n );\n }\n\n return packageInformation;\n}\n\n/**\n * Implements the node resolution for folder access and extension selection\n */\n\nfunction applyNodeExtensionResolution(unqualifiedPath, {extensions}) {\n // We use this "infinite while" so that we can restart the process as long as we hit package folders\n while (true) {\n let stat;\n\n try {\n stat = statSync(unqualifiedPath);\n } catch (error) {}\n\n // If the file exists and is a file, we can stop right there\n\n if (stat && !stat.isDirectory()) {\n // If the very last component of the resolved path is a symlink to a file, we then resolve it to a file. We only\n // do this first the last component, and not the rest of the path! This allows us to support the case of bin\n // symlinks, where a symlink in "/xyz/pkg-name/.bin/bin-name" will point somewhere else (like "/xyz/pkg-name/index.js").\n // In such a case, we want relative requires to be resolved relative to "/xyz/pkg-name/" rather than "/xyz/pkg-name/.bin/".\n //\n // Also note that the reason we must use readlink on the last component (instead of realpath on the whole path)\n // is that we must preserve the other symlinks, in particular those used by pnp to deambiguate packages using\n // peer dependencies. For example, "/xyz/.pnp/local/pnp-01234569/.bin/bin-name" should see its relative requires\n // be resolved relative to "/xyz/.pnp/local/pnp-0123456789/" rather than "/xyz/pkg-with-peers/", because otherwise\n // we would lose the information that would tell us what are the dependencies of pkg-with-peers relative to its\n // ancestors.\n\n if (lstatSync(unqualifiedPath).isSymbolicLink()) {\n unqualifiedPath = path.normalize(path.resolve(path.dirname(unqualifiedPath), readlinkSync(unqualifiedPath)));\n }\n\n return unqualifiedPath;\n }\n\n // If the file is a directory, we must check if it contains a package.json with a "main" entry\n\n if (stat && stat.isDirectory()) {\n let pkgJson;\n\n try {\n pkgJson = JSON.parse(readFileSync(`${unqualifiedPath}/package.json`, \'utf-8\'));\n } catch (error) {}\n\n let nextUnqualifiedPath;\n\n if (pkgJson && pkgJson.main) {\n nextUnqualifiedPath = path.resolve(unqualifiedPath, pkgJson.main);\n }\n\n // If the "main" field changed the path, we start again from this new location\n\n if (nextUnqualifiedPath && nextUnqualifiedPath !== unqualifiedPath) {\n const resolution = applyNodeExtensionResolution(nextUnqualifiedPath, {extensions});\n\n if (resolution !== null) {\n return resolution;\n }\n }\n }\n\n // Otherwise we check if we find a file that match one of the supported extensions\n\n const qualifiedPath = extensions\n .map(extension => {\n return `${unqualifiedPath}${extension}`;\n })\n .find(candidateFile => {\n return existsSync(candidateFile);\n });\n\n if (qualifiedPath) {\n return qualifiedPath;\n }\n\n // Otherwise, we check if the path is a folder - in such a case, we try to use its index\n\n if (stat && stat.isDirectory()) {\n const indexPath = extensions\n .map(extension => {\n return `${unqualifiedPath}/index${extension}`;\n })\n .find(candidateFile => {\n return existsSync(candidateFile);\n });\n\n if (indexPath) {\n return indexPath;\n }\n }\n\n // Otherwise there\'s nothing else we can do :(\n\n return null;\n }\n}\n\n/**\n * This function creates fake modules that can be used with the _resolveFilename function.\n * Ideally it would be nice to be able to avoid this, since it causes useless allocations\n * and cannot be cached efficiently (we recompute the nodeModulePaths every time).\n *\n * Fortunately, this should only affect the fallback, and there hopefully shouldn\'t be a\n * lot of them.\n */\n\nfunction makeFakeModule(path) {\n const fakeModule = new Module(path, false);\n fakeModule.filename = path;\n fakeModule.paths = Module._nodeModulePaths(path);\n return fakeModule;\n}\n\n/**\n * Normalize path to posix format.\n */\n\nfunction normalizePath(fsPath) {\n fsPath = path.normalize(fsPath);\n\n if (process.platform === \'win32\') {\n fsPath = fsPath.replace(backwardSlashRegExp, \'/\');\n }\n\n return fsPath;\n}\n\n/**\n * Forward the resolution to the next resolver (usually the native one)\n */\n\nfunction callNativeResolution(request, issuer) {\n if (issuer.endsWith(\'/\')) {\n issuer += \'internal.js\';\n }\n\n try {\n enableNativeHooks = false;\n\n // Since we would need to create a fake module anyway (to call _resolveLookupPath that\n // would give us the paths to give to _resolveFilename), we can as well not use\n // the {paths} option at all, since it internally makes _resolveFilename create another\n // fake module anyway.\n return Module._resolveFilename(request, makeFakeModule(issuer), false);\n } finally {\n enableNativeHooks = true;\n }\n}\n\n/**\n * This key indicates which version of the standard is implemented by this resolver. The `std` key is the\n * Plug\'n\'Play standard, and any other key are third-party extensions. Third-party extensions are not allowed\n * to override the standard, and can only offer new methods.\n *\n * If an new version of the Plug\'n\'Play standard is released and some extensions conflict with newly added\n * functions, they\'ll just have to fix the conflicts and bump their own version number.\n */\n\nexports.VERSIONS = {std: 1};\n\n/**\n * Useful when used together with getPackageInformation to fetch information about the top-level package.\n */\n\nexports.topLevel = {name: null, reference: null};\n\n/**\n * Gets the package information for a given locator. Returns null if they cannot be retrieved.\n */\n\nexports.getPackageInformation = function getPackageInformation({name, reference}) {\n const packageInformationStore = packageInformationStores.get(name);\n\n if (!packageInformationStore) {\n return null;\n }\n\n const packageInformation = packageInformationStore.get(reference);\n\n if (!packageInformation) {\n return null;\n }\n\n return packageInformation;\n};\n\n/**\n * Transforms a request (what\'s typically passed as argument to the require function) into an unqualified path.\n * This path is called "unqualified" because it only changes the package name to the package location on the disk,\n * which means that the end result still cannot be directly accessed (for example, it doesn\'t try to resolve the\n * file extension, or to resolve directories to their "index.js" content). Use the "resolveUnqualified" function\n * to convert them to fully-qualified paths, or just use "resolveRequest" that do both operations in one go.\n *\n * Note that it is extremely important that the `issuer` path ends with a forward slash if the issuer is to be\n * treated as a folder (ie. "/tmp/foo/" rather than "/tmp/foo" if "foo" is a directory). Otherwise relative\n * imports won\'t be computed correctly (they\'ll get resolved relative to "/tmp/" instead of "/tmp/foo/").\n */\n\nexports.resolveToUnqualified = function resolveToUnqualified(request, issuer, {considerBuiltins = true} = {}) {\n // The \'pnpapi\' request is reserved and will always return the path to the PnP file, from everywhere\n\n if (request === `pnpapi`) {\n return pnpFile;\n }\n\n // Bailout if the request is a native module\n\n if (considerBuiltins && builtinModules.has(request)) {\n return null;\n }\n\n // We allow disabling the pnp resolution for some subpaths. This is because some projects, often legacy,\n // contain multiple levels of dependencies (ie. a yarn.lock inside a subfolder of a yarn.lock). This is\n // typically solved using workspaces, but not all of them have been converted already.\n\n if (ignorePattern && ignorePattern.test(normalizePath(issuer))) {\n const result = callNativeResolution(request, issuer);\n\n if (result === false) {\n throw makeError(\n `BUILTIN_NODE_RESOLUTION_FAIL`,\n `The builtin node resolution algorithm was unable to resolve the module referenced by "${request}" and requested from "${issuer}" (it didn\'t go through the pnp resolver because the issuer was explicitely ignored by the regexp "$$BLACKLIST")`,\n {\n request,\n issuer,\n }\n );\n }\n\n return result;\n }\n\n let unqualifiedPath;\n\n // If the request is a relative or absolute path, we just return it normalized\n\n const dependencyNameMatch = request.match(pathRegExp);\n\n if (!dependencyNameMatch) {\n if (path.isAbsolute(request)) {\n unqualifiedPath = path.normalize(request);\n } else if (issuer.match(isDirRegExp)) {\n unqualifiedPath = path.normalize(path.resolve(issuer, request));\n } else {\n unqualifiedPath = path.normalize(path.resolve(path.dirname(issuer), request));\n }\n }\n\n // Things are more hairy if it\'s a package require - we then need to figure out which package is needed, and in\n // particular the exact version for the given location on the dependency tree\n\n if (dependencyNameMatch) {\n const [, dependencyName, subPath] = dependencyNameMatch;\n\n const issuerLocator = exports.findPackageLocator(issuer);\n\n // If the issuer file doesn\'t seem to be owned by a package managed through pnp, then we resort to using the next\n // resolution algorithm in the chain, usually the native Node resolution one\n\n if (!issuerLocator) {\n const result = callNativeResolution(request, issuer);\n\n if (result === false) {\n throw makeError(\n `BUILTIN_NODE_RESOLUTION_FAIL`,\n `The builtin node resolution algorithm was unable to resolve the module referenced by "${request}" and requested from "${issuer}" (it didn\'t go through the pnp resolver because the issuer doesn\'t seem to be part of the Yarn-managed dependency tree)`,\n {\n request,\n issuer,\n }\n );\n }\n\n return result;\n }\n\n const issuerInformation = getPackageInformationSafe(issuerLocator);\n\n // We obtain the dependency reference in regard to the package that request it\n\n let dependencyReference = issuerInformation.packageDependencies.get(dependencyName);\n\n // If we can\'t find it, we check if we can potentially load it from the packages that have been defined as potential fallbacks.\n // It\'s a bit of a hack, but it improves compatibility with the existing Node ecosystem. Hopefully we should eventually be able\n // to kill this logic and become stricter once pnp gets enough traction and the affected packages fix themselves.\n\n if (issuerLocator !== topLevelLocator) {\n for (let t = 0, T = fallbackLocators.length; dependencyReference === undefined && t < T; ++t) {\n const fallbackInformation = getPackageInformationSafe(fallbackLocators[t]);\n dependencyReference = fallbackInformation.packageDependencies.get(dependencyName);\n }\n }\n\n // If we can\'t find the path, and if the package making the request is the top-level, we can offer nicer error messages\n\n if (!dependencyReference) {\n if (dependencyReference === null) {\n if (issuerLocator === topLevelLocator) {\n throw makeError(\n `MISSING_PEER_DEPENDENCY`,\n `You seem to be requiring a peer dependency ("${dependencyName}"), but it is not installed (which might be because you\'re the top-level package)`,\n {request, issuer, dependencyName}\n );\n } else {\n throw makeError(\n `MISSING_PEER_DEPENDENCY`,\n `Package "${issuerLocator.name}@${issuerLocator.reference}" is trying to access a peer dependency ("${dependencyName}") that should be provided by its direct ancestor but isn\'t`,\n {request, issuer, issuerLocator: Object.assign({}, issuerLocator), dependencyName}\n );\n }\n } else {\n if (issuerLocator === topLevelLocator) {\n throw makeError(\n `UNDECLARED_DEPENDENCY`,\n `You cannot require a package ("${dependencyName}") that is not declared in your dependencies (via "${issuer}")`,\n {request, issuer, dependencyName}\n );\n } else {\n const candidates = Array.from(issuerInformation.packageDependencies.keys());\n throw makeError(\n `UNDECLARED_DEPENDENCY`,\n `Package "${issuerLocator.name}@${issuerLocator.reference}" (via "${issuer}") is trying to require the package "${dependencyName}" (via "${request}") without it being listed in its dependencies (${candidates.join(\n `, `\n )})`,\n {request, issuer, issuerLocator: Object.assign({}, issuerLocator), dependencyName, candidates}\n );\n }\n }\n }\n\n // We need to check that the package exists on the filesystem, because it might not have been installed\n\n const dependencyLocator = {name: dependencyName, reference: dependencyReference};\n const dependencyInformation = exports.getPackageInformation(dependencyLocator);\n const dependencyLocation = path.resolve(__dirname, dependencyInformation.packageLocation);\n\n if (!dependencyLocation) {\n throw makeError(\n `MISSING_DEPENDENCY`,\n `Package "${dependencyLocator.name}@${dependencyLocator.reference}" is a valid dependency, but hasn\'t been installed and thus cannot be required (it might be caused if you install a partial tree, such as on production environments)`,\n {request, issuer, dependencyLocator: Object.assign({}, dependencyLocator)}\n );\n }\n\n // Now that we know which package we should resolve to, we only have to find out the file location\n\n if (subPath) {\n unqualifiedPath = path.resolve(dependencyLocation, subPath);\n } else {\n unqualifiedPath = dependencyLocation;\n }\n }\n\n return path.normalize(unqualifiedPath);\n};\n\n/**\n * Transforms an unqualified path into a qualified path by using the Node resolution algorithm (which automatically\n * appends ".js" / ".json", and transforms directory accesses into "index.js").\n */\n\nexports.resolveUnqualified = function resolveUnqualified(\n unqualifiedPath,\n {extensions = Object.keys(Module._extensions)} = {}\n) {\n const qualifiedPath = applyNodeExtensionResolution(unqualifiedPath, {extensions});\n\n if (qualifiedPath) {\n return path.normalize(qualifiedPath);\n } else {\n throw makeError(\n `QUALIFIED_PATH_RESOLUTION_FAILED`,\n `Couldn\'t find a suitable Node resolution for unqualified path "${unqualifiedPath}"`,\n {unqualifiedPath}\n );\n }\n};\n\n/**\n * Transforms a request into a fully qualified path.\n *\n * Note that it is extremely important that the `issuer` path ends with a forward slash if the issuer is to be\n * treated as a folder (ie. "/tmp/foo/" rather than "/tmp/foo" if "foo" is a directory). Otherwise relative\n * imports won\'t be computed correctly (they\'ll get resolved relative to "/tmp/" instead of "/tmp/foo/").\n */\n\nexports.resolveRequest = function resolveRequest(request, issuer, {considerBuiltins, extensions} = {}) {\n let unqualifiedPath;\n\n try {\n unqualifiedPath = exports.resolveToUnqualified(request, issuer, {considerBuiltins});\n } catch (originalError) {\n // If we get a BUILTIN_NODE_RESOLUTION_FAIL error there, it means that we\'ve had to use the builtin node\n // resolution, which usually shouldn\'t happen. It might be because the user is trying to require something\n // from a path loaded through a symlink (which is not possible, because we need something normalized to\n // figure out which package is making the require call), so we try to make the same request using a fully\n // resolved issuer and throws a better and more actionable error if it works.\n if (originalError.code === `BUILTIN_NODE_RESOLUTION_FAIL`) {\n let realIssuer;\n\n try {\n realIssuer = realpathSync(issuer);\n } catch (error) {}\n\n if (realIssuer) {\n if (issuer.endsWith(`/`)) {\n realIssuer = realIssuer.replace(/\\/?$/, `/`);\n }\n\n try {\n exports.resolveToUnqualified(request, realIssuer, {considerBuiltins});\n } catch (error) {\n // If an error was thrown, the problem doesn\'t seem to come from a path not being normalized, so we\n // can just throw the original error which was legit.\n throw originalError;\n }\n\n // If we reach this stage, it means that resolveToUnqualified didn\'t fail when using the fully resolved\n // file path, which is very likely caused by a module being invoked through Node with a path not being\n // correctly normalized (ie you should use "node $(realpath script.js)" instead of "node script.js").\n throw makeError(\n `SYMLINKED_PATH_DETECTED`,\n `A pnp module ("${request}") has been required from what seems to be a symlinked path ("${issuer}"). This is not possible, you must ensure that your modules are invoked through their fully resolved path on the filesystem (in this case "${realIssuer}").`,\n {\n request,\n issuer,\n realIssuer,\n }\n );\n }\n }\n throw originalError;\n }\n\n if (unqualifiedPath === null) {\n return null;\n }\n\n try {\n return exports.resolveUnqualified(unqualifiedPath, {extensions});\n } catch (resolutionError) {\n if (resolutionError.code === \'QUALIFIED_PATH_RESOLUTION_FAILED\') {\n Object.assign(resolutionError.data, {request, issuer});\n }\n throw resolutionError;\n }\n};\n\n/**\n * Setups the hook into the Node environment.\n *\n * From this point on, any call to `require()` will go through the "resolveRequest" function, and the result will\n * be used as path of the file to load.\n */\n\nexports.setup = function setup() {\n // A small note: we don\'t replace the cache here (and instead use the native one). This is an effort to not\n // break code similar to "delete require.cache[require.resolve(FOO)]", where FOO is a package located outside\n // of the Yarn dependency tree. In this case, we defer the load to the native loader. If we were to replace the\n // cache by our own, the native loader would populate its own cache, which wouldn\'t be exposed anymore, so the\n // delete call would be broken.\n\n const originalModuleLoad = Module._load;\n\n Module._load = function(request, parent, isMain) {\n if (!enableNativeHooks) {\n return originalModuleLoad.call(Module, request, parent, isMain);\n }\n\n // Builtins are managed by the regular Node loader\n\n if (builtinModules.has(request)) {\n try {\n enableNativeHooks = false;\n return originalModuleLoad.call(Module, request, parent, isMain);\n } finally {\n enableNativeHooks = true;\n }\n }\n\n // The \'pnpapi\' name is reserved to return the PnP api currently in use by the program\n\n if (request === `pnpapi`) {\n return pnpModule.exports;\n }\n\n // Request `Module._resolveFilename` (ie. `resolveRequest`) to tell us which file we should load\n\n const modulePath = Module._resolveFilename(request, parent, isMain);\n\n // Check if the module has already been created for the given file\n\n const cacheEntry = Module._cache[modulePath];\n\n if (cacheEntry) {\n return cacheEntry.exports;\n }\n\n // Create a new module and store it into the cache\n\n const module = new Module(modulePath, parent);\n Module._cache[modulePath] = module;\n\n // The main module is exposed as global variable\n\n if (isMain) {\n process.mainModule = module;\n module.id = \'.\';\n }\n\n // Try to load the module, and remove it from the cache if it fails\n\n let hasThrown = true;\n\n try {\n module.load(modulePath);\n hasThrown = false;\n } finally {\n if (hasThrown) {\n delete Module._cache[modulePath];\n }\n }\n\n // Some modules might have to be patched for compatibility purposes\n\n for (const [filter, patchFn] of patchedModules) {\n if (filter.test(request)) {\n module.exports = patchFn(exports.findPackageLocator(parent.filename), module.exports);\n }\n }\n\n return module.exports;\n };\n\n const originalModuleResolveFilename = Module._resolveFilename;\n\n Module._resolveFilename = function(request, parent, isMain, options) {\n if (!enableNativeHooks) {\n return originalModuleResolveFilename.call(Module, request, parent, isMain, options);\n }\n\n let issuers;\n\n if (options) {\n const optionNames = new Set(Object.keys(options));\n optionNames.delete(\'paths\');\n\n if (optionNames.size > 0) {\n throw makeError(\n `UNSUPPORTED`,\n `Some options passed to require() aren\'t supported by PnP yet (${Array.from(optionNames).join(\', \')})`\n );\n }\n\n if (options.paths) {\n issuers = options.paths.map(entry => `${path.normalize(entry)}/`);\n }\n }\n\n if (!issuers) {\n const issuerModule = getIssuerModule(parent);\n const issuer = issuerModule ? issuerModule.filename : `${process.cwd()}/`;\n\n issuers = [issuer];\n }\n\n let firstError;\n\n for (const issuer of issuers) {\n let resolution;\n\n try {\n resolution = exports.resolveRequest(request, issuer);\n } catch (error) {\n firstError = firstError || error;\n continue;\n }\n\n return resolution !== null ? resolution : request;\n }\n\n throw firstError;\n };\n\n const originalFindPath = Module._findPath;\n\n Module._findPath = function(request, paths, isMain) {\n if (!enableNativeHooks) {\n return originalFindPath.call(Module, request, paths, isMain);\n }\n\n for (const path of paths || []) {\n let resolution;\n\n try {\n resolution = exports.resolveRequest(request, path);\n } catch (error) {\n continue;\n }\n\n if (resolution) {\n return resolution;\n }\n }\n\n return false;\n };\n\n process.versions.pnp = String(exports.VERSIONS.std);\n};\n\nexports.setupCompatibilityLayer = () => {\n // ESLint currently doesn\'t have any portable way for shared configs to specify their own\n // plugins that should be used (https://github.com/eslint/eslint/issues/10125). This will\n // likely get fixed at some point, but it\'ll take time and in the meantime we\'ll just add\n // additional fallback entries for common shared configs.\n\n for (const name of [`react-scripts`]) {\n const packageInformationStore = packageInformationStores.get(name);\n if (packageInformationStore) {\n for (const reference of packageInformationStore.keys()) {\n fallbackLocators.push({name, reference});\n }\n }\n }\n\n // Modern versions of `resolve` support a specific entry point that custom resolvers can use\n // to inject a specific resolution logic without having to patch the whole package.\n //\n // Cf: https://github.com/browserify/resolve/pull/174\n\n patchedModules.push([\n /^\\.\\/normalize-options\\.js$/,\n (issuer, normalizeOptions) => {\n if (!issuer || issuer.name !== \'resolve\') {\n return normalizeOptions;\n }\n\n return (request, opts) => {\n opts = opts || {};\n\n if (opts.forceNodeResolution) {\n return opts;\n }\n\n opts.preserveSymlinks = true;\n opts.paths = function(request, basedir, getNodeModulesDir, opts) {\n // Extract the name of the package being requested (1=full name, 2=scope name, 3=local name)\n const parts = request.match(/^((?:(@[^\\/]+)\\/)?([^\\/]+))/);\n\n // make sure that basedir ends with a slash\n if (basedir.charAt(basedir.length - 1) !== \'/\') {\n basedir = path.join(basedir, \'/\');\n }\n // This is guaranteed to return the path to the "package.json" file from the given package\n const manifestPath = exports.resolveToUnqualified(`${parts[1]}/package.json`, basedir);\n\n // The first dirname strips the package.json, the second strips the local named folder\n let nodeModules = path.dirname(path.dirname(manifestPath));\n\n // Strips the scope named folder if needed\n if (parts[2]) {\n nodeModules = path.dirname(nodeModules);\n }\n\n return [nodeModules];\n };\n\n return opts;\n };\n },\n ]);\n};\n\nif (module.parent && module.parent.id === \'internal/preload\') {\n exports.setupCompatibilityLayer();\n\n exports.setup();\n}\n\nif (process.mainModule === module) {\n exports.setupCompatibilityLayer();\n\n const reportError = (code, message, data) => {\n process.stdout.write(`${JSON.stringify([{code, message, data}, null])}\\n`);\n };\n\n const reportSuccess = resolution => {\n process.stdout.write(`${JSON.stringify([null, resolution])}\\n`);\n };\n\n const processResolution = (request, issuer) => {\n try {\n reportSuccess(exports.resolveRequest(request, issuer));\n } catch (error) {\n reportError(error.code, error.message, error.data);\n }\n };\n\n const processRequest = data => {\n try {\n const [request, issuer] = JSON.parse(data);\n processResolution(request, issuer);\n } catch (error) {\n reportError(`INVALID_JSON`, error.message, error.data);\n }\n };\n\n if (process.argv.length > 2) {\n if (process.argv.length !== 4) {\n process.stderr.write(`Usage: ${process.argv[0]} ${process.argv[1]} <request> <issuer>\\n`);\n process.exitCode = 64; /* EX_USAGE */\n } else {\n processResolution(process.argv[2], process.argv[3]);\n }\n } else {\n let buffer = \'\';\n const decoder = new StringDecoder.StringDecoder();\n\n process.stdin.on(\'data\', chunk => {\n buffer += decoder.write(chunk);\n\n do {\n const index = buffer.indexOf(\'\\n\');\n if (index === -1) {\n break;\n }\n\n const line = buffer.slice(0, index);\n buffer = buffer.slice(index + 1);\n\n processRequest(line);\n } while (true);\n });\n }\n}\n';
95679
95680
95681var crypto = __webpack_require__(21);
95682var invariant = __webpack_require__(15);
95683var path = __webpack_require__(1);
95684
95685var backwardSlashRegExp = /\\/g;
95686
95687var OFFLINE_CACHE_EXTENSION = `.zip`;
95688
95689function generateMaps(packageInformationStores, blacklistedLocations) {
95690 var code = ``;
95691
95692 // Bake the information stores into our generated code
95693 code += `let packageInformationStores = new Map([\n`;
95694 for (var _iterator = packageInformationStores, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
95695 var _ref2;
95696
95697 if (_isArray) {
95698 if (_i >= _iterator.length) break;
95699 _ref2 = _iterator[_i++];
95700 } else {
95701 _i = _iterator.next();
95702 if (_i.done) break;
95703 _ref2 = _i.value;
95704 }
95705
95706 var _ref = _ref2;
95707 var packageName = _ref[0];
95708 var packageInformationStore = _ref[1];
95709
95710 code += ` [${(0, (_stringify || _load_stringify()).default)(packageName)}, new Map([\n`;
95711 for (var _iterator4 = packageInformationStore, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
95712 var _ref7;
95713
95714 if (_isArray4) {
95715 if (_i4 >= _iterator4.length) break;
95716 _ref7 = _iterator4[_i4++];
95717 } else {
95718 _i4 = _iterator4.next();
95719 if (_i4.done) break;
95720 _ref7 = _i4.value;
95721 }
95722
95723 var _ref6 = _ref7;
95724 var packageReference = _ref6[0];
95725 var _ref6$ = _ref6[1];
95726 var _packageLocation = _ref6$.packageLocation;
95727 var _packageDependencies = _ref6$.packageDependencies;
95728
95729 code += ` [${(0, (_stringify || _load_stringify()).default)(packageReference)}, {\n`;
95730 code += ` packageLocation: path.resolve(__dirname, ${(0, (_stringify || _load_stringify()).default)(_packageLocation)}),\n`;
95731 code += ` packageDependencies: new Map([\n`;
95732 for (var _iterator5 = _packageDependencies.entries(), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
95733 var _ref9;
95734
95735 if (_isArray5) {
95736 if (_i5 >= _iterator5.length) break;
95737 _ref9 = _iterator5[_i5++];
95738 } else {
95739 _i5 = _iterator5.next();
95740 if (_i5.done) break;
95741 _ref9 = _i5.value;
95742 }
95743
95744 var _ref8 = _ref9;
95745 var dependencyName = _ref8[0];
95746 var dependencyReference = _ref8[1];
95747
95748 code += ` [${(0, (_stringify || _load_stringify()).default)(dependencyName)}, ${(0, (_stringify || _load_stringify()).default)(dependencyReference)}],\n`;
95749 }
95750 code += ` ]),\n`;
95751 code += ` }],\n`;
95752 }
95753 code += ` ])],\n`;
95754 }
95755 code += `]);\n`;
95756
95757 code += `\n`;
95758
95759 // Also bake an inverse map that will allow us to find the package information based on the path
95760 code += `let locatorsByLocations = new Map([\n`;
95761 for (var _iterator2 = blacklistedLocations, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
95762 var _ref3;
95763
95764 if (_isArray2) {
95765 if (_i2 >= _iterator2.length) break;
95766 _ref3 = _iterator2[_i2++];
95767 } else {
95768 _i2 = _iterator2.next();
95769 if (_i2.done) break;
95770 _ref3 = _i2.value;
95771 }
95772
95773 var blacklistedLocation = _ref3;
95774
95775 code += ` [${(0, (_stringify || _load_stringify()).default)(blacklistedLocation)}, blacklistedLocator],\n`;
95776 }
95777 for (var _iterator3 = packageInformationStores, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
95778 var _ref5;
95779
95780 if (_isArray3) {
95781 if (_i3 >= _iterator3.length) break;
95782 _ref5 = _iterator3[_i3++];
95783 } else {
95784 _i3 = _iterator3.next();
95785 if (_i3.done) break;
95786 _ref5 = _i3.value;
95787 }
95788
95789 var _ref4 = _ref5;
95790 var _packageName = _ref4[0];
95791 var _packageInformationStore = _ref4[1];
95792
95793 for (var _iterator6 = _packageInformationStore, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
95794 var _ref11;
95795
95796 if (_isArray6) {
95797 if (_i6 >= _iterator6.length) break;
95798 _ref11 = _iterator6[_i6++];
95799 } else {
95800 _i6 = _iterator6.next();
95801 if (_i6.done) break;
95802 _ref11 = _i6.value;
95803 }
95804
95805 var _ref10 = _ref11;
95806 var _packageReference = _ref10[0];
95807 var _packageLocation2 = _ref10[1].packageLocation;
95808
95809 if (_packageName !== null) {
95810 code += ` [${(0, (_stringify || _load_stringify()).default)(_packageLocation2)}, ${(0, (_stringify || _load_stringify()).default)({
95811 name: _packageName,
95812 reference: _packageReference
95813 })}],\n`;
95814 } else {
95815 code += ` [${(0, (_stringify || _load_stringify()).default)(_packageLocation2)}, topLevelLocator],\n`;
95816 }
95817 }
95818 }
95819 code += `]);\n`;
95820
95821 return code;
95822}
95823
95824function generateFindPackageLocator(packageInformationStores) {
95825 var code = ``;
95826
95827 // We get the list of each string length we'll need to check in order to find the current package context
95828 var lengths = new (_map || _load_map()).default();
95829
95830 for (var _iterator7 = packageInformationStores.values(), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
95831 var _ref12;
95832
95833 if (_isArray7) {
95834 if (_i7 >= _iterator7.length) break;
95835 _ref12 = _iterator7[_i7++];
95836 } else {
95837 _i7 = _iterator7.next();
95838 if (_i7.done) break;
95839 _ref12 = _i7.value;
95840 }
95841
95842 var packageInformationStore = _ref12;
95843
95844 for (var _iterator9 = packageInformationStore.values(), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator9);;) {
95845 var _ref16;
95846
95847 if (_isArray9) {
95848 if (_i9 >= _iterator9.length) break;
95849 _ref16 = _iterator9[_i9++];
95850 } else {
95851 _i9 = _iterator9.next();
95852 if (_i9.done) break;
95853 _ref16 = _i9.value;
95854 }
95855
95856 var _ref15 = _ref16;
95857 var _packageLocation3 = _ref15.packageLocation;
95858
95859 if (_packageLocation3 === null) {
95860 continue;
95861 }
95862
95863 var _length = _packageLocation3.length;
95864 var count = (lengths.get(_length) || 0) + 1;
95865
95866 lengths.set(_length, count);
95867 }
95868 }
95869
95870 // We must try the larger lengths before the smaller ones, because smaller ones might also match the longest ones
95871 // (for instance, /project/path will match /project/path/.pnp/global/node_modules/pnp-cf5f9c17b8f8db)
95872 var sortedLengths = (0, (_from || _load_from()).default)(lengths.entries()).sort(function (a, b) {
95873 return b[0] - a[0];
95874 });
95875
95876 // Generate a function that, given a file path, returns the associated package name
95877 code += `exports.findPackageLocator = function findPackageLocator(location) {\n`;
95878 code += ` let relativeLocation = normalizePath(path.relative(__dirname, location));\n`;
95879 code += `\n`;
95880 code += ` if (!relativeLocation.match(isStrictRegExp))\n`;
95881 code += ` relativeLocation = \`./\${relativeLocation}\`;\n`;
95882 code += `\n`;
95883 code += ` if (location.match(isDirRegExp) && relativeLocation.charAt(relativeLocation.length - 1) !== '/')\n`;
95884 code += ` relativeLocation = \`\${relativeLocation}/\`;\n`;
95885 code += `\n`;
95886 code += ` let match;\n`;
95887
95888 for (var _iterator8 = sortedLengths, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator8);;) {
95889 var _ref14;
95890
95891 if (_isArray8) {
95892 if (_i8 >= _iterator8.length) break;
95893 _ref14 = _iterator8[_i8++];
95894 } else {
95895 _i8 = _iterator8.next();
95896 if (_i8.done) break;
95897 _ref14 = _i8.value;
95898 }
95899
95900 var _ref13 = _ref14;
95901 var length = _ref13[0];
95902
95903 code += `\n`;
95904 code += ` if (relativeLocation.length >= ${length} && relativeLocation[${length - 1}] === '/')\n`;
95905 code += ` if (match = locatorsByLocations.get(relativeLocation.substr(0, ${length})))\n`;
95906 code += ` return blacklistCheck(match);\n`;
95907 }
95908
95909 code += `\n`;
95910 code += ` return null;\n`;
95911 code += `};\n`;
95912
95913 return code;
95914}
95915
95916/***/ }),
95917/* 537 */
95918/***/ (function(module, exports, __webpack_require__) {
95919
95920"use strict";
95921
95922
95923Object.defineProperty(exports, "__esModule", {
95924 value: true
95925});
95926
95927var _getIterator2;
95928
95929function _load_getIterator() {
95930 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
95931}
95932
95933var _set;
95934
95935function _load_set() {
95936 return _set = _interopRequireDefault(__webpack_require__(16));
95937}
95938
95939var _keys;
95940
95941function _load_keys() {
95942 return _keys = _interopRequireDefault(__webpack_require__(14));
95943}
95944
95945exports.getTransitiveDevDependencies = getTransitiveDevDependencies;
95946
95947function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
95948
95949function dependenciesObjectToPatterns(dependencies) {
95950 if (!dependencies) {
95951 return [];
95952 }
95953 return (0, (_keys || _load_keys()).default)(dependencies).map(function (name) {
95954 return `${name}@${(dependencies || {})[name]}`;
95955 });
95956}
95957
95958// Enumerate all the transitive dependencies of a set of top-level packages
95959function getTransitiveDependencies(lockfile, roots) {
95960 // Queue of dependency patterns to visit; set of already-visited patterns
95961 var queue = [];
95962 var patterns = new (_set || _load_set()).default();
95963
95964 var enqueue = function enqueue(pattern) {
95965 if (patterns.has(pattern)) {
95966 return;
95967 }
95968 patterns.add(pattern);
95969 queue.push(pattern);
95970 };
95971
95972 roots.forEach(enqueue);
95973
95974 // Final result set
95975 var transitiveDependencies = new (_set || _load_set()).default();
95976
95977 while (queue.length > 0) {
95978 var pattern = queue.shift();
95979 var lockManifest = lockfile.getLocked(pattern);
95980
95981 if (!lockManifest) {
95982 continue;
95983 }
95984
95985 // Add the dependency to the result set
95986 transitiveDependencies.add(`${lockManifest.name}@${lockManifest.version}`);
95987
95988 // Enqueue any dependencies of the dependency for processing
95989
95990 var dependencyPatterns = dependenciesObjectToPatterns(lockManifest.dependencies);
95991 dependencyPatterns.forEach(enqueue);
95992
95993 var optionalDependencyPatterns = dependenciesObjectToPatterns(lockManifest.optionalDependencies);
95994 optionalDependencyPatterns.forEach(enqueue);
95995 }
95996
95997 return transitiveDependencies;
95998}
95999
96000function setDifference(x, y) {
96001 return new (_set || _load_set()).default([].concat(x).filter(function (value) {
96002 return !y.has(value);
96003 }));
96004}
96005
96006// Given a manifest, an optional workspace layout, and a lockfile, enumerate
96007// all package versions that:
96008// i) are present in the lockfile
96009// ii) are a transitive dependency of some top-level devDependency
96010// iii) are not a transitive dependency of some top-level production dependency
96011function getTransitiveDevDependencies(packageManifest, workspaceLayout, lockfile) {
96012 // Enumerate the top-level package manifest as well as any workspace manifests
96013 var manifests = [packageManifest];
96014 if (workspaceLayout) {
96015 for (var _iterator = (0, (_keys || _load_keys()).default)(workspaceLayout.workspaces), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
96016 var _ref;
96017
96018 if (_isArray) {
96019 if (_i >= _iterator.length) break;
96020 _ref = _iterator[_i++];
96021 } else {
96022 _i = _iterator.next();
96023 if (_i.done) break;
96024 _ref = _i.value;
96025 }
96026
96027 var name = _ref;
96028
96029 manifests.push(workspaceLayout.workspaces[name].manifest);
96030 }
96031 }
96032
96033 // Collect all the top-level production and development dependencies across all manifests
96034 var productionRoots = [];
96035 var developmentRoots = [];
96036 for (var _iterator2 = manifests, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
96037 var _ref2;
96038
96039 if (_isArray2) {
96040 if (_i2 >= _iterator2.length) break;
96041 _ref2 = _iterator2[_i2++];
96042 } else {
96043 _i2 = _iterator2.next();
96044 if (_i2.done) break;
96045 _ref2 = _i2.value;
96046 }
96047
96048 var manifest = _ref2;
96049
96050 productionRoots = productionRoots.concat(dependenciesObjectToPatterns(manifest.dependencies));
96051 productionRoots = productionRoots.concat(dependenciesObjectToPatterns(manifest.optionalDependencies));
96052 developmentRoots = developmentRoots.concat(dependenciesObjectToPatterns(manifest.devDependencies));
96053 }
96054
96055 // Enumerate all the transitive production and development dependencies
96056 var productionDependencies = getTransitiveDependencies(lockfile, productionRoots);
96057 var developmentDependencies = getTransitiveDependencies(lockfile, developmentRoots);
96058
96059 // Exclude any development dependencies that are also production dependencies
96060 return setDifference(developmentDependencies, productionDependencies);
96061}
96062
96063/***/ }),
96064/* 538 */
96065/***/ (function(module, exports, __webpack_require__) {
96066
96067"use strict";
96068
96069
96070Object.defineProperty(exports, "__esModule", {
96071 value: true
96072});
96073exports.parseRefs = exports.resolveVersion = exports.isCommitSha = undefined;
96074
96075var _map;
96076
96077function _load_map() {
96078 return _map = _interopRequireDefault(__webpack_require__(42));
96079}
96080
96081var _asyncToGenerator2;
96082
96083function _load_asyncToGenerator() {
96084 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
96085}
96086
96087var _getIterator2;
96088
96089function _load_getIterator() {
96090 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
96091}
96092
96093var _promise;
96094
96095function _load_promise() {
96096 return _promise = _interopRequireDefault(__webpack_require__(7));
96097}
96098
96099var _misc;
96100
96101function _load_misc() {
96102 return _misc = __webpack_require__(28);
96103}
96104
96105function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
96106
96107var semver = __webpack_require__(27);
96108
96109var REF_PREFIX = 'refs/';
96110var REF_TAG_PREFIX = 'refs/tags/';
96111var REF_BRANCH_PREFIX = 'refs/heads/';
96112var REF_PR_PREFIX = 'refs/pull/';
96113
96114// This regex is designed to match output from git of the style:
96115// ebeb6eafceb61dd08441ffe086c77eb472842494 refs/tags/v0.21.0
96116// and extract the hash and ref name as capture groups
96117var GIT_REF_LINE_REGEXP = /^([a-fA-F0-9]+)\s+(refs\/(?:tags|heads|pull|remotes)\/.*)$/;
96118
96119var COMMIT_SHA_REGEXP = /^[a-f0-9]{5,40}$/;
96120var REF_NAME_REGEXP = /^refs\/(tags|heads)\/(.+)$/;
96121
96122var isCommitSha = exports.isCommitSha = function isCommitSha(target) {
96123 return COMMIT_SHA_REGEXP.test(target);
96124};
96125
96126var tryVersionAsGitCommit = function tryVersionAsGitCommit(_ref) {
96127 var version = _ref.version,
96128 refs = _ref.refs,
96129 git = _ref.git;
96130
96131 var lowercaseVersion = version.toLowerCase();
96132 if (!isCommitSha(lowercaseVersion)) {
96133 return (_promise || _load_promise()).default.resolve(null);
96134 }
96135 for (var _iterator = refs.entries(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
96136 var _ref4;
96137
96138 if (_isArray) {
96139 if (_i >= _iterator.length) break;
96140 _ref4 = _iterator[_i++];
96141 } else {
96142 _i = _iterator.next();
96143 if (_i.done) break;
96144 _ref4 = _i.value;
96145 }
96146
96147 var _ref3 = _ref4;
96148 var _ref2 = _ref3[0];
96149 var _sha = _ref3[1];
96150
96151 if (_sha.startsWith(lowercaseVersion)) {
96152 return (_promise || _load_promise()).default.resolve({ sha: _sha, ref: _ref2 });
96153 }
96154 }
96155 return git.resolveCommit(lowercaseVersion);
96156};
96157
96158var tryEmptyVersionAsDefaultBranch = function tryEmptyVersionAsDefaultBranch(_ref5) {
96159 var version = _ref5.version,
96160 git = _ref5.git;
96161 return version.trim() === '' ? git.resolveDefaultBranch() : (_promise || _load_promise()).default.resolve(null);
96162};
96163
96164var tryWildcardVersionAsDefaultBranch = function tryWildcardVersionAsDefaultBranch(_ref6) {
96165 var version = _ref6.version,
96166 git = _ref6.git;
96167 return version === '*' ? git.resolveDefaultBranch() : (_promise || _load_promise()).default.resolve(null);
96168};
96169
96170var tryRef = function tryRef(refs, ref) {
96171 var sha = refs.get(ref);
96172 return sha ? { sha, ref } : null;
96173};
96174
96175var tryVersionAsFullRef = function tryVersionAsFullRef(_ref7) {
96176 var version = _ref7.version,
96177 refs = _ref7.refs;
96178 return version.startsWith('refs/') ? tryRef(refs, version) : null;
96179};
96180
96181var tryVersionAsTagName = function tryVersionAsTagName(_ref8) {
96182 var version = _ref8.version,
96183 refs = _ref8.refs;
96184 return tryRef(refs, `${REF_TAG_PREFIX}${version}`);
96185};
96186
96187var tryVersionAsPullRequestNo = function tryVersionAsPullRequestNo(_ref9) {
96188 var version = _ref9.version,
96189 refs = _ref9.refs;
96190 return tryRef(refs, `${REF_PR_PREFIX}${version}`);
96191};
96192
96193var tryVersionAsBranchName = function tryVersionAsBranchName(_ref10) {
96194 var version = _ref10.version,
96195 refs = _ref10.refs;
96196 return tryRef(refs, `${REF_BRANCH_PREFIX}${version}`);
96197};
96198
96199var tryVersionAsDirectRef = function tryVersionAsDirectRef(_ref11) {
96200 var version = _ref11.version,
96201 refs = _ref11.refs;
96202 return tryRef(refs, `${REF_PREFIX}${version}`);
96203};
96204
96205var computeSemverNames = function computeSemverNames(_ref12) {
96206 var config = _ref12.config,
96207 refs = _ref12.refs;
96208
96209 var names = {
96210 tags: [],
96211 heads: []
96212 };
96213 for (var _iterator2 = refs.keys(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
96214 var _ref14;
96215
96216 if (_isArray2) {
96217 if (_i2 >= _iterator2.length) break;
96218 _ref14 = _iterator2[_i2++];
96219 } else {
96220 _i2 = _iterator2.next();
96221 if (_i2.done) break;
96222 _ref14 = _i2.value;
96223 }
96224
96225 var _ref13 = _ref14;
96226
96227 var match = REF_NAME_REGEXP.exec(_ref13);
96228 if (!match) {
96229 continue;
96230 }
96231 var type = match[1],
96232 name = match[2];
96233
96234 if (semver.valid(name, config.looseSemver)) {
96235 names[type].push(name);
96236 }
96237 }
96238 return names;
96239};
96240
96241var findSemver = function findSemver(version, config, namesList) {
96242 return config.resolveConstraints(namesList, version);
96243};
96244
96245var tryVersionAsTagSemver = function () {
96246 var _ref15 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref16, names) {
96247 var version = _ref16.version,
96248 config = _ref16.config,
96249 refs = _ref16.refs;
96250
96251 var result = yield findSemver(version.replace(/^semver:/, ''), config, names.tags);
96252 return result ? tryRef(refs, `${REF_TAG_PREFIX}${result}`) : null;
96253 });
96254
96255 return function tryVersionAsTagSemver(_x, _x2) {
96256 return _ref15.apply(this, arguments);
96257 };
96258}();
96259
96260var tryVersionAsBranchSemver = function () {
96261 var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (_ref18, names) {
96262 var version = _ref18.version,
96263 config = _ref18.config,
96264 refs = _ref18.refs;
96265
96266 var result = yield findSemver(version.replace(/^semver:/, ''), config, names.heads);
96267 return result ? tryRef(refs, `${REF_BRANCH_PREFIX}${result}`) : null;
96268 });
96269
96270 return function tryVersionAsBranchSemver(_x3, _x4) {
96271 return _ref17.apply(this, arguments);
96272 };
96273}();
96274
96275var tryVersionAsSemverRange = function () {
96276 var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (options) {
96277 var names = computeSemverNames(options);
96278 return (yield tryVersionAsTagSemver(options, names)) || tryVersionAsBranchSemver(options, names);
96279 });
96280
96281 return function tryVersionAsSemverRange(_x5) {
96282 return _ref19.apply(this, arguments);
96283 };
96284}();
96285
96286var VERSION_RESOLUTION_STEPS = [tryEmptyVersionAsDefaultBranch, tryVersionAsGitCommit, tryVersionAsFullRef, tryVersionAsTagName, tryVersionAsPullRequestNo, tryVersionAsBranchName, tryVersionAsSemverRange, tryWildcardVersionAsDefaultBranch, tryVersionAsDirectRef];
96287
96288/**
96289 * Resolve a git-url hash (version) to a git commit sha and branch/tag ref
96290 * Returns null if the version cannot be resolved to any commit
96291 */
96292
96293var resolveVersion = exports.resolveVersion = function () {
96294 var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (options) {
96295 for (var _iterator3 = VERSION_RESOLUTION_STEPS, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
96296 var _ref21;
96297
96298 if (_isArray3) {
96299 if (_i3 >= _iterator3.length) break;
96300 _ref21 = _iterator3[_i3++];
96301 } else {
96302 _i3 = _iterator3.next();
96303 if (_i3.done) break;
96304 _ref21 = _i3.value;
96305 }
96306
96307 var testFunction = _ref21;
96308
96309 var result = yield testFunction(options);
96310 if (result !== null) {
96311 return result;
96312 }
96313 }
96314 return null;
96315 });
96316
96317 return function resolveVersion(_x6) {
96318 return _ref20.apply(this, arguments);
96319 };
96320}();
96321
96322/**
96323 * Parse Git ref lines into hash of ref names to SHA hashes
96324 */
96325
96326var parseRefs = exports.parseRefs = function parseRefs(stdout) {
96327 // store references
96328 var refs = new (_map || _load_map()).default();
96329
96330 // line delimited
96331 var refLines = stdout.split('\n');
96332
96333 for (var _iterator4 = refLines, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
96334 var _ref22;
96335
96336 if (_isArray4) {
96337 if (_i4 >= _iterator4.length) break;
96338 _ref22 = _iterator4[_i4++];
96339 } else {
96340 _i4 = _iterator4.next();
96341 if (_i4.done) break;
96342 _ref22 = _i4.value;
96343 }
96344
96345 var line = _ref22;
96346
96347 var match = GIT_REF_LINE_REGEXP.exec(line);
96348
96349 if (match) {
96350 var _sha2 = match[1],
96351 tagName = match[2];
96352
96353 // As documented in gitrevisions:
96354 // https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html#_specifying_revisions
96355 // "A suffix ^ followed by an empty brace pair means the object could be a tag,
96356 // and dereference the tag recursively until a non-tag object is found."
96357 // In other words, the hash without ^{} is the hash of the tag,
96358 // and the hash with ^{} is the hash of the commit at which the tag was made.
96359
96360 var name = (0, (_misc || _load_misc()).removeSuffix)(tagName, '^{}');
96361
96362 refs.set(name, _sha2);
96363 }
96364 }
96365
96366 return refs;
96367};
96368
96369/***/ }),
96370/* 539 */
96371/***/ (function(module, exports, __webpack_require__) {
96372
96373"use strict";
96374
96375
96376Object.defineProperty(exports, "__esModule", {
96377 value: true
96378});
96379exports.LogicalDependencyTree = undefined;
96380
96381var _classCallCheck2;
96382
96383function _load_classCallCheck() {
96384 return _classCallCheck2 = _interopRequireDefault(__webpack_require__(3));
96385}
96386
96387var _npmLogicalTree;
96388
96389function _load_npmLogicalTree() {
96390 return _npmLogicalTree = _interopRequireDefault(__webpack_require__(838));
96391}
96392
96393function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
96394
96395var LogicalDependencyTree = exports.LogicalDependencyTree = function () {
96396 function LogicalDependencyTree(packageJson, packageLock) {
96397 (0, (_classCallCheck2 || _load_classCallCheck()).default)(this, LogicalDependencyTree);
96398
96399 this.tree = (0, (_npmLogicalTree || _load_npmLogicalTree()).default)(JSON.parse(packageJson), JSON.parse(packageLock));
96400 }
96401
96402 LogicalDependencyTree.prototype._findNode = function _findNode(name, parentNames) {
96403 var parentTree = parentNames ? parentNames.reduce(function (node, ancestor) {
96404 var ancestorNode = node.dependencies.get(ancestor);
96405 return ancestorNode;
96406 }, this.tree) : this.tree;
96407 var node = parentTree.dependencies.get(name);
96408 return node;
96409 };
96410
96411 LogicalDependencyTree.prototype.getFixedVersionPattern = function getFixedVersionPattern(name, parentNames) {
96412 var node = this._findNode(name, parentNames);
96413 var version = node.version;
96414 return `${node.name}@${version}`;
96415 };
96416
96417 return LogicalDependencyTree;
96418}();
96419
96420/***/ }),
96421/* 540 */
96422/***/ (function(module, exports, __webpack_require__) {
96423
96424"use strict";
96425
96426
96427Object.defineProperty(exports, "__esModule", {
96428 value: true
96429});
96430
96431var _keys;
96432
96433function _load_keys() {
96434 return _keys = _interopRequireDefault(__webpack_require__(14));
96435}
96436
96437var _getIterator2;
96438
96439function _load_getIterator() {
96440 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
96441}
96442
96443var _asyncToGenerator2;
96444
96445function _load_asyncToGenerator() {
96446 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
96447}
96448
96449var _constants;
96450
96451function _load_constants() {
96452 return _constants = __webpack_require__(13);
96453}
96454
96455var _util;
96456
96457function _load_util() {
96458 return _util = __webpack_require__(207);
96459}
96460
96461var _index;
96462
96463function _load_index() {
96464 return _index = __webpack_require__(75);
96465}
96466
96467var _inferLicense;
96468
96469function _load_inferLicense() {
96470 return _inferLicense = _interopRequireDefault(__webpack_require__(541));
96471}
96472
96473var _fs;
96474
96475function _load_fs() {
96476 return _fs = _interopRequireWildcard(__webpack_require__(8));
96477}
96478
96479function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
96480
96481function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
96482
96483var semver = __webpack_require__(27);
96484var path = __webpack_require__(1);
96485var url = __webpack_require__(29);
96486
96487var VALID_BIN_KEYS = /^(?!\.{0,2}$)[a-z0-9._-]+$/i;
96488
96489var LICENSE_RENAMES = {
96490 'MIT/X11': 'MIT',
96491 X11: 'MIT'
96492};
96493
96494exports.default = function () {
96495 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (info, moduleLoc, reporter, warn, looseSemver) {
96496 var files = yield (_fs || _load_fs()).readdir(moduleLoc);
96497
96498 // clean info.version
96499 if (typeof info.version === 'string') {
96500 info.version = semver.clean(info.version, looseSemver) || info.version;
96501 }
96502
96503 // if name or version aren't set then set them to empty strings
96504 info.name = info.name || '';
96505 info.version = info.version || '';
96506
96507 // if the man field is a string then coerce it to an array
96508 if (typeof info.man === 'string') {
96509 info.man = [info.man];
96510 }
96511
96512 // if the keywords field is a string then split it on any whitespace
96513 if (typeof info.keywords === 'string') {
96514 info.keywords = info.keywords.split(/\s+/g);
96515 }
96516
96517 // if there's no contributors field but an authors field then expand it
96518 if (!info.contributors && files.indexOf('AUTHORS') >= 0) {
96519 var authorsFilepath = path.join(moduleLoc, 'AUTHORS');
96520 var authorsFilestats = yield (_fs || _load_fs()).stat(authorsFilepath);
96521 if (authorsFilestats.isFile()) {
96522 var authors = yield (_fs || _load_fs()).readFile(authorsFilepath);
96523 authors = authors.split(/\r?\n/g) // split on lines
96524 .map(function (line) {
96525 return line.replace(/^\s*#.*$/, '').trim();
96526 }) // remove comments
96527 .filter(function (line) {
96528 return !!line;
96529 }); // remove empty lines
96530 info.contributors = authors;
96531 }
96532 }
96533
96534 // expand people fields to objects
96535 if (typeof info.author === 'string' || typeof info.author === 'object') {
96536 info.author = (0, (_util || _load_util()).normalizePerson)(info.author);
96537 }
96538 if (Array.isArray(info.contributors)) {
96539 info.contributors = info.contributors.map((_util || _load_util()).normalizePerson);
96540 }
96541 if (Array.isArray(info.maintainers)) {
96542 info.maintainers = info.maintainers.map((_util || _load_util()).normalizePerson);
96543 }
96544
96545 // if there's no readme field then load the README file from the cwd
96546 if (!info.readme) {
96547 var readmeCandidates = files.filter(function (filename) {
96548 var lower = filename.toLowerCase();
96549 return lower === 'readme' || lower.indexOf('readme.') === 0;
96550 }).sort(function (filename1, filename2) {
96551 // favor files with extensions
96552 return filename2.indexOf('.') - filename1.indexOf('.');
96553 });
96554
96555 for (var _iterator = readmeCandidates, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
96556 var _ref2;
96557
96558 if (_isArray) {
96559 if (_i >= _iterator.length) break;
96560 _ref2 = _iterator[_i++];
96561 } else {
96562 _i = _iterator.next();
96563 if (_i.done) break;
96564 _ref2 = _i.value;
96565 }
96566
96567 var readmeFilename = _ref2;
96568
96569 var readmeFilepath = path.join(moduleLoc, readmeFilename);
96570 var readmeFileStats = yield (_fs || _load_fs()).stat(readmeFilepath);
96571 if (readmeFileStats.isFile()) {
96572 info.readmeFilename = readmeFilename;
96573 info.readme = yield (_fs || _load_fs()).readFile(readmeFilepath);
96574 break;
96575 }
96576 }
96577 }
96578
96579 // if there's no description then take the first paragraph from the readme
96580 if (!info.description && info.readme) {
96581 var desc = (0, (_util || _load_util()).extractDescription)(info.readme);
96582 if (desc) {
96583 info.description = desc;
96584 }
96585 }
96586
96587 // support array of engine keys
96588 if (Array.isArray(info.engines)) {
96589 var engines = {};
96590 for (var _iterator2 = info.engines, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
96591 var _ref3;
96592
96593 if (_isArray2) {
96594 if (_i2 >= _iterator2.length) break;
96595 _ref3 = _iterator2[_i2++];
96596 } else {
96597 _i2 = _iterator2.next();
96598 if (_i2.done) break;
96599 _ref3 = _i2.value;
96600 }
96601
96602 var str = _ref3;
96603
96604 if (typeof str === 'string') {
96605 var _str$trim$split = str.trim().split(/ +/g),
96606 name = _str$trim$split[0],
96607 patternParts = _str$trim$split.slice(1);
96608
96609 engines[name] = patternParts.join(' ');
96610 }
96611 }
96612 info.engines = engines;
96613 }
96614
96615 // if the repository field is a string then assume it's a git repo and expand it
96616 if (typeof info.repository === 'string') {
96617 info.repository = {
96618 type: 'git',
96619 url: info.repository
96620 };
96621 }
96622
96623 var repo = info.repository;
96624
96625 // explode info.repository.url if it's a hosted git shorthand
96626 if (repo && typeof repo === 'object' && typeof repo.url === 'string') {
96627 repo.url = (0, (_index || _load_index()).hostedGitFragmentToGitUrl)(repo.url, reporter);
96628 }
96629
96630 // allow bugs to be specified as a string, expand it to an object with a single url prop
96631 if (typeof info.bugs === 'string') {
96632 info.bugs = { url: info.bugs };
96633 }
96634
96635 // normalize homepage url to http
96636 if (typeof info.homepage === 'string') {
96637 var parts = url.parse(info.homepage);
96638 parts.protocol = parts.protocol || 'http:';
96639 if (parts.pathname && !parts.hostname) {
96640 parts.hostname = parts.pathname;
96641 parts.pathname = '';
96642 }
96643 info.homepage = url.format(parts);
96644 }
96645
96646 // if the `bin` field is as string then expand it to an object with a single property
96647 // based on the original `bin` field and `name field`
96648 // { name: "foo", bin: "cli.js" } -> { name: "foo", bin: { foo: "cli.js" } }
96649 if (typeof info.name === 'string' && typeof info.bin === 'string' && info.bin.length > 0) {
96650 // Remove scoped package name for consistency with NPM's bin field fixing behaviour
96651 var _name = info.name.replace(/^@[^\/]+\//, '');
96652 info.bin = { [_name]: info.bin };
96653 }
96654
96655 // Validate that the bin entries reference only files within their package, and that
96656 // their name is a valid file name
96657 if (typeof info.bin === 'object' && info.bin !== null) {
96658 var bin = info.bin;
96659 for (var _iterator3 = (0, (_keys || _load_keys()).default)(bin), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator3);;) {
96660 var _ref4;
96661
96662 if (_isArray3) {
96663 if (_i3 >= _iterator3.length) break;
96664 _ref4 = _iterator3[_i3++];
96665 } else {
96666 _i3 = _iterator3.next();
96667 if (_i3.done) break;
96668 _ref4 = _i3.value;
96669 }
96670
96671 var _key = _ref4;
96672
96673 var target = bin[_key];
96674 if (!VALID_BIN_KEYS.test(_key) || !(0, (_util || _load_util()).isValidBin)(target)) {
96675 delete bin[_key];
96676 warn(reporter.lang('invalidBinEntry', info.name, _key));
96677 } else {
96678 bin[_key] = path.normalize(target);
96679 }
96680 }
96681 } else if (typeof info.bin !== 'undefined') {
96682 delete info.bin;
96683 warn(reporter.lang('invalidBinField', info.name));
96684 }
96685
96686 // bundleDependencies is an alias for bundledDependencies
96687 if (info.bundledDependencies) {
96688 info.bundleDependencies = info.bundledDependencies;
96689 delete info.bundledDependencies;
96690 }
96691
96692 var scripts = void 0;
96693
96694 // dummy script object to shove file inferred scripts onto
96695 if (info.scripts && typeof info.scripts === 'object') {
96696 scripts = info.scripts;
96697 } else {
96698 scripts = {};
96699 }
96700
96701 // if there's a server.js file and no start script then set it to `node server.js`
96702 if (!scripts.start && files.indexOf('server.js') >= 0) {
96703 scripts.start = 'node server.js';
96704 }
96705
96706 // if there's a binding.gyp file and no install script then set it to `node-gyp rebuild`
96707 if (!scripts.install && files.indexOf('binding.gyp') >= 0) {
96708 scripts.install = 'node-gyp rebuild';
96709 }
96710
96711 // set scripts if we've polluted the empty object
96712 if ((0, (_keys || _load_keys()).default)(scripts).length) {
96713 info.scripts = scripts;
96714 }
96715
96716 var dirs = info.directories;
96717
96718 if (dirs && typeof dirs === 'object') {
96719 var binDir = dirs.bin;
96720
96721 if (!info.bin && binDir && typeof binDir === 'string') {
96722 var _bin = info.bin = {};
96723 var fullBinDir = path.join(moduleLoc, binDir);
96724
96725 if (yield (_fs || _load_fs()).exists(fullBinDir)) {
96726 for (var _iterator4 = yield (_fs || _load_fs()).readdir(fullBinDir), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator4);;) {
96727 var _ref5;
96728
96729 if (_isArray4) {
96730 if (_i4 >= _iterator4.length) break;
96731 _ref5 = _iterator4[_i4++];
96732 } else {
96733 _i4 = _iterator4.next();
96734 if (_i4.done) break;
96735 _ref5 = _i4.value;
96736 }
96737
96738 var scriptName = _ref5;
96739
96740 if (scriptName[0] === '.') {
96741 continue;
96742 }
96743 _bin[scriptName] = path.join('.', binDir, scriptName);
96744 }
96745 } else {
96746 warn(reporter.lang('manifestDirectoryNotFound', binDir, info.name));
96747 }
96748 }
96749
96750 var manDir = dirs.man;
96751
96752 if (!info.man && typeof manDir === 'string') {
96753 var man = info.man = [];
96754 var fullManDir = path.join(moduleLoc, manDir);
96755
96756 if (yield (_fs || _load_fs()).exists(fullManDir)) {
96757 for (var _iterator5 = yield (_fs || _load_fs()).readdir(fullManDir), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator5);;) {
96758 var _ref6;
96759
96760 if (_isArray5) {
96761 if (_i5 >= _iterator5.length) break;
96762 _ref6 = _iterator5[_i5++];
96763 } else {
96764 _i5 = _iterator5.next();
96765 if (_i5.done) break;
96766 _ref6 = _i5.value;
96767 }
96768
96769 var filename = _ref6;
96770
96771 if (/^(.*?)\.[0-9]$/.test(filename)) {
96772 man.push(path.join('.', manDir, filename));
96773 }
96774 }
96775 } else {
96776 warn(reporter.lang('manifestDirectoryNotFound', manDir, info.name));
96777 }
96778 }
96779 }
96780
96781 delete info.directories;
96782
96783 // normalize licenses field
96784 var licenses = info.licenses;
96785 if (Array.isArray(licenses) && !info.license) {
96786 var licenseTypes = [];
96787
96788 for (var _iterator6 = licenses, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator6);;) {
96789 var _ref7;
96790
96791 if (_isArray6) {
96792 if (_i6 >= _iterator6.length) break;
96793 _ref7 = _iterator6[_i6++];
96794 } else {
96795 _i6 = _iterator6.next();
96796 if (_i6.done) break;
96797 _ref7 = _i6.value;
96798 }
96799
96800 var _license = _ref7;
96801
96802 if (_license && typeof _license === 'object') {
96803 _license = _license.type;
96804 }
96805 if (typeof _license === 'string') {
96806 licenseTypes.push(_license);
96807 }
96808 }
96809
96810 licenseTypes = licenseTypes.filter((_util || _load_util()).isValidLicense);
96811
96812 if (licenseTypes.length === 1) {
96813 info.license = licenseTypes[0];
96814 } else if (licenseTypes.length) {
96815 info.license = `(${licenseTypes.join(' OR ')})`;
96816 }
96817 }
96818
96819 var license = info.license;
96820
96821 // normalize license
96822 if (license && typeof license === 'object') {
96823 info.license = license.type;
96824 }
96825
96826 // get license file
96827 var licenseFile = files.find(function (filename) {
96828 var lower = filename.toLowerCase();
96829 return lower === 'license' || lower.startsWith('license.') || lower === 'unlicense' || lower.startsWith('unlicense.');
96830 });
96831 if (licenseFile) {
96832 var licenseFilepath = path.join(moduleLoc, licenseFile);
96833 var licenseFileStats = yield (_fs || _load_fs()).stat(licenseFilepath);
96834 if (licenseFileStats.isFile()) {
96835 var licenseContent = yield (_fs || _load_fs()).readFile(licenseFilepath);
96836 var inferredLicense = (0, (_inferLicense || _load_inferLicense()).default)(licenseContent);
96837 info.licenseText = licenseContent;
96838
96839 var _license2 = info.license;
96840
96841 if (typeof _license2 === 'string') {
96842 if (inferredLicense && (0, (_util || _load_util()).isValidLicense)(inferredLicense) && !(0, (_util || _load_util()).isValidLicense)(_license2)) {
96843 // some packages don't specify their license version but we can infer it based on their license file
96844 var basicLicense = _license2.toLowerCase().replace(/(-like|\*)$/g, '');
96845 var expandedLicense = inferredLicense.toLowerCase();
96846 if (expandedLicense.startsWith(basicLicense)) {
96847 // TODO consider doing something to notify the user
96848 info.license = inferredLicense;
96849 }
96850 }
96851 } else if (inferredLicense) {
96852 // if there's no license then infer it based on the license file
96853 info.license = inferredLicense;
96854 } else {
96855 // valid expression to refer to a license in a file
96856 info.license = `SEE LICENSE IN ${licenseFile}`;
96857 }
96858 }
96859 }
96860
96861 if (typeof info.license === 'string') {
96862 // sometimes licenses are known by different names, reduce them
96863 info.license = LICENSE_RENAMES[info.license] || info.license;
96864 } else if (typeof info.readme === 'string') {
96865 // the license might be at the bottom of the README
96866 var _inferredLicense = (0, (_inferLicense || _load_inferLicense()).default)(info.readme);
96867 if (_inferredLicense) {
96868 info.license = _inferredLicense;
96869 }
96870 }
96871
96872 // get notice file
96873 var noticeFile = files.find(function (filename) {
96874 var lower = filename.toLowerCase();
96875 return lower === 'notice' || lower.startsWith('notice.');
96876 });
96877 if (noticeFile) {
96878 var noticeFilepath = path.join(moduleLoc, noticeFile);
96879 var noticeFileStats = yield (_fs || _load_fs()).stat(noticeFilepath);
96880 if (noticeFileStats.isFile()) {
96881 info.noticeText = yield (_fs || _load_fs()).readFile(noticeFilepath);
96882 }
96883 }
96884
96885 for (var _iterator7 = (_constants || _load_constants()).MANIFEST_FIELDS, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator7);;) {
96886 var _ref8;
96887
96888 if (_isArray7) {
96889 if (_i7 >= _iterator7.length) break;
96890 _ref8 = _iterator7[_i7++];
96891 } else {
96892 _i7 = _iterator7.next();
96893 if (_i7.done) break;
96894 _ref8 = _i7.value;
96895 }
96896
96897 var dependencyType = _ref8;
96898
96899 var dependencyList = info[dependencyType];
96900 if (dependencyList && typeof dependencyList === 'object') {
96901 delete dependencyList['//'];
96902 for (var _name2 in dependencyList) {
96903 dependencyList[_name2] = dependencyList[_name2] || '';
96904 }
96905 }
96906 }
96907 });
96908
96909 return function (_x, _x2, _x3, _x4, _x5) {
96910 return _ref.apply(this, arguments);
96911 };
96912}();
96913
96914/***/ }),
96915/* 541 */
96916/***/ (function(module, exports, __webpack_require__) {
96917
96918"use strict";
96919
96920
96921Object.defineProperty(exports, "__esModule", {
96922 value: true
96923});
96924
96925var _getIterator2;
96926
96927function _load_getIterator() {
96928 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
96929}
96930
96931exports.default = inferLicense;
96932
96933var _licenses;
96934
96935function _load_licenses() {
96936 return _licenses = _interopRequireDefault(__webpack_require__(542));
96937}
96938
96939function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
96940
96941function clean(str) {
96942 return str.replace(/[^A-Za-z\s]/g, ' ').replace(/[\s]+/g, ' ').trim().toLowerCase();
96943}
96944
96945var REGEXES = {
96946 Apache: [/Apache License\b/],
96947 BSD: [/BSD\b/],
96948 ISC: [/The ISC License/, /ISC\b/],
96949 MIT: [/MIT\b/],
96950 Unlicense: [/http:\/\/unlicense.org\//],
96951 WTFPL: [/DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE/, /WTFPL\b/]
96952};
96953
96954function inferLicense(license) {
96955 // check if we have any explicit licenses
96956 var cleanLicense = clean(license);
96957 for (var licenseName in (_licenses || _load_licenses()).default) {
96958 var testLicense = (_licenses || _load_licenses()).default[licenseName];
96959 if (cleanLicense.search(testLicense) >= 0) {
96960 return licenseName;
96961 }
96962 }
96963
96964 // infer based on some keywords
96965 for (var _licenseName in REGEXES) {
96966 for (var _iterator = REGEXES[_licenseName], _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
96967 var _ref;
96968
96969 if (_isArray) {
96970 if (_i >= _iterator.length) break;
96971 _ref = _iterator[_i++];
96972 } else {
96973 _i = _iterator.next();
96974 if (_i.done) break;
96975 _ref = _i.value;
96976 }
96977
96978 var regex = _ref;
96979
96980 if (license.search(regex) >= 0) {
96981 return `${_licenseName}*`;
96982 }
96983 }
96984 }
96985
96986 return null;
96987}
96988
96989/***/ }),
96990/* 542 */
96991/***/ (function(module, exports, __webpack_require__) {
96992
96993"use strict";
96994
96995
96996Object.defineProperty(exports, "__esModule", {
96997 value: true
96998});
96999
97000
97001/* eslint-disable max-len */
97002
97003/**
97004 * DO NOT EDIT THIS FILE MANUALLY.
97005 * THIS FILE WAS GENERATED BY "generate-licenses-js.js".
97006 */
97007
97008exports.default = {
97009 'Apache-2.0': new RegExp('(licensed under the apache license version the license you may not use this file except in compliance with the license you may obtain a copy of the license at http www apache org licenses license unless required by applicable law or agreed to in writing software distributed under the license is distributed on an as is basis without warranties or conditions of any kind either express or implied see the license for the specific language governing permissions and limitations under the license$|apache license version january http www apache org licenses terms and conditions for use reproduction and distribution definitions license shall mean the terms and conditions for use reproduction and distribution as defined by sections through of this document licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the license legal entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity for the purposes of this definition control means i the power direct or indirect to cause the direction or management of such entity whether by contract or otherwise or ii ownership of fifty percent or more of the outstanding shares or iii beneficial ownership of such entity you or your shall mean an individual or legal entity exercising permissions granted by this license source form shall mean the preferred form for making modifications including but not limited to software source code documentation source and configuration files object form shall mean any form resulting from mechanical transformation or translation of a source form including but not limited to compiled object code generated documentation and conversions to other media types work shall mean the work of authorship whether in source or object form made available under the license as indicated by a copyright notice that is included in or attached to the work an example is provided in the appendix below derivative works shall mean any work whether in source or object form that is based on or derived from the work and for which the editorial revisions annotations elaborations or other modifications represent as a whole an original work of authorship for the purposes of this license derivative works shall not include works that remain separable from or merely link or bind by name to the interfaces of the work and derivative works thereof contribution shall mean any work of authorship including the original version of the work and any modifications or additions to that work or derivative works thereof that is intentionally submitted to licensor for inclusion in the work by the copyright owner or by an individual or legal entity authorized to submit on behalf of the copyright owner for the purposes of this definition submitted means any form of electronic verbal or written communication sent to the licensor or its representatives including but not limited to communication on electronic mailing lists source code control systems and issue tracking systems that are managed by or on behalf of the licensor for the purpose of discussing and improving the work but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as not a contribution contributor shall mean licensor and any individual or legal entity on behalf of whom a contribution has been received by licensor and subsequently incorporated within the work grant of copyright license subject to the terms and conditions of this license each contributor hereby grants to you a perpetual worldwide non exclusive no charge royalty free irrevocable copyright license to reproduce prepare derivative works of publicly display publicly perform sublicense and distribute the work and such derivative works in source or object form grant of patent license subject to the terms and conditions of this license each contributor hereby grants to you a perpetual worldwide non exclusive no charge royalty free irrevocable except as stated in this section patent license to make have made use offer to sell sell import and otherwise transfer the work where such license applies only to those patent claims licensable by such contributor that are necessarily infringed by their contribution s alone or by combination of their contribution s with the work to which such contribution s was submitted if you institute patent litigation against any entity including a cross claim or counterclaim in a lawsuit alleging that the work or a contribution incorporated within the work constitutes direct or contributory patent infringement then any patent licenses granted to you under this license for that work shall terminate as of the date such litigation is filed redistribution you may reproduce and distribute copies of the work or derivative works thereof in any medium with or without modifications and in source or object form provided that you meet the following conditions a you must give any other recipients of the work or derivative works a copy of this license and b you must cause any modified files to carry prominent notices stating that you changed the files and c you must retain in the source form of any derivative works that you distribute all copyright patent trademark and attribution notices from the source form of the work excluding those notices that do not pertain to any part of the derivative works and d if the work includes a notice text file as part of its distribution then any derivative works that you distribute must include a readable copy of the attribution notices contained within such notice file excluding those notices that do not pertain to any part of the derivative works in at least one of the following places within a notice text file distributed as part of the derivative works within the source form or documentation if provided along with the derivative works or within a display generated by the derivative works if and wherever such third party notices normally appear the contents of the notice file are for informational purposes only and do not modify the license you may add your own attribution notices within derivative works that you distribute alongside or as an addendum to the notice text from the work provided that such additional attribution notices cannot be construed as modifying the license you may add your own copyright statement to your modifications and may provide additional or different license terms and conditions for use reproduction or distribution of your modifications or for any such derivative works as a whole provided your use reproduction and distribution of the work otherwise complies with the conditions stated in this license submission of contributions unless you explicitly state otherwise any contribution intentionally submitted for inclusion in the work by you to the licensor shall be under the terms and conditions of this license without any additional terms or conditions notwithstanding the above nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with licensor regarding such contributions trademarks this license does not grant permission to use the trade names trademarks service marks or product names of the licensor except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the notice file disclaimer of warranty unless required by applicable law or agreed to in writing licensor provides the work and each contributor provides its contributions on an as is basis without warranties or conditions of any kind either express or implied including without limitation any warranties or conditions of title non infringement merchantability or fitness for a particular purpose you are solely responsible for determining the appropriateness of using or redistributing the work and assume any risks associated with your exercise of permissions under this license limitation of liability in no event and under no legal theory whether in tort including negligence contract or otherwise unless required by applicable law such as deliberate and grossly negligent acts or agreed to in writing shall any contributor be liable to you for damages including any direct indirect special incidental or consequential damages of any character arising as a result of this license or out of the use or inability to use the work including but not limited to damages for loss of goodwill work stoppage computer failure or malfunction or any and all other commercial damages or losses even if such contributor has been advised of the possibility of such damages accepting warranty or additional liability while redistributing the work or derivative works thereof you may choose to offer and charge a fee for acceptance of support warranty indemnity or other liability obligations and or rights consistent with this license however in accepting such obligations you may act only on your own behalf and on your sole responsibility not on behalf of any other contributor and only if you agree to indemnify defend and hold each contributor harmless for any liability incurred by or claims asserted against such contributor by reason of your accepting any such warranty or additional liability end of terms and conditions$)', 'g'),
97010 'BSD-2-Clause': new RegExp('(redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution this(.*?| )is provided by the copyright holders and contributors as is and any express or implied warranties including but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed in no event shall(.*?| )be liable for any direct indirect incidental special exemplary or consequential damages including but not limited to procurement of substitute goods or services loss of use data or profits or business interruption however caused and on any theory of liability whether in contract strict liability or tort including negligence or otherwise arising in any way out of the use of this(.*?| )even if advised of the possibility of such damage$|redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution this software is provided by the copyright holders and contributors as is and any express or implied warranties including but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed in no event shall(.*?| )be liable for any direct indirect incidental special exemplary or consequential damages including but not limited to procurement of substitute goods or services loss of use data or profits or business interruption however caused and on any theory of liability whether in contract strict liability or tort including negligence or otherwise arising in any way out of the use of this software even if advised of the possibility of such damage$)', 'g'),
97011 'BSD-3-Clause': new RegExp('(redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution neither the name of(.*?| )nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission this software is provided by the copyright holders and contributors as is and any express or implied warranties including but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed in no event shall(.*?| )be liable for any direct indirect incidental special exemplary or consequential damages including but not limited to procurement of substitute goods or services loss of use data or profits or business interruption however caused and on any theory of liability whether in contract strict liability or tort including negligence or otherwise arising in any way out of the use of this software even if advised of the possibility of such damage$|(redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution the names of any contributors may not be used to endorse or promote products derived from this software without specific prior written permission this software is provided by the copyright holders and contributors as is and any express or implied warranties including but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed in no event shall the copyright holders and contributors be liable for any direct indirect incidental special exemplary or consequential damages including but not limited to procurement of substitute goods or services loss of use data or profits or business interruption however caused and on any theory of liability whether in contract strict liability or tort including negligence or otherwise arising in any way out of the use of this software even if advised of the possibility of such damage$|redistribution and use in source and binary forms with or without modification are permitted provided that the following conditions are met redistributions of source code must retain the above copyright notice this list of conditions and the following disclaimer redistributions in binary form must reproduce the above copyright notice this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution neither the name(.*?| )nor the names of(.*?| )contributors may be used to endorse or promote products derived from this software without specific prior written permission this software is provided by(.*?| )as is and any express or implied warranties including but not limited to the implied warranties of merchantability and fitness for a particular purpose are disclaimed in no event shall(.*?| )be liable for any direct indirect incidental special exemplary or consequential damages including but not limited to procurement of substitute goods or services loss of use data or profits or business interruption however caused and on any theory of liability whether in contract strict liability or tort including negligence or otherwise arising in any way out of the use of this software even if advised of the possibility of such damage$))', 'g'),
97012 MIT: new RegExp('permission is hereby granted free of charge to any person obtaining a copy of this software and associated documentation files the software to deal in the software without restriction including without limitation the rights to use copy modify merge publish distribute sublicense and or sell copies of the software and to permit persons to whom the software is furnished to do so subject to the following conditions the above copyright notice and this permission notice shall be included in all copies or substantial portions of the software the software is provided as is without warranty of any kind express or implied including but not limited to the warranties of merchantability fitness for a particular purpose and noninfringement in no event shall the authors or copyright holders be liable for any claim damages or other liability whether in an action of contract tort or otherwise arising from out of or in connection with the software or the use or other dealings in the software$', 'g'),
97013 Unlicense: new RegExp('this is free and unencumbered software released into the public domain anyone is free to copy modify publish use compile sell or distribute this software either in source code form or as a compiled binary for any purpose commercial or non commercial and by any means in jurisdictions that recognize copyright laws the author or authors of this software dedicate any and all copyright interest in the software to the public domain we make this dedication for the benefit of the public at large and to the detriment of our heirs and successors we intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law the software is provided as is without warranty of any kind express or implied including but not limited to the warranties of merchantability fitness for a particular purpose and noninfringement in no event shall the authors be liable for any claim damages or other liability whether in an action of contract tort or otherwise arising from out of or in connection with the software or the use or other dealings in the software for more information please refer to wildcard$', 'g')
97014};
97015
97016/***/ }),
97017/* 543 */
97018/***/ (function(module, exports, __webpack_require__) {
97019
97020"use strict";
97021
97022
97023Object.defineProperty(exports, "__esModule", {
97024 value: true
97025});
97026
97027var _keys;
97028
97029function _load_keys() {
97030 return _keys = _interopRequireDefault(__webpack_require__(14));
97031}
97032
97033var _getIterator2;
97034
97035function _load_getIterator() {
97036 return _getIterator2 = _interopRequireDefault(__webpack_require__(4));
97037}
97038
97039exports.default = function (info, moduleLoc, lockfileFolder) {
97040 // It won't work if we don't yet know what's the folder we'll use as root. It's not a
97041 // big deal tho, because it only happens when trying to figure out the root, and we
97042 // don't need to know the dependencies / devDependencies at this time.
97043 if (!lockfileFolder) {
97044 return;
97045 }
97046
97047 for (var _iterator = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, (_getIterator2 || _load_getIterator()).default)(_iterator);;) {
97048 var _ref;
97049
97050 if (_isArray) {
97051 if (_i >= _iterator.length) break;
97052 _ref = _iterator[_i++];
97053 } else {
97054 _i = _iterator.next();
97055 if (_i.done) break;
97056 _ref = _i.value;
97057 }
97058
97059 var dependencyType = _ref;
97060
97061 var dependencies = info[dependencyType];
97062 if (!dependencies) {
97063 continue;
97064 }
97065
97066 for (var _iterator2 = (0, (_keys || _load_keys()).default)(dependencies), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, (_getIterator2 || _load_getIterator()).default)(_iterator2);;) {
97067 var _ref2;
97068
97069 if (_isArray2) {
97070 if (_i2 >= _iterator2.length) break;
97071 _ref2 = _iterator2[_i2++];
97072 } else {
97073 _i2 = _iterator2.next();
97074 if (_i2.done) break;
97075 _ref2 = _i2.value;
97076 }
97077
97078 var name = _ref2;
97079
97080 var value = dependencies[name];
97081
97082 if (path.isAbsolute(value)) {
97083 value = (_fileResolver || _load_fileResolver()).FILE_PROTOCOL_PREFIX + value;
97084 }
97085
97086 var prefix = void 0;
97087 if (value.startsWith((_fileResolver || _load_fileResolver()).FILE_PROTOCOL_PREFIX)) {
97088 prefix = (_fileResolver || _load_fileResolver()).FILE_PROTOCOL_PREFIX;
97089 } else if (value.startsWith((_linkResolver || _load_linkResolver()).LINK_PROTOCOL_PREFIX)) {
97090 prefix = (_linkResolver || _load_linkResolver()).LINK_PROTOCOL_PREFIX;
97091 } else {
97092 continue;
97093 }
97094 (0, (_invariant || _load_invariant()).default)(prefix, 'prefix is definitely defined here');
97095
97096 var unprefixed = value.substr(prefix.length);
97097 var hasPathPrefix = /^\.(\/|$)/.test(unprefixed);
97098
97099 var absoluteTarget = path.resolve(lockfileFolder, moduleLoc, unprefixed);
97100 var relativeTarget = path.relative(lockfileFolder, absoluteTarget) || '.';
97101
97102 if (absoluteTarget === lockfileFolder) {
97103 relativeTarget = '.';
97104 } else if (hasPathPrefix) {
97105 // TODO: This logic should be removed during the next major bump
97106 // If the original value was using the "./" prefix, then we output a similar path.
97107 // We need to do this because otherwise it would cause problems with already existing
97108 // lockfile, which would see some of their entries being unrecognized.
97109 relativeTarget = relativeTarget.replace(/^(?!\.{0,2}\/)/, `./`);
97110 }
97111
97112 dependencies[name] = prefix + relativeTarget.replace(/\\/g, '/');
97113 }
97114 }
97115};
97116
97117var _constants;
97118
97119function _load_constants() {
97120 return _constants = __webpack_require__(13);
97121}
97122
97123var _fileResolver;
97124
97125function _load_fileResolver() {
97126 return _fileResolver = __webpack_require__(202);
97127}
97128
97129var _linkResolver;
97130
97131function _load_linkResolver() {
97132 return _linkResolver = __webpack_require__(305);
97133}
97134
97135var _invariant;
97136
97137function _load_invariant() {
97138 return _invariant = _interopRequireDefault(__webpack_require__(15));
97139}
97140
97141function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
97142
97143var path = __webpack_require__(1);
97144
97145/***/ }),
97146/* 544 */
97147/***/ (function(module, exports, __webpack_require__) {
97148
97149"use strict";
97150
97151
97152Object.defineProperty(exports, "__esModule", {
97153 value: true
97154});
97155exports.default = {
97156 autohr: 'author',
97157 autor: 'author',
97158 contributers: 'contributors',
97159 depdenencies: 'dependencies',
97160 dependancies: 'dependencies',
97161 dependecies: 'dependencies',
97162 depends: 'dependencies',
97163 'dev-dependencies': 'devDependencies',
97164 devDependences: 'devDependencies',
97165 devDepenencies: 'devDependencies',
97166 devEependencies: 'devDependencies',
97167 devdependencies: 'devDependencies',
97168 hampage: 'homepage',
97169 hompage: 'homepage',
97170 prefereGlobal: 'preferGlobal',
97171 publicationConfig: 'publishConfig',
97172 repo: 'repository',
97173 repostitory: 'repository',
97174 script: 'scripts'
97175};
97176
97177/***/ }),
97178/* 545 */
97179/***/ (function(module, exports, __webpack_require__) {
97180
97181"use strict";
97182
97183
97184Object.defineProperty(exports, "__esModule", {
97185 value: true
97186});
97187exports.default = parsePackageName;
97188
97189
97190var PKG_INPUT = /(^\S?[^\s@]+)(?:@(\S+))?$/;
97191
97192function parsePackageName(input) {
97193 var _PKG_INPUT$exec = PKG_INPUT.exec(input),
97194 name = _PKG_INPUT$exec[1],
97195 version = _PKG_INPUT$exec[2];
97196
97197 return { name, version };
97198}
97199
97200/***/ }),
97201/* 546 */
97202/***/ (function(module, exports, __webpack_require__) {
97203
97204"use strict";
97205
97206
97207Object.defineProperty(exports, "__esModule", {
97208 value: true
97209});
97210
97211var _from;
97212
97213function _load_from() {
97214 return _from = _interopRequireDefault(__webpack_require__(53));
97215}
97216
97217var _asyncToGenerator2;
97218
97219function _load_asyncToGenerator() {
97220 return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
97221}
97222
97223var makePortableProxyScriptUnix = function () {
97224 var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (source, destination, options) {
97225 var environment = options.extraEnvironment ? (0, (_from || _load_from()).default)(options.extraEnvironment.entries()).map(function (_ref2) {
97226 var key = _ref2[0],
97227 value = _ref2[1];
97228 return `${key}="${value}"`;
97229 }).join(' ') + ' ' : '';
97230
97231 var prependedArguments = options.prependArguments ? ' ' + options.prependArguments.map(function (arg) {
97232 return `"${arg}"`;
97233 }).join(' ') : '';
97234 var appendedArguments = options.appendArguments ? ' ' + options.appendArguments.map(function (arg) {
97235 return `"${arg}"`;
97236 }).join(' ') : '';
97237
97238 var filePath = `${destination}/${options.proxyBasename || path.basename(source)}`;
97239
97240 // Unless impossible we want to preserve any symlinks used to call us when forwarding the call to the binary (so we
97241 // cannot use realpath or transform relative paths into absolute ones), but we also need to tell the sh interpreter
97242 // that the symlink should be resolved relative to the script directory (hence dirname "$0" at runtime).
97243 var sourcePath = path.isAbsolute(source) ? source : `$(dirname "$0")/../${source}`;
97244
97245 yield (_fs || _load_fs()).mkdirp(destination);
97246
97247 if (process.platform === 'win32') {
97248 yield (_fs || _load_fs()).writeFile(filePath + '.cmd', `@${environment}"${sourcePath}" ${prependedArguments} ${appendedArguments} %*\r\n`);
97249 } else {
97250 yield (_fs || _load_fs()).writeFile(filePath, `#!/bin/sh\n\n${environment}exec "${sourcePath}"${prependedArguments} "$@"${appendedArguments}\n`);
97251 yield (_fs || _load_fs()).chmod(filePath, 0o755);
97252 }
97253 });
97254
97255 return function makePortableProxyScriptUnix(_x, _x2, _x3) {
97256 return _ref.apply(this, arguments);
97257 };
97258}();
97259
97260exports.makePortableProxyScript = makePortableProxyScript;
97261
97262var _fs;
97263
97264function _load_fs() {
97265 return _fs = _interopRequireWildcard(__webpack_require__(8));
97266}
97267
97268function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
97269
97270function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
97271
97272var path = __webpack_require__(1);
97273
97274function makePortableProxyScript(source, destination) {
97275 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
97276
97277 return makePortableProxyScriptUnix(source, destination, options);
97278}
97279
97280/***/ }),
97281/* 547 */
97282/***/ (function(module, exports, __webpack_require__) {
97283
97284"use strict";
97285
97286
97287Object.defineProperty(exports, "__esModule", {
97288 value: true
97289});
97290
97291var _assign;
97292
97293function _load_assign() {
97294 return _assign = _interopRequireDefault(__webpack_require__(23));
97295}
97296
97297exports.findRc = findRc;
97298
97299var _fs;
97300
97301function _load_fs() {
97302 return _fs = __webpack_require__(12);
97303}
97304
97305var _path;
97306
97307function _load_path() {
97308 return _path = _interopRequireWildcard(__webpack_require__(1));
97309}
97310
97311var _constants;
97312
97313function _load_constants() {
97314 return _constants = __webpack_require__(13);
97315}
97316
97317function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
97318
97319function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
97320
97321var etc = '/etc';
97322
97323var isWin = process.platform === 'win32';
97324var home = isWin ? process.env.USERPROFILE : process.env.HOME;
97325
97326function getRcPaths(name, cwd) {
97327 var configPaths = [];
97328
97329 function pushConfigPath() {
97330 for (var _len = arguments.length, segments = Array(_len), _key = 0; _key < _len; _key++) {
97331 segments[_key] = arguments[_key];
97332 }
97333
97334 configPaths.push((_path || _load_path()).join.apply(_path || _load_path(), segments));
97335 if (segments[segments.length - 1] === `.${name}rc`) {
97336 configPaths.push((_path || _load_path()).join.apply(_path || _load_path(), segments.slice(0, -1).concat([`.${name}rc.yml`])));
97337 }
97338 }
97339
97340 function unshiftConfigPath() {
97341 for (var _len2 = arguments.length, segments = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
97342 segments[_key2] = arguments[_key2];
97343 }
97344
97345 if (segments[segments.length - 1] === `.${name}rc`) {
97346 configPaths.unshift((_path || _load_path()).join.apply(_path || _load_path(), segments.slice(0, -1).concat([`.${name}rc.yml`])));
97347 }
97348 configPaths.unshift((_path || _load_path()).join.apply(_path || _load_path(), segments));
97349 }
97350
97351 if (!isWin) {
97352 pushConfigPath(etc, name, 'config');
97353 pushConfigPath(etc, `${name}rc`);
97354 }
97355
97356 if (home) {
97357 pushConfigPath((_constants || _load_constants()).CONFIG_DIRECTORY);
97358 pushConfigPath(home, '.config', name, 'config');
97359 pushConfigPath(home, '.config', name);
97360 pushConfigPath(home, `.${name}`, 'config');
97361 pushConfigPath(home, `.${name}rc`);
97362 }
97363
97364 // add .yarnrc locations relative to the cwd
97365 while (true) {
97366 unshiftConfigPath(cwd, `.${name}rc`);
97367
97368 var upperCwd = (_path || _load_path()).dirname(cwd);
97369 if (upperCwd === cwd) {
97370 // we've reached the root
97371 break;
97372 } else {
97373 // continue since there's still more directories to search
97374 cwd = upperCwd;
97375 }
97376 }
97377
97378 var envVariable = `${name}_config`.toUpperCase();
97379
97380 if (process.env[envVariable]) {
97381 pushConfigPath(process.env[envVariable]);
97382 }
97383
97384 return configPaths;
97385}
97386
97387function parseRcPaths(paths, parser) {
97388 return (_assign || _load_assign()).default.apply(Object, [{}].concat(paths.map(function (path) {
97389 try {
97390 return parser((0, (_fs || _load_fs()).readFileSync)(path).toString(), path);
97391 } catch (error) {
97392 if (error.code === 'ENOENT' || error.code === 'EISDIR') {
97393 return {};
97394 } else {
97395 throw error;
97396 }
97397 }
97398 })));
97399}
97400
97401function findRc(name, cwd, parser) {
97402 return parseRcPaths(getRcPaths(name, cwd), parser);
97403}
97404
97405/***/ }),
97406/* 548 */
97407/***/ (function(module, exports, __webpack_require__) {
97408
97409"use strict";
97410
97411
97412Object.defineProperty(exports, "__esModule", {
97413 value: true
97414});
97415exports.isFakeRoot = isFakeRoot;
97416exports.isRootUser = isRootUser;
97417function getUid() {
97418 if (process.platform !== 'win32' && process.getuid) {
97419 return process.getuid();
97420 }
97421 return null;
97422}
97423
97424exports.default = isRootUser(getUid()) && !isFakeRoot();
97425function isFakeRoot() {
97426 return Boolean(process.env.FAKEROOTKEY);
97427}
97428
97429function isRootUser(uid) {
97430 return uid === 0;
97431}
97432
97433/***/ }),
97434/* 549 */
97435/***/ (function(module, exports, __webpack_require__) {
97436
97437"use strict";
97438
97439
97440Object.defineProperty(exports, "__esModule", {
97441 value: true
97442});
97443exports.getDataDir = getDataDir;
97444exports.getCacheDir = getCacheDir;
97445exports.getConfigDir = getConfigDir;
97446var path = __webpack_require__(1);
97447var userHome = __webpack_require__(101).default;
97448
97449var FALLBACK_CONFIG_DIR = path.join(userHome, '.config', 'yarn');
97450var FALLBACK_CACHE_DIR = path.join(userHome, '.cache', 'yarn');
97451
97452function getDataDir() {
97453 if (process.platform === 'win32') {
97454 var WIN32_APPDATA_DIR = getLocalAppDataDir();
97455 return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path.join(WIN32_APPDATA_DIR, 'Data');
97456 } else if (process.env.XDG_DATA_HOME) {
97457 return path.join(process.env.XDG_DATA_HOME, 'yarn');
97458 } else {
97459 // This could arguably be ~/Library/Application Support/Yarn on Macs,
97460 // but that feels unintuitive for a cli tool
97461
97462 // Instead, use our prior fallback. Some day this could be
97463 // path.join(userHome, '.local', 'share', 'yarn')
97464 // or return path.join(WIN32_APPDATA_DIR, 'Data') on win32
97465 return FALLBACK_CONFIG_DIR;
97466 }
97467}
97468
97469function getCacheDir() {
97470 if (process.platform === 'win32') {
97471 // process.env.TEMP also exists, but most apps put caches here
97472 return path.join(getLocalAppDataDir() || path.join(userHome, 'AppData', 'Local', 'Yarn'), 'Cache');
97473 } else if (process.env.XDG_CACHE_HOME) {
97474 return path.join(process.env.XDG_CACHE_HOME, 'yarn');
97475 } else if (process.platform === 'darwin') {
97476 return path.join(userHome, 'Library', 'Caches', 'Yarn');
97477 } else {
97478 return FALLBACK_CACHE_DIR;
97479 }
97480}
97481
97482function getConfigDir() {
97483 if (process.platform === 'win32') {
97484 // Use our prior fallback. Some day this could be
97485 // return path.join(WIN32_APPDATA_DIR, 'Config')
97486 var WIN32_APPDATA_DIR = getLocalAppDataDir();
97487 return WIN32_APPDATA_DIR == null ? FALLBACK_CONFIG_DIR : path.join(WIN32_APPDATA_DIR, 'Config');
97488 } else if (process.env.XDG_CONFIG_HOME) {
97489 return path.join(process.env.XDG_CONFIG_HOME, 'yarn');
97490 } else {
97491 return FALLBACK_CONFIG_DIR;
97492 }
97493}
97494
97495function getLocalAppDataDir() {
97496 return process.env.LOCALAPPDATA ? path.join(process.env.LOCALAPPDATA, 'Yarn') : null;
97497}
97498
97499/***/ }),
97500/* 550 */
97501/***/ (function(module, exports, __webpack_require__) {
97502
97503module.exports = { "default": __webpack_require__(596), __esModule: true };
97504
97505/***/ }),
97506/* 551 */
97507/***/ (function(module, exports, __webpack_require__) {
97508
97509module.exports = { "default": __webpack_require__(599), __esModule: true };
97510
97511/***/ }),
97512/* 552 */
97513/***/ (function(module, exports, __webpack_require__) {
97514
97515module.exports = { "default": __webpack_require__(601), __esModule: true };
97516
97517/***/ }),
97518/* 553 */
97519/***/ (function(module, exports, __webpack_require__) {
97520
97521module.exports = { "default": __webpack_require__(603), __esModule: true };
97522
97523/***/ }),
97524/* 554 */
97525/***/ (function(module, exports, __webpack_require__) {
97526
97527module.exports = { "default": __webpack_require__(604), __esModule: true };
97528
97529/***/ }),
97530/* 555 */
97531/***/ (function(module, exports, __webpack_require__) {
97532
97533"use strict";
97534
97535module.exports = balanced;
97536function balanced(a, b, str) {
97537 if (a instanceof RegExp) a = maybeMatch(a, str);
97538 if (b instanceof RegExp) b = maybeMatch(b, str);
97539
97540 var r = range(a, b, str);
97541
97542 return r && {
97543 start: r[0],
97544 end: r[1],
97545 pre: str.slice(0, r[0]),
97546 body: str.slice(r[0] + a.length, r[1]),
97547 post: str.slice(r[1] + b.length)
97548 };
97549}
97550
97551function maybeMatch(reg, str) {
97552 var m = str.match(reg);
97553 return m ? m[0] : null;
97554}
97555
97556balanced.range = range;
97557function range(a, b, str) {
97558 var begs, beg, left, right, result;
97559 var ai = str.indexOf(a);
97560 var bi = str.indexOf(b, ai + 1);
97561 var i = ai;
97562
97563 if (ai >= 0 && bi > 0) {
97564 begs = [];
97565 left = str.length;
97566
97567 while (i >= 0 && !result) {
97568 if (i == ai) {
97569 begs.push(i);
97570 ai = str.indexOf(a, i + 1);
97571 } else if (begs.length == 1) {
97572 result = [ begs.pop(), bi ];
97573 } else {
97574 beg = begs.pop();
97575 if (beg < left) {
97576 left = beg;
97577 right = bi;
97578 }
97579
97580 bi = str.indexOf(b, i + 1);
97581 }
97582
97583 i = ai < bi && ai >= 0 ? ai : bi;
97584 }
97585
97586 if (begs.length) {
97587 result = [ left, right ];
97588 }
97589 }
97590
97591 return result;
97592}
97593
97594
97595/***/ }),
97596/* 556 */
97597/***/ (function(module, exports, __webpack_require__) {
97598
97599var DuplexStream = __webpack_require__(863)
97600 , util = __webpack_require__(9)
97601 , Buffer = __webpack_require__(60).Buffer
97602
97603
97604function BufferList (callback) {
97605 if (!(this instanceof BufferList))
97606 return new BufferList(callback)
97607
97608 this._bufs = []
97609 this.length = 0
97610
97611 if (typeof callback == 'function') {
97612 this._callback = callback
97613
97614 var piper = function piper (err) {
97615 if (this._callback) {
97616 this._callback(err)
97617 this._callback = null
97618 }
97619 }.bind(this)
97620
97621 this.on('pipe', function onPipe (src) {
97622 src.on('error', piper)
97623 })
97624 this.on('unpipe', function onUnpipe (src) {
97625 src.removeListener('error', piper)
97626 })
97627 } else {
97628 this.append(callback)
97629 }
97630
97631 DuplexStream.call(this)
97632}
97633
97634
97635util.inherits(BufferList, DuplexStream)
97636
97637
97638BufferList.prototype._offset = function _offset (offset) {
97639 var tot = 0, i = 0, _t
97640 if (offset === 0) return [ 0, 0 ]
97641 for (; i < this._bufs.length; i++) {
97642 _t = tot + this._bufs[i].length
97643 if (offset < _t || i == this._bufs.length - 1)
97644 return [ i, offset - tot ]
97645 tot = _t
97646 }
97647}
97648
97649
97650BufferList.prototype.append = function append (buf) {
97651 var i = 0
97652
97653 if (Buffer.isBuffer(buf)) {
97654 this._appendBuffer(buf);
97655 } else if (Array.isArray(buf)) {
97656 for (; i < buf.length; i++)
97657 this.append(buf[i])
97658 } else if (buf instanceof BufferList) {
97659 // unwrap argument into individual BufferLists
97660 for (; i < buf._bufs.length; i++)
97661 this.append(buf._bufs[i])
97662 } else if (buf != null) {
97663 // coerce number arguments to strings, since Buffer(number) does
97664 // uninitialized memory allocation
97665 if (typeof buf == 'number')
97666 buf = buf.toString()
97667
97668 this._appendBuffer(Buffer.from(buf));
97669 }
97670
97671 return this
97672}
97673
97674
97675BufferList.prototype._appendBuffer = function appendBuffer (buf) {
97676 this._bufs.push(buf)
97677 this.length += buf.length
97678}
97679
97680
97681BufferList.prototype._write = function _write (buf, encoding, callback) {
97682 this._appendBuffer(buf)
97683
97684 if (typeof callback == 'function')
97685 callback()
97686}
97687
97688
97689BufferList.prototype._read = function _read (size) {
97690 if (!this.length)
97691 return this.push(null)
97692
97693 size = Math.min(size, this.length)
97694 this.push(this.slice(0, size))
97695 this.consume(size)
97696}
97697
97698
97699BufferList.prototype.end = function end (chunk) {
97700 DuplexStream.prototype.end.call(this, chunk)
97701
97702 if (this._callback) {
97703 this._callback(null, this.slice())
97704 this._callback = null
97705 }
97706}
97707
97708
97709BufferList.prototype.get = function get (index) {
97710 return this.slice(index, index + 1)[0]
97711}
97712
97713
97714BufferList.prototype.slice = function slice (start, end) {
97715 if (typeof start == 'number' && start < 0)
97716 start += this.length
97717 if (typeof end == 'number' && end < 0)
97718 end += this.length
97719 return this.copy(null, 0, start, end)
97720}
97721
97722
97723BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {
97724 if (typeof srcStart != 'number' || srcStart < 0)
97725 srcStart = 0
97726 if (typeof srcEnd != 'number' || srcEnd > this.length)
97727 srcEnd = this.length
97728 if (srcStart >= this.length)
97729 return dst || Buffer.alloc(0)
97730 if (srcEnd <= 0)
97731 return dst || Buffer.alloc(0)
97732
97733 var copy = !!dst
97734 , off = this._offset(srcStart)
97735 , len = srcEnd - srcStart
97736 , bytes = len
97737 , bufoff = (copy && dstStart) || 0
97738 , start = off[1]
97739 , l
97740 , i
97741
97742 // copy/slice everything
97743 if (srcStart === 0 && srcEnd == this.length) {
97744 if (!copy) { // slice, but full concat if multiple buffers
97745 return this._bufs.length === 1
97746 ? this._bufs[0]
97747 : Buffer.concat(this._bufs, this.length)
97748 }
97749
97750 // copy, need to copy individual buffers
97751 for (i = 0; i < this._bufs.length; i++) {
97752 this._bufs[i].copy(dst, bufoff)
97753 bufoff += this._bufs[i].length
97754 }
97755
97756 return dst
97757 }
97758
97759 // easy, cheap case where it's a subset of one of the buffers
97760 if (bytes <= this._bufs[off[0]].length - start) {
97761 return copy
97762 ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)
97763 : this._bufs[off[0]].slice(start, start + bytes)
97764 }
97765
97766 if (!copy) // a slice, we need something to copy in to
97767 dst = Buffer.allocUnsafe(len)
97768
97769 for (i = off[0]; i < this._bufs.length; i++) {
97770 l = this._bufs[i].length - start
97771
97772 if (bytes > l) {
97773 this._bufs[i].copy(dst, bufoff, start)
97774 } else {
97775 this._bufs[i].copy(dst, bufoff, start, start + bytes)
97776 break
97777 }
97778
97779 bufoff += l
97780 bytes -= l
97781
97782 if (start)
97783 start = 0
97784 }
97785
97786 return dst
97787}
97788
97789BufferList.prototype.shallowSlice = function shallowSlice (start, end) {
97790 start = start || 0
97791 end = end || this.length
97792
97793 if (start < 0)
97794 start += this.length
97795 if (end < 0)
97796 end += this.length
97797
97798 var startOffset = this._offset(start)
97799 , endOffset = this._offset(end)
97800 , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1)
97801
97802 if (endOffset[1] == 0)
97803 buffers.pop()
97804 else
97805 buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1])
97806
97807 if (startOffset[1] != 0)
97808 buffers[0] = buffers[0].slice(startOffset[1])
97809
97810 return new BufferList(buffers)
97811}
97812
97813BufferList.prototype.toString = function toString (encoding, start, end) {
97814 return this.slice(start, end).toString(encoding)
97815}
97816
97817BufferList.prototype.consume = function consume (bytes) {
97818 while (this._bufs.length) {
97819 if (bytes >= this._bufs[0].length) {
97820 bytes -= this._bufs[0].length
97821 this.length -= this._bufs[0].length
97822 this._bufs.shift()
97823 } else {
97824 this._bufs[0] = this._bufs[0].slice(bytes)
97825 this.length -= bytes
97826 break
97827 }
97828 }
97829 return this
97830}
97831
97832
97833BufferList.prototype.duplicate = function duplicate () {
97834 var i = 0
97835 , copy = new BufferList()
97836
97837 for (; i < this._bufs.length; i++)
97838 copy.append(this._bufs[i])
97839
97840 return copy
97841}
97842
97843
97844BufferList.prototype.destroy = function destroy () {
97845 this._bufs.length = 0
97846 this.length = 0
97847 this.push(null)
97848}
97849
97850
97851;(function () {
97852 var methods = {
97853 'readDoubleBE' : 8
97854 , 'readDoubleLE' : 8
97855 , 'readFloatBE' : 4
97856 , 'readFloatLE' : 4
97857 , 'readInt32BE' : 4
97858 , 'readInt32LE' : 4
97859 , 'readUInt32BE' : 4
97860 , 'readUInt32LE' : 4
97861 , 'readInt16BE' : 2
97862 , 'readInt16LE' : 2
97863 , 'readUInt16BE' : 2
97864 , 'readUInt16LE' : 2
97865 , 'readInt8' : 1
97866 , 'readUInt8' : 1
97867 }
97868
97869 for (var m in methods) {
97870 (function (m) {
97871 BufferList.prototype[m] = function (offset) {
97872 return this.slice(offset, offset + methods[m])[m](0)
97873 }
97874 }(m))
97875 }
97876}())
97877
97878
97879module.exports = BufferList
97880
97881
97882/***/ }),
97883/* 557 */
97884/***/ (function(module, exports, __webpack_require__) {
97885
97886var concatMap = __webpack_require__(589);
97887var balanced = __webpack_require__(555);
97888
97889module.exports = expandTop;
97890
97891var escSlash = '\0SLASH'+Math.random()+'\0';
97892var escOpen = '\0OPEN'+Math.random()+'\0';
97893var escClose = '\0CLOSE'+Math.random()+'\0';
97894var escComma = '\0COMMA'+Math.random()+'\0';
97895var escPeriod = '\0PERIOD'+Math.random()+'\0';
97896
97897function numeric(str) {
97898 return parseInt(str, 10) == str
97899 ? parseInt(str, 10)
97900 : str.charCodeAt(0);
97901}
97902
97903function escapeBraces(str) {
97904 return str.split('\\\\').join(escSlash)
97905 .split('\\{').join(escOpen)
97906 .split('\\}').join(escClose)
97907 .split('\\,').join(escComma)
97908 .split('\\.').join(escPeriod);
97909}
97910
97911function unescapeBraces(str) {
97912 return str.split(escSlash).join('\\')
97913 .split(escOpen).join('{')
97914 .split(escClose).join('}')
97915 .split(escComma).join(',')
97916 .split(escPeriod).join('.');
97917}
97918
97919
97920// Basically just str.split(","), but handling cases
97921// where we have nested braced sections, which should be
97922// treated as individual members, like {a,{b,c},d}
97923function parseCommaParts(str) {
97924 if (!str)
97925 return [''];
97926
97927 var parts = [];
97928 var m = balanced('{', '}', str);
97929
97930 if (!m)
97931 return str.split(',');
97932
97933 var pre = m.pre;
97934 var body = m.body;
97935 var post = m.post;
97936 var p = pre.split(',');
97937
97938 p[p.length-1] += '{' + body + '}';
97939 var postParts = parseCommaParts(post);
97940 if (post.length) {
97941 p[p.length-1] += postParts.shift();
97942 p.push.apply(p, postParts);
97943 }
97944
97945 parts.push.apply(parts, p);
97946
97947 return parts;
97948}
97949
97950function expandTop(str) {
97951 if (!str)
97952 return [];
97953
97954 // I don't know why Bash 4.3 does this, but it does.
97955 // Anything starting with {} will have the first two bytes preserved
97956 // but *only* at the top level, so {},a}b will not expand to anything,
97957 // but a{},b}c will be expanded to [a}c,abc].
97958 // One could argue that this is a bug in Bash, but since the goal of
97959 // this module is to match Bash's rules, we escape a leading {}
97960 if (str.substr(0, 2) === '{}') {
97961 str = '\\{\\}' + str.substr(2);
97962 }
97963
97964 return expand(escapeBraces(str), true).map(unescapeBraces);
97965}
97966
97967function identity(e) {
97968 return e;
97969}
97970
97971function embrace(str) {
97972 return '{' + str + '}';
97973}
97974function isPadded(el) {
97975 return /^-?0\d/.test(el);
97976}
97977
97978function lte(i, y) {
97979 return i <= y;
97980}
97981function gte(i, y) {
97982 return i >= y;
97983}
97984
97985function expand(str, isTop) {
97986 var expansions = [];
97987
97988 var m = balanced('{', '}', str);
97989 if (!m || /\$$/.test(m.pre)) return [str];
97990
97991 var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
97992 var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
97993 var isSequence = isNumericSequence || isAlphaSequence;
97994 var isOptions = m.body.indexOf(',') >= 0;
97995 if (!isSequence && !isOptions) {
97996 // {a},b}
97997 if (m.post.match(/,.*\}/)) {
97998 str = m.pre + '{' + m.body + escClose + m.post;
97999 return expand(str);
98000 }
98001 return [str];
98002 }
98003
98004 var n;
98005 if (isSequence) {
98006 n = m.body.split(/\.\./);
98007 } else {
98008 n = parseCommaParts(m.body);
98009 if (n.length === 1) {
98010 // x{{a,b}}y ==> x{a}y x{b}y
98011 n = expand(n[0], false).map(embrace);
98012 if (n.length === 1) {
98013 var post = m.post.length
98014 ? expand(m.post, false)
98015 : [''];
98016 return post.map(function(p) {
98017 return m.pre + n[0] + p;
98018 });
98019 }
98020 }
98021 }
98022
98023 // at this point, n is the parts, and we know it's not a comma set
98024 // with a single entry.
98025
98026 // no need to expand pre, since it is guaranteed to be free of brace-sets
98027 var pre = m.pre;
98028 var post = m.post.length
98029 ? expand(m.post, false)
98030 : [''];
98031
98032 var N;
98033
98034 if (isSequence) {
98035 var x = numeric(n[0]);
98036 var y = numeric(n[1]);
98037 var width = Math.max(n[0].length, n[1].length)
98038 var incr = n.length == 3
98039 ? Math.abs(numeric(n[2]))
98040 : 1;
98041 var test = lte;
98042 var reverse = y < x;
98043 if (reverse) {
98044 incr *= -1;
98045 test = gte;
98046 }
98047 var pad = n.some(isPadded);
98048
98049 N = [];
98050
98051 for (var i = x; test(i, y); i += incr) {
98052 var c;
98053 if (isAlphaSequence) {
98054 c = String.fromCharCode(i);
98055 if (c === '\\')
98056 c = '';
98057 } else {
98058 c = String(i);
98059 if (pad) {
98060 var need = width - c.length;
98061 if (need > 0) {
98062 var z = new Array(need + 1).join('0');
98063 if (i < 0)
98064 c = '-' + z + c.slice(1);
98065 else
98066 c = z + c;
98067 }
98068 }
98069 }
98070 N.push(c);
98071 }
98072 } else {
98073 N = concatMap(n, function(el) { return expand(el, false) });
98074 }
98075
98076 for (var j = 0; j < N.length; j++) {
98077 for (var k = 0; k < post.length; k++) {
98078 var expansion = pre + N[j] + post[k];
98079 if (!isTop || isSequence || expansion)
98080 expansions.push(expansion);
98081 }
98082 }
98083
98084 return expansions;
98085}
98086
98087
98088
98089/***/ }),
98090/* 558 */
98091/***/ (function(module, exports) {
98092
98093function allocUnsafe (size) {
98094 if (typeof size !== 'number') {
98095 throw new TypeError('"size" argument must be a number')
98096 }
98097
98098 if (size < 0) {
98099 throw new RangeError('"size" argument must not be negative')
98100 }
98101
98102 if (Buffer.allocUnsafe) {
98103 return Buffer.allocUnsafe(size)
98104 } else {
98105 return new Buffer(size)
98106 }
98107}
98108
98109module.exports = allocUnsafe
98110
98111
98112/***/ }),
98113/* 559 */
98114/***/ (function(module, exports) {
98115
98116/* Node.js 6.4.0 and up has full support */
98117var hasFullSupport = (function () {
98118 try {
98119 if (!Buffer.isEncoding('latin1')) {
98120 return false
98121 }
98122
98123 var buf = Buffer.alloc ? Buffer.alloc(4) : new Buffer(4)
98124
98125 buf.fill('ab', 'ucs2')
98126
98127 return (buf.toString('hex') === '61006200')
98128 } catch (_) {
98129 return false
98130 }
98131}())
98132
98133function isSingleByte (val) {
98134 return (val.length === 1 && val.charCodeAt(0) < 256)
98135}
98136
98137function fillWithNumber (buffer, val, start, end) {
98138 if (start < 0 || end > buffer.length) {
98139 throw new RangeError('Out of range index')
98140 }
98141
98142 start = start >>> 0
98143 end = end === undefined ? buffer.length : end >>> 0
98144
98145 if (end > start) {
98146 buffer.fill(val, start, end)
98147 }
98148
98149 return buffer
98150}
98151
98152function fillWithBuffer (buffer, val, start, end) {
98153 if (start < 0 || end > buffer.length) {
98154 throw new RangeError('Out of range index')
98155 }
98156
98157 if (end <= start) {
98158 return buffer
98159 }
98160
98161 start = start >>> 0
98162 end = end === undefined ? buffer.length : end >>> 0
98163
98164 var pos = start
98165 var len = val.length
98166 while (pos <= (end - len)) {
98167 val.copy(buffer, pos)
98168 pos += len
98169 }
98170
98171 if (pos !== end) {
98172 val.copy(buffer, pos, 0, end - pos)
98173 }
98174
98175 return buffer
98176}
98177
98178function fill (buffer, val, start, end, encoding) {
98179 if (hasFullSupport) {
98180 return buffer.fill(val, start, end, encoding)
98181 }
98182
98183 if (typeof val === 'number') {
98184 return fillWithNumber(buffer, val, start, end)
98185 }
98186
98187 if (typeof val === 'string') {
98188 if (typeof start === 'string') {
98189 encoding = start
98190 start = 0
98191 end = buffer.length
98192 } else if (typeof end === 'string') {
98193 encoding = end
98194 end = buffer.length
98195 }
98196
98197 if (encoding !== undefined && typeof encoding !== 'string') {
98198 throw new TypeError('encoding must be a string')
98199 }
98200
98201 if (encoding === 'latin1') {
98202 encoding = 'binary'
98203 }
98204
98205 if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
98206 throw new TypeError('Unknown encoding: ' + encoding)
98207 }
98208
98209 if (val === '') {
98210 return fillWithNumber(buffer, 0, start, end)
98211 }
98212
98213 if (isSingleByte(val)) {
98214 return fillWithNumber(buffer, val.charCodeAt(0), start, end)
98215 }
98216
98217 val = new Buffer(val, encoding)
98218 }
98219
98220 if (Buffer.isBuffer(val)) {
98221 return fillWithBuffer(buffer, val, start, end)
98222 }
98223
98224 // Other values (e.g. undefined, boolean, object) results in zero-fill
98225 return fillWithNumber(buffer, 0, start, end)
98226}
98227
98228module.exports = fill
98229
98230
98231/***/ }),
98232/* 560 */
98233/***/ (function(module, exports) {
98234
98235var toString = Object.prototype.toString
98236
98237var isModern = (
98238 typeof Buffer.alloc === 'function' &&
98239 typeof Buffer.allocUnsafe === 'function' &&
98240 typeof Buffer.from === 'function'
98241)
98242
98243function isArrayBuffer (input) {
98244 return toString.call(input).slice(8, -1) === 'ArrayBuffer'
98245}
98246
98247function fromArrayBuffer (obj, byteOffset, length) {
98248 byteOffset >>>= 0
98249
98250 var maxLength = obj.byteLength - byteOffset
98251
98252 if (maxLength < 0) {
98253 throw new RangeError("'offset' is out of bounds")
98254 }
98255
98256 if (length === undefined) {
98257 length = maxLength
98258 } else {
98259 length >>>= 0
98260
98261 if (length > maxLength) {
98262 throw new RangeError("'length' is out of bounds")
98263 }
98264 }
98265
98266 return isModern
98267 ? Buffer.from(obj.slice(byteOffset, byteOffset + length))
98268 : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))
98269}
98270
98271function fromString (string, encoding) {
98272 if (typeof encoding !== 'string' || encoding === '') {
98273 encoding = 'utf8'
98274 }
98275
98276 if (!Buffer.isEncoding(encoding)) {
98277 throw new TypeError('"encoding" must be a valid string encoding')
98278 }
98279
98280 return isModern
98281 ? Buffer.from(string, encoding)
98282 : new Buffer(string, encoding)
98283}
98284
98285function bufferFrom (value, encodingOrOffset, length) {
98286 if (typeof value === 'number') {
98287 throw new TypeError('"value" argument must not be a number')
98288 }
98289
98290 if (isArrayBuffer(value)) {
98291 return fromArrayBuffer(value, encodingOrOffset, length)
98292 }
98293
98294 if (typeof value === 'string') {
98295 return fromString(value, encodingOrOffset)
98296 }
98297
98298 return isModern
98299 ? Buffer.from(value)
98300 : new Buffer(value)
98301}
98302
98303module.exports = bufferFrom
98304
98305
98306/***/ }),
98307/* 561 */
98308/***/ (function(module, exports, __webpack_require__) {
98309
98310"use strict";
98311/*!
98312 * bytes
98313 * Copyright(c) 2012-2014 TJ Holowaychuk
98314 * Copyright(c) 2015 Jed Watson
98315 * MIT Licensed
98316 */
98317
98318
98319
98320/**
98321 * Module exports.
98322 * @public
98323 */
98324
98325module.exports = bytes;
98326module.exports.format = format;
98327module.exports.parse = parse;
98328
98329/**
98330 * Module variables.
98331 * @private
98332 */
98333
98334var formatThousandsRegExp = /\B(?=(\d{3})+(?!\d))/g;
98335
98336var formatDecimalsRegExp = /(?:\.0*|(\.[^0]+)0+)$/;
98337
98338var map = {
98339 b: 1,
98340 kb: 1 << 10,
98341 mb: 1 << 20,
98342 gb: 1 << 30,
98343 tb: ((1 << 30) * 1024)
98344};
98345
98346var parseRegExp = /^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb)$/i;
98347
98348/**
98349 * Convert the given value in bytes into a string or parse to string to an integer in bytes.
98350 *
98351 * @param {string|number} value
98352 * @param {{
98353 * case: [string],
98354 * decimalPlaces: [number]
98355 * fixedDecimals: [boolean]
98356 * thousandsSeparator: [string]
98357 * unitSeparator: [string]
98358 * }} [options] bytes options.
98359 *
98360 * @returns {string|number|null}
98361 */
98362
98363function bytes(value, options) {
98364 if (typeof value === 'string') {
98365 return parse(value);
98366 }
98367
98368 if (typeof value === 'number') {
98369 return format(value, options);
98370 }
98371
98372 return null;
98373}
98374
98375/**
98376 * Format the given value in bytes into a string.
98377 *
98378 * If the value is negative, it is kept as such. If it is a float,
98379 * it is rounded.
98380 *
98381 * @param {number} value
98382 * @param {object} [options]
98383 * @param {number} [options.decimalPlaces=2]
98384 * @param {number} [options.fixedDecimals=false]
98385 * @param {string} [options.thousandsSeparator=]
98386 * @param {string} [options.unit=]
98387 * @param {string} [options.unitSeparator=]
98388 *
98389 * @returns {string|null}
98390 * @public
98391 */
98392
98393function format(value, options) {
98394 if (!Number.isFinite(value)) {
98395 return null;
98396 }
98397
98398 var mag = Math.abs(value);
98399 var thousandsSeparator = (options && options.thousandsSeparator) || '';
98400 var unitSeparator = (options && options.unitSeparator) || '';
98401 var decimalPlaces = (options && options.decimalPlaces !== undefined) ? options.decimalPlaces : 2;
98402 var fixedDecimals = Boolean(options && options.fixedDecimals);
98403 var unit = (options && options.unit) || '';
98404
98405 if (!unit || !map[unit.toLowerCase()]) {
98406 if (mag >= map.tb) {
98407 unit = 'TB';
98408 } else if (mag >= map.gb) {
98409 unit = 'GB';
98410 } else if (mag >= map.mb) {
98411 unit = 'MB';
98412 } else if (mag >= map.kb) {
98413 unit = 'KB';
98414 } else {
98415 unit = 'B';
98416 }
98417 }
98418
98419 var val = value / map[unit.toLowerCase()];
98420 var str = val.toFixed(decimalPlaces);
98421
98422 if (!fixedDecimals) {
98423 str = str.replace(formatDecimalsRegExp, '$1');
98424 }
98425
98426 if (thousandsSeparator) {
98427 str = str.replace(formatThousandsRegExp, thousandsSeparator);
98428 }
98429
98430 return str + unitSeparator + unit;
98431}
98432
98433/**
98434 * Parse the string value into an integer in bytes.
98435 *
98436 * If no unit is given, it is assumed the value is in bytes.
98437 *
98438 * @param {number|string} val
98439 *
98440 * @returns {number|null}
98441 * @public
98442 */
98443
98444function parse(val) {
98445 if (typeof val === 'number' && !isNaN(val)) {
98446 return val;
98447 }
98448
98449 if (typeof val !== 'string') {
98450 return null;
98451 }
98452
98453 // Test if the string passed is valid
98454 var results = parseRegExp.exec(val);
98455 var floatValue;
98456 var unit = 'b';
98457
98458 if (!results) {
98459 // Nothing could be extracted from the given string
98460 floatValue = parseInt(val, 10);
98461 unit = 'b'
98462 } else {
98463 // Retrieve the value and the unit
98464 floatValue = parseFloat(results[1]);
98465 unit = results[4].toLowerCase();
98466 }
98467
98468 return Math.floor(map[unit] * floatValue);
98469}
98470
98471
98472/***/ }),
98473/* 562 */
98474/***/ (function(module, exports, __webpack_require__) {
98475
98476"use strict";
98477
98478
98479function preserveCamelCase(str) {
98480 let isLastCharLower = false;
98481 let isLastCharUpper = false;
98482 let isLastLastCharUpper = false;
98483
98484 for (let i = 0; i < str.length; i++) {
98485 const c = str[i];
98486
98487 if (isLastCharLower && /[a-zA-Z]/.test(c) && c.toUpperCase() === c) {
98488 str = str.substr(0, i) + '-' + str.substr(i);
98489 isLastCharLower = false;
98490 isLastLastCharUpper = isLastCharUpper;
98491 isLastCharUpper = true;
98492 i++;
98493 } else if (isLastCharUpper && isLastLastCharUpper && /[a-zA-Z]/.test(c) && c.toLowerCase() === c) {
98494 str = str.substr(0, i - 1) + '-' + str.substr(i - 1);
98495 isLastLastCharUpper = isLastCharUpper;
98496 isLastCharUpper = false;
98497 isLastCharLower = true;
98498 } else {
98499 isLastCharLower = c.toLowerCase() === c;
98500 isLastLastCharUpper = isLastCharUpper;
98501 isLastCharUpper = c.toUpperCase() === c;
98502 }
98503 }
98504
98505 return str;
98506}
98507
98508module.exports = function (str) {
98509 if (arguments.length > 1) {
98510 str = Array.from(arguments)
98511 .map(x => x.trim())
98512 .filter(x => x.length)
98513 .join('-');
98514 } else {
98515 str = str.trim();
98516 }
98517
98518 if (str.length === 0) {
98519 return '';
98520 }
98521
98522 if (str.length === 1) {
98523 return str.toLowerCase();
98524 }
98525
98526 if (/^[a-z0-9]+$/.test(str)) {
98527 return str;
98528 }
98529
98530 const hasUpperCase = str !== str.toLowerCase();
98531
98532 if (hasUpperCase) {
98533 str = preserveCamelCase(str);
98534 }
98535
98536 return str
98537 .replace(/^[_.\- ]+/, '')
98538 .toLowerCase()
98539 .replace(/[_.\- ]+(\w|$)/g, (m, p1) => p1.toUpperCase());
98540};
98541
98542
98543/***/ }),
98544/* 563 */
98545/***/ (function(module, exports, __webpack_require__) {
98546
98547"use strict";
98548
98549module.exports = (flag, argv) => {
98550 argv = argv || process.argv;
98551 const prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');
98552 const pos = argv.indexOf(prefix + flag);
98553 const terminatorPos = argv.indexOf('--');
98554 return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
98555};
98556
98557
98558/***/ }),
98559/* 564 */
98560/***/ (function(module, exports, __webpack_require__) {
98561
98562"use strict";
98563
98564const os = __webpack_require__(72);
98565const hasFlag = __webpack_require__(563);
98566
98567const env = process.env;
98568
98569let forceColor;
98570if (hasFlag('no-color') ||
98571 hasFlag('no-colors') ||
98572 hasFlag('color=false')) {
98573 forceColor = false;
98574} else if (hasFlag('color') ||
98575 hasFlag('colors') ||
98576 hasFlag('color=true') ||
98577 hasFlag('color=always')) {
98578 forceColor = true;
98579}
98580if ('FORCE_COLOR' in env) {
98581 forceColor = env.FORCE_COLOR.length === 0 || parseInt(env.FORCE_COLOR, 10) !== 0;
98582}
98583
98584function translateLevel(level) {
98585 if (level === 0) {
98586 return false;
98587 }
98588
98589 return {
98590 level,
98591 hasBasic: true,
98592 has256: level >= 2,
98593 has16m: level >= 3
98594 };
98595}
98596
98597function supportsColor(stream) {
98598 if (forceColor === false) {
98599 return 0;
98600 }
98601
98602 if (hasFlag('color=16m') ||
98603 hasFlag('color=full') ||
98604 hasFlag('color=truecolor')) {
98605 return 3;
98606 }
98607
98608 if (hasFlag('color=256')) {
98609 return 2;
98610 }
98611
98612 if (stream && !stream.isTTY && forceColor !== true) {
98613 return 0;
98614 }
98615
98616 const min = forceColor ? 1 : 0;
98617
98618 if (process.platform === 'win32') {
98619 // Node.js 7.5.0 is the first version of Node.js to include a patch to
98620 // libuv that enables 256 color output on Windows. Anything earlier and it
98621 // won't work. However, here we target Node.js 8 at minimum as it is an LTS
98622 // release, and Node.js 7 is not. Windows 10 build 10586 is the first Windows
98623 // release that supports 256 colors. Windows 10 build 14931 is the first release
98624 // that supports 16m/TrueColor.
98625 const osRelease = os.release().split('.');
98626 if (
98627 Number(process.versions.node.split('.')[0]) >= 8 &&
98628 Number(osRelease[0]) >= 10 &&
98629 Number(osRelease[2]) >= 10586
98630 ) {
98631 return Number(osRelease[2]) >= 14931 ? 3 : 2;
98632 }
98633
98634 return 1;
98635 }
98636
98637 if ('CI' in env) {
98638 if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(sign => sign in env) || env.CI_NAME === 'codeship') {
98639 return 1;
98640 }
98641
98642 return min;
98643 }
98644
98645 if ('TEAMCITY_VERSION' in env) {
98646 return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
98647 }
98648
98649 if (env.COLORTERM === 'truecolor') {
98650 return 3;
98651 }
98652
98653 if ('TERM_PROGRAM' in env) {
98654 const version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
98655
98656 switch (env.TERM_PROGRAM) {
98657 case 'iTerm.app':
98658 return version >= 3 ? 3 : 2;
98659 case 'Apple_Terminal':
98660 return 2;
98661 // No default
98662 }
98663 }
98664
98665 if (/-256(color)?$/i.test(env.TERM)) {
98666 return 2;
98667 }
98668
98669 if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
98670 return 1;
98671 }
98672
98673 if ('COLORTERM' in env) {
98674 return 1;
98675 }
98676
98677 if (env.TERM === 'dumb') {
98678 return min;
98679 }
98680
98681 return min;
98682}
98683
98684function getSupportLevel(stream) {
98685 const level = supportsColor(stream);
98686 return translateLevel(level);
98687}
98688
98689module.exports = {
98690 supportsColor: getSupportLevel,
98691 stdout: getSupportLevel(process.stdout),
98692 stderr: getSupportLevel(process.stderr)
98693};
98694
98695
98696/***/ }),
98697/* 565 */
98698/***/ (function(module, exports, __webpack_require__) {
98699
98700"use strict";
98701
98702const TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
98703const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
98704const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
98705const ESCAPE_REGEX = /\\(u[a-f\d]{4}|x[a-f\d]{2}|.)|([^\\])/gi;
98706
98707const ESCAPES = new Map([
98708 ['n', '\n'],
98709 ['r', '\r'],
98710 ['t', '\t'],
98711 ['b', '\b'],
98712 ['f', '\f'],
98713 ['v', '\v'],
98714 ['0', '\0'],
98715 ['\\', '\\'],
98716 ['e', '\u001B'],
98717 ['a', '\u0007']
98718]);
98719
98720function unescape(c) {
98721 if ((c[0] === 'u' && c.length === 5) || (c[0] === 'x' && c.length === 3)) {
98722 return String.fromCharCode(parseInt(c.slice(1), 16));
98723 }
98724
98725 return ESCAPES.get(c) || c;
98726}
98727
98728function parseArguments(name, args) {
98729 const results = [];
98730 const chunks = args.trim().split(/\s*,\s*/g);
98731 let matches;
98732
98733 for (const chunk of chunks) {
98734 if (!isNaN(chunk)) {
98735 results.push(Number(chunk));
98736 } else if ((matches = chunk.match(STRING_REGEX))) {
98737 results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, chr) => escape ? unescape(escape) : chr));
98738 } else {
98739 throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
98740 }
98741 }
98742
98743 return results;
98744}
98745
98746function parseStyle(style) {
98747 STYLE_REGEX.lastIndex = 0;
98748
98749 const results = [];
98750 let matches;
98751
98752 while ((matches = STYLE_REGEX.exec(style)) !== null) {
98753 const name = matches[1];
98754
98755 if (matches[2]) {
98756 const args = parseArguments(name, matches[2]);
98757 results.push([name].concat(args));
98758 } else {
98759 results.push([name]);
98760 }
98761 }
98762
98763 return results;
98764}
98765
98766function buildStyle(chalk, styles) {
98767 const enabled = {};
98768
98769 for (const layer of styles) {
98770 for (const style of layer.styles) {
98771 enabled[style[0]] = layer.inverse ? null : style.slice(1);
98772 }
98773 }
98774
98775 let current = chalk;
98776 for (const styleName of Object.keys(enabled)) {
98777 if (Array.isArray(enabled[styleName])) {
98778 if (!(styleName in current)) {
98779 throw new Error(`Unknown Chalk style: ${styleName}`);
98780 }
98781
98782 if (enabled[styleName].length > 0) {
98783 current = current[styleName].apply(current, enabled[styleName]);
98784 } else {
98785 current = current[styleName];
98786 }
98787 }
98788 }
98789
98790 return current;
98791}
98792
98793module.exports = (chalk, tmp) => {
98794 const styles = [];
98795 const chunks = [];
98796 let chunk = [];
98797
98798 // eslint-disable-next-line max-params
98799 tmp.replace(TEMPLATE_REGEX, (m, escapeChar, inverse, style, close, chr) => {
98800 if (escapeChar) {
98801 chunk.push(unescape(escapeChar));
98802 } else if (style) {
98803 const str = chunk.join('');
98804 chunk = [];
98805 chunks.push(styles.length === 0 ? str : buildStyle(chalk, styles)(str));
98806 styles.push({inverse, styles: parseStyle(style)});
98807 } else if (close) {
98808 if (styles.length === 0) {
98809 throw new Error('Found extraneous } in Chalk template literal');
98810 }
98811
98812 chunks.push(buildStyle(chalk, styles)(chunk.join('')));
98813 chunk = [];
98814 styles.pop();
98815 } else {
98816 chunk.push(chr);
98817 }
98818 });
98819
98820 chunks.push(chunk.join(''));
98821
98822 if (styles.length > 0) {
98823 const errMsg = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? '' : 's'} (\`}\`)`;
98824 throw new Error(errMsg);
98825 }
98826
98827 return chunks.join('');
98828};
98829
98830
98831/***/ }),
98832/* 566 */
98833/***/ (function(module, exports, __webpack_require__) {
98834
98835module.exports = chownr
98836chownr.sync = chownrSync
98837
98838var fs = __webpack_require__(12)
98839, path = __webpack_require__(1)
98840
98841function chownr (p, uid, gid, cb) {
98842 fs.readdir(p, function (er, children) {
98843 // any error other than ENOTDIR means it's not readable, or
98844 // doesn't exist. give up.
98845 if (er && er.code !== "ENOTDIR") return cb(er)
98846 if (er || !children.length) return fs.chown(p, uid, gid, cb)
98847
98848 var len = children.length
98849 , errState = null
98850 children.forEach(function (child) {
98851 var pathChild = path.resolve(p, child);
98852 fs.lstat(pathChild, function(er, stats) {
98853 if (er)
98854 return cb(er)
98855 if (!stats.isSymbolicLink())
98856 chownr(pathChild, uid, gid, then)
98857 else
98858 then()
98859 })
98860 })
98861 function then (er) {
98862 if (errState) return
98863 if (er) return cb(errState = er)
98864 if (-- len === 0) return fs.chown(p, uid, gid, cb)
98865 }
98866 })
98867}
98868
98869function chownrSync (p, uid, gid) {
98870 var children
98871 try {
98872 children = fs.readdirSync(p)
98873 } catch (er) {
98874 if (er && er.code === "ENOTDIR") return fs.chownSync(p, uid, gid)
98875 throw er
98876 }
98877 if (!children.length) return fs.chownSync(p, uid, gid)
98878
98879 children.forEach(function (child) {
98880 var pathChild = path.resolve(p, child)
98881 var stats = fs.lstatSync(pathChild)
98882 if (!stats.isSymbolicLink())
98883 chownrSync(pathChild, uid, gid)
98884 })
98885 return fs.chownSync(p, uid, gid)
98886}
98887
98888
98889/***/ }),
98890/* 567 */
98891/***/ (function(module, exports, __webpack_require__) {
98892
98893"use strict";
98894
98895
98896var env = process.env
98897
98898var vendors = [
98899 // Constant, Name, Envs
98900 ['TRAVIS', 'Travis CI', 'TRAVIS'],
98901 ['CIRCLE', 'CircleCI', 'CIRCLECI'],
98902 ['GITLAB', 'GitLab CI', 'GITLAB_CI'],
98903 ['APPVEYOR', 'AppVeyor', 'APPVEYOR'],
98904 ['CODESHIP', 'Codeship', {CI_NAME: 'codeship'}],
98905 ['DRONE', 'Drone', 'DRONE'],
98906 ['MAGNUM', 'Magnum CI', 'MAGNUM'],
98907 ['SEMAPHORE', 'Semaphore', 'SEMAPHORE'],
98908 ['JENKINS', 'Jenkins', 'JENKINS_URL', 'BUILD_ID'],
98909 ['BAMBOO', 'Bamboo', 'bamboo_planKey'],
98910 ['TFS', 'Team Foundation Server', 'TF_BUILD'],
98911 ['TEAMCITY', 'TeamCity', 'TEAMCITY_VERSION'],
98912 ['BUILDKITE', 'Buildkite', 'BUILDKITE'],
98913 ['HUDSON', 'Hudson', 'HUDSON_URL'],
98914 ['TASKCLUSTER', 'TaskCluster', 'TASK_ID', 'RUN_ID'],
98915 ['GOCD', 'GoCD', 'GO_PIPELINE_LABEL'],
98916 ['BITBUCKET', 'Bitbucket Pipelines', 'BITBUCKET_COMMIT'],
98917 ['CODEBUILD', 'AWS CodeBuild', 'CODEBUILD_BUILD_ARN']
98918]
98919
98920exports.name = null
98921
98922vendors.forEach(function (vendor) {
98923 var constant = vendor.shift()
98924 var name = vendor.shift()
98925 var isCI = vendor.every(function (obj) {
98926 if (typeof obj === 'string') return !!env[obj]
98927 return Object.keys(obj).every(function (k) {
98928 return env[k] === obj[k]
98929 })
98930 })
98931 exports[constant] = isCI
98932 if (isCI) exports.name = name
98933})
98934
98935exports.isCI = !!(
98936 env.CI || // Travis CI, CircleCI, Gitlab CI, Appveyor, CodeShip
98937 env.CONTINUOUS_INTEGRATION || // Travis CI
98938 env.BUILD_NUMBER || // Jenkins, TeamCity
98939 exports.name ||
98940 false
98941)
98942
98943
98944/***/ }),
98945/* 568 */
98946/***/ (function(module, exports, __webpack_require__) {
98947
98948module.exports = __webpack_require__(571);
98949
98950/***/ }),
98951/* 569 */
98952/***/ (function(module, exports, __webpack_require__) {
98953
98954var kindOf = __webpack_require__(169);
98955var utils = __webpack_require__(320);
98956
98957/**
98958 * A representation of a cell within the table.
98959 * Implementations must have `init` and `draw` methods,
98960 * as well as `colSpan`, `rowSpan`, `desiredHeight` and `desiredWidth` properties.
98961 * @param options
98962 * @constructor
98963 */
98964function Cell(options){
98965 this.setOptions(options);
98966}
98967
98968Cell.prototype.setOptions = function(options){
98969 if(['boolean', 'number', 'string'].indexOf(kindOf(options)) !== -1){
98970 options = {content:''+options};
98971 }
98972 options = options || {};
98973 this.options = options;
98974 var content = options.content;
98975 if (['boolean', 'number', 'string'].indexOf(kindOf(content)) !== -1) {
98976 this.content = String(content);
98977 } else if (!content) {
98978 this.content = '';
98979 } else {
98980 throw new Error('Content needs to be a primitive, got: ' + (typeof content));
98981 }
98982 this.colSpan = options.colSpan || 1;
98983 this.rowSpan = options.rowSpan || 1;
98984};
98985
98986Cell.prototype.mergeTableOptions = function(tableOptions,cells){
98987 this.cells = cells;
98988
98989 var optionsChars = this.options.chars || {};
98990 var tableChars = tableOptions.chars;
98991 var chars = this.chars = {};
98992 CHAR_NAMES.forEach(function(name){
98993 setOption(optionsChars,tableChars,name,chars);
98994 });
98995
98996 this.truncate = this.options.truncate || tableOptions.truncate;
98997
98998 var style = this.options.style = this.options.style || {};
98999 var tableStyle = tableOptions.style;
99000 setOption(style, tableStyle, 'padding-left', this);
99001 setOption(style, tableStyle, 'padding-right', this);
99002 this.head = style.head || tableStyle.head;
99003 this.border = style.border || tableStyle.border;
99004
99005 var fixedWidth = tableOptions.colWidths[this.x];
99006 if(tableOptions.wordWrap && fixedWidth){
99007 fixedWidth -= this.paddingLeft + this.paddingRight;
99008 if(this.colSpan){
99009 var i = 1;
99010 while(i<this.colSpan){
99011 fixedWidth += tableOptions.colWidths[this.x + i];
99012 i++;
99013 }
99014 }
99015 this.lines = utils.colorizeLines(utils.wordWrap(fixedWidth,this.content));
99016 }
99017 else {
99018 this.lines = utils.colorizeLines(this.content.split('\n'));
99019 }
99020
99021 this.desiredWidth = utils.strlen(this.content) + this.paddingLeft + this.paddingRight;
99022 this.desiredHeight = this.lines.length;
99023};
99024
99025/**
99026 * Each cell will have it's `x` and `y` values set by the `layout-manager` prior to
99027 * `init` being called;
99028 * @type {Number}
99029 */
99030
99031Cell.prototype.x = null;
99032Cell.prototype.y = null;
99033
99034/**
99035 * Initializes the Cells data structure.
99036 *
99037 * @param tableOptions - A fully populated set of tableOptions.
99038 * In addition to the standard default values, tableOptions must have fully populated the
99039 * `colWidths` and `rowWidths` arrays. Those arrays must have lengths equal to the number
99040 * of columns or rows (respectively) in this table, and each array item must be a Number.
99041 *
99042 */
99043Cell.prototype.init = function(tableOptions){
99044 var x = this.x;
99045 var y = this.y;
99046 this.widths = tableOptions.colWidths.slice(x, x + this.colSpan);
99047 this.heights = tableOptions.rowHeights.slice(y, y + this.rowSpan);
99048 this.width = this.widths.reduce(sumPlusOne, -1);
99049 this.height = this.heights.reduce(sumPlusOne, -1);
99050
99051 this.hAlign = this.options.hAlign || tableOptions.colAligns[x];
99052 this.vAlign = this.options.vAlign || tableOptions.rowAligns[y];
99053
99054 this.drawRight = x + this.colSpan == tableOptions.colWidths.length;
99055};
99056
99057/**
99058 * Draws the given line of the cell.
99059 * This default implementation defers to methods `drawTop`, `drawBottom`, `drawLine` and `drawEmpty`.
99060 * @param lineNum - can be `top`, `bottom` or a numerical line number.
99061 * @param spanningCell - will be a number if being called from a RowSpanCell, and will represent how
99062 * many rows below it's being called from. Otherwise it's undefined.
99063 * @returns {String} The representation of this line.
99064 */
99065Cell.prototype.draw = function(lineNum,spanningCell){
99066 if(lineNum == 'top') return this.drawTop(this.drawRight);
99067 if(lineNum == 'bottom') return this.drawBottom(this.drawRight);
99068 var padLen = Math.max(this.height - this.lines.length, 0);
99069 var padTop;
99070 switch (this.vAlign){
99071 case 'center':
99072 padTop = Math.ceil(padLen / 2);
99073 break;
99074 case 'bottom':
99075 padTop = padLen;
99076 break;
99077 default :
99078 padTop = 0;
99079 }
99080 if( (lineNum < padTop) || (lineNum >= (padTop + this.lines.length))){
99081 return this.drawEmpty(this.drawRight,spanningCell);
99082 }
99083 var forceTruncation = (this.lines.length > this.height) && (lineNum + 1 >= this.height);
99084 return this.drawLine(lineNum - padTop, this.drawRight, forceTruncation,spanningCell);
99085};
99086
99087/**
99088 * Renders the top line of the cell.
99089 * @param drawRight - true if this method should render the right edge of the cell.
99090 * @returns {String}
99091 */
99092Cell.prototype.drawTop = function(drawRight){
99093 var content = [];
99094 if(this.cells){ //TODO: cells should always exist - some tests don't fill it in though
99095 this.widths.forEach(function(width,index){
99096 content.push(this._topLeftChar(index));
99097 content.push(
99098 utils.repeat(this.chars[this.y == 0 ? 'top' : 'mid'],width)
99099 );
99100 },this);
99101 }
99102 else {
99103 content.push(this._topLeftChar(0));
99104 content.push(utils.repeat(this.chars[this.y == 0 ? 'top' : 'mid'],this.width));
99105 }
99106 if(drawRight){
99107 content.push(this.chars[this.y == 0 ? 'topRight' : 'rightMid']);
99108 }
99109 return this.wrapWithStyleColors('border',content.join(''));
99110};
99111
99112Cell.prototype._topLeftChar = function(offset){
99113 var x = this.x+offset;
99114 var leftChar;
99115 if(this.y == 0){
99116 leftChar = x == 0 ? 'topLeft' : (offset == 0 ? 'topMid' : 'top');
99117 } else {
99118 if(x == 0){
99119 leftChar = 'leftMid';
99120 }
99121 else {
99122 leftChar = offset == 0 ? 'midMid' : 'bottomMid';
99123 if(this.cells){ //TODO: cells should always exist - some tests don't fill it in though
99124 var spanAbove = this.cells[this.y-1][x] instanceof Cell.ColSpanCell;
99125 if(spanAbove){
99126 leftChar = offset == 0 ? 'topMid' : 'mid';
99127 }
99128 if(offset == 0){
99129 var i = 1;
99130 while(this.cells[this.y][x-i] instanceof Cell.ColSpanCell){
99131 i++;
99132 }
99133 if(this.cells[this.y][x-i] instanceof Cell.RowSpanCell){
99134 leftChar = 'leftMid';
99135 }
99136 }
99137 }
99138 }
99139 }
99140 return this.chars[leftChar];
99141};
99142
99143Cell.prototype.wrapWithStyleColors = function(styleProperty,content){
99144 if(this[styleProperty] && this[styleProperty].length){
99145 try {
99146 var colors = __webpack_require__(587);
99147 for(var i = this[styleProperty].length - 1; i >= 0; i--){
99148 colors = colors[this[styleProperty][i]];
99149 }
99150 return colors(content);
99151 } catch (e) {
99152 return content;
99153 }
99154 }
99155 else {
99156 return content;
99157 }
99158};
99159
99160/**
99161 * Renders a line of text.
99162 * @param lineNum - Which line of text to render. This is not necessarily the line within the cell.
99163 * There may be top-padding above the first line of text.
99164 * @param drawRight - true if this method should render the right edge of the cell.
99165 * @param forceTruncationSymbol - `true` if the rendered text should end with the truncation symbol even
99166 * if the text fits. This is used when the cell is vertically truncated. If `false` the text should
99167 * only include the truncation symbol if the text will not fit horizontally within the cell width.
99168 * @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined.
99169 * @returns {String}
99170 */
99171Cell.prototype.drawLine = function(lineNum,drawRight,forceTruncationSymbol,spanningCell){
99172 var left = this.chars[this.x == 0 ? 'left' : 'middle'];
99173 if(this.x && spanningCell && this.cells){
99174 var cellLeft = this.cells[this.y+spanningCell][this.x-1];
99175 while(cellLeft instanceof ColSpanCell){
99176 cellLeft = this.cells[cellLeft.y][cellLeft.x-1];
99177 }
99178 if(!(cellLeft instanceof RowSpanCell)){
99179 left = this.chars['rightMid'];
99180 }
99181 }
99182 var leftPadding = utils.repeat(' ', this.paddingLeft);
99183 var right = (drawRight ? this.chars['right'] : '');
99184 var rightPadding = utils.repeat(' ', this.paddingRight);
99185 var line = this.lines[lineNum];
99186 var len = this.width - (this.paddingLeft + this.paddingRight);
99187 if(forceTruncationSymbol) line += this.truncate || '…';
99188 var content = utils.truncate(line,len,this.truncate);
99189 content = utils.pad(content, len, ' ', this.hAlign);
99190 content = leftPadding + content + rightPadding;
99191 return this.stylizeLine(left,content,right);
99192};
99193
99194Cell.prototype.stylizeLine = function(left,content,right){
99195 left = this.wrapWithStyleColors('border',left);
99196 right = this.wrapWithStyleColors('border',right);
99197 if(this.y === 0){
99198 content = this.wrapWithStyleColors('head',content);
99199 }
99200 return left + content + right;
99201};
99202
99203/**
99204 * Renders the bottom line of the cell.
99205 * @param drawRight - true if this method should render the right edge of the cell.
99206 * @returns {String}
99207 */
99208Cell.prototype.drawBottom = function(drawRight){
99209 var left = this.chars[this.x == 0 ? 'bottomLeft' : 'bottomMid'];
99210 var content = utils.repeat(this.chars.bottom,this.width);
99211 var right = drawRight ? this.chars['bottomRight'] : '';
99212 return this.wrapWithStyleColors('border',left + content + right);
99213};
99214
99215/**
99216 * Renders a blank line of text within the cell. Used for top and/or bottom padding.
99217 * @param drawRight - true if this method should render the right edge of the cell.
99218 * @param spanningCell - a number of if being called from a RowSpanCell. (how many rows below). otherwise undefined.
99219 * @returns {String}
99220 */
99221Cell.prototype.drawEmpty = function(drawRight,spanningCell){
99222 var left = this.chars[this.x == 0 ? 'left' : 'middle'];
99223 if(this.x && spanningCell && this.cells){
99224 var cellLeft = this.cells[this.y+spanningCell][this.x-1];
99225 while(cellLeft instanceof ColSpanCell){
99226 cellLeft = this.cells[cellLeft.y][cellLeft.x-1];
99227 }
99228 if(!(cellLeft instanceof RowSpanCell)){
99229 left = this.chars['rightMid'];
99230 }
99231 }
99232 var right = (drawRight ? this.chars['right'] : '');
99233 var content = utils.repeat(' ',this.width);
99234 return this.stylizeLine(left , content , right);
99235};
99236
99237/**
99238 * A Cell that doesn't do anything. It just draws empty lines.
99239 * Used as a placeholder in column spanning.
99240 * @constructor
99241 */
99242function ColSpanCell(){}
99243
99244ColSpanCell.prototype.draw = function(){
99245 return '';
99246};
99247
99248ColSpanCell.prototype.init = function(tableOptions){};
99249
99250
99251/**
99252 * A placeholder Cell for a Cell that spans multiple rows.
99253 * It delegates rendering to the original cell, but adds the appropriate offset.
99254 * @param originalCell
99255 * @constructor
99256 */
99257function RowSpanCell(originalCell){
99258 this.originalCell = originalCell;
99259}
99260
99261RowSpanCell.prototype.init = function(tableOptions){
99262 var y = this.y;
99263 var originalY = this.originalCell.y;
99264 this.cellOffset = y - originalY;
99265 this.offset = findDimension(tableOptions.rowHeights,originalY,this.cellOffset);
99266};
99267
99268RowSpanCell.prototype.draw = function(lineNum){
99269 if(lineNum == 'top'){
99270 return this.originalCell.draw(this.offset,this.cellOffset);
99271 }
99272 if(lineNum == 'bottom'){
99273 return this.originalCell.draw('bottom');
99274 }
99275 return this.originalCell.draw(this.offset + 1 + lineNum);
99276};
99277
99278ColSpanCell.prototype.mergeTableOptions =
99279RowSpanCell.prototype.mergeTableOptions = function(){};
99280
99281// HELPER FUNCTIONS
99282function setOption(objA,objB,nameB,targetObj){
99283 var nameA = nameB.split('-');
99284 if(nameA.length > 1) {
99285 nameA[1] = nameA[1].charAt(0).toUpperCase() + nameA[1].substr(1);
99286 nameA = nameA.join('');
99287 targetObj[nameA] = objA[nameA] || objA[nameB] || objB[nameA] || objB[nameB];
99288 }
99289 else {
99290 targetObj[nameB] = objA[nameB] || objB[nameB];
99291 }
99292}
99293
99294function findDimension(dimensionTable, startingIndex, span){
99295 var ret = dimensionTable[startingIndex];
99296 for(var i = 1; i < span; i++){
99297 ret += 1 + dimensionTable[startingIndex + i];
99298 }
99299 return ret;
99300}
99301
99302function sumPlusOne(a,b){
99303 return a+b+1;
99304}
99305
99306var CHAR_NAMES = [ 'top'
99307 , 'top-mid'
99308 , 'top-left'
99309 , 'top-right'
99310 , 'bottom'
99311 , 'bottom-mid'
99312 , 'bottom-left'
99313 , 'bottom-right'
99314 , 'left'
99315 , 'left-mid'
99316 , 'mid'
99317 , 'mid-mid'
99318 , 'right'
99319 , 'right-mid'
99320 , 'middle'
99321];
99322module.exports = Cell;
99323module.exports.ColSpanCell = ColSpanCell;
99324module.exports.RowSpanCell = RowSpanCell;
99325
99326
99327/***/ }),
99328/* 570 */
99329/***/ (function(module, exports, __webpack_require__) {
99330
99331var kindOf = __webpack_require__(169);
99332var objectAssign = __webpack_require__(243);
99333var Cell = __webpack_require__(569);
99334var RowSpanCell = Cell.RowSpanCell;
99335var ColSpanCell = Cell.ColSpanCell;
99336
99337(function(){
99338 function layoutTable(table){
99339 table.forEach(function(row,rowIndex){
99340 row.forEach(function(cell,columnIndex){
99341 cell.y = rowIndex;
99342 cell.x = columnIndex;
99343 for(var y = rowIndex; y >= 0; y--){
99344 var row2 = table[y];
99345 var xMax = (y === rowIndex) ? columnIndex : row2.length;
99346 for(var x = 0; x < xMax; x++){
99347 var cell2 = row2[x];
99348 while(cellsConflict(cell,cell2)){
99349 cell.x++;
99350 }
99351 }
99352 }
99353 });
99354 });
99355 }
99356
99357 function maxWidth(table) {
99358 var mw = 0;
99359 table.forEach(function (row) {
99360 row.forEach(function (cell) {
99361 mw = Math.max(mw,cell.x + (cell.colSpan || 1));
99362 });
99363 });
99364 return mw;
99365 }
99366
99367 function maxHeight(table){
99368 return table.length;
99369 }
99370
99371 function cellsConflict(cell1,cell2){
99372 var yMin1 = cell1.y;
99373 var yMax1 = cell1.y - 1 + (cell1.rowSpan || 1);
99374 var yMin2 = cell2.y;
99375 var yMax2 = cell2.y - 1 + (cell2.rowSpan || 1);
99376 var yConflict = !(yMin1 > yMax2 || yMin2 > yMax1);
99377
99378 var xMin1= cell1.x;
99379 var xMax1 = cell1.x - 1 + (cell1.colSpan || 1);
99380 var xMin2= cell2.x;
99381 var xMax2 = cell2.x - 1 + (cell2.colSpan || 1);
99382 var xConflict = !(xMin1 > xMax2 || xMin2 > xMax1);
99383
99384 return yConflict && xConflict;
99385 }
99386
99387 function conflictExists(rows,x,y){
99388 var i_max = Math.min(rows.length-1,y);
99389 var cell = {x:x,y:y};
99390 for(var i = 0; i <= i_max; i++){
99391 var row = rows[i];
99392 for(var j = 0; j < row.length; j++){
99393 if(cellsConflict(cell,row[j])){
99394 return true;
99395 }
99396 }
99397 }
99398 return false;
99399 }
99400
99401 function allBlank(rows,y,xMin,xMax){
99402 for(var x = xMin; x < xMax; x++){
99403 if(conflictExists(rows,x,y)){
99404 return false;
99405 }
99406 }
99407 return true;
99408 }
99409
99410 function addRowSpanCells(table){
99411 table.forEach(function(row,rowIndex){
99412 row.forEach(function(cell){
99413 for(var i = 1; i < cell.rowSpan; i++){
99414 var rowSpanCell = new RowSpanCell(cell);
99415 rowSpanCell.x = cell.x;
99416 rowSpanCell.y = cell.y + i;
99417 rowSpanCell.colSpan = cell.colSpan;
99418 insertCell(rowSpanCell,table[rowIndex+i]);
99419 }
99420 });
99421 });
99422 }
99423
99424 function addColSpanCells(cellRows){
99425 for(var rowIndex = cellRows.length-1; rowIndex >= 0; rowIndex--) {
99426 var cellColumns = cellRows[rowIndex];
99427 for (var columnIndex = 0; columnIndex < cellColumns.length; columnIndex++) {
99428 var cell = cellColumns[columnIndex];
99429 for (var k = 1; k < cell.colSpan; k++) {
99430 var colSpanCell = new ColSpanCell();
99431 colSpanCell.x = cell.x + k;
99432 colSpanCell.y = cell.y;
99433 cellColumns.splice(columnIndex + 1, 0, colSpanCell);
99434 }
99435 }
99436 }
99437 }
99438
99439 function insertCell(cell,row){
99440 var x = 0;
99441 while(x < row.length && (row[x].x < cell.x)) {
99442 x++;
99443 }
99444 row.splice(x,0,cell);
99445 }
99446
99447 function fillInTable(table){
99448 var h_max = maxHeight(table);
99449 var w_max = maxWidth(table);
99450 for(var y = 0; y < h_max; y++){
99451 for(var x = 0; x < w_max; x++){
99452 if(!conflictExists(table,x,y)){
99453 var opts = {x:x,y:y,colSpan:1,rowSpan:1};
99454 x++;
99455 while(x < w_max && !conflictExists(table,x,y)){
99456 opts.colSpan++;
99457 x++;
99458 }
99459 var y2 = y + 1;
99460 while(y2 < h_max && allBlank(table,y2,opts.x,opts.x+opts.colSpan)){
99461 opts.rowSpan++;
99462 y2++;
99463 }
99464
99465 var cell = new Cell(opts);
99466 cell.x = opts.x;
99467 cell.y = opts.y;
99468 insertCell(cell,table[y]);
99469 }
99470 }
99471 }
99472 }
99473
99474 function generateCells(rows){
99475 return rows.map(function(row){
99476 if(kindOf(row) !== 'array'){
99477 var key = Object.keys(row)[0];
99478 row = row[key];
99479 if(kindOf(row) === 'array'){
99480 row = row.slice();
99481 row.unshift(key);
99482 }
99483 else {
99484 row = [key,row];
99485 }
99486 }
99487 return row.map(function(cell){
99488 return new Cell(cell);
99489 });
99490 });
99491 }
99492
99493 function makeTableLayout(rows){
99494 var cellRows = generateCells(rows);
99495 layoutTable(cellRows);
99496 fillInTable(cellRows);
99497 addRowSpanCells(cellRows);
99498 addColSpanCells(cellRows);
99499 return cellRows;
99500 }
99501
99502 module.exports = {
99503 makeTableLayout: makeTableLayout,
99504 layoutTable: layoutTable,
99505 addRowSpanCells: addRowSpanCells,
99506 maxWidth:maxWidth,
99507 fillInTable:fillInTable,
99508 computeWidths:makeComputeWidths('colSpan','desiredWidth','x',1),
99509 computeHeights:makeComputeWidths('rowSpan','desiredHeight','y',1)
99510 };
99511})();
99512
99513function makeComputeWidths(colSpan,desiredWidth,x,forcedMin){
99514 return function(vals,table){
99515 var result = [];
99516 var spanners = [];
99517 table.forEach(function(row){
99518 row.forEach(function(cell){
99519 if((cell[colSpan] || 1) > 1){
99520 spanners.push(cell);
99521 }
99522 else {
99523 result[cell[x]] = Math.max(result[cell[x]] || 0, cell[desiredWidth] || 0, forcedMin);
99524 }
99525 });
99526 });
99527
99528 vals.forEach(function(val,index){
99529 if(kindOf(val) === 'number'){
99530 result[index] = val;
99531 }
99532 });
99533
99534 //spanners.forEach(function(cell){
99535 for(var k = spanners.length - 1; k >=0; k--){
99536 var cell = spanners[k];
99537 var span = cell[colSpan];
99538 var col = cell[x];
99539 var existingWidth = result[col];
99540 var editableCols = kindOf(vals[col]) === 'number' ? 0 : 1;
99541 for(var i = 1; i < span; i ++){
99542 existingWidth += 1 + result[col + i];
99543 if(kindOf(vals[col + i]) !== 'number'){
99544 editableCols++;
99545 }
99546 }
99547 if(cell[desiredWidth] > existingWidth){
99548 i = 0;
99549 while(editableCols > 0 && cell[desiredWidth] > existingWidth){
99550 if(kindOf(vals[col+i]) !== 'number'){
99551 var dif = Math.round( (cell[desiredWidth] - existingWidth) / editableCols );
99552 existingWidth += dif;
99553 result[col + i] += dif;
99554 editableCols--;
99555 }
99556 i++;
99557 }
99558 }
99559 }
99560
99561 objectAssign(vals,result);
99562 for(var j = 0; j < vals.length; j++){
99563 vals[j] = Math.max(forcedMin, vals[j] || 0);
99564 }
99565 };
99566}
99567
99568
99569/***/ }),
99570/* 571 */
99571/***/ (function(module, exports, __webpack_require__) {
99572
99573var utils = __webpack_require__(320);
99574var tableLayout = __webpack_require__(570);
99575
99576function Table(options){
99577 this.options = utils.mergeOptions(options);
99578}
99579
99580Table.prototype.__proto__ = Array.prototype;
99581
99582Table.prototype.toString = function(){
99583 var array = this;
99584 var headersPresent = this.options.head && this.options.head.length;
99585 if(headersPresent){
99586 array = [this.options.head];
99587 if(this.length){
99588 array.push.apply(array,this);
99589 }
99590 }
99591 else {
99592 this.options.style.head=[];
99593 }
99594
99595 var cells = tableLayout.makeTableLayout(array);
99596
99597 cells.forEach(function(row){
99598 row.forEach(function(cell){
99599 cell.mergeTableOptions(this.options,cells);
99600 },this);
99601 },this);
99602
99603 tableLayout.computeWidths(this.options.colWidths,cells);
99604 tableLayout.computeHeights(this.options.rowHeights,cells);
99605
99606 cells.forEach(function(row,rowIndex){
99607 row.forEach(function(cell,cellIndex){
99608 cell.init(this.options);
99609 },this);
99610 },this);
99611
99612 var result = [];
99613
99614 for(var rowIndex = 0; rowIndex < cells.length; rowIndex++){
99615 var row = cells[rowIndex];
99616 var heightOfRow = this.options.rowHeights[rowIndex];
99617
99618 if(rowIndex === 0 || !this.options.style.compact || (rowIndex == 1 && headersPresent)){
99619 doDraw(row,'top',result);
99620 }
99621
99622 for(var lineNum = 0; lineNum < heightOfRow; lineNum++){
99623 doDraw(row,lineNum,result);
99624 }
99625
99626 if(rowIndex + 1 == cells.length){
99627 doDraw(row,'bottom',result);
99628 }
99629 }
99630
99631 return result.join('\n');
99632};
99633
99634function doDraw(row,lineNum,result){
99635 var line = [];
99636 row.forEach(function(cell){
99637 line.push(cell.draw(lineNum));
99638 });
99639 var str = line.join('');
99640 if(str.length) result.push(str);
99641}
99642
99643Table.prototype.__defineGetter__('width', function (){
99644 var str = this.toString().split("\n");
99645 return str[0].length;
99646});
99647
99648module.exports = Table;
99649
99650
99651/***/ }),
99652/* 572 */
99653/***/ (function(module, exports, __webpack_require__) {
99654
99655"use strict";
99656
99657
99658exports = module.exports = cliWidth;
99659
99660function normalizeOpts(options) {
99661 var defaultOpts = {
99662 defaultWidth: 0,
99663 output: process.stdout,
99664 tty: __webpack_require__(148)
99665 };
99666
99667 if (!options) {
99668 return defaultOpts;
99669 } else {
99670 Object.keys(defaultOpts).forEach(function (key) {
99671 if (!options[key]) {
99672 options[key] = defaultOpts[key];
99673 }
99674 });
99675
99676 return options;
99677 }
99678}
99679
99680function cliWidth(options) {
99681 var opts = normalizeOpts(options);
99682
99683 if (opts.output.getWindowSize) {
99684 return opts.output.getWindowSize()[0] || opts.defaultWidth;
99685 } else {
99686 if (opts.tty.getWindowSize) {
99687 return opts.tty.getWindowSize()[1] || opts.defaultWidth;
99688 } else {
99689 if (opts.output.columns) {
99690 return opts.output.columns;
99691 } else {
99692 if (process.env.CLI_WIDTH) {
99693 var width = parseInt(process.env.CLI_WIDTH, 10);
99694
99695 if (!isNaN(width) && width !== 0) {
99696 return width;
99697 }
99698 }
99699 }
99700
99701 return opts.defaultWidth;
99702 }
99703 }
99704};
99705
99706
99707/***/ }),
99708/* 573 */
99709/***/ (function(module, exports, __webpack_require__) {
99710
99711"use strict";
99712/* eslint-disable babel/new-cap, xo/throw-new-error */
99713
99714module.exports = function (str, pos) {
99715 if (str === null || str === undefined) {
99716 throw TypeError();
99717 }
99718
99719 str = String(str);
99720
99721 var size = str.length;
99722 var i = pos ? Number(pos) : 0;
99723
99724 if (Number.isNaN(i)) {
99725 i = 0;
99726 }
99727
99728 if (i < 0 || i >= size) {
99729 return undefined;
99730 }
99731
99732 var first = str.charCodeAt(i);
99733
99734 if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) {
99735 var second = str.charCodeAt(i + 1);
99736
99737 if (second >= 0xDC00 && second <= 0xDFFF) {
99738 return ((first - 0xD800) * 0x400) + second - 0xDC00 + 0x10000;
99739 }
99740 }
99741
99742 return first;
99743};
99744
99745
99746/***/ }),
99747/* 574 */
99748/***/ (function(module, exports, __webpack_require__) {
99749
99750var conversions = __webpack_require__(322);
99751var route = __webpack_require__(575);
99752
99753var convert = {};
99754
99755var models = Object.keys(conversions);
99756
99757function wrapRaw(fn) {
99758 var wrappedFn = function (args) {
99759 if (args === undefined || args === null) {
99760 return args;
99761 }
99762
99763 if (arguments.length > 1) {
99764 args = Array.prototype.slice.call(arguments);
99765 }
99766
99767 return fn(args);
99768 };
99769
99770 // preserve .conversion property if there is one
99771 if ('conversion' in fn) {
99772 wrappedFn.conversion = fn.conversion;
99773 }
99774
99775 return wrappedFn;
99776}
99777
99778function wrapRounded(fn) {
99779 var wrappedFn = function (args) {
99780 if (args === undefined || args === null) {
99781 return args;
99782 }
99783
99784 if (arguments.length > 1) {
99785 args = Array.prototype.slice.call(arguments);
99786 }
99787
99788 var result = fn(args);
99789
99790 // we're assuming the result is an array here.
99791 // see notice in conversions.js; don't use box types
99792 // in conversion functions.
99793 if (typeof result === 'object') {
99794 for (var len = result.length, i = 0; i < len; i++) {
99795 result[i] = Math.round(result[i]);
99796 }
99797 }
99798
99799 return result;
99800 };
99801
99802 // preserve .conversion property if there is one
99803 if ('conversion' in fn) {
99804 wrappedFn.conversion = fn.conversion;
99805 }
99806
99807 return wrappedFn;
99808}
99809
99810models.forEach(function (fromModel) {
99811 convert[fromModel] = {};
99812
99813 Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
99814 Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
99815
99816 var routes = route(fromModel);
99817 var routeModels = Object.keys(routes);
99818
99819 routeModels.forEach(function (toModel) {
99820 var fn = routes[toModel];
99821
99822 convert[fromModel][toModel] = wrapRounded(fn);
99823 convert[fromModel][toModel].raw = wrapRaw(fn);
99824 });
99825});
99826
99827module.exports = convert;
99828
99829
99830/***/ }),
99831/* 575 */
99832/***/ (function(module, exports, __webpack_require__) {
99833
99834var conversions = __webpack_require__(322);
99835
99836/*
99837 this function routes a model to all other models.
99838
99839 all functions that are routed have a property `.conversion` attached
99840 to the returned synthetic function. This property is an array
99841 of strings, each with the steps in between the 'from' and 'to'
99842 color models (inclusive).
99843
99844 conversions that are not possible simply are not included.
99845*/
99846
99847function buildGraph() {
99848 var graph = {};
99849 // https://jsperf.com/object-keys-vs-for-in-with-closure/3
99850 var models = Object.keys(conversions);
99851
99852 for (var len = models.length, i = 0; i < len; i++) {
99853 graph[models[i]] = {
99854 // http://jsperf.com/1-vs-infinity
99855 // micro-opt, but this is simple.
99856 distance: -1,
99857 parent: null
99858 };
99859 }
99860
99861 return graph;
99862}
99863
99864// https://en.wikipedia.org/wiki/Breadth-first_search
99865function deriveBFS(fromModel) {
99866 var graph = buildGraph();
99867 var queue = [fromModel]; // unshift -> queue -> pop
99868
99869 graph[fromModel].distance = 0;
99870
99871 while (queue.length) {
99872 var current = queue.pop();
99873 var adjacents = Object.keys(conversions[current]);
99874
99875 for (var len = adjacents.length, i = 0; i < len; i++) {
99876 var adjacent = adjacents[i];
99877 var node = graph[adjacent];
99878
99879 if (node.distance === -1) {
99880 node.distance = graph[current].distance + 1;
99881 node.parent = current;
99882 queue.unshift(adjacent);
99883 }
99884 }
99885 }
99886
99887 return graph;
99888}
99889
99890function link(from, to) {
99891 return function (args) {
99892 return to(from(args));
99893 };
99894}
99895
99896function wrapConversion(toModel, graph) {
99897 var path = [graph[toModel].parent, toModel];
99898 var fn = conversions[graph[toModel].parent][toModel];
99899
99900 var cur = graph[toModel].parent;
99901 while (graph[cur].parent) {
99902 path.unshift(graph[cur].parent);
99903 fn = link(conversions[graph[cur].parent][cur], fn);
99904 cur = graph[cur].parent;
99905 }
99906
99907 fn.conversion = path;
99908 return fn;
99909}
99910
99911module.exports = function (fromModel) {
99912 var graph = deriveBFS(fromModel);
99913 var conversion = {};
99914
99915 var models = Object.keys(graph);
99916 for (var len = models.length, i = 0; i < len; i++) {
99917 var toModel = models[i];
99918 var node = graph[toModel];
99919
99920 if (node.parent === null) {
99921 // no possible conversion, or this node is the source model.
99922 continue;
99923 }
99924
99925 conversion[toModel] = wrapConversion(toModel, graph);
99926 }
99927
99928 return conversion;
99929};
99930
99931
99932
99933/***/ }),
99934/* 576 */
99935/***/ (function(module, exports) {
99936
99937module.exports = {
99938 "aliceblue": [240, 248, 255],
99939 "antiquewhite": [250, 235, 215],
99940 "aqua": [0, 255, 255],
99941 "aquamarine": [127, 255, 212],
99942 "azure": [240, 255, 255],
99943 "beige": [245, 245, 220],
99944 "bisque": [255, 228, 196],
99945 "black": [0, 0, 0],
99946 "blanchedalmond": [255, 235, 205],
99947 "blue": [0, 0, 255],
99948 "blueviolet": [138, 43, 226],
99949 "brown": [165, 42, 42],
99950 "burlywood": [222, 184, 135],
99951 "cadetblue": [95, 158, 160],
99952 "chartreuse": [127, 255, 0],
99953 "chocolate": [210, 105, 30],
99954 "coral": [255, 127, 80],
99955 "cornflowerblue": [100, 149, 237],
99956 "cornsilk": [255, 248, 220],
99957 "crimson": [220, 20, 60],
99958 "cyan": [0, 255, 255],
99959 "darkblue": [0, 0, 139],
99960 "darkcyan": [0, 139, 139],
99961 "darkgoldenrod": [184, 134, 11],
99962 "darkgray": [169, 169, 169],
99963 "darkgreen": [0, 100, 0],
99964 "darkgrey": [169, 169, 169],
99965 "darkkhaki": [189, 183, 107],
99966 "darkmagenta": [139, 0, 139],
99967 "darkolivegreen": [85, 107, 47],
99968 "darkorange": [255, 140, 0],
99969 "darkorchid": [153, 50, 204],
99970 "darkred": [139, 0, 0],
99971 "darksalmon": [233, 150, 122],
99972 "darkseagreen": [143, 188, 143],
99973 "darkslateblue": [72, 61, 139],
99974 "darkslategray": [47, 79, 79],
99975 "darkslategrey": [47, 79, 79],
99976 "darkturquoise": [0, 206, 209],
99977 "darkviolet": [148, 0, 211],
99978 "deeppink": [255, 20, 147],
99979 "deepskyblue": [0, 191, 255],
99980 "dimgray": [105, 105, 105],
99981 "dimgrey": [105, 105, 105],
99982 "dodgerblue": [30, 144, 255],
99983 "firebrick": [178, 34, 34],
99984 "floralwhite": [255, 250, 240],
99985 "forestgreen": [34, 139, 34],
99986 "fuchsia": [255, 0, 255],
99987 "gainsboro": [220, 220, 220],
99988 "ghostwhite": [248, 248, 255],
99989 "gold": [255, 215, 0],
99990 "goldenrod": [218, 165, 32],
99991 "gray": [128, 128, 128],
99992 "green": [0, 128, 0],
99993 "greenyellow": [173, 255, 47],
99994 "grey": [128, 128, 128],
99995 "honeydew": [240, 255, 240],
99996 "hotpink": [255, 105, 180],
99997 "indianred": [205, 92, 92],
99998 "indigo": [75, 0, 130],
99999 "ivory": [255, 255, 240],
100000 "khaki": [240, 230, 140],
100001 "lavender": [230, 230, 250],
100002 "lavenderblush": [255, 240, 245],
100003 "lawngreen": [124, 252, 0],
100004 "lemonchiffon": [255, 250, 205],
100005 "lightblue": [173, 216, 230],
100006 "lightcoral": [240, 128, 128],
100007 "lightcyan": [224, 255, 255],
100008 "lightgoldenrodyellow": [250, 250, 210],
100009 "lightgray": [211, 211, 211],
100010 "lightgreen": [144, 238, 144],
100011 "lightgrey": [211, 211, 211],
100012 "lightpink": [255, 182, 193],
100013 "lightsalmon": [255, 160, 122],
100014 "lightseagreen": [32, 178, 170],
100015 "lightskyblue": [135, 206, 250],
100016 "lightslategray": [119, 136, 153],
100017 "lightslategrey": [119, 136, 153],
100018 "lightsteelblue": [176, 196, 222],
100019 "lightyellow": [255, 255, 224],
100020 "lime": [0, 255, 0],
100021 "limegreen": [50, 205, 50],
100022 "linen": [250, 240, 230],
100023 "magenta": [255, 0, 255],
100024 "maroon": [128, 0, 0],
100025 "mediumaquamarine": [102, 205, 170],
100026 "mediumblue": [0, 0, 205],
100027 "mediumorchid": [186, 85, 211],
100028 "mediumpurple": [147, 112, 219],
100029 "mediumseagreen": [60, 179, 113],
100030 "mediumslateblue": [123, 104, 238],
100031 "mediumspringgreen": [0, 250, 154],
100032 "mediumturquoise": [72, 209, 204],
100033 "mediumvioletred": [199, 21, 133],
100034 "midnightblue": [25, 25, 112],
100035 "mintcream": [245, 255, 250],
100036 "mistyrose": [255, 228, 225],
100037 "moccasin": [255, 228, 181],
100038 "navajowhite": [255, 222, 173],
100039 "navy": [0, 0, 128],
100040 "oldlace": [253, 245, 230],
100041 "olive": [128, 128, 0],
100042 "olivedrab": [107, 142, 35],
100043 "orange": [255, 165, 0],
100044 "orangered": [255, 69, 0],
100045 "orchid": [218, 112, 214],
100046 "palegoldenrod": [238, 232, 170],
100047 "palegreen": [152, 251, 152],
100048 "paleturquoise": [175, 238, 238],
100049 "palevioletred": [219, 112, 147],
100050 "papayawhip": [255, 239, 213],
100051 "peachpuff": [255, 218, 185],
100052 "peru": [205, 133, 63],
100053 "pink": [255, 192, 203],
100054 "plum": [221, 160, 221],
100055 "powderblue": [176, 224, 230],
100056 "purple": [128, 0, 128],
100057 "rebeccapurple": [102, 51, 153],
100058 "red": [255, 0, 0],
100059 "rosybrown": [188, 143, 143],
100060 "royalblue": [65, 105, 225],
100061 "saddlebrown": [139, 69, 19],
100062 "salmon": [250, 128, 114],
100063 "sandybrown": [244, 164, 96],
100064 "seagreen": [46, 139, 87],
100065 "seashell": [255, 245, 238],
100066 "sienna": [160, 82, 45],
100067 "silver": [192, 192, 192],
100068 "skyblue": [135, 206, 235],
100069 "slateblue": [106, 90, 205],
100070 "slategray": [112, 128, 144],
100071 "slategrey": [112, 128, 144],
100072 "snow": [255, 250, 250],
100073 "springgreen": [0, 255, 127],
100074 "steelblue": [70, 130, 180],
100075 "tan": [210, 180, 140],
100076 "teal": [0, 128, 128],
100077 "thistle": [216, 191, 216],
100078 "tomato": [255, 99, 71],
100079 "turquoise": [64, 224, 208],
100080 "violet": [238, 130, 238],
100081 "wheat": [245, 222, 179],
100082 "white": [255, 255, 255],
100083 "whitesmoke": [245, 245, 245],
100084 "yellow": [255, 255, 0],
100085 "yellowgreen": [154, 205, 50]
100086};
100087
100088/***/ }),
100089/* 577 */
100090/***/ (function(module, exports, __webpack_require__) {
100091
100092/*
100093
100094The MIT License (MIT)
100095
100096Original Library
100097 - Copyright (c) Marak Squires
100098
100099Additional functionality
100100 - Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
100101
100102Permission is hereby granted, free of charge, to any person obtaining a copy
100103of this software and associated documentation files (the "Software"), to deal
100104in the Software without restriction, including without limitation the rights
100105to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
100106copies of the Software, and to permit persons to whom the Software is
100107furnished to do so, subject to the following conditions:
100108
100109The above copyright notice and this permission notice shall be included in
100110all copies or substantial portions of the Software.
100111
100112THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
100113IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
100114FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
100115AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
100116LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
100117OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
100118THE SOFTWARE.
100119
100120*/
100121
100122var colors = {};
100123module['exports'] = colors;
100124
100125colors.themes = {};
100126
100127var util = __webpack_require__(9);
100128var ansiStyles = colors.styles = __webpack_require__(584);
100129var defineProps = Object.defineProperties;
100130var newLineRegex = new RegExp(/[\r\n]+/g);
100131
100132colors.supportsColor = __webpack_require__(586).supportsColor;
100133
100134if (typeof colors.enabled === 'undefined') {
100135 colors.enabled = colors.supportsColor() !== false;
100136}
100137
100138colors.enable = function() {
100139 colors.enabled = true;
100140};
100141
100142colors.disable = function() {
100143 colors.enabled = false;
100144};
100145
100146colors.stripColors = colors.strip = function(str) {
100147 return ('' + str).replace(/\x1B\[\d+m/g, '');
100148};
100149
100150// eslint-disable-next-line no-unused-vars
100151var stylize = colors.stylize = function stylize(str, style) {
100152 if (!colors.enabled) {
100153 return str+'';
100154 }
100155
100156 return ansiStyles[style].open + str + ansiStyles[style].close;
100157};
100158
100159var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
100160var escapeStringRegexp = function(str) {
100161 if (typeof str !== 'string') {
100162 throw new TypeError('Expected a string');
100163 }
100164 return str.replace(matchOperatorsRe, '\\$&');
100165};
100166
100167function build(_styles) {
100168 var builder = function builder() {
100169 return applyStyle.apply(builder, arguments);
100170 };
100171 builder._styles = _styles;
100172 // __proto__ is used because we must return a function, but there is
100173 // no way to create a function with a different prototype.
100174 builder.__proto__ = proto;
100175 return builder;
100176}
100177
100178var styles = (function() {
100179 var ret = {};
100180 ansiStyles.grey = ansiStyles.gray;
100181 Object.keys(ansiStyles).forEach(function(key) {
100182 ansiStyles[key].closeRe =
100183 new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
100184 ret[key] = {
100185 get: function() {
100186 return build(this._styles.concat(key));
100187 },
100188 };
100189 });
100190 return ret;
100191})();
100192
100193var proto = defineProps(function colors() {}, styles);
100194
100195function applyStyle() {
100196 var args = Array.prototype.slice.call(arguments);
100197
100198 var str = args.map(function(arg) {
100199 if (arg != undefined && arg.constructor === String) {
100200 return arg;
100201 } else {
100202 return util.inspect(arg);
100203 }
100204 }).join(' ');
100205
100206 if (!colors.enabled || !str) {
100207 return str;
100208 }
100209
100210 var newLinesPresent = str.indexOf('\n') != -1;
100211
100212 var nestedStyles = this._styles;
100213
100214 var i = nestedStyles.length;
100215 while (i--) {
100216 var code = ansiStyles[nestedStyles[i]];
100217 str = code.open + str.replace(code.closeRe, code.open) + code.close;
100218 if (newLinesPresent) {
100219 str = str.replace(newLineRegex, function(match) {
100220 return code.close + match + code.open;
100221 });
100222 }
100223 }
100224
100225 return str;
100226}
100227
100228colors.setTheme = function(theme) {
100229 if (typeof theme === 'string') {
100230 console.log('colors.setTheme now only accepts an object, not a string. ' +
100231 'If you are trying to set a theme from a file, it is now your (the ' +
100232 'caller\'s) responsibility to require the file. The old syntax ' +
100233 'looked like colors.setTheme(__dirname + ' +
100234 '\'/../themes/generic-logging.js\'); The new syntax looks like '+
100235 'colors.setTheme(require(__dirname + ' +
100236 '\'/../themes/generic-logging.js\'));');
100237 return;
100238 }
100239 for (var style in theme) {
100240 (function(style) {
100241 colors[style] = function(str) {
100242 if (typeof theme[style] === 'object') {
100243 var out = str;
100244 for (var i in theme[style]) {
100245 out = colors[theme[style][i]](out);
100246 }
100247 return out;
100248 }
100249 return colors[theme[style]](str);
100250 };
100251 })(style);
100252 }
100253};
100254
100255function init() {
100256 var ret = {};
100257 Object.keys(styles).forEach(function(name) {
100258 ret[name] = {
100259 get: function() {
100260 return build([name]);
100261 },
100262 };
100263 });
100264 return ret;
100265}
100266
100267var sequencer = function sequencer(map, str) {
100268 var exploded = str.split('');
100269 exploded = exploded.map(map);
100270 return exploded.join('');
100271};
100272
100273// custom formatter methods
100274colors.trap = __webpack_require__(578);
100275colors.zalgo = __webpack_require__(579);
100276
100277// maps
100278colors.maps = {};
100279colors.maps.america = __webpack_require__(580)(colors);
100280colors.maps.zebra = __webpack_require__(583)(colors);
100281colors.maps.rainbow = __webpack_require__(581)(colors);
100282colors.maps.random = __webpack_require__(582)(colors);
100283
100284for (var map in colors.maps) {
100285 (function(map) {
100286 colors[map] = function(str) {
100287 return sequencer(colors.maps[map], str);
100288 };
100289 })(map);
100290}
100291
100292defineProps(colors, init());
100293
100294
100295/***/ }),
100296/* 578 */
100297/***/ (function(module, exports) {
100298
100299module['exports'] = function runTheTrap(text, options) {
100300 var result = '';
100301 text = text || 'Run the trap, drop the bass';
100302 text = text.split('');
100303 var trap = {
100304 a: ['\u0040', '\u0104', '\u023a', '\u0245', '\u0394', '\u039b', '\u0414'],
100305 b: ['\u00df', '\u0181', '\u0243', '\u026e', '\u03b2', '\u0e3f'],
100306 c: ['\u00a9', '\u023b', '\u03fe'],
100307 d: ['\u00d0', '\u018a', '\u0500', '\u0501', '\u0502', '\u0503'],
100308 e: ['\u00cb', '\u0115', '\u018e', '\u0258', '\u03a3', '\u03be', '\u04bc',
100309 '\u0a6c'],
100310 f: ['\u04fa'],
100311 g: ['\u0262'],
100312 h: ['\u0126', '\u0195', '\u04a2', '\u04ba', '\u04c7', '\u050a'],
100313 i: ['\u0f0f'],
100314 j: ['\u0134'],
100315 k: ['\u0138', '\u04a0', '\u04c3', '\u051e'],
100316 l: ['\u0139'],
100317 m: ['\u028d', '\u04cd', '\u04ce', '\u0520', '\u0521', '\u0d69'],
100318 n: ['\u00d1', '\u014b', '\u019d', '\u0376', '\u03a0', '\u048a'],
100319 o: ['\u00d8', '\u00f5', '\u00f8', '\u01fe', '\u0298', '\u047a', '\u05dd',
100320 '\u06dd', '\u0e4f'],
100321 p: ['\u01f7', '\u048e'],
100322 q: ['\u09cd'],
100323 r: ['\u00ae', '\u01a6', '\u0210', '\u024c', '\u0280', '\u042f'],
100324 s: ['\u00a7', '\u03de', '\u03df', '\u03e8'],
100325 t: ['\u0141', '\u0166', '\u0373'],
100326 u: ['\u01b1', '\u054d'],
100327 v: ['\u05d8'],
100328 w: ['\u0428', '\u0460', '\u047c', '\u0d70'],
100329 x: ['\u04b2', '\u04fe', '\u04fc', '\u04fd'],
100330 y: ['\u00a5', '\u04b0', '\u04cb'],
100331 z: ['\u01b5', '\u0240'],
100332 };
100333 text.forEach(function(c) {
100334 c = c.toLowerCase();
100335 var chars = trap[c] || [' '];
100336 var rand = Math.floor(Math.random() * chars.length);
100337 if (typeof trap[c] !== 'undefined') {
100338 result += trap[c][rand];
100339 } else {
100340 result += c;
100341 }
100342 });
100343 return result;
100344};
100345
100346
100347/***/ }),
100348/* 579 */
100349/***/ (function(module, exports) {
100350
100351// please no
100352module['exports'] = function zalgo(text, options) {
100353 text = text || ' he is here ';
100354 var soul = {
100355 'up': [
100356 '̍', '̎', '̄', '̅',
100357 '̿', '̑', '̆', '̐',
100358 '͒', '͗', '͑', '̇',
100359 '̈', '̊', '͂', '̓',
100360 '̈', '͊', '͋', '͌',
100361 '̃', '̂', '̌', '͐',
100362 '̀', '́', '̋', '̏',
100363 '̒', '̓', '̔', '̽',
100364 '̉', 'ͣ', 'ͤ', 'ͥ',
100365 'ͦ', 'ͧ', 'ͨ', 'ͩ',
100366 'ͪ', 'ͫ', 'ͬ', 'ͭ',
100367 'ͮ', 'ͯ', '̾', '͛',
100368 '͆', '̚',
100369 ],
100370 'down': [
100371 '̖', '̗', '̘', '̙',
100372 '̜', '̝', '̞', '̟',
100373 '̠', '̤', '̥', '̦',
100374 '̩', '̪', '̫', '̬',
100375 '̭', '̮', '̯', '̰',
100376 '̱', '̲', '̳', '̹',
100377 '̺', '̻', '̼', 'ͅ',
100378 '͇', '͈', '͉', '͍',
100379 '͎', '͓', '͔', '͕',
100380 '͖', '͙', '͚', '̣',
100381 ],
100382 'mid': [
100383 '̕', '̛', '̀', '́',
100384 '͘', '̡', '̢', '̧',
100385 '̨', '̴', '̵', '̶',
100386 '͜', '͝', '͞',
100387 '͟', '͠', '͢', '̸',
100388 '̷', '͡', ' ҉',
100389 ],
100390 };
100391 var all = [].concat(soul.up, soul.down, soul.mid);
100392
100393 function randomNumber(range) {
100394 var r = Math.floor(Math.random() * range);
100395 return r;
100396 }
100397
100398 function isChar(character) {
100399 var bool = false;
100400 all.filter(function(i) {
100401 bool = (i === character);
100402 });
100403 return bool;
100404 }
100405
100406
100407 function heComes(text, options) {
100408 var result = '';
100409 var counts;
100410 var l;
100411 options = options || {};
100412 options['up'] =
100413 typeof options['up'] !== 'undefined' ? options['up'] : true;
100414 options['mid'] =
100415 typeof options['mid'] !== 'undefined' ? options['mid'] : true;
100416 options['down'] =
100417 typeof options['down'] !== 'undefined' ? options['down'] : true;
100418 options['size'] =
100419 typeof options['size'] !== 'undefined' ? options['size'] : 'maxi';
100420 text = text.split('');
100421 for (l in text) {
100422 if (isChar(l)) {
100423 continue;
100424 }
100425 result = result + text[l];
100426 counts = {'up': 0, 'down': 0, 'mid': 0};
100427 switch (options.size) {
100428 case 'mini':
100429 counts.up = randomNumber(8);
100430 counts.mid = randomNumber(2);
100431 counts.down = randomNumber(8);
100432 break;
100433 case 'maxi':
100434 counts.up = randomNumber(16) + 3;
100435 counts.mid = randomNumber(4) + 1;
100436 counts.down = randomNumber(64) + 3;
100437 break;
100438 default:
100439 counts.up = randomNumber(8) + 1;
100440 counts.mid = randomNumber(6) / 2;
100441 counts.down = randomNumber(8) + 1;
100442 break;
100443 }
100444
100445 var arr = ['up', 'mid', 'down'];
100446 for (var d in arr) {
100447 var index = arr[d];
100448 for (var i = 0; i <= counts[index]; i++) {
100449 if (options[index]) {
100450 result = result + soul[index][randomNumber(soul[index].length)];
100451 }
100452 }
100453 }
100454 }
100455 return result;
100456 }
100457 // don't summon him
100458 return heComes(text, options);
100459};
100460
100461
100462
100463/***/ }),
100464/* 580 */
100465/***/ (function(module, exports) {
100466
100467module['exports'] = function(colors) {
100468 return function(letter, i, exploded) {
100469 if (letter === ' ') return letter;
100470 switch (i%3) {
100471 case 0: return colors.red(letter);
100472 case 1: return colors.white(letter);
100473 case 2: return colors.blue(letter);
100474 }
100475 };
100476};
100477
100478
100479/***/ }),
100480/* 581 */
100481/***/ (function(module, exports) {
100482
100483module['exports'] = function(colors) {
100484 // RoY G BiV
100485 var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta'];
100486 return function(letter, i, exploded) {
100487 if (letter === ' ') {
100488 return letter;
100489 } else {
100490 return colors[rainbowColors[i++ % rainbowColors.length]](letter);
100491 }
100492 };
100493};
100494
100495
100496
100497/***/ }),
100498/* 582 */
100499/***/ (function(module, exports) {
100500
100501module['exports'] = function(colors) {
100502 var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green',
100503 'blue', 'white', 'cyan', 'magenta'];
100504 return function(letter, i, exploded) {
100505 return letter === ' ' ? letter :
100506 colors[
100507 available[Math.round(Math.random() * (available.length - 2))]
100508 ](letter);
100509 };
100510};
100511
100512
100513/***/ }),
100514/* 583 */
100515/***/ (function(module, exports) {
100516
100517module['exports'] = function(colors) {
100518 return function(letter, i, exploded) {
100519 return i % 2 === 0 ? letter : colors.inverse(letter);
100520 };
100521};
100522
100523
100524/***/ }),
100525/* 584 */
100526/***/ (function(module, exports) {
100527
100528/*
100529The MIT License (MIT)
100530
100531Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
100532
100533Permission is hereby granted, free of charge, to any person obtaining a copy
100534of this software and associated documentation files (the "Software"), to deal
100535in the Software without restriction, including without limitation the rights
100536to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
100537copies of the Software, and to permit persons to whom the Software is
100538furnished to do so, subject to the following conditions:
100539
100540The above copyright notice and this permission notice shall be included in
100541all copies or substantial portions of the Software.
100542
100543THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
100544IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
100545FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
100546AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
100547LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
100548OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
100549THE SOFTWARE.
100550
100551*/
100552
100553var styles = {};
100554module['exports'] = styles;
100555
100556var codes = {
100557 reset: [0, 0],
100558
100559 bold: [1, 22],
100560 dim: [2, 22],
100561 italic: [3, 23],
100562 underline: [4, 24],
100563 inverse: [7, 27],
100564 hidden: [8, 28],
100565 strikethrough: [9, 29],
100566
100567 black: [30, 39],
100568 red: [31, 39],
100569 green: [32, 39],
100570 yellow: [33, 39],
100571 blue: [34, 39],
100572 magenta: [35, 39],
100573 cyan: [36, 39],
100574 white: [37, 39],
100575 gray: [90, 39],
100576 grey: [90, 39],
100577
100578 bgBlack: [40, 49],
100579 bgRed: [41, 49],
100580 bgGreen: [42, 49],
100581 bgYellow: [43, 49],
100582 bgBlue: [44, 49],
100583 bgMagenta: [45, 49],
100584 bgCyan: [46, 49],
100585 bgWhite: [47, 49],
100586
100587 // legacy styles for colors pre v1.0.0
100588 blackBG: [40, 49],
100589 redBG: [41, 49],
100590 greenBG: [42, 49],
100591 yellowBG: [43, 49],
100592 blueBG: [44, 49],
100593 magentaBG: [45, 49],
100594 cyanBG: [46, 49],
100595 whiteBG: [47, 49],
100596
100597};
100598
100599Object.keys(codes).forEach(function(key) {
100600 var val = codes[key];
100601 var style = styles[key] = [];
100602 style.open = '\u001b[' + val[0] + 'm';
100603 style.close = '\u001b[' + val[1] + 'm';
100604});
100605
100606
100607/***/ }),
100608/* 585 */
100609/***/ (function(module, exports, __webpack_require__) {
100610
100611"use strict";
100612/*
100613MIT License
100614
100615Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
100616
100617Permission is hereby granted, free of charge, to any person obtaining a copy of
100618this software and associated documentation files (the "Software"), to deal in
100619the Software without restriction, including without limitation the rights to
100620use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
100621of the Software, and to permit persons to whom the Software is furnished to do
100622so, subject to the following conditions:
100623
100624The above copyright notice and this permission notice shall be included in all
100625copies or substantial portions of the Software.
100626
100627THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
100628IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
100629FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
100630AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
100631LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
100632OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
100633SOFTWARE.
100634*/
100635
100636
100637
100638module.exports = function(flag, argv) {
100639 argv = argv || process.argv;
100640
100641 var terminatorPos = argv.indexOf('--');
100642 var prefix = /^-{1,2}/.test(flag) ? '' : '--';
100643 var pos = argv.indexOf(prefix + flag);
100644
100645 return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
100646};
100647
100648
100649/***/ }),
100650/* 586 */
100651/***/ (function(module, exports, __webpack_require__) {
100652
100653"use strict";
100654/*
100655The MIT License (MIT)
100656
100657Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
100658
100659Permission is hereby granted, free of charge, to any person obtaining a copy
100660of this software and associated documentation files (the "Software"), to deal
100661in the Software without restriction, including without limitation the rights
100662to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
100663copies of the Software, and to permit persons to whom the Software is
100664furnished to do so, subject to the following conditions:
100665
100666The above copyright notice and this permission notice shall be included in
100667all copies or substantial portions of the Software.
100668
100669THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
100670IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
100671FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
100672AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
100673LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
100674OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
100675THE SOFTWARE.
100676
100677*/
100678
100679
100680
100681var os = __webpack_require__(72);
100682var hasFlag = __webpack_require__(585);
100683
100684var env = process.env;
100685
100686var forceColor = void 0;
100687if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {
100688 forceColor = false;
100689} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true')
100690 || hasFlag('color=always')) {
100691 forceColor = true;
100692}
100693if ('FORCE_COLOR' in env) {
100694 forceColor = env.FORCE_COLOR.length === 0
100695 || parseInt(env.FORCE_COLOR, 10) !== 0;
100696}
100697
100698function translateLevel(level) {
100699 if (level === 0) {
100700 return false;
100701 }
100702
100703 return {
100704 level: level,
100705 hasBasic: true,
100706 has256: level >= 2,
100707 has16m: level >= 3,
100708 };
100709}
100710
100711function supportsColor(stream) {
100712 if (forceColor === false) {
100713 return 0;
100714 }
100715
100716 if (hasFlag('color=16m') || hasFlag('color=full')
100717 || hasFlag('color=truecolor')) {
100718 return 3;
100719 }
100720
100721 if (hasFlag('color=256')) {
100722 return 2;
100723 }
100724
100725 if (stream && !stream.isTTY && forceColor !== true) {
100726 return 0;
100727 }
100728
100729 var min = forceColor ? 1 : 0;
100730
100731 if (process.platform === 'win32') {
100732 // Node.js 7.5.0 is the first version of Node.js to include a patch to
100733 // libuv that enables 256 color output on Windows. Anything earlier and it
100734 // won't work. However, here we target Node.js 8 at minimum as it is an LTS
100735 // release, and Node.js 7 is not. Windows 10 build 10586 is the first
100736 // Windows release that supports 256 colors. Windows 10 build 14931 is the
100737 // first release that supports 16m/TrueColor.
100738 var osRelease = os.release().split('.');
100739 if (Number(process.versions.node.split('.')[0]) >= 8
100740 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
100741 return Number(osRelease[2]) >= 14931 ? 3 : 2;
100742 }
100743
100744 return 1;
100745 }
100746
100747 if ('CI' in env) {
100748 if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) {
100749 return sign in env;
100750 }) || env.CI_NAME === 'codeship') {
100751 return 1;
100752 }
100753
100754 return min;
100755 }
100756
100757 if ('TEAMCITY_VERSION' in env) {
100758 return (/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0
100759 );
100760 }
100761
100762 if ('TERM_PROGRAM' in env) {
100763 var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
100764
100765 switch (env.TERM_PROGRAM) {
100766 case 'iTerm.app':
100767 return version >= 3 ? 3 : 2;
100768 case 'Hyper':
100769 return 3;
100770 case 'Apple_Terminal':
100771 return 2;
100772 // No default
100773 }
100774 }
100775
100776 if (/-256(color)?$/i.test(env.TERM)) {
100777 return 2;
100778 }
100779
100780 if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
100781 return 1;
100782 }
100783
100784 if ('COLORTERM' in env) {
100785 return 1;
100786 }
100787
100788 if (env.TERM === 'dumb') {
100789 return min;
100790 }
100791
100792 return min;
100793}
100794
100795function getSupportLevel(stream) {
100796 var level = supportsColor(stream);
100797 return translateLevel(level);
100798}
100799
100800module.exports = {
100801 supportsColor: getSupportLevel,
100802 stdout: getSupportLevel(process.stdout),
100803 stderr: getSupportLevel(process.stderr),
100804};
100805
100806
100807/***/ }),
100808/* 587 */
100809/***/ (function(module, exports, __webpack_require__) {
100810
100811//
100812// Remark: Requiring this file will use the "safe" colors API,
100813// which will not touch String.prototype.
100814//
100815// var colors = require('colors/safe');
100816// colors.red("foo")
100817//
100818//
100819var colors = __webpack_require__(577);
100820module['exports'] = colors;
100821
100822
100823/***/ }),
100824/* 588 */
100825/***/ (function(module, exports) {
100826
100827module.exports = defer;
100828
100829/**
100830 * Runs provided function on next iteration of the event loop
100831 *
100832 * @param {function} fn - function to run
100833 */
100834function defer(fn)
100835{
100836 var nextTick = typeof setImmediate == 'function'
100837 ? setImmediate
100838 : (
100839 typeof process == 'object' && typeof process.nextTick == 'function'
100840 ? process.nextTick
100841 : null
100842 );
100843
100844 if (nextTick)
100845 {
100846 nextTick(fn);
100847 }
100848 else
100849 {
100850 setTimeout(fn, 0);
100851 }
100852}
100853
100854
100855/***/ }),
100856/* 589 */
100857/***/ (function(module, exports) {
100858
100859module.exports = function (xs, fn) {
100860 var res = [];
100861 for (var i = 0; i < xs.length; i++) {
100862 var x = fn(xs[i], i);
100863 if (isArray(x)) res.push.apply(res, x);
100864 else res.push(x);
100865 }
100866 return res;
100867};
100868
100869var isArray = Array.isArray || function (xs) {
100870 return Object.prototype.toString.call(xs) === '[object Array]';
100871};
100872
100873
100874/***/ }),
100875/* 590 */
100876/***/ (function(module, exports, __webpack_require__) {
100877
100878__webpack_require__(104);
100879__webpack_require__(625);
100880module.exports = __webpack_require__(26).Array.from;
100881
100882
100883/***/ }),
100884/* 591 */
100885/***/ (function(module, exports, __webpack_require__) {
100886
100887__webpack_require__(128);
100888__webpack_require__(104);
100889module.exports = __webpack_require__(624);
100890
100891
100892/***/ }),
100893/* 592 */
100894/***/ (function(module, exports, __webpack_require__) {
100895
100896var core = __webpack_require__(26);
100897var $JSON = core.JSON || (core.JSON = { stringify: JSON.stringify });
100898module.exports = function stringify(it) { // eslint-disable-line no-unused-vars
100899 return $JSON.stringify.apply($JSON, arguments);
100900};
100901
100902
100903/***/ }),
100904/* 593 */
100905/***/ (function(module, exports, __webpack_require__) {
100906
100907__webpack_require__(163);
100908__webpack_require__(104);
100909__webpack_require__(128);
100910__webpack_require__(627);
100911__webpack_require__(639);
100912__webpack_require__(638);
100913__webpack_require__(637);
100914module.exports = __webpack_require__(26).Map;
100915
100916
100917/***/ }),
100918/* 594 */
100919/***/ (function(module, exports, __webpack_require__) {
100920
100921__webpack_require__(628);
100922module.exports = __webpack_require__(26).Object.assign;
100923
100924
100925/***/ }),
100926/* 595 */
100927/***/ (function(module, exports, __webpack_require__) {
100928
100929__webpack_require__(629);
100930var $Object = __webpack_require__(26).Object;
100931module.exports = function create(P, D) {
100932 return $Object.create(P, D);
100933};
100934
100935
100936/***/ }),
100937/* 596 */
100938/***/ (function(module, exports, __webpack_require__) {
100939
100940__webpack_require__(630);
100941module.exports = __webpack_require__(26).Object.getPrototypeOf;
100942
100943
100944/***/ }),
100945/* 597 */
100946/***/ (function(module, exports, __webpack_require__) {
100947
100948__webpack_require__(631);
100949module.exports = __webpack_require__(26).Object.keys;
100950
100951
100952/***/ }),
100953/* 598 */
100954/***/ (function(module, exports, __webpack_require__) {
100955
100956__webpack_require__(632);
100957module.exports = __webpack_require__(26).Object.setPrototypeOf;
100958
100959
100960/***/ }),
100961/* 599 */
100962/***/ (function(module, exports, __webpack_require__) {
100963
100964__webpack_require__(640);
100965module.exports = __webpack_require__(26).Object.values;
100966
100967
100968/***/ }),
100969/* 600 */
100970/***/ (function(module, exports, __webpack_require__) {
100971
100972__webpack_require__(163);
100973__webpack_require__(104);
100974__webpack_require__(128);
100975__webpack_require__(633);
100976__webpack_require__(641);
100977__webpack_require__(642);
100978module.exports = __webpack_require__(26).Promise;
100979
100980
100981/***/ }),
100982/* 601 */
100983/***/ (function(module, exports, __webpack_require__) {
100984
100985__webpack_require__(634);
100986module.exports = __webpack_require__(26).Reflect.construct;
100987
100988
100989/***/ }),
100990/* 602 */
100991/***/ (function(module, exports, __webpack_require__) {
100992
100993__webpack_require__(163);
100994__webpack_require__(104);
100995__webpack_require__(128);
100996__webpack_require__(635);
100997__webpack_require__(645);
100998__webpack_require__(644);
100999__webpack_require__(643);
101000module.exports = __webpack_require__(26).Set;
101001
101002
101003/***/ }),
101004/* 603 */
101005/***/ (function(module, exports, __webpack_require__) {
101006
101007__webpack_require__(636);
101008__webpack_require__(163);
101009__webpack_require__(646);
101010__webpack_require__(647);
101011module.exports = __webpack_require__(26).Symbol;
101012
101013
101014/***/ }),
101015/* 604 */
101016/***/ (function(module, exports, __webpack_require__) {
101017
101018__webpack_require__(104);
101019__webpack_require__(128);
101020module.exports = __webpack_require__(230).f('iterator');
101021
101022
101023/***/ }),
101024/* 605 */
101025/***/ (function(module, exports) {
101026
101027module.exports = function () { /* empty */ };
101028
101029
101030/***/ }),
101031/* 606 */
101032/***/ (function(module, exports, __webpack_require__) {
101033
101034var forOf = __webpack_require__(121);
101035
101036module.exports = function (iter, ITERATOR) {
101037 var result = [];
101038 forOf(iter, false, result.push, result, ITERATOR);
101039 return result;
101040};
101041
101042
101043/***/ }),
101044/* 607 */
101045/***/ (function(module, exports, __webpack_require__) {
101046
101047// false -> Array#indexOf
101048// true -> Array#includes
101049var toIObject = __webpack_require__(90);
101050var toLength = __webpack_require__(161);
101051var toAbsoluteIndex = __webpack_require__(622);
101052module.exports = function (IS_INCLUDES) {
101053 return function ($this, el, fromIndex) {
101054 var O = toIObject($this);
101055 var length = toLength(O.length);
101056 var index = toAbsoluteIndex(fromIndex, length);
101057 var value;
101058 // Array#includes uses SameValueZero equality algorithm
101059 // eslint-disable-next-line no-self-compare
101060 if (IS_INCLUDES && el != el) while (length > index) {
101061 value = O[index++];
101062 // eslint-disable-next-line no-self-compare
101063 if (value != value) return true;
101064 // Array#indexOf ignores holes, Array#includes - not
101065 } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
101066 if (O[index] === el) return IS_INCLUDES || index || 0;
101067 } return !IS_INCLUDES && -1;
101068 };
101069};
101070
101071
101072/***/ }),
101073/* 608 */
101074/***/ (function(module, exports, __webpack_require__) {
101075
101076// 0 -> Array#forEach
101077// 1 -> Array#map
101078// 2 -> Array#filter
101079// 3 -> Array#some
101080// 4 -> Array#every
101081// 5 -> Array#find
101082// 6 -> Array#findIndex
101083var ctx = __webpack_require__(67);
101084var IObject = __webpack_require__(218);
101085var toObject = __webpack_require__(103);
101086var toLength = __webpack_require__(161);
101087var asc = __webpack_require__(610);
101088module.exports = function (TYPE, $create) {
101089 var IS_MAP = TYPE == 1;
101090 var IS_FILTER = TYPE == 2;
101091 var IS_SOME = TYPE == 3;
101092 var IS_EVERY = TYPE == 4;
101093 var IS_FIND_INDEX = TYPE == 6;
101094 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
101095 var create = $create || asc;
101096 return function ($this, callbackfn, that) {
101097 var O = toObject($this);
101098 var self = IObject(O);
101099 var f = ctx(callbackfn, that, 3);
101100 var length = toLength(self.length);
101101 var index = 0;
101102 var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
101103 var val, res;
101104 for (;length > index; index++) if (NO_HOLES || index in self) {
101105 val = self[index];
101106 res = f(val, index, O);
101107 if (TYPE) {
101108 if (IS_MAP) result[index] = res; // map
101109 else if (res) switch (TYPE) {
101110 case 3: return true; // some
101111 case 5: return val; // find
101112 case 6: return index; // findIndex
101113 case 2: result.push(val); // filter
101114 } else if (IS_EVERY) return false; // every
101115 }
101116 }
101117 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
101118 };
101119};
101120
101121
101122/***/ }),
101123/* 609 */
101124/***/ (function(module, exports, __webpack_require__) {
101125
101126var isObject = __webpack_require__(49);
101127var isArray = __webpack_require__(331);
101128var SPECIES = __webpack_require__(44)('species');
101129
101130module.exports = function (original) {
101131 var C;
101132 if (isArray(original)) {
101133 C = original.constructor;
101134 // cross-realm fallback
101135 if (typeof C == 'function' && (C === Array || isArray(C.prototype))) C = undefined;
101136 if (isObject(C)) {
101137 C = C[SPECIES];
101138 if (C === null) C = undefined;
101139 }
101140 } return C === undefined ? Array : C;
101141};
101142
101143
101144/***/ }),
101145/* 610 */
101146/***/ (function(module, exports, __webpack_require__) {
101147
101148// 9.4.2.3 ArraySpeciesCreate(originalArray, length)
101149var speciesConstructor = __webpack_require__(609);
101150
101151module.exports = function (original, length) {
101152 return new (speciesConstructor(original))(length);
101153};
101154
101155
101156/***/ }),
101157/* 611 */
101158/***/ (function(module, exports, __webpack_require__) {
101159
101160"use strict";
101161
101162var aFunction = __webpack_require__(88);
101163var isObject = __webpack_require__(49);
101164var invoke = __webpack_require__(329);
101165var arraySlice = [].slice;
101166var factories = {};
101167
101168var construct = function (F, len, args) {
101169 if (!(len in factories)) {
101170 for (var n = [], i = 0; i < len; i++) n[i] = 'a[' + i + ']';
101171 // eslint-disable-next-line no-new-func
101172 factories[len] = Function('F,a', 'return new F(' + n.join(',') + ')');
101173 } return factories[len](F, args);
101174};
101175
101176module.exports = Function.bind || function bind(that /* , ...args */) {
101177 var fn = aFunction(this);
101178 var partArgs = arraySlice.call(arguments, 1);
101179 var bound = function (/* args... */) {
101180 var args = partArgs.concat(arraySlice.call(arguments));
101181 return this instanceof bound ? construct(fn, args.length, args) : invoke(fn, args, that);
101182 };
101183 if (isObject(fn.prototype)) bound.prototype = fn.prototype;
101184 return bound;
101185};
101186
101187
101188/***/ }),
101189/* 612 */
101190/***/ (function(module, exports, __webpack_require__) {
101191
101192"use strict";
101193
101194var $defineProperty = __webpack_require__(63);
101195var createDesc = __webpack_require__(126);
101196
101197module.exports = function (object, index, value) {
101198 if (index in object) $defineProperty.f(object, index, createDesc(0, value));
101199 else object[index] = value;
101200};
101201
101202
101203/***/ }),
101204/* 613 */
101205/***/ (function(module, exports, __webpack_require__) {
101206
101207// all enumerable object keys, includes symbols
101208var getKeys = __webpack_require__(102);
101209var gOPS = __webpack_require__(222);
101210var pIE = __webpack_require__(125);
101211module.exports = function (it) {
101212 var result = getKeys(it);
101213 var getSymbols = gOPS.f;
101214 if (getSymbols) {
101215 var symbols = getSymbols(it);
101216 var isEnum = pIE.f;
101217 var i = 0;
101218 var key;
101219 while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
101220 } return result;
101221};
101222
101223
101224/***/ }),
101225/* 614 */
101226/***/ (function(module, exports, __webpack_require__) {
101227
101228"use strict";
101229
101230var create = __webpack_require__(124);
101231var descriptor = __webpack_require__(126);
101232var setToStringTag = __webpack_require__(127);
101233var IteratorPrototype = {};
101234
101235// 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
101236__webpack_require__(77)(IteratorPrototype, __webpack_require__(44)('iterator'), function () { return this; });
101237
101238module.exports = function (Constructor, NAME, next) {
101239 Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) });
101240 setToStringTag(Constructor, NAME + ' Iterator');
101241};
101242
101243
101244/***/ }),
101245/* 615 */
101246/***/ (function(module, exports, __webpack_require__) {
101247
101248var global = __webpack_require__(38);
101249var macrotask = __webpack_require__(347).set;
101250var Observer = global.MutationObserver || global.WebKitMutationObserver;
101251var process = global.process;
101252var Promise = global.Promise;
101253var isNode = __webpack_require__(120)(process) == 'process';
101254
101255module.exports = function () {
101256 var head, last, notify;
101257
101258 var flush = function () {
101259 var parent, fn;
101260 if (isNode && (parent = process.domain)) parent.exit();
101261 while (head) {
101262 fn = head.fn;
101263 head = head.next;
101264 try {
101265 fn();
101266 } catch (e) {
101267 if (head) notify();
101268 else last = undefined;
101269 throw e;
101270 }
101271 } last = undefined;
101272 if (parent) parent.enter();
101273 };
101274
101275 // Node.js
101276 if (isNode) {
101277 notify = function () {
101278 process.nextTick(flush);
101279 };
101280 // browsers with MutationObserver, except iOS Safari - https://github.com/zloirock/core-js/issues/339
101281 } else if (Observer && !(global.navigator && global.navigator.standalone)) {
101282 var toggle = true;
101283 var node = document.createTextNode('');
101284 new Observer(flush).observe(node, { characterData: true }); // eslint-disable-line no-new
101285 notify = function () {
101286 node.data = toggle = !toggle;
101287 };
101288 // environments with maybe non-completely correct, but existent Promise
101289 } else if (Promise && Promise.resolve) {
101290 // Promise.resolve without an argument throws an error in LG WebOS 2
101291 var promise = Promise.resolve(undefined);
101292 notify = function () {
101293 promise.then(flush);
101294 };
101295 // for other environments - macrotask based on:
101296 // - setImmediate
101297 // - MessageChannel
101298 // - window.postMessag
101299 // - onreadystatechange
101300 // - setTimeout
101301 } else {
101302 notify = function () {
101303 // strange IE + webpack dev server bug - use .call(global)
101304 macrotask.call(global, flush);
101305 };
101306 }
101307
101308 return function (fn) {
101309 var task = { fn: fn, next: undefined };
101310 if (last) last.next = task;
101311 if (!head) {
101312 head = task;
101313 notify();
101314 } last = task;
101315 };
101316};
101317
101318
101319/***/ }),
101320/* 616 */
101321/***/ (function(module, exports, __webpack_require__) {
101322
101323"use strict";
101324
101325// 19.1.2.1 Object.assign(target, source, ...)
101326var getKeys = __webpack_require__(102);
101327var gOPS = __webpack_require__(222);
101328var pIE = __webpack_require__(125);
101329var toObject = __webpack_require__(103);
101330var IObject = __webpack_require__(218);
101331var $assign = Object.assign;
101332
101333// should work with symbols and should have deterministic property order (V8 bug)
101334module.exports = !$assign || __webpack_require__(76)(function () {
101335 var A = {};
101336 var B = {};
101337 // eslint-disable-next-line no-undef
101338 var S = Symbol();
101339 var K = 'abcdefghijklmnopqrst';
101340 A[S] = 7;
101341 K.split('').forEach(function (k) { B[k] = k; });
101342 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
101343}) ? function assign(target, source) { // eslint-disable-line no-unused-vars
101344 var T = toObject(target);
101345 var aLen = arguments.length;
101346 var index = 1;
101347 var getSymbols = gOPS.f;
101348 var isEnum = pIE.f;
101349 while (aLen > index) {
101350 var S = IObject(arguments[index++]);
101351 var keys = getSymbols ? getKeys(S).concat(getSymbols(S)) : getKeys(S);
101352 var length = keys.length;
101353 var j = 0;
101354 var key;
101355 while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
101356 } return T;
101357} : $assign;
101358
101359
101360/***/ }),
101361/* 617 */
101362/***/ (function(module, exports, __webpack_require__) {
101363
101364var dP = __webpack_require__(63);
101365var anObject = __webpack_require__(58);
101366var getKeys = __webpack_require__(102);
101367
101368module.exports = __webpack_require__(68) ? Object.defineProperties : function defineProperties(O, Properties) {
101369 anObject(O);
101370 var keys = getKeys(Properties);
101371 var length = keys.length;
101372 var i = 0;
101373 var P;
101374 while (length > i) dP.f(O, P = keys[i++], Properties[P]);
101375 return O;
101376};
101377
101378
101379/***/ }),
101380/* 618 */
101381/***/ (function(module, exports, __webpack_require__) {
101382
101383// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
101384var toIObject = __webpack_require__(90);
101385var gOPN = __webpack_require__(336).f;
101386var toString = {}.toString;
101387
101388var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
101389 ? Object.getOwnPropertyNames(window) : [];
101390
101391var getWindowNames = function (it) {
101392 try {
101393 return gOPN(it);
101394 } catch (e) {
101395 return windowNames.slice();
101396 }
101397};
101398
101399module.exports.f = function getOwnPropertyNames(it) {
101400 return windowNames && toString.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(toIObject(it));
101401};
101402
101403
101404/***/ }),
101405/* 619 */
101406/***/ (function(module, exports, __webpack_require__) {
101407
101408var getKeys = __webpack_require__(102);
101409var toIObject = __webpack_require__(90);
101410var isEnum = __webpack_require__(125).f;
101411module.exports = function (isEntries) {
101412 return function (it) {
101413 var O = toIObject(it);
101414 var keys = getKeys(O);
101415 var length = keys.length;
101416 var i = 0;
101417 var result = [];
101418 var key;
101419 while (length > i) if (isEnum.call(O, key = keys[i++])) {
101420 result.push(isEntries ? [key, O[key]] : O[key]);
101421 } return result;
101422 };
101423};
101424
101425
101426/***/ }),
101427/* 620 */
101428/***/ (function(module, exports, __webpack_require__) {
101429
101430// Works with __proto__ only. Old v8 can't work with null proto objects.
101431/* eslint-disable no-proto */
101432var isObject = __webpack_require__(49);
101433var anObject = __webpack_require__(58);
101434var check = function (O, proto) {
101435 anObject(O);
101436 if (!isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
101437};
101438module.exports = {
101439 set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
101440 function (test, buggy, set) {
101441 try {
101442 set = __webpack_require__(67)(Function.call, __webpack_require__(335).f(Object.prototype, '__proto__').set, 2);
101443 set(test, []);
101444 buggy = !(test instanceof Array);
101445 } catch (e) { buggy = true; }
101446 return function setPrototypeOf(O, proto) {
101447 check(O, proto);
101448 if (buggy) O.__proto__ = proto;
101449 else set(O, proto);
101450 return O;
101451 };
101452 }({}, false) : undefined),
101453 check: check
101454};
101455
101456
101457/***/ }),
101458/* 621 */
101459/***/ (function(module, exports, __webpack_require__) {
101460
101461var toInteger = __webpack_require__(226);
101462var defined = __webpack_require__(215);
101463// true -> String#at
101464// false -> String#codePointAt
101465module.exports = function (TO_STRING) {
101466 return function (that, pos) {
101467 var s = String(defined(that));
101468 var i = toInteger(pos);
101469 var l = s.length;
101470 var a, b;
101471 if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
101472 a = s.charCodeAt(i);
101473 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
101474 ? TO_STRING ? s.charAt(i) : a
101475 : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
101476 };
101477};
101478
101479
101480/***/ }),
101481/* 622 */
101482/***/ (function(module, exports, __webpack_require__) {
101483
101484var toInteger = __webpack_require__(226);
101485var max = Math.max;
101486var min = Math.min;
101487module.exports = function (index, length) {
101488 index = toInteger(index);
101489 return index < 0 ? max(index + length, 0) : min(index, length);
101490};
101491
101492
101493/***/ }),
101494/* 623 */
101495/***/ (function(module, exports, __webpack_require__) {
101496
101497var global = __webpack_require__(38);
101498var navigator = global.navigator;
101499
101500module.exports = navigator && navigator.userAgent || '';
101501
101502
101503/***/ }),
101504/* 624 */
101505/***/ (function(module, exports, __webpack_require__) {
101506
101507var anObject = __webpack_require__(58);
101508var get = __webpack_require__(231);
101509module.exports = __webpack_require__(26).getIterator = function (it) {
101510 var iterFn = get(it);
101511 if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
101512 return anObject(iterFn.call(it));
101513};
101514
101515
101516/***/ }),
101517/* 625 */
101518/***/ (function(module, exports, __webpack_require__) {
101519
101520"use strict";
101521
101522var ctx = __webpack_require__(67);
101523var $export = __webpack_require__(33);
101524var toObject = __webpack_require__(103);
101525var call = __webpack_require__(332);
101526var isArrayIter = __webpack_require__(330);
101527var toLength = __webpack_require__(161);
101528var createProperty = __webpack_require__(612);
101529var getIterFn = __webpack_require__(231);
101530
101531$export($export.S + $export.F * !__webpack_require__(333)(function (iter) { Array.from(iter); }), 'Array', {
101532 // 22.1.2.1 Array.from(arrayLike, mapfn = undefined, thisArg = undefined)
101533 from: function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
101534 var O = toObject(arrayLike);
101535 var C = typeof this == 'function' ? this : Array;
101536 var aLen = arguments.length;
101537 var mapfn = aLen > 1 ? arguments[1] : undefined;
101538 var mapping = mapfn !== undefined;
101539 var index = 0;
101540 var iterFn = getIterFn(O);
101541 var length, result, step, iterator;
101542 if (mapping) mapfn = ctx(mapfn, aLen > 2 ? arguments[2] : undefined, 2);
101543 // if object isn't iterable or it's array with default iterator - use simple case
101544 if (iterFn != undefined && !(C == Array && isArrayIter(iterFn))) {
101545 for (iterator = iterFn.call(O), result = new C(); !(step = iterator.next()).done; index++) {
101546 createProperty(result, index, mapping ? call(iterator, mapfn, [step.value, index], true) : step.value);
101547 }
101548 } else {
101549 length = toLength(O.length);
101550 for (result = new C(length); length > index; index++) {
101551 createProperty(result, index, mapping ? mapfn(O[index], index) : O[index]);
101552 }
101553 }
101554 result.length = index;
101555 return result;
101556 }
101557});
101558
101559
101560/***/ }),
101561/* 626 */
101562/***/ (function(module, exports, __webpack_require__) {
101563
101564"use strict";
101565
101566var addToUnscopables = __webpack_require__(605);
101567var step = __webpack_require__(334);
101568var Iterators = __webpack_require__(122);
101569var toIObject = __webpack_require__(90);
101570
101571// 22.1.3.4 Array.prototype.entries()
101572// 22.1.3.13 Array.prototype.keys()
101573// 22.1.3.29 Array.prototype.values()
101574// 22.1.3.30 Array.prototype[@@iterator]()
101575module.exports = __webpack_require__(219)(Array, 'Array', function (iterated, kind) {
101576 this._t = toIObject(iterated); // target
101577 this._i = 0; // next index
101578 this._k = kind; // kind
101579// 22.1.5.2.1 %ArrayIteratorPrototype%.next()
101580}, function () {
101581 var O = this._t;
101582 var kind = this._k;
101583 var index = this._i++;
101584 if (!O || index >= O.length) {
101585 this._t = undefined;
101586 return step(1);
101587 }
101588 if (kind == 'keys') return step(0, index);
101589 if (kind == 'values') return step(0, O[index]);
101590 return step(0, [index, O[index]]);
101591}, 'values');
101592
101593// argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
101594Iterators.Arguments = Iterators.Array;
101595
101596addToUnscopables('keys');
101597addToUnscopables('values');
101598addToUnscopables('entries');
101599
101600
101601/***/ }),
101602/* 627 */
101603/***/ (function(module, exports, __webpack_require__) {
101604
101605"use strict";
101606
101607var strong = __webpack_require__(324);
101608var validate = __webpack_require__(228);
101609var MAP = 'Map';
101610
101611// 23.1 Map Objects
101612module.exports = __webpack_require__(326)(MAP, function (get) {
101613 return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
101614}, {
101615 // 23.1.3.6 Map.prototype.get(key)
101616 get: function get(key) {
101617 var entry = strong.getEntry(validate(this, MAP), key);
101618 return entry && entry.v;
101619 },
101620 // 23.1.3.9 Map.prototype.set(key, value)
101621 set: function set(key, value) {
101622 return strong.def(validate(this, MAP), key === 0 ? 0 : key, value);
101623 }
101624}, strong, true);
101625
101626
101627/***/ }),
101628/* 628 */
101629/***/ (function(module, exports, __webpack_require__) {
101630
101631// 19.1.3.1 Object.assign(target, source)
101632var $export = __webpack_require__(33);
101633
101634$export($export.S + $export.F, 'Object', { assign: __webpack_require__(616) });
101635
101636
101637/***/ }),
101638/* 629 */
101639/***/ (function(module, exports, __webpack_require__) {
101640
101641var $export = __webpack_require__(33);
101642// 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
101643$export($export.S, 'Object', { create: __webpack_require__(124) });
101644
101645
101646/***/ }),
101647/* 630 */
101648/***/ (function(module, exports, __webpack_require__) {
101649
101650// 19.1.2.9 Object.getPrototypeOf(O)
101651var toObject = __webpack_require__(103);
101652var $getPrototypeOf = __webpack_require__(337);
101653
101654__webpack_require__(339)('getPrototypeOf', function () {
101655 return function getPrototypeOf(it) {
101656 return $getPrototypeOf(toObject(it));
101657 };
101658});
101659
101660
101661/***/ }),
101662/* 631 */
101663/***/ (function(module, exports, __webpack_require__) {
101664
101665// 19.1.2.14 Object.keys(O)
101666var toObject = __webpack_require__(103);
101667var $keys = __webpack_require__(102);
101668
101669__webpack_require__(339)('keys', function () {
101670 return function keys(it) {
101671 return $keys(toObject(it));
101672 };
101673});
101674
101675
101676/***/ }),
101677/* 632 */
101678/***/ (function(module, exports, __webpack_require__) {
101679
101680// 19.1.3.19 Object.setPrototypeOf(O, proto)
101681var $export = __webpack_require__(33);
101682$export($export.S, 'Object', { setPrototypeOf: __webpack_require__(620).set });
101683
101684
101685/***/ }),
101686/* 633 */
101687/***/ (function(module, exports, __webpack_require__) {
101688
101689"use strict";
101690
101691var LIBRARY = __webpack_require__(123);
101692var global = __webpack_require__(38);
101693var ctx = __webpack_require__(67);
101694var classof = __webpack_require__(214);
101695var $export = __webpack_require__(33);
101696var isObject = __webpack_require__(49);
101697var aFunction = __webpack_require__(88);
101698var anInstance = __webpack_require__(213);
101699var forOf = __webpack_require__(121);
101700var speciesConstructor = __webpack_require__(346);
101701var task = __webpack_require__(347).set;
101702var microtask = __webpack_require__(615)();
101703var newPromiseCapabilityModule = __webpack_require__(221);
101704var perform = __webpack_require__(340);
101705var userAgent = __webpack_require__(623);
101706var promiseResolve = __webpack_require__(341);
101707var PROMISE = 'Promise';
101708var TypeError = global.TypeError;
101709var process = global.process;
101710var versions = process && process.versions;
101711var v8 = versions && versions.v8 || '';
101712var $Promise = global[PROMISE];
101713var isNode = classof(process) == 'process';
101714var empty = function () { /* empty */ };
101715var Internal, newGenericPromiseCapability, OwnPromiseCapability, Wrapper;
101716var newPromiseCapability = newGenericPromiseCapability = newPromiseCapabilityModule.f;
101717
101718var USE_NATIVE = !!function () {
101719 try {
101720 // correct subclassing with @@species support
101721 var promise = $Promise.resolve(1);
101722 var FakePromise = (promise.constructor = {})[__webpack_require__(44)('species')] = function (exec) {
101723 exec(empty, empty);
101724 };
101725 // unhandled rejections tracking support, NodeJS Promise without it fails @@species test
101726 return (isNode || typeof PromiseRejectionEvent == 'function')
101727 && promise.then(empty) instanceof FakePromise
101728 // v8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
101729 // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
101730 // we can't detect it synchronously, so just check versions
101731 && v8.indexOf('6.6') !== 0
101732 && userAgent.indexOf('Chrome/66') === -1;
101733 } catch (e) { /* empty */ }
101734}();
101735
101736// helpers
101737var isThenable = function (it) {
101738 var then;
101739 return isObject(it) && typeof (then = it.then) == 'function' ? then : false;
101740};
101741var notify = function (promise, isReject) {
101742 if (promise._n) return;
101743 promise._n = true;
101744 var chain = promise._c;
101745 microtask(function () {
101746 var value = promise._v;
101747 var ok = promise._s == 1;
101748 var i = 0;
101749 var run = function (reaction) {
101750 var handler = ok ? reaction.ok : reaction.fail;
101751 var resolve = reaction.resolve;
101752 var reject = reaction.reject;
101753 var domain = reaction.domain;
101754 var result, then, exited;
101755 try {
101756 if (handler) {
101757 if (!ok) {
101758 if (promise._h == 2) onHandleUnhandled(promise);
101759 promise._h = 1;
101760 }
101761 if (handler === true) result = value;
101762 else {
101763 if (domain) domain.enter();
101764 result = handler(value); // may throw
101765 if (domain) {
101766 domain.exit();
101767 exited = true;
101768 }
101769 }
101770 if (result === reaction.promise) {
101771 reject(TypeError('Promise-chain cycle'));
101772 } else if (then = isThenable(result)) {
101773 then.call(result, resolve, reject);
101774 } else resolve(result);
101775 } else reject(value);
101776 } catch (e) {
101777 if (domain && !exited) domain.exit();
101778 reject(e);
101779 }
101780 };
101781 while (chain.length > i) run(chain[i++]); // variable length - can't use forEach
101782 promise._c = [];
101783 promise._n = false;
101784 if (isReject && !promise._h) onUnhandled(promise);
101785 });
101786};
101787var onUnhandled = function (promise) {
101788 task.call(global, function () {
101789 var value = promise._v;
101790 var unhandled = isUnhandled(promise);
101791 var result, handler, console;
101792 if (unhandled) {
101793 result = perform(function () {
101794 if (isNode) {
101795 process.emit('unhandledRejection', value, promise);
101796 } else if (handler = global.onunhandledrejection) {
101797 handler({ promise: promise, reason: value });
101798 } else if ((console = global.console) && console.error) {
101799 console.error('Unhandled promise rejection', value);
101800 }
101801 });
101802 // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
101803 promise._h = isNode || isUnhandled(promise) ? 2 : 1;
101804 } promise._a = undefined;
101805 if (unhandled && result.e) throw result.v;
101806 });
101807};
101808var isUnhandled = function (promise) {
101809 return promise._h !== 1 && (promise._a || promise._c).length === 0;
101810};
101811var onHandleUnhandled = function (promise) {
101812 task.call(global, function () {
101813 var handler;
101814 if (isNode) {
101815 process.emit('rejectionHandled', promise);
101816 } else if (handler = global.onrejectionhandled) {
101817 handler({ promise: promise, reason: promise._v });
101818 }
101819 });
101820};
101821var $reject = function (value) {
101822 var promise = this;
101823 if (promise._d) return;
101824 promise._d = true;
101825 promise = promise._w || promise; // unwrap
101826 promise._v = value;
101827 promise._s = 2;
101828 if (!promise._a) promise._a = promise._c.slice();
101829 notify(promise, true);
101830};
101831var $resolve = function (value) {
101832 var promise = this;
101833 var then;
101834 if (promise._d) return;
101835 promise._d = true;
101836 promise = promise._w || promise; // unwrap
101837 try {
101838 if (promise === value) throw TypeError("Promise can't be resolved itself");
101839 if (then = isThenable(value)) {
101840 microtask(function () {
101841 var wrapper = { _w: promise, _d: false }; // wrap
101842 try {
101843 then.call(value, ctx($resolve, wrapper, 1), ctx($reject, wrapper, 1));
101844 } catch (e) {
101845 $reject.call(wrapper, e);
101846 }
101847 });
101848 } else {
101849 promise._v = value;
101850 promise._s = 1;
101851 notify(promise, false);
101852 }
101853 } catch (e) {
101854 $reject.call({ _w: promise, _d: false }, e); // wrap
101855 }
101856};
101857
101858// constructor polyfill
101859if (!USE_NATIVE) {
101860 // 25.4.3.1 Promise(executor)
101861 $Promise = function Promise(executor) {
101862 anInstance(this, $Promise, PROMISE, '_h');
101863 aFunction(executor);
101864 Internal.call(this);
101865 try {
101866 executor(ctx($resolve, this, 1), ctx($reject, this, 1));
101867 } catch (err) {
101868 $reject.call(this, err);
101869 }
101870 };
101871 // eslint-disable-next-line no-unused-vars
101872 Internal = function Promise(executor) {
101873 this._c = []; // <- awaiting reactions
101874 this._a = undefined; // <- checked in isUnhandled reactions
101875 this._s = 0; // <- state
101876 this._d = false; // <- done
101877 this._v = undefined; // <- value
101878 this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled
101879 this._n = false; // <- notify
101880 };
101881 Internal.prototype = __webpack_require__(223)($Promise.prototype, {
101882 // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected)
101883 then: function then(onFulfilled, onRejected) {
101884 var reaction = newPromiseCapability(speciesConstructor(this, $Promise));
101885 reaction.ok = typeof onFulfilled == 'function' ? onFulfilled : true;
101886 reaction.fail = typeof onRejected == 'function' && onRejected;
101887 reaction.domain = isNode ? process.domain : undefined;
101888 this._c.push(reaction);
101889 if (this._a) this._a.push(reaction);
101890 if (this._s) notify(this, false);
101891 return reaction.promise;
101892 },
101893 // 25.4.5.1 Promise.prototype.catch(onRejected)
101894 'catch': function (onRejected) {
101895 return this.then(undefined, onRejected);
101896 }
101897 });
101898 OwnPromiseCapability = function () {
101899 var promise = new Internal();
101900 this.promise = promise;
101901 this.resolve = ctx($resolve, promise, 1);
101902 this.reject = ctx($reject, promise, 1);
101903 };
101904 newPromiseCapabilityModule.f = newPromiseCapability = function (C) {
101905 return C === $Promise || C === Wrapper
101906 ? new OwnPromiseCapability(C)
101907 : newGenericPromiseCapability(C);
101908 };
101909}
101910
101911$export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise });
101912__webpack_require__(127)($Promise, PROMISE);
101913__webpack_require__(345)(PROMISE);
101914Wrapper = __webpack_require__(26)[PROMISE];
101915
101916// statics
101917$export($export.S + $export.F * !USE_NATIVE, PROMISE, {
101918 // 25.4.4.5 Promise.reject(r)
101919 reject: function reject(r) {
101920 var capability = newPromiseCapability(this);
101921 var $$reject = capability.reject;
101922 $$reject(r);
101923 return capability.promise;
101924 }
101925});
101926$export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, {
101927 // 25.4.4.6 Promise.resolve(x)
101928 resolve: function resolve(x) {
101929 return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x);
101930 }
101931});
101932$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(333)(function (iter) {
101933 $Promise.all(iter)['catch'](empty);
101934})), PROMISE, {
101935 // 25.4.4.1 Promise.all(iterable)
101936 all: function all(iterable) {
101937 var C = this;
101938 var capability = newPromiseCapability(C);
101939 var resolve = capability.resolve;
101940 var reject = capability.reject;
101941 var result = perform(function () {
101942 var values = [];
101943 var index = 0;
101944 var remaining = 1;
101945 forOf(iterable, false, function (promise) {
101946 var $index = index++;
101947 var alreadyCalled = false;
101948 values.push(undefined);
101949 remaining++;
101950 C.resolve(promise).then(function (value) {
101951 if (alreadyCalled) return;
101952 alreadyCalled = true;
101953 values[$index] = value;
101954 --remaining || resolve(values);
101955 }, reject);
101956 });
101957 --remaining || resolve(values);
101958 });
101959 if (result.e) reject(result.v);
101960 return capability.promise;
101961 },
101962 // 25.4.4.4 Promise.race(iterable)
101963 race: function race(iterable) {
101964 var C = this;
101965 var capability = newPromiseCapability(C);
101966 var reject = capability.reject;
101967 var result = perform(function () {
101968 forOf(iterable, false, function (promise) {
101969 C.resolve(promise).then(capability.resolve, reject);
101970 });
101971 });
101972 if (result.e) reject(result.v);
101973 return capability.promise;
101974 }
101975});
101976
101977
101978/***/ }),
101979/* 634 */
101980/***/ (function(module, exports, __webpack_require__) {
101981
101982// 26.1.2 Reflect.construct(target, argumentsList [, newTarget])
101983var $export = __webpack_require__(33);
101984var create = __webpack_require__(124);
101985var aFunction = __webpack_require__(88);
101986var anObject = __webpack_require__(58);
101987var isObject = __webpack_require__(49);
101988var fails = __webpack_require__(76);
101989var bind = __webpack_require__(611);
101990var rConstruct = (__webpack_require__(38).Reflect || {}).construct;
101991
101992// MS Edge supports only 2 arguments and argumentsList argument is optional
101993// FF Nightly sets third argument as `new.target`, but does not create `this` from it
101994var NEW_TARGET_BUG = fails(function () {
101995 function F() { /* empty */ }
101996 return !(rConstruct(function () { /* empty */ }, [], F) instanceof F);
101997});
101998var ARGS_BUG = !fails(function () {
101999 rConstruct(function () { /* empty */ });
102000});
102001
102002$export($export.S + $export.F * (NEW_TARGET_BUG || ARGS_BUG), 'Reflect', {
102003 construct: function construct(Target, args /* , newTarget */) {
102004 aFunction(Target);
102005 anObject(args);
102006 var newTarget = arguments.length < 3 ? Target : aFunction(arguments[2]);
102007 if (ARGS_BUG && !NEW_TARGET_BUG) return rConstruct(Target, args, newTarget);
102008 if (Target == newTarget) {
102009 // w/o altered newTarget, optimization for 0-4 arguments
102010 switch (args.length) {
102011 case 0: return new Target();
102012 case 1: return new Target(args[0]);
102013 case 2: return new Target(args[0], args[1]);
102014 case 3: return new Target(args[0], args[1], args[2]);
102015 case 4: return new Target(args[0], args[1], args[2], args[3]);
102016 }
102017 // w/o altered newTarget, lot of arguments case
102018 var $args = [null];
102019 $args.push.apply($args, args);
102020 return new (bind.apply(Target, $args))();
102021 }
102022 // with altered newTarget, not support built-in constructors
102023 var proto = newTarget.prototype;
102024 var instance = create(isObject(proto) ? proto : Object.prototype);
102025 var result = Function.apply.call(Target, instance, args);
102026 return isObject(result) ? result : instance;
102027 }
102028});
102029
102030
102031/***/ }),
102032/* 635 */
102033/***/ (function(module, exports, __webpack_require__) {
102034
102035"use strict";
102036
102037var strong = __webpack_require__(324);
102038var validate = __webpack_require__(228);
102039var SET = 'Set';
102040
102041// 23.2 Set Objects
102042module.exports = __webpack_require__(326)(SET, function (get) {
102043 return function Set() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
102044}, {
102045 // 23.2.3.1 Set.prototype.add(value)
102046 add: function add(value) {
102047 return strong.def(validate(this, SET), value = value === 0 ? 0 : value, value);
102048 }
102049}, strong);
102050
102051
102052/***/ }),
102053/* 636 */
102054/***/ (function(module, exports, __webpack_require__) {
102055
102056"use strict";
102057
102058// ECMAScript 6 symbols shim
102059var global = __webpack_require__(38);
102060var has = __webpack_require__(89);
102061var DESCRIPTORS = __webpack_require__(68);
102062var $export = __webpack_require__(33);
102063var redefine = __webpack_require__(342);
102064var META = __webpack_require__(220).KEY;
102065var $fails = __webpack_require__(76);
102066var shared = __webpack_require__(225);
102067var setToStringTag = __webpack_require__(127);
102068var uid = __webpack_require__(162);
102069var wks = __webpack_require__(44);
102070var wksExt = __webpack_require__(230);
102071var wksDefine = __webpack_require__(229);
102072var enumKeys = __webpack_require__(613);
102073var isArray = __webpack_require__(331);
102074var anObject = __webpack_require__(58);
102075var isObject = __webpack_require__(49);
102076var toIObject = __webpack_require__(90);
102077var toPrimitive = __webpack_require__(227);
102078var createDesc = __webpack_require__(126);
102079var _create = __webpack_require__(124);
102080var gOPNExt = __webpack_require__(618);
102081var $GOPD = __webpack_require__(335);
102082var $DP = __webpack_require__(63);
102083var $keys = __webpack_require__(102);
102084var gOPD = $GOPD.f;
102085var dP = $DP.f;
102086var gOPN = gOPNExt.f;
102087var $Symbol = global.Symbol;
102088var $JSON = global.JSON;
102089var _stringify = $JSON && $JSON.stringify;
102090var PROTOTYPE = 'prototype';
102091var HIDDEN = wks('_hidden');
102092var TO_PRIMITIVE = wks('toPrimitive');
102093var isEnum = {}.propertyIsEnumerable;
102094var SymbolRegistry = shared('symbol-registry');
102095var AllSymbols = shared('symbols');
102096var OPSymbols = shared('op-symbols');
102097var ObjectProto = Object[PROTOTYPE];
102098var USE_NATIVE = typeof $Symbol == 'function';
102099var QObject = global.QObject;
102100// Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
102101var setter = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
102102
102103// fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
102104var setSymbolDesc = DESCRIPTORS && $fails(function () {
102105 return _create(dP({}, 'a', {
102106 get: function () { return dP(this, 'a', { value: 7 }).a; }
102107 })).a != 7;
102108}) ? function (it, key, D) {
102109 var protoDesc = gOPD(ObjectProto, key);
102110 if (protoDesc) delete ObjectProto[key];
102111 dP(it, key, D);
102112 if (protoDesc && it !== ObjectProto) dP(ObjectProto, key, protoDesc);
102113} : dP;
102114
102115var wrap = function (tag) {
102116 var sym = AllSymbols[tag] = _create($Symbol[PROTOTYPE]);
102117 sym._k = tag;
102118 return sym;
102119};
102120
102121var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
102122 return typeof it == 'symbol';
102123} : function (it) {
102124 return it instanceof $Symbol;
102125};
102126
102127var $defineProperty = function defineProperty(it, key, D) {
102128 if (it === ObjectProto) $defineProperty(OPSymbols, key, D);
102129 anObject(it);
102130 key = toPrimitive(key, true);
102131 anObject(D);
102132 if (has(AllSymbols, key)) {
102133 if (!D.enumerable) {
102134 if (!has(it, HIDDEN)) dP(it, HIDDEN, createDesc(1, {}));
102135 it[HIDDEN][key] = true;
102136 } else {
102137 if (has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
102138 D = _create(D, { enumerable: createDesc(0, false) });
102139 } return setSymbolDesc(it, key, D);
102140 } return dP(it, key, D);
102141};
102142var $defineProperties = function defineProperties(it, P) {
102143 anObject(it);
102144 var keys = enumKeys(P = toIObject(P));
102145 var i = 0;
102146 var l = keys.length;
102147 var key;
102148 while (l > i) $defineProperty(it, key = keys[i++], P[key]);
102149 return it;
102150};
102151var $create = function create(it, P) {
102152 return P === undefined ? _create(it) : $defineProperties(_create(it), P);
102153};
102154var $propertyIsEnumerable = function propertyIsEnumerable(key) {
102155 var E = isEnum.call(this, key = toPrimitive(key, true));
102156 if (this === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return false;
102157 return E || !has(this, key) || !has(AllSymbols, key) || has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
102158};
102159var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
102160 it = toIObject(it);
102161 key = toPrimitive(key, true);
102162 if (it === ObjectProto && has(AllSymbols, key) && !has(OPSymbols, key)) return;
102163 var D = gOPD(it, key);
102164 if (D && has(AllSymbols, key) && !(has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
102165 return D;
102166};
102167var $getOwnPropertyNames = function getOwnPropertyNames(it) {
102168 var names = gOPN(toIObject(it));
102169 var result = [];
102170 var i = 0;
102171 var key;
102172 while (names.length > i) {
102173 if (!has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
102174 } return result;
102175};
102176var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
102177 var IS_OP = it === ObjectProto;
102178 var names = gOPN(IS_OP ? OPSymbols : toIObject(it));
102179 var result = [];
102180 var i = 0;
102181 var key;
102182 while (names.length > i) {
102183 if (has(AllSymbols, key = names[i++]) && (IS_OP ? has(ObjectProto, key) : true)) result.push(AllSymbols[key]);
102184 } return result;
102185};
102186
102187// 19.4.1.1 Symbol([description])
102188if (!USE_NATIVE) {
102189 $Symbol = function Symbol() {
102190 if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
102191 var tag = uid(arguments.length > 0 ? arguments[0] : undefined);
102192 var $set = function (value) {
102193 if (this === ObjectProto) $set.call(OPSymbols, value);
102194 if (has(this, HIDDEN) && has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
102195 setSymbolDesc(this, tag, createDesc(1, value));
102196 };
102197 if (DESCRIPTORS && setter) setSymbolDesc(ObjectProto, tag, { configurable: true, set: $set });
102198 return wrap(tag);
102199 };
102200 redefine($Symbol[PROTOTYPE], 'toString', function toString() {
102201 return this._k;
102202 });
102203
102204 $GOPD.f = $getOwnPropertyDescriptor;
102205 $DP.f = $defineProperty;
102206 __webpack_require__(336).f = gOPNExt.f = $getOwnPropertyNames;
102207 __webpack_require__(125).f = $propertyIsEnumerable;
102208 __webpack_require__(222).f = $getOwnPropertySymbols;
102209
102210 if (DESCRIPTORS && !__webpack_require__(123)) {
102211 redefine(ObjectProto, 'propertyIsEnumerable', $propertyIsEnumerable, true);
102212 }
102213
102214 wksExt.f = function (name) {
102215 return wrap(wks(name));
102216 };
102217}
102218
102219$export($export.G + $export.W + $export.F * !USE_NATIVE, { Symbol: $Symbol });
102220
102221for (var es6Symbols = (
102222 // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
102223 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
102224).split(','), j = 0; es6Symbols.length > j;)wks(es6Symbols[j++]);
102225
102226for (var wellKnownSymbols = $keys(wks.store), k = 0; wellKnownSymbols.length > k;) wksDefine(wellKnownSymbols[k++]);
102227
102228$export($export.S + $export.F * !USE_NATIVE, 'Symbol', {
102229 // 19.4.2.1 Symbol.for(key)
102230 'for': function (key) {
102231 return has(SymbolRegistry, key += '')
102232 ? SymbolRegistry[key]
102233 : SymbolRegistry[key] = $Symbol(key);
102234 },
102235 // 19.4.2.5 Symbol.keyFor(sym)
102236 keyFor: function keyFor(sym) {
102237 if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
102238 for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
102239 },
102240 useSetter: function () { setter = true; },
102241 useSimple: function () { setter = false; }
102242});
102243
102244$export($export.S + $export.F * !USE_NATIVE, 'Object', {
102245 // 19.1.2.2 Object.create(O [, Properties])
102246 create: $create,
102247 // 19.1.2.4 Object.defineProperty(O, P, Attributes)
102248 defineProperty: $defineProperty,
102249 // 19.1.2.3 Object.defineProperties(O, Properties)
102250 defineProperties: $defineProperties,
102251 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
102252 getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
102253 // 19.1.2.7 Object.getOwnPropertyNames(O)
102254 getOwnPropertyNames: $getOwnPropertyNames,
102255 // 19.1.2.8 Object.getOwnPropertySymbols(O)
102256 getOwnPropertySymbols: $getOwnPropertySymbols
102257});
102258
102259// 24.3.2 JSON.stringify(value [, replacer [, space]])
102260$JSON && $export($export.S + $export.F * (!USE_NATIVE || $fails(function () {
102261 var S = $Symbol();
102262 // MS Edge converts symbol values to JSON as {}
102263 // WebKit converts symbol values to JSON as null
102264 // V8 throws on boxed symbols
102265 return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
102266})), 'JSON', {
102267 stringify: function stringify(it) {
102268 var args = [it];
102269 var i = 1;
102270 var replacer, $replacer;
102271 while (arguments.length > i) args.push(arguments[i++]);
102272 $replacer = replacer = args[1];
102273 if (!isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
102274 if (!isArray(replacer)) replacer = function (key, value) {
102275 if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
102276 if (!isSymbol(value)) return value;
102277 };
102278 args[1] = replacer;
102279 return _stringify.apply($JSON, args);
102280 }
102281});
102282
102283// 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
102284$Symbol[PROTOTYPE][TO_PRIMITIVE] || __webpack_require__(77)($Symbol[PROTOTYPE], TO_PRIMITIVE, $Symbol[PROTOTYPE].valueOf);
102285// 19.4.3.5 Symbol.prototype[@@toStringTag]
102286setToStringTag($Symbol, 'Symbol');
102287// 20.2.1.9 Math[@@toStringTag]
102288setToStringTag(Math, 'Math', true);
102289// 24.3.3 JSON[@@toStringTag]
102290setToStringTag(global.JSON, 'JSON', true);
102291
102292
102293/***/ }),
102294/* 637 */
102295/***/ (function(module, exports, __webpack_require__) {
102296
102297// https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
102298__webpack_require__(343)('Map');
102299
102300
102301/***/ }),
102302/* 638 */
102303/***/ (function(module, exports, __webpack_require__) {
102304
102305// https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
102306__webpack_require__(344)('Map');
102307
102308
102309/***/ }),
102310/* 639 */
102311/***/ (function(module, exports, __webpack_require__) {
102312
102313// https://github.com/DavidBruant/Map-Set.prototype.toJSON
102314var $export = __webpack_require__(33);
102315
102316$export($export.P + $export.R, 'Map', { toJSON: __webpack_require__(325)('Map') });
102317
102318
102319/***/ }),
102320/* 640 */
102321/***/ (function(module, exports, __webpack_require__) {
102322
102323// https://github.com/tc39/proposal-object-values-entries
102324var $export = __webpack_require__(33);
102325var $values = __webpack_require__(619)(false);
102326
102327$export($export.S, 'Object', {
102328 values: function values(it) {
102329 return $values(it);
102330 }
102331});
102332
102333
102334/***/ }),
102335/* 641 */
102336/***/ (function(module, exports, __webpack_require__) {
102337
102338"use strict";
102339// https://github.com/tc39/proposal-promise-finally
102340
102341var $export = __webpack_require__(33);
102342var core = __webpack_require__(26);
102343var global = __webpack_require__(38);
102344var speciesConstructor = __webpack_require__(346);
102345var promiseResolve = __webpack_require__(341);
102346
102347$export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) {
102348 var C = speciesConstructor(this, core.Promise || global.Promise);
102349 var isFunction = typeof onFinally == 'function';
102350 return this.then(
102351 isFunction ? function (x) {
102352 return promiseResolve(C, onFinally()).then(function () { return x; });
102353 } : onFinally,
102354 isFunction ? function (e) {
102355 return promiseResolve(C, onFinally()).then(function () { throw e; });
102356 } : onFinally
102357 );
102358} });
102359
102360
102361/***/ }),
102362/* 642 */
102363/***/ (function(module, exports, __webpack_require__) {
102364
102365"use strict";
102366
102367// https://github.com/tc39/proposal-promise-try
102368var $export = __webpack_require__(33);
102369var newPromiseCapability = __webpack_require__(221);
102370var perform = __webpack_require__(340);
102371
102372$export($export.S, 'Promise', { 'try': function (callbackfn) {
102373 var promiseCapability = newPromiseCapability.f(this);
102374 var result = perform(callbackfn);
102375 (result.e ? promiseCapability.reject : promiseCapability.resolve)(result.v);
102376 return promiseCapability.promise;
102377} });
102378
102379
102380/***/ }),
102381/* 643 */
102382/***/ (function(module, exports, __webpack_require__) {
102383
102384// https://tc39.github.io/proposal-setmap-offrom/#sec-set.from
102385__webpack_require__(343)('Set');
102386
102387
102388/***/ }),
102389/* 644 */
102390/***/ (function(module, exports, __webpack_require__) {
102391
102392// https://tc39.github.io/proposal-setmap-offrom/#sec-set.of
102393__webpack_require__(344)('Set');
102394
102395
102396/***/ }),
102397/* 645 */
102398/***/ (function(module, exports, __webpack_require__) {
102399
102400// https://github.com/DavidBruant/Map-Set.prototype.toJSON
102401var $export = __webpack_require__(33);
102402
102403$export($export.P + $export.R, 'Set', { toJSON: __webpack_require__(325)('Set') });
102404
102405
102406/***/ }),
102407/* 646 */
102408/***/ (function(module, exports, __webpack_require__) {
102409
102410__webpack_require__(229)('asyncIterator');
102411
102412
102413/***/ }),
102414/* 647 */
102415/***/ (function(module, exports, __webpack_require__) {
102416
102417__webpack_require__(229)('observable');
102418
102419
102420/***/ }),
102421/* 648 */
102422/***/ (function(module, exports, __webpack_require__) {
102423
102424"use strict";
102425
102426var arrayFindIndex = __webpack_require__(452);
102427
102428module.exports = function () {
102429 var unhandledRejections = [];
102430
102431 function onUnhandledRejection(reason, promise) {
102432 unhandledRejections.push({reason: reason, promise: promise});
102433 }
102434
102435 function onRejectionHandled(promise) {
102436 var index = arrayFindIndex(unhandledRejections, function (x) {
102437 return x.promise === promise;
102438 });
102439
102440 unhandledRejections.splice(index, 1);
102441 }
102442
102443 function currentlyUnhandled() {
102444 return unhandledRejections.map(function (entry) {
102445 return {
102446 reason: entry.reason,
102447 promise: entry.promise
102448 };
102449 });
102450 }
102451
102452 return {
102453 onUnhandledRejection: onUnhandledRejection,
102454 onRejectionHandled: onRejectionHandled,
102455 currentlyUnhandled: currentlyUnhandled
102456 };
102457};
102458
102459
102460/***/ }),
102461/* 649 */
102462/***/ (function(module, exports, __webpack_require__) {
102463
102464"use strict";
102465
102466var core = __webpack_require__(648);
102467
102468module.exports = function (p) {
102469 p = p || process;
102470 var c = core();
102471
102472 p.on('unhandledRejection', c.onUnhandledRejection);
102473 p.on('rejectionHandled', c.onRejectionHandled);
102474
102475 return c.currentlyUnhandled;
102476};
102477
102478
102479/***/ }),
102480/* 650 */
102481/***/ (function(module, exports, __webpack_require__) {
102482
102483/**
102484 * This is the web browser implementation of `debug()`.
102485 *
102486 * Expose `debug()` as the module.
102487 */
102488
102489exports = module.exports = __webpack_require__(348);
102490exports.log = log;
102491exports.formatArgs = formatArgs;
102492exports.save = save;
102493exports.load = load;
102494exports.useColors = useColors;
102495exports.storage = 'undefined' != typeof chrome
102496 && 'undefined' != typeof chrome.storage
102497 ? chrome.storage.local
102498 : localstorage();
102499
102500/**
102501 * Colors.
102502 */
102503
102504exports.colors = [
102505 '#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC',
102506 '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF',
102507 '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC',
102508 '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF',
102509 '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC',
102510 '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033',
102511 '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366',
102512 '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933',
102513 '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC',
102514 '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF',
102515 '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'
102516];
102517
102518/**
102519 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
102520 * and the Firebug extension (any Firefox version) are known
102521 * to support "%c" CSS customizations.
102522 *
102523 * TODO: add a `localStorage` variable to explicitly enable/disable colors
102524 */
102525
102526function useColors() {
102527 // NB: In an Electron preload script, document will be defined but not fully
102528 // initialized. Since we know we're in Chrome, we'll just detect this case
102529 // explicitly
102530 if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
102531 return true;
102532 }
102533
102534 // Internet Explorer and Edge do not support colors.
102535 if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
102536 return false;
102537 }
102538
102539 // is webkit? http://stackoverflow.com/a/16459606/376773
102540 // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
102541 return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
102542 // is firebug? http://stackoverflow.com/a/398120/376773
102543 (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
102544 // is firefox >= v31?
102545 // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
102546 (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
102547 // double check webkit in userAgent just in case we are in a worker
102548 (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
102549}
102550
102551/**
102552 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
102553 */
102554
102555exports.formatters.j = function(v) {
102556 try {
102557 return JSON.stringify(v);
102558 } catch (err) {
102559 return '[UnexpectedJSONParseError]: ' + err.message;
102560 }
102561};
102562
102563
102564/**
102565 * Colorize log arguments if enabled.
102566 *
102567 * @api public
102568 */
102569
102570function formatArgs(args) {
102571 var useColors = this.useColors;
102572
102573 args[0] = (useColors ? '%c' : '')
102574 + this.namespace
102575 + (useColors ? ' %c' : ' ')
102576 + args[0]
102577 + (useColors ? '%c ' : ' ')
102578 + '+' + exports.humanize(this.diff);
102579
102580 if (!useColors) return;
102581
102582 var c = 'color: ' + this.color;
102583 args.splice(1, 0, c, 'color: inherit')
102584
102585 // the final "%c" is somewhat tricky, because there could be other
102586 // arguments passed either before or after the %c, so we need to
102587 // figure out the correct index to insert the CSS into
102588 var index = 0;
102589 var lastC = 0;
102590 args[0].replace(/%[a-zA-Z%]/g, function(match) {
102591 if ('%%' === match) return;
102592 index++;
102593 if ('%c' === match) {
102594 // we only are interested in the *last* %c
102595 // (the user may have provided their own)
102596 lastC = index;
102597 }
102598 });
102599
102600 args.splice(lastC, 0, c);
102601}
102602
102603/**
102604 * Invokes `console.log()` when available.
102605 * No-op when `console.log` is not a "function".
102606 *
102607 * @api public
102608 */
102609
102610function log() {
102611 // this hackery is required for IE8/9, where
102612 // the `console.log` function doesn't have 'apply'
102613 return 'object' === typeof console
102614 && console.log
102615 && Function.prototype.apply.call(console.log, console, arguments);
102616}
102617
102618/**
102619 * Save `namespaces`.
102620 *
102621 * @param {String} namespaces
102622 * @api private
102623 */
102624
102625function save(namespaces) {
102626 try {
102627 if (null == namespaces) {
102628 exports.storage.removeItem('debug');
102629 } else {
102630 exports.storage.debug = namespaces;
102631 }
102632 } catch(e) {}
102633}
102634
102635/**
102636 * Load `namespaces`.
102637 *
102638 * @return {String} returns the previously persisted debug modes
102639 * @api private
102640 */
102641
102642function load() {
102643 var r;
102644 try {
102645 r = exports.storage.debug;
102646 } catch(e) {}
102647
102648 // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
102649 if (!r && typeof process !== 'undefined' && 'env' in process) {
102650 r = process.env.DEBUG;
102651 }
102652
102653 return r;
102654}
102655
102656/**
102657 * Enable namespaces listed in `localStorage.debug` initially.
102658 */
102659
102660exports.enable(load());
102661
102662/**
102663 * Localstorage attempts to return the localstorage.
102664 *
102665 * This is necessary because safari throws
102666 * when a user disables cookies/localstorage
102667 * and you attempt to access it.
102668 *
102669 * @return {LocalStorage}
102670 * @api private
102671 */
102672
102673function localstorage() {
102674 try {
102675 return window.localStorage;
102676 } catch (e) {}
102677}
102678
102679
102680/***/ }),
102681/* 651 */
102682/***/ (function(module, exports, __webpack_require__) {
102683
102684/**
102685 * Detect Electron renderer process, which is node, but we should
102686 * treat as a browser.
102687 */
102688
102689if (typeof process === 'undefined' || process.type === 'renderer') {
102690 module.exports = __webpack_require__(650);
102691} else {
102692 module.exports = __webpack_require__(652);
102693}
102694
102695
102696/***/ }),
102697/* 652 */
102698/***/ (function(module, exports, __webpack_require__) {
102699
102700/**
102701 * Module dependencies.
102702 */
102703
102704var tty = __webpack_require__(148);
102705var util = __webpack_require__(9);
102706
102707/**
102708 * This is the Node.js implementation of `debug()`.
102709 *
102710 * Expose `debug()` as the module.
102711 */
102712
102713exports = module.exports = __webpack_require__(348);
102714exports.init = init;
102715exports.log = log;
102716exports.formatArgs = formatArgs;
102717exports.save = save;
102718exports.load = load;
102719exports.useColors = useColors;
102720
102721/**
102722 * Colors.
102723 */
102724
102725exports.colors = [ 6, 2, 3, 4, 5, 1 ];
102726
102727try {
102728 var supportsColor = __webpack_require__(1021);
102729 if (supportsColor && supportsColor.level >= 2) {
102730 exports.colors = [
102731 20, 21, 26, 27, 32, 33, 38, 39, 40, 41, 42, 43, 44, 45, 56, 57, 62, 63, 68,
102732 69, 74, 75, 76, 77, 78, 79, 80, 81, 92, 93, 98, 99, 112, 113, 128, 129, 134,
102733 135, 148, 149, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171,
102734 172, 173, 178, 179, 184, 185, 196, 197, 198, 199, 200, 201, 202, 203, 204,
102735 205, 206, 207, 208, 209, 214, 215, 220, 221
102736 ];
102737 }
102738} catch (err) {
102739 // swallow - we only care if `supports-color` is available; it doesn't have to be.
102740}
102741
102742/**
102743 * Build up the default `inspectOpts` object from the environment variables.
102744 *
102745 * $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
102746 */
102747
102748exports.inspectOpts = Object.keys(process.env).filter(function (key) {
102749 return /^debug_/i.test(key);
102750}).reduce(function (obj, key) {
102751 // camel-case
102752 var prop = key
102753 .substring(6)
102754 .toLowerCase()
102755 .replace(/_([a-z])/g, function (_, k) { return k.toUpperCase() });
102756
102757 // coerce string value into JS value
102758 var val = process.env[key];
102759 if (/^(yes|on|true|enabled)$/i.test(val)) val = true;
102760 else if (/^(no|off|false|disabled)$/i.test(val)) val = false;
102761 else if (val === 'null') val = null;
102762 else val = Number(val);
102763
102764 obj[prop] = val;
102765 return obj;
102766}, {});
102767
102768/**
102769 * Is stdout a TTY? Colored output is enabled when `true`.
102770 */
102771
102772function useColors() {
102773 return 'colors' in exports.inspectOpts
102774 ? Boolean(exports.inspectOpts.colors)
102775 : tty.isatty(process.stderr.fd);
102776}
102777
102778/**
102779 * Map %o to `util.inspect()`, all on a single line.
102780 */
102781
102782exports.formatters.o = function(v) {
102783 this.inspectOpts.colors = this.useColors;
102784 return util.inspect(v, this.inspectOpts)
102785 .split('\n').map(function(str) {
102786 return str.trim()
102787 }).join(' ');
102788};
102789
102790/**
102791 * Map %o to `util.inspect()`, allowing multiple lines if needed.
102792 */
102793
102794exports.formatters.O = function(v) {
102795 this.inspectOpts.colors = this.useColors;
102796 return util.inspect(v, this.inspectOpts);
102797};
102798
102799/**
102800 * Adds ANSI color escape codes if enabled.
102801 *
102802 * @api public
102803 */
102804
102805function formatArgs(args) {
102806 var name = this.namespace;
102807 var useColors = this.useColors;
102808
102809 if (useColors) {
102810 var c = this.color;
102811 var colorCode = '\u001b[3' + (c < 8 ? c : '8;5;' + c);
102812 var prefix = ' ' + colorCode + ';1m' + name + ' ' + '\u001b[0m';
102813
102814 args[0] = prefix + args[0].split('\n').join('\n' + prefix);
102815 args.push(colorCode + 'm+' + exports.humanize(this.diff) + '\u001b[0m');
102816 } else {
102817 args[0] = getDate() + name + ' ' + args[0];
102818 }
102819}
102820
102821function getDate() {
102822 if (exports.inspectOpts.hideDate) {
102823 return '';
102824 } else {
102825 return new Date().toISOString() + ' ';
102826 }
102827}
102828
102829/**
102830 * Invokes `util.format()` with the specified arguments and writes to stderr.
102831 */
102832
102833function log() {
102834 return process.stderr.write(util.format.apply(util, arguments) + '\n');
102835}
102836
102837/**
102838 * Save `namespaces`.
102839 *
102840 * @param {String} namespaces
102841 * @api private
102842 */
102843
102844function save(namespaces) {
102845 if (null == namespaces) {
102846 // If you set a process.env field to null or undefined, it gets cast to the
102847 // string 'null' or 'undefined'. Just delete instead.
102848 delete process.env.DEBUG;
102849 } else {
102850 process.env.DEBUG = namespaces;
102851 }
102852}
102853
102854/**
102855 * Load `namespaces`.
102856 *
102857 * @return {String} returns the previously persisted debug modes
102858 * @api private
102859 */
102860
102861function load() {
102862 return process.env.DEBUG;
102863}
102864
102865/**
102866 * Init logic for `debug` instances.
102867 *
102868 * Create a new `inspectOpts` object in case `useColors` is set
102869 * differently for a particular `debug` instance.
102870 */
102871
102872function init (debug) {
102873 debug.inspectOpts = {};
102874
102875 var keys = Object.keys(exports.inspectOpts);
102876 for (var i = 0; i < keys.length; i++) {
102877 debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
102878 }
102879}
102880
102881/**
102882 * Enable namespaces listed in `process.env.DEBUG` initially.
102883 */
102884
102885exports.enable(load());
102886
102887
102888/***/ }),
102889/* 653 */
102890/***/ (function(module, exports, __webpack_require__) {
102891
102892"use strict";
102893
102894var token = '%[a-f0-9]{2}';
102895var singleMatcher = new RegExp(token, 'gi');
102896var multiMatcher = new RegExp('(' + token + ')+', 'gi');
102897
102898function decodeComponents(components, split) {
102899 try {
102900 // Try to decode the entire string first
102901 return decodeURIComponent(components.join(''));
102902 } catch (err) {
102903 // Do nothing
102904 }
102905
102906 if (components.length === 1) {
102907 return components;
102908 }
102909
102910 split = split || 1;
102911
102912 // Split the array in 2 parts
102913 var left = components.slice(0, split);
102914 var right = components.slice(split);
102915
102916 return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
102917}
102918
102919function decode(input) {
102920 try {
102921 return decodeURIComponent(input);
102922 } catch (err) {
102923 var tokens = input.match(singleMatcher);
102924
102925 for (var i = 1; i < tokens.length; i++) {
102926 input = decodeComponents(tokens, i).join('');
102927
102928 tokens = input.match(singleMatcher);
102929 }
102930
102931 return input;
102932 }
102933}
102934
102935function customDecodeURIComponent(input) {
102936 // Keep track of all the replacements and prefill the map with the `BOM`
102937 var replaceMap = {
102938 '%FE%FF': '\uFFFD\uFFFD',
102939 '%FF%FE': '\uFFFD\uFFFD'
102940 };
102941
102942 var match = multiMatcher.exec(input);
102943 while (match) {
102944 try {
102945 // Decode as big chunks as possible
102946 replaceMap[match[0]] = decodeURIComponent(match[0]);
102947 } catch (err) {
102948 var result = decode(match[0]);
102949
102950 if (result !== match[0]) {
102951 replaceMap[match[0]] = result;
102952 }
102953 }
102954
102955 match = multiMatcher.exec(input);
102956 }
102957
102958 // Add `%C2` at the end of the map to make sure it does not replace the combinator before everything else
102959 replaceMap['%C2'] = '\uFFFD';
102960
102961 var entries = Object.keys(replaceMap);
102962
102963 for (var i = 0; i < entries.length; i++) {
102964 // Replace all decoded components
102965 var key = entries[i];
102966 input = input.replace(new RegExp(key, 'g'), replaceMap[key]);
102967 }
102968
102969 return input;
102970}
102971
102972module.exports = function (encodedURI) {
102973 if (typeof encodedURI !== 'string') {
102974 throw new TypeError('Expected `encodedURI` to be of type `string`, got `' + typeof encodedURI + '`');
102975 }
102976
102977 try {
102978 encodedURI = encodedURI.replace(/\+/g, ' ');
102979
102980 // Try the built in decoder first
102981 return decodeURIComponent(encodedURI);
102982 } catch (err) {
102983 // Fallback to a more advanced decoder
102984 return customDecodeURIComponent(encodedURI);
102985 }
102986};
102987
102988
102989/***/ }),
102990/* 654 */
102991/***/ (function(module, exports, __webpack_require__) {
102992
102993var pSlice = Array.prototype.slice;
102994var objectKeys = __webpack_require__(656);
102995var isArguments = __webpack_require__(655);
102996
102997var deepEqual = module.exports = function (actual, expected, opts) {
102998 if (!opts) opts = {};
102999 // 7.1. All identical values are equivalent, as determined by ===.
103000 if (actual === expected) {
103001 return true;
103002
103003 } else if (actual instanceof Date && expected instanceof Date) {
103004 return actual.getTime() === expected.getTime();
103005
103006 // 7.3. Other pairs that do not both pass typeof value == 'object',
103007 // equivalence is determined by ==.
103008 } else if (!actual || !expected || typeof actual != 'object' && typeof expected != 'object') {
103009 return opts.strict ? actual === expected : actual == expected;
103010
103011 // 7.4. For all other Object pairs, including Array objects, equivalence is
103012 // determined by having the same number of owned properties (as verified
103013 // with Object.prototype.hasOwnProperty.call), the same set of keys
103014 // (although not necessarily the same order), equivalent values for every
103015 // corresponding key, and an identical 'prototype' property. Note: this
103016 // accounts for both named and indexed properties on Arrays.
103017 } else {
103018 return objEquiv(actual, expected, opts);
103019 }
103020}
103021
103022function isUndefinedOrNull(value) {
103023 return value === null || value === undefined;
103024}
103025
103026function isBuffer (x) {
103027 if (!x || typeof x !== 'object' || typeof x.length !== 'number') return false;
103028 if (typeof x.copy !== 'function' || typeof x.slice !== 'function') {
103029 return false;
103030 }
103031 if (x.length > 0 && typeof x[0] !== 'number') return false;
103032 return true;
103033}
103034
103035function objEquiv(a, b, opts) {
103036 var i, key;
103037 if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
103038 return false;
103039 // an identical 'prototype' property.
103040 if (a.prototype !== b.prototype) return false;
103041 //~~~I've managed to break Object.keys through screwy arguments passing.
103042 // Converting to array solves the problem.
103043 if (isArguments(a)) {
103044 if (!isArguments(b)) {
103045 return false;
103046 }
103047 a = pSlice.call(a);
103048 b = pSlice.call(b);
103049 return deepEqual(a, b, opts);
103050 }
103051 if (isBuffer(a)) {
103052 if (!isBuffer(b)) {
103053 return false;
103054 }
103055 if (a.length !== b.length) return false;
103056 for (i = 0; i < a.length; i++) {
103057 if (a[i] !== b[i]) return false;
103058 }
103059 return true;
103060 }
103061 try {
103062 var ka = objectKeys(a),
103063 kb = objectKeys(b);
103064 } catch (e) {//happens when one is a string literal and the other isn't
103065 return false;
103066 }
103067 // having the same number of owned properties (keys incorporates
103068 // hasOwnProperty)
103069 if (ka.length != kb.length)
103070 return false;
103071 //the same set of keys (although not necessarily the same order),
103072 ka.sort();
103073 kb.sort();
103074 //~~~cheap key test
103075 for (i = ka.length - 1; i >= 0; i--) {
103076 if (ka[i] != kb[i])
103077 return false;
103078 }
103079 //equivalent values for every corresponding key, and
103080 //~~~possibly expensive deep test
103081 for (i = ka.length - 1; i >= 0; i--) {
103082 key = ka[i];
103083 if (!deepEqual(a[key], b[key], opts)) return false;
103084 }
103085 return typeof a === typeof b;
103086}
103087
103088
103089/***/ }),
103090/* 655 */
103091/***/ (function(module, exports) {
103092
103093var supportsArgumentsClass = (function(){
103094 return Object.prototype.toString.call(arguments)
103095})() == '[object Arguments]';
103096
103097exports = module.exports = supportsArgumentsClass ? supported : unsupported;
103098
103099exports.supported = supported;
103100function supported(object) {
103101 return Object.prototype.toString.call(object) == '[object Arguments]';
103102};
103103
103104exports.unsupported = unsupported;
103105function unsupported(object){
103106 return object &&
103107 typeof object == 'object' &&
103108 typeof object.length == 'number' &&
103109 Object.prototype.hasOwnProperty.call(object, 'callee') &&
103110 !Object.prototype.propertyIsEnumerable.call(object, 'callee') ||
103111 false;
103112};
103113
103114
103115/***/ }),
103116/* 656 */
103117/***/ (function(module, exports) {
103118
103119exports = module.exports = typeof Object.keys === 'function'
103120 ? Object.keys : shim;
103121
103122exports.shim = shim;
103123function shim (obj) {
103124 var keys = [];
103125 for (var key in obj) keys.push(key);
103126 return keys;
103127}
103128
103129
103130/***/ }),
103131/* 657 */
103132/***/ (function(module, exports, __webpack_require__) {
103133
103134var Stream = __webpack_require__(35).Stream;
103135var util = __webpack_require__(9);
103136
103137module.exports = DelayedStream;
103138function DelayedStream() {
103139 this.source = null;
103140 this.dataSize = 0;
103141 this.maxDataSize = 1024 * 1024;
103142 this.pauseStream = true;
103143
103144 this._maxDataSizeExceeded = false;
103145 this._released = false;
103146 this._bufferedEvents = [];
103147}
103148util.inherits(DelayedStream, Stream);
103149
103150DelayedStream.create = function(source, options) {
103151 var delayedStream = new this();
103152
103153 options = options || {};
103154 for (var option in options) {
103155 delayedStream[option] = options[option];
103156 }
103157
103158 delayedStream.source = source;
103159
103160 var realEmit = source.emit;
103161 source.emit = function() {
103162 delayedStream._handleEmit(arguments);
103163 return realEmit.apply(source, arguments);
103164 };
103165
103166 source.on('error', function() {});
103167 if (delayedStream.pauseStream) {
103168 source.pause();
103169 }
103170
103171 return delayedStream;
103172};
103173
103174Object.defineProperty(DelayedStream.prototype, 'readable', {
103175 configurable: true,
103176 enumerable: true,
103177 get: function() {
103178 return this.source.readable;
103179 }
103180});
103181
103182DelayedStream.prototype.setEncoding = function() {
103183 return this.source.setEncoding.apply(this.source, arguments);
103184};
103185
103186DelayedStream.prototype.resume = function() {
103187 if (!this._released) {
103188 this.release();
103189 }
103190
103191 this.source.resume();
103192};
103193
103194DelayedStream.prototype.pause = function() {
103195 this.source.pause();
103196};
103197
103198DelayedStream.prototype.release = function() {
103199 this._released = true;
103200
103201 this._bufferedEvents.forEach(function(args) {
103202 this.emit.apply(this, args);
103203 }.bind(this));
103204 this._bufferedEvents = [];
103205};
103206
103207DelayedStream.prototype.pipe = function() {
103208 var r = Stream.prototype.pipe.apply(this, arguments);
103209 this.resume();
103210 return r;
103211};
103212
103213DelayedStream.prototype._handleEmit = function(args) {
103214 if (this._released) {
103215 this.emit.apply(this, args);
103216 return;
103217 }
103218
103219 if (args[0] === 'data') {
103220 this.dataSize += args[1].length;
103221 this._checkIfMaxDataSizeExceeded();
103222 }
103223
103224 this._bufferedEvents.push(args);
103225};
103226
103227DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
103228 if (this._maxDataSizeExceeded) {
103229 return;
103230 }
103231
103232 if (this.dataSize <= this.maxDataSize) {
103233 return;
103234 }
103235
103236 this._maxDataSizeExceeded = true;
103237 var message =
103238 'DelayedStream#maxDataSize of ' + this.maxDataSize + ' bytes exceeded.'
103239 this.emit('error', new Error(message));
103240};
103241
103242
103243/***/ }),
103244/* 658 */
103245/***/ (function(module, exports, __webpack_require__) {
103246
103247"use strict";
103248
103249
103250// detect either spaces or tabs but not both to properly handle tabs
103251// for indentation and spaces for alignment
103252const INDENT_RE = /^(?:( )+|\t+)/;
103253
103254function getMostUsed(indents) {
103255 let result = 0;
103256 let maxUsed = 0;
103257 let maxWeight = 0;
103258
103259 for (const entry of indents) {
103260 // TODO: use destructuring when targeting Node.js 6
103261 const key = entry[0];
103262 const val = entry[1];
103263
103264 const u = val[0];
103265 const w = val[1];
103266
103267 if (u > maxUsed || (u === maxUsed && w > maxWeight)) {
103268 maxUsed = u;
103269 maxWeight = w;
103270 result = Number(key);
103271 }
103272 }
103273
103274 return result;
103275}
103276
103277module.exports = str => {
103278 if (typeof str !== 'string') {
103279 throw new TypeError('Expected a string');
103280 }
103281
103282 // used to see if tabs or spaces are the most used
103283 let tabs = 0;
103284 let spaces = 0;
103285
103286 // remember the size of previous line's indentation
103287 let prev = 0;
103288
103289 // remember how many indents/unindents as occurred for a given size
103290 // and how much lines follow a given indentation
103291 //
103292 // indents = {
103293 // 3: [1, 0],
103294 // 4: [1, 5],
103295 // 5: [1, 0],
103296 // 12: [1, 0],
103297 // }
103298 const indents = new Map();
103299
103300 // pointer to the array of last used indent
103301 let current;
103302
103303 // whether the last action was an indent (opposed to an unindent)
103304 let isIndent;
103305
103306 for (const line of str.split(/\n/g)) {
103307 if (!line) {
103308 // ignore empty lines
103309 continue;
103310 }
103311
103312 let indent;
103313 const matches = line.match(INDENT_RE);
103314
103315 if (matches) {
103316 indent = matches[0].length;
103317
103318 if (matches[1]) {
103319 spaces++;
103320 } else {
103321 tabs++;
103322 }
103323 } else {
103324 indent = 0;
103325 }
103326
103327 const diff = indent - prev;
103328 prev = indent;
103329
103330 if (diff) {
103331 // an indent or unindent has been detected
103332
103333 isIndent = diff > 0;
103334
103335 current = indents.get(isIndent ? diff : -diff);
103336
103337 if (current) {
103338 current[0]++;
103339 } else {
103340 current = [1, 0];
103341 indents.set(diff, current);
103342 }
103343 } else if (current) {
103344 // if the last action was an indent, increment the weight
103345 current[1] += Number(isIndent);
103346 }
103347 }
103348
103349 const amount = getMostUsed(indents);
103350
103351 let type;
103352 let indent;
103353 if (!amount) {
103354 type = null;
103355 indent = '';
103356 } else if (spaces >= tabs) {
103357 type = 'space';
103358 indent = ' '.repeat(amount);
103359 } else {
103360 type = 'tab';
103361 indent = '\t'.repeat(amount);
103362 }
103363
103364 return {
103365 amount,
103366 type,
103367 indent
103368 };
103369};
103370
103371
103372/***/ }),
103373/* 659 */
103374/***/ (function(module, exports, __webpack_require__) {
103375
103376/*
103377* Copyright (c) 2013, Yahoo! Inc. All rights reserved.
103378* Copyrights licensed under the New BSD License.
103379* See the accompanying LICENSE file for terms.
103380*/
103381
103382var CacheObject = function (conf) {
103383 conf = conf || {};
103384 conf.ttl = parseInt(conf.ttl, 10) || 300; //0 is not permissible
103385 conf.cachesize = parseInt(conf.cachesize, 10) || 1000; //0 is not permissible
103386
103387 this.ttl = conf.ttl * 1000;
103388 this.max = conf.cachesize;
103389
103390 this.count = 0;
103391 this.data = {};
103392 var next = __webpack_require__(453);
103393
103394 this.set = function (key, value, callback) {
103395 var self = this;
103396 next(function () {
103397 if (self.data[key]) {
103398 if (self.data[key].newer) {
103399 if (self.data[key].older) {
103400 self.data[key].newer.older = self.data[key].older;
103401 self.data[key].older.newer = self.data[key].newer;
103402 } else {
103403 self.tail = self.data[key].newer;
103404 delete self.tail.older;
103405 }
103406
103407 self.data[key].older = self.head;
103408 self.head.newer = self.data[key];
103409 delete self.data[key].newer;
103410 self.head = self.data[key];
103411 }
103412
103413 self.head.val = value;
103414 self.head.hit = 0;
103415 self.head.ts = Date.now();
103416 } else {
103417 // key is not exist
103418 self.data[key] = {
103419 "key" : key,
103420 "val" : value,
103421 "hit" : 0,
103422 "ts" : Date.now()
103423 };
103424
103425 if (!self.head) {
103426 // cache is empty
103427 self.head = self.data[key];
103428 self.tail = self.data[key];
103429 } else {
103430 // insert the new entry to the front
103431 self.head.newer = self.data[key];
103432 self.data[key].older = self.head;
103433 self.head = self.data[key];
103434 }
103435
103436 if (self.count >= self.max) {
103437 // remove the tail
103438 var temp = self.tail;
103439 self.tail = self.tail.newer;
103440 delete self.tail.next;
103441 delete self.data[temp.key];
103442 } else {
103443 self.count = self.count + 1;
103444 }
103445 }
103446 /* jshint -W030 */
103447 callback && callback(null, value);
103448 });
103449 };
103450
103451 this.get = function (key, callback) {
103452 var self = this;
103453 if (!callback) {
103454 throw('cache.get callback is required.');
103455 }
103456
103457 next(function () {
103458 if (!self.data[key]) {
103459 return callback(null, undefined);
103460 }
103461 var value;
103462 if (conf.ttl !== 0 && (Date.now() - self.data[key].ts) >= self.ttl) {
103463 if (self.data[key].newer) {
103464 if (self.data[key].older) {
103465 // in the middle of the list
103466 self.data[key].newer.older = self.data[key].older;
103467 self.data[key].older.newer = self.data[key].newer;
103468 } else {
103469 // tail
103470 self.tail = self.data[key].newer;
103471 delete self.tail.older;
103472 }
103473 } else {
103474 // the first item
103475 if (self.data[key].older) {
103476 self.head = self.data[key].older;
103477 delete self.head.newer;
103478 } else {
103479 // 1 items
103480 delete self.head;
103481 delete self.tail;
103482 }
103483 }
103484
103485 delete self.data[key];
103486 self.count = self.count - 1;
103487 } else {
103488 self.data[key].hit = self.data[key].hit + 1;
103489 value = self.data[key].val;
103490 }
103491 callback(null, value);
103492 });
103493 };
103494};
103495
103496module.exports = CacheObject;
103497
103498
103499/***/ }),
103500/* 660 */
103501/***/ (function(module, exports, __webpack_require__) {
103502
103503/*
103504* Copyright (c) 2013, Yahoo! Inc. All rights reserved.
103505* Copyrights licensed under the New BSD License.
103506* See the accompanying LICENSE file for terms.
103507*/
103508
103509var CacheObject = __webpack_require__(659),
103510 deepCopy = __webpack_require__(820),
103511 dns = __webpack_require__(1037);
103512
103513
103514// original function storage
103515var EnhanceDns = function (conf) {
103516 conf = conf || {};
103517 conf.ttl = parseInt(conf.ttl, 10) || 300; //0 is not allowed ie it ttl is set to 0, it will take the default
103518 conf.cachesize = parseInt(conf.cachesize, 10); //0 is allowed but it will disable the caching
103519
103520 if (isNaN(conf.cachesize)) {
103521 conf.cachesize = 1000; //set default cache size to 1000 records max
103522 }
103523 if (!conf.enable || conf.cachesize <= 0 || dns.internalCache) {
103524 //cache already exists, means this code has already execute ie method are already overwritten
103525 return dns;
103526 }
103527
103528 // original function storage
103529 var backup_object = {
103530 lookup : dns.lookup,
103531 resolve : dns.resolve,
103532 resolve4 : dns.resolve4,
103533 resolve6 : dns.resolve6,
103534 resolveMx : dns.resolveMx,
103535 resolveTxt : dns.resolveTxt,
103536 resolveSrv : dns.resolveSrv,
103537 resolveNs : dns.resolveNs,
103538 resolveCname : dns.resolveCname,
103539 reverse : dns.reverse
103540 },
103541 // cache storage instance
103542 cache = conf.cache ? /*istanbul ignore next*/ new conf.cache(conf) : new CacheObject(conf);
103543
103544 // insert cache object to the instance
103545 dns.internalCache = cache;
103546
103547 // override dns.lookup method
103548 dns.lookup = function (domain, options, callback) {
103549 var family = 0;
103550 var hints = 0;
103551 var all = false;
103552 if (arguments.length === 2) {
103553 callback = options;
103554 options = family;
103555 } else if (typeof options === 'object') {
103556 if (options.family) {
103557 family = +options.family;
103558 if (family !== 4 && family !== 6) {
103559 callback(new Error('invalid argument: `family` must be 4 or 6'));
103560 return;
103561 }
103562 }
103563 /*istanbul ignore next - "hints" require node 0.12+*/
103564 if (options.hints) {
103565 hints = +options.hints;
103566 }
103567 all = (options.all === true);
103568 } else if (options) {
103569 family = +options;
103570 if (family !== 4 && family !== 6) {
103571 callback(new Error('invalid argument: `family` must be 4 or 6'));
103572 return;
103573 }
103574 }
103575
103576 cache.get('lookup_' + domain + '_' + family + '_' + hints + '_' + all, function (error, record) {
103577 if (record) {
103578 /*istanbul ignore next - "all" option require node 4+*/
103579 if (Array.isArray(record)) {
103580 return callback(error, record);
103581 }
103582 return callback(error, record.address, record.family);
103583 }
103584
103585 try{
103586 backup_object.lookup(domain, options, function (err, address, family_r) {
103587 if (err) {
103588 return callback(err);
103589 }
103590 var value;
103591 /*istanbul ignore next - "all" option require node 4+*/
103592 if (Array.isArray(address)) {
103593 value = address;
103594 } else {
103595 value = {
103596 'address' : address,
103597 'family' : family_r
103598 };
103599 }
103600 cache.set('lookup_' + domain + '_' + family + '_' + hints + '_' + all, value, function () {
103601 callback(err, address, family_r);
103602 });
103603 });
103604 } catch (err) {
103605 /*istanbul ignore next - doesn't throw in node 0.10*/
103606 callback(err);
103607 }
103608 });
103609 };
103610
103611 // override dns.resolve method
103612 dns.resolve = function (domain, type, callback) {
103613 var type_new, callback_new;
103614
103615 if (typeof type === 'string') {
103616 type_new = type;
103617 callback_new = callback;
103618 } else {
103619 type_new = "A";
103620 callback_new = type;
103621 }
103622
103623 cache.get('resolve_' + domain + '_' + type_new, function (error, record) {
103624 if (record) {
103625 return callback_new(error, deepCopy(record), true);
103626 }
103627 try {
103628 backup_object.resolve(domain, type_new, function (err, addresses) {
103629 if (err) {
103630 return callback_new(err);
103631 }
103632 cache.set('resolve_' + domain + '_' + type_new, addresses, function () {
103633 callback_new(err, deepCopy(addresses), false);
103634 });
103635 });
103636 } catch (err) {
103637 /*istanbul ignore next - doesn't throw in node 0.10*/
103638 callback_new(err);
103639 }
103640 });
103641 };
103642
103643 // override dns.resolve4 method
103644 dns.resolve4 = function (domain, callback) {
103645 cache.get('resolve4_' + domain, function (error, record) {
103646 if (record) {
103647 return callback(error, deepCopy(record));
103648 }
103649 try {
103650 backup_object.resolve4(domain, function (err, addresses) {
103651 if (err) {
103652 return callback(err);
103653 }
103654 cache.set('resolve4_' + domain, addresses, function () {
103655 callback(err, deepCopy(addresses));
103656 });
103657 });
103658 } catch (err) {
103659 /*istanbul ignore next - doesn't throw in node 0.10*/
103660 callback(err);
103661 }
103662 });
103663 };
103664
103665 // override dns.resolve6 method
103666 dns.resolve6 = function (domain, callback) {
103667 cache.get('resolve6_' + domain, function (error, record) {
103668 if (record) {
103669 return callback(error, deepCopy(record));
103670 }
103671 try {
103672 backup_object.resolve6(domain, function (err, addresses) {
103673 if (err) {
103674 return callback(err);
103675 }
103676 cache.set('resolve6_' + domain, addresses, function () {
103677 callback(err, deepCopy(addresses));
103678 });
103679 });
103680 } catch (err) {
103681 /*istanbul ignore next - doesn't throw in node 0.10*/
103682 callback(err);
103683 }
103684 });
103685 };
103686
103687 // override dns.resolveMx method
103688 dns.resolveMx = function (domain, callback) {
103689 cache.get('resolveMx_' + domain, function (error, record) {
103690 if (record) {
103691 return callback(error, deepCopy(record));
103692 }
103693 try {
103694 backup_object.resolveMx(domain, function (err, addresses) {
103695 if (err) {
103696 return callback(err);
103697 }
103698 cache.set('resolveMx_' + domain, addresses, function () {
103699 callback(err, deepCopy(addresses));
103700 });
103701 });
103702 } catch (err) {
103703 /*istanbul ignore next - doesn't throw in node 0.10*/
103704 callback(err);
103705 }
103706 });
103707 };
103708
103709 // override dns.resolveTxt method
103710 dns.resolveTxt = function (domain, callback) {
103711 cache.get('resolveTxt_' + domain, function (error, record) {
103712 if (record) {
103713 return callback(error, deepCopy(record));
103714 }
103715 try {
103716 backup_object.resolveTxt(domain, function (err, addresses) {
103717 if (err) {
103718 return callback(err);
103719 }
103720 cache.set('resolveTxt_' + domain, addresses, function () {
103721 callback(err, deepCopy(addresses));
103722 });
103723 });
103724 } catch (err) {
103725 /*istanbul ignore next - doesn't throw in node 0.10*/
103726 callback(err);
103727 }
103728 });
103729 };
103730
103731 // override dns.resolveSrv method
103732 dns.resolveSrv = function (domain, callback) {
103733 cache.get('resolveSrv_' + domain, function (error, record) {
103734 if (record) {
103735 return callback(error, deepCopy(record));
103736 }
103737 try {
103738 backup_object.resolveSrv(domain, function (err, addresses) {
103739 if (err) {
103740 return callback(err);
103741 }
103742 cache.set('resolveSrv_' + domain, addresses, function () {
103743 callback(err, deepCopy(addresses));
103744 });
103745 });
103746 } catch (err) {
103747 /*istanbul ignore next - doesn't throw in node 0.10*/
103748 callback(err);
103749 }
103750 });
103751 };
103752
103753 // override dns.resolveNs method
103754 dns.resolveNs = function (domain, callback) {
103755 cache.get('resolveNs_' + domain, function (error, record) {
103756 if (record) {
103757 return callback(error, deepCopy(record));
103758 }
103759 try {
103760 backup_object.resolveNs(domain, function (err, addresses) {
103761 if (err) {
103762 return callback(err);
103763 }
103764 cache.set('resolveNs_' + domain, addresses, function () {
103765 callback(err, deepCopy(addresses));
103766 });
103767 });
103768 } catch (err) {
103769 /*istanbul ignore next - doesn't throw in node 0.10*/
103770 callback(err);
103771 }
103772 });
103773 };
103774
103775 // override dns.resolveCname method
103776 dns.resolveCname = function (domain, callback) {
103777 cache.get('resolveCname_' + domain, function (error, record) {
103778 if (record) {
103779 return callback(error, deepCopy(record));
103780 }
103781 try {
103782 backup_object.resolveCname(domain, function (err, addresses) {
103783 if (err) {
103784 return callback(err);
103785 }
103786 cache.set('resolveCname_' + domain, addresses, function () {
103787 callback(err, deepCopy(addresses));
103788 });
103789 });
103790 } catch (err) {
103791 /*istanbul ignore next - doesn't throw in node 0.10*/
103792 callback(err);
103793 }
103794 });
103795 };
103796
103797 // override dns.reverse method
103798 dns.reverse = function (ip, callback) {
103799 cache.get('reverse_' + ip, function (error, record) {
103800 if (record) {
103801 return callback(error, deepCopy(record));
103802 }
103803 try {
103804 backup_object.reverse(ip, function (err, addresses) {
103805 if (err) {
103806 return callback(err);
103807 }
103808 cache.set('reverse_' + ip, addresses, function () {
103809 callback(err, deepCopy(addresses));
103810 });
103811 });
103812 } catch (err) {
103813 /*istanbul ignore next - doesn't throw in node 0.10*/
103814 callback(err);
103815 }
103816 });
103817 };
103818 return dns;
103819};
103820
103821module.exports = function(conf) {
103822 return new EnhanceDns(conf);
103823};
103824
103825
103826/***/ }),
103827/* 661 */
103828/***/ (function(module, exports, __webpack_require__) {
103829
103830// Named EC curves
103831
103832// Requires ec.js, jsbn.js, and jsbn2.js
103833var BigInteger = __webpack_require__(79).BigInteger
103834var ECCurveFp = __webpack_require__(129).ECCurveFp
103835
103836
103837// ----------------
103838// X9ECParameters
103839
103840// constructor
103841function X9ECParameters(curve,g,n,h) {
103842 this.curve = curve;
103843 this.g = g;
103844 this.n = n;
103845 this.h = h;
103846}
103847
103848function x9getCurve() {
103849 return this.curve;
103850}
103851
103852function x9getG() {
103853 return this.g;
103854}
103855
103856function x9getN() {
103857 return this.n;
103858}
103859
103860function x9getH() {
103861 return this.h;
103862}
103863
103864X9ECParameters.prototype.getCurve = x9getCurve;
103865X9ECParameters.prototype.getG = x9getG;
103866X9ECParameters.prototype.getN = x9getN;
103867X9ECParameters.prototype.getH = x9getH;
103868
103869// ----------------
103870// SECNamedCurves
103871
103872function fromHex(s) { return new BigInteger(s, 16); }
103873
103874function secp128r1() {
103875 // p = 2^128 - 2^97 - 1
103876 var p = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF");
103877 var a = fromHex("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC");
103878 var b = fromHex("E87579C11079F43DD824993C2CEE5ED3");
103879 //byte[] S = Hex.decode("000E0D4D696E6768756151750CC03A4473D03679");
103880 var n = fromHex("FFFFFFFE0000000075A30D1B9038A115");
103881 var h = BigInteger.ONE;
103882 var curve = new ECCurveFp(p, a, b);
103883 var G = curve.decodePointHex("04"
103884 + "161FF7528B899B2D0C28607CA52C5B86"
103885 + "CF5AC8395BAFEB13C02DA292DDED7A83");
103886 return new X9ECParameters(curve, G, n, h);
103887}
103888
103889function secp160k1() {
103890 // p = 2^160 - 2^32 - 2^14 - 2^12 - 2^9 - 2^8 - 2^7 - 2^3 - 2^2 - 1
103891 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73");
103892 var a = BigInteger.ZERO;
103893 var b = fromHex("7");
103894 //byte[] S = null;
103895 var n = fromHex("0100000000000000000001B8FA16DFAB9ACA16B6B3");
103896 var h = BigInteger.ONE;
103897 var curve = new ECCurveFp(p, a, b);
103898 var G = curve.decodePointHex("04"
103899 + "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB"
103900 + "938CF935318FDCED6BC28286531733C3F03C4FEE");
103901 return new X9ECParameters(curve, G, n, h);
103902}
103903
103904function secp160r1() {
103905 // p = 2^160 - 2^31 - 1
103906 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF");
103907 var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC");
103908 var b = fromHex("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45");
103909 //byte[] S = Hex.decode("1053CDE42C14D696E67687561517533BF3F83345");
103910 var n = fromHex("0100000000000000000001F4C8F927AED3CA752257");
103911 var h = BigInteger.ONE;
103912 var curve = new ECCurveFp(p, a, b);
103913 var G = curve.decodePointHex("04"
103914 + "4A96B5688EF573284664698968C38BB913CBFC82"
103915 + "23A628553168947D59DCC912042351377AC5FB32");
103916 return new X9ECParameters(curve, G, n, h);
103917}
103918
103919function secp192k1() {
103920 // p = 2^192 - 2^32 - 2^12 - 2^8 - 2^7 - 2^6 - 2^3 - 1
103921 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37");
103922 var a = BigInteger.ZERO;
103923 var b = fromHex("3");
103924 //byte[] S = null;
103925 var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D");
103926 var h = BigInteger.ONE;
103927 var curve = new ECCurveFp(p, a, b);
103928 var G = curve.decodePointHex("04"
103929 + "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D"
103930 + "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");
103931 return new X9ECParameters(curve, G, n, h);
103932}
103933
103934function secp192r1() {
103935 // p = 2^192 - 2^64 - 1
103936 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF");
103937 var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC");
103938 var b = fromHex("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1");
103939 //byte[] S = Hex.decode("3045AE6FC8422F64ED579528D38120EAE12196D5");
103940 var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831");
103941 var h = BigInteger.ONE;
103942 var curve = new ECCurveFp(p, a, b);
103943 var G = curve.decodePointHex("04"
103944 + "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012"
103945 + "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811");
103946 return new X9ECParameters(curve, G, n, h);
103947}
103948
103949function secp224r1() {
103950 // p = 2^224 - 2^96 + 1
103951 var p = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001");
103952 var a = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE");
103953 var b = fromHex("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4");
103954 //byte[] S = Hex.decode("BD71344799D5C7FCDC45B59FA3B9AB8F6A948BC5");
103955 var n = fromHex("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D");
103956 var h = BigInteger.ONE;
103957 var curve = new ECCurveFp(p, a, b);
103958 var G = curve.decodePointHex("04"
103959 + "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21"
103960 + "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");
103961 return new X9ECParameters(curve, G, n, h);
103962}
103963
103964function secp256r1() {
103965 // p = 2^224 (2^32 - 1) + 2^192 + 2^96 - 1
103966 var p = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF");
103967 var a = fromHex("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC");
103968 var b = fromHex("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B");
103969 //byte[] S = Hex.decode("C49D360886E704936A6678E1139D26B7819F7E90");
103970 var n = fromHex("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551");
103971 var h = BigInteger.ONE;
103972 var curve = new ECCurveFp(p, a, b);
103973 var G = curve.decodePointHex("04"
103974 + "6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296"
103975 + "4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");
103976 return new X9ECParameters(curve, G, n, h);
103977}
103978
103979// TODO: make this into a proper hashtable
103980function getSECCurveByName(name) {
103981 if(name == "secp128r1") return secp128r1();
103982 if(name == "secp160k1") return secp160k1();
103983 if(name == "secp160r1") return secp160r1();
103984 if(name == "secp192k1") return secp192k1();
103985 if(name == "secp192r1") return secp192r1();
103986 if(name == "secp224r1") return secp224r1();
103987 if(name == "secp256r1") return secp256r1();
103988 return null;
103989}
103990
103991module.exports = {
103992 "secp128r1":secp128r1,
103993 "secp160k1":secp160k1,
103994 "secp160r1":secp160r1,
103995 "secp192k1":secp192k1,
103996 "secp192r1":secp192r1,
103997 "secp224r1":secp224r1,
103998 "secp256r1":secp256r1
103999}
104000
104001
104002/***/ }),
104003/* 662 */
104004/***/ (function(module, exports, __webpack_require__) {
104005
104006(function webpackUniversalModuleDefinition(root, factory) {
104007/* istanbul ignore next */
104008 if(true)
104009 module.exports = factory();
104010 else if(typeof define === 'function' && define.amd)
104011 define([], factory);
104012/* istanbul ignore next */
104013 else if(typeof exports === 'object')
104014 exports["esprima"] = factory();
104015 else
104016 root["esprima"] = factory();
104017})(this, function() {
104018return /******/ (function(modules) { // webpackBootstrap
104019/******/ // The module cache
104020/******/ var installedModules = {};
104021
104022/******/ // The require function
104023/******/ function __webpack_require__(moduleId) {
104024
104025/******/ // Check if module is in cache
104026/* istanbul ignore if */
104027/******/ if(installedModules[moduleId])
104028/******/ return installedModules[moduleId].exports;
104029
104030/******/ // Create a new module (and put it into the cache)
104031/******/ var module = installedModules[moduleId] = {
104032/******/ exports: {},
104033/******/ id: moduleId,
104034/******/ loaded: false
104035/******/ };
104036
104037/******/ // Execute the module function
104038/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
104039
104040/******/ // Flag the module as loaded
104041/******/ module.loaded = true;
104042
104043/******/ // Return the exports of the module
104044/******/ return module.exports;
104045/******/ }
104046
104047
104048/******/ // expose the modules object (__webpack_modules__)
104049/******/ __webpack_require__.m = modules;
104050
104051/******/ // expose the module cache
104052/******/ __webpack_require__.c = installedModules;
104053
104054/******/ // __webpack_public_path__
104055/******/ __webpack_require__.p = "";
104056
104057/******/ // Load entry module and return exports
104058/******/ return __webpack_require__(0);
104059/******/ })
104060/************************************************************************/
104061/******/ ([
104062/* 0 */
104063/***/ function(module, exports, __webpack_require__) {
104064
104065 "use strict";
104066 /*
104067 Copyright JS Foundation and other contributors, https://js.foundation/
104068
104069 Redistribution and use in source and binary forms, with or without
104070 modification, are permitted provided that the following conditions are met:
104071
104072 * Redistributions of source code must retain the above copyright
104073 notice, this list of conditions and the following disclaimer.
104074 * Redistributions in binary form must reproduce the above copyright
104075 notice, this list of conditions and the following disclaimer in the
104076 documentation and/or other materials provided with the distribution.
104077
104078 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
104079 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
104080 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
104081 ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
104082 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
104083 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
104084 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
104085 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
104086 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
104087 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
104088 */
104089 Object.defineProperty(exports, "__esModule", { value: true });
104090 var comment_handler_1 = __webpack_require__(1);
104091 var jsx_parser_1 = __webpack_require__(3);
104092 var parser_1 = __webpack_require__(8);
104093 var tokenizer_1 = __webpack_require__(15);
104094 function parse(code, options, delegate) {
104095 var commentHandler = null;
104096 var proxyDelegate = function (node, metadata) {
104097 if (delegate) {
104098 delegate(node, metadata);
104099 }
104100 if (commentHandler) {
104101 commentHandler.visit(node, metadata);
104102 }
104103 };
104104 var parserDelegate = (typeof delegate === 'function') ? proxyDelegate : null;
104105 var collectComment = false;
104106 if (options) {
104107 collectComment = (typeof options.comment === 'boolean' && options.comment);
104108 var attachComment = (typeof options.attachComment === 'boolean' && options.attachComment);
104109 if (collectComment || attachComment) {
104110 commentHandler = new comment_handler_1.CommentHandler();
104111 commentHandler.attach = attachComment;
104112 options.comment = true;
104113 parserDelegate = proxyDelegate;
104114 }
104115 }
104116 var isModule = false;
104117 if (options && typeof options.sourceType === 'string') {
104118 isModule = (options.sourceType === 'module');
104119 }
104120 var parser;
104121 if (options && typeof options.jsx === 'boolean' && options.jsx) {
104122 parser = new jsx_parser_1.JSXParser(code, options, parserDelegate);
104123 }
104124 else {
104125 parser = new parser_1.Parser(code, options, parserDelegate);
104126 }
104127 var program = isModule ? parser.parseModule() : parser.parseScript();
104128 var ast = program;
104129 if (collectComment && commentHandler) {
104130 ast.comments = commentHandler.comments;
104131 }
104132 if (parser.config.tokens) {
104133 ast.tokens = parser.tokens;
104134 }
104135 if (parser.config.tolerant) {
104136 ast.errors = parser.errorHandler.errors;
104137 }
104138 return ast;
104139 }
104140 exports.parse = parse;
104141 function parseModule(code, options, delegate) {
104142 var parsingOptions = options || {};
104143 parsingOptions.sourceType = 'module';
104144 return parse(code, parsingOptions, delegate);
104145 }
104146 exports.parseModule = parseModule;
104147 function parseScript(code, options, delegate) {
104148 var parsingOptions = options || {};
104149 parsingOptions.sourceType = 'script';
104150 return parse(code, parsingOptions, delegate);
104151 }
104152 exports.parseScript = parseScript;
104153 function tokenize(code, options, delegate) {
104154 var tokenizer = new tokenizer_1.Tokenizer(code, options);
104155 var tokens;
104156 tokens = [];
104157 try {
104158 while (true) {
104159 var token = tokenizer.getNextToken();
104160 if (!token) {
104161 break;
104162 }
104163 if (delegate) {
104164 token = delegate(token);
104165 }
104166 tokens.push(token);
104167 }
104168 }
104169 catch (e) {
104170 tokenizer.errorHandler.tolerate(e);
104171 }
104172 if (tokenizer.errorHandler.tolerant) {
104173 tokens.errors = tokenizer.errors();
104174 }
104175 return tokens;
104176 }
104177 exports.tokenize = tokenize;
104178 var syntax_1 = __webpack_require__(2);
104179 exports.Syntax = syntax_1.Syntax;
104180 // Sync with *.json manifests.
104181 exports.version = '4.0.1';
104182
104183
104184/***/ },
104185/* 1 */
104186/***/ function(module, exports, __webpack_require__) {
104187
104188 "use strict";
104189 Object.defineProperty(exports, "__esModule", { value: true });
104190 var syntax_1 = __webpack_require__(2);
104191 var CommentHandler = (function () {
104192 function CommentHandler() {
104193 this.attach = false;
104194 this.comments = [];
104195 this.stack = [];
104196 this.leading = [];
104197 this.trailing = [];
104198 }
104199 CommentHandler.prototype.insertInnerComments = function (node, metadata) {
104200 // innnerComments for properties empty block
104201 // `function a() {/** comments **\/}`
104202 if (node.type === syntax_1.Syntax.BlockStatement && node.body.length === 0) {
104203 var innerComments = [];
104204 for (var i = this.leading.length - 1; i >= 0; --i) {
104205 var entry = this.leading[i];
104206 if (metadata.end.offset >= entry.start) {
104207 innerComments.unshift(entry.comment);
104208 this.leading.splice(i, 1);
104209 this.trailing.splice(i, 1);
104210 }
104211 }
104212 if (innerComments.length) {
104213 node.innerComments = innerComments;
104214 }
104215 }
104216 };
104217 CommentHandler.prototype.findTrailingComments = function (metadata) {
104218 var trailingComments = [];
104219 if (this.trailing.length > 0) {
104220 for (var i = this.trailing.length - 1; i >= 0; --i) {
104221 var entry_1 = this.trailing[i];
104222 if (entry_1.start >= metadata.end.offset) {
104223 trailingComments.unshift(entry_1.comment);
104224 }
104225 }
104226 this.trailing.length = 0;
104227 return trailingComments;
104228 }
104229 var entry = this.stack[this.stack.length - 1];
104230 if (entry && entry.node.trailingComments) {
104231 var firstComment = entry.node.trailingComments[0];
104232 if (firstComment && firstComment.range[0] >= metadata.end.offset) {
104233 trailingComments = entry.node.trailingComments;
104234 delete entry.node.trailingComments;
104235 }
104236 }
104237 return trailingComments;
104238 };
104239 CommentHandler.prototype.findLeadingComments = function (metadata) {
104240 var leadingComments = [];
104241 var target;
104242 while (this.stack.length > 0) {
104243 var entry = this.stack[this.stack.length - 1];
104244 if (entry && entry.start >= metadata.start.offset) {
104245 target = entry.node;
104246 this.stack.pop();
104247 }
104248 else {
104249 break;
104250 }
104251 }
104252 if (target) {
104253 var count = target.leadingComments ? target.leadingComments.length : 0;
104254 for (var i = count - 1; i >= 0; --i) {
104255 var comment = target.leadingComments[i];
104256 if (comment.range[1] <= metadata.start.offset) {
104257 leadingComments.unshift(comment);
104258 target.leadingComments.splice(i, 1);
104259 }
104260 }
104261 if (target.leadingComments && target.leadingComments.length === 0) {
104262 delete target.leadingComments;
104263 }
104264 return leadingComments;
104265 }
104266 for (var i = this.leading.length - 1; i >= 0; --i) {
104267 var entry = this.leading[i];
104268 if (entry.start <= metadata.start.offset) {
104269 leadingComments.unshift(entry.comment);
104270 this.leading.splice(i, 1);
104271 }
104272 }
104273 return leadingComments;
104274 };
104275 CommentHandler.prototype.visitNode = function (node, metadata) {
104276 if (node.type === syntax_1.Syntax.Program && node.body.length > 0) {
104277 return;
104278 }
104279 this.insertInnerComments(node, metadata);
104280 var trailingComments = this.findTrailingComments(metadata);
104281 var leadingComments = this.findLeadingComments(metadata);
104282 if (leadingComments.length > 0) {
104283 node.leadingComments = leadingComments;
104284 }
104285 if (trailingComments.length > 0) {
104286 node.trailingComments = trailingComments;
104287 }
104288 this.stack.push({
104289 node: node,
104290 start: metadata.start.offset
104291 });
104292 };
104293 CommentHandler.prototype.visitComment = function (node, metadata) {
104294 var type = (node.type[0] === 'L') ? 'Line' : 'Block';
104295 var comment = {
104296 type: type,
104297 value: node.value
104298 };
104299 if (node.range) {
104300 comment.range = node.range;
104301 }
104302 if (node.loc) {
104303 comment.loc = node.loc;
104304 }
104305 this.comments.push(comment);
104306 if (this.attach) {
104307 var entry = {
104308 comment: {
104309 type: type,
104310 value: node.value,
104311 range: [metadata.start.offset, metadata.end.offset]
104312 },
104313 start: metadata.start.offset
104314 };
104315 if (node.loc) {
104316 entry.comment.loc = node.loc;
104317 }
104318 node.type = type;
104319 this.leading.push(entry);
104320 this.trailing.push(entry);
104321 }
104322 };
104323 CommentHandler.prototype.visit = function (node, metadata) {
104324 if (node.type === 'LineComment') {
104325 this.visitComment(node, metadata);
104326 }
104327 else if (node.type === 'BlockComment') {
104328 this.visitComment(node, metadata);
104329 }
104330 else if (this.attach) {
104331 this.visitNode(node, metadata);
104332 }
104333 };
104334 return CommentHandler;
104335 }());
104336 exports.CommentHandler = CommentHandler;
104337
104338
104339/***/ },
104340/* 2 */
104341/***/ function(module, exports) {
104342
104343 "use strict";
104344 Object.defineProperty(exports, "__esModule", { value: true });
104345 exports.Syntax = {
104346 AssignmentExpression: 'AssignmentExpression',
104347 AssignmentPattern: 'AssignmentPattern',
104348 ArrayExpression: 'ArrayExpression',
104349 ArrayPattern: 'ArrayPattern',
104350 ArrowFunctionExpression: 'ArrowFunctionExpression',
104351 AwaitExpression: 'AwaitExpression',
104352 BlockStatement: 'BlockStatement',
104353 BinaryExpression: 'BinaryExpression',
104354 BreakStatement: 'BreakStatement',
104355 CallExpression: 'CallExpression',
104356 CatchClause: 'CatchClause',
104357 ClassBody: 'ClassBody',
104358 ClassDeclaration: 'ClassDeclaration',
104359 ClassExpression: 'ClassExpression',
104360 ConditionalExpression: 'ConditionalExpression',
104361 ContinueStatement: 'ContinueStatement',
104362 DoWhileStatement: 'DoWhileStatement',
104363 DebuggerStatement: 'DebuggerStatement',
104364 EmptyStatement: 'EmptyStatement',
104365 ExportAllDeclaration: 'ExportAllDeclaration',
104366 ExportDefaultDeclaration: 'ExportDefaultDeclaration',
104367 ExportNamedDeclaration: 'ExportNamedDeclaration',
104368 ExportSpecifier: 'ExportSpecifier',
104369 ExpressionStatement: 'ExpressionStatement',
104370 ForStatement: 'ForStatement',
104371 ForOfStatement: 'ForOfStatement',
104372 ForInStatement: 'ForInStatement',
104373 FunctionDeclaration: 'FunctionDeclaration',
104374 FunctionExpression: 'FunctionExpression',
104375 Identifier: 'Identifier',
104376 IfStatement: 'IfStatement',
104377 ImportDeclaration: 'ImportDeclaration',
104378 ImportDefaultSpecifier: 'ImportDefaultSpecifier',
104379 ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
104380 ImportSpecifier: 'ImportSpecifier',
104381 Literal: 'Literal',
104382 LabeledStatement: 'LabeledStatement',
104383 LogicalExpression: 'LogicalExpression',
104384 MemberExpression: 'MemberExpression',
104385 MetaProperty: 'MetaProperty',
104386 MethodDefinition: 'MethodDefinition',
104387 NewExpression: 'NewExpression',
104388 ObjectExpression: 'ObjectExpression',
104389 ObjectPattern: 'ObjectPattern',
104390 Program: 'Program',
104391 Property: 'Property',
104392 RestElement: 'RestElement',
104393 ReturnStatement: 'ReturnStatement',
104394 SequenceExpression: 'SequenceExpression',
104395 SpreadElement: 'SpreadElement',
104396 Super: 'Super',
104397 SwitchCase: 'SwitchCase',
104398 SwitchStatement: 'SwitchStatement',
104399 TaggedTemplateExpression: 'TaggedTemplateExpression',
104400 TemplateElement: 'TemplateElement',
104401 TemplateLiteral: 'TemplateLiteral',
104402 ThisExpression: 'ThisExpression',
104403 ThrowStatement: 'ThrowStatement',
104404 TryStatement: 'TryStatement',
104405 UnaryExpression: 'UnaryExpression',
104406 UpdateExpression: 'UpdateExpression',
104407 VariableDeclaration: 'VariableDeclaration',
104408 VariableDeclarator: 'VariableDeclarator',
104409 WhileStatement: 'WhileStatement',
104410 WithStatement: 'WithStatement',
104411 YieldExpression: 'YieldExpression'
104412 };
104413
104414
104415/***/ },
104416/* 3 */
104417/***/ function(module, exports, __webpack_require__) {
104418
104419 "use strict";
104420/* istanbul ignore next */
104421 var __extends = (this && this.__extends) || (function () {
104422 var extendStatics = Object.setPrototypeOf ||
104423 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
104424 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
104425 return function (d, b) {
104426 extendStatics(d, b);
104427 function __() { this.constructor = d; }
104428 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
104429 };
104430 })();
104431 Object.defineProperty(exports, "__esModule", { value: true });
104432 var character_1 = __webpack_require__(4);
104433 var JSXNode = __webpack_require__(5);
104434 var jsx_syntax_1 = __webpack_require__(6);
104435 var Node = __webpack_require__(7);
104436 var parser_1 = __webpack_require__(8);
104437 var token_1 = __webpack_require__(13);
104438 var xhtml_entities_1 = __webpack_require__(14);
104439 token_1.TokenName[100 /* Identifier */] = 'JSXIdentifier';
104440 token_1.TokenName[101 /* Text */] = 'JSXText';
104441 // Fully qualified element name, e.g. <svg:path> returns "svg:path"
104442 function getQualifiedElementName(elementName) {
104443 var qualifiedName;
104444 switch (elementName.type) {
104445 case jsx_syntax_1.JSXSyntax.JSXIdentifier:
104446 var id = elementName;
104447 qualifiedName = id.name;
104448 break;
104449 case jsx_syntax_1.JSXSyntax.JSXNamespacedName:
104450 var ns = elementName;
104451 qualifiedName = getQualifiedElementName(ns.namespace) + ':' +
104452 getQualifiedElementName(ns.name);
104453 break;
104454 case jsx_syntax_1.JSXSyntax.JSXMemberExpression:
104455 var expr = elementName;
104456 qualifiedName = getQualifiedElementName(expr.object) + '.' +
104457 getQualifiedElementName(expr.property);
104458 break;
104459 /* istanbul ignore next */
104460 default:
104461 break;
104462 }
104463 return qualifiedName;
104464 }
104465 var JSXParser = (function (_super) {
104466 __extends(JSXParser, _super);
104467 function JSXParser(code, options, delegate) {
104468 return _super.call(this, code, options, delegate) || this;
104469 }
104470 JSXParser.prototype.parsePrimaryExpression = function () {
104471 return this.match('<') ? this.parseJSXRoot() : _super.prototype.parsePrimaryExpression.call(this);
104472 };
104473 JSXParser.prototype.startJSX = function () {
104474 // Unwind the scanner before the lookahead token.
104475 this.scanner.index = this.startMarker.index;
104476 this.scanner.lineNumber = this.startMarker.line;
104477 this.scanner.lineStart = this.startMarker.index - this.startMarker.column;
104478 };
104479 JSXParser.prototype.finishJSX = function () {
104480 // Prime the next lookahead.
104481 this.nextToken();
104482 };
104483 JSXParser.prototype.reenterJSX = function () {
104484 this.startJSX();
104485 this.expectJSX('}');
104486 // Pop the closing '}' added from the lookahead.
104487 if (this.config.tokens) {
104488 this.tokens.pop();
104489 }
104490 };
104491 JSXParser.prototype.createJSXNode = function () {
104492 this.collectComments();
104493 return {
104494 index: this.scanner.index,
104495 line: this.scanner.lineNumber,
104496 column: this.scanner.index - this.scanner.lineStart
104497 };
104498 };
104499 JSXParser.prototype.createJSXChildNode = function () {
104500 return {
104501 index: this.scanner.index,
104502 line: this.scanner.lineNumber,
104503 column: this.scanner.index - this.scanner.lineStart
104504 };
104505 };
104506 JSXParser.prototype.scanXHTMLEntity = function (quote) {
104507 var result = '&';
104508 var valid = true;
104509 var terminated = false;
104510 var numeric = false;
104511 var hex = false;
104512 while (!this.scanner.eof() && valid && !terminated) {
104513 var ch = this.scanner.source[this.scanner.index];
104514 if (ch === quote) {
104515 break;
104516 }
104517 terminated = (ch === ';');
104518 result += ch;
104519 ++this.scanner.index;
104520 if (!terminated) {
104521 switch (result.length) {
104522 case 2:
104523 // e.g. '&#123;'
104524 numeric = (ch === '#');
104525 break;
104526 case 3:
104527 if (numeric) {
104528 // e.g. '&#x41;'
104529 hex = (ch === 'x');
104530 valid = hex || character_1.Character.isDecimalDigit(ch.charCodeAt(0));
104531 numeric = numeric && !hex;
104532 }
104533 break;
104534 default:
104535 valid = valid && !(numeric && !character_1.Character.isDecimalDigit(ch.charCodeAt(0)));
104536 valid = valid && !(hex && !character_1.Character.isHexDigit(ch.charCodeAt(0)));
104537 break;
104538 }
104539 }
104540 }
104541 if (valid && terminated && result.length > 2) {
104542 // e.g. '&#x41;' becomes just '#x41'
104543 var str = result.substr(1, result.length - 2);
104544 if (numeric && str.length > 1) {
104545 result = String.fromCharCode(parseInt(str.substr(1), 10));
104546 }
104547 else if (hex && str.length > 2) {
104548 result = String.fromCharCode(parseInt('0' + str.substr(1), 16));
104549 }
104550 else if (!numeric && !hex && xhtml_entities_1.XHTMLEntities[str]) {
104551 result = xhtml_entities_1.XHTMLEntities[str];
104552 }
104553 }
104554 return result;
104555 };
104556 // Scan the next JSX token. This replaces Scanner#lex when in JSX mode.
104557 JSXParser.prototype.lexJSX = function () {
104558 var cp = this.scanner.source.charCodeAt(this.scanner.index);
104559 // < > / : = { }
104560 if (cp === 60 || cp === 62 || cp === 47 || cp === 58 || cp === 61 || cp === 123 || cp === 125) {
104561 var value = this.scanner.source[this.scanner.index++];
104562 return {
104563 type: 7 /* Punctuator */,
104564 value: value,
104565 lineNumber: this.scanner.lineNumber,
104566 lineStart: this.scanner.lineStart,
104567 start: this.scanner.index - 1,
104568 end: this.scanner.index
104569 };
104570 }
104571 // " '
104572 if (cp === 34 || cp === 39) {
104573 var start = this.scanner.index;
104574 var quote = this.scanner.source[this.scanner.index++];
104575 var str = '';
104576 while (!this.scanner.eof()) {
104577 var ch = this.scanner.source[this.scanner.index++];
104578 if (ch === quote) {
104579 break;
104580 }
104581 else if (ch === '&') {
104582 str += this.scanXHTMLEntity(quote);
104583 }
104584 else {
104585 str += ch;
104586 }
104587 }
104588 return {
104589 type: 8 /* StringLiteral */,
104590 value: str,
104591 lineNumber: this.scanner.lineNumber,
104592 lineStart: this.scanner.lineStart,
104593 start: start,
104594 end: this.scanner.index
104595 };
104596 }
104597 // ... or .
104598 if (cp === 46) {
104599 var n1 = this.scanner.source.charCodeAt(this.scanner.index + 1);
104600 var n2 = this.scanner.source.charCodeAt(this.scanner.index + 2);
104601 var value = (n1 === 46 && n2 === 46) ? '...' : '.';
104602 var start = this.scanner.index;
104603 this.scanner.index += value.length;
104604 return {
104605 type: 7 /* Punctuator */,
104606 value: value,
104607 lineNumber: this.scanner.lineNumber,
104608 lineStart: this.scanner.lineStart,
104609 start: start,
104610 end: this.scanner.index
104611 };
104612 }
104613 // `
104614 if (cp === 96) {
104615 // Only placeholder, since it will be rescanned as a real assignment expression.
104616 return {
104617 type: 10 /* Template */,
104618 value: '',
104619 lineNumber: this.scanner.lineNumber,
104620 lineStart: this.scanner.lineStart,
104621 start: this.scanner.index,
104622 end: this.scanner.index
104623 };
104624 }
104625 // Identifer can not contain backslash (char code 92).
104626 if (character_1.Character.isIdentifierStart(cp) && (cp !== 92)) {
104627 var start = this.scanner.index;
104628 ++this.scanner.index;
104629 while (!this.scanner.eof()) {
104630 var ch = this.scanner.source.charCodeAt(this.scanner.index);
104631 if (character_1.Character.isIdentifierPart(ch) && (ch !== 92)) {
104632 ++this.scanner.index;
104633 }
104634 else if (ch === 45) {
104635 // Hyphen (char code 45) can be part of an identifier.
104636 ++this.scanner.index;
104637 }
104638 else {
104639 break;
104640 }
104641 }
104642 var id = this.scanner.source.slice(start, this.scanner.index);
104643 return {
104644 type: 100 /* Identifier */,
104645 value: id,
104646 lineNumber: this.scanner.lineNumber,
104647 lineStart: this.scanner.lineStart,
104648 start: start,
104649 end: this.scanner.index
104650 };
104651 }
104652 return this.scanner.lex();
104653 };
104654 JSXParser.prototype.nextJSXToken = function () {
104655 this.collectComments();
104656 this.startMarker.index = this.scanner.index;
104657 this.startMarker.line = this.scanner.lineNumber;
104658 this.startMarker.column = this.scanner.index - this.scanner.lineStart;
104659 var token = this.lexJSX();
104660 this.lastMarker.index = this.scanner.index;
104661 this.lastMarker.line = this.scanner.lineNumber;
104662 this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
104663 if (this.config.tokens) {
104664 this.tokens.push(this.convertToken(token));
104665 }
104666 return token;
104667 };
104668 JSXParser.prototype.nextJSXText = function () {
104669 this.startMarker.index = this.scanner.index;
104670 this.startMarker.line = this.scanner.lineNumber;
104671 this.startMarker.column = this.scanner.index - this.scanner.lineStart;
104672 var start = this.scanner.index;
104673 var text = '';
104674 while (!this.scanner.eof()) {
104675 var ch = this.scanner.source[this.scanner.index];
104676 if (ch === '{' || ch === '<') {
104677 break;
104678 }
104679 ++this.scanner.index;
104680 text += ch;
104681 if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
104682 ++this.scanner.lineNumber;
104683 if (ch === '\r' && this.scanner.source[this.scanner.index] === '\n') {
104684 ++this.scanner.index;
104685 }
104686 this.scanner.lineStart = this.scanner.index;
104687 }
104688 }
104689 this.lastMarker.index = this.scanner.index;
104690 this.lastMarker.line = this.scanner.lineNumber;
104691 this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
104692 var token = {
104693 type: 101 /* Text */,
104694 value: text,
104695 lineNumber: this.scanner.lineNumber,
104696 lineStart: this.scanner.lineStart,
104697 start: start,
104698 end: this.scanner.index
104699 };
104700 if ((text.length > 0) && this.config.tokens) {
104701 this.tokens.push(this.convertToken(token));
104702 }
104703 return token;
104704 };
104705 JSXParser.prototype.peekJSXToken = function () {
104706 var state = this.scanner.saveState();
104707 this.scanner.scanComments();
104708 var next = this.lexJSX();
104709 this.scanner.restoreState(state);
104710 return next;
104711 };
104712 // Expect the next JSX token to match the specified punctuator.
104713 // If not, an exception will be thrown.
104714 JSXParser.prototype.expectJSX = function (value) {
104715 var token = this.nextJSXToken();
104716 if (token.type !== 7 /* Punctuator */ || token.value !== value) {
104717 this.throwUnexpectedToken(token);
104718 }
104719 };
104720 // Return true if the next JSX token matches the specified punctuator.
104721 JSXParser.prototype.matchJSX = function (value) {
104722 var next = this.peekJSXToken();
104723 return next.type === 7 /* Punctuator */ && next.value === value;
104724 };
104725 JSXParser.prototype.parseJSXIdentifier = function () {
104726 var node = this.createJSXNode();
104727 var token = this.nextJSXToken();
104728 if (token.type !== 100 /* Identifier */) {
104729 this.throwUnexpectedToken(token);
104730 }
104731 return this.finalize(node, new JSXNode.JSXIdentifier(token.value));
104732 };
104733 JSXParser.prototype.parseJSXElementName = function () {
104734 var node = this.createJSXNode();
104735 var elementName = this.parseJSXIdentifier();
104736 if (this.matchJSX(':')) {
104737 var namespace = elementName;
104738 this.expectJSX(':');
104739 var name_1 = this.parseJSXIdentifier();
104740 elementName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_1));
104741 }
104742 else if (this.matchJSX('.')) {
104743 while (this.matchJSX('.')) {
104744 var object = elementName;
104745 this.expectJSX('.');
104746 var property = this.parseJSXIdentifier();
104747 elementName = this.finalize(node, new JSXNode.JSXMemberExpression(object, property));
104748 }
104749 }
104750 return elementName;
104751 };
104752 JSXParser.prototype.parseJSXAttributeName = function () {
104753 var node = this.createJSXNode();
104754 var attributeName;
104755 var identifier = this.parseJSXIdentifier();
104756 if (this.matchJSX(':')) {
104757 var namespace = identifier;
104758 this.expectJSX(':');
104759 var name_2 = this.parseJSXIdentifier();
104760 attributeName = this.finalize(node, new JSXNode.JSXNamespacedName(namespace, name_2));
104761 }
104762 else {
104763 attributeName = identifier;
104764 }
104765 return attributeName;
104766 };
104767 JSXParser.prototype.parseJSXStringLiteralAttribute = function () {
104768 var node = this.createJSXNode();
104769 var token = this.nextJSXToken();
104770 if (token.type !== 8 /* StringLiteral */) {
104771 this.throwUnexpectedToken(token);
104772 }
104773 var raw = this.getTokenRaw(token);
104774 return this.finalize(node, new Node.Literal(token.value, raw));
104775 };
104776 JSXParser.prototype.parseJSXExpressionAttribute = function () {
104777 var node = this.createJSXNode();
104778 this.expectJSX('{');
104779 this.finishJSX();
104780 if (this.match('}')) {
104781 this.tolerateError('JSX attributes must only be assigned a non-empty expression');
104782 }
104783 var expression = this.parseAssignmentExpression();
104784 this.reenterJSX();
104785 return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
104786 };
104787 JSXParser.prototype.parseJSXAttributeValue = function () {
104788 return this.matchJSX('{') ? this.parseJSXExpressionAttribute() :
104789 this.matchJSX('<') ? this.parseJSXElement() : this.parseJSXStringLiteralAttribute();
104790 };
104791 JSXParser.prototype.parseJSXNameValueAttribute = function () {
104792 var node = this.createJSXNode();
104793 var name = this.parseJSXAttributeName();
104794 var value = null;
104795 if (this.matchJSX('=')) {
104796 this.expectJSX('=');
104797 value = this.parseJSXAttributeValue();
104798 }
104799 return this.finalize(node, new JSXNode.JSXAttribute(name, value));
104800 };
104801 JSXParser.prototype.parseJSXSpreadAttribute = function () {
104802 var node = this.createJSXNode();
104803 this.expectJSX('{');
104804 this.expectJSX('...');
104805 this.finishJSX();
104806 var argument = this.parseAssignmentExpression();
104807 this.reenterJSX();
104808 return this.finalize(node, new JSXNode.JSXSpreadAttribute(argument));
104809 };
104810 JSXParser.prototype.parseJSXAttributes = function () {
104811 var attributes = [];
104812 while (!this.matchJSX('/') && !this.matchJSX('>')) {
104813 var attribute = this.matchJSX('{') ? this.parseJSXSpreadAttribute() :
104814 this.parseJSXNameValueAttribute();
104815 attributes.push(attribute);
104816 }
104817 return attributes;
104818 };
104819 JSXParser.prototype.parseJSXOpeningElement = function () {
104820 var node = this.createJSXNode();
104821 this.expectJSX('<');
104822 var name = this.parseJSXElementName();
104823 var attributes = this.parseJSXAttributes();
104824 var selfClosing = this.matchJSX('/');
104825 if (selfClosing) {
104826 this.expectJSX('/');
104827 }
104828 this.expectJSX('>');
104829 return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
104830 };
104831 JSXParser.prototype.parseJSXBoundaryElement = function () {
104832 var node = this.createJSXNode();
104833 this.expectJSX('<');
104834 if (this.matchJSX('/')) {
104835 this.expectJSX('/');
104836 var name_3 = this.parseJSXElementName();
104837 this.expectJSX('>');
104838 return this.finalize(node, new JSXNode.JSXClosingElement(name_3));
104839 }
104840 var name = this.parseJSXElementName();
104841 var attributes = this.parseJSXAttributes();
104842 var selfClosing = this.matchJSX('/');
104843 if (selfClosing) {
104844 this.expectJSX('/');
104845 }
104846 this.expectJSX('>');
104847 return this.finalize(node, new JSXNode.JSXOpeningElement(name, selfClosing, attributes));
104848 };
104849 JSXParser.prototype.parseJSXEmptyExpression = function () {
104850 var node = this.createJSXChildNode();
104851 this.collectComments();
104852 this.lastMarker.index = this.scanner.index;
104853 this.lastMarker.line = this.scanner.lineNumber;
104854 this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
104855 return this.finalize(node, new JSXNode.JSXEmptyExpression());
104856 };
104857 JSXParser.prototype.parseJSXExpressionContainer = function () {
104858 var node = this.createJSXNode();
104859 this.expectJSX('{');
104860 var expression;
104861 if (this.matchJSX('}')) {
104862 expression = this.parseJSXEmptyExpression();
104863 this.expectJSX('}');
104864 }
104865 else {
104866 this.finishJSX();
104867 expression = this.parseAssignmentExpression();
104868 this.reenterJSX();
104869 }
104870 return this.finalize(node, new JSXNode.JSXExpressionContainer(expression));
104871 };
104872 JSXParser.prototype.parseJSXChildren = function () {
104873 var children = [];
104874 while (!this.scanner.eof()) {
104875 var node = this.createJSXChildNode();
104876 var token = this.nextJSXText();
104877 if (token.start < token.end) {
104878 var raw = this.getTokenRaw(token);
104879 var child = this.finalize(node, new JSXNode.JSXText(token.value, raw));
104880 children.push(child);
104881 }
104882 if (this.scanner.source[this.scanner.index] === '{') {
104883 var container = this.parseJSXExpressionContainer();
104884 children.push(container);
104885 }
104886 else {
104887 break;
104888 }
104889 }
104890 return children;
104891 };
104892 JSXParser.prototype.parseComplexJSXElement = function (el) {
104893 var stack = [];
104894 while (!this.scanner.eof()) {
104895 el.children = el.children.concat(this.parseJSXChildren());
104896 var node = this.createJSXChildNode();
104897 var element = this.parseJSXBoundaryElement();
104898 if (element.type === jsx_syntax_1.JSXSyntax.JSXOpeningElement) {
104899 var opening = element;
104900 if (opening.selfClosing) {
104901 var child = this.finalize(node, new JSXNode.JSXElement(opening, [], null));
104902 el.children.push(child);
104903 }
104904 else {
104905 stack.push(el);
104906 el = { node: node, opening: opening, closing: null, children: [] };
104907 }
104908 }
104909 if (element.type === jsx_syntax_1.JSXSyntax.JSXClosingElement) {
104910 el.closing = element;
104911 var open_1 = getQualifiedElementName(el.opening.name);
104912 var close_1 = getQualifiedElementName(el.closing.name);
104913 if (open_1 !== close_1) {
104914 this.tolerateError('Expected corresponding JSX closing tag for %0', open_1);
104915 }
104916 if (stack.length > 0) {
104917 var child = this.finalize(el.node, new JSXNode.JSXElement(el.opening, el.children, el.closing));
104918 el = stack[stack.length - 1];
104919 el.children.push(child);
104920 stack.pop();
104921 }
104922 else {
104923 break;
104924 }
104925 }
104926 }
104927 return el;
104928 };
104929 JSXParser.prototype.parseJSXElement = function () {
104930 var node = this.createJSXNode();
104931 var opening = this.parseJSXOpeningElement();
104932 var children = [];
104933 var closing = null;
104934 if (!opening.selfClosing) {
104935 var el = this.parseComplexJSXElement({ node: node, opening: opening, closing: closing, children: children });
104936 children = el.children;
104937 closing = el.closing;
104938 }
104939 return this.finalize(node, new JSXNode.JSXElement(opening, children, closing));
104940 };
104941 JSXParser.prototype.parseJSXRoot = function () {
104942 // Pop the opening '<' added from the lookahead.
104943 if (this.config.tokens) {
104944 this.tokens.pop();
104945 }
104946 this.startJSX();
104947 var element = this.parseJSXElement();
104948 this.finishJSX();
104949 return element;
104950 };
104951 JSXParser.prototype.isStartOfExpression = function () {
104952 return _super.prototype.isStartOfExpression.call(this) || this.match('<');
104953 };
104954 return JSXParser;
104955 }(parser_1.Parser));
104956 exports.JSXParser = JSXParser;
104957
104958
104959/***/ },
104960/* 4 */
104961/***/ function(module, exports) {
104962
104963 "use strict";
104964 Object.defineProperty(exports, "__esModule", { value: true });
104965 // See also tools/generate-unicode-regex.js.
104966 var Regex = {
104967 // Unicode v8.0.0 NonAsciiIdentifierStart:
104968 NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
104969 // Unicode v8.0.0 NonAsciiIdentifierPart:
104970 NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
104971 };
104972 exports.Character = {
104973 /* tslint:disable:no-bitwise */
104974 fromCodePoint: function (cp) {
104975 return (cp < 0x10000) ? String.fromCharCode(cp) :
104976 String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) +
104977 String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));
104978 },
104979 // https://tc39.github.io/ecma262/#sec-white-space
104980 isWhiteSpace: function (cp) {
104981 return (cp === 0x20) || (cp === 0x09) || (cp === 0x0B) || (cp === 0x0C) || (cp === 0xA0) ||
104982 (cp >= 0x1680 && [0x1680, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(cp) >= 0);
104983 },
104984 // https://tc39.github.io/ecma262/#sec-line-terminators
104985 isLineTerminator: function (cp) {
104986 return (cp === 0x0A) || (cp === 0x0D) || (cp === 0x2028) || (cp === 0x2029);
104987 },
104988 // https://tc39.github.io/ecma262/#sec-names-and-keywords
104989 isIdentifierStart: function (cp) {
104990 return (cp === 0x24) || (cp === 0x5F) ||
104991 (cp >= 0x41 && cp <= 0x5A) ||
104992 (cp >= 0x61 && cp <= 0x7A) ||
104993 (cp === 0x5C) ||
104994 ((cp >= 0x80) && Regex.NonAsciiIdentifierStart.test(exports.Character.fromCodePoint(cp)));
104995 },
104996 isIdentifierPart: function (cp) {
104997 return (cp === 0x24) || (cp === 0x5F) ||
104998 (cp >= 0x41 && cp <= 0x5A) ||
104999 (cp >= 0x61 && cp <= 0x7A) ||
105000 (cp >= 0x30 && cp <= 0x39) ||
105001 (cp === 0x5C) ||
105002 ((cp >= 0x80) && Regex.NonAsciiIdentifierPart.test(exports.Character.fromCodePoint(cp)));
105003 },
105004 // https://tc39.github.io/ecma262/#sec-literals-numeric-literals
105005 isDecimalDigit: function (cp) {
105006 return (cp >= 0x30 && cp <= 0x39); // 0..9
105007 },
105008 isHexDigit: function (cp) {
105009 return (cp >= 0x30 && cp <= 0x39) ||
105010 (cp >= 0x41 && cp <= 0x46) ||
105011 (cp >= 0x61 && cp <= 0x66); // a..f
105012 },
105013 isOctalDigit: function (cp) {
105014 return (cp >= 0x30 && cp <= 0x37); // 0..7
105015 }
105016 };
105017
105018
105019/***/ },
105020/* 5 */
105021/***/ function(module, exports, __webpack_require__) {
105022
105023 "use strict";
105024 Object.defineProperty(exports, "__esModule", { value: true });
105025 var jsx_syntax_1 = __webpack_require__(6);
105026 /* tslint:disable:max-classes-per-file */
105027 var JSXClosingElement = (function () {
105028 function JSXClosingElement(name) {
105029 this.type = jsx_syntax_1.JSXSyntax.JSXClosingElement;
105030 this.name = name;
105031 }
105032 return JSXClosingElement;
105033 }());
105034 exports.JSXClosingElement = JSXClosingElement;
105035 var JSXElement = (function () {
105036 function JSXElement(openingElement, children, closingElement) {
105037 this.type = jsx_syntax_1.JSXSyntax.JSXElement;
105038 this.openingElement = openingElement;
105039 this.children = children;
105040 this.closingElement = closingElement;
105041 }
105042 return JSXElement;
105043 }());
105044 exports.JSXElement = JSXElement;
105045 var JSXEmptyExpression = (function () {
105046 function JSXEmptyExpression() {
105047 this.type = jsx_syntax_1.JSXSyntax.JSXEmptyExpression;
105048 }
105049 return JSXEmptyExpression;
105050 }());
105051 exports.JSXEmptyExpression = JSXEmptyExpression;
105052 var JSXExpressionContainer = (function () {
105053 function JSXExpressionContainer(expression) {
105054 this.type = jsx_syntax_1.JSXSyntax.JSXExpressionContainer;
105055 this.expression = expression;
105056 }
105057 return JSXExpressionContainer;
105058 }());
105059 exports.JSXExpressionContainer = JSXExpressionContainer;
105060 var JSXIdentifier = (function () {
105061 function JSXIdentifier(name) {
105062 this.type = jsx_syntax_1.JSXSyntax.JSXIdentifier;
105063 this.name = name;
105064 }
105065 return JSXIdentifier;
105066 }());
105067 exports.JSXIdentifier = JSXIdentifier;
105068 var JSXMemberExpression = (function () {
105069 function JSXMemberExpression(object, property) {
105070 this.type = jsx_syntax_1.JSXSyntax.JSXMemberExpression;
105071 this.object = object;
105072 this.property = property;
105073 }
105074 return JSXMemberExpression;
105075 }());
105076 exports.JSXMemberExpression = JSXMemberExpression;
105077 var JSXAttribute = (function () {
105078 function JSXAttribute(name, value) {
105079 this.type = jsx_syntax_1.JSXSyntax.JSXAttribute;
105080 this.name = name;
105081 this.value = value;
105082 }
105083 return JSXAttribute;
105084 }());
105085 exports.JSXAttribute = JSXAttribute;
105086 var JSXNamespacedName = (function () {
105087 function JSXNamespacedName(namespace, name) {
105088 this.type = jsx_syntax_1.JSXSyntax.JSXNamespacedName;
105089 this.namespace = namespace;
105090 this.name = name;
105091 }
105092 return JSXNamespacedName;
105093 }());
105094 exports.JSXNamespacedName = JSXNamespacedName;
105095 var JSXOpeningElement = (function () {
105096 function JSXOpeningElement(name, selfClosing, attributes) {
105097 this.type = jsx_syntax_1.JSXSyntax.JSXOpeningElement;
105098 this.name = name;
105099 this.selfClosing = selfClosing;
105100 this.attributes = attributes;
105101 }
105102 return JSXOpeningElement;
105103 }());
105104 exports.JSXOpeningElement = JSXOpeningElement;
105105 var JSXSpreadAttribute = (function () {
105106 function JSXSpreadAttribute(argument) {
105107 this.type = jsx_syntax_1.JSXSyntax.JSXSpreadAttribute;
105108 this.argument = argument;
105109 }
105110 return JSXSpreadAttribute;
105111 }());
105112 exports.JSXSpreadAttribute = JSXSpreadAttribute;
105113 var JSXText = (function () {
105114 function JSXText(value, raw) {
105115 this.type = jsx_syntax_1.JSXSyntax.JSXText;
105116 this.value = value;
105117 this.raw = raw;
105118 }
105119 return JSXText;
105120 }());
105121 exports.JSXText = JSXText;
105122
105123
105124/***/ },
105125/* 6 */
105126/***/ function(module, exports) {
105127
105128 "use strict";
105129 Object.defineProperty(exports, "__esModule", { value: true });
105130 exports.JSXSyntax = {
105131 JSXAttribute: 'JSXAttribute',
105132 JSXClosingElement: 'JSXClosingElement',
105133 JSXElement: 'JSXElement',
105134 JSXEmptyExpression: 'JSXEmptyExpression',
105135 JSXExpressionContainer: 'JSXExpressionContainer',
105136 JSXIdentifier: 'JSXIdentifier',
105137 JSXMemberExpression: 'JSXMemberExpression',
105138 JSXNamespacedName: 'JSXNamespacedName',
105139 JSXOpeningElement: 'JSXOpeningElement',
105140 JSXSpreadAttribute: 'JSXSpreadAttribute',
105141 JSXText: 'JSXText'
105142 };
105143
105144
105145/***/ },
105146/* 7 */
105147/***/ function(module, exports, __webpack_require__) {
105148
105149 "use strict";
105150 Object.defineProperty(exports, "__esModule", { value: true });
105151 var syntax_1 = __webpack_require__(2);
105152 /* tslint:disable:max-classes-per-file */
105153 var ArrayExpression = (function () {
105154 function ArrayExpression(elements) {
105155 this.type = syntax_1.Syntax.ArrayExpression;
105156 this.elements = elements;
105157 }
105158 return ArrayExpression;
105159 }());
105160 exports.ArrayExpression = ArrayExpression;
105161 var ArrayPattern = (function () {
105162 function ArrayPattern(elements) {
105163 this.type = syntax_1.Syntax.ArrayPattern;
105164 this.elements = elements;
105165 }
105166 return ArrayPattern;
105167 }());
105168 exports.ArrayPattern = ArrayPattern;
105169 var ArrowFunctionExpression = (function () {
105170 function ArrowFunctionExpression(params, body, expression) {
105171 this.type = syntax_1.Syntax.ArrowFunctionExpression;
105172 this.id = null;
105173 this.params = params;
105174 this.body = body;
105175 this.generator = false;
105176 this.expression = expression;
105177 this.async = false;
105178 }
105179 return ArrowFunctionExpression;
105180 }());
105181 exports.ArrowFunctionExpression = ArrowFunctionExpression;
105182 var AssignmentExpression = (function () {
105183 function AssignmentExpression(operator, left, right) {
105184 this.type = syntax_1.Syntax.AssignmentExpression;
105185 this.operator = operator;
105186 this.left = left;
105187 this.right = right;
105188 }
105189 return AssignmentExpression;
105190 }());
105191 exports.AssignmentExpression = AssignmentExpression;
105192 var AssignmentPattern = (function () {
105193 function AssignmentPattern(left, right) {
105194 this.type = syntax_1.Syntax.AssignmentPattern;
105195 this.left = left;
105196 this.right = right;
105197 }
105198 return AssignmentPattern;
105199 }());
105200 exports.AssignmentPattern = AssignmentPattern;
105201 var AsyncArrowFunctionExpression = (function () {
105202 function AsyncArrowFunctionExpression(params, body, expression) {
105203 this.type = syntax_1.Syntax.ArrowFunctionExpression;
105204 this.id = null;
105205 this.params = params;
105206 this.body = body;
105207 this.generator = false;
105208 this.expression = expression;
105209 this.async = true;
105210 }
105211 return AsyncArrowFunctionExpression;
105212 }());
105213 exports.AsyncArrowFunctionExpression = AsyncArrowFunctionExpression;
105214 var AsyncFunctionDeclaration = (function () {
105215 function AsyncFunctionDeclaration(id, params, body) {
105216 this.type = syntax_1.Syntax.FunctionDeclaration;
105217 this.id = id;
105218 this.params = params;
105219 this.body = body;
105220 this.generator = false;
105221 this.expression = false;
105222 this.async = true;
105223 }
105224 return AsyncFunctionDeclaration;
105225 }());
105226 exports.AsyncFunctionDeclaration = AsyncFunctionDeclaration;
105227 var AsyncFunctionExpression = (function () {
105228 function AsyncFunctionExpression(id, params, body) {
105229 this.type = syntax_1.Syntax.FunctionExpression;
105230 this.id = id;
105231 this.params = params;
105232 this.body = body;
105233 this.generator = false;
105234 this.expression = false;
105235 this.async = true;
105236 }
105237 return AsyncFunctionExpression;
105238 }());
105239 exports.AsyncFunctionExpression = AsyncFunctionExpression;
105240 var AwaitExpression = (function () {
105241 function AwaitExpression(argument) {
105242 this.type = syntax_1.Syntax.AwaitExpression;
105243 this.argument = argument;
105244 }
105245 return AwaitExpression;
105246 }());
105247 exports.AwaitExpression = AwaitExpression;
105248 var BinaryExpression = (function () {
105249 function BinaryExpression(operator, left, right) {
105250 var logical = (operator === '||' || operator === '&&');
105251 this.type = logical ? syntax_1.Syntax.LogicalExpression : syntax_1.Syntax.BinaryExpression;
105252 this.operator = operator;
105253 this.left = left;
105254 this.right = right;
105255 }
105256 return BinaryExpression;
105257 }());
105258 exports.BinaryExpression = BinaryExpression;
105259 var BlockStatement = (function () {
105260 function BlockStatement(body) {
105261 this.type = syntax_1.Syntax.BlockStatement;
105262 this.body = body;
105263 }
105264 return BlockStatement;
105265 }());
105266 exports.BlockStatement = BlockStatement;
105267 var BreakStatement = (function () {
105268 function BreakStatement(label) {
105269 this.type = syntax_1.Syntax.BreakStatement;
105270 this.label = label;
105271 }
105272 return BreakStatement;
105273 }());
105274 exports.BreakStatement = BreakStatement;
105275 var CallExpression = (function () {
105276 function CallExpression(callee, args) {
105277 this.type = syntax_1.Syntax.CallExpression;
105278 this.callee = callee;
105279 this.arguments = args;
105280 }
105281 return CallExpression;
105282 }());
105283 exports.CallExpression = CallExpression;
105284 var CatchClause = (function () {
105285 function CatchClause(param, body) {
105286 this.type = syntax_1.Syntax.CatchClause;
105287 this.param = param;
105288 this.body = body;
105289 }
105290 return CatchClause;
105291 }());
105292 exports.CatchClause = CatchClause;
105293 var ClassBody = (function () {
105294 function ClassBody(body) {
105295 this.type = syntax_1.Syntax.ClassBody;
105296 this.body = body;
105297 }
105298 return ClassBody;
105299 }());
105300 exports.ClassBody = ClassBody;
105301 var ClassDeclaration = (function () {
105302 function ClassDeclaration(id, superClass, body) {
105303 this.type = syntax_1.Syntax.ClassDeclaration;
105304 this.id = id;
105305 this.superClass = superClass;
105306 this.body = body;
105307 }
105308 return ClassDeclaration;
105309 }());
105310 exports.ClassDeclaration = ClassDeclaration;
105311 var ClassExpression = (function () {
105312 function ClassExpression(id, superClass, body) {
105313 this.type = syntax_1.Syntax.ClassExpression;
105314 this.id = id;
105315 this.superClass = superClass;
105316 this.body = body;
105317 }
105318 return ClassExpression;
105319 }());
105320 exports.ClassExpression = ClassExpression;
105321 var ComputedMemberExpression = (function () {
105322 function ComputedMemberExpression(object, property) {
105323 this.type = syntax_1.Syntax.MemberExpression;
105324 this.computed = true;
105325 this.object = object;
105326 this.property = property;
105327 }
105328 return ComputedMemberExpression;
105329 }());
105330 exports.ComputedMemberExpression = ComputedMemberExpression;
105331 var ConditionalExpression = (function () {
105332 function ConditionalExpression(test, consequent, alternate) {
105333 this.type = syntax_1.Syntax.ConditionalExpression;
105334 this.test = test;
105335 this.consequent = consequent;
105336 this.alternate = alternate;
105337 }
105338 return ConditionalExpression;
105339 }());
105340 exports.ConditionalExpression = ConditionalExpression;
105341 var ContinueStatement = (function () {
105342 function ContinueStatement(label) {
105343 this.type = syntax_1.Syntax.ContinueStatement;
105344 this.label = label;
105345 }
105346 return ContinueStatement;
105347 }());
105348 exports.ContinueStatement = ContinueStatement;
105349 var DebuggerStatement = (function () {
105350 function DebuggerStatement() {
105351 this.type = syntax_1.Syntax.DebuggerStatement;
105352 }
105353 return DebuggerStatement;
105354 }());
105355 exports.DebuggerStatement = DebuggerStatement;
105356 var Directive = (function () {
105357 function Directive(expression, directive) {
105358 this.type = syntax_1.Syntax.ExpressionStatement;
105359 this.expression = expression;
105360 this.directive = directive;
105361 }
105362 return Directive;
105363 }());
105364 exports.Directive = Directive;
105365 var DoWhileStatement = (function () {
105366 function DoWhileStatement(body, test) {
105367 this.type = syntax_1.Syntax.DoWhileStatement;
105368 this.body = body;
105369 this.test = test;
105370 }
105371 return DoWhileStatement;
105372 }());
105373 exports.DoWhileStatement = DoWhileStatement;
105374 var EmptyStatement = (function () {
105375 function EmptyStatement() {
105376 this.type = syntax_1.Syntax.EmptyStatement;
105377 }
105378 return EmptyStatement;
105379 }());
105380 exports.EmptyStatement = EmptyStatement;
105381 var ExportAllDeclaration = (function () {
105382 function ExportAllDeclaration(source) {
105383 this.type = syntax_1.Syntax.ExportAllDeclaration;
105384 this.source = source;
105385 }
105386 return ExportAllDeclaration;
105387 }());
105388 exports.ExportAllDeclaration = ExportAllDeclaration;
105389 var ExportDefaultDeclaration = (function () {
105390 function ExportDefaultDeclaration(declaration) {
105391 this.type = syntax_1.Syntax.ExportDefaultDeclaration;
105392 this.declaration = declaration;
105393 }
105394 return ExportDefaultDeclaration;
105395 }());
105396 exports.ExportDefaultDeclaration = ExportDefaultDeclaration;
105397 var ExportNamedDeclaration = (function () {
105398 function ExportNamedDeclaration(declaration, specifiers, source) {
105399 this.type = syntax_1.Syntax.ExportNamedDeclaration;
105400 this.declaration = declaration;
105401 this.specifiers = specifiers;
105402 this.source = source;
105403 }
105404 return ExportNamedDeclaration;
105405 }());
105406 exports.ExportNamedDeclaration = ExportNamedDeclaration;
105407 var ExportSpecifier = (function () {
105408 function ExportSpecifier(local, exported) {
105409 this.type = syntax_1.Syntax.ExportSpecifier;
105410 this.exported = exported;
105411 this.local = local;
105412 }
105413 return ExportSpecifier;
105414 }());
105415 exports.ExportSpecifier = ExportSpecifier;
105416 var ExpressionStatement = (function () {
105417 function ExpressionStatement(expression) {
105418 this.type = syntax_1.Syntax.ExpressionStatement;
105419 this.expression = expression;
105420 }
105421 return ExpressionStatement;
105422 }());
105423 exports.ExpressionStatement = ExpressionStatement;
105424 var ForInStatement = (function () {
105425 function ForInStatement(left, right, body) {
105426 this.type = syntax_1.Syntax.ForInStatement;
105427 this.left = left;
105428 this.right = right;
105429 this.body = body;
105430 this.each = false;
105431 }
105432 return ForInStatement;
105433 }());
105434 exports.ForInStatement = ForInStatement;
105435 var ForOfStatement = (function () {
105436 function ForOfStatement(left, right, body) {
105437 this.type = syntax_1.Syntax.ForOfStatement;
105438 this.left = left;
105439 this.right = right;
105440 this.body = body;
105441 }
105442 return ForOfStatement;
105443 }());
105444 exports.ForOfStatement = ForOfStatement;
105445 var ForStatement = (function () {
105446 function ForStatement(init, test, update, body) {
105447 this.type = syntax_1.Syntax.ForStatement;
105448 this.init = init;
105449 this.test = test;
105450 this.update = update;
105451 this.body = body;
105452 }
105453 return ForStatement;
105454 }());
105455 exports.ForStatement = ForStatement;
105456 var FunctionDeclaration = (function () {
105457 function FunctionDeclaration(id, params, body, generator) {
105458 this.type = syntax_1.Syntax.FunctionDeclaration;
105459 this.id = id;
105460 this.params = params;
105461 this.body = body;
105462 this.generator = generator;
105463 this.expression = false;
105464 this.async = false;
105465 }
105466 return FunctionDeclaration;
105467 }());
105468 exports.FunctionDeclaration = FunctionDeclaration;
105469 var FunctionExpression = (function () {
105470 function FunctionExpression(id, params, body, generator) {
105471 this.type = syntax_1.Syntax.FunctionExpression;
105472 this.id = id;
105473 this.params = params;
105474 this.body = body;
105475 this.generator = generator;
105476 this.expression = false;
105477 this.async = false;
105478 }
105479 return FunctionExpression;
105480 }());
105481 exports.FunctionExpression = FunctionExpression;
105482 var Identifier = (function () {
105483 function Identifier(name) {
105484 this.type = syntax_1.Syntax.Identifier;
105485 this.name = name;
105486 }
105487 return Identifier;
105488 }());
105489 exports.Identifier = Identifier;
105490 var IfStatement = (function () {
105491 function IfStatement(test, consequent, alternate) {
105492 this.type = syntax_1.Syntax.IfStatement;
105493 this.test = test;
105494 this.consequent = consequent;
105495 this.alternate = alternate;
105496 }
105497 return IfStatement;
105498 }());
105499 exports.IfStatement = IfStatement;
105500 var ImportDeclaration = (function () {
105501 function ImportDeclaration(specifiers, source) {
105502 this.type = syntax_1.Syntax.ImportDeclaration;
105503 this.specifiers = specifiers;
105504 this.source = source;
105505 }
105506 return ImportDeclaration;
105507 }());
105508 exports.ImportDeclaration = ImportDeclaration;
105509 var ImportDefaultSpecifier = (function () {
105510 function ImportDefaultSpecifier(local) {
105511 this.type = syntax_1.Syntax.ImportDefaultSpecifier;
105512 this.local = local;
105513 }
105514 return ImportDefaultSpecifier;
105515 }());
105516 exports.ImportDefaultSpecifier = ImportDefaultSpecifier;
105517 var ImportNamespaceSpecifier = (function () {
105518 function ImportNamespaceSpecifier(local) {
105519 this.type = syntax_1.Syntax.ImportNamespaceSpecifier;
105520 this.local = local;
105521 }
105522 return ImportNamespaceSpecifier;
105523 }());
105524 exports.ImportNamespaceSpecifier = ImportNamespaceSpecifier;
105525 var ImportSpecifier = (function () {
105526 function ImportSpecifier(local, imported) {
105527 this.type = syntax_1.Syntax.ImportSpecifier;
105528 this.local = local;
105529 this.imported = imported;
105530 }
105531 return ImportSpecifier;
105532 }());
105533 exports.ImportSpecifier = ImportSpecifier;
105534 var LabeledStatement = (function () {
105535 function LabeledStatement(label, body) {
105536 this.type = syntax_1.Syntax.LabeledStatement;
105537 this.label = label;
105538 this.body = body;
105539 }
105540 return LabeledStatement;
105541 }());
105542 exports.LabeledStatement = LabeledStatement;
105543 var Literal = (function () {
105544 function Literal(value, raw) {
105545 this.type = syntax_1.Syntax.Literal;
105546 this.value = value;
105547 this.raw = raw;
105548 }
105549 return Literal;
105550 }());
105551 exports.Literal = Literal;
105552 var MetaProperty = (function () {
105553 function MetaProperty(meta, property) {
105554 this.type = syntax_1.Syntax.MetaProperty;
105555 this.meta = meta;
105556 this.property = property;
105557 }
105558 return MetaProperty;
105559 }());
105560 exports.MetaProperty = MetaProperty;
105561 var MethodDefinition = (function () {
105562 function MethodDefinition(key, computed, value, kind, isStatic) {
105563 this.type = syntax_1.Syntax.MethodDefinition;
105564 this.key = key;
105565 this.computed = computed;
105566 this.value = value;
105567 this.kind = kind;
105568 this.static = isStatic;
105569 }
105570 return MethodDefinition;
105571 }());
105572 exports.MethodDefinition = MethodDefinition;
105573 var Module = (function () {
105574 function Module(body) {
105575 this.type = syntax_1.Syntax.Program;
105576 this.body = body;
105577 this.sourceType = 'module';
105578 }
105579 return Module;
105580 }());
105581 exports.Module = Module;
105582 var NewExpression = (function () {
105583 function NewExpression(callee, args) {
105584 this.type = syntax_1.Syntax.NewExpression;
105585 this.callee = callee;
105586 this.arguments = args;
105587 }
105588 return NewExpression;
105589 }());
105590 exports.NewExpression = NewExpression;
105591 var ObjectExpression = (function () {
105592 function ObjectExpression(properties) {
105593 this.type = syntax_1.Syntax.ObjectExpression;
105594 this.properties = properties;
105595 }
105596 return ObjectExpression;
105597 }());
105598 exports.ObjectExpression = ObjectExpression;
105599 var ObjectPattern = (function () {
105600 function ObjectPattern(properties) {
105601 this.type = syntax_1.Syntax.ObjectPattern;
105602 this.properties = properties;
105603 }
105604 return ObjectPattern;
105605 }());
105606 exports.ObjectPattern = ObjectPattern;
105607 var Property = (function () {
105608 function Property(kind, key, computed, value, method, shorthand) {
105609 this.type = syntax_1.Syntax.Property;
105610 this.key = key;
105611 this.computed = computed;
105612 this.value = value;
105613 this.kind = kind;
105614 this.method = method;
105615 this.shorthand = shorthand;
105616 }
105617 return Property;
105618 }());
105619 exports.Property = Property;
105620 var RegexLiteral = (function () {
105621 function RegexLiteral(value, raw, pattern, flags) {
105622 this.type = syntax_1.Syntax.Literal;
105623 this.value = value;
105624 this.raw = raw;
105625 this.regex = { pattern: pattern, flags: flags };
105626 }
105627 return RegexLiteral;
105628 }());
105629 exports.RegexLiteral = RegexLiteral;
105630 var RestElement = (function () {
105631 function RestElement(argument) {
105632 this.type = syntax_1.Syntax.RestElement;
105633 this.argument = argument;
105634 }
105635 return RestElement;
105636 }());
105637 exports.RestElement = RestElement;
105638 var ReturnStatement = (function () {
105639 function ReturnStatement(argument) {
105640 this.type = syntax_1.Syntax.ReturnStatement;
105641 this.argument = argument;
105642 }
105643 return ReturnStatement;
105644 }());
105645 exports.ReturnStatement = ReturnStatement;
105646 var Script = (function () {
105647 function Script(body) {
105648 this.type = syntax_1.Syntax.Program;
105649 this.body = body;
105650 this.sourceType = 'script';
105651 }
105652 return Script;
105653 }());
105654 exports.Script = Script;
105655 var SequenceExpression = (function () {
105656 function SequenceExpression(expressions) {
105657 this.type = syntax_1.Syntax.SequenceExpression;
105658 this.expressions = expressions;
105659 }
105660 return SequenceExpression;
105661 }());
105662 exports.SequenceExpression = SequenceExpression;
105663 var SpreadElement = (function () {
105664 function SpreadElement(argument) {
105665 this.type = syntax_1.Syntax.SpreadElement;
105666 this.argument = argument;
105667 }
105668 return SpreadElement;
105669 }());
105670 exports.SpreadElement = SpreadElement;
105671 var StaticMemberExpression = (function () {
105672 function StaticMemberExpression(object, property) {
105673 this.type = syntax_1.Syntax.MemberExpression;
105674 this.computed = false;
105675 this.object = object;
105676 this.property = property;
105677 }
105678 return StaticMemberExpression;
105679 }());
105680 exports.StaticMemberExpression = StaticMemberExpression;
105681 var Super = (function () {
105682 function Super() {
105683 this.type = syntax_1.Syntax.Super;
105684 }
105685 return Super;
105686 }());
105687 exports.Super = Super;
105688 var SwitchCase = (function () {
105689 function SwitchCase(test, consequent) {
105690 this.type = syntax_1.Syntax.SwitchCase;
105691 this.test = test;
105692 this.consequent = consequent;
105693 }
105694 return SwitchCase;
105695 }());
105696 exports.SwitchCase = SwitchCase;
105697 var SwitchStatement = (function () {
105698 function SwitchStatement(discriminant, cases) {
105699 this.type = syntax_1.Syntax.SwitchStatement;
105700 this.discriminant = discriminant;
105701 this.cases = cases;
105702 }
105703 return SwitchStatement;
105704 }());
105705 exports.SwitchStatement = SwitchStatement;
105706 var TaggedTemplateExpression = (function () {
105707 function TaggedTemplateExpression(tag, quasi) {
105708 this.type = syntax_1.Syntax.TaggedTemplateExpression;
105709 this.tag = tag;
105710 this.quasi = quasi;
105711 }
105712 return TaggedTemplateExpression;
105713 }());
105714 exports.TaggedTemplateExpression = TaggedTemplateExpression;
105715 var TemplateElement = (function () {
105716 function TemplateElement(value, tail) {
105717 this.type = syntax_1.Syntax.TemplateElement;
105718 this.value = value;
105719 this.tail = tail;
105720 }
105721 return TemplateElement;
105722 }());
105723 exports.TemplateElement = TemplateElement;
105724 var TemplateLiteral = (function () {
105725 function TemplateLiteral(quasis, expressions) {
105726 this.type = syntax_1.Syntax.TemplateLiteral;
105727 this.quasis = quasis;
105728 this.expressions = expressions;
105729 }
105730 return TemplateLiteral;
105731 }());
105732 exports.TemplateLiteral = TemplateLiteral;
105733 var ThisExpression = (function () {
105734 function ThisExpression() {
105735 this.type = syntax_1.Syntax.ThisExpression;
105736 }
105737 return ThisExpression;
105738 }());
105739 exports.ThisExpression = ThisExpression;
105740 var ThrowStatement = (function () {
105741 function ThrowStatement(argument) {
105742 this.type = syntax_1.Syntax.ThrowStatement;
105743 this.argument = argument;
105744 }
105745 return ThrowStatement;
105746 }());
105747 exports.ThrowStatement = ThrowStatement;
105748 var TryStatement = (function () {
105749 function TryStatement(block, handler, finalizer) {
105750 this.type = syntax_1.Syntax.TryStatement;
105751 this.block = block;
105752 this.handler = handler;
105753 this.finalizer = finalizer;
105754 }
105755 return TryStatement;
105756 }());
105757 exports.TryStatement = TryStatement;
105758 var UnaryExpression = (function () {
105759 function UnaryExpression(operator, argument) {
105760 this.type = syntax_1.Syntax.UnaryExpression;
105761 this.operator = operator;
105762 this.argument = argument;
105763 this.prefix = true;
105764 }
105765 return UnaryExpression;
105766 }());
105767 exports.UnaryExpression = UnaryExpression;
105768 var UpdateExpression = (function () {
105769 function UpdateExpression(operator, argument, prefix) {
105770 this.type = syntax_1.Syntax.UpdateExpression;
105771 this.operator = operator;
105772 this.argument = argument;
105773 this.prefix = prefix;
105774 }
105775 return UpdateExpression;
105776 }());
105777 exports.UpdateExpression = UpdateExpression;
105778 var VariableDeclaration = (function () {
105779 function VariableDeclaration(declarations, kind) {
105780 this.type = syntax_1.Syntax.VariableDeclaration;
105781 this.declarations = declarations;
105782 this.kind = kind;
105783 }
105784 return VariableDeclaration;
105785 }());
105786 exports.VariableDeclaration = VariableDeclaration;
105787 var VariableDeclarator = (function () {
105788 function VariableDeclarator(id, init) {
105789 this.type = syntax_1.Syntax.VariableDeclarator;
105790 this.id = id;
105791 this.init = init;
105792 }
105793 return VariableDeclarator;
105794 }());
105795 exports.VariableDeclarator = VariableDeclarator;
105796 var WhileStatement = (function () {
105797 function WhileStatement(test, body) {
105798 this.type = syntax_1.Syntax.WhileStatement;
105799 this.test = test;
105800 this.body = body;
105801 }
105802 return WhileStatement;
105803 }());
105804 exports.WhileStatement = WhileStatement;
105805 var WithStatement = (function () {
105806 function WithStatement(object, body) {
105807 this.type = syntax_1.Syntax.WithStatement;
105808 this.object = object;
105809 this.body = body;
105810 }
105811 return WithStatement;
105812 }());
105813 exports.WithStatement = WithStatement;
105814 var YieldExpression = (function () {
105815 function YieldExpression(argument, delegate) {
105816 this.type = syntax_1.Syntax.YieldExpression;
105817 this.argument = argument;
105818 this.delegate = delegate;
105819 }
105820 return YieldExpression;
105821 }());
105822 exports.YieldExpression = YieldExpression;
105823
105824
105825/***/ },
105826/* 8 */
105827/***/ function(module, exports, __webpack_require__) {
105828
105829 "use strict";
105830 Object.defineProperty(exports, "__esModule", { value: true });
105831 var assert_1 = __webpack_require__(9);
105832 var error_handler_1 = __webpack_require__(10);
105833 var messages_1 = __webpack_require__(11);
105834 var Node = __webpack_require__(7);
105835 var scanner_1 = __webpack_require__(12);
105836 var syntax_1 = __webpack_require__(2);
105837 var token_1 = __webpack_require__(13);
105838 var ArrowParameterPlaceHolder = 'ArrowParameterPlaceHolder';
105839 var Parser = (function () {
105840 function Parser(code, options, delegate) {
105841 if (options === void 0) { options = {}; }
105842 this.config = {
105843 range: (typeof options.range === 'boolean') && options.range,
105844 loc: (typeof options.loc === 'boolean') && options.loc,
105845 source: null,
105846 tokens: (typeof options.tokens === 'boolean') && options.tokens,
105847 comment: (typeof options.comment === 'boolean') && options.comment,
105848 tolerant: (typeof options.tolerant === 'boolean') && options.tolerant
105849 };
105850 if (this.config.loc && options.source && options.source !== null) {
105851 this.config.source = String(options.source);
105852 }
105853 this.delegate = delegate;
105854 this.errorHandler = new error_handler_1.ErrorHandler();
105855 this.errorHandler.tolerant = this.config.tolerant;
105856 this.scanner = new scanner_1.Scanner(code, this.errorHandler);
105857 this.scanner.trackComment = this.config.comment;
105858 this.operatorPrecedence = {
105859 ')': 0,
105860 ';': 0,
105861 ',': 0,
105862 '=': 0,
105863 ']': 0,
105864 '||': 1,
105865 '&&': 2,
105866 '|': 3,
105867 '^': 4,
105868 '&': 5,
105869 '==': 6,
105870 '!=': 6,
105871 '===': 6,
105872 '!==': 6,
105873 '<': 7,
105874 '>': 7,
105875 '<=': 7,
105876 '>=': 7,
105877 '<<': 8,
105878 '>>': 8,
105879 '>>>': 8,
105880 '+': 9,
105881 '-': 9,
105882 '*': 11,
105883 '/': 11,
105884 '%': 11
105885 };
105886 this.lookahead = {
105887 type: 2 /* EOF */,
105888 value: '',
105889 lineNumber: this.scanner.lineNumber,
105890 lineStart: 0,
105891 start: 0,
105892 end: 0
105893 };
105894 this.hasLineTerminator = false;
105895 this.context = {
105896 isModule: false,
105897 await: false,
105898 allowIn: true,
105899 allowStrictDirective: true,
105900 allowYield: true,
105901 firstCoverInitializedNameError: null,
105902 isAssignmentTarget: false,
105903 isBindingElement: false,
105904 inFunctionBody: false,
105905 inIteration: false,
105906 inSwitch: false,
105907 labelSet: {},
105908 strict: false
105909 };
105910 this.tokens = [];
105911 this.startMarker = {
105912 index: 0,
105913 line: this.scanner.lineNumber,
105914 column: 0
105915 };
105916 this.lastMarker = {
105917 index: 0,
105918 line: this.scanner.lineNumber,
105919 column: 0
105920 };
105921 this.nextToken();
105922 this.lastMarker = {
105923 index: this.scanner.index,
105924 line: this.scanner.lineNumber,
105925 column: this.scanner.index - this.scanner.lineStart
105926 };
105927 }
105928 Parser.prototype.throwError = function (messageFormat) {
105929 var values = [];
105930 for (var _i = 1; _i < arguments.length; _i++) {
105931 values[_i - 1] = arguments[_i];
105932 }
105933 var args = Array.prototype.slice.call(arguments, 1);
105934 var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) {
105935 assert_1.assert(idx < args.length, 'Message reference must be in range');
105936 return args[idx];
105937 });
105938 var index = this.lastMarker.index;
105939 var line = this.lastMarker.line;
105940 var column = this.lastMarker.column + 1;
105941 throw this.errorHandler.createError(index, line, column, msg);
105942 };
105943 Parser.prototype.tolerateError = function (messageFormat) {
105944 var values = [];
105945 for (var _i = 1; _i < arguments.length; _i++) {
105946 values[_i - 1] = arguments[_i];
105947 }
105948 var args = Array.prototype.slice.call(arguments, 1);
105949 var msg = messageFormat.replace(/%(\d)/g, function (whole, idx) {
105950 assert_1.assert(idx < args.length, 'Message reference must be in range');
105951 return args[idx];
105952 });
105953 var index = this.lastMarker.index;
105954 var line = this.scanner.lineNumber;
105955 var column = this.lastMarker.column + 1;
105956 this.errorHandler.tolerateError(index, line, column, msg);
105957 };
105958 // Throw an exception because of the token.
105959 Parser.prototype.unexpectedTokenError = function (token, message) {
105960 var msg = message || messages_1.Messages.UnexpectedToken;
105961 var value;
105962 if (token) {
105963 if (!message) {
105964 msg = (token.type === 2 /* EOF */) ? messages_1.Messages.UnexpectedEOS :
105965 (token.type === 3 /* Identifier */) ? messages_1.Messages.UnexpectedIdentifier :
105966 (token.type === 6 /* NumericLiteral */) ? messages_1.Messages.UnexpectedNumber :
105967 (token.type === 8 /* StringLiteral */) ? messages_1.Messages.UnexpectedString :
105968 (token.type === 10 /* Template */) ? messages_1.Messages.UnexpectedTemplate :
105969 messages_1.Messages.UnexpectedToken;
105970 if (token.type === 4 /* Keyword */) {
105971 if (this.scanner.isFutureReservedWord(token.value)) {
105972 msg = messages_1.Messages.UnexpectedReserved;
105973 }
105974 else if (this.context.strict && this.scanner.isStrictModeReservedWord(token.value)) {
105975 msg = messages_1.Messages.StrictReservedWord;
105976 }
105977 }
105978 }
105979 value = token.value;
105980 }
105981 else {
105982 value = 'ILLEGAL';
105983 }
105984 msg = msg.replace('%0', value);
105985 if (token && typeof token.lineNumber === 'number') {
105986 var index = token.start;
105987 var line = token.lineNumber;
105988 var lastMarkerLineStart = this.lastMarker.index - this.lastMarker.column;
105989 var column = token.start - lastMarkerLineStart + 1;
105990 return this.errorHandler.createError(index, line, column, msg);
105991 }
105992 else {
105993 var index = this.lastMarker.index;
105994 var line = this.lastMarker.line;
105995 var column = this.lastMarker.column + 1;
105996 return this.errorHandler.createError(index, line, column, msg);
105997 }
105998 };
105999 Parser.prototype.throwUnexpectedToken = function (token, message) {
106000 throw this.unexpectedTokenError(token, message);
106001 };
106002 Parser.prototype.tolerateUnexpectedToken = function (token, message) {
106003 this.errorHandler.tolerate(this.unexpectedTokenError(token, message));
106004 };
106005 Parser.prototype.collectComments = function () {
106006 if (!this.config.comment) {
106007 this.scanner.scanComments();
106008 }
106009 else {
106010 var comments = this.scanner.scanComments();
106011 if (comments.length > 0 && this.delegate) {
106012 for (var i = 0; i < comments.length; ++i) {
106013 var e = comments[i];
106014 var node = void 0;
106015 node = {
106016 type: e.multiLine ? 'BlockComment' : 'LineComment',
106017 value: this.scanner.source.slice(e.slice[0], e.slice[1])
106018 };
106019 if (this.config.range) {
106020 node.range = e.range;
106021 }
106022 if (this.config.loc) {
106023 node.loc = e.loc;
106024 }
106025 var metadata = {
106026 start: {
106027 line: e.loc.start.line,
106028 column: e.loc.start.column,
106029 offset: e.range[0]
106030 },
106031 end: {
106032 line: e.loc.end.line,
106033 column: e.loc.end.column,
106034 offset: e.range[1]
106035 }
106036 };
106037 this.delegate(node, metadata);
106038 }
106039 }
106040 }
106041 };
106042 // From internal representation to an external structure
106043 Parser.prototype.getTokenRaw = function (token) {
106044 return this.scanner.source.slice(token.start, token.end);
106045 };
106046 Parser.prototype.convertToken = function (token) {
106047 var t = {
106048 type: token_1.TokenName[token.type],
106049 value: this.getTokenRaw(token)
106050 };
106051 if (this.config.range) {
106052 t.range = [token.start, token.end];
106053 }
106054 if (this.config.loc) {
106055 t.loc = {
106056 start: {
106057 line: this.startMarker.line,
106058 column: this.startMarker.column
106059 },
106060 end: {
106061 line: this.scanner.lineNumber,
106062 column: this.scanner.index - this.scanner.lineStart
106063 }
106064 };
106065 }
106066 if (token.type === 9 /* RegularExpression */) {
106067 var pattern = token.pattern;
106068 var flags = token.flags;
106069 t.regex = { pattern: pattern, flags: flags };
106070 }
106071 return t;
106072 };
106073 Parser.prototype.nextToken = function () {
106074 var token = this.lookahead;
106075 this.lastMarker.index = this.scanner.index;
106076 this.lastMarker.line = this.scanner.lineNumber;
106077 this.lastMarker.column = this.scanner.index - this.scanner.lineStart;
106078 this.collectComments();
106079 if (this.scanner.index !== this.startMarker.index) {
106080 this.startMarker.index = this.scanner.index;
106081 this.startMarker.line = this.scanner.lineNumber;
106082 this.startMarker.column = this.scanner.index - this.scanner.lineStart;
106083 }
106084 var next = this.scanner.lex();
106085 this.hasLineTerminator = (token.lineNumber !== next.lineNumber);
106086 if (next && this.context.strict && next.type === 3 /* Identifier */) {
106087 if (this.scanner.isStrictModeReservedWord(next.value)) {
106088 next.type = 4 /* Keyword */;
106089 }
106090 }
106091 this.lookahead = next;
106092 if (this.config.tokens && next.type !== 2 /* EOF */) {
106093 this.tokens.push(this.convertToken(next));
106094 }
106095 return token;
106096 };
106097 Parser.prototype.nextRegexToken = function () {
106098 this.collectComments();
106099 var token = this.scanner.scanRegExp();
106100 if (this.config.tokens) {
106101 // Pop the previous token, '/' or '/='
106102 // This is added from the lookahead token.
106103 this.tokens.pop();
106104 this.tokens.push(this.convertToken(token));
106105 }
106106 // Prime the next lookahead.
106107 this.lookahead = token;
106108 this.nextToken();
106109 return token;
106110 };
106111 Parser.prototype.createNode = function () {
106112 return {
106113 index: this.startMarker.index,
106114 line: this.startMarker.line,
106115 column: this.startMarker.column
106116 };
106117 };
106118 Parser.prototype.startNode = function (token, lastLineStart) {
106119 if (lastLineStart === void 0) { lastLineStart = 0; }
106120 var column = token.start - token.lineStart;
106121 var line = token.lineNumber;
106122 if (column < 0) {
106123 column += lastLineStart;
106124 line--;
106125 }
106126 return {
106127 index: token.start,
106128 line: line,
106129 column: column
106130 };
106131 };
106132 Parser.prototype.finalize = function (marker, node) {
106133 if (this.config.range) {
106134 node.range = [marker.index, this.lastMarker.index];
106135 }
106136 if (this.config.loc) {
106137 node.loc = {
106138 start: {
106139 line: marker.line,
106140 column: marker.column,
106141 },
106142 end: {
106143 line: this.lastMarker.line,
106144 column: this.lastMarker.column
106145 }
106146 };
106147 if (this.config.source) {
106148 node.loc.source = this.config.source;
106149 }
106150 }
106151 if (this.delegate) {
106152 var metadata = {
106153 start: {
106154 line: marker.line,
106155 column: marker.column,
106156 offset: marker.index
106157 },
106158 end: {
106159 line: this.lastMarker.line,
106160 column: this.lastMarker.column,
106161 offset: this.lastMarker.index
106162 }
106163 };
106164 this.delegate(node, metadata);
106165 }
106166 return node;
106167 };
106168 // Expect the next token to match the specified punctuator.
106169 // If not, an exception will be thrown.
106170 Parser.prototype.expect = function (value) {
106171 var token = this.nextToken();
106172 if (token.type !== 7 /* Punctuator */ || token.value !== value) {
106173 this.throwUnexpectedToken(token);
106174 }
106175 };
106176 // Quietly expect a comma when in tolerant mode, otherwise delegates to expect().
106177 Parser.prototype.expectCommaSeparator = function () {
106178 if (this.config.tolerant) {
106179 var token = this.lookahead;
106180 if (token.type === 7 /* Punctuator */ && token.value === ',') {
106181 this.nextToken();
106182 }
106183 else if (token.type === 7 /* Punctuator */ && token.value === ';') {
106184 this.nextToken();
106185 this.tolerateUnexpectedToken(token);
106186 }
106187 else {
106188 this.tolerateUnexpectedToken(token, messages_1.Messages.UnexpectedToken);
106189 }
106190 }
106191 else {
106192 this.expect(',');
106193 }
106194 };
106195 // Expect the next token to match the specified keyword.
106196 // If not, an exception will be thrown.
106197 Parser.prototype.expectKeyword = function (keyword) {
106198 var token = this.nextToken();
106199 if (token.type !== 4 /* Keyword */ || token.value !== keyword) {
106200 this.throwUnexpectedToken(token);
106201 }
106202 };
106203 // Return true if the next token matches the specified punctuator.
106204 Parser.prototype.match = function (value) {
106205 return this.lookahead.type === 7 /* Punctuator */ && this.lookahead.value === value;
106206 };
106207 // Return true if the next token matches the specified keyword
106208 Parser.prototype.matchKeyword = function (keyword) {
106209 return this.lookahead.type === 4 /* Keyword */ && this.lookahead.value === keyword;
106210 };
106211 // Return true if the next token matches the specified contextual keyword
106212 // (where an identifier is sometimes a keyword depending on the context)
106213 Parser.prototype.matchContextualKeyword = function (keyword) {
106214 return this.lookahead.type === 3 /* Identifier */ && this.lookahead.value === keyword;
106215 };
106216 // Return true if the next token is an assignment operator
106217 Parser.prototype.matchAssign = function () {
106218 if (this.lookahead.type !== 7 /* Punctuator */) {
106219 return false;
106220 }
106221 var op = this.lookahead.value;
106222 return op === '=' ||
106223 op === '*=' ||
106224 op === '**=' ||
106225 op === '/=' ||
106226 op === '%=' ||
106227 op === '+=' ||
106228 op === '-=' ||
106229 op === '<<=' ||
106230 op === '>>=' ||
106231 op === '>>>=' ||
106232 op === '&=' ||
106233 op === '^=' ||
106234 op === '|=';
106235 };
106236 // Cover grammar support.
106237 //
106238 // When an assignment expression position starts with an left parenthesis, the determination of the type
106239 // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead)
106240 // or the first comma. This situation also defers the determination of all the expressions nested in the pair.
106241 //
106242 // There are three productions that can be parsed in a parentheses pair that needs to be determined
106243 // after the outermost pair is closed. They are:
106244 //
106245 // 1. AssignmentExpression
106246 // 2. BindingElements
106247 // 3. AssignmentTargets
106248 //
106249 // In order to avoid exponential backtracking, we use two flags to denote if the production can be
106250 // binding element or assignment target.
106251 //
106252 // The three productions have the relationship:
106253 //
106254 // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression
106255 //
106256 // with a single exception that CoverInitializedName when used directly in an Expression, generates
106257 // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the
106258 // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair.
106259 //
106260 // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not
106261 // effect the current flags. This means the production the parser parses is only used as an expression. Therefore
106262 // the CoverInitializedName check is conducted.
106263 //
106264 // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates
106265 // the flags outside of the parser. This means the production the parser parses is used as a part of a potential
106266 // pattern. The CoverInitializedName check is deferred.
106267 Parser.prototype.isolateCoverGrammar = function (parseFunction) {
106268 var previousIsBindingElement = this.context.isBindingElement;
106269 var previousIsAssignmentTarget = this.context.isAssignmentTarget;
106270 var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
106271 this.context.isBindingElement = true;
106272 this.context.isAssignmentTarget = true;
106273 this.context.firstCoverInitializedNameError = null;
106274 var result = parseFunction.call(this);
106275 if (this.context.firstCoverInitializedNameError !== null) {
106276 this.throwUnexpectedToken(this.context.firstCoverInitializedNameError);
106277 }
106278 this.context.isBindingElement = previousIsBindingElement;
106279 this.context.isAssignmentTarget = previousIsAssignmentTarget;
106280 this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError;
106281 return result;
106282 };
106283 Parser.prototype.inheritCoverGrammar = function (parseFunction) {
106284 var previousIsBindingElement = this.context.isBindingElement;
106285 var previousIsAssignmentTarget = this.context.isAssignmentTarget;
106286 var previousFirstCoverInitializedNameError = this.context.firstCoverInitializedNameError;
106287 this.context.isBindingElement = true;
106288 this.context.isAssignmentTarget = true;
106289 this.context.firstCoverInitializedNameError = null;
106290 var result = parseFunction.call(this);
106291 this.context.isBindingElement = this.context.isBindingElement && previousIsBindingElement;
106292 this.context.isAssignmentTarget = this.context.isAssignmentTarget && previousIsAssignmentTarget;
106293 this.context.firstCoverInitializedNameError = previousFirstCoverInitializedNameError || this.context.firstCoverInitializedNameError;
106294 return result;
106295 };
106296 Parser.prototype.consumeSemicolon = function () {
106297 if (this.match(';')) {
106298 this.nextToken();
106299 }
106300 else if (!this.hasLineTerminator) {
106301 if (this.lookahead.type !== 2 /* EOF */ && !this.match('}')) {
106302 this.throwUnexpectedToken(this.lookahead);
106303 }
106304 this.lastMarker.index = this.startMarker.index;
106305 this.lastMarker.line = this.startMarker.line;
106306 this.lastMarker.column = this.startMarker.column;
106307 }
106308 };
106309 // https://tc39.github.io/ecma262/#sec-primary-expression
106310 Parser.prototype.parsePrimaryExpression = function () {
106311 var node = this.createNode();
106312 var expr;
106313 var token, raw;
106314 switch (this.lookahead.type) {
106315 case 3 /* Identifier */:
106316 if ((this.context.isModule || this.context.await) && this.lookahead.value === 'await') {
106317 this.tolerateUnexpectedToken(this.lookahead);
106318 }
106319 expr = this.matchAsyncFunction() ? this.parseFunctionExpression() : this.finalize(node, new Node.Identifier(this.nextToken().value));
106320 break;
106321 case 6 /* NumericLiteral */:
106322 case 8 /* StringLiteral */:
106323 if (this.context.strict && this.lookahead.octal) {
106324 this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.StrictOctalLiteral);
106325 }
106326 this.context.isAssignmentTarget = false;
106327 this.context.isBindingElement = false;
106328 token = this.nextToken();
106329 raw = this.getTokenRaw(token);
106330 expr = this.finalize(node, new Node.Literal(token.value, raw));
106331 break;
106332 case 1 /* BooleanLiteral */:
106333 this.context.isAssignmentTarget = false;
106334 this.context.isBindingElement = false;
106335 token = this.nextToken();
106336 raw = this.getTokenRaw(token);
106337 expr = this.finalize(node, new Node.Literal(token.value === 'true', raw));
106338 break;
106339 case 5 /* NullLiteral */:
106340 this.context.isAssignmentTarget = false;
106341 this.context.isBindingElement = false;
106342 token = this.nextToken();
106343 raw = this.getTokenRaw(token);
106344 expr = this.finalize(node, new Node.Literal(null, raw));
106345 break;
106346 case 10 /* Template */:
106347 expr = this.parseTemplateLiteral();
106348 break;
106349 case 7 /* Punctuator */:
106350 switch (this.lookahead.value) {
106351 case '(':
106352 this.context.isBindingElement = false;
106353 expr = this.inheritCoverGrammar(this.parseGroupExpression);
106354 break;
106355 case '[':
106356 expr = this.inheritCoverGrammar(this.parseArrayInitializer);
106357 break;
106358 case '{':
106359 expr = this.inheritCoverGrammar(this.parseObjectInitializer);
106360 break;
106361 case '/':
106362 case '/=':
106363 this.context.isAssignmentTarget = false;
106364 this.context.isBindingElement = false;
106365 this.scanner.index = this.startMarker.index;
106366 token = this.nextRegexToken();
106367 raw = this.getTokenRaw(token);
106368 expr = this.finalize(node, new Node.RegexLiteral(token.regex, raw, token.pattern, token.flags));
106369 break;
106370 default:
106371 expr = this.throwUnexpectedToken(this.nextToken());
106372 }
106373 break;
106374 case 4 /* Keyword */:
106375 if (!this.context.strict && this.context.allowYield && this.matchKeyword('yield')) {
106376 expr = this.parseIdentifierName();
106377 }
106378 else if (!this.context.strict && this.matchKeyword('let')) {
106379 expr = this.finalize(node, new Node.Identifier(this.nextToken().value));
106380 }
106381 else {
106382 this.context.isAssignmentTarget = false;
106383 this.context.isBindingElement = false;
106384 if (this.matchKeyword('function')) {
106385 expr = this.parseFunctionExpression();
106386 }
106387 else if (this.matchKeyword('this')) {
106388 this.nextToken();
106389 expr = this.finalize(node, new Node.ThisExpression());
106390 }
106391 else if (this.matchKeyword('class')) {
106392 expr = this.parseClassExpression();
106393 }
106394 else {
106395 expr = this.throwUnexpectedToken(this.nextToken());
106396 }
106397 }
106398 break;
106399 default:
106400 expr = this.throwUnexpectedToken(this.nextToken());
106401 }
106402 return expr;
106403 };
106404 // https://tc39.github.io/ecma262/#sec-array-initializer
106405 Parser.prototype.parseSpreadElement = function () {
106406 var node = this.createNode();
106407 this.expect('...');
106408 var arg = this.inheritCoverGrammar(this.parseAssignmentExpression);
106409 return this.finalize(node, new Node.SpreadElement(arg));
106410 };
106411 Parser.prototype.parseArrayInitializer = function () {
106412 var node = this.createNode();
106413 var elements = [];
106414 this.expect('[');
106415 while (!this.match(']')) {
106416 if (this.match(',')) {
106417 this.nextToken();
106418 elements.push(null);
106419 }
106420 else if (this.match('...')) {
106421 var element = this.parseSpreadElement();
106422 if (!this.match(']')) {
106423 this.context.isAssignmentTarget = false;
106424 this.context.isBindingElement = false;
106425 this.expect(',');
106426 }
106427 elements.push(element);
106428 }
106429 else {
106430 elements.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
106431 if (!this.match(']')) {
106432 this.expect(',');
106433 }
106434 }
106435 }
106436 this.expect(']');
106437 return this.finalize(node, new Node.ArrayExpression(elements));
106438 };
106439 // https://tc39.github.io/ecma262/#sec-object-initializer
106440 Parser.prototype.parsePropertyMethod = function (params) {
106441 this.context.isAssignmentTarget = false;
106442 this.context.isBindingElement = false;
106443 var previousStrict = this.context.strict;
106444 var previousAllowStrictDirective = this.context.allowStrictDirective;
106445 this.context.allowStrictDirective = params.simple;
106446 var body = this.isolateCoverGrammar(this.parseFunctionSourceElements);
106447 if (this.context.strict && params.firstRestricted) {
106448 this.tolerateUnexpectedToken(params.firstRestricted, params.message);
106449 }
106450 if (this.context.strict && params.stricted) {
106451 this.tolerateUnexpectedToken(params.stricted, params.message);
106452 }
106453 this.context.strict = previousStrict;
106454 this.context.allowStrictDirective = previousAllowStrictDirective;
106455 return body;
106456 };
106457 Parser.prototype.parsePropertyMethodFunction = function () {
106458 var isGenerator = false;
106459 var node = this.createNode();
106460 var previousAllowYield = this.context.allowYield;
106461 this.context.allowYield = true;
106462 var params = this.parseFormalParameters();
106463 var method = this.parsePropertyMethod(params);
106464 this.context.allowYield = previousAllowYield;
106465 return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
106466 };
106467 Parser.prototype.parsePropertyMethodAsyncFunction = function () {
106468 var node = this.createNode();
106469 var previousAllowYield = this.context.allowYield;
106470 var previousAwait = this.context.await;
106471 this.context.allowYield = false;
106472 this.context.await = true;
106473 var params = this.parseFormalParameters();
106474 var method = this.parsePropertyMethod(params);
106475 this.context.allowYield = previousAllowYield;
106476 this.context.await = previousAwait;
106477 return this.finalize(node, new Node.AsyncFunctionExpression(null, params.params, method));
106478 };
106479 Parser.prototype.parseObjectPropertyKey = function () {
106480 var node = this.createNode();
106481 var token = this.nextToken();
106482 var key;
106483 switch (token.type) {
106484 case 8 /* StringLiteral */:
106485 case 6 /* NumericLiteral */:
106486 if (this.context.strict && token.octal) {
106487 this.tolerateUnexpectedToken(token, messages_1.Messages.StrictOctalLiteral);
106488 }
106489 var raw = this.getTokenRaw(token);
106490 key = this.finalize(node, new Node.Literal(token.value, raw));
106491 break;
106492 case 3 /* Identifier */:
106493 case 1 /* BooleanLiteral */:
106494 case 5 /* NullLiteral */:
106495 case 4 /* Keyword */:
106496 key = this.finalize(node, new Node.Identifier(token.value));
106497 break;
106498 case 7 /* Punctuator */:
106499 if (token.value === '[') {
106500 key = this.isolateCoverGrammar(this.parseAssignmentExpression);
106501 this.expect(']');
106502 }
106503 else {
106504 key = this.throwUnexpectedToken(token);
106505 }
106506 break;
106507 default:
106508 key = this.throwUnexpectedToken(token);
106509 }
106510 return key;
106511 };
106512 Parser.prototype.isPropertyKey = function (key, value) {
106513 return (key.type === syntax_1.Syntax.Identifier && key.name === value) ||
106514 (key.type === syntax_1.Syntax.Literal && key.value === value);
106515 };
106516 Parser.prototype.parseObjectProperty = function (hasProto) {
106517 var node = this.createNode();
106518 var token = this.lookahead;
106519 var kind;
106520 var key = null;
106521 var value = null;
106522 var computed = false;
106523 var method = false;
106524 var shorthand = false;
106525 var isAsync = false;
106526 if (token.type === 3 /* Identifier */) {
106527 var id = token.value;
106528 this.nextToken();
106529 computed = this.match('[');
106530 isAsync = !this.hasLineTerminator && (id === 'async') &&
106531 !this.match(':') && !this.match('(') && !this.match('*') && !this.match(',');
106532 key = isAsync ? this.parseObjectPropertyKey() : this.finalize(node, new Node.Identifier(id));
106533 }
106534 else if (this.match('*')) {
106535 this.nextToken();
106536 }
106537 else {
106538 computed = this.match('[');
106539 key = this.parseObjectPropertyKey();
106540 }
106541 var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
106542 if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'get' && lookaheadPropertyKey) {
106543 kind = 'get';
106544 computed = this.match('[');
106545 key = this.parseObjectPropertyKey();
106546 this.context.allowYield = false;
106547 value = this.parseGetterMethod();
106548 }
106549 else if (token.type === 3 /* Identifier */ && !isAsync && token.value === 'set' && lookaheadPropertyKey) {
106550 kind = 'set';
106551 computed = this.match('[');
106552 key = this.parseObjectPropertyKey();
106553 value = this.parseSetterMethod();
106554 }
106555 else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) {
106556 kind = 'init';
106557 computed = this.match('[');
106558 key = this.parseObjectPropertyKey();
106559 value = this.parseGeneratorMethod();
106560 method = true;
106561 }
106562 else {
106563 if (!key) {
106564 this.throwUnexpectedToken(this.lookahead);
106565 }
106566 kind = 'init';
106567 if (this.match(':') && !isAsync) {
106568 if (!computed && this.isPropertyKey(key, '__proto__')) {
106569 if (hasProto.value) {
106570 this.tolerateError(messages_1.Messages.DuplicateProtoProperty);
106571 }
106572 hasProto.value = true;
106573 }
106574 this.nextToken();
106575 value = this.inheritCoverGrammar(this.parseAssignmentExpression);
106576 }
106577 else if (this.match('(')) {
106578 value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
106579 method = true;
106580 }
106581 else if (token.type === 3 /* Identifier */) {
106582 var id = this.finalize(node, new Node.Identifier(token.value));
106583 if (this.match('=')) {
106584 this.context.firstCoverInitializedNameError = this.lookahead;
106585 this.nextToken();
106586 shorthand = true;
106587 var init = this.isolateCoverGrammar(this.parseAssignmentExpression);
106588 value = this.finalize(node, new Node.AssignmentPattern(id, init));
106589 }
106590 else {
106591 shorthand = true;
106592 value = id;
106593 }
106594 }
106595 else {
106596 this.throwUnexpectedToken(this.nextToken());
106597 }
106598 }
106599 return this.finalize(node, new Node.Property(kind, key, computed, value, method, shorthand));
106600 };
106601 Parser.prototype.parseObjectInitializer = function () {
106602 var node = this.createNode();
106603 this.expect('{');
106604 var properties = [];
106605 var hasProto = { value: false };
106606 while (!this.match('}')) {
106607 properties.push(this.parseObjectProperty(hasProto));
106608 if (!this.match('}')) {
106609 this.expectCommaSeparator();
106610 }
106611 }
106612 this.expect('}');
106613 return this.finalize(node, new Node.ObjectExpression(properties));
106614 };
106615 // https://tc39.github.io/ecma262/#sec-template-literals
106616 Parser.prototype.parseTemplateHead = function () {
106617 assert_1.assert(this.lookahead.head, 'Template literal must start with a template head');
106618 var node = this.createNode();
106619 var token = this.nextToken();
106620 var raw = token.value;
106621 var cooked = token.cooked;
106622 return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail));
106623 };
106624 Parser.prototype.parseTemplateElement = function () {
106625 if (this.lookahead.type !== 10 /* Template */) {
106626 this.throwUnexpectedToken();
106627 }
106628 var node = this.createNode();
106629 var token = this.nextToken();
106630 var raw = token.value;
106631 var cooked = token.cooked;
106632 return this.finalize(node, new Node.TemplateElement({ raw: raw, cooked: cooked }, token.tail));
106633 };
106634 Parser.prototype.parseTemplateLiteral = function () {
106635 var node = this.createNode();
106636 var expressions = [];
106637 var quasis = [];
106638 var quasi = this.parseTemplateHead();
106639 quasis.push(quasi);
106640 while (!quasi.tail) {
106641 expressions.push(this.parseExpression());
106642 quasi = this.parseTemplateElement();
106643 quasis.push(quasi);
106644 }
106645 return this.finalize(node, new Node.TemplateLiteral(quasis, expressions));
106646 };
106647 // https://tc39.github.io/ecma262/#sec-grouping-operator
106648 Parser.prototype.reinterpretExpressionAsPattern = function (expr) {
106649 switch (expr.type) {
106650 case syntax_1.Syntax.Identifier:
106651 case syntax_1.Syntax.MemberExpression:
106652 case syntax_1.Syntax.RestElement:
106653 case syntax_1.Syntax.AssignmentPattern:
106654 break;
106655 case syntax_1.Syntax.SpreadElement:
106656 expr.type = syntax_1.Syntax.RestElement;
106657 this.reinterpretExpressionAsPattern(expr.argument);
106658 break;
106659 case syntax_1.Syntax.ArrayExpression:
106660 expr.type = syntax_1.Syntax.ArrayPattern;
106661 for (var i = 0; i < expr.elements.length; i++) {
106662 if (expr.elements[i] !== null) {
106663 this.reinterpretExpressionAsPattern(expr.elements[i]);
106664 }
106665 }
106666 break;
106667 case syntax_1.Syntax.ObjectExpression:
106668 expr.type = syntax_1.Syntax.ObjectPattern;
106669 for (var i = 0; i < expr.properties.length; i++) {
106670 this.reinterpretExpressionAsPattern(expr.properties[i].value);
106671 }
106672 break;
106673 case syntax_1.Syntax.AssignmentExpression:
106674 expr.type = syntax_1.Syntax.AssignmentPattern;
106675 delete expr.operator;
106676 this.reinterpretExpressionAsPattern(expr.left);
106677 break;
106678 default:
106679 // Allow other node type for tolerant parsing.
106680 break;
106681 }
106682 };
106683 Parser.prototype.parseGroupExpression = function () {
106684 var expr;
106685 this.expect('(');
106686 if (this.match(')')) {
106687 this.nextToken();
106688 if (!this.match('=>')) {
106689 this.expect('=>');
106690 }
106691 expr = {
106692 type: ArrowParameterPlaceHolder,
106693 params: [],
106694 async: false
106695 };
106696 }
106697 else {
106698 var startToken = this.lookahead;
106699 var params = [];
106700 if (this.match('...')) {
106701 expr = this.parseRestElement(params);
106702 this.expect(')');
106703 if (!this.match('=>')) {
106704 this.expect('=>');
106705 }
106706 expr = {
106707 type: ArrowParameterPlaceHolder,
106708 params: [expr],
106709 async: false
106710 };
106711 }
106712 else {
106713 var arrow = false;
106714 this.context.isBindingElement = true;
106715 expr = this.inheritCoverGrammar(this.parseAssignmentExpression);
106716 if (this.match(',')) {
106717 var expressions = [];
106718 this.context.isAssignmentTarget = false;
106719 expressions.push(expr);
106720 while (this.lookahead.type !== 2 /* EOF */) {
106721 if (!this.match(',')) {
106722 break;
106723 }
106724 this.nextToken();
106725 if (this.match(')')) {
106726 this.nextToken();
106727 for (var i = 0; i < expressions.length; i++) {
106728 this.reinterpretExpressionAsPattern(expressions[i]);
106729 }
106730 arrow = true;
106731 expr = {
106732 type: ArrowParameterPlaceHolder,
106733 params: expressions,
106734 async: false
106735 };
106736 }
106737 else if (this.match('...')) {
106738 if (!this.context.isBindingElement) {
106739 this.throwUnexpectedToken(this.lookahead);
106740 }
106741 expressions.push(this.parseRestElement(params));
106742 this.expect(')');
106743 if (!this.match('=>')) {
106744 this.expect('=>');
106745 }
106746 this.context.isBindingElement = false;
106747 for (var i = 0; i < expressions.length; i++) {
106748 this.reinterpretExpressionAsPattern(expressions[i]);
106749 }
106750 arrow = true;
106751 expr = {
106752 type: ArrowParameterPlaceHolder,
106753 params: expressions,
106754 async: false
106755 };
106756 }
106757 else {
106758 expressions.push(this.inheritCoverGrammar(this.parseAssignmentExpression));
106759 }
106760 if (arrow) {
106761 break;
106762 }
106763 }
106764 if (!arrow) {
106765 expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions));
106766 }
106767 }
106768 if (!arrow) {
106769 this.expect(')');
106770 if (this.match('=>')) {
106771 if (expr.type === syntax_1.Syntax.Identifier && expr.name === 'yield') {
106772 arrow = true;
106773 expr = {
106774 type: ArrowParameterPlaceHolder,
106775 params: [expr],
106776 async: false
106777 };
106778 }
106779 if (!arrow) {
106780 if (!this.context.isBindingElement) {
106781 this.throwUnexpectedToken(this.lookahead);
106782 }
106783 if (expr.type === syntax_1.Syntax.SequenceExpression) {
106784 for (var i = 0; i < expr.expressions.length; i++) {
106785 this.reinterpretExpressionAsPattern(expr.expressions[i]);
106786 }
106787 }
106788 else {
106789 this.reinterpretExpressionAsPattern(expr);
106790 }
106791 var parameters = (expr.type === syntax_1.Syntax.SequenceExpression ? expr.expressions : [expr]);
106792 expr = {
106793 type: ArrowParameterPlaceHolder,
106794 params: parameters,
106795 async: false
106796 };
106797 }
106798 }
106799 this.context.isBindingElement = false;
106800 }
106801 }
106802 }
106803 return expr;
106804 };
106805 // https://tc39.github.io/ecma262/#sec-left-hand-side-expressions
106806 Parser.prototype.parseArguments = function () {
106807 this.expect('(');
106808 var args = [];
106809 if (!this.match(')')) {
106810 while (true) {
106811 var expr = this.match('...') ? this.parseSpreadElement() :
106812 this.isolateCoverGrammar(this.parseAssignmentExpression);
106813 args.push(expr);
106814 if (this.match(')')) {
106815 break;
106816 }
106817 this.expectCommaSeparator();
106818 if (this.match(')')) {
106819 break;
106820 }
106821 }
106822 }
106823 this.expect(')');
106824 return args;
106825 };
106826 Parser.prototype.isIdentifierName = function (token) {
106827 return token.type === 3 /* Identifier */ ||
106828 token.type === 4 /* Keyword */ ||
106829 token.type === 1 /* BooleanLiteral */ ||
106830 token.type === 5 /* NullLiteral */;
106831 };
106832 Parser.prototype.parseIdentifierName = function () {
106833 var node = this.createNode();
106834 var token = this.nextToken();
106835 if (!this.isIdentifierName(token)) {
106836 this.throwUnexpectedToken(token);
106837 }
106838 return this.finalize(node, new Node.Identifier(token.value));
106839 };
106840 Parser.prototype.parseNewExpression = function () {
106841 var node = this.createNode();
106842 var id = this.parseIdentifierName();
106843 assert_1.assert(id.name === 'new', 'New expression must start with `new`');
106844 var expr;
106845 if (this.match('.')) {
106846 this.nextToken();
106847 if (this.lookahead.type === 3 /* Identifier */ && this.context.inFunctionBody && this.lookahead.value === 'target') {
106848 var property = this.parseIdentifierName();
106849 expr = new Node.MetaProperty(id, property);
106850 }
106851 else {
106852 this.throwUnexpectedToken(this.lookahead);
106853 }
106854 }
106855 else {
106856 var callee = this.isolateCoverGrammar(this.parseLeftHandSideExpression);
106857 var args = this.match('(') ? this.parseArguments() : [];
106858 expr = new Node.NewExpression(callee, args);
106859 this.context.isAssignmentTarget = false;
106860 this.context.isBindingElement = false;
106861 }
106862 return this.finalize(node, expr);
106863 };
106864 Parser.prototype.parseAsyncArgument = function () {
106865 var arg = this.parseAssignmentExpression();
106866 this.context.firstCoverInitializedNameError = null;
106867 return arg;
106868 };
106869 Parser.prototype.parseAsyncArguments = function () {
106870 this.expect('(');
106871 var args = [];
106872 if (!this.match(')')) {
106873 while (true) {
106874 var expr = this.match('...') ? this.parseSpreadElement() :
106875 this.isolateCoverGrammar(this.parseAsyncArgument);
106876 args.push(expr);
106877 if (this.match(')')) {
106878 break;
106879 }
106880 this.expectCommaSeparator();
106881 if (this.match(')')) {
106882 break;
106883 }
106884 }
106885 }
106886 this.expect(')');
106887 return args;
106888 };
106889 Parser.prototype.parseLeftHandSideExpressionAllowCall = function () {
106890 var startToken = this.lookahead;
106891 var maybeAsync = this.matchContextualKeyword('async');
106892 var previousAllowIn = this.context.allowIn;
106893 this.context.allowIn = true;
106894 var expr;
106895 if (this.matchKeyword('super') && this.context.inFunctionBody) {
106896 expr = this.createNode();
106897 this.nextToken();
106898 expr = this.finalize(expr, new Node.Super());
106899 if (!this.match('(') && !this.match('.') && !this.match('[')) {
106900 this.throwUnexpectedToken(this.lookahead);
106901 }
106902 }
106903 else {
106904 expr = this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression);
106905 }
106906 while (true) {
106907 if (this.match('.')) {
106908 this.context.isBindingElement = false;
106909 this.context.isAssignmentTarget = true;
106910 this.expect('.');
106911 var property = this.parseIdentifierName();
106912 expr = this.finalize(this.startNode(startToken), new Node.StaticMemberExpression(expr, property));
106913 }
106914 else if (this.match('(')) {
106915 var asyncArrow = maybeAsync && (startToken.lineNumber === this.lookahead.lineNumber);
106916 this.context.isBindingElement = false;
106917 this.context.isAssignmentTarget = false;
106918 var args = asyncArrow ? this.parseAsyncArguments() : this.parseArguments();
106919 expr = this.finalize(this.startNode(startToken), new Node.CallExpression(expr, args));
106920 if (asyncArrow && this.match('=>')) {
106921 for (var i = 0; i < args.length; ++i) {
106922 this.reinterpretExpressionAsPattern(args[i]);
106923 }
106924 expr = {
106925 type: ArrowParameterPlaceHolder,
106926 params: args,
106927 async: true
106928 };
106929 }
106930 }
106931 else if (this.match('[')) {
106932 this.context.isBindingElement = false;
106933 this.context.isAssignmentTarget = true;
106934 this.expect('[');
106935 var property = this.isolateCoverGrammar(this.parseExpression);
106936 this.expect(']');
106937 expr = this.finalize(this.startNode(startToken), new Node.ComputedMemberExpression(expr, property));
106938 }
106939 else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) {
106940 var quasi = this.parseTemplateLiteral();
106941 expr = this.finalize(this.startNode(startToken), new Node.TaggedTemplateExpression(expr, quasi));
106942 }
106943 else {
106944 break;
106945 }
106946 }
106947 this.context.allowIn = previousAllowIn;
106948 return expr;
106949 };
106950 Parser.prototype.parseSuper = function () {
106951 var node = this.createNode();
106952 this.expectKeyword('super');
106953 if (!this.match('[') && !this.match('.')) {
106954 this.throwUnexpectedToken(this.lookahead);
106955 }
106956 return this.finalize(node, new Node.Super());
106957 };
106958 Parser.prototype.parseLeftHandSideExpression = function () {
106959 assert_1.assert(this.context.allowIn, 'callee of new expression always allow in keyword.');
106960 var node = this.startNode(this.lookahead);
106961 var expr = (this.matchKeyword('super') && this.context.inFunctionBody) ? this.parseSuper() :
106962 this.inheritCoverGrammar(this.matchKeyword('new') ? this.parseNewExpression : this.parsePrimaryExpression);
106963 while (true) {
106964 if (this.match('[')) {
106965 this.context.isBindingElement = false;
106966 this.context.isAssignmentTarget = true;
106967 this.expect('[');
106968 var property = this.isolateCoverGrammar(this.parseExpression);
106969 this.expect(']');
106970 expr = this.finalize(node, new Node.ComputedMemberExpression(expr, property));
106971 }
106972 else if (this.match('.')) {
106973 this.context.isBindingElement = false;
106974 this.context.isAssignmentTarget = true;
106975 this.expect('.');
106976 var property = this.parseIdentifierName();
106977 expr = this.finalize(node, new Node.StaticMemberExpression(expr, property));
106978 }
106979 else if (this.lookahead.type === 10 /* Template */ && this.lookahead.head) {
106980 var quasi = this.parseTemplateLiteral();
106981 expr = this.finalize(node, new Node.TaggedTemplateExpression(expr, quasi));
106982 }
106983 else {
106984 break;
106985 }
106986 }
106987 return expr;
106988 };
106989 // https://tc39.github.io/ecma262/#sec-update-expressions
106990 Parser.prototype.parseUpdateExpression = function () {
106991 var expr;
106992 var startToken = this.lookahead;
106993 if (this.match('++') || this.match('--')) {
106994 var node = this.startNode(startToken);
106995 var token = this.nextToken();
106996 expr = this.inheritCoverGrammar(this.parseUnaryExpression);
106997 if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) {
106998 this.tolerateError(messages_1.Messages.StrictLHSPrefix);
106999 }
107000 if (!this.context.isAssignmentTarget) {
107001 this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
107002 }
107003 var prefix = true;
107004 expr = this.finalize(node, new Node.UpdateExpression(token.value, expr, prefix));
107005 this.context.isAssignmentTarget = false;
107006 this.context.isBindingElement = false;
107007 }
107008 else {
107009 expr = this.inheritCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
107010 if (!this.hasLineTerminator && this.lookahead.type === 7 /* Punctuator */) {
107011 if (this.match('++') || this.match('--')) {
107012 if (this.context.strict && expr.type === syntax_1.Syntax.Identifier && this.scanner.isRestrictedWord(expr.name)) {
107013 this.tolerateError(messages_1.Messages.StrictLHSPostfix);
107014 }
107015 if (!this.context.isAssignmentTarget) {
107016 this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
107017 }
107018 this.context.isAssignmentTarget = false;
107019 this.context.isBindingElement = false;
107020 var operator = this.nextToken().value;
107021 var prefix = false;
107022 expr = this.finalize(this.startNode(startToken), new Node.UpdateExpression(operator, expr, prefix));
107023 }
107024 }
107025 }
107026 return expr;
107027 };
107028 // https://tc39.github.io/ecma262/#sec-unary-operators
107029 Parser.prototype.parseAwaitExpression = function () {
107030 var node = this.createNode();
107031 this.nextToken();
107032 var argument = this.parseUnaryExpression();
107033 return this.finalize(node, new Node.AwaitExpression(argument));
107034 };
107035 Parser.prototype.parseUnaryExpression = function () {
107036 var expr;
107037 if (this.match('+') || this.match('-') || this.match('~') || this.match('!') ||
107038 this.matchKeyword('delete') || this.matchKeyword('void') || this.matchKeyword('typeof')) {
107039 var node = this.startNode(this.lookahead);
107040 var token = this.nextToken();
107041 expr = this.inheritCoverGrammar(this.parseUnaryExpression);
107042 expr = this.finalize(node, new Node.UnaryExpression(token.value, expr));
107043 if (this.context.strict && expr.operator === 'delete' && expr.argument.type === syntax_1.Syntax.Identifier) {
107044 this.tolerateError(messages_1.Messages.StrictDelete);
107045 }
107046 this.context.isAssignmentTarget = false;
107047 this.context.isBindingElement = false;
107048 }
107049 else if (this.context.await && this.matchContextualKeyword('await')) {
107050 expr = this.parseAwaitExpression();
107051 }
107052 else {
107053 expr = this.parseUpdateExpression();
107054 }
107055 return expr;
107056 };
107057 Parser.prototype.parseExponentiationExpression = function () {
107058 var startToken = this.lookahead;
107059 var expr = this.inheritCoverGrammar(this.parseUnaryExpression);
107060 if (expr.type !== syntax_1.Syntax.UnaryExpression && this.match('**')) {
107061 this.nextToken();
107062 this.context.isAssignmentTarget = false;
107063 this.context.isBindingElement = false;
107064 var left = expr;
107065 var right = this.isolateCoverGrammar(this.parseExponentiationExpression);
107066 expr = this.finalize(this.startNode(startToken), new Node.BinaryExpression('**', left, right));
107067 }
107068 return expr;
107069 };
107070 // https://tc39.github.io/ecma262/#sec-exp-operator
107071 // https://tc39.github.io/ecma262/#sec-multiplicative-operators
107072 // https://tc39.github.io/ecma262/#sec-additive-operators
107073 // https://tc39.github.io/ecma262/#sec-bitwise-shift-operators
107074 // https://tc39.github.io/ecma262/#sec-relational-operators
107075 // https://tc39.github.io/ecma262/#sec-equality-operators
107076 // https://tc39.github.io/ecma262/#sec-binary-bitwise-operators
107077 // https://tc39.github.io/ecma262/#sec-binary-logical-operators
107078 Parser.prototype.binaryPrecedence = function (token) {
107079 var op = token.value;
107080 var precedence;
107081 if (token.type === 7 /* Punctuator */) {
107082 precedence = this.operatorPrecedence[op] || 0;
107083 }
107084 else if (token.type === 4 /* Keyword */) {
107085 precedence = (op === 'instanceof' || (this.context.allowIn && op === 'in')) ? 7 : 0;
107086 }
107087 else {
107088 precedence = 0;
107089 }
107090 return precedence;
107091 };
107092 Parser.prototype.parseBinaryExpression = function () {
107093 var startToken = this.lookahead;
107094 var expr = this.inheritCoverGrammar(this.parseExponentiationExpression);
107095 var token = this.lookahead;
107096 var prec = this.binaryPrecedence(token);
107097 if (prec > 0) {
107098 this.nextToken();
107099 this.context.isAssignmentTarget = false;
107100 this.context.isBindingElement = false;
107101 var markers = [startToken, this.lookahead];
107102 var left = expr;
107103 var right = this.isolateCoverGrammar(this.parseExponentiationExpression);
107104 var stack = [left, token.value, right];
107105 var precedences = [prec];
107106 while (true) {
107107 prec = this.binaryPrecedence(this.lookahead);
107108 if (prec <= 0) {
107109 break;
107110 }
107111 // Reduce: make a binary expression from the three topmost entries.
107112 while ((stack.length > 2) && (prec <= precedences[precedences.length - 1])) {
107113 right = stack.pop();
107114 var operator = stack.pop();
107115 precedences.pop();
107116 left = stack.pop();
107117 markers.pop();
107118 var node = this.startNode(markers[markers.length - 1]);
107119 stack.push(this.finalize(node, new Node.BinaryExpression(operator, left, right)));
107120 }
107121 // Shift.
107122 stack.push(this.nextToken().value);
107123 precedences.push(prec);
107124 markers.push(this.lookahead);
107125 stack.push(this.isolateCoverGrammar(this.parseExponentiationExpression));
107126 }
107127 // Final reduce to clean-up the stack.
107128 var i = stack.length - 1;
107129 expr = stack[i];
107130 var lastMarker = markers.pop();
107131 while (i > 1) {
107132 var marker = markers.pop();
107133 var lastLineStart = lastMarker && lastMarker.lineStart;
107134 var node = this.startNode(marker, lastLineStart);
107135 var operator = stack[i - 1];
107136 expr = this.finalize(node, new Node.BinaryExpression(operator, stack[i - 2], expr));
107137 i -= 2;
107138 lastMarker = marker;
107139 }
107140 }
107141 return expr;
107142 };
107143 // https://tc39.github.io/ecma262/#sec-conditional-operator
107144 Parser.prototype.parseConditionalExpression = function () {
107145 var startToken = this.lookahead;
107146 var expr = this.inheritCoverGrammar(this.parseBinaryExpression);
107147 if (this.match('?')) {
107148 this.nextToken();
107149 var previousAllowIn = this.context.allowIn;
107150 this.context.allowIn = true;
107151 var consequent = this.isolateCoverGrammar(this.parseAssignmentExpression);
107152 this.context.allowIn = previousAllowIn;
107153 this.expect(':');
107154 var alternate = this.isolateCoverGrammar(this.parseAssignmentExpression);
107155 expr = this.finalize(this.startNode(startToken), new Node.ConditionalExpression(expr, consequent, alternate));
107156 this.context.isAssignmentTarget = false;
107157 this.context.isBindingElement = false;
107158 }
107159 return expr;
107160 };
107161 // https://tc39.github.io/ecma262/#sec-assignment-operators
107162 Parser.prototype.checkPatternParam = function (options, param) {
107163 switch (param.type) {
107164 case syntax_1.Syntax.Identifier:
107165 this.validateParam(options, param, param.name);
107166 break;
107167 case syntax_1.Syntax.RestElement:
107168 this.checkPatternParam(options, param.argument);
107169 break;
107170 case syntax_1.Syntax.AssignmentPattern:
107171 this.checkPatternParam(options, param.left);
107172 break;
107173 case syntax_1.Syntax.ArrayPattern:
107174 for (var i = 0; i < param.elements.length; i++) {
107175 if (param.elements[i] !== null) {
107176 this.checkPatternParam(options, param.elements[i]);
107177 }
107178 }
107179 break;
107180 case syntax_1.Syntax.ObjectPattern:
107181 for (var i = 0; i < param.properties.length; i++) {
107182 this.checkPatternParam(options, param.properties[i].value);
107183 }
107184 break;
107185 default:
107186 break;
107187 }
107188 options.simple = options.simple && (param instanceof Node.Identifier);
107189 };
107190 Parser.prototype.reinterpretAsCoverFormalsList = function (expr) {
107191 var params = [expr];
107192 var options;
107193 var asyncArrow = false;
107194 switch (expr.type) {
107195 case syntax_1.Syntax.Identifier:
107196 break;
107197 case ArrowParameterPlaceHolder:
107198 params = expr.params;
107199 asyncArrow = expr.async;
107200 break;
107201 default:
107202 return null;
107203 }
107204 options = {
107205 simple: true,
107206 paramSet: {}
107207 };
107208 for (var i = 0; i < params.length; ++i) {
107209 var param = params[i];
107210 if (param.type === syntax_1.Syntax.AssignmentPattern) {
107211 if (param.right.type === syntax_1.Syntax.YieldExpression) {
107212 if (param.right.argument) {
107213 this.throwUnexpectedToken(this.lookahead);
107214 }
107215 param.right.type = syntax_1.Syntax.Identifier;
107216 param.right.name = 'yield';
107217 delete param.right.argument;
107218 delete param.right.delegate;
107219 }
107220 }
107221 else if (asyncArrow && param.type === syntax_1.Syntax.Identifier && param.name === 'await') {
107222 this.throwUnexpectedToken(this.lookahead);
107223 }
107224 this.checkPatternParam(options, param);
107225 params[i] = param;
107226 }
107227 if (this.context.strict || !this.context.allowYield) {
107228 for (var i = 0; i < params.length; ++i) {
107229 var param = params[i];
107230 if (param.type === syntax_1.Syntax.YieldExpression) {
107231 this.throwUnexpectedToken(this.lookahead);
107232 }
107233 }
107234 }
107235 if (options.message === messages_1.Messages.StrictParamDupe) {
107236 var token = this.context.strict ? options.stricted : options.firstRestricted;
107237 this.throwUnexpectedToken(token, options.message);
107238 }
107239 return {
107240 simple: options.simple,
107241 params: params,
107242 stricted: options.stricted,
107243 firstRestricted: options.firstRestricted,
107244 message: options.message
107245 };
107246 };
107247 Parser.prototype.parseAssignmentExpression = function () {
107248 var expr;
107249 if (!this.context.allowYield && this.matchKeyword('yield')) {
107250 expr = this.parseYieldExpression();
107251 }
107252 else {
107253 var startToken = this.lookahead;
107254 var token = startToken;
107255 expr = this.parseConditionalExpression();
107256 if (token.type === 3 /* Identifier */ && (token.lineNumber === this.lookahead.lineNumber) && token.value === 'async') {
107257 if (this.lookahead.type === 3 /* Identifier */ || this.matchKeyword('yield')) {
107258 var arg = this.parsePrimaryExpression();
107259 this.reinterpretExpressionAsPattern(arg);
107260 expr = {
107261 type: ArrowParameterPlaceHolder,
107262 params: [arg],
107263 async: true
107264 };
107265 }
107266 }
107267 if (expr.type === ArrowParameterPlaceHolder || this.match('=>')) {
107268 // https://tc39.github.io/ecma262/#sec-arrow-function-definitions
107269 this.context.isAssignmentTarget = false;
107270 this.context.isBindingElement = false;
107271 var isAsync = expr.async;
107272 var list = this.reinterpretAsCoverFormalsList(expr);
107273 if (list) {
107274 if (this.hasLineTerminator) {
107275 this.tolerateUnexpectedToken(this.lookahead);
107276 }
107277 this.context.firstCoverInitializedNameError = null;
107278 var previousStrict = this.context.strict;
107279 var previousAllowStrictDirective = this.context.allowStrictDirective;
107280 this.context.allowStrictDirective = list.simple;
107281 var previousAllowYield = this.context.allowYield;
107282 var previousAwait = this.context.await;
107283 this.context.allowYield = true;
107284 this.context.await = isAsync;
107285 var node = this.startNode(startToken);
107286 this.expect('=>');
107287 var body = void 0;
107288 if (this.match('{')) {
107289 var previousAllowIn = this.context.allowIn;
107290 this.context.allowIn = true;
107291 body = this.parseFunctionSourceElements();
107292 this.context.allowIn = previousAllowIn;
107293 }
107294 else {
107295 body = this.isolateCoverGrammar(this.parseAssignmentExpression);
107296 }
107297 var expression = body.type !== syntax_1.Syntax.BlockStatement;
107298 if (this.context.strict && list.firstRestricted) {
107299 this.throwUnexpectedToken(list.firstRestricted, list.message);
107300 }
107301 if (this.context.strict && list.stricted) {
107302 this.tolerateUnexpectedToken(list.stricted, list.message);
107303 }
107304 expr = isAsync ? this.finalize(node, new Node.AsyncArrowFunctionExpression(list.params, body, expression)) :
107305 this.finalize(node, new Node.ArrowFunctionExpression(list.params, body, expression));
107306 this.context.strict = previousStrict;
107307 this.context.allowStrictDirective = previousAllowStrictDirective;
107308 this.context.allowYield = previousAllowYield;
107309 this.context.await = previousAwait;
107310 }
107311 }
107312 else {
107313 if (this.matchAssign()) {
107314 if (!this.context.isAssignmentTarget) {
107315 this.tolerateError(messages_1.Messages.InvalidLHSInAssignment);
107316 }
107317 if (this.context.strict && expr.type === syntax_1.Syntax.Identifier) {
107318 var id = expr;
107319 if (this.scanner.isRestrictedWord(id.name)) {
107320 this.tolerateUnexpectedToken(token, messages_1.Messages.StrictLHSAssignment);
107321 }
107322 if (this.scanner.isStrictModeReservedWord(id.name)) {
107323 this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
107324 }
107325 }
107326 if (!this.match('=')) {
107327 this.context.isAssignmentTarget = false;
107328 this.context.isBindingElement = false;
107329 }
107330 else {
107331 this.reinterpretExpressionAsPattern(expr);
107332 }
107333 token = this.nextToken();
107334 var operator = token.value;
107335 var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
107336 expr = this.finalize(this.startNode(startToken), new Node.AssignmentExpression(operator, expr, right));
107337 this.context.firstCoverInitializedNameError = null;
107338 }
107339 }
107340 }
107341 return expr;
107342 };
107343 // https://tc39.github.io/ecma262/#sec-comma-operator
107344 Parser.prototype.parseExpression = function () {
107345 var startToken = this.lookahead;
107346 var expr = this.isolateCoverGrammar(this.parseAssignmentExpression);
107347 if (this.match(',')) {
107348 var expressions = [];
107349 expressions.push(expr);
107350 while (this.lookahead.type !== 2 /* EOF */) {
107351 if (!this.match(',')) {
107352 break;
107353 }
107354 this.nextToken();
107355 expressions.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
107356 }
107357 expr = this.finalize(this.startNode(startToken), new Node.SequenceExpression(expressions));
107358 }
107359 return expr;
107360 };
107361 // https://tc39.github.io/ecma262/#sec-block
107362 Parser.prototype.parseStatementListItem = function () {
107363 var statement;
107364 this.context.isAssignmentTarget = true;
107365 this.context.isBindingElement = true;
107366 if (this.lookahead.type === 4 /* Keyword */) {
107367 switch (this.lookahead.value) {
107368 case 'export':
107369 if (!this.context.isModule) {
107370 this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalExportDeclaration);
107371 }
107372 statement = this.parseExportDeclaration();
107373 break;
107374 case 'import':
107375 if (!this.context.isModule) {
107376 this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.IllegalImportDeclaration);
107377 }
107378 statement = this.parseImportDeclaration();
107379 break;
107380 case 'const':
107381 statement = this.parseLexicalDeclaration({ inFor: false });
107382 break;
107383 case 'function':
107384 statement = this.parseFunctionDeclaration();
107385 break;
107386 case 'class':
107387 statement = this.parseClassDeclaration();
107388 break;
107389 case 'let':
107390 statement = this.isLexicalDeclaration() ? this.parseLexicalDeclaration({ inFor: false }) : this.parseStatement();
107391 break;
107392 default:
107393 statement = this.parseStatement();
107394 break;
107395 }
107396 }
107397 else {
107398 statement = this.parseStatement();
107399 }
107400 return statement;
107401 };
107402 Parser.prototype.parseBlock = function () {
107403 var node = this.createNode();
107404 this.expect('{');
107405 var block = [];
107406 while (true) {
107407 if (this.match('}')) {
107408 break;
107409 }
107410 block.push(this.parseStatementListItem());
107411 }
107412 this.expect('}');
107413 return this.finalize(node, new Node.BlockStatement(block));
107414 };
107415 // https://tc39.github.io/ecma262/#sec-let-and-const-declarations
107416 Parser.prototype.parseLexicalBinding = function (kind, options) {
107417 var node = this.createNode();
107418 var params = [];
107419 var id = this.parsePattern(params, kind);
107420 if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
107421 if (this.scanner.isRestrictedWord(id.name)) {
107422 this.tolerateError(messages_1.Messages.StrictVarName);
107423 }
107424 }
107425 var init = null;
107426 if (kind === 'const') {
107427 if (!this.matchKeyword('in') && !this.matchContextualKeyword('of')) {
107428 if (this.match('=')) {
107429 this.nextToken();
107430 init = this.isolateCoverGrammar(this.parseAssignmentExpression);
107431 }
107432 else {
107433 this.throwError(messages_1.Messages.DeclarationMissingInitializer, 'const');
107434 }
107435 }
107436 }
107437 else if ((!options.inFor && id.type !== syntax_1.Syntax.Identifier) || this.match('=')) {
107438 this.expect('=');
107439 init = this.isolateCoverGrammar(this.parseAssignmentExpression);
107440 }
107441 return this.finalize(node, new Node.VariableDeclarator(id, init));
107442 };
107443 Parser.prototype.parseBindingList = function (kind, options) {
107444 var list = [this.parseLexicalBinding(kind, options)];
107445 while (this.match(',')) {
107446 this.nextToken();
107447 list.push(this.parseLexicalBinding(kind, options));
107448 }
107449 return list;
107450 };
107451 Parser.prototype.isLexicalDeclaration = function () {
107452 var state = this.scanner.saveState();
107453 this.scanner.scanComments();
107454 var next = this.scanner.lex();
107455 this.scanner.restoreState(state);
107456 return (next.type === 3 /* Identifier */) ||
107457 (next.type === 7 /* Punctuator */ && next.value === '[') ||
107458 (next.type === 7 /* Punctuator */ && next.value === '{') ||
107459 (next.type === 4 /* Keyword */ && next.value === 'let') ||
107460 (next.type === 4 /* Keyword */ && next.value === 'yield');
107461 };
107462 Parser.prototype.parseLexicalDeclaration = function (options) {
107463 var node = this.createNode();
107464 var kind = this.nextToken().value;
107465 assert_1.assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const');
107466 var declarations = this.parseBindingList(kind, options);
107467 this.consumeSemicolon();
107468 return this.finalize(node, new Node.VariableDeclaration(declarations, kind));
107469 };
107470 // https://tc39.github.io/ecma262/#sec-destructuring-binding-patterns
107471 Parser.prototype.parseBindingRestElement = function (params, kind) {
107472 var node = this.createNode();
107473 this.expect('...');
107474 var arg = this.parsePattern(params, kind);
107475 return this.finalize(node, new Node.RestElement(arg));
107476 };
107477 Parser.prototype.parseArrayPattern = function (params, kind) {
107478 var node = this.createNode();
107479 this.expect('[');
107480 var elements = [];
107481 while (!this.match(']')) {
107482 if (this.match(',')) {
107483 this.nextToken();
107484 elements.push(null);
107485 }
107486 else {
107487 if (this.match('...')) {
107488 elements.push(this.parseBindingRestElement(params, kind));
107489 break;
107490 }
107491 else {
107492 elements.push(this.parsePatternWithDefault(params, kind));
107493 }
107494 if (!this.match(']')) {
107495 this.expect(',');
107496 }
107497 }
107498 }
107499 this.expect(']');
107500 return this.finalize(node, new Node.ArrayPattern(elements));
107501 };
107502 Parser.prototype.parsePropertyPattern = function (params, kind) {
107503 var node = this.createNode();
107504 var computed = false;
107505 var shorthand = false;
107506 var method = false;
107507 var key;
107508 var value;
107509 if (this.lookahead.type === 3 /* Identifier */) {
107510 var keyToken = this.lookahead;
107511 key = this.parseVariableIdentifier();
107512 var init = this.finalize(node, new Node.Identifier(keyToken.value));
107513 if (this.match('=')) {
107514 params.push(keyToken);
107515 shorthand = true;
107516 this.nextToken();
107517 var expr = this.parseAssignmentExpression();
107518 value = this.finalize(this.startNode(keyToken), new Node.AssignmentPattern(init, expr));
107519 }
107520 else if (!this.match(':')) {
107521 params.push(keyToken);
107522 shorthand = true;
107523 value = init;
107524 }
107525 else {
107526 this.expect(':');
107527 value = this.parsePatternWithDefault(params, kind);
107528 }
107529 }
107530 else {
107531 computed = this.match('[');
107532 key = this.parseObjectPropertyKey();
107533 this.expect(':');
107534 value = this.parsePatternWithDefault(params, kind);
107535 }
107536 return this.finalize(node, new Node.Property('init', key, computed, value, method, shorthand));
107537 };
107538 Parser.prototype.parseObjectPattern = function (params, kind) {
107539 var node = this.createNode();
107540 var properties = [];
107541 this.expect('{');
107542 while (!this.match('}')) {
107543 properties.push(this.parsePropertyPattern(params, kind));
107544 if (!this.match('}')) {
107545 this.expect(',');
107546 }
107547 }
107548 this.expect('}');
107549 return this.finalize(node, new Node.ObjectPattern(properties));
107550 };
107551 Parser.prototype.parsePattern = function (params, kind) {
107552 var pattern;
107553 if (this.match('[')) {
107554 pattern = this.parseArrayPattern(params, kind);
107555 }
107556 else if (this.match('{')) {
107557 pattern = this.parseObjectPattern(params, kind);
107558 }
107559 else {
107560 if (this.matchKeyword('let') && (kind === 'const' || kind === 'let')) {
107561 this.tolerateUnexpectedToken(this.lookahead, messages_1.Messages.LetInLexicalBinding);
107562 }
107563 params.push(this.lookahead);
107564 pattern = this.parseVariableIdentifier(kind);
107565 }
107566 return pattern;
107567 };
107568 Parser.prototype.parsePatternWithDefault = function (params, kind) {
107569 var startToken = this.lookahead;
107570 var pattern = this.parsePattern(params, kind);
107571 if (this.match('=')) {
107572 this.nextToken();
107573 var previousAllowYield = this.context.allowYield;
107574 this.context.allowYield = true;
107575 var right = this.isolateCoverGrammar(this.parseAssignmentExpression);
107576 this.context.allowYield = previousAllowYield;
107577 pattern = this.finalize(this.startNode(startToken), new Node.AssignmentPattern(pattern, right));
107578 }
107579 return pattern;
107580 };
107581 // https://tc39.github.io/ecma262/#sec-variable-statement
107582 Parser.prototype.parseVariableIdentifier = function (kind) {
107583 var node = this.createNode();
107584 var token = this.nextToken();
107585 if (token.type === 4 /* Keyword */ && token.value === 'yield') {
107586 if (this.context.strict) {
107587 this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
107588 }
107589 else if (!this.context.allowYield) {
107590 this.throwUnexpectedToken(token);
107591 }
107592 }
107593 else if (token.type !== 3 /* Identifier */) {
107594 if (this.context.strict && token.type === 4 /* Keyword */ && this.scanner.isStrictModeReservedWord(token.value)) {
107595 this.tolerateUnexpectedToken(token, messages_1.Messages.StrictReservedWord);
107596 }
107597 else {
107598 if (this.context.strict || token.value !== 'let' || kind !== 'var') {
107599 this.throwUnexpectedToken(token);
107600 }
107601 }
107602 }
107603 else if ((this.context.isModule || this.context.await) && token.type === 3 /* Identifier */ && token.value === 'await') {
107604 this.tolerateUnexpectedToken(token);
107605 }
107606 return this.finalize(node, new Node.Identifier(token.value));
107607 };
107608 Parser.prototype.parseVariableDeclaration = function (options) {
107609 var node = this.createNode();
107610 var params = [];
107611 var id = this.parsePattern(params, 'var');
107612 if (this.context.strict && id.type === syntax_1.Syntax.Identifier) {
107613 if (this.scanner.isRestrictedWord(id.name)) {
107614 this.tolerateError(messages_1.Messages.StrictVarName);
107615 }
107616 }
107617 var init = null;
107618 if (this.match('=')) {
107619 this.nextToken();
107620 init = this.isolateCoverGrammar(this.parseAssignmentExpression);
107621 }
107622 else if (id.type !== syntax_1.Syntax.Identifier && !options.inFor) {
107623 this.expect('=');
107624 }
107625 return this.finalize(node, new Node.VariableDeclarator(id, init));
107626 };
107627 Parser.prototype.parseVariableDeclarationList = function (options) {
107628 var opt = { inFor: options.inFor };
107629 var list = [];
107630 list.push(this.parseVariableDeclaration(opt));
107631 while (this.match(',')) {
107632 this.nextToken();
107633 list.push(this.parseVariableDeclaration(opt));
107634 }
107635 return list;
107636 };
107637 Parser.prototype.parseVariableStatement = function () {
107638 var node = this.createNode();
107639 this.expectKeyword('var');
107640 var declarations = this.parseVariableDeclarationList({ inFor: false });
107641 this.consumeSemicolon();
107642 return this.finalize(node, new Node.VariableDeclaration(declarations, 'var'));
107643 };
107644 // https://tc39.github.io/ecma262/#sec-empty-statement
107645 Parser.prototype.parseEmptyStatement = function () {
107646 var node = this.createNode();
107647 this.expect(';');
107648 return this.finalize(node, new Node.EmptyStatement());
107649 };
107650 // https://tc39.github.io/ecma262/#sec-expression-statement
107651 Parser.prototype.parseExpressionStatement = function () {
107652 var node = this.createNode();
107653 var expr = this.parseExpression();
107654 this.consumeSemicolon();
107655 return this.finalize(node, new Node.ExpressionStatement(expr));
107656 };
107657 // https://tc39.github.io/ecma262/#sec-if-statement
107658 Parser.prototype.parseIfClause = function () {
107659 if (this.context.strict && this.matchKeyword('function')) {
107660 this.tolerateError(messages_1.Messages.StrictFunction);
107661 }
107662 return this.parseStatement();
107663 };
107664 Parser.prototype.parseIfStatement = function () {
107665 var node = this.createNode();
107666 var consequent;
107667 var alternate = null;
107668 this.expectKeyword('if');
107669 this.expect('(');
107670 var test = this.parseExpression();
107671 if (!this.match(')') && this.config.tolerant) {
107672 this.tolerateUnexpectedToken(this.nextToken());
107673 consequent = this.finalize(this.createNode(), new Node.EmptyStatement());
107674 }
107675 else {
107676 this.expect(')');
107677 consequent = this.parseIfClause();
107678 if (this.matchKeyword('else')) {
107679 this.nextToken();
107680 alternate = this.parseIfClause();
107681 }
107682 }
107683 return this.finalize(node, new Node.IfStatement(test, consequent, alternate));
107684 };
107685 // https://tc39.github.io/ecma262/#sec-do-while-statement
107686 Parser.prototype.parseDoWhileStatement = function () {
107687 var node = this.createNode();
107688 this.expectKeyword('do');
107689 var previousInIteration = this.context.inIteration;
107690 this.context.inIteration = true;
107691 var body = this.parseStatement();
107692 this.context.inIteration = previousInIteration;
107693 this.expectKeyword('while');
107694 this.expect('(');
107695 var test = this.parseExpression();
107696 if (!this.match(')') && this.config.tolerant) {
107697 this.tolerateUnexpectedToken(this.nextToken());
107698 }
107699 else {
107700 this.expect(')');
107701 if (this.match(';')) {
107702 this.nextToken();
107703 }
107704 }
107705 return this.finalize(node, new Node.DoWhileStatement(body, test));
107706 };
107707 // https://tc39.github.io/ecma262/#sec-while-statement
107708 Parser.prototype.parseWhileStatement = function () {
107709 var node = this.createNode();
107710 var body;
107711 this.expectKeyword('while');
107712 this.expect('(');
107713 var test = this.parseExpression();
107714 if (!this.match(')') && this.config.tolerant) {
107715 this.tolerateUnexpectedToken(this.nextToken());
107716 body = this.finalize(this.createNode(), new Node.EmptyStatement());
107717 }
107718 else {
107719 this.expect(')');
107720 var previousInIteration = this.context.inIteration;
107721 this.context.inIteration = true;
107722 body = this.parseStatement();
107723 this.context.inIteration = previousInIteration;
107724 }
107725 return this.finalize(node, new Node.WhileStatement(test, body));
107726 };
107727 // https://tc39.github.io/ecma262/#sec-for-statement
107728 // https://tc39.github.io/ecma262/#sec-for-in-and-for-of-statements
107729 Parser.prototype.parseForStatement = function () {
107730 var init = null;
107731 var test = null;
107732 var update = null;
107733 var forIn = true;
107734 var left, right;
107735 var node = this.createNode();
107736 this.expectKeyword('for');
107737 this.expect('(');
107738 if (this.match(';')) {
107739 this.nextToken();
107740 }
107741 else {
107742 if (this.matchKeyword('var')) {
107743 init = this.createNode();
107744 this.nextToken();
107745 var previousAllowIn = this.context.allowIn;
107746 this.context.allowIn = false;
107747 var declarations = this.parseVariableDeclarationList({ inFor: true });
107748 this.context.allowIn = previousAllowIn;
107749 if (declarations.length === 1 && this.matchKeyword('in')) {
107750 var decl = declarations[0];
107751 if (decl.init && (decl.id.type === syntax_1.Syntax.ArrayPattern || decl.id.type === syntax_1.Syntax.ObjectPattern || this.context.strict)) {
107752 this.tolerateError(messages_1.Messages.ForInOfLoopInitializer, 'for-in');
107753 }
107754 init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
107755 this.nextToken();
107756 left = init;
107757 right = this.parseExpression();
107758 init = null;
107759 }
107760 else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) {
107761 init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
107762 this.nextToken();
107763 left = init;
107764 right = this.parseAssignmentExpression();
107765 init = null;
107766 forIn = false;
107767 }
107768 else {
107769 init = this.finalize(init, new Node.VariableDeclaration(declarations, 'var'));
107770 this.expect(';');
107771 }
107772 }
107773 else if (this.matchKeyword('const') || this.matchKeyword('let')) {
107774 init = this.createNode();
107775 var kind = this.nextToken().value;
107776 if (!this.context.strict && this.lookahead.value === 'in') {
107777 init = this.finalize(init, new Node.Identifier(kind));
107778 this.nextToken();
107779 left = init;
107780 right = this.parseExpression();
107781 init = null;
107782 }
107783 else {
107784 var previousAllowIn = this.context.allowIn;
107785 this.context.allowIn = false;
107786 var declarations = this.parseBindingList(kind, { inFor: true });
107787 this.context.allowIn = previousAllowIn;
107788 if (declarations.length === 1 && declarations[0].init === null && this.matchKeyword('in')) {
107789 init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
107790 this.nextToken();
107791 left = init;
107792 right = this.parseExpression();
107793 init = null;
107794 }
107795 else if (declarations.length === 1 && declarations[0].init === null && this.matchContextualKeyword('of')) {
107796 init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
107797 this.nextToken();
107798 left = init;
107799 right = this.parseAssignmentExpression();
107800 init = null;
107801 forIn = false;
107802 }
107803 else {
107804 this.consumeSemicolon();
107805 init = this.finalize(init, new Node.VariableDeclaration(declarations, kind));
107806 }
107807 }
107808 }
107809 else {
107810 var initStartToken = this.lookahead;
107811 var previousAllowIn = this.context.allowIn;
107812 this.context.allowIn = false;
107813 init = this.inheritCoverGrammar(this.parseAssignmentExpression);
107814 this.context.allowIn = previousAllowIn;
107815 if (this.matchKeyword('in')) {
107816 if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
107817 this.tolerateError(messages_1.Messages.InvalidLHSInForIn);
107818 }
107819 this.nextToken();
107820 this.reinterpretExpressionAsPattern(init);
107821 left = init;
107822 right = this.parseExpression();
107823 init = null;
107824 }
107825 else if (this.matchContextualKeyword('of')) {
107826 if (!this.context.isAssignmentTarget || init.type === syntax_1.Syntax.AssignmentExpression) {
107827 this.tolerateError(messages_1.Messages.InvalidLHSInForLoop);
107828 }
107829 this.nextToken();
107830 this.reinterpretExpressionAsPattern(init);
107831 left = init;
107832 right = this.parseAssignmentExpression();
107833 init = null;
107834 forIn = false;
107835 }
107836 else {
107837 if (this.match(',')) {
107838 var initSeq = [init];
107839 while (this.match(',')) {
107840 this.nextToken();
107841 initSeq.push(this.isolateCoverGrammar(this.parseAssignmentExpression));
107842 }
107843 init = this.finalize(this.startNode(initStartToken), new Node.SequenceExpression(initSeq));
107844 }
107845 this.expect(';');
107846 }
107847 }
107848 }
107849 if (typeof left === 'undefined') {
107850 if (!this.match(';')) {
107851 test = this.parseExpression();
107852 }
107853 this.expect(';');
107854 if (!this.match(')')) {
107855 update = this.parseExpression();
107856 }
107857 }
107858 var body;
107859 if (!this.match(')') && this.config.tolerant) {
107860 this.tolerateUnexpectedToken(this.nextToken());
107861 body = this.finalize(this.createNode(), new Node.EmptyStatement());
107862 }
107863 else {
107864 this.expect(')');
107865 var previousInIteration = this.context.inIteration;
107866 this.context.inIteration = true;
107867 body = this.isolateCoverGrammar(this.parseStatement);
107868 this.context.inIteration = previousInIteration;
107869 }
107870 return (typeof left === 'undefined') ?
107871 this.finalize(node, new Node.ForStatement(init, test, update, body)) :
107872 forIn ? this.finalize(node, new Node.ForInStatement(left, right, body)) :
107873 this.finalize(node, new Node.ForOfStatement(left, right, body));
107874 };
107875 // https://tc39.github.io/ecma262/#sec-continue-statement
107876 Parser.prototype.parseContinueStatement = function () {
107877 var node = this.createNode();
107878 this.expectKeyword('continue');
107879 var label = null;
107880 if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) {
107881 var id = this.parseVariableIdentifier();
107882 label = id;
107883 var key = '$' + id.name;
107884 if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
107885 this.throwError(messages_1.Messages.UnknownLabel, id.name);
107886 }
107887 }
107888 this.consumeSemicolon();
107889 if (label === null && !this.context.inIteration) {
107890 this.throwError(messages_1.Messages.IllegalContinue);
107891 }
107892 return this.finalize(node, new Node.ContinueStatement(label));
107893 };
107894 // https://tc39.github.io/ecma262/#sec-break-statement
107895 Parser.prototype.parseBreakStatement = function () {
107896 var node = this.createNode();
107897 this.expectKeyword('break');
107898 var label = null;
107899 if (this.lookahead.type === 3 /* Identifier */ && !this.hasLineTerminator) {
107900 var id = this.parseVariableIdentifier();
107901 var key = '$' + id.name;
107902 if (!Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
107903 this.throwError(messages_1.Messages.UnknownLabel, id.name);
107904 }
107905 label = id;
107906 }
107907 this.consumeSemicolon();
107908 if (label === null && !this.context.inIteration && !this.context.inSwitch) {
107909 this.throwError(messages_1.Messages.IllegalBreak);
107910 }
107911 return this.finalize(node, new Node.BreakStatement(label));
107912 };
107913 // https://tc39.github.io/ecma262/#sec-return-statement
107914 Parser.prototype.parseReturnStatement = function () {
107915 if (!this.context.inFunctionBody) {
107916 this.tolerateError(messages_1.Messages.IllegalReturn);
107917 }
107918 var node = this.createNode();
107919 this.expectKeyword('return');
107920 var hasArgument = (!this.match(';') && !this.match('}') &&
107921 !this.hasLineTerminator && this.lookahead.type !== 2 /* EOF */) ||
107922 this.lookahead.type === 8 /* StringLiteral */ ||
107923 this.lookahead.type === 10 /* Template */;
107924 var argument = hasArgument ? this.parseExpression() : null;
107925 this.consumeSemicolon();
107926 return this.finalize(node, new Node.ReturnStatement(argument));
107927 };
107928 // https://tc39.github.io/ecma262/#sec-with-statement
107929 Parser.prototype.parseWithStatement = function () {
107930 if (this.context.strict) {
107931 this.tolerateError(messages_1.Messages.StrictModeWith);
107932 }
107933 var node = this.createNode();
107934 var body;
107935 this.expectKeyword('with');
107936 this.expect('(');
107937 var object = this.parseExpression();
107938 if (!this.match(')') && this.config.tolerant) {
107939 this.tolerateUnexpectedToken(this.nextToken());
107940 body = this.finalize(this.createNode(), new Node.EmptyStatement());
107941 }
107942 else {
107943 this.expect(')');
107944 body = this.parseStatement();
107945 }
107946 return this.finalize(node, new Node.WithStatement(object, body));
107947 };
107948 // https://tc39.github.io/ecma262/#sec-switch-statement
107949 Parser.prototype.parseSwitchCase = function () {
107950 var node = this.createNode();
107951 var test;
107952 if (this.matchKeyword('default')) {
107953 this.nextToken();
107954 test = null;
107955 }
107956 else {
107957 this.expectKeyword('case');
107958 test = this.parseExpression();
107959 }
107960 this.expect(':');
107961 var consequent = [];
107962 while (true) {
107963 if (this.match('}') || this.matchKeyword('default') || this.matchKeyword('case')) {
107964 break;
107965 }
107966 consequent.push(this.parseStatementListItem());
107967 }
107968 return this.finalize(node, new Node.SwitchCase(test, consequent));
107969 };
107970 Parser.prototype.parseSwitchStatement = function () {
107971 var node = this.createNode();
107972 this.expectKeyword('switch');
107973 this.expect('(');
107974 var discriminant = this.parseExpression();
107975 this.expect(')');
107976 var previousInSwitch = this.context.inSwitch;
107977 this.context.inSwitch = true;
107978 var cases = [];
107979 var defaultFound = false;
107980 this.expect('{');
107981 while (true) {
107982 if (this.match('}')) {
107983 break;
107984 }
107985 var clause = this.parseSwitchCase();
107986 if (clause.test === null) {
107987 if (defaultFound) {
107988 this.throwError(messages_1.Messages.MultipleDefaultsInSwitch);
107989 }
107990 defaultFound = true;
107991 }
107992 cases.push(clause);
107993 }
107994 this.expect('}');
107995 this.context.inSwitch = previousInSwitch;
107996 return this.finalize(node, new Node.SwitchStatement(discriminant, cases));
107997 };
107998 // https://tc39.github.io/ecma262/#sec-labelled-statements
107999 Parser.prototype.parseLabelledStatement = function () {
108000 var node = this.createNode();
108001 var expr = this.parseExpression();
108002 var statement;
108003 if ((expr.type === syntax_1.Syntax.Identifier) && this.match(':')) {
108004 this.nextToken();
108005 var id = expr;
108006 var key = '$' + id.name;
108007 if (Object.prototype.hasOwnProperty.call(this.context.labelSet, key)) {
108008 this.throwError(messages_1.Messages.Redeclaration, 'Label', id.name);
108009 }
108010 this.context.labelSet[key] = true;
108011 var body = void 0;
108012 if (this.matchKeyword('class')) {
108013 this.tolerateUnexpectedToken(this.lookahead);
108014 body = this.parseClassDeclaration();
108015 }
108016 else if (this.matchKeyword('function')) {
108017 var token = this.lookahead;
108018 var declaration = this.parseFunctionDeclaration();
108019 if (this.context.strict) {
108020 this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunction);
108021 }
108022 else if (declaration.generator) {
108023 this.tolerateUnexpectedToken(token, messages_1.Messages.GeneratorInLegacyContext);
108024 }
108025 body = declaration;
108026 }
108027 else {
108028 body = this.parseStatement();
108029 }
108030 delete this.context.labelSet[key];
108031 statement = new Node.LabeledStatement(id, body);
108032 }
108033 else {
108034 this.consumeSemicolon();
108035 statement = new Node.ExpressionStatement(expr);
108036 }
108037 return this.finalize(node, statement);
108038 };
108039 // https://tc39.github.io/ecma262/#sec-throw-statement
108040 Parser.prototype.parseThrowStatement = function () {
108041 var node = this.createNode();
108042 this.expectKeyword('throw');
108043 if (this.hasLineTerminator) {
108044 this.throwError(messages_1.Messages.NewlineAfterThrow);
108045 }
108046 var argument = this.parseExpression();
108047 this.consumeSemicolon();
108048 return this.finalize(node, new Node.ThrowStatement(argument));
108049 };
108050 // https://tc39.github.io/ecma262/#sec-try-statement
108051 Parser.prototype.parseCatchClause = function () {
108052 var node = this.createNode();
108053 this.expectKeyword('catch');
108054 this.expect('(');
108055 if (this.match(')')) {
108056 this.throwUnexpectedToken(this.lookahead);
108057 }
108058 var params = [];
108059 var param = this.parsePattern(params);
108060 var paramMap = {};
108061 for (var i = 0; i < params.length; i++) {
108062 var key = '$' + params[i].value;
108063 if (Object.prototype.hasOwnProperty.call(paramMap, key)) {
108064 this.tolerateError(messages_1.Messages.DuplicateBinding, params[i].value);
108065 }
108066 paramMap[key] = true;
108067 }
108068 if (this.context.strict && param.type === syntax_1.Syntax.Identifier) {
108069 if (this.scanner.isRestrictedWord(param.name)) {
108070 this.tolerateError(messages_1.Messages.StrictCatchVariable);
108071 }
108072 }
108073 this.expect(')');
108074 var body = this.parseBlock();
108075 return this.finalize(node, new Node.CatchClause(param, body));
108076 };
108077 Parser.prototype.parseFinallyClause = function () {
108078 this.expectKeyword('finally');
108079 return this.parseBlock();
108080 };
108081 Parser.prototype.parseTryStatement = function () {
108082 var node = this.createNode();
108083 this.expectKeyword('try');
108084 var block = this.parseBlock();
108085 var handler = this.matchKeyword('catch') ? this.parseCatchClause() : null;
108086 var finalizer = this.matchKeyword('finally') ? this.parseFinallyClause() : null;
108087 if (!handler && !finalizer) {
108088 this.throwError(messages_1.Messages.NoCatchOrFinally);
108089 }
108090 return this.finalize(node, new Node.TryStatement(block, handler, finalizer));
108091 };
108092 // https://tc39.github.io/ecma262/#sec-debugger-statement
108093 Parser.prototype.parseDebuggerStatement = function () {
108094 var node = this.createNode();
108095 this.expectKeyword('debugger');
108096 this.consumeSemicolon();
108097 return this.finalize(node, new Node.DebuggerStatement());
108098 };
108099 // https://tc39.github.io/ecma262/#sec-ecmascript-language-statements-and-declarations
108100 Parser.prototype.parseStatement = function () {
108101 var statement;
108102 switch (this.lookahead.type) {
108103 case 1 /* BooleanLiteral */:
108104 case 5 /* NullLiteral */:
108105 case 6 /* NumericLiteral */:
108106 case 8 /* StringLiteral */:
108107 case 10 /* Template */:
108108 case 9 /* RegularExpression */:
108109 statement = this.parseExpressionStatement();
108110 break;
108111 case 7 /* Punctuator */:
108112 var value = this.lookahead.value;
108113 if (value === '{') {
108114 statement = this.parseBlock();
108115 }
108116 else if (value === '(') {
108117 statement = this.parseExpressionStatement();
108118 }
108119 else if (value === ';') {
108120 statement = this.parseEmptyStatement();
108121 }
108122 else {
108123 statement = this.parseExpressionStatement();
108124 }
108125 break;
108126 case 3 /* Identifier */:
108127 statement = this.matchAsyncFunction() ? this.parseFunctionDeclaration() : this.parseLabelledStatement();
108128 break;
108129 case 4 /* Keyword */:
108130 switch (this.lookahead.value) {
108131 case 'break':
108132 statement = this.parseBreakStatement();
108133 break;
108134 case 'continue':
108135 statement = this.parseContinueStatement();
108136 break;
108137 case 'debugger':
108138 statement = this.parseDebuggerStatement();
108139 break;
108140 case 'do':
108141 statement = this.parseDoWhileStatement();
108142 break;
108143 case 'for':
108144 statement = this.parseForStatement();
108145 break;
108146 case 'function':
108147 statement = this.parseFunctionDeclaration();
108148 break;
108149 case 'if':
108150 statement = this.parseIfStatement();
108151 break;
108152 case 'return':
108153 statement = this.parseReturnStatement();
108154 break;
108155 case 'switch':
108156 statement = this.parseSwitchStatement();
108157 break;
108158 case 'throw':
108159 statement = this.parseThrowStatement();
108160 break;
108161 case 'try':
108162 statement = this.parseTryStatement();
108163 break;
108164 case 'var':
108165 statement = this.parseVariableStatement();
108166 break;
108167 case 'while':
108168 statement = this.parseWhileStatement();
108169 break;
108170 case 'with':
108171 statement = this.parseWithStatement();
108172 break;
108173 default:
108174 statement = this.parseExpressionStatement();
108175 break;
108176 }
108177 break;
108178 default:
108179 statement = this.throwUnexpectedToken(this.lookahead);
108180 }
108181 return statement;
108182 };
108183 // https://tc39.github.io/ecma262/#sec-function-definitions
108184 Parser.prototype.parseFunctionSourceElements = function () {
108185 var node = this.createNode();
108186 this.expect('{');
108187 var body = this.parseDirectivePrologues();
108188 var previousLabelSet = this.context.labelSet;
108189 var previousInIteration = this.context.inIteration;
108190 var previousInSwitch = this.context.inSwitch;
108191 var previousInFunctionBody = this.context.inFunctionBody;
108192 this.context.labelSet = {};
108193 this.context.inIteration = false;
108194 this.context.inSwitch = false;
108195 this.context.inFunctionBody = true;
108196 while (this.lookahead.type !== 2 /* EOF */) {
108197 if (this.match('}')) {
108198 break;
108199 }
108200 body.push(this.parseStatementListItem());
108201 }
108202 this.expect('}');
108203 this.context.labelSet = previousLabelSet;
108204 this.context.inIteration = previousInIteration;
108205 this.context.inSwitch = previousInSwitch;
108206 this.context.inFunctionBody = previousInFunctionBody;
108207 return this.finalize(node, new Node.BlockStatement(body));
108208 };
108209 Parser.prototype.validateParam = function (options, param, name) {
108210 var key = '$' + name;
108211 if (this.context.strict) {
108212 if (this.scanner.isRestrictedWord(name)) {
108213 options.stricted = param;
108214 options.message = messages_1.Messages.StrictParamName;
108215 }
108216 if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
108217 options.stricted = param;
108218 options.message = messages_1.Messages.StrictParamDupe;
108219 }
108220 }
108221 else if (!options.firstRestricted) {
108222 if (this.scanner.isRestrictedWord(name)) {
108223 options.firstRestricted = param;
108224 options.message = messages_1.Messages.StrictParamName;
108225 }
108226 else if (this.scanner.isStrictModeReservedWord(name)) {
108227 options.firstRestricted = param;
108228 options.message = messages_1.Messages.StrictReservedWord;
108229 }
108230 else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
108231 options.stricted = param;
108232 options.message = messages_1.Messages.StrictParamDupe;
108233 }
108234 }
108235 /* istanbul ignore next */
108236 if (typeof Object.defineProperty === 'function') {
108237 Object.defineProperty(options.paramSet, key, { value: true, enumerable: true, writable: true, configurable: true });
108238 }
108239 else {
108240 options.paramSet[key] = true;
108241 }
108242 };
108243 Parser.prototype.parseRestElement = function (params) {
108244 var node = this.createNode();
108245 this.expect('...');
108246 var arg = this.parsePattern(params);
108247 if (this.match('=')) {
108248 this.throwError(messages_1.Messages.DefaultRestParameter);
108249 }
108250 if (!this.match(')')) {
108251 this.throwError(messages_1.Messages.ParameterAfterRestParameter);
108252 }
108253 return this.finalize(node, new Node.RestElement(arg));
108254 };
108255 Parser.prototype.parseFormalParameter = function (options) {
108256 var params = [];
108257 var param = this.match('...') ? this.parseRestElement(params) : this.parsePatternWithDefault(params);
108258 for (var i = 0; i < params.length; i++) {
108259 this.validateParam(options, params[i], params[i].value);
108260 }
108261 options.simple = options.simple && (param instanceof Node.Identifier);
108262 options.params.push(param);
108263 };
108264 Parser.prototype.parseFormalParameters = function (firstRestricted) {
108265 var options;
108266 options = {
108267 simple: true,
108268 params: [],
108269 firstRestricted: firstRestricted
108270 };
108271 this.expect('(');
108272 if (!this.match(')')) {
108273 options.paramSet = {};
108274 while (this.lookahead.type !== 2 /* EOF */) {
108275 this.parseFormalParameter(options);
108276 if (this.match(')')) {
108277 break;
108278 }
108279 this.expect(',');
108280 if (this.match(')')) {
108281 break;
108282 }
108283 }
108284 }
108285 this.expect(')');
108286 return {
108287 simple: options.simple,
108288 params: options.params,
108289 stricted: options.stricted,
108290 firstRestricted: options.firstRestricted,
108291 message: options.message
108292 };
108293 };
108294 Parser.prototype.matchAsyncFunction = function () {
108295 var match = this.matchContextualKeyword('async');
108296 if (match) {
108297 var state = this.scanner.saveState();
108298 this.scanner.scanComments();
108299 var next = this.scanner.lex();
108300 this.scanner.restoreState(state);
108301 match = (state.lineNumber === next.lineNumber) && (next.type === 4 /* Keyword */) && (next.value === 'function');
108302 }
108303 return match;
108304 };
108305 Parser.prototype.parseFunctionDeclaration = function (identifierIsOptional) {
108306 var node = this.createNode();
108307 var isAsync = this.matchContextualKeyword('async');
108308 if (isAsync) {
108309 this.nextToken();
108310 }
108311 this.expectKeyword('function');
108312 var isGenerator = isAsync ? false : this.match('*');
108313 if (isGenerator) {
108314 this.nextToken();
108315 }
108316 var message;
108317 var id = null;
108318 var firstRestricted = null;
108319 if (!identifierIsOptional || !this.match('(')) {
108320 var token = this.lookahead;
108321 id = this.parseVariableIdentifier();
108322 if (this.context.strict) {
108323 if (this.scanner.isRestrictedWord(token.value)) {
108324 this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
108325 }
108326 }
108327 else {
108328 if (this.scanner.isRestrictedWord(token.value)) {
108329 firstRestricted = token;
108330 message = messages_1.Messages.StrictFunctionName;
108331 }
108332 else if (this.scanner.isStrictModeReservedWord(token.value)) {
108333 firstRestricted = token;
108334 message = messages_1.Messages.StrictReservedWord;
108335 }
108336 }
108337 }
108338 var previousAllowAwait = this.context.await;
108339 var previousAllowYield = this.context.allowYield;
108340 this.context.await = isAsync;
108341 this.context.allowYield = !isGenerator;
108342 var formalParameters = this.parseFormalParameters(firstRestricted);
108343 var params = formalParameters.params;
108344 var stricted = formalParameters.stricted;
108345 firstRestricted = formalParameters.firstRestricted;
108346 if (formalParameters.message) {
108347 message = formalParameters.message;
108348 }
108349 var previousStrict = this.context.strict;
108350 var previousAllowStrictDirective = this.context.allowStrictDirective;
108351 this.context.allowStrictDirective = formalParameters.simple;
108352 var body = this.parseFunctionSourceElements();
108353 if (this.context.strict && firstRestricted) {
108354 this.throwUnexpectedToken(firstRestricted, message);
108355 }
108356 if (this.context.strict && stricted) {
108357 this.tolerateUnexpectedToken(stricted, message);
108358 }
108359 this.context.strict = previousStrict;
108360 this.context.allowStrictDirective = previousAllowStrictDirective;
108361 this.context.await = previousAllowAwait;
108362 this.context.allowYield = previousAllowYield;
108363 return isAsync ? this.finalize(node, new Node.AsyncFunctionDeclaration(id, params, body)) :
108364 this.finalize(node, new Node.FunctionDeclaration(id, params, body, isGenerator));
108365 };
108366 Parser.prototype.parseFunctionExpression = function () {
108367 var node = this.createNode();
108368 var isAsync = this.matchContextualKeyword('async');
108369 if (isAsync) {
108370 this.nextToken();
108371 }
108372 this.expectKeyword('function');
108373 var isGenerator = isAsync ? false : this.match('*');
108374 if (isGenerator) {
108375 this.nextToken();
108376 }
108377 var message;
108378 var id = null;
108379 var firstRestricted;
108380 var previousAllowAwait = this.context.await;
108381 var previousAllowYield = this.context.allowYield;
108382 this.context.await = isAsync;
108383 this.context.allowYield = !isGenerator;
108384 if (!this.match('(')) {
108385 var token = this.lookahead;
108386 id = (!this.context.strict && !isGenerator && this.matchKeyword('yield')) ? this.parseIdentifierName() : this.parseVariableIdentifier();
108387 if (this.context.strict) {
108388 if (this.scanner.isRestrictedWord(token.value)) {
108389 this.tolerateUnexpectedToken(token, messages_1.Messages.StrictFunctionName);
108390 }
108391 }
108392 else {
108393 if (this.scanner.isRestrictedWord(token.value)) {
108394 firstRestricted = token;
108395 message = messages_1.Messages.StrictFunctionName;
108396 }
108397 else if (this.scanner.isStrictModeReservedWord(token.value)) {
108398 firstRestricted = token;
108399 message = messages_1.Messages.StrictReservedWord;
108400 }
108401 }
108402 }
108403 var formalParameters = this.parseFormalParameters(firstRestricted);
108404 var params = formalParameters.params;
108405 var stricted = formalParameters.stricted;
108406 firstRestricted = formalParameters.firstRestricted;
108407 if (formalParameters.message) {
108408 message = formalParameters.message;
108409 }
108410 var previousStrict = this.context.strict;
108411 var previousAllowStrictDirective = this.context.allowStrictDirective;
108412 this.context.allowStrictDirective = formalParameters.simple;
108413 var body = this.parseFunctionSourceElements();
108414 if (this.context.strict && firstRestricted) {
108415 this.throwUnexpectedToken(firstRestricted, message);
108416 }
108417 if (this.context.strict && stricted) {
108418 this.tolerateUnexpectedToken(stricted, message);
108419 }
108420 this.context.strict = previousStrict;
108421 this.context.allowStrictDirective = previousAllowStrictDirective;
108422 this.context.await = previousAllowAwait;
108423 this.context.allowYield = previousAllowYield;
108424 return isAsync ? this.finalize(node, new Node.AsyncFunctionExpression(id, params, body)) :
108425 this.finalize(node, new Node.FunctionExpression(id, params, body, isGenerator));
108426 };
108427 // https://tc39.github.io/ecma262/#sec-directive-prologues-and-the-use-strict-directive
108428 Parser.prototype.parseDirective = function () {
108429 var token = this.lookahead;
108430 var node = this.createNode();
108431 var expr = this.parseExpression();
108432 var directive = (expr.type === syntax_1.Syntax.Literal) ? this.getTokenRaw(token).slice(1, -1) : null;
108433 this.consumeSemicolon();
108434 return this.finalize(node, directive ? new Node.Directive(expr, directive) : new Node.ExpressionStatement(expr));
108435 };
108436 Parser.prototype.parseDirectivePrologues = function () {
108437 var firstRestricted = null;
108438 var body = [];
108439 while (true) {
108440 var token = this.lookahead;
108441 if (token.type !== 8 /* StringLiteral */) {
108442 break;
108443 }
108444 var statement = this.parseDirective();
108445 body.push(statement);
108446 var directive = statement.directive;
108447 if (typeof directive !== 'string') {
108448 break;
108449 }
108450 if (directive === 'use strict') {
108451 this.context.strict = true;
108452 if (firstRestricted) {
108453 this.tolerateUnexpectedToken(firstRestricted, messages_1.Messages.StrictOctalLiteral);
108454 }
108455 if (!this.context.allowStrictDirective) {
108456 this.tolerateUnexpectedToken(token, messages_1.Messages.IllegalLanguageModeDirective);
108457 }
108458 }
108459 else {
108460 if (!firstRestricted && token.octal) {
108461 firstRestricted = token;
108462 }
108463 }
108464 }
108465 return body;
108466 };
108467 // https://tc39.github.io/ecma262/#sec-method-definitions
108468 Parser.prototype.qualifiedPropertyName = function (token) {
108469 switch (token.type) {
108470 case 3 /* Identifier */:
108471 case 8 /* StringLiteral */:
108472 case 1 /* BooleanLiteral */:
108473 case 5 /* NullLiteral */:
108474 case 6 /* NumericLiteral */:
108475 case 4 /* Keyword */:
108476 return true;
108477 case 7 /* Punctuator */:
108478 return token.value === '[';
108479 default:
108480 break;
108481 }
108482 return false;
108483 };
108484 Parser.prototype.parseGetterMethod = function () {
108485 var node = this.createNode();
108486 var isGenerator = false;
108487 var previousAllowYield = this.context.allowYield;
108488 this.context.allowYield = !isGenerator;
108489 var formalParameters = this.parseFormalParameters();
108490 if (formalParameters.params.length > 0) {
108491 this.tolerateError(messages_1.Messages.BadGetterArity);
108492 }
108493 var method = this.parsePropertyMethod(formalParameters);
108494 this.context.allowYield = previousAllowYield;
108495 return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
108496 };
108497 Parser.prototype.parseSetterMethod = function () {
108498 var node = this.createNode();
108499 var isGenerator = false;
108500 var previousAllowYield = this.context.allowYield;
108501 this.context.allowYield = !isGenerator;
108502 var formalParameters = this.parseFormalParameters();
108503 if (formalParameters.params.length !== 1) {
108504 this.tolerateError(messages_1.Messages.BadSetterArity);
108505 }
108506 else if (formalParameters.params[0] instanceof Node.RestElement) {
108507 this.tolerateError(messages_1.Messages.BadSetterRestParameter);
108508 }
108509 var method = this.parsePropertyMethod(formalParameters);
108510 this.context.allowYield = previousAllowYield;
108511 return this.finalize(node, new Node.FunctionExpression(null, formalParameters.params, method, isGenerator));
108512 };
108513 Parser.prototype.parseGeneratorMethod = function () {
108514 var node = this.createNode();
108515 var isGenerator = true;
108516 var previousAllowYield = this.context.allowYield;
108517 this.context.allowYield = true;
108518 var params = this.parseFormalParameters();
108519 this.context.allowYield = false;
108520 var method = this.parsePropertyMethod(params);
108521 this.context.allowYield = previousAllowYield;
108522 return this.finalize(node, new Node.FunctionExpression(null, params.params, method, isGenerator));
108523 };
108524 // https://tc39.github.io/ecma262/#sec-generator-function-definitions
108525 Parser.prototype.isStartOfExpression = function () {
108526 var start = true;
108527 var value = this.lookahead.value;
108528 switch (this.lookahead.type) {
108529 case 7 /* Punctuator */:
108530 start = (value === '[') || (value === '(') || (value === '{') ||
108531 (value === '+') || (value === '-') ||
108532 (value === '!') || (value === '~') ||
108533 (value === '++') || (value === '--') ||
108534 (value === '/') || (value === '/='); // regular expression literal
108535 break;
108536 case 4 /* Keyword */:
108537 start = (value === 'class') || (value === 'delete') ||
108538 (value === 'function') || (value === 'let') || (value === 'new') ||
108539 (value === 'super') || (value === 'this') || (value === 'typeof') ||
108540 (value === 'void') || (value === 'yield');
108541 break;
108542 default:
108543 break;
108544 }
108545 return start;
108546 };
108547 Parser.prototype.parseYieldExpression = function () {
108548 var node = this.createNode();
108549 this.expectKeyword('yield');
108550 var argument = null;
108551 var delegate = false;
108552 if (!this.hasLineTerminator) {
108553 var previousAllowYield = this.context.allowYield;
108554 this.context.allowYield = false;
108555 delegate = this.match('*');
108556 if (delegate) {
108557 this.nextToken();
108558 argument = this.parseAssignmentExpression();
108559 }
108560 else if (this.isStartOfExpression()) {
108561 argument = this.parseAssignmentExpression();
108562 }
108563 this.context.allowYield = previousAllowYield;
108564 }
108565 return this.finalize(node, new Node.YieldExpression(argument, delegate));
108566 };
108567 // https://tc39.github.io/ecma262/#sec-class-definitions
108568 Parser.prototype.parseClassElement = function (hasConstructor) {
108569 var token = this.lookahead;
108570 var node = this.createNode();
108571 var kind = '';
108572 var key = null;
108573 var value = null;
108574 var computed = false;
108575 var method = false;
108576 var isStatic = false;
108577 var isAsync = false;
108578 if (this.match('*')) {
108579 this.nextToken();
108580 }
108581 else {
108582 computed = this.match('[');
108583 key = this.parseObjectPropertyKey();
108584 var id = key;
108585 if (id.name === 'static' && (this.qualifiedPropertyName(this.lookahead) || this.match('*'))) {
108586 token = this.lookahead;
108587 isStatic = true;
108588 computed = this.match('[');
108589 if (this.match('*')) {
108590 this.nextToken();
108591 }
108592 else {
108593 key = this.parseObjectPropertyKey();
108594 }
108595 }
108596 if ((token.type === 3 /* Identifier */) && !this.hasLineTerminator && (token.value === 'async')) {
108597 var punctuator = this.lookahead.value;
108598 if (punctuator !== ':' && punctuator !== '(' && punctuator !== '*') {
108599 isAsync = true;
108600 token = this.lookahead;
108601 key = this.parseObjectPropertyKey();
108602 if (token.type === 3 /* Identifier */ && token.value === 'constructor') {
108603 this.tolerateUnexpectedToken(token, messages_1.Messages.ConstructorIsAsync);
108604 }
108605 }
108606 }
108607 }
108608 var lookaheadPropertyKey = this.qualifiedPropertyName(this.lookahead);
108609 if (token.type === 3 /* Identifier */) {
108610 if (token.value === 'get' && lookaheadPropertyKey) {
108611 kind = 'get';
108612 computed = this.match('[');
108613 key = this.parseObjectPropertyKey();
108614 this.context.allowYield = false;
108615 value = this.parseGetterMethod();
108616 }
108617 else if (token.value === 'set' && lookaheadPropertyKey) {
108618 kind = 'set';
108619 computed = this.match('[');
108620 key = this.parseObjectPropertyKey();
108621 value = this.parseSetterMethod();
108622 }
108623 }
108624 else if (token.type === 7 /* Punctuator */ && token.value === '*' && lookaheadPropertyKey) {
108625 kind = 'init';
108626 computed = this.match('[');
108627 key = this.parseObjectPropertyKey();
108628 value = this.parseGeneratorMethod();
108629 method = true;
108630 }
108631 if (!kind && key && this.match('(')) {
108632 kind = 'init';
108633 value = isAsync ? this.parsePropertyMethodAsyncFunction() : this.parsePropertyMethodFunction();
108634 method = true;
108635 }
108636 if (!kind) {
108637 this.throwUnexpectedToken(this.lookahead);
108638 }
108639 if (kind === 'init') {
108640 kind = 'method';
108641 }
108642 if (!computed) {
108643 if (isStatic && this.isPropertyKey(key, 'prototype')) {
108644 this.throwUnexpectedToken(token, messages_1.Messages.StaticPrototype);
108645 }
108646 if (!isStatic && this.isPropertyKey(key, 'constructor')) {
108647 if (kind !== 'method' || !method || (value && value.generator)) {
108648 this.throwUnexpectedToken(token, messages_1.Messages.ConstructorSpecialMethod);
108649 }
108650 if (hasConstructor.value) {
108651 this.throwUnexpectedToken(token, messages_1.Messages.DuplicateConstructor);
108652 }
108653 else {
108654 hasConstructor.value = true;
108655 }
108656 kind = 'constructor';
108657 }
108658 }
108659 return this.finalize(node, new Node.MethodDefinition(key, computed, value, kind, isStatic));
108660 };
108661 Parser.prototype.parseClassElementList = function () {
108662 var body = [];
108663 var hasConstructor = { value: false };
108664 this.expect('{');
108665 while (!this.match('}')) {
108666 if (this.match(';')) {
108667 this.nextToken();
108668 }
108669 else {
108670 body.push(this.parseClassElement(hasConstructor));
108671 }
108672 }
108673 this.expect('}');
108674 return body;
108675 };
108676 Parser.prototype.parseClassBody = function () {
108677 var node = this.createNode();
108678 var elementList = this.parseClassElementList();
108679 return this.finalize(node, new Node.ClassBody(elementList));
108680 };
108681 Parser.prototype.parseClassDeclaration = function (identifierIsOptional) {
108682 var node = this.createNode();
108683 var previousStrict = this.context.strict;
108684 this.context.strict = true;
108685 this.expectKeyword('class');
108686 var id = (identifierIsOptional && (this.lookahead.type !== 3 /* Identifier */)) ? null : this.parseVariableIdentifier();
108687 var superClass = null;
108688 if (this.matchKeyword('extends')) {
108689 this.nextToken();
108690 superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
108691 }
108692 var classBody = this.parseClassBody();
108693 this.context.strict = previousStrict;
108694 return this.finalize(node, new Node.ClassDeclaration(id, superClass, classBody));
108695 };
108696 Parser.prototype.parseClassExpression = function () {
108697 var node = this.createNode();
108698 var previousStrict = this.context.strict;
108699 this.context.strict = true;
108700 this.expectKeyword('class');
108701 var id = (this.lookahead.type === 3 /* Identifier */) ? this.parseVariableIdentifier() : null;
108702 var superClass = null;
108703 if (this.matchKeyword('extends')) {
108704 this.nextToken();
108705 superClass = this.isolateCoverGrammar(this.parseLeftHandSideExpressionAllowCall);
108706 }
108707 var classBody = this.parseClassBody();
108708 this.context.strict = previousStrict;
108709 return this.finalize(node, new Node.ClassExpression(id, superClass, classBody));
108710 };
108711 // https://tc39.github.io/ecma262/#sec-scripts
108712 // https://tc39.github.io/ecma262/#sec-modules
108713 Parser.prototype.parseModule = function () {
108714 this.context.strict = true;
108715 this.context.isModule = true;
108716 this.scanner.isModule = true;
108717 var node = this.createNode();
108718 var body = this.parseDirectivePrologues();
108719 while (this.lookahead.type !== 2 /* EOF */) {
108720 body.push(this.parseStatementListItem());
108721 }
108722 return this.finalize(node, new Node.Module(body));
108723 };
108724 Parser.prototype.parseScript = function () {
108725 var node = this.createNode();
108726 var body = this.parseDirectivePrologues();
108727 while (this.lookahead.type !== 2 /* EOF */) {
108728 body.push(this.parseStatementListItem());
108729 }
108730 return this.finalize(node, new Node.Script(body));
108731 };
108732 // https://tc39.github.io/ecma262/#sec-imports
108733 Parser.prototype.parseModuleSpecifier = function () {
108734 var node = this.createNode();
108735 if (this.lookahead.type !== 8 /* StringLiteral */) {
108736 this.throwError(messages_1.Messages.InvalidModuleSpecifier);
108737 }
108738 var token = this.nextToken();
108739 var raw = this.getTokenRaw(token);
108740 return this.finalize(node, new Node.Literal(token.value, raw));
108741 };
108742 // import {<foo as bar>} ...;
108743 Parser.prototype.parseImportSpecifier = function () {
108744 var node = this.createNode();
108745 var imported;
108746 var local;
108747 if (this.lookahead.type === 3 /* Identifier */) {
108748 imported = this.parseVariableIdentifier();
108749 local = imported;
108750 if (this.matchContextualKeyword('as')) {
108751 this.nextToken();
108752 local = this.parseVariableIdentifier();
108753 }
108754 }
108755 else {
108756 imported = this.parseIdentifierName();
108757 local = imported;
108758 if (this.matchContextualKeyword('as')) {
108759 this.nextToken();
108760 local = this.parseVariableIdentifier();
108761 }
108762 else {
108763 this.throwUnexpectedToken(this.nextToken());
108764 }
108765 }
108766 return this.finalize(node, new Node.ImportSpecifier(local, imported));
108767 };
108768 // {foo, bar as bas}
108769 Parser.prototype.parseNamedImports = function () {
108770 this.expect('{');
108771 var specifiers = [];
108772 while (!this.match('}')) {
108773 specifiers.push(this.parseImportSpecifier());
108774 if (!this.match('}')) {
108775 this.expect(',');
108776 }
108777 }
108778 this.expect('}');
108779 return specifiers;
108780 };
108781 // import <foo> ...;
108782 Parser.prototype.parseImportDefaultSpecifier = function () {
108783 var node = this.createNode();
108784 var local = this.parseIdentifierName();
108785 return this.finalize(node, new Node.ImportDefaultSpecifier(local));
108786 };
108787 // import <* as foo> ...;
108788 Parser.prototype.parseImportNamespaceSpecifier = function () {
108789 var node = this.createNode();
108790 this.expect('*');
108791 if (!this.matchContextualKeyword('as')) {
108792 this.throwError(messages_1.Messages.NoAsAfterImportNamespace);
108793 }
108794 this.nextToken();
108795 var local = this.parseIdentifierName();
108796 return this.finalize(node, new Node.ImportNamespaceSpecifier(local));
108797 };
108798 Parser.prototype.parseImportDeclaration = function () {
108799 if (this.context.inFunctionBody) {
108800 this.throwError(messages_1.Messages.IllegalImportDeclaration);
108801 }
108802 var node = this.createNode();
108803 this.expectKeyword('import');
108804 var src;
108805 var specifiers = [];
108806 if (this.lookahead.type === 8 /* StringLiteral */) {
108807 // import 'foo';
108808 src = this.parseModuleSpecifier();
108809 }
108810 else {
108811 if (this.match('{')) {
108812 // import {bar}
108813 specifiers = specifiers.concat(this.parseNamedImports());
108814 }
108815 else if (this.match('*')) {
108816 // import * as foo
108817 specifiers.push(this.parseImportNamespaceSpecifier());
108818 }
108819 else if (this.isIdentifierName(this.lookahead) && !this.matchKeyword('default')) {
108820 // import foo
108821 specifiers.push(this.parseImportDefaultSpecifier());
108822 if (this.match(',')) {
108823 this.nextToken();
108824 if (this.match('*')) {
108825 // import foo, * as foo
108826 specifiers.push(this.parseImportNamespaceSpecifier());
108827 }
108828 else if (this.match('{')) {
108829 // import foo, {bar}
108830 specifiers = specifiers.concat(this.parseNamedImports());
108831 }
108832 else {
108833 this.throwUnexpectedToken(this.lookahead);
108834 }
108835 }
108836 }
108837 else {
108838 this.throwUnexpectedToken(this.nextToken());
108839 }
108840 if (!this.matchContextualKeyword('from')) {
108841 var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
108842 this.throwError(message, this.lookahead.value);
108843 }
108844 this.nextToken();
108845 src = this.parseModuleSpecifier();
108846 }
108847 this.consumeSemicolon();
108848 return this.finalize(node, new Node.ImportDeclaration(specifiers, src));
108849 };
108850 // https://tc39.github.io/ecma262/#sec-exports
108851 Parser.prototype.parseExportSpecifier = function () {
108852 var node = this.createNode();
108853 var local = this.parseIdentifierName();
108854 var exported = local;
108855 if (this.matchContextualKeyword('as')) {
108856 this.nextToken();
108857 exported = this.parseIdentifierName();
108858 }
108859 return this.finalize(node, new Node.ExportSpecifier(local, exported));
108860 };
108861 Parser.prototype.parseExportDeclaration = function () {
108862 if (this.context.inFunctionBody) {
108863 this.throwError(messages_1.Messages.IllegalExportDeclaration);
108864 }
108865 var node = this.createNode();
108866 this.expectKeyword('export');
108867 var exportDeclaration;
108868 if (this.matchKeyword('default')) {
108869 // export default ...
108870 this.nextToken();
108871 if (this.matchKeyword('function')) {
108872 // export default function foo () {}
108873 // export default function () {}
108874 var declaration = this.parseFunctionDeclaration(true);
108875 exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
108876 }
108877 else if (this.matchKeyword('class')) {
108878 // export default class foo {}
108879 var declaration = this.parseClassDeclaration(true);
108880 exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
108881 }
108882 else if (this.matchContextualKeyword('async')) {
108883 // export default async function f () {}
108884 // export default async function () {}
108885 // export default async x => x
108886 var declaration = this.matchAsyncFunction() ? this.parseFunctionDeclaration(true) : this.parseAssignmentExpression();
108887 exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
108888 }
108889 else {
108890 if (this.matchContextualKeyword('from')) {
108891 this.throwError(messages_1.Messages.UnexpectedToken, this.lookahead.value);
108892 }
108893 // export default {};
108894 // export default [];
108895 // export default (1 + 2);
108896 var declaration = this.match('{') ? this.parseObjectInitializer() :
108897 this.match('[') ? this.parseArrayInitializer() : this.parseAssignmentExpression();
108898 this.consumeSemicolon();
108899 exportDeclaration = this.finalize(node, new Node.ExportDefaultDeclaration(declaration));
108900 }
108901 }
108902 else if (this.match('*')) {
108903 // export * from 'foo';
108904 this.nextToken();
108905 if (!this.matchContextualKeyword('from')) {
108906 var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
108907 this.throwError(message, this.lookahead.value);
108908 }
108909 this.nextToken();
108910 var src = this.parseModuleSpecifier();
108911 this.consumeSemicolon();
108912 exportDeclaration = this.finalize(node, new Node.ExportAllDeclaration(src));
108913 }
108914 else if (this.lookahead.type === 4 /* Keyword */) {
108915 // export var f = 1;
108916 var declaration = void 0;
108917 switch (this.lookahead.value) {
108918 case 'let':
108919 case 'const':
108920 declaration = this.parseLexicalDeclaration({ inFor: false });
108921 break;
108922 case 'var':
108923 case 'class':
108924 case 'function':
108925 declaration = this.parseStatementListItem();
108926 break;
108927 default:
108928 this.throwUnexpectedToken(this.lookahead);
108929 }
108930 exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null));
108931 }
108932 else if (this.matchAsyncFunction()) {
108933 var declaration = this.parseFunctionDeclaration();
108934 exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(declaration, [], null));
108935 }
108936 else {
108937 var specifiers = [];
108938 var source = null;
108939 var isExportFromIdentifier = false;
108940 this.expect('{');
108941 while (!this.match('}')) {
108942 isExportFromIdentifier = isExportFromIdentifier || this.matchKeyword('default');
108943 specifiers.push(this.parseExportSpecifier());
108944 if (!this.match('}')) {
108945 this.expect(',');
108946 }
108947 }
108948 this.expect('}');
108949 if (this.matchContextualKeyword('from')) {
108950 // export {default} from 'foo';
108951 // export {foo} from 'foo';
108952 this.nextToken();
108953 source = this.parseModuleSpecifier();
108954 this.consumeSemicolon();
108955 }
108956 else if (isExportFromIdentifier) {
108957 // export {default}; // missing fromClause
108958 var message = this.lookahead.value ? messages_1.Messages.UnexpectedToken : messages_1.Messages.MissingFromClause;
108959 this.throwError(message, this.lookahead.value);
108960 }
108961 else {
108962 // export {foo};
108963 this.consumeSemicolon();
108964 }
108965 exportDeclaration = this.finalize(node, new Node.ExportNamedDeclaration(null, specifiers, source));
108966 }
108967 return exportDeclaration;
108968 };
108969 return Parser;
108970 }());
108971 exports.Parser = Parser;
108972
108973
108974/***/ },
108975/* 9 */
108976/***/ function(module, exports) {
108977
108978 "use strict";
108979 // Ensure the condition is true, otherwise throw an error.
108980 // This is only to have a better contract semantic, i.e. another safety net
108981 // to catch a logic error. The condition shall be fulfilled in normal case.
108982 // Do NOT use this to enforce a certain condition on any user input.
108983 Object.defineProperty(exports, "__esModule", { value: true });
108984 function assert(condition, message) {
108985 /* istanbul ignore if */
108986 if (!condition) {
108987 throw new Error('ASSERT: ' + message);
108988 }
108989 }
108990 exports.assert = assert;
108991
108992
108993/***/ },
108994/* 10 */
108995/***/ function(module, exports) {
108996
108997 "use strict";
108998 /* tslint:disable:max-classes-per-file */
108999 Object.defineProperty(exports, "__esModule", { value: true });
109000 var ErrorHandler = (function () {
109001 function ErrorHandler() {
109002 this.errors = [];
109003 this.tolerant = false;
109004 }
109005 ErrorHandler.prototype.recordError = function (error) {
109006 this.errors.push(error);
109007 };
109008 ErrorHandler.prototype.tolerate = function (error) {
109009 if (this.tolerant) {
109010 this.recordError(error);
109011 }
109012 else {
109013 throw error;
109014 }
109015 };
109016 ErrorHandler.prototype.constructError = function (msg, column) {
109017 var error = new Error(msg);
109018 try {
109019 throw error;
109020 }
109021 catch (base) {
109022 /* istanbul ignore else */
109023 if (Object.create && Object.defineProperty) {
109024 error = Object.create(base);
109025 Object.defineProperty(error, 'column', { value: column });
109026 }
109027 }
109028 /* istanbul ignore next */
109029 return error;
109030 };
109031 ErrorHandler.prototype.createError = function (index, line, col, description) {
109032 var msg = 'Line ' + line + ': ' + description;
109033 var error = this.constructError(msg, col);
109034 error.index = index;
109035 error.lineNumber = line;
109036 error.description = description;
109037 return error;
109038 };
109039 ErrorHandler.prototype.throwError = function (index, line, col, description) {
109040 throw this.createError(index, line, col, description);
109041 };
109042 ErrorHandler.prototype.tolerateError = function (index, line, col, description) {
109043 var error = this.createError(index, line, col, description);
109044 if (this.tolerant) {
109045 this.recordError(error);
109046 }
109047 else {
109048 throw error;
109049 }
109050 };
109051 return ErrorHandler;
109052 }());
109053 exports.ErrorHandler = ErrorHandler;
109054
109055
109056/***/ },
109057/* 11 */
109058/***/ function(module, exports) {
109059
109060 "use strict";
109061 Object.defineProperty(exports, "__esModule", { value: true });
109062 // Error messages should be identical to V8.
109063 exports.Messages = {
109064 BadGetterArity: 'Getter must not have any formal parameters',
109065 BadSetterArity: 'Setter must have exactly one formal parameter',
109066 BadSetterRestParameter: 'Setter function argument must not be a rest parameter',
109067 ConstructorIsAsync: 'Class constructor may not be an async method',
109068 ConstructorSpecialMethod: 'Class constructor may not be an accessor',
109069 DeclarationMissingInitializer: 'Missing initializer in %0 declaration',
109070 DefaultRestParameter: 'Unexpected token =',
109071 DuplicateBinding: 'Duplicate binding %0',
109072 DuplicateConstructor: 'A class may only have one constructor',
109073 DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals',
109074 ForInOfLoopInitializer: '%0 loop variable declaration may not have an initializer',
109075 GeneratorInLegacyContext: 'Generator declarations are not allowed in legacy contexts',
109076 IllegalBreak: 'Illegal break statement',
109077 IllegalContinue: 'Illegal continue statement',
109078 IllegalExportDeclaration: 'Unexpected token',
109079 IllegalImportDeclaration: 'Unexpected token',
109080 IllegalLanguageModeDirective: 'Illegal \'use strict\' directive in function with non-simple parameter list',
109081 IllegalReturn: 'Illegal return statement',
109082 InvalidEscapedReservedWord: 'Keyword must not contain escaped characters',
109083 InvalidHexEscapeSequence: 'Invalid hexadecimal escape sequence',
109084 InvalidLHSInAssignment: 'Invalid left-hand side in assignment',
109085 InvalidLHSInForIn: 'Invalid left-hand side in for-in',
109086 InvalidLHSInForLoop: 'Invalid left-hand side in for-loop',
109087 InvalidModuleSpecifier: 'Unexpected token',
109088 InvalidRegExp: 'Invalid regular expression',
109089 LetInLexicalBinding: 'let is disallowed as a lexically bound name',
109090 MissingFromClause: 'Unexpected token',
109091 MultipleDefaultsInSwitch: 'More than one default clause in switch statement',
109092 NewlineAfterThrow: 'Illegal newline after throw',
109093 NoAsAfterImportNamespace: 'Unexpected token',
109094 NoCatchOrFinally: 'Missing catch or finally after try',
109095 ParameterAfterRestParameter: 'Rest parameter must be last formal parameter',
109096 Redeclaration: '%0 \'%1\' has already been declared',
109097 StaticPrototype: 'Classes may not have static property named prototype',
109098 StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
109099 StrictDelete: 'Delete of an unqualified identifier in strict mode.',
109100 StrictFunction: 'In strict mode code, functions can only be declared at top level or inside a block',
109101 StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
109102 StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
109103 StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
109104 StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
109105 StrictModeWith: 'Strict mode code may not include a with statement',
109106 StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
109107 StrictParamDupe: 'Strict mode function may not have duplicate parameter names',
109108 StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
109109 StrictReservedWord: 'Use of future reserved word in strict mode',
109110 StrictVarName: 'Variable name may not be eval or arguments in strict mode',
109111 TemplateOctalLiteral: 'Octal literals are not allowed in template strings.',
109112 UnexpectedEOS: 'Unexpected end of input',
109113 UnexpectedIdentifier: 'Unexpected identifier',
109114 UnexpectedNumber: 'Unexpected number',
109115 UnexpectedReserved: 'Unexpected reserved word',
109116 UnexpectedString: 'Unexpected string',
109117 UnexpectedTemplate: 'Unexpected quasi %0',
109118 UnexpectedToken: 'Unexpected token %0',
109119 UnexpectedTokenIllegal: 'Unexpected token ILLEGAL',
109120 UnknownLabel: 'Undefined label \'%0\'',
109121 UnterminatedRegExp: 'Invalid regular expression: missing /'
109122 };
109123
109124
109125/***/ },
109126/* 12 */
109127/***/ function(module, exports, __webpack_require__) {
109128
109129 "use strict";
109130 Object.defineProperty(exports, "__esModule", { value: true });
109131 var assert_1 = __webpack_require__(9);
109132 var character_1 = __webpack_require__(4);
109133 var messages_1 = __webpack_require__(11);
109134 function hexValue(ch) {
109135 return '0123456789abcdef'.indexOf(ch.toLowerCase());
109136 }
109137 function octalValue(ch) {
109138 return '01234567'.indexOf(ch);
109139 }
109140 var Scanner = (function () {
109141 function Scanner(code, handler) {
109142 this.source = code;
109143 this.errorHandler = handler;
109144 this.trackComment = false;
109145 this.isModule = false;
109146 this.length = code.length;
109147 this.index = 0;
109148 this.lineNumber = (code.length > 0) ? 1 : 0;
109149 this.lineStart = 0;
109150 this.curlyStack = [];
109151 }
109152 Scanner.prototype.saveState = function () {
109153 return {
109154 index: this.index,
109155 lineNumber: this.lineNumber,
109156 lineStart: this.lineStart
109157 };
109158 };
109159 Scanner.prototype.restoreState = function (state) {
109160 this.index = state.index;
109161 this.lineNumber = state.lineNumber;
109162 this.lineStart = state.lineStart;
109163 };
109164 Scanner.prototype.eof = function () {
109165 return this.index >= this.length;
109166 };
109167 Scanner.prototype.throwUnexpectedToken = function (message) {
109168 if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; }
109169 return this.errorHandler.throwError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
109170 };
109171 Scanner.prototype.tolerateUnexpectedToken = function (message) {
109172 if (message === void 0) { message = messages_1.Messages.UnexpectedTokenIllegal; }
109173 this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
109174 };
109175 // https://tc39.github.io/ecma262/#sec-comments
109176 Scanner.prototype.skipSingleLineComment = function (offset) {
109177 var comments = [];
109178 var start, loc;
109179 if (this.trackComment) {
109180 comments = [];
109181 start = this.index - offset;
109182 loc = {
109183 start: {
109184 line: this.lineNumber,
109185 column: this.index - this.lineStart - offset
109186 },
109187 end: {}
109188 };
109189 }
109190 while (!this.eof()) {
109191 var ch = this.source.charCodeAt(this.index);
109192 ++this.index;
109193 if (character_1.Character.isLineTerminator(ch)) {
109194 if (this.trackComment) {
109195 loc.end = {
109196 line: this.lineNumber,
109197 column: this.index - this.lineStart - 1
109198 };
109199 var entry = {
109200 multiLine: false,
109201 slice: [start + offset, this.index - 1],
109202 range: [start, this.index - 1],
109203 loc: loc
109204 };
109205 comments.push(entry);
109206 }
109207 if (ch === 13 && this.source.charCodeAt(this.index) === 10) {
109208 ++this.index;
109209 }
109210 ++this.lineNumber;
109211 this.lineStart = this.index;
109212 return comments;
109213 }
109214 }
109215 if (this.trackComment) {
109216 loc.end = {
109217 line: this.lineNumber,
109218 column: this.index - this.lineStart
109219 };
109220 var entry = {
109221 multiLine: false,
109222 slice: [start + offset, this.index],
109223 range: [start, this.index],
109224 loc: loc
109225 };
109226 comments.push(entry);
109227 }
109228 return comments;
109229 };
109230 Scanner.prototype.skipMultiLineComment = function () {
109231 var comments = [];
109232 var start, loc;
109233 if (this.trackComment) {
109234 comments = [];
109235 start = this.index - 2;
109236 loc = {
109237 start: {
109238 line: this.lineNumber,
109239 column: this.index - this.lineStart - 2
109240 },
109241 end: {}
109242 };
109243 }
109244 while (!this.eof()) {
109245 var ch = this.source.charCodeAt(this.index);
109246 if (character_1.Character.isLineTerminator(ch)) {
109247 if (ch === 0x0D && this.source.charCodeAt(this.index + 1) === 0x0A) {
109248 ++this.index;
109249 }
109250 ++this.lineNumber;
109251 ++this.index;
109252 this.lineStart = this.index;
109253 }
109254 else if (ch === 0x2A) {
109255 // Block comment ends with '*/'.
109256 if (this.source.charCodeAt(this.index + 1) === 0x2F) {
109257 this.index += 2;
109258 if (this.trackComment) {
109259 loc.end = {
109260 line: this.lineNumber,
109261 column: this.index - this.lineStart
109262 };
109263 var entry = {
109264 multiLine: true,
109265 slice: [start + 2, this.index - 2],
109266 range: [start, this.index],
109267 loc: loc
109268 };
109269 comments.push(entry);
109270 }
109271 return comments;
109272 }
109273 ++this.index;
109274 }
109275 else {
109276 ++this.index;
109277 }
109278 }
109279 // Ran off the end of the file - the whole thing is a comment
109280 if (this.trackComment) {
109281 loc.end = {
109282 line: this.lineNumber,
109283 column: this.index - this.lineStart
109284 };
109285 var entry = {
109286 multiLine: true,
109287 slice: [start + 2, this.index],
109288 range: [start, this.index],
109289 loc: loc
109290 };
109291 comments.push(entry);
109292 }
109293 this.tolerateUnexpectedToken();
109294 return comments;
109295 };
109296 Scanner.prototype.scanComments = function () {
109297 var comments;
109298 if (this.trackComment) {
109299 comments = [];
109300 }
109301 var start = (this.index === 0);
109302 while (!this.eof()) {
109303 var ch = this.source.charCodeAt(this.index);
109304 if (character_1.Character.isWhiteSpace(ch)) {
109305 ++this.index;
109306 }
109307 else if (character_1.Character.isLineTerminator(ch)) {
109308 ++this.index;
109309 if (ch === 0x0D && this.source.charCodeAt(this.index) === 0x0A) {
109310 ++this.index;
109311 }
109312 ++this.lineNumber;
109313 this.lineStart = this.index;
109314 start = true;
109315 }
109316 else if (ch === 0x2F) {
109317 ch = this.source.charCodeAt(this.index + 1);
109318 if (ch === 0x2F) {
109319 this.index += 2;
109320 var comment = this.skipSingleLineComment(2);
109321 if (this.trackComment) {
109322 comments = comments.concat(comment);
109323 }
109324 start = true;
109325 }
109326 else if (ch === 0x2A) {
109327 this.index += 2;
109328 var comment = this.skipMultiLineComment();
109329 if (this.trackComment) {
109330 comments = comments.concat(comment);
109331 }
109332 }
109333 else {
109334 break;
109335 }
109336 }
109337 else if (start && ch === 0x2D) {
109338 // U+003E is '>'
109339 if ((this.source.charCodeAt(this.index + 1) === 0x2D) && (this.source.charCodeAt(this.index + 2) === 0x3E)) {
109340 // '-->' is a single-line comment
109341 this.index += 3;
109342 var comment = this.skipSingleLineComment(3);
109343 if (this.trackComment) {
109344 comments = comments.concat(comment);
109345 }
109346 }
109347 else {
109348 break;
109349 }
109350 }
109351 else if (ch === 0x3C && !this.isModule) {
109352 if (this.source.slice(this.index + 1, this.index + 4) === '!--') {
109353 this.index += 4; // `<!--`
109354 var comment = this.skipSingleLineComment(4);
109355 if (this.trackComment) {
109356 comments = comments.concat(comment);
109357 }
109358 }
109359 else {
109360 break;
109361 }
109362 }
109363 else {
109364 break;
109365 }
109366 }
109367 return comments;
109368 };
109369 // https://tc39.github.io/ecma262/#sec-future-reserved-words
109370 Scanner.prototype.isFutureReservedWord = function (id) {
109371 switch (id) {
109372 case 'enum':
109373 case 'export':
109374 case 'import':
109375 case 'super':
109376 return true;
109377 default:
109378 return false;
109379 }
109380 };
109381 Scanner.prototype.isStrictModeReservedWord = function (id) {
109382 switch (id) {
109383 case 'implements':
109384 case 'interface':
109385 case 'package':
109386 case 'private':
109387 case 'protected':
109388 case 'public':
109389 case 'static':
109390 case 'yield':
109391 case 'let':
109392 return true;
109393 default:
109394 return false;
109395 }
109396 };
109397 Scanner.prototype.isRestrictedWord = function (id) {
109398 return id === 'eval' || id === 'arguments';
109399 };
109400 // https://tc39.github.io/ecma262/#sec-keywords
109401 Scanner.prototype.isKeyword = function (id) {
109402 switch (id.length) {
109403 case 2:
109404 return (id === 'if') || (id === 'in') || (id === 'do');
109405 case 3:
109406 return (id === 'var') || (id === 'for') || (id === 'new') ||
109407 (id === 'try') || (id === 'let');
109408 case 4:
109409 return (id === 'this') || (id === 'else') || (id === 'case') ||
109410 (id === 'void') || (id === 'with') || (id === 'enum');
109411 case 5:
109412 return (id === 'while') || (id === 'break') || (id === 'catch') ||
109413 (id === 'throw') || (id === 'const') || (id === 'yield') ||
109414 (id === 'class') || (id === 'super');
109415 case 6:
109416 return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
109417 (id === 'switch') || (id === 'export') || (id === 'import');
109418 case 7:
109419 return (id === 'default') || (id === 'finally') || (id === 'extends');
109420 case 8:
109421 return (id === 'function') || (id === 'continue') || (id === 'debugger');
109422 case 10:
109423 return (id === 'instanceof');
109424 default:
109425 return false;
109426 }
109427 };
109428 Scanner.prototype.codePointAt = function (i) {
109429 var cp = this.source.charCodeAt(i);
109430 if (cp >= 0xD800 && cp <= 0xDBFF) {
109431 var second = this.source.charCodeAt(i + 1);
109432 if (second >= 0xDC00 && second <= 0xDFFF) {
109433 var first = cp;
109434 cp = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
109435 }
109436 }
109437 return cp;
109438 };
109439 Scanner.prototype.scanHexEscape = function (prefix) {
109440 var len = (prefix === 'u') ? 4 : 2;
109441 var code = 0;
109442 for (var i = 0; i < len; ++i) {
109443 if (!this.eof() && character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
109444 code = code * 16 + hexValue(this.source[this.index++]);
109445 }
109446 else {
109447 return null;
109448 }
109449 }
109450 return String.fromCharCode(code);
109451 };
109452 Scanner.prototype.scanUnicodeCodePointEscape = function () {
109453 var ch = this.source[this.index];
109454 var code = 0;
109455 // At least, one hex digit is required.
109456 if (ch === '}') {
109457 this.throwUnexpectedToken();
109458 }
109459 while (!this.eof()) {
109460 ch = this.source[this.index++];
109461 if (!character_1.Character.isHexDigit(ch.charCodeAt(0))) {
109462 break;
109463 }
109464 code = code * 16 + hexValue(ch);
109465 }
109466 if (code > 0x10FFFF || ch !== '}') {
109467 this.throwUnexpectedToken();
109468 }
109469 return character_1.Character.fromCodePoint(code);
109470 };
109471 Scanner.prototype.getIdentifier = function () {
109472 var start = this.index++;
109473 while (!this.eof()) {
109474 var ch = this.source.charCodeAt(this.index);
109475 if (ch === 0x5C) {
109476 // Blackslash (U+005C) marks Unicode escape sequence.
109477 this.index = start;
109478 return this.getComplexIdentifier();
109479 }
109480 else if (ch >= 0xD800 && ch < 0xDFFF) {
109481 // Need to handle surrogate pairs.
109482 this.index = start;
109483 return this.getComplexIdentifier();
109484 }
109485 if (character_1.Character.isIdentifierPart(ch)) {
109486 ++this.index;
109487 }
109488 else {
109489 break;
109490 }
109491 }
109492 return this.source.slice(start, this.index);
109493 };
109494 Scanner.prototype.getComplexIdentifier = function () {
109495 var cp = this.codePointAt(this.index);
109496 var id = character_1.Character.fromCodePoint(cp);
109497 this.index += id.length;
109498 // '\u' (U+005C, U+0075) denotes an escaped character.
109499 var ch;
109500 if (cp === 0x5C) {
109501 if (this.source.charCodeAt(this.index) !== 0x75) {
109502 this.throwUnexpectedToken();
109503 }
109504 ++this.index;
109505 if (this.source[this.index] === '{') {
109506 ++this.index;
109507 ch = this.scanUnicodeCodePointEscape();
109508 }
109509 else {
109510 ch = this.scanHexEscape('u');
109511 if (ch === null || ch === '\\' || !character_1.Character.isIdentifierStart(ch.charCodeAt(0))) {
109512 this.throwUnexpectedToken();
109513 }
109514 }
109515 id = ch;
109516 }
109517 while (!this.eof()) {
109518 cp = this.codePointAt(this.index);
109519 if (!character_1.Character.isIdentifierPart(cp)) {
109520 break;
109521 }
109522 ch = character_1.Character.fromCodePoint(cp);
109523 id += ch;
109524 this.index += ch.length;
109525 // '\u' (U+005C, U+0075) denotes an escaped character.
109526 if (cp === 0x5C) {
109527 id = id.substr(0, id.length - 1);
109528 if (this.source.charCodeAt(this.index) !== 0x75) {
109529 this.throwUnexpectedToken();
109530 }
109531 ++this.index;
109532 if (this.source[this.index] === '{') {
109533 ++this.index;
109534 ch = this.scanUnicodeCodePointEscape();
109535 }
109536 else {
109537 ch = this.scanHexEscape('u');
109538 if (ch === null || ch === '\\' || !character_1.Character.isIdentifierPart(ch.charCodeAt(0))) {
109539 this.throwUnexpectedToken();
109540 }
109541 }
109542 id += ch;
109543 }
109544 }
109545 return id;
109546 };
109547 Scanner.prototype.octalToDecimal = function (ch) {
109548 // \0 is not octal escape sequence
109549 var octal = (ch !== '0');
109550 var code = octalValue(ch);
109551 if (!this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
109552 octal = true;
109553 code = code * 8 + octalValue(this.source[this.index++]);
109554 // 3 digits are only allowed when string starts
109555 // with 0, 1, 2, 3
109556 if ('0123'.indexOf(ch) >= 0 && !this.eof() && character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
109557 code = code * 8 + octalValue(this.source[this.index++]);
109558 }
109559 }
109560 return {
109561 code: code,
109562 octal: octal
109563 };
109564 };
109565 // https://tc39.github.io/ecma262/#sec-names-and-keywords
109566 Scanner.prototype.scanIdentifier = function () {
109567 var type;
109568 var start = this.index;
109569 // Backslash (U+005C) starts an escaped character.
109570 var id = (this.source.charCodeAt(start) === 0x5C) ? this.getComplexIdentifier() : this.getIdentifier();
109571 // There is no keyword or literal with only one character.
109572 // Thus, it must be an identifier.
109573 if (id.length === 1) {
109574 type = 3 /* Identifier */;
109575 }
109576 else if (this.isKeyword(id)) {
109577 type = 4 /* Keyword */;
109578 }
109579 else if (id === 'null') {
109580 type = 5 /* NullLiteral */;
109581 }
109582 else if (id === 'true' || id === 'false') {
109583 type = 1 /* BooleanLiteral */;
109584 }
109585 else {
109586 type = 3 /* Identifier */;
109587 }
109588 if (type !== 3 /* Identifier */ && (start + id.length !== this.index)) {
109589 var restore = this.index;
109590 this.index = start;
109591 this.tolerateUnexpectedToken(messages_1.Messages.InvalidEscapedReservedWord);
109592 this.index = restore;
109593 }
109594 return {
109595 type: type,
109596 value: id,
109597 lineNumber: this.lineNumber,
109598 lineStart: this.lineStart,
109599 start: start,
109600 end: this.index
109601 };
109602 };
109603 // https://tc39.github.io/ecma262/#sec-punctuators
109604 Scanner.prototype.scanPunctuator = function () {
109605 var start = this.index;
109606 // Check for most common single-character punctuators.
109607 var str = this.source[this.index];
109608 switch (str) {
109609 case '(':
109610 case '{':
109611 if (str === '{') {
109612 this.curlyStack.push('{');
109613 }
109614 ++this.index;
109615 break;
109616 case '.':
109617 ++this.index;
109618 if (this.source[this.index] === '.' && this.source[this.index + 1] === '.') {
109619 // Spread operator: ...
109620 this.index += 2;
109621 str = '...';
109622 }
109623 break;
109624 case '}':
109625 ++this.index;
109626 this.curlyStack.pop();
109627 break;
109628 case ')':
109629 case ';':
109630 case ',':
109631 case '[':
109632 case ']':
109633 case ':':
109634 case '?':
109635 case '~':
109636 ++this.index;
109637 break;
109638 default:
109639 // 4-character punctuator.
109640 str = this.source.substr(this.index, 4);
109641 if (str === '>>>=') {
109642 this.index += 4;
109643 }
109644 else {
109645 // 3-character punctuators.
109646 str = str.substr(0, 3);
109647 if (str === '===' || str === '!==' || str === '>>>' ||
109648 str === '<<=' || str === '>>=' || str === '**=') {
109649 this.index += 3;
109650 }
109651 else {
109652 // 2-character punctuators.
109653 str = str.substr(0, 2);
109654 if (str === '&&' || str === '||' || str === '==' || str === '!=' ||
109655 str === '+=' || str === '-=' || str === '*=' || str === '/=' ||
109656 str === '++' || str === '--' || str === '<<' || str === '>>' ||
109657 str === '&=' || str === '|=' || str === '^=' || str === '%=' ||
109658 str === '<=' || str === '>=' || str === '=>' || str === '**') {
109659 this.index += 2;
109660 }
109661 else {
109662 // 1-character punctuators.
109663 str = this.source[this.index];
109664 if ('<>=!+-*%&|^/'.indexOf(str) >= 0) {
109665 ++this.index;
109666 }
109667 }
109668 }
109669 }
109670 }
109671 if (this.index === start) {
109672 this.throwUnexpectedToken();
109673 }
109674 return {
109675 type: 7 /* Punctuator */,
109676 value: str,
109677 lineNumber: this.lineNumber,
109678 lineStart: this.lineStart,
109679 start: start,
109680 end: this.index
109681 };
109682 };
109683 // https://tc39.github.io/ecma262/#sec-literals-numeric-literals
109684 Scanner.prototype.scanHexLiteral = function (start) {
109685 var num = '';
109686 while (!this.eof()) {
109687 if (!character_1.Character.isHexDigit(this.source.charCodeAt(this.index))) {
109688 break;
109689 }
109690 num += this.source[this.index++];
109691 }
109692 if (num.length === 0) {
109693 this.throwUnexpectedToken();
109694 }
109695 if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
109696 this.throwUnexpectedToken();
109697 }
109698 return {
109699 type: 6 /* NumericLiteral */,
109700 value: parseInt('0x' + num, 16),
109701 lineNumber: this.lineNumber,
109702 lineStart: this.lineStart,
109703 start: start,
109704 end: this.index
109705 };
109706 };
109707 Scanner.prototype.scanBinaryLiteral = function (start) {
109708 var num = '';
109709 var ch;
109710 while (!this.eof()) {
109711 ch = this.source[this.index];
109712 if (ch !== '0' && ch !== '1') {
109713 break;
109714 }
109715 num += this.source[this.index++];
109716 }
109717 if (num.length === 0) {
109718 // only 0b or 0B
109719 this.throwUnexpectedToken();
109720 }
109721 if (!this.eof()) {
109722 ch = this.source.charCodeAt(this.index);
109723 /* istanbul ignore else */
109724 if (character_1.Character.isIdentifierStart(ch) || character_1.Character.isDecimalDigit(ch)) {
109725 this.throwUnexpectedToken();
109726 }
109727 }
109728 return {
109729 type: 6 /* NumericLiteral */,
109730 value: parseInt(num, 2),
109731 lineNumber: this.lineNumber,
109732 lineStart: this.lineStart,
109733 start: start,
109734 end: this.index
109735 };
109736 };
109737 Scanner.prototype.scanOctalLiteral = function (prefix, start) {
109738 var num = '';
109739 var octal = false;
109740 if (character_1.Character.isOctalDigit(prefix.charCodeAt(0))) {
109741 octal = true;
109742 num = '0' + this.source[this.index++];
109743 }
109744 else {
109745 ++this.index;
109746 }
109747 while (!this.eof()) {
109748 if (!character_1.Character.isOctalDigit(this.source.charCodeAt(this.index))) {
109749 break;
109750 }
109751 num += this.source[this.index++];
109752 }
109753 if (!octal && num.length === 0) {
109754 // only 0o or 0O
109755 this.throwUnexpectedToken();
109756 }
109757 if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index)) || character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
109758 this.throwUnexpectedToken();
109759 }
109760 return {
109761 type: 6 /* NumericLiteral */,
109762 value: parseInt(num, 8),
109763 octal: octal,
109764 lineNumber: this.lineNumber,
109765 lineStart: this.lineStart,
109766 start: start,
109767 end: this.index
109768 };
109769 };
109770 Scanner.prototype.isImplicitOctalLiteral = function () {
109771 // Implicit octal, unless there is a non-octal digit.
109772 // (Annex B.1.1 on Numeric Literals)
109773 for (var i = this.index + 1; i < this.length; ++i) {
109774 var ch = this.source[i];
109775 if (ch === '8' || ch === '9') {
109776 return false;
109777 }
109778 if (!character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
109779 return true;
109780 }
109781 }
109782 return true;
109783 };
109784 Scanner.prototype.scanNumericLiteral = function () {
109785 var start = this.index;
109786 var ch = this.source[start];
109787 assert_1.assert(character_1.Character.isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'), 'Numeric literal must start with a decimal digit or a decimal point');
109788 var num = '';
109789 if (ch !== '.') {
109790 num = this.source[this.index++];
109791 ch = this.source[this.index];
109792 // Hex number starts with '0x'.
109793 // Octal number starts with '0'.
109794 // Octal number in ES6 starts with '0o'.
109795 // Binary number in ES6 starts with '0b'.
109796 if (num === '0') {
109797 if (ch === 'x' || ch === 'X') {
109798 ++this.index;
109799 return this.scanHexLiteral(start);
109800 }
109801 if (ch === 'b' || ch === 'B') {
109802 ++this.index;
109803 return this.scanBinaryLiteral(start);
109804 }
109805 if (ch === 'o' || ch === 'O') {
109806 return this.scanOctalLiteral(ch, start);
109807 }
109808 if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
109809 if (this.isImplicitOctalLiteral()) {
109810 return this.scanOctalLiteral(ch, start);
109811 }
109812 }
109813 }
109814 while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
109815 num += this.source[this.index++];
109816 }
109817 ch = this.source[this.index];
109818 }
109819 if (ch === '.') {
109820 num += this.source[this.index++];
109821 while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
109822 num += this.source[this.index++];
109823 }
109824 ch = this.source[this.index];
109825 }
109826 if (ch === 'e' || ch === 'E') {
109827 num += this.source[this.index++];
109828 ch = this.source[this.index];
109829 if (ch === '+' || ch === '-') {
109830 num += this.source[this.index++];
109831 }
109832 if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
109833 while (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
109834 num += this.source[this.index++];
109835 }
109836 }
109837 else {
109838 this.throwUnexpectedToken();
109839 }
109840 }
109841 if (character_1.Character.isIdentifierStart(this.source.charCodeAt(this.index))) {
109842 this.throwUnexpectedToken();
109843 }
109844 return {
109845 type: 6 /* NumericLiteral */,
109846 value: parseFloat(num),
109847 lineNumber: this.lineNumber,
109848 lineStart: this.lineStart,
109849 start: start,
109850 end: this.index
109851 };
109852 };
109853 // https://tc39.github.io/ecma262/#sec-literals-string-literals
109854 Scanner.prototype.scanStringLiteral = function () {
109855 var start = this.index;
109856 var quote = this.source[start];
109857 assert_1.assert((quote === '\'' || quote === '"'), 'String literal must starts with a quote');
109858 ++this.index;
109859 var octal = false;
109860 var str = '';
109861 while (!this.eof()) {
109862 var ch = this.source[this.index++];
109863 if (ch === quote) {
109864 quote = '';
109865 break;
109866 }
109867 else if (ch === '\\') {
109868 ch = this.source[this.index++];
109869 if (!ch || !character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
109870 switch (ch) {
109871 case 'u':
109872 if (this.source[this.index] === '{') {
109873 ++this.index;
109874 str += this.scanUnicodeCodePointEscape();
109875 }
109876 else {
109877 var unescaped_1 = this.scanHexEscape(ch);
109878 if (unescaped_1 === null) {
109879 this.throwUnexpectedToken();
109880 }
109881 str += unescaped_1;
109882 }
109883 break;
109884 case 'x':
109885 var unescaped = this.scanHexEscape(ch);
109886 if (unescaped === null) {
109887 this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
109888 }
109889 str += unescaped;
109890 break;
109891 case 'n':
109892 str += '\n';
109893 break;
109894 case 'r':
109895 str += '\r';
109896 break;
109897 case 't':
109898 str += '\t';
109899 break;
109900 case 'b':
109901 str += '\b';
109902 break;
109903 case 'f':
109904 str += '\f';
109905 break;
109906 case 'v':
109907 str += '\x0B';
109908 break;
109909 case '8':
109910 case '9':
109911 str += ch;
109912 this.tolerateUnexpectedToken();
109913 break;
109914 default:
109915 if (ch && character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
109916 var octToDec = this.octalToDecimal(ch);
109917 octal = octToDec.octal || octal;
109918 str += String.fromCharCode(octToDec.code);
109919 }
109920 else {
109921 str += ch;
109922 }
109923 break;
109924 }
109925 }
109926 else {
109927 ++this.lineNumber;
109928 if (ch === '\r' && this.source[this.index] === '\n') {
109929 ++this.index;
109930 }
109931 this.lineStart = this.index;
109932 }
109933 }
109934 else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
109935 break;
109936 }
109937 else {
109938 str += ch;
109939 }
109940 }
109941 if (quote !== '') {
109942 this.index = start;
109943 this.throwUnexpectedToken();
109944 }
109945 return {
109946 type: 8 /* StringLiteral */,
109947 value: str,
109948 octal: octal,
109949 lineNumber: this.lineNumber,
109950 lineStart: this.lineStart,
109951 start: start,
109952 end: this.index
109953 };
109954 };
109955 // https://tc39.github.io/ecma262/#sec-template-literal-lexical-components
109956 Scanner.prototype.scanTemplate = function () {
109957 var cooked = '';
109958 var terminated = false;
109959 var start = this.index;
109960 var head = (this.source[start] === '`');
109961 var tail = false;
109962 var rawOffset = 2;
109963 ++this.index;
109964 while (!this.eof()) {
109965 var ch = this.source[this.index++];
109966 if (ch === '`') {
109967 rawOffset = 1;
109968 tail = true;
109969 terminated = true;
109970 break;
109971 }
109972 else if (ch === '$') {
109973 if (this.source[this.index] === '{') {
109974 this.curlyStack.push('${');
109975 ++this.index;
109976 terminated = true;
109977 break;
109978 }
109979 cooked += ch;
109980 }
109981 else if (ch === '\\') {
109982 ch = this.source[this.index++];
109983 if (!character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
109984 switch (ch) {
109985 case 'n':
109986 cooked += '\n';
109987 break;
109988 case 'r':
109989 cooked += '\r';
109990 break;
109991 case 't':
109992 cooked += '\t';
109993 break;
109994 case 'u':
109995 if (this.source[this.index] === '{') {
109996 ++this.index;
109997 cooked += this.scanUnicodeCodePointEscape();
109998 }
109999 else {
110000 var restore = this.index;
110001 var unescaped_2 = this.scanHexEscape(ch);
110002 if (unescaped_2 !== null) {
110003 cooked += unescaped_2;
110004 }
110005 else {
110006 this.index = restore;
110007 cooked += ch;
110008 }
110009 }
110010 break;
110011 case 'x':
110012 var unescaped = this.scanHexEscape(ch);
110013 if (unescaped === null) {
110014 this.throwUnexpectedToken(messages_1.Messages.InvalidHexEscapeSequence);
110015 }
110016 cooked += unescaped;
110017 break;
110018 case 'b':
110019 cooked += '\b';
110020 break;
110021 case 'f':
110022 cooked += '\f';
110023 break;
110024 case 'v':
110025 cooked += '\v';
110026 break;
110027 default:
110028 if (ch === '0') {
110029 if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index))) {
110030 // Illegal: \01 \02 and so on
110031 this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
110032 }
110033 cooked += '\0';
110034 }
110035 else if (character_1.Character.isOctalDigit(ch.charCodeAt(0))) {
110036 // Illegal: \1 \2
110037 this.throwUnexpectedToken(messages_1.Messages.TemplateOctalLiteral);
110038 }
110039 else {
110040 cooked += ch;
110041 }
110042 break;
110043 }
110044 }
110045 else {
110046 ++this.lineNumber;
110047 if (ch === '\r' && this.source[this.index] === '\n') {
110048 ++this.index;
110049 }
110050 this.lineStart = this.index;
110051 }
110052 }
110053 else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
110054 ++this.lineNumber;
110055 if (ch === '\r' && this.source[this.index] === '\n') {
110056 ++this.index;
110057 }
110058 this.lineStart = this.index;
110059 cooked += '\n';
110060 }
110061 else {
110062 cooked += ch;
110063 }
110064 }
110065 if (!terminated) {
110066 this.throwUnexpectedToken();
110067 }
110068 if (!head) {
110069 this.curlyStack.pop();
110070 }
110071 return {
110072 type: 10 /* Template */,
110073 value: this.source.slice(start + 1, this.index - rawOffset),
110074 cooked: cooked,
110075 head: head,
110076 tail: tail,
110077 lineNumber: this.lineNumber,
110078 lineStart: this.lineStart,
110079 start: start,
110080 end: this.index
110081 };
110082 };
110083 // https://tc39.github.io/ecma262/#sec-literals-regular-expression-literals
110084 Scanner.prototype.testRegExp = function (pattern, flags) {
110085 // The BMP character to use as a replacement for astral symbols when
110086 // translating an ES6 "u"-flagged pattern to an ES5-compatible
110087 // approximation.
110088 // Note: replacing with '\uFFFF' enables false positives in unlikely
110089 // scenarios. For example, `[\u{1044f}-\u{10440}]` is an invalid
110090 // pattern that would not be detected by this substitution.
110091 var astralSubstitute = '\uFFFF';
110092 var tmp = pattern;
110093 var self = this;
110094 if (flags.indexOf('u') >= 0) {
110095 tmp = tmp
110096 .replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {
110097 var codePoint = parseInt($1 || $2, 16);
110098 if (codePoint > 0x10FFFF) {
110099 self.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
110100 }
110101 if (codePoint <= 0xFFFF) {
110102 return String.fromCharCode(codePoint);
110103 }
110104 return astralSubstitute;
110105 })
110106 .replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, astralSubstitute);
110107 }
110108 // First, detect invalid regular expressions.
110109 try {
110110 RegExp(tmp);
110111 }
110112 catch (e) {
110113 this.throwUnexpectedToken(messages_1.Messages.InvalidRegExp);
110114 }
110115 // Return a regular expression object for this pattern-flag pair, or
110116 // `null` in case the current environment doesn't support the flags it
110117 // uses.
110118 try {
110119 return new RegExp(pattern, flags);
110120 }
110121 catch (exception) {
110122 /* istanbul ignore next */
110123 return null;
110124 }
110125 };
110126 Scanner.prototype.scanRegExpBody = function () {
110127 var ch = this.source[this.index];
110128 assert_1.assert(ch === '/', 'Regular expression literal must start with a slash');
110129 var str = this.source[this.index++];
110130 var classMarker = false;
110131 var terminated = false;
110132 while (!this.eof()) {
110133 ch = this.source[this.index++];
110134 str += ch;
110135 if (ch === '\\') {
110136 ch = this.source[this.index++];
110137 // https://tc39.github.io/ecma262/#sec-literals-regular-expression-literals
110138 if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
110139 this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
110140 }
110141 str += ch;
110142 }
110143 else if (character_1.Character.isLineTerminator(ch.charCodeAt(0))) {
110144 this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
110145 }
110146 else if (classMarker) {
110147 if (ch === ']') {
110148 classMarker = false;
110149 }
110150 }
110151 else {
110152 if (ch === '/') {
110153 terminated = true;
110154 break;
110155 }
110156 else if (ch === '[') {
110157 classMarker = true;
110158 }
110159 }
110160 }
110161 if (!terminated) {
110162 this.throwUnexpectedToken(messages_1.Messages.UnterminatedRegExp);
110163 }
110164 // Exclude leading and trailing slash.
110165 return str.substr(1, str.length - 2);
110166 };
110167 Scanner.prototype.scanRegExpFlags = function () {
110168 var str = '';
110169 var flags = '';
110170 while (!this.eof()) {
110171 var ch = this.source[this.index];
110172 if (!character_1.Character.isIdentifierPart(ch.charCodeAt(0))) {
110173 break;
110174 }
110175 ++this.index;
110176 if (ch === '\\' && !this.eof()) {
110177 ch = this.source[this.index];
110178 if (ch === 'u') {
110179 ++this.index;
110180 var restore = this.index;
110181 var char = this.scanHexEscape('u');
110182 if (char !== null) {
110183 flags += char;
110184 for (str += '\\u'; restore < this.index; ++restore) {
110185 str += this.source[restore];
110186 }
110187 }
110188 else {
110189 this.index = restore;
110190 flags += 'u';
110191 str += '\\u';
110192 }
110193 this.tolerateUnexpectedToken();
110194 }
110195 else {
110196 str += '\\';
110197 this.tolerateUnexpectedToken();
110198 }
110199 }
110200 else {
110201 flags += ch;
110202 str += ch;
110203 }
110204 }
110205 return flags;
110206 };
110207 Scanner.prototype.scanRegExp = function () {
110208 var start = this.index;
110209 var pattern = this.scanRegExpBody();
110210 var flags = this.scanRegExpFlags();
110211 var value = this.testRegExp(pattern, flags);
110212 return {
110213 type: 9 /* RegularExpression */,
110214 value: '',
110215 pattern: pattern,
110216 flags: flags,
110217 regex: value,
110218 lineNumber: this.lineNumber,
110219 lineStart: this.lineStart,
110220 start: start,
110221 end: this.index
110222 };
110223 };
110224 Scanner.prototype.lex = function () {
110225 if (this.eof()) {
110226 return {
110227 type: 2 /* EOF */,
110228 value: '',
110229 lineNumber: this.lineNumber,
110230 lineStart: this.lineStart,
110231 start: this.index,
110232 end: this.index
110233 };
110234 }
110235 var cp = this.source.charCodeAt(this.index);
110236 if (character_1.Character.isIdentifierStart(cp)) {
110237 return this.scanIdentifier();
110238 }
110239 // Very common: ( and ) and ;
110240 if (cp === 0x28 || cp === 0x29 || cp === 0x3B) {
110241 return this.scanPunctuator();
110242 }
110243 // String literal starts with single quote (U+0027) or double quote (U+0022).
110244 if (cp === 0x27 || cp === 0x22) {
110245 return this.scanStringLiteral();
110246 }
110247 // Dot (.) U+002E can also start a floating-point number, hence the need
110248 // to check the next character.
110249 if (cp === 0x2E) {
110250 if (character_1.Character.isDecimalDigit(this.source.charCodeAt(this.index + 1))) {
110251 return this.scanNumericLiteral();
110252 }
110253 return this.scanPunctuator();
110254 }
110255 if (character_1.Character.isDecimalDigit(cp)) {
110256 return this.scanNumericLiteral();
110257 }
110258 // Template literals start with ` (U+0060) for template head
110259 // or } (U+007D) for template middle or template tail.
110260 if (cp === 0x60 || (cp === 0x7D && this.curlyStack[this.curlyStack.length - 1] === '${')) {
110261 return this.scanTemplate();
110262 }
110263 // Possible identifier start in a surrogate pair.
110264 if (cp >= 0xD800 && cp < 0xDFFF) {
110265 if (character_1.Character.isIdentifierStart(this.codePointAt(this.index))) {
110266 return this.scanIdentifier();
110267 }
110268 }
110269 return this.scanPunctuator();
110270 };
110271 return Scanner;
110272 }());
110273 exports.Scanner = Scanner;
110274
110275
110276/***/ },
110277/* 13 */
110278/***/ function(module, exports) {
110279
110280 "use strict";
110281 Object.defineProperty(exports, "__esModule", { value: true });
110282 exports.TokenName = {};
110283 exports.TokenName[1 /* BooleanLiteral */] = 'Boolean';
110284 exports.TokenName[2 /* EOF */] = '<end>';
110285 exports.TokenName[3 /* Identifier */] = 'Identifier';
110286 exports.TokenName[4 /* Keyword */] = 'Keyword';
110287 exports.TokenName[5 /* NullLiteral */] = 'Null';
110288 exports.TokenName[6 /* NumericLiteral */] = 'Numeric';
110289 exports.TokenName[7 /* Punctuator */] = 'Punctuator';
110290 exports.TokenName[8 /* StringLiteral */] = 'String';
110291 exports.TokenName[9 /* RegularExpression */] = 'RegularExpression';
110292 exports.TokenName[10 /* Template */] = 'Template';
110293
110294
110295/***/ },
110296/* 14 */
110297/***/ function(module, exports) {
110298
110299 "use strict";
110300 // Generated by generate-xhtml-entities.js. DO NOT MODIFY!
110301 Object.defineProperty(exports, "__esModule", { value: true });
110302 exports.XHTMLEntities = {
110303 quot: '\u0022',
110304 amp: '\u0026',
110305 apos: '\u0027',
110306 gt: '\u003E',
110307 nbsp: '\u00A0',
110308 iexcl: '\u00A1',
110309 cent: '\u00A2',
110310 pound: '\u00A3',
110311 curren: '\u00A4',
110312 yen: '\u00A5',
110313 brvbar: '\u00A6',
110314 sect: '\u00A7',
110315 uml: '\u00A8',
110316 copy: '\u00A9',
110317 ordf: '\u00AA',
110318 laquo: '\u00AB',
110319 not: '\u00AC',
110320 shy: '\u00AD',
110321 reg: '\u00AE',
110322 macr: '\u00AF',
110323 deg: '\u00B0',
110324 plusmn: '\u00B1',
110325 sup2: '\u00B2',
110326 sup3: '\u00B3',
110327 acute: '\u00B4',
110328 micro: '\u00B5',
110329 para: '\u00B6',
110330 middot: '\u00B7',
110331 cedil: '\u00B8',
110332 sup1: '\u00B9',
110333 ordm: '\u00BA',
110334 raquo: '\u00BB',
110335 frac14: '\u00BC',
110336 frac12: '\u00BD',
110337 frac34: '\u00BE',
110338 iquest: '\u00BF',
110339 Agrave: '\u00C0',
110340 Aacute: '\u00C1',
110341 Acirc: '\u00C2',
110342 Atilde: '\u00C3',
110343 Auml: '\u00C4',
110344 Aring: '\u00C5',
110345 AElig: '\u00C6',
110346 Ccedil: '\u00C7',
110347 Egrave: '\u00C8',
110348 Eacute: '\u00C9',
110349 Ecirc: '\u00CA',
110350 Euml: '\u00CB',
110351 Igrave: '\u00CC',
110352 Iacute: '\u00CD',
110353 Icirc: '\u00CE',
110354 Iuml: '\u00CF',
110355 ETH: '\u00D0',
110356 Ntilde: '\u00D1',
110357 Ograve: '\u00D2',
110358 Oacute: '\u00D3',
110359 Ocirc: '\u00D4',
110360 Otilde: '\u00D5',
110361 Ouml: '\u00D6',
110362 times: '\u00D7',
110363 Oslash: '\u00D8',
110364 Ugrave: '\u00D9',
110365 Uacute: '\u00DA',
110366 Ucirc: '\u00DB',
110367 Uuml: '\u00DC',
110368 Yacute: '\u00DD',
110369 THORN: '\u00DE',
110370 szlig: '\u00DF',
110371 agrave: '\u00E0',
110372 aacute: '\u00E1',
110373 acirc: '\u00E2',
110374 atilde: '\u00E3',
110375 auml: '\u00E4',
110376 aring: '\u00E5',
110377 aelig: '\u00E6',
110378 ccedil: '\u00E7',
110379 egrave: '\u00E8',
110380 eacute: '\u00E9',
110381 ecirc: '\u00EA',
110382 euml: '\u00EB',
110383 igrave: '\u00EC',
110384 iacute: '\u00ED',
110385 icirc: '\u00EE',
110386 iuml: '\u00EF',
110387 eth: '\u00F0',
110388 ntilde: '\u00F1',
110389 ograve: '\u00F2',
110390 oacute: '\u00F3',
110391 ocirc: '\u00F4',
110392 otilde: '\u00F5',
110393 ouml: '\u00F6',
110394 divide: '\u00F7',
110395 oslash: '\u00F8',
110396 ugrave: '\u00F9',
110397 uacute: '\u00FA',
110398 ucirc: '\u00FB',
110399 uuml: '\u00FC',
110400 yacute: '\u00FD',
110401 thorn: '\u00FE',
110402 yuml: '\u00FF',
110403 OElig: '\u0152',
110404 oelig: '\u0153',
110405 Scaron: '\u0160',
110406 scaron: '\u0161',
110407 Yuml: '\u0178',
110408 fnof: '\u0192',
110409 circ: '\u02C6',
110410 tilde: '\u02DC',
110411 Alpha: '\u0391',
110412 Beta: '\u0392',
110413 Gamma: '\u0393',
110414 Delta: '\u0394',
110415 Epsilon: '\u0395',
110416 Zeta: '\u0396',
110417 Eta: '\u0397',
110418 Theta: '\u0398',
110419 Iota: '\u0399',
110420 Kappa: '\u039A',
110421 Lambda: '\u039B',
110422 Mu: '\u039C',
110423 Nu: '\u039D',
110424 Xi: '\u039E',
110425 Omicron: '\u039F',
110426 Pi: '\u03A0',
110427 Rho: '\u03A1',
110428 Sigma: '\u03A3',
110429 Tau: '\u03A4',
110430 Upsilon: '\u03A5',
110431 Phi: '\u03A6',
110432 Chi: '\u03A7',
110433 Psi: '\u03A8',
110434 Omega: '\u03A9',
110435 alpha: '\u03B1',
110436 beta: '\u03B2',
110437 gamma: '\u03B3',
110438 delta: '\u03B4',
110439 epsilon: '\u03B5',
110440 zeta: '\u03B6',
110441 eta: '\u03B7',
110442 theta: '\u03B8',
110443 iota: '\u03B9',
110444 kappa: '\u03BA',
110445 lambda: '\u03BB',
110446 mu: '\u03BC',
110447 nu: '\u03BD',
110448 xi: '\u03BE',
110449 omicron: '\u03BF',
110450 pi: '\u03C0',
110451 rho: '\u03C1',
110452 sigmaf: '\u03C2',
110453 sigma: '\u03C3',
110454 tau: '\u03C4',
110455 upsilon: '\u03C5',
110456 phi: '\u03C6',
110457 chi: '\u03C7',
110458 psi: '\u03C8',
110459 omega: '\u03C9',
110460 thetasym: '\u03D1',
110461 upsih: '\u03D2',
110462 piv: '\u03D6',
110463 ensp: '\u2002',
110464 emsp: '\u2003',
110465 thinsp: '\u2009',
110466 zwnj: '\u200C',
110467 zwj: '\u200D',
110468 lrm: '\u200E',
110469 rlm: '\u200F',
110470 ndash: '\u2013',
110471 mdash: '\u2014',
110472 lsquo: '\u2018',
110473 rsquo: '\u2019',
110474 sbquo: '\u201A',
110475 ldquo: '\u201C',
110476 rdquo: '\u201D',
110477 bdquo: '\u201E',
110478 dagger: '\u2020',
110479 Dagger: '\u2021',
110480 bull: '\u2022',
110481 hellip: '\u2026',
110482 permil: '\u2030',
110483 prime: '\u2032',
110484 Prime: '\u2033',
110485 lsaquo: '\u2039',
110486 rsaquo: '\u203A',
110487 oline: '\u203E',
110488 frasl: '\u2044',
110489 euro: '\u20AC',
110490 image: '\u2111',
110491 weierp: '\u2118',
110492 real: '\u211C',
110493 trade: '\u2122',
110494 alefsym: '\u2135',
110495 larr: '\u2190',
110496 uarr: '\u2191',
110497 rarr: '\u2192',
110498 darr: '\u2193',
110499 harr: '\u2194',
110500 crarr: '\u21B5',
110501 lArr: '\u21D0',
110502 uArr: '\u21D1',
110503 rArr: '\u21D2',
110504 dArr: '\u21D3',
110505 hArr: '\u21D4',
110506 forall: '\u2200',
110507 part: '\u2202',
110508 exist: '\u2203',
110509 empty: '\u2205',
110510 nabla: '\u2207',
110511 isin: '\u2208',
110512 notin: '\u2209',
110513 ni: '\u220B',
110514 prod: '\u220F',
110515 sum: '\u2211',
110516 minus: '\u2212',
110517 lowast: '\u2217',
110518 radic: '\u221A',
110519 prop: '\u221D',
110520 infin: '\u221E',
110521 ang: '\u2220',
110522 and: '\u2227',
110523 or: '\u2228',
110524 cap: '\u2229',
110525 cup: '\u222A',
110526 int: '\u222B',
110527 there4: '\u2234',
110528 sim: '\u223C',
110529 cong: '\u2245',
110530 asymp: '\u2248',
110531 ne: '\u2260',
110532 equiv: '\u2261',
110533 le: '\u2264',
110534 ge: '\u2265',
110535 sub: '\u2282',
110536 sup: '\u2283',
110537 nsub: '\u2284',
110538 sube: '\u2286',
110539 supe: '\u2287',
110540 oplus: '\u2295',
110541 otimes: '\u2297',
110542 perp: '\u22A5',
110543 sdot: '\u22C5',
110544 lceil: '\u2308',
110545 rceil: '\u2309',
110546 lfloor: '\u230A',
110547 rfloor: '\u230B',
110548 loz: '\u25CA',
110549 spades: '\u2660',
110550 clubs: '\u2663',
110551 hearts: '\u2665',
110552 diams: '\u2666',
110553 lang: '\u27E8',
110554 rang: '\u27E9'
110555 };
110556
110557
110558/***/ },
110559/* 15 */
110560/***/ function(module, exports, __webpack_require__) {
110561
110562 "use strict";
110563 Object.defineProperty(exports, "__esModule", { value: true });
110564 var error_handler_1 = __webpack_require__(10);
110565 var scanner_1 = __webpack_require__(12);
110566 var token_1 = __webpack_require__(13);
110567 var Reader = (function () {
110568 function Reader() {
110569 this.values = [];
110570 this.curly = this.paren = -1;
110571 }
110572 // A function following one of those tokens is an expression.
110573 Reader.prototype.beforeFunctionExpression = function (t) {
110574 return ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',
110575 'return', 'case', 'delete', 'throw', 'void',
110576 // assignment operators
110577 '=', '+=', '-=', '*=', '**=', '/=', '%=', '<<=', '>>=', '>>>=',
110578 '&=', '|=', '^=', ',',
110579 // binary/unary operators
110580 '+', '-', '*', '**', '/', '%', '++', '--', '<<', '>>', '>>>', '&',
110581 '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',
110582 '<=', '<', '>', '!=', '!=='].indexOf(t) >= 0;
110583 };
110584 // Determine if forward slash (/) is an operator or part of a regular expression
110585 // https://github.com/mozilla/sweet.js/wiki/design
110586 Reader.prototype.isRegexStart = function () {
110587 var previous = this.values[this.values.length - 1];
110588 var regex = (previous !== null);
110589 switch (previous) {
110590 case 'this':
110591 case ']':
110592 regex = false;
110593 break;
110594 case ')':
110595 var keyword = this.values[this.paren - 1];
110596 regex = (keyword === 'if' || keyword === 'while' || keyword === 'for' || keyword === 'with');
110597 break;
110598 case '}':
110599 // Dividing a function by anything makes little sense,
110600 // but we have to check for that.
110601 regex = false;
110602 if (this.values[this.curly - 3] === 'function') {
110603 // Anonymous function, e.g. function(){} /42
110604 var check = this.values[this.curly - 4];
110605 regex = check ? !this.beforeFunctionExpression(check) : false;
110606 }
110607 else if (this.values[this.curly - 4] === 'function') {
110608 // Named function, e.g. function f(){} /42/
110609 var check = this.values[this.curly - 5];
110610 regex = check ? !this.beforeFunctionExpression(check) : true;
110611 }
110612 break;
110613 default:
110614 break;
110615 }
110616 return regex;
110617 };
110618 Reader.prototype.push = function (token) {
110619 if (token.type === 7 /* Punctuator */ || token.type === 4 /* Keyword */) {
110620 if (token.value === '{') {
110621 this.curly = this.values.length;
110622 }
110623 else if (token.value === '(') {
110624 this.paren = this.values.length;
110625 }
110626 this.values.push(token.value);
110627 }
110628 else {
110629 this.values.push(null);
110630 }
110631 };
110632 return Reader;
110633 }());
110634 var Tokenizer = (function () {
110635 function Tokenizer(code, config) {
110636 this.errorHandler = new error_handler_1.ErrorHandler();
110637 this.errorHandler.tolerant = config ? (typeof config.tolerant === 'boolean' && config.tolerant) : false;
110638 this.scanner = new scanner_1.Scanner(code, this.errorHandler);
110639 this.scanner.trackComment = config ? (typeof config.comment === 'boolean' && config.comment) : false;
110640 this.trackRange = config ? (typeof config.range === 'boolean' && config.range) : false;
110641 this.trackLoc = config ? (typeof config.loc === 'boolean' && config.loc) : false;
110642 this.buffer = [];
110643 this.reader = new Reader();
110644 }
110645 Tokenizer.prototype.errors = function () {
110646 return this.errorHandler.errors;
110647 };
110648 Tokenizer.prototype.getNextToken = function () {
110649 if (this.buffer.length === 0) {
110650 var comments = this.scanner.scanComments();
110651 if (this.scanner.trackComment) {
110652 for (var i = 0; i < comments.length; ++i) {
110653 var e = comments[i];
110654 var value = this.scanner.source.slice(e.slice[0], e.slice[1]);
110655 var comment = {
110656 type: e.multiLine ? 'BlockComment' : 'LineComment',
110657 value: value
110658 };
110659 if (this.trackRange) {
110660 comment.range = e.range;
110661 }
110662 if (this.trackLoc) {
110663 comment.loc = e.loc;
110664 }
110665 this.buffer.push(comment);
110666 }
110667 }
110668 if (!this.scanner.eof()) {
110669 var loc = void 0;
110670 if (this.trackLoc) {
110671 loc = {
110672 start: {
110673 line: this.scanner.lineNumber,
110674 column: this.scanner.index - this.scanner.lineStart
110675 },
110676 end: {}
110677 };
110678 }
110679 var startRegex = (this.scanner.source[this.scanner.index] === '/') && this.reader.isRegexStart();
110680 var token = startRegex ? this.scanner.scanRegExp() : this.scanner.lex();
110681 this.reader.push(token);
110682 var entry = {
110683 type: token_1.TokenName[token.type],
110684 value: this.scanner.source.slice(token.start, token.end)
110685 };
110686 if (this.trackRange) {
110687 entry.range = [token.start, token.end];
110688 }
110689 if (this.trackLoc) {
110690 loc.end = {
110691 line: this.scanner.lineNumber,
110692 column: this.scanner.index - this.scanner.lineStart
110693 };
110694 entry.loc = loc;
110695 }
110696 if (token.type === 9 /* RegularExpression */) {
110697 var pattern = token.pattern;
110698 var flags = token.flags;
110699 entry.regex = { pattern: pattern, flags: flags };
110700 }
110701 this.buffer.push(entry);
110702 }
110703 }
110704 return this.buffer.shift();
110705 };
110706 return Tokenizer;
110707 }());
110708 exports.Tokenizer = Tokenizer;
110709
110710
110711/***/ }
110712/******/ ])
110713});
110714;
110715
110716/***/ }),
110717/* 663 */
110718/***/ (function(module, exports, __webpack_require__) {
110719
110720"use strict";
110721/*!
110722 * expand-brackets <https://github.com/jonschlinkert/expand-brackets>
110723 *
110724 * Copyright (c) 2015 Jon Schlinkert.
110725 * Licensed under the MIT license.
110726 */
110727
110728
110729
110730var isPosixBracket = __webpack_require__(788);
110731
110732/**
110733 * POSIX character classes
110734 */
110735
110736var POSIX = {
110737 alnum: 'a-zA-Z0-9',
110738 alpha: 'a-zA-Z',
110739 blank: ' \\t',
110740 cntrl: '\\x00-\\x1F\\x7F',
110741 digit: '0-9',
110742 graph: '\\x21-\\x7E',
110743 lower: 'a-z',
110744 print: '\\x20-\\x7E',
110745 punct: '-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
110746 space: ' \\t\\r\\n\\v\\f',
110747 upper: 'A-Z',
110748 word: 'A-Za-z0-9_',
110749 xdigit: 'A-Fa-f0-9',
110750};
110751
110752/**
110753 * Expose `brackets`
110754 */
110755
110756module.exports = brackets;
110757
110758function brackets(str) {
110759 if (!isPosixBracket(str)) {
110760 return str;
110761 }
110762
110763 var negated = false;
110764 if (str.indexOf('[^') !== -1) {
110765 negated = true;
110766 str = str.split('[^').join('[');
110767 }
110768 if (str.indexOf('[!') !== -1) {
110769 negated = true;
110770 str = str.split('[!').join('[');
110771 }
110772
110773 var a = str.split('[');
110774 var b = str.split(']');
110775 var imbalanced = a.length !== b.length;
110776
110777 var parts = str.split(/(?::\]\[:|\[?\[:|:\]\]?)/);
110778 var len = parts.length, i = 0;
110779 var end = '', beg = '';
110780 var res = [];
110781
110782 // start at the end (innermost) first
110783 while (len--) {
110784 var inner = parts[i++];
110785 if (inner === '^[!' || inner === '[!') {
110786 inner = '';
110787 negated = true;
110788 }
110789
110790 var prefix = negated ? '^' : '';
110791 var ch = POSIX[inner];
110792
110793 if (ch) {
110794 res.push('[' + prefix + ch + ']');
110795 } else if (inner) {
110796 if (/^\[?\w-\w\]?$/.test(inner)) {
110797 if (i === parts.length) {
110798 res.push('[' + prefix + inner);
110799 } else if (i === 1) {
110800 res.push(prefix + inner + ']');
110801 } else {
110802 res.push(prefix + inner);
110803 }
110804 } else {
110805 if (i === 1) {
110806 beg += inner;
110807 } else if (i === parts.length) {
110808 end += inner;
110809 } else {
110810 res.push('[' + prefix + inner + ']');
110811 }
110812 }
110813 }
110814 }
110815
110816 var result = res.join('|');
110817 var rlen = res.length || 1;
110818 if (rlen > 1) {
110819 result = '(?:' + result + ')';
110820 rlen = 1;
110821 }
110822 if (beg) {
110823 rlen++;
110824 if (beg.charAt(0) === '[') {
110825 if (imbalanced) {
110826 beg = '\\[' + beg.slice(1);
110827 } else {
110828 beg += ']';
110829 }
110830 }
110831 result = beg + result;
110832 }
110833 if (end) {
110834 rlen++;
110835 if (end.slice(-1) === ']') {
110836 if (imbalanced) {
110837 end = end.slice(0, end.length - 1) + '\\]';
110838 } else {
110839 end = '[' + end;
110840 }
110841 }
110842 result += end;
110843 }
110844
110845 if (rlen > 1) {
110846 result = result.split('][').join(']|[');
110847 if (result.indexOf('|') !== -1 && !/\(\?/.test(result)) {
110848 result = '(?:' + result + ')';
110849 }
110850 }
110851
110852 result = result.replace(/\[+=|=\]+/g, '\\b');
110853 return result;
110854}
110855
110856brackets.makeRe = function(pattern) {
110857 try {
110858 return new RegExp(brackets(pattern));
110859 } catch (err) {}
110860};
110861
110862brackets.isMatch = function(str, pattern) {
110863 try {
110864 return brackets.makeRe(pattern).test(str);
110865 } catch (err) {
110866 return false;
110867 }
110868};
110869
110870brackets.match = function(arr, pattern) {
110871 var len = arr.length, i = 0;
110872 var res = arr.slice();
110873
110874 var re = brackets.makeRe(pattern);
110875 while (i < len) {
110876 var ele = arr[i++];
110877 if (!re.test(ele)) {
110878 continue;
110879 }
110880 res.splice(i, 1);
110881 }
110882 return res;
110883};
110884
110885
110886/***/ }),
110887/* 664 */
110888/***/ (function(module, exports, __webpack_require__) {
110889
110890"use strict";
110891/*!
110892 * expand-range <https://github.com/jonschlinkert/expand-range>
110893 *
110894 * Copyright (c) 2014-2015, Jon Schlinkert.
110895 * Licensed under the MIT license.
110896 */
110897
110898
110899
110900var fill = __webpack_require__(665);
110901
110902module.exports = function expandRange(str, options, fn) {
110903 if (typeof str !== 'string') {
110904 throw new TypeError('expand-range expects a string.');
110905 }
110906
110907 if (typeof options === 'function') {
110908 fn = options;
110909 options = {};
110910 }
110911
110912 if (typeof options === 'boolean') {
110913 options = {};
110914 options.makeRe = true;
110915 }
110916
110917 // create arguments to pass to fill-range
110918 var opts = options || {};
110919 var args = str.split('..');
110920 var len = args.length;
110921 if (len > 3) { return str; }
110922
110923 // if only one argument, it can't expand so return it
110924 if (len === 1) { return args; }
110925
110926 // if `true`, tell fill-range to regexify the string
110927 if (typeof fn === 'boolean' && fn === true) {
110928 opts.makeRe = true;
110929 }
110930
110931 args.push(opts);
110932 return fill.apply(null, args.concat(fn));
110933};
110934
110935
110936/***/ }),
110937/* 665 */
110938/***/ (function(module, exports, __webpack_require__) {
110939
110940"use strict";
110941/*!
110942 * fill-range <https://github.com/jonschlinkert/fill-range>
110943 *
110944 * Copyright (c) 2014-2018, Jon Schlinkert.
110945 * Released under the MIT License.
110946 */
110947
110948
110949
110950var isObject = __webpack_require__(667);
110951var isNumber = __webpack_require__(666);
110952var randomize = __webpack_require__(859);
110953var repeatStr = __webpack_require__(869);
110954var repeat = __webpack_require__(381);
110955
110956/**
110957 * Expose `fillRange`
110958 */
110959
110960module.exports = fillRange;
110961
110962/**
110963 * Return a range of numbers or letters.
110964 *
110965 * @param {String} `a` Start of the range
110966 * @param {String} `b` End of the range
110967 * @param {String} `step` Increment or decrement to use.
110968 * @param {Function} `fn` Custom function to modify each element in the range.
110969 * @return {Array}
110970 */
110971
110972function fillRange(a, b, step, options, fn) {
110973 if (a == null || b == null) {
110974 throw new Error('fill-range expects the first and second args to be strings.');
110975 }
110976
110977 if (typeof step === 'function') {
110978 fn = step; options = {}; step = null;
110979 }
110980
110981 if (typeof options === 'function') {
110982 fn = options; options = {};
110983 }
110984
110985 if (isObject(step)) {
110986 options = step; step = '';
110987 }
110988
110989 var expand, regex = false, sep = '';
110990 var opts = options || {};
110991
110992 if (typeof opts.silent === 'undefined') {
110993 opts.silent = true;
110994 }
110995
110996 step = step || opts.step;
110997
110998 // store a ref to unmodified arg
110999 var origA = a, origB = b;
111000
111001 b = (b.toString() === '-0') ? 0 : b;
111002
111003 if (opts.optimize || opts.makeRe) {
111004 step = step ? (step += '~') : step;
111005 expand = true;
111006 regex = true;
111007 sep = '~';
111008 }
111009
111010 // handle special step characters
111011 if (typeof step === 'string') {
111012 var match = stepRe().exec(step);
111013
111014 if (match) {
111015 var i = match.index;
111016 var m = match[0];
111017
111018 // repeat string
111019 if (m === '+') {
111020 return repeat(a, b);
111021
111022 // randomize a, `b` times
111023 } else if (m === '?') {
111024 return [randomize(a, b)];
111025
111026 // expand right, no regex reduction
111027 } else if (m === '>') {
111028 step = step.substr(0, i) + step.substr(i + 1);
111029 expand = true;
111030
111031 // expand to an array, or if valid create a reduced
111032 // string for a regex logic `or`
111033 } else if (m === '|') {
111034 step = step.substr(0, i) + step.substr(i + 1);
111035 expand = true;
111036 regex = true;
111037 sep = m;
111038
111039 // expand to an array, or if valid create a reduced
111040 // string for a regex range
111041 } else if (m === '~') {
111042 step = step.substr(0, i) + step.substr(i + 1);
111043 expand = true;
111044 regex = true;
111045 sep = m;
111046 }
111047 } else if (!isNumber(step)) {
111048 if (!opts.silent) {
111049 throw new TypeError('fill-range: invalid step.');
111050 }
111051 return null;
111052 }
111053 }
111054
111055 if (/[.&*()[\]^%$#@!]/.test(a) || /[.&*()[\]^%$#@!]/.test(b)) {
111056 if (!opts.silent) {
111057 throw new RangeError('fill-range: invalid range arguments.');
111058 }
111059 return null;
111060 }
111061
111062 // has neither a letter nor number, or has both letters and numbers
111063 // this needs to be after the step logic
111064 if (!noAlphaNum(a) || !noAlphaNum(b) || hasBoth(a) || hasBoth(b)) {
111065 if (!opts.silent) {
111066 throw new RangeError('fill-range: invalid range arguments.');
111067 }
111068 return null;
111069 }
111070
111071 // validate arguments
111072 var isNumA = isNumber(zeros(a));
111073 var isNumB = isNumber(zeros(b));
111074
111075 if ((!isNumA && isNumB) || (isNumA && !isNumB)) {
111076 if (!opts.silent) {
111077 throw new TypeError('fill-range: first range argument is incompatible with second.');
111078 }
111079 return null;
111080 }
111081
111082 // by this point both are the same, so we
111083 // can use A to check going forward.
111084 var isNum = isNumA;
111085 var num = formatStep(step);
111086
111087 // is the range alphabetical? or numeric?
111088 if (isNum) {
111089 // if numeric, coerce to an integer
111090 a = +a; b = +b;
111091 } else {
111092 // otherwise, get the charCode to expand alpha ranges
111093 a = a.charCodeAt(0);
111094 b = b.charCodeAt(0);
111095 }
111096
111097 // is the pattern descending?
111098 var isDescending = a > b;
111099
111100 // don't create a character class if the args are < 0
111101 if (a < 0 || b < 0) {
111102 expand = false;
111103 regex = false;
111104 }
111105
111106 // detect padding
111107 var padding = isPadded(origA, origB);
111108 var res, pad, arr = [];
111109 var ii = 0;
111110
111111 // character classes, ranges and logical `or`
111112 if (regex) {
111113 if (shouldExpand(a, b, num, isNum, padding, opts)) {
111114 // make sure the correct separator is used
111115 if (sep === '|' || sep === '~') {
111116 sep = detectSeparator(a, b, num, isNum, isDescending);
111117 }
111118 return wrap([origA, origB], sep, opts);
111119 }
111120 }
111121
111122 while (isDescending ? (a >= b) : (a <= b)) {
111123 if (padding && isNum) {
111124 pad = padding(a);
111125 }
111126
111127 // custom function
111128 if (typeof fn === 'function') {
111129 res = fn(a, isNum, pad, ii++);
111130
111131 // letters
111132 } else if (!isNum) {
111133 if (regex && isInvalidChar(a)) {
111134 res = null;
111135 } else {
111136 res = String.fromCharCode(a);
111137 }
111138
111139 // numbers
111140 } else {
111141 res = formatPadding(a, pad);
111142 }
111143
111144 // add result to the array, filtering any nulled values
111145 if (res !== null) arr.push(res);
111146
111147 // increment or decrement
111148 if (isDescending) {
111149 a -= num;
111150 } else {
111151 a += num;
111152 }
111153 }
111154
111155 // now that the array is expanded, we need to handle regex
111156 // character classes, ranges or logical `or` that wasn't
111157 // already handled before the loop
111158 if ((regex || expand) && !opts.noexpand) {
111159 // make sure the correct separator is used
111160 if (sep === '|' || sep === '~') {
111161 sep = detectSeparator(a, b, num, isNum, isDescending);
111162 }
111163 if (arr.length === 1 || a < 0 || b < 0) { return arr; }
111164 return wrap(arr, sep, opts);
111165 }
111166
111167 return arr;
111168}
111169
111170/**
111171 * Wrap the string with the correct regex
111172 * syntax.
111173 */
111174
111175function wrap(arr, sep, opts) {
111176 if (sep === '~') { sep = '-'; }
111177 var str = arr.join(sep);
111178 var pre = opts && opts.regexPrefix;
111179
111180 // regex logical `or`
111181 if (sep === '|') {
111182 str = pre ? pre + str : str;
111183 str = '(' + str + ')';
111184 }
111185
111186 // regex character class
111187 if (sep === '-') {
111188 str = (pre && pre === '^')
111189 ? pre + str
111190 : str;
111191 str = '[' + str + ']';
111192 }
111193 return [str];
111194}
111195
111196/**
111197 * Check for invalid characters
111198 */
111199
111200function isCharClass(a, b, step, isNum, isDescending) {
111201 if (isDescending) { return false; }
111202 if (isNum) { return a <= 9 && b <= 9; }
111203 if (a < b) { return step === 1; }
111204 return false;
111205}
111206
111207/**
111208 * Detect the correct separator to use
111209 */
111210
111211function shouldExpand(a, b, num, isNum, padding, opts) {
111212 if (isNum && (a > 9 || b > 9)) { return false; }
111213 return !padding && num === 1 && a < b;
111214}
111215
111216/**
111217 * Detect the correct separator to use
111218 */
111219
111220function detectSeparator(a, b, step, isNum, isDescending) {
111221 var isChar = isCharClass(a, b, step, isNum, isDescending);
111222 if (!isChar) {
111223 return '|';
111224 }
111225 return '~';
111226}
111227
111228/**
111229 * Correctly format the step based on type
111230 */
111231
111232function formatStep(step) {
111233 return Math.abs(step >> 0) || 1;
111234}
111235
111236/**
111237 * Format padding, taking leading `-` into account
111238 */
111239
111240function formatPadding(ch, pad) {
111241 var res = pad ? pad + ch : ch;
111242 if (pad && ch.toString().charAt(0) === '-') {
111243 res = '-' + pad + ch.toString().substr(1);
111244 }
111245 return res.toString();
111246}
111247
111248/**
111249 * Check for invalid characters
111250 */
111251
111252function isInvalidChar(str) {
111253 var ch = toStr(str);
111254 return ch === '\\'
111255 || ch === '['
111256 || ch === ']'
111257 || ch === '^'
111258 || ch === '('
111259 || ch === ')'
111260 || ch === '`';
111261}
111262
111263/**
111264 * Convert to a string from a charCode
111265 */
111266
111267function toStr(ch) {
111268 return String.fromCharCode(ch);
111269}
111270
111271
111272/**
111273 * Step regex
111274 */
111275
111276function stepRe() {
111277 return /\?|>|\||\+|\~/g;
111278}
111279
111280/**
111281 * Return true if `val` has either a letter
111282 * or a number
111283 */
111284
111285function noAlphaNum(val) {
111286 return /[a-z0-9]/i.test(val);
111287}
111288
111289/**
111290 * Return true if `val` has both a letter and
111291 * a number (invalid)
111292 */
111293
111294function hasBoth(val) {
111295 return /[a-z][0-9]|[0-9][a-z]/i.test(val);
111296}
111297
111298/**
111299 * Normalize zeros for checks
111300 */
111301
111302function zeros(val) {
111303 if (/^-*0+$/.test(val.toString())) {
111304 return '0';
111305 }
111306 return val;
111307}
111308
111309/**
111310 * Return true if `val` has leading zeros,
111311 * or a similar valid pattern.
111312 */
111313
111314function hasZeros(val) {
111315 return /[^.]\.|^-*0+[0-9]/.test(val);
111316}
111317
111318/**
111319 * If the string is padded, returns a curried function with
111320 * the a cached padding string, or `false` if no padding.
111321 *
111322 * @param {*} `origA` String or number.
111323 * @return {String|Boolean}
111324 */
111325
111326function isPadded(origA, origB) {
111327 if (hasZeros(origA) || hasZeros(origB)) {
111328 var alen = length(origA);
111329 var blen = length(origB);
111330
111331 var len = alen >= blen
111332 ? alen
111333 : blen;
111334
111335 return function (a) {
111336 return repeatStr('0', len - length(a));
111337 };
111338 }
111339 return false;
111340}
111341
111342/**
111343 * Get the string length of `val`
111344 */
111345
111346function length(val) {
111347 return val.toString().length;
111348}
111349
111350
111351/***/ }),
111352/* 666 */
111353/***/ (function(module, exports, __webpack_require__) {
111354
111355"use strict";
111356/*!
111357 * is-number <https://github.com/jonschlinkert/is-number>
111358 *
111359 * Copyright (c) 2014-2015, Jon Schlinkert.
111360 * Licensed under the MIT License.
111361 */
111362
111363
111364
111365var typeOf = __webpack_require__(169);
111366
111367module.exports = function isNumber(num) {
111368 var type = typeOf(num);
111369 if (type !== 'number' && type !== 'string') {
111370 return false;
111371 }
111372 var n = +num;
111373 return (n - n + 1) >= 0 && num !== '';
111374};
111375
111376
111377/***/ }),
111378/* 667 */
111379/***/ (function(module, exports, __webpack_require__) {
111380
111381"use strict";
111382/*!
111383 * isobject <https://github.com/jonschlinkert/isobject>
111384 *
111385 * Copyright (c) 2014-2015, Jon Schlinkert.
111386 * Licensed under the MIT License.
111387 */
111388
111389
111390
111391var isArray = __webpack_require__(366);
111392
111393module.exports = function isObject(val) {
111394 return val != null && typeof val === 'object' && isArray(val) === false;
111395};
111396
111397
111398/***/ }),
111399/* 668 */
111400/***/ (function(module, exports, __webpack_require__) {
111401
111402"use strict";
111403/*!
111404 * extglob <https://github.com/jonschlinkert/extglob>
111405 *
111406 * Copyright (c) 2015, Jon Schlinkert.
111407 * Licensed under the MIT License.
111408 */
111409
111410
111411
111412/**
111413 * Module dependencies
111414 */
111415
111416var isExtglob = __webpack_require__(166);
111417var re, cache = {};
111418
111419/**
111420 * Expose `extglob`
111421 */
111422
111423module.exports = extglob;
111424
111425/**
111426 * Convert the given extglob `string` to a regex-compatible
111427 * string.
111428 *
111429 * ```js
111430 * var extglob = require('extglob');
111431 * extglob('!(a?(b))');
111432 * //=> '(?!a(?:b)?)[^/]*?'
111433 * ```
111434 *
111435 * @param {String} `str` The string to convert.
111436 * @param {Object} `options`
111437 * @option {Boolean} [options] `esc` If `false` special characters will not be escaped. Defaults to `true`.
111438 * @option {Boolean} [options] `regex` If `true` a regular expression is returned instead of a string.
111439 * @return {String}
111440 * @api public
111441 */
111442
111443
111444function extglob(str, opts) {
111445 opts = opts || {};
111446 var o = {}, i = 0;
111447
111448 // fix common character reversals
111449 // '*!(.js)' => '*.!(js)'
111450 str = str.replace(/!\(([^\w*()])/g, '$1!(');
111451
111452 // support file extension negation
111453 str = str.replace(/([*\/])\.!\([*]\)/g, function (m, ch) {
111454 if (ch === '/') {
111455 return escape('\\/[^.]+');
111456 }
111457 return escape('[^.]+');
111458 });
111459
111460 // create a unique key for caching by
111461 // combining the string and options
111462 var key = str
111463 + String(!!opts.regex)
111464 + String(!!opts.contains)
111465 + String(!!opts.escape);
111466
111467 if (cache.hasOwnProperty(key)) {
111468 return cache[key];
111469 }
111470
111471 if (!(re instanceof RegExp)) {
111472 re = regex();
111473 }
111474
111475 opts.negate = false;
111476 var m;
111477
111478 while (m = re.exec(str)) {
111479 var prefix = m[1];
111480 var inner = m[3];
111481 if (prefix === '!') {
111482 opts.negate = true;
111483 }
111484
111485 var id = '__EXTGLOB_' + (i++) + '__';
111486 // use the prefix of the _last_ (outtermost) pattern
111487 o[id] = wrap(inner, prefix, opts.escape);
111488 str = str.split(m[0]).join(id);
111489 }
111490
111491 var keys = Object.keys(o);
111492 var len = keys.length;
111493
111494 // we have to loop again to allow us to convert
111495 // patterns in reverse order (starting with the
111496 // innermost/last pattern first)
111497 while (len--) {
111498 var prop = keys[len];
111499 str = str.split(prop).join(o[prop]);
111500 }
111501
111502 var result = opts.regex
111503 ? toRegex(str, opts.contains, opts.negate)
111504 : str;
111505
111506 result = result.split('.').join('\\.');
111507
111508 // cache the result and return it
111509 return (cache[key] = result);
111510}
111511
111512/**
111513 * Convert `string` to a regex string.
111514 *
111515 * @param {String} `str`
111516 * @param {String} `prefix` Character that determines how to wrap the string.
111517 * @param {Boolean} `esc` If `false` special characters will not be escaped. Defaults to `true`.
111518 * @return {String}
111519 */
111520
111521function wrap(inner, prefix, esc) {
111522 if (esc) inner = escape(inner);
111523
111524 switch (prefix) {
111525 case '!':
111526 return '(?!' + inner + ')[^/]' + (esc ? '%%%~' : '*?');
111527 case '@':
111528 return '(?:' + inner + ')';
111529 case '+':
111530 return '(?:' + inner + ')+';
111531 case '*':
111532 return '(?:' + inner + ')' + (esc ? '%%' : '*')
111533 case '?':
111534 return '(?:' + inner + '|)';
111535 default:
111536 return inner;
111537 }
111538}
111539
111540function escape(str) {
111541 str = str.split('*').join('[^/]%%%~');
111542 str = str.split('.').join('\\.');
111543 return str;
111544}
111545
111546/**
111547 * extglob regex.
111548 */
111549
111550function regex() {
111551 return /(\\?[@?!+*$]\\?)(\(([^()]*?)\))/;
111552}
111553
111554/**
111555 * Negation regex
111556 */
111557
111558function negate(str) {
111559 return '(?!^' + str + ').*$';
111560}
111561
111562/**
111563 * Create the regex to do the matching. If
111564 * the leading character in the `pattern` is `!`
111565 * a negation regex is returned.
111566 *
111567 * @param {String} `pattern`
111568 * @param {Boolean} `contains` Allow loose matching.
111569 * @param {Boolean} `isNegated` True if the pattern is a negation pattern.
111570 */
111571
111572function toRegex(pattern, contains, isNegated) {
111573 var prefix = contains ? '^' : '';
111574 var after = contains ? '$' : '';
111575 pattern = ('(?:' + pattern + ')' + after);
111576 if (isNegated) {
111577 pattern = prefix + negate(pattern);
111578 }
111579 return new RegExp(prefix + pattern);
111580}
111581
111582
111583/***/ }),
111584/* 669 */
111585/***/ (function(module, exports, __webpack_require__) {
111586
111587/*
111588 * extsprintf.js: extended POSIX-style sprintf
111589 */
111590
111591var mod_assert = __webpack_require__(50);
111592var mod_util = __webpack_require__(9);
111593
111594/*
111595 * Public interface
111596 */
111597exports.sprintf = jsSprintf;
111598exports.printf = jsPrintf;
111599exports.fprintf = jsFprintf;
111600
111601/*
111602 * Stripped down version of s[n]printf(3c). We make a best effort to throw an
111603 * exception when given a format string we don't understand, rather than
111604 * ignoring it, so that we won't break existing programs if/when we go implement
111605 * the rest of this.
111606 *
111607 * This implementation currently supports specifying
111608 * - field alignment ('-' flag),
111609 * - zero-pad ('0' flag)
111610 * - always show numeric sign ('+' flag),
111611 * - field width
111612 * - conversions for strings, decimal integers, and floats (numbers).
111613 * - argument size specifiers. These are all accepted but ignored, since
111614 * Javascript has no notion of the physical size of an argument.
111615 *
111616 * Everything else is currently unsupported, most notably precision, unsigned
111617 * numbers, non-decimal numbers, and characters.
111618 */
111619function jsSprintf(fmt)
111620{
111621 var regex = [
111622 '([^%]*)', /* normal text */
111623 '%', /* start of format */
111624 '([\'\\-+ #0]*?)', /* flags (optional) */
111625 '([1-9]\\d*)?', /* width (optional) */
111626 '(\\.([1-9]\\d*))?', /* precision (optional) */
111627 '[lhjztL]*?', /* length mods (ignored) */
111628 '([diouxXfFeEgGaAcCsSp%jr])' /* conversion */
111629 ].join('');
111630
111631 var re = new RegExp(regex);
111632 var args = Array.prototype.slice.call(arguments, 1);
111633 var flags, width, precision, conversion;
111634 var left, pad, sign, arg, match;
111635 var ret = '';
111636 var argn = 1;
111637
111638 mod_assert.equal('string', typeof (fmt));
111639
111640 while ((match = re.exec(fmt)) !== null) {
111641 ret += match[1];
111642 fmt = fmt.substring(match[0].length);
111643
111644 flags = match[2] || '';
111645 width = match[3] || 0;
111646 precision = match[4] || '';
111647 conversion = match[6];
111648 left = false;
111649 sign = false;
111650 pad = ' ';
111651
111652 if (conversion == '%') {
111653 ret += '%';
111654 continue;
111655 }
111656
111657 if (args.length === 0)
111658 throw (new Error('too few args to sprintf'));
111659
111660 arg = args.shift();
111661 argn++;
111662
111663 if (flags.match(/[\' #]/))
111664 throw (new Error(
111665 'unsupported flags: ' + flags));
111666
111667 if (precision.length > 0)
111668 throw (new Error(
111669 'non-zero precision not supported'));
111670
111671 if (flags.match(/-/))
111672 left = true;
111673
111674 if (flags.match(/0/))
111675 pad = '0';
111676
111677 if (flags.match(/\+/))
111678 sign = true;
111679
111680 switch (conversion) {
111681 case 's':
111682 if (arg === undefined || arg === null)
111683 throw (new Error('argument ' + argn +
111684 ': attempted to print undefined or null ' +
111685 'as a string'));
111686 ret += doPad(pad, width, left, arg.toString());
111687 break;
111688
111689 case 'd':
111690 arg = Math.floor(arg);
111691 /*jsl:fallthru*/
111692 case 'f':
111693 sign = sign && arg > 0 ? '+' : '';
111694 ret += sign + doPad(pad, width, left,
111695 arg.toString());
111696 break;
111697
111698 case 'x':
111699 ret += doPad(pad, width, left, arg.toString(16));
111700 break;
111701
111702 case 'j': /* non-standard */
111703 if (width === 0)
111704 width = 10;
111705 ret += mod_util.inspect(arg, false, width);
111706 break;
111707
111708 case 'r': /* non-standard */
111709 ret += dumpException(arg);
111710 break;
111711
111712 default:
111713 throw (new Error('unsupported conversion: ' +
111714 conversion));
111715 }
111716 }
111717
111718 ret += fmt;
111719 return (ret);
111720}
111721
111722function jsPrintf() {
111723 var args = Array.prototype.slice.call(arguments);
111724 args.unshift(process.stdout);
111725 jsFprintf.apply(null, args);
111726}
111727
111728function jsFprintf(stream) {
111729 var args = Array.prototype.slice.call(arguments, 1);
111730 return (stream.write(jsSprintf.apply(this, args)));
111731}
111732
111733function doPad(chr, width, left, str)
111734{
111735 var ret = str;
111736
111737 while (ret.length < width) {
111738 if (left)
111739 ret += chr;
111740 else
111741 ret = chr + ret;
111742 }
111743
111744 return (ret);
111745}
111746
111747/*
111748 * This function dumps long stack traces for exceptions having a cause() method.
111749 * See node-verror for an example.
111750 */
111751function dumpException(ex)
111752{
111753 var ret;
111754
111755 if (!(ex instanceof Error))
111756 throw (new Error(jsSprintf('invalid type for %%r: %j', ex)));
111757
111758 /* Note that V8 prepends "ex.stack" with ex.toString(). */
111759 ret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack;
111760
111761 if (ex.cause && typeof (ex.cause) === 'function') {
111762 var cex = ex.cause();
111763 if (cex) {
111764 ret += '\nCaused by: ' + dumpException(cex);
111765 }
111766 }
111767
111768 return (ret);
111769}
111770
111771
111772/***/ }),
111773/* 670 */
111774/***/ (function(module, exports) {
111775
111776/*!
111777 * filename-regex <https://github.com/regexps/filename-regex>
111778 *
111779 * Copyright (c) 2014-2015, Jon Schlinkert
111780 * Licensed under the MIT license.
111781 */
111782
111783module.exports = function filenameRegex() {
111784 return /([^\\\/]+)$/;
111785};
111786
111787
111788/***/ }),
111789/* 671 */
111790/***/ (function(module, exports, __webpack_require__) {
111791
111792"use strict";
111793/*!
111794 * for-in <https://github.com/jonschlinkert/for-in>
111795 *
111796 * Copyright (c) 2014-2017, Jon Schlinkert.
111797 * Released under the MIT License.
111798 */
111799
111800
111801
111802module.exports = function forIn(obj, fn, thisArg) {
111803 for (var key in obj) {
111804 if (fn.call(thisArg, obj[key], key, obj) === false) {
111805 break;
111806 }
111807 }
111808};
111809
111810
111811/***/ }),
111812/* 672 */
111813/***/ (function(module, exports, __webpack_require__) {
111814
111815module.exports = ForeverAgent
111816ForeverAgent.SSL = ForeverAgentSSL
111817
111818var util = __webpack_require__(9)
111819 , Agent = __webpack_require__(83).Agent
111820 , net = __webpack_require__(151)
111821 , tls = __webpack_require__(440)
111822 , AgentSSL = __webpack_require__(185).Agent
111823
111824function getConnectionName(host, port) {
111825 var name = ''
111826 if (typeof host === 'string') {
111827 name = host + ':' + port
111828 } else {
111829 // For node.js v012.0 and iojs-v1.5.1, host is an object. And any existing localAddress is part of the connection name.
111830 name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':')
111831 }
111832 return name
111833}
111834
111835function ForeverAgent(options) {
111836 var self = this
111837 self.options = options || {}
111838 self.requests = {}
111839 self.sockets = {}
111840 self.freeSockets = {}
111841 self.maxSockets = self.options.maxSockets || Agent.defaultMaxSockets
111842 self.minSockets = self.options.minSockets || ForeverAgent.defaultMinSockets
111843 self.on('free', function(socket, host, port) {
111844 var name = getConnectionName(host, port)
111845
111846 if (self.requests[name] && self.requests[name].length) {
111847 self.requests[name].shift().onSocket(socket)
111848 } else if (self.sockets[name].length < self.minSockets) {
111849 if (!self.freeSockets[name]) self.freeSockets[name] = []
111850 self.freeSockets[name].push(socket)
111851
111852 // if an error happens while we don't use the socket anyway, meh, throw the socket away
111853 var onIdleError = function() {
111854 socket.destroy()
111855 }
111856 socket._onIdleError = onIdleError
111857 socket.on('error', onIdleError)
111858 } else {
111859 // If there are no pending requests just destroy the
111860 // socket and it will get removed from the pool. This
111861 // gets us out of timeout issues and allows us to
111862 // default to Connection:keep-alive.
111863 socket.destroy()
111864 }
111865 })
111866
111867}
111868util.inherits(ForeverAgent, Agent)
111869
111870ForeverAgent.defaultMinSockets = 5
111871
111872
111873ForeverAgent.prototype.createConnection = net.createConnection
111874ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest
111875ForeverAgent.prototype.addRequest = function(req, host, port) {
111876 var name = getConnectionName(host, port)
111877
111878 if (typeof host !== 'string') {
111879 var options = host
111880 port = options.port
111881 host = options.host
111882 }
111883
111884 if (this.freeSockets[name] && this.freeSockets[name].length > 0 && !req.useChunkedEncodingByDefault) {
111885 var idleSocket = this.freeSockets[name].pop()
111886 idleSocket.removeListener('error', idleSocket._onIdleError)
111887 delete idleSocket._onIdleError
111888 req._reusedSocket = true
111889 req.onSocket(idleSocket)
111890 } else {
111891 this.addRequestNoreuse(req, host, port)
111892 }
111893}
111894
111895ForeverAgent.prototype.removeSocket = function(s, name, host, port) {
111896 if (this.sockets[name]) {
111897 var index = this.sockets[name].indexOf(s)
111898 if (index !== -1) {
111899 this.sockets[name].splice(index, 1)
111900 }
111901 } else if (this.sockets[name] && this.sockets[name].length === 0) {
111902 // don't leak
111903 delete this.sockets[name]
111904 delete this.requests[name]
111905 }
111906
111907 if (this.freeSockets[name]) {
111908 var index = this.freeSockets[name].indexOf(s)
111909 if (index !== -1) {
111910 this.freeSockets[name].splice(index, 1)
111911 if (this.freeSockets[name].length === 0) {
111912 delete this.freeSockets[name]
111913 }
111914 }
111915 }
111916
111917 if (this.requests[name] && this.requests[name].length) {
111918 // If we have pending requests and a socket gets closed a new one
111919 // needs to be created to take over in the pool for the one that closed.
111920 this.createSocket(name, host, port).emit('free')
111921 }
111922}
111923
111924function ForeverAgentSSL (options) {
111925 ForeverAgent.call(this, options)
111926}
111927util.inherits(ForeverAgentSSL, ForeverAgent)
111928
111929ForeverAgentSSL.prototype.createConnection = createConnectionSSL
111930ForeverAgentSSL.prototype.addRequestNoreuse = AgentSSL.prototype.addRequest
111931
111932function createConnectionSSL (port, host, options) {
111933 if (typeof port === 'object') {
111934 options = port;
111935 } else if (typeof host === 'object') {
111936 options = host;
111937 } else if (typeof options === 'object') {
111938 options = options;
111939 } else {
111940 options = {};
111941 }
111942
111943 if (typeof port === 'number') {
111944 options.port = port;
111945 }
111946
111947 if (typeof host === 'string') {
111948 options.host = host;
111949 }
111950
111951 return tls.connect(options);
111952}
111953
111954
111955/***/ }),
111956/* 673 */
111957/***/ (function(module, exports, __webpack_require__) {
111958
111959var CombinedStream = __webpack_require__(323);
111960var util = __webpack_require__(9);
111961var path = __webpack_require__(1);
111962var http = __webpack_require__(83);
111963var https = __webpack_require__(185);
111964var parseUrl = __webpack_require__(29).parse;
111965var fs = __webpack_require__(12);
111966var mime = __webpack_require__(370);
111967var asynckit = __webpack_require__(458);
111968var populate = __webpack_require__(674);
111969
111970// Public API
111971module.exports = FormData;
111972
111973// make it a Stream
111974util.inherits(FormData, CombinedStream);
111975
111976/**
111977 * Create readable "multipart/form-data" streams.
111978 * Can be used to submit forms
111979 * and file uploads to other web applications.
111980 *
111981 * @constructor
111982 * @param {Object} options - Properties to be added/overriden for FormData and CombinedStream
111983 */
111984function FormData(options) {
111985 if (!(this instanceof FormData)) {
111986 return new FormData();
111987 }
111988
111989 this._overheadLength = 0;
111990 this._valueLength = 0;
111991 this._valuesToMeasure = [];
111992
111993 CombinedStream.call(this);
111994
111995 options = options || {};
111996 for (var option in options) {
111997 this[option] = options[option];
111998 }
111999}
112000
112001FormData.LINE_BREAK = '\r\n';
112002FormData.DEFAULT_CONTENT_TYPE = 'application/octet-stream';
112003
112004FormData.prototype.append = function(field, value, options) {
112005
112006 options = options || {};
112007
112008 // allow filename as single option
112009 if (typeof options == 'string') {
112010 options = {filename: options};
112011 }
112012
112013 var append = CombinedStream.prototype.append.bind(this);
112014
112015 // all that streamy business can't handle numbers
112016 if (typeof value == 'number') {
112017 value = '' + value;
112018 }
112019
112020 // https://github.com/felixge/node-form-data/issues/38
112021 if (util.isArray(value)) {
112022 // Please convert your array into string
112023 // the way web server expects it
112024 this._error(new Error('Arrays are not supported.'));
112025 return;
112026 }
112027
112028 var header = this._multiPartHeader(field, value, options);
112029 var footer = this._multiPartFooter();
112030
112031 append(header);
112032 append(value);
112033 append(footer);
112034
112035 // pass along options.knownLength
112036 this._trackLength(header, value, options);
112037};
112038
112039FormData.prototype._trackLength = function(header, value, options) {
112040 var valueLength = 0;
112041
112042 // used w/ getLengthSync(), when length is known.
112043 // e.g. for streaming directly from a remote server,
112044 // w/ a known file a size, and not wanting to wait for
112045 // incoming file to finish to get its size.
112046 if (options.knownLength != null) {
112047 valueLength += +options.knownLength;
112048 } else if (Buffer.isBuffer(value)) {
112049 valueLength = value.length;
112050 } else if (typeof value === 'string') {
112051 valueLength = Buffer.byteLength(value);
112052 }
112053
112054 this._valueLength += valueLength;
112055
112056 // @check why add CRLF? does this account for custom/multiple CRLFs?
112057 this._overheadLength +=
112058 Buffer.byteLength(header) +
112059 FormData.LINE_BREAK.length;
112060
112061 // empty or either doesn't have path or not an http response
112062 if (!value || ( !value.path && !(value.readable && value.hasOwnProperty('httpVersion')) )) {
112063 return;
112064 }
112065
112066 // no need to bother with the length
112067 if (!options.knownLength) {
112068 this._valuesToMeasure.push(value);
112069 }
112070};
112071
112072FormData.prototype._lengthRetriever = function(value, callback) {
112073
112074 if (value.hasOwnProperty('fd')) {
112075
112076 // take read range into a account
112077 // `end` = Infinity –> read file till the end
112078 //
112079 // TODO: Looks like there is bug in Node fs.createReadStream
112080 // it doesn't respect `end` options without `start` options
112081 // Fix it when node fixes it.
112082 // https://github.com/joyent/node/issues/7819
112083 if (value.end != undefined && value.end != Infinity && value.start != undefined) {
112084
112085 // when end specified
112086 // no need to calculate range
112087 // inclusive, starts with 0
112088 callback(null, value.end + 1 - (value.start ? value.start : 0));
112089
112090 // not that fast snoopy
112091 } else {
112092 // still need to fetch file size from fs
112093 fs.stat(value.path, function(err, stat) {
112094
112095 var fileSize;
112096
112097 if (err) {
112098 callback(err);
112099 return;
112100 }
112101
112102 // update final size based on the range options
112103 fileSize = stat.size - (value.start ? value.start : 0);
112104 callback(null, fileSize);
112105 });
112106 }
112107
112108 // or http response
112109 } else if (value.hasOwnProperty('httpVersion')) {
112110 callback(null, +value.headers['content-length']);
112111
112112 // or request stream http://github.com/mikeal/request
112113 } else if (value.hasOwnProperty('httpModule')) {
112114 // wait till response come back
112115 value.on('response', function(response) {
112116 value.pause();
112117 callback(null, +response.headers['content-length']);
112118 });
112119 value.resume();
112120
112121 // something else
112122 } else {
112123 callback('Unknown stream');
112124 }
112125};
112126
112127FormData.prototype._multiPartHeader = function(field, value, options) {
112128 // custom header specified (as string)?
112129 // it becomes responsible for boundary
112130 // (e.g. to handle extra CRLFs on .NET servers)
112131 if (typeof options.header == 'string') {
112132 return options.header;
112133 }
112134
112135 var contentDisposition = this._getContentDisposition(value, options);
112136 var contentType = this._getContentType(value, options);
112137
112138 var contents = '';
112139 var headers = {
112140 // add custom disposition as third element or keep it two elements if not
112141 'Content-Disposition': ['form-data', 'name="' + field + '"'].concat(contentDisposition || []),
112142 // if no content type. allow it to be empty array
112143 'Content-Type': [].concat(contentType || [])
112144 };
112145
112146 // allow custom headers.
112147 if (typeof options.header == 'object') {
112148 populate(headers, options.header);
112149 }
112150
112151 var header;
112152 for (var prop in headers) {
112153 if (!headers.hasOwnProperty(prop)) continue;
112154 header = headers[prop];
112155
112156 // skip nullish headers.
112157 if (header == null) {
112158 continue;
112159 }
112160
112161 // convert all headers to arrays.
112162 if (!Array.isArray(header)) {
112163 header = [header];
112164 }
112165
112166 // add non-empty headers.
112167 if (header.length) {
112168 contents += prop + ': ' + header.join('; ') + FormData.LINE_BREAK;
112169 }
112170 }
112171
112172 return '--' + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
112173};
112174
112175FormData.prototype._getContentDisposition = function(value, options) {
112176
112177 var filename
112178 , contentDisposition
112179 ;
112180
112181 if (typeof options.filepath === 'string') {
112182 // custom filepath for relative paths
112183 filename = path.normalize(options.filepath).replace(/\\/g, '/');
112184 } else if (options.filename || value.name || value.path) {
112185 // custom filename take precedence
112186 // formidable and the browser add a name property
112187 // fs- and request- streams have path property
112188 filename = path.basename(options.filename || value.name || value.path);
112189 } else if (value.readable && value.hasOwnProperty('httpVersion')) {
112190 // or try http response
112191 filename = path.basename(value.client._httpMessage.path);
112192 }
112193
112194 if (filename) {
112195 contentDisposition = 'filename="' + filename + '"';
112196 }
112197
112198 return contentDisposition;
112199};
112200
112201FormData.prototype._getContentType = function(value, options) {
112202
112203 // use custom content-type above all
112204 var contentType = options.contentType;
112205
112206 // or try `name` from formidable, browser
112207 if (!contentType && value.name) {
112208 contentType = mime.lookup(value.name);
112209 }
112210
112211 // or try `path` from fs-, request- streams
112212 if (!contentType && value.path) {
112213 contentType = mime.lookup(value.path);
112214 }
112215
112216 // or if it's http-reponse
112217 if (!contentType && value.readable && value.hasOwnProperty('httpVersion')) {
112218 contentType = value.headers['content-type'];
112219 }
112220
112221 // or guess it from the filepath or filename
112222 if (!contentType && (options.filepath || options.filename)) {
112223 contentType = mime.lookup(options.filepath || options.filename);
112224 }
112225
112226 // fallback to the default content type if `value` is not simple value
112227 if (!contentType && typeof value == 'object') {
112228 contentType = FormData.DEFAULT_CONTENT_TYPE;
112229 }
112230
112231 return contentType;
112232};
112233
112234FormData.prototype._multiPartFooter = function() {
112235 return function(next) {
112236 var footer = FormData.LINE_BREAK;
112237
112238 var lastPart = (this._streams.length === 0);
112239 if (lastPart) {
112240 footer += this._lastBoundary();
112241 }
112242
112243 next(footer);
112244 }.bind(this);
112245};
112246
112247FormData.prototype._lastBoundary = function() {
112248 return '--' + this.getBoundary() + '--' + FormData.LINE_BREAK;
112249};
112250
112251FormData.prototype.getHeaders = function(userHeaders) {
112252 var header;
112253 var formHeaders = {
112254 'content-type': 'multipart/form-data; boundary=' + this.getBoundary()
112255 };
112256
112257 for (header in userHeaders) {
112258 if (userHeaders.hasOwnProperty(header)) {
112259 formHeaders[header.toLowerCase()] = userHeaders[header];
112260 }
112261 }
112262
112263 return formHeaders;
112264};
112265
112266FormData.prototype.getBoundary = function() {
112267 if (!this._boundary) {
112268 this._generateBoundary();
112269 }
112270
112271 return this._boundary;
112272};
112273
112274FormData.prototype._generateBoundary = function() {
112275 // This generates a 50 character boundary similar to those used by Firefox.
112276 // They are optimized for boyer-moore parsing.
112277 var boundary = '--------------------------';
112278 for (var i = 0; i < 24; i++) {
112279 boundary += Math.floor(Math.random() * 10).toString(16);
112280 }
112281
112282 this._boundary = boundary;
112283};
112284
112285// Note: getLengthSync DOESN'T calculate streams length
112286// As workaround one can calculate file size manually
112287// and add it as knownLength option
112288FormData.prototype.getLengthSync = function() {
112289 var knownLength = this._overheadLength + this._valueLength;
112290
112291 // Don't get confused, there are 3 "internal" streams for each keyval pair
112292 // so it basically checks if there is any value added to the form
112293 if (this._streams.length) {
112294 knownLength += this._lastBoundary().length;
112295 }
112296
112297 // https://github.com/form-data/form-data/issues/40
112298 if (!this.hasKnownLength()) {
112299 // Some async length retrievers are present
112300 // therefore synchronous length calculation is false.
112301 // Please use getLength(callback) to get proper length
112302 this._error(new Error('Cannot calculate proper length in synchronous way.'));
112303 }
112304
112305 return knownLength;
112306};
112307
112308// Public API to check if length of added values is known
112309// https://github.com/form-data/form-data/issues/196
112310// https://github.com/form-data/form-data/issues/262
112311FormData.prototype.hasKnownLength = function() {
112312 var hasKnownLength = true;
112313
112314 if (this._valuesToMeasure.length) {
112315 hasKnownLength = false;
112316 }
112317
112318 return hasKnownLength;
112319};
112320
112321FormData.prototype.getLength = function(cb) {
112322 var knownLength = this._overheadLength + this._valueLength;
112323
112324 if (this._streams.length) {
112325 knownLength += this._lastBoundary().length;
112326 }
112327
112328 if (!this._valuesToMeasure.length) {
112329 process.nextTick(cb.bind(this, null, knownLength));
112330 return;
112331 }
112332
112333 asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
112334 if (err) {
112335 cb(err);
112336 return;
112337 }
112338
112339 values.forEach(function(length) {
112340 knownLength += length;
112341 });
112342
112343 cb(null, knownLength);
112344 });
112345};
112346
112347FormData.prototype.submit = function(params, cb) {
112348 var request
112349 , options
112350 , defaults = {method: 'post'}
112351 ;
112352
112353 // parse provided url if it's string
112354 // or treat it as options object
112355 if (typeof params == 'string') {
112356
112357 params = parseUrl(params);
112358 options = populate({
112359 port: params.port,
112360 path: params.pathname,
112361 host: params.hostname,
112362 protocol: params.protocol
112363 }, defaults);
112364
112365 // use custom params
112366 } else {
112367
112368 options = populate(params, defaults);
112369 // if no port provided use default one
112370 if (!options.port) {
112371 options.port = options.protocol == 'https:' ? 443 : 80;
112372 }
112373 }
112374
112375 // put that good code in getHeaders to some use
112376 options.headers = this.getHeaders(params.headers);
112377
112378 // https if specified, fallback to http in any other case
112379 if (options.protocol == 'https:') {
112380 request = https.request(options);
112381 } else {
112382 request = http.request(options);
112383 }
112384
112385 // get content length and fire away
112386 this.getLength(function(err, length) {
112387 if (err) {
112388 this._error(err);
112389 return;
112390 }
112391
112392 // add content length
112393 request.setHeader('Content-Length', length);
112394
112395 this.pipe(request);
112396 if (cb) {
112397 request.on('error', cb);
112398 request.on('response', cb.bind(this, null));
112399 }
112400 }.bind(this));
112401
112402 return request;
112403};
112404
112405FormData.prototype._error = function(err) {
112406 if (!this.error) {
112407 this.error = err;
112408 this.pause();
112409 this.emit('error', err);
112410 }
112411};
112412
112413FormData.prototype.toString = function () {
112414 return '[object FormData]';
112415};
112416
112417
112418/***/ }),
112419/* 674 */
112420/***/ (function(module, exports) {
112421
112422// populates missing values
112423module.exports = function(dst, src) {
112424
112425 Object.keys(src).forEach(function(prop)
112426 {
112427 dst[prop] = dst[prop] || src[prop];
112428 });
112429
112430 return dst;
112431};
112432
112433
112434/***/ }),
112435/* 675 */
112436/***/ (function(module, exports, __webpack_require__) {
112437
112438module.exports = __webpack_require__(12).constants || __webpack_require__(439)
112439
112440
112441/***/ }),
112442/* 676 */
112443/***/ (function(module, exports, __webpack_require__) {
112444
112445// Copyright Joyent, Inc. and other Node contributors.
112446//
112447// Permission is hereby granted, free of charge, to any person obtaining a
112448// copy of this software and associated documentation files (the
112449// "Software"), to deal in the Software without restriction, including
112450// without limitation the rights to use, copy, modify, merge, publish,
112451// distribute, sublicense, and/or sell copies of the Software, and to permit
112452// persons to whom the Software is furnished to do so, subject to the
112453// following conditions:
112454//
112455// The above copyright notice and this permission notice shall be included
112456// in all copies or substantial portions of the Software.
112457//
112458// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
112459// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
112460// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
112461// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
112462// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
112463// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
112464// USE OR OTHER DEALINGS IN THE SOFTWARE.
112465
112466var pathModule = __webpack_require__(1);
112467var isWindows = process.platform === 'win32';
112468var fs = __webpack_require__(12);
112469
112470// JavaScript implementation of realpath, ported from node pre-v6
112471
112472var DEBUG = process.env.NODE_DEBUG && /fs/.test(process.env.NODE_DEBUG);
112473
112474function rethrow() {
112475 // Only enable in debug mode. A backtrace uses ~1000 bytes of heap space and
112476 // is fairly slow to generate.
112477 var callback;
112478 if (DEBUG) {
112479 var backtrace = new Error;
112480 callback = debugCallback;
112481 } else
112482 callback = missingCallback;
112483
112484 return callback;
112485
112486 function debugCallback(err) {
112487 if (err) {
112488 backtrace.message = err.message;
112489 err = backtrace;
112490 missingCallback(err);
112491 }
112492 }
112493
112494 function missingCallback(err) {
112495 if (err) {
112496 if (process.throwDeprecation)
112497 throw err; // Forgot a callback but don't know where? Use NODE_DEBUG=fs
112498 else if (!process.noDeprecation) {
112499 var msg = 'fs: missing callback ' + (err.stack || err.message);
112500 if (process.traceDeprecation)
112501 console.trace(msg);
112502 else
112503 console.error(msg);
112504 }
112505 }
112506 }
112507}
112508
112509function maybeCallback(cb) {
112510 return typeof cb === 'function' ? cb : rethrow();
112511}
112512
112513var normalize = pathModule.normalize;
112514
112515// Regexp that finds the next partion of a (partial) path
112516// result is [base_with_slash, base], e.g. ['somedir/', 'somedir']
112517if (isWindows) {
112518 var nextPartRe = /(.*?)(?:[\/\\]+|$)/g;
112519} else {
112520 var nextPartRe = /(.*?)(?:[\/]+|$)/g;
112521}
112522
112523// Regex to find the device root, including trailing slash. E.g. 'c:\\'.
112524if (isWindows) {
112525 var splitRootRe = /^(?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?[\\\/]*/;
112526} else {
112527 var splitRootRe = /^[\/]*/;
112528}
112529
112530exports.realpathSync = function realpathSync(p, cache) {
112531 // make p is absolute
112532 p = pathModule.resolve(p);
112533
112534 if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
112535 return cache[p];
112536 }
112537
112538 var original = p,
112539 seenLinks = {},
112540 knownHard = {};
112541
112542 // current character position in p
112543 var pos;
112544 // the partial path so far, including a trailing slash if any
112545 var current;
112546 // the partial path without a trailing slash (except when pointing at a root)
112547 var base;
112548 // the partial path scanned in the previous round, with slash
112549 var previous;
112550
112551 start();
112552
112553 function start() {
112554 // Skip over roots
112555 var m = splitRootRe.exec(p);
112556 pos = m[0].length;
112557 current = m[0];
112558 base = m[0];
112559 previous = '';
112560
112561 // On windows, check that the root exists. On unix there is no need.
112562 if (isWindows && !knownHard[base]) {
112563 fs.lstatSync(base);
112564 knownHard[base] = true;
112565 }
112566 }
112567
112568 // walk down the path, swapping out linked pathparts for their real
112569 // values
112570 // NB: p.length changes.
112571 while (pos < p.length) {
112572 // find the next part
112573 nextPartRe.lastIndex = pos;
112574 var result = nextPartRe.exec(p);
112575 previous = current;
112576 current += result[0];
112577 base = previous + result[1];
112578 pos = nextPartRe.lastIndex;
112579
112580 // continue if not a symlink
112581 if (knownHard[base] || (cache && cache[base] === base)) {
112582 continue;
112583 }
112584
112585 var resolvedLink;
112586 if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
112587 // some known symbolic link. no need to stat again.
112588 resolvedLink = cache[base];
112589 } else {
112590 var stat = fs.lstatSync(base);
112591 if (!stat.isSymbolicLink()) {
112592 knownHard[base] = true;
112593 if (cache) cache[base] = base;
112594 continue;
112595 }
112596
112597 // read the link if it wasn't read before
112598 // dev/ino always return 0 on windows, so skip the check.
112599 var linkTarget = null;
112600 if (!isWindows) {
112601 var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
112602 if (seenLinks.hasOwnProperty(id)) {
112603 linkTarget = seenLinks[id];
112604 }
112605 }
112606 if (linkTarget === null) {
112607 fs.statSync(base);
112608 linkTarget = fs.readlinkSync(base);
112609 }
112610 resolvedLink = pathModule.resolve(previous, linkTarget);
112611 // track this, if given a cache.
112612 if (cache) cache[base] = resolvedLink;
112613 if (!isWindows) seenLinks[id] = linkTarget;
112614 }
112615
112616 // resolve the link, then start over
112617 p = pathModule.resolve(resolvedLink, p.slice(pos));
112618 start();
112619 }
112620
112621 if (cache) cache[original] = p;
112622
112623 return p;
112624};
112625
112626
112627exports.realpath = function realpath(p, cache, cb) {
112628 if (typeof cb !== 'function') {
112629 cb = maybeCallback(cache);
112630 cache = null;
112631 }
112632
112633 // make p is absolute
112634 p = pathModule.resolve(p);
112635
112636 if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
112637 return process.nextTick(cb.bind(null, null, cache[p]));
112638 }
112639
112640 var original = p,
112641 seenLinks = {},
112642 knownHard = {};
112643
112644 // current character position in p
112645 var pos;
112646 // the partial path so far, including a trailing slash if any
112647 var current;
112648 // the partial path without a trailing slash (except when pointing at a root)
112649 var base;
112650 // the partial path scanned in the previous round, with slash
112651 var previous;
112652
112653 start();
112654
112655 function start() {
112656 // Skip over roots
112657 var m = splitRootRe.exec(p);
112658 pos = m[0].length;
112659 current = m[0];
112660 base = m[0];
112661 previous = '';
112662
112663 // On windows, check that the root exists. On unix there is no need.
112664 if (isWindows && !knownHard[base]) {
112665 fs.lstat(base, function(err) {
112666 if (err) return cb(err);
112667 knownHard[base] = true;
112668 LOOP();
112669 });
112670 } else {
112671 process.nextTick(LOOP);
112672 }
112673 }
112674
112675 // walk down the path, swapping out linked pathparts for their real
112676 // values
112677 function LOOP() {
112678 // stop if scanned past end of path
112679 if (pos >= p.length) {
112680 if (cache) cache[original] = p;
112681 return cb(null, p);
112682 }
112683
112684 // find the next part
112685 nextPartRe.lastIndex = pos;
112686 var result = nextPartRe.exec(p);
112687 previous = current;
112688 current += result[0];
112689 base = previous + result[1];
112690 pos = nextPartRe.lastIndex;
112691
112692 // continue if not a symlink
112693 if (knownHard[base] || (cache && cache[base] === base)) {
112694 return process.nextTick(LOOP);
112695 }
112696
112697 if (cache && Object.prototype.hasOwnProperty.call(cache, base)) {
112698 // known symbolic link. no need to stat again.
112699 return gotResolvedLink(cache[base]);
112700 }
112701
112702 return fs.lstat(base, gotStat);
112703 }
112704
112705 function gotStat(err, stat) {
112706 if (err) return cb(err);
112707
112708 // if not a symlink, skip to the next path part
112709 if (!stat.isSymbolicLink()) {
112710 knownHard[base] = true;
112711 if (cache) cache[base] = base;
112712 return process.nextTick(LOOP);
112713 }
112714
112715 // stat & read the link if not read before
112716 // call gotTarget as soon as the link target is known
112717 // dev/ino always return 0 on windows, so skip the check.
112718 if (!isWindows) {
112719 var id = stat.dev.toString(32) + ':' + stat.ino.toString(32);
112720 if (seenLinks.hasOwnProperty(id)) {
112721 return gotTarget(null, seenLinks[id], base);
112722 }
112723 }
112724 fs.stat(base, function(err) {
112725 if (err) return cb(err);
112726
112727 fs.readlink(base, function(err, target) {
112728 if (!isWindows) seenLinks[id] = target;
112729 gotTarget(err, target);
112730 });
112731 });
112732 }
112733
112734 function gotTarget(err, target, base) {
112735 if (err) return cb(err);
112736
112737 var resolvedLink = pathModule.resolve(previous, target);
112738 if (cache) cache[base] = resolvedLink;
112739 gotResolvedLink(resolvedLink);
112740 }
112741
112742 function gotResolvedLink(resolvedLink) {
112743 // resolve the link, then start over
112744 p = pathModule.resolve(resolvedLink, p.slice(pos));
112745 start();
112746 }
112747};
112748
112749
112750/***/ }),
112751/* 677 */
112752/***/ (function(module, exports, __webpack_require__) {
112753
112754"use strict";
112755/*!
112756 * glob-base <https://github.com/jonschlinkert/glob-base>
112757 *
112758 * Copyright (c) 2015, Jon Schlinkert.
112759 * Licensed under the MIT License.
112760 */
112761
112762
112763
112764var path = __webpack_require__(1);
112765var parent = __webpack_require__(678);
112766var isGlob = __webpack_require__(167);
112767
112768module.exports = function globBase(pattern) {
112769 if (typeof pattern !== 'string') {
112770 throw new TypeError('glob-base expects a string.');
112771 }
112772
112773 var res = {};
112774 res.base = parent(pattern);
112775 res.isGlob = isGlob(pattern);
112776
112777 if (res.base !== '.') {
112778 res.glob = pattern.substr(res.base.length);
112779 if (res.glob.charAt(0) === '/') {
112780 res.glob = res.glob.substr(1);
112781 }
112782 } else {
112783 res.glob = pattern;
112784 }
112785
112786 if (!res.isGlob) {
112787 res.base = dirname(pattern);
112788 res.glob = res.base !== '.'
112789 ? pattern.substr(res.base.length)
112790 : pattern;
112791 }
112792
112793 if (res.glob.substr(0, 2) === './') {
112794 res.glob = res.glob.substr(2);
112795 }
112796 if (res.glob.charAt(0) === '/') {
112797 res.glob = res.glob.substr(1);
112798 }
112799 return res;
112800};
112801
112802function dirname(glob) {
112803 if (glob.slice(-1) === '/') return glob;
112804 return path.dirname(glob);
112805}
112806
112807
112808/***/ }),
112809/* 678 */
112810/***/ (function(module, exports, __webpack_require__) {
112811
112812"use strict";
112813
112814
112815var path = __webpack_require__(1);
112816var isglob = __webpack_require__(167);
112817
112818module.exports = function globParent(str) {
112819 str += 'a'; // preserves full path in case of trailing path separator
112820 do {str = path.dirname(str)} while (isglob(str));
112821 return str;
112822};
112823
112824
112825/***/ }),
112826/* 679 */
112827/***/ (function(module, exports, __webpack_require__) {
112828
112829module.exports = globSync
112830globSync.GlobSync = GlobSync
112831
112832var fs = __webpack_require__(12)
112833var rp = __webpack_require__(353)
112834var minimatch = __webpack_require__(170)
112835var Minimatch = minimatch.Minimatch
112836var Glob = __webpack_require__(234).Glob
112837var util = __webpack_require__(9)
112838var path = __webpack_require__(1)
112839var assert = __webpack_require__(50)
112840var isAbsolute = __webpack_require__(245)
112841var common = __webpack_require__(354)
112842var alphasort = common.alphasort
112843var alphasorti = common.alphasorti
112844var setopts = common.setopts
112845var ownProp = common.ownProp
112846var childrenIgnored = common.childrenIgnored
112847var isIgnored = common.isIgnored
112848
112849function globSync (pattern, options) {
112850 if (typeof options === 'function' || arguments.length === 3)
112851 throw new TypeError('callback provided to sync glob\n'+
112852 'See: https://github.com/isaacs/node-glob/issues/167')
112853
112854 return new GlobSync(pattern, options).found
112855}
112856
112857function GlobSync (pattern, options) {
112858 if (!pattern)
112859 throw new Error('must provide pattern')
112860
112861 if (typeof options === 'function' || arguments.length === 3)
112862 throw new TypeError('callback provided to sync glob\n'+
112863 'See: https://github.com/isaacs/node-glob/issues/167')
112864
112865 if (!(this instanceof GlobSync))
112866 return new GlobSync(pattern, options)
112867
112868 setopts(this, pattern, options)
112869
112870 if (this.noprocess)
112871 return this
112872
112873 var n = this.minimatch.set.length
112874 this.matches = new Array(n)
112875 for (var i = 0; i < n; i ++) {
112876 this._process(this.minimatch.set[i], i, false)
112877 }
112878 this._finish()
112879}
112880
112881GlobSync.prototype._finish = function () {
112882 assert(this instanceof GlobSync)
112883 if (this.realpath) {
112884 var self = this
112885 this.matches.forEach(function (matchset, index) {
112886 var set = self.matches[index] = Object.create(null)
112887 for (var p in matchset) {
112888 try {
112889 p = self._makeAbs(p)
112890 var real = rp.realpathSync(p, self.realpathCache)
112891 set[real] = true
112892 } catch (er) {
112893 if (er.syscall === 'stat')
112894 set[self._makeAbs(p)] = true
112895 else
112896 throw er
112897 }
112898 }
112899 })
112900 }
112901 common.finish(this)
112902}
112903
112904
112905GlobSync.prototype._process = function (pattern, index, inGlobStar) {
112906 assert(this instanceof GlobSync)
112907
112908 // Get the first [n] parts of pattern that are all strings.
112909 var n = 0
112910 while (typeof pattern[n] === 'string') {
112911 n ++
112912 }
112913 // now n is the index of the first one that is *not* a string.
112914
112915 // See if there's anything else
112916 var prefix
112917 switch (n) {
112918 // if not, then this is rather simple
112919 case pattern.length:
112920 this._processSimple(pattern.join('/'), index)
112921 return
112922
112923 case 0:
112924 // pattern *starts* with some non-trivial item.
112925 // going to readdir(cwd), but not include the prefix in matches.
112926 prefix = null
112927 break
112928
112929 default:
112930 // pattern has some string bits in the front.
112931 // whatever it starts with, whether that's 'absolute' like /foo/bar,
112932 // or 'relative' like '../baz'
112933 prefix = pattern.slice(0, n).join('/')
112934 break
112935 }
112936
112937 var remain = pattern.slice(n)
112938
112939 // get the list of entries.
112940 var read
112941 if (prefix === null)
112942 read = '.'
112943 else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
112944 if (!prefix || !isAbsolute(prefix))
112945 prefix = '/' + prefix
112946 read = prefix
112947 } else
112948 read = prefix
112949
112950 var abs = this._makeAbs(read)
112951
112952 //if ignored, skip processing
112953 if (childrenIgnored(this, read))
112954 return
112955
112956 var isGlobStar = remain[0] === minimatch.GLOBSTAR
112957 if (isGlobStar)
112958 this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
112959 else
112960 this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
112961}
112962
112963
112964GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
112965 var entries = this._readdir(abs, inGlobStar)
112966
112967 // if the abs isn't a dir, then nothing can match!
112968 if (!entries)
112969 return
112970
112971 // It will only match dot entries if it starts with a dot, or if
112972 // dot is set. Stuff like @(.foo|.bar) isn't allowed.
112973 var pn = remain[0]
112974 var negate = !!this.minimatch.negate
112975 var rawGlob = pn._glob
112976 var dotOk = this.dot || rawGlob.charAt(0) === '.'
112977
112978 var matchedEntries = []
112979 for (var i = 0; i < entries.length; i++) {
112980 var e = entries[i]
112981 if (e.charAt(0) !== '.' || dotOk) {
112982 var m
112983 if (negate && !prefix) {
112984 m = !e.match(pn)
112985 } else {
112986 m = e.match(pn)
112987 }
112988 if (m)
112989 matchedEntries.push(e)
112990 }
112991 }
112992
112993 var len = matchedEntries.length
112994 // If there are no matched entries, then nothing matches.
112995 if (len === 0)
112996 return
112997
112998 // if this is the last remaining pattern bit, then no need for
112999 // an additional stat *unless* the user has specified mark or
113000 // stat explicitly. We know they exist, since readdir returned
113001 // them.
113002
113003 if (remain.length === 1 && !this.mark && !this.stat) {
113004 if (!this.matches[index])
113005 this.matches[index] = Object.create(null)
113006
113007 for (var i = 0; i < len; i ++) {
113008 var e = matchedEntries[i]
113009 if (prefix) {
113010 if (prefix.slice(-1) !== '/')
113011 e = prefix + '/' + e
113012 else
113013 e = prefix + e
113014 }
113015
113016 if (e.charAt(0) === '/' && !this.nomount) {
113017 e = path.join(this.root, e)
113018 }
113019 this._emitMatch(index, e)
113020 }
113021 // This was the last one, and no stats were needed
113022 return
113023 }
113024
113025 // now test all matched entries as stand-ins for that part
113026 // of the pattern.
113027 remain.shift()
113028 for (var i = 0; i < len; i ++) {
113029 var e = matchedEntries[i]
113030 var newPattern
113031 if (prefix)
113032 newPattern = [prefix, e]
113033 else
113034 newPattern = [e]
113035 this._process(newPattern.concat(remain), index, inGlobStar)
113036 }
113037}
113038
113039
113040GlobSync.prototype._emitMatch = function (index, e) {
113041 if (isIgnored(this, e))
113042 return
113043
113044 var abs = this._makeAbs(e)
113045
113046 if (this.mark)
113047 e = this._mark(e)
113048
113049 if (this.absolute) {
113050 e = abs
113051 }
113052
113053 if (this.matches[index][e])
113054 return
113055
113056 if (this.nodir) {
113057 var c = this.cache[abs]
113058 if (c === 'DIR' || Array.isArray(c))
113059 return
113060 }
113061
113062 this.matches[index][e] = true
113063
113064 if (this.stat)
113065 this._stat(e)
113066}
113067
113068
113069GlobSync.prototype._readdirInGlobStar = function (abs) {
113070 // follow all symlinked directories forever
113071 // just proceed as if this is a non-globstar situation
113072 if (this.follow)
113073 return this._readdir(abs, false)
113074
113075 var entries
113076 var lstat
113077 var stat
113078 try {
113079 lstat = fs.lstatSync(abs)
113080 } catch (er) {
113081 if (er.code === 'ENOENT') {
113082 // lstat failed, doesn't exist
113083 return null
113084 }
113085 }
113086
113087 var isSym = lstat && lstat.isSymbolicLink()
113088 this.symlinks[abs] = isSym
113089
113090 // If it's not a symlink or a dir, then it's definitely a regular file.
113091 // don't bother doing a readdir in that case.
113092 if (!isSym && lstat && !lstat.isDirectory())
113093 this.cache[abs] = 'FILE'
113094 else
113095 entries = this._readdir(abs, false)
113096
113097 return entries
113098}
113099
113100GlobSync.prototype._readdir = function (abs, inGlobStar) {
113101 var entries
113102
113103 if (inGlobStar && !ownProp(this.symlinks, abs))
113104 return this._readdirInGlobStar(abs)
113105
113106 if (ownProp(this.cache, abs)) {
113107 var c = this.cache[abs]
113108 if (!c || c === 'FILE')
113109 return null
113110
113111 if (Array.isArray(c))
113112 return c
113113 }
113114
113115 try {
113116 return this._readdirEntries(abs, fs.readdirSync(abs))
113117 } catch (er) {
113118 this._readdirError(abs, er)
113119 return null
113120 }
113121}
113122
113123GlobSync.prototype._readdirEntries = function (abs, entries) {
113124 // if we haven't asked to stat everything, then just
113125 // assume that everything in there exists, so we can avoid
113126 // having to stat it a second time.
113127 if (!this.mark && !this.stat) {
113128 for (var i = 0; i < entries.length; i ++) {
113129 var e = entries[i]
113130 if (abs === '/')
113131 e = abs + e
113132 else
113133 e = abs + '/' + e
113134 this.cache[e] = true
113135 }
113136 }
113137
113138 this.cache[abs] = entries
113139
113140 // mark and cache dir-ness
113141 return entries
113142}
113143
113144GlobSync.prototype._readdirError = function (f, er) {
113145 // handle errors, and cache the information
113146 switch (er.code) {
113147 case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
113148 case 'ENOTDIR': // totally normal. means it *does* exist.
113149 var abs = this._makeAbs(f)
113150 this.cache[abs] = 'FILE'
113151 if (abs === this.cwdAbs) {
113152 var error = new Error(er.code + ' invalid cwd ' + this.cwd)
113153 error.path = this.cwd
113154 error.code = er.code
113155 throw error
113156 }
113157 break
113158
113159 case 'ENOENT': // not terribly unusual
113160 case 'ELOOP':
113161 case 'ENAMETOOLONG':
113162 case 'UNKNOWN':
113163 this.cache[this._makeAbs(f)] = false
113164 break
113165
113166 default: // some unusual error. Treat as failure.
113167 this.cache[this._makeAbs(f)] = false
113168 if (this.strict)
113169 throw er
113170 if (!this.silent)
113171 console.error('glob error', er)
113172 break
113173 }
113174}
113175
113176GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
113177
113178 var entries = this._readdir(abs, inGlobStar)
113179
113180 // no entries means not a dir, so it can never have matches
113181 // foo.txt/** doesn't match foo.txt
113182 if (!entries)
113183 return
113184
113185 // test without the globstar, and with every child both below
113186 // and replacing the globstar.
113187 var remainWithoutGlobStar = remain.slice(1)
113188 var gspref = prefix ? [ prefix ] : []
113189 var noGlobStar = gspref.concat(remainWithoutGlobStar)
113190
113191 // the noGlobStar pattern exits the inGlobStar state
113192 this._process(noGlobStar, index, false)
113193
113194 var len = entries.length
113195 var isSym = this.symlinks[abs]
113196
113197 // If it's a symlink, and we're in a globstar, then stop
113198 if (isSym && inGlobStar)
113199 return
113200
113201 for (var i = 0; i < len; i++) {
113202 var e = entries[i]
113203 if (e.charAt(0) === '.' && !this.dot)
113204 continue
113205
113206 // these two cases enter the inGlobStar state
113207 var instead = gspref.concat(entries[i], remainWithoutGlobStar)
113208 this._process(instead, index, true)
113209
113210 var below = gspref.concat(entries[i], remain)
113211 this._process(below, index, true)
113212 }
113213}
113214
113215GlobSync.prototype._processSimple = function (prefix, index) {
113216 // XXX review this. Shouldn't it be doing the mounting etc
113217 // before doing stat? kinda weird?
113218 var exists = this._stat(prefix)
113219
113220 if (!this.matches[index])
113221 this.matches[index] = Object.create(null)
113222
113223 // If it doesn't exist, then just mark the lack of results
113224 if (!exists)
113225 return
113226
113227 if (prefix && isAbsolute(prefix) && !this.nomount) {
113228 var trail = /[\/\\]$/.test(prefix)
113229 if (prefix.charAt(0) === '/') {
113230 prefix = path.join(this.root, prefix)
113231 } else {
113232 prefix = path.resolve(this.root, prefix)
113233 if (trail)
113234 prefix += '/'
113235 }
113236 }
113237
113238 if (process.platform === 'win32')
113239 prefix = prefix.replace(/\\/g, '/')
113240
113241 // Mark this as a match
113242 this._emitMatch(index, prefix)
113243}
113244
113245// Returns either 'DIR', 'FILE', or false
113246GlobSync.prototype._stat = function (f) {
113247 var abs = this._makeAbs(f)
113248 var needDir = f.slice(-1) === '/'
113249
113250 if (f.length > this.maxLength)
113251 return false
113252
113253 if (!this.stat && ownProp(this.cache, abs)) {
113254 var c = this.cache[abs]
113255
113256 if (Array.isArray(c))
113257 c = 'DIR'
113258
113259 // It exists, but maybe not how we need it
113260 if (!needDir || c === 'DIR')
113261 return c
113262
113263 if (needDir && c === 'FILE')
113264 return false
113265
113266 // otherwise we have to stat, because maybe c=true
113267 // if we know it exists, but not what it is.
113268 }
113269
113270 var exists
113271 var stat = this.statCache[abs]
113272 if (!stat) {
113273 var lstat
113274 try {
113275 lstat = fs.lstatSync(abs)
113276 } catch (er) {
113277 if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
113278 this.statCache[abs] = false
113279 return false
113280 }
113281 }
113282
113283 if (lstat && lstat.isSymbolicLink()) {
113284 try {
113285 stat = fs.statSync(abs)
113286 } catch (er) {
113287 stat = lstat
113288 }
113289 } else {
113290 stat = lstat
113291 }
113292 }
113293
113294 this.statCache[abs] = stat
113295
113296 var c = true
113297 if (stat)
113298 c = stat.isDirectory() ? 'DIR' : 'FILE'
113299
113300 this.cache[abs] = this.cache[abs] || c
113301
113302 if (needDir && c === 'FILE')
113303 return false
113304
113305 return c
113306}
113307
113308GlobSync.prototype._mark = function (p) {
113309 return common.mark(this, p)
113310}
113311
113312GlobSync.prototype._makeAbs = function (f) {
113313 return common.makeAbs(this, f)
113314}
113315
113316
113317/***/ }),
113318/* 680 */
113319/***/ (function(module, exports, __webpack_require__) {
113320
113321var Stream = __webpack_require__(35).Stream
113322
113323module.exports = legacy
113324
113325function legacy (fs) {
113326 return {
113327 ReadStream: ReadStream,
113328 WriteStream: WriteStream
113329 }
113330
113331 function ReadStream (path, options) {
113332 if (!(this instanceof ReadStream)) return new ReadStream(path, options);
113333
113334 Stream.call(this);
113335
113336 var self = this;
113337
113338 this.path = path;
113339 this.fd = null;
113340 this.readable = true;
113341 this.paused = false;
113342
113343 this.flags = 'r';
113344 this.mode = 438; /*=0666*/
113345 this.bufferSize = 64 * 1024;
113346
113347 options = options || {};
113348
113349 // Mixin options into this
113350 var keys = Object.keys(options);
113351 for (var index = 0, length = keys.length; index < length; index++) {
113352 var key = keys[index];
113353 this[key] = options[key];
113354 }
113355
113356 if (this.encoding) this.setEncoding(this.encoding);
113357
113358 if (this.start !== undefined) {
113359 if ('number' !== typeof this.start) {
113360 throw TypeError('start must be a Number');
113361 }
113362 if (this.end === undefined) {
113363 this.end = Infinity;
113364 } else if ('number' !== typeof this.end) {
113365 throw TypeError('end must be a Number');
113366 }
113367
113368 if (this.start > this.end) {
113369 throw new Error('start must be <= end');
113370 }
113371
113372 this.pos = this.start;
113373 }
113374
113375 if (this.fd !== null) {
113376 process.nextTick(function() {
113377 self._read();
113378 });
113379 return;
113380 }
113381
113382 fs.open(this.path, this.flags, this.mode, function (err, fd) {
113383 if (err) {
113384 self.emit('error', err);
113385 self.readable = false;
113386 return;
113387 }
113388
113389 self.fd = fd;
113390 self.emit('open', fd);
113391 self._read();
113392 })
113393 }
113394
113395 function WriteStream (path, options) {
113396 if (!(this instanceof WriteStream)) return new WriteStream(path, options);
113397
113398 Stream.call(this);
113399
113400 this.path = path;
113401 this.fd = null;
113402 this.writable = true;
113403
113404 this.flags = 'w';
113405 this.encoding = 'binary';
113406 this.mode = 438; /*=0666*/
113407 this.bytesWritten = 0;
113408
113409 options = options || {};
113410
113411 // Mixin options into this
113412 var keys = Object.keys(options);
113413 for (var index = 0, length = keys.length; index < length; index++) {
113414 var key = keys[index];
113415 this[key] = options[key];
113416 }
113417
113418 if (this.start !== undefined) {
113419 if ('number' !== typeof this.start) {
113420 throw TypeError('start must be a Number');
113421 }
113422 if (this.start < 0) {
113423 throw new Error('start must be >= zero');
113424 }
113425
113426 this.pos = this.start;
113427 }
113428
113429 this.busy = false;
113430 this._queue = [];
113431
113432 if (this.fd === null) {
113433 this._open = fs.open;
113434 this._queue.push([this._open, this.path, this.flags, this.mode, undefined]);
113435 this.flush();
113436 }
113437 }
113438}
113439
113440
113441/***/ }),
113442/* 681 */
113443/***/ (function(module, exports, __webpack_require__) {
113444
113445var fs = __webpack_require__(355)
113446var constants = __webpack_require__(439)
113447
113448var origCwd = process.cwd
113449var cwd = null
113450
113451var platform = process.env.GRACEFUL_FS_PLATFORM || process.platform
113452
113453process.cwd = function() {
113454 if (!cwd)
113455 cwd = origCwd.call(process)
113456 return cwd
113457}
113458try {
113459 process.cwd()
113460} catch (er) {}
113461
113462var chdir = process.chdir
113463process.chdir = function(d) {
113464 cwd = null
113465 chdir.call(process, d)
113466}
113467
113468module.exports = patch
113469
113470function patch (fs) {
113471 // (re-)implement some things that are known busted or missing.
113472
113473 // lchmod, broken prior to 0.6.2
113474 // back-port the fix here.
113475 if (constants.hasOwnProperty('O_SYMLINK') &&
113476 process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
113477 patchLchmod(fs)
113478 }
113479
113480 // lutimes implementation, or no-op
113481 if (!fs.lutimes) {
113482 patchLutimes(fs)
113483 }
113484
113485 // https://github.com/isaacs/node-graceful-fs/issues/4
113486 // Chown should not fail on einval or eperm if non-root.
113487 // It should not fail on enosys ever, as this just indicates
113488 // that a fs doesn't support the intended operation.
113489
113490 fs.chown = chownFix(fs.chown)
113491 fs.fchown = chownFix(fs.fchown)
113492 fs.lchown = chownFix(fs.lchown)
113493
113494 fs.chmod = chmodFix(fs.chmod)
113495 fs.fchmod = chmodFix(fs.fchmod)
113496 fs.lchmod = chmodFix(fs.lchmod)
113497
113498 fs.chownSync = chownFixSync(fs.chownSync)
113499 fs.fchownSync = chownFixSync(fs.fchownSync)
113500 fs.lchownSync = chownFixSync(fs.lchownSync)
113501
113502 fs.chmodSync = chmodFixSync(fs.chmodSync)
113503 fs.fchmodSync = chmodFixSync(fs.fchmodSync)
113504 fs.lchmodSync = chmodFixSync(fs.lchmodSync)
113505
113506 fs.stat = statFix(fs.stat)
113507 fs.fstat = statFix(fs.fstat)
113508 fs.lstat = statFix(fs.lstat)
113509
113510 fs.statSync = statFixSync(fs.statSync)
113511 fs.fstatSync = statFixSync(fs.fstatSync)
113512 fs.lstatSync = statFixSync(fs.lstatSync)
113513
113514 // if lchmod/lchown do not exist, then make them no-ops
113515 if (!fs.lchmod) {
113516 fs.lchmod = function (path, mode, cb) {
113517 if (cb) process.nextTick(cb)
113518 }
113519 fs.lchmodSync = function () {}
113520 }
113521 if (!fs.lchown) {
113522 fs.lchown = function (path, uid, gid, cb) {
113523 if (cb) process.nextTick(cb)
113524 }
113525 fs.lchownSync = function () {}
113526 }
113527
113528 // on Windows, A/V software can lock the directory, causing this
113529 // to fail with an EACCES or EPERM if the directory contains newly
113530 // created files. Try again on failure, for up to 60 seconds.
113531
113532 // Set the timeout this long because some Windows Anti-Virus, such as Parity
113533 // bit9, may lock files for up to a minute, causing npm package install
113534 // failures. Also, take care to yield the scheduler. Windows scheduling gives
113535 // CPU to a busy looping process, which can cause the program causing the lock
113536 // contention to be starved of CPU by node, so the contention doesn't resolve.
113537 if (platform === "win32") {
113538 fs.rename = (function (fs$rename) { return function (from, to, cb) {
113539 var start = Date.now()
113540 var backoff = 0;
113541 fs$rename(from, to, function CB (er) {
113542 if (er
113543 && (er.code === "EACCES" || er.code === "EPERM")
113544 && Date.now() - start < 60000) {
113545 setTimeout(function() {
113546 fs.stat(to, function (stater, st) {
113547 if (stater && stater.code === "ENOENT")
113548 fs$rename(from, to, CB);
113549 else
113550 cb(er)
113551 })
113552 }, backoff)
113553 if (backoff < 100)
113554 backoff += 10;
113555 return;
113556 }
113557 if (cb) cb(er)
113558 })
113559 }})(fs.rename)
113560 }
113561
113562 // if read() returns EAGAIN, then just try it again.
113563 fs.read = (function (fs$read) { return function (fd, buffer, offset, length, position, callback_) {
113564 var callback
113565 if (callback_ && typeof callback_ === 'function') {
113566 var eagCounter = 0
113567 callback = function (er, _, __) {
113568 if (er && er.code === 'EAGAIN' && eagCounter < 10) {
113569 eagCounter ++
113570 return fs$read.call(fs, fd, buffer, offset, length, position, callback)
113571 }
113572 callback_.apply(this, arguments)
113573 }
113574 }
113575 return fs$read.call(fs, fd, buffer, offset, length, position, callback)
113576 }})(fs.read)
113577
113578 fs.readSync = (function (fs$readSync) { return function (fd, buffer, offset, length, position) {
113579 var eagCounter = 0
113580 while (true) {
113581 try {
113582 return fs$readSync.call(fs, fd, buffer, offset, length, position)
113583 } catch (er) {
113584 if (er.code === 'EAGAIN' && eagCounter < 10) {
113585 eagCounter ++
113586 continue
113587 }
113588 throw er
113589 }
113590 }
113591 }})(fs.readSync)
113592}
113593
113594function patchLchmod (fs) {
113595 fs.lchmod = function (path, mode, callback) {
113596 fs.open( path
113597 , constants.O_WRONLY | constants.O_SYMLINK
113598 , mode
113599 , function (err, fd) {
113600 if (err) {
113601 if (callback) callback(err)
113602 return
113603 }
113604 // prefer to return the chmod error, if one occurs,
113605 // but still try to close, and report closing errors if they occur.
113606 fs.fchmod(fd, mode, function (err) {
113607 fs.close(fd, function(err2) {
113608 if (callback) callback(err || err2)
113609 })
113610 })
113611 })
113612 }
113613
113614 fs.lchmodSync = function (path, mode) {
113615 var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK, mode)
113616
113617 // prefer to return the chmod error, if one occurs,
113618 // but still try to close, and report closing errors if they occur.
113619 var threw = true
113620 var ret
113621 try {
113622 ret = fs.fchmodSync(fd, mode)
113623 threw = false
113624 } finally {
113625 if (threw) {
113626 try {
113627 fs.closeSync(fd)
113628 } catch (er) {}
113629 } else {
113630 fs.closeSync(fd)
113631 }
113632 }
113633 return ret
113634 }
113635}
113636
113637function patchLutimes (fs) {
113638 if (constants.hasOwnProperty("O_SYMLINK")) {
113639 fs.lutimes = function (path, at, mt, cb) {
113640 fs.open(path, constants.O_SYMLINK, function (er, fd) {
113641 if (er) {
113642 if (cb) cb(er)
113643 return
113644 }
113645 fs.futimes(fd, at, mt, function (er) {
113646 fs.close(fd, function (er2) {
113647 if (cb) cb(er || er2)
113648 })
113649 })
113650 })
113651 }
113652
113653 fs.lutimesSync = function (path, at, mt) {
113654 var fd = fs.openSync(path, constants.O_SYMLINK)
113655 var ret
113656 var threw = true
113657 try {
113658 ret = fs.futimesSync(fd, at, mt)
113659 threw = false
113660 } finally {
113661 if (threw) {
113662 try {
113663 fs.closeSync(fd)
113664 } catch (er) {}
113665 } else {
113666 fs.closeSync(fd)
113667 }
113668 }
113669 return ret
113670 }
113671
113672 } else {
113673 fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) }
113674 fs.lutimesSync = function () {}
113675 }
113676}
113677
113678function chmodFix (orig) {
113679 if (!orig) return orig
113680 return function (target, mode, cb) {
113681 return orig.call(fs, target, mode, function (er) {
113682 if (chownErOk(er)) er = null
113683 if (cb) cb.apply(this, arguments)
113684 })
113685 }
113686}
113687
113688function chmodFixSync (orig) {
113689 if (!orig) return orig
113690 return function (target, mode) {
113691 try {
113692 return orig.call(fs, target, mode)
113693 } catch (er) {
113694 if (!chownErOk(er)) throw er
113695 }
113696 }
113697}
113698
113699
113700function chownFix (orig) {
113701 if (!orig) return orig
113702 return function (target, uid, gid, cb) {
113703 return orig.call(fs, target, uid, gid, function (er) {
113704 if (chownErOk(er)) er = null
113705 if (cb) cb.apply(this, arguments)
113706 })
113707 }
113708}
113709
113710function chownFixSync (orig) {
113711 if (!orig) return orig
113712 return function (target, uid, gid) {
113713 try {
113714 return orig.call(fs, target, uid, gid)
113715 } catch (er) {
113716 if (!chownErOk(er)) throw er
113717 }
113718 }
113719}
113720
113721
113722function statFix (orig) {
113723 if (!orig) return orig
113724 // Older versions of Node erroneously returned signed integers for
113725 // uid + gid.
113726 return function (target, cb) {
113727 return orig.call(fs, target, function (er, stats) {
113728 if (!stats) return cb.apply(this, arguments)
113729 if (stats.uid < 0) stats.uid += 0x100000000
113730 if (stats.gid < 0) stats.gid += 0x100000000
113731 if (cb) cb.apply(this, arguments)
113732 })
113733 }
113734}
113735
113736function statFixSync (orig) {
113737 if (!orig) return orig
113738 // Older versions of Node erroneously returned signed integers for
113739 // uid + gid.
113740 return function (target) {
113741 var stats = orig.call(fs, target)
113742 if (stats.uid < 0) stats.uid += 0x100000000
113743 if (stats.gid < 0) stats.gid += 0x100000000
113744 return stats;
113745 }
113746}
113747
113748// ENOSYS means that the fs doesn't support the op. Just ignore
113749// that, because it doesn't matter.
113750//
113751// if there's no getuid, or if getuid() is something other
113752// than 0, and the error is EINVAL or EPERM, then just ignore
113753// it.
113754//
113755// This specific case is a silent failure in cp, install, tar,
113756// and most other unix tools that manage permissions.
113757//
113758// When running as root, or if other types of errors are
113759// encountered, then it's strict.
113760function chownErOk (er) {
113761 if (!er)
113762 return true
113763
113764 if (er.code === "ENOSYS")
113765 return true
113766
113767 var nonroot = !process.getuid || process.getuid() !== 0
113768 if (nonroot) {
113769 if (er.code === "EINVAL" || er.code === "EPERM")
113770 return true
113771 }
113772
113773 return false
113774}
113775
113776
113777/***/ }),
113778/* 682 */
113779/***/ (function(module, exports, __webpack_require__) {
113780
113781var zlib = __webpack_require__(188)
113782var peek = __webpack_require__(847)
113783var through = __webpack_require__(432)
113784var pumpify = __webpack_require__(854)
113785var isGzip = __webpack_require__(786)
113786var isDeflate = __webpack_require__(781)
113787
113788var isCompressed = function (data) {
113789 if (isGzip(data)) return 1
113790 if (isDeflate(data)) return 2
113791 return 0
113792}
113793
113794var gunzip = function (maxRecursion) {
113795 if (!(maxRecursion >= 0)) maxRecursion = 3
113796
113797 return peek({newline: false, maxBuffer: 10}, function (data, swap) {
113798 if (maxRecursion < 0) return swap(new Error('Maximum recursion reached'))
113799 switch (isCompressed(data)) {
113800 case 1:
113801 swap(null, pumpify(zlib.createGunzip(), gunzip(maxRecursion - 1)))
113802 break
113803 case 2:
113804 swap(null, pumpify(zlib.createInflate(), gunzip(maxRecursion - 1)))
113805 break
113806 default:
113807 swap(null, through())
113808 }
113809 })
113810}
113811
113812module.exports = gunzip
113813
113814
113815/***/ }),
113816/* 683 */
113817/***/ (function(module, exports) {
113818
113819module.exports = {"$id":"afterRequest.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["lastAccess","eTag","hitCount"],"properties":{"expires":{"type":"string","pattern":"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},"lastAccess":{"type":"string","pattern":"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},"eTag":{"type":"string"},"hitCount":{"type":"integer"},"comment":{"type":"string"}}}
113820
113821/***/ }),
113822/* 684 */
113823/***/ (function(module, exports) {
113824
113825module.exports = {"$id":"beforeRequest.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["lastAccess","eTag","hitCount"],"properties":{"expires":{"type":"string","pattern":"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},"lastAccess":{"type":"string","pattern":"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))?"},"eTag":{"type":"string"},"hitCount":{"type":"integer"},"comment":{"type":"string"}}}
113826
113827/***/ }),
113828/* 685 */
113829/***/ (function(module, exports) {
113830
113831module.exports = {"$id":"browser.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","version"],"properties":{"name":{"type":"string"},"version":{"type":"string"},"comment":{"type":"string"}}}
113832
113833/***/ }),
113834/* 686 */
113835/***/ (function(module, exports) {
113836
113837module.exports = {"$id":"cache.json#","$schema":"http://json-schema.org/draft-06/schema#","properties":{"beforeRequest":{"oneOf":[{"type":"null"},{"$ref":"beforeRequest.json#"}]},"afterRequest":{"oneOf":[{"type":"null"},{"$ref":"afterRequest.json#"}]},"comment":{"type":"string"}}}
113838
113839/***/ }),
113840/* 687 */
113841/***/ (function(module, exports) {
113842
113843module.exports = {"$id":"content.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["size","mimeType"],"properties":{"size":{"type":"integer"},"compression":{"type":"integer"},"mimeType":{"type":"string"},"text":{"type":"string"},"encoding":{"type":"string"},"comment":{"type":"string"}}}
113844
113845/***/ }),
113846/* 688 */
113847/***/ (function(module, exports) {
113848
113849module.exports = {"$id":"cookie.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"path":{"type":"string"},"domain":{"type":"string"},"expires":{"type":["string","null"],"format":"date-time"},"httpOnly":{"type":"boolean"},"secure":{"type":"boolean"},"comment":{"type":"string"}}}
113850
113851/***/ }),
113852/* 689 */
113853/***/ (function(module, exports) {
113854
113855module.exports = {"$id":"creator.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","version"],"properties":{"name":{"type":"string"},"version":{"type":"string"},"comment":{"type":"string"}}}
113856
113857/***/ }),
113858/* 690 */
113859/***/ (function(module, exports) {
113860
113861module.exports = {"$id":"entry.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["startedDateTime","time","request","response","cache","timings"],"properties":{"pageref":{"type":"string"},"startedDateTime":{"type":"string","format":"date-time","pattern":"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"},"time":{"type":"number","min":0},"request":{"$ref":"request.json#"},"response":{"$ref":"response.json#"},"cache":{"$ref":"cache.json#"},"timings":{"$ref":"timings.json#"},"serverIPAddress":{"type":"string","oneOf":[{"format":"ipv4"},{"format":"ipv6"}]},"connection":{"type":"string"},"comment":{"type":"string"}}}
113862
113863/***/ }),
113864/* 691 */
113865/***/ (function(module, exports) {
113866
113867module.exports = {"$id":"har.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["log"],"properties":{"log":{"$ref":"log.json#"}}}
113868
113869/***/ }),
113870/* 692 */
113871/***/ (function(module, exports) {
113872
113873module.exports = {"$id":"header.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"comment":{"type":"string"}}}
113874
113875/***/ }),
113876/* 693 */
113877/***/ (function(module, exports, __webpack_require__) {
113878
113879"use strict";
113880
113881
113882module.exports = {
113883 afterRequest: __webpack_require__(683),
113884 beforeRequest: __webpack_require__(684),
113885 browser: __webpack_require__(685),
113886 cache: __webpack_require__(686),
113887 content: __webpack_require__(687),
113888 cookie: __webpack_require__(688),
113889 creator: __webpack_require__(689),
113890 entry: __webpack_require__(690),
113891 har: __webpack_require__(691),
113892 header: __webpack_require__(692),
113893 log: __webpack_require__(694),
113894 page: __webpack_require__(695),
113895 pageTimings: __webpack_require__(696),
113896 postData: __webpack_require__(697),
113897 query: __webpack_require__(698),
113898 request: __webpack_require__(699),
113899 response: __webpack_require__(700),
113900 timings: __webpack_require__(701)
113901}
113902
113903
113904/***/ }),
113905/* 694 */
113906/***/ (function(module, exports) {
113907
113908module.exports = {"$id":"log.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["version","creator","entries"],"properties":{"version":{"type":"string"},"creator":{"$ref":"creator.json#"},"browser":{"$ref":"browser.json#"},"pages":{"type":"array","items":{"$ref":"page.json#"}},"entries":{"type":"array","items":{"$ref":"entry.json#"}},"comment":{"type":"string"}}}
113909
113910/***/ }),
113911/* 695 */
113912/***/ (function(module, exports) {
113913
113914module.exports = {"$id":"page.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["startedDateTime","id","title","pageTimings"],"properties":{"startedDateTime":{"type":"string","format":"date-time","pattern":"^(\\d{4})(-)?(\\d\\d)(-)?(\\d\\d)(T)?(\\d\\d)(:)?(\\d\\d)(:)?(\\d\\d)(\\.\\d+)?(Z|([+-])(\\d\\d)(:)?(\\d\\d))"},"id":{"type":"string","unique":true},"title":{"type":"string"},"pageTimings":{"$ref":"pageTimings.json#"},"comment":{"type":"string"}}}
113915
113916/***/ }),
113917/* 696 */
113918/***/ (function(module, exports) {
113919
113920module.exports = {"$id":"pageTimings.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","properties":{"onContentLoad":{"type":"number","min":-1},"onLoad":{"type":"number","min":-1},"comment":{"type":"string"}}}
113921
113922/***/ }),
113923/* 697 */
113924/***/ (function(module, exports) {
113925
113926module.exports = {"$id":"postData.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","optional":true,"required":["mimeType"],"properties":{"mimeType":{"type":"string"},"text":{"type":"string"},"params":{"type":"array","required":["name"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"fileName":{"type":"string"},"contentType":{"type":"string"},"comment":{"type":"string"}}},"comment":{"type":"string"}}}
113927
113928/***/ }),
113929/* 698 */
113930/***/ (function(module, exports) {
113931
113932module.exports = {"$id":"query.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"comment":{"type":"string"}}}
113933
113934/***/ }),
113935/* 699 */
113936/***/ (function(module, exports) {
113937
113938module.exports = {"$id":"request.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["method","url","httpVersion","cookies","headers","queryString","headersSize","bodySize"],"properties":{"method":{"type":"string"},"url":{"type":"string","format":"uri"},"httpVersion":{"type":"string"},"cookies":{"type":"array","items":{"$ref":"cookie.json#"}},"headers":{"type":"array","items":{"$ref":"header.json#"}},"queryString":{"type":"array","items":{"$ref":"query.json#"}},"postData":{"$ref":"postData.json#"},"headersSize":{"type":"integer"},"bodySize":{"type":"integer"},"comment":{"type":"string"}}}
113939
113940/***/ }),
113941/* 700 */
113942/***/ (function(module, exports) {
113943
113944module.exports = {"$id":"response.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["status","statusText","httpVersion","cookies","headers","content","redirectURL","headersSize","bodySize"],"properties":{"status":{"type":"integer"},"statusText":{"type":"string"},"httpVersion":{"type":"string"},"cookies":{"type":"array","items":{"$ref":"cookie.json#"}},"headers":{"type":"array","items":{"$ref":"header.json#"}},"content":{"$ref":"content.json#"},"redirectURL":{"type":"string"},"headersSize":{"type":"integer"},"bodySize":{"type":"integer"},"comment":{"type":"string"}}}
113945
113946/***/ }),
113947/* 701 */
113948/***/ (function(module, exports) {
113949
113950module.exports = {"$id":"timings.json#","$schema":"http://json-schema.org/draft-06/schema#","required":["send","wait","receive"],"properties":{"dns":{"type":"number","min":-1},"connect":{"type":"number","min":-1},"blocked":{"type":"number","min":-1},"send":{"type":"number","min":-1},"wait":{"type":"number","min":-1},"receive":{"type":"number","min":-1},"ssl":{"type":"number","min":-1},"comment":{"type":"string"}}}
113951
113952/***/ }),
113953/* 702 */
113954/***/ (function(module, exports) {
113955
113956function HARError (errors) {
113957 var message = 'validation failed'
113958
113959 this.name = 'HARError'
113960 this.message = message
113961 this.errors = errors
113962
113963 if (typeof Error.captureStackTrace === 'function') {
113964 Error.captureStackTrace(this, this.constructor)
113965 } else {
113966 this.stack = (new Error(message)).stack
113967 }
113968}
113969
113970HARError.prototype = Error.prototype
113971
113972module.exports = HARError
113973
113974
113975/***/ }),
113976/* 703 */
113977/***/ (function(module, exports, __webpack_require__) {
113978
113979var Ajv = __webpack_require__(705)
113980var HARError = __webpack_require__(702)
113981var schemas = __webpack_require__(693)
113982
113983var ajv
113984
113985function validate (name, data) {
113986 data = data || {}
113987
113988 // validator config
113989 ajv = ajv || new Ajv({
113990 allErrors: true,
113991 schemas: schemas
113992 })
113993
113994 var validate = ajv.getSchema(name + '.json')
113995
113996 return new Promise(function (resolve, reject) {
113997 var valid = validate(data)
113998
113999 !valid ? reject(new HARError(validate.errors)) : resolve(data)
114000 })
114001}
114002
114003exports.afterRequest = function (data) {
114004 return validate('afterRequest', data)
114005}
114006
114007exports.beforeRequest = function (data) {
114008 return validate('beforeRequest', data)
114009}
114010
114011exports.browser = function (data) {
114012 return validate('browser', data)
114013}
114014
114015exports.cache = function (data) {
114016 return validate('cache', data)
114017}
114018
114019exports.content = function (data) {
114020 return validate('content', data)
114021}
114022
114023exports.cookie = function (data) {
114024 return validate('cookie', data)
114025}
114026
114027exports.creator = function (data) {
114028 return validate('creator', data)
114029}
114030
114031exports.entry = function (data) {
114032 return validate('entry', data)
114033}
114034
114035exports.har = function (data) {
114036 return validate('har', data)
114037}
114038
114039exports.header = function (data) {
114040 return validate('header', data)
114041}
114042
114043exports.log = function (data) {
114044 return validate('log', data)
114045}
114046
114047exports.page = function (data) {
114048 return validate('page', data)
114049}
114050
114051exports.pageTimings = function (data) {
114052 return validate('pageTimings', data)
114053}
114054
114055exports.postData = function (data) {
114056 return validate('postData', data)
114057}
114058
114059exports.query = function (data) {
114060 return validate('query', data)
114061}
114062
114063exports.request = function (data) {
114064 return validate('request', data)
114065}
114066
114067exports.response = function (data) {
114068 return validate('response', data)
114069}
114070
114071exports.timings = function (data) {
114072 return validate('timings', data)
114073}
114074
114075
114076/***/ }),
114077/* 704 */
114078/***/ (function(module, exports, __webpack_require__) {
114079
114080"use strict";
114081
114082
114083var KEYWORDS = [
114084 'multipleOf',
114085 'maximum',
114086 'exclusiveMaximum',
114087 'minimum',
114088 'exclusiveMinimum',
114089 'maxLength',
114090 'minLength',
114091 'pattern',
114092 'additionalItems',
114093 'maxItems',
114094 'minItems',
114095 'uniqueItems',
114096 'maxProperties',
114097 'minProperties',
114098 'required',
114099 'additionalProperties',
114100 'enum',
114101 'format',
114102 'const'
114103];
114104
114105module.exports = function (metaSchema, keywordsJsonPointers) {
114106 for (var i=0; i<keywordsJsonPointers.length; i++) {
114107 metaSchema = JSON.parse(JSON.stringify(metaSchema));
114108 var segments = keywordsJsonPointers[i].split('/');
114109 var keywords = metaSchema;
114110 var j;
114111 for (j=1; j<segments.length; j++)
114112 keywords = keywords[segments[j]];
114113
114114 for (j=0; j<KEYWORDS.length; j++) {
114115 var key = KEYWORDS[j];
114116 var schema = keywords[key];
114117 if (schema) {
114118 keywords[key] = {
114119 anyOf: [
114120 schema,
114121 { $ref: 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/$data.json#' }
114122 ]
114123 };
114124 }
114125 }
114126 }
114127
114128 return metaSchema;
114129};
114130
114131
114132/***/ }),
114133/* 705 */
114134/***/ (function(module, exports, __webpack_require__) {
114135
114136"use strict";
114137
114138
114139var compileSchema = __webpack_require__(710)
114140 , resolve = __webpack_require__(236)
114141 , Cache = __webpack_require__(706)
114142 , SchemaObject = __webpack_require__(357)
114143 , stableStringify = __webpack_require__(352)
114144 , formats = __webpack_require__(709)
114145 , rules = __webpack_require__(711)
114146 , $dataMetaSchema = __webpack_require__(704)
114147 , patternGroups = __webpack_require__(732)
114148 , util = __webpack_require__(106)
114149 , co = __webpack_require__(321);
114150
114151module.exports = Ajv;
114152
114153Ajv.prototype.validate = validate;
114154Ajv.prototype.compile = compile;
114155Ajv.prototype.addSchema = addSchema;
114156Ajv.prototype.addMetaSchema = addMetaSchema;
114157Ajv.prototype.validateSchema = validateSchema;
114158Ajv.prototype.getSchema = getSchema;
114159Ajv.prototype.removeSchema = removeSchema;
114160Ajv.prototype.addFormat = addFormat;
114161Ajv.prototype.errorsText = errorsText;
114162
114163Ajv.prototype._addSchema = _addSchema;
114164Ajv.prototype._compile = _compile;
114165
114166Ajv.prototype.compileAsync = __webpack_require__(708);
114167var customKeyword = __webpack_require__(731);
114168Ajv.prototype.addKeyword = customKeyword.add;
114169Ajv.prototype.getKeyword = customKeyword.get;
114170Ajv.prototype.removeKeyword = customKeyword.remove;
114171
114172var errorClasses = __webpack_require__(235);
114173Ajv.ValidationError = errorClasses.Validation;
114174Ajv.MissingRefError = errorClasses.MissingRef;
114175Ajv.$dataMetaSchema = $dataMetaSchema;
114176
114177var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema';
114178
114179var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes' ];
114180var META_SUPPORT_DATA = ['/properties'];
114181
114182/**
114183 * Creates validator instance.
114184 * Usage: `Ajv(opts)`
114185 * @param {Object} opts optional options
114186 * @return {Object} ajv instance
114187 */
114188function Ajv(opts) {
114189 if (!(this instanceof Ajv)) return new Ajv(opts);
114190 opts = this._opts = util.copy(opts) || {};
114191 setLogger(this);
114192 this._schemas = {};
114193 this._refs = {};
114194 this._fragments = {};
114195 this._formats = formats(opts.format);
114196 var schemaUriFormat = this._schemaUriFormat = this._formats['uri-reference'];
114197 this._schemaUriFormatFunc = function (str) { return schemaUriFormat.test(str); };
114198
114199 this._cache = opts.cache || new Cache;
114200 this._loadingSchemas = {};
114201 this._compilations = [];
114202 this.RULES = rules();
114203 this._getId = chooseGetId(opts);
114204
114205 opts.loopRequired = opts.loopRequired || Infinity;
114206 if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;
114207 if (opts.serialize === undefined) opts.serialize = stableStringify;
114208 this._metaOpts = getMetaSchemaOptions(this);
114209
114210 if (opts.formats) addInitialFormats(this);
114211 addDraft6MetaSchema(this);
114212 if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);
114213 addInitialSchemas(this);
114214 if (opts.patternGroups) patternGroups(this);
114215}
114216
114217
114218
114219/**
114220 * Validate data using schema
114221 * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize.
114222 * @this Ajv
114223 * @param {String|Object} schemaKeyRef key, ref or schema object
114224 * @param {Any} data to be validated
114225 * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
114226 */
114227function validate(schemaKeyRef, data) {
114228 var v;
114229 if (typeof schemaKeyRef == 'string') {
114230 v = this.getSchema(schemaKeyRef);
114231 if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"');
114232 } else {
114233 var schemaObj = this._addSchema(schemaKeyRef);
114234 v = schemaObj.validate || this._compile(schemaObj);
114235 }
114236
114237 var valid = v(data);
114238 if (v.$async === true)
114239 return this._opts.async == '*' ? co(valid) : valid;
114240 this.errors = v.errors;
114241 return valid;
114242}
114243
114244
114245/**
114246 * Create validating function for passed schema.
114247 * @this Ajv
114248 * @param {Object} schema schema object
114249 * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.
114250 * @return {Function} validating function
114251 */
114252function compile(schema, _meta) {
114253 var schemaObj = this._addSchema(schema, undefined, _meta);
114254 return schemaObj.validate || this._compile(schemaObj);
114255}
114256
114257
114258/**
114259 * Adds schema to the instance.
114260 * @this Ajv
114261 * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.
114262 * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
114263 * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead.
114264 * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
114265 * @return {Ajv} this for method chaining
114266 */
114267function addSchema(schema, key, _skipValidation, _meta) {
114268 if (Array.isArray(schema)){
114269 for (var i=0; i<schema.length; i++) this.addSchema(schema[i], undefined, _skipValidation, _meta);
114270 return this;
114271 }
114272 var id = this._getId(schema);
114273 if (id !== undefined && typeof id != 'string')
114274 throw new Error('schema id must be string');
114275 key = resolve.normalizeId(key || id);
114276 checkUnique(this, key);
114277 this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);
114278 return this;
114279}
114280
114281
114282/**
114283 * Add schema that will be used to validate other schemas
114284 * options in META_IGNORE_OPTIONS are alway set to false
114285 * @this Ajv
114286 * @param {Object} schema schema object
114287 * @param {String} key optional schema key
114288 * @param {Boolean} skipValidation true to skip schema validation, can be used to override validateSchema option for meta-schema
114289 * @return {Ajv} this for method chaining
114290 */
114291function addMetaSchema(schema, key, skipValidation) {
114292 this.addSchema(schema, key, skipValidation, true);
114293 return this;
114294}
114295
114296
114297/**
114298 * Validate schema
114299 * @this Ajv
114300 * @param {Object} schema schema to validate
114301 * @param {Boolean} throwOrLogError pass true to throw (or log) an error if invalid
114302 * @return {Boolean} true if schema is valid
114303 */
114304function validateSchema(schema, throwOrLogError) {
114305 var $schema = schema.$schema;
114306 if ($schema !== undefined && typeof $schema != 'string')
114307 throw new Error('$schema must be a string');
114308 $schema = $schema || this._opts.defaultMeta || defaultMeta(this);
114309 if (!$schema) {
114310 this.logger.warn('meta-schema not available');
114311 this.errors = null;
114312 return true;
114313 }
114314 var currentUriFormat = this._formats.uri;
114315 this._formats.uri = typeof currentUriFormat == 'function'
114316 ? this._schemaUriFormatFunc
114317 : this._schemaUriFormat;
114318 var valid;
114319 try { valid = this.validate($schema, schema); }
114320 finally { this._formats.uri = currentUriFormat; }
114321 if (!valid && throwOrLogError) {
114322 var message = 'schema is invalid: ' + this.errorsText();
114323 if (this._opts.validateSchema == 'log') this.logger.error(message);
114324 else throw new Error(message);
114325 }
114326 return valid;
114327}
114328
114329
114330function defaultMeta(self) {
114331 var meta = self._opts.meta;
114332 self._opts.defaultMeta = typeof meta == 'object'
114333 ? self._getId(meta) || meta
114334 : self.getSchema(META_SCHEMA_ID)
114335 ? META_SCHEMA_ID
114336 : undefined;
114337 return self._opts.defaultMeta;
114338}
114339
114340
114341/**
114342 * Get compiled schema from the instance by `key` or `ref`.
114343 * @this Ajv
114344 * @param {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).
114345 * @return {Function} schema validating function (with property `schema`).
114346 */
114347function getSchema(keyRef) {
114348 var schemaObj = _getSchemaObj(this, keyRef);
114349 switch (typeof schemaObj) {
114350 case 'object': return schemaObj.validate || this._compile(schemaObj);
114351 case 'string': return this.getSchema(schemaObj);
114352 case 'undefined': return _getSchemaFragment(this, keyRef);
114353 }
114354}
114355
114356
114357function _getSchemaFragment(self, ref) {
114358 var res = resolve.schema.call(self, { schema: {} }, ref);
114359 if (res) {
114360 var schema = res.schema
114361 , root = res.root
114362 , baseId = res.baseId;
114363 var v = compileSchema.call(self, schema, root, undefined, baseId);
114364 self._fragments[ref] = new SchemaObject({
114365 ref: ref,
114366 fragment: true,
114367 schema: schema,
114368 root: root,
114369 baseId: baseId,
114370 validate: v
114371 });
114372 return v;
114373 }
114374}
114375
114376
114377function _getSchemaObj(self, keyRef) {
114378 keyRef = resolve.normalizeId(keyRef);
114379 return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
114380}
114381
114382
114383/**
114384 * Remove cached schema(s).
114385 * If no parameter is passed all schemas but meta-schemas are removed.
114386 * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
114387 * Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
114388 * @this Ajv
114389 * @param {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object
114390 * @return {Ajv} this for method chaining
114391 */
114392function removeSchema(schemaKeyRef) {
114393 if (schemaKeyRef instanceof RegExp) {
114394 _removeAllSchemas(this, this._schemas, schemaKeyRef);
114395 _removeAllSchemas(this, this._refs, schemaKeyRef);
114396 return this;
114397 }
114398 switch (typeof schemaKeyRef) {
114399 case 'undefined':
114400 _removeAllSchemas(this, this._schemas);
114401 _removeAllSchemas(this, this._refs);
114402 this._cache.clear();
114403 return this;
114404 case 'string':
114405 var schemaObj = _getSchemaObj(this, schemaKeyRef);
114406 if (schemaObj) this._cache.del(schemaObj.cacheKey);
114407 delete this._schemas[schemaKeyRef];
114408 delete this._refs[schemaKeyRef];
114409 return this;
114410 case 'object':
114411 var serialize = this._opts.serialize;
114412 var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef;
114413 this._cache.del(cacheKey);
114414 var id = this._getId(schemaKeyRef);
114415 if (id) {
114416 id = resolve.normalizeId(id);
114417 delete this._schemas[id];
114418 delete this._refs[id];
114419 }
114420 }
114421 return this;
114422}
114423
114424
114425function _removeAllSchemas(self, schemas, regex) {
114426 for (var keyRef in schemas) {
114427 var schemaObj = schemas[keyRef];
114428 if (!schemaObj.meta && (!regex || regex.test(keyRef))) {
114429 self._cache.del(schemaObj.cacheKey);
114430 delete schemas[keyRef];
114431 }
114432 }
114433}
114434
114435
114436/* @this Ajv */
114437function _addSchema(schema, skipValidation, meta, shouldAddSchema) {
114438 if (typeof schema != 'object' && typeof schema != 'boolean')
114439 throw new Error('schema should be object or boolean');
114440 var serialize = this._opts.serialize;
114441 var cacheKey = serialize ? serialize(schema) : schema;
114442 var cached = this._cache.get(cacheKey);
114443 if (cached) return cached;
114444
114445 shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;
114446
114447 var id = resolve.normalizeId(this._getId(schema));
114448 if (id && shouldAddSchema) checkUnique(this, id);
114449
114450 var willValidate = this._opts.validateSchema !== false && !skipValidation;
114451 var recursiveMeta;
114452 if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema)))
114453 this.validateSchema(schema, true);
114454
114455 var localRefs = resolve.ids.call(this, schema);
114456
114457 var schemaObj = new SchemaObject({
114458 id: id,
114459 schema: schema,
114460 localRefs: localRefs,
114461 cacheKey: cacheKey,
114462 meta: meta
114463 });
114464
114465 if (id[0] != '#' && shouldAddSchema) this._refs[id] = schemaObj;
114466 this._cache.put(cacheKey, schemaObj);
114467
114468 if (willValidate && recursiveMeta) this.validateSchema(schema, true);
114469
114470 return schemaObj;
114471}
114472
114473
114474/* @this Ajv */
114475function _compile(schemaObj, root) {
114476 if (schemaObj.compiling) {
114477 schemaObj.validate = callValidate;
114478 callValidate.schema = schemaObj.schema;
114479 callValidate.errors = null;
114480 callValidate.root = root ? root : callValidate;
114481 if (schemaObj.schema.$async === true)
114482 callValidate.$async = true;
114483 return callValidate;
114484 }
114485 schemaObj.compiling = true;
114486
114487 var currentOpts;
114488 if (schemaObj.meta) {
114489 currentOpts = this._opts;
114490 this._opts = this._metaOpts;
114491 }
114492
114493 var v;
114494 try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); }
114495 finally {
114496 schemaObj.compiling = false;
114497 if (schemaObj.meta) this._opts = currentOpts;
114498 }
114499
114500 schemaObj.validate = v;
114501 schemaObj.refs = v.refs;
114502 schemaObj.refVal = v.refVal;
114503 schemaObj.root = v.root;
114504 return v;
114505
114506
114507 function callValidate() {
114508 var _validate = schemaObj.validate;
114509 var result = _validate.apply(null, arguments);
114510 callValidate.errors = _validate.errors;
114511 return result;
114512 }
114513}
114514
114515
114516function chooseGetId(opts) {
114517 switch (opts.schemaId) {
114518 case '$id': return _get$Id;
114519 case 'id': return _getId;
114520 default: return _get$IdOrId;
114521 }
114522}
114523
114524/* @this Ajv */
114525function _getId(schema) {
114526 if (schema.$id) this.logger.warn('schema $id ignored', schema.$id);
114527 return schema.id;
114528}
114529
114530/* @this Ajv */
114531function _get$Id(schema) {
114532 if (schema.id) this.logger.warn('schema id ignored', schema.id);
114533 return schema.$id;
114534}
114535
114536
114537function _get$IdOrId(schema) {
114538 if (schema.$id && schema.id && schema.$id != schema.id)
114539 throw new Error('schema $id is different from id');
114540 return schema.$id || schema.id;
114541}
114542
114543
114544/**
114545 * Convert array of error message objects to string
114546 * @this Ajv
114547 * @param {Array<Object>} errors optional array of validation errors, if not passed errors from the instance are used.
114548 * @param {Object} options optional options with properties `separator` and `dataVar`.
114549 * @return {String} human readable string with all errors descriptions
114550 */
114551function errorsText(errors, options) {
114552 errors = errors || this.errors;
114553 if (!errors) return 'No errors';
114554 options = options || {};
114555 var separator = options.separator === undefined ? ', ' : options.separator;
114556 var dataVar = options.dataVar === undefined ? 'data' : options.dataVar;
114557
114558 var text = '';
114559 for (var i=0; i<errors.length; i++) {
114560 var e = errors[i];
114561 if (e) text += dataVar + e.dataPath + ' ' + e.message + separator;
114562 }
114563 return text.slice(0, -separator.length);
114564}
114565
114566
114567/**
114568 * Add custom format
114569 * @this Ajv
114570 * @param {String} name format name
114571 * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid)
114572 * @return {Ajv} this for method chaining
114573 */
114574function addFormat(name, format) {
114575 if (typeof format == 'string') format = new RegExp(format);
114576 this._formats[name] = format;
114577 return this;
114578}
114579
114580
114581function addDraft6MetaSchema(self) {
114582 var $dataSchema;
114583 if (self._opts.$data) {
114584 $dataSchema = __webpack_require__(733);
114585 self.addMetaSchema($dataSchema, $dataSchema.$id, true);
114586 }
114587 if (self._opts.meta === false) return;
114588 var metaSchema = __webpack_require__(734);
114589 if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA);
114590 self.addMetaSchema(metaSchema, META_SCHEMA_ID, true);
114591 self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID;
114592}
114593
114594
114595function addInitialSchemas(self) {
114596 var optsSchemas = self._opts.schemas;
114597 if (!optsSchemas) return;
114598 if (Array.isArray(optsSchemas)) self.addSchema(optsSchemas);
114599 else for (var key in optsSchemas) self.addSchema(optsSchemas[key], key);
114600}
114601
114602
114603function addInitialFormats(self) {
114604 for (var name in self._opts.formats) {
114605 var format = self._opts.formats[name];
114606 self.addFormat(name, format);
114607 }
114608}
114609
114610
114611function checkUnique(self, id) {
114612 if (self._schemas[id] || self._refs[id])
114613 throw new Error('schema with key or id "' + id + '" already exists');
114614}
114615
114616
114617function getMetaSchemaOptions(self) {
114618 var metaOpts = util.copy(self._opts);
114619 for (var i=0; i<META_IGNORE_OPTIONS.length; i++)
114620 delete metaOpts[META_IGNORE_OPTIONS[i]];
114621 return metaOpts;
114622}
114623
114624
114625function setLogger(self) {
114626 var logger = self._opts.logger;
114627 if (logger === false) {
114628 self.logger = {log: noop, warn: noop, error: noop};
114629 } else {
114630 if (logger === undefined) logger = console;
114631 if (!(typeof logger == 'object' && logger.log && logger.warn && logger.error))
114632 throw new Error('logger must implement log, warn and error methods');
114633 self.logger = logger;
114634 }
114635}
114636
114637
114638function noop() {}
114639
114640
114641/***/ }),
114642/* 706 */
114643/***/ (function(module, exports, __webpack_require__) {
114644
114645"use strict";
114646
114647
114648
114649var Cache = module.exports = function Cache() {
114650 this._cache = {};
114651};
114652
114653
114654Cache.prototype.put = function Cache_put(key, value) {
114655 this._cache[key] = value;
114656};
114657
114658
114659Cache.prototype.get = function Cache_get(key) {
114660 return this._cache[key];
114661};
114662
114663
114664Cache.prototype.del = function Cache_del(key) {
114665 delete this._cache[key];
114666};
114667
114668
114669Cache.prototype.clear = function Cache_clear() {
114670 this._cache = {};
114671};
114672
114673
114674/***/ }),
114675/* 707 */
114676/***/ (function(module, exports, __webpack_require__) {
114677
114678"use strict";
114679
114680
114681//all requires must be explicit because browserify won't work with dynamic requires
114682module.exports = {
114683 '$ref': __webpack_require__(728),
114684 allOf: __webpack_require__(713),
114685 anyOf: __webpack_require__(714),
114686 const: __webpack_require__(715),
114687 contains: __webpack_require__(716),
114688 dependencies: __webpack_require__(718),
114689 'enum': __webpack_require__(719),
114690 format: __webpack_require__(720),
114691 items: __webpack_require__(721),
114692 maximum: __webpack_require__(358),
114693 minimum: __webpack_require__(358),
114694 maxItems: __webpack_require__(359),
114695 minItems: __webpack_require__(359),
114696 maxLength: __webpack_require__(360),
114697 minLength: __webpack_require__(360),
114698 maxProperties: __webpack_require__(361),
114699 minProperties: __webpack_require__(361),
114700 multipleOf: __webpack_require__(722),
114701 not: __webpack_require__(723),
114702 oneOf: __webpack_require__(724),
114703 pattern: __webpack_require__(725),
114704 properties: __webpack_require__(726),
114705 propertyNames: __webpack_require__(727),
114706 required: __webpack_require__(729),
114707 uniqueItems: __webpack_require__(730),
114708 validate: __webpack_require__(362)
114709};
114710
114711
114712/***/ }),
114713/* 708 */
114714/***/ (function(module, exports, __webpack_require__) {
114715
114716"use strict";
114717
114718
114719var MissingRefError = __webpack_require__(235).MissingRef;
114720
114721module.exports = compileAsync;
114722
114723
114724/**
114725 * Creates validating function for passed schema with asynchronous loading of missing schemas.
114726 * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema.
114727 * @this Ajv
114728 * @param {Object} schema schema object
114729 * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped
114730 * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function.
114731 * @return {Promise} promise that resolves with a validating function.
114732 */
114733function compileAsync(schema, meta, callback) {
114734 /* eslint no-shadow: 0 */
114735 /* global Promise */
114736 /* jshint validthis: true */
114737 var self = this;
114738 if (typeof this._opts.loadSchema != 'function')
114739 throw new Error('options.loadSchema should be a function');
114740
114741 if (typeof meta == 'function') {
114742 callback = meta;
114743 meta = undefined;
114744 }
114745
114746 var p = loadMetaSchemaOf(schema).then(function () {
114747 var schemaObj = self._addSchema(schema, undefined, meta);
114748 return schemaObj.validate || _compileAsync(schemaObj);
114749 });
114750
114751 if (callback) {
114752 p.then(
114753 function(v) { callback(null, v); },
114754 callback
114755 );
114756 }
114757
114758 return p;
114759
114760
114761 function loadMetaSchemaOf(sch) {
114762 var $schema = sch.$schema;
114763 return $schema && !self.getSchema($schema)
114764 ? compileAsync.call(self, { $ref: $schema }, true)
114765 : Promise.resolve();
114766 }
114767
114768
114769 function _compileAsync(schemaObj) {
114770 try { return self._compile(schemaObj); }
114771 catch(e) {
114772 if (e instanceof MissingRefError) return loadMissingSchema(e);
114773 throw e;
114774 }
114775
114776
114777 function loadMissingSchema(e) {
114778 var ref = e.missingSchema;
114779 if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved');
114780
114781 var schemaPromise = self._loadingSchemas[ref];
114782 if (!schemaPromise) {
114783 schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref);
114784 schemaPromise.then(removePromise, removePromise);
114785 }
114786
114787 return schemaPromise.then(function (sch) {
114788 if (!added(ref)) {
114789 return loadMetaSchemaOf(sch).then(function () {
114790 if (!added(ref)) self.addSchema(sch, ref, undefined, meta);
114791 });
114792 }
114793 }).then(function() {
114794 return _compileAsync(schemaObj);
114795 });
114796
114797 function removePromise() {
114798 delete self._loadingSchemas[ref];
114799 }
114800
114801 function added(ref) {
114802 return self._refs[ref] || self._schemas[ref];
114803 }
114804 }
114805 }
114806}
114807
114808
114809/***/ }),
114810/* 709 */
114811/***/ (function(module, exports, __webpack_require__) {
114812
114813"use strict";
114814
114815
114816var util = __webpack_require__(106);
114817
114818var DATE = /^\d\d\d\d-(\d\d)-(\d\d)$/;
114819var DAYS = [0,31,29,31,30,31,30,31,31,30,31,30,31];
114820var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i;
114821var HOSTNAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i;
114822var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
114823var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
114824// uri-template: https://tools.ietf.org/html/rfc6570
114825var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;
114826// For the source: https://gist.github.com/dperini/729294
114827// For test cases: https://mathiasbynens.be/demo/url-regex
114828// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983.
114829// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;
114830var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i;
114831var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
114832var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$|^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
114833var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;
114834
114835
114836module.exports = formats;
114837
114838function formats(mode) {
114839 mode = mode == 'full' ? 'full' : 'fast';
114840 return util.copy(formats[mode]);
114841}
114842
114843
114844formats.fast = {
114845 // date: http://tools.ietf.org/html/rfc3339#section-5.6
114846 date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/,
114847 // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
114848 time: /^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i,
114849 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i,
114850 // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
114851 uri: /^(?:[a-z][a-z0-9+-.]*)(?::|\/)\/?[^\s]*$/i,
114852 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i,
114853 'uri-template': URITEMPLATE,
114854 url: URL,
114855 // email (sources from jsen validator):
114856 // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
114857 // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')
114858 email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,
114859 hostname: HOSTNAME,
114860 // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
114861 ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
114862 // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses
114863 ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
114864 regex: regex,
114865 // uuid: http://tools.ietf.org/html/rfc4122
114866 uuid: UUID,
114867 // JSON-pointer: https://tools.ietf.org/html/rfc6901
114868 // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
114869 'json-pointer': JSON_POINTER,
114870 // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
114871 'relative-json-pointer': RELATIVE_JSON_POINTER
114872};
114873
114874
114875formats.full = {
114876 date: date,
114877 time: time,
114878 'date-time': date_time,
114879 uri: uri,
114880 'uri-reference': URIREF,
114881 'uri-template': URITEMPLATE,
114882 url: URL,
114883 email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
114884 hostname: hostname,
114885 ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
114886 ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
114887 regex: regex,
114888 uuid: UUID,
114889 'json-pointer': JSON_POINTER,
114890 'relative-json-pointer': RELATIVE_JSON_POINTER
114891};
114892
114893
114894function date(str) {
114895 // full-date from http://tools.ietf.org/html/rfc3339#section-5.6
114896 var matches = str.match(DATE);
114897 if (!matches) return false;
114898
114899 var month = +matches[1];
114900 var day = +matches[2];
114901 return month >= 1 && month <= 12 && day >= 1 && day <= DAYS[month];
114902}
114903
114904
114905function time(str, full) {
114906 var matches = str.match(TIME);
114907 if (!matches) return false;
114908
114909 var hour = matches[1];
114910 var minute = matches[2];
114911 var second = matches[3];
114912 var timeZone = matches[5];
114913 return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone);
114914}
114915
114916
114917var DATE_TIME_SEPARATOR = /t|\s/i;
114918function date_time(str) {
114919 // http://tools.ietf.org/html/rfc3339#section-5.6
114920 var dateTime = str.split(DATE_TIME_SEPARATOR);
114921 return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true);
114922}
114923
114924
114925function hostname(str) {
114926 // https://tools.ietf.org/html/rfc1034#section-3.5
114927 // https://tools.ietf.org/html/rfc1123#section-2
114928 return str.length <= 255 && HOSTNAME.test(str);
114929}
114930
114931
114932var NOT_URI_FRAGMENT = /\/|:/;
114933function uri(str) {
114934 // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
114935 return NOT_URI_FRAGMENT.test(str) && URI.test(str);
114936}
114937
114938
114939var Z_ANCHOR = /[^\\]\\Z/;
114940function regex(str) {
114941 if (Z_ANCHOR.test(str)) return false;
114942 try {
114943 new RegExp(str);
114944 return true;
114945 } catch(e) {
114946 return false;
114947 }
114948}
114949
114950
114951/***/ }),
114952/* 710 */
114953/***/ (function(module, exports, __webpack_require__) {
114954
114955"use strict";
114956
114957
114958var resolve = __webpack_require__(236)
114959 , util = __webpack_require__(106)
114960 , errorClasses = __webpack_require__(235)
114961 , stableStringify = __webpack_require__(352);
114962
114963var validateGenerator = __webpack_require__(362);
114964
114965/**
114966 * Functions below are used inside compiled validations function
114967 */
114968
114969var co = __webpack_require__(321);
114970var ucs2length = util.ucs2length;
114971var equal = __webpack_require__(237);
114972
114973// this error is thrown by async schemas to return validation errors via exception
114974var ValidationError = errorClasses.Validation;
114975
114976module.exports = compile;
114977
114978
114979/**
114980 * Compiles schema to validation function
114981 * @this Ajv
114982 * @param {Object} schema schema object
114983 * @param {Object} root object with information about the root schema for this schema
114984 * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution
114985 * @param {String} baseId base ID for IDs in the schema
114986 * @return {Function} validation function
114987 */
114988function compile(schema, root, localRefs, baseId) {
114989 /* jshint validthis: true, evil: true */
114990 /* eslint no-shadow: 0 */
114991 var self = this
114992 , opts = this._opts
114993 , refVal = [ undefined ]
114994 , refs = {}
114995 , patterns = []
114996 , patternsHash = {}
114997 , defaults = []
114998 , defaultsHash = {}
114999 , customRules = [];
115000
115001 root = root || { schema: schema, refVal: refVal, refs: refs };
115002
115003 var c = checkCompiling.call(this, schema, root, baseId);
115004 var compilation = this._compilations[c.index];
115005 if (c.compiling) return (compilation.callValidate = callValidate);
115006
115007 var formats = this._formats;
115008 var RULES = this.RULES;
115009
115010 try {
115011 var v = localCompile(schema, root, localRefs, baseId);
115012 compilation.validate = v;
115013 var cv = compilation.callValidate;
115014 if (cv) {
115015 cv.schema = v.schema;
115016 cv.errors = null;
115017 cv.refs = v.refs;
115018 cv.refVal = v.refVal;
115019 cv.root = v.root;
115020 cv.$async = v.$async;
115021 if (opts.sourceCode) cv.source = v.source;
115022 }
115023 return v;
115024 } finally {
115025 endCompiling.call(this, schema, root, baseId);
115026 }
115027
115028 function callValidate() {
115029 var validate = compilation.validate;
115030 var result = validate.apply(null, arguments);
115031 callValidate.errors = validate.errors;
115032 return result;
115033 }
115034
115035 function localCompile(_schema, _root, localRefs, baseId) {
115036 var isRoot = !_root || (_root && _root.schema == _schema);
115037 if (_root.schema != root.schema)
115038 return compile.call(self, _schema, _root, localRefs, baseId);
115039
115040 var $async = _schema.$async === true;
115041
115042 var sourceCode = validateGenerator({
115043 isTop: true,
115044 schema: _schema,
115045 isRoot: isRoot,
115046 baseId: baseId,
115047 root: _root,
115048 schemaPath: '',
115049 errSchemaPath: '#',
115050 errorPath: '""',
115051 MissingRefError: errorClasses.MissingRef,
115052 RULES: RULES,
115053 validate: validateGenerator,
115054 util: util,
115055 resolve: resolve,
115056 resolveRef: resolveRef,
115057 usePattern: usePattern,
115058 useDefault: useDefault,
115059 useCustomRule: useCustomRule,
115060 opts: opts,
115061 formats: formats,
115062 logger: self.logger,
115063 self: self
115064 });
115065
115066 sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)
115067 + vars(defaults, defaultCode) + vars(customRules, customRuleCode)
115068 + sourceCode;
115069
115070 if (opts.processCode) sourceCode = opts.processCode(sourceCode);
115071 // console.log('\n\n\n *** \n', JSON.stringify(sourceCode));
115072 var validate;
115073 try {
115074 var makeValidate = new Function(
115075 'self',
115076 'RULES',
115077 'formats',
115078 'root',
115079 'refVal',
115080 'defaults',
115081 'customRules',
115082 'co',
115083 'equal',
115084 'ucs2length',
115085 'ValidationError',
115086 sourceCode
115087 );
115088
115089 validate = makeValidate(
115090 self,
115091 RULES,
115092 formats,
115093 root,
115094 refVal,
115095 defaults,
115096 customRules,
115097 co,
115098 equal,
115099 ucs2length,
115100 ValidationError
115101 );
115102
115103 refVal[0] = validate;
115104 } catch(e) {
115105 self.logger.error('Error compiling schema, function code:', sourceCode);
115106 throw e;
115107 }
115108
115109 validate.schema = _schema;
115110 validate.errors = null;
115111 validate.refs = refs;
115112 validate.refVal = refVal;
115113 validate.root = isRoot ? validate : _root;
115114 if ($async) validate.$async = true;
115115 if (opts.sourceCode === true) {
115116 validate.source = {
115117 code: sourceCode,
115118 patterns: patterns,
115119 defaults: defaults
115120 };
115121 }
115122
115123 return validate;
115124 }
115125
115126 function resolveRef(baseId, ref, isRoot) {
115127 ref = resolve.url(baseId, ref);
115128 var refIndex = refs[ref];
115129 var _refVal, refCode;
115130 if (refIndex !== undefined) {
115131 _refVal = refVal[refIndex];
115132 refCode = 'refVal[' + refIndex + ']';
115133 return resolvedRef(_refVal, refCode);
115134 }
115135 if (!isRoot && root.refs) {
115136 var rootRefId = root.refs[ref];
115137 if (rootRefId !== undefined) {
115138 _refVal = root.refVal[rootRefId];
115139 refCode = addLocalRef(ref, _refVal);
115140 return resolvedRef(_refVal, refCode);
115141 }
115142 }
115143
115144 refCode = addLocalRef(ref);
115145 var v = resolve.call(self, localCompile, root, ref);
115146 if (v === undefined) {
115147 var localSchema = localRefs && localRefs[ref];
115148 if (localSchema) {
115149 v = resolve.inlineRef(localSchema, opts.inlineRefs)
115150 ? localSchema
115151 : compile.call(self, localSchema, root, localRefs, baseId);
115152 }
115153 }
115154
115155 if (v === undefined) {
115156 removeLocalRef(ref);
115157 } else {
115158 replaceLocalRef(ref, v);
115159 return resolvedRef(v, refCode);
115160 }
115161 }
115162
115163 function addLocalRef(ref, v) {
115164 var refId = refVal.length;
115165 refVal[refId] = v;
115166 refs[ref] = refId;
115167 return 'refVal' + refId;
115168 }
115169
115170 function removeLocalRef(ref) {
115171 delete refs[ref];
115172 }
115173
115174 function replaceLocalRef(ref, v) {
115175 var refId = refs[ref];
115176 refVal[refId] = v;
115177 }
115178
115179 function resolvedRef(refVal, code) {
115180 return typeof refVal == 'object' || typeof refVal == 'boolean'
115181 ? { code: code, schema: refVal, inline: true }
115182 : { code: code, $async: refVal && refVal.$async };
115183 }
115184
115185 function usePattern(regexStr) {
115186 var index = patternsHash[regexStr];
115187 if (index === undefined) {
115188 index = patternsHash[regexStr] = patterns.length;
115189 patterns[index] = regexStr;
115190 }
115191 return 'pattern' + index;
115192 }
115193
115194 function useDefault(value) {
115195 switch (typeof value) {
115196 case 'boolean':
115197 case 'number':
115198 return '' + value;
115199 case 'string':
115200 return util.toQuotedString(value);
115201 case 'object':
115202 if (value === null) return 'null';
115203 var valueStr = stableStringify(value);
115204 var index = defaultsHash[valueStr];
115205 if (index === undefined) {
115206 index = defaultsHash[valueStr] = defaults.length;
115207 defaults[index] = value;
115208 }
115209 return 'default' + index;
115210 }
115211 }
115212
115213 function useCustomRule(rule, schema, parentSchema, it) {
115214 var validateSchema = rule.definition.validateSchema;
115215 if (validateSchema && self._opts.validateSchema !== false) {
115216 var valid = validateSchema(schema);
115217 if (!valid) {
115218 var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors);
115219 if (self._opts.validateSchema == 'log') self.logger.error(message);
115220 else throw new Error(message);
115221 }
115222 }
115223
115224 var compile = rule.definition.compile
115225 , inline = rule.definition.inline
115226 , macro = rule.definition.macro;
115227
115228 var validate;
115229 if (compile) {
115230 validate = compile.call(self, schema, parentSchema, it);
115231 } else if (macro) {
115232 validate = macro.call(self, schema, parentSchema, it);
115233 if (opts.validateSchema !== false) self.validateSchema(validate, true);
115234 } else if (inline) {
115235 validate = inline.call(self, it, rule.keyword, schema, parentSchema);
115236 } else {
115237 validate = rule.definition.validate;
115238 if (!validate) return;
115239 }
115240
115241 if (validate === undefined)
115242 throw new Error('custom keyword "' + rule.keyword + '"failed to compile');
115243
115244 var index = customRules.length;
115245 customRules[index] = validate;
115246
115247 return {
115248 code: 'customRule' + index,
115249 validate: validate
115250 };
115251 }
115252}
115253
115254
115255/**
115256 * Checks if the schema is currently compiled
115257 * @this Ajv
115258 * @param {Object} schema schema to compile
115259 * @param {Object} root root object
115260 * @param {String} baseId base schema ID
115261 * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean)
115262 */
115263function checkCompiling(schema, root, baseId) {
115264 /* jshint validthis: true */
115265 var index = compIndex.call(this, schema, root, baseId);
115266 if (index >= 0) return { index: index, compiling: true };
115267 index = this._compilations.length;
115268 this._compilations[index] = {
115269 schema: schema,
115270 root: root,
115271 baseId: baseId
115272 };
115273 return { index: index, compiling: false };
115274}
115275
115276
115277/**
115278 * Removes the schema from the currently compiled list
115279 * @this Ajv
115280 * @param {Object} schema schema to compile
115281 * @param {Object} root root object
115282 * @param {String} baseId base schema ID
115283 */
115284function endCompiling(schema, root, baseId) {
115285 /* jshint validthis: true */
115286 var i = compIndex.call(this, schema, root, baseId);
115287 if (i >= 0) this._compilations.splice(i, 1);
115288}
115289
115290
115291/**
115292 * Index of schema compilation in the currently compiled list
115293 * @this Ajv
115294 * @param {Object} schema schema to compile
115295 * @param {Object} root root object
115296 * @param {String} baseId base schema ID
115297 * @return {Integer} compilation index
115298 */
115299function compIndex(schema, root, baseId) {
115300 /* jshint validthis: true */
115301 for (var i=0; i<this._compilations.length; i++) {
115302 var c = this._compilations[i];
115303 if (c.schema == schema && c.root == root && c.baseId == baseId) return i;
115304 }
115305 return -1;
115306}
115307
115308
115309function patternCode(i, patterns) {
115310 return 'var pattern' + i + ' = new RegExp(' + util.toQuotedString(patterns[i]) + ');';
115311}
115312
115313
115314function defaultCode(i) {
115315 return 'var default' + i + ' = defaults[' + i + '];';
115316}
115317
115318
115319function refValCode(i, refVal) {
115320 return refVal[i] === undefined ? '' : 'var refVal' + i + ' = refVal[' + i + '];';
115321}
115322
115323
115324function customRuleCode(i) {
115325 return 'var customRule' + i + ' = customRules[' + i + '];';
115326}
115327
115328
115329function vars(arr, statement) {
115330 if (!arr.length) return '';
115331 var code = '';
115332 for (var i=0; i<arr.length; i++)
115333 code += statement(i, arr);
115334 return code;
115335}
115336
115337
115338/***/ }),
115339/* 711 */
115340/***/ (function(module, exports, __webpack_require__) {
115341
115342"use strict";
115343
115344
115345var ruleModules = __webpack_require__(707)
115346 , toHash = __webpack_require__(106).toHash;
115347
115348module.exports = function rules() {
115349 var RULES = [
115350 { type: 'number',
115351 rules: [ { 'maximum': ['exclusiveMaximum'] },
115352 { 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] },
115353 { type: 'string',
115354 rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] },
115355 { type: 'array',
115356 rules: [ 'maxItems', 'minItems', 'uniqueItems', 'contains', 'items' ] },
115357 { type: 'object',
115358 rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames',
115359 { 'properties': ['additionalProperties', 'patternProperties'] } ] },
115360 { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf' ] }
115361 ];
115362
115363 var ALL = [ 'type' ];
115364 var KEYWORDS = [
115365 'additionalItems', '$schema', '$id', 'id', 'title',
115366 'description', 'default', 'definitions'
115367 ];
115368 var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];
115369 RULES.all = toHash(ALL);
115370 RULES.types = toHash(TYPES);
115371
115372 RULES.forEach(function (group) {
115373 group.rules = group.rules.map(function (keyword) {
115374 var implKeywords;
115375 if (typeof keyword == 'object') {
115376 var key = Object.keys(keyword)[0];
115377 implKeywords = keyword[key];
115378 keyword = key;
115379 implKeywords.forEach(function (k) {
115380 ALL.push(k);
115381 RULES.all[k] = true;
115382 });
115383 }
115384 ALL.push(keyword);
115385 var rule = RULES.all[keyword] = {
115386 keyword: keyword,
115387 code: ruleModules[keyword],
115388 implements: implKeywords
115389 };
115390 return rule;
115391 });
115392
115393 if (group.type) RULES.types[group.type] = group;
115394 });
115395
115396 RULES.keywords = toHash(ALL.concat(KEYWORDS));
115397 RULES.custom = {};
115398
115399 return RULES;
115400};
115401
115402
115403/***/ }),
115404/* 712 */
115405/***/ (function(module, exports, __webpack_require__) {
115406
115407"use strict";
115408
115409
115410// https://mathiasbynens.be/notes/javascript-encoding
115411// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
115412module.exports = function ucs2length(str) {
115413 var length = 0
115414 , len = str.length
115415 , pos = 0
115416 , value;
115417 while (pos < len) {
115418 length++;
115419 value = str.charCodeAt(pos++);
115420 if (value >= 0xD800 && value <= 0xDBFF && pos < len) {
115421 // high surrogate, and there is a next character
115422 value = str.charCodeAt(pos);
115423 if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate
115424 }
115425 }
115426 return length;
115427};
115428
115429
115430/***/ }),
115431/* 713 */
115432/***/ (function(module, exports, __webpack_require__) {
115433
115434"use strict";
115435
115436module.exports = function generate_allOf(it, $keyword, $ruleType) {
115437 var out = ' ';
115438 var $schema = it.schema[$keyword];
115439 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
115440 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
115441 var $breakOnError = !it.opts.allErrors;
115442 var $it = it.util.copy(it);
115443 var $closingBraces = '';
115444 $it.level++;
115445 var $nextValid = 'valid' + $it.level;
115446 var $currentBaseId = $it.baseId,
115447 $allSchemasEmpty = true;
115448 var arr1 = $schema;
115449 if (arr1) {
115450 var $sch, $i = -1,
115451 l1 = arr1.length - 1;
115452 while ($i < l1) {
115453 $sch = arr1[$i += 1];
115454 if (it.util.schemaHasRules($sch, it.RULES.all)) {
115455 $allSchemasEmpty = false;
115456 $it.schema = $sch;
115457 $it.schemaPath = $schemaPath + '[' + $i + ']';
115458 $it.errSchemaPath = $errSchemaPath + '/' + $i;
115459 out += ' ' + (it.validate($it)) + ' ';
115460 $it.baseId = $currentBaseId;
115461 if ($breakOnError) {
115462 out += ' if (' + ($nextValid) + ') { ';
115463 $closingBraces += '}';
115464 }
115465 }
115466 }
115467 }
115468 if ($breakOnError) {
115469 if ($allSchemasEmpty) {
115470 out += ' if (true) { ';
115471 } else {
115472 out += ' ' + ($closingBraces.slice(0, -1)) + ' ';
115473 }
115474 }
115475 out = it.util.cleanUpCode(out);
115476 return out;
115477}
115478
115479
115480/***/ }),
115481/* 714 */
115482/***/ (function(module, exports, __webpack_require__) {
115483
115484"use strict";
115485
115486module.exports = function generate_anyOf(it, $keyword, $ruleType) {
115487 var out = ' ';
115488 var $lvl = it.level;
115489 var $dataLvl = it.dataLevel;
115490 var $schema = it.schema[$keyword];
115491 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
115492 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
115493 var $breakOnError = !it.opts.allErrors;
115494 var $data = 'data' + ($dataLvl || '');
115495 var $valid = 'valid' + $lvl;
115496 var $errs = 'errs__' + $lvl;
115497 var $it = it.util.copy(it);
115498 var $closingBraces = '';
115499 $it.level++;
115500 var $nextValid = 'valid' + $it.level;
115501 var $noEmptySchema = $schema.every(function($sch) {
115502 return it.util.schemaHasRules($sch, it.RULES.all);
115503 });
115504 if ($noEmptySchema) {
115505 var $currentBaseId = $it.baseId;
115506 out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; ';
115507 var $wasComposite = it.compositeRule;
115508 it.compositeRule = $it.compositeRule = true;
115509 var arr1 = $schema;
115510 if (arr1) {
115511 var $sch, $i = -1,
115512 l1 = arr1.length - 1;
115513 while ($i < l1) {
115514 $sch = arr1[$i += 1];
115515 $it.schema = $sch;
115516 $it.schemaPath = $schemaPath + '[' + $i + ']';
115517 $it.errSchemaPath = $errSchemaPath + '/' + $i;
115518 out += ' ' + (it.validate($it)) + ' ';
115519 $it.baseId = $currentBaseId;
115520 out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { ';
115521 $closingBraces += '}';
115522 }
115523 }
115524 it.compositeRule = $it.compositeRule = $wasComposite;
115525 out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */
115526 if (it.createErrors !== false) {
115527 out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
115528 if (it.opts.messages !== false) {
115529 out += ' , message: \'should match some schema in anyOf\' ';
115530 }
115531 if (it.opts.verbose) {
115532 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
115533 }
115534 out += ' } ';
115535 } else {
115536 out += ' {} ';
115537 }
115538 out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
115539 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
115540 if (it.async) {
115541 out += ' throw new ValidationError(vErrors); ';
115542 } else {
115543 out += ' validate.errors = vErrors; return false; ';
115544 }
115545 }
115546 out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
115547 if (it.opts.allErrors) {
115548 out += ' } ';
115549 }
115550 out = it.util.cleanUpCode(out);
115551 } else {
115552 if ($breakOnError) {
115553 out += ' if (true) { ';
115554 }
115555 }
115556 return out;
115557}
115558
115559
115560/***/ }),
115561/* 715 */
115562/***/ (function(module, exports, __webpack_require__) {
115563
115564"use strict";
115565
115566module.exports = function generate_const(it, $keyword, $ruleType) {
115567 var out = ' ';
115568 var $lvl = it.level;
115569 var $dataLvl = it.dataLevel;
115570 var $schema = it.schema[$keyword];
115571 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
115572 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
115573 var $breakOnError = !it.opts.allErrors;
115574 var $data = 'data' + ($dataLvl || '');
115575 var $valid = 'valid' + $lvl;
115576 var $isData = it.opts.$data && $schema && $schema.$data,
115577 $schemaValue;
115578 if ($isData) {
115579 out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
115580 $schemaValue = 'schema' + $lvl;
115581 } else {
115582 $schemaValue = $schema;
115583 }
115584 if (!$isData) {
115585 out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';';
115586 }
115587 out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { ';
115588 var $$outStack = $$outStack || [];
115589 $$outStack.push(out);
115590 out = ''; /* istanbul ignore else */
115591 if (it.createErrors !== false) {
115592 out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
115593 if (it.opts.messages !== false) {
115594 out += ' , message: \'should be equal to constant\' ';
115595 }
115596 if (it.opts.verbose) {
115597 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
115598 }
115599 out += ' } ';
115600 } else {
115601 out += ' {} ';
115602 }
115603 var __err = out;
115604 out = $$outStack.pop();
115605 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
115606 if (it.async) {
115607 out += ' throw new ValidationError([' + (__err) + ']); ';
115608 } else {
115609 out += ' validate.errors = [' + (__err) + ']; return false; ';
115610 }
115611 } else {
115612 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
115613 }
115614 out += ' }';
115615 if ($breakOnError) {
115616 out += ' else { ';
115617 }
115618 return out;
115619}
115620
115621
115622/***/ }),
115623/* 716 */
115624/***/ (function(module, exports, __webpack_require__) {
115625
115626"use strict";
115627
115628module.exports = function generate_contains(it, $keyword, $ruleType) {
115629 var out = ' ';
115630 var $lvl = it.level;
115631 var $dataLvl = it.dataLevel;
115632 var $schema = it.schema[$keyword];
115633 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
115634 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
115635 var $breakOnError = !it.opts.allErrors;
115636 var $data = 'data' + ($dataLvl || '');
115637 var $valid = 'valid' + $lvl;
115638 var $errs = 'errs__' + $lvl;
115639 var $it = it.util.copy(it);
115640 var $closingBraces = '';
115641 $it.level++;
115642 var $nextValid = 'valid' + $it.level;
115643 var $idx = 'i' + $lvl,
115644 $dataNxt = $it.dataLevel = it.dataLevel + 1,
115645 $nextData = 'data' + $dataNxt,
115646 $currentBaseId = it.baseId,
115647 $nonEmptySchema = it.util.schemaHasRules($schema, it.RULES.all);
115648 out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
115649 if ($nonEmptySchema) {
115650 var $wasComposite = it.compositeRule;
115651 it.compositeRule = $it.compositeRule = true;
115652 $it.schema = $schema;
115653 $it.schemaPath = $schemaPath;
115654 $it.errSchemaPath = $errSchemaPath;
115655 out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
115656 $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
115657 var $passData = $data + '[' + $idx + ']';
115658 $it.dataPathArr[$dataNxt] = $idx;
115659 var $code = it.validate($it);
115660 $it.baseId = $currentBaseId;
115661 if (it.util.varOccurences($code, $nextData) < 2) {
115662 out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
115663 } else {
115664 out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
115665 }
115666 out += ' if (' + ($nextValid) + ') break; } ';
115667 it.compositeRule = $it.compositeRule = $wasComposite;
115668 out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {';
115669 } else {
115670 out += ' if (' + ($data) + '.length == 0) {';
115671 }
115672 var $$outStack = $$outStack || [];
115673 $$outStack.push(out);
115674 out = ''; /* istanbul ignore else */
115675 if (it.createErrors !== false) {
115676 out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
115677 if (it.opts.messages !== false) {
115678 out += ' , message: \'should contain a valid item\' ';
115679 }
115680 if (it.opts.verbose) {
115681 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
115682 }
115683 out += ' } ';
115684 } else {
115685 out += ' {} ';
115686 }
115687 var __err = out;
115688 out = $$outStack.pop();
115689 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
115690 if (it.async) {
115691 out += ' throw new ValidationError([' + (__err) + ']); ';
115692 } else {
115693 out += ' validate.errors = [' + (__err) + ']; return false; ';
115694 }
115695 } else {
115696 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
115697 }
115698 out += ' } else { ';
115699 if ($nonEmptySchema) {
115700 out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
115701 }
115702 if (it.opts.allErrors) {
115703 out += ' } ';
115704 }
115705 out = it.util.cleanUpCode(out);
115706 return out;
115707}
115708
115709
115710/***/ }),
115711/* 717 */
115712/***/ (function(module, exports, __webpack_require__) {
115713
115714"use strict";
115715
115716module.exports = function generate_custom(it, $keyword, $ruleType) {
115717 var out = ' ';
115718 var $lvl = it.level;
115719 var $dataLvl = it.dataLevel;
115720 var $schema = it.schema[$keyword];
115721 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
115722 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
115723 var $breakOnError = !it.opts.allErrors;
115724 var $errorKeyword;
115725 var $data = 'data' + ($dataLvl || '');
115726 var $valid = 'valid' + $lvl;
115727 var $errs = 'errs__' + $lvl;
115728 var $isData = it.opts.$data && $schema && $schema.$data,
115729 $schemaValue;
115730 if ($isData) {
115731 out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
115732 $schemaValue = 'schema' + $lvl;
115733 } else {
115734 $schemaValue = $schema;
115735 }
115736 var $rule = this,
115737 $definition = 'definition' + $lvl,
115738 $rDef = $rule.definition,
115739 $closingBraces = '';
115740 var $compile, $inline, $macro, $ruleValidate, $validateCode;
115741 if ($isData && $rDef.$data) {
115742 $validateCode = 'keywordValidate' + $lvl;
115743 var $validateSchema = $rDef.validateSchema;
115744 out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;';
115745 } else {
115746 $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);
115747 if (!$ruleValidate) return;
115748 $schemaValue = 'validate.schema' + $schemaPath;
115749 $validateCode = $ruleValidate.code;
115750 $compile = $rDef.compile;
115751 $inline = $rDef.inline;
115752 $macro = $rDef.macro;
115753 }
115754 var $ruleErrs = $validateCode + '.errors',
115755 $i = 'i' + $lvl,
115756 $ruleErr = 'ruleErr' + $lvl,
115757 $asyncKeyword = $rDef.async;
115758 if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema');
115759 if (!($inline || $macro)) {
115760 out += '' + ($ruleErrs) + ' = null;';
115761 }
115762 out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
115763 if ($isData && $rDef.$data) {
115764 $closingBraces += '}';
115765 out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { ';
115766 if ($validateSchema) {
115767 $closingBraces += '}';
115768 out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { ';
115769 }
115770 }
115771 if ($inline) {
115772 if ($rDef.statements) {
115773 out += ' ' + ($ruleValidate.validate) + ' ';
115774 } else {
115775 out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; ';
115776 }
115777 } else if ($macro) {
115778 var $it = it.util.copy(it);
115779 var $closingBraces = '';
115780 $it.level++;
115781 var $nextValid = 'valid' + $it.level;
115782 $it.schema = $ruleValidate.validate;
115783 $it.schemaPath = '';
115784 var $wasComposite = it.compositeRule;
115785 it.compositeRule = $it.compositeRule = true;
115786 var $code = it.validate($it).replace(/validate\.schema/g, $validateCode);
115787 it.compositeRule = $it.compositeRule = $wasComposite;
115788 out += ' ' + ($code);
115789 } else {
115790 var $$outStack = $$outStack || [];
115791 $$outStack.push(out);
115792 out = '';
115793 out += ' ' + ($validateCode) + '.call( ';
115794 if (it.opts.passContext) {
115795 out += 'this';
115796 } else {
115797 out += 'self';
115798 }
115799 if ($compile || $rDef.schema === false) {
115800 out += ' , ' + ($data) + ' ';
115801 } else {
115802 out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' ';
115803 }
115804 out += ' , (dataPath || \'\')';
115805 if (it.errorPath != '""') {
115806 out += ' + ' + (it.errorPath);
115807 }
115808 var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
115809 $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
115810 out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) ';
115811 var def_callRuleValidate = out;
115812 out = $$outStack.pop();
115813 if ($rDef.errors === false) {
115814 out += ' ' + ($valid) + ' = ';
115815 if ($asyncKeyword) {
115816 out += '' + (it.yieldAwait);
115817 }
115818 out += '' + (def_callRuleValidate) + '; ';
115819 } else {
115820 if ($asyncKeyword) {
115821 $ruleErrs = 'customErrors' + $lvl;
115822 out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = ' + (it.yieldAwait) + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } ';
115823 } else {
115824 out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; ';
115825 }
115826 }
115827 }
115828 if ($rDef.modifying) {
115829 out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];';
115830 }
115831 out += '' + ($closingBraces);
115832 if ($rDef.valid) {
115833 if ($breakOnError) {
115834 out += ' if (true) { ';
115835 }
115836 } else {
115837 out += ' if ( ';
115838 if ($rDef.valid === undefined) {
115839 out += ' !';
115840 if ($macro) {
115841 out += '' + ($nextValid);
115842 } else {
115843 out += '' + ($valid);
115844 }
115845 } else {
115846 out += ' ' + (!$rDef.valid) + ' ';
115847 }
115848 out += ') { ';
115849 $errorKeyword = $rule.keyword;
115850 var $$outStack = $$outStack || [];
115851 $$outStack.push(out);
115852 out = '';
115853 var $$outStack = $$outStack || [];
115854 $$outStack.push(out);
115855 out = ''; /* istanbul ignore else */
115856 if (it.createErrors !== false) {
115857 out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
115858 if (it.opts.messages !== false) {
115859 out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
115860 }
115861 if (it.opts.verbose) {
115862 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
115863 }
115864 out += ' } ';
115865 } else {
115866 out += ' {} ';
115867 }
115868 var __err = out;
115869 out = $$outStack.pop();
115870 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
115871 if (it.async) {
115872 out += ' throw new ValidationError([' + (__err) + ']); ';
115873 } else {
115874 out += ' validate.errors = [' + (__err) + ']; return false; ';
115875 }
115876 } else {
115877 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
115878 }
115879 var def_customError = out;
115880 out = $$outStack.pop();
115881 if ($inline) {
115882 if ($rDef.errors) {
115883 if ($rDef.errors != 'full') {
115884 out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
115885 if (it.opts.verbose) {
115886 out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
115887 }
115888 out += ' } ';
115889 }
115890 } else {
115891 if ($rDef.errors === false) {
115892 out += ' ' + (def_customError) + ' ';
115893 } else {
115894 out += ' if (' + ($errs) + ' == errors) { ' + (def_customError) + ' } else { for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
115895 if (it.opts.verbose) {
115896 out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
115897 }
115898 out += ' } } ';
115899 }
115900 }
115901 } else if ($macro) {
115902 out += ' var err = '; /* istanbul ignore else */
115903 if (it.createErrors !== false) {
115904 out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
115905 if (it.opts.messages !== false) {
115906 out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
115907 }
115908 if (it.opts.verbose) {
115909 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
115910 }
115911 out += ' } ';
115912 } else {
115913 out += ' {} ';
115914 }
115915 out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
115916 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
115917 if (it.async) {
115918 out += ' throw new ValidationError(vErrors); ';
115919 } else {
115920 out += ' validate.errors = vErrors; return false; ';
115921 }
115922 }
115923 } else {
115924 if ($rDef.errors === false) {
115925 out += ' ' + (def_customError) + ' ';
115926 } else {
115927 out += ' if (Array.isArray(' + ($ruleErrs) + ')) { if (vErrors === null) vErrors = ' + ($ruleErrs) + '; else vErrors = vErrors.concat(' + ($ruleErrs) + '); errors = vErrors.length; for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; ';
115928 if (it.opts.verbose) {
115929 out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
115930 }
115931 out += ' } } else { ' + (def_customError) + ' } ';
115932 }
115933 }
115934 out += ' } ';
115935 if ($breakOnError) {
115936 out += ' else { ';
115937 }
115938 }
115939 return out;
115940}
115941
115942
115943/***/ }),
115944/* 718 */
115945/***/ (function(module, exports, __webpack_require__) {
115946
115947"use strict";
115948
115949module.exports = function generate_dependencies(it, $keyword, $ruleType) {
115950 var out = ' ';
115951 var $lvl = it.level;
115952 var $dataLvl = it.dataLevel;
115953 var $schema = it.schema[$keyword];
115954 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
115955 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
115956 var $breakOnError = !it.opts.allErrors;
115957 var $data = 'data' + ($dataLvl || '');
115958 var $errs = 'errs__' + $lvl;
115959 var $it = it.util.copy(it);
115960 var $closingBraces = '';
115961 $it.level++;
115962 var $nextValid = 'valid' + $it.level;
115963 var $schemaDeps = {},
115964 $propertyDeps = {},
115965 $ownProperties = it.opts.ownProperties;
115966 for ($property in $schema) {
115967 var $sch = $schema[$property];
115968 var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps;
115969 $deps[$property] = $sch;
115970 }
115971 out += 'var ' + ($errs) + ' = errors;';
115972 var $currentErrorPath = it.errorPath;
115973 out += 'var missing' + ($lvl) + ';';
115974 for (var $property in $propertyDeps) {
115975 $deps = $propertyDeps[$property];
115976 if ($deps.length) {
115977 out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';
115978 if ($ownProperties) {
115979 out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') ';
115980 }
115981 if ($breakOnError) {
115982 out += ' && ( ';
115983 var arr1 = $deps;
115984 if (arr1) {
115985 var $propertyKey, $i = -1,
115986 l1 = arr1.length - 1;
115987 while ($i < l1) {
115988 $propertyKey = arr1[$i += 1];
115989 if ($i) {
115990 out += ' || ';
115991 }
115992 var $prop = it.util.getProperty($propertyKey),
115993 $useData = $data + $prop;
115994 out += ' ( ( ' + ($useData) + ' === undefined ';
115995 if ($ownProperties) {
115996 out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
115997 }
115998 out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';
115999 }
116000 }
116001 out += ')) { ';
116002 var $propertyPath = 'missing' + $lvl,
116003 $missingProperty = '\' + ' + $propertyPath + ' + \'';
116004 if (it.opts._errorDataPathProperty) {
116005 it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;
116006 }
116007 var $$outStack = $$outStack || [];
116008 $$outStack.push(out);
116009 out = ''; /* istanbul ignore else */
116010 if (it.createErrors !== false) {
116011 out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } ';
116012 if (it.opts.messages !== false) {
116013 out += ' , message: \'should have ';
116014 if ($deps.length == 1) {
116015 out += 'property ' + (it.util.escapeQuotes($deps[0]));
116016 } else {
116017 out += 'properties ' + (it.util.escapeQuotes($deps.join(", ")));
116018 }
116019 out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' ';
116020 }
116021 if (it.opts.verbose) {
116022 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
116023 }
116024 out += ' } ';
116025 } else {
116026 out += ' {} ';
116027 }
116028 var __err = out;
116029 out = $$outStack.pop();
116030 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
116031 if (it.async) {
116032 out += ' throw new ValidationError([' + (__err) + ']); ';
116033 } else {
116034 out += ' validate.errors = [' + (__err) + ']; return false; ';
116035 }
116036 } else {
116037 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
116038 }
116039 } else {
116040 out += ' ) { ';
116041 var arr2 = $deps;
116042 if (arr2) {
116043 var $propertyKey, i2 = -1,
116044 l2 = arr2.length - 1;
116045 while (i2 < l2) {
116046 $propertyKey = arr2[i2 += 1];
116047 var $prop = it.util.getProperty($propertyKey),
116048 $missingProperty = it.util.escapeQuotes($propertyKey),
116049 $useData = $data + $prop;
116050 if (it.opts._errorDataPathProperty) {
116051 it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
116052 }
116053 out += ' if ( ' + ($useData) + ' === undefined ';
116054 if ($ownProperties) {
116055 out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
116056 }
116057 out += ') { var err = '; /* istanbul ignore else */
116058 if (it.createErrors !== false) {
116059 out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } ';
116060 if (it.opts.messages !== false) {
116061 out += ' , message: \'should have ';
116062 if ($deps.length == 1) {
116063 out += 'property ' + (it.util.escapeQuotes($deps[0]));
116064 } else {
116065 out += 'properties ' + (it.util.escapeQuotes($deps.join(", ")));
116066 }
116067 out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' ';
116068 }
116069 if (it.opts.verbose) {
116070 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
116071 }
116072 out += ' } ';
116073 } else {
116074 out += ' {} ';
116075 }
116076 out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';
116077 }
116078 }
116079 }
116080 out += ' } ';
116081 if ($breakOnError) {
116082 $closingBraces += '}';
116083 out += ' else { ';
116084 }
116085 }
116086 }
116087 it.errorPath = $currentErrorPath;
116088 var $currentBaseId = $it.baseId;
116089 for (var $property in $schemaDeps) {
116090 var $sch = $schemaDeps[$property];
116091 if (it.util.schemaHasRules($sch, it.RULES.all)) {
116092 out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';
116093 if ($ownProperties) {
116094 out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') ';
116095 }
116096 out += ') { ';
116097 $it.schema = $sch;
116098 $it.schemaPath = $schemaPath + it.util.getProperty($property);
116099 $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property);
116100 out += ' ' + (it.validate($it)) + ' ';
116101 $it.baseId = $currentBaseId;
116102 out += ' } ';
116103 if ($breakOnError) {
116104 out += ' if (' + ($nextValid) + ') { ';
116105 $closingBraces += '}';
116106 }
116107 }
116108 }
116109 if ($breakOnError) {
116110 out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
116111 }
116112 out = it.util.cleanUpCode(out);
116113 return out;
116114}
116115
116116
116117/***/ }),
116118/* 719 */
116119/***/ (function(module, exports, __webpack_require__) {
116120
116121"use strict";
116122
116123module.exports = function generate_enum(it, $keyword, $ruleType) {
116124 var out = ' ';
116125 var $lvl = it.level;
116126 var $dataLvl = it.dataLevel;
116127 var $schema = it.schema[$keyword];
116128 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
116129 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
116130 var $breakOnError = !it.opts.allErrors;
116131 var $data = 'data' + ($dataLvl || '');
116132 var $valid = 'valid' + $lvl;
116133 var $isData = it.opts.$data && $schema && $schema.$data,
116134 $schemaValue;
116135 if ($isData) {
116136 out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
116137 $schemaValue = 'schema' + $lvl;
116138 } else {
116139 $schemaValue = $schema;
116140 }
116141 var $i = 'i' + $lvl,
116142 $vSchema = 'schema' + $lvl;
116143 if (!$isData) {
116144 out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';';
116145 }
116146 out += 'var ' + ($valid) + ';';
116147 if ($isData) {
116148 out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
116149 }
116150 out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }';
116151 if ($isData) {
116152 out += ' } ';
116153 }
116154 out += ' if (!' + ($valid) + ') { ';
116155 var $$outStack = $$outStack || [];
116156 $$outStack.push(out);
116157 out = ''; /* istanbul ignore else */
116158 if (it.createErrors !== false) {
116159 out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } ';
116160 if (it.opts.messages !== false) {
116161 out += ' , message: \'should be equal to one of the allowed values\' ';
116162 }
116163 if (it.opts.verbose) {
116164 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
116165 }
116166 out += ' } ';
116167 } else {
116168 out += ' {} ';
116169 }
116170 var __err = out;
116171 out = $$outStack.pop();
116172 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
116173 if (it.async) {
116174 out += ' throw new ValidationError([' + (__err) + ']); ';
116175 } else {
116176 out += ' validate.errors = [' + (__err) + ']; return false; ';
116177 }
116178 } else {
116179 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
116180 }
116181 out += ' }';
116182 if ($breakOnError) {
116183 out += ' else { ';
116184 }
116185 return out;
116186}
116187
116188
116189/***/ }),
116190/* 720 */
116191/***/ (function(module, exports, __webpack_require__) {
116192
116193"use strict";
116194
116195module.exports = function generate_format(it, $keyword, $ruleType) {
116196 var out = ' ';
116197 var $lvl = it.level;
116198 var $dataLvl = it.dataLevel;
116199 var $schema = it.schema[$keyword];
116200 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
116201 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
116202 var $breakOnError = !it.opts.allErrors;
116203 var $data = 'data' + ($dataLvl || '');
116204 if (it.opts.format === false) {
116205 if ($breakOnError) {
116206 out += ' if (true) { ';
116207 }
116208 return out;
116209 }
116210 var $isData = it.opts.$data && $schema && $schema.$data,
116211 $schemaValue;
116212 if ($isData) {
116213 out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
116214 $schemaValue = 'schema' + $lvl;
116215 } else {
116216 $schemaValue = $schema;
116217 }
116218 var $unknownFormats = it.opts.unknownFormats,
116219 $allowUnknown = Array.isArray($unknownFormats);
116220 if ($isData) {
116221 var $format = 'format' + $lvl,
116222 $isObject = 'isObject' + $lvl,
116223 $formatType = 'formatType' + $lvl;
116224 out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { ';
116225 if (it.async) {
116226 out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; ';
116227 }
116228 out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if ( ';
116229 if ($isData) {
116230 out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
116231 }
116232 out += ' (';
116233 if ($unknownFormats != 'ignore') {
116234 out += ' (' + ($schemaValue) + ' && !' + ($format) + ' ';
116235 if ($allowUnknown) {
116236 out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 ';
116237 }
116238 out += ') || ';
116239 }
116240 out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? ';
116241 if (it.async) {
116242 out += ' (async' + ($lvl) + ' ? ' + (it.yieldAwait) + ' ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) ';
116243 } else {
116244 out += ' ' + ($format) + '(' + ($data) + ') ';
116245 }
116246 out += ' : ' + ($format) + '.test(' + ($data) + '))))) {';
116247 } else {
116248 var $format = it.formats[$schema];
116249 if (!$format) {
116250 if ($unknownFormats == 'ignore') {
116251 it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"');
116252 if ($breakOnError) {
116253 out += ' if (true) { ';
116254 }
116255 return out;
116256 } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) {
116257 if ($breakOnError) {
116258 out += ' if (true) { ';
116259 }
116260 return out;
116261 } else {
116262 throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"');
116263 }
116264 }
116265 var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate;
116266 var $formatType = $isObject && $format.type || 'string';
116267 if ($isObject) {
116268 var $async = $format.async === true;
116269 $format = $format.validate;
116270 }
116271 if ($formatType != $ruleType) {
116272 if ($breakOnError) {
116273 out += ' if (true) { ';
116274 }
116275 return out;
116276 }
116277 if ($async) {
116278 if (!it.async) throw new Error('async format in sync schema');
116279 var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';
116280 out += ' if (!(' + (it.yieldAwait) + ' ' + ($formatRef) + '(' + ($data) + '))) { ';
116281 } else {
116282 out += ' if (! ';
116283 var $formatRef = 'formats' + it.util.getProperty($schema);
116284 if ($isObject) $formatRef += '.validate';
116285 if (typeof $format == 'function') {
116286 out += ' ' + ($formatRef) + '(' + ($data) + ') ';
116287 } else {
116288 out += ' ' + ($formatRef) + '.test(' + ($data) + ') ';
116289 }
116290 out += ') { ';
116291 }
116292 }
116293 var $$outStack = $$outStack || [];
116294 $$outStack.push(out);
116295 out = ''; /* istanbul ignore else */
116296 if (it.createErrors !== false) {
116297 out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: ';
116298 if ($isData) {
116299 out += '' + ($schemaValue);
116300 } else {
116301 out += '' + (it.util.toQuotedString($schema));
116302 }
116303 out += ' } ';
116304 if (it.opts.messages !== false) {
116305 out += ' , message: \'should match format "';
116306 if ($isData) {
116307 out += '\' + ' + ($schemaValue) + ' + \'';
116308 } else {
116309 out += '' + (it.util.escapeQuotes($schema));
116310 }
116311 out += '"\' ';
116312 }
116313 if (it.opts.verbose) {
116314 out += ' , schema: ';
116315 if ($isData) {
116316 out += 'validate.schema' + ($schemaPath);
116317 } else {
116318 out += '' + (it.util.toQuotedString($schema));
116319 }
116320 out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
116321 }
116322 out += ' } ';
116323 } else {
116324 out += ' {} ';
116325 }
116326 var __err = out;
116327 out = $$outStack.pop();
116328 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
116329 if (it.async) {
116330 out += ' throw new ValidationError([' + (__err) + ']); ';
116331 } else {
116332 out += ' validate.errors = [' + (__err) + ']; return false; ';
116333 }
116334 } else {
116335 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
116336 }
116337 out += ' } ';
116338 if ($breakOnError) {
116339 out += ' else { ';
116340 }
116341 return out;
116342}
116343
116344
116345/***/ }),
116346/* 721 */
116347/***/ (function(module, exports, __webpack_require__) {
116348
116349"use strict";
116350
116351module.exports = function generate_items(it, $keyword, $ruleType) {
116352 var out = ' ';
116353 var $lvl = it.level;
116354 var $dataLvl = it.dataLevel;
116355 var $schema = it.schema[$keyword];
116356 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
116357 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
116358 var $breakOnError = !it.opts.allErrors;
116359 var $data = 'data' + ($dataLvl || '');
116360 var $valid = 'valid' + $lvl;
116361 var $errs = 'errs__' + $lvl;
116362 var $it = it.util.copy(it);
116363 var $closingBraces = '';
116364 $it.level++;
116365 var $nextValid = 'valid' + $it.level;
116366 var $idx = 'i' + $lvl,
116367 $dataNxt = $it.dataLevel = it.dataLevel + 1,
116368 $nextData = 'data' + $dataNxt,
116369 $currentBaseId = it.baseId;
116370 out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
116371 if (Array.isArray($schema)) {
116372 var $additionalItems = it.schema.additionalItems;
116373 if ($additionalItems === false) {
116374 out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; ';
116375 var $currErrSchemaPath = $errSchemaPath;
116376 $errSchemaPath = it.errSchemaPath + '/additionalItems';
116377 out += ' if (!' + ($valid) + ') { ';
116378 var $$outStack = $$outStack || [];
116379 $$outStack.push(out);
116380 out = ''; /* istanbul ignore else */
116381 if (it.createErrors !== false) {
116382 out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } ';
116383 if (it.opts.messages !== false) {
116384 out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' ';
116385 }
116386 if (it.opts.verbose) {
116387 out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
116388 }
116389 out += ' } ';
116390 } else {
116391 out += ' {} ';
116392 }
116393 var __err = out;
116394 out = $$outStack.pop();
116395 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
116396 if (it.async) {
116397 out += ' throw new ValidationError([' + (__err) + ']); ';
116398 } else {
116399 out += ' validate.errors = [' + (__err) + ']; return false; ';
116400 }
116401 } else {
116402 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
116403 }
116404 out += ' } ';
116405 $errSchemaPath = $currErrSchemaPath;
116406 if ($breakOnError) {
116407 $closingBraces += '}';
116408 out += ' else { ';
116409 }
116410 }
116411 var arr1 = $schema;
116412 if (arr1) {
116413 var $sch, $i = -1,
116414 l1 = arr1.length - 1;
116415 while ($i < l1) {
116416 $sch = arr1[$i += 1];
116417 if (it.util.schemaHasRules($sch, it.RULES.all)) {
116418 out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { ';
116419 var $passData = $data + '[' + $i + ']';
116420 $it.schema = $sch;
116421 $it.schemaPath = $schemaPath + '[' + $i + ']';
116422 $it.errSchemaPath = $errSchemaPath + '/' + $i;
116423 $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);
116424 $it.dataPathArr[$dataNxt] = $i;
116425 var $code = it.validate($it);
116426 $it.baseId = $currentBaseId;
116427 if (it.util.varOccurences($code, $nextData) < 2) {
116428 out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
116429 } else {
116430 out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
116431 }
116432 out += ' } ';
116433 if ($breakOnError) {
116434 out += ' if (' + ($nextValid) + ') { ';
116435 $closingBraces += '}';
116436 }
116437 }
116438 }
116439 }
116440 if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) {
116441 $it.schema = $additionalItems;
116442 $it.schemaPath = it.schemaPath + '.additionalItems';
116443 $it.errSchemaPath = it.errSchemaPath + '/additionalItems';
116444 out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
116445 $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
116446 var $passData = $data + '[' + $idx + ']';
116447 $it.dataPathArr[$dataNxt] = $idx;
116448 var $code = it.validate($it);
116449 $it.baseId = $currentBaseId;
116450 if (it.util.varOccurences($code, $nextData) < 2) {
116451 out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
116452 } else {
116453 out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
116454 }
116455 if ($breakOnError) {
116456 out += ' if (!' + ($nextValid) + ') break; ';
116457 }
116458 out += ' } } ';
116459 if ($breakOnError) {
116460 out += ' if (' + ($nextValid) + ') { ';
116461 $closingBraces += '}';
116462 }
116463 }
116464 } else if (it.util.schemaHasRules($schema, it.RULES.all)) {
116465 $it.schema = $schema;
116466 $it.schemaPath = $schemaPath;
116467 $it.errSchemaPath = $errSchemaPath;
116468 out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
116469 $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
116470 var $passData = $data + '[' + $idx + ']';
116471 $it.dataPathArr[$dataNxt] = $idx;
116472 var $code = it.validate($it);
116473 $it.baseId = $currentBaseId;
116474 if (it.util.varOccurences($code, $nextData) < 2) {
116475 out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
116476 } else {
116477 out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
116478 }
116479 if ($breakOnError) {
116480 out += ' if (!' + ($nextValid) + ') break; ';
116481 }
116482 out += ' }';
116483 }
116484 if ($breakOnError) {
116485 out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
116486 }
116487 out = it.util.cleanUpCode(out);
116488 return out;
116489}
116490
116491
116492/***/ }),
116493/* 722 */
116494/***/ (function(module, exports, __webpack_require__) {
116495
116496"use strict";
116497
116498module.exports = function generate_multipleOf(it, $keyword, $ruleType) {
116499 var out = ' ';
116500 var $lvl = it.level;
116501 var $dataLvl = it.dataLevel;
116502 var $schema = it.schema[$keyword];
116503 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
116504 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
116505 var $breakOnError = !it.opts.allErrors;
116506 var $data = 'data' + ($dataLvl || '');
116507 var $isData = it.opts.$data && $schema && $schema.$data,
116508 $schemaValue;
116509 if ($isData) {
116510 out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
116511 $schemaValue = 'schema' + $lvl;
116512 } else {
116513 $schemaValue = $schema;
116514 }
116515 out += 'var division' + ($lvl) + ';if (';
116516 if ($isData) {
116517 out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || ';
116518 }
116519 out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', ';
116520 if (it.opts.multipleOfPrecision) {
116521 out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' ';
116522 } else {
116523 out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') ';
116524 }
116525 out += ' ) ';
116526 if ($isData) {
116527 out += ' ) ';
116528 }
116529 out += ' ) { ';
116530 var $$outStack = $$outStack || [];
116531 $$outStack.push(out);
116532 out = ''; /* istanbul ignore else */
116533 if (it.createErrors !== false) {
116534 out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } ';
116535 if (it.opts.messages !== false) {
116536 out += ' , message: \'should be multiple of ';
116537 if ($isData) {
116538 out += '\' + ' + ($schemaValue);
116539 } else {
116540 out += '' + ($schemaValue) + '\'';
116541 }
116542 }
116543 if (it.opts.verbose) {
116544 out += ' , schema: ';
116545 if ($isData) {
116546 out += 'validate.schema' + ($schemaPath);
116547 } else {
116548 out += '' + ($schema);
116549 }
116550 out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
116551 }
116552 out += ' } ';
116553 } else {
116554 out += ' {} ';
116555 }
116556 var __err = out;
116557 out = $$outStack.pop();
116558 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
116559 if (it.async) {
116560 out += ' throw new ValidationError([' + (__err) + ']); ';
116561 } else {
116562 out += ' validate.errors = [' + (__err) + ']; return false; ';
116563 }
116564 } else {
116565 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
116566 }
116567 out += '} ';
116568 if ($breakOnError) {
116569 out += ' else { ';
116570 }
116571 return out;
116572}
116573
116574
116575/***/ }),
116576/* 723 */
116577/***/ (function(module, exports, __webpack_require__) {
116578
116579"use strict";
116580
116581module.exports = function generate_not(it, $keyword, $ruleType) {
116582 var out = ' ';
116583 var $lvl = it.level;
116584 var $dataLvl = it.dataLevel;
116585 var $schema = it.schema[$keyword];
116586 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
116587 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
116588 var $breakOnError = !it.opts.allErrors;
116589 var $data = 'data' + ($dataLvl || '');
116590 var $errs = 'errs__' + $lvl;
116591 var $it = it.util.copy(it);
116592 $it.level++;
116593 var $nextValid = 'valid' + $it.level;
116594 if (it.util.schemaHasRules($schema, it.RULES.all)) {
116595 $it.schema = $schema;
116596 $it.schemaPath = $schemaPath;
116597 $it.errSchemaPath = $errSchemaPath;
116598 out += ' var ' + ($errs) + ' = errors; ';
116599 var $wasComposite = it.compositeRule;
116600 it.compositeRule = $it.compositeRule = true;
116601 $it.createErrors = false;
116602 var $allErrorsOption;
116603 if ($it.opts.allErrors) {
116604 $allErrorsOption = $it.opts.allErrors;
116605 $it.opts.allErrors = false;
116606 }
116607 out += ' ' + (it.validate($it)) + ' ';
116608 $it.createErrors = true;
116609 if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;
116610 it.compositeRule = $it.compositeRule = $wasComposite;
116611 out += ' if (' + ($nextValid) + ') { ';
116612 var $$outStack = $$outStack || [];
116613 $$outStack.push(out);
116614 out = ''; /* istanbul ignore else */
116615 if (it.createErrors !== false) {
116616 out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
116617 if (it.opts.messages !== false) {
116618 out += ' , message: \'should NOT be valid\' ';
116619 }
116620 if (it.opts.verbose) {
116621 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
116622 }
116623 out += ' } ';
116624 } else {
116625 out += ' {} ';
116626 }
116627 var __err = out;
116628 out = $$outStack.pop();
116629 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
116630 if (it.async) {
116631 out += ' throw new ValidationError([' + (__err) + ']); ';
116632 } else {
116633 out += ' validate.errors = [' + (__err) + ']; return false; ';
116634 }
116635 } else {
116636 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
116637 }
116638 out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
116639 if (it.opts.allErrors) {
116640 out += ' } ';
116641 }
116642 } else {
116643 out += ' var err = '; /* istanbul ignore else */
116644 if (it.createErrors !== false) {
116645 out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
116646 if (it.opts.messages !== false) {
116647 out += ' , message: \'should NOT be valid\' ';
116648 }
116649 if (it.opts.verbose) {
116650 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
116651 }
116652 out += ' } ';
116653 } else {
116654 out += ' {} ';
116655 }
116656 out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
116657 if ($breakOnError) {
116658 out += ' if (false) { ';
116659 }
116660 }
116661 return out;
116662}
116663
116664
116665/***/ }),
116666/* 724 */
116667/***/ (function(module, exports, __webpack_require__) {
116668
116669"use strict";
116670
116671module.exports = function generate_oneOf(it, $keyword, $ruleType) {
116672 var out = ' ';
116673 var $lvl = it.level;
116674 var $dataLvl = it.dataLevel;
116675 var $schema = it.schema[$keyword];
116676 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
116677 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
116678 var $breakOnError = !it.opts.allErrors;
116679 var $data = 'data' + ($dataLvl || '');
116680 var $valid = 'valid' + $lvl;
116681 var $errs = 'errs__' + $lvl;
116682 var $it = it.util.copy(it);
116683 var $closingBraces = '';
116684 $it.level++;
116685 var $nextValid = 'valid' + $it.level;
116686 out += 'var ' + ($errs) + ' = errors;var prevValid' + ($lvl) + ' = false;var ' + ($valid) + ' = false;';
116687 var $currentBaseId = $it.baseId;
116688 var $wasComposite = it.compositeRule;
116689 it.compositeRule = $it.compositeRule = true;
116690 var arr1 = $schema;
116691 if (arr1) {
116692 var $sch, $i = -1,
116693 l1 = arr1.length - 1;
116694 while ($i < l1) {
116695 $sch = arr1[$i += 1];
116696 if (it.util.schemaHasRules($sch, it.RULES.all)) {
116697 $it.schema = $sch;
116698 $it.schemaPath = $schemaPath + '[' + $i + ']';
116699 $it.errSchemaPath = $errSchemaPath + '/' + $i;
116700 out += ' ' + (it.validate($it)) + ' ';
116701 $it.baseId = $currentBaseId;
116702 } else {
116703 out += ' var ' + ($nextValid) + ' = true; ';
116704 }
116705 if ($i) {
116706 out += ' if (' + ($nextValid) + ' && prevValid' + ($lvl) + ') ' + ($valid) + ' = false; else { ';
116707 $closingBraces += '}';
116708 }
116709 out += ' if (' + ($nextValid) + ') ' + ($valid) + ' = prevValid' + ($lvl) + ' = true;';
116710 }
116711 }
116712 it.compositeRule = $it.compositeRule = $wasComposite;
116713 out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */
116714 if (it.createErrors !== false) {
116715 out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
116716 if (it.opts.messages !== false) {
116717 out += ' , message: \'should match exactly one schema in oneOf\' ';
116718 }
116719 if (it.opts.verbose) {
116720 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
116721 }
116722 out += ' } ';
116723 } else {
116724 out += ' {} ';
116725 }
116726 out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
116727 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
116728 if (it.async) {
116729 out += ' throw new ValidationError(vErrors); ';
116730 } else {
116731 out += ' validate.errors = vErrors; return false; ';
116732 }
116733 }
116734 out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }';
116735 if (it.opts.allErrors) {
116736 out += ' } ';
116737 }
116738 return out;
116739}
116740
116741
116742/***/ }),
116743/* 725 */
116744/***/ (function(module, exports, __webpack_require__) {
116745
116746"use strict";
116747
116748module.exports = function generate_pattern(it, $keyword, $ruleType) {
116749 var out = ' ';
116750 var $lvl = it.level;
116751 var $dataLvl = it.dataLevel;
116752 var $schema = it.schema[$keyword];
116753 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
116754 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
116755 var $breakOnError = !it.opts.allErrors;
116756 var $data = 'data' + ($dataLvl || '');
116757 var $isData = it.opts.$data && $schema && $schema.$data,
116758 $schemaValue;
116759 if ($isData) {
116760 out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
116761 $schemaValue = 'schema' + $lvl;
116762 } else {
116763 $schemaValue = $schema;
116764 }
116765 var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema);
116766 out += 'if ( ';
116767 if ($isData) {
116768 out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
116769 }
116770 out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { ';
116771 var $$outStack = $$outStack || [];
116772 $$outStack.push(out);
116773 out = ''; /* istanbul ignore else */
116774 if (it.createErrors !== false) {
116775 out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: ';
116776 if ($isData) {
116777 out += '' + ($schemaValue);
116778 } else {
116779 out += '' + (it.util.toQuotedString($schema));
116780 }
116781 out += ' } ';
116782 if (it.opts.messages !== false) {
116783 out += ' , message: \'should match pattern "';
116784 if ($isData) {
116785 out += '\' + ' + ($schemaValue) + ' + \'';
116786 } else {
116787 out += '' + (it.util.escapeQuotes($schema));
116788 }
116789 out += '"\' ';
116790 }
116791 if (it.opts.verbose) {
116792 out += ' , schema: ';
116793 if ($isData) {
116794 out += 'validate.schema' + ($schemaPath);
116795 } else {
116796 out += '' + (it.util.toQuotedString($schema));
116797 }
116798 out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
116799 }
116800 out += ' } ';
116801 } else {
116802 out += ' {} ';
116803 }
116804 var __err = out;
116805 out = $$outStack.pop();
116806 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
116807 if (it.async) {
116808 out += ' throw new ValidationError([' + (__err) + ']); ';
116809 } else {
116810 out += ' validate.errors = [' + (__err) + ']; return false; ';
116811 }
116812 } else {
116813 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
116814 }
116815 out += '} ';
116816 if ($breakOnError) {
116817 out += ' else { ';
116818 }
116819 return out;
116820}
116821
116822
116823/***/ }),
116824/* 726 */
116825/***/ (function(module, exports, __webpack_require__) {
116826
116827"use strict";
116828
116829module.exports = function generate_properties(it, $keyword, $ruleType) {
116830 var out = ' ';
116831 var $lvl = it.level;
116832 var $dataLvl = it.dataLevel;
116833 var $schema = it.schema[$keyword];
116834 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
116835 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
116836 var $breakOnError = !it.opts.allErrors;
116837 var $data = 'data' + ($dataLvl || '');
116838 var $valid = 'valid' + $lvl;
116839 var $errs = 'errs__' + $lvl;
116840 var $it = it.util.copy(it);
116841 var $closingBraces = '';
116842 $it.level++;
116843 var $nextValid = 'valid' + $it.level;
116844 var $key = 'key' + $lvl,
116845 $idx = 'idx' + $lvl,
116846 $dataNxt = $it.dataLevel = it.dataLevel + 1,
116847 $nextData = 'data' + $dataNxt,
116848 $dataProperties = 'dataProperties' + $lvl;
116849 var $schemaKeys = Object.keys($schema || {}),
116850 $pProperties = it.schema.patternProperties || {},
116851 $pPropertyKeys = Object.keys($pProperties),
116852 $aProperties = it.schema.additionalProperties,
116853 $someProperties = $schemaKeys.length || $pPropertyKeys.length,
116854 $noAdditional = $aProperties === false,
116855 $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length,
116856 $removeAdditional = it.opts.removeAdditional,
116857 $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional,
116858 $ownProperties = it.opts.ownProperties,
116859 $currentBaseId = it.baseId;
116860 var $required = it.schema.required;
116861 if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required);
116862 if (it.opts.patternGroups) {
116863 var $pgProperties = it.schema.patternGroups || {},
116864 $pgPropertyKeys = Object.keys($pgProperties);
116865 }
116866 out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;';
116867 if ($ownProperties) {
116868 out += ' var ' + ($dataProperties) + ' = undefined;';
116869 }
116870 if ($checkAdditional) {
116871 if ($ownProperties) {
116872 out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
116873 } else {
116874 out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
116875 }
116876 if ($someProperties) {
116877 out += ' var isAdditional' + ($lvl) + ' = !(false ';
116878 if ($schemaKeys.length) {
116879 if ($schemaKeys.length > 5) {
116880 out += ' || validate.schema' + ($schemaPath) + '[' + ($key) + '] ';
116881 } else {
116882 var arr1 = $schemaKeys;
116883 if (arr1) {
116884 var $propertyKey, i1 = -1,
116885 l1 = arr1.length - 1;
116886 while (i1 < l1) {
116887 $propertyKey = arr1[i1 += 1];
116888 out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' ';
116889 }
116890 }
116891 }
116892 }
116893 if ($pPropertyKeys.length) {
116894 var arr2 = $pPropertyKeys;
116895 if (arr2) {
116896 var $pProperty, $i = -1,
116897 l2 = arr2.length - 1;
116898 while ($i < l2) {
116899 $pProperty = arr2[$i += 1];
116900 out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') ';
116901 }
116902 }
116903 }
116904 if (it.opts.patternGroups && $pgPropertyKeys.length) {
116905 var arr3 = $pgPropertyKeys;
116906 if (arr3) {
116907 var $pgProperty, $i = -1,
116908 l3 = arr3.length - 1;
116909 while ($i < l3) {
116910 $pgProperty = arr3[$i += 1];
116911 out += ' || ' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ') ';
116912 }
116913 }
116914 }
116915 out += ' ); if (isAdditional' + ($lvl) + ') { ';
116916 }
116917 if ($removeAdditional == 'all') {
116918 out += ' delete ' + ($data) + '[' + ($key) + ']; ';
116919 } else {
116920 var $currentErrorPath = it.errorPath;
116921 var $additionalProperty = '\' + ' + $key + ' + \'';
116922 if (it.opts._errorDataPathProperty) {
116923 it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
116924 }
116925 if ($noAdditional) {
116926 if ($removeAdditional) {
116927 out += ' delete ' + ($data) + '[' + ($key) + ']; ';
116928 } else {
116929 out += ' ' + ($nextValid) + ' = false; ';
116930 var $currErrSchemaPath = $errSchemaPath;
116931 $errSchemaPath = it.errSchemaPath + '/additionalProperties';
116932 var $$outStack = $$outStack || [];
116933 $$outStack.push(out);
116934 out = ''; /* istanbul ignore else */
116935 if (it.createErrors !== false) {
116936 out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } ';
116937 if (it.opts.messages !== false) {
116938 out += ' , message: \'should NOT have additional properties\' ';
116939 }
116940 if (it.opts.verbose) {
116941 out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
116942 }
116943 out += ' } ';
116944 } else {
116945 out += ' {} ';
116946 }
116947 var __err = out;
116948 out = $$outStack.pop();
116949 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
116950 if (it.async) {
116951 out += ' throw new ValidationError([' + (__err) + ']); ';
116952 } else {
116953 out += ' validate.errors = [' + (__err) + ']; return false; ';
116954 }
116955 } else {
116956 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
116957 }
116958 $errSchemaPath = $currErrSchemaPath;
116959 if ($breakOnError) {
116960 out += ' break; ';
116961 }
116962 }
116963 } else if ($additionalIsSchema) {
116964 if ($removeAdditional == 'failing') {
116965 out += ' var ' + ($errs) + ' = errors; ';
116966 var $wasComposite = it.compositeRule;
116967 it.compositeRule = $it.compositeRule = true;
116968 $it.schema = $aProperties;
116969 $it.schemaPath = it.schemaPath + '.additionalProperties';
116970 $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
116971 $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
116972 var $passData = $data + '[' + $key + ']';
116973 $it.dataPathArr[$dataNxt] = $key;
116974 var $code = it.validate($it);
116975 $it.baseId = $currentBaseId;
116976 if (it.util.varOccurences($code, $nextData) < 2) {
116977 out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
116978 } else {
116979 out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
116980 }
116981 out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } ';
116982 it.compositeRule = $it.compositeRule = $wasComposite;
116983 } else {
116984 $it.schema = $aProperties;
116985 $it.schemaPath = it.schemaPath + '.additionalProperties';
116986 $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
116987 $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
116988 var $passData = $data + '[' + $key + ']';
116989 $it.dataPathArr[$dataNxt] = $key;
116990 var $code = it.validate($it);
116991 $it.baseId = $currentBaseId;
116992 if (it.util.varOccurences($code, $nextData) < 2) {
116993 out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
116994 } else {
116995 out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
116996 }
116997 if ($breakOnError) {
116998 out += ' if (!' + ($nextValid) + ') break; ';
116999 }
117000 }
117001 }
117002 it.errorPath = $currentErrorPath;
117003 }
117004 if ($someProperties) {
117005 out += ' } ';
117006 }
117007 out += ' } ';
117008 if ($breakOnError) {
117009 out += ' if (' + ($nextValid) + ') { ';
117010 $closingBraces += '}';
117011 }
117012 }
117013 var $useDefaults = it.opts.useDefaults && !it.compositeRule;
117014 if ($schemaKeys.length) {
117015 var arr4 = $schemaKeys;
117016 if (arr4) {
117017 var $propertyKey, i4 = -1,
117018 l4 = arr4.length - 1;
117019 while (i4 < l4) {
117020 $propertyKey = arr4[i4 += 1];
117021 var $sch = $schema[$propertyKey];
117022 if (it.util.schemaHasRules($sch, it.RULES.all)) {
117023 var $prop = it.util.getProperty($propertyKey),
117024 $passData = $data + $prop,
117025 $hasDefault = $useDefaults && $sch.default !== undefined;
117026 $it.schema = $sch;
117027 $it.schemaPath = $schemaPath + $prop;
117028 $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);
117029 $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);
117030 $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);
117031 var $code = it.validate($it);
117032 $it.baseId = $currentBaseId;
117033 if (it.util.varOccurences($code, $nextData) < 2) {
117034 $code = it.util.varReplace($code, $nextData, $passData);
117035 var $useData = $passData;
117036 } else {
117037 var $useData = $nextData;
117038 out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ';
117039 }
117040 if ($hasDefault) {
117041 out += ' ' + ($code) + ' ';
117042 } else {
117043 if ($requiredHash && $requiredHash[$propertyKey]) {
117044 out += ' if ( ' + ($useData) + ' === undefined ';
117045 if ($ownProperties) {
117046 out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
117047 }
117048 out += ') { ' + ($nextValid) + ' = false; ';
117049 var $currentErrorPath = it.errorPath,
117050 $currErrSchemaPath = $errSchemaPath,
117051 $missingProperty = it.util.escapeQuotes($propertyKey);
117052 if (it.opts._errorDataPathProperty) {
117053 it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
117054 }
117055 $errSchemaPath = it.errSchemaPath + '/required';
117056 var $$outStack = $$outStack || [];
117057 $$outStack.push(out);
117058 out = ''; /* istanbul ignore else */
117059 if (it.createErrors !== false) {
117060 out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
117061 if (it.opts.messages !== false) {
117062 out += ' , message: \'';
117063 if (it.opts._errorDataPathProperty) {
117064 out += 'is a required property';
117065 } else {
117066 out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
117067 }
117068 out += '\' ';
117069 }
117070 if (it.opts.verbose) {
117071 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
117072 }
117073 out += ' } ';
117074 } else {
117075 out += ' {} ';
117076 }
117077 var __err = out;
117078 out = $$outStack.pop();
117079 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
117080 if (it.async) {
117081 out += ' throw new ValidationError([' + (__err) + ']); ';
117082 } else {
117083 out += ' validate.errors = [' + (__err) + ']; return false; ';
117084 }
117085 } else {
117086 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
117087 }
117088 $errSchemaPath = $currErrSchemaPath;
117089 it.errorPath = $currentErrorPath;
117090 out += ' } else { ';
117091 } else {
117092 if ($breakOnError) {
117093 out += ' if ( ' + ($useData) + ' === undefined ';
117094 if ($ownProperties) {
117095 out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
117096 }
117097 out += ') { ' + ($nextValid) + ' = true; } else { ';
117098 } else {
117099 out += ' if (' + ($useData) + ' !== undefined ';
117100 if ($ownProperties) {
117101 out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
117102 }
117103 out += ' ) { ';
117104 }
117105 }
117106 out += ' ' + ($code) + ' } ';
117107 }
117108 }
117109 if ($breakOnError) {
117110 out += ' if (' + ($nextValid) + ') { ';
117111 $closingBraces += '}';
117112 }
117113 }
117114 }
117115 }
117116 if ($pPropertyKeys.length) {
117117 var arr5 = $pPropertyKeys;
117118 if (arr5) {
117119 var $pProperty, i5 = -1,
117120 l5 = arr5.length - 1;
117121 while (i5 < l5) {
117122 $pProperty = arr5[i5 += 1];
117123 var $sch = $pProperties[$pProperty];
117124 if (it.util.schemaHasRules($sch, it.RULES.all)) {
117125 $it.schema = $sch;
117126 $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);
117127 $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty);
117128 if ($ownProperties) {
117129 out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
117130 } else {
117131 out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
117132 }
117133 out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { ';
117134 $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
117135 var $passData = $data + '[' + $key + ']';
117136 $it.dataPathArr[$dataNxt] = $key;
117137 var $code = it.validate($it);
117138 $it.baseId = $currentBaseId;
117139 if (it.util.varOccurences($code, $nextData) < 2) {
117140 out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
117141 } else {
117142 out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
117143 }
117144 if ($breakOnError) {
117145 out += ' if (!' + ($nextValid) + ') break; ';
117146 }
117147 out += ' } ';
117148 if ($breakOnError) {
117149 out += ' else ' + ($nextValid) + ' = true; ';
117150 }
117151 out += ' } ';
117152 if ($breakOnError) {
117153 out += ' if (' + ($nextValid) + ') { ';
117154 $closingBraces += '}';
117155 }
117156 }
117157 }
117158 }
117159 }
117160 if (it.opts.patternGroups && $pgPropertyKeys.length) {
117161 var arr6 = $pgPropertyKeys;
117162 if (arr6) {
117163 var $pgProperty, i6 = -1,
117164 l6 = arr6.length - 1;
117165 while (i6 < l6) {
117166 $pgProperty = arr6[i6 += 1];
117167 var $pgSchema = $pgProperties[$pgProperty],
117168 $sch = $pgSchema.schema;
117169 if (it.util.schemaHasRules($sch, it.RULES.all)) {
117170 $it.schema = $sch;
117171 $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema';
117172 $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + it.util.escapeFragment($pgProperty) + '/schema';
117173 out += ' var pgPropCount' + ($lvl) + ' = 0; ';
117174 if ($ownProperties) {
117175 out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
117176 } else {
117177 out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
117178 }
117179 out += ' if (' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ')) { pgPropCount' + ($lvl) + '++; ';
117180 $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
117181 var $passData = $data + '[' + $key + ']';
117182 $it.dataPathArr[$dataNxt] = $key;
117183 var $code = it.validate($it);
117184 $it.baseId = $currentBaseId;
117185 if (it.util.varOccurences($code, $nextData) < 2) {
117186 out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
117187 } else {
117188 out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
117189 }
117190 if ($breakOnError) {
117191 out += ' if (!' + ($nextValid) + ') break; ';
117192 }
117193 out += ' } ';
117194 if ($breakOnError) {
117195 out += ' else ' + ($nextValid) + ' = true; ';
117196 }
117197 out += ' } ';
117198 if ($breakOnError) {
117199 out += ' if (' + ($nextValid) + ') { ';
117200 $closingBraces += '}';
117201 }
117202 var $pgMin = $pgSchema.minimum,
117203 $pgMax = $pgSchema.maximum;
117204 if ($pgMin !== undefined || $pgMax !== undefined) {
117205 out += ' var ' + ($valid) + ' = true; ';
117206 var $currErrSchemaPath = $errSchemaPath;
117207 if ($pgMin !== undefined) {
117208 var $limit = $pgMin,
117209 $reason = 'minimum',
117210 $moreOrLess = 'less';
117211 out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' >= ' + ($pgMin) + '; ';
117212 $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum';
117213 out += ' if (!' + ($valid) + ') { ';
117214 var $$outStack = $$outStack || [];
117215 $$outStack.push(out);
117216 out = ''; /* istanbul ignore else */
117217 if (it.createErrors !== false) {
117218 out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } ';
117219 if (it.opts.messages !== false) {
117220 out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' ';
117221 }
117222 if (it.opts.verbose) {
117223 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
117224 }
117225 out += ' } ';
117226 } else {
117227 out += ' {} ';
117228 }
117229 var __err = out;
117230 out = $$outStack.pop();
117231 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
117232 if (it.async) {
117233 out += ' throw new ValidationError([' + (__err) + ']); ';
117234 } else {
117235 out += ' validate.errors = [' + (__err) + ']; return false; ';
117236 }
117237 } else {
117238 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
117239 }
117240 out += ' } ';
117241 if ($pgMax !== undefined) {
117242 out += ' else ';
117243 }
117244 }
117245 if ($pgMax !== undefined) {
117246 var $limit = $pgMax,
117247 $reason = 'maximum',
117248 $moreOrLess = 'more';
117249 out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' <= ' + ($pgMax) + '; ';
117250 $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum';
117251 out += ' if (!' + ($valid) + ') { ';
117252 var $$outStack = $$outStack || [];
117253 $$outStack.push(out);
117254 out = ''; /* istanbul ignore else */
117255 if (it.createErrors !== false) {
117256 out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } ';
117257 if (it.opts.messages !== false) {
117258 out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' ';
117259 }
117260 if (it.opts.verbose) {
117261 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
117262 }
117263 out += ' } ';
117264 } else {
117265 out += ' {} ';
117266 }
117267 var __err = out;
117268 out = $$outStack.pop();
117269 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
117270 if (it.async) {
117271 out += ' throw new ValidationError([' + (__err) + ']); ';
117272 } else {
117273 out += ' validate.errors = [' + (__err) + ']; return false; ';
117274 }
117275 } else {
117276 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
117277 }
117278 out += ' } ';
117279 }
117280 $errSchemaPath = $currErrSchemaPath;
117281 if ($breakOnError) {
117282 out += ' if (' + ($valid) + ') { ';
117283 $closingBraces += '}';
117284 }
117285 }
117286 }
117287 }
117288 }
117289 }
117290 if ($breakOnError) {
117291 out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
117292 }
117293 out = it.util.cleanUpCode(out);
117294 return out;
117295}
117296
117297
117298/***/ }),
117299/* 727 */
117300/***/ (function(module, exports, __webpack_require__) {
117301
117302"use strict";
117303
117304module.exports = function generate_propertyNames(it, $keyword, $ruleType) {
117305 var out = ' ';
117306 var $lvl = it.level;
117307 var $dataLvl = it.dataLevel;
117308 var $schema = it.schema[$keyword];
117309 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
117310 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
117311 var $breakOnError = !it.opts.allErrors;
117312 var $data = 'data' + ($dataLvl || '');
117313 var $errs = 'errs__' + $lvl;
117314 var $it = it.util.copy(it);
117315 var $closingBraces = '';
117316 $it.level++;
117317 var $nextValid = 'valid' + $it.level;
117318 if (it.util.schemaHasRules($schema, it.RULES.all)) {
117319 $it.schema = $schema;
117320 $it.schemaPath = $schemaPath;
117321 $it.errSchemaPath = $errSchemaPath;
117322 var $key = 'key' + $lvl,
117323 $idx = 'idx' + $lvl,
117324 $i = 'i' + $lvl,
117325 $invalidName = '\' + ' + $key + ' + \'',
117326 $dataNxt = $it.dataLevel = it.dataLevel + 1,
117327 $nextData = 'data' + $dataNxt,
117328 $dataProperties = 'dataProperties' + $lvl,
117329 $ownProperties = it.opts.ownProperties,
117330 $currentBaseId = it.baseId;
117331 out += ' var ' + ($errs) + ' = errors; ';
117332 if ($ownProperties) {
117333 out += ' var ' + ($dataProperties) + ' = undefined; ';
117334 }
117335 if ($ownProperties) {
117336 out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
117337 } else {
117338 out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
117339 }
117340 out += ' var startErrs' + ($lvl) + ' = errors; ';
117341 var $passData = $key;
117342 var $wasComposite = it.compositeRule;
117343 it.compositeRule = $it.compositeRule = true;
117344 var $code = it.validate($it);
117345 $it.baseId = $currentBaseId;
117346 if (it.util.varOccurences($code, $nextData) < 2) {
117347 out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
117348 } else {
117349 out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
117350 }
117351 it.compositeRule = $it.compositeRule = $wasComposite;
117352 out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + '<errors; ' + ($i) + '++) { vErrors[' + ($i) + '].propertyName = ' + ($key) + '; } var err = '; /* istanbul ignore else */
117353 if (it.createErrors !== false) {
117354 out += ' { keyword: \'' + ('propertyNames') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { propertyName: \'' + ($invalidName) + '\' } ';
117355 if (it.opts.messages !== false) {
117356 out += ' , message: \'property name \\\'' + ($invalidName) + '\\\' is invalid\' ';
117357 }
117358 if (it.opts.verbose) {
117359 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
117360 }
117361 out += ' } ';
117362 } else {
117363 out += ' {} ';
117364 }
117365 out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
117366 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
117367 if (it.async) {
117368 out += ' throw new ValidationError(vErrors); ';
117369 } else {
117370 out += ' validate.errors = vErrors; return false; ';
117371 }
117372 }
117373 if ($breakOnError) {
117374 out += ' break; ';
117375 }
117376 out += ' } }';
117377 }
117378 if ($breakOnError) {
117379 out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
117380 }
117381 out = it.util.cleanUpCode(out);
117382 return out;
117383}
117384
117385
117386/***/ }),
117387/* 728 */
117388/***/ (function(module, exports, __webpack_require__) {
117389
117390"use strict";
117391
117392module.exports = function generate_ref(it, $keyword, $ruleType) {
117393 var out = ' ';
117394 var $lvl = it.level;
117395 var $dataLvl = it.dataLevel;
117396 var $schema = it.schema[$keyword];
117397 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
117398 var $breakOnError = !it.opts.allErrors;
117399 var $data = 'data' + ($dataLvl || '');
117400 var $valid = 'valid' + $lvl;
117401 var $async, $refCode;
117402 if ($schema == '#' || $schema == '#/') {
117403 if (it.isRoot) {
117404 $async = it.async;
117405 $refCode = 'validate';
117406 } else {
117407 $async = it.root.schema.$async === true;
117408 $refCode = 'root.refVal[0]';
117409 }
117410 } else {
117411 var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot);
117412 if ($refVal === undefined) {
117413 var $message = it.MissingRefError.message(it.baseId, $schema);
117414 if (it.opts.missingRefs == 'fail') {
117415 it.logger.error($message);
117416 var $$outStack = $$outStack || [];
117417 $$outStack.push(out);
117418 out = ''; /* istanbul ignore else */
117419 if (it.createErrors !== false) {
117420 out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } ';
117421 if (it.opts.messages !== false) {
117422 out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' ';
117423 }
117424 if (it.opts.verbose) {
117425 out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
117426 }
117427 out += ' } ';
117428 } else {
117429 out += ' {} ';
117430 }
117431 var __err = out;
117432 out = $$outStack.pop();
117433 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
117434 if (it.async) {
117435 out += ' throw new ValidationError([' + (__err) + ']); ';
117436 } else {
117437 out += ' validate.errors = [' + (__err) + ']; return false; ';
117438 }
117439 } else {
117440 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
117441 }
117442 if ($breakOnError) {
117443 out += ' if (false) { ';
117444 }
117445 } else if (it.opts.missingRefs == 'ignore') {
117446 it.logger.warn($message);
117447 if ($breakOnError) {
117448 out += ' if (true) { ';
117449 }
117450 } else {
117451 throw new it.MissingRefError(it.baseId, $schema, $message);
117452 }
117453 } else if ($refVal.inline) {
117454 var $it = it.util.copy(it);
117455 $it.level++;
117456 var $nextValid = 'valid' + $it.level;
117457 $it.schema = $refVal.schema;
117458 $it.schemaPath = '';
117459 $it.errSchemaPath = $schema;
117460 var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code);
117461 out += ' ' + ($code) + ' ';
117462 if ($breakOnError) {
117463 out += ' if (' + ($nextValid) + ') { ';
117464 }
117465 } else {
117466 $async = $refVal.$async === true;
117467 $refCode = $refVal.code;
117468 }
117469 }
117470 if ($refCode) {
117471 var $$outStack = $$outStack || [];
117472 $$outStack.push(out);
117473 out = '';
117474 if (it.opts.passContext) {
117475 out += ' ' + ($refCode) + '.call(this, ';
117476 } else {
117477 out += ' ' + ($refCode) + '( ';
117478 }
117479 out += ' ' + ($data) + ', (dataPath || \'\')';
117480 if (it.errorPath != '""') {
117481 out += ' + ' + (it.errorPath);
117482 }
117483 var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
117484 $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
117485 out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) ';
117486 var __callValidate = out;
117487 out = $$outStack.pop();
117488 if ($async) {
117489 if (!it.async) throw new Error('async schema referenced by sync schema');
117490 if ($breakOnError) {
117491 out += ' var ' + ($valid) + '; ';
117492 }
117493 out += ' try { ' + (it.yieldAwait) + ' ' + (__callValidate) + '; ';
117494 if ($breakOnError) {
117495 out += ' ' + ($valid) + ' = true; ';
117496 }
117497 out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ';
117498 if ($breakOnError) {
117499 out += ' ' + ($valid) + ' = false; ';
117500 }
117501 out += ' } ';
117502 if ($breakOnError) {
117503 out += ' if (' + ($valid) + ') { ';
117504 }
117505 } else {
117506 out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } ';
117507 if ($breakOnError) {
117508 out += ' else { ';
117509 }
117510 }
117511 }
117512 return out;
117513}
117514
117515
117516/***/ }),
117517/* 729 */
117518/***/ (function(module, exports, __webpack_require__) {
117519
117520"use strict";
117521
117522module.exports = function generate_required(it, $keyword, $ruleType) {
117523 var out = ' ';
117524 var $lvl = it.level;
117525 var $dataLvl = it.dataLevel;
117526 var $schema = it.schema[$keyword];
117527 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
117528 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
117529 var $breakOnError = !it.opts.allErrors;
117530 var $data = 'data' + ($dataLvl || '');
117531 var $valid = 'valid' + $lvl;
117532 var $isData = it.opts.$data && $schema && $schema.$data,
117533 $schemaValue;
117534 if ($isData) {
117535 out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
117536 $schemaValue = 'schema' + $lvl;
117537 } else {
117538 $schemaValue = $schema;
117539 }
117540 var $vSchema = 'schema' + $lvl;
117541 if (!$isData) {
117542 if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) {
117543 var $required = [];
117544 var arr1 = $schema;
117545 if (arr1) {
117546 var $property, i1 = -1,
117547 l1 = arr1.length - 1;
117548 while (i1 < l1) {
117549 $property = arr1[i1 += 1];
117550 var $propertySch = it.schema.properties[$property];
117551 if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) {
117552 $required[$required.length] = $property;
117553 }
117554 }
117555 }
117556 } else {
117557 var $required = $schema;
117558 }
117559 }
117560 if ($isData || $required.length) {
117561 var $currentErrorPath = it.errorPath,
117562 $loopRequired = $isData || $required.length >= it.opts.loopRequired,
117563 $ownProperties = it.opts.ownProperties;
117564 if ($breakOnError) {
117565 out += ' var missing' + ($lvl) + '; ';
117566 if ($loopRequired) {
117567 if (!$isData) {
117568 out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
117569 }
117570 var $i = 'i' + $lvl,
117571 $propertyPath = 'schema' + $lvl + '[' + $i + ']',
117572 $missingProperty = '\' + ' + $propertyPath + ' + \'';
117573 if (it.opts._errorDataPathProperty) {
117574 it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
117575 }
117576 out += ' var ' + ($valid) + ' = true; ';
117577 if ($isData) {
117578 out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
117579 }
117580 out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined ';
117581 if ($ownProperties) {
117582 out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
117583 }
117584 out += '; if (!' + ($valid) + ') break; } ';
117585 if ($isData) {
117586 out += ' } ';
117587 }
117588 out += ' if (!' + ($valid) + ') { ';
117589 var $$outStack = $$outStack || [];
117590 $$outStack.push(out);
117591 out = ''; /* istanbul ignore else */
117592 if (it.createErrors !== false) {
117593 out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
117594 if (it.opts.messages !== false) {
117595 out += ' , message: \'';
117596 if (it.opts._errorDataPathProperty) {
117597 out += 'is a required property';
117598 } else {
117599 out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
117600 }
117601 out += '\' ';
117602 }
117603 if (it.opts.verbose) {
117604 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
117605 }
117606 out += ' } ';
117607 } else {
117608 out += ' {} ';
117609 }
117610 var __err = out;
117611 out = $$outStack.pop();
117612 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
117613 if (it.async) {
117614 out += ' throw new ValidationError([' + (__err) + ']); ';
117615 } else {
117616 out += ' validate.errors = [' + (__err) + ']; return false; ';
117617 }
117618 } else {
117619 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
117620 }
117621 out += ' } else { ';
117622 } else {
117623 out += ' if ( ';
117624 var arr2 = $required;
117625 if (arr2) {
117626 var $propertyKey, $i = -1,
117627 l2 = arr2.length - 1;
117628 while ($i < l2) {
117629 $propertyKey = arr2[$i += 1];
117630 if ($i) {
117631 out += ' || ';
117632 }
117633 var $prop = it.util.getProperty($propertyKey),
117634 $useData = $data + $prop;
117635 out += ' ( ( ' + ($useData) + ' === undefined ';
117636 if ($ownProperties) {
117637 out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
117638 }
117639 out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';
117640 }
117641 }
117642 out += ') { ';
117643 var $propertyPath = 'missing' + $lvl,
117644 $missingProperty = '\' + ' + $propertyPath + ' + \'';
117645 if (it.opts._errorDataPathProperty) {
117646 it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;
117647 }
117648 var $$outStack = $$outStack || [];
117649 $$outStack.push(out);
117650 out = ''; /* istanbul ignore else */
117651 if (it.createErrors !== false) {
117652 out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
117653 if (it.opts.messages !== false) {
117654 out += ' , message: \'';
117655 if (it.opts._errorDataPathProperty) {
117656 out += 'is a required property';
117657 } else {
117658 out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
117659 }
117660 out += '\' ';
117661 }
117662 if (it.opts.verbose) {
117663 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
117664 }
117665 out += ' } ';
117666 } else {
117667 out += ' {} ';
117668 }
117669 var __err = out;
117670 out = $$outStack.pop();
117671 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
117672 if (it.async) {
117673 out += ' throw new ValidationError([' + (__err) + ']); ';
117674 } else {
117675 out += ' validate.errors = [' + (__err) + ']; return false; ';
117676 }
117677 } else {
117678 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
117679 }
117680 out += ' } else { ';
117681 }
117682 } else {
117683 if ($loopRequired) {
117684 if (!$isData) {
117685 out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
117686 }
117687 var $i = 'i' + $lvl,
117688 $propertyPath = 'schema' + $lvl + '[' + $i + ']',
117689 $missingProperty = '\' + ' + $propertyPath + ' + \'';
117690 if (it.opts._errorDataPathProperty) {
117691 it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
117692 }
117693 if ($isData) {
117694 out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */
117695 if (it.createErrors !== false) {
117696 out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
117697 if (it.opts.messages !== false) {
117698 out += ' , message: \'';
117699 if (it.opts._errorDataPathProperty) {
117700 out += 'is a required property';
117701 } else {
117702 out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
117703 }
117704 out += '\' ';
117705 }
117706 if (it.opts.verbose) {
117707 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
117708 }
117709 out += ' } ';
117710 } else {
117711 out += ' {} ';
117712 }
117713 out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { ';
117714 }
117715 out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined ';
117716 if ($ownProperties) {
117717 out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
117718 }
117719 out += ') { var err = '; /* istanbul ignore else */
117720 if (it.createErrors !== false) {
117721 out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
117722 if (it.opts.messages !== false) {
117723 out += ' , message: \'';
117724 if (it.opts._errorDataPathProperty) {
117725 out += 'is a required property';
117726 } else {
117727 out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
117728 }
117729 out += '\' ';
117730 }
117731 if (it.opts.verbose) {
117732 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
117733 }
117734 out += ' } ';
117735 } else {
117736 out += ' {} ';
117737 }
117738 out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ';
117739 if ($isData) {
117740 out += ' } ';
117741 }
117742 } else {
117743 var arr3 = $required;
117744 if (arr3) {
117745 var $propertyKey, i3 = -1,
117746 l3 = arr3.length - 1;
117747 while (i3 < l3) {
117748 $propertyKey = arr3[i3 += 1];
117749 var $prop = it.util.getProperty($propertyKey),
117750 $missingProperty = it.util.escapeQuotes($propertyKey),
117751 $useData = $data + $prop;
117752 if (it.opts._errorDataPathProperty) {
117753 it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
117754 }
117755 out += ' if ( ' + ($useData) + ' === undefined ';
117756 if ($ownProperties) {
117757 out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
117758 }
117759 out += ') { var err = '; /* istanbul ignore else */
117760 if (it.createErrors !== false) {
117761 out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
117762 if (it.opts.messages !== false) {
117763 out += ' , message: \'';
117764 if (it.opts._errorDataPathProperty) {
117765 out += 'is a required property';
117766 } else {
117767 out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
117768 }
117769 out += '\' ';
117770 }
117771 if (it.opts.verbose) {
117772 out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
117773 }
117774 out += ' } ';
117775 } else {
117776 out += ' {} ';
117777 }
117778 out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';
117779 }
117780 }
117781 }
117782 }
117783 it.errorPath = $currentErrorPath;
117784 } else if ($breakOnError) {
117785 out += ' if (true) {';
117786 }
117787 return out;
117788}
117789
117790
117791/***/ }),
117792/* 730 */
117793/***/ (function(module, exports, __webpack_require__) {
117794
117795"use strict";
117796
117797module.exports = function generate_uniqueItems(it, $keyword, $ruleType) {
117798 var out = ' ';
117799 var $lvl = it.level;
117800 var $dataLvl = it.dataLevel;
117801 var $schema = it.schema[$keyword];
117802 var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
117803 var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
117804 var $breakOnError = !it.opts.allErrors;
117805 var $data = 'data' + ($dataLvl || '');
117806 var $valid = 'valid' + $lvl;
117807 var $isData = it.opts.$data && $schema && $schema.$data,
117808 $schemaValue;
117809 if ($isData) {
117810 out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
117811 $schemaValue = 'schema' + $lvl;
117812 } else {
117813 $schemaValue = $schema;
117814 }
117815 if (($schema || $isData) && it.opts.uniqueItems !== false) {
117816 if ($isData) {
117817 out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { ';
117818 }
117819 out += ' var ' + ($valid) + ' = true; if (' + ($data) + '.length > 1) { var i = ' + ($data) + '.length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } } ';
117820 if ($isData) {
117821 out += ' } ';
117822 }
117823 out += ' if (!' + ($valid) + ') { ';
117824 var $$outStack = $$outStack || [];
117825 $$outStack.push(out);
117826 out = ''; /* istanbul ignore else */
117827 if (it.createErrors !== false) {
117828 out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } ';
117829 if (it.opts.messages !== false) {
117830 out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' ';
117831 }
117832 if (it.opts.verbose) {
117833 out += ' , schema: ';
117834 if ($isData) {
117835 out += 'validate.schema' + ($schemaPath);
117836 } else {
117837 out += '' + ($schema);
117838 }
117839 out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
117840 }
117841 out += ' } ';
117842 } else {
117843 out += ' {} ';
117844 }
117845 var __err = out;
117846 out = $$outStack.pop();
117847 if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
117848 if (it.async) {
117849 out += ' throw new ValidationError([' + (__err) + ']); ';
117850 } else {
117851 out += ' validate.errors = [' + (__err) + ']; return false; ';
117852 }
117853 } else {
117854 out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
117855 }
117856 out += ' } ';
117857 if ($breakOnError) {
117858 out += ' else { ';
117859 }
117860 } else {
117861 if ($breakOnError) {
117862 out += ' if (true) { ';
117863 }
117864 }
117865 return out;
117866}
117867
117868
117869/***/ }),
117870/* 731 */
117871/***/ (function(module, exports, __webpack_require__) {
117872
117873"use strict";
117874
117875
117876var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i;
117877var customRuleCode = __webpack_require__(717);
117878
117879module.exports = {
117880 add: addKeyword,
117881 get: getKeyword,
117882 remove: removeKeyword
117883};
117884
117885/**
117886 * Define custom keyword
117887 * @this Ajv
117888 * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords).
117889 * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.
117890 * @return {Ajv} this for method chaining
117891 */
117892function addKeyword(keyword, definition) {
117893 /* jshint validthis: true */
117894 /* eslint no-shadow: 0 */
117895 var RULES = this.RULES;
117896
117897 if (RULES.keywords[keyword])
117898 throw new Error('Keyword ' + keyword + ' is already defined');
117899
117900 if (!IDENTIFIER.test(keyword))
117901 throw new Error('Keyword ' + keyword + ' is not a valid identifier');
117902
117903 if (definition) {
117904 if (definition.macro && definition.valid !== undefined)
117905 throw new Error('"valid" option cannot be used with macro keywords');
117906
117907 var dataType = definition.type;
117908 if (Array.isArray(dataType)) {
117909 var i, len = dataType.length;
117910 for (i=0; i<len; i++) checkDataType(dataType[i]);
117911 for (i=0; i<len; i++) _addRule(keyword, dataType[i], definition);
117912 } else {
117913 if (dataType) checkDataType(dataType);
117914 _addRule(keyword, dataType, definition);
117915 }
117916
117917 var $data = definition.$data === true && this._opts.$data;
117918 if ($data && !definition.validate)
117919 throw new Error('$data support: "validate" function is not defined');
117920
117921 var metaSchema = definition.metaSchema;
117922 if (metaSchema) {
117923 if ($data) {
117924 metaSchema = {
117925 anyOf: [
117926 metaSchema,
117927 { '$ref': 'https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/$data.json#' }
117928 ]
117929 };
117930 }
117931 definition.validateSchema = this.compile(metaSchema, true);
117932 }
117933 }
117934
117935 RULES.keywords[keyword] = RULES.all[keyword] = true;
117936
117937
117938 function _addRule(keyword, dataType, definition) {
117939 var ruleGroup;
117940 for (var i=0; i<RULES.length; i++) {
117941 var rg = RULES[i];
117942 if (rg.type == dataType) {
117943 ruleGroup = rg;
117944 break;
117945 }
117946 }
117947
117948 if (!ruleGroup) {
117949 ruleGroup = { type: dataType, rules: [] };
117950 RULES.push(ruleGroup);
117951 }
117952
117953 var rule = {
117954 keyword: keyword,
117955 definition: definition,
117956 custom: true,
117957 code: customRuleCode,
117958 implements: definition.implements
117959 };
117960 ruleGroup.rules.push(rule);
117961 RULES.custom[keyword] = rule;
117962 }
117963
117964
117965 function checkDataType(dataType) {
117966 if (!RULES.types[dataType]) throw new Error('Unknown type ' + dataType);
117967 }
117968
117969 return this;
117970}
117971
117972
117973/**
117974 * Get keyword
117975 * @this Ajv
117976 * @param {String} keyword pre-defined or custom keyword.
117977 * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise.
117978 */
117979function getKeyword(keyword) {
117980 /* jshint validthis: true */
117981 var rule = this.RULES.custom[keyword];
117982 return rule ? rule.definition : this.RULES.keywords[keyword] || false;
117983}
117984
117985
117986/**
117987 * Remove keyword
117988 * @this Ajv
117989 * @param {String} keyword pre-defined or custom keyword.
117990 * @return {Ajv} this for method chaining
117991 */
117992function removeKeyword(keyword) {
117993 /* jshint validthis: true */
117994 var RULES = this.RULES;
117995 delete RULES.keywords[keyword];
117996 delete RULES.all[keyword];
117997 delete RULES.custom[keyword];
117998 for (var i=0; i<RULES.length; i++) {
117999 var rules = RULES[i].rules;
118000 for (var j=0; j<rules.length; j++) {
118001 if (rules[j].keyword == keyword) {
118002 rules.splice(j, 1);
118003 break;
118004 }
118005 }
118006 }
118007 return this;
118008}
118009
118010
118011/***/ }),
118012/* 732 */
118013/***/ (function(module, exports, __webpack_require__) {
118014
118015"use strict";
118016
118017
118018var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema';
118019
118020module.exports = function (ajv) {
118021 var defaultMeta = ajv._opts.defaultMeta;
118022 var metaSchemaRef = typeof defaultMeta == 'string'
118023 ? { $ref: defaultMeta }
118024 : ajv.getSchema(META_SCHEMA_ID)
118025 ? { $ref: META_SCHEMA_ID }
118026 : {};
118027
118028 ajv.addKeyword('patternGroups', {
118029 // implemented in properties.jst
118030 metaSchema: {
118031 type: 'object',
118032 additionalProperties: {
118033 type: 'object',
118034 required: [ 'schema' ],
118035 properties: {
118036 maximum: {
118037 type: 'integer',
118038 minimum: 0
118039 },
118040 minimum: {
118041 type: 'integer',
118042 minimum: 0
118043 },
118044 schema: metaSchemaRef
118045 },
118046 additionalProperties: false
118047 }
118048 }
118049 });
118050 ajv.RULES.all.properties.implements.push('patternGroups');
118051};
118052
118053
118054/***/ }),
118055/* 733 */
118056/***/ (function(module, exports) {
118057
118058module.exports = {"$schema":"http://json-schema.org/draft-06/schema#","$id":"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/$data.json#","description":"Meta-schema for $data reference (JSON-schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}
118059
118060/***/ }),
118061/* 734 */
118062/***/ (function(module, exports) {
118063
118064module.exports = {"$schema":"http://json-schema.org/draft-06/schema#","$id":"http://json-schema.org/draft-06/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"examples":{"type":"array","items":{}},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":{},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}}
118065
118066/***/ }),
118067/* 735 */
118068/***/ (function(module, exports, __webpack_require__) {
118069
118070"use strict";
118071
118072
118073var traverse = module.exports = function (schema, opts, cb) {
118074 if (typeof opts == 'function') {
118075 cb = opts;
118076 opts = {};
118077 }
118078 _traverse(opts, cb, schema, '', schema);
118079};
118080
118081
118082traverse.keywords = {
118083 additionalItems: true,
118084 items: true,
118085 contains: true,
118086 additionalProperties: true,
118087 propertyNames: true,
118088 not: true
118089};
118090
118091traverse.arrayKeywords = {
118092 items: true,
118093 allOf: true,
118094 anyOf: true,
118095 oneOf: true
118096};
118097
118098traverse.propsKeywords = {
118099 definitions: true,
118100 properties: true,
118101 patternProperties: true,
118102 dependencies: true
118103};
118104
118105traverse.skipKeywords = {
118106 enum: true,
118107 const: true,
118108 required: true,
118109 maximum: true,
118110 minimum: true,
118111 exclusiveMaximum: true,
118112 exclusiveMinimum: true,
118113 multipleOf: true,
118114 maxLength: true,
118115 minLength: true,
118116 pattern: true,
118117 format: true,
118118 maxItems: true,
118119 minItems: true,
118120 uniqueItems: true,
118121 maxProperties: true,
118122 minProperties: true
118123};
118124
118125
118126function _traverse(opts, cb, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
118127 if (schema && typeof schema == 'object' && !Array.isArray(schema)) {
118128 cb(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
118129 for (var key in schema) {
118130 var sch = schema[key];
118131 if (Array.isArray(sch)) {
118132 if (key in traverse.arrayKeywords) {
118133 for (var i=0; i<sch.length; i++)
118134 _traverse(opts, cb, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
118135 }
118136 } else if (key in traverse.propsKeywords) {
118137 if (sch && typeof sch == 'object') {
118138 for (var prop in sch)
118139 _traverse(opts, cb, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
118140 }
118141 } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
118142 _traverse(opts, cb, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
118143 }
118144 }
118145 }
118146}
118147
118148
118149function escapeJsonPtr(str) {
118150 return str.replace(/~/g, '~0').replace(/\//g, '~1');
118151}
118152
118153
118154/***/ }),
118155/* 736 */
118156/***/ (function(module, exports, __webpack_require__) {
118157
118158"use strict";
118159
118160module.exports = function (flag, argv) {
118161 argv = argv || process.argv;
118162
118163 var terminatorPos = argv.indexOf('--');
118164 var prefix = /^--/.test(flag) ? '' : '--';
118165 var pos = argv.indexOf(prefix + flag);
118166
118167 return pos !== -1 && (terminatorPos !== -1 ? pos < terminatorPos : true);
118168};
118169
118170
118171/***/ }),
118172/* 737 */
118173/***/ (function(module, exports) {
118174
118175function webpackEmptyContext(req) {
118176 throw new Error("Cannot find module '" + req + "'.");
118177}
118178webpackEmptyContext.keys = function() { return []; };
118179webpackEmptyContext.resolve = webpackEmptyContext;
118180module.exports = webpackEmptyContext;
118181webpackEmptyContext.id = 737;
118182
118183/***/ }),
118184/* 738 */
118185/***/ (function(module, exports, __webpack_require__) {
118186
118187"use strict";
118188
118189var pkg = __webpack_require__(739);
118190
118191/* @private
118192 *
118193 * constructs a set of all dependencies recursively
118194 *
118195 * @method depsFor
118196 * @param {String} name of package to assemble unique deps for
118197 * @param {String} dir (optional) path to begin resolving from
118198 * @return {Array} a unique set of all deps
118199 */
118200module.exports = function depsFor(name, dir) {
118201 var dependencies = [];
118202 var visited = Object.create(null);
118203
118204 (function again(name, dir) {
118205 var thePackage = pkg(name, dir);
118206
118207 if (thePackage === null) { return; }
118208
118209 var key = thePackage.name + thePackage.version + thePackage.baseDir;
118210
118211 if (visited[key]) { return; }
118212 visited[key] = true;
118213
118214 dependencies.push(thePackage);
118215
118216 return Object.keys(thePackage.dependencies || {}).forEach(function(dep) {
118217 again(dep, thePackage.baseDir);
118218 });
118219 }(name, dir));
118220
118221 return dependencies;
118222};
118223
118224
118225
118226/***/ }),
118227/* 739 */
118228/***/ (function(module, exports, __webpack_require__) {
118229
118230"use strict";
118231
118232
118233var resolvePkg = __webpack_require__(740);
118234
118235/* @private
118236 *
118237 * given the name of a descendent module this module locates and returns its
118238 * package.json. In addition, it provides the baseDir.
118239 *
118240 * @method pkg
118241 * @param {String} name
118242 * @param {String} dir (optional) root directory to begin resolution
118243 */
118244module.exports = function pkg(name, dir) {
118245 if (name !== './') { name += '/'; }
118246
118247 var packagePath = resolvePkg(name, dir);
118248 if (packagePath === null) { return null; }
118249
118250 var thePackage = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }());
118251
118252 thePackage.baseDir = packagePath.slice(0, packagePath.length - 12 /* index of `/package.json` */);
118253
118254 return thePackage;
118255};
118256
118257
118258/***/ }),
118259/* 740 */
118260/***/ (function(module, exports, __webpack_require__) {
118261
118262"use strict";
118263
118264var resolve = __webpack_require__(886);
118265var path = __webpack_require__(1);
118266
118267/* @private
118268 *
118269 * @method resolvePkg
118270 * @param {String} name
118271 * @param {String} dir
118272 * @return {String}
118273 */
118274module.exports = function resolvePkg(name, dir) {
118275 if (name === './') {
118276 return path.resolve(name, 'package.json');
118277 }
118278
118279 if (name[name.length - 1] !== '/') {
118280 name += '/';
118281 }
118282
118283 if (name.charAt(0) === '/') {
118284 return name + 'package.json';
118285 }
118286
118287 try {
118288 return resolve.sync(name + 'package.json', {
118289 basedir: dir || __dirname,
118290 preserveSymlinks: false
118291 });
118292 } catch(err) {
118293 if (err.code === 'MODULE_NOT_FOUND') {
118294 return null;
118295 }
118296
118297 throw err;
118298 }
118299};
118300
118301
118302/***/ }),
118303/* 741 */
118304/***/ (function(module, exports, __webpack_require__) {
118305
118306// Copyright 2015 Joyent, Inc.
118307
118308var parser = __webpack_require__(742);
118309var signer = __webpack_require__(743);
118310var verify = __webpack_require__(744);
118311var utils = __webpack_require__(165);
118312
118313
118314
118315///--- API
118316
118317module.exports = {
118318
118319 parse: parser.parseRequest,
118320 parseRequest: parser.parseRequest,
118321
118322 sign: signer.signRequest,
118323 signRequest: signer.signRequest,
118324 createSigner: signer.createSigner,
118325 isSigner: signer.isSigner,
118326
118327 sshKeyToPEM: utils.sshKeyToPEM,
118328 sshKeyFingerprint: utils.fingerprint,
118329 pemToRsaSSHKey: utils.pemToRsaSSHKey,
118330
118331 verify: verify.verifySignature,
118332 verifySignature: verify.verifySignature,
118333 verifyHMAC: verify.verifyHMAC
118334};
118335
118336
118337/***/ }),
118338/* 742 */
118339/***/ (function(module, exports, __webpack_require__) {
118340
118341// Copyright 2012 Joyent, Inc. All rights reserved.
118342
118343var assert = __webpack_require__(22);
118344var util = __webpack_require__(9);
118345var utils = __webpack_require__(165);
118346
118347
118348
118349///--- Globals
118350
118351var HASH_ALGOS = utils.HASH_ALGOS;
118352var PK_ALGOS = utils.PK_ALGOS;
118353var HttpSignatureError = utils.HttpSignatureError;
118354var InvalidAlgorithmError = utils.InvalidAlgorithmError;
118355var validateAlgorithm = utils.validateAlgorithm;
118356
118357var State = {
118358 New: 0,
118359 Params: 1
118360};
118361
118362var ParamsState = {
118363 Name: 0,
118364 Quote: 1,
118365 Value: 2,
118366 Comma: 3
118367};
118368
118369
118370///--- Specific Errors
118371
118372
118373function ExpiredRequestError(message) {
118374 HttpSignatureError.call(this, message, ExpiredRequestError);
118375}
118376util.inherits(ExpiredRequestError, HttpSignatureError);
118377
118378
118379function InvalidHeaderError(message) {
118380 HttpSignatureError.call(this, message, InvalidHeaderError);
118381}
118382util.inherits(InvalidHeaderError, HttpSignatureError);
118383
118384
118385function InvalidParamsError(message) {
118386 HttpSignatureError.call(this, message, InvalidParamsError);
118387}
118388util.inherits(InvalidParamsError, HttpSignatureError);
118389
118390
118391function MissingHeaderError(message) {
118392 HttpSignatureError.call(this, message, MissingHeaderError);
118393}
118394util.inherits(MissingHeaderError, HttpSignatureError);
118395
118396function StrictParsingError(message) {
118397 HttpSignatureError.call(this, message, StrictParsingError);
118398}
118399util.inherits(StrictParsingError, HttpSignatureError);
118400
118401///--- Exported API
118402
118403module.exports = {
118404
118405 /**
118406 * Parses the 'Authorization' header out of an http.ServerRequest object.
118407 *
118408 * Note that this API will fully validate the Authorization header, and throw
118409 * on any error. It will not however check the signature, or the keyId format
118410 * as those are specific to your environment. You can use the options object
118411 * to pass in extra constraints.
118412 *
118413 * As a response object you can expect this:
118414 *
118415 * {
118416 * "scheme": "Signature",
118417 * "params": {
118418 * "keyId": "foo",
118419 * "algorithm": "rsa-sha256",
118420 * "headers": [
118421 * "date" or "x-date",
118422 * "digest"
118423 * ],
118424 * "signature": "base64"
118425 * },
118426 * "signingString": "ready to be passed to crypto.verify()"
118427 * }
118428 *
118429 * @param {Object} request an http.ServerRequest.
118430 * @param {Object} options an optional options object with:
118431 * - clockSkew: allowed clock skew in seconds (default 300).
118432 * - headers: required header names (def: date or x-date)
118433 * - algorithms: algorithms to support (default: all).
118434 * - strict: should enforce latest spec parsing
118435 * (default: false).
118436 * @return {Object} parsed out object (see above).
118437 * @throws {TypeError} on invalid input.
118438 * @throws {InvalidHeaderError} on an invalid Authorization header error.
118439 * @throws {InvalidParamsError} if the params in the scheme are invalid.
118440 * @throws {MissingHeaderError} if the params indicate a header not present,
118441 * either in the request headers from the params,
118442 * or not in the params from a required header
118443 * in options.
118444 * @throws {StrictParsingError} if old attributes are used in strict parsing
118445 * mode.
118446 * @throws {ExpiredRequestError} if the value of date or x-date exceeds skew.
118447 */
118448 parseRequest: function parseRequest(request, options) {
118449 assert.object(request, 'request');
118450 assert.object(request.headers, 'request.headers');
118451 if (options === undefined) {
118452 options = {};
118453 }
118454 if (options.headers === undefined) {
118455 options.headers = [request.headers['x-date'] ? 'x-date' : 'date'];
118456 }
118457 assert.object(options, 'options');
118458 assert.arrayOfString(options.headers, 'options.headers');
118459 assert.optionalFinite(options.clockSkew, 'options.clockSkew');
118460
118461 var authzHeaderName = options.authorizationHeaderName || 'authorization';
118462
118463 if (!request.headers[authzHeaderName]) {
118464 throw new MissingHeaderError('no ' + authzHeaderName + ' header ' +
118465 'present in the request');
118466 }
118467
118468 options.clockSkew = options.clockSkew || 300;
118469
118470
118471 var i = 0;
118472 var state = State.New;
118473 var substate = ParamsState.Name;
118474 var tmpName = '';
118475 var tmpValue = '';
118476
118477 var parsed = {
118478 scheme: '',
118479 params: {},
118480 signingString: ''
118481 };
118482
118483 var authz = request.headers[authzHeaderName];
118484 for (i = 0; i < authz.length; i++) {
118485 var c = authz.charAt(i);
118486
118487 switch (Number(state)) {
118488
118489 case State.New:
118490 if (c !== ' ') parsed.scheme += c;
118491 else state = State.Params;
118492 break;
118493
118494 case State.Params:
118495 switch (Number(substate)) {
118496
118497 case ParamsState.Name:
118498 var code = c.charCodeAt(0);
118499 // restricted name of A-Z / a-z
118500 if ((code >= 0x41 && code <= 0x5a) || // A-Z
118501 (code >= 0x61 && code <= 0x7a)) { // a-z
118502 tmpName += c;
118503 } else if (c === '=') {
118504 if (tmpName.length === 0)
118505 throw new InvalidHeaderError('bad param format');
118506 substate = ParamsState.Quote;
118507 } else {
118508 throw new InvalidHeaderError('bad param format');
118509 }
118510 break;
118511
118512 case ParamsState.Quote:
118513 if (c === '"') {
118514 tmpValue = '';
118515 substate = ParamsState.Value;
118516 } else {
118517 throw new InvalidHeaderError('bad param format');
118518 }
118519 break;
118520
118521 case ParamsState.Value:
118522 if (c === '"') {
118523 parsed.params[tmpName] = tmpValue;
118524 substate = ParamsState.Comma;
118525 } else {
118526 tmpValue += c;
118527 }
118528 break;
118529
118530 case ParamsState.Comma:
118531 if (c === ',') {
118532 tmpName = '';
118533 substate = ParamsState.Name;
118534 } else {
118535 throw new InvalidHeaderError('bad param format');
118536 }
118537 break;
118538
118539 default:
118540 throw new Error('Invalid substate');
118541 }
118542 break;
118543
118544 default:
118545 throw new Error('Invalid substate');
118546 }
118547
118548 }
118549
118550 if (!parsed.params.headers || parsed.params.headers === '') {
118551 if (request.headers['x-date']) {
118552 parsed.params.headers = ['x-date'];
118553 } else {
118554 parsed.params.headers = ['date'];
118555 }
118556 } else {
118557 parsed.params.headers = parsed.params.headers.split(' ');
118558 }
118559
118560 // Minimally validate the parsed object
118561 if (!parsed.scheme || parsed.scheme !== 'Signature')
118562 throw new InvalidHeaderError('scheme was not "Signature"');
118563
118564 if (!parsed.params.keyId)
118565 throw new InvalidHeaderError('keyId was not specified');
118566
118567 if (!parsed.params.algorithm)
118568 throw new InvalidHeaderError('algorithm was not specified');
118569
118570 if (!parsed.params.signature)
118571 throw new InvalidHeaderError('signature was not specified');
118572
118573 // Check the algorithm against the official list
118574 parsed.params.algorithm = parsed.params.algorithm.toLowerCase();
118575 try {
118576 validateAlgorithm(parsed.params.algorithm);
118577 } catch (e) {
118578 if (e instanceof InvalidAlgorithmError)
118579 throw (new InvalidParamsError(parsed.params.algorithm + ' is not ' +
118580 'supported'));
118581 else
118582 throw (e);
118583 }
118584
118585 // Build the signingString
118586 for (i = 0; i < parsed.params.headers.length; i++) {
118587 var h = parsed.params.headers[i].toLowerCase();
118588 parsed.params.headers[i] = h;
118589
118590 if (h === 'request-line') {
118591 if (!options.strict) {
118592 /*
118593 * We allow headers from the older spec drafts if strict parsing isn't
118594 * specified in options.
118595 */
118596 parsed.signingString +=
118597 request.method + ' ' + request.url + ' HTTP/' + request.httpVersion;
118598 } else {
118599 /* Strict parsing doesn't allow older draft headers. */
118600 throw (new StrictParsingError('request-line is not a valid header ' +
118601 'with strict parsing enabled.'));
118602 }
118603 } else if (h === '(request-target)') {
118604 parsed.signingString +=
118605 '(request-target): ' + request.method.toLowerCase() + ' ' +
118606 request.url;
118607 } else {
118608 var value = request.headers[h];
118609 if (value === undefined)
118610 throw new MissingHeaderError(h + ' was not in the request');
118611 parsed.signingString += h + ': ' + value;
118612 }
118613
118614 if ((i + 1) < parsed.params.headers.length)
118615 parsed.signingString += '\n';
118616 }
118617
118618 // Check against the constraints
118619 var date;
118620 if (request.headers.date || request.headers['x-date']) {
118621 if (request.headers['x-date']) {
118622 date = new Date(request.headers['x-date']);
118623 } else {
118624 date = new Date(request.headers.date);
118625 }
118626 var now = new Date();
118627 var skew = Math.abs(now.getTime() - date.getTime());
118628
118629 if (skew > options.clockSkew * 1000) {
118630 throw new ExpiredRequestError('clock skew of ' +
118631 (skew / 1000) +
118632 's was greater than ' +
118633 options.clockSkew + 's');
118634 }
118635 }
118636
118637 options.headers.forEach(function (hdr) {
118638 // Remember that we already checked any headers in the params
118639 // were in the request, so if this passes we're good.
118640 if (parsed.params.headers.indexOf(hdr.toLowerCase()) < 0)
118641 throw new MissingHeaderError(hdr + ' was not a signed header');
118642 });
118643
118644 if (options.algorithms) {
118645 if (options.algorithms.indexOf(parsed.params.algorithm) === -1)
118646 throw new InvalidParamsError(parsed.params.algorithm +
118647 ' is not a supported algorithm');
118648 }
118649
118650 parsed.algorithm = parsed.params.algorithm.toUpperCase();
118651 parsed.keyId = parsed.params.keyId;
118652 return parsed;
118653 }
118654
118655};
118656
118657
118658/***/ }),
118659/* 743 */
118660/***/ (function(module, exports, __webpack_require__) {
118661
118662// Copyright 2012 Joyent, Inc. All rights reserved.
118663
118664var assert = __webpack_require__(22);
118665var crypto = __webpack_require__(21);
118666var http = __webpack_require__(83);
118667var util = __webpack_require__(9);
118668var sshpk = __webpack_require__(268);
118669var jsprim = __webpack_require__(817);
118670var utils = __webpack_require__(165);
118671
118672var sprintf = __webpack_require__(9).format;
118673
118674var HASH_ALGOS = utils.HASH_ALGOS;
118675var PK_ALGOS = utils.PK_ALGOS;
118676var InvalidAlgorithmError = utils.InvalidAlgorithmError;
118677var HttpSignatureError = utils.HttpSignatureError;
118678var validateAlgorithm = utils.validateAlgorithm;
118679
118680///--- Globals
118681
118682var AUTHZ_FMT =
118683 'Signature keyId="%s",algorithm="%s",headers="%s",signature="%s"';
118684
118685///--- Specific Errors
118686
118687function MissingHeaderError(message) {
118688 HttpSignatureError.call(this, message, MissingHeaderError);
118689}
118690util.inherits(MissingHeaderError, HttpSignatureError);
118691
118692function StrictParsingError(message) {
118693 HttpSignatureError.call(this, message, StrictParsingError);
118694}
118695util.inherits(StrictParsingError, HttpSignatureError);
118696
118697/* See createSigner() */
118698function RequestSigner(options) {
118699 assert.object(options, 'options');
118700
118701 var alg = [];
118702 if (options.algorithm !== undefined) {
118703 assert.string(options.algorithm, 'options.algorithm');
118704 alg = validateAlgorithm(options.algorithm);
118705 }
118706 this.rs_alg = alg;
118707
118708 /*
118709 * RequestSigners come in two varieties: ones with an rs_signFunc, and ones
118710 * with an rs_signer.
118711 *
118712 * rs_signFunc-based RequestSigners have to build up their entire signing
118713 * string within the rs_lines array and give it to rs_signFunc as a single
118714 * concat'd blob. rs_signer-based RequestSigners can add a line at a time to
118715 * their signing state by using rs_signer.update(), thus only needing to
118716 * buffer the hash function state and one line at a time.
118717 */
118718 if (options.sign !== undefined) {
118719 assert.func(options.sign, 'options.sign');
118720 this.rs_signFunc = options.sign;
118721
118722 } else if (alg[0] === 'hmac' && options.key !== undefined) {
118723 assert.string(options.keyId, 'options.keyId');
118724 this.rs_keyId = options.keyId;
118725
118726 if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key))
118727 throw (new TypeError('options.key for HMAC must be a string or Buffer'));
118728
118729 /*
118730 * Make an rs_signer for HMACs, not a rs_signFunc -- HMACs digest their
118731 * data in chunks rather than requiring it all to be given in one go
118732 * at the end, so they are more similar to signers than signFuncs.
118733 */
118734 this.rs_signer = crypto.createHmac(alg[1].toUpperCase(), options.key);
118735 this.rs_signer.sign = function () {
118736 var digest = this.digest('base64');
118737 return ({
118738 hashAlgorithm: alg[1],
118739 toString: function () { return (digest); }
118740 });
118741 };
118742
118743 } else if (options.key !== undefined) {
118744 var key = options.key;
118745 if (typeof (key) === 'string' || Buffer.isBuffer(key))
118746 key = sshpk.parsePrivateKey(key);
118747
118748 assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]),
118749 'options.key must be a sshpk.PrivateKey');
118750 this.rs_key = key;
118751
118752 assert.string(options.keyId, 'options.keyId');
118753 this.rs_keyId = options.keyId;
118754
118755 if (!PK_ALGOS[key.type]) {
118756 throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' +
118757 'keys are not supported'));
118758 }
118759
118760 if (alg[0] !== undefined && key.type !== alg[0]) {
118761 throw (new InvalidAlgorithmError('options.key must be a ' +
118762 alg[0].toUpperCase() + ' key, was given a ' +
118763 key.type.toUpperCase() + ' key instead'));
118764 }
118765
118766 this.rs_signer = key.createSign(alg[1]);
118767
118768 } else {
118769 throw (new TypeError('options.sign (func) or options.key is required'));
118770 }
118771
118772 this.rs_headers = [];
118773 this.rs_lines = [];
118774}
118775
118776/**
118777 * Adds a header to be signed, with its value, into this signer.
118778 *
118779 * @param {String} header
118780 * @param {String} value
118781 * @return {String} value written
118782 */
118783RequestSigner.prototype.writeHeader = function (header, value) {
118784 assert.string(header, 'header');
118785 header = header.toLowerCase();
118786 assert.string(value, 'value');
118787
118788 this.rs_headers.push(header);
118789
118790 if (this.rs_signFunc) {
118791 this.rs_lines.push(header + ': ' + value);
118792
118793 } else {
118794 var line = header + ': ' + value;
118795 if (this.rs_headers.length > 0)
118796 line = '\n' + line;
118797 this.rs_signer.update(line);
118798 }
118799
118800 return (value);
118801};
118802
118803/**
118804 * Adds a default Date header, returning its value.
118805 *
118806 * @return {String}
118807 */
118808RequestSigner.prototype.writeDateHeader = function () {
118809 return (this.writeHeader('date', jsprim.rfc1123(new Date())));
118810};
118811
118812/**
118813 * Adds the request target line to be signed.
118814 *
118815 * @param {String} method, HTTP method (e.g. 'get', 'post', 'put')
118816 * @param {String} path
118817 */
118818RequestSigner.prototype.writeTarget = function (method, path) {
118819 assert.string(method, 'method');
118820 assert.string(path, 'path');
118821 method = method.toLowerCase();
118822 this.writeHeader('(request-target)', method + ' ' + path);
118823};
118824
118825/**
118826 * Calculate the value for the Authorization header on this request
118827 * asynchronously.
118828 *
118829 * @param {Func} callback (err, authz)
118830 */
118831RequestSigner.prototype.sign = function (cb) {
118832 assert.func(cb, 'callback');
118833
118834 if (this.rs_headers.length < 1)
118835 throw (new Error('At least one header must be signed'));
118836
118837 var alg, authz;
118838 if (this.rs_signFunc) {
118839 var data = this.rs_lines.join('\n');
118840 var self = this;
118841 this.rs_signFunc(data, function (err, sig) {
118842 if (err) {
118843 cb(err);
118844 return;
118845 }
118846 try {
118847 assert.object(sig, 'signature');
118848 assert.string(sig.keyId, 'signature.keyId');
118849 assert.string(sig.algorithm, 'signature.algorithm');
118850 assert.string(sig.signature, 'signature.signature');
118851 alg = validateAlgorithm(sig.algorithm);
118852
118853 authz = sprintf(AUTHZ_FMT,
118854 sig.keyId,
118855 sig.algorithm,
118856 self.rs_headers.join(' '),
118857 sig.signature);
118858 } catch (e) {
118859 cb(e);
118860 return;
118861 }
118862 cb(null, authz);
118863 });
118864
118865 } else {
118866 try {
118867 var sigObj = this.rs_signer.sign();
118868 } catch (e) {
118869 cb(e);
118870 return;
118871 }
118872 alg = (this.rs_alg[0] || this.rs_key.type) + '-' + sigObj.hashAlgorithm;
118873 var signature = sigObj.toString();
118874 authz = sprintf(AUTHZ_FMT,
118875 this.rs_keyId,
118876 alg,
118877 this.rs_headers.join(' '),
118878 signature);
118879 cb(null, authz);
118880 }
118881};
118882
118883///--- Exported API
118884
118885module.exports = {
118886 /**
118887 * Identifies whether a given object is a request signer or not.
118888 *
118889 * @param {Object} object, the object to identify
118890 * @returns {Boolean}
118891 */
118892 isSigner: function (obj) {
118893 if (typeof (obj) === 'object' && obj instanceof RequestSigner)
118894 return (true);
118895 return (false);
118896 },
118897
118898 /**
118899 * Creates a request signer, used to asynchronously build a signature
118900 * for a request (does not have to be an http.ClientRequest).
118901 *
118902 * @param {Object} options, either:
118903 * - {String} keyId
118904 * - {String|Buffer} key
118905 * - {String} algorithm (optional, required for HMAC)
118906 * or:
118907 * - {Func} sign (data, cb)
118908 * @return {RequestSigner}
118909 */
118910 createSigner: function createSigner(options) {
118911 return (new RequestSigner(options));
118912 },
118913
118914 /**
118915 * Adds an 'Authorization' header to an http.ClientRequest object.
118916 *
118917 * Note that this API will add a Date header if it's not already set. Any
118918 * other headers in the options.headers array MUST be present, or this
118919 * will throw.
118920 *
118921 * You shouldn't need to check the return type; it's just there if you want
118922 * to be pedantic.
118923 *
118924 * The optional flag indicates whether parsing should use strict enforcement
118925 * of the version draft-cavage-http-signatures-04 of the spec or beyond.
118926 * The default is to be loose and support
118927 * older versions for compatibility.
118928 *
118929 * @param {Object} request an instance of http.ClientRequest.
118930 * @param {Object} options signing parameters object:
118931 * - {String} keyId required.
118932 * - {String} key required (either a PEM or HMAC key).
118933 * - {Array} headers optional; defaults to ['date'].
118934 * - {String} algorithm optional (unless key is HMAC);
118935 * default is the same as the sshpk default
118936 * signing algorithm for the type of key given
118937 * - {String} httpVersion optional; defaults to '1.1'.
118938 * - {Boolean} strict optional; defaults to 'false'.
118939 * @return {Boolean} true if Authorization (and optionally Date) were added.
118940 * @throws {TypeError} on bad parameter types (input).
118941 * @throws {InvalidAlgorithmError} if algorithm was bad or incompatible with
118942 * the given key.
118943 * @throws {sshpk.KeyParseError} if key was bad.
118944 * @throws {MissingHeaderError} if a header to be signed was specified but
118945 * was not present.
118946 */
118947 signRequest: function signRequest(request, options) {
118948 assert.object(request, 'request');
118949 assert.object(options, 'options');
118950 assert.optionalString(options.algorithm, 'options.algorithm');
118951 assert.string(options.keyId, 'options.keyId');
118952 assert.optionalArrayOfString(options.headers, 'options.headers');
118953 assert.optionalString(options.httpVersion, 'options.httpVersion');
118954
118955 if (!request.getHeader('Date'))
118956 request.setHeader('Date', jsprim.rfc1123(new Date()));
118957 if (!options.headers)
118958 options.headers = ['date'];
118959 if (!options.httpVersion)
118960 options.httpVersion = '1.1';
118961
118962 var alg = [];
118963 if (options.algorithm) {
118964 options.algorithm = options.algorithm.toLowerCase();
118965 alg = validateAlgorithm(options.algorithm);
118966 }
118967
118968 var i;
118969 var stringToSign = '';
118970 for (i = 0; i < options.headers.length; i++) {
118971 if (typeof (options.headers[i]) !== 'string')
118972 throw new TypeError('options.headers must be an array of Strings');
118973
118974 var h = options.headers[i].toLowerCase();
118975
118976 if (h === 'request-line') {
118977 if (!options.strict) {
118978 /**
118979 * We allow headers from the older spec drafts if strict parsing isn't
118980 * specified in options.
118981 */
118982 stringToSign +=
118983 request.method + ' ' + request.path + ' HTTP/' +
118984 options.httpVersion;
118985 } else {
118986 /* Strict parsing doesn't allow older draft headers. */
118987 throw (new StrictParsingError('request-line is not a valid header ' +
118988 'with strict parsing enabled.'));
118989 }
118990 } else if (h === '(request-target)') {
118991 stringToSign +=
118992 '(request-target): ' + request.method.toLowerCase() + ' ' +
118993 request.path;
118994 } else {
118995 var value = request.getHeader(h);
118996 if (value === undefined || value === '') {
118997 throw new MissingHeaderError(h + ' was not in the request');
118998 }
118999 stringToSign += h + ': ' + value;
119000 }
119001
119002 if ((i + 1) < options.headers.length)
119003 stringToSign += '\n';
119004 }
119005
119006 /* This is just for unit tests. */
119007 if (request.hasOwnProperty('_stringToSign')) {
119008 request._stringToSign = stringToSign;
119009 }
119010
119011 var signature;
119012 if (alg[0] === 'hmac') {
119013 if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key))
119014 throw (new TypeError('options.key must be a string or Buffer'));
119015
119016 var hmac = crypto.createHmac(alg[1].toUpperCase(), options.key);
119017 hmac.update(stringToSign);
119018 signature = hmac.digest('base64');
119019
119020 } else {
119021 var key = options.key;
119022 if (typeof (key) === 'string' || Buffer.isBuffer(key))
119023 key = sshpk.parsePrivateKey(options.key);
119024
119025 assert.ok(sshpk.PrivateKey.isPrivateKey(key, [1, 2]),
119026 'options.key must be a sshpk.PrivateKey');
119027
119028 if (!PK_ALGOS[key.type]) {
119029 throw (new InvalidAlgorithmError(key.type.toUpperCase() + ' type ' +
119030 'keys are not supported'));
119031 }
119032
119033 if (alg[0] !== undefined && key.type !== alg[0]) {
119034 throw (new InvalidAlgorithmError('options.key must be a ' +
119035 alg[0].toUpperCase() + ' key, was given a ' +
119036 key.type.toUpperCase() + ' key instead'));
119037 }
119038
119039 var signer = key.createSign(alg[1]);
119040 signer.update(stringToSign);
119041 var sigObj = signer.sign();
119042 if (!HASH_ALGOS[sigObj.hashAlgorithm]) {
119043 throw (new InvalidAlgorithmError(sigObj.hashAlgorithm.toUpperCase() +
119044 ' is not a supported hash algorithm'));
119045 }
119046 options.algorithm = key.type + '-' + sigObj.hashAlgorithm;
119047 signature = sigObj.toString();
119048 assert.notStrictEqual(signature, '', 'empty signature produced');
119049 }
119050
119051 var authzHeaderName = options.authorizationHeaderName || 'Authorization';
119052
119053 request.setHeader(authzHeaderName, sprintf(AUTHZ_FMT,
119054 options.keyId,
119055 options.algorithm,
119056 options.headers.join(' '),
119057 signature));
119058
119059 return true;
119060 }
119061
119062};
119063
119064
119065/***/ }),
119066/* 744 */
119067/***/ (function(module, exports, __webpack_require__) {
119068
119069// Copyright 2015 Joyent, Inc.
119070
119071var assert = __webpack_require__(22);
119072var crypto = __webpack_require__(21);
119073var sshpk = __webpack_require__(268);
119074var utils = __webpack_require__(165);
119075
119076var HASH_ALGOS = utils.HASH_ALGOS;
119077var PK_ALGOS = utils.PK_ALGOS;
119078var InvalidAlgorithmError = utils.InvalidAlgorithmError;
119079var HttpSignatureError = utils.HttpSignatureError;
119080var validateAlgorithm = utils.validateAlgorithm;
119081
119082///--- Exported API
119083
119084module.exports = {
119085 /**
119086 * Verify RSA/DSA signature against public key. You are expected to pass in
119087 * an object that was returned from `parse()`.
119088 *
119089 * @param {Object} parsedSignature the object you got from `parse`.
119090 * @param {String} pubkey RSA/DSA private key PEM.
119091 * @return {Boolean} true if valid, false otherwise.
119092 * @throws {TypeError} if you pass in bad arguments.
119093 * @throws {InvalidAlgorithmError}
119094 */
119095 verifySignature: function verifySignature(parsedSignature, pubkey) {
119096 assert.object(parsedSignature, 'parsedSignature');
119097 if (typeof (pubkey) === 'string' || Buffer.isBuffer(pubkey))
119098 pubkey = sshpk.parseKey(pubkey);
119099 assert.ok(sshpk.Key.isKey(pubkey, [1, 1]), 'pubkey must be a sshpk.Key');
119100
119101 var alg = validateAlgorithm(parsedSignature.algorithm);
119102 if (alg[0] === 'hmac' || alg[0] !== pubkey.type)
119103 return (false);
119104
119105 var v = pubkey.createVerify(alg[1]);
119106 v.update(parsedSignature.signingString);
119107 return (v.verify(parsedSignature.params.signature, 'base64'));
119108 },
119109
119110 /**
119111 * Verify HMAC against shared secret. You are expected to pass in an object
119112 * that was returned from `parse()`.
119113 *
119114 * @param {Object} parsedSignature the object you got from `parse`.
119115 * @param {String} secret HMAC shared secret.
119116 * @return {Boolean} true if valid, false otherwise.
119117 * @throws {TypeError} if you pass in bad arguments.
119118 * @throws {InvalidAlgorithmError}
119119 */
119120 verifyHMAC: function verifyHMAC(parsedSignature, secret) {
119121 assert.object(parsedSignature, 'parsedHMAC');
119122 assert.string(secret, 'secret');
119123
119124 var alg = validateAlgorithm(parsedSignature.algorithm);
119125 if (alg[0] !== 'hmac')
119126 return (false);
119127
119128 var hashAlg = alg[1].toUpperCase();
119129
119130 var hmac = crypto.createHmac(hashAlg, secret);
119131 hmac.update(parsedSignature.signingString);
119132
119133 /*
119134 * Now double-hash to avoid leaking timing information - there's
119135 * no easy constant-time compare in JS, so we use this approach
119136 * instead. See for more info:
119137 * https://www.isecpartners.com/blog/2011/february/double-hmac-
119138 * verification.aspx
119139 */
119140 var h1 = crypto.createHmac(hashAlg, secret);
119141 h1.update(hmac.digest());
119142 h1 = h1.digest();
119143 var h2 = crypto.createHmac(hashAlg, secret);
119144 h2.update(new Buffer(parsedSignature.params.signature, 'base64'));
119145 h2 = h2.digest();
119146
119147 /* Node 0.8 returns strings from .digest(). */
119148 if (typeof (h1) === 'string')
119149 return (h1 === h2);
119150 /* And node 0.10 lacks the .equals() method on Buffers. */
119151 if (Buffer.isBuffer(h1) && !h1.equals)
119152 return (h1.toString('binary') === h2.toString('binary'));
119153
119154 return (h1.equals(h2));
119155 }
119156};
119157
119158
119159/***/ }),
119160/* 745 */
119161/***/ (function(module, exports, __webpack_require__) {
119162
119163var wrappy = __webpack_require__(436)
119164var reqs = Object.create(null)
119165var once = __webpack_require__(133)
119166
119167module.exports = wrappy(inflight)
119168
119169function inflight (key, cb) {
119170 if (reqs[key]) {
119171 reqs[key].push(cb)
119172 return null
119173 } else {
119174 reqs[key] = [cb]
119175 return makeres(key)
119176 }
119177}
119178
119179function makeres (key) {
119180 return once(function RES () {
119181 var cbs = reqs[key]
119182 var len = cbs.length
119183 var args = slice(arguments)
119184
119185 // XXX It's somewhat ambiguous whether a new callback added in this
119186 // pass should be queued for later execution if something in the
119187 // list of callbacks throws, or if it should just be discarded.
119188 // However, it's such an edge case that it hardly matters, and either
119189 // choice is likely as surprising as the other.
119190 // As it happens, we do go ahead and schedule it for later execution.
119191 try {
119192 for (var i = 0; i < len; i++) {
119193 cbs[i].apply(null, args)
119194 }
119195 } finally {
119196 if (cbs.length > len) {
119197 // added more in the interim.
119198 // de-zalgo, just in case, but don't call again.
119199 cbs.splice(0, len)
119200 process.nextTick(function () {
119201 RES.apply(null, args)
119202 })
119203 } else {
119204 delete reqs[key]
119205 }
119206 }
119207 })
119208}
119209
119210function slice (args) {
119211 var length = args.length
119212 var array = []
119213
119214 for (var i = 0; i < length; i++) array[i] = args[i]
119215 return array
119216}
119217
119218
119219/***/ }),
119220/* 746 */
119221/***/ (function(module, exports) {
119222
119223if (typeof Object.create === 'function') {
119224 // implementation from standard node.js 'util' module
119225 module.exports = function inherits(ctor, superCtor) {
119226 ctor.super_ = superCtor
119227 ctor.prototype = Object.create(superCtor.prototype, {
119228 constructor: {
119229 value: ctor,
119230 enumerable: false,
119231 writable: true,
119232 configurable: true
119233 }
119234 });
119235 };
119236} else {
119237 // old school shim for old browsers
119238 module.exports = function inherits(ctor, superCtor) {
119239 ctor.super_ = superCtor
119240 var TempCtor = function () {}
119241 TempCtor.prototype = superCtor.prototype
119242 ctor.prototype = new TempCtor()
119243 ctor.prototype.constructor = ctor
119244 }
119245}
119246
119247
119248/***/ }),
119249/* 747 */
119250/***/ (function(module, exports) {
119251
119252exports.parse = exports.decode = decode
119253
119254exports.stringify = exports.encode = encode
119255
119256exports.safe = safe
119257exports.unsafe = unsafe
119258
119259var eol = typeof process !== 'undefined' &&
119260 process.platform === 'win32' ? '\r\n' : '\n'
119261
119262function encode (obj, opt) {
119263 var children = []
119264 var out = ''
119265
119266 if (typeof opt === 'string') {
119267 opt = {
119268 section: opt,
119269 whitespace: false
119270 }
119271 } else {
119272 opt = opt || {}
119273 opt.whitespace = opt.whitespace === true
119274 }
119275
119276 var separator = opt.whitespace ? ' = ' : '='
119277
119278 Object.keys(obj).forEach(function (k, _, __) {
119279 var val = obj[k]
119280 if (val && Array.isArray(val)) {
119281 val.forEach(function (item) {
119282 out += safe(k + '[]') + separator + safe(item) + '\n'
119283 })
119284 } else if (val && typeof val === 'object') {
119285 children.push(k)
119286 } else {
119287 out += safe(k) + separator + safe(val) + eol
119288 }
119289 })
119290
119291 if (opt.section && out.length) {
119292 out = '[' + safe(opt.section) + ']' + eol + out
119293 }
119294
119295 children.forEach(function (k, _, __) {
119296 var nk = dotSplit(k).join('\\.')
119297 var section = (opt.section ? opt.section + '.' : '') + nk
119298 var child = encode(obj[k], {
119299 section: section,
119300 whitespace: opt.whitespace
119301 })
119302 if (out.length && child.length) {
119303 out += eol
119304 }
119305 out += child
119306 })
119307
119308 return out
119309}
119310
119311function dotSplit (str) {
119312 return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002')
119313 .replace(/\\\./g, '\u0001')
119314 .split(/\./).map(function (part) {
119315 return part.replace(/\1/g, '\\.')
119316 .replace(/\2LITERAL\\1LITERAL\2/g, '\u0001')
119317 })
119318}
119319
119320function decode (str) {
119321 var out = {}
119322 var p = out
119323 var section = null
119324 // section |key = value
119325 var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i
119326 var lines = str.split(/[\r\n]+/g)
119327
119328 lines.forEach(function (line, _, __) {
119329 if (!line || line.match(/^\s*[;#]/)) return
119330 var match = line.match(re)
119331 if (!match) return
119332 if (match[1] !== undefined) {
119333 section = unsafe(match[1])
119334 p = out[section] = out[section] || {}
119335 return
119336 }
119337 var key = unsafe(match[2])
119338 var value = match[3] ? unsafe(match[4]) : true
119339 switch (value) {
119340 case 'true':
119341 case 'false':
119342 case 'null': value = JSON.parse(value)
119343 }
119344
119345 // Convert keys with '[]' suffix to an array
119346 if (key.length > 2 && key.slice(-2) === '[]') {
119347 key = key.substring(0, key.length - 2)
119348 if (!p[key]) {
119349 p[key] = []
119350 } else if (!Array.isArray(p[key])) {
119351 p[key] = [p[key]]
119352 }
119353 }
119354
119355 // safeguard against resetting a previously defined
119356 // array by accidentally forgetting the brackets
119357 if (Array.isArray(p[key])) {
119358 p[key].push(value)
119359 } else {
119360 p[key] = value
119361 }
119362 })
119363
119364 // {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}}
119365 // use a filter to return the keys that have to be deleted.
119366 Object.keys(out).filter(function (k, _, __) {
119367 if (!out[k] ||
119368 typeof out[k] !== 'object' ||
119369 Array.isArray(out[k])) {
119370 return false
119371 }
119372 // see if the parent section is also an object.
119373 // if so, add it to that, and mark this one for deletion
119374 var parts = dotSplit(k)
119375 var p = out
119376 var l = parts.pop()
119377 var nl = l.replace(/\\\./g, '.')
119378 parts.forEach(function (part, _, __) {
119379 if (!p[part] || typeof p[part] !== 'object') p[part] = {}
119380 p = p[part]
119381 })
119382 if (p === out && nl === l) {
119383 return false
119384 }
119385 p[nl] = out[k]
119386 return true
119387 }).forEach(function (del, _, __) {
119388 delete out[del]
119389 })
119390
119391 return out
119392}
119393
119394function isQuoted (val) {
119395 return (val.charAt(0) === '"' && val.slice(-1) === '"') ||
119396 (val.charAt(0) === "'" && val.slice(-1) === "'")
119397}
119398
119399function safe (val) {
119400 return (typeof val !== 'string' ||
119401 val.match(/[=\r\n]/) ||
119402 val.match(/^\[/) ||
119403 (val.length > 1 &&
119404 isQuoted(val)) ||
119405 val !== val.trim())
119406 ? JSON.stringify(val)
119407 : val.replace(/;/g, '\\;').replace(/#/g, '\\#')
119408}
119409
119410function unsafe (val, doUnesc) {
119411 val = (val || '').trim()
119412 if (isQuoted(val)) {
119413 // remove the single quotes before calling JSON.parse
119414 if (val.charAt(0) === "'") {
119415 val = val.substr(1, val.length - 2)
119416 }
119417 try { val = JSON.parse(val) } catch (_) {}
119418 } else {
119419 // walk the val to find the first not-escaped ; character
119420 var esc = false
119421 var unesc = ''
119422 for (var i = 0, l = val.length; i < l; i++) {
119423 var c = val.charAt(i)
119424 if (esc) {
119425 if ('\\;#'.indexOf(c) !== -1) {
119426 unesc += c
119427 } else {
119428 unesc += '\\' + c
119429 }
119430 esc = false
119431 } else if (';#'.indexOf(c) !== -1) {
119432 break
119433 } else if (c === '\\') {
119434 esc = true
119435 } else {
119436 unesc += c
119437 }
119438 }
119439 if (esc) {
119440 unesc += '\\'
119441 }
119442 return unesc.trim()
119443 }
119444 return val
119445}
119446
119447
119448/***/ }),
119449/* 748 */
119450/***/ (function(module, exports, __webpack_require__) {
119451
119452var util = __webpack_require__(9),
119453 Match = __webpack_require__ (130);
119454
119455
119456/**
119457 * This is a superclass for the individual detectors for
119458 * each of the detectable members of the ISO 2022 family
119459 * of encodings.
119460 */
119461
119462function ISO_2022() {}
119463
119464ISO_2022.prototype.match = function(det) {
119465
119466 /**
119467 * Matching function shared among the 2022 detectors JP, CN and KR
119468 * Counts up the number of legal an unrecognized escape sequences in
119469 * the sample of text, and computes a score based on the total number &
119470 * the proportion that fit the encoding.
119471 *
119472 *
119473 * @param text the byte buffer containing text to analyse
119474 * @param textLen the size of the text in the byte.
119475 * @param escapeSequences the byte escape sequences to test for.
119476 * @return match quality, in the range of 0-100.
119477 */
119478
119479 var i, j;
119480 var escN;
119481 var hits = 0;
119482 var misses = 0;
119483 var shifts = 0;
119484 var quality;
119485
119486 // TODO: refactor me
119487 var text = det.fInputBytes;
119488 var textLen = det.fInputLen;
119489
119490 scanInput:
119491 for (i = 0; i < textLen; i++) {
119492 if (text[i] == 0x1b) {
119493 checkEscapes:
119494 for (escN = 0; escN < this.escapeSequences.length; escN++) {
119495 var seq = this.escapeSequences[escN];
119496
119497 if ((textLen - i) < seq.length)
119498 continue checkEscapes;
119499
119500 for (j = 1; j < seq.length; j++)
119501 if (seq[j] != text[i + j])
119502 continue checkEscapes;
119503
119504
119505 hits++;
119506 i += seq.length - 1;
119507 continue scanInput;
119508 }
119509
119510 misses++;
119511 }
119512
119513 // Shift in/out
119514 if (text[i] == 0x0e || text[i] == 0x0f)
119515 shifts++;
119516
119517 }
119518
119519 if (hits == 0)
119520 return null;
119521
119522 //
119523 // Initial quality is based on relative proportion of recongized vs.
119524 // unrecognized escape sequences.
119525 // All good: quality = 100;
119526 // half or less good: quality = 0;
119527 // linear inbetween.
119528 quality = (100 * hits - 100 * misses) / (hits + misses);
119529
119530 // Back off quality if there were too few escape sequences seen.
119531 // Include shifts in this computation, so that KR does not get penalized
119532 // for having only a single Escape sequence, but many shifts.
119533 if (hits + shifts < 5)
119534 quality -= (5 - (hits + shifts)) * 10;
119535
119536 return quality <= 0 ? null : new Match(det, this, quality);
119537};
119538
119539module.exports.ISO_2022_JP = function() {
119540 this.name = function() {
119541 return 'ISO-2022-JP';
119542 };
119543 this.escapeSequences = [
119544 [ 0x1b, 0x24, 0x28, 0x43 ], // KS X 1001:1992
119545 [ 0x1b, 0x24, 0x28, 0x44 ], // JIS X 212-1990
119546 [ 0x1b, 0x24, 0x40 ], // JIS C 6226-1978
119547 [ 0x1b, 0x24, 0x41 ], // GB 2312-80
119548 [ 0x1b, 0x24, 0x42 ], // JIS X 208-1983
119549 [ 0x1b, 0x26, 0x40 ], // JIS X 208 1990, 1997
119550 [ 0x1b, 0x28, 0x42 ], // ASCII
119551 [ 0x1b, 0x28, 0x48 ], // JIS-Roman
119552 [ 0x1b, 0x28, 0x49 ], // Half-width katakana
119553 [ 0x1b, 0x28, 0x4a ], // JIS-Roman
119554 [ 0x1b, 0x2e, 0x41 ], // ISO 8859-1
119555 [ 0x1b, 0x2e, 0x46 ] // ISO 8859-7
119556 ];
119557};
119558util.inherits(module.exports.ISO_2022_JP, ISO_2022);
119559
119560
119561
119562module.exports.ISO_2022_KR = function() {
119563 this.name = function() {
119564 return 'ISO-2022-KR';
119565 };
119566 this.escapeSequences = [
119567 [ 0x1b, 0x24, 0x29, 0x43 ]
119568 ];
119569};
119570util.inherits(module.exports.ISO_2022_KR, ISO_2022);
119571
119572
119573
119574module.exports.ISO_2022_CN = function() {
119575 this.name = function() {
119576 return 'ISO-2022-CN';
119577 };
119578 this.escapeSequences = [
119579 [ 0x1b, 0x24, 0x29, 0x41 ], // GB 2312-80
119580 [ 0x1b, 0x24, 0x29, 0x47 ], // CNS 11643-1992 Plane 1
119581 [ 0x1b, 0x24, 0x2A, 0x48 ], // CNS 11643-1992 Plane 2
119582 [ 0x1b, 0x24, 0x29, 0x45 ], // ISO-IR-165
119583 [ 0x1b, 0x24, 0x2B, 0x49 ], // CNS 11643-1992 Plane 3
119584 [ 0x1b, 0x24, 0x2B, 0x4A ], // CNS 11643-1992 Plane 4
119585 [ 0x1b, 0x24, 0x2B, 0x4B ], // CNS 11643-1992 Plane 5
119586 [ 0x1b, 0x24, 0x2B, 0x4C ], // CNS 11643-1992 Plane 6
119587 [ 0x1b, 0x24, 0x2B, 0x4D ], // CNS 11643-1992 Plane 7
119588 [ 0x1b, 0x4e ], // SS2
119589 [ 0x1b, 0x4f ] // SS3
119590 ];
119591};
119592util.inherits(module.exports.ISO_2022_CN, ISO_2022);
119593
119594
119595/***/ }),
119596/* 749 */
119597/***/ (function(module, exports, __webpack_require__) {
119598
119599var util = __webpack_require__(9),
119600 Match = __webpack_require__ (130);
119601
119602/**
119603 * Binary search implementation (recursive)
119604 */
119605function binarySearch(arr, searchValue) {
119606 function find(arr, searchValue, left, right) {
119607 if (right < left)
119608 return -1;
119609
119610 /*
119611 int mid = mid = (left + right) / 2;
119612 There is a bug in the above line;
119613 Joshua Bloch suggests the following replacement:
119614 */
119615 var mid = Math.floor((left + right) >>> 1);
119616 if (searchValue > arr[mid])
119617 return find(arr, searchValue, mid + 1, right);
119618
119619 if (searchValue < arr[mid])
119620 return find(arr, searchValue, left, mid - 1);
119621
119622 return mid;
119623 };
119624
119625 return find(arr, searchValue, 0, arr.length - 1);
119626};
119627
119628// 'Character' iterated character class.
119629// Recognizers for specific mbcs encodings make their 'characters' available
119630// by providing a nextChar() function that fills in an instance of iteratedChar
119631// with the next char from the input.
119632// The returned characters are not converted to Unicode, but remain as the raw
119633// bytes (concatenated into an int) from the codepage data.
119634//
119635// For Asian charsets, use the raw input rather than the input that has been
119636// stripped of markup. Detection only considers multi-byte chars, effectively
119637// stripping markup anyway, and double byte chars do occur in markup too.
119638//
119639function IteratedChar() {
119640
119641 this.charValue = 0; // 1-4 bytes from the raw input data
119642 this.index = 0;
119643 this.nextIndex = 0;
119644 this.error = false;
119645 this.done = false;
119646
119647 this.reset = function() {
119648 this.charValue = 0;
119649 this.index = -1;
119650 this.nextIndex = 0;
119651 this.error = false;
119652 this.done = false;
119653 };
119654
119655 this.nextByte = function(det) {
119656 if (this.nextIndex >= det.fRawLength) {
119657 this.done = true;
119658 return -1;
119659 }
119660 var byteValue = det.fRawInput[this.nextIndex++] & 0x00ff;
119661 return byteValue;
119662 };
119663};
119664
119665
119666
119667/**
119668 * Asian double or multi-byte - charsets.
119669 * Match is determined mostly by the input data adhering to the
119670 * encoding scheme for the charset, and, optionally,
119671 * frequency-of-occurence of characters.
119672 */
119673
119674function mbcs() {};
119675
119676/**
119677 * Test the match of this charset with the input text data
119678 * which is obtained via the CharsetDetector object.
119679 *
119680 * @param det The CharsetDetector, which contains the input text
119681 * to be checked for being in this charset.
119682 * @return Two values packed into one int (Damn java, anyhow)
119683 * bits 0-7: the match confidence, ranging from 0-100
119684 * bits 8-15: The match reason, an enum-like value.
119685 */
119686mbcs.prototype.match = function(det) {
119687
119688 var singleByteCharCount = 0, //TODO Do we really need this?
119689 doubleByteCharCount = 0,
119690 commonCharCount = 0,
119691 badCharCount = 0,
119692 totalCharCount = 0,
119693 confidence = 0;
119694
119695 var iter = new IteratedChar();
119696
119697 detectBlock: {
119698 for (iter.reset(); this.nextChar(iter, det);) {
119699 totalCharCount++;
119700 if (iter.error) {
119701 badCharCount++;
119702 } else {
119703 var cv = iter.charValue & 0xFFFFFFFF;
119704
119705 if (cv <= 0xff) {
119706 singleByteCharCount++;
119707 } else {
119708 doubleByteCharCount++;
119709 if (this.commonChars != null) {
119710 // NOTE: This assumes that there are no 4-byte common chars.
119711 if (binarySearch(this.commonChars, cv) >= 0) {
119712 commonCharCount++;
119713 }
119714 }
119715 }
119716 }
119717 if (badCharCount >= 2 && badCharCount * 5 >= doubleByteCharCount) {
119718 // console.log('its here!')
119719 // Bail out early if the byte data is not matching the encoding scheme.
119720 break detectBlock;
119721 }
119722 }
119723
119724 if (doubleByteCharCount <= 10 && badCharCount== 0) {
119725 // Not many multi-byte chars.
119726 if (doubleByteCharCount == 0 && totalCharCount < 10) {
119727 // There weren't any multibyte sequences, and there was a low density of non-ASCII single bytes.
119728 // We don't have enough data to have any confidence.
119729 // Statistical analysis of single byte non-ASCII charcters would probably help here.
119730 confidence = 0;
119731 }
119732 else {
119733 // ASCII or ISO file? It's probably not our encoding,
119734 // but is not incompatible with our encoding, so don't give it a zero.
119735 confidence = 10;
119736 }
119737 break detectBlock;
119738 }
119739
119740 //
119741 // No match if there are too many characters that don't fit the encoding scheme.
119742 // (should we have zero tolerance for these?)
119743 //
119744 if (doubleByteCharCount < 20 * badCharCount) {
119745 confidence = 0;
119746 break detectBlock;
119747 }
119748
119749 if (this.commonChars == null) {
119750 // We have no statistics on frequently occuring characters.
119751 // Assess confidence purely on having a reasonable number of
119752 // multi-byte characters (the more the better
119753 confidence = 30 + doubleByteCharCount - 20 * badCharCount;
119754 if (confidence > 100) {
119755 confidence = 100;
119756 }
119757 } else {
119758 //
119759 // Frequency of occurence statistics exist.
119760 //
119761 var maxVal = Math.log(parseFloat(doubleByteCharCount) / 4);
119762 var scaleFactor = 90.0 / maxVal;
119763 confidence = Math.floor(Math.log(commonCharCount + 1) * scaleFactor + 10);
119764 confidence = Math.min(confidence, 100);
119765 }
119766 } // end of detectBlock:
119767
119768 return confidence == 0 ? null : new Match(det, this, confidence);
119769};
119770
119771/**
119772 * Get the next character (however many bytes it is) from the input data
119773 * Subclasses for specific charset encodings must implement this function
119774 * to get characters according to the rules of their encoding scheme.
119775 *
119776 * This function is not a method of class iteratedChar only because
119777 * that would require a lot of extra derived classes, which is awkward.
119778 * @param it The iteratedChar 'struct' into which the returned char is placed.
119779 * @param det The charset detector, which is needed to get at the input byte data
119780 * being iterated over.
119781 * @return True if a character was returned, false at end of input.
119782 */
119783
119784mbcs.prototype.nextChar = function(iter, det) {};
119785
119786
119787
119788/**
119789 * Shift-JIS charset recognizer.
119790 */
119791module.exports.sjis = function() {
119792 this.name = function() {
119793 return 'Shift-JIS';
119794 };
119795 this.language = function() {
119796 return 'ja';
119797 };
119798
119799 // TODO: This set of data comes from the character frequency-
119800 // of-occurence analysis tool. The data needs to be moved
119801 // into a resource and loaded from there.
119802 this.commonChars = [
119803 0x8140, 0x8141, 0x8142, 0x8145, 0x815b, 0x8169, 0x816a, 0x8175, 0x8176, 0x82a0,
119804 0x82a2, 0x82a4, 0x82a9, 0x82aa, 0x82ab, 0x82ad, 0x82af, 0x82b1, 0x82b3, 0x82b5,
119805 0x82b7, 0x82bd, 0x82be, 0x82c1, 0x82c4, 0x82c5, 0x82c6, 0x82c8, 0x82c9, 0x82cc,
119806 0x82cd, 0x82dc, 0x82e0, 0x82e7, 0x82e8, 0x82e9, 0x82ea, 0x82f0, 0x82f1, 0x8341,
119807 0x8343, 0x834e, 0x834f, 0x8358, 0x835e, 0x8362, 0x8367, 0x8375, 0x8376, 0x8389,
119808 0x838a, 0x838b, 0x838d, 0x8393, 0x8e96, 0x93fa, 0x95aa
119809 ];
119810
119811 this.nextChar = function(iter, det) {
119812 iter.index = iter.nextIndex;
119813 iter.error = false;
119814
119815 var firstByte;
119816 firstByte = iter.charValue = iter.nextByte(det);
119817 if (firstByte < 0)
119818 return false;
119819
119820 if (firstByte <= 0x7f || (firstByte > 0xa0 && firstByte <= 0xdf))
119821 return true;
119822
119823 var secondByte = iter.nextByte(det);
119824 if (secondByte < 0)
119825 return false;
119826
119827 iter.charValue = (firstByte << 8) | secondByte;
119828 if (! ((secondByte >= 0x40 && secondByte <= 0x7f) || (secondByte >= 0x80 && secondByte <= 0xff))) {
119829 // Illegal second byte value.
119830 iter.error = true;
119831 }
119832 return true;
119833 };
119834};
119835util.inherits(module.exports.sjis, mbcs);
119836
119837
119838
119839/**
119840 * Big5 charset recognizer.
119841 */
119842module.exports.big5 = function() {
119843 this.name = function() {
119844 return 'Big5';
119845 };
119846 this.language = function() {
119847 return 'zh';
119848 };
119849 // TODO: This set of data comes from the character frequency-
119850 // of-occurence analysis tool. The data needs to be moved
119851 // into a resource and loaded from there.
119852 this.commonChars = [
119853 0xa140, 0xa141, 0xa142, 0xa143, 0xa147, 0xa149, 0xa175, 0xa176, 0xa440, 0xa446,
119854 0xa447, 0xa448, 0xa451, 0xa454, 0xa457, 0xa464, 0xa46a, 0xa46c, 0xa477, 0xa4a3,
119855 0xa4a4, 0xa4a7, 0xa4c1, 0xa4ce, 0xa4d1, 0xa4df, 0xa4e8, 0xa4fd, 0xa540, 0xa548,
119856 0xa558, 0xa569, 0xa5cd, 0xa5e7, 0xa657, 0xa661, 0xa662, 0xa668, 0xa670, 0xa6a8,
119857 0xa6b3, 0xa6b9, 0xa6d3, 0xa6db, 0xa6e6, 0xa6f2, 0xa740, 0xa751, 0xa759, 0xa7da,
119858 0xa8a3, 0xa8a5, 0xa8ad, 0xa8d1, 0xa8d3, 0xa8e4, 0xa8fc, 0xa9c0, 0xa9d2, 0xa9f3,
119859 0xaa6b, 0xaaba, 0xaabe, 0xaacc, 0xaafc, 0xac47, 0xac4f, 0xacb0, 0xacd2, 0xad59,
119860 0xaec9, 0xafe0, 0xb0ea, 0xb16f, 0xb2b3, 0xb2c4, 0xb36f, 0xb44c, 0xb44e, 0xb54c,
119861 0xb5a5, 0xb5bd, 0xb5d0, 0xb5d8, 0xb671, 0xb7ed, 0xb867, 0xb944, 0xbad8, 0xbb44,
119862 0xbba1, 0xbdd1, 0xc2c4, 0xc3b9, 0xc440, 0xc45f
119863 ];
119864 this.nextChar = function(iter, det) {
119865 iter.index = iter.nextIndex;
119866 iter.error = false;
119867
119868 var firstByte = iter.charValue = iter.nextByte(det);
119869
119870 if (firstByte < 0)
119871 return false;
119872
119873 // single byte character.
119874 if (firstByte <= 0x7f || firstByte == 0xff)
119875 return true;
119876
119877 var secondByte = iter.nextByte(det);
119878
119879 if (secondByte < 0)
119880 return false;
119881
119882 iter.charValue = (iter.charValue << 8) | secondByte;
119883
119884 if (secondByte < 0x40 || secondByte == 0x7f || secondByte == 0xff)
119885 iter.error = true;
119886
119887 return true;
119888 };
119889};
119890util.inherits(module.exports.big5, mbcs);
119891
119892
119893
119894/**
119895 * EUC charset recognizers. One abstract class that provides the common function
119896 * for getting the next character according to the EUC encoding scheme,
119897 * and nested derived classes for EUC_KR, EUC_JP, EUC_CN.
119898 *
119899 * Get the next character value for EUC based encodings.
119900 * Character 'value' is simply the raw bytes that make up the character
119901 * packed into an int.
119902 */
119903function eucNextChar(iter, det) {
119904 iter.index = iter.nextIndex;
119905 iter.error = false;
119906 var firstByte = 0;
119907 var secondByte = 0;
119908 var thirdByte = 0;
119909 //int fourthByte = 0;
119910 buildChar: {
119911 firstByte = iter.charValue = iter.nextByte(det);
119912 if (firstByte < 0) {
119913 // Ran off the end of the input data
119914 iter.done = true;
119915 break buildChar;
119916 }
119917 if (firstByte <= 0x8d) {
119918 // single byte char
119919 break buildChar;
119920 }
119921 secondByte = iter.nextByte(det);
119922 iter.charValue = (iter.charValue << 8) | secondByte;
119923 if (firstByte >= 0xA1 && firstByte <= 0xfe) {
119924 // Two byte Char
119925 if (secondByte < 0xa1) {
119926 iter.error = true;
119927 }
119928 break buildChar;
119929 }
119930 if (firstByte == 0x8e) {
119931 // Code Set 2.
119932 // In EUC-JP, total char size is 2 bytes, only one byte of actual char value.
119933 // In EUC-TW, total char size is 4 bytes, three bytes contribute to char value.
119934 // We don't know which we've got.
119935 // Treat it like EUC-JP. If the data really was EUC-TW, the following two
119936 // bytes will look like a well formed 2 byte char.
119937 if (secondByte < 0xa1) {
119938 iter.error = true;
119939 }
119940 break buildChar;
119941 }
119942 if (firstByte == 0x8f) {
119943 // Code set 3.
119944 // Three byte total char size, two bytes of actual char value.
119945 thirdByte = iter.nextByte(det);
119946 iter.charValue = (iter.charValue << 8) | thirdByte;
119947 if (thirdByte < 0xa1) {
119948 iter.error = true;
119949 }
119950 }
119951 }
119952 return iter.done == false;
119953};
119954
119955
119956
119957/**
119958 * The charset recognize for EUC-JP. A singleton instance of this class
119959 * is created and kept by the public CharsetDetector class
119960 */
119961module.exports.euc_jp = function() {
119962 this.name = function() {
119963 return 'EUC-JP';
119964 };
119965 this.language = function() {
119966 return 'ja';
119967 };
119968
119969 // TODO: This set of data comes from the character frequency-
119970 // of-occurence analysis tool. The data needs to be moved
119971 // into a resource and loaded from there.
119972 this.commonChars = [
119973 0xa1a1, 0xa1a2, 0xa1a3, 0xa1a6, 0xa1bc, 0xa1ca, 0xa1cb, 0xa1d6, 0xa1d7, 0xa4a2,
119974 0xa4a4, 0xa4a6, 0xa4a8, 0xa4aa, 0xa4ab, 0xa4ac, 0xa4ad, 0xa4af, 0xa4b1, 0xa4b3,
119975 0xa4b5, 0xa4b7, 0xa4b9, 0xa4bb, 0xa4bd, 0xa4bf, 0xa4c0, 0xa4c1, 0xa4c3, 0xa4c4,
119976 0xa4c6, 0xa4c7, 0xa4c8, 0xa4c9, 0xa4ca, 0xa4cb, 0xa4ce, 0xa4cf, 0xa4d0, 0xa4de,
119977 0xa4df, 0xa4e1, 0xa4e2, 0xa4e4, 0xa4e8, 0xa4e9, 0xa4ea, 0xa4eb, 0xa4ec, 0xa4ef,
119978 0xa4f2, 0xa4f3, 0xa5a2, 0xa5a3, 0xa5a4, 0xa5a6, 0xa5a7, 0xa5aa, 0xa5ad, 0xa5af,
119979 0xa5b0, 0xa5b3, 0xa5b5, 0xa5b7, 0xa5b8, 0xa5b9, 0xa5bf, 0xa5c3, 0xa5c6, 0xa5c7,
119980 0xa5c8, 0xa5c9, 0xa5cb, 0xa5d0, 0xa5d5, 0xa5d6, 0xa5d7, 0xa5de, 0xa5e0, 0xa5e1,
119981 0xa5e5, 0xa5e9, 0xa5ea, 0xa5eb, 0xa5ec, 0xa5ed, 0xa5f3, 0xb8a9, 0xb9d4, 0xbaee,
119982 0xbbc8, 0xbef0, 0xbfb7, 0xc4ea, 0xc6fc, 0xc7bd, 0xcab8, 0xcaf3, 0xcbdc, 0xcdd1
119983 ];
119984
119985 this.nextChar = eucNextChar;
119986};
119987util.inherits(module.exports.euc_jp, mbcs);
119988
119989
119990
119991/**
119992 * The charset recognize for EUC-KR. A singleton instance of this class
119993 * is created and kept by the public CharsetDetector class
119994 */
119995module.exports.euc_kr = function() {
119996 this.name = function() {
119997 return 'EUC-KR';
119998 };
119999 this.language = function() {
120000 return 'ko';
120001 };
120002
120003 // TODO: This set of data comes from the character frequency-
120004 // of-occurence analysis tool. The data needs to be moved
120005 // into a resource and loaded from there.
120006 this.commonChars = [
120007 0xb0a1, 0xb0b3, 0xb0c5, 0xb0cd, 0xb0d4, 0xb0e6, 0xb0ed, 0xb0f8, 0xb0fa, 0xb0fc,
120008 0xb1b8, 0xb1b9, 0xb1c7, 0xb1d7, 0xb1e2, 0xb3aa, 0xb3bb, 0xb4c2, 0xb4cf, 0xb4d9,
120009 0xb4eb, 0xb5a5, 0xb5b5, 0xb5bf, 0xb5c7, 0xb5e9, 0xb6f3, 0xb7af, 0xb7c2, 0xb7ce,
120010 0xb8a6, 0xb8ae, 0xb8b6, 0xb8b8, 0xb8bb, 0xb8e9, 0xb9ab, 0xb9ae, 0xb9cc, 0xb9ce,
120011 0xb9fd, 0xbab8, 0xbace, 0xbad0, 0xbaf1, 0xbbe7, 0xbbf3, 0xbbfd, 0xbcad, 0xbcba,
120012 0xbcd2, 0xbcf6, 0xbdba, 0xbdc0, 0xbdc3, 0xbdc5, 0xbec6, 0xbec8, 0xbedf, 0xbeee,
120013 0xbef8, 0xbefa, 0xbfa1, 0xbfa9, 0xbfc0, 0xbfe4, 0xbfeb, 0xbfec, 0xbff8, 0xc0a7,
120014 0xc0af, 0xc0b8, 0xc0ba, 0xc0bb, 0xc0bd, 0xc0c7, 0xc0cc, 0xc0ce, 0xc0cf, 0xc0d6,
120015 0xc0da, 0xc0e5, 0xc0fb, 0xc0fc, 0xc1a4, 0xc1a6, 0xc1b6, 0xc1d6, 0xc1df, 0xc1f6,
120016 0xc1f8, 0xc4a1, 0xc5cd, 0xc6ae, 0xc7cf, 0xc7d1, 0xc7d2, 0xc7d8, 0xc7e5, 0xc8ad
120017 ];
120018
120019 this.nextChar = eucNextChar;
120020};
120021util.inherits(module.exports.euc_kr, mbcs);
120022
120023
120024
120025/**
120026 * GB-18030 recognizer. Uses simplified Chinese statistics.
120027 */
120028module.exports.gb_18030 = function() {
120029 this.name = function() {
120030 return 'GB18030';
120031 };
120032 this.language = function() {
120033 return 'zh';
120034 };
120035
120036 /*
120037 * Get the next character value for EUC based encodings.
120038 * Character 'value' is simply the raw bytes that make up the character
120039 * packed into an int.
120040 */
120041 this.nextChar = function(iter, det) {
120042 iter.index = iter.nextIndex;
120043 iter.error = false;
120044 var firstByte = 0;
120045 var secondByte = 0;
120046 var thirdByte = 0;
120047 var fourthByte = 0;
120048 buildChar: {
120049 firstByte = iter.charValue = iter.nextByte(det);
120050 if (firstByte < 0) {
120051 // Ran off the end of the input data
120052 iter.done = true;
120053 break buildChar;
120054 }
120055 if (firstByte <= 0x80) {
120056 // single byte char
120057 break buildChar;
120058 }
120059 secondByte = iter.nextByte(det);
120060 iter.charValue = (iter.charValue << 8) | secondByte;
120061 if (firstByte >= 0x81 && firstByte <= 0xFE) {
120062 // Two byte Char
120063 if ((secondByte >= 0x40 && secondByte <= 0x7E) || (secondByte >=80 && secondByte <= 0xFE)) {
120064 break buildChar;
120065 }
120066 // Four byte char
120067 if (secondByte >= 0x30 && secondByte <= 0x39) {
120068 thirdByte = iter.nextByte(det);
120069 if (thirdByte >= 0x81 && thirdByte <= 0xFE) {
120070 fourthByte = iter.nextByte(det);
120071 if (fourthByte >= 0x30 && fourthByte <= 0x39) {
120072 iter.charValue = (iter.charValue << 16) | (thirdByte << 8) | fourthByte;
120073 break buildChar;
120074 }
120075 }
120076 }
120077 iter.error = true;
120078 break buildChar;
120079 }
120080 }
120081 return iter.done == false;
120082 };
120083
120084 // TODO: This set of data comes from the character frequency-
120085 // of-occurence analysis tool. The data needs to be moved
120086 // into a resource and loaded from there.
120087 this.commonChars = [
120088 0xa1a1, 0xa1a2, 0xa1a3, 0xa1a4, 0xa1b0, 0xa1b1, 0xa1f1, 0xa1f3, 0xa3a1, 0xa3ac,
120089 0xa3ba, 0xb1a8, 0xb1b8, 0xb1be, 0xb2bb, 0xb3c9, 0xb3f6, 0xb4f3, 0xb5bd, 0xb5c4,
120090 0xb5e3, 0xb6af, 0xb6d4, 0xb6e0, 0xb7a2, 0xb7a8, 0xb7bd, 0xb7d6, 0xb7dd, 0xb8b4,
120091 0xb8df, 0xb8f6, 0xb9ab, 0xb9c9, 0xb9d8, 0xb9fa, 0xb9fd, 0xbacd, 0xbba7, 0xbbd6,
120092 0xbbe1, 0xbbfa, 0xbcbc, 0xbcdb, 0xbcfe, 0xbdcc, 0xbecd, 0xbedd, 0xbfb4, 0xbfc6,
120093 0xbfc9, 0xc0b4, 0xc0ed, 0xc1cb, 0xc2db, 0xc3c7, 0xc4dc, 0xc4ea, 0xc5cc, 0xc6f7,
120094 0xc7f8, 0xc8ab, 0xc8cb, 0xc8d5, 0xc8e7, 0xc9cf, 0xc9fa, 0xcab1, 0xcab5, 0xcac7,
120095 0xcad0, 0xcad6, 0xcaf5, 0xcafd, 0xccec, 0xcdf8, 0xceaa, 0xcec4, 0xced2, 0xcee5,
120096 0xcfb5, 0xcfc2, 0xcfd6, 0xd0c2, 0xd0c5, 0xd0d0, 0xd0d4, 0xd1a7, 0xd2aa, 0xd2b2,
120097 0xd2b5, 0xd2bb, 0xd2d4, 0xd3c3, 0xd3d0, 0xd3fd, 0xd4c2, 0xd4da, 0xd5e2, 0xd6d0
120098 ];
120099};
120100util.inherits(module.exports.gb_18030, mbcs);
120101
120102
120103/***/ }),
120104/* 750 */
120105/***/ (function(module, exports, __webpack_require__) {
120106
120107var util = __webpack_require__(9),
120108 Match = __webpack_require__ (130);
120109
120110/**
120111 * This class recognizes single-byte encodings. Because the encoding scheme is so
120112 * simple, language statistics are used to do the matching.
120113 */
120114
120115function NGramParser(theNgramList, theByteMap) {
120116 var N_GRAM_MASK = 0xFFFFFF;
120117
120118 this.byteIndex = 0;
120119 this.ngram = 0;
120120
120121 this.ngramList = theNgramList;
120122 this.byteMap = theByteMap;
120123
120124 this.ngramCount = 0;
120125 this.hitCount = 0;
120126
120127 this.spaceChar;
120128
120129 /*
120130 * Binary search for value in table, which must have exactly 64 entries.
120131 */
120132 this.search = function(table, value) {
120133 var index = 0;
120134
120135 if (table[index + 32] <= value) index += 32;
120136 if (table[index + 16] <= value) index += 16;
120137 if (table[index + 8] <= value) index += 8;
120138 if (table[index + 4] <= value) index += 4;
120139 if (table[index + 2] <= value) index += 2;
120140 if (table[index + 1] <= value) index += 1;
120141 if (table[index] > value) index -= 1;
120142
120143 if (index < 0 || table[index] != value)
120144 return -1;
120145
120146 return index;
120147 };
120148
120149 this.lookup = function(thisNgram) {
120150 this.ngramCount += 1;
120151 if (this.search(this.ngramList, thisNgram) >= 0) {
120152 this.hitCount += 1;
120153 }
120154 };
120155
120156 this.addByte = function(b) {
120157 this.ngram = ((this.ngram << 8) + (b & 0xFF)) & N_GRAM_MASK;
120158 this.lookup(this.ngram);
120159 }
120160
120161 this.nextByte = function(det) {
120162 if (this.byteIndex >= det.fInputLen)
120163 return -1;
120164
120165 return det.fInputBytes[this.byteIndex++] & 0xFF;
120166 }
120167
120168 this.parse = function(det, spaceCh) {
120169 var b, ignoreSpace = false;
120170 this.spaceChar = spaceCh;
120171
120172 while ((b = this.nextByte(det)) >= 0) {
120173 var mb = this.byteMap[b];
120174
120175 // TODO: 0x20 might not be a space in all character sets...
120176 if (mb != 0) {
120177 if (!(mb == this.spaceChar && ignoreSpace)) {
120178 this.addByte(mb);
120179 }
120180
120181 ignoreSpace = (mb == this.spaceChar);
120182 }
120183 }
120184
120185 // TODO: Is this OK? The buffer could have ended in the middle of a word...
120186 this.addByte(this.spaceChar);
120187
120188 var rawPercent = this.hitCount / this.ngramCount;
120189
120190 // TODO - This is a bit of a hack to take care of a case
120191 // were we were getting a confidence of 135...
120192 if (rawPercent > 0.33)
120193 return 98;
120194
120195 return Math.floor(rawPercent * 300.0);
120196 };
120197};
120198
120199function NGramsPlusLang(la, ng) {
120200 this.fLang = la;
120201 this.fNGrams = ng;
120202};
120203
120204function sbcs() {};
120205sbcs.prototype.spaceChar = 0x20;
120206sbcs.prototype.ngrams = function() {};
120207sbcs.prototype.byteMap = function() {};
120208sbcs.prototype.match = function(det) {
120209
120210 var ngrams = this.ngrams();
120211 var multiple = (Array.isArray(ngrams) && ngrams[0] instanceof NGramsPlusLang);
120212
120213 if (!multiple) {
120214 var parser = new NGramParser(ngrams, this.byteMap());
120215 var confidence = parser.parse(det, this.spaceChar);
120216 return confidence <= 0 ? null : new Match(det, this, confidence);
120217 }
120218
120219 var bestConfidenceSoFar = -1;
120220 var lang = null;
120221
120222 for (var i = ngrams.length - 1; i >= 0; i--) {
120223 var ngl = ngrams[i];
120224
120225 var parser = new NGramParser(ngl.fNGrams, this.byteMap());
120226 var confidence = parser.parse(det, this.spaceChar);
120227 if (confidence > bestConfidenceSoFar) {
120228 bestConfidenceSoFar = confidence;
120229 lang = ngl.fLang;
120230 }
120231 }
120232
120233 var name = this.name(det);
120234 return bestConfidenceSoFar <= 0 ? null : new Match(det, this, bestConfidenceSoFar, name, lang);
120235};
120236
120237
120238module.exports.ISO_8859_1 = function() {
120239 this.byteMap = function() {
120240 return [
120241 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120242 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120243 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120244 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120245 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
120246 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120247 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120248 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120249 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120250 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120251 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120252 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120253 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120254 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120255 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120256 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120257 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120258 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120259 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120260 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120261 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120262 0x20, 0x20, 0xAA, 0x20, 0x20, 0x20, 0x20, 0x20,
120263 0x20, 0x20, 0x20, 0x20, 0x20, 0xB5, 0x20, 0x20,
120264 0x20, 0x20, 0xBA, 0x20, 0x20, 0x20, 0x20, 0x20,
120265 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120266 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120267 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20,
120268 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xDF,
120269 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120270 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120271 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20,
120272 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF
120273 ];
120274 };
120275
120276 this.ngrams = function() {
120277 return [
120278 new NGramsPlusLang('da', [
120279 0x206166, 0x206174, 0x206465, 0x20656E, 0x206572, 0x20666F, 0x206861, 0x206920,
120280 0x206D65, 0x206F67, 0x2070E5, 0x207369, 0x207374, 0x207469, 0x207669, 0x616620,
120281 0x616E20, 0x616E64, 0x617220, 0x617420, 0x646520, 0x64656E, 0x646572, 0x646574,
120282 0x652073, 0x656420, 0x656465, 0x656E20, 0x656E64, 0x657220, 0x657265, 0x657320,
120283 0x657420, 0x666F72, 0x676520, 0x67656E, 0x676572, 0x696765, 0x696C20, 0x696E67,
120284 0x6B6520, 0x6B6B65, 0x6C6572, 0x6C6967, 0x6C6C65, 0x6D6564, 0x6E6465, 0x6E6520,
120285 0x6E6720, 0x6E6765, 0x6F6720, 0x6F6D20, 0x6F7220, 0x70E520, 0x722064, 0x722065,
120286 0x722073, 0x726520, 0x737465, 0x742073, 0x746520, 0x746572, 0x74696C, 0x766572
120287 ]),
120288 new NGramsPlusLang('de', [
120289 0x20616E, 0x206175, 0x206265, 0x206461, 0x206465, 0x206469, 0x206569, 0x206765,
120290 0x206861, 0x20696E, 0x206D69, 0x207363, 0x207365, 0x20756E, 0x207665, 0x20766F,
120291 0x207765, 0x207A75, 0x626572, 0x636820, 0x636865, 0x636874, 0x646173, 0x64656E,
120292 0x646572, 0x646965, 0x652064, 0x652073, 0x65696E, 0x656974, 0x656E20, 0x657220,
120293 0x657320, 0x67656E, 0x68656E, 0x687420, 0x696368, 0x696520, 0x696E20, 0x696E65,
120294 0x697420, 0x6C6963, 0x6C6C65, 0x6E2061, 0x6E2064, 0x6E2073, 0x6E6420, 0x6E6465,
120295 0x6E6520, 0x6E6720, 0x6E6765, 0x6E7465, 0x722064, 0x726465, 0x726569, 0x736368,
120296 0x737465, 0x742064, 0x746520, 0x74656E, 0x746572, 0x756E64, 0x756E67, 0x766572
120297 ]),
120298 new NGramsPlusLang('en', [
120299 0x206120, 0x20616E, 0x206265, 0x20636F, 0x20666F, 0x206861, 0x206865, 0x20696E,
120300 0x206D61, 0x206F66, 0x207072, 0x207265, 0x207361, 0x207374, 0x207468, 0x20746F,
120301 0x207768, 0x616964, 0x616C20, 0x616E20, 0x616E64, 0x617320, 0x617420, 0x617465,
120302 0x617469, 0x642061, 0x642074, 0x652061, 0x652073, 0x652074, 0x656420, 0x656E74,
120303 0x657220, 0x657320, 0x666F72, 0x686174, 0x686520, 0x686572, 0x696420, 0x696E20,
120304 0x696E67, 0x696F6E, 0x697320, 0x6E2061, 0x6E2074, 0x6E6420, 0x6E6720, 0x6E7420,
120305 0x6F6620, 0x6F6E20, 0x6F7220, 0x726520, 0x727320, 0x732061, 0x732074, 0x736169,
120306 0x737420, 0x742074, 0x746572, 0x746861, 0x746865, 0x74696F, 0x746F20, 0x747320
120307 ]),
120308 new NGramsPlusLang('es', [
120309 0x206120, 0x206361, 0x20636F, 0x206465, 0x20656C, 0x20656E, 0x206573, 0x20696E,
120310 0x206C61, 0x206C6F, 0x207061, 0x20706F, 0x207072, 0x207175, 0x207265, 0x207365,
120311 0x20756E, 0x207920, 0x612063, 0x612064, 0x612065, 0x61206C, 0x612070, 0x616369,
120312 0x61646F, 0x616C20, 0x617220, 0x617320, 0x6369F3, 0x636F6E, 0x646520, 0x64656C,
120313 0x646F20, 0x652064, 0x652065, 0x65206C, 0x656C20, 0x656E20, 0x656E74, 0x657320,
120314 0x657374, 0x69656E, 0x69F36E, 0x6C6120, 0x6C6F73, 0x6E2065, 0x6E7465, 0x6F2064,
120315 0x6F2065, 0x6F6E20, 0x6F7220, 0x6F7320, 0x706172, 0x717565, 0x726120, 0x726573,
120316 0x732064, 0x732065, 0x732070, 0x736520, 0x746520, 0x746F20, 0x756520, 0xF36E20
120317 ]),
120318 new NGramsPlusLang('fr', [
120319 0x206175, 0x20636F, 0x206461, 0x206465, 0x206475, 0x20656E, 0x206574, 0x206C61,
120320 0x206C65, 0x207061, 0x20706F, 0x207072, 0x207175, 0x207365, 0x20736F, 0x20756E,
120321 0x20E020, 0x616E74, 0x617469, 0x636520, 0x636F6E, 0x646520, 0x646573, 0x647520,
120322 0x652061, 0x652063, 0x652064, 0x652065, 0x65206C, 0x652070, 0x652073, 0x656E20,
120323 0x656E74, 0x657220, 0x657320, 0x657420, 0x657572, 0x696F6E, 0x697320, 0x697420,
120324 0x6C6120, 0x6C6520, 0x6C6573, 0x6D656E, 0x6E2064, 0x6E6520, 0x6E7320, 0x6E7420,
120325 0x6F6E20, 0x6F6E74, 0x6F7572, 0x717565, 0x72206C, 0x726520, 0x732061, 0x732064,
120326 0x732065, 0x73206C, 0x732070, 0x742064, 0x746520, 0x74696F, 0x756520, 0x757220
120327 ]),
120328 new NGramsPlusLang('it', [
120329 0x20616C, 0x206368, 0x20636F, 0x206465, 0x206469, 0x206520, 0x20696C, 0x20696E,
120330 0x206C61, 0x207065, 0x207072, 0x20756E, 0x612063, 0x612064, 0x612070, 0x612073,
120331 0x61746F, 0x636865, 0x636F6E, 0x64656C, 0x646920, 0x652061, 0x652063, 0x652064,
120332 0x652069, 0x65206C, 0x652070, 0x652073, 0x656C20, 0x656C6C, 0x656E74, 0x657220,
120333 0x686520, 0x692061, 0x692063, 0x692064, 0x692073, 0x696120, 0x696C20, 0x696E20,
120334 0x696F6E, 0x6C6120, 0x6C6520, 0x6C6920, 0x6C6C61, 0x6E6520, 0x6E6920, 0x6E6F20,
120335 0x6E7465, 0x6F2061, 0x6F2064, 0x6F2069, 0x6F2073, 0x6F6E20, 0x6F6E65, 0x706572,
120336 0x726120, 0x726520, 0x736920, 0x746120, 0x746520, 0x746920, 0x746F20, 0x7A696F
120337 ]),
120338 new NGramsPlusLang('nl', [
120339 0x20616C, 0x206265, 0x206461, 0x206465, 0x206469, 0x206565, 0x20656E, 0x206765,
120340 0x206865, 0x20696E, 0x206D61, 0x206D65, 0x206F70, 0x207465, 0x207661, 0x207665,
120341 0x20766F, 0x207765, 0x207A69, 0x61616E, 0x616172, 0x616E20, 0x616E64, 0x617220,
120342 0x617420, 0x636874, 0x646520, 0x64656E, 0x646572, 0x652062, 0x652076, 0x65656E,
120343 0x656572, 0x656E20, 0x657220, 0x657273, 0x657420, 0x67656E, 0x686574, 0x696520,
120344 0x696E20, 0x696E67, 0x697320, 0x6E2062, 0x6E2064, 0x6E2065, 0x6E2068, 0x6E206F,
120345 0x6E2076, 0x6E6465, 0x6E6720, 0x6F6E64, 0x6F6F72, 0x6F7020, 0x6F7220, 0x736368,
120346 0x737465, 0x742064, 0x746520, 0x74656E, 0x746572, 0x76616E, 0x766572, 0x766F6F
120347 ]),
120348 new NGramsPlusLang('no', [
120349 0x206174, 0x206176, 0x206465, 0x20656E, 0x206572, 0x20666F, 0x206861, 0x206920,
120350 0x206D65, 0x206F67, 0x2070E5, 0x207365, 0x20736B, 0x20736F, 0x207374, 0x207469,
120351 0x207669, 0x20E520, 0x616E64, 0x617220, 0x617420, 0x646520, 0x64656E, 0x646574,
120352 0x652073, 0x656420, 0x656E20, 0x656E65, 0x657220, 0x657265, 0x657420, 0x657474,
120353 0x666F72, 0x67656E, 0x696B6B, 0x696C20, 0x696E67, 0x6B6520, 0x6B6B65, 0x6C6520,
120354 0x6C6C65, 0x6D6564, 0x6D656E, 0x6E2073, 0x6E6520, 0x6E6720, 0x6E6765, 0x6E6E65,
120355 0x6F6720, 0x6F6D20, 0x6F7220, 0x70E520, 0x722073, 0x726520, 0x736F6D, 0x737465,
120356 0x742073, 0x746520, 0x74656E, 0x746572, 0x74696C, 0x747420, 0x747465, 0x766572
120357 ]),
120358 new NGramsPlusLang('pt', [
120359 0x206120, 0x20636F, 0x206461, 0x206465, 0x20646F, 0x206520, 0x206573, 0x206D61,
120360 0x206E6F, 0x206F20, 0x207061, 0x20706F, 0x207072, 0x207175, 0x207265, 0x207365,
120361 0x20756D, 0x612061, 0x612063, 0x612064, 0x612070, 0x616465, 0x61646F, 0x616C20,
120362 0x617220, 0x617261, 0x617320, 0x636F6D, 0x636F6E, 0x646120, 0x646520, 0x646F20,
120363 0x646F73, 0x652061, 0x652064, 0x656D20, 0x656E74, 0x657320, 0x657374, 0x696120,
120364 0x696361, 0x6D656E, 0x6E7465, 0x6E746F, 0x6F2061, 0x6F2063, 0x6F2064, 0x6F2065,
120365 0x6F2070, 0x6F7320, 0x706172, 0x717565, 0x726120, 0x726573, 0x732061, 0x732064,
120366 0x732065, 0x732070, 0x737461, 0x746520, 0x746F20, 0x756520, 0xE36F20, 0xE7E36F
120367 ]),
120368 new NGramsPlusLang('sv', [
120369 0x206174, 0x206176, 0x206465, 0x20656E, 0x2066F6, 0x206861, 0x206920, 0x20696E,
120370 0x206B6F, 0x206D65, 0x206F63, 0x2070E5, 0x20736B, 0x20736F, 0x207374, 0x207469,
120371 0x207661, 0x207669, 0x20E472, 0x616465, 0x616E20, 0x616E64, 0x617220, 0x617474,
120372 0x636820, 0x646520, 0x64656E, 0x646572, 0x646574, 0x656420, 0x656E20, 0x657220,
120373 0x657420, 0x66F672, 0x67656E, 0x696C6C, 0x696E67, 0x6B6120, 0x6C6C20, 0x6D6564,
120374 0x6E2073, 0x6E6120, 0x6E6465, 0x6E6720, 0x6E6765, 0x6E696E, 0x6F6368, 0x6F6D20,
120375 0x6F6E20, 0x70E520, 0x722061, 0x722073, 0x726120, 0x736B61, 0x736F6D, 0x742073,
120376 0x746120, 0x746520, 0x746572, 0x74696C, 0x747420, 0x766172, 0xE47220, 0xF67220,
120377 ])
120378 ];
120379 };
120380
120381 this.name = function(det) {
120382 return (det && det.fC1Bytes) ? 'windows-1252' : 'ISO-8859-1';
120383 };
120384};
120385util.inherits(module.exports.ISO_8859_1, sbcs);
120386
120387
120388module.exports.ISO_8859_2 = function() {
120389 this.byteMap = function() {
120390 return [
120391 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120392 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120393 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120394 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120395 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
120396 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120397 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120398 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120399 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120400 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120401 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120402 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120403 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120404 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120405 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120406 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120407 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120408 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120409 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120410 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120411 0x20, 0xB1, 0x20, 0xB3, 0x20, 0xB5, 0xB6, 0x20,
120412 0x20, 0xB9, 0xBA, 0xBB, 0xBC, 0x20, 0xBE, 0xBF,
120413 0x20, 0xB1, 0x20, 0xB3, 0x20, 0xB5, 0xB6, 0xB7,
120414 0x20, 0xB9, 0xBA, 0xBB, 0xBC, 0x20, 0xBE, 0xBF,
120415 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120416 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120417 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20,
120418 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xDF,
120419 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120420 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120421 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20,
120422 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0x20
120423 ];
120424 }
120425
120426 this.ngrams = function() {
120427 return [
120428 new NGramsPlusLang('cs', [
120429 0x206120, 0x206279, 0x20646F, 0x206A65, 0x206E61, 0x206E65, 0x206F20, 0x206F64,
120430 0x20706F, 0x207072, 0x2070F8, 0x20726F, 0x207365, 0x20736F, 0x207374, 0x20746F,
120431 0x207620, 0x207679, 0x207A61, 0x612070, 0x636520, 0x636820, 0x652070, 0x652073,
120432 0x652076, 0x656D20, 0x656EED, 0x686F20, 0x686F64, 0x697374, 0x6A6520, 0x6B7465,
120433 0x6C6520, 0x6C6920, 0x6E6120, 0x6EE920, 0x6EEC20, 0x6EED20, 0x6F2070, 0x6F646E,
120434 0x6F6A69, 0x6F7374, 0x6F7520, 0x6F7661, 0x706F64, 0x706F6A, 0x70726F, 0x70F865,
120435 0x736520, 0x736F75, 0x737461, 0x737469, 0x73746E, 0x746572, 0x746EED, 0x746F20,
120436 0x752070, 0xBE6520, 0xE16EED, 0xE9686F, 0xED2070, 0xED2073, 0xED6D20, 0xF86564,
120437 ]),
120438 new NGramsPlusLang('hu', [
120439 0x206120, 0x20617A, 0x206265, 0x206567, 0x20656C, 0x206665, 0x206861, 0x20686F,
120440 0x206973, 0x206B65, 0x206B69, 0x206BF6, 0x206C65, 0x206D61, 0x206D65, 0x206D69,
120441 0x206E65, 0x20737A, 0x207465, 0x20E973, 0x612061, 0x61206B, 0x61206D, 0x612073,
120442 0x616B20, 0x616E20, 0x617A20, 0x62616E, 0x62656E, 0x656779, 0x656B20, 0x656C20,
120443 0x656C65, 0x656D20, 0x656E20, 0x657265, 0x657420, 0x657465, 0x657474, 0x677920,
120444 0x686F67, 0x696E74, 0x697320, 0x6B2061, 0x6BF67A, 0x6D6567, 0x6D696E, 0x6E2061,
120445 0x6E616B, 0x6E656B, 0x6E656D, 0x6E7420, 0x6F6779, 0x732061, 0x737A65, 0x737A74,
120446 0x737AE1, 0x73E967, 0x742061, 0x747420, 0x74E173, 0x7A6572, 0xE16E20, 0xE97320,
120447 ]),
120448 new NGramsPlusLang('pl', [
120449 0x20637A, 0x20646F, 0x206920, 0x206A65, 0x206B6F, 0x206D61, 0x206D69, 0x206E61,
120450 0x206E69, 0x206F64, 0x20706F, 0x207072, 0x207369, 0x207720, 0x207769, 0x207779,
120451 0x207A20, 0x207A61, 0x612070, 0x612077, 0x616E69, 0x636820, 0x637A65, 0x637A79,
120452 0x646F20, 0x647A69, 0x652070, 0x652073, 0x652077, 0x65207A, 0x65676F, 0x656A20,
120453 0x656D20, 0x656E69, 0x676F20, 0x696120, 0x696520, 0x69656A, 0x6B6120, 0x6B6920,
120454 0x6B6965, 0x6D6965, 0x6E6120, 0x6E6961, 0x6E6965, 0x6F2070, 0x6F7761, 0x6F7769,
120455 0x706F6C, 0x707261, 0x70726F, 0x70727A, 0x727A65, 0x727A79, 0x7369EA, 0x736B69,
120456 0x737461, 0x776965, 0x796368, 0x796D20, 0x7A6520, 0x7A6965, 0x7A7920, 0xF37720,
120457 ]),
120458 new NGramsPlusLang('ro', [
120459 0x206120, 0x206163, 0x206361, 0x206365, 0x20636F, 0x206375, 0x206465, 0x206469,
120460 0x206C61, 0x206D61, 0x207065, 0x207072, 0x207365, 0x2073E3, 0x20756E, 0x20BA69,
120461 0x20EE6E, 0x612063, 0x612064, 0x617265, 0x617420, 0x617465, 0x617520, 0x636172,
120462 0x636F6E, 0x637520, 0x63E320, 0x646520, 0x652061, 0x652063, 0x652064, 0x652070,
120463 0x652073, 0x656120, 0x656920, 0x656C65, 0x656E74, 0x657374, 0x692061, 0x692063,
120464 0x692064, 0x692070, 0x696520, 0x696920, 0x696E20, 0x6C6120, 0x6C6520, 0x6C6F72,
120465 0x6C7569, 0x6E6520, 0x6E7472, 0x6F7220, 0x70656E, 0x726520, 0x726561, 0x727520,
120466 0x73E320, 0x746520, 0x747275, 0x74E320, 0x756920, 0x756C20, 0xBA6920, 0xEE6E20,
120467 ])
120468 ];
120469 };
120470
120471 this.name = function(det) {
120472 return (det && det.fC1Bytes) ? 'windows-1250' : 'ISO-8859-2';
120473 };
120474};
120475util.inherits(module.exports.ISO_8859_2, sbcs);
120476
120477
120478module.exports.ISO_8859_5 = function() {
120479 this.byteMap = function() {
120480 return [
120481 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120482 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120483 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120484 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120485 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
120486 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120487 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120488 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120489 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120490 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120491 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120492 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120493 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120494 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120495 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120496 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120497 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120498 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120499 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120500 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120501 0x20, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
120502 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0x20, 0xFE, 0xFF,
120503 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
120504 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
120505 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120506 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120507 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
120508 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
120509 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120510 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120511 0x20, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
120512 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0x20, 0xFE, 0xFF
120513 ];
120514 };
120515
120516 this.ngrams = function() {
120517 return [
120518 0x20D220, 0x20D2DE, 0x20D4DE, 0x20D7D0, 0x20D820, 0x20DAD0, 0x20DADE, 0x20DDD0,
120519 0x20DDD5, 0x20DED1, 0x20DFDE, 0x20DFE0, 0x20E0D0, 0x20E1DE, 0x20E1E2, 0x20E2DE,
120520 0x20E7E2, 0x20EDE2, 0xD0DDD8, 0xD0E2EC, 0xD3DE20, 0xD5DBEC, 0xD5DDD8, 0xD5E1E2,
120521 0xD5E220, 0xD820DF, 0xD8D520, 0xD8D820, 0xD8EF20, 0xDBD5DD, 0xDBD820, 0xDBECDD,
120522 0xDDD020, 0xDDD520, 0xDDD8D5, 0xDDD8EF, 0xDDDE20, 0xDDDED2, 0xDE20D2, 0xDE20DF,
120523 0xDE20E1, 0xDED220, 0xDED2D0, 0xDED3DE, 0xDED920, 0xDEDBEC, 0xDEDC20, 0xDEE1E2,
120524 0xDFDEDB, 0xDFE0D5, 0xDFE0D8, 0xDFE0DE, 0xE0D0D2, 0xE0D5D4, 0xE1E2D0, 0xE1E2D2,
120525 0xE1E2D8, 0xE1EF20, 0xE2D5DB, 0xE2DE20, 0xE2DEE0, 0xE2EC20, 0xE7E2DE, 0xEBE520
120526 ];
120527 };
120528
120529 this.name = function(det) {
120530 return 'ISO-8859-5';
120531 };
120532
120533 this.language = function() {
120534 return 'ru';
120535 };
120536};
120537util.inherits(module.exports.ISO_8859_5, sbcs);
120538
120539
120540module.exports.ISO_8859_6 = function() {
120541 this.byteMap = function() {
120542 return [
120543 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120544 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120545 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120546 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120547 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
120548 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120549 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120550 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120551 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120552 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120553 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120554 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120555 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120556 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120557 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120558 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120559 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120560 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120561 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120562 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120563 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120564 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120565 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120566 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120567 0x20, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
120568 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
120569 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
120570 0xD8, 0xD9, 0xDA, 0x20, 0x20, 0x20, 0x20, 0x20,
120571 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120572 0xE8, 0xE9, 0xEA, 0x20, 0x20, 0x20, 0x20, 0x20,
120573 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120574 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20
120575 ];
120576 };
120577
120578 this.ngrams = function() {
120579 return [
120580 0x20C7E4, 0x20C7E6, 0x20C8C7, 0x20D9E4, 0x20E1EA, 0x20E4E4, 0x20E5E6, 0x20E8C7,
120581 0xC720C7, 0xC7C120, 0xC7CA20, 0xC7D120, 0xC7E420, 0xC7E4C3, 0xC7E4C7, 0xC7E4C8,
120582 0xC7E4CA, 0xC7E4CC, 0xC7E4CD, 0xC7E4CF, 0xC7E4D3, 0xC7E4D9, 0xC7E4E2, 0xC7E4E5,
120583 0xC7E4E8, 0xC7E4EA, 0xC7E520, 0xC7E620, 0xC7E6CA, 0xC820C7, 0xC920C7, 0xC920E1,
120584 0xC920E4, 0xC920E5, 0xC920E8, 0xCA20C7, 0xCF20C7, 0xCFC920, 0xD120C7, 0xD1C920,
120585 0xD320C7, 0xD920C7, 0xD9E4E9, 0xE1EA20, 0xE420C7, 0xE4C920, 0xE4E920, 0xE4EA20,
120586 0xE520C7, 0xE5C720, 0xE5C920, 0xE5E620, 0xE620C7, 0xE720C7, 0xE7C720, 0xE8C7E4,
120587 0xE8E620, 0xE920C7, 0xEA20C7, 0xEA20E5, 0xEA20E8, 0xEAC920, 0xEAD120, 0xEAE620
120588 ];
120589 };
120590
120591 this.name = function(det) {
120592 return 'ISO-8859-6';
120593 };
120594
120595 this.language = function() {
120596 return 'ar';
120597 };
120598};
120599util.inherits(module.exports.ISO_8859_6, sbcs);
120600
120601
120602module.exports.ISO_8859_7 = function() {
120603 this.byteMap = function() {
120604 return [
120605 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120606 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120607 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120608 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120609 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
120610 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120611 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120612 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120613 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120614 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120615 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120616 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120617 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120618 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120619 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120620 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120621 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120622 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120623 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120624 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120625 0x20, 0xA1, 0xA2, 0x20, 0x20, 0x20, 0x20, 0x20,
120626 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120627 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xDC, 0x20,
120628 0xDD, 0xDE, 0xDF, 0x20, 0xFC, 0x20, 0xFD, 0xFE,
120629 0xC0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120630 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120631 0xF0, 0xF1, 0x20, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
120632 0xF8, 0xF9, 0xFA, 0xFB, 0xDC, 0xDD, 0xDE, 0xDF,
120633 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120634 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120635 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
120636 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0x20
120637 ];
120638 };
120639
120640 this.ngrams = function() {
120641 return [
120642 0x20E1ED, 0x20E1F0, 0x20E3E9, 0x20E4E9, 0x20E5F0, 0x20E720, 0x20EAE1, 0x20ECE5,
120643 0x20EDE1, 0x20EF20, 0x20F0E1, 0x20F0EF, 0x20F0F1, 0x20F3F4, 0x20F3F5, 0x20F4E7,
120644 0x20F4EF, 0xDFE120, 0xE120E1, 0xE120F4, 0xE1E920, 0xE1ED20, 0xE1F0FC, 0xE1F220,
120645 0xE3E9E1, 0xE5E920, 0xE5F220, 0xE720F4, 0xE7ED20, 0xE7F220, 0xE920F4, 0xE9E120,
120646 0xE9EADE, 0xE9F220, 0xEAE1E9, 0xEAE1F4, 0xECE520, 0xED20E1, 0xED20E5, 0xED20F0,
120647 0xEDE120, 0xEFF220, 0xEFF520, 0xF0EFF5, 0xF0F1EF, 0xF0FC20, 0xF220E1, 0xF220E5,
120648 0xF220EA, 0xF220F0, 0xF220F4, 0xF3E520, 0xF3E720, 0xF3F4EF, 0xF4E120, 0xF4E1E9,
120649 0xF4E7ED, 0xF4E7F2, 0xF4E9EA, 0xF4EF20, 0xF4EFF5, 0xF4F9ED, 0xF9ED20, 0xFEED20
120650 ];
120651 };
120652
120653 this.name = function(det) {
120654 return (det && det.fC1Bytes) ? 'windows-1253' : 'ISO-8859-7';
120655 };
120656
120657 this.language = function() {
120658 return 'el';
120659 };
120660};
120661util.inherits(module.exports.ISO_8859_7, sbcs);
120662
120663module.exports.ISO_8859_8 = function() {
120664
120665 this.byteMap = function() {
120666 return [
120667 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120668 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120669 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120670 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120671 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
120672 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120673 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120674 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120675 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120676 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120677 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120678 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120679 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120680 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120681 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120682 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120683 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120684 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120685 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120686 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120687 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120688 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120689 0x20, 0x20, 0x20, 0x20, 0x20, 0xB5, 0x20, 0x20,
120690 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120691 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120692 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120693 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120694 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120695 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120696 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120697 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
120698 0xF8, 0xF9, 0xFA, 0x20, 0x20, 0x20, 0x20, 0x20
120699 ];
120700 };
120701
120702 this.ngrams = function() {
120703 return [
120704 new NGramsPlusLang('he', [
120705 0x20E0E5, 0x20E0E7, 0x20E0E9, 0x20E0FA, 0x20E1E9, 0x20E1EE, 0x20E4E0, 0x20E4E5,
120706 0x20E4E9, 0x20E4EE, 0x20E4F2, 0x20E4F9, 0x20E4FA, 0x20ECE0, 0x20ECE4, 0x20EEE0,
120707 0x20F2EC, 0x20F9EC, 0xE0FA20, 0xE420E0, 0xE420E1, 0xE420E4, 0xE420EC, 0xE420EE,
120708 0xE420F9, 0xE4E5E0, 0xE5E020, 0xE5ED20, 0xE5EF20, 0xE5F820, 0xE5FA20, 0xE920E4,
120709 0xE9E420, 0xE9E5FA, 0xE9E9ED, 0xE9ED20, 0xE9EF20, 0xE9F820, 0xE9FA20, 0xEC20E0,
120710 0xEC20E4, 0xECE020, 0xECE420, 0xED20E0, 0xED20E1, 0xED20E4, 0xED20EC, 0xED20EE,
120711 0xED20F9, 0xEEE420, 0xEF20E4, 0xF0E420, 0xF0E920, 0xF0E9ED, 0xF2EC20, 0xF820E4,
120712 0xF8E9ED, 0xF9EC20, 0xFA20E0, 0xFA20E1, 0xFA20E4, 0xFA20EC, 0xFA20EE, 0xFA20F9,
120713 ]),
120714 new NGramsPlusLang('he', [
120715 0x20E0E5, 0x20E0EC, 0x20E4E9, 0x20E4EC, 0x20E4EE, 0x20E4F0, 0x20E9F0, 0x20ECF2,
120716 0x20ECF9, 0x20EDE5, 0x20EDE9, 0x20EFE5, 0x20EFE9, 0x20F8E5, 0x20F8E9, 0x20FAE0,
120717 0x20FAE5, 0x20FAE9, 0xE020E4, 0xE020EC, 0xE020ED, 0xE020FA, 0xE0E420, 0xE0E5E4,
120718 0xE0EC20, 0xE0EE20, 0xE120E4, 0xE120ED, 0xE120FA, 0xE420E4, 0xE420E9, 0xE420EC,
120719 0xE420ED, 0xE420EF, 0xE420F8, 0xE420FA, 0xE4EC20, 0xE5E020, 0xE5E420, 0xE7E020,
120720 0xE9E020, 0xE9E120, 0xE9E420, 0xEC20E4, 0xEC20ED, 0xEC20FA, 0xECF220, 0xECF920,
120721 0xEDE9E9, 0xEDE9F0, 0xEDE9F8, 0xEE20E4, 0xEE20ED, 0xEE20FA, 0xEEE120, 0xEEE420,
120722 0xF2E420, 0xF920E4, 0xF920ED, 0xF920FA, 0xF9E420, 0xFAE020, 0xFAE420, 0xFAE5E9,
120723 ])
120724 ];
120725 };
120726
120727 this.name = function(det) {
120728 return (det && det.fC1Bytes) ? 'windows-1255' : 'ISO-8859-8';
120729 };
120730
120731 this.language = function() {
120732 return 'he';
120733 };
120734
120735};
120736util.inherits(module.exports.ISO_8859_8, sbcs);
120737
120738
120739module.exports.ISO_8859_9 = function() {
120740 this.byteMap = function() {
120741 return [
120742 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120743 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120744 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120745 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120746 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
120747 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120748 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120749 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120750 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120751 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120752 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120753 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120754 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120755 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120756 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120757 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120758 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120759 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120760 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120761 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120762 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120763 0x20, 0x20, 0xAA, 0x20, 0x20, 0x20, 0x20, 0x20,
120764 0x20, 0x20, 0x20, 0x20, 0x20, 0xB5, 0x20, 0x20,
120765 0x20, 0x20, 0xBA, 0x20, 0x20, 0x20, 0x20, 0x20,
120766 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120767 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120768 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20,
120769 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0x69, 0xFE, 0xDF,
120770 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120771 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120772 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0x20,
120773 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF
120774 ];
120775 };
120776
120777 this.ngrams = function() {
120778 return [
120779 0x206261, 0x206269, 0x206275, 0x206461, 0x206465, 0x206765, 0x206861, 0x20696C,
120780 0x206B61, 0x206B6F, 0x206D61, 0x206F6C, 0x207361, 0x207461, 0x207665, 0x207961,
120781 0x612062, 0x616B20, 0x616C61, 0x616D61, 0x616E20, 0x616EFD, 0x617220, 0x617261,
120782 0x6172FD, 0x6173FD, 0x617961, 0x626972, 0x646120, 0x646520, 0x646920, 0x652062,
120783 0x65206B, 0x656469, 0x656E20, 0x657220, 0x657269, 0x657369, 0x696C65, 0x696E20,
120784 0x696E69, 0x697220, 0x6C616E, 0x6C6172, 0x6C6520, 0x6C6572, 0x6E2061, 0x6E2062,
120785 0x6E206B, 0x6E6461, 0x6E6465, 0x6E6520, 0x6E6920, 0x6E696E, 0x6EFD20, 0x72696E,
120786 0x72FD6E, 0x766520, 0x796120, 0x796F72, 0xFD6E20, 0xFD6E64, 0xFD6EFD, 0xFDF0FD
120787 ];
120788 };
120789
120790 this.name = function(det) {
120791 return (det && det.fC1Bytes) ? 'windows-1254' : 'ISO-8859-9';
120792 };
120793
120794 this.language = function() {
120795 return 'tr';
120796 };
120797};
120798util.inherits(module.exports.ISO_8859_9, sbcs);
120799
120800
120801module.exports.windows_1251 = function() {
120802 this.byteMap = function() {
120803 return [
120804 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120805 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120806 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120807 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120808 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
120809 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120810 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120811 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120812 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120813 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120814 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120815 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120816 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120817 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120818 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120819 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120820 0x90, 0x83, 0x20, 0x83, 0x20, 0x20, 0x20, 0x20,
120821 0x20, 0x20, 0x9A, 0x20, 0x9C, 0x9D, 0x9E, 0x9F,
120822 0x90, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120823 0x20, 0x20, 0x9A, 0x20, 0x9C, 0x9D, 0x9E, 0x9F,
120824 0x20, 0xA2, 0xA2, 0xBC, 0x20, 0xB4, 0x20, 0x20,
120825 0xB8, 0x20, 0xBA, 0x20, 0x20, 0x20, 0x20, 0xBF,
120826 0x20, 0x20, 0xB3, 0xB3, 0xB4, 0xB5, 0x20, 0x20,
120827 0xB8, 0x20, 0xBA, 0x20, 0xBC, 0xBE, 0xBE, 0xBF,
120828 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120829 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120830 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
120831 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF,
120832 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120833 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120834 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6, 0xF7,
120835 0xF8, 0xF9, 0xFA, 0xFB, 0xFC, 0xFD, 0xFE, 0xFF
120836 ];
120837 };
120838
120839 this.ngrams = function() {
120840 return [
120841 0x20E220, 0x20E2EE, 0x20E4EE, 0x20E7E0, 0x20E820, 0x20EAE0, 0x20EAEE, 0x20EDE0,
120842 0x20EDE5, 0x20EEE1, 0x20EFEE, 0x20EFF0, 0x20F0E0, 0x20F1EE, 0x20F1F2, 0x20F2EE,
120843 0x20F7F2, 0x20FDF2, 0xE0EDE8, 0xE0F2FC, 0xE3EE20, 0xE5EBFC, 0xE5EDE8, 0xE5F1F2,
120844 0xE5F220, 0xE820EF, 0xE8E520, 0xE8E820, 0xE8FF20, 0xEBE5ED, 0xEBE820, 0xEBFCED,
120845 0xEDE020, 0xEDE520, 0xEDE8E5, 0xEDE8FF, 0xEDEE20, 0xEDEEE2, 0xEE20E2, 0xEE20EF,
120846 0xEE20F1, 0xEEE220, 0xEEE2E0, 0xEEE3EE, 0xEEE920, 0xEEEBFC, 0xEEEC20, 0xEEF1F2,
120847 0xEFEEEB, 0xEFF0E5, 0xEFF0E8, 0xEFF0EE, 0xF0E0E2, 0xF0E5E4, 0xF1F2E0, 0xF1F2E2,
120848 0xF1F2E8, 0xF1FF20, 0xF2E5EB, 0xF2EE20, 0xF2EEF0, 0xF2FC20, 0xF7F2EE, 0xFBF520
120849 ];
120850 };
120851
120852 this.name = function(det) {
120853 return 'windows-1251';
120854 };
120855
120856 this.language = function() {
120857 return 'ru';
120858 };
120859};
120860util.inherits(module.exports.windows_1251, sbcs);
120861
120862
120863module.exports.windows_1256 = function() {
120864 this.byteMap = function() {
120865 return [
120866 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120867 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120868 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120869 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120870 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
120871 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120872 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120873 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120874 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120875 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120876 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120877 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120878 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120879 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120880 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120881 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120882 0x20, 0x81, 0x20, 0x83, 0x20, 0x20, 0x20, 0x20,
120883 0x88, 0x20, 0x8A, 0x20, 0x9C, 0x8D, 0x8E, 0x8F,
120884 0x90, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120885 0x98, 0x20, 0x9A, 0x20, 0x9C, 0x20, 0x20, 0x9F,
120886 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120887 0x20, 0x20, 0xAA, 0x20, 0x20, 0x20, 0x20, 0x20,
120888 0x20, 0x20, 0x20, 0x20, 0x20, 0xB5, 0x20, 0x20,
120889 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120890 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
120891 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
120892 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0x20,
120893 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
120894 0xE0, 0xE1, 0xE2, 0xE3, 0xE4, 0xE5, 0xE6, 0xE7,
120895 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE, 0xEF,
120896 0x20, 0x20, 0x20, 0x20, 0xF4, 0x20, 0x20, 0x20,
120897 0x20, 0xF9, 0x20, 0xFB, 0xFC, 0x20, 0x20, 0xFF
120898 ];
120899 };
120900
120901 this.ngrams = function() {
120902 return [
120903 0x20C7E1, 0x20C7E4, 0x20C8C7, 0x20DAE1, 0x20DDED, 0x20E1E1, 0x20E3E4, 0x20E6C7,
120904 0xC720C7, 0xC7C120, 0xC7CA20, 0xC7D120, 0xC7E120, 0xC7E1C3, 0xC7E1C7, 0xC7E1C8,
120905 0xC7E1CA, 0xC7E1CC, 0xC7E1CD, 0xC7E1CF, 0xC7E1D3, 0xC7E1DA, 0xC7E1DE, 0xC7E1E3,
120906 0xC7E1E6, 0xC7E1ED, 0xC7E320, 0xC7E420, 0xC7E4CA, 0xC820C7, 0xC920C7, 0xC920DD,
120907 0xC920E1, 0xC920E3, 0xC920E6, 0xCA20C7, 0xCF20C7, 0xCFC920, 0xD120C7, 0xD1C920,
120908 0xD320C7, 0xDA20C7, 0xDAE1EC, 0xDDED20, 0xE120C7, 0xE1C920, 0xE1EC20, 0xE1ED20,
120909 0xE320C7, 0xE3C720, 0xE3C920, 0xE3E420, 0xE420C7, 0xE520C7, 0xE5C720, 0xE6C7E1,
120910 0xE6E420, 0xEC20C7, 0xED20C7, 0xED20E3, 0xED20E6, 0xEDC920, 0xEDD120, 0xEDE420
120911 ];
120912 };
120913
120914 this.name = function(det) {
120915 return 'windows-1256';
120916 };
120917
120918 this.language = function() {
120919 return 'ar';
120920 };
120921};
120922util.inherits(module.exports.windows_1256, sbcs);
120923
120924
120925module.exports.KOI8_R = function() {
120926 this.byteMap = function() {
120927 return [
120928 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120929 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120930 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120931 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120932 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00,
120933 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120934 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120935 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120936 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120937 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120938 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120939 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120940 0x20, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
120941 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0x6D, 0x6E, 0x6F,
120942 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
120943 0x78, 0x79, 0x7A, 0x20, 0x20, 0x20, 0x20, 0x20,
120944 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120945 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120946 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120947 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120948 0x20, 0x20, 0x20, 0xA3, 0x20, 0x20, 0x20, 0x20,
120949 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120950 0x20, 0x20, 0x20, 0xA3, 0x20, 0x20, 0x20, 0x20,
120951 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
120952 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
120953 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
120954 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
120955 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF,
120956 0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7,
120957 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF,
120958 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0xD5, 0xD6, 0xD7,
120959 0xD8, 0xD9, 0xDA, 0xDB, 0xDC, 0xDD, 0xDE, 0xDF
120960 ];
120961 };
120962
120963 this.ngrams = function() {
120964 return [
120965 0x20C4CF, 0x20C920, 0x20CBC1, 0x20CBCF, 0x20CEC1, 0x20CEC5, 0x20CFC2, 0x20D0CF,
120966 0x20D0D2, 0x20D2C1, 0x20D3CF, 0x20D3D4, 0x20D4CF, 0x20D720, 0x20D7CF, 0x20DAC1,
120967 0x20DCD4, 0x20DED4, 0xC1CEC9, 0xC1D4D8, 0xC5CCD8, 0xC5CEC9, 0xC5D3D4, 0xC5D420,
120968 0xC7CF20, 0xC920D0, 0xC9C520, 0xC9C920, 0xC9D120, 0xCCC5CE, 0xCCC920, 0xCCD8CE,
120969 0xCEC120, 0xCEC520, 0xCEC9C5, 0xCEC9D1, 0xCECF20, 0xCECFD7, 0xCF20D0, 0xCF20D3,
120970 0xCF20D7, 0xCFC7CF, 0xCFCA20, 0xCFCCD8, 0xCFCD20, 0xCFD3D4, 0xCFD720, 0xCFD7C1,
120971 0xD0CFCC, 0xD0D2C5, 0xD0D2C9, 0xD0D2CF, 0xD2C1D7, 0xD2C5C4, 0xD3D120, 0xD3D4C1,
120972 0xD3D4C9, 0xD3D4D7, 0xD4C5CC, 0xD4CF20, 0xD4CFD2, 0xD4D820, 0xD9C820, 0xDED4CF
120973 ];
120974 };
120975
120976 this.name = function(det) {
120977 return 'KOI8-R';
120978 };
120979
120980 this.language = function() {
120981 return 'ru';
120982 };
120983};
120984util.inherits(module.exports.KOI8_R, sbcs);
120985
120986
120987/*
120988module.exports.ISO_8859_7 = function() {
120989 this.byteMap = function() {
120990 return [
120991
120992 ];
120993 };
120994
120995 this.ngrams = function() {
120996 return [
120997
120998 ];
120999 };
121000
121001 this.name = function(det) {
121002 if (typeof det == 'undefined')
121003 return 'ISO-8859-7';
121004 return det.fC1Bytes ? 'windows-1253' : 'ISO-8859-7';
121005 };
121006
121007 this.language = function() {
121008 return 'el';
121009 };
121010};
121011util.inherits(module.exports.ISO_8859_7, sbcs);
121012*/
121013
121014
121015
121016/***/ }),
121017/* 751 */
121018/***/ (function(module, exports, __webpack_require__) {
121019
121020"use strict";
121021
121022var util = __webpack_require__(9),
121023 Match = __webpack_require__ (130);
121024
121025/**
121026 * This class matches UTF-16 and UTF-32, both big- and little-endian. The
121027 * BOM will be used if it is present.
121028 */
121029module.exports.UTF_16BE = function() {
121030 this.name = function() {
121031 return 'UTF-16BE';
121032 };
121033 this.match = function(det) {
121034 var input = det.fRawInput;
121035
121036 if (input.length >= 2 && ((input[0] & 0xff) == 0xfe && (input[1] & 0xff) == 0xff)) {
121037 return new Match(det, this, 100); // confidence = 100
121038 }
121039
121040 // TODO: Do some statistics to check for unsigned UTF-16BE
121041 return null;
121042 };
121043};
121044
121045module.exports.UTF_16LE = function() {
121046 this.name = function() {
121047 return 'UTF-16LE';
121048 };
121049 this.match = function(det) {
121050 var input = det.fRawInput;
121051
121052 if (input.length >= 2 && ((input[0] & 0xff) == 0xff && (input[1] & 0xff) == 0xfe)) {
121053 // LE BOM is present.
121054 if (input.length >= 4 && input[2] == 0x00 && input[3] == 0x00) {
121055 // It is probably UTF-32 LE, not UTF-16
121056 return null;
121057 }
121058 return new Match(det, this, 100); // confidence = 100
121059 }
121060
121061 // TODO: Do some statistics to check for unsigned UTF-16LE
121062 return null;
121063 }
121064};
121065
121066function UTF_32() {};
121067UTF_32.prototype.match = function(det) {
121068 var input = det.fRawInput,
121069 limit = (det.fRawLength / 4) * 4,
121070 numValid = 0,
121071 numInvalid = 0,
121072 hasBOM = false,
121073 confidence = 0;
121074
121075 if (limit == 0) {
121076 return null;
121077 }
121078
121079 if (this.getChar(input, 0) == 0x0000FEFF) {
121080 hasBOM = true;
121081 }
121082
121083 for (var i = 0; i < limit; i += 4) {
121084 var ch = this.getChar(input, i);
121085
121086 if (ch < 0 || ch >= 0x10FFFF || (ch >= 0xD800 && ch <= 0xDFFF)) {
121087 numInvalid += 1;
121088 } else {
121089 numValid += 1;
121090 }
121091 }
121092
121093 // Cook up some sort of confidence score, based on presence of a BOM
121094 // and the existence of valid and/or invalid multi-byte sequences.
121095 if (hasBOM && numInvalid == 0) {
121096 confidence = 100;
121097 } else if (hasBOM && numValid > numInvalid * 10) {
121098 confidence = 80;
121099 } else if (numValid > 3 && numInvalid == 0) {
121100 confidence = 100;
121101 } else if (numValid > 0 && numInvalid == 0) {
121102 confidence = 80;
121103 } else if (numValid > numInvalid * 10) {
121104 // Probably corrupt UTF-32BE data. Valid sequences aren't likely by chance.
121105 confidence = 25;
121106 }
121107
121108 // return confidence == 0 ? null : new CharsetMatch(det, this, confidence);
121109 return confidence == 0 ? null : new Match(det, this, confidence);
121110};
121111
121112module.exports.UTF_32BE = function() {
121113 this.name = function() {
121114 return 'UTF-32BE';
121115 };
121116 this.getChar = function(input, index) {
121117 return (input[index + 0] & 0xff) << 24 | (input[index + 1] & 0xff) << 16 |
121118 (input[index + 2] & 0xff) << 8 | (input[index + 3] & 0xff);
121119 };
121120};
121121util.inherits(module.exports.UTF_32BE, UTF_32);
121122
121123module.exports.UTF_32LE = function() {
121124 this.name = function() {
121125 return 'UTF-32LE';
121126 };
121127 this.getChar = function(input, index) {
121128 return (input[index + 3] & 0xff) << 24 | (input[index + 2] & 0xff) << 16 |
121129 (input[index + 1] & 0xff) << 8 | (input[index + 0] & 0xff);
121130 };
121131};
121132util.inherits(module.exports.UTF_32LE, UTF_32);
121133
121134
121135/***/ }),
121136/* 752 */
121137/***/ (function(module, exports, __webpack_require__) {
121138
121139
121140var Match = __webpack_require__ (130);
121141
121142/**
121143 * Charset recognizer for UTF-8
121144 */
121145module.exports = function() {
121146 this.name = function() {
121147 return 'UTF-8';
121148 };
121149 this.match = function(det) {
121150
121151 var hasBOM = false,
121152 numValid = 0,
121153 numInvalid = 0,
121154 input = det.fRawInput,
121155 trailBytes = 0,
121156 confidence;
121157
121158 if (det.fRawLength >= 3 &&
121159 (input[0] & 0xff) == 0xef && (input[1] & 0xff) == 0xbb && (input[2] & 0xff) == 0xbf) {
121160 hasBOM = true;
121161 }
121162
121163 // Scan for multi-byte sequences
121164 for (var i = 0; i < det.fRawLength; i++) {
121165 var b = input[i];
121166 if ((b & 0x80) == 0)
121167 continue; // ASCII
121168
121169 // Hi bit on char found. Figure out how long the sequence should be
121170 if ((b & 0x0e0) == 0x0c0) {
121171 trailBytes = 1;
121172 } else if ((b & 0x0f0) == 0x0e0) {
121173 trailBytes = 2;
121174 } else if ((b & 0x0f8) == 0xf0) {
121175 trailBytes = 3;
121176 } else {
121177 numInvalid++;
121178 if (numInvalid > 5)
121179 break;
121180 trailBytes = 0;
121181 }
121182
121183 // Verify that we've got the right number of trail bytes in the sequence
121184 for (;;) {
121185 i++;
121186 if (i >= det.fRawLength)
121187 break;
121188
121189 if ((input[i] & 0xc0) != 0x080) {
121190 numInvalid++;
121191 break;
121192 }
121193 if (--trailBytes == 0) {
121194 numValid++;
121195 break;
121196 }
121197 }
121198 }
121199
121200 // Cook up some sort of confidence score, based on presense of a BOM
121201 // and the existence of valid and/or invalid multi-byte sequences.
121202 confidence = 0;
121203 if (hasBOM && numInvalid == 0)
121204 confidence = 100;
121205 else if (hasBOM && numValid > numInvalid * 10)
121206 confidence = 80;
121207 else if (numValid > 3 && numInvalid == 0)
121208 confidence = 100;
121209 else if (numValid > 0 && numInvalid == 0)
121210 confidence = 80;
121211 else if (numValid == 0 && numInvalid == 0)
121212 // Plain ASCII.
121213 confidence = 10;
121214 else if (numValid > numInvalid * 10)
121215 // Probably corruput utf-8 data. Valid sequences aren't likely by chance.
121216 confidence = 25;
121217 else
121218 return null
121219
121220 return new Match(det, this, confidence);
121221 };
121222};
121223
121224
121225/***/ }),
121226/* 753 */
121227/***/ (function(module, exports, __webpack_require__) {
121228
121229
121230var fs = __webpack_require__(12);
121231
121232var utf8 = __webpack_require__(752),
121233 unicode = __webpack_require__(751),
121234 mbcs = __webpack_require__(749),
121235 sbcs = __webpack_require__(750),
121236 iso2022 = __webpack_require__(748);
121237
121238var self = this;
121239
121240var recognisers = [
121241 new utf8,
121242 new unicode.UTF_16BE,
121243 new unicode.UTF_16LE,
121244 new unicode.UTF_32BE,
121245 new unicode.UTF_32LE,
121246 new mbcs.sjis,
121247 new mbcs.big5,
121248 new mbcs.euc_jp,
121249 new mbcs.euc_kr,
121250 new mbcs.gb_18030,
121251 new iso2022.ISO_2022_JP,
121252 new iso2022.ISO_2022_KR,
121253 new iso2022.ISO_2022_CN,
121254 new sbcs.ISO_8859_1,
121255 new sbcs.ISO_8859_2,
121256 new sbcs.ISO_8859_5,
121257 new sbcs.ISO_8859_6,
121258 new sbcs.ISO_8859_7,
121259 new sbcs.ISO_8859_8,
121260 new sbcs.ISO_8859_9,
121261 new sbcs.windows_1251,
121262 new sbcs.windows_1256,
121263 new sbcs.KOI8_R
121264];
121265
121266module.exports.detect = function(buffer, opts) {
121267
121268 // Tally up the byte occurence statistics.
121269 var fByteStats = [];
121270 for (var i = 0; i < 256; i++)
121271 fByteStats[i] = 0;
121272
121273 for (var i = buffer.length - 1; i >= 0; i--)
121274 fByteStats[buffer[i] & 0x00ff]++;
121275
121276 var fC1Bytes = false;
121277 for (var i = 0x80; i <= 0x9F; i += 1) {
121278 if (fByteStats[i] != 0) {
121279 fC1Bytes = true;
121280 break;
121281 }
121282 }
121283
121284 var context = {
121285 fByteStats: fByteStats,
121286 fC1Bytes: fC1Bytes,
121287 fRawInput: buffer,
121288 fRawLength: buffer.length,
121289 fInputBytes: buffer,
121290 fInputLen: buffer.length
121291 };
121292
121293 var matches = recognisers.map(function(rec) {
121294 return rec.match(context);
121295 }).filter(function(match) {
121296 return !!match;
121297 }).sort(function(a, b) {
121298 return b.confidence - a.confidence;
121299 });
121300
121301 if (opts && opts.returnAllMatches === true) {
121302 return matches;
121303 }
121304 else {
121305 return matches.length > 0 ? matches[0].name : null;
121306 }
121307};
121308
121309module.exports.detectFile = function(filepath, opts, cb) {
121310 if (typeof opts === 'function') {
121311 cb = opts;
121312 opts = undefined;
121313 }
121314
121315 var fd;
121316
121317 var handler = function(err, buffer) {
121318 if (fd) {
121319 fs.closeSync(fd);
121320 }
121321
121322 if (err) return cb(err, null);
121323 cb(null, self.detect(buffer, opts));
121324 };
121325
121326 if (opts && opts.sampleSize) {
121327 fd = fs.openSync(filepath, 'r'),
121328 sample = Buffer.allocUnsafe(opts.sampleSize);
121329
121330 fs.read(fd, sample, 0, opts.sampleSize, null, function(err) {
121331 handler(err, sample);
121332 });
121333 return;
121334 }
121335
121336 fs.readFile(filepath, handler);
121337};
121338
121339module.exports.detectFileSync = function(filepath, opts) {
121340 if (opts && opts.sampleSize) {
121341 var fd = fs.openSync(filepath, 'r'),
121342 sample = Buffer.allocUnsafe(opts.sampleSize);
121343
121344 fs.readSync(fd, sample, 0, opts.sampleSize);
121345 fs.closeSync(fd);
121346 return self.detect(sample, opts);
121347 }
121348
121349 return self.detect(fs.readFileSync(filepath), opts);
121350};
121351
121352// Wrappers for the previous functions to return all encodings
121353module.exports.detectAll = function(buffer, opts) {
121354 if (typeof opts !== 'object') {
121355 opts = {};
121356 }
121357 opts.returnAllMatches = true;
121358 return self.detect(buffer, opts);
121359}
121360
121361module.exports.detectFileAll = function(filepath, opts, cb) {
121362 if (typeof opts === 'function') {
121363 cb = opts;
121364 opts = undefined;
121365 }
121366 if (typeof opts !== 'object') {
121367 opts = {};
121368 }
121369 opts.returnAllMatches = true;
121370 self.detectFile(filepath, opts, cb);
121371}
121372
121373module.exports.detectFileAllSync = function(filepath, opts) {
121374 if (typeof opts !== 'object') {
121375 opts = {};
121376 }
121377 opts.returnAllMatches = true;
121378 return self.detectFileSync(filepath, opts);
121379}
121380
121381
121382/***/ }),
121383/* 754 */
121384/***/ (function(module, exports, __webpack_require__) {
121385
121386"use strict";
121387
121388/***
121389 * Node External Editor
121390 *
121391 * Kevin Gravier <kevin@mrkmg.com>
121392 * MIT 2018
121393 */
121394var __extends = (this && this.__extends) || (function () {
121395 var extendStatics = function (d, b) {
121396 extendStatics = Object.setPrototypeOf ||
121397 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
121398 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
121399 return extendStatics(d, b);
121400 }
121401 return function (d, b) {
121402 extendStatics(d, b);
121403 function __() { this.constructor = d; }
121404 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
121405 };
121406})();
121407Object.defineProperty(exports, "__esModule", { value: true });
121408var CreateFileError = /** @class */ (function (_super) {
121409 __extends(CreateFileError, _super);
121410 function CreateFileError(originalError) {
121411 var _newTarget = this.constructor;
121412 var _this = _super.call(this, "Failed to create temporary file for editor") || this;
121413 _this.originalError = originalError;
121414 var proto = _newTarget.prototype;
121415 if (Object.setPrototypeOf) {
121416 Object.setPrototypeOf(_this, proto);
121417 }
121418 else {
121419 _this.__proto__ = _newTarget.prototype;
121420 }
121421 return _this;
121422 }
121423 return CreateFileError;
121424}(Error));
121425exports.CreateFileError = CreateFileError;
121426
121427
121428/***/ }),
121429/* 755 */
121430/***/ (function(module, exports, __webpack_require__) {
121431
121432"use strict";
121433
121434/***
121435 * Node External Editor
121436 *
121437 * Kevin Gravier <kevin@mrkmg.com>
121438 * MIT 2018
121439 */
121440var __extends = (this && this.__extends) || (function () {
121441 var extendStatics = function (d, b) {
121442 extendStatics = Object.setPrototypeOf ||
121443 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
121444 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
121445 return extendStatics(d, b);
121446 }
121447 return function (d, b) {
121448 extendStatics(d, b);
121449 function __() { this.constructor = d; }
121450 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
121451 };
121452})();
121453Object.defineProperty(exports, "__esModule", { value: true });
121454var LaunchEditorError = /** @class */ (function (_super) {
121455 __extends(LaunchEditorError, _super);
121456 function LaunchEditorError(originalError) {
121457 var _newTarget = this.constructor;
121458 var _this = _super.call(this, "Failed launch editor") || this;
121459 _this.originalError = originalError;
121460 var proto = _newTarget.prototype;
121461 if (Object.setPrototypeOf) {
121462 Object.setPrototypeOf(_this, proto);
121463 }
121464 else {
121465 _this.__proto__ = _newTarget.prototype;
121466 }
121467 return _this;
121468 }
121469 return LaunchEditorError;
121470}(Error));
121471exports.LaunchEditorError = LaunchEditorError;
121472
121473
121474/***/ }),
121475/* 756 */
121476/***/ (function(module, exports, __webpack_require__) {
121477
121478"use strict";
121479
121480/***
121481 * Node External Editor
121482 *
121483 * Kevin Gravier <kevin@mrkmg.com>
121484 * MIT 2018
121485 */
121486var __extends = (this && this.__extends) || (function () {
121487 var extendStatics = function (d, b) {
121488 extendStatics = Object.setPrototypeOf ||
121489 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
121490 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
121491 return extendStatics(d, b);
121492 }
121493 return function (d, b) {
121494 extendStatics(d, b);
121495 function __() { this.constructor = d; }
121496 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
121497 };
121498})();
121499Object.defineProperty(exports, "__esModule", { value: true });
121500var ReadFileError = /** @class */ (function (_super) {
121501 __extends(ReadFileError, _super);
121502 function ReadFileError(originalError) {
121503 var _newTarget = this.constructor;
121504 var _this = _super.call(this, "Failed to read temporary file") || this;
121505 _this.originalError = originalError;
121506 var proto = _newTarget.prototype;
121507 if (Object.setPrototypeOf) {
121508 Object.setPrototypeOf(_this, proto);
121509 }
121510 else {
121511 _this.__proto__ = _newTarget.prototype;
121512 }
121513 return _this;
121514 }
121515 return ReadFileError;
121516}(Error));
121517exports.ReadFileError = ReadFileError;
121518
121519
121520/***/ }),
121521/* 757 */
121522/***/ (function(module, exports, __webpack_require__) {
121523
121524"use strict";
121525
121526/***
121527 * Node External Editor
121528 *
121529 * Kevin Gravier <kevin@mrkmg.com>
121530 * MIT 2018
121531 */
121532var __extends = (this && this.__extends) || (function () {
121533 var extendStatics = function (d, b) {
121534 extendStatics = Object.setPrototypeOf ||
121535 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
121536 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
121537 return extendStatics(d, b);
121538 }
121539 return function (d, b) {
121540 extendStatics(d, b);
121541 function __() { this.constructor = d; }
121542 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
121543 };
121544})();
121545Object.defineProperty(exports, "__esModule", { value: true });
121546var RemoveFileError = /** @class */ (function (_super) {
121547 __extends(RemoveFileError, _super);
121548 function RemoveFileError(originalError) {
121549 var _newTarget = this.constructor;
121550 var _this = _super.call(this, "Failed to cleanup temporary file") || this;
121551 _this.originalError = originalError;
121552 var proto = _newTarget.prototype;
121553 if (Object.setPrototypeOf) {
121554 Object.setPrototypeOf(_this, proto);
121555 }
121556 else {
121557 _this.__proto__ = _newTarget.prototype;
121558 }
121559 return _this;
121560 }
121561 return RemoveFileError;
121562}(Error));
121563exports.RemoveFileError = RemoveFileError;
121564
121565
121566/***/ }),
121567/* 758 */
121568/***/ (function(module, exports, __webpack_require__) {
121569
121570"use strict";
121571
121572/***
121573 * Node External Editor
121574 *
121575 * Kevin Gravier <kevin@mrkmg.com>
121576 * MIT 2018
121577 */
121578Object.defineProperty(exports, "__esModule", { value: true });
121579var chardet_1 = __webpack_require__(753);
121580var child_process_1 = __webpack_require__(270);
121581var fs_1 = __webpack_require__(12);
121582var iconv_lite_1 = __webpack_require__(775);
121583var tmp_1 = __webpack_require__(1027);
121584var CreateFileError_1 = __webpack_require__(754);
121585exports.CreateFileError = CreateFileError_1.CreateFileError;
121586var LaunchEditorError_1 = __webpack_require__(755);
121587exports.LaunchEditorError = LaunchEditorError_1.LaunchEditorError;
121588var ReadFileError_1 = __webpack_require__(756);
121589exports.ReadFileError = ReadFileError_1.ReadFileError;
121590var RemoveFileError_1 = __webpack_require__(757);
121591exports.RemoveFileError = RemoveFileError_1.RemoveFileError;
121592function edit(text) {
121593 if (text === void 0) { text = ""; }
121594 var editor = new ExternalEditor(text);
121595 editor.run();
121596 editor.cleanup();
121597 return editor.text;
121598}
121599exports.edit = edit;
121600function editAsync(text, callback) {
121601 if (text === void 0) { text = ""; }
121602 var editor = new ExternalEditor(text);
121603 editor.runAsync(function (err, result) {
121604 if (err) {
121605 setImmediate(callback, err, null);
121606 }
121607 else {
121608 try {
121609 editor.cleanup();
121610 setImmediate(callback, null, result);
121611 }
121612 catch (cleanupError) {
121613 setImmediate(callback, cleanupError, null);
121614 }
121615 }
121616 });
121617}
121618exports.editAsync = editAsync;
121619var ExternalEditor = /** @class */ (function () {
121620 function ExternalEditor(text) {
121621 if (text === void 0) { text = ""; }
121622 this.text = "";
121623 this.text = text;
121624 this.determineEditor();
121625 this.createTemporaryFile();
121626 }
121627 ExternalEditor.splitStringBySpace = function (str) {
121628 var pieces = [];
121629 var currentString = "";
121630 for (var strIndex = 0; strIndex < str.length; strIndex++) {
121631 var currentLetter = str[strIndex];
121632 if (strIndex > 0 && currentLetter === " " && str[strIndex - 1] !== "\\" && currentString.length > 0) {
121633 pieces.push(currentString);
121634 currentString = "";
121635 }
121636 else {
121637 currentString += currentLetter;
121638 }
121639 }
121640 if (currentString.length > 0) {
121641 pieces.push(currentString);
121642 }
121643 return pieces;
121644 };
121645 Object.defineProperty(ExternalEditor.prototype, "temp_file", {
121646 get: function () {
121647 console.log("DEPRECATED: temp_file. Use tempFile moving forward.");
121648 return this.tempFile;
121649 },
121650 enumerable: true,
121651 configurable: true
121652 });
121653 Object.defineProperty(ExternalEditor.prototype, "last_exit_status", {
121654 get: function () {
121655 console.log("DEPRECATED: last_exit_status. Use lastExitStatus moving forward.");
121656 return this.lastExitStatus;
121657 },
121658 enumerable: true,
121659 configurable: true
121660 });
121661 ExternalEditor.prototype.run = function () {
121662 this.launchEditor();
121663 this.readTemporaryFile();
121664 return this.text;
121665 };
121666 ExternalEditor.prototype.runAsync = function (callback) {
121667 var _this = this;
121668 try {
121669 this.launchEditorAsync(function () {
121670 try {
121671 _this.readTemporaryFile();
121672 setImmediate(callback, null, _this.text);
121673 }
121674 catch (readError) {
121675 setImmediate(callback, readError, null);
121676 }
121677 });
121678 }
121679 catch (launchError) {
121680 setImmediate(callback, launchError, null);
121681 }
121682 };
121683 ExternalEditor.prototype.cleanup = function () {
121684 this.removeTemporaryFile();
121685 };
121686 ExternalEditor.prototype.determineEditor = function () {
121687 var editor = process.env.VISUAL ? process.env.VISUAL :
121688 process.env.EDITOR ? process.env.EDITOR :
121689 /^win/.test(process.platform) ? "notepad" :
121690 "vim";
121691 var editorOpts = ExternalEditor.splitStringBySpace(editor).map(function (piece) { return piece.replace("\\ ", " "); });
121692 var bin = editorOpts.shift();
121693 this.editor = { args: editorOpts, bin: bin };
121694 };
121695 ExternalEditor.prototype.createTemporaryFile = function () {
121696 try {
121697 this.tempFile = tmp_1.tmpNameSync({});
121698 fs_1.writeFileSync(this.tempFile, this.text, { encoding: "utf8" });
121699 }
121700 catch (createFileError) {
121701 throw new CreateFileError_1.CreateFileError(createFileError);
121702 }
121703 };
121704 ExternalEditor.prototype.readTemporaryFile = function () {
121705 try {
121706 var tempFileBuffer = fs_1.readFileSync(this.tempFile);
121707 if (tempFileBuffer.length === 0) {
121708 this.text = "";
121709 }
121710 else {
121711 var encoding = chardet_1.detect(tempFileBuffer).toString();
121712 if (!iconv_lite_1.encodingExists(encoding)) {
121713 // Probably a bad idea, but will at least prevent crashing
121714 encoding = "utf8";
121715 }
121716 this.text = iconv_lite_1.decode(tempFileBuffer, encoding);
121717 }
121718 }
121719 catch (readFileError) {
121720 throw new ReadFileError_1.ReadFileError(readFileError);
121721 }
121722 };
121723 ExternalEditor.prototype.removeTemporaryFile = function () {
121724 try {
121725 fs_1.unlinkSync(this.tempFile);
121726 }
121727 catch (removeFileError) {
121728 throw new RemoveFileError_1.RemoveFileError(removeFileError);
121729 }
121730 };
121731 ExternalEditor.prototype.launchEditor = function () {
121732 try {
121733 var editorProcess = child_process_1.spawnSync(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
121734 this.lastExitStatus = editorProcess.status;
121735 }
121736 catch (launchError) {
121737 throw new LaunchEditorError_1.LaunchEditorError(launchError);
121738 }
121739 };
121740 ExternalEditor.prototype.launchEditorAsync = function (callback) {
121741 var _this = this;
121742 try {
121743 var editorProcess = child_process_1.spawn(this.editor.bin, this.editor.args.concat([this.tempFile]), { stdio: "inherit" });
121744 editorProcess.on("exit", function (code) {
121745 _this.lastExitStatus = code;
121746 setImmediate(callback);
121747 });
121748 }
121749 catch (launchError) {
121750 throw new LaunchEditorError_1.LaunchEditorError(launchError);
121751 }
121752 };
121753 return ExternalEditor;
121754}());
121755exports.ExternalEditor = ExternalEditor;
121756
121757
121758/***/ }),
121759/* 759 */
121760/***/ (function(module, exports, __webpack_require__) {
121761
121762"use strict";
121763
121764var Buffer = __webpack_require__(20).Buffer;
121765
121766// Multibyte codec. In this scheme, a character is represented by 1 or more bytes.
121767// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences.
121768// To save memory and loading time, we read table files only when requested.
121769
121770exports._dbcs = DBCSCodec;
121771
121772var UNASSIGNED = -1,
121773 GB18030_CODE = -2,
121774 SEQ_START = -10,
121775 NODE_START = -1000,
121776 UNASSIGNED_NODE = new Array(0x100),
121777 DEF_CHAR = -1;
121778
121779for (var i = 0; i < 0x100; i++)
121780 UNASSIGNED_NODE[i] = UNASSIGNED;
121781
121782
121783// Class DBCSCodec reads and initializes mapping tables.
121784function DBCSCodec(codecOptions, iconv) {
121785 this.encodingName = codecOptions.encodingName;
121786 if (!codecOptions)
121787 throw new Error("DBCS codec is called without the data.")
121788 if (!codecOptions.table)
121789 throw new Error("Encoding '" + this.encodingName + "' has no data.");
121790
121791 // Load tables.
121792 var mappingTable = codecOptions.table();
121793
121794
121795 // Decode tables: MBCS -> Unicode.
121796
121797 // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256.
121798 // Trie root is decodeTables[0].
121799 // Values: >= 0 -> unicode character code. can be > 0xFFFF
121800 // == UNASSIGNED -> unknown/unassigned sequence.
121801 // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence.
121802 // <= NODE_START -> index of the next node in our trie to process next byte.
121803 // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq.
121804 this.decodeTables = [];
121805 this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node.
121806
121807 // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here.
121808 this.decodeTableSeq = [];
121809
121810 // Actual mapping tables consist of chunks. Use them to fill up decode tables.
121811 for (var i = 0; i < mappingTable.length; i++)
121812 this._addDecodeChunk(mappingTable[i]);
121813
121814 this.defaultCharUnicode = iconv.defaultCharUnicode;
121815
121816
121817 // Encode tables: Unicode -> DBCS.
121818
121819 // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance.
121820 // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null.
121821 // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.).
121822 // == UNASSIGNED -> no conversion found. Output a default char.
121823 // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence.
121824 this.encodeTable = [];
121825
121826 // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of
121827 // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key
121828 // means end of sequence (needed when one sequence is a strict subsequence of another).
121829 // Objects are kept separately from encodeTable to increase performance.
121830 this.encodeTableSeq = [];
121831
121832 // Some chars can be decoded, but need not be encoded.
121833 var skipEncodeChars = {};
121834 if (codecOptions.encodeSkipVals)
121835 for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) {
121836 var val = codecOptions.encodeSkipVals[i];
121837 if (typeof val === 'number')
121838 skipEncodeChars[val] = true;
121839 else
121840 for (var j = val.from; j <= val.to; j++)
121841 skipEncodeChars[j] = true;
121842 }
121843
121844 // Use decode trie to recursively fill out encode tables.
121845 this._fillEncodeTable(0, 0, skipEncodeChars);
121846
121847 // Add more encoding pairs when needed.
121848 if (codecOptions.encodeAdd) {
121849 for (var uChar in codecOptions.encodeAdd)
121850 if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar))
121851 this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]);
121852 }
121853
121854 this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)];
121855 if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?'];
121856 if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0);
121857
121858
121859 // Load & create GB18030 tables when needed.
121860 if (typeof codecOptions.gb18030 === 'function') {
121861 this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges.
121862
121863 // Add GB18030 decode tables.
121864 var thirdByteNodeIdx = this.decodeTables.length;
121865 var thirdByteNode = this.decodeTables[thirdByteNodeIdx] = UNASSIGNED_NODE.slice(0);
121866
121867 var fourthByteNodeIdx = this.decodeTables.length;
121868 var fourthByteNode = this.decodeTables[fourthByteNodeIdx] = UNASSIGNED_NODE.slice(0);
121869
121870 for (var i = 0x81; i <= 0xFE; i++) {
121871 var secondByteNodeIdx = NODE_START - this.decodeTables[0][i];
121872 var secondByteNode = this.decodeTables[secondByteNodeIdx];
121873 for (var j = 0x30; j <= 0x39; j++)
121874 secondByteNode[j] = NODE_START - thirdByteNodeIdx;
121875 }
121876 for (var i = 0x81; i <= 0xFE; i++)
121877 thirdByteNode[i] = NODE_START - fourthByteNodeIdx;
121878 for (var i = 0x30; i <= 0x39; i++)
121879 fourthByteNode[i] = GB18030_CODE
121880 }
121881}
121882
121883DBCSCodec.prototype.encoder = DBCSEncoder;
121884DBCSCodec.prototype.decoder = DBCSDecoder;
121885
121886// Decoder helpers
121887DBCSCodec.prototype._getDecodeTrieNode = function(addr) {
121888 var bytes = [];
121889 for (; addr > 0; addr >>= 8)
121890 bytes.push(addr & 0xFF);
121891 if (bytes.length == 0)
121892 bytes.push(0);
121893
121894 var node = this.decodeTables[0];
121895 for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie.
121896 var val = node[bytes[i]];
121897
121898 if (val == UNASSIGNED) { // Create new node.
121899 node[bytes[i]] = NODE_START - this.decodeTables.length;
121900 this.decodeTables.push(node = UNASSIGNED_NODE.slice(0));
121901 }
121902 else if (val <= NODE_START) { // Existing node.
121903 node = this.decodeTables[NODE_START - val];
121904 }
121905 else
121906 throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16));
121907 }
121908 return node;
121909}
121910
121911
121912DBCSCodec.prototype._addDecodeChunk = function(chunk) {
121913 // First element of chunk is the hex mbcs code where we start.
121914 var curAddr = parseInt(chunk[0], 16);
121915
121916 // Choose the decoding node where we'll write our chars.
121917 var writeTable = this._getDecodeTrieNode(curAddr);
121918 curAddr = curAddr & 0xFF;
121919
121920 // Write all other elements of the chunk to the table.
121921 for (var k = 1; k < chunk.length; k++) {
121922 var part = chunk[k];
121923 if (typeof part === "string") { // String, write as-is.
121924 for (var l = 0; l < part.length;) {
121925 var code = part.charCodeAt(l++);
121926 if (0xD800 <= code && code < 0xDC00) { // Decode surrogate
121927 var codeTrail = part.charCodeAt(l++);
121928 if (0xDC00 <= codeTrail && codeTrail < 0xE000)
121929 writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00);
121930 else
121931 throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]);
121932 }
121933 else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used)
121934 var len = 0xFFF - code + 2;
121935 var seq = [];
121936 for (var m = 0; m < len; m++)
121937 seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq.
121938
121939 writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length;
121940 this.decodeTableSeq.push(seq);
121941 }
121942 else
121943 writeTable[curAddr++] = code; // Basic char
121944 }
121945 }
121946 else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character.
121947 var charCode = writeTable[curAddr - 1] + 1;
121948 for (var l = 0; l < part; l++)
121949 writeTable[curAddr++] = charCode++;
121950 }
121951 else
121952 throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]);
121953 }
121954 if (curAddr > 0xFF)
121955 throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr);
121956}
121957
121958// Encoder helpers
121959DBCSCodec.prototype._getEncodeBucket = function(uCode) {
121960 var high = uCode >> 8; // This could be > 0xFF because of astral characters.
121961 if (this.encodeTable[high] === undefined)
121962 this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand.
121963 return this.encodeTable[high];
121964}
121965
121966DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) {
121967 var bucket = this._getEncodeBucket(uCode);
121968 var low = uCode & 0xFF;
121969 if (bucket[low] <= SEQ_START)
121970 this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it.
121971 else if (bucket[low] == UNASSIGNED)
121972 bucket[low] = dbcsCode;
121973}
121974
121975DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) {
121976
121977 // Get the root of character tree according to first character of the sequence.
121978 var uCode = seq[0];
121979 var bucket = this._getEncodeBucket(uCode);
121980 var low = uCode & 0xFF;
121981
121982 var node;
121983 if (bucket[low] <= SEQ_START) {
121984 // There's already a sequence with - use it.
121985 node = this.encodeTableSeq[SEQ_START-bucket[low]];
121986 }
121987 else {
121988 // There was no sequence object - allocate a new one.
121989 node = {};
121990 if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence.
121991 bucket[low] = SEQ_START - this.encodeTableSeq.length;
121992 this.encodeTableSeq.push(node);
121993 }
121994
121995 // Traverse the character tree, allocating new nodes as needed.
121996 for (var j = 1; j < seq.length-1; j++) {
121997 var oldVal = node[uCode];
121998 if (typeof oldVal === 'object')
121999 node = oldVal;
122000 else {
122001 node = node[uCode] = {}
122002 if (oldVal !== undefined)
122003 node[DEF_CHAR] = oldVal
122004 }
122005 }
122006
122007 // Set the leaf to given dbcsCode.
122008 uCode = seq[seq.length-1];
122009 node[uCode] = dbcsCode;
122010}
122011
122012DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) {
122013 var node = this.decodeTables[nodeIdx];
122014 for (var i = 0; i < 0x100; i++) {
122015 var uCode = node[i];
122016 var mbCode = prefix + i;
122017 if (skipEncodeChars[mbCode])
122018 continue;
122019
122020 if (uCode >= 0)
122021 this._setEncodeChar(uCode, mbCode);
122022 else if (uCode <= NODE_START)
122023 this._fillEncodeTable(NODE_START - uCode, mbCode << 8, skipEncodeChars);
122024 else if (uCode <= SEQ_START)
122025 this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode);
122026 }
122027}
122028
122029
122030
122031// == Encoder ==================================================================
122032
122033function DBCSEncoder(options, codec) {
122034 // Encoder state
122035 this.leadSurrogate = -1;
122036 this.seqObj = undefined;
122037
122038 // Static data
122039 this.encodeTable = codec.encodeTable;
122040 this.encodeTableSeq = codec.encodeTableSeq;
122041 this.defaultCharSingleByte = codec.defCharSB;
122042 this.gb18030 = codec.gb18030;
122043}
122044
122045DBCSEncoder.prototype.write = function(str) {
122046 var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)),
122047 leadSurrogate = this.leadSurrogate,
122048 seqObj = this.seqObj, nextChar = -1,
122049 i = 0, j = 0;
122050
122051 while (true) {
122052 // 0. Get next character.
122053 if (nextChar === -1) {
122054 if (i == str.length) break;
122055 var uCode = str.charCodeAt(i++);
122056 }
122057 else {
122058 var uCode = nextChar;
122059 nextChar = -1;
122060 }
122061
122062 // 1. Handle surrogates.
122063 if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates.
122064 if (uCode < 0xDC00) { // We've got lead surrogate.
122065 if (leadSurrogate === -1) {
122066 leadSurrogate = uCode;
122067 continue;
122068 } else {
122069 leadSurrogate = uCode;
122070 // Double lead surrogate found.
122071 uCode = UNASSIGNED;
122072 }
122073 } else { // We've got trail surrogate.
122074 if (leadSurrogate !== -1) {
122075 uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00);
122076 leadSurrogate = -1;
122077 } else {
122078 // Incomplete surrogate pair - only trail surrogate found.
122079 uCode = UNASSIGNED;
122080 }
122081
122082 }
122083 }
122084 else if (leadSurrogate !== -1) {
122085 // Incomplete surrogate pair - only lead surrogate found.
122086 nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char.
122087 leadSurrogate = -1;
122088 }
122089
122090 // 2. Convert uCode character.
122091 var dbcsCode = UNASSIGNED;
122092 if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence
122093 var resCode = seqObj[uCode];
122094 if (typeof resCode === 'object') { // Sequence continues.
122095 seqObj = resCode;
122096 continue;
122097
122098 } else if (typeof resCode == 'number') { // Sequence finished. Write it.
122099 dbcsCode = resCode;
122100
122101 } else if (resCode == undefined) { // Current character is not part of the sequence.
122102
122103 // Try default character for this sequence
122104 resCode = seqObj[DEF_CHAR];
122105 if (resCode !== undefined) {
122106 dbcsCode = resCode; // Found. Write it.
122107 nextChar = uCode; // Current character will be written too in the next iteration.
122108
122109 } else {
122110 // TODO: What if we have no default? (resCode == undefined)
122111 // Then, we should write first char of the sequence as-is and try the rest recursively.
122112 // Didn't do it for now because no encoding has this situation yet.
122113 // Currently, just skip the sequence and write current char.
122114 }
122115 }
122116 seqObj = undefined;
122117 }
122118 else if (uCode >= 0) { // Regular character
122119 var subtable = this.encodeTable[uCode >> 8];
122120 if (subtable !== undefined)
122121 dbcsCode = subtable[uCode & 0xFF];
122122
122123 if (dbcsCode <= SEQ_START) { // Sequence start
122124 seqObj = this.encodeTableSeq[SEQ_START-dbcsCode];
122125 continue;
122126 }
122127
122128 if (dbcsCode == UNASSIGNED && this.gb18030) {
122129 // Use GB18030 algorithm to find character(s) to write.
122130 var idx = findIdx(this.gb18030.uChars, uCode);
122131 if (idx != -1) {
122132 var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]);
122133 newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600;
122134 newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260;
122135 newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10;
122136 newBuf[j++] = 0x30 + dbcsCode;
122137 continue;
122138 }
122139 }
122140 }
122141
122142 // 3. Write dbcsCode character.
122143 if (dbcsCode === UNASSIGNED)
122144 dbcsCode = this.defaultCharSingleByte;
122145
122146 if (dbcsCode < 0x100) {
122147 newBuf[j++] = dbcsCode;
122148 }
122149 else if (dbcsCode < 0x10000) {
122150 newBuf[j++] = dbcsCode >> 8; // high byte
122151 newBuf[j++] = dbcsCode & 0xFF; // low byte
122152 }
122153 else {
122154 newBuf[j++] = dbcsCode >> 16;
122155 newBuf[j++] = (dbcsCode >> 8) & 0xFF;
122156 newBuf[j++] = dbcsCode & 0xFF;
122157 }
122158 }
122159
122160 this.seqObj = seqObj;
122161 this.leadSurrogate = leadSurrogate;
122162 return newBuf.slice(0, j);
122163}
122164
122165DBCSEncoder.prototype.end = function() {
122166 if (this.leadSurrogate === -1 && this.seqObj === undefined)
122167 return; // All clean. Most often case.
122168
122169 var newBuf = Buffer.alloc(10), j = 0;
122170
122171 if (this.seqObj) { // We're in the sequence.
122172 var dbcsCode = this.seqObj[DEF_CHAR];
122173 if (dbcsCode !== undefined) { // Write beginning of the sequence.
122174 if (dbcsCode < 0x100) {
122175 newBuf[j++] = dbcsCode;
122176 }
122177 else {
122178 newBuf[j++] = dbcsCode >> 8; // high byte
122179 newBuf[j++] = dbcsCode & 0xFF; // low byte
122180 }
122181 } else {
122182 // See todo above.
122183 }
122184 this.seqObj = undefined;
122185 }
122186
122187 if (this.leadSurrogate !== -1) {
122188 // Incomplete surrogate pair - only lead surrogate found.
122189 newBuf[j++] = this.defaultCharSingleByte;
122190 this.leadSurrogate = -1;
122191 }
122192
122193 return newBuf.slice(0, j);
122194}
122195
122196// Export for testing
122197DBCSEncoder.prototype.findIdx = findIdx;
122198
122199
122200// == Decoder ==================================================================
122201
122202function DBCSDecoder(options, codec) {
122203 // Decoder state
122204 this.nodeIdx = 0;
122205 this.prevBuf = Buffer.alloc(0);
122206
122207 // Static data
122208 this.decodeTables = codec.decodeTables;
122209 this.decodeTableSeq = codec.decodeTableSeq;
122210 this.defaultCharUnicode = codec.defaultCharUnicode;
122211 this.gb18030 = codec.gb18030;
122212}
122213
122214DBCSDecoder.prototype.write = function(buf) {
122215 var newBuf = Buffer.alloc(buf.length*2),
122216 nodeIdx = this.nodeIdx,
122217 prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,
122218 seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence.
122219 uCode;
122220
122221 if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later.
122222 prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]);
122223
122224 for (var i = 0, j = 0; i < buf.length; i++) {
122225 var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset];
122226
122227 // Lookup in current trie node.
122228 var uCode = this.decodeTables[nodeIdx][curByte];
122229
122230 if (uCode >= 0) {
122231 // Normal character, just use it.
122232 }
122233 else if (uCode === UNASSIGNED) { // Unknown char.
122234 // TODO: Callback with seq.
122235 //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);
122236 i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle).
122237 uCode = this.defaultCharUnicode.charCodeAt(0);
122238 }
122239 else if (uCode === GB18030_CODE) {
122240 var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);
122241 var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30);
122242 var idx = findIdx(this.gb18030.gbChars, ptr);
122243 uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx];
122244 }
122245 else if (uCode <= NODE_START) { // Go to next trie node.
122246 nodeIdx = NODE_START - uCode;
122247 continue;
122248 }
122249 else if (uCode <= SEQ_START) { // Output a sequence of chars.
122250 var seq = this.decodeTableSeq[SEQ_START - uCode];
122251 for (var k = 0; k < seq.length - 1; k++) {
122252 uCode = seq[k];
122253 newBuf[j++] = uCode & 0xFF;
122254 newBuf[j++] = uCode >> 8;
122255 }
122256 uCode = seq[seq.length-1];
122257 }
122258 else
122259 throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte);
122260
122261 // Write the character to buffer, handling higher planes using surrogate pair.
122262 if (uCode > 0xFFFF) {
122263 uCode -= 0x10000;
122264 var uCodeLead = 0xD800 + Math.floor(uCode / 0x400);
122265 newBuf[j++] = uCodeLead & 0xFF;
122266 newBuf[j++] = uCodeLead >> 8;
122267
122268 uCode = 0xDC00 + uCode % 0x400;
122269 }
122270 newBuf[j++] = uCode & 0xFF;
122271 newBuf[j++] = uCode >> 8;
122272
122273 // Reset trie node.
122274 nodeIdx = 0; seqStart = i+1;
122275 }
122276
122277 this.nodeIdx = nodeIdx;
122278 this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset);
122279 return newBuf.slice(0, j).toString('ucs2');
122280}
122281
122282DBCSDecoder.prototype.end = function() {
122283 var ret = '';
122284
122285 // Try to parse all remaining chars.
122286 while (this.prevBuf.length > 0) {
122287 // Skip 1 character in the buffer.
122288 ret += this.defaultCharUnicode;
122289 var buf = this.prevBuf.slice(1);
122290
122291 // Parse remaining as usual.
122292 this.prevBuf = Buffer.alloc(0);
122293 this.nodeIdx = 0;
122294 if (buf.length > 0)
122295 ret += this.write(buf);
122296 }
122297
122298 this.nodeIdx = 0;
122299 return ret;
122300}
122301
122302// Binary search for GB18030. Returns largest i such that table[i] <= val.
122303function findIdx(table, val) {
122304 if (table[0] > val)
122305 return -1;
122306
122307 var l = 0, r = table.length;
122308 while (l < r-1) { // always table[l] <= val < table[r]
122309 var mid = l + Math.floor((r-l+1)/2);
122310 if (table[mid] <= val)
122311 l = mid;
122312 else
122313 r = mid;
122314 }
122315 return l;
122316}
122317
122318
122319
122320/***/ }),
122321/* 760 */
122322/***/ (function(module, exports, __webpack_require__) {
122323
122324"use strict";
122325
122326
122327// Description of supported double byte encodings and aliases.
122328// Tables are not require()-d until they are needed to speed up library load.
122329// require()-s are direct to support Browserify.
122330
122331module.exports = {
122332
122333 // == Japanese/ShiftJIS ====================================================
122334 // All japanese encodings are based on JIS X set of standards:
122335 // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
122336 // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes.
122337 // Has several variations in 1978, 1983, 1990 and 1997.
122338 // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead.
122339 // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233.
122340 // 2 planes, first is superset of 0208, second - revised 0212.
122341 // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx)
122342
122343 // Byte encodings are:
122344 // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte
122345 // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC.
122346 // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI.
122347 // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes.
122348 // 0x00-0x7F - lower part of 0201
122349 // 0x8E, 0xA1-0xDF - upper part of 0201
122350 // (0xA1-0xFE)x2 - 0208 plane (94x94).
122351 // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94).
122352 // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon.
122353 // Used as-is in ISO2022 family.
122354 // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII,
122355 // 0201-1976 Roman, 0208-1978, 0208-1983.
122356 // * ISO2022-JP-1: Adds esc seq for 0212-1990.
122357 // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7.
122358 // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2.
122359 // * ISO2022-JP-2004: Adds 0213-2004 Plane 1.
122360 //
122361 // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes.
122362 //
122363 // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html
122364
122365 'shiftjis': {
122366 type: '_dbcs',
122367 table: function() { return __webpack_require__(770) },
122368 encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
122369 encodeSkipVals: [{from: 0xED40, to: 0xF940}],
122370 },
122371 'csshiftjis': 'shiftjis',
122372 'mskanji': 'shiftjis',
122373 'sjis': 'shiftjis',
122374 'windows31j': 'shiftjis',
122375 'ms31j': 'shiftjis',
122376 'xsjis': 'shiftjis',
122377 'windows932': 'shiftjis',
122378 'ms932': 'shiftjis',
122379 '932': 'shiftjis',
122380 'cp932': 'shiftjis',
122381
122382 'eucjp': {
122383 type: '_dbcs',
122384 table: function() { return __webpack_require__(768) },
122385 encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E},
122386 },
122387
122388 // TODO: KDDI extension to Shift_JIS
122389 // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes.
122390 // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars.
122391
122392
122393 // == Chinese/GBK ==========================================================
122394 // http://en.wikipedia.org/wiki/GBK
122395 // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder
122396
122397 // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936
122398 'gb2312': 'cp936',
122399 'gb231280': 'cp936',
122400 'gb23121980': 'cp936',
122401 'csgb2312': 'cp936',
122402 'csiso58gb231280': 'cp936',
122403 'euccn': 'cp936',
122404
122405 // Microsoft's CP936 is a subset and approximation of GBK.
122406 'windows936': 'cp936',
122407 'ms936': 'cp936',
122408 '936': 'cp936',
122409 'cp936': {
122410 type: '_dbcs',
122411 table: function() { return __webpack_require__(238) },
122412 },
122413
122414 // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
122415 'gbk': {
122416 type: '_dbcs',
122417 table: function() { return __webpack_require__(238).concat(__webpack_require__(364)) },
122418 },
122419 'xgbk': 'gbk',
122420 'isoir58': 'gbk',
122421
122422 // GB18030 is an algorithmic extension of GBK.
122423 // Main source: https://www.w3.org/TR/encoding/#gbk-encoder
122424 // http://icu-project.org/docs/papers/gb18030.html
122425 // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml
122426 // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0
122427 'gb18030': {
122428 type: '_dbcs',
122429 table: function() { return __webpack_require__(238).concat(__webpack_require__(364)) },
122430 gb18030: function() { return __webpack_require__(769) },
122431 encodeSkipVals: [0x80],
122432 encodeAdd: {'€': 0xA2E3},
122433 },
122434
122435 'chinese': 'gb18030',
122436
122437
122438 // == Korean ===============================================================
122439 // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same.
122440 'windows949': 'cp949',
122441 'ms949': 'cp949',
122442 '949': 'cp949',
122443 'cp949': {
122444 type: '_dbcs',
122445 table: function() { return __webpack_require__(767) },
122446 },
122447
122448 'cseuckr': 'cp949',
122449 'csksc56011987': 'cp949',
122450 'euckr': 'cp949',
122451 'isoir149': 'cp949',
122452 'korean': 'cp949',
122453 'ksc56011987': 'cp949',
122454 'ksc56011989': 'cp949',
122455 'ksc5601': 'cp949',
122456
122457
122458 // == Big5/Taiwan/Hong Kong ================================================
122459 // There are lots of tables for Big5 and cp950. Please see the following links for history:
122460 // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html
122461 // Variations, in roughly number of defined chars:
122462 // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT
122463 // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/
122464 // * Big5-2003 (Taiwan standard) almost superset of cp950.
122465 // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers.
122466 // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard.
122467 // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years.
122468 // Plus, it has 4 combining sequences.
122469 // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299
122470 // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way.
122471 // Implementations are not consistent within browsers; sometimes labeled as just big5.
122472 // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied.
122473 // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31
122474 // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s.
122475 // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt
122476 // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt
122477 //
122478 // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder
122479 // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong.
122480
122481 'windows950': 'cp950',
122482 'ms950': 'cp950',
122483 '950': 'cp950',
122484 'cp950': {
122485 type: '_dbcs',
122486 table: function() { return __webpack_require__(363) },
122487 },
122488
122489 // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.
122490 'big5': 'big5hkscs',
122491 'big5hkscs': {
122492 type: '_dbcs',
122493 table: function() { return __webpack_require__(363).concat(__webpack_require__(766)) },
122494 encodeSkipVals: [0xa2cc],
122495 },
122496
122497 'cnbig5': 'big5hkscs',
122498 'csbig5': 'big5hkscs',
122499 'xxbig5': 'big5hkscs',
122500};
122501
122502
122503/***/ }),
122504/* 761 */
122505/***/ (function(module, exports, __webpack_require__) {
122506
122507"use strict";
122508
122509
122510// Update this array if you add/rename/remove files in this directory.
122511// We support Browserify by skipping automatic module discovery and requiring modules directly.
122512var modules = [
122513 __webpack_require__(762),
122514 __webpack_require__(771),
122515 __webpack_require__(772),
122516 __webpack_require__(763),
122517 __webpack_require__(765),
122518 __webpack_require__(764),
122519 __webpack_require__(759),
122520 __webpack_require__(760),
122521];
122522
122523// Put all encoding/alias/codec definitions to single object and export it.
122524for (var i = 0; i < modules.length; i++) {
122525 var module = modules[i];
122526 for (var enc in module)
122527 if (Object.prototype.hasOwnProperty.call(module, enc))
122528 exports[enc] = module[enc];
122529}
122530
122531
122532/***/ }),
122533/* 762 */
122534/***/ (function(module, exports, __webpack_require__) {
122535
122536"use strict";
122537
122538var Buffer = __webpack_require__(20).Buffer;
122539
122540// Export Node.js internal encodings.
122541
122542module.exports = {
122543 // Encodings
122544 utf8: { type: "_internal", bomAware: true},
122545 cesu8: { type: "_internal", bomAware: true},
122546 unicode11utf8: "utf8",
122547
122548 ucs2: { type: "_internal", bomAware: true},
122549 utf16le: "ucs2",
122550
122551 binary: { type: "_internal" },
122552 base64: { type: "_internal" },
122553 hex: { type: "_internal" },
122554
122555 // Codec.
122556 _internal: InternalCodec,
122557};
122558
122559//------------------------------------------------------------------------------
122560
122561function InternalCodec(codecOptions, iconv) {
122562 this.enc = codecOptions.encodingName;
122563 this.bomAware = codecOptions.bomAware;
122564
122565 if (this.enc === "base64")
122566 this.encoder = InternalEncoderBase64;
122567 else if (this.enc === "cesu8") {
122568 this.enc = "utf8"; // Use utf8 for decoding.
122569 this.encoder = InternalEncoderCesu8;
122570
122571 // Add decoder for versions of Node not supporting CESU-8
122572 if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') {
122573 this.decoder = InternalDecoderCesu8;
122574 this.defaultCharUnicode = iconv.defaultCharUnicode;
122575 }
122576 }
122577}
122578
122579InternalCodec.prototype.encoder = InternalEncoder;
122580InternalCodec.prototype.decoder = InternalDecoder;
122581
122582//------------------------------------------------------------------------------
122583
122584// We use node.js internal decoder. Its signature is the same as ours.
122585var StringDecoder = __webpack_require__(272).StringDecoder;
122586
122587if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method.
122588 StringDecoder.prototype.end = function() {};
122589
122590
122591function InternalDecoder(options, codec) {
122592 StringDecoder.call(this, codec.enc);
122593}
122594
122595InternalDecoder.prototype = StringDecoder.prototype;
122596
122597
122598//------------------------------------------------------------------------------
122599// Encoder is mostly trivial
122600
122601function InternalEncoder(options, codec) {
122602 this.enc = codec.enc;
122603}
122604
122605InternalEncoder.prototype.write = function(str) {
122606 return Buffer.from(str, this.enc);
122607}
122608
122609InternalEncoder.prototype.end = function() {
122610}
122611
122612
122613//------------------------------------------------------------------------------
122614// Except base64 encoder, which must keep its state.
122615
122616function InternalEncoderBase64(options, codec) {
122617 this.prevStr = '';
122618}
122619
122620InternalEncoderBase64.prototype.write = function(str) {
122621 str = this.prevStr + str;
122622 var completeQuads = str.length - (str.length % 4);
122623 this.prevStr = str.slice(completeQuads);
122624 str = str.slice(0, completeQuads);
122625
122626 return Buffer.from(str, "base64");
122627}
122628
122629InternalEncoderBase64.prototype.end = function() {
122630 return Buffer.from(this.prevStr, "base64");
122631}
122632
122633
122634//------------------------------------------------------------------------------
122635// CESU-8 encoder is also special.
122636
122637function InternalEncoderCesu8(options, codec) {
122638}
122639
122640InternalEncoderCesu8.prototype.write = function(str) {
122641 var buf = Buffer.alloc(str.length * 3), bufIdx = 0;
122642 for (var i = 0; i < str.length; i++) {
122643 var charCode = str.charCodeAt(i);
122644 // Naive implementation, but it works because CESU-8 is especially easy
122645 // to convert from UTF-16 (which all JS strings are encoded in).
122646 if (charCode < 0x80)
122647 buf[bufIdx++] = charCode;
122648 else if (charCode < 0x800) {
122649 buf[bufIdx++] = 0xC0 + (charCode >>> 6);
122650 buf[bufIdx++] = 0x80 + (charCode & 0x3f);
122651 }
122652 else { // charCode will always be < 0x10000 in javascript.
122653 buf[bufIdx++] = 0xE0 + (charCode >>> 12);
122654 buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f);
122655 buf[bufIdx++] = 0x80 + (charCode & 0x3f);
122656 }
122657 }
122658 return buf.slice(0, bufIdx);
122659}
122660
122661InternalEncoderCesu8.prototype.end = function() {
122662}
122663
122664//------------------------------------------------------------------------------
122665// CESU-8 decoder is not implemented in Node v4.0+
122666
122667function InternalDecoderCesu8(options, codec) {
122668 this.acc = 0;
122669 this.contBytes = 0;
122670 this.accBytes = 0;
122671 this.defaultCharUnicode = codec.defaultCharUnicode;
122672}
122673
122674InternalDecoderCesu8.prototype.write = function(buf) {
122675 var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes,
122676 res = '';
122677 for (var i = 0; i < buf.length; i++) {
122678 var curByte = buf[i];
122679 if ((curByte & 0xC0) !== 0x80) { // Leading byte
122680 if (contBytes > 0) { // Previous code is invalid
122681 res += this.defaultCharUnicode;
122682 contBytes = 0;
122683 }
122684
122685 if (curByte < 0x80) { // Single-byte code
122686 res += String.fromCharCode(curByte);
122687 } else if (curByte < 0xE0) { // Two-byte code
122688 acc = curByte & 0x1F;
122689 contBytes = 1; accBytes = 1;
122690 } else if (curByte < 0xF0) { // Three-byte code
122691 acc = curByte & 0x0F;
122692 contBytes = 2; accBytes = 1;
122693 } else { // Four or more are not supported for CESU-8.
122694 res += this.defaultCharUnicode;
122695 }
122696 } else { // Continuation byte
122697 if (contBytes > 0) { // We're waiting for it.
122698 acc = (acc << 6) | (curByte & 0x3f);
122699 contBytes--; accBytes++;
122700 if (contBytes === 0) {
122701 // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80)
122702 if (accBytes === 2 && acc < 0x80 && acc > 0)
122703 res += this.defaultCharUnicode;
122704 else if (accBytes === 3 && acc < 0x800)
122705 res += this.defaultCharUnicode;
122706 else
122707 // Actually add character.
122708 res += String.fromCharCode(acc);
122709 }
122710 } else { // Unexpected continuation byte
122711 res += this.defaultCharUnicode;
122712 }
122713 }
122714 }
122715 this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes;
122716 return res;
122717}
122718
122719InternalDecoderCesu8.prototype.end = function() {
122720 var res = 0;
122721 if (this.contBytes > 0)
122722 res += this.defaultCharUnicode;
122723 return res;
122724}
122725
122726
122727/***/ }),
122728/* 763 */
122729/***/ (function(module, exports, __webpack_require__) {
122730
122731"use strict";
122732
122733var Buffer = __webpack_require__(20).Buffer;
122734
122735// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that
122736// correspond to encoded bytes (if 128 - then lower half is ASCII).
122737
122738exports._sbcs = SBCSCodec;
122739function SBCSCodec(codecOptions, iconv) {
122740 if (!codecOptions)
122741 throw new Error("SBCS codec is called without the data.")
122742
122743 // Prepare char buffer for decoding.
122744 if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256))
122745 throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)");
122746
122747 if (codecOptions.chars.length === 128) {
122748 var asciiString = "";
122749 for (var i = 0; i < 128; i++)
122750 asciiString += String.fromCharCode(i);
122751 codecOptions.chars = asciiString + codecOptions.chars;
122752 }
122753
122754 this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2');
122755
122756 // Encoding buffer.
122757 var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0));
122758
122759 for (var i = 0; i < codecOptions.chars.length; i++)
122760 encodeBuf[codecOptions.chars.charCodeAt(i)] = i;
122761
122762 this.encodeBuf = encodeBuf;
122763}
122764
122765SBCSCodec.prototype.encoder = SBCSEncoder;
122766SBCSCodec.prototype.decoder = SBCSDecoder;
122767
122768
122769function SBCSEncoder(options, codec) {
122770 this.encodeBuf = codec.encodeBuf;
122771}
122772
122773SBCSEncoder.prototype.write = function(str) {
122774 var buf = Buffer.alloc(str.length);
122775 for (var i = 0; i < str.length; i++)
122776 buf[i] = this.encodeBuf[str.charCodeAt(i)];
122777
122778 return buf;
122779}
122780
122781SBCSEncoder.prototype.end = function() {
122782}
122783
122784
122785function SBCSDecoder(options, codec) {
122786 this.decodeBuf = codec.decodeBuf;
122787}
122788
122789SBCSDecoder.prototype.write = function(buf) {
122790 // Strings are immutable in JS -> we use ucs2 buffer to speed up computations.
122791 var decodeBuf = this.decodeBuf;
122792 var newBuf = Buffer.alloc(buf.length*2);
122793 var idx1 = 0, idx2 = 0;
122794 for (var i = 0; i < buf.length; i++) {
122795 idx1 = buf[i]*2; idx2 = i*2;
122796 newBuf[idx2] = decodeBuf[idx1];
122797 newBuf[idx2+1] = decodeBuf[idx1+1];
122798 }
122799 return newBuf.toString('ucs2');
122800}
122801
122802SBCSDecoder.prototype.end = function() {
122803}
122804
122805
122806/***/ }),
122807/* 764 */
122808/***/ (function(module, exports, __webpack_require__) {
122809
122810"use strict";
122811
122812
122813// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script.
122814module.exports = {
122815 "437": "cp437",
122816 "737": "cp737",
122817 "775": "cp775",
122818 "850": "cp850",
122819 "852": "cp852",
122820 "855": "cp855",
122821 "856": "cp856",
122822 "857": "cp857",
122823 "858": "cp858",
122824 "860": "cp860",
122825 "861": "cp861",
122826 "862": "cp862",
122827 "863": "cp863",
122828 "864": "cp864",
122829 "865": "cp865",
122830 "866": "cp866",
122831 "869": "cp869",
122832 "874": "windows874",
122833 "922": "cp922",
122834 "1046": "cp1046",
122835 "1124": "cp1124",
122836 "1125": "cp1125",
122837 "1129": "cp1129",
122838 "1133": "cp1133",
122839 "1161": "cp1161",
122840 "1162": "cp1162",
122841 "1163": "cp1163",
122842 "1250": "windows1250",
122843 "1251": "windows1251",
122844 "1252": "windows1252",
122845 "1253": "windows1253",
122846 "1254": "windows1254",
122847 "1255": "windows1255",
122848 "1256": "windows1256",
122849 "1257": "windows1257",
122850 "1258": "windows1258",
122851 "28591": "iso88591",
122852 "28592": "iso88592",
122853 "28593": "iso88593",
122854 "28594": "iso88594",
122855 "28595": "iso88595",
122856 "28596": "iso88596",
122857 "28597": "iso88597",
122858 "28598": "iso88598",
122859 "28599": "iso88599",
122860 "28600": "iso885910",
122861 "28601": "iso885911",
122862 "28603": "iso885913",
122863 "28604": "iso885914",
122864 "28605": "iso885915",
122865 "28606": "iso885916",
122866 "windows874": {
122867 "type": "_sbcs",
122868 "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
122869 },
122870 "win874": "windows874",
122871 "cp874": "windows874",
122872 "windows1250": {
122873 "type": "_sbcs",
122874 "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
122875 },
122876 "win1250": "windows1250",
122877 "cp1250": "windows1250",
122878 "windows1251": {
122879 "type": "_sbcs",
122880 "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
122881 },
122882 "win1251": "windows1251",
122883 "cp1251": "windows1251",
122884 "windows1252": {
122885 "type": "_sbcs",
122886 "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
122887 },
122888 "win1252": "windows1252",
122889 "cp1252": "windows1252",
122890 "windows1253": {
122891 "type": "_sbcs",
122892 "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"
122893 },
122894 "win1253": "windows1253",
122895 "cp1253": "windows1253",
122896 "windows1254": {
122897 "type": "_sbcs",
122898 "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
122899 },
122900 "win1254": "windows1254",
122901 "cp1254": "windows1254",
122902 "windows1255": {
122903 "type": "_sbcs",
122904 "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"
122905 },
122906 "win1255": "windows1255",
122907 "cp1255": "windows1255",
122908 "windows1256": {
122909 "type": "_sbcs",
122910 "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے"
122911 },
122912 "win1256": "windows1256",
122913 "cp1256": "windows1256",
122914 "windows1257": {
122915 "type": "_sbcs",
122916 "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙"
122917 },
122918 "win1257": "windows1257",
122919 "cp1257": "windows1257",
122920 "windows1258": {
122921 "type": "_sbcs",
122922 "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
122923 },
122924 "win1258": "windows1258",
122925 "cp1258": "windows1258",
122926 "iso88591": {
122927 "type": "_sbcs",
122928 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
122929 },
122930 "cp28591": "iso88591",
122931 "iso88592": {
122932 "type": "_sbcs",
122933 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙"
122934 },
122935 "cp28592": "iso88592",
122936 "iso88593": {
122937 "type": "_sbcs",
122938 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�Ż°ħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙"
122939 },
122940 "cp28593": "iso88593",
122941 "iso88594": {
122942 "type": "_sbcs",
122943 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤ĨĻ§¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩļˇ¸šēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖ×ØŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙"
122944 },
122945 "cp28594": "iso88594",
122946 "iso88595": {
122947 "type": "_sbcs",
122948 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ"
122949 },
122950 "cp28595": "iso88595",
122951 "iso88596": {
122952 "type": "_sbcs",
122953 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������"
122954 },
122955 "cp28596": "iso88596",
122956 "iso88597": {
122957 "type": "_sbcs",
122958 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�"
122959 },
122960 "cp28597": "iso88597",
122961 "iso88598": {
122962 "type": "_sbcs",
122963 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�"
122964 },
122965 "cp28598": "iso88598",
122966 "iso88599": {
122967 "type": "_sbcs",
122968 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖ×ØÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ"
122969 },
122970 "cp28599": "iso88599",
122971 "iso885910": {
122972 "type": "_sbcs",
122973 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨĶ§ĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ"
122974 },
122975 "cp28600": "iso885910",
122976 "iso885911": {
122977 "type": "_sbcs",
122978 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
122979 },
122980 "cp28601": "iso885911",
122981 "iso885913": {
122982 "type": "_sbcs",
122983 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’"
122984 },
122985 "cp28603": "iso885913",
122986 "iso885914": {
122987 "type": "_sbcs",
122988 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ"
122989 },
122990 "cp28604": "iso885914",
122991 "iso885915": {
122992 "type": "_sbcs",
122993 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
122994 },
122995 "cp28605": "iso885915",
122996 "iso885916": {
122997 "type": "_sbcs",
122998 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Š§š©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ"
122999 },
123000 "cp28606": "iso885916",
123001 "cp437": {
123002 "type": "_sbcs",
123003 "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
123004 },
123005 "ibm437": "cp437",
123006 "csibm437": "cp437",
123007 "cp737": {
123008 "type": "_sbcs",
123009 "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ "
123010 },
123011 "ibm737": "cp737",
123012 "csibm737": "cp737",
123013 "cp775": {
123014 "type": "_sbcs",
123015 "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£ØפĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ "
123016 },
123017 "ibm775": "cp775",
123018 "csibm775": "cp775",
123019 "cp850": {
123020 "type": "_sbcs",
123021 "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "
123022 },
123023 "ibm850": "cp850",
123024 "csibm850": "cp850",
123025 "cp852": {
123026 "type": "_sbcs",
123027 "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ "
123028 },
123029 "ibm852": "cp852",
123030 "csibm852": "cp852",
123031 "cp855": {
123032 "type": "_sbcs",
123033 "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ "
123034 },
123035 "ibm855": "cp855",
123036 "csibm855": "cp855",
123037 "cp856": {
123038 "type": "_sbcs",
123039 "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ "
123040 },
123041 "ibm856": "cp856",
123042 "csibm856": "cp856",
123043 "cp857": {
123044 "type": "_sbcs",
123045 "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ "
123046 },
123047 "ibm857": "cp857",
123048 "csibm857": "cp857",
123049 "cp858": {
123050 "type": "_sbcs",
123051 "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø׃áíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ "
123052 },
123053 "ibm858": "cp858",
123054 "csibm858": "cp858",
123055 "cp860": {
123056 "type": "_sbcs",
123057 "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
123058 },
123059 "ibm860": "cp860",
123060 "csibm860": "cp860",
123061 "cp861": {
123062 "type": "_sbcs",
123063 "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
123064 },
123065 "ibm861": "cp861",
123066 "csibm861": "cp861",
123067 "cp862": {
123068 "type": "_sbcs",
123069 "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
123070 },
123071 "ibm862": "cp862",
123072 "csibm862": "cp862",
123073 "cp863": {
123074 "type": "_sbcs",
123075 "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
123076 },
123077 "ibm863": "cp863",
123078 "csibm863": "cp863",
123079 "cp864": {
123080 "type": "_sbcs",
123081 "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�"
123082 },
123083 "ibm864": "cp864",
123084 "csibm864": "cp864",
123085 "cp865": {
123086 "type": "_sbcs",
123087 "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
123088 },
123089 "ibm865": "cp865",
123090 "csibm865": "cp865",
123091 "cp866": {
123092 "type": "_sbcs",
123093 "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ "
123094 },
123095 "ibm866": "cp866",
123096 "csibm866": "cp866",
123097 "cp869": {
123098 "type": "_sbcs",
123099 "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ "
123100 },
123101 "ibm869": "cp869",
123102 "csibm869": "cp869",
123103 "cp922": {
123104 "type": "_sbcs",
123105 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖ×ØÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ"
123106 },
123107 "ibm922": "cp922",
123108 "csibm922": "cp922",
123109 "cp1046": {
123110 "type": "_sbcs",
123111 "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�"
123112 },
123113 "ibm1046": "cp1046",
123114 "csibm1046": "cp1046",
123115 "cp1124": {
123116 "type": "_sbcs",
123117 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ"
123118 },
123119 "ibm1124": "cp1124",
123120 "csibm1124": "cp1124",
123121 "cp1125": {
123122 "type": "_sbcs",
123123 "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ "
123124 },
123125 "ibm1125": "cp1125",
123126 "csibm1125": "cp1125",
123127 "cp1129": {
123128 "type": "_sbcs",
123129 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
123130 },
123131 "ibm1129": "cp1129",
123132 "csibm1129": "cp1129",
123133 "cp1133": {
123134 "type": "_sbcs",
123135 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�"
123136 },
123137 "ibm1133": "cp1133",
123138 "csibm1133": "cp1133",
123139 "cp1161": {
123140 "type": "_sbcs",
123141 "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ "
123142 },
123143 "ibm1161": "cp1161",
123144 "csibm1161": "cp1161",
123145 "cp1162": {
123146 "type": "_sbcs",
123147 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
123148 },
123149 "ibm1162": "cp1162",
123150 "csibm1162": "cp1162",
123151 "cp1163": {
123152 "type": "_sbcs",
123153 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖ×ØÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ"
123154 },
123155 "ibm1163": "cp1163",
123156 "csibm1163": "cp1163",
123157 "maccroatian": {
123158 "type": "_sbcs",
123159 "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈Ć«Č… ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"
123160 },
123161 "maccyrillic": {
123162 "type": "_sbcs",
123163 "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
123164 },
123165 "macgreek": {
123166 "type": "_sbcs",
123167 "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�"
123168 },
123169 "maciceland": {
123170 "type": "_sbcs",
123171 "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüÝ°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
123172 },
123173 "macroman": {
123174 "type": "_sbcs",
123175 "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
123176 },
123177 "macromania": {
123178 "type": "_sbcs",
123179 "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
123180 },
123181 "macthai": {
123182 "type": "_sbcs",
123183 "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����"
123184 },
123185 "macturkish": {
123186 "type": "_sbcs",
123187 "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ"
123188 },
123189 "macukraine": {
123190 "type": "_sbcs",
123191 "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤"
123192 },
123193 "koi8r": {
123194 "type": "_sbcs",
123195 "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
123196 },
123197 "koi8u": {
123198 "type": "_sbcs",
123199 "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
123200 },
123201 "koi8ru": {
123202 "type": "_sbcs",
123203 "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
123204 },
123205 "koi8t": {
123206 "type": "_sbcs",
123207 "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ"
123208 },
123209 "armscii8": {
123210 "type": "_sbcs",
123211 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�"
123212 },
123213 "rk1048": {
123214 "type": "_sbcs",
123215 "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
123216 },
123217 "tcvn": {
123218 "type": "_sbcs",
123219 "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ"
123220 },
123221 "georgianacademy": {
123222 "type": "_sbcs",
123223 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
123224 },
123225 "georgianps": {
123226 "type": "_sbcs",
123227 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ"
123228 },
123229 "pt154": {
123230 "type": "_sbcs",
123231 "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя"
123232 },
123233 "viscii": {
123234 "type": "_sbcs",
123235 "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ"
123236 },
123237 "iso646cn": {
123238 "type": "_sbcs",
123239 "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"
123240 },
123241 "iso646jp": {
123242 "type": "_sbcs",
123243 "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������"
123244 },
123245 "hproman8": {
123246 "type": "_sbcs",
123247 "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�"
123248 },
123249 "macintosh": {
123250 "type": "_sbcs",
123251 "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ"
123252 },
123253 "ascii": {
123254 "type": "_sbcs",
123255 "chars": "��������������������������������������������������������������������������������������������������������������������������������"
123256 },
123257 "tis620": {
123258 "type": "_sbcs",
123259 "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
123260 }
123261}
123262
123263/***/ }),
123264/* 765 */
123265/***/ (function(module, exports, __webpack_require__) {
123266
123267"use strict";
123268
123269
123270// Manually added data to be used by sbcs codec in addition to generated one.
123271
123272module.exports = {
123273 // Not supported by iconv, not sure why.
123274 "10029": "maccenteuro",
123275 "maccenteuro": {
123276 "type": "_sbcs",
123277 "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ"
123278 },
123279
123280 "808": "cp808",
123281 "ibm808": "cp808",
123282 "cp808": {
123283 "type": "_sbcs",
123284 "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ "
123285 },
123286
123287 "mik": {
123288 "type": "_sbcs",
123289 "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ "
123290 },
123291
123292 // Aliases of generated encodings.
123293 "ascii8bit": "ascii",
123294 "usascii": "ascii",
123295 "ansix34": "ascii",
123296 "ansix341968": "ascii",
123297 "ansix341986": "ascii",
123298 "csascii": "ascii",
123299 "cp367": "ascii",
123300 "ibm367": "ascii",
123301 "isoir6": "ascii",
123302 "iso646us": "ascii",
123303 "iso646irv": "ascii",
123304 "us": "ascii",
123305
123306 "latin1": "iso88591",
123307 "latin2": "iso88592",
123308 "latin3": "iso88593",
123309 "latin4": "iso88594",
123310 "latin5": "iso88599",
123311 "latin6": "iso885910",
123312 "latin7": "iso885913",
123313 "latin8": "iso885914",
123314 "latin9": "iso885915",
123315 "latin10": "iso885916",
123316
123317 "csisolatin1": "iso88591",
123318 "csisolatin2": "iso88592",
123319 "csisolatin3": "iso88593",
123320 "csisolatin4": "iso88594",
123321 "csisolatincyrillic": "iso88595",
123322 "csisolatinarabic": "iso88596",
123323 "csisolatingreek" : "iso88597",
123324 "csisolatinhebrew": "iso88598",
123325 "csisolatin5": "iso88599",
123326 "csisolatin6": "iso885910",
123327
123328 "l1": "iso88591",
123329 "l2": "iso88592",
123330 "l3": "iso88593",
123331 "l4": "iso88594",
123332 "l5": "iso88599",
123333 "l6": "iso885910",
123334 "l7": "iso885913",
123335 "l8": "iso885914",
123336 "l9": "iso885915",
123337 "l10": "iso885916",
123338
123339 "isoir14": "iso646jp",
123340 "isoir57": "iso646cn",
123341 "isoir100": "iso88591",
123342 "isoir101": "iso88592",
123343 "isoir109": "iso88593",
123344 "isoir110": "iso88594",
123345 "isoir144": "iso88595",
123346 "isoir127": "iso88596",
123347 "isoir126": "iso88597",
123348 "isoir138": "iso88598",
123349 "isoir148": "iso88599",
123350 "isoir157": "iso885910",
123351 "isoir166": "tis620",
123352 "isoir179": "iso885913",
123353 "isoir199": "iso885914",
123354 "isoir203": "iso885915",
123355 "isoir226": "iso885916",
123356
123357 "cp819": "iso88591",
123358 "ibm819": "iso88591",
123359
123360 "cyrillic": "iso88595",
123361
123362 "arabic": "iso88596",
123363 "arabic8": "iso88596",
123364 "ecma114": "iso88596",
123365 "asmo708": "iso88596",
123366
123367 "greek" : "iso88597",
123368 "greek8" : "iso88597",
123369 "ecma118" : "iso88597",
123370 "elot928" : "iso88597",
123371
123372 "hebrew": "iso88598",
123373 "hebrew8": "iso88598",
123374
123375 "turkish": "iso88599",
123376 "turkish8": "iso88599",
123377
123378 "thai": "iso885911",
123379 "thai8": "iso885911",
123380
123381 "celtic": "iso885914",
123382 "celtic8": "iso885914",
123383 "isoceltic": "iso885914",
123384
123385 "tis6200": "tis620",
123386 "tis62025291": "tis620",
123387 "tis62025330": "tis620",
123388
123389 "10000": "macroman",
123390 "10006": "macgreek",
123391 "10007": "maccyrillic",
123392 "10079": "maciceland",
123393 "10081": "macturkish",
123394
123395 "cspc8codepage437": "cp437",
123396 "cspc775baltic": "cp775",
123397 "cspc850multilingual": "cp850",
123398 "cspcp852": "cp852",
123399 "cspc862latinhebrew": "cp862",
123400 "cpgr": "cp869",
123401
123402 "msee": "cp1250",
123403 "mscyrl": "cp1251",
123404 "msansi": "cp1252",
123405 "msgreek": "cp1253",
123406 "msturk": "cp1254",
123407 "mshebr": "cp1255",
123408 "msarab": "cp1256",
123409 "winbaltrim": "cp1257",
123410
123411 "cp20866": "koi8r",
123412 "20866": "koi8r",
123413 "ibm878": "koi8r",
123414 "cskoi8r": "koi8r",
123415
123416 "cp21866": "koi8u",
123417 "21866": "koi8u",
123418 "ibm1168": "koi8u",
123419
123420 "strk10482002": "rk1048",
123421
123422 "tcvn5712": "tcvn",
123423 "tcvn57121": "tcvn",
123424
123425 "gb198880": "iso646cn",
123426 "cn": "iso646cn",
123427
123428 "csiso14jisc6220ro": "iso646jp",
123429 "jisc62201969ro": "iso646jp",
123430 "jp": "iso646jp",
123431
123432 "cshproman8": "hproman8",
123433 "r8": "hproman8",
123434 "roman8": "hproman8",
123435 "xroman8": "hproman8",
123436 "ibm1051": "hproman8",
123437
123438 "mac": "macintosh",
123439 "csmacintosh": "macintosh",
123440};
123441
123442
123443
123444/***/ }),
123445/* 766 */
123446/***/ (function(module, exports) {
123447
123448module.exports = [["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"],["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"],["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"],["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"],["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"],["8940","𪎩𡅅"],["8943","攊"],["8946","丽滝鵎釟"],["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"],["89a1","琑糼緍楆竉刧"],["89ab","醌碸酞肼"],["89b0","贋胶𠧧"],["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"],["89c1","溚舾甙"],["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"],["8a40","𧶄唥"],["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"],["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"],["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"],["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"],["8aac","䠋𠆩㿺塳𢶍"],["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"],["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"],["8ac9","𪘁𠸉𢫏𢳉"],["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"],["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"],["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"],["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"],["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"],["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"],["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"],["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"],["8ca1","𣏹椙橃𣱣泿"],["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"],["8cc9","顨杫䉶圽"],["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"],["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"],["8d40","𠮟"],["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"],["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"],["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"],["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"],["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"],["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"],["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"],["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"],["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"],["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"],["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"],["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"],["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"],["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"],["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"],["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"],["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"],["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"],["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"],["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"],["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"],["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"],["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"],["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"],["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"],["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"],["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"],["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"],["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"],["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"],["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"],["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"],["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"],["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"],["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"],["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"],["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"],["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"],["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"],["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"],["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"],["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"],["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"],["9fae","酙隁酜"],["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"],["9fc1","𤤙盖鮝个𠳔莾衂"],["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"],["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"],["9fe7","毺蠘罸"],["9feb","嘠𪙊蹷齓"],["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"],["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"],["a055","𡠻𦸅"],["a058","詾𢔛"],["a05b","惽癧髗鵄鍮鮏蟵"],["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"],["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"],["a0a1","嵗𨯂迚𨸹"],["a0a6","僙𡵆礆匲阸𠼻䁥"],["a0ae","矾"],["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"],["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"],["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"],["a3c0","␀",31,"␡"],["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23],["c740","す",58,"ァアィイ"],["c7a1","ゥ",81,"А",5,"ЁЖ",4],["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"],["c8a1","龰冈龱𧘇"],["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"],["c8f5","ʃɐɛɔɵœøŋʊɪ"],["f9fe","■"],["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"],["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"],["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"],["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"],["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"],["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"],["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"],["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"],["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"],["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"]]
123449
123450/***/ }),
123451/* 767 */
123452/***/ (function(module, exports) {
123453
123454module.exports = [["0","\u0000",127],["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"],["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"],["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"],["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5],["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"],["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18],["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7],["8361","긝",18,"긲긳긵긶긹긻긼"],["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8],["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8],["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18],["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"],["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4],["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"],["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"],["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"],["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10],["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"],["8741","놞",9,"놩",15],["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"],["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4],["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4],["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"],["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"],["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"],["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"],["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15],["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"],["8a61","둧",4,"둭",18,"뒁뒂"],["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"],["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"],["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8],["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18],["8c41","똀",15,"똒똓똕똖똗똙",4],["8c61","똞",6,"똦",5,"똭",6,"똵",5],["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16],["8d41","뛃",16,"뛕",8],["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"],["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"],["8e41","랟랡",6,"랪랮",5,"랶랷랹",8],["8e61","럂",4,"럈럊",19],["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7],["8f41","뢅",7,"뢎",17],["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4],["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5],["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"],["9061","륾",5,"릆릈릋릌릏",15],["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"],["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5],["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5],["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6],["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"],["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4],["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"],["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"],["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8],["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"],["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8],["9461","봞",5,"봥",6,"봭",12],["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24],["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"],["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"],["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14],["9641","뺸",23,"뻒뻓"],["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8],["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44],["9741","뾃",16,"뾕",8],["9761","뾞",17,"뾱",7],["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"],["9841","쁀",16,"쁒",5,"쁙쁚쁛"],["9861","쁝쁞쁟쁡",6,"쁪",15],["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"],["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"],["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"],["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"],["9a41","숤숥숦숧숪숬숮숰숳숵",16],["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"],["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"],["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8],["9b61","쌳",17,"썆",7],["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"],["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5],["9c61","쏿",8,"쐉",6,"쐑",9],["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12],["9d41","쒪",13,"쒹쒺쒻쒽",8],["9d61","쓆",25],["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"],["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"],["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"],["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"],["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"],["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"],["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"],["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"],["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13],["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"],["a141","좥좦좧좩",18,"좾좿죀죁"],["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"],["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"],["a241","줐줒",5,"줙",18],["a261","줭",6,"줵",18],["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"],["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"],["a361","즑",6,"즚즜즞",16],["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"],["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"],["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12],["a481","쨦쨧쨨쨪",28,"ㄱ",93],["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"],["a561","쩫",17,"쩾",5,"쪅쪆"],["a581","쪇",16,"쪙",14,"ⅰ",9],["a5b0","Ⅰ",9],["a5c1","Α",16,"Σ",6],["a5e1","α",16,"σ",6],["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"],["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6],["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7],["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7],["a761","쬪",22,"쭂쭃쭄"],["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"],["a841","쭭",10,"쭺",14],["a861","쮉",18,"쮝",6],["a881","쮤",19,"쮹",11,"ÆЪĦ"],["a8a6","IJ"],["a8a8","ĿŁØŒºÞŦŊ"],["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"],["a941","쯅",14,"쯕",10],["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18],["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"],["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"],["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"],["aa81","챳챴챶",29,"ぁ",82],["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"],["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5],["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85],["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"],["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4],["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25],["acd1","а",5,"ёж",25],["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7],["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"],["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"],["ae41","췆",5,"췍췎췏췑",16],["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4],["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"],["af41","츬츭츮츯츲츴츶",19],["af61","칊",13,"칚칛칝칞칢",5,"칪칬"],["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"],["b041","캚",5,"캢캦",5,"캮",12],["b061","캻",5,"컂",19],["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"],["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"],["b161","켥",6,"켮켲",5,"켹",11],["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"],["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"],["b261","쾎",18,"쾢",5,"쾩"],["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"],["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"],["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5],["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"],["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5],["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"],["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"],["b541","킕",14,"킦킧킩킪킫킭",5],["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4],["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"],["b641","턅",7,"턎",17],["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"],["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"],["b741","텮",13,"텽",6,"톅톆톇톉톊"],["b761","톋",20,"톢톣톥톦톧"],["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"],["b841","퇐",7,"퇙",17],["b861","퇫",8,"퇵퇶퇷퇹",13],["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"],["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"],["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"],["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"],["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"],["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5],["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"],["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"],["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"],["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"],["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"],["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"],["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"],["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"],["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13],["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"],["be41","퐸",7,"푁푂푃푅",14],["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"],["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"],["bf41","풞",10,"풪",14],["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"],["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"],["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5],["c061","픞",25],["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"],["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"],["c161","햌햍햎햏햑",19,"햦햧"],["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"],["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"],["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"],["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"],["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4],["c361","홢",4,"홨홪",5,"홲홳홵",11],["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"],["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"],["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4],["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"],["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"],["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4],["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"],["c641","힍힎힏힑",6,"힚힜힞",5],["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"],["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"],["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"],["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"],["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"],["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"],["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"],["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"],["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"],["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"],["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"],["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"],["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"],["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"],["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"],["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"],["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"],["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"],["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"],["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"],["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"],["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"],["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"],["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"],["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"],["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"],["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"],["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"],["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"],["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"],["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"],["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"],["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"],["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"],["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"],["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"],["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"],["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"],["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"],["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"],["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"],["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"],["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"],["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"],["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"],["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"],["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"],["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"],["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"],["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"],["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"],["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"],["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"],["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"],["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"]]
123455
123456/***/ }),
123457/* 768 */
123458/***/ (function(module, exports) {
123459
123460module.exports = [["0","\u0000",127],["8ea1","。",62],["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"],["a2a1","◆□■△▲▽▼※〒→←↑↓〓"],["a2ba","∈∋⊆⊇⊂⊃∪∩"],["a2ca","∧∨¬⇒⇔∀∃"],["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["a2f2","ʼn♯♭♪†‡¶"],["a2fe","◯"],["a3b0","0",9],["a3c1","A",25],["a3e1","a",25],["a4a1","ぁ",82],["a5a1","ァ",85],["a6a1","Α",16,"Σ",6],["a6c1","α",16,"σ",6],["a7a1","А",5,"ЁЖ",25],["a7d1","а",5,"ёж",25],["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["ada1","①",19,"Ⅰ",9],["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"],["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"],["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"],["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"],["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"],["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"],["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"],["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"],["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"],["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"],["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"],["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"],["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"],["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"],["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"],["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"],["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"],["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"],["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"],["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"],["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"],["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"],["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"],["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"],["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"],["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"],["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"],["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"],["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"],["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"],["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"],["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"],["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"],["f4a1","堯槇遙瑤凜熙"],["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"],["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"],["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["fcf1","ⅰ",9,"¬¦'""],["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"],["8fa2c2","¡¦¿"],["8fa2eb","ºª©®™¤№"],["8fa6e1","ΆΈΉΊΪ"],["8fa6e7","Ό"],["8fa6e9","ΎΫ"],["8fa6ec","Ώ"],["8fa6f1","άέήίϊΐόςύϋΰώ"],["8fa7c2","Ђ",10,"ЎЏ"],["8fa7f2","ђ",10,"ўџ"],["8fa9a1","ÆĐ"],["8fa9a4","Ħ"],["8fa9a6","IJ"],["8fa9a8","ŁĿ"],["8fa9ab","ŊØŒ"],["8fa9af","ŦÞ"],["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"],["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"],["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"],["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"],["8fabbd","ġĥíìïîǐ"],["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"],["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"],["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"],["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"],["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"],["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"],["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"],["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"],["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"],["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"],["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"],["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"],["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"],["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"],["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"],["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"],["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"],["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"],["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"],["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"],["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"],["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"],["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"],["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"],["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"],["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"],["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"],["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"],["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"],["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"],["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"],["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"],["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"],["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"],["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"],["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5],["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"],["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"],["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"],["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"],["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"],["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"],["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"],["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"],["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"],["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"],["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"],["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"],["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"],["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"],["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"],["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"],["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"],["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"],["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"],["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"],["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"],["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"],["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4],["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"],["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"],["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"],["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"]]
123461
123462/***/ }),
123463/* 769 */
123464/***/ (function(module, exports) {
123465
123466module.exports = {"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]}
123467
123468/***/ }),
123469/* 770 */
123470/***/ (function(module, exports) {
123471
123472module.exports = [["0","\u0000",128],["a1","。",62],["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"],["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"],["81b8","∈∋⊆⊇⊂⊃∪∩"],["81c8","∧∨¬⇒⇔∀∃"],["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"],["81f0","ʼn♯♭♪†‡¶"],["81fc","◯"],["824f","0",9],["8260","A",25],["8281","a",25],["829f","ぁ",82],["8340","ァ",62],["8380","ム",22],["839f","Α",16,"Σ",6],["83bf","α",16,"σ",6],["8440","А",5,"ЁЖ",25],["8470","а",5,"ёж",7],["8480","о",17],["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"],["8740","①",19,"Ⅰ",9],["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"],["877e","㍻"],["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"],["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"],["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"],["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"],["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"],["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"],["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"],["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"],["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"],["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"],["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"],["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"],["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"],["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"],["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"],["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"],["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"],["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"],["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"],["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"],["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"],["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"],["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"],["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"],["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"],["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"],["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"],["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"],["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"],["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"],["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"],["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"],["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"],["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"],["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"],["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"],["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"],["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"],["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"],["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"],["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"],["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"],["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"],["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"],["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"],["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"],["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"],["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"],["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"],["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"],["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"],["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"],["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"],["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"],["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"],["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"],["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"],["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"],["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"],["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"],["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"],["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"],["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"],["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"],["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"],["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"],["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"],["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"],["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"],["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"],["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"],["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"],["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"],["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"],["eeef","ⅰ",9,"¬¦'""],["f040","",62],["f080","",124],["f140","",62],["f180","",124],["f240","",62],["f280","",124],["f340","",62],["f380","",124],["f440","",62],["f480","",124],["f540","",62],["f580","",124],["f640","",62],["f680","",124],["f740","",62],["f780","",124],["f840","",62],["f880","",124],["f940",""],["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"],["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"],["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"],["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"],["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"]]
123473
123474/***/ }),
123475/* 771 */
123476/***/ (function(module, exports, __webpack_require__) {
123477
123478"use strict";
123479
123480var Buffer = __webpack_require__(20).Buffer;
123481
123482// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js
123483
123484// == UTF16-BE codec. ==========================================================
123485
123486exports.utf16be = Utf16BECodec;
123487function Utf16BECodec() {
123488}
123489
123490Utf16BECodec.prototype.encoder = Utf16BEEncoder;
123491Utf16BECodec.prototype.decoder = Utf16BEDecoder;
123492Utf16BECodec.prototype.bomAware = true;
123493
123494
123495// -- Encoding
123496
123497function Utf16BEEncoder() {
123498}
123499
123500Utf16BEEncoder.prototype.write = function(str) {
123501 var buf = Buffer.from(str, 'ucs2');
123502 for (var i = 0; i < buf.length; i += 2) {
123503 var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp;
123504 }
123505 return buf;
123506}
123507
123508Utf16BEEncoder.prototype.end = function() {
123509}
123510
123511
123512// -- Decoding
123513
123514function Utf16BEDecoder() {
123515 this.overflowByte = -1;
123516}
123517
123518Utf16BEDecoder.prototype.write = function(buf) {
123519 if (buf.length == 0)
123520 return '';
123521
123522 var buf2 = Buffer.alloc(buf.length + 1),
123523 i = 0, j = 0;
123524
123525 if (this.overflowByte !== -1) {
123526 buf2[0] = buf[0];
123527 buf2[1] = this.overflowByte;
123528 i = 1; j = 2;
123529 }
123530
123531 for (; i < buf.length-1; i += 2, j+= 2) {
123532 buf2[j] = buf[i+1];
123533 buf2[j+1] = buf[i];
123534 }
123535
123536 this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1;
123537
123538 return buf2.slice(0, j).toString('ucs2');
123539}
123540
123541Utf16BEDecoder.prototype.end = function() {
123542}
123543
123544
123545// == UTF-16 codec =============================================================
123546// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic.
123547// Defaults to UTF-16LE, as it's prevalent and default in Node.
123548// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le
123549// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'});
123550
123551// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false).
123552
123553exports.utf16 = Utf16Codec;
123554function Utf16Codec(codecOptions, iconv) {
123555 this.iconv = iconv;
123556}
123557
123558Utf16Codec.prototype.encoder = Utf16Encoder;
123559Utf16Codec.prototype.decoder = Utf16Decoder;
123560
123561
123562// -- Encoding (pass-through)
123563
123564function Utf16Encoder(options, codec) {
123565 options = options || {};
123566 if (options.addBOM === undefined)
123567 options.addBOM = true;
123568 this.encoder = codec.iconv.getEncoder('utf-16le', options);
123569}
123570
123571Utf16Encoder.prototype.write = function(str) {
123572 return this.encoder.write(str);
123573}
123574
123575Utf16Encoder.prototype.end = function() {
123576 return this.encoder.end();
123577}
123578
123579
123580// -- Decoding
123581
123582function Utf16Decoder(options, codec) {
123583 this.decoder = null;
123584 this.initialBytes = [];
123585 this.initialBytesLen = 0;
123586
123587 this.options = options || {};
123588 this.iconv = codec.iconv;
123589}
123590
123591Utf16Decoder.prototype.write = function(buf) {
123592 if (!this.decoder) {
123593 // Codec is not chosen yet. Accumulate initial bytes.
123594 this.initialBytes.push(buf);
123595 this.initialBytesLen += buf.length;
123596
123597 if (this.initialBytesLen < 16) // We need more bytes to use space heuristic (see below)
123598 return '';
123599
123600 // We have enough bytes -> detect endianness.
123601 var buf = Buffer.concat(this.initialBytes),
123602 encoding = detectEncoding(buf, this.options.defaultEncoding);
123603 this.decoder = this.iconv.getDecoder(encoding, this.options);
123604 this.initialBytes.length = this.initialBytesLen = 0;
123605 }
123606
123607 return this.decoder.write(buf);
123608}
123609
123610Utf16Decoder.prototype.end = function() {
123611 if (!this.decoder) {
123612 var buf = Buffer.concat(this.initialBytes),
123613 encoding = detectEncoding(buf, this.options.defaultEncoding);
123614 this.decoder = this.iconv.getDecoder(encoding, this.options);
123615
123616 var res = this.decoder.write(buf),
123617 trail = this.decoder.end();
123618
123619 return trail ? (res + trail) : res;
123620 }
123621 return this.decoder.end();
123622}
123623
123624function detectEncoding(buf, defaultEncoding) {
123625 var enc = defaultEncoding || 'utf-16le';
123626
123627 if (buf.length >= 2) {
123628 // Check BOM.
123629 if (buf[0] == 0xFE && buf[1] == 0xFF) // UTF-16BE BOM
123630 enc = 'utf-16be';
123631 else if (buf[0] == 0xFF && buf[1] == 0xFE) // UTF-16LE BOM
123632 enc = 'utf-16le';
123633 else {
123634 // No BOM found. Try to deduce encoding from initial content.
123635 // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon.
123636 // So, we count ASCII as if it was LE or BE, and decide from that.
123637 var asciiCharsLE = 0, asciiCharsBE = 0, // Counts of chars in both positions
123638 _len = Math.min(buf.length - (buf.length % 2), 64); // Len is always even.
123639
123640 for (var i = 0; i < _len; i += 2) {
123641 if (buf[i] === 0 && buf[i+1] !== 0) asciiCharsBE++;
123642 if (buf[i] !== 0 && buf[i+1] === 0) asciiCharsLE++;
123643 }
123644
123645 if (asciiCharsBE > asciiCharsLE)
123646 enc = 'utf-16be';
123647 else if (asciiCharsBE < asciiCharsLE)
123648 enc = 'utf-16le';
123649 }
123650 }
123651
123652 return enc;
123653}
123654
123655
123656
123657
123658/***/ }),
123659/* 772 */
123660/***/ (function(module, exports, __webpack_require__) {
123661
123662"use strict";
123663
123664var Buffer = __webpack_require__(20).Buffer;
123665
123666// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152
123667// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3
123668
123669exports.utf7 = Utf7Codec;
123670exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7
123671function Utf7Codec(codecOptions, iconv) {
123672 this.iconv = iconv;
123673};
123674
123675Utf7Codec.prototype.encoder = Utf7Encoder;
123676Utf7Codec.prototype.decoder = Utf7Decoder;
123677Utf7Codec.prototype.bomAware = true;
123678
123679
123680// -- Encoding
123681
123682var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;
123683
123684function Utf7Encoder(options, codec) {
123685 this.iconv = codec.iconv;
123686}
123687
123688Utf7Encoder.prototype.write = function(str) {
123689 // Naive implementation.
123690 // Non-direct chars are encoded as "+<base64>-"; single "+" char is encoded as "+-".
123691 return Buffer.from(str.replace(nonDirectChars, function(chunk) {
123692 return "+" + (chunk === '+' ? '' :
123693 this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, ''))
123694 + "-";
123695 }.bind(this)));
123696}
123697
123698Utf7Encoder.prototype.end = function() {
123699}
123700
123701
123702// -- Decoding
123703
123704function Utf7Decoder(options, codec) {
123705 this.iconv = codec.iconv;
123706 this.inBase64 = false;
123707 this.base64Accum = '';
123708}
123709
123710var base64Regex = /[A-Za-z0-9\/+]/;
123711var base64Chars = [];
123712for (var i = 0; i < 256; i++)
123713 base64Chars[i] = base64Regex.test(String.fromCharCode(i));
123714
123715var plusChar = '+'.charCodeAt(0),
123716 minusChar = '-'.charCodeAt(0),
123717 andChar = '&'.charCodeAt(0);
123718
123719Utf7Decoder.prototype.write = function(buf) {
123720 var res = "", lastI = 0,
123721 inBase64 = this.inBase64,
123722 base64Accum = this.base64Accum;
123723
123724 // The decoder is more involved as we must handle chunks in stream.
123725
123726 for (var i = 0; i < buf.length; i++) {
123727 if (!inBase64) { // We're in direct mode.
123728 // Write direct chars until '+'
123729 if (buf[i] == plusChar) {
123730 res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
123731 lastI = i+1;
123732 inBase64 = true;
123733 }
123734 } else { // We decode base64.
123735 if (!base64Chars[buf[i]]) { // Base64 ended.
123736 if (i == lastI && buf[i] == minusChar) {// "+-" -> "+"
123737 res += "+";
123738 } else {
123739 var b64str = base64Accum + buf.slice(lastI, i).toString();
123740 res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
123741 }
123742
123743 if (buf[i] != minusChar) // Minus is absorbed after base64.
123744 i--;
123745
123746 lastI = i+1;
123747 inBase64 = false;
123748 base64Accum = '';
123749 }
123750 }
123751 }
123752
123753 if (!inBase64) {
123754 res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
123755 } else {
123756 var b64str = base64Accum + buf.slice(lastI).toString();
123757
123758 var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
123759 base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
123760 b64str = b64str.slice(0, canBeDecoded);
123761
123762 res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
123763 }
123764
123765 this.inBase64 = inBase64;
123766 this.base64Accum = base64Accum;
123767
123768 return res;
123769}
123770
123771Utf7Decoder.prototype.end = function() {
123772 var res = "";
123773 if (this.inBase64 && this.base64Accum.length > 0)
123774 res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
123775
123776 this.inBase64 = false;
123777 this.base64Accum = '';
123778 return res;
123779}
123780
123781
123782// UTF-7-IMAP codec.
123783// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3)
123784// Differences:
123785// * Base64 part is started by "&" instead of "+"
123786// * Direct characters are 0x20-0x7E, except "&" (0x26)
123787// * In Base64, "," is used instead of "/"
123788// * Base64 must not be used to represent direct characters.
123789// * No implicit shift back from Base64 (should always end with '-')
123790// * String must end in non-shifted position.
123791// * "-&" while in base64 is not allowed.
123792
123793
123794exports.utf7imap = Utf7IMAPCodec;
123795function Utf7IMAPCodec(codecOptions, iconv) {
123796 this.iconv = iconv;
123797};
123798
123799Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder;
123800Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder;
123801Utf7IMAPCodec.prototype.bomAware = true;
123802
123803
123804// -- Encoding
123805
123806function Utf7IMAPEncoder(options, codec) {
123807 this.iconv = codec.iconv;
123808 this.inBase64 = false;
123809 this.base64Accum = Buffer.alloc(6);
123810 this.base64AccumIdx = 0;
123811}
123812
123813Utf7IMAPEncoder.prototype.write = function(str) {
123814 var inBase64 = this.inBase64,
123815 base64Accum = this.base64Accum,
123816 base64AccumIdx = this.base64AccumIdx,
123817 buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0;
123818
123819 for (var i = 0; i < str.length; i++) {
123820 var uChar = str.charCodeAt(i);
123821 if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'.
123822 if (inBase64) {
123823 if (base64AccumIdx > 0) {
123824 bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
123825 base64AccumIdx = 0;
123826 }
123827
123828 buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
123829 inBase64 = false;
123830 }
123831
123832 if (!inBase64) {
123833 buf[bufIdx++] = uChar; // Write direct character
123834
123835 if (uChar === andChar) // Ampersand -> '&-'
123836 buf[bufIdx++] = minusChar;
123837 }
123838
123839 } else { // Non-direct character
123840 if (!inBase64) {
123841 buf[bufIdx++] = andChar; // Write '&', then go to base64 mode.
123842 inBase64 = true;
123843 }
123844 if (inBase64) {
123845 base64Accum[base64AccumIdx++] = uChar >> 8;
123846 base64Accum[base64AccumIdx++] = uChar & 0xFF;
123847
123848 if (base64AccumIdx == base64Accum.length) {
123849 bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx);
123850 base64AccumIdx = 0;
123851 }
123852 }
123853 }
123854 }
123855
123856 this.inBase64 = inBase64;
123857 this.base64AccumIdx = base64AccumIdx;
123858
123859 return buf.slice(0, bufIdx);
123860}
123861
123862Utf7IMAPEncoder.prototype.end = function() {
123863 var buf = Buffer.alloc(10), bufIdx = 0;
123864 if (this.inBase64) {
123865 if (this.base64AccumIdx > 0) {
123866 bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx);
123867 this.base64AccumIdx = 0;
123868 }
123869
123870 buf[bufIdx++] = minusChar; // Write '-', then go to direct mode.
123871 this.inBase64 = false;
123872 }
123873
123874 return buf.slice(0, bufIdx);
123875}
123876
123877
123878// -- Decoding
123879
123880function Utf7IMAPDecoder(options, codec) {
123881 this.iconv = codec.iconv;
123882 this.inBase64 = false;
123883 this.base64Accum = '';
123884}
123885
123886var base64IMAPChars = base64Chars.slice();
123887base64IMAPChars[','.charCodeAt(0)] = true;
123888
123889Utf7IMAPDecoder.prototype.write = function(buf) {
123890 var res = "", lastI = 0,
123891 inBase64 = this.inBase64,
123892 base64Accum = this.base64Accum;
123893
123894 // The decoder is more involved as we must handle chunks in stream.
123895 // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end).
123896
123897 for (var i = 0; i < buf.length; i++) {
123898 if (!inBase64) { // We're in direct mode.
123899 // Write direct chars until '&'
123900 if (buf[i] == andChar) {
123901 res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars.
123902 lastI = i+1;
123903 inBase64 = true;
123904 }
123905 } else { // We decode base64.
123906 if (!base64IMAPChars[buf[i]]) { // Base64 ended.
123907 if (i == lastI && buf[i] == minusChar) { // "&-" -> "&"
123908 res += "&";
123909 } else {
123910 var b64str = base64Accum + buf.slice(lastI, i).toString().replace(/,/g, '/');
123911 res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
123912 }
123913
123914 if (buf[i] != minusChar) // Minus may be absorbed after base64.
123915 i--;
123916
123917 lastI = i+1;
123918 inBase64 = false;
123919 base64Accum = '';
123920 }
123921 }
123922 }
123923
123924 if (!inBase64) {
123925 res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars.
123926 } else {
123927 var b64str = base64Accum + buf.slice(lastI).toString().replace(/,/g, '/');
123928
123929 var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars.
123930 base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future.
123931 b64str = b64str.slice(0, canBeDecoded);
123932
123933 res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be");
123934 }
123935
123936 this.inBase64 = inBase64;
123937 this.base64Accum = base64Accum;
123938
123939 return res;
123940}
123941
123942Utf7IMAPDecoder.prototype.end = function() {
123943 var res = "";
123944 if (this.inBase64 && this.base64Accum.length > 0)
123945 res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be");
123946
123947 this.inBase64 = false;
123948 this.base64Accum = '';
123949 return res;
123950}
123951
123952
123953
123954
123955/***/ }),
123956/* 773 */
123957/***/ (function(module, exports, __webpack_require__) {
123958
123959"use strict";
123960
123961
123962var BOMChar = '\uFEFF';
123963
123964exports.PrependBOM = PrependBOMWrapper
123965function PrependBOMWrapper(encoder, options) {
123966 this.encoder = encoder;
123967 this.addBOM = true;
123968}
123969
123970PrependBOMWrapper.prototype.write = function(str) {
123971 if (this.addBOM) {
123972 str = BOMChar + str;
123973 this.addBOM = false;
123974 }
123975
123976 return this.encoder.write(str);
123977}
123978
123979PrependBOMWrapper.prototype.end = function() {
123980 return this.encoder.end();
123981}
123982
123983
123984//------------------------------------------------------------------------------
123985
123986exports.StripBOM = StripBOMWrapper;
123987function StripBOMWrapper(decoder, options) {
123988 this.decoder = decoder;
123989 this.pass = false;
123990 this.options = options || {};
123991}
123992
123993StripBOMWrapper.prototype.write = function(buf) {
123994 var res = this.decoder.write(buf);
123995 if (this.pass || !res)
123996 return res;
123997
123998 if (res[0] === BOMChar) {
123999 res = res.slice(1);
124000 if (typeof this.options.stripBOM === 'function')
124001 this.options.stripBOM();
124002 }
124003
124004 this.pass = true;
124005 return res;
124006}
124007
124008StripBOMWrapper.prototype.end = function() {
124009 return this.decoder.end();
124010}
124011
124012
124013
124014/***/ }),
124015/* 774 */
124016/***/ (function(module, exports, __webpack_require__) {
124017
124018"use strict";
124019
124020var Buffer = __webpack_require__(94).Buffer;
124021// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer
124022
124023// == Extend Node primitives to use iconv-lite =================================
124024
124025module.exports = function (iconv) {
124026 var original = undefined; // Place to keep original methods.
124027
124028 // Node authors rewrote Buffer internals to make it compatible with
124029 // Uint8Array and we cannot patch key functions since then.
124030 // Note: this does use older Buffer API on a purpose
124031 iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array);
124032
124033 iconv.extendNodeEncodings = function extendNodeEncodings() {
124034 if (original) return;
124035 original = {};
124036
124037 if (!iconv.supportsNodeEncodingsExtension) {
124038 console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node");
124039 console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility");
124040 return;
124041 }
124042
124043 var nodeNativeEncodings = {
124044 'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true,
124045 'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true,
124046 };
124047
124048 Buffer.isNativeEncoding = function(enc) {
124049 return enc && nodeNativeEncodings[enc.toLowerCase()];
124050 }
124051
124052 // -- SlowBuffer -----------------------------------------------------------
124053 var SlowBuffer = __webpack_require__(94).SlowBuffer;
124054
124055 original.SlowBufferToString = SlowBuffer.prototype.toString;
124056 SlowBuffer.prototype.toString = function(encoding, start, end) {
124057 encoding = String(encoding || 'utf8').toLowerCase();
124058
124059 // Use native conversion when possible
124060 if (Buffer.isNativeEncoding(encoding))
124061 return original.SlowBufferToString.call(this, encoding, start, end);
124062
124063 // Otherwise, use our decoding method.
124064 if (typeof start == 'undefined') start = 0;
124065 if (typeof end == 'undefined') end = this.length;
124066 return iconv.decode(this.slice(start, end), encoding);
124067 }
124068
124069 original.SlowBufferWrite = SlowBuffer.prototype.write;
124070 SlowBuffer.prototype.write = function(string, offset, length, encoding) {
124071 // Support both (string, offset, length, encoding)
124072 // and the legacy (string, encoding, offset, length)
124073 if (isFinite(offset)) {
124074 if (!isFinite(length)) {
124075 encoding = length;
124076 length = undefined;
124077 }
124078 } else { // legacy
124079 var swap = encoding;
124080 encoding = offset;
124081 offset = length;
124082 length = swap;
124083 }
124084
124085 offset = +offset || 0;
124086 var remaining = this.length - offset;
124087 if (!length) {
124088 length = remaining;
124089 } else {
124090 length = +length;
124091 if (length > remaining) {
124092 length = remaining;
124093 }
124094 }
124095 encoding = String(encoding || 'utf8').toLowerCase();
124096
124097 // Use native conversion when possible
124098 if (Buffer.isNativeEncoding(encoding))
124099 return original.SlowBufferWrite.call(this, string, offset, length, encoding);
124100
124101 if (string.length > 0 && (length < 0 || offset < 0))
124102 throw new RangeError('attempt to write beyond buffer bounds');
124103
124104 // Otherwise, use our encoding method.
124105 var buf = iconv.encode(string, encoding);
124106 if (buf.length < length) length = buf.length;
124107 buf.copy(this, offset, 0, length);
124108 return length;
124109 }
124110
124111 // -- Buffer ---------------------------------------------------------------
124112
124113 original.BufferIsEncoding = Buffer.isEncoding;
124114 Buffer.isEncoding = function(encoding) {
124115 return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding);
124116 }
124117
124118 original.BufferByteLength = Buffer.byteLength;
124119 Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) {
124120 encoding = String(encoding || 'utf8').toLowerCase();
124121
124122 // Use native conversion when possible
124123 if (Buffer.isNativeEncoding(encoding))
124124 return original.BufferByteLength.call(this, str, encoding);
124125
124126 // Slow, I know, but we don't have a better way yet.
124127 return iconv.encode(str, encoding).length;
124128 }
124129
124130 original.BufferToString = Buffer.prototype.toString;
124131 Buffer.prototype.toString = function(encoding, start, end) {
124132 encoding = String(encoding || 'utf8').toLowerCase();
124133
124134 // Use native conversion when possible
124135 if (Buffer.isNativeEncoding(encoding))
124136 return original.BufferToString.call(this, encoding, start, end);
124137
124138 // Otherwise, use our decoding method.
124139 if (typeof start == 'undefined') start = 0;
124140 if (typeof end == 'undefined') end = this.length;
124141 return iconv.decode(this.slice(start, end), encoding);
124142 }
124143
124144 original.BufferWrite = Buffer.prototype.write;
124145 Buffer.prototype.write = function(string, offset, length, encoding) {
124146 var _offset = offset, _length = length, _encoding = encoding;
124147 // Support both (string, offset, length, encoding)
124148 // and the legacy (string, encoding, offset, length)
124149 if (isFinite(offset)) {
124150 if (!isFinite(length)) {
124151 encoding = length;
124152 length = undefined;
124153 }
124154 } else { // legacy
124155 var swap = encoding;
124156 encoding = offset;
124157 offset = length;
124158 length = swap;
124159 }
124160
124161 encoding = String(encoding || 'utf8').toLowerCase();
124162
124163 // Use native conversion when possible
124164 if (Buffer.isNativeEncoding(encoding))
124165 return original.BufferWrite.call(this, string, _offset, _length, _encoding);
124166
124167 offset = +offset || 0;
124168 var remaining = this.length - offset;
124169 if (!length) {
124170 length = remaining;
124171 } else {
124172 length = +length;
124173 if (length > remaining) {
124174 length = remaining;
124175 }
124176 }
124177
124178 if (string.length > 0 && (length < 0 || offset < 0))
124179 throw new RangeError('attempt to write beyond buffer bounds');
124180
124181 // Otherwise, use our encoding method.
124182 var buf = iconv.encode(string, encoding);
124183 if (buf.length < length) length = buf.length;
124184 buf.copy(this, offset, 0, length);
124185 return length;
124186
124187 // TODO: Set _charsWritten.
124188 }
124189
124190
124191 // -- Readable -------------------------------------------------------------
124192 if (iconv.supportsStreams) {
124193 var Readable = __webpack_require__(35).Readable;
124194
124195 original.ReadableSetEncoding = Readable.prototype.setEncoding;
124196 Readable.prototype.setEncoding = function setEncoding(enc, options) {
124197 // Use our own decoder, it has the same interface.
124198 // We cannot use original function as it doesn't handle BOM-s.
124199 this._readableState.decoder = iconv.getDecoder(enc, options);
124200 this._readableState.encoding = enc;
124201 }
124202
124203 Readable.prototype.collect = iconv._collect;
124204 }
124205 }
124206
124207 // Remove iconv-lite Node primitive extensions.
124208 iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() {
124209 if (!iconv.supportsNodeEncodingsExtension)
124210 return;
124211 if (!original)
124212 throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.")
124213
124214 delete Buffer.isNativeEncoding;
124215
124216 var SlowBuffer = __webpack_require__(94).SlowBuffer;
124217
124218 SlowBuffer.prototype.toString = original.SlowBufferToString;
124219 SlowBuffer.prototype.write = original.SlowBufferWrite;
124220
124221 Buffer.isEncoding = original.BufferIsEncoding;
124222 Buffer.byteLength = original.BufferByteLength;
124223 Buffer.prototype.toString = original.BufferToString;
124224 Buffer.prototype.write = original.BufferWrite;
124225
124226 if (iconv.supportsStreams) {
124227 var Readable = __webpack_require__(35).Readable;
124228
124229 Readable.prototype.setEncoding = original.ReadableSetEncoding;
124230 delete Readable.prototype.collect;
124231 }
124232
124233 original = undefined;
124234 }
124235}
124236
124237
124238/***/ }),
124239/* 775 */
124240/***/ (function(module, exports, __webpack_require__) {
124241
124242"use strict";
124243
124244
124245// Some environments don't have global Buffer (e.g. React Native).
124246// Solution would be installing npm modules "buffer" and "stream" explicitly.
124247var Buffer = __webpack_require__(20).Buffer;
124248
124249var bomHandling = __webpack_require__(773),
124250 iconv = module.exports;
124251
124252// All codecs and aliases are kept here, keyed by encoding name/alias.
124253// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
124254iconv.encodings = null;
124255
124256// Characters emitted in case of error.
124257iconv.defaultCharUnicode = '�';
124258iconv.defaultCharSingleByte = '?';
124259
124260// Public API.
124261iconv.encode = function encode(str, encoding, options) {
124262 str = "" + (str || ""); // Ensure string.
124263
124264 var encoder = iconv.getEncoder(encoding, options);
124265
124266 var res = encoder.write(str);
124267 var trail = encoder.end();
124268
124269 return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;
124270}
124271
124272iconv.decode = function decode(buf, encoding, options) {
124273 if (typeof buf === 'string') {
124274 if (!iconv.skipDecodeWarning) {
124275 console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');
124276 iconv.skipDecodeWarning = true;
124277 }
124278
124279 buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
124280 }
124281
124282 var decoder = iconv.getDecoder(encoding, options);
124283
124284 var res = decoder.write(buf);
124285 var trail = decoder.end();
124286
124287 return trail ? (res + trail) : res;
124288}
124289
124290iconv.encodingExists = function encodingExists(enc) {
124291 try {
124292 iconv.getCodec(enc);
124293 return true;
124294 } catch (e) {
124295 return false;
124296 }
124297}
124298
124299// Legacy aliases to convert functions
124300iconv.toEncoding = iconv.encode;
124301iconv.fromEncoding = iconv.decode;
124302
124303// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
124304iconv._codecDataCache = {};
124305iconv.getCodec = function getCodec(encoding) {
124306 if (!iconv.encodings)
124307 iconv.encodings = __webpack_require__(761); // Lazy load all encoding definitions.
124308
124309 // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
124310 var enc = iconv._canonicalizeEncoding(encoding);
124311
124312 // Traverse iconv.encodings to find actual codec.
124313 var codecOptions = {};
124314 while (true) {
124315 var codec = iconv._codecDataCache[enc];
124316 if (codec)
124317 return codec;
124318
124319 var codecDef = iconv.encodings[enc];
124320
124321 switch (typeof codecDef) {
124322 case "string": // Direct alias to other encoding.
124323 enc = codecDef;
124324 break;
124325
124326 case "object": // Alias with options. Can be layered.
124327 for (var key in codecDef)
124328 codecOptions[key] = codecDef[key];
124329
124330 if (!codecOptions.encodingName)
124331 codecOptions.encodingName = enc;
124332
124333 enc = codecDef.type;
124334 break;
124335
124336 case "function": // Codec itself.
124337 if (!codecOptions.encodingName)
124338 codecOptions.encodingName = enc;
124339
124340 // The codec function must load all tables and return object with .encoder and .decoder methods.
124341 // It'll be called only once (for each different options object).
124342 codec = new codecDef(codecOptions, iconv);
124343
124344 iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
124345 return codec;
124346
124347 default:
124348 throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
124349 }
124350 }
124351}
124352
124353iconv._canonicalizeEncoding = function(encoding) {
124354 // Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
124355 return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
124356}
124357
124358iconv.getEncoder = function getEncoder(encoding, options) {
124359 var codec = iconv.getCodec(encoding),
124360 encoder = new codec.encoder(options, codec);
124361
124362 if (codec.bomAware && options && options.addBOM)
124363 encoder = new bomHandling.PrependBOM(encoder, options);
124364
124365 return encoder;
124366}
124367
124368iconv.getDecoder = function getDecoder(encoding, options) {
124369 var codec = iconv.getCodec(encoding),
124370 decoder = new codec.decoder(options, codec);
124371
124372 if (codec.bomAware && !(options && options.stripBOM === false))
124373 decoder = new bomHandling.StripBOM(decoder, options);
124374
124375 return decoder;
124376}
124377
124378
124379// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json.
124380var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node;
124381if (nodeVer) {
124382
124383 // Load streaming support in Node v0.10+
124384 var nodeVerArr = nodeVer.split(".").map(Number);
124385 if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) {
124386 __webpack_require__(776)(iconv);
124387 }
124388
124389 // Load Node primitive extensions.
124390 __webpack_require__(774)(iconv);
124391}
124392
124393if (false) {
124394 console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.");
124395}
124396
124397
124398/***/ }),
124399/* 776 */
124400/***/ (function(module, exports, __webpack_require__) {
124401
124402"use strict";
124403
124404
124405var Buffer = __webpack_require__(94).Buffer,
124406 Transform = __webpack_require__(35).Transform;
124407
124408
124409// == Exports ==================================================================
124410module.exports = function(iconv) {
124411
124412 // Additional Public API.
124413 iconv.encodeStream = function encodeStream(encoding, options) {
124414 return new IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options);
124415 }
124416
124417 iconv.decodeStream = function decodeStream(encoding, options) {
124418 return new IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options);
124419 }
124420
124421 iconv.supportsStreams = true;
124422
124423
124424 // Not published yet.
124425 iconv.IconvLiteEncoderStream = IconvLiteEncoderStream;
124426 iconv.IconvLiteDecoderStream = IconvLiteDecoderStream;
124427 iconv._collect = IconvLiteDecoderStream.prototype.collect;
124428};
124429
124430
124431// == Encoder stream =======================================================
124432function IconvLiteEncoderStream(conv, options) {
124433 this.conv = conv;
124434 options = options || {};
124435 options.decodeStrings = false; // We accept only strings, so we don't need to decode them.
124436 Transform.call(this, options);
124437}
124438
124439IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, {
124440 constructor: { value: IconvLiteEncoderStream }
124441});
124442
124443IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) {
124444 if (typeof chunk != 'string')
124445 return done(new Error("Iconv encoding stream needs strings as its input."));
124446 try {
124447 var res = this.conv.write(chunk);
124448 if (res && res.length) this.push(res);
124449 done();
124450 }
124451 catch (e) {
124452 done(e);
124453 }
124454}
124455
124456IconvLiteEncoderStream.prototype._flush = function(done) {
124457 try {
124458 var res = this.conv.end();
124459 if (res && res.length) this.push(res);
124460 done();
124461 }
124462 catch (e) {
124463 done(e);
124464 }
124465}
124466
124467IconvLiteEncoderStream.prototype.collect = function(cb) {
124468 var chunks = [];
124469 this.on('error', cb);
124470 this.on('data', function(chunk) { chunks.push(chunk); });
124471 this.on('end', function() {
124472 cb(null, Buffer.concat(chunks));
124473 });
124474 return this;
124475}
124476
124477
124478// == Decoder stream =======================================================
124479function IconvLiteDecoderStream(conv, options) {
124480 this.conv = conv;
124481 options = options || {};
124482 options.encoding = this.encoding = 'utf8'; // We output strings.
124483 Transform.call(this, options);
124484}
124485
124486IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, {
124487 constructor: { value: IconvLiteDecoderStream }
124488});
124489
124490IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) {
124491 if (!Buffer.isBuffer(chunk))
124492 return done(new Error("Iconv decoding stream needs buffers as its input."));
124493 try {
124494 var res = this.conv.write(chunk);
124495 if (res && res.length) this.push(res, this.encoding);
124496 done();
124497 }
124498 catch (e) {
124499 done(e);
124500 }
124501}
124502
124503IconvLiteDecoderStream.prototype._flush = function(done) {
124504 try {
124505 var res = this.conv.end();
124506 if (res && res.length) this.push(res, this.encoding);
124507 done();
124508 }
124509 catch (e) {
124510 done(e);
124511 }
124512}
124513
124514IconvLiteDecoderStream.prototype.collect = function(cb) {
124515 var res = '';
124516 this.on('error', cb);
124517 this.on('data', function(chunk) { res += chunk; });
124518 this.on('end', function() {
124519 cb(null, res);
124520 });
124521 return this;
124522}
124523
124524
124525
124526/***/ }),
124527/* 777 */
124528/***/ (function(module, exports, __webpack_require__) {
124529
124530"use strict";
124531
124532const stripAnsi = __webpack_require__(269);
124533const isFullwidthCodePoint = __webpack_require__(785);
124534
124535module.exports = str => {
124536 if (typeof str !== 'string' || str.length === 0) {
124537 return 0;
124538 }
124539
124540 str = stripAnsi(str);
124541
124542 let width = 0;
124543
124544 for (let i = 0; i < str.length; i++) {
124545 const code = str.codePointAt(i);
124546
124547 // Ignore control characters
124548 if (code <= 0x1F || (code >= 0x7F && code <= 0x9F)) {
124549 continue;
124550 }
124551
124552 // Ignore combining characters
124553 if (code >= 0x300 && code <= 0x36F) {
124554 continue;
124555 }
124556
124557 // Surrogates
124558 if (code > 0xFFFF) {
124559 i++;
124560 }
124561
124562 width += isFullwidthCodePoint(code) ? 2 : 1;
124563 }
124564
124565 return width;
124566};
124567
124568
124569/***/ }),
124570/* 778 */
124571/***/ (function(module, exports) {
124572
124573/*!
124574 * Determine if an object is a Buffer
124575 *
124576 * @author Feross Aboukhadijeh <https://feross.org>
124577 * @license MIT
124578 */
124579
124580// The _isBuffer check is for Safari 5-7 support, because it's missing
124581// Object.prototype.constructor. Remove this eventually
124582module.exports = function (obj) {
124583 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
124584}
124585
124586function isBuffer (obj) {
124587 return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)
124588}
124589
124590// For Node v0.10 support. Remove this eventually.
124591function isSlowBuffer (obj) {
124592 return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))
124593}
124594
124595
124596/***/ }),
124597/* 779 */
124598/***/ (function(module, exports, __webpack_require__) {
124599
124600"use strict";
124601
124602const builtinModules = __webpack_require__(780);
124603
124604const moduleSet = new Set(builtinModules);
124605
124606module.exports = moduleName => {
124607 if (typeof moduleName !== 'string') {
124608 throw new TypeError('Expected a string');
124609 }
124610
124611 return moduleSet.has(moduleName);
124612};
124613
124614
124615/***/ }),
124616/* 780 */
124617/***/ (function(module, exports, __webpack_require__) {
124618
124619"use strict";
124620
124621
124622const blacklist = [
124623 'freelist',
124624 'sys'
124625];
124626
124627module.exports = Object.keys(process.binding('natives'))
124628 .filter(x => !/^_|^internal|\//.test(x) && blacklist.indexOf(x) === -1)
124629 .sort();
124630
124631
124632/***/ }),
124633/* 781 */
124634/***/ (function(module, exports, __webpack_require__) {
124635
124636"use strict";
124637
124638
124639module.exports = function (buf) {
124640 if (!buf || buf.length < 2) return false
124641 return buf[0] === 0x78 && (buf[1] === 1 || buf[1] === 0x9c || buf[1] === 0xda)
124642}
124643
124644
124645/***/ }),
124646/* 782 */
124647/***/ (function(module, exports) {
124648
124649/*!
124650 * is-dotfile <https://github.com/jonschlinkert/is-dotfile>
124651 *
124652 * Copyright (c) 2015-2017, Jon Schlinkert.
124653 * Released under the MIT License.
124654 */
124655
124656module.exports = function(str) {
124657 if (str.charCodeAt(0) === 46 /* . */ && str.indexOf('/', 1) === -1) {
124658 return true;
124659 }
124660 var slash = str.lastIndexOf('/');
124661 return slash !== -1 ? str.charCodeAt(slash + 1) === 46 /* . */ : false;
124662};
124663
124664
124665/***/ }),
124666/* 783 */
124667/***/ (function(module, exports, __webpack_require__) {
124668
124669"use strict";
124670/*!
124671 * is-equal-shallow <https://github.com/jonschlinkert/is-equal-shallow>
124672 *
124673 * Copyright (c) 2015, Jon Schlinkert.
124674 * Licensed under the MIT License.
124675 */
124676
124677
124678
124679var isPrimitive = __webpack_require__(789);
124680
124681module.exports = function isEqual(a, b) {
124682 if (!a && !b) { return true; }
124683 if (!a && b || a && !b) { return false; }
124684
124685 var numKeysA = 0, numKeysB = 0, key;
124686 for (key in b) {
124687 numKeysB++;
124688 if (!isPrimitive(b[key]) || !a.hasOwnProperty(key) || (a[key] !== b[key])) {
124689 return false;
124690 }
124691 }
124692 for (key in a) {
124693 numKeysA++;
124694 }
124695 return numKeysA === numKeysB;
124696};
124697
124698
124699/***/ }),
124700/* 784 */
124701/***/ (function(module, exports, __webpack_require__) {
124702
124703"use strict";
124704/*!
124705 * is-extendable <https://github.com/jonschlinkert/is-extendable>
124706 *
124707 * Copyright (c) 2015, Jon Schlinkert.
124708 * Licensed under the MIT License.
124709 */
124710
124711
124712
124713module.exports = function isExtendable(val) {
124714 return typeof val !== 'undefined' && val !== null
124715 && (typeof val === 'object' || typeof val === 'function');
124716};
124717
124718
124719/***/ }),
124720/* 785 */
124721/***/ (function(module, exports, __webpack_require__) {
124722
124723"use strict";
124724
124725/* eslint-disable yoda */
124726module.exports = x => {
124727 if (Number.isNaN(x)) {
124728 return false;
124729 }
124730
124731 // code points are derived from:
124732 // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
124733 if (
124734 x >= 0x1100 && (
124735 x <= 0x115f || // Hangul Jamo
124736 x === 0x2329 || // LEFT-POINTING ANGLE BRACKET
124737 x === 0x232a || // RIGHT-POINTING ANGLE BRACKET
124738 // CJK Radicals Supplement .. Enclosed CJK Letters and Months
124739 (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
124740 // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
124741 (0x3250 <= x && x <= 0x4dbf) ||
124742 // CJK Unified Ideographs .. Yi Radicals
124743 (0x4e00 <= x && x <= 0xa4c6) ||
124744 // Hangul Jamo Extended-A
124745 (0xa960 <= x && x <= 0xa97c) ||
124746 // Hangul Syllables
124747 (0xac00 <= x && x <= 0xd7a3) ||
124748 // CJK Compatibility Ideographs
124749 (0xf900 <= x && x <= 0xfaff) ||
124750 // Vertical Forms
124751 (0xfe10 <= x && x <= 0xfe19) ||
124752 // CJK Compatibility Forms .. Small Form Variants
124753 (0xfe30 <= x && x <= 0xfe6b) ||
124754 // Halfwidth and Fullwidth Forms
124755 (0xff01 <= x && x <= 0xff60) ||
124756 (0xffe0 <= x && x <= 0xffe6) ||
124757 // Kana Supplement
124758 (0x1b000 <= x && x <= 0x1b001) ||
124759 // Enclosed Ideographic Supplement
124760 (0x1f200 <= x && x <= 0x1f251) ||
124761 // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
124762 (0x20000 <= x && x <= 0x3fffd)
124763 )
124764 ) {
124765 return true;
124766 }
124767
124768 return false;
124769};
124770
124771
124772/***/ }),
124773/* 786 */
124774/***/ (function(module, exports, __webpack_require__) {
124775
124776"use strict";
124777
124778
124779/**
124780 * Check if a Buffer/Uint8Array is a GZIP file
124781 *
124782 * @param {Buffer} buf
124783 * @api public
124784 */
124785
124786module.exports = function (buf) {
124787 if (!buf || buf.length < 3) {
124788 return false;
124789 }
124790
124791 return buf[0] === 31 && buf[1] === 139 && buf[2] === 8;
124792};
124793
124794
124795/***/ }),
124796/* 787 */
124797/***/ (function(module, exports, __webpack_require__) {
124798
124799"use strict";
124800
124801var toString = Object.prototype.toString;
124802
124803module.exports = function (x) {
124804 var prototype;
124805 return toString.call(x) === '[object Object]' && (prototype = Object.getPrototypeOf(x), prototype === null || prototype === Object.getPrototypeOf({}));
124806};
124807
124808
124809/***/ }),
124810/* 788 */
124811/***/ (function(module, exports) {
124812
124813/*!
124814 * is-posix-bracket <https://github.com/jonschlinkert/is-posix-bracket>
124815 *
124816 * Copyright (c) 2015-2016, Jon Schlinkert.
124817 * Licensed under the MIT License.
124818 */
124819
124820module.exports = function isPosixBracket(str) {
124821 return typeof str === 'string' && /\[([:.=+])(?:[^\[\]]|)+\1\]/.test(str);
124822};
124823
124824
124825/***/ }),
124826/* 789 */
124827/***/ (function(module, exports, __webpack_require__) {
124828
124829"use strict";
124830/*!
124831 * is-primitive <https://github.com/jonschlinkert/is-primitive>
124832 *
124833 * Copyright (c) 2014-2015, Jon Schlinkert.
124834 * Licensed under the MIT License.
124835 */
124836
124837
124838
124839// see http://jsperf.com/testing-value-is-primitive/7
124840module.exports = function isPrimitive(value) {
124841 return value == null || (typeof value !== 'function' && typeof value !== 'object');
124842};
124843
124844
124845/***/ }),
124846/* 790 */
124847/***/ (function(module, exports) {
124848
124849module.exports = isPromise;
124850
124851function isPromise(obj) {
124852 return !!obj && (typeof obj === 'object' || typeof obj === 'function') && typeof obj.then === 'function';
124853}
124854
124855
124856/***/ }),
124857/* 791 */
124858/***/ (function(module, exports) {
124859
124860module.exports = isTypedArray
124861isTypedArray.strict = isStrictTypedArray
124862isTypedArray.loose = isLooseTypedArray
124863
124864var toString = Object.prototype.toString
124865var names = {
124866 '[object Int8Array]': true
124867 , '[object Int16Array]': true
124868 , '[object Int32Array]': true
124869 , '[object Uint8Array]': true
124870 , '[object Uint8ClampedArray]': true
124871 , '[object Uint16Array]': true
124872 , '[object Uint32Array]': true
124873 , '[object Float32Array]': true
124874 , '[object Float64Array]': true
124875}
124876
124877function isTypedArray(arr) {
124878 return (
124879 isStrictTypedArray(arr)
124880 || isLooseTypedArray(arr)
124881 )
124882}
124883
124884function isStrictTypedArray(arr) {
124885 return (
124886 arr instanceof Int8Array
124887 || arr instanceof Int16Array
124888 || arr instanceof Int32Array
124889 || arr instanceof Uint8Array
124890 || arr instanceof Uint8ClampedArray
124891 || arr instanceof Uint16Array
124892 || arr instanceof Uint32Array
124893 || arr instanceof Float32Array
124894 || arr instanceof Float64Array
124895 )
124896}
124897
124898function isLooseTypedArray(arr) {
124899 return names[toString.call(arr)]
124900}
124901
124902
124903/***/ }),
124904/* 792 */
124905/***/ (function(module, exports, __webpack_require__) {
124906
124907// @flow
124908
124909/*::
124910declare var __webpack_require__: mixed;
124911*/
124912
124913module.exports = typeof __webpack_require__ !== "undefined";
124914
124915
124916/***/ }),
124917/* 793 */
124918/***/ (function(module, exports, __webpack_require__) {
124919
124920var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
124921 * is-windows <https://github.com/jonschlinkert/is-windows>
124922 *
124923 * Copyright © 2015-2018, Jon Schlinkert.
124924 * Released under the MIT License.
124925 */
124926
124927(function(factory) {
124928 if (exports && typeof exports === 'object' && typeof module !== 'undefined') {
124929 module.exports = factory();
124930 } else if (true) {
124931 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
124932 __WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
124933 (__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
124934 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
124935 } else if (typeof window !== 'undefined') {
124936 window.isWindows = factory();
124937 } else if (typeof global !== 'undefined') {
124938 global.isWindows = factory();
124939 } else if (typeof self !== 'undefined') {
124940 self.isWindows = factory();
124941 } else {
124942 this.isWindows = factory();
124943 }
124944})(function() {
124945 'use strict';
124946 return function isWindows() {
124947 return process && (process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE));
124948 };
124949});
124950
124951
124952/***/ }),
124953/* 794 */
124954/***/ (function(module, exports, __webpack_require__) {
124955
124956"use strict";
124957
124958
124959
124960var yaml = __webpack_require__(795);
124961
124962
124963module.exports = yaml;
124964
124965
124966/***/ }),
124967/* 795 */
124968/***/ (function(module, exports, __webpack_require__) {
124969
124970"use strict";
124971
124972
124973
124974var loader = __webpack_require__(797);
124975var dumper = __webpack_require__(796);
124976
124977
124978function deprecated(name) {
124979 return function () {
124980 throw new Error('Function ' + name + ' is deprecated and cannot be used.');
124981 };
124982}
124983
124984
124985module.exports.Type = __webpack_require__(30);
124986module.exports.Schema = __webpack_require__(108);
124987module.exports.FAILSAFE_SCHEMA = __webpack_require__(239);
124988module.exports.JSON_SCHEMA = __webpack_require__(369);
124989module.exports.CORE_SCHEMA = __webpack_require__(368);
124990module.exports.DEFAULT_SAFE_SCHEMA = __webpack_require__(132);
124991module.exports.DEFAULT_FULL_SCHEMA = __webpack_require__(168);
124992module.exports.load = loader.load;
124993module.exports.loadAll = loader.loadAll;
124994module.exports.safeLoad = loader.safeLoad;
124995module.exports.safeLoadAll = loader.safeLoadAll;
124996module.exports.dump = dumper.dump;
124997module.exports.safeDump = dumper.safeDump;
124998module.exports.YAMLException = __webpack_require__(131);
124999
125000// Deprecated schema names from JS-YAML 2.0.x
125001module.exports.MINIMAL_SCHEMA = __webpack_require__(239);
125002module.exports.SAFE_SCHEMA = __webpack_require__(132);
125003module.exports.DEFAULT_SCHEMA = __webpack_require__(168);
125004
125005// Deprecated functions from JS-YAML 1.x.x
125006module.exports.scan = deprecated('scan');
125007module.exports.parse = deprecated('parse');
125008module.exports.compose = deprecated('compose');
125009module.exports.addConstructor = deprecated('addConstructor');
125010
125011
125012/***/ }),
125013/* 796 */
125014/***/ (function(module, exports, __webpack_require__) {
125015
125016"use strict";
125017
125018
125019/*eslint-disable no-use-before-define*/
125020
125021var common = __webpack_require__(107);
125022var YAMLException = __webpack_require__(131);
125023var DEFAULT_FULL_SCHEMA = __webpack_require__(168);
125024var DEFAULT_SAFE_SCHEMA = __webpack_require__(132);
125025
125026var _toString = Object.prototype.toString;
125027var _hasOwnProperty = Object.prototype.hasOwnProperty;
125028
125029var CHAR_TAB = 0x09; /* Tab */
125030var CHAR_LINE_FEED = 0x0A; /* LF */
125031var CHAR_SPACE = 0x20; /* Space */
125032var CHAR_EXCLAMATION = 0x21; /* ! */
125033var CHAR_DOUBLE_QUOTE = 0x22; /* " */
125034var CHAR_SHARP = 0x23; /* # */
125035var CHAR_PERCENT = 0x25; /* % */
125036var CHAR_AMPERSAND = 0x26; /* & */
125037var CHAR_SINGLE_QUOTE = 0x27; /* ' */
125038var CHAR_ASTERISK = 0x2A; /* * */
125039var CHAR_COMMA = 0x2C; /* , */
125040var CHAR_MINUS = 0x2D; /* - */
125041var CHAR_COLON = 0x3A; /* : */
125042var CHAR_GREATER_THAN = 0x3E; /* > */
125043var CHAR_QUESTION = 0x3F; /* ? */
125044var CHAR_COMMERCIAL_AT = 0x40; /* @ */
125045var CHAR_LEFT_SQUARE_BRACKET = 0x5B; /* [ */
125046var CHAR_RIGHT_SQUARE_BRACKET = 0x5D; /* ] */
125047var CHAR_GRAVE_ACCENT = 0x60; /* ` */
125048var CHAR_LEFT_CURLY_BRACKET = 0x7B; /* { */
125049var CHAR_VERTICAL_LINE = 0x7C; /* | */
125050var CHAR_RIGHT_CURLY_BRACKET = 0x7D; /* } */
125051
125052var ESCAPE_SEQUENCES = {};
125053
125054ESCAPE_SEQUENCES[0x00] = '\\0';
125055ESCAPE_SEQUENCES[0x07] = '\\a';
125056ESCAPE_SEQUENCES[0x08] = '\\b';
125057ESCAPE_SEQUENCES[0x09] = '\\t';
125058ESCAPE_SEQUENCES[0x0A] = '\\n';
125059ESCAPE_SEQUENCES[0x0B] = '\\v';
125060ESCAPE_SEQUENCES[0x0C] = '\\f';
125061ESCAPE_SEQUENCES[0x0D] = '\\r';
125062ESCAPE_SEQUENCES[0x1B] = '\\e';
125063ESCAPE_SEQUENCES[0x22] = '\\"';
125064ESCAPE_SEQUENCES[0x5C] = '\\\\';
125065ESCAPE_SEQUENCES[0x85] = '\\N';
125066ESCAPE_SEQUENCES[0xA0] = '\\_';
125067ESCAPE_SEQUENCES[0x2028] = '\\L';
125068ESCAPE_SEQUENCES[0x2029] = '\\P';
125069
125070var DEPRECATED_BOOLEANS_SYNTAX = [
125071 'y', 'Y', 'yes', 'Yes', 'YES', 'on', 'On', 'ON',
125072 'n', 'N', 'no', 'No', 'NO', 'off', 'Off', 'OFF'
125073];
125074
125075function compileStyleMap(schema, map) {
125076 var result, keys, index, length, tag, style, type;
125077
125078 if (map === null) return {};
125079
125080 result = {};
125081 keys = Object.keys(map);
125082
125083 for (index = 0, length = keys.length; index < length; index += 1) {
125084 tag = keys[index];
125085 style = String(map[tag]);
125086
125087 if (tag.slice(0, 2) === '!!') {
125088 tag = 'tag:yaml.org,2002:' + tag.slice(2);
125089 }
125090 type = schema.compiledTypeMap['fallback'][tag];
125091
125092 if (type && _hasOwnProperty.call(type.styleAliases, style)) {
125093 style = type.styleAliases[style];
125094 }
125095
125096 result[tag] = style;
125097 }
125098
125099 return result;
125100}
125101
125102function encodeHex(character) {
125103 var string, handle, length;
125104
125105 string = character.toString(16).toUpperCase();
125106
125107 if (character <= 0xFF) {
125108 handle = 'x';
125109 length = 2;
125110 } else if (character <= 0xFFFF) {
125111 handle = 'u';
125112 length = 4;
125113 } else if (character <= 0xFFFFFFFF) {
125114 handle = 'U';
125115 length = 8;
125116 } else {
125117 throw new YAMLException('code point within a string may not be greater than 0xFFFFFFFF');
125118 }
125119
125120 return '\\' + handle + common.repeat('0', length - string.length) + string;
125121}
125122
125123function State(options) {
125124 this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
125125 this.indent = Math.max(1, (options['indent'] || 2));
125126 this.noArrayIndent = options['noArrayIndent'] || false;
125127 this.skipInvalid = options['skipInvalid'] || false;
125128 this.flowLevel = (common.isNothing(options['flowLevel']) ? -1 : options['flowLevel']);
125129 this.styleMap = compileStyleMap(this.schema, options['styles'] || null);
125130 this.sortKeys = options['sortKeys'] || false;
125131 this.lineWidth = options['lineWidth'] || 80;
125132 this.noRefs = options['noRefs'] || false;
125133 this.noCompatMode = options['noCompatMode'] || false;
125134 this.condenseFlow = options['condenseFlow'] || false;
125135
125136 this.implicitTypes = this.schema.compiledImplicit;
125137 this.explicitTypes = this.schema.compiledExplicit;
125138
125139 this.tag = null;
125140 this.result = '';
125141
125142 this.duplicates = [];
125143 this.usedDuplicates = null;
125144}
125145
125146// Indents every line in a string. Empty lines (\n only) are not indented.
125147function indentString(string, spaces) {
125148 var ind = common.repeat(' ', spaces),
125149 position = 0,
125150 next = -1,
125151 result = '',
125152 line,
125153 length = string.length;
125154
125155 while (position < length) {
125156 next = string.indexOf('\n', position);
125157 if (next === -1) {
125158 line = string.slice(position);
125159 position = length;
125160 } else {
125161 line = string.slice(position, next + 1);
125162 position = next + 1;
125163 }
125164
125165 if (line.length && line !== '\n') result += ind;
125166
125167 result += line;
125168 }
125169
125170 return result;
125171}
125172
125173function generateNextLine(state, level) {
125174 return '\n' + common.repeat(' ', state.indent * level);
125175}
125176
125177function testImplicitResolving(state, str) {
125178 var index, length, type;
125179
125180 for (index = 0, length = state.implicitTypes.length; index < length; index += 1) {
125181 type = state.implicitTypes[index];
125182
125183 if (type.resolve(str)) {
125184 return true;
125185 }
125186 }
125187
125188 return false;
125189}
125190
125191// [33] s-white ::= s-space | s-tab
125192function isWhitespace(c) {
125193 return c === CHAR_SPACE || c === CHAR_TAB;
125194}
125195
125196// Returns true if the character can be printed without escaping.
125197// From YAML 1.2: "any allowed characters known to be non-printable
125198// should also be escaped. [However,] This isn’t mandatory"
125199// Derived from nb-char - \t - #x85 - #xA0 - #x2028 - #x2029.
125200function isPrintable(c) {
125201 return (0x00020 <= c && c <= 0x00007E)
125202 || ((0x000A1 <= c && c <= 0x00D7FF) && c !== 0x2028 && c !== 0x2029)
125203 || ((0x0E000 <= c && c <= 0x00FFFD) && c !== 0xFEFF /* BOM */)
125204 || (0x10000 <= c && c <= 0x10FFFF);
125205}
125206
125207// Simplified test for values allowed after the first character in plain style.
125208function isPlainSafe(c) {
125209 // Uses a subset of nb-char - c-flow-indicator - ":" - "#"
125210 // where nb-char ::= c-printable - b-char - c-byte-order-mark.
125211 return isPrintable(c) && c !== 0xFEFF
125212 // - c-flow-indicator
125213 && c !== CHAR_COMMA
125214 && c !== CHAR_LEFT_SQUARE_BRACKET
125215 && c !== CHAR_RIGHT_SQUARE_BRACKET
125216 && c !== CHAR_LEFT_CURLY_BRACKET
125217 && c !== CHAR_RIGHT_CURLY_BRACKET
125218 // - ":" - "#"
125219 && c !== CHAR_COLON
125220 && c !== CHAR_SHARP;
125221}
125222
125223// Simplified test for values allowed as the first character in plain style.
125224function isPlainSafeFirst(c) {
125225 // Uses a subset of ns-char - c-indicator
125226 // where ns-char = nb-char - s-white.
125227 return isPrintable(c) && c !== 0xFEFF
125228 && !isWhitespace(c) // - s-white
125229 // - (c-indicator ::=
125230 // “-” | “?” | “:” | “,” | “[” | “]” | “{” | “}”
125231 && c !== CHAR_MINUS
125232 && c !== CHAR_QUESTION
125233 && c !== CHAR_COLON
125234 && c !== CHAR_COMMA
125235 && c !== CHAR_LEFT_SQUARE_BRACKET
125236 && c !== CHAR_RIGHT_SQUARE_BRACKET
125237 && c !== CHAR_LEFT_CURLY_BRACKET
125238 && c !== CHAR_RIGHT_CURLY_BRACKET
125239 // | “#” | “&” | “*” | “!” | “|” | “>” | “'” | “"”
125240 && c !== CHAR_SHARP
125241 && c !== CHAR_AMPERSAND
125242 && c !== CHAR_ASTERISK
125243 && c !== CHAR_EXCLAMATION
125244 && c !== CHAR_VERTICAL_LINE
125245 && c !== CHAR_GREATER_THAN
125246 && c !== CHAR_SINGLE_QUOTE
125247 && c !== CHAR_DOUBLE_QUOTE
125248 // | “%” | “@” | “`”)
125249 && c !== CHAR_PERCENT
125250 && c !== CHAR_COMMERCIAL_AT
125251 && c !== CHAR_GRAVE_ACCENT;
125252}
125253
125254// Determines whether block indentation indicator is required.
125255function needIndentIndicator(string) {
125256 var leadingSpaceRe = /^\n* /;
125257 return leadingSpaceRe.test(string);
125258}
125259
125260var STYLE_PLAIN = 1,
125261 STYLE_SINGLE = 2,
125262 STYLE_LITERAL = 3,
125263 STYLE_FOLDED = 4,
125264 STYLE_DOUBLE = 5;
125265
125266// Determines which scalar styles are possible and returns the preferred style.
125267// lineWidth = -1 => no limit.
125268// Pre-conditions: str.length > 0.
125269// Post-conditions:
125270// STYLE_PLAIN or STYLE_SINGLE => no \n are in the string.
125271// STYLE_LITERAL => no lines are suitable for folding (or lineWidth is -1).
125272// STYLE_FOLDED => a line > lineWidth and can be folded (and lineWidth != -1).
125273function chooseScalarStyle(string, singleLineOnly, indentPerLevel, lineWidth, testAmbiguousType) {
125274 var i;
125275 var char;
125276 var hasLineBreak = false;
125277 var hasFoldableLine = false; // only checked if shouldTrackWidth
125278 var shouldTrackWidth = lineWidth !== -1;
125279 var previousLineBreak = -1; // count the first line correctly
125280 var plain = isPlainSafeFirst(string.charCodeAt(0))
125281 && !isWhitespace(string.charCodeAt(string.length - 1));
125282
125283 if (singleLineOnly) {
125284 // Case: no block styles.
125285 // Check for disallowed characters to rule out plain and single.
125286 for (i = 0; i < string.length; i++) {
125287 char = string.charCodeAt(i);
125288 if (!isPrintable(char)) {
125289 return STYLE_DOUBLE;
125290 }
125291 plain = plain && isPlainSafe(char);
125292 }
125293 } else {
125294 // Case: block styles permitted.
125295 for (i = 0; i < string.length; i++) {
125296 char = string.charCodeAt(i);
125297 if (char === CHAR_LINE_FEED) {
125298 hasLineBreak = true;
125299 // Check if any line can be folded.
125300 if (shouldTrackWidth) {
125301 hasFoldableLine = hasFoldableLine ||
125302 // Foldable line = too long, and not more-indented.
125303 (i - previousLineBreak - 1 > lineWidth &&
125304 string[previousLineBreak + 1] !== ' ');
125305 previousLineBreak = i;
125306 }
125307 } else if (!isPrintable(char)) {
125308 return STYLE_DOUBLE;
125309 }
125310 plain = plain && isPlainSafe(char);
125311 }
125312 // in case the end is missing a \n
125313 hasFoldableLine = hasFoldableLine || (shouldTrackWidth &&
125314 (i - previousLineBreak - 1 > lineWidth &&
125315 string[previousLineBreak + 1] !== ' '));
125316 }
125317 // Although every style can represent \n without escaping, prefer block styles
125318 // for multiline, since they're more readable and they don't add empty lines.
125319 // Also prefer folding a super-long line.
125320 if (!hasLineBreak && !hasFoldableLine) {
125321 // Strings interpretable as another type have to be quoted;
125322 // e.g. the string 'true' vs. the boolean true.
125323 return plain && !testAmbiguousType(string)
125324 ? STYLE_PLAIN : STYLE_SINGLE;
125325 }
125326 // Edge case: block indentation indicator can only have one digit.
125327 if (indentPerLevel > 9 && needIndentIndicator(string)) {
125328 return STYLE_DOUBLE;
125329 }
125330 // At this point we know block styles are valid.
125331 // Prefer literal style unless we want to fold.
125332 return hasFoldableLine ? STYLE_FOLDED : STYLE_LITERAL;
125333}
125334
125335// Note: line breaking/folding is implemented for only the folded style.
125336// NB. We drop the last trailing newline (if any) of a returned block scalar
125337// since the dumper adds its own newline. This always works:
125338// • No ending newline => unaffected; already using strip "-" chomping.
125339// • Ending newline => removed then restored.
125340// Importantly, this keeps the "+" chomp indicator from gaining an extra line.
125341function writeScalar(state, string, level, iskey) {
125342 state.dump = (function () {
125343 if (string.length === 0) {
125344 return "''";
125345 }
125346 if (!state.noCompatMode &&
125347 DEPRECATED_BOOLEANS_SYNTAX.indexOf(string) !== -1) {
125348 return "'" + string + "'";
125349 }
125350
125351 var indent = state.indent * Math.max(1, level); // no 0-indent scalars
125352 // As indentation gets deeper, let the width decrease monotonically
125353 // to the lower bound min(state.lineWidth, 40).
125354 // Note that this implies
125355 // state.lineWidth ≤ 40 + state.indent: width is fixed at the lower bound.
125356 // state.lineWidth > 40 + state.indent: width decreases until the lower bound.
125357 // This behaves better than a constant minimum width which disallows narrower options,
125358 // or an indent threshold which causes the width to suddenly increase.
125359 var lineWidth = state.lineWidth === -1
125360 ? -1 : Math.max(Math.min(state.lineWidth, 40), state.lineWidth - indent);
125361
125362 // Without knowing if keys are implicit/explicit, assume implicit for safety.
125363 var singleLineOnly = iskey
125364 // No block styles in flow mode.
125365 || (state.flowLevel > -1 && level >= state.flowLevel);
125366 function testAmbiguity(string) {
125367 return testImplicitResolving(state, string);
125368 }
125369
125370 switch (chooseScalarStyle(string, singleLineOnly, state.indent, lineWidth, testAmbiguity)) {
125371 case STYLE_PLAIN:
125372 return string;
125373 case STYLE_SINGLE:
125374 return "'" + string.replace(/'/g, "''") + "'";
125375 case STYLE_LITERAL:
125376 return '|' + blockHeader(string, state.indent)
125377 + dropEndingNewline(indentString(string, indent));
125378 case STYLE_FOLDED:
125379 return '>' + blockHeader(string, state.indent)
125380 + dropEndingNewline(indentString(foldString(string, lineWidth), indent));
125381 case STYLE_DOUBLE:
125382 return '"' + escapeString(string, lineWidth) + '"';
125383 default:
125384 throw new YAMLException('impossible error: invalid scalar style');
125385 }
125386 }());
125387}
125388
125389// Pre-conditions: string is valid for a block scalar, 1 <= indentPerLevel <= 9.
125390function blockHeader(string, indentPerLevel) {
125391 var indentIndicator = needIndentIndicator(string) ? String(indentPerLevel) : '';
125392
125393 // note the special case: the string '\n' counts as a "trailing" empty line.
125394 var clip = string[string.length - 1] === '\n';
125395 var keep = clip && (string[string.length - 2] === '\n' || string === '\n');
125396 var chomp = keep ? '+' : (clip ? '' : '-');
125397
125398 return indentIndicator + chomp + '\n';
125399}
125400
125401// (See the note for writeScalar.)
125402function dropEndingNewline(string) {
125403 return string[string.length - 1] === '\n' ? string.slice(0, -1) : string;
125404}
125405
125406// Note: a long line without a suitable break point will exceed the width limit.
125407// Pre-conditions: every char in str isPrintable, str.length > 0, width > 0.
125408function foldString(string, width) {
125409 // In folded style, $k$ consecutive newlines output as $k+1$ newlines—
125410 // unless they're before or after a more-indented line, or at the very
125411 // beginning or end, in which case $k$ maps to $k$.
125412 // Therefore, parse each chunk as newline(s) followed by a content line.
125413 var lineRe = /(\n+)([^\n]*)/g;
125414
125415 // first line (possibly an empty line)
125416 var result = (function () {
125417 var nextLF = string.indexOf('\n');
125418 nextLF = nextLF !== -1 ? nextLF : string.length;
125419 lineRe.lastIndex = nextLF;
125420 return foldLine(string.slice(0, nextLF), width);
125421 }());
125422 // If we haven't reached the first content line yet, don't add an extra \n.
125423 var prevMoreIndented = string[0] === '\n' || string[0] === ' ';
125424 var moreIndented;
125425
125426 // rest of the lines
125427 var match;
125428 while ((match = lineRe.exec(string))) {
125429 var prefix = match[1], line = match[2];
125430 moreIndented = (line[0] === ' ');
125431 result += prefix
125432 + (!prevMoreIndented && !moreIndented && line !== ''
125433 ? '\n' : '')
125434 + foldLine(line, width);
125435 prevMoreIndented = moreIndented;
125436 }
125437
125438 return result;
125439}
125440
125441// Greedy line breaking.
125442// Picks the longest line under the limit each time,
125443// otherwise settles for the shortest line over the limit.
125444// NB. More-indented lines *cannot* be folded, as that would add an extra \n.
125445function foldLine(line, width) {
125446 if (line === '' || line[0] === ' ') return line;
125447
125448 // Since a more-indented line adds a \n, breaks can't be followed by a space.
125449 var breakRe = / [^ ]/g; // note: the match index will always be <= length-2.
125450 var match;
125451 // start is an inclusive index. end, curr, and next are exclusive.
125452 var start = 0, end, curr = 0, next = 0;
125453 var result = '';
125454
125455 // Invariants: 0 <= start <= length-1.
125456 // 0 <= curr <= next <= max(0, length-2). curr - start <= width.
125457 // Inside the loop:
125458 // A match implies length >= 2, so curr and next are <= length-2.
125459 while ((match = breakRe.exec(line))) {
125460 next = match.index;
125461 // maintain invariant: curr - start <= width
125462 if (next - start > width) {
125463 end = (curr > start) ? curr : next; // derive end <= length-2
125464 result += '\n' + line.slice(start, end);
125465 // skip the space that was output as \n
125466 start = end + 1; // derive start <= length-1
125467 }
125468 curr = next;
125469 }
125470
125471 // By the invariants, start <= length-1, so there is something left over.
125472 // It is either the whole string or a part starting from non-whitespace.
125473 result += '\n';
125474 // Insert a break if the remainder is too long and there is a break available.
125475 if (line.length - start > width && curr > start) {
125476 result += line.slice(start, curr) + '\n' + line.slice(curr + 1);
125477 } else {
125478 result += line.slice(start);
125479 }
125480
125481 return result.slice(1); // drop extra \n joiner
125482}
125483
125484// Escapes a double-quoted string.
125485function escapeString(string) {
125486 var result = '';
125487 var char, nextChar;
125488 var escapeSeq;
125489
125490 for (var i = 0; i < string.length; i++) {
125491 char = string.charCodeAt(i);
125492 // Check for surrogate pairs (reference Unicode 3.0 section "3.7 Surrogates").
125493 if (char >= 0xD800 && char <= 0xDBFF/* high surrogate */) {
125494 nextChar = string.charCodeAt(i + 1);
125495 if (nextChar >= 0xDC00 && nextChar <= 0xDFFF/* low surrogate */) {
125496 // Combine the surrogate pair and store it escaped.
125497 result += encodeHex((char - 0xD800) * 0x400 + nextChar - 0xDC00 + 0x10000);
125498 // Advance index one extra since we already used that char here.
125499 i++; continue;
125500 }
125501 }
125502 escapeSeq = ESCAPE_SEQUENCES[char];
125503 result += !escapeSeq && isPrintable(char)
125504 ? string[i]
125505 : escapeSeq || encodeHex(char);
125506 }
125507
125508 return result;
125509}
125510
125511function writeFlowSequence(state, level, object) {
125512 var _result = '',
125513 _tag = state.tag,
125514 index,
125515 length;
125516
125517 for (index = 0, length = object.length; index < length; index += 1) {
125518 // Write only valid elements.
125519 if (writeNode(state, level, object[index], false, false)) {
125520 if (index !== 0) _result += ',' + (!state.condenseFlow ? ' ' : '');
125521 _result += state.dump;
125522 }
125523 }
125524
125525 state.tag = _tag;
125526 state.dump = '[' + _result + ']';
125527}
125528
125529function writeBlockSequence(state, level, object, compact) {
125530 var _result = '',
125531 _tag = state.tag,
125532 index,
125533 length;
125534
125535 for (index = 0, length = object.length; index < length; index += 1) {
125536 // Write only valid elements.
125537 if (writeNode(state, level + 1, object[index], true, true)) {
125538 if (!compact || index !== 0) {
125539 _result += generateNextLine(state, level);
125540 }
125541
125542 if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
125543 _result += '-';
125544 } else {
125545 _result += '- ';
125546 }
125547
125548 _result += state.dump;
125549 }
125550 }
125551
125552 state.tag = _tag;
125553 state.dump = _result || '[]'; // Empty sequence if no valid values.
125554}
125555
125556function writeFlowMapping(state, level, object) {
125557 var _result = '',
125558 _tag = state.tag,
125559 objectKeyList = Object.keys(object),
125560 index,
125561 length,
125562 objectKey,
125563 objectValue,
125564 pairBuffer;
125565
125566 for (index = 0, length = objectKeyList.length; index < length; index += 1) {
125567 pairBuffer = state.condenseFlow ? '"' : '';
125568
125569 if (index !== 0) pairBuffer += ', ';
125570
125571 objectKey = objectKeyList[index];
125572 objectValue = object[objectKey];
125573
125574 if (!writeNode(state, level, objectKey, false, false)) {
125575 continue; // Skip this pair because of invalid key;
125576 }
125577
125578 if (state.dump.length > 1024) pairBuffer += '? ';
125579
125580 pairBuffer += state.dump + (state.condenseFlow ? '"' : '') + ':' + (state.condenseFlow ? '' : ' ');
125581
125582 if (!writeNode(state, level, objectValue, false, false)) {
125583 continue; // Skip this pair because of invalid value.
125584 }
125585
125586 pairBuffer += state.dump;
125587
125588 // Both key and value are valid.
125589 _result += pairBuffer;
125590 }
125591
125592 state.tag = _tag;
125593 state.dump = '{' + _result + '}';
125594}
125595
125596function writeBlockMapping(state, level, object, compact) {
125597 var _result = '',
125598 _tag = state.tag,
125599 objectKeyList = Object.keys(object),
125600 index,
125601 length,
125602 objectKey,
125603 objectValue,
125604 explicitPair,
125605 pairBuffer;
125606
125607 // Allow sorting keys so that the output file is deterministic
125608 if (state.sortKeys === true) {
125609 // Default sorting
125610 objectKeyList.sort();
125611 } else if (typeof state.sortKeys === 'function') {
125612 // Custom sort function
125613 objectKeyList.sort(state.sortKeys);
125614 } else if (state.sortKeys) {
125615 // Something is wrong
125616 throw new YAMLException('sortKeys must be a boolean or a function');
125617 }
125618
125619 for (index = 0, length = objectKeyList.length; index < length; index += 1) {
125620 pairBuffer = '';
125621
125622 if (!compact || index !== 0) {
125623 pairBuffer += generateNextLine(state, level);
125624 }
125625
125626 objectKey = objectKeyList[index];
125627 objectValue = object[objectKey];
125628
125629 if (!writeNode(state, level + 1, objectKey, true, true, true)) {
125630 continue; // Skip this pair because of invalid key.
125631 }
125632
125633 explicitPair = (state.tag !== null && state.tag !== '?') ||
125634 (state.dump && state.dump.length > 1024);
125635
125636 if (explicitPair) {
125637 if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
125638 pairBuffer += '?';
125639 } else {
125640 pairBuffer += '? ';
125641 }
125642 }
125643
125644 pairBuffer += state.dump;
125645
125646 if (explicitPair) {
125647 pairBuffer += generateNextLine(state, level);
125648 }
125649
125650 if (!writeNode(state, level + 1, objectValue, true, explicitPair)) {
125651 continue; // Skip this pair because of invalid value.
125652 }
125653
125654 if (state.dump && CHAR_LINE_FEED === state.dump.charCodeAt(0)) {
125655 pairBuffer += ':';
125656 } else {
125657 pairBuffer += ': ';
125658 }
125659
125660 pairBuffer += state.dump;
125661
125662 // Both key and value are valid.
125663 _result += pairBuffer;
125664 }
125665
125666 state.tag = _tag;
125667 state.dump = _result || '{}'; // Empty mapping if no valid pairs.
125668}
125669
125670function detectType(state, object, explicit) {
125671 var _result, typeList, index, length, type, style;
125672
125673 typeList = explicit ? state.explicitTypes : state.implicitTypes;
125674
125675 for (index = 0, length = typeList.length; index < length; index += 1) {
125676 type = typeList[index];
125677
125678 if ((type.instanceOf || type.predicate) &&
125679 (!type.instanceOf || ((typeof object === 'object') && (object instanceof type.instanceOf))) &&
125680 (!type.predicate || type.predicate(object))) {
125681
125682 state.tag = explicit ? type.tag : '?';
125683
125684 if (type.represent) {
125685 style = state.styleMap[type.tag] || type.defaultStyle;
125686
125687 if (_toString.call(type.represent) === '[object Function]') {
125688 _result = type.represent(object, style);
125689 } else if (_hasOwnProperty.call(type.represent, style)) {
125690 _result = type.represent[style](object, style);
125691 } else {
125692 throw new YAMLException('!<' + type.tag + '> tag resolver accepts not "' + style + '" style');
125693 }
125694
125695 state.dump = _result;
125696 }
125697
125698 return true;
125699 }
125700 }
125701
125702 return false;
125703}
125704
125705// Serializes `object` and writes it to global `result`.
125706// Returns true on success, or false on invalid object.
125707//
125708function writeNode(state, level, object, block, compact, iskey) {
125709 state.tag = null;
125710 state.dump = object;
125711
125712 if (!detectType(state, object, false)) {
125713 detectType(state, object, true);
125714 }
125715
125716 var type = _toString.call(state.dump);
125717
125718 if (block) {
125719 block = (state.flowLevel < 0 || state.flowLevel > level);
125720 }
125721
125722 var objectOrArray = type === '[object Object]' || type === '[object Array]',
125723 duplicateIndex,
125724 duplicate;
125725
125726 if (objectOrArray) {
125727 duplicateIndex = state.duplicates.indexOf(object);
125728 duplicate = duplicateIndex !== -1;
125729 }
125730
125731 if ((state.tag !== null && state.tag !== '?') || duplicate || (state.indent !== 2 && level > 0)) {
125732 compact = false;
125733 }
125734
125735 if (duplicate && state.usedDuplicates[duplicateIndex]) {
125736 state.dump = '*ref_' + duplicateIndex;
125737 } else {
125738 if (objectOrArray && duplicate && !state.usedDuplicates[duplicateIndex]) {
125739 state.usedDuplicates[duplicateIndex] = true;
125740 }
125741 if (type === '[object Object]') {
125742 if (block && (Object.keys(state.dump).length !== 0)) {
125743 writeBlockMapping(state, level, state.dump, compact);
125744 if (duplicate) {
125745 state.dump = '&ref_' + duplicateIndex + state.dump;
125746 }
125747 } else {
125748 writeFlowMapping(state, level, state.dump);
125749 if (duplicate) {
125750 state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
125751 }
125752 }
125753 } else if (type === '[object Array]') {
125754 var arrayLevel = (state.noArrayIndent && (level > 0)) ? level - 1 : level;
125755 if (block && (state.dump.length !== 0)) {
125756 writeBlockSequence(state, arrayLevel, state.dump, compact);
125757 if (duplicate) {
125758 state.dump = '&ref_' + duplicateIndex + state.dump;
125759 }
125760 } else {
125761 writeFlowSequence(state, arrayLevel, state.dump);
125762 if (duplicate) {
125763 state.dump = '&ref_' + duplicateIndex + ' ' + state.dump;
125764 }
125765 }
125766 } else if (type === '[object String]') {
125767 if (state.tag !== '?') {
125768 writeScalar(state, state.dump, level, iskey);
125769 }
125770 } else {
125771 if (state.skipInvalid) return false;
125772 throw new YAMLException('unacceptable kind of an object to dump ' + type);
125773 }
125774
125775 if (state.tag !== null && state.tag !== '?') {
125776 state.dump = '!<' + state.tag + '> ' + state.dump;
125777 }
125778 }
125779
125780 return true;
125781}
125782
125783function getDuplicateReferences(object, state) {
125784 var objects = [],
125785 duplicatesIndexes = [],
125786 index,
125787 length;
125788
125789 inspectNode(object, objects, duplicatesIndexes);
125790
125791 for (index = 0, length = duplicatesIndexes.length; index < length; index += 1) {
125792 state.duplicates.push(objects[duplicatesIndexes[index]]);
125793 }
125794 state.usedDuplicates = new Array(length);
125795}
125796
125797function inspectNode(object, objects, duplicatesIndexes) {
125798 var objectKeyList,
125799 index,
125800 length;
125801
125802 if (object !== null && typeof object === 'object') {
125803 index = objects.indexOf(object);
125804 if (index !== -1) {
125805 if (duplicatesIndexes.indexOf(index) === -1) {
125806 duplicatesIndexes.push(index);
125807 }
125808 } else {
125809 objects.push(object);
125810
125811 if (Array.isArray(object)) {
125812 for (index = 0, length = object.length; index < length; index += 1) {
125813 inspectNode(object[index], objects, duplicatesIndexes);
125814 }
125815 } else {
125816 objectKeyList = Object.keys(object);
125817
125818 for (index = 0, length = objectKeyList.length; index < length; index += 1) {
125819 inspectNode(object[objectKeyList[index]], objects, duplicatesIndexes);
125820 }
125821 }
125822 }
125823 }
125824}
125825
125826function dump(input, options) {
125827 options = options || {};
125828
125829 var state = new State(options);
125830
125831 if (!state.noRefs) getDuplicateReferences(input, state);
125832
125833 if (writeNode(state, 0, input, true, true)) return state.dump + '\n';
125834
125835 return '';
125836}
125837
125838function safeDump(input, options) {
125839 return dump(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
125840}
125841
125842module.exports.dump = dump;
125843module.exports.safeDump = safeDump;
125844
125845
125846/***/ }),
125847/* 797 */
125848/***/ (function(module, exports, __webpack_require__) {
125849
125850"use strict";
125851
125852
125853/*eslint-disable max-len,no-use-before-define*/
125854
125855var common = __webpack_require__(107);
125856var YAMLException = __webpack_require__(131);
125857var Mark = __webpack_require__(798);
125858var DEFAULT_SAFE_SCHEMA = __webpack_require__(132);
125859var DEFAULT_FULL_SCHEMA = __webpack_require__(168);
125860
125861
125862var _hasOwnProperty = Object.prototype.hasOwnProperty;
125863
125864
125865var CONTEXT_FLOW_IN = 1;
125866var CONTEXT_FLOW_OUT = 2;
125867var CONTEXT_BLOCK_IN = 3;
125868var CONTEXT_BLOCK_OUT = 4;
125869
125870
125871var CHOMPING_CLIP = 1;
125872var CHOMPING_STRIP = 2;
125873var CHOMPING_KEEP = 3;
125874
125875
125876var PATTERN_NON_PRINTABLE = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/;
125877var PATTERN_NON_ASCII_LINE_BREAKS = /[\x85\u2028\u2029]/;
125878var PATTERN_FLOW_INDICATORS = /[,\[\]\{\}]/;
125879var PATTERN_TAG_HANDLE = /^(?:!|!!|![a-z\-]+!)$/i;
125880var PATTERN_TAG_URI = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
125881
125882
125883function _class(obj) { return Object.prototype.toString.call(obj); }
125884
125885function is_EOL(c) {
125886 return (c === 0x0A/* LF */) || (c === 0x0D/* CR */);
125887}
125888
125889function is_WHITE_SPACE(c) {
125890 return (c === 0x09/* Tab */) || (c === 0x20/* Space */);
125891}
125892
125893function is_WS_OR_EOL(c) {
125894 return (c === 0x09/* Tab */) ||
125895 (c === 0x20/* Space */) ||
125896 (c === 0x0A/* LF */) ||
125897 (c === 0x0D/* CR */);
125898}
125899
125900function is_FLOW_INDICATOR(c) {
125901 return c === 0x2C/* , */ ||
125902 c === 0x5B/* [ */ ||
125903 c === 0x5D/* ] */ ||
125904 c === 0x7B/* { */ ||
125905 c === 0x7D/* } */;
125906}
125907
125908function fromHexCode(c) {
125909 var lc;
125910
125911 if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
125912 return c - 0x30;
125913 }
125914
125915 /*eslint-disable no-bitwise*/
125916 lc = c | 0x20;
125917
125918 if ((0x61/* a */ <= lc) && (lc <= 0x66/* f */)) {
125919 return lc - 0x61 + 10;
125920 }
125921
125922 return -1;
125923}
125924
125925function escapedHexLen(c) {
125926 if (c === 0x78/* x */) { return 2; }
125927 if (c === 0x75/* u */) { return 4; }
125928 if (c === 0x55/* U */) { return 8; }
125929 return 0;
125930}
125931
125932function fromDecimalCode(c) {
125933 if ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) {
125934 return c - 0x30;
125935 }
125936
125937 return -1;
125938}
125939
125940function simpleEscapeSequence(c) {
125941 /* eslint-disable indent */
125942 return (c === 0x30/* 0 */) ? '\x00' :
125943 (c === 0x61/* a */) ? '\x07' :
125944 (c === 0x62/* b */) ? '\x08' :
125945 (c === 0x74/* t */) ? '\x09' :
125946 (c === 0x09/* Tab */) ? '\x09' :
125947 (c === 0x6E/* n */) ? '\x0A' :
125948 (c === 0x76/* v */) ? '\x0B' :
125949 (c === 0x66/* f */) ? '\x0C' :
125950 (c === 0x72/* r */) ? '\x0D' :
125951 (c === 0x65/* e */) ? '\x1B' :
125952 (c === 0x20/* Space */) ? ' ' :
125953 (c === 0x22/* " */) ? '\x22' :
125954 (c === 0x2F/* / */) ? '/' :
125955 (c === 0x5C/* \ */) ? '\x5C' :
125956 (c === 0x4E/* N */) ? '\x85' :
125957 (c === 0x5F/* _ */) ? '\xA0' :
125958 (c === 0x4C/* L */) ? '\u2028' :
125959 (c === 0x50/* P */) ? '\u2029' : '';
125960}
125961
125962function charFromCodepoint(c) {
125963 if (c <= 0xFFFF) {
125964 return String.fromCharCode(c);
125965 }
125966 // Encode UTF-16 surrogate pair
125967 // https://en.wikipedia.org/wiki/UTF-16#Code_points_U.2B010000_to_U.2B10FFFF
125968 return String.fromCharCode(
125969 ((c - 0x010000) >> 10) + 0xD800,
125970 ((c - 0x010000) & 0x03FF) + 0xDC00
125971 );
125972}
125973
125974var simpleEscapeCheck = new Array(256); // integer, for fast access
125975var simpleEscapeMap = new Array(256);
125976for (var i = 0; i < 256; i++) {
125977 simpleEscapeCheck[i] = simpleEscapeSequence(i) ? 1 : 0;
125978 simpleEscapeMap[i] = simpleEscapeSequence(i);
125979}
125980
125981
125982function State(input, options) {
125983 this.input = input;
125984
125985 this.filename = options['filename'] || null;
125986 this.schema = options['schema'] || DEFAULT_FULL_SCHEMA;
125987 this.onWarning = options['onWarning'] || null;
125988 this.legacy = options['legacy'] || false;
125989 this.json = options['json'] || false;
125990 this.listener = options['listener'] || null;
125991
125992 this.implicitTypes = this.schema.compiledImplicit;
125993 this.typeMap = this.schema.compiledTypeMap;
125994
125995 this.length = input.length;
125996 this.position = 0;
125997 this.line = 0;
125998 this.lineStart = 0;
125999 this.lineIndent = 0;
126000
126001 this.documents = [];
126002
126003 /*
126004 this.version;
126005 this.checkLineBreaks;
126006 this.tagMap;
126007 this.anchorMap;
126008 this.tag;
126009 this.anchor;
126010 this.kind;
126011 this.result;*/
126012
126013}
126014
126015
126016function generateError(state, message) {
126017 return new YAMLException(
126018 message,
126019 new Mark(state.filename, state.input, state.position, state.line, (state.position - state.lineStart)));
126020}
126021
126022function throwError(state, message) {
126023 throw generateError(state, message);
126024}
126025
126026function throwWarning(state, message) {
126027 if (state.onWarning) {
126028 state.onWarning.call(null, generateError(state, message));
126029 }
126030}
126031
126032
126033var directiveHandlers = {
126034
126035 YAML: function handleYamlDirective(state, name, args) {
126036
126037 var match, major, minor;
126038
126039 if (state.version !== null) {
126040 throwError(state, 'duplication of %YAML directive');
126041 }
126042
126043 if (args.length !== 1) {
126044 throwError(state, 'YAML directive accepts exactly one argument');
126045 }
126046
126047 match = /^([0-9]+)\.([0-9]+)$/.exec(args[0]);
126048
126049 if (match === null) {
126050 throwError(state, 'ill-formed argument of the YAML directive');
126051 }
126052
126053 major = parseInt(match[1], 10);
126054 minor = parseInt(match[2], 10);
126055
126056 if (major !== 1) {
126057 throwError(state, 'unacceptable YAML version of the document');
126058 }
126059
126060 state.version = args[0];
126061 state.checkLineBreaks = (minor < 2);
126062
126063 if (minor !== 1 && minor !== 2) {
126064 throwWarning(state, 'unsupported YAML version of the document');
126065 }
126066 },
126067
126068 TAG: function handleTagDirective(state, name, args) {
126069
126070 var handle, prefix;
126071
126072 if (args.length !== 2) {
126073 throwError(state, 'TAG directive accepts exactly two arguments');
126074 }
126075
126076 handle = args[0];
126077 prefix = args[1];
126078
126079 if (!PATTERN_TAG_HANDLE.test(handle)) {
126080 throwError(state, 'ill-formed tag handle (first argument) of the TAG directive');
126081 }
126082
126083 if (_hasOwnProperty.call(state.tagMap, handle)) {
126084 throwError(state, 'there is a previously declared suffix for "' + handle + '" tag handle');
126085 }
126086
126087 if (!PATTERN_TAG_URI.test(prefix)) {
126088 throwError(state, 'ill-formed tag prefix (second argument) of the TAG directive');
126089 }
126090
126091 state.tagMap[handle] = prefix;
126092 }
126093};
126094
126095
126096function captureSegment(state, start, end, checkJson) {
126097 var _position, _length, _character, _result;
126098
126099 if (start < end) {
126100 _result = state.input.slice(start, end);
126101
126102 if (checkJson) {
126103 for (_position = 0, _length = _result.length; _position < _length; _position += 1) {
126104 _character = _result.charCodeAt(_position);
126105 if (!(_character === 0x09 ||
126106 (0x20 <= _character && _character <= 0x10FFFF))) {
126107 throwError(state, 'expected valid JSON character');
126108 }
126109 }
126110 } else if (PATTERN_NON_PRINTABLE.test(_result)) {
126111 throwError(state, 'the stream contains non-printable characters');
126112 }
126113
126114 state.result += _result;
126115 }
126116}
126117
126118function mergeMappings(state, destination, source, overridableKeys) {
126119 var sourceKeys, key, index, quantity;
126120
126121 if (!common.isObject(source)) {
126122 throwError(state, 'cannot merge mappings; the provided source object is unacceptable');
126123 }
126124
126125 sourceKeys = Object.keys(source);
126126
126127 for (index = 0, quantity = sourceKeys.length; index < quantity; index += 1) {
126128 key = sourceKeys[index];
126129
126130 if (!_hasOwnProperty.call(destination, key)) {
126131 destination[key] = source[key];
126132 overridableKeys[key] = true;
126133 }
126134 }
126135}
126136
126137function storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, startLine, startPos) {
126138 var index, quantity;
126139
126140 // The output is a plain object here, so keys can only be strings.
126141 // We need to convert keyNode to a string, but doing so can hang the process
126142 // (deeply nested arrays that explode exponentially using aliases).
126143 if (Array.isArray(keyNode)) {
126144 keyNode = Array.prototype.slice.call(keyNode);
126145
126146 for (index = 0, quantity = keyNode.length; index < quantity; index += 1) {
126147 if (Array.isArray(keyNode[index])) {
126148 throwError(state, 'nested arrays are not supported inside keys');
126149 }
126150
126151 if (typeof keyNode === 'object' && _class(keyNode[index]) === '[object Object]') {
126152 keyNode[index] = '[object Object]';
126153 }
126154 }
126155 }
126156
126157 // Avoid code execution in load() via toString property
126158 // (still use its own toString for arrays, timestamps,
126159 // and whatever user schema extensions happen to have @@toStringTag)
126160 if (typeof keyNode === 'object' && _class(keyNode) === '[object Object]') {
126161 keyNode = '[object Object]';
126162 }
126163
126164
126165 keyNode = String(keyNode);
126166
126167 if (_result === null) {
126168 _result = {};
126169 }
126170
126171 if (keyTag === 'tag:yaml.org,2002:merge') {
126172 if (Array.isArray(valueNode)) {
126173 for (index = 0, quantity = valueNode.length; index < quantity; index += 1) {
126174 mergeMappings(state, _result, valueNode[index], overridableKeys);
126175 }
126176 } else {
126177 mergeMappings(state, _result, valueNode, overridableKeys);
126178 }
126179 } else {
126180 if (!state.json &&
126181 !_hasOwnProperty.call(overridableKeys, keyNode) &&
126182 _hasOwnProperty.call(_result, keyNode)) {
126183 state.line = startLine || state.line;
126184 state.position = startPos || state.position;
126185 throwError(state, 'duplicated mapping key');
126186 }
126187 _result[keyNode] = valueNode;
126188 delete overridableKeys[keyNode];
126189 }
126190
126191 return _result;
126192}
126193
126194function readLineBreak(state) {
126195 var ch;
126196
126197 ch = state.input.charCodeAt(state.position);
126198
126199 if (ch === 0x0A/* LF */) {
126200 state.position++;
126201 } else if (ch === 0x0D/* CR */) {
126202 state.position++;
126203 if (state.input.charCodeAt(state.position) === 0x0A/* LF */) {
126204 state.position++;
126205 }
126206 } else {
126207 throwError(state, 'a line break is expected');
126208 }
126209
126210 state.line += 1;
126211 state.lineStart = state.position;
126212}
126213
126214function skipSeparationSpace(state, allowComments, checkIndent) {
126215 var lineBreaks = 0,
126216 ch = state.input.charCodeAt(state.position);
126217
126218 while (ch !== 0) {
126219 while (is_WHITE_SPACE(ch)) {
126220 ch = state.input.charCodeAt(++state.position);
126221 }
126222
126223 if (allowComments && ch === 0x23/* # */) {
126224 do {
126225 ch = state.input.charCodeAt(++state.position);
126226 } while (ch !== 0x0A/* LF */ && ch !== 0x0D/* CR */ && ch !== 0);
126227 }
126228
126229 if (is_EOL(ch)) {
126230 readLineBreak(state);
126231
126232 ch = state.input.charCodeAt(state.position);
126233 lineBreaks++;
126234 state.lineIndent = 0;
126235
126236 while (ch === 0x20/* Space */) {
126237 state.lineIndent++;
126238 ch = state.input.charCodeAt(++state.position);
126239 }
126240 } else {
126241 break;
126242 }
126243 }
126244
126245 if (checkIndent !== -1 && lineBreaks !== 0 && state.lineIndent < checkIndent) {
126246 throwWarning(state, 'deficient indentation');
126247 }
126248
126249 return lineBreaks;
126250}
126251
126252function testDocumentSeparator(state) {
126253 var _position = state.position,
126254 ch;
126255
126256 ch = state.input.charCodeAt(_position);
126257
126258 // Condition state.position === state.lineStart is tested
126259 // in parent on each call, for efficiency. No needs to test here again.
126260 if ((ch === 0x2D/* - */ || ch === 0x2E/* . */) &&
126261 ch === state.input.charCodeAt(_position + 1) &&
126262 ch === state.input.charCodeAt(_position + 2)) {
126263
126264 _position += 3;
126265
126266 ch = state.input.charCodeAt(_position);
126267
126268 if (ch === 0 || is_WS_OR_EOL(ch)) {
126269 return true;
126270 }
126271 }
126272
126273 return false;
126274}
126275
126276function writeFoldedLines(state, count) {
126277 if (count === 1) {
126278 state.result += ' ';
126279 } else if (count > 1) {
126280 state.result += common.repeat('\n', count - 1);
126281 }
126282}
126283
126284
126285function readPlainScalar(state, nodeIndent, withinFlowCollection) {
126286 var preceding,
126287 following,
126288 captureStart,
126289 captureEnd,
126290 hasPendingContent,
126291 _line,
126292 _lineStart,
126293 _lineIndent,
126294 _kind = state.kind,
126295 _result = state.result,
126296 ch;
126297
126298 ch = state.input.charCodeAt(state.position);
126299
126300 if (is_WS_OR_EOL(ch) ||
126301 is_FLOW_INDICATOR(ch) ||
126302 ch === 0x23/* # */ ||
126303 ch === 0x26/* & */ ||
126304 ch === 0x2A/* * */ ||
126305 ch === 0x21/* ! */ ||
126306 ch === 0x7C/* | */ ||
126307 ch === 0x3E/* > */ ||
126308 ch === 0x27/* ' */ ||
126309 ch === 0x22/* " */ ||
126310 ch === 0x25/* % */ ||
126311 ch === 0x40/* @ */ ||
126312 ch === 0x60/* ` */) {
126313 return false;
126314 }
126315
126316 if (ch === 0x3F/* ? */ || ch === 0x2D/* - */) {
126317 following = state.input.charCodeAt(state.position + 1);
126318
126319 if (is_WS_OR_EOL(following) ||
126320 withinFlowCollection && is_FLOW_INDICATOR(following)) {
126321 return false;
126322 }
126323 }
126324
126325 state.kind = 'scalar';
126326 state.result = '';
126327 captureStart = captureEnd = state.position;
126328 hasPendingContent = false;
126329
126330 while (ch !== 0) {
126331 if (ch === 0x3A/* : */) {
126332 following = state.input.charCodeAt(state.position + 1);
126333
126334 if (is_WS_OR_EOL(following) ||
126335 withinFlowCollection && is_FLOW_INDICATOR(following)) {
126336 break;
126337 }
126338
126339 } else if (ch === 0x23/* # */) {
126340 preceding = state.input.charCodeAt(state.position - 1);
126341
126342 if (is_WS_OR_EOL(preceding)) {
126343 break;
126344 }
126345
126346 } else if ((state.position === state.lineStart && testDocumentSeparator(state)) ||
126347 withinFlowCollection && is_FLOW_INDICATOR(ch)) {
126348 break;
126349
126350 } else if (is_EOL(ch)) {
126351 _line = state.line;
126352 _lineStart = state.lineStart;
126353 _lineIndent = state.lineIndent;
126354 skipSeparationSpace(state, false, -1);
126355
126356 if (state.lineIndent >= nodeIndent) {
126357 hasPendingContent = true;
126358 ch = state.input.charCodeAt(state.position);
126359 continue;
126360 } else {
126361 state.position = captureEnd;
126362 state.line = _line;
126363 state.lineStart = _lineStart;
126364 state.lineIndent = _lineIndent;
126365 break;
126366 }
126367 }
126368
126369 if (hasPendingContent) {
126370 captureSegment(state, captureStart, captureEnd, false);
126371 writeFoldedLines(state, state.line - _line);
126372 captureStart = captureEnd = state.position;
126373 hasPendingContent = false;
126374 }
126375
126376 if (!is_WHITE_SPACE(ch)) {
126377 captureEnd = state.position + 1;
126378 }
126379
126380 ch = state.input.charCodeAt(++state.position);
126381 }
126382
126383 captureSegment(state, captureStart, captureEnd, false);
126384
126385 if (state.result) {
126386 return true;
126387 }
126388
126389 state.kind = _kind;
126390 state.result = _result;
126391 return false;
126392}
126393
126394function readSingleQuotedScalar(state, nodeIndent) {
126395 var ch,
126396 captureStart, captureEnd;
126397
126398 ch = state.input.charCodeAt(state.position);
126399
126400 if (ch !== 0x27/* ' */) {
126401 return false;
126402 }
126403
126404 state.kind = 'scalar';
126405 state.result = '';
126406 state.position++;
126407 captureStart = captureEnd = state.position;
126408
126409 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
126410 if (ch === 0x27/* ' */) {
126411 captureSegment(state, captureStart, state.position, true);
126412 ch = state.input.charCodeAt(++state.position);
126413
126414 if (ch === 0x27/* ' */) {
126415 captureStart = state.position;
126416 state.position++;
126417 captureEnd = state.position;
126418 } else {
126419 return true;
126420 }
126421
126422 } else if (is_EOL(ch)) {
126423 captureSegment(state, captureStart, captureEnd, true);
126424 writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
126425 captureStart = captureEnd = state.position;
126426
126427 } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
126428 throwError(state, 'unexpected end of the document within a single quoted scalar');
126429
126430 } else {
126431 state.position++;
126432 captureEnd = state.position;
126433 }
126434 }
126435
126436 throwError(state, 'unexpected end of the stream within a single quoted scalar');
126437}
126438
126439function readDoubleQuotedScalar(state, nodeIndent) {
126440 var captureStart,
126441 captureEnd,
126442 hexLength,
126443 hexResult,
126444 tmp,
126445 ch;
126446
126447 ch = state.input.charCodeAt(state.position);
126448
126449 if (ch !== 0x22/* " */) {
126450 return false;
126451 }
126452
126453 state.kind = 'scalar';
126454 state.result = '';
126455 state.position++;
126456 captureStart = captureEnd = state.position;
126457
126458 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
126459 if (ch === 0x22/* " */) {
126460 captureSegment(state, captureStart, state.position, true);
126461 state.position++;
126462 return true;
126463
126464 } else if (ch === 0x5C/* \ */) {
126465 captureSegment(state, captureStart, state.position, true);
126466 ch = state.input.charCodeAt(++state.position);
126467
126468 if (is_EOL(ch)) {
126469 skipSeparationSpace(state, false, nodeIndent);
126470
126471 // TODO: rework to inline fn with no type cast?
126472 } else if (ch < 256 && simpleEscapeCheck[ch]) {
126473 state.result += simpleEscapeMap[ch];
126474 state.position++;
126475
126476 } else if ((tmp = escapedHexLen(ch)) > 0) {
126477 hexLength = tmp;
126478 hexResult = 0;
126479
126480 for (; hexLength > 0; hexLength--) {
126481 ch = state.input.charCodeAt(++state.position);
126482
126483 if ((tmp = fromHexCode(ch)) >= 0) {
126484 hexResult = (hexResult << 4) + tmp;
126485
126486 } else {
126487 throwError(state, 'expected hexadecimal character');
126488 }
126489 }
126490
126491 state.result += charFromCodepoint(hexResult);
126492
126493 state.position++;
126494
126495 } else {
126496 throwError(state, 'unknown escape sequence');
126497 }
126498
126499 captureStart = captureEnd = state.position;
126500
126501 } else if (is_EOL(ch)) {
126502 captureSegment(state, captureStart, captureEnd, true);
126503 writeFoldedLines(state, skipSeparationSpace(state, false, nodeIndent));
126504 captureStart = captureEnd = state.position;
126505
126506 } else if (state.position === state.lineStart && testDocumentSeparator(state)) {
126507 throwError(state, 'unexpected end of the document within a double quoted scalar');
126508
126509 } else {
126510 state.position++;
126511 captureEnd = state.position;
126512 }
126513 }
126514
126515 throwError(state, 'unexpected end of the stream within a double quoted scalar');
126516}
126517
126518function readFlowCollection(state, nodeIndent) {
126519 var readNext = true,
126520 _line,
126521 _tag = state.tag,
126522 _result,
126523 _anchor = state.anchor,
126524 following,
126525 terminator,
126526 isPair,
126527 isExplicitPair,
126528 isMapping,
126529 overridableKeys = {},
126530 keyNode,
126531 keyTag,
126532 valueNode,
126533 ch;
126534
126535 ch = state.input.charCodeAt(state.position);
126536
126537 if (ch === 0x5B/* [ */) {
126538 terminator = 0x5D;/* ] */
126539 isMapping = false;
126540 _result = [];
126541 } else if (ch === 0x7B/* { */) {
126542 terminator = 0x7D;/* } */
126543 isMapping = true;
126544 _result = {};
126545 } else {
126546 return false;
126547 }
126548
126549 if (state.anchor !== null) {
126550 state.anchorMap[state.anchor] = _result;
126551 }
126552
126553 ch = state.input.charCodeAt(++state.position);
126554
126555 while (ch !== 0) {
126556 skipSeparationSpace(state, true, nodeIndent);
126557
126558 ch = state.input.charCodeAt(state.position);
126559
126560 if (ch === terminator) {
126561 state.position++;
126562 state.tag = _tag;
126563 state.anchor = _anchor;
126564 state.kind = isMapping ? 'mapping' : 'sequence';
126565 state.result = _result;
126566 return true;
126567 } else if (!readNext) {
126568 throwError(state, 'missed comma between flow collection entries');
126569 }
126570
126571 keyTag = keyNode = valueNode = null;
126572 isPair = isExplicitPair = false;
126573
126574 if (ch === 0x3F/* ? */) {
126575 following = state.input.charCodeAt(state.position + 1);
126576
126577 if (is_WS_OR_EOL(following)) {
126578 isPair = isExplicitPair = true;
126579 state.position++;
126580 skipSeparationSpace(state, true, nodeIndent);
126581 }
126582 }
126583
126584 _line = state.line;
126585 composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
126586 keyTag = state.tag;
126587 keyNode = state.result;
126588 skipSeparationSpace(state, true, nodeIndent);
126589
126590 ch = state.input.charCodeAt(state.position);
126591
126592 if ((isExplicitPair || state.line === _line) && ch === 0x3A/* : */) {
126593 isPair = true;
126594 ch = state.input.charCodeAt(++state.position);
126595 skipSeparationSpace(state, true, nodeIndent);
126596 composeNode(state, nodeIndent, CONTEXT_FLOW_IN, false, true);
126597 valueNode = state.result;
126598 }
126599
126600 if (isMapping) {
126601 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode);
126602 } else if (isPair) {
126603 _result.push(storeMappingPair(state, null, overridableKeys, keyTag, keyNode, valueNode));
126604 } else {
126605 _result.push(keyNode);
126606 }
126607
126608 skipSeparationSpace(state, true, nodeIndent);
126609
126610 ch = state.input.charCodeAt(state.position);
126611
126612 if (ch === 0x2C/* , */) {
126613 readNext = true;
126614 ch = state.input.charCodeAt(++state.position);
126615 } else {
126616 readNext = false;
126617 }
126618 }
126619
126620 throwError(state, 'unexpected end of the stream within a flow collection');
126621}
126622
126623function readBlockScalar(state, nodeIndent) {
126624 var captureStart,
126625 folding,
126626 chomping = CHOMPING_CLIP,
126627 didReadContent = false,
126628 detectedIndent = false,
126629 textIndent = nodeIndent,
126630 emptyLines = 0,
126631 atMoreIndented = false,
126632 tmp,
126633 ch;
126634
126635 ch = state.input.charCodeAt(state.position);
126636
126637 if (ch === 0x7C/* | */) {
126638 folding = false;
126639 } else if (ch === 0x3E/* > */) {
126640 folding = true;
126641 } else {
126642 return false;
126643 }
126644
126645 state.kind = 'scalar';
126646 state.result = '';
126647
126648 while (ch !== 0) {
126649 ch = state.input.charCodeAt(++state.position);
126650
126651 if (ch === 0x2B/* + */ || ch === 0x2D/* - */) {
126652 if (CHOMPING_CLIP === chomping) {
126653 chomping = (ch === 0x2B/* + */) ? CHOMPING_KEEP : CHOMPING_STRIP;
126654 } else {
126655 throwError(state, 'repeat of a chomping mode identifier');
126656 }
126657
126658 } else if ((tmp = fromDecimalCode(ch)) >= 0) {
126659 if (tmp === 0) {
126660 throwError(state, 'bad explicit indentation width of a block scalar; it cannot be less than one');
126661 } else if (!detectedIndent) {
126662 textIndent = nodeIndent + tmp - 1;
126663 detectedIndent = true;
126664 } else {
126665 throwError(state, 'repeat of an indentation width identifier');
126666 }
126667
126668 } else {
126669 break;
126670 }
126671 }
126672
126673 if (is_WHITE_SPACE(ch)) {
126674 do { ch = state.input.charCodeAt(++state.position); }
126675 while (is_WHITE_SPACE(ch));
126676
126677 if (ch === 0x23/* # */) {
126678 do { ch = state.input.charCodeAt(++state.position); }
126679 while (!is_EOL(ch) && (ch !== 0));
126680 }
126681 }
126682
126683 while (ch !== 0) {
126684 readLineBreak(state);
126685 state.lineIndent = 0;
126686
126687 ch = state.input.charCodeAt(state.position);
126688
126689 while ((!detectedIndent || state.lineIndent < textIndent) &&
126690 (ch === 0x20/* Space */)) {
126691 state.lineIndent++;
126692 ch = state.input.charCodeAt(++state.position);
126693 }
126694
126695 if (!detectedIndent && state.lineIndent > textIndent) {
126696 textIndent = state.lineIndent;
126697 }
126698
126699 if (is_EOL(ch)) {
126700 emptyLines++;
126701 continue;
126702 }
126703
126704 // End of the scalar.
126705 if (state.lineIndent < textIndent) {
126706
126707 // Perform the chomping.
126708 if (chomping === CHOMPING_KEEP) {
126709 state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
126710 } else if (chomping === CHOMPING_CLIP) {
126711 if (didReadContent) { // i.e. only if the scalar is not empty.
126712 state.result += '\n';
126713 }
126714 }
126715
126716 // Break this `while` cycle and go to the funciton's epilogue.
126717 break;
126718 }
126719
126720 // Folded style: use fancy rules to handle line breaks.
126721 if (folding) {
126722
126723 // Lines starting with white space characters (more-indented lines) are not folded.
126724 if (is_WHITE_SPACE(ch)) {
126725 atMoreIndented = true;
126726 // except for the first content line (cf. Example 8.1)
126727 state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
126728
126729 // End of more-indented block.
126730 } else if (atMoreIndented) {
126731 atMoreIndented = false;
126732 state.result += common.repeat('\n', emptyLines + 1);
126733
126734 // Just one line break - perceive as the same line.
126735 } else if (emptyLines === 0) {
126736 if (didReadContent) { // i.e. only if we have already read some scalar content.
126737 state.result += ' ';
126738 }
126739
126740 // Several line breaks - perceive as different lines.
126741 } else {
126742 state.result += common.repeat('\n', emptyLines);
126743 }
126744
126745 // Literal style: just add exact number of line breaks between content lines.
126746 } else {
126747 // Keep all line breaks except the header line break.
126748 state.result += common.repeat('\n', didReadContent ? 1 + emptyLines : emptyLines);
126749 }
126750
126751 didReadContent = true;
126752 detectedIndent = true;
126753 emptyLines = 0;
126754 captureStart = state.position;
126755
126756 while (!is_EOL(ch) && (ch !== 0)) {
126757 ch = state.input.charCodeAt(++state.position);
126758 }
126759
126760 captureSegment(state, captureStart, state.position, false);
126761 }
126762
126763 return true;
126764}
126765
126766function readBlockSequence(state, nodeIndent) {
126767 var _line,
126768 _tag = state.tag,
126769 _anchor = state.anchor,
126770 _result = [],
126771 following,
126772 detected = false,
126773 ch;
126774
126775 if (state.anchor !== null) {
126776 state.anchorMap[state.anchor] = _result;
126777 }
126778
126779 ch = state.input.charCodeAt(state.position);
126780
126781 while (ch !== 0) {
126782
126783 if (ch !== 0x2D/* - */) {
126784 break;
126785 }
126786
126787 following = state.input.charCodeAt(state.position + 1);
126788
126789 if (!is_WS_OR_EOL(following)) {
126790 break;
126791 }
126792
126793 detected = true;
126794 state.position++;
126795
126796 if (skipSeparationSpace(state, true, -1)) {
126797 if (state.lineIndent <= nodeIndent) {
126798 _result.push(null);
126799 ch = state.input.charCodeAt(state.position);
126800 continue;
126801 }
126802 }
126803
126804 _line = state.line;
126805 composeNode(state, nodeIndent, CONTEXT_BLOCK_IN, false, true);
126806 _result.push(state.result);
126807 skipSeparationSpace(state, true, -1);
126808
126809 ch = state.input.charCodeAt(state.position);
126810
126811 if ((state.line === _line || state.lineIndent > nodeIndent) && (ch !== 0)) {
126812 throwError(state, 'bad indentation of a sequence entry');
126813 } else if (state.lineIndent < nodeIndent) {
126814 break;
126815 }
126816 }
126817
126818 if (detected) {
126819 state.tag = _tag;
126820 state.anchor = _anchor;
126821 state.kind = 'sequence';
126822 state.result = _result;
126823 return true;
126824 }
126825 return false;
126826}
126827
126828function readBlockMapping(state, nodeIndent, flowIndent) {
126829 var following,
126830 allowCompact,
126831 _line,
126832 _pos,
126833 _tag = state.tag,
126834 _anchor = state.anchor,
126835 _result = {},
126836 overridableKeys = {},
126837 keyTag = null,
126838 keyNode = null,
126839 valueNode = null,
126840 atExplicitKey = false,
126841 detected = false,
126842 ch;
126843
126844 if (state.anchor !== null) {
126845 state.anchorMap[state.anchor] = _result;
126846 }
126847
126848 ch = state.input.charCodeAt(state.position);
126849
126850 while (ch !== 0) {
126851 following = state.input.charCodeAt(state.position + 1);
126852 _line = state.line; // Save the current line.
126853 _pos = state.position;
126854
126855 //
126856 // Explicit notation case. There are two separate blocks:
126857 // first for the key (denoted by "?") and second for the value (denoted by ":")
126858 //
126859 if ((ch === 0x3F/* ? */ || ch === 0x3A/* : */) && is_WS_OR_EOL(following)) {
126860
126861 if (ch === 0x3F/* ? */) {
126862 if (atExplicitKey) {
126863 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
126864 keyTag = keyNode = valueNode = null;
126865 }
126866
126867 detected = true;
126868 atExplicitKey = true;
126869 allowCompact = true;
126870
126871 } else if (atExplicitKey) {
126872 // i.e. 0x3A/* : */ === character after the explicit key.
126873 atExplicitKey = false;
126874 allowCompact = true;
126875
126876 } else {
126877 throwError(state, 'incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line');
126878 }
126879
126880 state.position += 1;
126881 ch = following;
126882
126883 //
126884 // Implicit notation case. Flow-style node as the key first, then ":", and the value.
126885 //
126886 } else if (composeNode(state, flowIndent, CONTEXT_FLOW_OUT, false, true)) {
126887
126888 if (state.line === _line) {
126889 ch = state.input.charCodeAt(state.position);
126890
126891 while (is_WHITE_SPACE(ch)) {
126892 ch = state.input.charCodeAt(++state.position);
126893 }
126894
126895 if (ch === 0x3A/* : */) {
126896 ch = state.input.charCodeAt(++state.position);
126897
126898 if (!is_WS_OR_EOL(ch)) {
126899 throwError(state, 'a whitespace character is expected after the key-value separator within a block mapping');
126900 }
126901
126902 if (atExplicitKey) {
126903 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
126904 keyTag = keyNode = valueNode = null;
126905 }
126906
126907 detected = true;
126908 atExplicitKey = false;
126909 allowCompact = false;
126910 keyTag = state.tag;
126911 keyNode = state.result;
126912
126913 } else if (detected) {
126914 throwError(state, 'can not read an implicit mapping pair; a colon is missed');
126915
126916 } else {
126917 state.tag = _tag;
126918 state.anchor = _anchor;
126919 return true; // Keep the result of `composeNode`.
126920 }
126921
126922 } else if (detected) {
126923 throwError(state, 'can not read a block mapping entry; a multiline key may not be an implicit key');
126924
126925 } else {
126926 state.tag = _tag;
126927 state.anchor = _anchor;
126928 return true; // Keep the result of `composeNode`.
126929 }
126930
126931 } else {
126932 break; // Reading is done. Go to the epilogue.
126933 }
126934
126935 //
126936 // Common reading code for both explicit and implicit notations.
126937 //
126938 if (state.line === _line || state.lineIndent > nodeIndent) {
126939 if (composeNode(state, nodeIndent, CONTEXT_BLOCK_OUT, true, allowCompact)) {
126940 if (atExplicitKey) {
126941 keyNode = state.result;
126942 } else {
126943 valueNode = state.result;
126944 }
126945 }
126946
126947 if (!atExplicitKey) {
126948 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, valueNode, _line, _pos);
126949 keyTag = keyNode = valueNode = null;
126950 }
126951
126952 skipSeparationSpace(state, true, -1);
126953 ch = state.input.charCodeAt(state.position);
126954 }
126955
126956 if (state.lineIndent > nodeIndent && (ch !== 0)) {
126957 throwError(state, 'bad indentation of a mapping entry');
126958 } else if (state.lineIndent < nodeIndent) {
126959 break;
126960 }
126961 }
126962
126963 //
126964 // Epilogue.
126965 //
126966
126967 // Special case: last mapping's node contains only the key in explicit notation.
126968 if (atExplicitKey) {
126969 storeMappingPair(state, _result, overridableKeys, keyTag, keyNode, null);
126970 }
126971
126972 // Expose the resulting mapping.
126973 if (detected) {
126974 state.tag = _tag;
126975 state.anchor = _anchor;
126976 state.kind = 'mapping';
126977 state.result = _result;
126978 }
126979
126980 return detected;
126981}
126982
126983function readTagProperty(state) {
126984 var _position,
126985 isVerbatim = false,
126986 isNamed = false,
126987 tagHandle,
126988 tagName,
126989 ch;
126990
126991 ch = state.input.charCodeAt(state.position);
126992
126993 if (ch !== 0x21/* ! */) return false;
126994
126995 if (state.tag !== null) {
126996 throwError(state, 'duplication of a tag property');
126997 }
126998
126999 ch = state.input.charCodeAt(++state.position);
127000
127001 if (ch === 0x3C/* < */) {
127002 isVerbatim = true;
127003 ch = state.input.charCodeAt(++state.position);
127004
127005 } else if (ch === 0x21/* ! */) {
127006 isNamed = true;
127007 tagHandle = '!!';
127008 ch = state.input.charCodeAt(++state.position);
127009
127010 } else {
127011 tagHandle = '!';
127012 }
127013
127014 _position = state.position;
127015
127016 if (isVerbatim) {
127017 do { ch = state.input.charCodeAt(++state.position); }
127018 while (ch !== 0 && ch !== 0x3E/* > */);
127019
127020 if (state.position < state.length) {
127021 tagName = state.input.slice(_position, state.position);
127022 ch = state.input.charCodeAt(++state.position);
127023 } else {
127024 throwError(state, 'unexpected end of the stream within a verbatim tag');
127025 }
127026 } else {
127027 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
127028
127029 if (ch === 0x21/* ! */) {
127030 if (!isNamed) {
127031 tagHandle = state.input.slice(_position - 1, state.position + 1);
127032
127033 if (!PATTERN_TAG_HANDLE.test(tagHandle)) {
127034 throwError(state, 'named tag handle cannot contain such characters');
127035 }
127036
127037 isNamed = true;
127038 _position = state.position + 1;
127039 } else {
127040 throwError(state, 'tag suffix cannot contain exclamation marks');
127041 }
127042 }
127043
127044 ch = state.input.charCodeAt(++state.position);
127045 }
127046
127047 tagName = state.input.slice(_position, state.position);
127048
127049 if (PATTERN_FLOW_INDICATORS.test(tagName)) {
127050 throwError(state, 'tag suffix cannot contain flow indicator characters');
127051 }
127052 }
127053
127054 if (tagName && !PATTERN_TAG_URI.test(tagName)) {
127055 throwError(state, 'tag name cannot contain such characters: ' + tagName);
127056 }
127057
127058 if (isVerbatim) {
127059 state.tag = tagName;
127060
127061 } else if (_hasOwnProperty.call(state.tagMap, tagHandle)) {
127062 state.tag = state.tagMap[tagHandle] + tagName;
127063
127064 } else if (tagHandle === '!') {
127065 state.tag = '!' + tagName;
127066
127067 } else if (tagHandle === '!!') {
127068 state.tag = 'tag:yaml.org,2002:' + tagName;
127069
127070 } else {
127071 throwError(state, 'undeclared tag handle "' + tagHandle + '"');
127072 }
127073
127074 return true;
127075}
127076
127077function readAnchorProperty(state) {
127078 var _position,
127079 ch;
127080
127081 ch = state.input.charCodeAt(state.position);
127082
127083 if (ch !== 0x26/* & */) return false;
127084
127085 if (state.anchor !== null) {
127086 throwError(state, 'duplication of an anchor property');
127087 }
127088
127089 ch = state.input.charCodeAt(++state.position);
127090 _position = state.position;
127091
127092 while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
127093 ch = state.input.charCodeAt(++state.position);
127094 }
127095
127096 if (state.position === _position) {
127097 throwError(state, 'name of an anchor node must contain at least one character');
127098 }
127099
127100 state.anchor = state.input.slice(_position, state.position);
127101 return true;
127102}
127103
127104function readAlias(state) {
127105 var _position, alias,
127106 ch;
127107
127108 ch = state.input.charCodeAt(state.position);
127109
127110 if (ch !== 0x2A/* * */) return false;
127111
127112 ch = state.input.charCodeAt(++state.position);
127113 _position = state.position;
127114
127115 while (ch !== 0 && !is_WS_OR_EOL(ch) && !is_FLOW_INDICATOR(ch)) {
127116 ch = state.input.charCodeAt(++state.position);
127117 }
127118
127119 if (state.position === _position) {
127120 throwError(state, 'name of an alias node must contain at least one character');
127121 }
127122
127123 alias = state.input.slice(_position, state.position);
127124
127125 if (!state.anchorMap.hasOwnProperty(alias)) {
127126 throwError(state, 'unidentified alias "' + alias + '"');
127127 }
127128
127129 state.result = state.anchorMap[alias];
127130 skipSeparationSpace(state, true, -1);
127131 return true;
127132}
127133
127134function composeNode(state, parentIndent, nodeContext, allowToSeek, allowCompact) {
127135 var allowBlockStyles,
127136 allowBlockScalars,
127137 allowBlockCollections,
127138 indentStatus = 1, // 1: this>parent, 0: this=parent, -1: this<parent
127139 atNewLine = false,
127140 hasContent = false,
127141 typeIndex,
127142 typeQuantity,
127143 type,
127144 flowIndent,
127145 blockIndent;
127146
127147 if (state.listener !== null) {
127148 state.listener('open', state);
127149 }
127150
127151 state.tag = null;
127152 state.anchor = null;
127153 state.kind = null;
127154 state.result = null;
127155
127156 allowBlockStyles = allowBlockScalars = allowBlockCollections =
127157 CONTEXT_BLOCK_OUT === nodeContext ||
127158 CONTEXT_BLOCK_IN === nodeContext;
127159
127160 if (allowToSeek) {
127161 if (skipSeparationSpace(state, true, -1)) {
127162 atNewLine = true;
127163
127164 if (state.lineIndent > parentIndent) {
127165 indentStatus = 1;
127166 } else if (state.lineIndent === parentIndent) {
127167 indentStatus = 0;
127168 } else if (state.lineIndent < parentIndent) {
127169 indentStatus = -1;
127170 }
127171 }
127172 }
127173
127174 if (indentStatus === 1) {
127175 while (readTagProperty(state) || readAnchorProperty(state)) {
127176 if (skipSeparationSpace(state, true, -1)) {
127177 atNewLine = true;
127178 allowBlockCollections = allowBlockStyles;
127179
127180 if (state.lineIndent > parentIndent) {
127181 indentStatus = 1;
127182 } else if (state.lineIndent === parentIndent) {
127183 indentStatus = 0;
127184 } else if (state.lineIndent < parentIndent) {
127185 indentStatus = -1;
127186 }
127187 } else {
127188 allowBlockCollections = false;
127189 }
127190 }
127191 }
127192
127193 if (allowBlockCollections) {
127194 allowBlockCollections = atNewLine || allowCompact;
127195 }
127196
127197 if (indentStatus === 1 || CONTEXT_BLOCK_OUT === nodeContext) {
127198 if (CONTEXT_FLOW_IN === nodeContext || CONTEXT_FLOW_OUT === nodeContext) {
127199 flowIndent = parentIndent;
127200 } else {
127201 flowIndent = parentIndent + 1;
127202 }
127203
127204 blockIndent = state.position - state.lineStart;
127205
127206 if (indentStatus === 1) {
127207 if (allowBlockCollections &&
127208 (readBlockSequence(state, blockIndent) ||
127209 readBlockMapping(state, blockIndent, flowIndent)) ||
127210 readFlowCollection(state, flowIndent)) {
127211 hasContent = true;
127212 } else {
127213 if ((allowBlockScalars && readBlockScalar(state, flowIndent)) ||
127214 readSingleQuotedScalar(state, flowIndent) ||
127215 readDoubleQuotedScalar(state, flowIndent)) {
127216 hasContent = true;
127217
127218 } else if (readAlias(state)) {
127219 hasContent = true;
127220
127221 if (state.tag !== null || state.anchor !== null) {
127222 throwError(state, 'alias node should not have any properties');
127223 }
127224
127225 } else if (readPlainScalar(state, flowIndent, CONTEXT_FLOW_IN === nodeContext)) {
127226 hasContent = true;
127227
127228 if (state.tag === null) {
127229 state.tag = '?';
127230 }
127231 }
127232
127233 if (state.anchor !== null) {
127234 state.anchorMap[state.anchor] = state.result;
127235 }
127236 }
127237 } else if (indentStatus === 0) {
127238 // Special case: block sequences are allowed to have same indentation level as the parent.
127239 // http://www.yaml.org/spec/1.2/spec.html#id2799784
127240 hasContent = allowBlockCollections && readBlockSequence(state, blockIndent);
127241 }
127242 }
127243
127244 if (state.tag !== null && state.tag !== '!') {
127245 if (state.tag === '?') {
127246 for (typeIndex = 0, typeQuantity = state.implicitTypes.length; typeIndex < typeQuantity; typeIndex += 1) {
127247 type = state.implicitTypes[typeIndex];
127248
127249 // Implicit resolving is not allowed for non-scalar types, and '?'
127250 // non-specific tag is only assigned to plain scalars. So, it isn't
127251 // needed to check for 'kind' conformity.
127252
127253 if (type.resolve(state.result)) { // `state.result` updated in resolver if matched
127254 state.result = type.construct(state.result);
127255 state.tag = type.tag;
127256 if (state.anchor !== null) {
127257 state.anchorMap[state.anchor] = state.result;
127258 }
127259 break;
127260 }
127261 }
127262 } else if (_hasOwnProperty.call(state.typeMap[state.kind || 'fallback'], state.tag)) {
127263 type = state.typeMap[state.kind || 'fallback'][state.tag];
127264
127265 if (state.result !== null && type.kind !== state.kind) {
127266 throwError(state, 'unacceptable node kind for !<' + state.tag + '> tag; it should be "' + type.kind + '", not "' + state.kind + '"');
127267 }
127268
127269 if (!type.resolve(state.result)) { // `state.result` updated in resolver if matched
127270 throwError(state, 'cannot resolve a node with !<' + state.tag + '> explicit tag');
127271 } else {
127272 state.result = type.construct(state.result);
127273 if (state.anchor !== null) {
127274 state.anchorMap[state.anchor] = state.result;
127275 }
127276 }
127277 } else {
127278 throwError(state, 'unknown tag !<' + state.tag + '>');
127279 }
127280 }
127281
127282 if (state.listener !== null) {
127283 state.listener('close', state);
127284 }
127285 return state.tag !== null || state.anchor !== null || hasContent;
127286}
127287
127288function readDocument(state) {
127289 var documentStart = state.position,
127290 _position,
127291 directiveName,
127292 directiveArgs,
127293 hasDirectives = false,
127294 ch;
127295
127296 state.version = null;
127297 state.checkLineBreaks = state.legacy;
127298 state.tagMap = {};
127299 state.anchorMap = {};
127300
127301 while ((ch = state.input.charCodeAt(state.position)) !== 0) {
127302 skipSeparationSpace(state, true, -1);
127303
127304 ch = state.input.charCodeAt(state.position);
127305
127306 if (state.lineIndent > 0 || ch !== 0x25/* % */) {
127307 break;
127308 }
127309
127310 hasDirectives = true;
127311 ch = state.input.charCodeAt(++state.position);
127312 _position = state.position;
127313
127314 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
127315 ch = state.input.charCodeAt(++state.position);
127316 }
127317
127318 directiveName = state.input.slice(_position, state.position);
127319 directiveArgs = [];
127320
127321 if (directiveName.length < 1) {
127322 throwError(state, 'directive name must not be less than one character in length');
127323 }
127324
127325 while (ch !== 0) {
127326 while (is_WHITE_SPACE(ch)) {
127327 ch = state.input.charCodeAt(++state.position);
127328 }
127329
127330 if (ch === 0x23/* # */) {
127331 do { ch = state.input.charCodeAt(++state.position); }
127332 while (ch !== 0 && !is_EOL(ch));
127333 break;
127334 }
127335
127336 if (is_EOL(ch)) break;
127337
127338 _position = state.position;
127339
127340 while (ch !== 0 && !is_WS_OR_EOL(ch)) {
127341 ch = state.input.charCodeAt(++state.position);
127342 }
127343
127344 directiveArgs.push(state.input.slice(_position, state.position));
127345 }
127346
127347 if (ch !== 0) readLineBreak(state);
127348
127349 if (_hasOwnProperty.call(directiveHandlers, directiveName)) {
127350 directiveHandlers[directiveName](state, directiveName, directiveArgs);
127351 } else {
127352 throwWarning(state, 'unknown document directive "' + directiveName + '"');
127353 }
127354 }
127355
127356 skipSeparationSpace(state, true, -1);
127357
127358 if (state.lineIndent === 0 &&
127359 state.input.charCodeAt(state.position) === 0x2D/* - */ &&
127360 state.input.charCodeAt(state.position + 1) === 0x2D/* - */ &&
127361 state.input.charCodeAt(state.position + 2) === 0x2D/* - */) {
127362 state.position += 3;
127363 skipSeparationSpace(state, true, -1);
127364
127365 } else if (hasDirectives) {
127366 throwError(state, 'directives end mark is expected');
127367 }
127368
127369 composeNode(state, state.lineIndent - 1, CONTEXT_BLOCK_OUT, false, true);
127370 skipSeparationSpace(state, true, -1);
127371
127372 if (state.checkLineBreaks &&
127373 PATTERN_NON_ASCII_LINE_BREAKS.test(state.input.slice(documentStart, state.position))) {
127374 throwWarning(state, 'non-ASCII line breaks are interpreted as content');
127375 }
127376
127377 state.documents.push(state.result);
127378
127379 if (state.position === state.lineStart && testDocumentSeparator(state)) {
127380
127381 if (state.input.charCodeAt(state.position) === 0x2E/* . */) {
127382 state.position += 3;
127383 skipSeparationSpace(state, true, -1);
127384 }
127385 return;
127386 }
127387
127388 if (state.position < (state.length - 1)) {
127389 throwError(state, 'end of the stream or a document separator is expected');
127390 } else {
127391 return;
127392 }
127393}
127394
127395
127396function loadDocuments(input, options) {
127397 input = String(input);
127398 options = options || {};
127399
127400 if (input.length !== 0) {
127401
127402 // Add tailing `\n` if not exists
127403 if (input.charCodeAt(input.length - 1) !== 0x0A/* LF */ &&
127404 input.charCodeAt(input.length - 1) !== 0x0D/* CR */) {
127405 input += '\n';
127406 }
127407
127408 // Strip BOM
127409 if (input.charCodeAt(0) === 0xFEFF) {
127410 input = input.slice(1);
127411 }
127412 }
127413
127414 var state = new State(input, options);
127415
127416 // Use 0 as string terminator. That significantly simplifies bounds check.
127417 state.input += '\0';
127418
127419 while (state.input.charCodeAt(state.position) === 0x20/* Space */) {
127420 state.lineIndent += 1;
127421 state.position += 1;
127422 }
127423
127424 while (state.position < (state.length - 1)) {
127425 readDocument(state);
127426 }
127427
127428 return state.documents;
127429}
127430
127431
127432function loadAll(input, iterator, options) {
127433 var documents = loadDocuments(input, options), index, length;
127434
127435 if (typeof iterator !== 'function') {
127436 return documents;
127437 }
127438
127439 for (index = 0, length = documents.length; index < length; index += 1) {
127440 iterator(documents[index]);
127441 }
127442}
127443
127444
127445function load(input, options) {
127446 var documents = loadDocuments(input, options);
127447
127448 if (documents.length === 0) {
127449 /*eslint-disable no-undefined*/
127450 return undefined;
127451 } else if (documents.length === 1) {
127452 return documents[0];
127453 }
127454 throw new YAMLException('expected a single document in the stream, but found more');
127455}
127456
127457
127458function safeLoadAll(input, output, options) {
127459 if (typeof output === 'function') {
127460 loadAll(input, output, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
127461 } else {
127462 return loadAll(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
127463 }
127464}
127465
127466
127467function safeLoad(input, options) {
127468 return load(input, common.extend({ schema: DEFAULT_SAFE_SCHEMA }, options));
127469}
127470
127471
127472module.exports.loadAll = loadAll;
127473module.exports.load = load;
127474module.exports.safeLoadAll = safeLoadAll;
127475module.exports.safeLoad = safeLoad;
127476
127477
127478/***/ }),
127479/* 798 */
127480/***/ (function(module, exports, __webpack_require__) {
127481
127482"use strict";
127483
127484
127485
127486var common = __webpack_require__(107);
127487
127488
127489function Mark(name, buffer, position, line, column) {
127490 this.name = name;
127491 this.buffer = buffer;
127492 this.position = position;
127493 this.line = line;
127494 this.column = column;
127495}
127496
127497
127498Mark.prototype.getSnippet = function getSnippet(indent, maxLength) {
127499 var head, start, tail, end, snippet;
127500
127501 if (!this.buffer) return null;
127502
127503 indent = indent || 4;
127504 maxLength = maxLength || 75;
127505
127506 head = '';
127507 start = this.position;
127508
127509 while (start > 0 && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(start - 1)) === -1) {
127510 start -= 1;
127511 if (this.position - start > (maxLength / 2 - 1)) {
127512 head = ' ... ';
127513 start += 5;
127514 break;
127515 }
127516 }
127517
127518 tail = '';
127519 end = this.position;
127520
127521 while (end < this.buffer.length && '\x00\r\n\x85\u2028\u2029'.indexOf(this.buffer.charAt(end)) === -1) {
127522 end += 1;
127523 if (end - this.position > (maxLength / 2 - 1)) {
127524 tail = ' ... ';
127525 end -= 5;
127526 break;
127527 }
127528 }
127529
127530 snippet = this.buffer.slice(start, end);
127531
127532 return common.repeat(' ', indent) + head + snippet + tail + '\n' +
127533 common.repeat(' ', indent + this.position - start + head.length) + '^';
127534};
127535
127536
127537Mark.prototype.toString = function toString(compact) {
127538 var snippet, where = '';
127539
127540 if (this.name) {
127541 where += 'in "' + this.name + '" ';
127542 }
127543
127544 where += 'at line ' + (this.line + 1) + ', column ' + (this.column + 1);
127545
127546 if (!compact) {
127547 snippet = this.getSnippet();
127548
127549 if (snippet) {
127550 where += ':\n' + snippet;
127551 }
127552 }
127553
127554 return where;
127555};
127556
127557
127558module.exports = Mark;
127559
127560
127561/***/ }),
127562/* 799 */
127563/***/ (function(module, exports, __webpack_require__) {
127564
127565"use strict";
127566var require;
127567
127568/*eslint-disable no-bitwise*/
127569
127570var NodeBuffer;
127571
127572try {
127573 // A trick for browserified version, to not include `Buffer` shim
127574 var _require = require;
127575 NodeBuffer = __webpack_require__(94).Buffer;
127576} catch (__) {}
127577
127578var Type = __webpack_require__(30);
127579
127580
127581// [ 64, 65, 66 ] -> [ padding, CR, LF ]
127582var BASE64_MAP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\n\r';
127583
127584
127585function resolveYamlBinary(data) {
127586 if (data === null) return false;
127587
127588 var code, idx, bitlen = 0, max = data.length, map = BASE64_MAP;
127589
127590 // Convert one by one.
127591 for (idx = 0; idx < max; idx++) {
127592 code = map.indexOf(data.charAt(idx));
127593
127594 // Skip CR/LF
127595 if (code > 64) continue;
127596
127597 // Fail on illegal characters
127598 if (code < 0) return false;
127599
127600 bitlen += 6;
127601 }
127602
127603 // If there are any bits left, source was corrupted
127604 return (bitlen % 8) === 0;
127605}
127606
127607function constructYamlBinary(data) {
127608 var idx, tailbits,
127609 input = data.replace(/[\r\n=]/g, ''), // remove CR/LF & padding to simplify scan
127610 max = input.length,
127611 map = BASE64_MAP,
127612 bits = 0,
127613 result = [];
127614
127615 // Collect by 6*4 bits (3 bytes)
127616
127617 for (idx = 0; idx < max; idx++) {
127618 if ((idx % 4 === 0) && idx) {
127619 result.push((bits >> 16) & 0xFF);
127620 result.push((bits >> 8) & 0xFF);
127621 result.push(bits & 0xFF);
127622 }
127623
127624 bits = (bits << 6) | map.indexOf(input.charAt(idx));
127625 }
127626
127627 // Dump tail
127628
127629 tailbits = (max % 4) * 6;
127630
127631 if (tailbits === 0) {
127632 result.push((bits >> 16) & 0xFF);
127633 result.push((bits >> 8) & 0xFF);
127634 result.push(bits & 0xFF);
127635 } else if (tailbits === 18) {
127636 result.push((bits >> 10) & 0xFF);
127637 result.push((bits >> 2) & 0xFF);
127638 } else if (tailbits === 12) {
127639 result.push((bits >> 4) & 0xFF);
127640 }
127641
127642 // Wrap into Buffer for NodeJS and leave Array for browser
127643 if (NodeBuffer) {
127644 // Support node 6.+ Buffer API when available
127645 return NodeBuffer.from ? NodeBuffer.from(result) : new NodeBuffer(result);
127646 }
127647
127648 return result;
127649}
127650
127651function representYamlBinary(object /*, style*/) {
127652 var result = '', bits = 0, idx, tail,
127653 max = object.length,
127654 map = BASE64_MAP;
127655
127656 // Convert every three bytes to 4 ASCII characters.
127657
127658 for (idx = 0; idx < max; idx++) {
127659 if ((idx % 3 === 0) && idx) {
127660 result += map[(bits >> 18) & 0x3F];
127661 result += map[(bits >> 12) & 0x3F];
127662 result += map[(bits >> 6) & 0x3F];
127663 result += map[bits & 0x3F];
127664 }
127665
127666 bits = (bits << 8) + object[idx];
127667 }
127668
127669 // Dump tail
127670
127671 tail = max % 3;
127672
127673 if (tail === 0) {
127674 result += map[(bits >> 18) & 0x3F];
127675 result += map[(bits >> 12) & 0x3F];
127676 result += map[(bits >> 6) & 0x3F];
127677 result += map[bits & 0x3F];
127678 } else if (tail === 2) {
127679 result += map[(bits >> 10) & 0x3F];
127680 result += map[(bits >> 4) & 0x3F];
127681 result += map[(bits << 2) & 0x3F];
127682 result += map[64];
127683 } else if (tail === 1) {
127684 result += map[(bits >> 2) & 0x3F];
127685 result += map[(bits << 4) & 0x3F];
127686 result += map[64];
127687 result += map[64];
127688 }
127689
127690 return result;
127691}
127692
127693function isBinary(object) {
127694 return NodeBuffer && NodeBuffer.isBuffer(object);
127695}
127696
127697module.exports = new Type('tag:yaml.org,2002:binary', {
127698 kind: 'scalar',
127699 resolve: resolveYamlBinary,
127700 construct: constructYamlBinary,
127701 predicate: isBinary,
127702 represent: representYamlBinary
127703});
127704
127705
127706/***/ }),
127707/* 800 */
127708/***/ (function(module, exports, __webpack_require__) {
127709
127710"use strict";
127711
127712
127713var Type = __webpack_require__(30);
127714
127715function resolveYamlBoolean(data) {
127716 if (data === null) return false;
127717
127718 var max = data.length;
127719
127720 return (max === 4 && (data === 'true' || data === 'True' || data === 'TRUE')) ||
127721 (max === 5 && (data === 'false' || data === 'False' || data === 'FALSE'));
127722}
127723
127724function constructYamlBoolean(data) {
127725 return data === 'true' ||
127726 data === 'True' ||
127727 data === 'TRUE';
127728}
127729
127730function isBoolean(object) {
127731 return Object.prototype.toString.call(object) === '[object Boolean]';
127732}
127733
127734module.exports = new Type('tag:yaml.org,2002:bool', {
127735 kind: 'scalar',
127736 resolve: resolveYamlBoolean,
127737 construct: constructYamlBoolean,
127738 predicate: isBoolean,
127739 represent: {
127740 lowercase: function (object) { return object ? 'true' : 'false'; },
127741 uppercase: function (object) { return object ? 'TRUE' : 'FALSE'; },
127742 camelcase: function (object) { return object ? 'True' : 'False'; }
127743 },
127744 defaultStyle: 'lowercase'
127745});
127746
127747
127748/***/ }),
127749/* 801 */
127750/***/ (function(module, exports, __webpack_require__) {
127751
127752"use strict";
127753
127754
127755var common = __webpack_require__(107);
127756var Type = __webpack_require__(30);
127757
127758var YAML_FLOAT_PATTERN = new RegExp(
127759 // 2.5e4, 2.5 and integers
127760 '^(?:[-+]?(?:0|[1-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?' +
127761 // .2e4, .2
127762 // special case, seems not from spec
127763 '|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?' +
127764 // 20:59
127765 '|[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\\.[0-9_]*' +
127766 // .inf
127767 '|[-+]?\\.(?:inf|Inf|INF)' +
127768 // .nan
127769 '|\\.(?:nan|NaN|NAN))$');
127770
127771function resolveYamlFloat(data) {
127772 if (data === null) return false;
127773
127774 if (!YAML_FLOAT_PATTERN.test(data) ||
127775 // Quick hack to not allow integers end with `_`
127776 // Probably should update regexp & check speed
127777 data[data.length - 1] === '_') {
127778 return false;
127779 }
127780
127781 return true;
127782}
127783
127784function constructYamlFloat(data) {
127785 var value, sign, base, digits;
127786
127787 value = data.replace(/_/g, '').toLowerCase();
127788 sign = value[0] === '-' ? -1 : 1;
127789 digits = [];
127790
127791 if ('+-'.indexOf(value[0]) >= 0) {
127792 value = value.slice(1);
127793 }
127794
127795 if (value === '.inf') {
127796 return (sign === 1) ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY;
127797
127798 } else if (value === '.nan') {
127799 return NaN;
127800
127801 } else if (value.indexOf(':') >= 0) {
127802 value.split(':').forEach(function (v) {
127803 digits.unshift(parseFloat(v, 10));
127804 });
127805
127806 value = 0.0;
127807 base = 1;
127808
127809 digits.forEach(function (d) {
127810 value += d * base;
127811 base *= 60;
127812 });
127813
127814 return sign * value;
127815
127816 }
127817 return sign * parseFloat(value, 10);
127818}
127819
127820
127821var SCIENTIFIC_WITHOUT_DOT = /^[-+]?[0-9]+e/;
127822
127823function representYamlFloat(object, style) {
127824 var res;
127825
127826 if (isNaN(object)) {
127827 switch (style) {
127828 case 'lowercase': return '.nan';
127829 case 'uppercase': return '.NAN';
127830 case 'camelcase': return '.NaN';
127831 }
127832 } else if (Number.POSITIVE_INFINITY === object) {
127833 switch (style) {
127834 case 'lowercase': return '.inf';
127835 case 'uppercase': return '.INF';
127836 case 'camelcase': return '.Inf';
127837 }
127838 } else if (Number.NEGATIVE_INFINITY === object) {
127839 switch (style) {
127840 case 'lowercase': return '-.inf';
127841 case 'uppercase': return '-.INF';
127842 case 'camelcase': return '-.Inf';
127843 }
127844 } else if (common.isNegativeZero(object)) {
127845 return '-0.0';
127846 }
127847
127848 res = object.toString(10);
127849
127850 // JS stringifier can build scientific format without dots: 5e-100,
127851 // while YAML requres dot: 5.e-100. Fix it with simple hack
127852
127853 return SCIENTIFIC_WITHOUT_DOT.test(res) ? res.replace('e', '.e') : res;
127854}
127855
127856function isFloat(object) {
127857 return (Object.prototype.toString.call(object) === '[object Number]') &&
127858 (object % 1 !== 0 || common.isNegativeZero(object));
127859}
127860
127861module.exports = new Type('tag:yaml.org,2002:float', {
127862 kind: 'scalar',
127863 resolve: resolveYamlFloat,
127864 construct: constructYamlFloat,
127865 predicate: isFloat,
127866 represent: representYamlFloat,
127867 defaultStyle: 'lowercase'
127868});
127869
127870
127871/***/ }),
127872/* 802 */
127873/***/ (function(module, exports, __webpack_require__) {
127874
127875"use strict";
127876
127877
127878var common = __webpack_require__(107);
127879var Type = __webpack_require__(30);
127880
127881function isHexCode(c) {
127882 return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */)) ||
127883 ((0x41/* A */ <= c) && (c <= 0x46/* F */)) ||
127884 ((0x61/* a */ <= c) && (c <= 0x66/* f */));
127885}
127886
127887function isOctCode(c) {
127888 return ((0x30/* 0 */ <= c) && (c <= 0x37/* 7 */));
127889}
127890
127891function isDecCode(c) {
127892 return ((0x30/* 0 */ <= c) && (c <= 0x39/* 9 */));
127893}
127894
127895function resolveYamlInteger(data) {
127896 if (data === null) return false;
127897
127898 var max = data.length,
127899 index = 0,
127900 hasDigits = false,
127901 ch;
127902
127903 if (!max) return false;
127904
127905 ch = data[index];
127906
127907 // sign
127908 if (ch === '-' || ch === '+') {
127909 ch = data[++index];
127910 }
127911
127912 if (ch === '0') {
127913 // 0
127914 if (index + 1 === max) return true;
127915 ch = data[++index];
127916
127917 // base 2, base 8, base 16
127918
127919 if (ch === 'b') {
127920 // base 2
127921 index++;
127922
127923 for (; index < max; index++) {
127924 ch = data[index];
127925 if (ch === '_') continue;
127926 if (ch !== '0' && ch !== '1') return false;
127927 hasDigits = true;
127928 }
127929 return hasDigits && ch !== '_';
127930 }
127931
127932
127933 if (ch === 'x') {
127934 // base 16
127935 index++;
127936
127937 for (; index < max; index++) {
127938 ch = data[index];
127939 if (ch === '_') continue;
127940 if (!isHexCode(data.charCodeAt(index))) return false;
127941 hasDigits = true;
127942 }
127943 return hasDigits && ch !== '_';
127944 }
127945
127946 // base 8
127947 for (; index < max; index++) {
127948 ch = data[index];
127949 if (ch === '_') continue;
127950 if (!isOctCode(data.charCodeAt(index))) return false;
127951 hasDigits = true;
127952 }
127953 return hasDigits && ch !== '_';
127954 }
127955
127956 // base 10 (except 0) or base 60
127957
127958 // value should not start with `_`;
127959 if (ch === '_') return false;
127960
127961 for (; index < max; index++) {
127962 ch = data[index];
127963 if (ch === '_') continue;
127964 if (ch === ':') break;
127965 if (!isDecCode(data.charCodeAt(index))) {
127966 return false;
127967 }
127968 hasDigits = true;
127969 }
127970
127971 // Should have digits and should not end with `_`
127972 if (!hasDigits || ch === '_') return false;
127973
127974 // if !base60 - done;
127975 if (ch !== ':') return true;
127976
127977 // base60 almost not used, no needs to optimize
127978 return /^(:[0-5]?[0-9])+$/.test(data.slice(index));
127979}
127980
127981function constructYamlInteger(data) {
127982 var value = data, sign = 1, ch, base, digits = [];
127983
127984 if (value.indexOf('_') !== -1) {
127985 value = value.replace(/_/g, '');
127986 }
127987
127988 ch = value[0];
127989
127990 if (ch === '-' || ch === '+') {
127991 if (ch === '-') sign = -1;
127992 value = value.slice(1);
127993 ch = value[0];
127994 }
127995
127996 if (value === '0') return 0;
127997
127998 if (ch === '0') {
127999 if (value[1] === 'b') return sign * parseInt(value.slice(2), 2);
128000 if (value[1] === 'x') return sign * parseInt(value, 16);
128001 return sign * parseInt(value, 8);
128002 }
128003
128004 if (value.indexOf(':') !== -1) {
128005 value.split(':').forEach(function (v) {
128006 digits.unshift(parseInt(v, 10));
128007 });
128008
128009 value = 0;
128010 base = 1;
128011
128012 digits.forEach(function (d) {
128013 value += (d * base);
128014 base *= 60;
128015 });
128016
128017 return sign * value;
128018
128019 }
128020
128021 return sign * parseInt(value, 10);
128022}
128023
128024function isInteger(object) {
128025 return (Object.prototype.toString.call(object)) === '[object Number]' &&
128026 (object % 1 === 0 && !common.isNegativeZero(object));
128027}
128028
128029module.exports = new Type('tag:yaml.org,2002:int', {
128030 kind: 'scalar',
128031 resolve: resolveYamlInteger,
128032 construct: constructYamlInteger,
128033 predicate: isInteger,
128034 represent: {
128035 binary: function (obj) { return obj >= 0 ? '0b' + obj.toString(2) : '-0b' + obj.toString(2).slice(1); },
128036 octal: function (obj) { return obj >= 0 ? '0' + obj.toString(8) : '-0' + obj.toString(8).slice(1); },
128037 decimal: function (obj) { return obj.toString(10); },
128038 /* eslint-disable max-len */
128039 hexadecimal: function (obj) { return obj >= 0 ? '0x' + obj.toString(16).toUpperCase() : '-0x' + obj.toString(16).toUpperCase().slice(1); }
128040 },
128041 defaultStyle: 'decimal',
128042 styleAliases: {
128043 binary: [ 2, 'bin' ],
128044 octal: [ 8, 'oct' ],
128045 decimal: [ 10, 'dec' ],
128046 hexadecimal: [ 16, 'hex' ]
128047 }
128048});
128049
128050
128051/***/ }),
128052/* 803 */
128053/***/ (function(module, exports, __webpack_require__) {
128054
128055"use strict";
128056var require;
128057
128058var esprima;
128059
128060// Browserified version does not have esprima
128061//
128062// 1. For node.js just require module as deps
128063// 2. For browser try to require mudule via external AMD system.
128064// If not found - try to fallback to window.esprima. If not
128065// found too - then fail to parse.
128066//
128067try {
128068 // workaround to exclude package from browserify list.
128069 var _require = require;
128070 esprima = __webpack_require__(662);
128071} catch (_) {
128072 /*global window */
128073 if (typeof window !== 'undefined') esprima = window.esprima;
128074}
128075
128076var Type = __webpack_require__(30);
128077
128078function resolveJavascriptFunction(data) {
128079 if (data === null) return false;
128080
128081 try {
128082 var source = '(' + data + ')',
128083 ast = esprima.parse(source, { range: true });
128084
128085 if (ast.type !== 'Program' ||
128086 ast.body.length !== 1 ||
128087 ast.body[0].type !== 'ExpressionStatement' ||
128088 (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
128089 ast.body[0].expression.type !== 'FunctionExpression')) {
128090 return false;
128091 }
128092
128093 return true;
128094 } catch (err) {
128095 return false;
128096 }
128097}
128098
128099function constructJavascriptFunction(data) {
128100 /*jslint evil:true*/
128101
128102 var source = '(' + data + ')',
128103 ast = esprima.parse(source, { range: true }),
128104 params = [],
128105 body;
128106
128107 if (ast.type !== 'Program' ||
128108 ast.body.length !== 1 ||
128109 ast.body[0].type !== 'ExpressionStatement' ||
128110 (ast.body[0].expression.type !== 'ArrowFunctionExpression' &&
128111 ast.body[0].expression.type !== 'FunctionExpression')) {
128112 throw new Error('Failed to resolve function');
128113 }
128114
128115 ast.body[0].expression.params.forEach(function (param) {
128116 params.push(param.name);
128117 });
128118
128119 body = ast.body[0].expression.body.range;
128120
128121 // Esprima's ranges include the first '{' and the last '}' characters on
128122 // function expressions. So cut them out.
128123 if (ast.body[0].expression.body.type === 'BlockStatement') {
128124 /*eslint-disable no-new-func*/
128125 return new Function(params, source.slice(body[0] + 1, body[1] - 1));
128126 }
128127 // ES6 arrow functions can omit the BlockStatement. In that case, just return
128128 // the body.
128129 /*eslint-disable no-new-func*/
128130 return new Function(params, 'return ' + source.slice(body[0], body[1]));
128131}
128132
128133function representJavascriptFunction(object /*, style*/) {
128134 return object.toString();
128135}
128136
128137function isFunction(object) {
128138 return Object.prototype.toString.call(object) === '[object Function]';
128139}
128140
128141module.exports = new Type('tag:yaml.org,2002:js/function', {
128142 kind: 'scalar',
128143 resolve: resolveJavascriptFunction,
128144 construct: constructJavascriptFunction,
128145 predicate: isFunction,
128146 represent: representJavascriptFunction
128147});
128148
128149
128150/***/ }),
128151/* 804 */
128152/***/ (function(module, exports, __webpack_require__) {
128153
128154"use strict";
128155
128156
128157var Type = __webpack_require__(30);
128158
128159function resolveJavascriptRegExp(data) {
128160 if (data === null) return false;
128161 if (data.length === 0) return false;
128162
128163 var regexp = data,
128164 tail = /\/([gim]*)$/.exec(data),
128165 modifiers = '';
128166
128167 // if regexp starts with '/' it can have modifiers and must be properly closed
128168 // `/foo/gim` - modifiers tail can be maximum 3 chars
128169 if (regexp[0] === '/') {
128170 if (tail) modifiers = tail[1];
128171
128172 if (modifiers.length > 3) return false;
128173 // if expression starts with /, is should be properly terminated
128174 if (regexp[regexp.length - modifiers.length - 1] !== '/') return false;
128175 }
128176
128177 return true;
128178}
128179
128180function constructJavascriptRegExp(data) {
128181 var regexp = data,
128182 tail = /\/([gim]*)$/.exec(data),
128183 modifiers = '';
128184
128185 // `/foo/gim` - tail can be maximum 4 chars
128186 if (regexp[0] === '/') {
128187 if (tail) modifiers = tail[1];
128188 regexp = regexp.slice(1, regexp.length - modifiers.length - 1);
128189 }
128190
128191 return new RegExp(regexp, modifiers);
128192}
128193
128194function representJavascriptRegExp(object /*, style*/) {
128195 var result = '/' + object.source + '/';
128196
128197 if (object.global) result += 'g';
128198 if (object.multiline) result += 'm';
128199 if (object.ignoreCase) result += 'i';
128200
128201 return result;
128202}
128203
128204function isRegExp(object) {
128205 return Object.prototype.toString.call(object) === '[object RegExp]';
128206}
128207
128208module.exports = new Type('tag:yaml.org,2002:js/regexp', {
128209 kind: 'scalar',
128210 resolve: resolveJavascriptRegExp,
128211 construct: constructJavascriptRegExp,
128212 predicate: isRegExp,
128213 represent: representJavascriptRegExp
128214});
128215
128216
128217/***/ }),
128218/* 805 */
128219/***/ (function(module, exports, __webpack_require__) {
128220
128221"use strict";
128222
128223
128224var Type = __webpack_require__(30);
128225
128226function resolveJavascriptUndefined() {
128227 return true;
128228}
128229
128230function constructJavascriptUndefined() {
128231 /*eslint-disable no-undefined*/
128232 return undefined;
128233}
128234
128235function representJavascriptUndefined() {
128236 return '';
128237}
128238
128239function isUndefined(object) {
128240 return typeof object === 'undefined';
128241}
128242
128243module.exports = new Type('tag:yaml.org,2002:js/undefined', {
128244 kind: 'scalar',
128245 resolve: resolveJavascriptUndefined,
128246 construct: constructJavascriptUndefined,
128247 predicate: isUndefined,
128248 represent: representJavascriptUndefined
128249});
128250
128251
128252/***/ }),
128253/* 806 */
128254/***/ (function(module, exports, __webpack_require__) {
128255
128256"use strict";
128257
128258
128259var Type = __webpack_require__(30);
128260
128261module.exports = new Type('tag:yaml.org,2002:map', {
128262 kind: 'mapping',
128263 construct: function (data) { return data !== null ? data : {}; }
128264});
128265
128266
128267/***/ }),
128268/* 807 */
128269/***/ (function(module, exports, __webpack_require__) {
128270
128271"use strict";
128272
128273
128274var Type = __webpack_require__(30);
128275
128276function resolveYamlMerge(data) {
128277 return data === '<<' || data === null;
128278}
128279
128280module.exports = new Type('tag:yaml.org,2002:merge', {
128281 kind: 'scalar',
128282 resolve: resolveYamlMerge
128283});
128284
128285
128286/***/ }),
128287/* 808 */
128288/***/ (function(module, exports, __webpack_require__) {
128289
128290"use strict";
128291
128292
128293var Type = __webpack_require__(30);
128294
128295function resolveYamlNull(data) {
128296 if (data === null) return true;
128297
128298 var max = data.length;
128299
128300 return (max === 1 && data === '~') ||
128301 (max === 4 && (data === 'null' || data === 'Null' || data === 'NULL'));
128302}
128303
128304function constructYamlNull() {
128305 return null;
128306}
128307
128308function isNull(object) {
128309 return object === null;
128310}
128311
128312module.exports = new Type('tag:yaml.org,2002:null', {
128313 kind: 'scalar',
128314 resolve: resolveYamlNull,
128315 construct: constructYamlNull,
128316 predicate: isNull,
128317 represent: {
128318 canonical: function () { return '~'; },
128319 lowercase: function () { return 'null'; },
128320 uppercase: function () { return 'NULL'; },
128321 camelcase: function () { return 'Null'; }
128322 },
128323 defaultStyle: 'lowercase'
128324});
128325
128326
128327/***/ }),
128328/* 809 */
128329/***/ (function(module, exports, __webpack_require__) {
128330
128331"use strict";
128332
128333
128334var Type = __webpack_require__(30);
128335
128336var _hasOwnProperty = Object.prototype.hasOwnProperty;
128337var _toString = Object.prototype.toString;
128338
128339function resolveYamlOmap(data) {
128340 if (data === null) return true;
128341
128342 var objectKeys = [], index, length, pair, pairKey, pairHasKey,
128343 object = data;
128344
128345 for (index = 0, length = object.length; index < length; index += 1) {
128346 pair = object[index];
128347 pairHasKey = false;
128348
128349 if (_toString.call(pair) !== '[object Object]') return false;
128350
128351 for (pairKey in pair) {
128352 if (_hasOwnProperty.call(pair, pairKey)) {
128353 if (!pairHasKey) pairHasKey = true;
128354 else return false;
128355 }
128356 }
128357
128358 if (!pairHasKey) return false;
128359
128360 if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
128361 else return false;
128362 }
128363
128364 return true;
128365}
128366
128367function constructYamlOmap(data) {
128368 return data !== null ? data : [];
128369}
128370
128371module.exports = new Type('tag:yaml.org,2002:omap', {
128372 kind: 'sequence',
128373 resolve: resolveYamlOmap,
128374 construct: constructYamlOmap
128375});
128376
128377
128378/***/ }),
128379/* 810 */
128380/***/ (function(module, exports, __webpack_require__) {
128381
128382"use strict";
128383
128384
128385var Type = __webpack_require__(30);
128386
128387var _toString = Object.prototype.toString;
128388
128389function resolveYamlPairs(data) {
128390 if (data === null) return true;
128391
128392 var index, length, pair, keys, result,
128393 object = data;
128394
128395 result = new Array(object.length);
128396
128397 for (index = 0, length = object.length; index < length; index += 1) {
128398 pair = object[index];
128399
128400 if (_toString.call(pair) !== '[object Object]') return false;
128401
128402 keys = Object.keys(pair);
128403
128404 if (keys.length !== 1) return false;
128405
128406 result[index] = [ keys[0], pair[keys[0]] ];
128407 }
128408
128409 return true;
128410}
128411
128412function constructYamlPairs(data) {
128413 if (data === null) return [];
128414
128415 var index, length, pair, keys, result,
128416 object = data;
128417
128418 result = new Array(object.length);
128419
128420 for (index = 0, length = object.length; index < length; index += 1) {
128421 pair = object[index];
128422
128423 keys = Object.keys(pair);
128424
128425 result[index] = [ keys[0], pair[keys[0]] ];
128426 }
128427
128428 return result;
128429}
128430
128431module.exports = new Type('tag:yaml.org,2002:pairs', {
128432 kind: 'sequence',
128433 resolve: resolveYamlPairs,
128434 construct: constructYamlPairs
128435});
128436
128437
128438/***/ }),
128439/* 811 */
128440/***/ (function(module, exports, __webpack_require__) {
128441
128442"use strict";
128443
128444
128445var Type = __webpack_require__(30);
128446
128447module.exports = new Type('tag:yaml.org,2002:seq', {
128448 kind: 'sequence',
128449 construct: function (data) { return data !== null ? data : []; }
128450});
128451
128452
128453/***/ }),
128454/* 812 */
128455/***/ (function(module, exports, __webpack_require__) {
128456
128457"use strict";
128458
128459
128460var Type = __webpack_require__(30);
128461
128462var _hasOwnProperty = Object.prototype.hasOwnProperty;
128463
128464function resolveYamlSet(data) {
128465 if (data === null) return true;
128466
128467 var key, object = data;
128468
128469 for (key in object) {
128470 if (_hasOwnProperty.call(object, key)) {
128471 if (object[key] !== null) return false;
128472 }
128473 }
128474
128475 return true;
128476}
128477
128478function constructYamlSet(data) {
128479 return data !== null ? data : {};
128480}
128481
128482module.exports = new Type('tag:yaml.org,2002:set', {
128483 kind: 'mapping',
128484 resolve: resolveYamlSet,
128485 construct: constructYamlSet
128486});
128487
128488
128489/***/ }),
128490/* 813 */
128491/***/ (function(module, exports, __webpack_require__) {
128492
128493"use strict";
128494
128495
128496var Type = __webpack_require__(30);
128497
128498module.exports = new Type('tag:yaml.org,2002:str', {
128499 kind: 'scalar',
128500 construct: function (data) { return data !== null ? data : ''; }
128501});
128502
128503
128504/***/ }),
128505/* 814 */
128506/***/ (function(module, exports, __webpack_require__) {
128507
128508"use strict";
128509
128510
128511var Type = __webpack_require__(30);
128512
128513var YAML_DATE_REGEXP = new RegExp(
128514 '^([0-9][0-9][0-9][0-9])' + // [1] year
128515 '-([0-9][0-9])' + // [2] month
128516 '-([0-9][0-9])$'); // [3] day
128517
128518var YAML_TIMESTAMP_REGEXP = new RegExp(
128519 '^([0-9][0-9][0-9][0-9])' + // [1] year
128520 '-([0-9][0-9]?)' + // [2] month
128521 '-([0-9][0-9]?)' + // [3] day
128522 '(?:[Tt]|[ \\t]+)' + // ...
128523 '([0-9][0-9]?)' + // [4] hour
128524 ':([0-9][0-9])' + // [5] minute
128525 ':([0-9][0-9])' + // [6] second
128526 '(?:\\.([0-9]*))?' + // [7] fraction
128527 '(?:[ \\t]*(Z|([-+])([0-9][0-9]?)' + // [8] tz [9] tz_sign [10] tz_hour
128528 '(?::([0-9][0-9]))?))?$'); // [11] tz_minute
128529
128530function resolveYamlTimestamp(data) {
128531 if (data === null) return false;
128532 if (YAML_DATE_REGEXP.exec(data) !== null) return true;
128533 if (YAML_TIMESTAMP_REGEXP.exec(data) !== null) return true;
128534 return false;
128535}
128536
128537function constructYamlTimestamp(data) {
128538 var match, year, month, day, hour, minute, second, fraction = 0,
128539 delta = null, tz_hour, tz_minute, date;
128540
128541 match = YAML_DATE_REGEXP.exec(data);
128542 if (match === null) match = YAML_TIMESTAMP_REGEXP.exec(data);
128543
128544 if (match === null) throw new Error('Date resolve error');
128545
128546 // match: [1] year [2] month [3] day
128547
128548 year = +(match[1]);
128549 month = +(match[2]) - 1; // JS month starts with 0
128550 day = +(match[3]);
128551
128552 if (!match[4]) { // no hour
128553 return new Date(Date.UTC(year, month, day));
128554 }
128555
128556 // match: [4] hour [5] minute [6] second [7] fraction
128557
128558 hour = +(match[4]);
128559 minute = +(match[5]);
128560 second = +(match[6]);
128561
128562 if (match[7]) {
128563 fraction = match[7].slice(0, 3);
128564 while (fraction.length < 3) { // milli-seconds
128565 fraction += '0';
128566 }
128567 fraction = +fraction;
128568 }
128569
128570 // match: [8] tz [9] tz_sign [10] tz_hour [11] tz_minute
128571
128572 if (match[9]) {
128573 tz_hour = +(match[10]);
128574 tz_minute = +(match[11] || 0);
128575 delta = (tz_hour * 60 + tz_minute) * 60000; // delta in mili-seconds
128576 if (match[9] === '-') delta = -delta;
128577 }
128578
128579 date = new Date(Date.UTC(year, month, day, hour, minute, second, fraction));
128580
128581 if (delta) date.setTime(date.getTime() - delta);
128582
128583 return date;
128584}
128585
128586function representYamlTimestamp(object /*, style*/) {
128587 return object.toISOString();
128588}
128589
128590module.exports = new Type('tag:yaml.org,2002:timestamp', {
128591 kind: 'scalar',
128592 resolve: resolveYamlTimestamp,
128593 construct: constructYamlTimestamp,
128594 instanceOf: Date,
128595 represent: representYamlTimestamp
128596});
128597
128598
128599/***/ }),
128600/* 815 */
128601/***/ (function(module, exports, __webpack_require__) {
128602
128603var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/**
128604 * JSONSchema Validator - Validates JavaScript objects using JSON Schemas
128605 * (http://www.json.com/json-schema-proposal/)
128606 *
128607 * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com)
128608 * Licensed under the MIT (MIT-LICENSE.txt) license.
128609To use the validator call the validate function with an instance object and an optional schema object.
128610If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
128611that schema will be used to validate and the schema parameter is not necessary (if both exist,
128612both validations will occur).
128613The validate method will return an array of validation errors. If there are no errors, then an
128614empty list will be returned. A validation error will have two properties:
128615"property" which indicates which property had the error
128616"message" which indicates what the error was
128617 */
128618(function (root, factory) {
128619 if (true) {
128620 // AMD. Register as an anonymous module.
128621 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
128622 return factory();
128623 }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__),
128624 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
128625 } else if (typeof module === 'object' && module.exports) {
128626 // Node. Does not work with strict CommonJS, but
128627 // only CommonJS-like environments that support module.exports,
128628 // like Node.
128629 module.exports = factory();
128630 } else {
128631 // Browser globals
128632 root.jsonSchema = factory();
128633 }
128634}(this, function () {// setup primitive classes to be JSON Schema types
128635var exports = validate
128636exports.Integer = {type:"integer"};
128637var primitiveConstructors = {
128638 String: String,
128639 Boolean: Boolean,
128640 Number: Number,
128641 Object: Object,
128642 Array: Array,
128643 Date: Date
128644}
128645exports.validate = validate;
128646function validate(/*Any*/instance,/*Object*/schema) {
128647 // Summary:
128648 // To use the validator call JSONSchema.validate with an instance object and an optional schema object.
128649 // If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
128650 // that schema will be used to validate and the schema parameter is not necessary (if both exist,
128651 // both validations will occur).
128652 // The validate method will return an object with two properties:
128653 // valid: A boolean indicating if the instance is valid by the schema
128654 // errors: An array of validation errors. If there are no errors, then an
128655 // empty list will be returned. A validation error will have two properties:
128656 // property: which indicates which property had the error
128657 // message: which indicates what the error was
128658 //
128659 return validate(instance, schema, {changing: false});//, coerce: false, existingOnly: false});
128660 };
128661exports.checkPropertyChange = function(/*Any*/value,/*Object*/schema, /*String*/property) {
128662 // Summary:
128663 // The checkPropertyChange method will check to see if an value can legally be in property with the given schema
128664 // This is slightly different than the validate method in that it will fail if the schema is readonly and it will
128665 // not check for self-validation, it is assumed that the passed in value is already internally valid.
128666 // The checkPropertyChange method will return the same object type as validate, see JSONSchema.validate for
128667 // information.
128668 //
128669 return validate(value, schema, {changing: property || "property"});
128670 };
128671var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*Object*/options) {
128672
128673 if (!options) options = {};
128674 var _changing = options.changing;
128675
128676 function getType(schema){
128677 return schema.type || (primitiveConstructors[schema.name] == schema && schema.name.toLowerCase());
128678 }
128679 var errors = [];
128680 // validate a value against a property definition
128681 function checkProp(value, schema, path,i){
128682
128683 var l;
128684 path += path ? typeof i == 'number' ? '[' + i + ']' : typeof i == 'undefined' ? '' : '.' + i : i;
128685 function addError(message){
128686 errors.push({property:path,message:message});
128687 }
128688
128689 if((typeof schema != 'object' || schema instanceof Array) && (path || typeof schema != 'function') && !(schema && getType(schema))){
128690 if(typeof schema == 'function'){
128691 if(!(value instanceof schema)){
128692 addError("is not an instance of the class/constructor " + schema.name);
128693 }
128694 }else if(schema){
128695 addError("Invalid schema/property definition " + schema);
128696 }
128697 return null;
128698 }
128699 if(_changing && schema.readonly){
128700 addError("is a readonly field, it can not be changed");
128701 }
128702 if(schema['extends']){ // if it extends another schema, it must pass that schema as well
128703 checkProp(value,schema['extends'],path,i);
128704 }
128705 // validate a value against a type definition
128706 function checkType(type,value){
128707 if(type){
128708 if(typeof type == 'string' && type != 'any' &&
128709 (type == 'null' ? value !== null : typeof value != type) &&
128710 !(value instanceof Array && type == 'array') &&
128711 !(value instanceof Date && type == 'date') &&
128712 !(type == 'integer' && value%1===0)){
128713 return [{property:path,message:(typeof value) + " value found, but a " + type + " is required"}];
128714 }
128715 if(type instanceof Array){
128716 var unionErrors=[];
128717 for(var j = 0; j < type.length; j++){ // a union type
128718 if(!(unionErrors=checkType(type[j],value)).length){
128719 break;
128720 }
128721 }
128722 if(unionErrors.length){
128723 return unionErrors;
128724 }
128725 }else if(typeof type == 'object'){
128726 var priorErrors = errors;
128727 errors = [];
128728 checkProp(value,type,path);
128729 var theseErrors = errors;
128730 errors = priorErrors;
128731 return theseErrors;
128732 }
128733 }
128734 return [];
128735 }
128736 if(value === undefined){
128737 if(schema.required){
128738 addError("is missing and it is required");
128739 }
128740 }else{
128741 errors = errors.concat(checkType(getType(schema),value));
128742 if(schema.disallow && !checkType(schema.disallow,value).length){
128743 addError(" disallowed value was matched");
128744 }
128745 if(value !== null){
128746 if(value instanceof Array){
128747 if(schema.items){
128748 var itemsIsArray = schema.items instanceof Array;
128749 var propDef = schema.items;
128750 for (i = 0, l = value.length; i < l; i += 1) {
128751 if (itemsIsArray)
128752 propDef = schema.items[i];
128753 if (options.coerce)
128754 value[i] = options.coerce(value[i], propDef);
128755 errors.concat(checkProp(value[i],propDef,path,i));
128756 }
128757 }
128758 if(schema.minItems && value.length < schema.minItems){
128759 addError("There must be a minimum of " + schema.minItems + " in the array");
128760 }
128761 if(schema.maxItems && value.length > schema.maxItems){
128762 addError("There must be a maximum of " + schema.maxItems + " in the array");
128763 }
128764 }else if(schema.properties || schema.additionalProperties){
128765 errors.concat(checkObj(value, schema.properties, path, schema.additionalProperties));
128766 }
128767 if(schema.pattern && typeof value == 'string' && !value.match(schema.pattern)){
128768 addError("does not match the regex pattern " + schema.pattern);
128769 }
128770 if(schema.maxLength && typeof value == 'string' && value.length > schema.maxLength){
128771 addError("may only be " + schema.maxLength + " characters long");
128772 }
128773 if(schema.minLength && typeof value == 'string' && value.length < schema.minLength){
128774 addError("must be at least " + schema.minLength + " characters long");
128775 }
128776 if(typeof schema.minimum !== undefined && typeof value == typeof schema.minimum &&
128777 schema.minimum > value){
128778 addError("must have a minimum value of " + schema.minimum);
128779 }
128780 if(typeof schema.maximum !== undefined && typeof value == typeof schema.maximum &&
128781 schema.maximum < value){
128782 addError("must have a maximum value of " + schema.maximum);
128783 }
128784 if(schema['enum']){
128785 var enumer = schema['enum'];
128786 l = enumer.length;
128787 var found;
128788 for(var j = 0; j < l; j++){
128789 if(enumer[j]===value){
128790 found=1;
128791 break;
128792 }
128793 }
128794 if(!found){
128795 addError("does not have a value in the enumeration " + enumer.join(", "));
128796 }
128797 }
128798 if(typeof schema.maxDecimal == 'number' &&
128799 (value.toString().match(new RegExp("\\.[0-9]{" + (schema.maxDecimal + 1) + ",}")))){
128800 addError("may only have " + schema.maxDecimal + " digits of decimal places");
128801 }
128802 }
128803 }
128804 return null;
128805 }
128806 // validate an object against a schema
128807 function checkObj(instance,objTypeDef,path,additionalProp){
128808
128809 if(typeof objTypeDef =='object'){
128810 if(typeof instance != 'object' || instance instanceof Array){
128811 errors.push({property:path,message:"an object is required"});
128812 }
128813
128814 for(var i in objTypeDef){
128815 if(objTypeDef.hasOwnProperty(i)){
128816 var value = instance[i];
128817 // skip _not_ specified properties
128818 if (value === undefined && options.existingOnly) continue;
128819 var propDef = objTypeDef[i];
128820 // set default
128821 if(value === undefined && propDef["default"]){
128822 value = instance[i] = propDef["default"];
128823 }
128824 if(options.coerce && i in instance){
128825 value = instance[i] = options.coerce(value, propDef);
128826 }
128827 checkProp(value,propDef,path,i);
128828 }
128829 }
128830 }
128831 for(i in instance){
128832 if(instance.hasOwnProperty(i) && !(i.charAt(0) == '_' && i.charAt(1) == '_') && objTypeDef && !objTypeDef[i] && additionalProp===false){
128833 if (options.filter) {
128834 delete instance[i];
128835 continue;
128836 } else {
128837 errors.push({property:path,message:(typeof value) + "The property " + i +
128838 " is not defined in the schema and the schema does not allow additional properties"});
128839 }
128840 }
128841 var requires = objTypeDef && objTypeDef[i] && objTypeDef[i].requires;
128842 if(requires && !(requires in instance)){
128843 errors.push({property:path,message:"the presence of the property " + i + " requires that " + requires + " also be present"});
128844 }
128845 value = instance[i];
128846 if(additionalProp && (!(objTypeDef && typeof objTypeDef == 'object') || !(i in objTypeDef))){
128847 if(options.coerce){
128848 value = instance[i] = options.coerce(value, additionalProp);
128849 }
128850 checkProp(value,additionalProp,path,i);
128851 }
128852 if(!_changing && value && value.$schema){
128853 errors = errors.concat(checkProp(value,value.$schema,path,i));
128854 }
128855 }
128856 return errors;
128857 }
128858 if(schema){
128859 checkProp(instance,schema,'',_changing || '');
128860 }
128861 if(!_changing && instance && instance.$schema){
128862 checkProp(instance,instance.$schema,'','');
128863 }
128864 return {valid:!errors.length,errors:errors};
128865};
128866exports.mustBeValid = function(result){
128867 // summary:
128868 // This checks to ensure that the result is valid and will throw an appropriate error message if it is not
128869 // result: the result returned from checkPropertyChange or validate
128870 if(!result.valid){
128871 throw new TypeError(result.errors.map(function(error){return "for property " + error.property + ': ' + error.message;}).join(", \n"));
128872 }
128873}
128874
128875return exports;
128876}));
128877
128878
128879/***/ }),
128880/* 816 */
128881/***/ (function(module, exports) {
128882
128883exports = module.exports = stringify
128884exports.getSerialize = serializer
128885
128886function stringify(obj, replacer, spaces, cycleReplacer) {
128887 return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces)
128888}
128889
128890function serializer(replacer, cycleReplacer) {
128891 var stack = [], keys = []
128892
128893 if (cycleReplacer == null) cycleReplacer = function(key, value) {
128894 if (stack[0] === value) return "[Circular ~]"
128895 return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"
128896 }
128897
128898 return function(key, value) {
128899 if (stack.length > 0) {
128900 var thisPos = stack.indexOf(this)
128901 ~thisPos ? stack.splice(thisPos + 1) : stack.push(this)
128902 ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key)
128903 if (~stack.indexOf(value)) value = cycleReplacer.call(this, key, value)
128904 }
128905 else stack.push(value)
128906
128907 return replacer == null ? value : replacer.call(this, key, value)
128908 }
128909}
128910
128911
128912/***/ }),
128913/* 817 */
128914/***/ (function(module, exports, __webpack_require__) {
128915
128916/*
128917 * lib/jsprim.js: utilities for primitive JavaScript types
128918 */
128919
128920var mod_assert = __webpack_require__(22);
128921var mod_util = __webpack_require__(9);
128922
128923var mod_extsprintf = __webpack_require__(669);
128924var mod_verror = __webpack_require__(1033);
128925var mod_jsonschema = __webpack_require__(815);
128926
128927/*
128928 * Public interface
128929 */
128930exports.deepCopy = deepCopy;
128931exports.deepEqual = deepEqual;
128932exports.isEmpty = isEmpty;
128933exports.hasKey = hasKey;
128934exports.forEachKey = forEachKey;
128935exports.pluck = pluck;
128936exports.flattenObject = flattenObject;
128937exports.flattenIter = flattenIter;
128938exports.validateJsonObject = validateJsonObjectJS;
128939exports.validateJsonObjectJS = validateJsonObjectJS;
128940exports.randElt = randElt;
128941exports.extraProperties = extraProperties;
128942exports.mergeObjects = mergeObjects;
128943
128944exports.startsWith = startsWith;
128945exports.endsWith = endsWith;
128946
128947exports.parseInteger = parseInteger;
128948
128949exports.iso8601 = iso8601;
128950exports.rfc1123 = rfc1123;
128951exports.parseDateTime = parseDateTime;
128952
128953exports.hrtimediff = hrtimeDiff;
128954exports.hrtimeDiff = hrtimeDiff;
128955exports.hrtimeAccum = hrtimeAccum;
128956exports.hrtimeAdd = hrtimeAdd;
128957exports.hrtimeNanosec = hrtimeNanosec;
128958exports.hrtimeMicrosec = hrtimeMicrosec;
128959exports.hrtimeMillisec = hrtimeMillisec;
128960
128961
128962/*
128963 * Deep copy an acyclic *basic* Javascript object. This only handles basic
128964 * scalars (strings, numbers, booleans) and arbitrarily deep arrays and objects
128965 * containing these. This does *not* handle instances of other classes.
128966 */
128967function deepCopy(obj)
128968{
128969 var ret, key;
128970 var marker = '__deepCopy';
128971
128972 if (obj && obj[marker])
128973 throw (new Error('attempted deep copy of cyclic object'));
128974
128975 if (obj && obj.constructor == Object) {
128976 ret = {};
128977 obj[marker] = true;
128978
128979 for (key in obj) {
128980 if (key == marker)
128981 continue;
128982
128983 ret[key] = deepCopy(obj[key]);
128984 }
128985
128986 delete (obj[marker]);
128987 return (ret);
128988 }
128989
128990 if (obj && obj.constructor == Array) {
128991 ret = [];
128992 obj[marker] = true;
128993
128994 for (key = 0; key < obj.length; key++)
128995 ret.push(deepCopy(obj[key]));
128996
128997 delete (obj[marker]);
128998 return (ret);
128999 }
129000
129001 /*
129002 * It must be a primitive type -- just return it.
129003 */
129004 return (obj);
129005}
129006
129007function deepEqual(obj1, obj2)
129008{
129009 if (typeof (obj1) != typeof (obj2))
129010 return (false);
129011
129012 if (obj1 === null || obj2 === null || typeof (obj1) != 'object')
129013 return (obj1 === obj2);
129014
129015 if (obj1.constructor != obj2.constructor)
129016 return (false);
129017
129018 var k;
129019 for (k in obj1) {
129020 if (!obj2.hasOwnProperty(k))
129021 return (false);
129022
129023 if (!deepEqual(obj1[k], obj2[k]))
129024 return (false);
129025 }
129026
129027 for (k in obj2) {
129028 if (!obj1.hasOwnProperty(k))
129029 return (false);
129030 }
129031
129032 return (true);
129033}
129034
129035function isEmpty(obj)
129036{
129037 var key;
129038 for (key in obj)
129039 return (false);
129040 return (true);
129041}
129042
129043function hasKey(obj, key)
129044{
129045 mod_assert.equal(typeof (key), 'string');
129046 return (Object.prototype.hasOwnProperty.call(obj, key));
129047}
129048
129049function forEachKey(obj, callback)
129050{
129051 for (var key in obj) {
129052 if (hasKey(obj, key)) {
129053 callback(key, obj[key]);
129054 }
129055 }
129056}
129057
129058function pluck(obj, key)
129059{
129060 mod_assert.equal(typeof (key), 'string');
129061 return (pluckv(obj, key));
129062}
129063
129064function pluckv(obj, key)
129065{
129066 if (obj === null || typeof (obj) !== 'object')
129067 return (undefined);
129068
129069 if (obj.hasOwnProperty(key))
129070 return (obj[key]);
129071
129072 var i = key.indexOf('.');
129073 if (i == -1)
129074 return (undefined);
129075
129076 var key1 = key.substr(0, i);
129077 if (!obj.hasOwnProperty(key1))
129078 return (undefined);
129079
129080 return (pluckv(obj[key1], key.substr(i + 1)));
129081}
129082
129083/*
129084 * Invoke callback(row) for each entry in the array that would be returned by
129085 * flattenObject(data, depth). This is just like flattenObject(data,
129086 * depth).forEach(callback), except that the intermediate array is never
129087 * created.
129088 */
129089function flattenIter(data, depth, callback)
129090{
129091 doFlattenIter(data, depth, [], callback);
129092}
129093
129094function doFlattenIter(data, depth, accum, callback)
129095{
129096 var each;
129097 var key;
129098
129099 if (depth === 0) {
129100 each = accum.slice(0);
129101 each.push(data);
129102 callback(each);
129103 return;
129104 }
129105
129106 mod_assert.ok(data !== null);
129107 mod_assert.equal(typeof (data), 'object');
129108 mod_assert.equal(typeof (depth), 'number');
129109 mod_assert.ok(depth >= 0);
129110
129111 for (key in data) {
129112 each = accum.slice(0);
129113 each.push(key);
129114 doFlattenIter(data[key], depth - 1, each, callback);
129115 }
129116}
129117
129118function flattenObject(data, depth)
129119{
129120 if (depth === 0)
129121 return ([ data ]);
129122
129123 mod_assert.ok(data !== null);
129124 mod_assert.equal(typeof (data), 'object');
129125 mod_assert.equal(typeof (depth), 'number');
129126 mod_assert.ok(depth >= 0);
129127
129128 var rv = [];
129129 var key;
129130
129131 for (key in data) {
129132 flattenObject(data[key], depth - 1).forEach(function (p) {
129133 rv.push([ key ].concat(p));
129134 });
129135 }
129136
129137 return (rv);
129138}
129139
129140function startsWith(str, prefix)
129141{
129142 return (str.substr(0, prefix.length) == prefix);
129143}
129144
129145function endsWith(str, suffix)
129146{
129147 return (str.substr(
129148 str.length - suffix.length, suffix.length) == suffix);
129149}
129150
129151function iso8601(d)
129152{
129153 if (typeof (d) == 'number')
129154 d = new Date(d);
129155 mod_assert.ok(d.constructor === Date);
129156 return (mod_extsprintf.sprintf('%4d-%02d-%02dT%02d:%02d:%02d.%03dZ',
129157 d.getUTCFullYear(), d.getUTCMonth() + 1, d.getUTCDate(),
129158 d.getUTCHours(), d.getUTCMinutes(), d.getUTCSeconds(),
129159 d.getUTCMilliseconds()));
129160}
129161
129162var RFC1123_MONTHS = [
129163 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
129164 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
129165var RFC1123_DAYS = [
129166 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
129167
129168function rfc1123(date) {
129169 return (mod_extsprintf.sprintf('%s, %02d %s %04d %02d:%02d:%02d GMT',
129170 RFC1123_DAYS[date.getUTCDay()], date.getUTCDate(),
129171 RFC1123_MONTHS[date.getUTCMonth()], date.getUTCFullYear(),
129172 date.getUTCHours(), date.getUTCMinutes(),
129173 date.getUTCSeconds()));
129174}
129175
129176/*
129177 * Parses a date expressed as a string, as either a number of milliseconds since
129178 * the epoch or any string format that Date accepts, giving preference to the
129179 * former where these two sets overlap (e.g., small numbers).
129180 */
129181function parseDateTime(str)
129182{
129183 /*
129184 * This is irritatingly implicit, but significantly more concise than
129185 * alternatives. The "+str" will convert a string containing only a
129186 * number directly to a Number, or NaN for other strings. Thus, if the
129187 * conversion succeeds, we use it (this is the milliseconds-since-epoch
129188 * case). Otherwise, we pass the string directly to the Date
129189 * constructor to parse.
129190 */
129191 var numeric = +str;
129192 if (!isNaN(numeric)) {
129193 return (new Date(numeric));
129194 } else {
129195 return (new Date(str));
129196 }
129197}
129198
129199
129200/*
129201 * Number.*_SAFE_INTEGER isn't present before node v0.12, so we hardcode
129202 * the ES6 definitions here, while allowing for them to someday be higher.
129203 */
129204var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
129205var MIN_SAFE_INTEGER = Number.MIN_SAFE_INTEGER || -9007199254740991;
129206
129207
129208/*
129209 * Default options for parseInteger().
129210 */
129211var PI_DEFAULTS = {
129212 base: 10,
129213 allowSign: true,
129214 allowPrefix: false,
129215 allowTrailing: false,
129216 allowImprecise: false,
129217 trimWhitespace: false,
129218 leadingZeroIsOctal: false
129219};
129220
129221var CP_0 = 0x30;
129222var CP_9 = 0x39;
129223
129224var CP_A = 0x41;
129225var CP_B = 0x42;
129226var CP_O = 0x4f;
129227var CP_T = 0x54;
129228var CP_X = 0x58;
129229var CP_Z = 0x5a;
129230
129231var CP_a = 0x61;
129232var CP_b = 0x62;
129233var CP_o = 0x6f;
129234var CP_t = 0x74;
129235var CP_x = 0x78;
129236var CP_z = 0x7a;
129237
129238var PI_CONV_DEC = 0x30;
129239var PI_CONV_UC = 0x37;
129240var PI_CONV_LC = 0x57;
129241
129242
129243/*
129244 * A stricter version of parseInt() that provides options for changing what
129245 * is an acceptable string (for example, disallowing trailing characters).
129246 */
129247function parseInteger(str, uopts)
129248{
129249 mod_assert.string(str, 'str');
129250 mod_assert.optionalObject(uopts, 'options');
129251
129252 var baseOverride = false;
129253 var options = PI_DEFAULTS;
129254
129255 if (uopts) {
129256 baseOverride = hasKey(uopts, 'base');
129257 options = mergeObjects(options, uopts);
129258 mod_assert.number(options.base, 'options.base');
129259 mod_assert.ok(options.base >= 2, 'options.base >= 2');
129260 mod_assert.ok(options.base <= 36, 'options.base <= 36');
129261 mod_assert.bool(options.allowSign, 'options.allowSign');
129262 mod_assert.bool(options.allowPrefix, 'options.allowPrefix');
129263 mod_assert.bool(options.allowTrailing,
129264 'options.allowTrailing');
129265 mod_assert.bool(options.allowImprecise,
129266 'options.allowImprecise');
129267 mod_assert.bool(options.trimWhitespace,
129268 'options.trimWhitespace');
129269 mod_assert.bool(options.leadingZeroIsOctal,
129270 'options.leadingZeroIsOctal');
129271
129272 if (options.leadingZeroIsOctal) {
129273 mod_assert.ok(!baseOverride,
129274 '"base" and "leadingZeroIsOctal" are ' +
129275 'mutually exclusive');
129276 }
129277 }
129278
129279 var c;
129280 var pbase = -1;
129281 var base = options.base;
129282 var start;
129283 var mult = 1;
129284 var value = 0;
129285 var idx = 0;
129286 var len = str.length;
129287
129288 /* Trim any whitespace on the left side. */
129289 if (options.trimWhitespace) {
129290 while (idx < len && isSpace(str.charCodeAt(idx))) {
129291 ++idx;
129292 }
129293 }
129294
129295 /* Check the number for a leading sign. */
129296 if (options.allowSign) {
129297 if (str[idx] === '-') {
129298 idx += 1;
129299 mult = -1;
129300 } else if (str[idx] === '+') {
129301 idx += 1;
129302 }
129303 }
129304
129305 /* Parse the base-indicating prefix if there is one. */
129306 if (str[idx] === '0') {
129307 if (options.allowPrefix) {
129308 pbase = prefixToBase(str.charCodeAt(idx + 1));
129309 if (pbase !== -1 && (!baseOverride || pbase === base)) {
129310 base = pbase;
129311 idx += 2;
129312 }
129313 }
129314
129315 if (pbase === -1 && options.leadingZeroIsOctal) {
129316 base = 8;
129317 }
129318 }
129319
129320 /* Parse the actual digits. */
129321 for (start = idx; idx < len; ++idx) {
129322 c = translateDigit(str.charCodeAt(idx));
129323 if (c !== -1 && c < base) {
129324 value *= base;
129325 value += c;
129326 } else {
129327 break;
129328 }
129329 }
129330
129331 /* If we didn't parse any digits, we have an invalid number. */
129332 if (start === idx) {
129333 return (new Error('invalid number: ' + JSON.stringify(str)));
129334 }
129335
129336 /* Trim any whitespace on the right side. */
129337 if (options.trimWhitespace) {
129338 while (idx < len && isSpace(str.charCodeAt(idx))) {
129339 ++idx;
129340 }
129341 }
129342
129343 /* Check for trailing characters. */
129344 if (idx < len && !options.allowTrailing) {
129345 return (new Error('trailing characters after number: ' +
129346 JSON.stringify(str.slice(idx))));
129347 }
129348
129349 /* If our value is 0, we return now, to avoid returning -0. */
129350 if (value === 0) {
129351 return (0);
129352 }
129353
129354 /* Calculate our final value. */
129355 var result = value * mult;
129356
129357 /*
129358 * If the string represents a value that cannot be precisely represented
129359 * by JavaScript, then we want to check that:
129360 *
129361 * - We never increased the value past MAX_SAFE_INTEGER
129362 * - We don't make the result negative and below MIN_SAFE_INTEGER
129363 *
129364 * Because we only ever increment the value during parsing, there's no
129365 * chance of moving past MAX_SAFE_INTEGER and then dropping below it
129366 * again, losing precision in the process. This means that we only need
129367 * to do our checks here, at the end.
129368 */
129369 if (!options.allowImprecise &&
129370 (value > MAX_SAFE_INTEGER || result < MIN_SAFE_INTEGER)) {
129371 return (new Error('number is outside of the supported range: ' +
129372 JSON.stringify(str.slice(start, idx))));
129373 }
129374
129375 return (result);
129376}
129377
129378
129379/*
129380 * Interpret a character code as a base-36 digit.
129381 */
129382function translateDigit(d)
129383{
129384 if (d >= CP_0 && d <= CP_9) {
129385 /* '0' to '9' -> 0 to 9 */
129386 return (d - PI_CONV_DEC);
129387 } else if (d >= CP_A && d <= CP_Z) {
129388 /* 'A' - 'Z' -> 10 to 35 */
129389 return (d - PI_CONV_UC);
129390 } else if (d >= CP_a && d <= CP_z) {
129391 /* 'a' - 'z' -> 10 to 35 */
129392 return (d - PI_CONV_LC);
129393 } else {
129394 /* Invalid character code */
129395 return (-1);
129396 }
129397}
129398
129399
129400/*
129401 * Test if a value matches the ECMAScript definition of trimmable whitespace.
129402 */
129403function isSpace(c)
129404{
129405 return (c === 0x20) ||
129406 (c >= 0x0009 && c <= 0x000d) ||
129407 (c === 0x00a0) ||
129408 (c === 0x1680) ||
129409 (c === 0x180e) ||
129410 (c >= 0x2000 && c <= 0x200a) ||
129411 (c === 0x2028) ||
129412 (c === 0x2029) ||
129413 (c === 0x202f) ||
129414 (c === 0x205f) ||
129415 (c === 0x3000) ||
129416 (c === 0xfeff);
129417}
129418
129419
129420/*
129421 * Determine which base a character indicates (e.g., 'x' indicates hex).
129422 */
129423function prefixToBase(c)
129424{
129425 if (c === CP_b || c === CP_B) {
129426 /* 0b/0B (binary) */
129427 return (2);
129428 } else if (c === CP_o || c === CP_O) {
129429 /* 0o/0O (octal) */
129430 return (8);
129431 } else if (c === CP_t || c === CP_T) {
129432 /* 0t/0T (decimal) */
129433 return (10);
129434 } else if (c === CP_x || c === CP_X) {
129435 /* 0x/0X (hexadecimal) */
129436 return (16);
129437 } else {
129438 /* Not a meaningful character */
129439 return (-1);
129440 }
129441}
129442
129443
129444function validateJsonObjectJS(schema, input)
129445{
129446 var report = mod_jsonschema.validate(input, schema);
129447
129448 if (report.errors.length === 0)
129449 return (null);
129450
129451 /* Currently, we only do anything useful with the first error. */
129452 var error = report.errors[0];
129453
129454 /* The failed property is given by a URI with an irrelevant prefix. */
129455 var propname = error['property'];
129456 var reason = error['message'].toLowerCase();
129457 var i, j;
129458
129459 /*
129460 * There's at least one case where the property error message is
129461 * confusing at best. We work around this here.
129462 */
129463 if ((i = reason.indexOf('the property ')) != -1 &&
129464 (j = reason.indexOf(' is not defined in the schema and the ' +
129465 'schema does not allow additional properties')) != -1) {
129466 i += 'the property '.length;
129467 if (propname === '')
129468 propname = reason.substr(i, j - i);
129469 else
129470 propname = propname + '.' + reason.substr(i, j - i);
129471
129472 reason = 'unsupported property';
129473 }
129474
129475 var rv = new mod_verror.VError('property "%s": %s', propname, reason);
129476 rv.jsv_details = error;
129477 return (rv);
129478}
129479
129480function randElt(arr)
129481{
129482 mod_assert.ok(Array.isArray(arr) && arr.length > 0,
129483 'randElt argument must be a non-empty array');
129484
129485 return (arr[Math.floor(Math.random() * arr.length)]);
129486}
129487
129488function assertHrtime(a)
129489{
129490 mod_assert.ok(a[0] >= 0 && a[1] >= 0,
129491 'negative numbers not allowed in hrtimes');
129492 mod_assert.ok(a[1] < 1e9, 'nanoseconds column overflow');
129493}
129494
129495/*
129496 * Compute the time elapsed between hrtime readings A and B, where A is later
129497 * than B. hrtime readings come from Node's process.hrtime(). There is no
129498 * defined way to represent negative deltas, so it's illegal to diff B from A
129499 * where the time denoted by B is later than the time denoted by A. If this
129500 * becomes valuable, we can define a representation and extend the
129501 * implementation to support it.
129502 */
129503function hrtimeDiff(a, b)
129504{
129505 assertHrtime(a);
129506 assertHrtime(b);
129507 mod_assert.ok(a[0] > b[0] || (a[0] == b[0] && a[1] >= b[1]),
129508 'negative differences not allowed');
129509
129510 var rv = [ a[0] - b[0], 0 ];
129511
129512 if (a[1] >= b[1]) {
129513 rv[1] = a[1] - b[1];
129514 } else {
129515 rv[0]--;
129516 rv[1] = 1e9 - (b[1] - a[1]);
129517 }
129518
129519 return (rv);
129520}
129521
129522/*
129523 * Convert a hrtime reading from the array format returned by Node's
129524 * process.hrtime() into a scalar number of nanoseconds.
129525 */
129526function hrtimeNanosec(a)
129527{
129528 assertHrtime(a);
129529
129530 return (Math.floor(a[0] * 1e9 + a[1]));
129531}
129532
129533/*
129534 * Convert a hrtime reading from the array format returned by Node's
129535 * process.hrtime() into a scalar number of microseconds.
129536 */
129537function hrtimeMicrosec(a)
129538{
129539 assertHrtime(a);
129540
129541 return (Math.floor(a[0] * 1e6 + a[1] / 1e3));
129542}
129543
129544/*
129545 * Convert a hrtime reading from the array format returned by Node's
129546 * process.hrtime() into a scalar number of milliseconds.
129547 */
129548function hrtimeMillisec(a)
129549{
129550 assertHrtime(a);
129551
129552 return (Math.floor(a[0] * 1e3 + a[1] / 1e6));
129553}
129554
129555/*
129556 * Add two hrtime readings A and B, overwriting A with the result of the
129557 * addition. This function is useful for accumulating several hrtime intervals
129558 * into a counter. Returns A.
129559 */
129560function hrtimeAccum(a, b)
129561{
129562 assertHrtime(a);
129563 assertHrtime(b);
129564
129565 /*
129566 * Accumulate the nanosecond component.
129567 */
129568 a[1] += b[1];
129569 if (a[1] >= 1e9) {
129570 /*
129571 * The nanosecond component overflowed, so carry to the seconds
129572 * field.
129573 */
129574 a[0]++;
129575 a[1] -= 1e9;
129576 }
129577
129578 /*
129579 * Accumulate the seconds component.
129580 */
129581 a[0] += b[0];
129582
129583 return (a);
129584}
129585
129586/*
129587 * Add two hrtime readings A and B, returning the result as a new hrtime array.
129588 * Does not modify either input argument.
129589 */
129590function hrtimeAdd(a, b)
129591{
129592 assertHrtime(a);
129593
129594 var rv = [ a[0], a[1] ];
129595
129596 return (hrtimeAccum(rv, b));
129597}
129598
129599
129600/*
129601 * Check an object for unexpected properties. Accepts the object to check, and
129602 * an array of allowed property names (strings). Returns an array of key names
129603 * that were found on the object, but did not appear in the list of allowed
129604 * properties. If no properties were found, the returned array will be of
129605 * zero length.
129606 */
129607function extraProperties(obj, allowed)
129608{
129609 mod_assert.ok(typeof (obj) === 'object' && obj !== null,
129610 'obj argument must be a non-null object');
129611 mod_assert.ok(Array.isArray(allowed),
129612 'allowed argument must be an array of strings');
129613 for (var i = 0; i < allowed.length; i++) {
129614 mod_assert.ok(typeof (allowed[i]) === 'string',
129615 'allowed argument must be an array of strings');
129616 }
129617
129618 return (Object.keys(obj).filter(function (key) {
129619 return (allowed.indexOf(key) === -1);
129620 }));
129621}
129622
129623/*
129624 * Given three sets of properties "provided" (may be undefined), "overrides"
129625 * (required), and "defaults" (may be undefined), construct an object containing
129626 * the union of these sets with "overrides" overriding "provided", and
129627 * "provided" overriding "defaults". None of the input objects are modified.
129628 */
129629function mergeObjects(provided, overrides, defaults)
129630{
129631 var rv, k;
129632
129633 rv = {};
129634 if (defaults) {
129635 for (k in defaults)
129636 rv[k] = defaults[k];
129637 }
129638
129639 if (provided) {
129640 for (k in provided)
129641 rv[k] = provided[k];
129642 }
129643
129644 if (overrides) {
129645 for (k in overrides)
129646 rv[k] = overrides[k];
129647 }
129648
129649 return (rv);
129650}
129651
129652
129653/***/ }),
129654/* 818 */
129655/***/ (function(module, exports, __webpack_require__) {
129656
129657"use strict";
129658/* eslint-disable no-nested-ternary */
129659
129660var arr = [];
129661var charCodeCache = [];
129662
129663module.exports = function (a, b) {
129664 if (a === b) {
129665 return 0;
129666 }
129667
129668 var swap = a;
129669
129670 // Swapping the strings if `a` is longer than `b` so we know which one is the
129671 // shortest & which one is the longest
129672 if (a.length > b.length) {
129673 a = b;
129674 b = swap;
129675 }
129676
129677 var aLen = a.length;
129678 var bLen = b.length;
129679
129680 if (aLen === 0) {
129681 return bLen;
129682 }
129683
129684 if (bLen === 0) {
129685 return aLen;
129686 }
129687
129688 // Performing suffix trimming:
129689 // We can linearly drop suffix common to both strings since they
129690 // don't increase distance at all
129691 // Note: `~-` is the bitwise way to perform a `- 1` operation
129692 while (aLen > 0 && (a.charCodeAt(~-aLen) === b.charCodeAt(~-bLen))) {
129693 aLen--;
129694 bLen--;
129695 }
129696
129697 if (aLen === 0) {
129698 return bLen;
129699 }
129700
129701 // Performing prefix trimming
129702 // We can linearly drop prefix common to both strings since they
129703 // don't increase distance at all
129704 var start = 0;
129705
129706 while (start < aLen && (a.charCodeAt(start) === b.charCodeAt(start))) {
129707 start++;
129708 }
129709
129710 aLen -= start;
129711 bLen -= start;
129712
129713 if (aLen === 0) {
129714 return bLen;
129715 }
129716
129717 var bCharCode;
129718 var ret;
129719 var tmp;
129720 var tmp2;
129721 var i = 0;
129722 var j = 0;
129723
129724 while (i < aLen) {
129725 charCodeCache[start + i] = a.charCodeAt(start + i);
129726 arr[i] = ++i;
129727 }
129728
129729 while (j < bLen) {
129730 bCharCode = b.charCodeAt(start + j);
129731 tmp = j++;
129732 ret = j;
129733
129734 for (i = 0; i < aLen; i++) {
129735 tmp2 = bCharCode === charCodeCache[start + i] ? tmp : tmp + 1;
129736 tmp = arr[i];
129737 ret = arr[i] = tmp > ret ? tmp2 > ret ? ret + 1 : tmp2 : tmp2 > tmp ? tmp + 1 : tmp2;
129738 }
129739 }
129740
129741 return ret;
129742};
129743
129744
129745/***/ }),
129746/* 819 */
129747/***/ (function(module, exports, __webpack_require__) {
129748
129749/* WEBPACK VAR INJECTION */(function(module) {/**
129750 * lodash (Custom Build) <https://lodash.com/>
129751 * Build: `lodash modularize exports="npm" -o ./`
129752 * Copyright jQuery Foundation and other contributors <https://jquery.org/>
129753 * Released under MIT license <https://lodash.com/license>
129754 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
129755 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
129756 */
129757
129758/** Used as the size to enable large array optimizations. */
129759var LARGE_ARRAY_SIZE = 200;
129760
129761/** Used to stand-in for `undefined` hash values. */
129762var HASH_UNDEFINED = '__lodash_hash_undefined__';
129763
129764/** Used as references for various `Number` constants. */
129765var MAX_SAFE_INTEGER = 9007199254740991;
129766
129767/** `Object#toString` result references. */
129768var argsTag = '[object Arguments]',
129769 arrayTag = '[object Array]',
129770 boolTag = '[object Boolean]',
129771 dateTag = '[object Date]',
129772 errorTag = '[object Error]',
129773 funcTag = '[object Function]',
129774 genTag = '[object GeneratorFunction]',
129775 mapTag = '[object Map]',
129776 numberTag = '[object Number]',
129777 objectTag = '[object Object]',
129778 promiseTag = '[object Promise]',
129779 regexpTag = '[object RegExp]',
129780 setTag = '[object Set]',
129781 stringTag = '[object String]',
129782 symbolTag = '[object Symbol]',
129783 weakMapTag = '[object WeakMap]';
129784
129785var arrayBufferTag = '[object ArrayBuffer]',
129786 dataViewTag = '[object DataView]',
129787 float32Tag = '[object Float32Array]',
129788 float64Tag = '[object Float64Array]',
129789 int8Tag = '[object Int8Array]',
129790 int16Tag = '[object Int16Array]',
129791 int32Tag = '[object Int32Array]',
129792 uint8Tag = '[object Uint8Array]',
129793 uint8ClampedTag = '[object Uint8ClampedArray]',
129794 uint16Tag = '[object Uint16Array]',
129795 uint32Tag = '[object Uint32Array]';
129796
129797/**
129798 * Used to match `RegExp`
129799 * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns).
129800 */
129801var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
129802
129803/** Used to match `RegExp` flags from their coerced string values. */
129804var reFlags = /\w*$/;
129805
129806/** Used to detect host constructors (Safari). */
129807var reIsHostCtor = /^\[object .+?Constructor\]$/;
129808
129809/** Used to detect unsigned integer values. */
129810var reIsUint = /^(?:0|[1-9]\d*)$/;
129811
129812/** Used to identify `toStringTag` values supported by `_.clone`. */
129813var cloneableTags = {};
129814cloneableTags[argsTag] = cloneableTags[arrayTag] =
129815cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
129816cloneableTags[boolTag] = cloneableTags[dateTag] =
129817cloneableTags[float32Tag] = cloneableTags[float64Tag] =
129818cloneableTags[int8Tag] = cloneableTags[int16Tag] =
129819cloneableTags[int32Tag] = cloneableTags[mapTag] =
129820cloneableTags[numberTag] = cloneableTags[objectTag] =
129821cloneableTags[regexpTag] = cloneableTags[setTag] =
129822cloneableTags[stringTag] = cloneableTags[symbolTag] =
129823cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
129824cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
129825cloneableTags[errorTag] = cloneableTags[funcTag] =
129826cloneableTags[weakMapTag] = false;
129827
129828/** Used to determine if values are of the language type `Object`. */
129829var objectTypes = {
129830 'function': true,
129831 'object': true
129832};
129833
129834/** Detect free variable `exports`. */
129835var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType)
129836 ? exports
129837 : undefined;
129838
129839/** Detect free variable `module`. */
129840var freeModule = (objectTypes[typeof module] && module && !module.nodeType)
129841 ? module
129842 : undefined;
129843
129844/** Detect the popular CommonJS extension `module.exports`. */
129845var moduleExports = (freeModule && freeModule.exports === freeExports)
129846 ? freeExports
129847 : undefined;
129848
129849/** Detect free variable `global` from Node.js. */
129850var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
129851
129852/** Detect free variable `self`. */
129853var freeSelf = checkGlobal(objectTypes[typeof self] && self);
129854
129855/** Detect free variable `window`. */
129856var freeWindow = checkGlobal(objectTypes[typeof window] && window);
129857
129858/** Detect `this` as the global object. */
129859var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
129860
129861/**
129862 * Used as a reference to the global object.
129863 *
129864 * The `this` value is used if it's the global object to avoid Greasemonkey's
129865 * restricted `window` object, otherwise the `window` object is used.
129866 */
129867var root = freeGlobal ||
129868 ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) ||
129869 freeSelf || thisGlobal || Function('return this')();
129870
129871/**
129872 * Adds the key-value `pair` to `map`.
129873 *
129874 * @private
129875 * @param {Object} map The map to modify.
129876 * @param {Array} pair The key-value pair to add.
129877 * @returns {Object} Returns `map`.
129878 */
129879function addMapEntry(map, pair) {
129880 // Don't return `Map#set` because it doesn't return the map instance in IE 11.
129881 map.set(pair[0], pair[1]);
129882 return map;
129883}
129884
129885/**
129886 * Adds `value` to `set`.
129887 *
129888 * @private
129889 * @param {Object} set The set to modify.
129890 * @param {*} value The value to add.
129891 * @returns {Object} Returns `set`.
129892 */
129893function addSetEntry(set, value) {
129894 set.add(value);
129895 return set;
129896}
129897
129898/**
129899 * A specialized version of `_.forEach` for arrays without support for
129900 * iteratee shorthands.
129901 *
129902 * @private
129903 * @param {Array} array The array to iterate over.
129904 * @param {Function} iteratee The function invoked per iteration.
129905 * @returns {Array} Returns `array`.
129906 */
129907function arrayEach(array, iteratee) {
129908 var index = -1,
129909 length = array.length;
129910
129911 while (++index < length) {
129912 if (iteratee(array[index], index, array) === false) {
129913 break;
129914 }
129915 }
129916 return array;
129917}
129918
129919/**
129920 * Appends the elements of `values` to `array`.
129921 *
129922 * @private
129923 * @param {Array} array The array to modify.
129924 * @param {Array} values The values to append.
129925 * @returns {Array} Returns `array`.
129926 */
129927function arrayPush(array, values) {
129928 var index = -1,
129929 length = values.length,
129930 offset = array.length;
129931
129932 while (++index < length) {
129933 array[offset + index] = values[index];
129934 }
129935 return array;
129936}
129937
129938/**
129939 * A specialized version of `_.reduce` for arrays without support for
129940 * iteratee shorthands.
129941 *
129942 * @private
129943 * @param {Array} array The array to iterate over.
129944 * @param {Function} iteratee The function invoked per iteration.
129945 * @param {*} [accumulator] The initial value.
129946 * @param {boolean} [initAccum] Specify using the first element of `array` as
129947 * the initial value.
129948 * @returns {*} Returns the accumulated value.
129949 */
129950function arrayReduce(array, iteratee, accumulator, initAccum) {
129951 var index = -1,
129952 length = array.length;
129953
129954 if (initAccum && length) {
129955 accumulator = array[++index];
129956 }
129957 while (++index < length) {
129958 accumulator = iteratee(accumulator, array[index], index, array);
129959 }
129960 return accumulator;
129961}
129962
129963/**
129964 * The base implementation of `_.times` without support for iteratee shorthands
129965 * or max array length checks.
129966 *
129967 * @private
129968 * @param {number} n The number of times to invoke `iteratee`.
129969 * @param {Function} iteratee The function invoked per iteration.
129970 * @returns {Array} Returns the array of results.
129971 */
129972function baseTimes(n, iteratee) {
129973 var index = -1,
129974 result = Array(n);
129975
129976 while (++index < n) {
129977 result[index] = iteratee(index);
129978 }
129979 return result;
129980}
129981
129982/**
129983 * Checks if `value` is a global object.
129984 *
129985 * @private
129986 * @param {*} value The value to check.
129987 * @returns {null|Object} Returns `value` if it's a global object, else `null`.
129988 */
129989function checkGlobal(value) {
129990 return (value && value.Object === Object) ? value : null;
129991}
129992
129993/**
129994 * Checks if `value` is a host object in IE < 9.
129995 *
129996 * @private
129997 * @param {*} value The value to check.
129998 * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
129999 */
130000function isHostObject(value) {
130001 // Many host objects are `Object` objects that can coerce to strings
130002 // despite having improperly defined `toString` methods.
130003 var result = false;
130004 if (value != null && typeof value.toString != 'function') {
130005 try {
130006 result = !!(value + '');
130007 } catch (e) {}
130008 }
130009 return result;
130010}
130011
130012/**
130013 * Converts `map` to its key-value pairs.
130014 *
130015 * @private
130016 * @param {Object} map The map to convert.
130017 * @returns {Array} Returns the key-value pairs.
130018 */
130019function mapToArray(map) {
130020 var index = -1,
130021 result = Array(map.size);
130022
130023 map.forEach(function(value, key) {
130024 result[++index] = [key, value];
130025 });
130026 return result;
130027}
130028
130029/**
130030 * Converts `set` to an array of its values.
130031 *
130032 * @private
130033 * @param {Object} set The set to convert.
130034 * @returns {Array} Returns the values.
130035 */
130036function setToArray(set) {
130037 var index = -1,
130038 result = Array(set.size);
130039
130040 set.forEach(function(value) {
130041 result[++index] = value;
130042 });
130043 return result;
130044}
130045
130046/** Used for built-in method references. */
130047var arrayProto = Array.prototype,
130048 objectProto = Object.prototype;
130049
130050/** Used to resolve the decompiled source of functions. */
130051var funcToString = Function.prototype.toString;
130052
130053/** Used to check objects for own properties. */
130054var hasOwnProperty = objectProto.hasOwnProperty;
130055
130056/**
130057 * Used to resolve the
130058 * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
130059 * of values.
130060 */
130061var objectToString = objectProto.toString;
130062
130063/** Used to detect if a method is native. */
130064var reIsNative = RegExp('^' +
130065 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
130066 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
130067);
130068
130069/** Built-in value references. */
130070var Buffer = moduleExports ? root.Buffer : undefined,
130071 Symbol = root.Symbol,
130072 Uint8Array = root.Uint8Array,
130073 getOwnPropertySymbols = Object.getOwnPropertySymbols,
130074 objectCreate = Object.create,
130075 propertyIsEnumerable = objectProto.propertyIsEnumerable,
130076 splice = arrayProto.splice;
130077
130078/* Built-in method references for those with the same name as other `lodash` methods. */
130079var nativeGetPrototype = Object.getPrototypeOf,
130080 nativeKeys = Object.keys;
130081
130082/* Built-in method references that are verified to be native. */
130083var DataView = getNative(root, 'DataView'),
130084 Map = getNative(root, 'Map'),
130085 Promise = getNative(root, 'Promise'),
130086 Set = getNative(root, 'Set'),
130087 WeakMap = getNative(root, 'WeakMap'),
130088 nativeCreate = getNative(Object, 'create');
130089
130090/** Used to detect maps, sets, and weakmaps. */
130091var dataViewCtorString = toSource(DataView),
130092 mapCtorString = toSource(Map),
130093 promiseCtorString = toSource(Promise),
130094 setCtorString = toSource(Set),
130095 weakMapCtorString = toSource(WeakMap);
130096
130097/** Used to convert symbols to primitives and strings. */
130098var symbolProto = Symbol ? Symbol.prototype : undefined,
130099 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
130100
130101/**
130102 * Creates a hash object.
130103 *
130104 * @private
130105 * @constructor
130106 * @param {Array} [entries] The key-value pairs to cache.
130107 */
130108function Hash(entries) {
130109 var index = -1,
130110 length = entries ? entries.length : 0;
130111
130112 this.clear();
130113 while (++index < length) {
130114 var entry = entries[index];
130115 this.set(entry[0], entry[1]);
130116 }
130117}
130118
130119/**
130120 * Removes all key-value entries from the hash.
130121 *
130122 * @private
130123 * @name clear
130124 * @memberOf Hash
130125 */
130126function hashClear() {
130127 this.__data__ = nativeCreate ? nativeCreate(null) : {};
130128}
130129
130130/**
130131 * Removes `key` and its value from the hash.
130132 *
130133 * @private
130134 * @name delete
130135 * @memberOf Hash
130136 * @param {Object} hash The hash to modify.
130137 * @param {string} key The key of the value to remove.
130138 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
130139 */
130140function hashDelete(key) {
130141 return this.has(key) && delete this.__data__[key];
130142}
130143
130144/**
130145 * Gets the hash value for `key`.
130146 *
130147 * @private
130148 * @name get
130149 * @memberOf Hash
130150 * @param {string} key The key of the value to get.
130151 * @returns {*} Returns the entry value.
130152 */
130153function hashGet(key) {
130154 var data = this.__data__;
130155 if (nativeCreate) {
130156 var result = data[key];
130157 return result === HASH_UNDEFINED ? undefined : result;
130158 }
130159 return hasOwnProperty.call(data, key) ? data[key] : undefined;
130160}
130161
130162/**
130163 * Checks if a hash value for `key` exists.
130164 *
130165 * @private
130166 * @name has
130167 * @memberOf Hash
130168 * @param {string} key The key of the entry to check.
130169 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
130170 */
130171function hashHas(key) {
130172 var data = this.__data__;
130173 return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
130174}
130175
130176/**
130177 * Sets the hash `key` to `value`.
130178 *
130179 * @private
130180 * @name set
130181 * @memberOf Hash
130182 * @param {string} key The key of the value to set.
130183 * @param {*} value The value to set.
130184 * @returns {Object} Returns the hash instance.
130185 */
130186function hashSet(key, value) {
130187 var data = this.__data__;
130188 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
130189 return this;
130190}
130191
130192// Add methods to `Hash`.
130193Hash.prototype.clear = hashClear;
130194Hash.prototype['delete'] = hashDelete;
130195Hash.prototype.get = hashGet;
130196Hash.prototype.has = hashHas;
130197Hash.prototype.set = hashSet;
130198
130199/**
130200 * Creates an list cache object.
130201 *
130202 * @private
130203 * @constructor
130204 * @param {Array} [entries] The key-value pairs to cache.
130205 */
130206function ListCache(entries) {
130207 var index = -1,
130208 length = entries ? entries.length : 0;
130209
130210 this.clear();
130211 while (++index < length) {
130212 var entry = entries[index];
130213 this.set(entry[0], entry[1]);
130214 }
130215}
130216
130217/**
130218 * Removes all key-value entries from the list cache.
130219 *
130220 * @private
130221 * @name clear
130222 * @memberOf ListCache
130223 */
130224function listCacheClear() {
130225 this.__data__ = [];
130226}
130227
130228/**
130229 * Removes `key` and its value from the list cache.
130230 *
130231 * @private
130232 * @name delete
130233 * @memberOf ListCache
130234 * @param {string} key The key of the value to remove.
130235 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
130236 */
130237function listCacheDelete(key) {
130238 var data = this.__data__,
130239 index = assocIndexOf(data, key);
130240
130241 if (index < 0) {
130242 return false;
130243 }
130244 var lastIndex = data.length - 1;
130245 if (index == lastIndex) {
130246 data.pop();
130247 } else {
130248 splice.call(data, index, 1);
130249 }
130250 return true;
130251}
130252
130253/**
130254 * Gets the list cache value for `key`.
130255 *
130256 * @private
130257 * @name get
130258 * @memberOf ListCache
130259 * @param {string} key The key of the value to get.
130260 * @returns {*} Returns the entry value.
130261 */
130262function listCacheGet(key) {
130263 var data = this.__data__,
130264 index = assocIndexOf(data, key);
130265
130266 return index < 0 ? undefined : data[index][1];
130267}
130268
130269/**
130270 * Checks if a list cache value for `key` exists.
130271 *
130272 * @private
130273 * @name has
130274 * @memberOf ListCache
130275 * @param {string} key The key of the entry to check.
130276 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
130277 */
130278function listCacheHas(key) {
130279 return assocIndexOf(this.__data__, key) > -1;
130280}
130281
130282/**
130283 * Sets the list cache `key` to `value`.
130284 *
130285 * @private
130286 * @name set
130287 * @memberOf ListCache
130288 * @param {string} key The key of the value to set.
130289 * @param {*} value The value to set.
130290 * @returns {Object} Returns the list cache instance.
130291 */
130292function listCacheSet(key, value) {
130293 var data = this.__data__,
130294 index = assocIndexOf(data, key);
130295
130296 if (index < 0) {
130297 data.push([key, value]);
130298 } else {
130299 data[index][1] = value;
130300 }
130301 return this;
130302}
130303
130304// Add methods to `ListCache`.
130305ListCache.prototype.clear = listCacheClear;
130306ListCache.prototype['delete'] = listCacheDelete;
130307ListCache.prototype.get = listCacheGet;
130308ListCache.prototype.has = listCacheHas;
130309ListCache.prototype.set = listCacheSet;
130310
130311/**
130312 * Creates a map cache object to store key-value pairs.
130313 *
130314 * @private
130315 * @constructor
130316 * @param {Array} [entries] The key-value pairs to cache.
130317 */
130318function MapCache(entries) {
130319 var index = -1,
130320 length = entries ? entries.length : 0;
130321
130322 this.clear();
130323 while (++index < length) {
130324 var entry = entries[index];
130325 this.set(entry[0], entry[1]);
130326 }
130327}
130328
130329/**
130330 * Removes all key-value entries from the map.
130331 *
130332 * @private
130333 * @name clear
130334 * @memberOf MapCache
130335 */
130336function mapCacheClear() {
130337 this.__data__ = {
130338 'hash': new Hash,
130339 'map': new (Map || ListCache),
130340 'string': new Hash
130341 };
130342}
130343
130344/**
130345 * Removes `key` and its value from the map.
130346 *
130347 * @private
130348 * @name delete
130349 * @memberOf MapCache
130350 * @param {string} key The key of the value to remove.
130351 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
130352 */
130353function mapCacheDelete(key) {
130354 return getMapData(this, key)['delete'](key);
130355}
130356
130357/**
130358 * Gets the map value for `key`.
130359 *
130360 * @private
130361 * @name get
130362 * @memberOf MapCache
130363 * @param {string} key The key of the value to get.
130364 * @returns {*} Returns the entry value.
130365 */
130366function mapCacheGet(key) {
130367 return getMapData(this, key).get(key);
130368}
130369
130370/**
130371 * Checks if a map value for `key` exists.
130372 *
130373 * @private
130374 * @name has
130375 * @memberOf MapCache
130376 * @param {string} key The key of the entry to check.
130377 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
130378 */
130379function mapCacheHas(key) {
130380 return getMapData(this, key).has(key);
130381}
130382
130383/**
130384 * Sets the map `key` to `value`.
130385 *
130386 * @private
130387 * @name set
130388 * @memberOf MapCache
130389 * @param {string} key The key of the value to set.
130390 * @param {*} value The value to set.
130391 * @returns {Object} Returns the map cache instance.
130392 */
130393function mapCacheSet(key, value) {
130394 getMapData(this, key).set(key, value);
130395 return this;
130396}
130397
130398// Add methods to `MapCache`.
130399MapCache.prototype.clear = mapCacheClear;
130400MapCache.prototype['delete'] = mapCacheDelete;
130401MapCache.prototype.get = mapCacheGet;
130402MapCache.prototype.has = mapCacheHas;
130403MapCache.prototype.set = mapCacheSet;
130404
130405/**
130406 * Creates a stack cache object to store key-value pairs.
130407 *
130408 * @private
130409 * @constructor
130410 * @param {Array} [entries] The key-value pairs to cache.
130411 */
130412function Stack(entries) {
130413 this.__data__ = new ListCache(entries);
130414}
130415
130416/**
130417 * Removes all key-value entries from the stack.
130418 *
130419 * @private
130420 * @name clear
130421 * @memberOf Stack
130422 */
130423function stackClear() {
130424 this.__data__ = new ListCache;
130425}
130426
130427/**
130428 * Removes `key` and its value from the stack.
130429 *
130430 * @private
130431 * @name delete
130432 * @memberOf Stack
130433 * @param {string} key The key of the value to remove.
130434 * @returns {boolean} Returns `true` if the entry was removed, else `false`.
130435 */
130436function stackDelete(key) {
130437 return this.__data__['delete'](key);
130438}
130439
130440/**
130441 * Gets the stack value for `key`.
130442 *
130443 * @private
130444 * @name get
130445 * @memberOf Stack
130446 * @param {string} key The key of the value to get.
130447 * @returns {*} Returns the entry value.
130448 */
130449function stackGet(key) {
130450 return this.__data__.get(key);
130451}
130452
130453/**
130454 * Checks if a stack value for `key` exists.
130455 *
130456 * @private
130457 * @name has
130458 * @memberOf Stack
130459 * @param {string} key The key of the entry to check.
130460 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
130461 */
130462function stackHas(key) {
130463 return this.__data__.has(key);
130464}
130465
130466/**
130467 * Sets the stack `key` to `value`.
130468 *
130469 * @private
130470 * @name set
130471 * @memberOf Stack
130472 * @param {string} key The key of the value to set.
130473 * @param {*} value The value to set.
130474 * @returns {Object} Returns the stack cache instance.
130475 */
130476function stackSet(key, value) {
130477 var cache = this.__data__;
130478 if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) {
130479 cache = this.__data__ = new MapCache(cache.__data__);
130480 }
130481 cache.set(key, value);
130482 return this;
130483}
130484
130485// Add methods to `Stack`.
130486Stack.prototype.clear = stackClear;
130487Stack.prototype['delete'] = stackDelete;
130488Stack.prototype.get = stackGet;
130489Stack.prototype.has = stackHas;
130490Stack.prototype.set = stackSet;
130491
130492/**
130493 * Assigns `value` to `key` of `object` if the existing value is not equivalent
130494 * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
130495 * for equality comparisons.
130496 *
130497 * @private
130498 * @param {Object} object The object to modify.
130499 * @param {string} key The key of the property to assign.
130500 * @param {*} value The value to assign.
130501 */
130502function assignValue(object, key, value) {
130503 var objValue = object[key];
130504 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
130505 (value === undefined && !(key in object))) {
130506 object[key] = value;
130507 }
130508}
130509
130510/**
130511 * Gets the index at which the `key` is found in `array` of key-value pairs.
130512 *
130513 * @private
130514 * @param {Array} array The array to search.
130515 * @param {*} key The key to search for.
130516 * @returns {number} Returns the index of the matched value, else `-1`.
130517 */
130518function assocIndexOf(array, key) {
130519 var length = array.length;
130520 while (length--) {
130521 if (eq(array[length][0], key)) {
130522 return length;
130523 }
130524 }
130525 return -1;
130526}
130527
130528/**
130529 * The base implementation of `_.assign` without support for multiple sources
130530 * or `customizer` functions.
130531 *
130532 * @private
130533 * @param {Object} object The destination object.
130534 * @param {Object} source The source object.
130535 * @returns {Object} Returns `object`.
130536 */
130537function baseAssign(object, source) {
130538 return object && copyObject(source, keys(source), object);
130539}
130540
130541/**
130542 * The base implementation of `_.clone` and `_.cloneDeep` which tracks
130543 * traversed objects.
130544 *
130545 * @private
130546 * @param {*} value The value to clone.
130547 * @param {boolean} [isDeep] Specify a deep clone.
130548 * @param {boolean} [isFull] Specify a clone including symbols.
130549 * @param {Function} [customizer] The function to customize cloning.
130550 * @param {string} [key] The key of `value`.
130551 * @param {Object} [object] The parent object of `value`.
130552 * @param {Object} [stack] Tracks traversed objects and their clone counterparts.
130553 * @returns {*} Returns the cloned value.
130554 */
130555function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
130556 var result;
130557 if (customizer) {
130558 result = object ? customizer(value, key, object, stack) : customizer(value);
130559 }
130560 if (result !== undefined) {
130561 return result;
130562 }
130563 if (!isObject(value)) {
130564 return value;
130565 }
130566 var isArr = isArray(value);
130567 if (isArr) {
130568 result = initCloneArray(value);
130569 if (!isDeep) {
130570 return copyArray(value, result);
130571 }
130572 } else {
130573 var tag = getTag(value),
130574 isFunc = tag == funcTag || tag == genTag;
130575
130576 if (isBuffer(value)) {
130577 return cloneBuffer(value, isDeep);
130578 }
130579 if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
130580 if (isHostObject(value)) {
130581 return object ? value : {};
130582 }
130583 result = initCloneObject(isFunc ? {} : value);
130584 if (!isDeep) {
130585 return copySymbols(value, baseAssign(result, value));
130586 }
130587 } else {
130588 if (!cloneableTags[tag]) {
130589 return object ? value : {};
130590 }
130591 result = initCloneByTag(value, tag, baseClone, isDeep);
130592 }
130593 }
130594 // Check for circular references and return its corresponding clone.
130595 stack || (stack = new Stack);
130596 var stacked = stack.get(value);
130597 if (stacked) {
130598 return stacked;
130599 }
130600 stack.set(value, result);
130601
130602 if (!isArr) {
130603 var props = isFull ? getAllKeys(value) : keys(value);
130604 }
130605 // Recursively populate clone (susceptible to call stack limits).
130606 arrayEach(props || value, function(subValue, key) {
130607 if (props) {
130608 key = subValue;
130609 subValue = value[key];
130610 }
130611 assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack));
130612 });
130613 return result;
130614}
130615
130616/**
130617 * The base implementation of `_.create` without support for assigning
130618 * properties to the created object.
130619 *
130620 * @private
130621 * @param {Object} prototype The object to inherit from.
130622 * @returns {Object} Returns the new object.
130623 */
130624function baseCreate(proto) {
130625 return isObject(proto) ? objectCreate(proto) : {};
130626}
130627
130628/**
130629 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
130630 * `keysFunc` and `symbolsFunc` to get the enumerable property names and
130631 * symbols of `object`.
130632 *
130633 * @private
130634 * @param {Object} object The object to query.
130635 * @param {Function} keysFunc The function to get the keys of `object`.
130636 * @param {Function} symbolsFunc The function to get the symbols of `object`.
130637 * @returns {Array} Returns the array of property names and symbols.
130638 */
130639function baseGetAllKeys(object, keysFunc, symbolsFunc) {
130640 var result = keysFunc(object);
130641 return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
130642}
130643
130644/**
130645 * The base implementation of `_.has` without support for deep paths.
130646 *
130647 * @private
130648 * @param {Object} object The object to query.
130649 * @param {Array|string} key The key to check.
130650 * @returns {boolean} Returns `true` if `key` exists, else `false`.
130651 */
130652function baseHas(object, key) {
130653 // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
130654 // that are composed entirely of index properties, return `false` for
130655 // `hasOwnProperty` checks of them.
130656 return hasOwnProperty.call(object, key) ||
130657 (typeof object == 'object' && key in object && getPrototype(object) === null);
130658}
130659
130660/**
130661 * The base implementation of `_.keys` which doesn't skip the constructor
130662 * property of prototypes or treat sparse arrays as dense.
130663 *
130664 * @private
130665 * @param {Object} object The object to query.
130666 * @returns {Array} Returns the array of property names.
130667 */
130668function baseKeys(object) {
130669 return nativeKeys(Object(object));
130670}
130671
130672/**
130673 * The base implementation of `_.property` without support for deep paths.
130674 *
130675 * @private
130676 * @param {string} key The key of the property to get.
130677 * @returns {Function} Returns the new accessor function.
130678 */
130679function baseProperty(key) {
130680 return function(object) {
130681 return object == null ? undefined : object[key];
130682 };
130683}
130684
130685/**
130686 * Creates a clone of `buffer`.
130687 *
130688 * @private
130689 * @param {Buffer} buffer The buffer to clone.
130690 * @param {boolean} [isDeep] Specify a deep clone.
130691 * @returns {Buffer} Returns the cloned buffer.
130692 */
130693function cloneBuffer(buffer, isDeep) {
130694 if (isDeep) {
130695 return buffer.slice();
130696 }
130697 var result = new buffer.constructor(buffer.length);
130698 buffer.copy(result);
130699 return result;
130700}
130701
130702/**
130703 * Creates a clone of `arrayBuffer`.
130704 *
130705 * @private
130706 * @param {ArrayBuffer} arrayBuffer The array buffer to clone.
130707 * @returns {ArrayBuffer} Returns the cloned array buffer.
130708 */
130709function cloneArrayBuffer(arrayBuffer) {
130710 var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
130711 new Uint8Array(result).set(new Uint8Array(arrayBuffer));
130712 return result;
130713}
130714
130715/**
130716 * Creates a clone of `dataView`.
130717 *
130718 * @private
130719 * @param {Object} dataView The data view to clone.
130720 * @param {boolean} [isDeep] Specify a deep clone.
130721 * @returns {Object} Returns the cloned data view.
130722 */
130723function cloneDataView(dataView, isDeep) {
130724 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
130725 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
130726}
130727
130728/**
130729 * Creates a clone of `map`.
130730 *
130731 * @private
130732 * @param {Object} map The map to clone.
130733 * @param {Function} cloneFunc The function to clone values.
130734 * @param {boolean} [isDeep] Specify a deep clone.
130735 * @returns {Object} Returns the cloned map.
130736 */
130737function cloneMap(map, isDeep, cloneFunc) {
130738 var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
130739 return arrayReduce(array, addMapEntry, new map.constructor);
130740}
130741
130742/**
130743 * Creates a clone of `regexp`.
130744 *
130745 * @private
130746 * @param {Object} regexp The regexp to clone.
130747 * @returns {Object} Returns the cloned regexp.
130748 */
130749function cloneRegExp(regexp) {
130750 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
130751 result.lastIndex = regexp.lastIndex;
130752 return result;
130753}
130754
130755/**
130756 * Creates a clone of `set`.
130757 *
130758 * @private
130759 * @param {Object} set The set to clone.
130760 * @param {Function} cloneFunc The function to clone values.
130761 * @param {boolean} [isDeep] Specify a deep clone.
130762 * @returns {Object} Returns the cloned set.
130763 */
130764function cloneSet(set, isDeep, cloneFunc) {
130765 var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
130766 return arrayReduce(array, addSetEntry, new set.constructor);
130767}
130768
130769/**
130770 * Creates a clone of the `symbol` object.
130771 *
130772 * @private
130773 * @param {Object} symbol The symbol object to clone.
130774 * @returns {Object} Returns the cloned symbol object.
130775 */
130776function cloneSymbol(symbol) {
130777 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
130778}
130779
130780/**
130781 * Creates a clone of `typedArray`.
130782 *
130783 * @private
130784 * @param {Object} typedArray The typed array to clone.
130785 * @param {boolean} [isDeep] Specify a deep clone.
130786 * @returns {Object} Returns the cloned typed array.
130787 */
130788function cloneTypedArray(typedArray, isDeep) {
130789 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
130790 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
130791}
130792
130793/**
130794 * Copies the values of `source` to `array`.
130795 *
130796 * @private
130797 * @param {Array} source The array to copy values from.
130798 * @param {Array} [array=[]] The array to copy values to.
130799 * @returns {Array} Returns `array`.
130800 */
130801function copyArray(source, array) {
130802 var index = -1,
130803 length = source.length;
130804
130805 array || (array = Array(length));
130806 while (++index < length) {
130807 array[index] = source[index];
130808 }
130809 return array;
130810}
130811
130812/**
130813 * Copies properties of `source` to `object`.
130814 *
130815 * @private
130816 * @param {Object} source The object to copy properties from.
130817 * @param {Array} props The property identifiers to copy.
130818 * @param {Object} [object={}] The object to copy properties to.
130819 * @param {Function} [customizer] The function to customize copied values.
130820 * @returns {Object} Returns `object`.
130821 */
130822function copyObject(source, props, object, customizer) {
130823 object || (object = {});
130824
130825 var index = -1,
130826 length = props.length;
130827
130828 while (++index < length) {
130829 var key = props[index];
130830
130831 var newValue = customizer
130832 ? customizer(object[key], source[key], key, object, source)
130833 : source[key];
130834
130835 assignValue(object, key, newValue);
130836 }
130837 return object;
130838}
130839
130840/**
130841 * Copies own symbol properties of `source` to `object`.
130842 *
130843 * @private
130844 * @param {Object} source The object to copy symbols from.
130845 * @param {Object} [object={}] The object to copy symbols to.
130846 * @returns {Object} Returns `object`.
130847 */
130848function copySymbols(source, object) {
130849 return copyObject(source, getSymbols(source), object);
130850}
130851
130852/**
130853 * Creates an array of own enumerable property names and symbols of `object`.
130854 *
130855 * @private
130856 * @param {Object} object The object to query.
130857 * @returns {Array} Returns the array of property names and symbols.
130858 */
130859function getAllKeys(object) {
130860 return baseGetAllKeys(object, keys, getSymbols);
130861}
130862
130863/**
130864 * Gets the "length" property value of `object`.
130865 *
130866 * **Note:** This function is used to avoid a
130867 * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects
130868 * Safari on at least iOS 8.1-8.3 ARM64.
130869 *
130870 * @private
130871 * @param {Object} object The object to query.
130872 * @returns {*} Returns the "length" value.
130873 */
130874var getLength = baseProperty('length');
130875
130876/**
130877 * Gets the data for `map`.
130878 *
130879 * @private
130880 * @param {Object} map The map to query.
130881 * @param {string} key The reference key.
130882 * @returns {*} Returns the map data.
130883 */
130884function getMapData(map, key) {
130885 var data = map.__data__;
130886 return isKeyable(key)
130887 ? data[typeof key == 'string' ? 'string' : 'hash']
130888 : data.map;
130889}
130890
130891/**
130892 * Gets the native function at `key` of `object`.
130893 *
130894 * @private
130895 * @param {Object} object The object to query.
130896 * @param {string} key The key of the method to get.
130897 * @returns {*} Returns the function if it's native, else `undefined`.
130898 */
130899function getNative(object, key) {
130900 var value = object[key];
130901 return isNative(value) ? value : undefined;
130902}
130903
130904/**
130905 * Gets the `[[Prototype]]` of `value`.
130906 *
130907 * @private
130908 * @param {*} value The value to query.
130909 * @returns {null|Object} Returns the `[[Prototype]]`.
130910 */
130911function getPrototype(value) {
130912 return nativeGetPrototype(Object(value));
130913}
130914
130915/**
130916 * Creates an array of the own enumerable symbol properties of `object`.
130917 *
130918 * @private
130919 * @param {Object} object The object to query.
130920 * @returns {Array} Returns the array of symbols.
130921 */
130922function getSymbols(object) {
130923 // Coerce `object` to an object to avoid non-object errors in V8.
130924 // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details.
130925 return getOwnPropertySymbols(Object(object));
130926}
130927
130928// Fallback for IE < 11.
130929if (!getOwnPropertySymbols) {
130930 getSymbols = function() {
130931 return [];
130932 };
130933}
130934
130935/**
130936 * Gets the `toStringTag` of `value`.
130937 *
130938 * @private
130939 * @param {*} value The value to query.
130940 * @returns {string} Returns the `toStringTag`.
130941 */
130942function getTag(value) {
130943 return objectToString.call(value);
130944}
130945
130946// Fallback for data views, maps, sets, and weak maps in IE 11,
130947// for data views in Edge, and promises in Node.js.
130948if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
130949 (Map && getTag(new Map) != mapTag) ||
130950 (Promise && getTag(Promise.resolve()) != promiseTag) ||
130951 (Set && getTag(new Set) != setTag) ||
130952 (WeakMap && getTag(new WeakMap) != weakMapTag)) {
130953 getTag = function(value) {
130954 var result = objectToString.call(value),
130955 Ctor = result == objectTag ? value.constructor : undefined,
130956 ctorString = Ctor ? toSource(Ctor) : undefined;
130957
130958 if (ctorString) {
130959 switch (ctorString) {
130960 case dataViewCtorString: return dataViewTag;
130961 case mapCtorString: return mapTag;
130962 case promiseCtorString: return promiseTag;
130963 case setCtorString: return setTag;
130964 case weakMapCtorString: return weakMapTag;
130965 }
130966 }
130967 return result;
130968 };
130969}
130970
130971/**
130972 * Initializes an array clone.
130973 *
130974 * @private
130975 * @param {Array} array The array to clone.
130976 * @returns {Array} Returns the initialized clone.
130977 */
130978function initCloneArray(array) {
130979 var length = array.length,
130980 result = array.constructor(length);
130981
130982 // Add properties assigned by `RegExp#exec`.
130983 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
130984 result.index = array.index;
130985 result.input = array.input;
130986 }
130987 return result;
130988}
130989
130990/**
130991 * Initializes an object clone.
130992 *
130993 * @private
130994 * @param {Object} object The object to clone.
130995 * @returns {Object} Returns the initialized clone.
130996 */
130997function initCloneObject(object) {
130998 return (typeof object.constructor == 'function' && !isPrototype(object))
130999 ? baseCreate(getPrototype(object))
131000 : {};
131001}
131002
131003/**
131004 * Initializes an object clone based on its `toStringTag`.
131005 *
131006 * **Note:** This function only supports cloning values with tags of
131007 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
131008 *
131009 * @private
131010 * @param {Object} object The object to clone.
131011 * @param {string} tag The `toStringTag` of the object to clone.
131012 * @param {Function} cloneFunc The function to clone values.
131013 * @param {boolean} [isDeep] Specify a deep clone.
131014 * @returns {Object} Returns the initialized clone.
131015 */
131016function initCloneByTag(object, tag, cloneFunc, isDeep) {
131017 var Ctor = object.constructor;
131018 switch (tag) {
131019 case arrayBufferTag:
131020 return cloneArrayBuffer(object);
131021
131022 case boolTag:
131023 case dateTag:
131024 return new Ctor(+object);
131025
131026 case dataViewTag:
131027 return cloneDataView(object, isDeep);
131028
131029 case float32Tag: case float64Tag:
131030 case int8Tag: case int16Tag: case int32Tag:
131031 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:
131032 return cloneTypedArray(object, isDeep);
131033
131034 case mapTag:
131035 return cloneMap(object, isDeep, cloneFunc);
131036
131037 case numberTag:
131038 case stringTag:
131039 return new Ctor(object);
131040
131041 case regexpTag:
131042 return cloneRegExp(object);
131043
131044 case setTag:
131045 return cloneSet(object, isDeep, cloneFunc);
131046
131047 case symbolTag:
131048 return cloneSymbol(object);
131049 }
131050}
131051
131052/**
131053 * Creates an array of index keys for `object` values of arrays,
131054 * `arguments` objects, and strings, otherwise `null` is returned.
131055 *
131056 * @private
131057 * @param {Object} object The object to query.
131058 * @returns {Array|null} Returns index keys, else `null`.
131059 */
131060function indexKeys(object) {
131061 var length = object ? object.length : undefined;
131062 if (isLength(length) &&
131063 (isArray(object) || isString(object) || isArguments(object))) {
131064 return baseTimes(length, String);
131065 }
131066 return null;
131067}
131068
131069/**
131070 * Checks if `value` is a valid array-like index.
131071 *
131072 * @private
131073 * @param {*} value The value to check.
131074 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
131075 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
131076 */
131077function isIndex(value, length) {
131078 length = length == null ? MAX_SAFE_INTEGER : length;
131079 return !!length &&
131080 (typeof value == 'number' || reIsUint.test(value)) &&
131081 (value > -1 && value % 1 == 0 && value < length);
131082}
131083
131084/**
131085 * Checks if `value` is suitable for use as unique object key.
131086 *
131087 * @private
131088 * @param {*} value The value to check.
131089 * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
131090 */
131091function isKeyable(value) {
131092 var type = typeof value;
131093 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
131094 ? (value !== '__proto__')
131095 : (value === null);
131096}
131097
131098/**
131099 * Checks if `value` is likely a prototype object.
131100 *
131101 * @private
131102 * @param {*} value The value to check.
131103 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
131104 */
131105function isPrototype(value) {
131106 var Ctor = value && value.constructor,
131107 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
131108
131109 return value === proto;
131110}
131111
131112/**
131113 * Converts `func` to its source code.
131114 *
131115 * @private
131116 * @param {Function} func The function to process.
131117 * @returns {string} Returns the source code.
131118 */
131119function toSource(func) {
131120 if (func != null) {
131121 try {
131122 return funcToString.call(func);
131123 } catch (e) {}
131124 try {
131125 return (func + '');
131126 } catch (e) {}
131127 }
131128 return '';
131129}
131130
131131/**
131132 * Performs a
131133 * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
131134 * comparison between two values to determine if they are equivalent.
131135 *
131136 * @static
131137 * @memberOf _
131138 * @since 4.0.0
131139 * @category Lang
131140 * @param {*} value The value to compare.
131141 * @param {*} other The other value to compare.
131142 * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
131143 * @example
131144 *
131145 * var object = { 'user': 'fred' };
131146 * var other = { 'user': 'fred' };
131147 *
131148 * _.eq(object, object);
131149 * // => true
131150 *
131151 * _.eq(object, other);
131152 * // => false
131153 *
131154 * _.eq('a', 'a');
131155 * // => true
131156 *
131157 * _.eq('a', Object('a'));
131158 * // => false
131159 *
131160 * _.eq(NaN, NaN);
131161 * // => true
131162 */
131163function eq(value, other) {
131164 return value === other || (value !== value && other !== other);
131165}
131166
131167/**
131168 * Checks if `value` is likely an `arguments` object.
131169 *
131170 * @static
131171 * @memberOf _
131172 * @since 0.1.0
131173 * @category Lang
131174 * @param {*} value The value to check.
131175 * @returns {boolean} Returns `true` if `value` is correctly classified,
131176 * else `false`.
131177 * @example
131178 *
131179 * _.isArguments(function() { return arguments; }());
131180 * // => true
131181 *
131182 * _.isArguments([1, 2, 3]);
131183 * // => false
131184 */
131185function isArguments(value) {
131186 // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode.
131187 return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
131188 (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
131189}
131190
131191/**
131192 * Checks if `value` is classified as an `Array` object.
131193 *
131194 * @static
131195 * @memberOf _
131196 * @since 0.1.0
131197 * @type {Function}
131198 * @category Lang
131199 * @param {*} value The value to check.
131200 * @returns {boolean} Returns `true` if `value` is correctly classified,
131201 * else `false`.
131202 * @example
131203 *
131204 * _.isArray([1, 2, 3]);
131205 * // => true
131206 *
131207 * _.isArray(document.body.children);
131208 * // => false
131209 *
131210 * _.isArray('abc');
131211 * // => false
131212 *
131213 * _.isArray(_.noop);
131214 * // => false
131215 */
131216var isArray = Array.isArray;
131217
131218/**
131219 * Checks if `value` is array-like. A value is considered array-like if it's
131220 * not a function and has a `value.length` that's an integer greater than or
131221 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
131222 *
131223 * @static
131224 * @memberOf _
131225 * @since 4.0.0
131226 * @category Lang
131227 * @param {*} value The value to check.
131228 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
131229 * @example
131230 *
131231 * _.isArrayLike([1, 2, 3]);
131232 * // => true
131233 *
131234 * _.isArrayLike(document.body.children);
131235 * // => true
131236 *
131237 * _.isArrayLike('abc');
131238 * // => true
131239 *
131240 * _.isArrayLike(_.noop);
131241 * // => false
131242 */
131243function isArrayLike(value) {
131244 return value != null && isLength(getLength(value)) && !isFunction(value);
131245}
131246
131247/**
131248 * This method is like `_.isArrayLike` except that it also checks if `value`
131249 * is an object.
131250 *
131251 * @static
131252 * @memberOf _
131253 * @since 4.0.0
131254 * @category Lang
131255 * @param {*} value The value to check.
131256 * @returns {boolean} Returns `true` if `value` is an array-like object,
131257 * else `false`.
131258 * @example
131259 *
131260 * _.isArrayLikeObject([1, 2, 3]);
131261 * // => true
131262 *
131263 * _.isArrayLikeObject(document.body.children);
131264 * // => true
131265 *
131266 * _.isArrayLikeObject('abc');
131267 * // => false
131268 *
131269 * _.isArrayLikeObject(_.noop);
131270 * // => false
131271 */
131272function isArrayLikeObject(value) {
131273 return isObjectLike(value) && isArrayLike(value);
131274}
131275
131276/**
131277 * Checks if `value` is a buffer.
131278 *
131279 * @static
131280 * @memberOf _
131281 * @since 4.3.0
131282 * @category Lang
131283 * @param {*} value The value to check.
131284 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
131285 * @example
131286 *
131287 * _.isBuffer(new Buffer(2));
131288 * // => true
131289 *
131290 * _.isBuffer(new Uint8Array(2));
131291 * // => false
131292 */
131293var isBuffer = !Buffer ? constant(false) : function(value) {
131294 return value instanceof Buffer;
131295};
131296
131297/**
131298 * Checks if `value` is classified as a `Function` object.
131299 *
131300 * @static
131301 * @memberOf _
131302 * @since 0.1.0
131303 * @category Lang
131304 * @param {*} value The value to check.
131305 * @returns {boolean} Returns `true` if `value` is correctly classified,
131306 * else `false`.
131307 * @example
131308 *
131309 * _.isFunction(_);
131310 * // => true
131311 *
131312 * _.isFunction(/abc/);
131313 * // => false
131314 */
131315function isFunction(value) {
131316 // The use of `Object#toString` avoids issues with the `typeof` operator
131317 // in Safari 8 which returns 'object' for typed array and weak map constructors,
131318 // and PhantomJS 1.9 which returns 'function' for `NodeList` instances.
131319 var tag = isObject(value) ? objectToString.call(value) : '';
131320 return tag == funcTag || tag == genTag;
131321}
131322
131323/**
131324 * Checks if `value` is a valid array-like length.
131325 *
131326 * **Note:** This function is loosely based on
131327 * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
131328 *
131329 * @static
131330 * @memberOf _
131331 * @since 4.0.0
131332 * @category Lang
131333 * @param {*} value The value to check.
131334 * @returns {boolean} Returns `true` if `value` is a valid length,
131335 * else `false`.
131336 * @example
131337 *
131338 * _.isLength(3);
131339 * // => true
131340 *
131341 * _.isLength(Number.MIN_VALUE);
131342 * // => false
131343 *
131344 * _.isLength(Infinity);
131345 * // => false
131346 *
131347 * _.isLength('3');
131348 * // => false
131349 */
131350function isLength(value) {
131351 return typeof value == 'number' &&
131352 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
131353}
131354
131355/**
131356 * Checks if `value` is the
131357 * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types)
131358 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
131359 *
131360 * @static
131361 * @memberOf _
131362 * @since 0.1.0
131363 * @category Lang
131364 * @param {*} value The value to check.
131365 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
131366 * @example
131367 *
131368 * _.isObject({});
131369 * // => true
131370 *
131371 * _.isObject([1, 2, 3]);
131372 * // => true
131373 *
131374 * _.isObject(_.noop);
131375 * // => true
131376 *
131377 * _.isObject(null);
131378 * // => false
131379 */
131380function isObject(value) {
131381 var type = typeof value;
131382 return !!value && (type == 'object' || type == 'function');
131383}
131384
131385/**
131386 * Checks if `value` is object-like. A value is object-like if it's not `null`
131387 * and has a `typeof` result of "object".
131388 *
131389 * @static
131390 * @memberOf _
131391 * @since 4.0.0
131392 * @category Lang
131393 * @param {*} value The value to check.
131394 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
131395 * @example
131396 *
131397 * _.isObjectLike({});
131398 * // => true
131399 *
131400 * _.isObjectLike([1, 2, 3]);
131401 * // => true
131402 *
131403 * _.isObjectLike(_.noop);
131404 * // => false
131405 *
131406 * _.isObjectLike(null);
131407 * // => false
131408 */
131409function isObjectLike(value) {
131410 return !!value && typeof value == 'object';
131411}
131412
131413/**
131414 * Checks if `value` is a native function.
131415 *
131416 * @static
131417 * @memberOf _
131418 * @since 3.0.0
131419 * @category Lang
131420 * @param {*} value The value to check.
131421 * @returns {boolean} Returns `true` if `value` is a native function,
131422 * else `false`.
131423 * @example
131424 *
131425 * _.isNative(Array.prototype.push);
131426 * // => true
131427 *
131428 * _.isNative(_);
131429 * // => false
131430 */
131431function isNative(value) {
131432 if (!isObject(value)) {
131433 return false;
131434 }
131435 var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
131436 return pattern.test(toSource(value));
131437}
131438
131439/**
131440 * Checks if `value` is classified as a `String` primitive or object.
131441 *
131442 * @static
131443 * @since 0.1.0
131444 * @memberOf _
131445 * @category Lang
131446 * @param {*} value The value to check.
131447 * @returns {boolean} Returns `true` if `value` is correctly classified,
131448 * else `false`.
131449 * @example
131450 *
131451 * _.isString('abc');
131452 * // => true
131453 *
131454 * _.isString(1);
131455 * // => false
131456 */
131457function isString(value) {
131458 return typeof value == 'string' ||
131459 (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
131460}
131461
131462/**
131463 * Creates an array of the own enumerable property names of `object`.
131464 *
131465 * **Note:** Non-object values are coerced to objects. See the
131466 * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
131467 * for more details.
131468 *
131469 * @static
131470 * @since 0.1.0
131471 * @memberOf _
131472 * @category Object
131473 * @param {Object} object The object to query.
131474 * @returns {Array} Returns the array of property names.
131475 * @example
131476 *
131477 * function Foo() {
131478 * this.a = 1;
131479 * this.b = 2;
131480 * }
131481 *
131482 * Foo.prototype.c = 3;
131483 *
131484 * _.keys(new Foo);
131485 * // => ['a', 'b'] (iteration order is not guaranteed)
131486 *
131487 * _.keys('hi');
131488 * // => ['0', '1']
131489 */
131490function keys(object) {
131491 var isProto = isPrototype(object);
131492 if (!(isProto || isArrayLike(object))) {
131493 return baseKeys(object);
131494 }
131495 var indexes = indexKeys(object),
131496 skipIndexes = !!indexes,
131497 result = indexes || [],
131498 length = result.length;
131499
131500 for (var key in object) {
131501 if (baseHas(object, key) &&
131502 !(skipIndexes && (key == 'length' || isIndex(key, length))) &&
131503 !(isProto && key == 'constructor')) {
131504 result.push(key);
131505 }
131506 }
131507 return result;
131508}
131509
131510/**
131511 * Creates a function that returns `value`.
131512 *
131513 * @static
131514 * @memberOf _
131515 * @since 2.4.0
131516 * @category Util
131517 * @param {*} value The value to return from the new function.
131518 * @returns {Function} Returns the new constant function.
131519 * @example
131520 *
131521 * var object = { 'user': 'fred' };
131522 * var getter = _.constant(object);
131523 *
131524 * getter() === object;
131525 * // => true
131526 */
131527function constant(value) {
131528 return function() {
131529 return value;
131530 };
131531}
131532
131533module.exports = baseClone;
131534
131535/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(150)(module)))
131536
131537/***/ }),
131538/* 820 */
131539/***/ (function(module, exports, __webpack_require__) {
131540
131541/**
131542 * lodash 4.3.2 (Custom Build) <https://lodash.com/>
131543 * Build: `lodash modularize exports="npm" -o ./`
131544 * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
131545 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
131546 * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
131547 * Available under MIT license <https://lodash.com/license>
131548 */
131549var baseClone = __webpack_require__(819);
131550
131551/**
131552 * Creates a shallow clone of `value`.
131553 *
131554 * **Note:** This method is loosely based on the
131555 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)
131556 * and supports cloning arrays, array buffers, booleans, date objects, maps,
131557 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed
131558 * arrays. The own enumerable properties of `arguments` objects are cloned
131559 * as plain objects. An empty object is returned for uncloneable values such
131560 * as error objects, functions, DOM nodes, and WeakMaps.
131561 *
131562 * @static
131563 * @memberOf _
131564 * @category Lang
131565 * @param {*} value The value to clone.
131566 * @returns {*} Returns the cloned value.
131567 * @example
131568 *
131569 * var objects = [{ 'a': 1 }, { 'b': 2 }];
131570 *
131571 * var shallow = _.clone(objects);
131572 * console.log(shallow[0] === objects[0]);
131573 * // => true
131574 */
131575function clone(value) {
131576 return baseClone(value, false, true);
131577}
131578
131579module.exports = clone;
131580
131581
131582/***/ }),
131583/* 821 */
131584/***/ (function(module, exports) {
131585
131586/**
131587 * lodash (Custom Build) <https://lodash.com/>
131588 * Build: `lodash modularize exports="npm" -o ./`
131589 * Copyright jQuery Foundation and other contributors <https://jquery.org/>
131590 * Released under MIT license <https://lodash.com/license>
131591 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
131592 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
131593 */
131594
131595/** Used as references for various `Number` constants. */
131596var MAX_SAFE_INTEGER = 9007199254740991;
131597
131598/** `Object#toString` result references. */
131599var argsTag = '[object Arguments]',
131600 funcTag = '[object Function]',
131601 genTag = '[object GeneratorFunction]',
131602 mapTag = '[object Map]',
131603 objectTag = '[object Object]',
131604 promiseTag = '[object Promise]',
131605 setTag = '[object Set]',
131606 stringTag = '[object String]',
131607 weakMapTag = '[object WeakMap]';
131608
131609var dataViewTag = '[object DataView]';
131610
131611/**
131612 * Used to match `RegExp`
131613 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
131614 */
131615var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
131616
131617/** Used to detect host constructors (Safari). */
131618var reIsHostCtor = /^\[object .+?Constructor\]$/;
131619
131620/** Used to detect unsigned integer values. */
131621var reIsUint = /^(?:0|[1-9]\d*)$/;
131622
131623/** Used to compose unicode character classes. */
131624var rsAstralRange = '\\ud800-\\udfff',
131625 rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
131626 rsComboSymbolsRange = '\\u20d0-\\u20f0',
131627 rsVarRange = '\\ufe0e\\ufe0f';
131628
131629/** Used to compose unicode capture groups. */
131630var rsAstral = '[' + rsAstralRange + ']',
131631 rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
131632 rsFitz = '\\ud83c[\\udffb-\\udfff]',
131633 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
131634 rsNonAstral = '[^' + rsAstralRange + ']',
131635 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
131636 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
131637 rsZWJ = '\\u200d';
131638
131639/** Used to compose unicode regexes. */
131640var reOptMod = rsModifier + '?',
131641 rsOptVar = '[' + rsVarRange + ']?',
131642 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
131643 rsSeq = rsOptVar + reOptMod + rsOptJoin,
131644 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
131645
131646/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
131647var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
131648
131649/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
131650var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
131651
131652/** Detect free variable `global` from Node.js. */
131653var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
131654
131655/** Detect free variable `self`. */
131656var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
131657
131658/** Used as a reference to the global object. */
131659var root = freeGlobal || freeSelf || Function('return this')();
131660
131661/**
131662 * A specialized version of `_.map` for arrays without support for iteratee
131663 * shorthands.
131664 *
131665 * @private
131666 * @param {Array} [array] The array to iterate over.
131667 * @param {Function} iteratee The function invoked per iteration.
131668 * @returns {Array} Returns the new mapped array.
131669 */
131670function arrayMap(array, iteratee) {
131671 var index = -1,
131672 length = array ? array.length : 0,
131673 result = Array(length);
131674
131675 while (++index < length) {
131676 result[index] = iteratee(array[index], index, array);
131677 }
131678 return result;
131679}
131680
131681/**
131682 * Converts an ASCII `string` to an array.
131683 *
131684 * @private
131685 * @param {string} string The string to convert.
131686 * @returns {Array} Returns the converted array.
131687 */
131688function asciiToArray(string) {
131689 return string.split('');
131690}
131691
131692/**
131693 * The base implementation of `_.times` without support for iteratee shorthands
131694 * or max array length checks.
131695 *
131696 * @private
131697 * @param {number} n The number of times to invoke `iteratee`.
131698 * @param {Function} iteratee The function invoked per iteration.
131699 * @returns {Array} Returns the array of results.
131700 */
131701function baseTimes(n, iteratee) {
131702 var index = -1,
131703 result = Array(n);
131704
131705 while (++index < n) {
131706 result[index] = iteratee(index);
131707 }
131708 return result;
131709}
131710
131711/**
131712 * The base implementation of `_.values` and `_.valuesIn` which creates an
131713 * array of `object` property values corresponding to the property names
131714 * of `props`.
131715 *
131716 * @private
131717 * @param {Object} object The object to query.
131718 * @param {Array} props The property names to get values for.
131719 * @returns {Object} Returns the array of property values.
131720 */
131721function baseValues(object, props) {
131722 return arrayMap(props, function(key) {
131723 return object[key];
131724 });
131725}
131726
131727/**
131728 * Gets the value at `key` of `object`.
131729 *
131730 * @private
131731 * @param {Object} [object] The object to query.
131732 * @param {string} key The key of the property to get.
131733 * @returns {*} Returns the property value.
131734 */
131735function getValue(object, key) {
131736 return object == null ? undefined : object[key];
131737}
131738
131739/**
131740 * Checks if `string` contains Unicode symbols.
131741 *
131742 * @private
131743 * @param {string} string The string to inspect.
131744 * @returns {boolean} Returns `true` if a symbol is found, else `false`.
131745 */
131746function hasUnicode(string) {
131747 return reHasUnicode.test(string);
131748}
131749
131750/**
131751 * Checks if `value` is a host object in IE < 9.
131752 *
131753 * @private
131754 * @param {*} value The value to check.
131755 * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
131756 */
131757function isHostObject(value) {
131758 // Many host objects are `Object` objects that can coerce to strings
131759 // despite having improperly defined `toString` methods.
131760 var result = false;
131761 if (value != null && typeof value.toString != 'function') {
131762 try {
131763 result = !!(value + '');
131764 } catch (e) {}
131765 }
131766 return result;
131767}
131768
131769/**
131770 * Converts `iterator` to an array.
131771 *
131772 * @private
131773 * @param {Object} iterator The iterator to convert.
131774 * @returns {Array} Returns the converted array.
131775 */
131776function iteratorToArray(iterator) {
131777 var data,
131778 result = [];
131779
131780 while (!(data = iterator.next()).done) {
131781 result.push(data.value);
131782 }
131783 return result;
131784}
131785
131786/**
131787 * Converts `map` to its key-value pairs.
131788 *
131789 * @private
131790 * @param {Object} map The map to convert.
131791 * @returns {Array} Returns the key-value pairs.
131792 */
131793function mapToArray(map) {
131794 var index = -1,
131795 result = Array(map.size);
131796
131797 map.forEach(function(value, key) {
131798 result[++index] = [key, value];
131799 });
131800 return result;
131801}
131802
131803/**
131804 * Creates a unary function that invokes `func` with its argument transformed.
131805 *
131806 * @private
131807 * @param {Function} func The function to wrap.
131808 * @param {Function} transform The argument transform.
131809 * @returns {Function} Returns the new function.
131810 */
131811function overArg(func, transform) {
131812 return function(arg) {
131813 return func(transform(arg));
131814 };
131815}
131816
131817/**
131818 * Converts `set` to an array of its values.
131819 *
131820 * @private
131821 * @param {Object} set The set to convert.
131822 * @returns {Array} Returns the values.
131823 */
131824function setToArray(set) {
131825 var index = -1,
131826 result = Array(set.size);
131827
131828 set.forEach(function(value) {
131829 result[++index] = value;
131830 });
131831 return result;
131832}
131833
131834/**
131835 * Converts `string` to an array.
131836 *
131837 * @private
131838 * @param {string} string The string to convert.
131839 * @returns {Array} Returns the converted array.
131840 */
131841function stringToArray(string) {
131842 return hasUnicode(string)
131843 ? unicodeToArray(string)
131844 : asciiToArray(string);
131845}
131846
131847/**
131848 * Converts a Unicode `string` to an array.
131849 *
131850 * @private
131851 * @param {string} string The string to convert.
131852 * @returns {Array} Returns the converted array.
131853 */
131854function unicodeToArray(string) {
131855 return string.match(reUnicode) || [];
131856}
131857
131858/** Used for built-in method references. */
131859var funcProto = Function.prototype,
131860 objectProto = Object.prototype;
131861
131862/** Used to detect overreaching core-js shims. */
131863var coreJsData = root['__core-js_shared__'];
131864
131865/** Used to detect methods masquerading as native. */
131866var maskSrcKey = (function() {
131867 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
131868 return uid ? ('Symbol(src)_1.' + uid) : '';
131869}());
131870
131871/** Used to resolve the decompiled source of functions. */
131872var funcToString = funcProto.toString;
131873
131874/** Used to check objects for own properties. */
131875var hasOwnProperty = objectProto.hasOwnProperty;
131876
131877/**
131878 * Used to resolve the
131879 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
131880 * of values.
131881 */
131882var objectToString = objectProto.toString;
131883
131884/** Used to detect if a method is native. */
131885var reIsNative = RegExp('^' +
131886 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
131887 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
131888);
131889
131890/** Built-in value references. */
131891var Symbol = root.Symbol,
131892 iteratorSymbol = Symbol ? Symbol.iterator : undefined,
131893 propertyIsEnumerable = objectProto.propertyIsEnumerable;
131894
131895/* Built-in method references for those with the same name as other `lodash` methods. */
131896var nativeKeys = overArg(Object.keys, Object);
131897
131898/* Built-in method references that are verified to be native. */
131899var DataView = getNative(root, 'DataView'),
131900 Map = getNative(root, 'Map'),
131901 Promise = getNative(root, 'Promise'),
131902 Set = getNative(root, 'Set'),
131903 WeakMap = getNative(root, 'WeakMap');
131904
131905/** Used to detect maps, sets, and weakmaps. */
131906var dataViewCtorString = toSource(DataView),
131907 mapCtorString = toSource(Map),
131908 promiseCtorString = toSource(Promise),
131909 setCtorString = toSource(Set),
131910 weakMapCtorString = toSource(WeakMap);
131911
131912/**
131913 * Creates an array of the enumerable property names of the array-like `value`.
131914 *
131915 * @private
131916 * @param {*} value The value to query.
131917 * @param {boolean} inherited Specify returning inherited property names.
131918 * @returns {Array} Returns the array of property names.
131919 */
131920function arrayLikeKeys(value, inherited) {
131921 // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
131922 // Safari 9 makes `arguments.length` enumerable in strict mode.
131923 var result = (isArray(value) || isArguments(value))
131924 ? baseTimes(value.length, String)
131925 : [];
131926
131927 var length = result.length,
131928 skipIndexes = !!length;
131929
131930 for (var key in value) {
131931 if ((inherited || hasOwnProperty.call(value, key)) &&
131932 !(skipIndexes && (key == 'length' || isIndex(key, length)))) {
131933 result.push(key);
131934 }
131935 }
131936 return result;
131937}
131938
131939/**
131940 * The base implementation of `getTag`.
131941 *
131942 * @private
131943 * @param {*} value The value to query.
131944 * @returns {string} Returns the `toStringTag`.
131945 */
131946function baseGetTag(value) {
131947 return objectToString.call(value);
131948}
131949
131950/**
131951 * The base implementation of `_.isNative` without bad shim checks.
131952 *
131953 * @private
131954 * @param {*} value The value to check.
131955 * @returns {boolean} Returns `true` if `value` is a native function,
131956 * else `false`.
131957 */
131958function baseIsNative(value) {
131959 if (!isObject(value) || isMasked(value)) {
131960 return false;
131961 }
131962 var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
131963 return pattern.test(toSource(value));
131964}
131965
131966/**
131967 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
131968 *
131969 * @private
131970 * @param {Object} object The object to query.
131971 * @returns {Array} Returns the array of property names.
131972 */
131973function baseKeys(object) {
131974 if (!isPrototype(object)) {
131975 return nativeKeys(object);
131976 }
131977 var result = [];
131978 for (var key in Object(object)) {
131979 if (hasOwnProperty.call(object, key) && key != 'constructor') {
131980 result.push(key);
131981 }
131982 }
131983 return result;
131984}
131985
131986/**
131987 * Copies the values of `source` to `array`.
131988 *
131989 * @private
131990 * @param {Array} source The array to copy values from.
131991 * @param {Array} [array=[]] The array to copy values to.
131992 * @returns {Array} Returns `array`.
131993 */
131994function copyArray(source, array) {
131995 var index = -1,
131996 length = source.length;
131997
131998 array || (array = Array(length));
131999 while (++index < length) {
132000 array[index] = source[index];
132001 }
132002 return array;
132003}
132004
132005/**
132006 * Gets the native function at `key` of `object`.
132007 *
132008 * @private
132009 * @param {Object} object The object to query.
132010 * @param {string} key The key of the method to get.
132011 * @returns {*} Returns the function if it's native, else `undefined`.
132012 */
132013function getNative(object, key) {
132014 var value = getValue(object, key);
132015 return baseIsNative(value) ? value : undefined;
132016}
132017
132018/**
132019 * Gets the `toStringTag` of `value`.
132020 *
132021 * @private
132022 * @param {*} value The value to query.
132023 * @returns {string} Returns the `toStringTag`.
132024 */
132025var getTag = baseGetTag;
132026
132027// Fallback for data views, maps, sets, and weak maps in IE 11,
132028// for data views in Edge < 14, and promises in Node.js.
132029if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
132030 (Map && getTag(new Map) != mapTag) ||
132031 (Promise && getTag(Promise.resolve()) != promiseTag) ||
132032 (Set && getTag(new Set) != setTag) ||
132033 (WeakMap && getTag(new WeakMap) != weakMapTag)) {
132034 getTag = function(value) {
132035 var result = objectToString.call(value),
132036 Ctor = result == objectTag ? value.constructor : undefined,
132037 ctorString = Ctor ? toSource(Ctor) : undefined;
132038
132039 if (ctorString) {
132040 switch (ctorString) {
132041 case dataViewCtorString: return dataViewTag;
132042 case mapCtorString: return mapTag;
132043 case promiseCtorString: return promiseTag;
132044 case setCtorString: return setTag;
132045 case weakMapCtorString: return weakMapTag;
132046 }
132047 }
132048 return result;
132049 };
132050}
132051
132052/**
132053 * Checks if `value` is a valid array-like index.
132054 *
132055 * @private
132056 * @param {*} value The value to check.
132057 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
132058 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
132059 */
132060function isIndex(value, length) {
132061 length = length == null ? MAX_SAFE_INTEGER : length;
132062 return !!length &&
132063 (typeof value == 'number' || reIsUint.test(value)) &&
132064 (value > -1 && value % 1 == 0 && value < length);
132065}
132066
132067/**
132068 * Checks if `func` has its source masked.
132069 *
132070 * @private
132071 * @param {Function} func The function to check.
132072 * @returns {boolean} Returns `true` if `func` is masked, else `false`.
132073 */
132074function isMasked(func) {
132075 return !!maskSrcKey && (maskSrcKey in func);
132076}
132077
132078/**
132079 * Checks if `value` is likely a prototype object.
132080 *
132081 * @private
132082 * @param {*} value The value to check.
132083 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
132084 */
132085function isPrototype(value) {
132086 var Ctor = value && value.constructor,
132087 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
132088
132089 return value === proto;
132090}
132091
132092/**
132093 * Converts `func` to its source code.
132094 *
132095 * @private
132096 * @param {Function} func The function to process.
132097 * @returns {string} Returns the source code.
132098 */
132099function toSource(func) {
132100 if (func != null) {
132101 try {
132102 return funcToString.call(func);
132103 } catch (e) {}
132104 try {
132105 return (func + '');
132106 } catch (e) {}
132107 }
132108 return '';
132109}
132110
132111/**
132112 * Checks if `value` is likely an `arguments` object.
132113 *
132114 * @static
132115 * @memberOf _
132116 * @since 0.1.0
132117 * @category Lang
132118 * @param {*} value The value to check.
132119 * @returns {boolean} Returns `true` if `value` is an `arguments` object,
132120 * else `false`.
132121 * @example
132122 *
132123 * _.isArguments(function() { return arguments; }());
132124 * // => true
132125 *
132126 * _.isArguments([1, 2, 3]);
132127 * // => false
132128 */
132129function isArguments(value) {
132130 // Safari 8.1 makes `arguments.callee` enumerable in strict mode.
132131 return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&
132132 (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);
132133}
132134
132135/**
132136 * Checks if `value` is classified as an `Array` object.
132137 *
132138 * @static
132139 * @memberOf _
132140 * @since 0.1.0
132141 * @category Lang
132142 * @param {*} value The value to check.
132143 * @returns {boolean} Returns `true` if `value` is an array, else `false`.
132144 * @example
132145 *
132146 * _.isArray([1, 2, 3]);
132147 * // => true
132148 *
132149 * _.isArray(document.body.children);
132150 * // => false
132151 *
132152 * _.isArray('abc');
132153 * // => false
132154 *
132155 * _.isArray(_.noop);
132156 * // => false
132157 */
132158var isArray = Array.isArray;
132159
132160/**
132161 * Checks if `value` is array-like. A value is considered array-like if it's
132162 * not a function and has a `value.length` that's an integer greater than or
132163 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
132164 *
132165 * @static
132166 * @memberOf _
132167 * @since 4.0.0
132168 * @category Lang
132169 * @param {*} value The value to check.
132170 * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
132171 * @example
132172 *
132173 * _.isArrayLike([1, 2, 3]);
132174 * // => true
132175 *
132176 * _.isArrayLike(document.body.children);
132177 * // => true
132178 *
132179 * _.isArrayLike('abc');
132180 * // => true
132181 *
132182 * _.isArrayLike(_.noop);
132183 * // => false
132184 */
132185function isArrayLike(value) {
132186 return value != null && isLength(value.length) && !isFunction(value);
132187}
132188
132189/**
132190 * This method is like `_.isArrayLike` except that it also checks if `value`
132191 * is an object.
132192 *
132193 * @static
132194 * @memberOf _
132195 * @since 4.0.0
132196 * @category Lang
132197 * @param {*} value The value to check.
132198 * @returns {boolean} Returns `true` if `value` is an array-like object,
132199 * else `false`.
132200 * @example
132201 *
132202 * _.isArrayLikeObject([1, 2, 3]);
132203 * // => true
132204 *
132205 * _.isArrayLikeObject(document.body.children);
132206 * // => true
132207 *
132208 * _.isArrayLikeObject('abc');
132209 * // => false
132210 *
132211 * _.isArrayLikeObject(_.noop);
132212 * // => false
132213 */
132214function isArrayLikeObject(value) {
132215 return isObjectLike(value) && isArrayLike(value);
132216}
132217
132218/**
132219 * Checks if `value` is classified as a `Function` object.
132220 *
132221 * @static
132222 * @memberOf _
132223 * @since 0.1.0
132224 * @category Lang
132225 * @param {*} value The value to check.
132226 * @returns {boolean} Returns `true` if `value` is a function, else `false`.
132227 * @example
132228 *
132229 * _.isFunction(_);
132230 * // => true
132231 *
132232 * _.isFunction(/abc/);
132233 * // => false
132234 */
132235function isFunction(value) {
132236 // The use of `Object#toString` avoids issues with the `typeof` operator
132237 // in Safari 8-9 which returns 'object' for typed array and other constructors.
132238 var tag = isObject(value) ? objectToString.call(value) : '';
132239 return tag == funcTag || tag == genTag;
132240}
132241
132242/**
132243 * Checks if `value` is a valid array-like length.
132244 *
132245 * **Note:** This method is loosely based on
132246 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
132247 *
132248 * @static
132249 * @memberOf _
132250 * @since 4.0.0
132251 * @category Lang
132252 * @param {*} value The value to check.
132253 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
132254 * @example
132255 *
132256 * _.isLength(3);
132257 * // => true
132258 *
132259 * _.isLength(Number.MIN_VALUE);
132260 * // => false
132261 *
132262 * _.isLength(Infinity);
132263 * // => false
132264 *
132265 * _.isLength('3');
132266 * // => false
132267 */
132268function isLength(value) {
132269 return typeof value == 'number' &&
132270 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
132271}
132272
132273/**
132274 * Checks if `value` is the
132275 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
132276 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
132277 *
132278 * @static
132279 * @memberOf _
132280 * @since 0.1.0
132281 * @category Lang
132282 * @param {*} value The value to check.
132283 * @returns {boolean} Returns `true` if `value` is an object, else `false`.
132284 * @example
132285 *
132286 * _.isObject({});
132287 * // => true
132288 *
132289 * _.isObject([1, 2, 3]);
132290 * // => true
132291 *
132292 * _.isObject(_.noop);
132293 * // => true
132294 *
132295 * _.isObject(null);
132296 * // => false
132297 */
132298function isObject(value) {
132299 var type = typeof value;
132300 return !!value && (type == 'object' || type == 'function');
132301}
132302
132303/**
132304 * Checks if `value` is object-like. A value is object-like if it's not `null`
132305 * and has a `typeof` result of "object".
132306 *
132307 * @static
132308 * @memberOf _
132309 * @since 4.0.0
132310 * @category Lang
132311 * @param {*} value The value to check.
132312 * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
132313 * @example
132314 *
132315 * _.isObjectLike({});
132316 * // => true
132317 *
132318 * _.isObjectLike([1, 2, 3]);
132319 * // => true
132320 *
132321 * _.isObjectLike(_.noop);
132322 * // => false
132323 *
132324 * _.isObjectLike(null);
132325 * // => false
132326 */
132327function isObjectLike(value) {
132328 return !!value && typeof value == 'object';
132329}
132330
132331/**
132332 * Checks if `value` is classified as a `String` primitive or object.
132333 *
132334 * @static
132335 * @since 0.1.0
132336 * @memberOf _
132337 * @category Lang
132338 * @param {*} value The value to check.
132339 * @returns {boolean} Returns `true` if `value` is a string, else `false`.
132340 * @example
132341 *
132342 * _.isString('abc');
132343 * // => true
132344 *
132345 * _.isString(1);
132346 * // => false
132347 */
132348function isString(value) {
132349 return typeof value == 'string' ||
132350 (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag);
132351}
132352
132353/**
132354 * Converts `value` to an array.
132355 *
132356 * @static
132357 * @since 0.1.0
132358 * @memberOf _
132359 * @category Lang
132360 * @param {*} value The value to convert.
132361 * @returns {Array} Returns the converted array.
132362 * @example
132363 *
132364 * _.toArray({ 'a': 1, 'b': 2 });
132365 * // => [1, 2]
132366 *
132367 * _.toArray('abc');
132368 * // => ['a', 'b', 'c']
132369 *
132370 * _.toArray(1);
132371 * // => []
132372 *
132373 * _.toArray(null);
132374 * // => []
132375 */
132376function toArray(value) {
132377 if (!value) {
132378 return [];
132379 }
132380 if (isArrayLike(value)) {
132381 return isString(value) ? stringToArray(value) : copyArray(value);
132382 }
132383 if (iteratorSymbol && value[iteratorSymbol]) {
132384 return iteratorToArray(value[iteratorSymbol]());
132385 }
132386 var tag = getTag(value),
132387 func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);
132388
132389 return func(value);
132390}
132391
132392/**
132393 * Creates an array of the own enumerable property names of `object`.
132394 *
132395 * **Note:** Non-object values are coerced to objects. See the
132396 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
132397 * for more details.
132398 *
132399 * @static
132400 * @since 0.1.0
132401 * @memberOf _
132402 * @category Object
132403 * @param {Object} object The object to query.
132404 * @returns {Array} Returns the array of property names.
132405 * @example
132406 *
132407 * function Foo() {
132408 * this.a = 1;
132409 * this.b = 2;
132410 * }
132411 *
132412 * Foo.prototype.c = 3;
132413 *
132414 * _.keys(new Foo);
132415 * // => ['a', 'b'] (iteration order is not guaranteed)
132416 *
132417 * _.keys('hi');
132418 * // => ['0', '1']
132419 */
132420function keys(object) {
132421 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
132422}
132423
132424/**
132425 * Creates an array of the own enumerable string keyed property values of `object`.
132426 *
132427 * **Note:** Non-object values are coerced to objects.
132428 *
132429 * @static
132430 * @since 0.1.0
132431 * @memberOf _
132432 * @category Object
132433 * @param {Object} object The object to query.
132434 * @returns {Array} Returns the array of property values.
132435 * @example
132436 *
132437 * function Foo() {
132438 * this.a = 1;
132439 * this.b = 2;
132440 * }
132441 *
132442 * Foo.prototype.c = 3;
132443 *
132444 * _.values(new Foo);
132445 * // => [1, 2] (iteration order is not guaranteed)
132446 *
132447 * _.values('hi');
132448 * // => ['h', 'i']
132449 */
132450function values(object) {
132451 return object ? baseValues(object, keys(object)) : [];
132452}
132453
132454module.exports = toArray;
132455
132456
132457/***/ }),
132458/* 822 */
132459/***/ (function(module, exports, __webpack_require__) {
132460
132461var crypto = __webpack_require__(21)
132462var max = Math.pow(2, 32)
132463
132464module.exports = random
132465module.exports.cryptographic = true
132466
132467function random () {
132468 var buf = crypto
132469 .randomBytes(4)
132470 .toString('hex')
132471
132472 return parseInt(buf, 16) / max
132473}
132474
132475
132476/***/ }),
132477/* 823 */
132478/***/ (function(module, exports, __webpack_require__) {
132479
132480"use strict";
132481
132482
132483var chars = {}, unesc, temp;
132484
132485function reverse(object, prepender) {
132486 return Object.keys(object).reduce(function(reversed, key) {
132487 var newKey = prepender ? prepender + key : key; // Optionally prepend a string to key.
132488 reversed[object[key]] = newKey; // Swap key and value.
132489 return reversed; // Return the result.
132490 }, {});
132491}
132492
132493/**
132494 * Regex for common characters
132495 */
132496
132497chars.escapeRegex = {
132498 '?': /\?/g,
132499 '@': /\@/g,
132500 '!': /\!/g,
132501 '+': /\+/g,
132502 '*': /\*/g,
132503 '(': /\(/g,
132504 ')': /\)/g,
132505 '[': /\[/g,
132506 ']': /\]/g
132507};
132508
132509/**
132510 * Escape characters
132511 */
132512
132513chars.ESC = {
132514 '?': '__UNESC_QMRK__',
132515 '@': '__UNESC_AMPE__',
132516 '!': '__UNESC_EXCL__',
132517 '+': '__UNESC_PLUS__',
132518 '*': '__UNESC_STAR__',
132519 ',': '__UNESC_COMMA__',
132520 '(': '__UNESC_LTPAREN__',
132521 ')': '__UNESC_RTPAREN__',
132522 '[': '__UNESC_LTBRACK__',
132523 ']': '__UNESC_RTBRACK__'
132524};
132525
132526/**
132527 * Unescape characters
132528 */
132529
132530chars.UNESC = unesc || (unesc = reverse(chars.ESC, '\\'));
132531
132532chars.ESC_TEMP = {
132533 '?': '__TEMP_QMRK__',
132534 '@': '__TEMP_AMPE__',
132535 '!': '__TEMP_EXCL__',
132536 '*': '__TEMP_STAR__',
132537 '+': '__TEMP_PLUS__',
132538 ',': '__TEMP_COMMA__',
132539 '(': '__TEMP_LTPAREN__',
132540 ')': '__TEMP_RTPAREN__',
132541 '[': '__TEMP_LTBRACK__',
132542 ']': '__TEMP_RTBRACK__'
132543};
132544
132545chars.TEMP = temp || (temp = reverse(chars.ESC_TEMP));
132546
132547module.exports = chars;
132548
132549
132550/***/ }),
132551/* 824 */
132552/***/ (function(module, exports, __webpack_require__) {
132553
132554"use strict";
132555/*!
132556 * micromatch <https://github.com/jonschlinkert/micromatch>
132557 *
132558 * Copyright (c) 2014-2015, Jon Schlinkert.
132559 * Licensed under the MIT License.
132560 */
132561
132562
132563
132564var utils = __webpack_require__(240);
132565var Glob = __webpack_require__(825);
132566
132567/**
132568 * Expose `expand`
132569 */
132570
132571module.exports = expand;
132572
132573/**
132574 * Expand a glob pattern to resolve braces and
132575 * similar patterns before converting to regex.
132576 *
132577 * @param {String|Array} `pattern`
132578 * @param {Array} `files`
132579 * @param {Options} `opts`
132580 * @return {Array}
132581 */
132582
132583function expand(pattern, options) {
132584 if (typeof pattern !== 'string') {
132585 throw new TypeError('micromatch.expand(): argument should be a string.');
132586 }
132587
132588 var glob = new Glob(pattern, options || {});
132589 var opts = glob.options;
132590
132591 if (!utils.isGlob(pattern)) {
132592 glob.pattern = glob.pattern.replace(/([\/.])/g, '\\$1');
132593 return glob;
132594 }
132595
132596 glob.pattern = glob.pattern.replace(/(\+)(?!\()/g, '\\$1');
132597 glob.pattern = glob.pattern.split('$').join('\\$');
132598
132599 if (typeof opts.braces !== 'boolean' && typeof opts.nobraces !== 'boolean') {
132600 opts.braces = true;
132601 }
132602
132603 if (glob.pattern === '.*') {
132604 return {
132605 pattern: '\\.' + star,
132606 tokens: tok,
132607 options: opts
132608 };
132609 }
132610
132611 if (glob.pattern === '*') {
132612 return {
132613 pattern: oneStar(opts.dot),
132614 tokens: tok,
132615 options: opts
132616 };
132617 }
132618
132619 // parse the glob pattern into tokens
132620 glob.parse();
132621 var tok = glob.tokens;
132622 tok.is.negated = opts.negated;
132623
132624 // dotfile handling
132625 if ((opts.dotfiles === true || tok.is.dotfile) && opts.dot !== false) {
132626 opts.dotfiles = true;
132627 opts.dot = true;
132628 }
132629
132630 if ((opts.dotdirs === true || tok.is.dotdir) && opts.dot !== false) {
132631 opts.dotdirs = true;
132632 opts.dot = true;
132633 }
132634
132635 // check for braces with a dotfile pattern
132636 if (/[{,]\./.test(glob.pattern)) {
132637 opts.makeRe = false;
132638 opts.dot = true;
132639 }
132640
132641 if (opts.nonegate !== true) {
132642 opts.negated = glob.negated;
132643 }
132644
132645 // if the leading character is a dot or a slash, escape it
132646 if (glob.pattern.charAt(0) === '.' && glob.pattern.charAt(1) !== '/') {
132647 glob.pattern = '\\' + glob.pattern;
132648 }
132649
132650 /**
132651 * Extended globs
132652 */
132653
132654 // expand braces, e.g `{1..5}`
132655 glob.track('before braces');
132656 if (tok.is.braces) {
132657 glob.braces();
132658 }
132659 glob.track('after braces');
132660
132661 // expand extglobs, e.g `foo/!(a|b)`
132662 glob.track('before extglob');
132663 if (tok.is.extglob) {
132664 glob.extglob();
132665 }
132666 glob.track('after extglob');
132667
132668 // expand brackets, e.g `[[:alpha:]]`
132669 glob.track('before brackets');
132670 if (tok.is.brackets) {
132671 glob.brackets();
132672 }
132673 glob.track('after brackets');
132674
132675 // special patterns
132676 glob._replace('[!', '[^');
132677 glob._replace('(?', '(%~');
132678 glob._replace(/\[\]/, '\\[\\]');
132679 glob._replace('/[', '/' + (opts.dot ? dotfiles : nodot) + '[', true);
132680 glob._replace('/?', '/' + (opts.dot ? dotfiles : nodot) + '[^/]', true);
132681 glob._replace('/.', '/(?=.)\\.', true);
132682
132683 // windows drives
132684 glob._replace(/^(\w):([\\\/]+?)/gi, '(?=.)$1:$2', true);
132685
132686 // negate slashes in exclusion ranges
132687 if (glob.pattern.indexOf('[^') !== -1) {
132688 glob.pattern = negateSlash(glob.pattern);
132689 }
132690
132691 if (opts.globstar !== false && glob.pattern === '**') {
132692 glob.pattern = globstar(opts.dot);
132693
132694 } else {
132695 glob.pattern = balance(glob.pattern, '[', ']');
132696 glob.escape(glob.pattern);
132697
132698 // if the pattern has `**`
132699 if (tok.is.globstar) {
132700 glob.pattern = collapse(glob.pattern, '/**');
132701 glob.pattern = collapse(glob.pattern, '**/');
132702 glob._replace('/**/', '(?:/' + globstar(opts.dot) + '/|/)', true);
132703 glob._replace(/\*{2,}/g, '**');
132704
132705 // 'foo/*'
132706 glob._replace(/(\w+)\*(?!\/)/g, '$1[^/]*?', true);
132707 glob._replace(/\*\*\/\*(\w)/g, globstar(opts.dot) + '\\/' + (opts.dot ? dotfiles : nodot) + '[^/]*?$1', true);
132708
132709 if (opts.dot !== true) {
132710 glob._replace(/\*\*\/(.)/g, '(?:**\\/|)$1');
132711 }
132712
132713 // 'foo/**' or '{**,*}', but not 'foo**'
132714 if (tok.path.dirname !== '' || /,\*\*|\*\*,/.test(glob.orig)) {
132715 glob._replace('**', globstar(opts.dot), true);
132716 }
132717 }
132718
132719 // ends with /*
132720 glob._replace(/\/\*$/, '\\/' + oneStar(opts.dot), true);
132721 // ends with *, no slashes
132722 glob._replace(/(?!\/)\*$/, star, true);
132723 // has 'n*.' (partial wildcard w/ file extension)
132724 glob._replace(/([^\/]+)\*/, '$1' + oneStar(true), true);
132725 // has '*'
132726 glob._replace('*', oneStar(opts.dot), true);
132727 glob._replace('?.', '?\\.', true);
132728 glob._replace('?:', '?:', true);
132729
132730 glob._replace(/\?+/g, function(match) {
132731 var len = match.length;
132732 if (len === 1) {
132733 return qmark;
132734 }
132735 return qmark + '{' + len + '}';
132736 });
132737
132738 // escape '.abc' => '\\.abc'
132739 glob._replace(/\.([*\w]+)/g, '\\.$1');
132740 // fix '[^\\\\/]'
132741 glob._replace(/\[\^[\\\/]+\]/g, qmark);
132742 // '///' => '\/'
132743 glob._replace(/\/+/g, '\\/');
132744 // '\\\\\\' => '\\'
132745 glob._replace(/\\{2,}/g, '\\');
132746 }
132747
132748 // unescape previously escaped patterns
132749 glob.unescape(glob.pattern);
132750 glob._replace('__UNESC_STAR__', '*');
132751
132752 // escape dots that follow qmarks
132753 glob._replace('?.', '?\\.');
132754
132755 // remove unnecessary slashes in character classes
132756 glob._replace('[^\\/]', qmark);
132757
132758 if (glob.pattern.length > 1) {
132759 if (/^[\[?*]/.test(glob.pattern)) {
132760 // only prepend the string if we don't want to match dotfiles
132761 glob.pattern = (opts.dot ? dotfiles : nodot) + glob.pattern;
132762 }
132763 }
132764
132765 return glob;
132766}
132767
132768/**
132769 * Collapse repeated character sequences.
132770 *
132771 * ```js
132772 * collapse('a/../../../b', '../');
132773 * //=> 'a/../b'
132774 * ```
132775 *
132776 * @param {String} `str`
132777 * @param {String} `ch` Character sequence to collapse
132778 * @return {String}
132779 */
132780
132781function collapse(str, ch) {
132782 var res = str.split(ch);
132783 var isFirst = res[0] === '';
132784 var isLast = res[res.length - 1] === '';
132785 res = res.filter(Boolean);
132786 if (isFirst) res.unshift('');
132787 if (isLast) res.push('');
132788 return res.join(ch);
132789}
132790
132791/**
132792 * Negate slashes in exclusion ranges, per glob spec:
132793 *
132794 * ```js
132795 * negateSlash('[^foo]');
132796 * //=> '[^\\/foo]'
132797 * ```
132798 *
132799 * @param {String} `str` glob pattern
132800 * @return {String}
132801 */
132802
132803function negateSlash(str) {
132804 return str.replace(/\[\^([^\]]*?)\]/g, function(match, inner) {
132805 if (inner.indexOf('/') === -1) {
132806 inner = '\\/' + inner;
132807 }
132808 return '[^' + inner + ']';
132809 });
132810}
132811
132812/**
132813 * Escape imbalanced braces/bracket. This is a very
132814 * basic, naive implementation that only does enough
132815 * to serve the purpose.
132816 */
132817
132818function balance(str, a, b) {
132819 var aarr = str.split(a);
132820 var alen = aarr.join('').length;
132821 var blen = str.split(b).join('').length;
132822
132823 if (alen !== blen) {
132824 str = aarr.join('\\' + a);
132825 return str.split(b).join('\\' + b);
132826 }
132827 return str;
132828}
132829
132830/**
132831 * Special patterns to be converted to regex.
132832 * Heuristics are used to simplify patterns
132833 * and speed up processing.
132834 */
132835
132836/* eslint no-multi-spaces: 0 */
132837var qmark = '[^/]';
132838var star = qmark + '*?';
132839var nodot = '(?!\\.)(?=.)';
132840var dotfileGlob = '(?:\\/|^)\\.{1,2}($|\\/)';
132841var dotfiles = '(?!' + dotfileGlob + ')(?=.)';
132842var twoStarDot = '(?:(?!' + dotfileGlob + ').)*?';
132843
132844/**
132845 * Create a regex for `*`.
132846 *
132847 * If `dot` is true, or the pattern does not begin with
132848 * a leading star, then return the simpler regex.
132849 */
132850
132851function oneStar(dotfile) {
132852 return dotfile ? '(?!' + dotfileGlob + ')(?=.)' + star : (nodot + star);
132853}
132854
132855function globstar(dotfile) {
132856 if (dotfile) { return twoStarDot; }
132857 return '(?:(?!(?:\\/|^)\\.).)*?';
132858}
132859
132860
132861/***/ }),
132862/* 825 */
132863/***/ (function(module, exports, __webpack_require__) {
132864
132865"use strict";
132866
132867
132868var chars = __webpack_require__(823);
132869var utils = __webpack_require__(240);
132870
132871/**
132872 * Expose `Glob`
132873 */
132874
132875var Glob = module.exports = function Glob(pattern, options) {
132876 if (!(this instanceof Glob)) {
132877 return new Glob(pattern, options);
132878 }
132879 this.options = options || {};
132880 this.pattern = pattern;
132881 this.history = [];
132882 this.tokens = {};
132883 this.init(pattern);
132884};
132885
132886/**
132887 * Initialize defaults
132888 */
132889
132890Glob.prototype.init = function(pattern) {
132891 this.orig = pattern;
132892 this.negated = this.isNegated();
132893 this.options.track = this.options.track || false;
132894 this.options.makeRe = true;
132895};
132896
132897/**
132898 * Push a change into `glob.history`. Useful
132899 * for debugging.
132900 */
132901
132902Glob.prototype.track = function(msg) {
132903 if (this.options.track) {
132904 this.history.push({msg: msg, pattern: this.pattern});
132905 }
132906};
132907
132908/**
132909 * Return true if `glob.pattern` was negated
132910 * with `!`, also remove the `!` from the pattern.
132911 *
132912 * @return {Boolean}
132913 */
132914
132915Glob.prototype.isNegated = function() {
132916 if (this.pattern.charCodeAt(0) === 33 /* '!' */) {
132917 this.pattern = this.pattern.slice(1);
132918 return true;
132919 }
132920 return false;
132921};
132922
132923/**
132924 * Expand braces in the given glob pattern.
132925 *
132926 * We only need to use the [braces] lib when
132927 * patterns are nested.
132928 */
132929
132930Glob.prototype.braces = function() {
132931 if (this.options.nobraces !== true && this.options.nobrace !== true) {
132932 // naive/fast check for imbalanced characters
132933 var a = this.pattern.match(/[\{\(\[]/g);
132934 var b = this.pattern.match(/[\}\)\]]/g);
132935
132936 // if imbalanced, don't optimize the pattern
132937 if (a && b && (a.length !== b.length)) {
132938 this.options.makeRe = false;
132939 }
132940
132941 // expand brace patterns and join the resulting array
132942 var expanded = utils.braces(this.pattern, this.options);
132943 this.pattern = expanded.join('|');
132944 }
132945};
132946
132947/**
132948 * Expand bracket expressions in `glob.pattern`
132949 */
132950
132951Glob.prototype.brackets = function() {
132952 if (this.options.nobrackets !== true) {
132953 this.pattern = utils.brackets(this.pattern);
132954 }
132955};
132956
132957/**
132958 * Expand bracket expressions in `glob.pattern`
132959 */
132960
132961Glob.prototype.extglob = function() {
132962 if (this.options.noextglob === true) return;
132963
132964 if (utils.isExtglob(this.pattern)) {
132965 this.pattern = utils.extglob(this.pattern, {escape: true});
132966 }
132967};
132968
132969/**
132970 * Parse the given pattern
132971 */
132972
132973Glob.prototype.parse = function(pattern) {
132974 this.tokens = utils.parseGlob(pattern || this.pattern, true);
132975 return this.tokens;
132976};
132977
132978/**
132979 * Replace `a` with `b`. Also tracks the change before and
132980 * after each replacement. This is disabled by default, but
132981 * can be enabled by setting `options.track` to true.
132982 *
132983 * Also, when the pattern is a string, `.split()` is used,
132984 * because it's much faster than replace.
132985 *
132986 * @param {RegExp|String} `a`
132987 * @param {String} `b`
132988 * @param {Boolean} `escape` When `true`, escapes `*` and `?` in the replacement.
132989 * @return {String}
132990 */
132991
132992Glob.prototype._replace = function(a, b, escape) {
132993 this.track('before (find): "' + a + '" (replace with): "' + b + '"');
132994 if (escape) b = esc(b);
132995 if (a && b && typeof a === 'string') {
132996 this.pattern = this.pattern.split(a).join(b);
132997 } else {
132998 this.pattern = this.pattern.replace(a, b);
132999 }
133000 this.track('after');
133001};
133002
133003/**
133004 * Escape special characters in the given string.
133005 *
133006 * @param {String} `str` Glob pattern
133007 * @return {String}
133008 */
133009
133010Glob.prototype.escape = function(str) {
133011 this.track('before escape: ');
133012 var re = /["\\](['"]?[^"'\\]['"]?)/g;
133013
133014 this.pattern = str.replace(re, function($0, $1) {
133015 var o = chars.ESC;
133016 var ch = o && o[$1];
133017 if (ch) {
133018 return ch;
133019 }
133020 if (/[a-z]/i.test($0)) {
133021 return $0.split('\\').join('');
133022 }
133023 return $0;
133024 });
133025
133026 this.track('after escape: ');
133027};
133028
133029/**
133030 * Unescape special characters in the given string.
133031 *
133032 * @param {String} `str`
133033 * @return {String}
133034 */
133035
133036Glob.prototype.unescape = function(str) {
133037 var re = /__([A-Z]+)_([A-Z]+)__/g;
133038 this.pattern = str.replace(re, function($0, $1) {
133039 return chars[$1][$0];
133040 });
133041 this.pattern = unesc(this.pattern);
133042};
133043
133044/**
133045 * Escape/unescape utils
133046 */
133047
133048function esc(str) {
133049 str = str.split('?').join('%~');
133050 str = str.split('*').join('%%');
133051 return str;
133052}
133053
133054function unesc(str) {
133055 str = str.split('%~').join('?');
133056 str = str.split('%%').join('*');
133057 return str;
133058}
133059
133060
133061/***/ }),
133062/* 826 */
133063/***/ (function(module, exports, __webpack_require__) {
133064
133065"use strict";
133066/*!
133067 * arr-diff <https://github.com/jonschlinkert/arr-diff>
133068 *
133069 * Copyright (c) 2014 Jon Schlinkert, contributors.
133070 * Licensed under the MIT License
133071 */
133072
133073
133074
133075var flatten = __webpack_require__(451);
133076var slice = [].slice;
133077
133078/**
133079 * Return the difference between the first array and
133080 * additional arrays.
133081 *
133082 * ```js
133083 * var diff = require('{%= name %}');
133084 *
133085 * var a = ['a', 'b', 'c', 'd'];
133086 * var b = ['b', 'c'];
133087 *
133088 * console.log(diff(a, b))
133089 * //=> ['a', 'd']
133090 * ```
133091 *
133092 * @param {Array} `a`
133093 * @param {Array} `b`
133094 * @return {Array}
133095 * @api public
133096 */
133097
133098function diff(arr, arrays) {
133099 var argsLen = arguments.length;
133100 var len = arr.length, i = -1;
133101 var res = [], arrays;
133102
133103 if (argsLen === 1) {
133104 return arr;
133105 }
133106
133107 if (argsLen > 2) {
133108 arrays = flatten(slice.call(arguments, 1));
133109 }
133110
133111 while (++i < len) {
133112 if (!~arrays.indexOf(arr[i])) {
133113 res.push(arr[i]);
133114 }
133115 }
133116 return res;
133117}
133118
133119/**
133120 * Expose `diff`
133121 */
133122
133123module.exports = diff;
133124
133125
133126/***/ }),
133127/* 827 */
133128/***/ (function(module, exports, __webpack_require__) {
133129
133130"use strict";
133131/*!
133132 * array-unique <https://github.com/jonschlinkert/array-unique>
133133 *
133134 * Copyright (c) 2014-2015, Jon Schlinkert.
133135 * Licensed under the MIT License.
133136 */
133137
133138
133139
133140module.exports = function unique(arr) {
133141 if (!Array.isArray(arr)) {
133142 throw new TypeError('array-unique expects an array.');
133143 }
133144
133145 var len = arr.length;
133146 var i = -1;
133147
133148 while (i++ < len) {
133149 var j = i + 1;
133150
133151 for (; j < arr.length; ++j) {
133152 if (arr[i] === arr[j]) {
133153 arr.splice(j--, 1);
133154 }
133155 }
133156 }
133157 return arr;
133158};
133159
133160
133161/***/ }),
133162/* 828 */
133163/***/ (function(module, exports, __webpack_require__) {
133164
133165"use strict";
133166/*!
133167 * braces <https://github.com/jonschlinkert/braces>
133168 *
133169 * Copyright (c) 2014-2015, Jon Schlinkert.
133170 * Licensed under the MIT license.
133171 */
133172
133173
133174
133175/**
133176 * Module dependencies
133177 */
133178
133179var expand = __webpack_require__(664);
133180var repeat = __webpack_require__(381);
133181var tokens = __webpack_require__(850);
133182
133183/**
133184 * Expose `braces`
133185 */
133186
133187module.exports = function(str, options) {
133188 if (typeof str !== 'string') {
133189 throw new Error('braces expects a string');
133190 }
133191 return braces(str, options);
133192};
133193
133194/**
133195 * Expand `{foo,bar}` or `{1..5}` braces in the
133196 * given `string`.
133197 *
133198 * @param {String} `str`
133199 * @param {Array} `arr`
133200 * @param {Object} `options`
133201 * @return {Array}
133202 */
133203
133204function braces(str, arr, options) {
133205 if (str === '') {
133206 return [];
133207 }
133208
133209 if (!Array.isArray(arr)) {
133210 options = arr;
133211 arr = [];
133212 }
133213
133214 var opts = options || {};
133215 arr = arr || [];
133216
133217 if (typeof opts.nodupes === 'undefined') {
133218 opts.nodupes = true;
133219 }
133220
133221 var fn = opts.fn;
133222 var es6;
133223
133224 if (typeof opts === 'function') {
133225 fn = opts;
133226 opts = {};
133227 }
133228
133229 if (!(patternRe instanceof RegExp)) {
133230 patternRe = patternRegex();
133231 }
133232
133233 var matches = str.match(patternRe) || [];
133234 var m = matches[0];
133235
133236 switch(m) {
133237 case '\\,':
133238 return escapeCommas(str, arr, opts);
133239 case '\\.':
133240 return escapeDots(str, arr, opts);
133241 case '\/.':
133242 return escapePaths(str, arr, opts);
133243 case ' ':
133244 return splitWhitespace(str);
133245 case '{,}':
133246 return exponential(str, opts, braces);
133247 case '{}':
133248 return emptyBraces(str, arr, opts);
133249 case '\\{':
133250 case '\\}':
133251 return escapeBraces(str, arr, opts);
133252 case '${':
133253 if (!/\{[^{]+\{/.test(str)) {
133254 return arr.concat(str);
133255 } else {
133256 es6 = true;
133257 str = tokens.before(str, es6Regex());
133258 }
133259 }
133260
133261 if (!(braceRe instanceof RegExp)) {
133262 braceRe = braceRegex();
133263 }
133264
133265 var match = braceRe.exec(str);
133266 if (match == null) {
133267 return [str];
133268 }
133269
133270 var outter = match[1];
133271 var inner = match[2];
133272 if (inner === '') { return [str]; }
133273
133274 var segs, segsLength;
133275
133276 if (inner.indexOf('..') !== -1) {
133277 segs = expand(inner, opts, fn) || inner.split(',');
133278 segsLength = segs.length;
133279
133280 } else if (inner[0] === '"' || inner[0] === '\'') {
133281 return arr.concat(str.split(/['"]/).join(''));
133282
133283 } else {
133284 segs = inner.split(',');
133285 if (opts.makeRe) {
133286 return braces(str.replace(outter, wrap(segs, '|')), opts);
133287 }
133288
133289 segsLength = segs.length;
133290 if (segsLength === 1 && opts.bash) {
133291 segs[0] = wrap(segs[0], '\\');
133292 }
133293 }
133294
133295 var len = segs.length;
133296 var i = 0, val;
133297
133298 while (len--) {
133299 var path = segs[i++];
133300
133301 if (/(\.[^.\/])/.test(path)) {
133302 if (segsLength > 1) {
133303 return segs;
133304 } else {
133305 return [str];
133306 }
133307 }
133308
133309 val = splice(str, outter, path);
133310
133311 if (/\{[^{}]+?\}/.test(val)) {
133312 arr = braces(val, arr, opts);
133313 } else if (val !== '') {
133314 if (opts.nodupes && arr.indexOf(val) !== -1) { continue; }
133315 arr.push(es6 ? tokens.after(val) : val);
133316 }
133317 }
133318
133319 if (opts.strict) { return filter(arr, filterEmpty); }
133320 return arr;
133321}
133322
133323/**
133324 * Expand exponential ranges
133325 *
133326 * `a{,}{,}` => ['a', 'a', 'a', 'a']
133327 */
133328
133329function exponential(str, options, fn) {
133330 if (typeof options === 'function') {
133331 fn = options;
133332 options = null;
133333 }
133334
133335 var opts = options || {};
133336 var esc = '__ESC_EXP__';
133337 var exp = 0;
133338 var res;
133339
133340 var parts = str.split('{,}');
133341 if (opts.nodupes) {
133342 return fn(parts.join(''), opts);
133343 }
133344
133345 exp = parts.length - 1;
133346 res = fn(parts.join(esc), opts);
133347 var len = res.length;
133348 var arr = [];
133349 var i = 0;
133350
133351 while (len--) {
133352 var ele = res[i++];
133353 var idx = ele.indexOf(esc);
133354
133355 if (idx === -1) {
133356 arr.push(ele);
133357
133358 } else {
133359 ele = ele.split('__ESC_EXP__').join('');
133360 if (!!ele && opts.nodupes !== false) {
133361 arr.push(ele);
133362
133363 } else {
133364 var num = Math.pow(2, exp);
133365 arr.push.apply(arr, repeat(ele, num));
133366 }
133367 }
133368 }
133369 return arr;
133370}
133371
133372/**
133373 * Wrap a value with parens, brackets or braces,
133374 * based on the given character/separator.
133375 *
133376 * @param {String|Array} `val`
133377 * @param {String} `ch`
133378 * @return {String}
133379 */
133380
133381function wrap(val, ch) {
133382 if (ch === '|') {
133383 return '(' + val.join(ch) + ')';
133384 }
133385 if (ch === ',') {
133386 return '{' + val.join(ch) + '}';
133387 }
133388 if (ch === '-') {
133389 return '[' + val.join(ch) + ']';
133390 }
133391 if (ch === '\\') {
133392 return '\\{' + val + '\\}';
133393 }
133394}
133395
133396/**
133397 * Handle empty braces: `{}`
133398 */
133399
133400function emptyBraces(str, arr, opts) {
133401 return braces(str.split('{}').join('\\{\\}'), arr, opts);
133402}
133403
133404/**
133405 * Filter out empty-ish values
133406 */
133407
133408function filterEmpty(ele) {
133409 return !!ele && ele !== '\\';
133410}
133411
133412/**
133413 * Handle patterns with whitespace
133414 */
133415
133416function splitWhitespace(str) {
133417 var segs = str.split(' ');
133418 var len = segs.length;
133419 var res = [];
133420 var i = 0;
133421
133422 while (len--) {
133423 res.push.apply(res, braces(segs[i++]));
133424 }
133425 return res;
133426}
133427
133428/**
133429 * Handle escaped braces: `\\{foo,bar}`
133430 */
133431
133432function escapeBraces(str, arr, opts) {
133433 if (!/\{[^{]+\{/.test(str)) {
133434 return arr.concat(str.split('\\').join(''));
133435 } else {
133436 str = str.split('\\{').join('__LT_BRACE__');
133437 str = str.split('\\}').join('__RT_BRACE__');
133438 return map(braces(str, arr, opts), function(ele) {
133439 ele = ele.split('__LT_BRACE__').join('{');
133440 return ele.split('__RT_BRACE__').join('}');
133441 });
133442 }
133443}
133444
133445/**
133446 * Handle escaped dots: `{1\\.2}`
133447 */
133448
133449function escapeDots(str, arr, opts) {
133450 if (!/[^\\]\..+\\\./.test(str)) {
133451 return arr.concat(str.split('\\').join(''));
133452 } else {
133453 str = str.split('\\.').join('__ESC_DOT__');
133454 return map(braces(str, arr, opts), function(ele) {
133455 return ele.split('__ESC_DOT__').join('.');
133456 });
133457 }
133458}
133459
133460/**
133461 * Handle escaped dots: `{1\\.2}`
133462 */
133463
133464function escapePaths(str, arr, opts) {
133465 str = str.split('\/.').join('__ESC_PATH__');
133466 return map(braces(str, arr, opts), function(ele) {
133467 return ele.split('__ESC_PATH__').join('\/.');
133468 });
133469}
133470
133471/**
133472 * Handle escaped commas: `{a\\,b}`
133473 */
133474
133475function escapeCommas(str, arr, opts) {
133476 if (!/\w,/.test(str)) {
133477 return arr.concat(str.split('\\').join(''));
133478 } else {
133479 str = str.split('\\,').join('__ESC_COMMA__');
133480 return map(braces(str, arr, opts), function(ele) {
133481 return ele.split('__ESC_COMMA__').join(',');
133482 });
133483 }
133484}
133485
133486/**
133487 * Regex for common patterns
133488 */
133489
133490function patternRegex() {
133491 return /\${|( (?=[{,}])|(?=[{,}]) )|{}|{,}|\\,(?=.*[{}])|\/\.(?=.*[{}])|\\\.(?={)|\\{|\\}/;
133492}
133493
133494/**
133495 * Braces regex.
133496 */
133497
133498function braceRegex() {
133499 return /.*(\\?\{([^}]+)\})/;
133500}
133501
133502/**
133503 * es6 delimiter regex.
133504 */
133505
133506function es6Regex() {
133507 return /\$\{([^}]+)\}/;
133508}
133509
133510var braceRe;
133511var patternRe;
133512
133513/**
133514 * Faster alternative to `String.replace()` when the
133515 * index of the token to be replaces can't be supplied
133516 */
133517
133518function splice(str, token, replacement) {
133519 var i = str.indexOf(token);
133520 return str.substr(0, i) + replacement
133521 + str.substr(i + token.length);
133522}
133523
133524/**
133525 * Fast array map
133526 */
133527
133528function map(arr, fn) {
133529 if (arr == null) {
133530 return [];
133531 }
133532
133533 var len = arr.length;
133534 var res = new Array(len);
133535 var i = -1;
133536
133537 while (++i < len) {
133538 res[i] = fn(arr[i], i, arr);
133539 }
133540
133541 return res;
133542}
133543
133544/**
133545 * Fast array filter
133546 */
133547
133548function filter(arr, cb) {
133549 if (arr == null) return [];
133550 if (typeof cb !== 'function') {
133551 throw new TypeError('braces: filter expects a callback function.');
133552 }
133553
133554 var len = arr.length;
133555 var res = arr.slice();
133556 var i = 0;
133557
133558 while (len--) {
133559 if (!cb(arr[len], i++)) {
133560 res.splice(len, 1);
133561 }
133562 }
133563 return res;
133564}
133565
133566
133567/***/ }),
133568/* 829 */
133569/***/ (function(module, exports) {
133570
133571module.exports = {"application/1d-interleaved-parityfec":{"source":"iana"},"application/3gpdash-qoe-report+xml":{"source":"iana","compressible":true},"application/3gpp-ims+xml":{"source":"iana","compressible":true},"application/a2l":{"source":"iana"},"application/activemessage":{"source":"iana"},"application/activity+json":{"source":"iana","compressible":true},"application/alto-costmap+json":{"source":"iana","compressible":true},"application/alto-costmapfilter+json":{"source":"iana","compressible":true},"application/alto-directory+json":{"source":"iana","compressible":true},"application/alto-endpointcost+json":{"source":"iana","compressible":true},"application/alto-endpointcostparams+json":{"source":"iana","compressible":true},"application/alto-endpointprop+json":{"source":"iana","compressible":true},"application/alto-endpointpropparams+json":{"source":"iana","compressible":true},"application/alto-error+json":{"source":"iana","compressible":true},"application/alto-networkmap+json":{"source":"iana","compressible":true},"application/alto-networkmapfilter+json":{"source":"iana","compressible":true},"application/aml":{"source":"iana"},"application/andrew-inset":{"source":"iana","extensions":["ez"]},"application/applefile":{"source":"iana"},"application/applixware":{"source":"apache","extensions":["aw"]},"application/atf":{"source":"iana"},"application/atfx":{"source":"iana"},"application/atom+xml":{"source":"iana","compressible":true,"extensions":["atom"]},"application/atomcat+xml":{"source":"iana","compressible":true,"extensions":["atomcat"]},"application/atomdeleted+xml":{"source":"iana","compressible":true},"application/atomicmail":{"source":"iana"},"application/atomsvc+xml":{"source":"iana","compressible":true,"extensions":["atomsvc"]},"application/atxml":{"source":"iana"},"application/auth-policy+xml":{"source":"iana","compressible":true},"application/bacnet-xdd+zip":{"source":"iana","compressible":false},"application/batch-smtp":{"source":"iana"},"application/bdoc":{"compressible":false,"extensions":["bdoc"]},"application/beep+xml":{"source":"iana","compressible":true},"application/calendar+json":{"source":"iana","compressible":true},"application/calendar+xml":{"source":"iana","compressible":true},"application/call-completion":{"source":"iana"},"application/cals-1840":{"source":"iana"},"application/cbor":{"source":"iana"},"application/cccex":{"source":"iana"},"application/ccmp+xml":{"source":"iana","compressible":true},"application/ccxml+xml":{"source":"iana","compressible":true,"extensions":["ccxml"]},"application/cdfx+xml":{"source":"iana","compressible":true},"application/cdmi-capability":{"source":"iana","extensions":["cdmia"]},"application/cdmi-container":{"source":"iana","extensions":["cdmic"]},"application/cdmi-domain":{"source":"iana","extensions":["cdmid"]},"application/cdmi-object":{"source":"iana","extensions":["cdmio"]},"application/cdmi-queue":{"source":"iana","extensions":["cdmiq"]},"application/cdni":{"source":"iana"},"application/cea":{"source":"iana"},"application/cea-2018+xml":{"source":"iana","compressible":true},"application/cellml+xml":{"source":"iana","compressible":true},"application/cfw":{"source":"iana"},"application/clue_info+xml":{"source":"iana","compressible":true},"application/cms":{"source":"iana"},"application/cnrp+xml":{"source":"iana","compressible":true},"application/coap-group+json":{"source":"iana","compressible":true},"application/coap-payload":{"source":"iana"},"application/commonground":{"source":"iana"},"application/conference-info+xml":{"source":"iana","compressible":true},"application/cose":{"source":"iana"},"application/cose-key":{"source":"iana"},"application/cose-key-set":{"source":"iana"},"application/cpl+xml":{"source":"iana","compressible":true},"application/csrattrs":{"source":"iana"},"application/csta+xml":{"source":"iana","compressible":true},"application/cstadata+xml":{"source":"iana","compressible":true},"application/csvm+json":{"source":"iana","compressible":true},"application/cu-seeme":{"source":"apache","extensions":["cu"]},"application/cwt":{"source":"iana"},"application/cybercash":{"source":"iana"},"application/dart":{"compressible":true},"application/dash+xml":{"source":"iana","compressible":true,"extensions":["mpd"]},"application/dashdelta":{"source":"iana"},"application/davmount+xml":{"source":"iana","compressible":true,"extensions":["davmount"]},"application/dca-rft":{"source":"iana"},"application/dcd":{"source":"iana"},"application/dec-dx":{"source":"iana"},"application/dialog-info+xml":{"source":"iana","compressible":true},"application/dicom":{"source":"iana"},"application/dicom+json":{"source":"iana","compressible":true},"application/dicom+xml":{"source":"iana","compressible":true},"application/dii":{"source":"iana"},"application/dit":{"source":"iana"},"application/dns":{"source":"iana"},"application/dns+json":{"source":"iana","compressible":true},"application/docbook+xml":{"source":"apache","compressible":true,"extensions":["dbk"]},"application/dskpp+xml":{"source":"iana","compressible":true},"application/dssc+der":{"source":"iana","extensions":["dssc"]},"application/dssc+xml":{"source":"iana","compressible":true,"extensions":["xdssc"]},"application/dvcs":{"source":"iana"},"application/ecmascript":{"source":"iana","compressible":true,"extensions":["ecma","es"]},"application/edi-consent":{"source":"iana"},"application/edi-x12":{"source":"iana","compressible":false},"application/edifact":{"source":"iana","compressible":false},"application/efi":{"source":"iana"},"application/emergencycalldata.comment+xml":{"source":"iana","compressible":true},"application/emergencycalldata.control+xml":{"source":"iana","compressible":true},"application/emergencycalldata.deviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.ecall.msd":{"source":"iana"},"application/emergencycalldata.providerinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.serviceinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.subscriberinfo+xml":{"source":"iana","compressible":true},"application/emergencycalldata.veds+xml":{"source":"iana","compressible":true},"application/emma+xml":{"source":"iana","compressible":true,"extensions":["emma"]},"application/emotionml+xml":{"source":"iana","compressible":true},"application/encaprtp":{"source":"iana"},"application/epp+xml":{"source":"iana","compressible":true},"application/epub+zip":{"source":"iana","compressible":false,"extensions":["epub"]},"application/eshop":{"source":"iana"},"application/exi":{"source":"iana","extensions":["exi"]},"application/fastinfoset":{"source":"iana"},"application/fastsoap":{"source":"iana"},"application/fdt+xml":{"source":"iana","compressible":true},"application/fhir+json":{"source":"iana","compressible":true},"application/fhir+xml":{"source":"iana","compressible":true},"application/fido.trusted-apps+json":{"compressible":true},"application/fits":{"source":"iana"},"application/font-sfnt":{"source":"iana"},"application/font-tdpfr":{"source":"iana","extensions":["pfr"]},"application/font-woff":{"source":"iana","compressible":false},"application/framework-attributes+xml":{"source":"iana","compressible":true},"application/geo+json":{"source":"iana","compressible":true,"extensions":["geojson"]},"application/geo+json-seq":{"source":"iana"},"application/geoxacml+xml":{"source":"iana","compressible":true},"application/gltf-buffer":{"source":"iana"},"application/gml+xml":{"source":"iana","compressible":true,"extensions":["gml"]},"application/gpx+xml":{"source":"apache","compressible":true,"extensions":["gpx"]},"application/gxf":{"source":"apache","extensions":["gxf"]},"application/gzip":{"source":"iana","compressible":false,"extensions":["gz"]},"application/h224":{"source":"iana"},"application/held+xml":{"source":"iana","compressible":true},"application/hjson":{"extensions":["hjson"]},"application/http":{"source":"iana"},"application/hyperstudio":{"source":"iana","extensions":["stk"]},"application/ibe-key-request+xml":{"source":"iana","compressible":true},"application/ibe-pkg-reply+xml":{"source":"iana","compressible":true},"application/ibe-pp-data":{"source":"iana"},"application/iges":{"source":"iana"},"application/im-iscomposing+xml":{"source":"iana","compressible":true},"application/index":{"source":"iana"},"application/index.cmd":{"source":"iana"},"application/index.obj":{"source":"iana"},"application/index.response":{"source":"iana"},"application/index.vnd":{"source":"iana"},"application/inkml+xml":{"source":"iana","compressible":true,"extensions":["ink","inkml"]},"application/iotp":{"source":"iana"},"application/ipfix":{"source":"iana","extensions":["ipfix"]},"application/ipp":{"source":"iana"},"application/isup":{"source":"iana"},"application/its+xml":{"source":"iana","compressible":true},"application/java-archive":{"source":"apache","compressible":false,"extensions":["jar","war","ear"]},"application/java-serialized-object":{"source":"apache","compressible":false,"extensions":["ser"]},"application/java-vm":{"source":"apache","compressible":false,"extensions":["class"]},"application/javascript":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["js","mjs"]},"application/jf2feed+json":{"source":"iana","compressible":true},"application/jose":{"source":"iana"},"application/jose+json":{"source":"iana","compressible":true},"application/jrd+json":{"source":"iana","compressible":true},"application/json":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["json","map"]},"application/json-patch+json":{"source":"iana","compressible":true},"application/json-seq":{"source":"iana"},"application/json5":{"extensions":["json5"]},"application/jsonml+json":{"source":"apache","compressible":true,"extensions":["jsonml"]},"application/jwk+json":{"source":"iana","compressible":true},"application/jwk-set+json":{"source":"iana","compressible":true},"application/jwt":{"source":"iana"},"application/kpml-request+xml":{"source":"iana","compressible":true},"application/kpml-response+xml":{"source":"iana","compressible":true},"application/ld+json":{"source":"iana","compressible":true,"extensions":["jsonld"]},"application/lgr+xml":{"source":"iana","compressible":true},"application/link-format":{"source":"iana"},"application/load-control+xml":{"source":"iana","compressible":true},"application/lost+xml":{"source":"iana","compressible":true,"extensions":["lostxml"]},"application/lostsync+xml":{"source":"iana","compressible":true},"application/lxf":{"source":"iana"},"application/mac-binhex40":{"source":"iana","extensions":["hqx"]},"application/mac-compactpro":{"source":"apache","extensions":["cpt"]},"application/macwriteii":{"source":"iana"},"application/mads+xml":{"source":"iana","compressible":true,"extensions":["mads"]},"application/manifest+json":{"charset":"UTF-8","compressible":true,"extensions":["webmanifest"]},"application/marc":{"source":"iana","extensions":["mrc"]},"application/marcxml+xml":{"source":"iana","compressible":true,"extensions":["mrcx"]},"application/mathematica":{"source":"iana","extensions":["ma","nb","mb"]},"application/mathml+xml":{"source":"iana","compressible":true,"extensions":["mathml"]},"application/mathml-content+xml":{"source":"iana","compressible":true},"application/mathml-presentation+xml":{"source":"iana","compressible":true},"application/mbms-associated-procedure-description+xml":{"source":"iana","compressible":true},"application/mbms-deregister+xml":{"source":"iana","compressible":true},"application/mbms-envelope+xml":{"source":"iana","compressible":true},"application/mbms-msk+xml":{"source":"iana","compressible":true},"application/mbms-msk-response+xml":{"source":"iana","compressible":true},"application/mbms-protection-description+xml":{"source":"iana","compressible":true},"application/mbms-reception-report+xml":{"source":"iana","compressible":true},"application/mbms-register+xml":{"source":"iana","compressible":true},"application/mbms-register-response+xml":{"source":"iana","compressible":true},"application/mbms-schedule+xml":{"source":"iana","compressible":true},"application/mbms-user-service-description+xml":{"source":"iana","compressible":true},"application/mbox":{"source":"iana","extensions":["mbox"]},"application/media-policy-dataset+xml":{"source":"iana","compressible":true},"application/media_control+xml":{"source":"iana","compressible":true},"application/mediaservercontrol+xml":{"source":"iana","compressible":true,"extensions":["mscml"]},"application/merge-patch+json":{"source":"iana","compressible":true},"application/metalink+xml":{"source":"apache","compressible":true,"extensions":["metalink"]},"application/metalink4+xml":{"source":"iana","compressible":true,"extensions":["meta4"]},"application/mets+xml":{"source":"iana","compressible":true,"extensions":["mets"]},"application/mf4":{"source":"iana"},"application/mikey":{"source":"iana"},"application/mmt-usd+xml":{"source":"iana","compressible":true},"application/mods+xml":{"source":"iana","compressible":true,"extensions":["mods"]},"application/moss-keys":{"source":"iana"},"application/moss-signature":{"source":"iana"},"application/mosskey-data":{"source":"iana"},"application/mosskey-request":{"source":"iana"},"application/mp21":{"source":"iana","extensions":["m21","mp21"]},"application/mp4":{"source":"iana","extensions":["mp4s","m4p"]},"application/mpeg4-generic":{"source":"iana"},"application/mpeg4-iod":{"source":"iana"},"application/mpeg4-iod-xmt":{"source":"iana"},"application/mrb-consumer+xml":{"source":"iana","compressible":true},"application/mrb-publish+xml":{"source":"iana","compressible":true},"application/msc-ivr+xml":{"source":"iana","compressible":true},"application/msc-mixer+xml":{"source":"iana","compressible":true},"application/msword":{"source":"iana","compressible":false,"extensions":["doc","dot"]},"application/mud+json":{"source":"iana","compressible":true},"application/mxf":{"source":"iana","extensions":["mxf"]},"application/n-quads":{"source":"iana"},"application/n-triples":{"source":"iana"},"application/nasdata":{"source":"iana"},"application/news-checkgroups":{"source":"iana"},"application/news-groupinfo":{"source":"iana"},"application/news-transmission":{"source":"iana"},"application/nlsml+xml":{"source":"iana","compressible":true},"application/node":{"source":"iana"},"application/nss":{"source":"iana"},"application/ocsp-request":{"source":"iana"},"application/ocsp-response":{"source":"iana"},"application/octet-stream":{"source":"iana","compressible":false,"extensions":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"]},"application/oda":{"source":"iana","extensions":["oda"]},"application/odx":{"source":"iana"},"application/oebps-package+xml":{"source":"iana","compressible":true,"extensions":["opf"]},"application/ogg":{"source":"iana","compressible":false,"extensions":["ogx"]},"application/omdoc+xml":{"source":"apache","compressible":true,"extensions":["omdoc"]},"application/onenote":{"source":"apache","extensions":["onetoc","onetoc2","onetmp","onepkg"]},"application/oxps":{"source":"iana","extensions":["oxps"]},"application/p2p-overlay+xml":{"source":"iana","compressible":true},"application/parityfec":{"source":"iana"},"application/passport":{"source":"iana"},"application/patch-ops-error+xml":{"source":"iana","compressible":true,"extensions":["xer"]},"application/pdf":{"source":"iana","compressible":false,"extensions":["pdf"]},"application/pdx":{"source":"iana"},"application/pgp-encrypted":{"source":"iana","compressible":false,"extensions":["pgp"]},"application/pgp-keys":{"source":"iana"},"application/pgp-signature":{"source":"iana","extensions":["asc","sig"]},"application/pics-rules":{"source":"apache","extensions":["prf"]},"application/pidf+xml":{"source":"iana","compressible":true},"application/pidf-diff+xml":{"source":"iana","compressible":true},"application/pkcs10":{"source":"iana","extensions":["p10"]},"application/pkcs12":{"source":"iana"},"application/pkcs7-mime":{"source":"iana","extensions":["p7m","p7c"]},"application/pkcs7-signature":{"source":"iana","extensions":["p7s"]},"application/pkcs8":{"source":"iana","extensions":["p8"]},"application/pkcs8-encrypted":{"source":"iana"},"application/pkix-attr-cert":{"source":"iana","extensions":["ac"]},"application/pkix-cert":{"source":"iana","extensions":["cer"]},"application/pkix-crl":{"source":"iana","extensions":["crl"]},"application/pkix-pkipath":{"source":"iana","extensions":["pkipath"]},"application/pkixcmp":{"source":"iana","extensions":["pki"]},"application/pls+xml":{"source":"iana","compressible":true,"extensions":["pls"]},"application/poc-settings+xml":{"source":"iana","compressible":true},"application/postscript":{"source":"iana","compressible":true,"extensions":["ai","eps","ps"]},"application/ppsp-tracker+json":{"source":"iana","compressible":true},"application/problem+json":{"source":"iana","compressible":true},"application/problem+xml":{"source":"iana","compressible":true},"application/provenance+xml":{"source":"iana","compressible":true},"application/prs.alvestrand.titrax-sheet":{"source":"iana"},"application/prs.cww":{"source":"iana","extensions":["cww"]},"application/prs.hpub+zip":{"source":"iana","compressible":false},"application/prs.nprend":{"source":"iana"},"application/prs.plucker":{"source":"iana"},"application/prs.rdf-xml-crypt":{"source":"iana"},"application/prs.xsf+xml":{"source":"iana","compressible":true},"application/pskc+xml":{"source":"iana","compressible":true,"extensions":["pskcxml"]},"application/qsig":{"source":"iana"},"application/raml+yaml":{"compressible":true,"extensions":["raml"]},"application/raptorfec":{"source":"iana"},"application/rdap+json":{"source":"iana","compressible":true},"application/rdf+xml":{"source":"iana","compressible":true,"extensions":["rdf","owl"]},"application/reginfo+xml":{"source":"iana","compressible":true,"extensions":["rif"]},"application/relax-ng-compact-syntax":{"source":"iana","extensions":["rnc"]},"application/remote-printing":{"source":"iana"},"application/reputon+json":{"source":"iana","compressible":true},"application/resource-lists+xml":{"source":"iana","compressible":true,"extensions":["rl"]},"application/resource-lists-diff+xml":{"source":"iana","compressible":true,"extensions":["rld"]},"application/rfc+xml":{"source":"iana","compressible":true},"application/riscos":{"source":"iana"},"application/rlmi+xml":{"source":"iana","compressible":true},"application/rls-services+xml":{"source":"iana","compressible":true,"extensions":["rs"]},"application/route-apd+xml":{"source":"iana","compressible":true},"application/route-s-tsid+xml":{"source":"iana","compressible":true},"application/route-usd+xml":{"source":"iana","compressible":true},"application/rpki-ghostbusters":{"source":"iana","extensions":["gbr"]},"application/rpki-manifest":{"source":"iana","extensions":["mft"]},"application/rpki-publication":{"source":"iana"},"application/rpki-roa":{"source":"iana","extensions":["roa"]},"application/rpki-updown":{"source":"iana"},"application/rsd+xml":{"source":"apache","compressible":true,"extensions":["rsd"]},"application/rss+xml":{"source":"apache","compressible":true,"extensions":["rss"]},"application/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"application/rtploopback":{"source":"iana"},"application/rtx":{"source":"iana"},"application/samlassertion+xml":{"source":"iana","compressible":true},"application/samlmetadata+xml":{"source":"iana","compressible":true},"application/sbml+xml":{"source":"iana","compressible":true,"extensions":["sbml"]},"application/scaip+xml":{"source":"iana","compressible":true},"application/scim+json":{"source":"iana","compressible":true},"application/scvp-cv-request":{"source":"iana","extensions":["scq"]},"application/scvp-cv-response":{"source":"iana","extensions":["scs"]},"application/scvp-vp-request":{"source":"iana","extensions":["spq"]},"application/scvp-vp-response":{"source":"iana","extensions":["spp"]},"application/sdp":{"source":"iana","extensions":["sdp"]},"application/secevent+jwt":{"source":"iana"},"application/senml+cbor":{"source":"iana"},"application/senml+json":{"source":"iana","compressible":true},"application/senml+xml":{"source":"iana","compressible":true},"application/senml-exi":{"source":"iana"},"application/sensml+cbor":{"source":"iana"},"application/sensml+json":{"source":"iana","compressible":true},"application/sensml+xml":{"source":"iana","compressible":true},"application/sensml-exi":{"source":"iana"},"application/sep+xml":{"source":"iana","compressible":true},"application/sep-exi":{"source":"iana"},"application/session-info":{"source":"iana"},"application/set-payment":{"source":"iana"},"application/set-payment-initiation":{"source":"iana","extensions":["setpay"]},"application/set-registration":{"source":"iana"},"application/set-registration-initiation":{"source":"iana","extensions":["setreg"]},"application/sgml":{"source":"iana"},"application/sgml-open-catalog":{"source":"iana"},"application/shf+xml":{"source":"iana","compressible":true,"extensions":["shf"]},"application/sieve":{"source":"iana"},"application/simple-filter+xml":{"source":"iana","compressible":true},"application/simple-message-summary":{"source":"iana"},"application/simplesymbolcontainer":{"source":"iana"},"application/slate":{"source":"iana"},"application/smil":{"source":"iana"},"application/smil+xml":{"source":"iana","compressible":true,"extensions":["smi","smil"]},"application/smpte336m":{"source":"iana"},"application/soap+fastinfoset":{"source":"iana"},"application/soap+xml":{"source":"iana","compressible":true},"application/sparql-query":{"source":"iana","extensions":["rq"]},"application/sparql-results+xml":{"source":"iana","compressible":true,"extensions":["srx"]},"application/spirits-event+xml":{"source":"iana","compressible":true},"application/sql":{"source":"iana"},"application/srgs":{"source":"iana","extensions":["gram"]},"application/srgs+xml":{"source":"iana","compressible":true,"extensions":["grxml"]},"application/sru+xml":{"source":"iana","compressible":true,"extensions":["sru"]},"application/ssdl+xml":{"source":"apache","compressible":true,"extensions":["ssdl"]},"application/ssml+xml":{"source":"iana","compressible":true,"extensions":["ssml"]},"application/stix+json":{"source":"iana","compressible":true},"application/tamp-apex-update":{"source":"iana"},"application/tamp-apex-update-confirm":{"source":"iana"},"application/tamp-community-update":{"source":"iana"},"application/tamp-community-update-confirm":{"source":"iana"},"application/tamp-error":{"source":"iana"},"application/tamp-sequence-adjust":{"source":"iana"},"application/tamp-sequence-adjust-confirm":{"source":"iana"},"application/tamp-status-query":{"source":"iana"},"application/tamp-status-response":{"source":"iana"},"application/tamp-update":{"source":"iana"},"application/tamp-update-confirm":{"source":"iana"},"application/tar":{"compressible":true},"application/taxii+json":{"source":"iana","compressible":true},"application/tei+xml":{"source":"iana","compressible":true,"extensions":["tei","teicorpus"]},"application/thraud+xml":{"source":"iana","compressible":true,"extensions":["tfi"]},"application/timestamp-query":{"source":"iana"},"application/timestamp-reply":{"source":"iana"},"application/timestamped-data":{"source":"iana","extensions":["tsd"]},"application/tlsrpt+gzip":{"source":"iana"},"application/tlsrpt+json":{"source":"iana","compressible":true},"application/tnauthlist":{"source":"iana"},"application/trickle-ice-sdpfrag":{"source":"iana"},"application/trig":{"source":"iana"},"application/ttml+xml":{"source":"iana","compressible":true},"application/tve-trigger":{"source":"iana"},"application/ulpfec":{"source":"iana"},"application/urc-grpsheet+xml":{"source":"iana","compressible":true},"application/urc-ressheet+xml":{"source":"iana","compressible":true},"application/urc-targetdesc+xml":{"source":"iana","compressible":true},"application/urc-uisocketdesc+xml":{"source":"iana","compressible":true},"application/vcard+json":{"source":"iana","compressible":true},"application/vcard+xml":{"source":"iana","compressible":true},"application/vemmi":{"source":"iana"},"application/vividence.scriptfile":{"source":"apache"},"application/vnd.1000minds.decision-model+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-prose-pc3ch+xml":{"source":"iana","compressible":true},"application/vnd.3gpp-v2x-local-service-information":{"source":"iana"},"application/vnd.3gpp.access-transfer-events+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.bsf+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.gmop+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcdata-payload":{"source":"iana"},"application/vnd.3gpp.mcdata-signalling":{"source":"iana"},"application/vnd.3gpp.mcptt-affiliation-command+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-floor-request+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-location-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-mbms-usage-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mcptt-signed+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.mid-call+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.pic-bw-large":{"source":"iana","extensions":["plb"]},"application/vnd.3gpp.pic-bw-small":{"source":"iana","extensions":["psb"]},"application/vnd.3gpp.pic-bw-var":{"source":"iana","extensions":["pvb"]},"application/vnd.3gpp.sms":{"source":"iana"},"application/vnd.3gpp.sms+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-ext+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.srvcc-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.state-and-event-info+xml":{"source":"iana","compressible":true},"application/vnd.3gpp.ussd+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.bcmcsinfo+xml":{"source":"iana","compressible":true},"application/vnd.3gpp2.sms":{"source":"iana"},"application/vnd.3gpp2.tcap":{"source":"iana","extensions":["tcap"]},"application/vnd.3lightssoftware.imagescal":{"source":"iana"},"application/vnd.3m.post-it-notes":{"source":"iana","extensions":["pwn"]},"application/vnd.accpac.simply.aso":{"source":"iana","extensions":["aso"]},"application/vnd.accpac.simply.imp":{"source":"iana","extensions":["imp"]},"application/vnd.acucobol":{"source":"iana","extensions":["acu"]},"application/vnd.acucorp":{"source":"iana","extensions":["atc","acutc"]},"application/vnd.adobe.air-application-installer-package+zip":{"source":"apache","compressible":false,"extensions":["air"]},"application/vnd.adobe.flash.movie":{"source":"iana"},"application/vnd.adobe.formscentral.fcdt":{"source":"iana","extensions":["fcdt"]},"application/vnd.adobe.fxp":{"source":"iana","extensions":["fxp","fxpl"]},"application/vnd.adobe.partial-upload":{"source":"iana"},"application/vnd.adobe.xdp+xml":{"source":"iana","compressible":true,"extensions":["xdp"]},"application/vnd.adobe.xfdf":{"source":"iana","extensions":["xfdf"]},"application/vnd.aether.imp":{"source":"iana"},"application/vnd.afpc.afplinedata":{"source":"iana"},"application/vnd.afpc.modca":{"source":"iana"},"application/vnd.ah-barcode":{"source":"iana"},"application/vnd.ahead.space":{"source":"iana","extensions":["ahead"]},"application/vnd.airzip.filesecure.azf":{"source":"iana","extensions":["azf"]},"application/vnd.airzip.filesecure.azs":{"source":"iana","extensions":["azs"]},"application/vnd.amadeus+json":{"source":"iana","compressible":true},"application/vnd.amazon.ebook":{"source":"apache","extensions":["azw"]},"application/vnd.amazon.mobi8-ebook":{"source":"iana"},"application/vnd.americandynamics.acc":{"source":"iana","extensions":["acc"]},"application/vnd.amiga.ami":{"source":"iana","extensions":["ami"]},"application/vnd.amundsen.maze+xml":{"source":"iana","compressible":true},"application/vnd.android.package-archive":{"source":"apache","compressible":false,"extensions":["apk"]},"application/vnd.anki":{"source":"iana"},"application/vnd.anser-web-certificate-issue-initiation":{"source":"iana","extensions":["cii"]},"application/vnd.anser-web-funds-transfer-initiation":{"source":"apache","extensions":["fti"]},"application/vnd.antix.game-component":{"source":"iana","extensions":["atx"]},"application/vnd.apache.thrift.binary":{"source":"iana"},"application/vnd.apache.thrift.compact":{"source":"iana"},"application/vnd.apache.thrift.json":{"source":"iana"},"application/vnd.api+json":{"source":"iana","compressible":true},"application/vnd.apothekende.reservation+json":{"source":"iana","compressible":true},"application/vnd.apple.installer+xml":{"source":"iana","compressible":true,"extensions":["mpkg"]},"application/vnd.apple.mpegurl":{"source":"iana","extensions":["m3u8"]},"application/vnd.apple.pkpass":{"compressible":false,"extensions":["pkpass"]},"application/vnd.arastra.swi":{"source":"iana"},"application/vnd.aristanetworks.swi":{"source":"iana","extensions":["swi"]},"application/vnd.artisan+json":{"source":"iana","compressible":true},"application/vnd.artsquare":{"source":"iana"},"application/vnd.astraea-software.iota":{"source":"iana","extensions":["iota"]},"application/vnd.audiograph":{"source":"iana","extensions":["aep"]},"application/vnd.autopackage":{"source":"iana"},"application/vnd.avalon+json":{"source":"iana","compressible":true},"application/vnd.avistar+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmml+xml":{"source":"iana","compressible":true},"application/vnd.balsamiq.bmpr":{"source":"iana"},"application/vnd.banana-accounting":{"source":"iana"},"application/vnd.bbf.usp.msg":{"source":"iana"},"application/vnd.bbf.usp.msg+json":{"source":"iana","compressible":true},"application/vnd.bekitzur-stech+json":{"source":"iana","compressible":true},"application/vnd.bint.med-content":{"source":"iana"},"application/vnd.biopax.rdf+xml":{"source":"iana","compressible":true},"application/vnd.blink-idb-value-wrapper":{"source":"iana"},"application/vnd.blueice.multipass":{"source":"iana","extensions":["mpm"]},"application/vnd.bluetooth.ep.oob":{"source":"iana"},"application/vnd.bluetooth.le.oob":{"source":"iana"},"application/vnd.bmi":{"source":"iana","extensions":["bmi"]},"application/vnd.businessobjects":{"source":"iana","extensions":["rep"]},"application/vnd.byu.uapi+json":{"source":"iana","compressible":true},"application/vnd.cab-jscript":{"source":"iana"},"application/vnd.canon-cpdl":{"source":"iana"},"application/vnd.canon-lips":{"source":"iana"},"application/vnd.capasystems-pg+json":{"source":"iana","compressible":true},"application/vnd.cendio.thinlinc.clientconf":{"source":"iana"},"application/vnd.century-systems.tcp_stream":{"source":"iana"},"application/vnd.chemdraw+xml":{"source":"iana","compressible":true,"extensions":["cdxml"]},"application/vnd.chess-pgn":{"source":"iana"},"application/vnd.chipnuts.karaoke-mmd":{"source":"iana","extensions":["mmd"]},"application/vnd.cinderella":{"source":"iana","extensions":["cdy"]},"application/vnd.cirpack.isdn-ext":{"source":"iana"},"application/vnd.citationstyles.style+xml":{"source":"iana","compressible":true,"extensions":["csl"]},"application/vnd.claymore":{"source":"iana","extensions":["cla"]},"application/vnd.cloanto.rp9":{"source":"iana","extensions":["rp9"]},"application/vnd.clonk.c4group":{"source":"iana","extensions":["c4g","c4d","c4f","c4p","c4u"]},"application/vnd.cluetrust.cartomobile-config":{"source":"iana","extensions":["c11amc"]},"application/vnd.cluetrust.cartomobile-config-pkg":{"source":"iana","extensions":["c11amz"]},"application/vnd.coffeescript":{"source":"iana"},"application/vnd.collabio.xodocuments.document":{"source":"iana"},"application/vnd.collabio.xodocuments.document-template":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation":{"source":"iana"},"application/vnd.collabio.xodocuments.presentation-template":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet":{"source":"iana"},"application/vnd.collabio.xodocuments.spreadsheet-template":{"source":"iana"},"application/vnd.collection+json":{"source":"iana","compressible":true},"application/vnd.collection.doc+json":{"source":"iana","compressible":true},"application/vnd.collection.next+json":{"source":"iana","compressible":true},"application/vnd.comicbook+zip":{"source":"iana","compressible":false},"application/vnd.comicbook-rar":{"source":"iana"},"application/vnd.commerce-battelle":{"source":"iana"},"application/vnd.commonspace":{"source":"iana","extensions":["csp"]},"application/vnd.contact.cmsg":{"source":"iana","extensions":["cdbcmsg"]},"application/vnd.coreos.ignition+json":{"source":"iana","compressible":true},"application/vnd.cosmocaller":{"source":"iana","extensions":["cmc"]},"application/vnd.crick.clicker":{"source":"iana","extensions":["clkx"]},"application/vnd.crick.clicker.keyboard":{"source":"iana","extensions":["clkk"]},"application/vnd.crick.clicker.palette":{"source":"iana","extensions":["clkp"]},"application/vnd.crick.clicker.template":{"source":"iana","extensions":["clkt"]},"application/vnd.crick.clicker.wordbank":{"source":"iana","extensions":["clkw"]},"application/vnd.criticaltools.wbs+xml":{"source":"iana","compressible":true,"extensions":["wbs"]},"application/vnd.ctc-posml":{"source":"iana","extensions":["pml"]},"application/vnd.ctct.ws+xml":{"source":"iana","compressible":true},"application/vnd.cups-pdf":{"source":"iana"},"application/vnd.cups-postscript":{"source":"iana"},"application/vnd.cups-ppd":{"source":"iana","extensions":["ppd"]},"application/vnd.cups-raster":{"source":"iana"},"application/vnd.cups-raw":{"source":"iana"},"application/vnd.curl":{"source":"iana"},"application/vnd.curl.car":{"source":"apache","extensions":["car"]},"application/vnd.curl.pcurl":{"source":"apache","extensions":["pcurl"]},"application/vnd.cyan.dean.root+xml":{"source":"iana","compressible":true},"application/vnd.cybank":{"source":"iana"},"application/vnd.d2l.coursepackage1p0+zip":{"source":"iana","compressible":false},"application/vnd.dart":{"source":"iana","compressible":true,"extensions":["dart"]},"application/vnd.data-vision.rdz":{"source":"iana","extensions":["rdz"]},"application/vnd.datapackage+json":{"source":"iana","compressible":true},"application/vnd.dataresource+json":{"source":"iana","compressible":true},"application/vnd.debian.binary-package":{"source":"iana"},"application/vnd.dece.data":{"source":"iana","extensions":["uvf","uvvf","uvd","uvvd"]},"application/vnd.dece.ttml+xml":{"source":"iana","compressible":true,"extensions":["uvt","uvvt"]},"application/vnd.dece.unspecified":{"source":"iana","extensions":["uvx","uvvx"]},"application/vnd.dece.zip":{"source":"iana","extensions":["uvz","uvvz"]},"application/vnd.denovo.fcselayout-link":{"source":"iana","extensions":["fe_launch"]},"application/vnd.desmume-movie":{"source":"iana"},"application/vnd.desmume.movie":{"source":"apache"},"application/vnd.dir-bi.plate-dl-nosuffix":{"source":"iana"},"application/vnd.dm.delegation+xml":{"source":"iana","compressible":true},"application/vnd.dna":{"source":"iana","extensions":["dna"]},"application/vnd.document+json":{"source":"iana","compressible":true},"application/vnd.dolby.mlp":{"source":"apache","extensions":["mlp"]},"application/vnd.dolby.mobile.1":{"source":"iana"},"application/vnd.dolby.mobile.2":{"source":"iana"},"application/vnd.doremir.scorecloud-binary-document":{"source":"iana"},"application/vnd.dpgraph":{"source":"iana","extensions":["dpg"]},"application/vnd.dreamfactory":{"source":"iana","extensions":["dfac"]},"application/vnd.drive+json":{"source":"iana","compressible":true},"application/vnd.ds-keypoint":{"source":"apache","extensions":["kpxx"]},"application/vnd.dtg.local":{"source":"iana"},"application/vnd.dtg.local.flash":{"source":"iana"},"application/vnd.dtg.local.html":{"source":"iana"},"application/vnd.dvb.ait":{"source":"iana","extensions":["ait"]},"application/vnd.dvb.dvbj":{"source":"iana"},"application/vnd.dvb.esgcontainer":{"source":"iana"},"application/vnd.dvb.ipdcdftnotifaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess":{"source":"iana"},"application/vnd.dvb.ipdcesgaccess2":{"source":"iana"},"application/vnd.dvb.ipdcesgpdd":{"source":"iana"},"application/vnd.dvb.ipdcroaming":{"source":"iana"},"application/vnd.dvb.iptv.alfec-base":{"source":"iana"},"application/vnd.dvb.iptv.alfec-enhancement":{"source":"iana"},"application/vnd.dvb.notif-aggregate-root+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-container+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-generic+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-msglist+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-request+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-ia-registration-response+xml":{"source":"iana","compressible":true},"application/vnd.dvb.notif-init+xml":{"source":"iana","compressible":true},"application/vnd.dvb.pfr":{"source":"iana"},"application/vnd.dvb.service":{"source":"iana","extensions":["svc"]},"application/vnd.dxr":{"source":"iana"},"application/vnd.dynageo":{"source":"iana","extensions":["geo"]},"application/vnd.dzr":{"source":"iana"},"application/vnd.easykaraoke.cdgdownload":{"source":"iana"},"application/vnd.ecdis-update":{"source":"iana"},"application/vnd.ecip.rlp":{"source":"iana"},"application/vnd.ecowin.chart":{"source":"iana","extensions":["mag"]},"application/vnd.ecowin.filerequest":{"source":"iana"},"application/vnd.ecowin.fileupdate":{"source":"iana"},"application/vnd.ecowin.series":{"source":"iana"},"application/vnd.ecowin.seriesrequest":{"source":"iana"},"application/vnd.ecowin.seriesupdate":{"source":"iana"},"application/vnd.efi.img":{"source":"iana"},"application/vnd.efi.iso":{"source":"iana"},"application/vnd.emclient.accessrequest+xml":{"source":"iana","compressible":true},"application/vnd.enliven":{"source":"iana","extensions":["nml"]},"application/vnd.enphase.envoy":{"source":"iana"},"application/vnd.eprints.data+xml":{"source":"iana","compressible":true},"application/vnd.epson.esf":{"source":"iana","extensions":["esf"]},"application/vnd.epson.msf":{"source":"iana","extensions":["msf"]},"application/vnd.epson.quickanime":{"source":"iana","extensions":["qam"]},"application/vnd.epson.salt":{"source":"iana","extensions":["slt"]},"application/vnd.epson.ssf":{"source":"iana","extensions":["ssf"]},"application/vnd.ericsson.quickcall":{"source":"iana"},"application/vnd.espass-espass+zip":{"source":"iana","compressible":false},"application/vnd.eszigno3+xml":{"source":"iana","compressible":true,"extensions":["es3","et3"]},"application/vnd.etsi.aoc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.asic-e+zip":{"source":"iana","compressible":false},"application/vnd.etsi.asic-s+zip":{"source":"iana","compressible":false},"application/vnd.etsi.cug+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvcommand+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-bc+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-cod+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsad-npvr+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvservice+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvsync+xml":{"source":"iana","compressible":true},"application/vnd.etsi.iptvueprofile+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mcid+xml":{"source":"iana","compressible":true},"application/vnd.etsi.mheg5":{"source":"iana"},"application/vnd.etsi.overload-control-policy-dataset+xml":{"source":"iana","compressible":true},"application/vnd.etsi.pstn+xml":{"source":"iana","compressible":true},"application/vnd.etsi.sci+xml":{"source":"iana","compressible":true},"application/vnd.etsi.simservs+xml":{"source":"iana","compressible":true},"application/vnd.etsi.timestamp-token":{"source":"iana"},"application/vnd.etsi.tsl+xml":{"source":"iana","compressible":true},"application/vnd.etsi.tsl.der":{"source":"iana"},"application/vnd.eudora.data":{"source":"iana"},"application/vnd.evolv.ecig.profile":{"source":"iana"},"application/vnd.evolv.ecig.settings":{"source":"iana"},"application/vnd.evolv.ecig.theme":{"source":"iana"},"application/vnd.ezpix-album":{"source":"iana","extensions":["ez2"]},"application/vnd.ezpix-package":{"source":"iana","extensions":["ez3"]},"application/vnd.f-secure.mobile":{"source":"iana"},"application/vnd.fastcopy-disk-image":{"source":"iana"},"application/vnd.fdf":{"source":"iana","extensions":["fdf"]},"application/vnd.fdsn.mseed":{"source":"iana","extensions":["mseed"]},"application/vnd.fdsn.seed":{"source":"iana","extensions":["seed","dataless"]},"application/vnd.ffsns":{"source":"iana"},"application/vnd.filmit.zfc":{"source":"iana"},"application/vnd.fints":{"source":"iana"},"application/vnd.firemonkeys.cloudcell":{"source":"iana"},"application/vnd.flographit":{"source":"iana","extensions":["gph"]},"application/vnd.fluxtime.clip":{"source":"iana","extensions":["ftc"]},"application/vnd.font-fontforge-sfd":{"source":"iana"},"application/vnd.framemaker":{"source":"iana","extensions":["fm","frame","maker","book"]},"application/vnd.frogans.fnc":{"source":"iana","extensions":["fnc"]},"application/vnd.frogans.ltf":{"source":"iana","extensions":["ltf"]},"application/vnd.fsc.weblaunch":{"source":"iana","extensions":["fsc"]},"application/vnd.fujitsu.oasys":{"source":"iana","extensions":["oas"]},"application/vnd.fujitsu.oasys2":{"source":"iana","extensions":["oa2"]},"application/vnd.fujitsu.oasys3":{"source":"iana","extensions":["oa3"]},"application/vnd.fujitsu.oasysgp":{"source":"iana","extensions":["fg5"]},"application/vnd.fujitsu.oasysprs":{"source":"iana","extensions":["bh2"]},"application/vnd.fujixerox.art-ex":{"source":"iana"},"application/vnd.fujixerox.art4":{"source":"iana"},"application/vnd.fujixerox.ddd":{"source":"iana","extensions":["ddd"]},"application/vnd.fujixerox.docuworks":{"source":"iana","extensions":["xdw"]},"application/vnd.fujixerox.docuworks.binder":{"source":"iana","extensions":["xbd"]},"application/vnd.fujixerox.docuworks.container":{"source":"iana"},"application/vnd.fujixerox.hbpl":{"source":"iana"},"application/vnd.fut-misnet":{"source":"iana"},"application/vnd.fuzzysheet":{"source":"iana","extensions":["fzs"]},"application/vnd.genomatix.tuxedo":{"source":"iana","extensions":["txd"]},"application/vnd.geo+json":{"source":"iana","compressible":true},"application/vnd.geocube+xml":{"source":"iana","compressible":true},"application/vnd.geogebra.file":{"source":"iana","extensions":["ggb"]},"application/vnd.geogebra.tool":{"source":"iana","extensions":["ggt"]},"application/vnd.geometry-explorer":{"source":"iana","extensions":["gex","gre"]},"application/vnd.geonext":{"source":"iana","extensions":["gxt"]},"application/vnd.geoplan":{"source":"iana","extensions":["g2w"]},"application/vnd.geospace":{"source":"iana","extensions":["g3w"]},"application/vnd.gerber":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt":{"source":"iana"},"application/vnd.globalplatform.card-content-mgt-response":{"source":"iana"},"application/vnd.gmx":{"source":"iana","extensions":["gmx"]},"application/vnd.google-apps.document":{"compressible":false,"extensions":["gdoc"]},"application/vnd.google-apps.presentation":{"compressible":false,"extensions":["gslides"]},"application/vnd.google-apps.spreadsheet":{"compressible":false,"extensions":["gsheet"]},"application/vnd.google-earth.kml+xml":{"source":"iana","compressible":true,"extensions":["kml"]},"application/vnd.google-earth.kmz":{"source":"iana","compressible":false,"extensions":["kmz"]},"application/vnd.gov.sk.e-form+xml":{"source":"iana","compressible":true},"application/vnd.gov.sk.e-form+zip":{"source":"iana","compressible":false},"application/vnd.gov.sk.xmldatacontainer+xml":{"source":"iana","compressible":true},"application/vnd.grafeq":{"source":"iana","extensions":["gqf","gqs"]},"application/vnd.gridmp":{"source":"iana"},"application/vnd.groove-account":{"source":"iana","extensions":["gac"]},"application/vnd.groove-help":{"source":"iana","extensions":["ghf"]},"application/vnd.groove-identity-message":{"source":"iana","extensions":["gim"]},"application/vnd.groove-injector":{"source":"iana","extensions":["grv"]},"application/vnd.groove-tool-message":{"source":"iana","extensions":["gtm"]},"application/vnd.groove-tool-template":{"source":"iana","extensions":["tpl"]},"application/vnd.groove-vcard":{"source":"iana","extensions":["vcg"]},"application/vnd.hal+json":{"source":"iana","compressible":true},"application/vnd.hal+xml":{"source":"iana","compressible":true,"extensions":["hal"]},"application/vnd.handheld-entertainment+xml":{"source":"iana","compressible":true,"extensions":["zmm"]},"application/vnd.hbci":{"source":"iana","extensions":["hbci"]},"application/vnd.hc+json":{"source":"iana","compressible":true},"application/vnd.hcl-bireports":{"source":"iana"},"application/vnd.hdt":{"source":"iana"},"application/vnd.heroku+json":{"source":"iana","compressible":true},"application/vnd.hhe.lesson-player":{"source":"iana","extensions":["les"]},"application/vnd.hp-hpgl":{"source":"iana","extensions":["hpgl"]},"application/vnd.hp-hpid":{"source":"iana","extensions":["hpid"]},"application/vnd.hp-hps":{"source":"iana","extensions":["hps"]},"application/vnd.hp-jlyt":{"source":"iana","extensions":["jlt"]},"application/vnd.hp-pcl":{"source":"iana","extensions":["pcl"]},"application/vnd.hp-pclxl":{"source":"iana","extensions":["pclxl"]},"application/vnd.httphone":{"source":"iana"},"application/vnd.hydrostatix.sof-data":{"source":"iana","extensions":["sfd-hdstx"]},"application/vnd.hyper+json":{"source":"iana","compressible":true},"application/vnd.hyper-item+json":{"source":"iana","compressible":true},"application/vnd.hyperdrive+json":{"source":"iana","compressible":true},"application/vnd.hzn-3d-crossword":{"source":"iana"},"application/vnd.ibm.afplinedata":{"source":"iana"},"application/vnd.ibm.electronic-media":{"source":"iana"},"application/vnd.ibm.minipay":{"source":"iana","extensions":["mpy"]},"application/vnd.ibm.modcap":{"source":"iana","extensions":["afp","listafp","list3820"]},"application/vnd.ibm.rights-management":{"source":"iana","extensions":["irm"]},"application/vnd.ibm.secure-container":{"source":"iana","extensions":["sc"]},"application/vnd.iccprofile":{"source":"iana","extensions":["icc","icm"]},"application/vnd.ieee.1905":{"source":"iana"},"application/vnd.igloader":{"source":"iana","extensions":["igl"]},"application/vnd.imagemeter.folder+zip":{"source":"iana","compressible":false},"application/vnd.imagemeter.image+zip":{"source":"iana","compressible":false},"application/vnd.immervision-ivp":{"source":"iana","extensions":["ivp"]},"application/vnd.immervision-ivu":{"source":"iana","extensions":["ivu"]},"application/vnd.ims.imsccv1p1":{"source":"iana"},"application/vnd.ims.imsccv1p2":{"source":"iana"},"application/vnd.ims.imsccv1p3":{"source":"iana"},"application/vnd.ims.lis.v2.result+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolconsumerprofile+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolproxy.id+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings+json":{"source":"iana","compressible":true},"application/vnd.ims.lti.v2.toolsettings.simple+json":{"source":"iana","compressible":true},"application/vnd.informedcontrol.rms+xml":{"source":"iana","compressible":true},"application/vnd.informix-visionary":{"source":"iana"},"application/vnd.infotech.project":{"source":"iana"},"application/vnd.infotech.project+xml":{"source":"iana","compressible":true},"application/vnd.innopath.wamp.notification":{"source":"iana"},"application/vnd.insors.igm":{"source":"iana","extensions":["igm"]},"application/vnd.intercon.formnet":{"source":"iana","extensions":["xpw","xpx"]},"application/vnd.intergeo":{"source":"iana","extensions":["i2g"]},"application/vnd.intertrust.digibox":{"source":"iana"},"application/vnd.intertrust.nncp":{"source":"iana"},"application/vnd.intu.qbo":{"source":"iana","extensions":["qbo"]},"application/vnd.intu.qfx":{"source":"iana","extensions":["qfx"]},"application/vnd.iptc.g2.catalogitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.conceptitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.knowledgeitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.newsmessage+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.packageitem+xml":{"source":"iana","compressible":true},"application/vnd.iptc.g2.planningitem+xml":{"source":"iana","compressible":true},"application/vnd.ipunplugged.rcprofile":{"source":"iana","extensions":["rcprofile"]},"application/vnd.irepository.package+xml":{"source":"iana","compressible":true,"extensions":["irp"]},"application/vnd.is-xpr":{"source":"iana","extensions":["xpr"]},"application/vnd.isac.fcs":{"source":"iana","extensions":["fcs"]},"application/vnd.jam":{"source":"iana","extensions":["jam"]},"application/vnd.japannet-directory-service":{"source":"iana"},"application/vnd.japannet-jpnstore-wakeup":{"source":"iana"},"application/vnd.japannet-payment-wakeup":{"source":"iana"},"application/vnd.japannet-registration":{"source":"iana"},"application/vnd.japannet-registration-wakeup":{"source":"iana"},"application/vnd.japannet-setstore-wakeup":{"source":"iana"},"application/vnd.japannet-verification":{"source":"iana"},"application/vnd.japannet-verification-wakeup":{"source":"iana"},"application/vnd.jcp.javame.midlet-rms":{"source":"iana","extensions":["rms"]},"application/vnd.jisp":{"source":"iana","extensions":["jisp"]},"application/vnd.joost.joda-archive":{"source":"iana","extensions":["joda"]},"application/vnd.jsk.isdn-ngn":{"source":"iana"},"application/vnd.kahootz":{"source":"iana","extensions":["ktz","ktr"]},"application/vnd.kde.karbon":{"source":"iana","extensions":["karbon"]},"application/vnd.kde.kchart":{"source":"iana","extensions":["chrt"]},"application/vnd.kde.kformula":{"source":"iana","extensions":["kfo"]},"application/vnd.kde.kivio":{"source":"iana","extensions":["flw"]},"application/vnd.kde.kontour":{"source":"iana","extensions":["kon"]},"application/vnd.kde.kpresenter":{"source":"iana","extensions":["kpr","kpt"]},"application/vnd.kde.kspread":{"source":"iana","extensions":["ksp"]},"application/vnd.kde.kword":{"source":"iana","extensions":["kwd","kwt"]},"application/vnd.kenameaapp":{"source":"iana","extensions":["htke"]},"application/vnd.kidspiration":{"source":"iana","extensions":["kia"]},"application/vnd.kinar":{"source":"iana","extensions":["kne","knp"]},"application/vnd.koan":{"source":"iana","extensions":["skp","skd","skt","skm"]},"application/vnd.kodak-descriptor":{"source":"iana","extensions":["sse"]},"application/vnd.las.las+json":{"source":"iana","compressible":true},"application/vnd.las.las+xml":{"source":"iana","compressible":true,"extensions":["lasxml"]},"application/vnd.leap+json":{"source":"iana","compressible":true},"application/vnd.liberty-request+xml":{"source":"iana","compressible":true},"application/vnd.llamagraphics.life-balance.desktop":{"source":"iana","extensions":["lbd"]},"application/vnd.llamagraphics.life-balance.exchange+xml":{"source":"iana","compressible":true,"extensions":["lbe"]},"application/vnd.lotus-1-2-3":{"source":"iana","extensions":["123"]},"application/vnd.lotus-approach":{"source":"iana","extensions":["apr"]},"application/vnd.lotus-freelance":{"source":"iana","extensions":["pre"]},"application/vnd.lotus-notes":{"source":"iana","extensions":["nsf"]},"application/vnd.lotus-organizer":{"source":"iana","extensions":["org"]},"application/vnd.lotus-screencam":{"source":"iana","extensions":["scm"]},"application/vnd.lotus-wordpro":{"source":"iana","extensions":["lwp"]},"application/vnd.macports.portpkg":{"source":"iana","extensions":["portpkg"]},"application/vnd.mapbox-vector-tile":{"source":"iana"},"application/vnd.marlin.drm.actiontoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.conftoken+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.license+xml":{"source":"iana","compressible":true},"application/vnd.marlin.drm.mdcf":{"source":"iana"},"application/vnd.mason+json":{"source":"iana","compressible":true},"application/vnd.maxmind.maxmind-db":{"source":"iana"},"application/vnd.mcd":{"source":"iana","extensions":["mcd"]},"application/vnd.medcalcdata":{"source":"iana","extensions":["mc1"]},"application/vnd.mediastation.cdkey":{"source":"iana","extensions":["cdkey"]},"application/vnd.meridian-slingshot":{"source":"iana"},"application/vnd.mfer":{"source":"iana","extensions":["mwf"]},"application/vnd.mfmp":{"source":"iana","extensions":["mfm"]},"application/vnd.micro+json":{"source":"iana","compressible":true},"application/vnd.micrografx.flo":{"source":"iana","extensions":["flo"]},"application/vnd.micrografx.igx":{"source":"iana","extensions":["igx"]},"application/vnd.microsoft.portable-executable":{"source":"iana"},"application/vnd.microsoft.windows.thumbnail-cache":{"source":"iana"},"application/vnd.miele+json":{"source":"iana","compressible":true},"application/vnd.mif":{"source":"iana","extensions":["mif"]},"application/vnd.minisoft-hp3000-save":{"source":"iana"},"application/vnd.mitsubishi.misty-guard.trustweb":{"source":"iana"},"application/vnd.mobius.daf":{"source":"iana","extensions":["daf"]},"application/vnd.mobius.dis":{"source":"iana","extensions":["dis"]},"application/vnd.mobius.mbk":{"source":"iana","extensions":["mbk"]},"application/vnd.mobius.mqy":{"source":"iana","extensions":["mqy"]},"application/vnd.mobius.msl":{"source":"iana","extensions":["msl"]},"application/vnd.mobius.plc":{"source":"iana","extensions":["plc"]},"application/vnd.mobius.txf":{"source":"iana","extensions":["txf"]},"application/vnd.mophun.application":{"source":"iana","extensions":["mpn"]},"application/vnd.mophun.certificate":{"source":"iana","extensions":["mpc"]},"application/vnd.motorola.flexsuite":{"source":"iana"},"application/vnd.motorola.flexsuite.adsi":{"source":"iana"},"application/vnd.motorola.flexsuite.fis":{"source":"iana"},"application/vnd.motorola.flexsuite.gotap":{"source":"iana"},"application/vnd.motorola.flexsuite.kmr":{"source":"iana"},"application/vnd.motorola.flexsuite.ttc":{"source":"iana"},"application/vnd.motorola.flexsuite.wem":{"source":"iana"},"application/vnd.motorola.iprm":{"source":"iana"},"application/vnd.mozilla.xul+xml":{"source":"iana","compressible":true,"extensions":["xul"]},"application/vnd.ms-3mfdocument":{"source":"iana"},"application/vnd.ms-artgalry":{"source":"iana","extensions":["cil"]},"application/vnd.ms-asf":{"source":"iana"},"application/vnd.ms-cab-compressed":{"source":"iana","extensions":["cab"]},"application/vnd.ms-color.iccprofile":{"source":"apache"},"application/vnd.ms-excel":{"source":"iana","compressible":false,"extensions":["xls","xlm","xla","xlc","xlt","xlw"]},"application/vnd.ms-excel.addin.macroenabled.12":{"source":"iana","extensions":["xlam"]},"application/vnd.ms-excel.sheet.binary.macroenabled.12":{"source":"iana","extensions":["xlsb"]},"application/vnd.ms-excel.sheet.macroenabled.12":{"source":"iana","extensions":["xlsm"]},"application/vnd.ms-excel.template.macroenabled.12":{"source":"iana","extensions":["xltm"]},"application/vnd.ms-fontobject":{"source":"iana","compressible":true,"extensions":["eot"]},"application/vnd.ms-htmlhelp":{"source":"iana","extensions":["chm"]},"application/vnd.ms-ims":{"source":"iana","extensions":["ims"]},"application/vnd.ms-lrm":{"source":"iana","extensions":["lrm"]},"application/vnd.ms-office.activex+xml":{"source":"iana","compressible":true},"application/vnd.ms-officetheme":{"source":"iana","extensions":["thmx"]},"application/vnd.ms-opentype":{"source":"apache","compressible":true},"application/vnd.ms-outlook":{"compressible":false,"extensions":["msg"]},"application/vnd.ms-package.obfuscated-opentype":{"source":"apache"},"application/vnd.ms-pki.seccat":{"source":"apache","extensions":["cat"]},"application/vnd.ms-pki.stl":{"source":"apache","extensions":["stl"]},"application/vnd.ms-playready.initiator+xml":{"source":"iana","compressible":true},"application/vnd.ms-powerpoint":{"source":"iana","compressible":false,"extensions":["ppt","pps","pot"]},"application/vnd.ms-powerpoint.addin.macroenabled.12":{"source":"iana","extensions":["ppam"]},"application/vnd.ms-powerpoint.presentation.macroenabled.12":{"source":"iana","extensions":["pptm"]},"application/vnd.ms-powerpoint.slide.macroenabled.12":{"source":"iana","extensions":["sldm"]},"application/vnd.ms-powerpoint.slideshow.macroenabled.12":{"source":"iana","extensions":["ppsm"]},"application/vnd.ms-powerpoint.template.macroenabled.12":{"source":"iana","extensions":["potm"]},"application/vnd.ms-printdevicecapabilities+xml":{"source":"iana","compressible":true},"application/vnd.ms-printing.printticket+xml":{"source":"apache","compressible":true},"application/vnd.ms-printschematicket+xml":{"source":"iana","compressible":true},"application/vnd.ms-project":{"source":"iana","extensions":["mpp","mpt"]},"application/vnd.ms-tnef":{"source":"iana"},"application/vnd.ms-windows.devicepairing":{"source":"iana"},"application/vnd.ms-windows.nwprinting.oob":{"source":"iana"},"application/vnd.ms-windows.printerpairing":{"source":"iana"},"application/vnd.ms-windows.wsd.oob":{"source":"iana"},"application/vnd.ms-wmdrm.lic-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.lic-resp":{"source":"iana"},"application/vnd.ms-wmdrm.meter-chlg-req":{"source":"iana"},"application/vnd.ms-wmdrm.meter-resp":{"source":"iana"},"application/vnd.ms-word.document.macroenabled.12":{"source":"iana","extensions":["docm"]},"application/vnd.ms-word.template.macroenabled.12":{"source":"iana","extensions":["dotm"]},"application/vnd.ms-works":{"source":"iana","extensions":["wps","wks","wcm","wdb"]},"application/vnd.ms-wpl":{"source":"iana","extensions":["wpl"]},"application/vnd.ms-xpsdocument":{"source":"iana","compressible":false,"extensions":["xps"]},"application/vnd.msa-disk-image":{"source":"iana"},"application/vnd.mseq":{"source":"iana","extensions":["mseq"]},"application/vnd.msign":{"source":"iana"},"application/vnd.multiad.creator":{"source":"iana"},"application/vnd.multiad.creator.cif":{"source":"iana"},"application/vnd.music-niff":{"source":"iana"},"application/vnd.musician":{"source":"iana","extensions":["mus"]},"application/vnd.muvee.style":{"source":"iana","extensions":["msty"]},"application/vnd.mynfc":{"source":"iana","extensions":["taglet"]},"application/vnd.ncd.control":{"source":"iana"},"application/vnd.ncd.reference":{"source":"iana"},"application/vnd.nearst.inv+json":{"source":"iana","compressible":true},"application/vnd.nervana":{"source":"iana"},"application/vnd.netfpx":{"source":"iana"},"application/vnd.neurolanguage.nlu":{"source":"iana","extensions":["nlu"]},"application/vnd.nimn":{"source":"iana"},"application/vnd.nintendo.nitro.rom":{"source":"iana"},"application/vnd.nintendo.snes.rom":{"source":"iana"},"application/vnd.nitf":{"source":"iana","extensions":["ntf","nitf"]},"application/vnd.noblenet-directory":{"source":"iana","extensions":["nnd"]},"application/vnd.noblenet-sealer":{"source":"iana","extensions":["nns"]},"application/vnd.noblenet-web":{"source":"iana","extensions":["nnw"]},"application/vnd.nokia.catalogs":{"source":"iana"},"application/vnd.nokia.conml+wbxml":{"source":"iana"},"application/vnd.nokia.conml+xml":{"source":"iana","compressible":true},"application/vnd.nokia.iptv.config+xml":{"source":"iana","compressible":true},"application/vnd.nokia.isds-radio-presets":{"source":"iana"},"application/vnd.nokia.landmark+wbxml":{"source":"iana"},"application/vnd.nokia.landmark+xml":{"source":"iana","compressible":true},"application/vnd.nokia.landmarkcollection+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.ac+xml":{"source":"iana","compressible":true},"application/vnd.nokia.n-gage.data":{"source":"iana","extensions":["ngdat"]},"application/vnd.nokia.n-gage.symbian.install":{"source":"iana","extensions":["n-gage"]},"application/vnd.nokia.ncd":{"source":"iana"},"application/vnd.nokia.pcd+wbxml":{"source":"iana"},"application/vnd.nokia.pcd+xml":{"source":"iana","compressible":true},"application/vnd.nokia.radio-preset":{"source":"iana","extensions":["rpst"]},"application/vnd.nokia.radio-presets":{"source":"iana","extensions":["rpss"]},"application/vnd.novadigm.edm":{"source":"iana","extensions":["edm"]},"application/vnd.novadigm.edx":{"source":"iana","extensions":["edx"]},"application/vnd.novadigm.ext":{"source":"iana","extensions":["ext"]},"application/vnd.ntt-local.content-share":{"source":"iana"},"application/vnd.ntt-local.file-transfer":{"source":"iana"},"application/vnd.ntt-local.ogw_remote-access":{"source":"iana"},"application/vnd.ntt-local.sip-ta_remote":{"source":"iana"},"application/vnd.ntt-local.sip-ta_tcp_stream":{"source":"iana"},"application/vnd.oasis.opendocument.chart":{"source":"iana","extensions":["odc"]},"application/vnd.oasis.opendocument.chart-template":{"source":"iana","extensions":["otc"]},"application/vnd.oasis.opendocument.database":{"source":"iana","extensions":["odb"]},"application/vnd.oasis.opendocument.formula":{"source":"iana","extensions":["odf"]},"application/vnd.oasis.opendocument.formula-template":{"source":"iana","extensions":["odft"]},"application/vnd.oasis.opendocument.graphics":{"source":"iana","compressible":false,"extensions":["odg"]},"application/vnd.oasis.opendocument.graphics-template":{"source":"iana","extensions":["otg"]},"application/vnd.oasis.opendocument.image":{"source":"iana","extensions":["odi"]},"application/vnd.oasis.opendocument.image-template":{"source":"iana","extensions":["oti"]},"application/vnd.oasis.opendocument.presentation":{"source":"iana","compressible":false,"extensions":["odp"]},"application/vnd.oasis.opendocument.presentation-template":{"source":"iana","extensions":["otp"]},"application/vnd.oasis.opendocument.spreadsheet":{"source":"iana","compressible":false,"extensions":["ods"]},"application/vnd.oasis.opendocument.spreadsheet-template":{"source":"iana","extensions":["ots"]},"application/vnd.oasis.opendocument.text":{"source":"iana","compressible":false,"extensions":["odt"]},"application/vnd.oasis.opendocument.text-master":{"source":"iana","extensions":["odm"]},"application/vnd.oasis.opendocument.text-template":{"source":"iana","extensions":["ott"]},"application/vnd.oasis.opendocument.text-web":{"source":"iana","extensions":["oth"]},"application/vnd.obn":{"source":"iana"},"application/vnd.ocf+cbor":{"source":"iana"},"application/vnd.oftn.l10n+json":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessdownload+xml":{"source":"iana","compressible":true},"application/vnd.oipf.contentaccessstreaming+xml":{"source":"iana","compressible":true},"application/vnd.oipf.cspg-hexbinary":{"source":"iana"},"application/vnd.oipf.dae.svg+xml":{"source":"iana","compressible":true},"application/vnd.oipf.dae.xhtml+xml":{"source":"iana","compressible":true},"application/vnd.oipf.mippvcontrolmessage+xml":{"source":"iana","compressible":true},"application/vnd.oipf.pae.gem":{"source":"iana"},"application/vnd.oipf.spdiscovery+xml":{"source":"iana","compressible":true},"application/vnd.oipf.spdlist+xml":{"source":"iana","compressible":true},"application/vnd.oipf.ueprofile+xml":{"source":"iana","compressible":true},"application/vnd.oipf.userprofile+xml":{"source":"iana","compressible":true},"application/vnd.olpc-sugar":{"source":"iana","extensions":["xo"]},"application/vnd.oma-scws-config":{"source":"iana"},"application/vnd.oma-scws-http-request":{"source":"iana"},"application/vnd.oma-scws-http-response":{"source":"iana"},"application/vnd.oma.bcast.associated-procedure-parameter+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.drm-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.imd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.ltkm":{"source":"iana"},"application/vnd.oma.bcast.notification+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.provisioningtrigger":{"source":"iana"},"application/vnd.oma.bcast.sgboot":{"source":"iana"},"application/vnd.oma.bcast.sgdd+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sgdu":{"source":"iana"},"application/vnd.oma.bcast.simple-symbol-container":{"source":"iana"},"application/vnd.oma.bcast.smartcard-trigger+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.sprov+xml":{"source":"iana","compressible":true},"application/vnd.oma.bcast.stkm":{"source":"iana"},"application/vnd.oma.cab-address-book+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-feature-handler+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-pcc+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-subs-invite+xml":{"source":"iana","compressible":true},"application/vnd.oma.cab-user-prefs+xml":{"source":"iana","compressible":true},"application/vnd.oma.dcd":{"source":"iana"},"application/vnd.oma.dcdc":{"source":"iana"},"application/vnd.oma.dd2+xml":{"source":"iana","compressible":true,"extensions":["dd2"]},"application/vnd.oma.drm.risd+xml":{"source":"iana","compressible":true},"application/vnd.oma.group-usage-list+xml":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+json":{"source":"iana","compressible":true},"application/vnd.oma.lwm2m+tlv":{"source":"iana"},"application/vnd.oma.pal+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.detailed-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.final-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.groups+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.invocation-descriptor+xml":{"source":"iana","compressible":true},"application/vnd.oma.poc.optimized-progress-report+xml":{"source":"iana","compressible":true},"application/vnd.oma.push":{"source":"iana"},"application/vnd.oma.scidm.messages+xml":{"source":"iana","compressible":true},"application/vnd.oma.xcap-directory+xml":{"source":"iana","compressible":true},"application/vnd.omads-email+xml":{"source":"iana","compressible":true},"application/vnd.omads-file+xml":{"source":"iana","compressible":true},"application/vnd.omads-folder+xml":{"source":"iana","compressible":true},"application/vnd.omaloc-supl-init":{"source":"iana"},"application/vnd.onepager":{"source":"iana"},"application/vnd.onepagertamp":{"source":"iana"},"application/vnd.onepagertamx":{"source":"iana"},"application/vnd.onepagertat":{"source":"iana"},"application/vnd.onepagertatp":{"source":"iana"},"application/vnd.onepagertatx":{"source":"iana"},"application/vnd.openblox.game+xml":{"source":"iana","compressible":true},"application/vnd.openblox.game-binary":{"source":"iana"},"application/vnd.openeye.oeb":{"source":"iana"},"application/vnd.openofficeorg.extension":{"source":"apache","extensions":["oxt"]},"application/vnd.openstreetmap.data+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.custom-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.customxmlproperties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawing+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chart+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.extended-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{"source":"iana","compressible":false,"extensions":["pptx"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.presprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slide":{"source":"iana","extensions":["sldx"]},"application/vnd.openxmlformats-officedocument.presentationml.slide+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideshow":{"source":"iana","extensions":["ppsx"]},"application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.tags+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.template":{"source":"iana","extensions":["potx"]},"application/vnd.openxmlformats-officedocument.presentationml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"source":"iana","compressible":false,"extensions":["xlsx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.template":{"source":"iana","extensions":["xltx"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.theme+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.themeoverride+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.vmldrawing":{"source":"iana"},"application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{"source":"iana","compressible":false,"extensions":["docx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.template":{"source":"iana","extensions":["dotx"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.core-properties+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml":{"source":"iana","compressible":true},"application/vnd.openxmlformats-package.relationships+xml":{"source":"iana","compressible":true},"application/vnd.oracle.resource+json":{"source":"iana","compressible":true},"application/vnd.orange.indata":{"source":"iana"},"application/vnd.osa.netdeploy":{"source":"iana"},"application/vnd.osgeo.mapguide.package":{"source":"iana","extensions":["mgp"]},"application/vnd.osgi.bundle":{"source":"iana"},"application/vnd.osgi.dp":{"source":"iana","extensions":["dp"]},"application/vnd.osgi.subsystem":{"source":"iana","extensions":["esa"]},"application/vnd.otps.ct-kip+xml":{"source":"iana","compressible":true},"application/vnd.oxli.countgraph":{"source":"iana"},"application/vnd.pagerduty+json":{"source":"iana","compressible":true},"application/vnd.palm":{"source":"iana","extensions":["pdb","pqa","oprc"]},"application/vnd.panoply":{"source":"iana"},"application/vnd.paos+xml":{"source":"iana","compressible":true},"application/vnd.paos.xml":{"source":"apache"},"application/vnd.patentdive":{"source":"iana"},"application/vnd.pawaafile":{"source":"iana","extensions":["paw"]},"application/vnd.pcos":{"source":"iana"},"application/vnd.pg.format":{"source":"iana","extensions":["str"]},"application/vnd.pg.osasli":{"source":"iana","extensions":["ei6"]},"application/vnd.piaccess.application-licence":{"source":"iana"},"application/vnd.picsel":{"source":"iana","extensions":["efif"]},"application/vnd.pmi.widget":{"source":"iana","extensions":["wg"]},"application/vnd.poc.group-advertisement+xml":{"source":"iana","compressible":true},"application/vnd.pocketlearn":{"source":"iana","extensions":["plf"]},"application/vnd.powerbuilder6":{"source":"iana","extensions":["pbd"]},"application/vnd.powerbuilder6-s":{"source":"iana"},"application/vnd.powerbuilder7":{"source":"iana"},"application/vnd.powerbuilder7-s":{"source":"iana"},"application/vnd.powerbuilder75":{"source":"iana"},"application/vnd.powerbuilder75-s":{"source":"iana"},"application/vnd.preminet":{"source":"iana"},"application/vnd.previewsystems.box":{"source":"iana","extensions":["box"]},"application/vnd.proteus.magazine":{"source":"iana","extensions":["mgz"]},"application/vnd.psfs":{"source":"iana"},"application/vnd.publishare-delta-tree":{"source":"iana","extensions":["qps"]},"application/vnd.pvi.ptid1":{"source":"iana","extensions":["ptid"]},"application/vnd.pwg-multiplexed":{"source":"iana"},"application/vnd.pwg-xhtml-print+xml":{"source":"iana","compressible":true},"application/vnd.qualcomm.brew-app-res":{"source":"iana"},"application/vnd.quarantainenet":{"source":"iana"},"application/vnd.quark.quarkxpress":{"source":"iana","extensions":["qxd","qxt","qwd","qwt","qxl","qxb"]},"application/vnd.quobject-quoxdocument":{"source":"iana"},"application/vnd.radisys.moml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-conn+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-audit-stream+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-conf+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-base+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-detect+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-fax-sendrecv+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-group+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-speech+xml":{"source":"iana","compressible":true},"application/vnd.radisys.msml-dialog-transform+xml":{"source":"iana","compressible":true},"application/vnd.rainstor.data":{"source":"iana"},"application/vnd.rapid":{"source":"iana"},"application/vnd.rar":{"source":"iana"},"application/vnd.realvnc.bed":{"source":"iana","extensions":["bed"]},"application/vnd.recordare.musicxml":{"source":"iana","extensions":["mxl"]},"application/vnd.recordare.musicxml+xml":{"source":"iana","compressible":true,"extensions":["musicxml"]},"application/vnd.renlearn.rlprint":{"source":"iana"},"application/vnd.restful+json":{"source":"iana","compressible":true},"application/vnd.rig.cryptonote":{"source":"iana","extensions":["cryptonote"]},"application/vnd.rim.cod":{"source":"apache","extensions":["cod"]},"application/vnd.rn-realmedia":{"source":"apache","extensions":["rm"]},"application/vnd.rn-realmedia-vbr":{"source":"apache","extensions":["rmvb"]},"application/vnd.route66.link66+xml":{"source":"iana","compressible":true,"extensions":["link66"]},"application/vnd.rs-274x":{"source":"iana"},"application/vnd.ruckus.download":{"source":"iana"},"application/vnd.s3sms":{"source":"iana"},"application/vnd.sailingtracker.track":{"source":"iana","extensions":["st"]},"application/vnd.sbm.cid":{"source":"iana"},"application/vnd.sbm.mid2":{"source":"iana"},"application/vnd.scribus":{"source":"iana"},"application/vnd.sealed.3df":{"source":"iana"},"application/vnd.sealed.csf":{"source":"iana"},"application/vnd.sealed.doc":{"source":"iana"},"application/vnd.sealed.eml":{"source":"iana"},"application/vnd.sealed.mht":{"source":"iana"},"application/vnd.sealed.net":{"source":"iana"},"application/vnd.sealed.ppt":{"source":"iana"},"application/vnd.sealed.tiff":{"source":"iana"},"application/vnd.sealed.xls":{"source":"iana"},"application/vnd.sealedmedia.softseal.html":{"source":"iana"},"application/vnd.sealedmedia.softseal.pdf":{"source":"iana"},"application/vnd.seemail":{"source":"iana","extensions":["see"]},"application/vnd.sema":{"source":"iana","extensions":["sema"]},"application/vnd.semd":{"source":"iana","extensions":["semd"]},"application/vnd.semf":{"source":"iana","extensions":["semf"]},"application/vnd.shana.informed.formdata":{"source":"iana","extensions":["ifm"]},"application/vnd.shana.informed.formtemplate":{"source":"iana","extensions":["itp"]},"application/vnd.shana.informed.interchange":{"source":"iana","extensions":["iif"]},"application/vnd.shana.informed.package":{"source":"iana","extensions":["ipk"]},"application/vnd.shootproof+json":{"source":"iana","compressible":true},"application/vnd.sigrok.session":{"source":"iana"},"application/vnd.simtech-mindmapper":{"source":"iana","extensions":["twd","twds"]},"application/vnd.siren+json":{"source":"iana","compressible":true},"application/vnd.smaf":{"source":"iana","extensions":["mmf"]},"application/vnd.smart.notebook":{"source":"iana"},"application/vnd.smart.teacher":{"source":"iana","extensions":["teacher"]},"application/vnd.software602.filler.form+xml":{"source":"iana","compressible":true},"application/vnd.software602.filler.form-xml-zip":{"source":"iana"},"application/vnd.solent.sdkm+xml":{"source":"iana","compressible":true,"extensions":["sdkm","sdkd"]},"application/vnd.spotfire.dxp":{"source":"iana","extensions":["dxp"]},"application/vnd.spotfire.sfs":{"source":"iana","extensions":["sfs"]},"application/vnd.sqlite3":{"source":"iana"},"application/vnd.sss-cod":{"source":"iana"},"application/vnd.sss-dtf":{"source":"iana"},"application/vnd.sss-ntf":{"source":"iana"},"application/vnd.stardivision.calc":{"source":"apache","extensions":["sdc"]},"application/vnd.stardivision.draw":{"source":"apache","extensions":["sda"]},"application/vnd.stardivision.impress":{"source":"apache","extensions":["sdd"]},"application/vnd.stardivision.math":{"source":"apache","extensions":["smf"]},"application/vnd.stardivision.writer":{"source":"apache","extensions":["sdw","vor"]},"application/vnd.stardivision.writer-global":{"source":"apache","extensions":["sgl"]},"application/vnd.stepmania.package":{"source":"iana","extensions":["smzip"]},"application/vnd.stepmania.stepchart":{"source":"iana","extensions":["sm"]},"application/vnd.street-stream":{"source":"iana"},"application/vnd.sun.wadl+xml":{"source":"iana","compressible":true,"extensions":["wadl"]},"application/vnd.sun.xml.calc":{"source":"apache","extensions":["sxc"]},"application/vnd.sun.xml.calc.template":{"source":"apache","extensions":["stc"]},"application/vnd.sun.xml.draw":{"source":"apache","extensions":["sxd"]},"application/vnd.sun.xml.draw.template":{"source":"apache","extensions":["std"]},"application/vnd.sun.xml.impress":{"source":"apache","extensions":["sxi"]},"application/vnd.sun.xml.impress.template":{"source":"apache","extensions":["sti"]},"application/vnd.sun.xml.math":{"source":"apache","extensions":["sxm"]},"application/vnd.sun.xml.writer":{"source":"apache","extensions":["sxw"]},"application/vnd.sun.xml.writer.global":{"source":"apache","extensions":["sxg"]},"application/vnd.sun.xml.writer.template":{"source":"apache","extensions":["stw"]},"application/vnd.sus-calendar":{"source":"iana","extensions":["sus","susp"]},"application/vnd.svd":{"source":"iana","extensions":["svd"]},"application/vnd.swiftview-ics":{"source":"iana"},"application/vnd.symbian.install":{"source":"apache","extensions":["sis","sisx"]},"application/vnd.syncml+xml":{"source":"iana","compressible":true,"extensions":["xsm"]},"application/vnd.syncml.dm+wbxml":{"source":"iana","extensions":["bdm"]},"application/vnd.syncml.dm+xml":{"source":"iana","compressible":true,"extensions":["xdm"]},"application/vnd.syncml.dm.notification":{"source":"iana"},"application/vnd.syncml.dmddf+wbxml":{"source":"iana"},"application/vnd.syncml.dmddf+xml":{"source":"iana","compressible":true},"application/vnd.syncml.dmtnds+wbxml":{"source":"iana"},"application/vnd.syncml.dmtnds+xml":{"source":"iana","compressible":true},"application/vnd.syncml.ds.notification":{"source":"iana"},"application/vnd.tableschema+json":{"source":"iana","compressible":true},"application/vnd.tao.intent-module-archive":{"source":"iana","extensions":["tao"]},"application/vnd.tcpdump.pcap":{"source":"iana","extensions":["pcap","cap","dmp"]},"application/vnd.think-cell.ppttc+json":{"source":"iana","compressible":true},"application/vnd.tmd.mediaflex.api+xml":{"source":"iana","compressible":true},"application/vnd.tml":{"source":"iana"},"application/vnd.tmobile-livetv":{"source":"iana","extensions":["tmo"]},"application/vnd.tri.onesource":{"source":"iana"},"application/vnd.trid.tpt":{"source":"iana","extensions":["tpt"]},"application/vnd.triscape.mxs":{"source":"iana","extensions":["mxs"]},"application/vnd.trueapp":{"source":"iana","extensions":["tra"]},"application/vnd.truedoc":{"source":"iana"},"application/vnd.ubisoft.webplayer":{"source":"iana"},"application/vnd.ufdl":{"source":"iana","extensions":["ufd","ufdl"]},"application/vnd.uiq.theme":{"source":"iana","extensions":["utz"]},"application/vnd.umajin":{"source":"iana","extensions":["umj"]},"application/vnd.unity":{"source":"iana","extensions":["unityweb"]},"application/vnd.uoml+xml":{"source":"iana","compressible":true,"extensions":["uoml"]},"application/vnd.uplanet.alert":{"source":"iana"},"application/vnd.uplanet.alert-wbxml":{"source":"iana"},"application/vnd.uplanet.bearer-choice":{"source":"iana"},"application/vnd.uplanet.bearer-choice-wbxml":{"source":"iana"},"application/vnd.uplanet.cacheop":{"source":"iana"},"application/vnd.uplanet.cacheop-wbxml":{"source":"iana"},"application/vnd.uplanet.channel":{"source":"iana"},"application/vnd.uplanet.channel-wbxml":{"source":"iana"},"application/vnd.uplanet.list":{"source":"iana"},"application/vnd.uplanet.list-wbxml":{"source":"iana"},"application/vnd.uplanet.listcmd":{"source":"iana"},"application/vnd.uplanet.listcmd-wbxml":{"source":"iana"},"application/vnd.uplanet.signal":{"source":"iana"},"application/vnd.uri-map":{"source":"iana"},"application/vnd.valve.source.material":{"source":"iana"},"application/vnd.vcx":{"source":"iana","extensions":["vcx"]},"application/vnd.vd-study":{"source":"iana"},"application/vnd.vectorworks":{"source":"iana"},"application/vnd.vel+json":{"source":"iana","compressible":true},"application/vnd.verimatrix.vcas":{"source":"iana"},"application/vnd.vidsoft.vidconference":{"source":"iana"},"application/vnd.visio":{"source":"iana","extensions":["vsd","vst","vss","vsw"]},"application/vnd.visionary":{"source":"iana","extensions":["vis"]},"application/vnd.vividence.scriptfile":{"source":"iana"},"application/vnd.vsf":{"source":"iana","extensions":["vsf"]},"application/vnd.wap.sic":{"source":"iana"},"application/vnd.wap.slc":{"source":"iana"},"application/vnd.wap.wbxml":{"source":"iana","extensions":["wbxml"]},"application/vnd.wap.wmlc":{"source":"iana","extensions":["wmlc"]},"application/vnd.wap.wmlscriptc":{"source":"iana","extensions":["wmlsc"]},"application/vnd.webturbo":{"source":"iana","extensions":["wtb"]},"application/vnd.wfa.p2p":{"source":"iana"},"application/vnd.wfa.wsc":{"source":"iana"},"application/vnd.windows.devicepairing":{"source":"iana"},"application/vnd.wmc":{"source":"iana"},"application/vnd.wmf.bootstrap":{"source":"iana"},"application/vnd.wolfram.mathematica":{"source":"iana"},"application/vnd.wolfram.mathematica.package":{"source":"iana"},"application/vnd.wolfram.player":{"source":"iana","extensions":["nbp"]},"application/vnd.wordperfect":{"source":"iana","extensions":["wpd"]},"application/vnd.wqd":{"source":"iana","extensions":["wqd"]},"application/vnd.wrq-hp3000-labelled":{"source":"iana"},"application/vnd.wt.stf":{"source":"iana","extensions":["stf"]},"application/vnd.wv.csp+wbxml":{"source":"iana"},"application/vnd.wv.csp+xml":{"source":"iana","compressible":true},"application/vnd.wv.ssp+xml":{"source":"iana","compressible":true},"application/vnd.xacml+json":{"source":"iana","compressible":true},"application/vnd.xara":{"source":"iana","extensions":["xar"]},"application/vnd.xfdl":{"source":"iana","extensions":["xfdl"]},"application/vnd.xfdl.webform":{"source":"iana"},"application/vnd.xmi+xml":{"source":"iana","compressible":true},"application/vnd.xmpie.cpkg":{"source":"iana"},"application/vnd.xmpie.dpkg":{"source":"iana"},"application/vnd.xmpie.plan":{"source":"iana"},"application/vnd.xmpie.ppkg":{"source":"iana"},"application/vnd.xmpie.xlim":{"source":"iana"},"application/vnd.yamaha.hv-dic":{"source":"iana","extensions":["hvd"]},"application/vnd.yamaha.hv-script":{"source":"iana","extensions":["hvs"]},"application/vnd.yamaha.hv-voice":{"source":"iana","extensions":["hvp"]},"application/vnd.yamaha.openscoreformat":{"source":"iana","extensions":["osf"]},"application/vnd.yamaha.openscoreformat.osfpvg+xml":{"source":"iana","compressible":true,"extensions":["osfpvg"]},"application/vnd.yamaha.remote-setup":{"source":"iana"},"application/vnd.yamaha.smaf-audio":{"source":"iana","extensions":["saf"]},"application/vnd.yamaha.smaf-phrase":{"source":"iana","extensions":["spf"]},"application/vnd.yamaha.through-ngn":{"source":"iana"},"application/vnd.yamaha.tunnel-udpencap":{"source":"iana"},"application/vnd.yaoweme":{"source":"iana"},"application/vnd.yellowriver-custom-menu":{"source":"iana","extensions":["cmp"]},"application/vnd.youtube.yt":{"source":"iana"},"application/vnd.zul":{"source":"iana","extensions":["zir","zirz"]},"application/vnd.zzazz.deck+xml":{"source":"iana","compressible":true,"extensions":["zaz"]},"application/voicexml+xml":{"source":"iana","compressible":true,"extensions":["vxml"]},"application/voucher-cms+json":{"source":"iana","compressible":true},"application/vq-rtcpxr":{"source":"iana"},"application/wasm":{"compressible":true,"extensions":["wasm"]},"application/watcherinfo+xml":{"source":"iana","compressible":true},"application/webpush-options+json":{"source":"iana","compressible":true},"application/whoispp-query":{"source":"iana"},"application/whoispp-response":{"source":"iana"},"application/widget":{"source":"iana","extensions":["wgt"]},"application/winhlp":{"source":"apache","extensions":["hlp"]},"application/wita":{"source":"iana"},"application/wordperfect5.1":{"source":"iana"},"application/wsdl+xml":{"source":"iana","compressible":true,"extensions":["wsdl"]},"application/wspolicy+xml":{"source":"iana","compressible":true,"extensions":["wspolicy"]},"application/x-7z-compressed":{"source":"apache","compressible":false,"extensions":["7z"]},"application/x-abiword":{"source":"apache","extensions":["abw"]},"application/x-ace-compressed":{"source":"apache","extensions":["ace"]},"application/x-amf":{"source":"apache"},"application/x-apple-diskimage":{"source":"apache","extensions":["dmg"]},"application/x-arj":{"compressible":false,"extensions":["arj"]},"application/x-authorware-bin":{"source":"apache","extensions":["aab","x32","u32","vox"]},"application/x-authorware-map":{"source":"apache","extensions":["aam"]},"application/x-authorware-seg":{"source":"apache","extensions":["aas"]},"application/x-bcpio":{"source":"apache","extensions":["bcpio"]},"application/x-bdoc":{"compressible":false,"extensions":["bdoc"]},"application/x-bittorrent":{"source":"apache","extensions":["torrent"]},"application/x-blorb":{"source":"apache","extensions":["blb","blorb"]},"application/x-bzip":{"source":"apache","compressible":false,"extensions":["bz"]},"application/x-bzip2":{"source":"apache","compressible":false,"extensions":["bz2","boz"]},"application/x-cbr":{"source":"apache","extensions":["cbr","cba","cbt","cbz","cb7"]},"application/x-cdlink":{"source":"apache","extensions":["vcd"]},"application/x-cfs-compressed":{"source":"apache","extensions":["cfs"]},"application/x-chat":{"source":"apache","extensions":["chat"]},"application/x-chess-pgn":{"source":"apache","extensions":["pgn"]},"application/x-chrome-extension":{"extensions":["crx"]},"application/x-cocoa":{"source":"nginx","extensions":["cco"]},"application/x-compress":{"source":"apache"},"application/x-conference":{"source":"apache","extensions":["nsc"]},"application/x-cpio":{"source":"apache","extensions":["cpio"]},"application/x-csh":{"source":"apache","extensions":["csh"]},"application/x-deb":{"compressible":false},"application/x-debian-package":{"source":"apache","extensions":["deb","udeb"]},"application/x-dgc-compressed":{"source":"apache","extensions":["dgc"]},"application/x-director":{"source":"apache","extensions":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"]},"application/x-doom":{"source":"apache","extensions":["wad"]},"application/x-dtbncx+xml":{"source":"apache","compressible":true,"extensions":["ncx"]},"application/x-dtbook+xml":{"source":"apache","compressible":true,"extensions":["dtb"]},"application/x-dtbresource+xml":{"source":"apache","compressible":true,"extensions":["res"]},"application/x-dvi":{"source":"apache","compressible":false,"extensions":["dvi"]},"application/x-envoy":{"source":"apache","extensions":["evy"]},"application/x-eva":{"source":"apache","extensions":["eva"]},"application/x-font-bdf":{"source":"apache","extensions":["bdf"]},"application/x-font-dos":{"source":"apache"},"application/x-font-framemaker":{"source":"apache"},"application/x-font-ghostscript":{"source":"apache","extensions":["gsf"]},"application/x-font-libgrx":{"source":"apache"},"application/x-font-linux-psf":{"source":"apache","extensions":["psf"]},"application/x-font-pcf":{"source":"apache","extensions":["pcf"]},"application/x-font-snf":{"source":"apache","extensions":["snf"]},"application/x-font-speedo":{"source":"apache"},"application/x-font-sunos-news":{"source":"apache"},"application/x-font-type1":{"source":"apache","extensions":["pfa","pfb","pfm","afm"]},"application/x-font-vfont":{"source":"apache"},"application/x-freearc":{"source":"apache","extensions":["arc"]},"application/x-futuresplash":{"source":"apache","extensions":["spl"]},"application/x-gca-compressed":{"source":"apache","extensions":["gca"]},"application/x-glulx":{"source":"apache","extensions":["ulx"]},"application/x-gnumeric":{"source":"apache","extensions":["gnumeric"]},"application/x-gramps-xml":{"source":"apache","extensions":["gramps"]},"application/x-gtar":{"source":"apache","extensions":["gtar"]},"application/x-gzip":{"source":"apache"},"application/x-hdf":{"source":"apache","extensions":["hdf"]},"application/x-httpd-php":{"compressible":true,"extensions":["php"]},"application/x-install-instructions":{"source":"apache","extensions":["install"]},"application/x-iso9660-image":{"source":"apache","extensions":["iso"]},"application/x-java-archive-diff":{"source":"nginx","extensions":["jardiff"]},"application/x-java-jnlp-file":{"source":"apache","compressible":false,"extensions":["jnlp"]},"application/x-javascript":{"compressible":true},"application/x-latex":{"source":"apache","compressible":false,"extensions":["latex"]},"application/x-lua-bytecode":{"extensions":["luac"]},"application/x-lzh-compressed":{"source":"apache","extensions":["lzh","lha"]},"application/x-makeself":{"source":"nginx","extensions":["run"]},"application/x-mie":{"source":"apache","extensions":["mie"]},"application/x-mobipocket-ebook":{"source":"apache","extensions":["prc","mobi"]},"application/x-mpegurl":{"compressible":false},"application/x-ms-application":{"source":"apache","extensions":["application"]},"application/x-ms-shortcut":{"source":"apache","extensions":["lnk"]},"application/x-ms-wmd":{"source":"apache","extensions":["wmd"]},"application/x-ms-wmz":{"source":"apache","extensions":["wmz"]},"application/x-ms-xbap":{"source":"apache","extensions":["xbap"]},"application/x-msaccess":{"source":"apache","extensions":["mdb"]},"application/x-msbinder":{"source":"apache","extensions":["obd"]},"application/x-mscardfile":{"source":"apache","extensions":["crd"]},"application/x-msclip":{"source":"apache","extensions":["clp"]},"application/x-msdos-program":{"extensions":["exe"]},"application/x-msdownload":{"source":"apache","extensions":["exe","dll","com","bat","msi"]},"application/x-msmediaview":{"source":"apache","extensions":["mvb","m13","m14"]},"application/x-msmetafile":{"source":"apache","extensions":["wmf","wmz","emf","emz"]},"application/x-msmoney":{"source":"apache","extensions":["mny"]},"application/x-mspublisher":{"source":"apache","extensions":["pub"]},"application/x-msschedule":{"source":"apache","extensions":["scd"]},"application/x-msterminal":{"source":"apache","extensions":["trm"]},"application/x-mswrite":{"source":"apache","extensions":["wri"]},"application/x-netcdf":{"source":"apache","extensions":["nc","cdf"]},"application/x-ns-proxy-autoconfig":{"compressible":true,"extensions":["pac"]},"application/x-nzb":{"source":"apache","extensions":["nzb"]},"application/x-perl":{"source":"nginx","extensions":["pl","pm"]},"application/x-pilot":{"source":"nginx","extensions":["prc","pdb"]},"application/x-pkcs12":{"source":"apache","compressible":false,"extensions":["p12","pfx"]},"application/x-pkcs7-certificates":{"source":"apache","extensions":["p7b","spc"]},"application/x-pkcs7-certreqresp":{"source":"apache","extensions":["p7r"]},"application/x-rar-compressed":{"source":"apache","compressible":false,"extensions":["rar"]},"application/x-redhat-package-manager":{"source":"nginx","extensions":["rpm"]},"application/x-research-info-systems":{"source":"apache","extensions":["ris"]},"application/x-sea":{"source":"nginx","extensions":["sea"]},"application/x-sh":{"source":"apache","compressible":true,"extensions":["sh"]},"application/x-shar":{"source":"apache","extensions":["shar"]},"application/x-shockwave-flash":{"source":"apache","compressible":false,"extensions":["swf"]},"application/x-silverlight-app":{"source":"apache","extensions":["xap"]},"application/x-sql":{"source":"apache","extensions":["sql"]},"application/x-stuffit":{"source":"apache","compressible":false,"extensions":["sit"]},"application/x-stuffitx":{"source":"apache","extensions":["sitx"]},"application/x-subrip":{"source":"apache","extensions":["srt"]},"application/x-sv4cpio":{"source":"apache","extensions":["sv4cpio"]},"application/x-sv4crc":{"source":"apache","extensions":["sv4crc"]},"application/x-t3vm-image":{"source":"apache","extensions":["t3"]},"application/x-tads":{"source":"apache","extensions":["gam"]},"application/x-tar":{"source":"apache","compressible":true,"extensions":["tar"]},"application/x-tcl":{"source":"apache","extensions":["tcl","tk"]},"application/x-tex":{"source":"apache","extensions":["tex"]},"application/x-tex-tfm":{"source":"apache","extensions":["tfm"]},"application/x-texinfo":{"source":"apache","extensions":["texinfo","texi"]},"application/x-tgif":{"source":"apache","extensions":["obj"]},"application/x-ustar":{"source":"apache","extensions":["ustar"]},"application/x-virtualbox-hdd":{"compressible":true,"extensions":["hdd"]},"application/x-virtualbox-ova":{"compressible":true,"extensions":["ova"]},"application/x-virtualbox-ovf":{"compressible":true,"extensions":["ovf"]},"application/x-virtualbox-vbox":{"compressible":true,"extensions":["vbox"]},"application/x-virtualbox-vbox-extpack":{"compressible":false,"extensions":["vbox-extpack"]},"application/x-virtualbox-vdi":{"compressible":true,"extensions":["vdi"]},"application/x-virtualbox-vhd":{"compressible":true,"extensions":["vhd"]},"application/x-virtualbox-vmdk":{"compressible":true,"extensions":["vmdk"]},"application/x-wais-source":{"source":"apache","extensions":["src"]},"application/x-web-app-manifest+json":{"compressible":true,"extensions":["webapp"]},"application/x-www-form-urlencoded":{"source":"iana","compressible":true},"application/x-x509-ca-cert":{"source":"apache","extensions":["der","crt","pem"]},"application/x-xfig":{"source":"apache","extensions":["fig"]},"application/x-xliff+xml":{"source":"apache","compressible":true,"extensions":["xlf"]},"application/x-xpinstall":{"source":"apache","compressible":false,"extensions":["xpi"]},"application/x-xz":{"source":"apache","extensions":["xz"]},"application/x-zmachine":{"source":"apache","extensions":["z1","z2","z3","z4","z5","z6","z7","z8"]},"application/x400-bp":{"source":"iana"},"application/xacml+xml":{"source":"iana","compressible":true},"application/xaml+xml":{"source":"apache","compressible":true,"extensions":["xaml"]},"application/xcap-att+xml":{"source":"iana","compressible":true},"application/xcap-caps+xml":{"source":"iana","compressible":true},"application/xcap-diff+xml":{"source":"iana","compressible":true,"extensions":["xdf"]},"application/xcap-el+xml":{"source":"iana","compressible":true},"application/xcap-error+xml":{"source":"iana","compressible":true},"application/xcap-ns+xml":{"source":"iana","compressible":true},"application/xcon-conference-info+xml":{"source":"iana","compressible":true},"application/xcon-conference-info-diff+xml":{"source":"iana","compressible":true},"application/xenc+xml":{"source":"iana","compressible":true,"extensions":["xenc"]},"application/xhtml+xml":{"source":"iana","compressible":true,"extensions":["xhtml","xht"]},"application/xhtml-voice+xml":{"source":"apache","compressible":true},"application/xliff+xml":{"source":"iana","compressible":true},"application/xml":{"source":"iana","compressible":true,"extensions":["xml","xsl","xsd","rng"]},"application/xml-dtd":{"source":"iana","compressible":true,"extensions":["dtd"]},"application/xml-external-parsed-entity":{"source":"iana"},"application/xml-patch+xml":{"source":"iana","compressible":true},"application/xmpp+xml":{"source":"iana","compressible":true},"application/xop+xml":{"source":"iana","compressible":true,"extensions":["xop"]},"application/xproc+xml":{"source":"apache","compressible":true,"extensions":["xpl"]},"application/xslt+xml":{"source":"iana","compressible":true,"extensions":["xslt"]},"application/xspf+xml":{"source":"apache","compressible":true,"extensions":["xspf"]},"application/xv+xml":{"source":"iana","compressible":true,"extensions":["mxml","xhvml","xvml","xvm"]},"application/yang":{"source":"iana","extensions":["yang"]},"application/yang-data+json":{"source":"iana","compressible":true},"application/yang-data+xml":{"source":"iana","compressible":true},"application/yang-patch+json":{"source":"iana","compressible":true},"application/yang-patch+xml":{"source":"iana","compressible":true},"application/yin+xml":{"source":"iana","compressible":true,"extensions":["yin"]},"application/zip":{"source":"iana","compressible":false,"extensions":["zip"]},"application/zlib":{"source":"iana"},"audio/1d-interleaved-parityfec":{"source":"iana"},"audio/32kadpcm":{"source":"iana"},"audio/3gpp":{"source":"iana","compressible":false,"extensions":["3gpp"]},"audio/3gpp2":{"source":"iana"},"audio/aac":{"source":"iana"},"audio/ac3":{"source":"iana"},"audio/adpcm":{"source":"apache","extensions":["adp"]},"audio/amr":{"source":"iana"},"audio/amr-wb":{"source":"iana"},"audio/amr-wb+":{"source":"iana"},"audio/aptx":{"source":"iana"},"audio/asc":{"source":"iana"},"audio/atrac-advanced-lossless":{"source":"iana"},"audio/atrac-x":{"source":"iana"},"audio/atrac3":{"source":"iana"},"audio/basic":{"source":"iana","compressible":false,"extensions":["au","snd"]},"audio/bv16":{"source":"iana"},"audio/bv32":{"source":"iana"},"audio/clearmode":{"source":"iana"},"audio/cn":{"source":"iana"},"audio/dat12":{"source":"iana"},"audio/dls":{"source":"iana"},"audio/dsr-es201108":{"source":"iana"},"audio/dsr-es202050":{"source":"iana"},"audio/dsr-es202211":{"source":"iana"},"audio/dsr-es202212":{"source":"iana"},"audio/dv":{"source":"iana"},"audio/dvi4":{"source":"iana"},"audio/eac3":{"source":"iana"},"audio/encaprtp":{"source":"iana"},"audio/evrc":{"source":"iana"},"audio/evrc-qcp":{"source":"iana"},"audio/evrc0":{"source":"iana"},"audio/evrc1":{"source":"iana"},"audio/evrcb":{"source":"iana"},"audio/evrcb0":{"source":"iana"},"audio/evrcb1":{"source":"iana"},"audio/evrcnw":{"source":"iana"},"audio/evrcnw0":{"source":"iana"},"audio/evrcnw1":{"source":"iana"},"audio/evrcwb":{"source":"iana"},"audio/evrcwb0":{"source":"iana"},"audio/evrcwb1":{"source":"iana"},"audio/evs":{"source":"iana"},"audio/fwdred":{"source":"iana"},"audio/g711-0":{"source":"iana"},"audio/g719":{"source":"iana"},"audio/g722":{"source":"iana"},"audio/g7221":{"source":"iana"},"audio/g723":{"source":"iana"},"audio/g726-16":{"source":"iana"},"audio/g726-24":{"source":"iana"},"audio/g726-32":{"source":"iana"},"audio/g726-40":{"source":"iana"},"audio/g728":{"source":"iana"},"audio/g729":{"source":"iana"},"audio/g7291":{"source":"iana"},"audio/g729d":{"source":"iana"},"audio/g729e":{"source":"iana"},"audio/gsm":{"source":"iana"},"audio/gsm-efr":{"source":"iana"},"audio/gsm-hr-08":{"source":"iana"},"audio/ilbc":{"source":"iana"},"audio/ip-mr_v2.5":{"source":"iana"},"audio/isac":{"source":"apache"},"audio/l16":{"source":"iana"},"audio/l20":{"source":"iana"},"audio/l24":{"source":"iana","compressible":false},"audio/l8":{"source":"iana"},"audio/lpc":{"source":"iana"},"audio/melp":{"source":"iana"},"audio/melp1200":{"source":"iana"},"audio/melp2400":{"source":"iana"},"audio/melp600":{"source":"iana"},"audio/midi":{"source":"apache","extensions":["mid","midi","kar","rmi"]},"audio/mobile-xmf":{"source":"iana"},"audio/mp3":{"compressible":false,"extensions":["mp3"]},"audio/mp4":{"source":"iana","compressible":false,"extensions":["m4a","mp4a"]},"audio/mp4a-latm":{"source":"iana"},"audio/mpa":{"source":"iana"},"audio/mpa-robust":{"source":"iana"},"audio/mpeg":{"source":"iana","compressible":false,"extensions":["mpga","mp2","mp2a","mp3","m2a","m3a"]},"audio/mpeg4-generic":{"source":"iana"},"audio/musepack":{"source":"apache"},"audio/ogg":{"source":"iana","compressible":false,"extensions":["oga","ogg","spx"]},"audio/opus":{"source":"iana"},"audio/parityfec":{"source":"iana"},"audio/pcma":{"source":"iana"},"audio/pcma-wb":{"source":"iana"},"audio/pcmu":{"source":"iana"},"audio/pcmu-wb":{"source":"iana"},"audio/prs.sid":{"source":"iana"},"audio/qcelp":{"source":"iana"},"audio/raptorfec":{"source":"iana"},"audio/red":{"source":"iana"},"audio/rtp-enc-aescm128":{"source":"iana"},"audio/rtp-midi":{"source":"iana"},"audio/rtploopback":{"source":"iana"},"audio/rtx":{"source":"iana"},"audio/s3m":{"source":"apache","extensions":["s3m"]},"audio/silk":{"source":"apache","extensions":["sil"]},"audio/smv":{"source":"iana"},"audio/smv-qcp":{"source":"iana"},"audio/smv0":{"source":"iana"},"audio/sp-midi":{"source":"iana"},"audio/speex":{"source":"iana"},"audio/t140c":{"source":"iana"},"audio/t38":{"source":"iana"},"audio/telephone-event":{"source":"iana"},"audio/tone":{"source":"iana"},"audio/uemclip":{"source":"iana"},"audio/ulpfec":{"source":"iana"},"audio/usac":{"source":"iana"},"audio/vdvi":{"source":"iana"},"audio/vmr-wb":{"source":"iana"},"audio/vnd.3gpp.iufp":{"source":"iana"},"audio/vnd.4sb":{"source":"iana"},"audio/vnd.audiokoz":{"source":"iana"},"audio/vnd.celp":{"source":"iana"},"audio/vnd.cisco.nse":{"source":"iana"},"audio/vnd.cmles.radio-events":{"source":"iana"},"audio/vnd.cns.anp1":{"source":"iana"},"audio/vnd.cns.inf1":{"source":"iana"},"audio/vnd.dece.audio":{"source":"iana","extensions":["uva","uvva"]},"audio/vnd.digital-winds":{"source":"iana","extensions":["eol"]},"audio/vnd.dlna.adts":{"source":"iana"},"audio/vnd.dolby.heaac.1":{"source":"iana"},"audio/vnd.dolby.heaac.2":{"source":"iana"},"audio/vnd.dolby.mlp":{"source":"iana"},"audio/vnd.dolby.mps":{"source":"iana"},"audio/vnd.dolby.pl2":{"source":"iana"},"audio/vnd.dolby.pl2x":{"source":"iana"},"audio/vnd.dolby.pl2z":{"source":"iana"},"audio/vnd.dolby.pulse.1":{"source":"iana"},"audio/vnd.dra":{"source":"iana","extensions":["dra"]},"audio/vnd.dts":{"source":"iana","extensions":["dts"]},"audio/vnd.dts.hd":{"source":"iana","extensions":["dtshd"]},"audio/vnd.dvb.file":{"source":"iana"},"audio/vnd.everad.plj":{"source":"iana"},"audio/vnd.hns.audio":{"source":"iana"},"audio/vnd.lucent.voice":{"source":"iana","extensions":["lvp"]},"audio/vnd.ms-playready.media.pya":{"source":"iana","extensions":["pya"]},"audio/vnd.nokia.mobile-xmf":{"source":"iana"},"audio/vnd.nortel.vbk":{"source":"iana"},"audio/vnd.nuera.ecelp4800":{"source":"iana","extensions":["ecelp4800"]},"audio/vnd.nuera.ecelp7470":{"source":"iana","extensions":["ecelp7470"]},"audio/vnd.nuera.ecelp9600":{"source":"iana","extensions":["ecelp9600"]},"audio/vnd.octel.sbc":{"source":"iana"},"audio/vnd.presonus.multitrack":{"source":"iana"},"audio/vnd.qcelp":{"source":"iana"},"audio/vnd.rhetorex.32kadpcm":{"source":"iana"},"audio/vnd.rip":{"source":"iana","extensions":["rip"]},"audio/vnd.rn-realaudio":{"compressible":false},"audio/vnd.sealedmedia.softseal.mpeg":{"source":"iana"},"audio/vnd.vmx.cvsd":{"source":"iana"},"audio/vnd.wave":{"compressible":false},"audio/vorbis":{"source":"iana","compressible":false},"audio/vorbis-config":{"source":"iana"},"audio/wav":{"compressible":false,"extensions":["wav"]},"audio/wave":{"compressible":false,"extensions":["wav"]},"audio/webm":{"source":"apache","compressible":false,"extensions":["weba"]},"audio/x-aac":{"source":"apache","compressible":false,"extensions":["aac"]},"audio/x-aiff":{"source":"apache","extensions":["aif","aiff","aifc"]},"audio/x-caf":{"source":"apache","compressible":false,"extensions":["caf"]},"audio/x-flac":{"source":"apache","extensions":["flac"]},"audio/x-m4a":{"source":"nginx","extensions":["m4a"]},"audio/x-matroska":{"source":"apache","extensions":["mka"]},"audio/x-mpegurl":{"source":"apache","extensions":["m3u"]},"audio/x-ms-wax":{"source":"apache","extensions":["wax"]},"audio/x-ms-wma":{"source":"apache","extensions":["wma"]},"audio/x-pn-realaudio":{"source":"apache","extensions":["ram","ra"]},"audio/x-pn-realaudio-plugin":{"source":"apache","extensions":["rmp"]},"audio/x-realaudio":{"source":"nginx","extensions":["ra"]},"audio/x-tta":{"source":"apache"},"audio/x-wav":{"source":"apache","extensions":["wav"]},"audio/xm":{"source":"apache","extensions":["xm"]},"chemical/x-cdx":{"source":"apache","extensions":["cdx"]},"chemical/x-cif":{"source":"apache","extensions":["cif"]},"chemical/x-cmdf":{"source":"apache","extensions":["cmdf"]},"chemical/x-cml":{"source":"apache","extensions":["cml"]},"chemical/x-csml":{"source":"apache","extensions":["csml"]},"chemical/x-pdb":{"source":"apache"},"chemical/x-xyz":{"source":"apache","extensions":["xyz"]},"font/collection":{"source":"iana","extensions":["ttc"]},"font/otf":{"source":"iana","compressible":true,"extensions":["otf"]},"font/sfnt":{"source":"iana"},"font/ttf":{"source":"iana","extensions":["ttf"]},"font/woff":{"source":"iana","extensions":["woff"]},"font/woff2":{"source":"iana","extensions":["woff2"]},"image/aces":{"source":"iana"},"image/apng":{"compressible":false,"extensions":["apng"]},"image/bmp":{"source":"iana","compressible":true,"extensions":["bmp"]},"image/cgm":{"source":"iana","extensions":["cgm"]},"image/dicom-rle":{"source":"iana"},"image/emf":{"source":"iana"},"image/fits":{"source":"iana"},"image/g3fax":{"source":"iana","extensions":["g3"]},"image/gif":{"source":"iana","compressible":false,"extensions":["gif"]},"image/ief":{"source":"iana","extensions":["ief"]},"image/jls":{"source":"iana"},"image/jp2":{"source":"iana","compressible":false,"extensions":["jp2","jpg2"]},"image/jpeg":{"source":"iana","compressible":false,"extensions":["jpeg","jpg","jpe"]},"image/jpm":{"source":"iana","compressible":false,"extensions":["jpm"]},"image/jpx":{"source":"iana","compressible":false,"extensions":["jpx","jpf"]},"image/ktx":{"source":"iana","extensions":["ktx"]},"image/naplps":{"source":"iana"},"image/pjpeg":{"compressible":false},"image/png":{"source":"iana","compressible":false,"extensions":["png"]},"image/prs.btif":{"source":"iana","extensions":["btif"]},"image/prs.pti":{"source":"iana"},"image/pwg-raster":{"source":"iana"},"image/sgi":{"source":"apache","extensions":["sgi"]},"image/svg+xml":{"source":"iana","compressible":true,"extensions":["svg","svgz"]},"image/t38":{"source":"iana"},"image/tiff":{"source":"iana","compressible":false,"extensions":["tiff","tif"]},"image/tiff-fx":{"source":"iana"},"image/vnd.adobe.photoshop":{"source":"iana","compressible":true,"extensions":["psd"]},"image/vnd.airzip.accelerator.azv":{"source":"iana"},"image/vnd.cns.inf2":{"source":"iana"},"image/vnd.dece.graphic":{"source":"iana","extensions":["uvi","uvvi","uvg","uvvg"]},"image/vnd.djvu":{"source":"iana","extensions":["djvu","djv"]},"image/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"image/vnd.dwg":{"source":"iana","extensions":["dwg"]},"image/vnd.dxf":{"source":"iana","extensions":["dxf"]},"image/vnd.fastbidsheet":{"source":"iana","extensions":["fbs"]},"image/vnd.fpx":{"source":"iana","extensions":["fpx"]},"image/vnd.fst":{"source":"iana","extensions":["fst"]},"image/vnd.fujixerox.edmics-mmr":{"source":"iana","extensions":["mmr"]},"image/vnd.fujixerox.edmics-rlc":{"source":"iana","extensions":["rlc"]},"image/vnd.globalgraphics.pgb":{"source":"iana"},"image/vnd.microsoft.icon":{"source":"iana"},"image/vnd.mix":{"source":"iana"},"image/vnd.mozilla.apng":{"source":"iana"},"image/vnd.ms-modi":{"source":"iana","extensions":["mdi"]},"image/vnd.ms-photo":{"source":"apache","extensions":["wdp"]},"image/vnd.net-fpx":{"source":"iana","extensions":["npx"]},"image/vnd.radiance":{"source":"iana"},"image/vnd.sealed.png":{"source":"iana"},"image/vnd.sealedmedia.softseal.gif":{"source":"iana"},"image/vnd.sealedmedia.softseal.jpg":{"source":"iana"},"image/vnd.svf":{"source":"iana"},"image/vnd.tencent.tap":{"source":"iana"},"image/vnd.valve.source.texture":{"source":"iana"},"image/vnd.wap.wbmp":{"source":"iana","extensions":["wbmp"]},"image/vnd.xiff":{"source":"iana","extensions":["xif"]},"image/vnd.zbrush.pcx":{"source":"iana"},"image/webp":{"source":"apache","extensions":["webp"]},"image/wmf":{"source":"iana"},"image/x-3ds":{"source":"apache","extensions":["3ds"]},"image/x-cmu-raster":{"source":"apache","extensions":["ras"]},"image/x-cmx":{"source":"apache","extensions":["cmx"]},"image/x-freehand":{"source":"apache","extensions":["fh","fhc","fh4","fh5","fh7"]},"image/x-icon":{"source":"apache","compressible":true,"extensions":["ico"]},"image/x-jng":{"source":"nginx","extensions":["jng"]},"image/x-mrsid-image":{"source":"apache","extensions":["sid"]},"image/x-ms-bmp":{"source":"nginx","compressible":true,"extensions":["bmp"]},"image/x-pcx":{"source":"apache","extensions":["pcx"]},"image/x-pict":{"source":"apache","extensions":["pic","pct"]},"image/x-portable-anymap":{"source":"apache","extensions":["pnm"]},"image/x-portable-bitmap":{"source":"apache","extensions":["pbm"]},"image/x-portable-graymap":{"source":"apache","extensions":["pgm"]},"image/x-portable-pixmap":{"source":"apache","extensions":["ppm"]},"image/x-rgb":{"source":"apache","extensions":["rgb"]},"image/x-tga":{"source":"apache","extensions":["tga"]},"image/x-xbitmap":{"source":"apache","extensions":["xbm"]},"image/x-xcf":{"compressible":false},"image/x-xpixmap":{"source":"apache","extensions":["xpm"]},"image/x-xwindowdump":{"source":"apache","extensions":["xwd"]},"message/cpim":{"source":"iana"},"message/delivery-status":{"source":"iana"},"message/disposition-notification":{"source":"iana","extensions":["disposition-notification"]},"message/external-body":{"source":"iana"},"message/feedback-report":{"source":"iana"},"message/global":{"source":"iana","extensions":["u8msg"]},"message/global-delivery-status":{"source":"iana","extensions":["u8dsn"]},"message/global-disposition-notification":{"source":"iana","extensions":["u8mdn"]},"message/global-headers":{"source":"iana","extensions":["u8hdr"]},"message/http":{"source":"iana","compressible":false},"message/imdn+xml":{"source":"iana","compressible":true},"message/news":{"source":"iana"},"message/partial":{"source":"iana","compressible":false},"message/rfc822":{"source":"iana","compressible":true,"extensions":["eml","mime"]},"message/s-http":{"source":"iana"},"message/sip":{"source":"iana"},"message/sipfrag":{"source":"iana"},"message/tracking-status":{"source":"iana"},"message/vnd.si.simp":{"source":"iana"},"message/vnd.wfa.wsc":{"source":"iana","extensions":["wsc"]},"model/3mf":{"source":"iana"},"model/gltf+json":{"source":"iana","compressible":true,"extensions":["gltf"]},"model/gltf-binary":{"source":"iana","compressible":true,"extensions":["glb"]},"model/iges":{"source":"iana","compressible":false,"extensions":["igs","iges"]},"model/mesh":{"source":"iana","compressible":false,"extensions":["msh","mesh","silo"]},"model/stl":{"source":"iana"},"model/vnd.collada+xml":{"source":"iana","compressible":true,"extensions":["dae"]},"model/vnd.dwf":{"source":"iana","extensions":["dwf"]},"model/vnd.flatland.3dml":{"source":"iana"},"model/vnd.gdl":{"source":"iana","extensions":["gdl"]},"model/vnd.gs-gdl":{"source":"apache"},"model/vnd.gs.gdl":{"source":"iana"},"model/vnd.gtw":{"source":"iana","extensions":["gtw"]},"model/vnd.moml+xml":{"source":"iana","compressible":true},"model/vnd.mts":{"source":"iana","extensions":["mts"]},"model/vnd.opengex":{"source":"iana"},"model/vnd.parasolid.transmit.binary":{"source":"iana"},"model/vnd.parasolid.transmit.text":{"source":"iana"},"model/vnd.rosette.annotated-data-model":{"source":"iana"},"model/vnd.usdz+zip":{"source":"iana","compressible":false},"model/vnd.valve.source.compiled-map":{"source":"iana"},"model/vnd.vtu":{"source":"iana","extensions":["vtu"]},"model/vrml":{"source":"iana","compressible":false,"extensions":["wrl","vrml"]},"model/x3d+binary":{"source":"apache","compressible":false,"extensions":["x3db","x3dbz"]},"model/x3d+fastinfoset":{"source":"iana"},"model/x3d+vrml":{"source":"apache","compressible":false,"extensions":["x3dv","x3dvz"]},"model/x3d+xml":{"source":"iana","compressible":true,"extensions":["x3d","x3dz"]},"model/x3d-vrml":{"source":"iana"},"multipart/alternative":{"source":"iana","compressible":false},"multipart/appledouble":{"source":"iana"},"multipart/byteranges":{"source":"iana"},"multipart/digest":{"source":"iana"},"multipart/encrypted":{"source":"iana","compressible":false},"multipart/form-data":{"source":"iana","compressible":false},"multipart/header-set":{"source":"iana"},"multipart/mixed":{"source":"iana","compressible":false},"multipart/multilingual":{"source":"iana"},"multipart/parallel":{"source":"iana"},"multipart/related":{"source":"iana","compressible":false},"multipart/report":{"source":"iana"},"multipart/signed":{"source":"iana","compressible":false},"multipart/vnd.bint.med-plus":{"source":"iana"},"multipart/voice-message":{"source":"iana"},"multipart/x-mixed-replace":{"source":"iana"},"text/1d-interleaved-parityfec":{"source":"iana"},"text/cache-manifest":{"source":"iana","compressible":true,"extensions":["appcache","manifest"]},"text/calendar":{"source":"iana","extensions":["ics","ifb"]},"text/calender":{"compressible":true},"text/cmd":{"compressible":true},"text/coffeescript":{"extensions":["coffee","litcoffee"]},"text/css":{"source":"iana","charset":"UTF-8","compressible":true,"extensions":["css"]},"text/csv":{"source":"iana","compressible":true,"extensions":["csv"]},"text/csv-schema":{"source":"iana"},"text/directory":{"source":"iana"},"text/dns":{"source":"iana"},"text/ecmascript":{"source":"iana"},"text/encaprtp":{"source":"iana"},"text/enriched":{"source":"iana"},"text/fwdred":{"source":"iana"},"text/grammar-ref-list":{"source":"iana"},"text/html":{"source":"iana","compressible":true,"extensions":["html","htm","shtml"]},"text/jade":{"extensions":["jade"]},"text/javascript":{"source":"iana","compressible":true},"text/jcr-cnd":{"source":"iana"},"text/jsx":{"compressible":true,"extensions":["jsx"]},"text/less":{"extensions":["less"]},"text/markdown":{"source":"iana","compressible":true,"extensions":["markdown","md"]},"text/mathml":{"source":"nginx","extensions":["mml"]},"text/mizar":{"source":"iana"},"text/n3":{"source":"iana","compressible":true,"extensions":["n3"]},"text/parameters":{"source":"iana"},"text/parityfec":{"source":"iana"},"text/plain":{"source":"iana","compressible":true,"extensions":["txt","text","conf","def","list","log","in","ini"]},"text/provenance-notation":{"source":"iana"},"text/prs.fallenstein.rst":{"source":"iana"},"text/prs.lines.tag":{"source":"iana","extensions":["dsc"]},"text/prs.prop.logic":{"source":"iana"},"text/raptorfec":{"source":"iana"},"text/red":{"source":"iana"},"text/rfc822-headers":{"source":"iana"},"text/richtext":{"source":"iana","compressible":true,"extensions":["rtx"]},"text/rtf":{"source":"iana","compressible":true,"extensions":["rtf"]},"text/rtp-enc-aescm128":{"source":"iana"},"text/rtploopback":{"source":"iana"},"text/rtx":{"source":"iana"},"text/sgml":{"source":"iana","extensions":["sgml","sgm"]},"text/shex":{"extensions":["shex"]},"text/slim":{"extensions":["slim","slm"]},"text/strings":{"source":"iana"},"text/stylus":{"extensions":["stylus","styl"]},"text/t140":{"source":"iana"},"text/tab-separated-values":{"source":"iana","compressible":true,"extensions":["tsv"]},"text/troff":{"source":"iana","extensions":["t","tr","roff","man","me","ms"]},"text/turtle":{"source":"iana","charset":"UTF-8","extensions":["ttl"]},"text/ulpfec":{"source":"iana"},"text/uri-list":{"source":"iana","compressible":true,"extensions":["uri","uris","urls"]},"text/vcard":{"source":"iana","compressible":true,"extensions":["vcard"]},"text/vnd.a":{"source":"iana"},"text/vnd.abc":{"source":"iana"},"text/vnd.ascii-art":{"source":"iana"},"text/vnd.curl":{"source":"iana","extensions":["curl"]},"text/vnd.curl.dcurl":{"source":"apache","extensions":["dcurl"]},"text/vnd.curl.mcurl":{"source":"apache","extensions":["mcurl"]},"text/vnd.curl.scurl":{"source":"apache","extensions":["scurl"]},"text/vnd.debian.copyright":{"source":"iana"},"text/vnd.dmclientscript":{"source":"iana"},"text/vnd.dvb.subtitle":{"source":"iana","extensions":["sub"]},"text/vnd.esmertec.theme-descriptor":{"source":"iana"},"text/vnd.fly":{"source":"iana","extensions":["fly"]},"text/vnd.fmi.flexstor":{"source":"iana","extensions":["flx"]},"text/vnd.gml":{"source":"iana"},"text/vnd.graphviz":{"source":"iana","extensions":["gv"]},"text/vnd.hgl":{"source":"iana"},"text/vnd.in3d.3dml":{"source":"iana","extensions":["3dml"]},"text/vnd.in3d.spot":{"source":"iana","extensions":["spot"]},"text/vnd.iptc.newsml":{"source":"iana"},"text/vnd.iptc.nitf":{"source":"iana"},"text/vnd.latex-z":{"source":"iana"},"text/vnd.motorola.reflex":{"source":"iana"},"text/vnd.ms-mediapackage":{"source":"iana"},"text/vnd.net2phone.commcenter.command":{"source":"iana"},"text/vnd.radisys.msml-basic-layout":{"source":"iana"},"text/vnd.si.uricatalogue":{"source":"iana"},"text/vnd.sun.j2me.app-descriptor":{"source":"iana","extensions":["jad"]},"text/vnd.trolltech.linguist":{"source":"iana"},"text/vnd.wap.si":{"source":"iana"},"text/vnd.wap.sl":{"source":"iana"},"text/vnd.wap.wml":{"source":"iana","extensions":["wml"]},"text/vnd.wap.wmlscript":{"source":"iana","extensions":["wmls"]},"text/vtt":{"charset":"UTF-8","compressible":true,"extensions":["vtt"]},"text/x-asm":{"source":"apache","extensions":["s","asm"]},"text/x-c":{"source":"apache","extensions":["c","cc","cxx","cpp","h","hh","dic"]},"text/x-component":{"source":"nginx","extensions":["htc"]},"text/x-fortran":{"source":"apache","extensions":["f","for","f77","f90"]},"text/x-gwt-rpc":{"compressible":true},"text/x-handlebars-template":{"extensions":["hbs"]},"text/x-java-source":{"source":"apache","extensions":["java"]},"text/x-jquery-tmpl":{"compressible":true},"text/x-lua":{"extensions":["lua"]},"text/x-markdown":{"compressible":true,"extensions":["mkd"]},"text/x-nfo":{"source":"apache","extensions":["nfo"]},"text/x-opml":{"source":"apache","extensions":["opml"]},"text/x-org":{"compressible":true,"extensions":["org"]},"text/x-pascal":{"source":"apache","extensions":["p","pas"]},"text/x-processing":{"compressible":true,"extensions":["pde"]},"text/x-sass":{"extensions":["sass"]},"text/x-scss":{"extensions":["scss"]},"text/x-setext":{"source":"apache","extensions":["etx"]},"text/x-sfv":{"source":"apache","extensions":["sfv"]},"text/x-suse-ymp":{"compressible":true,"extensions":["ymp"]},"text/x-uuencode":{"source":"apache","extensions":["uu"]},"text/x-vcalendar":{"source":"apache","extensions":["vcs"]},"text/x-vcard":{"source":"apache","extensions":["vcf"]},"text/xml":{"source":"iana","compressible":true,"extensions":["xml"]},"text/xml-external-parsed-entity":{"source":"iana"},"text/yaml":{"extensions":["yaml","yml"]},"video/1d-interleaved-parityfec":{"source":"iana"},"video/3gpp":{"source":"iana","extensions":["3gp","3gpp"]},"video/3gpp-tt":{"source":"iana"},"video/3gpp2":{"source":"iana","extensions":["3g2"]},"video/bmpeg":{"source":"iana"},"video/bt656":{"source":"iana"},"video/celb":{"source":"iana"},"video/dv":{"source":"iana"},"video/encaprtp":{"source":"iana"},"video/h261":{"source":"iana","extensions":["h261"]},"video/h263":{"source":"iana","extensions":["h263"]},"video/h263-1998":{"source":"iana"},"video/h263-2000":{"source":"iana"},"video/h264":{"source":"iana","extensions":["h264"]},"video/h264-rcdo":{"source":"iana"},"video/h264-svc":{"source":"iana"},"video/h265":{"source":"iana"},"video/iso.segment":{"source":"iana"},"video/jpeg":{"source":"iana","extensions":["jpgv"]},"video/jpeg2000":{"source":"iana"},"video/jpm":{"source":"apache","extensions":["jpm","jpgm"]},"video/mj2":{"source":"iana","extensions":["mj2","mjp2"]},"video/mp1s":{"source":"iana"},"video/mp2p":{"source":"iana"},"video/mp2t":{"source":"iana","extensions":["ts"]},"video/mp4":{"source":"iana","compressible":false,"extensions":["mp4","mp4v","mpg4"]},"video/mp4v-es":{"source":"iana"},"video/mpeg":{"source":"iana","compressible":false,"extensions":["mpeg","mpg","mpe","m1v","m2v"]},"video/mpeg4-generic":{"source":"iana"},"video/mpv":{"source":"iana"},"video/nv":{"source":"iana"},"video/ogg":{"source":"iana","compressible":false,"extensions":["ogv"]},"video/parityfec":{"source":"iana"},"video/pointer":{"source":"iana"},"video/quicktime":{"source":"iana","compressible":false,"extensions":["qt","mov"]},"video/raptorfec":{"source":"iana"},"video/raw":{"source":"iana"},"video/rtp-enc-aescm128":{"source":"iana"},"video/rtploopback":{"source":"iana"},"video/rtx":{"source":"iana"},"video/smpte291":{"source":"iana"},"video/smpte292m":{"source":"iana"},"video/ulpfec":{"source":"iana"},"video/vc1":{"source":"iana"},"video/vnd.cctv":{"source":"iana"},"video/vnd.dece.hd":{"source":"iana","extensions":["uvh","uvvh"]},"video/vnd.dece.mobile":{"source":"iana","extensions":["uvm","uvvm"]},"video/vnd.dece.mp4":{"source":"iana"},"video/vnd.dece.pd":{"source":"iana","extensions":["uvp","uvvp"]},"video/vnd.dece.sd":{"source":"iana","extensions":["uvs","uvvs"]},"video/vnd.dece.video":{"source":"iana","extensions":["uvv","uvvv"]},"video/vnd.directv.mpeg":{"source":"iana"},"video/vnd.directv.mpeg-tts":{"source":"iana"},"video/vnd.dlna.mpeg-tts":{"source":"iana"},"video/vnd.dvb.file":{"source":"iana","extensions":["dvb"]},"video/vnd.fvt":{"source":"iana","extensions":["fvt"]},"video/vnd.hns.video":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.1dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-1010":{"source":"iana"},"video/vnd.iptvforum.2dparityfec-2005":{"source":"iana"},"video/vnd.iptvforum.ttsavc":{"source":"iana"},"video/vnd.iptvforum.ttsmpeg2":{"source":"iana"},"video/vnd.motorola.video":{"source":"iana"},"video/vnd.motorola.videop":{"source":"iana"},"video/vnd.mpegurl":{"source":"iana","extensions":["mxu","m4u"]},"video/vnd.ms-playready.media.pyv":{"source":"iana","extensions":["pyv"]},"video/vnd.nokia.interleaved-multimedia":{"source":"iana"},"video/vnd.nokia.mp4vr":{"source":"iana"},"video/vnd.nokia.videovoip":{"source":"iana"},"video/vnd.objectvideo":{"source":"iana"},"video/vnd.radgamettools.bink":{"source":"iana"},"video/vnd.radgamettools.smacker":{"source":"iana"},"video/vnd.sealed.mpeg1":{"source":"iana"},"video/vnd.sealed.mpeg4":{"source":"iana"},"video/vnd.sealed.swf":{"source":"iana"},"video/vnd.sealedmedia.softseal.mov":{"source":"iana"},"video/vnd.uvvu.mp4":{"source":"iana","extensions":["uvu","uvvu"]},"video/vnd.vivo":{"source":"iana","extensions":["viv"]},"video/vp8":{"source":"iana"},"video/webm":{"source":"apache","compressible":false,"extensions":["webm"]},"video/x-f4v":{"source":"apache","extensions":["f4v"]},"video/x-fli":{"source":"apache","extensions":["fli"]},"video/x-flv":{"source":"apache","compressible":false,"extensions":["flv"]},"video/x-m4v":{"source":"apache","extensions":["m4v"]},"video/x-matroska":{"source":"apache","compressible":false,"extensions":["mkv","mk3d","mks"]},"video/x-mng":{"source":"apache","extensions":["mng"]},"video/x-ms-asf":{"source":"apache","extensions":["asf","asx"]},"video/x-ms-vob":{"source":"apache","extensions":["vob"]},"video/x-ms-wm":{"source":"apache","extensions":["wm"]},"video/x-ms-wmv":{"source":"apache","compressible":false,"extensions":["wmv"]},"video/x-ms-wmx":{"source":"apache","extensions":["wmx"]},"video/x-ms-wvx":{"source":"apache","extensions":["wvx"]},"video/x-msvideo":{"source":"apache","extensions":["avi"]},"video/x-sgi-movie":{"source":"apache","extensions":["movie"]},"video/x-smv":{"source":"apache","extensions":["smv"]},"x-conference/x-cooltalk":{"source":"apache","extensions":["ice"]},"x-shader/x-fragment":{"compressible":true},"x-shader/x-vertex":{"compressible":true}}
133572
133573/***/ }),
133574/* 830 */
133575/***/ (function(module, exports, __webpack_require__) {
133576
133577/*!
133578 * mime-db
133579 * Copyright(c) 2014 Jonathan Ong
133580 * MIT Licensed
133581 */
133582
133583/**
133584 * Module exports.
133585 */
133586
133587module.exports = __webpack_require__(829)
133588
133589
133590/***/ }),
133591/* 831 */
133592/***/ (function(module, exports, __webpack_require__) {
133593
133594"use strict";
133595
133596module.exports = (to, from) => {
133597 // TODO: use `Reflect.ownKeys()` when targeting Node.js 6
133598 for (const prop of Object.getOwnPropertyNames(from).concat(Object.getOwnPropertySymbols(from))) {
133599 Object.defineProperty(to, prop, Object.getOwnPropertyDescriptor(from, prop));
133600 }
133601
133602 return to;
133603};
133604
133605
133606/***/ }),
133607/* 832 */
133608/***/ (function(module, exports, __webpack_require__) {
133609
133610"use strict";
133611
133612
133613const mkdirp = __webpack_require__(241)
133614
133615module.exports = function (dir, opts) {
133616 return new Promise((resolve, reject) => {
133617 mkdirp(dir, opts, (err, made) => err === null ? resolve(made) : reject(err))
133618 })
133619}
133620
133621
133622/***/ }),
133623/* 833 */
133624/***/ (function(module, exports) {
133625
133626/**
133627 * Helpers.
133628 */
133629
133630var s = 1000;
133631var m = s * 60;
133632var h = m * 60;
133633var d = h * 24;
133634var y = d * 365.25;
133635
133636/**
133637 * Parse or format the given `val`.
133638 *
133639 * Options:
133640 *
133641 * - `long` verbose formatting [false]
133642 *
133643 * @param {String|Number} val
133644 * @param {Object} [options]
133645 * @throws {Error} throw an error if val is not a non-empty string or a number
133646 * @return {String|Number}
133647 * @api public
133648 */
133649
133650module.exports = function(val, options) {
133651 options = options || {};
133652 var type = typeof val;
133653 if (type === 'string' && val.length > 0) {
133654 return parse(val);
133655 } else if (type === 'number' && isNaN(val) === false) {
133656 return options.long ? fmtLong(val) : fmtShort(val);
133657 }
133658 throw new Error(
133659 'val is not a non-empty string or a valid number. val=' +
133660 JSON.stringify(val)
133661 );
133662};
133663
133664/**
133665 * Parse the given `str` and return milliseconds.
133666 *
133667 * @param {String} str
133668 * @return {Number}
133669 * @api private
133670 */
133671
133672function parse(str) {
133673 str = String(str);
133674 if (str.length > 100) {
133675 return;
133676 }
133677 var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(
133678 str
133679 );
133680 if (!match) {
133681 return;
133682 }
133683 var n = parseFloat(match[1]);
133684 var type = (match[2] || 'ms').toLowerCase();
133685 switch (type) {
133686 case 'years':
133687 case 'year':
133688 case 'yrs':
133689 case 'yr':
133690 case 'y':
133691 return n * y;
133692 case 'days':
133693 case 'day':
133694 case 'd':
133695 return n * d;
133696 case 'hours':
133697 case 'hour':
133698 case 'hrs':
133699 case 'hr':
133700 case 'h':
133701 return n * h;
133702 case 'minutes':
133703 case 'minute':
133704 case 'mins':
133705 case 'min':
133706 case 'm':
133707 return n * m;
133708 case 'seconds':
133709 case 'second':
133710 case 'secs':
133711 case 'sec':
133712 case 's':
133713 return n * s;
133714 case 'milliseconds':
133715 case 'millisecond':
133716 case 'msecs':
133717 case 'msec':
133718 case 'ms':
133719 return n;
133720 default:
133721 return undefined;
133722 }
133723}
133724
133725/**
133726 * Short format for `ms`.
133727 *
133728 * @param {Number} ms
133729 * @return {String}
133730 * @api private
133731 */
133732
133733function fmtShort(ms) {
133734 if (ms >= d) {
133735 return Math.round(ms / d) + 'd';
133736 }
133737 if (ms >= h) {
133738 return Math.round(ms / h) + 'h';
133739 }
133740 if (ms >= m) {
133741 return Math.round(ms / m) + 'm';
133742 }
133743 if (ms >= s) {
133744 return Math.round(ms / s) + 's';
133745 }
133746 return ms + 'ms';
133747}
133748
133749/**
133750 * Long format for `ms`.
133751 *
133752 * @param {Number} ms
133753 * @return {String}
133754 * @api private
133755 */
133756
133757function fmtLong(ms) {
133758 return plural(ms, d, 'day') ||
133759 plural(ms, h, 'hour') ||
133760 plural(ms, m, 'minute') ||
133761 plural(ms, s, 'second') ||
133762 ms + ' ms';
133763}
133764
133765/**
133766 * Pluralization helper.
133767 */
133768
133769function plural(ms, n, name) {
133770 if (ms < n) {
133771 return;
133772 }
133773 if (ms < n * 1.5) {
133774 return Math.floor(ms / n) + ' ' + name;
133775 }
133776 return Math.ceil(ms / n) + ' ' + name + 's';
133777}
133778
133779
133780/***/ }),
133781/* 834 */
133782/***/ (function(module, exports, __webpack_require__) {
133783
133784
133785var Promise = __webpack_require__(278)
133786var fs
133787try {
133788 fs = __webpack_require__(356)
133789} catch(err) {
133790 fs = __webpack_require__(12)
133791}
133792
133793var api = [
133794 'appendFile',
133795 'chmod',
133796 'chown',
133797 'close',
133798 'fchmod',
133799 'fchown',
133800 'fdatasync',
133801 'fstat',
133802 'fsync',
133803 'ftruncate',
133804 'futimes',
133805 'lchown',
133806 'link',
133807 'lstat',
133808 'mkdir',
133809 'open',
133810 'read',
133811 'readFile',
133812 'readdir',
133813 'readlink',
133814 'realpath',
133815 'rename',
133816 'rmdir',
133817 'stat',
133818 'symlink',
133819 'truncate',
133820 'unlink',
133821 'utimes',
133822 'write',
133823 'writeFile'
133824]
133825
133826typeof fs.access === 'function' && api.push('access')
133827typeof fs.copyFile === 'function' && api.push('copyFile')
133828typeof fs.mkdtemp === 'function' && api.push('mkdtemp')
133829
133830__webpack_require__(1024).withCallback(fs, exports, api)
133831
133832exports.exists = function (filename, callback) {
133833 // callback
133834 if (typeof callback === 'function') {
133835 return fs.stat(filename, function (err) {
133836 callback(null, !err);
133837 })
133838 }
133839 // or promise
133840 return new Promise(function (resolve) {
133841 fs.stat(filename, function (err) {
133842 resolve(!err)
133843 })
133844 })
133845}
133846
133847
133848/***/ }),
133849/* 835 */
133850/***/ (function(module, exports, __webpack_require__) {
133851
133852/*jslint node: true*/
133853var toArray = __webpack_require__(821);
133854var emojiByName = __webpack_require__(836);
133855
133856"use strict";
133857
133858/**
133859 * regex to parse emoji in a string - finds emoji, e.g. :coffee:
133860 */
133861var emojiNameRegex = /:([a-zA-Z0-9_\-\+]+):/g;
133862
133863/**
133864 * regex to trim whitespace
133865 * use instead of String.prototype.trim() for IE8 supprt
133866 */
133867var trimSpaceRegex = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;
133868
133869/**
133870 * Removes colons on either side
133871 * of the string if present
133872 * @param {string} str
133873 * @return {string}
133874 */
133875function stripColons (str) {
133876 var colonIndex = str.indexOf(':');
133877 if (colonIndex > -1) {
133878 // :emoji: (http://www.emoji-cheat-sheet.com/)
133879 if (colonIndex === str.length - 1) {
133880 str = str.substring(0, colonIndex);
133881 return stripColons(str);
133882 } else {
133883 str = str.substr(colonIndex + 1);
133884 return stripColons(str);
133885 }
133886 }
133887
133888 return str;
133889}
133890
133891/**
133892 * Adds colons to either side
133893 * of the string
133894 * @param {string} str
133895 * @return {string}
133896 */
133897function wrapColons (str) {
133898 return (typeof str === 'string' && str.length > 0) ? ':' + str + ':' : str;
133899}
133900
133901/**
133902 * Ensure that the word is wrapped in colons
133903 * by only adding them, if they are not there.
133904 * @param {string} str
133905 * @return {string}
133906 */
133907function ensureColons (str) {
133908 return (typeof str === 'string' && str[0] !== ':') ? wrapColons(str) : str;
133909}
133910
133911// Non spacing mark, some emoticons have them. It's the 'Variant Form',
133912// which provides more information so that emoticons can be rendered as
133913// more colorful graphics. FE0E is a unicode text version, where as FE0F
133914// should be rendered as a graphical version. The code gracefully degrades.
133915var NON_SPACING_MARK = String.fromCharCode(65039); // 65039 - '️' - 0xFE0F;
133916var nonSpacingRegex = new RegExp(NON_SPACING_MARK, 'g')
133917
133918// Remove the non-spacing-mark from the code, never send a stripped version
133919// to the client, as it kills graphical emoticons.
133920function stripNSB (code) {
133921 return code.replace(nonSpacingRegex, '');
133922};
133923
133924// Reversed hash table, where as emojiByName contains a { heart: '❤' }
133925// dictionary emojiByCode contains { ❤: 'heart' }. The codes are normalized
133926// to the text version.
133927var emojiByCode = Object.keys(emojiByName).reduce(function(h,k) {
133928 h[stripNSB(emojiByName[k])] = k;
133929 return h;
133930}, {});
133931
133932/**
133933 * Emoji namespace
133934 */
133935var Emoji = {
133936 emoji: emojiByName,
133937};
133938
133939/**
133940 * get emoji code from name
133941 * @param {string} emoji
133942 * @return {string}
133943 */
133944Emoji._get = function _get (emoji) {
133945 if (emojiByName.hasOwnProperty(emoji)) {
133946 return emojiByName[emoji];
133947 }
133948
133949 return ensureColons(emoji);
133950};
133951
133952/**
133953 * get emoji code from :emoji: string or name
133954 * @param {string} emoji
133955 * @return {string}
133956 */
133957Emoji.get = function get (emoji) {
133958 emoji = stripColons(emoji);
133959
133960 return Emoji._get(emoji);
133961};
133962
133963/**
133964 * find the emoji by either code or name
133965 * @param {string} nameOrCode The emoji to find, either `coffee`, `:coffee:` or `☕`;
133966 * @return {object}
133967 */
133968Emoji.find = function find (nameOrCode) {
133969 return Emoji.findByName(nameOrCode) || Emoji.findByCode(nameOrCode);
133970};
133971
133972/**
133973 * find the emoji by name
133974 * @param {string} name The emoji to find either `coffee` or `:coffee:`;
133975 * @return {object}
133976 */
133977Emoji.findByName = function findByName (name) {
133978 var stripped = stripColons(name);
133979 var emoji = emojiByName[stripped];
133980
133981 return emoji ? ({ emoji: emoji, key: stripped }) : undefined;
133982};
133983
133984/**
133985 * find the emoji by code (emoji)
133986 * @param {string} code The emoji to find; for example `☕` or `☔`
133987 * @return {object}
133988 */
133989Emoji.findByCode = function findByCode (code) {
133990 var stripped = stripNSB(code);
133991 var name = emojiByCode[stripped];
133992
133993 // lookup emoji to ensure the Variant Form is returned
133994 return name ? ({ emoji: emojiByName[name], key: name }) : undefined;
133995};
133996
133997
133998/**
133999 * Check if an emoji is known by this library
134000 * @param {string} nameOrCode The emoji to validate, either `coffee`, `:coffee:` or `☕`;
134001 * @return {object}
134002 */
134003Emoji.hasEmoji = function hasEmoji (nameOrCode) {
134004 return Emoji.hasEmojiByName(nameOrCode) || Emoji.hasEmojiByCode(nameOrCode);
134005};
134006
134007/**
134008 * Check if an emoji with given name is known by this library
134009 * @param {string} name The emoji to validate either `coffee` or `:coffee:`;
134010 * @return {object}
134011 */
134012Emoji.hasEmojiByName = function hasEmojiByName (name) {
134013 var result = Emoji.findByName(name);
134014 return !!result && result.key === stripColons(name);
134015};
134016
134017/**
134018 * Check if a given emoji is known by this library
134019 * @param {string} code The emoji to validate; for example `☕` or `☔`
134020 * @return {object}
134021 */
134022Emoji.hasEmojiByCode = function hasEmojiByCode (code) {
134023 var result = Emoji.findByCode(code);
134024 return !!result && stripNSB(result.emoji) === stripNSB(code);
134025};
134026
134027/**
134028 * get emoji name from code
134029 * @param {string} emoji
134030 * @param {boolean} includeColons should the result include the ::
134031 * @return {string}
134032 */
134033Emoji.which = function which (emoji_code, includeColons) {
134034 var code = stripNSB(emoji_code);
134035 var word = emojiByCode[code];
134036
134037 return includeColons ? wrapColons(word) : word;
134038};
134039
134040/**
134041 * emojify a string (replace :emoji: with an emoji)
134042 * @param {string} str
134043 * @param {function} on_missing (gets emoji name without :: and returns a proper emoji if no emoji was found)
134044 * @param {function} format (wrap the returned emoji in a custom element)
134045 * @return {string}
134046 */
134047Emoji.emojify = function emojify (str, on_missing, format) {
134048 if (!str) return '';
134049
134050 return str.split(emojiNameRegex) // parse emoji via regex
134051 .map(function parseEmoji(s, i) {
134052 // every second element is an emoji, e.g. "test :fast_forward:" -> [ "test ", "fast_forward" ]
134053 if (i % 2 === 0) return s;
134054 var emoji = Emoji._get(s);
134055 var isMissing = emoji.indexOf(':') > -1;
134056
134057 if (isMissing && typeof on_missing === 'function') {
134058 return on_missing(s);
134059 }
134060
134061 if (!isMissing && typeof format === 'function') {
134062 return format(emoji, s);
134063 }
134064
134065 return emoji;
134066 })
134067 .join('') // convert back to string
134068 ;
134069};
134070
134071/**
134072 * return a random emoji
134073 * @return {string}
134074 */
134075Emoji.random = function random () {
134076 var emojiKeys = Object.keys(emojiByName);
134077 var randomIndex = Math.floor(Math.random() * emojiKeys.length);
134078 var key = emojiKeys[randomIndex];
134079 var emoji = Emoji._get(key);
134080 return { key: key, emoji: emoji };
134081}
134082
134083/**
134084 * return an collection of potential emoji matches
134085 * @param {string} str
134086 * @return {Array.<Object>}
134087 */
134088Emoji.search = function search (str) {
134089 var emojiKeys = Object.keys(emojiByName);
134090 var matcher = stripColons(str)
134091 var matchingKeys = emojiKeys.filter(function(key) {
134092 return key.toString().indexOf(matcher) === 0;
134093 });
134094 return matchingKeys.map(function(key) {
134095 return {
134096 key: key,
134097 emoji: Emoji._get(key),
134098 };
134099 });
134100}
134101
134102/**
134103 * unemojify a string (replace emoji with :emoji:)
134104 * @param {string} str
134105 * @return {string}
134106 */
134107Emoji.unemojify = function unemojify (str) {
134108 if (!str) return '';
134109 var words = toArray(str);
134110
134111 return words.map(function(word) {
134112 return Emoji.which(word, true) || word;
134113 }).join('');
134114};
134115
134116/**
134117 * replace emojis with replacement value
134118 * @param {string} str
134119 * @param {function|string} the string or callback function to replace the emoji with
134120 * @param {boolean} should trailing whitespaces be cleaned? Defaults false
134121 * @return {string}
134122 */
134123Emoji.replace = function replace (str, replacement, cleanSpaces) {
134124 if (!str) return '';
134125
134126 var replace = typeof replacement === 'function' ? replacement : function() { return replacement; };
134127 var words = toArray(str);
134128
134129 var replaced = words.map(function(word, idx) {
134130 var emoji = Emoji.findByCode(word);
134131
134132 if (emoji && cleanSpaces && words[idx + 1] === ' ') {
134133 words[idx + 1] = '';
134134 }
134135
134136 return emoji ? replace(emoji) : word;
134137 }).join('');
134138
134139 return cleanSpaces ? replaced.replace(trimSpaceRegex, '') : replaced;
134140};
134141
134142
134143/**
134144 * remove all emojis from a string
134145 * @param {string} str
134146 * @return {string}
134147 */
134148Emoji.strip = function strip (str) {
134149 return Emoji.replace(str, '', true);
134150};
134151
134152module.exports = Emoji;
134153
134154
134155/***/ }),
134156/* 836 */
134157/***/ (function(module, exports) {
134158
134159module.exports = {"100":"💯","1234":"🔢","interrobang":"⁉️","tm":"™️","information_source":"ℹ️","left_right_arrow":"↔️","arrow_up_down":"↕️","arrow_upper_left":"↖️","arrow_upper_right":"↗️","arrow_lower_right":"↘️","arrow_lower_left":"↙️","keyboard":"⌨","sunny":"☀️","cloud":"☁️","umbrella":"☔️","showman":"☃","comet":"☄","ballot_box_with_check":"☑️","coffee":"☕️","shamrock":"☘","skull_and_crossbones":"☠","radioactive_sign":"☢","biohazard_sign":"☣","orthodox_cross":"☦","wheel_of_dharma":"☸","white_frowning_face":"☹","aries":"♈️","taurus":"♉️","sagittarius":"♐️","capricorn":"♑️","aquarius":"♒️","pisces":"♓️","spades":"♠️","clubs":"♣️","hearts":"♥️","diamonds":"♦️","hotsprings":"♨️","hammer_and_pick":"⚒","anchor":"⚓️","crossed_swords":"⚔","scales":"⚖","alembic":"⚗","gear":"⚙","scissors":"✂️","white_check_mark":"✅","airplane":"✈️","email":"✉️","envelope":"✉️","black_nib":"✒️","heavy_check_mark":"✔️","heavy_multiplication_x":"✖️","star_of_david":"✡","sparkles":"✨","eight_spoked_asterisk":"✳️","eight_pointed_black_star":"✴️","snowflake":"❄️","sparkle":"❇️","question":"❓","grey_question":"❔","grey_exclamation":"❕","exclamation":"❗️","heavy_exclamation_mark":"❗️","heavy_heart_exclamation_mark_ornament":"❣","heart":"❤️","heavy_plus_sign":"➕","heavy_minus_sign":"➖","heavy_division_sign":"➗","arrow_heading_up":"⤴️","arrow_heading_down":"⤵️","wavy_dash":"〰️","congratulations":"㊗️","secret":"㊙️","copyright":"©️","registered":"®️","bangbang":"‼️","leftwards_arrow_with_hook":"↩️","arrow_right_hook":"↪️","watch":"⌚️","hourglass":"⌛️","fast_forward":"⏩","rewind":"⏪","arrow_double_up":"⏫","arrow_double_down":"⏬","black_right_pointing_double_triangle_with_vertical_bar":"⏭","black_left_pointing_double_triangle_with_vertical_bar":"⏮","black_right_pointing_triangle_with_double_vertical_bar":"⏯","alarm_clock":"⏰","stopwatch":"⏱","timer_clock":"⏲","hourglass_flowing_sand":"⏳","double_vertical_bar":"⏸","black_square_for_stop":"⏹","black_circle_for_record":"⏺","m":"Ⓜ️","black_small_square":"▪️","white_small_square":"▫️","arrow_forward":"▶️","arrow_backward":"◀️","white_medium_square":"◻️","black_medium_square":"◼️","white_medium_small_square":"◽️","black_medium_small_square":"◾️","phone":"☎️","telephone":"☎️","point_up":"☝️","star_and_crescent":"☪","peace_symbol":"☮","yin_yang":"☯","relaxed":"☺️","gemini":"♊️","cancer":"♋️","leo":"♌️","virgo":"♍️","libra":"♎️","scorpius":"♏️","recycle":"♻️","wheelchair":"♿️","atom_symbol":"⚛","fleur_de_lis":"⚜","warning":"⚠️","zap":"⚡️","white_circle":"⚪️","black_circle":"⚫️","coffin":"⚰","funeral_urn":"⚱","soccer":"⚽️","baseball":"⚾️","snowman":"⛄️","partly_sunny":"⛅️","thunder_cloud_and_rain":"⛈","ophiuchus":"⛎","pick":"⛏","helmet_with_white_cross":"⛑","chains":"⛓","no_entry":"⛔️","shinto_shrine":"⛩","church":"⛪️","mountain":"⛰","umbrella_on_ground":"⛱","fountain":"⛲️","golf":"⛳️","ferry":"⛴","boat":"⛵️","sailboat":"⛵️","skier":"⛷","ice_skate":"⛸","person_with_ball":"⛹","tent":"⛺️","fuelpump":"⛽️","fist":"✊","hand":"✋","raised_hand":"✋","v":"✌️","writing_hand":"✍","pencil2":"✏️","latin_cross":"✝","x":"❌","negative_squared_cross_mark":"❎","arrow_right":"➡️","curly_loop":"➰","loop":"➿","arrow_left":"⬅️","arrow_up":"⬆️","arrow_down":"⬇️","black_large_square":"⬛️","white_large_square":"⬜️","star":"⭐️","o":"⭕️","part_alternation_mark":"〽️","mahjong":"🀄️","black_joker":"🃏","a":"🅰️","b":"🅱️","o2":"🅾️","parking":"🅿️","ab":"🆎","cl":"🆑","cool":"🆒","free":"🆓","id":"🆔","new":"🆕","ng":"🆖","ok":"🆗","sos":"🆘","up":"🆙","vs":"🆚","koko":"🈁","sa":"🈂️","u7121":"🈚️","u6307":"🈯️","u7981":"🈲","u7a7a":"🈳","u5408":"🈴","u6e80":"🈵","u6709":"🈶","u6708":"🈷️","u7533":"🈸","u5272":"🈹","u55b6":"🈺","ideograph_advantage":"🉐","accept":"🉑","cyclone":"🌀","foggy":"🌁","closed_umbrella":"🌂","night_with_stars":"🌃","sunrise_over_mountains":"🌄","sunrise":"🌅","city_sunset":"🌆","city_sunrise":"🌇","rainbow":"🌈","bridge_at_night":"🌉","ocean":"🌊","volcano":"🌋","milky_way":"🌌","earth_africa":"🌍","earth_americas":"🌎","earth_asia":"🌏","globe_with_meridians":"🌐","new_moon":"🌑","waxing_crescent_moon":"🌒","first_quarter_moon":"🌓","moon":"🌔","waxing_gibbous_moon":"🌔","full_moon":"🌕","waning_gibbous_moon":"🌖","last_quarter_moon":"🌗","waning_crescent_moon":"🌘","crescent_moon":"🌙","new_moon_with_face":"🌚","first_quarter_moon_with_face":"🌛","last_quarter_moon_with_face":"🌜","full_moon_with_face":"🌝","sun_with_face":"🌞","star2":"🌟","stars":"🌠","thermometer":"🌡","mostly_sunny":"🌤","sun_small_cloud":"🌤","barely_sunny":"🌥","sun_behind_cloud":"🌥","partly_sunny_rain":"🌦","sun_behind_rain_cloud":"🌦","rain_cloud":"🌧","snow_cloud":"🌨","lightning":"🌩","lightning_cloud":"🌩","tornado":"🌪","tornado_cloud":"🌪","fog":"🌫","wind_blowing_face":"🌬","hotdog":"🌭","taco":"🌮","burrito":"🌯","chestnut":"🌰","seedling":"🌱","evergreen_tree":"🌲","deciduous_tree":"🌳","palm_tree":"🌴","cactus":"🌵","hot_pepper":"🌶","tulip":"🌷","cherry_blossom":"🌸","rose":"🌹","hibiscus":"🌺","sunflower":"🌻","blossom":"🌼","corn":"🌽","ear_of_rice":"🌾","herb":"🌿","four_leaf_clover":"🍀","maple_leaf":"🍁","fallen_leaf":"🍂","leaves":"🍃","mushroom":"🍄","tomato":"🍅","eggplant":"🍆","grapes":"🍇","melon":"🍈","watermelon":"🍉","tangerine":"🍊","lemon":"🍋","banana":"🍌","pineapple":"🍍","apple":"🍎","green_apple":"🍏","pear":"🍐","peach":"🍑","cherries":"🍒","strawberry":"🍓","hamburger":"🍔","pizza":"🍕","meat_on_bone":"🍖","poultry_leg":"🍗","rice_cracker":"🍘","rice_ball":"🍙","rice":"🍚","curry":"🍛","ramen":"🍜","spaghetti":"🍝","bread":"🍞","fries":"🍟","sweet_potato":"🍠","dango":"🍡","oden":"🍢","sushi":"🍣","fried_shrimp":"🍤","fish_cake":"🍥","icecream":"🍦","shaved_ice":"🍧","ice_cream":"🍨","doughnut":"🍩","cookie":"🍪","chocolate_bar":"🍫","candy":"🍬","lollipop":"🍭","custard":"🍮","honey_pot":"🍯","cake":"🍰","bento":"🍱","stew":"🍲","egg":"🍳","fork_and_knife":"🍴","tea":"🍵","sake":"🍶","wine_glass":"🍷","cocktail":"🍸","tropical_drink":"🍹","beer":"🍺","beers":"🍻","baby_bottle":"🍼","knife_fork_plate":"🍽","champagne":"🍾","popcorn":"🍿","ribbon":"🎀","gift":"🎁","birthday":"🎂","jack_o_lantern":"🎃","christmas_tree":"🎄","santa":"🎅","fireworks":"🎆","sparkler":"🎇","balloon":"🎈","tada":"🎉","confetti_ball":"🎊","tanabata_tree":"🎋","crossed_flags":"🎌","bamboo":"🎍","dolls":"🎎","flags":"🎏","wind_chime":"🎐","rice_scene":"🎑","school_satchel":"🎒","mortar_board":"🎓","medal":"🎖","reminder_ribbon":"🎗","studio_microphone":"🎙","level_slider":"🎚","control_knobs":"🎛","film_frames":"🎞","admission_tickets":"🎟","carousel_horse":"🎠","ferris_wheel":"🎡","roller_coaster":"🎢","fishing_pole_and_fish":"🎣","microphone":"🎤","movie_camera":"🎥","cinema":"🎦","headphones":"🎧","art":"🎨","tophat":"🎩","circus_tent":"🎪","ticket":"🎫","clapper":"🎬","performing_arts":"🎭","video_game":"🎮","dart":"🎯","slot_machine":"🎰","8ball":"🎱","game_die":"🎲","bowling":"🎳","flower_playing_cards":"🎴","musical_note":"🎵","notes":"🎶","saxophone":"🎷","guitar":"🎸","musical_keyboard":"🎹","trumpet":"🎺","violin":"🎻","musical_score":"🎼","running_shirt_with_sash":"🎽","tennis":"🎾","ski":"🎿","basketball":"🏀","checkered_flag":"🏁","snowboarder":"🏂","runner":"🏃","running":"🏃","surfer":"🏄","sports_medal":"🏅","trophy":"🏆","horse_racing":"🏇","football":"🏈","rugby_football":"🏉","swimmer":"🏊","weight_lifter":"🏋","golfer":"🏌","racing_motorcycle":"🏍","racing_car":"🏎","cricket_bat_and_ball":"🏏","volleyball":"🏐","field_hockey_stick_and_ball":"🏑","ice_hockey_stick_and_puck":"🏒","table_tennis_paddle_and_ball":"🏓","snow_capped_mountain":"🏔","camping":"🏕","beach_with_umbrella":"🏖","building_construction":"🏗","house_buildings":"🏘","cityscape":"🏙","derelict_house_building":"🏚","classical_building":"🏛","desert":"🏜","desert_island":"🏝","national_park":"🏞","stadium":"🏟","house":"🏠","house_with_garden":"🏡","office":"🏢","post_office":"🏣","european_post_office":"🏤","hospital":"🏥","bank":"🏦","atm":"🏧","hotel":"🏨","love_hotel":"🏩","convenience_store":"🏪","school":"🏫","department_store":"🏬","factory":"🏭","izakaya_lantern":"🏮","lantern":"🏮","japanese_castle":"🏯","european_castle":"🏰","waving_white_flag":"🏳","waving_black_flag":"🏴","rosette":"🏵","label":"🏷","badminton_racquet_and_shuttlecock":"🏸","bow_and_arrow":"🏹","amphora":"🏺","skin-tone-2":"🏻","skin-tone-3":"🏼","skin-tone-4":"🏽","skin-tone-5":"🏾","skin-tone-6":"🏿","rat":"🐀","mouse2":"🐁","ox":"🐂","water_buffalo":"🐃","cow2":"🐄","tiger2":"🐅","leopard":"🐆","rabbit2":"🐇","cat2":"🐈","dragon":"🐉","crocodile":"🐊","whale2":"🐋","snail":"🐌","snake":"🐍","racehorse":"🐎","ram":"🐏","goat":"🐐","sheep":"🐑","monkey":"🐒","rooster":"🐓","chicken":"🐔","dog2":"🐕","pig2":"🐖","boar":"🐗","elephant":"🐘","octopus":"🐙","shell":"🐚","bug":"🐛","ant":"🐜","bee":"🐝","honeybee":"🐝","beetle":"🐞","fish":"🐟","tropical_fish":"🐠","blowfish":"🐡","turtle":"🐢","hatching_chick":"🐣","baby_chick":"🐤","hatched_chick":"🐥","bird":"🐦","penguin":"🐧","koala":"🐨","poodle":"🐩","dromedary_camel":"🐪","camel":"🐫","dolphin":"🐬","flipper":"🐬","mouse":"🐭","cow":"🐮","tiger":"🐯","rabbit":"🐰","cat":"🐱","dragon_face":"🐲","whale":"🐳","horse":"🐴","monkey_face":"🐵","dog":"🐶","pig":"🐷","frog":"🐸","hamster":"🐹","wolf":"🐺","bear":"🐻","panda_face":"🐼","pig_nose":"🐽","feet":"🐾","paw_prints":"🐾","chipmunk":"🐿","eyes":"👀","eye":"👁","ear":"👂","nose":"👃","lips":"👄","tongue":"👅","point_up_2":"👆","point_down":"👇","point_left":"👈","point_right":"👉","facepunch":"👊","punch":"👊","wave":"👋","ok_hand":"👌","+1":"👍","thumbsup":"👍","-1":"👎","thumbsdown":"👎","clap":"👏","open_hands":"👐","crown":"👑","womans_hat":"👒","eyeglasses":"👓","necktie":"👔","shirt":"👕","tshirt":"👕","jeans":"👖","dress":"👗","kimono":"👘","bikini":"👙","womans_clothes":"👚","purse":"👛","handbag":"👜","pouch":"👝","mans_shoe":"👞","shoe":"👞","athletic_shoe":"👟","high_heel":"👠","sandal":"👡","boot":"👢","footprints":"👣","bust_in_silhouette":"👤","busts_in_silhouette":"👥","boy":"👦","girl":"👧","man":"👨","woman":"👩","family":"👨‍👩‍👦","man-woman-boy":"👨‍👩‍👦","couple":"👫","man_and_woman_holding_hands":"👫","two_men_holding_hands":"👬","two_women_holding_hands":"👭","cop":"👮","dancers":"👯","bride_with_veil":"👰","person_with_blond_hair":"👱","man_with_gua_pi_mao":"👲","man_with_turban":"👳","older_man":"👴","older_woman":"👵","baby":"👶","construction_worker":"👷","princess":"👸","japanese_ogre":"👹","japanese_goblin":"👺","ghost":"👻","angel":"👼","alien":"👽","space_invader":"👾","imp":"👿","skull":"💀","information_desk_person":"💁","guardsman":"💂","dancer":"💃","lipstick":"💄","nail_care":"💅","massage":"💆","haircut":"💇","barber":"💈","syringe":"💉","pill":"💊","kiss":"💋","love_letter":"💌","ring":"💍","gem":"💎","couplekiss":"💏","bouquet":"💐","couple_with_heart":"💑","wedding":"💒","heartbeat":"💓","broken_heart":"💔","two_hearts":"💕","sparkling_heart":"💖","heartpulse":"💗","cupid":"💘","blue_heart":"💙","green_heart":"💚","yellow_heart":"💛","purple_heart":"💜","gift_heart":"💝","revolving_hearts":"💞","heart_decoration":"💟","diamond_shape_with_a_dot_inside":"💠","bulb":"💡","anger":"💢","bomb":"💣","zzz":"💤","boom":"💥","collision":"💥","sweat_drops":"💦","droplet":"💧","dash":"💨","hankey":"💩","poop":"💩","shit":"💩","muscle":"💪","dizzy":"💫","speech_balloon":"💬","thought_balloon":"💭","white_flower":"💮","moneybag":"💰","currency_exchange":"💱","heavy_dollar_sign":"💲","credit_card":"💳","yen":"💴","dollar":"💵","euro":"💶","pound":"💷","money_with_wings":"💸","chart":"💹","seat":"💺","computer":"💻","briefcase":"💼","minidisc":"💽","floppy_disk":"💾","cd":"💿","dvd":"📀","file_folder":"📁","open_file_folder":"📂","page_with_curl":"📃","page_facing_up":"📄","date":"📅","calendar":"📆","card_index":"📇","chart_with_upwards_trend":"📈","chart_with_downwards_trend":"📉","bar_chart":"📊","clipboard":"📋","pushpin":"📌","round_pushpin":"📍","paperclip":"📎","straight_ruler":"📏","triangular_ruler":"📐","bookmark_tabs":"📑","ledger":"📒","notebook":"📓","notebook_with_decorative_cover":"📔","closed_book":"📕","book":"📖","open_book":"📖","green_book":"📗","blue_book":"📘","orange_book":"📙","books":"📚","name_badge":"📛","scroll":"📜","memo":"📝","pencil":"📝","telephone_receiver":"📞","pager":"📟","fax":"📠","satellite":"🛰","loudspeaker":"📢","mega":"📣","outbox_tray":"📤","inbox_tray":"📥","package":"📦","e-mail":"📧","incoming_envelope":"📨","envelope_with_arrow":"📩","mailbox_closed":"📪","mailbox":"📫","mailbox_with_mail":"📬","mailbox_with_no_mail":"📭","postbox":"📮","postal_horn":"📯","newspaper":"📰","iphone":"📱","calling":"📲","vibration_mode":"📳","mobile_phone_off":"📴","no_mobile_phones":"📵","signal_strength":"📶","camera":"📷","camera_with_flash":"📸","video_camera":"📹","tv":"📺","radio":"📻","vhs":"📼","film_projector":"📽","prayer_beads":"📿","twisted_rightwards_arrows":"🔀","repeat":"🔁","repeat_one":"🔂","arrows_clockwise":"🔃","arrows_counterclockwise":"🔄","low_brightness":"🔅","high_brightness":"🔆","mute":"🔇","speaker":"🔈","sound":"🔉","loud_sound":"🔊","battery":"🔋","electric_plug":"🔌","mag":"🔍","mag_right":"🔎","lock_with_ink_pen":"🔏","closed_lock_with_key":"🔐","key":"🔑","lock":"🔒","unlock":"🔓","bell":"🔔","no_bell":"🔕","bookmark":"🔖","link":"🔗","radio_button":"🔘","back":"🔙","end":"🔚","on":"🔛","soon":"🔜","top":"🔝","underage":"🔞","keycap_ten":"🔟","capital_abcd":"🔠","abcd":"🔡","symbols":"🔣","abc":"🔤","fire":"🔥","flashlight":"🔦","wrench":"🔧","hammer":"🔨","nut_and_bolt":"🔩","hocho":"🔪","knife":"🔪","gun":"🔫","microscope":"🔬","telescope":"🔭","crystal_ball":"🔮","six_pointed_star":"🔯","beginner":"🔰","trident":"🔱","black_square_button":"🔲","white_square_button":"🔳","red_circle":"🔴","large_blue_circle":"🔵","large_orange_diamond":"🔶","large_blue_diamond":"🔷","small_orange_diamond":"🔸","small_blue_diamond":"🔹","small_red_triangle":"🔺","small_red_triangle_down":"🔻","arrow_up_small":"🔼","arrow_down_small":"🔽","om_symbol":"🕉","dove_of_peace":"🕊","kaaba":"🕋","mosque":"🕌","synagogue":"🕍","menorah_with_nine_branches":"🕎","clock1":"🕐","clock2":"🕑","clock3":"🕒","clock4":"🕓","clock5":"🕔","clock6":"🕕","clock7":"🕖","clock8":"🕗","clock9":"🕘","clock10":"🕙","clock11":"🕚","clock12":"🕛","clock130":"🕜","clock230":"🕝","clock330":"🕞","clock430":"🕟","clock530":"🕠","clock630":"🕡","clock730":"🕢","clock830":"🕣","clock930":"🕤","clock1030":"🕥","clock1130":"🕦","clock1230":"🕧","candle":"🕯","mantelpiece_clock":"🕰","hole":"🕳","man_in_business_suit_levitating":"🕴","sleuth_or_spy":"🕵","dark_sunglasses":"🕶","spider":"🕷","spider_web":"🕸","joystick":"🕹","linked_paperclips":"🖇","lower_left_ballpoint_pen":"🖊","lower_left_fountain_pen":"🖋","lower_left_paintbrush":"🖌","lower_left_crayon":"🖍","raised_hand_with_fingers_splayed":"🖐","middle_finger":"🖕","reversed_hand_with_middle_finger_extended":"🖕","spock-hand":"🖖","desktop_computer":"🖥","printer":"🖨","three_button_mouse":"🖱","trackball":"🖲","frame_with_picture":"🖼","card_index_dividers":"🗂","card_file_box":"🗃","file_cabinet":"🗄","wastebasket":"🗑","spiral_note_pad":"🗒","spiral_calendar_pad":"🗓","compression":"🗜","old_key":"🗝","rolled_up_newspaper":"🗞","dagger_knife":"🗡","speaking_head_in_silhouette":"🗣","left_speech_bubble":"🗨","right_anger_bubble":"🗯","ballot_box_with_ballot":"🗳","world_map":"🗺","mount_fuji":"🗻","tokyo_tower":"🗼","statue_of_liberty":"🗽","japan":"🗾","moyai":"🗿","grinning":"😀","grin":"😁","joy":"😂","smiley":"😃","smile":"😄","sweat_smile":"😅","laughing":"😆","satisfied":"😆","innocent":"😇","smiling_imp":"😈","wink":"😉","blush":"😊","yum":"😋","relieved":"😌","heart_eyes":"😍","sunglasses":"😎","smirk":"😏","neutral_face":"😐","expressionless":"😑","unamused":"😒","sweat":"😓","pensive":"😔","confused":"😕","confounded":"😖","kissing":"😗","kissing_heart":"😘","kissing_smiling_eyes":"😙","kissing_closed_eyes":"😚","stuck_out_tongue":"😛","stuck_out_tongue_winking_eye":"😜","stuck_out_tongue_closed_eyes":"😝","disappointed":"😞","worried":"😟","angry":"😠","rage":"😡","cry":"😢","persevere":"😣","triumph":"😤","disappointed_relieved":"😥","frowning":"😦","anguished":"😧","fearful":"😨","weary":"😩","sleepy":"😪","tired_face":"😫","grimacing":"😬","sob":"😭","open_mouth":"😮","hushed":"😯","cold_sweat":"😰","scream":"😱","astonished":"😲","flushed":"😳","sleeping":"😴","dizzy_face":"😵","no_mouth":"😶","mask":"😷","smile_cat":"😸","joy_cat":"😹","smiley_cat":"😺","heart_eyes_cat":"😻","smirk_cat":"😼","kissing_cat":"😽","pouting_cat":"😾","crying_cat_face":"😿","scream_cat":"🙀","slightly_frowning_face":"🙁","slightly_smiling_face":"🙂","upside_down_face":"🙃","face_with_rolling_eyes":"🙄","no_good":"🙅","ok_woman":"🙆","bow":"🙇","see_no_evil":"🙈","hear_no_evil":"🙉","speak_no_evil":"🙊","raising_hand":"🙋","raised_hands":"🙌","person_frowning":"🙍","person_with_pouting_face":"🙎","pray":"🙏","rocket":"🚀","helicopter":"🚁","steam_locomotive":"🚂","railway_car":"🚃","bullettrain_side":"🚄","bullettrain_front":"🚅","train2":"🚆","metro":"🚇","light_rail":"🚈","station":"🚉","tram":"🚊","train":"🚋","bus":"🚌","oncoming_bus":"🚍","trolleybus":"🚎","busstop":"🚏","minibus":"🚐","ambulance":"🚑","fire_engine":"🚒","police_car":"🚓","oncoming_police_car":"🚔","taxi":"🚕","oncoming_taxi":"🚖","car":"🚗","red_car":"🚗","oncoming_automobile":"🚘","blue_car":"🚙","truck":"🚚","articulated_lorry":"🚛","tractor":"🚜","monorail":"🚝","mountain_railway":"🚞","suspension_railway":"🚟","mountain_cableway":"🚠","aerial_tramway":"🚡","ship":"🚢","rowboat":"🚣","speedboat":"🚤","traffic_light":"🚥","vertical_traffic_light":"🚦","construction":"🚧","rotating_light":"🚨","triangular_flag_on_post":"🚩","door":"🚪","no_entry_sign":"🚫","smoking":"🚬","no_smoking":"🚭","put_litter_in_its_place":"🚮","do_not_litter":"🚯","potable_water":"🚰","non-potable_water":"🚱","bike":"🚲","no_bicycles":"🚳","bicyclist":"🚴","mountain_bicyclist":"🚵","walking":"🚶","no_pedestrians":"🚷","children_crossing":"🚸","mens":"🚹","womens":"🚺","restroom":"🚻","baby_symbol":"🚼","toilet":"🚽","wc":"🚾","shower":"🚿","bath":"🛀","bathtub":"🛁","passport_control":"🛂","customs":"🛃","baggage_claim":"🛄","left_luggage":"🛅","couch_and_lamp":"🛋","sleeping_accommodation":"🛌","shopping_bags":"🛍","bellhop_bell":"🛎","bed":"🛏","place_of_worship":"🛐","hammer_and_wrench":"🛠","shield":"🛡","oil_drum":"🛢","motorway":"🛣","railway_track":"🛤","motor_boat":"🛥","small_airplane":"🛩","airplane_departure":"🛫","airplane_arriving":"🛬","passenger_ship":"🛳","zipper_mouth_face":"🤐","money_mouth_face":"🤑","face_with_thermometer":"🤒","nerd_face":"🤓","thinking_face":"🤔","face_with_head_bandage":"🤕","robot_face":"🤖","hugging_face":"🤗","the_horns":"🤘","sign_of_the_horns":"🤘","crab":"🦀","lion_face":"🦁","scorpion":"🦂","turkey":"🦃","unicorn_face":"🦄","cheese_wedge":"🧀","hash":"#️⃣","keycap_star":"*⃣","zero":"0️⃣","one":"1️⃣","two":"2️⃣","three":"3️⃣","four":"4️⃣","five":"5️⃣","six":"6️⃣","seven":"7️⃣","eight":"8️⃣","nine":"9️⃣","flag-ac":"🇦🇨","flag-ad":"🇦🇩","flag-ae":"🇦🇪","flag-af":"🇦🇫","flag-ag":"🇦🇬","flag-ai":"🇦🇮","flag-al":"🇦🇱","flag-am":"🇦🇲","flag-ao":"🇦🇴","flag-aq":"🇦🇶","flag-ar":"🇦🇷","flag-as":"🇦🇸","flag-at":"🇦🇹","flag-au":"🇦🇺","flag-aw":"🇦🇼","flag-ax":"🇦🇽","flag-az":"🇦🇿","flag-ba":"🇧🇦","flag-bb":"🇧🇧","flag-bd":"🇧🇩","flag-be":"🇧🇪","flag-bf":"🇧🇫","flag-bg":"🇧🇬","flag-bh":"🇧🇭","flag-bi":"🇧🇮","flag-bj":"🇧🇯","flag-bl":"🇧🇱","flag-bm":"🇧🇲","flag-bn":"🇧🇳","flag-bo":"🇧🇴","flag-bq":"🇧🇶","flag-br":"🇧🇷","flag-bs":"🇧🇸","flag-bt":"🇧🇹","flag-bv":"🇧🇻","flag-bw":"🇧🇼","flag-by":"🇧🇾","flag-bz":"🇧🇿","flag-ca":"🇨🇦","flag-cc":"🇨🇨","flag-cd":"🇨🇩","flag-cf":"🇨🇫","flag-cg":"🇨🇬","flag-ch":"🇨🇭","flag-ci":"🇨🇮","flag-ck":"🇨🇰","flag-cl":"🇨🇱","flag-cm":"🇨🇲","flag-cn":"🇨🇳","cn":"🇨🇳","flag-co":"🇨🇴","flag-cp":"🇨🇵","flag-cr":"🇨🇷","flag-cu":"🇨🇺","flag-cv":"🇨🇻","flag-cw":"🇨🇼","flag-cx":"🇨🇽","flag-cy":"🇨🇾","flag-cz":"🇨🇿","flag-de":"🇩🇪","de":"🇩🇪","flag-dg":"🇩🇬","flag-dj":"🇩🇯","flag-dk":"🇩🇰","flag-dm":"🇩🇲","flag-do":"🇩🇴","flag-dz":"🇩🇿","flag-ea":"🇪🇦","flag-ec":"🇪🇨","flag-ee":"🇪🇪","flag-eg":"🇪🇬","flag-eh":"🇪🇭","flag-er":"🇪🇷","flag-es":"🇪🇸","es":"🇪🇸","flag-et":"🇪🇹","flag-eu":"🇪🇺","flag-fi":"🇫🇮","flag-fj":"🇫🇯","flag-fk":"🇫🇰","flag-fm":"🇫🇲","flag-fo":"🇫🇴","flag-fr":"🇫🇷","fr":"🇫🇷","flag-ga":"🇬🇦","flag-gb":"🇬🇧","gb":"🇬🇧","uk":"🇬🇧","flag-gd":"🇬🇩","flag-ge":"🇬🇪","flag-gf":"🇬🇫","flag-gg":"🇬🇬","flag-gh":"🇬🇭","flag-gi":"🇬🇮","flag-gl":"🇬🇱","flag-gm":"🇬🇲","flag-gn":"🇬🇳","flag-gp":"🇬🇵","flag-gq":"🇬🇶","flag-gr":"🇬🇷","flag-gs":"🇬🇸","flag-gt":"🇬🇹","flag-gu":"🇬🇺","flag-gw":"🇬🇼","flag-gy":"🇬🇾","flag-hk":"🇭🇰","flag-hm":"🇭🇲","flag-hn":"🇭🇳","flag-hr":"🇭🇷","flag-ht":"🇭🇹","flag-hu":"🇭🇺","flag-ic":"🇮🇨","flag-id":"🇮🇩","flag-ie":"🇮🇪","flag-il":"🇮🇱","flag-im":"🇮🇲","flag-in":"🇮🇳","flag-io":"🇮🇴","flag-iq":"🇮🇶","flag-ir":"🇮🇷","flag-is":"🇮🇸","flag-it":"🇮🇹","it":"🇮🇹","flag-je":"🇯🇪","flag-jm":"🇯🇲","flag-jo":"🇯🇴","flag-jp":"🇯🇵","jp":"🇯🇵","flag-ke":"🇰🇪","flag-kg":"🇰🇬","flag-kh":"🇰🇭","flag-ki":"🇰🇮","flag-km":"🇰🇲","flag-kn":"🇰🇳","flag-kp":"🇰🇵","flag-kr":"🇰🇷","kr":"🇰🇷","flag-kw":"🇰🇼","flag-ky":"🇰🇾","flag-kz":"🇰🇿","flag-la":"🇱🇦","flag-lb":"🇱🇧","flag-lc":"🇱🇨","flag-li":"🇱🇮","flag-lk":"🇱🇰","flag-lr":"🇱🇷","flag-ls":"🇱🇸","flag-lt":"🇱🇹","flag-lu":"🇱🇺","flag-lv":"🇱🇻","flag-ly":"🇱🇾","flag-ma":"🇲🇦","flag-mc":"🇲🇨","flag-md":"🇲🇩","flag-me":"🇲🇪","flag-mf":"🇲🇫","flag-mg":"🇲🇬","flag-mh":"🇲🇭","flag-mk":"🇲🇰","flag-ml":"🇲🇱","flag-mm":"🇲🇲","flag-mn":"🇲🇳","flag-mo":"🇲🇴","flag-mp":"🇲🇵","flag-mq":"🇲🇶","flag-mr":"🇲🇷","flag-ms":"🇲🇸","flag-mt":"🇲🇹","flag-mu":"🇲🇺","flag-mv":"🇲🇻","flag-mw":"🇲🇼","flag-mx":"🇲🇽","flag-my":"🇲🇾","flag-mz":"🇲🇿","flag-na":"🇳🇦","flag-nc":"🇳🇨","flag-ne":"🇳🇪","flag-nf":"🇳🇫","flag-ng":"🇳🇬","flag-ni":"🇳🇮","flag-nl":"🇳🇱","flag-no":"🇳🇴","flag-np":"🇳🇵","flag-nr":"🇳🇷","flag-nu":"🇳🇺","flag-nz":"🇳🇿","flag-om":"🇴🇲","flag-pa":"🇵🇦","flag-pe":"🇵🇪","flag-pf":"🇵🇫","flag-pg":"🇵🇬","flag-ph":"🇵🇭","flag-pk":"🇵🇰","flag-pl":"🇵🇱","flag-pm":"🇵🇲","flag-pn":"🇵🇳","flag-pr":"🇵🇷","flag-ps":"🇵🇸","flag-pt":"🇵🇹","flag-pw":"🇵🇼","flag-py":"🇵🇾","flag-qa":"🇶🇦","flag-re":"🇷🇪","flag-ro":"🇷🇴","flag-rs":"🇷🇸","flag-ru":"🇷🇺","ru":"🇷🇺","flag-rw":"🇷🇼","flag-sa":"🇸🇦","flag-sb":"🇸🇧","flag-sc":"🇸🇨","flag-sd":"🇸🇩","flag-se":"🇸🇪","flag-sg":"🇸🇬","flag-sh":"🇸🇭","flag-si":"🇸🇮","flag-sj":"🇸🇯","flag-sk":"🇸🇰","flag-sl":"🇸🇱","flag-sm":"🇸🇲","flag-sn":"🇸🇳","flag-so":"🇸🇴","flag-sr":"🇸🇷","flag-ss":"🇸🇸","flag-st":"🇸🇹","flag-sv":"🇸🇻","flag-sx":"🇸🇽","flag-sy":"🇸🇾","flag-sz":"🇸🇿","flag-ta":"🇹🇦","flag-tc":"🇹🇨","flag-td":"🇹🇩","flag-tf":"🇹🇫","flag-tg":"🇹🇬","flag-th":"🇹🇭","flag-tj":"🇹🇯","flag-tk":"🇹🇰","flag-tl":"🇹🇱","flag-tm":"🇹🇲","flag-tn":"🇹🇳","flag-to":"🇹🇴","flag-tr":"🇹🇷","flag-tt":"🇹🇹","flag-tv":"🇹🇻","flag-tw":"🇹🇼","flag-tz":"🇹🇿","flag-ua":"🇺🇦","flag-ug":"🇺🇬","flag-um":"🇺🇲","flag-us":"🇺🇸","us":"🇺🇸","flag-uy":"🇺🇾","flag-uz":"🇺🇿","flag-va":"🇻🇦","flag-vc":"🇻🇨","flag-ve":"🇻🇪","flag-vg":"🇻🇬","flag-vi":"🇻🇮","flag-vn":"🇻🇳","flag-vu":"🇻🇺","flag-wf":"🇼🇫","flag-ws":"🇼🇸","flag-xk":"🇽🇰","flag-ye":"🇾🇪","flag-yt":"🇾🇹","flag-za":"🇿🇦","flag-zm":"🇿🇲","flag-zw":"🇿🇼","man-man-boy":"👨‍👨‍👦","man-man-boy-boy":"👨‍👨‍👦‍👦","man-man-girl":"👨‍👨‍👧","man-man-girl-boy":"👨‍👨‍👧‍👦","man-man-girl-girl":"👨‍👨‍👧‍👧","man-woman-boy-boy":"👨‍👩‍👦‍👦","man-woman-girl":"👨‍👩‍👧","man-woman-girl-boy":"👨‍👩‍👧‍👦","man-woman-girl-girl":"👨‍👩‍👧‍👧","man-heart-man":"👨‍❤️‍👨","man-kiss-man":"👨‍❤️‍💋‍👨","woman-woman-boy":"👩‍👩‍👦","woman-woman-boy-boy":"👩‍👩‍👦‍👦","woman-woman-girl":"👩‍👩‍👧","woman-woman-girl-boy":"👩‍👩‍👧‍👦","woman-woman-girl-girl":"👩‍👩‍👧‍👧","woman-heart-woman":"👩‍❤️‍👩","woman-kiss-woman":"👩‍❤️‍💋‍👩"}
134160
134161/***/ }),
134162/* 837 */
134163/***/ (function(module, exports, __webpack_require__) {
134164
134165/*!
134166 * normalize-path <https://github.com/jonschlinkert/normalize-path>
134167 *
134168 * Copyright (c) 2014-2017, Jon Schlinkert.
134169 * Released under the MIT License.
134170 */
134171
134172var removeTrailingSeparator = __webpack_require__(868);
134173
134174module.exports = function normalizePath(str, stripTrailing) {
134175 if (typeof str !== 'string') {
134176 throw new TypeError('expected a string');
134177 }
134178 str = str.replace(/[\\\/]+/g, '/');
134179 if (stripTrailing !== false) {
134180 str = removeTrailingSeparator(str);
134181 }
134182 return str;
134183};
134184
134185
134186/***/ }),
134187/* 838 */
134188/***/ (function(module, exports, __webpack_require__) {
134189
134190"use strict";
134191
134192
134193let path
134194
134195class LogicalTree {
134196 constructor (name, address, opts) {
134197 this.name = name
134198 this.version = opts.version
134199 this.address = address || ''
134200 this.optional = !!opts.optional
134201 this.dev = !!opts.dev
134202 this.bundled = !!opts.bundled
134203 this.resolved = opts.resolved
134204 this.integrity = opts.integrity
134205 this.dependencies = new Map()
134206 this.requiredBy = new Set()
134207 }
134208
134209 get isRoot () { return !this.requiredBy.size }
134210
134211 addDep (dep) {
134212 this.dependencies.set(dep.name, dep)
134213 dep.requiredBy.add(this)
134214 return this
134215 }
134216
134217 delDep (dep) {
134218 this.dependencies.delete(dep.name)
134219 dep.requiredBy.delete(this)
134220 return this
134221 }
134222
134223 getDep (name) {
134224 return this.dependencies.get(name)
134225 }
134226
134227 path (prefix) {
134228 if (this.isRoot) {
134229 // The address of the root is the prefix itself.
134230 return prefix || ''
134231 } else {
134232 if (!path) { path = __webpack_require__(1) }
134233 return path.join(
134234 prefix || '',
134235 'node_modules',
134236 this.address.replace(/:/g, '/node_modules/')
134237 )
134238 }
134239 }
134240
134241 // This finds cycles _from_ a given node: if some deeper dep has
134242 // its own cycle, but that cycle does not refer to this node,
134243 // it will return false.
134244 hasCycle (_seen, _from) {
134245 if (!_seen) { _seen = new Set() }
134246 if (!_from) { _from = this }
134247 for (let dep of this.dependencies.values()) {
134248 if (_seen.has(dep)) { continue }
134249 _seen.add(dep)
134250 if (dep === _from || dep.hasCycle(_seen, _from)) {
134251 return true
134252 }
134253 }
134254 return false
134255 }
134256
134257 forEachAsync (fn, opts, _pending) {
134258 if (!opts) { opts = _pending || {} }
134259 if (!_pending) { _pending = new Map() }
134260 const P = opts.Promise || Promise
134261 if (_pending.has(this)) {
134262 return P.resolve(this.hasCycle() || _pending.get(this))
134263 }
134264 const pending = P.resolve().then(() => {
134265 return fn(this, () => {
134266 return promiseMap(
134267 this.dependencies.values(),
134268 dep => dep.forEachAsync(fn, opts, _pending),
134269 opts
134270 )
134271 })
134272 })
134273 _pending.set(this, pending)
134274 return pending
134275 }
134276
134277 forEach (fn, _seen) {
134278 if (!_seen) { _seen = new Set() }
134279 if (_seen.has(this)) { return }
134280 _seen.add(this)
134281 fn(this, () => {
134282 for (let dep of this.dependencies.values()) {
134283 dep.forEach(fn, _seen)
134284 }
134285 })
134286 }
134287}
134288
134289module.exports = lockTree
134290function lockTree (pkg, pkgLock, opts) {
134291 const tree = makeNode(pkg.name, null, pkg)
134292 const allDeps = new Map()
134293 Array.from(
134294 new Set(Object.keys(pkg.devDependencies || {})
134295 .concat(Object.keys(pkg.optionalDependencies || {}))
134296 .concat(Object.keys(pkg.dependencies || {})))
134297 ).forEach(name => {
134298 let dep = allDeps.get(name)
134299 if (!dep) {
134300 const depNode = (pkgLock.dependencies || {})[name]
134301 dep = makeNode(name, name, depNode)
134302 }
134303 addChild(dep, tree, allDeps, pkgLock)
134304 })
134305 return tree
134306}
134307
134308module.exports.node = makeNode
134309function makeNode (name, address, opts) {
134310 return new LogicalTree(name, address, opts || {})
134311}
134312
134313function addChild (dep, tree, allDeps, pkgLock) {
134314 tree.addDep(dep)
134315 allDeps.set(dep.address, dep)
134316 const addr = dep.address
134317 const lockNode = atAddr(pkgLock, addr)
134318 Object.keys(lockNode.requires || {}).forEach(name => {
134319 const tdepAddr = reqAddr(pkgLock, name, addr)
134320 let tdep = allDeps.get(tdepAddr)
134321 if (!tdep) {
134322 tdep = makeNode(name, tdepAddr, atAddr(pkgLock, tdepAddr))
134323 addChild(tdep, dep, allDeps, pkgLock)
134324 } else {
134325 dep.addDep(tdep)
134326 }
134327 })
134328}
134329
134330module.exports._reqAddr = reqAddr
134331function reqAddr (pkgLock, name, fromAddr) {
134332 const lockNode = atAddr(pkgLock, fromAddr)
134333 const child = (lockNode.dependencies || {})[name]
134334 if (child) {
134335 return `${fromAddr}:${name}`
134336 } else {
134337 const parts = fromAddr.split(':')
134338 while (parts.length) {
134339 parts.pop()
134340 const joined = parts.join(':')
134341 const parent = atAddr(pkgLock, joined)
134342 if (parent) {
134343 const child = (parent.dependencies || {})[name]
134344 if (child) {
134345 return `${joined}${parts.length ? ':' : ''}${name}`
134346 }
134347 }
134348 }
134349 const err = new Error(`${name} not accessible from ${fromAddr}`)
134350 err.pkgLock = pkgLock
134351 err.target = name
134352 err.from = fromAddr
134353 throw err
134354 }
134355}
134356
134357module.exports._atAddr = atAddr
134358function atAddr (pkgLock, addr) {
134359 if (!addr.length) { return pkgLock }
134360 const parts = addr.split(':')
134361 return parts.reduce((acc, next) => {
134362 return acc && (acc.dependencies || {})[next]
134363 }, pkgLock)
134364}
134365
134366function promiseMap (arr, fn, opts, _index) {
134367 _index = _index || 0
134368 const P = (opts && opts.Promise) || Promise
134369 if (P.map) {
134370 return P.map(arr, fn, opts)
134371 } else {
134372 if (!(arr instanceof Array)) {
134373 arr = Array.from(arr)
134374 }
134375 if (_index >= arr.length) {
134376 return P.resolve()
134377 } else {
134378 return P.resolve(fn(arr[_index], _index, arr))
134379 .then(() => promiseMap(arr, fn, opts, _index + 1))
134380 }
134381 }
134382}
134383
134384
134385/***/ }),
134386/* 839 */
134387/***/ (function(module, exports, __webpack_require__) {
134388
134389"use strict";
134390
134391module.exports = Number.isNaN || function (x) {
134392 return x !== x;
134393};
134394
134395
134396/***/ }),
134397/* 840 */
134398/***/ (function(module, exports, __webpack_require__) {
134399
134400var crypto = __webpack_require__(21)
134401 , qs = __webpack_require__(186)
134402 ;
134403
134404function sha1 (key, body) {
134405 return crypto.createHmac('sha1', key).update(body).digest('base64')
134406}
134407
134408function rsa (key, body) {
134409 return crypto.createSign("RSA-SHA1").update(body).sign(key, 'base64');
134410}
134411
134412function rfc3986 (str) {
134413 return encodeURIComponent(str)
134414 .replace(/!/g,'%21')
134415 .replace(/\*/g,'%2A')
134416 .replace(/\(/g,'%28')
134417 .replace(/\)/g,'%29')
134418 .replace(/'/g,'%27')
134419 ;
134420}
134421
134422// Maps object to bi-dimensional array
134423// Converts { foo: 'A', bar: [ 'b', 'B' ]} to
134424// [ ['foo', 'A'], ['bar', 'b'], ['bar', 'B'] ]
134425function map (obj) {
134426 var key, val, arr = []
134427 for (key in obj) {
134428 val = obj[key]
134429 if (Array.isArray(val))
134430 for (var i = 0; i < val.length; i++)
134431 arr.push([key, val[i]])
134432 else if (typeof val === "object")
134433 for (var prop in val)
134434 arr.push([key + '[' + prop + ']', val[prop]]);
134435 else
134436 arr.push([key, val])
134437 }
134438 return arr
134439}
134440
134441// Compare function for sort
134442function compare (a, b) {
134443 return a > b ? 1 : a < b ? -1 : 0
134444}
134445
134446function generateBase (httpMethod, base_uri, params) {
134447 // adapted from https://dev.twitter.com/docs/auth/oauth and
134448 // https://dev.twitter.com/docs/auth/creating-signature
134449
134450 // Parameter normalization
134451 // http://tools.ietf.org/html/rfc5849#section-3.4.1.3.2
134452 var normalized = map(params)
134453 // 1. First, the name and value of each parameter are encoded
134454 .map(function (p) {
134455 return [ rfc3986(p[0]), rfc3986(p[1] || '') ]
134456 })
134457 // 2. The parameters are sorted by name, using ascending byte value
134458 // ordering. If two or more parameters share the same name, they
134459 // are sorted by their value.
134460 .sort(function (a, b) {
134461 return compare(a[0], b[0]) || compare(a[1], b[1])
134462 })
134463 // 3. The name of each parameter is concatenated to its corresponding
134464 // value using an "=" character (ASCII code 61) as a separator, even
134465 // if the value is empty.
134466 .map(function (p) { return p.join('=') })
134467 // 4. The sorted name/value pairs are concatenated together into a
134468 // single string by using an "&" character (ASCII code 38) as
134469 // separator.
134470 .join('&')
134471
134472 var base = [
134473 rfc3986(httpMethod ? httpMethod.toUpperCase() : 'GET'),
134474 rfc3986(base_uri),
134475 rfc3986(normalized)
134476 ].join('&')
134477
134478 return base
134479}
134480
134481function hmacsign (httpMethod, base_uri, params, consumer_secret, token_secret) {
134482 var base = generateBase(httpMethod, base_uri, params)
134483 var key = [
134484 consumer_secret || '',
134485 token_secret || ''
134486 ].map(rfc3986).join('&')
134487
134488 return sha1(key, base)
134489}
134490
134491function rsasign (httpMethod, base_uri, params, private_key, token_secret) {
134492 var base = generateBase(httpMethod, base_uri, params)
134493 var key = private_key || ''
134494
134495 return rsa(key, base)
134496}
134497
134498function plaintext (consumer_secret, token_secret) {
134499 var key = [
134500 consumer_secret || '',
134501 token_secret || ''
134502 ].map(rfc3986).join('&')
134503
134504 return key
134505}
134506
134507function sign (signMethod, httpMethod, base_uri, params, consumer_secret, token_secret) {
134508 var method
134509 var skipArgs = 1
134510
134511 switch (signMethod) {
134512 case 'RSA-SHA1':
134513 method = rsasign
134514 break
134515 case 'HMAC-SHA1':
134516 method = hmacsign
134517 break
134518 case 'PLAINTEXT':
134519 method = plaintext
134520 skipArgs = 4
134521 break
134522 default:
134523 throw new Error("Signature method not supported: " + signMethod)
134524 }
134525
134526 return method.apply(null, [].slice.call(arguments, skipArgs))
134527}
134528
134529exports.hmacsign = hmacsign
134530exports.rsasign = rsasign
134531exports.plaintext = plaintext
134532exports.sign = sign
134533exports.rfc3986 = rfc3986
134534exports.generateBase = generateBase
134535
134536
134537
134538/***/ }),
134539/* 841 */
134540/***/ (function(module, exports, __webpack_require__) {
134541
134542"use strict";
134543/*!
134544 * object.omit <https://github.com/jonschlinkert/object.omit>
134545 *
134546 * Copyright (c) 2014-2015, Jon Schlinkert.
134547 * Licensed under the MIT License.
134548 */
134549
134550
134551
134552var isObject = __webpack_require__(784);
134553var forOwn = __webpack_require__(842);
134554
134555module.exports = function omit(obj, keys) {
134556 if (!isObject(obj)) return {};
134557
134558 keys = [].concat.apply([], [].slice.call(arguments, 1));
134559 var last = keys[keys.length - 1];
134560 var res = {}, fn;
134561
134562 if (typeof last === 'function') {
134563 fn = keys.pop();
134564 }
134565
134566 var isFunction = typeof fn === 'function';
134567 if (!keys.length && !isFunction) {
134568 return obj;
134569 }
134570
134571 forOwn(obj, function(value, key) {
134572 if (keys.indexOf(key) === -1) {
134573
134574 if (!isFunction) {
134575 res[key] = value;
134576 } else if (fn(value, key, obj)) {
134577 res[key] = value;
134578 }
134579 }
134580 });
134581 return res;
134582};
134583
134584
134585/***/ }),
134586/* 842 */
134587/***/ (function(module, exports, __webpack_require__) {
134588
134589"use strict";
134590/*!
134591 * for-own <https://github.com/jonschlinkert/for-own>
134592 *
134593 * Copyright (c) 2014-2017, Jon Schlinkert.
134594 * Released under the MIT License.
134595 */
134596
134597
134598
134599var forIn = __webpack_require__(671);
134600var hasOwn = Object.prototype.hasOwnProperty;
134601
134602module.exports = function forOwn(obj, fn, thisArg) {
134603 forIn(obj, function(val, key) {
134604 if (hasOwn.call(obj, key)) {
134605 return fn.call(thisArg, obj[key], key, obj);
134606 }
134607 });
134608};
134609
134610
134611/***/ }),
134612/* 843 */
134613/***/ (function(module, exports, __webpack_require__) {
134614
134615"use strict";
134616
134617const mimicFn = __webpack_require__(831);
134618
134619module.exports = (fn, opts) => {
134620 // TODO: Remove this in v3
134621 if (opts === true) {
134622 throw new TypeError('The second argument is now an options object');
134623 }
134624
134625 if (typeof fn !== 'function') {
134626 throw new TypeError('Expected a function');
134627 }
134628
134629 opts = opts || {};
134630
134631 let ret;
134632 let called = false;
134633 const fnName = fn.displayName || fn.name || '<anonymous>';
134634
134635 const onetime = function () {
134636 if (called) {
134637 if (opts.throw === true) {
134638 throw new Error(`Function \`${fnName}\` can only be called once`);
134639 }
134640
134641 return ret;
134642 }
134643
134644 called = true;
134645 ret = fn.apply(this, arguments);
134646 fn = null;
134647
134648 return ret;
134649 };
134650
134651 mimicFn(onetime, fn);
134652
134653 return onetime;
134654};
134655
134656
134657/***/ }),
134658/* 844 */
134659/***/ (function(module, exports, __webpack_require__) {
134660
134661"use strict";
134662
134663var isWindows = process.platform === 'win32';
134664var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/;
134665
134666// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43
134667module.exports = function () {
134668 var path;
134669
134670 if (isWindows) {
134671 path = process.env.TEMP ||
134672 process.env.TMP ||
134673 (process.env.SystemRoot || process.env.windir) + '\\temp';
134674 } else {
134675 path = process.env.TMPDIR ||
134676 process.env.TMP ||
134677 process.env.TEMP ||
134678 '/tmp';
134679 }
134680
134681 if (trailingSlashRe.test(path)) {
134682 path = path.slice(0, -1);
134683 }
134684
134685 return path;
134686};
134687
134688
134689/***/ }),
134690/* 845 */
134691/***/ (function(module, exports, __webpack_require__) {
134692
134693"use strict";
134694/*!
134695 * parse-glob <https://github.com/jonschlinkert/parse-glob>
134696 *
134697 * Copyright (c) 2015, Jon Schlinkert.
134698 * Licensed under the MIT License.
134699 */
134700
134701
134702
134703var isGlob = __webpack_require__(167);
134704var findBase = __webpack_require__(677);
134705var extglob = __webpack_require__(166);
134706var dotfile = __webpack_require__(782);
134707
134708/**
134709 * Expose `cache`
134710 */
134711
134712var cache = module.exports.cache = {};
134713
134714/**
134715 * Parse a glob pattern into tokens.
134716 *
134717 * When no paths or '**' are in the glob, we use a
134718 * different strategy for parsing the filename, since
134719 * file names can contain braces and other difficult
134720 * patterns. such as:
134721 *
134722 * - `*.{a,b}`
134723 * - `(**|*.js)`
134724 */
134725
134726module.exports = function parseGlob(glob) {
134727 if (cache.hasOwnProperty(glob)) {
134728 return cache[glob];
134729 }
134730
134731 var tok = {};
134732 tok.orig = glob;
134733 tok.is = {};
134734
134735 // unescape dots and slashes in braces/brackets
134736 glob = escape(glob);
134737
134738 var parsed = findBase(glob);
134739 tok.is.glob = parsed.isGlob;
134740
134741 tok.glob = parsed.glob;
134742 tok.base = parsed.base;
134743 var segs = /([^\/]*)$/.exec(glob);
134744
134745 tok.path = {};
134746 tok.path.dirname = '';
134747 tok.path.basename = segs[1] || '';
134748 tok.path.dirname = glob.split(tok.path.basename).join('') || '';
134749 var basename = (tok.path.basename || '').split('.') || '';
134750 tok.path.filename = basename[0] || '';
134751 tok.path.extname = basename.slice(1).join('.') || '';
134752 tok.path.ext = '';
134753
134754 if (isGlob(tok.path.dirname) && !tok.path.basename) {
134755 if (!/\/$/.test(tok.glob)) {
134756 tok.path.basename = tok.glob;
134757 }
134758 tok.path.dirname = tok.base;
134759 }
134760
134761 if (glob.indexOf('/') === -1 && !tok.is.globstar) {
134762 tok.path.dirname = '';
134763 tok.path.basename = tok.orig;
134764 }
134765
134766 var dot = tok.path.basename.indexOf('.');
134767 if (dot !== -1) {
134768 tok.path.filename = tok.path.basename.slice(0, dot);
134769 tok.path.extname = tok.path.basename.slice(dot);
134770 }
134771
134772 if (tok.path.extname.charAt(0) === '.') {
134773 var exts = tok.path.extname.split('.');
134774 tok.path.ext = exts[exts.length - 1];
134775 }
134776
134777 // unescape dots and slashes in braces/brackets
134778 tok.glob = unescape(tok.glob);
134779 tok.path.dirname = unescape(tok.path.dirname);
134780 tok.path.basename = unescape(tok.path.basename);
134781 tok.path.filename = unescape(tok.path.filename);
134782 tok.path.extname = unescape(tok.path.extname);
134783
134784 // Booleans
134785 var is = (glob && tok.is.glob);
134786 tok.is.negated = glob && glob.charAt(0) === '!';
134787 tok.is.extglob = glob && extglob(glob);
134788 tok.is.braces = has(is, glob, '{');
134789 tok.is.brackets = has(is, glob, '[:');
134790 tok.is.globstar = has(is, glob, '**');
134791 tok.is.dotfile = dotfile(tok.path.basename) || dotfile(tok.path.filename);
134792 tok.is.dotdir = dotdir(tok.path.dirname);
134793 return (cache[glob] = tok);
134794}
134795
134796/**
134797 * Returns true if the glob matches dot-directories.
134798 *
134799 * @param {Object} `tok` The tokens object
134800 * @param {Object} `path` The path object
134801 * @return {Object}
134802 */
134803
134804function dotdir(base) {
134805 if (base.indexOf('/.') !== -1) {
134806 return true;
134807 }
134808 if (base.charAt(0) === '.' && base.charAt(1) !== '/') {
134809 return true;
134810 }
134811 return false;
134812}
134813
134814/**
134815 * Returns true if the pattern has the given `ch`aracter(s)
134816 *
134817 * @param {Object} `glob` The glob pattern.
134818 * @param {Object} `ch` The character to test for
134819 * @return {Object}
134820 */
134821
134822function has(is, glob, ch) {
134823 return is && glob.indexOf(ch) !== -1;
134824}
134825
134826/**
134827 * Escape/unescape utils
134828 */
134829
134830function escape(str) {
134831 var re = /\{([^{}]*?)}|\(([^()]*?)\)|\[([^\[\]]*?)\]/g;
134832 return str.replace(re, function (outter, braces, parens, brackets) {
134833 var inner = braces || parens || brackets;
134834 if (!inner) { return outter; }
134835 return outter.split(inner).join(esc(inner));
134836 });
134837}
134838
134839function esc(str) {
134840 str = str.split('/').join('__SLASH__');
134841 str = str.split('.').join('__DOT__');
134842 return str;
134843}
134844
134845function unescape(str) {
134846 str = str.split('__SLASH__').join('/');
134847 str = str.split('__DOT__').join('.');
134848 return str;
134849}
134850
134851
134852/***/ }),
134853/* 846 */
134854/***/ (function(module, exports, __webpack_require__) {
134855
134856"use strict";
134857
134858
134859var isWindows = process.platform === 'win32';
134860
134861// Regex to split a windows path into three parts: [*, device, slash,
134862// tail] windows-only
134863var splitDeviceRe =
134864 /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
134865
134866// Regex to split the tail part of the above into [*, dir, basename, ext]
134867var splitTailRe =
134868 /^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/;
134869
134870var win32 = {};
134871
134872// Function to split a filename into [root, dir, basename, ext]
134873function win32SplitPath(filename) {
134874 // Separate device+slash from tail
134875 var result = splitDeviceRe.exec(filename),
134876 device = (result[1] || '') + (result[2] || ''),
134877 tail = result[3] || '';
134878 // Split the tail into dir, basename and extension
134879 var result2 = splitTailRe.exec(tail),
134880 dir = result2[1],
134881 basename = result2[2],
134882 ext = result2[3];
134883 return [device, dir, basename, ext];
134884}
134885
134886win32.parse = function(pathString) {
134887 if (typeof pathString !== 'string') {
134888 throw new TypeError(
134889 "Parameter 'pathString' must be a string, not " + typeof pathString
134890 );
134891 }
134892 var allParts = win32SplitPath(pathString);
134893 if (!allParts || allParts.length !== 4) {
134894 throw new TypeError("Invalid path '" + pathString + "'");
134895 }
134896 return {
134897 root: allParts[0],
134898 dir: allParts[0] + allParts[1].slice(0, -1),
134899 base: allParts[2],
134900 ext: allParts[3],
134901 name: allParts[2].slice(0, allParts[2].length - allParts[3].length)
134902 };
134903};
134904
134905
134906
134907// Split a filename into [root, dir, basename, ext], unix version
134908// 'root' is just a slash, or nothing.
134909var splitPathRe =
134910 /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
134911var posix = {};
134912
134913
134914function posixSplitPath(filename) {
134915 return splitPathRe.exec(filename).slice(1);
134916}
134917
134918
134919posix.parse = function(pathString) {
134920 if (typeof pathString !== 'string') {
134921 throw new TypeError(
134922 "Parameter 'pathString' must be a string, not " + typeof pathString
134923 );
134924 }
134925 var allParts = posixSplitPath(pathString);
134926 if (!allParts || allParts.length !== 4) {
134927 throw new TypeError("Invalid path '" + pathString + "'");
134928 }
134929 allParts[1] = allParts[1] || '';
134930 allParts[2] = allParts[2] || '';
134931 allParts[3] = allParts[3] || '';
134932
134933 return {
134934 root: allParts[0],
134935 dir: allParts[0] + allParts[1].slice(0, -1),
134936 base: allParts[2],
134937 ext: allParts[3],
134938 name: allParts[2].slice(0, allParts[2].length - allParts[3].length)
134939 };
134940};
134941
134942
134943if (isWindows)
134944 module.exports = win32.parse;
134945else /* posix */
134946 module.exports = posix.parse;
134947
134948module.exports.posix = posix.parse;
134949module.exports.win32 = win32.parse;
134950
134951
134952/***/ }),
134953/* 847 */
134954/***/ (function(module, exports, __webpack_require__) {
134955
134956var duplexify = __webpack_require__(349)
134957var through = __webpack_require__(432)
134958var bufferFrom = __webpack_require__(560)
134959
134960var noop = function() {}
134961
134962var isObject = function(data) {
134963 return !Buffer.isBuffer(data) && typeof data !== 'string'
134964}
134965
134966var peek = function(opts, onpeek) {
134967 if (typeof opts === 'number') opts = {maxBuffer:opts}
134968 if (typeof opts === 'function') return peek(null, opts)
134969 if (!opts) opts = {}
134970
134971 var maxBuffer = typeof opts.maxBuffer === 'number' ? opts.maxBuffer : 65535
134972 var strict = opts.strict
134973 var newline = opts.newline !== false
134974
134975 var buffer = []
134976 var bufferSize = 0
134977 var dup = duplexify.obj()
134978
134979 var peeker = through.obj({highWaterMark:1}, function(data, enc, cb) {
134980 if (isObject(data)) return ready(data, null, cb)
134981 if (!Buffer.isBuffer(data)) data = bufferFrom(data)
134982
134983 if (newline) {
134984 var nl = Array.prototype.indexOf.call(data, 10)
134985 if (nl > 0 && data[nl-1] === 13) nl--
134986
134987 if (nl > -1) {
134988 buffer.push(data.slice(0, nl))
134989 return ready(Buffer.concat(buffer), data.slice(nl), cb)
134990 }
134991 }
134992
134993 buffer.push(data)
134994 bufferSize += data.length
134995
134996 if (bufferSize < maxBuffer) return cb()
134997 if (strict) return cb(new Error('No newline found'))
134998 ready(Buffer.concat(buffer), null, cb)
134999 })
135000
135001 var onpreend = function() {
135002 if (strict) return dup.destroy(new Error('No newline found'))
135003 dup.cork()
135004 ready(Buffer.concat(buffer), null, function(err) {
135005 if (err) return dup.destroy(err)
135006 dup.uncork()
135007 })
135008 }
135009
135010 var ready = function(data, overflow, cb) {
135011 dup.removeListener('preend', onpreend)
135012 onpeek(data, function(err, parser) {
135013 if (err) return cb(err)
135014
135015 dup.setWritable(parser)
135016 dup.setReadable(parser)
135017
135018 if (data) parser.write(data)
135019 if (overflow) parser.write(overflow)
135020
135021 overflow = buffer = peeker = null // free the data
135022 cb()
135023 })
135024 }
135025
135026 dup.on('preend', onpreend)
135027 dup.setWritable(peeker)
135028
135029 return dup
135030}
135031
135032module.exports = peek
135033
135034
135035/***/ }),
135036/* 848 */
135037/***/ (function(module, exports) {
135038
135039// Generated by CoffeeScript 1.12.2
135040(function() {
135041 var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime;
135042
135043 if ((typeof performance !== "undefined" && performance !== null) && performance.now) {
135044 module.exports = function() {
135045 return performance.now();
135046 };
135047 } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) {
135048 module.exports = function() {
135049 return (getNanoSeconds() - nodeLoadTime) / 1e6;
135050 };
135051 hrtime = process.hrtime;
135052 getNanoSeconds = function() {
135053 var hr;
135054 hr = hrtime();
135055 return hr[0] * 1e9 + hr[1];
135056 };
135057 moduleLoadTime = getNanoSeconds();
135058 upTime = process.uptime() * 1e9;
135059 nodeLoadTime = moduleLoadTime - upTime;
135060 } else if (Date.now) {
135061 module.exports = function() {
135062 return Date.now() - loadTime;
135063 };
135064 loadTime = Date.now();
135065 } else {
135066 module.exports = function() {
135067 return new Date().getTime() - loadTime;
135068 };
135069 loadTime = new Date().getTime();
135070 }
135071
135072}).call(this);
135073
135074//# sourceMappingURL=performance-now.js.map
135075
135076
135077/***/ }),
135078/* 849 */
135079/***/ (function(module, exports, __webpack_require__) {
135080
135081"use strict";
135082
135083module.exports = (url, opts) => {
135084 if (typeof url !== 'string') {
135085 throw new TypeError(`Expected \`url\` to be of type \`string\`, got \`${typeof url}\``);
135086 }
135087
135088 url = url.trim();
135089 opts = Object.assign({https: false}, opts);
135090
135091 if (/^\.*\/|^(?!localhost)\w+:/.test(url)) {
135092 return url;
135093 }
135094
135095 return url.replace(/^(?!(?:\w+:)?\/\/)/, opts.https ? 'https://' : 'http://');
135096};
135097
135098
135099/***/ }),
135100/* 850 */
135101/***/ (function(module, exports, __webpack_require__) {
135102
135103"use strict";
135104/*!
135105 * preserve <https://github.com/jonschlinkert/preserve>
135106 *
135107 * Copyright (c) 2014-2015, Jon Schlinkert.
135108 * Licensed under the MIT license.
135109 */
135110
135111
135112
135113/**
135114 * Replace tokens in `str` with a temporary, heuristic placeholder.
135115 *
135116 * ```js
135117 * tokens.before('{a\\,b}');
135118 * //=> '{__ID1__}'
135119 * ```
135120 *
135121 * @param {String} `str`
135122 * @return {String} String with placeholders.
135123 * @api public
135124 */
135125
135126exports.before = function before(str, re) {
135127 return str.replace(re, function (match) {
135128 var id = randomize();
135129 cache[id] = match;
135130 return '__ID' + id + '__';
135131 });
135132};
135133
135134/**
135135 * Replace placeholders in `str` with original tokens.
135136 *
135137 * ```js
135138 * tokens.after('{__ID1__}');
135139 * //=> '{a\\,b}'
135140 * ```
135141 *
135142 * @param {String} `str` String with placeholders
135143 * @return {String} `str` String with original tokens.
135144 * @api public
135145 */
135146
135147exports.after = function after(str) {
135148 return str.replace(/__ID(.{5})__/g, function (_, id) {
135149 return cache[id];
135150 });
135151};
135152
135153function randomize() {
135154 return Math.random().toString().slice(2, 7);
135155}
135156
135157var cache = {};
135158
135159/***/ }),
135160/* 851 */
135161/***/ (function(module, exports, __webpack_require__) {
135162
135163"use strict";
135164
135165
135166function makeSync(fs, name) {
135167 const fn = fs[`${name}Sync`];
135168
135169 return function () {
135170 const callback = arguments[arguments.length - 1];
135171 const args = Array.prototype.slice.call(arguments, 0, -1);
135172 let ret;
135173
135174 try {
135175 ret = fn.apply(fs, args);
135176 } catch (err) {
135177 return callback(err);
135178 }
135179
135180 callback(null, ret);
135181 };
135182}
135183
135184function syncFs(fs) {
135185 const fns = ['mkdir', 'realpath', 'stat', 'rmdir', 'utimes'];
135186 const obj = {};
135187
135188 // Create the sync versions of the methods that we need
135189 fns.forEach((name) => {
135190 obj[name] = makeSync(fs, name);
135191 });
135192
135193 // Copy the rest of the functions
135194 for (const key in fs) {
135195 if (!obj[key]) {
135196 obj[key] = fs[key];
135197 }
135198 }
135199
135200 return obj;
135201}
135202
135203module.exports = syncFs;
135204
135205
135206/***/ }),
135207/* 852 */
135208/***/ (function(module, exports, __webpack_require__) {
135209
135210"use strict";
135211
135212
135213Object.defineProperty(exports, '__esModule', { value: true });
135214
135215/**
135216 * Key a method on your object with this symbol and you can get special
135217 * formatting for that value! See ShellStringText, ShellStringUnquoted, or
135218 * shellStringSemicolon for examples.
135219 * @ignore
135220 */
135221const formatSymbol = Symbol('format');
135222/**
135223 * This symbol is for implementing advanced behaviors like the need for extra
135224 * carets in Windows shell strings that use pipes. If present, it's called in
135225 * an earlier phase than formatSymbol, and is passed a mutable context that can
135226 * be read during the format phase to influence formatting.
135227 * @ignore
135228 */
135229const preformatSymbol = Symbol('preformat');
135230
135231// When minimum Node version becomes 6, replace calls to sticky with /.../y and
135232// inline execFrom.
135233let stickySupported = true;
135234try {
135235 new RegExp('', 'y');
135236} catch (e) {
135237 stickySupported = false;
135238}
135239const sticky = stickySupported ? source => new RegExp(source, 'y') : source => new RegExp(`^(?:${source})`);
135240const execFrom = stickySupported ? (re, haystack, index) => (re.lastIndex = index, re.exec(haystack)) : (re, haystack, index) => re.exec(haystack.substr(index));
135241
135242function quoteForCmd(text, forceQuote) {
135243 let caretDepth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
135244 // See the below blog post for an explanation of this function and
135245 // quoteForWin32:
135246 // https://blogs.msdn.microsoft.com/twistylittlepassagesallalike/2011/04/23/everyone-quotes-command-line-arguments-the-wrong-way/
135247 if (!text.length) {
135248 return '""';
135249 }
135250 if (/[\n\r]/.test(text)) {
135251 throw new Error("Line breaks can't be quoted on Windows");
135252 }
135253 const caretEscape = /["%]/.test(text);
135254 text = quoteForWin32(text, forceQuote || !caretEscape && /[&()<>^|]/.test(text));
135255 if (caretEscape) {
135256 // See Win32Context for explanation of what caretDepth is for.
135257 do {
135258 text = text.replace(/[\t "%&()<>^|]/g, '^$&');
135259 } while (caretDepth--);
135260 }
135261 return text;
135262}
135263const quoteForWin32 = (text, forceQuote) => forceQuote || /[\t "]/.test(text) ? `"${text.replace(/\\+(?=$|")/g, '$&$&').replace(/"/g, '\\"')}"` : text;
135264const cmdMetaChars = /[\t\n\r "%&()<>^|]/;
135265class Win32Context {
135266 constructor() {
135267 this.currentScope = newScope(null);
135268 this.scopesByObject = new Map();
135269 }
135270 read(text) {
135271 // When cmd.exe pipes to or from a batch file, it spawns a second copy of
135272 // itself to run the inner command. This necessitates doubling up on carets
135273 // so that escaped characters survive both cmd.exe invocations. See:
135274 // https://stackoverflow.com/questions/8192318/why-does-delayed-expansion-fail-when-inside-a-piped-block-of-code#8194279
135275 // https://ss64.com/nt/syntax-redirection.html
135276 //
135277 // Parentheses can create an additional subshell, requiring additional
135278 // escaping... it's a mess.
135279 //
135280 // So here's what we do about it: we read all unquoted text in a shell
135281 // string and put it through this tiny parser that looks for pipes,
135282 // sequence operators (&, &&, ||), and parentheses. This can't be part of
135283 // the main Puka parsing, because it can be affected by `unquoted(...)`
135284 // values provided at evaluation time.
135285 //
135286 // Then, after associating each thing that needs to be quoted with a scope
135287 // (via `mark()`), we can determine the depth of caret escaping required
135288 // in each scope and pass it (via `Formatter::quote()`) to `quoteForCmd()`.
135289 //
135290 // See also `ShellStringText`, which holds the logic for the previous
135291 // paragraph.
135292 const length = text.length;
135293 for (let pos = 0, match; pos < length;) {
135294 if (match = execFrom(reUnimportant, text, pos)) {
135295 pos += match[0].length;
135296 }
135297 if (pos >= length) break;
135298 if (match = execFrom(reSeqOp, text, pos)) {
135299 this.seq();
135300 pos += match[0].length;
135301 } else {
135302 const char = text.charCodeAt(pos);
135303 if (char === CARET) {
135304 pos += 2;
135305 } else if (char === QUOTE) {
135306 // If you were foolish enough to leave a dangling quotation mark in
135307 // an unquoted span... you're likely to have bigger problems than
135308 // incorrect escaping. So we just do the simplest thing of looking for
135309 // the end quote only in this piece of text.
135310 pos += execFrom(reNotQuote, text, pos + 1)[0].length + 2;
135311 } else {
135312 if (char === OPEN_PAREN) {
135313 this.enterScope();
135314 } else if (char === CLOSE_PAREN) {
135315 this.exitScope();
135316 } else {
135317 // (char === '|')
135318 this.currentScope.depthDelta = 1;
135319 }
135320 pos++;
135321 }
135322 }
135323 }
135324 }
135325 enterScope() {
135326 this.currentScope = newScope(this.currentScope);
135327 }
135328 exitScope() {
135329 this.currentScope = this.currentScope.parent || (this.currentScope.parent = newScope(null));
135330 }
135331 seq() {
135332 // | binds tighter than sequence operators, so the latter create new sibling
135333 // scopes for future |s to mutate.
135334 this.currentScope = newScope(this.currentScope.parent);
135335 }
135336 mark(obj) {
135337 this.scopesByObject.set(obj, this.currentScope);
135338 }
135339 at(obj) {
135340 return { depth: getDepth(this.scopesByObject.get(obj)) };
135341 }
135342}
135343const getDepth = scope => scope === null ? 0 : scope.depth !== -1 ? scope.depth : scope.depth = getDepth(scope.parent) + scope.depthDelta;
135344const newScope = parent => ({ parent, depthDelta: 0, depth: -1 });
135345const CARET = '^'.charCodeAt();
135346const QUOTE = '"'.charCodeAt();
135347const OPEN_PAREN = '('.charCodeAt();
135348const CLOSE_PAREN = ')'.charCodeAt();
135349const reNotQuote = sticky('[^"]*');
135350const reSeqOp = sticky('&&?|\\|\\|');
135351const reUnimportant = sticky('(?:>&|[^"$&()^|])+');
135352
135353const quoteForSh = (text, forceQuote) => text.length ? forceQuote || shMetaChars.test(text) ? `'${text.replace(/'/g, "'\\''")}'`.replace(/^(?:'')+(?!$)/, '').replace(/\\'''/g, "\\'") : text : "''";
135354const shMetaChars = /[\t\n\r "#$&'()*;<>?\\`|~]/;
135355
135356/**
135357 * To get a Formatter, call `Formatter.for`.
135358 *
135359 * To create a new Formatter, pass an object to `Formatter.declare`.
135360 *
135361 * To set the global default Formatter, assign to `Formatter.default`.
135362 *
135363 * @class
135364 * @property {Formatter} default - The Formatter to be used when no platform
135365 * is provided—for example, when creating strings with `sh`.
135366 * @ignore
135367 */
135368function Formatter() {}
135369Object.assign(Formatter, /** @lends Formatter */{
135370 /**
135371 * Gets a Formatter that has been declared for the provided platform, or
135372 * the base `'sh'` formatter if there is no Formatter specific to this
135373 * platform, or the Formatter for the current platform if no specific platform
135374 * is provided.
135375 */
135376 for(platform) {
135377 return platform == null ? Formatter.default || (Formatter.default = Formatter.for(process.platform)) : Formatter._registry.get(platform) || Formatter._registry.get('sh');
135378 },
135379 /**
135380 * Creates a new Formatter or mutates the properties on an existing
135381 * Formatter. The `platform` key on the provided properties object determines
135382 * when the Formatter is retrieved.
135383 */
135384 declare(props) {
135385 const platform = props && props.platform || 'sh';
135386 const existingFormatter = Formatter._registry.get(platform);
135387 const formatter = Object.assign(existingFormatter || new Formatter(), props);
135388 formatter.emptyString === void 0 && (formatter.emptyString = formatter.quote('', true));
135389 existingFormatter || Formatter._registry.set(formatter.platform, formatter);
135390 },
135391 _registry: new Map(),
135392 prototype: {
135393 platform: 'sh',
135394 quote: quoteForSh,
135395 metaChars: shMetaChars,
135396 hasExtraMetaChars: false,
135397 statementSeparator: ';',
135398 createContext() {
135399 return defaultContext;
135400 }
135401 }
135402});
135403const defaultContext = {
135404 at() {}
135405};
135406Formatter.declare();
135407Formatter.declare({
135408 platform: 'win32',
135409 quote(text, forceQuote, opts) {
135410 return quoteForCmd(text, forceQuote, opts && opts.depth || 0);
135411 },
135412 metaChars: cmdMetaChars,
135413 hasExtraMetaChars: true,
135414 statementSeparator: '&',
135415 createContext(root) {
135416 const context = new this.Context();
135417 root[preformatSymbol](context);
135418 return context;
135419 },
135420 Context: Win32Context
135421});
135422
135423const isObject = any => any === Object(any);
135424function memoize(f) {
135425 const cache = new WeakMap();
135426 return arg => {
135427 let result = cache.get(arg);
135428 if (result === void 0) {
135429 result = f(arg);
135430 cache.set(arg, result);
135431 }
135432 return result;
135433 };
135434}
135435
135436/**
135437 * Represents a contiguous span of text that may or must be quoted. The contents
135438 * may already contain quoted segments, which will always be quoted. If unquoted
135439 * segments also require quoting, the entire span will be quoted together.
135440 * @ignore
135441 */
135442class ShellStringText {
135443 constructor(contents, untested) {
135444 this.contents = contents;
135445 this.untested = untested;
135446 }
135447 [formatSymbol](formatter, context) {
135448 const unformattedContents = this.contents;
135449 const length = unformattedContents.length;
135450 const contents = new Array(length);
135451 for (let i = 0; i < length; i++) {
135452 const c = unformattedContents[i];
135453 contents[i] = isObject(c) && formatSymbol in c ? c[formatSymbol](formatter) : c;
135454 }
135455 for (let unquoted = true, i = 0; i < length; i++) {
135456 const content = contents[i];
135457 if (content === null) {
135458 unquoted = !unquoted;
135459 } else {
135460 if (unquoted && (formatter.hasExtraMetaChars || this.untested && this.untested.has(i)) && formatter.metaChars.test(content)) {
135461 return formatter.quote(contents.join(''), false, context.at(this));
135462 }
135463 }
135464 }
135465 const parts = [];
135466 for (let quoted = null, i = 0; i < length; i++) {
135467 const content = contents[i];
135468 if (content === null) {
135469 quoted = quoted ? (parts.push(formatter.quote(quoted.join(''), true, context.at(this))), null) : [];
135470 } else {
135471 (quoted || parts).push(content);
135472 }
135473 }
135474 const result = parts.join('');
135475 return result.length ? result : formatter.emptyString;
135476 }
135477 [preformatSymbol](context) {
135478 context.mark(this);
135479 }
135480}
135481
135482/**
135483 * Represents a contiguous span of text that will not be quoted.
135484 * @ignore
135485 */
135486class ShellStringUnquoted {
135487 constructor(value) {
135488 this.value = value;
135489 }
135490 [formatSymbol]() {
135491 return this.value;
135492 }
135493 [preformatSymbol](context) {
135494 context.read(this.value);
135495 }
135496}
135497
135498/**
135499 * Represents a semicolon... or an ampersand, on Windows.
135500 * @ignore
135501 */
135502const shellStringSemicolon = {
135503 [formatSymbol](formatter) {
135504 return formatter.statementSeparator;
135505 },
135506 [preformatSymbol](context) {
135507 context.seq();
135508 }
135509};
135510
135511const PLACEHOLDER = {};
135512const parse = memoize(templateSpans => {
135513 // These are the token types our DSL can recognize. Their values won't escape
135514 // this function.
135515 const TOKEN_TEXT = 0;
135516 const TOKEN_QUOTE = 1;
135517 const TOKEN_SEMI = 2;
135518 const TOKEN_UNQUOTED = 3;
135519 const TOKEN_SPACE = 4;
135520 const TOKEN_REDIRECT = 5;
135521 const result = [];
135522 let placeholderCount = 0;
135523 let prefix = null;
135524 let onlyPrefixOnce = false;
135525 let contents = [];
135526 let quote = 0;
135527 const lastSpan = templateSpans.length - 1;
135528 for (let spanIndex = 0; spanIndex <= lastSpan; spanIndex++) {
135529 const templateSpan = templateSpans[spanIndex];
135530 const posEnd = templateSpan.length;
135531 let tokenStart = 0;
135532 if (spanIndex) {
135533 placeholderCount++;
135534 contents.push(PLACEHOLDER);
135535 }
135536 // For each span, we first do a recognizing pass in which we use regular
135537 // expressions to identify the positions of tokens in the text, and then
135538 // a second pass that actually splits the text into the minimum number of
135539 // substrings necessary.
135540 const recognized = []; // [type1, index1, type2, index2...]
135541 let firstWordBreak = -1;
135542 let lastWordBreak = -1;
135543 {
135544 let pos = 0,
135545 match;
135546 while (pos < posEnd) {
135547 if (quote) {
135548 if (match = execFrom(quote === CHAR_SQUO ? reQuotation1 : reQuotation2, templateSpan, pos)) {
135549 recognized.push(TOKEN_TEXT, pos);
135550 pos += match[0].length;
135551 }
135552 if (pos < posEnd) {
135553 recognized.push(TOKEN_QUOTE, pos++);
135554 quote = 0;
135555 }
135556 } else {
135557 if (match = execFrom(reText, templateSpan, pos)) {
135558 const setBreaks = match[1] != null;
135559 setBreaks && firstWordBreak < 0 && (firstWordBreak = pos);
135560 recognized.push(setBreaks ? TOKEN_UNQUOTED : TOKEN_TEXT, pos);
135561 pos += match[0].length;
135562 setBreaks && (lastWordBreak = pos);
135563 }
135564 if (match = execFrom(reRedirectOrSpace, templateSpan, pos)) {
135565 firstWordBreak < 0 && (firstWordBreak = pos);
135566 lastWordBreak = pos;
135567 recognized.push(match[1] ? TOKEN_REDIRECT : TOKEN_SPACE, pos);
135568 pos += match[0].length;
135569 }
135570 const char = templateSpan.charCodeAt(pos);
135571 if (char === CHAR_SEMI) {
135572 firstWordBreak < 0 && (firstWordBreak = pos);
135573 recognized.push(TOKEN_SEMI, pos++);
135574 lastWordBreak = pos;
135575 } else if (char === CHAR_SQUO || char === CHAR_DQUO) {
135576 recognized.push(TOKEN_QUOTE, pos++);
135577 quote = char;
135578 }
135579 }
135580 }
135581 }
135582 // Word breaks are only important if they separate words with placeholders,
135583 // so we can ignore the first/last break if this is the first/last span.
135584 spanIndex === 0 && (firstWordBreak = -1);
135585 spanIndex === lastSpan && (lastWordBreak = posEnd);
135586 // Here begins the second pass mentioned above. This loop runs one more
135587 // iteration than there are tokens in recognized, because it handles tokens
135588 // on a one-iteration delay; hence the i <= iEnd instead of i < iEnd.
135589 const iEnd = recognized.length;
135590 for (let i = 0, type = -1; i <= iEnd; i += 2) {
135591 let typeNext = -1,
135592 pos;
135593 if (i === iEnd) {
135594 pos = posEnd;
135595 } else {
135596 typeNext = recognized[i];
135597 pos = recognized[i + 1];
135598 // If the next token is space or redirect, but there's another word
135599 // break in this span, then we can handle that token the same way we
135600 // would handle unquoted text because it isn't being attached to a
135601 // placeholder.
135602 typeNext >= TOKEN_SPACE && pos !== lastWordBreak && (typeNext = TOKEN_UNQUOTED);
135603 }
135604 const breakHere = pos === firstWordBreak || pos === lastWordBreak;
135605 if (pos && (breakHere || typeNext !== type)) {
135606 let value = type === TOKEN_QUOTE ? null : type === TOKEN_SEMI ? shellStringSemicolon : templateSpan.substring(tokenStart, pos);
135607 if (type >= TOKEN_SEMI) {
135608 // This branch handles semicolons, unquoted text, spaces, and
135609 // redirects. shellStringSemicolon is already a formatSymbol object;
135610 // the rest need to be wrapped.
135611 type === TOKEN_SEMI || (value = new ShellStringUnquoted(value));
135612 // We don't need to check placeholderCount here like we do below;
135613 // that's only relevant during the first word break of the span, and
135614 // because this iteration of the loop is processing the token that
135615 // was checked for breaks in the previous iteration, it will have
135616 // already been handled. For the same reason, prefix is guaranteed to
135617 // be null.
135618 if (contents.length) {
135619 result.push(new ShellStringText(contents, null));
135620 contents = [];
135621 }
135622 // Only spaces and redirects become prefixes, but not if they've been
135623 // rewritten to unquoted above.
135624 if (type >= TOKEN_SPACE) {
135625 prefix = value;
135626 onlyPrefixOnce = type === TOKEN_SPACE;
135627 } else {
135628 result.push(value);
135629 }
135630 } else {
135631 contents.push(value);
135632 }
135633 tokenStart = pos;
135634 }
135635 if (breakHere) {
135636 if (placeholderCount) {
135637 result.push({ contents, placeholderCount, prefix, onlyPrefixOnce });
135638 } else {
135639 // There's no prefix to handle in this branch; a prefix prior to this
135640 // span would mean placeholderCount > 0, and a prefix in this span
135641 // can't be created because spaces and redirects get rewritten to
135642 // unquoted before the last word break.
135643 contents.length && result.push(new ShellStringText(contents, null));
135644 }
135645 placeholderCount = 0;prefix = null;onlyPrefixOnce = false;
135646 contents = [];
135647 }
135648 type = typeNext;
135649 }
135650 }
135651 if (quote) {
135652 throw new SyntaxError(`String is missing a ${String.fromCharCode(quote)} character`);
135653 }
135654 return result;
135655});
135656const CHAR_SEMI = ';'.charCodeAt();
135657const CHAR_SQUO = "'".charCodeAt();
135658const CHAR_DQUO = '"'.charCodeAt();
135659const reQuotation1 = sticky("[^']+");
135660const reQuotation2 = sticky('[^"]+');
135661const reText = sticky('[^\\s"#$&\'();<>\\\\`|]+|([#$&()\\\\`|]+)');
135662const reRedirectOrSpace = sticky('((?:\\s+\\d+|\\s*)[<>]+\\s*)|\\s+');
135663
135664class BitSet {
135665 constructor() {
135666 this.vector = new Int32Array(1);
135667 }
135668 has(n) {
135669 return (this.vector[n >>> 5] & 1 << n) !== 0;
135670 }
135671 add(n) {
135672 const i = n >>> 5,
135673 requiredLength = i + 1;
135674 let vector = this.vector;var _vector = vector;
135675 let length = _vector.length;
135676 if (requiredLength > length) {
135677 while (requiredLength > (length *= 2));
135678 const oldValues = vector;
135679 vector = new Int32Array(length);
135680 vector.set(oldValues);
135681 this.vector = vector;
135682 }
135683 vector[i] |= 1 << n;
135684 }
135685}
135686
135687function evaluate(template, values) {
135688 values = values.map(toStringishArray);
135689 const children = [];
135690 let valuesStart = 0;
135691 for (let i = 0, iMax = template.length; i < iMax; i++) {
135692 const word = template[i];
135693 if (formatSymbol in word) {
135694 children.push(word);
135695 continue;
135696 }
135697 const contents = word.contents,
135698 placeholderCount = word.placeholderCount,
135699 prefix = word.prefix,
135700 onlyPrefixOnce = word.onlyPrefixOnce;
135701 const kMax = contents.length;
135702 const valuesEnd = valuesStart + placeholderCount;
135703 const tuples = cartesianProduct(values, valuesStart, valuesEnd);
135704 valuesStart = valuesEnd;
135705 for (let j = 0, jMax = tuples.length; j < jMax; j++) {
135706 const needSpace = j > 0;
135707 const tuple = tuples[j];
135708 (needSpace || prefix) && children.push(needSpace && (onlyPrefixOnce || !prefix) ? unquotedSpace : prefix);
135709 let interpolatedContents = [];
135710 let untested = null;
135711 let quoting = false;
135712 let tupleIndex = 0;
135713 for (let k = 0; k < kMax; k++) {
135714 const content = contents[k];
135715 if (content === PLACEHOLDER) {
135716 const value = tuple[tupleIndex++];
135717 if (quoting) {
135718 interpolatedContents.push(value);
135719 } else {
135720 if (isObject(value) && formatSymbol in value) {
135721 if (interpolatedContents.length) {
135722 children.push(new ShellStringText(interpolatedContents, untested));
135723 interpolatedContents = [];
135724 untested = null;
135725 }
135726 children.push(value);
135727 } else {
135728 (untested || (untested = new BitSet())).add(interpolatedContents.length);
135729 interpolatedContents.push(value);
135730 }
135731 }
135732 } else {
135733 interpolatedContents.push(content);
135734 content === null && (quoting = !quoting);
135735 }
135736 }
135737 if (interpolatedContents.length) {
135738 children.push(new ShellStringText(interpolatedContents, untested));
135739 }
135740 }
135741 }
135742 return children;
135743}
135744const primToStringish = value => value == null ? '' + value : value;
135745function toStringishArray(value) {
135746 let array;
135747 switch (true) {
135748 default:
135749 if (isObject(value)) {
135750 if (Array.isArray(value)) {
135751 array = value;break;
135752 }
135753 if (Symbol.iterator in value) {
135754 array = Array.from(value);break;
135755 }
135756 }
135757 array = [value];
135758 }
135759 return array.map(primToStringish);
135760}
135761function cartesianProduct(arrs, start, end) {
135762 const size = end - start;
135763 let resultLength = 1;
135764 for (let i = start; i < end; i++) {
135765 resultLength *= arrs[i].length;
135766 }
135767 if (resultLength > 1e6) {
135768 throw new RangeError("Far too many elements to interpolate");
135769 }
135770 const result = new Array(resultLength);
135771 const indices = new Array(size).fill(0);
135772 for (let i = 0; i < resultLength; i++) {
135773 const value = result[i] = new Array(size);
135774 for (let j = 0; j < size; j++) {
135775 value[j] = arrs[j + start][indices[j]];
135776 }
135777 for (let j = size - 1; j >= 0; j--) {
135778 if (++indices[j] < arrs[j + start].length) break;
135779 indices[j] = 0;
135780 }
135781 }
135782 return result;
135783}
135784const unquotedSpace = new ShellStringUnquoted(' ');
135785
135786/**
135787 * A ShellString represents a shell command after it has been interpolated, but
135788 * before it has been formatted for a particular platform. ShellStrings are
135789 * useful if you want to prepare a command for a different platform than the
135790 * current one, for instance.
135791 *
135792 * To create a ShellString, use `ShellString.sh` the same way you would use
135793 * top-level `sh`.
135794 */
135795class ShellString {
135796 /** @hideconstructor */
135797 constructor(children) {
135798 this.children = children;
135799 }
135800 /**
135801 * `ShellString.sh` is a template tag just like `sh`; the only difference is
135802 * that this function returns a ShellString which has not yet been formatted
135803 * into a String.
135804 * @returns {ShellString}
135805 * @function sh
135806 * @static
135807 * @memberof ShellString
135808 */
135809 static sh(templateSpans) {
135810 for (var _len = arguments.length, values = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
135811 values[_key - 1] = arguments[_key];
135812 }
135813 return new ShellString(evaluate(parse(templateSpans), values));
135814 }
135815 /**
135816 * A method to format a ShellString into a regular String formatted for a
135817 * particular platform.
135818 *
135819 * @param {String} [platform] a value that `process.platform` might take:
135820 * `'win32'`, `'linux'`, etc.; determines how the string is to be formatted.
135821 * When omitted, effectively the same as `process.platform`.
135822 * @returns {String}
135823 */
135824 toString(platform) {
135825 return this[formatSymbol](Formatter.for(platform));
135826 }
135827 [formatSymbol](formatter) {
135828 let context = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : formatter.createContext(this);
135829 return this.children.map(child => child[formatSymbol](formatter, context)).join('');
135830 }
135831 [preformatSymbol](context) {
135832 const children = this.children;
135833 for (let i = 0, iMax = children.length; i < iMax; i++) {
135834 const child = children[i];
135835 if (preformatSymbol in child) {
135836 child[preformatSymbol](context);
135837 }
135838 }
135839 }
135840}
135841
135842/**
135843 * A Windows-specific version of {@link quoteForShell}.
135844 * @param {String} text to be quoted
135845 * @param {Boolean} [forceQuote] whether to always add quotes even if the string
135846 * is already safe. Defaults to `false`.
135847 */
135848
135849/**
135850 * A Unix-specific version of {@link quoteForShell}.
135851 * @param {String} text to be quoted
135852 * @param {Boolean} [forceQuote] whether to always add quotes even if the string
135853 * is already safe. Defaults to `false`.
135854 */
135855
135856/**
135857 * Quotes a string for injecting into a shell command.
135858 *
135859 * This function is exposed for some hypothetical case when the `sh` DSL simply
135860 * won't do; `sh` is expected to be the more convenient option almost always.
135861 * Compare:
135862 *
135863 * ```javascript
135864 * console.log('cmd' + args.map(a => ' ' + quoteForShell(a)).join(''));
135865 * console.log(sh`cmd ${args}`); // same as above
135866 *
135867 * console.log('cmd' + args.map(a => ' ' + quoteForShell(a, true)).join(''));
135868 * console.log(sh`cmd "${args}"`); // same as above
135869 * ```
135870 *
135871 * Additionally, on Windows, `sh` checks the entire command string for pipes,
135872 * which subtly change how arguments need to be quoted. If your commands may
135873 * involve pipes, you are strongly encouraged to use `sh` and not try to roll
135874 * your own with `quoteForShell`.
135875 *
135876 * @param {String} text to be quoted
135877 * @param {Boolean} [forceQuote] whether to always add quotes even if the string
135878 * is already safe. Defaults to `false`.
135879 * @param {String} [platform] a value that `process.platform` might take:
135880 * `'win32'`, `'linux'`, etc.; determines how the string is to be formatted.
135881 * When omitted, effectively the same as `process.platform`.
135882 *
135883 * @returns {String} a string that is safe for the current (or specified)
135884 * platform.
135885 */
135886function quoteForShell(text, forceQuote, platform) {
135887 return Formatter.for(platform).quote(text, forceQuote);
135888}
135889
135890/**
135891 * A string template tag for safely constructing cross-platform shell commands.
135892 *
135893 * An `sh` template is not actually treated as a literal string to be
135894 * interpolated; instead, it is a tiny DSL designed to make working with shell
135895 * strings safe, simple, and straightforward. To get started quickly, see the
135896 * examples below. {@link #the-sh-dsl More detailed documentation} is available
135897 * further down.
135898 *
135899 * @name sh
135900 * @example
135901 * const title = '"this" & "that"';
135902 * sh`script --title=${title}`; // => "script '--title=\"this\" & \"that\"'"
135903 * // Note: these examples show results for non-Windows platforms.
135904 * // On Windows, the above would instead be
135905 * // 'script ^"--title=\\^"this\\^" ^& \\^"that\\^"^"'.
135906 *
135907 * const names = ['file1', 'file 2'];
135908 * sh`rimraf ${names}.txt`; // => "rimraf file1.txt 'file 2.txt'"
135909 *
135910 * const cmd1 = ['cat', 'file 1.txt', 'file 2.txt'];
135911 * const cmd2 = ['use-input', '-abc'];
135912 * sh`${cmd1}|${cmd2}`; // => "cat 'file 1.txt' 'file 2.txt'|use-input -abc"
135913 *
135914 * @returns {String} - a string formatted for the platform Node is currently
135915 * running on.
135916 */
135917const sh = function () {
135918 return ShellString.sh.apply(ShellString, arguments).toString();
135919};
135920
135921/**
135922 * This function permits raw strings to be interpolated into a `sh` template.
135923 *
135924 * **IMPORTANT**: If you're using Puka due to security concerns, make sure you
135925 * don't pass any untrusted content to `unquoted`. This may be obvious, but
135926 * stray punctuation in an `unquoted` section can compromise the safety of the
135927 * entire shell command.
135928 *
135929 * @param value - any value (it will be treated as a string)
135930 *
135931 * @example
135932 * const both = true;
135933 * sh`foo ${unquoted(both ? '&&' : '||')} bar`; // => 'foo && bar'
135934 */
135935const unquoted = value => new ShellStringUnquoted(value);
135936
135937exports.Formatter = Formatter;
135938exports.ShellString = ShellString;
135939exports.ShellStringText = ShellStringText;
135940exports.ShellStringUnquoted = ShellStringUnquoted;
135941exports.quoteForCmd = quoteForCmd;
135942exports.quoteForSh = quoteForSh;
135943exports.quoteForShell = quoteForShell;
135944exports.sh = sh;
135945exports.shellStringSemicolon = shellStringSemicolon;
135946exports.formatSymbol = formatSymbol;
135947exports.preformatSymbol = preformatSymbol;
135948exports.unquoted = unquoted;
135949
135950
135951/***/ }),
135952/* 853 */
135953/***/ (function(module, exports, __webpack_require__) {
135954
135955var once = __webpack_require__(133)
135956var eos = __webpack_require__(164)
135957var fs = __webpack_require__(12) // we only need fs to get the ReadStream and WriteStream prototypes
135958
135959var noop = function () {}
135960
135961var isFn = function (fn) {
135962 return typeof fn === 'function'
135963}
135964
135965var isFS = function (stream) {
135966 if (!fs) return false // browser
135967 return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
135968}
135969
135970var isRequest = function (stream) {
135971 return stream.setHeader && isFn(stream.abort)
135972}
135973
135974var destroyer = function (stream, reading, writing, callback) {
135975 callback = once(callback)
135976
135977 var closed = false
135978 stream.on('close', function () {
135979 closed = true
135980 })
135981
135982 eos(stream, {readable: reading, writable: writing}, function (err) {
135983 if (err) return callback(err)
135984 closed = true
135985 callback()
135986 })
135987
135988 var destroyed = false
135989 return function (err) {
135990 if (closed) return
135991 if (destroyed) return
135992 destroyed = true
135993
135994 if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
135995 if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
135996
135997 if (isFn(stream.destroy)) return stream.destroy()
135998
135999 callback(err || new Error('stream was destroyed'))
136000 }
136001}
136002
136003var call = function (fn) {
136004 fn()
136005}
136006
136007var pipe = function (from, to) {
136008 return from.pipe(to)
136009}
136010
136011var pump = function () {
136012 var streams = Array.prototype.slice.call(arguments)
136013 var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
136014
136015 if (Array.isArray(streams[0])) streams = streams[0]
136016 if (streams.length < 2) throw new Error('pump requires two streams per minimum')
136017
136018 var error
136019 var destroys = streams.map(function (stream, i) {
136020 var reading = i < streams.length - 1
136021 var writing = i > 0
136022 return destroyer(stream, reading, writing, function (err) {
136023 if (!error) error = err
136024 if (err) destroys.forEach(call)
136025 if (reading) return
136026 destroys.forEach(call)
136027 callback(error)
136028 })
136029 })
136030
136031 return streams.reduce(pipe)
136032}
136033
136034module.exports = pump
136035
136036
136037/***/ }),
136038/* 854 */
136039/***/ (function(module, exports, __webpack_require__) {
136040
136041var pump = __webpack_require__(855)
136042var inherits = __webpack_require__(78)
136043var Duplexify = __webpack_require__(349)
136044
136045var toArray = function(args) {
136046 if (!args.length) return []
136047 return Array.isArray(args[0]) ? args[0] : Array.prototype.slice.call(args)
136048}
136049
136050var define = function(opts) {
136051 var Pumpify = function() {
136052 var streams = toArray(arguments)
136053 if (!(this instanceof Pumpify)) return new Pumpify(streams)
136054 Duplexify.call(this, null, null, opts)
136055 if (streams.length) this.setPipeline(streams)
136056 }
136057
136058 inherits(Pumpify, Duplexify)
136059
136060 Pumpify.prototype.setPipeline = function() {
136061 var streams = toArray(arguments)
136062 var self = this
136063 var ended = false
136064 var w = streams[0]
136065 var r = streams[streams.length-1]
136066
136067 r = r.readable ? r : null
136068 w = w.writable ? w : null
136069
136070 var onclose = function() {
136071 streams[0].emit('error', new Error('stream was destroyed'))
136072 }
136073
136074 this.on('close', onclose)
136075 this.on('prefinish', function() {
136076 if (!ended) self.cork()
136077 })
136078
136079 pump(streams, function(err) {
136080 self.removeListener('close', onclose)
136081 if (err) return self.destroy(err.message === 'premature close' ? null : err)
136082 ended = true
136083 // pump ends after the last stream is not writable *but*
136084 // pumpify still forwards the readable part so we need to catch errors
136085 // still, so reenable autoDestroy in this case
136086 if (self._autoDestroy === false) self._autoDestroy = true
136087 self.uncork()
136088 })
136089
136090 if (this.destroyed) return onclose()
136091 this.setWritable(w)
136092 this.setReadable(r)
136093 }
136094
136095 return Pumpify
136096}
136097
136098module.exports = define({autoDestroy:false, destroy:false})
136099module.exports.obj = define({autoDestroy: false, destroy:false, objectMode:true, highWaterMark:16})
136100module.exports.ctor = define
136101
136102
136103/***/ }),
136104/* 855 */
136105/***/ (function(module, exports, __webpack_require__) {
136106
136107var once = __webpack_require__(133)
136108var eos = __webpack_require__(164)
136109var fs = __webpack_require__(12) // we only need fs to get the ReadStream and WriteStream prototypes
136110
136111var noop = function () {}
136112var ancient = /^v?\.0/.test(process.version)
136113
136114var isFn = function (fn) {
136115 return typeof fn === 'function'
136116}
136117
136118var isFS = function (stream) {
136119 if (!ancient) return false // newer node version do not need to care about fs is a special way
136120 if (!fs) return false // browser
136121 return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
136122}
136123
136124var isRequest = function (stream) {
136125 return stream.setHeader && isFn(stream.abort)
136126}
136127
136128var destroyer = function (stream, reading, writing, callback) {
136129 callback = once(callback)
136130
136131 var closed = false
136132 stream.on('close', function () {
136133 closed = true
136134 })
136135
136136 eos(stream, {readable: reading, writable: writing}, function (err) {
136137 if (err) return callback(err)
136138 closed = true
136139 callback()
136140 })
136141
136142 var destroyed = false
136143 return function (err) {
136144 if (closed) return
136145 if (destroyed) return
136146 destroyed = true
136147
136148 if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
136149 if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
136150
136151 if (isFn(stream.destroy)) return stream.destroy()
136152
136153 callback(err || new Error('stream was destroyed'))
136154 }
136155}
136156
136157var call = function (fn) {
136158 fn()
136159}
136160
136161var pipe = function (from, to) {
136162 return from.pipe(to)
136163}
136164
136165var pump = function () {
136166 var streams = Array.prototype.slice.call(arguments)
136167 var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
136168
136169 if (Array.isArray(streams[0])) streams = streams[0]
136170 if (streams.length < 2) throw new Error('pump requires two streams per minimum')
136171
136172 var error
136173 var destroys = streams.map(function (stream, i) {
136174 var reading = i < streams.length - 1
136175 var writing = i > 0
136176 return destroyer(stream, reading, writing, function (err) {
136177 if (!error) error = err
136178 if (err) destroys.forEach(call)
136179 if (reading) return
136180 destroys.forEach(call)
136181 callback(error)
136182 })
136183 })
136184
136185 streams.reduce(pipe)
136186}
136187
136188module.exports = pump
136189
136190
136191/***/ }),
136192/* 856 */
136193/***/ (function(module, exports, __webpack_require__) {
136194
136195"use strict";
136196
136197
136198var utils = __webpack_require__(375);
136199
136200var has = Object.prototype.hasOwnProperty;
136201
136202var defaults = {
136203 allowDots: false,
136204 allowPrototypes: false,
136205 arrayLimit: 20,
136206 decoder: utils.decode,
136207 delimiter: '&',
136208 depth: 5,
136209 parameterLimit: 1000,
136210 plainObjects: false,
136211 strictNullHandling: false
136212};
136213
136214var parseValues = function parseQueryStringValues(str, options) {
136215 var obj = {};
136216 var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
136217 var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
136218 var parts = cleanStr.split(options.delimiter, limit);
136219
136220 for (var i = 0; i < parts.length; ++i) {
136221 var part = parts[i];
136222
136223 var bracketEqualsPos = part.indexOf(']=');
136224 var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
136225
136226 var key, val;
136227 if (pos === -1) {
136228 key = options.decoder(part, defaults.decoder);
136229 val = options.strictNullHandling ? null : '';
136230 } else {
136231 key = options.decoder(part.slice(0, pos), defaults.decoder);
136232 val = options.decoder(part.slice(pos + 1), defaults.decoder);
136233 }
136234 if (has.call(obj, key)) {
136235 obj[key] = [].concat(obj[key]).concat(val);
136236 } else {
136237 obj[key] = val;
136238 }
136239 }
136240
136241 return obj;
136242};
136243
136244var parseObject = function (chain, val, options) {
136245 var leaf = val;
136246
136247 for (var i = chain.length - 1; i >= 0; --i) {
136248 var obj;
136249 var root = chain[i];
136250
136251 if (root === '[]') {
136252 obj = [];
136253 obj = obj.concat(leaf);
136254 } else {
136255 obj = options.plainObjects ? Object.create(null) : {};
136256 var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
136257 var index = parseInt(cleanRoot, 10);
136258 if (
136259 !isNaN(index)
136260 && root !== cleanRoot
136261 && String(index) === cleanRoot
136262 && index >= 0
136263 && (options.parseArrays && index <= options.arrayLimit)
136264 ) {
136265 obj = [];
136266 obj[index] = leaf;
136267 } else {
136268 obj[cleanRoot] = leaf;
136269 }
136270 }
136271
136272 leaf = obj;
136273 }
136274
136275 return leaf;
136276};
136277
136278var parseKeys = function parseQueryStringKeys(givenKey, val, options) {
136279 if (!givenKey) {
136280 return;
136281 }
136282
136283 // Transform dot notation to bracket notation
136284 var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
136285
136286 // The regex chunks
136287
136288 var brackets = /(\[[^[\]]*])/;
136289 var child = /(\[[^[\]]*])/g;
136290
136291 // Get the parent
136292
136293 var segment = brackets.exec(key);
136294 var parent = segment ? key.slice(0, segment.index) : key;
136295
136296 // Stash the parent if it exists
136297
136298 var keys = [];
136299 if (parent) {
136300 // If we aren't using plain objects, optionally prefix keys
136301 // that would overwrite object prototype properties
136302 if (!options.plainObjects && has.call(Object.prototype, parent)) {
136303 if (!options.allowPrototypes) {
136304 return;
136305 }
136306 }
136307
136308 keys.push(parent);
136309 }
136310
136311 // Loop through children appending to the array until we hit depth
136312
136313 var i = 0;
136314 while ((segment = child.exec(key)) !== null && i < options.depth) {
136315 i += 1;
136316 if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
136317 if (!options.allowPrototypes) {
136318 return;
136319 }
136320 }
136321 keys.push(segment[1]);
136322 }
136323
136324 // If there's a remainder, just add whatever is left
136325
136326 if (segment) {
136327 keys.push('[' + key.slice(segment.index) + ']');
136328 }
136329
136330 return parseObject(keys, val, options);
136331};
136332
136333module.exports = function (str, opts) {
136334 var options = opts ? utils.assign({}, opts) : {};
136335
136336 if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') {
136337 throw new TypeError('Decoder has to be a function.');
136338 }
136339
136340 options.ignoreQueryPrefix = options.ignoreQueryPrefix === true;
136341 options.delimiter = typeof options.delimiter === 'string' || utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter;
136342 options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth;
136343 options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit;
136344 options.parseArrays = options.parseArrays !== false;
136345 options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder;
136346 options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots;
136347 options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects;
136348 options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes;
136349 options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit;
136350 options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
136351
136352 if (str === '' || str === null || typeof str === 'undefined') {
136353 return options.plainObjects ? Object.create(null) : {};
136354 }
136355
136356 var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
136357 var obj = options.plainObjects ? Object.create(null) : {};
136358
136359 // Iterate over the keys and setup the new object
136360
136361 var keys = Object.keys(tempObj);
136362 for (var i = 0; i < keys.length; ++i) {
136363 var key = keys[i];
136364 var newObj = parseKeys(key, tempObj[key], options);
136365 obj = utils.merge(obj, newObj, options);
136366 }
136367
136368 return utils.compact(obj);
136369};
136370
136371
136372/***/ }),
136373/* 857 */
136374/***/ (function(module, exports, __webpack_require__) {
136375
136376"use strict";
136377
136378
136379var utils = __webpack_require__(375);
136380var formats = __webpack_require__(373);
136381
136382var arrayPrefixGenerators = {
136383 brackets: function brackets(prefix) { // eslint-disable-line func-name-matching
136384 return prefix + '[]';
136385 },
136386 indices: function indices(prefix, key) { // eslint-disable-line func-name-matching
136387 return prefix + '[' + key + ']';
136388 },
136389 repeat: function repeat(prefix) { // eslint-disable-line func-name-matching
136390 return prefix;
136391 }
136392};
136393
136394var toISO = Date.prototype.toISOString;
136395
136396var defaults = {
136397 delimiter: '&',
136398 encode: true,
136399 encoder: utils.encode,
136400 encodeValuesOnly: false,
136401 serializeDate: function serializeDate(date) { // eslint-disable-line func-name-matching
136402 return toISO.call(date);
136403 },
136404 skipNulls: false,
136405 strictNullHandling: false
136406};
136407
136408var stringify = function stringify( // eslint-disable-line func-name-matching
136409 object,
136410 prefix,
136411 generateArrayPrefix,
136412 strictNullHandling,
136413 skipNulls,
136414 encoder,
136415 filter,
136416 sort,
136417 allowDots,
136418 serializeDate,
136419 formatter,
136420 encodeValuesOnly
136421) {
136422 var obj = object;
136423 if (typeof filter === 'function') {
136424 obj = filter(prefix, obj);
136425 } else if (obj instanceof Date) {
136426 obj = serializeDate(obj);
136427 } else if (obj === null) {
136428 if (strictNullHandling) {
136429 return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder) : prefix;
136430 }
136431
136432 obj = '';
136433 }
136434
136435 if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || utils.isBuffer(obj)) {
136436 if (encoder) {
136437 var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder);
136438 return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder))];
136439 }
136440 return [formatter(prefix) + '=' + formatter(String(obj))];
136441 }
136442
136443 var values = [];
136444
136445 if (typeof obj === 'undefined') {
136446 return values;
136447 }
136448
136449 var objKeys;
136450 if (Array.isArray(filter)) {
136451 objKeys = filter;
136452 } else {
136453 var keys = Object.keys(obj);
136454 objKeys = sort ? keys.sort(sort) : keys;
136455 }
136456
136457 for (var i = 0; i < objKeys.length; ++i) {
136458 var key = objKeys[i];
136459
136460 if (skipNulls && obj[key] === null) {
136461 continue;
136462 }
136463
136464 if (Array.isArray(obj)) {
136465 values = values.concat(stringify(
136466 obj[key],
136467 generateArrayPrefix(prefix, key),
136468 generateArrayPrefix,
136469 strictNullHandling,
136470 skipNulls,
136471 encoder,
136472 filter,
136473 sort,
136474 allowDots,
136475 serializeDate,
136476 formatter,
136477 encodeValuesOnly
136478 ));
136479 } else {
136480 values = values.concat(stringify(
136481 obj[key],
136482 prefix + (allowDots ? '.' + key : '[' + key + ']'),
136483 generateArrayPrefix,
136484 strictNullHandling,
136485 skipNulls,
136486 encoder,
136487 filter,
136488 sort,
136489 allowDots,
136490 serializeDate,
136491 formatter,
136492 encodeValuesOnly
136493 ));
136494 }
136495 }
136496
136497 return values;
136498};
136499
136500module.exports = function (object, opts) {
136501 var obj = object;
136502 var options = opts ? utils.assign({}, opts) : {};
136503
136504 if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') {
136505 throw new TypeError('Encoder has to be a function.');
136506 }
136507
136508 var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter;
136509 var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling;
136510 var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls;
136511 var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode;
136512 var encoder = typeof options.encoder === 'function' ? options.encoder : defaults.encoder;
136513 var sort = typeof options.sort === 'function' ? options.sort : null;
136514 var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots;
136515 var serializeDate = typeof options.serializeDate === 'function' ? options.serializeDate : defaults.serializeDate;
136516 var encodeValuesOnly = typeof options.encodeValuesOnly === 'boolean' ? options.encodeValuesOnly : defaults.encodeValuesOnly;
136517 if (typeof options.format === 'undefined') {
136518 options.format = formats['default'];
136519 } else if (!Object.prototype.hasOwnProperty.call(formats.formatters, options.format)) {
136520 throw new TypeError('Unknown format option provided.');
136521 }
136522 var formatter = formats.formatters[options.format];
136523 var objKeys;
136524 var filter;
136525
136526 if (typeof options.filter === 'function') {
136527 filter = options.filter;
136528 obj = filter('', obj);
136529 } else if (Array.isArray(options.filter)) {
136530 filter = options.filter;
136531 objKeys = filter;
136532 }
136533
136534 var keys = [];
136535
136536 if (typeof obj !== 'object' || obj === null) {
136537 return '';
136538 }
136539
136540 var arrayFormat;
136541 if (options.arrayFormat in arrayPrefixGenerators) {
136542 arrayFormat = options.arrayFormat;
136543 } else if ('indices' in options) {
136544 arrayFormat = options.indices ? 'indices' : 'repeat';
136545 } else {
136546 arrayFormat = 'indices';
136547 }
136548
136549 var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
136550
136551 if (!objKeys) {
136552 objKeys = Object.keys(obj);
136553 }
136554
136555 if (sort) {
136556 objKeys.sort(sort);
136557 }
136558
136559 for (var i = 0; i < objKeys.length; ++i) {
136560 var key = objKeys[i];
136561
136562 if (skipNulls && obj[key] === null) {
136563 continue;
136564 }
136565
136566 keys = keys.concat(stringify(
136567 obj[key],
136568 key,
136569 generateArrayPrefix,
136570 strictNullHandling,
136571 skipNulls,
136572 encode ? encoder : null,
136573 filter,
136574 sort,
136575 allowDots,
136576 serializeDate,
136577 formatter,
136578 encodeValuesOnly
136579 ));
136580 }
136581
136582 var joined = keys.join(delimiter);
136583 var prefix = options.addQueryPrefix === true ? '?' : '';
136584
136585 return joined.length > 0 ? prefix + joined : '';
136586};
136587
136588
136589/***/ }),
136590/* 858 */
136591/***/ (function(module, exports, __webpack_require__) {
136592
136593"use strict";
136594
136595var strictUriEncode = __webpack_require__(1016);
136596var objectAssign = __webpack_require__(243);
136597var decodeComponent = __webpack_require__(653);
136598
136599function encoderForArrayFormat(opts) {
136600 switch (opts.arrayFormat) {
136601 case 'index':
136602 return function (key, value, index) {
136603 return value === null ? [
136604 encode(key, opts),
136605 '[',
136606 index,
136607 ']'
136608 ].join('') : [
136609 encode(key, opts),
136610 '[',
136611 encode(index, opts),
136612 ']=',
136613 encode(value, opts)
136614 ].join('');
136615 };
136616
136617 case 'bracket':
136618 return function (key, value) {
136619 return value === null ? encode(key, opts) : [
136620 encode(key, opts),
136621 '[]=',
136622 encode(value, opts)
136623 ].join('');
136624 };
136625
136626 default:
136627 return function (key, value) {
136628 return value === null ? encode(key, opts) : [
136629 encode(key, opts),
136630 '=',
136631 encode(value, opts)
136632 ].join('');
136633 };
136634 }
136635}
136636
136637function parserForArrayFormat(opts) {
136638 var result;
136639
136640 switch (opts.arrayFormat) {
136641 case 'index':
136642 return function (key, value, accumulator) {
136643 result = /\[(\d*)\]$/.exec(key);
136644
136645 key = key.replace(/\[\d*\]$/, '');
136646
136647 if (!result) {
136648 accumulator[key] = value;
136649 return;
136650 }
136651
136652 if (accumulator[key] === undefined) {
136653 accumulator[key] = {};
136654 }
136655
136656 accumulator[key][result[1]] = value;
136657 };
136658
136659 case 'bracket':
136660 return function (key, value, accumulator) {
136661 result = /(\[\])$/.exec(key);
136662 key = key.replace(/\[\]$/, '');
136663
136664 if (!result) {
136665 accumulator[key] = value;
136666 return;
136667 } else if (accumulator[key] === undefined) {
136668 accumulator[key] = [value];
136669 return;
136670 }
136671
136672 accumulator[key] = [].concat(accumulator[key], value);
136673 };
136674
136675 default:
136676 return function (key, value, accumulator) {
136677 if (accumulator[key] === undefined) {
136678 accumulator[key] = value;
136679 return;
136680 }
136681
136682 accumulator[key] = [].concat(accumulator[key], value);
136683 };
136684 }
136685}
136686
136687function encode(value, opts) {
136688 if (opts.encode) {
136689 return opts.strict ? strictUriEncode(value) : encodeURIComponent(value);
136690 }
136691
136692 return value;
136693}
136694
136695function keysSorter(input) {
136696 if (Array.isArray(input)) {
136697 return input.sort();
136698 } else if (typeof input === 'object') {
136699 return keysSorter(Object.keys(input)).sort(function (a, b) {
136700 return Number(a) - Number(b);
136701 }).map(function (key) {
136702 return input[key];
136703 });
136704 }
136705
136706 return input;
136707}
136708
136709function extract(str) {
136710 var queryStart = str.indexOf('?');
136711 if (queryStart === -1) {
136712 return '';
136713 }
136714 return str.slice(queryStart + 1);
136715}
136716
136717function parse(str, opts) {
136718 opts = objectAssign({arrayFormat: 'none'}, opts);
136719
136720 var formatter = parserForArrayFormat(opts);
136721
136722 // Create an object with no prototype
136723 // https://github.com/sindresorhus/query-string/issues/47
136724 var ret = Object.create(null);
136725
136726 if (typeof str !== 'string') {
136727 return ret;
136728 }
136729
136730 str = str.trim().replace(/^[?#&]/, '');
136731
136732 if (!str) {
136733 return ret;
136734 }
136735
136736 str.split('&').forEach(function (param) {
136737 var parts = param.replace(/\+/g, ' ').split('=');
136738 // Firefox (pre 40) decodes `%3D` to `=`
136739 // https://github.com/sindresorhus/query-string/pull/37
136740 var key = parts.shift();
136741 var val = parts.length > 0 ? parts.join('=') : undefined;
136742
136743 // missing `=` should be `null`:
136744 // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
136745 val = val === undefined ? null : decodeComponent(val);
136746
136747 formatter(decodeComponent(key), val, ret);
136748 });
136749
136750 return Object.keys(ret).sort().reduce(function (result, key) {
136751 var val = ret[key];
136752 if (Boolean(val) && typeof val === 'object' && !Array.isArray(val)) {
136753 // Sort object keys, not values
136754 result[key] = keysSorter(val);
136755 } else {
136756 result[key] = val;
136757 }
136758
136759 return result;
136760 }, Object.create(null));
136761}
136762
136763exports.extract = extract;
136764exports.parse = parse;
136765
136766exports.stringify = function (obj, opts) {
136767 var defaults = {
136768 encode: true,
136769 strict: true,
136770 arrayFormat: 'none'
136771 };
136772
136773 opts = objectAssign(defaults, opts);
136774
136775 if (opts.sort === false) {
136776 opts.sort = function () {};
136777 }
136778
136779 var formatter = encoderForArrayFormat(opts);
136780
136781 return obj ? Object.keys(obj).sort(opts.sort).map(function (key) {
136782 var val = obj[key];
136783
136784 if (val === undefined) {
136785 return '';
136786 }
136787
136788 if (val === null) {
136789 return encode(key, opts);
136790 }
136791
136792 if (Array.isArray(val)) {
136793 var result = [];
136794
136795 val.slice().forEach(function (val2) {
136796 if (val2 === undefined) {
136797 return;
136798 }
136799
136800 result.push(formatter(key, val2, result.length));
136801 });
136802
136803 return result.join('&');
136804 }
136805
136806 return encode(key, opts) + '=' + encode(val, opts);
136807 }).filter(function (x) {
136808 return x.length > 0;
136809 }).join('&') : '';
136810};
136811
136812exports.parseUrl = function (str, opts) {
136813 return {
136814 url: str.split('?')[0] || '',
136815 query: parse(extract(str), opts)
136816 };
136817};
136818
136819
136820/***/ }),
136821/* 859 */
136822/***/ (function(module, exports, __webpack_require__) {
136823
136824"use strict";
136825/*!
136826 * randomatic <https://github.com/jonschlinkert/randomatic>
136827 *
136828 * Copyright (c) 2014-2017, Jon Schlinkert.
136829 * Released under the MIT License.
136830 */
136831
136832
136833
136834var isNumber = __webpack_require__(860);
136835var typeOf = __webpack_require__(861);
136836var mathRandom = __webpack_require__(822);
136837
136838/**
136839 * Expose `randomatic`
136840 */
136841
136842module.exports = randomatic;
136843module.exports.isCrypto = !!mathRandom.cryptographic;
136844
136845/**
136846 * Available mask characters
136847 */
136848
136849var type = {
136850 lower: 'abcdefghijklmnopqrstuvwxyz',
136851 upper: 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
136852 number: '0123456789',
136853 special: '~!@#$%^&()_+-={}[];\',.'
136854};
136855
136856type.all = type.lower + type.upper + type.number + type.special;
136857
136858/**
136859 * Generate random character sequences of a specified `length`,
136860 * based on the given `pattern`.
136861 *
136862 * @param {String} `pattern` The pattern to use for generating the random string.
136863 * @param {String} `length` The length of the string to generate.
136864 * @param {String} `options`
136865 * @return {String}
136866 * @api public
136867 */
136868
136869function randomatic(pattern, length, options) {
136870 if (typeof pattern === 'undefined') {
136871 throw new Error('randomatic expects a string or number.');
136872 }
136873
136874 var custom = false;
136875 if (arguments.length === 1) {
136876 if (typeof pattern === 'string') {
136877 length = pattern.length;
136878
136879 } else if (isNumber(pattern)) {
136880 options = {};
136881 length = pattern;
136882 pattern = '*';
136883 }
136884 }
136885
136886 if (typeOf(length) === 'object' && length.hasOwnProperty('chars')) {
136887 options = length;
136888 pattern = options.chars;
136889 length = pattern.length;
136890 custom = true;
136891 }
136892
136893 var opts = options || {};
136894 var mask = '';
136895 var res = '';
136896
136897 // Characters to be used
136898 if (pattern.indexOf('?') !== -1) mask += opts.chars;
136899 if (pattern.indexOf('a') !== -1) mask += type.lower;
136900 if (pattern.indexOf('A') !== -1) mask += type.upper;
136901 if (pattern.indexOf('0') !== -1) mask += type.number;
136902 if (pattern.indexOf('!') !== -1) mask += type.special;
136903 if (pattern.indexOf('*') !== -1) mask += type.all;
136904 if (custom) mask += pattern;
136905
136906 while (length--) {
136907 res += mask.charAt(parseInt(mathRandom() * mask.length, 10));
136908 }
136909 return res;
136910};
136911
136912
136913/***/ }),
136914/* 860 */
136915/***/ (function(module, exports, __webpack_require__) {
136916
136917"use strict";
136918/*!
136919 * is-number <https://github.com/jonschlinkert/is-number>
136920 *
136921 * Copyright (c) 2014-2017, Jon Schlinkert.
136922 * Released under the MIT License.
136923 */
136924
136925
136926
136927module.exports = function isNumber(num) {
136928 var type = typeof num;
136929
136930 if (type === 'string' || num instanceof String) {
136931 // an empty string would be coerced to true with the below logic
136932 if (!num.trim()) return false;
136933 } else if (type !== 'number' && !(num instanceof Number)) {
136934 return false;
136935 }
136936
136937 return (num - num + 1) >= 0;
136938};
136939
136940
136941/***/ }),
136942/* 861 */
136943/***/ (function(module, exports) {
136944
136945var toString = Object.prototype.toString;
136946
136947module.exports = function kindOf(val) {
136948 if (val === void 0) return 'undefined';
136949 if (val === null) return 'null';
136950
136951 var type = typeof val;
136952 if (type === 'boolean') return 'boolean';
136953 if (type === 'string') return 'string';
136954 if (type === 'number') return 'number';
136955 if (type === 'symbol') return 'symbol';
136956 if (type === 'function') {
136957 return isGeneratorFn(val) ? 'generatorfunction' : 'function';
136958 }
136959
136960 if (isArray(val)) return 'array';
136961 if (isBuffer(val)) return 'buffer';
136962 if (isArguments(val)) return 'arguments';
136963 if (isDate(val)) return 'date';
136964 if (isError(val)) return 'error';
136965 if (isRegexp(val)) return 'regexp';
136966
136967 switch (ctorName(val)) {
136968 case 'Symbol': return 'symbol';
136969 case 'Promise': return 'promise';
136970
136971 // Set, Map, WeakSet, WeakMap
136972 case 'WeakMap': return 'weakmap';
136973 case 'WeakSet': return 'weakset';
136974 case 'Map': return 'map';
136975 case 'Set': return 'set';
136976
136977 // 8-bit typed arrays
136978 case 'Int8Array': return 'int8array';
136979 case 'Uint8Array': return 'uint8array';
136980 case 'Uint8ClampedArray': return 'uint8clampedarray';
136981
136982 // 16-bit typed arrays
136983 case 'Int16Array': return 'int16array';
136984 case 'Uint16Array': return 'uint16array';
136985
136986 // 32-bit typed arrays
136987 case 'Int32Array': return 'int32array';
136988 case 'Uint32Array': return 'uint32array';
136989 case 'Float32Array': return 'float32array';
136990 case 'Float64Array': return 'float64array';
136991 }
136992
136993 if (isGeneratorObj(val)) {
136994 return 'generator';
136995 }
136996
136997 // Non-plain objects
136998 type = toString.call(val);
136999 switch (type) {
137000 case '[object Object]': return 'object';
137001 // iterators
137002 case '[object Map Iterator]': return 'mapiterator';
137003 case '[object Set Iterator]': return 'setiterator';
137004 case '[object String Iterator]': return 'stringiterator';
137005 case '[object Array Iterator]': return 'arrayiterator';
137006 }
137007
137008 // other
137009 return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
137010};
137011
137012function ctorName(val) {
137013 return val.constructor ? val.constructor.name : null;
137014}
137015
137016function isArray(val) {
137017 if (Array.isArray) return Array.isArray(val);
137018 return val instanceof Array;
137019}
137020
137021function isError(val) {
137022 return val instanceof Error || (typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number');
137023}
137024
137025function isDate(val) {
137026 if (val instanceof Date) return true;
137027 return typeof val.toDateString === 'function'
137028 && typeof val.getDate === 'function'
137029 && typeof val.setDate === 'function';
137030}
137031
137032function isRegexp(val) {
137033 if (val instanceof RegExp) return true;
137034 return typeof val.flags === 'string'
137035 && typeof val.ignoreCase === 'boolean'
137036 && typeof val.multiline === 'boolean'
137037 && typeof val.global === 'boolean';
137038}
137039
137040function isGeneratorFn(name, val) {
137041 return ctorName(name) === 'GeneratorFunction';
137042}
137043
137044function isGeneratorObj(val) {
137045 return typeof val.throw === 'function'
137046 && typeof val.return === 'function'
137047 && typeof val.next === 'function';
137048}
137049
137050function isArguments(val) {
137051 try {
137052 if (typeof val.length === 'number' && typeof val.callee === 'function') {
137053 return true;
137054 }
137055 } catch (err) {
137056 if (err.message.indexOf('callee') !== -1) {
137057 return true;
137058 }
137059 }
137060 return false;
137061}
137062
137063/**
137064 * If you need to support Safari 5-7 (8-10 yr-old browser),
137065 * take a look at https://github.com/feross/is-buffer
137066 */
137067
137068function isBuffer(val) {
137069 if (val.constructor && typeof val.constructor.isBuffer === 'function') {
137070 return val.constructor.isBuffer(val);
137071 }
137072 return false;
137073}
137074
137075
137076/***/ }),
137077/* 862 */
137078/***/ (function(module, exports, __webpack_require__) {
137079
137080
137081module.exports = read
137082
137083var readline = __webpack_require__(187)
137084var Mute = __webpack_require__(371)
137085
137086function read (opts, cb) {
137087 if (opts.num) {
137088 throw new Error('read() no longer accepts a char number limit')
137089 }
137090
137091 if (typeof opts.default !== 'undefined' &&
137092 typeof opts.default !== 'string' &&
137093 typeof opts.default !== 'number') {
137094 throw new Error('default value must be string or number')
137095 }
137096
137097 var input = opts.input || process.stdin
137098 var output = opts.output || process.stdout
137099 var prompt = (opts.prompt || '').trim() + ' '
137100 var silent = opts.silent
137101 var editDef = false
137102 var timeout = opts.timeout
137103
137104 var def = opts.default || ''
137105 if (def) {
137106 if (silent) {
137107 prompt += '(<default hidden>) '
137108 } else if (opts.edit) {
137109 editDef = true
137110 } else {
137111 prompt += '(' + def + ') '
137112 }
137113 }
137114 var terminal = !!(opts.terminal || output.isTTY)
137115
137116 var m = new Mute({ replace: opts.replace, prompt: prompt })
137117 m.pipe(output, {end: false})
137118 output = m
137119 var rlOpts = { input: input, output: output, terminal: terminal }
137120
137121 if (process.version.match(/^v0\.6/)) {
137122 var rl = readline.createInterface(rlOpts.input, rlOpts.output)
137123 } else {
137124 var rl = readline.createInterface(rlOpts)
137125 }
137126
137127
137128 output.unmute()
137129 rl.setPrompt(prompt)
137130 rl.prompt()
137131 if (silent) {
137132 output.mute()
137133 } else if (editDef) {
137134 rl.line = def
137135 rl.cursor = def.length
137136 rl._refreshLine()
137137 }
137138
137139 var called = false
137140 rl.on('line', onLine)
137141 rl.on('error', onError)
137142
137143 rl.on('SIGINT', function () {
137144 rl.close()
137145 onError(new Error('canceled'))
137146 })
137147
137148 var timer
137149 if (timeout) {
137150 timer = setTimeout(function () {
137151 onError(new Error('timed out'))
137152 }, timeout)
137153 }
137154
137155 function done () {
137156 called = true
137157 rl.close()
137158
137159 if (process.version.match(/^v0\.6/)) {
137160 rl.input.removeAllListeners('data')
137161 rl.input.removeAllListeners('keypress')
137162 rl.input.pause()
137163 }
137164
137165 clearTimeout(timer)
137166 output.mute()
137167 output.end()
137168 }
137169
137170 function onError (er) {
137171 if (called) return
137172 done()
137173 return cb(er)
137174 }
137175
137176 function onLine (line) {
137177 if (called) return
137178 if (silent && terminal) {
137179 output.unmute()
137180 output.write('\r\n')
137181 }
137182 done()
137183 // truncate the \n at the end.
137184 line = line.replace(/\r?\n$/, '')
137185 var isDefault = !!(editDef && line === def)
137186 if (def && !line) {
137187 isDefault = true
137188 line = def
137189 }
137190 cb(null, line, isDefault)
137191 }
137192}
137193
137194
137195/***/ }),
137196/* 863 */
137197/***/ (function(module, exports, __webpack_require__) {
137198
137199module.exports = __webpack_require__(91).Duplex
137200
137201
137202/***/ }),
137203/* 864 */
137204/***/ (function(module, exports, __webpack_require__) {
137205
137206"use strict";
137207// Copyright Joyent, Inc. and other Node contributors.
137208//
137209// Permission is hereby granted, free of charge, to any person obtaining a
137210// copy of this software and associated documentation files (the
137211// "Software"), to deal in the Software without restriction, including
137212// without limitation the rights to use, copy, modify, merge, publish,
137213// distribute, sublicense, and/or sell copies of the Software, and to permit
137214// persons to whom the Software is furnished to do so, subject to the
137215// following conditions:
137216//
137217// The above copyright notice and this permission notice shall be included
137218// in all copies or substantial portions of the Software.
137219//
137220// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
137221// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
137222// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
137223// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
137224// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
137225// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
137226// USE OR OTHER DEALINGS IN THE SOFTWARE.
137227
137228// a passthrough stream.
137229// basically just the most minimal sort of Transform stream.
137230// Every written chunk gets output as-is.
137231
137232
137233
137234module.exports = PassThrough;
137235
137236var Transform = __webpack_require__(377);
137237
137238/*<replacement>*/
137239var util = __webpack_require__(105);
137240util.inherits = __webpack_require__(78);
137241/*</replacement>*/
137242
137243util.inherits(PassThrough, Transform);
137244
137245function PassThrough(options) {
137246 if (!(this instanceof PassThrough)) return new PassThrough(options);
137247
137248 Transform.call(this, options);
137249}
137250
137251PassThrough.prototype._transform = function (chunk, encoding, cb) {
137252 cb(null, chunk);
137253};
137254
137255/***/ }),
137256/* 865 */
137257/***/ (function(module, exports, __webpack_require__) {
137258
137259"use strict";
137260
137261
137262function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
137263
137264var Buffer = __webpack_require__(60).Buffer;
137265var util = __webpack_require__(9);
137266
137267function copyBuffer(src, target, offset) {
137268 src.copy(target, offset);
137269}
137270
137271module.exports = function () {
137272 function BufferList() {
137273 _classCallCheck(this, BufferList);
137274
137275 this.head = null;
137276 this.tail = null;
137277 this.length = 0;
137278 }
137279
137280 BufferList.prototype.push = function push(v) {
137281 var entry = { data: v, next: null };
137282 if (this.length > 0) this.tail.next = entry;else this.head = entry;
137283 this.tail = entry;
137284 ++this.length;
137285 };
137286
137287 BufferList.prototype.unshift = function unshift(v) {
137288 var entry = { data: v, next: this.head };
137289 if (this.length === 0) this.tail = entry;
137290 this.head = entry;
137291 ++this.length;
137292 };
137293
137294 BufferList.prototype.shift = function shift() {
137295 if (this.length === 0) return;
137296 var ret = this.head.data;
137297 if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
137298 --this.length;
137299 return ret;
137300 };
137301
137302 BufferList.prototype.clear = function clear() {
137303 this.head = this.tail = null;
137304 this.length = 0;
137305 };
137306
137307 BufferList.prototype.join = function join(s) {
137308 if (this.length === 0) return '';
137309 var p = this.head;
137310 var ret = '' + p.data;
137311 while (p = p.next) {
137312 ret += s + p.data;
137313 }return ret;
137314 };
137315
137316 BufferList.prototype.concat = function concat(n) {
137317 if (this.length === 0) return Buffer.alloc(0);
137318 if (this.length === 1) return this.head.data;
137319 var ret = Buffer.allocUnsafe(n >>> 0);
137320 var p = this.head;
137321 var i = 0;
137322 while (p) {
137323 copyBuffer(p.data, ret, i);
137324 i += p.data.length;
137325 p = p.next;
137326 }
137327 return ret;
137328 };
137329
137330 return BufferList;
137331}();
137332
137333if (util && util.inspect && util.inspect.custom) {
137334 module.exports.prototype[util.inspect.custom] = function () {
137335 var obj = util.inspect({ length: this.length });
137336 return this.constructor.name + ' ' + obj;
137337 };
137338}
137339
137340/***/ }),
137341/* 866 */
137342/***/ (function(module, exports, __webpack_require__) {
137343
137344module.exports = __webpack_require__(91).Transform
137345
137346
137347/***/ }),
137348/* 867 */
137349/***/ (function(module, exports, __webpack_require__) {
137350
137351"use strict";
137352/*!
137353 * regex-cache <https://github.com/jonschlinkert/regex-cache>
137354 *
137355 * Copyright (c) 2015-2017, Jon Schlinkert.
137356 * Released under the MIT License.
137357 */
137358
137359
137360
137361var equal = __webpack_require__(783);
137362var basic = {};
137363var cache = {};
137364
137365/**
137366 * Expose `regexCache`
137367 */
137368
137369module.exports = regexCache;
137370
137371/**
137372 * Memoize the results of a call to the new RegExp constructor.
137373 *
137374 * @param {Function} fn [description]
137375 * @param {String} str [description]
137376 * @param {Options} options [description]
137377 * @param {Boolean} nocompare [description]
137378 * @return {RegExp}
137379 */
137380
137381function regexCache(fn, str, opts) {
137382 var key = '_default_', regex, cached;
137383
137384 if (!str && !opts) {
137385 if (typeof fn !== 'function') {
137386 return fn;
137387 }
137388 return basic[key] || (basic[key] = fn(str));
137389 }
137390
137391 var isString = typeof str === 'string';
137392 if (isString) {
137393 if (!opts) {
137394 return basic[str] || (basic[str] = fn(str));
137395 }
137396 key = str;
137397 } else {
137398 opts = str;
137399 }
137400
137401 cached = cache[key];
137402 if (cached && equal(cached.opts, opts)) {
137403 return cached.regex;
137404 }
137405
137406 memo(key, opts, (regex = fn(str, opts)));
137407 return regex;
137408}
137409
137410function memo(key, opts, regex) {
137411 cache[key] = {regex: regex, opts: opts};
137412}
137413
137414/**
137415 * Expose `cache`
137416 */
137417
137418module.exports.cache = cache;
137419module.exports.basic = basic;
137420
137421
137422/***/ }),
137423/* 868 */
137424/***/ (function(module, exports) {
137425
137426var isWin = process.platform === 'win32';
137427
137428module.exports = function (str) {
137429 var i = str.length - 1;
137430 if (i < 2) {
137431 return str;
137432 }
137433 while (isSeparator(str, i)) {
137434 i--;
137435 }
137436 return str.substr(0, i + 1);
137437};
137438
137439function isSeparator(str, i) {
137440 var char = str[i];
137441 return i > 0 && (char === '/' || (isWin && char === '\\'));
137442}
137443
137444
137445/***/ }),
137446/* 869 */
137447/***/ (function(module, exports, __webpack_require__) {
137448
137449"use strict";
137450/*!
137451 * repeat-string <https://github.com/jonschlinkert/repeat-string>
137452 *
137453 * Copyright (c) 2014-2015, Jon Schlinkert.
137454 * Licensed under the MIT License.
137455 */
137456
137457
137458
137459/**
137460 * Results cache
137461 */
137462
137463var res = '';
137464var cache;
137465
137466/**
137467 * Expose `repeat`
137468 */
137469
137470module.exports = repeat;
137471
137472/**
137473 * Repeat the given `string` the specified `number`
137474 * of times.
137475 *
137476 * **Example:**
137477 *
137478 * ```js
137479 * var repeat = require('repeat-string');
137480 * repeat('A', 5);
137481 * //=> AAAAA
137482 * ```
137483 *
137484 * @param {String} `string` The string to repeat
137485 * @param {Number} `number` The number of times to repeat the string
137486 * @return {String} Repeated string
137487 * @api public
137488 */
137489
137490function repeat(str, num) {
137491 if (typeof str !== 'string') {
137492 throw new TypeError('expected a string');
137493 }
137494
137495 // cover common, quick use cases
137496 if (num === 1) return str;
137497 if (num === 2) return str + str;
137498
137499 var max = str.length * num;
137500 if (cache !== str || typeof cache === 'undefined') {
137501 cache = str;
137502 res = '';
137503 } else if (res.length >= max) {
137504 return res.substr(0, max);
137505 }
137506
137507 while (max > res.length && num > 1) {
137508 if (num & 1) {
137509 res += str;
137510 }
137511
137512 num >>= 1;
137513 str += str;
137514 }
137515
137516 res += str;
137517 res = res.substr(0, max);
137518 return res;
137519}
137520
137521
137522/***/ }),
137523/* 870 */
137524/***/ (function(module, exports) {
137525
137526module.exports = {"name":"request-capture-har","version":"1.2.2","description":"Wrapper for request module that saves all traffic as a HAR file, useful for auto mocking a client","main":"request-capture-har.js","scripts":{"test":"semistandard","travis":"npm test && node request-capture-har.js"},"repository":{"type":"git","url":"git+https://github.com/paulirish/node-request-capture-har.git"},"keywords":["http","request","har"],"author":"Lars Thorup <lars@zealake.com> (http://github.com/larsthorup)","license":"MIT","bugs":{"url":"https://github.com/paulirish/node-request-capture-har/issues"},"homepage":"https://github.com/paulirish/node-request-capture-har#readme","files":["request-capture-har.js"],"devDependencies":{"semistandard":"^8.0.0"}}
137527
137528/***/ }),
137529/* 871 */
137530/***/ (function(module, exports, __webpack_require__) {
137531
137532var fs = __webpack_require__(12);
137533var pkg = __webpack_require__(870);
137534
137535function buildHarHeaders (headers) {
137536 return headers ? Object.keys(headers).map(function (key) {
137537 return {
137538 name: key,
137539 // header values are required to be strings
137540 value: headers[key].toString()
137541 };
137542 }) : [];
137543}
137544
137545function appendPostData (entry, request) {
137546 if (!request.body) return;
137547
137548 entry.request.postData = {
137549 mimeType: 'application/octet-stream',
137550 text: request.body
137551 };
137552}
137553
137554function toMs (num) {
137555 return Math.round(num * 1000) / 1000;
137556}
137557
137558function HarWrapper (requestModule) {
137559 this.requestModule = requestModule;
137560 this.clear();
137561}
137562
137563HarWrapper.prototype.request = function (options) {
137564 // include detailed timing data in response object
137565 Object.assign(options, { time: true });
137566 var self = this;
137567 // make call to true request module
137568 return this.requestModule(options, function (err, incomingMessage, response) {
137569 // create new har entry with reponse timings
137570 if (!err) {
137571 self.entries.push(self.buildHarEntry(incomingMessage));
137572 }
137573
137574 // fire any callback provided in options, as request has ignored it
137575 // https://github.com/request/request/blob/v2.75.0/index.js#L40
137576 if (typeof options.callback === 'function') {
137577 options.callback.apply(null, arguments);
137578 }
137579 });
137580};
137581
137582HarWrapper.prototype.clear = function () {
137583 this.entries = [];
137584 this.earliestTime = new Date(2099, 1, 1);
137585};
137586
137587HarWrapper.prototype.saveHar = function (fileName) {
137588 var httpArchive = {
137589 log: {
137590 version: '1.2',
137591 creator: {name: 'request-capture-har', version: pkg.version},
137592 pages: [{
137593 startedDateTime: new Date(this.earliestTime).toISOString(),
137594 id: 'request-capture-har',
137595 title: 'request-capture-har',
137596 pageTimings: { }
137597 }],
137598 entries: this.entries
137599 }
137600 };
137601 fs.writeFileSync(fileName, JSON.stringify(httpArchive, null, 2));
137602};
137603
137604HarWrapper.prototype.buildTimings = function (entry, response) {
137605 var startTs = response.request.startTime;
137606 var endTs = startTs + response.elapsedTime;
137607 var totalTime = endTs - startTs;
137608
137609 if (new Date(startTs) < this.earliestTime) {
137610 this.earliestTime = new Date(startTs);
137611 }
137612 entry.startedDateTime = new Date(startTs).toISOString();
137613 entry.time = totalTime;
137614
137615 // new timing data added in request 2.81.0
137616 if (response.timingPhases) {
137617 entry.timings = {
137618 'blocked': toMs(response.timingPhases.wait),
137619 'dns': toMs(response.timingPhases.dns),
137620 'connect': toMs(response.timingPhases.tcp),
137621 'send': 0,
137622 'wait': toMs(response.timingPhases.firstByte),
137623 'receive': toMs(response.timingPhases.download)
137624 };
137625 return;
137626 }
137627
137628 var responseStartTs = response.request.response.responseStartTime;
137629
137630 var waitingTime = responseStartTs - startTs;
137631 var receiveTime = endTs - responseStartTs;
137632 entry.timings = {
137633 send: 0,
137634 wait: waitingTime,
137635 receive: receiveTime
137636 };
137637};
137638
137639HarWrapper.prototype.buildHarEntry = function (response) {
137640 var entry = {
137641 request: {
137642 method: response.request.method,
137643 url: response.request.uri.href,
137644 httpVersion: 'HTTP/' + response.httpVersion,
137645 cookies: [],
137646 headers: buildHarHeaders(response.request.headers),
137647 queryString: [],
137648 headersSize: -1,
137649 bodySize: -1
137650 },
137651 response: {
137652 status: response.statusCode,
137653 statusText: response.statusMessage,
137654 httpVersion: 'HTTP/' + response.httpVersion,
137655 cookies: [],
137656 headers: buildHarHeaders(response.headers),
137657 _transferSize: response.body.length,
137658 content: {
137659 size: response.body.length,
137660 mimeType: response.headers['content-type']
137661 },
137662 redirectURL: '',
137663 headersSize: -1,
137664 bodySize: -1
137665 },
137666 cache: {}
137667 };
137668 this.buildTimings(entry, response);
137669 appendPostData(entry, response.request);
137670 return entry;
137671};
137672
137673module.exports = HarWrapper;
137674
137675
137676/***/ }),
137677/* 872 */
137678/***/ (function(module, exports, __webpack_require__) {
137679
137680"use strict";
137681// Copyright 2010-2012 Mikeal Rogers
137682//
137683// Licensed under the Apache License, Version 2.0 (the "License");
137684// you may not use this file except in compliance with the License.
137685// You may obtain a copy of the License at
137686//
137687// http://www.apache.org/licenses/LICENSE-2.0
137688//
137689// Unless required by applicable law or agreed to in writing, software
137690// distributed under the License is distributed on an "AS IS" BASIS,
137691// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
137692// See the License for the specific language governing permissions and
137693// limitations under the License.
137694
137695
137696
137697var extend = __webpack_require__(232)
137698var cookies = __webpack_require__(382)
137699var helpers = __webpack_require__(246)
137700
137701var paramsHaveRequestBody = helpers.paramsHaveRequestBody
137702
137703// organize params for patch, post, put, head, del
137704function initParams (uri, options, callback) {
137705 if (typeof options === 'function') {
137706 callback = options
137707 }
137708
137709 var params = {}
137710 if (typeof options === 'object') {
137711 extend(params, options, {uri: uri})
137712 } else if (typeof uri === 'string') {
137713 extend(params, {uri: uri})
137714 } else {
137715 extend(params, uri)
137716 }
137717
137718 params.callback = callback || params.callback
137719 return params
137720}
137721
137722function request (uri, options, callback) {
137723 if (typeof uri === 'undefined') {
137724 throw new Error('undefined is not a valid uri or options object.')
137725 }
137726
137727 var params = initParams(uri, options, callback)
137728
137729 if (params.method === 'HEAD' && paramsHaveRequestBody(params)) {
137730 throw new Error('HTTP HEAD requests MUST NOT include a request body.')
137731 }
137732
137733 return new request.Request(params)
137734}
137735
137736function verbFunc (verb) {
137737 var method = verb.toUpperCase()
137738 return function (uri, options, callback) {
137739 var params = initParams(uri, options, callback)
137740 params.method = method
137741 return request(params, params.callback)
137742 }
137743}
137744
137745// define like this to please codeintel/intellisense IDEs
137746request.get = verbFunc('get')
137747request.head = verbFunc('head')
137748request.options = verbFunc('options')
137749request.post = verbFunc('post')
137750request.put = verbFunc('put')
137751request.patch = verbFunc('patch')
137752request.del = verbFunc('delete')
137753request['delete'] = verbFunc('delete')
137754
137755request.jar = function (store) {
137756 return cookies.jar(store)
137757}
137758
137759request.cookie = function (str) {
137760 return cookies.parse(str)
137761}
137762
137763function wrapRequestMethod (method, options, requester, verb) {
137764 return function (uri, opts, callback) {
137765 var params = initParams(uri, opts, callback)
137766
137767 var target = {}
137768 extend(true, target, options, params)
137769
137770 target.pool = params.pool || options.pool
137771
137772 if (verb) {
137773 target.method = verb.toUpperCase()
137774 }
137775
137776 if (typeof requester === 'function') {
137777 method = requester
137778 }
137779
137780 return method(target, target.callback)
137781 }
137782}
137783
137784request.defaults = function (options, requester) {
137785 var self = this
137786
137787 options = options || {}
137788
137789 if (typeof options === 'function') {
137790 requester = options
137791 options = {}
137792 }
137793
137794 var defaults = wrapRequestMethod(self, options, requester)
137795
137796 var verbs = ['get', 'head', 'post', 'put', 'patch', 'del', 'delete']
137797 verbs.forEach(function (verb) {
137798 defaults[verb] = wrapRequestMethod(self[verb], options, requester, verb)
137799 })
137800
137801 defaults.cookie = wrapRequestMethod(self.cookie, options, requester)
137802 defaults.jar = self.jar
137803 defaults.defaults = self.defaults
137804 return defaults
137805}
137806
137807request.forever = function (agentOptions, optionsArg) {
137808 var options = {}
137809 if (optionsArg) {
137810 extend(options, optionsArg)
137811 }
137812 if (agentOptions) {
137813 options.agentOptions = agentOptions
137814 }
137815
137816 options.forever = true
137817 return request.defaults(options)
137818}
137819
137820// Exports
137821
137822module.exports = request
137823request.Request = __webpack_require__(885)
137824request.initParams = initParams
137825
137826// Backwards compatibility for request.debug
137827Object.defineProperty(request, 'debug', {
137828 enumerable: true,
137829 get: function () {
137830 return request.Request.debug
137831 },
137832 set: function (debug) {
137833 request.Request.debug = debug
137834 }
137835})
137836
137837
137838/***/ }),
137839/* 873 */
137840/***/ (function(module, exports, __webpack_require__) {
137841
137842"use strict";
137843
137844
137845var caseless = __webpack_require__(212)
137846var uuid = __webpack_require__(114)
137847var helpers = __webpack_require__(246)
137848
137849var md5 = helpers.md5
137850var toBase64 = helpers.toBase64
137851
137852function Auth (request) {
137853 // define all public properties here
137854 this.request = request
137855 this.hasAuth = false
137856 this.sentAuth = false
137857 this.bearerToken = null
137858 this.user = null
137859 this.pass = null
137860}
137861
137862Auth.prototype.basic = function (user, pass, sendImmediately) {
137863 var self = this
137864 if (typeof user !== 'string' || (pass !== undefined && typeof pass !== 'string')) {
137865 self.request.emit('error', new Error('auth() received invalid user or password'))
137866 }
137867 self.user = user
137868 self.pass = pass
137869 self.hasAuth = true
137870 var header = user + ':' + (pass || '')
137871 if (sendImmediately || typeof sendImmediately === 'undefined') {
137872 var authHeader = 'Basic ' + toBase64(header)
137873 self.sentAuth = true
137874 return authHeader
137875 }
137876}
137877
137878Auth.prototype.bearer = function (bearer, sendImmediately) {
137879 var self = this
137880 self.bearerToken = bearer
137881 self.hasAuth = true
137882 if (sendImmediately || typeof sendImmediately === 'undefined') {
137883 if (typeof bearer === 'function') {
137884 bearer = bearer()
137885 }
137886 var authHeader = 'Bearer ' + (bearer || '')
137887 self.sentAuth = true
137888 return authHeader
137889 }
137890}
137891
137892Auth.prototype.digest = function (method, path, authHeader) {
137893 // TODO: More complete implementation of RFC 2617.
137894 // - handle challenge.domain
137895 // - support qop="auth-int" only
137896 // - handle Authentication-Info (not necessarily?)
137897 // - check challenge.stale (not necessarily?)
137898 // - increase nc (not necessarily?)
137899 // For reference:
137900 // http://tools.ietf.org/html/rfc2617#section-3
137901 // https://github.com/bagder/curl/blob/master/lib/http_digest.c
137902
137903 var self = this
137904
137905 var challenge = {}
137906 var re = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi
137907 for (;;) {
137908 var match = re.exec(authHeader)
137909 if (!match) {
137910 break
137911 }
137912 challenge[match[1]] = match[2] || match[3]
137913 }
137914
137915 /**
137916 * RFC 2617: handle both MD5 and MD5-sess algorithms.
137917 *
137918 * If the algorithm directive's value is "MD5" or unspecified, then HA1 is
137919 * HA1=MD5(username:realm:password)
137920 * If the algorithm directive's value is "MD5-sess", then HA1 is
137921 * HA1=MD5(MD5(username:realm:password):nonce:cnonce)
137922 */
137923 var ha1Compute = function (algorithm, user, realm, pass, nonce, cnonce) {
137924 var ha1 = md5(user + ':' + realm + ':' + pass)
137925 if (algorithm && algorithm.toLowerCase() === 'md5-sess') {
137926 return md5(ha1 + ':' + nonce + ':' + cnonce)
137927 } else {
137928 return ha1
137929 }
137930 }
137931
137932 var qop = /(^|,)\s*auth\s*($|,)/.test(challenge.qop) && 'auth'
137933 var nc = qop && '00000001'
137934 var cnonce = qop && uuid().replace(/-/g, '')
137935 var ha1 = ha1Compute(challenge.algorithm, self.user, challenge.realm, self.pass, challenge.nonce, cnonce)
137936 var ha2 = md5(method + ':' + path)
137937 var digestResponse = qop
137938 ? md5(ha1 + ':' + challenge.nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + ha2)
137939 : md5(ha1 + ':' + challenge.nonce + ':' + ha2)
137940 var authValues = {
137941 username: self.user,
137942 realm: challenge.realm,
137943 nonce: challenge.nonce,
137944 uri: path,
137945 qop: qop,
137946 response: digestResponse,
137947 nc: nc,
137948 cnonce: cnonce,
137949 algorithm: challenge.algorithm,
137950 opaque: challenge.opaque
137951 }
137952
137953 authHeader = []
137954 for (var k in authValues) {
137955 if (authValues[k]) {
137956 if (k === 'qop' || k === 'nc' || k === 'algorithm') {
137957 authHeader.push(k + '=' + authValues[k])
137958 } else {
137959 authHeader.push(k + '="' + authValues[k] + '"')
137960 }
137961 }
137962 }
137963 authHeader = 'Digest ' + authHeader.join(', ')
137964 self.sentAuth = true
137965 return authHeader
137966}
137967
137968Auth.prototype.onRequest = function (user, pass, sendImmediately, bearer) {
137969 var self = this
137970 var request = self.request
137971
137972 var authHeader
137973 if (bearer === undefined && user === undefined) {
137974 self.request.emit('error', new Error('no auth mechanism defined'))
137975 } else if (bearer !== undefined) {
137976 authHeader = self.bearer(bearer, sendImmediately)
137977 } else {
137978 authHeader = self.basic(user, pass, sendImmediately)
137979 }
137980 if (authHeader) {
137981 request.setHeader('authorization', authHeader)
137982 }
137983}
137984
137985Auth.prototype.onResponse = function (response) {
137986 var self = this
137987 var request = self.request
137988
137989 if (!self.hasAuth || self.sentAuth) { return null }
137990
137991 var c = caseless(response.headers)
137992
137993 var authHeader = c.get('www-authenticate')
137994 var authVerb = authHeader && authHeader.split(' ')[0].toLowerCase()
137995 request.debug('reauth', authVerb)
137996
137997 switch (authVerb) {
137998 case 'basic':
137999 return self.basic(self.user, self.pass, true)
138000
138001 case 'bearer':
138002 return self.bearer(self.bearerToken, true)
138003
138004 case 'digest':
138005 return self.digest(request.method, request.path, authHeader)
138006 }
138007}
138008
138009exports.Auth = Auth
138010
138011
138012/***/ }),
138013/* 874 */
138014/***/ (function(module, exports, __webpack_require__) {
138015
138016"use strict";
138017
138018
138019function formatHostname (hostname) {
138020 // canonicalize the hostname, so that 'oogle.com' won't match 'google.com'
138021 return hostname.replace(/^\.*/, '.').toLowerCase()
138022}
138023
138024function parseNoProxyZone (zone) {
138025 zone = zone.trim().toLowerCase()
138026
138027 var zoneParts = zone.split(':', 2)
138028 var zoneHost = formatHostname(zoneParts[0])
138029 var zonePort = zoneParts[1]
138030 var hasPort = zone.indexOf(':') > -1
138031
138032 return {hostname: zoneHost, port: zonePort, hasPort: hasPort}
138033}
138034
138035function uriInNoProxy (uri, noProxy) {
138036 var port = uri.port || (uri.protocol === 'https:' ? '443' : '80')
138037 var hostname = formatHostname(uri.hostname)
138038 var noProxyList = noProxy.split(',')
138039
138040 // iterate through the noProxyList until it finds a match.
138041 return noProxyList.map(parseNoProxyZone).some(function (noProxyZone) {
138042 var isMatchedAt = hostname.indexOf(noProxyZone.hostname)
138043 var hostnameMatched = (
138044 isMatchedAt > -1 &&
138045 (isMatchedAt === hostname.length - noProxyZone.hostname.length)
138046 )
138047
138048 if (noProxyZone.hasPort) {
138049 return (port === noProxyZone.port) && hostnameMatched
138050 }
138051
138052 return hostnameMatched
138053 })
138054}
138055
138056function getProxyFromURI (uri) {
138057 // Decide the proper request proxy to use based on the request URI object and the
138058 // environmental variables (NO_PROXY, HTTP_PROXY, etc.)
138059 // respect NO_PROXY environment variables (see: http://lynx.isc.org/current/breakout/lynx_help/keystrokes/environments.html)
138060
138061 var noProxy = process.env.NO_PROXY || process.env.no_proxy || ''
138062
138063 // if the noProxy is a wildcard then return null
138064
138065 if (noProxy === '*') {
138066 return null
138067 }
138068
138069 // if the noProxy is not empty and the uri is found return null
138070
138071 if (noProxy !== '' && uriInNoProxy(uri, noProxy)) {
138072 return null
138073 }
138074
138075 // Check for HTTP or HTTPS Proxy in environment Else default to null
138076
138077 if (uri.protocol === 'http:') {
138078 return process.env.HTTP_PROXY ||
138079 process.env.http_proxy || null
138080 }
138081
138082 if (uri.protocol === 'https:') {
138083 return process.env.HTTPS_PROXY ||
138084 process.env.https_proxy ||
138085 process.env.HTTP_PROXY ||
138086 process.env.http_proxy || null
138087 }
138088
138089 // if none of that works, return null
138090 // (What uri protocol are you using then?)
138091
138092 return null
138093}
138094
138095module.exports = getProxyFromURI
138096
138097
138098/***/ }),
138099/* 875 */
138100/***/ (function(module, exports, __webpack_require__) {
138101
138102"use strict";
138103
138104
138105var fs = __webpack_require__(12)
138106var qs = __webpack_require__(186)
138107var validate = __webpack_require__(703)
138108var extend = __webpack_require__(232)
138109
138110function Har (request) {
138111 this.request = request
138112}
138113
138114Har.prototype.reducer = function (obj, pair) {
138115 // new property ?
138116 if (obj[pair.name] === undefined) {
138117 obj[pair.name] = pair.value
138118 return obj
138119 }
138120
138121 // existing? convert to array
138122 var arr = [
138123 obj[pair.name],
138124 pair.value
138125 ]
138126
138127 obj[pair.name] = arr
138128
138129 return obj
138130}
138131
138132Har.prototype.prep = function (data) {
138133 // construct utility properties
138134 data.queryObj = {}
138135 data.headersObj = {}
138136 data.postData.jsonObj = false
138137 data.postData.paramsObj = false
138138
138139 // construct query objects
138140 if (data.queryString && data.queryString.length) {
138141 data.queryObj = data.queryString.reduce(this.reducer, {})
138142 }
138143
138144 // construct headers objects
138145 if (data.headers && data.headers.length) {
138146 // loweCase header keys
138147 data.headersObj = data.headers.reduceRight(function (headers, header) {
138148 headers[header.name] = header.value
138149 return headers
138150 }, {})
138151 }
138152
138153 // construct Cookie header
138154 if (data.cookies && data.cookies.length) {
138155 var cookies = data.cookies.map(function (cookie) {
138156 return cookie.name + '=' + cookie.value
138157 })
138158
138159 if (cookies.length) {
138160 data.headersObj.cookie = cookies.join('; ')
138161 }
138162 }
138163
138164 // prep body
138165 function some (arr) {
138166 return arr.some(function (type) {
138167 return data.postData.mimeType.indexOf(type) === 0
138168 })
138169 }
138170
138171 if (some([
138172 'multipart/mixed',
138173 'multipart/related',
138174 'multipart/form-data',
138175 'multipart/alternative'])) {
138176 // reset values
138177 data.postData.mimeType = 'multipart/form-data'
138178 } else if (some([
138179 'application/x-www-form-urlencoded'])) {
138180 if (!data.postData.params) {
138181 data.postData.text = ''
138182 } else {
138183 data.postData.paramsObj = data.postData.params.reduce(this.reducer, {})
138184
138185 // always overwrite
138186 data.postData.text = qs.stringify(data.postData.paramsObj)
138187 }
138188 } else if (some([
138189 'text/json',
138190 'text/x-json',
138191 'application/json',
138192 'application/x-json'])) {
138193 data.postData.mimeType = 'application/json'
138194
138195 if (data.postData.text) {
138196 try {
138197 data.postData.jsonObj = JSON.parse(data.postData.text)
138198 } catch (e) {
138199 this.request.debug(e)
138200
138201 // force back to text/plain
138202 data.postData.mimeType = 'text/plain'
138203 }
138204 }
138205 }
138206
138207 return data
138208}
138209
138210Har.prototype.options = function (options) {
138211 // skip if no har property defined
138212 if (!options.har) {
138213 return options
138214 }
138215
138216 var har = {}
138217 extend(har, options.har)
138218
138219 // only process the first entry
138220 if (har.log && har.log.entries) {
138221 har = har.log.entries[0]
138222 }
138223
138224 // add optional properties to make validation successful
138225 har.url = har.url || options.url || options.uri || options.baseUrl || '/'
138226 har.httpVersion = har.httpVersion || 'HTTP/1.1'
138227 har.queryString = har.queryString || []
138228 har.headers = har.headers || []
138229 har.cookies = har.cookies || []
138230 har.postData = har.postData || {}
138231 har.postData.mimeType = har.postData.mimeType || 'application/octet-stream'
138232
138233 har.bodySize = 0
138234 har.headersSize = 0
138235 har.postData.size = 0
138236
138237 if (!validate.request(har)) {
138238 return options
138239 }
138240
138241 // clean up and get some utility properties
138242 var req = this.prep(har)
138243
138244 // construct new options
138245 if (req.url) {
138246 options.url = req.url
138247 }
138248
138249 if (req.method) {
138250 options.method = req.method
138251 }
138252
138253 if (Object.keys(req.queryObj).length) {
138254 options.qs = req.queryObj
138255 }
138256
138257 if (Object.keys(req.headersObj).length) {
138258 options.headers = req.headersObj
138259 }
138260
138261 function test (type) {
138262 return req.postData.mimeType.indexOf(type) === 0
138263 }
138264 if (test('application/x-www-form-urlencoded')) {
138265 options.form = req.postData.paramsObj
138266 } else if (test('application/json')) {
138267 if (req.postData.jsonObj) {
138268 options.body = req.postData.jsonObj
138269 options.json = true
138270 }
138271 } else if (test('multipart/form-data')) {
138272 options.formData = {}
138273
138274 req.postData.params.forEach(function (param) {
138275 var attachment = {}
138276
138277 if (!param.fileName && !param.fileName && !param.contentType) {
138278 options.formData[param.name] = param.value
138279 return
138280 }
138281
138282 // attempt to read from disk!
138283 if (param.fileName && !param.value) {
138284 attachment.value = fs.createReadStream(param.fileName)
138285 } else if (param.value) {
138286 attachment.value = param.value
138287 }
138288
138289 if (param.fileName) {
138290 attachment.options = {
138291 filename: param.fileName,
138292 contentType: param.contentType ? param.contentType : null
138293 }
138294 }
138295
138296 options.formData[param.name] = attachment
138297 })
138298 } else {
138299 if (req.postData.text) {
138300 options.body = req.postData.text
138301 }
138302 }
138303
138304 return options
138305}
138306
138307exports.Har = Har
138308
138309
138310/***/ }),
138311/* 876 */
138312/***/ (function(module, exports, __webpack_require__) {
138313
138314"use strict";
138315
138316
138317var crypto = __webpack_require__(21)
138318
138319function randomString (size) {
138320 var bits = (size + 1) * 6
138321 var buffer = crypto.randomBytes(Math.ceil(bits / 8))
138322 var string = buffer.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/=/g, '')
138323 return string.slice(0, size)
138324}
138325
138326function calculatePayloadHash (payload, algorithm, contentType) {
138327 var hash = crypto.createHash(algorithm)
138328 hash.update('hawk.1.payload\n')
138329 hash.update((contentType ? contentType.split(';')[0].trim().toLowerCase() : '') + '\n')
138330 hash.update(payload || '')
138331 hash.update('\n')
138332 return hash.digest('base64')
138333}
138334
138335exports.calculateMac = function (credentials, opts) {
138336 var normalized = 'hawk.1.header\n' +
138337 opts.ts + '\n' +
138338 opts.nonce + '\n' +
138339 (opts.method || '').toUpperCase() + '\n' +
138340 opts.resource + '\n' +
138341 opts.host.toLowerCase() + '\n' +
138342 opts.port + '\n' +
138343 (opts.hash || '') + '\n'
138344
138345 if (opts.ext) {
138346 normalized = normalized + opts.ext.replace('\\', '\\\\').replace('\n', '\\n')
138347 }
138348
138349 normalized = normalized + '\n'
138350
138351 if (opts.app) {
138352 normalized = normalized + opts.app + '\n' + (opts.dlg || '') + '\n'
138353 }
138354
138355 var hmac = crypto.createHmac(credentials.algorithm, credentials.key).update(normalized)
138356 var digest = hmac.digest('base64')
138357 return digest
138358}
138359
138360exports.header = function (uri, method, opts) {
138361 var timestamp = opts.timestamp || Math.floor((Date.now() + (opts.localtimeOffsetMsec || 0)) / 1000)
138362 var credentials = opts.credentials
138363 if (!credentials || !credentials.id || !credentials.key || !credentials.algorithm) {
138364 return ''
138365 }
138366
138367 if (['sha1', 'sha256'].indexOf(credentials.algorithm) === -1) {
138368 return ''
138369 }
138370
138371 var artifacts = {
138372 ts: timestamp,
138373 nonce: opts.nonce || randomString(6),
138374 method: method,
138375 resource: uri.pathname + (uri.search || ''),
138376 host: uri.hostname,
138377 port: uri.port || (uri.protocol === 'http:' ? 80 : 443),
138378 hash: opts.hash,
138379 ext: opts.ext,
138380 app: opts.app,
138381 dlg: opts.dlg
138382 }
138383
138384 if (!artifacts.hash && (opts.payload || opts.payload === '')) {
138385 artifacts.hash = calculatePayloadHash(opts.payload, credentials.algorithm, opts.contentType)
138386 }
138387
138388 var mac = exports.calculateMac(credentials, artifacts)
138389
138390 var hasExt = artifacts.ext !== null && artifacts.ext !== undefined && artifacts.ext !== ''
138391 var header = 'Hawk id="' + credentials.id +
138392 '", ts="' + artifacts.ts +
138393 '", nonce="' + artifacts.nonce +
138394 (artifacts.hash ? '", hash="' + artifacts.hash : '') +
138395 (hasExt ? '", ext="' + artifacts.ext.replace(/\\/g, '\\\\').replace(/"/g, '\\"') : '') +
138396 '", mac="' + mac + '"'
138397
138398 if (artifacts.app) {
138399 header = header + ', app="' + artifacts.app + (artifacts.dlg ? '", dlg="' + artifacts.dlg : '') + '"'
138400 }
138401
138402 return header
138403}
138404
138405
138406/***/ }),
138407/* 877 */
138408/***/ (function(module, exports, __webpack_require__) {
138409
138410"use strict";
138411
138412
138413var uuid = __webpack_require__(114)
138414var CombinedStream = __webpack_require__(323)
138415var isstream = __webpack_require__(367)
138416var Buffer = __webpack_require__(60).Buffer
138417
138418function Multipart (request) {
138419 this.request = request
138420 this.boundary = uuid()
138421 this.chunked = false
138422 this.body = null
138423}
138424
138425Multipart.prototype.isChunked = function (options) {
138426 var self = this
138427 var chunked = false
138428 var parts = options.data || options
138429
138430 if (!parts.forEach) {
138431 self.request.emit('error', new Error('Argument error, options.multipart.'))
138432 }
138433
138434 if (options.chunked !== undefined) {
138435 chunked = options.chunked
138436 }
138437
138438 if (self.request.getHeader('transfer-encoding') === 'chunked') {
138439 chunked = true
138440 }
138441
138442 if (!chunked) {
138443 parts.forEach(function (part) {
138444 if (typeof part.body === 'undefined') {
138445 self.request.emit('error', new Error('Body attribute missing in multipart.'))
138446 }
138447 if (isstream(part.body)) {
138448 chunked = true
138449 }
138450 })
138451 }
138452
138453 return chunked
138454}
138455
138456Multipart.prototype.setHeaders = function (chunked) {
138457 var self = this
138458
138459 if (chunked && !self.request.hasHeader('transfer-encoding')) {
138460 self.request.setHeader('transfer-encoding', 'chunked')
138461 }
138462
138463 var header = self.request.getHeader('content-type')
138464
138465 if (!header || header.indexOf('multipart') === -1) {
138466 self.request.setHeader('content-type', 'multipart/related; boundary=' + self.boundary)
138467 } else {
138468 if (header.indexOf('boundary') !== -1) {
138469 self.boundary = header.replace(/.*boundary=([^\s;]+).*/, '$1')
138470 } else {
138471 self.request.setHeader('content-type', header + '; boundary=' + self.boundary)
138472 }
138473 }
138474}
138475
138476Multipart.prototype.build = function (parts, chunked) {
138477 var self = this
138478 var body = chunked ? new CombinedStream() : []
138479
138480 function add (part) {
138481 if (typeof part === 'number') {
138482 part = part.toString()
138483 }
138484 return chunked ? body.append(part) : body.push(Buffer.from(part))
138485 }
138486
138487 if (self.request.preambleCRLF) {
138488 add('\r\n')
138489 }
138490
138491 parts.forEach(function (part) {
138492 var preamble = '--' + self.boundary + '\r\n'
138493 Object.keys(part).forEach(function (key) {
138494 if (key === 'body') { return }
138495 preamble += key + ': ' + part[key] + '\r\n'
138496 })
138497 preamble += '\r\n'
138498 add(preamble)
138499 add(part.body)
138500 add('\r\n')
138501 })
138502 add('--' + self.boundary + '--')
138503
138504 if (self.request.postambleCRLF) {
138505 add('\r\n')
138506 }
138507
138508 return body
138509}
138510
138511Multipart.prototype.onRequest = function (options) {
138512 var self = this
138513
138514 var chunked = self.isChunked(options)
138515 var parts = options.data || options
138516
138517 self.setHeaders(chunked)
138518 self.chunked = chunked
138519 self.body = self.build(parts, chunked)
138520}
138521
138522exports.Multipart = Multipart
138523
138524
138525/***/ }),
138526/* 878 */
138527/***/ (function(module, exports, __webpack_require__) {
138528
138529"use strict";
138530
138531
138532var url = __webpack_require__(29)
138533var qs = __webpack_require__(374)
138534var caseless = __webpack_require__(212)
138535var uuid = __webpack_require__(114)
138536var oauth = __webpack_require__(840)
138537var crypto = __webpack_require__(21)
138538var Buffer = __webpack_require__(60).Buffer
138539
138540function OAuth (request) {
138541 this.request = request
138542 this.params = null
138543}
138544
138545OAuth.prototype.buildParams = function (_oauth, uri, method, query, form, qsLib) {
138546 var oa = {}
138547 for (var i in _oauth) {
138548 oa['oauth_' + i] = _oauth[i]
138549 }
138550 if (!oa.oauth_version) {
138551 oa.oauth_version = '1.0'
138552 }
138553 if (!oa.oauth_timestamp) {
138554 oa.oauth_timestamp = Math.floor(Date.now() / 1000).toString()
138555 }
138556 if (!oa.oauth_nonce) {
138557 oa.oauth_nonce = uuid().replace(/-/g, '')
138558 }
138559 if (!oa.oauth_signature_method) {
138560 oa.oauth_signature_method = 'HMAC-SHA1'
138561 }
138562
138563 var consumer_secret_or_private_key = oa.oauth_consumer_secret || oa.oauth_private_key // eslint-disable-line camelcase
138564 delete oa.oauth_consumer_secret
138565 delete oa.oauth_private_key
138566
138567 var token_secret = oa.oauth_token_secret // eslint-disable-line camelcase
138568 delete oa.oauth_token_secret
138569
138570 var realm = oa.oauth_realm
138571 delete oa.oauth_realm
138572 delete oa.oauth_transport_method
138573
138574 var baseurl = uri.protocol + '//' + uri.host + uri.pathname
138575 var params = qsLib.parse([].concat(query, form, qsLib.stringify(oa)).join('&'))
138576
138577 oa.oauth_signature = oauth.sign(
138578 oa.oauth_signature_method,
138579 method,
138580 baseurl,
138581 params,
138582 consumer_secret_or_private_key, // eslint-disable-line camelcase
138583 token_secret // eslint-disable-line camelcase
138584 )
138585
138586 if (realm) {
138587 oa.realm = realm
138588 }
138589
138590 return oa
138591}
138592
138593OAuth.prototype.buildBodyHash = function (_oauth, body) {
138594 if (['HMAC-SHA1', 'RSA-SHA1'].indexOf(_oauth.signature_method || 'HMAC-SHA1') < 0) {
138595 this.request.emit('error', new Error('oauth: ' + _oauth.signature_method +
138596 ' signature_method not supported with body_hash signing.'))
138597 }
138598
138599 var shasum = crypto.createHash('sha1')
138600 shasum.update(body || '')
138601 var sha1 = shasum.digest('hex')
138602
138603 return Buffer.from(sha1, 'hex').toString('base64')
138604}
138605
138606OAuth.prototype.concatParams = function (oa, sep, wrap) {
138607 wrap = wrap || ''
138608
138609 var params = Object.keys(oa).filter(function (i) {
138610 return i !== 'realm' && i !== 'oauth_signature'
138611 }).sort()
138612
138613 if (oa.realm) {
138614 params.splice(0, 0, 'realm')
138615 }
138616 params.push('oauth_signature')
138617
138618 return params.map(function (i) {
138619 return i + '=' + wrap + oauth.rfc3986(oa[i]) + wrap
138620 }).join(sep)
138621}
138622
138623OAuth.prototype.onRequest = function (_oauth) {
138624 var self = this
138625 self.params = _oauth
138626
138627 var uri = self.request.uri || {}
138628 var method = self.request.method || ''
138629 var headers = caseless(self.request.headers)
138630 var body = self.request.body || ''
138631 var qsLib = self.request.qsLib || qs
138632
138633 var form
138634 var query
138635 var contentType = headers.get('content-type') || ''
138636 var formContentType = 'application/x-www-form-urlencoded'
138637 var transport = _oauth.transport_method || 'header'
138638
138639 if (contentType.slice(0, formContentType.length) === formContentType) {
138640 contentType = formContentType
138641 form = body
138642 }
138643 if (uri.query) {
138644 query = uri.query
138645 }
138646 if (transport === 'body' && (method !== 'POST' || contentType !== formContentType)) {
138647 self.request.emit('error', new Error('oauth: transport_method of body requires POST ' +
138648 'and content-type ' + formContentType))
138649 }
138650
138651 if (!form && typeof _oauth.body_hash === 'boolean') {
138652 _oauth.body_hash = self.buildBodyHash(_oauth, self.request.body.toString())
138653 }
138654
138655 var oa = self.buildParams(_oauth, uri, method, query, form, qsLib)
138656
138657 switch (transport) {
138658 case 'header':
138659 self.request.setHeader('Authorization', 'OAuth ' + self.concatParams(oa, ',', '"'))
138660 break
138661
138662 case 'query':
138663 var href = self.request.uri.href += (query ? '&' : '?') + self.concatParams(oa, '&')
138664 self.request.uri = url.parse(href)
138665 self.request.path = self.request.uri.path
138666 break
138667
138668 case 'body':
138669 self.request.body = (form ? form + '&' : '') + self.concatParams(oa, '&')
138670 break
138671
138672 default:
138673 self.request.emit('error', new Error('oauth: transport_method invalid'))
138674 }
138675}
138676
138677exports.OAuth = OAuth
138678
138679
138680/***/ }),
138681/* 879 */
138682/***/ (function(module, exports, __webpack_require__) {
138683
138684"use strict";
138685
138686
138687var qs = __webpack_require__(374)
138688var querystring = __webpack_require__(186)
138689
138690function Querystring (request) {
138691 this.request = request
138692 this.lib = null
138693 this.useQuerystring = null
138694 this.parseOptions = null
138695 this.stringifyOptions = null
138696}
138697
138698Querystring.prototype.init = function (options) {
138699 if (this.lib) { return }
138700
138701 this.useQuerystring = options.useQuerystring
138702 this.lib = (this.useQuerystring ? querystring : qs)
138703
138704 this.parseOptions = options.qsParseOptions || {}
138705 this.stringifyOptions = options.qsStringifyOptions || {}
138706}
138707
138708Querystring.prototype.stringify = function (obj) {
138709 return (this.useQuerystring)
138710 ? this.rfc3986(this.lib.stringify(obj,
138711 this.stringifyOptions.sep || null,
138712 this.stringifyOptions.eq || null,
138713 this.stringifyOptions))
138714 : this.lib.stringify(obj, this.stringifyOptions)
138715}
138716
138717Querystring.prototype.parse = function (str) {
138718 return (this.useQuerystring)
138719 ? this.lib.parse(str,
138720 this.parseOptions.sep || null,
138721 this.parseOptions.eq || null,
138722 this.parseOptions)
138723 : this.lib.parse(str, this.parseOptions)
138724}
138725
138726Querystring.prototype.rfc3986 = function (str) {
138727 return str.replace(/[!'()*]/g, function (c) {
138728 return '%' + c.charCodeAt(0).toString(16).toUpperCase()
138729 })
138730}
138731
138732Querystring.prototype.unescape = querystring.unescape
138733
138734exports.Querystring = Querystring
138735
138736
138737/***/ }),
138738/* 880 */
138739/***/ (function(module, exports, __webpack_require__) {
138740
138741"use strict";
138742
138743
138744var url = __webpack_require__(29)
138745var isUrl = /^https?:/
138746
138747function Redirect (request) {
138748 this.request = request
138749 this.followRedirect = true
138750 this.followRedirects = true
138751 this.followAllRedirects = false
138752 this.followOriginalHttpMethod = false
138753 this.allowRedirect = function () { return true }
138754 this.maxRedirects = 10
138755 this.redirects = []
138756 this.redirectsFollowed = 0
138757 this.removeRefererHeader = false
138758}
138759
138760Redirect.prototype.onRequest = function (options) {
138761 var self = this
138762
138763 if (options.maxRedirects !== undefined) {
138764 self.maxRedirects = options.maxRedirects
138765 }
138766 if (typeof options.followRedirect === 'function') {
138767 self.allowRedirect = options.followRedirect
138768 }
138769 if (options.followRedirect !== undefined) {
138770 self.followRedirects = !!options.followRedirect
138771 }
138772 if (options.followAllRedirects !== undefined) {
138773 self.followAllRedirects = options.followAllRedirects
138774 }
138775 if (self.followRedirects || self.followAllRedirects) {
138776 self.redirects = self.redirects || []
138777 }
138778 if (options.removeRefererHeader !== undefined) {
138779 self.removeRefererHeader = options.removeRefererHeader
138780 }
138781 if (options.followOriginalHttpMethod !== undefined) {
138782 self.followOriginalHttpMethod = options.followOriginalHttpMethod
138783 }
138784}
138785
138786Redirect.prototype.redirectTo = function (response) {
138787 var self = this
138788 var request = self.request
138789
138790 var redirectTo = null
138791 if (response.statusCode >= 300 && response.statusCode < 400 && response.caseless.has('location')) {
138792 var location = response.caseless.get('location')
138793 request.debug('redirect', location)
138794
138795 if (self.followAllRedirects) {
138796 redirectTo = location
138797 } else if (self.followRedirects) {
138798 switch (request.method) {
138799 case 'PATCH':
138800 case 'PUT':
138801 case 'POST':
138802 case 'DELETE':
138803 // Do not follow redirects
138804 break
138805 default:
138806 redirectTo = location
138807 break
138808 }
138809 }
138810 } else if (response.statusCode === 401) {
138811 var authHeader = request._auth.onResponse(response)
138812 if (authHeader) {
138813 request.setHeader('authorization', authHeader)
138814 redirectTo = request.uri
138815 }
138816 }
138817 return redirectTo
138818}
138819
138820Redirect.prototype.onResponse = function (response) {
138821 var self = this
138822 var request = self.request
138823
138824 var redirectTo = self.redirectTo(response)
138825 if (!redirectTo || !self.allowRedirect.call(request, response)) {
138826 return false
138827 }
138828
138829 request.debug('redirect to', redirectTo)
138830
138831 // ignore any potential response body. it cannot possibly be useful
138832 // to us at this point.
138833 // response.resume should be defined, but check anyway before calling. Workaround for browserify.
138834 if (response.resume) {
138835 response.resume()
138836 }
138837
138838 if (self.redirectsFollowed >= self.maxRedirects) {
138839 request.emit('error', new Error('Exceeded maxRedirects. Probably stuck in a redirect loop ' + request.uri.href))
138840 return false
138841 }
138842 self.redirectsFollowed += 1
138843
138844 if (!isUrl.test(redirectTo)) {
138845 redirectTo = url.resolve(request.uri.href, redirectTo)
138846 }
138847
138848 var uriPrev = request.uri
138849 request.uri = url.parse(redirectTo)
138850
138851 // handle the case where we change protocol from https to http or vice versa
138852 if (request.uri.protocol !== uriPrev.protocol) {
138853 delete request.agent
138854 }
138855
138856 self.redirects.push({ statusCode: response.statusCode, redirectUri: redirectTo })
138857
138858 if (self.followAllRedirects && request.method !== 'HEAD' &&
138859 response.statusCode !== 401 && response.statusCode !== 307) {
138860 request.method = self.followOriginalHttpMethod ? request.method : 'GET'
138861 }
138862 // request.method = 'GET' // Force all redirects to use GET || commented out fixes #215
138863 delete request.src
138864 delete request.req
138865 delete request._started
138866 if (response.statusCode !== 401 && response.statusCode !== 307) {
138867 // Remove parameters from the previous response, unless this is the second request
138868 // for a server that requires digest authentication.
138869 delete request.body
138870 delete request._form
138871 if (request.headers) {
138872 request.removeHeader('host')
138873 request.removeHeader('content-type')
138874 request.removeHeader('content-length')
138875 if (request.uri.hostname !== request.originalHost.split(':')[0]) {
138876 // Remove authorization if changing hostnames (but not if just
138877 // changing ports or protocols). This matches the behavior of curl:
138878 // https://github.com/bagder/curl/blob/6beb0eee/lib/http.c#L710
138879 request.removeHeader('authorization')
138880 }
138881 }
138882 }
138883
138884 if (!self.removeRefererHeader) {
138885 request.setHeader('referer', uriPrev.href)
138886 }
138887
138888 request.emit('redirect')
138889
138890 request.init()
138891
138892 return true
138893}
138894
138895exports.Redirect = Redirect
138896
138897
138898/***/ }),
138899/* 881 */
138900/***/ (function(module, exports, __webpack_require__) {
138901
138902"use strict";
138903
138904
138905var url = __webpack_require__(29)
138906var tunnel = __webpack_require__(1028)
138907
138908var defaultProxyHeaderWhiteList = [
138909 'accept',
138910 'accept-charset',
138911 'accept-encoding',
138912 'accept-language',
138913 'accept-ranges',
138914 'cache-control',
138915 'content-encoding',
138916 'content-language',
138917 'content-location',
138918 'content-md5',
138919 'content-range',
138920 'content-type',
138921 'connection',
138922 'date',
138923 'expect',
138924 'max-forwards',
138925 'pragma',
138926 'referer',
138927 'te',
138928 'user-agent',
138929 'via'
138930]
138931
138932var defaultProxyHeaderExclusiveList = [
138933 'proxy-authorization'
138934]
138935
138936function constructProxyHost (uriObject) {
138937 var port = uriObject.port
138938 var protocol = uriObject.protocol
138939 var proxyHost = uriObject.hostname + ':'
138940
138941 if (port) {
138942 proxyHost += port
138943 } else if (protocol === 'https:') {
138944 proxyHost += '443'
138945 } else {
138946 proxyHost += '80'
138947 }
138948
138949 return proxyHost
138950}
138951
138952function constructProxyHeaderWhiteList (headers, proxyHeaderWhiteList) {
138953 var whiteList = proxyHeaderWhiteList
138954 .reduce(function (set, header) {
138955 set[header.toLowerCase()] = true
138956 return set
138957 }, {})
138958
138959 return Object.keys(headers)
138960 .filter(function (header) {
138961 return whiteList[header.toLowerCase()]
138962 })
138963 .reduce(function (set, header) {
138964 set[header] = headers[header]
138965 return set
138966 }, {})
138967}
138968
138969function constructTunnelOptions (request, proxyHeaders) {
138970 var proxy = request.proxy
138971
138972 var tunnelOptions = {
138973 proxy: {
138974 host: proxy.hostname,
138975 port: +proxy.port,
138976 proxyAuth: proxy.auth,
138977 headers: proxyHeaders
138978 },
138979 headers: request.headers,
138980 ca: request.ca,
138981 cert: request.cert,
138982 key: request.key,
138983 passphrase: request.passphrase,
138984 pfx: request.pfx,
138985 ciphers: request.ciphers,
138986 rejectUnauthorized: request.rejectUnauthorized,
138987 secureOptions: request.secureOptions,
138988 secureProtocol: request.secureProtocol
138989 }
138990
138991 return tunnelOptions
138992}
138993
138994function constructTunnelFnName (uri, proxy) {
138995 var uriProtocol = (uri.protocol === 'https:' ? 'https' : 'http')
138996 var proxyProtocol = (proxy.protocol === 'https:' ? 'Https' : 'Http')
138997 return [uriProtocol, proxyProtocol].join('Over')
138998}
138999
139000function getTunnelFn (request) {
139001 var uri = request.uri
139002 var proxy = request.proxy
139003 var tunnelFnName = constructTunnelFnName(uri, proxy)
139004 return tunnel[tunnelFnName]
139005}
139006
139007function Tunnel (request) {
139008 this.request = request
139009 this.proxyHeaderWhiteList = defaultProxyHeaderWhiteList
139010 this.proxyHeaderExclusiveList = []
139011 if (typeof request.tunnel !== 'undefined') {
139012 this.tunnelOverride = request.tunnel
139013 }
139014}
139015
139016Tunnel.prototype.isEnabled = function () {
139017 var self = this
139018 var request = self.request
139019 // Tunnel HTTPS by default. Allow the user to override this setting.
139020
139021 // If self.tunnelOverride is set (the user specified a value), use it.
139022 if (typeof self.tunnelOverride !== 'undefined') {
139023 return self.tunnelOverride
139024 }
139025
139026 // If the destination is HTTPS, tunnel.
139027 if (request.uri.protocol === 'https:') {
139028 return true
139029 }
139030
139031 // Otherwise, do not use tunnel.
139032 return false
139033}
139034
139035Tunnel.prototype.setup = function (options) {
139036 var self = this
139037 var request = self.request
139038
139039 options = options || {}
139040
139041 if (typeof request.proxy === 'string') {
139042 request.proxy = url.parse(request.proxy)
139043 }
139044
139045 if (!request.proxy || !request.tunnel) {
139046 return false
139047 }
139048
139049 // Setup Proxy Header Exclusive List and White List
139050 if (options.proxyHeaderWhiteList) {
139051 self.proxyHeaderWhiteList = options.proxyHeaderWhiteList
139052 }
139053 if (options.proxyHeaderExclusiveList) {
139054 self.proxyHeaderExclusiveList = options.proxyHeaderExclusiveList
139055 }
139056
139057 var proxyHeaderExclusiveList = self.proxyHeaderExclusiveList.concat(defaultProxyHeaderExclusiveList)
139058 var proxyHeaderWhiteList = self.proxyHeaderWhiteList.concat(proxyHeaderExclusiveList)
139059
139060 // Setup Proxy Headers and Proxy Headers Host
139061 // Only send the Proxy White Listed Header names
139062 var proxyHeaders = constructProxyHeaderWhiteList(request.headers, proxyHeaderWhiteList)
139063 proxyHeaders.host = constructProxyHost(request.uri)
139064
139065 proxyHeaderExclusiveList.forEach(request.removeHeader, request)
139066
139067 // Set Agent from Tunnel Data
139068 var tunnelFn = getTunnelFn(request)
139069 var tunnelOptions = constructTunnelOptions(request, proxyHeaders)
139070 request.agent = tunnelFn(tunnelOptions)
139071
139072 return true
139073}
139074
139075Tunnel.defaultProxyHeaderWhiteList = defaultProxyHeaderWhiteList
139076Tunnel.defaultProxyHeaderExclusiveList = defaultProxyHeaderExclusiveList
139077exports.Tunnel = Tunnel
139078
139079
139080/***/ }),
139081/* 882 */
139082/***/ (function(module, exports, __webpack_require__) {
139083
139084"use strict";
139085/*!
139086 * Copyright (c) 2015, Salesforce.com, Inc.
139087 * All rights reserved.
139088 *
139089 * Redistribution and use in source and binary forms, with or without
139090 * modification, are permitted provided that the following conditions are met:
139091 *
139092 * 1. Redistributions of source code must retain the above copyright notice,
139093 * this list of conditions and the following disclaimer.
139094 *
139095 * 2. Redistributions in binary form must reproduce the above copyright notice,
139096 * this list of conditions and the following disclaimer in the documentation
139097 * and/or other materials provided with the distribution.
139098 *
139099 * 3. Neither the name of Salesforce.com nor the names of its contributors may
139100 * be used to endorse or promote products derived from this software without
139101 * specific prior written permission.
139102 *
139103 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
139104 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
139105 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
139106 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
139107 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
139108 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
139109 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
139110 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
139111 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
139112 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
139113 * POSSIBILITY OF SUCH DAMAGE.
139114 */
139115
139116var net = __webpack_require__(151);
139117var urlParse = __webpack_require__(29).parse;
139118var pubsuffix = __webpack_require__(385);
139119var Store = __webpack_require__(386).Store;
139120var MemoryCookieStore = __webpack_require__(883).MemoryCookieStore;
139121var pathMatch = __webpack_require__(383).pathMatch;
139122var VERSION = __webpack_require__(884).version;
139123
139124var punycode;
139125try {
139126 punycode = __webpack_require__(271);
139127} catch(e) {
139128 console.warn("cookie: can't load punycode; won't use punycode for domain normalization");
139129}
139130
139131// From RFC6265 S4.1.1
139132// note that it excludes \x3B ";"
139133var COOKIE_OCTETS = /^[\x21\x23-\x2B\x2D-\x3A\x3C-\x5B\x5D-\x7E]+$/;
139134
139135var CONTROL_CHARS = /[\x00-\x1F]/;
139136
139137// From Chromium // '\r', '\n' and '\0' should be treated as a terminator in
139138// the "relaxed" mode, see:
139139// https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/parsed_cookie.cc#L60
139140var TERMINATORS = ['\n', '\r', '\0'];
139141
139142// RFC6265 S4.1.1 defines path value as 'any CHAR except CTLs or ";"'
139143// Note ';' is \x3B
139144var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/;
139145
139146// date-time parsing constants (RFC6265 S5.1.1)
139147
139148var DATE_DELIM = /[\x09\x20-\x2F\x3B-\x40\x5B-\x60\x7B-\x7E]/;
139149
139150var MONTH_TO_NUM = {
139151 jan:0, feb:1, mar:2, apr:3, may:4, jun:5,
139152 jul:6, aug:7, sep:8, oct:9, nov:10, dec:11
139153};
139154var NUM_TO_MONTH = [
139155 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'
139156];
139157var NUM_TO_DAY = [
139158 'Sun','Mon','Tue','Wed','Thu','Fri','Sat'
139159];
139160
139161var MAX_TIME = 2147483647000; // 31-bit max
139162var MIN_TIME = 0; // 31-bit min
139163
139164/*
139165 * Parses a Natural number (i.e., non-negative integer) with either the
139166 * <min>*<max>DIGIT ( non-digit *OCTET )
139167 * or
139168 * <min>*<max>DIGIT
139169 * grammar (RFC6265 S5.1.1).
139170 *
139171 * The "trailingOK" boolean controls if the grammar accepts a
139172 * "( non-digit *OCTET )" trailer.
139173 */
139174function parseDigits(token, minDigits, maxDigits, trailingOK) {
139175 var count = 0;
139176 while (count < token.length) {
139177 var c = token.charCodeAt(count);
139178 // "non-digit = %x00-2F / %x3A-FF"
139179 if (c <= 0x2F || c >= 0x3A) {
139180 break;
139181 }
139182 count++;
139183 }
139184
139185 // constrain to a minimum and maximum number of digits.
139186 if (count < minDigits || count > maxDigits) {
139187 return null;
139188 }
139189
139190 if (!trailingOK && count != token.length) {
139191 return null;
139192 }
139193
139194 return parseInt(token.substr(0,count), 10);
139195}
139196
139197function parseTime(token) {
139198 var parts = token.split(':');
139199 var result = [0,0,0];
139200
139201 /* RF6256 S5.1.1:
139202 * time = hms-time ( non-digit *OCTET )
139203 * hms-time = time-field ":" time-field ":" time-field
139204 * time-field = 1*2DIGIT
139205 */
139206
139207 if (parts.length !== 3) {
139208 return null;
139209 }
139210
139211 for (var i = 0; i < 3; i++) {
139212 // "time-field" must be strictly "1*2DIGIT", HOWEVER, "hms-time" can be
139213 // followed by "( non-digit *OCTET )" so therefore the last time-field can
139214 // have a trailer
139215 var trailingOK = (i == 2);
139216 var num = parseDigits(parts[i], 1, 2, trailingOK);
139217 if (num === null) {
139218 return null;
139219 }
139220 result[i] = num;
139221 }
139222
139223 return result;
139224}
139225
139226function parseMonth(token) {
139227 token = String(token).substr(0,3).toLowerCase();
139228 var num = MONTH_TO_NUM[token];
139229 return num >= 0 ? num : null;
139230}
139231
139232/*
139233 * RFC6265 S5.1.1 date parser (see RFC for full grammar)
139234 */
139235function parseDate(str) {
139236 if (!str) {
139237 return;
139238 }
139239
139240 /* RFC6265 S5.1.1:
139241 * 2. Process each date-token sequentially in the order the date-tokens
139242 * appear in the cookie-date
139243 */
139244 var tokens = str.split(DATE_DELIM);
139245 if (!tokens) {
139246 return;
139247 }
139248
139249 var hour = null;
139250 var minute = null;
139251 var second = null;
139252 var dayOfMonth = null;
139253 var month = null;
139254 var year = null;
139255
139256 for (var i=0; i<tokens.length; i++) {
139257 var token = tokens[i].trim();
139258 if (!token.length) {
139259 continue;
139260 }
139261
139262 var result;
139263
139264 /* 2.1. If the found-time flag is not set and the token matches the time
139265 * production, set the found-time flag and set the hour- value,
139266 * minute-value, and second-value to the numbers denoted by the digits in
139267 * the date-token, respectively. Skip the remaining sub-steps and continue
139268 * to the next date-token.
139269 */
139270 if (second === null) {
139271 result = parseTime(token);
139272 if (result) {
139273 hour = result[0];
139274 minute = result[1];
139275 second = result[2];
139276 continue;
139277 }
139278 }
139279
139280 /* 2.2. If the found-day-of-month flag is not set and the date-token matches
139281 * the day-of-month production, set the found-day-of- month flag and set
139282 * the day-of-month-value to the number denoted by the date-token. Skip
139283 * the remaining sub-steps and continue to the next date-token.
139284 */
139285 if (dayOfMonth === null) {
139286 // "day-of-month = 1*2DIGIT ( non-digit *OCTET )"
139287 result = parseDigits(token, 1, 2, true);
139288 if (result !== null) {
139289 dayOfMonth = result;
139290 continue;
139291 }
139292 }
139293
139294 /* 2.3. If the found-month flag is not set and the date-token matches the
139295 * month production, set the found-month flag and set the month-value to
139296 * the month denoted by the date-token. Skip the remaining sub-steps and
139297 * continue to the next date-token.
139298 */
139299 if (month === null) {
139300 result = parseMonth(token);
139301 if (result !== null) {
139302 month = result;
139303 continue;
139304 }
139305 }
139306
139307 /* 2.4. If the found-year flag is not set and the date-token matches the
139308 * year production, set the found-year flag and set the year-value to the
139309 * number denoted by the date-token. Skip the remaining sub-steps and
139310 * continue to the next date-token.
139311 */
139312 if (year === null) {
139313 // "year = 2*4DIGIT ( non-digit *OCTET )"
139314 result = parseDigits(token, 2, 4, true);
139315 if (result !== null) {
139316 year = result;
139317 /* From S5.1.1:
139318 * 3. If the year-value is greater than or equal to 70 and less
139319 * than or equal to 99, increment the year-value by 1900.
139320 * 4. If the year-value is greater than or equal to 0 and less
139321 * than or equal to 69, increment the year-value by 2000.
139322 */
139323 if (year >= 70 && year <= 99) {
139324 year += 1900;
139325 } else if (year >= 0 && year <= 69) {
139326 year += 2000;
139327 }
139328 }
139329 }
139330 }
139331
139332 /* RFC 6265 S5.1.1
139333 * "5. Abort these steps and fail to parse the cookie-date if:
139334 * * at least one of the found-day-of-month, found-month, found-
139335 * year, or found-time flags is not set,
139336 * * the day-of-month-value is less than 1 or greater than 31,
139337 * * the year-value is less than 1601,
139338 * * the hour-value is greater than 23,
139339 * * the minute-value is greater than 59, or
139340 * * the second-value is greater than 59.
139341 * (Note that leap seconds cannot be represented in this syntax.)"
139342 *
139343 * So, in order as above:
139344 */
139345 if (
139346 dayOfMonth === null || month === null || year === null || second === null ||
139347 dayOfMonth < 1 || dayOfMonth > 31 ||
139348 year < 1601 ||
139349 hour > 23 ||
139350 minute > 59 ||
139351 second > 59
139352 ) {
139353 return;
139354 }
139355
139356 return new Date(Date.UTC(year, month, dayOfMonth, hour, minute, second));
139357}
139358
139359function formatDate(date) {
139360 var d = date.getUTCDate(); d = d >= 10 ? d : '0'+d;
139361 var h = date.getUTCHours(); h = h >= 10 ? h : '0'+h;
139362 var m = date.getUTCMinutes(); m = m >= 10 ? m : '0'+m;
139363 var s = date.getUTCSeconds(); s = s >= 10 ? s : '0'+s;
139364 return NUM_TO_DAY[date.getUTCDay()] + ', ' +
139365 d+' '+ NUM_TO_MONTH[date.getUTCMonth()] +' '+ date.getUTCFullYear() +' '+
139366 h+':'+m+':'+s+' GMT';
139367}
139368
139369// S5.1.2 Canonicalized Host Names
139370function canonicalDomain(str) {
139371 if (str == null) {
139372 return null;
139373 }
139374 str = str.trim().replace(/^\./,''); // S4.1.2.3 & S5.2.3: ignore leading .
139375
139376 // convert to IDN if any non-ASCII characters
139377 if (punycode && /[^\u0001-\u007f]/.test(str)) {
139378 str = punycode.toASCII(str);
139379 }
139380
139381 return str.toLowerCase();
139382}
139383
139384// S5.1.3 Domain Matching
139385function domainMatch(str, domStr, canonicalize) {
139386 if (str == null || domStr == null) {
139387 return null;
139388 }
139389 if (canonicalize !== false) {
139390 str = canonicalDomain(str);
139391 domStr = canonicalDomain(domStr);
139392 }
139393
139394 /*
139395 * "The domain string and the string are identical. (Note that both the
139396 * domain string and the string will have been canonicalized to lower case at
139397 * this point)"
139398 */
139399 if (str == domStr) {
139400 return true;
139401 }
139402
139403 /* "All of the following [three] conditions hold:" (order adjusted from the RFC) */
139404
139405 /* "* The string is a host name (i.e., not an IP address)." */
139406 if (net.isIP(str)) {
139407 return false;
139408 }
139409
139410 /* "* The domain string is a suffix of the string" */
139411 var idx = str.indexOf(domStr);
139412 if (idx <= 0) {
139413 return false; // it's a non-match (-1) or prefix (0)
139414 }
139415
139416 // e.g "a.b.c".indexOf("b.c") === 2
139417 // 5 === 3+2
139418 if (str.length !== domStr.length + idx) { // it's not a suffix
139419 return false;
139420 }
139421
139422 /* "* The last character of the string that is not included in the domain
139423 * string is a %x2E (".") character." */
139424 if (str.substr(idx-1,1) !== '.') {
139425 return false;
139426 }
139427
139428 return true;
139429}
139430
139431
139432// RFC6265 S5.1.4 Paths and Path-Match
139433
139434/*
139435 * "The user agent MUST use an algorithm equivalent to the following algorithm
139436 * to compute the default-path of a cookie:"
139437 *
139438 * Assumption: the path (and not query part or absolute uri) is passed in.
139439 */
139440function defaultPath(path) {
139441 // "2. If the uri-path is empty or if the first character of the uri-path is not
139442 // a %x2F ("/") character, output %x2F ("/") and skip the remaining steps.
139443 if (!path || path.substr(0,1) !== "/") {
139444 return "/";
139445 }
139446
139447 // "3. If the uri-path contains no more than one %x2F ("/") character, output
139448 // %x2F ("/") and skip the remaining step."
139449 if (path === "/") {
139450 return path;
139451 }
139452
139453 var rightSlash = path.lastIndexOf("/");
139454 if (rightSlash === 0) {
139455 return "/";
139456 }
139457
139458 // "4. Output the characters of the uri-path from the first character up to,
139459 // but not including, the right-most %x2F ("/")."
139460 return path.slice(0, rightSlash);
139461}
139462
139463function trimTerminator(str) {
139464 for (var t = 0; t < TERMINATORS.length; t++) {
139465 var terminatorIdx = str.indexOf(TERMINATORS[t]);
139466 if (terminatorIdx !== -1) {
139467 str = str.substr(0,terminatorIdx);
139468 }
139469 }
139470
139471 return str;
139472}
139473
139474function parseCookiePair(cookiePair, looseMode) {
139475 cookiePair = trimTerminator(cookiePair);
139476
139477 var firstEq = cookiePair.indexOf('=');
139478 if (looseMode) {
139479 if (firstEq === 0) { // '=' is immediately at start
139480 cookiePair = cookiePair.substr(1);
139481 firstEq = cookiePair.indexOf('='); // might still need to split on '='
139482 }
139483 } else { // non-loose mode
139484 if (firstEq <= 0) { // no '=' or is at start
139485 return; // needs to have non-empty "cookie-name"
139486 }
139487 }
139488
139489 var cookieName, cookieValue;
139490 if (firstEq <= 0) {
139491 cookieName = "";
139492 cookieValue = cookiePair.trim();
139493 } else {
139494 cookieName = cookiePair.substr(0, firstEq).trim();
139495 cookieValue = cookiePair.substr(firstEq+1).trim();
139496 }
139497
139498 if (CONTROL_CHARS.test(cookieName) || CONTROL_CHARS.test(cookieValue)) {
139499 return;
139500 }
139501
139502 var c = new Cookie();
139503 c.key = cookieName;
139504 c.value = cookieValue;
139505 return c;
139506}
139507
139508function parse(str, options) {
139509 if (!options || typeof options !== 'object') {
139510 options = {};
139511 }
139512 str = str.trim();
139513
139514 // We use a regex to parse the "name-value-pair" part of S5.2
139515 var firstSemi = str.indexOf(';'); // S5.2 step 1
139516 var cookiePair = (firstSemi === -1) ? str : str.substr(0, firstSemi);
139517 var c = parseCookiePair(cookiePair, !!options.loose);
139518 if (!c) {
139519 return;
139520 }
139521
139522 if (firstSemi === -1) {
139523 return c;
139524 }
139525
139526 // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string
139527 // (including the %x3B (";") in question)." plus later on in the same section
139528 // "discard the first ";" and trim".
139529 var unparsed = str.slice(firstSemi + 1).trim();
139530
139531 // "If the unparsed-attributes string is empty, skip the rest of these
139532 // steps."
139533 if (unparsed.length === 0) {
139534 return c;
139535 }
139536
139537 /*
139538 * S5.2 says that when looping over the items "[p]rocess the attribute-name
139539 * and attribute-value according to the requirements in the following
139540 * subsections" for every item. Plus, for many of the individual attributes
139541 * in S5.3 it says to use the "attribute-value of the last attribute in the
139542 * cookie-attribute-list". Therefore, in this implementation, we overwrite
139543 * the previous value.
139544 */
139545 var cookie_avs = unparsed.split(';');
139546 while (cookie_avs.length) {
139547 var av = cookie_avs.shift().trim();
139548 if (av.length === 0) { // happens if ";;" appears
139549 continue;
139550 }
139551 var av_sep = av.indexOf('=');
139552 var av_key, av_value;
139553
139554 if (av_sep === -1) {
139555 av_key = av;
139556 av_value = null;
139557 } else {
139558 av_key = av.substr(0,av_sep);
139559 av_value = av.substr(av_sep+1);
139560 }
139561
139562 av_key = av_key.trim().toLowerCase();
139563
139564 if (av_value) {
139565 av_value = av_value.trim();
139566 }
139567
139568 switch(av_key) {
139569 case 'expires': // S5.2.1
139570 if (av_value) {
139571 var exp = parseDate(av_value);
139572 // "If the attribute-value failed to parse as a cookie date, ignore the
139573 // cookie-av."
139574 if (exp) {
139575 // over and underflow not realistically a concern: V8's getTime() seems to
139576 // store something larger than a 32-bit time_t (even with 32-bit node)
139577 c.expires = exp;
139578 }
139579 }
139580 break;
139581
139582 case 'max-age': // S5.2.2
139583 if (av_value) {
139584 // "If the first character of the attribute-value is not a DIGIT or a "-"
139585 // character ...[or]... If the remainder of attribute-value contains a
139586 // non-DIGIT character, ignore the cookie-av."
139587 if (/^-?[0-9]+$/.test(av_value)) {
139588 var delta = parseInt(av_value, 10);
139589 // "If delta-seconds is less than or equal to zero (0), let expiry-time
139590 // be the earliest representable date and time."
139591 c.setMaxAge(delta);
139592 }
139593 }
139594 break;
139595
139596 case 'domain': // S5.2.3
139597 // "If the attribute-value is empty, the behavior is undefined. However,
139598 // the user agent SHOULD ignore the cookie-av entirely."
139599 if (av_value) {
139600 // S5.2.3 "Let cookie-domain be the attribute-value without the leading %x2E
139601 // (".") character."
139602 var domain = av_value.trim().replace(/^\./, '');
139603 if (domain) {
139604 // "Convert the cookie-domain to lower case."
139605 c.domain = domain.toLowerCase();
139606 }
139607 }
139608 break;
139609
139610 case 'path': // S5.2.4
139611 /*
139612 * "If the attribute-value is empty or if the first character of the
139613 * attribute-value is not %x2F ("/"):
139614 * Let cookie-path be the default-path.
139615 * Otherwise:
139616 * Let cookie-path be the attribute-value."
139617 *
139618 * We'll represent the default-path as null since it depends on the
139619 * context of the parsing.
139620 */
139621 c.path = av_value && av_value[0] === "/" ? av_value : null;
139622 break;
139623
139624 case 'secure': // S5.2.5
139625 /*
139626 * "If the attribute-name case-insensitively matches the string "Secure",
139627 * the user agent MUST append an attribute to the cookie-attribute-list
139628 * with an attribute-name of Secure and an empty attribute-value."
139629 */
139630 c.secure = true;
139631 break;
139632
139633 case 'httponly': // S5.2.6 -- effectively the same as 'secure'
139634 c.httpOnly = true;
139635 break;
139636
139637 default:
139638 c.extensions = c.extensions || [];
139639 c.extensions.push(av);
139640 break;
139641 }
139642 }
139643
139644 return c;
139645}
139646
139647// avoid the V8 deoptimization monster!
139648function jsonParse(str) {
139649 var obj;
139650 try {
139651 obj = JSON.parse(str);
139652 } catch (e) {
139653 return e;
139654 }
139655 return obj;
139656}
139657
139658function fromJSON(str) {
139659 if (!str) {
139660 return null;
139661 }
139662
139663 var obj;
139664 if (typeof str === 'string') {
139665 obj = jsonParse(str);
139666 if (obj instanceof Error) {
139667 return null;
139668 }
139669 } else {
139670 // assume it's an Object
139671 obj = str;
139672 }
139673
139674 var c = new Cookie();
139675 for (var i=0; i<Cookie.serializableProperties.length; i++) {
139676 var prop = Cookie.serializableProperties[i];
139677 if (obj[prop] === undefined ||
139678 obj[prop] === Cookie.prototype[prop])
139679 {
139680 continue; // leave as prototype default
139681 }
139682
139683 if (prop === 'expires' ||
139684 prop === 'creation' ||
139685 prop === 'lastAccessed')
139686 {
139687 if (obj[prop] === null) {
139688 c[prop] = null;
139689 } else {
139690 c[prop] = obj[prop] == "Infinity" ?
139691 "Infinity" : new Date(obj[prop]);
139692 }
139693 } else {
139694 c[prop] = obj[prop];
139695 }
139696 }
139697
139698 return c;
139699}
139700
139701/* Section 5.4 part 2:
139702 * "* Cookies with longer paths are listed before cookies with
139703 * shorter paths.
139704 *
139705 * * Among cookies that have equal-length path fields, cookies with
139706 * earlier creation-times are listed before cookies with later
139707 * creation-times."
139708 */
139709
139710function cookieCompare(a,b) {
139711 var cmp = 0;
139712
139713 // descending for length: b CMP a
139714 var aPathLen = a.path ? a.path.length : 0;
139715 var bPathLen = b.path ? b.path.length : 0;
139716 cmp = bPathLen - aPathLen;
139717 if (cmp !== 0) {
139718 return cmp;
139719 }
139720
139721 // ascending for time: a CMP b
139722 var aTime = a.creation ? a.creation.getTime() : MAX_TIME;
139723 var bTime = b.creation ? b.creation.getTime() : MAX_TIME;
139724 cmp = aTime - bTime;
139725 if (cmp !== 0) {
139726 return cmp;
139727 }
139728
139729 // break ties for the same millisecond (precision of JavaScript's clock)
139730 cmp = a.creationIndex - b.creationIndex;
139731
139732 return cmp;
139733}
139734
139735// Gives the permutation of all possible pathMatch()es of a given path. The
139736// array is in longest-to-shortest order. Handy for indexing.
139737function permutePath(path) {
139738 if (path === '/') {
139739 return ['/'];
139740 }
139741 if (path.lastIndexOf('/') === path.length-1) {
139742 path = path.substr(0,path.length-1);
139743 }
139744 var permutations = [path];
139745 while (path.length > 1) {
139746 var lindex = path.lastIndexOf('/');
139747 if (lindex === 0) {
139748 break;
139749 }
139750 path = path.substr(0,lindex);
139751 permutations.push(path);
139752 }
139753 permutations.push('/');
139754 return permutations;
139755}
139756
139757function getCookieContext(url) {
139758 if (url instanceof Object) {
139759 return url;
139760 }
139761 // NOTE: decodeURI will throw on malformed URIs (see GH-32).
139762 // Therefore, we will just skip decoding for such URIs.
139763 try {
139764 url = decodeURI(url);
139765 }
139766 catch(err) {
139767 // Silently swallow error
139768 }
139769
139770 return urlParse(url);
139771}
139772
139773function Cookie(options) {
139774 options = options || {};
139775
139776 Object.keys(options).forEach(function(prop) {
139777 if (Cookie.prototype.hasOwnProperty(prop) &&
139778 Cookie.prototype[prop] !== options[prop] &&
139779 prop.substr(0,1) !== '_')
139780 {
139781 this[prop] = options[prop];
139782 }
139783 }, this);
139784
139785 this.creation = this.creation || new Date();
139786
139787 // used to break creation ties in cookieCompare():
139788 Object.defineProperty(this, 'creationIndex', {
139789 configurable: false,
139790 enumerable: false, // important for assert.deepEqual checks
139791 writable: true,
139792 value: ++Cookie.cookiesCreated
139793 });
139794}
139795
139796Cookie.cookiesCreated = 0; // incremented each time a cookie is created
139797
139798Cookie.parse = parse;
139799Cookie.fromJSON = fromJSON;
139800
139801Cookie.prototype.key = "";
139802Cookie.prototype.value = "";
139803
139804// the order in which the RFC has them:
139805Cookie.prototype.expires = "Infinity"; // coerces to literal Infinity
139806Cookie.prototype.maxAge = null; // takes precedence over expires for TTL
139807Cookie.prototype.domain = null;
139808Cookie.prototype.path = null;
139809Cookie.prototype.secure = false;
139810Cookie.prototype.httpOnly = false;
139811Cookie.prototype.extensions = null;
139812
139813// set by the CookieJar:
139814Cookie.prototype.hostOnly = null; // boolean when set
139815Cookie.prototype.pathIsDefault = null; // boolean when set
139816Cookie.prototype.creation = null; // Date when set; defaulted by Cookie.parse
139817Cookie.prototype.lastAccessed = null; // Date when set
139818Object.defineProperty(Cookie.prototype, 'creationIndex', {
139819 configurable: true,
139820 enumerable: false,
139821 writable: true,
139822 value: 0
139823});
139824
139825Cookie.serializableProperties = Object.keys(Cookie.prototype)
139826 .filter(function(prop) {
139827 return !(
139828 Cookie.prototype[prop] instanceof Function ||
139829 prop === 'creationIndex' ||
139830 prop.substr(0,1) === '_'
139831 );
139832 });
139833
139834Cookie.prototype.inspect = function inspect() {
139835 var now = Date.now();
139836 return 'Cookie="'+this.toString() +
139837 '; hostOnly='+(this.hostOnly != null ? this.hostOnly : '?') +
139838 '; aAge='+(this.lastAccessed ? (now-this.lastAccessed.getTime())+'ms' : '?') +
139839 '; cAge='+(this.creation ? (now-this.creation.getTime())+'ms' : '?') +
139840 '"';
139841};
139842
139843Cookie.prototype.toJSON = function() {
139844 var obj = {};
139845
139846 var props = Cookie.serializableProperties;
139847 for (var i=0; i<props.length; i++) {
139848 var prop = props[i];
139849 if (this[prop] === Cookie.prototype[prop]) {
139850 continue; // leave as prototype default
139851 }
139852
139853 if (prop === 'expires' ||
139854 prop === 'creation' ||
139855 prop === 'lastAccessed')
139856 {
139857 if (this[prop] === null) {
139858 obj[prop] = null;
139859 } else {
139860 obj[prop] = this[prop] == "Infinity" ? // intentionally not ===
139861 "Infinity" : this[prop].toISOString();
139862 }
139863 } else if (prop === 'maxAge') {
139864 if (this[prop] !== null) {
139865 // again, intentionally not ===
139866 obj[prop] = (this[prop] == Infinity || this[prop] == -Infinity) ?
139867 this[prop].toString() : this[prop];
139868 }
139869 } else {
139870 if (this[prop] !== Cookie.prototype[prop]) {
139871 obj[prop] = this[prop];
139872 }
139873 }
139874 }
139875
139876 return obj;
139877};
139878
139879Cookie.prototype.clone = function() {
139880 return fromJSON(this.toJSON());
139881};
139882
139883Cookie.prototype.validate = function validate() {
139884 if (!COOKIE_OCTETS.test(this.value)) {
139885 return false;
139886 }
139887 if (this.expires != Infinity && !(this.expires instanceof Date) && !parseDate(this.expires)) {
139888 return false;
139889 }
139890 if (this.maxAge != null && this.maxAge <= 0) {
139891 return false; // "Max-Age=" non-zero-digit *DIGIT
139892 }
139893 if (this.path != null && !PATH_VALUE.test(this.path)) {
139894 return false;
139895 }
139896
139897 var cdomain = this.cdomain();
139898 if (cdomain) {
139899 if (cdomain.match(/\.$/)) {
139900 return false; // S4.1.2.3 suggests that this is bad. domainMatch() tests confirm this
139901 }
139902 var suffix = pubsuffix.getPublicSuffix(cdomain);
139903 if (suffix == null) { // it's a public suffix
139904 return false;
139905 }
139906 }
139907 return true;
139908};
139909
139910Cookie.prototype.setExpires = function setExpires(exp) {
139911 if (exp instanceof Date) {
139912 this.expires = exp;
139913 } else {
139914 this.expires = parseDate(exp) || "Infinity";
139915 }
139916};
139917
139918Cookie.prototype.setMaxAge = function setMaxAge(age) {
139919 if (age === Infinity || age === -Infinity) {
139920 this.maxAge = age.toString(); // so JSON.stringify() works
139921 } else {
139922 this.maxAge = age;
139923 }
139924};
139925
139926// gives Cookie header format
139927Cookie.prototype.cookieString = function cookieString() {
139928 var val = this.value;
139929 if (val == null) {
139930 val = '';
139931 }
139932 if (this.key === '') {
139933 return val;
139934 }
139935 return this.key+'='+val;
139936};
139937
139938// gives Set-Cookie header format
139939Cookie.prototype.toString = function toString() {
139940 var str = this.cookieString();
139941
139942 if (this.expires != Infinity) {
139943 if (this.expires instanceof Date) {
139944 str += '; Expires='+formatDate(this.expires);
139945 } else {
139946 str += '; Expires='+this.expires;
139947 }
139948 }
139949
139950 if (this.maxAge != null && this.maxAge != Infinity) {
139951 str += '; Max-Age='+this.maxAge;
139952 }
139953
139954 if (this.domain && !this.hostOnly) {
139955 str += '; Domain='+this.domain;
139956 }
139957 if (this.path) {
139958 str += '; Path='+this.path;
139959 }
139960
139961 if (this.secure) {
139962 str += '; Secure';
139963 }
139964 if (this.httpOnly) {
139965 str += '; HttpOnly';
139966 }
139967 if (this.extensions) {
139968 this.extensions.forEach(function(ext) {
139969 str += '; '+ext;
139970 });
139971 }
139972
139973 return str;
139974};
139975
139976// TTL() partially replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
139977// elsewhere)
139978// S5.3 says to give the "latest representable date" for which we use Infinity
139979// For "expired" we use 0
139980Cookie.prototype.TTL = function TTL(now) {
139981 /* RFC6265 S4.1.2.2 If a cookie has both the Max-Age and the Expires
139982 * attribute, the Max-Age attribute has precedence and controls the
139983 * expiration date of the cookie.
139984 * (Concurs with S5.3 step 3)
139985 */
139986 if (this.maxAge != null) {
139987 return this.maxAge<=0 ? 0 : this.maxAge*1000;
139988 }
139989
139990 var expires = this.expires;
139991 if (expires != Infinity) {
139992 if (!(expires instanceof Date)) {
139993 expires = parseDate(expires) || Infinity;
139994 }
139995
139996 if (expires == Infinity) {
139997 return Infinity;
139998 }
139999
140000 return expires.getTime() - (now || Date.now());
140001 }
140002
140003 return Infinity;
140004};
140005
140006// expiryTime() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
140007// elsewhere)
140008Cookie.prototype.expiryTime = function expiryTime(now) {
140009 if (this.maxAge != null) {
140010 var relativeTo = now || this.creation || new Date();
140011 var age = (this.maxAge <= 0) ? -Infinity : this.maxAge*1000;
140012 return relativeTo.getTime() + age;
140013 }
140014
140015 if (this.expires == Infinity) {
140016 return Infinity;
140017 }
140018 return this.expires.getTime();
140019};
140020
140021// expiryDate() replaces the "expiry-time" parts of S5.3 step 3 (setCookie()
140022// elsewhere), except it returns a Date
140023Cookie.prototype.expiryDate = function expiryDate(now) {
140024 var millisec = this.expiryTime(now);
140025 if (millisec == Infinity) {
140026 return new Date(MAX_TIME);
140027 } else if (millisec == -Infinity) {
140028 return new Date(MIN_TIME);
140029 } else {
140030 return new Date(millisec);
140031 }
140032};
140033
140034// This replaces the "persistent-flag" parts of S5.3 step 3
140035Cookie.prototype.isPersistent = function isPersistent() {
140036 return (this.maxAge != null || this.expires != Infinity);
140037};
140038
140039// Mostly S5.1.2 and S5.2.3:
140040Cookie.prototype.cdomain =
140041Cookie.prototype.canonicalizedDomain = function canonicalizedDomain() {
140042 if (this.domain == null) {
140043 return null;
140044 }
140045 return canonicalDomain(this.domain);
140046};
140047
140048function CookieJar(store, options) {
140049 if (typeof options === "boolean") {
140050 options = {rejectPublicSuffixes: options};
140051 } else if (options == null) {
140052 options = {};
140053 }
140054 if (options.rejectPublicSuffixes != null) {
140055 this.rejectPublicSuffixes = options.rejectPublicSuffixes;
140056 }
140057 if (options.looseMode != null) {
140058 this.enableLooseMode = options.looseMode;
140059 }
140060
140061 if (!store) {
140062 store = new MemoryCookieStore();
140063 }
140064 this.store = store;
140065}
140066CookieJar.prototype.store = null;
140067CookieJar.prototype.rejectPublicSuffixes = true;
140068CookieJar.prototype.enableLooseMode = false;
140069var CAN_BE_SYNC = [];
140070
140071CAN_BE_SYNC.push('setCookie');
140072CookieJar.prototype.setCookie = function(cookie, url, options, cb) {
140073 var err;
140074 var context = getCookieContext(url);
140075 if (options instanceof Function) {
140076 cb = options;
140077 options = {};
140078 }
140079
140080 var host = canonicalDomain(context.hostname);
140081 var loose = this.enableLooseMode;
140082 if (options.loose != null) {
140083 loose = options.loose;
140084 }
140085
140086 // S5.3 step 1
140087 if (!(cookie instanceof Cookie)) {
140088 cookie = Cookie.parse(cookie, { loose: loose });
140089 }
140090 if (!cookie) {
140091 err = new Error("Cookie failed to parse");
140092 return cb(options.ignoreError ? null : err);
140093 }
140094
140095 // S5.3 step 2
140096 var now = options.now || new Date(); // will assign later to save effort in the face of errors
140097
140098 // S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie()
140099
140100 // S5.3 step 4: NOOP; domain is null by default
140101
140102 // S5.3 step 5: public suffixes
140103 if (this.rejectPublicSuffixes && cookie.domain) {
140104 var suffix = pubsuffix.getPublicSuffix(cookie.cdomain());
140105 if (suffix == null) { // e.g. "com"
140106 err = new Error("Cookie has domain set to a public suffix");
140107 return cb(options.ignoreError ? null : err);
140108 }
140109 }
140110
140111 // S5.3 step 6:
140112 if (cookie.domain) {
140113 if (!domainMatch(host, cookie.cdomain(), false)) {
140114 err = new Error("Cookie not in this host's domain. Cookie:"+cookie.cdomain()+" Request:"+host);
140115 return cb(options.ignoreError ? null : err);
140116 }
140117
140118 if (cookie.hostOnly == null) { // don't reset if already set
140119 cookie.hostOnly = false;
140120 }
140121
140122 } else {
140123 cookie.hostOnly = true;
140124 cookie.domain = host;
140125 }
140126
140127 //S5.2.4 If the attribute-value is empty or if the first character of the
140128 //attribute-value is not %x2F ("/"):
140129 //Let cookie-path be the default-path.
140130 if (!cookie.path || cookie.path[0] !== '/') {
140131 cookie.path = defaultPath(context.pathname);
140132 cookie.pathIsDefault = true;
140133 }
140134
140135 // S5.3 step 8: NOOP; secure attribute
140136 // S5.3 step 9: NOOP; httpOnly attribute
140137
140138 // S5.3 step 10
140139 if (options.http === false && cookie.httpOnly) {
140140 err = new Error("Cookie is HttpOnly and this isn't an HTTP API");
140141 return cb(options.ignoreError ? null : err);
140142 }
140143
140144 var store = this.store;
140145
140146 if (!store.updateCookie) {
140147 store.updateCookie = function(oldCookie, newCookie, cb) {
140148 this.putCookie(newCookie, cb);
140149 };
140150 }
140151
140152 function withCookie(err, oldCookie) {
140153 if (err) {
140154 return cb(err);
140155 }
140156
140157 var next = function(err) {
140158 if (err) {
140159 return cb(err);
140160 } else {
140161 cb(null, cookie);
140162 }
140163 };
140164
140165 if (oldCookie) {
140166 // S5.3 step 11 - "If the cookie store contains a cookie with the same name,
140167 // domain, and path as the newly created cookie:"
140168 if (options.http === false && oldCookie.httpOnly) { // step 11.2
140169 err = new Error("old Cookie is HttpOnly and this isn't an HTTP API");
140170 return cb(options.ignoreError ? null : err);
140171 }
140172 cookie.creation = oldCookie.creation; // step 11.3
140173 cookie.creationIndex = oldCookie.creationIndex; // preserve tie-breaker
140174 cookie.lastAccessed = now;
140175 // Step 11.4 (delete cookie) is implied by just setting the new one:
140176 store.updateCookie(oldCookie, cookie, next); // step 12
140177
140178 } else {
140179 cookie.creation = cookie.lastAccessed = now;
140180 store.putCookie(cookie, next); // step 12
140181 }
140182 }
140183
140184 store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);
140185};
140186
140187// RFC6365 S5.4
140188CAN_BE_SYNC.push('getCookies');
140189CookieJar.prototype.getCookies = function(url, options, cb) {
140190 var context = getCookieContext(url);
140191 if (options instanceof Function) {
140192 cb = options;
140193 options = {};
140194 }
140195
140196 var host = canonicalDomain(context.hostname);
140197 var path = context.pathname || '/';
140198
140199 var secure = options.secure;
140200 if (secure == null && context.protocol &&
140201 (context.protocol == 'https:' || context.protocol == 'wss:'))
140202 {
140203 secure = true;
140204 }
140205
140206 var http = options.http;
140207 if (http == null) {
140208 http = true;
140209 }
140210
140211 var now = options.now || Date.now();
140212 var expireCheck = options.expire !== false;
140213 var allPaths = !!options.allPaths;
140214 var store = this.store;
140215
140216 function matchingCookie(c) {
140217 // "Either:
140218 // The cookie's host-only-flag is true and the canonicalized
140219 // request-host is identical to the cookie's domain.
140220 // Or:
140221 // The cookie's host-only-flag is false and the canonicalized
140222 // request-host domain-matches the cookie's domain."
140223 if (c.hostOnly) {
140224 if (c.domain != host) {
140225 return false;
140226 }
140227 } else {
140228 if (!domainMatch(host, c.domain, false)) {
140229 return false;
140230 }
140231 }
140232
140233 // "The request-uri's path path-matches the cookie's path."
140234 if (!allPaths && !pathMatch(path, c.path)) {
140235 return false;
140236 }
140237
140238 // "If the cookie's secure-only-flag is true, then the request-uri's
140239 // scheme must denote a "secure" protocol"
140240 if (c.secure && !secure) {
140241 return false;
140242 }
140243
140244 // "If the cookie's http-only-flag is true, then exclude the cookie if the
140245 // cookie-string is being generated for a "non-HTTP" API"
140246 if (c.httpOnly && !http) {
140247 return false;
140248 }
140249
140250 // deferred from S5.3
140251 // non-RFC: allow retention of expired cookies by choice
140252 if (expireCheck && c.expiryTime() <= now) {
140253 store.removeCookie(c.domain, c.path, c.key, function(){}); // result ignored
140254 return false;
140255 }
140256
140257 return true;
140258 }
140259
140260 store.findCookies(host, allPaths ? null : path, function(err,cookies) {
140261 if (err) {
140262 return cb(err);
140263 }
140264
140265 cookies = cookies.filter(matchingCookie);
140266
140267 // sorting of S5.4 part 2
140268 if (options.sort !== false) {
140269 cookies = cookies.sort(cookieCompare);
140270 }
140271
140272 // S5.4 part 3
140273 var now = new Date();
140274 cookies.forEach(function(c) {
140275 c.lastAccessed = now;
140276 });
140277 // TODO persist lastAccessed
140278
140279 cb(null,cookies);
140280 });
140281};
140282
140283CAN_BE_SYNC.push('getCookieString');
140284CookieJar.prototype.getCookieString = function(/*..., cb*/) {
140285 var args = Array.prototype.slice.call(arguments,0);
140286 var cb = args.pop();
140287 var next = function(err,cookies) {
140288 if (err) {
140289 cb(err);
140290 } else {
140291 cb(null, cookies
140292 .sort(cookieCompare)
140293 .map(function(c){
140294 return c.cookieString();
140295 })
140296 .join('; '));
140297 }
140298 };
140299 args.push(next);
140300 this.getCookies.apply(this,args);
140301};
140302
140303CAN_BE_SYNC.push('getSetCookieStrings');
140304CookieJar.prototype.getSetCookieStrings = function(/*..., cb*/) {
140305 var args = Array.prototype.slice.call(arguments,0);
140306 var cb = args.pop();
140307 var next = function(err,cookies) {
140308 if (err) {
140309 cb(err);
140310 } else {
140311 cb(null, cookies.map(function(c){
140312 return c.toString();
140313 }));
140314 }
140315 };
140316 args.push(next);
140317 this.getCookies.apply(this,args);
140318};
140319
140320CAN_BE_SYNC.push('serialize');
140321CookieJar.prototype.serialize = function(cb) {
140322 var type = this.store.constructor.name;
140323 if (type === 'Object') {
140324 type = null;
140325 }
140326
140327 // update README.md "Serialization Format" if you change this, please!
140328 var serialized = {
140329 // The version of tough-cookie that serialized this jar. Generally a good
140330 // practice since future versions can make data import decisions based on
140331 // known past behavior. When/if this matters, use `semver`.
140332 version: 'tough-cookie@'+VERSION,
140333
140334 // add the store type, to make humans happy:
140335 storeType: type,
140336
140337 // CookieJar configuration:
140338 rejectPublicSuffixes: !!this.rejectPublicSuffixes,
140339
140340 // this gets filled from getAllCookies:
140341 cookies: []
140342 };
140343
140344 if (!(this.store.getAllCookies &&
140345 typeof this.store.getAllCookies === 'function'))
140346 {
140347 return cb(new Error('store does not support getAllCookies and cannot be serialized'));
140348 }
140349
140350 this.store.getAllCookies(function(err,cookies) {
140351 if (err) {
140352 return cb(err);
140353 }
140354
140355 serialized.cookies = cookies.map(function(cookie) {
140356 // convert to serialized 'raw' cookies
140357 cookie = (cookie instanceof Cookie) ? cookie.toJSON() : cookie;
140358
140359 // Remove the index so new ones get assigned during deserialization
140360 delete cookie.creationIndex;
140361
140362 return cookie;
140363 });
140364
140365 return cb(null, serialized);
140366 });
140367};
140368
140369// well-known name that JSON.stringify calls
140370CookieJar.prototype.toJSON = function() {
140371 return this.serializeSync();
140372};
140373
140374// use the class method CookieJar.deserialize instead of calling this directly
140375CAN_BE_SYNC.push('_importCookies');
140376CookieJar.prototype._importCookies = function(serialized, cb) {
140377 var jar = this;
140378 var cookies = serialized.cookies;
140379 if (!cookies || !Array.isArray(cookies)) {
140380 return cb(new Error('serialized jar has no cookies array'));
140381 }
140382 cookies = cookies.slice(); // do not modify the original
140383
140384 function putNext(err) {
140385 if (err) {
140386 return cb(err);
140387 }
140388
140389 if (!cookies.length) {
140390 return cb(err, jar);
140391 }
140392
140393 var cookie;
140394 try {
140395 cookie = fromJSON(cookies.shift());
140396 } catch (e) {
140397 return cb(e);
140398 }
140399
140400 if (cookie === null) {
140401 return putNext(null); // skip this cookie
140402 }
140403
140404 jar.store.putCookie(cookie, putNext);
140405 }
140406
140407 putNext();
140408};
140409
140410CookieJar.deserialize = function(strOrObj, store, cb) {
140411 if (arguments.length !== 3) {
140412 // store is optional
140413 cb = store;
140414 store = null;
140415 }
140416
140417 var serialized;
140418 if (typeof strOrObj === 'string') {
140419 serialized = jsonParse(strOrObj);
140420 if (serialized instanceof Error) {
140421 return cb(serialized);
140422 }
140423 } else {
140424 serialized = strOrObj;
140425 }
140426
140427 var jar = new CookieJar(store, serialized.rejectPublicSuffixes);
140428 jar._importCookies(serialized, function(err) {
140429 if (err) {
140430 return cb(err);
140431 }
140432 cb(null, jar);
140433 });
140434};
140435
140436CookieJar.deserializeSync = function(strOrObj, store) {
140437 var serialized = typeof strOrObj === 'string' ?
140438 JSON.parse(strOrObj) : strOrObj;
140439 var jar = new CookieJar(store, serialized.rejectPublicSuffixes);
140440
140441 // catch this mistake early:
140442 if (!jar.store.synchronous) {
140443 throw new Error('CookieJar store is not synchronous; use async API instead.');
140444 }
140445
140446 jar._importCookiesSync(serialized);
140447 return jar;
140448};
140449CookieJar.fromJSON = CookieJar.deserializeSync;
140450
140451CAN_BE_SYNC.push('clone');
140452CookieJar.prototype.clone = function(newStore, cb) {
140453 if (arguments.length === 1) {
140454 cb = newStore;
140455 newStore = null;
140456 }
140457
140458 this.serialize(function(err,serialized) {
140459 if (err) {
140460 return cb(err);
140461 }
140462 CookieJar.deserialize(newStore, serialized, cb);
140463 });
140464};
140465
140466// Use a closure to provide a true imperative API for synchronous stores.
140467function syncWrap(method) {
140468 return function() {
140469 if (!this.store.synchronous) {
140470 throw new Error('CookieJar store is not synchronous; use async API instead.');
140471 }
140472
140473 var args = Array.prototype.slice.call(arguments);
140474 var syncErr, syncResult;
140475 args.push(function syncCb(err, result) {
140476 syncErr = err;
140477 syncResult = result;
140478 });
140479 this[method].apply(this, args);
140480
140481 if (syncErr) {
140482 throw syncErr;
140483 }
140484 return syncResult;
140485 };
140486}
140487
140488// wrap all declared CAN_BE_SYNC methods in the sync wrapper
140489CAN_BE_SYNC.forEach(function(method) {
140490 CookieJar.prototype[method+'Sync'] = syncWrap(method);
140491});
140492
140493module.exports = {
140494 CookieJar: CookieJar,
140495 Cookie: Cookie,
140496 Store: Store,
140497 MemoryCookieStore: MemoryCookieStore,
140498 parseDate: parseDate,
140499 formatDate: formatDate,
140500 parse: parse,
140501 fromJSON: fromJSON,
140502 domainMatch: domainMatch,
140503 defaultPath: defaultPath,
140504 pathMatch: pathMatch,
140505 getPublicSuffix: pubsuffix.getPublicSuffix,
140506 cookieCompare: cookieCompare,
140507 permuteDomain: __webpack_require__(384).permuteDomain,
140508 permutePath: permutePath,
140509 canonicalDomain: canonicalDomain
140510};
140511
140512
140513/***/ }),
140514/* 883 */
140515/***/ (function(module, exports, __webpack_require__) {
140516
140517"use strict";
140518/*!
140519 * Copyright (c) 2015, Salesforce.com, Inc.
140520 * All rights reserved.
140521 *
140522 * Redistribution and use in source and binary forms, with or without
140523 * modification, are permitted provided that the following conditions are met:
140524 *
140525 * 1. Redistributions of source code must retain the above copyright notice,
140526 * this list of conditions and the following disclaimer.
140527 *
140528 * 2. Redistributions in binary form must reproduce the above copyright notice,
140529 * this list of conditions and the following disclaimer in the documentation
140530 * and/or other materials provided with the distribution.
140531 *
140532 * 3. Neither the name of Salesforce.com nor the names of its contributors may
140533 * be used to endorse or promote products derived from this software without
140534 * specific prior written permission.
140535 *
140536 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
140537 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
140538 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
140539 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
140540 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
140541 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
140542 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
140543 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
140544 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
140545 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
140546 * POSSIBILITY OF SUCH DAMAGE.
140547 */
140548
140549var Store = __webpack_require__(386).Store;
140550var permuteDomain = __webpack_require__(384).permuteDomain;
140551var pathMatch = __webpack_require__(383).pathMatch;
140552var util = __webpack_require__(9);
140553
140554function MemoryCookieStore() {
140555 Store.call(this);
140556 this.idx = {};
140557}
140558util.inherits(MemoryCookieStore, Store);
140559exports.MemoryCookieStore = MemoryCookieStore;
140560MemoryCookieStore.prototype.idx = null;
140561
140562// Since it's just a struct in RAM, this Store is synchronous
140563MemoryCookieStore.prototype.synchronous = true;
140564
140565// force a default depth:
140566MemoryCookieStore.prototype.inspect = function() {
140567 return "{ idx: "+util.inspect(this.idx, false, 2)+' }';
140568};
140569
140570MemoryCookieStore.prototype.findCookie = function(domain, path, key, cb) {
140571 if (!this.idx[domain]) {
140572 return cb(null,undefined);
140573 }
140574 if (!this.idx[domain][path]) {
140575 return cb(null,undefined);
140576 }
140577 return cb(null,this.idx[domain][path][key]||null);
140578};
140579
140580MemoryCookieStore.prototype.findCookies = function(domain, path, cb) {
140581 var results = [];
140582 if (!domain) {
140583 return cb(null,[]);
140584 }
140585
140586 var pathMatcher;
140587 if (!path) {
140588 // null means "all paths"
140589 pathMatcher = function matchAll(domainIndex) {
140590 for (var curPath in domainIndex) {
140591 var pathIndex = domainIndex[curPath];
140592 for (var key in pathIndex) {
140593 results.push(pathIndex[key]);
140594 }
140595 }
140596 };
140597
140598 } else {
140599 pathMatcher = function matchRFC(domainIndex) {
140600 //NOTE: we should use path-match algorithm from S5.1.4 here
140601 //(see : https://github.com/ChromiumWebApps/chromium/blob/b3d3b4da8bb94c1b2e061600df106d590fda3620/net/cookies/canonical_cookie.cc#L299)
140602 Object.keys(domainIndex).forEach(function (cookiePath) {
140603 if (pathMatch(path, cookiePath)) {
140604 var pathIndex = domainIndex[cookiePath];
140605
140606 for (var key in pathIndex) {
140607 results.push(pathIndex[key]);
140608 }
140609 }
140610 });
140611 };
140612 }
140613
140614 var domains = permuteDomain(domain) || [domain];
140615 var idx = this.idx;
140616 domains.forEach(function(curDomain) {
140617 var domainIndex = idx[curDomain];
140618 if (!domainIndex) {
140619 return;
140620 }
140621 pathMatcher(domainIndex);
140622 });
140623
140624 cb(null,results);
140625};
140626
140627MemoryCookieStore.prototype.putCookie = function(cookie, cb) {
140628 if (!this.idx[cookie.domain]) {
140629 this.idx[cookie.domain] = {};
140630 }
140631 if (!this.idx[cookie.domain][cookie.path]) {
140632 this.idx[cookie.domain][cookie.path] = {};
140633 }
140634 this.idx[cookie.domain][cookie.path][cookie.key] = cookie;
140635 cb(null);
140636};
140637
140638MemoryCookieStore.prototype.updateCookie = function(oldCookie, newCookie, cb) {
140639 // updateCookie() may avoid updating cookies that are identical. For example,
140640 // lastAccessed may not be important to some stores and an equality
140641 // comparison could exclude that field.
140642 this.putCookie(newCookie,cb);
140643};
140644
140645MemoryCookieStore.prototype.removeCookie = function(domain, path, key, cb) {
140646 if (this.idx[domain] && this.idx[domain][path] && this.idx[domain][path][key]) {
140647 delete this.idx[domain][path][key];
140648 }
140649 cb(null);
140650};
140651
140652MemoryCookieStore.prototype.removeCookies = function(domain, path, cb) {
140653 if (this.idx[domain]) {
140654 if (path) {
140655 delete this.idx[domain][path];
140656 } else {
140657 delete this.idx[domain];
140658 }
140659 }
140660 return cb(null);
140661};
140662
140663MemoryCookieStore.prototype.getAllCookies = function(cb) {
140664 var cookies = [];
140665 var idx = this.idx;
140666
140667 var domains = Object.keys(idx);
140668 domains.forEach(function(domain) {
140669 var paths = Object.keys(idx[domain]);
140670 paths.forEach(function(path) {
140671 var keys = Object.keys(idx[domain][path]);
140672 keys.forEach(function(key) {
140673 if (key !== null) {
140674 cookies.push(idx[domain][path][key]);
140675 }
140676 });
140677 });
140678 });
140679
140680 // Sort by creationIndex so deserializing retains the creation order.
140681 // When implementing your own store, this SHOULD retain the order too
140682 cookies.sort(function(a,b) {
140683 return (a.creationIndex||0) - (b.creationIndex||0);
140684 });
140685
140686 cb(null, cookies);
140687};
140688
140689
140690/***/ }),
140691/* 884 */
140692/***/ (function(module, exports) {
140693
140694module.exports = {"author":{"name":"Jeremy Stashewsky","email":"jstashewsky@salesforce.com","website":"https://github.com/stash"},"contributors":[{"name":"Alexander Savin","website":"https://github.com/apsavin"},{"name":"Ian Livingstone","website":"https://github.com/ianlivingstone"},{"name":"Ivan Nikulin","website":"https://github.com/inikulin"},{"name":"Lalit Kapoor","website":"https://github.com/lalitkapoor"},{"name":"Sam Thompson","website":"https://github.com/sambthompson"},{"name":"Sebastian Mayr","website":"https://github.com/Sebmaster"}],"license":"BSD-3-Clause","name":"tough-cookie","description":"RFC6265 Cookies and Cookie Jar for node.js","keywords":["HTTP","cookie","cookies","set-cookie","cookiejar","jar","RFC6265","RFC2965"],"version":"2.3.4","homepage":"https://github.com/salesforce/tough-cookie","repository":{"type":"git","url":"git://github.com/salesforce/tough-cookie.git"},"bugs":{"url":"https://github.com/salesforce/tough-cookie/issues"},"main":"./lib/cookie","files":["lib"],"scripts":{"suffixup":"curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js","test":"vows test/*_test.js"},"engines":{"node":">=0.8"},"devDependencies":{"async":"^1.4.2","string.prototype.repeat":"^0.2.0","vows":"^0.8.1"},"dependencies":{"punycode":"^1.4.1"}}
140695
140696/***/ }),
140697/* 885 */
140698/***/ (function(module, exports, __webpack_require__) {
140699
140700"use strict";
140701
140702
140703var http = __webpack_require__(83)
140704var https = __webpack_require__(185)
140705var url = __webpack_require__(29)
140706var util = __webpack_require__(9)
140707var stream = __webpack_require__(35)
140708var zlib = __webpack_require__(188)
140709var aws2 = __webpack_require__(462)
140710var aws4 = __webpack_require__(463)
140711var httpSignature = __webpack_require__(741)
140712var mime = __webpack_require__(370)
140713var caseless = __webpack_require__(212)
140714var ForeverAgent = __webpack_require__(672)
140715var FormData = __webpack_require__(673)
140716var extend = __webpack_require__(232)
140717var isstream = __webpack_require__(367)
140718var isTypedArray = __webpack_require__(791).strict
140719var helpers = __webpack_require__(246)
140720var cookies = __webpack_require__(382)
140721var getProxyFromURI = __webpack_require__(874)
140722var Querystring = __webpack_require__(879).Querystring
140723var Har = __webpack_require__(875).Har
140724var Auth = __webpack_require__(873).Auth
140725var OAuth = __webpack_require__(878).OAuth
140726var hawk = __webpack_require__(876)
140727var Multipart = __webpack_require__(877).Multipart
140728var Redirect = __webpack_require__(880).Redirect
140729var Tunnel = __webpack_require__(881).Tunnel
140730var now = __webpack_require__(848)
140731var Buffer = __webpack_require__(60).Buffer
140732
140733var safeStringify = helpers.safeStringify
140734var isReadStream = helpers.isReadStream
140735var toBase64 = helpers.toBase64
140736var defer = helpers.defer
140737var copy = helpers.copy
140738var version = helpers.version
140739var globalCookieJar = cookies.jar()
140740
140741var globalPool = {}
140742
140743function filterForNonReserved (reserved, options) {
140744 // Filter out properties that are not reserved.
140745 // Reserved values are passed in at call site.
140746
140747 var object = {}
140748 for (var i in options) {
140749 var notReserved = (reserved.indexOf(i) === -1)
140750 if (notReserved) {
140751 object[i] = options[i]
140752 }
140753 }
140754 return object
140755}
140756
140757function filterOutReservedFunctions (reserved, options) {
140758 // Filter out properties that are functions and are reserved.
140759 // Reserved values are passed in at call site.
140760
140761 var object = {}
140762 for (var i in options) {
140763 var isReserved = !(reserved.indexOf(i) === -1)
140764 var isFunction = (typeof options[i] === 'function')
140765 if (!(isReserved && isFunction)) {
140766 object[i] = options[i]
140767 }
140768 }
140769 return object
140770}
140771
140772// Return a simpler request object to allow serialization
140773function requestToJSON () {
140774 var self = this
140775 return {
140776 uri: self.uri,
140777 method: self.method,
140778 headers: self.headers
140779 }
140780}
140781
140782// Return a simpler response object to allow serialization
140783function responseToJSON () {
140784 var self = this
140785 return {
140786 statusCode: self.statusCode,
140787 body: self.body,
140788 headers: self.headers,
140789 request: requestToJSON.call(self.request)
140790 }
140791}
140792
140793function Request (options) {
140794 // if given the method property in options, set property explicitMethod to true
140795
140796 // extend the Request instance with any non-reserved properties
140797 // remove any reserved functions from the options object
140798 // set Request instance to be readable and writable
140799 // call init
140800
140801 var self = this
140802
140803 // start with HAR, then override with additional options
140804 if (options.har) {
140805 self._har = new Har(self)
140806 options = self._har.options(options)
140807 }
140808
140809 stream.Stream.call(self)
140810 var reserved = Object.keys(Request.prototype)
140811 var nonReserved = filterForNonReserved(reserved, options)
140812
140813 extend(self, nonReserved)
140814 options = filterOutReservedFunctions(reserved, options)
140815
140816 self.readable = true
140817 self.writable = true
140818 if (options.method) {
140819 self.explicitMethod = true
140820 }
140821 self._qs = new Querystring(self)
140822 self._auth = new Auth(self)
140823 self._oauth = new OAuth(self)
140824 self._multipart = new Multipart(self)
140825 self._redirect = new Redirect(self)
140826 self._tunnel = new Tunnel(self)
140827 self.init(options)
140828}
140829
140830util.inherits(Request, stream.Stream)
140831
140832// Debugging
140833Request.debug = process.env.NODE_DEBUG && /\brequest\b/.test(process.env.NODE_DEBUG)
140834function debug () {
140835 if (Request.debug) {
140836 console.error('REQUEST %s', util.format.apply(util, arguments))
140837 }
140838}
140839Request.prototype.debug = debug
140840
140841Request.prototype.init = function (options) {
140842 // init() contains all the code to setup the request object.
140843 // the actual outgoing request is not started until start() is called
140844 // this function is called from both the constructor and on redirect.
140845 var self = this
140846 if (!options) {
140847 options = {}
140848 }
140849 self.headers = self.headers ? copy(self.headers) : {}
140850
140851 // Delete headers with value undefined since they break
140852 // ClientRequest.OutgoingMessage.setHeader in node 0.12
140853 for (var headerName in self.headers) {
140854 if (typeof self.headers[headerName] === 'undefined') {
140855 delete self.headers[headerName]
140856 }
140857 }
140858
140859 caseless.httpify(self, self.headers)
140860
140861 if (!self.method) {
140862 self.method = options.method || 'GET'
140863 }
140864 if (!self.localAddress) {
140865 self.localAddress = options.localAddress
140866 }
140867
140868 self._qs.init(options)
140869
140870 debug(options)
140871 if (!self.pool && self.pool !== false) {
140872 self.pool = globalPool
140873 }
140874 self.dests = self.dests || []
140875 self.__isRequestRequest = true
140876
140877 // Protect against double callback
140878 if (!self._callback && self.callback) {
140879 self._callback = self.callback
140880 self.callback = function () {
140881 if (self._callbackCalled) {
140882 return // Print a warning maybe?
140883 }
140884 self._callbackCalled = true
140885 self._callback.apply(self, arguments)
140886 }
140887 self.on('error', self.callback.bind())
140888 self.on('complete', self.callback.bind(self, null))
140889 }
140890
140891 // People use this property instead all the time, so support it
140892 if (!self.uri && self.url) {
140893 self.uri = self.url
140894 delete self.url
140895 }
140896
140897 // If there's a baseUrl, then use it as the base URL (i.e. uri must be
140898 // specified as a relative path and is appended to baseUrl).
140899 if (self.baseUrl) {
140900 if (typeof self.baseUrl !== 'string') {
140901 return self.emit('error', new Error('options.baseUrl must be a string'))
140902 }
140903
140904 if (typeof self.uri !== 'string') {
140905 return self.emit('error', new Error('options.uri must be a string when using options.baseUrl'))
140906 }
140907
140908 if (self.uri.indexOf('//') === 0 || self.uri.indexOf('://') !== -1) {
140909 return self.emit('error', new Error('options.uri must be a path when using options.baseUrl'))
140910 }
140911
140912 // Handle all cases to make sure that there's only one slash between
140913 // baseUrl and uri.
140914 var baseUrlEndsWithSlash = self.baseUrl.lastIndexOf('/') === self.baseUrl.length - 1
140915 var uriStartsWithSlash = self.uri.indexOf('/') === 0
140916
140917 if (baseUrlEndsWithSlash && uriStartsWithSlash) {
140918 self.uri = self.baseUrl + self.uri.slice(1)
140919 } else if (baseUrlEndsWithSlash || uriStartsWithSlash) {
140920 self.uri = self.baseUrl + self.uri
140921 } else if (self.uri === '') {
140922 self.uri = self.baseUrl
140923 } else {
140924 self.uri = self.baseUrl + '/' + self.uri
140925 }
140926 delete self.baseUrl
140927 }
140928
140929 // A URI is needed by this point, emit error if we haven't been able to get one
140930 if (!self.uri) {
140931 return self.emit('error', new Error('options.uri is a required argument'))
140932 }
140933
140934 // If a string URI/URL was given, parse it into a URL object
140935 if (typeof self.uri === 'string') {
140936 self.uri = url.parse(self.uri)
140937 }
140938
140939 // Some URL objects are not from a URL parsed string and need href added
140940 if (!self.uri.href) {
140941 self.uri.href = url.format(self.uri)
140942 }
140943
140944 // DEPRECATED: Warning for users of the old Unix Sockets URL Scheme
140945 if (self.uri.protocol === 'unix:') {
140946 return self.emit('error', new Error('`unix://` URL scheme is no longer supported. Please use the format `http://unix:SOCKET:PATH`'))
140947 }
140948
140949 // Support Unix Sockets
140950 if (self.uri.host === 'unix') {
140951 self.enableUnixSocket()
140952 }
140953
140954 if (self.strictSSL === false) {
140955 self.rejectUnauthorized = false
140956 }
140957
140958 if (!self.uri.pathname) { self.uri.pathname = '/' }
140959
140960 if (!(self.uri.host || (self.uri.hostname && self.uri.port)) && !self.uri.isUnix) {
140961 // Invalid URI: it may generate lot of bad errors, like 'TypeError: Cannot call method `indexOf` of undefined' in CookieJar
140962 // Detect and reject it as soon as possible
140963 var faultyUri = url.format(self.uri)
140964 var message = 'Invalid URI "' + faultyUri + '"'
140965 if (Object.keys(options).length === 0) {
140966 // No option ? This can be the sign of a redirect
140967 // As this is a case where the user cannot do anything (they didn't call request directly with this URL)
140968 // they should be warned that it can be caused by a redirection (can save some hair)
140969 message += '. This can be caused by a crappy redirection.'
140970 }
140971 // This error was fatal
140972 self.abort()
140973 return self.emit('error', new Error(message))
140974 }
140975
140976 if (!self.hasOwnProperty('proxy')) {
140977 self.proxy = getProxyFromURI(self.uri)
140978 }
140979
140980 self.tunnel = self._tunnel.isEnabled()
140981 if (self.proxy) {
140982 self._tunnel.setup(options)
140983 }
140984
140985 self._redirect.onRequest(options)
140986
140987 self.setHost = false
140988 if (!self.hasHeader('host')) {
140989 var hostHeaderName = self.originalHostHeaderName || 'host'
140990 // When used with an IPv6 address, `host` will provide
140991 // the correct bracketed format, unlike using `hostname` and
140992 // optionally adding the `port` when necessary.
140993 self.setHeader(hostHeaderName, self.uri.host)
140994 self.setHost = true
140995 }
140996
140997 self.jar(self._jar || options.jar)
140998
140999 if (!self.uri.port) {
141000 if (self.uri.protocol === 'http:') { self.uri.port = 80 } else if (self.uri.protocol === 'https:') { self.uri.port = 443 }
141001 }
141002
141003 if (self.proxy && !self.tunnel) {
141004 self.port = self.proxy.port
141005 self.host = self.proxy.hostname
141006 } else {
141007 self.port = self.uri.port
141008 self.host = self.uri.hostname
141009 }
141010
141011 if (options.form) {
141012 self.form(options.form)
141013 }
141014
141015 if (options.formData) {
141016 var formData = options.formData
141017 var requestForm = self.form()
141018 var appendFormValue = function (key, value) {
141019 if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) {
141020 requestForm.append(key, value.value, value.options)
141021 } else {
141022 requestForm.append(key, value)
141023 }
141024 }
141025 for (var formKey in formData) {
141026 if (formData.hasOwnProperty(formKey)) {
141027 var formValue = formData[formKey]
141028 if (formValue instanceof Array) {
141029 for (var j = 0; j < formValue.length; j++) {
141030 appendFormValue(formKey, formValue[j])
141031 }
141032 } else {
141033 appendFormValue(formKey, formValue)
141034 }
141035 }
141036 }
141037 }
141038
141039 if (options.qs) {
141040 self.qs(options.qs)
141041 }
141042
141043 if (self.uri.path) {
141044 self.path = self.uri.path
141045 } else {
141046 self.path = self.uri.pathname + (self.uri.search || '')
141047 }
141048
141049 if (self.path.length === 0) {
141050 self.path = '/'
141051 }
141052
141053 // Auth must happen last in case signing is dependent on other headers
141054 if (options.aws) {
141055 self.aws(options.aws)
141056 }
141057
141058 if (options.hawk) {
141059 self.hawk(options.hawk)
141060 }
141061
141062 if (options.httpSignature) {
141063 self.httpSignature(options.httpSignature)
141064 }
141065
141066 if (options.auth) {
141067 if (Object.prototype.hasOwnProperty.call(options.auth, 'username')) {
141068 options.auth.user = options.auth.username
141069 }
141070 if (Object.prototype.hasOwnProperty.call(options.auth, 'password')) {
141071 options.auth.pass = options.auth.password
141072 }
141073
141074 self.auth(
141075 options.auth.user,
141076 options.auth.pass,
141077 options.auth.sendImmediately,
141078 options.auth.bearer
141079 )
141080 }
141081
141082 if (self.gzip && !self.hasHeader('accept-encoding')) {
141083 self.setHeader('accept-encoding', 'gzip, deflate')
141084 }
141085
141086 if (self.uri.auth && !self.hasHeader('authorization')) {
141087 var uriAuthPieces = self.uri.auth.split(':').map(function (item) { return self._qs.unescape(item) })
141088 self.auth(uriAuthPieces[0], uriAuthPieces.slice(1).join(':'), true)
141089 }
141090
141091 if (!self.tunnel && self.proxy && self.proxy.auth && !self.hasHeader('proxy-authorization')) {
141092 var proxyAuthPieces = self.proxy.auth.split(':').map(function (item) { return self._qs.unescape(item) })
141093 var authHeader = 'Basic ' + toBase64(proxyAuthPieces.join(':'))
141094 self.setHeader('proxy-authorization', authHeader)
141095 }
141096
141097 if (self.proxy && !self.tunnel) {
141098 self.path = (self.uri.protocol + '//' + self.uri.host + self.path)
141099 }
141100
141101 if (options.json) {
141102 self.json(options.json)
141103 }
141104 if (options.multipart) {
141105 self.multipart(options.multipart)
141106 }
141107
141108 if (options.time) {
141109 self.timing = true
141110
141111 // NOTE: elapsedTime is deprecated in favor of .timings
141112 self.elapsedTime = self.elapsedTime || 0
141113 }
141114
141115 function setContentLength () {
141116 if (isTypedArray(self.body)) {
141117 self.body = Buffer.from(self.body)
141118 }
141119
141120 if (!self.hasHeader('content-length')) {
141121 var length
141122 if (typeof self.body === 'string') {
141123 length = Buffer.byteLength(self.body)
141124 } else if (Array.isArray(self.body)) {
141125 length = self.body.reduce(function (a, b) { return a + b.length }, 0)
141126 } else {
141127 length = self.body.length
141128 }
141129
141130 if (length) {
141131 self.setHeader('content-length', length)
141132 } else {
141133 self.emit('error', new Error('Argument error, options.body.'))
141134 }
141135 }
141136 }
141137 if (self.body && !isstream(self.body)) {
141138 setContentLength()
141139 }
141140
141141 if (options.oauth) {
141142 self.oauth(options.oauth)
141143 } else if (self._oauth.params && self.hasHeader('authorization')) {
141144 self.oauth(self._oauth.params)
141145 }
141146
141147 var protocol = self.proxy && !self.tunnel ? self.proxy.protocol : self.uri.protocol
141148 var defaultModules = {'http:': http, 'https:': https}
141149 var httpModules = self.httpModules || {}
141150
141151 self.httpModule = httpModules[protocol] || defaultModules[protocol]
141152
141153 if (!self.httpModule) {
141154 return self.emit('error', new Error('Invalid protocol: ' + protocol))
141155 }
141156
141157 if (options.ca) {
141158 self.ca = options.ca
141159 }
141160
141161 if (!self.agent) {
141162 if (options.agentOptions) {
141163 self.agentOptions = options.agentOptions
141164 }
141165
141166 if (options.agentClass) {
141167 self.agentClass = options.agentClass
141168 } else if (options.forever) {
141169 var v = version()
141170 // use ForeverAgent in node 0.10- only
141171 if (v.major === 0 && v.minor <= 10) {
141172 self.agentClass = protocol === 'http:' ? ForeverAgent : ForeverAgent.SSL
141173 } else {
141174 self.agentClass = self.httpModule.Agent
141175 self.agentOptions = self.agentOptions || {}
141176 self.agentOptions.keepAlive = true
141177 }
141178 } else {
141179 self.agentClass = self.httpModule.Agent
141180 }
141181 }
141182
141183 if (self.pool === false) {
141184 self.agent = false
141185 } else {
141186 self.agent = self.agent || self.getNewAgent()
141187 }
141188
141189 self.on('pipe', function (src) {
141190 if (self.ntick && self._started) {
141191 self.emit('error', new Error('You cannot pipe to this stream after the outbound request has started.'))
141192 }
141193 self.src = src
141194 if (isReadStream(src)) {
141195 if (!self.hasHeader('content-type')) {
141196 self.setHeader('content-type', mime.lookup(src.path))
141197 }
141198 } else {
141199 if (src.headers) {
141200 for (var i in src.headers) {
141201 if (!self.hasHeader(i)) {
141202 self.setHeader(i, src.headers[i])
141203 }
141204 }
141205 }
141206 if (self._json && !self.hasHeader('content-type')) {
141207 self.setHeader('content-type', 'application/json')
141208 }
141209 if (src.method && !self.explicitMethod) {
141210 self.method = src.method
141211 }
141212 }
141213
141214 // self.on('pipe', function () {
141215 // console.error('You have already piped to this stream. Pipeing twice is likely to break the request.')
141216 // })
141217 })
141218
141219 defer(function () {
141220 if (self._aborted) {
141221 return
141222 }
141223
141224 var end = function () {
141225 if (self._form) {
141226 if (!self._auth.hasAuth) {
141227 self._form.pipe(self)
141228 } else if (self._auth.hasAuth && self._auth.sentAuth) {
141229 self._form.pipe(self)
141230 }
141231 }
141232 if (self._multipart && self._multipart.chunked) {
141233 self._multipart.body.pipe(self)
141234 }
141235 if (self.body) {
141236 if (isstream(self.body)) {
141237 self.body.pipe(self)
141238 } else {
141239 setContentLength()
141240 if (Array.isArray(self.body)) {
141241 self.body.forEach(function (part) {
141242 self.write(part)
141243 })
141244 } else {
141245 self.write(self.body)
141246 }
141247 self.end()
141248 }
141249 } else if (self.requestBodyStream) {
141250 console.warn('options.requestBodyStream is deprecated, please pass the request object to stream.pipe.')
141251 self.requestBodyStream.pipe(self)
141252 } else if (!self.src) {
141253 if (self._auth.hasAuth && !self._auth.sentAuth) {
141254 self.end()
141255 return
141256 }
141257 if (self.method !== 'GET' && typeof self.method !== 'undefined') {
141258 self.setHeader('content-length', 0)
141259 }
141260 self.end()
141261 }
141262 }
141263
141264 if (self._form && !self.hasHeader('content-length')) {
141265 // Before ending the request, we had to compute the length of the whole form, asyncly
141266 self.setHeader(self._form.getHeaders(), true)
141267 self._form.getLength(function (err, length) {
141268 if (!err && !isNaN(length)) {
141269 self.setHeader('content-length', length)
141270 }
141271 end()
141272 })
141273 } else {
141274 end()
141275 }
141276
141277 self.ntick = true
141278 })
141279}
141280
141281Request.prototype.getNewAgent = function () {
141282 var self = this
141283 var Agent = self.agentClass
141284 var options = {}
141285 if (self.agentOptions) {
141286 for (var i in self.agentOptions) {
141287 options[i] = self.agentOptions[i]
141288 }
141289 }
141290 if (self.ca) {
141291 options.ca = self.ca
141292 }
141293 if (self.ciphers) {
141294 options.ciphers = self.ciphers
141295 }
141296 if (self.secureProtocol) {
141297 options.secureProtocol = self.secureProtocol
141298 }
141299 if (self.secureOptions) {
141300 options.secureOptions = self.secureOptions
141301 }
141302 if (typeof self.rejectUnauthorized !== 'undefined') {
141303 options.rejectUnauthorized = self.rejectUnauthorized
141304 }
141305
141306 if (self.cert && self.key) {
141307 options.key = self.key
141308 options.cert = self.cert
141309 }
141310
141311 if (self.pfx) {
141312 options.pfx = self.pfx
141313 }
141314
141315 if (self.passphrase) {
141316 options.passphrase = self.passphrase
141317 }
141318
141319 var poolKey = ''
141320
141321 // different types of agents are in different pools
141322 if (Agent !== self.httpModule.Agent) {
141323 poolKey += Agent.name
141324 }
141325
141326 // ca option is only relevant if proxy or destination are https
141327 var proxy = self.proxy
141328 if (typeof proxy === 'string') {
141329 proxy = url.parse(proxy)
141330 }
141331 var isHttps = (proxy && proxy.protocol === 'https:') || this.uri.protocol === 'https:'
141332
141333 if (isHttps) {
141334 if (options.ca) {
141335 if (poolKey) {
141336 poolKey += ':'
141337 }
141338 poolKey += options.ca
141339 }
141340
141341 if (typeof options.rejectUnauthorized !== 'undefined') {
141342 if (poolKey) {
141343 poolKey += ':'
141344 }
141345 poolKey += options.rejectUnauthorized
141346 }
141347
141348 if (options.cert) {
141349 if (poolKey) {
141350 poolKey += ':'
141351 }
141352 poolKey += options.cert.toString('ascii') + options.key.toString('ascii')
141353 }
141354
141355 if (options.pfx) {
141356 if (poolKey) {
141357 poolKey += ':'
141358 }
141359 poolKey += options.pfx.toString('ascii')
141360 }
141361
141362 if (options.ciphers) {
141363 if (poolKey) {
141364 poolKey += ':'
141365 }
141366 poolKey += options.ciphers
141367 }
141368
141369 if (options.secureProtocol) {
141370 if (poolKey) {
141371 poolKey += ':'
141372 }
141373 poolKey += options.secureProtocol
141374 }
141375
141376 if (options.secureOptions) {
141377 if (poolKey) {
141378 poolKey += ':'
141379 }
141380 poolKey += options.secureOptions
141381 }
141382 }
141383
141384 if (self.pool === globalPool && !poolKey && Object.keys(options).length === 0 && self.httpModule.globalAgent) {
141385 // not doing anything special. Use the globalAgent
141386 return self.httpModule.globalAgent
141387 }
141388
141389 // we're using a stored agent. Make sure it's protocol-specific
141390 poolKey = self.uri.protocol + poolKey
141391
141392 // generate a new agent for this setting if none yet exists
141393 if (!self.pool[poolKey]) {
141394 self.pool[poolKey] = new Agent(options)
141395 // properly set maxSockets on new agents
141396 if (self.pool.maxSockets) {
141397 self.pool[poolKey].maxSockets = self.pool.maxSockets
141398 }
141399 }
141400
141401 return self.pool[poolKey]
141402}
141403
141404Request.prototype.start = function () {
141405 // start() is called once we are ready to send the outgoing HTTP request.
141406 // this is usually called on the first write(), end() or on nextTick()
141407 var self = this
141408
141409 if (self.timing) {
141410 // All timings will be relative to this request's startTime. In order to do this,
141411 // we need to capture the wall-clock start time (via Date), immediately followed
141412 // by the high-resolution timer (via now()). While these two won't be set
141413 // at the _exact_ same time, they should be close enough to be able to calculate
141414 // high-resolution, monotonically non-decreasing timestamps relative to startTime.
141415 var startTime = new Date().getTime()
141416 var startTimeNow = now()
141417 }
141418
141419 if (self._aborted) {
141420 return
141421 }
141422
141423 self._started = true
141424 self.method = self.method || 'GET'
141425 self.href = self.uri.href
141426
141427 if (self.src && self.src.stat && self.src.stat.size && !self.hasHeader('content-length')) {
141428 self.setHeader('content-length', self.src.stat.size)
141429 }
141430 if (self._aws) {
141431 self.aws(self._aws, true)
141432 }
141433
141434 // We have a method named auth, which is completely different from the http.request
141435 // auth option. If we don't remove it, we're gonna have a bad time.
141436 var reqOptions = copy(self)
141437 delete reqOptions.auth
141438
141439 debug('make request', self.uri.href)
141440
141441 // node v6.8.0 now supports a `timeout` value in `http.request()`, but we
141442 // should delete it for now since we handle timeouts manually for better
141443 // consistency with node versions before v6.8.0
141444 delete reqOptions.timeout
141445
141446 try {
141447 self.req = self.httpModule.request(reqOptions)
141448 } catch (err) {
141449 self.emit('error', err)
141450 return
141451 }
141452
141453 if (self.timing) {
141454 self.startTime = startTime
141455 self.startTimeNow = startTimeNow
141456
141457 // Timing values will all be relative to startTime (by comparing to startTimeNow
141458 // so we have an accurate clock)
141459 self.timings = {}
141460 }
141461
141462 var timeout
141463 if (self.timeout && !self.timeoutTimer) {
141464 if (self.timeout < 0) {
141465 timeout = 0
141466 } else if (typeof self.timeout === 'number' && isFinite(self.timeout)) {
141467 timeout = self.timeout
141468 }
141469 }
141470
141471 self.req.on('response', self.onRequestResponse.bind(self))
141472 self.req.on('error', self.onRequestError.bind(self))
141473 self.req.on('drain', function () {
141474 self.emit('drain')
141475 })
141476
141477 self.req.on('socket', function (socket) {
141478 // `._connecting` was the old property which was made public in node v6.1.0
141479 var isConnecting = socket._connecting || socket.connecting
141480 if (self.timing) {
141481 self.timings.socket = now() - self.startTimeNow
141482
141483 if (isConnecting) {
141484 var onLookupTiming = function () {
141485 self.timings.lookup = now() - self.startTimeNow
141486 }
141487
141488 var onConnectTiming = function () {
141489 self.timings.connect = now() - self.startTimeNow
141490 }
141491
141492 socket.once('lookup', onLookupTiming)
141493 socket.once('connect', onConnectTiming)
141494
141495 // clean up timing event listeners if needed on error
141496 self.req.once('error', function () {
141497 socket.removeListener('lookup', onLookupTiming)
141498 socket.removeListener('connect', onConnectTiming)
141499 })
141500 }
141501 }
141502
141503 var setReqTimeout = function () {
141504 // This timeout sets the amount of time to wait *between* bytes sent
141505 // from the server once connected.
141506 //
141507 // In particular, it's useful for erroring if the server fails to send
141508 // data halfway through streaming a response.
141509 self.req.setTimeout(timeout, function () {
141510 if (self.req) {
141511 self.abort()
141512 var e = new Error('ESOCKETTIMEDOUT')
141513 e.code = 'ESOCKETTIMEDOUT'
141514 e.connect = false
141515 self.emit('error', e)
141516 }
141517 })
141518 }
141519 if (timeout !== undefined) {
141520 // Only start the connection timer if we're actually connecting a new
141521 // socket, otherwise if we're already connected (because this is a
141522 // keep-alive connection) do not bother. This is important since we won't
141523 // get a 'connect' event for an already connected socket.
141524 if (isConnecting) {
141525 var onReqSockConnect = function () {
141526 socket.removeListener('connect', onReqSockConnect)
141527 clearTimeout(self.timeoutTimer)
141528 self.timeoutTimer = null
141529 setReqTimeout()
141530 }
141531
141532 socket.on('connect', onReqSockConnect)
141533
141534 self.req.on('error', function (err) { // eslint-disable-line handle-callback-err
141535 socket.removeListener('connect', onReqSockConnect)
141536 })
141537
141538 // Set a timeout in memory - this block will throw if the server takes more
141539 // than `timeout` to write the HTTP status and headers (corresponding to
141540 // the on('response') event on the client). NB: this measures wall-clock
141541 // time, not the time between bytes sent by the server.
141542 self.timeoutTimer = setTimeout(function () {
141543 socket.removeListener('connect', onReqSockConnect)
141544 self.abort()
141545 var e = new Error('ETIMEDOUT')
141546 e.code = 'ETIMEDOUT'
141547 e.connect = true
141548 self.emit('error', e)
141549 }, timeout)
141550 } else {
141551 // We're already connected
141552 setReqTimeout()
141553 }
141554 }
141555 self.emit('socket', socket)
141556 })
141557
141558 self.emit('request', self.req)
141559}
141560
141561Request.prototype.onRequestError = function (error) {
141562 var self = this
141563 if (self._aborted) {
141564 return
141565 }
141566 if (self.req && self.req._reusedSocket && error.code === 'ECONNRESET' &&
141567 self.agent.addRequestNoreuse) {
141568 self.agent = { addRequest: self.agent.addRequestNoreuse.bind(self.agent) }
141569 self.start()
141570 self.req.end()
141571 return
141572 }
141573 if (self.timeout && self.timeoutTimer) {
141574 clearTimeout(self.timeoutTimer)
141575 self.timeoutTimer = null
141576 }
141577 self.emit('error', error)
141578}
141579
141580Request.prototype.onRequestResponse = function (response) {
141581 var self = this
141582
141583 if (self.timing) {
141584 self.timings.response = now() - self.startTimeNow
141585 }
141586
141587 debug('onRequestResponse', self.uri.href, response.statusCode, response.headers)
141588 response.on('end', function () {
141589 if (self.timing) {
141590 self.timings.end = now() - self.startTimeNow
141591 response.timingStart = self.startTime
141592
141593 // fill in the blanks for any periods that didn't trigger, such as
141594 // no lookup or connect due to keep alive
141595 if (!self.timings.socket) {
141596 self.timings.socket = 0
141597 }
141598 if (!self.timings.lookup) {
141599 self.timings.lookup = self.timings.socket
141600 }
141601 if (!self.timings.connect) {
141602 self.timings.connect = self.timings.lookup
141603 }
141604 if (!self.timings.response) {
141605 self.timings.response = self.timings.connect
141606 }
141607
141608 debug('elapsed time', self.timings.end)
141609
141610 // elapsedTime includes all redirects
141611 self.elapsedTime += Math.round(self.timings.end)
141612
141613 // NOTE: elapsedTime is deprecated in favor of .timings
141614 response.elapsedTime = self.elapsedTime
141615
141616 // timings is just for the final fetch
141617 response.timings = self.timings
141618
141619 // pre-calculate phase timings as well
141620 response.timingPhases = {
141621 wait: self.timings.socket,
141622 dns: self.timings.lookup - self.timings.socket,
141623 tcp: self.timings.connect - self.timings.lookup,
141624 firstByte: self.timings.response - self.timings.connect,
141625 download: self.timings.end - self.timings.response,
141626 total: self.timings.end
141627 }
141628 }
141629 debug('response end', self.uri.href, response.statusCode, response.headers)
141630 })
141631
141632 if (self._aborted) {
141633 debug('aborted', self.uri.href)
141634 response.resume()
141635 return
141636 }
141637
141638 self.response = response
141639 response.request = self
141640 response.toJSON = responseToJSON
141641
141642 // XXX This is different on 0.10, because SSL is strict by default
141643 if (self.httpModule === https &&
141644 self.strictSSL && (!response.hasOwnProperty('socket') ||
141645 !response.socket.authorized)) {
141646 debug('strict ssl error', self.uri.href)
141647 var sslErr = response.hasOwnProperty('socket') ? response.socket.authorizationError : self.uri.href + ' does not support SSL'
141648 self.emit('error', new Error('SSL Error: ' + sslErr))
141649 return
141650 }
141651
141652 // Save the original host before any redirect (if it changes, we need to
141653 // remove any authorization headers). Also remember the case of the header
141654 // name because lots of broken servers expect Host instead of host and we
141655 // want the caller to be able to specify this.
141656 self.originalHost = self.getHeader('host')
141657 if (!self.originalHostHeaderName) {
141658 self.originalHostHeaderName = self.hasHeader('host')
141659 }
141660 if (self.setHost) {
141661 self.removeHeader('host')
141662 }
141663 if (self.timeout && self.timeoutTimer) {
141664 clearTimeout(self.timeoutTimer)
141665 self.timeoutTimer = null
141666 }
141667
141668 var targetCookieJar = (self._jar && self._jar.setCookie) ? self._jar : globalCookieJar
141669 var addCookie = function (cookie) {
141670 // set the cookie if it's domain in the href's domain.
141671 try {
141672 targetCookieJar.setCookie(cookie, self.uri.href, {ignoreError: true})
141673 } catch (e) {
141674 self.emit('error', e)
141675 }
141676 }
141677
141678 response.caseless = caseless(response.headers)
141679
141680 if (response.caseless.has('set-cookie') && (!self._disableCookies)) {
141681 var headerName = response.caseless.has('set-cookie')
141682 if (Array.isArray(response.headers[headerName])) {
141683 response.headers[headerName].forEach(addCookie)
141684 } else {
141685 addCookie(response.headers[headerName])
141686 }
141687 }
141688
141689 if (self._redirect.onResponse(response)) {
141690 return // Ignore the rest of the response
141691 } else {
141692 // Be a good stream and emit end when the response is finished.
141693 // Hack to emit end on close because of a core bug that never fires end
141694 response.on('close', function () {
141695 if (!self._ended) {
141696 self.response.emit('end')
141697 }
141698 })
141699
141700 response.once('end', function () {
141701 self._ended = true
141702 })
141703
141704 var noBody = function (code) {
141705 return (
141706 self.method === 'HEAD' ||
141707 // Informational
141708 (code >= 100 && code < 200) ||
141709 // No Content
141710 code === 204 ||
141711 // Not Modified
141712 code === 304
141713 )
141714 }
141715
141716 var responseContent
141717 if (self.gzip && !noBody(response.statusCode)) {
141718 var contentEncoding = response.headers['content-encoding'] || 'identity'
141719 contentEncoding = contentEncoding.trim().toLowerCase()
141720
141721 // Be more lenient with decoding compressed responses, since (very rarely)
141722 // servers send slightly invalid gzip responses that are still accepted
141723 // by common browsers.
141724 // Always using Z_SYNC_FLUSH is what cURL does.
141725 var zlibOptions = {
141726 flush: zlib.Z_SYNC_FLUSH,
141727 finishFlush: zlib.Z_SYNC_FLUSH
141728 }
141729
141730 if (contentEncoding === 'gzip') {
141731 responseContent = zlib.createGunzip(zlibOptions)
141732 response.pipe(responseContent)
141733 } else if (contentEncoding === 'deflate') {
141734 responseContent = zlib.createInflate(zlibOptions)
141735 response.pipe(responseContent)
141736 } else {
141737 // Since previous versions didn't check for Content-Encoding header,
141738 // ignore any invalid values to preserve backwards-compatibility
141739 if (contentEncoding !== 'identity') {
141740 debug('ignoring unrecognized Content-Encoding ' + contentEncoding)
141741 }
141742 responseContent = response
141743 }
141744 } else {
141745 responseContent = response
141746 }
141747
141748 if (self.encoding) {
141749 if (self.dests.length !== 0) {
141750 console.error('Ignoring encoding parameter as this stream is being piped to another stream which makes the encoding option invalid.')
141751 } else {
141752 responseContent.setEncoding(self.encoding)
141753 }
141754 }
141755
141756 if (self._paused) {
141757 responseContent.pause()
141758 }
141759
141760 self.responseContent = responseContent
141761
141762 self.emit('response', response)
141763
141764 self.dests.forEach(function (dest) {
141765 self.pipeDest(dest)
141766 })
141767
141768 responseContent.on('data', function (chunk) {
141769 if (self.timing && !self.responseStarted) {
141770 self.responseStartTime = (new Date()).getTime()
141771
141772 // NOTE: responseStartTime is deprecated in favor of .timings
141773 response.responseStartTime = self.responseStartTime
141774 }
141775 self._destdata = true
141776 self.emit('data', chunk)
141777 })
141778 responseContent.once('end', function (chunk) {
141779 self.emit('end', chunk)
141780 })
141781 responseContent.on('error', function (error) {
141782 self.emit('error', error)
141783 })
141784 responseContent.on('close', function () { self.emit('close') })
141785
141786 if (self.callback) {
141787 self.readResponseBody(response)
141788 } else { // if no callback
141789 self.on('end', function () {
141790 if (self._aborted) {
141791 debug('aborted', self.uri.href)
141792 return
141793 }
141794 self.emit('complete', response)
141795 })
141796 }
141797 }
141798 debug('finish init function', self.uri.href)
141799}
141800
141801Request.prototype.readResponseBody = function (response) {
141802 var self = this
141803 debug("reading response's body")
141804 var buffers = []
141805 var bufferLength = 0
141806 var strings = []
141807
141808 self.on('data', function (chunk) {
141809 if (!Buffer.isBuffer(chunk)) {
141810 strings.push(chunk)
141811 } else if (chunk.length) {
141812 bufferLength += chunk.length
141813 buffers.push(chunk)
141814 }
141815 })
141816 self.on('end', function () {
141817 debug('end event', self.uri.href)
141818 if (self._aborted) {
141819 debug('aborted', self.uri.href)
141820 // `buffer` is defined in the parent scope and used in a closure it exists for the life of the request.
141821 // This can lead to leaky behavior if the user retains a reference to the request object.
141822 buffers = []
141823 bufferLength = 0
141824 return
141825 }
141826
141827 if (bufferLength) {
141828 debug('has body', self.uri.href, bufferLength)
141829 response.body = Buffer.concat(buffers, bufferLength)
141830 if (self.encoding !== null) {
141831 response.body = response.body.toString(self.encoding)
141832 }
141833 // `buffer` is defined in the parent scope and used in a closure it exists for the life of the Request.
141834 // This can lead to leaky behavior if the user retains a reference to the request object.
141835 buffers = []
141836 bufferLength = 0
141837 } else if (strings.length) {
141838 // The UTF8 BOM [0xEF,0xBB,0xBF] is converted to [0xFE,0xFF] in the JS UTC16/UCS2 representation.
141839 // Strip this value out when the encoding is set to 'utf8', as upstream consumers won't expect it and it breaks JSON.parse().
141840 if (self.encoding === 'utf8' && strings[0].length > 0 && strings[0][0] === '\uFEFF') {
141841 strings[0] = strings[0].substring(1)
141842 }
141843 response.body = strings.join('')
141844 }
141845
141846 if (self._json) {
141847 try {
141848 response.body = JSON.parse(response.body, self._jsonReviver)
141849 } catch (e) {
141850 debug('invalid JSON received', self.uri.href)
141851 }
141852 }
141853 debug('emitting complete', self.uri.href)
141854 if (typeof response.body === 'undefined' && !self._json) {
141855 response.body = self.encoding === null ? Buffer.alloc(0) : ''
141856 }
141857 self.emit('complete', response, response.body)
141858 })
141859}
141860
141861Request.prototype.abort = function () {
141862 var self = this
141863 self._aborted = true
141864
141865 if (self.req) {
141866 self.req.abort()
141867 } else if (self.response) {
141868 self.response.destroy()
141869 }
141870
141871 self.emit('abort')
141872}
141873
141874Request.prototype.pipeDest = function (dest) {
141875 var self = this
141876 var response = self.response
141877 // Called after the response is received
141878 if (dest.headers && !dest.headersSent) {
141879 if (response.caseless.has('content-type')) {
141880 var ctname = response.caseless.has('content-type')
141881 if (dest.setHeader) {
141882 dest.setHeader(ctname, response.headers[ctname])
141883 } else {
141884 dest.headers[ctname] = response.headers[ctname]
141885 }
141886 }
141887
141888 if (response.caseless.has('content-length')) {
141889 var clname = response.caseless.has('content-length')
141890 if (dest.setHeader) {
141891 dest.setHeader(clname, response.headers[clname])
141892 } else {
141893 dest.headers[clname] = response.headers[clname]
141894 }
141895 }
141896 }
141897 if (dest.setHeader && !dest.headersSent) {
141898 for (var i in response.headers) {
141899 // If the response content is being decoded, the Content-Encoding header
141900 // of the response doesn't represent the piped content, so don't pass it.
141901 if (!self.gzip || i !== 'content-encoding') {
141902 dest.setHeader(i, response.headers[i])
141903 }
141904 }
141905 dest.statusCode = response.statusCode
141906 }
141907 if (self.pipefilter) {
141908 self.pipefilter(response, dest)
141909 }
141910}
141911
141912Request.prototype.qs = function (q, clobber) {
141913 var self = this
141914 var base
141915 if (!clobber && self.uri.query) {
141916 base = self._qs.parse(self.uri.query)
141917 } else {
141918 base = {}
141919 }
141920
141921 for (var i in q) {
141922 base[i] = q[i]
141923 }
141924
141925 var qs = self._qs.stringify(base)
141926
141927 if (qs === '') {
141928 return self
141929 }
141930
141931 self.uri = url.parse(self.uri.href.split('?')[0] + '?' + qs)
141932 self.url = self.uri
141933 self.path = self.uri.path
141934
141935 if (self.uri.host === 'unix') {
141936 self.enableUnixSocket()
141937 }
141938
141939 return self
141940}
141941Request.prototype.form = function (form) {
141942 var self = this
141943 if (form) {
141944 if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) {
141945 self.setHeader('content-type', 'application/x-www-form-urlencoded')
141946 }
141947 self.body = (typeof form === 'string')
141948 ? self._qs.rfc3986(form.toString('utf8'))
141949 : self._qs.stringify(form).toString('utf8')
141950 return self
141951 }
141952 // create form-data object
141953 self._form = new FormData()
141954 self._form.on('error', function (err) {
141955 err.message = 'form-data: ' + err.message
141956 self.emit('error', err)
141957 self.abort()
141958 })
141959 return self._form
141960}
141961Request.prototype.multipart = function (multipart) {
141962 var self = this
141963
141964 self._multipart.onRequest(multipart)
141965
141966 if (!self._multipart.chunked) {
141967 self.body = self._multipart.body
141968 }
141969
141970 return self
141971}
141972Request.prototype.json = function (val) {
141973 var self = this
141974
141975 if (!self.hasHeader('accept')) {
141976 self.setHeader('accept', 'application/json')
141977 }
141978
141979 if (typeof self.jsonReplacer === 'function') {
141980 self._jsonReplacer = self.jsonReplacer
141981 }
141982
141983 self._json = true
141984 if (typeof val === 'boolean') {
141985 if (self.body !== undefined) {
141986 if (!/^application\/x-www-form-urlencoded\b/.test(self.getHeader('content-type'))) {
141987 self.body = safeStringify(self.body, self._jsonReplacer)
141988 } else {
141989 self.body = self._qs.rfc3986(self.body)
141990 }
141991 if (!self.hasHeader('content-type')) {
141992 self.setHeader('content-type', 'application/json')
141993 }
141994 }
141995 } else {
141996 self.body = safeStringify(val, self._jsonReplacer)
141997 if (!self.hasHeader('content-type')) {
141998 self.setHeader('content-type', 'application/json')
141999 }
142000 }
142001
142002 if (typeof self.jsonReviver === 'function') {
142003 self._jsonReviver = self.jsonReviver
142004 }
142005
142006 return self
142007}
142008Request.prototype.getHeader = function (name, headers) {
142009 var self = this
142010 var result, re, match
142011 if (!headers) {
142012 headers = self.headers
142013 }
142014 Object.keys(headers).forEach(function (key) {
142015 if (key.length !== name.length) {
142016 return
142017 }
142018 re = new RegExp(name, 'i')
142019 match = key.match(re)
142020 if (match) {
142021 result = headers[key]
142022 }
142023 })
142024 return result
142025}
142026Request.prototype.enableUnixSocket = function () {
142027 // Get the socket & request paths from the URL
142028 var unixParts = this.uri.path.split(':')
142029 var host = unixParts[0]
142030 var path = unixParts[1]
142031 // Apply unix properties to request
142032 this.socketPath = host
142033 this.uri.pathname = path
142034 this.uri.path = path
142035 this.uri.host = host
142036 this.uri.hostname = host
142037 this.uri.isUnix = true
142038}
142039
142040Request.prototype.auth = function (user, pass, sendImmediately, bearer) {
142041 var self = this
142042
142043 self._auth.onRequest(user, pass, sendImmediately, bearer)
142044
142045 return self
142046}
142047Request.prototype.aws = function (opts, now) {
142048 var self = this
142049
142050 if (!now) {
142051 self._aws = opts
142052 return self
142053 }
142054
142055 if (opts.sign_version === 4 || opts.sign_version === '4') {
142056 // use aws4
142057 var options = {
142058 host: self.uri.host,
142059 path: self.uri.path,
142060 method: self.method,
142061 headers: {
142062 'content-type': self.getHeader('content-type') || ''
142063 },
142064 body: self.body
142065 }
142066 var signRes = aws4.sign(options, {
142067 accessKeyId: opts.key,
142068 secretAccessKey: opts.secret,
142069 sessionToken: opts.session
142070 })
142071 self.setHeader('authorization', signRes.headers.Authorization)
142072 self.setHeader('x-amz-date', signRes.headers['X-Amz-Date'])
142073 if (signRes.headers['X-Amz-Security-Token']) {
142074 self.setHeader('x-amz-security-token', signRes.headers['X-Amz-Security-Token'])
142075 }
142076 } else {
142077 // default: use aws-sign2
142078 var date = new Date()
142079 self.setHeader('date', date.toUTCString())
142080 var auth = {
142081 key: opts.key,
142082 secret: opts.secret,
142083 verb: self.method.toUpperCase(),
142084 date: date,
142085 contentType: self.getHeader('content-type') || '',
142086 md5: self.getHeader('content-md5') || '',
142087 amazonHeaders: aws2.canonicalizeHeaders(self.headers)
142088 }
142089 var path = self.uri.path
142090 if (opts.bucket && path) {
142091 auth.resource = '/' + opts.bucket + path
142092 } else if (opts.bucket && !path) {
142093 auth.resource = '/' + opts.bucket
142094 } else if (!opts.bucket && path) {
142095 auth.resource = path
142096 } else if (!opts.bucket && !path) {
142097 auth.resource = '/'
142098 }
142099 auth.resource = aws2.canonicalizeResource(auth.resource)
142100 self.setHeader('authorization', aws2.authorization(auth))
142101 }
142102
142103 return self
142104}
142105Request.prototype.httpSignature = function (opts) {
142106 var self = this
142107 httpSignature.signRequest({
142108 getHeader: function (header) {
142109 return self.getHeader(header, self.headers)
142110 },
142111 setHeader: function (header, value) {
142112 self.setHeader(header, value)
142113 },
142114 method: self.method,
142115 path: self.path
142116 }, opts)
142117 debug('httpSignature authorization', self.getHeader('authorization'))
142118
142119 return self
142120}
142121Request.prototype.hawk = function (opts) {
142122 var self = this
142123 self.setHeader('Authorization', hawk.header(self.uri, self.method, opts))
142124}
142125Request.prototype.oauth = function (_oauth) {
142126 var self = this
142127
142128 self._oauth.onRequest(_oauth)
142129
142130 return self
142131}
142132
142133Request.prototype.jar = function (jar) {
142134 var self = this
142135 var cookies
142136
142137 if (self._redirect.redirectsFollowed === 0) {
142138 self.originalCookieHeader = self.getHeader('cookie')
142139 }
142140
142141 if (!jar) {
142142 // disable cookies
142143 cookies = false
142144 self._disableCookies = true
142145 } else {
142146 var targetCookieJar = (jar && jar.getCookieString) ? jar : globalCookieJar
142147 var urihref = self.uri.href
142148 // fetch cookie in the Specified host
142149 if (targetCookieJar) {
142150 cookies = targetCookieJar.getCookieString(urihref)
142151 }
142152 }
142153
142154 // if need cookie and cookie is not empty
142155 if (cookies && cookies.length) {
142156 if (self.originalCookieHeader) {
142157 // Don't overwrite existing Cookie header
142158 self.setHeader('cookie', self.originalCookieHeader + '; ' + cookies)
142159 } else {
142160 self.setHeader('cookie', cookies)
142161 }
142162 }
142163 self._jar = jar
142164 return self
142165}
142166
142167// Stream API
142168Request.prototype.pipe = function (dest, opts) {
142169 var self = this
142170
142171 if (self.response) {
142172 if (self._destdata) {
142173 self.emit('error', new Error('You cannot pipe after data has been emitted from the response.'))
142174 } else if (self._ended) {
142175 self.emit('error', new Error('You cannot pipe after the response has been ended.'))
142176 } else {
142177 stream.Stream.prototype.pipe.call(self, dest, opts)
142178 self.pipeDest(dest)
142179 return dest
142180 }
142181 } else {
142182 self.dests.push(dest)
142183 stream.Stream.prototype.pipe.call(self, dest, opts)
142184 return dest
142185 }
142186}
142187Request.prototype.write = function () {
142188 var self = this
142189 if (self._aborted) { return }
142190
142191 if (!self._started) {
142192 self.start()
142193 }
142194 if (self.req) {
142195 return self.req.write.apply(self.req, arguments)
142196 }
142197}
142198Request.prototype.end = function (chunk) {
142199 var self = this
142200 if (self._aborted) { return }
142201
142202 if (chunk) {
142203 self.write(chunk)
142204 }
142205 if (!self._started) {
142206 self.start()
142207 }
142208 if (self.req) {
142209 self.req.end()
142210 }
142211}
142212Request.prototype.pause = function () {
142213 var self = this
142214 if (!self.responseContent) {
142215 self._paused = true
142216 } else {
142217 self.responseContent.pause.apply(self.responseContent, arguments)
142218 }
142219}
142220Request.prototype.resume = function () {
142221 var self = this
142222 if (!self.responseContent) {
142223 self._paused = false
142224 } else {
142225 self.responseContent.resume.apply(self.responseContent, arguments)
142226 }
142227}
142228Request.prototype.destroy = function () {
142229 var self = this
142230 if (!self._ended) {
142231 self.end()
142232 } else if (self.response) {
142233 self.response.destroy()
142234 }
142235}
142236
142237Request.defaultProxyHeaderWhiteList =
142238 Tunnel.defaultProxyHeaderWhiteList.slice()
142239
142240Request.defaultProxyHeaderExclusiveList =
142241 Tunnel.defaultProxyHeaderExclusiveList.slice()
142242
142243// Exports
142244
142245Request.prototype.toJSON = requestToJSON
142246module.exports = Request
142247
142248
142249/***/ }),
142250/* 886 */
142251/***/ (function(module, exports, __webpack_require__) {
142252
142253var core = __webpack_require__(247);
142254var async = __webpack_require__(887);
142255async.core = core;
142256async.isCore = function isCore(x) { return core[x]; };
142257async.sync = __webpack_require__(889);
142258
142259exports = async;
142260module.exports = async;
142261
142262
142263/***/ }),
142264/* 887 */
142265/***/ (function(module, exports, __webpack_require__) {
142266
142267var core = __webpack_require__(247);
142268var fs = __webpack_require__(12);
142269var path = __webpack_require__(1);
142270var caller = __webpack_require__(387);
142271var nodeModulesPaths = __webpack_require__(388);
142272
142273var defaultIsFile = function isFile(file, cb) {
142274 fs.stat(file, function (err, stat) {
142275 if (!err) {
142276 return cb(null, stat.isFile() || stat.isFIFO());
142277 }
142278 if (err.code === 'ENOENT' || err.code === 'ENOTDIR') return cb(null, false);
142279 return cb(err);
142280 });
142281};
142282
142283module.exports = function resolve(x, options, callback) {
142284 var cb = callback;
142285 var opts = options || {};
142286 if (typeof opts === 'function') {
142287 cb = opts;
142288 opts = {};
142289 }
142290 if (typeof x !== 'string') {
142291 var err = new TypeError('Path must be a string.');
142292 return process.nextTick(function () {
142293 cb(err);
142294 });
142295 }
142296
142297 var isFile = opts.isFile || defaultIsFile;
142298 var readFile = opts.readFile || fs.readFile;
142299
142300 var extensions = opts.extensions || ['.js'];
142301 var basedir = opts.basedir || path.dirname(caller());
142302 var parent = opts.filename || basedir;
142303
142304 opts.paths = opts.paths || [];
142305
142306 if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) {
142307 var res = path.resolve(basedir, x);
142308 if (x === '..' || x.slice(-1) === '/') res += '/';
142309 if (/\/$/.test(x) && res === basedir) {
142310 loadAsDirectory(res, opts.package, onfile);
142311 } else loadAsFile(res, opts.package, onfile);
142312 } else loadNodeModules(x, basedir, function (err, n, pkg) {
142313 if (err) cb(err);
142314 else if (n) cb(null, n, pkg);
142315 else if (core[x]) return cb(null, x);
142316 else {
142317 var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
142318 moduleError.code = 'MODULE_NOT_FOUND';
142319 cb(moduleError);
142320 }
142321 });
142322
142323 function onfile(err, m, pkg) {
142324 if (err) cb(err);
142325 else if (m) cb(null, m, pkg);
142326 else loadAsDirectory(res, function (err, d, pkg) {
142327 if (err) cb(err);
142328 else if (d) cb(null, d, pkg);
142329 else {
142330 var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
142331 moduleError.code = 'MODULE_NOT_FOUND';
142332 cb(moduleError);
142333 }
142334 });
142335 }
142336
142337 function loadAsFile(x, thePackage, callback) {
142338 var loadAsFilePackage = thePackage;
142339 var cb = callback;
142340 if (typeof loadAsFilePackage === 'function') {
142341 cb = loadAsFilePackage;
142342 loadAsFilePackage = undefined;
142343 }
142344
142345 var exts = [''].concat(extensions);
142346 load(exts, x, loadAsFilePackage);
142347
142348 function load(exts, x, loadPackage) {
142349 if (exts.length === 0) return cb(null, undefined, loadPackage);
142350 var file = x + exts[0];
142351
142352 var pkg = loadPackage;
142353 if (pkg) onpkg(null, pkg);
142354 else loadpkg(path.dirname(file), onpkg);
142355
142356 function onpkg(err, pkg_, dir) {
142357 pkg = pkg_;
142358 if (err) return cb(err);
142359 if (dir && pkg && opts.pathFilter) {
142360 var rfile = path.relative(dir, file);
142361 var rel = rfile.slice(0, rfile.length - exts[0].length);
142362 var r = opts.pathFilter(pkg, x, rel);
142363 if (r) return load(
142364 [''].concat(extensions.slice()),
142365 path.resolve(dir, r),
142366 pkg
142367 );
142368 }
142369 isFile(file, onex);
142370 }
142371 function onex(err, ex) {
142372 if (err) return cb(err);
142373 if (ex) return cb(null, file, pkg);
142374 load(exts.slice(1), x, pkg);
142375 }
142376 }
142377 }
142378
142379 function loadpkg(dir, cb) {
142380 if (dir === '' || dir === '/') return cb(null);
142381 if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
142382 return cb(null);
142383 }
142384 if (/[/\\]node_modules[/\\]*$/.test(dir)) return cb(null);
142385
142386 var pkgfile = path.join(dir, 'package.json');
142387 isFile(pkgfile, function (err, ex) {
142388 // on err, ex is false
142389 if (!ex) return loadpkg(path.dirname(dir), cb);
142390
142391 readFile(pkgfile, function (err, body) {
142392 if (err) cb(err);
142393 try { var pkg = JSON.parse(body); } catch (jsonErr) {}
142394
142395 if (pkg && opts.packageFilter) {
142396 pkg = opts.packageFilter(pkg, pkgfile);
142397 }
142398 cb(null, pkg, dir);
142399 });
142400 });
142401 }
142402
142403 function loadAsDirectory(x, loadAsDirectoryPackage, callback) {
142404 var cb = callback;
142405 var fpkg = loadAsDirectoryPackage;
142406 if (typeof fpkg === 'function') {
142407 cb = fpkg;
142408 fpkg = opts.package;
142409 }
142410
142411 var pkgfile = path.join(x, 'package.json');
142412 isFile(pkgfile, function (err, ex) {
142413 if (err) return cb(err);
142414 if (!ex) return loadAsFile(path.join(x, 'index'), fpkg, cb);
142415
142416 readFile(pkgfile, function (err, body) {
142417 if (err) return cb(err);
142418 try {
142419 var pkg = JSON.parse(body);
142420 } catch (jsonErr) {}
142421
142422 if (opts.packageFilter) {
142423 pkg = opts.packageFilter(pkg, pkgfile);
142424 }
142425
142426 if (pkg.main) {
142427 if (pkg.main === '.' || pkg.main === './') {
142428 pkg.main = 'index';
142429 }
142430 loadAsFile(path.resolve(x, pkg.main), pkg, function (err, m, pkg) {
142431 if (err) return cb(err);
142432 if (m) return cb(null, m, pkg);
142433 if (!pkg) return loadAsFile(path.join(x, 'index'), pkg, cb);
142434
142435 var dir = path.resolve(x, pkg.main);
142436 loadAsDirectory(dir, pkg, function (err, n, pkg) {
142437 if (err) return cb(err);
142438 if (n) return cb(null, n, pkg);
142439 loadAsFile(path.join(x, 'index'), pkg, cb);
142440 });
142441 });
142442 return;
142443 }
142444
142445 loadAsFile(path.join(x, '/index'), pkg, cb);
142446 });
142447 });
142448 }
142449
142450 function processDirs(cb, dirs) {
142451 if (dirs.length === 0) return cb(null, undefined);
142452 var dir = dirs[0];
142453
142454 var file = path.join(dir, x);
142455 loadAsFile(file, opts.package, onfile);
142456
142457 function onfile(err, m, pkg) {
142458 if (err) return cb(err);
142459 if (m) return cb(null, m, pkg);
142460 loadAsDirectory(path.join(dir, x), opts.package, ondir);
142461 }
142462
142463 function ondir(err, n, pkg) {
142464 if (err) return cb(err);
142465 if (n) return cb(null, n, pkg);
142466 processDirs(cb, dirs.slice(1));
142467 }
142468 }
142469 function loadNodeModules(x, start, cb) {
142470 processDirs(cb, nodeModulesPaths(start, opts));
142471 }
142472};
142473
142474
142475/***/ }),
142476/* 888 */
142477/***/ (function(module, exports) {
142478
142479module.exports = {"assert":true,"async_hooks":">= 8","buffer_ieee754":"< 0.9.7","buffer":true,"child_process":true,"cluster":true,"console":true,"constants":true,"crypto":true,"_debugger":"< 8","dgram":true,"dns":true,"domain":true,"events":true,"freelist":"< 6","fs":true,"fs/promises":">= 10 && < 10.1","_http_agent":">= 0.11.1","_http_client":">= 0.11.1","_http_common":">= 0.11.1","_http_incoming":">= 0.11.1","_http_outgoing":">= 0.11.1","_http_server":">= 0.11.1","http":true,"http2":">= 8.8","https":true,"inspector":">= 8.0.0","_linklist":"< 8","module":true,"net":true,"node-inspect/lib/_inspect":">= 7.6.0","node-inspect/lib/internal/inspect_client":">= 7.6.0","node-inspect/lib/internal/inspect_repl":">= 7.6.0","os":true,"path":true,"perf_hooks":">= 8.5","process":">= 1","punycode":true,"querystring":true,"readline":true,"repl":true,"smalloc":">= 0.11.5 && < 3","_stream_duplex":">= 0.9.4","_stream_transform":">= 0.9.4","_stream_wrap":">= 1.4.1","_stream_passthrough":">= 0.9.4","_stream_readable":">= 0.9.4","_stream_writable":">= 0.9.4","stream":true,"string_decoder":true,"sys":true,"timers":true,"_tls_common":">= 0.11.13","_tls_legacy":">= 0.11.3 && < 10","_tls_wrap":">= 0.11.3","tls":true,"trace_events":">= 10","tty":true,"url":true,"util":true,"v8/tools/arguments":">= 10","v8/tools/codemap":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/consarray":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/csvparser":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/logreader":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/profile_view":[">= 4.4.0 && < 5",">= 5.2.0"],"v8/tools/splaytree":[">= 4.4.0 && < 5",">= 5.2.0"],"v8":">= 1","vm":true,"zlib":true}
142480
142481/***/ }),
142482/* 889 */
142483/***/ (function(module, exports, __webpack_require__) {
142484
142485var core = __webpack_require__(247);
142486var fs = __webpack_require__(12);
142487var path = __webpack_require__(1);
142488var caller = __webpack_require__(387);
142489var nodeModulesPaths = __webpack_require__(388);
142490
142491var defaultIsFile = function isFile(file) {
142492 try {
142493 var stat = fs.statSync(file);
142494 } catch (e) {
142495 if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR')) return false;
142496 throw e;
142497 }
142498 return stat.isFile() || stat.isFIFO();
142499};
142500
142501module.exports = function (x, options) {
142502 if (typeof x !== 'string') {
142503 throw new TypeError('Path must be a string.');
142504 }
142505 var opts = options || {};
142506 var isFile = opts.isFile || defaultIsFile;
142507 var readFileSync = opts.readFileSync || fs.readFileSync;
142508
142509 var extensions = opts.extensions || ['.js'];
142510 var basedir = opts.basedir || path.dirname(caller());
142511 var parent = opts.filename || basedir;
142512
142513 opts.paths = opts.paths || [];
142514
142515 if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) {
142516 var res = path.resolve(basedir, x);
142517 if (x === '..' || x.slice(-1) === '/') res += '/';
142518 var m = loadAsFileSync(res) || loadAsDirectorySync(res);
142519 if (m) return m;
142520 } else {
142521 var n = loadNodeModulesSync(x, basedir);
142522 if (n) return n;
142523 }
142524
142525 if (core[x]) return x;
142526
142527 var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
142528 err.code = 'MODULE_NOT_FOUND';
142529 throw err;
142530
142531 function loadAsFileSync(x) {
142532 var pkg = loadpkg(path.dirname(x));
142533
142534 if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
142535 var rfile = path.relative(pkg.dir, x);
142536 var r = opts.pathFilter(pkg.pkg, x, rfile);
142537 if (r) {
142538 x = path.resolve(pkg.dir, r); // eslint-disable-line no-param-reassign
142539 }
142540 }
142541
142542 if (isFile(x)) {
142543 return x;
142544 }
142545
142546 for (var i = 0; i < extensions.length; i++) {
142547 var file = x + extensions[i];
142548 if (isFile(file)) {
142549 return file;
142550 }
142551 }
142552 }
142553
142554 function loadpkg(dir) {
142555 if (dir === '' || dir === '/') return;
142556 if (process.platform === 'win32' && (/^\w:[/\\]*$/).test(dir)) {
142557 return;
142558 }
142559 if (/[/\\]node_modules[/\\]*$/.test(dir)) return;
142560
142561 var pkgfile = path.join(dir, 'package.json');
142562
142563 if (!isFile(pkgfile)) {
142564 return loadpkg(path.dirname(dir));
142565 }
142566
142567 var body = readFileSync(pkgfile);
142568
142569 try {
142570 var pkg = JSON.parse(body);
142571 } catch (jsonErr) {}
142572
142573 if (pkg && opts.packageFilter) {
142574 pkg = opts.packageFilter(pkg, dir);
142575 }
142576
142577 return { pkg: pkg, dir: dir };
142578 }
142579
142580 function loadAsDirectorySync(x) {
142581 var pkgfile = path.join(x, '/package.json');
142582 if (isFile(pkgfile)) {
142583 try {
142584 var body = readFileSync(pkgfile, 'UTF8');
142585 var pkg = JSON.parse(body);
142586
142587 if (opts.packageFilter) {
142588 pkg = opts.packageFilter(pkg, x);
142589 }
142590
142591 if (pkg.main) {
142592 if (pkg.main === '.' || pkg.main === './') {
142593 pkg.main = 'index';
142594 }
142595 var m = loadAsFileSync(path.resolve(x, pkg.main));
142596 if (m) return m;
142597 var n = loadAsDirectorySync(path.resolve(x, pkg.main));
142598 if (n) return n;
142599 }
142600 } catch (e) {}
142601 }
142602
142603 return loadAsFileSync(path.join(x, '/index'));
142604 }
142605
142606 function loadNodeModulesSync(x, start) {
142607 var dirs = nodeModulesPaths(start, opts);
142608 for (var i = 0; i < dirs.length; i++) {
142609 var dir = dirs[i];
142610 var m = loadAsFileSync(path.join(dir, '/', x));
142611 if (m) return m;
142612 var n = loadAsDirectorySync(path.join(dir, '/', x));
142613 if (n) return n;
142614 }
142615 }
142616};
142617
142618
142619/***/ }),
142620/* 890 */
142621/***/ (function(module, exports, __webpack_require__) {
142622
142623"use strict";
142624
142625const onetime = __webpack_require__(843);
142626const signalExit = __webpack_require__(421);
142627
142628module.exports = onetime(() => {
142629 signalExit(() => {
142630 process.stderr.write('\u001b[?25h');
142631 }, {alwaysLast: true});
142632});
142633
142634
142635/***/ }),
142636/* 891 */
142637/***/ (function(module, exports, __webpack_require__) {
142638
142639module.exports = __webpack_require__(892);
142640
142641/***/ }),
142642/* 892 */
142643/***/ (function(module, exports, __webpack_require__) {
142644
142645var RetryOperation = __webpack_require__(893);
142646
142647exports.operation = function(options) {
142648 var timeouts = exports.timeouts(options);
142649 return new RetryOperation(timeouts, {
142650 forever: options && options.forever,
142651 unref: options && options.unref
142652 });
142653};
142654
142655exports.timeouts = function(options) {
142656 if (options instanceof Array) {
142657 return [].concat(options);
142658 }
142659
142660 var opts = {
142661 retries: 10,
142662 factor: 2,
142663 minTimeout: 1 * 1000,
142664 maxTimeout: Infinity,
142665 randomize: false
142666 };
142667 for (var key in options) {
142668 opts[key] = options[key];
142669 }
142670
142671 if (opts.minTimeout > opts.maxTimeout) {
142672 throw new Error('minTimeout is greater than maxTimeout');
142673 }
142674
142675 var timeouts = [];
142676 for (var i = 0; i < opts.retries; i++) {
142677 timeouts.push(this.createTimeout(i, opts));
142678 }
142679
142680 if (options && options.forever && !timeouts.length) {
142681 timeouts.push(this.createTimeout(i, opts));
142682 }
142683
142684 // sort the array numerically ascending
142685 timeouts.sort(function(a,b) {
142686 return a - b;
142687 });
142688
142689 return timeouts;
142690};
142691
142692exports.createTimeout = function(attempt, opts) {
142693 var random = (opts.randomize)
142694 ? (Math.random() + 1)
142695 : 1;
142696
142697 var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt));
142698 timeout = Math.min(timeout, opts.maxTimeout);
142699
142700 return timeout;
142701};
142702
142703exports.wrap = function(obj, options, methods) {
142704 if (options instanceof Array) {
142705 methods = options;
142706 options = null;
142707 }
142708
142709 if (!methods) {
142710 methods = [];
142711 for (var key in obj) {
142712 if (typeof obj[key] === 'function') {
142713 methods.push(key);
142714 }
142715 }
142716 }
142717
142718 for (var i = 0; i < methods.length; i++) {
142719 var method = methods[i];
142720 var original = obj[method];
142721
142722 obj[method] = function retryWrapper() {
142723 var op = exports.operation(options);
142724 var args = Array.prototype.slice.call(arguments);
142725 var callback = args.pop();
142726
142727 args.push(function(err) {
142728 if (op.retry(err)) {
142729 return;
142730 }
142731 if (err) {
142732 arguments[0] = op.mainError();
142733 }
142734 callback.apply(this, arguments);
142735 });
142736
142737 op.attempt(function() {
142738 original.apply(obj, args);
142739 });
142740 };
142741 obj[method].options = options;
142742 }
142743};
142744
142745
142746/***/ }),
142747/* 893 */
142748/***/ (function(module, exports) {
142749
142750function RetryOperation(timeouts, options) {
142751 // Compatibility for the old (timeouts, retryForever) signature
142752 if (typeof options === 'boolean') {
142753 options = { forever: options };
142754 }
142755
142756 this._timeouts = timeouts;
142757 this._options = options || {};
142758 this._fn = null;
142759 this._errors = [];
142760 this._attempts = 1;
142761 this._operationTimeout = null;
142762 this._operationTimeoutCb = null;
142763 this._timeout = null;
142764
142765 if (this._options.forever) {
142766 this._cachedTimeouts = this._timeouts.slice(0);
142767 }
142768}
142769module.exports = RetryOperation;
142770
142771RetryOperation.prototype.stop = function() {
142772 if (this._timeout) {
142773 clearTimeout(this._timeout);
142774 }
142775
142776 this._timeouts = [];
142777 this._cachedTimeouts = null;
142778};
142779
142780RetryOperation.prototype.retry = function(err) {
142781 if (this._timeout) {
142782 clearTimeout(this._timeout);
142783 }
142784
142785 if (!err) {
142786 return false;
142787 }
142788
142789 this._errors.push(err);
142790
142791 var timeout = this._timeouts.shift();
142792 if (timeout === undefined) {
142793 if (this._cachedTimeouts) {
142794 // retry forever, only keep last error
142795 this._errors.splice(this._errors.length - 1, this._errors.length);
142796 this._timeouts = this._cachedTimeouts.slice(0);
142797 timeout = this._timeouts.shift();
142798 } else {
142799 return false;
142800 }
142801 }
142802
142803 var self = this;
142804 var timer = setTimeout(function() {
142805 self._attempts++;
142806
142807 if (self._operationTimeoutCb) {
142808 self._timeout = setTimeout(function() {
142809 self._operationTimeoutCb(self._attempts);
142810 }, self._operationTimeout);
142811
142812 if (this._options.unref) {
142813 self._timeout.unref();
142814 }
142815 }
142816
142817 self._fn(self._attempts);
142818 }, timeout);
142819
142820 if (this._options.unref) {
142821 timer.unref();
142822 }
142823
142824 return true;
142825};
142826
142827RetryOperation.prototype.attempt = function(fn, timeoutOps) {
142828 this._fn = fn;
142829
142830 if (timeoutOps) {
142831 if (timeoutOps.timeout) {
142832 this._operationTimeout = timeoutOps.timeout;
142833 }
142834 if (timeoutOps.cb) {
142835 this._operationTimeoutCb = timeoutOps.cb;
142836 }
142837 }
142838
142839 var self = this;
142840 if (this._operationTimeoutCb) {
142841 this._timeout = setTimeout(function() {
142842 self._operationTimeoutCb();
142843 }, self._operationTimeout);
142844 }
142845
142846 this._fn(this._attempts);
142847};
142848
142849RetryOperation.prototype.try = function(fn) {
142850 console.log('Using RetryOperation.try() is deprecated');
142851 this.attempt(fn);
142852};
142853
142854RetryOperation.prototype.start = function(fn) {
142855 console.log('Using RetryOperation.start() is deprecated');
142856 this.attempt(fn);
142857};
142858
142859RetryOperation.prototype.start = RetryOperation.prototype.try;
142860
142861RetryOperation.prototype.errors = function() {
142862 return this._errors;
142863};
142864
142865RetryOperation.prototype.attempts = function() {
142866 return this._attempts;
142867};
142868
142869RetryOperation.prototype.mainError = function() {
142870 if (this._errors.length === 0) {
142871 return null;
142872 }
142873
142874 var counts = {};
142875 var mainError = null;
142876 var mainErrorCount = 0;
142877
142878 for (var i = 0; i < this._errors.length; i++) {
142879 var error = this._errors[i];
142880 var message = error.message;
142881 var count = (counts[message] || 0) + 1;
142882
142883 counts[message] = count;
142884
142885 if (count >= mainErrorCount) {
142886 mainError = error;
142887 mainErrorCount = count;
142888 }
142889 }
142890
142891 return mainError;
142892};
142893
142894
142895/***/ }),
142896/* 894 */
142897/***/ (function(module, exports, __webpack_require__) {
142898
142899module.exports = rimraf
142900rimraf.sync = rimrafSync
142901
142902var assert = __webpack_require__(50)
142903var path = __webpack_require__(1)
142904var fs = __webpack_require__(12)
142905var glob = __webpack_require__(234)
142906var _0666 = parseInt('666', 8)
142907
142908var defaultGlobOpts = {
142909 nosort: true,
142910 silent: true
142911}
142912
142913// for EMFILE handling
142914var timeout = 0
142915
142916var isWindows = (process.platform === "win32")
142917
142918function defaults (options) {
142919 var methods = [
142920 'unlink',
142921 'chmod',
142922 'stat',
142923 'lstat',
142924 'rmdir',
142925 'readdir'
142926 ]
142927 methods.forEach(function(m) {
142928 options[m] = options[m] || fs[m]
142929 m = m + 'Sync'
142930 options[m] = options[m] || fs[m]
142931 })
142932
142933 options.maxBusyTries = options.maxBusyTries || 3
142934 options.emfileWait = options.emfileWait || 1000
142935 if (options.glob === false) {
142936 options.disableGlob = true
142937 }
142938 options.disableGlob = options.disableGlob || false
142939 options.glob = options.glob || defaultGlobOpts
142940}
142941
142942function rimraf (p, options, cb) {
142943 if (typeof options === 'function') {
142944 cb = options
142945 options = {}
142946 }
142947
142948 assert(p, 'rimraf: missing path')
142949 assert.equal(typeof p, 'string', 'rimraf: path should be a string')
142950 assert.equal(typeof cb, 'function', 'rimraf: callback function required')
142951 assert(options, 'rimraf: invalid options argument provided')
142952 assert.equal(typeof options, 'object', 'rimraf: options should be object')
142953
142954 defaults(options)
142955
142956 var busyTries = 0
142957 var errState = null
142958 var n = 0
142959
142960 if (options.disableGlob || !glob.hasMagic(p))
142961 return afterGlob(null, [p])
142962
142963 options.lstat(p, function (er, stat) {
142964 if (!er)
142965 return afterGlob(null, [p])
142966
142967 glob(p, options.glob, afterGlob)
142968 })
142969
142970 function next (er) {
142971 errState = errState || er
142972 if (--n === 0)
142973 cb(errState)
142974 }
142975
142976 function afterGlob (er, results) {
142977 if (er)
142978 return cb(er)
142979
142980 n = results.length
142981 if (n === 0)
142982 return cb()
142983
142984 results.forEach(function (p) {
142985 rimraf_(p, options, function CB (er) {
142986 if (er) {
142987 if ((er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
142988 busyTries < options.maxBusyTries) {
142989 busyTries ++
142990 var time = busyTries * 100
142991 // try again, with the same exact callback as this one.
142992 return setTimeout(function () {
142993 rimraf_(p, options, CB)
142994 }, time)
142995 }
142996
142997 // this one won't happen if graceful-fs is used.
142998 if (er.code === "EMFILE" && timeout < options.emfileWait) {
142999 return setTimeout(function () {
143000 rimraf_(p, options, CB)
143001 }, timeout ++)
143002 }
143003
143004 // already gone
143005 if (er.code === "ENOENT") er = null
143006 }
143007
143008 timeout = 0
143009 next(er)
143010 })
143011 })
143012 }
143013}
143014
143015// Two possible strategies.
143016// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
143017// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
143018//
143019// Both result in an extra syscall when you guess wrong. However, there
143020// are likely far more normal files in the world than directories. This
143021// is based on the assumption that a the average number of files per
143022// directory is >= 1.
143023//
143024// If anyone ever complains about this, then I guess the strategy could
143025// be made configurable somehow. But until then, YAGNI.
143026function rimraf_ (p, options, cb) {
143027 assert(p)
143028 assert(options)
143029 assert(typeof cb === 'function')
143030
143031 // sunos lets the root user unlink directories, which is... weird.
143032 // so we have to lstat here and make sure it's not a dir.
143033 options.lstat(p, function (er, st) {
143034 if (er && er.code === "ENOENT")
143035 return cb(null)
143036
143037 // Windows can EPERM on stat. Life is suffering.
143038 if (er && er.code === "EPERM" && isWindows)
143039 fixWinEPERM(p, options, er, cb)
143040
143041 if (st && st.isDirectory())
143042 return rmdir(p, options, er, cb)
143043
143044 options.unlink(p, function (er) {
143045 if (er) {
143046 if (er.code === "ENOENT")
143047 return cb(null)
143048 if (er.code === "EPERM")
143049 return (isWindows)
143050 ? fixWinEPERM(p, options, er, cb)
143051 : rmdir(p, options, er, cb)
143052 if (er.code === "EISDIR")
143053 return rmdir(p, options, er, cb)
143054 }
143055 return cb(er)
143056 })
143057 })
143058}
143059
143060function fixWinEPERM (p, options, er, cb) {
143061 assert(p)
143062 assert(options)
143063 assert(typeof cb === 'function')
143064 if (er)
143065 assert(er instanceof Error)
143066
143067 options.chmod(p, _0666, function (er2) {
143068 if (er2)
143069 cb(er2.code === "ENOENT" ? null : er)
143070 else
143071 options.stat(p, function(er3, stats) {
143072 if (er3)
143073 cb(er3.code === "ENOENT" ? null : er)
143074 else if (stats.isDirectory())
143075 rmdir(p, options, er, cb)
143076 else
143077 options.unlink(p, cb)
143078 })
143079 })
143080}
143081
143082function fixWinEPERMSync (p, options, er) {
143083 assert(p)
143084 assert(options)
143085 if (er)
143086 assert(er instanceof Error)
143087
143088 try {
143089 options.chmodSync(p, _0666)
143090 } catch (er2) {
143091 if (er2.code === "ENOENT")
143092 return
143093 else
143094 throw er
143095 }
143096
143097 try {
143098 var stats = options.statSync(p)
143099 } catch (er3) {
143100 if (er3.code === "ENOENT")
143101 return
143102 else
143103 throw er
143104 }
143105
143106 if (stats.isDirectory())
143107 rmdirSync(p, options, er)
143108 else
143109 options.unlinkSync(p)
143110}
143111
143112function rmdir (p, options, originalEr, cb) {
143113 assert(p)
143114 assert(options)
143115 if (originalEr)
143116 assert(originalEr instanceof Error)
143117 assert(typeof cb === 'function')
143118
143119 // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
143120 // if we guessed wrong, and it's not a directory, then
143121 // raise the original error.
143122 options.rmdir(p, function (er) {
143123 if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
143124 rmkids(p, options, cb)
143125 else if (er && er.code === "ENOTDIR")
143126 cb(originalEr)
143127 else
143128 cb(er)
143129 })
143130}
143131
143132function rmkids(p, options, cb) {
143133 assert(p)
143134 assert(options)
143135 assert(typeof cb === 'function')
143136
143137 options.readdir(p, function (er, files) {
143138 if (er)
143139 return cb(er)
143140 var n = files.length
143141 if (n === 0)
143142 return options.rmdir(p, cb)
143143 var errState
143144 files.forEach(function (f) {
143145 rimraf(path.join(p, f), options, function (er) {
143146 if (errState)
143147 return
143148 if (er)
143149 return cb(errState = er)
143150 if (--n === 0)
143151 options.rmdir(p, cb)
143152 })
143153 })
143154 })
143155}
143156
143157// this looks simpler, and is strictly *faster*, but will
143158// tie up the JavaScript thread and fail on excessively
143159// deep directory trees.
143160function rimrafSync (p, options) {
143161 options = options || {}
143162 defaults(options)
143163
143164 assert(p, 'rimraf: missing path')
143165 assert.equal(typeof p, 'string', 'rimraf: path should be a string')
143166 assert(options, 'rimraf: missing options')
143167 assert.equal(typeof options, 'object', 'rimraf: options should be object')
143168
143169 var results
143170
143171 if (options.disableGlob || !glob.hasMagic(p)) {
143172 results = [p]
143173 } else {
143174 try {
143175 options.lstatSync(p)
143176 results = [p]
143177 } catch (er) {
143178 results = glob.sync(p, options.glob)
143179 }
143180 }
143181
143182 if (!results.length)
143183 return
143184
143185 for (var i = 0; i < results.length; i++) {
143186 var p = results[i]
143187
143188 try {
143189 var st = options.lstatSync(p)
143190 } catch (er) {
143191 if (er.code === "ENOENT")
143192 return
143193
143194 // Windows can EPERM on stat. Life is suffering.
143195 if (er.code === "EPERM" && isWindows)
143196 fixWinEPERMSync(p, options, er)
143197 }
143198
143199 try {
143200 // sunos lets the root user unlink directories, which is... weird.
143201 if (st && st.isDirectory())
143202 rmdirSync(p, options, null)
143203 else
143204 options.unlinkSync(p)
143205 } catch (er) {
143206 if (er.code === "ENOENT")
143207 return
143208 if (er.code === "EPERM")
143209 return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
143210 if (er.code !== "EISDIR")
143211 throw er
143212
143213 rmdirSync(p, options, er)
143214 }
143215 }
143216}
143217
143218function rmdirSync (p, options, originalEr) {
143219 assert(p)
143220 assert(options)
143221 if (originalEr)
143222 assert(originalEr instanceof Error)
143223
143224 try {
143225 options.rmdirSync(p)
143226 } catch (er) {
143227 if (er.code === "ENOENT")
143228 return
143229 if (er.code === "ENOTDIR")
143230 throw originalEr
143231 if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
143232 rmkidsSync(p, options)
143233 }
143234}
143235
143236function rmkidsSync (p, options) {
143237 assert(p)
143238 assert(options)
143239 options.readdirSync(p).forEach(function (f) {
143240 rimrafSync(path.join(p, f), options)
143241 })
143242
143243 // We only end up here once we got ENOTEMPTY at least once, and
143244 // at this point, we are guaranteed to have removed all the kids.
143245 // So, we know that it won't be ENOENT or ENOTDIR or anything else.
143246 // try really hard to delete stuff on windows, because it has a
143247 // PROFOUNDLY annoying habit of not closing handles promptly when
143248 // files are deleted, resulting in spurious ENOTEMPTY errors.
143249 var retries = isWindows ? 100 : 1
143250 var i = 0
143251 do {
143252 var threw = true
143253 try {
143254 var ret = options.rmdirSync(p, options)
143255 threw = false
143256 return ret
143257 } finally {
143258 if (++i < retries && threw)
143259 continue
143260 }
143261 } while (true)
143262}
143263
143264
143265/***/ }),
143266/* 895 */
143267/***/ (function(module, __webpack_exports__, __webpack_require__) {
143268
143269"use strict";
143270/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return SubscribeOnObservable; });
143271/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
143272/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(17);
143273/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_asap__ = __webpack_require__(408);
143274/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isNumeric__ = __webpack_require__(181);
143275/** PURE_IMPORTS_START tslib,_Observable,_scheduler_asap,_util_isNumeric PURE_IMPORTS_END */
143276
143277
143278
143279
143280var SubscribeOnObservable = /*@__PURE__*/ (function (_super) {
143281 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubscribeOnObservable, _super);
143282 function SubscribeOnObservable(source, delayTime, scheduler) {
143283 if (delayTime === void 0) {
143284 delayTime = 0;
143285 }
143286 if (scheduler === void 0) {
143287 scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_asap__["a" /* asap */];
143288 }
143289 var _this = _super.call(this) || this;
143290 _this.source = source;
143291 _this.delayTime = delayTime;
143292 _this.scheduler = scheduler;
143293 if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isNumeric__["a" /* isNumeric */])(delayTime) || delayTime < 0) {
143294 _this.delayTime = 0;
143295 }
143296 if (!scheduler || typeof scheduler.schedule !== 'function') {
143297 _this.scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_asap__["a" /* asap */];
143298 }
143299 return _this;
143300 }
143301 SubscribeOnObservable.create = function (source, delay, scheduler) {
143302 if (delay === void 0) {
143303 delay = 0;
143304 }
143305 if (scheduler === void 0) {
143306 scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_asap__["a" /* asap */];
143307 }
143308 return new SubscribeOnObservable(source, delay, scheduler);
143309 };
143310 SubscribeOnObservable.dispatch = function (arg) {
143311 var source = arg.source, subscriber = arg.subscriber;
143312 return this.add(source.subscribe(subscriber));
143313 };
143314 SubscribeOnObservable.prototype._subscribe = function (subscriber) {
143315 var delay = this.delayTime;
143316 var source = this.source;
143317 var scheduler = this.scheduler;
143318 return scheduler.schedule(SubscribeOnObservable.dispatch, delay, {
143319 source: source, subscriber: subscriber
143320 });
143321 };
143322 return SubscribeOnObservable;
143323}(__WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */]));
143324
143325//# sourceMappingURL=SubscribeOnObservable.js.map
143326
143327
143328/***/ }),
143329/* 896 */
143330/***/ (function(module, __webpack_exports__, __webpack_require__) {
143331
143332"use strict";
143333/* harmony export (immutable) */ __webpack_exports__["a"] = bindCallback;
143334/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
143335/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__ = __webpack_require__(174);
143336/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__operators_map__ = __webpack_require__(54);
143337/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_canReportError__ = __webpack_require__(262);
143338/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isArray__ = __webpack_require__(48);
143339/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_isScheduler__ = __webpack_require__(56);
143340/** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_canReportError,_util_isArray,_util_isScheduler PURE_IMPORTS_END */
143341
143342
143343
143344
143345
143346
143347function bindCallback(callbackFunc, resultSelector, scheduler) {
143348 if (resultSelector) {
143349 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isScheduler__["a" /* isScheduler */])(resultSelector)) {
143350 scheduler = resultSelector;
143351 }
143352 else {
143353 return function () {
143354 var args = [];
143355 for (var _i = 0; _i < arguments.length; _i++) {
143356 args[_i] = arguments[_i];
143357 }
143358 return bindCallback(callbackFunc, scheduler).apply(void 0, args).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__operators_map__["a" /* map */])(function (args) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isArray__["a" /* isArray */])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
143359 };
143360 }
143361 }
143362 return function () {
143363 var args = [];
143364 for (var _i = 0; _i < arguments.length; _i++) {
143365 args[_i] = arguments[_i];
143366 }
143367 var context = this;
143368 var subject;
143369 var params = {
143370 context: context,
143371 subject: subject,
143372 callbackFunc: callbackFunc,
143373 scheduler: scheduler,
143374 };
143375 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
143376 if (!scheduler) {
143377 if (!subject) {
143378 subject = new __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__["a" /* AsyncSubject */]();
143379 var handler = function () {
143380 var innerArgs = [];
143381 for (var _i = 0; _i < arguments.length; _i++) {
143382 innerArgs[_i] = arguments[_i];
143383 }
143384 subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
143385 subject.complete();
143386 };
143387 try {
143388 callbackFunc.apply(context, args.concat([handler]));
143389 }
143390 catch (err) {
143391 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_canReportError__["a" /* canReportError */])(subject)) {
143392 subject.error(err);
143393 }
143394 else {
143395 console.warn(err);
143396 }
143397 }
143398 }
143399 return subject.subscribe(subscriber);
143400 }
143401 else {
143402 var state = {
143403 args: args, subscriber: subscriber, params: params,
143404 };
143405 return scheduler.schedule(dispatch, 0, state);
143406 }
143407 });
143408 };
143409}
143410function dispatch(state) {
143411 var _this = this;
143412 var self = this;
143413 var args = state.args, subscriber = state.subscriber, params = state.params;
143414 var callbackFunc = params.callbackFunc, context = params.context, scheduler = params.scheduler;
143415 var subject = params.subject;
143416 if (!subject) {
143417 subject = params.subject = new __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__["a" /* AsyncSubject */]();
143418 var handler = function () {
143419 var innerArgs = [];
143420 for (var _i = 0; _i < arguments.length; _i++) {
143421 innerArgs[_i] = arguments[_i];
143422 }
143423 var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
143424 _this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
143425 };
143426 try {
143427 callbackFunc.apply(context, args.concat([handler]));
143428 }
143429 catch (err) {
143430 subject.error(err);
143431 }
143432 }
143433 this.add(subject.subscribe(subscriber));
143434}
143435function dispatchNext(state) {
143436 var value = state.value, subject = state.subject;
143437 subject.next(value);
143438 subject.complete();
143439}
143440function dispatchError(state) {
143441 var err = state.err, subject = state.subject;
143442 subject.error(err);
143443}
143444//# sourceMappingURL=bindCallback.js.map
143445
143446
143447/***/ }),
143448/* 897 */
143449/***/ (function(module, __webpack_exports__, __webpack_require__) {
143450
143451"use strict";
143452/* harmony export (immutable) */ __webpack_exports__["a"] = bindNodeCallback;
143453/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
143454/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__ = __webpack_require__(174);
143455/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__operators_map__ = __webpack_require__(54);
143456/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_canReportError__ = __webpack_require__(262);
143457/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isScheduler__ = __webpack_require__(56);
143458/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_isArray__ = __webpack_require__(48);
143459/** PURE_IMPORTS_START _Observable,_AsyncSubject,_operators_map,_util_canReportError,_util_isScheduler,_util_isArray PURE_IMPORTS_END */
143460
143461
143462
143463
143464
143465
143466function bindNodeCallback(callbackFunc, resultSelector, scheduler) {
143467 if (resultSelector) {
143468 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isScheduler__["a" /* isScheduler */])(resultSelector)) {
143469 scheduler = resultSelector;
143470 }
143471 else {
143472 return function () {
143473 var args = [];
143474 for (var _i = 0; _i < arguments.length; _i++) {
143475 args[_i] = arguments[_i];
143476 }
143477 return bindNodeCallback(callbackFunc, scheduler).apply(void 0, args).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__operators_map__["a" /* map */])(function (args) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isArray__["a" /* isArray */])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
143478 };
143479 }
143480 }
143481 return function () {
143482 var args = [];
143483 for (var _i = 0; _i < arguments.length; _i++) {
143484 args[_i] = arguments[_i];
143485 }
143486 var params = {
143487 subject: undefined,
143488 args: args,
143489 callbackFunc: callbackFunc,
143490 scheduler: scheduler,
143491 context: this,
143492 };
143493 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
143494 var context = params.context;
143495 var subject = params.subject;
143496 if (!scheduler) {
143497 if (!subject) {
143498 subject = params.subject = new __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__["a" /* AsyncSubject */]();
143499 var handler = function () {
143500 var innerArgs = [];
143501 for (var _i = 0; _i < arguments.length; _i++) {
143502 innerArgs[_i] = arguments[_i];
143503 }
143504 var err = innerArgs.shift();
143505 if (err) {
143506 subject.error(err);
143507 return;
143508 }
143509 subject.next(innerArgs.length <= 1 ? innerArgs[0] : innerArgs);
143510 subject.complete();
143511 };
143512 try {
143513 callbackFunc.apply(context, args.concat([handler]));
143514 }
143515 catch (err) {
143516 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_canReportError__["a" /* canReportError */])(subject)) {
143517 subject.error(err);
143518 }
143519 else {
143520 console.warn(err);
143521 }
143522 }
143523 }
143524 return subject.subscribe(subscriber);
143525 }
143526 else {
143527 return scheduler.schedule(dispatch, 0, { params: params, subscriber: subscriber, context: context });
143528 }
143529 });
143530 };
143531}
143532function dispatch(state) {
143533 var _this = this;
143534 var params = state.params, subscriber = state.subscriber, context = state.context;
143535 var callbackFunc = params.callbackFunc, args = params.args, scheduler = params.scheduler;
143536 var subject = params.subject;
143537 if (!subject) {
143538 subject = params.subject = new __WEBPACK_IMPORTED_MODULE_1__AsyncSubject__["a" /* AsyncSubject */]();
143539 var handler = function () {
143540 var innerArgs = [];
143541 for (var _i = 0; _i < arguments.length; _i++) {
143542 innerArgs[_i] = arguments[_i];
143543 }
143544 var err = innerArgs.shift();
143545 if (err) {
143546 _this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
143547 }
143548 else {
143549 var value = innerArgs.length <= 1 ? innerArgs[0] : innerArgs;
143550 _this.add(scheduler.schedule(dispatchNext, 0, { value: value, subject: subject }));
143551 }
143552 };
143553 try {
143554 callbackFunc.apply(context, args.concat([handler]));
143555 }
143556 catch (err) {
143557 this.add(scheduler.schedule(dispatchError, 0, { err: err, subject: subject }));
143558 }
143559 }
143560 this.add(subject.subscribe(subscriber));
143561}
143562function dispatchNext(arg) {
143563 var value = arg.value, subject = arg.subject;
143564 subject.next(value);
143565 subject.complete();
143566}
143567function dispatchError(arg) {
143568 var err = arg.err, subject = arg.subject;
143569 subject.error(err);
143570}
143571//# sourceMappingURL=bindNodeCallback.js.map
143572
143573
143574/***/ }),
143575/* 898 */
143576/***/ (function(module, __webpack_exports__, __webpack_require__) {
143577
143578"use strict";
143579/* harmony export (immutable) */ __webpack_exports__["a"] = forkJoin;
143580/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
143581/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(17);
143582/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(48);
143583/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__empty__ = __webpack_require__(46);
143584/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
143585/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__OuterSubscriber__ = __webpack_require__(18);
143586/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__operators_map__ = __webpack_require__(54);
143587/** PURE_IMPORTS_START tslib,_Observable,_util_isArray,_empty,_util_subscribeToResult,_OuterSubscriber,_operators_map PURE_IMPORTS_END */
143588
143589
143590
143591
143592
143593
143594
143595function forkJoin() {
143596 var sources = [];
143597 for (var _i = 0; _i < arguments.length; _i++) {
143598 sources[_i] = arguments[_i];
143599 }
143600 var resultSelector;
143601 if (typeof sources[sources.length - 1] === 'function') {
143602 resultSelector = sources.pop();
143603 }
143604 if (sources.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(sources[0])) {
143605 sources = sources[0];
143606 }
143607 if (sources.length === 0) {
143608 return __WEBPACK_IMPORTED_MODULE_3__empty__["b" /* EMPTY */];
143609 }
143610 if (resultSelector) {
143611 return forkJoin(sources).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__operators_map__["a" /* map */])(function (args) { return resultSelector.apply(void 0, args); }));
143612 }
143613 return new __WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */](function (subscriber) {
143614 return new ForkJoinSubscriber(subscriber, sources);
143615 });
143616}
143617var ForkJoinSubscriber = /*@__PURE__*/ (function (_super) {
143618 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ForkJoinSubscriber, _super);
143619 function ForkJoinSubscriber(destination, sources) {
143620 var _this = _super.call(this, destination) || this;
143621 _this.sources = sources;
143622 _this.completed = 0;
143623 _this.haveValues = 0;
143624 var len = sources.length;
143625 _this.values = new Array(len);
143626 for (var i = 0; i < len; i++) {
143627 var source = sources[i];
143628 var innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(_this, source, null, i);
143629 if (innerSubscription) {
143630 _this.add(innerSubscription);
143631 }
143632 }
143633 return _this;
143634 }
143635 ForkJoinSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
143636 this.values[outerIndex] = innerValue;
143637 if (!innerSub._hasValue) {
143638 innerSub._hasValue = true;
143639 this.haveValues++;
143640 }
143641 };
143642 ForkJoinSubscriber.prototype.notifyComplete = function (innerSub) {
143643 var _a = this, destination = _a.destination, haveValues = _a.haveValues, values = _a.values;
143644 var len = values.length;
143645 if (!innerSub._hasValue) {
143646 destination.complete();
143647 return;
143648 }
143649 this.completed++;
143650 if (this.completed !== len) {
143651 return;
143652 }
143653 if (haveValues === len) {
143654 destination.next(values);
143655 }
143656 destination.complete();
143657 };
143658 return ForkJoinSubscriber;
143659}(__WEBPACK_IMPORTED_MODULE_5__OuterSubscriber__["a" /* OuterSubscriber */]));
143660//# sourceMappingURL=forkJoin.js.map
143661
143662
143663/***/ }),
143664/* 899 */
143665/***/ (function(module, __webpack_exports__, __webpack_require__) {
143666
143667"use strict";
143668/* harmony export (immutable) */ __webpack_exports__["a"] = fromEvent;
143669/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
143670/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isArray__ = __webpack_require__(48);
143671/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(142);
143672/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__operators_map__ = __webpack_require__(54);
143673/** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */
143674
143675
143676
143677
143678var toString = Object.prototype.toString;
143679function fromEvent(target, eventName, options, resultSelector) {
143680 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(options)) {
143681 resultSelector = options;
143682 options = undefined;
143683 }
143684 if (resultSelector) {
143685 return fromEvent(target, eventName, options).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__operators_map__["a" /* map */])(function (args) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isArray__["a" /* isArray */])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
143686 }
143687 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
143688 function handler(e) {
143689 if (arguments.length > 1) {
143690 subscriber.next(Array.prototype.slice.call(arguments));
143691 }
143692 else {
143693 subscriber.next(e);
143694 }
143695 }
143696 setupSubscription(target, eventName, handler, subscriber, options);
143697 });
143698}
143699function setupSubscription(sourceObj, eventName, handler, subscriber, options) {
143700 var unsubscribe;
143701 if (isEventTarget(sourceObj)) {
143702 var source_1 = sourceObj;
143703 sourceObj.addEventListener(eventName, handler, options);
143704 unsubscribe = function () { return source_1.removeEventListener(eventName, handler, options); };
143705 }
143706 else if (isJQueryStyleEventEmitter(sourceObj)) {
143707 var source_2 = sourceObj;
143708 sourceObj.on(eventName, handler);
143709 unsubscribe = function () { return source_2.off(eventName, handler); };
143710 }
143711 else if (isNodeStyleEventEmitter(sourceObj)) {
143712 var source_3 = sourceObj;
143713 sourceObj.addListener(eventName, handler);
143714 unsubscribe = function () { return source_3.removeListener(eventName, handler); };
143715 }
143716 else if (sourceObj && sourceObj.length) {
143717 for (var i = 0, len = sourceObj.length; i < len; i++) {
143718 setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
143719 }
143720 }
143721 else {
143722 throw new TypeError('Invalid event target');
143723 }
143724 subscriber.add(unsubscribe);
143725}
143726function isNodeStyleEventEmitter(sourceObj) {
143727 return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';
143728}
143729function isJQueryStyleEventEmitter(sourceObj) {
143730 return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';
143731}
143732function isEventTarget(sourceObj) {
143733 return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';
143734}
143735//# sourceMappingURL=fromEvent.js.map
143736
143737
143738/***/ }),
143739/* 900 */
143740/***/ (function(module, __webpack_exports__, __webpack_require__) {
143741
143742"use strict";
143743/* harmony export (immutable) */ __webpack_exports__["a"] = fromEventPattern;
143744/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
143745/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isArray__ = __webpack_require__(48);
143746/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(142);
143747/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__operators_map__ = __webpack_require__(54);
143748/** PURE_IMPORTS_START _Observable,_util_isArray,_util_isFunction,_operators_map PURE_IMPORTS_END */
143749
143750
143751
143752
143753function fromEventPattern(addHandler, removeHandler, resultSelector) {
143754 if (resultSelector) {
143755 return fromEventPattern(addHandler, removeHandler).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__operators_map__["a" /* map */])(function (args) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isArray__["a" /* isArray */])(args) ? resultSelector.apply(void 0, args) : resultSelector(args); }));
143756 }
143757 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
143758 var handler = function () {
143759 var e = [];
143760 for (var _i = 0; _i < arguments.length; _i++) {
143761 e[_i] = arguments[_i];
143762 }
143763 return subscriber.next(e.length === 1 ? e[0] : e);
143764 };
143765 var retValue;
143766 try {
143767 retValue = addHandler(handler);
143768 }
143769 catch (err) {
143770 subscriber.error(err);
143771 return undefined;
143772 }
143773 if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(removeHandler)) {
143774 return undefined;
143775 }
143776 return function () { return removeHandler(handler, retValue); };
143777 });
143778}
143779//# sourceMappingURL=fromEventPattern.js.map
143780
143781
143782/***/ }),
143783/* 901 */
143784/***/ (function(module, __webpack_exports__, __webpack_require__) {
143785
143786"use strict";
143787/* harmony export (immutable) */ __webpack_exports__["a"] = fromIterable;
143788/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
143789/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
143790/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__symbol_iterator__ = __webpack_require__(139);
143791/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToIterable__ = __webpack_require__(418);
143792/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_iterator,_util_subscribeToIterable PURE_IMPORTS_END */
143793
143794
143795
143796
143797function fromIterable(input, scheduler) {
143798 if (!input) {
143799 throw new Error('Iterable cannot be null');
143800 }
143801 if (!scheduler) {
143802 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToIterable__["a" /* subscribeToIterable */])(input));
143803 }
143804 else {
143805 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
143806 var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
143807 var iterator;
143808 sub.add(function () {
143809 if (iterator && typeof iterator.return === 'function') {
143810 iterator.return();
143811 }
143812 });
143813 sub.add(scheduler.schedule(function () {
143814 iterator = input[__WEBPACK_IMPORTED_MODULE_2__symbol_iterator__["a" /* iterator */]]();
143815 sub.add(scheduler.schedule(function () {
143816 if (subscriber.closed) {
143817 return;
143818 }
143819 var value;
143820 var done;
143821 try {
143822 var result = iterator.next();
143823 value = result.value;
143824 done = result.done;
143825 }
143826 catch (err) {
143827 subscriber.error(err);
143828 return;
143829 }
143830 if (done) {
143831 subscriber.complete();
143832 }
143833 else {
143834 subscriber.next(value);
143835 this.schedule();
143836 }
143837 }));
143838 }));
143839 return sub;
143840 });
143841 }
143842}
143843//# sourceMappingURL=fromIterable.js.map
143844
143845
143846/***/ }),
143847/* 902 */
143848/***/ (function(module, __webpack_exports__, __webpack_require__) {
143849
143850"use strict";
143851/* harmony export (immutable) */ __webpack_exports__["a"] = fromObservable;
143852/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
143853/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
143854/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__symbol_observable__ = __webpack_require__(112);
143855/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToObservable__ = __webpack_require__(419);
143856/** PURE_IMPORTS_START _Observable,_Subscription,_symbol_observable,_util_subscribeToObservable PURE_IMPORTS_END */
143857
143858
143859
143860
143861function fromObservable(input, scheduler) {
143862 if (!scheduler) {
143863 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToObservable__["a" /* subscribeToObservable */])(input));
143864 }
143865 else {
143866 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
143867 var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
143868 sub.add(scheduler.schedule(function () {
143869 var observable = input[__WEBPACK_IMPORTED_MODULE_2__symbol_observable__["a" /* observable */]]();
143870 sub.add(observable.subscribe({
143871 next: function (value) { sub.add(scheduler.schedule(function () { return subscriber.next(value); })); },
143872 error: function (err) { sub.add(scheduler.schedule(function () { return subscriber.error(err); })); },
143873 complete: function () { sub.add(scheduler.schedule(function () { return subscriber.complete(); })); },
143874 }));
143875 }));
143876 return sub;
143877 });
143878 }
143879}
143880//# sourceMappingURL=fromObservable.js.map
143881
143882
143883/***/ }),
143884/* 903 */
143885/***/ (function(module, __webpack_exports__, __webpack_require__) {
143886
143887"use strict";
143888/* harmony export (immutable) */ __webpack_exports__["a"] = fromPromise;
143889/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
143890/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
143891/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToPromise__ = __webpack_require__(420);
143892/** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToPromise PURE_IMPORTS_END */
143893
143894
143895
143896function fromPromise(input, scheduler) {
143897 if (!scheduler) {
143898 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToPromise__["a" /* subscribeToPromise */])(input));
143899 }
143900 else {
143901 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
143902 var sub = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
143903 sub.add(scheduler.schedule(function () {
143904 return input.then(function (value) {
143905 sub.add(scheduler.schedule(function () {
143906 subscriber.next(value);
143907 sub.add(scheduler.schedule(function () { return subscriber.complete(); }));
143908 }));
143909 }, function (err) {
143910 sub.add(scheduler.schedule(function () { return subscriber.error(err); }));
143911 });
143912 }));
143913 return sub;
143914 });
143915 }
143916}
143917//# sourceMappingURL=fromPromise.js.map
143918
143919
143920/***/ }),
143921/* 904 */
143922/***/ (function(module, __webpack_exports__, __webpack_require__) {
143923
143924"use strict";
143925/* harmony export (immutable) */ __webpack_exports__["a"] = generate;
143926/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
143927/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_identity__ = __webpack_require__(113);
143928/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isScheduler__ = __webpack_require__(56);
143929/** PURE_IMPORTS_START _Observable,_util_identity,_util_isScheduler PURE_IMPORTS_END */
143930
143931
143932
143933function generate(initialStateOrOptions, condition, iterate, resultSelectorOrObservable, scheduler) {
143934 var resultSelector;
143935 var initialState;
143936 if (arguments.length == 1) {
143937 var options = initialStateOrOptions;
143938 initialState = options.initialState;
143939 condition = options.condition;
143940 iterate = options.iterate;
143941 resultSelector = options.resultSelector || __WEBPACK_IMPORTED_MODULE_1__util_identity__["a" /* identity */];
143942 scheduler = options.scheduler;
143943 }
143944 else if (resultSelectorOrObservable === undefined || __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isScheduler__["a" /* isScheduler */])(resultSelectorOrObservable)) {
143945 initialState = initialStateOrOptions;
143946 resultSelector = __WEBPACK_IMPORTED_MODULE_1__util_identity__["a" /* identity */];
143947 scheduler = resultSelectorOrObservable;
143948 }
143949 else {
143950 initialState = initialStateOrOptions;
143951 resultSelector = resultSelectorOrObservable;
143952 }
143953 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
143954 var state = initialState;
143955 if (scheduler) {
143956 return scheduler.schedule(dispatch, 0, {
143957 subscriber: subscriber,
143958 iterate: iterate,
143959 condition: condition,
143960 resultSelector: resultSelector,
143961 state: state
143962 });
143963 }
143964 do {
143965 if (condition) {
143966 var conditionResult = void 0;
143967 try {
143968 conditionResult = condition(state);
143969 }
143970 catch (err) {
143971 subscriber.error(err);
143972 return undefined;
143973 }
143974 if (!conditionResult) {
143975 subscriber.complete();
143976 break;
143977 }
143978 }
143979 var value = void 0;
143980 try {
143981 value = resultSelector(state);
143982 }
143983 catch (err) {
143984 subscriber.error(err);
143985 return undefined;
143986 }
143987 subscriber.next(value);
143988 if (subscriber.closed) {
143989 break;
143990 }
143991 try {
143992 state = iterate(state);
143993 }
143994 catch (err) {
143995 subscriber.error(err);
143996 return undefined;
143997 }
143998 } while (true);
143999 return undefined;
144000 });
144001}
144002function dispatch(state) {
144003 var subscriber = state.subscriber, condition = state.condition;
144004 if (subscriber.closed) {
144005 return undefined;
144006 }
144007 if (state.needIterate) {
144008 try {
144009 state.state = state.iterate(state.state);
144010 }
144011 catch (err) {
144012 subscriber.error(err);
144013 return undefined;
144014 }
144015 }
144016 else {
144017 state.needIterate = true;
144018 }
144019 if (condition) {
144020 var conditionResult = void 0;
144021 try {
144022 conditionResult = condition(state.state);
144023 }
144024 catch (err) {
144025 subscriber.error(err);
144026 return undefined;
144027 }
144028 if (!conditionResult) {
144029 subscriber.complete();
144030 return undefined;
144031 }
144032 if (subscriber.closed) {
144033 return undefined;
144034 }
144035 }
144036 var value;
144037 try {
144038 value = state.resultSelector(state.state);
144039 }
144040 catch (err) {
144041 subscriber.error(err);
144042 return undefined;
144043 }
144044 if (subscriber.closed) {
144045 return undefined;
144046 }
144047 subscriber.next(value);
144048 if (subscriber.closed) {
144049 return undefined;
144050 }
144051 return this.schedule(state);
144052}
144053//# sourceMappingURL=generate.js.map
144054
144055
144056/***/ }),
144057/* 905 */
144058/***/ (function(module, __webpack_exports__, __webpack_require__) {
144059
144060"use strict";
144061/* harmony export (immutable) */ __webpack_exports__["a"] = iif;
144062/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__defer__ = __webpack_require__(250);
144063/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__empty__ = __webpack_require__(46);
144064/** PURE_IMPORTS_START _defer,_empty PURE_IMPORTS_END */
144065
144066
144067function iif(condition, trueResult, falseResult) {
144068 if (trueResult === void 0) {
144069 trueResult = __WEBPACK_IMPORTED_MODULE_1__empty__["b" /* EMPTY */];
144070 }
144071 if (falseResult === void 0) {
144072 falseResult = __WEBPACK_IMPORTED_MODULE_1__empty__["b" /* EMPTY */];
144073 }
144074 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__defer__["a" /* defer */])(function () { return condition() ? trueResult : falseResult; });
144075}
144076//# sourceMappingURL=iif.js.map
144077
144078
144079/***/ }),
144080/* 906 */
144081/***/ (function(module, __webpack_exports__, __webpack_require__) {
144082
144083"use strict";
144084/* harmony export (immutable) */ __webpack_exports__["a"] = interval;
144085/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
144086/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(47);
144087/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isNumeric__ = __webpack_require__(181);
144088/** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric PURE_IMPORTS_END */
144089
144090
144091
144092function interval(period, scheduler) {
144093 if (period === void 0) {
144094 period = 0;
144095 }
144096 if (scheduler === void 0) {
144097 scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */];
144098 }
144099 if (!__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isNumeric__["a" /* isNumeric */])(period) || period < 0) {
144100 period = 0;
144101 }
144102 if (!scheduler || typeof scheduler.schedule !== 'function') {
144103 scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */];
144104 }
144105 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
144106 subscriber.add(scheduler.schedule(dispatch, period, { subscriber: subscriber, counter: 0, period: period }));
144107 return subscriber;
144108 });
144109}
144110function dispatch(state) {
144111 var subscriber = state.subscriber, counter = state.counter, period = state.period;
144112 subscriber.next(counter);
144113 this.schedule({ subscriber: subscriber, counter: counter + 1, period: period }, period);
144114}
144115//# sourceMappingURL=interval.js.map
144116
144117
144118/***/ }),
144119/* 907 */
144120/***/ (function(module, __webpack_exports__, __webpack_require__) {
144121
144122"use strict";
144123/* harmony export (immutable) */ __webpack_exports__["a"] = onErrorResumeNext;
144124/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
144125/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__from__ = __webpack_require__(64);
144126/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(48);
144127/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__empty__ = __webpack_require__(46);
144128/** PURE_IMPORTS_START _Observable,_from,_util_isArray,_empty PURE_IMPORTS_END */
144129
144130
144131
144132
144133function onErrorResumeNext() {
144134 var sources = [];
144135 for (var _i = 0; _i < arguments.length; _i++) {
144136 sources[_i] = arguments[_i];
144137 }
144138 if (sources.length === 0) {
144139 return __WEBPACK_IMPORTED_MODULE_3__empty__["b" /* EMPTY */];
144140 }
144141 var first = sources[0], remainder = sources.slice(1);
144142 if (sources.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(first)) {
144143 return onErrorResumeNext.apply(void 0, first);
144144 }
144145 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
144146 var subNext = function () { return subscriber.add(onErrorResumeNext.apply(void 0, remainder).subscribe(subscriber)); };
144147 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__from__["a" /* from */])(first).subscribe({
144148 next: function (value) { subscriber.next(value); },
144149 error: subNext,
144150 complete: subNext,
144151 });
144152 });
144153}
144154//# sourceMappingURL=onErrorResumeNext.js.map
144155
144156
144157/***/ }),
144158/* 908 */
144159/***/ (function(module, __webpack_exports__, __webpack_require__) {
144160
144161"use strict";
144162/* harmony export (immutable) */ __webpack_exports__["a"] = pairs;
144163/* unused harmony export dispatch */
144164/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
144165/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
144166/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */
144167
144168
144169function pairs(obj, scheduler) {
144170 if (!scheduler) {
144171 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
144172 var keys = Object.keys(obj);
144173 for (var i = 0; i < keys.length && !subscriber.closed; i++) {
144174 var key = keys[i];
144175 if (obj.hasOwnProperty(key)) {
144176 subscriber.next([key, obj[key]]);
144177 }
144178 }
144179 subscriber.complete();
144180 });
144181 }
144182 else {
144183 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
144184 var keys = Object.keys(obj);
144185 var subscription = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
144186 subscription.add(scheduler.schedule(dispatch, 0, { keys: keys, index: 0, subscriber: subscriber, subscription: subscription, obj: obj }));
144187 return subscription;
144188 });
144189 }
144190}
144191function dispatch(state) {
144192 var keys = state.keys, index = state.index, subscriber = state.subscriber, subscription = state.subscription, obj = state.obj;
144193 if (!subscriber.closed) {
144194 if (index < keys.length) {
144195 var key = keys[index];
144196 subscriber.next([key, obj[key]]);
144197 subscription.add(this.schedule({ keys: keys, index: index + 1, subscriber: subscriber, subscription: subscription, obj: obj }));
144198 }
144199 else {
144200 subscriber.complete();
144201 }
144202 }
144203}
144204//# sourceMappingURL=pairs.js.map
144205
144206
144207/***/ }),
144208/* 909 */
144209/***/ (function(module, __webpack_exports__, __webpack_require__) {
144210
144211"use strict";
144212/* harmony export (immutable) */ __webpack_exports__["a"] = range;
144213/* unused harmony export dispatch */
144214/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
144215/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
144216
144217function range(start, count, scheduler) {
144218 if (start === void 0) {
144219 start = 0;
144220 }
144221 if (count === void 0) {
144222 count = 0;
144223 }
144224 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
144225 var index = 0;
144226 var current = start;
144227 if (scheduler) {
144228 return scheduler.schedule(dispatch, 0, {
144229 index: index, count: count, start: start, subscriber: subscriber
144230 });
144231 }
144232 else {
144233 do {
144234 if (index++ >= count) {
144235 subscriber.complete();
144236 break;
144237 }
144238 subscriber.next(current++);
144239 if (subscriber.closed) {
144240 break;
144241 }
144242 } while (true);
144243 }
144244 return undefined;
144245 });
144246}
144247function dispatch(state) {
144248 var start = state.start, index = state.index, count = state.count, subscriber = state.subscriber;
144249 if (index >= count) {
144250 subscriber.complete();
144251 return;
144252 }
144253 subscriber.next(start);
144254 if (subscriber.closed) {
144255 return;
144256 }
144257 state.index = index + 1;
144258 state.start = start + 1;
144259 this.schedule(state);
144260}
144261//# sourceMappingURL=range.js.map
144262
144263
144264/***/ }),
144265/* 910 */
144266/***/ (function(module, __webpack_exports__, __webpack_require__) {
144267
144268"use strict";
144269/* harmony export (immutable) */ __webpack_exports__["a"] = using;
144270/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
144271/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__from__ = __webpack_require__(64);
144272/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__empty__ = __webpack_require__(46);
144273/** PURE_IMPORTS_START _Observable,_from,_empty PURE_IMPORTS_END */
144274
144275
144276
144277function using(resourceFactory, observableFactory) {
144278 return new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) {
144279 var resource;
144280 try {
144281 resource = resourceFactory();
144282 }
144283 catch (err) {
144284 subscriber.error(err);
144285 return undefined;
144286 }
144287 var result;
144288 try {
144289 result = observableFactory(resource);
144290 }
144291 catch (err) {
144292 subscriber.error(err);
144293 return undefined;
144294 }
144295 var source = result ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__from__["a" /* from */])(result) : __WEBPACK_IMPORTED_MODULE_2__empty__["b" /* EMPTY */];
144296 var subscription = source.subscribe(subscriber);
144297 return function () {
144298 subscription.unsubscribe();
144299 if (resource) {
144300 resource.unsubscribe();
144301 }
144302 };
144303 });
144304}
144305//# sourceMappingURL=using.js.map
144306
144307
144308/***/ }),
144309/* 911 */
144310/***/ (function(module, __webpack_exports__, __webpack_require__) {
144311
144312"use strict";
144313/* harmony export (immutable) */ __webpack_exports__["a"] = auditTime;
144314/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scheduler_async__ = __webpack_require__(47);
144315/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__audit__ = __webpack_require__(398);
144316/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_timer__ = __webpack_require__(397);
144317/** PURE_IMPORTS_START _scheduler_async,_audit,_observable_timer PURE_IMPORTS_END */
144318
144319
144320
144321function auditTime(duration, scheduler) {
144322 if (scheduler === void 0) {
144323 scheduler = __WEBPACK_IMPORTED_MODULE_0__scheduler_async__["a" /* async */];
144324 }
144325 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__audit__["a" /* audit */])(function () { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_timer__["a" /* timer */])(duration, scheduler); });
144326}
144327//# sourceMappingURL=auditTime.js.map
144328
144329
144330/***/ }),
144331/* 912 */
144332/***/ (function(module, __webpack_exports__, __webpack_require__) {
144333
144334"use strict";
144335/* harmony export (immutable) */ __webpack_exports__["a"] = buffer;
144336/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
144337/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
144338/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
144339/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
144340
144341
144342
144343function buffer(closingNotifier) {
144344 return function bufferOperatorFunction(source) {
144345 return source.lift(new BufferOperator(closingNotifier));
144346 };
144347}
144348var BufferOperator = /*@__PURE__*/ (function () {
144349 function BufferOperator(closingNotifier) {
144350 this.closingNotifier = closingNotifier;
144351 }
144352 BufferOperator.prototype.call = function (subscriber, source) {
144353 return source.subscribe(new BufferSubscriber(subscriber, this.closingNotifier));
144354 };
144355 return BufferOperator;
144356}());
144357var BufferSubscriber = /*@__PURE__*/ (function (_super) {
144358 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferSubscriber, _super);
144359 function BufferSubscriber(destination, closingNotifier) {
144360 var _this = _super.call(this, destination) || this;
144361 _this.buffer = [];
144362 _this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(_this, closingNotifier));
144363 return _this;
144364 }
144365 BufferSubscriber.prototype._next = function (value) {
144366 this.buffer.push(value);
144367 };
144368 BufferSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
144369 var buffer = this.buffer;
144370 this.buffer = [];
144371 this.destination.next(buffer);
144372 };
144373 return BufferSubscriber;
144374}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
144375//# sourceMappingURL=buffer.js.map
144376
144377
144378/***/ }),
144379/* 913 */
144380/***/ (function(module, __webpack_exports__, __webpack_require__) {
144381
144382"use strict";
144383/* harmony export (immutable) */ __webpack_exports__["a"] = bufferCount;
144384/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
144385/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
144386/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
144387
144388
144389function bufferCount(bufferSize, startBufferEvery) {
144390 if (startBufferEvery === void 0) {
144391 startBufferEvery = null;
144392 }
144393 return function bufferCountOperatorFunction(source) {
144394 return source.lift(new BufferCountOperator(bufferSize, startBufferEvery));
144395 };
144396}
144397var BufferCountOperator = /*@__PURE__*/ (function () {
144398 function BufferCountOperator(bufferSize, startBufferEvery) {
144399 this.bufferSize = bufferSize;
144400 this.startBufferEvery = startBufferEvery;
144401 if (!startBufferEvery || bufferSize === startBufferEvery) {
144402 this.subscriberClass = BufferCountSubscriber;
144403 }
144404 else {
144405 this.subscriberClass = BufferSkipCountSubscriber;
144406 }
144407 }
144408 BufferCountOperator.prototype.call = function (subscriber, source) {
144409 return source.subscribe(new this.subscriberClass(subscriber, this.bufferSize, this.startBufferEvery));
144410 };
144411 return BufferCountOperator;
144412}());
144413var BufferCountSubscriber = /*@__PURE__*/ (function (_super) {
144414 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferCountSubscriber, _super);
144415 function BufferCountSubscriber(destination, bufferSize) {
144416 var _this = _super.call(this, destination) || this;
144417 _this.bufferSize = bufferSize;
144418 _this.buffer = [];
144419 return _this;
144420 }
144421 BufferCountSubscriber.prototype._next = function (value) {
144422 var buffer = this.buffer;
144423 buffer.push(value);
144424 if (buffer.length == this.bufferSize) {
144425 this.destination.next(buffer);
144426 this.buffer = [];
144427 }
144428 };
144429 BufferCountSubscriber.prototype._complete = function () {
144430 var buffer = this.buffer;
144431 if (buffer.length > 0) {
144432 this.destination.next(buffer);
144433 }
144434 _super.prototype._complete.call(this);
144435 };
144436 return BufferCountSubscriber;
144437}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
144438var BufferSkipCountSubscriber = /*@__PURE__*/ (function (_super) {
144439 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferSkipCountSubscriber, _super);
144440 function BufferSkipCountSubscriber(destination, bufferSize, startBufferEvery) {
144441 var _this = _super.call(this, destination) || this;
144442 _this.bufferSize = bufferSize;
144443 _this.startBufferEvery = startBufferEvery;
144444 _this.buffers = [];
144445 _this.count = 0;
144446 return _this;
144447 }
144448 BufferSkipCountSubscriber.prototype._next = function (value) {
144449 var _a = this, bufferSize = _a.bufferSize, startBufferEvery = _a.startBufferEvery, buffers = _a.buffers, count = _a.count;
144450 this.count++;
144451 if (count % startBufferEvery === 0) {
144452 buffers.push([]);
144453 }
144454 for (var i = buffers.length; i--;) {
144455 var buffer = buffers[i];
144456 buffer.push(value);
144457 if (buffer.length === bufferSize) {
144458 buffers.splice(i, 1);
144459 this.destination.next(buffer);
144460 }
144461 }
144462 };
144463 BufferSkipCountSubscriber.prototype._complete = function () {
144464 var _a = this, buffers = _a.buffers, destination = _a.destination;
144465 while (buffers.length > 0) {
144466 var buffer = buffers.shift();
144467 if (buffer.length > 0) {
144468 destination.next(buffer);
144469 }
144470 }
144471 _super.prototype._complete.call(this);
144472 };
144473 return BufferSkipCountSubscriber;
144474}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
144475//# sourceMappingURL=bufferCount.js.map
144476
144477
144478/***/ }),
144479/* 914 */
144480/***/ (function(module, __webpack_exports__, __webpack_require__) {
144481
144482"use strict";
144483/* harmony export (immutable) */ __webpack_exports__["a"] = bufferTime;
144484/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
144485/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(47);
144486/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscriber__ = __webpack_require__(5);
144487/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isScheduler__ = __webpack_require__(56);
144488/** PURE_IMPORTS_START tslib,_scheduler_async,_Subscriber,_util_isScheduler PURE_IMPORTS_END */
144489
144490
144491
144492
144493function bufferTime(bufferTimeSpan) {
144494 var length = arguments.length;
144495 var scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */];
144496 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_isScheduler__["a" /* isScheduler */])(arguments[arguments.length - 1])) {
144497 scheduler = arguments[arguments.length - 1];
144498 length--;
144499 }
144500 var bufferCreationInterval = null;
144501 if (length >= 2) {
144502 bufferCreationInterval = arguments[1];
144503 }
144504 var maxBufferSize = Number.POSITIVE_INFINITY;
144505 if (length >= 3) {
144506 maxBufferSize = arguments[2];
144507 }
144508 return function bufferTimeOperatorFunction(source) {
144509 return source.lift(new BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler));
144510 };
144511}
144512var BufferTimeOperator = /*@__PURE__*/ (function () {
144513 function BufferTimeOperator(bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
144514 this.bufferTimeSpan = bufferTimeSpan;
144515 this.bufferCreationInterval = bufferCreationInterval;
144516 this.maxBufferSize = maxBufferSize;
144517 this.scheduler = scheduler;
144518 }
144519 BufferTimeOperator.prototype.call = function (subscriber, source) {
144520 return source.subscribe(new BufferTimeSubscriber(subscriber, this.bufferTimeSpan, this.bufferCreationInterval, this.maxBufferSize, this.scheduler));
144521 };
144522 return BufferTimeOperator;
144523}());
144524var Context = /*@__PURE__*/ (function () {
144525 function Context() {
144526 this.buffer = [];
144527 }
144528 return Context;
144529}());
144530var BufferTimeSubscriber = /*@__PURE__*/ (function (_super) {
144531 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferTimeSubscriber, _super);
144532 function BufferTimeSubscriber(destination, bufferTimeSpan, bufferCreationInterval, maxBufferSize, scheduler) {
144533 var _this = _super.call(this, destination) || this;
144534 _this.bufferTimeSpan = bufferTimeSpan;
144535 _this.bufferCreationInterval = bufferCreationInterval;
144536 _this.maxBufferSize = maxBufferSize;
144537 _this.scheduler = scheduler;
144538 _this.contexts = [];
144539 var context = _this.openContext();
144540 _this.timespanOnly = bufferCreationInterval == null || bufferCreationInterval < 0;
144541 if (_this.timespanOnly) {
144542 var timeSpanOnlyState = { subscriber: _this, context: context, bufferTimeSpan: bufferTimeSpan };
144543 _this.add(context.closeAction = scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
144544 }
144545 else {
144546 var closeState = { subscriber: _this, context: context };
144547 var creationState = { bufferTimeSpan: bufferTimeSpan, bufferCreationInterval: bufferCreationInterval, subscriber: _this, scheduler: scheduler };
144548 _this.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, closeState));
144549 _this.add(scheduler.schedule(dispatchBufferCreation, bufferCreationInterval, creationState));
144550 }
144551 return _this;
144552 }
144553 BufferTimeSubscriber.prototype._next = function (value) {
144554 var contexts = this.contexts;
144555 var len = contexts.length;
144556 var filledBufferContext;
144557 for (var i = 0; i < len; i++) {
144558 var context_1 = contexts[i];
144559 var buffer = context_1.buffer;
144560 buffer.push(value);
144561 if (buffer.length == this.maxBufferSize) {
144562 filledBufferContext = context_1;
144563 }
144564 }
144565 if (filledBufferContext) {
144566 this.onBufferFull(filledBufferContext);
144567 }
144568 };
144569 BufferTimeSubscriber.prototype._error = function (err) {
144570 this.contexts.length = 0;
144571 _super.prototype._error.call(this, err);
144572 };
144573 BufferTimeSubscriber.prototype._complete = function () {
144574 var _a = this, contexts = _a.contexts, destination = _a.destination;
144575 while (contexts.length > 0) {
144576 var context_2 = contexts.shift();
144577 destination.next(context_2.buffer);
144578 }
144579 _super.prototype._complete.call(this);
144580 };
144581 BufferTimeSubscriber.prototype._unsubscribe = function () {
144582 this.contexts = null;
144583 };
144584 BufferTimeSubscriber.prototype.onBufferFull = function (context) {
144585 this.closeContext(context);
144586 var closeAction = context.closeAction;
144587 closeAction.unsubscribe();
144588 this.remove(closeAction);
144589 if (!this.closed && this.timespanOnly) {
144590 context = this.openContext();
144591 var bufferTimeSpan = this.bufferTimeSpan;
144592 var timeSpanOnlyState = { subscriber: this, context: context, bufferTimeSpan: bufferTimeSpan };
144593 this.add(context.closeAction = this.scheduler.schedule(dispatchBufferTimeSpanOnly, bufferTimeSpan, timeSpanOnlyState));
144594 }
144595 };
144596 BufferTimeSubscriber.prototype.openContext = function () {
144597 var context = new Context();
144598 this.contexts.push(context);
144599 return context;
144600 };
144601 BufferTimeSubscriber.prototype.closeContext = function (context) {
144602 this.destination.next(context.buffer);
144603 var contexts = this.contexts;
144604 var spliceIndex = contexts ? contexts.indexOf(context) : -1;
144605 if (spliceIndex >= 0) {
144606 contexts.splice(contexts.indexOf(context), 1);
144607 }
144608 };
144609 return BufferTimeSubscriber;
144610}(__WEBPACK_IMPORTED_MODULE_2__Subscriber__["a" /* Subscriber */]));
144611function dispatchBufferTimeSpanOnly(state) {
144612 var subscriber = state.subscriber;
144613 var prevContext = state.context;
144614 if (prevContext) {
144615 subscriber.closeContext(prevContext);
144616 }
144617 if (!subscriber.closed) {
144618 state.context = subscriber.openContext();
144619 state.context.closeAction = this.schedule(state, state.bufferTimeSpan);
144620 }
144621}
144622function dispatchBufferCreation(state) {
144623 var bufferCreationInterval = state.bufferCreationInterval, bufferTimeSpan = state.bufferTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler;
144624 var context = subscriber.openContext();
144625 var action = this;
144626 if (!subscriber.closed) {
144627 subscriber.add(context.closeAction = scheduler.schedule(dispatchBufferClose, bufferTimeSpan, { subscriber: subscriber, context: context }));
144628 action.schedule(state, bufferCreationInterval);
144629 }
144630}
144631function dispatchBufferClose(arg) {
144632 var subscriber = arg.subscriber, context = arg.context;
144633 subscriber.closeContext(context);
144634}
144635//# sourceMappingURL=bufferTime.js.map
144636
144637
144638/***/ }),
144639/* 915 */
144640/***/ (function(module, __webpack_exports__, __webpack_require__) {
144641
144642"use strict";
144643/* harmony export (immutable) */ __webpack_exports__["a"] = bufferToggle;
144644/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
144645/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
144646/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
144647/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
144648/** PURE_IMPORTS_START tslib,_Subscription,_util_subscribeToResult,_OuterSubscriber PURE_IMPORTS_END */
144649
144650
144651
144652
144653function bufferToggle(openings, closingSelector) {
144654 return function bufferToggleOperatorFunction(source) {
144655 return source.lift(new BufferToggleOperator(openings, closingSelector));
144656 };
144657}
144658var BufferToggleOperator = /*@__PURE__*/ (function () {
144659 function BufferToggleOperator(openings, closingSelector) {
144660 this.openings = openings;
144661 this.closingSelector = closingSelector;
144662 }
144663 BufferToggleOperator.prototype.call = function (subscriber, source) {
144664 return source.subscribe(new BufferToggleSubscriber(subscriber, this.openings, this.closingSelector));
144665 };
144666 return BufferToggleOperator;
144667}());
144668var BufferToggleSubscriber = /*@__PURE__*/ (function (_super) {
144669 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferToggleSubscriber, _super);
144670 function BufferToggleSubscriber(destination, openings, closingSelector) {
144671 var _this = _super.call(this, destination) || this;
144672 _this.openings = openings;
144673 _this.closingSelector = closingSelector;
144674 _this.contexts = [];
144675 _this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(_this, openings));
144676 return _this;
144677 }
144678 BufferToggleSubscriber.prototype._next = function (value) {
144679 var contexts = this.contexts;
144680 var len = contexts.length;
144681 for (var i = 0; i < len; i++) {
144682 contexts[i].buffer.push(value);
144683 }
144684 };
144685 BufferToggleSubscriber.prototype._error = function (err) {
144686 var contexts = this.contexts;
144687 while (contexts.length > 0) {
144688 var context_1 = contexts.shift();
144689 context_1.subscription.unsubscribe();
144690 context_1.buffer = null;
144691 context_1.subscription = null;
144692 }
144693 this.contexts = null;
144694 _super.prototype._error.call(this, err);
144695 };
144696 BufferToggleSubscriber.prototype._complete = function () {
144697 var contexts = this.contexts;
144698 while (contexts.length > 0) {
144699 var context_2 = contexts.shift();
144700 this.destination.next(context_2.buffer);
144701 context_2.subscription.unsubscribe();
144702 context_2.buffer = null;
144703 context_2.subscription = null;
144704 }
144705 this.contexts = null;
144706 _super.prototype._complete.call(this);
144707 };
144708 BufferToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
144709 outerValue ? this.closeBuffer(outerValue) : this.openBuffer(innerValue);
144710 };
144711 BufferToggleSubscriber.prototype.notifyComplete = function (innerSub) {
144712 this.closeBuffer(innerSub.context);
144713 };
144714 BufferToggleSubscriber.prototype.openBuffer = function (value) {
144715 try {
144716 var closingSelector = this.closingSelector;
144717 var closingNotifier = closingSelector.call(this, value);
144718 if (closingNotifier) {
144719 this.trySubscribe(closingNotifier);
144720 }
144721 }
144722 catch (err) {
144723 this._error(err);
144724 }
144725 };
144726 BufferToggleSubscriber.prototype.closeBuffer = function (context) {
144727 var contexts = this.contexts;
144728 if (contexts && context) {
144729 var buffer = context.buffer, subscription = context.subscription;
144730 this.destination.next(buffer);
144731 contexts.splice(contexts.indexOf(context), 1);
144732 this.remove(subscription);
144733 subscription.unsubscribe();
144734 }
144735 };
144736 BufferToggleSubscriber.prototype.trySubscribe = function (closingNotifier) {
144737 var contexts = this.contexts;
144738 var buffer = [];
144739 var subscription = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
144740 var context = { buffer: buffer, subscription: subscription };
144741 contexts.push(context);
144742 var innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(this, closingNotifier, context);
144743 if (!innerSubscription || innerSubscription.closed) {
144744 this.closeBuffer(context);
144745 }
144746 else {
144747 innerSubscription.context = context;
144748 this.add(innerSubscription);
144749 subscription.add(innerSubscription);
144750 }
144751 };
144752 return BufferToggleSubscriber;
144753}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
144754//# sourceMappingURL=bufferToggle.js.map
144755
144756
144757/***/ }),
144758/* 916 */
144759/***/ (function(module, __webpack_exports__, __webpack_require__) {
144760
144761"use strict";
144762/* harmony export (immutable) */ __webpack_exports__["a"] = bufferWhen;
144763/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
144764/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
144765/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(59);
144766/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55);
144767/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18);
144768/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19);
144769/** PURE_IMPORTS_START tslib,_Subscription,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
144770
144771
144772
144773
144774
144775
144776function bufferWhen(closingSelector) {
144777 return function (source) {
144778 return source.lift(new BufferWhenOperator(closingSelector));
144779 };
144780}
144781var BufferWhenOperator = /*@__PURE__*/ (function () {
144782 function BufferWhenOperator(closingSelector) {
144783 this.closingSelector = closingSelector;
144784 }
144785 BufferWhenOperator.prototype.call = function (subscriber, source) {
144786 return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));
144787 };
144788 return BufferWhenOperator;
144789}());
144790var BufferWhenSubscriber = /*@__PURE__*/ (function (_super) {
144791 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](BufferWhenSubscriber, _super);
144792 function BufferWhenSubscriber(destination, closingSelector) {
144793 var _this = _super.call(this, destination) || this;
144794 _this.closingSelector = closingSelector;
144795 _this.subscribing = false;
144796 _this.openBuffer();
144797 return _this;
144798 }
144799 BufferWhenSubscriber.prototype._next = function (value) {
144800 this.buffer.push(value);
144801 };
144802 BufferWhenSubscriber.prototype._complete = function () {
144803 var buffer = this.buffer;
144804 if (buffer) {
144805 this.destination.next(buffer);
144806 }
144807 _super.prototype._complete.call(this);
144808 };
144809 BufferWhenSubscriber.prototype._unsubscribe = function () {
144810 this.buffer = null;
144811 this.subscribing = false;
144812 };
144813 BufferWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
144814 this.openBuffer();
144815 };
144816 BufferWhenSubscriber.prototype.notifyComplete = function () {
144817 if (this.subscribing) {
144818 this.complete();
144819 }
144820 else {
144821 this.openBuffer();
144822 }
144823 };
144824 BufferWhenSubscriber.prototype.openBuffer = function () {
144825 var closingSubscription = this.closingSubscription;
144826 if (closingSubscription) {
144827 this.remove(closingSubscription);
144828 closingSubscription.unsubscribe();
144829 }
144830 var buffer = this.buffer;
144831 if (this.buffer) {
144832 this.destination.next(buffer);
144833 }
144834 this.buffer = [];
144835 var closingNotifier = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.closingSelector)();
144836 if (closingNotifier === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
144837 this.error(__WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e);
144838 }
144839 else {
144840 closingSubscription = new __WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]();
144841 this.closingSubscription = closingSubscription;
144842 this.add(closingSubscription);
144843 this.subscribing = true;
144844 closingSubscription.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, closingNotifier));
144845 this.subscribing = false;
144846 }
144847 };
144848 return BufferWhenSubscriber;
144849}(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */]));
144850//# sourceMappingURL=bufferWhen.js.map
144851
144852
144853/***/ }),
144854/* 917 */
144855/***/ (function(module, __webpack_exports__, __webpack_require__) {
144856
144857"use strict";
144858/* harmony export (immutable) */ __webpack_exports__["a"] = catchError;
144859/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
144860/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
144861/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__ = __webpack_require__(80);
144862/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19);
144863/** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
144864
144865
144866
144867
144868function catchError(selector) {
144869 return function catchErrorOperatorFunction(source) {
144870 var operator = new CatchOperator(selector);
144871 var caught = source.lift(operator);
144872 return (operator.caught = caught);
144873 };
144874}
144875var CatchOperator = /*@__PURE__*/ (function () {
144876 function CatchOperator(selector) {
144877 this.selector = selector;
144878 }
144879 CatchOperator.prototype.call = function (subscriber, source) {
144880 return source.subscribe(new CatchSubscriber(subscriber, this.selector, this.caught));
144881 };
144882 return CatchOperator;
144883}());
144884var CatchSubscriber = /*@__PURE__*/ (function (_super) {
144885 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](CatchSubscriber, _super);
144886 function CatchSubscriber(destination, selector, caught) {
144887 var _this = _super.call(this, destination) || this;
144888 _this.selector = selector;
144889 _this.caught = caught;
144890 return _this;
144891 }
144892 CatchSubscriber.prototype.error = function (err) {
144893 if (!this.isStopped) {
144894 var result = void 0;
144895 try {
144896 result = this.selector(err, this.caught);
144897 }
144898 catch (err2) {
144899 _super.prototype.error.call(this, err2);
144900 return;
144901 }
144902 this._unsubscribeAndRecycle();
144903 var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined);
144904 this.add(innerSubscriber);
144905 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(this, result, undefined, undefined, innerSubscriber);
144906 }
144907 };
144908 return CatchSubscriber;
144909}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
144910//# sourceMappingURL=catchError.js.map
144911
144912
144913/***/ }),
144914/* 918 */
144915/***/ (function(module, __webpack_exports__, __webpack_require__) {
144916
144917"use strict";
144918/* harmony export (immutable) */ __webpack_exports__["a"] = combineAll;
144919/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_combineLatest__ = __webpack_require__(249);
144920/** PURE_IMPORTS_START _observable_combineLatest PURE_IMPORTS_END */
144921
144922function combineAll(project) {
144923 return function (source) { return source.lift(new __WEBPACK_IMPORTED_MODULE_0__observable_combineLatest__["b" /* CombineLatestOperator */](project)); };
144924}
144925//# sourceMappingURL=combineAll.js.map
144926
144927
144928/***/ }),
144929/* 919 */
144930/***/ (function(module, __webpack_exports__, __webpack_require__) {
144931
144932"use strict";
144933/* harmony export (immutable) */ __webpack_exports__["a"] = combineLatest;
144934/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(48);
144935/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_combineLatest__ = __webpack_require__(249);
144936/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_from__ = __webpack_require__(64);
144937/** PURE_IMPORTS_START _util_isArray,_observable_combineLatest,_observable_from PURE_IMPORTS_END */
144938
144939
144940
144941var none = {};
144942function combineLatest() {
144943 var observables = [];
144944 for (var _i = 0; _i < arguments.length; _i++) {
144945 observables[_i] = arguments[_i];
144946 }
144947 var project = null;
144948 if (typeof observables[observables.length - 1] === 'function') {
144949 project = observables.pop();
144950 }
144951 if (observables.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(observables[0])) {
144952 observables = observables[0].slice();
144953 }
144954 return function (source) { return source.lift.call(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_from__["a" /* from */])([source].concat(observables)), new __WEBPACK_IMPORTED_MODULE_1__observable_combineLatest__["b" /* CombineLatestOperator */](project)); };
144955}
144956//# sourceMappingURL=combineLatest.js.map
144957
144958
144959/***/ }),
144960/* 920 */
144961/***/ (function(module, __webpack_exports__, __webpack_require__) {
144962
144963"use strict";
144964/* harmony export (immutable) */ __webpack_exports__["a"] = concat;
144965/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_concat__ = __webpack_require__(177);
144966/** PURE_IMPORTS_START _observable_concat PURE_IMPORTS_END */
144967
144968function concat() {
144969 var observables = [];
144970 for (var _i = 0; _i < arguments.length; _i++) {
144971 observables[_i] = arguments[_i];
144972 }
144973 return function (source) { return source.lift.call(__WEBPACK_IMPORTED_MODULE_0__observable_concat__["a" /* concat */].apply(void 0, [source].concat(observables))); };
144974}
144975//# sourceMappingURL=concat.js.map
144976
144977
144978/***/ }),
144979/* 921 */
144980/***/ (function(module, __webpack_exports__, __webpack_require__) {
144981
144982"use strict";
144983/* harmony export (immutable) */ __webpack_exports__["a"] = concatMapTo;
144984/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__concatMap__ = __webpack_require__(400);
144985/** PURE_IMPORTS_START _concatMap PURE_IMPORTS_END */
144986
144987function concatMapTo(innerObservable, resultSelector) {
144988 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__concatMap__["a" /* concatMap */])(function () { return innerObservable; }, resultSelector);
144989}
144990//# sourceMappingURL=concatMapTo.js.map
144991
144992
144993/***/ }),
144994/* 922 */
144995/***/ (function(module, __webpack_exports__, __webpack_require__) {
144996
144997"use strict";
144998/* harmony export (immutable) */ __webpack_exports__["a"] = count;
144999/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
145000/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
145001/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
145002
145003
145004function count(predicate) {
145005 return function (source) { return source.lift(new CountOperator(predicate, source)); };
145006}
145007var CountOperator = /*@__PURE__*/ (function () {
145008 function CountOperator(predicate, source) {
145009 this.predicate = predicate;
145010 this.source = source;
145011 }
145012 CountOperator.prototype.call = function (subscriber, source) {
145013 return source.subscribe(new CountSubscriber(subscriber, this.predicate, this.source));
145014 };
145015 return CountOperator;
145016}());
145017var CountSubscriber = /*@__PURE__*/ (function (_super) {
145018 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](CountSubscriber, _super);
145019 function CountSubscriber(destination, predicate, source) {
145020 var _this = _super.call(this, destination) || this;
145021 _this.predicate = predicate;
145022 _this.source = source;
145023 _this.count = 0;
145024 _this.index = 0;
145025 return _this;
145026 }
145027 CountSubscriber.prototype._next = function (value) {
145028 if (this.predicate) {
145029 this._tryPredicate(value);
145030 }
145031 else {
145032 this.count++;
145033 }
145034 };
145035 CountSubscriber.prototype._tryPredicate = function (value) {
145036 var result;
145037 try {
145038 result = this.predicate(value, this.index++, this.source);
145039 }
145040 catch (err) {
145041 this.destination.error(err);
145042 return;
145043 }
145044 if (result) {
145045 this.count++;
145046 }
145047 };
145048 CountSubscriber.prototype._complete = function () {
145049 this.destination.next(this.count);
145050 this.destination.complete();
145051 };
145052 return CountSubscriber;
145053}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
145054//# sourceMappingURL=count.js.map
145055
145056
145057/***/ }),
145058/* 923 */
145059/***/ (function(module, __webpack_exports__, __webpack_require__) {
145060
145061"use strict";
145062/* harmony export (immutable) */ __webpack_exports__["a"] = debounce;
145063/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
145064/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
145065/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
145066/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
145067
145068
145069
145070function debounce(durationSelector) {
145071 return function (source) { return source.lift(new DebounceOperator(durationSelector)); };
145072}
145073var DebounceOperator = /*@__PURE__*/ (function () {
145074 function DebounceOperator(durationSelector) {
145075 this.durationSelector = durationSelector;
145076 }
145077 DebounceOperator.prototype.call = function (subscriber, source) {
145078 return source.subscribe(new DebounceSubscriber(subscriber, this.durationSelector));
145079 };
145080 return DebounceOperator;
145081}());
145082var DebounceSubscriber = /*@__PURE__*/ (function (_super) {
145083 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DebounceSubscriber, _super);
145084 function DebounceSubscriber(destination, durationSelector) {
145085 var _this = _super.call(this, destination) || this;
145086 _this.durationSelector = durationSelector;
145087 _this.hasValue = false;
145088 _this.durationSubscription = null;
145089 return _this;
145090 }
145091 DebounceSubscriber.prototype._next = function (value) {
145092 try {
145093 var result = this.durationSelector.call(this, value);
145094 if (result) {
145095 this._tryNext(value, result);
145096 }
145097 }
145098 catch (err) {
145099 this.destination.error(err);
145100 }
145101 };
145102 DebounceSubscriber.prototype._complete = function () {
145103 this.emitValue();
145104 this.destination.complete();
145105 };
145106 DebounceSubscriber.prototype._tryNext = function (value, duration) {
145107 var subscription = this.durationSubscription;
145108 this.value = value;
145109 this.hasValue = true;
145110 if (subscription) {
145111 subscription.unsubscribe();
145112 this.remove(subscription);
145113 }
145114 subscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(this, duration);
145115 if (subscription && !subscription.closed) {
145116 this.add(this.durationSubscription = subscription);
145117 }
145118 };
145119 DebounceSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
145120 this.emitValue();
145121 };
145122 DebounceSubscriber.prototype.notifyComplete = function () {
145123 this.emitValue();
145124 };
145125 DebounceSubscriber.prototype.emitValue = function () {
145126 if (this.hasValue) {
145127 var value = this.value;
145128 var subscription = this.durationSubscription;
145129 if (subscription) {
145130 this.durationSubscription = null;
145131 subscription.unsubscribe();
145132 this.remove(subscription);
145133 }
145134 this.value = null;
145135 this.hasValue = false;
145136 _super.prototype._next.call(this, value);
145137 }
145138 };
145139 return DebounceSubscriber;
145140}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
145141//# sourceMappingURL=debounce.js.map
145142
145143
145144/***/ }),
145145/* 924 */
145146/***/ (function(module, __webpack_exports__, __webpack_require__) {
145147
145148"use strict";
145149/* harmony export (immutable) */ __webpack_exports__["a"] = debounceTime;
145150/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
145151/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
145152/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_async__ = __webpack_require__(47);
145153/** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */
145154
145155
145156
145157function debounceTime(dueTime, scheduler) {
145158 if (scheduler === void 0) {
145159 scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_async__["a" /* async */];
145160 }
145161 return function (source) { return source.lift(new DebounceTimeOperator(dueTime, scheduler)); };
145162}
145163var DebounceTimeOperator = /*@__PURE__*/ (function () {
145164 function DebounceTimeOperator(dueTime, scheduler) {
145165 this.dueTime = dueTime;
145166 this.scheduler = scheduler;
145167 }
145168 DebounceTimeOperator.prototype.call = function (subscriber, source) {
145169 return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));
145170 };
145171 return DebounceTimeOperator;
145172}());
145173var DebounceTimeSubscriber = /*@__PURE__*/ (function (_super) {
145174 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DebounceTimeSubscriber, _super);
145175 function DebounceTimeSubscriber(destination, dueTime, scheduler) {
145176 var _this = _super.call(this, destination) || this;
145177 _this.dueTime = dueTime;
145178 _this.scheduler = scheduler;
145179 _this.debouncedSubscription = null;
145180 _this.lastValue = null;
145181 _this.hasValue = false;
145182 return _this;
145183 }
145184 DebounceTimeSubscriber.prototype._next = function (value) {
145185 this.clearDebounce();
145186 this.lastValue = value;
145187 this.hasValue = true;
145188 this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));
145189 };
145190 DebounceTimeSubscriber.prototype._complete = function () {
145191 this.debouncedNext();
145192 this.destination.complete();
145193 };
145194 DebounceTimeSubscriber.prototype.debouncedNext = function () {
145195 this.clearDebounce();
145196 if (this.hasValue) {
145197 var lastValue = this.lastValue;
145198 this.lastValue = null;
145199 this.hasValue = false;
145200 this.destination.next(lastValue);
145201 }
145202 };
145203 DebounceTimeSubscriber.prototype.clearDebounce = function () {
145204 var debouncedSubscription = this.debouncedSubscription;
145205 if (debouncedSubscription !== null) {
145206 this.remove(debouncedSubscription);
145207 debouncedSubscription.unsubscribe();
145208 this.debouncedSubscription = null;
145209 }
145210 };
145211 return DebounceTimeSubscriber;
145212}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
145213function dispatchNext(subscriber) {
145214 subscriber.debouncedNext();
145215}
145216//# sourceMappingURL=debounceTime.js.map
145217
145218
145219/***/ }),
145220/* 925 */
145221/***/ (function(module, __webpack_exports__, __webpack_require__) {
145222
145223"use strict";
145224/* harmony export (immutable) */ __webpack_exports__["a"] = delay;
145225/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
145226/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(47);
145227/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isDate__ = __webpack_require__(413);
145228/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(5);
145229/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Notification__ = __webpack_require__(175);
145230/** PURE_IMPORTS_START tslib,_scheduler_async,_util_isDate,_Subscriber,_Notification PURE_IMPORTS_END */
145231
145232
145233
145234
145235
145236function delay(delay, scheduler) {
145237 if (scheduler === void 0) {
145238 scheduler = __WEBPACK_IMPORTED_MODULE_1__scheduler_async__["a" /* async */];
145239 }
145240 var absoluteDelay = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isDate__["a" /* isDate */])(delay);
145241 var delayFor = absoluteDelay ? (+delay - scheduler.now()) : Math.abs(delay);
145242 return function (source) { return source.lift(new DelayOperator(delayFor, scheduler)); };
145243}
145244var DelayOperator = /*@__PURE__*/ (function () {
145245 function DelayOperator(delay, scheduler) {
145246 this.delay = delay;
145247 this.scheduler = scheduler;
145248 }
145249 DelayOperator.prototype.call = function (subscriber, source) {
145250 return source.subscribe(new DelaySubscriber(subscriber, this.delay, this.scheduler));
145251 };
145252 return DelayOperator;
145253}());
145254var DelaySubscriber = /*@__PURE__*/ (function (_super) {
145255 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DelaySubscriber, _super);
145256 function DelaySubscriber(destination, delay, scheduler) {
145257 var _this = _super.call(this, destination) || this;
145258 _this.delay = delay;
145259 _this.scheduler = scheduler;
145260 _this.queue = [];
145261 _this.active = false;
145262 _this.errored = false;
145263 return _this;
145264 }
145265 DelaySubscriber.dispatch = function (state) {
145266 var source = state.source;
145267 var queue = source.queue;
145268 var scheduler = state.scheduler;
145269 var destination = state.destination;
145270 while (queue.length > 0 && (queue[0].time - scheduler.now()) <= 0) {
145271 queue.shift().notification.observe(destination);
145272 }
145273 if (queue.length > 0) {
145274 var delay_1 = Math.max(0, queue[0].time - scheduler.now());
145275 this.schedule(state, delay_1);
145276 }
145277 else {
145278 this.unsubscribe();
145279 source.active = false;
145280 }
145281 };
145282 DelaySubscriber.prototype._schedule = function (scheduler) {
145283 this.active = true;
145284 var destination = this.destination;
145285 destination.add(scheduler.schedule(DelaySubscriber.dispatch, this.delay, {
145286 source: this, destination: this.destination, scheduler: scheduler
145287 }));
145288 };
145289 DelaySubscriber.prototype.scheduleNotification = function (notification) {
145290 if (this.errored === true) {
145291 return;
145292 }
145293 var scheduler = this.scheduler;
145294 var message = new DelayMessage(scheduler.now() + this.delay, notification);
145295 this.queue.push(message);
145296 if (this.active === false) {
145297 this._schedule(scheduler);
145298 }
145299 };
145300 DelaySubscriber.prototype._next = function (value) {
145301 this.scheduleNotification(__WEBPACK_IMPORTED_MODULE_4__Notification__["a" /* Notification */].createNext(value));
145302 };
145303 DelaySubscriber.prototype._error = function (err) {
145304 this.errored = true;
145305 this.queue = [];
145306 this.destination.error(err);
145307 this.unsubscribe();
145308 };
145309 DelaySubscriber.prototype._complete = function () {
145310 this.scheduleNotification(__WEBPACK_IMPORTED_MODULE_4__Notification__["a" /* Notification */].createComplete());
145311 this.unsubscribe();
145312 };
145313 return DelaySubscriber;
145314}(__WEBPACK_IMPORTED_MODULE_3__Subscriber__["a" /* Subscriber */]));
145315var DelayMessage = /*@__PURE__*/ (function () {
145316 function DelayMessage(time, notification) {
145317 this.time = time;
145318 this.notification = notification;
145319 }
145320 return DelayMessage;
145321}());
145322//# sourceMappingURL=delay.js.map
145323
145324
145325/***/ }),
145326/* 926 */
145327/***/ (function(module, __webpack_exports__, __webpack_require__) {
145328
145329"use strict";
145330/* harmony export (immutable) */ __webpack_exports__["a"] = delayWhen;
145331/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
145332/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
145333/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observable__ = __webpack_require__(17);
145334/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
145335/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
145336/** PURE_IMPORTS_START tslib,_Subscriber,_Observable,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
145337
145338
145339
145340
145341
145342function delayWhen(delayDurationSelector, subscriptionDelay) {
145343 if (subscriptionDelay) {
145344 return function (source) {
145345 return new SubscriptionDelayObservable(source, subscriptionDelay)
145346 .lift(new DelayWhenOperator(delayDurationSelector));
145347 };
145348 }
145349 return function (source) { return source.lift(new DelayWhenOperator(delayDurationSelector)); };
145350}
145351var DelayWhenOperator = /*@__PURE__*/ (function () {
145352 function DelayWhenOperator(delayDurationSelector) {
145353 this.delayDurationSelector = delayDurationSelector;
145354 }
145355 DelayWhenOperator.prototype.call = function (subscriber, source) {
145356 return source.subscribe(new DelayWhenSubscriber(subscriber, this.delayDurationSelector));
145357 };
145358 return DelayWhenOperator;
145359}());
145360var DelayWhenSubscriber = /*@__PURE__*/ (function (_super) {
145361 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DelayWhenSubscriber, _super);
145362 function DelayWhenSubscriber(destination, delayDurationSelector) {
145363 var _this = _super.call(this, destination) || this;
145364 _this.delayDurationSelector = delayDurationSelector;
145365 _this.completed = false;
145366 _this.delayNotifierSubscriptions = [];
145367 _this.index = 0;
145368 return _this;
145369 }
145370 DelayWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
145371 this.destination.next(outerValue);
145372 this.removeSubscription(innerSub);
145373 this.tryComplete();
145374 };
145375 DelayWhenSubscriber.prototype.notifyError = function (error, innerSub) {
145376 this._error(error);
145377 };
145378 DelayWhenSubscriber.prototype.notifyComplete = function (innerSub) {
145379 var value = this.removeSubscription(innerSub);
145380 if (value) {
145381 this.destination.next(value);
145382 }
145383 this.tryComplete();
145384 };
145385 DelayWhenSubscriber.prototype._next = function (value) {
145386 var index = this.index++;
145387 try {
145388 var delayNotifier = this.delayDurationSelector(value, index);
145389 if (delayNotifier) {
145390 this.tryDelay(delayNotifier, value);
145391 }
145392 }
145393 catch (err) {
145394 this.destination.error(err);
145395 }
145396 };
145397 DelayWhenSubscriber.prototype._complete = function () {
145398 this.completed = true;
145399 this.tryComplete();
145400 this.unsubscribe();
145401 };
145402 DelayWhenSubscriber.prototype.removeSubscription = function (subscription) {
145403 subscription.unsubscribe();
145404 var subscriptionIdx = this.delayNotifierSubscriptions.indexOf(subscription);
145405 if (subscriptionIdx !== -1) {
145406 this.delayNotifierSubscriptions.splice(subscriptionIdx, 1);
145407 }
145408 return subscription.outerValue;
145409 };
145410 DelayWhenSubscriber.prototype.tryDelay = function (delayNotifier, value) {
145411 var notifierSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, delayNotifier, value);
145412 if (notifierSubscription && !notifierSubscription.closed) {
145413 var destination = this.destination;
145414 destination.add(notifierSubscription);
145415 this.delayNotifierSubscriptions.push(notifierSubscription);
145416 }
145417 };
145418 DelayWhenSubscriber.prototype.tryComplete = function () {
145419 if (this.completed && this.delayNotifierSubscriptions.length === 0) {
145420 this.destination.complete();
145421 }
145422 };
145423 return DelayWhenSubscriber;
145424}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
145425var SubscriptionDelayObservable = /*@__PURE__*/ (function (_super) {
145426 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubscriptionDelayObservable, _super);
145427 function SubscriptionDelayObservable(source, subscriptionDelay) {
145428 var _this = _super.call(this) || this;
145429 _this.source = source;
145430 _this.subscriptionDelay = subscriptionDelay;
145431 return _this;
145432 }
145433 SubscriptionDelayObservable.prototype._subscribe = function (subscriber) {
145434 this.subscriptionDelay.subscribe(new SubscriptionDelaySubscriber(subscriber, this.source));
145435 };
145436 return SubscriptionDelayObservable;
145437}(__WEBPACK_IMPORTED_MODULE_2__Observable__["a" /* Observable */]));
145438var SubscriptionDelaySubscriber = /*@__PURE__*/ (function (_super) {
145439 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubscriptionDelaySubscriber, _super);
145440 function SubscriptionDelaySubscriber(parent, source) {
145441 var _this = _super.call(this) || this;
145442 _this.parent = parent;
145443 _this.source = source;
145444 _this.sourceSubscribed = false;
145445 return _this;
145446 }
145447 SubscriptionDelaySubscriber.prototype._next = function (unused) {
145448 this.subscribeToSource();
145449 };
145450 SubscriptionDelaySubscriber.prototype._error = function (err) {
145451 this.unsubscribe();
145452 this.parent.error(err);
145453 };
145454 SubscriptionDelaySubscriber.prototype._complete = function () {
145455 this.unsubscribe();
145456 this.subscribeToSource();
145457 };
145458 SubscriptionDelaySubscriber.prototype.subscribeToSource = function () {
145459 if (!this.sourceSubscribed) {
145460 this.sourceSubscribed = true;
145461 this.unsubscribe();
145462 this.source.subscribe(this.parent);
145463 }
145464 };
145465 return SubscriptionDelaySubscriber;
145466}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
145467//# sourceMappingURL=delayWhen.js.map
145468
145469
145470/***/ }),
145471/* 927 */
145472/***/ (function(module, __webpack_exports__, __webpack_require__) {
145473
145474"use strict";
145475/* harmony export (immutable) */ __webpack_exports__["a"] = dematerialize;
145476/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
145477/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
145478/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
145479
145480
145481function dematerialize() {
145482 return function dematerializeOperatorFunction(source) {
145483 return source.lift(new DeMaterializeOperator());
145484 };
145485}
145486var DeMaterializeOperator = /*@__PURE__*/ (function () {
145487 function DeMaterializeOperator() {
145488 }
145489 DeMaterializeOperator.prototype.call = function (subscriber, source) {
145490 return source.subscribe(new DeMaterializeSubscriber(subscriber));
145491 };
145492 return DeMaterializeOperator;
145493}());
145494var DeMaterializeSubscriber = /*@__PURE__*/ (function (_super) {
145495 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DeMaterializeSubscriber, _super);
145496 function DeMaterializeSubscriber(destination) {
145497 return _super.call(this, destination) || this;
145498 }
145499 DeMaterializeSubscriber.prototype._next = function (value) {
145500 value.observe(this.destination);
145501 };
145502 return DeMaterializeSubscriber;
145503}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
145504//# sourceMappingURL=dematerialize.js.map
145505
145506
145507/***/ }),
145508/* 928 */
145509/***/ (function(module, __webpack_exports__, __webpack_require__) {
145510
145511"use strict";
145512/* harmony export (immutable) */ __webpack_exports__["a"] = distinct;
145513/* unused harmony export DistinctSubscriber */
145514/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
145515/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
145516/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
145517/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
145518
145519
145520
145521function distinct(keySelector, flushes) {
145522 return function (source) { return source.lift(new DistinctOperator(keySelector, flushes)); };
145523}
145524var DistinctOperator = /*@__PURE__*/ (function () {
145525 function DistinctOperator(keySelector, flushes) {
145526 this.keySelector = keySelector;
145527 this.flushes = flushes;
145528 }
145529 DistinctOperator.prototype.call = function (subscriber, source) {
145530 return source.subscribe(new DistinctSubscriber(subscriber, this.keySelector, this.flushes));
145531 };
145532 return DistinctOperator;
145533}());
145534var DistinctSubscriber = /*@__PURE__*/ (function (_super) {
145535 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](DistinctSubscriber, _super);
145536 function DistinctSubscriber(destination, keySelector, flushes) {
145537 var _this = _super.call(this, destination) || this;
145538 _this.keySelector = keySelector;
145539 _this.values = new Set();
145540 if (flushes) {
145541 _this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(_this, flushes));
145542 }
145543 return _this;
145544 }
145545 DistinctSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
145546 this.values.clear();
145547 };
145548 DistinctSubscriber.prototype.notifyError = function (error, innerSub) {
145549 this._error(error);
145550 };
145551 DistinctSubscriber.prototype._next = function (value) {
145552 if (this.keySelector) {
145553 this._useKeySelector(value);
145554 }
145555 else {
145556 this._finalizeNext(value, value);
145557 }
145558 };
145559 DistinctSubscriber.prototype._useKeySelector = function (value) {
145560 var key;
145561 var destination = this.destination;
145562 try {
145563 key = this.keySelector(value);
145564 }
145565 catch (err) {
145566 destination.error(err);
145567 return;
145568 }
145569 this._finalizeNext(key, value);
145570 };
145571 DistinctSubscriber.prototype._finalizeNext = function (key, value) {
145572 var values = this.values;
145573 if (!values.has(key)) {
145574 values.add(key);
145575 this.destination.next(value);
145576 }
145577 };
145578 return DistinctSubscriber;
145579}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
145580
145581//# sourceMappingURL=distinct.js.map
145582
145583
145584/***/ }),
145585/* 929 */
145586/***/ (function(module, __webpack_exports__, __webpack_require__) {
145587
145588"use strict";
145589/* harmony export (immutable) */ __webpack_exports__["a"] = distinctUntilKeyChanged;
145590/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__distinctUntilChanged__ = __webpack_require__(401);
145591/** PURE_IMPORTS_START _distinctUntilChanged PURE_IMPORTS_END */
145592
145593function distinctUntilKeyChanged(key, compare) {
145594 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__distinctUntilChanged__["a" /* distinctUntilChanged */])(function (x, y) { return compare ? compare(x[key], y[key]) : x[key] === y[key]; });
145595}
145596//# sourceMappingURL=distinctUntilKeyChanged.js.map
145597
145598
145599/***/ }),
145600/* 930 */
145601/***/ (function(module, __webpack_exports__, __webpack_require__) {
145602
145603"use strict";
145604/* harmony export (immutable) */ __webpack_exports__["a"] = elementAt;
145605/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_ArgumentOutOfRangeError__ = __webpack_require__(140);
145606/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(135);
145607/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__throwIfEmpty__ = __webpack_require__(179);
145608/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__defaultIfEmpty__ = __webpack_require__(134);
145609/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__take__ = __webpack_require__(259);
145610/** PURE_IMPORTS_START _util_ArgumentOutOfRangeError,_filter,_throwIfEmpty,_defaultIfEmpty,_take PURE_IMPORTS_END */
145611
145612
145613
145614
145615
145616function elementAt(index, defaultValue) {
145617 if (index < 0) {
145618 throw new __WEBPACK_IMPORTED_MODULE_0__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */]();
145619 }
145620 var hasDefaultValue = arguments.length >= 2;
145621 return function (source) {
145622 return source.pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(function (v, i) { return i === index; }), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__take__["a" /* take */])(1), hasDefaultValue
145623 ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__defaultIfEmpty__["a" /* defaultIfEmpty */])(defaultValue)
145624 : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__throwIfEmpty__["a" /* throwIfEmpty */])(function () { return new __WEBPACK_IMPORTED_MODULE_0__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */](); }));
145625 };
145626}
145627//# sourceMappingURL=elementAt.js.map
145628
145629
145630/***/ }),
145631/* 931 */
145632/***/ (function(module, __webpack_exports__, __webpack_require__) {
145633
145634"use strict";
145635/* harmony export (immutable) */ __webpack_exports__["a"] = endWith;
145636/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_fromArray__ = __webpack_require__(81);
145637/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_scalar__ = __webpack_require__(252);
145638/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_empty__ = __webpack_require__(46);
145639/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_concat__ = __webpack_require__(177);
145640/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isScheduler__ = __webpack_require__(56);
145641/** PURE_IMPORTS_START _observable_fromArray,_observable_scalar,_observable_empty,_observable_concat,_util_isScheduler PURE_IMPORTS_END */
145642
145643
145644
145645
145646
145647function endWith() {
145648 var array = [];
145649 for (var _i = 0; _i < arguments.length; _i++) {
145650 array[_i] = arguments[_i];
145651 }
145652 return function (source) {
145653 var scheduler = array[array.length - 1];
145654 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isScheduler__["a" /* isScheduler */])(scheduler)) {
145655 array.pop();
145656 }
145657 else {
145658 scheduler = null;
145659 }
145660 var len = array.length;
145661 if (len === 1 && !scheduler) {
145662 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(source, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_scalar__["a" /* scalar */])(array[0]));
145663 }
145664 else if (len > 0) {
145665 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(source, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__observable_fromArray__["a" /* fromArray */])(array, scheduler));
145666 }
145667 else {
145668 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(source, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_empty__["a" /* empty */])(scheduler));
145669 }
145670 };
145671}
145672//# sourceMappingURL=endWith.js.map
145673
145674
145675/***/ }),
145676/* 932 */
145677/***/ (function(module, __webpack_exports__, __webpack_require__) {
145678
145679"use strict";
145680/* harmony export (immutable) */ __webpack_exports__["a"] = every;
145681/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
145682/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
145683/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
145684
145685
145686function every(predicate, thisArg) {
145687 return function (source) { return source.lift(new EveryOperator(predicate, thisArg, source)); };
145688}
145689var EveryOperator = /*@__PURE__*/ (function () {
145690 function EveryOperator(predicate, thisArg, source) {
145691 this.predicate = predicate;
145692 this.thisArg = thisArg;
145693 this.source = source;
145694 }
145695 EveryOperator.prototype.call = function (observer, source) {
145696 return source.subscribe(new EverySubscriber(observer, this.predicate, this.thisArg, this.source));
145697 };
145698 return EveryOperator;
145699}());
145700var EverySubscriber = /*@__PURE__*/ (function (_super) {
145701 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](EverySubscriber, _super);
145702 function EverySubscriber(destination, predicate, thisArg, source) {
145703 var _this = _super.call(this, destination) || this;
145704 _this.predicate = predicate;
145705 _this.thisArg = thisArg;
145706 _this.source = source;
145707 _this.index = 0;
145708 _this.thisArg = thisArg || _this;
145709 return _this;
145710 }
145711 EverySubscriber.prototype.notifyComplete = function (everyValueMatch) {
145712 this.destination.next(everyValueMatch);
145713 this.destination.complete();
145714 };
145715 EverySubscriber.prototype._next = function (value) {
145716 var result = false;
145717 try {
145718 result = this.predicate.call(this.thisArg, value, this.index++, this.source);
145719 }
145720 catch (err) {
145721 this.destination.error(err);
145722 return;
145723 }
145724 if (!result) {
145725 this.notifyComplete(false);
145726 }
145727 };
145728 EverySubscriber.prototype._complete = function () {
145729 this.notifyComplete(true);
145730 };
145731 return EverySubscriber;
145732}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
145733//# sourceMappingURL=every.js.map
145734
145735
145736/***/ }),
145737/* 933 */
145738/***/ (function(module, __webpack_exports__, __webpack_require__) {
145739
145740"use strict";
145741/* harmony export (immutable) */ __webpack_exports__["a"] = exhaust;
145742/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
145743/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
145744/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
145745/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
145746
145747
145748
145749function exhaust() {
145750 return function (source) { return source.lift(new SwitchFirstOperator()); };
145751}
145752var SwitchFirstOperator = /*@__PURE__*/ (function () {
145753 function SwitchFirstOperator() {
145754 }
145755 SwitchFirstOperator.prototype.call = function (subscriber, source) {
145756 return source.subscribe(new SwitchFirstSubscriber(subscriber));
145757 };
145758 return SwitchFirstOperator;
145759}());
145760var SwitchFirstSubscriber = /*@__PURE__*/ (function (_super) {
145761 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SwitchFirstSubscriber, _super);
145762 function SwitchFirstSubscriber(destination) {
145763 var _this = _super.call(this, destination) || this;
145764 _this.hasCompleted = false;
145765 _this.hasSubscription = false;
145766 return _this;
145767 }
145768 SwitchFirstSubscriber.prototype._next = function (value) {
145769 if (!this.hasSubscription) {
145770 this.hasSubscription = true;
145771 this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(this, value));
145772 }
145773 };
145774 SwitchFirstSubscriber.prototype._complete = function () {
145775 this.hasCompleted = true;
145776 if (!this.hasSubscription) {
145777 this.destination.complete();
145778 }
145779 };
145780 SwitchFirstSubscriber.prototype.notifyComplete = function (innerSub) {
145781 this.remove(innerSub);
145782 this.hasSubscription = false;
145783 if (this.hasCompleted) {
145784 this.destination.complete();
145785 }
145786 };
145787 return SwitchFirstSubscriber;
145788}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
145789//# sourceMappingURL=exhaust.js.map
145790
145791
145792/***/ }),
145793/* 934 */
145794/***/ (function(module, __webpack_exports__, __webpack_require__) {
145795
145796"use strict";
145797/* harmony export (immutable) */ __webpack_exports__["a"] = exhaustMap;
145798/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
145799/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
145800/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__ = __webpack_require__(80);
145801/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19);
145802/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(54);
145803/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__observable_from__ = __webpack_require__(64);
145804/** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult,_map,_observable_from PURE_IMPORTS_END */
145805
145806
145807
145808
145809
145810
145811function exhaustMap(project, resultSelector) {
145812 if (resultSelector) {
145813 return function (source) { return source.pipe(exhaustMap(function (a, i) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__observable_from__["a" /* from */])(project(a, i)).pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__map__["a" /* map */])(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };
145814 }
145815 return function (source) {
145816 return source.lift(new ExhauseMapOperator(project));
145817 };
145818}
145819var ExhauseMapOperator = /*@__PURE__*/ (function () {
145820 function ExhauseMapOperator(project) {
145821 this.project = project;
145822 }
145823 ExhauseMapOperator.prototype.call = function (subscriber, source) {
145824 return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));
145825 };
145826 return ExhauseMapOperator;
145827}());
145828var ExhaustMapSubscriber = /*@__PURE__*/ (function (_super) {
145829 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ExhaustMapSubscriber, _super);
145830 function ExhaustMapSubscriber(destination, project) {
145831 var _this = _super.call(this, destination) || this;
145832 _this.project = project;
145833 _this.hasSubscription = false;
145834 _this.hasCompleted = false;
145835 _this.index = 0;
145836 return _this;
145837 }
145838 ExhaustMapSubscriber.prototype._next = function (value) {
145839 if (!this.hasSubscription) {
145840 this.tryNext(value);
145841 }
145842 };
145843 ExhaustMapSubscriber.prototype.tryNext = function (value) {
145844 var result;
145845 var index = this.index++;
145846 try {
145847 result = this.project(value, index);
145848 }
145849 catch (err) {
145850 this.destination.error(err);
145851 return;
145852 }
145853 this.hasSubscription = true;
145854 this._innerSub(result, value, index);
145855 };
145856 ExhaustMapSubscriber.prototype._innerSub = function (result, value, index) {
145857 var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined);
145858 var destination = this.destination;
145859 destination.add(innerSubscriber);
145860 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(this, result, value, index, innerSubscriber);
145861 };
145862 ExhaustMapSubscriber.prototype._complete = function () {
145863 this.hasCompleted = true;
145864 if (!this.hasSubscription) {
145865 this.destination.complete();
145866 }
145867 this.unsubscribe();
145868 };
145869 ExhaustMapSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
145870 this.destination.next(innerValue);
145871 };
145872 ExhaustMapSubscriber.prototype.notifyError = function (err) {
145873 this.destination.error(err);
145874 };
145875 ExhaustMapSubscriber.prototype.notifyComplete = function (innerSub) {
145876 var destination = this.destination;
145877 destination.remove(innerSub);
145878 this.hasSubscription = false;
145879 if (this.hasCompleted) {
145880 this.destination.complete();
145881 }
145882 };
145883 return ExhaustMapSubscriber;
145884}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
145885//# sourceMappingURL=exhaustMap.js.map
145886
145887
145888/***/ }),
145889/* 935 */
145890/***/ (function(module, __webpack_exports__, __webpack_require__) {
145891
145892"use strict";
145893/* harmony export (immutable) */ __webpack_exports__["a"] = expand;
145894/* unused harmony export ExpandOperator */
145895/* unused harmony export ExpandSubscriber */
145896/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
145897/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_tryCatch__ = __webpack_require__(59);
145898/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_errorObject__ = __webpack_require__(55);
145899/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
145900/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(19);
145901/** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
145902
145903
145904
145905
145906
145907function expand(project, concurrent, scheduler) {
145908 if (concurrent === void 0) {
145909 concurrent = Number.POSITIVE_INFINITY;
145910 }
145911 if (scheduler === void 0) {
145912 scheduler = undefined;
145913 }
145914 concurrent = (concurrent || 0) < 1 ? Number.POSITIVE_INFINITY : concurrent;
145915 return function (source) { return source.lift(new ExpandOperator(project, concurrent, scheduler)); };
145916}
145917var ExpandOperator = /*@__PURE__*/ (function () {
145918 function ExpandOperator(project, concurrent, scheduler) {
145919 this.project = project;
145920 this.concurrent = concurrent;
145921 this.scheduler = scheduler;
145922 }
145923 ExpandOperator.prototype.call = function (subscriber, source) {
145924 return source.subscribe(new ExpandSubscriber(subscriber, this.project, this.concurrent, this.scheduler));
145925 };
145926 return ExpandOperator;
145927}());
145928
145929var ExpandSubscriber = /*@__PURE__*/ (function (_super) {
145930 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ExpandSubscriber, _super);
145931 function ExpandSubscriber(destination, project, concurrent, scheduler) {
145932 var _this = _super.call(this, destination) || this;
145933 _this.project = project;
145934 _this.concurrent = concurrent;
145935 _this.scheduler = scheduler;
145936 _this.index = 0;
145937 _this.active = 0;
145938 _this.hasCompleted = false;
145939 if (concurrent < Number.POSITIVE_INFINITY) {
145940 _this.buffer = [];
145941 }
145942 return _this;
145943 }
145944 ExpandSubscriber.dispatch = function (arg) {
145945 var subscriber = arg.subscriber, result = arg.result, value = arg.value, index = arg.index;
145946 subscriber.subscribeToProjection(result, value, index);
145947 };
145948 ExpandSubscriber.prototype._next = function (value) {
145949 var destination = this.destination;
145950 if (destination.closed) {
145951 this._complete();
145952 return;
145953 }
145954 var index = this.index++;
145955 if (this.active < this.concurrent) {
145956 destination.next(value);
145957 var result = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_tryCatch__["a" /* tryCatch */])(this.project)(value, index);
145958 if (result === __WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */]) {
145959 destination.error(__WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */].e);
145960 }
145961 else if (!this.scheduler) {
145962 this.subscribeToProjection(result, value, index);
145963 }
145964 else {
145965 var state = { subscriber: this, result: result, value: value, index: index };
145966 var destination_1 = this.destination;
145967 destination_1.add(this.scheduler.schedule(ExpandSubscriber.dispatch, 0, state));
145968 }
145969 }
145970 else {
145971 this.buffer.push(value);
145972 }
145973 };
145974 ExpandSubscriber.prototype.subscribeToProjection = function (result, value, index) {
145975 this.active++;
145976 var destination = this.destination;
145977 destination.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__["a" /* subscribeToResult */])(this, result, value, index));
145978 };
145979 ExpandSubscriber.prototype._complete = function () {
145980 this.hasCompleted = true;
145981 if (this.hasCompleted && this.active === 0) {
145982 this.destination.complete();
145983 }
145984 this.unsubscribe();
145985 };
145986 ExpandSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
145987 this._next(innerValue);
145988 };
145989 ExpandSubscriber.prototype.notifyComplete = function (innerSub) {
145990 var buffer = this.buffer;
145991 var destination = this.destination;
145992 destination.remove(innerSub);
145993 this.active--;
145994 if (buffer && buffer.length > 0) {
145995 this._next(buffer.shift());
145996 }
145997 if (this.hasCompleted && this.active === 0) {
145998 this.destination.complete();
145999 }
146000 };
146001 return ExpandSubscriber;
146002}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
146003
146004//# sourceMappingURL=expand.js.map
146005
146006
146007/***/ }),
146008/* 936 */
146009/***/ (function(module, __webpack_exports__, __webpack_require__) {
146010
146011"use strict";
146012/* harmony export (immutable) */ __webpack_exports__["a"] = finalize;
146013/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
146014/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
146015/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(31);
146016/** PURE_IMPORTS_START tslib,_Subscriber,_Subscription PURE_IMPORTS_END */
146017
146018
146019
146020function finalize(callback) {
146021 return function (source) { return source.lift(new FinallyOperator(callback)); };
146022}
146023var FinallyOperator = /*@__PURE__*/ (function () {
146024 function FinallyOperator(callback) {
146025 this.callback = callback;
146026 }
146027 FinallyOperator.prototype.call = function (subscriber, source) {
146028 return source.subscribe(new FinallySubscriber(subscriber, this.callback));
146029 };
146030 return FinallyOperator;
146031}());
146032var FinallySubscriber = /*@__PURE__*/ (function (_super) {
146033 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](FinallySubscriber, _super);
146034 function FinallySubscriber(destination, callback) {
146035 var _this = _super.call(this, destination) || this;
146036 _this.add(new __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */](callback));
146037 return _this;
146038 }
146039 return FinallySubscriber;
146040}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
146041//# sourceMappingURL=finalize.js.map
146042
146043
146044/***/ }),
146045/* 937 */
146046/***/ (function(module, __webpack_exports__, __webpack_require__) {
146047
146048"use strict";
146049/* harmony export (immutable) */ __webpack_exports__["a"] = findIndex;
146050/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__operators_find__ = __webpack_require__(402);
146051/** PURE_IMPORTS_START _operators_find PURE_IMPORTS_END */
146052
146053function findIndex(predicate, thisArg) {
146054 return function (source) { return source.lift(new __WEBPACK_IMPORTED_MODULE_0__operators_find__["b" /* FindValueOperator */](predicate, source, true, thisArg)); };
146055}
146056//# sourceMappingURL=findIndex.js.map
146057
146058
146059/***/ }),
146060/* 938 */
146061/***/ (function(module, __webpack_exports__, __webpack_require__) {
146062
146063"use strict";
146064/* harmony export (immutable) */ __webpack_exports__["a"] = first;
146065/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_EmptyError__ = __webpack_require__(141);
146066/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(135);
146067/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__take__ = __webpack_require__(259);
146068/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__defaultIfEmpty__ = __webpack_require__(134);
146069/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__throwIfEmpty__ = __webpack_require__(179);
146070/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_identity__ = __webpack_require__(113);
146071/** PURE_IMPORTS_START _util_EmptyError,_filter,_take,_defaultIfEmpty,_throwIfEmpty,_util_identity PURE_IMPORTS_END */
146072
146073
146074
146075
146076
146077
146078function first(predicate, defaultValue) {
146079 var hasDefaultValue = arguments.length >= 2;
146080 return function (source) { return source.pipe(predicate ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(function (v, i) { return predicate(v, i, source); }) : __WEBPACK_IMPORTED_MODULE_5__util_identity__["a" /* identity */], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__take__["a" /* take */])(1), hasDefaultValue ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__defaultIfEmpty__["a" /* defaultIfEmpty */])(defaultValue) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__throwIfEmpty__["a" /* throwIfEmpty */])(function () { return new __WEBPACK_IMPORTED_MODULE_0__util_EmptyError__["a" /* EmptyError */](); })); };
146081}
146082//# sourceMappingURL=first.js.map
146083
146084
146085/***/ }),
146086/* 939 */
146087/***/ (function(module, __webpack_exports__, __webpack_require__) {
146088
146089"use strict";
146090/* harmony export (immutable) */ __webpack_exports__["a"] = ignoreElements;
146091/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
146092/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
146093/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
146094
146095
146096function ignoreElements() {
146097 return function ignoreElementsOperatorFunction(source) {
146098 return source.lift(new IgnoreElementsOperator());
146099 };
146100}
146101var IgnoreElementsOperator = /*@__PURE__*/ (function () {
146102 function IgnoreElementsOperator() {
146103 }
146104 IgnoreElementsOperator.prototype.call = function (subscriber, source) {
146105 return source.subscribe(new IgnoreElementsSubscriber(subscriber));
146106 };
146107 return IgnoreElementsOperator;
146108}());
146109var IgnoreElementsSubscriber = /*@__PURE__*/ (function (_super) {
146110 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](IgnoreElementsSubscriber, _super);
146111 function IgnoreElementsSubscriber() {
146112 return _super !== null && _super.apply(this, arguments) || this;
146113 }
146114 IgnoreElementsSubscriber.prototype._next = function (unused) {
146115 };
146116 return IgnoreElementsSubscriber;
146117}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
146118//# sourceMappingURL=ignoreElements.js.map
146119
146120
146121/***/ }),
146122/* 940 */
146123/***/ (function(module, __webpack_exports__, __webpack_require__) {
146124
146125"use strict";
146126/* harmony export (immutable) */ __webpack_exports__["a"] = isEmpty;
146127/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
146128/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
146129/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
146130
146131
146132function isEmpty() {
146133 return function (source) { return source.lift(new IsEmptyOperator()); };
146134}
146135var IsEmptyOperator = /*@__PURE__*/ (function () {
146136 function IsEmptyOperator() {
146137 }
146138 IsEmptyOperator.prototype.call = function (observer, source) {
146139 return source.subscribe(new IsEmptySubscriber(observer));
146140 };
146141 return IsEmptyOperator;
146142}());
146143var IsEmptySubscriber = /*@__PURE__*/ (function (_super) {
146144 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](IsEmptySubscriber, _super);
146145 function IsEmptySubscriber(destination) {
146146 return _super.call(this, destination) || this;
146147 }
146148 IsEmptySubscriber.prototype.notifyComplete = function (isEmpty) {
146149 var destination = this.destination;
146150 destination.next(isEmpty);
146151 destination.complete();
146152 };
146153 IsEmptySubscriber.prototype._next = function (value) {
146154 this.notifyComplete(false);
146155 };
146156 IsEmptySubscriber.prototype._complete = function () {
146157 this.notifyComplete(true);
146158 };
146159 return IsEmptySubscriber;
146160}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
146161//# sourceMappingURL=isEmpty.js.map
146162
146163
146164/***/ }),
146165/* 941 */
146166/***/ (function(module, __webpack_exports__, __webpack_require__) {
146167
146168"use strict";
146169/* harmony export (immutable) */ __webpack_exports__["a"] = last;
146170/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_EmptyError__ = __webpack_require__(141);
146171/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(135);
146172/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__takeLast__ = __webpack_require__(260);
146173/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__throwIfEmpty__ = __webpack_require__(179);
146174/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__defaultIfEmpty__ = __webpack_require__(134);
146175/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_identity__ = __webpack_require__(113);
146176/** PURE_IMPORTS_START _util_EmptyError,_filter,_takeLast,_throwIfEmpty,_defaultIfEmpty,_util_identity PURE_IMPORTS_END */
146177
146178
146179
146180
146181
146182
146183function last(predicate, defaultValue) {
146184 var hasDefaultValue = arguments.length >= 2;
146185 return function (source) { return source.pipe(predicate ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(function (v, i) { return predicate(v, i, source); }) : __WEBPACK_IMPORTED_MODULE_5__util_identity__["a" /* identity */], __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__takeLast__["a" /* takeLast */])(1), hasDefaultValue ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__defaultIfEmpty__["a" /* defaultIfEmpty */])(defaultValue) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__throwIfEmpty__["a" /* throwIfEmpty */])(function () { return new __WEBPACK_IMPORTED_MODULE_0__util_EmptyError__["a" /* EmptyError */](); })); };
146186}
146187//# sourceMappingURL=last.js.map
146188
146189
146190/***/ }),
146191/* 942 */
146192/***/ (function(module, __webpack_exports__, __webpack_require__) {
146193
146194"use strict";
146195/* harmony export (immutable) */ __webpack_exports__["a"] = mapTo;
146196/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
146197/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
146198/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
146199
146200
146201function mapTo(value) {
146202 return function (source) { return source.lift(new MapToOperator(value)); };
146203}
146204var MapToOperator = /*@__PURE__*/ (function () {
146205 function MapToOperator(value) {
146206 this.value = value;
146207 }
146208 MapToOperator.prototype.call = function (subscriber, source) {
146209 return source.subscribe(new MapToSubscriber(subscriber, this.value));
146210 };
146211 return MapToOperator;
146212}());
146213var MapToSubscriber = /*@__PURE__*/ (function (_super) {
146214 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MapToSubscriber, _super);
146215 function MapToSubscriber(destination, value) {
146216 var _this = _super.call(this, destination) || this;
146217 _this.value = value;
146218 return _this;
146219 }
146220 MapToSubscriber.prototype._next = function (x) {
146221 this.destination.next(this.value);
146222 };
146223 return MapToSubscriber;
146224}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
146225//# sourceMappingURL=mapTo.js.map
146226
146227
146228/***/ }),
146229/* 943 */
146230/***/ (function(module, __webpack_exports__, __webpack_require__) {
146231
146232"use strict";
146233/* harmony export (immutable) */ __webpack_exports__["a"] = materialize;
146234/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
146235/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
146236/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Notification__ = __webpack_require__(175);
146237/** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */
146238
146239
146240
146241function materialize() {
146242 return function materializeOperatorFunction(source) {
146243 return source.lift(new MaterializeOperator());
146244 };
146245}
146246var MaterializeOperator = /*@__PURE__*/ (function () {
146247 function MaterializeOperator() {
146248 }
146249 MaterializeOperator.prototype.call = function (subscriber, source) {
146250 return source.subscribe(new MaterializeSubscriber(subscriber));
146251 };
146252 return MaterializeOperator;
146253}());
146254var MaterializeSubscriber = /*@__PURE__*/ (function (_super) {
146255 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MaterializeSubscriber, _super);
146256 function MaterializeSubscriber(destination) {
146257 return _super.call(this, destination) || this;
146258 }
146259 MaterializeSubscriber.prototype._next = function (value) {
146260 this.destination.next(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createNext(value));
146261 };
146262 MaterializeSubscriber.prototype._error = function (err) {
146263 var destination = this.destination;
146264 destination.next(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createError(err));
146265 destination.complete();
146266 };
146267 MaterializeSubscriber.prototype._complete = function () {
146268 var destination = this.destination;
146269 destination.next(__WEBPACK_IMPORTED_MODULE_2__Notification__["a" /* Notification */].createComplete());
146270 destination.complete();
146271 };
146272 return MaterializeSubscriber;
146273}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
146274//# sourceMappingURL=materialize.js.map
146275
146276
146277/***/ }),
146278/* 944 */
146279/***/ (function(module, __webpack_exports__, __webpack_require__) {
146280
146281"use strict";
146282/* harmony export (immutable) */ __webpack_exports__["a"] = max;
146283/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__reduce__ = __webpack_require__(178);
146284/** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
146285
146286function max(comparer) {
146287 var max = (typeof comparer === 'function')
146288 ? function (x, y) { return comparer(x, y) > 0 ? x : y; }
146289 : function (x, y) { return x > y ? x : y; };
146290 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__reduce__["a" /* reduce */])(max);
146291}
146292//# sourceMappingURL=max.js.map
146293
146294
146295/***/ }),
146296/* 945 */
146297/***/ (function(module, __webpack_exports__, __webpack_require__) {
146298
146299"use strict";
146300/* harmony export (immutable) */ __webpack_exports__["a"] = merge;
146301/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_merge__ = __webpack_require__(394);
146302/** PURE_IMPORTS_START _observable_merge PURE_IMPORTS_END */
146303
146304function merge() {
146305 var observables = [];
146306 for (var _i = 0; _i < arguments.length; _i++) {
146307 observables[_i] = arguments[_i];
146308 }
146309 return function (source) { return source.lift.call(__WEBPACK_IMPORTED_MODULE_0__observable_merge__["a" /* merge */].apply(void 0, [source].concat(observables))); };
146310}
146311//# sourceMappingURL=merge.js.map
146312
146313
146314/***/ }),
146315/* 946 */
146316/***/ (function(module, __webpack_exports__, __webpack_require__) {
146317
146318"use strict";
146319/* harmony export (immutable) */ __webpack_exports__["a"] = mergeMapTo;
146320/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mergeMap__ = __webpack_require__(136);
146321/** PURE_IMPORTS_START _mergeMap PURE_IMPORTS_END */
146322
146323function mergeMapTo(innerObservable, resultSelector, concurrent) {
146324 if (concurrent === void 0) {
146325 concurrent = Number.POSITIVE_INFINITY;
146326 }
146327 if (typeof resultSelector === 'function') {
146328 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeMap__["a" /* mergeMap */])(function () { return innerObservable; }, resultSelector, concurrent);
146329 }
146330 if (typeof resultSelector === 'number') {
146331 concurrent = resultSelector;
146332 }
146333 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__mergeMap__["a" /* mergeMap */])(function () { return innerObservable; }, concurrent);
146334}
146335//# sourceMappingURL=mergeMapTo.js.map
146336
146337
146338/***/ }),
146339/* 947 */
146340/***/ (function(module, __webpack_exports__, __webpack_require__) {
146341
146342"use strict";
146343/* harmony export (immutable) */ __webpack_exports__["a"] = mergeScan;
146344/* unused harmony export MergeScanOperator */
146345/* unused harmony export MergeScanSubscriber */
146346/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
146347/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_tryCatch__ = __webpack_require__(59);
146348/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_errorObject__ = __webpack_require__(55);
146349/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19);
146350/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18);
146351/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__InnerSubscriber__ = __webpack_require__(80);
146352/** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber PURE_IMPORTS_END */
146353
146354
146355
146356
146357
146358
146359function mergeScan(accumulator, seed, concurrent) {
146360 if (concurrent === void 0) {
146361 concurrent = Number.POSITIVE_INFINITY;
146362 }
146363 return function (source) { return source.lift(new MergeScanOperator(accumulator, seed, concurrent)); };
146364}
146365var MergeScanOperator = /*@__PURE__*/ (function () {
146366 function MergeScanOperator(accumulator, seed, concurrent) {
146367 this.accumulator = accumulator;
146368 this.seed = seed;
146369 this.concurrent = concurrent;
146370 }
146371 MergeScanOperator.prototype.call = function (subscriber, source) {
146372 return source.subscribe(new MergeScanSubscriber(subscriber, this.accumulator, this.seed, this.concurrent));
146373 };
146374 return MergeScanOperator;
146375}());
146376
146377var MergeScanSubscriber = /*@__PURE__*/ (function (_super) {
146378 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](MergeScanSubscriber, _super);
146379 function MergeScanSubscriber(destination, accumulator, acc, concurrent) {
146380 var _this = _super.call(this, destination) || this;
146381 _this.accumulator = accumulator;
146382 _this.acc = acc;
146383 _this.concurrent = concurrent;
146384 _this.hasValue = false;
146385 _this.hasCompleted = false;
146386 _this.buffer = [];
146387 _this.active = 0;
146388 _this.index = 0;
146389 return _this;
146390 }
146391 MergeScanSubscriber.prototype._next = function (value) {
146392 if (this.active < this.concurrent) {
146393 var index = this.index++;
146394 var ish = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_tryCatch__["a" /* tryCatch */])(this.accumulator)(this.acc, value);
146395 var destination = this.destination;
146396 if (ish === __WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */]) {
146397 destination.error(__WEBPACK_IMPORTED_MODULE_2__util_errorObject__["a" /* errorObject */].e);
146398 }
146399 else {
146400 this.active++;
146401 this._innerSub(ish, value, index);
146402 }
146403 }
146404 else {
146405 this.buffer.push(value);
146406 }
146407 };
146408 MergeScanSubscriber.prototype._innerSub = function (ish, value, index) {
146409 var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_5__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined);
146410 var destination = this.destination;
146411 destination.add(innerSubscriber);
146412 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(this, ish, value, index, innerSubscriber);
146413 };
146414 MergeScanSubscriber.prototype._complete = function () {
146415 this.hasCompleted = true;
146416 if (this.active === 0 && this.buffer.length === 0) {
146417 if (this.hasValue === false) {
146418 this.destination.next(this.acc);
146419 }
146420 this.destination.complete();
146421 }
146422 this.unsubscribe();
146423 };
146424 MergeScanSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
146425 var destination = this.destination;
146426 this.acc = innerValue;
146427 this.hasValue = true;
146428 destination.next(innerValue);
146429 };
146430 MergeScanSubscriber.prototype.notifyComplete = function (innerSub) {
146431 var buffer = this.buffer;
146432 var destination = this.destination;
146433 destination.remove(innerSub);
146434 this.active--;
146435 if (buffer.length > 0) {
146436 this._next(buffer.shift());
146437 }
146438 else if (this.active === 0 && this.hasCompleted) {
146439 if (this.hasValue === false) {
146440 this.destination.next(this.acc);
146441 }
146442 this.destination.complete();
146443 }
146444 };
146445 return MergeScanSubscriber;
146446}(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */]));
146447
146448//# sourceMappingURL=mergeScan.js.map
146449
146450
146451/***/ }),
146452/* 948 */
146453/***/ (function(module, __webpack_exports__, __webpack_require__) {
146454
146455"use strict";
146456/* harmony export (immutable) */ __webpack_exports__["a"] = min;
146457/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__reduce__ = __webpack_require__(178);
146458/** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
146459
146460function min(comparer) {
146461 var min = (typeof comparer === 'function')
146462 ? function (x, y) { return comparer(x, y) < 0 ? x : y; }
146463 : function (x, y) { return x < y ? x : y; };
146464 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__reduce__["a" /* reduce */])(min);
146465}
146466//# sourceMappingURL=min.js.map
146467
146468
146469/***/ }),
146470/* 949 */
146471/***/ (function(module, __webpack_exports__, __webpack_require__) {
146472
146473"use strict";
146474/* harmony export (immutable) */ __webpack_exports__["a"] = onErrorResumeNext;
146475/* unused harmony export onErrorResumeNextStatic */
146476/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
146477/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_from__ = __webpack_require__(64);
146478/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArray__ = __webpack_require__(48);
146479/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(18);
146480/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__InnerSubscriber__ = __webpack_require__(80);
146481/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19);
146482/** PURE_IMPORTS_START tslib,_observable_from,_util_isArray,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
146483
146484
146485
146486
146487
146488
146489function onErrorResumeNext() {
146490 var nextSources = [];
146491 for (var _i = 0; _i < arguments.length; _i++) {
146492 nextSources[_i] = arguments[_i];
146493 }
146494 if (nextSources.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(nextSources[0])) {
146495 nextSources = nextSources[0];
146496 }
146497 return function (source) { return source.lift(new OnErrorResumeNextOperator(nextSources)); };
146498}
146499function onErrorResumeNextStatic() {
146500 var nextSources = [];
146501 for (var _i = 0; _i < arguments.length; _i++) {
146502 nextSources[_i] = arguments[_i];
146503 }
146504 var source = null;
146505 if (nextSources.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isArray__["a" /* isArray */])(nextSources[0])) {
146506 nextSources = nextSources[0];
146507 }
146508 source = nextSources.shift();
146509 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_from__["a" /* from */])(source, null).lift(new OnErrorResumeNextOperator(nextSources));
146510}
146511var OnErrorResumeNextOperator = /*@__PURE__*/ (function () {
146512 function OnErrorResumeNextOperator(nextSources) {
146513 this.nextSources = nextSources;
146514 }
146515 OnErrorResumeNextOperator.prototype.call = function (subscriber, source) {
146516 return source.subscribe(new OnErrorResumeNextSubscriber(subscriber, this.nextSources));
146517 };
146518 return OnErrorResumeNextOperator;
146519}());
146520var OnErrorResumeNextSubscriber = /*@__PURE__*/ (function (_super) {
146521 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](OnErrorResumeNextSubscriber, _super);
146522 function OnErrorResumeNextSubscriber(destination, nextSources) {
146523 var _this = _super.call(this, destination) || this;
146524 _this.destination = destination;
146525 _this.nextSources = nextSources;
146526 return _this;
146527 }
146528 OnErrorResumeNextSubscriber.prototype.notifyError = function (error, innerSub) {
146529 this.subscribeToNextSource();
146530 };
146531 OnErrorResumeNextSubscriber.prototype.notifyComplete = function (innerSub) {
146532 this.subscribeToNextSource();
146533 };
146534 OnErrorResumeNextSubscriber.prototype._error = function (err) {
146535 this.subscribeToNextSource();
146536 this.unsubscribe();
146537 };
146538 OnErrorResumeNextSubscriber.prototype._complete = function () {
146539 this.subscribeToNextSource();
146540 this.unsubscribe();
146541 };
146542 OnErrorResumeNextSubscriber.prototype.subscribeToNextSource = function () {
146543 var next = this.nextSources.shift();
146544 if (next) {
146545 var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_4__InnerSubscriber__["a" /* InnerSubscriber */](this, undefined, undefined);
146546 var destination = this.destination;
146547 destination.add(innerSubscriber);
146548 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, next, undefined, undefined, innerSubscriber);
146549 }
146550 else {
146551 this.destination.complete();
146552 }
146553 };
146554 return OnErrorResumeNextSubscriber;
146555}(__WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__["a" /* OuterSubscriber */]));
146556//# sourceMappingURL=onErrorResumeNext.js.map
146557
146558
146559/***/ }),
146560/* 950 */
146561/***/ (function(module, __webpack_exports__, __webpack_require__) {
146562
146563"use strict";
146564/* harmony export (immutable) */ __webpack_exports__["a"] = pairwise;
146565/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
146566/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
146567/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
146568
146569
146570function pairwise() {
146571 return function (source) { return source.lift(new PairwiseOperator()); };
146572}
146573var PairwiseOperator = /*@__PURE__*/ (function () {
146574 function PairwiseOperator() {
146575 }
146576 PairwiseOperator.prototype.call = function (subscriber, source) {
146577 return source.subscribe(new PairwiseSubscriber(subscriber));
146578 };
146579 return PairwiseOperator;
146580}());
146581var PairwiseSubscriber = /*@__PURE__*/ (function (_super) {
146582 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](PairwiseSubscriber, _super);
146583 function PairwiseSubscriber(destination) {
146584 var _this = _super.call(this, destination) || this;
146585 _this.hasPrev = false;
146586 return _this;
146587 }
146588 PairwiseSubscriber.prototype._next = function (value) {
146589 if (this.hasPrev) {
146590 this.destination.next([this.prev, value]);
146591 }
146592 else {
146593 this.hasPrev = true;
146594 }
146595 this.prev = value;
146596 };
146597 return PairwiseSubscriber;
146598}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
146599//# sourceMappingURL=pairwise.js.map
146600
146601
146602/***/ }),
146603/* 951 */
146604/***/ (function(module, __webpack_exports__, __webpack_require__) {
146605
146606"use strict";
146607/* harmony export (immutable) */ __webpack_exports__["a"] = partition;
146608/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_not__ = __webpack_require__(1004);
146609/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(135);
146610/** PURE_IMPORTS_START _util_not,_filter PURE_IMPORTS_END */
146611
146612
146613function partition(predicate, thisArg) {
146614 return function (source) {
146615 return [
146616 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(predicate, thisArg)(source),
146617 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__filter__["a" /* filter */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_not__["a" /* not */])(predicate, thisArg))(source)
146618 ];
146619 };
146620}
146621//# sourceMappingURL=partition.js.map
146622
146623
146624/***/ }),
146625/* 952 */
146626/***/ (function(module, __webpack_exports__, __webpack_require__) {
146627
146628"use strict";
146629/* harmony export (immutable) */ __webpack_exports__["a"] = pluck;
146630/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__map__ = __webpack_require__(54);
146631/** PURE_IMPORTS_START _map PURE_IMPORTS_END */
146632
146633function pluck() {
146634 var properties = [];
146635 for (var _i = 0; _i < arguments.length; _i++) {
146636 properties[_i] = arguments[_i];
146637 }
146638 var length = properties.length;
146639 if (length === 0) {
146640 throw new Error('list of properties cannot be empty.');
146641 }
146642 return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__map__["a" /* map */])(plucker(properties, length))(source); };
146643}
146644function plucker(props, length) {
146645 var mapper = function (x) {
146646 var currentProp = x;
146647 for (var i = 0; i < length; i++) {
146648 var p = currentProp[props[i]];
146649 if (typeof p !== 'undefined') {
146650 currentProp = p;
146651 }
146652 else {
146653 return undefined;
146654 }
146655 }
146656 return currentProp;
146657 };
146658 return mapper;
146659}
146660//# sourceMappingURL=pluck.js.map
146661
146662
146663/***/ }),
146664/* 953 */
146665/***/ (function(module, __webpack_exports__, __webpack_require__) {
146666
146667"use strict";
146668/* harmony export (immutable) */ __webpack_exports__["a"] = publish;
146669/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Subject__ = __webpack_require__(43);
146670/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multicast__ = __webpack_require__(111);
146671/** PURE_IMPORTS_START _Subject,_multicast PURE_IMPORTS_END */
146672
146673
146674function publish(selector) {
146675 return selector ?
146676 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(function () { return new __WEBPACK_IMPORTED_MODULE_0__Subject__["a" /* Subject */](); }, selector) :
146677 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(new __WEBPACK_IMPORTED_MODULE_0__Subject__["a" /* Subject */]());
146678}
146679//# sourceMappingURL=publish.js.map
146680
146681
146682/***/ }),
146683/* 954 */
146684/***/ (function(module, __webpack_exports__, __webpack_require__) {
146685
146686"use strict";
146687/* harmony export (immutable) */ __webpack_exports__["a"] = publishBehavior;
146688/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__BehaviorSubject__ = __webpack_require__(389);
146689/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multicast__ = __webpack_require__(111);
146690/** PURE_IMPORTS_START _BehaviorSubject,_multicast PURE_IMPORTS_END */
146691
146692
146693function publishBehavior(value) {
146694 return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(new __WEBPACK_IMPORTED_MODULE_0__BehaviorSubject__["a" /* BehaviorSubject */](value))(source); };
146695}
146696//# sourceMappingURL=publishBehavior.js.map
146697
146698
146699/***/ }),
146700/* 955 */
146701/***/ (function(module, __webpack_exports__, __webpack_require__) {
146702
146703"use strict";
146704/* harmony export (immutable) */ __webpack_exports__["a"] = publishLast;
146705/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AsyncSubject__ = __webpack_require__(174);
146706/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multicast__ = __webpack_require__(111);
146707/** PURE_IMPORTS_START _AsyncSubject,_multicast PURE_IMPORTS_END */
146708
146709
146710function publishLast() {
146711 return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(new __WEBPACK_IMPORTED_MODULE_0__AsyncSubject__["a" /* AsyncSubject */]())(source); };
146712}
146713//# sourceMappingURL=publishLast.js.map
146714
146715
146716/***/ }),
146717/* 956 */
146718/***/ (function(module, __webpack_exports__, __webpack_require__) {
146719
146720"use strict";
146721/* harmony export (immutable) */ __webpack_exports__["a"] = publishReplay;
146722/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__ = __webpack_require__(248);
146723/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__multicast__ = __webpack_require__(111);
146724/** PURE_IMPORTS_START _ReplaySubject,_multicast PURE_IMPORTS_END */
146725
146726
146727function publishReplay(bufferSize, windowTime, selectorOrScheduler, scheduler) {
146728 if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') {
146729 scheduler = selectorOrScheduler;
146730 }
146731 var selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined;
146732 var subject = new __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__["a" /* ReplaySubject */](bufferSize, windowTime, scheduler);
146733 return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__multicast__["a" /* multicast */])(function () { return subject; }, selector)(source); };
146734}
146735//# sourceMappingURL=publishReplay.js.map
146736
146737
146738/***/ }),
146739/* 957 */
146740/***/ (function(module, __webpack_exports__, __webpack_require__) {
146741
146742"use strict";
146743/* harmony export (immutable) */ __webpack_exports__["a"] = race;
146744/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(48);
146745/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_race__ = __webpack_require__(396);
146746/** PURE_IMPORTS_START _util_isArray,_observable_race PURE_IMPORTS_END */
146747
146748
146749function race() {
146750 var observables = [];
146751 for (var _i = 0; _i < arguments.length; _i++) {
146752 observables[_i] = arguments[_i];
146753 }
146754 return function raceOperatorFunction(source) {
146755 if (observables.length === 1 && __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(observables[0])) {
146756 observables = observables[0];
146757 }
146758 return source.lift.call(__WEBPACK_IMPORTED_MODULE_1__observable_race__["a" /* race */].apply(void 0, [source].concat(observables)));
146759 };
146760}
146761//# sourceMappingURL=race.js.map
146762
146763
146764/***/ }),
146765/* 958 */
146766/***/ (function(module, __webpack_exports__, __webpack_require__) {
146767
146768"use strict";
146769/* harmony export (immutable) */ __webpack_exports__["a"] = repeat;
146770/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
146771/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
146772/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_empty__ = __webpack_require__(46);
146773/** PURE_IMPORTS_START tslib,_Subscriber,_observable_empty PURE_IMPORTS_END */
146774
146775
146776
146777function repeat(count) {
146778 if (count === void 0) {
146779 count = -1;
146780 }
146781 return function (source) {
146782 if (count === 0) {
146783 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_empty__["a" /* empty */])();
146784 }
146785 else if (count < 0) {
146786 return source.lift(new RepeatOperator(-1, source));
146787 }
146788 else {
146789 return source.lift(new RepeatOperator(count - 1, source));
146790 }
146791 };
146792}
146793var RepeatOperator = /*@__PURE__*/ (function () {
146794 function RepeatOperator(count, source) {
146795 this.count = count;
146796 this.source = source;
146797 }
146798 RepeatOperator.prototype.call = function (subscriber, source) {
146799 return source.subscribe(new RepeatSubscriber(subscriber, this.count, this.source));
146800 };
146801 return RepeatOperator;
146802}());
146803var RepeatSubscriber = /*@__PURE__*/ (function (_super) {
146804 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RepeatSubscriber, _super);
146805 function RepeatSubscriber(destination, count, source) {
146806 var _this = _super.call(this, destination) || this;
146807 _this.count = count;
146808 _this.source = source;
146809 return _this;
146810 }
146811 RepeatSubscriber.prototype.complete = function () {
146812 if (!this.isStopped) {
146813 var _a = this, source = _a.source, count = _a.count;
146814 if (count === 0) {
146815 return _super.prototype.complete.call(this);
146816 }
146817 else if (count > -1) {
146818 this.count = count - 1;
146819 }
146820 source.subscribe(this._unsubscribeAndRecycle());
146821 }
146822 };
146823 return RepeatSubscriber;
146824}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
146825//# sourceMappingURL=repeat.js.map
146826
146827
146828/***/ }),
146829/* 959 */
146830/***/ (function(module, __webpack_exports__, __webpack_require__) {
146831
146832"use strict";
146833/* harmony export (immutable) */ __webpack_exports__["a"] = repeatWhen;
146834/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
146835/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
146836/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(59);
146837/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55);
146838/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18);
146839/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19);
146840/** PURE_IMPORTS_START tslib,_Subject,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
146841
146842
146843
146844
146845
146846
146847function repeatWhen(notifier) {
146848 return function (source) { return source.lift(new RepeatWhenOperator(notifier)); };
146849}
146850var RepeatWhenOperator = /*@__PURE__*/ (function () {
146851 function RepeatWhenOperator(notifier) {
146852 this.notifier = notifier;
146853 }
146854 RepeatWhenOperator.prototype.call = function (subscriber, source) {
146855 return source.subscribe(new RepeatWhenSubscriber(subscriber, this.notifier, source));
146856 };
146857 return RepeatWhenOperator;
146858}());
146859var RepeatWhenSubscriber = /*@__PURE__*/ (function (_super) {
146860 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RepeatWhenSubscriber, _super);
146861 function RepeatWhenSubscriber(destination, notifier, source) {
146862 var _this = _super.call(this, destination) || this;
146863 _this.notifier = notifier;
146864 _this.source = source;
146865 _this.sourceIsBeingSubscribedTo = true;
146866 return _this;
146867 }
146868 RepeatWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
146869 this.sourceIsBeingSubscribedTo = true;
146870 this.source.subscribe(this);
146871 };
146872 RepeatWhenSubscriber.prototype.notifyComplete = function (innerSub) {
146873 if (this.sourceIsBeingSubscribedTo === false) {
146874 return _super.prototype.complete.call(this);
146875 }
146876 };
146877 RepeatWhenSubscriber.prototype.complete = function () {
146878 this.sourceIsBeingSubscribedTo = false;
146879 if (!this.isStopped) {
146880 if (!this.retries) {
146881 this.subscribeToRetries();
146882 }
146883 if (!this.retriesSubscription || this.retriesSubscription.closed) {
146884 return _super.prototype.complete.call(this);
146885 }
146886 this._unsubscribeAndRecycle();
146887 this.notifications.next();
146888 }
146889 };
146890 RepeatWhenSubscriber.prototype._unsubscribe = function () {
146891 var _a = this, notifications = _a.notifications, retriesSubscription = _a.retriesSubscription;
146892 if (notifications) {
146893 notifications.unsubscribe();
146894 this.notifications = null;
146895 }
146896 if (retriesSubscription) {
146897 retriesSubscription.unsubscribe();
146898 this.retriesSubscription = null;
146899 }
146900 this.retries = null;
146901 };
146902 RepeatWhenSubscriber.prototype._unsubscribeAndRecycle = function () {
146903 var _unsubscribe = this._unsubscribe;
146904 this._unsubscribe = null;
146905 _super.prototype._unsubscribeAndRecycle.call(this);
146906 this._unsubscribe = _unsubscribe;
146907 return this;
146908 };
146909 RepeatWhenSubscriber.prototype.subscribeToRetries = function () {
146910 this.notifications = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]();
146911 var retries = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.notifier)(this.notifications);
146912 if (retries === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
146913 return _super.prototype.complete.call(this);
146914 }
146915 this.retries = retries;
146916 this.retriesSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, retries);
146917 };
146918 return RepeatWhenSubscriber;
146919}(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */]));
146920//# sourceMappingURL=repeatWhen.js.map
146921
146922
146923/***/ }),
146924/* 960 */
146925/***/ (function(module, __webpack_exports__, __webpack_require__) {
146926
146927"use strict";
146928/* harmony export (immutable) */ __webpack_exports__["a"] = retry;
146929/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
146930/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
146931/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
146932
146933
146934function retry(count) {
146935 if (count === void 0) {
146936 count = -1;
146937 }
146938 return function (source) { return source.lift(new RetryOperator(count, source)); };
146939}
146940var RetryOperator = /*@__PURE__*/ (function () {
146941 function RetryOperator(count, source) {
146942 this.count = count;
146943 this.source = source;
146944 }
146945 RetryOperator.prototype.call = function (subscriber, source) {
146946 return source.subscribe(new RetrySubscriber(subscriber, this.count, this.source));
146947 };
146948 return RetryOperator;
146949}());
146950var RetrySubscriber = /*@__PURE__*/ (function (_super) {
146951 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RetrySubscriber, _super);
146952 function RetrySubscriber(destination, count, source) {
146953 var _this = _super.call(this, destination) || this;
146954 _this.count = count;
146955 _this.source = source;
146956 return _this;
146957 }
146958 RetrySubscriber.prototype.error = function (err) {
146959 if (!this.isStopped) {
146960 var _a = this, source = _a.source, count = _a.count;
146961 if (count === 0) {
146962 return _super.prototype.error.call(this, err);
146963 }
146964 else if (count > -1) {
146965 this.count = count - 1;
146966 }
146967 source.subscribe(this._unsubscribeAndRecycle());
146968 }
146969 };
146970 return RetrySubscriber;
146971}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
146972//# sourceMappingURL=retry.js.map
146973
146974
146975/***/ }),
146976/* 961 */
146977/***/ (function(module, __webpack_exports__, __webpack_require__) {
146978
146979"use strict";
146980/* harmony export (immutable) */ __webpack_exports__["a"] = retryWhen;
146981/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
146982/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
146983/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(59);
146984/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55);
146985/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18);
146986/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19);
146987/** PURE_IMPORTS_START tslib,_Subject,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
146988
146989
146990
146991
146992
146993
146994function retryWhen(notifier) {
146995 return function (source) { return source.lift(new RetryWhenOperator(notifier, source)); };
146996}
146997var RetryWhenOperator = /*@__PURE__*/ (function () {
146998 function RetryWhenOperator(notifier, source) {
146999 this.notifier = notifier;
147000 this.source = source;
147001 }
147002 RetryWhenOperator.prototype.call = function (subscriber, source) {
147003 return source.subscribe(new RetryWhenSubscriber(subscriber, this.notifier, this.source));
147004 };
147005 return RetryWhenOperator;
147006}());
147007var RetryWhenSubscriber = /*@__PURE__*/ (function (_super) {
147008 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](RetryWhenSubscriber, _super);
147009 function RetryWhenSubscriber(destination, notifier, source) {
147010 var _this = _super.call(this, destination) || this;
147011 _this.notifier = notifier;
147012 _this.source = source;
147013 return _this;
147014 }
147015 RetryWhenSubscriber.prototype.error = function (err) {
147016 if (!this.isStopped) {
147017 var errors = this.errors;
147018 var retries = this.retries;
147019 var retriesSubscription = this.retriesSubscription;
147020 if (!retries) {
147021 errors = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]();
147022 retries = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.notifier)(errors);
147023 if (retries === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
147024 return _super.prototype.error.call(this, __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e);
147025 }
147026 retriesSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, retries);
147027 }
147028 else {
147029 this.errors = null;
147030 this.retriesSubscription = null;
147031 }
147032 this._unsubscribeAndRecycle();
147033 this.errors = errors;
147034 this.retries = retries;
147035 this.retriesSubscription = retriesSubscription;
147036 errors.next(err);
147037 }
147038 };
147039 RetryWhenSubscriber.prototype._unsubscribe = function () {
147040 var _a = this, errors = _a.errors, retriesSubscription = _a.retriesSubscription;
147041 if (errors) {
147042 errors.unsubscribe();
147043 this.errors = null;
147044 }
147045 if (retriesSubscription) {
147046 retriesSubscription.unsubscribe();
147047 this.retriesSubscription = null;
147048 }
147049 this.retries = null;
147050 };
147051 RetryWhenSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
147052 var _unsubscribe = this._unsubscribe;
147053 this._unsubscribe = null;
147054 this._unsubscribeAndRecycle();
147055 this._unsubscribe = _unsubscribe;
147056 this.source.subscribe(this);
147057 };
147058 return RetryWhenSubscriber;
147059}(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */]));
147060//# sourceMappingURL=retryWhen.js.map
147061
147062
147063/***/ }),
147064/* 962 */
147065/***/ (function(module, __webpack_exports__, __webpack_require__) {
147066
147067"use strict";
147068/* harmony export (immutable) */ __webpack_exports__["a"] = sample;
147069/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
147070/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
147071/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
147072/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
147073
147074
147075
147076function sample(notifier) {
147077 return function (source) { return source.lift(new SampleOperator(notifier)); };
147078}
147079var SampleOperator = /*@__PURE__*/ (function () {
147080 function SampleOperator(notifier) {
147081 this.notifier = notifier;
147082 }
147083 SampleOperator.prototype.call = function (subscriber, source) {
147084 var sampleSubscriber = new SampleSubscriber(subscriber);
147085 var subscription = source.subscribe(sampleSubscriber);
147086 subscription.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(sampleSubscriber, this.notifier));
147087 return subscription;
147088 };
147089 return SampleOperator;
147090}());
147091var SampleSubscriber = /*@__PURE__*/ (function (_super) {
147092 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SampleSubscriber, _super);
147093 function SampleSubscriber() {
147094 var _this = _super !== null && _super.apply(this, arguments) || this;
147095 _this.hasValue = false;
147096 return _this;
147097 }
147098 SampleSubscriber.prototype._next = function (value) {
147099 this.value = value;
147100 this.hasValue = true;
147101 };
147102 SampleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
147103 this.emitValue();
147104 };
147105 SampleSubscriber.prototype.notifyComplete = function () {
147106 this.emitValue();
147107 };
147108 SampleSubscriber.prototype.emitValue = function () {
147109 if (this.hasValue) {
147110 this.hasValue = false;
147111 this.destination.next(this.value);
147112 }
147113 };
147114 return SampleSubscriber;
147115}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
147116//# sourceMappingURL=sample.js.map
147117
147118
147119/***/ }),
147120/* 963 */
147121/***/ (function(module, __webpack_exports__, __webpack_require__) {
147122
147123"use strict";
147124/* harmony export (immutable) */ __webpack_exports__["a"] = sampleTime;
147125/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
147126/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
147127/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_async__ = __webpack_require__(47);
147128/** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */
147129
147130
147131
147132function sampleTime(period, scheduler) {
147133 if (scheduler === void 0) {
147134 scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_async__["a" /* async */];
147135 }
147136 return function (source) { return source.lift(new SampleTimeOperator(period, scheduler)); };
147137}
147138var SampleTimeOperator = /*@__PURE__*/ (function () {
147139 function SampleTimeOperator(period, scheduler) {
147140 this.period = period;
147141 this.scheduler = scheduler;
147142 }
147143 SampleTimeOperator.prototype.call = function (subscriber, source) {
147144 return source.subscribe(new SampleTimeSubscriber(subscriber, this.period, this.scheduler));
147145 };
147146 return SampleTimeOperator;
147147}());
147148var SampleTimeSubscriber = /*@__PURE__*/ (function (_super) {
147149 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SampleTimeSubscriber, _super);
147150 function SampleTimeSubscriber(destination, period, scheduler) {
147151 var _this = _super.call(this, destination) || this;
147152 _this.period = period;
147153 _this.scheduler = scheduler;
147154 _this.hasValue = false;
147155 _this.add(scheduler.schedule(dispatchNotification, period, { subscriber: _this, period: period }));
147156 return _this;
147157 }
147158 SampleTimeSubscriber.prototype._next = function (value) {
147159 this.lastValue = value;
147160 this.hasValue = true;
147161 };
147162 SampleTimeSubscriber.prototype.notifyNext = function () {
147163 if (this.hasValue) {
147164 this.hasValue = false;
147165 this.destination.next(this.lastValue);
147166 }
147167 };
147168 return SampleTimeSubscriber;
147169}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
147170function dispatchNotification(state) {
147171 var subscriber = state.subscriber, period = state.period;
147172 subscriber.notifyNext();
147173 this.schedule(state, period);
147174}
147175//# sourceMappingURL=sampleTime.js.map
147176
147177
147178/***/ }),
147179/* 964 */
147180/***/ (function(module, __webpack_exports__, __webpack_require__) {
147181
147182"use strict";
147183/* harmony export (immutable) */ __webpack_exports__["a"] = sequenceEqual;
147184/* unused harmony export SequenceEqualOperator */
147185/* unused harmony export SequenceEqualSubscriber */
147186/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
147187/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
147188/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(59);
147189/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55);
147190/** PURE_IMPORTS_START tslib,_Subscriber,_util_tryCatch,_util_errorObject PURE_IMPORTS_END */
147191
147192
147193
147194
147195function sequenceEqual(compareTo, comparor) {
147196 return function (source) { return source.lift(new SequenceEqualOperator(compareTo, comparor)); };
147197}
147198var SequenceEqualOperator = /*@__PURE__*/ (function () {
147199 function SequenceEqualOperator(compareTo, comparor) {
147200 this.compareTo = compareTo;
147201 this.comparor = comparor;
147202 }
147203 SequenceEqualOperator.prototype.call = function (subscriber, source) {
147204 return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparor));
147205 };
147206 return SequenceEqualOperator;
147207}());
147208
147209var SequenceEqualSubscriber = /*@__PURE__*/ (function (_super) {
147210 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SequenceEqualSubscriber, _super);
147211 function SequenceEqualSubscriber(destination, compareTo, comparor) {
147212 var _this = _super.call(this, destination) || this;
147213 _this.compareTo = compareTo;
147214 _this.comparor = comparor;
147215 _this._a = [];
147216 _this._b = [];
147217 _this._oneComplete = false;
147218 _this.destination.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, _this)));
147219 return _this;
147220 }
147221 SequenceEqualSubscriber.prototype._next = function (value) {
147222 if (this._oneComplete && this._b.length === 0) {
147223 this.emit(false);
147224 }
147225 else {
147226 this._a.push(value);
147227 this.checkValues();
147228 }
147229 };
147230 SequenceEqualSubscriber.prototype._complete = function () {
147231 if (this._oneComplete) {
147232 this.emit(this._a.length === 0 && this._b.length === 0);
147233 }
147234 else {
147235 this._oneComplete = true;
147236 }
147237 this.unsubscribe();
147238 };
147239 SequenceEqualSubscriber.prototype.checkValues = function () {
147240 var _c = this, _a = _c._a, _b = _c._b, comparor = _c.comparor;
147241 while (_a.length > 0 && _b.length > 0) {
147242 var a = _a.shift();
147243 var b = _b.shift();
147244 var areEqual = false;
147245 if (comparor) {
147246 areEqual = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(comparor)(a, b);
147247 if (areEqual === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
147248 this.destination.error(__WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e);
147249 }
147250 }
147251 else {
147252 areEqual = a === b;
147253 }
147254 if (!areEqual) {
147255 this.emit(false);
147256 }
147257 }
147258 };
147259 SequenceEqualSubscriber.prototype.emit = function (value) {
147260 var destination = this.destination;
147261 destination.next(value);
147262 destination.complete();
147263 };
147264 SequenceEqualSubscriber.prototype.nextB = function (value) {
147265 if (this._oneComplete && this._a.length === 0) {
147266 this.emit(false);
147267 }
147268 else {
147269 this._b.push(value);
147270 this.checkValues();
147271 }
147272 };
147273 SequenceEqualSubscriber.prototype.completeB = function () {
147274 if (this._oneComplete) {
147275 this.emit(this._a.length === 0 && this._b.length === 0);
147276 }
147277 else {
147278 this._oneComplete = true;
147279 }
147280 };
147281 return SequenceEqualSubscriber;
147282}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
147283
147284var SequenceEqualCompareToSubscriber = /*@__PURE__*/ (function (_super) {
147285 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SequenceEqualCompareToSubscriber, _super);
147286 function SequenceEqualCompareToSubscriber(destination, parent) {
147287 var _this = _super.call(this, destination) || this;
147288 _this.parent = parent;
147289 return _this;
147290 }
147291 SequenceEqualCompareToSubscriber.prototype._next = function (value) {
147292 this.parent.nextB(value);
147293 };
147294 SequenceEqualCompareToSubscriber.prototype._error = function (err) {
147295 this.parent.error(err);
147296 this.unsubscribe();
147297 };
147298 SequenceEqualCompareToSubscriber.prototype._complete = function () {
147299 this.parent.completeB();
147300 this.unsubscribe();
147301 };
147302 return SequenceEqualCompareToSubscriber;
147303}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
147304//# sourceMappingURL=sequenceEqual.js.map
147305
147306
147307/***/ }),
147308/* 965 */
147309/***/ (function(module, __webpack_exports__, __webpack_require__) {
147310
147311"use strict";
147312/* harmony export (immutable) */ __webpack_exports__["a"] = share;
147313/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__multicast__ = __webpack_require__(111);
147314/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__refCount__ = __webpack_require__(256);
147315/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subject__ = __webpack_require__(43);
147316/** PURE_IMPORTS_START _multicast,_refCount,_Subject PURE_IMPORTS_END */
147317
147318
147319
147320function shareSubjectFactory() {
147321 return new __WEBPACK_IMPORTED_MODULE_2__Subject__["a" /* Subject */]();
147322}
147323function share() {
147324 return function (source) { return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__refCount__["a" /* refCount */])()(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__multicast__["a" /* multicast */])(shareSubjectFactory)(source)); };
147325}
147326//# sourceMappingURL=share.js.map
147327
147328
147329/***/ }),
147330/* 966 */
147331/***/ (function(module, __webpack_exports__, __webpack_require__) {
147332
147333"use strict";
147334/* harmony export (immutable) */ __webpack_exports__["a"] = shareReplay;
147335/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__ = __webpack_require__(248);
147336/** PURE_IMPORTS_START _ReplaySubject PURE_IMPORTS_END */
147337
147338function shareReplay(bufferSize, windowTime, scheduler) {
147339 if (bufferSize === void 0) {
147340 bufferSize = Number.POSITIVE_INFINITY;
147341 }
147342 if (windowTime === void 0) {
147343 windowTime = Number.POSITIVE_INFINITY;
147344 }
147345 return function (source) { return source.lift(shareReplayOperator(bufferSize, windowTime, scheduler)); };
147346}
147347function shareReplayOperator(bufferSize, windowTime, scheduler) {
147348 var subject;
147349 var refCount = 0;
147350 var subscription;
147351 var hasError = false;
147352 var isComplete = false;
147353 return function shareReplayOperation(source) {
147354 refCount++;
147355 if (!subject || hasError) {
147356 hasError = false;
147357 subject = new __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__["a" /* ReplaySubject */](bufferSize, windowTime, scheduler);
147358 subscription = source.subscribe({
147359 next: function (value) { subject.next(value); },
147360 error: function (err) {
147361 hasError = true;
147362 subject.error(err);
147363 },
147364 complete: function () {
147365 isComplete = true;
147366 subject.complete();
147367 },
147368 });
147369 }
147370 var innerSub = subject.subscribe(this);
147371 return function () {
147372 refCount--;
147373 innerSub.unsubscribe();
147374 if (subscription && refCount === 0 && isComplete) {
147375 subscription.unsubscribe();
147376 }
147377 };
147378 };
147379}
147380//# sourceMappingURL=shareReplay.js.map
147381
147382
147383/***/ }),
147384/* 967 */
147385/***/ (function(module, __webpack_exports__, __webpack_require__) {
147386
147387"use strict";
147388/* harmony export (immutable) */ __webpack_exports__["a"] = single;
147389/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
147390/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
147391/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_EmptyError__ = __webpack_require__(141);
147392/** PURE_IMPORTS_START tslib,_Subscriber,_util_EmptyError PURE_IMPORTS_END */
147393
147394
147395
147396function single(predicate) {
147397 return function (source) { return source.lift(new SingleOperator(predicate, source)); };
147398}
147399var SingleOperator = /*@__PURE__*/ (function () {
147400 function SingleOperator(predicate, source) {
147401 this.predicate = predicate;
147402 this.source = source;
147403 }
147404 SingleOperator.prototype.call = function (subscriber, source) {
147405 return source.subscribe(new SingleSubscriber(subscriber, this.predicate, this.source));
147406 };
147407 return SingleOperator;
147408}());
147409var SingleSubscriber = /*@__PURE__*/ (function (_super) {
147410 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SingleSubscriber, _super);
147411 function SingleSubscriber(destination, predicate, source) {
147412 var _this = _super.call(this, destination) || this;
147413 _this.predicate = predicate;
147414 _this.source = source;
147415 _this.seenValue = false;
147416 _this.index = 0;
147417 return _this;
147418 }
147419 SingleSubscriber.prototype.applySingleValue = function (value) {
147420 if (this.seenValue) {
147421 this.destination.error('Sequence contains more than one element');
147422 }
147423 else {
147424 this.seenValue = true;
147425 this.singleValue = value;
147426 }
147427 };
147428 SingleSubscriber.prototype._next = function (value) {
147429 var index = this.index++;
147430 if (this.predicate) {
147431 this.tryNext(value, index);
147432 }
147433 else {
147434 this.applySingleValue(value);
147435 }
147436 };
147437 SingleSubscriber.prototype.tryNext = function (value, index) {
147438 try {
147439 if (this.predicate(value, index, this.source)) {
147440 this.applySingleValue(value);
147441 }
147442 }
147443 catch (err) {
147444 this.destination.error(err);
147445 }
147446 };
147447 SingleSubscriber.prototype._complete = function () {
147448 var destination = this.destination;
147449 if (this.index > 0) {
147450 destination.next(this.seenValue ? this.singleValue : undefined);
147451 destination.complete();
147452 }
147453 else {
147454 destination.error(new __WEBPACK_IMPORTED_MODULE_2__util_EmptyError__["a" /* EmptyError */]);
147455 }
147456 };
147457 return SingleSubscriber;
147458}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
147459//# sourceMappingURL=single.js.map
147460
147461
147462/***/ }),
147463/* 968 */
147464/***/ (function(module, __webpack_exports__, __webpack_require__) {
147465
147466"use strict";
147467/* harmony export (immutable) */ __webpack_exports__["a"] = skip;
147468/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
147469/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
147470/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
147471
147472
147473function skip(count) {
147474 return function (source) { return source.lift(new SkipOperator(count)); };
147475}
147476var SkipOperator = /*@__PURE__*/ (function () {
147477 function SkipOperator(total) {
147478 this.total = total;
147479 }
147480 SkipOperator.prototype.call = function (subscriber, source) {
147481 return source.subscribe(new SkipSubscriber(subscriber, this.total));
147482 };
147483 return SkipOperator;
147484}());
147485var SkipSubscriber = /*@__PURE__*/ (function (_super) {
147486 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SkipSubscriber, _super);
147487 function SkipSubscriber(destination, total) {
147488 var _this = _super.call(this, destination) || this;
147489 _this.total = total;
147490 _this.count = 0;
147491 return _this;
147492 }
147493 SkipSubscriber.prototype._next = function (x) {
147494 if (++this.count > this.total) {
147495 this.destination.next(x);
147496 }
147497 };
147498 return SkipSubscriber;
147499}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
147500//# sourceMappingURL=skip.js.map
147501
147502
147503/***/ }),
147504/* 969 */
147505/***/ (function(module, __webpack_exports__, __webpack_require__) {
147506
147507"use strict";
147508/* harmony export (immutable) */ __webpack_exports__["a"] = skipLast;
147509/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
147510/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
147511/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__ = __webpack_require__(140);
147512/** PURE_IMPORTS_START tslib,_Subscriber,_util_ArgumentOutOfRangeError PURE_IMPORTS_END */
147513
147514
147515
147516function skipLast(count) {
147517 return function (source) { return source.lift(new SkipLastOperator(count)); };
147518}
147519var SkipLastOperator = /*@__PURE__*/ (function () {
147520 function SkipLastOperator(_skipCount) {
147521 this._skipCount = _skipCount;
147522 if (this._skipCount < 0) {
147523 throw new __WEBPACK_IMPORTED_MODULE_2__util_ArgumentOutOfRangeError__["a" /* ArgumentOutOfRangeError */];
147524 }
147525 }
147526 SkipLastOperator.prototype.call = function (subscriber, source) {
147527 if (this._skipCount === 0) {
147528 return source.subscribe(new __WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */](subscriber));
147529 }
147530 else {
147531 return source.subscribe(new SkipLastSubscriber(subscriber, this._skipCount));
147532 }
147533 };
147534 return SkipLastOperator;
147535}());
147536var SkipLastSubscriber = /*@__PURE__*/ (function (_super) {
147537 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SkipLastSubscriber, _super);
147538 function SkipLastSubscriber(destination, _skipCount) {
147539 var _this = _super.call(this, destination) || this;
147540 _this._skipCount = _skipCount;
147541 _this._count = 0;
147542 _this._ring = new Array(_skipCount);
147543 return _this;
147544 }
147545 SkipLastSubscriber.prototype._next = function (value) {
147546 var skipCount = this._skipCount;
147547 var count = this._count++;
147548 if (count < skipCount) {
147549 this._ring[count] = value;
147550 }
147551 else {
147552 var currentIndex = count % skipCount;
147553 var ring = this._ring;
147554 var oldValue = ring[currentIndex];
147555 ring[currentIndex] = value;
147556 this.destination.next(oldValue);
147557 }
147558 };
147559 return SkipLastSubscriber;
147560}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
147561//# sourceMappingURL=skipLast.js.map
147562
147563
147564/***/ }),
147565/* 970 */
147566/***/ (function(module, __webpack_exports__, __webpack_require__) {
147567
147568"use strict";
147569/* harmony export (immutable) */ __webpack_exports__["a"] = skipUntil;
147570/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
147571/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
147572/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__ = __webpack_require__(80);
147573/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19);
147574/** PURE_IMPORTS_START tslib,_OuterSubscriber,_InnerSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
147575
147576
147577
147578
147579function skipUntil(notifier) {
147580 return function (source) { return source.lift(new SkipUntilOperator(notifier)); };
147581}
147582var SkipUntilOperator = /*@__PURE__*/ (function () {
147583 function SkipUntilOperator(notifier) {
147584 this.notifier = notifier;
147585 }
147586 SkipUntilOperator.prototype.call = function (destination, source) {
147587 return source.subscribe(new SkipUntilSubscriber(destination, this.notifier));
147588 };
147589 return SkipUntilOperator;
147590}());
147591var SkipUntilSubscriber = /*@__PURE__*/ (function (_super) {
147592 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SkipUntilSubscriber, _super);
147593 function SkipUntilSubscriber(destination, notifier) {
147594 var _this = _super.call(this, destination) || this;
147595 _this.hasValue = false;
147596 var innerSubscriber = new __WEBPACK_IMPORTED_MODULE_2__InnerSubscriber__["a" /* InnerSubscriber */](_this, undefined, undefined);
147597 _this.add(innerSubscriber);
147598 _this.innerSubscription = innerSubscriber;
147599 __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(_this, notifier, undefined, undefined, innerSubscriber);
147600 return _this;
147601 }
147602 SkipUntilSubscriber.prototype._next = function (value) {
147603 if (this.hasValue) {
147604 _super.prototype._next.call(this, value);
147605 }
147606 };
147607 SkipUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
147608 this.hasValue = true;
147609 if (this.innerSubscription) {
147610 this.innerSubscription.unsubscribe();
147611 }
147612 };
147613 SkipUntilSubscriber.prototype.notifyComplete = function () {
147614 };
147615 return SkipUntilSubscriber;
147616}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
147617//# sourceMappingURL=skipUntil.js.map
147618
147619
147620/***/ }),
147621/* 971 */
147622/***/ (function(module, __webpack_exports__, __webpack_require__) {
147623
147624"use strict";
147625/* harmony export (immutable) */ __webpack_exports__["a"] = skipWhile;
147626/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
147627/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
147628/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
147629
147630
147631function skipWhile(predicate) {
147632 return function (source) { return source.lift(new SkipWhileOperator(predicate)); };
147633}
147634var SkipWhileOperator = /*@__PURE__*/ (function () {
147635 function SkipWhileOperator(predicate) {
147636 this.predicate = predicate;
147637 }
147638 SkipWhileOperator.prototype.call = function (subscriber, source) {
147639 return source.subscribe(new SkipWhileSubscriber(subscriber, this.predicate));
147640 };
147641 return SkipWhileOperator;
147642}());
147643var SkipWhileSubscriber = /*@__PURE__*/ (function (_super) {
147644 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SkipWhileSubscriber, _super);
147645 function SkipWhileSubscriber(destination, predicate) {
147646 var _this = _super.call(this, destination) || this;
147647 _this.predicate = predicate;
147648 _this.skipping = true;
147649 _this.index = 0;
147650 return _this;
147651 }
147652 SkipWhileSubscriber.prototype._next = function (value) {
147653 var destination = this.destination;
147654 if (this.skipping) {
147655 this.tryCallPredicate(value);
147656 }
147657 if (!this.skipping) {
147658 destination.next(value);
147659 }
147660 };
147661 SkipWhileSubscriber.prototype.tryCallPredicate = function (value) {
147662 try {
147663 var result = this.predicate(value, this.index++);
147664 this.skipping = Boolean(result);
147665 }
147666 catch (err) {
147667 this.destination.error(err);
147668 }
147669 };
147670 return SkipWhileSubscriber;
147671}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
147672//# sourceMappingURL=skipWhile.js.map
147673
147674
147675/***/ }),
147676/* 972 */
147677/***/ (function(module, __webpack_exports__, __webpack_require__) {
147678
147679"use strict";
147680/* harmony export (immutable) */ __webpack_exports__["a"] = startWith;
147681/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_fromArray__ = __webpack_require__(81);
147682/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__observable_scalar__ = __webpack_require__(252);
147683/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_empty__ = __webpack_require__(46);
147684/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_concat__ = __webpack_require__(177);
147685/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isScheduler__ = __webpack_require__(56);
147686/** PURE_IMPORTS_START _observable_fromArray,_observable_scalar,_observable_empty,_observable_concat,_util_isScheduler PURE_IMPORTS_END */
147687
147688
147689
147690
147691
147692function startWith() {
147693 var array = [];
147694 for (var _i = 0; _i < arguments.length; _i++) {
147695 array[_i] = arguments[_i];
147696 }
147697 return function (source) {
147698 var scheduler = array[array.length - 1];
147699 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isScheduler__["a" /* isScheduler */])(scheduler)) {
147700 array.pop();
147701 }
147702 else {
147703 scheduler = null;
147704 }
147705 var len = array.length;
147706 if (len === 1 && !scheduler) {
147707 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__observable_scalar__["a" /* scalar */])(array[0]), source);
147708 }
147709 else if (len > 0) {
147710 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__observable_fromArray__["a" /* fromArray */])(array, scheduler), source);
147711 }
147712 else {
147713 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_concat__["a" /* concat */])(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_empty__["a" /* empty */])(scheduler), source);
147714 }
147715 };
147716}
147717//# sourceMappingURL=startWith.js.map
147718
147719
147720/***/ }),
147721/* 973 */
147722/***/ (function(module, __webpack_exports__, __webpack_require__) {
147723
147724"use strict";
147725/* harmony export (immutable) */ __webpack_exports__["a"] = subscribeOn;
147726/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_SubscribeOnObservable__ = __webpack_require__(895);
147727/** PURE_IMPORTS_START _observable_SubscribeOnObservable PURE_IMPORTS_END */
147728
147729function subscribeOn(scheduler, delay) {
147730 if (delay === void 0) {
147731 delay = 0;
147732 }
147733 return function subscribeOnOperatorFunction(source) {
147734 return source.lift(new SubscribeOnOperator(scheduler, delay));
147735 };
147736}
147737var SubscribeOnOperator = /*@__PURE__*/ (function () {
147738 function SubscribeOnOperator(scheduler, delay) {
147739 this.scheduler = scheduler;
147740 this.delay = delay;
147741 }
147742 SubscribeOnOperator.prototype.call = function (subscriber, source) {
147743 return new __WEBPACK_IMPORTED_MODULE_0__observable_SubscribeOnObservable__["a" /* SubscribeOnObservable */](source, this.delay, this.scheduler).subscribe(subscriber);
147744 };
147745 return SubscribeOnOperator;
147746}());
147747//# sourceMappingURL=subscribeOn.js.map
147748
147749
147750/***/ }),
147751/* 974 */
147752/***/ (function(module, __webpack_exports__, __webpack_require__) {
147753
147754"use strict";
147755/* harmony export (immutable) */ __webpack_exports__["a"] = switchAll;
147756/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__switchMap__ = __webpack_require__(258);
147757/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_identity__ = __webpack_require__(113);
147758/** PURE_IMPORTS_START _switchMap,_util_identity PURE_IMPORTS_END */
147759
147760
147761function switchAll() {
147762 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__switchMap__["a" /* switchMap */])(__WEBPACK_IMPORTED_MODULE_1__util_identity__["a" /* identity */]);
147763}
147764//# sourceMappingURL=switchAll.js.map
147765
147766
147767/***/ }),
147768/* 975 */
147769/***/ (function(module, __webpack_exports__, __webpack_require__) {
147770
147771"use strict";
147772/* harmony export (immutable) */ __webpack_exports__["a"] = switchMapTo;
147773/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__switchMap__ = __webpack_require__(258);
147774/** PURE_IMPORTS_START _switchMap PURE_IMPORTS_END */
147775
147776function switchMapTo(innerObservable, resultSelector) {
147777 return resultSelector ? __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__switchMap__["a" /* switchMap */])(function () { return innerObservable; }, resultSelector) : __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__switchMap__["a" /* switchMap */])(function () { return innerObservable; });
147778}
147779//# sourceMappingURL=switchMapTo.js.map
147780
147781
147782/***/ }),
147783/* 976 */
147784/***/ (function(module, __webpack_exports__, __webpack_require__) {
147785
147786"use strict";
147787/* harmony export (immutable) */ __webpack_exports__["a"] = takeUntil;
147788/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
147789/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
147790/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
147791/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
147792
147793
147794
147795function takeUntil(notifier) {
147796 return function (source) { return source.lift(new TakeUntilOperator(notifier)); };
147797}
147798var TakeUntilOperator = /*@__PURE__*/ (function () {
147799 function TakeUntilOperator(notifier) {
147800 this.notifier = notifier;
147801 }
147802 TakeUntilOperator.prototype.call = function (subscriber, source) {
147803 var takeUntilSubscriber = new TakeUntilSubscriber(subscriber);
147804 var notifierSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(takeUntilSubscriber, this.notifier);
147805 if (notifierSubscription && !takeUntilSubscriber.seenValue) {
147806 takeUntilSubscriber.add(notifierSubscription);
147807 return source.subscribe(takeUntilSubscriber);
147808 }
147809 return takeUntilSubscriber;
147810 };
147811 return TakeUntilOperator;
147812}());
147813var TakeUntilSubscriber = /*@__PURE__*/ (function (_super) {
147814 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TakeUntilSubscriber, _super);
147815 function TakeUntilSubscriber(destination) {
147816 var _this = _super.call(this, destination) || this;
147817 _this.seenValue = false;
147818 return _this;
147819 }
147820 TakeUntilSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
147821 this.seenValue = true;
147822 this.complete();
147823 };
147824 TakeUntilSubscriber.prototype.notifyComplete = function () {
147825 };
147826 return TakeUntilSubscriber;
147827}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
147828//# sourceMappingURL=takeUntil.js.map
147829
147830
147831/***/ }),
147832/* 977 */
147833/***/ (function(module, __webpack_exports__, __webpack_require__) {
147834
147835"use strict";
147836/* harmony export (immutable) */ __webpack_exports__["a"] = takeWhile;
147837/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
147838/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
147839/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
147840
147841
147842function takeWhile(predicate) {
147843 return function (source) { return source.lift(new TakeWhileOperator(predicate)); };
147844}
147845var TakeWhileOperator = /*@__PURE__*/ (function () {
147846 function TakeWhileOperator(predicate) {
147847 this.predicate = predicate;
147848 }
147849 TakeWhileOperator.prototype.call = function (subscriber, source) {
147850 return source.subscribe(new TakeWhileSubscriber(subscriber, this.predicate));
147851 };
147852 return TakeWhileOperator;
147853}());
147854var TakeWhileSubscriber = /*@__PURE__*/ (function (_super) {
147855 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](TakeWhileSubscriber, _super);
147856 function TakeWhileSubscriber(destination, predicate) {
147857 var _this = _super.call(this, destination) || this;
147858 _this.predicate = predicate;
147859 _this.index = 0;
147860 return _this;
147861 }
147862 TakeWhileSubscriber.prototype._next = function (value) {
147863 var destination = this.destination;
147864 var result;
147865 try {
147866 result = this.predicate(value, this.index++);
147867 }
147868 catch (err) {
147869 destination.error(err);
147870 return;
147871 }
147872 this.nextOrComplete(value, result);
147873 };
147874 TakeWhileSubscriber.prototype.nextOrComplete = function (value, predicateResult) {
147875 var destination = this.destination;
147876 if (Boolean(predicateResult)) {
147877 destination.next(value);
147878 }
147879 else {
147880 destination.complete();
147881 }
147882 };
147883 return TakeWhileSubscriber;
147884}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
147885//# sourceMappingURL=takeWhile.js.map
147886
147887
147888/***/ }),
147889/* 978 */
147890/***/ (function(module, __webpack_exports__, __webpack_require__) {
147891
147892"use strict";
147893/* harmony export (immutable) */ __webpack_exports__["a"] = throttleTime;
147894/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
147895/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
147896/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_async__ = __webpack_require__(47);
147897/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__throttle__ = __webpack_require__(406);
147898/** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async,_throttle PURE_IMPORTS_END */
147899
147900
147901
147902
147903function throttleTime(duration, scheduler, config) {
147904 if (scheduler === void 0) {
147905 scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_async__["a" /* async */];
147906 }
147907 if (config === void 0) {
147908 config = __WEBPACK_IMPORTED_MODULE_3__throttle__["b" /* defaultThrottleConfig */];
147909 }
147910 return function (source) { return source.lift(new ThrottleTimeOperator(duration, scheduler, config.leading, config.trailing)); };
147911}
147912var ThrottleTimeOperator = /*@__PURE__*/ (function () {
147913 function ThrottleTimeOperator(duration, scheduler, leading, trailing) {
147914 this.duration = duration;
147915 this.scheduler = scheduler;
147916 this.leading = leading;
147917 this.trailing = trailing;
147918 }
147919 ThrottleTimeOperator.prototype.call = function (subscriber, source) {
147920 return source.subscribe(new ThrottleTimeSubscriber(subscriber, this.duration, this.scheduler, this.leading, this.trailing));
147921 };
147922 return ThrottleTimeOperator;
147923}());
147924var ThrottleTimeSubscriber = /*@__PURE__*/ (function (_super) {
147925 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](ThrottleTimeSubscriber, _super);
147926 function ThrottleTimeSubscriber(destination, duration, scheduler, leading, trailing) {
147927 var _this = _super.call(this, destination) || this;
147928 _this.duration = duration;
147929 _this.scheduler = scheduler;
147930 _this.leading = leading;
147931 _this.trailing = trailing;
147932 _this._hasTrailingValue = false;
147933 _this._trailingValue = null;
147934 return _this;
147935 }
147936 ThrottleTimeSubscriber.prototype._next = function (value) {
147937 if (this.throttled) {
147938 if (this.trailing) {
147939 this._trailingValue = value;
147940 this._hasTrailingValue = true;
147941 }
147942 }
147943 else {
147944 this.add(this.throttled = this.scheduler.schedule(dispatchNext, this.duration, { subscriber: this }));
147945 if (this.leading) {
147946 this.destination.next(value);
147947 }
147948 }
147949 };
147950 ThrottleTimeSubscriber.prototype._complete = function () {
147951 if (this._hasTrailingValue) {
147952 this.destination.next(this._trailingValue);
147953 this.destination.complete();
147954 }
147955 else {
147956 this.destination.complete();
147957 }
147958 };
147959 ThrottleTimeSubscriber.prototype.clearThrottle = function () {
147960 var throttled = this.throttled;
147961 if (throttled) {
147962 if (this.trailing && this._hasTrailingValue) {
147963 this.destination.next(this._trailingValue);
147964 this._trailingValue = null;
147965 this._hasTrailingValue = false;
147966 }
147967 throttled.unsubscribe();
147968 this.remove(throttled);
147969 this.throttled = null;
147970 }
147971 };
147972 return ThrottleTimeSubscriber;
147973}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
147974function dispatchNext(arg) {
147975 var subscriber = arg.subscriber;
147976 subscriber.clearThrottle();
147977}
147978//# sourceMappingURL=throttleTime.js.map
147979
147980
147981/***/ }),
147982/* 979 */
147983/***/ (function(module, __webpack_exports__, __webpack_require__) {
147984
147985"use strict";
147986/* harmony export (immutable) */ __webpack_exports__["a"] = timeInterval;
147987/* unused harmony export TimeInterval */
147988/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scheduler_async__ = __webpack_require__(47);
147989/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scan__ = __webpack_require__(257);
147990/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__observable_defer__ = __webpack_require__(250);
147991/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__map__ = __webpack_require__(54);
147992/** PURE_IMPORTS_START _scheduler_async,_scan,_observable_defer,_map PURE_IMPORTS_END */
147993
147994
147995
147996
147997function timeInterval(scheduler) {
147998 if (scheduler === void 0) {
147999 scheduler = __WEBPACK_IMPORTED_MODULE_0__scheduler_async__["a" /* async */];
148000 }
148001 return function (source) {
148002 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__observable_defer__["a" /* defer */])(function () {
148003 return source.pipe(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__scan__["a" /* scan */])(function (_a, value) {
148004 var current = _a.current;
148005 return ({ value: value, current: scheduler.now(), last: current });
148006 }, { current: scheduler.now(), value: undefined, last: undefined }), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__map__["a" /* map */])(function (_a) {
148007 var current = _a.current, last = _a.last, value = _a.value;
148008 return new TimeInterval(value, current - last);
148009 }));
148010 });
148011 };
148012}
148013var TimeInterval = /*@__PURE__*/ (function () {
148014 function TimeInterval(value, interval) {
148015 this.value = value;
148016 this.interval = interval;
148017 }
148018 return TimeInterval;
148019}());
148020
148021//# sourceMappingURL=timeInterval.js.map
148022
148023
148024/***/ }),
148025/* 980 */
148026/***/ (function(module, __webpack_exports__, __webpack_require__) {
148027
148028"use strict";
148029/* harmony export (immutable) */ __webpack_exports__["a"] = timeout;
148030/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scheduler_async__ = __webpack_require__(47);
148031/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_TimeoutError__ = __webpack_require__(410);
148032/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__timeoutWith__ = __webpack_require__(407);
148033/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__observable_throwError__ = __webpack_require__(253);
148034/** PURE_IMPORTS_START _scheduler_async,_util_TimeoutError,_timeoutWith,_observable_throwError PURE_IMPORTS_END */
148035
148036
148037
148038
148039function timeout(due, scheduler) {
148040 if (scheduler === void 0) {
148041 scheduler = __WEBPACK_IMPORTED_MODULE_0__scheduler_async__["a" /* async */];
148042 }
148043 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__timeoutWith__["a" /* timeoutWith */])(due, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__observable_throwError__["a" /* throwError */])(new __WEBPACK_IMPORTED_MODULE_1__util_TimeoutError__["a" /* TimeoutError */]()), scheduler);
148044}
148045//# sourceMappingURL=timeout.js.map
148046
148047
148048/***/ }),
148049/* 981 */
148050/***/ (function(module, __webpack_exports__, __webpack_require__) {
148051
148052"use strict";
148053/* harmony export (immutable) */ __webpack_exports__["a"] = timestamp;
148054/* unused harmony export Timestamp */
148055/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__scheduler_async__ = __webpack_require__(47);
148056/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__map__ = __webpack_require__(54);
148057/** PURE_IMPORTS_START _scheduler_async,_map PURE_IMPORTS_END */
148058
148059
148060function timestamp(scheduler) {
148061 if (scheduler === void 0) {
148062 scheduler = __WEBPACK_IMPORTED_MODULE_0__scheduler_async__["a" /* async */];
148063 }
148064 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__map__["a" /* map */])(function (value) { return new Timestamp(value, scheduler.now()); });
148065}
148066var Timestamp = /*@__PURE__*/ (function () {
148067 function Timestamp(value, timestamp) {
148068 this.value = value;
148069 this.timestamp = timestamp;
148070 }
148071 return Timestamp;
148072}());
148073
148074//# sourceMappingURL=timestamp.js.map
148075
148076
148077/***/ }),
148078/* 982 */
148079/***/ (function(module, __webpack_exports__, __webpack_require__) {
148080
148081"use strict";
148082/* harmony export (immutable) */ __webpack_exports__["a"] = toArray;
148083/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__reduce__ = __webpack_require__(178);
148084/** PURE_IMPORTS_START _reduce PURE_IMPORTS_END */
148085
148086function toArrayReducer(arr, item, index) {
148087 if (index === 0) {
148088 return [item];
148089 }
148090 arr.push(item);
148091 return arr;
148092}
148093function toArray() {
148094 return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__reduce__["a" /* reduce */])(toArrayReducer, []);
148095}
148096//# sourceMappingURL=toArray.js.map
148097
148098
148099/***/ }),
148100/* 983 */
148101/***/ (function(module, __webpack_exports__, __webpack_require__) {
148102
148103"use strict";
148104/* harmony export (immutable) */ __webpack_exports__["a"] = window;
148105/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
148106/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
148107/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__ = __webpack_require__(18);
148108/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__ = __webpack_require__(19);
148109/** PURE_IMPORTS_START tslib,_Subject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
148110
148111
148112
148113
148114function window(windowBoundaries) {
148115 return function windowOperatorFunction(source) {
148116 return source.lift(new WindowOperator(windowBoundaries));
148117 };
148118}
148119var WindowOperator = /*@__PURE__*/ (function () {
148120 function WindowOperator(windowBoundaries) {
148121 this.windowBoundaries = windowBoundaries;
148122 }
148123 WindowOperator.prototype.call = function (subscriber, source) {
148124 var windowSubscriber = new WindowSubscriber(subscriber);
148125 var sourceSubscription = source.subscribe(windowSubscriber);
148126 if (!sourceSubscription.closed) {
148127 windowSubscriber.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_subscribeToResult__["a" /* subscribeToResult */])(windowSubscriber, this.windowBoundaries));
148128 }
148129 return sourceSubscription;
148130 };
148131 return WindowOperator;
148132}());
148133var WindowSubscriber = /*@__PURE__*/ (function (_super) {
148134 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WindowSubscriber, _super);
148135 function WindowSubscriber(destination) {
148136 var _this = _super.call(this, destination) || this;
148137 _this.window = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]();
148138 destination.next(_this.window);
148139 return _this;
148140 }
148141 WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
148142 this.openWindow();
148143 };
148144 WindowSubscriber.prototype.notifyError = function (error, innerSub) {
148145 this._error(error);
148146 };
148147 WindowSubscriber.prototype.notifyComplete = function (innerSub) {
148148 this._complete();
148149 };
148150 WindowSubscriber.prototype._next = function (value) {
148151 this.window.next(value);
148152 };
148153 WindowSubscriber.prototype._error = function (err) {
148154 this.window.error(err);
148155 this.destination.error(err);
148156 };
148157 WindowSubscriber.prototype._complete = function () {
148158 this.window.complete();
148159 this.destination.complete();
148160 };
148161 WindowSubscriber.prototype._unsubscribe = function () {
148162 this.window = null;
148163 };
148164 WindowSubscriber.prototype.openWindow = function () {
148165 var prevWindow = this.window;
148166 if (prevWindow) {
148167 prevWindow.complete();
148168 }
148169 var destination = this.destination;
148170 var newWindow = this.window = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]();
148171 destination.next(newWindow);
148172 };
148173 return WindowSubscriber;
148174}(__WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__["a" /* OuterSubscriber */]));
148175//# sourceMappingURL=window.js.map
148176
148177
148178/***/ }),
148179/* 984 */
148180/***/ (function(module, __webpack_exports__, __webpack_require__) {
148181
148182"use strict";
148183/* harmony export (immutable) */ __webpack_exports__["a"] = windowCount;
148184/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
148185/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(5);
148186/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subject__ = __webpack_require__(43);
148187/** PURE_IMPORTS_START tslib,_Subscriber,_Subject PURE_IMPORTS_END */
148188
148189
148190
148191function windowCount(windowSize, startWindowEvery) {
148192 if (startWindowEvery === void 0) {
148193 startWindowEvery = 0;
148194 }
148195 return function windowCountOperatorFunction(source) {
148196 return source.lift(new WindowCountOperator(windowSize, startWindowEvery));
148197 };
148198}
148199var WindowCountOperator = /*@__PURE__*/ (function () {
148200 function WindowCountOperator(windowSize, startWindowEvery) {
148201 this.windowSize = windowSize;
148202 this.startWindowEvery = startWindowEvery;
148203 }
148204 WindowCountOperator.prototype.call = function (subscriber, source) {
148205 return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));
148206 };
148207 return WindowCountOperator;
148208}());
148209var WindowCountSubscriber = /*@__PURE__*/ (function (_super) {
148210 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WindowCountSubscriber, _super);
148211 function WindowCountSubscriber(destination, windowSize, startWindowEvery) {
148212 var _this = _super.call(this, destination) || this;
148213 _this.destination = destination;
148214 _this.windowSize = windowSize;
148215 _this.startWindowEvery = startWindowEvery;
148216 _this.windows = [new __WEBPACK_IMPORTED_MODULE_2__Subject__["a" /* Subject */]()];
148217 _this.count = 0;
148218 destination.next(_this.windows[0]);
148219 return _this;
148220 }
148221 WindowCountSubscriber.prototype._next = function (value) {
148222 var startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;
148223 var destination = this.destination;
148224 var windowSize = this.windowSize;
148225 var windows = this.windows;
148226 var len = windows.length;
148227 for (var i = 0; i < len && !this.closed; i++) {
148228 windows[i].next(value);
148229 }
148230 var c = this.count - windowSize + 1;
148231 if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {
148232 windows.shift().complete();
148233 }
148234 if (++this.count % startWindowEvery === 0 && !this.closed) {
148235 var window_1 = new __WEBPACK_IMPORTED_MODULE_2__Subject__["a" /* Subject */]();
148236 windows.push(window_1);
148237 destination.next(window_1);
148238 }
148239 };
148240 WindowCountSubscriber.prototype._error = function (err) {
148241 var windows = this.windows;
148242 if (windows) {
148243 while (windows.length > 0 && !this.closed) {
148244 windows.shift().error(err);
148245 }
148246 }
148247 this.destination.error(err);
148248 };
148249 WindowCountSubscriber.prototype._complete = function () {
148250 var windows = this.windows;
148251 if (windows) {
148252 while (windows.length > 0 && !this.closed) {
148253 windows.shift().complete();
148254 }
148255 }
148256 this.destination.complete();
148257 };
148258 WindowCountSubscriber.prototype._unsubscribe = function () {
148259 this.count = 0;
148260 this.windows = null;
148261 };
148262 return WindowCountSubscriber;
148263}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
148264//# sourceMappingURL=windowCount.js.map
148265
148266
148267/***/ }),
148268/* 985 */
148269/***/ (function(module, __webpack_exports__, __webpack_require__) {
148270
148271"use strict";
148272/* harmony export (immutable) */ __webpack_exports__["a"] = windowTime;
148273/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
148274/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
148275/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__scheduler_async__ = __webpack_require__(47);
148276/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(5);
148277/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_isNumeric__ = __webpack_require__(181);
148278/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_isScheduler__ = __webpack_require__(56);
148279/** PURE_IMPORTS_START tslib,_Subject,_scheduler_async,_Subscriber,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */
148280
148281
148282
148283
148284
148285
148286function windowTime(windowTimeSpan) {
148287 var scheduler = __WEBPACK_IMPORTED_MODULE_2__scheduler_async__["a" /* async */];
148288 var windowCreationInterval = null;
148289 var maxWindowSize = Number.POSITIVE_INFINITY;
148290 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isScheduler__["a" /* isScheduler */])(arguments[3])) {
148291 scheduler = arguments[3];
148292 }
148293 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isScheduler__["a" /* isScheduler */])(arguments[2])) {
148294 scheduler = arguments[2];
148295 }
148296 else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isNumeric__["a" /* isNumeric */])(arguments[2])) {
148297 maxWindowSize = arguments[2];
148298 }
148299 if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_isScheduler__["a" /* isScheduler */])(arguments[1])) {
148300 scheduler = arguments[1];
148301 }
148302 else if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__util_isNumeric__["a" /* isNumeric */])(arguments[1])) {
148303 windowCreationInterval = arguments[1];
148304 }
148305 return function windowTimeOperatorFunction(source) {
148306 return source.lift(new WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler));
148307 };
148308}
148309var WindowTimeOperator = /*@__PURE__*/ (function () {
148310 function WindowTimeOperator(windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
148311 this.windowTimeSpan = windowTimeSpan;
148312 this.windowCreationInterval = windowCreationInterval;
148313 this.maxWindowSize = maxWindowSize;
148314 this.scheduler = scheduler;
148315 }
148316 WindowTimeOperator.prototype.call = function (subscriber, source) {
148317 return source.subscribe(new WindowTimeSubscriber(subscriber, this.windowTimeSpan, this.windowCreationInterval, this.maxWindowSize, this.scheduler));
148318 };
148319 return WindowTimeOperator;
148320}());
148321var CountedSubject = /*@__PURE__*/ (function (_super) {
148322 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](CountedSubject, _super);
148323 function CountedSubject() {
148324 var _this = _super !== null && _super.apply(this, arguments) || this;
148325 _this._numberOfNextedValues = 0;
148326 return _this;
148327 }
148328 CountedSubject.prototype.next = function (value) {
148329 this._numberOfNextedValues++;
148330 _super.prototype.next.call(this, value);
148331 };
148332 Object.defineProperty(CountedSubject.prototype, "numberOfNextedValues", {
148333 get: function () {
148334 return this._numberOfNextedValues;
148335 },
148336 enumerable: true,
148337 configurable: true
148338 });
148339 return CountedSubject;
148340}(__WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]));
148341var WindowTimeSubscriber = /*@__PURE__*/ (function (_super) {
148342 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WindowTimeSubscriber, _super);
148343 function WindowTimeSubscriber(destination, windowTimeSpan, windowCreationInterval, maxWindowSize, scheduler) {
148344 var _this = _super.call(this, destination) || this;
148345 _this.destination = destination;
148346 _this.windowTimeSpan = windowTimeSpan;
148347 _this.windowCreationInterval = windowCreationInterval;
148348 _this.maxWindowSize = maxWindowSize;
148349 _this.scheduler = scheduler;
148350 _this.windows = [];
148351 var window = _this.openWindow();
148352 if (windowCreationInterval !== null && windowCreationInterval >= 0) {
148353 var closeState = { subscriber: _this, window: window, context: null };
148354 var creationState = { windowTimeSpan: windowTimeSpan, windowCreationInterval: windowCreationInterval, subscriber: _this, scheduler: scheduler };
148355 _this.add(scheduler.schedule(dispatchWindowClose, windowTimeSpan, closeState));
148356 _this.add(scheduler.schedule(dispatchWindowCreation, windowCreationInterval, creationState));
148357 }
148358 else {
148359 var timeSpanOnlyState = { subscriber: _this, window: window, windowTimeSpan: windowTimeSpan };
148360 _this.add(scheduler.schedule(dispatchWindowTimeSpanOnly, windowTimeSpan, timeSpanOnlyState));
148361 }
148362 return _this;
148363 }
148364 WindowTimeSubscriber.prototype._next = function (value) {
148365 var windows = this.windows;
148366 var len = windows.length;
148367 for (var i = 0; i < len; i++) {
148368 var window_1 = windows[i];
148369 if (!window_1.closed) {
148370 window_1.next(value);
148371 if (window_1.numberOfNextedValues >= this.maxWindowSize) {
148372 this.closeWindow(window_1);
148373 }
148374 }
148375 }
148376 };
148377 WindowTimeSubscriber.prototype._error = function (err) {
148378 var windows = this.windows;
148379 while (windows.length > 0) {
148380 windows.shift().error(err);
148381 }
148382 this.destination.error(err);
148383 };
148384 WindowTimeSubscriber.prototype._complete = function () {
148385 var windows = this.windows;
148386 while (windows.length > 0) {
148387 var window_2 = windows.shift();
148388 if (!window_2.closed) {
148389 window_2.complete();
148390 }
148391 }
148392 this.destination.complete();
148393 };
148394 WindowTimeSubscriber.prototype.openWindow = function () {
148395 var window = new CountedSubject();
148396 this.windows.push(window);
148397 var destination = this.destination;
148398 destination.next(window);
148399 return window;
148400 };
148401 WindowTimeSubscriber.prototype.closeWindow = function (window) {
148402 window.complete();
148403 var windows = this.windows;
148404 windows.splice(windows.indexOf(window), 1);
148405 };
148406 return WindowTimeSubscriber;
148407}(__WEBPACK_IMPORTED_MODULE_3__Subscriber__["a" /* Subscriber */]));
148408function dispatchWindowTimeSpanOnly(state) {
148409 var subscriber = state.subscriber, windowTimeSpan = state.windowTimeSpan, window = state.window;
148410 if (window) {
148411 subscriber.closeWindow(window);
148412 }
148413 state.window = subscriber.openWindow();
148414 this.schedule(state, windowTimeSpan);
148415}
148416function dispatchWindowCreation(state) {
148417 var windowTimeSpan = state.windowTimeSpan, subscriber = state.subscriber, scheduler = state.scheduler, windowCreationInterval = state.windowCreationInterval;
148418 var window = subscriber.openWindow();
148419 var action = this;
148420 var context = { action: action, subscription: null };
148421 var timeSpanState = { subscriber: subscriber, window: window, context: context };
148422 context.subscription = scheduler.schedule(dispatchWindowClose, windowTimeSpan, timeSpanState);
148423 action.add(context.subscription);
148424 action.schedule(state, windowCreationInterval);
148425}
148426function dispatchWindowClose(state) {
148427 var subscriber = state.subscriber, window = state.window, context = state.context;
148428 if (context && context.action && context.subscription) {
148429 context.action.remove(context.subscription);
148430 }
148431 subscriber.closeWindow(window);
148432}
148433//# sourceMappingURL=windowTime.js.map
148434
148435
148436/***/ }),
148437/* 986 */
148438/***/ (function(module, __webpack_exports__, __webpack_require__) {
148439
148440"use strict";
148441/* harmony export (immutable) */ __webpack_exports__["a"] = windowToggle;
148442/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
148443/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
148444/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(31);
148445/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(59);
148446/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(55);
148447/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__OuterSubscriber__ = __webpack_require__(18);
148448/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_subscribeToResult__ = __webpack_require__(19);
148449/** PURE_IMPORTS_START tslib,_Subject,_Subscription,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
148450
148451
148452
148453
148454
148455
148456
148457function windowToggle(openings, closingSelector) {
148458 return function (source) { return source.lift(new WindowToggleOperator(openings, closingSelector)); };
148459}
148460var WindowToggleOperator = /*@__PURE__*/ (function () {
148461 function WindowToggleOperator(openings, closingSelector) {
148462 this.openings = openings;
148463 this.closingSelector = closingSelector;
148464 }
148465 WindowToggleOperator.prototype.call = function (subscriber, source) {
148466 return source.subscribe(new WindowToggleSubscriber(subscriber, this.openings, this.closingSelector));
148467 };
148468 return WindowToggleOperator;
148469}());
148470var WindowToggleSubscriber = /*@__PURE__*/ (function (_super) {
148471 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WindowToggleSubscriber, _super);
148472 function WindowToggleSubscriber(destination, openings, closingSelector) {
148473 var _this = _super.call(this, destination) || this;
148474 _this.openings = openings;
148475 _this.closingSelector = closingSelector;
148476 _this.contexts = [];
148477 _this.add(_this.openSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_subscribeToResult__["a" /* subscribeToResult */])(_this, openings, openings));
148478 return _this;
148479 }
148480 WindowToggleSubscriber.prototype._next = function (value) {
148481 var contexts = this.contexts;
148482 if (contexts) {
148483 var len = contexts.length;
148484 for (var i = 0; i < len; i++) {
148485 contexts[i].window.next(value);
148486 }
148487 }
148488 };
148489 WindowToggleSubscriber.prototype._error = function (err) {
148490 var contexts = this.contexts;
148491 this.contexts = null;
148492 if (contexts) {
148493 var len = contexts.length;
148494 var index = -1;
148495 while (++index < len) {
148496 var context_1 = contexts[index];
148497 context_1.window.error(err);
148498 context_1.subscription.unsubscribe();
148499 }
148500 }
148501 _super.prototype._error.call(this, err);
148502 };
148503 WindowToggleSubscriber.prototype._complete = function () {
148504 var contexts = this.contexts;
148505 this.contexts = null;
148506 if (contexts) {
148507 var len = contexts.length;
148508 var index = -1;
148509 while (++index < len) {
148510 var context_2 = contexts[index];
148511 context_2.window.complete();
148512 context_2.subscription.unsubscribe();
148513 }
148514 }
148515 _super.prototype._complete.call(this);
148516 };
148517 WindowToggleSubscriber.prototype._unsubscribe = function () {
148518 var contexts = this.contexts;
148519 this.contexts = null;
148520 if (contexts) {
148521 var len = contexts.length;
148522 var index = -1;
148523 while (++index < len) {
148524 var context_3 = contexts[index];
148525 context_3.window.unsubscribe();
148526 context_3.subscription.unsubscribe();
148527 }
148528 }
148529 };
148530 WindowToggleSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
148531 if (outerValue === this.openings) {
148532 var closingSelector = this.closingSelector;
148533 var closingNotifier = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(closingSelector)(innerValue);
148534 if (closingNotifier === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) {
148535 return this.error(__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e);
148536 }
148537 else {
148538 var window_1 = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]();
148539 var subscription = new __WEBPACK_IMPORTED_MODULE_2__Subscription__["a" /* Subscription */]();
148540 var context_4 = { window: window_1, subscription: subscription };
148541 this.contexts.push(context_4);
148542 var innerSubscription = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_subscribeToResult__["a" /* subscribeToResult */])(this, closingNotifier, context_4);
148543 if (innerSubscription.closed) {
148544 this.closeWindow(this.contexts.length - 1);
148545 }
148546 else {
148547 innerSubscription.context = context_4;
148548 subscription.add(innerSubscription);
148549 }
148550 this.destination.next(window_1);
148551 }
148552 }
148553 else {
148554 this.closeWindow(this.contexts.indexOf(outerValue));
148555 }
148556 };
148557 WindowToggleSubscriber.prototype.notifyError = function (err) {
148558 this.error(err);
148559 };
148560 WindowToggleSubscriber.prototype.notifyComplete = function (inner) {
148561 if (inner !== this.openSubscription) {
148562 this.closeWindow(this.contexts.indexOf(inner.context));
148563 }
148564 };
148565 WindowToggleSubscriber.prototype.closeWindow = function (index) {
148566 if (index === -1) {
148567 return;
148568 }
148569 var contexts = this.contexts;
148570 var context = contexts[index];
148571 var window = context.window, subscription = context.subscription;
148572 contexts.splice(index, 1);
148573 window.complete();
148574 subscription.unsubscribe();
148575 };
148576 return WindowToggleSubscriber;
148577}(__WEBPACK_IMPORTED_MODULE_5__OuterSubscriber__["a" /* OuterSubscriber */]));
148578//# sourceMappingURL=windowToggle.js.map
148579
148580
148581/***/ }),
148582/* 987 */
148583/***/ (function(module, __webpack_exports__, __webpack_require__) {
148584
148585"use strict";
148586/* harmony export (immutable) */ __webpack_exports__["a"] = windowWhen;
148587/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
148588/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(43);
148589/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(59);
148590/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(55);
148591/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__ = __webpack_require__(18);
148592/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__ = __webpack_require__(19);
148593/** PURE_IMPORTS_START tslib,_Subject,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
148594
148595
148596
148597
148598
148599
148600function windowWhen(closingSelector) {
148601 return function windowWhenOperatorFunction(source) {
148602 return source.lift(new WindowOperator(closingSelector));
148603 };
148604}
148605var WindowOperator = /*@__PURE__*/ (function () {
148606 function WindowOperator(closingSelector) {
148607 this.closingSelector = closingSelector;
148608 }
148609 WindowOperator.prototype.call = function (subscriber, source) {
148610 return source.subscribe(new WindowSubscriber(subscriber, this.closingSelector));
148611 };
148612 return WindowOperator;
148613}());
148614var WindowSubscriber = /*@__PURE__*/ (function (_super) {
148615 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WindowSubscriber, _super);
148616 function WindowSubscriber(destination, closingSelector) {
148617 var _this = _super.call(this, destination) || this;
148618 _this.destination = destination;
148619 _this.closingSelector = closingSelector;
148620 _this.openWindow();
148621 return _this;
148622 }
148623 WindowSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
148624 this.openWindow(innerSub);
148625 };
148626 WindowSubscriber.prototype.notifyError = function (error, innerSub) {
148627 this._error(error);
148628 };
148629 WindowSubscriber.prototype.notifyComplete = function (innerSub) {
148630 this.openWindow(innerSub);
148631 };
148632 WindowSubscriber.prototype._next = function (value) {
148633 this.window.next(value);
148634 };
148635 WindowSubscriber.prototype._error = function (err) {
148636 this.window.error(err);
148637 this.destination.error(err);
148638 this.unsubscribeClosingNotification();
148639 };
148640 WindowSubscriber.prototype._complete = function () {
148641 this.window.complete();
148642 this.destination.complete();
148643 this.unsubscribeClosingNotification();
148644 };
148645 WindowSubscriber.prototype.unsubscribeClosingNotification = function () {
148646 if (this.closingNotification) {
148647 this.closingNotification.unsubscribe();
148648 }
148649 };
148650 WindowSubscriber.prototype.openWindow = function (innerSub) {
148651 if (innerSub === void 0) {
148652 innerSub = null;
148653 }
148654 if (innerSub) {
148655 this.remove(innerSub);
148656 innerSub.unsubscribe();
148657 }
148658 var prevWindow = this.window;
148659 if (prevWindow) {
148660 prevWindow.complete();
148661 }
148662 var window = this.window = new __WEBPACK_IMPORTED_MODULE_1__Subject__["a" /* Subject */]();
148663 this.destination.next(window);
148664 var closingNotifier = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_tryCatch__["a" /* tryCatch */])(this.closingSelector)();
148665 if (closingNotifier === __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */]) {
148666 var err = __WEBPACK_IMPORTED_MODULE_3__util_errorObject__["a" /* errorObject */].e;
148667 this.destination.error(err);
148668 this.window.error(err);
148669 }
148670 else {
148671 this.add(this.closingNotification = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_5__util_subscribeToResult__["a" /* subscribeToResult */])(this, closingNotifier));
148672 }
148673 };
148674 return WindowSubscriber;
148675}(__WEBPACK_IMPORTED_MODULE_4__OuterSubscriber__["a" /* OuterSubscriber */]));
148676//# sourceMappingURL=windowWhen.js.map
148677
148678
148679/***/ }),
148680/* 988 */
148681/***/ (function(module, __webpack_exports__, __webpack_require__) {
148682
148683"use strict";
148684/* harmony export (immutable) */ __webpack_exports__["a"] = withLatestFrom;
148685/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
148686/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__ = __webpack_require__(18);
148687/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__ = __webpack_require__(19);
148688/** PURE_IMPORTS_START tslib,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */
148689
148690
148691
148692function withLatestFrom() {
148693 var args = [];
148694 for (var _i = 0; _i < arguments.length; _i++) {
148695 args[_i] = arguments[_i];
148696 }
148697 return function (source) {
148698 var project;
148699 if (typeof args[args.length - 1] === 'function') {
148700 project = args.pop();
148701 }
148702 var observables = args;
148703 return source.lift(new WithLatestFromOperator(observables, project));
148704 };
148705}
148706var WithLatestFromOperator = /*@__PURE__*/ (function () {
148707 function WithLatestFromOperator(observables, project) {
148708 this.observables = observables;
148709 this.project = project;
148710 }
148711 WithLatestFromOperator.prototype.call = function (subscriber, source) {
148712 return source.subscribe(new WithLatestFromSubscriber(subscriber, this.observables, this.project));
148713 };
148714 return WithLatestFromOperator;
148715}());
148716var WithLatestFromSubscriber = /*@__PURE__*/ (function (_super) {
148717 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](WithLatestFromSubscriber, _super);
148718 function WithLatestFromSubscriber(destination, observables, project) {
148719 var _this = _super.call(this, destination) || this;
148720 _this.observables = observables;
148721 _this.project = project;
148722 _this.toRespond = [];
148723 var len = observables.length;
148724 _this.values = new Array(len);
148725 for (var i = 0; i < len; i++) {
148726 _this.toRespond.push(i);
148727 }
148728 for (var i = 0; i < len; i++) {
148729 var observable = observables[i];
148730 _this.add(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_subscribeToResult__["a" /* subscribeToResult */])(_this, observable, observable, i));
148731 }
148732 return _this;
148733 }
148734 WithLatestFromSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
148735 this.values[outerIndex] = innerValue;
148736 var toRespond = this.toRespond;
148737 if (toRespond.length > 0) {
148738 var found = toRespond.indexOf(outerIndex);
148739 if (found !== -1) {
148740 toRespond.splice(found, 1);
148741 }
148742 }
148743 };
148744 WithLatestFromSubscriber.prototype.notifyComplete = function () {
148745 };
148746 WithLatestFromSubscriber.prototype._next = function (value) {
148747 if (this.toRespond.length === 0) {
148748 var args = [value].concat(this.values);
148749 if (this.project) {
148750 this._tryProject(args);
148751 }
148752 else {
148753 this.destination.next(args);
148754 }
148755 }
148756 };
148757 WithLatestFromSubscriber.prototype._tryProject = function (args) {
148758 var result;
148759 try {
148760 result = this.project.apply(this, args);
148761 }
148762 catch (err) {
148763 this.destination.error(err);
148764 return;
148765 }
148766 this.destination.next(result);
148767 };
148768 return WithLatestFromSubscriber;
148769}(__WEBPACK_IMPORTED_MODULE_1__OuterSubscriber__["a" /* OuterSubscriber */]));
148770//# sourceMappingURL=withLatestFrom.js.map
148771
148772
148773/***/ }),
148774/* 989 */
148775/***/ (function(module, __webpack_exports__, __webpack_require__) {
148776
148777"use strict";
148778/* harmony export (immutable) */ __webpack_exports__["a"] = zip;
148779/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_zip__ = __webpack_require__(254);
148780/** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */
148781
148782function zip() {
148783 var observables = [];
148784 for (var _i = 0; _i < arguments.length; _i++) {
148785 observables[_i] = arguments[_i];
148786 }
148787 return function zipOperatorFunction(source) {
148788 return source.lift.call(__WEBPACK_IMPORTED_MODULE_0__observable_zip__["a" /* zip */].apply(void 0, [source].concat(observables)));
148789 };
148790}
148791//# sourceMappingURL=zip.js.map
148792
148793
148794/***/ }),
148795/* 990 */
148796/***/ (function(module, __webpack_exports__, __webpack_require__) {
148797
148798"use strict";
148799/* harmony export (immutable) */ __webpack_exports__["a"] = zipAll;
148800/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__observable_zip__ = __webpack_require__(254);
148801/** PURE_IMPORTS_START _observable_zip PURE_IMPORTS_END */
148802
148803function zipAll(project) {
148804 return function (source) { return source.lift(new __WEBPACK_IMPORTED_MODULE_0__observable_zip__["b" /* ZipOperator */](project)); };
148805}
148806//# sourceMappingURL=zipAll.js.map
148807
148808
148809/***/ }),
148810/* 991 */
148811/***/ (function(module, __webpack_exports__, __webpack_require__) {
148812
148813"use strict";
148814/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Action; });
148815/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
148816/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(31);
148817/** PURE_IMPORTS_START tslib,_Subscription PURE_IMPORTS_END */
148818
148819
148820var Action = /*@__PURE__*/ (function (_super) {
148821 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Action, _super);
148822 function Action(scheduler, work) {
148823 return _super.call(this) || this;
148824 }
148825 Action.prototype.schedule = function (state, delay) {
148826 if (delay === void 0) {
148827 delay = 0;
148828 }
148829 return this;
148830 };
148831 return Action;
148832}(__WEBPACK_IMPORTED_MODULE_1__Subscription__["a" /* Subscription */]));
148833
148834//# sourceMappingURL=Action.js.map
148835
148836
148837/***/ }),
148838/* 992 */
148839/***/ (function(module, __webpack_exports__, __webpack_require__) {
148840
148841"use strict";
148842/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnimationFrameAction; });
148843/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
148844/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncAction__ = __webpack_require__(137);
148845/** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */
148846
148847
148848var AnimationFrameAction = /*@__PURE__*/ (function (_super) {
148849 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AnimationFrameAction, _super);
148850 function AnimationFrameAction(scheduler, work) {
148851 var _this = _super.call(this, scheduler, work) || this;
148852 _this.scheduler = scheduler;
148853 _this.work = work;
148854 return _this;
148855 }
148856 AnimationFrameAction.prototype.requestAsyncId = function (scheduler, id, delay) {
148857 if (delay === void 0) {
148858 delay = 0;
148859 }
148860 if (delay !== null && delay > 0) {
148861 return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
148862 }
148863 scheduler.actions.push(this);
148864 return scheduler.scheduled || (scheduler.scheduled = requestAnimationFrame(function () { return scheduler.flush(null); }));
148865 };
148866 AnimationFrameAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
148867 if (delay === void 0) {
148868 delay = 0;
148869 }
148870 if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
148871 return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
148872 }
148873 if (scheduler.actions.length === 0) {
148874 cancelAnimationFrame(id);
148875 scheduler.scheduled = undefined;
148876 }
148877 return undefined;
148878 };
148879 return AnimationFrameAction;
148880}(__WEBPACK_IMPORTED_MODULE_1__AsyncAction__["a" /* AsyncAction */]));
148881
148882//# sourceMappingURL=AnimationFrameAction.js.map
148883
148884
148885/***/ }),
148886/* 993 */
148887/***/ (function(module, __webpack_exports__, __webpack_require__) {
148888
148889"use strict";
148890/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AnimationFrameScheduler; });
148891/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
148892/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(138);
148893/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */
148894
148895
148896var AnimationFrameScheduler = /*@__PURE__*/ (function (_super) {
148897 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AnimationFrameScheduler, _super);
148898 function AnimationFrameScheduler() {
148899 return _super !== null && _super.apply(this, arguments) || this;
148900 }
148901 AnimationFrameScheduler.prototype.flush = function (action) {
148902 this.active = true;
148903 this.scheduled = undefined;
148904 var actions = this.actions;
148905 var error;
148906 var index = -1;
148907 var count = actions.length;
148908 action = action || actions.shift();
148909 do {
148910 if (error = action.execute(action.state, action.delay)) {
148911 break;
148912 }
148913 } while (++index < count && (action = actions.shift()));
148914 this.active = false;
148915 if (error) {
148916 while (++index < count && (action = actions.shift())) {
148917 action.unsubscribe();
148918 }
148919 throw error;
148920 }
148921 };
148922 return AnimationFrameScheduler;
148923}(__WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /* AsyncScheduler */]));
148924
148925//# sourceMappingURL=AnimationFrameScheduler.js.map
148926
148927
148928/***/ }),
148929/* 994 */
148930/***/ (function(module, __webpack_exports__, __webpack_require__) {
148931
148932"use strict";
148933/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsapAction; });
148934/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
148935/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_Immediate__ = __webpack_require__(1000);
148936/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__AsyncAction__ = __webpack_require__(137);
148937/** PURE_IMPORTS_START tslib,_util_Immediate,_AsyncAction PURE_IMPORTS_END */
148938
148939
148940
148941var AsapAction = /*@__PURE__*/ (function (_super) {
148942 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsapAction, _super);
148943 function AsapAction(scheduler, work) {
148944 var _this = _super.call(this, scheduler, work) || this;
148945 _this.scheduler = scheduler;
148946 _this.work = work;
148947 return _this;
148948 }
148949 AsapAction.prototype.requestAsyncId = function (scheduler, id, delay) {
148950 if (delay === void 0) {
148951 delay = 0;
148952 }
148953 if (delay !== null && delay > 0) {
148954 return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
148955 }
148956 scheduler.actions.push(this);
148957 return scheduler.scheduled || (scheduler.scheduled = __WEBPACK_IMPORTED_MODULE_1__util_Immediate__["a" /* Immediate */].setImmediate(scheduler.flush.bind(scheduler, null)));
148958 };
148959 AsapAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
148960 if (delay === void 0) {
148961 delay = 0;
148962 }
148963 if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
148964 return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay);
148965 }
148966 if (scheduler.actions.length === 0) {
148967 __WEBPACK_IMPORTED_MODULE_1__util_Immediate__["a" /* Immediate */].clearImmediate(id);
148968 scheduler.scheduled = undefined;
148969 }
148970 return undefined;
148971 };
148972 return AsapAction;
148973}(__WEBPACK_IMPORTED_MODULE_2__AsyncAction__["a" /* AsyncAction */]));
148974
148975//# sourceMappingURL=AsapAction.js.map
148976
148977
148978/***/ }),
148979/* 995 */
148980/***/ (function(module, __webpack_exports__, __webpack_require__) {
148981
148982"use strict";
148983/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return AsapScheduler; });
148984/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
148985/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(138);
148986/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */
148987
148988
148989var AsapScheduler = /*@__PURE__*/ (function (_super) {
148990 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AsapScheduler, _super);
148991 function AsapScheduler() {
148992 return _super !== null && _super.apply(this, arguments) || this;
148993 }
148994 AsapScheduler.prototype.flush = function (action) {
148995 this.active = true;
148996 this.scheduled = undefined;
148997 var actions = this.actions;
148998 var error;
148999 var index = -1;
149000 var count = actions.length;
149001 action = action || actions.shift();
149002 do {
149003 if (error = action.execute(action.state, action.delay)) {
149004 break;
149005 }
149006 } while (++index < count && (action = actions.shift()));
149007 this.active = false;
149008 if (error) {
149009 while (++index < count && (action = actions.shift())) {
149010 action.unsubscribe();
149011 }
149012 throw error;
149013 }
149014 };
149015 return AsapScheduler;
149016}(__WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /* AsyncScheduler */]));
149017
149018//# sourceMappingURL=AsapScheduler.js.map
149019
149020
149021/***/ }),
149022/* 996 */
149023/***/ (function(module, __webpack_exports__, __webpack_require__) {
149024
149025"use strict";
149026/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return QueueAction; });
149027/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
149028/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncAction__ = __webpack_require__(137);
149029/** PURE_IMPORTS_START tslib,_AsyncAction PURE_IMPORTS_END */
149030
149031
149032var QueueAction = /*@__PURE__*/ (function (_super) {
149033 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](QueueAction, _super);
149034 function QueueAction(scheduler, work) {
149035 var _this = _super.call(this, scheduler, work) || this;
149036 _this.scheduler = scheduler;
149037 _this.work = work;
149038 return _this;
149039 }
149040 QueueAction.prototype.schedule = function (state, delay) {
149041 if (delay === void 0) {
149042 delay = 0;
149043 }
149044 if (delay > 0) {
149045 return _super.prototype.schedule.call(this, state, delay);
149046 }
149047 this.delay = delay;
149048 this.state = state;
149049 this.scheduler.flush(this);
149050 return this;
149051 };
149052 QueueAction.prototype.execute = function (state, delay) {
149053 return (delay > 0 || this.closed) ?
149054 _super.prototype.execute.call(this, state, delay) :
149055 this._execute(state, delay);
149056 };
149057 QueueAction.prototype.requestAsyncId = function (scheduler, id, delay) {
149058 if (delay === void 0) {
149059 delay = 0;
149060 }
149061 if ((delay !== null && delay > 0) || (delay === null && this.delay > 0)) {
149062 return _super.prototype.requestAsyncId.call(this, scheduler, id, delay);
149063 }
149064 return scheduler.flush(this);
149065 };
149066 return QueueAction;
149067}(__WEBPACK_IMPORTED_MODULE_1__AsyncAction__["a" /* AsyncAction */]));
149068
149069//# sourceMappingURL=QueueAction.js.map
149070
149071
149072/***/ }),
149073/* 997 */
149074/***/ (function(module, __webpack_exports__, __webpack_require__) {
149075
149076"use strict";
149077/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return QueueScheduler; });
149078/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
149079/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__ = __webpack_require__(138);
149080/** PURE_IMPORTS_START tslib,_AsyncScheduler PURE_IMPORTS_END */
149081
149082
149083var QueueScheduler = /*@__PURE__*/ (function (_super) {
149084 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](QueueScheduler, _super);
149085 function QueueScheduler() {
149086 return _super !== null && _super.apply(this, arguments) || this;
149087 }
149088 return QueueScheduler;
149089}(__WEBPACK_IMPORTED_MODULE_1__AsyncScheduler__["a" /* AsyncScheduler */]));
149090
149091//# sourceMappingURL=QueueScheduler.js.map
149092
149093
149094/***/ }),
149095/* 998 */
149096/***/ (function(module, __webpack_exports__, __webpack_require__) {
149097
149098"use strict";
149099/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return VirtualTimeScheduler; });
149100/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return VirtualAction; });
149101/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(0);
149102/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AsyncAction__ = __webpack_require__(137);
149103/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__AsyncScheduler__ = __webpack_require__(138);
149104/** PURE_IMPORTS_START tslib,_AsyncAction,_AsyncScheduler PURE_IMPORTS_END */
149105
149106
149107
149108var VirtualTimeScheduler = /*@__PURE__*/ (function (_super) {
149109 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](VirtualTimeScheduler, _super);
149110 function VirtualTimeScheduler(SchedulerAction, maxFrames) {
149111 if (SchedulerAction === void 0) {
149112 SchedulerAction = VirtualAction;
149113 }
149114 if (maxFrames === void 0) {
149115 maxFrames = Number.POSITIVE_INFINITY;
149116 }
149117 var _this = _super.call(this, SchedulerAction, function () { return _this.frame; }) || this;
149118 _this.maxFrames = maxFrames;
149119 _this.frame = 0;
149120 _this.index = -1;
149121 return _this;
149122 }
149123 VirtualTimeScheduler.prototype.flush = function () {
149124 var _a = this, actions = _a.actions, maxFrames = _a.maxFrames;
149125 var error, action;
149126 while ((action = actions.shift()) && (this.frame = action.delay) <= maxFrames) {
149127 if (error = action.execute(action.state, action.delay)) {
149128 break;
149129 }
149130 }
149131 if (error) {
149132 while (action = actions.shift()) {
149133 action.unsubscribe();
149134 }
149135 throw error;
149136 }
149137 };
149138 VirtualTimeScheduler.frameTimeFactor = 10;
149139 return VirtualTimeScheduler;
149140}(__WEBPACK_IMPORTED_MODULE_2__AsyncScheduler__["a" /* AsyncScheduler */]));
149141
149142var VirtualAction = /*@__PURE__*/ (function (_super) {
149143 __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](VirtualAction, _super);
149144 function VirtualAction(scheduler, work, index) {
149145 if (index === void 0) {
149146 index = scheduler.index += 1;
149147 }
149148 var _this = _super.call(this, scheduler, work) || this;
149149 _this.scheduler = scheduler;
149150 _this.work = work;
149151 _this.index = index;
149152 _this.active = true;
149153 _this.index = scheduler.index = index;
149154 return _this;
149155 }
149156 VirtualAction.prototype.schedule = function (state, delay) {
149157 if (delay === void 0) {
149158 delay = 0;
149159 }
149160 if (!this.id) {
149161 return _super.prototype.schedule.call(this, state, delay);
149162 }
149163 this.active = false;
149164 var action = new VirtualAction(this.scheduler, this.work);
149165 this.add(action);
149166 return action.schedule(state, delay);
149167 };
149168 VirtualAction.prototype.requestAsyncId = function (scheduler, id, delay) {
149169 if (delay === void 0) {
149170 delay = 0;
149171 }
149172 this.delay = scheduler.frame + delay;
149173 var actions = scheduler.actions;
149174 actions.push(this);
149175 actions.sort(VirtualAction.sortActions);
149176 return true;
149177 };
149178 VirtualAction.prototype.recycleAsyncId = function (scheduler, id, delay) {
149179 if (delay === void 0) {
149180 delay = 0;
149181 }
149182 return undefined;
149183 };
149184 VirtualAction.prototype._execute = function (state, delay) {
149185 if (this.active === true) {
149186 return _super.prototype._execute.call(this, state, delay);
149187 }
149188 };
149189 VirtualAction.sortActions = function (a, b) {
149190 if (a.delay === b.delay) {
149191 if (a.index === b.index) {
149192 return 0;
149193 }
149194 else if (a.index > b.index) {
149195 return 1;
149196 }
149197 else {
149198 return -1;
149199 }
149200 }
149201 else if (a.delay > b.delay) {
149202 return 1;
149203 }
149204 else {
149205 return -1;
149206 }
149207 };
149208 return VirtualAction;
149209}(__WEBPACK_IMPORTED_MODULE_1__AsyncAction__["a" /* AsyncAction */]));
149210
149211//# sourceMappingURL=VirtualTimeScheduler.js.map
149212
149213
149214/***/ }),
149215/* 999 */
149216/***/ (function(module, __webpack_exports__, __webpack_require__) {
149217
149218"use strict";
149219/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return animationFrame; });
149220/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__AnimationFrameAction__ = __webpack_require__(992);
149221/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__AnimationFrameScheduler__ = __webpack_require__(993);
149222/** PURE_IMPORTS_START _AnimationFrameAction,_AnimationFrameScheduler PURE_IMPORTS_END */
149223
149224
149225var animationFrame = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_1__AnimationFrameScheduler__["a" /* AnimationFrameScheduler */](__WEBPACK_IMPORTED_MODULE_0__AnimationFrameAction__["a" /* AnimationFrameAction */]);
149226//# sourceMappingURL=animationFrame.js.map
149227
149228
149229/***/ }),
149230/* 1000 */
149231/***/ (function(module, __webpack_exports__, __webpack_require__) {
149232
149233"use strict";
149234/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Immediate; });
149235/** PURE_IMPORTS_START PURE_IMPORTS_END */
149236var nextHandle = 1;
149237var tasksByHandle = {};
149238function runIfPresent(handle) {
149239 var cb = tasksByHandle[handle];
149240 if (cb) {
149241 cb();
149242 }
149243}
149244var Immediate = {
149245 setImmediate: function (cb) {
149246 var handle = nextHandle++;
149247 tasksByHandle[handle] = cb;
149248 Promise.resolve().then(function () { return runIfPresent(handle); });
149249 return handle;
149250 },
149251 clearImmediate: function (handle) {
149252 delete tasksByHandle[handle];
149253 },
149254};
149255//# sourceMappingURL=Immediate.js.map
149256
149257
149258/***/ }),
149259/* 1001 */
149260/***/ (function(module, __webpack_exports__, __webpack_require__) {
149261
149262"use strict";
149263/* harmony export (immutable) */ __webpack_exports__["a"] = isInteropObservable;
149264/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_observable__ = __webpack_require__(112);
149265/** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */
149266
149267function isInteropObservable(input) {
149268 return input && typeof input[__WEBPACK_IMPORTED_MODULE_0__symbol_observable__["a" /* observable */]] === 'function';
149269}
149270//# sourceMappingURL=isInteropObservable.js.map
149271
149272
149273/***/ }),
149274/* 1002 */
149275/***/ (function(module, __webpack_exports__, __webpack_require__) {
149276
149277"use strict";
149278/* harmony export (immutable) */ __webpack_exports__["a"] = isIterable;
149279/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_iterator__ = __webpack_require__(139);
149280/** PURE_IMPORTS_START _symbol_iterator PURE_IMPORTS_END */
149281
149282function isIterable(input) {
149283 return input && typeof input[__WEBPACK_IMPORTED_MODULE_0__symbol_iterator__["a" /* iterator */]] === 'function';
149284}
149285//# sourceMappingURL=isIterable.js.map
149286
149287
149288/***/ }),
149289/* 1003 */
149290/***/ (function(module, __webpack_exports__, __webpack_require__) {
149291
149292"use strict";
149293/* harmony export (immutable) */ __webpack_exports__["a"] = isObservable;
149294/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(17);
149295/** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */
149296
149297function isObservable(obj) {
149298 return !!obj && (obj instanceof __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */] || (typeof obj.lift === 'function' && typeof obj.subscribe === 'function'));
149299}
149300//# sourceMappingURL=isObservable.js.map
149301
149302
149303/***/ }),
149304/* 1004 */
149305/***/ (function(module, __webpack_exports__, __webpack_require__) {
149306
149307"use strict";
149308/* harmony export (immutable) */ __webpack_exports__["a"] = not;
149309/** PURE_IMPORTS_START PURE_IMPORTS_END */
149310function not(pred, thisArg) {
149311 function notPred() {
149312 return !(notPred.pred.apply(notPred.thisArg, arguments));
149313 }
149314 notPred.pred = pred;
149315 notPred.thisArg = thisArg;
149316 return notPred;
149317}
149318//# sourceMappingURL=not.js.map
149319
149320
149321/***/ }),
149322/* 1005 */
149323/***/ (function(module, __webpack_exports__, __webpack_require__) {
149324
149325"use strict";
149326/* harmony export (immutable) */ __webpack_exports__["a"] = toSubscriber;
149327/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Subscriber__ = __webpack_require__(5);
149328/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__symbol_rxSubscriber__ = __webpack_require__(261);
149329/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observer__ = __webpack_require__(390);
149330/** PURE_IMPORTS_START _Subscriber,_symbol_rxSubscriber,_Observer PURE_IMPORTS_END */
149331
149332
149333
149334function toSubscriber(nextOrObserver, error, complete) {
149335 if (nextOrObserver) {
149336 if (nextOrObserver instanceof __WEBPACK_IMPORTED_MODULE_0__Subscriber__["a" /* Subscriber */]) {
149337 return nextOrObserver;
149338 }
149339 if (nextOrObserver[__WEBPACK_IMPORTED_MODULE_1__symbol_rxSubscriber__["a" /* rxSubscriber */]]) {
149340 return nextOrObserver[__WEBPACK_IMPORTED_MODULE_1__symbol_rxSubscriber__["a" /* rxSubscriber */]]();
149341 }
149342 }
149343 if (!nextOrObserver && !error && !complete) {
149344 return new __WEBPACK_IMPORTED_MODULE_0__Subscriber__["a" /* Subscriber */](__WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]);
149345 }
149346 return new __WEBPACK_IMPORTED_MODULE_0__Subscriber__["a" /* Subscriber */](nextOrObserver, error, complete);
149347}
149348//# sourceMappingURL=toSubscriber.js.map
149349
149350
149351/***/ }),
149352/* 1006 */
149353/***/ (function(module, exports) {
149354
149355// This is not the set of all possible signals.
149356//
149357// It IS, however, the set of all signals that trigger
149358// an exit on either Linux or BSD systems. Linux is a
149359// superset of the signal names supported on BSD, and
149360// the unknown signals just fail to register, so we can
149361// catch that easily enough.
149362//
149363// Don't bother with SIGKILL. It's uncatchable, which
149364// means that we can't fire any callbacks anyway.
149365//
149366// If a user does happen to register a handler on a non-
149367// fatal signal like SIGWINCH or something, and then
149368// exit, it'll end up firing `process.emit('exit')`, so
149369// the handler will be fired anyway.
149370//
149371// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
149372// artificially, inherently leave the process in a
149373// state from which it is not safe to try and enter JS
149374// listeners.
149375module.exports = [
149376 'SIGABRT',
149377 'SIGALRM',
149378 'SIGHUP',
149379 'SIGINT',
149380 'SIGTERM'
149381]
149382
149383if (process.platform !== 'win32') {
149384 module.exports.push(
149385 'SIGVTALRM',
149386 'SIGXCPU',
149387 'SIGXFSZ',
149388 'SIGUSR2',
149389 'SIGTRAP',
149390 'SIGSYS',
149391 'SIGQUIT',
149392 'SIGIOT'
149393 // should detect profiler and enable/disable accordingly.
149394 // see #21
149395 // 'SIGPROF'
149396 )
149397}
149398
149399if (process.platform === 'linux') {
149400 module.exports.push(
149401 'SIGIO',
149402 'SIGPOLL',
149403 'SIGPWR',
149404 'SIGSTKFLT',
149405 'SIGUNUSED'
149406 )
149407}
149408
149409
149410/***/ }),
149411/* 1007 */
149412/***/ (function(module, exports, __webpack_require__) {
149413
149414"use strict";
149415
149416const isPlainObj = __webpack_require__(787);
149417
149418module.exports = (obj, opts) => {
149419 if (!isPlainObj(obj)) {
149420 throw new TypeError('Expected a plain object');
149421 }
149422
149423 opts = opts || {};
149424
149425 // DEPRECATED
149426 if (typeof opts === 'function') {
149427 throw new TypeError('Specify the compare function as an option instead');
149428 }
149429
149430 const deep = opts.deep;
149431 const seenInput = [];
149432 const seenOutput = [];
149433
149434 const sortKeys = x => {
149435 const seenIndex = seenInput.indexOf(x);
149436
149437 if (seenIndex !== -1) {
149438 return seenOutput[seenIndex];
149439 }
149440
149441 const ret = {};
149442 const keys = Object.keys(x).sort(opts.compare);
149443
149444 seenInput.push(x);
149445 seenOutput.push(ret);
149446
149447 for (let i = 0; i < keys.length; i++) {
149448 const key = keys[i];
149449 const val = x[key];
149450
149451 if (deep && Array.isArray(val)) {
149452 const retArr = [];
149453
149454 for (let j = 0; j < val.length; j++) {
149455 retArr[j] = isPlainObj(val[j]) ? sortKeys(val[j]) : val[j];
149456 }
149457
149458 ret[key] = retArr;
149459 continue;
149460 }
149461
149462 ret[key] = deep && isPlainObj(val) ? sortKeys(val) : val;
149463 }
149464
149465 return ret;
149466 };
149467
149468 return sortKeys(obj);
149469};
149470
149471
149472/***/ }),
149473/* 1008 */
149474/***/ (function(module, exports, __webpack_require__) {
149475
149476/*
149477Copyright 2015 Kyle E. Mitchell
149478
149479Licensed under the Apache License, Version 2.0 (the "License");
149480you may not use this file except in compliance with the License.
149481You may obtain a copy of the License at
149482
149483 http://www.apache.org/licenses/LICENSE-2.0
149484
149485Unless required by applicable law or agreed to in writing, software
149486distributed under the License is distributed on an "AS IS" BASIS,
149487WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149488See the License for the specific language governing permissions and
149489limitations under the License.
149490*/
149491var parse = __webpack_require__(422)
149492var spdxLicenseIds = __webpack_require__(423)
149493
149494function valid (string) {
149495 try {
149496 parse(string)
149497 return true
149498 } catch (error) {
149499 return false
149500 }
149501}
149502
149503// Common transpositions of license identifier acronyms
149504var transpositions = [
149505 ['APGL', 'AGPL'],
149506 ['Gpl', 'GPL'],
149507 ['GLP', 'GPL'],
149508 ['APL', 'Apache'],
149509 ['ISD', 'ISC'],
149510 ['GLP', 'GPL'],
149511 ['IST', 'ISC'],
149512 ['Claude', 'Clause'],
149513 [' or later', '+'],
149514 [' International', ''],
149515 ['GNU', 'GPL'],
149516 ['GUN', 'GPL'],
149517 ['+', ''],
149518 ['GNU GPL', 'GPL'],
149519 ['GNU/GPL', 'GPL'],
149520 ['GNU GLP', 'GPL'],
149521 ['GNU General Public License', 'GPL'],
149522 ['Gnu public license', 'GPL'],
149523 ['GNU Public License', 'GPL'],
149524 ['GNU GENERAL PUBLIC LICENSE', 'GPL'],
149525 ['MTI', 'MIT'],
149526 ['Mozilla Public License', 'MPL'],
149527 ['WTH', 'WTF'],
149528 ['-License', '']
149529]
149530
149531var TRANSPOSED = 0
149532var CORRECT = 1
149533
149534// Simple corrections to nearly valid identifiers.
149535var transforms = [
149536 // e.g. 'mit'
149537 function (argument) {
149538 return argument.toUpperCase()
149539 },
149540 // e.g. 'MIT '
149541 function (argument) {
149542 return argument.trim()
149543 },
149544 // e.g. 'M.I.T.'
149545 function (argument) {
149546 return argument.replace(/\./g, '')
149547 },
149548 // e.g. 'Apache- 2.0'
149549 function (argument) {
149550 return argument.replace(/\s+/g, '')
149551 },
149552 // e.g. 'CC BY 4.0''
149553 function (argument) {
149554 return argument.replace(/\s+/g, '-')
149555 },
149556 // e.g. 'LGPLv2.1'
149557 function (argument) {
149558 return argument.replace('v', '-')
149559 },
149560 // e.g. 'Apache 2.0'
149561 function (argument) {
149562 return argument.replace(/,?\s*(\d)/, '-$1')
149563 },
149564 // e.g. 'GPL 2'
149565 function (argument) {
149566 return argument.replace(/,?\s*(\d)/, '-$1.0')
149567 },
149568 // e.g. 'Apache Version 2.0'
149569 function (argument) {
149570 return argument
149571 .replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2')
149572 },
149573 // e.g. 'Apache Version 2'
149574 function (argument) {
149575 return argument
149576 .replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/, '-$2.0')
149577 },
149578 // e.g. 'ZLIB'
149579 function (argument) {
149580 return argument[0].toUpperCase() + argument.slice(1)
149581 },
149582 // e.g. 'MPL/2.0'
149583 function (argument) {
149584 return argument.replace('/', '-')
149585 },
149586 // e.g. 'Apache 2'
149587 function (argument) {
149588 return argument
149589 .replace(/\s*V\s*(\d)/, '-$1')
149590 .replace(/(\d)$/, '$1.0')
149591 },
149592 // e.g. 'GPL-2.0', 'GPL-3.0'
149593 function (argument) {
149594 if (argument.indexOf('3.0') !== -1) {
149595 return argument + '-or-later'
149596 } else {
149597 return argument + '-only'
149598 }
149599 },
149600 // e.g. 'GPL-2.0-'
149601 function (argument) {
149602 return argument + 'only'
149603 },
149604 // e.g. 'GPL2'
149605 function (argument) {
149606 return argument.replace(/(\d)$/, '-$1.0')
149607 },
149608 // e.g. 'BSD 3'
149609 function (argument) {
149610 return argument.replace(/(-| )?(\d)$/, '-$2-Clause')
149611 },
149612 // e.g. 'BSD clause 3'
149613 function (argument) {
149614 return argument.replace(/(-| )clause(-| )(\d)/, '-$3-Clause')
149615 },
149616 // e.g. 'BY-NC-4.0'
149617 function (argument) {
149618 return 'CC-' + argument
149619 },
149620 // e.g. 'BY-NC'
149621 function (argument) {
149622 return 'CC-' + argument + '-4.0'
149623 },
149624 // e.g. 'Attribution-NonCommercial'
149625 function (argument) {
149626 return argument
149627 .replace('Attribution', 'BY')
149628 .replace('NonCommercial', 'NC')
149629 .replace('NoDerivatives', 'ND')
149630 .replace(/ (\d)/, '-$1')
149631 .replace(/ ?International/, '')
149632 },
149633 // e.g. 'Attribution-NonCommercial'
149634 function (argument) {
149635 return 'CC-' +
149636 argument
149637 .replace('Attribution', 'BY')
149638 .replace('NonCommercial', 'NC')
149639 .replace('NoDerivatives', 'ND')
149640 .replace(/ (\d)/, '-$1')
149641 .replace(/ ?International/, '') +
149642 '-4.0'
149643 }
149644]
149645
149646var licensesWithVersions = spdxLicenseIds
149647 .map(function (id) {
149648 var match = /^(.*)-\d+\.\d+$/.exec(id)
149649 return match
149650 ? [match[0], match[1]]
149651 : [id, null]
149652 })
149653 .reduce(function (objectMap, item) {
149654 var key = item[1]
149655 objectMap[key] = objectMap[key] || []
149656 objectMap[key].push(item[0])
149657 return objectMap
149658 }, {})
149659
149660var licensesWithOneVersion = Object.keys(licensesWithVersions)
149661 .map(function makeEntries (key) {
149662 return [key, licensesWithVersions[key]]
149663 })
149664 .filter(function identifySoleVersions (item) {
149665 return (
149666 // Licenses has just one valid version suffix.
149667 item[1].length === 1 &&
149668 item[0] !== null &&
149669 // APL will be considered Apache, rather than APL-1.0
149670 item[0] !== 'APL'
149671 )
149672 })
149673 .map(function createLastResorts (item) {
149674 return [item[0], item[1][0]]
149675 })
149676
149677licensesWithVersions = undefined
149678
149679// If all else fails, guess that strings containing certain substrings
149680// meant to identify certain licenses.
149681var lastResorts = [
149682 ['UNLI', 'Unlicense'],
149683 ['WTF', 'WTFPL'],
149684 ['2 CLAUSE', 'BSD-2-Clause'],
149685 ['2-CLAUSE', 'BSD-2-Clause'],
149686 ['3 CLAUSE', 'BSD-3-Clause'],
149687 ['3-CLAUSE', 'BSD-3-Clause'],
149688 ['AFFERO', 'AGPL-3.0-or-later'],
149689 ['AGPL', 'AGPL-3.0-or-later'],
149690 ['APACHE', 'Apache-2.0'],
149691 ['ARTISTIC', 'Artistic-2.0'],
149692 ['Affero', 'AGPL-3.0-or-later'],
149693 ['BEER', 'Beerware'],
149694 ['BOOST', 'BSL-1.0'],
149695 ['BSD', 'BSD-2-Clause'],
149696 ['CDDL', 'CDDL-1.1'],
149697 ['ECLIPSE', 'EPL-1.0'],
149698 ['FUCK', 'WTFPL'],
149699 ['GNU', 'GPL-3.0-or-later'],
149700 ['LGPL', 'LGPL-3.0-or-later'],
149701 ['GPLV1', 'GPL-1.0-only'],
149702 ['GPLV2', 'GPL-2.0-only'],
149703 ['GPL', 'GPL-3.0-or-later'],
149704 ['MIT +NO-FALSE-ATTRIBS', 'MITNFA'],
149705 ['MIT', 'MIT'],
149706 ['MPL', 'MPL-2.0'],
149707 ['X11', 'X11'],
149708 ['ZLIB', 'Zlib']
149709].concat(licensesWithOneVersion)
149710
149711var SUBSTRING = 0
149712var IDENTIFIER = 1
149713
149714var validTransformation = function (identifier) {
149715 for (var i = 0; i < transforms.length; i++) {
149716 var transformed = transforms[i](identifier).trim()
149717 if (transformed !== identifier && valid(transformed)) {
149718 return transformed
149719 }
149720 }
149721 return null
149722}
149723
149724var validLastResort = function (identifier) {
149725 var upperCased = identifier.toUpperCase()
149726 for (var i = 0; i < lastResorts.length; i++) {
149727 var lastResort = lastResorts[i]
149728 if (upperCased.indexOf(lastResort[SUBSTRING]) > -1) {
149729 return lastResort[IDENTIFIER]
149730 }
149731 }
149732 return null
149733}
149734
149735var anyCorrection = function (identifier, check) {
149736 for (var i = 0; i < transpositions.length; i++) {
149737 var transposition = transpositions[i]
149738 var transposed = transposition[TRANSPOSED]
149739 if (identifier.indexOf(transposed) > -1) {
149740 var corrected = identifier.replace(
149741 transposed,
149742 transposition[CORRECT]
149743 )
149744 var checked = check(corrected)
149745 if (checked !== null) {
149746 return checked
149747 }
149748 }
149749 }
149750 return null
149751}
149752
149753module.exports = function (identifier) {
149754 var validArugment = (
149755 typeof identifier === 'string' &&
149756 identifier.trim().length !== 0
149757 )
149758 if (!validArugment) {
149759 throw Error('Invalid argument. Expected non-empty string.')
149760 }
149761 identifier = identifier.replace(/\+$/, '').trim()
149762 if (valid(identifier)) {
149763 return upgradeGPLs(identifier)
149764 }
149765 var transformed = validTransformation(identifier)
149766 if (transformed !== null) {
149767 return upgradeGPLs(transformed)
149768 }
149769 transformed = anyCorrection(identifier, function (argument) {
149770 if (valid(argument)) {
149771 return argument
149772 }
149773 return validTransformation(argument)
149774 })
149775 if (transformed !== null) {
149776 return upgradeGPLs(transformed)
149777 }
149778 transformed = validLastResort(identifier)
149779 if (transformed !== null) {
149780 return upgradeGPLs(transformed)
149781 }
149782 transformed = anyCorrection(identifier, validLastResort)
149783 if (transformed !== null) {
149784 return upgradeGPLs(transformed)
149785 }
149786 return null
149787}
149788
149789function upgradeGPLs (value) {
149790 if ([
149791 'GPL-1.0', 'LGPL-1.0', 'AGPL-1.0',
149792 'GPL-2.0', 'LGPL-2.0', 'AGPL-2.0',
149793 'LGPL-2.1'
149794 ].indexOf(value) !== -1) {
149795 return value + '-only'
149796 } else if (['GPL-3.0', 'LGPL-3.0', 'AGPL-3.0'].indexOf(value) !== -1) {
149797 return value + '-or-later'
149798 } else {
149799 return value
149800 }
149801}
149802
149803
149804/***/ }),
149805/* 1009 */
149806/***/ (function(module, exports) {
149807
149808module.exports = ["389-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Bison-exception-2.2","Bootloader-exception","CLISP-exception-2.0","Classpath-exception-2.0","DigiRule-FOSS-exception","FLTK-exception","Fawkes-Runtime-exception","Font-exception-2.0","GCC-exception-2.0","GCC-exception-3.1","LZMA-exception","Libtool-exception","Linux-syscall-note","Nokia-Qt-exception-1.1","OCCT-exception-1.0","Qwt-exception-1.0","WxWindows-exception-3.1","eCos-exception-2.0","freertos-exception-2.0","gnu-javamail-exception","i2p-gpl-java-exception","mif-exception","openvpn-openssl-exception","u-boot-exception-2.0"]
149809
149810/***/ }),
149811/* 1010 */
149812/***/ (function(module, exports, __webpack_require__) {
149813
149814"use strict";
149815
149816
149817// The ABNF grammar in the spec is totally ambiguous.
149818//
149819// This parser follows the operator precedence defined in the
149820// `Order of Precedence and Parentheses` section.
149821
149822module.exports = function (tokens) {
149823 var index = 0
149824
149825 function hasMore () {
149826 return index < tokens.length
149827 }
149828
149829 function token () {
149830 return hasMore() ? tokens[index] : null
149831 }
149832
149833 function next () {
149834 if (!hasMore()) {
149835 throw new Error()
149836 }
149837 index++
149838 }
149839
149840 function parseOperator (operator) {
149841 var t = token()
149842 if (t && t.type === 'OPERATOR' && operator === t.string) {
149843 next()
149844 return t.string
149845 }
149846 }
149847
149848 function parseWith () {
149849 if (parseOperator('WITH')) {
149850 var t = token()
149851 if (t && t.type === 'EXCEPTION') {
149852 next()
149853 return t.string
149854 }
149855 throw new Error('Expected exception after `WITH`')
149856 }
149857 }
149858
149859 function parseLicenseRef () {
149860 // TODO: Actually, everything is concatenated into one string
149861 // for backward-compatibility but it could be better to return
149862 // a nice structure.
149863 var begin = index
149864 var string = ''
149865 var t = token()
149866 if (t.type === 'DOCUMENTREF') {
149867 next()
149868 string += 'DocumentRef-' + t.string + ':'
149869 if (!parseOperator(':')) {
149870 throw new Error('Expected `:` after `DocumentRef-...`')
149871 }
149872 }
149873 t = token()
149874 if (t.type === 'LICENSEREF') {
149875 next()
149876 string += 'LicenseRef-' + t.string
149877 return {license: string}
149878 }
149879 index = begin
149880 }
149881
149882 function parseLicense () {
149883 var t = token()
149884 if (t && t.type === 'LICENSE') {
149885 next()
149886 var node = {license: t.string}
149887 if (parseOperator('+')) {
149888 node.plus = true
149889 }
149890 var exception = parseWith()
149891 if (exception) {
149892 node.exception = exception
149893 }
149894 return node
149895 }
149896 }
149897
149898 function parseParenthesizedExpression () {
149899 var left = parseOperator('(')
149900 if (!left) {
149901 return
149902 }
149903
149904 var expr = parseExpression()
149905
149906 if (!parseOperator(')')) {
149907 throw new Error('Expected `)`')
149908 }
149909
149910 return expr
149911 }
149912
149913 function parseAtom () {
149914 return (
149915 parseParenthesizedExpression() ||
149916 parseLicenseRef() ||
149917 parseLicense()
149918 )
149919 }
149920
149921 function makeBinaryOpParser (operator, nextParser) {
149922 return function parseBinaryOp () {
149923 var left = nextParser()
149924 if (!left) {
149925 return
149926 }
149927
149928 if (!parseOperator(operator)) {
149929 return left
149930 }
149931
149932 var right = parseBinaryOp()
149933 if (!right) {
149934 throw new Error('Expected expression')
149935 }
149936 return {
149937 left: left,
149938 conjunction: operator.toLowerCase(),
149939 right: right
149940 }
149941 }
149942 }
149943
149944 var parseAnd = makeBinaryOpParser('AND', parseAtom)
149945 var parseExpression = makeBinaryOpParser('OR', parseAnd)
149946
149947 var node = parseExpression()
149948 if (!node || hasMore()) {
149949 throw new Error('Syntax error')
149950 }
149951 return node
149952}
149953
149954
149955/***/ }),
149956/* 1011 */
149957/***/ (function(module, exports, __webpack_require__) {
149958
149959"use strict";
149960
149961
149962var licenses = []
149963 .concat(__webpack_require__(423))
149964 .concat(__webpack_require__(1012))
149965var exceptions = __webpack_require__(1009)
149966
149967module.exports = function (source) {
149968 var index = 0
149969
149970 function hasMore () {
149971 return index < source.length
149972 }
149973
149974 // `value` can be a regexp or a string.
149975 // If it is recognized, the matching source string is returned and
149976 // the index is incremented. Otherwise `undefined` is returned.
149977 function read (value) {
149978 if (value instanceof RegExp) {
149979 var chars = source.slice(index)
149980 var match = chars.match(value)
149981 if (match) {
149982 index += match[0].length
149983 return match[0]
149984 }
149985 } else {
149986 if (source.indexOf(value, index) === index) {
149987 index += value.length
149988 return value
149989 }
149990 }
149991 }
149992
149993 function skipWhitespace () {
149994 read(/[ ]*/)
149995 }
149996
149997 function operator () {
149998 var string
149999 var possibilities = ['WITH', 'AND', 'OR', '(', ')', ':', '+']
150000 for (var i = 0; i < possibilities.length; i++) {
150001 string = read(possibilities[i])
150002 if (string) {
150003 break
150004 }
150005 }
150006
150007 if (string === '+' && index > 1 && source[index - 2] === ' ') {
150008 throw new Error('Space before `+`')
150009 }
150010
150011 return string && {
150012 type: 'OPERATOR',
150013 string: string
150014 }
150015 }
150016
150017 function idstring () {
150018 return read(/[A-Za-z0-9-.]+/)
150019 }
150020
150021 function expectIdstring () {
150022 var string = idstring()
150023 if (!string) {
150024 throw new Error('Expected idstring at offset ' + index)
150025 }
150026 return string
150027 }
150028
150029 function documentRef () {
150030 if (read('DocumentRef-')) {
150031 var string = expectIdstring()
150032 return {type: 'DOCUMENTREF', string: string}
150033 }
150034 }
150035
150036 function licenseRef () {
150037 if (read('LicenseRef-')) {
150038 var string = expectIdstring()
150039 return {type: 'LICENSEREF', string: string}
150040 }
150041 }
150042
150043 function identifier () {
150044 var begin = index
150045 var string = idstring()
150046
150047 if (licenses.indexOf(string) !== -1) {
150048 return {
150049 type: 'LICENSE',
150050 string: string
150051 }
150052 } else if (exceptions.indexOf(string) !== -1) {
150053 return {
150054 type: 'EXCEPTION',
150055 string: string
150056 }
150057 }
150058
150059 index = begin
150060 }
150061
150062 // Tries to read the next token. Returns `undefined` if no token is
150063 // recognized.
150064 function parseToken () {
150065 // Ordering matters
150066 return (
150067 operator() ||
150068 documentRef() ||
150069 licenseRef() ||
150070 identifier()
150071 )
150072 }
150073
150074 var tokens = []
150075 while (hasMore()) {
150076 skipWhitespace()
150077 if (!hasMore()) {
150078 break
150079 }
150080
150081 var token = parseToken()
150082 if (!token) {
150083 throw new Error('Unexpected `' + source[index] +
150084 '` at offset ' + index)
150085 }
150086
150087 tokens.push(token)
150088 }
150089 return tokens
150090}
150091
150092
150093/***/ }),
150094/* 1012 */
150095/***/ (function(module, exports) {
150096
150097module.exports = ["AGPL-3.0","eCos-2.0","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-2.0-with-GCC-exception","GPL-2.0","GPL-3.0-with-autoconf-exception","GPL-3.0-with-GCC-exception","GPL-3.0","LGPL-2.0","LGPL-2.1","LGPL-3.0","Nunit","StandardML-NJ","wxWindows"]
150098
150099/***/ }),
150100/* 1013 */
150101/***/ (function(module, exports, __webpack_require__) {
150102
150103// Copyright 2017 Joyent, Inc.
150104
150105module.exports = {
150106 read: read,
150107 verify: verify,
150108 sign: sign,
150109 signAsync: signAsync,
150110 write: write,
150111
150112 /* Internal private API */
150113 fromBuffer: fromBuffer,
150114 toBuffer: toBuffer
150115};
150116
150117var assert = __webpack_require__(22);
150118var SSHBuffer = __webpack_require__(147);
150119var crypto = __webpack_require__(21);
150120var Buffer = __webpack_require__(20).Buffer;
150121var algs = __webpack_require__(39);
150122var Key = __webpack_require__(34);
150123var PrivateKey = __webpack_require__(40);
150124var Identity = __webpack_require__(146);
150125var rfc4253 = __webpack_require__(92);
150126var Signature = __webpack_require__(70);
150127var utils = __webpack_require__(32);
150128var Certificate = __webpack_require__(143);
150129
150130function verify(cert, key) {
150131 /*
150132 * We always give an issuerKey, so if our verify() is being called then
150133 * there was no signature. Return false.
150134 */
150135 return (false);
150136}
150137
150138var TYPES = {
150139 'user': 1,
150140 'host': 2
150141};
150142Object.keys(TYPES).forEach(function (k) { TYPES[TYPES[k]] = k; });
150143
150144var ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/;
150145
150146function read(buf, options) {
150147 if (Buffer.isBuffer(buf))
150148 buf = buf.toString('ascii');
150149 var parts = buf.trim().split(/[ \t\n]+/g);
150150 if (parts.length < 2 || parts.length > 3)
150151 throw (new Error('Not a valid SSH certificate line'));
150152
150153 var algo = parts[0];
150154 var data = parts[1];
150155
150156 data = Buffer.from(data, 'base64');
150157 return (fromBuffer(data, algo));
150158}
150159
150160function fromBuffer(data, algo, partial) {
150161 var sshbuf = new SSHBuffer({ buffer: data });
150162 var innerAlgo = sshbuf.readString();
150163 if (algo !== undefined && innerAlgo !== algo)
150164 throw (new Error('SSH certificate algorithm mismatch'));
150165 if (algo === undefined)
150166 algo = innerAlgo;
150167
150168 var cert = {};
150169 cert.signatures = {};
150170 cert.signatures.openssh = {};
150171
150172 cert.signatures.openssh.nonce = sshbuf.readBuffer();
150173
150174 var key = {};
150175 var parts = (key.parts = []);
150176 key.type = getAlg(algo);
150177
150178 var partCount = algs.info[key.type].parts.length;
150179 while (parts.length < partCount)
150180 parts.push(sshbuf.readPart());
150181 assert.ok(parts.length >= 1, 'key must have at least one part');
150182
150183 var algInfo = algs.info[key.type];
150184 if (key.type === 'ecdsa') {
150185 var res = ECDSA_ALGO.exec(algo);
150186 assert.ok(res !== null);
150187 assert.strictEqual(res[1], parts[0].data.toString());
150188 }
150189
150190 for (var i = 0; i < algInfo.parts.length; ++i) {
150191 parts[i].name = algInfo.parts[i];
150192 if (parts[i].name !== 'curve' &&
150193 algInfo.normalize !== false) {
150194 var p = parts[i];
150195 p.data = utils.mpNormalize(p.data);
150196 }
150197 }
150198
150199 cert.subjectKey = new Key(key);
150200
150201 cert.serial = sshbuf.readInt64();
150202
150203 var type = TYPES[sshbuf.readInt()];
150204 assert.string(type, 'valid cert type');
150205
150206 cert.signatures.openssh.keyId = sshbuf.readString();
150207
150208 var principals = [];
150209 var pbuf = sshbuf.readBuffer();
150210 var psshbuf = new SSHBuffer({ buffer: pbuf });
150211 while (!psshbuf.atEnd())
150212 principals.push(psshbuf.readString());
150213 if (principals.length === 0)
150214 principals = ['*'];
150215
150216 cert.subjects = principals.map(function (pr) {
150217 if (type === 'user')
150218 return (Identity.forUser(pr));
150219 else if (type === 'host')
150220 return (Identity.forHost(pr));
150221 throw (new Error('Unknown identity type ' + type));
150222 });
150223
150224 cert.validFrom = int64ToDate(sshbuf.readInt64());
150225 cert.validUntil = int64ToDate(sshbuf.readInt64());
150226
150227 cert.signatures.openssh.critical = sshbuf.readBuffer();
150228 cert.signatures.openssh.exts = sshbuf.readBuffer();
150229
150230 /* reserved */
150231 sshbuf.readBuffer();
150232
150233 var signingKeyBuf = sshbuf.readBuffer();
150234 cert.issuerKey = rfc4253.read(signingKeyBuf);
150235
150236 /*
150237 * OpenSSH certs don't give the identity of the issuer, just their
150238 * public key. So, we use an Identity that matches anything. The
150239 * isSignedBy() function will later tell you if the key matches.
150240 */
150241 cert.issuer = Identity.forHost('**');
150242
150243 var sigBuf = sshbuf.readBuffer();
150244 cert.signatures.openssh.signature =
150245 Signature.parse(sigBuf, cert.issuerKey.type, 'ssh');
150246
150247 if (partial !== undefined) {
150248 partial.remainder = sshbuf.remainder();
150249 partial.consumed = sshbuf._offset;
150250 }
150251
150252 return (new Certificate(cert));
150253}
150254
150255function int64ToDate(buf) {
150256 var i = buf.readUInt32BE(0) * 4294967296;
150257 i += buf.readUInt32BE(4);
150258 var d = new Date();
150259 d.setTime(i * 1000);
150260 d.sourceInt64 = buf;
150261 return (d);
150262}
150263
150264function dateToInt64(date) {
150265 if (date.sourceInt64 !== undefined)
150266 return (date.sourceInt64);
150267 var i = Math.round(date.getTime() / 1000);
150268 var upper = Math.floor(i / 4294967296);
150269 var lower = Math.floor(i % 4294967296);
150270 var buf = Buffer.alloc(8);
150271 buf.writeUInt32BE(upper, 0);
150272 buf.writeUInt32BE(lower, 4);
150273 return (buf);
150274}
150275
150276function sign(cert, key) {
150277 if (cert.signatures.openssh === undefined)
150278 cert.signatures.openssh = {};
150279 try {
150280 var blob = toBuffer(cert, true);
150281 } catch (e) {
150282 delete (cert.signatures.openssh);
150283 return (false);
150284 }
150285 var sig = cert.signatures.openssh;
150286 var hashAlgo = undefined;
150287 if (key.type === 'rsa' || key.type === 'dsa')
150288 hashAlgo = 'sha1';
150289 var signer = key.createSign(hashAlgo);
150290 signer.write(blob);
150291 sig.signature = signer.sign();
150292 return (true);
150293}
150294
150295function signAsync(cert, signer, done) {
150296 if (cert.signatures.openssh === undefined)
150297 cert.signatures.openssh = {};
150298 try {
150299 var blob = toBuffer(cert, true);
150300 } catch (e) {
150301 delete (cert.signatures.openssh);
150302 done(e);
150303 return;
150304 }
150305 var sig = cert.signatures.openssh;
150306
150307 signer(blob, function (err, signature) {
150308 if (err) {
150309 done(err);
150310 return;
150311 }
150312 try {
150313 /*
150314 * This will throw if the signature isn't of a
150315 * type/algo that can be used for SSH.
150316 */
150317 signature.toBuffer('ssh');
150318 } catch (e) {
150319 done(e);
150320 return;
150321 }
150322 sig.signature = signature;
150323 done();
150324 });
150325}
150326
150327function write(cert, options) {
150328 if (options === undefined)
150329 options = {};
150330
150331 var blob = toBuffer(cert);
150332 var out = getCertType(cert.subjectKey) + ' ' + blob.toString('base64');
150333 if (options.comment)
150334 out = out + ' ' + options.comment;
150335 return (out);
150336}
150337
150338
150339function toBuffer(cert, noSig) {
150340 assert.object(cert.signatures.openssh, 'signature for openssh format');
150341 var sig = cert.signatures.openssh;
150342
150343 if (sig.nonce === undefined)
150344 sig.nonce = crypto.randomBytes(16);
150345 var buf = new SSHBuffer({});
150346 buf.writeString(getCertType(cert.subjectKey));
150347 buf.writeBuffer(sig.nonce);
150348
150349 var key = cert.subjectKey;
150350 var algInfo = algs.info[key.type];
150351 algInfo.parts.forEach(function (part) {
150352 buf.writePart(key.part[part]);
150353 });
150354
150355 buf.writeInt64(cert.serial);
150356
150357 var type = cert.subjects[0].type;
150358 assert.notStrictEqual(type, 'unknown');
150359 cert.subjects.forEach(function (id) {
150360 assert.strictEqual(id.type, type);
150361 });
150362 type = TYPES[type];
150363 buf.writeInt(type);
150364
150365 if (sig.keyId === undefined) {
150366 sig.keyId = cert.subjects[0].type + '_' +
150367 (cert.subjects[0].uid || cert.subjects[0].hostname);
150368 }
150369 buf.writeString(sig.keyId);
150370
150371 var sub = new SSHBuffer({});
150372 cert.subjects.forEach(function (id) {
150373 if (type === TYPES.host)
150374 sub.writeString(id.hostname);
150375 else if (type === TYPES.user)
150376 sub.writeString(id.uid);
150377 });
150378 buf.writeBuffer(sub.toBuffer());
150379
150380 buf.writeInt64(dateToInt64(cert.validFrom));
150381 buf.writeInt64(dateToInt64(cert.validUntil));
150382
150383 if (sig.critical === undefined)
150384 sig.critical = Buffer.alloc(0);
150385 buf.writeBuffer(sig.critical);
150386
150387 if (sig.exts === undefined)
150388 sig.exts = Buffer.alloc(0);
150389 buf.writeBuffer(sig.exts);
150390
150391 /* reserved */
150392 buf.writeBuffer(Buffer.alloc(0));
150393
150394 sub = rfc4253.write(cert.issuerKey);
150395 buf.writeBuffer(sub);
150396
150397 if (!noSig)
150398 buf.writeBuffer(sig.signature.toBuffer('ssh'));
150399
150400 return (buf.toBuffer());
150401}
150402
150403function getAlg(certType) {
150404 if (certType === 'ssh-rsa-cert-v01@openssh.com')
150405 return ('rsa');
150406 if (certType === 'ssh-dss-cert-v01@openssh.com')
150407 return ('dsa');
150408 if (certType.match(ECDSA_ALGO))
150409 return ('ecdsa');
150410 if (certType === 'ssh-ed25519-cert-v01@openssh.com')
150411 return ('ed25519');
150412 throw (new Error('Unsupported cert type ' + certType));
150413}
150414
150415function getCertType(key) {
150416 if (key.type === 'rsa')
150417 return ('ssh-rsa-cert-v01@openssh.com');
150418 if (key.type === 'dsa')
150419 return ('ssh-dss-cert-v01@openssh.com');
150420 if (key.type === 'ecdsa')
150421 return ('ecdsa-sha2-' + key.curve + '-cert-v01@openssh.com');
150422 if (key.type === 'ed25519')
150423 return ('ssh-ed25519-cert-v01@openssh.com');
150424 throw (new Error('Unsupported key type ' + key.type));
150425}
150426
150427
150428/***/ }),
150429/* 1014 */
150430/***/ (function(module, exports, __webpack_require__) {
150431
150432// Copyright 2016 Joyent, Inc.
150433
150434var x509 = __webpack_require__(427);
150435
150436module.exports = {
150437 read: read,
150438 verify: x509.verify,
150439 sign: x509.sign,
150440 write: write
150441};
150442
150443var assert = __webpack_require__(22);
150444var asn1 = __webpack_require__(66);
150445var Buffer = __webpack_require__(20).Buffer;
150446var algs = __webpack_require__(39);
150447var utils = __webpack_require__(32);
150448var Key = __webpack_require__(34);
150449var PrivateKey = __webpack_require__(40);
150450var pem = __webpack_require__(82);
150451var Identity = __webpack_require__(146);
150452var Signature = __webpack_require__(70);
150453var Certificate = __webpack_require__(143);
150454
150455function read(buf, options) {
150456 if (typeof (buf) !== 'string') {
150457 assert.buffer(buf, 'buf');
150458 buf = buf.toString('ascii');
150459 }
150460
150461 var lines = buf.trim().split(/[\r\n]+/g);
150462
150463 var m = lines[0].match(/*JSSTYLED*/
150464 /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/);
150465 assert.ok(m, 'invalid PEM header');
150466
150467 var m2 = lines[lines.length - 1].match(/*JSSTYLED*/
150468 /[-]+[ ]*END CERTIFICATE[ ]*[-]+/);
150469 assert.ok(m2, 'invalid PEM footer');
150470
150471 var headers = {};
150472 while (true) {
150473 lines = lines.slice(1);
150474 m = lines[0].match(/*JSSTYLED*/
150475 /^([A-Za-z0-9-]+): (.+)$/);
150476 if (!m)
150477 break;
150478 headers[m[1].toLowerCase()] = m[2];
150479 }
150480
150481 /* Chop off the first and last lines */
150482 lines = lines.slice(0, -1).join('');
150483 buf = Buffer.from(lines, 'base64');
150484
150485 return (x509.read(buf, options));
150486}
150487
150488function write(cert, options) {
150489 var dbuf = x509.write(cert, options);
150490
150491 var header = 'CERTIFICATE';
150492 var tmp = dbuf.toString('base64');
150493 var len = tmp.length + (tmp.length / 64) +
150494 18 + 16 + header.length*2 + 10;
150495 var buf = Buffer.alloc(len);
150496 var o = 0;
150497 o += buf.write('-----BEGIN ' + header + '-----\n', o);
150498 for (var i = 0; i < tmp.length; ) {
150499 var limit = i + 64;
150500 if (limit > tmp.length)
150501 limit = tmp.length;
150502 o += buf.write(tmp.slice(i, limit), o);
150503 buf[o++] = 10;
150504 i = limit;
150505 }
150506 o += buf.write('-----END ' + header + '-----\n', o);
150507
150508 return (buf.slice(0, o));
150509}
150510
150511
150512/***/ }),
150513/* 1015 */
150514/***/ (function(module, exports) {
150515
150516module.exports = shift
150517
150518function shift (stream) {
150519 var rs = stream._readableState
150520 if (!rs) return null
150521 return rs.objectMode ? stream.read() : stream.read(getStateLength(rs))
150522}
150523
150524function getStateLength (state) {
150525 if (state.buffer.length) {
150526 // Since node 6.3.0 state.buffer is a BufferList not an array
150527 if (state.buffer.head) {
150528 return state.buffer.head.data.length
150529 }
150530
150531 return state.buffer[0].length
150532 }
150533
150534 return state.length
150535}
150536
150537
150538/***/ }),
150539/* 1016 */
150540/***/ (function(module, exports, __webpack_require__) {
150541
150542"use strict";
150543
150544module.exports = function (str) {
150545 return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
150546 return '%' + c.charCodeAt(0).toString(16).toUpperCase();
150547 });
150548};
150549
150550
150551/***/ }),
150552/* 1017 */
150553/***/ (function(module, exports, __webpack_require__) {
150554
150555"use strict";
150556
150557var stripAnsi = __webpack_require__(1019);
150558var codePointAt = __webpack_require__(573);
150559var isFullwidthCodePoint = __webpack_require__(1018);
150560
150561// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345
150562module.exports = function (str) {
150563 if (typeof str !== 'string' || str.length === 0) {
150564 return 0;
150565 }
150566
150567 var width = 0;
150568
150569 str = stripAnsi(str);
150570
150571 for (var i = 0; i < str.length; i++) {
150572 var code = codePointAt(str, i);
150573
150574 // ignore control characters
150575 if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) {
150576 continue;
150577 }
150578
150579 // surrogates
150580 if (code >= 0x10000) {
150581 i++;
150582 }
150583
150584 if (isFullwidthCodePoint(code)) {
150585 width += 2;
150586 } else {
150587 width++;
150588 }
150589 }
150590
150591 return width;
150592};
150593
150594
150595/***/ }),
150596/* 1018 */
150597/***/ (function(module, exports, __webpack_require__) {
150598
150599"use strict";
150600
150601var numberIsNan = __webpack_require__(839);
150602
150603module.exports = function (x) {
150604 if (numberIsNan(x)) {
150605 return false;
150606 }
150607
150608 // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369
150609
150610 // code points are derived from:
150611 // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt
150612 if (x >= 0x1100 && (
150613 x <= 0x115f || // Hangul Jamo
150614 0x2329 === x || // LEFT-POINTING ANGLE BRACKET
150615 0x232a === x || // RIGHT-POINTING ANGLE BRACKET
150616 // CJK Radicals Supplement .. Enclosed CJK Letters and Months
150617 (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) ||
150618 // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A
150619 0x3250 <= x && x <= 0x4dbf ||
150620 // CJK Unified Ideographs .. Yi Radicals
150621 0x4e00 <= x && x <= 0xa4c6 ||
150622 // Hangul Jamo Extended-A
150623 0xa960 <= x && x <= 0xa97c ||
150624 // Hangul Syllables
150625 0xac00 <= x && x <= 0xd7a3 ||
150626 // CJK Compatibility Ideographs
150627 0xf900 <= x && x <= 0xfaff ||
150628 // Vertical Forms
150629 0xfe10 <= x && x <= 0xfe19 ||
150630 // CJK Compatibility Forms .. Small Form Variants
150631 0xfe30 <= x && x <= 0xfe6b ||
150632 // Halfwidth and Fullwidth Forms
150633 0xff01 <= x && x <= 0xff60 ||
150634 0xffe0 <= x && x <= 0xffe6 ||
150635 // Kana Supplement
150636 0x1b000 <= x && x <= 0x1b001 ||
150637 // Enclosed Ideographic Supplement
150638 0x1f200 <= x && x <= 0x1f251 ||
150639 // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane
150640 0x20000 <= x && x <= 0x3fffd)) {
150641 return true;
150642 }
150643
150644 return false;
150645}
150646
150647
150648/***/ }),
150649/* 1019 */
150650/***/ (function(module, exports, __webpack_require__) {
150651
150652"use strict";
150653
150654var ansiRegex = __webpack_require__(446)();
150655
150656module.exports = function (str) {
150657 return typeof str === 'string' ? str.replace(ansiRegex, '') : str;
150658};
150659
150660
150661/***/ }),
150662/* 1020 */
150663/***/ (function(module, exports, __webpack_require__) {
150664
150665"use strict";
150666
150667
150668module.exports = () => {
150669 const pattern = [
150670 '[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)',
150671 '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'
150672 ].join('|');
150673
150674 return new RegExp(pattern, 'g');
150675};
150676
150677
150678/***/ }),
150679/* 1021 */
150680/***/ (function(module, exports, __webpack_require__) {
150681
150682"use strict";
150683
150684var hasFlag = __webpack_require__(736);
150685
150686var support = function (level) {
150687 if (level === 0) {
150688 return false;
150689 }
150690
150691 return {
150692 level: level,
150693 hasBasic: true,
150694 has256: level >= 2,
150695 has16m: level >= 3
150696 };
150697};
150698
150699var supportLevel = (function () {
150700 if (hasFlag('no-color') ||
150701 hasFlag('no-colors') ||
150702 hasFlag('color=false')) {
150703 return 0;
150704 }
150705
150706 if (hasFlag('color=16m') ||
150707 hasFlag('color=full') ||
150708 hasFlag('color=truecolor')) {
150709 return 3;
150710 }
150711
150712 if (hasFlag('color=256')) {
150713 return 2;
150714 }
150715
150716 if (hasFlag('color') ||
150717 hasFlag('colors') ||
150718 hasFlag('color=true') ||
150719 hasFlag('color=always')) {
150720 return 1;
150721 }
150722
150723 if (process.stdout && !process.stdout.isTTY) {
150724 return 0;
150725 }
150726
150727 if (process.platform === 'win32') {
150728 return 1;
150729 }
150730
150731 if ('CI' in process.env) {
150732 if ('TRAVIS' in process.env || process.env.CI === 'Travis') {
150733 return 1;
150734 }
150735
150736 return 0;
150737 }
150738
150739 if ('TEAMCITY_VERSION' in process.env) {
150740 return process.env.TEAMCITY_VERSION.match(/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/) === null ? 0 : 1;
150741 }
150742
150743 if (/^(screen|xterm)-256(?:color)?/.test(process.env.TERM)) {
150744 return 2;
150745 }
150746
150747 if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) {
150748 return 1;
150749 }
150750
150751 if ('COLORTERM' in process.env) {
150752 return 1;
150753 }
150754
150755 if (process.env.TERM === 'dumb') {
150756 return 0;
150757 }
150758
150759 return 0;
150760})();
150761
150762if (supportLevel === 0 && 'FORCE_COLOR' in process.env) {
150763 supportLevel = 1;
150764}
150765
150766module.exports = process && support(supportLevel);
150767
150768
150769/***/ }),
150770/* 1022 */
150771/***/ (function(module, exports, __webpack_require__) {
150772
150773var util = __webpack_require__(9)
150774var bl = __webpack_require__(556)
150775var xtend = __webpack_require__(437)
150776var headers = __webpack_require__(430)
150777
150778var Writable = __webpack_require__(91).Writable
150779var PassThrough = __webpack_require__(91).PassThrough
150780
150781var noop = function () {}
150782
150783var overflow = function (size) {
150784 size &= 511
150785 return size && 512 - size
150786}
150787
150788var emptyStream = function (self, offset) {
150789 var s = new Source(self, offset)
150790 s.end()
150791 return s
150792}
150793
150794var mixinPax = function (header, pax) {
150795 if (pax.path) header.name = pax.path
150796 if (pax.linkpath) header.linkname = pax.linkpath
150797 if (pax.size) header.size = parseInt(pax.size, 10)
150798 header.pax = pax
150799 return header
150800}
150801
150802var Source = function (self, offset) {
150803 this._parent = self
150804 this.offset = offset
150805 PassThrough.call(this)
150806}
150807
150808util.inherits(Source, PassThrough)
150809
150810Source.prototype.destroy = function (err) {
150811 this._parent.destroy(err)
150812}
150813
150814var Extract = function (opts) {
150815 if (!(this instanceof Extract)) return new Extract(opts)
150816 Writable.call(this, opts)
150817
150818 opts = opts || {}
150819
150820 this._offset = 0
150821 this._buffer = bl()
150822 this._missing = 0
150823 this._partial = false
150824 this._onparse = noop
150825 this._header = null
150826 this._stream = null
150827 this._overflow = null
150828 this._cb = null
150829 this._locked = false
150830 this._destroyed = false
150831 this._pax = null
150832 this._paxGlobal = null
150833 this._gnuLongPath = null
150834 this._gnuLongLinkPath = null
150835
150836 var self = this
150837 var b = self._buffer
150838
150839 var oncontinue = function () {
150840 self._continue()
150841 }
150842
150843 var onunlock = function (err) {
150844 self._locked = false
150845 if (err) return self.destroy(err)
150846 if (!self._stream) oncontinue()
150847 }
150848
150849 var onstreamend = function () {
150850 self._stream = null
150851 var drain = overflow(self._header.size)
150852 if (drain) self._parse(drain, ondrain)
150853 else self._parse(512, onheader)
150854 if (!self._locked) oncontinue()
150855 }
150856
150857 var ondrain = function () {
150858 self._buffer.consume(overflow(self._header.size))
150859 self._parse(512, onheader)
150860 oncontinue()
150861 }
150862
150863 var onpaxglobalheader = function () {
150864 var size = self._header.size
150865 self._paxGlobal = headers.decodePax(b.slice(0, size))
150866 b.consume(size)
150867 onstreamend()
150868 }
150869
150870 var onpaxheader = function () {
150871 var size = self._header.size
150872 self._pax = headers.decodePax(b.slice(0, size))
150873 if (self._paxGlobal) self._pax = xtend(self._paxGlobal, self._pax)
150874 b.consume(size)
150875 onstreamend()
150876 }
150877
150878 var ongnulongpath = function () {
150879 var size = self._header.size
150880 this._gnuLongPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding)
150881 b.consume(size)
150882 onstreamend()
150883 }
150884
150885 var ongnulonglinkpath = function () {
150886 var size = self._header.size
150887 this._gnuLongLinkPath = headers.decodeLongPath(b.slice(0, size), opts.filenameEncoding)
150888 b.consume(size)
150889 onstreamend()
150890 }
150891
150892 var onheader = function () {
150893 var offset = self._offset
150894 var header
150895 try {
150896 header = self._header = headers.decode(b.slice(0, 512), opts.filenameEncoding)
150897 } catch (err) {
150898 self.emit('error', err)
150899 }
150900 b.consume(512)
150901
150902 if (!header) {
150903 self._parse(512, onheader)
150904 oncontinue()
150905 return
150906 }
150907 if (header.type === 'gnu-long-path') {
150908 self._parse(header.size, ongnulongpath)
150909 oncontinue()
150910 return
150911 }
150912 if (header.type === 'gnu-long-link-path') {
150913 self._parse(header.size, ongnulonglinkpath)
150914 oncontinue()
150915 return
150916 }
150917 if (header.type === 'pax-global-header') {
150918 self._parse(header.size, onpaxglobalheader)
150919 oncontinue()
150920 return
150921 }
150922 if (header.type === 'pax-header') {
150923 self._parse(header.size, onpaxheader)
150924 oncontinue()
150925 return
150926 }
150927
150928 if (self._gnuLongPath) {
150929 header.name = self._gnuLongPath
150930 self._gnuLongPath = null
150931 }
150932
150933 if (self._gnuLongLinkPath) {
150934 header.linkname = self._gnuLongLinkPath
150935 self._gnuLongLinkPath = null
150936 }
150937
150938 if (self._pax) {
150939 self._header = header = mixinPax(header, self._pax)
150940 self._pax = null
150941 }
150942
150943 self._locked = true
150944
150945 if (!header.size || header.type === 'directory') {
150946 self._parse(512, onheader)
150947 self.emit('entry', header, emptyStream(self, offset), onunlock)
150948 return
150949 }
150950
150951 self._stream = new Source(self, offset)
150952
150953 self.emit('entry', header, self._stream, onunlock)
150954 self._parse(header.size, onstreamend)
150955 oncontinue()
150956 }
150957
150958 this._onheader = onheader
150959 this._parse(512, onheader)
150960}
150961
150962util.inherits(Extract, Writable)
150963
150964Extract.prototype.destroy = function (err) {
150965 if (this._destroyed) return
150966 this._destroyed = true
150967
150968 if (err) this.emit('error', err)
150969 this.emit('close')
150970 if (this._stream) this._stream.emit('close')
150971}
150972
150973Extract.prototype._parse = function (size, onparse) {
150974 if (this._destroyed) return
150975 this._offset += size
150976 this._missing = size
150977 if (onparse === this._onheader) this._partial = false
150978 this._onparse = onparse
150979}
150980
150981Extract.prototype._continue = function () {
150982 if (this._destroyed) return
150983 var cb = this._cb
150984 this._cb = noop
150985 if (this._overflow) this._write(this._overflow, undefined, cb)
150986 else cb()
150987}
150988
150989Extract.prototype._write = function (data, enc, cb) {
150990 if (this._destroyed) return
150991
150992 var s = this._stream
150993 var b = this._buffer
150994 var missing = this._missing
150995 if (data.length) this._partial = true
150996
150997 // we do not reach end-of-chunk now. just forward it
150998
150999 if (data.length < missing) {
151000 this._missing -= data.length
151001 this._overflow = null
151002 if (s) return s.write(data, cb)
151003 b.append(data)
151004 return cb()
151005 }
151006
151007 // end-of-chunk. the parser should call cb.
151008
151009 this._cb = cb
151010 this._missing = 0
151011
151012 var overflow = null
151013 if (data.length > missing) {
151014 overflow = data.slice(missing)
151015 data = data.slice(0, missing)
151016 }
151017
151018 if (s) s.end(data)
151019 else b.append(data)
151020
151021 this._overflow = overflow
151022 this._onparse()
151023}
151024
151025Extract.prototype._final = function (cb) {
151026 if (this._partial) return this.destroy(new Error('Unexpected end of data'))
151027 cb()
151028}
151029
151030module.exports = Extract
151031
151032
151033/***/ }),
151034/* 1023 */
151035/***/ (function(module, exports, __webpack_require__) {
151036
151037var constants = __webpack_require__(675)
151038var eos = __webpack_require__(164)
151039var util = __webpack_require__(9)
151040var alloc = __webpack_require__(318)
151041var toBuffer = __webpack_require__(433)
151042
151043var Readable = __webpack_require__(91).Readable
151044var Writable = __webpack_require__(91).Writable
151045var StringDecoder = __webpack_require__(272).StringDecoder
151046
151047var headers = __webpack_require__(430)
151048
151049var DMODE = parseInt('755', 8)
151050var FMODE = parseInt('644', 8)
151051
151052var END_OF_TAR = alloc(1024)
151053
151054var noop = function () {}
151055
151056var overflow = function (self, size) {
151057 size &= 511
151058 if (size) self.push(END_OF_TAR.slice(0, 512 - size))
151059}
151060
151061function modeToType (mode) {
151062 switch (mode & constants.S_IFMT) {
151063 case constants.S_IFBLK: return 'block-device'
151064 case constants.S_IFCHR: return 'character-device'
151065 case constants.S_IFDIR: return 'directory'
151066 case constants.S_IFIFO: return 'fifo'
151067 case constants.S_IFLNK: return 'symlink'
151068 }
151069
151070 return 'file'
151071}
151072
151073var Sink = function (to) {
151074 Writable.call(this)
151075 this.written = 0
151076 this._to = to
151077 this._destroyed = false
151078}
151079
151080util.inherits(Sink, Writable)
151081
151082Sink.prototype._write = function (data, enc, cb) {
151083 this.written += data.length
151084 if (this._to.push(data)) return cb()
151085 this._to._drain = cb
151086}
151087
151088Sink.prototype.destroy = function () {
151089 if (this._destroyed) return
151090 this._destroyed = true
151091 this.emit('close')
151092}
151093
151094var LinkSink = function () {
151095 Writable.call(this)
151096 this.linkname = ''
151097 this._decoder = new StringDecoder('utf-8')
151098 this._destroyed = false
151099}
151100
151101util.inherits(LinkSink, Writable)
151102
151103LinkSink.prototype._write = function (data, enc, cb) {
151104 this.linkname += this._decoder.write(data)
151105 cb()
151106}
151107
151108LinkSink.prototype.destroy = function () {
151109 if (this._destroyed) return
151110 this._destroyed = true
151111 this.emit('close')
151112}
151113
151114var Void = function () {
151115 Writable.call(this)
151116 this._destroyed = false
151117}
151118
151119util.inherits(Void, Writable)
151120
151121Void.prototype._write = function (data, enc, cb) {
151122 cb(new Error('No body allowed for this entry'))
151123}
151124
151125Void.prototype.destroy = function () {
151126 if (this._destroyed) return
151127 this._destroyed = true
151128 this.emit('close')
151129}
151130
151131var Pack = function (opts) {
151132 if (!(this instanceof Pack)) return new Pack(opts)
151133 Readable.call(this, opts)
151134
151135 this._drain = noop
151136 this._finalized = false
151137 this._finalizing = false
151138 this._destroyed = false
151139 this._stream = null
151140}
151141
151142util.inherits(Pack, Readable)
151143
151144Pack.prototype.entry = function (header, buffer, callback) {
151145 if (this._stream) throw new Error('already piping an entry')
151146 if (this._finalized || this._destroyed) return
151147
151148 if (typeof buffer === 'function') {
151149 callback = buffer
151150 buffer = null
151151 }
151152
151153 if (!callback) callback = noop
151154
151155 var self = this
151156
151157 if (!header.size || header.type === 'symlink') header.size = 0
151158 if (!header.type) header.type = modeToType(header.mode)
151159 if (!header.mode) header.mode = header.type === 'directory' ? DMODE : FMODE
151160 if (!header.uid) header.uid = 0
151161 if (!header.gid) header.gid = 0
151162 if (!header.mtime) header.mtime = new Date()
151163
151164 if (typeof buffer === 'string') buffer = toBuffer(buffer)
151165 if (Buffer.isBuffer(buffer)) {
151166 header.size = buffer.length
151167 this._encode(header)
151168 this.push(buffer)
151169 overflow(self, header.size)
151170 process.nextTick(callback)
151171 return new Void()
151172 }
151173
151174 if (header.type === 'symlink' && !header.linkname) {
151175 var linkSink = new LinkSink()
151176 eos(linkSink, function (err) {
151177 if (err) { // stream was closed
151178 self.destroy()
151179 return callback(err)
151180 }
151181
151182 header.linkname = linkSink.linkname
151183 self._encode(header)
151184 callback()
151185 })
151186
151187 return linkSink
151188 }
151189
151190 this._encode(header)
151191
151192 if (header.type !== 'file' && header.type !== 'contiguous-file') {
151193 process.nextTick(callback)
151194 return new Void()
151195 }
151196
151197 var sink = new Sink(this)
151198
151199 this._stream = sink
151200
151201 eos(sink, function (err) {
151202 self._stream = null
151203
151204 if (err) { // stream was closed
151205 self.destroy()
151206 return callback(err)
151207 }
151208
151209 if (sink.written !== header.size) { // corrupting tar
151210 self.destroy()
151211 return callback(new Error('size mismatch'))
151212 }
151213
151214 overflow(self, header.size)
151215 if (self._finalizing) self.finalize()
151216 callback()
151217 })
151218
151219 return sink
151220}
151221
151222Pack.prototype.finalize = function () {
151223 if (this._stream) {
151224 this._finalizing = true
151225 return
151226 }
151227
151228 if (this._finalized) return
151229 this._finalized = true
151230 this.push(END_OF_TAR)
151231 this.push(null)
151232}
151233
151234Pack.prototype.destroy = function (err) {
151235 if (this._destroyed) return
151236 this._destroyed = true
151237
151238 if (err) this.emit('error', err)
151239 this.emit('close')
151240 if (this._stream && this._stream.destroy) this._stream.destroy()
151241}
151242
151243Pack.prototype._encode = function (header) {
151244 if (!header.pax) {
151245 var buf = headers.encode(header)
151246 if (buf) {
151247 this.push(buf)
151248 return
151249 }
151250 }
151251 this._encodePax(header)
151252}
151253
151254Pack.prototype._encodePax = function (header) {
151255 var paxHeader = headers.encodePax({
151256 name: header.name,
151257 linkname: header.linkname,
151258 pax: header.pax
151259 })
151260
151261 var newHeader = {
151262 name: 'PaxHeader',
151263 mode: header.mode,
151264 uid: header.uid,
151265 gid: header.gid,
151266 size: paxHeader.length,
151267 mtime: header.mtime,
151268 type: 'pax-header',
151269 linkname: header.linkname && 'PaxHeader',
151270 uname: header.uname,
151271 gname: header.gname,
151272 devmajor: header.devmajor,
151273 devminor: header.devminor
151274 }
151275
151276 this.push(headers.encode(newHeader))
151277 this.push(paxHeader)
151278 overflow(this, paxHeader.length)
151279
151280 newHeader.size = header.size
151281 newHeader.type = header.type
151282 this.push(headers.encode(newHeader))
151283}
151284
151285Pack.prototype._read = function (n) {
151286 var drain = this._drain
151287 this._drain = noop
151288 drain()
151289}
151290
151291module.exports = Pack
151292
151293
151294/***/ }),
151295/* 1024 */
151296/***/ (function(module, exports, __webpack_require__) {
151297
151298
151299var thenify = __webpack_require__(1025)
151300
151301module.exports = thenifyAll
151302thenifyAll.withCallback = withCallback
151303thenifyAll.thenify = thenify
151304
151305/**
151306 * Promisifies all the selected functions in an object.
151307 *
151308 * @param {Object} source the source object for the async functions
151309 * @param {Object} [destination] the destination to set all the promisified methods
151310 * @param {Array} [methods] an array of method names of `source`
151311 * @return {Object}
151312 * @api public
151313 */
151314
151315function thenifyAll(source, destination, methods) {
151316 return promisifyAll(source, destination, methods, thenify)
151317}
151318
151319/**
151320 * Promisifies all the selected functions in an object and backward compatible with callback.
151321 *
151322 * @param {Object} source the source object for the async functions
151323 * @param {Object} [destination] the destination to set all the promisified methods
151324 * @param {Array} [methods] an array of method names of `source`
151325 * @return {Object}
151326 * @api public
151327 */
151328
151329function withCallback(source, destination, methods) {
151330 return promisifyAll(source, destination, methods, thenify.withCallback)
151331}
151332
151333function promisifyAll(source, destination, methods, promisify) {
151334 if (!destination) {
151335 destination = {};
151336 methods = Object.keys(source)
151337 }
151338
151339 if (Array.isArray(destination)) {
151340 methods = destination
151341 destination = {}
151342 }
151343
151344 if (!methods) {
151345 methods = Object.keys(source)
151346 }
151347
151348 if (typeof source === 'function') destination = promisify(source)
151349
151350 methods.forEach(function (name) {
151351 // promisify only if it's a function
151352 if (typeof source[name] === 'function') destination[name] = promisify(source[name])
151353 })
151354
151355 // proxy the rest
151356 Object.keys(source).forEach(function (name) {
151357 if (deprecated(source, name)) return
151358 if (destination[name]) return
151359 destination[name] = source[name]
151360 })
151361
151362 return destination
151363}
151364
151365function deprecated(source, name) {
151366 var desc = Object.getOwnPropertyDescriptor(source, name)
151367 if (!desc || !desc.get) return false
151368 if (desc.get.name === 'deprecated') return true
151369 return false
151370}
151371
151372
151373/***/ }),
151374/* 1025 */
151375/***/ (function(module, exports, __webpack_require__) {
151376
151377
151378var Promise = __webpack_require__(278)
151379var assert = __webpack_require__(50)
151380
151381module.exports = thenify
151382
151383/**
151384 * Turn async functions into promises
151385 *
151386 * @param {Function} $$__fn__$$
151387 * @return {Function}
151388 * @api public
151389 */
151390
151391function thenify($$__fn__$$, options) {
151392 assert(typeof $$__fn__$$ === 'function')
151393 return eval(createWrapper($$__fn__$$.name, options))
151394}
151395
151396/**
151397 * Turn async functions into promises and backward compatible with callback
151398 *
151399 * @param {Function} $$__fn__$$
151400 * @return {Function}
151401 * @api public
151402 */
151403
151404thenify.withCallback = function ($$__fn__$$, options) {
151405 assert(typeof $$__fn__$$ === 'function')
151406 options = options || {}
151407 options.withCallback = true
151408 if (options.multiArgs === undefined) options.multiArgs = true
151409 return eval(createWrapper($$__fn__$$.name, options))
151410}
151411
151412function createCallback(resolve, reject, multiArgs) {
151413 return function(err, value) {
151414 if (err) return reject(err)
151415 var length = arguments.length
151416
151417 if (length <= 2 || !multiArgs) return resolve(value)
151418
151419 if (Array.isArray(multiArgs)) {
151420 var values = {}
151421 for (var i = 1; i < length; i++) values[multiArgs[i - 1]] = arguments[i]
151422 return resolve(values)
151423 }
151424
151425 var values = new Array(length - 1)
151426 for (var i = 1; i < length; ++i) values[i - 1] = arguments[i]
151427 resolve(values)
151428 }
151429}
151430
151431function createWrapper(name, options) {
151432 name = (name || '').replace(/\s|bound(?!$)/g, '')
151433 options = options || {}
151434 // default to true
151435 var multiArgs = options.multiArgs !== undefined ? options.multiArgs : true
151436 multiArgs = 'var multiArgs = ' + JSON.stringify(multiArgs) + '\n'
151437
151438 var withCallback = options.withCallback ?
151439 'var lastType = typeof arguments[len - 1]\n'
151440 + 'if (lastType === "function") return $$__fn__$$.apply(self, arguments)\n'
151441 : ''
151442
151443 return '(function ' + name + '() {\n'
151444 + 'var self = this\n'
151445 + 'var len = arguments.length\n'
151446 + multiArgs
151447 + withCallback
151448 + 'var args = new Array(len + 1)\n'
151449 + 'for (var i = 0; i < len; ++i) args[i] = arguments[i]\n'
151450 + 'var lastIndex = i\n'
151451 + 'return new Promise(function (resolve, reject) {\n'
151452 + 'args[lastIndex] = createCallback(resolve, reject, multiArgs)\n'
151453 + '$$__fn__$$.apply(self, args)\n'
151454 + '})\n'
151455 + '})'
151456}
151457
151458
151459/***/ }),
151460/* 1026 */
151461/***/ (function(module, exports, __webpack_require__) {
151462
151463var Stream = __webpack_require__(35)
151464
151465// through
151466//
151467// a stream that does nothing but re-emit the input.
151468// useful for aggregating a series of changing but not ending streams into one stream)
151469
151470exports = module.exports = through
151471through.through = through
151472
151473//create a readable writable stream.
151474
151475function through (write, end, opts) {
151476 write = write || function (data) { this.queue(data) }
151477 end = end || function () { this.queue(null) }
151478
151479 var ended = false, destroyed = false, buffer = [], _ended = false
151480 var stream = new Stream()
151481 stream.readable = stream.writable = true
151482 stream.paused = false
151483
151484// stream.autoPause = !(opts && opts.autoPause === false)
151485 stream.autoDestroy = !(opts && opts.autoDestroy === false)
151486
151487 stream.write = function (data) {
151488 write.call(this, data)
151489 return !stream.paused
151490 }
151491
151492 function drain() {
151493 while(buffer.length && !stream.paused) {
151494 var data = buffer.shift()
151495 if(null === data)
151496 return stream.emit('end')
151497 else
151498 stream.emit('data', data)
151499 }
151500 }
151501
151502 stream.queue = stream.push = function (data) {
151503// console.error(ended)
151504 if(_ended) return stream
151505 if(data === null) _ended = true
151506 buffer.push(data)
151507 drain()
151508 return stream
151509 }
151510
151511 //this will be registered as the first 'end' listener
151512 //must call destroy next tick, to make sure we're after any
151513 //stream piped from here.
151514 //this is only a problem if end is not emitted synchronously.
151515 //a nicer way to do this is to make sure this is the last listener for 'end'
151516
151517 stream.on('end', function () {
151518 stream.readable = false
151519 if(!stream.writable && stream.autoDestroy)
151520 process.nextTick(function () {
151521 stream.destroy()
151522 })
151523 })
151524
151525 function _end () {
151526 stream.writable = false
151527 end.call(stream)
151528 if(!stream.readable && stream.autoDestroy)
151529 stream.destroy()
151530 }
151531
151532 stream.end = function (data) {
151533 if(ended) return
151534 ended = true
151535 if(arguments.length) stream.write(data)
151536 _end() // will emit or queue
151537 return stream
151538 }
151539
151540 stream.destroy = function () {
151541 if(destroyed) return
151542 destroyed = true
151543 ended = true
151544 buffer.length = 0
151545 stream.writable = stream.readable = false
151546 stream.emit('close')
151547 return stream
151548 }
151549
151550 stream.pause = function () {
151551 if(stream.paused) return
151552 stream.paused = true
151553 return stream
151554 }
151555
151556 stream.resume = function () {
151557 if(stream.paused) {
151558 stream.paused = false
151559 stream.emit('resume')
151560 }
151561 drain()
151562 //may have become paused again,
151563 //as drain emits 'data'.
151564 if(!stream.paused)
151565 stream.emit('drain')
151566 return stream
151567 }
151568 return stream
151569}
151570
151571
151572
151573/***/ }),
151574/* 1027 */
151575/***/ (function(module, exports, __webpack_require__) {
151576
151577/*!
151578 * Tmp
151579 *
151580 * Copyright (c) 2011-2017 KARASZI Istvan <github@spam.raszi.hu>
151581 *
151582 * MIT Licensed
151583 */
151584
151585/*
151586 * Module dependencies.
151587 */
151588const fs = __webpack_require__(12);
151589const path = __webpack_require__(1);
151590const crypto = __webpack_require__(21);
151591const osTmpDir = __webpack_require__(844);
151592const _c = process.binding('constants');
151593
151594/*
151595 * The working inner variables.
151596 */
151597const
151598 /**
151599 * The temporary directory.
151600 * @type {string}
151601 */
151602 tmpDir = osTmpDir(),
151603
151604 // the random characters to choose from
151605 RANDOM_CHARS = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz',
151606
151607 TEMPLATE_PATTERN = /XXXXXX/,
151608
151609 DEFAULT_TRIES = 3,
151610
151611 CREATE_FLAGS = (_c.O_CREAT || _c.fs.O_CREAT) | (_c.O_EXCL || _c.fs.O_EXCL) | (_c.O_RDWR || _c.fs.O_RDWR),
151612
151613 EBADF = _c.EBADF || _c.os.errno.EBADF,
151614 ENOENT = _c.ENOENT || _c.os.errno.ENOENT,
151615
151616 DIR_MODE = 448 /* 0o700 */,
151617 FILE_MODE = 384 /* 0o600 */,
151618
151619 // this will hold the objects need to be removed on exit
151620 _removeObjects = [];
151621
151622var
151623 _gracefulCleanup = false,
151624 _uncaughtException = false;
151625
151626/**
151627 * Random name generator based on crypto.
151628 * Adapted from http://blog.tompawlak.org/how-to-generate-random-values-nodejs-javascript
151629 *
151630 * @param {number} howMany
151631 * @returns {string} the generated random name
151632 * @private
151633 */
151634function _randomChars(howMany) {
151635 var
151636 value = [],
151637 rnd = null;
151638
151639 // make sure that we do not fail because we ran out of entropy
151640 try {
151641 rnd = crypto.randomBytes(howMany);
151642 } catch (e) {
151643 rnd = crypto.pseudoRandomBytes(howMany);
151644 }
151645
151646 for (var i = 0; i < howMany; i++) {
151647 value.push(RANDOM_CHARS[rnd[i] % RANDOM_CHARS.length]);
151648 }
151649
151650 return value.join('');
151651}
151652
151653/**
151654 * Checks whether the `obj` parameter is defined or not.
151655 *
151656 * @param {Object} obj
151657 * @returns {boolean} true if the object is undefined
151658 * @private
151659 */
151660function _isUndefined(obj) {
151661 return typeof obj === 'undefined';
151662}
151663
151664/**
151665 * Parses the function arguments.
151666 *
151667 * This function helps to have optional arguments.
151668 *
151669 * @param {(Options|Function)} options
151670 * @param {Function} callback
151671 * @returns {Array} parsed arguments
151672 * @private
151673 */
151674function _parseArguments(options, callback) {
151675 if (typeof options == 'function') {
151676 return [callback || {}, options];
151677 }
151678
151679 if (_isUndefined(options)) {
151680 return [{}, callback];
151681 }
151682
151683 return [options, callback];
151684}
151685
151686/**
151687 * Generates a new temporary name.
151688 *
151689 * @param {Object} opts
151690 * @returns {string} the new random name according to opts
151691 * @private
151692 */
151693function _generateTmpName(opts) {
151694 if (opts.name) {
151695 return path.join(opts.dir || tmpDir, opts.name);
151696 }
151697
151698 // mkstemps like template
151699 if (opts.template) {
151700 return opts.template.replace(TEMPLATE_PATTERN, _randomChars(6));
151701 }
151702
151703 // prefix and postfix
151704 const name = [
151705 opts.prefix || 'tmp-',
151706 process.pid,
151707 _randomChars(12),
151708 opts.postfix || ''
151709 ].join('');
151710
151711 return path.join(opts.dir || tmpDir, name);
151712}
151713
151714/**
151715 * Gets a temporary file name.
151716 *
151717 * @param {(Options|tmpNameCallback)} options options or callback
151718 * @param {?tmpNameCallback} callback the callback function
151719 */
151720function tmpName(options, callback) {
151721 var
151722 args = _parseArguments(options, callback),
151723 opts = args[0],
151724 cb = args[1],
151725 tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES;
151726
151727 if (isNaN(tries) || tries < 0)
151728 return cb(new Error('Invalid tries'));
151729
151730 if (opts.template && !opts.template.match(TEMPLATE_PATTERN))
151731 return cb(new Error('Invalid template provided'));
151732
151733 (function _getUniqueName() {
151734 const name = _generateTmpName(opts);
151735
151736 // check whether the path exists then retry if needed
151737 fs.stat(name, function (err) {
151738 if (!err) {
151739 if (tries-- > 0) return _getUniqueName();
151740
151741 return cb(new Error('Could not get a unique tmp filename, max tries reached ' + name));
151742 }
151743
151744 cb(null, name);
151745 });
151746 }());
151747}
151748
151749/**
151750 * Synchronous version of tmpName.
151751 *
151752 * @param {Object} options
151753 * @returns {string} the generated random name
151754 * @throws {Error} if the options are invalid or could not generate a filename
151755 */
151756function tmpNameSync(options) {
151757 var
151758 args = _parseArguments(options),
151759 opts = args[0],
151760 tries = opts.name ? 1 : opts.tries || DEFAULT_TRIES;
151761
151762 if (isNaN(tries) || tries < 0)
151763 throw new Error('Invalid tries');
151764
151765 if (opts.template && !opts.template.match(TEMPLATE_PATTERN))
151766 throw new Error('Invalid template provided');
151767
151768 do {
151769 const name = _generateTmpName(opts);
151770 try {
151771 fs.statSync(name);
151772 } catch (e) {
151773 return name;
151774 }
151775 } while (tries-- > 0);
151776
151777 throw new Error('Could not get a unique tmp filename, max tries reached');
151778}
151779
151780/**
151781 * Creates and opens a temporary file.
151782 *
151783 * @param {(Options|fileCallback)} options the config options or the callback function
151784 * @param {?fileCallback} callback
151785 */
151786function file(options, callback) {
151787 var
151788 args = _parseArguments(options, callback),
151789 opts = args[0],
151790 cb = args[1];
151791
151792 opts.postfix = (_isUndefined(opts.postfix)) ? '.tmp' : opts.postfix;
151793
151794 // gets a temporary filename
151795 tmpName(opts, function _tmpNameCreated(err, name) {
151796 if (err) return cb(err);
151797
151798 // create and open the file
151799 fs.open(name, CREATE_FLAGS, opts.mode || FILE_MODE, function _fileCreated(err, fd) {
151800 if (err) return cb(err);
151801
151802 if (opts.discardDescriptor) {
151803 return fs.close(fd, function _discardCallback(err) {
151804 if (err) {
151805 // Low probability, and the file exists, so this could be
151806 // ignored. If it isn't we certainly need to unlink the
151807 // file, and if that fails too its error is more
151808 // important.
151809 try {
151810 fs.unlinkSync(name);
151811 } catch (e) {
151812 if (!isENOENT(e)) {
151813 err = e;
151814 }
151815 }
151816 return cb(err);
151817 }
151818 cb(null, name, undefined, _prepareTmpFileRemoveCallback(name, -1, opts));
151819 });
151820 }
151821 if (opts.detachDescriptor) {
151822 return cb(null, name, fd, _prepareTmpFileRemoveCallback(name, -1, opts));
151823 }
151824 cb(null, name, fd, _prepareTmpFileRemoveCallback(name, fd, opts));
151825 });
151826 });
151827}
151828
151829/**
151830 * Synchronous version of file.
151831 *
151832 * @param {Options} options
151833 * @returns {FileSyncObject} object consists of name, fd and removeCallback
151834 * @throws {Error} if cannot create a file
151835 */
151836function fileSync(options) {
151837 var
151838 args = _parseArguments(options),
151839 opts = args[0];
151840
151841 opts.postfix = opts.postfix || '.tmp';
151842
151843 const discardOrDetachDescriptor = opts.discardDescriptor || opts.detachDescriptor;
151844 const name = tmpNameSync(opts);
151845 var fd = fs.openSync(name, CREATE_FLAGS, opts.mode || FILE_MODE);
151846 if (opts.discardDescriptor) {
151847 fs.closeSync(fd);
151848 fd = undefined;
151849 }
151850
151851 return {
151852 name: name,
151853 fd: fd,
151854 removeCallback: _prepareTmpFileRemoveCallback(name, discardOrDetachDescriptor ? -1 : fd, opts)
151855 };
151856}
151857
151858/**
151859 * Removes files and folders in a directory recursively.
151860 *
151861 * @param {string} root
151862 * @private
151863 */
151864function _rmdirRecursiveSync(root) {
151865 const dirs = [root];
151866
151867 do {
151868 var
151869 dir = dirs.pop(),
151870 deferred = false,
151871 files = fs.readdirSync(dir);
151872
151873 for (var i = 0, length = files.length; i < length; i++) {
151874 var
151875 file = path.join(dir, files[i]),
151876 stat = fs.lstatSync(file); // lstat so we don't recurse into symlinked directories
151877
151878 if (stat.isDirectory()) {
151879 if (!deferred) {
151880 deferred = true;
151881 dirs.push(dir);
151882 }
151883 dirs.push(file);
151884 } else {
151885 fs.unlinkSync(file);
151886 }
151887 }
151888
151889 if (!deferred) {
151890 fs.rmdirSync(dir);
151891 }
151892 } while (dirs.length !== 0);
151893}
151894
151895/**
151896 * Creates a temporary directory.
151897 *
151898 * @param {(Options|dirCallback)} options the options or the callback function
151899 * @param {?dirCallback} callback
151900 */
151901function dir(options, callback) {
151902 var
151903 args = _parseArguments(options, callback),
151904 opts = args[0],
151905 cb = args[1];
151906
151907 // gets a temporary filename
151908 tmpName(opts, function _tmpNameCreated(err, name) {
151909 if (err) return cb(err);
151910
151911 // create the directory
151912 fs.mkdir(name, opts.mode || DIR_MODE, function _dirCreated(err) {
151913 if (err) return cb(err);
151914
151915 cb(null, name, _prepareTmpDirRemoveCallback(name, opts));
151916 });
151917 });
151918}
151919
151920/**
151921 * Synchronous version of dir.
151922 *
151923 * @param {Options} options
151924 * @returns {DirSyncObject} object consists of name and removeCallback
151925 * @throws {Error} if it cannot create a directory
151926 */
151927function dirSync(options) {
151928 var
151929 args = _parseArguments(options),
151930 opts = args[0];
151931
151932 const name = tmpNameSync(opts);
151933 fs.mkdirSync(name, opts.mode || DIR_MODE);
151934
151935 return {
151936 name: name,
151937 removeCallback: _prepareTmpDirRemoveCallback(name, opts)
151938 };
151939}
151940
151941/**
151942 * Prepares the callback for removal of the temporary file.
151943 *
151944 * @param {string} name the path of the file
151945 * @param {number} fd file descriptor
151946 * @param {Object} opts
151947 * @returns {fileCallback}
151948 * @private
151949 */
151950function _prepareTmpFileRemoveCallback(name, fd, opts) {
151951 const removeCallback = _prepareRemoveCallback(function _removeCallback(fdPath) {
151952 try {
151953 if (0 <= fdPath[0]) {
151954 fs.closeSync(fdPath[0]);
151955 }
151956 }
151957 catch (e) {
151958 // under some node/windows related circumstances, a temporary file
151959 // may have not be created as expected or the file was already closed
151960 // by the user, in which case we will simply ignore the error
151961 if (!isEBADF(e) && !isENOENT(e)) {
151962 // reraise any unanticipated error
151963 throw e;
151964 }
151965 }
151966 try {
151967 fs.unlinkSync(fdPath[1]);
151968 }
151969 catch (e) {
151970 if (!isENOENT(e)) {
151971 // reraise any unanticipated error
151972 throw e;
151973 }
151974 }
151975 }, [fd, name]);
151976
151977 if (!opts.keep) {
151978 _removeObjects.unshift(removeCallback);
151979 }
151980
151981 return removeCallback;
151982}
151983
151984/**
151985 * Prepares the callback for removal of the temporary directory.
151986 *
151987 * @param {string} name
151988 * @param {Object} opts
151989 * @returns {Function} the callback
151990 * @private
151991 */
151992function _prepareTmpDirRemoveCallback(name, opts) {
151993 const removeFunction = opts.unsafeCleanup ? _rmdirRecursiveSync : fs.rmdirSync.bind(fs);
151994 const removeCallback = _prepareRemoveCallback(removeFunction, name);
151995
151996 if (!opts.keep) {
151997 _removeObjects.unshift(removeCallback);
151998 }
151999
152000 return removeCallback;
152001}
152002
152003/**
152004 * Creates a guarded function wrapping the removeFunction call.
152005 *
152006 * @param {Function} removeFunction
152007 * @param {Object} arg
152008 * @returns {Function}
152009 * @private
152010 */
152011function _prepareRemoveCallback(removeFunction, arg) {
152012 var called = false;
152013
152014 return function _cleanupCallback(next) {
152015 if (!called) {
152016 const index = _removeObjects.indexOf(_cleanupCallback);
152017 if (index >= 0) {
152018 _removeObjects.splice(index, 1);
152019 }
152020
152021 called = true;
152022 removeFunction(arg);
152023 }
152024
152025 if (next) next(null);
152026 };
152027}
152028
152029/**
152030 * The garbage collector.
152031 *
152032 * @private
152033 */
152034function _garbageCollector() {
152035 if (_uncaughtException && !_gracefulCleanup) {
152036 return;
152037 }
152038
152039 // the function being called removes itself from _removeObjects,
152040 // loop until _removeObjects is empty
152041 while (_removeObjects.length) {
152042 try {
152043 _removeObjects[0].call(null);
152044 } catch (e) {
152045 // already removed?
152046 }
152047 }
152048}
152049
152050/**
152051 * Helper for testing against EBADF to compensate changes made to Node 7.x under Windows.
152052 */
152053function isEBADF(error) {
152054 return isExpectedError(error, -EBADF, 'EBADF');
152055}
152056
152057/**
152058 * Helper for testing against ENOENT to compensate changes made to Node 7.x under Windows.
152059 */
152060function isENOENT(error) {
152061 return isExpectedError(error, -ENOENT, 'ENOENT');
152062}
152063
152064/**
152065 * Helper to determine whether the expected error code matches the actual code and errno,
152066 * which will differ between the supported node versions.
152067 *
152068 * - Node >= 7.0:
152069 * error.code {String}
152070 * error.errno {String|Number} any numerical value will be negated
152071 *
152072 * - Node >= 6.0 < 7.0:
152073 * error.code {String}
152074 * error.errno {Number} negated
152075 *
152076 * - Node >= 4.0 < 6.0: introduces SystemError
152077 * error.code {String}
152078 * error.errno {Number} negated
152079 *
152080 * - Node >= 0.10 < 4.0:
152081 * error.code {Number} negated
152082 * error.errno n/a
152083 */
152084function isExpectedError(error, code, errno) {
152085 return error.code == code || error.code == errno;
152086}
152087
152088/**
152089 * Sets the graceful cleanup.
152090 *
152091 * Also removes the created files and directories when an uncaught exception occurs.
152092 */
152093function setGracefulCleanup() {
152094 _gracefulCleanup = true;
152095}
152096
152097const version = process.versions.node.split('.').map(function (value) {
152098 return parseInt(value, 10);
152099});
152100
152101if (version[0] === 0 && (version[1] < 9 || version[1] === 9 && version[2] < 5)) {
152102 process.addListener('uncaughtException', function _uncaughtExceptionThrown(err) {
152103 _uncaughtException = true;
152104 _garbageCollector();
152105
152106 throw err;
152107 });
152108}
152109
152110process.addListener('exit', function _exit(code) {
152111 if (code) _uncaughtException = true;
152112 _garbageCollector();
152113});
152114
152115/**
152116 * Configuration options.
152117 *
152118 * @typedef {Object} Options
152119 * @property {?number} tries the number of tries before give up the name generation
152120 * @property {?string} template the "mkstemp" like filename template
152121 * @property {?string} name fix name
152122 * @property {?string} dir the tmp directory to use
152123 * @property {?string} prefix prefix for the generated name
152124 * @property {?string} postfix postfix for the generated name
152125 */
152126
152127/**
152128 * @typedef {Object} FileSyncObject
152129 * @property {string} name the name of the file
152130 * @property {string} fd the file descriptor
152131 * @property {fileCallback} removeCallback the callback function to remove the file
152132 */
152133
152134/**
152135 * @typedef {Object} DirSyncObject
152136 * @property {string} name the name of the directory
152137 * @property {fileCallback} removeCallback the callback function to remove the directory
152138 */
152139
152140/**
152141 * @callback tmpNameCallback
152142 * @param {?Error} err the error object if anything goes wrong
152143 * @param {string} name the temporary file name
152144 */
152145
152146/**
152147 * @callback fileCallback
152148 * @param {?Error} err the error object if anything goes wrong
152149 * @param {string} name the temporary file name
152150 * @param {number} fd the file descriptor
152151 * @param {cleanupCallback} fn the cleanup callback function
152152 */
152153
152154/**
152155 * @callback dirCallback
152156 * @param {?Error} err the error object if anything goes wrong
152157 * @param {string} name the temporary file name
152158 * @param {cleanupCallback} fn the cleanup callback function
152159 */
152160
152161/**
152162 * Removes the temporary created file or directory.
152163 *
152164 * @callback cleanupCallback
152165 * @param {simpleCallback} [next] function to call after entry was removed
152166 */
152167
152168/**
152169 * Callback function for function composition.
152170 * @see {@link https://github.com/raszi/node-tmp/issues/57|raszi/node-tmp#57}
152171 *
152172 * @callback simpleCallback
152173 */
152174
152175// exporting all the needed methods
152176module.exports.tmpdir = tmpDir;
152177
152178module.exports.dir = dir;
152179module.exports.dirSync = dirSync;
152180
152181module.exports.file = file;
152182module.exports.fileSync = fileSync;
152183
152184module.exports.tmpName = tmpName;
152185module.exports.tmpNameSync = tmpNameSync;
152186
152187module.exports.setGracefulCleanup = setGracefulCleanup;
152188
152189
152190/***/ }),
152191/* 1028 */
152192/***/ (function(module, exports, __webpack_require__) {
152193
152194"use strict";
152195
152196
152197var net = __webpack_require__(151)
152198 , tls = __webpack_require__(440)
152199 , http = __webpack_require__(83)
152200 , https = __webpack_require__(185)
152201 , events = __webpack_require__(95)
152202 , assert = __webpack_require__(50)
152203 , util = __webpack_require__(9)
152204 , Buffer = __webpack_require__(60).Buffer
152205 ;
152206
152207exports.httpOverHttp = httpOverHttp
152208exports.httpsOverHttp = httpsOverHttp
152209exports.httpOverHttps = httpOverHttps
152210exports.httpsOverHttps = httpsOverHttps
152211
152212
152213function httpOverHttp(options) {
152214 var agent = new TunnelingAgent(options)
152215 agent.request = http.request
152216 return agent
152217}
152218
152219function httpsOverHttp(options) {
152220 var agent = new TunnelingAgent(options)
152221 agent.request = http.request
152222 agent.createSocket = createSecureSocket
152223 agent.defaultPort = 443
152224 return agent
152225}
152226
152227function httpOverHttps(options) {
152228 var agent = new TunnelingAgent(options)
152229 agent.request = https.request
152230 return agent
152231}
152232
152233function httpsOverHttps(options) {
152234 var agent = new TunnelingAgent(options)
152235 agent.request = https.request
152236 agent.createSocket = createSecureSocket
152237 agent.defaultPort = 443
152238 return agent
152239}
152240
152241
152242function TunnelingAgent(options) {
152243 var self = this
152244 self.options = options || {}
152245 self.proxyOptions = self.options.proxy || {}
152246 self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets
152247 self.requests = []
152248 self.sockets = []
152249
152250 self.on('free', function onFree(socket, host, port) {
152251 for (var i = 0, len = self.requests.length; i < len; ++i) {
152252 var pending = self.requests[i]
152253 if (pending.host === host && pending.port === port) {
152254 // Detect the request to connect same origin server,
152255 // reuse the connection.
152256 self.requests.splice(i, 1)
152257 pending.request.onSocket(socket)
152258 return
152259 }
152260 }
152261 socket.destroy()
152262 self.removeSocket(socket)
152263 })
152264}
152265util.inherits(TunnelingAgent, events.EventEmitter)
152266
152267TunnelingAgent.prototype.addRequest = function addRequest(req, options) {
152268 var self = this
152269
152270 // Legacy API: addRequest(req, host, port, path)
152271 if (typeof options === 'string') {
152272 options = {
152273 host: options,
152274 port: arguments[2],
152275 path: arguments[3]
152276 };
152277 }
152278
152279 if (self.sockets.length >= this.maxSockets) {
152280 // We are over limit so we'll add it to the queue.
152281 self.requests.push({host: options.host, port: options.port, request: req})
152282 return
152283 }
152284
152285 // If we are under maxSockets create a new one.
152286 self.createConnection({host: options.host, port: options.port, request: req})
152287}
152288
152289TunnelingAgent.prototype.createConnection = function createConnection(pending) {
152290 var self = this
152291
152292 self.createSocket(pending, function(socket) {
152293 socket.on('free', onFree)
152294 socket.on('close', onCloseOrRemove)
152295 socket.on('agentRemove', onCloseOrRemove)
152296 pending.request.onSocket(socket)
152297
152298 function onFree() {
152299 self.emit('free', socket, pending.host, pending.port)
152300 }
152301
152302 function onCloseOrRemove(err) {
152303 self.removeSocket(socket)
152304 socket.removeListener('free', onFree)
152305 socket.removeListener('close', onCloseOrRemove)
152306 socket.removeListener('agentRemove', onCloseOrRemove)
152307 }
152308 })
152309}
152310
152311TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
152312 var self = this
152313 var placeholder = {}
152314 self.sockets.push(placeholder)
152315
152316 var connectOptions = mergeOptions({}, self.proxyOptions,
152317 { method: 'CONNECT'
152318 , path: options.host + ':' + options.port
152319 , agent: false
152320 }
152321 )
152322 if (connectOptions.proxyAuth) {
152323 connectOptions.headers = connectOptions.headers || {}
152324 connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
152325 Buffer.from(connectOptions.proxyAuth).toString('base64')
152326 }
152327
152328 debug('making CONNECT request')
152329 var connectReq = self.request(connectOptions)
152330 connectReq.useChunkedEncodingByDefault = false // for v0.6
152331 connectReq.once('response', onResponse) // for v0.6
152332 connectReq.once('upgrade', onUpgrade) // for v0.6
152333 connectReq.once('connect', onConnect) // for v0.7 or later
152334 connectReq.once('error', onError)
152335 connectReq.end()
152336
152337 function onResponse(res) {
152338 // Very hacky. This is necessary to avoid http-parser leaks.
152339 res.upgrade = true
152340 }
152341
152342 function onUpgrade(res, socket, head) {
152343 // Hacky.
152344 process.nextTick(function() {
152345 onConnect(res, socket, head)
152346 })
152347 }
152348
152349 function onConnect(res, socket, head) {
152350 connectReq.removeAllListeners()
152351 socket.removeAllListeners()
152352
152353 if (res.statusCode === 200) {
152354 assert.equal(head.length, 0)
152355 debug('tunneling connection has established')
152356 self.sockets[self.sockets.indexOf(placeholder)] = socket
152357 cb(socket)
152358 } else {
152359 debug('tunneling socket could not be established, statusCode=%d', res.statusCode)
152360 var error = new Error('tunneling socket could not be established, ' + 'statusCode=' + res.statusCode)
152361 error.code = 'ECONNRESET'
152362 options.request.emit('error', error)
152363 self.removeSocket(placeholder)
152364 }
152365 }
152366
152367 function onError(cause) {
152368 connectReq.removeAllListeners()
152369
152370 debug('tunneling socket could not be established, cause=%s\n', cause.message, cause.stack)
152371 var error = new Error('tunneling socket could not be established, ' + 'cause=' + cause.message)
152372 error.code = 'ECONNRESET'
152373 options.request.emit('error', error)
152374 self.removeSocket(placeholder)
152375 }
152376}
152377
152378TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
152379 var pos = this.sockets.indexOf(socket)
152380 if (pos === -1) return
152381
152382 this.sockets.splice(pos, 1)
152383
152384 var pending = this.requests.shift()
152385 if (pending) {
152386 // If we have pending requests and a socket gets closed a new one
152387 // needs to be created to take over in the pool for the one that closed.
152388 this.createConnection(pending)
152389 }
152390}
152391
152392function createSecureSocket(options, cb) {
152393 var self = this
152394 TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
152395 // 0 is dummy port for v0.6
152396 var secureSocket = tls.connect(0, mergeOptions({}, self.options,
152397 { servername: options.host
152398 , socket: socket
152399 }
152400 ))
152401 self.sockets[self.sockets.indexOf(socket)] = secureSocket
152402 cb(secureSocket)
152403 })
152404}
152405
152406
152407function mergeOptions(target) {
152408 for (var i = 1, len = arguments.length; i < len; ++i) {
152409 var overrides = arguments[i]
152410 if (typeof overrides === 'object') {
152411 var keys = Object.keys(overrides)
152412 for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
152413 var k = keys[j]
152414 if (overrides[k] !== undefined) {
152415 target[k] = overrides[k]
152416 }
152417 }
152418 }
152419 }
152420 return target
152421}
152422
152423
152424var debug
152425if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
152426 debug = function() {
152427 var args = Array.prototype.slice.call(arguments)
152428 if (typeof args[0] === 'string') {
152429 args[0] = 'TUNNEL: ' + args[0]
152430 } else {
152431 args.unshift('TUNNEL:')
152432 }
152433 console.error.apply(console, args)
152434 }
152435} else {
152436 debug = function() {}
152437}
152438exports.debug = debug // for test
152439
152440
152441/***/ }),
152442/* 1029 */
152443/***/ (function(module, exports, __webpack_require__) {
152444
152445
152446/**
152447 * For Node.js, simply re-export the core `util.deprecate` function.
152448 */
152449
152450module.exports = __webpack_require__(9).deprecate;
152451
152452
152453/***/ }),
152454/* 1030 */
152455/***/ (function(module, exports, __webpack_require__) {
152456
152457var rng = __webpack_require__(435);
152458var bytesToUuid = __webpack_require__(434);
152459
152460// **`v1()` - Generate time-based UUID**
152461//
152462// Inspired by https://github.com/LiosK/UUID.js
152463// and http://docs.python.org/library/uuid.html
152464
152465var _nodeId;
152466var _clockseq;
152467
152468// Previous uuid creation time
152469var _lastMSecs = 0;
152470var _lastNSecs = 0;
152471
152472// See https://github.com/broofa/node-uuid for API details
152473function v1(options, buf, offset) {
152474 var i = buf && offset || 0;
152475 var b = buf || [];
152476
152477 options = options || {};
152478 var node = options.node || _nodeId;
152479 var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
152480
152481 // node and clockseq need to be initialized to random values if they're not
152482 // specified. We do this lazily to minimize issues related to insufficient
152483 // system entropy. See #189
152484 if (node == null || clockseq == null) {
152485 var seedBytes = rng();
152486 if (node == null) {
152487 // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
152488 node = _nodeId = [
152489 seedBytes[0] | 0x01,
152490 seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
152491 ];
152492 }
152493 if (clockseq == null) {
152494 // Per 4.2.2, randomize (14 bit) clockseq
152495 clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
152496 }
152497 }
152498
152499 // UUID timestamps are 100 nano-second units since the Gregorian epoch,
152500 // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
152501 // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
152502 // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
152503 var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
152504
152505 // Per 4.2.1.2, use count of uuid's generated during the current clock
152506 // cycle to simulate higher resolution clock
152507 var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
152508
152509 // Time since last uuid creation (in msecs)
152510 var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
152511
152512 // Per 4.2.1.2, Bump clockseq on clock regression
152513 if (dt < 0 && options.clockseq === undefined) {
152514 clockseq = clockseq + 1 & 0x3fff;
152515 }
152516
152517 // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
152518 // time interval
152519 if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
152520 nsecs = 0;
152521 }
152522
152523 // Per 4.2.1.2 Throw error if too many uuids are requested
152524 if (nsecs >= 10000) {
152525 throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
152526 }
152527
152528 _lastMSecs = msecs;
152529 _lastNSecs = nsecs;
152530 _clockseq = clockseq;
152531
152532 // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
152533 msecs += 12219292800000;
152534
152535 // `time_low`
152536 var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
152537 b[i++] = tl >>> 24 & 0xff;
152538 b[i++] = tl >>> 16 & 0xff;
152539 b[i++] = tl >>> 8 & 0xff;
152540 b[i++] = tl & 0xff;
152541
152542 // `time_mid`
152543 var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
152544 b[i++] = tmh >>> 8 & 0xff;
152545 b[i++] = tmh & 0xff;
152546
152547 // `time_high_and_version`
152548 b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
152549 b[i++] = tmh >>> 16 & 0xff;
152550
152551 // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
152552 b[i++] = clockseq >>> 8 | 0x80;
152553
152554 // `clock_seq_low`
152555 b[i++] = clockseq & 0xff;
152556
152557 // `node`
152558 for (var n = 0; n < 6; ++n) {
152559 b[i + n] = node[n];
152560 }
152561
152562 return buf ? buf : bytesToUuid(b);
152563}
152564
152565module.exports = v1;
152566
152567
152568/***/ }),
152569/* 1031 */
152570/***/ (function(module, exports, __webpack_require__) {
152571
152572var rng = __webpack_require__(435);
152573var bytesToUuid = __webpack_require__(434);
152574
152575function v4(options, buf, offset) {
152576 var i = buf && offset || 0;
152577
152578 if (typeof(options) == 'string') {
152579 buf = options === 'binary' ? new Array(16) : null;
152580 options = null;
152581 }
152582 options = options || {};
152583
152584 var rnds = options.random || (options.rng || rng)();
152585
152586 // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
152587 rnds[6] = (rnds[6] & 0x0f) | 0x40;
152588 rnds[8] = (rnds[8] & 0x3f) | 0x80;
152589
152590 // Copy bytes to buffer, if provided
152591 if (buf) {
152592 for (var ii = 0; ii < 16; ++ii) {
152593 buf[i + ii] = rnds[ii];
152594 }
152595 }
152596
152597 return buf || bytesToUuid(rnds);
152598}
152599
152600module.exports = v4;
152601
152602
152603/***/ }),
152604/* 1032 */
152605/***/ (function(module, exports, __webpack_require__) {
152606
152607var parse = __webpack_require__(422);
152608var correct = __webpack_require__(1008);
152609
152610var genericWarning = (
152611 'license should be ' +
152612 'a valid SPDX license expression (without "LicenseRef"), ' +
152613 '"UNLICENSED", or ' +
152614 '"SEE LICENSE IN <filename>"'
152615);
152616
152617var fileReferenceRE = /^SEE LICEN[CS]E IN (.+)$/;
152618
152619function startsWith(prefix, string) {
152620 return string.slice(0, prefix.length) === prefix;
152621}
152622
152623function usesLicenseRef(ast) {
152624 if (ast.hasOwnProperty('license')) {
152625 var license = ast.license;
152626 return (
152627 startsWith('LicenseRef', license) ||
152628 startsWith('DocumentRef', license)
152629 );
152630 } else {
152631 return (
152632 usesLicenseRef(ast.left) ||
152633 usesLicenseRef(ast.right)
152634 );
152635 }
152636}
152637
152638module.exports = function(argument) {
152639 var ast;
152640
152641 try {
152642 ast = parse(argument);
152643 } catch (e) {
152644 var match
152645 if (
152646 argument === 'UNLICENSED' ||
152647 argument === 'UNLICENCED'
152648 ) {
152649 return {
152650 validForOldPackages: true,
152651 validForNewPackages: true,
152652 unlicensed: true
152653 };
152654 } else if (match = fileReferenceRE.exec(argument)) {
152655 return {
152656 validForOldPackages: true,
152657 validForNewPackages: true,
152658 inFile: match[1]
152659 };
152660 } else {
152661 var result = {
152662 validForOldPackages: false,
152663 validForNewPackages: false,
152664 warnings: [genericWarning]
152665 };
152666 if (argument.trim().length !== 0) {
152667 var corrected = correct(argument);
152668 if (corrected) {
152669 result.warnings.push(
152670 'license is similar to the valid expression "' + corrected + '"'
152671 );
152672 }
152673 }
152674 return result;
152675 }
152676 }
152677
152678 if (usesLicenseRef(ast)) {
152679 return {
152680 validForNewPackages: false,
152681 validForOldPackages: false,
152682 spdx: true,
152683 warnings: [genericWarning]
152684 };
152685 } else {
152686 return {
152687 validForNewPackages: true,
152688 validForOldPackages: true,
152689 spdx: true
152690 };
152691 }
152692};
152693
152694
152695/***/ }),
152696/* 1033 */
152697/***/ (function(module, exports, __webpack_require__) {
152698
152699/*
152700 * verror.js: richer JavaScript errors
152701 */
152702
152703var mod_assertplus = __webpack_require__(22);
152704var mod_util = __webpack_require__(9);
152705
152706var mod_extsprintf = __webpack_require__(1034);
152707var mod_isError = __webpack_require__(105).isError;
152708var sprintf = mod_extsprintf.sprintf;
152709
152710/*
152711 * Public interface
152712 */
152713
152714/* So you can 'var VError = require('verror')' */
152715module.exports = VError;
152716/* For compatibility */
152717VError.VError = VError;
152718/* Other exported classes */
152719VError.SError = SError;
152720VError.WError = WError;
152721VError.MultiError = MultiError;
152722
152723/*
152724 * Common function used to parse constructor arguments for VError, WError, and
152725 * SError. Named arguments to this function:
152726 *
152727 * strict force strict interpretation of sprintf arguments, even
152728 * if the options in "argv" don't say so
152729 *
152730 * argv error's constructor arguments, which are to be
152731 * interpreted as described in README.md. For quick
152732 * reference, "argv" has one of the following forms:
152733 *
152734 * [ sprintf_args... ] (argv[0] is a string)
152735 * [ cause, sprintf_args... ] (argv[0] is an Error)
152736 * [ options, sprintf_args... ] (argv[0] is an object)
152737 *
152738 * This function normalizes these forms, producing an object with the following
152739 * properties:
152740 *
152741 * options equivalent to "options" in third form. This will never
152742 * be a direct reference to what the caller passed in
152743 * (i.e., it may be a shallow copy), so it can be freely
152744 * modified.
152745 *
152746 * shortmessage result of sprintf(sprintf_args), taking options.strict
152747 * into account as described in README.md.
152748 */
152749function parseConstructorArguments(args)
152750{
152751 var argv, options, sprintf_args, shortmessage, k;
152752
152753 mod_assertplus.object(args, 'args');
152754 mod_assertplus.bool(args.strict, 'args.strict');
152755 mod_assertplus.array(args.argv, 'args.argv');
152756 argv = args.argv;
152757
152758 /*
152759 * First, figure out which form of invocation we've been given.
152760 */
152761 if (argv.length === 0) {
152762 options = {};
152763 sprintf_args = [];
152764 } else if (mod_isError(argv[0])) {
152765 options = { 'cause': argv[0] };
152766 sprintf_args = argv.slice(1);
152767 } else if (typeof (argv[0]) === 'object') {
152768 options = {};
152769 for (k in argv[0]) {
152770 options[k] = argv[0][k];
152771 }
152772 sprintf_args = argv.slice(1);
152773 } else {
152774 mod_assertplus.string(argv[0],
152775 'first argument to VError, SError, or WError ' +
152776 'constructor must be a string, object, or Error');
152777 options = {};
152778 sprintf_args = argv;
152779 }
152780
152781 /*
152782 * Now construct the error's message.
152783 *
152784 * extsprintf (which we invoke here with our caller's arguments in order
152785 * to construct this Error's message) is strict in its interpretation of
152786 * values to be processed by the "%s" specifier. The value passed to
152787 * extsprintf must actually be a string or something convertible to a
152788 * String using .toString(). Passing other values (notably "null" and
152789 * "undefined") is considered a programmer error. The assumption is
152790 * that if you actually want to print the string "null" or "undefined",
152791 * then that's easy to do that when you're calling extsprintf; on the
152792 * other hand, if you did NOT want that (i.e., there's actually a bug
152793 * where the program assumes some variable is non-null and tries to
152794 * print it, which might happen when constructing a packet or file in
152795 * some specific format), then it's better to stop immediately than
152796 * produce bogus output.
152797 *
152798 * However, sometimes the bug is only in the code calling VError, and a
152799 * programmer might prefer to have the error message contain "null" or
152800 * "undefined" rather than have the bug in the error path crash the
152801 * program (making the first bug harder to identify). For that reason,
152802 * by default VError converts "null" or "undefined" arguments to their
152803 * string representations and passes those to extsprintf. Programmers
152804 * desiring the strict behavior can use the SError class or pass the
152805 * "strict" option to the VError constructor.
152806 */
152807 mod_assertplus.object(options);
152808 if (!options.strict && !args.strict) {
152809 sprintf_args = sprintf_args.map(function (a) {
152810 return (a === null ? 'null' :
152811 a === undefined ? 'undefined' : a);
152812 });
152813 }
152814
152815 if (sprintf_args.length === 0) {
152816 shortmessage = '';
152817 } else {
152818 shortmessage = sprintf.apply(null, sprintf_args);
152819 }
152820
152821 return ({
152822 'options': options,
152823 'shortmessage': shortmessage
152824 });
152825}
152826
152827/*
152828 * See README.md for reference documentation.
152829 */
152830function VError()
152831{
152832 var args, obj, parsed, cause, ctor, message, k;
152833
152834 args = Array.prototype.slice.call(arguments, 0);
152835
152836 /*
152837 * This is a regrettable pattern, but JavaScript's built-in Error class
152838 * is defined to work this way, so we allow the constructor to be called
152839 * without "new".
152840 */
152841 if (!(this instanceof VError)) {
152842 obj = Object.create(VError.prototype);
152843 VError.apply(obj, arguments);
152844 return (obj);
152845 }
152846
152847 /*
152848 * For convenience and backwards compatibility, we support several
152849 * different calling forms. Normalize them here.
152850 */
152851 parsed = parseConstructorArguments({
152852 'argv': args,
152853 'strict': false
152854 });
152855
152856 /*
152857 * If we've been given a name, apply it now.
152858 */
152859 if (parsed.options.name) {
152860 mod_assertplus.string(parsed.options.name,
152861 'error\'s "name" must be a string');
152862 this.name = parsed.options.name;
152863 }
152864
152865 /*
152866 * For debugging, we keep track of the original short message (attached
152867 * this Error particularly) separately from the complete message (which
152868 * includes the messages of our cause chain).
152869 */
152870 this.jse_shortmsg = parsed.shortmessage;
152871 message = parsed.shortmessage;
152872
152873 /*
152874 * If we've been given a cause, record a reference to it and update our
152875 * message appropriately.
152876 */
152877 cause = parsed.options.cause;
152878 if (cause) {
152879 mod_assertplus.ok(mod_isError(cause), 'cause is not an Error');
152880 this.jse_cause = cause;
152881
152882 if (!parsed.options.skipCauseMessage) {
152883 message += ': ' + cause.message;
152884 }
152885 }
152886
152887 /*
152888 * If we've been given an object with properties, shallow-copy that
152889 * here. We don't want to use a deep copy in case there are non-plain
152890 * objects here, but we don't want to use the original object in case
152891 * the caller modifies it later.
152892 */
152893 this.jse_info = {};
152894 if (parsed.options.info) {
152895 for (k in parsed.options.info) {
152896 this.jse_info[k] = parsed.options.info[k];
152897 }
152898 }
152899
152900 this.message = message;
152901 Error.call(this, message);
152902
152903 if (Error.captureStackTrace) {
152904 ctor = parsed.options.constructorOpt || this.constructor;
152905 Error.captureStackTrace(this, ctor);
152906 }
152907
152908 return (this);
152909}
152910
152911mod_util.inherits(VError, Error);
152912VError.prototype.name = 'VError';
152913
152914VError.prototype.toString = function ve_toString()
152915{
152916 var str = (this.hasOwnProperty('name') && this.name ||
152917 this.constructor.name || this.constructor.prototype.name);
152918 if (this.message)
152919 str += ': ' + this.message;
152920
152921 return (str);
152922};
152923
152924/*
152925 * This method is provided for compatibility. New callers should use
152926 * VError.cause() instead. That method also uses the saner `null` return value
152927 * when there is no cause.
152928 */
152929VError.prototype.cause = function ve_cause()
152930{
152931 var cause = VError.cause(this);
152932 return (cause === null ? undefined : cause);
152933};
152934
152935/*
152936 * Static methods
152937 *
152938 * These class-level methods are provided so that callers can use them on
152939 * instances of Errors that are not VErrors. New interfaces should be provided
152940 * only using static methods to eliminate the class of programming mistake where
152941 * people fail to check whether the Error object has the corresponding methods.
152942 */
152943
152944VError.cause = function (err)
152945{
152946 mod_assertplus.ok(mod_isError(err), 'err must be an Error');
152947 return (mod_isError(err.jse_cause) ? err.jse_cause : null);
152948};
152949
152950VError.info = function (err)
152951{
152952 var rv, cause, k;
152953
152954 mod_assertplus.ok(mod_isError(err), 'err must be an Error');
152955 cause = VError.cause(err);
152956 if (cause !== null) {
152957 rv = VError.info(cause);
152958 } else {
152959 rv = {};
152960 }
152961
152962 if (typeof (err.jse_info) == 'object' && err.jse_info !== null) {
152963 for (k in err.jse_info) {
152964 rv[k] = err.jse_info[k];
152965 }
152966 }
152967
152968 return (rv);
152969};
152970
152971VError.findCauseByName = function (err, name)
152972{
152973 var cause;
152974
152975 mod_assertplus.ok(mod_isError(err), 'err must be an Error');
152976 mod_assertplus.string(name, 'name');
152977 mod_assertplus.ok(name.length > 0, 'name cannot be empty');
152978
152979 for (cause = err; cause !== null; cause = VError.cause(cause)) {
152980 mod_assertplus.ok(mod_isError(cause));
152981 if (cause.name == name) {
152982 return (cause);
152983 }
152984 }
152985
152986 return (null);
152987};
152988
152989VError.hasCauseWithName = function (err, name)
152990{
152991 return (VError.findCauseByName(err, name) !== null);
152992};
152993
152994VError.fullStack = function (err)
152995{
152996 mod_assertplus.ok(mod_isError(err), 'err must be an Error');
152997
152998 var cause = VError.cause(err);
152999
153000 if (cause) {
153001 return (err.stack + '\ncaused by: ' + VError.fullStack(cause));
153002 }
153003
153004 return (err.stack);
153005};
153006
153007VError.errorFromList = function (errors)
153008{
153009 mod_assertplus.arrayOfObject(errors, 'errors');
153010
153011 if (errors.length === 0) {
153012 return (null);
153013 }
153014
153015 errors.forEach(function (e) {
153016 mod_assertplus.ok(mod_isError(e));
153017 });
153018
153019 if (errors.length == 1) {
153020 return (errors[0]);
153021 }
153022
153023 return (new MultiError(errors));
153024};
153025
153026VError.errorForEach = function (err, func)
153027{
153028 mod_assertplus.ok(mod_isError(err), 'err must be an Error');
153029 mod_assertplus.func(func, 'func');
153030
153031 if (err instanceof MultiError) {
153032 err.errors().forEach(function iterError(e) { func(e); });
153033 } else {
153034 func(err);
153035 }
153036};
153037
153038
153039/*
153040 * SError is like VError, but stricter about types. You cannot pass "null" or
153041 * "undefined" as string arguments to the formatter.
153042 */
153043function SError()
153044{
153045 var args, obj, parsed, options;
153046
153047 args = Array.prototype.slice.call(arguments, 0);
153048 if (!(this instanceof SError)) {
153049 obj = Object.create(SError.prototype);
153050 SError.apply(obj, arguments);
153051 return (obj);
153052 }
153053
153054 parsed = parseConstructorArguments({
153055 'argv': args,
153056 'strict': true
153057 });
153058
153059 options = parsed.options;
153060 VError.call(this, options, '%s', parsed.shortmessage);
153061
153062 return (this);
153063}
153064
153065/*
153066 * We don't bother setting SError.prototype.name because once constructed,
153067 * SErrors are just like VErrors.
153068 */
153069mod_util.inherits(SError, VError);
153070
153071
153072/*
153073 * Represents a collection of errors for the purpose of consumers that generally
153074 * only deal with one error. Callers can extract the individual errors
153075 * contained in this object, but may also just treat it as a normal single
153076 * error, in which case a summary message will be printed.
153077 */
153078function MultiError(errors)
153079{
153080 mod_assertplus.array(errors, 'list of errors');
153081 mod_assertplus.ok(errors.length > 0, 'must be at least one error');
153082 this.ase_errors = errors;
153083
153084 VError.call(this, {
153085 'cause': errors[0]
153086 }, 'first of %d error%s', errors.length, errors.length == 1 ? '' : 's');
153087}
153088
153089mod_util.inherits(MultiError, VError);
153090MultiError.prototype.name = 'MultiError';
153091
153092MultiError.prototype.errors = function me_errors()
153093{
153094 return (this.ase_errors.slice(0));
153095};
153096
153097
153098/*
153099 * See README.md for reference details.
153100 */
153101function WError()
153102{
153103 var args, obj, parsed, options;
153104
153105 args = Array.prototype.slice.call(arguments, 0);
153106 if (!(this instanceof WError)) {
153107 obj = Object.create(WError.prototype);
153108 WError.apply(obj, args);
153109 return (obj);
153110 }
153111
153112 parsed = parseConstructorArguments({
153113 'argv': args,
153114 'strict': false
153115 });
153116
153117 options = parsed.options;
153118 options['skipCauseMessage'] = true;
153119 VError.call(this, options, '%s', parsed.shortmessage);
153120
153121 return (this);
153122}
153123
153124mod_util.inherits(WError, VError);
153125WError.prototype.name = 'WError';
153126
153127WError.prototype.toString = function we_toString()
153128{
153129 var str = (this.hasOwnProperty('name') && this.name ||
153130 this.constructor.name || this.constructor.prototype.name);
153131 if (this.message)
153132 str += ': ' + this.message;
153133 if (this.jse_cause && this.jse_cause.message)
153134 str += '; caused by ' + this.jse_cause.toString();
153135
153136 return (str);
153137};
153138
153139/*
153140 * For purely historical reasons, WError's cause() function allows you to set
153141 * the cause.
153142 */
153143WError.prototype.cause = function we_cause(c)
153144{
153145 if (mod_isError(c))
153146 this.jse_cause = c;
153147
153148 return (this.jse_cause);
153149};
153150
153151
153152/***/ }),
153153/* 1034 */
153154/***/ (function(module, exports, __webpack_require__) {
153155
153156/*
153157 * extsprintf.js: extended POSIX-style sprintf
153158 */
153159
153160var mod_assert = __webpack_require__(50);
153161var mod_util = __webpack_require__(9);
153162
153163/*
153164 * Public interface
153165 */
153166exports.sprintf = jsSprintf;
153167exports.printf = jsPrintf;
153168exports.fprintf = jsFprintf;
153169
153170/*
153171 * Stripped down version of s[n]printf(3c). We make a best effort to throw an
153172 * exception when given a format string we don't understand, rather than
153173 * ignoring it, so that we won't break existing programs if/when we go implement
153174 * the rest of this.
153175 *
153176 * This implementation currently supports specifying
153177 * - field alignment ('-' flag),
153178 * - zero-pad ('0' flag)
153179 * - always show numeric sign ('+' flag),
153180 * - field width
153181 * - conversions for strings, decimal integers, and floats (numbers).
153182 * - argument size specifiers. These are all accepted but ignored, since
153183 * Javascript has no notion of the physical size of an argument.
153184 *
153185 * Everything else is currently unsupported, most notably precision, unsigned
153186 * numbers, non-decimal numbers, and characters.
153187 */
153188function jsSprintf(ofmt)
153189{
153190 var regex = [
153191 '([^%]*)', /* normal text */
153192 '%', /* start of format */
153193 '([\'\\-+ #0]*?)', /* flags (optional) */
153194 '([1-9]\\d*)?', /* width (optional) */
153195 '(\\.([1-9]\\d*))?', /* precision (optional) */
153196 '[lhjztL]*?', /* length mods (ignored) */
153197 '([diouxXfFeEgGaAcCsSp%jr])' /* conversion */
153198 ].join('');
153199
153200 var re = new RegExp(regex);
153201
153202 /* variadic arguments used to fill in conversion specifiers */
153203 var args = Array.prototype.slice.call(arguments, 1);
153204 /* remaining format string */
153205 var fmt = ofmt;
153206
153207 /* components of the current conversion specifier */
153208 var flags, width, precision, conversion;
153209 var left, pad, sign, arg, match;
153210
153211 /* return value */
153212 var ret = '';
153213
153214 /* current variadic argument (1-based) */
153215 var argn = 1;
153216 /* 0-based position in the format string that we've read */
153217 var posn = 0;
153218 /* 1-based position in the format string of the current conversion */
153219 var convposn;
153220 /* current conversion specifier */
153221 var curconv;
153222
153223 mod_assert.equal('string', typeof (fmt),
153224 'first argument must be a format string');
153225
153226 while ((match = re.exec(fmt)) !== null) {
153227 ret += match[1];
153228 fmt = fmt.substring(match[0].length);
153229
153230 /*
153231 * Update flags related to the current conversion specifier's
153232 * position so that we can report clear error messages.
153233 */
153234 curconv = match[0].substring(match[1].length);
153235 convposn = posn + match[1].length + 1;
153236 posn += match[0].length;
153237
153238 flags = match[2] || '';
153239 width = match[3] || 0;
153240 precision = match[4] || '';
153241 conversion = match[6];
153242 left = false;
153243 sign = false;
153244 pad = ' ';
153245
153246 if (conversion == '%') {
153247 ret += '%';
153248 continue;
153249 }
153250
153251 if (args.length === 0) {
153252 throw (jsError(ofmt, convposn, curconv,
153253 'has no matching argument ' +
153254 '(too few arguments passed)'));
153255 }
153256
153257 arg = args.shift();
153258 argn++;
153259
153260 if (flags.match(/[\' #]/)) {
153261 throw (jsError(ofmt, convposn, curconv,
153262 'uses unsupported flags'));
153263 }
153264
153265 if (precision.length > 0) {
153266 throw (jsError(ofmt, convposn, curconv,
153267 'uses non-zero precision (not supported)'));
153268 }
153269
153270 if (flags.match(/-/))
153271 left = true;
153272
153273 if (flags.match(/0/))
153274 pad = '0';
153275
153276 if (flags.match(/\+/))
153277 sign = true;
153278
153279 switch (conversion) {
153280 case 's':
153281 if (arg === undefined || arg === null) {
153282 throw (jsError(ofmt, convposn, curconv,
153283 'attempted to print undefined or null ' +
153284 'as a string (argument ' + argn + ' to ' +
153285 'sprintf)'));
153286 }
153287 ret += doPad(pad, width, left, arg.toString());
153288 break;
153289
153290 case 'd':
153291 arg = Math.floor(arg);
153292 /*jsl:fallthru*/
153293 case 'f':
153294 sign = sign && arg > 0 ? '+' : '';
153295 ret += sign + doPad(pad, width, left,
153296 arg.toString());
153297 break;
153298
153299 case 'x':
153300 ret += doPad(pad, width, left, arg.toString(16));
153301 break;
153302
153303 case 'j': /* non-standard */
153304 if (width === 0)
153305 width = 10;
153306 ret += mod_util.inspect(arg, false, width);
153307 break;
153308
153309 case 'r': /* non-standard */
153310 ret += dumpException(arg);
153311 break;
153312
153313 default:
153314 throw (jsError(ofmt, convposn, curconv,
153315 'is not supported'));
153316 }
153317 }
153318
153319 ret += fmt;
153320 return (ret);
153321}
153322
153323function jsError(fmtstr, convposn, curconv, reason) {
153324 mod_assert.equal(typeof (fmtstr), 'string');
153325 mod_assert.equal(typeof (curconv), 'string');
153326 mod_assert.equal(typeof (convposn), 'number');
153327 mod_assert.equal(typeof (reason), 'string');
153328 return (new Error('format string "' + fmtstr +
153329 '": conversion specifier "' + curconv + '" at character ' +
153330 convposn + ' ' + reason));
153331}
153332
153333function jsPrintf() {
153334 var args = Array.prototype.slice.call(arguments);
153335 args.unshift(process.stdout);
153336 jsFprintf.apply(null, args);
153337}
153338
153339function jsFprintf(stream) {
153340 var args = Array.prototype.slice.call(arguments, 1);
153341 return (stream.write(jsSprintf.apply(this, args)));
153342}
153343
153344function doPad(chr, width, left, str)
153345{
153346 var ret = str;
153347
153348 while (ret.length < width) {
153349 if (left)
153350 ret += chr;
153351 else
153352 ret = chr + ret;
153353 }
153354
153355 return (ret);
153356}
153357
153358/*
153359 * This function dumps long stack traces for exceptions having a cause() method.
153360 * See node-verror for an example.
153361 */
153362function dumpException(ex)
153363{
153364 var ret;
153365
153366 if (!(ex instanceof Error))
153367 throw (new Error(jsSprintf('invalid type for %%r: %j', ex)));
153368
153369 /* Note that V8 prepends "ex.stack" with ex.toString(). */
153370 ret = 'EXCEPTION: ' + ex.constructor.name + ': ' + ex.stack;
153371
153372 if (ex.cause && typeof (ex.cause) === 'function') {
153373 var cex = ex.cause();
153374 if (cex) {
153375 ret += '\nCaused by: ' + dumpException(cex);
153376 }
153377 }
153378
153379 return (ret);
153380}
153381
153382
153383/***/ }),
153384/* 1035 */
153385/***/ (function(module, exports, __webpack_require__) {
153386
153387"use strict";
153388
153389const lenient = __webpack_require__(1036);
153390
153391module.exports = (val, opts) => {
153392 val = String(val).trim();
153393 opts = Object.assign({
153394 lenient: false,
153395 default: null
153396 }, opts);
153397
153398 if (opts.default !== null && typeof opts.default !== 'boolean') {
153399 throw new TypeError(`Expected the \`default\` option to be of type \`boolean\`, got \`${typeof opts.default}\``);
153400 }
153401
153402 if (/^(?:y|yes|true|1)$/i.test(val)) {
153403 return true;
153404 }
153405
153406 if (/^(?:n|no|false|0)$/i.test(val)) {
153407 return false;
153408 }
153409
153410 if (opts.lenient === true) {
153411 return lenient(val, opts);
153412 }
153413
153414 return opts.default;
153415};
153416
153417
153418/***/ }),
153419/* 1036 */
153420/***/ (function(module, exports, __webpack_require__) {
153421
153422"use strict";
153423
153424
153425const YES_MATCH_SCORE_THRESHOLD = 2;
153426const NO_MATCH_SCORE_THRESHOLD = 1.25;
153427
153428const yMatch = new Map([
153429 [5, 0.25],
153430 [6, 0.25],
153431 [7, 0.25],
153432 ['t', 0.75],
153433 ['y', 1],
153434 ['u', 0.75],
153435 ['g', 0.25],
153436 ['h', 0.25],
153437 ['k', 0.25]
153438]);
153439
153440const eMatch = new Map([
153441 [2, 0.25],
153442 [3, 0.25],
153443 [4, 0.25],
153444 ['w', 0.75],
153445 ['e', 1],
153446 ['r', 0.75],
153447 ['s', 0.25],
153448 ['d', 0.25],
153449 ['f', 0.25]
153450]);
153451
153452const sMatch = new Map([
153453 ['q', 0.25],
153454 ['w', 0.25],
153455 ['e', 0.25],
153456 ['a', 0.75],
153457 ['s', 1],
153458 ['d', 0.75],
153459 ['z', 0.25],
153460 ['x', 0.25],
153461 ['c', 0.25]
153462]);
153463
153464const nMatch = new Map([
153465 ['h', 0.25],
153466 ['j', 0.25],
153467 ['k', 0.25],
153468 ['b', 0.75],
153469 ['n', 1],
153470 ['m', 0.75]
153471]);
153472
153473const oMatch = new Map([
153474 [9, 0.25],
153475 [0, 0.25],
153476 ['i', 0.75],
153477 ['o', 1],
153478 ['p', 0.75],
153479 ['k', 0.25],
153480 ['l', 0.25]
153481]);
153482
153483function getYesMatchScore(val) {
153484 let score = 0;
153485 const y = val[0];
153486 const e = val[1];
153487 const s = val[2];
153488
153489 if (yMatch.has(y)) {
153490 score += yMatch.get(y);
153491 }
153492
153493 if (eMatch.has(e)) {
153494 score += eMatch.get(e);
153495 }
153496
153497 if (sMatch.has(s)) {
153498 score += sMatch.get(s);
153499 }
153500
153501 return score;
153502}
153503
153504function getNoMatchScore(val) {
153505 let score = 0;
153506 const n = val[0];
153507 const o = val[1];
153508
153509 if (nMatch.has(n)) {
153510 score += nMatch.get(n);
153511 }
153512
153513 if (oMatch.has(o)) {
153514 score += oMatch.get(o);
153515 }
153516
153517 return score;
153518}
153519
153520module.exports = (val, opts) => {
153521 if (getYesMatchScore(val) >= YES_MATCH_SCORE_THRESHOLD) {
153522 return true;
153523 }
153524
153525 if (getNoMatchScore(val) >= NO_MATCH_SCORE_THRESHOLD) {
153526 return false;
153527 }
153528
153529 return opts.default;
153530};
153531
153532
153533/***/ }),
153534/* 1037 */
153535/***/ (function(module, exports) {
153536
153537module.exports = require("dns");
153538
153539/***/ }),
153540/* 1038 */
153541/***/ (function(module, exports) {
153542
153543module.exports = require("domain");
153544
153545/***/ })
153546/******/ ]);
\No newline at end of file