@mjhls/mjh-framework 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1298 -19
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1298 -19
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -19,12 +19,7 @@ var NavDropdown = _interopDefault(require('react-bootstrap/NavDropdown'));
|
|
|
19
19
|
var Form = _interopDefault(require('react-bootstrap/Form'));
|
|
20
20
|
var FormControl = _interopDefault(require('react-bootstrap/FormControl'));
|
|
21
21
|
var Button = _interopDefault(require('react-bootstrap/Button'));
|
|
22
|
-
var events = _interopDefault(require('events'));
|
|
23
22
|
var PropTypes = _interopDefault(require('prop-types'));
|
|
24
|
-
var tty = _interopDefault(require('tty'));
|
|
25
|
-
var util = _interopDefault(require('util'));
|
|
26
|
-
var fs = _interopDefault(require('fs'));
|
|
27
|
-
var net = _interopDefault(require('net'));
|
|
28
23
|
|
|
29
24
|
/*! *****************************************************************************
|
|
30
25
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1450,6 +1445,472 @@ function createCommonjsModule(fn, module) {
|
|
|
1450
1445
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
1451
1446
|
}
|
|
1452
1447
|
|
|
1448
|
+
var domain;
|
|
1449
|
+
|
|
1450
|
+
// This constructor is used to store event handlers. Instantiating this is
|
|
1451
|
+
// faster than explicitly calling `Object.create(null)` to get a "clean" empty
|
|
1452
|
+
// object (tested with v8 v4.9).
|
|
1453
|
+
function EventHandlers() {}
|
|
1454
|
+
EventHandlers.prototype = Object.create(null);
|
|
1455
|
+
|
|
1456
|
+
function EventEmitter() {
|
|
1457
|
+
EventEmitter.init.call(this);
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
// nodejs oddity
|
|
1461
|
+
// require('events') === require('events').EventEmitter
|
|
1462
|
+
EventEmitter.EventEmitter = EventEmitter;
|
|
1463
|
+
|
|
1464
|
+
EventEmitter.usingDomains = false;
|
|
1465
|
+
|
|
1466
|
+
EventEmitter.prototype.domain = undefined;
|
|
1467
|
+
EventEmitter.prototype._events = undefined;
|
|
1468
|
+
EventEmitter.prototype._maxListeners = undefined;
|
|
1469
|
+
|
|
1470
|
+
// By default EventEmitters will print a warning if more than 10 listeners are
|
|
1471
|
+
// added to it. This is a useful default which helps finding memory leaks.
|
|
1472
|
+
EventEmitter.defaultMaxListeners = 10;
|
|
1473
|
+
|
|
1474
|
+
EventEmitter.init = function() {
|
|
1475
|
+
this.domain = null;
|
|
1476
|
+
if (EventEmitter.usingDomains) {
|
|
1477
|
+
// if there is an active domain, then attach to it.
|
|
1478
|
+
if (domain.active && !(this instanceof domain.Domain)) ;
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
if (!this._events || this._events === Object.getPrototypeOf(this)._events) {
|
|
1482
|
+
this._events = new EventHandlers();
|
|
1483
|
+
this._eventsCount = 0;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
this._maxListeners = this._maxListeners || undefined;
|
|
1487
|
+
};
|
|
1488
|
+
|
|
1489
|
+
// Obviously not all Emitters should be limited to 10. This function allows
|
|
1490
|
+
// that to be increased. Set to zero for unlimited.
|
|
1491
|
+
EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
|
|
1492
|
+
if (typeof n !== 'number' || n < 0 || isNaN(n))
|
|
1493
|
+
throw new TypeError('"n" argument must be a positive number');
|
|
1494
|
+
this._maxListeners = n;
|
|
1495
|
+
return this;
|
|
1496
|
+
};
|
|
1497
|
+
|
|
1498
|
+
function $getMaxListeners(that) {
|
|
1499
|
+
if (that._maxListeners === undefined)
|
|
1500
|
+
return EventEmitter.defaultMaxListeners;
|
|
1501
|
+
return that._maxListeners;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
|
|
1505
|
+
return $getMaxListeners(this);
|
|
1506
|
+
};
|
|
1507
|
+
|
|
1508
|
+
// These standalone emit* functions are used to optimize calling of event
|
|
1509
|
+
// handlers for fast cases because emit() itself often has a variable number of
|
|
1510
|
+
// arguments and can be deoptimized because of that. These functions always have
|
|
1511
|
+
// the same number of arguments and thus do not get deoptimized, so the code
|
|
1512
|
+
// inside them can execute faster.
|
|
1513
|
+
function emitNone(handler, isFn, self) {
|
|
1514
|
+
if (isFn)
|
|
1515
|
+
handler.call(self);
|
|
1516
|
+
else {
|
|
1517
|
+
var len = handler.length;
|
|
1518
|
+
var listeners = arrayClone(handler, len);
|
|
1519
|
+
for (var i = 0; i < len; ++i)
|
|
1520
|
+
listeners[i].call(self);
|
|
1521
|
+
}
|
|
1522
|
+
}
|
|
1523
|
+
function emitOne(handler, isFn, self, arg1) {
|
|
1524
|
+
if (isFn)
|
|
1525
|
+
handler.call(self, arg1);
|
|
1526
|
+
else {
|
|
1527
|
+
var len = handler.length;
|
|
1528
|
+
var listeners = arrayClone(handler, len);
|
|
1529
|
+
for (var i = 0; i < len; ++i)
|
|
1530
|
+
listeners[i].call(self, arg1);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
function emitTwo(handler, isFn, self, arg1, arg2) {
|
|
1534
|
+
if (isFn)
|
|
1535
|
+
handler.call(self, arg1, arg2);
|
|
1536
|
+
else {
|
|
1537
|
+
var len = handler.length;
|
|
1538
|
+
var listeners = arrayClone(handler, len);
|
|
1539
|
+
for (var i = 0; i < len; ++i)
|
|
1540
|
+
listeners[i].call(self, arg1, arg2);
|
|
1541
|
+
}
|
|
1542
|
+
}
|
|
1543
|
+
function emitThree(handler, isFn, self, arg1, arg2, arg3) {
|
|
1544
|
+
if (isFn)
|
|
1545
|
+
handler.call(self, arg1, arg2, arg3);
|
|
1546
|
+
else {
|
|
1547
|
+
var len = handler.length;
|
|
1548
|
+
var listeners = arrayClone(handler, len);
|
|
1549
|
+
for (var i = 0; i < len; ++i)
|
|
1550
|
+
listeners[i].call(self, arg1, arg2, arg3);
|
|
1551
|
+
}
|
|
1552
|
+
}
|
|
1553
|
+
|
|
1554
|
+
function emitMany(handler, isFn, self, args) {
|
|
1555
|
+
if (isFn)
|
|
1556
|
+
handler.apply(self, args);
|
|
1557
|
+
else {
|
|
1558
|
+
var len = handler.length;
|
|
1559
|
+
var listeners = arrayClone(handler, len);
|
|
1560
|
+
for (var i = 0; i < len; ++i)
|
|
1561
|
+
listeners[i].apply(self, args);
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
EventEmitter.prototype.emit = function emit(type) {
|
|
1566
|
+
var er, handler, len, args, i, events, domain;
|
|
1567
|
+
var doError = (type === 'error');
|
|
1568
|
+
|
|
1569
|
+
events = this._events;
|
|
1570
|
+
if (events)
|
|
1571
|
+
doError = (doError && events.error == null);
|
|
1572
|
+
else if (!doError)
|
|
1573
|
+
return false;
|
|
1574
|
+
|
|
1575
|
+
domain = this.domain;
|
|
1576
|
+
|
|
1577
|
+
// If there is no 'error' event listener then throw.
|
|
1578
|
+
if (doError) {
|
|
1579
|
+
er = arguments[1];
|
|
1580
|
+
if (domain) {
|
|
1581
|
+
if (!er)
|
|
1582
|
+
er = new Error('Uncaught, unspecified "error" event');
|
|
1583
|
+
er.domainEmitter = this;
|
|
1584
|
+
er.domain = domain;
|
|
1585
|
+
er.domainThrown = false;
|
|
1586
|
+
domain.emit('error', er);
|
|
1587
|
+
} else if (er instanceof Error) {
|
|
1588
|
+
throw er; // Unhandled 'error' event
|
|
1589
|
+
} else {
|
|
1590
|
+
// At least give some kind of context to the user
|
|
1591
|
+
var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
|
|
1592
|
+
err.context = er;
|
|
1593
|
+
throw err;
|
|
1594
|
+
}
|
|
1595
|
+
return false;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
handler = events[type];
|
|
1599
|
+
|
|
1600
|
+
if (!handler)
|
|
1601
|
+
return false;
|
|
1602
|
+
|
|
1603
|
+
var isFn = typeof handler === 'function';
|
|
1604
|
+
len = arguments.length;
|
|
1605
|
+
switch (len) {
|
|
1606
|
+
// fast cases
|
|
1607
|
+
case 1:
|
|
1608
|
+
emitNone(handler, isFn, this);
|
|
1609
|
+
break;
|
|
1610
|
+
case 2:
|
|
1611
|
+
emitOne(handler, isFn, this, arguments[1]);
|
|
1612
|
+
break;
|
|
1613
|
+
case 3:
|
|
1614
|
+
emitTwo(handler, isFn, this, arguments[1], arguments[2]);
|
|
1615
|
+
break;
|
|
1616
|
+
case 4:
|
|
1617
|
+
emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]);
|
|
1618
|
+
break;
|
|
1619
|
+
// slower
|
|
1620
|
+
default:
|
|
1621
|
+
args = new Array(len - 1);
|
|
1622
|
+
for (i = 1; i < len; i++)
|
|
1623
|
+
args[i - 1] = arguments[i];
|
|
1624
|
+
emitMany(handler, isFn, this, args);
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
return true;
|
|
1628
|
+
};
|
|
1629
|
+
|
|
1630
|
+
function _addListener(target, type, listener, prepend) {
|
|
1631
|
+
var m;
|
|
1632
|
+
var events;
|
|
1633
|
+
var existing;
|
|
1634
|
+
|
|
1635
|
+
if (typeof listener !== 'function')
|
|
1636
|
+
throw new TypeError('"listener" argument must be a function');
|
|
1637
|
+
|
|
1638
|
+
events = target._events;
|
|
1639
|
+
if (!events) {
|
|
1640
|
+
events = target._events = new EventHandlers();
|
|
1641
|
+
target._eventsCount = 0;
|
|
1642
|
+
} else {
|
|
1643
|
+
// To avoid recursion in the case that type === "newListener"! Before
|
|
1644
|
+
// adding it to the listeners, first emit "newListener".
|
|
1645
|
+
if (events.newListener) {
|
|
1646
|
+
target.emit('newListener', type,
|
|
1647
|
+
listener.listener ? listener.listener : listener);
|
|
1648
|
+
|
|
1649
|
+
// Re-assign `events` because a newListener handler could have caused the
|
|
1650
|
+
// this._events to be assigned to a new object
|
|
1651
|
+
events = target._events;
|
|
1652
|
+
}
|
|
1653
|
+
existing = events[type];
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
if (!existing) {
|
|
1657
|
+
// Optimize the case of one listener. Don't need the extra array object.
|
|
1658
|
+
existing = events[type] = listener;
|
|
1659
|
+
++target._eventsCount;
|
|
1660
|
+
} else {
|
|
1661
|
+
if (typeof existing === 'function') {
|
|
1662
|
+
// Adding the second element, need to change to array.
|
|
1663
|
+
existing = events[type] = prepend ? [listener, existing] :
|
|
1664
|
+
[existing, listener];
|
|
1665
|
+
} else {
|
|
1666
|
+
// If we've already got an array, just append.
|
|
1667
|
+
if (prepend) {
|
|
1668
|
+
existing.unshift(listener);
|
|
1669
|
+
} else {
|
|
1670
|
+
existing.push(listener);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
|
|
1674
|
+
// Check for listener leak
|
|
1675
|
+
if (!existing.warned) {
|
|
1676
|
+
m = $getMaxListeners(target);
|
|
1677
|
+
if (m && m > 0 && existing.length > m) {
|
|
1678
|
+
existing.warned = true;
|
|
1679
|
+
var w = new Error('Possible EventEmitter memory leak detected. ' +
|
|
1680
|
+
existing.length + ' ' + type + ' listeners added. ' +
|
|
1681
|
+
'Use emitter.setMaxListeners() to increase limit');
|
|
1682
|
+
w.name = 'MaxListenersExceededWarning';
|
|
1683
|
+
w.emitter = target;
|
|
1684
|
+
w.type = type;
|
|
1685
|
+
w.count = existing.length;
|
|
1686
|
+
emitWarning(w);
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
return target;
|
|
1692
|
+
}
|
|
1693
|
+
function emitWarning(e) {
|
|
1694
|
+
typeof console.warn === 'function' ? console.warn(e) : console.log(e);
|
|
1695
|
+
}
|
|
1696
|
+
EventEmitter.prototype.addListener = function addListener(type, listener) {
|
|
1697
|
+
return _addListener(this, type, listener, false);
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1700
|
+
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
|
1701
|
+
|
|
1702
|
+
EventEmitter.prototype.prependListener =
|
|
1703
|
+
function prependListener(type, listener) {
|
|
1704
|
+
return _addListener(this, type, listener, true);
|
|
1705
|
+
};
|
|
1706
|
+
|
|
1707
|
+
function _onceWrap(target, type, listener) {
|
|
1708
|
+
var fired = false;
|
|
1709
|
+
function g() {
|
|
1710
|
+
target.removeListener(type, g);
|
|
1711
|
+
if (!fired) {
|
|
1712
|
+
fired = true;
|
|
1713
|
+
listener.apply(target, arguments);
|
|
1714
|
+
}
|
|
1715
|
+
}
|
|
1716
|
+
g.listener = listener;
|
|
1717
|
+
return g;
|
|
1718
|
+
}
|
|
1719
|
+
|
|
1720
|
+
EventEmitter.prototype.once = function once(type, listener) {
|
|
1721
|
+
if (typeof listener !== 'function')
|
|
1722
|
+
throw new TypeError('"listener" argument must be a function');
|
|
1723
|
+
this.on(type, _onceWrap(this, type, listener));
|
|
1724
|
+
return this;
|
|
1725
|
+
};
|
|
1726
|
+
|
|
1727
|
+
EventEmitter.prototype.prependOnceListener =
|
|
1728
|
+
function prependOnceListener(type, listener) {
|
|
1729
|
+
if (typeof listener !== 'function')
|
|
1730
|
+
throw new TypeError('"listener" argument must be a function');
|
|
1731
|
+
this.prependListener(type, _onceWrap(this, type, listener));
|
|
1732
|
+
return this;
|
|
1733
|
+
};
|
|
1734
|
+
|
|
1735
|
+
// emits a 'removeListener' event iff the listener was removed
|
|
1736
|
+
EventEmitter.prototype.removeListener =
|
|
1737
|
+
function removeListener(type, listener) {
|
|
1738
|
+
var list, events, position, i, originalListener;
|
|
1739
|
+
|
|
1740
|
+
if (typeof listener !== 'function')
|
|
1741
|
+
throw new TypeError('"listener" argument must be a function');
|
|
1742
|
+
|
|
1743
|
+
events = this._events;
|
|
1744
|
+
if (!events)
|
|
1745
|
+
return this;
|
|
1746
|
+
|
|
1747
|
+
list = events[type];
|
|
1748
|
+
if (!list)
|
|
1749
|
+
return this;
|
|
1750
|
+
|
|
1751
|
+
if (list === listener || (list.listener && list.listener === listener)) {
|
|
1752
|
+
if (--this._eventsCount === 0)
|
|
1753
|
+
this._events = new EventHandlers();
|
|
1754
|
+
else {
|
|
1755
|
+
delete events[type];
|
|
1756
|
+
if (events.removeListener)
|
|
1757
|
+
this.emit('removeListener', type, list.listener || listener);
|
|
1758
|
+
}
|
|
1759
|
+
} else if (typeof list !== 'function') {
|
|
1760
|
+
position = -1;
|
|
1761
|
+
|
|
1762
|
+
for (i = list.length; i-- > 0;) {
|
|
1763
|
+
if (list[i] === listener ||
|
|
1764
|
+
(list[i].listener && list[i].listener === listener)) {
|
|
1765
|
+
originalListener = list[i].listener;
|
|
1766
|
+
position = i;
|
|
1767
|
+
break;
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
if (position < 0)
|
|
1772
|
+
return this;
|
|
1773
|
+
|
|
1774
|
+
if (list.length === 1) {
|
|
1775
|
+
list[0] = undefined;
|
|
1776
|
+
if (--this._eventsCount === 0) {
|
|
1777
|
+
this._events = new EventHandlers();
|
|
1778
|
+
return this;
|
|
1779
|
+
} else {
|
|
1780
|
+
delete events[type];
|
|
1781
|
+
}
|
|
1782
|
+
} else {
|
|
1783
|
+
spliceOne(list, position);
|
|
1784
|
+
}
|
|
1785
|
+
|
|
1786
|
+
if (events.removeListener)
|
|
1787
|
+
this.emit('removeListener', type, originalListener || listener);
|
|
1788
|
+
}
|
|
1789
|
+
|
|
1790
|
+
return this;
|
|
1791
|
+
};
|
|
1792
|
+
|
|
1793
|
+
EventEmitter.prototype.removeAllListeners =
|
|
1794
|
+
function removeAllListeners(type) {
|
|
1795
|
+
var listeners, events;
|
|
1796
|
+
|
|
1797
|
+
events = this._events;
|
|
1798
|
+
if (!events)
|
|
1799
|
+
return this;
|
|
1800
|
+
|
|
1801
|
+
// not listening for removeListener, no need to emit
|
|
1802
|
+
if (!events.removeListener) {
|
|
1803
|
+
if (arguments.length === 0) {
|
|
1804
|
+
this._events = new EventHandlers();
|
|
1805
|
+
this._eventsCount = 0;
|
|
1806
|
+
} else if (events[type]) {
|
|
1807
|
+
if (--this._eventsCount === 0)
|
|
1808
|
+
this._events = new EventHandlers();
|
|
1809
|
+
else
|
|
1810
|
+
delete events[type];
|
|
1811
|
+
}
|
|
1812
|
+
return this;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
// emit removeListener for all listeners on all events
|
|
1816
|
+
if (arguments.length === 0) {
|
|
1817
|
+
var keys = Object.keys(events);
|
|
1818
|
+
for (var i = 0, key; i < keys.length; ++i) {
|
|
1819
|
+
key = keys[i];
|
|
1820
|
+
if (key === 'removeListener') continue;
|
|
1821
|
+
this.removeAllListeners(key);
|
|
1822
|
+
}
|
|
1823
|
+
this.removeAllListeners('removeListener');
|
|
1824
|
+
this._events = new EventHandlers();
|
|
1825
|
+
this._eventsCount = 0;
|
|
1826
|
+
return this;
|
|
1827
|
+
}
|
|
1828
|
+
|
|
1829
|
+
listeners = events[type];
|
|
1830
|
+
|
|
1831
|
+
if (typeof listeners === 'function') {
|
|
1832
|
+
this.removeListener(type, listeners);
|
|
1833
|
+
} else if (listeners) {
|
|
1834
|
+
// LIFO order
|
|
1835
|
+
do {
|
|
1836
|
+
this.removeListener(type, listeners[listeners.length - 1]);
|
|
1837
|
+
} while (listeners[0]);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
return this;
|
|
1841
|
+
};
|
|
1842
|
+
|
|
1843
|
+
EventEmitter.prototype.listeners = function listeners(type) {
|
|
1844
|
+
var evlistener;
|
|
1845
|
+
var ret;
|
|
1846
|
+
var events = this._events;
|
|
1847
|
+
|
|
1848
|
+
if (!events)
|
|
1849
|
+
ret = [];
|
|
1850
|
+
else {
|
|
1851
|
+
evlistener = events[type];
|
|
1852
|
+
if (!evlistener)
|
|
1853
|
+
ret = [];
|
|
1854
|
+
else if (typeof evlistener === 'function')
|
|
1855
|
+
ret = [evlistener.listener || evlistener];
|
|
1856
|
+
else
|
|
1857
|
+
ret = unwrapListeners(evlistener);
|
|
1858
|
+
}
|
|
1859
|
+
|
|
1860
|
+
return ret;
|
|
1861
|
+
};
|
|
1862
|
+
|
|
1863
|
+
EventEmitter.listenerCount = function(emitter, type) {
|
|
1864
|
+
if (typeof emitter.listenerCount === 'function') {
|
|
1865
|
+
return emitter.listenerCount(type);
|
|
1866
|
+
} else {
|
|
1867
|
+
return listenerCount.call(emitter, type);
|
|
1868
|
+
}
|
|
1869
|
+
};
|
|
1870
|
+
|
|
1871
|
+
EventEmitter.prototype.listenerCount = listenerCount;
|
|
1872
|
+
function listenerCount(type) {
|
|
1873
|
+
var events = this._events;
|
|
1874
|
+
|
|
1875
|
+
if (events) {
|
|
1876
|
+
var evlistener = events[type];
|
|
1877
|
+
|
|
1878
|
+
if (typeof evlistener === 'function') {
|
|
1879
|
+
return 1;
|
|
1880
|
+
} else if (evlistener) {
|
|
1881
|
+
return evlistener.length;
|
|
1882
|
+
}
|
|
1883
|
+
}
|
|
1884
|
+
|
|
1885
|
+
return 0;
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
EventEmitter.prototype.eventNames = function eventNames() {
|
|
1889
|
+
return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : [];
|
|
1890
|
+
};
|
|
1891
|
+
|
|
1892
|
+
// About 1.5x faster than the two-arg version of Array#splice().
|
|
1893
|
+
function spliceOne(list, index) {
|
|
1894
|
+
for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1)
|
|
1895
|
+
list[i] = list[k];
|
|
1896
|
+
list.pop();
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
function arrayClone(arr, i) {
|
|
1900
|
+
var copy = new Array(i);
|
|
1901
|
+
while (i--)
|
|
1902
|
+
copy[i] = arr[i];
|
|
1903
|
+
return copy;
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1906
|
+
function unwrapListeners(arr) {
|
|
1907
|
+
var ret = new Array(arr.length);
|
|
1908
|
+
for (var i = 0; i < ret.length; ++i) {
|
|
1909
|
+
ret[i] = arr[i].listener || arr[i];
|
|
1910
|
+
}
|
|
1911
|
+
return ret;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1453
1914
|
var utils = createCommonjsModule(function (module, exports) {
|
|
1454
1915
|
|
|
1455
1916
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1516,7 +1977,7 @@ var registeredSlots = {};
|
|
|
1516
1977
|
var managerAlreadyInitialized = false;
|
|
1517
1978
|
var globalTargetingArguments = {};
|
|
1518
1979
|
var globalAdSenseAttributes = {};
|
|
1519
|
-
var DFPManager = Object.assign(new
|
|
1980
|
+
var DFPManager = Object.assign(new EventEmitter.EventEmitter().setMaxListeners(0), {
|
|
1520
1981
|
singleRequestIsEnabled: function singleRequestIsEnabled() {
|
|
1521
1982
|
return singleRequestEnabled;
|
|
1522
1983
|
},
|
|
@@ -2911,7 +3372,7 @@ var Sister;
|
|
|
2911
3372
|
*/
|
|
2912
3373
|
Sister = function () {
|
|
2913
3374
|
var sister = {},
|
|
2914
|
-
events
|
|
3375
|
+
events = {};
|
|
2915
3376
|
|
|
2916
3377
|
/**
|
|
2917
3378
|
* @name handler
|
|
@@ -2926,8 +3387,8 @@ Sister = function () {
|
|
|
2926
3387
|
*/
|
|
2927
3388
|
sister.on = function (name, handler) {
|
|
2928
3389
|
var listener = {name: name, handler: handler};
|
|
2929
|
-
events
|
|
2930
|
-
events
|
|
3390
|
+
events[name] = events[name] || [];
|
|
3391
|
+
events[name].unshift(listener);
|
|
2931
3392
|
return listener;
|
|
2932
3393
|
};
|
|
2933
3394
|
|
|
@@ -2935,10 +3396,10 @@ Sister = function () {
|
|
|
2935
3396
|
* @param {listener}
|
|
2936
3397
|
*/
|
|
2937
3398
|
sister.off = function (listener) {
|
|
2938
|
-
var index = events
|
|
3399
|
+
var index = events[listener.name].indexOf(listener);
|
|
2939
3400
|
|
|
2940
3401
|
if (index !== -1) {
|
|
2941
|
-
events
|
|
3402
|
+
events[listener.name].splice(index, 1);
|
|
2942
3403
|
}
|
|
2943
3404
|
};
|
|
2944
3405
|
|
|
@@ -2947,7 +3408,7 @@ Sister = function () {
|
|
|
2947
3408
|
* @param {Object} data Event data.
|
|
2948
3409
|
*/
|
|
2949
3410
|
sister.trigger = function (name, data) {
|
|
2950
|
-
var listeners = events
|
|
3411
|
+
var listeners = events[name],
|
|
2951
3412
|
i;
|
|
2952
3413
|
|
|
2953
3414
|
if (listeners) {
|
|
@@ -3641,6 +4102,824 @@ var browser_5 = browser.useColors;
|
|
|
3641
4102
|
var browser_6 = browser.storage;
|
|
3642
4103
|
var browser_7 = browser.colors;
|
|
3643
4104
|
|
|
4105
|
+
// MIT lisence
|
|
4106
|
+
// from https://github.com/substack/tty-browserify/blob/1ba769a6429d242f36226538835b4034bf6b7886/index.js
|
|
4107
|
+
|
|
4108
|
+
function isatty() {
|
|
4109
|
+
return false;
|
|
4110
|
+
}
|
|
4111
|
+
|
|
4112
|
+
function ReadStream() {
|
|
4113
|
+
throw new Error('tty.ReadStream is not implemented');
|
|
4114
|
+
}
|
|
4115
|
+
|
|
4116
|
+
function WriteStream() {
|
|
4117
|
+
throw new Error('tty.ReadStream is not implemented');
|
|
4118
|
+
}
|
|
4119
|
+
|
|
4120
|
+
var tty = {
|
|
4121
|
+
isatty: isatty,
|
|
4122
|
+
ReadStream: ReadStream,
|
|
4123
|
+
WriteStream: WriteStream
|
|
4124
|
+
};
|
|
4125
|
+
|
|
4126
|
+
// shim for using process in browser
|
|
4127
|
+
// based off https://github.com/defunctzombie/node-process/blob/master/browser.js
|
|
4128
|
+
|
|
4129
|
+
function defaultSetTimout() {
|
|
4130
|
+
throw new Error('setTimeout has not been defined');
|
|
4131
|
+
}
|
|
4132
|
+
function defaultClearTimeout () {
|
|
4133
|
+
throw new Error('clearTimeout has not been defined');
|
|
4134
|
+
}
|
|
4135
|
+
var cachedSetTimeout = defaultSetTimout;
|
|
4136
|
+
var cachedClearTimeout = defaultClearTimeout;
|
|
4137
|
+
if (typeof global.setTimeout === 'function') {
|
|
4138
|
+
cachedSetTimeout = setTimeout;
|
|
4139
|
+
}
|
|
4140
|
+
if (typeof global.clearTimeout === 'function') {
|
|
4141
|
+
cachedClearTimeout = clearTimeout;
|
|
4142
|
+
}
|
|
4143
|
+
|
|
4144
|
+
function runTimeout(fun) {
|
|
4145
|
+
if (cachedSetTimeout === setTimeout) {
|
|
4146
|
+
//normal enviroments in sane situations
|
|
4147
|
+
return setTimeout(fun, 0);
|
|
4148
|
+
}
|
|
4149
|
+
// if setTimeout wasn't available but was latter defined
|
|
4150
|
+
if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
|
|
4151
|
+
cachedSetTimeout = setTimeout;
|
|
4152
|
+
return setTimeout(fun, 0);
|
|
4153
|
+
}
|
|
4154
|
+
try {
|
|
4155
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
4156
|
+
return cachedSetTimeout(fun, 0);
|
|
4157
|
+
} catch(e){
|
|
4158
|
+
try {
|
|
4159
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
4160
|
+
return cachedSetTimeout.call(null, fun, 0);
|
|
4161
|
+
} catch(e){
|
|
4162
|
+
// 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
|
|
4163
|
+
return cachedSetTimeout.call(this, fun, 0);
|
|
4164
|
+
}
|
|
4165
|
+
}
|
|
4166
|
+
|
|
4167
|
+
|
|
4168
|
+
}
|
|
4169
|
+
function runClearTimeout(marker) {
|
|
4170
|
+
if (cachedClearTimeout === clearTimeout) {
|
|
4171
|
+
//normal enviroments in sane situations
|
|
4172
|
+
return clearTimeout(marker);
|
|
4173
|
+
}
|
|
4174
|
+
// if clearTimeout wasn't available but was latter defined
|
|
4175
|
+
if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
|
|
4176
|
+
cachedClearTimeout = clearTimeout;
|
|
4177
|
+
return clearTimeout(marker);
|
|
4178
|
+
}
|
|
4179
|
+
try {
|
|
4180
|
+
// when when somebody has screwed with setTimeout but no I.E. maddness
|
|
4181
|
+
return cachedClearTimeout(marker);
|
|
4182
|
+
} catch (e){
|
|
4183
|
+
try {
|
|
4184
|
+
// When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
|
|
4185
|
+
return cachedClearTimeout.call(null, marker);
|
|
4186
|
+
} catch (e){
|
|
4187
|
+
// 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.
|
|
4188
|
+
// Some versions of I.E. have different rules for clearTimeout vs setTimeout
|
|
4189
|
+
return cachedClearTimeout.call(this, marker);
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4192
|
+
|
|
4193
|
+
|
|
4194
|
+
|
|
4195
|
+
}
|
|
4196
|
+
var queue = [];
|
|
4197
|
+
var draining = false;
|
|
4198
|
+
var currentQueue;
|
|
4199
|
+
var queueIndex = -1;
|
|
4200
|
+
|
|
4201
|
+
function cleanUpNextTick() {
|
|
4202
|
+
if (!draining || !currentQueue) {
|
|
4203
|
+
return;
|
|
4204
|
+
}
|
|
4205
|
+
draining = false;
|
|
4206
|
+
if (currentQueue.length) {
|
|
4207
|
+
queue = currentQueue.concat(queue);
|
|
4208
|
+
} else {
|
|
4209
|
+
queueIndex = -1;
|
|
4210
|
+
}
|
|
4211
|
+
if (queue.length) {
|
|
4212
|
+
drainQueue();
|
|
4213
|
+
}
|
|
4214
|
+
}
|
|
4215
|
+
|
|
4216
|
+
function drainQueue() {
|
|
4217
|
+
if (draining) {
|
|
4218
|
+
return;
|
|
4219
|
+
}
|
|
4220
|
+
var timeout = runTimeout(cleanUpNextTick);
|
|
4221
|
+
draining = true;
|
|
4222
|
+
|
|
4223
|
+
var len = queue.length;
|
|
4224
|
+
while(len) {
|
|
4225
|
+
currentQueue = queue;
|
|
4226
|
+
queue = [];
|
|
4227
|
+
while (++queueIndex < len) {
|
|
4228
|
+
if (currentQueue) {
|
|
4229
|
+
currentQueue[queueIndex].run();
|
|
4230
|
+
}
|
|
4231
|
+
}
|
|
4232
|
+
queueIndex = -1;
|
|
4233
|
+
len = queue.length;
|
|
4234
|
+
}
|
|
4235
|
+
currentQueue = null;
|
|
4236
|
+
draining = false;
|
|
4237
|
+
runClearTimeout(timeout);
|
|
4238
|
+
}
|
|
4239
|
+
function nextTick(fun) {
|
|
4240
|
+
var args = new Array(arguments.length - 1);
|
|
4241
|
+
if (arguments.length > 1) {
|
|
4242
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
4243
|
+
args[i - 1] = arguments[i];
|
|
4244
|
+
}
|
|
4245
|
+
}
|
|
4246
|
+
queue.push(new Item(fun, args));
|
|
4247
|
+
if (queue.length === 1 && !draining) {
|
|
4248
|
+
runTimeout(drainQueue);
|
|
4249
|
+
}
|
|
4250
|
+
}
|
|
4251
|
+
// v8 likes predictible objects
|
|
4252
|
+
function Item(fun, array) {
|
|
4253
|
+
this.fun = fun;
|
|
4254
|
+
this.array = array;
|
|
4255
|
+
}
|
|
4256
|
+
Item.prototype.run = function () {
|
|
4257
|
+
this.fun.apply(null, this.array);
|
|
4258
|
+
};
|
|
4259
|
+
var title = 'browser';
|
|
4260
|
+
var platform = 'browser';
|
|
4261
|
+
var browser$1 = true;
|
|
4262
|
+
var env = {};
|
|
4263
|
+
var argv = [];
|
|
4264
|
+
var version = ''; // empty string to avoid regexp issues
|
|
4265
|
+
var versions = {};
|
|
4266
|
+
var release = {};
|
|
4267
|
+
var config = {};
|
|
4268
|
+
|
|
4269
|
+
function noop() {}
|
|
4270
|
+
|
|
4271
|
+
var on = noop;
|
|
4272
|
+
var addListener = noop;
|
|
4273
|
+
var once = noop;
|
|
4274
|
+
var off = noop;
|
|
4275
|
+
var removeListener = noop;
|
|
4276
|
+
var removeAllListeners = noop;
|
|
4277
|
+
var emit = noop;
|
|
4278
|
+
|
|
4279
|
+
function binding(name) {
|
|
4280
|
+
throw new Error('process.binding is not supported');
|
|
4281
|
+
}
|
|
4282
|
+
|
|
4283
|
+
function cwd () { return '/' }
|
|
4284
|
+
function chdir (dir) {
|
|
4285
|
+
throw new Error('process.chdir is not supported');
|
|
4286
|
+
}function umask() { return 0; }
|
|
4287
|
+
|
|
4288
|
+
// from https://github.com/kumavis/browser-process-hrtime/blob/master/index.js
|
|
4289
|
+
var performance = global.performance || {};
|
|
4290
|
+
var performanceNow =
|
|
4291
|
+
performance.now ||
|
|
4292
|
+
performance.mozNow ||
|
|
4293
|
+
performance.msNow ||
|
|
4294
|
+
performance.oNow ||
|
|
4295
|
+
performance.webkitNow ||
|
|
4296
|
+
function(){ return (new Date()).getTime() };
|
|
4297
|
+
|
|
4298
|
+
// generate timestamp or delta
|
|
4299
|
+
// see http://nodejs.org/api/process.html#process_process_hrtime
|
|
4300
|
+
function hrtime(previousTimestamp){
|
|
4301
|
+
var clocktime = performanceNow.call(performance)*1e-3;
|
|
4302
|
+
var seconds = Math.floor(clocktime);
|
|
4303
|
+
var nanoseconds = Math.floor((clocktime%1)*1e9);
|
|
4304
|
+
if (previousTimestamp) {
|
|
4305
|
+
seconds = seconds - previousTimestamp[0];
|
|
4306
|
+
nanoseconds = nanoseconds - previousTimestamp[1];
|
|
4307
|
+
if (nanoseconds<0) {
|
|
4308
|
+
seconds--;
|
|
4309
|
+
nanoseconds += 1e9;
|
|
4310
|
+
}
|
|
4311
|
+
}
|
|
4312
|
+
return [seconds,nanoseconds]
|
|
4313
|
+
}
|
|
4314
|
+
|
|
4315
|
+
var startTime = new Date();
|
|
4316
|
+
function uptime() {
|
|
4317
|
+
var currentTime = new Date();
|
|
4318
|
+
var dif = currentTime - startTime;
|
|
4319
|
+
return dif / 1000;
|
|
4320
|
+
}
|
|
4321
|
+
|
|
4322
|
+
var process$1 = {
|
|
4323
|
+
nextTick: nextTick,
|
|
4324
|
+
title: title,
|
|
4325
|
+
browser: browser$1,
|
|
4326
|
+
env: env,
|
|
4327
|
+
argv: argv,
|
|
4328
|
+
version: version,
|
|
4329
|
+
versions: versions,
|
|
4330
|
+
on: on,
|
|
4331
|
+
addListener: addListener,
|
|
4332
|
+
once: once,
|
|
4333
|
+
off: off,
|
|
4334
|
+
removeListener: removeListener,
|
|
4335
|
+
removeAllListeners: removeAllListeners,
|
|
4336
|
+
emit: emit,
|
|
4337
|
+
binding: binding,
|
|
4338
|
+
cwd: cwd,
|
|
4339
|
+
chdir: chdir,
|
|
4340
|
+
umask: umask,
|
|
4341
|
+
hrtime: hrtime,
|
|
4342
|
+
platform: platform,
|
|
4343
|
+
release: release,
|
|
4344
|
+
config: config,
|
|
4345
|
+
uptime: uptime
|
|
4346
|
+
};
|
|
4347
|
+
|
|
4348
|
+
var inherits$1;
|
|
4349
|
+
if (typeof Object.create === 'function'){
|
|
4350
|
+
inherits$1 = function inherits(ctor, superCtor) {
|
|
4351
|
+
// implementation from standard node.js 'util' module
|
|
4352
|
+
ctor.super_ = superCtor;
|
|
4353
|
+
ctor.prototype = Object.create(superCtor.prototype, {
|
|
4354
|
+
constructor: {
|
|
4355
|
+
value: ctor,
|
|
4356
|
+
enumerable: false,
|
|
4357
|
+
writable: true,
|
|
4358
|
+
configurable: true
|
|
4359
|
+
}
|
|
4360
|
+
});
|
|
4361
|
+
};
|
|
4362
|
+
} else {
|
|
4363
|
+
inherits$1 = function inherits(ctor, superCtor) {
|
|
4364
|
+
ctor.super_ = superCtor;
|
|
4365
|
+
var TempCtor = function () {};
|
|
4366
|
+
TempCtor.prototype = superCtor.prototype;
|
|
4367
|
+
ctor.prototype = new TempCtor();
|
|
4368
|
+
ctor.prototype.constructor = ctor;
|
|
4369
|
+
};
|
|
4370
|
+
}
|
|
4371
|
+
var inherits$2 = inherits$1;
|
|
4372
|
+
|
|
4373
|
+
// Copyright Joyent, Inc. and other Node contributors.
|
|
4374
|
+
var formatRegExp = /%[sdj%]/g;
|
|
4375
|
+
function format(f) {
|
|
4376
|
+
if (!isString(f)) {
|
|
4377
|
+
var objects = [];
|
|
4378
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
4379
|
+
objects.push(inspect(arguments[i]));
|
|
4380
|
+
}
|
|
4381
|
+
return objects.join(' ');
|
|
4382
|
+
}
|
|
4383
|
+
|
|
4384
|
+
var i = 1;
|
|
4385
|
+
var args = arguments;
|
|
4386
|
+
var len = args.length;
|
|
4387
|
+
var str = String(f).replace(formatRegExp, function(x) {
|
|
4388
|
+
if (x === '%%') return '%';
|
|
4389
|
+
if (i >= len) return x;
|
|
4390
|
+
switch (x) {
|
|
4391
|
+
case '%s': return String(args[i++]);
|
|
4392
|
+
case '%d': return Number(args[i++]);
|
|
4393
|
+
case '%j':
|
|
4394
|
+
try {
|
|
4395
|
+
return JSON.stringify(args[i++]);
|
|
4396
|
+
} catch (_) {
|
|
4397
|
+
return '[Circular]';
|
|
4398
|
+
}
|
|
4399
|
+
default:
|
|
4400
|
+
return x;
|
|
4401
|
+
}
|
|
4402
|
+
});
|
|
4403
|
+
for (var x = args[i]; i < len; x = args[++i]) {
|
|
4404
|
+
if (isNull(x) || !isObject(x)) {
|
|
4405
|
+
str += ' ' + x;
|
|
4406
|
+
} else {
|
|
4407
|
+
str += ' ' + inspect(x);
|
|
4408
|
+
}
|
|
4409
|
+
}
|
|
4410
|
+
return str;
|
|
4411
|
+
}
|
|
4412
|
+
|
|
4413
|
+
// Mark that a method should not be used.
|
|
4414
|
+
// Returns a modified function which warns once by default.
|
|
4415
|
+
// If --no-deprecation is set, then it is a no-op.
|
|
4416
|
+
function deprecate(fn, msg) {
|
|
4417
|
+
// Allow for deprecating things in the process of starting up.
|
|
4418
|
+
if (isUndefined(global.process)) {
|
|
4419
|
+
return function() {
|
|
4420
|
+
return deprecate(fn, msg).apply(this, arguments);
|
|
4421
|
+
};
|
|
4422
|
+
}
|
|
4423
|
+
|
|
4424
|
+
var warned = false;
|
|
4425
|
+
function deprecated() {
|
|
4426
|
+
if (!warned) {
|
|
4427
|
+
{
|
|
4428
|
+
console.error(msg);
|
|
4429
|
+
}
|
|
4430
|
+
warned = true;
|
|
4431
|
+
}
|
|
4432
|
+
return fn.apply(this, arguments);
|
|
4433
|
+
}
|
|
4434
|
+
|
|
4435
|
+
return deprecated;
|
|
4436
|
+
}
|
|
4437
|
+
|
|
4438
|
+
var debugs = {};
|
|
4439
|
+
var debugEnviron;
|
|
4440
|
+
function debuglog(set) {
|
|
4441
|
+
if (isUndefined(debugEnviron))
|
|
4442
|
+
debugEnviron = process$1.env.NODE_DEBUG || '';
|
|
4443
|
+
set = set.toUpperCase();
|
|
4444
|
+
if (!debugs[set]) {
|
|
4445
|
+
if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
|
|
4446
|
+
var pid = 0;
|
|
4447
|
+
debugs[set] = function() {
|
|
4448
|
+
var msg = format.apply(null, arguments);
|
|
4449
|
+
console.error('%s %d: %s', set, pid, msg);
|
|
4450
|
+
};
|
|
4451
|
+
} else {
|
|
4452
|
+
debugs[set] = function() {};
|
|
4453
|
+
}
|
|
4454
|
+
}
|
|
4455
|
+
return debugs[set];
|
|
4456
|
+
}
|
|
4457
|
+
|
|
4458
|
+
/**
|
|
4459
|
+
* Echos the value of a value. Trys to print the value out
|
|
4460
|
+
* in the best way possible given the different types.
|
|
4461
|
+
*
|
|
4462
|
+
* @param {Object} obj The object to print out.
|
|
4463
|
+
* @param {Object} opts Optional options object that alters the output.
|
|
4464
|
+
*/
|
|
4465
|
+
/* legacy: obj, showHidden, depth, colors*/
|
|
4466
|
+
function inspect(obj, opts) {
|
|
4467
|
+
// default options
|
|
4468
|
+
var ctx = {
|
|
4469
|
+
seen: [],
|
|
4470
|
+
stylize: stylizeNoColor
|
|
4471
|
+
};
|
|
4472
|
+
// legacy...
|
|
4473
|
+
if (arguments.length >= 3) ctx.depth = arguments[2];
|
|
4474
|
+
if (arguments.length >= 4) ctx.colors = arguments[3];
|
|
4475
|
+
if (isBoolean(opts)) {
|
|
4476
|
+
// legacy...
|
|
4477
|
+
ctx.showHidden = opts;
|
|
4478
|
+
} else if (opts) {
|
|
4479
|
+
// got an "options" object
|
|
4480
|
+
_extend(ctx, opts);
|
|
4481
|
+
}
|
|
4482
|
+
// set default options
|
|
4483
|
+
if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
|
|
4484
|
+
if (isUndefined(ctx.depth)) ctx.depth = 2;
|
|
4485
|
+
if (isUndefined(ctx.colors)) ctx.colors = false;
|
|
4486
|
+
if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
|
|
4487
|
+
if (ctx.colors) ctx.stylize = stylizeWithColor;
|
|
4488
|
+
return formatValue(ctx, obj, ctx.depth);
|
|
4489
|
+
}
|
|
4490
|
+
|
|
4491
|
+
// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
|
|
4492
|
+
inspect.colors = {
|
|
4493
|
+
'bold' : [1, 22],
|
|
4494
|
+
'italic' : [3, 23],
|
|
4495
|
+
'underline' : [4, 24],
|
|
4496
|
+
'inverse' : [7, 27],
|
|
4497
|
+
'white' : [37, 39],
|
|
4498
|
+
'grey' : [90, 39],
|
|
4499
|
+
'black' : [30, 39],
|
|
4500
|
+
'blue' : [34, 39],
|
|
4501
|
+
'cyan' : [36, 39],
|
|
4502
|
+
'green' : [32, 39],
|
|
4503
|
+
'magenta' : [35, 39],
|
|
4504
|
+
'red' : [31, 39],
|
|
4505
|
+
'yellow' : [33, 39]
|
|
4506
|
+
};
|
|
4507
|
+
|
|
4508
|
+
// Don't use 'blue' not visible on cmd.exe
|
|
4509
|
+
inspect.styles = {
|
|
4510
|
+
'special': 'cyan',
|
|
4511
|
+
'number': 'yellow',
|
|
4512
|
+
'boolean': 'yellow',
|
|
4513
|
+
'undefined': 'grey',
|
|
4514
|
+
'null': 'bold',
|
|
4515
|
+
'string': 'green',
|
|
4516
|
+
'date': 'magenta',
|
|
4517
|
+
// "name": intentionally not styling
|
|
4518
|
+
'regexp': 'red'
|
|
4519
|
+
};
|
|
4520
|
+
|
|
4521
|
+
|
|
4522
|
+
function stylizeWithColor(str, styleType) {
|
|
4523
|
+
var style = inspect.styles[styleType];
|
|
4524
|
+
|
|
4525
|
+
if (style) {
|
|
4526
|
+
return '\u001b[' + inspect.colors[style][0] + 'm' + str +
|
|
4527
|
+
'\u001b[' + inspect.colors[style][1] + 'm';
|
|
4528
|
+
} else {
|
|
4529
|
+
return str;
|
|
4530
|
+
}
|
|
4531
|
+
}
|
|
4532
|
+
|
|
4533
|
+
|
|
4534
|
+
function stylizeNoColor(str, styleType) {
|
|
4535
|
+
return str;
|
|
4536
|
+
}
|
|
4537
|
+
|
|
4538
|
+
|
|
4539
|
+
function arrayToHash(array) {
|
|
4540
|
+
var hash = {};
|
|
4541
|
+
|
|
4542
|
+
array.forEach(function(val, idx) {
|
|
4543
|
+
hash[val] = true;
|
|
4544
|
+
});
|
|
4545
|
+
|
|
4546
|
+
return hash;
|
|
4547
|
+
}
|
|
4548
|
+
|
|
4549
|
+
|
|
4550
|
+
function formatValue(ctx, value, recurseTimes) {
|
|
4551
|
+
// Provide a hook for user-specified inspect functions.
|
|
4552
|
+
// Check that value is an object with an inspect function on it
|
|
4553
|
+
if (ctx.customInspect &&
|
|
4554
|
+
value &&
|
|
4555
|
+
isFunction(value.inspect) &&
|
|
4556
|
+
// Filter out the util module, it's inspect function is special
|
|
4557
|
+
value.inspect !== inspect &&
|
|
4558
|
+
// Also filter out any prototype objects using the circular check.
|
|
4559
|
+
!(value.constructor && value.constructor.prototype === value)) {
|
|
4560
|
+
var ret = value.inspect(recurseTimes, ctx);
|
|
4561
|
+
if (!isString(ret)) {
|
|
4562
|
+
ret = formatValue(ctx, ret, recurseTimes);
|
|
4563
|
+
}
|
|
4564
|
+
return ret;
|
|
4565
|
+
}
|
|
4566
|
+
|
|
4567
|
+
// Primitive types cannot have properties
|
|
4568
|
+
var primitive = formatPrimitive(ctx, value);
|
|
4569
|
+
if (primitive) {
|
|
4570
|
+
return primitive;
|
|
4571
|
+
}
|
|
4572
|
+
|
|
4573
|
+
// Look up the keys of the object.
|
|
4574
|
+
var keys = Object.keys(value);
|
|
4575
|
+
var visibleKeys = arrayToHash(keys);
|
|
4576
|
+
|
|
4577
|
+
if (ctx.showHidden) {
|
|
4578
|
+
keys = Object.getOwnPropertyNames(value);
|
|
4579
|
+
}
|
|
4580
|
+
|
|
4581
|
+
// IE doesn't make error fields non-enumerable
|
|
4582
|
+
// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
|
|
4583
|
+
if (isError(value)
|
|
4584
|
+
&& (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
|
|
4585
|
+
return formatError(value);
|
|
4586
|
+
}
|
|
4587
|
+
|
|
4588
|
+
// Some type of object without properties can be shortcutted.
|
|
4589
|
+
if (keys.length === 0) {
|
|
4590
|
+
if (isFunction(value)) {
|
|
4591
|
+
var name = value.name ? ': ' + value.name : '';
|
|
4592
|
+
return ctx.stylize('[Function' + name + ']', 'special');
|
|
4593
|
+
}
|
|
4594
|
+
if (isRegExp(value)) {
|
|
4595
|
+
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
|
|
4596
|
+
}
|
|
4597
|
+
if (isDate(value)) {
|
|
4598
|
+
return ctx.stylize(Date.prototype.toString.call(value), 'date');
|
|
4599
|
+
}
|
|
4600
|
+
if (isError(value)) {
|
|
4601
|
+
return formatError(value);
|
|
4602
|
+
}
|
|
4603
|
+
}
|
|
4604
|
+
|
|
4605
|
+
var base = '', array = false, braces = ['{', '}'];
|
|
4606
|
+
|
|
4607
|
+
// Make Array say that they are Array
|
|
4608
|
+
if (isArray$1(value)) {
|
|
4609
|
+
array = true;
|
|
4610
|
+
braces = ['[', ']'];
|
|
4611
|
+
}
|
|
4612
|
+
|
|
4613
|
+
// Make functions say that they are functions
|
|
4614
|
+
if (isFunction(value)) {
|
|
4615
|
+
var n = value.name ? ': ' + value.name : '';
|
|
4616
|
+
base = ' [Function' + n + ']';
|
|
4617
|
+
}
|
|
4618
|
+
|
|
4619
|
+
// Make RegExps say that they are RegExps
|
|
4620
|
+
if (isRegExp(value)) {
|
|
4621
|
+
base = ' ' + RegExp.prototype.toString.call(value);
|
|
4622
|
+
}
|
|
4623
|
+
|
|
4624
|
+
// Make dates with properties first say the date
|
|
4625
|
+
if (isDate(value)) {
|
|
4626
|
+
base = ' ' + Date.prototype.toUTCString.call(value);
|
|
4627
|
+
}
|
|
4628
|
+
|
|
4629
|
+
// Make error with message first say the error
|
|
4630
|
+
if (isError(value)) {
|
|
4631
|
+
base = ' ' + formatError(value);
|
|
4632
|
+
}
|
|
4633
|
+
|
|
4634
|
+
if (keys.length === 0 && (!array || value.length == 0)) {
|
|
4635
|
+
return braces[0] + base + braces[1];
|
|
4636
|
+
}
|
|
4637
|
+
|
|
4638
|
+
if (recurseTimes < 0) {
|
|
4639
|
+
if (isRegExp(value)) {
|
|
4640
|
+
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
|
|
4641
|
+
} else {
|
|
4642
|
+
return ctx.stylize('[Object]', 'special');
|
|
4643
|
+
}
|
|
4644
|
+
}
|
|
4645
|
+
|
|
4646
|
+
ctx.seen.push(value);
|
|
4647
|
+
|
|
4648
|
+
var output;
|
|
4649
|
+
if (array) {
|
|
4650
|
+
output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
|
|
4651
|
+
} else {
|
|
4652
|
+
output = keys.map(function(key) {
|
|
4653
|
+
return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
|
|
4654
|
+
});
|
|
4655
|
+
}
|
|
4656
|
+
|
|
4657
|
+
ctx.seen.pop();
|
|
4658
|
+
|
|
4659
|
+
return reduceToSingleString(output, base, braces);
|
|
4660
|
+
}
|
|
4661
|
+
|
|
4662
|
+
|
|
4663
|
+
function formatPrimitive(ctx, value) {
|
|
4664
|
+
if (isUndefined(value))
|
|
4665
|
+
return ctx.stylize('undefined', 'undefined');
|
|
4666
|
+
if (isString(value)) {
|
|
4667
|
+
var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
|
|
4668
|
+
.replace(/'/g, "\\'")
|
|
4669
|
+
.replace(/\\"/g, '"') + '\'';
|
|
4670
|
+
return ctx.stylize(simple, 'string');
|
|
4671
|
+
}
|
|
4672
|
+
if (isNumber(value))
|
|
4673
|
+
return ctx.stylize('' + value, 'number');
|
|
4674
|
+
if (isBoolean(value))
|
|
4675
|
+
return ctx.stylize('' + value, 'boolean');
|
|
4676
|
+
// For some reason typeof null is "object", so special case here.
|
|
4677
|
+
if (isNull(value))
|
|
4678
|
+
return ctx.stylize('null', 'null');
|
|
4679
|
+
}
|
|
4680
|
+
|
|
4681
|
+
|
|
4682
|
+
function formatError(value) {
|
|
4683
|
+
return '[' + Error.prototype.toString.call(value) + ']';
|
|
4684
|
+
}
|
|
4685
|
+
|
|
4686
|
+
|
|
4687
|
+
function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
|
|
4688
|
+
var output = [];
|
|
4689
|
+
for (var i = 0, l = value.length; i < l; ++i) {
|
|
4690
|
+
if (hasOwnProperty(value, String(i))) {
|
|
4691
|
+
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
|
|
4692
|
+
String(i), true));
|
|
4693
|
+
} else {
|
|
4694
|
+
output.push('');
|
|
4695
|
+
}
|
|
4696
|
+
}
|
|
4697
|
+
keys.forEach(function(key) {
|
|
4698
|
+
if (!key.match(/^\d+$/)) {
|
|
4699
|
+
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
|
|
4700
|
+
key, true));
|
|
4701
|
+
}
|
|
4702
|
+
});
|
|
4703
|
+
return output;
|
|
4704
|
+
}
|
|
4705
|
+
|
|
4706
|
+
|
|
4707
|
+
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
|
|
4708
|
+
var name, str, desc;
|
|
4709
|
+
desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
|
|
4710
|
+
if (desc.get) {
|
|
4711
|
+
if (desc.set) {
|
|
4712
|
+
str = ctx.stylize('[Getter/Setter]', 'special');
|
|
4713
|
+
} else {
|
|
4714
|
+
str = ctx.stylize('[Getter]', 'special');
|
|
4715
|
+
}
|
|
4716
|
+
} else {
|
|
4717
|
+
if (desc.set) {
|
|
4718
|
+
str = ctx.stylize('[Setter]', 'special');
|
|
4719
|
+
}
|
|
4720
|
+
}
|
|
4721
|
+
if (!hasOwnProperty(visibleKeys, key)) {
|
|
4722
|
+
name = '[' + key + ']';
|
|
4723
|
+
}
|
|
4724
|
+
if (!str) {
|
|
4725
|
+
if (ctx.seen.indexOf(desc.value) < 0) {
|
|
4726
|
+
if (isNull(recurseTimes)) {
|
|
4727
|
+
str = formatValue(ctx, desc.value, null);
|
|
4728
|
+
} else {
|
|
4729
|
+
str = formatValue(ctx, desc.value, recurseTimes - 1);
|
|
4730
|
+
}
|
|
4731
|
+
if (str.indexOf('\n') > -1) {
|
|
4732
|
+
if (array) {
|
|
4733
|
+
str = str.split('\n').map(function(line) {
|
|
4734
|
+
return ' ' + line;
|
|
4735
|
+
}).join('\n').substr(2);
|
|
4736
|
+
} else {
|
|
4737
|
+
str = '\n' + str.split('\n').map(function(line) {
|
|
4738
|
+
return ' ' + line;
|
|
4739
|
+
}).join('\n');
|
|
4740
|
+
}
|
|
4741
|
+
}
|
|
4742
|
+
} else {
|
|
4743
|
+
str = ctx.stylize('[Circular]', 'special');
|
|
4744
|
+
}
|
|
4745
|
+
}
|
|
4746
|
+
if (isUndefined(name)) {
|
|
4747
|
+
if (array && key.match(/^\d+$/)) {
|
|
4748
|
+
return str;
|
|
4749
|
+
}
|
|
4750
|
+
name = JSON.stringify('' + key);
|
|
4751
|
+
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
|
|
4752
|
+
name = name.substr(1, name.length - 2);
|
|
4753
|
+
name = ctx.stylize(name, 'name');
|
|
4754
|
+
} else {
|
|
4755
|
+
name = name.replace(/'/g, "\\'")
|
|
4756
|
+
.replace(/\\"/g, '"')
|
|
4757
|
+
.replace(/(^"|"$)/g, "'");
|
|
4758
|
+
name = ctx.stylize(name, 'string');
|
|
4759
|
+
}
|
|
4760
|
+
}
|
|
4761
|
+
|
|
4762
|
+
return name + ': ' + str;
|
|
4763
|
+
}
|
|
4764
|
+
|
|
4765
|
+
|
|
4766
|
+
function reduceToSingleString(output, base, braces) {
|
|
4767
|
+
var length = output.reduce(function(prev, cur) {
|
|
4768
|
+
if (cur.indexOf('\n') >= 0) ;
|
|
4769
|
+
return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
|
|
4770
|
+
}, 0);
|
|
4771
|
+
|
|
4772
|
+
if (length > 60) {
|
|
4773
|
+
return braces[0] +
|
|
4774
|
+
(base === '' ? '' : base + '\n ') +
|
|
4775
|
+
' ' +
|
|
4776
|
+
output.join(',\n ') +
|
|
4777
|
+
' ' +
|
|
4778
|
+
braces[1];
|
|
4779
|
+
}
|
|
4780
|
+
|
|
4781
|
+
return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
|
|
4782
|
+
}
|
|
4783
|
+
|
|
4784
|
+
|
|
4785
|
+
// NOTE: These type checking functions intentionally don't use `instanceof`
|
|
4786
|
+
// because it is fragile and can be easily faked with `Object.create()`.
|
|
4787
|
+
function isArray$1(ar) {
|
|
4788
|
+
return Array.isArray(ar);
|
|
4789
|
+
}
|
|
4790
|
+
|
|
4791
|
+
function isBoolean(arg) {
|
|
4792
|
+
return typeof arg === 'boolean';
|
|
4793
|
+
}
|
|
4794
|
+
|
|
4795
|
+
function isNull(arg) {
|
|
4796
|
+
return arg === null;
|
|
4797
|
+
}
|
|
4798
|
+
|
|
4799
|
+
function isNullOrUndefined(arg) {
|
|
4800
|
+
return arg == null;
|
|
4801
|
+
}
|
|
4802
|
+
|
|
4803
|
+
function isNumber(arg) {
|
|
4804
|
+
return typeof arg === 'number';
|
|
4805
|
+
}
|
|
4806
|
+
|
|
4807
|
+
function isString(arg) {
|
|
4808
|
+
return typeof arg === 'string';
|
|
4809
|
+
}
|
|
4810
|
+
|
|
4811
|
+
function isSymbol(arg) {
|
|
4812
|
+
return typeof arg === 'symbol';
|
|
4813
|
+
}
|
|
4814
|
+
|
|
4815
|
+
function isUndefined(arg) {
|
|
4816
|
+
return arg === void 0;
|
|
4817
|
+
}
|
|
4818
|
+
|
|
4819
|
+
function isRegExp(re) {
|
|
4820
|
+
return isObject(re) && objectToString(re) === '[object RegExp]';
|
|
4821
|
+
}
|
|
4822
|
+
|
|
4823
|
+
function isObject(arg) {
|
|
4824
|
+
return typeof arg === 'object' && arg !== null;
|
|
4825
|
+
}
|
|
4826
|
+
|
|
4827
|
+
function isDate(d) {
|
|
4828
|
+
return isObject(d) && objectToString(d) === '[object Date]';
|
|
4829
|
+
}
|
|
4830
|
+
|
|
4831
|
+
function isError(e) {
|
|
4832
|
+
return isObject(e) &&
|
|
4833
|
+
(objectToString(e) === '[object Error]' || e instanceof Error);
|
|
4834
|
+
}
|
|
4835
|
+
|
|
4836
|
+
function isFunction(arg) {
|
|
4837
|
+
return typeof arg === 'function';
|
|
4838
|
+
}
|
|
4839
|
+
|
|
4840
|
+
function isPrimitive(arg) {
|
|
4841
|
+
return arg === null ||
|
|
4842
|
+
typeof arg === 'boolean' ||
|
|
4843
|
+
typeof arg === 'number' ||
|
|
4844
|
+
typeof arg === 'string' ||
|
|
4845
|
+
typeof arg === 'symbol' || // ES6 symbol
|
|
4846
|
+
typeof arg === 'undefined';
|
|
4847
|
+
}
|
|
4848
|
+
|
|
4849
|
+
function isBuffer(maybeBuf) {
|
|
4850
|
+
return Buffer.isBuffer(maybeBuf);
|
|
4851
|
+
}
|
|
4852
|
+
|
|
4853
|
+
function objectToString(o) {
|
|
4854
|
+
return Object.prototype.toString.call(o);
|
|
4855
|
+
}
|
|
4856
|
+
|
|
4857
|
+
|
|
4858
|
+
function pad(n) {
|
|
4859
|
+
return n < 10 ? '0' + n.toString(10) : n.toString(10);
|
|
4860
|
+
}
|
|
4861
|
+
|
|
4862
|
+
|
|
4863
|
+
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
|
|
4864
|
+
'Oct', 'Nov', 'Dec'];
|
|
4865
|
+
|
|
4866
|
+
// 26 Feb 16:19:34
|
|
4867
|
+
function timestamp() {
|
|
4868
|
+
var d = new Date();
|
|
4869
|
+
var time = [pad(d.getHours()),
|
|
4870
|
+
pad(d.getMinutes()),
|
|
4871
|
+
pad(d.getSeconds())].join(':');
|
|
4872
|
+
return [d.getDate(), months[d.getMonth()], time].join(' ');
|
|
4873
|
+
}
|
|
4874
|
+
|
|
4875
|
+
|
|
4876
|
+
// log is just a thin wrapper to console.log that prepends a timestamp
|
|
4877
|
+
function log() {
|
|
4878
|
+
console.log('%s - %s', timestamp(), format.apply(null, arguments));
|
|
4879
|
+
}
|
|
4880
|
+
|
|
4881
|
+
function _extend(origin, add) {
|
|
4882
|
+
// Don't do anything if add isn't an object
|
|
4883
|
+
if (!add || !isObject(add)) return origin;
|
|
4884
|
+
|
|
4885
|
+
var keys = Object.keys(add);
|
|
4886
|
+
var i = keys.length;
|
|
4887
|
+
while (i--) {
|
|
4888
|
+
origin[keys[i]] = add[keys[i]];
|
|
4889
|
+
}
|
|
4890
|
+
return origin;
|
|
4891
|
+
}
|
|
4892
|
+
function hasOwnProperty(obj, prop) {
|
|
4893
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
4894
|
+
}
|
|
4895
|
+
|
|
4896
|
+
var util = {
|
|
4897
|
+
inherits: inherits$2,
|
|
4898
|
+
_extend: _extend,
|
|
4899
|
+
log: log,
|
|
4900
|
+
isBuffer: isBuffer,
|
|
4901
|
+
isPrimitive: isPrimitive,
|
|
4902
|
+
isFunction: isFunction,
|
|
4903
|
+
isError: isError,
|
|
4904
|
+
isDate: isDate,
|
|
4905
|
+
isObject: isObject,
|
|
4906
|
+
isRegExp: isRegExp,
|
|
4907
|
+
isUndefined: isUndefined,
|
|
4908
|
+
isSymbol: isSymbol,
|
|
4909
|
+
isString: isString,
|
|
4910
|
+
isNumber: isNumber,
|
|
4911
|
+
isNullOrUndefined: isNullOrUndefined,
|
|
4912
|
+
isNull: isNull,
|
|
4913
|
+
isBoolean: isBoolean,
|
|
4914
|
+
isArray: isArray$1,
|
|
4915
|
+
inspect: inspect,
|
|
4916
|
+
deprecate: deprecate,
|
|
4917
|
+
format: format,
|
|
4918
|
+
debuglog: debuglog
|
|
4919
|
+
};
|
|
4920
|
+
|
|
4921
|
+
var require$$2 = {};
|
|
4922
|
+
|
|
3644
4923
|
var node = createCommonjsModule(function (module, exports) {
|
|
3645
4924
|
/**
|
|
3646
4925
|
* Module dependencies.
|
|
@@ -3827,15 +5106,15 @@ function createWritableStdioStream (fd) {
|
|
|
3827
5106
|
break;
|
|
3828
5107
|
|
|
3829
5108
|
case 'FILE':
|
|
3830
|
-
var fs
|
|
3831
|
-
stream = new fs
|
|
5109
|
+
var fs = require$$2;
|
|
5110
|
+
stream = new fs.SyncWriteStream(fd, { autoClose: false });
|
|
3832
5111
|
stream._type = 'fs';
|
|
3833
5112
|
break;
|
|
3834
5113
|
|
|
3835
5114
|
case 'PIPE':
|
|
3836
5115
|
case 'TCP':
|
|
3837
|
-
var net
|
|
3838
|
-
stream = new net
|
|
5116
|
+
var net = require$$2;
|
|
5117
|
+
stream = new net.Socket({
|
|
3839
5118
|
fd: fd,
|
|
3840
5119
|
readable: false,
|
|
3841
5120
|
writable: true
|
|
@@ -4038,12 +5317,12 @@ var YouTubePlayer = {};
|
|
|
4038
5317
|
* @see https://developers.google.com/youtube/iframe_api_reference#Events
|
|
4039
5318
|
*/
|
|
4040
5319
|
YouTubePlayer.proxyEvents = function (emitter) {
|
|
4041
|
-
var events
|
|
5320
|
+
var events = {};
|
|
4042
5321
|
|
|
4043
5322
|
var _loop = function _loop(eventName) {
|
|
4044
5323
|
var onEventName = 'on' + eventName.slice(0, 1).toUpperCase() + eventName.slice(1);
|
|
4045
5324
|
|
|
4046
|
-
events
|
|
5325
|
+
events[onEventName] = function (event) {
|
|
4047
5326
|
debug('event "%s"', onEventName, event);
|
|
4048
5327
|
|
|
4049
5328
|
emitter.trigger(eventName, event);
|
|
@@ -4075,7 +5354,7 @@ YouTubePlayer.proxyEvents = function (emitter) {
|
|
|
4075
5354
|
}
|
|
4076
5355
|
}
|
|
4077
5356
|
|
|
4078
|
-
return events
|
|
5357
|
+
return events;
|
|
4079
5358
|
};
|
|
4080
5359
|
|
|
4081
5360
|
/**
|