1 (function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
3 typeof define === 'function' && define.amd ? define(factory) :
5 }(this, (function () { 'use strict';
7 function unwrapExports (x) {
8 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
11 function createCommonjsModule(fn, module) {
12 return module = { exports: {} }, fn(module, module.exports), module.exports;
15 var _global = createCommonjsModule(function (module) {
16 // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
17 var global = module.exports = typeof window != 'undefined' && window.Math == Math
18 ? window : typeof self != 'undefined' && self.Math == Math ? self
19 // eslint-disable-next-line no-new-func
20 : Function('return this')();
21 if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
24 var _core = createCommonjsModule(function (module) {
25 var core = module.exports = { version: '2.5.7' };
26 if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
28 var _core_1 = _core.version;
30 var _aFunction = function (it) {
31 if (typeof it != 'function') throw TypeError(it + ' is not a function!');
35 // optional / simple context binding
37 var _ctx = function (fn, that, length) {
39 if (that === undefined) return fn;
41 case 1: return function (a) {
42 return fn.call(that, a);
44 case 2: return function (a, b) {
45 return fn.call(that, a, b);
47 case 3: return function (a, b, c) {
48 return fn.call(that, a, b, c);
51 return function (/* ...args */) {
52 return fn.apply(that, arguments);
56 var _isObject = function (it) {
57 return typeof it === 'object' ? it !== null : typeof it === 'function';
60 var _anObject = function (it) {
61 if (!_isObject(it)) throw TypeError(it + ' is not an object!');
65 var _fails = function (exec) {
73 // Thank's IE8 for his funny defineProperty
74 var _descriptors = !_fails(function () {
75 return Object.defineProperty({}, 'a', { get: function () { return 7; } }).a != 7;
78 var document = _global.document;
79 // typeof document.createElement is 'object' in old IE
80 var is = _isObject(document) && _isObject(document.createElement);
81 var _domCreate = function (it) {
82 return is ? document.createElement(it) : {};
85 var _ie8DomDefine = !_descriptors && !_fails(function () {
86 return Object.defineProperty(_domCreate('div'), 'a', { get: function () { return 7; } }).a != 7;
89 // 7.1.1 ToPrimitive(input [, PreferredType])
91 // instead of the ES6 spec version, we didn't implement @@toPrimitive case
92 // and the second argument - flag - preferred type is a string
93 var _toPrimitive = function (it, S) {
94 if (!_isObject(it)) return it;
96 if (S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
97 if (typeof (fn = it.valueOf) == 'function' && !_isObject(val = fn.call(it))) return val;
98 if (!S && typeof (fn = it.toString) == 'function' && !_isObject(val = fn.call(it))) return val;
99 throw TypeError("Can't convert object to primitive value");
102 var dP = Object.defineProperty;
104 var f = _descriptors ? Object.defineProperty : function defineProperty(O, P, Attributes) {
106 P = _toPrimitive(P, true);
107 _anObject(Attributes);
108 if (_ie8DomDefine) try {
109 return dP(O, P, Attributes);
110 } catch (e) { /* empty */ }
111 if ('get' in Attributes || 'set' in Attributes) throw TypeError('Accessors not supported!');
112 if ('value' in Attributes) O[P] = Attributes.value;
120 var _propertyDesc = function (bitmap, value) {
122 enumerable: !(bitmap & 1),
123 configurable: !(bitmap & 2),
124 writable: !(bitmap & 4),
129 var _hide = _descriptors ? function (object, key, value) {
130 return _objectDp.f(object, key, _propertyDesc(1, value));
131 } : function (object, key, value) {
136 var hasOwnProperty = {}.hasOwnProperty;
137 var _has = function (it, key) {
138 return hasOwnProperty.call(it, key);
141 var PROTOTYPE = 'prototype';
143 var $export = function (type, name, source) {
144 var IS_FORCED = type & $export.F;
145 var IS_GLOBAL = type & $export.G;
146 var IS_STATIC = type & $export.S;
147 var IS_PROTO = type & $export.P;
148 var IS_BIND = type & $export.B;
149 var IS_WRAP = type & $export.W;
150 var exports = IS_GLOBAL ? _core : _core[name] || (_core[name] = {});
151 var expProto = exports[PROTOTYPE];
152 var target = IS_GLOBAL ? _global : IS_STATIC ? _global[name] : (_global[name] || {})[PROTOTYPE];
154 if (IS_GLOBAL) source = name;
155 for (key in source) {
156 // contains in native
157 own = !IS_FORCED && target && target[key] !== undefined;
158 if (own && _has(exports, key)) continue;
159 // export native or passed
160 out = own ? target[key] : source[key];
161 // prevent global pollution for namespaces
162 exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]
163 // bind timers to global for call from export context
164 : IS_BIND && own ? _ctx(out, _global)
165 // wrap global constructors for prevent change them in library
166 : IS_WRAP && target[key] == out ? (function (C) {
167 var F = function (a, b, c) {
168 if (this instanceof C) {
169 switch (arguments.length) {
170 case 0: return new C();
171 case 1: return new C(a);
172 case 2: return new C(a, b);
173 } return new C(a, b, c);
174 } return C.apply(this, arguments);
176 F[PROTOTYPE] = C[PROTOTYPE];
178 // make static versions for prototype methods
179 })(out) : IS_PROTO && typeof out == 'function' ? _ctx(Function.call, out) : out;
180 // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%
182 (exports.virtual || (exports.virtual = {}))[key] = out;
183 // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%
184 if (type & $export.R && expProto && !expProto[key]) _hide(expProto, key, out);
189 $export.F = 1; // forced
190 $export.G = 2; // global
191 $export.S = 4; // static
192 $export.P = 8; // proto
193 $export.B = 16; // bind
194 $export.W = 32; // wrap
195 $export.U = 64; // safe
196 $export.R = 128; // real proto method for `library`
197 var _export = $export;
199 var toString$1 = {}.toString;
201 var _cof = function (it) {
202 return toString$1.call(it).slice(8, -1);
205 // fallback for non-array-like ES3 and non-enumerable old V8 strings
207 // eslint-disable-next-line no-prototype-builtins
208 var _iobject = Object('z').propertyIsEnumerable(0) ? Object : function (it) {
209 return _cof(it) == 'String' ? it.split('') : Object(it);
212 // 7.2.1 RequireObjectCoercible(argument)
213 var _defined = function (it) {
214 if (it == undefined) throw TypeError("Can't call method on " + it);
218 // to indexed object, toObject with fallback for non-array-like ES3 strings
221 var _toIobject = function (it) {
222 return _iobject(_defined(it));
226 var ceil = Math.ceil;
227 var floor = Math.floor;
228 var _toInteger = function (it) {
229 return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);
235 var _toLength = function (it) {
236 return it > 0 ? min(_toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991
240 var min$1 = Math.min;
241 var _toAbsoluteIndex = function (index, length) {
242 index = _toInteger(index);
243 return index < 0 ? max(index + length, 0) : min$1(index, length);
246 // false -> Array#indexOf
247 // true -> Array#includes
251 var _arrayIncludes = function (IS_INCLUDES) {
252 return function ($this, el, fromIndex) {
253 var O = _toIobject($this);
254 var length = _toLength(O.length);
255 var index = _toAbsoluteIndex(fromIndex, length);
257 // Array#includes uses SameValueZero equality algorithm
258 // eslint-disable-next-line no-self-compare
259 if (IS_INCLUDES && el != el) while (length > index) {
261 // eslint-disable-next-line no-self-compare
262 if (value != value) return true;
263 // Array#indexOf ignores holes, Array#includes - not
264 } else for (;length > index; index++) if (IS_INCLUDES || index in O) {
265 if (O[index] === el) return IS_INCLUDES || index || 0;
266 } return !IS_INCLUDES && -1;
272 var _shared = createCommonjsModule(function (module) {
273 var SHARED = '__core-js_shared__';
274 var store = _global[SHARED] || (_global[SHARED] = {});
276 (module.exports = function (key, value) {
277 return store[key] || (store[key] = value !== undefined ? value : {});
278 })('versions', []).push({
279 version: _core.version,
280 mode: _library ? 'pure' : 'global',
281 copyright: '© 2018 Denis Pushkarev (zloirock.ru)'
286 var px = Math.random();
287 var _uid = function (key) {
288 return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));
291 var shared = _shared('keys');
293 var _sharedKey = function (key) {
294 return shared[key] || (shared[key] = _uid(key));
297 var arrayIndexOf = _arrayIncludes(false);
298 var IE_PROTO = _sharedKey('IE_PROTO');
300 var _objectKeysInternal = function (object, names) {
301 var O = _toIobject(object);
305 for (key in O) if (key != IE_PROTO) _has(O, key) && result.push(key);
306 // Don't enum bug & hidden keys
307 while (names.length > i) if (_has(O, key = names[i++])) {
308 ~arrayIndexOf(result, key) || result.push(key);
313 // IE 8- don't enum bug keys
315 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'
318 // 19.1.2.14 / 15.2.3.14 Object.keys(O)
322 var _objectKeys = Object.keys || function keys(O) {
323 return _objectKeysInternal(O, _enumBugKeys);
326 var _objectDps = _descriptors ? Object.defineProperties : function defineProperties(O, Properties) {
328 var keys = _objectKeys(Properties);
329 var length = keys.length;
332 while (length > i) _objectDp.f(O, P = keys[i++], Properties[P]);
336 var document$1 = _global.document;
337 var _html = document$1 && document$1.documentElement;
339 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
343 var IE_PROTO$1 = _sharedKey('IE_PROTO');
344 var Empty = function () { /* empty */ };
345 var PROTOTYPE$1 = 'prototype';
347 // Create object with fake `null` prototype: use iframe Object with cleared prototype
348 var createDict = function () {
349 // Thrash, waste and sodomy: IE GC bug
350 var iframe = _domCreate('iframe');
351 var i = _enumBugKeys.length;
355 iframe.style.display = 'none';
356 _html.appendChild(iframe);
357 iframe.src = 'javascript:'; // eslint-disable-line no-script-url
358 // createDict = iframe.contentWindow.Object;
359 // html.removeChild(iframe);
360 iframeDocument = iframe.contentWindow.document;
361 iframeDocument.open();
362 iframeDocument.write(lt + 'script' + gt + 'document.F=Object' + lt + '/script' + gt);
363 iframeDocument.close();
364 createDict = iframeDocument.F;
365 while (i--) delete createDict[PROTOTYPE$1][_enumBugKeys[i]];
369 var _objectCreate = Object.create || function create(O, Properties) {
372 Empty[PROTOTYPE$1] = _anObject(O);
373 result = new Empty();
374 Empty[PROTOTYPE$1] = null;
375 // add "__proto__" for Object.getPrototypeOf polyfill
376 result[IE_PROTO$1] = O;
377 } else result = createDict();
378 return Properties === undefined ? result : _objectDps(result, Properties);
381 // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties])
382 _export(_export.S, 'Object', { create: _objectCreate });
384 var $Object = _core.Object;
385 var create = function create(P, D) {
386 return $Object.create(P, D);
389 var create$1 = createCommonjsModule(function (module) {
390 module.exports = { "default": create, __esModule: true };
393 var _Object$create = unwrapExports(create$1);
395 // 7.1.13 ToObject(argument)
397 var _toObject = function (it) {
398 return Object(_defined(it));
401 // most Object methods by ES6 should accept primitives
405 var _objectSap = function (KEY, exec) {
406 var fn = (_core.Object || {})[KEY] || Object[KEY];
409 _export(_export.S + _export.F * _fails(function () { fn(1); }), 'Object', exp);
412 // 19.1.2.14 Object.keys(O)
416 _objectSap('keys', function () {
417 return function keys(it) {
418 return _objectKeys(_toObject(it));
422 var keys = _core.Object.keys;
424 var keys$1 = createCommonjsModule(function (module) {
425 module.exports = { "default": keys, __esModule: true };
428 var _Object$keys = unwrapExports(keys$1);
431 // false -> String#codePointAt
432 var _stringAt = function (TO_STRING) {
433 return function (that, pos) {
434 var s = String(_defined(that));
435 var i = _toInteger(pos);
438 if (i < 0 || i >= l) return TO_STRING ? '' : undefined;
440 return a < 0xd800 || a > 0xdbff || i + 1 === l || (b = s.charCodeAt(i + 1)) < 0xdc00 || b > 0xdfff
441 ? TO_STRING ? s.charAt(i) : a
442 : TO_STRING ? s.slice(i, i + 2) : (a - 0xd800 << 10) + (b - 0xdc00) + 0x10000;
446 var _redefine = _hide;
450 var _wks = createCommonjsModule(function (module) {
451 var store = _shared('wks');
453 var Symbol = _global.Symbol;
454 var USE_SYMBOL = typeof Symbol == 'function';
456 var $exports = module.exports = function (name) {
457 return store[name] || (store[name] =
458 USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : _uid)('Symbol.' + name));
461 $exports.store = store;
464 var def = _objectDp.f;
466 var TAG = _wks('toStringTag');
468 var _setToStringTag = function (it, tag, stat) {
469 if (it && !_has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag });
472 var IteratorPrototype = {};
474 // 25.1.2.1.1 %IteratorPrototype%[@@iterator]()
475 _hide(IteratorPrototype, _wks('iterator'), function () { return this; });
477 var _iterCreate = function (Constructor, NAME, next) {
478 Constructor.prototype = _objectCreate(IteratorPrototype, { next: _propertyDesc(1, next) });
479 _setToStringTag(Constructor, NAME + ' Iterator');
482 // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O)
485 var IE_PROTO$2 = _sharedKey('IE_PROTO');
486 var ObjectProto = Object.prototype;
488 var _objectGpo = Object.getPrototypeOf || function (O) {
490 if (_has(O, IE_PROTO$2)) return O[IE_PROTO$2];
491 if (typeof O.constructor == 'function' && O instanceof O.constructor) {
492 return O.constructor.prototype;
493 } return O instanceof Object ? ObjectProto : null;
496 var ITERATOR = _wks('iterator');
497 var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next`
498 var FF_ITERATOR = '@@iterator';
500 var VALUES = 'values';
502 var returnThis = function () { return this; };
504 var _iterDefine = function (Base, NAME, Constructor, next, DEFAULT, IS_SET, FORCED) {
505 _iterCreate(Constructor, NAME, next);
506 var getMethod = function (kind) {
507 if (!BUGGY && kind in proto) return proto[kind];
509 case KEYS: return function keys() { return new Constructor(this, kind); };
510 case VALUES: return function values() { return new Constructor(this, kind); };
511 } return function entries() { return new Constructor(this, kind); };
513 var TAG = NAME + ' Iterator';
514 var DEF_VALUES = DEFAULT == VALUES;
515 var VALUES_BUG = false;
516 var proto = Base.prototype;
517 var $native = proto[ITERATOR] || proto[FF_ITERATOR] || DEFAULT && proto[DEFAULT];
518 var $default = $native || getMethod(DEFAULT);
519 var $entries = DEFAULT ? !DEF_VALUES ? $default : getMethod('entries') : undefined;
520 var $anyNative = NAME == 'Array' ? proto.entries || $native : $native;
521 var methods, key, IteratorPrototype;
524 IteratorPrototype = _objectGpo($anyNative.call(new Base()));
525 if (IteratorPrototype !== Object.prototype && IteratorPrototype.next) {
526 // Set @@toStringTag to native iterators
527 _setToStringTag(IteratorPrototype, TAG, true);
528 // fix for some old engines
529 if (!_library && typeof IteratorPrototype[ITERATOR] != 'function') _hide(IteratorPrototype, ITERATOR, returnThis);
532 // fix Array#{values, @@iterator}.name in V8 / FF
533 if (DEF_VALUES && $native && $native.name !== VALUES) {
535 $default = function values() { return $native.call(this); };
538 if ((!_library || FORCED) && (BUGGY || VALUES_BUG || !proto[ITERATOR])) {
539 _hide(proto, ITERATOR, $default);
542 _iterators[NAME] = $default;
543 _iterators[TAG] = returnThis;
546 values: DEF_VALUES ? $default : getMethod(VALUES),
547 keys: IS_SET ? $default : getMethod(KEYS),
550 if (FORCED) for (key in methods) {
551 if (!(key in proto)) _redefine(proto, key, methods[key]);
552 } else _export(_export.P + _export.F * (BUGGY || VALUES_BUG), NAME, methods);
557 var $at = _stringAt(true);
559 // 21.1.3.27 String.prototype[@@iterator]()
560 _iterDefine(String, 'String', function (iterated) {
561 this._t = String(iterated); // target
562 this._i = 0; // next index
563 // 21.1.5.2.1 %StringIteratorPrototype%.next()
568 if (index >= O.length) return { value: undefined, done: true };
569 point = $at(O, index);
570 this._i += point.length;
571 return { value: point, done: false };
574 var _iterStep = function (done, value) {
575 return { value: value, done: !!done };
578 // 22.1.3.4 Array.prototype.entries()
579 // 22.1.3.13 Array.prototype.keys()
580 // 22.1.3.29 Array.prototype.values()
581 // 22.1.3.30 Array.prototype[@@iterator]()
582 var es6_array_iterator = _iterDefine(Array, 'Array', function (iterated, kind) {
583 this._t = _toIobject(iterated); // target
584 this._i = 0; // next index
585 this._k = kind; // kind
586 // 22.1.5.2.1 %ArrayIteratorPrototype%.next()
590 var index = this._i++;
591 if (!O || index >= O.length) {
595 if (kind == 'keys') return _iterStep(0, index);
596 if (kind == 'values') return _iterStep(0, O[index]);
597 return _iterStep(0, [index, O[index]]);
600 // argumentsList[@@iterator] is %ArrayProto_values% (9.4.4.6, 9.4.4.7)
601 _iterators.Arguments = _iterators.Array;
603 var TO_STRING_TAG = _wks('toStringTag');
605 var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' +
606 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' +
607 'MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,' +
608 'SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,' +
609 'TextTrackList,TouchList').split(',');
611 for (var i = 0; i < DOMIterables.length; i++) {
612 var NAME = DOMIterables[i];
613 var Collection = _global[NAME];
614 var proto = Collection && Collection.prototype;
615 if (proto && !proto[TO_STRING_TAG]) _hide(proto, TO_STRING_TAG, NAME);
616 _iterators[NAME] = _iterators.Array;
625 var iterator = _wksExt.f('iterator');
627 var iterator$1 = createCommonjsModule(function (module) {
628 module.exports = { "default": iterator, __esModule: true };
631 unwrapExports(iterator$1);
633 var _meta = createCommonjsModule(function (module) {
634 var META = _uid('meta');
637 var setDesc = _objectDp.f;
639 var isExtensible = Object.isExtensible || function () {
642 var FREEZE = !_fails(function () {
643 return isExtensible(Object.preventExtensions({}));
645 var setMeta = function (it) {
646 setDesc(it, META, { value: {
647 i: 'O' + ++id, // object ID
648 w: {} // weak collections IDs
651 var fastKey = function (it, create) {
652 // return primitive with prefix
653 if (!_isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
654 if (!_has(it, META)) {
655 // can't set metadata to uncaught frozen object
656 if (!isExtensible(it)) return 'F';
657 // not necessary to add metadata
658 if (!create) return 'E';
659 // add missing metadata
664 var getWeak = function (it, create) {
665 if (!_has(it, META)) {
666 // can't set metadata to uncaught frozen object
667 if (!isExtensible(it)) return true;
668 // not necessary to add metadata
669 if (!create) return false;
670 // add missing metadata
672 // return hash weak collections IDs
675 // add metadata on freeze-family methods calling
676 var onFreeze = function (it) {
677 if (FREEZE && meta.NEED && isExtensible(it) && !_has(it, META)) setMeta(it);
680 var meta = module.exports = {
688 var _meta_1 = _meta.KEY;
689 var _meta_2 = _meta.NEED;
690 var _meta_3 = _meta.fastKey;
691 var _meta_4 = _meta.getWeak;
692 var _meta_5 = _meta.onFreeze;
694 var defineProperty = _objectDp.f;
695 var _wksDefine = function (name) {
696 var $Symbol = _core.Symbol || (_core.Symbol = _library ? {} : _global.Symbol || {});
697 if (name.charAt(0) != '_' && !(name in $Symbol)) defineProperty($Symbol, name, { value: _wksExt.f(name) });
700 var f$2 = Object.getOwnPropertySymbols;
706 var f$3 = {}.propertyIsEnumerable;
712 // all enumerable object keys, includes symbols
716 var _enumKeys = function (it) {
717 var result = _objectKeys(it);
718 var getSymbols = _objectGops.f;
720 var symbols = getSymbols(it);
721 var isEnum = _objectPie.f;
724 while (symbols.length > i) if (isEnum.call(it, key = symbols[i++])) result.push(key);
728 // 7.2.2 IsArray(argument)
730 var _isArray = Array.isArray || function isArray(arg) {
731 return _cof(arg) == 'Array';
734 // 19.1.2.7 / 15.2.3.4 Object.getOwnPropertyNames(O)
736 var hiddenKeys = _enumBugKeys.concat('length', 'prototype');
738 var f$4 = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
739 return _objectKeysInternal(O, hiddenKeys);
746 // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
748 var gOPN = _objectGopn.f;
749 var toString$2 = {}.toString;
751 var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
752 ? Object.getOwnPropertyNames(window) : [];
754 var getWindowNames = function (it) {
758 return windowNames.slice();
762 var f$5 = function getOwnPropertyNames(it) {
763 return windowNames && toString$2.call(it) == '[object Window]' ? getWindowNames(it) : gOPN(_toIobject(it));
766 var _objectGopnExt = {
770 var gOPD = Object.getOwnPropertyDescriptor;
772 var f$6 = _descriptors ? gOPD : function getOwnPropertyDescriptor(O, P) {
774 P = _toPrimitive(P, true);
775 if (_ie8DomDefine) try {
777 } catch (e) { /* empty */ }
778 if (_has(O, P)) return _propertyDesc(!_objectPie.f.call(O, P), O[P]);
785 // ECMAScript 6 symbols shim
791 var META = _meta.KEY;
811 var gOPD$1 = _objectGopd.f;
812 var dP$1 = _objectDp.f;
813 var gOPN$1 = _objectGopnExt.f;
814 var $Symbol = _global.Symbol;
815 var $JSON = _global.JSON;
816 var _stringify = $JSON && $JSON.stringify;
817 var PROTOTYPE$2 = 'prototype';
818 var HIDDEN = _wks('_hidden');
819 var TO_PRIMITIVE = _wks('toPrimitive');
820 var isEnum = {}.propertyIsEnumerable;
821 var SymbolRegistry = _shared('symbol-registry');
822 var AllSymbols = _shared('symbols');
823 var OPSymbols = _shared('op-symbols');
824 var ObjectProto$1 = Object[PROTOTYPE$2];
825 var USE_NATIVE = typeof $Symbol == 'function';
826 var QObject = _global.QObject;
827 // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
828 var setter = !QObject || !QObject[PROTOTYPE$2] || !QObject[PROTOTYPE$2].findChild;
830 // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
831 var setSymbolDesc = _descriptors && _fails(function () {
832 return _objectCreate(dP$1({}, 'a', {
833 get: function () { return dP$1(this, 'a', { value: 7 }).a; }
835 }) ? function (it, key, D) {
836 var protoDesc = gOPD$1(ObjectProto$1, key);
837 if (protoDesc) delete ObjectProto$1[key];
839 if (protoDesc && it !== ObjectProto$1) dP$1(ObjectProto$1, key, protoDesc);
842 var wrap = function (tag) {
843 var sym = AllSymbols[tag] = _objectCreate($Symbol[PROTOTYPE$2]);
848 var isSymbol = USE_NATIVE && typeof $Symbol.iterator == 'symbol' ? function (it) {
849 return typeof it == 'symbol';
851 return it instanceof $Symbol;
854 var $defineProperty = function defineProperty(it, key, D) {
855 if (it === ObjectProto$1) $defineProperty(OPSymbols, key, D);
857 key = _toPrimitive(key, true);
859 if (_has(AllSymbols, key)) {
861 if (!_has(it, HIDDEN)) dP$1(it, HIDDEN, _propertyDesc(1, {}));
862 it[HIDDEN][key] = true;
864 if (_has(it, HIDDEN) && it[HIDDEN][key]) it[HIDDEN][key] = false;
865 D = _objectCreate(D, { enumerable: _propertyDesc(0, false) });
866 } return setSymbolDesc(it, key, D);
867 } return dP$1(it, key, D);
869 var $defineProperties = function defineProperties(it, P) {
871 var keys = _enumKeys(P = _toIobject(P));
875 while (l > i) $defineProperty(it, key = keys[i++], P[key]);
878 var $create = function create(it, P) {
879 return P === undefined ? _objectCreate(it) : $defineProperties(_objectCreate(it), P);
881 var $propertyIsEnumerable = function propertyIsEnumerable(key) {
882 var E = isEnum.call(this, key = _toPrimitive(key, true));
883 if (this === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return false;
884 return E || !_has(this, key) || !_has(AllSymbols, key) || _has(this, HIDDEN) && this[HIDDEN][key] ? E : true;
886 var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(it, key) {
888 key = _toPrimitive(key, true);
889 if (it === ObjectProto$1 && _has(AllSymbols, key) && !_has(OPSymbols, key)) return;
890 var D = gOPD$1(it, key);
891 if (D && _has(AllSymbols, key) && !(_has(it, HIDDEN) && it[HIDDEN][key])) D.enumerable = true;
894 var $getOwnPropertyNames = function getOwnPropertyNames(it) {
895 var names = gOPN$1(_toIobject(it));
899 while (names.length > i) {
900 if (!_has(AllSymbols, key = names[i++]) && key != HIDDEN && key != META) result.push(key);
903 var $getOwnPropertySymbols = function getOwnPropertySymbols(it) {
904 var IS_OP = it === ObjectProto$1;
905 var names = gOPN$1(IS_OP ? OPSymbols : _toIobject(it));
909 while (names.length > i) {
910 if (_has(AllSymbols, key = names[i++]) && (IS_OP ? _has(ObjectProto$1, key) : true)) result.push(AllSymbols[key]);
914 // 19.4.1.1 Symbol([description])
916 $Symbol = function Symbol() {
917 if (this instanceof $Symbol) throw TypeError('Symbol is not a constructor!');
918 var tag = _uid(arguments.length > 0 ? arguments[0] : undefined);
919 var $set = function (value) {
920 if (this === ObjectProto$1) $set.call(OPSymbols, value);
921 if (_has(this, HIDDEN) && _has(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
922 setSymbolDesc(this, tag, _propertyDesc(1, value));
924 if (_descriptors && setter) setSymbolDesc(ObjectProto$1, tag, { configurable: true, set: $set });
927 _redefine($Symbol[PROTOTYPE$2], 'toString', function toString() {
931 _objectGopd.f = $getOwnPropertyDescriptor;
932 _objectDp.f = $defineProperty;
933 _objectGopn.f = _objectGopnExt.f = $getOwnPropertyNames;
934 _objectPie.f = $propertyIsEnumerable;
935 _objectGops.f = $getOwnPropertySymbols;
937 if (_descriptors && !_library) {
938 _redefine(ObjectProto$1, 'propertyIsEnumerable', $propertyIsEnumerable, true);
941 _wksExt.f = function (name) {
942 return wrap(_wks(name));
946 _export(_export.G + _export.W + _export.F * !USE_NATIVE, { Symbol: $Symbol });
948 for (var es6Symbols = (
949 // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
950 'hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables'
951 ).split(','), j = 0; es6Symbols.length > j;)_wks(es6Symbols[j++]);
953 for (var wellKnownSymbols = _objectKeys(_wks.store), k = 0; wellKnownSymbols.length > k;) _wksDefine(wellKnownSymbols[k++]);
955 _export(_export.S + _export.F * !USE_NATIVE, 'Symbol', {
956 // 19.4.2.1 Symbol.for(key)
957 'for': function (key) {
958 return _has(SymbolRegistry, key += '')
959 ? SymbolRegistry[key]
960 : SymbolRegistry[key] = $Symbol(key);
962 // 19.4.2.5 Symbol.keyFor(sym)
963 keyFor: function keyFor(sym) {
964 if (!isSymbol(sym)) throw TypeError(sym + ' is not a symbol!');
965 for (var key in SymbolRegistry) if (SymbolRegistry[key] === sym) return key;
967 useSetter: function () { setter = true; },
968 useSimple: function () { setter = false; }
971 _export(_export.S + _export.F * !USE_NATIVE, 'Object', {
972 // 19.1.2.2 Object.create(O [, Properties])
974 // 19.1.2.4 Object.defineProperty(O, P, Attributes)
975 defineProperty: $defineProperty,
976 // 19.1.2.3 Object.defineProperties(O, Properties)
977 defineProperties: $defineProperties,
978 // 19.1.2.6 Object.getOwnPropertyDescriptor(O, P)
979 getOwnPropertyDescriptor: $getOwnPropertyDescriptor,
980 // 19.1.2.7 Object.getOwnPropertyNames(O)
981 getOwnPropertyNames: $getOwnPropertyNames,
982 // 19.1.2.8 Object.getOwnPropertySymbols(O)
983 getOwnPropertySymbols: $getOwnPropertySymbols
986 // 24.3.2 JSON.stringify(value [, replacer [, space]])
987 $JSON && _export(_export.S + _export.F * (!USE_NATIVE || _fails(function () {
989 // MS Edge converts symbol values to JSON as {}
990 // WebKit converts symbol values to JSON as null
991 // V8 throws on boxed symbols
992 return _stringify([S]) != '[null]' || _stringify({ a: S }) != '{}' || _stringify(Object(S)) != '{}';
994 stringify: function stringify(it) {
997 var replacer, $replacer;
998 while (arguments.length > i) args.push(arguments[i++]);
999 $replacer = replacer = args[1];
1000 if (!_isObject(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
1001 if (!_isArray(replacer)) replacer = function (key, value) {
1002 if (typeof $replacer == 'function') value = $replacer.call(this, key, value);
1003 if (!isSymbol(value)) return value;
1006 return _stringify.apply($JSON, args);
1010 // 19.4.3.4 Symbol.prototype[@@toPrimitive](hint)
1011 $Symbol[PROTOTYPE$2][TO_PRIMITIVE] || _hide($Symbol[PROTOTYPE$2], TO_PRIMITIVE, $Symbol[PROTOTYPE$2].valueOf);
1012 // 19.4.3.5 Symbol.prototype[@@toStringTag]
1013 _setToStringTag($Symbol, 'Symbol');
1014 // 20.2.1.9 Math[@@toStringTag]
1015 _setToStringTag(Math, 'Math', true);
1016 // 24.3.3 JSON[@@toStringTag]
1017 _setToStringTag(_global.JSON, 'JSON', true);
1019 _wksDefine('asyncIterator');
1021 _wksDefine('observable');
1023 var symbol = _core.Symbol;
1025 var symbol$1 = createCommonjsModule(function (module) {
1026 module.exports = { "default": symbol, __esModule: true };
1029 var _Symbol = unwrapExports(symbol$1);
1031 var _typeof_1 = createCommonjsModule(function (module, exports) {
1033 exports.__esModule = true;
1037 var _iterator2 = _interopRequireDefault(iterator$1);
1041 var _symbol2 = _interopRequireDefault(symbol$1);
1043 var _typeof = typeof _symbol2.default === "function" && typeof _iterator2.default === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj; };
1045 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1047 exports.default = typeof _symbol2.default === "function" && _typeof(_iterator2.default) === "symbol" ? function (obj) {
1048 return typeof obj === "undefined" ? "undefined" : _typeof(obj);
1049 } : function (obj) {
1050 return obj && typeof _symbol2.default === "function" && obj.constructor === _symbol2.default && obj !== _symbol2.default.prototype ? "symbol" : typeof obj === "undefined" ? "undefined" : _typeof(obj);
1054 var _typeof = unwrapExports(_typeof_1);
1056 // 7.2.9 SameValue(x, y)
1057 var _sameValue = Object.is || function is(x, y) {
1058 // eslint-disable-next-line no-self-compare
1059 return x === y ? x !== 0 || 1 / x === 1 / y : x != x && y != y;
1062 // 19.1.3.10 Object.is(value1, value2)
1064 _export(_export.S, 'Object', { is: _sameValue });
1066 var is$1 = _core.Object.is;
1068 var is$2 = createCommonjsModule(function (module) {
1069 module.exports = { "default": is$1, __esModule: true };
1072 var _Object$is = unwrapExports(is$2);
1074 // 19.1.2.9 Object.getPrototypeOf(O)
1078 _objectSap('getPrototypeOf', function () {
1079 return function getPrototypeOf(it) {
1080 return _objectGpo(_toObject(it));
1084 var getPrototypeOf = _core.Object.getPrototypeOf;
1086 var getPrototypeOf$1 = createCommonjsModule(function (module) {
1087 module.exports = { "default": getPrototypeOf, __esModule: true };
1090 var _Object$getPrototypeOf = unwrapExports(getPrototypeOf$1);
1092 var classCallCheck = createCommonjsModule(function (module, exports) {
1094 exports.__esModule = true;
1096 exports.default = function (instance, Constructor) {
1097 if (!(instance instanceof Constructor)) {
1098 throw new TypeError("Cannot call a class as a function");
1103 var _classCallCheck = unwrapExports(classCallCheck);
1105 var possibleConstructorReturn = createCommonjsModule(function (module, exports) {
1107 exports.__esModule = true;
1111 var _typeof3 = _interopRequireDefault(_typeof_1);
1113 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1115 exports.default = function (self, call) {
1117 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1120 return call && ((typeof call === "undefined" ? "undefined" : (0, _typeof3.default)(call)) === "object" || typeof call === "function") ? call : self;
1124 var _possibleConstructorReturn = unwrapExports(possibleConstructorReturn);
1126 // Works with __proto__ only. Old v8 can't work with null proto objects.
1127 /* eslint-disable no-proto */
1130 var check = function (O, proto) {
1132 if (!_isObject(proto) && proto !== null) throw TypeError(proto + ": can't set as prototype!");
1135 set: Object.setPrototypeOf || ('__proto__' in {} ? // eslint-disable-line
1136 function (test, buggy, set) {
1138 set = _ctx(Function.call, _objectGopd.f(Object.prototype, '__proto__').set, 2);
1140 buggy = !(test instanceof Array);
1141 } catch (e) { buggy = true; }
1142 return function setPrototypeOf(O, proto) {
1144 if (buggy) O.__proto__ = proto;
1148 }({}, false) : undefined),
1152 // 19.1.3.19 Object.setPrototypeOf(O, proto)
1154 _export(_export.S, 'Object', { setPrototypeOf: _setProto.set });
1156 var setPrototypeOf = _core.Object.setPrototypeOf;
1158 var setPrototypeOf$1 = createCommonjsModule(function (module) {
1159 module.exports = { "default": setPrototypeOf, __esModule: true };
1162 unwrapExports(setPrototypeOf$1);
1164 var inherits = createCommonjsModule(function (module, exports) {
1166 exports.__esModule = true;
1170 var _setPrototypeOf2 = _interopRequireDefault(setPrototypeOf$1);
1174 var _create2 = _interopRequireDefault(create$1);
1178 var _typeof3 = _interopRequireDefault(_typeof_1);
1180 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
1182 exports.default = function (subClass, superClass) {
1183 if (typeof superClass !== "function" && superClass !== null) {
1184 throw new TypeError("Super expression must either be null or a function, not " + (typeof superClass === "undefined" ? "undefined" : (0, _typeof3.default)(superClass)));
1187 subClass.prototype = (0, _create2.default)(superClass && superClass.prototype, {
1195 if (superClass) _setPrototypeOf2.default ? (0, _setPrototypeOf2.default)(subClass, superClass) : subClass.__proto__ = superClass;
1199 var _inherits = unwrapExports(inherits);
1201 // 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)
1202 _export(_export.S + _export.F * !_descriptors, 'Object', { defineProperty: _objectDp.f });
1204 var $Object$1 = _core.Object;
1205 var defineProperty$1 = function defineProperty(it, key, desc) {
1206 return $Object$1.defineProperty(it, key, desc);
1209 var defineProperty$2 = createCommonjsModule(function (module) {
1210 module.exports = { "default": defineProperty$1, __esModule: true };
1213 var _Object$defineProperty = unwrapExports(defineProperty$2);
1215 // getting tag from 19.1.3.6 Object.prototype.toString()
1217 var TAG$1 = _wks('toStringTag');
1219 var ARG = _cof(function () { return arguments; }()) == 'Arguments';
1221 // fallback for IE11 Script Access Denied error
1222 var tryGet = function (it, key) {
1225 } catch (e) { /* empty */ }
1228 var _classof = function (it) {
1230 return it === undefined ? 'Undefined' : it === null ? 'Null'
1231 // @@toStringTag case
1232 : typeof (T = tryGet(O = Object(it), TAG$1)) == 'string' ? T
1235 // ES3 arguments fallback
1236 : (B = _cof(O)) == 'Object' && typeof O.callee == 'function' ? 'Arguments' : B;
1239 var ITERATOR$1 = _wks('iterator');
1241 var core_getIteratorMethod = _core.getIteratorMethod = function (it) {
1242 if (it != undefined) return it[ITERATOR$1]
1244 || _iterators[_classof(it)];
1247 var core_getIterator = _core.getIterator = function (it) {
1248 var iterFn = core_getIteratorMethod(it);
1249 if (typeof iterFn != 'function') throw TypeError(it + ' is not iterable!');
1250 return _anObject(iterFn.call(it));
1253 var getIterator = core_getIterator;
1255 var getIterator$1 = createCommonjsModule(function (module) {
1256 module.exports = { "default": getIterator, __esModule: true };
1259 var _getIterator = unwrapExports(getIterator$1);
1261 var _redefineAll = function (target, src, safe) {
1262 for (var key in src) {
1263 if (safe && target[key]) target[key] = src[key];
1264 else _hide(target, key, src[key]);
1268 var _anInstance = function (it, Constructor, name, forbiddenField) {
1269 if (!(it instanceof Constructor) || (forbiddenField !== undefined && forbiddenField in it)) {
1270 throw TypeError(name + ': incorrect invocation!');
1274 // call something on iterator step with safe closing on error
1276 var _iterCall = function (iterator, fn, value, entries) {
1278 return entries ? fn(_anObject(value)[0], value[1]) : fn(value);
1279 // 7.4.6 IteratorClose(iterator, completion)
1281 var ret = iterator['return'];
1282 if (ret !== undefined) _anObject(ret.call(iterator));
1287 // check on default Array iterator
1289 var ITERATOR$2 = _wks('iterator');
1290 var ArrayProto = Array.prototype;
1292 var _isArrayIter = function (it) {
1293 return it !== undefined && (_iterators.Array === it || ArrayProto[ITERATOR$2] === it);
1296 var _forOf = createCommonjsModule(function (module) {
1299 var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) {
1300 var iterFn = ITERATOR ? function () { return iterable; } : core_getIteratorMethod(iterable);
1301 var f = _ctx(fn, that, entries ? 2 : 1);
1303 var length, step, iterator, result;
1304 if (typeof iterFn != 'function') throw TypeError(iterable + ' is not iterable!');
1305 // fast case for arrays with default iterator
1306 if (_isArrayIter(iterFn)) for (length = _toLength(iterable.length); length > index; index++) {
1307 result = entries ? f(_anObject(step = iterable[index])[0], step[1]) : f(iterable[index]);
1308 if (result === BREAK || result === RETURN) return result;
1309 } else for (iterator = iterFn.call(iterable); !(step = iterator.next()).done;) {
1310 result = _iterCall(iterator, f, step.value, entries);
1311 if (result === BREAK || result === RETURN) return result;
1314 exports.BREAK = BREAK;
1315 exports.RETURN = RETURN;
1318 var SPECIES = _wks('species');
1320 var _setSpecies = function (KEY) {
1321 var C = typeof _core[KEY] == 'function' ? _core[KEY] : _global[KEY];
1322 if (_descriptors && C && !C[SPECIES]) _objectDp.f(C, SPECIES, {
1324 get: function () { return this; }
1328 var _validateCollection = function (it, TYPE) {
1329 if (!_isObject(it) || it._t !== TYPE) throw TypeError('Incompatible receiver, ' + TYPE + ' required!');
1333 var dP$2 = _objectDp.f;
1343 var fastKey = _meta.fastKey;
1345 var SIZE = _descriptors ? '_s' : 'size';
1347 var getEntry = function (that, key) {
1349 var index = fastKey(key);
1351 if (index !== 'F') return that._i[index];
1352 // frozen object case
1353 for (entry = that._f; entry; entry = entry.n) {
1354 if (entry.k == key) return entry;
1358 var _collectionStrong = {
1359 getConstructor: function (wrapper, NAME, IS_MAP, ADDER) {
1360 var C = wrapper(function (that, iterable) {
1361 _anInstance(that, C, NAME, '_i');
1362 that._t = NAME; // collection type
1363 that._i = _objectCreate(null); // index
1364 that._f = undefined; // first entry
1365 that._l = undefined; // last entry
1366 that[SIZE] = 0; // size
1367 if (iterable != undefined) _forOf(iterable, IS_MAP, that[ADDER], that);
1369 _redefineAll(C.prototype, {
1370 // 23.1.3.1 Map.prototype.clear()
1371 // 23.2.3.2 Set.prototype.clear()
1372 clear: function clear() {
1373 for (var that = _validateCollection(this, NAME), data = that._i, entry = that._f; entry; entry = entry.n) {
1375 if (entry.p) entry.p = entry.p.n = undefined;
1376 delete data[entry.i];
1378 that._f = that._l = undefined;
1381 // 23.1.3.3 Map.prototype.delete(key)
1382 // 23.2.3.4 Set.prototype.delete(value)
1383 'delete': function (key) {
1384 var that = _validateCollection(this, NAME);
1385 var entry = getEntry(that, key);
1389 delete that._i[entry.i];
1391 if (prev) prev.n = next;
1392 if (next) next.p = prev;
1393 if (that._f == entry) that._f = next;
1394 if (that._l == entry) that._l = prev;
1398 // 23.2.3.6 Set.prototype.forEach(callbackfn, thisArg = undefined)
1399 // 23.1.3.5 Map.prototype.forEach(callbackfn, thisArg = undefined)
1400 forEach: function forEach(callbackfn /* , that = undefined */) {
1401 _validateCollection(this, NAME);
1402 var f = _ctx(callbackfn, arguments.length > 1 ? arguments[1] : undefined, 3);
1404 while (entry = entry ? entry.n : this._f) {
1405 f(entry.v, entry.k, this);
1406 // revert to the last existing entry
1407 while (entry && entry.r) entry = entry.p;
1410 // 23.1.3.7 Map.prototype.has(key)
1411 // 23.2.3.7 Set.prototype.has(value)
1412 has: function has(key) {
1413 return !!getEntry(_validateCollection(this, NAME), key);
1416 if (_descriptors) dP$2(C.prototype, 'size', {
1418 return _validateCollection(this, NAME)[SIZE];
1423 def: function (that, key, value) {
1424 var entry = getEntry(that, key);
1426 // change existing entry
1432 i: index = fastKey(key, true), // <- index
1434 v: value, // <- value
1435 p: prev = that._l, // <- previous entry
1436 n: undefined, // <- next entry
1437 r: false // <- removed
1439 if (!that._f) that._f = entry;
1440 if (prev) prev.n = entry;
1443 if (index !== 'F') that._i[index] = entry;
1447 setStrong: function (C, NAME, IS_MAP) {
1448 // add .keys, .values, .entries, [@@iterator]
1449 // 23.1.3.4, 23.1.3.8, 23.1.3.11, 23.1.3.12, 23.2.3.5, 23.2.3.8, 23.2.3.10, 23.2.3.11
1450 _iterDefine(C, NAME, function (iterated, kind) {
1451 this._t = _validateCollection(iterated, NAME); // target
1452 this._k = kind; // kind
1453 this._l = undefined; // previous
1457 var entry = that._l;
1458 // revert to the last existing entry
1459 while (entry && entry.r) entry = entry.p;
1461 if (!that._t || !(that._l = entry = entry ? entry.n : that._t._f)) {
1462 // or finish the iteration
1463 that._t = undefined;
1464 return _iterStep(1);
1466 // return step by kind
1467 if (kind == 'keys') return _iterStep(0, entry.k);
1468 if (kind == 'values') return _iterStep(0, entry.v);
1469 return _iterStep(0, [entry.k, entry.v]);
1470 }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
1472 // add [@@species], 23.1.2.2, 23.2.2.2
1477 var SPECIES$1 = _wks('species');
1479 var _arraySpeciesConstructor = function (original) {
1481 if (_isArray(original)) {
1482 C = original.constructor;
1483 // cross-realm fallback
1484 if (typeof C == 'function' && (C === Array || _isArray(C.prototype))) C = undefined;
1487 if (C === null) C = undefined;
1489 } return C === undefined ? Array : C;
1492 // 9.4.2.3 ArraySpeciesCreate(originalArray, length)
1495 var _arraySpeciesCreate = function (original, length) {
1496 return new (_arraySpeciesConstructor(original))(length);
1499 // 0 -> Array#forEach
1501 // 2 -> Array#filter
1505 // 6 -> Array#findIndex
1511 var _arrayMethods = function (TYPE, $create) {
1512 var IS_MAP = TYPE == 1;
1513 var IS_FILTER = TYPE == 2;
1514 var IS_SOME = TYPE == 3;
1515 var IS_EVERY = TYPE == 4;
1516 var IS_FIND_INDEX = TYPE == 6;
1517 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
1518 var create = $create || _arraySpeciesCreate;
1519 return function ($this, callbackfn, that) {
1520 var O = _toObject($this);
1521 var self = _iobject(O);
1522 var f = _ctx(callbackfn, that, 3);
1523 var length = _toLength(self.length);
1525 var result = IS_MAP ? create($this, length) : IS_FILTER ? create($this, 0) : undefined;
1527 for (;length > index; index++) if (NO_HOLES || index in self) {
1529 res = f(val, index, O);
1531 if (IS_MAP) result[index] = res; // map
1532 else if (res) switch (TYPE) {
1533 case 3: return true; // some
1534 case 5: return val; // find
1535 case 6: return index; // findIndex
1536 case 2: result.push(val); // filter
1537 } else if (IS_EVERY) return false; // every
1540 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : result;
1544 var dP$3 = _objectDp.f;
1545 var each = _arrayMethods(0);
1548 var _collection = function (NAME, wrapper, methods, common, IS_MAP, IS_WEAK) {
1549 var Base = _global[NAME];
1551 var ADDER = IS_MAP ? 'set' : 'add';
1552 var proto = C && C.prototype;
1554 if (!_descriptors || typeof C != 'function' || !(IS_WEAK || proto.forEach && !_fails(function () {
1555 new C().entries().next();
1557 // create collection constructor
1558 C = common.getConstructor(wrapper, NAME, IS_MAP, ADDER);
1559 _redefineAll(C.prototype, methods);
1562 C = wrapper(function (target, iterable) {
1563 _anInstance(target, C, NAME, '_c');
1564 target._c = new Base();
1565 if (iterable != undefined) _forOf(iterable, IS_MAP, target[ADDER], target);
1567 each('add,clear,delete,forEach,get,has,set,keys,values,entries,toJSON'.split(','), function (KEY) {
1568 var IS_ADDER = KEY == 'add' || KEY == 'set';
1569 if (KEY in proto && !(IS_WEAK && KEY == 'clear')) _hide(C.prototype, KEY, function (a, b) {
1570 _anInstance(this, C, KEY);
1571 if (!IS_ADDER && IS_WEAK && !_isObject(a)) return KEY == 'get' ? undefined : false;
1572 var result = this._c[KEY](a === 0 ? 0 : a, b);
1573 return IS_ADDER ? this : result;
1576 IS_WEAK || dP$3(C.prototype, 'size', {
1578 return this._c.size;
1583 _setToStringTag(C, NAME);
1586 _export(_export.G + _export.W + _export.F, O);
1588 if (!IS_WEAK) common.setStrong(C, NAME, IS_MAP);
1596 var es6_map = _collection(MAP, function (get) {
1597 return function Map() { return get(this, arguments.length > 0 ? arguments[0] : undefined); };
1599 // 23.1.3.6 Map.prototype.get(key)
1600 get: function get(key) {
1601 var entry = _collectionStrong.getEntry(_validateCollection(this, MAP), key);
1602 return entry && entry.v;
1604 // 23.1.3.9 Map.prototype.set(key, value)
1605 set: function set(key, value) {
1606 return _collectionStrong.def(_validateCollection(this, MAP), key === 0 ? 0 : key, value);
1608 }, _collectionStrong, true);
1610 var _arrayFromIterable = function (iter, ITERATOR) {
1612 _forOf(iter, false, result.push, result, ITERATOR);
1616 // https://github.com/DavidBruant/Map-Set.prototype.toJSON
1619 var _collectionToJson = function (NAME) {
1620 return function toJSON() {
1621 if (_classof(this) != NAME) throw TypeError(NAME + "#toJSON isn't generic");
1622 return _arrayFromIterable(this);
1626 // https://github.com/DavidBruant/Map-Set.prototype.toJSON
1629 _export(_export.P + _export.R, 'Map', { toJSON: _collectionToJson('Map') });
1631 // https://tc39.github.io/proposal-setmap-offrom/
1634 var _setCollectionOf = function (COLLECTION) {
1635 _export(_export.S, COLLECTION, { of: function of() {
1636 var length = arguments.length;
1637 var A = new Array(length);
1638 while (length--) A[length] = arguments[length];
1643 // https://tc39.github.io/proposal-setmap-offrom/#sec-map.of
1644 _setCollectionOf('Map');
1646 // https://tc39.github.io/proposal-setmap-offrom/
1652 var _setCollectionFrom = function (COLLECTION) {
1653 _export(_export.S, COLLECTION, { from: function from(source /* , mapFn, thisArg */) {
1654 var mapFn = arguments[1];
1655 var mapping, A, n, cb;
1657 mapping = mapFn !== undefined;
1658 if (mapping) _aFunction(mapFn);
1659 if (source == undefined) return new this();
1663 cb = _ctx(mapFn, arguments[2], 2);
1664 _forOf(source, false, function (nextItem) {
1665 A.push(cb(nextItem, n++));
1668 _forOf(source, false, A.push, A);
1674 // https://tc39.github.io/proposal-setmap-offrom/#sec-map.from
1675 _setCollectionFrom('Map');
1677 var map = _core.Map;
1679 var map$1 = createCommonjsModule(function (module) {
1680 module.exports = { "default": map, __esModule: true };
1683 var _Map = unwrapExports(map$1);
1686 "aliceblue": [240, 248, 255],
\r
1687 "antiquewhite": [250, 235, 215],
\r
1688 "aqua": [0, 255, 255],
\r
1689 "aquamarine": [127, 255, 212],
\r
1690 "azure": [240, 255, 255],
\r
1691 "beige": [245, 245, 220],
\r
1692 "bisque": [255, 228, 196],
\r
1693 "black": [0, 0, 0],
\r
1694 "blanchedalmond": [255, 235, 205],
\r
1695 "blue": [0, 0, 255],
\r
1696 "blueviolet": [138, 43, 226],
\r
1697 "brown": [165, 42, 42],
\r
1698 "burlywood": [222, 184, 135],
\r
1699 "cadetblue": [95, 158, 160],
\r
1700 "chartreuse": [127, 255, 0],
\r
1701 "chocolate": [210, 105, 30],
\r
1702 "coral": [255, 127, 80],
\r
1703 "cornflowerblue": [100, 149, 237],
\r
1704 "cornsilk": [255, 248, 220],
\r
1705 "crimson": [220, 20, 60],
\r
1706 "cyan": [0, 255, 255],
\r
1707 "darkblue": [0, 0, 139],
\r
1708 "darkcyan": [0, 139, 139],
\r
1709 "darkgoldenrod": [184, 134, 11],
\r
1710 "darkgray": [169, 169, 169],
\r
1711 "darkgreen": [0, 100, 0],
\r
1712 "darkgrey": [169, 169, 169],
\r
1713 "darkkhaki": [189, 183, 107],
\r
1714 "darkmagenta": [139, 0, 139],
\r
1715 "darkolivegreen": [85, 107, 47],
\r
1716 "darkorange": [255, 140, 0],
\r
1717 "darkorchid": [153, 50, 204],
\r
1718 "darkred": [139, 0, 0],
\r
1719 "darksalmon": [233, 150, 122],
\r
1720 "darkseagreen": [143, 188, 143],
\r
1721 "darkslateblue": [72, 61, 139],
\r
1722 "darkslategray": [47, 79, 79],
\r
1723 "darkslategrey": [47, 79, 79],
\r
1724 "darkturquoise": [0, 206, 209],
\r
1725 "darkviolet": [148, 0, 211],
\r
1726 "deeppink": [255, 20, 147],
\r
1727 "deepskyblue": [0, 191, 255],
\r
1728 "dimgray": [105, 105, 105],
\r
1729 "dimgrey": [105, 105, 105],
\r
1730 "dodgerblue": [30, 144, 255],
\r
1731 "firebrick": [178, 34, 34],
\r
1732 "floralwhite": [255, 250, 240],
\r
1733 "forestgreen": [34, 139, 34],
\r
1734 "fuchsia": [255, 0, 255],
\r
1735 "gainsboro": [220, 220, 220],
\r
1736 "ghostwhite": [248, 248, 255],
\r
1737 "gold": [255, 215, 0],
\r
1738 "goldenrod": [218, 165, 32],
\r
1739 "gray": [128, 128, 128],
\r
1740 "green": [0, 128, 0],
\r
1741 "greenyellow": [173, 255, 47],
\r
1742 "grey": [128, 128, 128],
\r
1743 "honeydew": [240, 255, 240],
\r
1744 "hotpink": [255, 105, 180],
\r
1745 "indianred": [205, 92, 92],
\r
1746 "indigo": [75, 0, 130],
\r
1747 "ivory": [255, 255, 240],
\r
1748 "khaki": [240, 230, 140],
\r
1749 "lavender": [230, 230, 250],
\r
1750 "lavenderblush": [255, 240, 245],
\r
1751 "lawngreen": [124, 252, 0],
\r
1752 "lemonchiffon": [255, 250, 205],
\r
1753 "lightblue": [173, 216, 230],
\r
1754 "lightcoral": [240, 128, 128],
\r
1755 "lightcyan": [224, 255, 255],
\r
1756 "lightgoldenrodyellow": [250, 250, 210],
\r
1757 "lightgray": [211, 211, 211],
\r
1758 "lightgreen": [144, 238, 144],
\r
1759 "lightgrey": [211, 211, 211],
\r
1760 "lightpink": [255, 182, 193],
\r
1761 "lightsalmon": [255, 160, 122],
\r
1762 "lightseagreen": [32, 178, 170],
\r
1763 "lightskyblue": [135, 206, 250],
\r
1764 "lightslategray": [119, 136, 153],
\r
1765 "lightslategrey": [119, 136, 153],
\r
1766 "lightsteelblue": [176, 196, 222],
\r
1767 "lightyellow": [255, 255, 224],
\r
1768 "lime": [0, 255, 0],
\r
1769 "limegreen": [50, 205, 50],
\r
1770 "linen": [250, 240, 230],
\r
1771 "magenta": [255, 0, 255],
\r
1772 "maroon": [128, 0, 0],
\r
1773 "mediumaquamarine": [102, 205, 170],
\r
1774 "mediumblue": [0, 0, 205],
\r
1775 "mediumorchid": [186, 85, 211],
\r
1776 "mediumpurple": [147, 112, 219],
\r
1777 "mediumseagreen": [60, 179, 113],
\r
1778 "mediumslateblue": [123, 104, 238],
\r
1779 "mediumspringgreen": [0, 250, 154],
\r
1780 "mediumturquoise": [72, 209, 204],
\r
1781 "mediumvioletred": [199, 21, 133],
\r
1782 "midnightblue": [25, 25, 112],
\r
1783 "mintcream": [245, 255, 250],
\r
1784 "mistyrose": [255, 228, 225],
\r
1785 "moccasin": [255, 228, 181],
\r
1786 "navajowhite": [255, 222, 173],
\r
1787 "navy": [0, 0, 128],
\r
1788 "oldlace": [253, 245, 230],
\r
1789 "olive": [128, 128, 0],
\r
1790 "olivedrab": [107, 142, 35],
\r
1791 "orange": [255, 165, 0],
\r
1792 "orangered": [255, 69, 0],
\r
1793 "orchid": [218, 112, 214],
\r
1794 "palegoldenrod": [238, 232, 170],
\r
1795 "palegreen": [152, 251, 152],
\r
1796 "paleturquoise": [175, 238, 238],
\r
1797 "palevioletred": [219, 112, 147],
\r
1798 "papayawhip": [255, 239, 213],
\r
1799 "peachpuff": [255, 218, 185],
\r
1800 "peru": [205, 133, 63],
\r
1801 "pink": [255, 192, 203],
\r
1802 "plum": [221, 160, 221],
\r
1803 "powderblue": [176, 224, 230],
\r
1804 "purple": [128, 0, 128],
\r
1805 "rebeccapurple": [102, 51, 153],
\r
1806 "red": [255, 0, 0],
\r
1807 "rosybrown": [188, 143, 143],
\r
1808 "royalblue": [65, 105, 225],
\r
1809 "saddlebrown": [139, 69, 19],
\r
1810 "salmon": [250, 128, 114],
\r
1811 "sandybrown": [244, 164, 96],
\r
1812 "seagreen": [46, 139, 87],
\r
1813 "seashell": [255, 245, 238],
\r
1814 "sienna": [160, 82, 45],
\r
1815 "silver": [192, 192, 192],
\r
1816 "skyblue": [135, 206, 235],
\r
1817 "slateblue": [106, 90, 205],
\r
1818 "slategray": [112, 128, 144],
\r
1819 "slategrey": [112, 128, 144],
\r
1820 "snow": [255, 250, 250],
\r
1821 "springgreen": [0, 255, 127],
\r
1822 "steelblue": [70, 130, 180],
\r
1823 "tan": [210, 180, 140],
\r
1824 "teal": [0, 128, 128],
\r
1825 "thistle": [216, 191, 216],
\r
1826 "tomato": [255, 99, 71],
\r
1827 "turquoise": [64, 224, 208],
\r
1828 "violet": [238, 130, 238],
\r
1829 "wheat": [245, 222, 179],
\r
1830 "white": [255, 255, 255],
\r
1831 "whitesmoke": [245, 245, 245],
\r
1832 "yellow": [255, 255, 0],
\r
1833 "yellowgreen": [154, 205, 50]
\r
1836 var conversions = createCommonjsModule(function (module) {
1840 // NOTE: conversions should only return primitive values (i.e. arrays, or
1841 // values that give correct `typeof` results).
1842 // do not use box values types (i.e. Number(), String(), etc.)
1844 var reverseKeywords = {};
1845 for (var key in colorName) {
1846 if (colorName.hasOwnProperty(key)) {
1847 reverseKeywords[colorName[key]] = key;
1851 var convert = module.exports = {
1852 rgb: {channels: 3, labels: 'rgb'},
1853 hsl: {channels: 3, labels: 'hsl'},
1854 hsv: {channels: 3, labels: 'hsv'},
1855 hwb: {channels: 3, labels: 'hwb'},
1856 cmyk: {channels: 4, labels: 'cmyk'},
1857 xyz: {channels: 3, labels: 'xyz'},
1858 lab: {channels: 3, labels: 'lab'},
1859 lch: {channels: 3, labels: 'lch'},
1860 hex: {channels: 1, labels: ['hex']},
1861 keyword: {channels: 1, labels: ['keyword']},
1862 ansi16: {channels: 1, labels: ['ansi16']},
1863 ansi256: {channels: 1, labels: ['ansi256']},
1864 hcg: {channels: 3, labels: ['h', 'c', 'g']},
1865 apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
1866 gray: {channels: 1, labels: ['gray']}
1869 // hide .channels and .labels properties
1870 for (var model in convert) {
1871 if (convert.hasOwnProperty(model)) {
1872 if (!('channels' in convert[model])) {
1873 throw new Error('missing channels property: ' + model);
1876 if (!('labels' in convert[model])) {
1877 throw new Error('missing channel labels property: ' + model);
1880 if (convert[model].labels.length !== convert[model].channels) {
1881 throw new Error('channel and label counts mismatch: ' + model);
1884 var channels = convert[model].channels;
1885 var labels = convert[model].labels;
1886 delete convert[model].channels;
1887 delete convert[model].labels;
1888 Object.defineProperty(convert[model], 'channels', {value: channels});
1889 Object.defineProperty(convert[model], 'labels', {value: labels});
1893 convert.rgb.hsl = function (rgb) {
1894 var r = rgb[0] / 255;
1895 var g = rgb[1] / 255;
1896 var b = rgb[2] / 255;
1897 var min = Math.min(r, g, b);
1898 var max = Math.max(r, g, b);
1899 var delta = max - min;
1906 } else if (r === max) {
1907 h = (g - b) / delta;
1908 } else if (g === max) {
1909 h = 2 + (b - r) / delta;
1910 } else if (b === max) {
1911 h = 4 + (r - g) / delta;
1914 h = Math.min(h * 60, 360);
1920 l = (min + max) / 2;
1924 } else if (l <= 0.5) {
1925 s = delta / (max + min);
1927 s = delta / (2 - max - min);
1930 return [h, s * 100, l * 100];
1933 convert.rgb.hsv = function (rgb) {
1940 var r = rgb[0] / 255;
1941 var g = rgb[1] / 255;
1942 var b = rgb[2] / 255;
1943 var v = Math.max(r, g, b);
1944 var diff = v - Math.min(r, g, b);
1945 var diffc = function (c) {
1946 return (v - c) / 6 / diff + 1 / 2;
1959 } else if (g === v) {
1960 h = (1 / 3) + rdif - bdif;
1961 } else if (b === v) {
1962 h = (2 / 3) + gdif - rdif;
1978 convert.rgb.hwb = function (rgb) {
1982 var h = convert.rgb.hsl(rgb)[0];
1983 var w = 1 / 255 * Math.min(r, Math.min(g, b));
1985 b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
1987 return [h, w * 100, b * 100];
1990 convert.rgb.cmyk = function (rgb) {
1991 var r = rgb[0] / 255;
1992 var g = rgb[1] / 255;
1993 var b = rgb[2] / 255;
1999 k = Math.min(1 - r, 1 - g, 1 - b);
2000 c = (1 - r - k) / (1 - k) || 0;
2001 m = (1 - g - k) / (1 - k) || 0;
2002 y = (1 - b - k) / (1 - k) || 0;
2004 return [c * 100, m * 100, y * 100, k * 100];
2008 * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
2010 function comparativeDistance(x, y) {
2012 Math.pow(x[0] - y[0], 2) +
2013 Math.pow(x[1] - y[1], 2) +
2014 Math.pow(x[2] - y[2], 2)
2018 convert.rgb.keyword = function (rgb) {
2019 var reversed = reverseKeywords[rgb];
2024 var currentClosestDistance = Infinity;
2025 var currentClosestKeyword;
2027 for (var keyword in colorName) {
2028 if (colorName.hasOwnProperty(keyword)) {
2029 var value = colorName[keyword];
2031 // Compute comparative distance
2032 var distance = comparativeDistance(rgb, value);
2034 // Check if its less, if so set as closest
2035 if (distance < currentClosestDistance) {
2036 currentClosestDistance = distance;
2037 currentClosestKeyword = keyword;
2042 return currentClosestKeyword;
2045 convert.keyword.rgb = function (keyword) {
2046 return colorName[keyword];
2049 convert.rgb.xyz = function (rgb) {
2050 var r = rgb[0] / 255;
2051 var g = rgb[1] / 255;
2052 var b = rgb[2] / 255;
2055 r = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);
2056 g = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);
2057 b = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);
2059 var x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
2060 var y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
2061 var z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
2063 return [x * 100, y * 100, z * 100];
2066 convert.rgb.lab = function (rgb) {
2067 var xyz = convert.rgb.xyz(rgb);
2079 x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
2080 y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
2081 z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
2090 convert.hsl.rgb = function (hsl) {
2091 var h = hsl[0] / 360;
2092 var s = hsl[1] / 100;
2093 var l = hsl[2] / 100;
2102 return [val, val, val];
2114 for (var i = 0; i < 3; i++) {
2115 t3 = h + 1 / 3 * -(i - 1);
2124 val = t1 + (t2 - t1) * 6 * t3;
2125 } else if (2 * t3 < 1) {
2127 } else if (3 * t3 < 2) {
2128 val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
2139 convert.hsl.hsv = function (hsl) {
2141 var s = hsl[1] / 100;
2142 var l = hsl[2] / 100;
2144 var lmin = Math.max(l, 0.01);
2149 s *= (l <= 1) ? l : 2 - l;
2150 smin *= lmin <= 1 ? lmin : 2 - lmin;
2152 sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
2154 return [h, sv * 100, v * 100];
2157 convert.hsv.rgb = function (hsv) {
2158 var h = hsv[0] / 60;
2159 var s = hsv[1] / 100;
2160 var v = hsv[2] / 100;
2161 var hi = Math.floor(h) % 6;
2163 var f = h - Math.floor(h);
2164 var p = 255 * v * (1 - s);
2165 var q = 255 * v * (1 - (s * f));
2166 var t = 255 * v * (1 - (s * (1 - f)));
2185 convert.hsv.hsl = function (hsv) {
2187 var s = hsv[1] / 100;
2188 var v = hsv[2] / 100;
2189 var vmin = Math.max(v, 0.01);
2195 lmin = (2 - s) * vmin;
2197 sl /= (lmin <= 1) ? lmin : 2 - lmin;
2201 return [h, sl * 100, l * 100];
2204 // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
2205 convert.hwb.rgb = function (hwb) {
2206 var h = hwb[0] / 360;
2207 var wh = hwb[1] / 100;
2208 var bl = hwb[2] / 100;
2209 var ratio = wh + bl;
2215 // wh + bl cant be > 1
2221 i = Math.floor(6 * h);
2225 if ((i & 0x01) !== 0) {
2229 n = wh + f * (v - wh); // linear interpolation
2237 case 0: r = v; g = n; b = wh; break;
2238 case 1: r = n; g = v; b = wh; break;
2239 case 2: r = wh; g = v; b = n; break;
2240 case 3: r = wh; g = n; b = v; break;
2241 case 4: r = n; g = wh; b = v; break;
2242 case 5: r = v; g = wh; b = n; break;
2245 return [r * 255, g * 255, b * 255];
2248 convert.cmyk.rgb = function (cmyk) {
2249 var c = cmyk[0] / 100;
2250 var m = cmyk[1] / 100;
2251 var y = cmyk[2] / 100;
2252 var k = cmyk[3] / 100;
2257 r = 1 - Math.min(1, c * (1 - k) + k);
2258 g = 1 - Math.min(1, m * (1 - k) + k);
2259 b = 1 - Math.min(1, y * (1 - k) + k);
2261 return [r * 255, g * 255, b * 255];
2264 convert.xyz.rgb = function (xyz) {
2265 var x = xyz[0] / 100;
2266 var y = xyz[1] / 100;
2267 var z = xyz[2] / 100;
2272 r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
2273 g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
2274 b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
2278 ? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)
2282 ? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)
2286 ? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)
2289 r = Math.min(Math.max(0, r), 1);
2290 g = Math.min(Math.max(0, g), 1);
2291 b = Math.min(Math.max(0, b), 1);
2293 return [r * 255, g * 255, b * 255];
2296 convert.xyz.lab = function (xyz) {
2308 x = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);
2309 y = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);
2310 z = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);
2319 convert.lab.xyz = function (lab) {
2331 var y2 = Math.pow(y, 3);
2332 var x2 = Math.pow(x, 3);
2333 var z2 = Math.pow(z, 3);
2334 y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
2335 x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
2336 z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
2345 convert.lab.lch = function (lab) {
2353 hr = Math.atan2(b, a);
2354 h = hr * 360 / 2 / Math.PI;
2360 c = Math.sqrt(a * a + b * b);
2365 convert.lch.lab = function (lch) {
2373 hr = h / 360 * 2 * Math.PI;
2374 a = c * Math.cos(hr);
2375 b = c * Math.sin(hr);
2380 convert.rgb.ansi16 = function (args) {
2384 var value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization
2386 value = Math.round(value / 50);
2393 + ((Math.round(b / 255) << 2)
2394 | (Math.round(g / 255) << 1)
2395 | Math.round(r / 255));
2404 convert.hsv.ansi16 = function (args) {
2405 // optimization here; we already know the value and don't need to get
2406 // it converted for us.
2407 return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
2410 convert.rgb.ansi256 = function (args) {
2415 // we use the extended greyscale palette here, with the exception of
2416 // black and white. normal palette only has 4 greyscale shades.
2417 if (r === g && g === b) {
2426 return Math.round(((r - 8) / 247) * 24) + 232;
2430 + (36 * Math.round(r / 255 * 5))
2431 + (6 * Math.round(g / 255 * 5))
2432 + Math.round(b / 255 * 5);
2437 convert.ansi16.rgb = function (args) {
2438 var color = args % 10;
2441 if (color === 0 || color === 7) {
2446 color = color / 10.5 * 255;
2448 return [color, color, color];
2451 var mult = (~~(args > 50) + 1) * 0.5;
2452 var r = ((color & 1) * mult) * 255;
2453 var g = (((color >> 1) & 1) * mult) * 255;
2454 var b = (((color >> 2) & 1) * mult) * 255;
2459 convert.ansi256.rgb = function (args) {
2462 var c = (args - 232) * 10 + 8;
2469 var r = Math.floor(args / 36) / 5 * 255;
2470 var g = Math.floor((rem = args % 36) / 6) / 5 * 255;
2471 var b = (rem % 6) / 5 * 255;
2476 convert.rgb.hex = function (args) {
2477 var integer = ((Math.round(args[0]) & 0xFF) << 16)
2478 + ((Math.round(args[1]) & 0xFF) << 8)
2479 + (Math.round(args[2]) & 0xFF);
2481 var string = integer.toString(16).toUpperCase();
2482 return '000000'.substring(string.length) + string;
2485 convert.hex.rgb = function (args) {
2486 var match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
2491 var colorString = match[0];
2493 if (match[0].length === 3) {
2494 colorString = colorString.split('').map(function (char) {
2499 var integer = parseInt(colorString, 16);
2500 var r = (integer >> 16) & 0xFF;
2501 var g = (integer >> 8) & 0xFF;
2502 var b = integer & 0xFF;
2507 convert.rgb.hcg = function (rgb) {
2508 var r = rgb[0] / 255;
2509 var g = rgb[1] / 255;
2510 var b = rgb[2] / 255;
2511 var max = Math.max(Math.max(r, g), b);
2512 var min = Math.min(Math.min(r, g), b);
2513 var chroma = (max - min);
2518 grayscale = min / (1 - chroma);
2527 hue = ((g - b) / chroma) % 6;
2530 hue = 2 + (b - r) / chroma;
2532 hue = 4 + (r - g) / chroma + 4;
2538 return [hue * 360, chroma * 100, grayscale * 100];
2541 convert.hsl.hcg = function (hsl) {
2542 var s = hsl[1] / 100;
2543 var l = hsl[2] / 100;
2550 c = 2.0 * s * (1.0 - l);
2554 f = (l - 0.5 * c) / (1.0 - c);
2557 return [hsl[0], c * 100, f * 100];
2560 convert.hsv.hcg = function (hsv) {
2561 var s = hsv[1] / 100;
2562 var v = hsv[2] / 100;
2568 f = (v - c) / (1 - c);
2571 return [hsv[0], c * 100, f * 100];
2574 convert.hcg.rgb = function (hcg) {
2575 var h = hcg[0] / 360;
2576 var c = hcg[1] / 100;
2577 var g = hcg[2] / 100;
2580 return [g * 255, g * 255, g * 255];
2583 var pure = [0, 0, 0];
2584 var hi = (h % 1) * 6;
2589 switch (Math.floor(hi)) {
2591 pure[0] = 1; pure[1] = v; pure[2] = 0; break;
2593 pure[0] = w; pure[1] = 1; pure[2] = 0; break;
2595 pure[0] = 0; pure[1] = 1; pure[2] = v; break;
2597 pure[0] = 0; pure[1] = w; pure[2] = 1; break;
2599 pure[0] = v; pure[1] = 0; pure[2] = 1; break;
2601 pure[0] = 1; pure[1] = 0; pure[2] = w;
2607 (c * pure[0] + mg) * 255,
2608 (c * pure[1] + mg) * 255,
2609 (c * pure[2] + mg) * 255
2613 convert.hcg.hsv = function (hcg) {
2614 var c = hcg[1] / 100;
2615 var g = hcg[2] / 100;
2617 var v = c + g * (1.0 - c);
2624 return [hcg[0], f * 100, v * 100];
2627 convert.hcg.hsl = function (hcg) {
2628 var c = hcg[1] / 100;
2629 var g = hcg[2] / 100;
2631 var l = g * (1.0 - c) + 0.5 * c;
2634 if (l > 0.0 && l < 0.5) {
2637 if (l >= 0.5 && l < 1.0) {
2638 s = c / (2 * (1 - l));
2641 return [hcg[0], s * 100, l * 100];
2644 convert.hcg.hwb = function (hcg) {
2645 var c = hcg[1] / 100;
2646 var g = hcg[2] / 100;
2647 var v = c + g * (1.0 - c);
2648 return [hcg[0], (v - c) * 100, (1 - v) * 100];
2651 convert.hwb.hcg = function (hwb) {
2652 var w = hwb[1] / 100;
2653 var b = hwb[2] / 100;
2659 g = (v - c) / (1 - c);
2662 return [hwb[0], c * 100, g * 100];
2665 convert.apple.rgb = function (apple) {
2666 return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
2669 convert.rgb.apple = function (rgb) {
2670 return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
2673 convert.gray.rgb = function (args) {
2674 return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
2677 convert.gray.hsl = convert.gray.hsv = function (args) {
2678 return [0, 0, args[0]];
2681 convert.gray.hwb = function (gray) {
2682 return [0, 100, gray[0]];
2685 convert.gray.cmyk = function (gray) {
2686 return [0, 0, 0, gray[0]];
2689 convert.gray.lab = function (gray) {
2690 return [gray[0], 0, 0];
2693 convert.gray.hex = function (gray) {
2694 var val = Math.round(gray[0] / 100 * 255) & 0xFF;
2695 var integer = (val << 16) + (val << 8) + val;
2697 var string = integer.toString(16).toUpperCase();
2698 return '000000'.substring(string.length) + string;
2701 convert.rgb.gray = function (rgb) {
2702 var val = (rgb[0] + rgb[1] + rgb[2]) / 3;
2703 return [val / 255 * 100];
2706 var conversions_1 = conversions.rgb;
2707 var conversions_2 = conversions.hsl;
2708 var conversions_3 = conversions.hsv;
2709 var conversions_4 = conversions.hwb;
2710 var conversions_5 = conversions.cmyk;
2711 var conversions_6 = conversions.xyz;
2712 var conversions_7 = conversions.lab;
2713 var conversions_8 = conversions.lch;
2714 var conversions_9 = conversions.hex;
2715 var conversions_10 = conversions.keyword;
2716 var conversions_11 = conversions.ansi16;
2717 var conversions_12 = conversions.ansi256;
2718 var conversions_13 = conversions.hcg;
2719 var conversions_14 = conversions.apple;
2720 var conversions_15 = conversions.gray;
2723 this function routes a model to all other models.
2725 all functions that are routed have a property `.conversion` attached
2726 to the returned synthetic function. This property is an array
2727 of strings, each with the steps in between the 'from' and 'to'
2728 color models (inclusive).
2730 conversions that are not possible simply are not included.
2733 function buildGraph() {
2735 // https://jsperf.com/object-keys-vs-for-in-with-closure/3
2736 var models = Object.keys(conversions);
2738 for (var len = models.length, i = 0; i < len; i++) {
2739 graph[models[i]] = {
2740 // http://jsperf.com/1-vs-infinity
2741 // micro-opt, but this is simple.
2750 // https://en.wikipedia.org/wiki/Breadth-first_search
2751 function deriveBFS(fromModel) {
2752 var graph = buildGraph();
2753 var queue = [fromModel]; // unshift -> queue -> pop
2755 graph[fromModel].distance = 0;
2757 while (queue.length) {
2758 var current = queue.pop();
2759 var adjacents = Object.keys(conversions[current]);
2761 for (var len = adjacents.length, i = 0; i < len; i++) {
2762 var adjacent = adjacents[i];
2763 var node = graph[adjacent];
2765 if (node.distance === -1) {
2766 node.distance = graph[current].distance + 1;
2767 node.parent = current;
2768 queue.unshift(adjacent);
2776 function link(from, to) {
2777 return function (args) {
2778 return to(from(args));
2782 function wrapConversion(toModel, graph) {
2783 var path = [graph[toModel].parent, toModel];
2784 var fn = conversions[graph[toModel].parent][toModel];
2786 var cur = graph[toModel].parent;
2787 while (graph[cur].parent) {
2788 path.unshift(graph[cur].parent);
2789 fn = link(conversions[graph[cur].parent][cur], fn);
2790 cur = graph[cur].parent;
2793 fn.conversion = path;
2797 var route = function (fromModel) {
2798 var graph = deriveBFS(fromModel);
2799 var conversion = {};
2801 var models = Object.keys(graph);
2802 for (var len = models.length, i = 0; i < len; i++) {
2803 var toModel = models[i];
2804 var node = graph[toModel];
2806 if (node.parent === null) {
2807 // no possible conversion, or this node is the source model.
2811 conversion[toModel] = wrapConversion(toModel, graph);
2819 var models = Object.keys(conversions);
2821 function wrapRaw(fn) {
2822 var wrappedFn = function (args) {
2823 if (args === undefined || args === null) {
2827 if (arguments.length > 1) {
2828 args = Array.prototype.slice.call(arguments);
2834 // preserve .conversion property if there is one
2835 if ('conversion' in fn) {
2836 wrappedFn.conversion = fn.conversion;
2842 function wrapRounded(fn) {
2843 var wrappedFn = function (args) {
2844 if (args === undefined || args === null) {
2848 if (arguments.length > 1) {
2849 args = Array.prototype.slice.call(arguments);
2852 var result = fn(args);
2854 // we're assuming the result is an array here.
2855 // see notice in conversions.js; don't use box types
2856 // in conversion functions.
2857 if (typeof result === 'object') {
2858 for (var len = result.length, i = 0; i < len; i++) {
2859 result[i] = Math.round(result[i]);
2866 // preserve .conversion property if there is one
2867 if ('conversion' in fn) {
2868 wrappedFn.conversion = fn.conversion;
2874 models.forEach(function (fromModel) {
2875 convert[fromModel] = {};
2877 Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
2878 Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
2880 var routes = route(fromModel);
2881 var routeModels = Object.keys(routes);
2883 routeModels.forEach(function (toModel) {
2884 var fn = routes[toModel];
2886 convert[fromModel][toModel] = wrapRounded(fn);
2887 convert[fromModel][toModel].raw = wrapRaw(fn);
2891 var colorConvert = convert;
2893 var ansiStyles = createCommonjsModule(function (module) {
2895 var wrapAnsi16 = function wrapAnsi16(fn, offset) {
2896 return function () {
2897 var code = fn.apply(colorConvert, arguments);
2898 return '\x1B[' + (code + offset) + 'm';
2902 var wrapAnsi256 = function wrapAnsi256(fn, offset) {
2903 return function () {
2904 var code = fn.apply(colorConvert, arguments);
2905 return '\x1B[' + (38 + offset) + ';5;' + code + 'm';
2909 var wrapAnsi16m = function wrapAnsi16m(fn, offset) {
2910 return function () {
2911 var rgb = fn.apply(colorConvert, arguments);
2912 return '\x1B[' + (38 + offset) + ';2;' + rgb[0] + ';' + rgb[1] + ';' + rgb[2] + 'm';
2916 function assembleStyles() {
2917 var codes = new _Map();
2921 // 21 isn't widely supported and 22 does the same thing
2928 strikethrough: [9, 29]
2942 redBright: [91, 39],
2943 greenBright: [92, 39],
2944 yellowBright: [93, 39],
2945 blueBright: [94, 39],
2946 magentaBright: [95, 39],
2947 cyanBright: [96, 39],
2948 whiteBright: [97, 39]
2956 bgMagenta: [45, 49],
2961 bgBlackBright: [100, 49],
2962 bgRedBright: [101, 49],
2963 bgGreenBright: [102, 49],
2964 bgYellowBright: [103, 49],
2965 bgBlueBright: [104, 49],
2966 bgMagentaBright: [105, 49],
2967 bgCyanBright: [106, 49],
2968 bgWhiteBright: [107, 49]
2973 styles.color.grey = styles.color.gray;
2975 var _iteratorNormalCompletion = true;
2976 var _didIteratorError = false;
2977 var _iteratorError = undefined;
2980 for (var _iterator = _getIterator(_Object$keys(styles)), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
2981 var groupName = _step.value;
2983 var group = styles[groupName];
2985 var _iteratorNormalCompletion3 = true;
2986 var _didIteratorError3 = false;
2987 var _iteratorError3 = undefined;
2990 for (var _iterator3 = _getIterator(_Object$keys(group)), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
2991 var styleName = _step3.value;
2993 var style = group[styleName];
2995 styles[styleName] = {
2996 open: '\x1B[' + style[0] + 'm',
2997 close: '\x1B[' + style[1] + 'm'
3000 group[styleName] = styles[styleName];
3002 codes.set(style[0], style[1]);
3005 _didIteratorError3 = true;
3006 _iteratorError3 = err;
3009 if (!_iteratorNormalCompletion3 && _iterator3.return) {
3010 _iterator3.return();
3013 if (_didIteratorError3) {
3014 throw _iteratorError3;
3019 _Object$defineProperty(styles, groupName, {
3024 Object.defineProperty(styles, 'codes', {
3030 _didIteratorError = true;
3031 _iteratorError = err;
3034 if (!_iteratorNormalCompletion && _iterator.return) {
3038 if (_didIteratorError) {
3039 throw _iteratorError;
3044 var ansi2ansi = function ansi2ansi(n) {
3047 var rgb2rgb = function rgb2rgb(r, g, b) {
3051 styles.color.close = '\x1B[39m';
3052 styles.bgColor.close = '\x1B[49m';
3054 styles.color.ansi = {
3055 ansi: wrapAnsi16(ansi2ansi, 0)
3057 styles.color.ansi256 = {
3058 ansi256: wrapAnsi256(ansi2ansi, 0)
3060 styles.color.ansi16m = {
3061 rgb: wrapAnsi16m(rgb2rgb, 0)
3064 styles.bgColor.ansi = {
3065 ansi: wrapAnsi16(ansi2ansi, 10)
3067 styles.bgColor.ansi256 = {
3068 ansi256: wrapAnsi256(ansi2ansi, 10)
3070 styles.bgColor.ansi16m = {
3071 rgb: wrapAnsi16m(rgb2rgb, 10)
3074 var _iteratorNormalCompletion2 = true;
3075 var _didIteratorError2 = false;
3076 var _iteratorError2 = undefined;
3079 for (var _iterator2 = _getIterator(_Object$keys(colorConvert)), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
3080 var key = _step2.value;
3082 if (_typeof(colorConvert[key]) !== 'object') {
3086 var suite = colorConvert[key];
3088 if (key === 'ansi16') {
3092 if ('ansi16' in suite) {
3093 styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0);
3094 styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10);
3097 if ('ansi256' in suite) {
3098 styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0);
3099 styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10);
3102 if ('rgb' in suite) {
3103 styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0);
3104 styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10);
3108 _didIteratorError2 = true;
3109 _iteratorError2 = err;
3112 if (!_iteratorNormalCompletion2 && _iterator2.return) {
3113 _iterator2.return();
3116 if (_didIteratorError2) {
3117 throw _iteratorError2;
3125 // Make the export immutable
3126 Object.defineProperty(module, 'exports', {
3132 var getOwnPropertySymbols = _core.Object.getOwnPropertySymbols;
3134 var getOwnPropertySymbols$1 = createCommonjsModule(function (module) {
3135 module.exports = { "default": getOwnPropertySymbols, __esModule: true };
3138 var _Object$getOwnPropertySymbols = unwrapExports(getOwnPropertySymbols$1);
3141 * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
3143 * This source code is licensed under the MIT license found in the
3144 * LICENSE file in the root directory of this source tree.
3149 var getSymbols = _Object$getOwnPropertySymbols || function (obj) {
3153 var isSymbol$1 = function isSymbol(key) {
3155 // $FlowFixMe string literal `symbol`. This value is not a valid `typeof` return value
3156 (typeof key === 'undefined' ? 'undefined' : _typeof(key)) === 'symbol' || toString.call(key) === '[object Symbol]'
3160 // Return entries (for example, of a map)
3161 // with spacing, indentation, and comma
3162 // without surrounding punctuation (for example, braces)
3163 function printIteratorEntries(
3164 // Flow 0.51.0: property `@@iterator` of $Iterator not found in Object
3165 // To allow simplistic getRecordIterator in immutable.js
3166 iterator, config, indentation, depth, refs, printer) {
3167 var separator = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : ': ';
3170 var current = iterator.next();
3172 if (!current.done) {
3173 result += config.spacingOuter;
3175 var indentationNext = indentation + config.indent;
3177 while (!current.done) {
3178 var name = printer(current.value[0], config, indentationNext, depth, refs);
3179 var value = printer(current.value[1], config, indentationNext, depth, refs);
3181 result += indentationNext + name + separator + value;
3183 current = iterator.next();
3185 if (!current.done) {
3186 result += ',' + config.spacingInner;
3187 } else if (!config.min) {
3192 result += config.spacingOuter + indentation;
3198 // Return values (for example, of a set)
3199 // with spacing, indentation, and comma
3200 // without surrounding punctuation (braces or brackets)
3201 function printIteratorValues(iterator, config, indentation, depth, refs, printer) {
3203 var current = iterator.next();
3205 if (!current.done) {
3206 result += config.spacingOuter;
3208 var indentationNext = indentation + config.indent;
3210 while (!current.done) {
3211 result += indentationNext + printer(current.value, config, indentationNext, depth, refs);
3213 current = iterator.next();
3215 if (!current.done) {
3216 result += ',' + config.spacingInner;
3217 } else if (!config.min) {
3222 result += config.spacingOuter + indentation;
3228 // Return items (for example, of an array)
3229 // with spacing, indentation, and comma
3230 // without surrounding punctuation (for example, brackets)
3231 function printListItems(list, config, indentation, depth, refs, printer) {
3235 result += config.spacingOuter;
3237 var indentationNext = indentation + config.indent;
3239 for (var i = 0; i < list.length; i++) {
3240 result += indentationNext + printer(list[i], config, indentationNext, depth, refs);
3242 if (i < list.length - 1) {
3243 result += ',' + config.spacingInner;
3244 } else if (!config.min) {
3249 result += config.spacingOuter + indentation;
3255 // Return properties of an object
3256 // with spacing, indentation, and comma
3257 // without surrounding punctuation (for example, braces)
3258 function printObjectProperties(val, config, indentation, depth, refs, printer) {
3260 var keys = _Object$keys(val).sort();
3261 var symbols = getSymbols(val);
3263 if (symbols.length) {
3264 keys = keys.filter(function (key) {
3265 return !isSymbol$1(key);
3270 result += config.spacingOuter;
3272 var indentationNext = indentation + config.indent;
3274 for (var i = 0; i < keys.length; i++) {
3276 var name = printer(key, config, indentationNext, depth, refs);
3277 var value = printer(val[key], config, indentationNext, depth, refs);
3279 result += indentationNext + name + ': ' + value;
3281 if (i < keys.length - 1) {
3282 result += ',' + config.spacingInner;
3283 } else if (!config.min) {
3288 result += config.spacingOuter + indentation;
3294 var _for = _core.Symbol['for'];
3296 var _for$1 = createCommonjsModule(function (module) {
3297 module.exports = { "default": _for, __esModule: true };
3300 var _Symbol$for = unwrapExports(_for$1);
3302 var asymmetricMatcher = _Symbol$for('jest.asymmetricMatcher');
3305 var serialize = function serialize(val, config, indentation, depth, refs, printer) {
3306 var stringedValue = val.toString();
3308 if (stringedValue === 'ArrayContaining' || stringedValue === 'ArrayNotContaining') {
3309 if (++depth > config.maxDepth) {
3310 return '[' + stringedValue + ']';
3312 return stringedValue + SPACE + '[' + printListItems(val.sample, config, indentation, depth, refs, printer) + ']';
3315 if (stringedValue === 'ObjectContaining' || stringedValue === 'ObjectNotContaining') {
3316 if (++depth > config.maxDepth) {
3317 return '[' + stringedValue + ']';
3319 return stringedValue + SPACE + '{' + printObjectProperties(val.sample, config, indentation, depth, refs, printer) + '}';
3322 if (stringedValue === 'StringMatching' || stringedValue === 'StringNotMatching') {
3323 return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
3326 if (stringedValue === 'StringContaining' || stringedValue === 'StringNotContaining') {
3327 return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
3330 return val.toAsymmetricMatcher();
3333 var test = function test(val) {
3334 return val && val.$$typeof === asymmetricMatcher;
3337 var AsymmetricMatcher = { serialize: serialize, test: test };
3339 var ansiRegex = createCommonjsModule(function (module) {
3341 module.exports = function () {
3342 var pattern = ['[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:[a-zA-Z\\d]*(?:;[a-zA-Z\\d]*)*)?\\u0007)', '(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PRZcf-ntqry=><~]))'].join('|');
3344 return new RegExp(pattern, 'g');
3348 var toHumanReadableAnsi = function toHumanReadableAnsi(text) {
3349 return text.replace(ansiRegex(), function (match, offset, string) {
3351 case ansiStyles.red.close:
3352 case ansiStyles.green.close:
3353 case ansiStyles.cyan.close:
3354 case ansiStyles.gray.close:
3355 case ansiStyles.white.close:
3356 case ansiStyles.yellow.close:
3357 case ansiStyles.bgRed.close:
3358 case ansiStyles.bgGreen.close:
3359 case ansiStyles.bgYellow.close:
3360 case ansiStyles.inverse.close:
3361 case ansiStyles.dim.close:
3362 case ansiStyles.bold.close:
3363 case ansiStyles.reset.open:
3364 case ansiStyles.reset.close:
3366 case ansiStyles.red.open:
3368 case ansiStyles.green.open:
3370 case ansiStyles.cyan.open:
3372 case ansiStyles.gray.open:
3374 case ansiStyles.white.open:
3376 case ansiStyles.yellow.open:
3378 case ansiStyles.bgRed.open:
3380 case ansiStyles.bgGreen.open:
3382 case ansiStyles.bgYellow.open:
3383 return '<bgYellow>';
3384 case ansiStyles.inverse.open:
3386 case ansiStyles.dim.open:
3388 case ansiStyles.bold.open:
3396 var test$1 = function test(val) {
3397 return typeof val === 'string' && val.match(ansiRegex());
3400 var serialize$1 = function serialize(val, config, indentation, depth, refs, printer) {
3401 return printer(toHumanReadableAnsi(val), config, indentation, depth, refs);
3404 var ConvertAnsi = { serialize: serialize$1, test: test$1 };
3406 // 19.1.2.1 Object.assign(target, source, ...)
3412 var $assign = Object.assign;
3414 // should work with symbols and should have deterministic property order (V8 bug)
3415 var _objectAssign = !$assign || _fails(function () {
3418 // eslint-disable-next-line no-undef
3420 var K = 'abcdefghijklmnopqrst';
3422 K.split('').forEach(function (k) { B[k] = k; });
3423 return $assign({}, A)[S] != 7 || Object.keys($assign({}, B)).join('') != K;
3424 }) ? function assign(target, source) { // eslint-disable-line no-unused-vars
3425 var T = _toObject(target);
3426 var aLen = arguments.length;
3428 var getSymbols = _objectGops.f;
3429 var isEnum = _objectPie.f;
3430 while (aLen > index) {
3431 var S = _iobject(arguments[index++]);
3432 var keys = getSymbols ? _objectKeys(S).concat(getSymbols(S)) : _objectKeys(S);
3433 var length = keys.length;
3436 while (length > j) if (isEnum.call(S, key = keys[j++])) T[key] = S[key];
3440 // 19.1.3.1 Object.assign(target, source)
3443 _export(_export.S + _export.F, 'Object', { assign: _objectAssign });
3445 var assign = _core.Object.assign;
3447 var assign$1 = createCommonjsModule(function (module) {
3448 module.exports = { "default": assign, __esModule: true };
3451 var _Object$assign = unwrapExports(assign$1);
3455 var COLLECTION_NAMES = ['DOMStringMap', 'NamedNodeMap'];
3457 var test$2 = function test(val) {
3458 return val && val.constructor && COLLECTION_NAMES.indexOf(val.constructor.name) !== -1;
3461 var convertCollectionToObject = function convertCollectionToObject(collection) {
3464 if (collection.constructor.name === 'NamedNodeMap') {
3465 for (var i = 0; i < collection.length; i++) {
3466 result[collection[i].name] = collection[i].value;
3469 result = _Object$assign({}, collection);
3475 var serialize$2 = function serialize(collection, config, indentation, depth, refs, printer) {
3476 if (++depth > config.maxDepth) {
3477 return '[' + collection.constructor.name + ']';
3480 return collection.constructor.name + SPACE$1 + '{' + printObjectProperties(convertCollectionToObject(collection), config, indentation, depth, refs, printer) + '}';
3483 var DOMCollection = { serialize: serialize$2, test: test$2 };
3486 * Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
3488 * This source code is licensed under the MIT license found in the
3489 * LICENSE file in the root directory of this source tree.
3494 function escapeHTML(str) {
3495 return str.replace(/</g, '<').replace(/>/g, '>');
3498 // Return empty string if keys is empty.
3499 var printProps = function printProps(keys, props, config, indentation, depth, refs, printer) {
3500 var indentationNext = indentation + config.indent;
3501 var colors = config.colors;
3502 return keys.map(function (key) {
3503 var value = props[key];
3504 var printed = printer(value, config, indentationNext, depth, refs);
3506 if (typeof value !== 'string') {
3507 if (printed.indexOf('\n') !== -1) {
3508 printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation;
3510 printed = '{' + printed + '}';
3513 return config.spacingInner + indentation + colors.prop.open + key + colors.prop.close + '=' + colors.value.open + printed + colors.value.close;
3517 // Return empty string if children is empty.
3518 var printChildren = function printChildren(children, config, indentation, depth, refs, printer) {
3519 return children.map(function (child) {
3520 return config.spacingOuter + indentation + (typeof child === 'string' ? printText(child, config) : printer(child, config, indentation, depth, refs));
3524 var printText = function printText(text, config) {
3525 var contentColor = config.colors.content;
3526 return contentColor.open + escapeHTML(text) + contentColor.close;
3529 var printComment = function printComment(comment, config) {
3530 var commentColor = config.colors.comment;
3531 return commentColor.open + '<!--' + escapeHTML(comment) + '-->' + commentColor.close;
3534 // Separate the functions to format props, children, and element,
3535 // so a plugin could override a particular function, if needed.
3536 // Too bad, so sad: the traditional (but unnecessary) space
3537 // in a self-closing tagColor requires a second test of printedProps.
3538 var printElement = function printElement(type, printedProps, printedChildren, config, indentation) {
3539 var tagColor = config.colors.tag;
3540 return tagColor.open + '<' + type + (printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open) + (printedChildren ? '>' + tagColor.close + printedChildren + config.spacingOuter + indentation + tagColor.open + '</' + type : (printedProps && !config.min ? '' : ' ') + '/') + '>' + tagColor.close;
3543 var printElementAsLeaf = function printElementAsLeaf(type, config) {
3544 var tagColor = config.colors.tag;
3545 return tagColor.open + '<' + type + tagColor.close + ' …' + tagColor.open + ' />' + tagColor.close;
3548 var ELEMENT_NODE = 1;
3550 var COMMENT_NODE = 8;
3551 var FRAGMENT_NODE = 11;
3553 var ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
3555 var testNode = function testNode(nodeType, name) {
3556 return nodeType === ELEMENT_NODE && ELEMENT_REGEXP.test(name) || nodeType === TEXT_NODE && name === 'Text' || nodeType === COMMENT_NODE && name === 'Comment' || nodeType === FRAGMENT_NODE && name === 'DocumentFragment';
3559 var test$3 = function test(val) {
3560 return val && val.constructor && val.constructor.name && testNode(val.nodeType, val.constructor.name);
3563 // Convert array of attribute objects to keys array and props object.
3564 var keysMapper = function keysMapper(attribute) {
3565 return attribute.name;
3567 var propsReducer = function propsReducer(props, attribute) {
3568 props[attribute.name] = attribute.value;
3572 var serialize$3 = function serialize(node, config, indentation, depth, refs, printer) {
3573 if (node.nodeType === TEXT_NODE) {
3574 return printText(node.data, config);
3577 if (node.nodeType === COMMENT_NODE) {
3578 return printComment(node.data, config);
3581 var type = node.nodeType === FRAGMENT_NODE ? 'DocumentFragment' : node.tagName.toLowerCase();
3583 if (++depth > config.maxDepth) {
3584 return printElementAsLeaf(type, config);
3587 return printElement(type, printProps(Array.prototype.map.call(node.attributes || [], keysMapper).sort(), Array.prototype.reduce.call(node.attributes || [], propsReducer, {}), config, indentation + config.indent, depth, refs, printer), printChildren(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
3590 var DOMElement = { serialize: serialize$3, test: test$3 };
3592 // SENTINEL constants are from https://github.com/facebook/immutable-js
3593 var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';
3594 var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';
3595 var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';
3596 var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';
3597 var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';
3598 var IS_RECORD_SENTINEL = '@@__IMMUTABLE_RECORD__@@'; // immutable v4
3599 var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';
3600 var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';
3601 var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';
3603 var getImmutableName = function getImmutableName(name) {
3604 return 'Immutable.' + name;
3606 var printAsLeaf = function printAsLeaf(name) {
3607 return '[' + name + ']';
3610 var LAZY = '…'; // Seq is lazy if it calls a method like filter
3612 var printImmutableEntries = function printImmutableEntries(val, config, indentation, depth, refs, printer, type) {
3613 return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE$2 + '{' + printIteratorEntries(val.entries(), config, indentation, depth, refs, printer) + '}';
3616 // Record has an entries method because it is a collection in immutable v3.
3617 // Return an iterator for Immutable Record from version v3 or v4.
3618 var getRecordEntries = function getRecordEntries(val) {
3621 next: function next() {
3622 if (i < val._keys.length) {
3623 var key = val._keys[i++];
3624 return { done: false, value: [key, val.get(key)] };
3626 return { done: true };
3631 var printImmutableRecord = function printImmutableRecord(val, config, indentation, depth, refs, printer) {
3632 // _name property is defined only for an Immutable Record instance
3633 // which was constructed with a second optional descriptive name arg
3634 var name = getImmutableName(val._name || 'Record');
3635 return ++depth > config.maxDepth ? printAsLeaf(name) : name + SPACE$2 + '{' + printIteratorEntries(getRecordEntries(val), config, indentation, depth, refs, printer) + '}';
3638 var printImmutableSeq = function printImmutableSeq(val, config, indentation, depth, refs, printer) {
3639 var name = getImmutableName('Seq');
3641 if (++depth > config.maxDepth) {
3642 return printAsLeaf(name);
3645 if (val[IS_KEYED_SENTINEL]) {
3646 return name + SPACE$2 + '{' + (
3647 // from Immutable collection of entries or from ECMAScript object
3648 val._iter || val._object ? printIteratorEntries(val.entries(), config, indentation, depth, refs, printer) : LAZY) + '}';
3651 return name + SPACE$2 + '[' + (val._iter || // from Immutable collection of values
3652 val._array || // from ECMAScript array
3653 val._collection || // from ECMAScript collection in immutable v4
3654 val._iterable // from ECMAScript collection in immutable v3
3655 ? printIteratorValues(val.values(), config, indentation, depth, refs, printer) : LAZY) + ']';
3658 var printImmutableValues = function printImmutableValues(val, config, indentation, depth, refs, printer, type) {
3659 return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : getImmutableName(type) + SPACE$2 + '[' + printIteratorValues(val.values(), config, indentation, depth, refs, printer) + ']';
3662 var serialize$4 = function serialize(val, config, indentation, depth, refs, printer) {
3663 if (val[IS_MAP_SENTINEL]) {
3664 return printImmutableEntries(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? 'OrderedMap' : 'Map');
3667 if (val[IS_LIST_SENTINEL]) {
3668 return printImmutableValues(val, config, indentation, depth, refs, printer, 'List');
3670 if (val[IS_SET_SENTINEL]) {
3671 return printImmutableValues(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? 'OrderedSet' : 'Set');
3673 if (val[IS_STACK_SENTINEL]) {
3674 return printImmutableValues(val, config, indentation, depth, refs, printer, 'Stack');
3677 if (val[IS_SEQ_SENTINEL]) {
3678 return printImmutableSeq(val, config, indentation, depth, refs, printer);
3681 // For compatibility with immutable v3 and v4, let record be the default.
3682 return printImmutableRecord(val, config, indentation, depth, refs, printer);
3685 // Explicitly comparing sentinel properties to true avoids false positive
3686 // when mock identity-obj-proxy returns the key as the value for any key.
3687 var test$4 = function test(val) {
3688 return val && (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);
3691 var Immutable = { serialize: serialize$4, test: test$4 };
3693 var elementSymbol = _Symbol$for('react.element');
3694 var fragmentSymbol = _Symbol$for('react.fragment');
3695 var forwardRefSymbol = _Symbol$for('react.forward_ref');
3696 var providerSymbol = _Symbol$for('react.provider');
3697 var contextSymbol = _Symbol$for('react.context');
3699 // Given element.props.children, or subtree during recursive traversal,
3700 // return flattened array of children.
3701 var getChildren = function getChildren(arg) {
3702 var children = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
3704 if (Array.isArray(arg)) {
3705 arg.forEach(function (item) {
3706 getChildren(item, children);
3708 } else if (arg != null && arg !== false) {
3714 var getType = function getType(element) {
3715 var type = element.type;
3716 if (typeof type === 'string') {
3719 if (typeof type === 'function') {
3720 return type.displayName || type.name || 'Unknown';
3722 if (type === fragmentSymbol) {
3723 return 'React.Fragment';
3725 if ((typeof type === 'undefined' ? 'undefined' : _typeof(type)) === 'object' && type !== null) {
3726 if (type.$$typeof === providerSymbol) {
3727 return 'Context.Provider';
3730 if (type.$$typeof === contextSymbol) {
3731 return 'Context.Consumer';
3734 if (type.$$typeof === forwardRefSymbol) {
3735 var functionName = type.render.displayName || type.render.name || '';
3737 return functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef';
3743 var getPropKeys = function getPropKeys(element) {
3744 var props = element.props;
3747 return _Object$keys(props).filter(function (key) {
3748 return key !== 'children' && props[key] !== undefined;
3752 var serialize$5 = function serialize(element, config, indentation, depth, refs, printer) {
3753 return ++depth > config.maxDepth ? printElementAsLeaf(getType(element), config) : printElement(getType(element), printProps(getPropKeys(element), element.props, config, indentation + config.indent, depth, refs, printer), printChildren(getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
3756 var test$5 = function test(val) {
3757 return val && val.$$typeof === elementSymbol;
3760 var ReactElement = { serialize: serialize$5, test: test$5 };
3762 var testSymbol = _Symbol$for('react.test.json');
3764 var getPropKeys$1 = function getPropKeys(object) {
3765 var props = object.props;
3768 return props ? _Object$keys(props).filter(function (key) {
3769 return props[key] !== undefined;
3773 var serialize$6 = function serialize(object, config, indentation, depth, refs, printer) {
3774 return ++depth > config.maxDepth ? printElementAsLeaf(object.type, config) : printElement(object.type, object.props ? printProps(getPropKeys$1(object),
3775 // Despite ternary expression, Flow 0.51.0 found incorrect error:
3776 // undefined is incompatible with the expected param type of Object
3778 object.props, config, indentation + config.indent, depth, refs, printer) : '', object.children ? printChildren(object.children, config, indentation + config.indent, depth, refs, printer) : '', config, indentation);
3781 var test$6 = function test(val) {
3782 return val && val.$$typeof === testSymbol;
3785 var ReactTestComponent = { serialize: serialize$6, test: test$6 };
3787 var toString$3 = Object.prototype.toString;
3788 var toISOString = Date.prototype.toISOString;
3789 var errorToString = Error.prototype.toString;
3790 var regExpToString = RegExp.prototype.toString;
3791 var symbolToString = _Symbol.prototype.toString;
3793 // Explicitly comparing typeof constructor to function avoids undefined as name
3794 // when mock identity-obj-proxy returns the key as the value for any key.
3795 var getConstructorName = function getConstructorName(val) {
3796 return typeof val.constructor === 'function' && val.constructor.name || 'Object';
3799 // Is val is equal to global window object? Works even if it does not exist :)
3801 var isWindow = function isWindow(val) {
3802 return typeof window !== 'undefined' && val === window;
3805 var SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
3806 var NEWLINE_REGEXP = /\n/gi;
3808 var PrettyFormatPluginError = function (_Error) {
3809 _inherits(PrettyFormatPluginError, _Error);
3811 function PrettyFormatPluginError(message, stack) {
3812 _classCallCheck(this, PrettyFormatPluginError);
3814 var _this = _possibleConstructorReturn(this, (PrettyFormatPluginError.__proto__ || _Object$getPrototypeOf(PrettyFormatPluginError)).call(this, message));
3816 _this.stack = stack;
3817 _this.name = _this.constructor.name;
3821 return PrettyFormatPluginError;
3824 function isToStringedArrayType(toStringed) {
3825 return toStringed === '[object Array]' || toStringed === '[object ArrayBuffer]' || toStringed === '[object DataView]' || toStringed === '[object Float32Array]' || toStringed === '[object Float64Array]' || toStringed === '[object Int8Array]' || toStringed === '[object Int16Array]' || toStringed === '[object Int32Array]' || toStringed === '[object Uint8Array]' || toStringed === '[object Uint8ClampedArray]' || toStringed === '[object Uint16Array]' || toStringed === '[object Uint32Array]';
3828 function printNumber(val) {
3829 return _Object$is(val, -0) ? '-0' : String(val);
3832 function printFunction(val, printFunctionName) {
3833 if (!printFunctionName) {
3834 return '[Function]';
3836 return '[Function ' + (val.name || 'anonymous') + ']';
3839 function printSymbol(val) {
3840 return symbolToString.call(val).replace(SYMBOL_REGEXP, 'Symbol($1)');
3843 function printError(val) {
3844 return '[' + errorToString.call(val) + ']';
3847 function printBasicValue(val, printFunctionName, escapeRegex) {
3848 if (val === true || val === false) {
3851 if (val === undefined) {
3858 var typeOf = typeof val === 'undefined' ? 'undefined' : _typeof(val);
3860 if (typeOf === 'number') {
3861 return printNumber(val);
3863 if (typeOf === 'string') {
3864 return '"' + val.replace(/"|\\/g, '\\$&') + '"';
3866 if (typeOf === 'function') {
3867 return printFunction(val, printFunctionName);
3869 if (typeOf === 'symbol') {
3870 return printSymbol(val);
3873 var toStringed = toString$3.call(val);
3875 if (toStringed === '[object WeakMap]') {
3876 return 'WeakMap {}';
3878 if (toStringed === '[object WeakSet]') {
3879 return 'WeakSet {}';
3881 if (toStringed === '[object Function]' || toStringed === '[object GeneratorFunction]') {
3882 return printFunction(val, printFunctionName);
3884 if (toStringed === '[object Symbol]') {
3885 return printSymbol(val);
3887 if (toStringed === '[object Date]') {
3888 return isNaN(+val) ? 'Date { NaN }' : toISOString.call(val);
3890 if (toStringed === '[object Error]') {
3891 return printError(val);
3893 if (toStringed === '[object RegExp]') {
3895 // https://github.com/benjamingr/RegExp.escape/blob/master/polyfill.js
3896 return regExpToString.call(val).replace(/[\\^$*+?.()|[\]{}]/g, '\\$&');
3898 return regExpToString.call(val);
3901 if (val instanceof Error) {
3902 return printError(val);
3908 function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {
3909 if (refs.indexOf(val) !== -1) {
3910 return '[Circular]';
3912 refs = refs.slice();
3915 var hitMaxDepth = ++depth > config.maxDepth;
3916 var min = config.min;
3918 if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === 'function' && !hasCalledToJSON) {
3919 return printer(val.toJSON(), config, indentation, depth, refs, true);
3922 var toStringed = toString$3.call(val);
3923 if (toStringed === '[object Arguments]') {
3924 return hitMaxDepth ? '[Arguments]' : (min ? '' : 'Arguments ') + '[' + printListItems(val, config, indentation, depth, refs, printer) + ']';
3926 if (isToStringedArrayType(toStringed)) {
3927 return hitMaxDepth ? '[' + val.constructor.name + ']' : (min ? '' : val.constructor.name + ' ') + '[' + printListItems(val, config, indentation, depth, refs, printer) + ']';
3929 if (toStringed === '[object Map]') {
3930 return hitMaxDepth ? '[Map]' : 'Map {' + printIteratorEntries(val.entries(), config, indentation, depth, refs, printer, ' => ') + '}';
3932 if (toStringed === '[object Set]') {
3933 return hitMaxDepth ? '[Set]' : 'Set {' + printIteratorValues(val.values(), config, indentation, depth, refs, printer) + '}';
3936 // Avoid failure to serialize global window object in jsdom test environment.
3937 // For example, not even relevant if window is prop of React element.
3938 return hitMaxDepth || isWindow(val) ? '[' + getConstructorName(val) + ']' : (min ? '' : getConstructorName(val) + ' ') + '{' + printObjectProperties(val, config, indentation, depth, refs, printer) + '}';
3941 function printPlugin(plugin, val, config, indentation, depth, refs) {
3942 var printed = void 0;
3945 printed = plugin.serialize ? plugin.serialize(val, config, indentation, depth, refs, printer) : plugin.print(val, function (valChild) {
3946 return printer(valChild, config, indentation, depth, refs);
3948 var indentationNext = indentation + config.indent;
3949 return indentationNext + str.replace(NEWLINE_REGEXP, '\n' + indentationNext);
3951 edgeSpacing: config.spacingOuter,
3953 spacing: config.spacingInner
3956 throw new PrettyFormatPluginError(error.message, error.stack);
3958 if (typeof printed !== 'string') {
3959 throw new Error('pretty-format: Plugin must return type "string" but instead returned "' + (typeof printed === 'undefined' ? 'undefined' : _typeof(printed)) + '".');
3964 function findPlugin(plugins, val) {
3965 for (var p = 0; p < plugins.length; p++) {
3967 if (plugins[p].test(val)) {
3971 throw new PrettyFormatPluginError(error.message, error.stack);
3978 function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
3979 var plugin = findPlugin(config.plugins, val);
3980 if (plugin !== null) {
3981 return printPlugin(plugin, val, config, indentation, depth, refs);
3984 var basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex);
3985 if (basicResult !== null) {
3989 return printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
3992 var DEFAULT_THEME = {
4000 var DEFAULT_THEME_KEYS = _Object$keys(DEFAULT_THEME);
4002 var DEFAULT_OPTIONS = {
4010 printFunctionName: true,
4011 theme: DEFAULT_THEME
4014 function validateOptions(options) {
4015 _Object$keys(options).forEach(function (key) {
4016 if (!DEFAULT_OPTIONS.hasOwnProperty(key)) {
4017 throw new Error('pretty-format: Unknown option "' + key + '".');
4021 if (options.min && options.indent !== undefined && options.indent !== 0) {
4022 throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');
4025 if (options.theme !== undefined) {
4026 if (options.theme === null) {
4027 throw new Error('pretty-format: Option "theme" must not be null.');
4030 if (_typeof(options.theme) !== 'object') {
4031 throw new Error('pretty-format: Option "theme" must be of type "object" but instead received "' + _typeof(options.theme) + '".');
4036 var getColorsHighlight = function getColorsHighlight(options) {
4038 // $FlowFixMe: Flow thinks keys from `Colors` are missing from `DEFAULT_THEME_KEYS`
4039 DEFAULT_THEME_KEYS.reduce(function (colors, key) {
4040 var value = options.theme && options.theme[key] !== undefined ? options.theme[key] : DEFAULT_THEME[key];
4041 var color = ansiStyles[value];
4042 if (color && typeof color.close === 'string' && typeof color.open === 'string') {
4043 colors[key] = color;
4045 throw new Error('pretty-format: Option "theme" has a key "' + key + '" whose value "' + value + '" is undefined in ansi-styles.');
4048 }, _Object$create(null))
4052 var getColorsEmpty = function getColorsEmpty() {
4054 // $FlowFixMe: Flow thinks keys from `Colors` are missing from `DEFAULT_THEME_KEYS`
4055 DEFAULT_THEME_KEYS.reduce(function (colors, key) {
4056 colors[key] = { close: '', open: '' };
4058 }, _Object$create(null))
4062 var getPrintFunctionName = function getPrintFunctionName(options) {
4063 return options && options.printFunctionName !== undefined ? options.printFunctionName : DEFAULT_OPTIONS.printFunctionName;
4066 var getEscapeRegex = function getEscapeRegex(options) {
4067 return options && options.escapeRegex !== undefined ? options.escapeRegex : DEFAULT_OPTIONS.escapeRegex;
4070 var getConfig = function getConfig(options) {
4072 callToJSON: options && options.callToJSON !== undefined ? options.callToJSON : DEFAULT_OPTIONS.callToJSON,
4073 colors: options && options.highlight ? getColorsHighlight(options) : getColorsEmpty(),
4074 escapeRegex: getEscapeRegex(options),
4075 indent: options && options.min ? '' : createIndent(options && options.indent !== undefined ? options.indent : DEFAULT_OPTIONS.indent),
4076 maxDepth: options && options.maxDepth !== undefined ? options.maxDepth : DEFAULT_OPTIONS.maxDepth,
4077 min: options && options.min !== undefined ? options.min : DEFAULT_OPTIONS.min,
4078 plugins: options && options.plugins !== undefined ? options.plugins : DEFAULT_OPTIONS.plugins,
4079 printFunctionName: getPrintFunctionName(options),
4080 spacingInner: options && options.min ? ' ' : '\n',
4081 spacingOuter: options && options.min ? '' : '\n'
4085 function createIndent(indent) {
4086 return new Array(indent + 1).join(' ');
4089 function prettyFormat(val, options) {
4091 validateOptions(options);
4092 if (options.plugins) {
4093 var plugin = findPlugin(options.plugins, val);
4094 if (plugin !== null) {
4095 return printPlugin(plugin, val, getConfig(options), '', 0, []);
4100 var basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options));
4101 if (basicResult !== null) {
4105 return printComplexValue(val, getConfig(options), '', 0, []);
4108 prettyFormat.plugins = {
4109 AsymmetricMatcher: AsymmetricMatcher,
4110 ConvertAnsi: ConvertAnsi,
4111 DOMCollection: DOMCollection,
4112 DOMElement: DOMElement,
4113 Immutable: Immutable,
4114 ReactElement: ReactElement,
4115 ReactTestComponent: ReactTestComponent
4118 module.exports = prettyFormat;