UNPKG

31.4 kBJavaScriptView Raw
1(function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap
2/******/ // The module cache
3/******/ var installedModules = {};
4/******/
5/******/ // The require function
6/******/ function __webpack_require__(moduleId) {
7/******/
8/******/ // Check if module is in cache
9/******/ if(installedModules[moduleId]) {
10/******/ return installedModules[moduleId].exports;
11/******/ }
12/******/ // Create a new module (and put it into the cache)
13/******/ var module = installedModules[moduleId] = {
14/******/ i: moduleId,
15/******/ l: false,
16/******/ exports: {}
17/******/ };
18/******/
19/******/ // Execute the module function
20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
21/******/
22/******/ // Flag the module as loaded
23/******/ module.l = true;
24/******/
25/******/ // Return the exports of the module
26/******/ return module.exports;
27/******/ }
28/******/
29/******/
30/******/ // expose the modules object (__webpack_modules__)
31/******/ __webpack_require__.m = modules;
32/******/
33/******/ // expose the module cache
34/******/ __webpack_require__.c = installedModules;
35/******/
36/******/ // define getter function for harmony exports
37/******/ __webpack_require__.d = function(exports, name, getter) {
38/******/ if(!__webpack_require__.o(exports, name)) {
39/******/ Object.defineProperty(exports, name, {
40/******/ configurable: false,
41/******/ enumerable: true,
42/******/ get: getter
43/******/ });
44/******/ }
45/******/ };
46/******/
47/******/ // getDefaultExport function for compatibility with non-harmony modules
48/******/ __webpack_require__.n = function(module) {
49/******/ var getter = module && module.__esModule ?
50/******/ function getDefault() { return module['default']; } :
51/******/ function getModuleExports() { return module; };
52/******/ __webpack_require__.d(getter, 'a', getter);
53/******/ return getter;
54/******/ };
55/******/
56/******/ // Object.prototype.hasOwnProperty.call
57/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
58/******/
59/******/ // __webpack_public_path__
60/******/ __webpack_require__.p = "";
61/******/
62/******/ // Load entry module and return exports
63/******/ return __webpack_require__(__webpack_require__.s = 5);
64/******/ })
65/************************************************************************/
66/******/ ([
67/* 0 */
68/***/ (function(module, exports, __webpack_require__) {
69
70"use strict";
71
72Object.defineProperty(exports, "__esModule", { value: true });
73var Level;
74(function (Level) {
75 Level[Level["DATA"] = 0] = "DATA";
76 Level[Level["INFO"] = 1] = "INFO";
77 Level[Level["WARN"] = 2] = "WARN";
78 Level[Level["ERROR"] = 3] = "ERROR";
79 Level[Level["__NOTHING"] = 4] = "__NOTHING";
80})(Level = exports.Level || (exports.Level = {}));
81
82
83/***/ }),
84/* 1 */
85/***/ (function(module, exports, __webpack_require__) {
86
87"use strict";
88
89Object.defineProperty(exports, "__esModule", { value: true });
90exports.isBrowser = (typeof window !== 'undefined' && window.document);
91exports.isNode = !exports.isBrowser;
92
93
94/***/ }),
95/* 2 */
96/***/ (function(module, exports, __webpack_require__) {
97
98"use strict";
99
100Object.defineProperty(exports, "__esModule", { value: true });
101const level_1 = __webpack_require__(0);
102const helper_1 = __webpack_require__(1);
103const backend_logging_1 = __webpack_require__(8);
104if (helper_1.isNode) {
105}
106class Display {
107 static msg(message, params, moduleName, moduleColor, level, moduleWidth) {
108 let color = 'gray';
109 if (level === level_1.Level.INFO)
110 color = 'deepskyblue';
111 if (level === level_1.Level.ERROR)
112 color = 'red';
113 if (level === level_1.Level.WARN)
114 color = 'orange';
115 if (moduleWidth) {
116 const diff = moduleWidth - moduleName.length;
117 if (diff > 0) {
118 for (let i = 0; i < diff; i++) {
119 moduleName += ' ';
120 }
121 }
122 }
123 if (helper_1.isBrowser) {
124 if (typeof message === 'string') {
125 let a1 = '%c ' + moduleName + ' %c ' + message + ' ';
126 let a2 = 'background: ' + moduleColor + ';color:white; border: 1px solid ' + moduleColor + '; ';
127 let a3 = 'border: 1px solid ' + color + '; ';
128 params.unshift(a3);
129 params.unshift(a2);
130 params.unshift(a1);
131 }
132 else {
133 let a1 = '%c ' + moduleName + ' ';
134 let a2 = 'background: ' + moduleColor + ';color:white; border: 1px solid ' + color + '; ';
135 params.push(message);
136 params.unshift(a2);
137 params.unshift(a1);
138 }
139 console.log.apply(console, params);
140 }
141 if (helper_1.isNode) {
142 let a1 = chalk.bgHex(moduleColor)(chalk.black(moduleName));
143 let p = params;
144 if (typeof message === 'string') {
145 a1 = a1 + chalk.keyword(color)(' [') + chalk.dim(message) + chalk.keyword(color)('] ');
146 }
147 else {
148 p = [message].concat(params);
149 }
150 backend_logging_1.consoleLog(a1, level);
151 backend_logging_1.displayParams(p, level);
152 }
153 }
154}
155exports.Display = Display;
156
157
158/***/ }),
159/* 3 */
160/***/ (function(module, exports) {
161
162// shim for using process in browser
163var process = module.exports = {};
164
165// cached from whatever global is present so that test runners that stub it
166// don't break things. But we need to wrap it in a try catch in case it is
167// wrapped in strict mode code which doesn't define any globals. It's inside a
168// function because try/catches deoptimize in certain engines.
169
170var cachedSetTimeout;
171var cachedClearTimeout;
172
173function defaultSetTimout() {
174 throw new Error('setTimeout has not been defined');
175}
176function defaultClearTimeout () {
177 throw new Error('clearTimeout has not been defined');
178}
179(function () {
180 try {
181 if (typeof setTimeout === 'function') {
182 cachedSetTimeout = setTimeout;
183 } else {
184 cachedSetTimeout = defaultSetTimout;
185 }
186 } catch (e) {
187 cachedSetTimeout = defaultSetTimout;
188 }
189 try {
190 if (typeof clearTimeout === 'function') {
191 cachedClearTimeout = clearTimeout;
192 } else {
193 cachedClearTimeout = defaultClearTimeout;
194 }
195 } catch (e) {
196 cachedClearTimeout = defaultClearTimeout;
197 }
198} ())
199function runTimeout(fun) {
200 if (cachedSetTimeout === setTimeout) {
201 //normal enviroments in sane situations
202 return setTimeout(fun, 0);
203 }
204 // if setTimeout wasn't available but was latter defined
205 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
206 cachedSetTimeout = setTimeout;
207 return setTimeout(fun, 0);
208 }
209 try {
210 // when when somebody has screwed with setTimeout but no I.E. maddness
211 return cachedSetTimeout(fun, 0);
212 } catch(e){
213 try {
214 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
215 return cachedSetTimeout.call(null, fun, 0);
216 } catch(e){
217 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
218 return cachedSetTimeout.call(this, fun, 0);
219 }
220 }
221
222
223}
224function runClearTimeout(marker) {
225 if (cachedClearTimeout === clearTimeout) {
226 //normal enviroments in sane situations
227 return clearTimeout(marker);
228 }
229 // if clearTimeout wasn't available but was latter defined
230 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
231 cachedClearTimeout = clearTimeout;
232 return clearTimeout(marker);
233 }
234 try {
235 // when when somebody has screwed with setTimeout but no I.E. maddness
236 return cachedClearTimeout(marker);
237 } catch (e){
238 try {
239 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
240 return cachedClearTimeout.call(null, marker);
241 } catch (e){
242 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
243 // Some versions of I.E. have different rules for clearTimeout vs setTimeout
244 return cachedClearTimeout.call(this, marker);
245 }
246 }
247
248
249
250}
251var queue = [];
252var draining = false;
253var currentQueue;
254var queueIndex = -1;
255
256function cleanUpNextTick() {
257 if (!draining || !currentQueue) {
258 return;
259 }
260 draining = false;
261 if (currentQueue.length) {
262 queue = currentQueue.concat(queue);
263 } else {
264 queueIndex = -1;
265 }
266 if (queue.length) {
267 drainQueue();
268 }
269}
270
271function drainQueue() {
272 if (draining) {
273 return;
274 }
275 var timeout = runTimeout(cleanUpNextTick);
276 draining = true;
277
278 var len = queue.length;
279 while(len) {
280 currentQueue = queue;
281 queue = [];
282 while (++queueIndex < len) {
283 if (currentQueue) {
284 currentQueue[queueIndex].run();
285 }
286 }
287 queueIndex = -1;
288 len = queue.length;
289 }
290 currentQueue = null;
291 draining = false;
292 runClearTimeout(timeout);
293}
294
295process.nextTick = function (fun) {
296 var args = new Array(arguments.length - 1);
297 if (arguments.length > 1) {
298 for (var i = 1; i < arguments.length; i++) {
299 args[i - 1] = arguments[i];
300 }
301 }
302 queue.push(new Item(fun, args));
303 if (queue.length === 1 && !draining) {
304 runTimeout(drainQueue);
305 }
306};
307
308// v8 likes predictible objects
309function Item(fun, array) {
310 this.fun = fun;
311 this.array = array;
312}
313Item.prototype.run = function () {
314 this.fun.apply(null, this.array);
315};
316process.title = 'browser';
317process.browser = true;
318process.env = {};
319process.argv = [];
320process.version = ''; // empty string to avoid regexp issues
321process.versions = {};
322
323function noop() {}
324
325process.on = noop;
326process.addListener = noop;
327process.once = noop;
328process.off = noop;
329process.removeListener = noop;
330process.removeAllListeners = noop;
331process.emit = noop;
332process.prependListener = noop;
333process.prependOnceListener = noop;
334
335process.listeners = function (name) { return [] }
336
337process.binding = function (name) {
338 throw new Error('process.binding is not supported');
339};
340
341process.cwd = function () { return '/' };
342process.chdir = function (dir) {
343 throw new Error('process.chdir is not supported');
344};
345process.umask = function() { return 0; };
346
347
348/***/ }),
349/* 4 */
350/***/ (function(module, exports, __webpack_require__) {
351
352"use strict";
353
354Object.defineProperty(exports, "__esModule", { value: true });
355function contain(arr, item) {
356 return arr.filter(l => l === item || ((item.match && typeof item.match === 'function') ? item.match(l) : false)).length > 0;
357}
358exports.contain = contain;
359;
360
361
362/***/ }),
363/* 5 */
364/***/ (function(module, exports, __webpack_require__) {
365
366"use strict";
367
368function __export(m) {
369 for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
370}
371Object.defineProperty(exports, "__esModule", { value: true });
372__export(__webpack_require__(6));
373__export(__webpack_require__(0));
374__export(__webpack_require__(1));
375
376
377/***/ }),
378/* 6 */
379/***/ (function(module, exports, __webpack_require__) {
380
381"use strict";
382
383Object.defineProperty(exports, "__esModule", { value: true });
384const logger_1 = __webpack_require__(7);
385const level_1 = __webpack_require__(0);
386const display_1 = __webpack_require__(2);
387const include_1 = __webpack_require__(4);
388const helper_1 = __webpack_require__(1);
389if (helper_1.isNode) {
390 var randomcolor = __webpack_require__(14);
391}
392class Log {
393 static create(name, ...level) {
394 let i;
395 if (Log.instances[name] === undefined) {
396 i = new logger_1.Logger(name, Log.getRandomColor(), Log.isDevelopmentMode, level, Log.isMutedModule(name), Log.levels.length > 0 ? Log.fixedWidth : undefined, Log.levels.length > 0 ? Log.display : undefined);
397 Log.instances[name] = i;
398 }
399 else {
400 i = Log.instances[name];
401 }
402 return i;
403 }
404 static getRandomColor() {
405 if (helper_1.isNode) {
406 return randomcolor({ luminosity: 'light', count: 10 });
407 }
408 let letters = '012345'.split('');
409 let color = '#';
410 color += letters[Math.round(Math.random() * 5)];
411 letters = '0123456789ABCDEF'.split('');
412 for (let i = 0; i < 5; i++) {
413 color += letters[Math.round(Math.random() * 15)];
414 }
415 if (color === undefined)
416 return this.getRandomColor();
417 return color;
418 }
419 static display(name, data, incomming, moduleName) {
420 if (!include_1.contain(Log.levels, incomming))
421 return;
422 if (incomming === level_1.Level.DATA) {
423 display_1.Display.msg(name, data, name, Log.instances[moduleName].color, level_1.Level.DATA, Log.instances[moduleName].fixedWidth);
424 }
425 if (incomming === level_1.Level.ERROR) {
426 display_1.Display.msg(name, data, name, Log.instances[moduleName].color, level_1.Level.ERROR, Log.instances[moduleName].fixedWidth);
427 }
428 if (incomming === level_1.Level.INFO) {
429 display_1.Display.msg(name, data, name, Log.instances[moduleName].color, level_1.Level.INFO, Log.instances[moduleName].fixedWidth);
430 }
431 if (incomming === level_1.Level.WARN) {
432 display_1.Display.msg(name, data, name, Log.instances[moduleName].color, level_1.Level.WARN, Log.instances[moduleName].fixedWidth);
433 }
434 }
435 static onlyLevel(...level) {
436 if (Log._logOnly) {
437 console.error('You should use funcion onlyLevel only once');
438 return;
439 }
440 if (Log._logOnly)
441 Log._logOnly = true;
442 if (level.length === 0)
443 return;
444 Log.levels = level;
445 }
446 static onlyModules(...modules) {
447 if (Log._logModules) {
448 console.error('You should use funcion onlyModules only once');
449 return;
450 }
451 if (modules.length === 0)
452 return;
453 Log.modules = modules;
454 Log.muteAllOtherModules();
455 }
456 static isMutedModule(moduleName) {
457 if (Log.modules.length == 0)
458 return false;
459 if (!include_1.contain(Log.modules, moduleName))
460 return true;
461 return false;
462 }
463 static muteAllOtherModules() {
464 for (var moduleName in Log.instances) {
465 if (!include_1.contain(Log.modules, moduleName))
466 Log.instances[moduleName].mute();
467 }
468 }
469 static setProductionMode() {
470 if (Log.modeIsSet) {
471 console.error('Mode is already set');
472 return;
473 }
474 if (console !== undefined && console.clear !== undefined) {
475 setTimeout(() => {
476 console.clear();
477 console.log = () => { };
478 console.error = () => { };
479 console.warn = () => { };
480 console.info = () => { };
481 });
482 }
483 logger_1.Logger.isProductionMode = true;
484 Log.isDevelopmentMode = false;
485 }
486}
487Log.instances = {};
488Log.fixedWidth = 0;
489Log._logOnly = false;
490Log.levels = [];
491Log._logModules = false;
492Log.modules = [];
493Log.isDevelopmentMode = true;
494Log.modeIsSet = false;
495exports.Log = Log;
496
497
498/***/ }),
499/* 7 */
500/***/ (function(module, exports, __webpack_require__) {
501
502"use strict";
503
504Object.defineProperty(exports, "__esModule", { value: true });
505const level_1 = __webpack_require__(0);
506const display_1 = __webpack_require__(2);
507const include_1 = __webpack_require__(4);
508class Logger {
509 constructor(name, color, developmentMode, allowed, isMuted, fixedWidth, display) {
510 this.name = name;
511 this.color = color;
512 this.developmentMode = developmentMode;
513 this.allowed = allowed;
514 this.isMuted = isMuted;
515 this.fixedWidth = fixedWidth;
516 this.display = display;
517 /** @deprecated Use data(...)
518 * @see data
519 */
520 this.d = (name, ...data) => this._data(name, data);
521 /** @deprecated Use error(...)
522 * @see error
523 */
524 this.er = (name, ...data) => this._error(name, data);
525 /** @deprecated Use info(...)
526 * @see info
527 */
528 this.i = (name, ...data) => this._info(name, data);
529 /** @deprecated Use warn(...)
530 * @see warn
531 */
532 this.w = (name, ...data) => this._warn(name, data);
533 /**
534 * Logs message and data with the level=data
535 * @param message The message
536 * @param otherParams Additional parameters
537 */
538 this.data = (message, ...otherParams) => { return this._data(message, otherParams); };
539 /**
540 * Logs message and data with the level=error
541 * @param message The message
542 * @param otherParams Additional parameters
543 */
544 this.error = (message, ...otherParams) => this._error(message, otherParams);
545 /**
546 * Logs message and data with the level=info
547 * @param message The message
548 * @param otherParams Additional parameters
549 */
550 this.info = (message, ...otherParams) => this._info(message, otherParams);
551 /**
552 * Logs message and data with the level=warn
553 * @param message The message
554 * @param otherParams Additional parameters
555 */
556 this.warn = (message, ...otherParams) => this._warn(message, otherParams);
557 }
558 _data(name, ...data) {
559 if (this.allowed.length >= 1 && include_1.contain(this.allowed, level_1.Level.__NOTHING)
560 && !include_1.contain(this.allowed, level_1.Level.DATA))
561 return this;
562 if (Logger.isProductionMode)
563 return this;
564 if (this.display !== undefined)
565 this.display(name, data, level_1.Level.DATA, this.name);
566 else if (this.allowed.length === 0 || include_1.contain(this.allowed, level_1.Level.DATA)) {
567 display_1.Display.msg.apply(undefined, [name, ...data, this.name, this.color, level_1.Level.DATA, this.fixedWidth]);
568 }
569 return this;
570 }
571 _error(name, ...data) {
572 if (this.allowed.length >= 1 && include_1.contain(this.allowed, level_1.Level.__NOTHING)
573 && !include_1.contain(this.allowed, level_1.Level.ERROR))
574 return this;
575 if (Logger.isProductionMode)
576 return this;
577 if (this.display !== undefined)
578 this.display(name, data, level_1.Level.ERROR, this.name);
579 else if (this.allowed.length === 0 || include_1.contain(this.allowed, level_1.Level.ERROR)) {
580 display_1.Display.msg.apply(undefined, [name, ...data, this.name, this.color, level_1.Level.ERROR, this.fixedWidth]);
581 }
582 return this;
583 }
584 _info(name, ...data) {
585 if (this.allowed.length >= 1 && include_1.contain(this.allowed, level_1.Level.__NOTHING)
586 && !include_1.contain(this.allowed, level_1.Level.INFO))
587 return this;
588 if (Logger.isProductionMode)
589 return this;
590 if (this.display !== undefined)
591 this.display(name, data, level_1.Level.INFO, this.name);
592 else if (this.allowed.length === 0 || include_1.contain(this.allowed, level_1.Level.INFO)) {
593 display_1.Display.msg.apply(undefined, [name, ...data, this.name, this.color, level_1.Level.INFO, this.fixedWidth]);
594 }
595 return this;
596 }
597 _warn(name, ...data) {
598 if (this.allowed.length >= 1 && include_1.contain(this.allowed, level_1.Level.__NOTHING)
599 && !include_1.contain(this.allowed, level_1.Level.WARN))
600 return this;
601 if (Logger.isProductionMode)
602 return this;
603 if (this.display !== undefined)
604 this.display(name, data, level_1.Level.WARN, this.name);
605 else if (this.allowed.length === 0 || include_1.contain(this.allowed, level_1.Level.WARN)) {
606 display_1.Display.msg.apply(undefined, [name, ...data, this.name, this.color, level_1.Level.WARN, this.fixedWidth]);
607 }
608 return this;
609 }
610 _logMessage(name, level, ...data) {
611 if (this.isMuted)
612 return this;
613 if (this.allowed.length >= 1 && include_1.contain(this.allowed, level)
614 && !include_1.contain(this.allowed, level))
615 return this;
616 if (Logger.isProductionMode)
617 return this;
618 if (this.display !== undefined)
619 this.display(name, data, level, this.name);
620 else if (this.allowed.length === 0 || include_1.contain(this.allowed, level)) {
621 display_1.Display.msg(name, data, this.name, this.color, level, this.fixedWidth);
622 }
623 return this;
624 }
625 level(l) {
626 this._level = l;
627 return this;
628 }
629 mute() {
630 this.isMuted = true;
631 }
632}
633Logger.isProductionMode = false;
634exports.Logger = Logger;
635
636
637/***/ }),
638/* 8 */
639/***/ (function(module, exports, __webpack_require__) {
640
641"use strict";
642/* WEBPACK VAR INJECTION */(function(process) {
643Object.defineProperty(exports, "__esModule", { value: true });
644const level_1 = __webpack_require__(0);
645const helper_1 = __webpack_require__(1);
646if (helper_1.isNode) {
647 var chalk = __webpack_require__(9);
648 var path = __webpack_require__(10);
649 var fs = __webpack_require__(11);
650 var JSON5 = __webpack_require__(12);
651 var stringify = __webpack_require__(13);
652}
653function consoleLog(data, level) {
654 if (level === level_1.Level.INFO)
655 console.info(data);
656 else if (level === level_1.Level.ERROR)
657 console.error(data);
658 else if (level === level_1.Level.WARN)
659 console.warn(data);
660 else
661 console.log(data);
662}
663exports.consoleLog = consoleLog;
664function displayParams(params = [], level) {
665 params.forEach(param => {
666 if (typeof param === 'object') {
667 handleObjectData(param, level);
668 }
669 else if (isObjectAfterStringify(param)) {
670 handleObjectData(JSON5.parse(param), level);
671 }
672 else {
673 consoleLog(param, level);
674 }
675 });
676}
677exports.displayParams = displayParams;
678function replace(out, match, char, color) {
679 let m = out.match(match);
680 let outer = out;
681 if (m)
682 m.forEach(p => {
683 const rep = p
684 .slice(1)
685 .replace(char, '');
686 outer = outer.replace(`"${rep}":`, `"${color.call(null, rep)}":`);
687 });
688 return outer;
689}
690function handleObjectData(param, level) {
691 if (istartedInVscode()) {
692 consoleLog(param, level);
693 return;
694 }
695 let out = stringify(param, null, 4);
696 out = replace(out, /\".*"\:\ \"/g, /\"\: "/, chalk.green);
697 out = replace(out, /\".*"\:\ \{/g, /\"\: \{/, chalk.yellow);
698 out = replace(out, /\".*"\:\ \[/g, /\"\: \[/, chalk.red);
699 out = replace(out, /\".*"\:\ true/g, /\"\: true/, chalk.blue);
700 out = replace(out, /\".*"\:\ false/g, /\"\: false/, chalk.blue);
701 out = replace(out, /\".*"\:\ (\-|[0-9])/g, /\"\: (\-|[0-9])/, chalk.magenta);
702 out = out.replace(/\"/g, chalk.dim('"'))
703 .replace(/\{/g, chalk.dim('{'))
704 .replace(/\}/g, chalk.dim('}'))
705 .replace(/\}/g, chalk.dim('}'));
706 if (process.stdout.columns && process.stdout.columns > 0) {
707 out = out.split('\n').map(line => {
708 return (line.length < process.stdout.columns ?
709 line :
710 line.slice(0, process.stdout.columns - 6) + chalk.dim('...'));
711 }).join('\n');
712 }
713 consoleLog(out, level);
714}
715function istartedInVscode() {
716 let args = process.execArgv;
717 if (args) {
718 return args.some((arg) => /^--debug=?/.test(arg) ||
719 /^--debug-brk=?/.test(arg) ||
720 /^--inspect=?/.test(arg) ||
721 /^--inspect-brk=?/.test(arg));
722 }
723 return false;
724}
725exports.istartedInVscode = istartedInVscode;
726function isObjectAfterStringify(s) {
727 try {
728 const json = JSON5.parse(s);
729 return true;
730 }
731 catch (error) {
732 return false;
733 }
734}
735
736/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
737
738/***/ }),
739/* 9 */
740/***/ (function(module, exports) {
741
742module.exports = require("chalk");
743
744/***/ }),
745/* 10 */
746/***/ (function(module, exports, __webpack_require__) {
747
748/* WEBPACK VAR INJECTION */(function(process) {// Copyright Joyent, Inc. and other Node contributors.
749//
750// Permission is hereby granted, free of charge, to any person obtaining a
751// copy of this software and associated documentation files (the
752// "Software"), to deal in the Software without restriction, including
753// without limitation the rights to use, copy, modify, merge, publish,
754// distribute, sublicense, and/or sell copies of the Software, and to permit
755// persons to whom the Software is furnished to do so, subject to the
756// following conditions:
757//
758// The above copyright notice and this permission notice shall be included
759// in all copies or substantial portions of the Software.
760//
761// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
762// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
763// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
764// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
765// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
766// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
767// USE OR OTHER DEALINGS IN THE SOFTWARE.
768
769// resolves . and .. elements in a path array with directory names there
770// must be no slashes, empty elements, or device names (c:\) in the array
771// (so also no leading and trailing slashes - it does not distinguish
772// relative and absolute paths)
773function normalizeArray(parts, allowAboveRoot) {
774 // if the path tries to go above the root, `up` ends up > 0
775 var up = 0;
776 for (var i = parts.length - 1; i >= 0; i--) {
777 var last = parts[i];
778 if (last === '.') {
779 parts.splice(i, 1);
780 } else if (last === '..') {
781 parts.splice(i, 1);
782 up++;
783 } else if (up) {
784 parts.splice(i, 1);
785 up--;
786 }
787 }
788
789 // if the path is allowed to go above the root, restore leading ..s
790 if (allowAboveRoot) {
791 for (; up--; up) {
792 parts.unshift('..');
793 }
794 }
795
796 return parts;
797}
798
799// Split a filename into [root, dir, basename, ext], unix version
800// 'root' is just a slash, or nothing.
801var splitPathRe =
802 /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;
803var splitPath = function(filename) {
804 return splitPathRe.exec(filename).slice(1);
805};
806
807// path.resolve([from ...], to)
808// posix version
809exports.resolve = function() {
810 var resolvedPath = '',
811 resolvedAbsolute = false;
812
813 for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i--) {
814 var path = (i >= 0) ? arguments[i] : process.cwd();
815
816 // Skip empty and invalid entries
817 if (typeof path !== 'string') {
818 throw new TypeError('Arguments to path.resolve must be strings');
819 } else if (!path) {
820 continue;
821 }
822
823 resolvedPath = path + '/' + resolvedPath;
824 resolvedAbsolute = path.charAt(0) === '/';
825 }
826
827 // At this point the path should be resolved to a full absolute path, but
828 // handle relative paths to be safe (might happen when process.cwd() fails)
829
830 // Normalize the path
831 resolvedPath = normalizeArray(filter(resolvedPath.split('/'), function(p) {
832 return !!p;
833 }), !resolvedAbsolute).join('/');
834
835 return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
836};
837
838// path.normalize(path)
839// posix version
840exports.normalize = function(path) {
841 var isAbsolute = exports.isAbsolute(path),
842 trailingSlash = substr(path, -1) === '/';
843
844 // Normalize the path
845 path = normalizeArray(filter(path.split('/'), function(p) {
846 return !!p;
847 }), !isAbsolute).join('/');
848
849 if (!path && !isAbsolute) {
850 path = '.';
851 }
852 if (path && trailingSlash) {
853 path += '/';
854 }
855
856 return (isAbsolute ? '/' : '') + path;
857};
858
859// posix version
860exports.isAbsolute = function(path) {
861 return path.charAt(0) === '/';
862};
863
864// posix version
865exports.join = function() {
866 var paths = Array.prototype.slice.call(arguments, 0);
867 return exports.normalize(filter(paths, function(p, index) {
868 if (typeof p !== 'string') {
869 throw new TypeError('Arguments to path.join must be strings');
870 }
871 return p;
872 }).join('/'));
873};
874
875
876// path.relative(from, to)
877// posix version
878exports.relative = function(from, to) {
879 from = exports.resolve(from).substr(1);
880 to = exports.resolve(to).substr(1);
881
882 function trim(arr) {
883 var start = 0;
884 for (; start < arr.length; start++) {
885 if (arr[start] !== '') break;
886 }
887
888 var end = arr.length - 1;
889 for (; end >= 0; end--) {
890 if (arr[end] !== '') break;
891 }
892
893 if (start > end) return [];
894 return arr.slice(start, end - start + 1);
895 }
896
897 var fromParts = trim(from.split('/'));
898 var toParts = trim(to.split('/'));
899
900 var length = Math.min(fromParts.length, toParts.length);
901 var samePartsLength = length;
902 for (var i = 0; i < length; i++) {
903 if (fromParts[i] !== toParts[i]) {
904 samePartsLength = i;
905 break;
906 }
907 }
908
909 var outputParts = [];
910 for (var i = samePartsLength; i < fromParts.length; i++) {
911 outputParts.push('..');
912 }
913
914 outputParts = outputParts.concat(toParts.slice(samePartsLength));
915
916 return outputParts.join('/');
917};
918
919exports.sep = '/';
920exports.delimiter = ':';
921
922exports.dirname = function(path) {
923 var result = splitPath(path),
924 root = result[0],
925 dir = result[1];
926
927 if (!root && !dir) {
928 // No dirname whatsoever
929 return '.';
930 }
931
932 if (dir) {
933 // It has a dirname, strip trailing slash
934 dir = dir.substr(0, dir.length - 1);
935 }
936
937 return root + dir;
938};
939
940
941exports.basename = function(path, ext) {
942 var f = splitPath(path)[2];
943 // TODO: make this comparison case-insensitive on windows?
944 if (ext && f.substr(-1 * ext.length) === ext) {
945 f = f.substr(0, f.length - ext.length);
946 }
947 return f;
948};
949
950
951exports.extname = function(path) {
952 return splitPath(path)[3];
953};
954
955function filter (xs, f) {
956 if (xs.filter) return xs.filter(f);
957 var res = [];
958 for (var i = 0; i < xs.length; i++) {
959 if (f(xs[i], i, xs)) res.push(xs[i]);
960 }
961 return res;
962}
963
964// String.prototype.substr - negative index don't work in IE8
965var substr = 'ab'.substr(-1) === 'b'
966 ? function (str, start, len) { return str.substr(start, len) }
967 : function (str, start, len) {
968 if (start < 0) start = str.length + start;
969 return str.substr(start, len);
970 }
971;
972
973/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3)))
974
975/***/ }),
976/* 11 */
977/***/ (function(module, exports) {
978
979
980
981/***/ }),
982/* 12 */
983/***/ (function(module, exports) {
984
985module.exports = require("json5");
986
987/***/ }),
988/* 13 */
989/***/ (function(module, exports) {
990
991module.exports = require("json-stringify-safe");
992
993/***/ }),
994/* 14 */
995/***/ (function(module, exports) {
996
997module.exports = require("randomcolor");
998
999/***/ })
1000/******/ ])));
\No newline at end of file