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