UNPKG

371 kBJavaScriptView Raw
1/**
2 * vis-data
3 * http://visjs.org/
4 *
5 * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
6 *
7 * @version 7.1.4
8 * @date 2022-03-15T15:26:16.016Z
9 *
10 * @copyright (c) 2011-2017 Almende B.V, http://almende.com
11 * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
12 *
13 * @license
14 * vis.js is dual licensed under both
15 *
16 * 1. The Apache 2.0 License
17 * http://www.apache.org/licenses/LICENSE-2.0
18 *
19 * and
20 *
21 * 2. The MIT License
22 * http://opensource.org/licenses/MIT
23 *
24 * vis.js may be distributed under either license.
25 */
26
27function _classCallCheck(instance, Constructor) {
28 if (!(instance instanceof Constructor)) {
29 throw new TypeError("Cannot call a class as a function");
30 }
31}
32
33var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
34
35var defineProperty$e = {exports: {}};
36
37var check = function (it) {
38 return it && it.Math == Math && it;
39}; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
40
41
42var global$M = // eslint-disable-next-line es/no-global-this -- safe
43check(typeof globalThis == 'object' && globalThis) || check(typeof window == 'object' && window) || // eslint-disable-next-line no-restricted-globals -- safe
44check(typeof self == 'object' && self) || check(typeof commonjsGlobal == 'object' && commonjsGlobal) || // eslint-disable-next-line no-new-func -- fallback
45function () {
46 return this;
47}() || Function('return this')();
48
49var fails$r = function (exec) {
50 try {
51 return !!exec();
52 } catch (error) {
53 return true;
54 }
55};
56
57var fails$q = fails$r;
58var functionBindNative = !fails$q(function () {
59 var test = function () {
60 /* empty */
61 }.bind(); // eslint-disable-next-line no-prototype-builtins -- safe
62
63
64 return typeof test != 'function' || test.hasOwnProperty('prototype');
65});
66
67var NATIVE_BIND$4 = functionBindNative;
68var FunctionPrototype$3 = Function.prototype;
69var apply$6 = FunctionPrototype$3.apply;
70var call$c = FunctionPrototype$3.call; // eslint-disable-next-line es/no-reflect -- safe
71
72var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$4 ? call$c.bind(apply$6) : function () {
73 return call$c.apply(apply$6, arguments);
74});
75
76var NATIVE_BIND$3 = functionBindNative;
77var FunctionPrototype$2 = Function.prototype;
78var bind$d = FunctionPrototype$2.bind;
79var call$b = FunctionPrototype$2.call;
80var uncurryThis$t = NATIVE_BIND$3 && bind$d.bind(call$b, call$b);
81var functionUncurryThis = NATIVE_BIND$3 ? function (fn) {
82 return fn && uncurryThis$t(fn);
83} : function (fn) {
84 return fn && function () {
85 return call$b.apply(fn, arguments);
86 };
87};
88
89// https://tc39.es/ecma262/#sec-iscallable
90
91var isCallable$h = function (argument) {
92 return typeof argument == 'function';
93};
94
95var objectGetOwnPropertyDescriptor = {};
96
97var fails$p = fails$r; // Detect IE8's incomplete defineProperty implementation
98
99var descriptors = !fails$p(function () {
100 // eslint-disable-next-line es/no-object-defineproperty -- required for testing
101 return Object.defineProperty({}, 1, {
102 get: function () {
103 return 7;
104 }
105 })[1] != 7;
106});
107
108var NATIVE_BIND$2 = functionBindNative;
109var call$a = Function.prototype.call;
110var functionCall = NATIVE_BIND$2 ? call$a.bind(call$a) : function () {
111 return call$a.apply(call$a, arguments);
112};
113
114var objectPropertyIsEnumerable = {};
115
116var $propertyIsEnumerable$2 = {}.propertyIsEnumerable; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
117
118var getOwnPropertyDescriptor$5 = Object.getOwnPropertyDescriptor; // Nashorn ~ JDK8 bug
119
120var NASHORN_BUG = getOwnPropertyDescriptor$5 && !$propertyIsEnumerable$2.call({
121 1: 2
122}, 1); // `Object.prototype.propertyIsEnumerable` method implementation
123// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
124
125objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
126 var descriptor = getOwnPropertyDescriptor$5(this, V);
127 return !!descriptor && descriptor.enumerable;
128} : $propertyIsEnumerable$2;
129
130var createPropertyDescriptor$5 = function (bitmap, value) {
131 return {
132 enumerable: !(bitmap & 1),
133 configurable: !(bitmap & 2),
134 writable: !(bitmap & 4),
135 value: value
136 };
137};
138
139var uncurryThis$s = functionUncurryThis;
140var toString$9 = uncurryThis$s({}.toString);
141var stringSlice$1 = uncurryThis$s(''.slice);
142
143var classofRaw$1 = function (it) {
144 return stringSlice$1(toString$9(it), 8, -1);
145};
146
147var global$L = global$M;
148var uncurryThis$r = functionUncurryThis;
149var fails$o = fails$r;
150var classof$f = classofRaw$1;
151var Object$9 = global$L.Object;
152var split = uncurryThis$r(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings
153
154var indexedObject = fails$o(function () {
155 // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
156 // eslint-disable-next-line no-prototype-builtins -- safe
157 return !Object$9('z').propertyIsEnumerable(0);
158}) ? function (it) {
159 return classof$f(it) == 'String' ? split(it, '') : Object$9(it);
160} : Object$9;
161
162var global$K = global$M;
163var TypeError$j = global$K.TypeError; // `RequireObjectCoercible` abstract operation
164// https://tc39.es/ecma262/#sec-requireobjectcoercible
165
166var requireObjectCoercible$5 = function (it) {
167 if (it == undefined) throw TypeError$j("Can't call method on " + it);
168 return it;
169};
170
171var IndexedObject$3 = indexedObject;
172var requireObjectCoercible$4 = requireObjectCoercible$5;
173
174var toIndexedObject$b = function (it) {
175 return IndexedObject$3(requireObjectCoercible$4(it));
176};
177
178var isCallable$g = isCallable$h;
179
180var isObject$f = function (it) {
181 return typeof it == 'object' ? it !== null : isCallable$g(it);
182};
183
184var path$q = {};
185
186var path$p = path$q;
187var global$J = global$M;
188var isCallable$f = isCallable$h;
189
190var aFunction = function (variable) {
191 return isCallable$f(variable) ? variable : undefined;
192};
193
194var getBuiltIn$9 = function (namespace, method) {
195 return arguments.length < 2 ? aFunction(path$p[namespace]) || aFunction(global$J[namespace]) : path$p[namespace] && path$p[namespace][method] || global$J[namespace] && global$J[namespace][method];
196};
197
198var uncurryThis$q = functionUncurryThis;
199var objectIsPrototypeOf = uncurryThis$q({}.isPrototypeOf);
200
201var getBuiltIn$8 = getBuiltIn$9;
202var engineUserAgent = getBuiltIn$8('navigator', 'userAgent') || '';
203
204var global$I = global$M;
205var userAgent$3 = engineUserAgent;
206var process = global$I.process;
207var Deno = global$I.Deno;
208var versions = process && process.versions || Deno && Deno.version;
209var v8 = versions && versions.v8;
210var match, version;
211
212if (v8) {
213 match = v8.split('.'); // in old Chrome, versions of V8 isn't V8 = Chrome / 10
214 // but their correct versions are not interesting for us
215
216 version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
217} // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
218// so check `userAgent` even if `.v8` exists, but 0
219
220
221if (!version && userAgent$3) {
222 match = userAgent$3.match(/Edge\/(\d+)/);
223
224 if (!match || match[1] >= 74) {
225 match = userAgent$3.match(/Chrome\/(\d+)/);
226 if (match) version = +match[1];
227 }
228}
229
230var engineV8Version = version;
231
232/* eslint-disable es/no-symbol -- required for testing */
233var V8_VERSION$2 = engineV8Version;
234var fails$n = fails$r; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
235
236var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$n(function () {
237 var symbol = Symbol(); // Chrome 38 Symbol has incorrect toString conversion
238 // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
239
240 return !String(symbol) || !(Object(symbol) instanceof Symbol) || // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
241 !Symbol.sham && V8_VERSION$2 && V8_VERSION$2 < 41;
242});
243
244/* eslint-disable es/no-symbol -- required for testing */
245var NATIVE_SYMBOL$2 = nativeSymbol;
246var useSymbolAsUid = NATIVE_SYMBOL$2 && !Symbol.sham && typeof Symbol.iterator == 'symbol';
247
248var global$H = global$M;
249var getBuiltIn$7 = getBuiltIn$9;
250var isCallable$e = isCallable$h;
251var isPrototypeOf$i = objectIsPrototypeOf;
252var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
253var Object$8 = global$H.Object;
254var isSymbol$3 = USE_SYMBOL_AS_UID$1 ? function (it) {
255 return typeof it == 'symbol';
256} : function (it) {
257 var $Symbol = getBuiltIn$7('Symbol');
258 return isCallable$e($Symbol) && isPrototypeOf$i($Symbol.prototype, Object$8(it));
259};
260
261var global$G = global$M;
262var String$4 = global$G.String;
263
264var tryToString$4 = function (argument) {
265 try {
266 return String$4(argument);
267 } catch (error) {
268 return 'Object';
269 }
270};
271
272var global$F = global$M;
273var isCallable$d = isCallable$h;
274var tryToString$3 = tryToString$4;
275var TypeError$i = global$F.TypeError; // `Assert: IsCallable(argument) is true`
276
277var aCallable$7 = function (argument) {
278 if (isCallable$d(argument)) return argument;
279 throw TypeError$i(tryToString$3(argument) + ' is not a function');
280};
281
282var aCallable$6 = aCallable$7; // `GetMethod` abstract operation
283// https://tc39.es/ecma262/#sec-getmethod
284
285var getMethod$3 = function (V, P) {
286 var func = V[P];
287 return func == null ? undefined : aCallable$6(func);
288};
289
290var global$E = global$M;
291var call$9 = functionCall;
292var isCallable$c = isCallable$h;
293var isObject$e = isObject$f;
294var TypeError$h = global$E.TypeError; // `OrdinaryToPrimitive` abstract operation
295// https://tc39.es/ecma262/#sec-ordinarytoprimitive
296
297var ordinaryToPrimitive$1 = function (input, pref) {
298 var fn, val;
299 if (pref === 'string' && isCallable$c(fn = input.toString) && !isObject$e(val = call$9(fn, input))) return val;
300 if (isCallable$c(fn = input.valueOf) && !isObject$e(val = call$9(fn, input))) return val;
301 if (pref !== 'string' && isCallable$c(fn = input.toString) && !isObject$e(val = call$9(fn, input))) return val;
302 throw TypeError$h("Can't convert object to primitive value");
303};
304
305var shared$4 = {exports: {}};
306
307var global$D = global$M; // eslint-disable-next-line es/no-object-defineproperty -- safe
308
309var defineProperty$d = Object.defineProperty;
310
311var setGlobal$1 = function (key, value) {
312 try {
313 defineProperty$d(global$D, key, {
314 value: value,
315 configurable: true,
316 writable: true
317 });
318 } catch (error) {
319 global$D[key] = value;
320 }
321
322 return value;
323};
324
325var global$C = global$M;
326var setGlobal = setGlobal$1;
327var SHARED = '__core-js_shared__';
328var store$3 = global$C[SHARED] || setGlobal(SHARED, {});
329var sharedStore = store$3;
330
331var store$2 = sharedStore;
332(shared$4.exports = function (key, value) {
333 return store$2[key] || (store$2[key] = value !== undefined ? value : {});
334})('versions', []).push({
335 version: '3.21.1',
336 mode: 'pure' ,
337 copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
338 license: 'https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE',
339 source: 'https://github.com/zloirock/core-js'
340});
341
342var global$B = global$M;
343var requireObjectCoercible$3 = requireObjectCoercible$5;
344var Object$7 = global$B.Object; // `ToObject` abstract operation
345// https://tc39.es/ecma262/#sec-toobject
346
347var toObject$e = function (argument) {
348 return Object$7(requireObjectCoercible$3(argument));
349};
350
351var uncurryThis$p = functionUncurryThis;
352var toObject$d = toObject$e;
353var hasOwnProperty = uncurryThis$p({}.hasOwnProperty); // `HasOwnProperty` abstract operation
354// https://tc39.es/ecma262/#sec-hasownproperty
355
356var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
357 return hasOwnProperty(toObject$d(it), key);
358};
359
360var uncurryThis$o = functionUncurryThis;
361var id$1 = 0;
362var postfix = Math.random();
363var toString$8 = uncurryThis$o(1.0.toString);
364
365var uid$4 = function (key) {
366 return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$8(++id$1 + postfix, 36);
367};
368
369var global$A = global$M;
370var shared$3 = shared$4.exports;
371var hasOwn$f = hasOwnProperty_1;
372var uid$3 = uid$4;
373var NATIVE_SYMBOL$1 = nativeSymbol;
374var USE_SYMBOL_AS_UID = useSymbolAsUid;
375var WellKnownSymbolsStore$1 = shared$3('wks');
376var Symbol$2 = global$A.Symbol;
377var symbolFor = Symbol$2 && Symbol$2['for'];
378var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid$3;
379
380var wellKnownSymbol$j = function (name) {
381 if (!hasOwn$f(WellKnownSymbolsStore$1, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore$1[name] == 'string')) {
382 var description = 'Symbol.' + name;
383
384 if (NATIVE_SYMBOL$1 && hasOwn$f(Symbol$2, name)) {
385 WellKnownSymbolsStore$1[name] = Symbol$2[name];
386 } else if (USE_SYMBOL_AS_UID && symbolFor) {
387 WellKnownSymbolsStore$1[name] = symbolFor(description);
388 } else {
389 WellKnownSymbolsStore$1[name] = createWellKnownSymbol(description);
390 }
391 }
392
393 return WellKnownSymbolsStore$1[name];
394};
395
396var global$z = global$M;
397var call$8 = functionCall;
398var isObject$d = isObject$f;
399var isSymbol$2 = isSymbol$3;
400var getMethod$2 = getMethod$3;
401var ordinaryToPrimitive = ordinaryToPrimitive$1;
402var wellKnownSymbol$i = wellKnownSymbol$j;
403var TypeError$g = global$z.TypeError;
404var TO_PRIMITIVE$1 = wellKnownSymbol$i('toPrimitive'); // `ToPrimitive` abstract operation
405// https://tc39.es/ecma262/#sec-toprimitive
406
407var toPrimitive$1 = function (input, pref) {
408 if (!isObject$d(input) || isSymbol$2(input)) return input;
409 var exoticToPrim = getMethod$2(input, TO_PRIMITIVE$1);
410 var result;
411
412 if (exoticToPrim) {
413 if (pref === undefined) pref = 'default';
414 result = call$8(exoticToPrim, input, pref);
415 if (!isObject$d(result) || isSymbol$2(result)) return result;
416 throw TypeError$g("Can't convert object to primitive value");
417 }
418
419 if (pref === undefined) pref = 'number';
420 return ordinaryToPrimitive(input, pref);
421};
422
423var toPrimitive = toPrimitive$1;
424var isSymbol$1 = isSymbol$3; // `ToPropertyKey` abstract operation
425// https://tc39.es/ecma262/#sec-topropertykey
426
427var toPropertyKey$4 = function (argument) {
428 var key = toPrimitive(argument, 'string');
429 return isSymbol$1(key) ? key : key + '';
430};
431
432var global$y = global$M;
433var isObject$c = isObject$f;
434var document$1 = global$y.document; // typeof document.createElement is 'object' in old IE
435
436var EXISTS$1 = isObject$c(document$1) && isObject$c(document$1.createElement);
437
438var documentCreateElement$1 = function (it) {
439 return EXISTS$1 ? document$1.createElement(it) : {};
440};
441
442var DESCRIPTORS$h = descriptors;
443var fails$m = fails$r;
444var createElement = documentCreateElement$1; // Thanks to IE8 for its funny defineProperty
445
446var ie8DomDefine = !DESCRIPTORS$h && !fails$m(function () {
447 // eslint-disable-next-line es/no-object-defineproperty -- required for testing
448 return Object.defineProperty(createElement('div'), 'a', {
449 get: function () {
450 return 7;
451 }
452 }).a != 7;
453});
454
455var DESCRIPTORS$g = descriptors;
456var call$7 = functionCall;
457var propertyIsEnumerableModule$2 = objectPropertyIsEnumerable;
458var createPropertyDescriptor$4 = createPropertyDescriptor$5;
459var toIndexedObject$a = toIndexedObject$b;
460var toPropertyKey$3 = toPropertyKey$4;
461var hasOwn$e = hasOwnProperty_1;
462var IE8_DOM_DEFINE$1 = ie8DomDefine; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
463
464var $getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method
465// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
466
467objectGetOwnPropertyDescriptor.f = DESCRIPTORS$g ? $getOwnPropertyDescriptor$2 : function getOwnPropertyDescriptor(O, P) {
468 O = toIndexedObject$a(O);
469 P = toPropertyKey$3(P);
470 if (IE8_DOM_DEFINE$1) try {
471 return $getOwnPropertyDescriptor$2(O, P);
472 } catch (error) {
473 /* empty */
474 }
475 if (hasOwn$e(O, P)) return createPropertyDescriptor$4(!call$7(propertyIsEnumerableModule$2.f, O, P), O[P]);
476};
477
478var fails$l = fails$r;
479var isCallable$b = isCallable$h;
480var replacement = /#|\.prototype\./;
481
482var isForced$1 = function (feature, detection) {
483 var value = data[normalize(feature)];
484 return value == POLYFILL ? true : value == NATIVE ? false : isCallable$b(detection) ? fails$l(detection) : !!detection;
485};
486
487var normalize = isForced$1.normalize = function (string) {
488 return String(string).replace(replacement, '.').toLowerCase();
489};
490
491var data = isForced$1.data = {};
492var NATIVE = isForced$1.NATIVE = 'N';
493var POLYFILL = isForced$1.POLYFILL = 'P';
494var isForced_1 = isForced$1;
495
496var uncurryThis$n = functionUncurryThis;
497var aCallable$5 = aCallable$7;
498var NATIVE_BIND$1 = functionBindNative;
499var bind$c = uncurryThis$n(uncurryThis$n.bind); // optional / simple context binding
500
501var functionBindContext = function (fn, that) {
502 aCallable$5(fn);
503 return that === undefined ? fn : NATIVE_BIND$1 ? bind$c(fn, that) : function
504 /* ...args */
505 () {
506 return fn.apply(that, arguments);
507 };
508};
509
510var objectDefineProperty = {};
511
512var DESCRIPTORS$f = descriptors;
513var fails$k = fails$r; // V8 ~ Chrome 36-
514// https://bugs.chromium.org/p/v8/issues/detail?id=3334
515
516var v8PrototypeDefineBug = DESCRIPTORS$f && fails$k(function () {
517 // eslint-disable-next-line es/no-object-defineproperty -- required for testing
518 return Object.defineProperty(function () {
519 /* empty */
520 }, 'prototype', {
521 value: 42,
522 writable: false
523 }).prototype != 42;
524});
525
526var global$x = global$M;
527var isObject$b = isObject$f;
528var String$3 = global$x.String;
529var TypeError$f = global$x.TypeError; // `Assert: Type(argument) is Object`
530
531var anObject$b = function (argument) {
532 if (isObject$b(argument)) return argument;
533 throw TypeError$f(String$3(argument) + ' is not an object');
534};
535
536var global$w = global$M;
537var DESCRIPTORS$e = descriptors;
538var IE8_DOM_DEFINE = ie8DomDefine;
539var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
540var anObject$a = anObject$b;
541var toPropertyKey$2 = toPropertyKey$4;
542var TypeError$e = global$w.TypeError; // eslint-disable-next-line es/no-object-defineproperty -- safe
543
544var $defineProperty$1 = Object.defineProperty; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
545
546var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
547var ENUMERABLE = 'enumerable';
548var CONFIGURABLE$1 = 'configurable';
549var WRITABLE = 'writable'; // `Object.defineProperty` method
550// https://tc39.es/ecma262/#sec-object.defineproperty
551
552objectDefineProperty.f = DESCRIPTORS$e ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
553 anObject$a(O);
554 P = toPropertyKey$2(P);
555 anObject$a(Attributes);
556
557 if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
558 var current = $getOwnPropertyDescriptor$1(O, P);
559
560 if (current && current[WRITABLE]) {
561 O[P] = Attributes.value;
562 Attributes = {
563 configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
564 enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
565 writable: false
566 };
567 }
568 }
569
570 return $defineProperty$1(O, P, Attributes);
571} : $defineProperty$1 : function defineProperty(O, P, Attributes) {
572 anObject$a(O);
573 P = toPropertyKey$2(P);
574 anObject$a(Attributes);
575 if (IE8_DOM_DEFINE) try {
576 return $defineProperty$1(O, P, Attributes);
577 } catch (error) {
578 /* empty */
579 }
580 if ('get' in Attributes || 'set' in Attributes) throw TypeError$e('Accessors not supported');
581 if ('value' in Attributes) O[P] = Attributes.value;
582 return O;
583};
584
585var DESCRIPTORS$d = descriptors;
586var definePropertyModule$4 = objectDefineProperty;
587var createPropertyDescriptor$3 = createPropertyDescriptor$5;
588var createNonEnumerableProperty$6 = DESCRIPTORS$d ? function (object, key, value) {
589 return definePropertyModule$4.f(object, key, createPropertyDescriptor$3(1, value));
590} : function (object, key, value) {
591 object[key] = value;
592 return object;
593};
594
595var global$v = global$M;
596var apply$5 = functionApply;
597var uncurryThis$m = functionUncurryThis;
598var isCallable$a = isCallable$h;
599var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
600var isForced = isForced_1;
601var path$o = path$q;
602var bind$b = functionBindContext;
603var createNonEnumerableProperty$5 = createNonEnumerableProperty$6;
604var hasOwn$d = hasOwnProperty_1;
605
606var wrapConstructor = function (NativeConstructor) {
607 var Wrapper = function (a, b, c) {
608 if (this instanceof Wrapper) {
609 switch (arguments.length) {
610 case 0:
611 return new NativeConstructor();
612
613 case 1:
614 return new NativeConstructor(a);
615
616 case 2:
617 return new NativeConstructor(a, b);
618 }
619
620 return new NativeConstructor(a, b, c);
621 }
622
623 return apply$5(NativeConstructor, this, arguments);
624 };
625
626 Wrapper.prototype = NativeConstructor.prototype;
627 return Wrapper;
628};
629/*
630 options.target - name of the target object
631 options.global - target is the global object
632 options.stat - export as static methods of target
633 options.proto - export as prototype methods of target
634 options.real - real prototype method for the `pure` version
635 options.forced - export even if the native feature is available
636 options.bind - bind methods to the target, required for the `pure` version
637 options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
638 options.unsafe - use the simple assignment of property instead of delete + defineProperty
639 options.sham - add a flag to not completely full polyfills
640 options.enumerable - export as enumerable property
641 options.noTargetGet - prevent calling a getter on target
642 options.name - the .name of the function if it does not match the key
643*/
644
645
646var _export = function (options, source) {
647 var TARGET = options.target;
648 var GLOBAL = options.global;
649 var STATIC = options.stat;
650 var PROTO = options.proto;
651 var nativeSource = GLOBAL ? global$v : STATIC ? global$v[TARGET] : (global$v[TARGET] || {}).prototype;
652 var target = GLOBAL ? path$o : path$o[TARGET] || createNonEnumerableProperty$5(path$o, TARGET, {})[TARGET];
653 var targetPrototype = target.prototype;
654 var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
655 var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
656
657 for (key in source) {
658 FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced); // contains in native
659
660 USE_NATIVE = !FORCED && nativeSource && hasOwn$d(nativeSource, key);
661 targetProperty = target[key];
662 if (USE_NATIVE) if (options.noTargetGet) {
663 descriptor = getOwnPropertyDescriptor$4(nativeSource, key);
664 nativeProperty = descriptor && descriptor.value;
665 } else nativeProperty = nativeSource[key]; // export native or implementation
666
667 sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key];
668 if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue; // bind timers to global for call from export context
669
670 if (options.bind && USE_NATIVE) resultProperty = bind$b(sourceProperty, global$v); // wrap global constructors for prevent changs in this version
671 else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty); // make static versions for prototype methods
672 else if (PROTO && isCallable$a(sourceProperty)) resultProperty = uncurryThis$m(sourceProperty); // default case
673 else resultProperty = sourceProperty; // add a flag to not completely full polyfills
674
675 if (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) {
676 createNonEnumerableProperty$5(resultProperty, 'sham', true);
677 }
678
679 createNonEnumerableProperty$5(target, key, resultProperty);
680
681 if (PROTO) {
682 VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
683
684 if (!hasOwn$d(path$o, VIRTUAL_PROTOTYPE)) {
685 createNonEnumerableProperty$5(path$o, VIRTUAL_PROTOTYPE, {});
686 } // export virtual prototype methods
687
688
689 createNonEnumerableProperty$5(path$o[VIRTUAL_PROTOTYPE], key, sourceProperty); // export real prototype methods
690
691 if (options.real && targetPrototype && !targetPrototype[key]) {
692 createNonEnumerableProperty$5(targetPrototype, key, sourceProperty);
693 }
694 }
695 }
696};
697
698var $$C = _export;
699var DESCRIPTORS$c = descriptors;
700var defineProperty$c = objectDefineProperty.f; // `Object.defineProperty` method
701// https://tc39.es/ecma262/#sec-object.defineproperty
702// eslint-disable-next-line es/no-object-defineproperty -- safe
703
704$$C({
705 target: 'Object',
706 stat: true,
707 forced: Object.defineProperty !== defineProperty$c,
708 sham: !DESCRIPTORS$c
709}, {
710 defineProperty: defineProperty$c
711});
712
713var path$n = path$q;
714var Object$6 = path$n.Object;
715
716var defineProperty$b = defineProperty$e.exports = function defineProperty(it, key, desc) {
717 return Object$6.defineProperty(it, key, desc);
718};
719
720if (Object$6.defineProperty.sham) defineProperty$b.sham = true;
721
722var parent$V = defineProperty$e.exports;
723var defineProperty$a = parent$V;
724
725var parent$U = defineProperty$a;
726var defineProperty$9 = parent$U;
727
728var parent$T = defineProperty$9;
729var defineProperty$8 = parent$T;
730
731var defineProperty$7 = defineProperty$8;
732
733function _defineProperties(target, props) {
734 for (var i = 0; i < props.length; i++) {
735 var descriptor = props[i];
736 descriptor.enumerable = descriptor.enumerable || false;
737 descriptor.configurable = true;
738 if ("value" in descriptor) descriptor.writable = true;
739
740 defineProperty$7(target, descriptor.key, descriptor);
741 }
742}
743
744function _createClass(Constructor, protoProps, staticProps) {
745 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
746 if (staticProps) _defineProperties(Constructor, staticProps);
747
748 defineProperty$7(Constructor, "prototype", {
749 writable: false
750 });
751
752 return Constructor;
753}
754
755function _defineProperty(obj, key, value) {
756 if (key in obj) {
757 defineProperty$7(obj, key, {
758 value: value,
759 enumerable: true,
760 configurable: true,
761 writable: true
762 });
763 } else {
764 obj[key] = value;
765 }
766
767 return obj;
768}
769
770var uncurryThis$l = functionUncurryThis;
771var arraySlice$5 = uncurryThis$l([].slice);
772
773var global$u = global$M;
774var uncurryThis$k = functionUncurryThis;
775var aCallable$4 = aCallable$7;
776var isObject$a = isObject$f;
777var hasOwn$c = hasOwnProperty_1;
778var arraySlice$4 = arraySlice$5;
779var NATIVE_BIND = functionBindNative;
780var Function$2 = global$u.Function;
781var concat$6 = uncurryThis$k([].concat);
782var join = uncurryThis$k([].join);
783var factories = {};
784
785var construct$4 = function (C, argsLength, args) {
786 if (!hasOwn$c(factories, argsLength)) {
787 for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
788
789 factories[argsLength] = Function$2('C,a', 'return new C(' + join(list, ',') + ')');
790 }
791
792 return factories[argsLength](C, args);
793}; // `Function.prototype.bind` method implementation
794// https://tc39.es/ecma262/#sec-function.prototype.bind
795
796
797var functionBind = NATIVE_BIND ? Function$2.bind : function bind(that
798/* , ...args */
799) {
800 var F = aCallable$4(this);
801 var Prototype = F.prototype;
802 var partArgs = arraySlice$4(arguments, 1);
803
804 var boundFunction = function
805 /* args... */
806 bound() {
807 var args = concat$6(partArgs, arraySlice$4(arguments));
808 return this instanceof boundFunction ? construct$4(F, args.length, args) : F.apply(that, args);
809 };
810
811 if (isObject$a(Prototype)) boundFunction.prototype = Prototype;
812 return boundFunction;
813};
814
815var $$B = _export;
816var bind$a = functionBind; // `Function.prototype.bind` method
817// https://tc39.es/ecma262/#sec-function.prototype.bind
818
819$$B({
820 target: 'Function',
821 proto: true,
822 forced: Function.bind !== bind$a
823}, {
824 bind: bind$a
825});
826
827var path$m = path$q;
828
829var entryVirtual$k = function (CONSTRUCTOR) {
830 return path$m[CONSTRUCTOR + 'Prototype'];
831};
832
833var entryVirtual$j = entryVirtual$k;
834var bind$9 = entryVirtual$j('Function').bind;
835
836var isPrototypeOf$h = objectIsPrototypeOf;
837var method$e = bind$9;
838var FunctionPrototype$1 = Function.prototype;
839
840var bind$8 = function (it) {
841 var own = it.bind;
842 return it === FunctionPrototype$1 || isPrototypeOf$h(FunctionPrototype$1, it) && own === FunctionPrototype$1.bind ? method$e : own;
843};
844
845var parent$S = bind$8;
846var bind$7 = parent$S;
847
848var bind$6 = bind$7;
849
850var ceil = Math.ceil;
851var floor$1 = Math.floor; // `ToIntegerOrInfinity` abstract operation
852// https://tc39.es/ecma262/#sec-tointegerorinfinity
853
854var toIntegerOrInfinity$4 = function (argument) {
855 var number = +argument; // eslint-disable-next-line no-self-compare -- safe
856
857 return number !== number || number === 0 ? 0 : (number > 0 ? floor$1 : ceil)(number);
858};
859
860var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
861var min$2 = Math.min; // `ToLength` abstract operation
862// https://tc39.es/ecma262/#sec-tolength
863
864var toLength$1 = function (argument) {
865 return argument > 0 ? min$2(toIntegerOrInfinity$3(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
866};
867
868var toLength = toLength$1; // `LengthOfArrayLike` abstract operation
869// https://tc39.es/ecma262/#sec-lengthofarraylike
870
871var lengthOfArrayLike$d = function (obj) {
872 return toLength(obj.length);
873};
874
875var global$t = global$M;
876var aCallable$3 = aCallable$7;
877var toObject$c = toObject$e;
878var IndexedObject$2 = indexedObject;
879var lengthOfArrayLike$c = lengthOfArrayLike$d;
880var TypeError$d = global$t.TypeError; // `Array.prototype.{ reduce, reduceRight }` methods implementation
881
882var createMethod$5 = function (IS_RIGHT) {
883 return function (that, callbackfn, argumentsLength, memo) {
884 aCallable$3(callbackfn);
885 var O = toObject$c(that);
886 var self = IndexedObject$2(O);
887 var length = lengthOfArrayLike$c(O);
888 var index = IS_RIGHT ? length - 1 : 0;
889 var i = IS_RIGHT ? -1 : 1;
890 if (argumentsLength < 2) while (true) {
891 if (index in self) {
892 memo = self[index];
893 index += i;
894 break;
895 }
896
897 index += i;
898
899 if (IS_RIGHT ? index < 0 : length <= index) {
900 throw TypeError$d('Reduce of empty array with no initial value');
901 }
902 }
903
904 for (; IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
905 memo = callbackfn(memo, self[index], index, O);
906 }
907
908 return memo;
909 };
910};
911
912var arrayReduce = {
913 // `Array.prototype.reduce` method
914 // https://tc39.es/ecma262/#sec-array.prototype.reduce
915 left: createMethod$5(false),
916 // `Array.prototype.reduceRight` method
917 // https://tc39.es/ecma262/#sec-array.prototype.reduceright
918 right: createMethod$5(true)
919};
920
921var fails$j = fails$r;
922
923var arrayMethodIsStrict$5 = function (METHOD_NAME, argument) {
924 var method = [][METHOD_NAME];
925 return !!method && fails$j(function () {
926 // eslint-disable-next-line no-useless-call -- required for testing
927 method.call(null, argument || function () {
928 return 1;
929 }, 1);
930 });
931};
932
933var classof$e = classofRaw$1;
934var global$s = global$M;
935var engineIsNode = classof$e(global$s.process) == 'process';
936
937var $$A = _export;
938var $reduce = arrayReduce.left;
939var arrayMethodIsStrict$4 = arrayMethodIsStrict$5;
940var CHROME_VERSION = engineV8Version;
941var IS_NODE = engineIsNode;
942var STRICT_METHOD$4 = arrayMethodIsStrict$4('reduce'); // Chrome 80-82 has a critical bug
943// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
944
945var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83; // `Array.prototype.reduce` method
946// https://tc39.es/ecma262/#sec-array.prototype.reduce
947
948$$A({
949 target: 'Array',
950 proto: true,
951 forced: !STRICT_METHOD$4 || CHROME_BUG
952}, {
953 reduce: function reduce(callbackfn
954 /* , initialValue */
955 ) {
956 var length = arguments.length;
957 return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
958 }
959});
960
961var entryVirtual$i = entryVirtual$k;
962var reduce$3 = entryVirtual$i('Array').reduce;
963
964var isPrototypeOf$g = objectIsPrototypeOf;
965var method$d = reduce$3;
966var ArrayPrototype$e = Array.prototype;
967
968var reduce$2 = function (it) {
969 var own = it.reduce;
970 return it === ArrayPrototype$e || isPrototypeOf$g(ArrayPrototype$e, it) && own === ArrayPrototype$e.reduce ? method$d : own;
971};
972
973var parent$R = reduce$2;
974var reduce$1 = parent$R;
975
976var reduce = reduce$1;
977
978var classof$d = classofRaw$1; // `IsArray` abstract operation
979// https://tc39.es/ecma262/#sec-isarray
980// eslint-disable-next-line es/no-array-isarray -- safe
981
982var isArray$d = Array.isArray || function isArray(argument) {
983 return classof$d(argument) == 'Array';
984};
985
986var wellKnownSymbol$h = wellKnownSymbol$j;
987var TO_STRING_TAG$3 = wellKnownSymbol$h('toStringTag');
988var test$2 = {};
989test$2[TO_STRING_TAG$3] = 'z';
990var toStringTagSupport = String(test$2) === '[object z]';
991
992var global$r = global$M;
993var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
994var isCallable$9 = isCallable$h;
995var classofRaw = classofRaw$1;
996var wellKnownSymbol$g = wellKnownSymbol$j;
997var TO_STRING_TAG$2 = wellKnownSymbol$g('toStringTag');
998var Object$5 = global$r.Object; // ES3 wrong here
999
1000var CORRECT_ARGUMENTS = classofRaw(function () {
1001 return arguments;
1002}()) == 'Arguments'; // fallback for IE11 Script Access Denied error
1003
1004var tryGet = function (it, key) {
1005 try {
1006 return it[key];
1007 } catch (error) {
1008 /* empty */
1009 }
1010}; // getting tag from ES6+ `Object.prototype.toString`
1011
1012
1013var classof$c = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function (it) {
1014 var O, tag, result;
1015 return it === undefined ? 'Undefined' : it === null ? 'Null' // @@toStringTag case
1016 : typeof (tag = tryGet(O = Object$5(it), TO_STRING_TAG$2)) == 'string' ? tag // builtinTag case
1017 : CORRECT_ARGUMENTS ? classofRaw(O) // ES3 arguments fallback
1018 : (result = classofRaw(O)) == 'Object' && isCallable$9(O.callee) ? 'Arguments' : result;
1019};
1020
1021var uncurryThis$j = functionUncurryThis;
1022var isCallable$8 = isCallable$h;
1023var store$1 = sharedStore;
1024var functionToString = uncurryThis$j(Function.toString); // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
1025
1026if (!isCallable$8(store$1.inspectSource)) {
1027 store$1.inspectSource = function (it) {
1028 return functionToString(it);
1029 };
1030}
1031
1032var inspectSource$2 = store$1.inspectSource;
1033
1034var uncurryThis$i = functionUncurryThis;
1035var fails$i = fails$r;
1036var isCallable$7 = isCallable$h;
1037var classof$b = classof$c;
1038var getBuiltIn$6 = getBuiltIn$9;
1039var inspectSource$1 = inspectSource$2;
1040
1041var noop = function () {
1042 /* empty */
1043};
1044
1045var empty = [];
1046var construct$3 = getBuiltIn$6('Reflect', 'construct');
1047var constructorRegExp = /^\s*(?:class|function)\b/;
1048var exec$2 = uncurryThis$i(constructorRegExp.exec);
1049var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
1050
1051var isConstructorModern = function isConstructor(argument) {
1052 if (!isCallable$7(argument)) return false;
1053
1054 try {
1055 construct$3(noop, empty, argument);
1056 return true;
1057 } catch (error) {
1058 return false;
1059 }
1060};
1061
1062var isConstructorLegacy = function isConstructor(argument) {
1063 if (!isCallable$7(argument)) return false;
1064
1065 switch (classof$b(argument)) {
1066 case 'AsyncFunction':
1067 case 'GeneratorFunction':
1068 case 'AsyncGeneratorFunction':
1069 return false;
1070 }
1071
1072 try {
1073 // we can't check .prototype since constructors produced by .bind haven't it
1074 // `Function#toString` throws on some built-it function in some legacy engines
1075 // (for example, `DOMQuad` and similar in FF41-)
1076 return INCORRECT_TO_STRING || !!exec$2(constructorRegExp, inspectSource$1(argument));
1077 } catch (error) {
1078 return true;
1079 }
1080};
1081
1082isConstructorLegacy.sham = true; // `IsConstructor` abstract operation
1083// https://tc39.es/ecma262/#sec-isconstructor
1084
1085var isConstructor$4 = !construct$3 || fails$i(function () {
1086 var called;
1087 return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () {
1088 called = true;
1089 }) || called;
1090}) ? isConstructorLegacy : isConstructorModern;
1091
1092var global$q = global$M;
1093var isArray$c = isArray$d;
1094var isConstructor$3 = isConstructor$4;
1095var isObject$9 = isObject$f;
1096var wellKnownSymbol$f = wellKnownSymbol$j;
1097var SPECIES$3 = wellKnownSymbol$f('species');
1098var Array$5 = global$q.Array; // a part of `ArraySpeciesCreate` abstract operation
1099// https://tc39.es/ecma262/#sec-arrayspeciescreate
1100
1101var arraySpeciesConstructor$1 = function (originalArray) {
1102 var C;
1103
1104 if (isArray$c(originalArray)) {
1105 C = originalArray.constructor; // cross-realm fallback
1106
1107 if (isConstructor$3(C) && (C === Array$5 || isArray$c(C.prototype))) C = undefined;else if (isObject$9(C)) {
1108 C = C[SPECIES$3];
1109 if (C === null) C = undefined;
1110 }
1111 }
1112
1113 return C === undefined ? Array$5 : C;
1114};
1115
1116var arraySpeciesConstructor = arraySpeciesConstructor$1; // `ArraySpeciesCreate` abstract operation
1117// https://tc39.es/ecma262/#sec-arrayspeciescreate
1118
1119var arraySpeciesCreate$4 = function (originalArray, length) {
1120 return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
1121};
1122
1123var bind$5 = functionBindContext;
1124var uncurryThis$h = functionUncurryThis;
1125var IndexedObject$1 = indexedObject;
1126var toObject$b = toObject$e;
1127var lengthOfArrayLike$b = lengthOfArrayLike$d;
1128var arraySpeciesCreate$3 = arraySpeciesCreate$4;
1129var push$5 = uncurryThis$h([].push); // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
1130
1131var createMethod$4 = function (TYPE) {
1132 var IS_MAP = TYPE == 1;
1133 var IS_FILTER = TYPE == 2;
1134 var IS_SOME = TYPE == 3;
1135 var IS_EVERY = TYPE == 4;
1136 var IS_FIND_INDEX = TYPE == 6;
1137 var IS_FILTER_REJECT = TYPE == 7;
1138 var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
1139 return function ($this, callbackfn, that, specificCreate) {
1140 var O = toObject$b($this);
1141 var self = IndexedObject$1(O);
1142 var boundFunction = bind$5(callbackfn, that);
1143 var length = lengthOfArrayLike$b(self);
1144 var index = 0;
1145 var create = specificCreate || arraySpeciesCreate$3;
1146 var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
1147 var value, result;
1148
1149 for (; length > index; index++) if (NO_HOLES || index in self) {
1150 value = self[index];
1151 result = boundFunction(value, index, O);
1152
1153 if (TYPE) {
1154 if (IS_MAP) target[index] = result; // map
1155 else if (result) switch (TYPE) {
1156 case 3:
1157 return true;
1158 // some
1159
1160 case 5:
1161 return value;
1162 // find
1163
1164 case 6:
1165 return index;
1166 // findIndex
1167
1168 case 2:
1169 push$5(target, value);
1170 // filter
1171 } else switch (TYPE) {
1172 case 4:
1173 return false;
1174 // every
1175
1176 case 7:
1177 push$5(target, value);
1178 // filterReject
1179 }
1180 }
1181 }
1182
1183 return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
1184 };
1185};
1186
1187var arrayIteration = {
1188 // `Array.prototype.forEach` method
1189 // https://tc39.es/ecma262/#sec-array.prototype.foreach
1190 forEach: createMethod$4(0),
1191 // `Array.prototype.map` method
1192 // https://tc39.es/ecma262/#sec-array.prototype.map
1193 map: createMethod$4(1),
1194 // `Array.prototype.filter` method
1195 // https://tc39.es/ecma262/#sec-array.prototype.filter
1196 filter: createMethod$4(2),
1197 // `Array.prototype.some` method
1198 // https://tc39.es/ecma262/#sec-array.prototype.some
1199 some: createMethod$4(3),
1200 // `Array.prototype.every` method
1201 // https://tc39.es/ecma262/#sec-array.prototype.every
1202 every: createMethod$4(4),
1203 // `Array.prototype.find` method
1204 // https://tc39.es/ecma262/#sec-array.prototype.find
1205 find: createMethod$4(5),
1206 // `Array.prototype.findIndex` method
1207 // https://tc39.es/ecma262/#sec-array.prototype.findIndex
1208 findIndex: createMethod$4(6),
1209 // `Array.prototype.filterReject` method
1210 // https://github.com/tc39/proposal-array-filtering
1211 filterReject: createMethod$4(7)
1212};
1213
1214var fails$h = fails$r;
1215var wellKnownSymbol$e = wellKnownSymbol$j;
1216var V8_VERSION$1 = engineV8Version;
1217var SPECIES$2 = wellKnownSymbol$e('species');
1218
1219var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) {
1220 // We can't use this feature detection in V8 since it causes
1221 // deoptimization and serious performance degradation
1222 // https://github.com/zloirock/core-js/issues/677
1223 return V8_VERSION$1 >= 51 || !fails$h(function () {
1224 var array = [];
1225 var constructor = array.constructor = {};
1226
1227 constructor[SPECIES$2] = function () {
1228 return {
1229 foo: 1
1230 };
1231 };
1232
1233 return array[METHOD_NAME](Boolean).foo !== 1;
1234 });
1235};
1236
1237var $$z = _export;
1238var $filter = arrayIteration.filter;
1239var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5;
1240var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$4('filter'); // `Array.prototype.filter` method
1241// https://tc39.es/ecma262/#sec-array.prototype.filter
1242// with adding support of @@species
1243
1244$$z({
1245 target: 'Array',
1246 proto: true,
1247 forced: !HAS_SPECIES_SUPPORT$3
1248}, {
1249 filter: function filter(callbackfn
1250 /* , thisArg */
1251 ) {
1252 return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1253 }
1254});
1255
1256var entryVirtual$h = entryVirtual$k;
1257var filter$3 = entryVirtual$h('Array').filter;
1258
1259var isPrototypeOf$f = objectIsPrototypeOf;
1260var method$c = filter$3;
1261var ArrayPrototype$d = Array.prototype;
1262
1263var filter$2 = function (it) {
1264 var own = it.filter;
1265 return it === ArrayPrototype$d || isPrototypeOf$f(ArrayPrototype$d, it) && own === ArrayPrototype$d.filter ? method$c : own;
1266};
1267
1268var parent$Q = filter$2;
1269var filter$1 = parent$Q;
1270
1271var filter = filter$1;
1272
1273var $$y = _export;
1274var $map = arrayIteration.map;
1275var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5;
1276var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$3('map'); // `Array.prototype.map` method
1277// https://tc39.es/ecma262/#sec-array.prototype.map
1278// with adding support of @@species
1279
1280$$y({
1281 target: 'Array',
1282 proto: true,
1283 forced: !HAS_SPECIES_SUPPORT$2
1284}, {
1285 map: function map(callbackfn
1286 /* , thisArg */
1287 ) {
1288 return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1289 }
1290});
1291
1292var entryVirtual$g = entryVirtual$k;
1293var map$6 = entryVirtual$g('Array').map;
1294
1295var isPrototypeOf$e = objectIsPrototypeOf;
1296var method$b = map$6;
1297var ArrayPrototype$c = Array.prototype;
1298
1299var map$5 = function (it) {
1300 var own = it.map;
1301 return it === ArrayPrototype$c || isPrototypeOf$e(ArrayPrototype$c, it) && own === ArrayPrototype$c.map ? method$b : own;
1302};
1303
1304var parent$P = map$5;
1305var map$4 = parent$P;
1306
1307var map$3 = map$4;
1308
1309var global$p = global$M;
1310var isArray$b = isArray$d;
1311var lengthOfArrayLike$a = lengthOfArrayLike$d;
1312var bind$4 = functionBindContext;
1313var TypeError$c = global$p.TypeError; // `FlattenIntoArray` abstract operation
1314// https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
1315
1316var flattenIntoArray$1 = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
1317 var targetIndex = start;
1318 var sourceIndex = 0;
1319 var mapFn = mapper ? bind$4(mapper, thisArg) : false;
1320 var element, elementLen;
1321
1322 while (sourceIndex < sourceLen) {
1323 if (sourceIndex in source) {
1324 element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
1325
1326 if (depth > 0 && isArray$b(element)) {
1327 elementLen = lengthOfArrayLike$a(element);
1328 targetIndex = flattenIntoArray$1(target, original, element, elementLen, targetIndex, depth - 1) - 1;
1329 } else {
1330 if (targetIndex >= 0x1FFFFFFFFFFFFF) throw TypeError$c('Exceed the acceptable array length');
1331 target[targetIndex] = element;
1332 }
1333
1334 targetIndex++;
1335 }
1336
1337 sourceIndex++;
1338 }
1339
1340 return targetIndex;
1341};
1342
1343var flattenIntoArray_1 = flattenIntoArray$1;
1344
1345var $$x = _export;
1346var flattenIntoArray = flattenIntoArray_1;
1347var aCallable$2 = aCallable$7;
1348var toObject$a = toObject$e;
1349var lengthOfArrayLike$9 = lengthOfArrayLike$d;
1350var arraySpeciesCreate$2 = arraySpeciesCreate$4; // `Array.prototype.flatMap` method
1351// https://tc39.es/ecma262/#sec-array.prototype.flatmap
1352
1353$$x({
1354 target: 'Array',
1355 proto: true
1356}, {
1357 flatMap: function flatMap(callbackfn
1358 /* , thisArg */
1359 ) {
1360 var O = toObject$a(this);
1361 var sourceLen = lengthOfArrayLike$9(O);
1362 var A;
1363 aCallable$2(callbackfn);
1364 A = arraySpeciesCreate$2(O, 0);
1365 A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
1366 return A;
1367 }
1368});
1369
1370var entryVirtual$f = entryVirtual$k;
1371var flatMap$3 = entryVirtual$f('Array').flatMap;
1372
1373var isPrototypeOf$d = objectIsPrototypeOf;
1374var method$a = flatMap$3;
1375var ArrayPrototype$b = Array.prototype;
1376
1377var flatMap$2 = function (it) {
1378 var own = it.flatMap;
1379 return it === ArrayPrototype$b || isPrototypeOf$d(ArrayPrototype$b, it) && own === ArrayPrototype$b.flatMap ? method$a : own;
1380};
1381
1382var parent$O = flatMap$2;
1383var flatMap$1 = parent$O;
1384
1385var flatMap = flatMap$1;
1386
1387/**
1388 * Create new data pipe.
1389 *
1390 * @param from - The source data set or data view.
1391 * @remarks
1392 * Example usage:
1393 * ```typescript
1394 * interface AppItem {
1395 * whoami: string;
1396 * appData: unknown;
1397 * visData: VisItem;
1398 * }
1399 * interface VisItem {
1400 * id: number;
1401 * label: string;
1402 * color: string;
1403 * x: number;
1404 * y: number;
1405 * }
1406 *
1407 * const ds1 = new DataSet<AppItem, "whoami">([], { fieldId: "whoami" });
1408 * const ds2 = new DataSet<VisItem, "id">();
1409 *
1410 * const pipe = createNewDataPipeFrom(ds1)
1411 * .filter((item): boolean => item.enabled === true)
1412 * .map<VisItem, "id">((item): VisItem => item.visData)
1413 * .to(ds2);
1414 *
1415 * pipe.start();
1416 * ```
1417 * @returns A factory whose methods can be used to configure the pipe.
1418 */
1419function createNewDataPipeFrom(from) {
1420 return new DataPipeUnderConstruction(from);
1421}
1422/**
1423 * Internal implementation of the pipe. This should be accessible only through
1424 * `createNewDataPipeFrom` from the outside.
1425 *
1426 * @typeParam SI - Source item type.
1427 * @typeParam SP - Source item type's id property name.
1428 * @typeParam TI - Target item type.
1429 * @typeParam TP - Target item type's id property name.
1430 */
1431
1432var SimpleDataPipe = /*#__PURE__*/function () {
1433 /**
1434 * Bound listeners for use with `DataInterface['on' | 'off']`.
1435 */
1436
1437 /**
1438 * Create a new data pipe.
1439 *
1440 * @param _source - The data set or data view that will be observed.
1441 * @param _transformers - An array of transforming functions to be used to
1442 * filter or transform the items in the pipe.
1443 * @param _target - The data set or data view that will receive the items.
1444 */
1445 function SimpleDataPipe(_source, _transformers, _target) {
1446 var _context, _context2, _context3;
1447
1448 _classCallCheck(this, SimpleDataPipe);
1449
1450 _defineProperty(this, "_source", void 0);
1451
1452 _defineProperty(this, "_transformers", void 0);
1453
1454 _defineProperty(this, "_target", void 0);
1455
1456 _defineProperty(this, "_listeners", {
1457 add: bind$6(_context = this._add).call(_context, this),
1458 remove: bind$6(_context2 = this._remove).call(_context2, this),
1459 update: bind$6(_context3 = this._update).call(_context3, this)
1460 });
1461
1462 this._source = _source;
1463 this._transformers = _transformers;
1464 this._target = _target;
1465 }
1466 /** @inheritDoc */
1467
1468
1469 _createClass(SimpleDataPipe, [{
1470 key: "all",
1471 value: function all() {
1472 this._target.update(this._transformItems(this._source.get()));
1473
1474 return this;
1475 }
1476 /** @inheritDoc */
1477
1478 }, {
1479 key: "start",
1480 value: function start() {
1481 this._source.on("add", this._listeners.add);
1482
1483 this._source.on("remove", this._listeners.remove);
1484
1485 this._source.on("update", this._listeners.update);
1486
1487 return this;
1488 }
1489 /** @inheritDoc */
1490
1491 }, {
1492 key: "stop",
1493 value: function stop() {
1494 this._source.off("add", this._listeners.add);
1495
1496 this._source.off("remove", this._listeners.remove);
1497
1498 this._source.off("update", this._listeners.update);
1499
1500 return this;
1501 }
1502 /**
1503 * Apply the transformers to the items.
1504 *
1505 * @param items - The items to be transformed.
1506 * @returns The transformed items.
1507 */
1508
1509 }, {
1510 key: "_transformItems",
1511 value: function _transformItems(items) {
1512 var _context4;
1513
1514 return reduce(_context4 = this._transformers).call(_context4, function (items, transform) {
1515 return transform(items);
1516 }, items);
1517 }
1518 /**
1519 * Handle an add event.
1520 *
1521 * @param _name - Ignored.
1522 * @param payload - The payload containing the ids of the added items.
1523 */
1524
1525 }, {
1526 key: "_add",
1527 value: function _add(_name, payload) {
1528 if (payload == null) {
1529 return;
1530 }
1531
1532 this._target.add(this._transformItems(this._source.get(payload.items)));
1533 }
1534 /**
1535 * Handle an update event.
1536 *
1537 * @param _name - Ignored.
1538 * @param payload - The payload containing the ids of the updated items.
1539 */
1540
1541 }, {
1542 key: "_update",
1543 value: function _update(_name, payload) {
1544 if (payload == null) {
1545 return;
1546 }
1547
1548 this._target.update(this._transformItems(this._source.get(payload.items)));
1549 }
1550 /**
1551 * Handle a remove event.
1552 *
1553 * @param _name - Ignored.
1554 * @param payload - The payload containing the data of the removed items.
1555 */
1556
1557 }, {
1558 key: "_remove",
1559 value: function _remove(_name, payload) {
1560 if (payload == null) {
1561 return;
1562 }
1563
1564 this._target.remove(this._transformItems(payload.oldData));
1565 }
1566 }]);
1567
1568 return SimpleDataPipe;
1569}();
1570/**
1571 * Internal implementation of the pipe factory. This should be accessible
1572 * only through `createNewDataPipeFrom` from the outside.
1573 *
1574 * @typeParam TI - Target item type.
1575 * @typeParam TP - Target item type's id property name.
1576 */
1577
1578
1579var DataPipeUnderConstruction = /*#__PURE__*/function () {
1580 /**
1581 * Array transformers used to transform items within the pipe. This is typed
1582 * as any for the sake of simplicity.
1583 */
1584
1585 /**
1586 * Create a new data pipe factory. This is an internal constructor that
1587 * should never be called from outside of this file.
1588 *
1589 * @param _source - The source data set or data view for this pipe.
1590 */
1591 function DataPipeUnderConstruction(_source) {
1592 _classCallCheck(this, DataPipeUnderConstruction);
1593
1594 _defineProperty(this, "_source", void 0);
1595
1596 _defineProperty(this, "_transformers", []);
1597
1598 this._source = _source;
1599 }
1600 /**
1601 * Filter the items.
1602 *
1603 * @param callback - A filtering function that returns true if given item
1604 * should be piped and false if not.
1605 * @returns This factory for further configuration.
1606 */
1607
1608
1609 _createClass(DataPipeUnderConstruction, [{
1610 key: "filter",
1611 value: function filter$1(callback) {
1612 this._transformers.push(function (input) {
1613 return filter(input).call(input, callback);
1614 });
1615
1616 return this;
1617 }
1618 /**
1619 * Map each source item to a new type.
1620 *
1621 * @param callback - A mapping function that takes a source item and returns
1622 * corresponding mapped item.
1623 * @typeParam TI - Target item type.
1624 * @typeParam TP - Target item type's id property name.
1625 * @returns This factory for further configuration.
1626 */
1627
1628 }, {
1629 key: "map",
1630 value: function map(callback) {
1631 this._transformers.push(function (input) {
1632 return map$3(input).call(input, callback);
1633 });
1634
1635 return this;
1636 }
1637 /**
1638 * Map each source item to zero or more items of a new type.
1639 *
1640 * @param callback - A mapping function that takes a source item and returns
1641 * an array of corresponding mapped items.
1642 * @typeParam TI - Target item type.
1643 * @typeParam TP - Target item type's id property name.
1644 * @returns This factory for further configuration.
1645 */
1646
1647 }, {
1648 key: "flatMap",
1649 value: function flatMap$1(callback) {
1650 this._transformers.push(function (input) {
1651 return flatMap(input).call(input, callback);
1652 });
1653
1654 return this;
1655 }
1656 /**
1657 * Connect this pipe to given data set.
1658 *
1659 * @param target - The data set that will receive the items from this pipe.
1660 * @returns The pipe connected between given data sets and performing
1661 * configured transformation on the processed items.
1662 */
1663
1664 }, {
1665 key: "to",
1666 value: function to(target) {
1667 return new SimpleDataPipe(this._source, this._transformers, target);
1668 }
1669 }]);
1670
1671 return DataPipeUnderConstruction;
1672}();
1673
1674var global$o = global$M;
1675var classof$a = classof$c;
1676var String$2 = global$o.String;
1677
1678var toString$7 = function (argument) {
1679 if (classof$a(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1680 return String$2(argument);
1681};
1682
1683var uncurryThis$g = functionUncurryThis;
1684var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
1685var toString$6 = toString$7;
1686var requireObjectCoercible$2 = requireObjectCoercible$5;
1687var charAt$2 = uncurryThis$g(''.charAt);
1688var charCodeAt$1 = uncurryThis$g(''.charCodeAt);
1689var stringSlice = uncurryThis$g(''.slice);
1690
1691var createMethod$3 = function (CONVERT_TO_STRING) {
1692 return function ($this, pos) {
1693 var S = toString$6(requireObjectCoercible$2($this));
1694 var position = toIntegerOrInfinity$2(pos);
1695 var size = S.length;
1696 var first, second;
1697 if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
1698 first = charCodeAt$1(S, position);
1699 return first < 0xD800 || first > 0xDBFF || position + 1 === size || (second = charCodeAt$1(S, position + 1)) < 0xDC00 || second > 0xDFFF ? CONVERT_TO_STRING ? charAt$2(S, position) : first : CONVERT_TO_STRING ? stringSlice(S, position, position + 2) : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
1700 };
1701};
1702
1703var stringMultibyte = {
1704 // `String.prototype.codePointAt` method
1705 // https://tc39.es/ecma262/#sec-string.prototype.codepointat
1706 codeAt: createMethod$3(false),
1707 // `String.prototype.at` method
1708 // https://github.com/mathiasbynens/String.prototype.at
1709 charAt: createMethod$3(true)
1710};
1711
1712var global$n = global$M;
1713var isCallable$6 = isCallable$h;
1714var inspectSource = inspectSource$2;
1715var WeakMap$1 = global$n.WeakMap;
1716var nativeWeakMap = isCallable$6(WeakMap$1) && /native code/.test(inspectSource(WeakMap$1));
1717
1718var shared$2 = shared$4.exports;
1719var uid$2 = uid$4;
1720var keys$7 = shared$2('keys');
1721
1722var sharedKey$4 = function (key) {
1723 return keys$7[key] || (keys$7[key] = uid$2(key));
1724};
1725
1726var hiddenKeys$6 = {};
1727
1728var NATIVE_WEAK_MAP = nativeWeakMap;
1729var global$m = global$M;
1730var uncurryThis$f = functionUncurryThis;
1731var isObject$8 = isObject$f;
1732var createNonEnumerableProperty$4 = createNonEnumerableProperty$6;
1733var hasOwn$b = hasOwnProperty_1;
1734var shared$1 = sharedStore;
1735var sharedKey$3 = sharedKey$4;
1736var hiddenKeys$5 = hiddenKeys$6;
1737var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
1738var TypeError$b = global$m.TypeError;
1739var WeakMap = global$m.WeakMap;
1740var set$3, get, has;
1741
1742var enforce = function (it) {
1743 return has(it) ? get(it) : set$3(it, {});
1744};
1745
1746var getterFor = function (TYPE) {
1747 return function (it) {
1748 var state;
1749
1750 if (!isObject$8(it) || (state = get(it)).type !== TYPE) {
1751 throw TypeError$b('Incompatible receiver, ' + TYPE + ' required');
1752 }
1753
1754 return state;
1755 };
1756};
1757
1758if (NATIVE_WEAK_MAP || shared$1.state) {
1759 var store = shared$1.state || (shared$1.state = new WeakMap());
1760 var wmget = uncurryThis$f(store.get);
1761 var wmhas = uncurryThis$f(store.has);
1762 var wmset = uncurryThis$f(store.set);
1763
1764 set$3 = function (it, metadata) {
1765 if (wmhas(store, it)) throw new TypeError$b(OBJECT_ALREADY_INITIALIZED);
1766 metadata.facade = it;
1767 wmset(store, it, metadata);
1768 return metadata;
1769 };
1770
1771 get = function (it) {
1772 return wmget(store, it) || {};
1773 };
1774
1775 has = function (it) {
1776 return wmhas(store, it);
1777 };
1778} else {
1779 var STATE = sharedKey$3('state');
1780 hiddenKeys$5[STATE] = true;
1781
1782 set$3 = function (it, metadata) {
1783 if (hasOwn$b(it, STATE)) throw new TypeError$b(OBJECT_ALREADY_INITIALIZED);
1784 metadata.facade = it;
1785 createNonEnumerableProperty$4(it, STATE, metadata);
1786 return metadata;
1787 };
1788
1789 get = function (it) {
1790 return hasOwn$b(it, STATE) ? it[STATE] : {};
1791 };
1792
1793 has = function (it) {
1794 return hasOwn$b(it, STATE);
1795 };
1796}
1797
1798var internalState = {
1799 set: set$3,
1800 get: get,
1801 has: has,
1802 enforce: enforce,
1803 getterFor: getterFor
1804};
1805
1806var DESCRIPTORS$b = descriptors;
1807var hasOwn$a = hasOwnProperty_1;
1808var FunctionPrototype = Function.prototype; // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1809
1810var getDescriptor = DESCRIPTORS$b && Object.getOwnPropertyDescriptor;
1811var EXISTS = hasOwn$a(FunctionPrototype, 'name'); // additional protection from minified / mangled / dropped function names
1812
1813var PROPER = EXISTS && function something() {
1814 /* empty */
1815}.name === 'something';
1816
1817var CONFIGURABLE = EXISTS && (!DESCRIPTORS$b || DESCRIPTORS$b && getDescriptor(FunctionPrototype, 'name').configurable);
1818var functionName = {
1819 EXISTS: EXISTS,
1820 PROPER: PROPER,
1821 CONFIGURABLE: CONFIGURABLE
1822};
1823
1824var objectDefineProperties = {};
1825
1826var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
1827var max$3 = Math.max;
1828var min$1 = Math.min; // Helper for a popular repeating case of the spec:
1829// Let integer be ? ToInteger(index).
1830// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
1831
1832var toAbsoluteIndex$5 = function (index, length) {
1833 var integer = toIntegerOrInfinity$1(index);
1834 return integer < 0 ? max$3(integer + length, 0) : min$1(integer, length);
1835};
1836
1837var toIndexedObject$9 = toIndexedObject$b;
1838var toAbsoluteIndex$4 = toAbsoluteIndex$5;
1839var lengthOfArrayLike$8 = lengthOfArrayLike$d; // `Array.prototype.{ indexOf, includes }` methods implementation
1840
1841var createMethod$2 = function (IS_INCLUDES) {
1842 return function ($this, el, fromIndex) {
1843 var O = toIndexedObject$9($this);
1844 var length = lengthOfArrayLike$8(O);
1845 var index = toAbsoluteIndex$4(fromIndex, length);
1846 var value; // Array#includes uses SameValueZero equality algorithm
1847 // eslint-disable-next-line no-self-compare -- NaN check
1848
1849 if (IS_INCLUDES && el != el) while (length > index) {
1850 value = O[index++]; // eslint-disable-next-line no-self-compare -- NaN check
1851
1852 if (value != value) return true; // Array#indexOf ignores holes, Array#includes - not
1853 } else for (; length > index; index++) {
1854 if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
1855 }
1856 return !IS_INCLUDES && -1;
1857 };
1858};
1859
1860var arrayIncludes = {
1861 // `Array.prototype.includes` method
1862 // https://tc39.es/ecma262/#sec-array.prototype.includes
1863 includes: createMethod$2(true),
1864 // `Array.prototype.indexOf` method
1865 // https://tc39.es/ecma262/#sec-array.prototype.indexof
1866 indexOf: createMethod$2(false)
1867};
1868
1869var uncurryThis$e = functionUncurryThis;
1870var hasOwn$9 = hasOwnProperty_1;
1871var toIndexedObject$8 = toIndexedObject$b;
1872var indexOf = arrayIncludes.indexOf;
1873var hiddenKeys$4 = hiddenKeys$6;
1874var push$4 = uncurryThis$e([].push);
1875
1876var objectKeysInternal = function (object, names) {
1877 var O = toIndexedObject$8(object);
1878 var i = 0;
1879 var result = [];
1880 var key;
1881
1882 for (key in O) !hasOwn$9(hiddenKeys$4, key) && hasOwn$9(O, key) && push$4(result, key); // Don't enum bug & hidden keys
1883
1884
1885 while (names.length > i) if (hasOwn$9(O, key = names[i++])) {
1886 ~indexOf(result, key) || push$4(result, key);
1887 }
1888
1889 return result;
1890};
1891
1892var enumBugKeys$3 = ['constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf'];
1893
1894var internalObjectKeys$1 = objectKeysInternal;
1895var enumBugKeys$2 = enumBugKeys$3; // `Object.keys` method
1896// https://tc39.es/ecma262/#sec-object.keys
1897// eslint-disable-next-line es/no-object-keys -- safe
1898
1899var objectKeys$4 = Object.keys || function keys(O) {
1900 return internalObjectKeys$1(O, enumBugKeys$2);
1901};
1902
1903var DESCRIPTORS$a = descriptors;
1904var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1905var definePropertyModule$3 = objectDefineProperty;
1906var anObject$9 = anObject$b;
1907var toIndexedObject$7 = toIndexedObject$b;
1908var objectKeys$3 = objectKeys$4; // `Object.defineProperties` method
1909// https://tc39.es/ecma262/#sec-object.defineproperties
1910// eslint-disable-next-line es/no-object-defineproperties -- safe
1911
1912objectDefineProperties.f = DESCRIPTORS$a && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1913 anObject$9(O);
1914 var props = toIndexedObject$7(Properties);
1915 var keys = objectKeys$3(Properties);
1916 var length = keys.length;
1917 var index = 0;
1918 var key;
1919
1920 while (length > index) definePropertyModule$3.f(O, key = keys[index++], props[key]);
1921
1922 return O;
1923};
1924
1925var getBuiltIn$5 = getBuiltIn$9;
1926var html$1 = getBuiltIn$5('document', 'documentElement');
1927
1928/* global ActiveXObject -- old IE, WSH */
1929var anObject$8 = anObject$b;
1930var definePropertiesModule$1 = objectDefineProperties;
1931var enumBugKeys$1 = enumBugKeys$3;
1932var hiddenKeys$3 = hiddenKeys$6;
1933var html = html$1;
1934var documentCreateElement = documentCreateElement$1;
1935var sharedKey$2 = sharedKey$4;
1936var GT = '>';
1937var LT = '<';
1938var PROTOTYPE$1 = 'prototype';
1939var SCRIPT = 'script';
1940var IE_PROTO$1 = sharedKey$2('IE_PROTO');
1941
1942var EmptyConstructor = function () {
1943 /* empty */
1944};
1945
1946var scriptTag = function (content) {
1947 return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1948}; // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1949
1950
1951var NullProtoObjectViaActiveX = function (activeXDocument) {
1952 activeXDocument.write(scriptTag(''));
1953 activeXDocument.close();
1954 var temp = activeXDocument.parentWindow.Object;
1955 activeXDocument = null; // avoid memory leak
1956
1957 return temp;
1958}; // Create object with fake `null` prototype: use iframe Object with cleared prototype
1959
1960
1961var NullProtoObjectViaIFrame = function () {
1962 // Thrash, waste and sodomy: IE GC bug
1963 var iframe = documentCreateElement('iframe');
1964 var JS = 'java' + SCRIPT + ':';
1965 var iframeDocument;
1966 iframe.style.display = 'none';
1967 html.appendChild(iframe); // https://github.com/zloirock/core-js/issues/475
1968
1969 iframe.src = String(JS);
1970 iframeDocument = iframe.contentWindow.document;
1971 iframeDocument.open();
1972 iframeDocument.write(scriptTag('document.F=Object'));
1973 iframeDocument.close();
1974 return iframeDocument.F;
1975}; // Check for document.domain and active x support
1976// No need to use active x approach when document.domain is not set
1977// see https://github.com/es-shims/es5-shim/issues/150
1978// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1979// avoid IE GC bug
1980
1981
1982var activeXDocument;
1983
1984var NullProtoObject = function () {
1985 try {
1986 activeXDocument = new ActiveXObject('htmlfile');
1987 } catch (error) {
1988 /* ignore */
1989 }
1990
1991 NullProtoObject = typeof document != 'undefined' ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1992 : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument); // WSH
1993
1994 var length = enumBugKeys$1.length;
1995
1996 while (length--) delete NullProtoObject[PROTOTYPE$1][enumBugKeys$1[length]];
1997
1998 return NullProtoObject();
1999};
2000
2001hiddenKeys$3[IE_PROTO$1] = true; // `Object.create` method
2002// https://tc39.es/ecma262/#sec-object.create
2003
2004var objectCreate = Object.create || function create(O, Properties) {
2005 var result;
2006
2007 if (O !== null) {
2008 EmptyConstructor[PROTOTYPE$1] = anObject$8(O);
2009 result = new EmptyConstructor();
2010 EmptyConstructor[PROTOTYPE$1] = null; // add "__proto__" for Object.getPrototypeOf polyfill
2011
2012 result[IE_PROTO$1] = O;
2013 } else result = NullProtoObject();
2014
2015 return Properties === undefined ? result : definePropertiesModule$1.f(result, Properties);
2016};
2017
2018var fails$g = fails$r;
2019var correctPrototypeGetter = !fails$g(function () {
2020 function F() {
2021 /* empty */
2022 }
2023
2024 F.prototype.constructor = null; // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
2025
2026 return Object.getPrototypeOf(new F()) !== F.prototype;
2027});
2028
2029var global$l = global$M;
2030var hasOwn$8 = hasOwnProperty_1;
2031var isCallable$5 = isCallable$h;
2032var toObject$9 = toObject$e;
2033var sharedKey$1 = sharedKey$4;
2034var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter;
2035var IE_PROTO = sharedKey$1('IE_PROTO');
2036var Object$4 = global$l.Object;
2037var ObjectPrototype$2 = Object$4.prototype; // `Object.getPrototypeOf` method
2038// https://tc39.es/ecma262/#sec-object.getprototypeof
2039
2040var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER$1 ? Object$4.getPrototypeOf : function (O) {
2041 var object = toObject$9(O);
2042 if (hasOwn$8(object, IE_PROTO)) return object[IE_PROTO];
2043 var constructor = object.constructor;
2044
2045 if (isCallable$5(constructor) && object instanceof constructor) {
2046 return constructor.prototype;
2047 }
2048
2049 return object instanceof Object$4 ? ObjectPrototype$2 : null;
2050};
2051
2052var createNonEnumerableProperty$3 = createNonEnumerableProperty$6;
2053
2054var redefine$4 = function (target, key, value, options) {
2055 if (options && options.enumerable) target[key] = value;else createNonEnumerableProperty$3(target, key, value);
2056};
2057
2058var fails$f = fails$r;
2059var isCallable$4 = isCallable$h;
2060var create$a = objectCreate;
2061var getPrototypeOf$6 = objectGetPrototypeOf;
2062var redefine$3 = redefine$4;
2063var wellKnownSymbol$d = wellKnownSymbol$j;
2064var ITERATOR$5 = wellKnownSymbol$d('iterator');
2065var BUGGY_SAFARI_ITERATORS$1 = false; // `%IteratorPrototype%` object
2066// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
2067
2068var IteratorPrototype$1, PrototypeOfArrayIteratorPrototype, arrayIterator;
2069/* eslint-disable es/no-array-prototype-keys -- safe */
2070
2071if ([].keys) {
2072 arrayIterator = [].keys(); // Safari 8 has buggy iterators w/o `next`
2073
2074 if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;else {
2075 PrototypeOfArrayIteratorPrototype = getPrototypeOf$6(getPrototypeOf$6(arrayIterator));
2076 if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$1 = PrototypeOfArrayIteratorPrototype;
2077 }
2078}
2079
2080var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$1 == undefined || fails$f(function () {
2081 var test = {}; // FF44- legacy iterators case
2082
2083 return IteratorPrototype$1[ITERATOR$5].call(test) !== test;
2084});
2085if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$1 = {};else IteratorPrototype$1 = create$a(IteratorPrototype$1); // `%IteratorPrototype%[@@iterator]()` method
2086// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
2087
2088if (!isCallable$4(IteratorPrototype$1[ITERATOR$5])) {
2089 redefine$3(IteratorPrototype$1, ITERATOR$5, function () {
2090 return this;
2091 });
2092}
2093
2094var iteratorsCore = {
2095 IteratorPrototype: IteratorPrototype$1,
2096 BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
2097};
2098
2099var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
2100var classof$9 = classof$c; // `Object.prototype.toString` method implementation
2101// https://tc39.es/ecma262/#sec-object.prototype.tostring
2102
2103var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() {
2104 return '[object ' + classof$9(this) + ']';
2105};
2106
2107var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2108var defineProperty$6 = objectDefineProperty.f;
2109var createNonEnumerableProperty$2 = createNonEnumerableProperty$6;
2110var hasOwn$7 = hasOwnProperty_1;
2111var toString$5 = objectToString;
2112var wellKnownSymbol$c = wellKnownSymbol$j;
2113var TO_STRING_TAG$1 = wellKnownSymbol$c('toStringTag');
2114
2115var setToStringTag$5 = function (it, TAG, STATIC, SET_METHOD) {
2116 if (it) {
2117 var target = STATIC ? it : it.prototype;
2118
2119 if (!hasOwn$7(target, TO_STRING_TAG$1)) {
2120 defineProperty$6(target, TO_STRING_TAG$1, {
2121 configurable: true,
2122 value: TAG
2123 });
2124 }
2125
2126 if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
2127 createNonEnumerableProperty$2(target, 'toString', toString$5);
2128 }
2129 }
2130};
2131
2132var iterators = {};
2133
2134var IteratorPrototype = iteratorsCore.IteratorPrototype;
2135var create$9 = objectCreate;
2136var createPropertyDescriptor$2 = createPropertyDescriptor$5;
2137var setToStringTag$4 = setToStringTag$5;
2138var Iterators$5 = iterators;
2139
2140var returnThis$1 = function () {
2141 return this;
2142};
2143
2144var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
2145 var TO_STRING_TAG = NAME + ' Iterator';
2146 IteratorConstructor.prototype = create$9(IteratorPrototype, {
2147 next: createPropertyDescriptor$2(+!ENUMERABLE_NEXT, next)
2148 });
2149 setToStringTag$4(IteratorConstructor, TO_STRING_TAG, false, true);
2150 Iterators$5[TO_STRING_TAG] = returnThis$1;
2151 return IteratorConstructor;
2152};
2153
2154var global$k = global$M;
2155var isCallable$3 = isCallable$h;
2156var String$1 = global$k.String;
2157var TypeError$a = global$k.TypeError;
2158
2159var aPossiblePrototype$1 = function (argument) {
2160 if (typeof argument == 'object' || isCallable$3(argument)) return argument;
2161 throw TypeError$a("Can't set " + String$1(argument) + ' as a prototype');
2162};
2163
2164/* eslint-disable no-proto -- safe */
2165var uncurryThis$d = functionUncurryThis;
2166var anObject$7 = anObject$b;
2167var aPossiblePrototype = aPossiblePrototype$1; // `Object.setPrototypeOf` method
2168// https://tc39.es/ecma262/#sec-object.setprototypeof
2169// Works with __proto__ only. Old v8 can't work with null proto objects.
2170// eslint-disable-next-line es/no-object-setprototypeof -- safe
2171
2172var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
2173 var CORRECT_SETTER = false;
2174 var test = {};
2175 var setter;
2176
2177 try {
2178 // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2179 setter = uncurryThis$d(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
2180 setter(test, []);
2181 CORRECT_SETTER = test instanceof Array;
2182 } catch (error) {
2183 /* empty */
2184 }
2185
2186 return function setPrototypeOf(O, proto) {
2187 anObject$7(O);
2188 aPossiblePrototype(proto);
2189 if (CORRECT_SETTER) setter(O, proto);else O.__proto__ = proto;
2190 return O;
2191 };
2192}() : undefined);
2193
2194var $$w = _export;
2195var call$6 = functionCall;
2196var FunctionName = functionName;
2197var createIteratorConstructor = createIteratorConstructor$1;
2198var getPrototypeOf$5 = objectGetPrototypeOf;
2199var setToStringTag$3 = setToStringTag$5;
2200var redefine$2 = redefine$4;
2201var wellKnownSymbol$b = wellKnownSymbol$j;
2202var Iterators$4 = iterators;
2203var IteratorsCore = iteratorsCore;
2204var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
2205var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
2206var ITERATOR$4 = wellKnownSymbol$b('iterator');
2207var KEYS = 'keys';
2208var VALUES = 'values';
2209var ENTRIES = 'entries';
2210
2211var returnThis = function () {
2212 return this;
2213};
2214
2215var defineIterator$3 = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
2216 createIteratorConstructor(IteratorConstructor, NAME, next);
2217
2218 var getIterationMethod = function (KIND) {
2219 if (KIND === DEFAULT && defaultIterator) return defaultIterator;
2220 if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
2221
2222 switch (KIND) {
2223 case KEYS:
2224 return function keys() {
2225 return new IteratorConstructor(this, KIND);
2226 };
2227
2228 case VALUES:
2229 return function values() {
2230 return new IteratorConstructor(this, KIND);
2231 };
2232
2233 case ENTRIES:
2234 return function entries() {
2235 return new IteratorConstructor(this, KIND);
2236 };
2237 }
2238
2239 return function () {
2240 return new IteratorConstructor(this);
2241 };
2242 };
2243
2244 var TO_STRING_TAG = NAME + ' Iterator';
2245 var INCORRECT_VALUES_NAME = false;
2246 var IterablePrototype = Iterable.prototype;
2247 var nativeIterator = IterablePrototype[ITERATOR$4] || IterablePrototype['@@iterator'] || DEFAULT && IterablePrototype[DEFAULT];
2248 var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
2249 var anyNativeIterator = NAME == 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
2250 var CurrentIteratorPrototype, methods, KEY; // fix native
2251
2252 if (anyNativeIterator) {
2253 CurrentIteratorPrototype = getPrototypeOf$5(anyNativeIterator.call(new Iterable()));
2254
2255 if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
2256
2257
2258 setToStringTag$3(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
2259 Iterators$4[TO_STRING_TAG] = returnThis;
2260 }
2261 } // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
2262
2263
2264 if (PROPER_FUNCTION_NAME$1 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
2265 {
2266 INCORRECT_VALUES_NAME = true;
2267
2268 defaultIterator = function values() {
2269 return call$6(nativeIterator, this);
2270 };
2271 }
2272 } // export additional methods
2273
2274
2275 if (DEFAULT) {
2276 methods = {
2277 values: getIterationMethod(VALUES),
2278 keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
2279 entries: getIterationMethod(ENTRIES)
2280 };
2281 if (FORCED) for (KEY in methods) {
2282 if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
2283 redefine$2(IterablePrototype, KEY, methods[KEY]);
2284 }
2285 } else $$w({
2286 target: NAME,
2287 proto: true,
2288 forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME
2289 }, methods);
2290 } // define iterator
2291
2292
2293 if ((FORCED) && IterablePrototype[ITERATOR$4] !== defaultIterator) {
2294 redefine$2(IterablePrototype, ITERATOR$4, defaultIterator, {
2295 name: DEFAULT
2296 });
2297 }
2298
2299 Iterators$4[NAME] = defaultIterator;
2300 return methods;
2301};
2302
2303var charAt$1 = stringMultibyte.charAt;
2304var toString$4 = toString$7;
2305var InternalStateModule$4 = internalState;
2306var defineIterator$2 = defineIterator$3;
2307var STRING_ITERATOR = 'String Iterator';
2308var setInternalState$4 = InternalStateModule$4.set;
2309var getInternalState$2 = InternalStateModule$4.getterFor(STRING_ITERATOR); // `String.prototype[@@iterator]` method
2310// https://tc39.es/ecma262/#sec-string.prototype-@@iterator
2311
2312defineIterator$2(String, 'String', function (iterated) {
2313 setInternalState$4(this, {
2314 type: STRING_ITERATOR,
2315 string: toString$4(iterated),
2316 index: 0
2317 }); // `%StringIteratorPrototype%.next` method
2318 // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
2319}, function next() {
2320 var state = getInternalState$2(this);
2321 var string = state.string;
2322 var index = state.index;
2323 var point;
2324 if (index >= string.length) return {
2325 value: undefined,
2326 done: true
2327 };
2328 point = charAt$1(string, index);
2329 state.index += point.length;
2330 return {
2331 value: point,
2332 done: false
2333 };
2334});
2335
2336var call$5 = functionCall;
2337var anObject$6 = anObject$b;
2338var getMethod$1 = getMethod$3;
2339
2340var iteratorClose$2 = function (iterator, kind, value) {
2341 var innerResult, innerError;
2342 anObject$6(iterator);
2343
2344 try {
2345 innerResult = getMethod$1(iterator, 'return');
2346
2347 if (!innerResult) {
2348 if (kind === 'throw') throw value;
2349 return value;
2350 }
2351
2352 innerResult = call$5(innerResult, iterator);
2353 } catch (error) {
2354 innerError = true;
2355 innerResult = error;
2356 }
2357
2358 if (kind === 'throw') throw value;
2359 if (innerError) throw innerResult;
2360 anObject$6(innerResult);
2361 return value;
2362};
2363
2364var anObject$5 = anObject$b;
2365var iteratorClose$1 = iteratorClose$2; // call something on iterator step with safe closing on error
2366
2367var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) {
2368 try {
2369 return ENTRIES ? fn(anObject$5(value)[0], value[1]) : fn(value);
2370 } catch (error) {
2371 iteratorClose$1(iterator, 'throw', error);
2372 }
2373};
2374
2375var wellKnownSymbol$a = wellKnownSymbol$j;
2376var Iterators$3 = iterators;
2377var ITERATOR$3 = wellKnownSymbol$a('iterator');
2378var ArrayPrototype$a = Array.prototype; // check on default Array iterator
2379
2380var isArrayIteratorMethod$2 = function (it) {
2381 return it !== undefined && (Iterators$3.Array === it || ArrayPrototype$a[ITERATOR$3] === it);
2382};
2383
2384var toPropertyKey$1 = toPropertyKey$4;
2385var definePropertyModule$2 = objectDefineProperty;
2386var createPropertyDescriptor$1 = createPropertyDescriptor$5;
2387
2388var createProperty$6 = function (object, key, value) {
2389 var propertyKey = toPropertyKey$1(key);
2390 if (propertyKey in object) definePropertyModule$2.f(object, propertyKey, createPropertyDescriptor$1(0, value));else object[propertyKey] = value;
2391};
2392
2393var classof$8 = classof$c;
2394var getMethod = getMethod$3;
2395var Iterators$2 = iterators;
2396var wellKnownSymbol$9 = wellKnownSymbol$j;
2397var ITERATOR$2 = wellKnownSymbol$9('iterator');
2398
2399var getIteratorMethod$8 = function (it) {
2400 if (it != undefined) return getMethod(it, ITERATOR$2) || getMethod(it, '@@iterator') || Iterators$2[classof$8(it)];
2401};
2402
2403var global$j = global$M;
2404var call$4 = functionCall;
2405var aCallable$1 = aCallable$7;
2406var anObject$4 = anObject$b;
2407var tryToString$2 = tryToString$4;
2408var getIteratorMethod$7 = getIteratorMethod$8;
2409var TypeError$9 = global$j.TypeError;
2410
2411var getIterator$7 = function (argument, usingIterator) {
2412 var iteratorMethod = arguments.length < 2 ? getIteratorMethod$7(argument) : usingIterator;
2413 if (aCallable$1(iteratorMethod)) return anObject$4(call$4(iteratorMethod, argument));
2414 throw TypeError$9(tryToString$2(argument) + ' is not iterable');
2415};
2416
2417var global$i = global$M;
2418var bind$3 = functionBindContext;
2419var call$3 = functionCall;
2420var toObject$8 = toObject$e;
2421var callWithSafeIterationClosing = callWithSafeIterationClosing$1;
2422var isArrayIteratorMethod$1 = isArrayIteratorMethod$2;
2423var isConstructor$2 = isConstructor$4;
2424var lengthOfArrayLike$7 = lengthOfArrayLike$d;
2425var createProperty$5 = createProperty$6;
2426var getIterator$6 = getIterator$7;
2427var getIteratorMethod$6 = getIteratorMethod$8;
2428var Array$4 = global$i.Array; // `Array.from` method implementation
2429// https://tc39.es/ecma262/#sec-array.from
2430
2431var arrayFrom = function from(arrayLike
2432/* , mapfn = undefined, thisArg = undefined */
2433) {
2434 var O = toObject$8(arrayLike);
2435 var IS_CONSTRUCTOR = isConstructor$2(this);
2436 var argumentsLength = arguments.length;
2437 var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
2438 var mapping = mapfn !== undefined;
2439 if (mapping) mapfn = bind$3(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
2440 var iteratorMethod = getIteratorMethod$6(O);
2441 var index = 0;
2442 var length, result, step, iterator, next, value; // if the target is not iterable or it's an array with the default iterator - use a simple case
2443
2444 if (iteratorMethod && !(this == Array$4 && isArrayIteratorMethod$1(iteratorMethod))) {
2445 iterator = getIterator$6(O, iteratorMethod);
2446 next = iterator.next;
2447 result = IS_CONSTRUCTOR ? new this() : [];
2448
2449 for (; !(step = call$3(next, iterator)).done; index++) {
2450 value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
2451 createProperty$5(result, index, value);
2452 }
2453 } else {
2454 length = lengthOfArrayLike$7(O);
2455 result = IS_CONSTRUCTOR ? new this(length) : Array$4(length);
2456
2457 for (; length > index; index++) {
2458 value = mapping ? mapfn(O[index], index) : O[index];
2459 createProperty$5(result, index, value);
2460 }
2461 }
2462
2463 result.length = index;
2464 return result;
2465};
2466
2467var wellKnownSymbol$8 = wellKnownSymbol$j;
2468var ITERATOR$1 = wellKnownSymbol$8('iterator');
2469var SAFE_CLOSING = false;
2470
2471try {
2472 var called = 0;
2473 var iteratorWithReturn = {
2474 next: function () {
2475 return {
2476 done: !!called++
2477 };
2478 },
2479 'return': function () {
2480 SAFE_CLOSING = true;
2481 }
2482 };
2483
2484 iteratorWithReturn[ITERATOR$1] = function () {
2485 return this;
2486 }; // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
2487
2488
2489 Array.from(iteratorWithReturn, function () {
2490 throw 2;
2491 });
2492} catch (error) {
2493 /* empty */
2494}
2495
2496var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
2497 if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2498 var ITERATION_SUPPORT = false;
2499
2500 try {
2501 var object = {};
2502
2503 object[ITERATOR$1] = function () {
2504 return {
2505 next: function () {
2506 return {
2507 done: ITERATION_SUPPORT = true
2508 };
2509 }
2510 };
2511 };
2512
2513 exec(object);
2514 } catch (error) {
2515 /* empty */
2516 }
2517
2518 return ITERATION_SUPPORT;
2519};
2520
2521var $$v = _export;
2522var from$6 = arrayFrom;
2523var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
2524var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
2525 // eslint-disable-next-line es/no-array-from -- required for testing
2526 Array.from(iterable);
2527}); // `Array.from` method
2528// https://tc39.es/ecma262/#sec-array.from
2529
2530$$v({
2531 target: 'Array',
2532 stat: true,
2533 forced: INCORRECT_ITERATION
2534}, {
2535 from: from$6
2536});
2537
2538var path$l = path$q;
2539var from$5 = path$l.Array.from;
2540
2541var parent$N = from$5;
2542var from$4 = parent$N;
2543
2544var from$3 = from$4;
2545
2546var toIndexedObject$6 = toIndexedObject$b;
2547var Iterators$1 = iterators;
2548var InternalStateModule$3 = internalState;
2549objectDefineProperty.f;
2550var defineIterator$1 = defineIterator$3;
2551var ARRAY_ITERATOR = 'Array Iterator';
2552var setInternalState$3 = InternalStateModule$3.set;
2553var getInternalState$1 = InternalStateModule$3.getterFor(ARRAY_ITERATOR); // `Array.prototype.entries` method
2554// https://tc39.es/ecma262/#sec-array.prototype.entries
2555// `Array.prototype.keys` method
2556// https://tc39.es/ecma262/#sec-array.prototype.keys
2557// `Array.prototype.values` method
2558// https://tc39.es/ecma262/#sec-array.prototype.values
2559// `Array.prototype[@@iterator]` method
2560// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
2561// `CreateArrayIterator` internal method
2562// https://tc39.es/ecma262/#sec-createarrayiterator
2563
2564defineIterator$1(Array, 'Array', function (iterated, kind) {
2565 setInternalState$3(this, {
2566 type: ARRAY_ITERATOR,
2567 target: toIndexedObject$6(iterated),
2568 // target
2569 index: 0,
2570 // next index
2571 kind: kind // kind
2572
2573 }); // `%ArrayIteratorPrototype%.next` method
2574 // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
2575}, function () {
2576 var state = getInternalState$1(this);
2577 var target = state.target;
2578 var kind = state.kind;
2579 var index = state.index++;
2580
2581 if (!target || index >= target.length) {
2582 state.target = undefined;
2583 return {
2584 value: undefined,
2585 done: true
2586 };
2587 }
2588
2589 if (kind == 'keys') return {
2590 value: index,
2591 done: false
2592 };
2593 if (kind == 'values') return {
2594 value: target[index],
2595 done: false
2596 };
2597 return {
2598 value: [index, target[index]],
2599 done: false
2600 };
2601}, 'values'); // argumentsList[@@iterator] is %ArrayProto_values%
2602// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
2603// https://tc39.es/ecma262/#sec-createmappedargumentsobject
2604
2605Iterators$1.Arguments = Iterators$1.Array; // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
2606
2607var getIteratorMethod$5 = getIteratorMethod$8;
2608var getIteratorMethod_1 = getIteratorMethod$5;
2609
2610// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
2611
2612var domIterables = {
2613 CSSRuleList: 0,
2614 CSSStyleDeclaration: 0,
2615 CSSValueList: 0,
2616 ClientRectList: 0,
2617 DOMRectList: 0,
2618 DOMStringList: 0,
2619 DOMTokenList: 1,
2620 DataTransferItemList: 0,
2621 FileList: 0,
2622 HTMLAllCollection: 0,
2623 HTMLCollection: 0,
2624 HTMLFormElement: 0,
2625 HTMLSelectElement: 0,
2626 MediaList: 0,
2627 MimeTypeArray: 0,
2628 NamedNodeMap: 0,
2629 NodeList: 1,
2630 PaintRequestList: 0,
2631 Plugin: 0,
2632 PluginArray: 0,
2633 SVGLengthList: 0,
2634 SVGNumberList: 0,
2635 SVGPathSegList: 0,
2636 SVGPointList: 0,
2637 SVGStringList: 0,
2638 SVGTransformList: 0,
2639 SourceBufferList: 0,
2640 StyleSheetList: 0,
2641 TextTrackCueList: 0,
2642 TextTrackList: 0,
2643 TouchList: 0
2644};
2645
2646var DOMIterables$4 = domIterables;
2647var global$h = global$M;
2648var classof$7 = classof$c;
2649var createNonEnumerableProperty$1 = createNonEnumerableProperty$6;
2650var Iterators = iterators;
2651var wellKnownSymbol$7 = wellKnownSymbol$j;
2652var TO_STRING_TAG = wellKnownSymbol$7('toStringTag');
2653
2654for (var COLLECTION_NAME in DOMIterables$4) {
2655 var Collection = global$h[COLLECTION_NAME];
2656 var CollectionPrototype = Collection && Collection.prototype;
2657
2658 if (CollectionPrototype && classof$7(CollectionPrototype) !== TO_STRING_TAG) {
2659 createNonEnumerableProperty$1(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
2660 }
2661
2662 Iterators[COLLECTION_NAME] = Iterators.Array;
2663}
2664
2665var parent$M = getIteratorMethod_1;
2666var getIteratorMethod$4 = parent$M;
2667
2668var parent$L = getIteratorMethod$4;
2669var getIteratorMethod$3 = parent$L;
2670
2671var parent$K = getIteratorMethod$3;
2672var getIteratorMethod$2 = parent$K;
2673
2674var getIteratorMethod$1 = getIteratorMethod$2;
2675
2676var objectGetOwnPropertyNames = {};
2677
2678var internalObjectKeys = objectKeysInternal;
2679var enumBugKeys = enumBugKeys$3;
2680var hiddenKeys$2 = enumBugKeys.concat('length', 'prototype'); // `Object.getOwnPropertyNames` method
2681// https://tc39.es/ecma262/#sec-object.getownpropertynames
2682// eslint-disable-next-line es/no-object-getownpropertynames -- safe
2683
2684objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
2685 return internalObjectKeys(O, hiddenKeys$2);
2686};
2687
2688var objectGetOwnPropertyNamesExternal = {};
2689
2690var global$g = global$M;
2691var toAbsoluteIndex$3 = toAbsoluteIndex$5;
2692var lengthOfArrayLike$6 = lengthOfArrayLike$d;
2693var createProperty$4 = createProperty$6;
2694var Array$3 = global$g.Array;
2695var max$2 = Math.max;
2696
2697var arraySliceSimple = function (O, start, end) {
2698 var length = lengthOfArrayLike$6(O);
2699 var k = toAbsoluteIndex$3(start, length);
2700 var fin = toAbsoluteIndex$3(end === undefined ? length : end, length);
2701 var result = Array$3(max$2(fin - k, 0));
2702
2703 for (var n = 0; k < fin; k++, n++) createProperty$4(result, n, O[k]);
2704
2705 result.length = n;
2706 return result;
2707};
2708
2709/* eslint-disable es/no-object-getownpropertynames -- safe */
2710var classof$6 = classofRaw$1;
2711var toIndexedObject$5 = toIndexedObject$b;
2712var $getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
2713var arraySlice$3 = arraySliceSimple;
2714var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
2715
2716var getWindowNames = function (it) {
2717 try {
2718 return $getOwnPropertyNames$1(it);
2719 } catch (error) {
2720 return arraySlice$3(windowNames);
2721 }
2722}; // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
2723
2724
2725objectGetOwnPropertyNamesExternal.f = function getOwnPropertyNames(it) {
2726 return windowNames && classof$6(it) == 'Window' ? getWindowNames(it) : $getOwnPropertyNames$1(toIndexedObject$5(it));
2727};
2728
2729var objectGetOwnPropertySymbols = {};
2730
2731objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
2732
2733var wellKnownSymbolWrapped = {};
2734
2735var wellKnownSymbol$6 = wellKnownSymbol$j;
2736wellKnownSymbolWrapped.f = wellKnownSymbol$6;
2737
2738var path$k = path$q;
2739var hasOwn$6 = hasOwnProperty_1;
2740var wrappedWellKnownSymbolModule$1 = wellKnownSymbolWrapped;
2741var defineProperty$5 = objectDefineProperty.f;
2742
2743var defineWellKnownSymbol$l = function (NAME) {
2744 var Symbol = path$k.Symbol || (path$k.Symbol = {});
2745 if (!hasOwn$6(Symbol, NAME)) defineProperty$5(Symbol, NAME, {
2746 value: wrappedWellKnownSymbolModule$1.f(NAME)
2747 });
2748};
2749
2750var $$u = _export;
2751var global$f = global$M;
2752var getBuiltIn$4 = getBuiltIn$9;
2753var apply$4 = functionApply;
2754var call$2 = functionCall;
2755var uncurryThis$c = functionUncurryThis;
2756var DESCRIPTORS$9 = descriptors;
2757var NATIVE_SYMBOL = nativeSymbol;
2758var fails$e = fails$r;
2759var hasOwn$5 = hasOwnProperty_1;
2760var isArray$a = isArray$d;
2761var isCallable$2 = isCallable$h;
2762var isObject$7 = isObject$f;
2763var isPrototypeOf$c = objectIsPrototypeOf;
2764var isSymbol = isSymbol$3;
2765var anObject$3 = anObject$b;
2766var toObject$7 = toObject$e;
2767var toIndexedObject$4 = toIndexedObject$b;
2768var toPropertyKey = toPropertyKey$4;
2769var $toString = toString$7;
2770var createPropertyDescriptor = createPropertyDescriptor$5;
2771var nativeObjectCreate = objectCreate;
2772var objectKeys$2 = objectKeys$4;
2773var getOwnPropertyNamesModule$2 = objectGetOwnPropertyNames;
2774var getOwnPropertyNamesExternal = objectGetOwnPropertyNamesExternal;
2775var getOwnPropertySymbolsModule$2 = objectGetOwnPropertySymbols;
2776var getOwnPropertyDescriptorModule$1 = objectGetOwnPropertyDescriptor;
2777var definePropertyModule$1 = objectDefineProperty;
2778var definePropertiesModule = objectDefineProperties;
2779var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
2780var arraySlice$2 = arraySlice$5;
2781var redefine$1 = redefine$4;
2782var shared = shared$4.exports;
2783var sharedKey = sharedKey$4;
2784var hiddenKeys$1 = hiddenKeys$6;
2785var uid$1 = uid$4;
2786var wellKnownSymbol$5 = wellKnownSymbol$j;
2787var wrappedWellKnownSymbolModule = wellKnownSymbolWrapped;
2788var defineWellKnownSymbol$k = defineWellKnownSymbol$l;
2789var setToStringTag$2 = setToStringTag$5;
2790var InternalStateModule$2 = internalState;
2791var $forEach$1 = arrayIteration.forEach;
2792var HIDDEN = sharedKey('hidden');
2793var SYMBOL = 'Symbol';
2794var PROTOTYPE = 'prototype';
2795var TO_PRIMITIVE = wellKnownSymbol$5('toPrimitive');
2796var setInternalState$2 = InternalStateModule$2.set;
2797var getInternalState = InternalStateModule$2.getterFor(SYMBOL);
2798var ObjectPrototype$1 = Object[PROTOTYPE];
2799var $Symbol = global$f.Symbol;
2800var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
2801var TypeError$8 = global$f.TypeError;
2802var QObject = global$f.QObject;
2803var $stringify$1 = getBuiltIn$4('JSON', 'stringify');
2804var nativeGetOwnPropertyDescriptor$1 = getOwnPropertyDescriptorModule$1.f;
2805var nativeDefineProperty = definePropertyModule$1.f;
2806var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
2807var nativePropertyIsEnumerable = propertyIsEnumerableModule$1.f;
2808var push$3 = uncurryThis$c([].push);
2809var AllSymbols = shared('symbols');
2810var ObjectPrototypeSymbols = shared('op-symbols');
2811var StringToSymbolRegistry = shared('string-to-symbol-registry');
2812var SymbolToStringRegistry = shared('symbol-to-string-registry');
2813var WellKnownSymbolsStore = shared('wks'); // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
2814
2815var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild; // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
2816
2817var setSymbolDescriptor = DESCRIPTORS$9 && fails$e(function () {
2818 return nativeObjectCreate(nativeDefineProperty({}, 'a', {
2819 get: function () {
2820 return nativeDefineProperty(this, 'a', {
2821 value: 7
2822 }).a;
2823 }
2824 })).a != 7;
2825}) ? function (O, P, Attributes) {
2826 var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype$1, P);
2827 if (ObjectPrototypeDescriptor) delete ObjectPrototype$1[P];
2828 nativeDefineProperty(O, P, Attributes);
2829
2830 if (ObjectPrototypeDescriptor && O !== ObjectPrototype$1) {
2831 nativeDefineProperty(ObjectPrototype$1, P, ObjectPrototypeDescriptor);
2832 }
2833} : nativeDefineProperty;
2834
2835var wrap$1 = function (tag, description) {
2836 var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
2837 setInternalState$2(symbol, {
2838 type: SYMBOL,
2839 tag: tag,
2840 description: description
2841 });
2842 if (!DESCRIPTORS$9) symbol.description = description;
2843 return symbol;
2844};
2845
2846var $defineProperty = function defineProperty(O, P, Attributes) {
2847 if (O === ObjectPrototype$1) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
2848 anObject$3(O);
2849 var key = toPropertyKey(P);
2850 anObject$3(Attributes);
2851
2852 if (hasOwn$5(AllSymbols, key)) {
2853 if (!Attributes.enumerable) {
2854 if (!hasOwn$5(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, {}));
2855 O[HIDDEN][key] = true;
2856 } else {
2857 if (hasOwn$5(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
2858 Attributes = nativeObjectCreate(Attributes, {
2859 enumerable: createPropertyDescriptor(0, false)
2860 });
2861 }
2862
2863 return setSymbolDescriptor(O, key, Attributes);
2864 }
2865
2866 return nativeDefineProperty(O, key, Attributes);
2867};
2868
2869var $defineProperties = function defineProperties(O, Properties) {
2870 anObject$3(O);
2871 var properties = toIndexedObject$4(Properties);
2872 var keys = objectKeys$2(properties).concat($getOwnPropertySymbols(properties));
2873 $forEach$1(keys, function (key) {
2874 if (!DESCRIPTORS$9 || call$2($propertyIsEnumerable$1, properties, key)) $defineProperty(O, key, properties[key]);
2875 });
2876 return O;
2877};
2878
2879var $create = function create(O, Properties) {
2880 return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
2881};
2882
2883var $propertyIsEnumerable$1 = function propertyIsEnumerable(V) {
2884 var P = toPropertyKey(V);
2885 var enumerable = call$2(nativePropertyIsEnumerable, this, P);
2886 if (this === ObjectPrototype$1 && hasOwn$5(AllSymbols, P) && !hasOwn$5(ObjectPrototypeSymbols, P)) return false;
2887 return enumerable || !hasOwn$5(this, P) || !hasOwn$5(AllSymbols, P) || hasOwn$5(this, HIDDEN) && this[HIDDEN][P] ? enumerable : true;
2888};
2889
2890var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
2891 var it = toIndexedObject$4(O);
2892 var key = toPropertyKey(P);
2893 if (it === ObjectPrototype$1 && hasOwn$5(AllSymbols, key) && !hasOwn$5(ObjectPrototypeSymbols, key)) return;
2894 var descriptor = nativeGetOwnPropertyDescriptor$1(it, key);
2895
2896 if (descriptor && hasOwn$5(AllSymbols, key) && !(hasOwn$5(it, HIDDEN) && it[HIDDEN][key])) {
2897 descriptor.enumerable = true;
2898 }
2899
2900 return descriptor;
2901};
2902
2903var $getOwnPropertyNames = function getOwnPropertyNames(O) {
2904 var names = nativeGetOwnPropertyNames(toIndexedObject$4(O));
2905 var result = [];
2906 $forEach$1(names, function (key) {
2907 if (!hasOwn$5(AllSymbols, key) && !hasOwn$5(hiddenKeys$1, key)) push$3(result, key);
2908 });
2909 return result;
2910};
2911
2912var $getOwnPropertySymbols = function getOwnPropertySymbols(O) {
2913 var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$1;
2914 var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject$4(O));
2915 var result = [];
2916 $forEach$1(names, function (key) {
2917 if (hasOwn$5(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn$5(ObjectPrototype$1, key))) {
2918 push$3(result, AllSymbols[key]);
2919 }
2920 });
2921 return result;
2922}; // `Symbol` constructor
2923// https://tc39.es/ecma262/#sec-symbol-constructor
2924
2925
2926if (!NATIVE_SYMBOL) {
2927 $Symbol = function Symbol() {
2928 if (isPrototypeOf$c(SymbolPrototype, this)) throw TypeError$8('Symbol is not a constructor');
2929 var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
2930 var tag = uid$1(description);
2931
2932 var setter = function (value) {
2933 if (this === ObjectPrototype$1) call$2(setter, ObjectPrototypeSymbols, value);
2934 if (hasOwn$5(this, HIDDEN) && hasOwn$5(this[HIDDEN], tag)) this[HIDDEN][tag] = false;
2935 setSymbolDescriptor(this, tag, createPropertyDescriptor(1, value));
2936 };
2937
2938 if (DESCRIPTORS$9 && USE_SETTER) setSymbolDescriptor(ObjectPrototype$1, tag, {
2939 configurable: true,
2940 set: setter
2941 });
2942 return wrap$1(tag, description);
2943 };
2944
2945 SymbolPrototype = $Symbol[PROTOTYPE];
2946 redefine$1(SymbolPrototype, 'toString', function toString() {
2947 return getInternalState(this).tag;
2948 });
2949 redefine$1($Symbol, 'withoutSetter', function (description) {
2950 return wrap$1(uid$1(description), description);
2951 });
2952 propertyIsEnumerableModule$1.f = $propertyIsEnumerable$1;
2953 definePropertyModule$1.f = $defineProperty;
2954 definePropertiesModule.f = $defineProperties;
2955 getOwnPropertyDescriptorModule$1.f = $getOwnPropertyDescriptor;
2956 getOwnPropertyNamesModule$2.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
2957 getOwnPropertySymbolsModule$2.f = $getOwnPropertySymbols;
2958
2959 wrappedWellKnownSymbolModule.f = function (name) {
2960 return wrap$1(wellKnownSymbol$5(name), name);
2961 };
2962
2963 if (DESCRIPTORS$9) {
2964 // https://github.com/tc39/proposal-Symbol-description
2965 nativeDefineProperty(SymbolPrototype, 'description', {
2966 configurable: true,
2967 get: function description() {
2968 return getInternalState(this).description;
2969 }
2970 });
2971 }
2972}
2973
2974$$u({
2975 global: true,
2976 wrap: true,
2977 forced: !NATIVE_SYMBOL,
2978 sham: !NATIVE_SYMBOL
2979}, {
2980 Symbol: $Symbol
2981});
2982$forEach$1(objectKeys$2(WellKnownSymbolsStore), function (name) {
2983 defineWellKnownSymbol$k(name);
2984});
2985$$u({
2986 target: SYMBOL,
2987 stat: true,
2988 forced: !NATIVE_SYMBOL
2989}, {
2990 // `Symbol.for` method
2991 // https://tc39.es/ecma262/#sec-symbol.for
2992 'for': function (key) {
2993 var string = $toString(key);
2994 if (hasOwn$5(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
2995 var symbol = $Symbol(string);
2996 StringToSymbolRegistry[string] = symbol;
2997 SymbolToStringRegistry[symbol] = string;
2998 return symbol;
2999 },
3000 // `Symbol.keyFor` method
3001 // https://tc39.es/ecma262/#sec-symbol.keyfor
3002 keyFor: function keyFor(sym) {
3003 if (!isSymbol(sym)) throw TypeError$8(sym + ' is not a symbol');
3004 if (hasOwn$5(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
3005 },
3006 useSetter: function () {
3007 USE_SETTER = true;
3008 },
3009 useSimple: function () {
3010 USE_SETTER = false;
3011 }
3012});
3013$$u({
3014 target: 'Object',
3015 stat: true,
3016 forced: !NATIVE_SYMBOL,
3017 sham: !DESCRIPTORS$9
3018}, {
3019 // `Object.create` method
3020 // https://tc39.es/ecma262/#sec-object.create
3021 create: $create,
3022 // `Object.defineProperty` method
3023 // https://tc39.es/ecma262/#sec-object.defineproperty
3024 defineProperty: $defineProperty,
3025 // `Object.defineProperties` method
3026 // https://tc39.es/ecma262/#sec-object.defineproperties
3027 defineProperties: $defineProperties,
3028 // `Object.getOwnPropertyDescriptor` method
3029 // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
3030 getOwnPropertyDescriptor: $getOwnPropertyDescriptor
3031});
3032$$u({
3033 target: 'Object',
3034 stat: true,
3035 forced: !NATIVE_SYMBOL
3036}, {
3037 // `Object.getOwnPropertyNames` method
3038 // https://tc39.es/ecma262/#sec-object.getownpropertynames
3039 getOwnPropertyNames: $getOwnPropertyNames,
3040 // `Object.getOwnPropertySymbols` method
3041 // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
3042 getOwnPropertySymbols: $getOwnPropertySymbols
3043}); // Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
3044// https://bugs.chromium.org/p/v8/issues/detail?id=3443
3045
3046$$u({
3047 target: 'Object',
3048 stat: true,
3049 forced: fails$e(function () {
3050 getOwnPropertySymbolsModule$2.f(1);
3051 })
3052}, {
3053 getOwnPropertySymbols: function getOwnPropertySymbols(it) {
3054 return getOwnPropertySymbolsModule$2.f(toObject$7(it));
3055 }
3056}); // `JSON.stringify` method behavior with symbols
3057// https://tc39.es/ecma262/#sec-json.stringify
3058
3059if ($stringify$1) {
3060 var FORCED_JSON_STRINGIFY = !NATIVE_SYMBOL || fails$e(function () {
3061 var symbol = $Symbol(); // MS Edge converts symbol values to JSON as {}
3062
3063 return $stringify$1([symbol]) != '[null]' // WebKit converts symbol values to JSON as null
3064 || $stringify$1({
3065 a: symbol
3066 }) != '{}' // V8 throws on boxed symbols
3067 || $stringify$1(Object(symbol)) != '{}';
3068 });
3069 $$u({
3070 target: 'JSON',
3071 stat: true,
3072 forced: FORCED_JSON_STRINGIFY
3073 }, {
3074 // eslint-disable-next-line no-unused-vars -- required for `.length`
3075 stringify: function stringify(it, replacer, space) {
3076 var args = arraySlice$2(arguments);
3077 var $replacer = replacer;
3078 if (!isObject$7(replacer) && it === undefined || isSymbol(it)) return; // IE8 returns string on undefined
3079
3080 if (!isArray$a(replacer)) replacer = function (key, value) {
3081 if (isCallable$2($replacer)) value = call$2($replacer, this, key, value);
3082 if (!isSymbol(value)) return value;
3083 };
3084 args[1] = replacer;
3085 return apply$4($stringify$1, null, args);
3086 }
3087 });
3088} // `Symbol.prototype[@@toPrimitive]` method
3089// https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
3090
3091
3092if (!SymbolPrototype[TO_PRIMITIVE]) {
3093 var valueOf = SymbolPrototype.valueOf; // eslint-disable-next-line no-unused-vars -- required for .length
3094
3095 redefine$1(SymbolPrototype, TO_PRIMITIVE, function (hint) {
3096 // TODO: improve hint logic
3097 return call$2(valueOf, this);
3098 });
3099} // `Symbol.prototype[@@toStringTag]` property
3100// https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
3101
3102
3103setToStringTag$2($Symbol, SYMBOL);
3104hiddenKeys$1[HIDDEN] = true;
3105
3106var path$j = path$q;
3107var getOwnPropertySymbols$2 = path$j.Object.getOwnPropertySymbols;
3108
3109var parent$J = getOwnPropertySymbols$2;
3110var getOwnPropertySymbols$1 = parent$J;
3111
3112var getOwnPropertySymbols = getOwnPropertySymbols$1;
3113
3114var getOwnPropertyDescriptor$3 = {exports: {}};
3115
3116var $$t = _export;
3117var fails$d = fails$r;
3118var toIndexedObject$3 = toIndexedObject$b;
3119var nativeGetOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
3120var DESCRIPTORS$8 = descriptors;
3121var FAILS_ON_PRIMITIVES$3 = fails$d(function () {
3122 nativeGetOwnPropertyDescriptor(1);
3123});
3124var FORCED$5 = !DESCRIPTORS$8 || FAILS_ON_PRIMITIVES$3; // `Object.getOwnPropertyDescriptor` method
3125// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
3126
3127$$t({
3128 target: 'Object',
3129 stat: true,
3130 forced: FORCED$5,
3131 sham: !DESCRIPTORS$8
3132}, {
3133 getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
3134 return nativeGetOwnPropertyDescriptor(toIndexedObject$3(it), key);
3135 }
3136});
3137
3138var path$i = path$q;
3139var Object$3 = path$i.Object;
3140
3141var getOwnPropertyDescriptor$2 = getOwnPropertyDescriptor$3.exports = function getOwnPropertyDescriptor(it, key) {
3142 return Object$3.getOwnPropertyDescriptor(it, key);
3143};
3144
3145if (Object$3.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor$2.sham = true;
3146
3147var parent$I = getOwnPropertyDescriptor$3.exports;
3148var getOwnPropertyDescriptor$1 = parent$I;
3149
3150var getOwnPropertyDescriptor = getOwnPropertyDescriptor$1;
3151
3152var getBuiltIn$3 = getBuiltIn$9;
3153var uncurryThis$b = functionUncurryThis;
3154var getOwnPropertyNamesModule$1 = objectGetOwnPropertyNames;
3155var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
3156var anObject$2 = anObject$b;
3157var concat$5 = uncurryThis$b([].concat); // all object keys, includes non-enumerable and symbols
3158
3159var ownKeys$6 = getBuiltIn$3('Reflect', 'ownKeys') || function ownKeys(it) {
3160 var keys = getOwnPropertyNamesModule$1.f(anObject$2(it));
3161 var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
3162 return getOwnPropertySymbols ? concat$5(keys, getOwnPropertySymbols(it)) : keys;
3163};
3164
3165var $$s = _export;
3166var DESCRIPTORS$7 = descriptors;
3167var ownKeys$5 = ownKeys$6;
3168var toIndexedObject$2 = toIndexedObject$b;
3169var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
3170var createProperty$3 = createProperty$6; // `Object.getOwnPropertyDescriptors` method
3171// https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
3172
3173$$s({
3174 target: 'Object',
3175 stat: true,
3176 sham: !DESCRIPTORS$7
3177}, {
3178 getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
3179 var O = toIndexedObject$2(object);
3180 var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
3181 var keys = ownKeys$5(O);
3182 var result = {};
3183 var index = 0;
3184 var key, descriptor;
3185
3186 while (keys.length > index) {
3187 descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
3188 if (descriptor !== undefined) createProperty$3(result, key, descriptor);
3189 }
3190
3191 return result;
3192 }
3193});
3194
3195var path$h = path$q;
3196var getOwnPropertyDescriptors$2 = path$h.Object.getOwnPropertyDescriptors;
3197
3198var parent$H = getOwnPropertyDescriptors$2;
3199var getOwnPropertyDescriptors$1 = parent$H;
3200
3201var getOwnPropertyDescriptors = getOwnPropertyDescriptors$1;
3202
3203var defineProperties$4 = {exports: {}};
3204
3205var $$r = _export;
3206var DESCRIPTORS$6 = descriptors;
3207var defineProperties$3 = objectDefineProperties.f; // `Object.defineProperties` method
3208// https://tc39.es/ecma262/#sec-object.defineproperties
3209// eslint-disable-next-line es/no-object-defineproperties -- safe
3210
3211$$r({
3212 target: 'Object',
3213 stat: true,
3214 forced: Object.defineProperties !== defineProperties$3,
3215 sham: !DESCRIPTORS$6
3216}, {
3217 defineProperties: defineProperties$3
3218});
3219
3220var path$g = path$q;
3221var Object$2 = path$g.Object;
3222
3223var defineProperties$2 = defineProperties$4.exports = function defineProperties(T, D) {
3224 return Object$2.defineProperties(T, D);
3225};
3226
3227if (Object$2.defineProperties.sham) defineProperties$2.sham = true;
3228
3229var parent$G = defineProperties$4.exports;
3230var defineProperties$1 = parent$G;
3231
3232var defineProperties = defineProperties$1;
3233
3234var defineProperty$4 = defineProperty$a;
3235
3236var $$q = _export;
3237var isArray$9 = isArray$d; // `Array.isArray` method
3238// https://tc39.es/ecma262/#sec-array.isarray
3239
3240$$q({
3241 target: 'Array',
3242 stat: true
3243}, {
3244 isArray: isArray$9
3245});
3246
3247var path$f = path$q;
3248var isArray$8 = path$f.Array.isArray;
3249
3250var parent$F = isArray$8;
3251var isArray$7 = parent$F;
3252
3253var parent$E = isArray$7;
3254var isArray$6 = parent$E;
3255
3256var parent$D = isArray$6;
3257var isArray$5 = parent$D;
3258
3259var isArray$4 = isArray$5;
3260
3261function _arrayWithHoles(arr) {
3262 if (isArray$4(arr)) return arr;
3263}
3264
3265var $$p = _export;
3266var global$e = global$M;
3267var fails$c = fails$r;
3268var isArray$3 = isArray$d;
3269var isObject$6 = isObject$f;
3270var toObject$6 = toObject$e;
3271var lengthOfArrayLike$5 = lengthOfArrayLike$d;
3272var createProperty$2 = createProperty$6;
3273var arraySpeciesCreate$1 = arraySpeciesCreate$4;
3274var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5;
3275var wellKnownSymbol$4 = wellKnownSymbol$j;
3276var V8_VERSION = engineV8Version;
3277var IS_CONCAT_SPREADABLE = wellKnownSymbol$4('isConcatSpreadable');
3278var MAX_SAFE_INTEGER$1 = 0x1FFFFFFFFFFFFF;
3279var MAXIMUM_ALLOWED_INDEX_EXCEEDED = 'Maximum allowed index exceeded';
3280var TypeError$7 = global$e.TypeError; // We can't use this feature detection in V8 since it causes
3281// deoptimization and serious performance degradation
3282// https://github.com/zloirock/core-js/issues/679
3283
3284var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails$c(function () {
3285 var array = [];
3286 array[IS_CONCAT_SPREADABLE] = false;
3287 return array.concat()[0] !== array;
3288});
3289var SPECIES_SUPPORT = arrayMethodHasSpeciesSupport$2('concat');
3290
3291var isConcatSpreadable = function (O) {
3292 if (!isObject$6(O)) return false;
3293 var spreadable = O[IS_CONCAT_SPREADABLE];
3294 return spreadable !== undefined ? !!spreadable : isArray$3(O);
3295};
3296
3297var FORCED$4 = !IS_CONCAT_SPREADABLE_SUPPORT || !SPECIES_SUPPORT; // `Array.prototype.concat` method
3298// https://tc39.es/ecma262/#sec-array.prototype.concat
3299// with adding support of @@isConcatSpreadable and @@species
3300
3301$$p({
3302 target: 'Array',
3303 proto: true,
3304 forced: FORCED$4
3305}, {
3306 // eslint-disable-next-line no-unused-vars -- required for `.length`
3307 concat: function concat(arg) {
3308 var O = toObject$6(this);
3309 var A = arraySpeciesCreate$1(O, 0);
3310 var n = 0;
3311 var i, k, length, len, E;
3312
3313 for (i = -1, length = arguments.length; i < length; i++) {
3314 E = i === -1 ? O : arguments[i];
3315
3316 if (isConcatSpreadable(E)) {
3317 len = lengthOfArrayLike$5(E);
3318 if (n + len > MAX_SAFE_INTEGER$1) throw TypeError$7(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
3319
3320 for (k = 0; k < len; k++, n++) if (k in E) createProperty$2(A, n, E[k]);
3321 } else {
3322 if (n >= MAX_SAFE_INTEGER$1) throw TypeError$7(MAXIMUM_ALLOWED_INDEX_EXCEEDED);
3323 createProperty$2(A, n++, E);
3324 }
3325 }
3326
3327 A.length = n;
3328 return A;
3329 }
3330});
3331
3332var defineWellKnownSymbol$j = defineWellKnownSymbol$l; // `Symbol.asyncIterator` well-known symbol
3333// https://tc39.es/ecma262/#sec-symbol.asynciterator
3334
3335defineWellKnownSymbol$j('asyncIterator');
3336
3337var defineWellKnownSymbol$i = defineWellKnownSymbol$l; // `Symbol.hasInstance` well-known symbol
3338// https://tc39.es/ecma262/#sec-symbol.hasinstance
3339
3340defineWellKnownSymbol$i('hasInstance');
3341
3342var defineWellKnownSymbol$h = defineWellKnownSymbol$l; // `Symbol.isConcatSpreadable` well-known symbol
3343// https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
3344
3345defineWellKnownSymbol$h('isConcatSpreadable');
3346
3347var defineWellKnownSymbol$g = defineWellKnownSymbol$l; // `Symbol.iterator` well-known symbol
3348// https://tc39.es/ecma262/#sec-symbol.iterator
3349
3350defineWellKnownSymbol$g('iterator');
3351
3352var defineWellKnownSymbol$f = defineWellKnownSymbol$l; // `Symbol.match` well-known symbol
3353// https://tc39.es/ecma262/#sec-symbol.match
3354
3355defineWellKnownSymbol$f('match');
3356
3357var defineWellKnownSymbol$e = defineWellKnownSymbol$l; // `Symbol.matchAll` well-known symbol
3358// https://tc39.es/ecma262/#sec-symbol.matchall
3359
3360defineWellKnownSymbol$e('matchAll');
3361
3362var defineWellKnownSymbol$d = defineWellKnownSymbol$l; // `Symbol.replace` well-known symbol
3363// https://tc39.es/ecma262/#sec-symbol.replace
3364
3365defineWellKnownSymbol$d('replace');
3366
3367var defineWellKnownSymbol$c = defineWellKnownSymbol$l; // `Symbol.search` well-known symbol
3368// https://tc39.es/ecma262/#sec-symbol.search
3369
3370defineWellKnownSymbol$c('search');
3371
3372var defineWellKnownSymbol$b = defineWellKnownSymbol$l; // `Symbol.species` well-known symbol
3373// https://tc39.es/ecma262/#sec-symbol.species
3374
3375defineWellKnownSymbol$b('species');
3376
3377var defineWellKnownSymbol$a = defineWellKnownSymbol$l; // `Symbol.split` well-known symbol
3378// https://tc39.es/ecma262/#sec-symbol.split
3379
3380defineWellKnownSymbol$a('split');
3381
3382var defineWellKnownSymbol$9 = defineWellKnownSymbol$l; // `Symbol.toPrimitive` well-known symbol
3383// https://tc39.es/ecma262/#sec-symbol.toprimitive
3384
3385defineWellKnownSymbol$9('toPrimitive');
3386
3387var defineWellKnownSymbol$8 = defineWellKnownSymbol$l; // `Symbol.toStringTag` well-known symbol
3388// https://tc39.es/ecma262/#sec-symbol.tostringtag
3389
3390defineWellKnownSymbol$8('toStringTag');
3391
3392var defineWellKnownSymbol$7 = defineWellKnownSymbol$l; // `Symbol.unscopables` well-known symbol
3393// https://tc39.es/ecma262/#sec-symbol.unscopables
3394
3395defineWellKnownSymbol$7('unscopables');
3396
3397var global$d = global$M;
3398var setToStringTag$1 = setToStringTag$5; // JSON[@@toStringTag] property
3399// https://tc39.es/ecma262/#sec-json-@@tostringtag
3400
3401setToStringTag$1(global$d.JSON, 'JSON', true);
3402
3403var path$e = path$q;
3404var symbol$5 = path$e.Symbol;
3405
3406var parent$C = symbol$5;
3407var symbol$4 = parent$C;
3408
3409var parent$B = symbol$4;
3410var symbol$3 = parent$B;
3411
3412var defineWellKnownSymbol$6 = defineWellKnownSymbol$l; // `Symbol.asyncDispose` well-known symbol
3413// https://github.com/tc39/proposal-using-statement
3414
3415defineWellKnownSymbol$6('asyncDispose');
3416
3417var defineWellKnownSymbol$5 = defineWellKnownSymbol$l; // `Symbol.dispose` well-known symbol
3418// https://github.com/tc39/proposal-using-statement
3419
3420defineWellKnownSymbol$5('dispose');
3421
3422var defineWellKnownSymbol$4 = defineWellKnownSymbol$l; // `Symbol.matcher` well-known symbol
3423// https://github.com/tc39/proposal-pattern-matching
3424
3425defineWellKnownSymbol$4('matcher');
3426
3427var defineWellKnownSymbol$3 = defineWellKnownSymbol$l; // `Symbol.metadata` well-known symbol
3428// https://github.com/tc39/proposal-decorators
3429
3430defineWellKnownSymbol$3('metadata');
3431
3432var defineWellKnownSymbol$2 = defineWellKnownSymbol$l; // `Symbol.observable` well-known symbol
3433// https://github.com/tc39/proposal-observable
3434
3435defineWellKnownSymbol$2('observable');
3436
3437var defineWellKnownSymbol$1 = defineWellKnownSymbol$l; // `Symbol.patternMatch` well-known symbol
3438// https://github.com/tc39/proposal-pattern-matching
3439
3440defineWellKnownSymbol$1('patternMatch');
3441
3442var defineWellKnownSymbol = defineWellKnownSymbol$l;
3443defineWellKnownSymbol('replaceAll');
3444
3445var parent$A = symbol$3; // TODO: Remove from `core-js@4`
3446// TODO: Remove from `core-js@4`
3447
3448var symbol$2 = parent$A;
3449
3450var symbol$1 = symbol$2;
3451
3452function _iterableToArrayLimit(arr, i) {
3453 var _i = arr == null ? null : typeof symbol$1 !== "undefined" && getIteratorMethod$1(arr) || arr["@@iterator"];
3454
3455 if (_i == null) return;
3456 var _arr = [];
3457 var _n = true;
3458 var _d = false;
3459
3460 var _s, _e;
3461
3462 try {
3463 for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
3464 _arr.push(_s.value);
3465
3466 if (i && _arr.length === i) break;
3467 }
3468 } catch (err) {
3469 _d = true;
3470 _e = err;
3471 } finally {
3472 try {
3473 if (!_n && _i["return"] != null) _i["return"]();
3474 } finally {
3475 if (_d) throw _e;
3476 }
3477 }
3478
3479 return _arr;
3480}
3481
3482var $$o = _export;
3483var global$c = global$M;
3484var isArray$2 = isArray$d;
3485var isConstructor$1 = isConstructor$4;
3486var isObject$5 = isObject$f;
3487var toAbsoluteIndex$2 = toAbsoluteIndex$5;
3488var lengthOfArrayLike$4 = lengthOfArrayLike$d;
3489var toIndexedObject$1 = toIndexedObject$b;
3490var createProperty$1 = createProperty$6;
3491var wellKnownSymbol$3 = wellKnownSymbol$j;
3492var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5;
3493var un$Slice = arraySlice$5;
3494var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice');
3495var SPECIES$1 = wellKnownSymbol$3('species');
3496var Array$2 = global$c.Array;
3497var max$1 = Math.max; // `Array.prototype.slice` method
3498// https://tc39.es/ecma262/#sec-array.prototype.slice
3499// fallback for not array-like ES3 strings and DOM objects
3500
3501$$o({
3502 target: 'Array',
3503 proto: true,
3504 forced: !HAS_SPECIES_SUPPORT$1
3505}, {
3506 slice: function slice(start, end) {
3507 var O = toIndexedObject$1(this);
3508 var length = lengthOfArrayLike$4(O);
3509 var k = toAbsoluteIndex$2(start, length);
3510 var fin = toAbsoluteIndex$2(end === undefined ? length : end, length); // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
3511
3512 var Constructor, result, n;
3513
3514 if (isArray$2(O)) {
3515 Constructor = O.constructor; // cross-realm fallback
3516
3517 if (isConstructor$1(Constructor) && (Constructor === Array$2 || isArray$2(Constructor.prototype))) {
3518 Constructor = undefined;
3519 } else if (isObject$5(Constructor)) {
3520 Constructor = Constructor[SPECIES$1];
3521 if (Constructor === null) Constructor = undefined;
3522 }
3523
3524 if (Constructor === Array$2 || Constructor === undefined) {
3525 return un$Slice(O, k, fin);
3526 }
3527 }
3528
3529 result = new (Constructor === undefined ? Array$2 : Constructor)(max$1(fin - k, 0));
3530
3531 for (n = 0; k < fin; k++, n++) if (k in O) createProperty$1(result, n, O[k]);
3532
3533 result.length = n;
3534 return result;
3535 }
3536});
3537
3538var entryVirtual$e = entryVirtual$k;
3539var slice$6 = entryVirtual$e('Array').slice;
3540
3541var isPrototypeOf$b = objectIsPrototypeOf;
3542var method$9 = slice$6;
3543var ArrayPrototype$9 = Array.prototype;
3544
3545var slice$5 = function (it) {
3546 var own = it.slice;
3547 return it === ArrayPrototype$9 || isPrototypeOf$b(ArrayPrototype$9, it) && own === ArrayPrototype$9.slice ? method$9 : own;
3548};
3549
3550var parent$z = slice$5;
3551var slice$4 = parent$z;
3552
3553var parent$y = slice$4;
3554var slice$3 = parent$y;
3555
3556var parent$x = slice$3;
3557var slice$2 = parent$x;
3558
3559var slice$1 = slice$2;
3560
3561var parent$w = from$4;
3562var from$2 = parent$w;
3563
3564var parent$v = from$2;
3565var from$1 = parent$v;
3566
3567var from = from$1;
3568
3569function _arrayLikeToArray$4(arr, len) {
3570 if (len == null || len > arr.length) len = arr.length;
3571
3572 for (var i = 0, arr2 = new Array(len); i < len; i++) {
3573 arr2[i] = arr[i];
3574 }
3575
3576 return arr2;
3577}
3578
3579function _unsupportedIterableToArray$4(o, minLen) {
3580 var _context;
3581
3582 if (!o) return;
3583 if (typeof o === "string") return _arrayLikeToArray$4(o, minLen);
3584
3585 var n = slice$1(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
3586
3587 if (n === "Object" && o.constructor) n = o.constructor.name;
3588 if (n === "Map" || n === "Set") return from(o);
3589 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$4(o, minLen);
3590}
3591
3592function _nonIterableRest() {
3593 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3594}
3595
3596function _slicedToArray(arr, i) {
3597 return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$4(arr, i) || _nonIterableRest();
3598}
3599
3600var WrappedWellKnownSymbolModule = wellKnownSymbolWrapped;
3601var iterator$5 = WrappedWellKnownSymbolModule.f('iterator');
3602
3603var parent$u = iterator$5;
3604var iterator$4 = parent$u;
3605
3606var parent$t = iterator$4;
3607var iterator$3 = parent$t;
3608
3609var parent$s = iterator$3;
3610var iterator$2 = parent$s;
3611
3612var iterator$1 = iterator$2;
3613
3614function _typeof(obj) {
3615 "@babel/helpers - typeof";
3616
3617 return _typeof = "function" == typeof symbol$1 && "symbol" == typeof iterator$1 ? function (obj) {
3618 return typeof obj;
3619 } : function (obj) {
3620 return obj && "function" == typeof symbol$1 && obj.constructor === symbol$1 && obj !== symbol$1.prototype ? "symbol" : typeof obj;
3621 }, _typeof(obj);
3622}
3623
3624function _arrayWithoutHoles(arr) {
3625 if (isArray$4(arr)) return _arrayLikeToArray$4(arr);
3626}
3627
3628function _iterableToArray(iter) {
3629 if (typeof symbol$1 !== "undefined" && getIteratorMethod$1(iter) != null || iter["@@iterator"] != null) return from(iter);
3630}
3631
3632function _nonIterableSpread() {
3633 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
3634}
3635
3636function _toConsumableArray(arr) {
3637 return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$4(arr) || _nonIterableSpread();
3638}
3639
3640var symbol = symbol$4;
3641
3642var entryVirtual$d = entryVirtual$k;
3643var concat$4 = entryVirtual$d('Array').concat;
3644
3645var isPrototypeOf$a = objectIsPrototypeOf;
3646var method$8 = concat$4;
3647var ArrayPrototype$8 = Array.prototype;
3648
3649var concat$3 = function (it) {
3650 var own = it.concat;
3651 return it === ArrayPrototype$8 || isPrototypeOf$a(ArrayPrototype$8, it) && own === ArrayPrototype$8.concat ? method$8 : own;
3652};
3653
3654var parent$r = concat$3;
3655var concat$2 = parent$r;
3656
3657var concat$1 = concat$2;
3658
3659var slice = slice$4;
3660
3661var $$n = _export;
3662var ownKeys$4 = ownKeys$6; // `Reflect.ownKeys` method
3663// https://tc39.es/ecma262/#sec-reflect.ownkeys
3664
3665$$n({
3666 target: 'Reflect',
3667 stat: true
3668}, {
3669 ownKeys: ownKeys$4
3670});
3671
3672var path$d = path$q;
3673var ownKeys$3 = path$d.Reflect.ownKeys;
3674
3675var parent$q = ownKeys$3;
3676var ownKeys$2 = parent$q;
3677
3678var ownKeys$1 = ownKeys$2;
3679
3680var isArray$1 = isArray$7;
3681
3682var $$m = _export;
3683var toObject$5 = toObject$e;
3684var nativeKeys = objectKeys$4;
3685var fails$b = fails$r;
3686var FAILS_ON_PRIMITIVES$2 = fails$b(function () {
3687 nativeKeys(1);
3688}); // `Object.keys` method
3689// https://tc39.es/ecma262/#sec-object.keys
3690
3691$$m({
3692 target: 'Object',
3693 stat: true,
3694 forced: FAILS_ON_PRIMITIVES$2
3695}, {
3696 keys: function keys(it) {
3697 return nativeKeys(toObject$5(it));
3698 }
3699});
3700
3701var path$c = path$q;
3702var keys$6 = path$c.Object.keys;
3703
3704var parent$p = keys$6;
3705var keys$5 = parent$p;
3706
3707var keys$4 = keys$5;
3708
3709var $$l = _export;
3710var global$b = global$M;
3711var uncurryThis$a = functionUncurryThis;
3712var Date$1 = global$b.Date;
3713var getTime = uncurryThis$a(Date$1.prototype.getTime); // `Date.now` method
3714// https://tc39.es/ecma262/#sec-date.now
3715
3716$$l({
3717 target: 'Date',
3718 stat: true
3719}, {
3720 now: function now() {
3721 return getTime(new Date$1());
3722 }
3723});
3724
3725var path$b = path$q;
3726path$b.Date.now;
3727
3728var $forEach = arrayIteration.forEach;
3729var arrayMethodIsStrict$3 = arrayMethodIsStrict$5;
3730var STRICT_METHOD$3 = arrayMethodIsStrict$3('forEach'); // `Array.prototype.forEach` method implementation
3731// https://tc39.es/ecma262/#sec-array.prototype.foreach
3732
3733var arrayForEach = !STRICT_METHOD$3 ? function forEach(callbackfn
3734/* , thisArg */
3735) {
3736 return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined); // eslint-disable-next-line es/no-array-prototype-foreach -- safe
3737} : [].forEach;
3738
3739var $$k = _export;
3740var forEach$5 = arrayForEach; // `Array.prototype.forEach` method
3741// https://tc39.es/ecma262/#sec-array.prototype.foreach
3742// eslint-disable-next-line es/no-array-prototype-foreach -- safe
3743
3744$$k({
3745 target: 'Array',
3746 proto: true,
3747 forced: [].forEach != forEach$5
3748}, {
3749 forEach: forEach$5
3750});
3751
3752var entryVirtual$c = entryVirtual$k;
3753var forEach$4 = entryVirtual$c('Array').forEach;
3754
3755var parent$o = forEach$4;
3756var forEach$3 = parent$o;
3757
3758var classof$5 = classof$c;
3759var hasOwn$4 = hasOwnProperty_1;
3760var isPrototypeOf$9 = objectIsPrototypeOf;
3761var method$7 = forEach$3;
3762var ArrayPrototype$7 = Array.prototype;
3763var DOMIterables$3 = {
3764 DOMTokenList: true,
3765 NodeList: true
3766};
3767
3768var forEach$2 = function (it) {
3769 var own = it.forEach;
3770 return it === ArrayPrototype$7 || isPrototypeOf$9(ArrayPrototype$7, it) && own === ArrayPrototype$7.forEach || hasOwn$4(DOMIterables$3, classof$5(it)) ? method$7 : own;
3771};
3772
3773var forEach$1 = forEach$2;
3774
3775var $$j = _export;
3776var uncurryThis$9 = functionUncurryThis;
3777var isArray = isArray$d;
3778var un$Reverse = uncurryThis$9([].reverse);
3779var test$1 = [1, 2]; // `Array.prototype.reverse` method
3780// https://tc39.es/ecma262/#sec-array.prototype.reverse
3781// fix for Safari 12.0 bug
3782// https://bugs.webkit.org/show_bug.cgi?id=188794
3783
3784$$j({
3785 target: 'Array',
3786 proto: true,
3787 forced: String(test$1) === String(test$1.reverse())
3788}, {
3789 reverse: function reverse() {
3790 // eslint-disable-next-line no-self-assign -- dirty hack
3791 if (isArray(this)) this.length = this.length;
3792 return un$Reverse(this);
3793 }
3794});
3795
3796var entryVirtual$b = entryVirtual$k;
3797var reverse$3 = entryVirtual$b('Array').reverse;
3798
3799var isPrototypeOf$8 = objectIsPrototypeOf;
3800var method$6 = reverse$3;
3801var ArrayPrototype$6 = Array.prototype;
3802
3803var reverse$2 = function (it) {
3804 var own = it.reverse;
3805 return it === ArrayPrototype$6 || isPrototypeOf$8(ArrayPrototype$6, it) && own === ArrayPrototype$6.reverse ? method$6 : own;
3806};
3807
3808var parent$n = reverse$2;
3809var reverse$1 = parent$n;
3810
3811var reverse = reverse$1;
3812
3813var $$i = _export;
3814var global$a = global$M;
3815var toAbsoluteIndex$1 = toAbsoluteIndex$5;
3816var toIntegerOrInfinity = toIntegerOrInfinity$4;
3817var lengthOfArrayLike$3 = lengthOfArrayLike$d;
3818var toObject$4 = toObject$e;
3819var arraySpeciesCreate = arraySpeciesCreate$4;
3820var createProperty = createProperty$6;
3821var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5;
3822var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
3823var TypeError$6 = global$a.TypeError;
3824var max = Math.max;
3825var min = Math.min;
3826var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
3827var MAXIMUM_ALLOWED_LENGTH_EXCEEDED = 'Maximum allowed length exceeded'; // `Array.prototype.splice` method
3828// https://tc39.es/ecma262/#sec-array.prototype.splice
3829// with adding support of @@species
3830
3831$$i({
3832 target: 'Array',
3833 proto: true,
3834 forced: !HAS_SPECIES_SUPPORT
3835}, {
3836 splice: function splice(start, deleteCount
3837 /* , ...items */
3838 ) {
3839 var O = toObject$4(this);
3840 var len = lengthOfArrayLike$3(O);
3841 var actualStart = toAbsoluteIndex$1(start, len);
3842 var argumentsLength = arguments.length;
3843 var insertCount, actualDeleteCount, A, k, from, to;
3844
3845 if (argumentsLength === 0) {
3846 insertCount = actualDeleteCount = 0;
3847 } else if (argumentsLength === 1) {
3848 insertCount = 0;
3849 actualDeleteCount = len - actualStart;
3850 } else {
3851 insertCount = argumentsLength - 2;
3852 actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
3853 }
3854
3855 if (len + insertCount - actualDeleteCount > MAX_SAFE_INTEGER) {
3856 throw TypeError$6(MAXIMUM_ALLOWED_LENGTH_EXCEEDED);
3857 }
3858
3859 A = arraySpeciesCreate(O, actualDeleteCount);
3860
3861 for (k = 0; k < actualDeleteCount; k++) {
3862 from = actualStart + k;
3863 if (from in O) createProperty(A, k, O[from]);
3864 }
3865
3866 A.length = actualDeleteCount;
3867
3868 if (insertCount < actualDeleteCount) {
3869 for (k = actualStart; k < len - actualDeleteCount; k++) {
3870 from = k + actualDeleteCount;
3871 to = k + insertCount;
3872 if (from in O) O[to] = O[from];else delete O[to];
3873 }
3874
3875 for (k = len; k > len - actualDeleteCount + insertCount; k--) delete O[k - 1];
3876 } else if (insertCount > actualDeleteCount) {
3877 for (k = len - actualDeleteCount; k > actualStart; k--) {
3878 from = k + actualDeleteCount - 1;
3879 to = k + insertCount - 1;
3880 if (from in O) O[to] = O[from];else delete O[to];
3881 }
3882 }
3883
3884 for (k = 0; k < insertCount; k++) {
3885 O[k + actualStart] = arguments[k + 2];
3886 }
3887
3888 O.length = len - actualDeleteCount + insertCount;
3889 return A;
3890 }
3891});
3892
3893var entryVirtual$a = entryVirtual$k;
3894var splice$3 = entryVirtual$a('Array').splice;
3895
3896var isPrototypeOf$7 = objectIsPrototypeOf;
3897var method$5 = splice$3;
3898var ArrayPrototype$5 = Array.prototype;
3899
3900var splice$2 = function (it) {
3901 var own = it.splice;
3902 return it === ArrayPrototype$5 || isPrototypeOf$7(ArrayPrototype$5, it) && own === ArrayPrototype$5.splice ? method$5 : own;
3903};
3904
3905var parent$m = splice$2;
3906var splice$1 = parent$m;
3907
3908var splice = splice$1;
3909
3910var DESCRIPTORS$5 = descriptors;
3911var uncurryThis$8 = functionUncurryThis;
3912var call$1 = functionCall;
3913var fails$a = fails$r;
3914var objectKeys$1 = objectKeys$4;
3915var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
3916var propertyIsEnumerableModule = objectPropertyIsEnumerable;
3917var toObject$3 = toObject$e;
3918var IndexedObject = indexedObject; // eslint-disable-next-line es/no-object-assign -- safe
3919
3920var $assign = Object.assign; // eslint-disable-next-line es/no-object-defineproperty -- required for testing
3921
3922var defineProperty$3 = Object.defineProperty;
3923var concat = uncurryThis$8([].concat); // `Object.assign` method
3924// https://tc39.es/ecma262/#sec-object.assign
3925
3926var objectAssign = !$assign || fails$a(function () {
3927 // should have correct order of operations (Edge bug)
3928 if (DESCRIPTORS$5 && $assign({
3929 b: 1
3930 }, $assign(defineProperty$3({}, 'a', {
3931 enumerable: true,
3932 get: function () {
3933 defineProperty$3(this, 'b', {
3934 value: 3,
3935 enumerable: false
3936 });
3937 }
3938 }), {
3939 b: 2
3940 })).b !== 1) return true; // should work with symbols and should have deterministic property order (V8 bug)
3941
3942 var A = {};
3943 var B = {}; // eslint-disable-next-line es/no-symbol -- safe
3944
3945 var symbol = Symbol();
3946 var alphabet = 'abcdefghijklmnopqrst';
3947 A[symbol] = 7;
3948 alphabet.split('').forEach(function (chr) {
3949 B[chr] = chr;
3950 });
3951 return $assign({}, A)[symbol] != 7 || objectKeys$1($assign({}, B)).join('') != alphabet;
3952}) ? function assign(target, source) {
3953 // eslint-disable-line no-unused-vars -- required for `.length`
3954 var T = toObject$3(target);
3955 var argumentsLength = arguments.length;
3956 var index = 1;
3957 var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
3958 var propertyIsEnumerable = propertyIsEnumerableModule.f;
3959
3960 while (argumentsLength > index) {
3961 var S = IndexedObject(arguments[index++]);
3962 var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
3963 var length = keys.length;
3964 var j = 0;
3965 var key;
3966
3967 while (length > j) {
3968 key = keys[j++];
3969 if (!DESCRIPTORS$5 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
3970 }
3971 }
3972
3973 return T;
3974} : $assign;
3975
3976var $$h = _export;
3977var assign$5 = objectAssign; // `Object.assign` method
3978// https://tc39.es/ecma262/#sec-object.assign
3979// eslint-disable-next-line es/no-object-assign -- required for testing
3980
3981$$h({
3982 target: 'Object',
3983 stat: true,
3984 forced: Object.assign !== assign$5
3985}, {
3986 assign: assign$5
3987});
3988
3989var path$a = path$q;
3990var assign$4 = path$a.Object.assign;
3991
3992var parent$l = assign$4;
3993var assign$3 = parent$l;
3994
3995var assign$2 = assign$3;
3996
3997var $$g = _export;
3998var $includes = arrayIncludes.includes;
3999// https://tc39.es/ecma262/#sec-array.prototype.includes
4000
4001$$g({
4002 target: 'Array',
4003 proto: true
4004}, {
4005 includes: function includes(el
4006 /* , fromIndex = 0 */
4007 ) {
4008 return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
4009 }
4010}); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
4011
4012var entryVirtual$9 = entryVirtual$k;
4013entryVirtual$9('Array').includes;
4014
4015var isObject$4 = isObject$f;
4016var classof$4 = classofRaw$1;
4017var wellKnownSymbol$2 = wellKnownSymbol$j;
4018var MATCH$1 = wellKnownSymbol$2('match'); // `IsRegExp` abstract operation
4019// https://tc39.es/ecma262/#sec-isregexp
4020
4021var isRegexp = function (it) {
4022 var isRegExp;
4023 return isObject$4(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$4(it) == 'RegExp');
4024};
4025
4026var global$9 = global$M;
4027var isRegExp = isRegexp;
4028var TypeError$5 = global$9.TypeError;
4029
4030var notARegexp = function (it) {
4031 if (isRegExp(it)) {
4032 throw TypeError$5("The method doesn't accept regular expressions");
4033 }
4034
4035 return it;
4036};
4037
4038var wellKnownSymbol$1 = wellKnownSymbol$j;
4039var MATCH = wellKnownSymbol$1('match');
4040
4041var correctIsRegexpLogic = function (METHOD_NAME) {
4042 var regexp = /./;
4043
4044 try {
4045 '/./'[METHOD_NAME](regexp);
4046 } catch (error1) {
4047 try {
4048 regexp[MATCH] = false;
4049 return '/./'[METHOD_NAME](regexp);
4050 } catch (error2) {
4051 /* empty */
4052 }
4053 }
4054
4055 return false;
4056};
4057
4058var $$f = _export;
4059var uncurryThis$7 = functionUncurryThis;
4060var notARegExp = notARegexp;
4061var requireObjectCoercible$1 = requireObjectCoercible$5;
4062var toString$3 = toString$7;
4063var correctIsRegExpLogic = correctIsRegexpLogic;
4064var stringIndexOf = uncurryThis$7(''.indexOf); // `String.prototype.includes` method
4065// https://tc39.es/ecma262/#sec-string.prototype.includes
4066
4067$$f({
4068 target: 'String',
4069 proto: true,
4070 forced: !correctIsRegExpLogic('includes')
4071}, {
4072 includes: function includes(searchString
4073 /* , position = 0 */
4074 ) {
4075 return !!~stringIndexOf(toString$3(requireObjectCoercible$1(this)), toString$3(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : undefined);
4076 }
4077});
4078
4079var entryVirtual$8 = entryVirtual$k;
4080entryVirtual$8('String').includes;
4081
4082var $$e = _export;
4083var fails$9 = fails$r;
4084var toObject$2 = toObject$e;
4085var nativeGetPrototypeOf = objectGetPrototypeOf;
4086var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
4087var FAILS_ON_PRIMITIVES$1 = fails$9(function () {
4088 nativeGetPrototypeOf(1);
4089}); // `Object.getPrototypeOf` method
4090// https://tc39.es/ecma262/#sec-object.getprototypeof
4091
4092$$e({
4093 target: 'Object',
4094 stat: true,
4095 forced: FAILS_ON_PRIMITIVES$1,
4096 sham: !CORRECT_PROTOTYPE_GETTER
4097}, {
4098 getPrototypeOf: function getPrototypeOf(it) {
4099 return nativeGetPrototypeOf(toObject$2(it));
4100 }
4101});
4102
4103var path$9 = path$q;
4104var getPrototypeOf$4 = path$9.Object.getPrototypeOf;
4105
4106var parent$k = getPrototypeOf$4;
4107var getPrototypeOf$3 = parent$k;
4108
4109var DESCRIPTORS$4 = descriptors;
4110var uncurryThis$6 = functionUncurryThis;
4111var objectKeys = objectKeys$4;
4112var toIndexedObject = toIndexedObject$b;
4113var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
4114var propertyIsEnumerable = uncurryThis$6($propertyIsEnumerable);
4115var push$2 = uncurryThis$6([].push); // `Object.{ entries, values }` methods implementation
4116
4117var createMethod$1 = function (TO_ENTRIES) {
4118 return function (it) {
4119 var O = toIndexedObject(it);
4120 var keys = objectKeys(O);
4121 var length = keys.length;
4122 var i = 0;
4123 var result = [];
4124 var key;
4125
4126 while (length > i) {
4127 key = keys[i++];
4128
4129 if (!DESCRIPTORS$4 || propertyIsEnumerable(O, key)) {
4130 push$2(result, TO_ENTRIES ? [key, O[key]] : O[key]);
4131 }
4132 }
4133
4134 return result;
4135 };
4136};
4137
4138var objectToArray = {
4139 // `Object.entries` method
4140 // https://tc39.es/ecma262/#sec-object.entries
4141 entries: createMethod$1(true),
4142 // `Object.values` method
4143 // https://tc39.es/ecma262/#sec-object.values
4144 values: createMethod$1(false)
4145};
4146
4147var $$d = _export;
4148var $values = objectToArray.values; // `Object.values` method
4149// https://tc39.es/ecma262/#sec-object.values
4150
4151$$d({
4152 target: 'Object',
4153 stat: true
4154}, {
4155 values: function values(O) {
4156 return $values(O);
4157 }
4158});
4159
4160var path$8 = path$q;
4161path$8.Object.values;
4162
4163var whitespaces$3 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' + '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
4164
4165var uncurryThis$5 = functionUncurryThis;
4166var requireObjectCoercible = requireObjectCoercible$5;
4167var toString$2 = toString$7;
4168var whitespaces$2 = whitespaces$3;
4169var replace$1 = uncurryThis$5(''.replace);
4170var whitespace = '[' + whitespaces$2 + ']';
4171var ltrim = RegExp('^' + whitespace + whitespace + '*');
4172var rtrim = RegExp(whitespace + whitespace + '*$'); // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
4173
4174var createMethod = function (TYPE) {
4175 return function ($this) {
4176 var string = toString$2(requireObjectCoercible($this));
4177 if (TYPE & 1) string = replace$1(string, ltrim, '');
4178 if (TYPE & 2) string = replace$1(string, rtrim, '');
4179 return string;
4180 };
4181};
4182
4183var stringTrim = {
4184 // `String.prototype.{ trimLeft, trimStart }` methods
4185 // https://tc39.es/ecma262/#sec-string.prototype.trimstart
4186 start: createMethod(1),
4187 // `String.prototype.{ trimRight, trimEnd }` methods
4188 // https://tc39.es/ecma262/#sec-string.prototype.trimend
4189 end: createMethod(2),
4190 // `String.prototype.trim` method
4191 // https://tc39.es/ecma262/#sec-string.prototype.trim
4192 trim: createMethod(3)
4193};
4194
4195var global$8 = global$M;
4196var fails$8 = fails$r;
4197var uncurryThis$4 = functionUncurryThis;
4198var toString$1 = toString$7;
4199var trim = stringTrim.trim;
4200var whitespaces$1 = whitespaces$3;
4201var $parseInt$1 = global$8.parseInt;
4202var Symbol$1 = global$8.Symbol;
4203var ITERATOR = Symbol$1 && Symbol$1.iterator;
4204var hex = /^[+-]?0x/i;
4205var exec$1 = uncurryThis$4(hex.exec);
4206var FORCED$3 = $parseInt$1(whitespaces$1 + '08') !== 8 || $parseInt$1(whitespaces$1 + '0x16') !== 22 // MS Edge 18- broken with boxed symbols
4207|| ITERATOR && !fails$8(function () {
4208 $parseInt$1(Object(ITERATOR));
4209}); // `parseInt` method
4210// https://tc39.es/ecma262/#sec-parseint-string-radix
4211
4212var numberParseInt = FORCED$3 ? function parseInt(string, radix) {
4213 var S = trim(toString$1(string));
4214 return $parseInt$1(S, radix >>> 0 || (exec$1(hex, S) ? 16 : 10));
4215} : $parseInt$1;
4216
4217var $$c = _export;
4218var $parseInt = numberParseInt; // `parseInt` method
4219// https://tc39.es/ecma262/#sec-parseint-string-radix
4220
4221$$c({
4222 global: true,
4223 forced: parseInt != $parseInt
4224}, {
4225 parseInt: $parseInt
4226});
4227
4228var path$7 = path$q;
4229path$7.parseInt;
4230
4231/* eslint-disable es/no-array-prototype-indexof -- required for testing */
4232
4233
4234var $$b = _export;
4235var uncurryThis$3 = functionUncurryThis;
4236var $IndexOf = arrayIncludes.indexOf;
4237var arrayMethodIsStrict$2 = arrayMethodIsStrict$5;
4238var un$IndexOf = uncurryThis$3([].indexOf);
4239var NEGATIVE_ZERO = !!un$IndexOf && 1 / un$IndexOf([1], 1, -0) < 0;
4240var STRICT_METHOD$2 = arrayMethodIsStrict$2('indexOf'); // `Array.prototype.indexOf` method
4241// https://tc39.es/ecma262/#sec-array.prototype.indexof
4242
4243$$b({
4244 target: 'Array',
4245 proto: true,
4246 forced: NEGATIVE_ZERO || !STRICT_METHOD$2
4247}, {
4248 indexOf: function indexOf(searchElement
4249 /* , fromIndex = 0 */
4250 ) {
4251 var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
4252 return NEGATIVE_ZERO // convert -0 to +0
4253 ? un$IndexOf(this, searchElement, fromIndex) || 0 : $IndexOf(this, searchElement, fromIndex);
4254 }
4255});
4256
4257var entryVirtual$7 = entryVirtual$k;
4258entryVirtual$7('Array').indexOf;
4259
4260var PROPER_FUNCTION_NAME = functionName.PROPER;
4261var fails$7 = fails$r;
4262var whitespaces = whitespaces$3;
4263var non = '\u200B\u0085\u180E'; // check that a method works with the correct list
4264// of whitespaces and has a correct name
4265
4266var stringTrimForced = function (METHOD_NAME) {
4267 return fails$7(function () {
4268 return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME;
4269 });
4270};
4271
4272var $$a = _export;
4273var $trim = stringTrim.trim;
4274var forcedStringTrimMethod = stringTrimForced; // `String.prototype.trim` method
4275// https://tc39.es/ecma262/#sec-string.prototype.trim
4276
4277$$a({
4278 target: 'String',
4279 proto: true,
4280 forced: forcedStringTrimMethod('trim')
4281}, {
4282 trim: function trim() {
4283 return $trim(this);
4284 }
4285});
4286
4287var entryVirtual$6 = entryVirtual$k;
4288entryVirtual$6('String').trim;
4289
4290var $$9 = _export;
4291var DESCRIPTORS$3 = descriptors;
4292var create$8 = objectCreate; // `Object.create` method
4293// https://tc39.es/ecma262/#sec-object.create
4294
4295$$9({
4296 target: 'Object',
4297 stat: true,
4298 sham: !DESCRIPTORS$3
4299}, {
4300 create: create$8
4301});
4302
4303var path$6 = path$q;
4304var Object$1 = path$6.Object;
4305
4306var create$7 = function create(P, D) {
4307 return Object$1.create(P, D);
4308};
4309
4310var parent$j = create$7;
4311var create$6 = parent$j;
4312
4313var create$5 = create$6;
4314
4315var $$8 = _export;
4316var global$7 = global$M;
4317var getBuiltIn$2 = getBuiltIn$9;
4318var apply$3 = functionApply;
4319var uncurryThis$2 = functionUncurryThis;
4320var fails$6 = fails$r;
4321var Array$1 = global$7.Array;
4322var $stringify = getBuiltIn$2('JSON', 'stringify');
4323var exec = uncurryThis$2(/./.exec);
4324var charAt = uncurryThis$2(''.charAt);
4325var charCodeAt = uncurryThis$2(''.charCodeAt);
4326var replace = uncurryThis$2(''.replace);
4327var numberToString = uncurryThis$2(1.0.toString);
4328var tester = /[\uD800-\uDFFF]/g;
4329var low = /^[\uD800-\uDBFF]$/;
4330var hi = /^[\uDC00-\uDFFF]$/;
4331
4332var fix = function (match, offset, string) {
4333 var prev = charAt(string, offset - 1);
4334 var next = charAt(string, offset + 1);
4335
4336 if (exec(low, match) && !exec(hi, next) || exec(hi, match) && !exec(low, prev)) {
4337 return '\\u' + numberToString(charCodeAt(match, 0), 16);
4338 }
4339
4340 return match;
4341};
4342
4343var FORCED$2 = fails$6(function () {
4344 return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"' || $stringify('\uDEAD') !== '"\\udead"';
4345});
4346
4347if ($stringify) {
4348 // `JSON.stringify` method
4349 // https://tc39.es/ecma262/#sec-json.stringify
4350 // https://github.com/tc39/proposal-well-formed-stringify
4351 $$8({
4352 target: 'JSON',
4353 stat: true,
4354 forced: FORCED$2
4355 }, {
4356 // eslint-disable-next-line no-unused-vars -- required for `.length`
4357 stringify: function stringify(it, replacer, space) {
4358 for (var i = 0, l = arguments.length, args = Array$1(l); i < l; i++) args[i] = arguments[i];
4359
4360 var result = apply$3($stringify, null, args);
4361 return typeof result == 'string' ? replace(result, tester, fix) : result;
4362 }
4363 });
4364}
4365
4366var path$5 = path$q;
4367var apply$2 = functionApply; // eslint-disable-next-line es/no-json -- safe
4368
4369if (!path$5.JSON) path$5.JSON = {
4370 stringify: JSON.stringify
4371}; // eslint-disable-next-line no-unused-vars -- required for `.length`
4372
4373var stringify$3 = function stringify(it, replacer, space) {
4374 return apply$2(path$5.JSON.stringify, null, arguments);
4375};
4376
4377var parent$i = stringify$3;
4378var stringify$2 = parent$i;
4379
4380var stringify$1 = stringify$2;
4381
4382var global$6 = global$M;
4383var TypeError$4 = global$6.TypeError;
4384
4385var validateArgumentsLength$1 = function (passed, required) {
4386 if (passed < required) throw TypeError$4('Not enough arguments');
4387 return passed;
4388};
4389
4390var $$7 = _export;
4391var global$5 = global$M;
4392var apply$1 = functionApply;
4393var isCallable$1 = isCallable$h;
4394var userAgent$2 = engineUserAgent;
4395var arraySlice$1 = arraySlice$5;
4396var validateArgumentsLength = validateArgumentsLength$1;
4397var MSIE = /MSIE .\./.test(userAgent$2); // <- dirty ie9- check
4398
4399var Function$1 = global$5.Function;
4400
4401var wrap = function (scheduler) {
4402 return function (handler, timeout
4403 /* , ...arguments */
4404 ) {
4405 var boundArgs = validateArgumentsLength(arguments.length, 1) > 2;
4406 var fn = isCallable$1(handler) ? handler : Function$1(handler);
4407 var args = boundArgs ? arraySlice$1(arguments, 2) : undefined;
4408 return scheduler(boundArgs ? function () {
4409 apply$1(fn, this, args);
4410 } : fn, timeout);
4411 };
4412}; // ie9- setTimeout & setInterval additional parameters fix
4413// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
4414
4415
4416$$7({
4417 global: true,
4418 bind: true,
4419 forced: MSIE
4420}, {
4421 // `setTimeout` method
4422 // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
4423 setTimeout: wrap(global$5.setTimeout),
4424 // `setInterval` method
4425 // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
4426 setInterval: wrap(global$5.setInterval)
4427});
4428
4429var path$4 = path$q;
4430var setTimeout$2 = path$4.setTimeout;
4431
4432var setTimeout$1 = setTimeout$2;
4433
4434var toObject$1 = toObject$e;
4435var toAbsoluteIndex = toAbsoluteIndex$5;
4436var lengthOfArrayLike$2 = lengthOfArrayLike$d; // `Array.prototype.fill` method implementation
4437// https://tc39.es/ecma262/#sec-array.prototype.fill
4438
4439var arrayFill = function fill(value
4440/* , start = 0, end = @length */
4441) {
4442 var O = toObject$1(this);
4443 var length = lengthOfArrayLike$2(O);
4444 var argumentsLength = arguments.length;
4445 var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
4446 var end = argumentsLength > 2 ? arguments[2] : undefined;
4447 var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
4448
4449 while (endPos > index) O[index++] = value;
4450
4451 return O;
4452};
4453
4454var $$6 = _export;
4455var fill = arrayFill;
4456// https://tc39.es/ecma262/#sec-array.prototype.fill
4457
4458$$6({
4459 target: 'Array',
4460 proto: true
4461}, {
4462 fill: fill
4463}); // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
4464
4465var entryVirtual$5 = entryVirtual$k;
4466entryVirtual$5('Array').fill;
4467
4468var componentEmitter = {exports: {}};
4469
4470(function (module) {
4471 /**
4472 * Expose `Emitter`.
4473 */
4474 {
4475 module.exports = Emitter;
4476 }
4477 /**
4478 * Initialize a new `Emitter`.
4479 *
4480 * @api public
4481 */
4482
4483
4484 function Emitter(obj) {
4485 if (obj) return mixin(obj);
4486 }
4487 /**
4488 * Mixin the emitter properties.
4489 *
4490 * @param {Object} obj
4491 * @return {Object}
4492 * @api private
4493 */
4494
4495 function mixin(obj) {
4496 for (var key in Emitter.prototype) {
4497 obj[key] = Emitter.prototype[key];
4498 }
4499
4500 return obj;
4501 }
4502 /**
4503 * Listen on the given `event` with `fn`.
4504 *
4505 * @param {String} event
4506 * @param {Function} fn
4507 * @return {Emitter}
4508 * @api public
4509 */
4510
4511
4512 Emitter.prototype.on = Emitter.prototype.addEventListener = function (event, fn) {
4513 this._callbacks = this._callbacks || {};
4514 (this._callbacks['$' + event] = this._callbacks['$' + event] || []).push(fn);
4515 return this;
4516 };
4517 /**
4518 * Adds an `event` listener that will be invoked a single
4519 * time then automatically removed.
4520 *
4521 * @param {String} event
4522 * @param {Function} fn
4523 * @return {Emitter}
4524 * @api public
4525 */
4526
4527
4528 Emitter.prototype.once = function (event, fn) {
4529 function on() {
4530 this.off(event, on);
4531 fn.apply(this, arguments);
4532 }
4533
4534 on.fn = fn;
4535 this.on(event, on);
4536 return this;
4537 };
4538 /**
4539 * Remove the given callback for `event` or all
4540 * registered callbacks.
4541 *
4542 * @param {String} event
4543 * @param {Function} fn
4544 * @return {Emitter}
4545 * @api public
4546 */
4547
4548
4549 Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function (event, fn) {
4550 this._callbacks = this._callbacks || {}; // all
4551
4552 if (0 == arguments.length) {
4553 this._callbacks = {};
4554 return this;
4555 } // specific event
4556
4557
4558 var callbacks = this._callbacks['$' + event];
4559 if (!callbacks) return this; // remove all handlers
4560
4561 if (1 == arguments.length) {
4562 delete this._callbacks['$' + event];
4563 return this;
4564 } // remove specific handler
4565
4566
4567 var cb;
4568
4569 for (var i = 0; i < callbacks.length; i++) {
4570 cb = callbacks[i];
4571
4572 if (cb === fn || cb.fn === fn) {
4573 callbacks.splice(i, 1);
4574 break;
4575 }
4576 } // Remove event specific arrays for event types that no
4577 // one is subscribed for to avoid memory leak.
4578
4579
4580 if (callbacks.length === 0) {
4581 delete this._callbacks['$' + event];
4582 }
4583
4584 return this;
4585 };
4586 /**
4587 * Emit `event` with the given args.
4588 *
4589 * @param {String} event
4590 * @param {Mixed} ...
4591 * @return {Emitter}
4592 */
4593
4594
4595 Emitter.prototype.emit = function (event) {
4596 this._callbacks = this._callbacks || {};
4597 var args = new Array(arguments.length - 1),
4598 callbacks = this._callbacks['$' + event];
4599
4600 for (var i = 1; i < arguments.length; i++) {
4601 args[i - 1] = arguments[i];
4602 }
4603
4604 if (callbacks) {
4605 callbacks = callbacks.slice(0);
4606
4607 for (var i = 0, len = callbacks.length; i < len; ++i) {
4608 callbacks[i].apply(this, args);
4609 }
4610 }
4611
4612 return this;
4613 };
4614 /**
4615 * Return array of callbacks for `event`.
4616 *
4617 * @param {String} event
4618 * @return {Array}
4619 * @api public
4620 */
4621
4622
4623 Emitter.prototype.listeners = function (event) {
4624 this._callbacks = this._callbacks || {};
4625 return this._callbacks['$' + event] || [];
4626 };
4627 /**
4628 * Check if this emitter has `event` handlers.
4629 *
4630 * @param {String} event
4631 * @return {Boolean}
4632 * @api public
4633 */
4634
4635
4636 Emitter.prototype.hasListeners = function (event) {
4637 return !!this.listeners(event).length;
4638 };
4639})(componentEmitter);
4640
4641var Emitter = componentEmitter.exports;
4642
4643/*! Hammer.JS - v2.0.17-rc - 2019-12-16
4644 * http://naver.github.io/egjs
4645 *
4646 * Forked By Naver egjs
4647 * Copyright (c) hammerjs
4648 * Licensed under the MIT license */
4649function _extends() {
4650 _extends = Object.assign || function (target) {
4651 for (var i = 1; i < arguments.length; i++) {
4652 var source = arguments[i];
4653
4654 for (var key in source) {
4655 if (Object.prototype.hasOwnProperty.call(source, key)) {
4656 target[key] = source[key];
4657 }
4658 }
4659 }
4660
4661 return target;
4662 };
4663
4664 return _extends.apply(this, arguments);
4665}
4666
4667function _inheritsLoose(subClass, superClass) {
4668 subClass.prototype = Object.create(superClass.prototype);
4669 subClass.prototype.constructor = subClass;
4670 subClass.__proto__ = superClass;
4671}
4672
4673function _assertThisInitialized$1(self) {
4674 if (self === void 0) {
4675 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
4676 }
4677
4678 return self;
4679}
4680/**
4681 * @private
4682 * extend object.
4683 * means that properties in dest will be overwritten by the ones in src.
4684 * @param {Object} target
4685 * @param {...Object} objects_to_assign
4686 * @returns {Object} target
4687 */
4688
4689
4690var assign;
4691
4692if (typeof Object.assign !== 'function') {
4693 assign = function assign(target) {
4694 if (target === undefined || target === null) {
4695 throw new TypeError('Cannot convert undefined or null to object');
4696 }
4697
4698 var output = Object(target);
4699
4700 for (var index = 1; index < arguments.length; index++) {
4701 var source = arguments[index];
4702
4703 if (source !== undefined && source !== null) {
4704 for (var nextKey in source) {
4705 if (source.hasOwnProperty(nextKey)) {
4706 output[nextKey] = source[nextKey];
4707 }
4708 }
4709 }
4710 }
4711
4712 return output;
4713 };
4714} else {
4715 assign = Object.assign;
4716}
4717
4718var assign$1 = assign;
4719var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
4720var TEST_ELEMENT = typeof document === "undefined" ? {
4721 style: {}
4722} : document.createElement('div');
4723var TYPE_FUNCTION = 'function';
4724var round = Math.round,
4725 abs = Math.abs;
4726var now = Date.now;
4727/**
4728 * @private
4729 * get the prefixed property
4730 * @param {Object} obj
4731 * @param {String} property
4732 * @returns {String|Undefined} prefixed
4733 */
4734
4735function prefixed(obj, property) {
4736 var prefix;
4737 var prop;
4738 var camelProp = property[0].toUpperCase() + property.slice(1);
4739 var i = 0;
4740
4741 while (i < VENDOR_PREFIXES.length) {
4742 prefix = VENDOR_PREFIXES[i];
4743 prop = prefix ? prefix + camelProp : property;
4744
4745 if (prop in obj) {
4746 return prop;
4747 }
4748
4749 i++;
4750 }
4751
4752 return undefined;
4753}
4754/* eslint-disable no-new-func, no-nested-ternary */
4755
4756
4757var win;
4758
4759if (typeof window === "undefined") {
4760 // window is undefined in node.js
4761 win = {};
4762} else {
4763 win = window;
4764}
4765
4766var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
4767var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
4768
4769function getTouchActionProps() {
4770 if (!NATIVE_TOUCH_ACTION) {
4771 return false;
4772 }
4773
4774 var touchMap = {};
4775 var cssSupports = win.CSS && win.CSS.supports;
4776 ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function (val) {
4777 // If css.supports is not supported but there is native touch-action assume it supports
4778 // all values. This is the case for IE 10 and 11.
4779 return touchMap[val] = cssSupports ? win.CSS.supports('touch-action', val) : true;
4780 });
4781 return touchMap;
4782}
4783
4784var TOUCH_ACTION_COMPUTE = 'compute';
4785var TOUCH_ACTION_AUTO = 'auto';
4786var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
4787
4788var TOUCH_ACTION_NONE = 'none';
4789var TOUCH_ACTION_PAN_X = 'pan-x';
4790var TOUCH_ACTION_PAN_Y = 'pan-y';
4791var TOUCH_ACTION_MAP = getTouchActionProps();
4792var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
4793var SUPPORT_TOUCH = ('ontouchstart' in win);
4794var SUPPORT_POINTER_EVENTS = prefixed(win, 'PointerEvent') !== undefined;
4795var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
4796var INPUT_TYPE_TOUCH = 'touch';
4797var INPUT_TYPE_PEN = 'pen';
4798var INPUT_TYPE_MOUSE = 'mouse';
4799var INPUT_TYPE_KINECT = 'kinect';
4800var COMPUTE_INTERVAL = 25;
4801var INPUT_START = 1;
4802var INPUT_MOVE = 2;
4803var INPUT_END = 4;
4804var INPUT_CANCEL = 8;
4805var DIRECTION_NONE = 1;
4806var DIRECTION_LEFT = 2;
4807var DIRECTION_RIGHT = 4;
4808var DIRECTION_UP = 8;
4809var DIRECTION_DOWN = 16;
4810var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
4811var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
4812var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
4813var PROPS_XY = ['x', 'y'];
4814var PROPS_CLIENT_XY = ['clientX', 'clientY'];
4815/**
4816 * @private
4817 * walk objects and arrays
4818 * @param {Object} obj
4819 * @param {Function} iterator
4820 * @param {Object} context
4821 */
4822
4823function each(obj, iterator, context) {
4824 var i;
4825
4826 if (!obj) {
4827 return;
4828 }
4829
4830 if (obj.forEach) {
4831 obj.forEach(iterator, context);
4832 } else if (obj.length !== undefined) {
4833 i = 0;
4834
4835 while (i < obj.length) {
4836 iterator.call(context, obj[i], i, obj);
4837 i++;
4838 }
4839 } else {
4840 for (i in obj) {
4841 obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
4842 }
4843 }
4844}
4845/**
4846 * @private
4847 * let a boolean value also be a function that must return a boolean
4848 * this first item in args will be used as the context
4849 * @param {Boolean|Function} val
4850 * @param {Array} [args]
4851 * @returns {Boolean}
4852 */
4853
4854
4855function boolOrFn(val, args) {
4856 if (typeof val === TYPE_FUNCTION) {
4857 return val.apply(args ? args[0] || undefined : undefined, args);
4858 }
4859
4860 return val;
4861}
4862/**
4863 * @private
4864 * small indexOf wrapper
4865 * @param {String} str
4866 * @param {String} find
4867 * @returns {Boolean} found
4868 */
4869
4870
4871function inStr(str, find) {
4872 return str.indexOf(find) > -1;
4873}
4874/**
4875 * @private
4876 * when the touchActions are collected they are not a valid value, so we need to clean things up. *
4877 * @param {String} actions
4878 * @returns {*}
4879 */
4880
4881
4882function cleanTouchActions(actions) {
4883 // none
4884 if (inStr(actions, TOUCH_ACTION_NONE)) {
4885 return TOUCH_ACTION_NONE;
4886 }
4887
4888 var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
4889 var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); // if both pan-x and pan-y are set (different recognizers
4890 // for different directions, e.g. horizontal pan but vertical swipe?)
4891 // we need none (as otherwise with pan-x pan-y combined none of these
4892 // recognizers will work, since the browser would handle all panning
4893
4894 if (hasPanX && hasPanY) {
4895 return TOUCH_ACTION_NONE;
4896 } // pan-x OR pan-y
4897
4898
4899 if (hasPanX || hasPanY) {
4900 return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
4901 } // manipulation
4902
4903
4904 if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
4905 return TOUCH_ACTION_MANIPULATION;
4906 }
4907
4908 return TOUCH_ACTION_AUTO;
4909}
4910/**
4911 * @private
4912 * Touch Action
4913 * sets the touchAction property or uses the js alternative
4914 * @param {Manager} manager
4915 * @param {String} value
4916 * @constructor
4917 */
4918
4919
4920var TouchAction = /*#__PURE__*/function () {
4921 function TouchAction(manager, value) {
4922 this.manager = manager;
4923 this.set(value);
4924 }
4925 /**
4926 * @private
4927 * set the touchAction value on the element or enable the polyfill
4928 * @param {String} value
4929 */
4930
4931
4932 var _proto = TouchAction.prototype;
4933
4934 _proto.set = function set(value) {
4935 // find out the touch-action by the event handlers
4936 if (value === TOUCH_ACTION_COMPUTE) {
4937 value = this.compute();
4938 }
4939
4940 if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
4941 this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
4942 }
4943
4944 this.actions = value.toLowerCase().trim();
4945 };
4946 /**
4947 * @private
4948 * just re-set the touchAction value
4949 */
4950
4951
4952 _proto.update = function update() {
4953 this.set(this.manager.options.touchAction);
4954 };
4955 /**
4956 * @private
4957 * compute the value for the touchAction property based on the recognizer's settings
4958 * @returns {String} value
4959 */
4960
4961
4962 _proto.compute = function compute() {
4963 var actions = [];
4964 each(this.manager.recognizers, function (recognizer) {
4965 if (boolOrFn(recognizer.options.enable, [recognizer])) {
4966 actions = actions.concat(recognizer.getTouchAction());
4967 }
4968 });
4969 return cleanTouchActions(actions.join(' '));
4970 };
4971 /**
4972 * @private
4973 * this method is called on each input cycle and provides the preventing of the browser behavior
4974 * @param {Object} input
4975 */
4976
4977
4978 _proto.preventDefaults = function preventDefaults(input) {
4979 var srcEvent = input.srcEvent;
4980 var direction = input.offsetDirection; // if the touch action did prevented once this session
4981
4982 if (this.manager.session.prevented) {
4983 srcEvent.preventDefault();
4984 return;
4985 }
4986
4987 var actions = this.actions;
4988 var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
4989 var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
4990 var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
4991
4992 if (hasNone) {
4993 // do not prevent defaults if this is a tap gesture
4994 var isTapPointer = input.pointers.length === 1;
4995 var isTapMovement = input.distance < 2;
4996 var isTapTouchTime = input.deltaTime < 250;
4997
4998 if (isTapPointer && isTapMovement && isTapTouchTime) {
4999 return;
5000 }
5001 }
5002
5003 if (hasPanX && hasPanY) {
5004 // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
5005 return;
5006 }
5007
5008 if (hasNone || hasPanY && direction & DIRECTION_HORIZONTAL || hasPanX && direction & DIRECTION_VERTICAL) {
5009 return this.preventSrc(srcEvent);
5010 }
5011 };
5012 /**
5013 * @private
5014 * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
5015 * @param {Object} srcEvent
5016 */
5017
5018
5019 _proto.preventSrc = function preventSrc(srcEvent) {
5020 this.manager.session.prevented = true;
5021 srcEvent.preventDefault();
5022 };
5023
5024 return TouchAction;
5025}();
5026/**
5027 * @private
5028 * find if a node is in the given parent
5029 * @method hasParent
5030 * @param {HTMLElement} node
5031 * @param {HTMLElement} parent
5032 * @return {Boolean} found
5033 */
5034
5035
5036function hasParent(node, parent) {
5037 while (node) {
5038 if (node === parent) {
5039 return true;
5040 }
5041
5042 node = node.parentNode;
5043 }
5044
5045 return false;
5046}
5047/**
5048 * @private
5049 * get the center of all the pointers
5050 * @param {Array} pointers
5051 * @return {Object} center contains `x` and `y` properties
5052 */
5053
5054
5055function getCenter(pointers) {
5056 var pointersLength = pointers.length; // no need to loop when only one touch
5057
5058 if (pointersLength === 1) {
5059 return {
5060 x: round(pointers[0].clientX),
5061 y: round(pointers[0].clientY)
5062 };
5063 }
5064
5065 var x = 0;
5066 var y = 0;
5067 var i = 0;
5068
5069 while (i < pointersLength) {
5070 x += pointers[i].clientX;
5071 y += pointers[i].clientY;
5072 i++;
5073 }
5074
5075 return {
5076 x: round(x / pointersLength),
5077 y: round(y / pointersLength)
5078 };
5079}
5080/**
5081 * @private
5082 * create a simple clone from the input used for storage of firstInput and firstMultiple
5083 * @param {Object} input
5084 * @returns {Object} clonedInputData
5085 */
5086
5087
5088function simpleCloneInputData(input) {
5089 // make a simple copy of the pointers because we will get a reference if we don't
5090 // we only need clientXY for the calculations
5091 var pointers = [];
5092 var i = 0;
5093
5094 while (i < input.pointers.length) {
5095 pointers[i] = {
5096 clientX: round(input.pointers[i].clientX),
5097 clientY: round(input.pointers[i].clientY)
5098 };
5099 i++;
5100 }
5101
5102 return {
5103 timeStamp: now(),
5104 pointers: pointers,
5105 center: getCenter(pointers),
5106 deltaX: input.deltaX,
5107 deltaY: input.deltaY
5108 };
5109}
5110/**
5111 * @private
5112 * calculate the absolute distance between two points
5113 * @param {Object} p1 {x, y}
5114 * @param {Object} p2 {x, y}
5115 * @param {Array} [props] containing x and y keys
5116 * @return {Number} distance
5117 */
5118
5119
5120function getDistance(p1, p2, props) {
5121 if (!props) {
5122 props = PROPS_XY;
5123 }
5124
5125 var x = p2[props[0]] - p1[props[0]];
5126 var y = p2[props[1]] - p1[props[1]];
5127 return Math.sqrt(x * x + y * y);
5128}
5129/**
5130 * @private
5131 * calculate the angle between two coordinates
5132 * @param {Object} p1
5133 * @param {Object} p2
5134 * @param {Array} [props] containing x and y keys
5135 * @return {Number} angle
5136 */
5137
5138
5139function getAngle(p1, p2, props) {
5140 if (!props) {
5141 props = PROPS_XY;
5142 }
5143
5144 var x = p2[props[0]] - p1[props[0]];
5145 var y = p2[props[1]] - p1[props[1]];
5146 return Math.atan2(y, x) * 180 / Math.PI;
5147}
5148/**
5149 * @private
5150 * get the direction between two points
5151 * @param {Number} x
5152 * @param {Number} y
5153 * @return {Number} direction
5154 */
5155
5156
5157function getDirection(x, y) {
5158 if (x === y) {
5159 return DIRECTION_NONE;
5160 }
5161
5162 if (abs(x) >= abs(y)) {
5163 return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
5164 }
5165
5166 return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
5167}
5168
5169function computeDeltaXY(session, input) {
5170 var center = input.center; // let { offsetDelta:offset = {}, prevDelta = {}, prevInput = {} } = session;
5171 // jscs throwing error on defalut destructured values and without defaults tests fail
5172
5173 var offset = session.offsetDelta || {};
5174 var prevDelta = session.prevDelta || {};
5175 var prevInput = session.prevInput || {};
5176
5177 if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
5178 prevDelta = session.prevDelta = {
5179 x: prevInput.deltaX || 0,
5180 y: prevInput.deltaY || 0
5181 };
5182 offset = session.offsetDelta = {
5183 x: center.x,
5184 y: center.y
5185 };
5186 }
5187
5188 input.deltaX = prevDelta.x + (center.x - offset.x);
5189 input.deltaY = prevDelta.y + (center.y - offset.y);
5190}
5191/**
5192 * @private
5193 * calculate the velocity between two points. unit is in px per ms.
5194 * @param {Number} deltaTime
5195 * @param {Number} x
5196 * @param {Number} y
5197 * @return {Object} velocity `x` and `y`
5198 */
5199
5200
5201function getVelocity(deltaTime, x, y) {
5202 return {
5203 x: x / deltaTime || 0,
5204 y: y / deltaTime || 0
5205 };
5206}
5207/**
5208 * @private
5209 * calculate the scale factor between two pointersets
5210 * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
5211 * @param {Array} start array of pointers
5212 * @param {Array} end array of pointers
5213 * @return {Number} scale
5214 */
5215
5216
5217function getScale(start, end) {
5218 return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
5219}
5220/**
5221 * @private
5222 * calculate the rotation degrees between two pointersets
5223 * @param {Array} start array of pointers
5224 * @param {Array} end array of pointers
5225 * @return {Number} rotation
5226 */
5227
5228
5229function getRotation(start, end) {
5230 return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
5231}
5232/**
5233 * @private
5234 * velocity is calculated every x ms
5235 * @param {Object} session
5236 * @param {Object} input
5237 */
5238
5239
5240function computeIntervalInputData(session, input) {
5241 var last = session.lastInterval || input;
5242 var deltaTime = input.timeStamp - last.timeStamp;
5243 var velocity;
5244 var velocityX;
5245 var velocityY;
5246 var direction;
5247
5248 if (input.eventType !== INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
5249 var deltaX = input.deltaX - last.deltaX;
5250 var deltaY = input.deltaY - last.deltaY;
5251 var v = getVelocity(deltaTime, deltaX, deltaY);
5252 velocityX = v.x;
5253 velocityY = v.y;
5254 velocity = abs(v.x) > abs(v.y) ? v.x : v.y;
5255 direction = getDirection(deltaX, deltaY);
5256 session.lastInterval = input;
5257 } else {
5258 // use latest velocity info if it doesn't overtake a minimum period
5259 velocity = last.velocity;
5260 velocityX = last.velocityX;
5261 velocityY = last.velocityY;
5262 direction = last.direction;
5263 }
5264
5265 input.velocity = velocity;
5266 input.velocityX = velocityX;
5267 input.velocityY = velocityY;
5268 input.direction = direction;
5269}
5270/**
5271* @private
5272 * extend the data with some usable properties like scale, rotate, velocity etc
5273 * @param {Object} manager
5274 * @param {Object} input
5275 */
5276
5277
5278function computeInputData(manager, input) {
5279 var session = manager.session;
5280 var pointers = input.pointers;
5281 var pointersLength = pointers.length; // store the first input to calculate the distance and direction
5282
5283 if (!session.firstInput) {
5284 session.firstInput = simpleCloneInputData(input);
5285 } // to compute scale and rotation we need to store the multiple touches
5286
5287
5288 if (pointersLength > 1 && !session.firstMultiple) {
5289 session.firstMultiple = simpleCloneInputData(input);
5290 } else if (pointersLength === 1) {
5291 session.firstMultiple = false;
5292 }
5293
5294 var firstInput = session.firstInput,
5295 firstMultiple = session.firstMultiple;
5296 var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
5297 var center = input.center = getCenter(pointers);
5298 input.timeStamp = now();
5299 input.deltaTime = input.timeStamp - firstInput.timeStamp;
5300 input.angle = getAngle(offsetCenter, center);
5301 input.distance = getDistance(offsetCenter, center);
5302 computeDeltaXY(session, input);
5303 input.offsetDirection = getDirection(input.deltaX, input.deltaY);
5304 var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
5305 input.overallVelocityX = overallVelocity.x;
5306 input.overallVelocityY = overallVelocity.y;
5307 input.overallVelocity = abs(overallVelocity.x) > abs(overallVelocity.y) ? overallVelocity.x : overallVelocity.y;
5308 input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
5309 input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
5310 input.maxPointers = !session.prevInput ? input.pointers.length : input.pointers.length > session.prevInput.maxPointers ? input.pointers.length : session.prevInput.maxPointers;
5311 computeIntervalInputData(session, input); // find the correct target
5312
5313 var target = manager.element;
5314 var srcEvent = input.srcEvent;
5315 var srcEventTarget;
5316
5317 if (srcEvent.composedPath) {
5318 srcEventTarget = srcEvent.composedPath()[0];
5319 } else if (srcEvent.path) {
5320 srcEventTarget = srcEvent.path[0];
5321 } else {
5322 srcEventTarget = srcEvent.target;
5323 }
5324
5325 if (hasParent(srcEventTarget, target)) {
5326 target = srcEventTarget;
5327 }
5328
5329 input.target = target;
5330}
5331/**
5332 * @private
5333 * handle input events
5334 * @param {Manager} manager
5335 * @param {String} eventType
5336 * @param {Object} input
5337 */
5338
5339
5340function inputHandler(manager, eventType, input) {
5341 var pointersLen = input.pointers.length;
5342 var changedPointersLen = input.changedPointers.length;
5343 var isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0;
5344 var isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0;
5345 input.isFirst = !!isFirst;
5346 input.isFinal = !!isFinal;
5347
5348 if (isFirst) {
5349 manager.session = {};
5350 } // source event is the normalized value of the domEvents
5351 // like 'touchstart, mouseup, pointerdown'
5352
5353
5354 input.eventType = eventType; // compute scale, rotation etc
5355
5356 computeInputData(manager, input); // emit secret event
5357
5358 manager.emit('hammer.input', input);
5359 manager.recognize(input);
5360 manager.session.prevInput = input;
5361}
5362/**
5363 * @private
5364 * split string on whitespace
5365 * @param {String} str
5366 * @returns {Array} words
5367 */
5368
5369
5370function splitStr(str) {
5371 return str.trim().split(/\s+/g);
5372}
5373/**
5374 * @private
5375 * addEventListener with multiple events at once
5376 * @param {EventTarget} target
5377 * @param {String} types
5378 * @param {Function} handler
5379 */
5380
5381
5382function addEventListeners(target, types, handler) {
5383 each(splitStr(types), function (type) {
5384 target.addEventListener(type, handler, false);
5385 });
5386}
5387/**
5388 * @private
5389 * removeEventListener with multiple events at once
5390 * @param {EventTarget} target
5391 * @param {String} types
5392 * @param {Function} handler
5393 */
5394
5395
5396function removeEventListeners(target, types, handler) {
5397 each(splitStr(types), function (type) {
5398 target.removeEventListener(type, handler, false);
5399 });
5400}
5401/**
5402 * @private
5403 * get the window object of an element
5404 * @param {HTMLElement} element
5405 * @returns {DocumentView|Window}
5406 */
5407
5408
5409function getWindowForElement(element) {
5410 var doc = element.ownerDocument || element;
5411 return doc.defaultView || doc.parentWindow || window;
5412}
5413/**
5414 * @private
5415 * create new input type manager
5416 * @param {Manager} manager
5417 * @param {Function} callback
5418 * @returns {Input}
5419 * @constructor
5420 */
5421
5422
5423var Input = /*#__PURE__*/function () {
5424 function Input(manager, callback) {
5425 var self = this;
5426 this.manager = manager;
5427 this.callback = callback;
5428 this.element = manager.element;
5429 this.target = manager.options.inputTarget; // smaller wrapper around the handler, for the scope and the enabled state of the manager,
5430 // so when disabled the input events are completely bypassed.
5431
5432 this.domHandler = function (ev) {
5433 if (boolOrFn(manager.options.enable, [manager])) {
5434 self.handler(ev);
5435 }
5436 };
5437
5438 this.init();
5439 }
5440 /**
5441 * @private
5442 * should handle the inputEvent data and trigger the callback
5443 * @virtual
5444 */
5445
5446
5447 var _proto = Input.prototype;
5448
5449 _proto.handler = function handler() {};
5450 /**
5451 * @private
5452 * bind the events
5453 */
5454
5455
5456 _proto.init = function init() {
5457 this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
5458 this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
5459 this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
5460 };
5461 /**
5462 * @private
5463 * unbind the events
5464 */
5465
5466
5467 _proto.destroy = function destroy() {
5468 this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
5469 this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
5470 this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
5471 };
5472
5473 return Input;
5474}();
5475/**
5476 * @private
5477 * find if a array contains the object using indexOf or a simple polyFill
5478 * @param {Array} src
5479 * @param {String} find
5480 * @param {String} [findByKey]
5481 * @return {Boolean|Number} false when not found, or the index
5482 */
5483
5484
5485function inArray(src, find, findByKey) {
5486 if (src.indexOf && !findByKey) {
5487 return src.indexOf(find);
5488 } else {
5489 var i = 0;
5490
5491 while (i < src.length) {
5492 if (findByKey && src[i][findByKey] == find || !findByKey && src[i] === find) {
5493 // do not use === here, test fails
5494 return i;
5495 }
5496
5497 i++;
5498 }
5499
5500 return -1;
5501 }
5502}
5503
5504var POINTER_INPUT_MAP = {
5505 pointerdown: INPUT_START,
5506 pointermove: INPUT_MOVE,
5507 pointerup: INPUT_END,
5508 pointercancel: INPUT_CANCEL,
5509 pointerout: INPUT_CANCEL
5510}; // in IE10 the pointer types is defined as an enum
5511
5512var IE10_POINTER_TYPE_ENUM = {
5513 2: INPUT_TYPE_TOUCH,
5514 3: INPUT_TYPE_PEN,
5515 4: INPUT_TYPE_MOUSE,
5516 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
5517
5518};
5519var POINTER_ELEMENT_EVENTS = 'pointerdown';
5520var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel'; // IE10 has prefixed support, and case-sensitive
5521
5522if (win.MSPointerEvent && !win.PointerEvent) {
5523 POINTER_ELEMENT_EVENTS = 'MSPointerDown';
5524 POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
5525}
5526/**
5527 * @private
5528 * Pointer events input
5529 * @constructor
5530 * @extends Input
5531 */
5532
5533
5534var PointerEventInput = /*#__PURE__*/function (_Input) {
5535 _inheritsLoose(PointerEventInput, _Input);
5536
5537 function PointerEventInput() {
5538 var _this;
5539
5540 var proto = PointerEventInput.prototype;
5541 proto.evEl = POINTER_ELEMENT_EVENTS;
5542 proto.evWin = POINTER_WINDOW_EVENTS;
5543 _this = _Input.apply(this, arguments) || this;
5544 _this.store = _this.manager.session.pointerEvents = [];
5545 return _this;
5546 }
5547 /**
5548 * @private
5549 * handle mouse events
5550 * @param {Object} ev
5551 */
5552
5553
5554 var _proto = PointerEventInput.prototype;
5555
5556 _proto.handler = function handler(ev) {
5557 var store = this.store;
5558 var removePointer = false;
5559 var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
5560 var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
5561 var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
5562 var isTouch = pointerType === INPUT_TYPE_TOUCH; // get index of the event in the store
5563
5564 var storeIndex = inArray(store, ev.pointerId, 'pointerId'); // start and mouse must be down
5565
5566 if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
5567 if (storeIndex < 0) {
5568 store.push(ev);
5569 storeIndex = store.length - 1;
5570 }
5571 } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
5572 removePointer = true;
5573 } // it not found, so the pointer hasn't been down (so it's probably a hover)
5574
5575
5576 if (storeIndex < 0) {
5577 return;
5578 } // update the event in the store
5579
5580
5581 store[storeIndex] = ev;
5582 this.callback(this.manager, eventType, {
5583 pointers: store,
5584 changedPointers: [ev],
5585 pointerType: pointerType,
5586 srcEvent: ev
5587 });
5588
5589 if (removePointer) {
5590 // remove from the store
5591 store.splice(storeIndex, 1);
5592 }
5593 };
5594
5595 return PointerEventInput;
5596}(Input);
5597/**
5598 * @private
5599 * convert array-like objects to real arrays
5600 * @param {Object} obj
5601 * @returns {Array}
5602 */
5603
5604
5605function toArray(obj) {
5606 return Array.prototype.slice.call(obj, 0);
5607}
5608/**
5609 * @private
5610 * unique array with objects based on a key (like 'id') or just by the array's value
5611 * @param {Array} src [{id:1},{id:2},{id:1}]
5612 * @param {String} [key]
5613 * @param {Boolean} [sort=False]
5614 * @returns {Array} [{id:1},{id:2}]
5615 */
5616
5617
5618function uniqueArray(src, key, sort) {
5619 var results = [];
5620 var values = [];
5621 var i = 0;
5622
5623 while (i < src.length) {
5624 var val = key ? src[i][key] : src[i];
5625
5626 if (inArray(values, val) < 0) {
5627 results.push(src[i]);
5628 }
5629
5630 values[i] = val;
5631 i++;
5632 }
5633
5634 if (sort) {
5635 if (!key) {
5636 results = results.sort();
5637 } else {
5638 results = results.sort(function (a, b) {
5639 return a[key] > b[key];
5640 });
5641 }
5642 }
5643
5644 return results;
5645}
5646
5647var TOUCH_INPUT_MAP = {
5648 touchstart: INPUT_START,
5649 touchmove: INPUT_MOVE,
5650 touchend: INPUT_END,
5651 touchcancel: INPUT_CANCEL
5652};
5653var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
5654/**
5655 * @private
5656 * Multi-user touch events input
5657 * @constructor
5658 * @extends Input
5659 */
5660
5661var TouchInput = /*#__PURE__*/function (_Input) {
5662 _inheritsLoose(TouchInput, _Input);
5663
5664 function TouchInput() {
5665 var _this;
5666
5667 TouchInput.prototype.evTarget = TOUCH_TARGET_EVENTS;
5668 _this = _Input.apply(this, arguments) || this;
5669 _this.targetIds = {}; // this.evTarget = TOUCH_TARGET_EVENTS;
5670
5671 return _this;
5672 }
5673
5674 var _proto = TouchInput.prototype;
5675
5676 _proto.handler = function handler(ev) {
5677 var type = TOUCH_INPUT_MAP[ev.type];
5678 var touches = getTouches.call(this, ev, type);
5679
5680 if (!touches) {
5681 return;
5682 }
5683
5684 this.callback(this.manager, type, {
5685 pointers: touches[0],
5686 changedPointers: touches[1],
5687 pointerType: INPUT_TYPE_TOUCH,
5688 srcEvent: ev
5689 });
5690 };
5691
5692 return TouchInput;
5693}(Input);
5694
5695function getTouches(ev, type) {
5696 var allTouches = toArray(ev.touches);
5697 var targetIds = this.targetIds; // when there is only one touch, the process can be simplified
5698
5699 if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
5700 targetIds[allTouches[0].identifier] = true;
5701 return [allTouches, allTouches];
5702 }
5703
5704 var i;
5705 var targetTouches;
5706 var changedTouches = toArray(ev.changedTouches);
5707 var changedTargetTouches = [];
5708 var target = this.target; // get target touches from touches
5709
5710 targetTouches = allTouches.filter(function (touch) {
5711 return hasParent(touch.target, target);
5712 }); // collect touches
5713
5714 if (type === INPUT_START) {
5715 i = 0;
5716
5717 while (i < targetTouches.length) {
5718 targetIds[targetTouches[i].identifier] = true;
5719 i++;
5720 }
5721 } // filter changed touches to only contain touches that exist in the collected target ids
5722
5723
5724 i = 0;
5725
5726 while (i < changedTouches.length) {
5727 if (targetIds[changedTouches[i].identifier]) {
5728 changedTargetTouches.push(changedTouches[i]);
5729 } // cleanup removed touches
5730
5731
5732 if (type & (INPUT_END | INPUT_CANCEL)) {
5733 delete targetIds[changedTouches[i].identifier];
5734 }
5735
5736 i++;
5737 }
5738
5739 if (!changedTargetTouches.length) {
5740 return;
5741 }
5742
5743 return [// merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
5744 uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true), changedTargetTouches];
5745}
5746
5747var MOUSE_INPUT_MAP = {
5748 mousedown: INPUT_START,
5749 mousemove: INPUT_MOVE,
5750 mouseup: INPUT_END
5751};
5752var MOUSE_ELEMENT_EVENTS = 'mousedown';
5753var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
5754/**
5755 * @private
5756 * Mouse events input
5757 * @constructor
5758 * @extends Input
5759 */
5760
5761var MouseInput = /*#__PURE__*/function (_Input) {
5762 _inheritsLoose(MouseInput, _Input);
5763
5764 function MouseInput() {
5765 var _this;
5766
5767 var proto = MouseInput.prototype;
5768 proto.evEl = MOUSE_ELEMENT_EVENTS;
5769 proto.evWin = MOUSE_WINDOW_EVENTS;
5770 _this = _Input.apply(this, arguments) || this;
5771 _this.pressed = false; // mousedown state
5772
5773 return _this;
5774 }
5775 /**
5776 * @private
5777 * handle mouse events
5778 * @param {Object} ev
5779 */
5780
5781
5782 var _proto = MouseInput.prototype;
5783
5784 _proto.handler = function handler(ev) {
5785 var eventType = MOUSE_INPUT_MAP[ev.type]; // on start we want to have the left mouse button down
5786
5787 if (eventType & INPUT_START && ev.button === 0) {
5788 this.pressed = true;
5789 }
5790
5791 if (eventType & INPUT_MOVE && ev.which !== 1) {
5792 eventType = INPUT_END;
5793 } // mouse must be down
5794
5795
5796 if (!this.pressed) {
5797 return;
5798 }
5799
5800 if (eventType & INPUT_END) {
5801 this.pressed = false;
5802 }
5803
5804 this.callback(this.manager, eventType, {
5805 pointers: [ev],
5806 changedPointers: [ev],
5807 pointerType: INPUT_TYPE_MOUSE,
5808 srcEvent: ev
5809 });
5810 };
5811
5812 return MouseInput;
5813}(Input);
5814/**
5815 * @private
5816 * Combined touch and mouse input
5817 *
5818 * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
5819 * This because touch devices also emit mouse events while doing a touch.
5820 *
5821 * @constructor
5822 * @extends Input
5823 */
5824
5825
5826var DEDUP_TIMEOUT = 2500;
5827var DEDUP_DISTANCE = 25;
5828
5829function setLastTouch(eventData) {
5830 var _eventData$changedPoi = eventData.changedPointers,
5831 touch = _eventData$changedPoi[0];
5832
5833 if (touch.identifier === this.primaryTouch) {
5834 var lastTouch = {
5835 x: touch.clientX,
5836 y: touch.clientY
5837 };
5838 var lts = this.lastTouches;
5839 this.lastTouches.push(lastTouch);
5840
5841 var removeLastTouch = function removeLastTouch() {
5842 var i = lts.indexOf(lastTouch);
5843
5844 if (i > -1) {
5845 lts.splice(i, 1);
5846 }
5847 };
5848
5849 setTimeout(removeLastTouch, DEDUP_TIMEOUT);
5850 }
5851}
5852
5853function recordTouches(eventType, eventData) {
5854 if (eventType & INPUT_START) {
5855 this.primaryTouch = eventData.changedPointers[0].identifier;
5856 setLastTouch.call(this, eventData);
5857 } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
5858 setLastTouch.call(this, eventData);
5859 }
5860}
5861
5862function isSyntheticEvent(eventData) {
5863 var x = eventData.srcEvent.clientX;
5864 var y = eventData.srcEvent.clientY;
5865
5866 for (var i = 0; i < this.lastTouches.length; i++) {
5867 var t = this.lastTouches[i];
5868 var dx = Math.abs(x - t.x);
5869 var dy = Math.abs(y - t.y);
5870
5871 if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
5872 return true;
5873 }
5874 }
5875
5876 return false;
5877}
5878
5879var TouchMouseInput = /*#__PURE__*/function () {
5880 var TouchMouseInput = /*#__PURE__*/function (_Input) {
5881 _inheritsLoose(TouchMouseInput, _Input);
5882
5883 function TouchMouseInput(_manager, callback) {
5884 var _this;
5885
5886 _this = _Input.call(this, _manager, callback) || this;
5887
5888 _this.handler = function (manager, inputEvent, inputData) {
5889 var isTouch = inputData.pointerType === INPUT_TYPE_TOUCH;
5890 var isMouse = inputData.pointerType === INPUT_TYPE_MOUSE;
5891
5892 if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
5893 return;
5894 } // when we're in a touch event, record touches to de-dupe synthetic mouse event
5895
5896
5897 if (isTouch) {
5898 recordTouches.call(_assertThisInitialized$1(_assertThisInitialized$1(_this)), inputEvent, inputData);
5899 } else if (isMouse && isSyntheticEvent.call(_assertThisInitialized$1(_assertThisInitialized$1(_this)), inputData)) {
5900 return;
5901 }
5902
5903 _this.callback(manager, inputEvent, inputData);
5904 };
5905
5906 _this.touch = new TouchInput(_this.manager, _this.handler);
5907 _this.mouse = new MouseInput(_this.manager, _this.handler);
5908 _this.primaryTouch = null;
5909 _this.lastTouches = [];
5910 return _this;
5911 }
5912 /**
5913 * @private
5914 * handle mouse and touch events
5915 * @param {Hammer} manager
5916 * @param {String} inputEvent
5917 * @param {Object} inputData
5918 */
5919
5920
5921 var _proto = TouchMouseInput.prototype;
5922 /**
5923 * @private
5924 * remove the event listeners
5925 */
5926
5927 _proto.destroy = function destroy() {
5928 this.touch.destroy();
5929 this.mouse.destroy();
5930 };
5931
5932 return TouchMouseInput;
5933 }(Input);
5934
5935 return TouchMouseInput;
5936}();
5937/**
5938 * @private
5939 * create new input type manager
5940 * called by the Manager constructor
5941 * @param {Hammer} manager
5942 * @returns {Input}
5943 */
5944
5945
5946function createInputInstance(manager) {
5947 var Type; // let inputClass = manager.options.inputClass;
5948
5949 var inputClass = manager.options.inputClass;
5950
5951 if (inputClass) {
5952 Type = inputClass;
5953 } else if (SUPPORT_POINTER_EVENTS) {
5954 Type = PointerEventInput;
5955 } else if (SUPPORT_ONLY_TOUCH) {
5956 Type = TouchInput;
5957 } else if (!SUPPORT_TOUCH) {
5958 Type = MouseInput;
5959 } else {
5960 Type = TouchMouseInput;
5961 }
5962
5963 return new Type(manager, inputHandler);
5964}
5965/**
5966 * @private
5967 * if the argument is an array, we want to execute the fn on each entry
5968 * if it aint an array we don't want to do a thing.
5969 * this is used by all the methods that accept a single and array argument.
5970 * @param {*|Array} arg
5971 * @param {String} fn
5972 * @param {Object} [context]
5973 * @returns {Boolean}
5974 */
5975
5976
5977function invokeArrayArg(arg, fn, context) {
5978 if (Array.isArray(arg)) {
5979 each(arg, context[fn], context);
5980 return true;
5981 }
5982
5983 return false;
5984}
5985
5986var STATE_POSSIBLE = 1;
5987var STATE_BEGAN = 2;
5988var STATE_CHANGED = 4;
5989var STATE_ENDED = 8;
5990var STATE_RECOGNIZED = STATE_ENDED;
5991var STATE_CANCELLED = 16;
5992var STATE_FAILED = 32;
5993/**
5994 * @private
5995 * get a unique id
5996 * @returns {number} uniqueId
5997 */
5998
5999var _uniqueId = 1;
6000
6001function uniqueId() {
6002 return _uniqueId++;
6003}
6004/**
6005 * @private
6006 * get a recognizer by name if it is bound to a manager
6007 * @param {Recognizer|String} otherRecognizer
6008 * @param {Recognizer} recognizer
6009 * @returns {Recognizer}
6010 */
6011
6012
6013function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
6014 var manager = recognizer.manager;
6015
6016 if (manager) {
6017 return manager.get(otherRecognizer);
6018 }
6019
6020 return otherRecognizer;
6021}
6022/**
6023 * @private
6024 * get a usable string, used as event postfix
6025 * @param {constant} state
6026 * @returns {String} state
6027 */
6028
6029
6030function stateStr(state) {
6031 if (state & STATE_CANCELLED) {
6032 return 'cancel';
6033 } else if (state & STATE_ENDED) {
6034 return 'end';
6035 } else if (state & STATE_CHANGED) {
6036 return 'move';
6037 } else if (state & STATE_BEGAN) {
6038 return 'start';
6039 }
6040
6041 return '';
6042}
6043/**
6044 * @private
6045 * Recognizer flow explained; *
6046 * All recognizers have the initial state of POSSIBLE when a input session starts.
6047 * The definition of a input session is from the first input until the last input, with all it's movement in it. *
6048 * Example session for mouse-input: mousedown -> mousemove -> mouseup
6049 *
6050 * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
6051 * which determines with state it should be.
6052 *
6053 * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
6054 * POSSIBLE to give it another change on the next cycle.
6055 *
6056 * Possible
6057 * |
6058 * +-----+---------------+
6059 * | |
6060 * +-----+-----+ |
6061 * | | |
6062 * Failed Cancelled |
6063 * +-------+------+
6064 * | |
6065 * Recognized Began
6066 * |
6067 * Changed
6068 * |
6069 * Ended/Recognized
6070 */
6071
6072/**
6073 * @private
6074 * Recognizer
6075 * Every recognizer needs to extend from this class.
6076 * @constructor
6077 * @param {Object} options
6078 */
6079
6080
6081var Recognizer = /*#__PURE__*/function () {
6082 function Recognizer(options) {
6083 if (options === void 0) {
6084 options = {};
6085 }
6086
6087 this.options = _extends({
6088 enable: true
6089 }, options);
6090 this.id = uniqueId();
6091 this.manager = null; // default is enable true
6092
6093 this.state = STATE_POSSIBLE;
6094 this.simultaneous = {};
6095 this.requireFail = [];
6096 }
6097 /**
6098 * @private
6099 * set options
6100 * @param {Object} options
6101 * @return {Recognizer}
6102 */
6103
6104
6105 var _proto = Recognizer.prototype;
6106
6107 _proto.set = function set(options) {
6108 assign$1(this.options, options); // also update the touchAction, in case something changed about the directions/enabled state
6109
6110 this.manager && this.manager.touchAction.update();
6111 return this;
6112 };
6113 /**
6114 * @private
6115 * recognize simultaneous with an other recognizer.
6116 * @param {Recognizer} otherRecognizer
6117 * @returns {Recognizer} this
6118 */
6119
6120
6121 _proto.recognizeWith = function recognizeWith(otherRecognizer) {
6122 if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
6123 return this;
6124 }
6125
6126 var simultaneous = this.simultaneous;
6127 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
6128
6129 if (!simultaneous[otherRecognizer.id]) {
6130 simultaneous[otherRecognizer.id] = otherRecognizer;
6131 otherRecognizer.recognizeWith(this);
6132 }
6133
6134 return this;
6135 };
6136 /**
6137 * @private
6138 * drop the simultaneous link. it doesnt remove the link on the other recognizer.
6139 * @param {Recognizer} otherRecognizer
6140 * @returns {Recognizer} this
6141 */
6142
6143
6144 _proto.dropRecognizeWith = function dropRecognizeWith(otherRecognizer) {
6145 if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
6146 return this;
6147 }
6148
6149 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
6150 delete this.simultaneous[otherRecognizer.id];
6151 return this;
6152 };
6153 /**
6154 * @private
6155 * recognizer can only run when an other is failing
6156 * @param {Recognizer} otherRecognizer
6157 * @returns {Recognizer} this
6158 */
6159
6160
6161 _proto.requireFailure = function requireFailure(otherRecognizer) {
6162 if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
6163 return this;
6164 }
6165
6166 var requireFail = this.requireFail;
6167 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
6168
6169 if (inArray(requireFail, otherRecognizer) === -1) {
6170 requireFail.push(otherRecognizer);
6171 otherRecognizer.requireFailure(this);
6172 }
6173
6174 return this;
6175 };
6176 /**
6177 * @private
6178 * drop the requireFailure link. it does not remove the link on the other recognizer.
6179 * @param {Recognizer} otherRecognizer
6180 * @returns {Recognizer} this
6181 */
6182
6183
6184 _proto.dropRequireFailure = function dropRequireFailure(otherRecognizer) {
6185 if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
6186 return this;
6187 }
6188
6189 otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
6190 var index = inArray(this.requireFail, otherRecognizer);
6191
6192 if (index > -1) {
6193 this.requireFail.splice(index, 1);
6194 }
6195
6196 return this;
6197 };
6198 /**
6199 * @private
6200 * has require failures boolean
6201 * @returns {boolean}
6202 */
6203
6204
6205 _proto.hasRequireFailures = function hasRequireFailures() {
6206 return this.requireFail.length > 0;
6207 };
6208 /**
6209 * @private
6210 * if the recognizer can recognize simultaneous with an other recognizer
6211 * @param {Recognizer} otherRecognizer
6212 * @returns {Boolean}
6213 */
6214
6215
6216 _proto.canRecognizeWith = function canRecognizeWith(otherRecognizer) {
6217 return !!this.simultaneous[otherRecognizer.id];
6218 };
6219 /**
6220 * @private
6221 * You should use `tryEmit` instead of `emit` directly to check
6222 * that all the needed recognizers has failed before emitting.
6223 * @param {Object} input
6224 */
6225
6226
6227 _proto.emit = function emit(input) {
6228 var self = this;
6229 var state = this.state;
6230
6231 function emit(event) {
6232 self.manager.emit(event, input);
6233 } // 'panstart' and 'panmove'
6234
6235
6236 if (state < STATE_ENDED) {
6237 emit(self.options.event + stateStr(state));
6238 }
6239
6240 emit(self.options.event); // simple 'eventName' events
6241
6242 if (input.additionalEvent) {
6243 // additional event(panleft, panright, pinchin, pinchout...)
6244 emit(input.additionalEvent);
6245 } // panend and pancancel
6246
6247
6248 if (state >= STATE_ENDED) {
6249 emit(self.options.event + stateStr(state));
6250 }
6251 };
6252 /**
6253 * @private
6254 * Check that all the require failure recognizers has failed,
6255 * if true, it emits a gesture event,
6256 * otherwise, setup the state to FAILED.
6257 * @param {Object} input
6258 */
6259
6260
6261 _proto.tryEmit = function tryEmit(input) {
6262 if (this.canEmit()) {
6263 return this.emit(input);
6264 } // it's failing anyway
6265
6266
6267 this.state = STATE_FAILED;
6268 };
6269 /**
6270 * @private
6271 * can we emit?
6272 * @returns {boolean}
6273 */
6274
6275
6276 _proto.canEmit = function canEmit() {
6277 var i = 0;
6278
6279 while (i < this.requireFail.length) {
6280 if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
6281 return false;
6282 }
6283
6284 i++;
6285 }
6286
6287 return true;
6288 };
6289 /**
6290 * @private
6291 * update the recognizer
6292 * @param {Object} inputData
6293 */
6294
6295
6296 _proto.recognize = function recognize(inputData) {
6297 // make a new copy of the inputData
6298 // so we can change the inputData without messing up the other recognizers
6299 var inputDataClone = assign$1({}, inputData); // is is enabled and allow recognizing?
6300
6301 if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
6302 this.reset();
6303 this.state = STATE_FAILED;
6304 return;
6305 } // reset when we've reached the end
6306
6307
6308 if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
6309 this.state = STATE_POSSIBLE;
6310 }
6311
6312 this.state = this.process(inputDataClone); // the recognizer has recognized a gesture
6313 // so trigger an event
6314
6315 if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
6316 this.tryEmit(inputDataClone);
6317 }
6318 };
6319 /**
6320 * @private
6321 * return the state of the recognizer
6322 * the actual recognizing happens in this method
6323 * @virtual
6324 * @param {Object} inputData
6325 * @returns {constant} STATE
6326 */
6327
6328 /* jshint ignore:start */
6329
6330
6331 _proto.process = function process(inputData) {};
6332 /* jshint ignore:end */
6333
6334 /**
6335 * @private
6336 * return the preferred touch-action
6337 * @virtual
6338 * @returns {Array}
6339 */
6340
6341
6342 _proto.getTouchAction = function getTouchAction() {};
6343 /**
6344 * @private
6345 * called when the gesture isn't allowed to recognize
6346 * like when another is being recognized or it is disabled
6347 * @virtual
6348 */
6349
6350
6351 _proto.reset = function reset() {};
6352
6353 return Recognizer;
6354}();
6355/**
6356 * @private
6357 * A tap is recognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
6358 * between the given interval and position. The delay option can be used to recognize multi-taps without firing
6359 * a single tap.
6360 *
6361 * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
6362 * multi-taps being recognized.
6363 * @constructor
6364 * @extends Recognizer
6365 */
6366
6367
6368var TapRecognizer = /*#__PURE__*/function (_Recognizer) {
6369 _inheritsLoose(TapRecognizer, _Recognizer);
6370
6371 function TapRecognizer(options) {
6372 var _this;
6373
6374 if (options === void 0) {
6375 options = {};
6376 }
6377
6378 _this = _Recognizer.call(this, _extends({
6379 event: 'tap',
6380 pointers: 1,
6381 taps: 1,
6382 interval: 300,
6383 // max time between the multi-tap taps
6384 time: 250,
6385 // max time of the pointer to be down (like finger on the screen)
6386 threshold: 9,
6387 // a minimal movement is ok, but keep it low
6388 posThreshold: 10
6389 }, options)) || this; // previous time and center,
6390 // used for tap counting
6391
6392 _this.pTime = false;
6393 _this.pCenter = false;
6394 _this._timer = null;
6395 _this._input = null;
6396 _this.count = 0;
6397 return _this;
6398 }
6399
6400 var _proto = TapRecognizer.prototype;
6401
6402 _proto.getTouchAction = function getTouchAction() {
6403 return [TOUCH_ACTION_MANIPULATION];
6404 };
6405
6406 _proto.process = function process(input) {
6407 var _this2 = this;
6408
6409 var options = this.options;
6410 var validPointers = input.pointers.length === options.pointers;
6411 var validMovement = input.distance < options.threshold;
6412 var validTouchTime = input.deltaTime < options.time;
6413 this.reset();
6414
6415 if (input.eventType & INPUT_START && this.count === 0) {
6416 return this.failTimeout();
6417 } // we only allow little movement
6418 // and we've reached an end event, so a tap is possible
6419
6420
6421 if (validMovement && validTouchTime && validPointers) {
6422 if (input.eventType !== INPUT_END) {
6423 return this.failTimeout();
6424 }
6425
6426 var validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;
6427 var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
6428 this.pTime = input.timeStamp;
6429 this.pCenter = input.center;
6430
6431 if (!validMultiTap || !validInterval) {
6432 this.count = 1;
6433 } else {
6434 this.count += 1;
6435 }
6436
6437 this._input = input; // if tap count matches we have recognized it,
6438 // else it has began recognizing...
6439
6440 var tapCount = this.count % options.taps;
6441
6442 if (tapCount === 0) {
6443 // no failing requirements, immediately trigger the tap event
6444 // or wait as long as the multitap interval to trigger
6445 if (!this.hasRequireFailures()) {
6446 return STATE_RECOGNIZED;
6447 } else {
6448 this._timer = setTimeout(function () {
6449 _this2.state = STATE_RECOGNIZED;
6450
6451 _this2.tryEmit();
6452 }, options.interval);
6453 return STATE_BEGAN;
6454 }
6455 }
6456 }
6457
6458 return STATE_FAILED;
6459 };
6460
6461 _proto.failTimeout = function failTimeout() {
6462 var _this3 = this;
6463
6464 this._timer = setTimeout(function () {
6465 _this3.state = STATE_FAILED;
6466 }, this.options.interval);
6467 return STATE_FAILED;
6468 };
6469
6470 _proto.reset = function reset() {
6471 clearTimeout(this._timer);
6472 };
6473
6474 _proto.emit = function emit() {
6475 if (this.state === STATE_RECOGNIZED) {
6476 this._input.tapCount = this.count;
6477 this.manager.emit(this.options.event, this._input);
6478 }
6479 };
6480
6481 return TapRecognizer;
6482}(Recognizer);
6483/**
6484 * @private
6485 * This recognizer is just used as a base for the simple attribute recognizers.
6486 * @constructor
6487 * @extends Recognizer
6488 */
6489
6490
6491var AttrRecognizer = /*#__PURE__*/function (_Recognizer) {
6492 _inheritsLoose(AttrRecognizer, _Recognizer);
6493
6494 function AttrRecognizer(options) {
6495 if (options === void 0) {
6496 options = {};
6497 }
6498
6499 return _Recognizer.call(this, _extends({
6500 pointers: 1
6501 }, options)) || this;
6502 }
6503 /**
6504 * @private
6505 * Used to check if it the recognizer receives valid input, like input.distance > 10.
6506 * @memberof AttrRecognizer
6507 * @param {Object} input
6508 * @returns {Boolean} recognized
6509 */
6510
6511
6512 var _proto = AttrRecognizer.prototype;
6513
6514 _proto.attrTest = function attrTest(input) {
6515 var optionPointers = this.options.pointers;
6516 return optionPointers === 0 || input.pointers.length === optionPointers;
6517 };
6518 /**
6519 * @private
6520 * Process the input and return the state for the recognizer
6521 * @memberof AttrRecognizer
6522 * @param {Object} input
6523 * @returns {*} State
6524 */
6525
6526
6527 _proto.process = function process(input) {
6528 var state = this.state;
6529 var eventType = input.eventType;
6530 var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
6531 var isValid = this.attrTest(input); // on cancel input and we've recognized before, return STATE_CANCELLED
6532
6533 if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
6534 return state | STATE_CANCELLED;
6535 } else if (isRecognized || isValid) {
6536 if (eventType & INPUT_END) {
6537 return state | STATE_ENDED;
6538 } else if (!(state & STATE_BEGAN)) {
6539 return STATE_BEGAN;
6540 }
6541
6542 return state | STATE_CHANGED;
6543 }
6544
6545 return STATE_FAILED;
6546 };
6547
6548 return AttrRecognizer;
6549}(Recognizer);
6550/**
6551 * @private
6552 * direction cons to string
6553 * @param {constant} direction
6554 * @returns {String}
6555 */
6556
6557
6558function directionStr(direction) {
6559 if (direction === DIRECTION_DOWN) {
6560 return 'down';
6561 } else if (direction === DIRECTION_UP) {
6562 return 'up';
6563 } else if (direction === DIRECTION_LEFT) {
6564 return 'left';
6565 } else if (direction === DIRECTION_RIGHT) {
6566 return 'right';
6567 }
6568
6569 return '';
6570}
6571/**
6572 * @private
6573 * Pan
6574 * Recognized when the pointer is down and moved in the allowed direction.
6575 * @constructor
6576 * @extends AttrRecognizer
6577 */
6578
6579
6580var PanRecognizer = /*#__PURE__*/function (_AttrRecognizer) {
6581 _inheritsLoose(PanRecognizer, _AttrRecognizer);
6582
6583 function PanRecognizer(options) {
6584 var _this;
6585
6586 if (options === void 0) {
6587 options = {};
6588 }
6589
6590 _this = _AttrRecognizer.call(this, _extends({
6591 event: 'pan',
6592 threshold: 10,
6593 pointers: 1,
6594 direction: DIRECTION_ALL
6595 }, options)) || this;
6596 _this.pX = null;
6597 _this.pY = null;
6598 return _this;
6599 }
6600
6601 var _proto = PanRecognizer.prototype;
6602
6603 _proto.getTouchAction = function getTouchAction() {
6604 var direction = this.options.direction;
6605 var actions = [];
6606
6607 if (direction & DIRECTION_HORIZONTAL) {
6608 actions.push(TOUCH_ACTION_PAN_Y);
6609 }
6610
6611 if (direction & DIRECTION_VERTICAL) {
6612 actions.push(TOUCH_ACTION_PAN_X);
6613 }
6614
6615 return actions;
6616 };
6617
6618 _proto.directionTest = function directionTest(input) {
6619 var options = this.options;
6620 var hasMoved = true;
6621 var distance = input.distance;
6622 var direction = input.direction;
6623 var x = input.deltaX;
6624 var y = input.deltaY; // lock to axis?
6625
6626 if (!(direction & options.direction)) {
6627 if (options.direction & DIRECTION_HORIZONTAL) {
6628 direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
6629 hasMoved = x !== this.pX;
6630 distance = Math.abs(input.deltaX);
6631 } else {
6632 direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
6633 hasMoved = y !== this.pY;
6634 distance = Math.abs(input.deltaY);
6635 }
6636 }
6637
6638 input.direction = direction;
6639 return hasMoved && distance > options.threshold && direction & options.direction;
6640 };
6641
6642 _proto.attrTest = function attrTest(input) {
6643 return AttrRecognizer.prototype.attrTest.call(this, input) && ( // replace with a super call
6644 this.state & STATE_BEGAN || !(this.state & STATE_BEGAN) && this.directionTest(input));
6645 };
6646
6647 _proto.emit = function emit(input) {
6648 this.pX = input.deltaX;
6649 this.pY = input.deltaY;
6650 var direction = directionStr(input.direction);
6651
6652 if (direction) {
6653 input.additionalEvent = this.options.event + direction;
6654 }
6655
6656 _AttrRecognizer.prototype.emit.call(this, input);
6657 };
6658
6659 return PanRecognizer;
6660}(AttrRecognizer);
6661/**
6662 * @private
6663 * Swipe
6664 * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
6665 * @constructor
6666 * @extends AttrRecognizer
6667 */
6668
6669
6670var SwipeRecognizer = /*#__PURE__*/function (_AttrRecognizer) {
6671 _inheritsLoose(SwipeRecognizer, _AttrRecognizer);
6672
6673 function SwipeRecognizer(options) {
6674 if (options === void 0) {
6675 options = {};
6676 }
6677
6678 return _AttrRecognizer.call(this, _extends({
6679 event: 'swipe',
6680 threshold: 10,
6681 velocity: 0.3,
6682 direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
6683 pointers: 1
6684 }, options)) || this;
6685 }
6686
6687 var _proto = SwipeRecognizer.prototype;
6688
6689 _proto.getTouchAction = function getTouchAction() {
6690 return PanRecognizer.prototype.getTouchAction.call(this);
6691 };
6692
6693 _proto.attrTest = function attrTest(input) {
6694 var direction = this.options.direction;
6695 var velocity;
6696
6697 if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
6698 velocity = input.overallVelocity;
6699 } else if (direction & DIRECTION_HORIZONTAL) {
6700 velocity = input.overallVelocityX;
6701 } else if (direction & DIRECTION_VERTICAL) {
6702 velocity = input.overallVelocityY;
6703 }
6704
6705 return _AttrRecognizer.prototype.attrTest.call(this, input) && direction & input.offsetDirection && input.distance > this.options.threshold && input.maxPointers === this.options.pointers && abs(velocity) > this.options.velocity && input.eventType & INPUT_END;
6706 };
6707
6708 _proto.emit = function emit(input) {
6709 var direction = directionStr(input.offsetDirection);
6710
6711 if (direction) {
6712 this.manager.emit(this.options.event + direction, input);
6713 }
6714
6715 this.manager.emit(this.options.event, input);
6716 };
6717
6718 return SwipeRecognizer;
6719}(AttrRecognizer);
6720/**
6721 * @private
6722 * Pinch
6723 * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
6724 * @constructor
6725 * @extends AttrRecognizer
6726 */
6727
6728
6729var PinchRecognizer = /*#__PURE__*/function (_AttrRecognizer) {
6730 _inheritsLoose(PinchRecognizer, _AttrRecognizer);
6731
6732 function PinchRecognizer(options) {
6733 if (options === void 0) {
6734 options = {};
6735 }
6736
6737 return _AttrRecognizer.call(this, _extends({
6738 event: 'pinch',
6739 threshold: 0,
6740 pointers: 2
6741 }, options)) || this;
6742 }
6743
6744 var _proto = PinchRecognizer.prototype;
6745
6746 _proto.getTouchAction = function getTouchAction() {
6747 return [TOUCH_ACTION_NONE];
6748 };
6749
6750 _proto.attrTest = function attrTest(input) {
6751 return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
6752 };
6753
6754 _proto.emit = function emit(input) {
6755 if (input.scale !== 1) {
6756 var inOut = input.scale < 1 ? 'in' : 'out';
6757 input.additionalEvent = this.options.event + inOut;
6758 }
6759
6760 _AttrRecognizer.prototype.emit.call(this, input);
6761 };
6762
6763 return PinchRecognizer;
6764}(AttrRecognizer);
6765/**
6766 * @private
6767 * Rotate
6768 * Recognized when two or more pointer are moving in a circular motion.
6769 * @constructor
6770 * @extends AttrRecognizer
6771 */
6772
6773
6774var RotateRecognizer = /*#__PURE__*/function (_AttrRecognizer) {
6775 _inheritsLoose(RotateRecognizer, _AttrRecognizer);
6776
6777 function RotateRecognizer(options) {
6778 if (options === void 0) {
6779 options = {};
6780 }
6781
6782 return _AttrRecognizer.call(this, _extends({
6783 event: 'rotate',
6784 threshold: 0,
6785 pointers: 2
6786 }, options)) || this;
6787 }
6788
6789 var _proto = RotateRecognizer.prototype;
6790
6791 _proto.getTouchAction = function getTouchAction() {
6792 return [TOUCH_ACTION_NONE];
6793 };
6794
6795 _proto.attrTest = function attrTest(input) {
6796 return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
6797 };
6798
6799 return RotateRecognizer;
6800}(AttrRecognizer);
6801/**
6802 * @private
6803 * Press
6804 * Recognized when the pointer is down for x ms without any movement.
6805 * @constructor
6806 * @extends Recognizer
6807 */
6808
6809
6810var PressRecognizer = /*#__PURE__*/function (_Recognizer) {
6811 _inheritsLoose(PressRecognizer, _Recognizer);
6812
6813 function PressRecognizer(options) {
6814 var _this;
6815
6816 if (options === void 0) {
6817 options = {};
6818 }
6819
6820 _this = _Recognizer.call(this, _extends({
6821 event: 'press',
6822 pointers: 1,
6823 time: 251,
6824 // minimal time of the pointer to be pressed
6825 threshold: 9
6826 }, options)) || this;
6827 _this._timer = null;
6828 _this._input = null;
6829 return _this;
6830 }
6831
6832 var _proto = PressRecognizer.prototype;
6833
6834 _proto.getTouchAction = function getTouchAction() {
6835 return [TOUCH_ACTION_AUTO];
6836 };
6837
6838 _proto.process = function process(input) {
6839 var _this2 = this;
6840
6841 var options = this.options;
6842 var validPointers = input.pointers.length === options.pointers;
6843 var validMovement = input.distance < options.threshold;
6844 var validTime = input.deltaTime > options.time;
6845 this._input = input; // we only allow little movement
6846 // and we've reached an end event, so a tap is possible
6847
6848 if (!validMovement || !validPointers || input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime) {
6849 this.reset();
6850 } else if (input.eventType & INPUT_START) {
6851 this.reset();
6852 this._timer = setTimeout(function () {
6853 _this2.state = STATE_RECOGNIZED;
6854
6855 _this2.tryEmit();
6856 }, options.time);
6857 } else if (input.eventType & INPUT_END) {
6858 return STATE_RECOGNIZED;
6859 }
6860
6861 return STATE_FAILED;
6862 };
6863
6864 _proto.reset = function reset() {
6865 clearTimeout(this._timer);
6866 };
6867
6868 _proto.emit = function emit(input) {
6869 if (this.state !== STATE_RECOGNIZED) {
6870 return;
6871 }
6872
6873 if (input && input.eventType & INPUT_END) {
6874 this.manager.emit(this.options.event + "up", input);
6875 } else {
6876 this._input.timeStamp = now();
6877 this.manager.emit(this.options.event, this._input);
6878 }
6879 };
6880
6881 return PressRecognizer;
6882}(Recognizer);
6883
6884var defaults = {
6885 /**
6886 * @private
6887 * set if DOM events are being triggered.
6888 * But this is slower and unused by simple implementations, so disabled by default.
6889 * @type {Boolean}
6890 * @default false
6891 */
6892 domEvents: false,
6893
6894 /**
6895 * @private
6896 * The value for the touchAction property/fallback.
6897 * When set to `compute` it will magically set the correct value based on the added recognizers.
6898 * @type {String}
6899 * @default compute
6900 */
6901 touchAction: TOUCH_ACTION_COMPUTE,
6902
6903 /**
6904 * @private
6905 * @type {Boolean}
6906 * @default true
6907 */
6908 enable: true,
6909
6910 /**
6911 * @private
6912 * EXPERIMENTAL FEATURE -- can be removed/changed
6913 * Change the parent input target element.
6914 * If Null, then it is being set the to main element.
6915 * @type {Null|EventTarget}
6916 * @default null
6917 */
6918 inputTarget: null,
6919
6920 /**
6921 * @private
6922 * force an input class
6923 * @type {Null|Function}
6924 * @default null
6925 */
6926 inputClass: null,
6927
6928 /**
6929 * @private
6930 * Some CSS properties can be used to improve the working of Hammer.
6931 * Add them to this method and they will be set when creating a new Manager.
6932 * @namespace
6933 */
6934 cssProps: {
6935 /**
6936 * @private
6937 * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
6938 * @type {String}
6939 * @default 'none'
6940 */
6941 userSelect: "none",
6942
6943 /**
6944 * @private
6945 * Disable the Windows Phone grippers when pressing an element.
6946 * @type {String}
6947 * @default 'none'
6948 */
6949 touchSelect: "none",
6950
6951 /**
6952 * @private
6953 * Disables the default callout shown when you touch and hold a touch target.
6954 * On iOS, when you touch and hold a touch target such as a link, Safari displays
6955 * a callout containing information about the link. This property allows you to disable that callout.
6956 * @type {String}
6957 * @default 'none'
6958 */
6959 touchCallout: "none",
6960
6961 /**
6962 * @private
6963 * Specifies whether zooming is enabled. Used by IE10>
6964 * @type {String}
6965 * @default 'none'
6966 */
6967 contentZooming: "none",
6968
6969 /**
6970 * @private
6971 * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
6972 * @type {String}
6973 * @default 'none'
6974 */
6975 userDrag: "none",
6976
6977 /**
6978 * @private
6979 * Overrides the highlight color shown when the user taps a link or a JavaScript
6980 * clickable element in iOS. This property obeys the alpha value, if specified.
6981 * @type {String}
6982 * @default 'rgba(0,0,0,0)'
6983 */
6984 tapHighlightColor: "rgba(0,0,0,0)"
6985 }
6986};
6987/**
6988 * @private
6989 * Default recognizer setup when calling `Hammer()`
6990 * When creating a new Manager these will be skipped.
6991 * This is separated with other defaults because of tree-shaking.
6992 * @type {Array}
6993 */
6994
6995var preset = [[RotateRecognizer, {
6996 enable: false
6997}], [PinchRecognizer, {
6998 enable: false
6999}, ['rotate']], [SwipeRecognizer, {
7000 direction: DIRECTION_HORIZONTAL
7001}], [PanRecognizer, {
7002 direction: DIRECTION_HORIZONTAL
7003}, ['swipe']], [TapRecognizer], [TapRecognizer, {
7004 event: 'doubletap',
7005 taps: 2
7006}, ['tap']], [PressRecognizer]];
7007var STOP = 1;
7008var FORCED_STOP = 2;
7009/**
7010 * @private
7011 * add/remove the css properties as defined in manager.options.cssProps
7012 * @param {Manager} manager
7013 * @param {Boolean} add
7014 */
7015
7016function toggleCssProps(manager, add) {
7017 var element = manager.element;
7018
7019 if (!element.style) {
7020 return;
7021 }
7022
7023 var prop;
7024 each(manager.options.cssProps, function (value, name) {
7025 prop = prefixed(element.style, name);
7026
7027 if (add) {
7028 manager.oldCssProps[prop] = element.style[prop];
7029 element.style[prop] = value;
7030 } else {
7031 element.style[prop] = manager.oldCssProps[prop] || "";
7032 }
7033 });
7034
7035 if (!add) {
7036 manager.oldCssProps = {};
7037 }
7038}
7039/**
7040 * @private
7041 * trigger dom event
7042 * @param {String} event
7043 * @param {Object} data
7044 */
7045
7046
7047function triggerDomEvent(event, data) {
7048 var gestureEvent = document.createEvent("Event");
7049 gestureEvent.initEvent(event, true, true);
7050 gestureEvent.gesture = data;
7051 data.target.dispatchEvent(gestureEvent);
7052}
7053/**
7054* @private
7055 * Manager
7056 * @param {HTMLElement} element
7057 * @param {Object} [options]
7058 * @constructor
7059 */
7060
7061
7062var Manager = /*#__PURE__*/function () {
7063 function Manager(element, options) {
7064 var _this = this;
7065
7066 this.options = assign$1({}, defaults, options || {});
7067 this.options.inputTarget = this.options.inputTarget || element;
7068 this.handlers = {};
7069 this.session = {};
7070 this.recognizers = [];
7071 this.oldCssProps = {};
7072 this.element = element;
7073 this.input = createInputInstance(this);
7074 this.touchAction = new TouchAction(this, this.options.touchAction);
7075 toggleCssProps(this, true);
7076 each(this.options.recognizers, function (item) {
7077 var recognizer = _this.add(new item[0](item[1]));
7078
7079 item[2] && recognizer.recognizeWith(item[2]);
7080 item[3] && recognizer.requireFailure(item[3]);
7081 }, this);
7082 }
7083 /**
7084 * @private
7085 * set options
7086 * @param {Object} options
7087 * @returns {Manager}
7088 */
7089
7090
7091 var _proto = Manager.prototype;
7092
7093 _proto.set = function set(options) {
7094 assign$1(this.options, options); // Options that need a little more setup
7095
7096 if (options.touchAction) {
7097 this.touchAction.update();
7098 }
7099
7100 if (options.inputTarget) {
7101 // Clean up existing event listeners and reinitialize
7102 this.input.destroy();
7103 this.input.target = options.inputTarget;
7104 this.input.init();
7105 }
7106
7107 return this;
7108 };
7109 /**
7110 * @private
7111 * stop recognizing for this session.
7112 * This session will be discarded, when a new [input]start event is fired.
7113 * When forced, the recognizer cycle is stopped immediately.
7114 * @param {Boolean} [force]
7115 */
7116
7117
7118 _proto.stop = function stop(force) {
7119 this.session.stopped = force ? FORCED_STOP : STOP;
7120 };
7121 /**
7122 * @private
7123 * run the recognizers!
7124 * called by the inputHandler function on every movement of the pointers (touches)
7125 * it walks through all the recognizers and tries to detect the gesture that is being made
7126 * @param {Object} inputData
7127 */
7128
7129
7130 _proto.recognize = function recognize(inputData) {
7131 var session = this.session;
7132
7133 if (session.stopped) {
7134 return;
7135 } // run the touch-action polyfill
7136
7137
7138 this.touchAction.preventDefaults(inputData);
7139 var recognizer;
7140 var recognizers = this.recognizers; // this holds the recognizer that is being recognized.
7141 // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
7142 // if no recognizer is detecting a thing, it is set to `null`
7143
7144 var curRecognizer = session.curRecognizer; // reset when the last recognizer is recognized
7145 // or when we're in a new session
7146
7147 if (!curRecognizer || curRecognizer && curRecognizer.state & STATE_RECOGNIZED) {
7148 session.curRecognizer = null;
7149 curRecognizer = null;
7150 }
7151
7152 var i = 0;
7153
7154 while (i < recognizers.length) {
7155 recognizer = recognizers[i]; // find out if we are allowed try to recognize the input for this one.
7156 // 1. allow if the session is NOT forced stopped (see the .stop() method)
7157 // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
7158 // that is being recognized.
7159 // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
7160 // this can be setup with the `recognizeWith()` method on the recognizer.
7161
7162 if (session.stopped !== FORCED_STOP && ( // 1
7163 !curRecognizer || recognizer === curRecognizer || // 2
7164 recognizer.canRecognizeWith(curRecognizer))) {
7165 // 3
7166 recognizer.recognize(inputData);
7167 } else {
7168 recognizer.reset();
7169 } // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
7170 // current active recognizer. but only if we don't already have an active recognizer
7171
7172
7173 if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
7174 session.curRecognizer = recognizer;
7175 curRecognizer = recognizer;
7176 }
7177
7178 i++;
7179 }
7180 };
7181 /**
7182 * @private
7183 * get a recognizer by its event name.
7184 * @param {Recognizer|String} recognizer
7185 * @returns {Recognizer|Null}
7186 */
7187
7188
7189 _proto.get = function get(recognizer) {
7190 if (recognizer instanceof Recognizer) {
7191 return recognizer;
7192 }
7193
7194 var recognizers = this.recognizers;
7195
7196 for (var i = 0; i < recognizers.length; i++) {
7197 if (recognizers[i].options.event === recognizer) {
7198 return recognizers[i];
7199 }
7200 }
7201
7202 return null;
7203 };
7204 /**
7205 * @private add a recognizer to the manager
7206 * existing recognizers with the same event name will be removed
7207 * @param {Recognizer} recognizer
7208 * @returns {Recognizer|Manager}
7209 */
7210
7211
7212 _proto.add = function add(recognizer) {
7213 if (invokeArrayArg(recognizer, "add", this)) {
7214 return this;
7215 } // remove existing
7216
7217
7218 var existing = this.get(recognizer.options.event);
7219
7220 if (existing) {
7221 this.remove(existing);
7222 }
7223
7224 this.recognizers.push(recognizer);
7225 recognizer.manager = this;
7226 this.touchAction.update();
7227 return recognizer;
7228 };
7229 /**
7230 * @private
7231 * remove a recognizer by name or instance
7232 * @param {Recognizer|String} recognizer
7233 * @returns {Manager}
7234 */
7235
7236
7237 _proto.remove = function remove(recognizer) {
7238 if (invokeArrayArg(recognizer, "remove", this)) {
7239 return this;
7240 }
7241
7242 var targetRecognizer = this.get(recognizer); // let's make sure this recognizer exists
7243
7244 if (recognizer) {
7245 var recognizers = this.recognizers;
7246 var index = inArray(recognizers, targetRecognizer);
7247
7248 if (index !== -1) {
7249 recognizers.splice(index, 1);
7250 this.touchAction.update();
7251 }
7252 }
7253
7254 return this;
7255 };
7256 /**
7257 * @private
7258 * bind event
7259 * @param {String} events
7260 * @param {Function} handler
7261 * @returns {EventEmitter} this
7262 */
7263
7264
7265 _proto.on = function on(events, handler) {
7266 if (events === undefined || handler === undefined) {
7267 return this;
7268 }
7269
7270 var handlers = this.handlers;
7271 each(splitStr(events), function (event) {
7272 handlers[event] = handlers[event] || [];
7273 handlers[event].push(handler);
7274 });
7275 return this;
7276 };
7277 /**
7278 * @private unbind event, leave emit blank to remove all handlers
7279 * @param {String} events
7280 * @param {Function} [handler]
7281 * @returns {EventEmitter} this
7282 */
7283
7284
7285 _proto.off = function off(events, handler) {
7286 if (events === undefined) {
7287 return this;
7288 }
7289
7290 var handlers = this.handlers;
7291 each(splitStr(events), function (event) {
7292 if (!handler) {
7293 delete handlers[event];
7294 } else {
7295 handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
7296 }
7297 });
7298 return this;
7299 };
7300 /**
7301 * @private emit event to the listeners
7302 * @param {String} event
7303 * @param {Object} data
7304 */
7305
7306
7307 _proto.emit = function emit(event, data) {
7308 // we also want to trigger dom events
7309 if (this.options.domEvents) {
7310 triggerDomEvent(event, data);
7311 } // no handlers, so skip it all
7312
7313
7314 var handlers = this.handlers[event] && this.handlers[event].slice();
7315
7316 if (!handlers || !handlers.length) {
7317 return;
7318 }
7319
7320 data.type = event;
7321
7322 data.preventDefault = function () {
7323 data.srcEvent.preventDefault();
7324 };
7325
7326 var i = 0;
7327
7328 while (i < handlers.length) {
7329 handlers[i](data);
7330 i++;
7331 }
7332 };
7333 /**
7334 * @private
7335 * destroy the manager and unbinds all events
7336 * it doesn't unbind dom events, that is the user own responsibility
7337 */
7338
7339
7340 _proto.destroy = function destroy() {
7341 this.element && toggleCssProps(this, false);
7342 this.handlers = {};
7343 this.session = {};
7344 this.input.destroy();
7345 this.element = null;
7346 };
7347
7348 return Manager;
7349}();
7350
7351var SINGLE_TOUCH_INPUT_MAP = {
7352 touchstart: INPUT_START,
7353 touchmove: INPUT_MOVE,
7354 touchend: INPUT_END,
7355 touchcancel: INPUT_CANCEL
7356};
7357var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
7358var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
7359/**
7360 * @private
7361 * Touch events input
7362 * @constructor
7363 * @extends Input
7364 */
7365
7366var SingleTouchInput = /*#__PURE__*/function (_Input) {
7367 _inheritsLoose(SingleTouchInput, _Input);
7368
7369 function SingleTouchInput() {
7370 var _this;
7371
7372 var proto = SingleTouchInput.prototype;
7373 proto.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
7374 proto.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
7375 _this = _Input.apply(this, arguments) || this;
7376 _this.started = false;
7377 return _this;
7378 }
7379
7380 var _proto = SingleTouchInput.prototype;
7381
7382 _proto.handler = function handler(ev) {
7383 var type = SINGLE_TOUCH_INPUT_MAP[ev.type]; // should we handle the touch events?
7384
7385 if (type === INPUT_START) {
7386 this.started = true;
7387 }
7388
7389 if (!this.started) {
7390 return;
7391 }
7392
7393 var touches = normalizeSingleTouches.call(this, ev, type); // when done, reset the started state
7394
7395 if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
7396 this.started = false;
7397 }
7398
7399 this.callback(this.manager, type, {
7400 pointers: touches[0],
7401 changedPointers: touches[1],
7402 pointerType: INPUT_TYPE_TOUCH,
7403 srcEvent: ev
7404 });
7405 };
7406
7407 return SingleTouchInput;
7408}(Input);
7409
7410function normalizeSingleTouches(ev, type) {
7411 var all = toArray(ev.touches);
7412 var changed = toArray(ev.changedTouches);
7413
7414 if (type & (INPUT_END | INPUT_CANCEL)) {
7415 all = uniqueArray(all.concat(changed), 'identifier', true);
7416 }
7417
7418 return [all, changed];
7419}
7420/**
7421 * @private
7422 * wrap a method with a deprecation warning and stack trace
7423 * @param {Function} method
7424 * @param {String} name
7425 * @param {String} message
7426 * @returns {Function} A new function wrapping the supplied method.
7427 */
7428
7429
7430function deprecate(method, name, message) {
7431 var deprecationMessage = "DEPRECATED METHOD: " + name + "\n" + message + " AT \n";
7432 return function () {
7433 var e = new Error('get-stack-trace');
7434 var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '').replace(/^\s+at\s+/gm, '').replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
7435 var log = window.console && (window.console.warn || window.console.log);
7436
7437 if (log) {
7438 log.call(window.console, deprecationMessage, stack);
7439 }
7440
7441 return method.apply(this, arguments);
7442 };
7443}
7444/**
7445 * @private
7446 * extend object.
7447 * means that properties in dest will be overwritten by the ones in src.
7448 * @param {Object} dest
7449 * @param {Object} src
7450 * @param {Boolean} [merge=false]
7451 * @returns {Object} dest
7452 */
7453
7454
7455var extend = deprecate(function (dest, src, merge) {
7456 var keys = Object.keys(src);
7457 var i = 0;
7458
7459 while (i < keys.length) {
7460 if (!merge || merge && dest[keys[i]] === undefined) {
7461 dest[keys[i]] = src[keys[i]];
7462 }
7463
7464 i++;
7465 }
7466
7467 return dest;
7468}, 'extend', 'Use `assign`.');
7469/**
7470 * @private
7471 * merge the values from src in the dest.
7472 * means that properties that exist in dest will not be overwritten by src
7473 * @param {Object} dest
7474 * @param {Object} src
7475 * @returns {Object} dest
7476 */
7477
7478var merge$1 = deprecate(function (dest, src) {
7479 return extend(dest, src, true);
7480}, 'merge', 'Use `assign`.');
7481/**
7482 * @private
7483 * simple class inheritance
7484 * @param {Function} child
7485 * @param {Function} base
7486 * @param {Object} [properties]
7487 */
7488
7489function inherit(child, base, properties) {
7490 var baseP = base.prototype;
7491 var childP;
7492 childP = child.prototype = Object.create(baseP);
7493 childP.constructor = child;
7494 childP._super = baseP;
7495
7496 if (properties) {
7497 assign$1(childP, properties);
7498 }
7499}
7500/**
7501 * @private
7502 * simple function bind
7503 * @param {Function} fn
7504 * @param {Object} context
7505 * @returns {Function}
7506 */
7507
7508
7509function bindFn(fn, context) {
7510 return function boundFn() {
7511 return fn.apply(context, arguments);
7512 };
7513}
7514/**
7515 * @private
7516 * Simple way to create a manager with a default set of recognizers.
7517 * @param {HTMLElement} element
7518 * @param {Object} [options]
7519 * @constructor
7520 */
7521
7522
7523var Hammer = /*#__PURE__*/function () {
7524 var Hammer =
7525 /**
7526 * @private
7527 * @const {string}
7528 */
7529 function Hammer(element, options) {
7530 if (options === void 0) {
7531 options = {};
7532 }
7533
7534 return new Manager(element, _extends({
7535 recognizers: preset.concat()
7536 }, options));
7537 };
7538
7539 Hammer.VERSION = "2.0.17-rc";
7540 Hammer.DIRECTION_ALL = DIRECTION_ALL;
7541 Hammer.DIRECTION_DOWN = DIRECTION_DOWN;
7542 Hammer.DIRECTION_LEFT = DIRECTION_LEFT;
7543 Hammer.DIRECTION_RIGHT = DIRECTION_RIGHT;
7544 Hammer.DIRECTION_UP = DIRECTION_UP;
7545 Hammer.DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL;
7546 Hammer.DIRECTION_VERTICAL = DIRECTION_VERTICAL;
7547 Hammer.DIRECTION_NONE = DIRECTION_NONE;
7548 Hammer.DIRECTION_DOWN = DIRECTION_DOWN;
7549 Hammer.INPUT_START = INPUT_START;
7550 Hammer.INPUT_MOVE = INPUT_MOVE;
7551 Hammer.INPUT_END = INPUT_END;
7552 Hammer.INPUT_CANCEL = INPUT_CANCEL;
7553 Hammer.STATE_POSSIBLE = STATE_POSSIBLE;
7554 Hammer.STATE_BEGAN = STATE_BEGAN;
7555 Hammer.STATE_CHANGED = STATE_CHANGED;
7556 Hammer.STATE_ENDED = STATE_ENDED;
7557 Hammer.STATE_RECOGNIZED = STATE_RECOGNIZED;
7558 Hammer.STATE_CANCELLED = STATE_CANCELLED;
7559 Hammer.STATE_FAILED = STATE_FAILED;
7560 Hammer.Manager = Manager;
7561 Hammer.Input = Input;
7562 Hammer.TouchAction = TouchAction;
7563 Hammer.TouchInput = TouchInput;
7564 Hammer.MouseInput = MouseInput;
7565 Hammer.PointerEventInput = PointerEventInput;
7566 Hammer.TouchMouseInput = TouchMouseInput;
7567 Hammer.SingleTouchInput = SingleTouchInput;
7568 Hammer.Recognizer = Recognizer;
7569 Hammer.AttrRecognizer = AttrRecognizer;
7570 Hammer.Tap = TapRecognizer;
7571 Hammer.Pan = PanRecognizer;
7572 Hammer.Swipe = SwipeRecognizer;
7573 Hammer.Pinch = PinchRecognizer;
7574 Hammer.Rotate = RotateRecognizer;
7575 Hammer.Press = PressRecognizer;
7576 Hammer.on = addEventListeners;
7577 Hammer.off = removeEventListeners;
7578 Hammer.each = each;
7579 Hammer.merge = merge$1;
7580 Hammer.extend = extend;
7581 Hammer.bindFn = bindFn;
7582 Hammer.assign = assign$1;
7583 Hammer.inherit = inherit;
7584 Hammer.bindFn = bindFn;
7585 Hammer.prefixed = prefixed;
7586 Hammer.toArray = toArray;
7587 Hammer.inArray = inArray;
7588 Hammer.uniqueArray = uniqueArray;
7589 Hammer.splitStr = splitStr;
7590 Hammer.boolOrFn = boolOrFn;
7591 Hammer.hasParent = hasParent;
7592 Hammer.addEventListeners = addEventListeners;
7593 Hammer.removeEventListeners = removeEventListeners;
7594 Hammer.defaults = assign$1({}, defaults, {
7595 preset: preset
7596 });
7597 return Hammer;
7598}(); // style loader but by script tag, not by the loader.
7599var RealHammer = Hammer;
7600
7601function _createForOfIteratorHelper$3(o, allowArrayLike) { var it = typeof symbol !== "undefined" && getIteratorMethod$1(o) || o["@@iterator"]; if (!it) { if (isArray$1(o) || (it = _unsupportedIterableToArray$3(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
7602
7603function _unsupportedIterableToArray$3(o, minLen) { var _context21; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$3(o, minLen); var n = slice(_context21 = Object.prototype.toString.call(o)).call(_context21, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return from$3(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen); }
7604
7605function _arrayLikeToArray$3(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
7606/**
7607 * Use this symbol to delete properies in deepObjectAssign.
7608 */
7609
7610var DELETE = symbol("DELETE");
7611/**
7612 * Pure version of deepObjectAssign, it doesn't modify any of it's arguments.
7613 *
7614 * @param base - The base object that fullfils the whole interface T.
7615 * @param updates - Updates that may change or delete props.
7616 * @returns A brand new instance with all the supplied objects deeply merged.
7617 */
7618
7619
7620function pureDeepObjectAssign(base) {
7621 var _context;
7622
7623 for (var _len = arguments.length, updates = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
7624 updates[_key - 1] = arguments[_key];
7625 }
7626
7627 return deepObjectAssign.apply(void 0, concat$1(_context = [{}, base]).call(_context, updates));
7628}
7629/**
7630 * Deep version of object assign with additional deleting by the DELETE symbol.
7631 *
7632 * @param values - Objects to be deeply merged.
7633 * @returns The first object from values.
7634 */
7635
7636
7637function deepObjectAssign() {
7638 var merged = deepObjectAssignNonentry.apply(void 0, arguments);
7639 stripDelete(merged);
7640 return merged;
7641}
7642/**
7643 * Deep version of object assign with additional deleting by the DELETE symbol.
7644 *
7645 * @remarks
7646 * This doesn't strip the DELETE symbols so they may end up in the final object.
7647 * @param values - Objects to be deeply merged.
7648 * @returns The first object from values.
7649 */
7650
7651
7652function deepObjectAssignNonentry() {
7653 for (var _len2 = arguments.length, values = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
7654 values[_key2] = arguments[_key2];
7655 }
7656
7657 if (values.length < 2) {
7658 return values[0];
7659 } else if (values.length > 2) {
7660 var _context2;
7661
7662 return deepObjectAssignNonentry.apply(void 0, concat$1(_context2 = [deepObjectAssign(values[0], values[1])]).call(_context2, _toConsumableArray(slice(values).call(values, 2))));
7663 }
7664
7665 var a = values[0];
7666 var b = values[1];
7667
7668 var _iterator = _createForOfIteratorHelper$3(ownKeys$1(b)),
7669 _step;
7670
7671 try {
7672 for (_iterator.s(); !(_step = _iterator.n()).done;) {
7673 var prop = _step.value;
7674 if (!Object.prototype.propertyIsEnumerable.call(b, prop)) ;else if (b[prop] === DELETE) {
7675 delete a[prop];
7676 } else if (a[prop] !== null && b[prop] !== null && _typeof(a[prop]) === "object" && _typeof(b[prop]) === "object" && !isArray$1(a[prop]) && !isArray$1(b[prop])) {
7677 a[prop] = deepObjectAssignNonentry(a[prop], b[prop]);
7678 } else {
7679 a[prop] = clone(b[prop]);
7680 }
7681 }
7682 } catch (err) {
7683 _iterator.e(err);
7684 } finally {
7685 _iterator.f();
7686 }
7687
7688 return a;
7689}
7690/**
7691 * Deep clone given object or array. In case of primitive simply return.
7692 *
7693 * @param a - Anything.
7694 * @returns Deep cloned object/array or unchanged a.
7695 */
7696
7697
7698function clone(a) {
7699 if (isArray$1(a)) {
7700 return map$3(a).call(a, function (value) {
7701 return clone(value);
7702 });
7703 } else if (_typeof(a) === "object" && a !== null) {
7704 return deepObjectAssignNonentry({}, a);
7705 } else {
7706 return a;
7707 }
7708}
7709/**
7710 * Strip DELETE from given object.
7711 *
7712 * @param a - Object which may contain DELETE but won't after this is executed.
7713 */
7714
7715
7716function stripDelete(a) {
7717 for (var _i = 0, _Object$keys = keys$4(a); _i < _Object$keys.length; _i++) {
7718 var prop = _Object$keys[_i];
7719
7720 if (a[prop] === DELETE) {
7721 delete a[prop];
7722 } else if (_typeof(a[prop]) === "object" && a[prop] !== null) {
7723 stripDelete(a[prop]);
7724 }
7725 }
7726}
7727/**
7728 * Setup a mock hammer.js object, for unit testing.
7729 *
7730 * Inspiration: https://github.com/uber/deck.gl/pull/658
7731 *
7732 * @returns {{on: noop, off: noop, destroy: noop, emit: noop, get: get}}
7733 */
7734
7735
7736function hammerMock() {
7737 var noop = function noop() {};
7738
7739 return {
7740 on: noop,
7741 off: noop,
7742 destroy: noop,
7743 emit: noop,
7744 get: function get() {
7745 return {
7746 set: noop
7747 };
7748 }
7749 };
7750}
7751
7752var Hammer$1 = typeof window !== "undefined" ? window.Hammer || RealHammer : function () {
7753 // hammer.js is only available in a browser, not in node.js. Replacing it with a mock object.
7754 return hammerMock();
7755};
7756/**
7757 * Turn an element into an clickToUse element.
7758 * When not active, the element has a transparent overlay. When the overlay is
7759 * clicked, the mode is changed to active.
7760 * When active, the element is displayed with a blue border around it, and
7761 * the interactive contents of the element can be used. When clicked outside
7762 * the element, the elements mode is changed to inactive.
7763 *
7764 * @param {Element} container
7765 * @class Activator
7766 */
7767
7768function Activator$1(container) {
7769 var _this = this,
7770 _context3;
7771
7772 this._cleanupQueue = [];
7773 this.active = false;
7774 this._dom = {
7775 container: container,
7776 overlay: document.createElement("div")
7777 };
7778
7779 this._dom.overlay.classList.add("vis-overlay");
7780
7781 this._dom.container.appendChild(this._dom.overlay);
7782
7783 this._cleanupQueue.push(function () {
7784 _this._dom.overlay.parentNode.removeChild(_this._dom.overlay);
7785 });
7786
7787 var hammer = Hammer$1(this._dom.overlay);
7788 hammer.on("tap", bind$6(_context3 = this._onTapOverlay).call(_context3, this));
7789
7790 this._cleanupQueue.push(function () {
7791 hammer.destroy(); // FIXME: cleaning up hammer instances doesn't work (Timeline not removed
7792 // from memory)
7793 }); // block all touch events (except tap)
7794
7795
7796 var events = ["tap", "doubletap", "press", "pinch", "pan", "panstart", "panmove", "panend"];
7797
7798 forEach$1(events).call(events, function (event) {
7799 hammer.on(event, function (event) {
7800 event.srcEvent.stopPropagation();
7801 });
7802 }); // attach a click event to the window, in order to deactivate when clicking outside the timeline
7803
7804
7805 if (document && document.body) {
7806 this._onClick = function (event) {
7807 if (!_hasParent(event.target, container)) {
7808 _this.deactivate();
7809 }
7810 };
7811
7812 document.body.addEventListener("click", this._onClick);
7813
7814 this._cleanupQueue.push(function () {
7815 document.body.removeEventListener("click", _this._onClick);
7816 });
7817 } // prepare escape key listener for deactivating when active
7818
7819
7820 this._escListener = function (event) {
7821 if ("key" in event ? event.key === "Escape" : event.keyCode === 27
7822 /* the keyCode is for IE11 */
7823 ) {
7824 _this.deactivate();
7825 }
7826 };
7827} // turn into an event emitter
7828
7829
7830Emitter(Activator$1.prototype); // The currently active activator
7831
7832Activator$1.current = null;
7833/**
7834 * Destroy the activator. Cleans up all created DOM and event listeners
7835 */
7836
7837Activator$1.prototype.destroy = function () {
7838 var _context4, _context5;
7839
7840 this.deactivate();
7841
7842 var _iterator2 = _createForOfIteratorHelper$3(reverse(_context4 = splice(_context5 = this._cleanupQueue).call(_context5, 0)).call(_context4)),
7843 _step2;
7844
7845 try {
7846 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
7847 var callback = _step2.value;
7848 callback();
7849 }
7850 } catch (err) {
7851 _iterator2.e(err);
7852 } finally {
7853 _iterator2.f();
7854 }
7855};
7856/**
7857 * Activate the element
7858 * Overlay is hidden, element is decorated with a blue shadow border
7859 */
7860
7861
7862Activator$1.prototype.activate = function () {
7863 // we allow only one active activator at a time
7864 if (Activator$1.current) {
7865 Activator$1.current.deactivate();
7866 }
7867
7868 Activator$1.current = this;
7869 this.active = true;
7870 this._dom.overlay.style.display = "none";
7871
7872 this._dom.container.classList.add("vis-active");
7873
7874 this.emit("change");
7875 this.emit("activate"); // ugly hack: bind ESC after emitting the events, as the Network rebinds all
7876 // keyboard events on a 'change' event
7877
7878 document.body.addEventListener("keydown", this._escListener);
7879};
7880/**
7881 * Deactivate the element
7882 * Overlay is displayed on top of the element
7883 */
7884
7885
7886Activator$1.prototype.deactivate = function () {
7887 this.active = false;
7888 this._dom.overlay.style.display = "block";
7889
7890 this._dom.container.classList.remove("vis-active");
7891
7892 document.body.removeEventListener("keydown", this._escListener);
7893 this.emit("change");
7894 this.emit("deactivate");
7895};
7896/**
7897 * Handle a tap event: activate the container
7898 *
7899 * @param {Event} event The event
7900 * @private
7901 */
7902
7903
7904Activator$1.prototype._onTapOverlay = function (event) {
7905 // activate the container
7906 this.activate();
7907 event.srcEvent.stopPropagation();
7908};
7909/**
7910 * Test whether the element has the requested parent element somewhere in
7911 * its chain of parent nodes.
7912 *
7913 * @param {HTMLElement} element
7914 * @param {HTMLElement} parent
7915 * @returns {boolean} Returns true when the parent is found somewhere in the
7916 * chain of parent nodes.
7917 * @private
7918 */
7919
7920
7921function _hasParent(element, parent) {
7922 while (element) {
7923 if (element === parent) {
7924 return true;
7925 }
7926
7927 element = element.parentNode;
7928 }
7929
7930 return false;
7931} // utility functions
7932
7933var global$4 = global$M;
7934var isConstructor = isConstructor$4;
7935var tryToString$1 = tryToString$4;
7936var TypeError$3 = global$4.TypeError; // `Assert: IsConstructor(argument) is true`
7937
7938var aConstructor$1 = function (argument) {
7939 if (isConstructor(argument)) return argument;
7940 throw TypeError$3(tryToString$1(argument) + ' is not a constructor');
7941};
7942
7943var $$5 = _export;
7944var getBuiltIn$1 = getBuiltIn$9;
7945var apply = functionApply;
7946var bind$2 = functionBind;
7947var aConstructor = aConstructor$1;
7948var anObject$1 = anObject$b;
7949var isObject$3 = isObject$f;
7950var create$4 = objectCreate;
7951var fails$5 = fails$r;
7952var nativeConstruct = getBuiltIn$1('Reflect', 'construct');
7953var ObjectPrototype = Object.prototype;
7954var push$1 = [].push; // `Reflect.construct` method
7955// https://tc39.es/ecma262/#sec-reflect.construct
7956// MS Edge supports only 2 arguments and argumentsList argument is optional
7957// FF Nightly sets third argument as `new.target`, but does not create `this` from it
7958
7959var NEW_TARGET_BUG = fails$5(function () {
7960 function F() {
7961 /* empty */
7962 }
7963
7964 return !(nativeConstruct(function () {
7965 /* empty */
7966 }, [], F) instanceof F);
7967});
7968var ARGS_BUG = !fails$5(function () {
7969 nativeConstruct(function () {
7970 /* empty */
7971 });
7972});
7973var FORCED$1 = NEW_TARGET_BUG || ARGS_BUG;
7974$$5({
7975 target: 'Reflect',
7976 stat: true,
7977 forced: FORCED$1,
7978 sham: FORCED$1
7979}, {
7980 construct: function construct(Target, args
7981 /* , newTarget */
7982 ) {
7983 aConstructor(Target);
7984 anObject$1(args);
7985 var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
7986 if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
7987
7988 if (Target == newTarget) {
7989 // w/o altered newTarget, optimization for 0-4 arguments
7990 switch (args.length) {
7991 case 0:
7992 return new Target();
7993
7994 case 1:
7995 return new Target(args[0]);
7996
7997 case 2:
7998 return new Target(args[0], args[1]);
7999
8000 case 3:
8001 return new Target(args[0], args[1], args[2]);
8002
8003 case 4:
8004 return new Target(args[0], args[1], args[2], args[3]);
8005 } // w/o altered newTarget, lot of arguments case
8006
8007
8008 var $args = [null];
8009 apply(push$1, $args, args);
8010 return new (apply(bind$2, Target, $args))();
8011 } // with altered newTarget, not support built-in constructors
8012
8013
8014 var proto = newTarget.prototype;
8015 var instance = create$4(isObject$3(proto) ? proto : ObjectPrototype);
8016 var result = apply(Target, instance, args);
8017 return isObject$3(result) ? result : instance;
8018 }
8019});
8020
8021var path$3 = path$q;
8022var construct$2 = path$3.Reflect.construct;
8023
8024var parent$h = construct$2;
8025var construct$1 = parent$h;
8026
8027var construct = construct$1;
8028
8029function _assertThisInitialized(self) {
8030 if (self === void 0) {
8031 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
8032 }
8033
8034 return self;
8035}
8036
8037var parent$g = create$6;
8038var create$3 = parent$g;
8039
8040var parent$f = create$3;
8041var create$2 = parent$f;
8042
8043var create$1 = create$2;
8044
8045var $$4 = _export;
8046var setPrototypeOf$5 = objectSetPrototypeOf; // `Object.setPrototypeOf` method
8047// https://tc39.es/ecma262/#sec-object.setprototypeof
8048
8049$$4({
8050 target: 'Object',
8051 stat: true
8052}, {
8053 setPrototypeOf: setPrototypeOf$5
8054});
8055
8056var path$2 = path$q;
8057var setPrototypeOf$4 = path$2.Object.setPrototypeOf;
8058
8059var parent$e = setPrototypeOf$4;
8060var setPrototypeOf$3 = parent$e;
8061
8062var parent$d = setPrototypeOf$3;
8063var setPrototypeOf$2 = parent$d;
8064
8065var parent$c = setPrototypeOf$2;
8066var setPrototypeOf$1 = parent$c;
8067
8068var setPrototypeOf = setPrototypeOf$1;
8069
8070function _setPrototypeOf(o, p) {
8071 _setPrototypeOf = setPrototypeOf || function _setPrototypeOf(o, p) {
8072 o.__proto__ = p;
8073 return o;
8074 };
8075
8076 return _setPrototypeOf(o, p);
8077}
8078
8079function _inherits(subClass, superClass) {
8080 if (typeof superClass !== "function" && superClass !== null) {
8081 throw new TypeError("Super expression must either be null or a function");
8082 }
8083
8084 subClass.prototype = create$1(superClass && superClass.prototype, {
8085 constructor: {
8086 value: subClass,
8087 writable: true,
8088 configurable: true
8089 }
8090 });
8091
8092 defineProperty$7(subClass, "prototype", {
8093 writable: false
8094 });
8095
8096 if (superClass) _setPrototypeOf(subClass, superClass);
8097}
8098
8099function _possibleConstructorReturn(self, call) {
8100 if (call && (_typeof(call) === "object" || typeof call === "function")) {
8101 return call;
8102 } else if (call !== void 0) {
8103 throw new TypeError("Derived constructors may only return object or undefined");
8104 }
8105
8106 return _assertThisInitialized(self);
8107}
8108
8109var parent$b = getPrototypeOf$3;
8110var getPrototypeOf$2 = parent$b;
8111
8112var parent$a = getPrototypeOf$2;
8113var getPrototypeOf$1 = parent$a;
8114
8115var getPrototypeOf = getPrototypeOf$1;
8116
8117function _getPrototypeOf(o) {
8118 _getPrototypeOf = setPrototypeOf ? getPrototypeOf : function _getPrototypeOf(o) {
8119 return o.__proto__ || getPrototypeOf(o);
8120 };
8121 return _getPrototypeOf(o);
8122}
8123
8124var runtime = {exports: {}};
8125
8126/**
8127 * Copyright (c) 2014-present, Facebook, Inc.
8128 *
8129 * This source code is licensed under the MIT license found in the
8130 * LICENSE file in the root directory of this source tree.
8131 */
8132
8133(function (module) {
8134 var runtime = function (exports) {
8135
8136 var Op = Object.prototype;
8137 var hasOwn = Op.hasOwnProperty;
8138 var undefined$1; // More compressible than void 0.
8139
8140 var $Symbol = typeof Symbol === "function" ? Symbol : {};
8141 var iteratorSymbol = $Symbol.iterator || "@@iterator";
8142 var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
8143 var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
8144
8145 function define(obj, key, value) {
8146 Object.defineProperty(obj, key, {
8147 value: value,
8148 enumerable: true,
8149 configurable: true,
8150 writable: true
8151 });
8152 return obj[key];
8153 }
8154
8155 try {
8156 // IE 8 has a broken Object.defineProperty that only works on DOM objects.
8157 define({}, "");
8158 } catch (err) {
8159 define = function (obj, key, value) {
8160 return obj[key] = value;
8161 };
8162 }
8163
8164 function wrap(innerFn, outerFn, self, tryLocsList) {
8165 // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
8166 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
8167 var generator = Object.create(protoGenerator.prototype);
8168 var context = new Context(tryLocsList || []); // The ._invoke method unifies the implementations of the .next,
8169 // .throw, and .return methods.
8170
8171 generator._invoke = makeInvokeMethod(innerFn, self, context);
8172 return generator;
8173 }
8174
8175 exports.wrap = wrap; // Try/catch helper to minimize deoptimizations. Returns a completion
8176 // record like context.tryEntries[i].completion. This interface could
8177 // have been (and was previously) designed to take a closure to be
8178 // invoked without arguments, but in all the cases we care about we
8179 // already have an existing method we want to call, so there's no need
8180 // to create a new function object. We can even get away with assuming
8181 // the method takes exactly one argument, since that happens to be true
8182 // in every case, so we don't have to touch the arguments object. The
8183 // only additional allocation required is the completion record, which
8184 // has a stable shape and so hopefully should be cheap to allocate.
8185
8186 function tryCatch(fn, obj, arg) {
8187 try {
8188 return {
8189 type: "normal",
8190 arg: fn.call(obj, arg)
8191 };
8192 } catch (err) {
8193 return {
8194 type: "throw",
8195 arg: err
8196 };
8197 }
8198 }
8199
8200 var GenStateSuspendedStart = "suspendedStart";
8201 var GenStateSuspendedYield = "suspendedYield";
8202 var GenStateExecuting = "executing";
8203 var GenStateCompleted = "completed"; // Returning this object from the innerFn has the same effect as
8204 // breaking out of the dispatch switch statement.
8205
8206 var ContinueSentinel = {}; // Dummy constructor functions that we use as the .constructor and
8207 // .constructor.prototype properties for functions that return Generator
8208 // objects. For full spec compliance, you may wish to configure your
8209 // minifier not to mangle the names of these two functions.
8210
8211 function Generator() {}
8212
8213 function GeneratorFunction() {}
8214
8215 function GeneratorFunctionPrototype() {} // This is a polyfill for %IteratorPrototype% for environments that
8216 // don't natively support it.
8217
8218
8219 var IteratorPrototype = {};
8220 define(IteratorPrototype, iteratorSymbol, function () {
8221 return this;
8222 });
8223 var getProto = Object.getPrototypeOf;
8224 var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
8225
8226 if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
8227 // This environment has a native %IteratorPrototype%; use it instead
8228 // of the polyfill.
8229 IteratorPrototype = NativeIteratorPrototype;
8230 }
8231
8232 var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
8233 GeneratorFunction.prototype = GeneratorFunctionPrototype;
8234 define(Gp, "constructor", GeneratorFunctionPrototype);
8235 define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
8236 GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"); // Helper for defining the .next, .throw, and .return methods of the
8237 // Iterator interface in terms of a single ._invoke method.
8238
8239 function defineIteratorMethods(prototype) {
8240 ["next", "throw", "return"].forEach(function (method) {
8241 define(prototype, method, function (arg) {
8242 return this._invoke(method, arg);
8243 });
8244 });
8245 }
8246
8247 exports.isGeneratorFunction = function (genFun) {
8248 var ctor = typeof genFun === "function" && genFun.constructor;
8249 return ctor ? ctor === GeneratorFunction || // For the native GeneratorFunction constructor, the best we can
8250 // do is to check its .name property.
8251 (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
8252 };
8253
8254 exports.mark = function (genFun) {
8255 if (Object.setPrototypeOf) {
8256 Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
8257 } else {
8258 genFun.__proto__ = GeneratorFunctionPrototype;
8259 define(genFun, toStringTagSymbol, "GeneratorFunction");
8260 }
8261
8262 genFun.prototype = Object.create(Gp);
8263 return genFun;
8264 }; // Within the body of any async function, `await x` is transformed to
8265 // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
8266 // `hasOwn.call(value, "__await")` to determine if the yielded value is
8267 // meant to be awaited.
8268
8269
8270 exports.awrap = function (arg) {
8271 return {
8272 __await: arg
8273 };
8274 };
8275
8276 function AsyncIterator(generator, PromiseImpl) {
8277 function invoke(method, arg, resolve, reject) {
8278 var record = tryCatch(generator[method], generator, arg);
8279
8280 if (record.type === "throw") {
8281 reject(record.arg);
8282 } else {
8283 var result = record.arg;
8284 var value = result.value;
8285
8286 if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
8287 return PromiseImpl.resolve(value.__await).then(function (value) {
8288 invoke("next", value, resolve, reject);
8289 }, function (err) {
8290 invoke("throw", err, resolve, reject);
8291 });
8292 }
8293
8294 return PromiseImpl.resolve(value).then(function (unwrapped) {
8295 // When a yielded Promise is resolved, its final value becomes
8296 // the .value of the Promise<{value,done}> result for the
8297 // current iteration.
8298 result.value = unwrapped;
8299 resolve(result);
8300 }, function (error) {
8301 // If a rejected Promise was yielded, throw the rejection back
8302 // into the async generator function so it can be handled there.
8303 return invoke("throw", error, resolve, reject);
8304 });
8305 }
8306 }
8307
8308 var previousPromise;
8309
8310 function enqueue(method, arg) {
8311 function callInvokeWithMethodAndArg() {
8312 return new PromiseImpl(function (resolve, reject) {
8313 invoke(method, arg, resolve, reject);
8314 });
8315 }
8316
8317 return previousPromise = // If enqueue has been called before, then we want to wait until
8318 // all previous Promises have been resolved before calling invoke,
8319 // so that results are always delivered in the correct order. If
8320 // enqueue has not been called before, then it is important to
8321 // call invoke immediately, without waiting on a callback to fire,
8322 // so that the async generator function has the opportunity to do
8323 // any necessary setup in a predictable way. This predictability
8324 // is why the Promise constructor synchronously invokes its
8325 // executor callback, and why async functions synchronously
8326 // execute code before the first await. Since we implement simple
8327 // async functions in terms of async generators, it is especially
8328 // important to get this right, even though it requires care.
8329 previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, // Avoid propagating failures to Promises returned by later
8330 // invocations of the iterator.
8331 callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
8332 } // Define the unified helper method that is used to implement .next,
8333 // .throw, and .return (see defineIteratorMethods).
8334
8335
8336 this._invoke = enqueue;
8337 }
8338
8339 defineIteratorMethods(AsyncIterator.prototype);
8340 define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
8341 return this;
8342 });
8343 exports.AsyncIterator = AsyncIterator; // Note that simple async functions are implemented on top of
8344 // AsyncIterator objects; they just return a Promise for the value of
8345 // the final result produced by the iterator.
8346
8347 exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
8348 if (PromiseImpl === void 0) PromiseImpl = Promise;
8349 var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
8350 return exports.isGeneratorFunction(outerFn) ? iter // If outerFn is a generator, return the full iterator.
8351 : iter.next().then(function (result) {
8352 return result.done ? result.value : iter.next();
8353 });
8354 };
8355
8356 function makeInvokeMethod(innerFn, self, context) {
8357 var state = GenStateSuspendedStart;
8358 return function invoke(method, arg) {
8359 if (state === GenStateExecuting) {
8360 throw new Error("Generator is already running");
8361 }
8362
8363 if (state === GenStateCompleted) {
8364 if (method === "throw") {
8365 throw arg;
8366 } // Be forgiving, per 25.3.3.3.3 of the spec:
8367 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
8368
8369
8370 return doneResult();
8371 }
8372
8373 context.method = method;
8374 context.arg = arg;
8375
8376 while (true) {
8377 var delegate = context.delegate;
8378
8379 if (delegate) {
8380 var delegateResult = maybeInvokeDelegate(delegate, context);
8381
8382 if (delegateResult) {
8383 if (delegateResult === ContinueSentinel) continue;
8384 return delegateResult;
8385 }
8386 }
8387
8388 if (context.method === "next") {
8389 // Setting context._sent for legacy support of Babel's
8390 // function.sent implementation.
8391 context.sent = context._sent = context.arg;
8392 } else if (context.method === "throw") {
8393 if (state === GenStateSuspendedStart) {
8394 state = GenStateCompleted;
8395 throw context.arg;
8396 }
8397
8398 context.dispatchException(context.arg);
8399 } else if (context.method === "return") {
8400 context.abrupt("return", context.arg);
8401 }
8402
8403 state = GenStateExecuting;
8404 var record = tryCatch(innerFn, self, context);
8405
8406 if (record.type === "normal") {
8407 // If an exception is thrown from innerFn, we leave state ===
8408 // GenStateExecuting and loop back for another invocation.
8409 state = context.done ? GenStateCompleted : GenStateSuspendedYield;
8410
8411 if (record.arg === ContinueSentinel) {
8412 continue;
8413 }
8414
8415 return {
8416 value: record.arg,
8417 done: context.done
8418 };
8419 } else if (record.type === "throw") {
8420 state = GenStateCompleted; // Dispatch the exception by looping back around to the
8421 // context.dispatchException(context.arg) call above.
8422
8423 context.method = "throw";
8424 context.arg = record.arg;
8425 }
8426 }
8427 };
8428 } // Call delegate.iterator[context.method](context.arg) and handle the
8429 // result, either by returning a { value, done } result from the
8430 // delegate iterator, or by modifying context.method and context.arg,
8431 // setting context.delegate to null, and returning the ContinueSentinel.
8432
8433
8434 function maybeInvokeDelegate(delegate, context) {
8435 var method = delegate.iterator[context.method];
8436
8437 if (method === undefined$1) {
8438 // A .throw or .return when the delegate iterator has no .throw
8439 // method always terminates the yield* loop.
8440 context.delegate = null;
8441
8442 if (context.method === "throw") {
8443 // Note: ["return"] must be used for ES3 parsing compatibility.
8444 if (delegate.iterator["return"]) {
8445 // If the delegate iterator has a return method, give it a
8446 // chance to clean up.
8447 context.method = "return";
8448 context.arg = undefined$1;
8449 maybeInvokeDelegate(delegate, context);
8450
8451 if (context.method === "throw") {
8452 // If maybeInvokeDelegate(context) changed context.method from
8453 // "return" to "throw", let that override the TypeError below.
8454 return ContinueSentinel;
8455 }
8456 }
8457
8458 context.method = "throw";
8459 context.arg = new TypeError("The iterator does not provide a 'throw' method");
8460 }
8461
8462 return ContinueSentinel;
8463 }
8464
8465 var record = tryCatch(method, delegate.iterator, context.arg);
8466
8467 if (record.type === "throw") {
8468 context.method = "throw";
8469 context.arg = record.arg;
8470 context.delegate = null;
8471 return ContinueSentinel;
8472 }
8473
8474 var info = record.arg;
8475
8476 if (!info) {
8477 context.method = "throw";
8478 context.arg = new TypeError("iterator result is not an object");
8479 context.delegate = null;
8480 return ContinueSentinel;
8481 }
8482
8483 if (info.done) {
8484 // Assign the result of the finished delegate to the temporary
8485 // variable specified by delegate.resultName (see delegateYield).
8486 context[delegate.resultName] = info.value; // Resume execution at the desired location (see delegateYield).
8487
8488 context.next = delegate.nextLoc; // If context.method was "throw" but the delegate handled the
8489 // exception, let the outer generator proceed normally. If
8490 // context.method was "next", forget context.arg since it has been
8491 // "consumed" by the delegate iterator. If context.method was
8492 // "return", allow the original .return call to continue in the
8493 // outer generator.
8494
8495 if (context.method !== "return") {
8496 context.method = "next";
8497 context.arg = undefined$1;
8498 }
8499 } else {
8500 // Re-yield the result returned by the delegate method.
8501 return info;
8502 } // The delegate iterator is finished, so forget it and continue with
8503 // the outer generator.
8504
8505
8506 context.delegate = null;
8507 return ContinueSentinel;
8508 } // Define Generator.prototype.{next,throw,return} in terms of the
8509 // unified ._invoke helper method.
8510
8511
8512 defineIteratorMethods(Gp);
8513 define(Gp, toStringTagSymbol, "Generator"); // A Generator should always return itself as the iterator object when the
8514 // @@iterator function is called on it. Some browsers' implementations of the
8515 // iterator prototype chain incorrectly implement this, causing the Generator
8516 // object to not be returned from this call. This ensures that doesn't happen.
8517 // See https://github.com/facebook/regenerator/issues/274 for more details.
8518
8519 define(Gp, iteratorSymbol, function () {
8520 return this;
8521 });
8522 define(Gp, "toString", function () {
8523 return "[object Generator]";
8524 });
8525
8526 function pushTryEntry(locs) {
8527 var entry = {
8528 tryLoc: locs[0]
8529 };
8530
8531 if (1 in locs) {
8532 entry.catchLoc = locs[1];
8533 }
8534
8535 if (2 in locs) {
8536 entry.finallyLoc = locs[2];
8537 entry.afterLoc = locs[3];
8538 }
8539
8540 this.tryEntries.push(entry);
8541 }
8542
8543 function resetTryEntry(entry) {
8544 var record = entry.completion || {};
8545 record.type = "normal";
8546 delete record.arg;
8547 entry.completion = record;
8548 }
8549
8550 function Context(tryLocsList) {
8551 // The root entry object (effectively a try statement without a catch
8552 // or a finally block) gives us a place to store values thrown from
8553 // locations where there is no enclosing try statement.
8554 this.tryEntries = [{
8555 tryLoc: "root"
8556 }];
8557 tryLocsList.forEach(pushTryEntry, this);
8558 this.reset(true);
8559 }
8560
8561 exports.keys = function (object) {
8562 var keys = [];
8563
8564 for (var key in object) {
8565 keys.push(key);
8566 }
8567
8568 keys.reverse(); // Rather than returning an object with a next method, we keep
8569 // things simple and return the next function itself.
8570
8571 return function next() {
8572 while (keys.length) {
8573 var key = keys.pop();
8574
8575 if (key in object) {
8576 next.value = key;
8577 next.done = false;
8578 return next;
8579 }
8580 } // To avoid creating an additional object, we just hang the .value
8581 // and .done properties off the next function object itself. This
8582 // also ensures that the minifier will not anonymize the function.
8583
8584
8585 next.done = true;
8586 return next;
8587 };
8588 };
8589
8590 function values(iterable) {
8591 if (iterable) {
8592 var iteratorMethod = iterable[iteratorSymbol];
8593
8594 if (iteratorMethod) {
8595 return iteratorMethod.call(iterable);
8596 }
8597
8598 if (typeof iterable.next === "function") {
8599 return iterable;
8600 }
8601
8602 if (!isNaN(iterable.length)) {
8603 var i = -1,
8604 next = function next() {
8605 while (++i < iterable.length) {
8606 if (hasOwn.call(iterable, i)) {
8607 next.value = iterable[i];
8608 next.done = false;
8609 return next;
8610 }
8611 }
8612
8613 next.value = undefined$1;
8614 next.done = true;
8615 return next;
8616 };
8617
8618 return next.next = next;
8619 }
8620 } // Return an iterator with no values.
8621
8622
8623 return {
8624 next: doneResult
8625 };
8626 }
8627
8628 exports.values = values;
8629
8630 function doneResult() {
8631 return {
8632 value: undefined$1,
8633 done: true
8634 };
8635 }
8636
8637 Context.prototype = {
8638 constructor: Context,
8639 reset: function (skipTempReset) {
8640 this.prev = 0;
8641 this.next = 0; // Resetting context._sent for legacy support of Babel's
8642 // function.sent implementation.
8643
8644 this.sent = this._sent = undefined$1;
8645 this.done = false;
8646 this.delegate = null;
8647 this.method = "next";
8648 this.arg = undefined$1;
8649 this.tryEntries.forEach(resetTryEntry);
8650
8651 if (!skipTempReset) {
8652 for (var name in this) {
8653 // Not sure about the optimal order of these conditions:
8654 if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
8655 this[name] = undefined$1;
8656 }
8657 }
8658 }
8659 },
8660 stop: function () {
8661 this.done = true;
8662 var rootEntry = this.tryEntries[0];
8663 var rootRecord = rootEntry.completion;
8664
8665 if (rootRecord.type === "throw") {
8666 throw rootRecord.arg;
8667 }
8668
8669 return this.rval;
8670 },
8671 dispatchException: function (exception) {
8672 if (this.done) {
8673 throw exception;
8674 }
8675
8676 var context = this;
8677
8678 function handle(loc, caught) {
8679 record.type = "throw";
8680 record.arg = exception;
8681 context.next = loc;
8682
8683 if (caught) {
8684 // If the dispatched exception was caught by a catch block,
8685 // then let that catch block handle the exception normally.
8686 context.method = "next";
8687 context.arg = undefined$1;
8688 }
8689
8690 return !!caught;
8691 }
8692
8693 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
8694 var entry = this.tryEntries[i];
8695 var record = entry.completion;
8696
8697 if (entry.tryLoc === "root") {
8698 // Exception thrown outside of any try block that could handle
8699 // it, so set the completion value of the entire function to
8700 // throw the exception.
8701 return handle("end");
8702 }
8703
8704 if (entry.tryLoc <= this.prev) {
8705 var hasCatch = hasOwn.call(entry, "catchLoc");
8706 var hasFinally = hasOwn.call(entry, "finallyLoc");
8707
8708 if (hasCatch && hasFinally) {
8709 if (this.prev < entry.catchLoc) {
8710 return handle(entry.catchLoc, true);
8711 } else if (this.prev < entry.finallyLoc) {
8712 return handle(entry.finallyLoc);
8713 }
8714 } else if (hasCatch) {
8715 if (this.prev < entry.catchLoc) {
8716 return handle(entry.catchLoc, true);
8717 }
8718 } else if (hasFinally) {
8719 if (this.prev < entry.finallyLoc) {
8720 return handle(entry.finallyLoc);
8721 }
8722 } else {
8723 throw new Error("try statement without catch or finally");
8724 }
8725 }
8726 }
8727 },
8728 abrupt: function (type, arg) {
8729 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
8730 var entry = this.tryEntries[i];
8731
8732 if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
8733 var finallyEntry = entry;
8734 break;
8735 }
8736 }
8737
8738 if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
8739 // Ignore the finally entry if control is not jumping to a
8740 // location outside the try/catch block.
8741 finallyEntry = null;
8742 }
8743
8744 var record = finallyEntry ? finallyEntry.completion : {};
8745 record.type = type;
8746 record.arg = arg;
8747
8748 if (finallyEntry) {
8749 this.method = "next";
8750 this.next = finallyEntry.finallyLoc;
8751 return ContinueSentinel;
8752 }
8753
8754 return this.complete(record);
8755 },
8756 complete: function (record, afterLoc) {
8757 if (record.type === "throw") {
8758 throw record.arg;
8759 }
8760
8761 if (record.type === "break" || record.type === "continue") {
8762 this.next = record.arg;
8763 } else if (record.type === "return") {
8764 this.rval = this.arg = record.arg;
8765 this.method = "return";
8766 this.next = "end";
8767 } else if (record.type === "normal" && afterLoc) {
8768 this.next = afterLoc;
8769 }
8770
8771 return ContinueSentinel;
8772 },
8773 finish: function (finallyLoc) {
8774 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
8775 var entry = this.tryEntries[i];
8776
8777 if (entry.finallyLoc === finallyLoc) {
8778 this.complete(entry.completion, entry.afterLoc);
8779 resetTryEntry(entry);
8780 return ContinueSentinel;
8781 }
8782 }
8783 },
8784 "catch": function (tryLoc) {
8785 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
8786 var entry = this.tryEntries[i];
8787
8788 if (entry.tryLoc === tryLoc) {
8789 var record = entry.completion;
8790
8791 if (record.type === "throw") {
8792 var thrown = record.arg;
8793 resetTryEntry(entry);
8794 }
8795
8796 return thrown;
8797 }
8798 } // The context.catch method must only be called with a location
8799 // argument that corresponds to a known catch block.
8800
8801
8802 throw new Error("illegal catch attempt");
8803 },
8804 delegateYield: function (iterable, resultName, nextLoc) {
8805 this.delegate = {
8806 iterator: values(iterable),
8807 resultName: resultName,
8808 nextLoc: nextLoc
8809 };
8810
8811 if (this.method === "next") {
8812 // Deliberately forget the last sent value so that we don't
8813 // accidentally pass it on to the delegate.
8814 this.arg = undefined$1;
8815 }
8816
8817 return ContinueSentinel;
8818 }
8819 }; // Regardless of whether this script is executing as a CommonJS module
8820 // or not, return the runtime object so that we can declare the variable
8821 // regeneratorRuntime in the outer scope, which allows this module to be
8822 // injected easily by `bin/regenerator --include-runtime script.js`.
8823
8824 return exports;
8825 }( // If this script is executing as a CommonJS module, use module.exports
8826 // as the regeneratorRuntime namespace. Otherwise create a new empty
8827 // object. Either way, the resulting object will be used to initialize
8828 // the regeneratorRuntime variable at the top of this file.
8829 module.exports );
8830
8831 try {
8832 regeneratorRuntime = runtime;
8833 } catch (accidentalStrictMode) {
8834 // This module should not be running in strict mode, so the above
8835 // assignment should always work unless something is misconfigured. Just
8836 // in case runtime.js accidentally runs in strict mode, in modern engines
8837 // we can explicitly access globalThis. In older engines we can escape
8838 // strict mode using a global Function call. This could conceivably fail
8839 // if a Content Security Policy forbids using Function, but in that case
8840 // the proper solution is to fix the accidental strict mode problem. If
8841 // you've misconfigured your bundler to force strict mode and applied a
8842 // CSP to forbid Function, and you're not willing to fix either of those
8843 // problems, please detail your unique predicament in a GitHub issue.
8844 if (typeof globalThis === "object") {
8845 globalThis.regeneratorRuntime = runtime;
8846 } else {
8847 Function("r", "regeneratorRuntime = r")(runtime);
8848 }
8849 }
8850})(runtime);
8851
8852var regenerator = runtime.exports;
8853
8854var internalMetadata = {exports: {}};
8855
8856var fails$4 = fails$r;
8857var arrayBufferNonExtensible = fails$4(function () {
8858 if (typeof ArrayBuffer == 'function') {
8859 var buffer = new ArrayBuffer(8); // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe
8860
8861 if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', {
8862 value: 8
8863 });
8864 }
8865});
8866
8867var fails$3 = fails$r;
8868var isObject$2 = isObject$f;
8869var classof$3 = classofRaw$1;
8870var ARRAY_BUFFER_NON_EXTENSIBLE = arrayBufferNonExtensible; // eslint-disable-next-line es/no-object-isextensible -- safe
8871
8872var $isExtensible = Object.isExtensible;
8873var FAILS_ON_PRIMITIVES = fails$3(function () {
8874 $isExtensible(1);
8875}); // `Object.isExtensible` method
8876// https://tc39.es/ecma262/#sec-object.isextensible
8877
8878var objectIsExtensible = FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE ? function isExtensible(it) {
8879 if (!isObject$2(it)) return false;
8880 if (ARRAY_BUFFER_NON_EXTENSIBLE && classof$3(it) == 'ArrayBuffer') return false;
8881 return $isExtensible ? $isExtensible(it) : true;
8882} : $isExtensible;
8883
8884var fails$2 = fails$r;
8885var freezing = !fails$2(function () {
8886 // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
8887 return Object.isExtensible(Object.preventExtensions({}));
8888});
8889
8890var $$3 = _export;
8891var uncurryThis$1 = functionUncurryThis;
8892var hiddenKeys = hiddenKeys$6;
8893var isObject$1 = isObject$f;
8894var hasOwn$3 = hasOwnProperty_1;
8895var defineProperty$2 = objectDefineProperty.f;
8896var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
8897var getOwnPropertyNamesExternalModule = objectGetOwnPropertyNamesExternal;
8898var isExtensible = objectIsExtensible;
8899var uid = uid$4;
8900var FREEZING = freezing;
8901var REQUIRED = false;
8902var METADATA = uid('meta');
8903var id = 0;
8904
8905var setMetadata = function (it) {
8906 defineProperty$2(it, METADATA, {
8907 value: {
8908 objectID: 'O' + id++,
8909 // object ID
8910 weakData: {} // weak collections IDs
8911
8912 }
8913 });
8914};
8915
8916var fastKey$1 = function (it, create) {
8917 // return a primitive with prefix
8918 if (!isObject$1(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
8919
8920 if (!hasOwn$3(it, METADATA)) {
8921 // can't set metadata to uncaught frozen object
8922 if (!isExtensible(it)) return 'F'; // not necessary to add metadata
8923
8924 if (!create) return 'E'; // add missing metadata
8925
8926 setMetadata(it); // return object ID
8927 }
8928
8929 return it[METADATA].objectID;
8930};
8931
8932var getWeakData = function (it, create) {
8933 if (!hasOwn$3(it, METADATA)) {
8934 // can't set metadata to uncaught frozen object
8935 if (!isExtensible(it)) return true; // not necessary to add metadata
8936
8937 if (!create) return false; // add missing metadata
8938
8939 setMetadata(it); // return the store of weak collections IDs
8940 }
8941
8942 return it[METADATA].weakData;
8943}; // add metadata on freeze-family methods calling
8944
8945
8946var onFreeze = function (it) {
8947 if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn$3(it, METADATA)) setMetadata(it);
8948 return it;
8949};
8950
8951var enable = function () {
8952 meta.enable = function () {
8953 /* empty */
8954 };
8955
8956 REQUIRED = true;
8957 var getOwnPropertyNames = getOwnPropertyNamesModule.f;
8958 var splice = uncurryThis$1([].splice);
8959 var test = {};
8960 test[METADATA] = 1; // prevent exposing of metadata key
8961
8962 if (getOwnPropertyNames(test).length) {
8963 getOwnPropertyNamesModule.f = function (it) {
8964 var result = getOwnPropertyNames(it);
8965
8966 for (var i = 0, length = result.length; i < length; i++) {
8967 if (result[i] === METADATA) {
8968 splice(result, i, 1);
8969 break;
8970 }
8971 }
8972
8973 return result;
8974 };
8975
8976 $$3({
8977 target: 'Object',
8978 stat: true,
8979 forced: true
8980 }, {
8981 getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
8982 });
8983 }
8984};
8985
8986var meta = internalMetadata.exports = {
8987 enable: enable,
8988 fastKey: fastKey$1,
8989 getWeakData: getWeakData,
8990 onFreeze: onFreeze
8991};
8992hiddenKeys[METADATA] = true;
8993
8994var global$3 = global$M;
8995var bind$1 = functionBindContext;
8996var call = functionCall;
8997var anObject = anObject$b;
8998var tryToString = tryToString$4;
8999var isArrayIteratorMethod = isArrayIteratorMethod$2;
9000var lengthOfArrayLike$1 = lengthOfArrayLike$d;
9001var isPrototypeOf$6 = objectIsPrototypeOf;
9002var getIterator$5 = getIterator$7;
9003var getIteratorMethod = getIteratorMethod$8;
9004var iteratorClose = iteratorClose$2;
9005var TypeError$2 = global$3.TypeError;
9006
9007var Result = function (stopped, result) {
9008 this.stopped = stopped;
9009 this.result = result;
9010};
9011
9012var ResultPrototype = Result.prototype;
9013
9014var iterate$2 = function (iterable, unboundFunction, options) {
9015 var that = options && options.that;
9016 var AS_ENTRIES = !!(options && options.AS_ENTRIES);
9017 var IS_ITERATOR = !!(options && options.IS_ITERATOR);
9018 var INTERRUPTED = !!(options && options.INTERRUPTED);
9019 var fn = bind$1(unboundFunction, that);
9020 var iterator, iterFn, index, length, result, next, step;
9021
9022 var stop = function (condition) {
9023 if (iterator) iteratorClose(iterator, 'normal', condition);
9024 return new Result(true, condition);
9025 };
9026
9027 var callFn = function (value) {
9028 if (AS_ENTRIES) {
9029 anObject(value);
9030 return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
9031 }
9032
9033 return INTERRUPTED ? fn(value, stop) : fn(value);
9034 };
9035
9036 if (IS_ITERATOR) {
9037 iterator = iterable;
9038 } else {
9039 iterFn = getIteratorMethod(iterable);
9040 if (!iterFn) throw TypeError$2(tryToString(iterable) + ' is not iterable'); // optimisation for array iterators
9041
9042 if (isArrayIteratorMethod(iterFn)) {
9043 for (index = 0, length = lengthOfArrayLike$1(iterable); length > index; index++) {
9044 result = callFn(iterable[index]);
9045 if (result && isPrototypeOf$6(ResultPrototype, result)) return result;
9046 }
9047
9048 return new Result(false);
9049 }
9050
9051 iterator = getIterator$5(iterable, iterFn);
9052 }
9053
9054 next = iterator.next;
9055
9056 while (!(step = call(next, iterator)).done) {
9057 try {
9058 result = callFn(step.value);
9059 } catch (error) {
9060 iteratorClose(iterator, 'throw', error);
9061 }
9062
9063 if (typeof result == 'object' && result && isPrototypeOf$6(ResultPrototype, result)) return result;
9064 }
9065
9066 return new Result(false);
9067};
9068
9069var global$2 = global$M;
9070var isPrototypeOf$5 = objectIsPrototypeOf;
9071var TypeError$1 = global$2.TypeError;
9072
9073var anInstance$2 = function (it, Prototype) {
9074 if (isPrototypeOf$5(Prototype, it)) return it;
9075 throw TypeError$1('Incorrect invocation');
9076};
9077
9078var $$2 = _export;
9079var global$1 = global$M;
9080var InternalMetadataModule = internalMetadata.exports;
9081var fails$1 = fails$r;
9082var createNonEnumerableProperty = createNonEnumerableProperty$6;
9083var iterate$1 = iterate$2;
9084var anInstance$1 = anInstance$2;
9085var isCallable = isCallable$h;
9086var isObject = isObject$f;
9087var setToStringTag = setToStringTag$5;
9088var defineProperty$1 = objectDefineProperty.f;
9089var forEach = arrayIteration.forEach;
9090var DESCRIPTORS$2 = descriptors;
9091var InternalStateModule$1 = internalState;
9092var setInternalState$1 = InternalStateModule$1.set;
9093var internalStateGetterFor$1 = InternalStateModule$1.getterFor;
9094
9095var collection$2 = function (CONSTRUCTOR_NAME, wrapper, common) {
9096 var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
9097 var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
9098 var ADDER = IS_MAP ? 'set' : 'add';
9099 var NativeConstructor = global$1[CONSTRUCTOR_NAME];
9100 var NativePrototype = NativeConstructor && NativeConstructor.prototype;
9101 var exported = {};
9102 var Constructor;
9103
9104 if (!DESCRIPTORS$2 || !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails$1(function () {
9105 new NativeConstructor().entries().next();
9106 }))) {
9107 // create collection constructor
9108 Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
9109 InternalMetadataModule.enable();
9110 } else {
9111 Constructor = wrapper(function (target, iterable) {
9112 setInternalState$1(anInstance$1(target, Prototype), {
9113 type: CONSTRUCTOR_NAME,
9114 collection: new NativeConstructor()
9115 });
9116 if (iterable != undefined) iterate$1(iterable, target[ADDER], {
9117 that: target,
9118 AS_ENTRIES: IS_MAP
9119 });
9120 });
9121 var Prototype = Constructor.prototype;
9122 var getInternalState = internalStateGetterFor$1(CONSTRUCTOR_NAME);
9123 forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
9124 var IS_ADDER = KEY == 'add' || KEY == 'set';
9125
9126 if (KEY in NativePrototype && !(IS_WEAK && KEY == 'clear')) {
9127 createNonEnumerableProperty(Prototype, KEY, function (a, b) {
9128 var collection = getInternalState(this).collection;
9129 if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY == 'get' ? undefined : false;
9130 var result = collection[KEY](a === 0 ? 0 : a, b);
9131 return IS_ADDER ? this : result;
9132 });
9133 }
9134 });
9135 IS_WEAK || defineProperty$1(Prototype, 'size', {
9136 configurable: true,
9137 get: function () {
9138 return getInternalState(this).collection.size;
9139 }
9140 });
9141 }
9142
9143 setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
9144 exported[CONSTRUCTOR_NAME] = Constructor;
9145 $$2({
9146 global: true,
9147 forced: true
9148 }, exported);
9149 if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
9150 return Constructor;
9151};
9152
9153var redefine = redefine$4;
9154
9155var redefineAll$1 = function (target, src, options) {
9156 for (var key in src) {
9157 if (options && options.unsafe && target[key]) target[key] = src[key];else redefine(target, key, src[key], options);
9158 }
9159
9160 return target;
9161};
9162
9163var getBuiltIn = getBuiltIn$9;
9164var definePropertyModule = objectDefineProperty;
9165var wellKnownSymbol = wellKnownSymbol$j;
9166var DESCRIPTORS$1 = descriptors;
9167var SPECIES = wellKnownSymbol('species');
9168
9169var setSpecies$1 = function (CONSTRUCTOR_NAME) {
9170 var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
9171 var defineProperty = definePropertyModule.f;
9172
9173 if (DESCRIPTORS$1 && Constructor && !Constructor[SPECIES]) {
9174 defineProperty(Constructor, SPECIES, {
9175 configurable: true,
9176 get: function () {
9177 return this;
9178 }
9179 });
9180 }
9181};
9182
9183var defineProperty = objectDefineProperty.f;
9184var create = objectCreate;
9185var redefineAll = redefineAll$1;
9186var bind = functionBindContext;
9187var anInstance = anInstance$2;
9188var iterate = iterate$2;
9189var defineIterator = defineIterator$3;
9190var setSpecies = setSpecies$1;
9191var DESCRIPTORS = descriptors;
9192var fastKey = internalMetadata.exports.fastKey;
9193var InternalStateModule = internalState;
9194var setInternalState = InternalStateModule.set;
9195var internalStateGetterFor = InternalStateModule.getterFor;
9196var collectionStrong$2 = {
9197 getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
9198 var Constructor = wrapper(function (that, iterable) {
9199 anInstance(that, Prototype);
9200 setInternalState(that, {
9201 type: CONSTRUCTOR_NAME,
9202 index: create(null),
9203 first: undefined,
9204 last: undefined,
9205 size: 0
9206 });
9207 if (!DESCRIPTORS) that.size = 0;
9208 if (iterable != undefined) iterate(iterable, that[ADDER], {
9209 that: that,
9210 AS_ENTRIES: IS_MAP
9211 });
9212 });
9213 var Prototype = Constructor.prototype;
9214 var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
9215
9216 var define = function (that, key, value) {
9217 var state = getInternalState(that);
9218 var entry = getEntry(that, key);
9219 var previous, index; // change existing entry
9220
9221 if (entry) {
9222 entry.value = value; // create new entry
9223 } else {
9224 state.last = entry = {
9225 index: index = fastKey(key, true),
9226 key: key,
9227 value: value,
9228 previous: previous = state.last,
9229 next: undefined,
9230 removed: false
9231 };
9232 if (!state.first) state.first = entry;
9233 if (previous) previous.next = entry;
9234 if (DESCRIPTORS) state.size++;else that.size++; // add to index
9235
9236 if (index !== 'F') state.index[index] = entry;
9237 }
9238
9239 return that;
9240 };
9241
9242 var getEntry = function (that, key) {
9243 var state = getInternalState(that); // fast case
9244
9245 var index = fastKey(key);
9246 var entry;
9247 if (index !== 'F') return state.index[index]; // frozen object case
9248
9249 for (entry = state.first; entry; entry = entry.next) {
9250 if (entry.key == key) return entry;
9251 }
9252 };
9253
9254 redefineAll(Prototype, {
9255 // `{ Map, Set }.prototype.clear()` methods
9256 // https://tc39.es/ecma262/#sec-map.prototype.clear
9257 // https://tc39.es/ecma262/#sec-set.prototype.clear
9258 clear: function clear() {
9259 var that = this;
9260 var state = getInternalState(that);
9261 var data = state.index;
9262 var entry = state.first;
9263
9264 while (entry) {
9265 entry.removed = true;
9266 if (entry.previous) entry.previous = entry.previous.next = undefined;
9267 delete data[entry.index];
9268 entry = entry.next;
9269 }
9270
9271 state.first = state.last = undefined;
9272 if (DESCRIPTORS) state.size = 0;else that.size = 0;
9273 },
9274 // `{ Map, Set }.prototype.delete(key)` methods
9275 // https://tc39.es/ecma262/#sec-map.prototype.delete
9276 // https://tc39.es/ecma262/#sec-set.prototype.delete
9277 'delete': function (key) {
9278 var that = this;
9279 var state = getInternalState(that);
9280 var entry = getEntry(that, key);
9281
9282 if (entry) {
9283 var next = entry.next;
9284 var prev = entry.previous;
9285 delete state.index[entry.index];
9286 entry.removed = true;
9287 if (prev) prev.next = next;
9288 if (next) next.previous = prev;
9289 if (state.first == entry) state.first = next;
9290 if (state.last == entry) state.last = prev;
9291 if (DESCRIPTORS) state.size--;else that.size--;
9292 }
9293
9294 return !!entry;
9295 },
9296 // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods
9297 // https://tc39.es/ecma262/#sec-map.prototype.foreach
9298 // https://tc39.es/ecma262/#sec-set.prototype.foreach
9299 forEach: function forEach(callbackfn
9300 /* , that = undefined */
9301 ) {
9302 var state = getInternalState(this);
9303 var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
9304 var entry;
9305
9306 while (entry = entry ? entry.next : state.first) {
9307 boundFunction(entry.value, entry.key, this); // revert to the last existing entry
9308
9309 while (entry && entry.removed) entry = entry.previous;
9310 }
9311 },
9312 // `{ Map, Set}.prototype.has(key)` methods
9313 // https://tc39.es/ecma262/#sec-map.prototype.has
9314 // https://tc39.es/ecma262/#sec-set.prototype.has
9315 has: function has(key) {
9316 return !!getEntry(this, key);
9317 }
9318 });
9319 redefineAll(Prototype, IS_MAP ? {
9320 // `Map.prototype.get(key)` method
9321 // https://tc39.es/ecma262/#sec-map.prototype.get
9322 get: function get(key) {
9323 var entry = getEntry(this, key);
9324 return entry && entry.value;
9325 },
9326 // `Map.prototype.set(key, value)` method
9327 // https://tc39.es/ecma262/#sec-map.prototype.set
9328 set: function set(key, value) {
9329 return define(this, key === 0 ? 0 : key, value);
9330 }
9331 } : {
9332 // `Set.prototype.add(value)` method
9333 // https://tc39.es/ecma262/#sec-set.prototype.add
9334 add: function add(value) {
9335 return define(this, value = value === 0 ? 0 : value, value);
9336 }
9337 });
9338 if (DESCRIPTORS) defineProperty(Prototype, 'size', {
9339 get: function () {
9340 return getInternalState(this).size;
9341 }
9342 });
9343 return Constructor;
9344 },
9345 setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
9346 var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
9347 var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
9348 var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods
9349 // https://tc39.es/ecma262/#sec-map.prototype.entries
9350 // https://tc39.es/ecma262/#sec-map.prototype.keys
9351 // https://tc39.es/ecma262/#sec-map.prototype.values
9352 // https://tc39.es/ecma262/#sec-map.prototype-@@iterator
9353 // https://tc39.es/ecma262/#sec-set.prototype.entries
9354 // https://tc39.es/ecma262/#sec-set.prototype.keys
9355 // https://tc39.es/ecma262/#sec-set.prototype.values
9356 // https://tc39.es/ecma262/#sec-set.prototype-@@iterator
9357
9358 defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
9359 setInternalState(this, {
9360 type: ITERATOR_NAME,
9361 target: iterated,
9362 state: getInternalCollectionState(iterated),
9363 kind: kind,
9364 last: undefined
9365 });
9366 }, function () {
9367 var state = getInternalIteratorState(this);
9368 var kind = state.kind;
9369 var entry = state.last; // revert to the last existing entry
9370
9371 while (entry && entry.removed) entry = entry.previous; // get next entry
9372
9373
9374 if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
9375 // or finish the iteration
9376 state.target = undefined;
9377 return {
9378 value: undefined,
9379 done: true
9380 };
9381 } // return step by kind
9382
9383
9384 if (kind == 'keys') return {
9385 value: entry.key,
9386 done: false
9387 };
9388 if (kind == 'values') return {
9389 value: entry.value,
9390 done: false
9391 };
9392 return {
9393 value: [entry.key, entry.value],
9394 done: false
9395 };
9396 }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); // `{ Map, Set }.prototype[@@species]` accessors
9397 // https://tc39.es/ecma262/#sec-get-map-@@species
9398 // https://tc39.es/ecma262/#sec-get-set-@@species
9399
9400 setSpecies(CONSTRUCTOR_NAME);
9401 }
9402};
9403
9404var collection$1 = collection$2;
9405var collectionStrong$1 = collectionStrong$2; // `Map` constructor
9406// https://tc39.es/ecma262/#sec-map-objects
9407
9408collection$1('Map', function (init) {
9409 return function Map() {
9410 return init(this, arguments.length ? arguments[0] : undefined);
9411 };
9412}, collectionStrong$1);
9413
9414var path$1 = path$q;
9415var map$2 = path$1.Map;
9416
9417var parent$9 = map$2;
9418var map$1 = parent$9;
9419
9420var map = map$1;
9421
9422var $$1 = _export;
9423var $some = arrayIteration.some;
9424var arrayMethodIsStrict$1 = arrayMethodIsStrict$5;
9425var STRICT_METHOD$1 = arrayMethodIsStrict$1('some'); // `Array.prototype.some` method
9426// https://tc39.es/ecma262/#sec-array.prototype.some
9427
9428$$1({
9429 target: 'Array',
9430 proto: true,
9431 forced: !STRICT_METHOD$1
9432}, {
9433 some: function some(callbackfn
9434 /* , thisArg */
9435 ) {
9436 return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
9437 }
9438});
9439
9440var entryVirtual$4 = entryVirtual$k;
9441var some$3 = entryVirtual$4('Array').some;
9442
9443var isPrototypeOf$4 = objectIsPrototypeOf;
9444var method$4 = some$3;
9445var ArrayPrototype$4 = Array.prototype;
9446
9447var some$2 = function (it) {
9448 var own = it.some;
9449 return it === ArrayPrototype$4 || isPrototypeOf$4(ArrayPrototype$4, it) && own === ArrayPrototype$4.some ? method$4 : own;
9450};
9451
9452var parent$8 = some$2;
9453var some$1 = parent$8;
9454
9455var some = some$1;
9456
9457var entryVirtual$3 = entryVirtual$k;
9458var keys$3 = entryVirtual$3('Array').keys;
9459
9460var parent$7 = keys$3;
9461var keys$2 = parent$7;
9462
9463var classof$2 = classof$c;
9464var hasOwn$2 = hasOwnProperty_1;
9465var isPrototypeOf$3 = objectIsPrototypeOf;
9466var method$3 = keys$2;
9467var ArrayPrototype$3 = Array.prototype;
9468var DOMIterables$2 = {
9469 DOMTokenList: true,
9470 NodeList: true
9471};
9472
9473var keys$1 = function (it) {
9474 var own = it.keys;
9475 return it === ArrayPrototype$3 || isPrototypeOf$3(ArrayPrototype$3, it) && own === ArrayPrototype$3.keys || hasOwn$2(DOMIterables$2, classof$2(it)) ? method$3 : own;
9476};
9477
9478var keys = keys$1;
9479
9480var arraySlice = arraySliceSimple;
9481var floor = Math.floor;
9482
9483var mergeSort = function (array, comparefn) {
9484 var length = array.length;
9485 var middle = floor(length / 2);
9486 return length < 8 ? insertionSort(array, comparefn) : merge(array, mergeSort(arraySlice(array, 0, middle), comparefn), mergeSort(arraySlice(array, middle), comparefn), comparefn);
9487};
9488
9489var insertionSort = function (array, comparefn) {
9490 var length = array.length;
9491 var i = 1;
9492 var element, j;
9493
9494 while (i < length) {
9495 j = i;
9496 element = array[i];
9497
9498 while (j && comparefn(array[j - 1], element) > 0) {
9499 array[j] = array[--j];
9500 }
9501
9502 if (j !== i++) array[j] = element;
9503 }
9504
9505 return array;
9506};
9507
9508var merge = function (array, left, right, comparefn) {
9509 var llength = left.length;
9510 var rlength = right.length;
9511 var lindex = 0;
9512 var rindex = 0;
9513
9514 while (lindex < llength || rindex < rlength) {
9515 array[lindex + rindex] = lindex < llength && rindex < rlength ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++] : lindex < llength ? left[lindex++] : right[rindex++];
9516 }
9517
9518 return array;
9519};
9520
9521var arraySort = mergeSort;
9522
9523var userAgent$1 = engineUserAgent;
9524var firefox = userAgent$1.match(/firefox\/(\d+)/i);
9525var engineFfVersion = !!firefox && +firefox[1];
9526
9527var UA = engineUserAgent;
9528var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
9529
9530var userAgent = engineUserAgent;
9531var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
9532var engineWebkitVersion = !!webkit && +webkit[1];
9533
9534var $ = _export;
9535var uncurryThis = functionUncurryThis;
9536var aCallable = aCallable$7;
9537var toObject = toObject$e;
9538var lengthOfArrayLike = lengthOfArrayLike$d;
9539var toString = toString$7;
9540var fails = fails$r;
9541var internalSort = arraySort;
9542var arrayMethodIsStrict = arrayMethodIsStrict$5;
9543var FF = engineFfVersion;
9544var IE_OR_EDGE = engineIsIeOrEdge;
9545var V8 = engineV8Version;
9546var WEBKIT = engineWebkitVersion;
9547var test = [];
9548var un$Sort = uncurryThis(test.sort);
9549var push = uncurryThis(test.push); // IE8-
9550
9551var FAILS_ON_UNDEFINED = fails(function () {
9552 test.sort(undefined);
9553}); // V8 bug
9554
9555var FAILS_ON_NULL = fails(function () {
9556 test.sort(null);
9557}); // Old WebKit
9558
9559var STRICT_METHOD = arrayMethodIsStrict('sort');
9560var STABLE_SORT = !fails(function () {
9561 // feature detection can be too slow, so check engines versions
9562 if (V8) return V8 < 70;
9563 if (FF && FF > 3) return;
9564 if (IE_OR_EDGE) return true;
9565 if (WEBKIT) return WEBKIT < 603;
9566 var result = '';
9567 var code, chr, value, index; // generate an array with more 512 elements (Chakra and old V8 fails only in this case)
9568
9569 for (code = 65; code < 76; code++) {
9570 chr = String.fromCharCode(code);
9571
9572 switch (code) {
9573 case 66:
9574 case 69:
9575 case 70:
9576 case 72:
9577 value = 3;
9578 break;
9579
9580 case 68:
9581 case 71:
9582 value = 4;
9583 break;
9584
9585 default:
9586 value = 2;
9587 }
9588
9589 for (index = 0; index < 47; index++) {
9590 test.push({
9591 k: chr + index,
9592 v: value
9593 });
9594 }
9595 }
9596
9597 test.sort(function (a, b) {
9598 return b.v - a.v;
9599 });
9600
9601 for (index = 0; index < test.length; index++) {
9602 chr = test[index].k.charAt(0);
9603 if (result.charAt(result.length - 1) !== chr) result += chr;
9604 }
9605
9606 return result !== 'DGBEFHACIJK';
9607});
9608var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
9609
9610var getSortCompare = function (comparefn) {
9611 return function (x, y) {
9612 if (y === undefined) return -1;
9613 if (x === undefined) return 1;
9614 if (comparefn !== undefined) return +comparefn(x, y) || 0;
9615 return toString(x) > toString(y) ? 1 : -1;
9616 };
9617}; // `Array.prototype.sort` method
9618// https://tc39.es/ecma262/#sec-array.prototype.sort
9619
9620
9621$({
9622 target: 'Array',
9623 proto: true,
9624 forced: FORCED
9625}, {
9626 sort: function sort(comparefn) {
9627 if (comparefn !== undefined) aCallable(comparefn);
9628 var array = toObject(this);
9629 if (STABLE_SORT) return comparefn === undefined ? un$Sort(array) : un$Sort(array, comparefn);
9630 var items = [];
9631 var arrayLength = lengthOfArrayLike(array);
9632 var itemsLength, index;
9633
9634 for (index = 0; index < arrayLength; index++) {
9635 if (index in array) push(items, array[index]);
9636 }
9637
9638 internalSort(items, getSortCompare(comparefn));
9639 itemsLength = items.length;
9640 index = 0;
9641
9642 while (index < itemsLength) array[index] = items[index++];
9643
9644 while (index < arrayLength) delete array[index++];
9645
9646 return array;
9647 }
9648});
9649
9650var entryVirtual$2 = entryVirtual$k;
9651var sort$3 = entryVirtual$2('Array').sort;
9652
9653var isPrototypeOf$2 = objectIsPrototypeOf;
9654var method$2 = sort$3;
9655var ArrayPrototype$2 = Array.prototype;
9656
9657var sort$2 = function (it) {
9658 var own = it.sort;
9659 return it === ArrayPrototype$2 || isPrototypeOf$2(ArrayPrototype$2, it) && own === ArrayPrototype$2.sort ? method$2 : own;
9660};
9661
9662var parent$6 = sort$2;
9663var sort$1 = parent$6;
9664
9665var sort = sort$1;
9666
9667var entryVirtual$1 = entryVirtual$k;
9668var values$3 = entryVirtual$1('Array').values;
9669
9670var parent$5 = values$3;
9671var values$2 = parent$5;
9672
9673var classof$1 = classof$c;
9674var hasOwn$1 = hasOwnProperty_1;
9675var isPrototypeOf$1 = objectIsPrototypeOf;
9676var method$1 = values$2;
9677var ArrayPrototype$1 = Array.prototype;
9678var DOMIterables$1 = {
9679 DOMTokenList: true,
9680 NodeList: true
9681};
9682
9683var values$1 = function (it) {
9684 var own = it.values;
9685 return it === ArrayPrototype$1 || isPrototypeOf$1(ArrayPrototype$1, it) && own === ArrayPrototype$1.values || hasOwn$1(DOMIterables$1, classof$1(it)) ? method$1 : own;
9686};
9687
9688var values = values$1;
9689
9690var iterator = iterator$4;
9691
9692var entryVirtual = entryVirtual$k;
9693var entries$3 = entryVirtual('Array').entries;
9694
9695var parent$4 = entries$3;
9696var entries$2 = parent$4;
9697
9698var classof = classof$c;
9699var hasOwn = hasOwnProperty_1;
9700var isPrototypeOf = objectIsPrototypeOf;
9701var method = entries$2;
9702var ArrayPrototype = Array.prototype;
9703var DOMIterables = {
9704 DOMTokenList: true,
9705 NodeList: true
9706};
9707
9708var entries$1 = function (it) {
9709 var own = it.entries;
9710 return it === ArrayPrototype || isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.entries || hasOwn(DOMIterables, classof(it)) ? method : own;
9711};
9712
9713var entries = entries$1;
9714
9715// Unique ID creation requires a high quality random # generator. In the browser we therefore
9716// require the crypto API and do not support built-in fallback to lower quality random number
9717// generators (like Math.random()).
9718var getRandomValues;
9719var rnds8 = new Uint8Array(16);
9720function rng() {
9721 // lazy load so that environments that need to polyfill have a chance to do so
9722 if (!getRandomValues) {
9723 // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
9724 // find the complete implementation of crypto (msCrypto) on IE11.
9725 getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
9726
9727 if (!getRandomValues) {
9728 throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
9729 }
9730 }
9731
9732 return getRandomValues(rnds8);
9733}
9734
9735var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
9736
9737function validate(uuid) {
9738 return typeof uuid === 'string' && REGEX.test(uuid);
9739}
9740
9741/**
9742 * Convert array of 16 byte values to UUID string format of the form:
9743 * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
9744 */
9745
9746var byteToHex = [];
9747
9748for (var i = 0; i < 256; ++i) {
9749 byteToHex.push((i + 0x100).toString(16).substr(1));
9750}
9751
9752function stringify(arr) {
9753 var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; // Note: Be careful editing this code! It's been tuned for performance
9754 // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
9755
9756 var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
9757 // of the following:
9758 // - One or more input array values don't map to a hex octet (leading to
9759 // "undefined" in the uuid)
9760 // - Invalid input values for the RFC `version` or `variant` fields
9761
9762 if (!validate(uuid)) {
9763 throw TypeError('Stringified UUID is invalid');
9764 }
9765
9766 return uuid;
9767}
9768
9769function v4(options, buf, offset) {
9770 options = options || {};
9771 var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
9772
9773 rnds[6] = rnds[6] & 0x0f | 0x40;
9774 rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
9775
9776 if (buf) {
9777 offset = offset || 0;
9778
9779 for (var i = 0; i < 16; ++i) {
9780 buf[offset + i] = rnds[i];
9781 }
9782
9783 return buf;
9784 }
9785
9786 return stringify(rnds);
9787}
9788
9789/**
9790 * Determine whether a value can be used as an id.
9791 *
9792 * @param value - Input value of unknown type.
9793 * @returns True if the value is valid id, false otherwise.
9794 */
9795function isId(value) {
9796 return typeof value === "string" || typeof value === "number";
9797}
9798
9799/**
9800 * A queue.
9801 *
9802 * @typeParam T - The type of method names to be replaced by queued versions.
9803 */
9804var Queue = /*#__PURE__*/function () {
9805 /** Delay in milliseconds. If defined the queue will be periodically flushed. */
9806
9807 /** Maximum number of entries in the queue before it will be flushed. */
9808
9809 /**
9810 * Construct a new Queue.
9811 *
9812 * @param options - Queue configuration.
9813 */
9814 function Queue(options) {
9815 _classCallCheck(this, Queue);
9816
9817 _defineProperty(this, "delay", void 0);
9818
9819 _defineProperty(this, "max", void 0);
9820
9821 _defineProperty(this, "_queue", []);
9822
9823 _defineProperty(this, "_timeout", null);
9824
9825 _defineProperty(this, "_extended", null);
9826
9827 // options
9828 this.delay = null;
9829 this.max = Infinity;
9830 this.setOptions(options);
9831 }
9832 /**
9833 * Update the configuration of the queue.
9834 *
9835 * @param options - Queue configuration.
9836 */
9837
9838
9839 _createClass(Queue, [{
9840 key: "setOptions",
9841 value: function setOptions(options) {
9842 if (options && typeof options.delay !== "undefined") {
9843 this.delay = options.delay;
9844 }
9845
9846 if (options && typeof options.max !== "undefined") {
9847 this.max = options.max;
9848 }
9849
9850 this._flushIfNeeded();
9851 }
9852 /**
9853 * Extend an object with queuing functionality.
9854 * The object will be extended with a function flush, and the methods provided in options.replace will be replaced with queued ones.
9855 *
9856 * @param object - The object to be extended.
9857 * @param options - Additional options.
9858 * @returns The created queue.
9859 */
9860
9861 }, {
9862 key: "destroy",
9863 value:
9864 /**
9865 * Destroy the queue. The queue will first flush all queued actions, and in case it has extended an object, will restore the original object.
9866 */
9867 function destroy() {
9868 this.flush();
9869
9870 if (this._extended) {
9871 var object = this._extended.object;
9872 var methods = this._extended.methods;
9873
9874 for (var i = 0; i < methods.length; i++) {
9875 var method = methods[i];
9876
9877 if (method.original) {
9878 // @TODO: better solution?
9879 object[method.name] = method.original;
9880 } else {
9881 // @TODO: better solution?
9882 delete object[method.name];
9883 }
9884 }
9885
9886 this._extended = null;
9887 }
9888 }
9889 /**
9890 * Replace a method on an object with a queued version.
9891 *
9892 * @param object - Object having the method.
9893 * @param method - The method name.
9894 */
9895
9896 }, {
9897 key: "replace",
9898 value: function replace(object, method) {
9899 /* eslint-disable-next-line @typescript-eslint/no-this-alias -- Function this is necessary in the function bellow, so class this has to be saved into a variable here. */
9900 var me = this;
9901 var original = object[method];
9902
9903 if (!original) {
9904 throw new Error("Method " + method + " undefined");
9905 }
9906
9907 object[method] = function () {
9908 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9909 args[_key] = arguments[_key];
9910 }
9911
9912 // add this call to the queue
9913 me.queue({
9914 args: args,
9915 fn: original,
9916 context: this
9917 });
9918 };
9919 }
9920 /**
9921 * Queue a call.
9922 *
9923 * @param entry - The function or entry to be queued.
9924 */
9925
9926 }, {
9927 key: "queue",
9928 value: function queue(entry) {
9929 if (typeof entry === "function") {
9930 this._queue.push({
9931 fn: entry
9932 });
9933 } else {
9934 this._queue.push(entry);
9935 }
9936
9937 this._flushIfNeeded();
9938 }
9939 /**
9940 * Check whether the queue needs to be flushed.
9941 */
9942
9943 }, {
9944 key: "_flushIfNeeded",
9945 value: function _flushIfNeeded() {
9946 var _this = this;
9947
9948 // flush when the maximum is exceeded.
9949 if (this._queue.length > this.max) {
9950 this.flush();
9951 } // flush after a period of inactivity when a delay is configured
9952
9953
9954 if (this._timeout != null) {
9955 clearTimeout(this._timeout);
9956 this._timeout = null;
9957 }
9958
9959 if (this.queue.length > 0 && typeof this.delay === "number") {
9960 this._timeout = setTimeout$1(function () {
9961 _this.flush();
9962 }, this.delay);
9963 }
9964 }
9965 /**
9966 * Flush all queued calls
9967 */
9968
9969 }, {
9970 key: "flush",
9971 value: function flush() {
9972 var _context, _context2;
9973
9974 forEach$1(_context = splice(_context2 = this._queue).call(_context2, 0)).call(_context, function (entry) {
9975 entry.fn.apply(entry.context || entry.fn, entry.args || []);
9976 });
9977 }
9978 }], [{
9979 key: "extend",
9980 value: function extend(object, options) {
9981 var queue = new Queue(options);
9982
9983 if (object.flush !== undefined) {
9984 throw new Error("Target object already has a property flush");
9985 }
9986
9987 object.flush = function () {
9988 queue.flush();
9989 };
9990
9991 var methods = [{
9992 name: "flush",
9993 original: undefined
9994 }];
9995
9996 if (options && options.replace) {
9997 for (var i = 0; i < options.replace.length; i++) {
9998 var name = options.replace[i];
9999 methods.push({
10000 name: name,
10001 // @TODO: better solution?
10002 original: object[name]
10003 }); // @TODO: better solution?
10004
10005 queue.replace(object, name);
10006 }
10007 }
10008
10009 queue._extended = {
10010 object: object,
10011 methods: methods
10012 };
10013 return queue;
10014 }
10015 }]);
10016
10017 return Queue;
10018}();
10019
10020/**
10021 * [[DataSet]] code that can be reused in [[DataView]] or other similar implementations of [[DataInterface]].
10022 *
10023 * @typeParam Item - Item type that may or may not have an id.
10024 * @typeParam IdProp - Name of the property that contains the id.
10025 */
10026var DataSetPart = /*#__PURE__*/function () {
10027 function DataSetPart() {
10028 _classCallCheck(this, DataSetPart);
10029
10030 _defineProperty(this, "_subscribers", {
10031 "*": [],
10032 add: [],
10033 remove: [],
10034 update: []
10035 });
10036
10037 _defineProperty(this, "subscribe", DataSetPart.prototype.on);
10038
10039 _defineProperty(this, "unsubscribe", DataSetPart.prototype.off);
10040 }
10041
10042 _createClass(DataSetPart, [{
10043 key: "_trigger",
10044 value:
10045 /**
10046 * Trigger an event
10047 *
10048 * @param event - Event name.
10049 * @param payload - Event payload.
10050 * @param senderId - Id of the sender.
10051 */
10052 function _trigger(event, payload, senderId) {
10053 var _context, _context2;
10054
10055 if (event === "*") {
10056 throw new Error("Cannot trigger event *");
10057 }
10058
10059 forEach$1(_context = concat$1(_context2 = []).call(_context2, _toConsumableArray(this._subscribers[event]), _toConsumableArray(this._subscribers["*"]))).call(_context, function (subscriber) {
10060 subscriber(event, payload, senderId != null ? senderId : null);
10061 });
10062 }
10063 /**
10064 * Subscribe to an event, add an event listener.
10065 *
10066 * @remarks Non-function callbacks are ignored.
10067 * @param event - Event name.
10068 * @param callback - Callback method.
10069 */
10070
10071 }, {
10072 key: "on",
10073 value: function on(event, callback) {
10074 if (typeof callback === "function") {
10075 this._subscribers[event].push(callback);
10076 } // @TODO: Maybe throw for invalid callbacks?
10077
10078 }
10079 /**
10080 * Unsubscribe from an event, remove an event listener.
10081 *
10082 * @remarks If the same callback was subscribed more than once **all** occurences will be removed.
10083 * @param event - Event name.
10084 * @param callback - Callback method.
10085 */
10086
10087 }, {
10088 key: "off",
10089 value: function off(event, callback) {
10090 var _context3;
10091
10092 this._subscribers[event] = filter(_context3 = this._subscribers[event]).call(_context3, function (subscriber) {
10093 return subscriber !== callback;
10094 });
10095 }
10096 /**
10097 * @deprecated Use on instead (PS: DataView.subscribe === DataView.on).
10098 */
10099
10100 }, {
10101 key: "testLeakSubscribers",
10102 get:
10103 /* develblock:start */
10104 function get() {
10105 return this._subscribers;
10106 }
10107 }]);
10108
10109 return DataSetPart;
10110}();
10111
10112var collection = collection$2;
10113var collectionStrong = collectionStrong$2; // `Set` constructor
10114// https://tc39.es/ecma262/#sec-set-objects
10115
10116collection('Set', function (init) {
10117 return function Set() {
10118 return init(this, arguments.length ? arguments[0] : undefined);
10119 };
10120}, collectionStrong);
10121
10122var path = path$q;
10123var set$2 = path.Set;
10124
10125var parent$3 = set$2;
10126var set$1 = parent$3;
10127
10128var set = set$1;
10129
10130var getIterator$4 = getIterator$7;
10131var getIterator_1 = getIterator$4;
10132
10133var parent$2 = getIterator_1;
10134var getIterator$3 = parent$2;
10135
10136var parent$1 = getIterator$3;
10137var getIterator$2 = parent$1;
10138
10139var parent = getIterator$2;
10140var getIterator$1 = parent;
10141
10142var getIterator = getIterator$1;
10143
10144var _Symbol$iterator;
10145
10146function _createForOfIteratorHelper$2(o, allowArrayLike) { var it = typeof symbol !== "undefined" && getIteratorMethod$1(o) || o["@@iterator"]; if (!it) { if (isArray$1(o) || (it = _unsupportedIterableToArray$2(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
10147
10148function _unsupportedIterableToArray$2(o, minLen) { var _context10; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = slice(_context10 = Object.prototype.toString.call(o)).call(_context10, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return from$3(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
10149
10150function _arrayLikeToArray$2(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10151
10152_Symbol$iterator = iterator;
10153
10154/**
10155 * Data stream
10156 *
10157 * @remarks
10158 * [[DataStream]] offers an always up to date stream of items from a [[DataSet]] or [[DataView]].
10159 * That means that the stream is evaluated at the time of iteration, conversion to another data type or when [[cache]] is called, not when the [[DataStream]] was created.
10160 * Multiple invocations of for example [[toItemArray]] may yield different results (if the data source like for example [[DataSet]] gets modified).
10161 * @typeParam Item - The item type this stream is going to work with.
10162 */
10163var DataStream = /*#__PURE__*/function () {
10164 /**
10165 * Create a new data stream.
10166 *
10167 * @param pairs - The id, item pairs.
10168 */
10169 function DataStream(pairs) {
10170 _classCallCheck(this, DataStream);
10171
10172 _defineProperty(this, "_pairs", void 0);
10173
10174 this._pairs = pairs;
10175 }
10176 /**
10177 * Return an iterable of key, value pairs for every entry in the stream.
10178 */
10179
10180
10181 _createClass(DataStream, [{
10182 key: _Symbol$iterator,
10183 value:
10184 /*#__PURE__*/
10185 regenerator.mark(function value() {
10186 var _iterator, _step, _step$value, id, item;
10187
10188 return regenerator.wrap(function value$(_context) {
10189 while (1) {
10190 switch (_context.prev = _context.next) {
10191 case 0:
10192 _iterator = _createForOfIteratorHelper$2(this._pairs);
10193 _context.prev = 1;
10194
10195 _iterator.s();
10196
10197 case 3:
10198 if ((_step = _iterator.n()).done) {
10199 _context.next = 9;
10200 break;
10201 }
10202
10203 _step$value = _slicedToArray(_step.value, 2), id = _step$value[0], item = _step$value[1];
10204 _context.next = 7;
10205 return [id, item];
10206
10207 case 7:
10208 _context.next = 3;
10209 break;
10210
10211 case 9:
10212 _context.next = 14;
10213 break;
10214
10215 case 11:
10216 _context.prev = 11;
10217 _context.t0 = _context["catch"](1);
10218
10219 _iterator.e(_context.t0);
10220
10221 case 14:
10222 _context.prev = 14;
10223
10224 _iterator.f();
10225
10226 return _context.finish(14);
10227
10228 case 17:
10229 case "end":
10230 return _context.stop();
10231 }
10232 }
10233 }, value, this, [[1, 11, 14, 17]]);
10234 })
10235 /**
10236 * Return an iterable of key, value pairs for every entry in the stream.
10237 */
10238
10239 }, {
10240 key: "entries",
10241 value:
10242 /*#__PURE__*/
10243 regenerator.mark(function entries() {
10244 var _iterator2, _step2, _step2$value, id, item;
10245
10246 return regenerator.wrap(function entries$(_context2) {
10247 while (1) {
10248 switch (_context2.prev = _context2.next) {
10249 case 0:
10250 _iterator2 = _createForOfIteratorHelper$2(this._pairs);
10251 _context2.prev = 1;
10252
10253 _iterator2.s();
10254
10255 case 3:
10256 if ((_step2 = _iterator2.n()).done) {
10257 _context2.next = 9;
10258 break;
10259 }
10260
10261 _step2$value = _slicedToArray(_step2.value, 2), id = _step2$value[0], item = _step2$value[1];
10262 _context2.next = 7;
10263 return [id, item];
10264
10265 case 7:
10266 _context2.next = 3;
10267 break;
10268
10269 case 9:
10270 _context2.next = 14;
10271 break;
10272
10273 case 11:
10274 _context2.prev = 11;
10275 _context2.t0 = _context2["catch"](1);
10276
10277 _iterator2.e(_context2.t0);
10278
10279 case 14:
10280 _context2.prev = 14;
10281
10282 _iterator2.f();
10283
10284 return _context2.finish(14);
10285
10286 case 17:
10287 case "end":
10288 return _context2.stop();
10289 }
10290 }
10291 }, entries, this, [[1, 11, 14, 17]]);
10292 })
10293 /**
10294 * Return an iterable of keys in the stream.
10295 */
10296
10297 }, {
10298 key: "keys",
10299 value:
10300 /*#__PURE__*/
10301 regenerator.mark(function keys() {
10302 var _iterator3, _step3, _step3$value, id;
10303
10304 return regenerator.wrap(function keys$(_context3) {
10305 while (1) {
10306 switch (_context3.prev = _context3.next) {
10307 case 0:
10308 _iterator3 = _createForOfIteratorHelper$2(this._pairs);
10309 _context3.prev = 1;
10310
10311 _iterator3.s();
10312
10313 case 3:
10314 if ((_step3 = _iterator3.n()).done) {
10315 _context3.next = 9;
10316 break;
10317 }
10318
10319 _step3$value = _slicedToArray(_step3.value, 1), id = _step3$value[0];
10320 _context3.next = 7;
10321 return id;
10322
10323 case 7:
10324 _context3.next = 3;
10325 break;
10326
10327 case 9:
10328 _context3.next = 14;
10329 break;
10330
10331 case 11:
10332 _context3.prev = 11;
10333 _context3.t0 = _context3["catch"](1);
10334
10335 _iterator3.e(_context3.t0);
10336
10337 case 14:
10338 _context3.prev = 14;
10339
10340 _iterator3.f();
10341
10342 return _context3.finish(14);
10343
10344 case 17:
10345 case "end":
10346 return _context3.stop();
10347 }
10348 }
10349 }, keys, this, [[1, 11, 14, 17]]);
10350 })
10351 /**
10352 * Return an iterable of values in the stream.
10353 */
10354
10355 }, {
10356 key: "values",
10357 value:
10358 /*#__PURE__*/
10359 regenerator.mark(function values() {
10360 var _iterator4, _step4, _step4$value, item;
10361
10362 return regenerator.wrap(function values$(_context4) {
10363 while (1) {
10364 switch (_context4.prev = _context4.next) {
10365 case 0:
10366 _iterator4 = _createForOfIteratorHelper$2(this._pairs);
10367 _context4.prev = 1;
10368
10369 _iterator4.s();
10370
10371 case 3:
10372 if ((_step4 = _iterator4.n()).done) {
10373 _context4.next = 9;
10374 break;
10375 }
10376
10377 _step4$value = _slicedToArray(_step4.value, 2), item = _step4$value[1];
10378 _context4.next = 7;
10379 return item;
10380
10381 case 7:
10382 _context4.next = 3;
10383 break;
10384
10385 case 9:
10386 _context4.next = 14;
10387 break;
10388
10389 case 11:
10390 _context4.prev = 11;
10391 _context4.t0 = _context4["catch"](1);
10392
10393 _iterator4.e(_context4.t0);
10394
10395 case 14:
10396 _context4.prev = 14;
10397
10398 _iterator4.f();
10399
10400 return _context4.finish(14);
10401
10402 case 17:
10403 case "end":
10404 return _context4.stop();
10405 }
10406 }
10407 }, values, this, [[1, 11, 14, 17]]);
10408 })
10409 /**
10410 * Return an array containing all the ids in this stream.
10411 *
10412 * @remarks
10413 * The array may contain duplicities.
10414 * @returns The array with all ids from this stream.
10415 */
10416
10417 }, {
10418 key: "toIdArray",
10419 value: function toIdArray() {
10420 var _context5;
10421
10422 return map$3(_context5 = _toConsumableArray(this._pairs)).call(_context5, function (pair) {
10423 return pair[0];
10424 });
10425 }
10426 /**
10427 * Return an array containing all the items in this stream.
10428 *
10429 * @remarks
10430 * The array may contain duplicities.
10431 * @returns The array with all items from this stream.
10432 */
10433
10434 }, {
10435 key: "toItemArray",
10436 value: function toItemArray() {
10437 var _context6;
10438
10439 return map$3(_context6 = _toConsumableArray(this._pairs)).call(_context6, function (pair) {
10440 return pair[1];
10441 });
10442 }
10443 /**
10444 * Return an array containing all the entries in this stream.
10445 *
10446 * @remarks
10447 * The array may contain duplicities.
10448 * @returns The array with all entries from this stream.
10449 */
10450
10451 }, {
10452 key: "toEntryArray",
10453 value: function toEntryArray() {
10454 return _toConsumableArray(this._pairs);
10455 }
10456 /**
10457 * Return an object map containing all the items in this stream accessible by ids.
10458 *
10459 * @remarks
10460 * In case of duplicate ids (coerced to string so `7 == '7'`) the last encoutered appears in the returned object.
10461 * @returns The object map of all id → item pairs from this stream.
10462 */
10463
10464 }, {
10465 key: "toObjectMap",
10466 value: function toObjectMap() {
10467 var map = create$5(null);
10468
10469 var _iterator5 = _createForOfIteratorHelper$2(this._pairs),
10470 _step5;
10471
10472 try {
10473 for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
10474 var _step5$value = _slicedToArray(_step5.value, 2),
10475 id = _step5$value[0],
10476 item = _step5$value[1];
10477
10478 map[id] = item;
10479 }
10480 } catch (err) {
10481 _iterator5.e(err);
10482 } finally {
10483 _iterator5.f();
10484 }
10485
10486 return map;
10487 }
10488 /**
10489 * Return a map containing all the items in this stream accessible by ids.
10490 *
10491 * @returns The map of all id → item pairs from this stream.
10492 */
10493
10494 }, {
10495 key: "toMap",
10496 value: function toMap() {
10497 return new map(this._pairs);
10498 }
10499 /**
10500 * Return a set containing all the (unique) ids in this stream.
10501 *
10502 * @returns The set of all ids from this stream.
10503 */
10504
10505 }, {
10506 key: "toIdSet",
10507 value: function toIdSet() {
10508 return new set(this.toIdArray());
10509 }
10510 /**
10511 * Return a set containing all the (unique) items in this stream.
10512 *
10513 * @returns The set of all items from this stream.
10514 */
10515
10516 }, {
10517 key: "toItemSet",
10518 value: function toItemSet() {
10519 return new set(this.toItemArray());
10520 }
10521 /**
10522 * Cache the items from this stream.
10523 *
10524 * @remarks
10525 * This method allows for items to be fetched immediatelly and used (possibly multiple times) later.
10526 * It can also be used to optimize performance as [[DataStream]] would otherwise reevaluate everything upon each iteration.
10527 *
10528 * ## Example
10529 * ```javascript
10530 * const ds = new DataSet([…])
10531 *
10532 * const cachedStream = ds.stream()
10533 * .filter(…)
10534 * .sort(…)
10535 * .map(…)
10536 * .cached(…) // Data are fetched, processed and cached here.
10537 *
10538 * ds.clear()
10539 * chachedStream // Still has all the items.
10540 * ```
10541 * @returns A new [[DataStream]] with cached items (detached from the original [[DataSet]]).
10542 */
10543
10544 }, {
10545 key: "cache",
10546 value: function cache() {
10547 return new DataStream(_toConsumableArray(this._pairs));
10548 }
10549 /**
10550 * Get the distinct values of given property.
10551 *
10552 * @param callback - The function that picks and possibly converts the property.
10553 * @typeParam T - The type of the distinct value.
10554 * @returns A set of all distinct properties.
10555 */
10556
10557 }, {
10558 key: "distinct",
10559 value: function distinct(callback) {
10560 var set$1 = new set();
10561
10562 var _iterator6 = _createForOfIteratorHelper$2(this._pairs),
10563 _step6;
10564
10565 try {
10566 for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
10567 var _step6$value = _slicedToArray(_step6.value, 2),
10568 id = _step6$value[0],
10569 item = _step6$value[1];
10570
10571 set$1.add(callback(item, id));
10572 }
10573 } catch (err) {
10574 _iterator6.e(err);
10575 } finally {
10576 _iterator6.f();
10577 }
10578
10579 return set$1;
10580 }
10581 /**
10582 * Filter the items of the stream.
10583 *
10584 * @param callback - The function that decides whether an item will be included.
10585 * @returns A new data stream with the filtered items.
10586 */
10587
10588 }, {
10589 key: "filter",
10590 value: function filter(callback) {
10591 var pairs = this._pairs;
10592 return new DataStream(_defineProperty({}, iterator, /*#__PURE__*/regenerator.mark(function _callee() {
10593 var _iterator7, _step7, _step7$value, id, item;
10594
10595 return regenerator.wrap(function _callee$(_context7) {
10596 while (1) {
10597 switch (_context7.prev = _context7.next) {
10598 case 0:
10599 _iterator7 = _createForOfIteratorHelper$2(pairs);
10600 _context7.prev = 1;
10601
10602 _iterator7.s();
10603
10604 case 3:
10605 if ((_step7 = _iterator7.n()).done) {
10606 _context7.next = 10;
10607 break;
10608 }
10609
10610 _step7$value = _slicedToArray(_step7.value, 2), id = _step7$value[0], item = _step7$value[1];
10611
10612 if (!callback(item, id)) {
10613 _context7.next = 8;
10614 break;
10615 }
10616
10617 _context7.next = 8;
10618 return [id, item];
10619
10620 case 8:
10621 _context7.next = 3;
10622 break;
10623
10624 case 10:
10625 _context7.next = 15;
10626 break;
10627
10628 case 12:
10629 _context7.prev = 12;
10630 _context7.t0 = _context7["catch"](1);
10631
10632 _iterator7.e(_context7.t0);
10633
10634 case 15:
10635 _context7.prev = 15;
10636
10637 _iterator7.f();
10638
10639 return _context7.finish(15);
10640
10641 case 18:
10642 case "end":
10643 return _context7.stop();
10644 }
10645 }
10646 }, _callee, null, [[1, 12, 15, 18]]);
10647 })));
10648 }
10649 /**
10650 * Execute a callback for each item of the stream.
10651 *
10652 * @param callback - The function that will be invoked for each item.
10653 */
10654
10655 }, {
10656 key: "forEach",
10657 value: function forEach(callback) {
10658 var _iterator8 = _createForOfIteratorHelper$2(this._pairs),
10659 _step8;
10660
10661 try {
10662 for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
10663 var _step8$value = _slicedToArray(_step8.value, 2),
10664 id = _step8$value[0],
10665 item = _step8$value[1];
10666
10667 callback(item, id);
10668 }
10669 } catch (err) {
10670 _iterator8.e(err);
10671 } finally {
10672 _iterator8.f();
10673 }
10674 }
10675 /**
10676 * Map the items into a different type.
10677 *
10678 * @param callback - The function that does the conversion.
10679 * @typeParam Mapped - The type of the item after mapping.
10680 * @returns A new data stream with the mapped items.
10681 */
10682
10683 }, {
10684 key: "map",
10685 value: function map(callback) {
10686 var pairs = this._pairs;
10687 return new DataStream(_defineProperty({}, iterator, /*#__PURE__*/regenerator.mark(function _callee2() {
10688 var _iterator9, _step9, _step9$value, id, item;
10689
10690 return regenerator.wrap(function _callee2$(_context8) {
10691 while (1) {
10692 switch (_context8.prev = _context8.next) {
10693 case 0:
10694 _iterator9 = _createForOfIteratorHelper$2(pairs);
10695 _context8.prev = 1;
10696
10697 _iterator9.s();
10698
10699 case 3:
10700 if ((_step9 = _iterator9.n()).done) {
10701 _context8.next = 9;
10702 break;
10703 }
10704
10705 _step9$value = _slicedToArray(_step9.value, 2), id = _step9$value[0], item = _step9$value[1];
10706 _context8.next = 7;
10707 return [id, callback(item, id)];
10708
10709 case 7:
10710 _context8.next = 3;
10711 break;
10712
10713 case 9:
10714 _context8.next = 14;
10715 break;
10716
10717 case 11:
10718 _context8.prev = 11;
10719 _context8.t0 = _context8["catch"](1);
10720
10721 _iterator9.e(_context8.t0);
10722
10723 case 14:
10724 _context8.prev = 14;
10725
10726 _iterator9.f();
10727
10728 return _context8.finish(14);
10729
10730 case 17:
10731 case "end":
10732 return _context8.stop();
10733 }
10734 }
10735 }, _callee2, null, [[1, 11, 14, 17]]);
10736 })));
10737 }
10738 /**
10739 * Get the item with the maximum value of given property.
10740 *
10741 * @param callback - The function that picks and possibly converts the property.
10742 * @returns The item with the maximum if found otherwise null.
10743 */
10744
10745 }, {
10746 key: "max",
10747 value: function max(callback) {
10748 var iter = getIterator(this._pairs);
10749
10750 var curr = iter.next();
10751
10752 if (curr.done) {
10753 return null;
10754 }
10755
10756 var maxItem = curr.value[1];
10757 var maxValue = callback(curr.value[1], curr.value[0]);
10758
10759 while (!(curr = iter.next()).done) {
10760 var _curr$value = _slicedToArray(curr.value, 2),
10761 id = _curr$value[0],
10762 item = _curr$value[1];
10763
10764 var _value = callback(item, id);
10765
10766 if (_value > maxValue) {
10767 maxValue = _value;
10768 maxItem = item;
10769 }
10770 }
10771
10772 return maxItem;
10773 }
10774 /**
10775 * Get the item with the minimum value of given property.
10776 *
10777 * @param callback - The function that picks and possibly converts the property.
10778 * @returns The item with the minimum if found otherwise null.
10779 */
10780
10781 }, {
10782 key: "min",
10783 value: function min(callback) {
10784 var iter = getIterator(this._pairs);
10785
10786 var curr = iter.next();
10787
10788 if (curr.done) {
10789 return null;
10790 }
10791
10792 var minItem = curr.value[1];
10793 var minValue = callback(curr.value[1], curr.value[0]);
10794
10795 while (!(curr = iter.next()).done) {
10796 var _curr$value2 = _slicedToArray(curr.value, 2),
10797 id = _curr$value2[0],
10798 item = _curr$value2[1];
10799
10800 var _value2 = callback(item, id);
10801
10802 if (_value2 < minValue) {
10803 minValue = _value2;
10804 minItem = item;
10805 }
10806 }
10807
10808 return minItem;
10809 }
10810 /**
10811 * Reduce the items into a single value.
10812 *
10813 * @param callback - The function that does the reduction.
10814 * @param accumulator - The initial value of the accumulator.
10815 * @typeParam T - The type of the accumulated value.
10816 * @returns The reduced value.
10817 */
10818
10819 }, {
10820 key: "reduce",
10821 value: function reduce(callback, accumulator) {
10822 var _iterator10 = _createForOfIteratorHelper$2(this._pairs),
10823 _step10;
10824
10825 try {
10826 for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
10827 var _step10$value = _slicedToArray(_step10.value, 2),
10828 id = _step10$value[0],
10829 item = _step10$value[1];
10830
10831 accumulator = callback(accumulator, item, id);
10832 }
10833 } catch (err) {
10834 _iterator10.e(err);
10835 } finally {
10836 _iterator10.f();
10837 }
10838
10839 return accumulator;
10840 }
10841 /**
10842 * Sort the items.
10843 *
10844 * @param callback - Item comparator.
10845 * @returns A new stream with sorted items.
10846 */
10847
10848 }, {
10849 key: "sort",
10850 value: function sort$1(callback) {
10851 var _this = this;
10852
10853 return new DataStream(_defineProperty({}, iterator, function () {
10854 var _context9;
10855
10856 return getIterator(sort(_context9 = _toConsumableArray(_this._pairs)).call(_context9, function (_ref, _ref2) {
10857 var _ref3 = _slicedToArray(_ref, 2),
10858 idA = _ref3[0],
10859 itemA = _ref3[1];
10860
10861 var _ref4 = _slicedToArray(_ref2, 2),
10862 idB = _ref4[0],
10863 itemB = _ref4[1];
10864
10865 return callback(itemA, itemB, idA, idB);
10866 }));
10867 }));
10868 }
10869 }]);
10870
10871 return DataStream;
10872}();
10873
10874function ownKeys(object, enumerableOnly) { var keys = keys$4(object); if (getOwnPropertySymbols) { var symbols = getOwnPropertySymbols(object); enumerableOnly && (symbols = filter(symbols).call(symbols, function (sym) { return getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10875
10876function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var _context10, _context11; var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? forEach$1(_context10 = ownKeys(Object(source), !0)).call(_context10, function (key) { _defineProperty(target, key, source[key]); }) : getOwnPropertyDescriptors ? defineProperties(target, getOwnPropertyDescriptors(source)) : forEach$1(_context11 = ownKeys(Object(source))).call(_context11, function (key) { defineProperty$4(target, key, getOwnPropertyDescriptor(source, key)); }); } return target; }
10877
10878function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof symbol !== "undefined" && getIteratorMethod$1(o) || o["@@iterator"]; if (!it) { if (isArray$1(o) || (it = _unsupportedIterableToArray$1(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
10879
10880function _unsupportedIterableToArray$1(o, minLen) { var _context9; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = slice(_context9 = Object.prototype.toString.call(o)).call(_context9, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return from$3(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
10881
10882function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
10883
10884function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10885
10886function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !construct) return false; if (construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
10887/**
10888 * Add an id to given item if it doesn't have one already.
10889 *
10890 * @remarks
10891 * The item will be modified.
10892 * @param item - The item that will have an id after a call to this function.
10893 * @param idProp - The key of the id property.
10894 * @typeParam Item - Item type that may or may not have an id.
10895 * @typeParam IdProp - Name of the property that contains the id.
10896 * @returns true
10897 */
10898
10899function ensureFullItem(item, idProp) {
10900 if (item[idProp] == null) {
10901 // generate an id
10902 item[idProp] = v4();
10903 }
10904
10905 return item;
10906}
10907/**
10908 * # DataSet
10909 *
10910 * Vis.js comes with a flexible DataSet, which can be used to hold and
10911 * manipulate unstructured data and listen for changes in the data. The DataSet
10912 * is key/value based. Data items can be added, updated and removed from the
10913 * DataSet, and one can subscribe to changes in the DataSet. The data in the
10914 * DataSet can be filtered and ordered. Data can be normalized when appending it
10915 * to the DataSet as well.
10916 *
10917 * ## Example
10918 *
10919 * The following example shows how to use a DataSet.
10920 *
10921 * ```javascript
10922 * // create a DataSet
10923 * var options = {};
10924 * var data = new vis.DataSet(options);
10925 *
10926 * // add items
10927 * // note that the data items can contain different properties and data formats
10928 * data.add([
10929 * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
10930 * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
10931 * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
10932 * {id: 4, text: 'item 4'}
10933 * ]);
10934 *
10935 * // subscribe to any change in the DataSet
10936 * data.on('*', function (event, properties, senderId) {
10937 * console.log('event', event, properties);
10938 * });
10939 *
10940 * // update an existing item
10941 * data.update({id: 2, group: 1});
10942 *
10943 * // remove an item
10944 * data.remove(4);
10945 *
10946 * // get all ids
10947 * var ids = data.getIds();
10948 * console.log('ids', ids);
10949 *
10950 * // get a specific item
10951 * var item1 = data.get(1);
10952 * console.log('item1', item1);
10953 *
10954 * // retrieve a filtered subset of the data
10955 * var items = data.get({
10956 * filter: function (item) {
10957 * return item.group == 1;
10958 * }
10959 * });
10960 * console.log('filtered items', items);
10961 * ```
10962 *
10963 * @typeParam Item - Item type that may or may not have an id.
10964 * @typeParam IdProp - Name of the property that contains the id.
10965 */
10966
10967
10968var DataSet = /*#__PURE__*/function (_DataSetPart) {
10969 _inherits(DataSet, _DataSetPart);
10970
10971 var _super = _createSuper$1(DataSet);
10972
10973 /**
10974 * Construct a new DataSet.
10975 *
10976 * @param data - Initial data or options.
10977 * @param options - Options (type error if data is also options).
10978 */
10979 function DataSet(data, options) {
10980 var _this;
10981
10982 _classCallCheck(this, DataSet);
10983
10984 _this = _super.call(this); // correctly read optional arguments
10985
10986 _defineProperty(_assertThisInitialized(_this), "flush", void 0);
10987
10988 _defineProperty(_assertThisInitialized(_this), "length", void 0);
10989
10990 _defineProperty(_assertThisInitialized(_this), "_options", void 0);
10991
10992 _defineProperty(_assertThisInitialized(_this), "_data", void 0);
10993
10994 _defineProperty(_assertThisInitialized(_this), "_idProp", void 0);
10995
10996 _defineProperty(_assertThisInitialized(_this), "_queue", null);
10997
10998 if (data && !isArray$1(data)) {
10999 options = data;
11000 data = [];
11001 }
11002
11003 _this._options = options || {};
11004 _this._data = new map(); // map with data indexed by id
11005
11006 _this.length = 0; // number of items in the DataSet
11007
11008 _this._idProp = _this._options.fieldId || "id"; // name of the field containing id
11009 // add initial data when provided
11010
11011 if (data && data.length) {
11012 _this.add(data);
11013 }
11014
11015 _this.setOptions(options);
11016
11017 return _this;
11018 }
11019 /**
11020 * Set new options.
11021 *
11022 * @param options - The new options.
11023 */
11024
11025
11026 _createClass(DataSet, [{
11027 key: "idProp",
11028 get:
11029 /** Flush all queued calls. */
11030
11031 /** @inheritDoc */
11032
11033 /** @inheritDoc */
11034 function get() {
11035 return this._idProp;
11036 }
11037 }, {
11038 key: "setOptions",
11039 value: function setOptions(options) {
11040 if (options && options.queue !== undefined) {
11041 if (options.queue === false) {
11042 // delete queue if loaded
11043 if (this._queue) {
11044 this._queue.destroy();
11045
11046 this._queue = null;
11047 }
11048 } else {
11049 // create queue and update its options
11050 if (!this._queue) {
11051 this._queue = Queue.extend(this, {
11052 replace: ["add", "update", "remove"]
11053 });
11054 }
11055
11056 if (options.queue && _typeof(options.queue) === "object") {
11057 this._queue.setOptions(options.queue);
11058 }
11059 }
11060 }
11061 }
11062 /**
11063 * Add a data item or an array with items.
11064 *
11065 * After the items are added to the DataSet, the DataSet will trigger an event `add`. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.
11066 *
11067 * ## Example
11068 *
11069 * ```javascript
11070 * // create a DataSet
11071 * const data = new vis.DataSet()
11072 *
11073 * // add items
11074 * const ids = data.add([
11075 * { id: 1, text: 'item 1' },
11076 * { id: 2, text: 'item 2' },
11077 * { text: 'item without an id' }
11078 * ])
11079 *
11080 * console.log(ids) // [1, 2, '<UUIDv4>']
11081 * ```
11082 *
11083 * @param data - Items to be added (ids will be generated if missing).
11084 * @param senderId - Sender id.
11085 * @returns addedIds - Array with the ids (generated if not present) of the added items.
11086 * @throws When an item with the same id as any of the added items already exists.
11087 */
11088
11089 }, {
11090 key: "add",
11091 value: function add(data, senderId) {
11092 var _this2 = this;
11093
11094 var addedIds = [];
11095 var id;
11096
11097 if (isArray$1(data)) {
11098 // Array
11099 var idsToAdd = map$3(data).call(data, function (d) {
11100 return d[_this2._idProp];
11101 });
11102
11103 if (some(idsToAdd).call(idsToAdd, function (id) {
11104 return _this2._data.has(id);
11105 })) {
11106 throw new Error("A duplicate id was found in the parameter array.");
11107 }
11108
11109 for (var i = 0, len = data.length; i < len; i++) {
11110 id = this._addItem(data[i]);
11111 addedIds.push(id);
11112 }
11113 } else if (data && _typeof(data) === "object") {
11114 // Single item
11115 id = this._addItem(data);
11116 addedIds.push(id);
11117 } else {
11118 throw new Error("Unknown dataType");
11119 }
11120
11121 if (addedIds.length) {
11122 this._trigger("add", {
11123 items: addedIds
11124 }, senderId);
11125 }
11126
11127 return addedIds;
11128 }
11129 /**
11130 * Update existing items. When an item does not exist, it will be created.
11131 *
11132 * @remarks
11133 * The provided properties will be merged in the existing item. When an item does not exist, it will be created.
11134 *
11135 * After the items are updated, the DataSet will trigger an event `add` for the added items, and an event `update`. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.
11136 *
11137 * ## Example
11138 *
11139 * ```javascript
11140 * // create a DataSet
11141 * const data = new vis.DataSet([
11142 * { id: 1, text: 'item 1' },
11143 * { id: 2, text: 'item 2' },
11144 * { id: 3, text: 'item 3' }
11145 * ])
11146 *
11147 * // update items
11148 * const ids = data.update([
11149 * { id: 2, text: 'item 2 (updated)' },
11150 * { id: 4, text: 'item 4 (new)' }
11151 * ])
11152 *
11153 * console.log(ids) // [2, 4]
11154 * ```
11155 *
11156 * ## Warning for TypeScript users
11157 * This method may introduce partial items into the data set. Use add or updateOnly instead for better type safety.
11158 * @param data - Items to be updated (if the id is already present) or added (if the id is missing).
11159 * @param senderId - Sender id.
11160 * @returns updatedIds - The ids of the added (these may be newly generated if there was no id in the item from the data) or updated items.
11161 * @throws When the supplied data is neither an item nor an array of items.
11162 */
11163
11164 }, {
11165 key: "update",
11166 value: function update(data, senderId) {
11167 var _this3 = this;
11168
11169 var addedIds = [];
11170 var updatedIds = [];
11171 var oldData = [];
11172 var updatedData = [];
11173 var idProp = this._idProp;
11174
11175 var addOrUpdate = function addOrUpdate(item) {
11176 var origId = item[idProp];
11177
11178 if (origId != null && _this3._data.has(origId)) {
11179 var fullItem = item; // it has an id, therefore it is a fullitem
11180
11181 var oldItem = assign$2({}, _this3._data.get(origId)); // update item
11182
11183
11184 var id = _this3._updateItem(fullItem);
11185
11186 updatedIds.push(id);
11187 updatedData.push(fullItem);
11188 oldData.push(oldItem);
11189 } else {
11190 // add new item
11191 var _id = _this3._addItem(item);
11192
11193 addedIds.push(_id);
11194 }
11195 };
11196
11197 if (isArray$1(data)) {
11198 // Array
11199 for (var i = 0, len = data.length; i < len; i++) {
11200 if (data[i] && _typeof(data[i]) === "object") {
11201 addOrUpdate(data[i]);
11202 } else {
11203 console.warn("Ignoring input item, which is not an object at index " + i);
11204 }
11205 }
11206 } else if (data && _typeof(data) === "object") {
11207 // Single item
11208 addOrUpdate(data);
11209 } else {
11210 throw new Error("Unknown dataType");
11211 }
11212
11213 if (addedIds.length) {
11214 this._trigger("add", {
11215 items: addedIds
11216 }, senderId);
11217 }
11218
11219 if (updatedIds.length) {
11220 var props = {
11221 items: updatedIds,
11222 oldData: oldData,
11223 data: updatedData
11224 }; // TODO: remove deprecated property 'data' some day
11225 //Object.defineProperty(props, 'data', {
11226 // 'get': (function() {
11227 // console.warn('Property data is deprecated. Use DataSet.get(ids) to retrieve the new data, use the oldData property on this object to get the old data');
11228 // return updatedData;
11229 // }).bind(this)
11230 //});
11231
11232 this._trigger("update", props, senderId);
11233 }
11234
11235 return concat$1(addedIds).call(addedIds, updatedIds);
11236 }
11237 /**
11238 * Update existing items. When an item does not exist, an error will be thrown.
11239 *
11240 * @remarks
11241 * The provided properties will be deeply merged into the existing item.
11242 * When an item does not exist (id not present in the data set or absent), an error will be thrown and nothing will be changed.
11243 *
11244 * After the items are updated, the DataSet will trigger an event `update`.
11245 * When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.
11246 *
11247 * ## Example
11248 *
11249 * ```javascript
11250 * // create a DataSet
11251 * const data = new vis.DataSet([
11252 * { id: 1, text: 'item 1' },
11253 * { id: 2, text: 'item 2' },
11254 * { id: 3, text: 'item 3' },
11255 * ])
11256 *
11257 * // update items
11258 * const ids = data.update([
11259 * { id: 2, text: 'item 2 (updated)' }, // works
11260 * // { id: 4, text: 'item 4 (new)' }, // would throw
11261 * // { text: 'item 4 (new)' }, // would also throw
11262 * ])
11263 *
11264 * console.log(ids) // [2]
11265 * ```
11266 * @param data - Updates (the id and optionally other props) to the items in this data set.
11267 * @param senderId - Sender id.
11268 * @returns updatedIds - The ids of the updated items.
11269 * @throws When the supplied data is neither an item nor an array of items, when the ids are missing.
11270 */
11271
11272 }, {
11273 key: "updateOnly",
11274 value: function updateOnly(data, senderId) {
11275 var _context,
11276 _this4 = this;
11277
11278 if (!isArray$1(data)) {
11279 data = [data];
11280 }
11281
11282 var updateEventData = map$3(_context = map$3(data).call(data, function (update) {
11283 var oldData = _this4._data.get(update[_this4._idProp]);
11284
11285 if (oldData == null) {
11286 throw new Error("Updating non-existent items is not allowed.");
11287 }
11288
11289 return {
11290 oldData: oldData,
11291 update: update
11292 };
11293 })).call(_context, function (_ref) {
11294 var oldData = _ref.oldData,
11295 update = _ref.update;
11296 var id = oldData[_this4._idProp];
11297 var updatedData = pureDeepObjectAssign(oldData, update);
11298
11299 _this4._data.set(id, updatedData);
11300
11301 return {
11302 id: id,
11303 oldData: oldData,
11304 updatedData: updatedData
11305 };
11306 });
11307
11308 if (updateEventData.length) {
11309 var props = {
11310 items: map$3(updateEventData).call(updateEventData, function (value) {
11311 return value.id;
11312 }),
11313 oldData: map$3(updateEventData).call(updateEventData, function (value) {
11314 return value.oldData;
11315 }),
11316 data: map$3(updateEventData).call(updateEventData, function (value) {
11317 return value.updatedData;
11318 })
11319 }; // TODO: remove deprecated property 'data' some day
11320 //Object.defineProperty(props, 'data', {
11321 // 'get': (function() {
11322 // console.warn('Property data is deprecated. Use DataSet.get(ids) to retrieve the new data, use the oldData property on this object to get the old data');
11323 // return updatedData;
11324 // }).bind(this)
11325 //});
11326
11327 this._trigger("update", props, senderId);
11328
11329 return props.items;
11330 } else {
11331 return [];
11332 }
11333 }
11334 /** @inheritDoc */
11335
11336 }, {
11337 key: "get",
11338 value: function get(first, second) {
11339 // @TODO: Woudn't it be better to split this into multiple methods?
11340 // parse the arguments
11341 var id = undefined;
11342 var ids = undefined;
11343 var options = undefined;
11344
11345 if (isId(first)) {
11346 // get(id [, options])
11347 id = first;
11348 options = second;
11349 } else if (isArray$1(first)) {
11350 // get(ids [, options])
11351 ids = first;
11352 options = second;
11353 } else {
11354 // get([, options])
11355 options = first;
11356 } // determine the return type
11357
11358
11359 var returnType = options && options.returnType === "Object" ? "Object" : "Array"; // @TODO: WTF is this? Or am I missing something?
11360 // var returnType
11361 // if (options && options.returnType) {
11362 // var allowedValues = ['Array', 'Object']
11363 // returnType =
11364 // allowedValues.indexOf(options.returnType) == -1
11365 // ? 'Array'
11366 // : options.returnType
11367 // } else {
11368 // returnType = 'Array'
11369 // }
11370 // build options
11371
11372 var filter$1 = options && filter(options);
11373
11374 var items = [];
11375 var item = undefined;
11376 var itemIds = undefined;
11377 var itemId = undefined; // convert items
11378
11379 if (id != null) {
11380 // return a single item
11381 item = this._data.get(id);
11382
11383 if (item && filter$1 && !filter$1(item)) {
11384 item = undefined;
11385 }
11386 } else if (ids != null) {
11387 // return a subset of items
11388 for (var i = 0, len = ids.length; i < len; i++) {
11389 item = this._data.get(ids[i]);
11390
11391 if (item != null && (!filter$1 || filter$1(item))) {
11392 items.push(item);
11393 }
11394 }
11395 } else {
11396 var _context2;
11397
11398 // return all items
11399 itemIds = _toConsumableArray(keys(_context2 = this._data).call(_context2));
11400
11401 for (var _i = 0, _len = itemIds.length; _i < _len; _i++) {
11402 itemId = itemIds[_i];
11403 item = this._data.get(itemId);
11404
11405 if (item != null && (!filter$1 || filter$1(item))) {
11406 items.push(item);
11407 }
11408 }
11409 } // order the results
11410
11411
11412 if (options && options.order && id == undefined) {
11413 this._sort(items, options.order);
11414 } // filter fields of the items
11415
11416
11417 if (options && options.fields) {
11418 var fields = options.fields;
11419
11420 if (id != undefined && item != null) {
11421 item = this._filterFields(item, fields);
11422 } else {
11423 for (var _i2 = 0, _len2 = items.length; _i2 < _len2; _i2++) {
11424 items[_i2] = this._filterFields(items[_i2], fields);
11425 }
11426 }
11427 } // return the results
11428
11429
11430 if (returnType == "Object") {
11431 var result = {};
11432
11433 for (var _i3 = 0, _len3 = items.length; _i3 < _len3; _i3++) {
11434 var resultant = items[_i3]; // @TODO: Shoudn't this be this._fieldId?
11435 // result[resultant.id] = resultant
11436
11437 var _id2 = resultant[this._idProp];
11438 result[_id2] = resultant;
11439 }
11440
11441 return result;
11442 } else {
11443 if (id != null) {
11444 var _item;
11445
11446 // a single item
11447 return (_item = item) !== null && _item !== void 0 ? _item : null;
11448 } else {
11449 // just return our array
11450 return items;
11451 }
11452 }
11453 }
11454 /** @inheritDoc */
11455
11456 }, {
11457 key: "getIds",
11458 value: function getIds(options) {
11459 var data = this._data;
11460
11461 var filter$1 = options && filter(options);
11462
11463 var order = options && options.order;
11464
11465 var itemIds = _toConsumableArray(keys(data).call(data));
11466
11467 var ids = [];
11468
11469 if (filter$1) {
11470 // get filtered items
11471 if (order) {
11472 // create ordered list
11473 var items = [];
11474
11475 for (var i = 0, len = itemIds.length; i < len; i++) {
11476 var id = itemIds[i];
11477
11478 var item = this._data.get(id);
11479
11480 if (item != null && filter$1(item)) {
11481 items.push(item);
11482 }
11483 }
11484
11485 this._sort(items, order);
11486
11487 for (var _i4 = 0, _len4 = items.length; _i4 < _len4; _i4++) {
11488 ids.push(items[_i4][this._idProp]);
11489 }
11490 } else {
11491 // create unordered list
11492 for (var _i5 = 0, _len5 = itemIds.length; _i5 < _len5; _i5++) {
11493 var _id3 = itemIds[_i5];
11494
11495 var _item2 = this._data.get(_id3);
11496
11497 if (_item2 != null && filter$1(_item2)) {
11498 ids.push(_item2[this._idProp]);
11499 }
11500 }
11501 }
11502 } else {
11503 // get all items
11504 if (order) {
11505 // create an ordered list
11506 var _items = [];
11507
11508 for (var _i6 = 0, _len6 = itemIds.length; _i6 < _len6; _i6++) {
11509 var _id4 = itemIds[_i6];
11510
11511 _items.push(data.get(_id4));
11512 }
11513
11514 this._sort(_items, order);
11515
11516 for (var _i7 = 0, _len7 = _items.length; _i7 < _len7; _i7++) {
11517 ids.push(_items[_i7][this._idProp]);
11518 }
11519 } else {
11520 // create unordered list
11521 for (var _i8 = 0, _len8 = itemIds.length; _i8 < _len8; _i8++) {
11522 var _id5 = itemIds[_i8];
11523
11524 var _item3 = data.get(_id5);
11525
11526 if (_item3 != null) {
11527 ids.push(_item3[this._idProp]);
11528 }
11529 }
11530 }
11531 }
11532
11533 return ids;
11534 }
11535 /** @inheritDoc */
11536
11537 }, {
11538 key: "getDataSet",
11539 value: function getDataSet() {
11540 return this;
11541 }
11542 /** @inheritDoc */
11543
11544 }, {
11545 key: "forEach",
11546 value: function forEach(callback, options) {
11547 var filter$1 = options && filter(options);
11548
11549 var data = this._data;
11550
11551 var itemIds = _toConsumableArray(keys(data).call(data));
11552
11553 if (options && options.order) {
11554 // execute forEach on ordered list
11555 var items = this.get(options);
11556
11557 for (var i = 0, len = items.length; i < len; i++) {
11558 var item = items[i];
11559 var id = item[this._idProp];
11560 callback(item, id);
11561 }
11562 } else {
11563 // unordered
11564 for (var _i9 = 0, _len9 = itemIds.length; _i9 < _len9; _i9++) {
11565 var _id6 = itemIds[_i9];
11566
11567 var _item4 = this._data.get(_id6);
11568
11569 if (_item4 != null && (!filter$1 || filter$1(_item4))) {
11570 callback(_item4, _id6);
11571 }
11572 }
11573 }
11574 }
11575 /** @inheritDoc */
11576
11577 }, {
11578 key: "map",
11579 value: function map(callback, options) {
11580 var filter$1 = options && filter(options);
11581
11582 var mappedItems = [];
11583 var data = this._data;
11584
11585 var itemIds = _toConsumableArray(keys(data).call(data)); // convert and filter items
11586
11587
11588 for (var i = 0, len = itemIds.length; i < len; i++) {
11589 var id = itemIds[i];
11590
11591 var item = this._data.get(id);
11592
11593 if (item != null && (!filter$1 || filter$1(item))) {
11594 mappedItems.push(callback(item, id));
11595 }
11596 } // order items
11597
11598
11599 if (options && options.order) {
11600 this._sort(mappedItems, options.order);
11601 }
11602
11603 return mappedItems;
11604 }
11605 /**
11606 * Filter the fields of an item.
11607 *
11608 * @param item - The item whose fields should be filtered.
11609 * @param fields - The names of the fields that will be kept.
11610 * @typeParam K - Field name type.
11611 * @returns The item without any additional fields.
11612 */
11613
11614 }, {
11615 key: "_filterFields",
11616 value: function _filterFields(item, fields) {
11617 var _context3;
11618
11619 if (!item) {
11620 // item is null
11621 return item;
11622 }
11623
11624 return reduce(_context3 = isArray$1(fields) ? // Use the supplied array
11625 fields : // Use the keys of the supplied object
11626 keys$4(fields)).call(_context3, function (filteredItem, field) {
11627 filteredItem[field] = item[field];
11628 return filteredItem;
11629 }, {});
11630 }
11631 /**
11632 * Sort the provided array with items.
11633 *
11634 * @param items - Items to be sorted in place.
11635 * @param order - A field name or custom sort function.
11636 * @typeParam T - The type of the items in the items array.
11637 */
11638
11639 }, {
11640 key: "_sort",
11641 value: function _sort(items, order) {
11642 if (typeof order === "string") {
11643 // order by provided field name
11644 var name = order; // field name
11645
11646 sort(items).call(items, function (a, b) {
11647 // @TODO: How to treat missing properties?
11648 var av = a[name];
11649 var bv = b[name];
11650 return av > bv ? 1 : av < bv ? -1 : 0;
11651 });
11652 } else if (typeof order === "function") {
11653 // order by sort function
11654 sort(items).call(items, order);
11655 } else {
11656 // TODO: extend order by an Object {field:string, direction:string}
11657 // where direction can be 'asc' or 'desc'
11658 throw new TypeError("Order must be a function or a string");
11659 }
11660 }
11661 /**
11662 * Remove an item or multiple items by “reference” (only the id is used) or by id.
11663 *
11664 * The method ignores removal of non-existing items, and returns an array containing the ids of the items which are actually removed from the DataSet.
11665 *
11666 * After the items are removed, the DataSet will trigger an event `remove` for the removed items. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.
11667 *
11668 * ## Example
11669 * ```javascript
11670 * // create a DataSet
11671 * const data = new vis.DataSet([
11672 * { id: 1, text: 'item 1' },
11673 * { id: 2, text: 'item 2' },
11674 * { id: 3, text: 'item 3' }
11675 * ])
11676 *
11677 * // remove items
11678 * const ids = data.remove([2, { id: 3 }, 4])
11679 *
11680 * console.log(ids) // [2, 3]
11681 * ```
11682 *
11683 * @param id - One or more items or ids of items to be removed.
11684 * @param senderId - Sender id.
11685 * @returns The ids of the removed items.
11686 */
11687
11688 }, {
11689 key: "remove",
11690 value: function remove(id, senderId) {
11691 var removedIds = [];
11692 var removedItems = []; // force everything to be an array for simplicity
11693
11694 var ids = isArray$1(id) ? id : [id];
11695
11696 for (var i = 0, len = ids.length; i < len; i++) {
11697 var item = this._remove(ids[i]);
11698
11699 if (item) {
11700 var itemId = item[this._idProp];
11701
11702 if (itemId != null) {
11703 removedIds.push(itemId);
11704 removedItems.push(item);
11705 }
11706 }
11707 }
11708
11709 if (removedIds.length) {
11710 this._trigger("remove", {
11711 items: removedIds,
11712 oldData: removedItems
11713 }, senderId);
11714 }
11715
11716 return removedIds;
11717 }
11718 /**
11719 * Remove an item by its id or reference.
11720 *
11721 * @param id - Id of an item or the item itself.
11722 * @returns The removed item if removed, null otherwise.
11723 */
11724
11725 }, {
11726 key: "_remove",
11727 value: function _remove(id) {
11728 // @TODO: It origianlly returned the item although the docs say id.
11729 // The code expects the item, so probably an error in the docs.
11730 var ident; // confirm the id to use based on the args type
11731
11732 if (isId(id)) {
11733 ident = id;
11734 } else if (id && _typeof(id) === "object") {
11735 ident = id[this._idProp]; // look for the identifier field using ._idProp
11736 } // do the removing if the item is found
11737
11738
11739 if (ident != null && this._data.has(ident)) {
11740 var item = this._data.get(ident) || null;
11741
11742 this._data.delete(ident);
11743
11744 --this.length;
11745 return item;
11746 }
11747
11748 return null;
11749 }
11750 /**
11751 * Clear the entire data set.
11752 *
11753 * After the items are removed, the [[DataSet]] will trigger an event `remove` for all removed items. When a `senderId` is provided, this id will be passed with the triggered event to all subscribers.
11754 *
11755 * @param senderId - Sender id.
11756 * @returns removedIds - The ids of all removed items.
11757 */
11758
11759 }, {
11760 key: "clear",
11761 value: function clear(senderId) {
11762 var _context4;
11763
11764 var ids = _toConsumableArray(keys(_context4 = this._data).call(_context4));
11765
11766 var items = [];
11767
11768 for (var i = 0, len = ids.length; i < len; i++) {
11769 items.push(this._data.get(ids[i]));
11770 }
11771
11772 this._data.clear();
11773
11774 this.length = 0;
11775
11776 this._trigger("remove", {
11777 items: ids,
11778 oldData: items
11779 }, senderId);
11780
11781 return ids;
11782 }
11783 /**
11784 * Find the item with maximum value of a specified field.
11785 *
11786 * @param field - Name of the property that should be searched for max value.
11787 * @returns Item containing max value, or null if no items.
11788 */
11789
11790 }, {
11791 key: "max",
11792 value: function max(field) {
11793 var _context5;
11794
11795 var max = null;
11796 var maxField = null;
11797
11798 var _iterator = _createForOfIteratorHelper$1(values(_context5 = this._data).call(_context5)),
11799 _step;
11800
11801 try {
11802 for (_iterator.s(); !(_step = _iterator.n()).done;) {
11803 var item = _step.value;
11804 var itemField = item[field];
11805
11806 if (typeof itemField === "number" && (maxField == null || itemField > maxField)) {
11807 max = item;
11808 maxField = itemField;
11809 }
11810 }
11811 } catch (err) {
11812 _iterator.e(err);
11813 } finally {
11814 _iterator.f();
11815 }
11816
11817 return max || null;
11818 }
11819 /**
11820 * Find the item with minimum value of a specified field.
11821 *
11822 * @param field - Name of the property that should be searched for min value.
11823 * @returns Item containing min value, or null if no items.
11824 */
11825
11826 }, {
11827 key: "min",
11828 value: function min(field) {
11829 var _context6;
11830
11831 var min = null;
11832 var minField = null;
11833
11834 var _iterator2 = _createForOfIteratorHelper$1(values(_context6 = this._data).call(_context6)),
11835 _step2;
11836
11837 try {
11838 for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
11839 var item = _step2.value;
11840 var itemField = item[field];
11841
11842 if (typeof itemField === "number" && (minField == null || itemField < minField)) {
11843 min = item;
11844 minField = itemField;
11845 }
11846 }
11847 } catch (err) {
11848 _iterator2.e(err);
11849 } finally {
11850 _iterator2.f();
11851 }
11852
11853 return min || null;
11854 }
11855 /**
11856 * Find all distinct values of a specified field
11857 *
11858 * @param prop - The property name whose distinct values should be returned.
11859 * @returns Unordered array containing all distinct values. Items without specified property are ignored.
11860 */
11861
11862 }, {
11863 key: "distinct",
11864 value: function distinct(prop) {
11865 var data = this._data;
11866
11867 var itemIds = _toConsumableArray(keys(data).call(data));
11868
11869 var values = [];
11870 var count = 0;
11871
11872 for (var i = 0, len = itemIds.length; i < len; i++) {
11873 var id = itemIds[i];
11874 var item = data.get(id);
11875 var value = item[prop];
11876 var exists = false;
11877
11878 for (var j = 0; j < count; j++) {
11879 if (values[j] == value) {
11880 exists = true;
11881 break;
11882 }
11883 }
11884
11885 if (!exists && value !== undefined) {
11886 values[count] = value;
11887 count++;
11888 }
11889 }
11890
11891 return values;
11892 }
11893 /**
11894 * Add a single item. Will fail when an item with the same id already exists.
11895 *
11896 * @param item - A new item to be added.
11897 * @returns Added item's id. An id is generated when it is not present in the item.
11898 */
11899
11900 }, {
11901 key: "_addItem",
11902 value: function _addItem(item) {
11903 var fullItem = ensureFullItem(item, this._idProp);
11904 var id = fullItem[this._idProp]; // check whether this id is already taken
11905
11906 if (this._data.has(id)) {
11907 // item already exists
11908 throw new Error("Cannot add item: item with id " + id + " already exists");
11909 }
11910
11911 this._data.set(id, fullItem);
11912
11913 ++this.length;
11914 return id;
11915 }
11916 /**
11917 * Update a single item: merge with existing item.
11918 * Will fail when the item has no id, or when there does not exist an item with the same id.
11919 *
11920 * @param update - The new item
11921 * @returns The id of the updated item.
11922 */
11923
11924 }, {
11925 key: "_updateItem",
11926 value: function _updateItem(update) {
11927 var id = update[this._idProp];
11928
11929 if (id == null) {
11930 throw new Error("Cannot update item: item has no id (item: " + stringify$1(update) + ")");
11931 }
11932
11933 var item = this._data.get(id);
11934
11935 if (!item) {
11936 // item doesn't exist
11937 throw new Error("Cannot update item: no item with id " + id + " found");
11938 }
11939
11940 this._data.set(id, _objectSpread(_objectSpread({}, item), update));
11941
11942 return id;
11943 }
11944 /** @inheritDoc */
11945
11946 }, {
11947 key: "stream",
11948 value: function stream(ids) {
11949 if (ids) {
11950 var data = this._data;
11951 return new DataStream(_defineProperty({}, iterator, /*#__PURE__*/regenerator.mark(function _callee() {
11952 var _iterator3, _step3, id, item;
11953
11954 return regenerator.wrap(function _callee$(_context7) {
11955 while (1) {
11956 switch (_context7.prev = _context7.next) {
11957 case 0:
11958 _iterator3 = _createForOfIteratorHelper$1(ids);
11959 _context7.prev = 1;
11960
11961 _iterator3.s();
11962
11963 case 3:
11964 if ((_step3 = _iterator3.n()).done) {
11965 _context7.next = 11;
11966 break;
11967 }
11968
11969 id = _step3.value;
11970 item = data.get(id);
11971
11972 if (!(item != null)) {
11973 _context7.next = 9;
11974 break;
11975 }
11976
11977 _context7.next = 9;
11978 return [id, item];
11979
11980 case 9:
11981 _context7.next = 3;
11982 break;
11983
11984 case 11:
11985 _context7.next = 16;
11986 break;
11987
11988 case 13:
11989 _context7.prev = 13;
11990 _context7.t0 = _context7["catch"](1);
11991
11992 _iterator3.e(_context7.t0);
11993
11994 case 16:
11995 _context7.prev = 16;
11996
11997 _iterator3.f();
11998
11999 return _context7.finish(16);
12000
12001 case 19:
12002 case "end":
12003 return _context7.stop();
12004 }
12005 }
12006 }, _callee, null, [[1, 13, 16, 19]]);
12007 })));
12008 } else {
12009 var _context8;
12010
12011 return new DataStream(_defineProperty({}, iterator, bind$6(_context8 = entries(this._data)).call(_context8, this._data)));
12012 }
12013 }
12014 /* develblock:start */
12015
12016 }, {
12017 key: "testLeakData",
12018 get: function get() {
12019 return this._data;
12020 }
12021 }, {
12022 key: "testLeakIdProp",
12023 get: function get() {
12024 return this._idProp;
12025 }
12026 }, {
12027 key: "testLeakOptions",
12028 get: function get() {
12029 return this._options;
12030 }
12031 }, {
12032 key: "testLeakQueue",
12033 get: function get() {
12034 return this._queue;
12035 },
12036 set: function set(v) {
12037 this._queue = v;
12038 }
12039 }]);
12040
12041 return DataSet;
12042}(DataSetPart);
12043
12044function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof symbol !== "undefined" && getIteratorMethod$1(o) || o["@@iterator"]; if (!it) { if (isArray$1(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
12045
12046function _unsupportedIterableToArray(o, minLen) { var _context5; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = slice(_context5 = Object.prototype.toString.call(o)).call(_context5, 8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return from$3(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
12047
12048function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
12049
12050function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
12051
12052function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !construct) return false; if (construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
12053/**
12054 * DataView
12055 *
12056 * A DataView offers a filtered and/or formatted view on a DataSet. One can subscribe to changes in a DataView, and easily get filtered or formatted data without having to specify filters and field types all the time.
12057 *
12058 * ## Example
12059 * ```javascript
12060 * // create a DataSet
12061 * var data = new vis.DataSet();
12062 * data.add([
12063 * {id: 1, text: 'item 1', date: new Date(2013, 6, 20), group: 1, first: true},
12064 * {id: 2, text: 'item 2', date: '2013-06-23', group: 2},
12065 * {id: 3, text: 'item 3', date: '2013-06-25', group: 2},
12066 * {id: 4, text: 'item 4'}
12067 * ]);
12068 *
12069 * // create a DataView
12070 * // the view will only contain items having a property group with value 1,
12071 * // and will only output fields id, text, and date.
12072 * var view = new vis.DataView(data, {
12073 * filter: function (item) {
12074 * return (item.group == 1);
12075 * },
12076 * fields: ['id', 'text', 'date']
12077 * });
12078 *
12079 * // subscribe to any change in the DataView
12080 * view.on('*', function (event, properties, senderId) {
12081 * console.log('event', event, properties);
12082 * });
12083 *
12084 * // update an item in the data set
12085 * data.update({id: 2, group: 1});
12086 *
12087 * // get all ids in the view
12088 * var ids = view.getIds();
12089 * console.log('ids', ids); // will output [1, 2]
12090 *
12091 * // get all items in the view
12092 * var items = view.get();
12093 * ```
12094 *
12095 * @typeParam Item - Item type that may or may not have an id.
12096 * @typeParam IdProp - Name of the property that contains the id.
12097 */
12098
12099var DataView = /*#__PURE__*/function (_DataSetPart) {
12100 _inherits(DataView, _DataSetPart);
12101
12102 var _super = _createSuper(DataView);
12103
12104 /**
12105 * Create a DataView.
12106 *
12107 * @param data - The instance containing data (directly or indirectly).
12108 * @param options - Options to configure this data view.
12109 */
12110 function DataView(data, options) {
12111 var _context;
12112
12113 var _this;
12114
12115 _classCallCheck(this, DataView);
12116
12117 _this = _super.call(this);
12118
12119 _defineProperty(_assertThisInitialized(_this), "length", 0);
12120
12121 _defineProperty(_assertThisInitialized(_this), "_listener", void 0);
12122
12123 _defineProperty(_assertThisInitialized(_this), "_data", void 0);
12124
12125 _defineProperty(_assertThisInitialized(_this), "_ids", new set());
12126
12127 _defineProperty(_assertThisInitialized(_this), "_options", void 0);
12128
12129 _this._options = options || {};
12130 _this._listener = bind$6(_context = _this._onEvent).call(_context, _assertThisInitialized(_this));
12131
12132 _this.setData(data);
12133
12134 return _this;
12135 } // TODO: implement a function .config() to dynamically update things like configured filter
12136 // and trigger changes accordingly
12137
12138 /**
12139 * Set a data source for the view.
12140 *
12141 * @param data - The instance containing data (directly or indirectly).
12142 * @remarks
12143 * Note that when the data view is bound to a data set it won't be garbage
12144 * collected unless the data set is too. Use `dataView.setData(null)` or
12145 * `dataView.dispose()` to enable garbage collection before you lose the last
12146 * reference.
12147 */
12148
12149
12150 _createClass(DataView, [{
12151 key: "idProp",
12152 get:
12153 /** @inheritDoc */
12154
12155 /** @inheritDoc */
12156 function get() {
12157 return this.getDataSet().idProp;
12158 }
12159 }, {
12160 key: "setData",
12161 value: function setData(data) {
12162 if (this._data) {
12163 // unsubscribe from current dataset
12164 if (this._data.off) {
12165 this._data.off("*", this._listener);
12166 } // trigger a remove of all items in memory
12167
12168
12169 var ids = this._data.getIds({
12170 filter: filter(this._options)
12171 });
12172
12173 var items = this._data.get(ids);
12174
12175 this._ids.clear();
12176
12177 this.length = 0;
12178
12179 this._trigger("remove", {
12180 items: ids,
12181 oldData: items
12182 });
12183 }
12184
12185 if (data != null) {
12186 this._data = data; // trigger an add of all added items
12187
12188 var _ids = this._data.getIds({
12189 filter: filter(this._options)
12190 });
12191
12192 for (var i = 0, len = _ids.length; i < len; i++) {
12193 var id = _ids[i];
12194
12195 this._ids.add(id);
12196 }
12197
12198 this.length = _ids.length;
12199
12200 this._trigger("add", {
12201 items: _ids
12202 });
12203 } else {
12204 this._data = new DataSet();
12205 } // subscribe to new dataset
12206
12207
12208 if (this._data.on) {
12209 this._data.on("*", this._listener);
12210 }
12211 }
12212 /**
12213 * Refresh the DataView.
12214 * Useful when the DataView has a filter function containing a variable parameter.
12215 */
12216
12217 }, {
12218 key: "refresh",
12219 value: function refresh() {
12220 var ids = this._data.getIds({
12221 filter: filter(this._options)
12222 });
12223
12224 var oldIds = _toConsumableArray(this._ids);
12225
12226 var newIds = {};
12227 var addedIds = [];
12228 var removedIds = [];
12229 var removedItems = []; // check for additions
12230
12231 for (var i = 0, len = ids.length; i < len; i++) {
12232 var id = ids[i];
12233 newIds[id] = true;
12234
12235 if (!this._ids.has(id)) {
12236 addedIds.push(id);
12237
12238 this._ids.add(id);
12239 }
12240 } // check for removals
12241
12242
12243 for (var _i = 0, _len = oldIds.length; _i < _len; _i++) {
12244 var _id = oldIds[_i];
12245
12246 var item = this._data.get(_id);
12247
12248 if (item == null) {
12249 // @TODO: Investigate.
12250 // Doesn't happen during tests or examples.
12251 // Is it really impossible or could it eventually happen?
12252 // How to handle it if it does? The types guarantee non-nullable items.
12253 console.error("If you see this, report it please.");
12254 } else if (!newIds[_id]) {
12255 removedIds.push(_id);
12256 removedItems.push(item);
12257
12258 this._ids.delete(_id);
12259 }
12260 }
12261
12262 this.length += addedIds.length - removedIds.length; // trigger events
12263
12264 if (addedIds.length) {
12265 this._trigger("add", {
12266 items: addedIds
12267 });
12268 }
12269
12270 if (removedIds.length) {
12271 this._trigger("remove", {
12272 items: removedIds,
12273 oldData: removedItems
12274 });
12275 }
12276 }
12277 /** @inheritDoc */
12278
12279 }, {
12280 key: "get",
12281 value: function get(first, second) {
12282 if (this._data == null) {
12283 return null;
12284 } // parse the arguments
12285
12286
12287 var ids = null;
12288 var options;
12289
12290 if (isId(first) || isArray$1(first)) {
12291 ids = first;
12292 options = second;
12293 } else {
12294 options = first;
12295 } // extend the options with the default options and provided options
12296
12297
12298 var viewOptions = assign$2({}, this._options, options); // create a combined filter method when needed
12299
12300
12301 var thisFilter = filter(this._options);
12302
12303 var optionsFilter = options && filter(options);
12304
12305 if (thisFilter && optionsFilter) {
12306 viewOptions.filter = function (item) {
12307 return thisFilter(item) && optionsFilter(item);
12308 };
12309 }
12310
12311 if (ids == null) {
12312 return this._data.get(viewOptions);
12313 } else {
12314 return this._data.get(ids, viewOptions);
12315 }
12316 }
12317 /** @inheritDoc */
12318
12319 }, {
12320 key: "getIds",
12321 value: function getIds(options) {
12322 if (this._data.length) {
12323 var defaultFilter = filter(this._options);
12324
12325 var optionsFilter = options != null ? filter(options) : null;
12326 var filter$1;
12327
12328 if (optionsFilter) {
12329 if (defaultFilter) {
12330 filter$1 = function filter(item) {
12331 return defaultFilter(item) && optionsFilter(item);
12332 };
12333 } else {
12334 filter$1 = optionsFilter;
12335 }
12336 } else {
12337 filter$1 = defaultFilter;
12338 }
12339
12340 return this._data.getIds({
12341 filter: filter$1,
12342 order: options && options.order
12343 });
12344 } else {
12345 return [];
12346 }
12347 }
12348 /** @inheritDoc */
12349
12350 }, {
12351 key: "forEach",
12352 value: function forEach(callback, options) {
12353 if (this._data) {
12354 var _context2;
12355
12356 var defaultFilter = filter(this._options);
12357
12358 var optionsFilter = options && filter(options);
12359
12360 var filter$1;
12361
12362 if (optionsFilter) {
12363 if (defaultFilter) {
12364 filter$1 = function filter(item) {
12365 return defaultFilter(item) && optionsFilter(item);
12366 };
12367 } else {
12368 filter$1 = optionsFilter;
12369 }
12370 } else {
12371 filter$1 = defaultFilter;
12372 }
12373
12374 forEach$1(_context2 = this._data).call(_context2, callback, {
12375 filter: filter$1,
12376 order: options && options.order
12377 });
12378 }
12379 }
12380 /** @inheritDoc */
12381
12382 }, {
12383 key: "map",
12384 value: function map(callback, options) {
12385 if (this._data) {
12386 var _context3;
12387
12388 var defaultFilter = filter(this._options);
12389
12390 var optionsFilter = options && filter(options);
12391
12392 var filter$1;
12393
12394 if (optionsFilter) {
12395 if (defaultFilter) {
12396 filter$1 = function filter(item) {
12397 return defaultFilter(item) && optionsFilter(item);
12398 };
12399 } else {
12400 filter$1 = optionsFilter;
12401 }
12402 } else {
12403 filter$1 = defaultFilter;
12404 }
12405
12406 return map$3(_context3 = this._data).call(_context3, callback, {
12407 filter: filter$1,
12408 order: options && options.order
12409 });
12410 } else {
12411 return [];
12412 }
12413 }
12414 /** @inheritDoc */
12415
12416 }, {
12417 key: "getDataSet",
12418 value: function getDataSet() {
12419 return this._data.getDataSet();
12420 }
12421 /** @inheritDoc */
12422
12423 }, {
12424 key: "stream",
12425 value: function stream(ids) {
12426 var _context4;
12427
12428 return this._data.stream(ids || _defineProperty({}, iterator, bind$6(_context4 = keys(this._ids)).call(_context4, this._ids)));
12429 }
12430 /**
12431 * Render the instance unusable prior to garbage collection.
12432 *
12433 * @remarks
12434 * The intention of this method is to help discover scenarios where the data
12435 * view is being used when the programmer thinks it has been garbage collected
12436 * already. It's stricter version of `dataView.setData(null)`.
12437 */
12438
12439 }, {
12440 key: "dispose",
12441 value: function dispose() {
12442 var _this$_data;
12443
12444 if ((_this$_data = this._data) !== null && _this$_data !== void 0 && _this$_data.off) {
12445 this._data.off("*", this._listener);
12446 }
12447
12448 var message = "This data view has already been disposed of.";
12449 var replacement = {
12450 get: function get() {
12451 throw new Error(message);
12452 },
12453 set: function set() {
12454 throw new Error(message);
12455 },
12456 configurable: false
12457 };
12458
12459 var _iterator = _createForOfIteratorHelper(ownKeys$1(DataView.prototype)),
12460 _step;
12461
12462 try {
12463 for (_iterator.s(); !(_step = _iterator.n()).done;) {
12464 var key = _step.value;
12465
12466 defineProperty$4(this, key, replacement);
12467 }
12468 } catch (err) {
12469 _iterator.e(err);
12470 } finally {
12471 _iterator.f();
12472 }
12473 }
12474 /**
12475 * Event listener. Will propagate all events from the connected data set to the subscribers of the DataView, but will filter the items and only trigger when there are changes in the filtered data set.
12476 *
12477 * @param event - The name of the event.
12478 * @param params - Parameters of the event.
12479 * @param senderId - Id supplied by the sender.
12480 */
12481
12482 }, {
12483 key: "_onEvent",
12484 value: function _onEvent(event, params, senderId) {
12485 if (!params || !params.items || !this._data) {
12486 return;
12487 }
12488
12489 var ids = params.items;
12490 var addedIds = [];
12491 var updatedIds = [];
12492 var removedIds = [];
12493 var oldItems = [];
12494 var updatedItems = [];
12495 var removedItems = [];
12496
12497 switch (event) {
12498 case "add":
12499 // filter the ids of the added items
12500 for (var i = 0, len = ids.length; i < len; i++) {
12501 var id = ids[i];
12502 var item = this.get(id);
12503
12504 if (item) {
12505 this._ids.add(id);
12506
12507 addedIds.push(id);
12508 }
12509 }
12510
12511 break;
12512
12513 case "update":
12514 // determine the event from the views viewpoint: an updated
12515 // item can be added, updated, or removed from this view.
12516 for (var _i2 = 0, _len2 = ids.length; _i2 < _len2; _i2++) {
12517 var _id2 = ids[_i2];
12518
12519 var _item = this.get(_id2);
12520
12521 if (_item) {
12522 if (this._ids.has(_id2)) {
12523 updatedIds.push(_id2);
12524 updatedItems.push(params.data[_i2]);
12525 oldItems.push(params.oldData[_i2]);
12526 } else {
12527 this._ids.add(_id2);
12528
12529 addedIds.push(_id2);
12530 }
12531 } else {
12532 if (this._ids.has(_id2)) {
12533 this._ids.delete(_id2);
12534
12535 removedIds.push(_id2);
12536 removedItems.push(params.oldData[_i2]);
12537 }
12538 }
12539 }
12540
12541 break;
12542
12543 case "remove":
12544 // filter the ids of the removed items
12545 for (var _i3 = 0, _len3 = ids.length; _i3 < _len3; _i3++) {
12546 var _id3 = ids[_i3];
12547
12548 if (this._ids.has(_id3)) {
12549 this._ids.delete(_id3);
12550
12551 removedIds.push(_id3);
12552 removedItems.push(params.oldData[_i3]);
12553 }
12554 }
12555
12556 break;
12557 }
12558
12559 this.length += addedIds.length - removedIds.length;
12560
12561 if (addedIds.length) {
12562 this._trigger("add", {
12563 items: addedIds
12564 }, senderId);
12565 }
12566
12567 if (updatedIds.length) {
12568 this._trigger("update", {
12569 items: updatedIds,
12570 oldData: oldItems,
12571 data: updatedItems
12572 }, senderId);
12573 }
12574
12575 if (removedIds.length) {
12576 this._trigger("remove", {
12577 items: removedIds,
12578 oldData: removedItems
12579 }, senderId);
12580 }
12581 }
12582 }]);
12583
12584 return DataView;
12585}(DataSetPart);
12586
12587/**
12588 * Check that given value is compatible with Vis Data Set interface.
12589 *
12590 * @param idProp - The expected property to contain item id.
12591 * @param v - The value to be tested.
12592 * @returns True if all expected values and methods match, false otherwise.
12593 */
12594function isDataSetLike(idProp, v) {
12595 return _typeof(v) === "object" && v !== null && idProp === v.idProp && typeof v.add === "function" && typeof v.clear === "function" && typeof v.distinct === "function" && typeof forEach$1(v) === "function" && typeof v.get === "function" && typeof v.getDataSet === "function" && typeof v.getIds === "function" && typeof v.length === "number" && typeof map$3(v) === "function" && typeof v.max === "function" && typeof v.min === "function" && typeof v.off === "function" && typeof v.on === "function" && typeof v.remove === "function" && typeof v.setOptions === "function" && typeof v.stream === "function" && typeof v.update === "function" && typeof v.updateOnly === "function";
12596}
12597
12598/**
12599 * Check that given value is compatible with Vis Data View interface.
12600 *
12601 * @param idProp - The expected property to contain item id.
12602 * @param v - The value to be tested.
12603 * @returns True if all expected values and methods match, false otherwise.
12604 */
12605
12606function isDataViewLike(idProp, v) {
12607 return _typeof(v) === "object" && v !== null && idProp === v.idProp && typeof forEach$1(v) === "function" && typeof v.get === "function" && typeof v.getDataSet === "function" && typeof v.getIds === "function" && typeof v.length === "number" && typeof map$3(v) === "function" && typeof v.off === "function" && typeof v.on === "function" && typeof v.stream === "function" && isDataSetLike(idProp, v.getDataSet());
12608}
12609
12610/* develblock:start */
12611console.warn("You're running a development build.");
12612
12613// Current API.
12614var index = {
12615 DataSet: DataSet,
12616 DataView: DataView,
12617 Queue: Queue
12618};
12619
12620export { DELETE, DataSet, DataStream, DataView, Queue, createNewDataPipeFrom, index as default, isDataSetLike, isDataViewLike };
12621//# sourceMappingURL=esm.js.map