1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | (function (global, factory) {
|
28 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
29 | typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
30 | (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.vis = global.vis || {}));
|
31 | })(this, (function (exports) { 'use strict';
|
32 |
|
33 | function _classCallCheck(instance, Constructor) {
|
34 | if (!(instance instanceof Constructor)) {
|
35 | throw new TypeError("Cannot call a class as a function");
|
36 | }
|
37 | }
|
38 |
|
39 | var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
40 |
|
41 | function getDefaultExportFromCjs (x) {
|
42 | return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
43 | }
|
44 |
|
45 | var defineProperty$f = {exports: {}};
|
46 |
|
47 | var check = function (it) {
|
48 | return it && it.Math === Math && it;
|
49 | };
|
50 |
|
51 |
|
52 | var global$p =
|
53 |
|
54 | check(typeof globalThis == 'object' && globalThis) ||
|
55 | check(typeof window == 'object' && window) ||
|
56 |
|
57 | check(typeof self == 'object' && self) ||
|
58 | check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
|
59 |
|
60 | (function () { return this; })() || commonjsGlobal || Function('return this')();
|
61 |
|
62 | var fails$u = function (exec) {
|
63 | try {
|
64 | return !!exec();
|
65 | } catch (error) {
|
66 | return true;
|
67 | }
|
68 | };
|
69 |
|
70 | var fails$t = fails$u;
|
71 |
|
72 | var functionBindNative = !fails$t(function () {
|
73 |
|
74 | var test = (function () { }).bind();
|
75 |
|
76 | return typeof test != 'function' || test.hasOwnProperty('prototype');
|
77 | });
|
78 |
|
79 | var NATIVE_BIND$4 = functionBindNative;
|
80 |
|
81 | var FunctionPrototype$4 = Function.prototype;
|
82 | var apply$6 = FunctionPrototype$4.apply;
|
83 | var call$k = FunctionPrototype$4.call;
|
84 |
|
85 |
|
86 | var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$4 ? call$k.bind(apply$6) : function () {
|
87 | return call$k.apply(apply$6, arguments);
|
88 | });
|
89 |
|
90 | var NATIVE_BIND$3 = functionBindNative;
|
91 |
|
92 | var FunctionPrototype$3 = Function.prototype;
|
93 | var call$j = FunctionPrototype$3.call;
|
94 | var uncurryThisWithBind = NATIVE_BIND$3 && FunctionPrototype$3.bind.bind(call$j, call$j);
|
95 |
|
96 | var functionUncurryThis = NATIVE_BIND$3 ? uncurryThisWithBind : function (fn) {
|
97 | return function () {
|
98 | return call$j.apply(fn, arguments);
|
99 | };
|
100 | };
|
101 |
|
102 | var uncurryThis$q = functionUncurryThis;
|
103 |
|
104 | var toString$9 = uncurryThis$q({}.toString);
|
105 | var stringSlice$1 = uncurryThis$q(''.slice);
|
106 |
|
107 | var classofRaw$2 = function (it) {
|
108 | return stringSlice$1(toString$9(it), 8, -1);
|
109 | };
|
110 |
|
111 | var classofRaw$1 = classofRaw$2;
|
112 | var uncurryThis$p = functionUncurryThis;
|
113 |
|
114 | var functionUncurryThisClause = function (fn) {
|
115 |
|
116 |
|
117 |
|
118 | if (classofRaw$1(fn) === 'Function') return uncurryThis$p(fn);
|
119 | };
|
120 |
|
121 | var documentAll$2 = typeof document == 'object' && document.all;
|
122 |
|
123 |
|
124 |
|
125 | var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
|
126 |
|
127 | var documentAll_1 = {
|
128 | all: documentAll$2,
|
129 | IS_HTMLDDA: IS_HTMLDDA
|
130 | };
|
131 |
|
132 | var $documentAll$1 = documentAll_1;
|
133 |
|
134 | var documentAll$1 = $documentAll$1.all;
|
135 |
|
136 |
|
137 |
|
138 | var isCallable$m = $documentAll$1.IS_HTMLDDA ? function (argument) {
|
139 | return typeof argument == 'function' || argument === documentAll$1;
|
140 | } : function (argument) {
|
141 | return typeof argument == 'function';
|
142 | };
|
143 |
|
144 | var objectGetOwnPropertyDescriptor = {};
|
145 |
|
146 | var fails$s = fails$u;
|
147 |
|
148 |
|
149 | var descriptors = !fails$s(function () {
|
150 |
|
151 | return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
152 | });
|
153 |
|
154 | var NATIVE_BIND$2 = functionBindNative;
|
155 |
|
156 | var call$i = Function.prototype.call;
|
157 |
|
158 | var functionCall = NATIVE_BIND$2 ? call$i.bind(call$i) : function () {
|
159 | return call$i.apply(call$i, arguments);
|
160 | };
|
161 |
|
162 | var objectPropertyIsEnumerable = {};
|
163 |
|
164 | var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
|
165 |
|
166 | var getOwnPropertyDescriptor$7 = Object.getOwnPropertyDescriptor;
|
167 |
|
168 |
|
169 | var NASHORN_BUG = getOwnPropertyDescriptor$7 && !$propertyIsEnumerable$1.call({ 1: 2 }, 1);
|
170 |
|
171 |
|
172 |
|
173 | objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
174 | var descriptor = getOwnPropertyDescriptor$7(this, V);
|
175 | return !!descriptor && descriptor.enumerable;
|
176 | } : $propertyIsEnumerable$1;
|
177 |
|
178 | var createPropertyDescriptor$7 = function (bitmap, value) {
|
179 | return {
|
180 | enumerable: !(bitmap & 1),
|
181 | configurable: !(bitmap & 2),
|
182 | writable: !(bitmap & 4),
|
183 | value: value
|
184 | };
|
185 | };
|
186 |
|
187 | var uncurryThis$o = functionUncurryThis;
|
188 | var fails$r = fails$u;
|
189 | var classof$f = classofRaw$2;
|
190 |
|
191 | var $Object$4 = Object;
|
192 | var split = uncurryThis$o(''.split);
|
193 |
|
194 |
|
195 | var indexedObject = fails$r(function () {
|
196 |
|
197 |
|
198 | return !$Object$4('z').propertyIsEnumerable(0);
|
199 | }) ? function (it) {
|
200 | return classof$f(it) === 'String' ? split(it, '') : $Object$4(it);
|
201 | } : $Object$4;
|
202 |
|
203 |
|
204 |
|
205 | var isNullOrUndefined$6 = function (it) {
|
206 | return it === null || it === undefined;
|
207 | };
|
208 |
|
209 | var isNullOrUndefined$5 = isNullOrUndefined$6;
|
210 |
|
211 | var $TypeError$g = TypeError;
|
212 |
|
213 |
|
214 |
|
215 | var requireObjectCoercible$3 = function (it) {
|
216 | if (isNullOrUndefined$5(it)) throw new $TypeError$g("Can't call method on " + it);
|
217 | return it;
|
218 | };
|
219 |
|
220 |
|
221 | var IndexedObject$3 = indexedObject;
|
222 | var requireObjectCoercible$2 = requireObjectCoercible$3;
|
223 |
|
224 | var toIndexedObject$a = function (it) {
|
225 | return IndexedObject$3(requireObjectCoercible$2(it));
|
226 | };
|
227 |
|
228 | var isCallable$l = isCallable$m;
|
229 | var $documentAll = documentAll_1;
|
230 |
|
231 | var documentAll = $documentAll.all;
|
232 |
|
233 | var isObject$h = $documentAll.IS_HTMLDDA ? function (it) {
|
234 | return typeof it == 'object' ? it !== null : isCallable$l(it) || it === documentAll;
|
235 | } : function (it) {
|
236 | return typeof it == 'object' ? it !== null : isCallable$l(it);
|
237 | };
|
238 |
|
239 | var path$o = {};
|
240 |
|
241 | var path$n = path$o;
|
242 | var global$o = global$p;
|
243 | var isCallable$k = isCallable$m;
|
244 |
|
245 | var aFunction = function (variable) {
|
246 | return isCallable$k(variable) ? variable : undefined;
|
247 | };
|
248 |
|
249 | var getBuiltIn$f = function (namespace, method) {
|
250 | return arguments.length < 2 ? aFunction(path$n[namespace]) || aFunction(global$o[namespace])
|
251 | : path$n[namespace] && path$n[namespace][method] || global$o[namespace] && global$o[namespace][method];
|
252 | };
|
253 |
|
254 | var uncurryThis$n = functionUncurryThis;
|
255 |
|
256 | var objectIsPrototypeOf = uncurryThis$n({}.isPrototypeOf);
|
257 |
|
258 | var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
259 |
|
260 | var global$n = global$p;
|
261 | var userAgent$5 = engineUserAgent;
|
262 |
|
263 | var process$3 = global$n.process;
|
264 | var Deno$1 = global$n.Deno;
|
265 | var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
|
266 | var v8 = versions && versions.v8;
|
267 | var match, version;
|
268 |
|
269 | if (v8) {
|
270 | match = v8.split('.');
|
271 |
|
272 |
|
273 | version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
274 | }
|
275 |
|
276 |
|
277 |
|
278 | if (!version && userAgent$5) {
|
279 | match = userAgent$5.match(/Edge\/(\d+)/);
|
280 | if (!match || match[1] >= 74) {
|
281 | match = userAgent$5.match(/Chrome\/(\d+)/);
|
282 | if (match) version = +match[1];
|
283 | }
|
284 | }
|
285 |
|
286 | var engineV8Version = version;
|
287 |
|
288 |
|
289 | var V8_VERSION$3 = engineV8Version;
|
290 | var fails$q = fails$u;
|
291 | var global$m = global$p;
|
292 |
|
293 | var $String$5 = global$m.String;
|
294 |
|
295 |
|
296 | var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$q(function () {
|
297 | var symbol = Symbol('symbol detection');
|
298 |
|
299 |
|
300 |
|
301 |
|
302 | return !$String$5(symbol) || !(Object(symbol) instanceof Symbol) ||
|
303 |
|
304 | !Symbol.sham && V8_VERSION$3 && V8_VERSION$3 < 41;
|
305 | });
|
306 |
|
307 |
|
308 | var NATIVE_SYMBOL$5 = symbolConstructorDetection;
|
309 |
|
310 | var useSymbolAsUid = NATIVE_SYMBOL$5
|
311 | && !Symbol.sham
|
312 | && typeof Symbol.iterator == 'symbol';
|
313 |
|
314 | var getBuiltIn$e = getBuiltIn$f;
|
315 | var isCallable$j = isCallable$m;
|
316 | var isPrototypeOf$k = objectIsPrototypeOf;
|
317 | var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
318 |
|
319 | var $Object$3 = Object;
|
320 |
|
321 | var isSymbol$5 = USE_SYMBOL_AS_UID$1 ? function (it) {
|
322 | return typeof it == 'symbol';
|
323 | } : function (it) {
|
324 | var $Symbol = getBuiltIn$e('Symbol');
|
325 | return isCallable$j($Symbol) && isPrototypeOf$k($Symbol.prototype, $Object$3(it));
|
326 | };
|
327 |
|
328 | var $String$4 = String;
|
329 |
|
330 | var tryToString$6 = function (argument) {
|
331 | try {
|
332 | return $String$4(argument);
|
333 | } catch (error) {
|
334 | return 'Object';
|
335 | }
|
336 | };
|
337 |
|
338 | var isCallable$i = isCallable$m;
|
339 | var tryToString$5 = tryToString$6;
|
340 |
|
341 | var $TypeError$f = TypeError;
|
342 |
|
343 |
|
344 | var aCallable$e = function (argument) {
|
345 | if (isCallable$i(argument)) return argument;
|
346 | throw new $TypeError$f(tryToString$5(argument) + ' is not a function');
|
347 | };
|
348 |
|
349 | var aCallable$d = aCallable$e;
|
350 | var isNullOrUndefined$4 = isNullOrUndefined$6;
|
351 |
|
352 |
|
353 |
|
354 | var getMethod$3 = function (V, P) {
|
355 | var func = V[P];
|
356 | return isNullOrUndefined$4(func) ? undefined : aCallable$d(func);
|
357 | };
|
358 |
|
359 | var call$h = functionCall;
|
360 | var isCallable$h = isCallable$m;
|
361 | var isObject$g = isObject$h;
|
362 |
|
363 | var $TypeError$e = TypeError;
|
364 |
|
365 |
|
366 |
|
367 | var ordinaryToPrimitive$1 = function (input, pref) {
|
368 | var fn, val;
|
369 | if (pref === 'string' && isCallable$h(fn = input.toString) && !isObject$g(val = call$h(fn, input))) return val;
|
370 | if (isCallable$h(fn = input.valueOf) && !isObject$g(val = call$h(fn, input))) return val;
|
371 | if (pref !== 'string' && isCallable$h(fn = input.toString) && !isObject$g(val = call$h(fn, input))) return val;
|
372 | throw new $TypeError$e("Can't convert object to primitive value");
|
373 | };
|
374 |
|
375 | var shared$7 = {exports: {}};
|
376 |
|
377 | var isPure = true;
|
378 |
|
379 | var global$l = global$p;
|
380 |
|
381 |
|
382 | var defineProperty$e = Object.defineProperty;
|
383 |
|
384 | var defineGlobalProperty$1 = function (key, value) {
|
385 | try {
|
386 | defineProperty$e(global$l, key, { value: value, configurable: true, writable: true });
|
387 | } catch (error) {
|
388 | global$l[key] = value;
|
389 | } return value;
|
390 | };
|
391 |
|
392 | var global$k = global$p;
|
393 | var defineGlobalProperty = defineGlobalProperty$1;
|
394 |
|
395 | var SHARED = '__core-js_shared__';
|
396 | var store$3 = global$k[SHARED] || defineGlobalProperty(SHARED, {});
|
397 |
|
398 | var sharedStore = store$3;
|
399 |
|
400 | var store$2 = sharedStore;
|
401 |
|
402 | (shared$7.exports = function (key, value) {
|
403 | return store$2[key] || (store$2[key] = value !== undefined ? value : {});
|
404 | })('versions', []).push({
|
405 | version: '3.33.2',
|
406 | mode: 'pure' ,
|
407 | copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
408 | license: 'https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE',
|
409 | source: 'https://github.com/zloirock/core-js'
|
410 | });
|
411 |
|
412 | var sharedExports = shared$7.exports;
|
413 |
|
414 | var requireObjectCoercible$1 = requireObjectCoercible$3;
|
415 |
|
416 | var $Object$2 = Object;
|
417 |
|
418 |
|
419 |
|
420 | var toObject$e = function (argument) {
|
421 | return $Object$2(requireObjectCoercible$1(argument));
|
422 | };
|
423 |
|
424 | var uncurryThis$m = functionUncurryThis;
|
425 | var toObject$d = toObject$e;
|
426 |
|
427 | var hasOwnProperty = uncurryThis$m({}.hasOwnProperty);
|
428 |
|
429 |
|
430 |
|
431 |
|
432 | var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
|
433 | return hasOwnProperty(toObject$d(it), key);
|
434 | };
|
435 |
|
436 | var uncurryThis$l = functionUncurryThis;
|
437 |
|
438 | var id$1 = 0;
|
439 | var postfix = Math.random();
|
440 | var toString$8 = uncurryThis$l(1.0.toString);
|
441 |
|
442 | var uid$4 = function (key) {
|
443 | return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$8(++id$1 + postfix, 36);
|
444 | };
|
445 |
|
446 | var global$j = global$p;
|
447 | var shared$6 = sharedExports;
|
448 | var hasOwn$j = hasOwnProperty_1;
|
449 | var uid$3 = uid$4;
|
450 | var NATIVE_SYMBOL$4 = symbolConstructorDetection;
|
451 | var USE_SYMBOL_AS_UID = useSymbolAsUid;
|
452 |
|
453 | var Symbol$3 = global$j.Symbol;
|
454 | var WellKnownSymbolsStore$2 = shared$6('wks');
|
455 | var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3['for'] || Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$3;
|
456 |
|
457 | var wellKnownSymbol$n = function (name) {
|
458 | if (!hasOwn$j(WellKnownSymbolsStore$2, name)) {
|
459 | WellKnownSymbolsStore$2[name] = NATIVE_SYMBOL$4 && hasOwn$j(Symbol$3, name)
|
460 | ? Symbol$3[name]
|
461 | : createWellKnownSymbol('Symbol.' + name);
|
462 | } return WellKnownSymbolsStore$2[name];
|
463 | };
|
464 |
|
465 | var call$g = functionCall;
|
466 | var isObject$f = isObject$h;
|
467 | var isSymbol$4 = isSymbol$5;
|
468 | var getMethod$2 = getMethod$3;
|
469 | var ordinaryToPrimitive = ordinaryToPrimitive$1;
|
470 | var wellKnownSymbol$m = wellKnownSymbol$n;
|
471 |
|
472 | var $TypeError$d = TypeError;
|
473 | var TO_PRIMITIVE = wellKnownSymbol$m('toPrimitive');
|
474 |
|
475 |
|
476 |
|
477 | var toPrimitive$6 = function (input, pref) {
|
478 | if (!isObject$f(input) || isSymbol$4(input)) return input;
|
479 | var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
|
480 | var result;
|
481 | if (exoticToPrim) {
|
482 | if (pref === undefined) pref = 'default';
|
483 | result = call$g(exoticToPrim, input, pref);
|
484 | if (!isObject$f(result) || isSymbol$4(result)) return result;
|
485 | throw new $TypeError$d("Can't convert object to primitive value");
|
486 | }
|
487 | if (pref === undefined) pref = 'number';
|
488 | return ordinaryToPrimitive(input, pref);
|
489 | };
|
490 |
|
491 | var toPrimitive$5 = toPrimitive$6;
|
492 | var isSymbol$3 = isSymbol$5;
|
493 |
|
494 |
|
495 |
|
496 | var toPropertyKey$4 = function (argument) {
|
497 | var key = toPrimitive$5(argument, 'string');
|
498 | return isSymbol$3(key) ? key : key + '';
|
499 | };
|
500 |
|
501 | var global$i = global$p;
|
502 | var isObject$e = isObject$h;
|
503 |
|
504 | var document$3 = global$i.document;
|
505 |
|
506 | var EXISTS$1 = isObject$e(document$3) && isObject$e(document$3.createElement);
|
507 |
|
508 | var documentCreateElement$1 = function (it) {
|
509 | return EXISTS$1 ? document$3.createElement(it) : {};
|
510 | };
|
511 |
|
512 | var DESCRIPTORS$h = descriptors;
|
513 | var fails$p = fails$u;
|
514 | var createElement$1 = documentCreateElement$1;
|
515 |
|
516 |
|
517 | var ie8DomDefine = !DESCRIPTORS$h && !fails$p(function () {
|
518 |
|
519 | return Object.defineProperty(createElement$1('div'), 'a', {
|
520 | get: function () { return 7; }
|
521 | }).a !== 7;
|
522 | });
|
523 |
|
524 | var DESCRIPTORS$g = descriptors;
|
525 | var call$f = functionCall;
|
526 | var propertyIsEnumerableModule$2 = objectPropertyIsEnumerable;
|
527 | var createPropertyDescriptor$6 = createPropertyDescriptor$7;
|
528 | var toIndexedObject$9 = toIndexedObject$a;
|
529 | var toPropertyKey$3 = toPropertyKey$4;
|
530 | var hasOwn$i = hasOwnProperty_1;
|
531 | var IE8_DOM_DEFINE$1 = ie8DomDefine;
|
532 |
|
533 |
|
534 | var $getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
|
535 |
|
536 |
|
537 |
|
538 | objectGetOwnPropertyDescriptor.f = DESCRIPTORS$g ? $getOwnPropertyDescriptor$2 : function getOwnPropertyDescriptor(O, P) {
|
539 | O = toIndexedObject$9(O);
|
540 | P = toPropertyKey$3(P);
|
541 | if (IE8_DOM_DEFINE$1) try {
|
542 | return $getOwnPropertyDescriptor$2(O, P);
|
543 | } catch (error) { }
|
544 | if (hasOwn$i(O, P)) return createPropertyDescriptor$6(!call$f(propertyIsEnumerableModule$2.f, O, P), O[P]);
|
545 | };
|
546 |
|
547 | var fails$o = fails$u;
|
548 | var isCallable$g = isCallable$m;
|
549 |
|
550 | var replacement = /#|\.prototype\./;
|
551 |
|
552 | var isForced$2 = function (feature, detection) {
|
553 | var value = data[normalize(feature)];
|
554 | return value === POLYFILL ? true
|
555 | : value === NATIVE ? false
|
556 | : isCallable$g(detection) ? fails$o(detection)
|
557 | : !!detection;
|
558 | };
|
559 |
|
560 | var normalize = isForced$2.normalize = function (string) {
|
561 | return String(string).replace(replacement, '.').toLowerCase();
|
562 | };
|
563 |
|
564 | var data = isForced$2.data = {};
|
565 | var NATIVE = isForced$2.NATIVE = 'N';
|
566 | var POLYFILL = isForced$2.POLYFILL = 'P';
|
567 |
|
568 | var isForced_1 = isForced$2;
|
569 |
|
570 | var uncurryThis$k = functionUncurryThisClause;
|
571 | var aCallable$c = aCallable$e;
|
572 | var NATIVE_BIND$1 = functionBindNative;
|
573 |
|
574 | var bind$i = uncurryThis$k(uncurryThis$k.bind);
|
575 |
|
576 |
|
577 | var functionBindContext = function (fn, that) {
|
578 | aCallable$c(fn);
|
579 | return that === undefined ? fn : NATIVE_BIND$1 ? bind$i(fn, that) : function (/* ...args */) {
|
580 | return fn.apply(that, arguments);
|
581 | };
|
582 | };
|
583 |
|
584 | var objectDefineProperty = {};
|
585 |
|
586 | var DESCRIPTORS$f = descriptors;
|
587 | var fails$n = fails$u;
|
588 |
|
589 |
|
590 |
|
591 | var v8PrototypeDefineBug = DESCRIPTORS$f && fails$n(function () {
|
592 |
|
593 | return Object.defineProperty(function () { }, 'prototype', {
|
594 | value: 42,
|
595 | writable: false
|
596 | }).prototype !== 42;
|
597 | });
|
598 |
|
599 | var isObject$d = isObject$h;
|
600 |
|
601 | var $String$3 = String;
|
602 | var $TypeError$c = TypeError;
|
603 |
|
604 |
|
605 | var anObject$d = function (argument) {
|
606 | if (isObject$d(argument)) return argument;
|
607 | throw new $TypeError$c($String$3(argument) + ' is not an object');
|
608 | };
|
609 |
|
610 | var DESCRIPTORS$e = descriptors;
|
611 | var IE8_DOM_DEFINE = ie8DomDefine;
|
612 | var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
|
613 | var anObject$c = anObject$d;
|
614 | var toPropertyKey$2 = toPropertyKey$4;
|
615 |
|
616 | var $TypeError$b = TypeError;
|
617 |
|
618 | var $defineProperty$1 = Object.defineProperty;
|
619 |
|
620 | var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
621 | var ENUMERABLE = 'enumerable';
|
622 | var CONFIGURABLE$1 = 'configurable';
|
623 | var WRITABLE = 'writable';
|
624 |
|
625 |
|
626 |
|
627 | objectDefineProperty.f = DESCRIPTORS$e ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
|
628 | anObject$c(O);
|
629 | P = toPropertyKey$2(P);
|
630 | anObject$c(Attributes);
|
631 | if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
632 | var current = $getOwnPropertyDescriptor$1(O, P);
|
633 | if (current && current[WRITABLE]) {
|
634 | O[P] = Attributes.value;
|
635 | Attributes = {
|
636 | configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
|
637 | enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
638 | writable: false
|
639 | };
|
640 | }
|
641 | } return $defineProperty$1(O, P, Attributes);
|
642 | } : $defineProperty$1 : function defineProperty(O, P, Attributes) {
|
643 | anObject$c(O);
|
644 | P = toPropertyKey$2(P);
|
645 | anObject$c(Attributes);
|
646 | if (IE8_DOM_DEFINE) try {
|
647 | return $defineProperty$1(O, P, Attributes);
|
648 | } catch (error) { }
|
649 | if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$b('Accessors not supported');
|
650 | if ('value' in Attributes) O[P] = Attributes.value;
|
651 | return O;
|
652 | };
|
653 |
|
654 | var DESCRIPTORS$d = descriptors;
|
655 | var definePropertyModule$4 = objectDefineProperty;
|
656 | var createPropertyDescriptor$5 = createPropertyDescriptor$7;
|
657 |
|
658 | var createNonEnumerableProperty$9 = DESCRIPTORS$d ? function (object, key, value) {
|
659 | return definePropertyModule$4.f(object, key, createPropertyDescriptor$5(1, value));
|
660 | } : function (object, key, value) {
|
661 | object[key] = value;
|
662 | return object;
|
663 | };
|
664 |
|
665 | var global$h = global$p;
|
666 | var apply$5 = functionApply;
|
667 | var uncurryThis$j = functionUncurryThisClause;
|
668 | var isCallable$f = isCallable$m;
|
669 | var getOwnPropertyDescriptor$6 = objectGetOwnPropertyDescriptor.f;
|
670 | var isForced$1 = isForced_1;
|
671 | var path$m = path$o;
|
672 | var bind$h = functionBindContext;
|
673 | var createNonEnumerableProperty$8 = createNonEnumerableProperty$9;
|
674 | var hasOwn$h = hasOwnProperty_1;
|
675 |
|
676 | var wrapConstructor = function (NativeConstructor) {
|
677 | var Wrapper = function (a, b, c) {
|
678 | if (this instanceof Wrapper) {
|
679 | switch (arguments.length) {
|
680 | case 0: return new NativeConstructor();
|
681 | case 1: return new NativeConstructor(a);
|
682 | case 2: return new NativeConstructor(a, b);
|
683 | } return new NativeConstructor(a, b, c);
|
684 | } return apply$5(NativeConstructor, this, arguments);
|
685 | };
|
686 | Wrapper.prototype = NativeConstructor.prototype;
|
687 | return Wrapper;
|
688 | };
|
689 |
|
690 | |
691 |
|
692 |
|
693 |
|
694 |
|
695 |
|
696 |
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 |
|
703 |
|
704 |
|
705 | var _export = function (options, source) {
|
706 | var TARGET = options.target;
|
707 | var GLOBAL = options.global;
|
708 | var STATIC = options.stat;
|
709 | var PROTO = options.proto;
|
710 |
|
711 | var nativeSource = GLOBAL ? global$h : STATIC ? global$h[TARGET] : (global$h[TARGET] || {}).prototype;
|
712 |
|
713 | var target = GLOBAL ? path$m : path$m[TARGET] || createNonEnumerableProperty$8(path$m, TARGET, {})[TARGET];
|
714 | var targetPrototype = target.prototype;
|
715 |
|
716 | var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE;
|
717 | var key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor;
|
718 |
|
719 | for (key in source) {
|
720 | FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
721 |
|
722 | USE_NATIVE = !FORCED && nativeSource && hasOwn$h(nativeSource, key);
|
723 |
|
724 | targetProperty = target[key];
|
725 |
|
726 | if (USE_NATIVE) if (options.dontCallGetSet) {
|
727 | descriptor = getOwnPropertyDescriptor$6(nativeSource, key);
|
728 | nativeProperty = descriptor && descriptor.value;
|
729 | } else nativeProperty = nativeSource[key];
|
730 |
|
731 |
|
732 | sourceProperty = (USE_NATIVE && nativeProperty) ? nativeProperty : source[key];
|
733 |
|
734 | if (USE_NATIVE && typeof targetProperty == typeof sourceProperty) continue;
|
735 |
|
736 |
|
737 | if (options.bind && USE_NATIVE) resultProperty = bind$h(sourceProperty, global$h);
|
738 |
|
739 | else if (options.wrap && USE_NATIVE) resultProperty = wrapConstructor(sourceProperty);
|
740 |
|
741 | else if (PROTO && isCallable$f(sourceProperty)) resultProperty = uncurryThis$j(sourceProperty);
|
742 |
|
743 | else resultProperty = sourceProperty;
|
744 |
|
745 |
|
746 | if (options.sham || (sourceProperty && sourceProperty.sham) || (targetProperty && targetProperty.sham)) {
|
747 | createNonEnumerableProperty$8(resultProperty, 'sham', true);
|
748 | }
|
749 |
|
750 | createNonEnumerableProperty$8(target, key, resultProperty);
|
751 |
|
752 | if (PROTO) {
|
753 | VIRTUAL_PROTOTYPE = TARGET + 'Prototype';
|
754 | if (!hasOwn$h(path$m, VIRTUAL_PROTOTYPE)) {
|
755 | createNonEnumerableProperty$8(path$m, VIRTUAL_PROTOTYPE, {});
|
756 | }
|
757 |
|
758 | createNonEnumerableProperty$8(path$m[VIRTUAL_PROTOTYPE], key, sourceProperty);
|
759 |
|
760 | if (options.real && targetPrototype && (FORCED || !targetPrototype[key])) {
|
761 | createNonEnumerableProperty$8(targetPrototype, key, sourceProperty);
|
762 | }
|
763 | }
|
764 | }
|
765 | };
|
766 |
|
767 | var $$P = _export;
|
768 | var DESCRIPTORS$c = descriptors;
|
769 | var defineProperty$d = objectDefineProperty.f;
|
770 |
|
771 |
|
772 |
|
773 |
|
774 | $$P({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty$d, sham: !DESCRIPTORS$c }, {
|
775 | defineProperty: defineProperty$d
|
776 | });
|
777 |
|
778 | var path$l = path$o;
|
779 |
|
780 | var Object$4 = path$l.Object;
|
781 |
|
782 | var defineProperty$c = defineProperty$f.exports = function defineProperty(it, key, desc) {
|
783 | return Object$4.defineProperty(it, key, desc);
|
784 | };
|
785 |
|
786 | if (Object$4.defineProperty.sham) defineProperty$c.sham = true;
|
787 |
|
788 | var definePropertyExports = defineProperty$f.exports;
|
789 |
|
790 | var parent$18 = definePropertyExports;
|
791 |
|
792 | var defineProperty$b = parent$18;
|
793 |
|
794 | var parent$17 = defineProperty$b;
|
795 |
|
796 | var defineProperty$a = parent$17;
|
797 |
|
798 | var parent$16 = defineProperty$a;
|
799 |
|
800 | var defineProperty$9 = parent$16;
|
801 |
|
802 | var defineProperty$8 = defineProperty$9;
|
803 |
|
804 | var _Object$defineProperty$1 = getDefaultExportFromCjs(defineProperty$8);
|
805 |
|
806 | var classof$e = classofRaw$2;
|
807 |
|
808 |
|
809 |
|
810 |
|
811 | var isArray$e = Array.isArray || function isArray(argument) {
|
812 | return classof$e(argument) === 'Array';
|
813 | };
|
814 |
|
815 | var ceil = Math.ceil;
|
816 | var floor$1 = Math.floor;
|
817 |
|
818 |
|
819 |
|
820 |
|
821 | var mathTrunc = Math.trunc || function trunc(x) {
|
822 | var n = +x;
|
823 | return (n > 0 ? floor$1 : ceil)(n);
|
824 | };
|
825 |
|
826 | var trunc = mathTrunc;
|
827 |
|
828 |
|
829 |
|
830 | var toIntegerOrInfinity$4 = function (argument) {
|
831 | var number = +argument;
|
832 |
|
833 | return number !== number || number === 0 ? 0 : trunc(number);
|
834 | };
|
835 |
|
836 | var toIntegerOrInfinity$3 = toIntegerOrInfinity$4;
|
837 |
|
838 | var min$2 = Math.min;
|
839 |
|
840 |
|
841 |
|
842 | var toLength$1 = function (argument) {
|
843 | return argument > 0 ? min$2(toIntegerOrInfinity$3(argument), 0x1FFFFFFFFFFFFF) : 0;
|
844 | };
|
845 |
|
846 | var toLength = toLength$1;
|
847 |
|
848 |
|
849 |
|
850 | var lengthOfArrayLike$d = function (obj) {
|
851 | return toLength(obj.length);
|
852 | };
|
853 |
|
854 | var $TypeError$a = TypeError;
|
855 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
856 |
|
857 | var doesNotExceedSafeInteger$4 = function (it) {
|
858 | if (it > MAX_SAFE_INTEGER) throw $TypeError$a('Maximum allowed index exceeded');
|
859 | return it;
|
860 | };
|
861 |
|
862 | var toPropertyKey$1 = toPropertyKey$4;
|
863 | var definePropertyModule$3 = objectDefineProperty;
|
864 | var createPropertyDescriptor$4 = createPropertyDescriptor$7;
|
865 |
|
866 | var createProperty$6 = function (object, key, value) {
|
867 | var propertyKey = toPropertyKey$1(key);
|
868 | if (propertyKey in object) definePropertyModule$3.f(object, propertyKey, createPropertyDescriptor$4(0, value));
|
869 | else object[propertyKey] = value;
|
870 | };
|
871 |
|
872 | var wellKnownSymbol$l = wellKnownSymbol$n;
|
873 |
|
874 | var TO_STRING_TAG$4 = wellKnownSymbol$l('toStringTag');
|
875 | var test$2 = {};
|
876 |
|
877 | test$2[TO_STRING_TAG$4] = 'z';
|
878 |
|
879 | var toStringTagSupport = String(test$2) === '[object z]';
|
880 |
|
881 | var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
|
882 | var isCallable$e = isCallable$m;
|
883 | var classofRaw = classofRaw$2;
|
884 | var wellKnownSymbol$k = wellKnownSymbol$n;
|
885 |
|
886 | var TO_STRING_TAG$3 = wellKnownSymbol$k('toStringTag');
|
887 | var $Object$1 = Object;
|
888 |
|
889 |
|
890 | var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
|
891 |
|
892 |
|
893 | var tryGet = function (it, key) {
|
894 | try {
|
895 | return it[key];
|
896 | } catch (error) { }
|
897 | };
|
898 |
|
899 |
|
900 | var classof$d = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function (it) {
|
901 | var O, tag, result;
|
902 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
903 |
|
904 | : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$3)) == 'string' ? tag
|
905 |
|
906 | : CORRECT_ARGUMENTS ? classofRaw(O)
|
907 |
|
908 | : (result = classofRaw(O)) === 'Object' && isCallable$e(O.callee) ? 'Arguments' : result;
|
909 | };
|
910 |
|
911 | var uncurryThis$i = functionUncurryThis;
|
912 | var isCallable$d = isCallable$m;
|
913 | var store$1 = sharedStore;
|
914 |
|
915 | var functionToString = uncurryThis$i(Function.toString);
|
916 |
|
917 |
|
918 | if (!isCallable$d(store$1.inspectSource)) {
|
919 | store$1.inspectSource = function (it) {
|
920 | return functionToString(it);
|
921 | };
|
922 | }
|
923 |
|
924 | var inspectSource$2 = store$1.inspectSource;
|
925 |
|
926 | var uncurryThis$h = functionUncurryThis;
|
927 | var fails$m = fails$u;
|
928 | var isCallable$c = isCallable$m;
|
929 | var classof$c = classof$d;
|
930 | var getBuiltIn$d = getBuiltIn$f;
|
931 | var inspectSource$1 = inspectSource$2;
|
932 |
|
933 | var noop = function () { };
|
934 | var empty = [];
|
935 | var construct$4 = getBuiltIn$d('Reflect', 'construct');
|
936 | var constructorRegExp = /^\s*(?:class|function)\b/;
|
937 | var exec$1 = uncurryThis$h(constructorRegExp.exec);
|
938 | var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
|
939 |
|
940 | var isConstructorModern = function isConstructor(argument) {
|
941 | if (!isCallable$c(argument)) return false;
|
942 | try {
|
943 | construct$4(noop, empty, argument);
|
944 | return true;
|
945 | } catch (error) {
|
946 | return false;
|
947 | }
|
948 | };
|
949 |
|
950 | var isConstructorLegacy = function isConstructor(argument) {
|
951 | if (!isCallable$c(argument)) return false;
|
952 | switch (classof$c(argument)) {
|
953 | case 'AsyncFunction':
|
954 | case 'GeneratorFunction':
|
955 | case 'AsyncGeneratorFunction': return false;
|
956 | }
|
957 | try {
|
958 |
|
959 |
|
960 |
|
961 | return INCORRECT_TO_STRING || !!exec$1(constructorRegExp, inspectSource$1(argument));
|
962 | } catch (error) {
|
963 | return true;
|
964 | }
|
965 | };
|
966 |
|
967 | isConstructorLegacy.sham = true;
|
968 |
|
969 |
|
970 |
|
971 | var isConstructor$4 = !construct$4 || fails$m(function () {
|
972 | var called;
|
973 | return isConstructorModern(isConstructorModern.call)
|
974 | || !isConstructorModern(Object)
|
975 | || !isConstructorModern(function () { called = true; })
|
976 | || called;
|
977 | }) ? isConstructorLegacy : isConstructorModern;
|
978 |
|
979 | var isArray$d = isArray$e;
|
980 | var isConstructor$3 = isConstructor$4;
|
981 | var isObject$c = isObject$h;
|
982 | var wellKnownSymbol$j = wellKnownSymbol$n;
|
983 |
|
984 | var SPECIES$5 = wellKnownSymbol$j('species');
|
985 | var $Array$3 = Array;
|
986 |
|
987 |
|
988 |
|
989 | var arraySpeciesConstructor$1 = function (originalArray) {
|
990 | var C;
|
991 | if (isArray$d(originalArray)) {
|
992 | C = originalArray.constructor;
|
993 |
|
994 | if (isConstructor$3(C) && (C === $Array$3 || isArray$d(C.prototype))) C = undefined;
|
995 | else if (isObject$c(C)) {
|
996 | C = C[SPECIES$5];
|
997 | if (C === null) C = undefined;
|
998 | }
|
999 | } return C === undefined ? $Array$3 : C;
|
1000 | };
|
1001 |
|
1002 | var arraySpeciesConstructor = arraySpeciesConstructor$1;
|
1003 |
|
1004 |
|
1005 |
|
1006 | var arraySpeciesCreate$4 = function (originalArray, length) {
|
1007 | return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
|
1008 | };
|
1009 |
|
1010 | var fails$l = fails$u;
|
1011 | var wellKnownSymbol$i = wellKnownSymbol$n;
|
1012 | var V8_VERSION$2 = engineV8Version;
|
1013 |
|
1014 | var SPECIES$4 = wellKnownSymbol$i('species');
|
1015 |
|
1016 | var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) {
|
1017 |
|
1018 |
|
1019 |
|
1020 | return V8_VERSION$2 >= 51 || !fails$l(function () {
|
1021 | var array = [];
|
1022 | var constructor = array.constructor = {};
|
1023 | constructor[SPECIES$4] = function () {
|
1024 | return { foo: 1 };
|
1025 | };
|
1026 | return array[METHOD_NAME](Boolean).foo !== 1;
|
1027 | });
|
1028 | };
|
1029 |
|
1030 | var $$O = _export;
|
1031 | var fails$k = fails$u;
|
1032 | var isArray$c = isArray$e;
|
1033 | var isObject$b = isObject$h;
|
1034 | var toObject$c = toObject$e;
|
1035 | var lengthOfArrayLike$c = lengthOfArrayLike$d;
|
1036 | var doesNotExceedSafeInteger$3 = doesNotExceedSafeInteger$4;
|
1037 | var createProperty$5 = createProperty$6;
|
1038 | var arraySpeciesCreate$3 = arraySpeciesCreate$4;
|
1039 | var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5;
|
1040 | var wellKnownSymbol$h = wellKnownSymbol$n;
|
1041 | var V8_VERSION$1 = engineV8Version;
|
1042 |
|
1043 | var IS_CONCAT_SPREADABLE = wellKnownSymbol$h('isConcatSpreadable');
|
1044 |
|
1045 |
|
1046 |
|
1047 |
|
1048 | var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION$1 >= 51 || !fails$k(function () {
|
1049 | var array = [];
|
1050 | array[IS_CONCAT_SPREADABLE] = false;
|
1051 | return array.concat()[0] !== array;
|
1052 | });
|
1053 |
|
1054 | var isConcatSpreadable = function (O) {
|
1055 | if (!isObject$b(O)) return false;
|
1056 | var spreadable = O[IS_CONCAT_SPREADABLE];
|
1057 | return spreadable !== undefined ? !!spreadable : isArray$c(O);
|
1058 | };
|
1059 |
|
1060 | var FORCED$6 = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport$4('concat');
|
1061 |
|
1062 |
|
1063 |
|
1064 |
|
1065 | $$O({ target: 'Array', proto: true, arity: 1, forced: FORCED$6 }, {
|
1066 |
|
1067 | concat: function concat(arg) {
|
1068 | var O = toObject$c(this);
|
1069 | var A = arraySpeciesCreate$3(O, 0);
|
1070 | var n = 0;
|
1071 | var i, k, length, len, E;
|
1072 | for (i = -1, length = arguments.length; i < length; i++) {
|
1073 | E = i === -1 ? O : arguments[i];
|
1074 | if (isConcatSpreadable(E)) {
|
1075 | len = lengthOfArrayLike$c(E);
|
1076 | doesNotExceedSafeInteger$3(n + len);
|
1077 | for (k = 0; k < len; k++, n++) if (k in E) createProperty$5(A, n, E[k]);
|
1078 | } else {
|
1079 | doesNotExceedSafeInteger$3(n + 1);
|
1080 | createProperty$5(A, n++, E);
|
1081 | }
|
1082 | }
|
1083 | A.length = n;
|
1084 | return A;
|
1085 | }
|
1086 | });
|
1087 |
|
1088 | var classof$b = classof$d;
|
1089 |
|
1090 | var $String$2 = String;
|
1091 |
|
1092 | var toString$7 = function (argument) {
|
1093 | if (classof$b(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
1094 | return $String$2(argument);
|
1095 | };
|
1096 |
|
1097 | var objectDefineProperties = {};
|
1098 |
|
1099 | var toIntegerOrInfinity$2 = toIntegerOrInfinity$4;
|
1100 |
|
1101 | var max$3 = Math.max;
|
1102 | var min$1 = Math.min;
|
1103 |
|
1104 |
|
1105 |
|
1106 |
|
1107 | var toAbsoluteIndex$4 = function (index, length) {
|
1108 | var integer = toIntegerOrInfinity$2(index);
|
1109 | return integer < 0 ? max$3(integer + length, 0) : min$1(integer, length);
|
1110 | };
|
1111 |
|
1112 | var toIndexedObject$8 = toIndexedObject$a;
|
1113 | var toAbsoluteIndex$3 = toAbsoluteIndex$4;
|
1114 | var lengthOfArrayLike$b = lengthOfArrayLike$d;
|
1115 |
|
1116 |
|
1117 | var createMethod$3 = function (IS_INCLUDES) {
|
1118 | return function ($this, el, fromIndex) {
|
1119 | var O = toIndexedObject$8($this);
|
1120 | var length = lengthOfArrayLike$b(O);
|
1121 | var index = toAbsoluteIndex$3(fromIndex, length);
|
1122 | var value;
|
1123 |
|
1124 |
|
1125 | if (IS_INCLUDES && el !== el) while (length > index) {
|
1126 | value = O[index++];
|
1127 |
|
1128 | if (value !== value) return true;
|
1129 |
|
1130 | } else for (;length > index; index++) {
|
1131 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
1132 | } return !IS_INCLUDES && -1;
|
1133 | };
|
1134 | };
|
1135 |
|
1136 | var arrayIncludes = {
|
1137 |
|
1138 |
|
1139 | includes: createMethod$3(true),
|
1140 |
|
1141 |
|
1142 | indexOf: createMethod$3(false)
|
1143 | };
|
1144 |
|
1145 | var hiddenKeys$6 = {};
|
1146 |
|
1147 | var uncurryThis$g = functionUncurryThis;
|
1148 | var hasOwn$g = hasOwnProperty_1;
|
1149 | var toIndexedObject$7 = toIndexedObject$a;
|
1150 | var indexOf = arrayIncludes.indexOf;
|
1151 | var hiddenKeys$5 = hiddenKeys$6;
|
1152 |
|
1153 | var push$c = uncurryThis$g([].push);
|
1154 |
|
1155 | var objectKeysInternal = function (object, names) {
|
1156 | var O = toIndexedObject$7(object);
|
1157 | var i = 0;
|
1158 | var result = [];
|
1159 | var key;
|
1160 | for (key in O) !hasOwn$g(hiddenKeys$5, key) && hasOwn$g(O, key) && push$c(result, key);
|
1161 |
|
1162 | while (names.length > i) if (hasOwn$g(O, key = names[i++])) {
|
1163 | ~indexOf(result, key) || push$c(result, key);
|
1164 | }
|
1165 | return result;
|
1166 | };
|
1167 |
|
1168 |
|
1169 | var enumBugKeys$3 = [
|
1170 | 'constructor',
|
1171 | 'hasOwnProperty',
|
1172 | 'isPrototypeOf',
|
1173 | 'propertyIsEnumerable',
|
1174 | 'toLocaleString',
|
1175 | 'toString',
|
1176 | 'valueOf'
|
1177 | ];
|
1178 |
|
1179 | var internalObjectKeys$1 = objectKeysInternal;
|
1180 | var enumBugKeys$2 = enumBugKeys$3;
|
1181 |
|
1182 |
|
1183 |
|
1184 |
|
1185 | var objectKeys$3 = Object.keys || function keys(O) {
|
1186 | return internalObjectKeys$1(O, enumBugKeys$2);
|
1187 | };
|
1188 |
|
1189 | var DESCRIPTORS$b = descriptors;
|
1190 | var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
|
1191 | var definePropertyModule$2 = objectDefineProperty;
|
1192 | var anObject$b = anObject$d;
|
1193 | var toIndexedObject$6 = toIndexedObject$a;
|
1194 | var objectKeys$2 = objectKeys$3;
|
1195 |
|
1196 |
|
1197 |
|
1198 |
|
1199 | objectDefineProperties.f = DESCRIPTORS$b && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
1200 | anObject$b(O);
|
1201 | var props = toIndexedObject$6(Properties);
|
1202 | var keys = objectKeys$2(Properties);
|
1203 | var length = keys.length;
|
1204 | var index = 0;
|
1205 | var key;
|
1206 | while (length > index) definePropertyModule$2.f(O, key = keys[index++], props[key]);
|
1207 | return O;
|
1208 | };
|
1209 |
|
1210 | var getBuiltIn$c = getBuiltIn$f;
|
1211 |
|
1212 | var html$2 = getBuiltIn$c('document', 'documentElement');
|
1213 |
|
1214 | var shared$5 = sharedExports;
|
1215 | var uid$2 = uid$4;
|
1216 |
|
1217 | var keys$7 = shared$5('keys');
|
1218 |
|
1219 | var sharedKey$4 = function (key) {
|
1220 | return keys$7[key] || (keys$7[key] = uid$2(key));
|
1221 | };
|
1222 |
|
1223 |
|
1224 | var anObject$a = anObject$d;
|
1225 | var definePropertiesModule$1 = objectDefineProperties;
|
1226 | var enumBugKeys$1 = enumBugKeys$3;
|
1227 | var hiddenKeys$4 = hiddenKeys$6;
|
1228 | var html$1 = html$2;
|
1229 | var documentCreateElement = documentCreateElement$1;
|
1230 | var sharedKey$3 = sharedKey$4;
|
1231 |
|
1232 | var GT = '>';
|
1233 | var LT = '<';
|
1234 | var PROTOTYPE$1 = 'prototype';
|
1235 | var SCRIPT = 'script';
|
1236 | var IE_PROTO$1 = sharedKey$3('IE_PROTO');
|
1237 |
|
1238 | var EmptyConstructor = function () { };
|
1239 |
|
1240 | var scriptTag = function (content) {
|
1241 | return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
1242 | };
|
1243 |
|
1244 |
|
1245 | var NullProtoObjectViaActiveX = function (activeXDocument) {
|
1246 | activeXDocument.write(scriptTag(''));
|
1247 | activeXDocument.close();
|
1248 | var temp = activeXDocument.parentWindow.Object;
|
1249 | activeXDocument = null;
|
1250 | return temp;
|
1251 | };
|
1252 |
|
1253 |
|
1254 | var NullProtoObjectViaIFrame = function () {
|
1255 |
|
1256 | var iframe = documentCreateElement('iframe');
|
1257 | var JS = 'java' + SCRIPT + ':';
|
1258 | var iframeDocument;
|
1259 | iframe.style.display = 'none';
|
1260 | html$1.appendChild(iframe);
|
1261 |
|
1262 | iframe.src = String(JS);
|
1263 | iframeDocument = iframe.contentWindow.document;
|
1264 | iframeDocument.open();
|
1265 | iframeDocument.write(scriptTag('document.F=Object'));
|
1266 | iframeDocument.close();
|
1267 | return iframeDocument.F;
|
1268 | };
|
1269 |
|
1270 |
|
1271 |
|
1272 |
|
1273 |
|
1274 |
|
1275 | var activeXDocument;
|
1276 | var NullProtoObject = function () {
|
1277 | try {
|
1278 | activeXDocument = new ActiveXObject('htmlfile');
|
1279 | } catch (error) { }
|
1280 | NullProtoObject = typeof document != 'undefined'
|
1281 | ? document.domain && activeXDocument
|
1282 | ? NullProtoObjectViaActiveX(activeXDocument)
|
1283 | : NullProtoObjectViaIFrame()
|
1284 | : NullProtoObjectViaActiveX(activeXDocument);
|
1285 | var length = enumBugKeys$1.length;
|
1286 | while (length--) delete NullProtoObject[PROTOTYPE$1][enumBugKeys$1[length]];
|
1287 | return NullProtoObject();
|
1288 | };
|
1289 |
|
1290 | hiddenKeys$4[IE_PROTO$1] = true;
|
1291 |
|
1292 |
|
1293 |
|
1294 |
|
1295 | var objectCreate = Object.create || function create(O, Properties) {
|
1296 | var result;
|
1297 | if (O !== null) {
|
1298 | EmptyConstructor[PROTOTYPE$1] = anObject$a(O);
|
1299 | result = new EmptyConstructor();
|
1300 | EmptyConstructor[PROTOTYPE$1] = null;
|
1301 |
|
1302 | result[IE_PROTO$1] = O;
|
1303 | } else result = NullProtoObject();
|
1304 | return Properties === undefined ? result : definePropertiesModule$1.f(result, Properties);
|
1305 | };
|
1306 |
|
1307 | var objectGetOwnPropertyNames = {};
|
1308 |
|
1309 | var internalObjectKeys = objectKeysInternal;
|
1310 | var enumBugKeys = enumBugKeys$3;
|
1311 |
|
1312 | var hiddenKeys$3 = enumBugKeys.concat('length', 'prototype');
|
1313 |
|
1314 |
|
1315 |
|
1316 |
|
1317 | objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
1318 | return internalObjectKeys(O, hiddenKeys$3);
|
1319 | };
|
1320 |
|
1321 | var objectGetOwnPropertyNamesExternal = {};
|
1322 |
|
1323 | var toAbsoluteIndex$2 = toAbsoluteIndex$4;
|
1324 | var lengthOfArrayLike$a = lengthOfArrayLike$d;
|
1325 | var createProperty$4 = createProperty$6;
|
1326 |
|
1327 | var $Array$2 = Array;
|
1328 | var max$2 = Math.max;
|
1329 |
|
1330 | var arraySliceSimple = function (O, start, end) {
|
1331 | var length = lengthOfArrayLike$a(O);
|
1332 | var k = toAbsoluteIndex$2(start, length);
|
1333 | var fin = toAbsoluteIndex$2(end === undefined ? length : end, length);
|
1334 | var result = $Array$2(max$2(fin - k, 0));
|
1335 | var n = 0;
|
1336 | for (; k < fin; k++, n++) createProperty$4(result, n, O[k]);
|
1337 | result.length = n;
|
1338 | return result;
|
1339 | };
|
1340 |
|
1341 |
|
1342 | var classof$a = classofRaw$2;
|
1343 | var toIndexedObject$5 = toIndexedObject$a;
|
1344 | var $getOwnPropertyNames$1 = objectGetOwnPropertyNames.f;
|
1345 | var arraySlice$6 = arraySliceSimple;
|
1346 |
|
1347 | var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
|
1348 | ? Object.getOwnPropertyNames(window) : [];
|
1349 |
|
1350 | var getWindowNames = function (it) {
|
1351 | try {
|
1352 | return $getOwnPropertyNames$1(it);
|
1353 | } catch (error) {
|
1354 | return arraySlice$6(windowNames);
|
1355 | }
|
1356 | };
|
1357 |
|
1358 |
|
1359 | objectGetOwnPropertyNamesExternal.f = function getOwnPropertyNames(it) {
|
1360 | return windowNames && classof$a(it) === 'Window'
|
1361 | ? getWindowNames(it)
|
1362 | : $getOwnPropertyNames$1(toIndexedObject$5(it));
|
1363 | };
|
1364 |
|
1365 | var objectGetOwnPropertySymbols = {};
|
1366 |
|
1367 |
|
1368 | objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
|
1369 |
|
1370 | var createNonEnumerableProperty$7 = createNonEnumerableProperty$9;
|
1371 |
|
1372 | var defineBuiltIn$6 = function (target, key, value, options) {
|
1373 | if (options && options.enumerable) target[key] = value;
|
1374 | else createNonEnumerableProperty$7(target, key, value);
|
1375 | return target;
|
1376 | };
|
1377 |
|
1378 | var defineProperty$7 = objectDefineProperty;
|
1379 |
|
1380 | var defineBuiltInAccessor$3 = function (target, name, descriptor) {
|
1381 | return defineProperty$7.f(target, name, descriptor);
|
1382 | };
|
1383 |
|
1384 | var wellKnownSymbolWrapped = {};
|
1385 |
|
1386 | var wellKnownSymbol$g = wellKnownSymbol$n;
|
1387 |
|
1388 | wellKnownSymbolWrapped.f = wellKnownSymbol$g;
|
1389 |
|
1390 | var path$k = path$o;
|
1391 | var hasOwn$f = hasOwnProperty_1;
|
1392 | var wrappedWellKnownSymbolModule$1 = wellKnownSymbolWrapped;
|
1393 | var defineProperty$6 = objectDefineProperty.f;
|
1394 |
|
1395 | var wellKnownSymbolDefine = function (NAME) {
|
1396 | var Symbol = path$k.Symbol || (path$k.Symbol = {});
|
1397 | if (!hasOwn$f(Symbol, NAME)) defineProperty$6(Symbol, NAME, {
|
1398 | value: wrappedWellKnownSymbolModule$1.f(NAME)
|
1399 | });
|
1400 | };
|
1401 |
|
1402 | var call$e = functionCall;
|
1403 | var getBuiltIn$b = getBuiltIn$f;
|
1404 | var wellKnownSymbol$f = wellKnownSymbol$n;
|
1405 | var defineBuiltIn$5 = defineBuiltIn$6;
|
1406 |
|
1407 | var symbolDefineToPrimitive = function () {
|
1408 | var Symbol = getBuiltIn$b('Symbol');
|
1409 | var SymbolPrototype = Symbol && Symbol.prototype;
|
1410 | var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
|
1411 | var TO_PRIMITIVE = wellKnownSymbol$f('toPrimitive');
|
1412 |
|
1413 | if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
|
1414 |
|
1415 |
|
1416 |
|
1417 | defineBuiltIn$5(SymbolPrototype, TO_PRIMITIVE, function (hint) {
|
1418 | return call$e(valueOf, this);
|
1419 | }, { arity: 1 });
|
1420 | }
|
1421 | };
|
1422 |
|
1423 | var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
|
1424 | var classof$9 = classof$d;
|
1425 |
|
1426 |
|
1427 |
|
1428 | var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() {
|
1429 | return '[object ' + classof$9(this) + ']';
|
1430 | };
|
1431 |
|
1432 | var TO_STRING_TAG_SUPPORT = toStringTagSupport;
|
1433 | var defineProperty$5 = objectDefineProperty.f;
|
1434 | var createNonEnumerableProperty$6 = createNonEnumerableProperty$9;
|
1435 | var hasOwn$e = hasOwnProperty_1;
|
1436 | var toString$6 = objectToString;
|
1437 | var wellKnownSymbol$e = wellKnownSymbol$n;
|
1438 |
|
1439 | var TO_STRING_TAG$2 = wellKnownSymbol$e('toStringTag');
|
1440 |
|
1441 | var setToStringTag$7 = function (it, TAG, STATIC, SET_METHOD) {
|
1442 | if (it) {
|
1443 | var target = STATIC ? it : it.prototype;
|
1444 | if (!hasOwn$e(target, TO_STRING_TAG$2)) {
|
1445 | defineProperty$5(target, TO_STRING_TAG$2, { configurable: true, value: TAG });
|
1446 | }
|
1447 | if (SET_METHOD && !TO_STRING_TAG_SUPPORT) {
|
1448 | createNonEnumerableProperty$6(target, 'toString', toString$6);
|
1449 | }
|
1450 | }
|
1451 | };
|
1452 |
|
1453 | var global$g = global$p;
|
1454 | var isCallable$b = isCallable$m;
|
1455 |
|
1456 | var WeakMap$1 = global$g.WeakMap;
|
1457 |
|
1458 | var weakMapBasicDetection = isCallable$b(WeakMap$1) && /native code/.test(String(WeakMap$1));
|
1459 |
|
1460 | var NATIVE_WEAK_MAP = weakMapBasicDetection;
|
1461 | var global$f = global$p;
|
1462 | var isObject$a = isObject$h;
|
1463 | var createNonEnumerableProperty$5 = createNonEnumerableProperty$9;
|
1464 | var hasOwn$d = hasOwnProperty_1;
|
1465 | var shared$4 = sharedStore;
|
1466 | var sharedKey$2 = sharedKey$4;
|
1467 | var hiddenKeys$2 = hiddenKeys$6;
|
1468 |
|
1469 | var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
1470 | var TypeError$3 = global$f.TypeError;
|
1471 | var WeakMap = global$f.WeakMap;
|
1472 | var set$4, get, has;
|
1473 |
|
1474 | var enforce = function (it) {
|
1475 | return has(it) ? get(it) : set$4(it, {});
|
1476 | };
|
1477 |
|
1478 | var getterFor = function (TYPE) {
|
1479 | return function (it) {
|
1480 | var state;
|
1481 | if (!isObject$a(it) || (state = get(it)).type !== TYPE) {
|
1482 | throw new TypeError$3('Incompatible receiver, ' + TYPE + ' required');
|
1483 | } return state;
|
1484 | };
|
1485 | };
|
1486 |
|
1487 | if (NATIVE_WEAK_MAP || shared$4.state) {
|
1488 | var store = shared$4.state || (shared$4.state = new WeakMap());
|
1489 |
|
1490 | store.get = store.get;
|
1491 | store.has = store.has;
|
1492 | store.set = store.set;
|
1493 |
|
1494 | set$4 = function (it, metadata) {
|
1495 | if (store.has(it)) throw new TypeError$3(OBJECT_ALREADY_INITIALIZED);
|
1496 | metadata.facade = it;
|
1497 | store.set(it, metadata);
|
1498 | return metadata;
|
1499 | };
|
1500 | get = function (it) {
|
1501 | return store.get(it) || {};
|
1502 | };
|
1503 | has = function (it) {
|
1504 | return store.has(it);
|
1505 | };
|
1506 | } else {
|
1507 | var STATE = sharedKey$2('state');
|
1508 | hiddenKeys$2[STATE] = true;
|
1509 | set$4 = function (it, metadata) {
|
1510 | if (hasOwn$d(it, STATE)) throw new TypeError$3(OBJECT_ALREADY_INITIALIZED);
|
1511 | metadata.facade = it;
|
1512 | createNonEnumerableProperty$5(it, STATE, metadata);
|
1513 | return metadata;
|
1514 | };
|
1515 | get = function (it) {
|
1516 | return hasOwn$d(it, STATE) ? it[STATE] : {};
|
1517 | };
|
1518 | has = function (it) {
|
1519 | return hasOwn$d(it, STATE);
|
1520 | };
|
1521 | }
|
1522 |
|
1523 | var internalState = {
|
1524 | set: set$4,
|
1525 | get: get,
|
1526 | has: has,
|
1527 | enforce: enforce,
|
1528 | getterFor: getterFor
|
1529 | };
|
1530 |
|
1531 | var bind$g = functionBindContext;
|
1532 | var uncurryThis$f = functionUncurryThis;
|
1533 | var IndexedObject$2 = indexedObject;
|
1534 | var toObject$b = toObject$e;
|
1535 | var lengthOfArrayLike$9 = lengthOfArrayLike$d;
|
1536 | var arraySpeciesCreate$2 = arraySpeciesCreate$4;
|
1537 |
|
1538 | var push$b = uncurryThis$f([].push);
|
1539 |
|
1540 | // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
|
1541 | var createMethod$2 = function (TYPE) {
|
1542 | var IS_MAP = TYPE === 1;
|
1543 | var IS_FILTER = TYPE === 2;
|
1544 | var IS_SOME = TYPE === 3;
|
1545 | var IS_EVERY = TYPE === 4;
|
1546 | var IS_FIND_INDEX = TYPE === 6;
|
1547 | var IS_FILTER_REJECT = TYPE === 7;
|
1548 | var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
|
1549 | return function ($this, callbackfn, that, specificCreate) {
|
1550 | var O = toObject$b($this);
|
1551 | var self = IndexedObject$2(O);
|
1552 | var boundFunction = bind$g(callbackfn, that);
|
1553 | var length = lengthOfArrayLike$9(self);
|
1554 | var index = 0;
|
1555 | var create = specificCreate || arraySpeciesCreate$2;
|
1556 | var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
|
1557 | var value, result;
|
1558 | for (;length > index; index++) if (NO_HOLES || index in self) {
|
1559 | value = self[index];
|
1560 | result = boundFunction(value, index, O);
|
1561 | if (TYPE) {
|
1562 | if (IS_MAP) target[index] = result; // map
|
1563 | else if (result) switch (TYPE) {
|
1564 | case 3: return true; // some
|
1565 | case 5: return value; // find
|
1566 | case 6: return index; // findIndex
|
1567 | case 2: push$b(target, value); // filter
|
1568 | } else switch (TYPE) {
|
1569 | case 4: return false; // every
|
1570 | case 7: push$b(target, value); // filterReject
|
1571 | }
|
1572 | }
|
1573 | }
|
1574 | return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
|
1575 | };
|
1576 | };
|
1577 |
|
1578 | var arrayIteration = {
|
1579 | // `Array.prototype.forEach` method
|
1580 | // https://tc39.es/ecma262/#sec-array.prototype.foreach
|
1581 | forEach: createMethod$2(0),
|
1582 | // `Array.prototype.map` method
|
1583 | // https://tc39.es/ecma262/#sec-array.prototype.map
|
1584 | map: createMethod$2(1),
|
1585 | // `Array.prototype.filter` method
|
1586 | // https://tc39.es/ecma262/#sec-array.prototype.filter
|
1587 | filter: createMethod$2(2),
|
1588 | // `Array.prototype.some` method
|
1589 | // https://tc39.es/ecma262/#sec-array.prototype.some
|
1590 | some: createMethod$2(3),
|
1591 | // `Array.prototype.every` method
|
1592 | // https://tc39.es/ecma262/#sec-array.prototype.every
|
1593 | every: createMethod$2(4),
|
1594 | // `Array.prototype.find` method
|
1595 | // https://tc39.es/ecma262/#sec-array.prototype.find
|
1596 | find: createMethod$2(5),
|
1597 | // `Array.prototype.findIndex` method
|
1598 | // https://tc39.es/ecma262/#sec-array.prototype.findIndex
|
1599 | findIndex: createMethod$2(6),
|
1600 | // `Array.prototype.filterReject` method
|
1601 | // https://github.com/tc39/proposal-array-filtering
|
1602 | filterReject: createMethod$2(7)
|
1603 | };
|
1604 |
|
1605 | var $$N = _export;
|
1606 | var global$e = global$p;
|
1607 | var call$d = functionCall;
|
1608 | var uncurryThis$e = functionUncurryThis;
|
1609 | var DESCRIPTORS$a = descriptors;
|
1610 | var NATIVE_SYMBOL$3 = symbolConstructorDetection;
|
1611 | var fails$j = fails$u;
|
1612 | var hasOwn$c = hasOwnProperty_1;
|
1613 | var isPrototypeOf$j = objectIsPrototypeOf;
|
1614 | var anObject$9 = anObject$d;
|
1615 | var toIndexedObject$4 = toIndexedObject$a;
|
1616 | var toPropertyKey = toPropertyKey$4;
|
1617 | var $toString = toString$7;
|
1618 | var createPropertyDescriptor$3 = createPropertyDescriptor$7;
|
1619 | var nativeObjectCreate = objectCreate;
|
1620 | var objectKeys$1 = objectKeys$3;
|
1621 | var getOwnPropertyNamesModule$2 = objectGetOwnPropertyNames;
|
1622 | var getOwnPropertyNamesExternal = objectGetOwnPropertyNamesExternal;
|
1623 | var getOwnPropertySymbolsModule$3 = objectGetOwnPropertySymbols;
|
1624 | var getOwnPropertyDescriptorModule$2 = objectGetOwnPropertyDescriptor;
|
1625 | var definePropertyModule$1 = objectDefineProperty;
|
1626 | var definePropertiesModule = objectDefineProperties;
|
1627 | var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
|
1628 | var defineBuiltIn$4 = defineBuiltIn$6;
|
1629 | var defineBuiltInAccessor$2 = defineBuiltInAccessor$3;
|
1630 | var shared$3 = sharedExports;
|
1631 | var sharedKey$1 = sharedKey$4;
|
1632 | var hiddenKeys$1 = hiddenKeys$6;
|
1633 | var uid$1 = uid$4;
|
1634 | var wellKnownSymbol$d = wellKnownSymbol$n;
|
1635 | var wrappedWellKnownSymbolModule = wellKnownSymbolWrapped;
|
1636 | var defineWellKnownSymbol$l = wellKnownSymbolDefine;
|
1637 | var defineSymbolToPrimitive$1 = symbolDefineToPrimitive;
|
1638 | var setToStringTag$6 = setToStringTag$7;
|
1639 | var InternalStateModule$5 = internalState;
|
1640 | var $forEach$1 = arrayIteration.forEach;
|
1641 |
|
1642 | var HIDDEN = sharedKey$1('hidden');
|
1643 | var SYMBOL = 'Symbol';
|
1644 | var PROTOTYPE = 'prototype';
|
1645 |
|
1646 | var setInternalState$5 = InternalStateModule$5.set;
|
1647 | var getInternalState$2 = InternalStateModule$5.getterFor(SYMBOL);
|
1648 |
|
1649 | var ObjectPrototype$2 = Object[PROTOTYPE];
|
1650 | var $Symbol = global$e.Symbol;
|
1651 | var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
|
1652 | var RangeError = global$e.RangeError;
|
1653 | var TypeError$2 = global$e.TypeError;
|
1654 | var QObject = global$e.QObject;
|
1655 | var nativeGetOwnPropertyDescriptor$1 = getOwnPropertyDescriptorModule$2.f;
|
1656 | var nativeDefineProperty = definePropertyModule$1.f;
|
1657 | var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
|
1658 | var nativePropertyIsEnumerable = propertyIsEnumerableModule$1.f;
|
1659 | var push$a = uncurryThis$e([].push);
|
1660 |
|
1661 | var AllSymbols = shared$3('symbols');
|
1662 | var ObjectPrototypeSymbols = shared$3('op-symbols');
|
1663 | var WellKnownSymbolsStore$1 = shared$3('wks');
|
1664 |
|
1665 | // Don't use setters in Qt Script, https://github.com/zloirock/core-js/issues/173
|
1666 | var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
|
1667 |
|
1668 | // fallback for old Android, https://code.google.com/p/v8/issues/detail?id=687
|
1669 | var fallbackDefineProperty = function (O, P, Attributes) {
|
1670 | var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor$1(ObjectPrototype$2, P);
|
1671 | if (ObjectPrototypeDescriptor) delete ObjectPrototype$2[P];
|
1672 | nativeDefineProperty(O, P, Attributes);
|
1673 | if (ObjectPrototypeDescriptor && O !== ObjectPrototype$2) {
|
1674 | nativeDefineProperty(ObjectPrototype$2, P, ObjectPrototypeDescriptor);
|
1675 | }
|
1676 | };
|
1677 |
|
1678 | var setSymbolDescriptor = DESCRIPTORS$a && fails$j(function () {
|
1679 | return nativeObjectCreate(nativeDefineProperty({}, 'a', {
|
1680 | get: function () { return nativeDefineProperty(this, 'a', { value: 7 }).a; }
|
1681 | })).a !== 7;
|
1682 | }) ? fallbackDefineProperty : nativeDefineProperty;
|
1683 |
|
1684 | var wrap = function (tag, description) {
|
1685 | var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
|
1686 | setInternalState$5(symbol, {
|
1687 | type: SYMBOL,
|
1688 | tag: tag,
|
1689 | description: description
|
1690 | });
|
1691 | if (!DESCRIPTORS$a) symbol.description = description;
|
1692 | return symbol;
|
1693 | };
|
1694 |
|
1695 | var $defineProperty = function defineProperty(O, P, Attributes) {
|
1696 | if (O === ObjectPrototype$2) $defineProperty(ObjectPrototypeSymbols, P, Attributes);
|
1697 | anObject$9(O);
|
1698 | var key = toPropertyKey(P);
|
1699 | anObject$9(Attributes);
|
1700 | if (hasOwn$c(AllSymbols, key)) {
|
1701 | if (!Attributes.enumerable) {
|
1702 | if (!hasOwn$c(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor$3(1, {}));
|
1703 | O[HIDDEN][key] = true;
|
1704 | } else {
|
1705 | if (hasOwn$c(O, HIDDEN) && O[HIDDEN][key]) O[HIDDEN][key] = false;
|
1706 | Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor$3(0, false) });
|
1707 | } return setSymbolDescriptor(O, key, Attributes);
|
1708 | } return nativeDefineProperty(O, key, Attributes);
|
1709 | };
|
1710 |
|
1711 | var $defineProperties = function defineProperties(O, Properties) {
|
1712 | anObject$9(O);
|
1713 | var properties = toIndexedObject$4(Properties);
|
1714 | var keys = objectKeys$1(properties).concat($getOwnPropertySymbols(properties));
|
1715 | $forEach$1(keys, function (key) {
|
1716 | if (!DESCRIPTORS$a || call$d($propertyIsEnumerable, properties, key)) $defineProperty(O, key, properties[key]);
|
1717 | });
|
1718 | return O;
|
1719 | };
|
1720 |
|
1721 | var $create = function create(O, Properties) {
|
1722 | return Properties === undefined ? nativeObjectCreate(O) : $defineProperties(nativeObjectCreate(O), Properties);
|
1723 | };
|
1724 |
|
1725 | var $propertyIsEnumerable = function propertyIsEnumerable(V) {
|
1726 | var P = toPropertyKey(V);
|
1727 | var enumerable = call$d(nativePropertyIsEnumerable, this, P);
|
1728 | if (this === ObjectPrototype$2 && hasOwn$c(AllSymbols, P) && !hasOwn$c(ObjectPrototypeSymbols, P)) return false;
|
1729 | return enumerable || !hasOwn$c(this, P) || !hasOwn$c(AllSymbols, P) || hasOwn$c(this, HIDDEN) && this[HIDDEN][P]
|
1730 | ? enumerable : true;
|
1731 | };
|
1732 |
|
1733 | var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O, P) {
|
1734 | var it = toIndexedObject$4(O);
|
1735 | var key = toPropertyKey(P);
|
1736 | if (it === ObjectPrototype$2 && hasOwn$c(AllSymbols, key) && !hasOwn$c(ObjectPrototypeSymbols, key)) return;
|
1737 | var descriptor = nativeGetOwnPropertyDescriptor$1(it, key);
|
1738 | if (descriptor && hasOwn$c(AllSymbols, key) && !(hasOwn$c(it, HIDDEN) && it[HIDDEN][key])) {
|
1739 | descriptor.enumerable = true;
|
1740 | }
|
1741 | return descriptor;
|
1742 | };
|
1743 |
|
1744 | var $getOwnPropertyNames = function getOwnPropertyNames(O) {
|
1745 | var names = nativeGetOwnPropertyNames(toIndexedObject$4(O));
|
1746 | var result = [];
|
1747 | $forEach$1(names, function (key) {
|
1748 | if (!hasOwn$c(AllSymbols, key) && !hasOwn$c(hiddenKeys$1, key)) push$a(result, key);
|
1749 | });
|
1750 | return result;
|
1751 | };
|
1752 |
|
1753 | var $getOwnPropertySymbols = function (O) {
|
1754 | var IS_OBJECT_PROTOTYPE = O === ObjectPrototype$2;
|
1755 | var names = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject$4(O));
|
1756 | var result = [];
|
1757 | $forEach$1(names, function (key) {
|
1758 | if (hasOwn$c(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn$c(ObjectPrototype$2, key))) {
|
1759 | push$a(result, AllSymbols[key]);
|
1760 | }
|
1761 | });
|
1762 | return result;
|
1763 | };
|
1764 |
|
1765 | // `Symbol` constructor
|
1766 | // https://tc39.es/ecma262/#sec-symbol-constructor
|
1767 | if (!NATIVE_SYMBOL$3) {
|
1768 | $Symbol = function Symbol() {
|
1769 | if (isPrototypeOf$j(SymbolPrototype, this)) throw new TypeError$2('Symbol is not a constructor');
|
1770 | var description = !arguments.length || arguments[0] === undefined ? undefined : $toString(arguments[0]);
|
1771 | var tag = uid$1(description);
|
1772 | var setter = function (value) {
|
1773 | var $this = this === undefined ? global$e : this;
|
1774 | if ($this === ObjectPrototype$2) call$d(setter, ObjectPrototypeSymbols, value);
|
1775 | if (hasOwn$c($this, HIDDEN) && hasOwn$c($this[HIDDEN], tag)) $this[HIDDEN][tag] = false;
|
1776 | var descriptor = createPropertyDescriptor$3(1, value);
|
1777 | try {
|
1778 | setSymbolDescriptor($this, tag, descriptor);
|
1779 | } catch (error) {
|
1780 | if (!(error instanceof RangeError)) throw error;
|
1781 | fallbackDefineProperty($this, tag, descriptor);
|
1782 | }
|
1783 | };
|
1784 | if (DESCRIPTORS$a && USE_SETTER) setSymbolDescriptor(ObjectPrototype$2, tag, { configurable: true, set: setter });
|
1785 | return wrap(tag, description);
|
1786 | };
|
1787 |
|
1788 | SymbolPrototype = $Symbol[PROTOTYPE];
|
1789 |
|
1790 | defineBuiltIn$4(SymbolPrototype, 'toString', function toString() {
|
1791 | return getInternalState$2(this).tag;
|
1792 | });
|
1793 |
|
1794 | defineBuiltIn$4($Symbol, 'withoutSetter', function (description) {
|
1795 | return wrap(uid$1(description), description);
|
1796 | });
|
1797 |
|
1798 | propertyIsEnumerableModule$1.f = $propertyIsEnumerable;
|
1799 | definePropertyModule$1.f = $defineProperty;
|
1800 | definePropertiesModule.f = $defineProperties;
|
1801 | getOwnPropertyDescriptorModule$2.f = $getOwnPropertyDescriptor;
|
1802 | getOwnPropertyNamesModule$2.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
|
1803 | getOwnPropertySymbolsModule$3.f = $getOwnPropertySymbols;
|
1804 |
|
1805 | wrappedWellKnownSymbolModule.f = function (name) {
|
1806 | return wrap(wellKnownSymbol$d(name), name);
|
1807 | };
|
1808 |
|
1809 | if (DESCRIPTORS$a) {
|
1810 | // https://github.com/tc39/proposal-Symbol-description
|
1811 | defineBuiltInAccessor$2(SymbolPrototype, 'description', {
|
1812 | configurable: true,
|
1813 | get: function description() {
|
1814 | return getInternalState$2(this).description;
|
1815 | }
|
1816 | });
|
1817 | }
|
1818 | }
|
1819 |
|
1820 | $$N({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL$3, sham: !NATIVE_SYMBOL$3 }, {
|
1821 | Symbol: $Symbol
|
1822 | });
|
1823 |
|
1824 | $forEach$1(objectKeys$1(WellKnownSymbolsStore$1), function (name) {
|
1825 | defineWellKnownSymbol$l(name);
|
1826 | });
|
1827 |
|
1828 | $$N({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL$3 }, {
|
1829 | useSetter: function () { USE_SETTER = true; },
|
1830 | useSimple: function () { USE_SETTER = false; }
|
1831 | });
|
1832 |
|
1833 | $$N({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$3, sham: !DESCRIPTORS$a }, {
|
1834 | // `Object.create` method
|
1835 | // https://tc39.es/ecma262/#sec-object.create
|
1836 | create: $create,
|
1837 | // `Object.defineProperty` method
|
1838 | // https://tc39.es/ecma262/#sec-object.defineproperty
|
1839 | defineProperty: $defineProperty,
|
1840 | // `Object.defineProperties` method
|
1841 | // https://tc39.es/ecma262/#sec-object.defineproperties
|
1842 | defineProperties: $defineProperties,
|
1843 | // `Object.getOwnPropertyDescriptor` method
|
1844 | // https://tc39.es/ecma262/#sec-object.getownpropertydescriptors
|
1845 | getOwnPropertyDescriptor: $getOwnPropertyDescriptor
|
1846 | });
|
1847 |
|
1848 | $$N({ target: 'Object', stat: true, forced: !NATIVE_SYMBOL$3 }, {
|
1849 | // `Object.getOwnPropertyNames` method
|
1850 | // https://tc39.es/ecma262/#sec-object.getownpropertynames
|
1851 | getOwnPropertyNames: $getOwnPropertyNames
|
1852 | });
|
1853 |
|
1854 | // `Symbol.prototype[@@toPrimitive]` method
|
1855 | // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
|
1856 | defineSymbolToPrimitive$1();
|
1857 |
|
1858 | // `Symbol.prototype[@@toStringTag]` property
|
1859 | // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
|
1860 | setToStringTag$6($Symbol, SYMBOL);
|
1861 |
|
1862 | hiddenKeys$1[HIDDEN] = true;
|
1863 |
|
1864 | var NATIVE_SYMBOL$2 = symbolConstructorDetection;
|
1865 |
|
1866 | /* eslint-disable es/no-symbol -- safe */
|
1867 | var symbolRegistryDetection = NATIVE_SYMBOL$2 && !!Symbol['for'] && !!Symbol.keyFor;
|
1868 |
|
1869 | var $$M = _export;
|
1870 | var getBuiltIn$a = getBuiltIn$f;
|
1871 | var hasOwn$b = hasOwnProperty_1;
|
1872 | var toString$5 = toString$7;
|
1873 | var shared$2 = sharedExports;
|
1874 | var NATIVE_SYMBOL_REGISTRY$1 = symbolRegistryDetection;
|
1875 |
|
1876 | var StringToSymbolRegistry = shared$2('string-to-symbol-registry');
|
1877 | var SymbolToStringRegistry$1 = shared$2('symbol-to-string-registry');
|
1878 |
|
1879 | // `Symbol.for` method
|
1880 | // https://tc39.es/ecma262/#sec-symbol.for
|
1881 | $$M({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY$1 }, {
|
1882 | 'for': function (key) {
|
1883 | var string = toString$5(key);
|
1884 | if (hasOwn$b(StringToSymbolRegistry, string)) return StringToSymbolRegistry[string];
|
1885 | var symbol = getBuiltIn$a('Symbol')(string);
|
1886 | StringToSymbolRegistry[string] = symbol;
|
1887 | SymbolToStringRegistry$1[symbol] = string;
|
1888 | return symbol;
|
1889 | }
|
1890 | });
|
1891 |
|
1892 | var $$L = _export;
|
1893 | var hasOwn$a = hasOwnProperty_1;
|
1894 | var isSymbol$2 = isSymbol$5;
|
1895 | var tryToString$4 = tryToString$6;
|
1896 | var shared$1 = sharedExports;
|
1897 | var NATIVE_SYMBOL_REGISTRY = symbolRegistryDetection;
|
1898 |
|
1899 | var SymbolToStringRegistry = shared$1('symbol-to-string-registry');
|
1900 |
|
1901 | // `Symbol.keyFor` method
|
1902 | // https://tc39.es/ecma262/#sec-symbol.keyfor
|
1903 | $$L({ target: 'Symbol', stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
|
1904 | keyFor: function keyFor(sym) {
|
1905 | if (!isSymbol$2(sym)) throw new TypeError(tryToString$4(sym) + ' is not a symbol');
|
1906 | if (hasOwn$a(SymbolToStringRegistry, sym)) return SymbolToStringRegistry[sym];
|
1907 | }
|
1908 | });
|
1909 |
|
1910 | var uncurryThis$d = functionUncurryThis;
|
1911 |
|
1912 | var arraySlice$5 = uncurryThis$d([].slice);
|
1913 |
|
1914 | var uncurryThis$c = functionUncurryThis;
|
1915 | var isArray$b = isArray$e;
|
1916 | var isCallable$a = isCallable$m;
|
1917 | var classof$8 = classofRaw$2;
|
1918 | var toString$4 = toString$7;
|
1919 |
|
1920 | var push$9 = uncurryThis$c([].push);
|
1921 |
|
1922 | var getJsonReplacerFunction = function (replacer) {
|
1923 | if (isCallable$a(replacer)) return replacer;
|
1924 | if (!isArray$b(replacer)) return;
|
1925 | var rawLength = replacer.length;
|
1926 | var keys = [];
|
1927 | for (var i = 0; i < rawLength; i++) {
|
1928 | var element = replacer[i];
|
1929 | if (typeof element == 'string') push$9(keys, element);
|
1930 | else if (typeof element == 'number' || classof$8(element) === 'Number' || classof$8(element) === 'String') push$9(keys, toString$4(element));
|
1931 | }
|
1932 | var keysLength = keys.length;
|
1933 | var root = true;
|
1934 | return function (key, value) {
|
1935 | if (root) {
|
1936 | root = false;
|
1937 | return value;
|
1938 | }
|
1939 | if (isArray$b(this)) return value;
|
1940 | for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
|
1941 | };
|
1942 | };
|
1943 |
|
1944 | var $$K = _export;
|
1945 | var getBuiltIn$9 = getBuiltIn$f;
|
1946 | var apply$4 = functionApply;
|
1947 | var call$c = functionCall;
|
1948 | var uncurryThis$b = functionUncurryThis;
|
1949 | var fails$i = fails$u;
|
1950 | var isCallable$9 = isCallable$m;
|
1951 | var isSymbol$1 = isSymbol$5;
|
1952 | var arraySlice$4 = arraySlice$5;
|
1953 | var getReplacerFunction = getJsonReplacerFunction;
|
1954 | var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
1955 |
|
1956 | var $String$1 = String;
|
1957 | var $stringify = getBuiltIn$9('JSON', 'stringify');
|
1958 | var exec = uncurryThis$b(/./.exec);
|
1959 | var charAt$2 = uncurryThis$b(''.charAt);
|
1960 | var charCodeAt$1 = uncurryThis$b(''.charCodeAt);
|
1961 | var replace$1 = uncurryThis$b(''.replace);
|
1962 | var numberToString = uncurryThis$b(1.0.toString);
|
1963 |
|
1964 | var tester = /[\uD800-\uDFFF]/g;
|
1965 | var low = /^[\uD800-\uDBFF]$/;
|
1966 | var hi = /^[\uDC00-\uDFFF]$/;
|
1967 |
|
1968 | var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL$1 || fails$i(function () {
|
1969 | var symbol = getBuiltIn$9('Symbol')('stringify detection');
|
1970 | // MS Edge converts symbol values to JSON as {}
|
1971 | return $stringify([symbol]) !== '[null]'
|
1972 | // WebKit converts symbol values to JSON as null
|
1973 | || $stringify({ a: symbol }) !== '{}'
|
1974 | // V8 throws on boxed symbols
|
1975 | || $stringify(Object(symbol)) !== '{}';
|
1976 | });
|
1977 |
|
1978 | // https://github.com/tc39/proposal-well-formed-stringify
|
1979 | var ILL_FORMED_UNICODE = fails$i(function () {
|
1980 | return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
|
1981 | || $stringify('\uDEAD') !== '"\\udead"';
|
1982 | });
|
1983 |
|
1984 | var stringifyWithSymbolsFix = function (it, replacer) {
|
1985 | var args = arraySlice$4(arguments);
|
1986 | var $replacer = getReplacerFunction(replacer);
|
1987 | if (!isCallable$9($replacer) && (it === undefined || isSymbol$1(it))) return; // IE8 returns string on undefined
|
1988 | args[1] = function (key, value) {
|
1989 | // some old implementations (like WebKit) could pass numbers as keys
|
1990 | if (isCallable$9($replacer)) value = call$c($replacer, this, $String$1(key), value);
|
1991 | if (!isSymbol$1(value)) return value;
|
1992 | };
|
1993 | return apply$4($stringify, null, args);
|
1994 | };
|
1995 |
|
1996 | var fixIllFormed = function (match, offset, string) {
|
1997 | var prev = charAt$2(string, offset - 1);
|
1998 | var next = charAt$2(string, offset + 1);
|
1999 | if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
|
2000 | return '\\u' + numberToString(charCodeAt$1(match, 0), 16);
|
2001 | } return match;
|
2002 | };
|
2003 |
|
2004 | if ($stringify) {
|
2005 | // `JSON.stringify` method
|
2006 | // https://tc39.es/ecma262/#sec-json.stringify
|
2007 | $$K({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
|
2008 | // eslint-disable-next-line no-unused-vars -- required for `.length`
|
2009 | stringify: function stringify(it, replacer, space) {
|
2010 | var args = arraySlice$4(arguments);
|
2011 | var result = apply$4(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
|
2012 | return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$1(result, tester, fixIllFormed) : result;
|
2013 | }
|
2014 | });
|
2015 | }
|
2016 |
|
2017 | var $$J = _export;
|
2018 | var NATIVE_SYMBOL = symbolConstructorDetection;
|
2019 | var fails$h = fails$u;
|
2020 | var getOwnPropertySymbolsModule$2 = objectGetOwnPropertySymbols;
|
2021 | var toObject$a = toObject$e;
|
2022 |
|
2023 | // V8 ~ Chrome 38 and 39 `Object.getOwnPropertySymbols` fails on primitives
|
2024 | // https://bugs.chromium.org/p/v8/issues/detail?id=3443
|
2025 | var FORCED$5 = !NATIVE_SYMBOL || fails$h(function () { getOwnPropertySymbolsModule$2.f(1); });
|
2026 |
|
2027 | // `Object.getOwnPropertySymbols` method
|
2028 | // https://tc39.es/ecma262/#sec-object.getownpropertysymbols
|
2029 | $$J({ target: 'Object', stat: true, forced: FORCED$5 }, {
|
2030 | getOwnPropertySymbols: function getOwnPropertySymbols(it) {
|
2031 | var $getOwnPropertySymbols = getOwnPropertySymbolsModule$2.f;
|
2032 | return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject$a(it)) : [];
|
2033 | }
|
2034 | });
|
2035 |
|
2036 | var defineWellKnownSymbol$k = wellKnownSymbolDefine;
|
2037 |
|
2038 | // `Symbol.asyncIterator` well-known symbol
|
2039 | // https://tc39.es/ecma262/#sec-symbol.asynciterator
|
2040 | defineWellKnownSymbol$k('asyncIterator');
|
2041 |
|
2042 | var defineWellKnownSymbol$j = wellKnownSymbolDefine;
|
2043 |
|
2044 | // `Symbol.hasInstance` well-known symbol
|
2045 | // https://tc39.es/ecma262/#sec-symbol.hasinstance
|
2046 | defineWellKnownSymbol$j('hasInstance');
|
2047 |
|
2048 | var defineWellKnownSymbol$i = wellKnownSymbolDefine;
|
2049 |
|
2050 | // `Symbol.isConcatSpreadable` well-known symbol
|
2051 | // https://tc39.es/ecma262/#sec-symbol.isconcatspreadable
|
2052 | defineWellKnownSymbol$i('isConcatSpreadable');
|
2053 |
|
2054 | var defineWellKnownSymbol$h = wellKnownSymbolDefine;
|
2055 |
|
2056 | // `Symbol.iterator` well-known symbol
|
2057 | // https://tc39.es/ecma262/#sec-symbol.iterator
|
2058 | defineWellKnownSymbol$h('iterator');
|
2059 |
|
2060 | var defineWellKnownSymbol$g = wellKnownSymbolDefine;
|
2061 |
|
2062 | // `Symbol.match` well-known symbol
|
2063 | // https://tc39.es/ecma262/#sec-symbol.match
|
2064 | defineWellKnownSymbol$g('match');
|
2065 |
|
2066 | var defineWellKnownSymbol$f = wellKnownSymbolDefine;
|
2067 |
|
2068 | // `Symbol.matchAll` well-known symbol
|
2069 | // https://tc39.es/ecma262/#sec-symbol.matchall
|
2070 | defineWellKnownSymbol$f('matchAll');
|
2071 |
|
2072 | var defineWellKnownSymbol$e = wellKnownSymbolDefine;
|
2073 |
|
2074 | // `Symbol.replace` well-known symbol
|
2075 | // https://tc39.es/ecma262/#sec-symbol.replace
|
2076 | defineWellKnownSymbol$e('replace');
|
2077 |
|
2078 | var defineWellKnownSymbol$d = wellKnownSymbolDefine;
|
2079 |
|
2080 | // `Symbol.search` well-known symbol
|
2081 | // https://tc39.es/ecma262/#sec-symbol.search
|
2082 | defineWellKnownSymbol$d('search');
|
2083 |
|
2084 | var defineWellKnownSymbol$c = wellKnownSymbolDefine;
|
2085 |
|
2086 | // `Symbol.species` well-known symbol
|
2087 | // https://tc39.es/ecma262/#sec-symbol.species
|
2088 | defineWellKnownSymbol$c('species');
|
2089 |
|
2090 | var defineWellKnownSymbol$b = wellKnownSymbolDefine;
|
2091 |
|
2092 | // `Symbol.split` well-known symbol
|
2093 | // https://tc39.es/ecma262/#sec-symbol.split
|
2094 | defineWellKnownSymbol$b('split');
|
2095 |
|
2096 | var defineWellKnownSymbol$a = wellKnownSymbolDefine;
|
2097 | var defineSymbolToPrimitive = symbolDefineToPrimitive;
|
2098 |
|
2099 | // `Symbol.toPrimitive` well-known symbol
|
2100 | // https://tc39.es/ecma262/#sec-symbol.toprimitive
|
2101 | defineWellKnownSymbol$a('toPrimitive');
|
2102 |
|
2103 | // `Symbol.prototype[@@toPrimitive]` method
|
2104 | // https://tc39.es/ecma262/#sec-symbol.prototype-@@toprimitive
|
2105 | defineSymbolToPrimitive();
|
2106 |
|
2107 | var getBuiltIn$8 = getBuiltIn$f;
|
2108 | var defineWellKnownSymbol$9 = wellKnownSymbolDefine;
|
2109 | var setToStringTag$5 = setToStringTag$7;
|
2110 |
|
2111 | // `Symbol.toStringTag` well-known symbol
|
2112 | // https://tc39.es/ecma262/#sec-symbol.tostringtag
|
2113 | defineWellKnownSymbol$9('toStringTag');
|
2114 |
|
2115 | // `Symbol.prototype[@@toStringTag]` property
|
2116 | // https://tc39.es/ecma262/#sec-symbol.prototype-@@tostringtag
|
2117 | setToStringTag$5(getBuiltIn$8('Symbol'), 'Symbol');
|
2118 |
|
2119 | var defineWellKnownSymbol$8 = wellKnownSymbolDefine;
|
2120 |
|
2121 | // `Symbol.unscopables` well-known symbol
|
2122 | // https://tc39.es/ecma262/#sec-symbol.unscopables
|
2123 | defineWellKnownSymbol$8('unscopables');
|
2124 |
|
2125 | var global$d = global$p;
|
2126 | var setToStringTag$4 = setToStringTag$7;
|
2127 |
|
2128 | // JSON[@@toStringTag] property
|
2129 | // https://tc39.es/ecma262/#sec-json-@@tostringtag
|
2130 | setToStringTag$4(global$d.JSON, 'JSON', true);
|
2131 |
|
2132 | var path$j = path$o;
|
2133 |
|
2134 | var symbol$5 = path$j.Symbol;
|
2135 |
|
2136 | var iterators = {};
|
2137 |
|
2138 | var DESCRIPTORS$9 = descriptors;
|
2139 | var hasOwn$9 = hasOwnProperty_1;
|
2140 |
|
2141 | var FunctionPrototype$2 = Function.prototype;
|
2142 | // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
2143 | var getDescriptor = DESCRIPTORS$9 && Object.getOwnPropertyDescriptor;
|
2144 |
|
2145 | var EXISTS = hasOwn$9(FunctionPrototype$2, 'name');
|
2146 | // additional protection from minified / mangled / dropped function names
|
2147 | var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
|
2148 | var CONFIGURABLE = EXISTS && (!DESCRIPTORS$9 || (DESCRIPTORS$9 && getDescriptor(FunctionPrototype$2, 'name').configurable));
|
2149 |
|
2150 | var functionName = {
|
2151 | EXISTS: EXISTS,
|
2152 | PROPER: PROPER,
|
2153 | CONFIGURABLE: CONFIGURABLE
|
2154 | };
|
2155 |
|
2156 | var fails$g = fails$u;
|
2157 |
|
2158 | var correctPrototypeGetter = !fails$g(function () {
|
2159 | function F() { /* empty */ }
|
2160 | F.prototype.constructor = null;
|
2161 | // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
|
2162 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
2163 | });
|
2164 |
|
2165 | var hasOwn$8 = hasOwnProperty_1;
|
2166 | var isCallable$8 = isCallable$m;
|
2167 | var toObject$9 = toObject$e;
|
2168 | var sharedKey = sharedKey$4;
|
2169 | var CORRECT_PROTOTYPE_GETTER$1 = correctPrototypeGetter;
|
2170 |
|
2171 | var IE_PROTO = sharedKey('IE_PROTO');
|
2172 | var $Object = Object;
|
2173 | var ObjectPrototype$1 = $Object.prototype;
|
2174 |
|
2175 | // `Object.getPrototypeOf` method
|
2176 | // https://tc39.es/ecma262/#sec-object.getprototypeof
|
2177 | // eslint-disable-next-line es/no-object-getprototypeof -- safe
|
2178 | var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER$1 ? $Object.getPrototypeOf : function (O) {
|
2179 | var object = toObject$9(O);
|
2180 | if (hasOwn$8(object, IE_PROTO)) return object[IE_PROTO];
|
2181 | var constructor = object.constructor;
|
2182 | if (isCallable$8(constructor) && object instanceof constructor) {
|
2183 | return constructor.prototype;
|
2184 | } return object instanceof $Object ? ObjectPrototype$1 : null;
|
2185 | };
|
2186 |
|
2187 | var fails$f = fails$u;
|
2188 | var isCallable$7 = isCallable$m;
|
2189 | var isObject$9 = isObject$h;
|
2190 | var create$b = objectCreate;
|
2191 | var getPrototypeOf$7 = objectGetPrototypeOf;
|
2192 | var defineBuiltIn$3 = defineBuiltIn$6;
|
2193 | var wellKnownSymbol$c = wellKnownSymbol$n;
|
2194 |
|
2195 | var ITERATOR$4 = wellKnownSymbol$c('iterator');
|
2196 | var BUGGY_SAFARI_ITERATORS$1 = false;
|
2197 |
|
2198 | // `%IteratorPrototype%` object
|
2199 | // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
|
2200 | var IteratorPrototype$1, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
2201 |
|
2202 | /* eslint-disable es/no-array-prototype-keys -- safe */
|
2203 | if ([].keys) {
|
2204 | arrayIterator = [].keys();
|
2205 | // Safari 8 has buggy iterators w/o `next`
|
2206 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
|
2207 | else {
|
2208 | PrototypeOfArrayIteratorPrototype = getPrototypeOf$7(getPrototypeOf$7(arrayIterator));
|
2209 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$1 = PrototypeOfArrayIteratorPrototype;
|
2210 | }
|
2211 | }
|
2212 |
|
2213 | var NEW_ITERATOR_PROTOTYPE = !isObject$9(IteratorPrototype$1) || fails$f(function () {
|
2214 | var test = {};
|
2215 | // FF44- legacy iterators case
|
2216 | return IteratorPrototype$1[ITERATOR$4].call(test) !== test;
|
2217 | });
|
2218 |
|
2219 | if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$1 = {};
|
2220 | else IteratorPrototype$1 = create$b(IteratorPrototype$1);
|
2221 |
|
2222 | // `%IteratorPrototype%[@@iterator]()` method
|
2223 | // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
|
2224 | if (!isCallable$7(IteratorPrototype$1[ITERATOR$4])) {
|
2225 | defineBuiltIn$3(IteratorPrototype$1, ITERATOR$4, function () {
|
2226 | return this;
|
2227 | });
|
2228 | }
|
2229 |
|
2230 | var iteratorsCore = {
|
2231 | IteratorPrototype: IteratorPrototype$1,
|
2232 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
|
2233 | };
|
2234 |
|
2235 | var IteratorPrototype = iteratorsCore.IteratorPrototype;
|
2236 | var create$a = objectCreate;
|
2237 | var createPropertyDescriptor$2 = createPropertyDescriptor$7;
|
2238 | var setToStringTag$3 = setToStringTag$7;
|
2239 | var Iterators$5 = iterators;
|
2240 |
|
2241 | var returnThis$1 = function () { return this; };
|
2242 |
|
2243 | var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
|
2244 | var TO_STRING_TAG = NAME + ' Iterator';
|
2245 | IteratorConstructor.prototype = create$a(IteratorPrototype, { next: createPropertyDescriptor$2(+!ENUMERABLE_NEXT, next) });
|
2246 | setToStringTag$3(IteratorConstructor, TO_STRING_TAG, false, true);
|
2247 | Iterators$5[TO_STRING_TAG] = returnThis$1;
|
2248 | return IteratorConstructor;
|
2249 | };
|
2250 |
|
2251 | var uncurryThis$a = functionUncurryThis;
|
2252 | var aCallable$b = aCallable$e;
|
2253 |
|
2254 | var functionUncurryThisAccessor = function (object, key, method) {
|
2255 | try {
|
2256 | // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
2257 | return uncurryThis$a(aCallable$b(Object.getOwnPropertyDescriptor(object, key)[method]));
|
2258 | } catch (error) { /* empty */ }
|
2259 | };
|
2260 |
|
2261 | var isCallable$6 = isCallable$m;
|
2262 |
|
2263 | var $String = String;
|
2264 | var $TypeError$9 = TypeError;
|
2265 |
|
2266 | var aPossiblePrototype$1 = function (argument) {
|
2267 | if (typeof argument == 'object' || isCallable$6(argument)) return argument;
|
2268 | throw new $TypeError$9("Can't set " + $String(argument) + ' as a prototype');
|
2269 | };
|
2270 |
|
2271 | /* eslint-disable no-proto -- safe */
|
2272 | var uncurryThisAccessor = functionUncurryThisAccessor;
|
2273 | var anObject$8 = anObject$d;
|
2274 | var aPossiblePrototype = aPossiblePrototype$1;
|
2275 |
|
2276 | // `Object.setPrototypeOf` method
|
2277 | // https://tc39.es/ecma262/#sec-object.setprototypeof
|
2278 | // Works with __proto__ only. Old v8 can't work with null proto objects.
|
2279 | // eslint-disable-next-line es/no-object-setprototypeof -- safe
|
2280 | var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
|
2281 | var CORRECT_SETTER = false;
|
2282 | var test = {};
|
2283 | var setter;
|
2284 | try {
|
2285 | setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
|
2286 | setter(test, []);
|
2287 | CORRECT_SETTER = test instanceof Array;
|
2288 | } catch (error) { /* empty */ }
|
2289 | return function setPrototypeOf(O, proto) {
|
2290 | anObject$8(O);
|
2291 | aPossiblePrototype(proto);
|
2292 | if (CORRECT_SETTER) setter(O, proto);
|
2293 | else O.__proto__ = proto;
|
2294 | return O;
|
2295 | };
|
2296 | }() : undefined);
|
2297 |
|
2298 | var $$I = _export;
|
2299 | var call$b = functionCall;
|
2300 | var FunctionName = functionName;
|
2301 | var createIteratorConstructor = iteratorCreateConstructor;
|
2302 | var getPrototypeOf$6 = objectGetPrototypeOf;
|
2303 | var setToStringTag$2 = setToStringTag$7;
|
2304 | var defineBuiltIn$2 = defineBuiltIn$6;
|
2305 | var wellKnownSymbol$b = wellKnownSymbol$n;
|
2306 | var Iterators$4 = iterators;
|
2307 | var IteratorsCore = iteratorsCore;
|
2308 |
|
2309 | var PROPER_FUNCTION_NAME = FunctionName.PROPER;
|
2310 | FunctionName.CONFIGURABLE;
|
2311 | IteratorsCore.IteratorPrototype;
|
2312 | var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
|
2313 | var ITERATOR$3 = wellKnownSymbol$b('iterator');
|
2314 | var KEYS = 'keys';
|
2315 | var VALUES = 'values';
|
2316 | var ENTRIES = 'entries';
|
2317 |
|
2318 | var returnThis = function () { return this; };
|
2319 |
|
2320 | var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
|
2321 | createIteratorConstructor(IteratorConstructor, NAME, next);
|
2322 |
|
2323 | var getIterationMethod = function (KIND) {
|
2324 | if (KIND === DEFAULT && defaultIterator) return defaultIterator;
|
2325 | if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
|
2326 |
|
2327 | switch (KIND) {
|
2328 | case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
|
2329 | case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
|
2330 | case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
|
2331 | }
|
2332 |
|
2333 | return function () { return new IteratorConstructor(this); };
|
2334 | };
|
2335 |
|
2336 | var TO_STRING_TAG = NAME + ' Iterator';
|
2337 | var INCORRECT_VALUES_NAME = false;
|
2338 | var IterablePrototype = Iterable.prototype;
|
2339 | var nativeIterator = IterablePrototype[ITERATOR$3]
|
2340 | || IterablePrototype['@@iterator']
|
2341 | || DEFAULT && IterablePrototype[DEFAULT];
|
2342 | var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
|
2343 | var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
|
2344 | var CurrentIteratorPrototype, methods, KEY;
|
2345 |
|
2346 | // fix native
|
2347 | if (anyNativeIterator) {
|
2348 | CurrentIteratorPrototype = getPrototypeOf$6(anyNativeIterator.call(new Iterable()));
|
2349 | if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
|
2350 | // Set @@toStringTag to native iterators
|
2351 | setToStringTag$2(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
|
2352 | Iterators$4[TO_STRING_TAG] = returnThis;
|
2353 | }
|
2354 | }
|
2355 |
|
2356 | // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
|
2357 | if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
|
2358 | {
|
2359 | INCORRECT_VALUES_NAME = true;
|
2360 | defaultIterator = function values() { return call$b(nativeIterator, this); };
|
2361 | }
|
2362 | }
|
2363 |
|
2364 | // export additional methods
|
2365 | if (DEFAULT) {
|
2366 | methods = {
|
2367 | values: getIterationMethod(VALUES),
|
2368 | keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
|
2369 | entries: getIterationMethod(ENTRIES)
|
2370 | };
|
2371 | if (FORCED) for (KEY in methods) {
|
2372 | if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
|
2373 | defineBuiltIn$2(IterablePrototype, KEY, methods[KEY]);
|
2374 | }
|
2375 | } else $$I({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
|
2376 | }
|
2377 |
|
2378 | // define iterator
|
2379 | if ((FORCED) && IterablePrototype[ITERATOR$3] !== defaultIterator) {
|
2380 | defineBuiltIn$2(IterablePrototype, ITERATOR$3, defaultIterator, { name: DEFAULT });
|
2381 | }
|
2382 | Iterators$4[NAME] = defaultIterator;
|
2383 |
|
2384 | return methods;
|
2385 | };
|
2386 |
|
2387 | // `CreateIterResultObject` abstract operation
|
2388 | // https://tc39.es/ecma262/#sec-createiterresultobject
|
2389 | var createIterResultObject$3 = function (value, done) {
|
2390 | return { value: value, done: done };
|
2391 | };
|
2392 |
|
2393 | var toIndexedObject$3 = toIndexedObject$a;
|
2394 | var Iterators$3 = iterators;
|
2395 | var InternalStateModule$4 = internalState;
|
2396 | objectDefineProperty.f;
|
2397 | var defineIterator$2 = iteratorDefine;
|
2398 | var createIterResultObject$2 = createIterResultObject$3;
|
2399 |
|
2400 | var ARRAY_ITERATOR = 'Array Iterator';
|
2401 | var setInternalState$4 = InternalStateModule$4.set;
|
2402 | var getInternalState$1 = InternalStateModule$4.getterFor(ARRAY_ITERATOR);
|
2403 |
|
2404 | // `Array.prototype.entries` method
|
2405 | // https://tc39.es/ecma262/#sec-array.prototype.entries
|
2406 | // `Array.prototype.keys` method
|
2407 | // https://tc39.es/ecma262/#sec-array.prototype.keys
|
2408 | // `Array.prototype.values` method
|
2409 | // https://tc39.es/ecma262/#sec-array.prototype.values
|
2410 | // `Array.prototype[@@iterator]` method
|
2411 | // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
|
2412 | // `CreateArrayIterator` internal method
|
2413 | // https://tc39.es/ecma262/#sec-createarrayiterator
|
2414 | defineIterator$2(Array, 'Array', function (iterated, kind) {
|
2415 | setInternalState$4(this, {
|
2416 | type: ARRAY_ITERATOR,
|
2417 | target: toIndexedObject$3(iterated), // target
|
2418 | index: 0, // next index
|
2419 | kind: kind // kind
|
2420 | });
|
2421 | // `%ArrayIteratorPrototype%.next` method
|
2422 | // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
|
2423 | }, function () {
|
2424 | var state = getInternalState$1(this);
|
2425 | var target = state.target;
|
2426 | var index = state.index++;
|
2427 | if (!target || index >= target.length) {
|
2428 | state.target = undefined;
|
2429 | return createIterResultObject$2(undefined, true);
|
2430 | }
|
2431 | switch (state.kind) {
|
2432 | case 'keys': return createIterResultObject$2(index, false);
|
2433 | case 'values': return createIterResultObject$2(target[index], false);
|
2434 | } return createIterResultObject$2([index, target[index]], false);
|
2435 | }, 'values');
|
2436 |
|
2437 | // argumentsList[@@iterator] is %ArrayProto_values%
|
2438 | // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
|
2439 | // https://tc39.es/ecma262/#sec-createmappedargumentsobject
|
2440 | Iterators$3.Arguments = Iterators$3.Array;
|
2441 |
|
2442 | // iterable DOM collections
|
2443 | // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
|
2444 | var domIterables = {
|
2445 | CSSRuleList: 0,
|
2446 | CSSStyleDeclaration: 0,
|
2447 | CSSValueList: 0,
|
2448 | ClientRectList: 0,
|
2449 | DOMRectList: 0,
|
2450 | DOMStringList: 0,
|
2451 | DOMTokenList: 1,
|
2452 | DataTransferItemList: 0,
|
2453 | FileList: 0,
|
2454 | HTMLAllCollection: 0,
|
2455 | HTMLCollection: 0,
|
2456 | HTMLFormElement: 0,
|
2457 | HTMLSelectElement: 0,
|
2458 | MediaList: 0,
|
2459 | MimeTypeArray: 0,
|
2460 | NamedNodeMap: 0,
|
2461 | NodeList: 1,
|
2462 | PaintRequestList: 0,
|
2463 | Plugin: 0,
|
2464 | PluginArray: 0,
|
2465 | SVGLengthList: 0,
|
2466 | SVGNumberList: 0,
|
2467 | SVGPathSegList: 0,
|
2468 | SVGPointList: 0,
|
2469 | SVGStringList: 0,
|
2470 | SVGTransformList: 0,
|
2471 | SourceBufferList: 0,
|
2472 | StyleSheetList: 0,
|
2473 | TextTrackCueList: 0,
|
2474 | TextTrackList: 0,
|
2475 | TouchList: 0
|
2476 | };
|
2477 |
|
2478 | var DOMIterables$4 = domIterables;
|
2479 | var global$c = global$p;
|
2480 | var classof$7 = classof$d;
|
2481 | var createNonEnumerableProperty$4 = createNonEnumerableProperty$9;
|
2482 | var Iterators$2 = iterators;
|
2483 | var wellKnownSymbol$a = wellKnownSymbol$n;
|
2484 |
|
2485 | var TO_STRING_TAG$1 = wellKnownSymbol$a('toStringTag');
|
2486 |
|
2487 | for (var COLLECTION_NAME in DOMIterables$4) {
|
2488 | var Collection = global$c[COLLECTION_NAME];
|
2489 | var CollectionPrototype = Collection && Collection.prototype;
|
2490 | if (CollectionPrototype && classof$7(CollectionPrototype) !== TO_STRING_TAG$1) {
|
2491 | createNonEnumerableProperty$4(CollectionPrototype, TO_STRING_TAG$1, COLLECTION_NAME);
|
2492 | }
|
2493 | Iterators$2[COLLECTION_NAME] = Iterators$2.Array;
|
2494 | }
|
2495 |
|
2496 | var parent$15 = symbol$5;
|
2497 |
|
2498 |
|
2499 | var symbol$4 = parent$15;
|
2500 |
|
2501 | var wellKnownSymbol$9 = wellKnownSymbol$n;
|
2502 | var defineProperty$4 = objectDefineProperty.f;
|
2503 |
|
2504 | var METADATA$1 = wellKnownSymbol$9('metadata');
|
2505 | var FunctionPrototype$1 = Function.prototype;
|
2506 |
|
2507 | // Function.prototype[@@metadata]
|
2508 | // https://github.com/tc39/proposal-decorator-metadata
|
2509 | if (FunctionPrototype$1[METADATA$1] === undefined) {
|
2510 | defineProperty$4(FunctionPrototype$1, METADATA$1, {
|
2511 | value: null
|
2512 | });
|
2513 | }
|
2514 |
|
2515 | var defineWellKnownSymbol$7 = wellKnownSymbolDefine;
|
2516 |
|
2517 | // `Symbol.asyncDispose` well-known symbol
|
2518 | // https://github.com/tc39/proposal-async-explicit-resource-management
|
2519 | defineWellKnownSymbol$7('asyncDispose');
|
2520 |
|
2521 | var defineWellKnownSymbol$6 = wellKnownSymbolDefine;
|
2522 |
|
2523 | // `Symbol.dispose` well-known symbol
|
2524 | // https://github.com/tc39/proposal-explicit-resource-management
|
2525 | defineWellKnownSymbol$6('dispose');
|
2526 |
|
2527 | var defineWellKnownSymbol$5 = wellKnownSymbolDefine;
|
2528 |
|
2529 | // `Symbol.metadata` well-known symbol
|
2530 | // https://github.com/tc39/proposal-decorators
|
2531 | defineWellKnownSymbol$5('metadata');
|
2532 |
|
2533 | var parent$14 = symbol$4;
|
2534 |
|
2535 |
|
2536 |
|
2537 |
|
2538 |
|
2539 |
|
2540 | var symbol$3 = parent$14;
|
2541 |
|
2542 | var getBuiltIn$7 = getBuiltIn$f;
|
2543 | var uncurryThis$9 = functionUncurryThis;
|
2544 |
|
2545 | var Symbol$2 = getBuiltIn$7('Symbol');
|
2546 | var keyFor = Symbol$2.keyFor;
|
2547 | var thisSymbolValue$1 = uncurryThis$9(Symbol$2.prototype.valueOf);
|
2548 |
|
2549 | // `Symbol.isRegisteredSymbol` method
|
2550 | // https://tc39.es/proposal-symbol-predicates/#sec-symbol-isregisteredsymbol
|
2551 | var symbolIsRegistered = Symbol$2.isRegisteredSymbol || function isRegisteredSymbol(value) {
|
2552 | try {
|
2553 | return keyFor(thisSymbolValue$1(value)) !== undefined;
|
2554 | } catch (error) {
|
2555 | return false;
|
2556 | }
|
2557 | };
|
2558 |
|
2559 | var $$H = _export;
|
2560 | var isRegisteredSymbol$1 = symbolIsRegistered;
|
2561 |
|
2562 | // `Symbol.isRegisteredSymbol` method
|
2563 | // https://tc39.es/proposal-symbol-predicates/#sec-symbol-isregisteredsymbol
|
2564 | $$H({ target: 'Symbol', stat: true }, {
|
2565 | isRegisteredSymbol: isRegisteredSymbol$1
|
2566 | });
|
2567 |
|
2568 | var shared = sharedExports;
|
2569 | var getBuiltIn$6 = getBuiltIn$f;
|
2570 | var uncurryThis$8 = functionUncurryThis;
|
2571 | var isSymbol = isSymbol$5;
|
2572 | var wellKnownSymbol$8 = wellKnownSymbol$n;
|
2573 |
|
2574 | var Symbol$1 = getBuiltIn$6('Symbol');
|
2575 | var $isWellKnownSymbol = Symbol$1.isWellKnownSymbol;
|
2576 | var getOwnPropertyNames = getBuiltIn$6('Object', 'getOwnPropertyNames');
|
2577 | var thisSymbolValue = uncurryThis$8(Symbol$1.prototype.valueOf);
|
2578 | var WellKnownSymbolsStore = shared('wks');
|
2579 |
|
2580 | for (var i = 0, symbolKeys = getOwnPropertyNames(Symbol$1), symbolKeysLength = symbolKeys.length; i < symbolKeysLength; i++) {
|
2581 | // some old engines throws on access to some keys like `arguments` or `caller`
|
2582 | try {
|
2583 | var symbolKey = symbolKeys[i];
|
2584 | if (isSymbol(Symbol$1[symbolKey])) wellKnownSymbol$8(symbolKey);
|
2585 | } catch (error) { /* empty */ }
|
2586 | }
|
2587 |
|
2588 | // `Symbol.isWellKnownSymbol` method
|
2589 | // https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknownsymbol
|
2590 | // We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected
|
2591 | var symbolIsWellKnown = function isWellKnownSymbol(value) {
|
2592 | if ($isWellKnownSymbol && $isWellKnownSymbol(value)) return true;
|
2593 | try {
|
2594 | var symbol = thisSymbolValue(value);
|
2595 | for (var j = 0, keys = getOwnPropertyNames(WellKnownSymbolsStore), keysLength = keys.length; j < keysLength; j++) {
|
2596 | // eslint-disable-next-line eqeqeq -- polyfilled symbols case
|
2597 | if (WellKnownSymbolsStore[keys[j]] == symbol) return true;
|
2598 | }
|
2599 | } catch (error) { /* empty */ }
|
2600 | return false;
|
2601 | };
|
2602 |
|
2603 | var $$G = _export;
|
2604 | var isWellKnownSymbol$1 = symbolIsWellKnown;
|
2605 |
|
2606 | // `Symbol.isWellKnownSymbol` method
|
2607 | // https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknownsymbol
|
2608 | // We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected
|
2609 | $$G({ target: 'Symbol', stat: true, forced: true }, {
|
2610 | isWellKnownSymbol: isWellKnownSymbol$1
|
2611 | });
|
2612 |
|
2613 | var defineWellKnownSymbol$4 = wellKnownSymbolDefine;
|
2614 |
|
2615 | // `Symbol.matcher` well-known symbol
|
2616 | // https://github.com/tc39/proposal-pattern-matching
|
2617 | defineWellKnownSymbol$4('matcher');
|
2618 |
|
2619 | var defineWellKnownSymbol$3 = wellKnownSymbolDefine;
|
2620 |
|
2621 | // `Symbol.observable` well-known symbol
|
2622 | // https://github.com/tc39/proposal-observable
|
2623 | defineWellKnownSymbol$3('observable');
|
2624 |
|
2625 | var $$F = _export;
|
2626 | var isRegisteredSymbol = symbolIsRegistered;
|
2627 |
|
2628 | // `Symbol.isRegistered` method
|
2629 | // obsolete version of https://tc39.es/proposal-symbol-predicates/#sec-symbol-isregisteredsymbol
|
2630 | $$F({ target: 'Symbol', stat: true, name: 'isRegisteredSymbol' }, {
|
2631 | isRegistered: isRegisteredSymbol
|
2632 | });
|
2633 |
|
2634 | var $$E = _export;
|
2635 | var isWellKnownSymbol = symbolIsWellKnown;
|
2636 |
|
2637 | // `Symbol.isWellKnown` method
|
2638 | // obsolete version of https://tc39.es/proposal-symbol-predicates/#sec-symbol-iswellknownsymbol
|
2639 | // We should patch it for newly added well-known symbols. If it's not required, this module just will not be injected
|
2640 | $$E({ target: 'Symbol', stat: true, name: 'isWellKnownSymbol', forced: true }, {
|
2641 | isWellKnown: isWellKnownSymbol
|
2642 | });
|
2643 |
|
2644 | // TODO: Remove from `core-js@4`
|
2645 | var defineWellKnownSymbol$2 = wellKnownSymbolDefine;
|
2646 |
|
2647 | // `Symbol.metadataKey` well-known symbol
|
2648 | // https://github.com/tc39/proposal-decorator-metadata
|
2649 | defineWellKnownSymbol$2('metadataKey');
|
2650 |
|
2651 | // TODO: remove from `core-js@4`
|
2652 | var defineWellKnownSymbol$1 = wellKnownSymbolDefine;
|
2653 |
|
2654 | // `Symbol.patternMatch` well-known symbol
|
2655 | // https://github.com/tc39/proposal-pattern-matching
|
2656 | defineWellKnownSymbol$1('patternMatch');
|
2657 |
|
2658 | // TODO: remove from `core-js@4`
|
2659 | var defineWellKnownSymbol = wellKnownSymbolDefine;
|
2660 |
|
2661 | defineWellKnownSymbol('replaceAll');
|
2662 |
|
2663 | var parent$13 = symbol$3;
|
2664 |
|
2665 |
|
2666 |
|
2667 |
|
2668 | // TODO: Remove from `core-js@4`
|
2669 |
|
2670 |
|
2671 |
|
2672 |
|
2673 |
|
2674 |
|
2675 | var symbol$2 = parent$13;
|
2676 |
|
2677 | var symbol$1 = symbol$2;
|
2678 |
|
2679 | var _Symbol$1 = /*@__PURE__*/getDefaultExportFromCjs(symbol$1);
|
2680 |
|
2681 | var uncurryThis$7 = functionUncurryThis;
|
2682 | var toIntegerOrInfinity$1 = toIntegerOrInfinity$4;
|
2683 | var toString$3 = toString$7;
|
2684 | var requireObjectCoercible = requireObjectCoercible$3;
|
2685 |
|
2686 | var charAt$1 = uncurryThis$7(''.charAt);
|
2687 | var charCodeAt = uncurryThis$7(''.charCodeAt);
|
2688 | var stringSlice = uncurryThis$7(''.slice);
|
2689 |
|
2690 | var createMethod$1 = function (CONVERT_TO_STRING) {
|
2691 | return function ($this, pos) {
|
2692 | var S = toString$3(requireObjectCoercible($this));
|
2693 | var position = toIntegerOrInfinity$1(pos);
|
2694 | var size = S.length;
|
2695 | var first, second;
|
2696 | if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
|
2697 | first = charCodeAt(S, position);
|
2698 | return first < 0xD800 || first > 0xDBFF || position + 1 === size
|
2699 | || (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
|
2700 | ? CONVERT_TO_STRING
|
2701 | ? charAt$1(S, position)
|
2702 | : first
|
2703 | : CONVERT_TO_STRING
|
2704 | ? stringSlice(S, position, position + 2)
|
2705 | : (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
|
2706 | };
|
2707 | };
|
2708 |
|
2709 | var stringMultibyte = {
|
2710 | // `String.prototype.codePointAt` method
|
2711 | // https://tc39.es/ecma262/#sec-string.prototype.codepointat
|
2712 | codeAt: createMethod$1(false),
|
2713 | // `String.prototype.at` method
|
2714 | // https://github.com/mathiasbynens/String.prototype.at
|
2715 | charAt: createMethod$1(true)
|
2716 | };
|
2717 |
|
2718 | var charAt = stringMultibyte.charAt;
|
2719 | var toString$2 = toString$7;
|
2720 | var InternalStateModule$3 = internalState;
|
2721 | var defineIterator$1 = iteratorDefine;
|
2722 | var createIterResultObject$1 = createIterResultObject$3;
|
2723 |
|
2724 | var STRING_ITERATOR = 'String Iterator';
|
2725 | var setInternalState$3 = InternalStateModule$3.set;
|
2726 | var getInternalState = InternalStateModule$3.getterFor(STRING_ITERATOR);
|
2727 |
|
2728 | // `String.prototype[@@iterator]` method
|
2729 | // https://tc39.es/ecma262/#sec-string.prototype-@@iterator
|
2730 | defineIterator$1(String, 'String', function (iterated) {
|
2731 | setInternalState$3(this, {
|
2732 | type: STRING_ITERATOR,
|
2733 | string: toString$2(iterated),
|
2734 | index: 0
|
2735 | });
|
2736 | // `%StringIteratorPrototype%.next` method
|
2737 | // https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
|
2738 | }, function next() {
|
2739 | var state = getInternalState(this);
|
2740 | var string = state.string;
|
2741 | var index = state.index;
|
2742 | var point;
|
2743 | if (index >= string.length) return createIterResultObject$1(undefined, true);
|
2744 | point = charAt(string, index);
|
2745 | state.index += point.length;
|
2746 | return createIterResultObject$1(point, false);
|
2747 | });
|
2748 |
|
2749 | var WrappedWellKnownSymbolModule$1 = wellKnownSymbolWrapped;
|
2750 |
|
2751 | var iterator$5 = WrappedWellKnownSymbolModule$1.f('iterator');
|
2752 |
|
2753 | var parent$12 = iterator$5;
|
2754 |
|
2755 |
|
2756 | var iterator$4 = parent$12;
|
2757 |
|
2758 | var parent$11 = iterator$4;
|
2759 |
|
2760 | var iterator$3 = parent$11;
|
2761 |
|
2762 | var parent$10 = iterator$3;
|
2763 |
|
2764 | var iterator$2 = parent$10;
|
2765 |
|
2766 | var iterator$1 = iterator$2;
|
2767 |
|
2768 | var _Symbol$iterator$1 = /*@__PURE__*/getDefaultExportFromCjs(iterator$1);
|
2769 |
|
2770 | function _typeof$1(o) {
|
2771 | "@babel/helpers - typeof";
|
2772 |
|
2773 | return _typeof$1 = "function" == typeof _Symbol$1 && "symbol" == typeof _Symbol$iterator$1 ? function (o) {
|
2774 | return typeof o;
|
2775 | } : function (o) {
|
2776 | return o && "function" == typeof _Symbol$1 && o.constructor === _Symbol$1 && o !== _Symbol$1.prototype ? "symbol" : typeof o;
|
2777 | }, _typeof$1(o);
|
2778 | }
|
2779 |
|
2780 | var WrappedWellKnownSymbolModule = wellKnownSymbolWrapped;
|
2781 |
|
2782 | var toPrimitive$4 = WrappedWellKnownSymbolModule.f('toPrimitive');
|
2783 |
|
2784 | var parent$$ = toPrimitive$4;
|
2785 |
|
2786 | var toPrimitive$3 = parent$$;
|
2787 |
|
2788 | var parent$_ = toPrimitive$3;
|
2789 |
|
2790 | var toPrimitive$2 = parent$_;
|
2791 |
|
2792 | var parent$Z = toPrimitive$2;
|
2793 |
|
2794 | var toPrimitive$1 = parent$Z;
|
2795 |
|
2796 | var toPrimitive = toPrimitive$1;
|
2797 |
|
2798 | var _Symbol$toPrimitive = /*@__PURE__*/getDefaultExportFromCjs(toPrimitive);
|
2799 |
|
2800 | function _toPrimitive(input, hint) {
|
2801 | if (_typeof$1(input) !== "object" || input === null) return input;
|
2802 | var prim = input[_Symbol$toPrimitive];
|
2803 | if (prim !== undefined) {
|
2804 | var res = prim.call(input, hint || "default");
|
2805 | if (_typeof$1(res) !== "object") return res;
|
2806 | throw new TypeError("@@toPrimitive must return a primitive value.");
|
2807 | }
|
2808 | return (hint === "string" ? String : Number)(input);
|
2809 | }
|
2810 |
|
2811 | function _toPropertyKey(arg) {
|
2812 | var key = _toPrimitive(arg, "string");
|
2813 | return _typeof$1(key) === "symbol" ? key : String(key);
|
2814 | }
|
2815 |
|
2816 | function _defineProperties(target, props) {
|
2817 | for (var i = 0; i < props.length; i++) {
|
2818 | var descriptor = props[i];
|
2819 | descriptor.enumerable = descriptor.enumerable || false;
|
2820 | descriptor.configurable = true;
|
2821 | if ("value" in descriptor) descriptor.writable = true;
|
2822 | _Object$defineProperty$1(target, _toPropertyKey(descriptor.key), descriptor);
|
2823 | }
|
2824 | }
|
2825 | function _createClass(Constructor, protoProps, staticProps) {
|
2826 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
2827 | if (staticProps) _defineProperties(Constructor, staticProps);
|
2828 | _Object$defineProperty$1(Constructor, "prototype", {
|
2829 | writable: false
|
2830 | });
|
2831 | return Constructor;
|
2832 | }
|
2833 |
|
2834 | function _defineProperty(obj, key, value) {
|
2835 | key = _toPropertyKey(key);
|
2836 | if (key in obj) {
|
2837 | _Object$defineProperty$1(obj, key, {
|
2838 | value: value,
|
2839 | enumerable: true,
|
2840 | configurable: true,
|
2841 | writable: true
|
2842 | });
|
2843 | } else {
|
2844 | obj[key] = value;
|
2845 | }
|
2846 | return obj;
|
2847 | }
|
2848 |
|
2849 | var uncurryThis$6 = functionUncurryThis;
|
2850 | var aCallable$a = aCallable$e;
|
2851 | var isObject$8 = isObject$h;
|
2852 | var hasOwn$7 = hasOwnProperty_1;
|
2853 | var arraySlice$3 = arraySlice$5;
|
2854 | var NATIVE_BIND = functionBindNative;
|
2855 |
|
2856 | var $Function = Function;
|
2857 | var concat$6 = uncurryThis$6([].concat);
|
2858 | var join = uncurryThis$6([].join);
|
2859 | var factories = {};
|
2860 |
|
2861 | var construct$3 = function (C, argsLength, args) {
|
2862 | if (!hasOwn$7(factories, argsLength)) {
|
2863 | var list = [];
|
2864 | var i = 0;
|
2865 | for (; i < argsLength; i++) list[i] = 'a[' + i + ']';
|
2866 | factories[argsLength] = $Function('C,a', 'return new C(' + join(list, ',') + ')');
|
2867 | } return factories[argsLength](C, args);
|
2868 | };
|
2869 |
|
2870 | // `Function.prototype.bind` method implementation
|
2871 | // https://tc39.es/ecma262/#sec-function.prototype.bind
|
2872 | // eslint-disable-next-line es/no-function-prototype-bind -- detection
|
2873 | var functionBind = NATIVE_BIND ? $Function.bind : function bind(that /* , ...args */) {
|
2874 | var F = aCallable$a(this);
|
2875 | var Prototype = F.prototype;
|
2876 | var partArgs = arraySlice$3(arguments, 1);
|
2877 | var boundFunction = function bound(/* args... */) {
|
2878 | var args = concat$6(partArgs, arraySlice$3(arguments));
|
2879 | return this instanceof boundFunction ? construct$3(F, args.length, args) : F.apply(that, args);
|
2880 | };
|
2881 | if (isObject$8(Prototype)) boundFunction.prototype = Prototype;
|
2882 | return boundFunction;
|
2883 | };
|
2884 |
|
2885 | // TODO: Remove from `core-js@4`
|
2886 | var $$D = _export;
|
2887 | var bind$f = functionBind;
|
2888 |
|
2889 | // `Function.prototype.bind` method
|
2890 | // https://tc39.es/ecma262/#sec-function.prototype.bind
|
2891 | // eslint-disable-next-line es/no-function-prototype-bind -- detection
|
2892 | $$D({ target: 'Function', proto: true, forced: Function.bind !== bind$f }, {
|
2893 | bind: bind$f
|
2894 | });
|
2895 |
|
2896 | var global$b = global$p;
|
2897 | var path$i = path$o;
|
2898 |
|
2899 | var getBuiltInPrototypeMethod$g = function (CONSTRUCTOR, METHOD) {
|
2900 | var Namespace = path$i[CONSTRUCTOR + 'Prototype'];
|
2901 | var pureMethod = Namespace && Namespace[METHOD];
|
2902 | if (pureMethod) return pureMethod;
|
2903 | var NativeConstructor = global$b[CONSTRUCTOR];
|
2904 | var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
2905 | return NativePrototype && NativePrototype[METHOD];
|
2906 | };
|
2907 |
|
2908 | var getBuiltInPrototypeMethod$f = getBuiltInPrototypeMethod$g;
|
2909 |
|
2910 | var bind$e = getBuiltInPrototypeMethod$f('Function', 'bind');
|
2911 |
|
2912 | var isPrototypeOf$i = objectIsPrototypeOf;
|
2913 | var method$f = bind$e;
|
2914 |
|
2915 | var FunctionPrototype = Function.prototype;
|
2916 |
|
2917 | var bind$d = function (it) {
|
2918 | var own = it.bind;
|
2919 | return it === FunctionPrototype || (isPrototypeOf$i(FunctionPrototype, it) && own === FunctionPrototype.bind) ? method$f : own;
|
2920 | };
|
2921 |
|
2922 | var parent$Y = bind$d;
|
2923 |
|
2924 | var bind$c = parent$Y;
|
2925 |
|
2926 | var bind$b = bind$c;
|
2927 |
|
2928 | var _bindInstanceProperty$1 = /*@__PURE__*/getDefaultExportFromCjs(bind$b);
|
2929 |
|
2930 | var aCallable$9 = aCallable$e;
|
2931 | var toObject$8 = toObject$e;
|
2932 | var IndexedObject$1 = indexedObject;
|
2933 | var lengthOfArrayLike$8 = lengthOfArrayLike$d;
|
2934 |
|
2935 | var $TypeError$8 = TypeError;
|
2936 |
|
2937 | // `Array.prototype.{ reduce, reduceRight }` methods implementation
|
2938 | var createMethod = function (IS_RIGHT) {
|
2939 | return function (that, callbackfn, argumentsLength, memo) {
|
2940 | aCallable$9(callbackfn);
|
2941 | var O = toObject$8(that);
|
2942 | var self = IndexedObject$1(O);
|
2943 | var length = lengthOfArrayLike$8(O);
|
2944 | var index = IS_RIGHT ? length - 1 : 0;
|
2945 | var i = IS_RIGHT ? -1 : 1;
|
2946 | if (argumentsLength < 2) while (true) {
|
2947 | if (index in self) {
|
2948 | memo = self[index];
|
2949 | index += i;
|
2950 | break;
|
2951 | }
|
2952 | index += i;
|
2953 | if (IS_RIGHT ? index < 0 : length <= index) {
|
2954 | throw new $TypeError$8('Reduce of empty array with no initial value');
|
2955 | }
|
2956 | }
|
2957 | for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {
|
2958 | memo = callbackfn(memo, self[index], index, O);
|
2959 | }
|
2960 | return memo;
|
2961 | };
|
2962 | };
|
2963 |
|
2964 | var arrayReduce = {
|
2965 | // `Array.prototype.reduce` method
|
2966 | // https://tc39.es/ecma262/#sec-array.prototype.reduce
|
2967 | left: createMethod(false),
|
2968 | // `Array.prototype.reduceRight` method
|
2969 | // https://tc39.es/ecma262/#sec-array.prototype.reduceright
|
2970 | right: createMethod(true)
|
2971 | };
|
2972 |
|
2973 | var fails$e = fails$u;
|
2974 |
|
2975 | var arrayMethodIsStrict$4 = function (METHOD_NAME, argument) {
|
2976 | var method = [][METHOD_NAME];
|
2977 | return !!method && fails$e(function () {
|
2978 | // eslint-disable-next-line no-useless-call -- required for testing
|
2979 | method.call(null, argument || function () { return 1; }, 1);
|
2980 | });
|
2981 | };
|
2982 |
|
2983 | var global$a = global$p;
|
2984 | var classof$6 = classofRaw$2;
|
2985 |
|
2986 | var engineIsNode = classof$6(global$a.process) === 'process';
|
2987 |
|
2988 | var $$C = _export;
|
2989 | var $reduce = arrayReduce.left;
|
2990 | var arrayMethodIsStrict$3 = arrayMethodIsStrict$4;
|
2991 | var CHROME_VERSION = engineV8Version;
|
2992 | var IS_NODE$4 = engineIsNode;
|
2993 |
|
2994 | // Chrome 80-82 has a critical bug
|
2995 | // https://bugs.chromium.org/p/chromium/issues/detail?id=1049982
|
2996 | var CHROME_BUG = !IS_NODE$4 && CHROME_VERSION > 79 && CHROME_VERSION < 83;
|
2997 | var FORCED$4 = CHROME_BUG || !arrayMethodIsStrict$3('reduce');
|
2998 |
|
2999 | // `Array.prototype.reduce` method
|
3000 | // https://tc39.es/ecma262/#sec-array.prototype.reduce
|
3001 | $$C({ target: 'Array', proto: true, forced: FORCED$4 }, {
|
3002 | reduce: function reduce(callbackfn /* , initialValue */) {
|
3003 | var length = arguments.length;
|
3004 | return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);
|
3005 | }
|
3006 | });
|
3007 |
|
3008 | var getBuiltInPrototypeMethod$e = getBuiltInPrototypeMethod$g;
|
3009 |
|
3010 | var reduce$3 = getBuiltInPrototypeMethod$e('Array', 'reduce');
|
3011 |
|
3012 | var isPrototypeOf$h = objectIsPrototypeOf;
|
3013 | var method$e = reduce$3;
|
3014 |
|
3015 | var ArrayPrototype$f = Array.prototype;
|
3016 |
|
3017 | var reduce$2 = function (it) {
|
3018 | var own = it.reduce;
|
3019 | return it === ArrayPrototype$f || (isPrototypeOf$h(ArrayPrototype$f, it) && own === ArrayPrototype$f.reduce) ? method$e : own;
|
3020 | };
|
3021 |
|
3022 | var parent$X = reduce$2;
|
3023 |
|
3024 | var reduce$1 = parent$X;
|
3025 |
|
3026 | var reduce = reduce$1;
|
3027 |
|
3028 | var _reduceInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(reduce);
|
3029 |
|
3030 | var $$B = _export;
|
3031 | var $filter = arrayIteration.filter;
|
3032 | var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5;
|
3033 |
|
3034 | var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$3('filter');
|
3035 |
|
3036 | // `Array.prototype.filter` method
|
3037 | // https://tc39.es/ecma262/#sec-array.prototype.filter
|
3038 | // with adding support of @@species
|
3039 | $$B({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, {
|
3040 | filter: function filter(callbackfn /* , thisArg */) {
|
3041 | return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3042 | }
|
3043 | });
|
3044 |
|
3045 | var getBuiltInPrototypeMethod$d = getBuiltInPrototypeMethod$g;
|
3046 |
|
3047 | var filter$3 = getBuiltInPrototypeMethod$d('Array', 'filter');
|
3048 |
|
3049 | var isPrototypeOf$g = objectIsPrototypeOf;
|
3050 | var method$d = filter$3;
|
3051 |
|
3052 | var ArrayPrototype$e = Array.prototype;
|
3053 |
|
3054 | var filter$2 = function (it) {
|
3055 | var own = it.filter;
|
3056 | return it === ArrayPrototype$e || (isPrototypeOf$g(ArrayPrototype$e, it) && own === ArrayPrototype$e.filter) ? method$d : own;
|
3057 | };
|
3058 |
|
3059 | var parent$W = filter$2;
|
3060 |
|
3061 | var filter$1 = parent$W;
|
3062 |
|
3063 | var filter = filter$1;
|
3064 |
|
3065 | var _filterInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(filter);
|
3066 |
|
3067 | var $$A = _export;
|
3068 | var $map = arrayIteration.map;
|
3069 | var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5;
|
3070 |
|
3071 | var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$2('map');
|
3072 |
|
3073 | // `Array.prototype.map` method
|
3074 | // https://tc39.es/ecma262/#sec-array.prototype.map
|
3075 | // with adding support of @@species
|
3076 | $$A({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
|
3077 | map: function map(callbackfn /* , thisArg */) {
|
3078 | return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3079 | }
|
3080 | });
|
3081 |
|
3082 | var getBuiltInPrototypeMethod$c = getBuiltInPrototypeMethod$g;
|
3083 |
|
3084 | var map$6 = getBuiltInPrototypeMethod$c('Array', 'map');
|
3085 |
|
3086 | var isPrototypeOf$f = objectIsPrototypeOf;
|
3087 | var method$c = map$6;
|
3088 |
|
3089 | var ArrayPrototype$d = Array.prototype;
|
3090 |
|
3091 | var map$5 = function (it) {
|
3092 | var own = it.map;
|
3093 | return it === ArrayPrototype$d || (isPrototypeOf$f(ArrayPrototype$d, it) && own === ArrayPrototype$d.map) ? method$c : own;
|
3094 | };
|
3095 |
|
3096 | var parent$V = map$5;
|
3097 |
|
3098 | var map$4 = parent$V;
|
3099 |
|
3100 | var map$3 = map$4;
|
3101 |
|
3102 | var _mapInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(map$3);
|
3103 |
|
3104 | var isArray$a = isArray$e;
|
3105 | var lengthOfArrayLike$7 = lengthOfArrayLike$d;
|
3106 | var doesNotExceedSafeInteger$2 = doesNotExceedSafeInteger$4;
|
3107 | var bind$a = functionBindContext;
|
3108 |
|
3109 | // `FlattenIntoArray` abstract operation
|
3110 | // https://tc39.github.io/proposal-flatMap/#sec-FlattenIntoArray
|
3111 | var flattenIntoArray$1 = function (target, original, source, sourceLen, start, depth, mapper, thisArg) {
|
3112 | var targetIndex = start;
|
3113 | var sourceIndex = 0;
|
3114 | var mapFn = mapper ? bind$a(mapper, thisArg) : false;
|
3115 | var element, elementLen;
|
3116 |
|
3117 | while (sourceIndex < sourceLen) {
|
3118 | if (sourceIndex in source) {
|
3119 | element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
|
3120 |
|
3121 | if (depth > 0 && isArray$a(element)) {
|
3122 | elementLen = lengthOfArrayLike$7(element);
|
3123 | targetIndex = flattenIntoArray$1(target, original, element, elementLen, targetIndex, depth - 1) - 1;
|
3124 | } else {
|
3125 | doesNotExceedSafeInteger$2(targetIndex + 1);
|
3126 | target[targetIndex] = element;
|
3127 | }
|
3128 |
|
3129 | targetIndex++;
|
3130 | }
|
3131 | sourceIndex++;
|
3132 | }
|
3133 | return targetIndex;
|
3134 | };
|
3135 |
|
3136 | var flattenIntoArray_1 = flattenIntoArray$1;
|
3137 |
|
3138 | var $$z = _export;
|
3139 | var flattenIntoArray = flattenIntoArray_1;
|
3140 | var aCallable$8 = aCallable$e;
|
3141 | var toObject$7 = toObject$e;
|
3142 | var lengthOfArrayLike$6 = lengthOfArrayLike$d;
|
3143 | var arraySpeciesCreate$1 = arraySpeciesCreate$4;
|
3144 |
|
3145 | // `Array.prototype.flatMap` method
|
3146 | // https://tc39.es/ecma262/#sec-array.prototype.flatmap
|
3147 | $$z({ target: 'Array', proto: true }, {
|
3148 | flatMap: function flatMap(callbackfn /* , thisArg */) {
|
3149 | var O = toObject$7(this);
|
3150 | var sourceLen = lengthOfArrayLike$6(O);
|
3151 | var A;
|
3152 | aCallable$8(callbackfn);
|
3153 | A = arraySpeciesCreate$1(O, 0);
|
3154 | A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
3155 | return A;
|
3156 | }
|
3157 | });
|
3158 |
|
3159 | var getBuiltInPrototypeMethod$b = getBuiltInPrototypeMethod$g;
|
3160 |
|
3161 | var flatMap$3 = getBuiltInPrototypeMethod$b('Array', 'flatMap');
|
3162 |
|
3163 | var isPrototypeOf$e = objectIsPrototypeOf;
|
3164 | var method$b = flatMap$3;
|
3165 |
|
3166 | var ArrayPrototype$c = Array.prototype;
|
3167 |
|
3168 | var flatMap$2 = function (it) {
|
3169 | var own = it.flatMap;
|
3170 | return it === ArrayPrototype$c || (isPrototypeOf$e(ArrayPrototype$c, it) && own === ArrayPrototype$c.flatMap) ? method$b : own;
|
3171 | };
|
3172 |
|
3173 | var parent$U = flatMap$2;
|
3174 |
|
3175 | var flatMap$1 = parent$U;
|
3176 |
|
3177 | var flatMap = flatMap$1;
|
3178 |
|
3179 | var _flatMapInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(flatMap);
|
3180 |
|
3181 | /**
|
3182 | * Create new data pipe.
|
3183 | *
|
3184 | * @param from - The source data set or data view.
|
3185 | * @remarks
|
3186 | * Example usage:
|
3187 | * ```typescript
|
3188 | * interface AppItem {
|
3189 | * whoami: string;
|
3190 | * appData: unknown;
|
3191 | * visData: VisItem;
|
3192 | * }
|
3193 | * interface VisItem {
|
3194 | * id: number;
|
3195 | * label: string;
|
3196 | * color: string;
|
3197 | * x: number;
|
3198 | * y: number;
|
3199 | * }
|
3200 | *
|
3201 | * const ds1 = new DataSet<AppItem, "whoami">([], { fieldId: "whoami" });
|
3202 | * const ds2 = new DataSet<VisItem, "id">();
|
3203 | *
|
3204 | * const pipe = createNewDataPipeFrom(ds1)
|
3205 | * .filter((item): boolean => item.enabled === true)
|
3206 | * .map<VisItem, "id">((item): VisItem => item.visData)
|
3207 | * .to(ds2);
|
3208 | *
|
3209 | * pipe.start();
|
3210 | * ```
|
3211 | * @returns A factory whose methods can be used to configure the pipe.
|
3212 | */
|
3213 | function createNewDataPipeFrom(from) {
|
3214 | return new DataPipeUnderConstruction(from);
|
3215 | }
|
3216 | /**
|
3217 | * Internal implementation of the pipe. This should be accessible only through
|
3218 | * `createNewDataPipeFrom` from the outside.
|
3219 | *
|
3220 | * @typeParam SI - Source item type.
|
3221 | * @typeParam SP - Source item type's id property name.
|
3222 | * @typeParam TI - Target item type.
|
3223 | * @typeParam TP - Target item type's id property name.
|
3224 | */
|
3225 | var SimpleDataPipe = /*#__PURE__*/function () {
|
3226 | /**
|
3227 | * Create a new data pipe.
|
3228 | *
|
3229 | * @param _source - The data set or data view that will be observed.
|
3230 | * @param _transformers - An array of transforming functions to be used to
|
3231 | * filter or transform the items in the pipe.
|
3232 | * @param _target - The data set or data view that will receive the items.
|
3233 | */
|
3234 | function SimpleDataPipe(_source, _transformers, _target) {
|
3235 | var _context, _context2, _context3;
|
3236 | _classCallCheck(this, SimpleDataPipe);
|
3237 | /**
|
3238 | * Bound listeners for use with `DataInterface['on' | 'off']`.
|
3239 | */
|
3240 | _defineProperty(this, "_listeners", {
|
3241 | add: _bindInstanceProperty$1(_context = this._add).call(_context, this),
|
3242 | remove: _bindInstanceProperty$1(_context2 = this._remove).call(_context2, this),
|
3243 | update: _bindInstanceProperty$1(_context3 = this._update).call(_context3, this)
|
3244 | });
|
3245 | this._source = _source;
|
3246 | this._transformers = _transformers;
|
3247 | this._target = _target;
|
3248 | }
|
3249 | /** @inheritDoc */
|
3250 | _createClass(SimpleDataPipe, [{
|
3251 | key: "all",
|
3252 | value: function all() {
|
3253 | this._target.update(this._transformItems(this._source.get()));
|
3254 | return this;
|
3255 | }
|
3256 | /** @inheritDoc */
|
3257 | }, {
|
3258 | key: "start",
|
3259 | value: function start() {
|
3260 | this._source.on("add", this._listeners.add);
|
3261 | this._source.on("remove", this._listeners.remove);
|
3262 | this._source.on("update", this._listeners.update);
|
3263 | return this;
|
3264 | }
|
3265 | /** @inheritDoc */
|
3266 | }, {
|
3267 | key: "stop",
|
3268 | value: function stop() {
|
3269 | this._source.off("add", this._listeners.add);
|
3270 | this._source.off("remove", this._listeners.remove);
|
3271 | this._source.off("update", this._listeners.update);
|
3272 | return this;
|
3273 | }
|
3274 | /**
|
3275 | * Apply the transformers to the items.
|
3276 | *
|
3277 | * @param items - The items to be transformed.
|
3278 | * @returns The transformed items.
|
3279 | */
|
3280 | }, {
|
3281 | key: "_transformItems",
|
3282 | value: function _transformItems(items) {
|
3283 | var _context4;
|
3284 | return _reduceInstanceProperty(_context4 = this._transformers).call(_context4, function (items, transform) {
|
3285 | return transform(items);
|
3286 | }, items);
|
3287 | }
|
3288 | /**
|
3289 | * Handle an add event.
|
3290 | *
|
3291 | * @param _name - Ignored.
|
3292 | * @param payload - The payload containing the ids of the added items.
|
3293 | */
|
3294 | }, {
|
3295 | key: "_add",
|
3296 | value: function _add(_name, payload) {
|
3297 | if (payload == null) {
|
3298 | return;
|
3299 | }
|
3300 | this._target.add(this._transformItems(this._source.get(payload.items)));
|
3301 | }
|
3302 | /**
|
3303 | * Handle an update event.
|
3304 | *
|
3305 | * @param _name - Ignored.
|
3306 | * @param payload - The payload containing the ids of the updated items.
|
3307 | */
|
3308 | }, {
|
3309 | key: "_update",
|
3310 | value: function _update(_name, payload) {
|
3311 | if (payload == null) {
|
3312 | return;
|
3313 | }
|
3314 | this._target.update(this._transformItems(this._source.get(payload.items)));
|
3315 | }
|
3316 | /**
|
3317 | * Handle a remove event.
|
3318 | *
|
3319 | * @param _name - Ignored.
|
3320 | * @param payload - The payload containing the data of the removed items.
|
3321 | */
|
3322 | }, {
|
3323 | key: "_remove",
|
3324 | value: function _remove(_name, payload) {
|
3325 | if (payload == null) {
|
3326 | return;
|
3327 | }
|
3328 | this._target.remove(this._transformItems(payload.oldData));
|
3329 | }
|
3330 | }]);
|
3331 | return SimpleDataPipe;
|
3332 | }();
|
3333 | /**
|
3334 | * Internal implementation of the pipe factory. This should be accessible
|
3335 | * only through `createNewDataPipeFrom` from the outside.
|
3336 | *
|
3337 | * @typeParam TI - Target item type.
|
3338 | * @typeParam TP - Target item type's id property name.
|
3339 | */
|
3340 | var DataPipeUnderConstruction = /*#__PURE__*/function () {
|
3341 | /**
|
3342 | * Create a new data pipe factory. This is an internal constructor that
|
3343 | * should never be called from outside of this file.
|
3344 | *
|
3345 | * @param _source - The source data set or data view for this pipe.
|
3346 | */
|
3347 | function DataPipeUnderConstruction(_source) {
|
3348 | _classCallCheck(this, DataPipeUnderConstruction);
|
3349 | /**
|
3350 | * Array transformers used to transform items within the pipe. This is typed
|
3351 | * as any for the sake of simplicity.
|
3352 | */
|
3353 | _defineProperty(this, "_transformers", []);
|
3354 | this._source = _source;
|
3355 | }
|
3356 | /**
|
3357 | * Filter the items.
|
3358 | *
|
3359 | * @param callback - A filtering function that returns true if given item
|
3360 | * should be piped and false if not.
|
3361 | * @returns This factory for further configuration.
|
3362 | */
|
3363 | _createClass(DataPipeUnderConstruction, [{
|
3364 | key: "filter",
|
3365 | value: function filter(callback) {
|
3366 | this._transformers.push(function (input) {
|
3367 | return _filterInstanceProperty(input).call(input, callback);
|
3368 | });
|
3369 | return this;
|
3370 | }
|
3371 | /**
|
3372 | * Map each source item to a new type.
|
3373 | *
|
3374 | * @param callback - A mapping function that takes a source item and returns
|
3375 | * corresponding mapped item.
|
3376 | * @typeParam TI - Target item type.
|
3377 | * @typeParam TP - Target item type's id property name.
|
3378 | * @returns This factory for further configuration.
|
3379 | */
|
3380 | }, {
|
3381 | key: "map",
|
3382 | value: function map(callback) {
|
3383 | this._transformers.push(function (input) {
|
3384 | return _mapInstanceProperty(input).call(input, callback);
|
3385 | });
|
3386 | return this;
|
3387 | }
|
3388 | /**
|
3389 | * Map each source item to zero or more items of a new type.
|
3390 | *
|
3391 | * @param callback - A mapping function that takes a source item and returns
|
3392 | * an array of corresponding mapped items.
|
3393 | * @typeParam TI - Target item type.
|
3394 | * @typeParam TP - Target item type's id property name.
|
3395 | * @returns This factory for further configuration.
|
3396 | */
|
3397 | }, {
|
3398 | key: "flatMap",
|
3399 | value: function flatMap(callback) {
|
3400 | this._transformers.push(function (input) {
|
3401 | return _flatMapInstanceProperty(input).call(input, callback);
|
3402 | });
|
3403 | return this;
|
3404 | }
|
3405 | /**
|
3406 | * Connect this pipe to given data set.
|
3407 | *
|
3408 | * @param target - The data set that will receive the items from this pipe.
|
3409 | * @returns The pipe connected between given data sets and performing
|
3410 | * configured transformation on the processed items.
|
3411 | */
|
3412 | }, {
|
3413 | key: "to",
|
3414 | value: function to(target) {
|
3415 | return new SimpleDataPipe(this._source, this._transformers, target);
|
3416 | }
|
3417 | }]);
|
3418 | return DataPipeUnderConstruction;
|
3419 | }();
|
3420 |
|
3421 | var componentEmitter = {exports: {}};
|
3422 |
|
3423 | (function (module) {
|
3424 | function Emitter(object) {
|
3425 | if (object) {
|
3426 | return mixin(object);
|
3427 | }
|
3428 |
|
3429 | this._callbacks = new Map();
|
3430 | }
|
3431 |
|
3432 | function mixin(object) {
|
3433 | Object.assign(object, Emitter.prototype);
|
3434 | object._callbacks = new Map();
|
3435 | return object;
|
3436 | }
|
3437 |
|
3438 | Emitter.prototype.on = function (event, listener) {
|
3439 | const callbacks = this._callbacks.get(event) ?? [];
|
3440 | callbacks.push(listener);
|
3441 | this._callbacks.set(event, callbacks);
|
3442 | return this;
|
3443 | };
|
3444 |
|
3445 | Emitter.prototype.once = function (event, listener) {
|
3446 | const on = (...arguments_) => {
|
3447 | this.off(event, on);
|
3448 | listener.apply(this, arguments_);
|
3449 | };
|
3450 |
|
3451 | on.fn = listener;
|
3452 | this.on(event, on);
|
3453 | return this;
|
3454 | };
|
3455 |
|
3456 | Emitter.prototype.off = function (event, listener) {
|
3457 | if (event === undefined && listener === undefined) {
|
3458 | this._callbacks.clear();
|
3459 | return this;
|
3460 | }
|
3461 |
|
3462 | if (listener === undefined) {
|
3463 | this._callbacks.delete(event);
|
3464 | return this;
|
3465 | }
|
3466 |
|
3467 | const callbacks = this._callbacks.get(event);
|
3468 | if (callbacks) {
|
3469 | for (const [index, callback] of callbacks.entries()) {
|
3470 | if (callback === listener || callback.fn === listener) {
|
3471 | callbacks.splice(index, 1);
|
3472 | break;
|
3473 | }
|
3474 | }
|
3475 |
|
3476 | if (callbacks.length === 0) {
|
3477 | this._callbacks.delete(event);
|
3478 | } else {
|
3479 | this._callbacks.set(event, callbacks);
|
3480 | }
|
3481 | }
|
3482 |
|
3483 | return this;
|
3484 | };
|
3485 |
|
3486 | Emitter.prototype.emit = function (event, ...arguments_) {
|
3487 | const callbacks = this._callbacks.get(event);
|
3488 | if (callbacks) {
|
3489 | // Create a copy of the callbacks array to avoid issues if it's modified during iteration
|
3490 | const callbacksCopy = [...callbacks];
|
3491 |
|
3492 | for (const callback of callbacksCopy) {
|
3493 | callback.apply(this, arguments_);
|
3494 | }
|
3495 | }
|
3496 |
|
3497 | return this;
|
3498 | };
|
3499 |
|
3500 | Emitter.prototype.listeners = function (event) {
|
3501 | return this._callbacks.get(event) ?? [];
|
3502 | };
|
3503 |
|
3504 | Emitter.prototype.listenerCount = function (event) {
|
3505 | if (event) {
|
3506 | return this.listeners(event).length;
|
3507 | }
|
3508 |
|
3509 | let totalCount = 0;
|
3510 | for (const callbacks of this._callbacks.values()) {
|
3511 | totalCount += callbacks.length;
|
3512 | }
|
3513 |
|
3514 | return totalCount;
|
3515 | };
|
3516 |
|
3517 | Emitter.prototype.hasListeners = function (event) {
|
3518 | return this.listenerCount(event) > 0;
|
3519 | };
|
3520 |
|
3521 | // Aliases
|
3522 | Emitter.prototype.addEventListener = Emitter.prototype.on;
|
3523 | Emitter.prototype.removeListener = Emitter.prototype.off;
|
3524 | Emitter.prototype.removeEventListener = Emitter.prototype.off;
|
3525 | Emitter.prototype.removeAllListeners = Emitter.prototype.off;
|
3526 |
|
3527 | {
|
3528 | module.exports = Emitter;
|
3529 | }
|
3530 | } (componentEmitter));
|
3531 |
|
3532 | var componentEmitterExports = componentEmitter.exports;
|
3533 | var Emitter = /*@__PURE__*/getDefaultExportFromCjs(componentEmitterExports);
|
3534 |
|
3535 | /*! Hammer.JS - v2.0.17-rc - 2019-12-16
|
3536 | * http://naver.github.io/egjs
|
3537 | *
|
3538 | * Forked By Naver egjs
|
3539 | * Copyright (c) hammerjs
|
3540 | * Licensed under the MIT license */
|
3541 | function _extends() {
|
3542 | _extends = Object.assign || function (target) {
|
3543 | for (var i = 1; i < arguments.length; i++) {
|
3544 | var source = arguments[i];
|
3545 |
|
3546 | for (var key in source) {
|
3547 | if (Object.prototype.hasOwnProperty.call(source, key)) {
|
3548 | target[key] = source[key];
|
3549 | }
|
3550 | }
|
3551 | }
|
3552 |
|
3553 | return target;
|
3554 | };
|
3555 |
|
3556 | return _extends.apply(this, arguments);
|
3557 | }
|
3558 |
|
3559 | function _inheritsLoose(subClass, superClass) {
|
3560 | subClass.prototype = Object.create(superClass.prototype);
|
3561 | subClass.prototype.constructor = subClass;
|
3562 | subClass.__proto__ = superClass;
|
3563 | }
|
3564 |
|
3565 | function _assertThisInitialized$1(self) {
|
3566 | if (self === void 0) {
|
3567 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
3568 | }
|
3569 |
|
3570 | return self;
|
3571 | }
|
3572 |
|
3573 | /**
|
3574 | * @private
|
3575 | * extend object.
|
3576 | * means that properties in dest will be overwritten by the ones in src.
|
3577 | * @param {Object} target
|
3578 | * @param {...Object} objects_to_assign
|
3579 | * @returns {Object} target
|
3580 | */
|
3581 | var assign$4;
|
3582 |
|
3583 | if (typeof Object.assign !== 'function') {
|
3584 | assign$4 = function assign(target) {
|
3585 | if (target === undefined || target === null) {
|
3586 | throw new TypeError('Cannot convert undefined or null to object');
|
3587 | }
|
3588 |
|
3589 | var output = Object(target);
|
3590 |
|
3591 | for (var index = 1; index < arguments.length; index++) {
|
3592 | var source = arguments[index];
|
3593 |
|
3594 | if (source !== undefined && source !== null) {
|
3595 | for (var nextKey in source) {
|
3596 | if (source.hasOwnProperty(nextKey)) {
|
3597 | output[nextKey] = source[nextKey];
|
3598 | }
|
3599 | }
|
3600 | }
|
3601 | }
|
3602 |
|
3603 | return output;
|
3604 | };
|
3605 | } else {
|
3606 | assign$4 = Object.assign;
|
3607 | }
|
3608 |
|
3609 | var assign$1$1 = assign$4;
|
3610 |
|
3611 | var VENDOR_PREFIXES = ['', 'webkit', 'Moz', 'MS', 'ms', 'o'];
|
3612 | var TEST_ELEMENT = typeof document === "undefined" ? {
|
3613 | style: {}
|
3614 | } : document.createElement('div');
|
3615 | var TYPE_FUNCTION = 'function';
|
3616 | var round = Math.round,
|
3617 | abs = Math.abs;
|
3618 | var now = Date.now;
|
3619 |
|
3620 | /**
|
3621 | * @private
|
3622 | * get the prefixed property
|
3623 | * @param {Object} obj
|
3624 | * @param {String} property
|
3625 | * @returns {String|Undefined} prefixed
|
3626 | */
|
3627 |
|
3628 | function prefixed(obj, property) {
|
3629 | var prefix;
|
3630 | var prop;
|
3631 | var camelProp = property[0].toUpperCase() + property.slice(1);
|
3632 | var i = 0;
|
3633 |
|
3634 | while (i < VENDOR_PREFIXES.length) {
|
3635 | prefix = VENDOR_PREFIXES[i];
|
3636 | prop = prefix ? prefix + camelProp : property;
|
3637 |
|
3638 | if (prop in obj) {
|
3639 | return prop;
|
3640 | }
|
3641 |
|
3642 | i++;
|
3643 | }
|
3644 |
|
3645 | return undefined;
|
3646 | }
|
3647 |
|
3648 | /* eslint-disable no-new-func, no-nested-ternary */
|
3649 | var win;
|
3650 |
|
3651 | if (typeof window === "undefined") {
|
3652 | // window is undefined in node.js
|
3653 | win = {};
|
3654 | } else {
|
3655 | win = window;
|
3656 | }
|
3657 |
|
3658 | var PREFIXED_TOUCH_ACTION = prefixed(TEST_ELEMENT.style, 'touchAction');
|
3659 | var NATIVE_TOUCH_ACTION = PREFIXED_TOUCH_ACTION !== undefined;
|
3660 | function getTouchActionProps() {
|
3661 | if (!NATIVE_TOUCH_ACTION) {
|
3662 | return false;
|
3663 | }
|
3664 |
|
3665 | var touchMap = {};
|
3666 | var cssSupports = win.CSS && win.CSS.supports;
|
3667 | ['auto', 'manipulation', 'pan-y', 'pan-x', 'pan-x pan-y', 'none'].forEach(function (val) {
|
3668 | // If css.supports is not supported but there is native touch-action assume it supports
|
3669 | // all values. This is the case for IE 10 and 11.
|
3670 | return touchMap[val] = cssSupports ? win.CSS.supports('touch-action', val) : true;
|
3671 | });
|
3672 | return touchMap;
|
3673 | }
|
3674 |
|
3675 | var TOUCH_ACTION_COMPUTE = 'compute';
|
3676 | var TOUCH_ACTION_AUTO = 'auto';
|
3677 | var TOUCH_ACTION_MANIPULATION = 'manipulation'; // not implemented
|
3678 |
|
3679 | var TOUCH_ACTION_NONE = 'none';
|
3680 | var TOUCH_ACTION_PAN_X = 'pan-x';
|
3681 | var TOUCH_ACTION_PAN_Y = 'pan-y';
|
3682 | var TOUCH_ACTION_MAP = getTouchActionProps();
|
3683 |
|
3684 | var MOBILE_REGEX = /mobile|tablet|ip(ad|hone|od)|android/i;
|
3685 | var SUPPORT_TOUCH = 'ontouchstart' in win;
|
3686 | var SUPPORT_POINTER_EVENTS = prefixed(win, 'PointerEvent') !== undefined;
|
3687 | var SUPPORT_ONLY_TOUCH = SUPPORT_TOUCH && MOBILE_REGEX.test(navigator.userAgent);
|
3688 | var INPUT_TYPE_TOUCH = 'touch';
|
3689 | var INPUT_TYPE_PEN = 'pen';
|
3690 | var INPUT_TYPE_MOUSE = 'mouse';
|
3691 | var INPUT_TYPE_KINECT = 'kinect';
|
3692 | var COMPUTE_INTERVAL = 25;
|
3693 | var INPUT_START = 1;
|
3694 | var INPUT_MOVE = 2;
|
3695 | var INPUT_END = 4;
|
3696 | var INPUT_CANCEL = 8;
|
3697 | var DIRECTION_NONE = 1;
|
3698 | var DIRECTION_LEFT = 2;
|
3699 | var DIRECTION_RIGHT = 4;
|
3700 | var DIRECTION_UP = 8;
|
3701 | var DIRECTION_DOWN = 16;
|
3702 | var DIRECTION_HORIZONTAL = DIRECTION_LEFT | DIRECTION_RIGHT;
|
3703 | var DIRECTION_VERTICAL = DIRECTION_UP | DIRECTION_DOWN;
|
3704 | var DIRECTION_ALL = DIRECTION_HORIZONTAL | DIRECTION_VERTICAL;
|
3705 | var PROPS_XY = ['x', 'y'];
|
3706 | var PROPS_CLIENT_XY = ['clientX', 'clientY'];
|
3707 |
|
3708 | /**
|
3709 | * @private
|
3710 | * walk objects and arrays
|
3711 | * @param {Object} obj
|
3712 | * @param {Function} iterator
|
3713 | * @param {Object} context
|
3714 | */
|
3715 | function each(obj, iterator, context) {
|
3716 | var i;
|
3717 |
|
3718 | if (!obj) {
|
3719 | return;
|
3720 | }
|
3721 |
|
3722 | if (obj.forEach) {
|
3723 | obj.forEach(iterator, context);
|
3724 | } else if (obj.length !== undefined) {
|
3725 | i = 0;
|
3726 |
|
3727 | while (i < obj.length) {
|
3728 | iterator.call(context, obj[i], i, obj);
|
3729 | i++;
|
3730 | }
|
3731 | } else {
|
3732 | for (i in obj) {
|
3733 | obj.hasOwnProperty(i) && iterator.call(context, obj[i], i, obj);
|
3734 | }
|
3735 | }
|
3736 | }
|
3737 |
|
3738 | /**
|
3739 | * @private
|
3740 | * let a boolean value also be a function that must return a boolean
|
3741 | * this first item in args will be used as the context
|
3742 | * @param {Boolean|Function} val
|
3743 | * @param {Array} [args]
|
3744 | * @returns {Boolean}
|
3745 | */
|
3746 |
|
3747 | function boolOrFn(val, args) {
|
3748 | if (typeof val === TYPE_FUNCTION) {
|
3749 | return val.apply(args ? args[0] || undefined : undefined, args);
|
3750 | }
|
3751 |
|
3752 | return val;
|
3753 | }
|
3754 |
|
3755 | /**
|
3756 | * @private
|
3757 | * small indexOf wrapper
|
3758 | * @param {String} str
|
3759 | * @param {String} find
|
3760 | * @returns {Boolean} found
|
3761 | */
|
3762 | function inStr(str, find) {
|
3763 | return str.indexOf(find) > -1;
|
3764 | }
|
3765 |
|
3766 | /**
|
3767 | * @private
|
3768 | * when the touchActions are collected they are not a valid value, so we need to clean things up. *
|
3769 | * @param {String} actions
|
3770 | * @returns {*}
|
3771 | */
|
3772 |
|
3773 | function cleanTouchActions(actions) {
|
3774 | // none
|
3775 | if (inStr(actions, TOUCH_ACTION_NONE)) {
|
3776 | return TOUCH_ACTION_NONE;
|
3777 | }
|
3778 |
|
3779 | var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X);
|
3780 | var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y); // if both pan-x and pan-y are set (different recognizers
|
3781 | // for different directions, e.g. horizontal pan but vertical swipe?)
|
3782 | // we need none (as otherwise with pan-x pan-y combined none of these
|
3783 | // recognizers will work, since the browser would handle all panning
|
3784 |
|
3785 | if (hasPanX && hasPanY) {
|
3786 | return TOUCH_ACTION_NONE;
|
3787 | } // pan-x OR pan-y
|
3788 |
|
3789 |
|
3790 | if (hasPanX || hasPanY) {
|
3791 | return hasPanX ? TOUCH_ACTION_PAN_X : TOUCH_ACTION_PAN_Y;
|
3792 | } // manipulation
|
3793 |
|
3794 |
|
3795 | if (inStr(actions, TOUCH_ACTION_MANIPULATION)) {
|
3796 | return TOUCH_ACTION_MANIPULATION;
|
3797 | }
|
3798 |
|
3799 | return TOUCH_ACTION_AUTO;
|
3800 | }
|
3801 |
|
3802 | /**
|
3803 | * @private
|
3804 | * Touch Action
|
3805 | * sets the touchAction property or uses the js alternative
|
3806 | * @param {Manager} manager
|
3807 | * @param {String} value
|
3808 | * @constructor
|
3809 | */
|
3810 |
|
3811 | var TouchAction =
|
3812 | /*#__PURE__*/
|
3813 | function () {
|
3814 | function TouchAction(manager, value) {
|
3815 | this.manager = manager;
|
3816 | this.set(value);
|
3817 | }
|
3818 | /**
|
3819 | * @private
|
3820 | * set the touchAction value on the element or enable the polyfill
|
3821 | * @param {String} value
|
3822 | */
|
3823 |
|
3824 |
|
3825 | var _proto = TouchAction.prototype;
|
3826 |
|
3827 | _proto.set = function set(value) {
|
3828 | // find out the touch-action by the event handlers
|
3829 | if (value === TOUCH_ACTION_COMPUTE) {
|
3830 | value = this.compute();
|
3831 | }
|
3832 |
|
3833 | if (NATIVE_TOUCH_ACTION && this.manager.element.style && TOUCH_ACTION_MAP[value]) {
|
3834 | this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
|
3835 | }
|
3836 |
|
3837 | this.actions = value.toLowerCase().trim();
|
3838 | };
|
3839 | /**
|
3840 | * @private
|
3841 | * just re-set the touchAction value
|
3842 | */
|
3843 |
|
3844 |
|
3845 | _proto.update = function update() {
|
3846 | this.set(this.manager.options.touchAction);
|
3847 | };
|
3848 | /**
|
3849 | * @private
|
3850 | * compute the value for the touchAction property based on the recognizer's settings
|
3851 | * @returns {String} value
|
3852 | */
|
3853 |
|
3854 |
|
3855 | _proto.compute = function compute() {
|
3856 | var actions = [];
|
3857 | each(this.manager.recognizers, function (recognizer) {
|
3858 | if (boolOrFn(recognizer.options.enable, [recognizer])) {
|
3859 | actions = actions.concat(recognizer.getTouchAction());
|
3860 | }
|
3861 | });
|
3862 | return cleanTouchActions(actions.join(' '));
|
3863 | };
|
3864 | /**
|
3865 | * @private
|
3866 | * this method is called on each input cycle and provides the preventing of the browser behavior
|
3867 | * @param {Object} input
|
3868 | */
|
3869 |
|
3870 |
|
3871 | _proto.preventDefaults = function preventDefaults(input) {
|
3872 | var srcEvent = input.srcEvent;
|
3873 | var direction = input.offsetDirection; // if the touch action did prevented once this session
|
3874 |
|
3875 | if (this.manager.session.prevented) {
|
3876 | srcEvent.preventDefault();
|
3877 | return;
|
3878 | }
|
3879 |
|
3880 | var actions = this.actions;
|
3881 | var hasNone = inStr(actions, TOUCH_ACTION_NONE) && !TOUCH_ACTION_MAP[TOUCH_ACTION_NONE];
|
3882 | var hasPanY = inStr(actions, TOUCH_ACTION_PAN_Y) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_Y];
|
3883 | var hasPanX = inStr(actions, TOUCH_ACTION_PAN_X) && !TOUCH_ACTION_MAP[TOUCH_ACTION_PAN_X];
|
3884 |
|
3885 | if (hasNone) {
|
3886 | // do not prevent defaults if this is a tap gesture
|
3887 | var isTapPointer = input.pointers.length === 1;
|
3888 | var isTapMovement = input.distance < 2;
|
3889 | var isTapTouchTime = input.deltaTime < 250;
|
3890 |
|
3891 | if (isTapPointer && isTapMovement && isTapTouchTime) {
|
3892 | return;
|
3893 | }
|
3894 | }
|
3895 |
|
3896 | if (hasPanX && hasPanY) {
|
3897 | // `pan-x pan-y` means browser handles all scrolling/panning, do not prevent
|
3898 | return;
|
3899 | }
|
3900 |
|
3901 | if (hasNone || hasPanY && direction & DIRECTION_HORIZONTAL || hasPanX && direction & DIRECTION_VERTICAL) {
|
3902 | return this.preventSrc(srcEvent);
|
3903 | }
|
3904 | };
|
3905 | /**
|
3906 | * @private
|
3907 | * call preventDefault to prevent the browser's default behavior (scrolling in most cases)
|
3908 | * @param {Object} srcEvent
|
3909 | */
|
3910 |
|
3911 |
|
3912 | _proto.preventSrc = function preventSrc(srcEvent) {
|
3913 | this.manager.session.prevented = true;
|
3914 | srcEvent.preventDefault();
|
3915 | };
|
3916 |
|
3917 | return TouchAction;
|
3918 | }();
|
3919 |
|
3920 | /**
|
3921 | * @private
|
3922 | * find if a node is in the given parent
|
3923 | * @method hasParent
|
3924 | * @param {HTMLElement} node
|
3925 | * @param {HTMLElement} parent
|
3926 | * @return {Boolean} found
|
3927 | */
|
3928 | function hasParent(node, parent) {
|
3929 | while (node) {
|
3930 | if (node === parent) {
|
3931 | return true;
|
3932 | }
|
3933 |
|
3934 | node = node.parentNode;
|
3935 | }
|
3936 |
|
3937 | return false;
|
3938 | }
|
3939 |
|
3940 | /**
|
3941 | * @private
|
3942 | * get the center of all the pointers
|
3943 | * @param {Array} pointers
|
3944 | * @return {Object} center contains `x` and `y` properties
|
3945 | */
|
3946 |
|
3947 | function getCenter(pointers) {
|
3948 | var pointersLength = pointers.length; // no need to loop when only one touch
|
3949 |
|
3950 | if (pointersLength === 1) {
|
3951 | return {
|
3952 | x: round(pointers[0].clientX),
|
3953 | y: round(pointers[0].clientY)
|
3954 | };
|
3955 | }
|
3956 |
|
3957 | var x = 0;
|
3958 | var y = 0;
|
3959 | var i = 0;
|
3960 |
|
3961 | while (i < pointersLength) {
|
3962 | x += pointers[i].clientX;
|
3963 | y += pointers[i].clientY;
|
3964 | i++;
|
3965 | }
|
3966 |
|
3967 | return {
|
3968 | x: round(x / pointersLength),
|
3969 | y: round(y / pointersLength)
|
3970 | };
|
3971 | }
|
3972 |
|
3973 | /**
|
3974 | * @private
|
3975 | * create a simple clone from the input used for storage of firstInput and firstMultiple
|
3976 | * @param {Object} input
|
3977 | * @returns {Object} clonedInputData
|
3978 | */
|
3979 |
|
3980 | function simpleCloneInputData(input) {
|
3981 | // make a simple copy of the pointers because we will get a reference if we don't
|
3982 | // we only need clientXY for the calculations
|
3983 | var pointers = [];
|
3984 | var i = 0;
|
3985 |
|
3986 | while (i < input.pointers.length) {
|
3987 | pointers[i] = {
|
3988 | clientX: round(input.pointers[i].clientX),
|
3989 | clientY: round(input.pointers[i].clientY)
|
3990 | };
|
3991 | i++;
|
3992 | }
|
3993 |
|
3994 | return {
|
3995 | timeStamp: now(),
|
3996 | pointers: pointers,
|
3997 | center: getCenter(pointers),
|
3998 | deltaX: input.deltaX,
|
3999 | deltaY: input.deltaY
|
4000 | };
|
4001 | }
|
4002 |
|
4003 | /**
|
4004 | * @private
|
4005 | * calculate the absolute distance between two points
|
4006 | * @param {Object} p1 {x, y}
|
4007 | * @param {Object} p2 {x, y}
|
4008 | * @param {Array} [props] containing x and y keys
|
4009 | * @return {Number} distance
|
4010 | */
|
4011 |
|
4012 | function getDistance(p1, p2, props) {
|
4013 | if (!props) {
|
4014 | props = PROPS_XY;
|
4015 | }
|
4016 |
|
4017 | var x = p2[props[0]] - p1[props[0]];
|
4018 | var y = p2[props[1]] - p1[props[1]];
|
4019 | return Math.sqrt(x * x + y * y);
|
4020 | }
|
4021 |
|
4022 | /**
|
4023 | * @private
|
4024 | * calculate the angle between two coordinates
|
4025 | * @param {Object} p1
|
4026 | * @param {Object} p2
|
4027 | * @param {Array} [props] containing x and y keys
|
4028 | * @return {Number} angle
|
4029 | */
|
4030 |
|
4031 | function getAngle(p1, p2, props) {
|
4032 | if (!props) {
|
4033 | props = PROPS_XY;
|
4034 | }
|
4035 |
|
4036 | var x = p2[props[0]] - p1[props[0]];
|
4037 | var y = p2[props[1]] - p1[props[1]];
|
4038 | return Math.atan2(y, x) * 180 / Math.PI;
|
4039 | }
|
4040 |
|
4041 | /**
|
4042 | * @private
|
4043 | * get the direction between two points
|
4044 | * @param {Number} x
|
4045 | * @param {Number} y
|
4046 | * @return {Number} direction
|
4047 | */
|
4048 |
|
4049 | function getDirection(x, y) {
|
4050 | if (x === y) {
|
4051 | return DIRECTION_NONE;
|
4052 | }
|
4053 |
|
4054 | if (abs(x) >= abs(y)) {
|
4055 | return x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
4056 | }
|
4057 |
|
4058 | return y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
|
4059 | }
|
4060 |
|
4061 | function computeDeltaXY(session, input) {
|
4062 | var center = input.center; // let { offsetDelta:offset = {}, prevDelta = {}, prevInput = {} } = session;
|
4063 | // jscs throwing error on defalut destructured values and without defaults tests fail
|
4064 |
|
4065 | var offset = session.offsetDelta || {};
|
4066 | var prevDelta = session.prevDelta || {};
|
4067 | var prevInput = session.prevInput || {};
|
4068 |
|
4069 | if (input.eventType === INPUT_START || prevInput.eventType === INPUT_END) {
|
4070 | prevDelta = session.prevDelta = {
|
4071 | x: prevInput.deltaX || 0,
|
4072 | y: prevInput.deltaY || 0
|
4073 | };
|
4074 | offset = session.offsetDelta = {
|
4075 | x: center.x,
|
4076 | y: center.y
|
4077 | };
|
4078 | }
|
4079 |
|
4080 | input.deltaX = prevDelta.x + (center.x - offset.x);
|
4081 | input.deltaY = prevDelta.y + (center.y - offset.y);
|
4082 | }
|
4083 |
|
4084 | /**
|
4085 | * @private
|
4086 | * calculate the velocity between two points. unit is in px per ms.
|
4087 | * @param {Number} deltaTime
|
4088 | * @param {Number} x
|
4089 | * @param {Number} y
|
4090 | * @return {Object} velocity `x` and `y`
|
4091 | */
|
4092 | function getVelocity(deltaTime, x, y) {
|
4093 | return {
|
4094 | x: x / deltaTime || 0,
|
4095 | y: y / deltaTime || 0
|
4096 | };
|
4097 | }
|
4098 |
|
4099 | /**
|
4100 | * @private
|
4101 | * calculate the scale factor between two pointersets
|
4102 | * no scale is 1, and goes down to 0 when pinched together, and bigger when pinched out
|
4103 | * @param {Array} start array of pointers
|
4104 | * @param {Array} end array of pointers
|
4105 | * @return {Number} scale
|
4106 | */
|
4107 |
|
4108 | function getScale(start, end) {
|
4109 | return getDistance(end[0], end[1], PROPS_CLIENT_XY) / getDistance(start[0], start[1], PROPS_CLIENT_XY);
|
4110 | }
|
4111 |
|
4112 | /**
|
4113 | * @private
|
4114 | * calculate the rotation degrees between two pointersets
|
4115 | * @param {Array} start array of pointers
|
4116 | * @param {Array} end array of pointers
|
4117 | * @return {Number} rotation
|
4118 | */
|
4119 |
|
4120 | function getRotation(start, end) {
|
4121 | return getAngle(end[1], end[0], PROPS_CLIENT_XY) + getAngle(start[1], start[0], PROPS_CLIENT_XY);
|
4122 | }
|
4123 |
|
4124 | /**
|
4125 | * @private
|
4126 | * velocity is calculated every x ms
|
4127 | * @param {Object} session
|
4128 | * @param {Object} input
|
4129 | */
|
4130 |
|
4131 | function computeIntervalInputData(session, input) {
|
4132 | var last = session.lastInterval || input;
|
4133 | var deltaTime = input.timeStamp - last.timeStamp;
|
4134 | var velocity;
|
4135 | var velocityX;
|
4136 | var velocityY;
|
4137 | var direction;
|
4138 |
|
4139 | if (input.eventType !== INPUT_CANCEL && (deltaTime > COMPUTE_INTERVAL || last.velocity === undefined)) {
|
4140 | var deltaX = input.deltaX - last.deltaX;
|
4141 | var deltaY = input.deltaY - last.deltaY;
|
4142 | var v = getVelocity(deltaTime, deltaX, deltaY);
|
4143 | velocityX = v.x;
|
4144 | velocityY = v.y;
|
4145 | velocity = abs(v.x) > abs(v.y) ? v.x : v.y;
|
4146 | direction = getDirection(deltaX, deltaY);
|
4147 | session.lastInterval = input;
|
4148 | } else {
|
4149 | // use latest velocity info if it doesn't overtake a minimum period
|
4150 | velocity = last.velocity;
|
4151 | velocityX = last.velocityX;
|
4152 | velocityY = last.velocityY;
|
4153 | direction = last.direction;
|
4154 | }
|
4155 |
|
4156 | input.velocity = velocity;
|
4157 | input.velocityX = velocityX;
|
4158 | input.velocityY = velocityY;
|
4159 | input.direction = direction;
|
4160 | }
|
4161 |
|
4162 | /**
|
4163 | * @private
|
4164 | * extend the data with some usable properties like scale, rotate, velocity etc
|
4165 | * @param {Object} manager
|
4166 | * @param {Object} input
|
4167 | */
|
4168 |
|
4169 | function computeInputData(manager, input) {
|
4170 | var session = manager.session;
|
4171 | var pointers = input.pointers;
|
4172 | var pointersLength = pointers.length; // store the first input to calculate the distance and direction
|
4173 |
|
4174 | if (!session.firstInput) {
|
4175 | session.firstInput = simpleCloneInputData(input);
|
4176 | } // to compute scale and rotation we need to store the multiple touches
|
4177 |
|
4178 |
|
4179 | if (pointersLength > 1 && !session.firstMultiple) {
|
4180 | session.firstMultiple = simpleCloneInputData(input);
|
4181 | } else if (pointersLength === 1) {
|
4182 | session.firstMultiple = false;
|
4183 | }
|
4184 |
|
4185 | var firstInput = session.firstInput,
|
4186 | firstMultiple = session.firstMultiple;
|
4187 | var offsetCenter = firstMultiple ? firstMultiple.center : firstInput.center;
|
4188 | var center = input.center = getCenter(pointers);
|
4189 | input.timeStamp = now();
|
4190 | input.deltaTime = input.timeStamp - firstInput.timeStamp;
|
4191 | input.angle = getAngle(offsetCenter, center);
|
4192 | input.distance = getDistance(offsetCenter, center);
|
4193 | computeDeltaXY(session, input);
|
4194 | input.offsetDirection = getDirection(input.deltaX, input.deltaY);
|
4195 | var overallVelocity = getVelocity(input.deltaTime, input.deltaX, input.deltaY);
|
4196 | input.overallVelocityX = overallVelocity.x;
|
4197 | input.overallVelocityY = overallVelocity.y;
|
4198 | input.overallVelocity = abs(overallVelocity.x) > abs(overallVelocity.y) ? overallVelocity.x : overallVelocity.y;
|
4199 | input.scale = firstMultiple ? getScale(firstMultiple.pointers, pointers) : 1;
|
4200 | input.rotation = firstMultiple ? getRotation(firstMultiple.pointers, pointers) : 0;
|
4201 | input.maxPointers = !session.prevInput ? input.pointers.length : input.pointers.length > session.prevInput.maxPointers ? input.pointers.length : session.prevInput.maxPointers;
|
4202 | computeIntervalInputData(session, input); // find the correct target
|
4203 |
|
4204 | var target = manager.element;
|
4205 | var srcEvent = input.srcEvent;
|
4206 | var srcEventTarget;
|
4207 |
|
4208 | if (srcEvent.composedPath) {
|
4209 | srcEventTarget = srcEvent.composedPath()[0];
|
4210 | } else if (srcEvent.path) {
|
4211 | srcEventTarget = srcEvent.path[0];
|
4212 | } else {
|
4213 | srcEventTarget = srcEvent.target;
|
4214 | }
|
4215 |
|
4216 | if (hasParent(srcEventTarget, target)) {
|
4217 | target = srcEventTarget;
|
4218 | }
|
4219 |
|
4220 | input.target = target;
|
4221 | }
|
4222 |
|
4223 | /**
|
4224 | * @private
|
4225 | * handle input events
|
4226 | * @param {Manager} manager
|
4227 | * @param {String} eventType
|
4228 | * @param {Object} input
|
4229 | */
|
4230 |
|
4231 | function inputHandler(manager, eventType, input) {
|
4232 | var pointersLen = input.pointers.length;
|
4233 | var changedPointersLen = input.changedPointers.length;
|
4234 | var isFirst = eventType & INPUT_START && pointersLen - changedPointersLen === 0;
|
4235 | var isFinal = eventType & (INPUT_END | INPUT_CANCEL) && pointersLen - changedPointersLen === 0;
|
4236 | input.isFirst = !!isFirst;
|
4237 | input.isFinal = !!isFinal;
|
4238 |
|
4239 | if (isFirst) {
|
4240 | manager.session = {};
|
4241 | } // source event is the normalized value of the domEvents
|
4242 | // like 'touchstart, mouseup, pointerdown'
|
4243 |
|
4244 |
|
4245 | input.eventType = eventType; // compute scale, rotation etc
|
4246 |
|
4247 | computeInputData(manager, input); // emit secret event
|
4248 |
|
4249 | manager.emit('hammer.input', input);
|
4250 | manager.recognize(input);
|
4251 | manager.session.prevInput = input;
|
4252 | }
|
4253 |
|
4254 | /**
|
4255 | * @private
|
4256 | * split string on whitespace
|
4257 | * @param {String} str
|
4258 | * @returns {Array} words
|
4259 | */
|
4260 | function splitStr(str) {
|
4261 | return str.trim().split(/\s+/g);
|
4262 | }
|
4263 |
|
4264 | /**
|
4265 | * @private
|
4266 | * addEventListener with multiple events at once
|
4267 | * @param {EventTarget} target
|
4268 | * @param {String} types
|
4269 | * @param {Function} handler
|
4270 | */
|
4271 |
|
4272 | function addEventListeners(target, types, handler) {
|
4273 | each(splitStr(types), function (type) {
|
4274 | target.addEventListener(type, handler, false);
|
4275 | });
|
4276 | }
|
4277 |
|
4278 | /**
|
4279 | * @private
|
4280 | * removeEventListener with multiple events at once
|
4281 | * @param {EventTarget} target
|
4282 | * @param {String} types
|
4283 | * @param {Function} handler
|
4284 | */
|
4285 |
|
4286 | function removeEventListeners(target, types, handler) {
|
4287 | each(splitStr(types), function (type) {
|
4288 | target.removeEventListener(type, handler, false);
|
4289 | });
|
4290 | }
|
4291 |
|
4292 | /**
|
4293 | * @private
|
4294 | * get the window object of an element
|
4295 | * @param {HTMLElement} element
|
4296 | * @returns {DocumentView|Window}
|
4297 | */
|
4298 | function getWindowForElement(element) {
|
4299 | var doc = element.ownerDocument || element;
|
4300 | return doc.defaultView || doc.parentWindow || window;
|
4301 | }
|
4302 |
|
4303 | /**
|
4304 | * @private
|
4305 | * create new input type manager
|
4306 | * @param {Manager} manager
|
4307 | * @param {Function} callback
|
4308 | * @returns {Input}
|
4309 | * @constructor
|
4310 | */
|
4311 |
|
4312 | var Input =
|
4313 | /*#__PURE__*/
|
4314 | function () {
|
4315 | function Input(manager, callback) {
|
4316 | var self = this;
|
4317 | this.manager = manager;
|
4318 | this.callback = callback;
|
4319 | this.element = manager.element;
|
4320 | this.target = manager.options.inputTarget; // smaller wrapper around the handler, for the scope and the enabled state of the manager,
|
4321 | // so when disabled the input events are completely bypassed.
|
4322 |
|
4323 | this.domHandler = function (ev) {
|
4324 | if (boolOrFn(manager.options.enable, [manager])) {
|
4325 | self.handler(ev);
|
4326 | }
|
4327 | };
|
4328 |
|
4329 | this.init();
|
4330 | }
|
4331 | /**
|
4332 | * @private
|
4333 | * should handle the inputEvent data and trigger the callback
|
4334 | * @virtual
|
4335 | */
|
4336 |
|
4337 |
|
4338 | var _proto = Input.prototype;
|
4339 |
|
4340 | _proto.handler = function handler() {};
|
4341 | /**
|
4342 | * @private
|
4343 | * bind the events
|
4344 | */
|
4345 |
|
4346 |
|
4347 | _proto.init = function init() {
|
4348 | this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
|
4349 | this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
|
4350 | this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
|
4351 | };
|
4352 | /**
|
4353 | * @private
|
4354 | * unbind the events
|
4355 | */
|
4356 |
|
4357 |
|
4358 | _proto.destroy = function destroy() {
|
4359 | this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
|
4360 | this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
|
4361 | this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
|
4362 | };
|
4363 |
|
4364 | return Input;
|
4365 | }();
|
4366 |
|
4367 | /**
|
4368 | * @private
|
4369 | * find if a array contains the object using indexOf or a simple polyFill
|
4370 | * @param {Array} src
|
4371 | * @param {String} find
|
4372 | * @param {String} [findByKey]
|
4373 | * @return {Boolean|Number} false when not found, or the index
|
4374 | */
|
4375 | function inArray(src, find, findByKey) {
|
4376 | if (src.indexOf && !findByKey) {
|
4377 | return src.indexOf(find);
|
4378 | } else {
|
4379 | var i = 0;
|
4380 |
|
4381 | while (i < src.length) {
|
4382 | if (findByKey && src[i][findByKey] == find || !findByKey && src[i] === find) {
|
4383 | // do not use === here, test fails
|
4384 | return i;
|
4385 | }
|
4386 |
|
4387 | i++;
|
4388 | }
|
4389 |
|
4390 | return -1;
|
4391 | }
|
4392 | }
|
4393 |
|
4394 | var POINTER_INPUT_MAP = {
|
4395 | pointerdown: INPUT_START,
|
4396 | pointermove: INPUT_MOVE,
|
4397 | pointerup: INPUT_END,
|
4398 | pointercancel: INPUT_CANCEL,
|
4399 | pointerout: INPUT_CANCEL
|
4400 | }; // in IE10 the pointer types is defined as an enum
|
4401 |
|
4402 | var IE10_POINTER_TYPE_ENUM = {
|
4403 | 2: INPUT_TYPE_TOUCH,
|
4404 | 3: INPUT_TYPE_PEN,
|
4405 | 4: INPUT_TYPE_MOUSE,
|
4406 | 5: INPUT_TYPE_KINECT // see https://twitter.com/jacobrossi/status/480596438489890816
|
4407 |
|
4408 | };
|
4409 | var POINTER_ELEMENT_EVENTS = 'pointerdown';
|
4410 | var POINTER_WINDOW_EVENTS = 'pointermove pointerup pointercancel'; // IE10 has prefixed support, and case-sensitive
|
4411 |
|
4412 | if (win.MSPointerEvent && !win.PointerEvent) {
|
4413 | POINTER_ELEMENT_EVENTS = 'MSPointerDown';
|
4414 | POINTER_WINDOW_EVENTS = 'MSPointerMove MSPointerUp MSPointerCancel';
|
4415 | }
|
4416 | /**
|
4417 | * @private
|
4418 | * Pointer events input
|
4419 | * @constructor
|
4420 | * @extends Input
|
4421 | */
|
4422 |
|
4423 |
|
4424 | var PointerEventInput =
|
4425 | /*#__PURE__*/
|
4426 | function (_Input) {
|
4427 | _inheritsLoose(PointerEventInput, _Input);
|
4428 |
|
4429 | function PointerEventInput() {
|
4430 | var _this;
|
4431 |
|
4432 | var proto = PointerEventInput.prototype;
|
4433 | proto.evEl = POINTER_ELEMENT_EVENTS;
|
4434 | proto.evWin = POINTER_WINDOW_EVENTS;
|
4435 | _this = _Input.apply(this, arguments) || this;
|
4436 | _this.store = _this.manager.session.pointerEvents = [];
|
4437 | return _this;
|
4438 | }
|
4439 | /**
|
4440 | * @private
|
4441 | * handle mouse events
|
4442 | * @param {Object} ev
|
4443 | */
|
4444 |
|
4445 |
|
4446 | var _proto = PointerEventInput.prototype;
|
4447 |
|
4448 | _proto.handler = function handler(ev) {
|
4449 | var store = this.store;
|
4450 | var removePointer = false;
|
4451 | var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
|
4452 | var eventType = POINTER_INPUT_MAP[eventTypeNormalized];
|
4453 | var pointerType = IE10_POINTER_TYPE_ENUM[ev.pointerType] || ev.pointerType;
|
4454 | var isTouch = pointerType === INPUT_TYPE_TOUCH; // get index of the event in the store
|
4455 |
|
4456 | var storeIndex = inArray(store, ev.pointerId, 'pointerId'); // start and mouse must be down
|
4457 |
|
4458 | if (eventType & INPUT_START && (ev.button === 0 || isTouch)) {
|
4459 | if (storeIndex < 0) {
|
4460 | store.push(ev);
|
4461 | storeIndex = store.length - 1;
|
4462 | }
|
4463 | } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
|
4464 | removePointer = true;
|
4465 | } // it not found, so the pointer hasn't been down (so it's probably a hover)
|
4466 |
|
4467 |
|
4468 | if (storeIndex < 0) {
|
4469 | return;
|
4470 | } // update the event in the store
|
4471 |
|
4472 |
|
4473 | store[storeIndex] = ev;
|
4474 | this.callback(this.manager, eventType, {
|
4475 | pointers: store,
|
4476 | changedPointers: [ev],
|
4477 | pointerType: pointerType,
|
4478 | srcEvent: ev
|
4479 | });
|
4480 |
|
4481 | if (removePointer) {
|
4482 | // remove from the store
|
4483 | store.splice(storeIndex, 1);
|
4484 | }
|
4485 | };
|
4486 |
|
4487 | return PointerEventInput;
|
4488 | }(Input);
|
4489 |
|
4490 | /**
|
4491 | * @private
|
4492 | * convert array-like objects to real arrays
|
4493 | * @param {Object} obj
|
4494 | * @returns {Array}
|
4495 | */
|
4496 | function toArray(obj) {
|
4497 | return Array.prototype.slice.call(obj, 0);
|
4498 | }
|
4499 |
|
4500 | /**
|
4501 | * @private
|
4502 | * unique array with objects based on a key (like 'id') or just by the array's value
|
4503 | * @param {Array} src [{id:1},{id:2},{id:1}]
|
4504 | * @param {String} [key]
|
4505 | * @param {Boolean} [sort=False]
|
4506 | * @returns {Array} [{id:1},{id:2}]
|
4507 | */
|
4508 |
|
4509 | function uniqueArray(src, key, sort) {
|
4510 | var results = [];
|
4511 | var values = [];
|
4512 | var i = 0;
|
4513 |
|
4514 | while (i < src.length) {
|
4515 | var val = key ? src[i][key] : src[i];
|
4516 |
|
4517 | if (inArray(values, val) < 0) {
|
4518 | results.push(src[i]);
|
4519 | }
|
4520 |
|
4521 | values[i] = val;
|
4522 | i++;
|
4523 | }
|
4524 |
|
4525 | if (sort) {
|
4526 | if (!key) {
|
4527 | results = results.sort();
|
4528 | } else {
|
4529 | results = results.sort(function (a, b) {
|
4530 | return a[key] > b[key];
|
4531 | });
|
4532 | }
|
4533 | }
|
4534 |
|
4535 | return results;
|
4536 | }
|
4537 |
|
4538 | var TOUCH_INPUT_MAP = {
|
4539 | touchstart: INPUT_START,
|
4540 | touchmove: INPUT_MOVE,
|
4541 | touchend: INPUT_END,
|
4542 | touchcancel: INPUT_CANCEL
|
4543 | };
|
4544 | var TOUCH_TARGET_EVENTS = 'touchstart touchmove touchend touchcancel';
|
4545 | /**
|
4546 | * @private
|
4547 | * Multi-user touch events input
|
4548 | * @constructor
|
4549 | * @extends Input
|
4550 | */
|
4551 |
|
4552 | var TouchInput =
|
4553 | /*#__PURE__*/
|
4554 | function (_Input) {
|
4555 | _inheritsLoose(TouchInput, _Input);
|
4556 |
|
4557 | function TouchInput() {
|
4558 | var _this;
|
4559 |
|
4560 | TouchInput.prototype.evTarget = TOUCH_TARGET_EVENTS;
|
4561 | _this = _Input.apply(this, arguments) || this;
|
4562 | _this.targetIds = {}; // this.evTarget = TOUCH_TARGET_EVENTS;
|
4563 |
|
4564 | return _this;
|
4565 | }
|
4566 |
|
4567 | var _proto = TouchInput.prototype;
|
4568 |
|
4569 | _proto.handler = function handler(ev) {
|
4570 | var type = TOUCH_INPUT_MAP[ev.type];
|
4571 | var touches = getTouches.call(this, ev, type);
|
4572 |
|
4573 | if (!touches) {
|
4574 | return;
|
4575 | }
|
4576 |
|
4577 | this.callback(this.manager, type, {
|
4578 | pointers: touches[0],
|
4579 | changedPointers: touches[1],
|
4580 | pointerType: INPUT_TYPE_TOUCH,
|
4581 | srcEvent: ev
|
4582 | });
|
4583 | };
|
4584 |
|
4585 | return TouchInput;
|
4586 | }(Input);
|
4587 |
|
4588 | function getTouches(ev, type) {
|
4589 | var allTouches = toArray(ev.touches);
|
4590 | var targetIds = this.targetIds; // when there is only one touch, the process can be simplified
|
4591 |
|
4592 | if (type & (INPUT_START | INPUT_MOVE) && allTouches.length === 1) {
|
4593 | targetIds[allTouches[0].identifier] = true;
|
4594 | return [allTouches, allTouches];
|
4595 | }
|
4596 |
|
4597 | var i;
|
4598 | var targetTouches;
|
4599 | var changedTouches = toArray(ev.changedTouches);
|
4600 | var changedTargetTouches = [];
|
4601 | var target = this.target; // get target touches from touches
|
4602 |
|
4603 | targetTouches = allTouches.filter(function (touch) {
|
4604 | return hasParent(touch.target, target);
|
4605 | }); // collect touches
|
4606 |
|
4607 | if (type === INPUT_START) {
|
4608 | i = 0;
|
4609 |
|
4610 | while (i < targetTouches.length) {
|
4611 | targetIds[targetTouches[i].identifier] = true;
|
4612 | i++;
|
4613 | }
|
4614 | } // filter changed touches to only contain touches that exist in the collected target ids
|
4615 |
|
4616 |
|
4617 | i = 0;
|
4618 |
|
4619 | while (i < changedTouches.length) {
|
4620 | if (targetIds[changedTouches[i].identifier]) {
|
4621 | changedTargetTouches.push(changedTouches[i]);
|
4622 | } // cleanup removed touches
|
4623 |
|
4624 |
|
4625 | if (type & (INPUT_END | INPUT_CANCEL)) {
|
4626 | delete targetIds[changedTouches[i].identifier];
|
4627 | }
|
4628 |
|
4629 | i++;
|
4630 | }
|
4631 |
|
4632 | if (!changedTargetTouches.length) {
|
4633 | return;
|
4634 | }
|
4635 |
|
4636 | return [// merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
|
4637 | uniqueArray(targetTouches.concat(changedTargetTouches), 'identifier', true), changedTargetTouches];
|
4638 | }
|
4639 |
|
4640 | var MOUSE_INPUT_MAP = {
|
4641 | mousedown: INPUT_START,
|
4642 | mousemove: INPUT_MOVE,
|
4643 | mouseup: INPUT_END
|
4644 | };
|
4645 | var MOUSE_ELEMENT_EVENTS = 'mousedown';
|
4646 | var MOUSE_WINDOW_EVENTS = 'mousemove mouseup';
|
4647 | /**
|
4648 | * @private
|
4649 | * Mouse events input
|
4650 | * @constructor
|
4651 | * @extends Input
|
4652 | */
|
4653 |
|
4654 | var MouseInput =
|
4655 | /*#__PURE__*/
|
4656 | function (_Input) {
|
4657 | _inheritsLoose(MouseInput, _Input);
|
4658 |
|
4659 | function MouseInput() {
|
4660 | var _this;
|
4661 |
|
4662 | var proto = MouseInput.prototype;
|
4663 | proto.evEl = MOUSE_ELEMENT_EVENTS;
|
4664 | proto.evWin = MOUSE_WINDOW_EVENTS;
|
4665 | _this = _Input.apply(this, arguments) || this;
|
4666 | _this.pressed = false; // mousedown state
|
4667 |
|
4668 | return _this;
|
4669 | }
|
4670 | /**
|
4671 | * @private
|
4672 | * handle mouse events
|
4673 | * @param {Object} ev
|
4674 | */
|
4675 |
|
4676 |
|
4677 | var _proto = MouseInput.prototype;
|
4678 |
|
4679 | _proto.handler = function handler(ev) {
|
4680 | var eventType = MOUSE_INPUT_MAP[ev.type]; // on start we want to have the left mouse button down
|
4681 |
|
4682 | if (eventType & INPUT_START && ev.button === 0) {
|
4683 | this.pressed = true;
|
4684 | }
|
4685 |
|
4686 | if (eventType & INPUT_MOVE && ev.which !== 1) {
|
4687 | eventType = INPUT_END;
|
4688 | } // mouse must be down
|
4689 |
|
4690 |
|
4691 | if (!this.pressed) {
|
4692 | return;
|
4693 | }
|
4694 |
|
4695 | if (eventType & INPUT_END) {
|
4696 | this.pressed = false;
|
4697 | }
|
4698 |
|
4699 | this.callback(this.manager, eventType, {
|
4700 | pointers: [ev],
|
4701 | changedPointers: [ev],
|
4702 | pointerType: INPUT_TYPE_MOUSE,
|
4703 | srcEvent: ev
|
4704 | });
|
4705 | };
|
4706 |
|
4707 | return MouseInput;
|
4708 | }(Input);
|
4709 |
|
4710 | /**
|
4711 | * @private
|
4712 | * Combined touch and mouse input
|
4713 | *
|
4714 | * Touch has a higher priority then mouse, and while touching no mouse events are allowed.
|
4715 | * This because touch devices also emit mouse events while doing a touch.
|
4716 | *
|
4717 | * @constructor
|
4718 | * @extends Input
|
4719 | */
|
4720 |
|
4721 | var DEDUP_TIMEOUT = 2500;
|
4722 | var DEDUP_DISTANCE = 25;
|
4723 |
|
4724 | function setLastTouch(eventData) {
|
4725 | var _eventData$changedPoi = eventData.changedPointers,
|
4726 | touch = _eventData$changedPoi[0];
|
4727 |
|
4728 | if (touch.identifier === this.primaryTouch) {
|
4729 | var lastTouch = {
|
4730 | x: touch.clientX,
|
4731 | y: touch.clientY
|
4732 | };
|
4733 | var lts = this.lastTouches;
|
4734 | this.lastTouches.push(lastTouch);
|
4735 |
|
4736 | var removeLastTouch = function removeLastTouch() {
|
4737 | var i = lts.indexOf(lastTouch);
|
4738 |
|
4739 | if (i > -1) {
|
4740 | lts.splice(i, 1);
|
4741 | }
|
4742 | };
|
4743 |
|
4744 | setTimeout(removeLastTouch, DEDUP_TIMEOUT);
|
4745 | }
|
4746 | }
|
4747 |
|
4748 | function recordTouches(eventType, eventData) {
|
4749 | if (eventType & INPUT_START) {
|
4750 | this.primaryTouch = eventData.changedPointers[0].identifier;
|
4751 | setLastTouch.call(this, eventData);
|
4752 | } else if (eventType & (INPUT_END | INPUT_CANCEL)) {
|
4753 | setLastTouch.call(this, eventData);
|
4754 | }
|
4755 | }
|
4756 |
|
4757 | function isSyntheticEvent(eventData) {
|
4758 | var x = eventData.srcEvent.clientX;
|
4759 | var y = eventData.srcEvent.clientY;
|
4760 |
|
4761 | for (var i = 0; i < this.lastTouches.length; i++) {
|
4762 | var t = this.lastTouches[i];
|
4763 | var dx = Math.abs(x - t.x);
|
4764 | var dy = Math.abs(y - t.y);
|
4765 |
|
4766 | if (dx <= DEDUP_DISTANCE && dy <= DEDUP_DISTANCE) {
|
4767 | return true;
|
4768 | }
|
4769 | }
|
4770 |
|
4771 | return false;
|
4772 | }
|
4773 |
|
4774 | var TouchMouseInput =
|
4775 | /*#__PURE__*/
|
4776 | function () {
|
4777 | var TouchMouseInput =
|
4778 | /*#__PURE__*/
|
4779 | function (_Input) {
|
4780 | _inheritsLoose(TouchMouseInput, _Input);
|
4781 |
|
4782 | function TouchMouseInput(_manager, callback) {
|
4783 | var _this;
|
4784 |
|
4785 | _this = _Input.call(this, _manager, callback) || this;
|
4786 |
|
4787 | _this.handler = function (manager, inputEvent, inputData) {
|
4788 | var isTouch = inputData.pointerType === INPUT_TYPE_TOUCH;
|
4789 | var isMouse = inputData.pointerType === INPUT_TYPE_MOUSE;
|
4790 |
|
4791 | if (isMouse && inputData.sourceCapabilities && inputData.sourceCapabilities.firesTouchEvents) {
|
4792 | return;
|
4793 | } // when we're in a touch event, record touches to de-dupe synthetic mouse event
|
4794 |
|
4795 |
|
4796 | if (isTouch) {
|
4797 | recordTouches.call(_assertThisInitialized$1(_assertThisInitialized$1(_this)), inputEvent, inputData);
|
4798 | } else if (isMouse && isSyntheticEvent.call(_assertThisInitialized$1(_assertThisInitialized$1(_this)), inputData)) {
|
4799 | return;
|
4800 | }
|
4801 |
|
4802 | _this.callback(manager, inputEvent, inputData);
|
4803 | };
|
4804 |
|
4805 | _this.touch = new TouchInput(_this.manager, _this.handler);
|
4806 | _this.mouse = new MouseInput(_this.manager, _this.handler);
|
4807 | _this.primaryTouch = null;
|
4808 | _this.lastTouches = [];
|
4809 | return _this;
|
4810 | }
|
4811 | /**
|
4812 | * @private
|
4813 | * handle mouse and touch events
|
4814 | * @param {Hammer} manager
|
4815 | * @param {String} inputEvent
|
4816 | * @param {Object} inputData
|
4817 | */
|
4818 |
|
4819 |
|
4820 | var _proto = TouchMouseInput.prototype;
|
4821 |
|
4822 | /**
|
4823 | * @private
|
4824 | * remove the event listeners
|
4825 | */
|
4826 | _proto.destroy = function destroy() {
|
4827 | this.touch.destroy();
|
4828 | this.mouse.destroy();
|
4829 | };
|
4830 |
|
4831 | return TouchMouseInput;
|
4832 | }(Input);
|
4833 |
|
4834 | return TouchMouseInput;
|
4835 | }();
|
4836 |
|
4837 | /**
|
4838 | * @private
|
4839 | * create new input type manager
|
4840 | * called by the Manager constructor
|
4841 | * @param {Hammer} manager
|
4842 | * @returns {Input}
|
4843 | */
|
4844 |
|
4845 | function createInputInstance(manager) {
|
4846 | var Type; // let inputClass = manager.options.inputClass;
|
4847 |
|
4848 | var inputClass = manager.options.inputClass;
|
4849 |
|
4850 | if (inputClass) {
|
4851 | Type = inputClass;
|
4852 | } else if (SUPPORT_POINTER_EVENTS) {
|
4853 | Type = PointerEventInput;
|
4854 | } else if (SUPPORT_ONLY_TOUCH) {
|
4855 | Type = TouchInput;
|
4856 | } else if (!SUPPORT_TOUCH) {
|
4857 | Type = MouseInput;
|
4858 | } else {
|
4859 | Type = TouchMouseInput;
|
4860 | }
|
4861 |
|
4862 | return new Type(manager, inputHandler);
|
4863 | }
|
4864 |
|
4865 | /**
|
4866 | * @private
|
4867 | * if the argument is an array, we want to execute the fn on each entry
|
4868 | * if it aint an array we don't want to do a thing.
|
4869 | * this is used by all the methods that accept a single and array argument.
|
4870 | * @param {*|Array} arg
|
4871 | * @param {String} fn
|
4872 | * @param {Object} [context]
|
4873 | * @returns {Boolean}
|
4874 | */
|
4875 |
|
4876 | function invokeArrayArg(arg, fn, context) {
|
4877 | if (Array.isArray(arg)) {
|
4878 | each(arg, context[fn], context);
|
4879 | return true;
|
4880 | }
|
4881 |
|
4882 | return false;
|
4883 | }
|
4884 |
|
4885 | var STATE_POSSIBLE = 1;
|
4886 | var STATE_BEGAN = 2;
|
4887 | var STATE_CHANGED = 4;
|
4888 | var STATE_ENDED = 8;
|
4889 | var STATE_RECOGNIZED = STATE_ENDED;
|
4890 | var STATE_CANCELLED = 16;
|
4891 | var STATE_FAILED = 32;
|
4892 |
|
4893 | /**
|
4894 | * @private
|
4895 | * get a unique id
|
4896 | * @returns {number} uniqueId
|
4897 | */
|
4898 | var _uniqueId = 1;
|
4899 | function uniqueId() {
|
4900 | return _uniqueId++;
|
4901 | }
|
4902 |
|
4903 | /**
|
4904 | * @private
|
4905 | * get a recognizer by name if it is bound to a manager
|
4906 | * @param {Recognizer|String} otherRecognizer
|
4907 | * @param {Recognizer} recognizer
|
4908 | * @returns {Recognizer}
|
4909 | */
|
4910 | function getRecognizerByNameIfManager(otherRecognizer, recognizer) {
|
4911 | var manager = recognizer.manager;
|
4912 |
|
4913 | if (manager) {
|
4914 | return manager.get(otherRecognizer);
|
4915 | }
|
4916 |
|
4917 | return otherRecognizer;
|
4918 | }
|
4919 |
|
4920 | /**
|
4921 | * @private
|
4922 | * get a usable string, used as event postfix
|
4923 | * @param {constant} state
|
4924 | * @returns {String} state
|
4925 | */
|
4926 |
|
4927 | function stateStr(state) {
|
4928 | if (state & STATE_CANCELLED) {
|
4929 | return 'cancel';
|
4930 | } else if (state & STATE_ENDED) {
|
4931 | return 'end';
|
4932 | } else if (state & STATE_CHANGED) {
|
4933 | return 'move';
|
4934 | } else if (state & STATE_BEGAN) {
|
4935 | return 'start';
|
4936 | }
|
4937 |
|
4938 | return '';
|
4939 | }
|
4940 |
|
4941 | /**
|
4942 | * @private
|
4943 | * Recognizer flow explained; *
|
4944 | * All recognizers have the initial state of POSSIBLE when a input session starts.
|
4945 | * The definition of a input session is from the first input until the last input, with all it's movement in it. *
|
4946 | * Example session for mouse-input: mousedown -> mousemove -> mouseup
|
4947 | *
|
4948 | * On each recognizing cycle (see Manager.recognize) the .recognize() method is executed
|
4949 | * which determines with state it should be.
|
4950 | *
|
4951 | * If the recognizer has the state FAILED, CANCELLED or RECOGNIZED (equals ENDED), it is reset to
|
4952 | * POSSIBLE to give it another change on the next cycle.
|
4953 | *
|
4954 | * Possible
|
4955 | * |
|
4956 | * +-----+---------------+
|
4957 | * | |
|
4958 | * +-----+-----+ |
|
4959 | * | | |
|
4960 | * Failed Cancelled |
|
4961 | * +-------+------+
|
4962 | * | |
|
4963 | * Recognized Began
|
4964 | * |
|
4965 | * Changed
|
4966 | * |
|
4967 | * Ended/Recognized
|
4968 | */
|
4969 |
|
4970 | /**
|
4971 | * @private
|
4972 | * Recognizer
|
4973 | * Every recognizer needs to extend from this class.
|
4974 | * @constructor
|
4975 | * @param {Object} options
|
4976 | */
|
4977 |
|
4978 | var Recognizer =
|
4979 | /*#__PURE__*/
|
4980 | function () {
|
4981 | function Recognizer(options) {
|
4982 | if (options === void 0) {
|
4983 | options = {};
|
4984 | }
|
4985 |
|
4986 | this.options = _extends({
|
4987 | enable: true
|
4988 | }, options);
|
4989 | this.id = uniqueId();
|
4990 | this.manager = null; // default is enable true
|
4991 |
|
4992 | this.state = STATE_POSSIBLE;
|
4993 | this.simultaneous = {};
|
4994 | this.requireFail = [];
|
4995 | }
|
4996 | /**
|
4997 | * @private
|
4998 | * set options
|
4999 | * @param {Object} options
|
5000 | * @return {Recognizer}
|
5001 | */
|
5002 |
|
5003 |
|
5004 | var _proto = Recognizer.prototype;
|
5005 |
|
5006 | _proto.set = function set(options) {
|
5007 | assign$1$1(this.options, options); // also update the touchAction, in case something changed about the directions/enabled state
|
5008 |
|
5009 | this.manager && this.manager.touchAction.update();
|
5010 | return this;
|
5011 | };
|
5012 | /**
|
5013 | * @private
|
5014 | * recognize simultaneous with an other recognizer.
|
5015 | * @param {Recognizer} otherRecognizer
|
5016 | * @returns {Recognizer} this
|
5017 | */
|
5018 |
|
5019 |
|
5020 | _proto.recognizeWith = function recognizeWith(otherRecognizer) {
|
5021 | if (invokeArrayArg(otherRecognizer, 'recognizeWith', this)) {
|
5022 | return this;
|
5023 | }
|
5024 |
|
5025 | var simultaneous = this.simultaneous;
|
5026 | otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
5027 |
|
5028 | if (!simultaneous[otherRecognizer.id]) {
|
5029 | simultaneous[otherRecognizer.id] = otherRecognizer;
|
5030 | otherRecognizer.recognizeWith(this);
|
5031 | }
|
5032 |
|
5033 | return this;
|
5034 | };
|
5035 | /**
|
5036 | * @private
|
5037 | * drop the simultaneous link. it doesnt remove the link on the other recognizer.
|
5038 | * @param {Recognizer} otherRecognizer
|
5039 | * @returns {Recognizer} this
|
5040 | */
|
5041 |
|
5042 |
|
5043 | _proto.dropRecognizeWith = function dropRecognizeWith(otherRecognizer) {
|
5044 | if (invokeArrayArg(otherRecognizer, 'dropRecognizeWith', this)) {
|
5045 | return this;
|
5046 | }
|
5047 |
|
5048 | otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
5049 | delete this.simultaneous[otherRecognizer.id];
|
5050 | return this;
|
5051 | };
|
5052 | /**
|
5053 | * @private
|
5054 | * recognizer can only run when an other is failing
|
5055 | * @param {Recognizer} otherRecognizer
|
5056 | * @returns {Recognizer} this
|
5057 | */
|
5058 |
|
5059 |
|
5060 | _proto.requireFailure = function requireFailure(otherRecognizer) {
|
5061 | if (invokeArrayArg(otherRecognizer, 'requireFailure', this)) {
|
5062 | return this;
|
5063 | }
|
5064 |
|
5065 | var requireFail = this.requireFail;
|
5066 | otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
5067 |
|
5068 | if (inArray(requireFail, otherRecognizer) === -1) {
|
5069 | requireFail.push(otherRecognizer);
|
5070 | otherRecognizer.requireFailure(this);
|
5071 | }
|
5072 |
|
5073 | return this;
|
5074 | };
|
5075 | /**
|
5076 | * @private
|
5077 | * drop the requireFailure link. it does not remove the link on the other recognizer.
|
5078 | * @param {Recognizer} otherRecognizer
|
5079 | * @returns {Recognizer} this
|
5080 | */
|
5081 |
|
5082 |
|
5083 | _proto.dropRequireFailure = function dropRequireFailure(otherRecognizer) {
|
5084 | if (invokeArrayArg(otherRecognizer, 'dropRequireFailure', this)) {
|
5085 | return this;
|
5086 | }
|
5087 |
|
5088 | otherRecognizer = getRecognizerByNameIfManager(otherRecognizer, this);
|
5089 | var index = inArray(this.requireFail, otherRecognizer);
|
5090 |
|
5091 | if (index > -1) {
|
5092 | this.requireFail.splice(index, 1);
|
5093 | }
|
5094 |
|
5095 | return this;
|
5096 | };
|
5097 | /**
|
5098 | * @private
|
5099 | * has require failures boolean
|
5100 | * @returns {boolean}
|
5101 | */
|
5102 |
|
5103 |
|
5104 | _proto.hasRequireFailures = function hasRequireFailures() {
|
5105 | return this.requireFail.length > 0;
|
5106 | };
|
5107 | /**
|
5108 | * @private
|
5109 | * if the recognizer can recognize simultaneous with an other recognizer
|
5110 | * @param {Recognizer} otherRecognizer
|
5111 | * @returns {Boolean}
|
5112 | */
|
5113 |
|
5114 |
|
5115 | _proto.canRecognizeWith = function canRecognizeWith(otherRecognizer) {
|
5116 | return !!this.simultaneous[otherRecognizer.id];
|
5117 | };
|
5118 | /**
|
5119 | * @private
|
5120 | * You should use `tryEmit` instead of `emit` directly to check
|
5121 | * that all the needed recognizers has failed before emitting.
|
5122 | * @param {Object} input
|
5123 | */
|
5124 |
|
5125 |
|
5126 | _proto.emit = function emit(input) {
|
5127 | var self = this;
|
5128 | var state = this.state;
|
5129 |
|
5130 | function emit(event) {
|
5131 | self.manager.emit(event, input);
|
5132 | } // 'panstart' and 'panmove'
|
5133 |
|
5134 |
|
5135 | if (state < STATE_ENDED) {
|
5136 | emit(self.options.event + stateStr(state));
|
5137 | }
|
5138 |
|
5139 | emit(self.options.event); // simple 'eventName' events
|
5140 |
|
5141 | if (input.additionalEvent) {
|
5142 | // additional event(panleft, panright, pinchin, pinchout...)
|
5143 | emit(input.additionalEvent);
|
5144 | } // panend and pancancel
|
5145 |
|
5146 |
|
5147 | if (state >= STATE_ENDED) {
|
5148 | emit(self.options.event + stateStr(state));
|
5149 | }
|
5150 | };
|
5151 | /**
|
5152 | * @private
|
5153 | * Check that all the require failure recognizers has failed,
|
5154 | * if true, it emits a gesture event,
|
5155 | * otherwise, setup the state to FAILED.
|
5156 | * @param {Object} input
|
5157 | */
|
5158 |
|
5159 |
|
5160 | _proto.tryEmit = function tryEmit(input) {
|
5161 | if (this.canEmit()) {
|
5162 | return this.emit(input);
|
5163 | } // it's failing anyway
|
5164 |
|
5165 |
|
5166 | this.state = STATE_FAILED;
|
5167 | };
|
5168 | /**
|
5169 | * @private
|
5170 | * can we emit?
|
5171 | * @returns {boolean}
|
5172 | */
|
5173 |
|
5174 |
|
5175 | _proto.canEmit = function canEmit() {
|
5176 | var i = 0;
|
5177 |
|
5178 | while (i < this.requireFail.length) {
|
5179 | if (!(this.requireFail[i].state & (STATE_FAILED | STATE_POSSIBLE))) {
|
5180 | return false;
|
5181 | }
|
5182 |
|
5183 | i++;
|
5184 | }
|
5185 |
|
5186 | return true;
|
5187 | };
|
5188 | /**
|
5189 | * @private
|
5190 | * update the recognizer
|
5191 | * @param {Object} inputData
|
5192 | */
|
5193 |
|
5194 |
|
5195 | _proto.recognize = function recognize(inputData) {
|
5196 | // make a new copy of the inputData
|
5197 | // so we can change the inputData without messing up the other recognizers
|
5198 | var inputDataClone = assign$1$1({}, inputData); // is is enabled and allow recognizing?
|
5199 |
|
5200 | if (!boolOrFn(this.options.enable, [this, inputDataClone])) {
|
5201 | this.reset();
|
5202 | this.state = STATE_FAILED;
|
5203 | return;
|
5204 | } // reset when we've reached the end
|
5205 |
|
5206 |
|
5207 | if (this.state & (STATE_RECOGNIZED | STATE_CANCELLED | STATE_FAILED)) {
|
5208 | this.state = STATE_POSSIBLE;
|
5209 | }
|
5210 |
|
5211 | this.state = this.process(inputDataClone); // the recognizer has recognized a gesture
|
5212 | // so trigger an event
|
5213 |
|
5214 | if (this.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED | STATE_CANCELLED)) {
|
5215 | this.tryEmit(inputDataClone);
|
5216 | }
|
5217 | };
|
5218 | /**
|
5219 | * @private
|
5220 | * return the state of the recognizer
|
5221 | * the actual recognizing happens in this method
|
5222 | * @virtual
|
5223 | * @param {Object} inputData
|
5224 | * @returns {constant} STATE
|
5225 | */
|
5226 |
|
5227 | /* jshint ignore:start */
|
5228 |
|
5229 |
|
5230 | _proto.process = function process(inputData) {};
|
5231 | /* jshint ignore:end */
|
5232 |
|
5233 | /**
|
5234 | * @private
|
5235 | * return the preferred touch-action
|
5236 | * @virtual
|
5237 | * @returns {Array}
|
5238 | */
|
5239 |
|
5240 |
|
5241 | _proto.getTouchAction = function getTouchAction() {};
|
5242 | /**
|
5243 | * @private
|
5244 | * called when the gesture isn't allowed to recognize
|
5245 | * like when another is being recognized or it is disabled
|
5246 | * @virtual
|
5247 | */
|
5248 |
|
5249 |
|
5250 | _proto.reset = function reset() {};
|
5251 |
|
5252 | return Recognizer;
|
5253 | }();
|
5254 |
|
5255 | /**
|
5256 | * @private
|
5257 | * A tap is recognized when the pointer is doing a small tap/click. Multiple taps are recognized if they occur
|
5258 | * between the given interval and position. The delay option can be used to recognize multi-taps without firing
|
5259 | * a single tap.
|
5260 | *
|
5261 | * The eventData from the emitted event contains the property `tapCount`, which contains the amount of
|
5262 | * multi-taps being recognized.
|
5263 | * @constructor
|
5264 | * @extends Recognizer
|
5265 | */
|
5266 |
|
5267 | var TapRecognizer =
|
5268 | /*#__PURE__*/
|
5269 | function (_Recognizer) {
|
5270 | _inheritsLoose(TapRecognizer, _Recognizer);
|
5271 |
|
5272 | function TapRecognizer(options) {
|
5273 | var _this;
|
5274 |
|
5275 | if (options === void 0) {
|
5276 | options = {};
|
5277 | }
|
5278 |
|
5279 | _this = _Recognizer.call(this, _extends({
|
5280 | event: 'tap',
|
5281 | pointers: 1,
|
5282 | taps: 1,
|
5283 | interval: 300,
|
5284 | // max time between the multi-tap taps
|
5285 | time: 250,
|
5286 | // max time of the pointer to be down (like finger on the screen)
|
5287 | threshold: 9,
|
5288 | // a minimal movement is ok, but keep it low
|
5289 | posThreshold: 10
|
5290 | }, options)) || this; // previous time and center,
|
5291 | // used for tap counting
|
5292 |
|
5293 | _this.pTime = false;
|
5294 | _this.pCenter = false;
|
5295 | _this._timer = null;
|
5296 | _this._input = null;
|
5297 | _this.count = 0;
|
5298 | return _this;
|
5299 | }
|
5300 |
|
5301 | var _proto = TapRecognizer.prototype;
|
5302 |
|
5303 | _proto.getTouchAction = function getTouchAction() {
|
5304 | return [TOUCH_ACTION_MANIPULATION];
|
5305 | };
|
5306 |
|
5307 | _proto.process = function process(input) {
|
5308 | var _this2 = this;
|
5309 |
|
5310 | var options = this.options;
|
5311 | var validPointers = input.pointers.length === options.pointers;
|
5312 | var validMovement = input.distance < options.threshold;
|
5313 | var validTouchTime = input.deltaTime < options.time;
|
5314 | this.reset();
|
5315 |
|
5316 | if (input.eventType & INPUT_START && this.count === 0) {
|
5317 | return this.failTimeout();
|
5318 | } // we only allow little movement
|
5319 | // and we've reached an end event, so a tap is possible
|
5320 |
|
5321 |
|
5322 | if (validMovement && validTouchTime && validPointers) {
|
5323 | if (input.eventType !== INPUT_END) {
|
5324 | return this.failTimeout();
|
5325 | }
|
5326 |
|
5327 | var validInterval = this.pTime ? input.timeStamp - this.pTime < options.interval : true;
|
5328 | var validMultiTap = !this.pCenter || getDistance(this.pCenter, input.center) < options.posThreshold;
|
5329 | this.pTime = input.timeStamp;
|
5330 | this.pCenter = input.center;
|
5331 |
|
5332 | if (!validMultiTap || !validInterval) {
|
5333 | this.count = 1;
|
5334 | } else {
|
5335 | this.count += 1;
|
5336 | }
|
5337 |
|
5338 | this._input = input; // if tap count matches we have recognized it,
|
5339 | // else it has began recognizing...
|
5340 |
|
5341 | var tapCount = this.count % options.taps;
|
5342 |
|
5343 | if (tapCount === 0) {
|
5344 | // no failing requirements, immediately trigger the tap event
|
5345 | // or wait as long as the multitap interval to trigger
|
5346 | if (!this.hasRequireFailures()) {
|
5347 | return STATE_RECOGNIZED;
|
5348 | } else {
|
5349 | this._timer = setTimeout(function () {
|
5350 | _this2.state = STATE_RECOGNIZED;
|
5351 |
|
5352 | _this2.tryEmit();
|
5353 | }, options.interval);
|
5354 | return STATE_BEGAN;
|
5355 | }
|
5356 | }
|
5357 | }
|
5358 |
|
5359 | return STATE_FAILED;
|
5360 | };
|
5361 |
|
5362 | _proto.failTimeout = function failTimeout() {
|
5363 | var _this3 = this;
|
5364 |
|
5365 | this._timer = setTimeout(function () {
|
5366 | _this3.state = STATE_FAILED;
|
5367 | }, this.options.interval);
|
5368 | return STATE_FAILED;
|
5369 | };
|
5370 |
|
5371 | _proto.reset = function reset() {
|
5372 | clearTimeout(this._timer);
|
5373 | };
|
5374 |
|
5375 | _proto.emit = function emit() {
|
5376 | if (this.state === STATE_RECOGNIZED) {
|
5377 | this._input.tapCount = this.count;
|
5378 | this.manager.emit(this.options.event, this._input);
|
5379 | }
|
5380 | };
|
5381 |
|
5382 | return TapRecognizer;
|
5383 | }(Recognizer);
|
5384 |
|
5385 | /**
|
5386 | * @private
|
5387 | * This recognizer is just used as a base for the simple attribute recognizers.
|
5388 | * @constructor
|
5389 | * @extends Recognizer
|
5390 | */
|
5391 |
|
5392 | var AttrRecognizer =
|
5393 | /*#__PURE__*/
|
5394 | function (_Recognizer) {
|
5395 | _inheritsLoose(AttrRecognizer, _Recognizer);
|
5396 |
|
5397 | function AttrRecognizer(options) {
|
5398 | if (options === void 0) {
|
5399 | options = {};
|
5400 | }
|
5401 |
|
5402 | return _Recognizer.call(this, _extends({
|
5403 | pointers: 1
|
5404 | }, options)) || this;
|
5405 | }
|
5406 | /**
|
5407 | * @private
|
5408 | * Used to check if it the recognizer receives valid input, like input.distance > 10.
|
5409 | * @memberof AttrRecognizer
|
5410 | * @param {Object} input
|
5411 | * @returns {Boolean} recognized
|
5412 | */
|
5413 |
|
5414 |
|
5415 | var _proto = AttrRecognizer.prototype;
|
5416 |
|
5417 | _proto.attrTest = function attrTest(input) {
|
5418 | var optionPointers = this.options.pointers;
|
5419 | return optionPointers === 0 || input.pointers.length === optionPointers;
|
5420 | };
|
5421 | /**
|
5422 | * @private
|
5423 | * Process the input and return the state for the recognizer
|
5424 | * @memberof AttrRecognizer
|
5425 | * @param {Object} input
|
5426 | * @returns {*} State
|
5427 | */
|
5428 |
|
5429 |
|
5430 | _proto.process = function process(input) {
|
5431 | var state = this.state;
|
5432 | var eventType = input.eventType;
|
5433 | var isRecognized = state & (STATE_BEGAN | STATE_CHANGED);
|
5434 | var isValid = this.attrTest(input); // on cancel input and we've recognized before, return STATE_CANCELLED
|
5435 |
|
5436 | if (isRecognized && (eventType & INPUT_CANCEL || !isValid)) {
|
5437 | return state | STATE_CANCELLED;
|
5438 | } else if (isRecognized || isValid) {
|
5439 | if (eventType & INPUT_END) {
|
5440 | return state | STATE_ENDED;
|
5441 | } else if (!(state & STATE_BEGAN)) {
|
5442 | return STATE_BEGAN;
|
5443 | }
|
5444 |
|
5445 | return state | STATE_CHANGED;
|
5446 | }
|
5447 |
|
5448 | return STATE_FAILED;
|
5449 | };
|
5450 |
|
5451 | return AttrRecognizer;
|
5452 | }(Recognizer);
|
5453 |
|
5454 | /**
|
5455 | * @private
|
5456 | * direction cons to string
|
5457 | * @param {constant} direction
|
5458 | * @returns {String}
|
5459 | */
|
5460 |
|
5461 | function directionStr(direction) {
|
5462 | if (direction === DIRECTION_DOWN) {
|
5463 | return 'down';
|
5464 | } else if (direction === DIRECTION_UP) {
|
5465 | return 'up';
|
5466 | } else if (direction === DIRECTION_LEFT) {
|
5467 | return 'left';
|
5468 | } else if (direction === DIRECTION_RIGHT) {
|
5469 | return 'right';
|
5470 | }
|
5471 |
|
5472 | return '';
|
5473 | }
|
5474 |
|
5475 | /**
|
5476 | * @private
|
5477 | * Pan
|
5478 | * Recognized when the pointer is down and moved in the allowed direction.
|
5479 | * @constructor
|
5480 | * @extends AttrRecognizer
|
5481 | */
|
5482 |
|
5483 | var PanRecognizer =
|
5484 | /*#__PURE__*/
|
5485 | function (_AttrRecognizer) {
|
5486 | _inheritsLoose(PanRecognizer, _AttrRecognizer);
|
5487 |
|
5488 | function PanRecognizer(options) {
|
5489 | var _this;
|
5490 |
|
5491 | if (options === void 0) {
|
5492 | options = {};
|
5493 | }
|
5494 |
|
5495 | _this = _AttrRecognizer.call(this, _extends({
|
5496 | event: 'pan',
|
5497 | threshold: 10,
|
5498 | pointers: 1,
|
5499 | direction: DIRECTION_ALL
|
5500 | }, options)) || this;
|
5501 | _this.pX = null;
|
5502 | _this.pY = null;
|
5503 | return _this;
|
5504 | }
|
5505 |
|
5506 | var _proto = PanRecognizer.prototype;
|
5507 |
|
5508 | _proto.getTouchAction = function getTouchAction() {
|
5509 | var direction = this.options.direction;
|
5510 | var actions = [];
|
5511 |
|
5512 | if (direction & DIRECTION_HORIZONTAL) {
|
5513 | actions.push(TOUCH_ACTION_PAN_Y);
|
5514 | }
|
5515 |
|
5516 | if (direction & DIRECTION_VERTICAL) {
|
5517 | actions.push(TOUCH_ACTION_PAN_X);
|
5518 | }
|
5519 |
|
5520 | return actions;
|
5521 | };
|
5522 |
|
5523 | _proto.directionTest = function directionTest(input) {
|
5524 | var options = this.options;
|
5525 | var hasMoved = true;
|
5526 | var distance = input.distance;
|
5527 | var direction = input.direction;
|
5528 | var x = input.deltaX;
|
5529 | var y = input.deltaY; // lock to axis?
|
5530 |
|
5531 | if (!(direction & options.direction)) {
|
5532 | if (options.direction & DIRECTION_HORIZONTAL) {
|
5533 | direction = x === 0 ? DIRECTION_NONE : x < 0 ? DIRECTION_LEFT : DIRECTION_RIGHT;
|
5534 | hasMoved = x !== this.pX;
|
5535 | distance = Math.abs(input.deltaX);
|
5536 | } else {
|
5537 | direction = y === 0 ? DIRECTION_NONE : y < 0 ? DIRECTION_UP : DIRECTION_DOWN;
|
5538 | hasMoved = y !== this.pY;
|
5539 | distance = Math.abs(input.deltaY);
|
5540 | }
|
5541 | }
|
5542 |
|
5543 | input.direction = direction;
|
5544 | return hasMoved && distance > options.threshold && direction & options.direction;
|
5545 | };
|
5546 |
|
5547 | _proto.attrTest = function attrTest(input) {
|
5548 | return AttrRecognizer.prototype.attrTest.call(this, input) && ( // replace with a super call
|
5549 | this.state & STATE_BEGAN || !(this.state & STATE_BEGAN) && this.directionTest(input));
|
5550 | };
|
5551 |
|
5552 | _proto.emit = function emit(input) {
|
5553 | this.pX = input.deltaX;
|
5554 | this.pY = input.deltaY;
|
5555 | var direction = directionStr(input.direction);
|
5556 |
|
5557 | if (direction) {
|
5558 | input.additionalEvent = this.options.event + direction;
|
5559 | }
|
5560 |
|
5561 | _AttrRecognizer.prototype.emit.call(this, input);
|
5562 | };
|
5563 |
|
5564 | return PanRecognizer;
|
5565 | }(AttrRecognizer);
|
5566 |
|
5567 | /**
|
5568 | * @private
|
5569 | * Swipe
|
5570 | * Recognized when the pointer is moving fast (velocity), with enough distance in the allowed direction.
|
5571 | * @constructor
|
5572 | * @extends AttrRecognizer
|
5573 | */
|
5574 |
|
5575 | var SwipeRecognizer =
|
5576 | /*#__PURE__*/
|
5577 | function (_AttrRecognizer) {
|
5578 | _inheritsLoose(SwipeRecognizer, _AttrRecognizer);
|
5579 |
|
5580 | function SwipeRecognizer(options) {
|
5581 | if (options === void 0) {
|
5582 | options = {};
|
5583 | }
|
5584 |
|
5585 | return _AttrRecognizer.call(this, _extends({
|
5586 | event: 'swipe',
|
5587 | threshold: 10,
|
5588 | velocity: 0.3,
|
5589 | direction: DIRECTION_HORIZONTAL | DIRECTION_VERTICAL,
|
5590 | pointers: 1
|
5591 | }, options)) || this;
|
5592 | }
|
5593 |
|
5594 | var _proto = SwipeRecognizer.prototype;
|
5595 |
|
5596 | _proto.getTouchAction = function getTouchAction() {
|
5597 | return PanRecognizer.prototype.getTouchAction.call(this);
|
5598 | };
|
5599 |
|
5600 | _proto.attrTest = function attrTest(input) {
|
5601 | var direction = this.options.direction;
|
5602 | var velocity;
|
5603 |
|
5604 | if (direction & (DIRECTION_HORIZONTAL | DIRECTION_VERTICAL)) {
|
5605 | velocity = input.overallVelocity;
|
5606 | } else if (direction & DIRECTION_HORIZONTAL) {
|
5607 | velocity = input.overallVelocityX;
|
5608 | } else if (direction & DIRECTION_VERTICAL) {
|
5609 | velocity = input.overallVelocityY;
|
5610 | }
|
5611 |
|
5612 | 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;
|
5613 | };
|
5614 |
|
5615 | _proto.emit = function emit(input) {
|
5616 | var direction = directionStr(input.offsetDirection);
|
5617 |
|
5618 | if (direction) {
|
5619 | this.manager.emit(this.options.event + direction, input);
|
5620 | }
|
5621 |
|
5622 | this.manager.emit(this.options.event, input);
|
5623 | };
|
5624 |
|
5625 | return SwipeRecognizer;
|
5626 | }(AttrRecognizer);
|
5627 |
|
5628 | /**
|
5629 | * @private
|
5630 | * Pinch
|
5631 | * Recognized when two or more pointers are moving toward (zoom-in) or away from each other (zoom-out).
|
5632 | * @constructor
|
5633 | * @extends AttrRecognizer
|
5634 | */
|
5635 |
|
5636 | var PinchRecognizer =
|
5637 | /*#__PURE__*/
|
5638 | function (_AttrRecognizer) {
|
5639 | _inheritsLoose(PinchRecognizer, _AttrRecognizer);
|
5640 |
|
5641 | function PinchRecognizer(options) {
|
5642 | if (options === void 0) {
|
5643 | options = {};
|
5644 | }
|
5645 |
|
5646 | return _AttrRecognizer.call(this, _extends({
|
5647 | event: 'pinch',
|
5648 | threshold: 0,
|
5649 | pointers: 2
|
5650 | }, options)) || this;
|
5651 | }
|
5652 |
|
5653 | var _proto = PinchRecognizer.prototype;
|
5654 |
|
5655 | _proto.getTouchAction = function getTouchAction() {
|
5656 | return [TOUCH_ACTION_NONE];
|
5657 | };
|
5658 |
|
5659 | _proto.attrTest = function attrTest(input) {
|
5660 | return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.scale - 1) > this.options.threshold || this.state & STATE_BEGAN);
|
5661 | };
|
5662 |
|
5663 | _proto.emit = function emit(input) {
|
5664 | if (input.scale !== 1) {
|
5665 | var inOut = input.scale < 1 ? 'in' : 'out';
|
5666 | input.additionalEvent = this.options.event + inOut;
|
5667 | }
|
5668 |
|
5669 | _AttrRecognizer.prototype.emit.call(this, input);
|
5670 | };
|
5671 |
|
5672 | return PinchRecognizer;
|
5673 | }(AttrRecognizer);
|
5674 |
|
5675 | /**
|
5676 | * @private
|
5677 | * Rotate
|
5678 | * Recognized when two or more pointer are moving in a circular motion.
|
5679 | * @constructor
|
5680 | * @extends AttrRecognizer
|
5681 | */
|
5682 |
|
5683 | var RotateRecognizer =
|
5684 | /*#__PURE__*/
|
5685 | function (_AttrRecognizer) {
|
5686 | _inheritsLoose(RotateRecognizer, _AttrRecognizer);
|
5687 |
|
5688 | function RotateRecognizer(options) {
|
5689 | if (options === void 0) {
|
5690 | options = {};
|
5691 | }
|
5692 |
|
5693 | return _AttrRecognizer.call(this, _extends({
|
5694 | event: 'rotate',
|
5695 | threshold: 0,
|
5696 | pointers: 2
|
5697 | }, options)) || this;
|
5698 | }
|
5699 |
|
5700 | var _proto = RotateRecognizer.prototype;
|
5701 |
|
5702 | _proto.getTouchAction = function getTouchAction() {
|
5703 | return [TOUCH_ACTION_NONE];
|
5704 | };
|
5705 |
|
5706 | _proto.attrTest = function attrTest(input) {
|
5707 | return _AttrRecognizer.prototype.attrTest.call(this, input) && (Math.abs(input.rotation) > this.options.threshold || this.state & STATE_BEGAN);
|
5708 | };
|
5709 |
|
5710 | return RotateRecognizer;
|
5711 | }(AttrRecognizer);
|
5712 |
|
5713 | /**
|
5714 | * @private
|
5715 | * Press
|
5716 | * Recognized when the pointer is down for x ms without any movement.
|
5717 | * @constructor
|
5718 | * @extends Recognizer
|
5719 | */
|
5720 |
|
5721 | var PressRecognizer =
|
5722 | /*#__PURE__*/
|
5723 | function (_Recognizer) {
|
5724 | _inheritsLoose(PressRecognizer, _Recognizer);
|
5725 |
|
5726 | function PressRecognizer(options) {
|
5727 | var _this;
|
5728 |
|
5729 | if (options === void 0) {
|
5730 | options = {};
|
5731 | }
|
5732 |
|
5733 | _this = _Recognizer.call(this, _extends({
|
5734 | event: 'press',
|
5735 | pointers: 1,
|
5736 | time: 251,
|
5737 | // minimal time of the pointer to be pressed
|
5738 | threshold: 9
|
5739 | }, options)) || this;
|
5740 | _this._timer = null;
|
5741 | _this._input = null;
|
5742 | return _this;
|
5743 | }
|
5744 |
|
5745 | var _proto = PressRecognizer.prototype;
|
5746 |
|
5747 | _proto.getTouchAction = function getTouchAction() {
|
5748 | return [TOUCH_ACTION_AUTO];
|
5749 | };
|
5750 |
|
5751 | _proto.process = function process(input) {
|
5752 | var _this2 = this;
|
5753 |
|
5754 | var options = this.options;
|
5755 | var validPointers = input.pointers.length === options.pointers;
|
5756 | var validMovement = input.distance < options.threshold;
|
5757 | var validTime = input.deltaTime > options.time;
|
5758 | this._input = input; // we only allow little movement
|
5759 | // and we've reached an end event, so a tap is possible
|
5760 |
|
5761 | if (!validMovement || !validPointers || input.eventType & (INPUT_END | INPUT_CANCEL) && !validTime) {
|
5762 | this.reset();
|
5763 | } else if (input.eventType & INPUT_START) {
|
5764 | this.reset();
|
5765 | this._timer = setTimeout(function () {
|
5766 | _this2.state = STATE_RECOGNIZED;
|
5767 |
|
5768 | _this2.tryEmit();
|
5769 | }, options.time);
|
5770 | } else if (input.eventType & INPUT_END) {
|
5771 | return STATE_RECOGNIZED;
|
5772 | }
|
5773 |
|
5774 | return STATE_FAILED;
|
5775 | };
|
5776 |
|
5777 | _proto.reset = function reset() {
|
5778 | clearTimeout(this._timer);
|
5779 | };
|
5780 |
|
5781 | _proto.emit = function emit(input) {
|
5782 | if (this.state !== STATE_RECOGNIZED) {
|
5783 | return;
|
5784 | }
|
5785 |
|
5786 | if (input && input.eventType & INPUT_END) {
|
5787 | this.manager.emit(this.options.event + "up", input);
|
5788 | } else {
|
5789 | this._input.timeStamp = now();
|
5790 | this.manager.emit(this.options.event, this._input);
|
5791 | }
|
5792 | };
|
5793 |
|
5794 | return PressRecognizer;
|
5795 | }(Recognizer);
|
5796 |
|
5797 | var defaults = {
|
5798 | /**
|
5799 | * @private
|
5800 | * set if DOM events are being triggered.
|
5801 | * But this is slower and unused by simple implementations, so disabled by default.
|
5802 | * @type {Boolean}
|
5803 | * @default false
|
5804 | */
|
5805 | domEvents: false,
|
5806 |
|
5807 | /**
|
5808 | * @private
|
5809 | * The value for the touchAction property/fallback.
|
5810 | * When set to `compute` it will magically set the correct value based on the added recognizers.
|
5811 | * @type {String}
|
5812 | * @default compute
|
5813 | */
|
5814 | touchAction: TOUCH_ACTION_COMPUTE,
|
5815 |
|
5816 | /**
|
5817 | * @private
|
5818 | * @type {Boolean}
|
5819 | * @default true
|
5820 | */
|
5821 | enable: true,
|
5822 |
|
5823 | /**
|
5824 | * @private
|
5825 | * EXPERIMENTAL FEATURE -- can be removed/changed
|
5826 | * Change the parent input target element.
|
5827 | * If Null, then it is being set the to main element.
|
5828 | * @type {Null|EventTarget}
|
5829 | * @default null
|
5830 | */
|
5831 | inputTarget: null,
|
5832 |
|
5833 | /**
|
5834 | * @private
|
5835 | * force an input class
|
5836 | * @type {Null|Function}
|
5837 | * @default null
|
5838 | */
|
5839 | inputClass: null,
|
5840 |
|
5841 | /**
|
5842 | * @private
|
5843 | * Some CSS properties can be used to improve the working of Hammer.
|
5844 | * Add them to this method and they will be set when creating a new Manager.
|
5845 | * @namespace
|
5846 | */
|
5847 | cssProps: {
|
5848 | /**
|
5849 | * @private
|
5850 | * Disables text selection to improve the dragging gesture. Mainly for desktop browsers.
|
5851 | * @type {String}
|
5852 | * @default 'none'
|
5853 | */
|
5854 | userSelect: "none",
|
5855 |
|
5856 | /**
|
5857 | * @private
|
5858 | * Disable the Windows Phone grippers when pressing an element.
|
5859 | * @type {String}
|
5860 | * @default 'none'
|
5861 | */
|
5862 | touchSelect: "none",
|
5863 |
|
5864 | /**
|
5865 | * @private
|
5866 | * Disables the default callout shown when you touch and hold a touch target.
|
5867 | * On iOS, when you touch and hold a touch target such as a link, Safari displays
|
5868 | * a callout containing information about the link. This property allows you to disable that callout.
|
5869 | * @type {String}
|
5870 | * @default 'none'
|
5871 | */
|
5872 | touchCallout: "none",
|
5873 |
|
5874 | /**
|
5875 | * @private
|
5876 | * Specifies whether zooming is enabled. Used by IE10>
|
5877 | * @type {String}
|
5878 | * @default 'none'
|
5879 | */
|
5880 | contentZooming: "none",
|
5881 |
|
5882 | /**
|
5883 | * @private
|
5884 | * Specifies that an entire element should be draggable instead of its contents. Mainly for desktop browsers.
|
5885 | * @type {String}
|
5886 | * @default 'none'
|
5887 | */
|
5888 | userDrag: "none",
|
5889 |
|
5890 | /**
|
5891 | * @private
|
5892 | * Overrides the highlight color shown when the user taps a link or a JavaScript
|
5893 | * clickable element in iOS. This property obeys the alpha value, if specified.
|
5894 | * @type {String}
|
5895 | * @default 'rgba(0,0,0,0)'
|
5896 | */
|
5897 | tapHighlightColor: "rgba(0,0,0,0)"
|
5898 | }
|
5899 | };
|
5900 | /**
|
5901 | * @private
|
5902 | * Default recognizer setup when calling `Hammer()`
|
5903 | * When creating a new Manager these will be skipped.
|
5904 | * This is separated with other defaults because of tree-shaking.
|
5905 | * @type {Array}
|
5906 | */
|
5907 |
|
5908 | var preset = [[RotateRecognizer, {
|
5909 | enable: false
|
5910 | }], [PinchRecognizer, {
|
5911 | enable: false
|
5912 | }, ['rotate']], [SwipeRecognizer, {
|
5913 | direction: DIRECTION_HORIZONTAL
|
5914 | }], [PanRecognizer, {
|
5915 | direction: DIRECTION_HORIZONTAL
|
5916 | }, ['swipe']], [TapRecognizer], [TapRecognizer, {
|
5917 | event: 'doubletap',
|
5918 | taps: 2
|
5919 | }, ['tap']], [PressRecognizer]];
|
5920 |
|
5921 | var STOP = 1;
|
5922 | var FORCED_STOP = 2;
|
5923 | /**
|
5924 | * @private
|
5925 | * add/remove the css properties as defined in manager.options.cssProps
|
5926 | * @param {Manager} manager
|
5927 | * @param {Boolean} add
|
5928 | */
|
5929 |
|
5930 | function toggleCssProps(manager, add) {
|
5931 | var element = manager.element;
|
5932 |
|
5933 | if (!element.style) {
|
5934 | return;
|
5935 | }
|
5936 |
|
5937 | var prop;
|
5938 | each(manager.options.cssProps, function (value, name) {
|
5939 | prop = prefixed(element.style, name);
|
5940 |
|
5941 | if (add) {
|
5942 | manager.oldCssProps[prop] = element.style[prop];
|
5943 | element.style[prop] = value;
|
5944 | } else {
|
5945 | element.style[prop] = manager.oldCssProps[prop] || "";
|
5946 | }
|
5947 | });
|
5948 |
|
5949 | if (!add) {
|
5950 | manager.oldCssProps = {};
|
5951 | }
|
5952 | }
|
5953 | /**
|
5954 | * @private
|
5955 | * trigger dom event
|
5956 | * @param {String} event
|
5957 | * @param {Object} data
|
5958 | */
|
5959 |
|
5960 |
|
5961 | function triggerDomEvent(event, data) {
|
5962 | var gestureEvent = document.createEvent("Event");
|
5963 | gestureEvent.initEvent(event, true, true);
|
5964 | gestureEvent.gesture = data;
|
5965 | data.target.dispatchEvent(gestureEvent);
|
5966 | }
|
5967 | /**
|
5968 | * @private
|
5969 | * Manager
|
5970 | * @param {HTMLElement} element
|
5971 | * @param {Object} [options]
|
5972 | * @constructor
|
5973 | */
|
5974 |
|
5975 |
|
5976 | var Manager =
|
5977 | /*#__PURE__*/
|
5978 | function () {
|
5979 | function Manager(element, options) {
|
5980 | var _this = this;
|
5981 |
|
5982 | this.options = assign$1$1({}, defaults, options || {});
|
5983 | this.options.inputTarget = this.options.inputTarget || element;
|
5984 | this.handlers = {};
|
5985 | this.session = {};
|
5986 | this.recognizers = [];
|
5987 | this.oldCssProps = {};
|
5988 | this.element = element;
|
5989 | this.input = createInputInstance(this);
|
5990 | this.touchAction = new TouchAction(this, this.options.touchAction);
|
5991 | toggleCssProps(this, true);
|
5992 | each(this.options.recognizers, function (item) {
|
5993 | var recognizer = _this.add(new item[0](item[1]));
|
5994 |
|
5995 | item[2] && recognizer.recognizeWith(item[2]);
|
5996 | item[3] && recognizer.requireFailure(item[3]);
|
5997 | }, this);
|
5998 | }
|
5999 | /**
|
6000 | * @private
|
6001 | * set options
|
6002 | * @param {Object} options
|
6003 | * @returns {Manager}
|
6004 | */
|
6005 |
|
6006 |
|
6007 | var _proto = Manager.prototype;
|
6008 |
|
6009 | _proto.set = function set(options) {
|
6010 | assign$1$1(this.options, options); // Options that need a little more setup
|
6011 |
|
6012 | if (options.touchAction) {
|
6013 | this.touchAction.update();
|
6014 | }
|
6015 |
|
6016 | if (options.inputTarget) {
|
6017 | // Clean up existing event listeners and reinitialize
|
6018 | this.input.destroy();
|
6019 | this.input.target = options.inputTarget;
|
6020 | this.input.init();
|
6021 | }
|
6022 |
|
6023 | return this;
|
6024 | };
|
6025 | /**
|
6026 | * @private
|
6027 | * stop recognizing for this session.
|
6028 | * This session will be discarded, when a new [input]start event is fired.
|
6029 | * When forced, the recognizer cycle is stopped immediately.
|
6030 | * @param {Boolean} [force]
|
6031 | */
|
6032 |
|
6033 |
|
6034 | _proto.stop = function stop(force) {
|
6035 | this.session.stopped = force ? FORCED_STOP : STOP;
|
6036 | };
|
6037 | /**
|
6038 | * @private
|
6039 | * run the recognizers!
|
6040 | * called by the inputHandler function on every movement of the pointers (touches)
|
6041 | * it walks through all the recognizers and tries to detect the gesture that is being made
|
6042 | * @param {Object} inputData
|
6043 | */
|
6044 |
|
6045 |
|
6046 | _proto.recognize = function recognize(inputData) {
|
6047 | var session = this.session;
|
6048 |
|
6049 | if (session.stopped) {
|
6050 | return;
|
6051 | } // run the touch-action polyfill
|
6052 |
|
6053 |
|
6054 | this.touchAction.preventDefaults(inputData);
|
6055 | var recognizer;
|
6056 | var recognizers = this.recognizers; // this holds the recognizer that is being recognized.
|
6057 | // so the recognizer's state needs to be BEGAN, CHANGED, ENDED or RECOGNIZED
|
6058 | // if no recognizer is detecting a thing, it is set to `null`
|
6059 |
|
6060 | var curRecognizer = session.curRecognizer; // reset when the last recognizer is recognized
|
6061 | // or when we're in a new session
|
6062 |
|
6063 | if (!curRecognizer || curRecognizer && curRecognizer.state & STATE_RECOGNIZED) {
|
6064 | session.curRecognizer = null;
|
6065 | curRecognizer = null;
|
6066 | }
|
6067 |
|
6068 | var i = 0;
|
6069 |
|
6070 | while (i < recognizers.length) {
|
6071 | recognizer = recognizers[i]; // find out if we are allowed try to recognize the input for this one.
|
6072 | // 1. allow if the session is NOT forced stopped (see the .stop() method)
|
6073 | // 2. allow if we still haven't recognized a gesture in this session, or the this recognizer is the one
|
6074 | // that is being recognized.
|
6075 | // 3. allow if the recognizer is allowed to run simultaneous with the current recognized recognizer.
|
6076 | // this can be setup with the `recognizeWith()` method on the recognizer.
|
6077 |
|
6078 | if (session.stopped !== FORCED_STOP && ( // 1
|
6079 | !curRecognizer || recognizer === curRecognizer || // 2
|
6080 | recognizer.canRecognizeWith(curRecognizer))) {
|
6081 | // 3
|
6082 | recognizer.recognize(inputData);
|
6083 | } else {
|
6084 | recognizer.reset();
|
6085 | } // if the recognizer has been recognizing the input as a valid gesture, we want to store this one as the
|
6086 | // current active recognizer. but only if we don't already have an active recognizer
|
6087 |
|
6088 |
|
6089 | if (!curRecognizer && recognizer.state & (STATE_BEGAN | STATE_CHANGED | STATE_ENDED)) {
|
6090 | session.curRecognizer = recognizer;
|
6091 | curRecognizer = recognizer;
|
6092 | }
|
6093 |
|
6094 | i++;
|
6095 | }
|
6096 | };
|
6097 | /**
|
6098 | * @private
|
6099 | * get a recognizer by its event name.
|
6100 | * @param {Recognizer|String} recognizer
|
6101 | * @returns {Recognizer|Null}
|
6102 | */
|
6103 |
|
6104 |
|
6105 | _proto.get = function get(recognizer) {
|
6106 | if (recognizer instanceof Recognizer) {
|
6107 | return recognizer;
|
6108 | }
|
6109 |
|
6110 | var recognizers = this.recognizers;
|
6111 |
|
6112 | for (var i = 0; i < recognizers.length; i++) {
|
6113 | if (recognizers[i].options.event === recognizer) {
|
6114 | return recognizers[i];
|
6115 | }
|
6116 | }
|
6117 |
|
6118 | return null;
|
6119 | };
|
6120 | /**
|
6121 | * @private add a recognizer to the manager
|
6122 | * existing recognizers with the same event name will be removed
|
6123 | * @param {Recognizer} recognizer
|
6124 | * @returns {Recognizer|Manager}
|
6125 | */
|
6126 |
|
6127 |
|
6128 | _proto.add = function add(recognizer) {
|
6129 | if (invokeArrayArg(recognizer, "add", this)) {
|
6130 | return this;
|
6131 | } // remove existing
|
6132 |
|
6133 |
|
6134 | var existing = this.get(recognizer.options.event);
|
6135 |
|
6136 | if (existing) {
|
6137 | this.remove(existing);
|
6138 | }
|
6139 |
|
6140 | this.recognizers.push(recognizer);
|
6141 | recognizer.manager = this;
|
6142 | this.touchAction.update();
|
6143 | return recognizer;
|
6144 | };
|
6145 | /**
|
6146 | * @private
|
6147 | * remove a recognizer by name or instance
|
6148 | * @param {Recognizer|String} recognizer
|
6149 | * @returns {Manager}
|
6150 | */
|
6151 |
|
6152 |
|
6153 | _proto.remove = function remove(recognizer) {
|
6154 | if (invokeArrayArg(recognizer, "remove", this)) {
|
6155 | return this;
|
6156 | }
|
6157 |
|
6158 | var targetRecognizer = this.get(recognizer); // let's make sure this recognizer exists
|
6159 |
|
6160 | if (recognizer) {
|
6161 | var recognizers = this.recognizers;
|
6162 | var index = inArray(recognizers, targetRecognizer);
|
6163 |
|
6164 | if (index !== -1) {
|
6165 | recognizers.splice(index, 1);
|
6166 | this.touchAction.update();
|
6167 | }
|
6168 | }
|
6169 |
|
6170 | return this;
|
6171 | };
|
6172 | /**
|
6173 | * @private
|
6174 | * bind event
|
6175 | * @param {String} events
|
6176 | * @param {Function} handler
|
6177 | * @returns {EventEmitter} this
|
6178 | */
|
6179 |
|
6180 |
|
6181 | _proto.on = function on(events, handler) {
|
6182 | if (events === undefined || handler === undefined) {
|
6183 | return this;
|
6184 | }
|
6185 |
|
6186 | var handlers = this.handlers;
|
6187 | each(splitStr(events), function (event) {
|
6188 | handlers[event] = handlers[event] || [];
|
6189 | handlers[event].push(handler);
|
6190 | });
|
6191 | return this;
|
6192 | };
|
6193 | /**
|
6194 | * @private unbind event, leave emit blank to remove all handlers
|
6195 | * @param {String} events
|
6196 | * @param {Function} [handler]
|
6197 | * @returns {EventEmitter} this
|
6198 | */
|
6199 |
|
6200 |
|
6201 | _proto.off = function off(events, handler) {
|
6202 | if (events === undefined) {
|
6203 | return this;
|
6204 | }
|
6205 |
|
6206 | var handlers = this.handlers;
|
6207 | each(splitStr(events), function (event) {
|
6208 | if (!handler) {
|
6209 | delete handlers[event];
|
6210 | } else {
|
6211 | handlers[event] && handlers[event].splice(inArray(handlers[event], handler), 1);
|
6212 | }
|
6213 | });
|
6214 | return this;
|
6215 | };
|
6216 | /**
|
6217 | * @private emit event to the listeners
|
6218 | * @param {String} event
|
6219 | * @param {Object} data
|
6220 | */
|
6221 |
|
6222 |
|
6223 | _proto.emit = function emit(event, data) {
|
6224 | // we also want to trigger dom events
|
6225 | if (this.options.domEvents) {
|
6226 | triggerDomEvent(event, data);
|
6227 | } // no handlers, so skip it all
|
6228 |
|
6229 |
|
6230 | var handlers = this.handlers[event] && this.handlers[event].slice();
|
6231 |
|
6232 | if (!handlers || !handlers.length) {
|
6233 | return;
|
6234 | }
|
6235 |
|
6236 | data.type = event;
|
6237 |
|
6238 | data.preventDefault = function () {
|
6239 | data.srcEvent.preventDefault();
|
6240 | };
|
6241 |
|
6242 | var i = 0;
|
6243 |
|
6244 | while (i < handlers.length) {
|
6245 | handlers[i](data);
|
6246 | i++;
|
6247 | }
|
6248 | };
|
6249 | /**
|
6250 | * @private
|
6251 | * destroy the manager and unbinds all events
|
6252 | * it doesn't unbind dom events, that is the user own responsibility
|
6253 | */
|
6254 |
|
6255 |
|
6256 | _proto.destroy = function destroy() {
|
6257 | this.element && toggleCssProps(this, false);
|
6258 | this.handlers = {};
|
6259 | this.session = {};
|
6260 | this.input.destroy();
|
6261 | this.element = null;
|
6262 | };
|
6263 |
|
6264 | return Manager;
|
6265 | }();
|
6266 |
|
6267 | var SINGLE_TOUCH_INPUT_MAP = {
|
6268 | touchstart: INPUT_START,
|
6269 | touchmove: INPUT_MOVE,
|
6270 | touchend: INPUT_END,
|
6271 | touchcancel: INPUT_CANCEL
|
6272 | };
|
6273 | var SINGLE_TOUCH_TARGET_EVENTS = 'touchstart';
|
6274 | var SINGLE_TOUCH_WINDOW_EVENTS = 'touchstart touchmove touchend touchcancel';
|
6275 | /**
|
6276 | * @private
|
6277 | * Touch events input
|
6278 | * @constructor
|
6279 | * @extends Input
|
6280 | */
|
6281 |
|
6282 | var SingleTouchInput =
|
6283 | /*#__PURE__*/
|
6284 | function (_Input) {
|
6285 | _inheritsLoose(SingleTouchInput, _Input);
|
6286 |
|
6287 | function SingleTouchInput() {
|
6288 | var _this;
|
6289 |
|
6290 | var proto = SingleTouchInput.prototype;
|
6291 | proto.evTarget = SINGLE_TOUCH_TARGET_EVENTS;
|
6292 | proto.evWin = SINGLE_TOUCH_WINDOW_EVENTS;
|
6293 | _this = _Input.apply(this, arguments) || this;
|
6294 | _this.started = false;
|
6295 | return _this;
|
6296 | }
|
6297 |
|
6298 | var _proto = SingleTouchInput.prototype;
|
6299 |
|
6300 | _proto.handler = function handler(ev) {
|
6301 | var type = SINGLE_TOUCH_INPUT_MAP[ev.type]; // should we handle the touch events?
|
6302 |
|
6303 | if (type === INPUT_START) {
|
6304 | this.started = true;
|
6305 | }
|
6306 |
|
6307 | if (!this.started) {
|
6308 | return;
|
6309 | }
|
6310 |
|
6311 | var touches = normalizeSingleTouches.call(this, ev, type); // when done, reset the started state
|
6312 |
|
6313 | if (type & (INPUT_END | INPUT_CANCEL) && touches[0].length - touches[1].length === 0) {
|
6314 | this.started = false;
|
6315 | }
|
6316 |
|
6317 | this.callback(this.manager, type, {
|
6318 | pointers: touches[0],
|
6319 | changedPointers: touches[1],
|
6320 | pointerType: INPUT_TYPE_TOUCH,
|
6321 | srcEvent: ev
|
6322 | });
|
6323 | };
|
6324 |
|
6325 | return SingleTouchInput;
|
6326 | }(Input);
|
6327 |
|
6328 | function normalizeSingleTouches(ev, type) {
|
6329 | var all = toArray(ev.touches);
|
6330 | var changed = toArray(ev.changedTouches);
|
6331 |
|
6332 | if (type & (INPUT_END | INPUT_CANCEL)) {
|
6333 | all = uniqueArray(all.concat(changed), 'identifier', true);
|
6334 | }
|
6335 |
|
6336 | return [all, changed];
|
6337 | }
|
6338 |
|
6339 | /**
|
6340 | * @private
|
6341 | * wrap a method with a deprecation warning and stack trace
|
6342 | * @param {Function} method
|
6343 | * @param {String} name
|
6344 | * @param {String} message
|
6345 | * @returns {Function} A new function wrapping the supplied method.
|
6346 | */
|
6347 | function deprecate(method, name, message) {
|
6348 | var deprecationMessage = "DEPRECATED METHOD: " + name + "\n" + message + " AT \n";
|
6349 | return function () {
|
6350 | var e = new Error('get-stack-trace');
|
6351 | var stack = e && e.stack ? e.stack.replace(/^[^\(]+?[\n$]/gm, '').replace(/^\s+at\s+/gm, '').replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') : 'Unknown Stack Trace';
|
6352 | var log = window.console && (window.console.warn || window.console.log);
|
6353 |
|
6354 | if (log) {
|
6355 | log.call(window.console, deprecationMessage, stack);
|
6356 | }
|
6357 |
|
6358 | return method.apply(this, arguments);
|
6359 | };
|
6360 | }
|
6361 |
|
6362 | /**
|
6363 | * @private
|
6364 | * extend object.
|
6365 | * means that properties in dest will be overwritten by the ones in src.
|
6366 | * @param {Object} dest
|
6367 | * @param {Object} src
|
6368 | * @param {Boolean} [merge=false]
|
6369 | * @returns {Object} dest
|
6370 | */
|
6371 |
|
6372 | var extend = deprecate(function (dest, src, merge) {
|
6373 | var keys = Object.keys(src);
|
6374 | var i = 0;
|
6375 |
|
6376 | while (i < keys.length) {
|
6377 | if (!merge || merge && dest[keys[i]] === undefined) {
|
6378 | dest[keys[i]] = src[keys[i]];
|
6379 | }
|
6380 |
|
6381 | i++;
|
6382 | }
|
6383 |
|
6384 | return dest;
|
6385 | }, 'extend', 'Use `assign`.');
|
6386 |
|
6387 | /**
|
6388 | * @private
|
6389 | * merge the values from src in the dest.
|
6390 | * means that properties that exist in dest will not be overwritten by src
|
6391 | * @param {Object} dest
|
6392 | * @param {Object} src
|
6393 | * @returns {Object} dest
|
6394 | */
|
6395 |
|
6396 | var merge$1 = deprecate(function (dest, src) {
|
6397 | return extend(dest, src, true);
|
6398 | }, 'merge', 'Use `assign`.');
|
6399 |
|
6400 | /**
|
6401 | * @private
|
6402 | * simple class inheritance
|
6403 | * @param {Function} child
|
6404 | * @param {Function} base
|
6405 | * @param {Object} [properties]
|
6406 | */
|
6407 |
|
6408 | function inherit(child, base, properties) {
|
6409 | var baseP = base.prototype;
|
6410 | var childP;
|
6411 | childP = child.prototype = Object.create(baseP);
|
6412 | childP.constructor = child;
|
6413 | childP._super = baseP;
|
6414 |
|
6415 | if (properties) {
|
6416 | assign$1$1(childP, properties);
|
6417 | }
|
6418 | }
|
6419 |
|
6420 | /**
|
6421 | * @private
|
6422 | * simple function bind
|
6423 | * @param {Function} fn
|
6424 | * @param {Object} context
|
6425 | * @returns {Function}
|
6426 | */
|
6427 | function bindFn(fn, context) {
|
6428 | return function boundFn() {
|
6429 | return fn.apply(context, arguments);
|
6430 | };
|
6431 | }
|
6432 |
|
6433 | /**
|
6434 | * @private
|
6435 | * Simple way to create a manager with a default set of recognizers.
|
6436 | * @param {HTMLElement} element
|
6437 | * @param {Object} [options]
|
6438 | * @constructor
|
6439 | */
|
6440 |
|
6441 | var Hammer =
|
6442 | /*#__PURE__*/
|
6443 | function () {
|
6444 | var Hammer =
|
6445 | /**
|
6446 | * @private
|
6447 | * @const {string}
|
6448 | */
|
6449 | function Hammer(element, options) {
|
6450 | if (options === void 0) {
|
6451 | options = {};
|
6452 | }
|
6453 |
|
6454 | return new Manager(element, _extends({
|
6455 | recognizers: preset.concat()
|
6456 | }, options));
|
6457 | };
|
6458 |
|
6459 | Hammer.VERSION = "2.0.17-rc";
|
6460 | Hammer.DIRECTION_ALL = DIRECTION_ALL;
|
6461 | Hammer.DIRECTION_DOWN = DIRECTION_DOWN;
|
6462 | Hammer.DIRECTION_LEFT = DIRECTION_LEFT;
|
6463 | Hammer.DIRECTION_RIGHT = DIRECTION_RIGHT;
|
6464 | Hammer.DIRECTION_UP = DIRECTION_UP;
|
6465 | Hammer.DIRECTION_HORIZONTAL = DIRECTION_HORIZONTAL;
|
6466 | Hammer.DIRECTION_VERTICAL = DIRECTION_VERTICAL;
|
6467 | Hammer.DIRECTION_NONE = DIRECTION_NONE;
|
6468 | Hammer.DIRECTION_DOWN = DIRECTION_DOWN;
|
6469 | Hammer.INPUT_START = INPUT_START;
|
6470 | Hammer.INPUT_MOVE = INPUT_MOVE;
|
6471 | Hammer.INPUT_END = INPUT_END;
|
6472 | Hammer.INPUT_CANCEL = INPUT_CANCEL;
|
6473 | Hammer.STATE_POSSIBLE = STATE_POSSIBLE;
|
6474 | Hammer.STATE_BEGAN = STATE_BEGAN;
|
6475 | Hammer.STATE_CHANGED = STATE_CHANGED;
|
6476 | Hammer.STATE_ENDED = STATE_ENDED;
|
6477 | Hammer.STATE_RECOGNIZED = STATE_RECOGNIZED;
|
6478 | Hammer.STATE_CANCELLED = STATE_CANCELLED;
|
6479 | Hammer.STATE_FAILED = STATE_FAILED;
|
6480 | Hammer.Manager = Manager;
|
6481 | Hammer.Input = Input;
|
6482 | Hammer.TouchAction = TouchAction;
|
6483 | Hammer.TouchInput = TouchInput;
|
6484 | Hammer.MouseInput = MouseInput;
|
6485 | Hammer.PointerEventInput = PointerEventInput;
|
6486 | Hammer.TouchMouseInput = TouchMouseInput;
|
6487 | Hammer.SingleTouchInput = SingleTouchInput;
|
6488 | Hammer.Recognizer = Recognizer;
|
6489 | Hammer.AttrRecognizer = AttrRecognizer;
|
6490 | Hammer.Tap = TapRecognizer;
|
6491 | Hammer.Pan = PanRecognizer;
|
6492 | Hammer.Swipe = SwipeRecognizer;
|
6493 | Hammer.Pinch = PinchRecognizer;
|
6494 | Hammer.Rotate = RotateRecognizer;
|
6495 | Hammer.Press = PressRecognizer;
|
6496 | Hammer.on = addEventListeners;
|
6497 | Hammer.off = removeEventListeners;
|
6498 | Hammer.each = each;
|
6499 | Hammer.merge = merge$1;
|
6500 | Hammer.extend = extend;
|
6501 | Hammer.bindFn = bindFn;
|
6502 | Hammer.assign = assign$1$1;
|
6503 | Hammer.inherit = inherit;
|
6504 | Hammer.bindFn = bindFn;
|
6505 | Hammer.prefixed = prefixed;
|
6506 | Hammer.toArray = toArray;
|
6507 | Hammer.inArray = inArray;
|
6508 | Hammer.uniqueArray = uniqueArray;
|
6509 | Hammer.splitStr = splitStr;
|
6510 | Hammer.boolOrFn = boolOrFn;
|
6511 | Hammer.hasParent = hasParent;
|
6512 | Hammer.addEventListeners = addEventListeners;
|
6513 | Hammer.removeEventListeners = removeEventListeners;
|
6514 | Hammer.defaults = assign$1$1({}, defaults, {
|
6515 | preset: preset
|
6516 | });
|
6517 | return Hammer;
|
6518 | }();
|
6519 |
|
6520 | var RealHammer = Hammer;
|
6521 |
|
6522 | /**
|
6523 | * vis-util
|
6524 | * https://github.com/visjs/vis-util
|
6525 | *
|
6526 | * utilitie collection for visjs
|
6527 | *
|
6528 | * @version 5.0.7
|
6529 | * @date 2023-11-20T09:06:51.067Z
|
6530 | *
|
6531 | * @copyright (c) 2011-2017 Almende B.V, http://almende.com
|
6532 | * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
|
6533 | *
|
6534 | * @license
|
6535 | * vis.js is dual licensed under both
|
6536 | *
|
6537 | * 1. The Apache 2.0 License
|
6538 | * http://www.apache.org/licenses/LICENSE-2.0
|
6539 | *
|
6540 | * and
|
6541 | *
|
6542 | * 2. The MIT License
|
6543 | * http://opensource.org/licenses/MIT
|
6544 | *
|
6545 | * vis.js may be distributed under either license.
|
6546 | */
|
6547 |
|
6548 |
|
6549 | /**
|
6550 | * Use this symbol to delete properies in deepObjectAssign.
|
6551 | */
|
6552 | const DELETE = Symbol("DELETE");
|
6553 | /**
|
6554 | * Pure version of deepObjectAssign, it doesn't modify any of it's arguments.
|
6555 | *
|
6556 | * @param base - The base object that fullfils the whole interface T.
|
6557 | * @param updates - Updates that may change or delete props.
|
6558 | * @returns A brand new instance with all the supplied objects deeply merged.
|
6559 | */
|
6560 | function pureDeepObjectAssign(base, ...updates) {
|
6561 | return deepObjectAssign({}, base, ...updates);
|
6562 | }
|
6563 | /**
|
6564 | * Deep version of object assign with additional deleting by the DELETE symbol.
|
6565 | *
|
6566 | * @param values - Objects to be deeply merged.
|
6567 | * @returns The first object from values.
|
6568 | */
|
6569 | function deepObjectAssign(...values) {
|
6570 | const merged = deepObjectAssignNonentry(...values);
|
6571 | stripDelete(merged);
|
6572 | return merged;
|
6573 | }
|
6574 | /**
|
6575 | * Deep version of object assign with additional deleting by the DELETE symbol.
|
6576 | *
|
6577 | * @remarks
|
6578 | * This doesn't strip the DELETE symbols so they may end up in the final object.
|
6579 | * @param values - Objects to be deeply merged.
|
6580 | * @returns The first object from values.
|
6581 | */
|
6582 | function deepObjectAssignNonentry(...values) {
|
6583 | if (values.length < 2) {
|
6584 | return values[0];
|
6585 | }
|
6586 | else if (values.length > 2) {
|
6587 | return deepObjectAssignNonentry(deepObjectAssign(values[0], values[1]), ...values.slice(2));
|
6588 | }
|
6589 | const a = values[0];
|
6590 | const b = values[1];
|
6591 | if (a instanceof Date && b instanceof Date) {
|
6592 | a.setTime(b.getTime());
|
6593 | return a;
|
6594 | }
|
6595 | for (const prop of Reflect.ownKeys(b)) {
|
6596 | if (!Object.prototype.propertyIsEnumerable.call(b, prop)) ;
|
6597 | else if (b[prop] === DELETE) {
|
6598 | delete a[prop];
|
6599 | }
|
6600 | else if (a[prop] !== null &&
|
6601 | b[prop] !== null &&
|
6602 | typeof a[prop] === "object" &&
|
6603 | typeof b[prop] === "object" &&
|
6604 | !Array.isArray(a[prop]) &&
|
6605 | !Array.isArray(b[prop])) {
|
6606 | a[prop] = deepObjectAssignNonentry(a[prop], b[prop]);
|
6607 | }
|
6608 | else {
|
6609 | a[prop] = clone(b[prop]);
|
6610 | }
|
6611 | }
|
6612 | return a;
|
6613 | }
|
6614 | /**
|
6615 | * Deep clone given object or array. In case of primitive simply return.
|
6616 | *
|
6617 | * @param a - Anything.
|
6618 | * @returns Deep cloned object/array or unchanged a.
|
6619 | */
|
6620 | function clone(a) {
|
6621 | if (Array.isArray(a)) {
|
6622 | return a.map((value) => clone(value));
|
6623 | }
|
6624 | else if (typeof a === "object" && a !== null) {
|
6625 | if (a instanceof Date) {
|
6626 | return new Date(a.getTime());
|
6627 | }
|
6628 | return deepObjectAssignNonentry({}, a);
|
6629 | }
|
6630 | else {
|
6631 | return a;
|
6632 | }
|
6633 | }
|
6634 | /**
|
6635 | * Strip DELETE from given object.
|
6636 | *
|
6637 | * @param a - Object which may contain DELETE but won't after this is executed.
|
6638 | */
|
6639 | function stripDelete(a) {
|
6640 | for (const prop of Object.keys(a)) {
|
6641 | if (a[prop] === DELETE) {
|
6642 | delete a[prop];
|
6643 | }
|
6644 | else if (typeof a[prop] === "object" && a[prop] !== null) {
|
6645 | stripDelete(a[prop]);
|
6646 | }
|
6647 | }
|
6648 | }
|
6649 |
|
6650 | /**
|
6651 | * Setup a mock hammer.js object, for unit testing.
|
6652 | *
|
6653 | * Inspiration: https://github.com/uber/deck.gl/pull/658
|
6654 | *
|
6655 | * @returns {{on: noop, off: noop, destroy: noop, emit: noop, get: get}}
|
6656 | */
|
6657 | function hammerMock() {
|
6658 | const noop = () => {};
|
6659 |
|
6660 | return {
|
6661 | on: noop,
|
6662 | off: noop,
|
6663 | destroy: noop,
|
6664 | emit: noop,
|
6665 |
|
6666 | get() {
|
6667 | return {
|
6668 | set: noop,
|
6669 | };
|
6670 | },
|
6671 | };
|
6672 | }
|
6673 |
|
6674 | const Hammer$1 =
|
6675 | typeof window !== "undefined"
|
6676 | ? window.Hammer || RealHammer
|
6677 | : function () {
|
6678 | // hammer.js is only available in a browser, not in node.js. Replacing it with a mock object.
|
6679 | return hammerMock();
|
6680 | };
|
6681 |
|
6682 | /**
|
6683 | * Turn an element into an clickToUse element.
|
6684 | * When not active, the element has a transparent overlay. When the overlay is
|
6685 | * clicked, the mode is changed to active.
|
6686 | * When active, the element is displayed with a blue border around it, and
|
6687 | * the interactive contents of the element can be used. When clicked outside
|
6688 | * the element, the elements mode is changed to inactive.
|
6689 | *
|
6690 | * @param {Element} container
|
6691 | * @class Activator
|
6692 | */
|
6693 | function Activator$1(container) {
|
6694 | this._cleanupQueue = [];
|
6695 |
|
6696 | this.active = false;
|
6697 |
|
6698 | this._dom = {
|
6699 | container,
|
6700 | overlay: document.createElement("div"),
|
6701 | };
|
6702 |
|
6703 | this._dom.overlay.classList.add("vis-overlay");
|
6704 |
|
6705 | this._dom.container.appendChild(this._dom.overlay);
|
6706 | this._cleanupQueue.push(() => {
|
6707 | this._dom.overlay.parentNode.removeChild(this._dom.overlay);
|
6708 | });
|
6709 |
|
6710 | const hammer = Hammer$1(this._dom.overlay);
|
6711 | hammer.on("tap", this._onTapOverlay.bind(this));
|
6712 | this._cleanupQueue.push(() => {
|
6713 | hammer.destroy();
|
6714 | // FIXME: cleaning up hammer instances doesn't work (Timeline not removed
|
6715 | // from memory)
|
6716 | });
|
6717 |
|
6718 | // block all touch events (except tap)
|
6719 | const events = [
|
6720 | "tap",
|
6721 | "doubletap",
|
6722 | "press",
|
6723 | "pinch",
|
6724 | "pan",
|
6725 | "panstart",
|
6726 | "panmove",
|
6727 | "panend",
|
6728 | ];
|
6729 | events.forEach((event) => {
|
6730 | hammer.on(event, (event) => {
|
6731 | event.srcEvent.stopPropagation();
|
6732 | });
|
6733 | });
|
6734 |
|
6735 | // attach a click event to the window, in order to deactivate when clicking outside the timeline
|
6736 | if (document && document.body) {
|
6737 | this._onClick = (event) => {
|
6738 | if (!_hasParent(event.target, container)) {
|
6739 | this.deactivate();
|
6740 | }
|
6741 | };
|
6742 | document.body.addEventListener("click", this._onClick);
|
6743 | this._cleanupQueue.push(() => {
|
6744 | document.body.removeEventListener("click", this._onClick);
|
6745 | });
|
6746 | }
|
6747 |
|
6748 | // prepare escape key listener for deactivating when active
|
6749 | this._escListener = (event) => {
|
6750 | if (
|
6751 | "key" in event
|
6752 | ? event.key === "Escape"
|
6753 | : event.keyCode === 27 /* the keyCode is for IE11 */
|
6754 | ) {
|
6755 | this.deactivate();
|
6756 | }
|
6757 | };
|
6758 | }
|
6759 |
|
6760 | // turn into an event emitter
|
6761 | Emitter(Activator$1.prototype);
|
6762 |
|
6763 | // The currently active activator
|
6764 | Activator$1.current = null;
|
6765 |
|
6766 | /**
|
6767 | * Destroy the activator. Cleans up all created DOM and event listeners
|
6768 | */
|
6769 | Activator$1.prototype.destroy = function () {
|
6770 | this.deactivate();
|
6771 |
|
6772 | for (const callback of this._cleanupQueue.splice(0).reverse()) {
|
6773 | callback();
|
6774 | }
|
6775 | };
|
6776 |
|
6777 | /**
|
6778 | * Activate the element
|
6779 | * Overlay is hidden, element is decorated with a blue shadow border
|
6780 | */
|
6781 | Activator$1.prototype.activate = function () {
|
6782 | // we allow only one active activator at a time
|
6783 | if (Activator$1.current) {
|
6784 | Activator$1.current.deactivate();
|
6785 | }
|
6786 | Activator$1.current = this;
|
6787 |
|
6788 | this.active = true;
|
6789 | this._dom.overlay.style.display = "none";
|
6790 | this._dom.container.classList.add("vis-active");
|
6791 |
|
6792 | this.emit("change");
|
6793 | this.emit("activate");
|
6794 |
|
6795 | // ugly hack: bind ESC after emitting the events, as the Network rebinds all
|
6796 | // keyboard events on a 'change' event
|
6797 | document.body.addEventListener("keydown", this._escListener);
|
6798 | };
|
6799 |
|
6800 | /**
|
6801 | * Deactivate the element
|
6802 | * Overlay is displayed on top of the element
|
6803 | */
|
6804 | Activator$1.prototype.deactivate = function () {
|
6805 | this.active = false;
|
6806 | this._dom.overlay.style.display = "block";
|
6807 | this._dom.container.classList.remove("vis-active");
|
6808 | document.body.removeEventListener("keydown", this._escListener);
|
6809 |
|
6810 | this.emit("change");
|
6811 | this.emit("deactivate");
|
6812 | };
|
6813 |
|
6814 | /**
|
6815 | * Handle a tap event: activate the container
|
6816 | *
|
6817 | * @param {Event} event The event
|
6818 | * @private
|
6819 | */
|
6820 | Activator$1.prototype._onTapOverlay = function (event) {
|
6821 | // activate the container
|
6822 | this.activate();
|
6823 | event.srcEvent.stopPropagation();
|
6824 | };
|
6825 |
|
6826 | /**
|
6827 | * Test whether the element has the requested parent element somewhere in
|
6828 | * its chain of parent nodes.
|
6829 | *
|
6830 | * @param {HTMLElement} element
|
6831 | * @param {HTMLElement} parent
|
6832 | * @returns {boolean} Returns true when the parent is found somewhere in the
|
6833 | * chain of parent nodes.
|
6834 | * @private
|
6835 | */
|
6836 | function _hasParent(element, parent) {
|
6837 | while (element) {
|
6838 | if (element === parent) {
|
6839 | return true;
|
6840 | }
|
6841 | element = element.parentNode;
|
6842 | }
|
6843 | return false;
|
6844 | }
|
6845 |
|
6846 | var isConstructor$2 = isConstructor$4;
|
6847 | var tryToString$3 = tryToString$6;
|
6848 |
|
6849 | var $TypeError$7 = TypeError;
|
6850 |
|
6851 | // `Assert: IsConstructor(argument) is true`
|
6852 | var aConstructor$2 = function (argument) {
|
6853 | if (isConstructor$2(argument)) return argument;
|
6854 | throw new $TypeError$7(tryToString$3(argument) + ' is not a constructor');
|
6855 | };
|
6856 |
|
6857 | var $$y = _export;
|
6858 | var getBuiltIn$5 = getBuiltIn$f;
|
6859 | var apply$3 = functionApply;
|
6860 | var bind$9 = functionBind;
|
6861 | var aConstructor$1 = aConstructor$2;
|
6862 | var anObject$7 = anObject$d;
|
6863 | var isObject$7 = isObject$h;
|
6864 | var create$9 = objectCreate;
|
6865 | var fails$d = fails$u;
|
6866 |
|
6867 | var nativeConstruct = getBuiltIn$5('Reflect', 'construct');
|
6868 | var ObjectPrototype = Object.prototype;
|
6869 | var push$8 = [].push;
|
6870 |
|
6871 | // `Reflect.construct` method
|
6872 | // https://tc39.es/ecma262/#sec-reflect.construct
|
6873 | // MS Edge supports only 2 arguments and argumentsList argument is optional
|
6874 | // FF Nightly sets third argument as `new.target`, but does not create `this` from it
|
6875 | var NEW_TARGET_BUG = fails$d(function () {
|
6876 | function F() { /* empty */ }
|
6877 | return !(nativeConstruct(function () { /* empty */ }, [], F) instanceof F);
|
6878 | });
|
6879 |
|
6880 | var ARGS_BUG = !fails$d(function () {
|
6881 | nativeConstruct(function () { /* empty */ });
|
6882 | });
|
6883 |
|
6884 | var FORCED$3 = NEW_TARGET_BUG || ARGS_BUG;
|
6885 |
|
6886 | $$y({ target: 'Reflect', stat: true, forced: FORCED$3, sham: FORCED$3 }, {
|
6887 | construct: function construct(Target, args /* , newTarget */) {
|
6888 | aConstructor$1(Target);
|
6889 | anObject$7(args);
|
6890 | var newTarget = arguments.length < 3 ? Target : aConstructor$1(arguments[2]);
|
6891 | if (ARGS_BUG && !NEW_TARGET_BUG) return nativeConstruct(Target, args, newTarget);
|
6892 | if (Target === newTarget) {
|
6893 | // w/o altered newTarget, optimization for 0-4 arguments
|
6894 | switch (args.length) {
|
6895 | case 0: return new Target();
|
6896 | case 1: return new Target(args[0]);
|
6897 | case 2: return new Target(args[0], args[1]);
|
6898 | case 3: return new Target(args[0], args[1], args[2]);
|
6899 | case 4: return new Target(args[0], args[1], args[2], args[3]);
|
6900 | }
|
6901 | // w/o altered newTarget, lot of arguments case
|
6902 | var $args = [null];
|
6903 | apply$3(push$8, $args, args);
|
6904 | return new (apply$3(bind$9, Target, $args))();
|
6905 | }
|
6906 | // with altered newTarget, not support built-in constructors
|
6907 | var proto = newTarget.prototype;
|
6908 | var instance = create$9(isObject$7(proto) ? proto : ObjectPrototype);
|
6909 | var result = apply$3(Target, instance, args);
|
6910 | return isObject$7(result) ? result : instance;
|
6911 | }
|
6912 | });
|
6913 |
|
6914 | var path$h = path$o;
|
6915 |
|
6916 | var construct$2 = path$h.Reflect.construct;
|
6917 |
|
6918 | var parent$T = construct$2;
|
6919 |
|
6920 | var construct$1 = parent$T;
|
6921 |
|
6922 | var construct = construct$1;
|
6923 |
|
6924 | var _Reflect$construct = /*@__PURE__*/getDefaultExportFromCjs(construct);
|
6925 |
|
6926 | var $$x = _export;
|
6927 | var isArray$9 = isArray$e;
|
6928 | var isConstructor$1 = isConstructor$4;
|
6929 | var isObject$6 = isObject$h;
|
6930 | var toAbsoluteIndex$1 = toAbsoluteIndex$4;
|
6931 | var lengthOfArrayLike$5 = lengthOfArrayLike$d;
|
6932 | var toIndexedObject$2 = toIndexedObject$a;
|
6933 | var createProperty$3 = createProperty$6;
|
6934 | var wellKnownSymbol$7 = wellKnownSymbol$n;
|
6935 | var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5;
|
6936 | var nativeSlice = arraySlice$5;
|
6937 |
|
6938 | var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('slice');
|
6939 |
|
6940 | var SPECIES$3 = wellKnownSymbol$7('species');
|
6941 | var $Array$1 = Array;
|
6942 | var max$1 = Math.max;
|
6943 |
|
6944 | // `Array.prototype.slice` method
|
6945 | // https://tc39.es/ecma262/#sec-array.prototype.slice
|
6946 | // fallback for not array-like ES3 strings and DOM objects
|
6947 | $$x({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
|
6948 | slice: function slice(start, end) {
|
6949 | var O = toIndexedObject$2(this);
|
6950 | var length = lengthOfArrayLike$5(O);
|
6951 | var k = toAbsoluteIndex$1(start, length);
|
6952 | var fin = toAbsoluteIndex$1(end === undefined ? length : end, length);
|
6953 | // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
|
6954 | var Constructor, result, n;
|
6955 | if (isArray$9(O)) {
|
6956 | Constructor = O.constructor;
|
6957 |
|
6958 | if (isConstructor$1(Constructor) && (Constructor === $Array$1 || isArray$9(Constructor.prototype))) {
|
6959 | Constructor = undefined;
|
6960 | } else if (isObject$6(Constructor)) {
|
6961 | Constructor = Constructor[SPECIES$3];
|
6962 | if (Constructor === null) Constructor = undefined;
|
6963 | }
|
6964 | if (Constructor === $Array$1 || Constructor === undefined) {
|
6965 | return nativeSlice(O, k, fin);
|
6966 | }
|
6967 | }
|
6968 | result = new (Constructor === undefined ? $Array$1 : Constructor)(max$1(fin - k, 0));
|
6969 | for (n = 0; k < fin; k++, n++) if (k in O) createProperty$3(result, n, O[k]);
|
6970 | result.length = n;
|
6971 | return result;
|
6972 | }
|
6973 | });
|
6974 |
|
6975 | var getBuiltInPrototypeMethod$a = getBuiltInPrototypeMethod$g;
|
6976 |
|
6977 | var slice$6 = getBuiltInPrototypeMethod$a('Array', 'slice');
|
6978 |
|
6979 | var isPrototypeOf$d = objectIsPrototypeOf;
|
6980 | var method$a = slice$6;
|
6981 |
|
6982 | var ArrayPrototype$b = Array.prototype;
|
6983 |
|
6984 | var slice$5 = function (it) {
|
6985 | var own = it.slice;
|
6986 | return it === ArrayPrototype$b || (isPrototypeOf$d(ArrayPrototype$b, it) && own === ArrayPrototype$b.slice) ? method$a : own;
|
6987 | };
|
6988 |
|
6989 | var parent$S = slice$5;
|
6990 |
|
6991 | var slice$4 = parent$S;
|
6992 |
|
6993 | var slice$3 = slice$4;
|
6994 |
|
6995 | var _sliceInstanceProperty$1 = getDefaultExportFromCjs(slice$3);
|
6996 |
|
6997 | var call$a = functionCall;
|
6998 | var anObject$6 = anObject$d;
|
6999 | var getMethod$1 = getMethod$3;
|
7000 |
|
7001 | var iteratorClose$2 = function (iterator, kind, value) {
|
7002 | var innerResult, innerError;
|
7003 | anObject$6(iterator);
|
7004 | try {
|
7005 | innerResult = getMethod$1(iterator, 'return');
|
7006 | if (!innerResult) {
|
7007 | if (kind === 'throw') throw value;
|
7008 | return value;
|
7009 | }
|
7010 | innerResult = call$a(innerResult, iterator);
|
7011 | } catch (error) {
|
7012 | innerError = true;
|
7013 | innerResult = error;
|
7014 | }
|
7015 | if (kind === 'throw') throw value;
|
7016 | if (innerError) throw innerResult;
|
7017 | anObject$6(innerResult);
|
7018 | return value;
|
7019 | };
|
7020 |
|
7021 | var anObject$5 = anObject$d;
|
7022 | var iteratorClose$1 = iteratorClose$2;
|
7023 |
|
7024 |
|
7025 | var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) {
|
7026 | try {
|
7027 | return ENTRIES ? fn(anObject$5(value)[0], value[1]) : fn(value);
|
7028 | } catch (error) {
|
7029 | iteratorClose$1(iterator, 'throw', error);
|
7030 | }
|
7031 | };
|
7032 |
|
7033 | var wellKnownSymbol$6 = wellKnownSymbol$n;
|
7034 | var Iterators$1 = iterators;
|
7035 |
|
7036 | var ITERATOR$2 = wellKnownSymbol$6('iterator');
|
7037 | var ArrayPrototype$a = Array.prototype;
|
7038 |
|
7039 |
|
7040 | var isArrayIteratorMethod$2 = function (it) {
|
7041 | return it !== undefined && (Iterators$1.Array === it || ArrayPrototype$a[ITERATOR$2] === it);
|
7042 | };
|
7043 |
|
7044 | var classof$5 = classof$d;
|
7045 | var getMethod = getMethod$3;
|
7046 | var isNullOrUndefined$3 = isNullOrUndefined$6;
|
7047 | var Iterators = iterators;
|
7048 | var wellKnownSymbol$5 = wellKnownSymbol$n;
|
7049 |
|
7050 | var ITERATOR$1 = wellKnownSymbol$5('iterator');
|
7051 |
|
7052 | var getIteratorMethod$9 = function (it) {
|
7053 | if (!isNullOrUndefined$3(it)) return getMethod(it, ITERATOR$1)
|
7054 | || getMethod(it, '@@iterator')
|
7055 | || Iterators[classof$5(it)];
|
7056 | };
|
7057 |
|
7058 | var call$9 = functionCall;
|
7059 | var aCallable$7 = aCallable$e;
|
7060 | var anObject$4 = anObject$d;
|
7061 | var tryToString$2 = tryToString$6;
|
7062 | var getIteratorMethod$8 = getIteratorMethod$9;
|
7063 |
|
7064 | var $TypeError$6 = TypeError;
|
7065 |
|
7066 | var getIterator$8 = function (argument, usingIterator) {
|
7067 | var iteratorMethod = arguments.length < 2 ? getIteratorMethod$8(argument) : usingIterator;
|
7068 | if (aCallable$7(iteratorMethod)) return anObject$4(call$9(iteratorMethod, argument));
|
7069 | throw new $TypeError$6(tryToString$2(argument) + ' is not iterable');
|
7070 | };
|
7071 |
|
7072 | var bind$8 = functionBindContext;
|
7073 | var call$8 = functionCall;
|
7074 | var toObject$6 = toObject$e;
|
7075 | var callWithSafeIterationClosing = callWithSafeIterationClosing$1;
|
7076 | var isArrayIteratorMethod$1 = isArrayIteratorMethod$2;
|
7077 | var isConstructor = isConstructor$4;
|
7078 | var lengthOfArrayLike$4 = lengthOfArrayLike$d;
|
7079 | var createProperty$2 = createProperty$6;
|
7080 | var getIterator$7 = getIterator$8;
|
7081 | var getIteratorMethod$7 = getIteratorMethod$9;
|
7082 |
|
7083 | var $Array = Array;
|
7084 |
|
7085 |
|
7086 |
|
7087 | var arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
|
7088 | var O = toObject$6(arrayLike);
|
7089 | var IS_CONSTRUCTOR = isConstructor(this);
|
7090 | var argumentsLength = arguments.length;
|
7091 | var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
|
7092 | var mapping = mapfn !== undefined;
|
7093 | if (mapping) mapfn = bind$8(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
|
7094 | var iteratorMethod = getIteratorMethod$7(O);
|
7095 | var index = 0;
|
7096 | var length, result, step, iterator, next, value;
|
7097 |
|
7098 | if (iteratorMethod && !(this === $Array && isArrayIteratorMethod$1(iteratorMethod))) {
|
7099 | iterator = getIterator$7(O, iteratorMethod);
|
7100 | next = iterator.next;
|
7101 | result = IS_CONSTRUCTOR ? new this() : [];
|
7102 | for (;!(step = call$8(next, iterator)).done; index++) {
|
7103 | value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
|
7104 | createProperty$2(result, index, value);
|
7105 | }
|
7106 | } else {
|
7107 | length = lengthOfArrayLike$4(O);
|
7108 | result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
|
7109 | for (;length > index; index++) {
|
7110 | value = mapping ? mapfn(O[index], index) : O[index];
|
7111 | createProperty$2(result, index, value);
|
7112 | }
|
7113 | }
|
7114 | result.length = index;
|
7115 | return result;
|
7116 | };
|
7117 |
|
7118 | var wellKnownSymbol$4 = wellKnownSymbol$n;
|
7119 |
|
7120 | var ITERATOR = wellKnownSymbol$4('iterator');
|
7121 | var SAFE_CLOSING = false;
|
7122 |
|
7123 | try {
|
7124 | var called = 0;
|
7125 | var iteratorWithReturn = {
|
7126 | next: function () {
|
7127 | return { done: !!called++ };
|
7128 | },
|
7129 | 'return': function () {
|
7130 | SAFE_CLOSING = true;
|
7131 | }
|
7132 | };
|
7133 | iteratorWithReturn[ITERATOR] = function () {
|
7134 | return this;
|
7135 | };
|
7136 |
|
7137 | Array.from(iteratorWithReturn, function () { throw 2; });
|
7138 | } catch (error) { }
|
7139 |
|
7140 | var checkCorrectnessOfIteration$2 = function (exec, SKIP_CLOSING) {
|
7141 | try {
|
7142 | if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
|
7143 | } catch (error) { return false; }
|
7144 | var ITERATION_SUPPORT = false;
|
7145 | try {
|
7146 | var object = {};
|
7147 | object[ITERATOR] = function () {
|
7148 | return {
|
7149 | next: function () {
|
7150 | return { done: ITERATION_SUPPORT = true };
|
7151 | }
|
7152 | };
|
7153 | };
|
7154 | exec(object);
|
7155 | } catch (error) { }
|
7156 | return ITERATION_SUPPORT;
|
7157 | };
|
7158 |
|
7159 | var $$w = _export;
|
7160 | var from$6 = arrayFrom;
|
7161 | var checkCorrectnessOfIteration$1 = checkCorrectnessOfIteration$2;
|
7162 |
|
7163 | var INCORRECT_ITERATION = !checkCorrectnessOfIteration$1(function (iterable) {
|
7164 |
|
7165 | Array.from(iterable);
|
7166 | });
|
7167 |
|
7168 |
|
7169 |
|
7170 | $$w({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
|
7171 | from: from$6
|
7172 | });
|
7173 |
|
7174 | var path$g = path$o;
|
7175 |
|
7176 | var from$5 = path$g.Array.from;
|
7177 |
|
7178 | var parent$R = from$5;
|
7179 |
|
7180 | var from$4 = parent$R;
|
7181 |
|
7182 | var from$3 = from$4;
|
7183 |
|
7184 | var _Array$from$1 = getDefaultExportFromCjs(from$3);
|
7185 |
|
7186 | var symbol = symbol$4;
|
7187 |
|
7188 | var _Symbol = getDefaultExportFromCjs(symbol);
|
7189 |
|
7190 | var getIteratorMethod$6 = getIteratorMethod$9;
|
7191 |
|
7192 | var getIteratorMethod_1 = getIteratorMethod$6;
|
7193 |
|
7194 | var parent$Q = getIteratorMethod_1;
|
7195 |
|
7196 |
|
7197 | var getIteratorMethod$5 = parent$Q;
|
7198 |
|
7199 | var parent$P = getIteratorMethod$5;
|
7200 |
|
7201 | var getIteratorMethod$4 = parent$P;
|
7202 |
|
7203 | var parent$O = getIteratorMethod$4;
|
7204 |
|
7205 | var getIteratorMethod$3 = parent$O;
|
7206 |
|
7207 | var getIteratorMethod$2 = getIteratorMethod$3;
|
7208 |
|
7209 | var _getIteratorMethod$1 = getDefaultExportFromCjs(getIteratorMethod$2);
|
7210 |
|
7211 | var getIteratorMethod$1 = getIteratorMethod$2;
|
7212 |
|
7213 | var _getIteratorMethod = getDefaultExportFromCjs(getIteratorMethod$1);
|
7214 |
|
7215 | var path$f = path$o;
|
7216 |
|
7217 | var getOwnPropertySymbols$2 = path$f.Object.getOwnPropertySymbols;
|
7218 |
|
7219 | var parent$N = getOwnPropertySymbols$2;
|
7220 |
|
7221 | var getOwnPropertySymbols$1 = parent$N;
|
7222 |
|
7223 | var getOwnPropertySymbols = getOwnPropertySymbols$1;
|
7224 |
|
7225 | var _Object$getOwnPropertySymbols = getDefaultExportFromCjs(getOwnPropertySymbols);
|
7226 |
|
7227 | var getOwnPropertyDescriptor$5 = {exports: {}};
|
7228 |
|
7229 | var $$v = _export;
|
7230 | var fails$c = fails$u;
|
7231 | var toIndexedObject$1 = toIndexedObject$a;
|
7232 | var nativeGetOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
7233 | var DESCRIPTORS$8 = descriptors;
|
7234 |
|
7235 | var FORCED$2 = !DESCRIPTORS$8 || fails$c(function () { nativeGetOwnPropertyDescriptor(1); });
|
7236 |
|
7237 |
|
7238 |
|
7239 | $$v({ target: 'Object', stat: true, forced: FORCED$2, sham: !DESCRIPTORS$8 }, {
|
7240 | getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it, key) {
|
7241 | return nativeGetOwnPropertyDescriptor(toIndexedObject$1(it), key);
|
7242 | }
|
7243 | });
|
7244 |
|
7245 | var path$e = path$o;
|
7246 |
|
7247 | var Object$3 = path$e.Object;
|
7248 |
|
7249 | var getOwnPropertyDescriptor$4 = getOwnPropertyDescriptor$5.exports = function getOwnPropertyDescriptor(it, key) {
|
7250 | return Object$3.getOwnPropertyDescriptor(it, key);
|
7251 | };
|
7252 |
|
7253 | if (Object$3.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor$4.sham = true;
|
7254 |
|
7255 | var getOwnPropertyDescriptorExports = getOwnPropertyDescriptor$5.exports;
|
7256 |
|
7257 | var parent$M = getOwnPropertyDescriptorExports;
|
7258 |
|
7259 | var getOwnPropertyDescriptor$3 = parent$M;
|
7260 |
|
7261 | var getOwnPropertyDescriptor$2 = getOwnPropertyDescriptor$3;
|
7262 |
|
7263 | var _Object$getOwnPropertyDescriptor = getDefaultExportFromCjs(getOwnPropertyDescriptor$2);
|
7264 |
|
7265 | var $forEach = arrayIteration.forEach;
|
7266 | var arrayMethodIsStrict$2 = arrayMethodIsStrict$4;
|
7267 |
|
7268 | var STRICT_METHOD$2 = arrayMethodIsStrict$2('forEach');
|
7269 |
|
7270 |
|
7271 |
|
7272 | var arrayForEach = !STRICT_METHOD$2 ? function forEach(callbackfn /* , thisArg */) {
|
7273 | return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
7274 |
|
7275 | } : [].forEach;
|
7276 |
|
7277 | var $$u = _export;
|
7278 | var forEach$8 = arrayForEach;
|
7279 |
|
7280 |
|
7281 |
|
7282 |
|
7283 | $$u({ target: 'Array', proto: true, forced: [].forEach !== forEach$8 }, {
|
7284 | forEach: forEach$8
|
7285 | });
|
7286 |
|
7287 | var getBuiltInPrototypeMethod$9 = getBuiltInPrototypeMethod$g;
|
7288 |
|
7289 | var forEach$7 = getBuiltInPrototypeMethod$9('Array', 'forEach');
|
7290 |
|
7291 | var parent$L = forEach$7;
|
7292 |
|
7293 | var forEach$6 = parent$L;
|
7294 |
|
7295 | var classof$4 = classof$d;
|
7296 | var hasOwn$6 = hasOwnProperty_1;
|
7297 | var isPrototypeOf$c = objectIsPrototypeOf;
|
7298 | var method$9 = forEach$6;
|
7299 |
|
7300 |
|
7301 | var ArrayPrototype$9 = Array.prototype;
|
7302 |
|
7303 | var DOMIterables$3 = {
|
7304 | DOMTokenList: true,
|
7305 | NodeList: true
|
7306 | };
|
7307 |
|
7308 | var forEach$5 = function (it) {
|
7309 | var own = it.forEach;
|
7310 | return it === ArrayPrototype$9 || (isPrototypeOf$c(ArrayPrototype$9, it) && own === ArrayPrototype$9.forEach)
|
7311 | || hasOwn$6(DOMIterables$3, classof$4(it)) ? method$9 : own;
|
7312 | };
|
7313 |
|
7314 | var forEach$4 = forEach$5;
|
7315 |
|
7316 | var _forEachInstanceProperty = getDefaultExportFromCjs(forEach$4);
|
7317 |
|
7318 | var getBuiltIn$4 = getBuiltIn$f;
|
7319 | var uncurryThis$5 = functionUncurryThis;
|
7320 | var getOwnPropertyNamesModule$1 = objectGetOwnPropertyNames;
|
7321 | var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
|
7322 | var anObject$3 = anObject$d;
|
7323 |
|
7324 | var concat$5 = uncurryThis$5([].concat);
|
7325 |
|
7326 |
|
7327 | var ownKeys$7 = getBuiltIn$4('Reflect', 'ownKeys') || function ownKeys(it) {
|
7328 | var keys = getOwnPropertyNamesModule$1.f(anObject$3(it));
|
7329 | var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
|
7330 | return getOwnPropertySymbols ? concat$5(keys, getOwnPropertySymbols(it)) : keys;
|
7331 | };
|
7332 |
|
7333 | var $$t = _export;
|
7334 | var DESCRIPTORS$7 = descriptors;
|
7335 | var ownKeys$6 = ownKeys$7;
|
7336 | var toIndexedObject = toIndexedObject$a;
|
7337 | var getOwnPropertyDescriptorModule$1 = objectGetOwnPropertyDescriptor;
|
7338 | var createProperty$1 = createProperty$6;
|
7339 |
|
7340 |
|
7341 |
|
7342 | $$t({ target: 'Object', stat: true, sham: !DESCRIPTORS$7 }, {
|
7343 | getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
|
7344 | var O = toIndexedObject(object);
|
7345 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule$1.f;
|
7346 | var keys = ownKeys$6(O);
|
7347 | var result = {};
|
7348 | var index = 0;
|
7349 | var key, descriptor;
|
7350 | while (keys.length > index) {
|
7351 | descriptor = getOwnPropertyDescriptor(O, key = keys[index++]);
|
7352 | if (descriptor !== undefined) createProperty$1(result, key, descriptor);
|
7353 | }
|
7354 | return result;
|
7355 | }
|
7356 | });
|
7357 |
|
7358 | var path$d = path$o;
|
7359 |
|
7360 | var getOwnPropertyDescriptors$2 = path$d.Object.getOwnPropertyDescriptors;
|
7361 |
|
7362 | var parent$K = getOwnPropertyDescriptors$2;
|
7363 |
|
7364 | var getOwnPropertyDescriptors$1 = parent$K;
|
7365 |
|
7366 | var getOwnPropertyDescriptors = getOwnPropertyDescriptors$1;
|
7367 |
|
7368 | var _Object$getOwnPropertyDescriptors = getDefaultExportFromCjs(getOwnPropertyDescriptors);
|
7369 |
|
7370 | var defineProperties$4 = {exports: {}};
|
7371 |
|
7372 | var $$s = _export;
|
7373 | var DESCRIPTORS$6 = descriptors;
|
7374 | var defineProperties$3 = objectDefineProperties.f;
|
7375 |
|
7376 |
|
7377 |
|
7378 |
|
7379 | $$s({ target: 'Object', stat: true, forced: Object.defineProperties !== defineProperties$3, sham: !DESCRIPTORS$6 }, {
|
7380 | defineProperties: defineProperties$3
|
7381 | });
|
7382 |
|
7383 | var path$c = path$o;
|
7384 |
|
7385 | var Object$2 = path$c.Object;
|
7386 |
|
7387 | var defineProperties$2 = defineProperties$4.exports = function defineProperties(T, D) {
|
7388 | return Object$2.defineProperties(T, D);
|
7389 | };
|
7390 |
|
7391 | if (Object$2.defineProperties.sham) defineProperties$2.sham = true;
|
7392 |
|
7393 | var definePropertiesExports = defineProperties$4.exports;
|
7394 |
|
7395 | var parent$J = definePropertiesExports;
|
7396 |
|
7397 | var defineProperties$1 = parent$J;
|
7398 |
|
7399 | var defineProperties = defineProperties$1;
|
7400 |
|
7401 | var _Object$defineProperties = getDefaultExportFromCjs(defineProperties);
|
7402 |
|
7403 | var defineProperty$3 = defineProperty$b;
|
7404 |
|
7405 | var _Object$defineProperty = getDefaultExportFromCjs(defineProperty$3);
|
7406 |
|
7407 | var $$r = _export;
|
7408 | var isArray$8 = isArray$e;
|
7409 |
|
7410 |
|
7411 |
|
7412 | $$r({ target: 'Array', stat: true }, {
|
7413 | isArray: isArray$8
|
7414 | });
|
7415 |
|
7416 | var path$b = path$o;
|
7417 |
|
7418 | var isArray$7 = path$b.Array.isArray;
|
7419 |
|
7420 | var parent$I = isArray$7;
|
7421 |
|
7422 | var isArray$6 = parent$I;
|
7423 |
|
7424 | var parent$H = isArray$6;
|
7425 |
|
7426 | var isArray$5 = parent$H;
|
7427 |
|
7428 | var parent$G = isArray$5;
|
7429 |
|
7430 | var isArray$4 = parent$G;
|
7431 |
|
7432 | var isArray$3 = isArray$4;
|
7433 |
|
7434 | var _Array$isArray$1 = getDefaultExportFromCjs(isArray$3);
|
7435 |
|
7436 | function _arrayLikeToArray$3(arr, len) {
|
7437 | if (len == null || len > arr.length) len = arr.length;
|
7438 | for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
7439 | return arr2;
|
7440 | }
|
7441 |
|
7442 | function _arrayWithoutHoles(arr) {
|
7443 | if (_Array$isArray$1(arr)) return _arrayLikeToArray$3(arr);
|
7444 | }
|
7445 |
|
7446 | var parent$F = from$4;
|
7447 |
|
7448 | var from$2 = parent$F;
|
7449 |
|
7450 | var parent$E = from$2;
|
7451 |
|
7452 | var from$1 = parent$E;
|
7453 |
|
7454 | var from = from$1;
|
7455 |
|
7456 | var _Array$from = getDefaultExportFromCjs(from);
|
7457 |
|
7458 | function _iterableToArray(iter) {
|
7459 | if (typeof _Symbol$1 !== "undefined" && _getIteratorMethod$1(iter) != null || iter["@@iterator"] != null) return _Array$from(iter);
|
7460 | }
|
7461 |
|
7462 | var parent$D = slice$4;
|
7463 |
|
7464 | var slice$2 = parent$D;
|
7465 |
|
7466 | var parent$C = slice$2;
|
7467 |
|
7468 | var slice$1 = parent$C;
|
7469 |
|
7470 | var slice = slice$1;
|
7471 |
|
7472 | var _sliceInstanceProperty = getDefaultExportFromCjs(slice);
|
7473 |
|
7474 | function _unsupportedIterableToArray$3(o, minLen) {
|
7475 | var _context;
|
7476 | if (!o) return;
|
7477 | if (typeof o === "string") return _arrayLikeToArray$3(o, minLen);
|
7478 | var n = _sliceInstanceProperty(_context = Object.prototype.toString.call(o)).call(_context, 8, -1);
|
7479 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
7480 | if (n === "Map" || n === "Set") return _Array$from(o);
|
7481 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$3(o, minLen);
|
7482 | }
|
7483 |
|
7484 | function _nonIterableSpread() {
|
7485 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
7486 | }
|
7487 |
|
7488 | function _toConsumableArray(arr) {
|
7489 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$3(arr) || _nonIterableSpread();
|
7490 | }
|
7491 |
|
7492 | function _assertThisInitialized(self) {
|
7493 | if (self === void 0) {
|
7494 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
7495 | }
|
7496 | return self;
|
7497 | }
|
7498 |
|
7499 |
|
7500 | var $$q = _export;
|
7501 | var DESCRIPTORS$5 = descriptors;
|
7502 | var create$8 = objectCreate;
|
7503 |
|
7504 |
|
7505 |
|
7506 | $$q({ target: 'Object', stat: true, sham: !DESCRIPTORS$5 }, {
|
7507 | create: create$8
|
7508 | });
|
7509 |
|
7510 | var path$a = path$o;
|
7511 |
|
7512 | var Object$1 = path$a.Object;
|
7513 |
|
7514 | var create$7 = function create(P, D) {
|
7515 | return Object$1.create(P, D);
|
7516 | };
|
7517 |
|
7518 | var parent$B = create$7;
|
7519 |
|
7520 | var create$6 = parent$B;
|
7521 |
|
7522 | var parent$A = create$6;
|
7523 |
|
7524 | var create$5 = parent$A;
|
7525 |
|
7526 | var parent$z = create$5;
|
7527 |
|
7528 | var create$4 = parent$z;
|
7529 |
|
7530 | var create$3 = create$4;
|
7531 |
|
7532 | var _Object$create$1 = getDefaultExportFromCjs(create$3);
|
7533 |
|
7534 | var $$p = _export;
|
7535 | var setPrototypeOf$6 = objectSetPrototypeOf;
|
7536 |
|
7537 |
|
7538 |
|
7539 | $$p({ target: 'Object', stat: true }, {
|
7540 | setPrototypeOf: setPrototypeOf$6
|
7541 | });
|
7542 |
|
7543 | var path$9 = path$o;
|
7544 |
|
7545 | var setPrototypeOf$5 = path$9.Object.setPrototypeOf;
|
7546 |
|
7547 | var parent$y = setPrototypeOf$5;
|
7548 |
|
7549 | var setPrototypeOf$4 = parent$y;
|
7550 |
|
7551 | var parent$x = setPrototypeOf$4;
|
7552 |
|
7553 | var setPrototypeOf$3 = parent$x;
|
7554 |
|
7555 | var parent$w = setPrototypeOf$3;
|
7556 |
|
7557 | var setPrototypeOf$2 = parent$w;
|
7558 |
|
7559 | var setPrototypeOf$1 = setPrototypeOf$2;
|
7560 |
|
7561 | var _Object$setPrototypeOf = getDefaultExportFromCjs(setPrototypeOf$1);
|
7562 |
|
7563 | var parent$v = bind$c;
|
7564 |
|
7565 | var bind$7 = parent$v;
|
7566 |
|
7567 | var parent$u = bind$7;
|
7568 |
|
7569 | var bind$6 = parent$u;
|
7570 |
|
7571 | var bind$5 = bind$6;
|
7572 |
|
7573 | var _bindInstanceProperty = getDefaultExportFromCjs(bind$5);
|
7574 |
|
7575 | function _setPrototypeOf(o, p) {
|
7576 | var _context;
|
7577 | _setPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$setPrototypeOf).call(_context) : function _setPrototypeOf(o, p) {
|
7578 | o.__proto__ = p;
|
7579 | return o;
|
7580 | };
|
7581 | return _setPrototypeOf(o, p);
|
7582 | }
|
7583 |
|
7584 | function _inherits(subClass, superClass) {
|
7585 | if (typeof superClass !== "function" && superClass !== null) {
|
7586 | throw new TypeError("Super expression must either be null or a function");
|
7587 | }
|
7588 | subClass.prototype = _Object$create$1(superClass && superClass.prototype, {
|
7589 | constructor: {
|
7590 | value: subClass,
|
7591 | writable: true,
|
7592 | configurable: true
|
7593 | }
|
7594 | });
|
7595 | _Object$defineProperty$1(subClass, "prototype", {
|
7596 | writable: false
|
7597 | });
|
7598 | if (superClass) _setPrototypeOf(subClass, superClass);
|
7599 | }
|
7600 |
|
7601 | function _possibleConstructorReturn(self, call) {
|
7602 | if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
|
7603 | return call;
|
7604 | } else if (call !== void 0) {
|
7605 | throw new TypeError("Derived constructors may only return object or undefined");
|
7606 | }
|
7607 | return _assertThisInitialized(self);
|
7608 | }
|
7609 |
|
7610 | var $$o = _export;
|
7611 | var fails$b = fails$u;
|
7612 | var toObject$5 = toObject$e;
|
7613 | var nativeGetPrototypeOf = objectGetPrototypeOf;
|
7614 | var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
|
7615 |
|
7616 | var FAILS_ON_PRIMITIVES$2 = fails$b(function () { nativeGetPrototypeOf(1); });
|
7617 |
|
7618 |
|
7619 |
|
7620 | $$o({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$2, sham: !CORRECT_PROTOTYPE_GETTER }, {
|
7621 | getPrototypeOf: function getPrototypeOf(it) {
|
7622 | return nativeGetPrototypeOf(toObject$5(it));
|
7623 | }
|
7624 | });
|
7625 |
|
7626 | var path$8 = path$o;
|
7627 |
|
7628 | var getPrototypeOf$5 = path$8.Object.getPrototypeOf;
|
7629 |
|
7630 | var parent$t = getPrototypeOf$5;
|
7631 |
|
7632 | var getPrototypeOf$4 = parent$t;
|
7633 |
|
7634 | var parent$s = getPrototypeOf$4;
|
7635 |
|
7636 | var getPrototypeOf$3 = parent$s;
|
7637 |
|
7638 | var parent$r = getPrototypeOf$3;
|
7639 |
|
7640 | var getPrototypeOf$2 = parent$r;
|
7641 |
|
7642 | var getPrototypeOf$1 = getPrototypeOf$2;
|
7643 |
|
7644 | var _Object$getPrototypeOf = getDefaultExportFromCjs(getPrototypeOf$1);
|
7645 |
|
7646 | function _getPrototypeOf(o) {
|
7647 | var _context;
|
7648 | _getPrototypeOf = _Object$setPrototypeOf ? _bindInstanceProperty(_context = _Object$getPrototypeOf).call(_context) : function _getPrototypeOf(o) {
|
7649 | return o.__proto__ || _Object$getPrototypeOf(o);
|
7650 | };
|
7651 | return _getPrototypeOf(o);
|
7652 | }
|
7653 |
|
7654 | var regeneratorRuntime$1 = {exports: {}};
|
7655 |
|
7656 | var _typeof = {exports: {}};
|
7657 |
|
7658 | (function (module) {
|
7659 | var _Symbol = symbol$1;
|
7660 | var _Symbol$iterator = iterator$1;
|
7661 | function _typeof(o) {
|
7662 | "@babel/helpers - typeof";
|
7663 |
|
7664 | return (module.exports = _typeof = "function" == typeof _Symbol && "symbol" == typeof _Symbol$iterator ? function (o) {
|
7665 | return typeof o;
|
7666 | } : function (o) {
|
7667 | return o && "function" == typeof _Symbol && o.constructor === _Symbol && o !== _Symbol.prototype ? "symbol" : typeof o;
|
7668 | }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
|
7669 | }
|
7670 | module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
7671 | } (_typeof));
|
7672 |
|
7673 | var _typeofExports = _typeof.exports;
|
7674 |
|
7675 | var parent$q = forEach$5;
|
7676 |
|
7677 | var forEach$3 = parent$q;
|
7678 |
|
7679 | var parent$p = forEach$3;
|
7680 |
|
7681 | var forEach$2 = parent$p;
|
7682 |
|
7683 | var forEach$1 = forEach$2;
|
7684 |
|
7685 | var DESCRIPTORS$4 = descriptors;
|
7686 | var isArray$2 = isArray$e;
|
7687 |
|
7688 | var $TypeError$5 = TypeError;
|
7689 |
|
7690 | var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
|
7691 |
|
7692 |
|
7693 | var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$4 && !function () {
|
7694 |
|
7695 | if (this !== undefined) return true;
|
7696 | try {
|
7697 |
|
7698 | Object.defineProperty([], 'length', { writable: false }).length = 1;
|
7699 | } catch (error) {
|
7700 | return error instanceof TypeError;
|
7701 | }
|
7702 | }();
|
7703 |
|
7704 | var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
|
7705 | if (isArray$2(O) && !getOwnPropertyDescriptor$1(O, 'length').writable) {
|
7706 | throw new $TypeError$5('Cannot set read only .length');
|
7707 | } return O.length = length;
|
7708 | } : function (O, length) {
|
7709 | return O.length = length;
|
7710 | };
|
7711 |
|
7712 | var $$n = _export;
|
7713 | var toObject$4 = toObject$e;
|
7714 | var lengthOfArrayLike$3 = lengthOfArrayLike$d;
|
7715 | var setArrayLength$1 = arraySetLength;
|
7716 | var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$4;
|
7717 | var fails$a = fails$u;
|
7718 |
|
7719 | var INCORRECT_TO_LENGTH = fails$a(function () {
|
7720 | return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
|
7721 | });
|
7722 |
|
7723 |
|
7724 |
|
7725 | var properErrorOnNonWritableLength = function () {
|
7726 | try {
|
7727 |
|
7728 | Object.defineProperty([], 'length', { writable: false }).push();
|
7729 | } catch (error) {
|
7730 | return error instanceof TypeError;
|
7731 | }
|
7732 | };
|
7733 |
|
7734 | var FORCED$1 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
|
7735 |
|
7736 |
|
7737 |
|
7738 | $$n({ target: 'Array', proto: true, arity: 1, forced: FORCED$1 }, {
|
7739 |
|
7740 | push: function push(item) {
|
7741 | var O = toObject$4(this);
|
7742 | var len = lengthOfArrayLike$3(O);
|
7743 | var argCount = arguments.length;
|
7744 | doesNotExceedSafeInteger$1(len + argCount);
|
7745 | for (var i = 0; i < argCount; i++) {
|
7746 | O[len] = arguments[i];
|
7747 | len++;
|
7748 | }
|
7749 | setArrayLength$1(O, len);
|
7750 | return len;
|
7751 | }
|
7752 | });
|
7753 |
|
7754 | var getBuiltInPrototypeMethod$8 = getBuiltInPrototypeMethod$g;
|
7755 |
|
7756 | var push$7 = getBuiltInPrototypeMethod$8('Array', 'push');
|
7757 |
|
7758 | var isPrototypeOf$b = objectIsPrototypeOf;
|
7759 | var method$8 = push$7;
|
7760 |
|
7761 | var ArrayPrototype$8 = Array.prototype;
|
7762 |
|
7763 | var push$6 = function (it) {
|
7764 | var own = it.push;
|
7765 | return it === ArrayPrototype$8 || (isPrototypeOf$b(ArrayPrototype$8, it) && own === ArrayPrototype$8.push) ? method$8 : own;
|
7766 | };
|
7767 |
|
7768 | var parent$o = push$6;
|
7769 |
|
7770 | var push$5 = parent$o;
|
7771 |
|
7772 | var parent$n = push$5;
|
7773 |
|
7774 | var push$4 = parent$n;
|
7775 |
|
7776 | var parent$m = push$4;
|
7777 |
|
7778 | var push$3 = parent$m;
|
7779 |
|
7780 | var push$2 = push$3;
|
7781 |
|
7782 | var _pushInstanceProperty = getDefaultExportFromCjs(push$2);
|
7783 |
|
7784 | var hasOwn$5 = hasOwnProperty_1;
|
7785 | var ownKeys$5 = ownKeys$7;
|
7786 | var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
|
7787 | var definePropertyModule = objectDefineProperty;
|
7788 |
|
7789 | var copyConstructorProperties$1 = function (target, source, exceptions) {
|
7790 | var keys = ownKeys$5(source);
|
7791 | var defineProperty = definePropertyModule.f;
|
7792 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
7793 | for (var i = 0; i < keys.length; i++) {
|
7794 | var key = keys[i];
|
7795 | if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
|
7796 | defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
7797 | }
|
7798 | }
|
7799 | };
|
7800 |
|
7801 | var isObject$5 = isObject$h;
|
7802 | var createNonEnumerableProperty$3 = createNonEnumerableProperty$9;
|
7803 |
|
7804 |
|
7805 |
|
7806 | var installErrorCause$1 = function (O, options) {
|
7807 | if (isObject$5(options) && 'cause' in options) {
|
7808 | createNonEnumerableProperty$3(O, 'cause', options.cause);
|
7809 | }
|
7810 | };
|
7811 |
|
7812 | var uncurryThis$4 = functionUncurryThis;
|
7813 |
|
7814 | var $Error$1 = Error;
|
7815 | var replace = uncurryThis$4(''.replace);
|
7816 |
|
7817 | var TEST = (function (arg) { return String(new $Error$1(arg).stack); })('zxcasd');
|
7818 |
|
7819 | var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
|
7820 | var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
|
7821 |
|
7822 | var errorStackClear = function (stack, dropEntries) {
|
7823 | if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error$1.prepareStackTrace) {
|
7824 | while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
|
7825 | } return stack;
|
7826 | };
|
7827 |
|
7828 | var fails$9 = fails$u;
|
7829 | var createPropertyDescriptor$1 = createPropertyDescriptor$7;
|
7830 |
|
7831 | var errorStackInstallable = !fails$9(function () {
|
7832 | var error = new Error('a');
|
7833 | if (!('stack' in error)) return true;
|
7834 |
|
7835 | Object.defineProperty(error, 'stack', createPropertyDescriptor$1(1, 7));
|
7836 | return error.stack !== 7;
|
7837 | });
|
7838 |
|
7839 | var createNonEnumerableProperty$2 = createNonEnumerableProperty$9;
|
7840 | var clearErrorStack = errorStackClear;
|
7841 | var ERROR_STACK_INSTALLABLE = errorStackInstallable;
|
7842 |
|
7843 |
|
7844 | var captureStackTrace = Error.captureStackTrace;
|
7845 |
|
7846 | var errorStackInstall = function (error, C, stack, dropEntries) {
|
7847 | if (ERROR_STACK_INSTALLABLE) {
|
7848 | if (captureStackTrace) captureStackTrace(error, C);
|
7849 | else createNonEnumerableProperty$2(error, 'stack', clearErrorStack(stack, dropEntries));
|
7850 | }
|
7851 | };
|
7852 |
|
7853 | var bind$4 = functionBindContext;
|
7854 | var call$7 = functionCall;
|
7855 | var anObject$2 = anObject$d;
|
7856 | var tryToString$1 = tryToString$6;
|
7857 | var isArrayIteratorMethod = isArrayIteratorMethod$2;
|
7858 | var lengthOfArrayLike$2 = lengthOfArrayLike$d;
|
7859 | var isPrototypeOf$a = objectIsPrototypeOf;
|
7860 | var getIterator$6 = getIterator$8;
|
7861 | var getIteratorMethod = getIteratorMethod$9;
|
7862 | var iteratorClose = iteratorClose$2;
|
7863 |
|
7864 | var $TypeError$4 = TypeError;
|
7865 |
|
7866 | var Result = function (stopped, result) {
|
7867 | this.stopped = stopped;
|
7868 | this.result = result;
|
7869 | };
|
7870 |
|
7871 | var ResultPrototype = Result.prototype;
|
7872 |
|
7873 | var iterate$7 = function (iterable, unboundFunction, options) {
|
7874 | var that = options && options.that;
|
7875 | var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
7876 | var IS_RECORD = !!(options && options.IS_RECORD);
|
7877 | var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
7878 | var INTERRUPTED = !!(options && options.INTERRUPTED);
|
7879 | var fn = bind$4(unboundFunction, that);
|
7880 | var iterator, iterFn, index, length, result, next, step;
|
7881 |
|
7882 | var stop = function (condition) {
|
7883 | if (iterator) iteratorClose(iterator, 'normal', condition);
|
7884 | return new Result(true, condition);
|
7885 | };
|
7886 |
|
7887 | var callFn = function (value) {
|
7888 | if (AS_ENTRIES) {
|
7889 | anObject$2(value);
|
7890 | return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
7891 | } return INTERRUPTED ? fn(value, stop) : fn(value);
|
7892 | };
|
7893 |
|
7894 | if (IS_RECORD) {
|
7895 | iterator = iterable.iterator;
|
7896 | } else if (IS_ITERATOR) {
|
7897 | iterator = iterable;
|
7898 | } else {
|
7899 | iterFn = getIteratorMethod(iterable);
|
7900 | if (!iterFn) throw new $TypeError$4(tryToString$1(iterable) + ' is not iterable');
|
7901 |
|
7902 | if (isArrayIteratorMethod(iterFn)) {
|
7903 | for (index = 0, length = lengthOfArrayLike$2(iterable); length > index; index++) {
|
7904 | result = callFn(iterable[index]);
|
7905 | if (result && isPrototypeOf$a(ResultPrototype, result)) return result;
|
7906 | } return new Result(false);
|
7907 | }
|
7908 | iterator = getIterator$6(iterable, iterFn);
|
7909 | }
|
7910 |
|
7911 | next = IS_RECORD ? iterable.next : iterator.next;
|
7912 | while (!(step = call$7(next, iterator)).done) {
|
7913 | try {
|
7914 | result = callFn(step.value);
|
7915 | } catch (error) {
|
7916 | iteratorClose(iterator, 'throw', error);
|
7917 | }
|
7918 | if (typeof result == 'object' && result && isPrototypeOf$a(ResultPrototype, result)) return result;
|
7919 | } return new Result(false);
|
7920 | };
|
7921 |
|
7922 | var toString$1 = toString$7;
|
7923 |
|
7924 | var normalizeStringArgument$1 = function (argument, $default) {
|
7925 | return argument === undefined ? arguments.length < 2 ? '' : $default : toString$1(argument);
|
7926 | };
|
7927 |
|
7928 | var $$m = _export;
|
7929 | var isPrototypeOf$9 = objectIsPrototypeOf;
|
7930 | var getPrototypeOf = objectGetPrototypeOf;
|
7931 | var setPrototypeOf = objectSetPrototypeOf;
|
7932 | var copyConstructorProperties = copyConstructorProperties$1;
|
7933 | var create$2 = objectCreate;
|
7934 | var createNonEnumerableProperty$1 = createNonEnumerableProperty$9;
|
7935 | var createPropertyDescriptor = createPropertyDescriptor$7;
|
7936 | var installErrorCause = installErrorCause$1;
|
7937 | var installErrorStack = errorStackInstall;
|
7938 | var iterate$6 = iterate$7;
|
7939 | var normalizeStringArgument = normalizeStringArgument$1;
|
7940 | var wellKnownSymbol$3 = wellKnownSymbol$n;
|
7941 |
|
7942 | var TO_STRING_TAG = wellKnownSymbol$3('toStringTag');
|
7943 | var $Error = Error;
|
7944 | var push$1 = [].push;
|
7945 |
|
7946 | var $AggregateError = function AggregateError(errors, message /* , options */) {
|
7947 | var isInstance = isPrototypeOf$9(AggregateErrorPrototype, this);
|
7948 | var that;
|
7949 | if (setPrototypeOf) {
|
7950 | that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
|
7951 | } else {
|
7952 | that = isInstance ? this : create$2(AggregateErrorPrototype);
|
7953 | createNonEnumerableProperty$1(that, TO_STRING_TAG, 'Error');
|
7954 | }
|
7955 | if (message !== undefined) createNonEnumerableProperty$1(that, 'message', normalizeStringArgument(message));
|
7956 | installErrorStack(that, $AggregateError, that.stack, 1);
|
7957 | if (arguments.length > 2) installErrorCause(that, arguments[2]);
|
7958 | var errorsArray = [];
|
7959 | iterate$6(errors, push$1, { that: errorsArray });
|
7960 | createNonEnumerableProperty$1(that, 'errors', errorsArray);
|
7961 | return that;
|
7962 | };
|
7963 |
|
7964 | if (setPrototypeOf) setPrototypeOf($AggregateError, $Error);
|
7965 | else copyConstructorProperties($AggregateError, $Error, { name: true });
|
7966 |
|
7967 | var AggregateErrorPrototype = $AggregateError.prototype = create$2($Error.prototype, {
|
7968 | constructor: createPropertyDescriptor(1, $AggregateError),
|
7969 | message: createPropertyDescriptor(1, ''),
|
7970 | name: createPropertyDescriptor(1, 'AggregateError')
|
7971 | });
|
7972 |
|
7973 | // `AggregateError` constructor
|
7974 | // https://tc39.es/ecma262/#sec-aggregate-error-constructor
|
7975 | $$m({ global: true, constructor: true, arity: 2 }, {
|
7976 | AggregateError: $AggregateError
|
7977 | });
|
7978 |
|
7979 | var getBuiltIn$3 = getBuiltIn$f;
|
7980 | var defineBuiltInAccessor$1 = defineBuiltInAccessor$3;
|
7981 | var wellKnownSymbol$2 = wellKnownSymbol$n;
|
7982 | var DESCRIPTORS$3 = descriptors;
|
7983 |
|
7984 | var SPECIES$2 = wellKnownSymbol$2('species');
|
7985 |
|
7986 | var setSpecies$2 = function (CONSTRUCTOR_NAME) {
|
7987 | var Constructor = getBuiltIn$3(CONSTRUCTOR_NAME);
|
7988 |
|
7989 | if (DESCRIPTORS$3 && Constructor && !Constructor[SPECIES$2]) {
|
7990 | defineBuiltInAccessor$1(Constructor, SPECIES$2, {
|
7991 | configurable: true,
|
7992 | get: function () { return this; }
|
7993 | });
|
7994 | }
|
7995 | };
|
7996 |
|
7997 | var isPrototypeOf$8 = objectIsPrototypeOf;
|
7998 |
|
7999 | var $TypeError$3 = TypeError;
|
8000 |
|
8001 | var anInstance$3 = function (it, Prototype) {
|
8002 | if (isPrototypeOf$8(Prototype, it)) return it;
|
8003 | throw new $TypeError$3('Incorrect invocation');
|
8004 | };
|
8005 |
|
8006 | var anObject$1 = anObject$d;
|
8007 | var aConstructor = aConstructor$2;
|
8008 | var isNullOrUndefined$2 = isNullOrUndefined$6;
|
8009 | var wellKnownSymbol$1 = wellKnownSymbol$n;
|
8010 |
|
8011 | var SPECIES$1 = wellKnownSymbol$1('species');
|
8012 |
|
8013 |
|
8014 |
|
8015 | var speciesConstructor$2 = function (O, defaultConstructor) {
|
8016 | var C = anObject$1(O).constructor;
|
8017 | var S;
|
8018 | return C === undefined || isNullOrUndefined$2(S = anObject$1(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
|
8019 | };
|
8020 |
|
8021 | var $TypeError$2 = TypeError;
|
8022 |
|
8023 | var validateArgumentsLength$2 = function (passed, required) {
|
8024 | if (passed < required) throw new $TypeError$2('Not enough arguments');
|
8025 | return passed;
|
8026 | };
|
8027 |
|
8028 | var userAgent$4 = engineUserAgent;
|
8029 |
|
8030 |
|
8031 | var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$4);
|
8032 |
|
8033 | var global$9 = global$p;
|
8034 | var apply$2 = functionApply;
|
8035 | var bind$3 = functionBindContext;
|
8036 | var isCallable$5 = isCallable$m;
|
8037 | var hasOwn$4 = hasOwnProperty_1;
|
8038 | var fails$8 = fails$u;
|
8039 | var html = html$2;
|
8040 | var arraySlice$2 = arraySlice$5;
|
8041 | var createElement = documentCreateElement$1;
|
8042 | var validateArgumentsLength$1 = validateArgumentsLength$2;
|
8043 | var IS_IOS$1 = engineIsIos;
|
8044 | var IS_NODE$3 = engineIsNode;
|
8045 |
|
8046 | var set$3 = global$9.setImmediate;
|
8047 | var clear = global$9.clearImmediate;
|
8048 | var process$2 = global$9.process;
|
8049 | var Dispatch = global$9.Dispatch;
|
8050 | var Function$2 = global$9.Function;
|
8051 | var MessageChannel = global$9.MessageChannel;
|
8052 | var String$1 = global$9.String;
|
8053 | var counter = 0;
|
8054 | var queue$2 = {};
|
8055 | var ONREADYSTATECHANGE = 'onreadystatechange';
|
8056 | var $location, defer, channel, port;
|
8057 |
|
8058 | fails$8(function () {
|
8059 |
|
8060 | $location = global$9.location;
|
8061 | });
|
8062 |
|
8063 | var run = function (id) {
|
8064 | if (hasOwn$4(queue$2, id)) {
|
8065 | var fn = queue$2[id];
|
8066 | delete queue$2[id];
|
8067 | fn();
|
8068 | }
|
8069 | };
|
8070 |
|
8071 | var runner = function (id) {
|
8072 | return function () {
|
8073 | run(id);
|
8074 | };
|
8075 | };
|
8076 |
|
8077 | var eventListener = function (event) {
|
8078 | run(event.data);
|
8079 | };
|
8080 |
|
8081 | var globalPostMessageDefer = function (id) {
|
8082 |
|
8083 | global$9.postMessage(String$1(id), $location.protocol + '//' + $location.host);
|
8084 | };
|
8085 |
|
8086 |
|
8087 | if (!set$3 || !clear) {
|
8088 | set$3 = function setImmediate(handler) {
|
8089 | validateArgumentsLength$1(arguments.length, 1);
|
8090 | var fn = isCallable$5(handler) ? handler : Function$2(handler);
|
8091 | var args = arraySlice$2(arguments, 1);
|
8092 | queue$2[++counter] = function () {
|
8093 | apply$2(fn, undefined, args);
|
8094 | };
|
8095 | defer(counter);
|
8096 | return counter;
|
8097 | };
|
8098 | clear = function clearImmediate(id) {
|
8099 | delete queue$2[id];
|
8100 | };
|
8101 |
|
8102 | if (IS_NODE$3) {
|
8103 | defer = function (id) {
|
8104 | process$2.nextTick(runner(id));
|
8105 | };
|
8106 |
|
8107 | } else if (Dispatch && Dispatch.now) {
|
8108 | defer = function (id) {
|
8109 | Dispatch.now(runner(id));
|
8110 | };
|
8111 |
|
8112 |
|
8113 | } else if (MessageChannel && !IS_IOS$1) {
|
8114 | channel = new MessageChannel();
|
8115 | port = channel.port2;
|
8116 | channel.port1.onmessage = eventListener;
|
8117 | defer = bind$3(port.postMessage, port);
|
8118 |
|
8119 |
|
8120 | } else if (
|
8121 | global$9.addEventListener &&
|
8122 | isCallable$5(global$9.postMessage) &&
|
8123 | !global$9.importScripts &&
|
8124 | $location && $location.protocol !== 'file:' &&
|
8125 | !fails$8(globalPostMessageDefer)
|
8126 | ) {
|
8127 | defer = globalPostMessageDefer;
|
8128 | global$9.addEventListener('message', eventListener, false);
|
8129 |
|
8130 | } else if (ONREADYSTATECHANGE in createElement('script')) {
|
8131 | defer = function (id) {
|
8132 | html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
|
8133 | html.removeChild(this);
|
8134 | run(id);
|
8135 | };
|
8136 | };
|
8137 |
|
8138 | } else {
|
8139 | defer = function (id) {
|
8140 | setTimeout(runner(id), 0);
|
8141 | };
|
8142 | }
|
8143 | }
|
8144 |
|
8145 | var task$1 = {
|
8146 | set: set$3,
|
8147 | clear: clear
|
8148 | };
|
8149 |
|
8150 | var Queue$3 = function () {
|
8151 | this.head = null;
|
8152 | this.tail = null;
|
8153 | };
|
8154 |
|
8155 | Queue$3.prototype = {
|
8156 | add: function (item) {
|
8157 | var entry = { item: item, next: null };
|
8158 | var tail = this.tail;
|
8159 | if (tail) tail.next = entry;
|
8160 | else this.head = entry;
|
8161 | this.tail = entry;
|
8162 | },
|
8163 | get: function () {
|
8164 | var entry = this.head;
|
8165 | if (entry) {
|
8166 | var next = this.head = entry.next;
|
8167 | if (next === null) this.tail = null;
|
8168 | return entry.item;
|
8169 | }
|
8170 | }
|
8171 | };
|
8172 |
|
8173 | var queue$1 = Queue$3;
|
8174 |
|
8175 | var userAgent$3 = engineUserAgent;
|
8176 |
|
8177 | var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$3) && typeof Pebble != 'undefined';
|
8178 |
|
8179 | var userAgent$2 = engineUserAgent;
|
8180 |
|
8181 | var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent$2);
|
8182 |
|
8183 | var global$8 = global$p;
|
8184 | var bind$2 = functionBindContext;
|
8185 | var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
|
8186 | var macrotask = task$1.set;
|
8187 | var Queue$2 = queue$1;
|
8188 | var IS_IOS = engineIsIos;
|
8189 | var IS_IOS_PEBBLE = engineIsIosPebble;
|
8190 | var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
|
8191 | var IS_NODE$2 = engineIsNode;
|
8192 |
|
8193 | var MutationObserver = global$8.MutationObserver || global$8.WebKitMutationObserver;
|
8194 | var document$2 = global$8.document;
|
8195 | var process$1 = global$8.process;
|
8196 | var Promise$1 = global$8.Promise;
|
8197 | // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
|
8198 | var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$8, 'queueMicrotask');
|
8199 | var microtask$1 = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
|
8200 | var notify$1, toggle, node, promise$5, then;
|
8201 |
|
8202 | // modern engines have queueMicrotask method
|
8203 | if (!microtask$1) {
|
8204 | var queue = new Queue$2();
|
8205 |
|
8206 | var flush = function () {
|
8207 | var parent, fn;
|
8208 | if (IS_NODE$2 && (parent = process$1.domain)) parent.exit();
|
8209 | while (fn = queue.get()) try {
|
8210 | fn();
|
8211 | } catch (error) {
|
8212 | if (queue.head) notify$1();
|
8213 | throw error;
|
8214 | }
|
8215 | if (parent) parent.enter();
|
8216 | };
|
8217 |
|
8218 |
|
8219 |
|
8220 | if (!IS_IOS && !IS_NODE$2 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
|
8221 | toggle = true;
|
8222 | node = document$2.createTextNode('');
|
8223 | new MutationObserver(flush).observe(node, { characterData: true });
|
8224 | notify$1 = function () {
|
8225 | node.data = toggle = !toggle;
|
8226 | };
|
8227 |
|
8228 | } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
|
8229 |
|
8230 | promise$5 = Promise$1.resolve(undefined);
|
8231 |
|
8232 | promise$5.constructor = Promise$1;
|
8233 | then = bind$2(promise$5.then, promise$5);
|
8234 | notify$1 = function () {
|
8235 | then(flush);
|
8236 | };
|
8237 |
|
8238 | } else if (IS_NODE$2) {
|
8239 | notify$1 = function () {
|
8240 | process$1.nextTick(flush);
|
8241 | };
|
8242 |
|
8243 |
|
8244 |
|
8245 |
|
8246 |
|
8247 |
|
8248 | } else {
|
8249 |
|
8250 | macrotask = bind$2(macrotask, global$8);
|
8251 | notify$1 = function () {
|
8252 | macrotask(flush);
|
8253 | };
|
8254 | }
|
8255 |
|
8256 | microtask$1 = function (fn) {
|
8257 | if (!queue.head) notify$1();
|
8258 | queue.add(fn);
|
8259 | };
|
8260 | }
|
8261 |
|
8262 | var microtask_1 = microtask$1;
|
8263 |
|
8264 | var hostReportErrors$1 = function (a, b) {
|
8265 | try {
|
8266 |
|
8267 | arguments.length === 1 ? console.error(a) : console.error(a, b);
|
8268 | } catch (error) { }
|
8269 | };
|
8270 |
|
8271 | var perform$6 = function (exec) {
|
8272 | try {
|
8273 | return { error: false, value: exec() };
|
8274 | } catch (error) {
|
8275 | return { error: true, value: error };
|
8276 | }
|
8277 | };
|
8278 |
|
8279 | var global$7 = global$p;
|
8280 |
|
8281 | var promiseNativeConstructor = global$7.Promise;
|
8282 |
|
8283 |
|
8284 | var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
|
8285 |
|
8286 | var IS_DENO$1 = engineIsDeno;
|
8287 | var IS_NODE$1 = engineIsNode;
|
8288 |
|
8289 | var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
|
8290 | && typeof window == 'object'
|
8291 | && typeof document == 'object';
|
8292 |
|
8293 | var global$6 = global$p;
|
8294 | var NativePromiseConstructor$5 = promiseNativeConstructor;
|
8295 | var isCallable$4 = isCallable$m;
|
8296 | var isForced = isForced_1;
|
8297 | var inspectSource = inspectSource$2;
|
8298 | var wellKnownSymbol = wellKnownSymbol$n;
|
8299 | var IS_BROWSER = engineIsBrowser;
|
8300 | var IS_DENO = engineIsDeno;
|
8301 | var V8_VERSION = engineV8Version;
|
8302 |
|
8303 | var NativePromisePrototype$2 = NativePromiseConstructor$5 && NativePromiseConstructor$5.prototype;
|
8304 | var SPECIES = wellKnownSymbol('species');
|
8305 | var SUBCLASSING = false;
|
8306 | var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$4(global$6.PromiseRejectionEvent);
|
8307 |
|
8308 | var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
|
8309 | var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$5);
|
8310 | var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$5);
|
8311 |
|
8312 |
|
8313 |
|
8314 | if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
|
8315 |
|
8316 | if (!(NativePromisePrototype$2['catch'] && NativePromisePrototype$2['finally'])) return true;
|
8317 |
|
8318 |
|
8319 |
|
8320 | if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
|
8321 |
|
8322 | var promise = new NativePromiseConstructor$5(function (resolve) { resolve(1); });
|
8323 | var FakePromise = function (exec) {
|
8324 | exec(function () { }, function () { });
|
8325 | };
|
8326 | var constructor = promise.constructor = {};
|
8327 | constructor[SPECIES] = FakePromise;
|
8328 | SUBCLASSING = promise.then(function () { }) instanceof FakePromise;
|
8329 | if (!SUBCLASSING) return true;
|
8330 |
|
8331 | } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
|
8332 | });
|
8333 |
|
8334 | var promiseConstructorDetection = {
|
8335 | CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
|
8336 | REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
|
8337 | SUBCLASSING: SUBCLASSING
|
8338 | };
|
8339 |
|
8340 | var newPromiseCapability$2 = {};
|
8341 |
|
8342 | var aCallable$6 = aCallable$e;
|
8343 |
|
8344 | var $TypeError$1 = TypeError;
|
8345 |
|
8346 | var PromiseCapability = function (C) {
|
8347 | var resolve, reject;
|
8348 | this.promise = new C(function ($$resolve, $$reject) {
|
8349 | if (resolve !== undefined || reject !== undefined) throw new $TypeError$1('Bad Promise constructor');
|
8350 | resolve = $$resolve;
|
8351 | reject = $$reject;
|
8352 | });
|
8353 | this.resolve = aCallable$6(resolve);
|
8354 | this.reject = aCallable$6(reject);
|
8355 | };
|
8356 |
|
8357 |
|
8358 |
|
8359 | newPromiseCapability$2.f = function (C) {
|
8360 | return new PromiseCapability(C);
|
8361 | };
|
8362 |
|
8363 | var $$l = _export;
|
8364 | var IS_NODE = engineIsNode;
|
8365 | var global$5 = global$p;
|
8366 | var call$6 = functionCall;
|
8367 | var defineBuiltIn$1 = defineBuiltIn$6;
|
8368 | var setToStringTag$1 = setToStringTag$7;
|
8369 | var setSpecies$1 = setSpecies$2;
|
8370 | var aCallable$5 = aCallable$e;
|
8371 | var isCallable$3 = isCallable$m;
|
8372 | var isObject$4 = isObject$h;
|
8373 | var anInstance$2 = anInstance$3;
|
8374 | var speciesConstructor$1 = speciesConstructor$2;
|
8375 | var task = task$1.set;
|
8376 | var microtask = microtask_1;
|
8377 | var hostReportErrors = hostReportErrors$1;
|
8378 | var perform$5 = perform$6;
|
8379 | var Queue$1 = queue$1;
|
8380 | var InternalStateModule$2 = internalState;
|
8381 | var NativePromiseConstructor$4 = promiseNativeConstructor;
|
8382 | var PromiseConstructorDetection = promiseConstructorDetection;
|
8383 | var newPromiseCapabilityModule$7 = newPromiseCapability$2;
|
8384 |
|
8385 | var PROMISE = 'Promise';
|
8386 | var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
|
8387 | var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
|
8388 | PromiseConstructorDetection.SUBCLASSING;
|
8389 | var getInternalPromiseState = InternalStateModule$2.getterFor(PROMISE);
|
8390 | var setInternalState$2 = InternalStateModule$2.set;
|
8391 | var NativePromisePrototype$1 = NativePromiseConstructor$4 && NativePromiseConstructor$4.prototype;
|
8392 | var PromiseConstructor = NativePromiseConstructor$4;
|
8393 | var PromisePrototype = NativePromisePrototype$1;
|
8394 | var TypeError$1 = global$5.TypeError;
|
8395 | var document$1 = global$5.document;
|
8396 | var process = global$5.process;
|
8397 | var newPromiseCapability$1 = newPromiseCapabilityModule$7.f;
|
8398 | var newGenericPromiseCapability = newPromiseCapability$1;
|
8399 |
|
8400 | var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$5.dispatchEvent);
|
8401 | var UNHANDLED_REJECTION = 'unhandledrejection';
|
8402 | var REJECTION_HANDLED = 'rejectionhandled';
|
8403 | var PENDING = 0;
|
8404 | var FULFILLED = 1;
|
8405 | var REJECTED = 2;
|
8406 | var HANDLED = 1;
|
8407 | var UNHANDLED = 2;
|
8408 |
|
8409 | var Internal, OwnPromiseCapability, PromiseWrapper;
|
8410 |
|
8411 | // helpers
|
8412 | var isThenable = function (it) {
|
8413 | var then;
|
8414 | return isObject$4(it) && isCallable$3(then = it.then) ? then : false;
|
8415 | };
|
8416 |
|
8417 | var callReaction = function (reaction, state) {
|
8418 | var value = state.value;
|
8419 | var ok = state.state === FULFILLED;
|
8420 | var handler = ok ? reaction.ok : reaction.fail;
|
8421 | var resolve = reaction.resolve;
|
8422 | var reject = reaction.reject;
|
8423 | var domain = reaction.domain;
|
8424 | var result, then, exited;
|
8425 | try {
|
8426 | if (handler) {
|
8427 | if (!ok) {
|
8428 | if (state.rejection === UNHANDLED) onHandleUnhandled(state);
|
8429 | state.rejection = HANDLED;
|
8430 | }
|
8431 | if (handler === true) result = value;
|
8432 | else {
|
8433 | if (domain) domain.enter();
|
8434 | result = handler(value);
|
8435 | if (domain) {
|
8436 | domain.exit();
|
8437 | exited = true;
|
8438 | }
|
8439 | }
|
8440 | if (result === reaction.promise) {
|
8441 | reject(new TypeError$1('Promise-chain cycle'));
|
8442 | } else if (then = isThenable(result)) {
|
8443 | call$6(then, result, resolve, reject);
|
8444 | } else resolve(result);
|
8445 | } else reject(value);
|
8446 | } catch (error) {
|
8447 | if (domain && !exited) domain.exit();
|
8448 | reject(error);
|
8449 | }
|
8450 | };
|
8451 |
|
8452 | var notify = function (state, isReject) {
|
8453 | if (state.notified) return;
|
8454 | state.notified = true;
|
8455 | microtask(function () {
|
8456 | var reactions = state.reactions;
|
8457 | var reaction;
|
8458 | while (reaction = reactions.get()) {
|
8459 | callReaction(reaction, state);
|
8460 | }
|
8461 | state.notified = false;
|
8462 | if (isReject && !state.rejection) onUnhandled(state);
|
8463 | });
|
8464 | };
|
8465 |
|
8466 | var dispatchEvent = function (name, promise, reason) {
|
8467 | var event, handler;
|
8468 | if (DISPATCH_EVENT) {
|
8469 | event = document$1.createEvent('Event');
|
8470 | event.promise = promise;
|
8471 | event.reason = reason;
|
8472 | event.initEvent(name, false, true);
|
8473 | global$5.dispatchEvent(event);
|
8474 | } else event = { promise: promise, reason: reason };
|
8475 | if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$5['on' + name])) handler(event);
|
8476 | else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
|
8477 | };
|
8478 |
|
8479 | var onUnhandled = function (state) {
|
8480 | call$6(task, global$5, function () {
|
8481 | var promise = state.facade;
|
8482 | var value = state.value;
|
8483 | var IS_UNHANDLED = isUnhandled(state);
|
8484 | var result;
|
8485 | if (IS_UNHANDLED) {
|
8486 | result = perform$5(function () {
|
8487 | if (IS_NODE) {
|
8488 | process.emit('unhandledRejection', value, promise);
|
8489 | } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
|
8490 | });
|
8491 |
|
8492 | state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
|
8493 | if (result.error) throw result.value;
|
8494 | }
|
8495 | });
|
8496 | };
|
8497 |
|
8498 | var isUnhandled = function (state) {
|
8499 | return state.rejection !== HANDLED && !state.parent;
|
8500 | };
|
8501 |
|
8502 | var onHandleUnhandled = function (state) {
|
8503 | call$6(task, global$5, function () {
|
8504 | var promise = state.facade;
|
8505 | if (IS_NODE) {
|
8506 | process.emit('rejectionHandled', promise);
|
8507 | } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
|
8508 | });
|
8509 | };
|
8510 |
|
8511 | var bind$1 = function (fn, state, unwrap) {
|
8512 | return function (value) {
|
8513 | fn(state, value, unwrap);
|
8514 | };
|
8515 | };
|
8516 |
|
8517 | var internalReject = function (state, value, unwrap) {
|
8518 | if (state.done) return;
|
8519 | state.done = true;
|
8520 | if (unwrap) state = unwrap;
|
8521 | state.value = value;
|
8522 | state.state = REJECTED;
|
8523 | notify(state, true);
|
8524 | };
|
8525 |
|
8526 | var internalResolve = function (state, value, unwrap) {
|
8527 | if (state.done) return;
|
8528 | state.done = true;
|
8529 | if (unwrap) state = unwrap;
|
8530 | try {
|
8531 | if (state.facade === value) throw new TypeError$1("Promise can't be resolved itself");
|
8532 | var then = isThenable(value);
|
8533 | if (then) {
|
8534 | microtask(function () {
|
8535 | var wrapper = { done: false };
|
8536 | try {
|
8537 | call$6(then, value,
|
8538 | bind$1(internalResolve, wrapper, state),
|
8539 | bind$1(internalReject, wrapper, state)
|
8540 | );
|
8541 | } catch (error) {
|
8542 | internalReject(wrapper, error, state);
|
8543 | }
|
8544 | });
|
8545 | } else {
|
8546 | state.value = value;
|
8547 | state.state = FULFILLED;
|
8548 | notify(state, false);
|
8549 | }
|
8550 | } catch (error) {
|
8551 | internalReject({ done: false }, error, state);
|
8552 | }
|
8553 | };
|
8554 |
|
8555 |
|
8556 | if (FORCED_PROMISE_CONSTRUCTOR$4) {
|
8557 |
|
8558 | PromiseConstructor = function Promise(executor) {
|
8559 | anInstance$2(this, PromisePrototype);
|
8560 | aCallable$5(executor);
|
8561 | call$6(Internal, this);
|
8562 | var state = getInternalPromiseState(this);
|
8563 | try {
|
8564 | executor(bind$1(internalResolve, state), bind$1(internalReject, state));
|
8565 | } catch (error) {
|
8566 | internalReject(state, error);
|
8567 | }
|
8568 | };
|
8569 |
|
8570 | PromisePrototype = PromiseConstructor.prototype;
|
8571 |
|
8572 |
|
8573 | Internal = function Promise(executor) {
|
8574 | setInternalState$2(this, {
|
8575 | type: PROMISE,
|
8576 | done: false,
|
8577 | notified: false,
|
8578 | parent: false,
|
8579 | reactions: new Queue$1(),
|
8580 | rejection: false,
|
8581 | state: PENDING,
|
8582 | value: undefined
|
8583 | });
|
8584 | };
|
8585 |
|
8586 |
|
8587 |
|
8588 | Internal.prototype = defineBuiltIn$1(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
|
8589 | var state = getInternalPromiseState(this);
|
8590 | var reaction = newPromiseCapability$1(speciesConstructor$1(this, PromiseConstructor));
|
8591 | state.parent = true;
|
8592 | reaction.ok = isCallable$3(onFulfilled) ? onFulfilled : true;
|
8593 | reaction.fail = isCallable$3(onRejected) && onRejected;
|
8594 | reaction.domain = IS_NODE ? process.domain : undefined;
|
8595 | if (state.state === PENDING) state.reactions.add(reaction);
|
8596 | else microtask(function () {
|
8597 | callReaction(reaction, state);
|
8598 | });
|
8599 | return reaction.promise;
|
8600 | });
|
8601 |
|
8602 | OwnPromiseCapability = function () {
|
8603 | var promise = new Internal();
|
8604 | var state = getInternalPromiseState(promise);
|
8605 | this.promise = promise;
|
8606 | this.resolve = bind$1(internalResolve, state);
|
8607 | this.reject = bind$1(internalReject, state);
|
8608 | };
|
8609 |
|
8610 | newPromiseCapabilityModule$7.f = newPromiseCapability$1 = function (C) {
|
8611 | return C === PromiseConstructor || C === PromiseWrapper
|
8612 | ? new OwnPromiseCapability(C)
|
8613 | : newGenericPromiseCapability(C);
|
8614 | };
|
8615 | }
|
8616 |
|
8617 | $$l({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
|
8618 | Promise: PromiseConstructor
|
8619 | });
|
8620 |
|
8621 | setToStringTag$1(PromiseConstructor, PROMISE, false, true);
|
8622 | setSpecies$1(PROMISE);
|
8623 |
|
8624 | var NativePromiseConstructor$3 = promiseNativeConstructor;
|
8625 | var checkCorrectnessOfIteration = checkCorrectnessOfIteration$2;
|
8626 | var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
|
8627 |
|
8628 | var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
|
8629 | NativePromiseConstructor$3.all(iterable).then(undefined, function () { });
|
8630 | });
|
8631 |
|
8632 | var $$k = _export;
|
8633 | var call$5 = functionCall;
|
8634 | var aCallable$4 = aCallable$e;
|
8635 | var newPromiseCapabilityModule$6 = newPromiseCapability$2;
|
8636 | var perform$4 = perform$6;
|
8637 | var iterate$5 = iterate$7;
|
8638 | var PROMISE_STATICS_INCORRECT_ITERATION$3 = promiseStaticsIncorrectIteration;
|
8639 |
|
8640 |
|
8641 |
|
8642 | $$k({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$3 }, {
|
8643 | all: function all(iterable) {
|
8644 | var C = this;
|
8645 | var capability = newPromiseCapabilityModule$6.f(C);
|
8646 | var resolve = capability.resolve;
|
8647 | var reject = capability.reject;
|
8648 | var result = perform$4(function () {
|
8649 | var $promiseResolve = aCallable$4(C.resolve);
|
8650 | var values = [];
|
8651 | var counter = 0;
|
8652 | var remaining = 1;
|
8653 | iterate$5(iterable, function (promise) {
|
8654 | var index = counter++;
|
8655 | var alreadyCalled = false;
|
8656 | remaining++;
|
8657 | call$5($promiseResolve, C, promise).then(function (value) {
|
8658 | if (alreadyCalled) return;
|
8659 | alreadyCalled = true;
|
8660 | values[index] = value;
|
8661 | --remaining || resolve(values);
|
8662 | }, reject);
|
8663 | });
|
8664 | --remaining || resolve(values);
|
8665 | });
|
8666 | if (result.error) reject(result.value);
|
8667 | return capability.promise;
|
8668 | }
|
8669 | });
|
8670 |
|
8671 | var $$j = _export;
|
8672 | var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
|
8673 | var NativePromiseConstructor$2 = promiseNativeConstructor;
|
8674 |
|
8675 | NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
|
8676 |
|
8677 |
|
8678 |
|
8679 | $$j({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
|
8680 | 'catch': function (onRejected) {
|
8681 | return this.then(undefined, onRejected);
|
8682 | }
|
8683 | });
|
8684 |
|
8685 | var $$i = _export;
|
8686 | var call$4 = functionCall;
|
8687 | var aCallable$3 = aCallable$e;
|
8688 | var newPromiseCapabilityModule$5 = newPromiseCapability$2;
|
8689 | var perform$3 = perform$6;
|
8690 | var iterate$4 = iterate$7;
|
8691 | var PROMISE_STATICS_INCORRECT_ITERATION$2 = promiseStaticsIncorrectIteration;
|
8692 |
|
8693 |
|
8694 |
|
8695 | $$i({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$2 }, {
|
8696 | race: function race(iterable) {
|
8697 | var C = this;
|
8698 | var capability = newPromiseCapabilityModule$5.f(C);
|
8699 | var reject = capability.reject;
|
8700 | var result = perform$3(function () {
|
8701 | var $promiseResolve = aCallable$3(C.resolve);
|
8702 | iterate$4(iterable, function (promise) {
|
8703 | call$4($promiseResolve, C, promise).then(capability.resolve, reject);
|
8704 | });
|
8705 | });
|
8706 | if (result.error) reject(result.value);
|
8707 | return capability.promise;
|
8708 | }
|
8709 | });
|
8710 |
|
8711 | var $$h = _export;
|
8712 | var call$3 = functionCall;
|
8713 | var newPromiseCapabilityModule$4 = newPromiseCapability$2;
|
8714 | var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
|
8715 |
|
8716 |
|
8717 |
|
8718 | $$h({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
|
8719 | reject: function reject(r) {
|
8720 | var capability = newPromiseCapabilityModule$4.f(this);
|
8721 | call$3(capability.reject, undefined, r);
|
8722 | return capability.promise;
|
8723 | }
|
8724 | });
|
8725 |
|
8726 | var anObject = anObject$d;
|
8727 | var isObject$3 = isObject$h;
|
8728 | var newPromiseCapability = newPromiseCapability$2;
|
8729 |
|
8730 | var promiseResolve$2 = function (C, x) {
|
8731 | anObject(C);
|
8732 | if (isObject$3(x) && x.constructor === C) return x;
|
8733 | var promiseCapability = newPromiseCapability.f(C);
|
8734 | var resolve = promiseCapability.resolve;
|
8735 | resolve(x);
|
8736 | return promiseCapability.promise;
|
8737 | };
|
8738 |
|
8739 | var $$g = _export;
|
8740 | var getBuiltIn$2 = getBuiltIn$f;
|
8741 | var IS_PURE = isPure;
|
8742 | var NativePromiseConstructor$1 = promiseNativeConstructor;
|
8743 | var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
|
8744 | var promiseResolve$1 = promiseResolve$2;
|
8745 |
|
8746 | var PromiseConstructorWrapper = getBuiltIn$2('Promise');
|
8747 | var CHECK_WRAPPER = !FORCED_PROMISE_CONSTRUCTOR;
|
8748 |
|
8749 |
|
8750 |
|
8751 | $$g({ target: 'Promise', stat: true, forced: IS_PURE }, {
|
8752 | resolve: function resolve(x) {
|
8753 | return promiseResolve$1(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor$1 : this, x);
|
8754 | }
|
8755 | });
|
8756 |
|
8757 | var $$f = _export;
|
8758 | var call$2 = functionCall;
|
8759 | var aCallable$2 = aCallable$e;
|
8760 | var newPromiseCapabilityModule$3 = newPromiseCapability$2;
|
8761 | var perform$2 = perform$6;
|
8762 | var iterate$3 = iterate$7;
|
8763 | var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
|
8764 |
|
8765 |
|
8766 |
|
8767 | $$f({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
|
8768 | allSettled: function allSettled(iterable) {
|
8769 | var C = this;
|
8770 | var capability = newPromiseCapabilityModule$3.f(C);
|
8771 | var resolve = capability.resolve;
|
8772 | var reject = capability.reject;
|
8773 | var result = perform$2(function () {
|
8774 | var promiseResolve = aCallable$2(C.resolve);
|
8775 | var values = [];
|
8776 | var counter = 0;
|
8777 | var remaining = 1;
|
8778 | iterate$3(iterable, function (promise) {
|
8779 | var index = counter++;
|
8780 | var alreadyCalled = false;
|
8781 | remaining++;
|
8782 | call$2(promiseResolve, C, promise).then(function (value) {
|
8783 | if (alreadyCalled) return;
|
8784 | alreadyCalled = true;
|
8785 | values[index] = { status: 'fulfilled', value: value };
|
8786 | --remaining || resolve(values);
|
8787 | }, function (error) {
|
8788 | if (alreadyCalled) return;
|
8789 | alreadyCalled = true;
|
8790 | values[index] = { status: 'rejected', reason: error };
|
8791 | --remaining || resolve(values);
|
8792 | });
|
8793 | });
|
8794 | --remaining || resolve(values);
|
8795 | });
|
8796 | if (result.error) reject(result.value);
|
8797 | return capability.promise;
|
8798 | }
|
8799 | });
|
8800 |
|
8801 | var $$e = _export;
|
8802 | var call$1 = functionCall;
|
8803 | var aCallable$1 = aCallable$e;
|
8804 | var getBuiltIn$1 = getBuiltIn$f;
|
8805 | var newPromiseCapabilityModule$2 = newPromiseCapability$2;
|
8806 | var perform$1 = perform$6;
|
8807 | var iterate$2 = iterate$7;
|
8808 | var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
|
8809 |
|
8810 | var PROMISE_ANY_ERROR = 'No one promise resolved';
|
8811 |
|
8812 |
|
8813 |
|
8814 | $$e({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
|
8815 | any: function any(iterable) {
|
8816 | var C = this;
|
8817 | var AggregateError = getBuiltIn$1('AggregateError');
|
8818 | var capability = newPromiseCapabilityModule$2.f(C);
|
8819 | var resolve = capability.resolve;
|
8820 | var reject = capability.reject;
|
8821 | var result = perform$1(function () {
|
8822 | var promiseResolve = aCallable$1(C.resolve);
|
8823 | var errors = [];
|
8824 | var counter = 0;
|
8825 | var remaining = 1;
|
8826 | var alreadyResolved = false;
|
8827 | iterate$2(iterable, function (promise) {
|
8828 | var index = counter++;
|
8829 | var alreadyRejected = false;
|
8830 | remaining++;
|
8831 | call$1(promiseResolve, C, promise).then(function (value) {
|
8832 | if (alreadyRejected || alreadyResolved) return;
|
8833 | alreadyResolved = true;
|
8834 | resolve(value);
|
8835 | }, function (error) {
|
8836 | if (alreadyRejected || alreadyResolved) return;
|
8837 | alreadyRejected = true;
|
8838 | errors[index] = error;
|
8839 | --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
|
8840 | });
|
8841 | });
|
8842 | --remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
|
8843 | });
|
8844 | if (result.error) reject(result.value);
|
8845 | return capability.promise;
|
8846 | }
|
8847 | });
|
8848 |
|
8849 | var $$d = _export;
|
8850 | var NativePromiseConstructor = promiseNativeConstructor;
|
8851 | var fails$7 = fails$u;
|
8852 | var getBuiltIn = getBuiltIn$f;
|
8853 | var isCallable$2 = isCallable$m;
|
8854 | var speciesConstructor = speciesConstructor$2;
|
8855 | var promiseResolve = promiseResolve$2;
|
8856 |
|
8857 | var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
|
8858 |
|
8859 |
|
8860 | var NON_GENERIC = !!NativePromiseConstructor && fails$7(function () {
|
8861 |
|
8862 | NativePromisePrototype['finally'].call({ then: function () { } }, function () { });
|
8863 | });
|
8864 |
|
8865 |
|
8866 |
|
8867 | $$d({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
|
8868 | 'finally': function (onFinally) {
|
8869 | var C = speciesConstructor(this, getBuiltIn('Promise'));
|
8870 | var isFunction = isCallable$2(onFinally);
|
8871 | return this.then(
|
8872 | isFunction ? function (x) {
|
8873 | return promiseResolve(C, onFinally()).then(function () { return x; });
|
8874 | } : onFinally,
|
8875 | isFunction ? function (e) {
|
8876 | return promiseResolve(C, onFinally()).then(function () { throw e; });
|
8877 | } : onFinally
|
8878 | );
|
8879 | }
|
8880 | });
|
8881 |
|
8882 | var path$7 = path$o;
|
8883 |
|
8884 | var promise$4 = path$7.Promise;
|
8885 |
|
8886 | var parent$l = promise$4;
|
8887 |
|
8888 |
|
8889 | var promise$3 = parent$l;
|
8890 |
|
8891 | var $$c = _export;
|
8892 | var newPromiseCapabilityModule$1 = newPromiseCapability$2;
|
8893 |
|
8894 |
|
8895 |
|
8896 | $$c({ target: 'Promise', stat: true }, {
|
8897 | withResolvers: function withResolvers() {
|
8898 | var promiseCapability = newPromiseCapabilityModule$1.f(this);
|
8899 | return {
|
8900 | promise: promiseCapability.promise,
|
8901 | resolve: promiseCapability.resolve,
|
8902 | reject: promiseCapability.reject
|
8903 | };
|
8904 | }
|
8905 | });
|
8906 |
|
8907 | var parent$k = promise$3;
|
8908 |
|
8909 |
|
8910 | var promise$2 = parent$k;
|
8911 |
|
8912 |
|
8913 | var $$b = _export;
|
8914 | var newPromiseCapabilityModule = newPromiseCapability$2;
|
8915 | var perform = perform$6;
|
8916 |
|
8917 |
|
8918 |
|
8919 | $$b({ target: 'Promise', stat: true, forced: true }, {
|
8920 | 'try': function (callbackfn) {
|
8921 | var promiseCapability = newPromiseCapabilityModule.f(this);
|
8922 | var result = perform(callbackfn);
|
8923 | (result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value);
|
8924 | return promiseCapability.promise;
|
8925 | }
|
8926 | });
|
8927 |
|
8928 | var parent$j = promise$2;
|
8929 |
|
8930 |
|
8931 |
|
8932 |
|
8933 |
|
8934 |
|
8935 | var promise$1 = parent$j;
|
8936 |
|
8937 | var promise = promise$1;
|
8938 |
|
8939 | var $$a = _export;
|
8940 | var uncurryThis$3 = functionUncurryThis;
|
8941 | var isArray$1 = isArray$e;
|
8942 |
|
8943 | var nativeReverse = uncurryThis$3([].reverse);
|
8944 | var test$1 = [1, 2];
|
8945 |
|
8946 |
|
8947 |
|
8948 |
|
8949 |
|
8950 | $$a({ target: 'Array', proto: true, forced: String(test$1) === String(test$1.reverse()) }, {
|
8951 | reverse: function reverse() {
|
8952 |
|
8953 | if (isArray$1(this)) this.length = this.length;
|
8954 | return nativeReverse(this);
|
8955 | }
|
8956 | });
|
8957 |
|
8958 | var getBuiltInPrototypeMethod$7 = getBuiltInPrototypeMethod$g;
|
8959 |
|
8960 | var reverse$5 = getBuiltInPrototypeMethod$7('Array', 'reverse');
|
8961 |
|
8962 | var isPrototypeOf$7 = objectIsPrototypeOf;
|
8963 | var method$7 = reverse$5;
|
8964 |
|
8965 | var ArrayPrototype$7 = Array.prototype;
|
8966 |
|
8967 | var reverse$4 = function (it) {
|
8968 | var own = it.reverse;
|
8969 | return it === ArrayPrototype$7 || (isPrototypeOf$7(ArrayPrototype$7, it) && own === ArrayPrototype$7.reverse) ? method$7 : own;
|
8970 | };
|
8971 |
|
8972 | var parent$i = reverse$4;
|
8973 |
|
8974 | var reverse$3 = parent$i;
|
8975 |
|
8976 | var parent$h = reverse$3;
|
8977 |
|
8978 | var reverse$2 = parent$h;
|
8979 |
|
8980 | var parent$g = reverse$2;
|
8981 |
|
8982 | var reverse$1 = parent$g;
|
8983 |
|
8984 | var reverse = reverse$1;
|
8985 |
|
8986 | (function (module) {
|
8987 | var _typeof = _typeofExports["default"];
|
8988 | var _Object$defineProperty = defineProperty$8;
|
8989 | var _Symbol = symbol$1;
|
8990 | var _Object$create = create$3;
|
8991 | var _Object$getPrototypeOf = getPrototypeOf$1;
|
8992 | var _forEachInstanceProperty = forEach$1;
|
8993 | var _pushInstanceProperty = push$2;
|
8994 | var _Object$setPrototypeOf = setPrototypeOf$1;
|
8995 | var _Promise = promise;
|
8996 | var _reverseInstanceProperty = reverse;
|
8997 | var _sliceInstanceProperty = slice;
|
8998 | function _regeneratorRuntime() {
|
8999 | module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
|
9000 | return e;
|
9001 | }, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
9002 | var t,
|
9003 | e = {},
|
9004 | r = Object.prototype,
|
9005 | n = r.hasOwnProperty,
|
9006 | o = _Object$defineProperty || function (t, e, r) {
|
9007 | t[e] = r.value;
|
9008 | },
|
9009 | i = "function" == typeof _Symbol ? _Symbol : {},
|
9010 | a = i.iterator || "@@iterator",
|
9011 | c = i.asyncIterator || "@@asyncIterator",
|
9012 | u = i.toStringTag || "@@toStringTag";
|
9013 | function define(t, e, r) {
|
9014 | return _Object$defineProperty(t, e, {
|
9015 | value: r,
|
9016 | enumerable: !0,
|
9017 | configurable: !0,
|
9018 | writable: !0
|
9019 | }), t[e];
|
9020 | }
|
9021 | try {
|
9022 | define({}, "");
|
9023 | } catch (t) {
|
9024 | define = function define(t, e, r) {
|
9025 | return t[e] = r;
|
9026 | };
|
9027 | }
|
9028 | function wrap(t, e, r, n) {
|
9029 | var i = e && e.prototype instanceof Generator ? e : Generator,
|
9030 | a = _Object$create(i.prototype),
|
9031 | c = new Context(n || []);
|
9032 | return o(a, "_invoke", {
|
9033 | value: makeInvokeMethod(t, r, c)
|
9034 | }), a;
|
9035 | }
|
9036 | function tryCatch(t, e, r) {
|
9037 | try {
|
9038 | return {
|
9039 | type: "normal",
|
9040 | arg: t.call(e, r)
|
9041 | };
|
9042 | } catch (t) {
|
9043 | return {
|
9044 | type: "throw",
|
9045 | arg: t
|
9046 | };
|
9047 | }
|
9048 | }
|
9049 | e.wrap = wrap;
|
9050 | var h = "suspendedStart",
|
9051 | l = "suspendedYield",
|
9052 | f = "executing",
|
9053 | s = "completed",
|
9054 | y = {};
|
9055 | function Generator() {}
|
9056 | function GeneratorFunction() {}
|
9057 | function GeneratorFunctionPrototype() {}
|
9058 | var p = {};
|
9059 | define(p, a, function () {
|
9060 | return this;
|
9061 | });
|
9062 | var d = _Object$getPrototypeOf,
|
9063 | v = d && d(d(values([])));
|
9064 | v && v !== r && n.call(v, a) && (p = v);
|
9065 | var g = GeneratorFunctionPrototype.prototype = Generator.prototype = _Object$create(p);
|
9066 | function defineIteratorMethods(t) {
|
9067 | var _context;
|
9068 | _forEachInstanceProperty(_context = ["next", "throw", "return"]).call(_context, function (e) {
|
9069 | define(t, e, function (t) {
|
9070 | return this._invoke(e, t);
|
9071 | });
|
9072 | });
|
9073 | }
|
9074 | function AsyncIterator(t, e) {
|
9075 | function invoke(r, o, i, a) {
|
9076 | var c = tryCatch(t[r], t, o);
|
9077 | if ("throw" !== c.type) {
|
9078 | var u = c.arg,
|
9079 | h = u.value;
|
9080 | return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
|
9081 | invoke("next", t, i, a);
|
9082 | }, function (t) {
|
9083 | invoke("throw", t, i, a);
|
9084 | }) : e.resolve(h).then(function (t) {
|
9085 | u.value = t, i(u);
|
9086 | }, function (t) {
|
9087 | return invoke("throw", t, i, a);
|
9088 | });
|
9089 | }
|
9090 | a(c.arg);
|
9091 | }
|
9092 | var r;
|
9093 | o(this, "_invoke", {
|
9094 | value: function value(t, n) {
|
9095 | function callInvokeWithMethodAndArg() {
|
9096 | return new e(function (e, r) {
|
9097 | invoke(t, n, e, r);
|
9098 | });
|
9099 | }
|
9100 | return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
|
9101 | }
|
9102 | });
|
9103 | }
|
9104 | function makeInvokeMethod(e, r, n) {
|
9105 | var o = h;
|
9106 | return function (i, a) {
|
9107 | if (o === f) throw new Error("Generator is already running");
|
9108 | if (o === s) {
|
9109 | if ("throw" === i) throw a;
|
9110 | return {
|
9111 | value: t,
|
9112 | done: !0
|
9113 | };
|
9114 | }
|
9115 | for (n.method = i, n.arg = a;;) {
|
9116 | var c = n.delegate;
|
9117 | if (c) {
|
9118 | var u = maybeInvokeDelegate(c, n);
|
9119 | if (u) {
|
9120 | if (u === y) continue;
|
9121 | return u;
|
9122 | }
|
9123 | }
|
9124 | if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
|
9125 | if (o === h) throw o = s, n.arg;
|
9126 | n.dispatchException(n.arg);
|
9127 | } else "return" === n.method && n.abrupt("return", n.arg);
|
9128 | o = f;
|
9129 | var p = tryCatch(e, r, n);
|
9130 | if ("normal" === p.type) {
|
9131 | if (o = n.done ? s : l, p.arg === y) continue;
|
9132 | return {
|
9133 | value: p.arg,
|
9134 | done: n.done
|
9135 | };
|
9136 | }
|
9137 | "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
|
9138 | }
|
9139 | };
|
9140 | }
|
9141 | function maybeInvokeDelegate(e, r) {
|
9142 | var n = r.method,
|
9143 | o = e.iterator[n];
|
9144 | if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
|
9145 | var i = tryCatch(o, e.iterator, r.arg);
|
9146 | if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
|
9147 | var a = i.arg;
|
9148 | return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
|
9149 | }
|
9150 | function pushTryEntry(t) {
|
9151 | var _context2;
|
9152 | var e = {
|
9153 | tryLoc: t[0]
|
9154 | };
|
9155 | 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), _pushInstanceProperty(_context2 = this.tryEntries).call(_context2, e);
|
9156 | }
|
9157 | function resetTryEntry(t) {
|
9158 | var e = t.completion || {};
|
9159 | e.type = "normal", delete e.arg, t.completion = e;
|
9160 | }
|
9161 | function Context(t) {
|
9162 | this.tryEntries = [{
|
9163 | tryLoc: "root"
|
9164 | }], _forEachInstanceProperty(t).call(t, pushTryEntry, this), this.reset(!0);
|
9165 | }
|
9166 | function values(e) {
|
9167 | if (e || "" === e) {
|
9168 | var r = e[a];
|
9169 | if (r) return r.call(e);
|
9170 | if ("function" == typeof e.next) return e;
|
9171 | if (!isNaN(e.length)) {
|
9172 | var o = -1,
|
9173 | i = function next() {
|
9174 | for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
|
9175 | return next.value = t, next.done = !0, next;
|
9176 | };
|
9177 | return i.next = i;
|
9178 | }
|
9179 | }
|
9180 | throw new TypeError(_typeof(e) + " is not iterable");
|
9181 | }
|
9182 | return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
|
9183 | value: GeneratorFunctionPrototype,
|
9184 | configurable: !0
|
9185 | }), o(GeneratorFunctionPrototype, "constructor", {
|
9186 | value: GeneratorFunction,
|
9187 | configurable: !0
|
9188 | }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
|
9189 | var e = "function" == typeof t && t.constructor;
|
9190 | return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
|
9191 | }, e.mark = function (t) {
|
9192 | return _Object$setPrototypeOf ? _Object$setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = _Object$create(g), t;
|
9193 | }, e.awrap = function (t) {
|
9194 | return {
|
9195 | __await: t
|
9196 | };
|
9197 | }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
|
9198 | return this;
|
9199 | }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
|
9200 | void 0 === i && (i = _Promise);
|
9201 | var a = new AsyncIterator(wrap(t, r, n, o), i);
|
9202 | return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
|
9203 | return t.done ? t.value : a.next();
|
9204 | });
|
9205 | }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
|
9206 | return this;
|
9207 | }), define(g, "toString", function () {
|
9208 | return "[object Generator]";
|
9209 | }), e.keys = function (t) {
|
9210 | var e = Object(t),
|
9211 | r = [];
|
9212 | for (var n in e) _pushInstanceProperty(r).call(r, n);
|
9213 | return _reverseInstanceProperty(r).call(r), function next() {
|
9214 | for (; r.length;) {
|
9215 | var t = r.pop();
|
9216 | if (t in e) return next.value = t, next.done = !1, next;
|
9217 | }
|
9218 | return next.done = !0, next;
|
9219 | };
|
9220 | }, e.values = values, Context.prototype = {
|
9221 | constructor: Context,
|
9222 | reset: function reset(e) {
|
9223 | var _context3;
|
9224 | if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, _forEachInstanceProperty(_context3 = this.tryEntries).call(_context3, resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+_sliceInstanceProperty(r).call(r, 1)) && (this[r] = t);
|
9225 | },
|
9226 | stop: function stop() {
|
9227 | this.done = !0;
|
9228 | var t = this.tryEntries[0].completion;
|
9229 | if ("throw" === t.type) throw t.arg;
|
9230 | return this.rval;
|
9231 | },
|
9232 | dispatchException: function dispatchException(e) {
|
9233 | if (this.done) throw e;
|
9234 | var r = this;
|
9235 | function handle(n, o) {
|
9236 | return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
|
9237 | }
|
9238 | for (var o = this.tryEntries.length - 1; o >= 0; --o) {
|
9239 | var i = this.tryEntries[o],
|
9240 | a = i.completion;
|
9241 | if ("root" === i.tryLoc) return handle("end");
|
9242 | if (i.tryLoc <= this.prev) {
|
9243 | var c = n.call(i, "catchLoc"),
|
9244 | u = n.call(i, "finallyLoc");
|
9245 | if (c && u) {
|
9246 | if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
9247 | if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
9248 | } else if (c) {
|
9249 | if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
9250 | } else {
|
9251 | if (!u) throw new Error("try statement without catch or finally");
|
9252 | if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
9253 | }
|
9254 | }
|
9255 | }
|
9256 | },
|
9257 | abrupt: function abrupt(t, e) {
|
9258 | for (var r = this.tryEntries.length - 1; r >= 0; --r) {
|
9259 | var o = this.tryEntries[r];
|
9260 | if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
|
9261 | var i = o;
|
9262 | break;
|
9263 | }
|
9264 | }
|
9265 | i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
|
9266 | var a = i ? i.completion : {};
|
9267 | return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
|
9268 | },
|
9269 | complete: function complete(t, e) {
|
9270 | if ("throw" === t.type) throw t.arg;
|
9271 | return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
|
9272 | },
|
9273 | finish: function finish(t) {
|
9274 | for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
9275 | var r = this.tryEntries[e];
|
9276 | if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
|
9277 | }
|
9278 | },
|
9279 | "catch": function _catch(t) {
|
9280 | for (var e = this.tryEntries.length - 1; e >= 0; --e) {
|
9281 | var r = this.tryEntries[e];
|
9282 | if (r.tryLoc === t) {
|
9283 | var n = r.completion;
|
9284 | if ("throw" === n.type) {
|
9285 | var o = n.arg;
|
9286 | resetTryEntry(r);
|
9287 | }
|
9288 | return o;
|
9289 | }
|
9290 | }
|
9291 | throw new Error("illegal catch attempt");
|
9292 | },
|
9293 | delegateYield: function delegateYield(e, r, n) {
|
9294 | return this.delegate = {
|
9295 | iterator: values(e),
|
9296 | resultName: r,
|
9297 | nextLoc: n
|
9298 | }, "next" === this.method && (this.arg = t), y;
|
9299 | }
|
9300 | }, e;
|
9301 | }
|
9302 | module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
9303 | } (regeneratorRuntime$1));
|
9304 |
|
9305 | var regeneratorRuntimeExports = regeneratorRuntime$1.exports;
|
9306 |
|
9307 |
|
9308 |
|
9309 | var runtime = regeneratorRuntimeExports();
|
9310 | var regenerator = runtime;
|
9311 |
|
9312 |
|
9313 | try {
|
9314 | regeneratorRuntime = runtime;
|
9315 | } catch (accidentalStrictMode) {
|
9316 | if (typeof globalThis === "object") {
|
9317 | globalThis.regeneratorRuntime = runtime;
|
9318 | } else {
|
9319 | Function("r", "regeneratorRuntime = r")(runtime);
|
9320 | }
|
9321 | }
|
9322 |
|
9323 | var _regeneratorRuntime = getDefaultExportFromCjs(regenerator);
|
9324 |
|
9325 | var isArray = isArray$6;
|
9326 |
|
9327 | var _Array$isArray = getDefaultExportFromCjs(isArray);
|
9328 |
|
9329 | var internalMetadata = {exports: {}};
|
9330 |
|
9331 |
|
9332 | var fails$6 = fails$u;
|
9333 |
|
9334 | var arrayBufferNonExtensible = fails$6(function () {
|
9335 | if (typeof ArrayBuffer == 'function') {
|
9336 | var buffer = new ArrayBuffer(8);
|
9337 |
|
9338 | if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 });
|
9339 | }
|
9340 | });
|
9341 |
|
9342 | var fails$5 = fails$u;
|
9343 | var isObject$2 = isObject$h;
|
9344 | var classof$3 = classofRaw$2;
|
9345 | var ARRAY_BUFFER_NON_EXTENSIBLE = arrayBufferNonExtensible;
|
9346 |
|
9347 |
|
9348 | var $isExtensible = Object.isExtensible;
|
9349 | var FAILS_ON_PRIMITIVES$1 = fails$5(function () { $isExtensible(1); });
|
9350 |
|
9351 |
|
9352 |
|
9353 | var objectIsExtensible = (FAILS_ON_PRIMITIVES$1 || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
|
9354 | if (!isObject$2(it)) return false;
|
9355 | if (ARRAY_BUFFER_NON_EXTENSIBLE && classof$3(it) === 'ArrayBuffer') return false;
|
9356 | return $isExtensible ? $isExtensible(it) : true;
|
9357 | } : $isExtensible;
|
9358 |
|
9359 | var fails$4 = fails$u;
|
9360 |
|
9361 | var freezing = !fails$4(function () {
|
9362 |
|
9363 | return Object.isExtensible(Object.preventExtensions({}));
|
9364 | });
|
9365 |
|
9366 | var $$9 = _export;
|
9367 | var uncurryThis$2 = functionUncurryThis;
|
9368 | var hiddenKeys = hiddenKeys$6;
|
9369 | var isObject$1 = isObject$h;
|
9370 | var hasOwn$3 = hasOwnProperty_1;
|
9371 | var defineProperty$2 = objectDefineProperty.f;
|
9372 | var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
|
9373 | var getOwnPropertyNamesExternalModule = objectGetOwnPropertyNamesExternal;
|
9374 | var isExtensible = objectIsExtensible;
|
9375 | var uid = uid$4;
|
9376 | var FREEZING = freezing;
|
9377 |
|
9378 | var REQUIRED = false;
|
9379 | var METADATA = uid('meta');
|
9380 | var id = 0;
|
9381 |
|
9382 | var setMetadata = function (it) {
|
9383 | defineProperty$2(it, METADATA, { value: {
|
9384 | objectID: 'O' + id++,
|
9385 | weakData: {}
|
9386 | } });
|
9387 | };
|
9388 |
|
9389 | var fastKey$1 = function (it, create) {
|
9390 |
|
9391 | if (!isObject$1(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
|
9392 | if (!hasOwn$3(it, METADATA)) {
|
9393 |
|
9394 | if (!isExtensible(it)) return 'F';
|
9395 |
|
9396 | if (!create) return 'E';
|
9397 |
|
9398 | setMetadata(it);
|
9399 |
|
9400 | } return it[METADATA].objectID;
|
9401 | };
|
9402 |
|
9403 | var getWeakData = function (it, create) {
|
9404 | if (!hasOwn$3(it, METADATA)) {
|
9405 |
|
9406 | if (!isExtensible(it)) return true;
|
9407 |
|
9408 | if (!create) return false;
|
9409 |
|
9410 | setMetadata(it);
|
9411 |
|
9412 | } return it[METADATA].weakData;
|
9413 | };
|
9414 |
|
9415 |
|
9416 | var onFreeze = function (it) {
|
9417 | if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn$3(it, METADATA)) setMetadata(it);
|
9418 | return it;
|
9419 | };
|
9420 |
|
9421 | var enable = function () {
|
9422 | meta.enable = function () { };
|
9423 | REQUIRED = true;
|
9424 | var getOwnPropertyNames = getOwnPropertyNamesModule.f;
|
9425 | var splice = uncurryThis$2([].splice);
|
9426 | var test = {};
|
9427 | test[METADATA] = 1;
|
9428 |
|
9429 |
|
9430 | if (getOwnPropertyNames(test).length) {
|
9431 | getOwnPropertyNamesModule.f = function (it) {
|
9432 | var result = getOwnPropertyNames(it);
|
9433 | for (var i = 0, length = result.length; i < length; i++) {
|
9434 | if (result[i] === METADATA) {
|
9435 | splice(result, i, 1);
|
9436 | break;
|
9437 | }
|
9438 | } return result;
|
9439 | };
|
9440 |
|
9441 | $$9({ target: 'Object', stat: true, forced: true }, {
|
9442 | getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
|
9443 | });
|
9444 | }
|
9445 | };
|
9446 |
|
9447 | var meta = internalMetadata.exports = {
|
9448 | enable: enable,
|
9449 | fastKey: fastKey$1,
|
9450 | getWeakData: getWeakData,
|
9451 | onFreeze: onFreeze
|
9452 | };
|
9453 |
|
9454 | hiddenKeys[METADATA] = true;
|
9455 |
|
9456 | var internalMetadataExports = internalMetadata.exports;
|
9457 |
|
9458 | var $$8 = _export;
|
9459 | var global$4 = global$p;
|
9460 | var InternalMetadataModule = internalMetadataExports;
|
9461 | var fails$3 = fails$u;
|
9462 | var createNonEnumerableProperty = createNonEnumerableProperty$9;
|
9463 | var iterate$1 = iterate$7;
|
9464 | var anInstance$1 = anInstance$3;
|
9465 | var isCallable$1 = isCallable$m;
|
9466 | var isObject = isObject$h;
|
9467 | var isNullOrUndefined$1 = isNullOrUndefined$6;
|
9468 | var setToStringTag = setToStringTag$7;
|
9469 | var defineProperty$1 = objectDefineProperty.f;
|
9470 | var forEach = arrayIteration.forEach;
|
9471 | var DESCRIPTORS$2 = descriptors;
|
9472 | var InternalStateModule$1 = internalState;
|
9473 |
|
9474 | var setInternalState$1 = InternalStateModule$1.set;
|
9475 | var internalStateGetterFor$1 = InternalStateModule$1.getterFor;
|
9476 |
|
9477 | var collection$2 = function (CONSTRUCTOR_NAME, wrapper, common) {
|
9478 | var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1;
|
9479 | var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1;
|
9480 | var ADDER = IS_MAP ? 'set' : 'add';
|
9481 | var NativeConstructor = global$4[CONSTRUCTOR_NAME];
|
9482 | var NativePrototype = NativeConstructor && NativeConstructor.prototype;
|
9483 | var exported = {};
|
9484 | var Constructor;
|
9485 |
|
9486 | if (!DESCRIPTORS$2 || !isCallable$1(NativeConstructor)
|
9487 | || !(IS_WEAK || NativePrototype.forEach && !fails$3(function () { new NativeConstructor().entries().next(); }))
|
9488 | ) {
|
9489 |
|
9490 | Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
|
9491 | InternalMetadataModule.enable();
|
9492 | } else {
|
9493 | Constructor = wrapper(function (target, iterable) {
|
9494 | setInternalState$1(anInstance$1(target, Prototype), {
|
9495 | type: CONSTRUCTOR_NAME,
|
9496 | collection: new NativeConstructor()
|
9497 | });
|
9498 | if (!isNullOrUndefined$1(iterable)) iterate$1(iterable, target[ADDER], { that: target, AS_ENTRIES: IS_MAP });
|
9499 | });
|
9500 |
|
9501 | var Prototype = Constructor.prototype;
|
9502 |
|
9503 | var getInternalState = internalStateGetterFor$1(CONSTRUCTOR_NAME);
|
9504 |
|
9505 | forEach(['add', 'clear', 'delete', 'forEach', 'get', 'has', 'set', 'keys', 'values', 'entries'], function (KEY) {
|
9506 | var IS_ADDER = KEY === 'add' || KEY === 'set';
|
9507 | if (KEY in NativePrototype && !(IS_WEAK && KEY === 'clear')) {
|
9508 | createNonEnumerableProperty(Prototype, KEY, function (a, b) {
|
9509 | var collection = getInternalState(this).collection;
|
9510 | if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY === 'get' ? undefined : false;
|
9511 | var result = collection[KEY](a === 0 ? 0 : a, b);
|
9512 | return IS_ADDER ? this : result;
|
9513 | });
|
9514 | }
|
9515 | });
|
9516 |
|
9517 | IS_WEAK || defineProperty$1(Prototype, 'size', {
|
9518 | configurable: true,
|
9519 | get: function () {
|
9520 | return getInternalState(this).collection.size;
|
9521 | }
|
9522 | });
|
9523 | }
|
9524 |
|
9525 | setToStringTag(Constructor, CONSTRUCTOR_NAME, false, true);
|
9526 |
|
9527 | exported[CONSTRUCTOR_NAME] = Constructor;
|
9528 | $$8({ global: true, forced: true }, exported);
|
9529 |
|
9530 | if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
|
9531 |
|
9532 | return Constructor;
|
9533 | };
|
9534 |
|
9535 | var defineBuiltIn = defineBuiltIn$6;
|
9536 |
|
9537 | var defineBuiltIns$1 = function (target, src, options) {
|
9538 | for (var key in src) {
|
9539 | if (options && options.unsafe && target[key]) target[key] = src[key];
|
9540 | else defineBuiltIn(target, key, src[key], options);
|
9541 | } return target;
|
9542 | };
|
9543 |
|
9544 | var create$1 = objectCreate;
|
9545 | var defineBuiltInAccessor = defineBuiltInAccessor$3;
|
9546 | var defineBuiltIns = defineBuiltIns$1;
|
9547 | var bind = functionBindContext;
|
9548 | var anInstance = anInstance$3;
|
9549 | var isNullOrUndefined = isNullOrUndefined$6;
|
9550 | var iterate = iterate$7;
|
9551 | var defineIterator = iteratorDefine;
|
9552 | var createIterResultObject = createIterResultObject$3;
|
9553 | var setSpecies = setSpecies$2;
|
9554 | var DESCRIPTORS$1 = descriptors;
|
9555 | var fastKey = internalMetadataExports.fastKey;
|
9556 | var InternalStateModule = internalState;
|
9557 |
|
9558 | var setInternalState = InternalStateModule.set;
|
9559 | var internalStateGetterFor = InternalStateModule.getterFor;
|
9560 |
|
9561 | var collectionStrong$2 = {
|
9562 | getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
|
9563 | var Constructor = wrapper(function (that, iterable) {
|
9564 | anInstance(that, Prototype);
|
9565 | setInternalState(that, {
|
9566 | type: CONSTRUCTOR_NAME,
|
9567 | index: create$1(null),
|
9568 | first: undefined,
|
9569 | last: undefined,
|
9570 | size: 0
|
9571 | });
|
9572 | if (!DESCRIPTORS$1) that.size = 0;
|
9573 | if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
|
9574 | });
|
9575 |
|
9576 | var Prototype = Constructor.prototype;
|
9577 |
|
9578 | var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
9579 |
|
9580 | var define = function (that, key, value) {
|
9581 | var state = getInternalState(that);
|
9582 | var entry = getEntry(that, key);
|
9583 | var previous, index;
|
9584 |
|
9585 | if (entry) {
|
9586 | entry.value = value;
|
9587 |
|
9588 | } else {
|
9589 | state.last = entry = {
|
9590 | index: index = fastKey(key, true),
|
9591 | key: key,
|
9592 | value: value,
|
9593 | previous: previous = state.last,
|
9594 | next: undefined,
|
9595 | removed: false
|
9596 | };
|
9597 | if (!state.first) state.first = entry;
|
9598 | if (previous) previous.next = entry;
|
9599 | if (DESCRIPTORS$1) state.size++;
|
9600 | else that.size++;
|
9601 |
|
9602 | if (index !== 'F') state.index[index] = entry;
|
9603 | } return that;
|
9604 | };
|
9605 |
|
9606 | var getEntry = function (that, key) {
|
9607 | var state = getInternalState(that);
|
9608 |
|
9609 | var index = fastKey(key);
|
9610 | var entry;
|
9611 | if (index !== 'F') return state.index[index];
|
9612 |
|
9613 | for (entry = state.first; entry; entry = entry.next) {
|
9614 | if (entry.key === key) return entry;
|
9615 | }
|
9616 | };
|
9617 |
|
9618 | defineBuiltIns(Prototype, {
|
9619 |
|
9620 |
|
9621 |
|
9622 | clear: function clear() {
|
9623 | var that = this;
|
9624 | var state = getInternalState(that);
|
9625 | var data = state.index;
|
9626 | var entry = state.first;
|
9627 | while (entry) {
|
9628 | entry.removed = true;
|
9629 | if (entry.previous) entry.previous = entry.previous.next = undefined;
|
9630 | delete data[entry.index];
|
9631 | entry = entry.next;
|
9632 | }
|
9633 | state.first = state.last = undefined;
|
9634 | if (DESCRIPTORS$1) state.size = 0;
|
9635 | else that.size = 0;
|
9636 | },
|
9637 |
|
9638 |
|
9639 |
|
9640 | 'delete': function (key) {
|
9641 | var that = this;
|
9642 | var state = getInternalState(that);
|
9643 | var entry = getEntry(that, key);
|
9644 | if (entry) {
|
9645 | var next = entry.next;
|
9646 | var prev = entry.previous;
|
9647 | delete state.index[entry.index];
|
9648 | entry.removed = true;
|
9649 | if (prev) prev.next = next;
|
9650 | if (next) next.previous = prev;
|
9651 | if (state.first === entry) state.first = next;
|
9652 | if (state.last === entry) state.last = prev;
|
9653 | if (DESCRIPTORS$1) state.size--;
|
9654 | else that.size--;
|
9655 | } return !!entry;
|
9656 | },
|
9657 |
|
9658 |
|
9659 |
|
9660 | forEach: function forEach(callbackfn /* , that = undefined */) {
|
9661 | var state = getInternalState(this);
|
9662 | var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
9663 | var entry;
|
9664 | while (entry = entry ? entry.next : state.first) {
|
9665 | boundFunction(entry.value, entry.key, this);
|
9666 |
|
9667 | while (entry && entry.removed) entry = entry.previous;
|
9668 | }
|
9669 | },
|
9670 |
|
9671 |
|
9672 |
|
9673 | has: function has(key) {
|
9674 | return !!getEntry(this, key);
|
9675 | }
|
9676 | });
|
9677 |
|
9678 | defineBuiltIns(Prototype, IS_MAP ? {
|
9679 |
|
9680 |
|
9681 | get: function get(key) {
|
9682 | var entry = getEntry(this, key);
|
9683 | return entry && entry.value;
|
9684 | },
|
9685 |
|
9686 |
|
9687 | set: function set(key, value) {
|
9688 | return define(this, key === 0 ? 0 : key, value);
|
9689 | }
|
9690 | } : {
|
9691 |
|
9692 |
|
9693 | add: function add(value) {
|
9694 | return define(this, value = value === 0 ? 0 : value, value);
|
9695 | }
|
9696 | });
|
9697 | if (DESCRIPTORS$1) defineBuiltInAccessor(Prototype, 'size', {
|
9698 | configurable: true,
|
9699 | get: function () {
|
9700 | return getInternalState(this).size;
|
9701 | }
|
9702 | });
|
9703 | return Constructor;
|
9704 | },
|
9705 | setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) {
|
9706 | var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator';
|
9707 | var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
|
9708 | var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
|
9709 |
|
9710 |
|
9711 |
|
9712 |
|
9713 |
|
9714 |
|
9715 |
|
9716 |
|
9717 |
|
9718 | defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) {
|
9719 | setInternalState(this, {
|
9720 | type: ITERATOR_NAME,
|
9721 | target: iterated,
|
9722 | state: getInternalCollectionState(iterated),
|
9723 | kind: kind,
|
9724 | last: undefined
|
9725 | });
|
9726 | }, function () {
|
9727 | var state = getInternalIteratorState(this);
|
9728 | var kind = state.kind;
|
9729 | var entry = state.last;
|
9730 |
|
9731 | while (entry && entry.removed) entry = entry.previous;
|
9732 |
|
9733 | if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
|
9734 |
|
9735 | state.target = undefined;
|
9736 | return createIterResultObject(undefined, true);
|
9737 | }
|
9738 |
|
9739 | if (kind === 'keys') return createIterResultObject(entry.key, false);
|
9740 | if (kind === 'values') return createIterResultObject(entry.value, false);
|
9741 | return createIterResultObject([entry.key, entry.value], false);
|
9742 | }, IS_MAP ? 'entries' : 'values', !IS_MAP, true);
|
9743 |
|
9744 |
|
9745 |
|
9746 |
|
9747 | setSpecies(CONSTRUCTOR_NAME);
|
9748 | }
|
9749 | };
|
9750 |
|
9751 | var collection$1 = collection$2;
|
9752 | var collectionStrong$1 = collectionStrong$2;
|
9753 |
|
9754 |
|
9755 |
|
9756 | collection$1('Map', function (init) {
|
9757 | return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
|
9758 | }, collectionStrong$1);
|
9759 |
|
9760 | var path$6 = path$o;
|
9761 |
|
9762 | var map$2 = path$6.Map;
|
9763 |
|
9764 | var parent$f = map$2;
|
9765 |
|
9766 |
|
9767 | var map$1 = parent$f;
|
9768 |
|
9769 | var map = map$1;
|
9770 |
|
9771 | var _Map = getDefaultExportFromCjs(map);
|
9772 |
|
9773 | var $$7 = _export;
|
9774 | var $some = arrayIteration.some;
|
9775 | var arrayMethodIsStrict$1 = arrayMethodIsStrict$4;
|
9776 |
|
9777 | var STRICT_METHOD$1 = arrayMethodIsStrict$1('some');
|
9778 |
|
9779 |
|
9780 |
|
9781 | $$7({ target: 'Array', proto: true, forced: !STRICT_METHOD$1 }, {
|
9782 | some: function some(callbackfn /* , thisArg */) {
|
9783 | return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
|
9784 | }
|
9785 | });
|
9786 |
|
9787 | var getBuiltInPrototypeMethod$6 = getBuiltInPrototypeMethod$g;
|
9788 |
|
9789 | var some$3 = getBuiltInPrototypeMethod$6('Array', 'some');
|
9790 |
|
9791 | var isPrototypeOf$6 = objectIsPrototypeOf;
|
9792 | var method$6 = some$3;
|
9793 |
|
9794 | var ArrayPrototype$6 = Array.prototype;
|
9795 |
|
9796 | var some$2 = function (it) {
|
9797 | var own = it.some;
|
9798 | return it === ArrayPrototype$6 || (isPrototypeOf$6(ArrayPrototype$6, it) && own === ArrayPrototype$6.some) ? method$6 : own;
|
9799 | };
|
9800 |
|
9801 | var parent$e = some$2;
|
9802 |
|
9803 | var some$1 = parent$e;
|
9804 |
|
9805 | var some = some$1;
|
9806 |
|
9807 | var _someInstanceProperty = getDefaultExportFromCjs(some);
|
9808 |
|
9809 | var DESCRIPTORS = descriptors;
|
9810 | var uncurryThis$1 = functionUncurryThis;
|
9811 | var call = functionCall;
|
9812 | var fails$2 = fails$u;
|
9813 | var objectKeys = objectKeys$3;
|
9814 | var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
|
9815 | var propertyIsEnumerableModule = objectPropertyIsEnumerable;
|
9816 | var toObject$3 = toObject$e;
|
9817 | var IndexedObject = indexedObject;
|
9818 |
|
9819 |
|
9820 | var $assign = Object.assign;
|
9821 |
|
9822 | var defineProperty = Object.defineProperty;
|
9823 | var concat$4 = uncurryThis$1([].concat);
|
9824 |
|
9825 |
|
9826 |
|
9827 | var objectAssign = !$assign || fails$2(function () {
|
9828 |
|
9829 | if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
|
9830 | enumerable: true,
|
9831 | get: function () {
|
9832 | defineProperty(this, 'b', {
|
9833 | value: 3,
|
9834 | enumerable: false
|
9835 | });
|
9836 | }
|
9837 | }), { b: 2 })).b !== 1) return true;
|
9838 |
|
9839 | var A = {};
|
9840 | var B = {};
|
9841 |
|
9842 | var symbol = Symbol('assign detection');
|
9843 | var alphabet = 'abcdefghijklmnopqrst';
|
9844 | A[symbol] = 7;
|
9845 | alphabet.split('').forEach(function (chr) { B[chr] = chr; });
|
9846 | return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
|
9847 | }) ? function assign(target, source) {
|
9848 | var T = toObject$3(target);
|
9849 | var argumentsLength = arguments.length;
|
9850 | var index = 1;
|
9851 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
9852 | var propertyIsEnumerable = propertyIsEnumerableModule.f;
|
9853 | while (argumentsLength > index) {
|
9854 | var S = IndexedObject(arguments[index++]);
|
9855 | var keys = getOwnPropertySymbols ? concat$4(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
|
9856 | var length = keys.length;
|
9857 | var j = 0;
|
9858 | var key;
|
9859 | while (length > j) {
|
9860 | key = keys[j++];
|
9861 | if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
|
9862 | }
|
9863 | } return T;
|
9864 | } : $assign;
|
9865 |
|
9866 | var $$6 = _export;
|
9867 | var assign$3 = objectAssign;
|
9868 |
|
9869 |
|
9870 |
|
9871 |
|
9872 | $$6({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign$3 }, {
|
9873 | assign: assign$3
|
9874 | });
|
9875 |
|
9876 | var path$5 = path$o;
|
9877 |
|
9878 | var assign$2 = path$5.Object.assign;
|
9879 |
|
9880 | var parent$d = assign$2;
|
9881 |
|
9882 | var assign$1 = parent$d;
|
9883 |
|
9884 | var assign = assign$1;
|
9885 |
|
9886 | var _Object$assign = getDefaultExportFromCjs(assign);
|
9887 |
|
9888 | var getBuiltInPrototypeMethod$5 = getBuiltInPrototypeMethod$g;
|
9889 |
|
9890 | var concat$3 = getBuiltInPrototypeMethod$5('Array', 'concat');
|
9891 |
|
9892 | var isPrototypeOf$5 = objectIsPrototypeOf;
|
9893 | var method$5 = concat$3;
|
9894 |
|
9895 | var ArrayPrototype$5 = Array.prototype;
|
9896 |
|
9897 | var concat$2 = function (it) {
|
9898 | var own = it.concat;
|
9899 | return it === ArrayPrototype$5 || (isPrototypeOf$5(ArrayPrototype$5, it) && own === ArrayPrototype$5.concat) ? method$5 : own;
|
9900 | };
|
9901 |
|
9902 | var parent$c = concat$2;
|
9903 |
|
9904 | var concat$1 = parent$c;
|
9905 |
|
9906 | var concat = concat$1;
|
9907 |
|
9908 | var _concatInstanceProperty = getDefaultExportFromCjs(concat);
|
9909 |
|
9910 | var getBuiltInPrototypeMethod$4 = getBuiltInPrototypeMethod$g;
|
9911 |
|
9912 | var keys$6 = getBuiltInPrototypeMethod$4('Array', 'keys');
|
9913 |
|
9914 | var parent$b = keys$6;
|
9915 |
|
9916 | var keys$5 = parent$b;
|
9917 |
|
9918 | var classof$2 = classof$d;
|
9919 | var hasOwn$2 = hasOwnProperty_1;
|
9920 | var isPrototypeOf$4 = objectIsPrototypeOf;
|
9921 | var method$4 = keys$5;
|
9922 |
|
9923 | var ArrayPrototype$4 = Array.prototype;
|
9924 |
|
9925 | var DOMIterables$2 = {
|
9926 | DOMTokenList: true,
|
9927 | NodeList: true
|
9928 | };
|
9929 |
|
9930 | var keys$4 = function (it) {
|
9931 | var own = it.keys;
|
9932 | return it === ArrayPrototype$4 || (isPrototypeOf$4(ArrayPrototype$4, it) && own === ArrayPrototype$4.keys)
|
9933 | || hasOwn$2(DOMIterables$2, classof$2(it)) ? method$4 : own;
|
9934 | };
|
9935 |
|
9936 | var keys$3 = keys$4;
|
9937 |
|
9938 | var _keysInstanceProperty = getDefaultExportFromCjs(keys$3);
|
9939 |
|
9940 | var $$5 = _export;
|
9941 | var toObject$2 = toObject$e;
|
9942 | var nativeKeys = objectKeys$3;
|
9943 | var fails$1 = fails$u;
|
9944 |
|
9945 | var FAILS_ON_PRIMITIVES = fails$1(function () { nativeKeys(1); });
|
9946 |
|
9947 |
|
9948 |
|
9949 | $$5({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, {
|
9950 | keys: function keys(it) {
|
9951 | return nativeKeys(toObject$2(it));
|
9952 | }
|
9953 | });
|
9954 |
|
9955 | var path$4 = path$o;
|
9956 |
|
9957 | var keys$2 = path$4.Object.keys;
|
9958 |
|
9959 | var parent$a = keys$2;
|
9960 |
|
9961 | var keys$1 = parent$a;
|
9962 |
|
9963 | var keys = keys$1;
|
9964 |
|
9965 | var _Object$keys = getDefaultExportFromCjs(keys);
|
9966 |
|
9967 | var tryToString = tryToString$6;
|
9968 |
|
9969 | var $TypeError = TypeError;
|
9970 |
|
9971 | var deletePropertyOrThrow$2 = function (O, P) {
|
9972 | if (!delete O[P]) throw new $TypeError('Cannot delete property ' + tryToString(P) + ' of ' + tryToString(O));
|
9973 | };
|
9974 |
|
9975 | var arraySlice$1 = arraySliceSimple;
|
9976 |
|
9977 | var floor = Math.floor;
|
9978 |
|
9979 | var mergeSort = function (array, comparefn) {
|
9980 | var length = array.length;
|
9981 | var middle = floor(length / 2);
|
9982 | return length < 8 ? insertionSort(array, comparefn) : merge(
|
9983 | array,
|
9984 | mergeSort(arraySlice$1(array, 0, middle), comparefn),
|
9985 | mergeSort(arraySlice$1(array, middle), comparefn),
|
9986 | comparefn
|
9987 | );
|
9988 | };
|
9989 |
|
9990 | var insertionSort = function (array, comparefn) {
|
9991 | var length = array.length;
|
9992 | var i = 1;
|
9993 | var element, j;
|
9994 |
|
9995 | while (i < length) {
|
9996 | j = i;
|
9997 | element = array[i];
|
9998 | while (j && comparefn(array[j - 1], element) > 0) {
|
9999 | array[j] = array[--j];
|
10000 | }
|
10001 | if (j !== i++) array[j] = element;
|
10002 | } return array;
|
10003 | };
|
10004 |
|
10005 | var merge = function (array, left, right, comparefn) {
|
10006 | var llength = left.length;
|
10007 | var rlength = right.length;
|
10008 | var lindex = 0;
|
10009 | var rindex = 0;
|
10010 |
|
10011 | while (lindex < llength || rindex < rlength) {
|
10012 | array[lindex + rindex] = (lindex < llength && rindex < rlength)
|
10013 | ? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
|
10014 | : lindex < llength ? left[lindex++] : right[rindex++];
|
10015 | } return array;
|
10016 | };
|
10017 |
|
10018 | var arraySort = mergeSort;
|
10019 |
|
10020 | var userAgent$1 = engineUserAgent;
|
10021 |
|
10022 | var firefox = userAgent$1.match(/firefox\/(\d+)/i);
|
10023 |
|
10024 | var engineFfVersion = !!firefox && +firefox[1];
|
10025 |
|
10026 | var UA = engineUserAgent;
|
10027 |
|
10028 | var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
|
10029 |
|
10030 | var userAgent = engineUserAgent;
|
10031 |
|
10032 | var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
|
10033 |
|
10034 | var engineWebkitVersion = !!webkit && +webkit[1];
|
10035 |
|
10036 | var $$4 = _export;
|
10037 | var uncurryThis = functionUncurryThis;
|
10038 | var aCallable = aCallable$e;
|
10039 | var toObject$1 = toObject$e;
|
10040 | var lengthOfArrayLike$1 = lengthOfArrayLike$d;
|
10041 | var deletePropertyOrThrow$1 = deletePropertyOrThrow$2;
|
10042 | var toString = toString$7;
|
10043 | var fails = fails$u;
|
10044 | var internalSort = arraySort;
|
10045 | var arrayMethodIsStrict = arrayMethodIsStrict$4;
|
10046 | var FF = engineFfVersion;
|
10047 | var IE_OR_EDGE = engineIsIeOrEdge;
|
10048 | var V8 = engineV8Version;
|
10049 | var WEBKIT = engineWebkitVersion;
|
10050 |
|
10051 | var test = [];
|
10052 | var nativeSort = uncurryThis(test.sort);
|
10053 | var push = uncurryThis(test.push);
|
10054 |
|
10055 |
|
10056 | var FAILS_ON_UNDEFINED = fails(function () {
|
10057 | test.sort(undefined);
|
10058 | });
|
10059 |
|
10060 | var FAILS_ON_NULL = fails(function () {
|
10061 | test.sort(null);
|
10062 | });
|
10063 |
|
10064 | var STRICT_METHOD = arrayMethodIsStrict('sort');
|
10065 |
|
10066 | var STABLE_SORT = !fails(function () {
|
10067 |
|
10068 | if (V8) return V8 < 70;
|
10069 | if (FF && FF > 3) return;
|
10070 | if (IE_OR_EDGE) return true;
|
10071 | if (WEBKIT) return WEBKIT < 603;
|
10072 |
|
10073 | var result = '';
|
10074 | var code, chr, value, index;
|
10075 |
|
10076 |
|
10077 | for (code = 65; code < 76; code++) {
|
10078 | chr = String.fromCharCode(code);
|
10079 |
|
10080 | switch (code) {
|
10081 | case 66: case 69: case 70: case 72: value = 3; break;
|
10082 | case 68: case 71: value = 4; break;
|
10083 | default: value = 2;
|
10084 | }
|
10085 |
|
10086 | for (index = 0; index < 47; index++) {
|
10087 | test.push({ k: chr + index, v: value });
|
10088 | }
|
10089 | }
|
10090 |
|
10091 | test.sort(function (a, b) { return b.v - a.v; });
|
10092 |
|
10093 | for (index = 0; index < test.length; index++) {
|
10094 | chr = test[index].k.charAt(0);
|
10095 | if (result.charAt(result.length - 1) !== chr) result += chr;
|
10096 | }
|
10097 |
|
10098 | return result !== 'DGBEFHACIJK';
|
10099 | });
|
10100 |
|
10101 | var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
|
10102 |
|
10103 | var getSortCompare = function (comparefn) {
|
10104 | return function (x, y) {
|
10105 | if (y === undefined) return -1;
|
10106 | if (x === undefined) return 1;
|
10107 | if (comparefn !== undefined) return +comparefn(x, y) || 0;
|
10108 | return toString(x) > toString(y) ? 1 : -1;
|
10109 | };
|
10110 | };
|
10111 |
|
10112 |
|
10113 |
|
10114 | $$4({ target: 'Array', proto: true, forced: FORCED }, {
|
10115 | sort: function sort(comparefn) {
|
10116 | if (comparefn !== undefined) aCallable(comparefn);
|
10117 |
|
10118 | var array = toObject$1(this);
|
10119 |
|
10120 | if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
|
10121 |
|
10122 | var items = [];
|
10123 | var arrayLength = lengthOfArrayLike$1(array);
|
10124 | var itemsLength, index;
|
10125 |
|
10126 | for (index = 0; index < arrayLength; index++) {
|
10127 | if (index in array) push(items, array[index]);
|
10128 | }
|
10129 |
|
10130 | internalSort(items, getSortCompare(comparefn));
|
10131 |
|
10132 | itemsLength = lengthOfArrayLike$1(items);
|
10133 | index = 0;
|
10134 |
|
10135 | while (index < itemsLength) array[index] = items[index++];
|
10136 | while (index < arrayLength) deletePropertyOrThrow$1(array, index++);
|
10137 |
|
10138 | return array;
|
10139 | }
|
10140 | });
|
10141 |
|
10142 | var getBuiltInPrototypeMethod$3 = getBuiltInPrototypeMethod$g;
|
10143 |
|
10144 | var sort$3 = getBuiltInPrototypeMethod$3('Array', 'sort');
|
10145 |
|
10146 | var isPrototypeOf$3 = objectIsPrototypeOf;
|
10147 | var method$3 = sort$3;
|
10148 |
|
10149 | var ArrayPrototype$3 = Array.prototype;
|
10150 |
|
10151 | var sort$2 = function (it) {
|
10152 | var own = it.sort;
|
10153 | return it === ArrayPrototype$3 || (isPrototypeOf$3(ArrayPrototype$3, it) && own === ArrayPrototype$3.sort) ? method$3 : own;
|
10154 | };
|
10155 |
|
10156 | var parent$9 = sort$2;
|
10157 |
|
10158 | var sort$1 = parent$9;
|
10159 |
|
10160 | var sort = sort$1;
|
10161 |
|
10162 | var _sortInstanceProperty = getDefaultExportFromCjs(sort);
|
10163 |
|
10164 | var getBuiltInPrototypeMethod$2 = getBuiltInPrototypeMethod$g;
|
10165 |
|
10166 | var values$3 = getBuiltInPrototypeMethod$2('Array', 'values');
|
10167 |
|
10168 | var parent$8 = values$3;
|
10169 |
|
10170 | var values$2 = parent$8;
|
10171 |
|
10172 | var classof$1 = classof$d;
|
10173 | var hasOwn$1 = hasOwnProperty_1;
|
10174 | var isPrototypeOf$2 = objectIsPrototypeOf;
|
10175 | var method$2 = values$2;
|
10176 |
|
10177 | var ArrayPrototype$2 = Array.prototype;
|
10178 |
|
10179 | var DOMIterables$1 = {
|
10180 | DOMTokenList: true,
|
10181 | NodeList: true
|
10182 | };
|
10183 |
|
10184 | var values$1 = function (it) {
|
10185 | var own = it.values;
|
10186 | return it === ArrayPrototype$2 || (isPrototypeOf$2(ArrayPrototype$2, it) && own === ArrayPrototype$2.values)
|
10187 | || hasOwn$1(DOMIterables$1, classof$1(it)) ? method$2 : own;
|
10188 | };
|
10189 |
|
10190 | var values = values$1;
|
10191 |
|
10192 | var _valuesInstanceProperty = getDefaultExportFromCjs(values);
|
10193 |
|
10194 | var path$3 = path$o;
|
10195 | var apply$1 = functionApply;
|
10196 |
|
10197 |
|
10198 | if (!path$3.JSON) path$3.JSON = { stringify: JSON.stringify };
|
10199 |
|
10200 |
|
10201 | var stringify$2 = function stringify(it, replacer, space) {
|
10202 | return apply$1(path$3.JSON.stringify, null, arguments);
|
10203 | };
|
10204 |
|
10205 | var parent$7 = stringify$2;
|
10206 |
|
10207 | var stringify$1 = parent$7;
|
10208 |
|
10209 | var stringify = stringify$1;
|
10210 |
|
10211 | var _JSON$stringify = getDefaultExportFromCjs(stringify);
|
10212 |
|
10213 | var iterator = iterator$4;
|
10214 |
|
10215 | var _Symbol$iterator = getDefaultExportFromCjs(iterator);
|
10216 |
|
10217 | var getBuiltInPrototypeMethod$1 = getBuiltInPrototypeMethod$g;
|
10218 |
|
10219 | var entries$3 = getBuiltInPrototypeMethod$1('Array', 'entries');
|
10220 |
|
10221 | var parent$6 = entries$3;
|
10222 |
|
10223 | var entries$2 = parent$6;
|
10224 |
|
10225 | var classof = classof$d;
|
10226 | var hasOwn = hasOwnProperty_1;
|
10227 | var isPrototypeOf$1 = objectIsPrototypeOf;
|
10228 | var method$1 = entries$2;
|
10229 |
|
10230 | var ArrayPrototype$1 = Array.prototype;
|
10231 |
|
10232 | var DOMIterables = {
|
10233 | DOMTokenList: true,
|
10234 | NodeList: true
|
10235 | };
|
10236 |
|
10237 | var entries$1 = function (it) {
|
10238 | var own = it.entries;
|
10239 | return it === ArrayPrototype$1 || (isPrototypeOf$1(ArrayPrototype$1, it) && own === ArrayPrototype$1.entries)
|
10240 | || hasOwn(DOMIterables, classof(it)) ? method$1 : own;
|
10241 | };
|
10242 |
|
10243 | var entries = entries$1;
|
10244 |
|
10245 | var _entriesInstanceProperty = getDefaultExportFromCjs(entries);
|
10246 |
|
10247 |
|
10248 |
|
10249 |
|
10250 | let getRandomValues;
|
10251 | const rnds8 = new Uint8Array(16);
|
10252 | function rng() {
|
10253 |
|
10254 | if (!getRandomValues) {
|
10255 |
|
10256 | getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
|
10257 |
|
10258 | if (!getRandomValues) {
|
10259 | throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
10260 | }
|
10261 | }
|
10262 |
|
10263 | return getRandomValues(rnds8);
|
10264 | }
|
10265 |
|
10266 | |
10267 |
|
10268 |
|
10269 |
|
10270 |
|
10271 | const byteToHex = [];
|
10272 |
|
10273 | for (let i = 0; i < 256; ++i) {
|
10274 | byteToHex.push((i + 0x100).toString(16).slice(1));
|
10275 | }
|
10276 |
|
10277 | function unsafeStringify(arr, offset = 0) {
|
10278 |
|
10279 |
|
10280 | return 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]];
|
10281 | }
|
10282 |
|
10283 | const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
|
10284 | var native = {
|
10285 | randomUUID
|
10286 | };
|
10287 |
|
10288 | function v4(options, buf, offset) {
|
10289 | if (native.randomUUID && !buf && !options) {
|
10290 | return native.randomUUID();
|
10291 | }
|
10292 |
|
10293 | options = options || {};
|
10294 | const rnds = options.random || (options.rng || rng)();
|
10295 |
|
10296 | rnds[6] = rnds[6] & 0x0f | 0x40;
|
10297 | rnds[8] = rnds[8] & 0x3f | 0x80;
|
10298 |
|
10299 | if (buf) {
|
10300 | offset = offset || 0;
|
10301 |
|
10302 | for (let i = 0; i < 16; ++i) {
|
10303 | buf[offset + i] = rnds[i];
|
10304 | }
|
10305 |
|
10306 | return buf;
|
10307 | }
|
10308 |
|
10309 | return unsafeStringify(rnds);
|
10310 | }
|
10311 |
|
10312 | |
10313 |
|
10314 |
|
10315 |
|
10316 |
|
10317 |
|
10318 | function isId(value) {
|
10319 | return typeof value === "string" || typeof value === "number";
|
10320 | }
|
10321 |
|
10322 |
|
10323 | var engineIsBun = typeof Bun == 'function' && Bun && typeof Bun.version == 'string';
|
10324 |
|
10325 | var global$3 = global$p;
|
10326 | var apply = functionApply;
|
10327 | var isCallable = isCallable$m;
|
10328 | var ENGINE_IS_BUN = engineIsBun;
|
10329 | var USER_AGENT = engineUserAgent;
|
10330 | var arraySlice = arraySlice$5;
|
10331 | var validateArgumentsLength = validateArgumentsLength$2;
|
10332 |
|
10333 | var Function$1 = global$3.Function;
|
10334 |
|
10335 | var WRAP = /MSIE .\./.test(USER_AGENT) || ENGINE_IS_BUN && (function () {
|
10336 | var version = global$3.Bun.version.split('.');
|
10337 | return version.length < 3 || version[0] === '0' && (version[1] < 3 || version[1] === '3' && version[2] === '0');
|
10338 | })();
|
10339 |
|
10340 |
|
10341 |
|
10342 |
|
10343 | var schedulersFix$2 = function (scheduler, hasTimeArg) {
|
10344 | var firstParamIndex = hasTimeArg ? 2 : 1;
|
10345 | return WRAP ? function (handler, timeout /* , ...arguments */) {
|
10346 | var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;
|
10347 | var fn = isCallable(handler) ? handler : Function$1(handler);
|
10348 | var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];
|
10349 | var callback = boundArgs ? function () {
|
10350 | apply(fn, this, params);
|
10351 | } : fn;
|
10352 | return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);
|
10353 | } : scheduler;
|
10354 | };
|
10355 |
|
10356 | var $$3 = _export;
|
10357 | var global$2 = global$p;
|
10358 | var schedulersFix$1 = schedulersFix$2;
|
10359 |
|
10360 | var setInterval = schedulersFix$1(global$2.setInterval, true);
|
10361 |
|
10362 |
|
10363 |
|
10364 | $$3({ global: true, bind: true, forced: global$2.setInterval !== setInterval }, {
|
10365 | setInterval: setInterval
|
10366 | });
|
10367 |
|
10368 | var $$2 = _export;
|
10369 | var global$1 = global$p;
|
10370 | var schedulersFix = schedulersFix$2;
|
10371 |
|
10372 | var setTimeout$3 = schedulersFix(global$1.setTimeout, true);
|
10373 |
|
10374 |
|
10375 |
|
10376 | $$2({ global: true, bind: true, forced: global$1.setTimeout !== setTimeout$3 }, {
|
10377 | setTimeout: setTimeout$3
|
10378 | });
|
10379 |
|
10380 | var path$2 = path$o;
|
10381 |
|
10382 | var setTimeout$2 = path$2.setTimeout;
|
10383 |
|
10384 | var setTimeout$1 = setTimeout$2;
|
10385 |
|
10386 | var _setTimeout = getDefaultExportFromCjs(setTimeout$1);
|
10387 |
|
10388 | var $$1 = _export;
|
10389 | var toObject = toObject$e;
|
10390 | var toAbsoluteIndex = toAbsoluteIndex$4;
|
10391 | var toIntegerOrInfinity = toIntegerOrInfinity$4;
|
10392 | var lengthOfArrayLike = lengthOfArrayLike$d;
|
10393 | var setArrayLength = arraySetLength;
|
10394 | var doesNotExceedSafeInteger = doesNotExceedSafeInteger$4;
|
10395 | var arraySpeciesCreate = arraySpeciesCreate$4;
|
10396 | var createProperty = createProperty$6;
|
10397 | var deletePropertyOrThrow = deletePropertyOrThrow$2;
|
10398 | var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5;
|
10399 |
|
10400 | var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
|
10401 |
|
10402 | var max = Math.max;
|
10403 | var min = Math.min;
|
10404 |
|
10405 |
|
10406 |
|
10407 |
|
10408 | $$1({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
|
10409 | splice: function splice(start, deleteCount /* , ...items */) {
|
10410 | var O = toObject(this);
|
10411 | var len = lengthOfArrayLike(O);
|
10412 | var actualStart = toAbsoluteIndex(start, len);
|
10413 | var argumentsLength = arguments.length;
|
10414 | var insertCount, actualDeleteCount, A, k, from, to;
|
10415 | if (argumentsLength === 0) {
|
10416 | insertCount = actualDeleteCount = 0;
|
10417 | } else if (argumentsLength === 1) {
|
10418 | insertCount = 0;
|
10419 | actualDeleteCount = len - actualStart;
|
10420 | } else {
|
10421 | insertCount = argumentsLength - 2;
|
10422 | actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
|
10423 | }
|
10424 | doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
|
10425 | A = arraySpeciesCreate(O, actualDeleteCount);
|
10426 | for (k = 0; k < actualDeleteCount; k++) {
|
10427 | from = actualStart + k;
|
10428 | if (from in O) createProperty(A, k, O[from]);
|
10429 | }
|
10430 | A.length = actualDeleteCount;
|
10431 | if (insertCount < actualDeleteCount) {
|
10432 | for (k = actualStart; k < len - actualDeleteCount; k++) {
|
10433 | from = k + actualDeleteCount;
|
10434 | to = k + insertCount;
|
10435 | if (from in O) O[to] = O[from];
|
10436 | else deletePropertyOrThrow(O, to);
|
10437 | }
|
10438 | for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
|
10439 | } else if (insertCount > actualDeleteCount) {
|
10440 | for (k = len - actualDeleteCount; k > actualStart; k--) {
|
10441 | from = k + actualDeleteCount - 1;
|
10442 | to = k + insertCount - 1;
|
10443 | if (from in O) O[to] = O[from];
|
10444 | else deletePropertyOrThrow(O, to);
|
10445 | }
|
10446 | }
|
10447 | for (k = 0; k < insertCount; k++) {
|
10448 | O[k + actualStart] = arguments[k + 2];
|
10449 | }
|
10450 | setArrayLength(O, len - actualDeleteCount + insertCount);
|
10451 | return A;
|
10452 | }
|
10453 | });
|
10454 |
|
10455 | var getBuiltInPrototypeMethod = getBuiltInPrototypeMethod$g;
|
10456 |
|
10457 | var splice$3 = getBuiltInPrototypeMethod('Array', 'splice');
|
10458 |
|
10459 | var isPrototypeOf = objectIsPrototypeOf;
|
10460 | var method = splice$3;
|
10461 |
|
10462 | var ArrayPrototype = Array.prototype;
|
10463 |
|
10464 | var splice$2 = function (it) {
|
10465 | var own = it.splice;
|
10466 | return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.splice) ? method : own;
|
10467 | };
|
10468 |
|
10469 | var parent$5 = splice$2;
|
10470 |
|
10471 | var splice$1 = parent$5;
|
10472 |
|
10473 | var splice = splice$1;
|
10474 |
|
10475 | var _spliceInstanceProperty = getDefaultExportFromCjs(splice);
|
10476 |
|
10477 | |
10478 |
|
10479 |
|
10480 |
|
10481 |
|
10482 | var Queue = function () {
|
10483 | |
10484 |
|
10485 |
|
10486 |
|
10487 |
|
10488 | function Queue(options) {
|
10489 | _classCallCheck(this, Queue);
|
10490 |
|
10491 |
|
10492 | _defineProperty(this, "_queue", []);
|
10493 | _defineProperty(this, "_timeout", null);
|
10494 | _defineProperty(this, "_extended", null);
|
10495 |
|
10496 | this.delay = null;
|
10497 | this.max = Infinity;
|
10498 | this.setOptions(options);
|
10499 | }
|
10500 | |
10501 |
|
10502 |
|
10503 |
|
10504 |
|
10505 | _createClass(Queue, [{
|
10506 | key: "setOptions",
|
10507 | value: function setOptions(options) {
|
10508 | if (options && typeof options.delay !== "undefined") {
|
10509 | this.delay = options.delay;
|
10510 | }
|
10511 | if (options && typeof options.max !== "undefined") {
|
10512 | this.max = options.max;
|
10513 | }
|
10514 | this._flushIfNeeded();
|
10515 | }
|
10516 | |
10517 |
|
10518 |
|
10519 |
|
10520 |
|
10521 |
|
10522 |
|
10523 |
|
10524 | }, {
|
10525 | key: "destroy",
|
10526 | value:
|
10527 | |
10528 |
|
10529 |
|
10530 | function destroy() {
|
10531 | this.flush();
|
10532 | if (this._extended) {
|
10533 | var object = this._extended.object;
|
10534 | var methods = this._extended.methods;
|
10535 | for (var i = 0; i < methods.length; i++) {
|
10536 | var method = methods[i];
|
10537 | if (method.original) {
|
10538 |
|
10539 | object[method.name] = method.original;
|
10540 | } else {
|
10541 |
|
10542 | delete object[method.name];
|
10543 | }
|
10544 | }
|
10545 | this._extended = null;
|
10546 | }
|
10547 | }
|
10548 | |
10549 |
|
10550 |
|
10551 |
|
10552 |
|
10553 |
|
10554 | }, {
|
10555 | key: "replace",
|
10556 | value: function replace(object, method) {
|
10557 |
|
10558 | var me = this;
|
10559 | var original = object[method];
|
10560 | if (!original) {
|
10561 | throw new Error("Method " + method + " undefined");
|
10562 | }
|
10563 | object[method] = function () {
|
10564 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
10565 | args[_key] = arguments[_key];
|
10566 | }
|
10567 |
|
10568 | me.queue({
|
10569 | args: args,
|
10570 | fn: original,
|
10571 | context: this
|
10572 | });
|
10573 | };
|
10574 | }
|
10575 | |
10576 |
|
10577 |
|
10578 |
|
10579 |
|
10580 | }, {
|
10581 | key: "queue",
|
10582 | value: function queue(entry) {
|
10583 | if (typeof entry === "function") {
|
10584 | this._queue.push({
|
10585 | fn: entry
|
10586 | });
|
10587 | } else {
|
10588 | this._queue.push(entry);
|
10589 | }
|
10590 | this._flushIfNeeded();
|
10591 | }
|
10592 | |
10593 |
|
10594 |
|
10595 | }, {
|
10596 | key: "_flushIfNeeded",
|
10597 | value: function _flushIfNeeded() {
|
10598 | var _this = this;
|
10599 |
|
10600 | if (this._queue.length > this.max) {
|
10601 | this.flush();
|
10602 | }
|
10603 |
|
10604 | if (this._timeout != null) {
|
10605 | clearTimeout(this._timeout);
|
10606 | this._timeout = null;
|
10607 | }
|
10608 | if (this.queue.length > 0 && typeof this.delay === "number") {
|
10609 | this._timeout = _setTimeout(function () {
|
10610 | _this.flush();
|
10611 | }, this.delay);
|
10612 | }
|
10613 | }
|
10614 | |
10615 |
|
10616 |
|
10617 | }, {
|
10618 | key: "flush",
|
10619 | value: function flush() {
|
10620 | var _context, _context2;
|
10621 | _forEachInstanceProperty(_context = _spliceInstanceProperty(_context2 = this._queue).call(_context2, 0)).call(_context, function (entry) {
|
10622 | entry.fn.apply(entry.context || entry.fn, entry.args || []);
|
10623 | });
|
10624 | }
|
10625 | }], [{
|
10626 | key: "extend",
|
10627 | value: function extend(object, options) {
|
10628 | var queue = new Queue(options);
|
10629 | if (object.flush !== undefined) {
|
10630 | throw new Error("Target object already has a property flush");
|
10631 | }
|
10632 | object.flush = function () {
|
10633 | queue.flush();
|
10634 | };
|
10635 | var methods = [{
|
10636 | name: "flush",
|
10637 | original: undefined
|
10638 | }];
|
10639 | if (options && options.replace) {
|
10640 | for (var i = 0; i < options.replace.length; i++) {
|
10641 | var name = options.replace[i];
|
10642 | methods.push({
|
10643 | name: name,
|
10644 |
|
10645 | original: object[name]
|
10646 | });
|
10647 |
|
10648 | queue.replace(object, name);
|
10649 | }
|
10650 | }
|
10651 | queue._extended = {
|
10652 | object: object,
|
10653 | methods: methods
|
10654 | };
|
10655 | return queue;
|
10656 | }
|
10657 | }]);
|
10658 | return Queue;
|
10659 | }();
|
10660 |
|
10661 | |
10662 |
|
10663 |
|
10664 |
|
10665 |
|
10666 |
|
10667 | var DataSetPart = function () {
|
10668 | function DataSetPart() {
|
10669 | _classCallCheck(this, DataSetPart);
|
10670 | _defineProperty(this, "_subscribers", {
|
10671 | "*": [],
|
10672 | add: [],
|
10673 | remove: [],
|
10674 | update: []
|
10675 | });
|
10676 | |
10677 |
|
10678 |
|
10679 | _defineProperty(this, "subscribe", DataSetPart.prototype.on);
|
10680 | |
10681 |
|
10682 |
|
10683 | _defineProperty(this, "unsubscribe", DataSetPart.prototype.off);
|
10684 | }
|
10685 | _createClass(DataSetPart, [{
|
10686 | key: "_trigger",
|
10687 | value:
|
10688 | |
10689 |
|
10690 |
|
10691 |
|
10692 |
|
10693 |
|
10694 |
|
10695 | function _trigger(event, payload, senderId) {
|
10696 | var _context, _context2;
|
10697 | if (event === "*") {
|
10698 | throw new Error("Cannot trigger event *");
|
10699 | }
|
10700 | _forEachInstanceProperty(_context = _concatInstanceProperty(_context2 = []).call(_context2, _toConsumableArray(this._subscribers[event]), _toConsumableArray(this._subscribers["*"]))).call(_context, function (subscriber) {
|
10701 | subscriber(event, payload, senderId != null ? senderId : null);
|
10702 | });
|
10703 | }
|
10704 | |
10705 |
|
10706 |
|
10707 |
|
10708 |
|
10709 |
|
10710 |
|
10711 | }, {
|
10712 | key: "on",
|
10713 | value: function on(event, callback) {
|
10714 | if (typeof callback === "function") {
|
10715 | this._subscribers[event].push(callback);
|
10716 | }
|
10717 |
|
10718 | }
|
10719 | |
10720 |
|
10721 |
|
10722 |
|
10723 |
|
10724 |
|
10725 |
|
10726 | }, {
|
10727 | key: "off",
|
10728 | value: function off(event, callback) {
|
10729 | var _context3;
|
10730 | this._subscribers[event] = _filterInstanceProperty(_context3 = this._subscribers[event]).call(_context3, function (subscriber) {
|
10731 | return subscriber !== callback;
|
10732 | });
|
10733 | }
|
10734 | }, {
|
10735 | key: "testLeakSubscribers",
|
10736 | get: /* develblock:start */
|
10737 | function get() {
|
10738 | return this._subscribers;
|
10739 | }
|
10740 | }]);
|
10741 | return DataSetPart;
|
10742 | }();
|
10743 |
|
10744 | function _arrayWithHoles(arr) {
|
10745 | if (_Array$isArray$1(arr)) return arr;
|
10746 | }
|
10747 |
|
10748 | function _iterableToArrayLimit(r, l) {
|
10749 | var t = null == r ? null : "undefined" != typeof _Symbol$1 && _getIteratorMethod$1(r) || r["@@iterator"];
|
10750 | if (null != t) {
|
10751 | var e,
|
10752 | n,
|
10753 | i,
|
10754 | u,
|
10755 | a = [],
|
10756 | f = !0,
|
10757 | o = !1;
|
10758 | try {
|
10759 | if (i = (t = t.call(r)).next, 0 === l) {
|
10760 | if (Object(t) !== t) return;
|
10761 | f = !1;
|
10762 | } else for (; !(f = (e = i.call(t)).done) && (_pushInstanceProperty(a).call(a, e.value), a.length !== l); f = !0);
|
10763 | } catch (r) {
|
10764 | o = !0, n = r;
|
10765 | } finally {
|
10766 | try {
|
10767 | if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
10768 | } finally {
|
10769 | if (o) throw n;
|
10770 | }
|
10771 | }
|
10772 | return a;
|
10773 | }
|
10774 | }
|
10775 |
|
10776 | function _nonIterableRest() {
|
10777 | throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
10778 | }
|
10779 |
|
10780 | function _slicedToArray(arr, i) {
|
10781 | return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray$3(arr, i) || _nonIterableRest();
|
10782 | }
|
10783 |
|
10784 | var create = create$6;
|
10785 |
|
10786 | var _Object$create = getDefaultExportFromCjs(create);
|
10787 |
|
10788 | var collection = collection$2;
|
10789 | var collectionStrong = collectionStrong$2;
|
10790 |
|
10791 |
|
10792 |
|
10793 | collection('Set', function (init) {
|
10794 | return function Set() { return init(this, arguments.length ? arguments[0] : undefined); };
|
10795 | }, collectionStrong);
|
10796 |
|
10797 | var path$1 = path$o;
|
10798 |
|
10799 | var set$2 = path$1.Set;
|
10800 |
|
10801 | var parent$4 = set$2;
|
10802 |
|
10803 |
|
10804 | var set$1 = parent$4;
|
10805 |
|
10806 | var set = set$1;
|
10807 |
|
10808 | var _Set = /*@__PURE__*/getDefaultExportFromCjs(set);
|
10809 |
|
10810 | var getIterator$5 = getIterator$8;
|
10811 |
|
10812 | var getIterator_1 = getIterator$5;
|
10813 |
|
10814 | var parent$3 = getIterator_1;
|
10815 |
|
10816 |
|
10817 | var getIterator$4 = parent$3;
|
10818 |
|
10819 | var parent$2 = getIterator$4;
|
10820 |
|
10821 | var getIterator$3 = parent$2;
|
10822 |
|
10823 | var parent$1 = getIterator$3;
|
10824 |
|
10825 | var getIterator$2 = parent$1;
|
10826 |
|
10827 | var getIterator$1 = getIterator$2;
|
10828 |
|
10829 | var getIterator = getIterator$1;
|
10830 |
|
10831 | var _getIterator = /*@__PURE__*/getDefaultExportFromCjs(getIterator);
|
10832 |
|
10833 | function _createForOfIteratorHelper$2(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray(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; } } }; }
|
10834 | function _unsupportedIterableToArray$2(o, minLen) { var _context10; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$2(o, minLen); var n = _sliceInstanceProperty$1(_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 _Array$from$1(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$2(o, minLen); }
|
10835 | function _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; }
|
10836 | |
10837 |
|
10838 |
|
10839 |
|
10840 |
|
10841 |
|
10842 |
|
10843 |
|
10844 |
|
10845 | var DataStream = function (_Symbol$iterator$1) {
|
10846 | |
10847 |
|
10848 |
|
10849 |
|
10850 |
|
10851 | function DataStream(pairs) {
|
10852 | _classCallCheck(this, DataStream);
|
10853 | this._pairs = pairs;
|
10854 | }
|
10855 | |
10856 |
|
10857 |
|
10858 | _createClass(DataStream, [{
|
10859 | key: _Symbol$iterator$1,
|
10860 | value:
|
10861 |
|
10862 | _regeneratorRuntime.mark(function value() {
|
10863 | var _iterator, _step, _step$value, id, item;
|
10864 | return _regeneratorRuntime.wrap(function value$(_context) {
|
10865 | while (1) switch (_context.prev = _context.next) {
|
10866 | case 0:
|
10867 | _iterator = _createForOfIteratorHelper$2(this._pairs);
|
10868 | _context.prev = 1;
|
10869 | _iterator.s();
|
10870 | case 3:
|
10871 | if ((_step = _iterator.n()).done) {
|
10872 | _context.next = 9;
|
10873 | break;
|
10874 | }
|
10875 | _step$value = _slicedToArray(_step.value, 2), id = _step$value[0], item = _step$value[1];
|
10876 | _context.next = 7;
|
10877 | return [id, item];
|
10878 | case 7:
|
10879 | _context.next = 3;
|
10880 | break;
|
10881 | case 9:
|
10882 | _context.next = 14;
|
10883 | break;
|
10884 | case 11:
|
10885 | _context.prev = 11;
|
10886 | _context.t0 = _context["catch"](1);
|
10887 | _iterator.e(_context.t0);
|
10888 | case 14:
|
10889 | _context.prev = 14;
|
10890 | _iterator.f();
|
10891 | return _context.finish(14);
|
10892 | case 17:
|
10893 | case "end":
|
10894 | return _context.stop();
|
10895 | }
|
10896 | }, value, this, [[1, 11, 14, 17]]);
|
10897 | })
|
10898 | |
10899 |
|
10900 |
|
10901 | }, {
|
10902 | key: "entries",
|
10903 | value:
|
10904 |
|
10905 | _regeneratorRuntime.mark(function entries() {
|
10906 | var _iterator2, _step2, _step2$value, id, item;
|
10907 | return _regeneratorRuntime.wrap(function entries$(_context2) {
|
10908 | while (1) switch (_context2.prev = _context2.next) {
|
10909 | case 0:
|
10910 | _iterator2 = _createForOfIteratorHelper$2(this._pairs);
|
10911 | _context2.prev = 1;
|
10912 | _iterator2.s();
|
10913 | case 3:
|
10914 | if ((_step2 = _iterator2.n()).done) {
|
10915 | _context2.next = 9;
|
10916 | break;
|
10917 | }
|
10918 | _step2$value = _slicedToArray(_step2.value, 2), id = _step2$value[0], item = _step2$value[1];
|
10919 | _context2.next = 7;
|
10920 | return [id, item];
|
10921 | case 7:
|
10922 | _context2.next = 3;
|
10923 | break;
|
10924 | case 9:
|
10925 | _context2.next = 14;
|
10926 | break;
|
10927 | case 11:
|
10928 | _context2.prev = 11;
|
10929 | _context2.t0 = _context2["catch"](1);
|
10930 | _iterator2.e(_context2.t0);
|
10931 | case 14:
|
10932 | _context2.prev = 14;
|
10933 | _iterator2.f();
|
10934 | return _context2.finish(14);
|
10935 | case 17:
|
10936 | case "end":
|
10937 | return _context2.stop();
|
10938 | }
|
10939 | }, entries, this, [[1, 11, 14, 17]]);
|
10940 | })
|
10941 | |
10942 |
|
10943 |
|
10944 | }, {
|
10945 | key: "keys",
|
10946 | value:
|
10947 |
|
10948 | _regeneratorRuntime.mark(function keys() {
|
10949 | var _iterator3, _step3, _step3$value, id;
|
10950 | return _regeneratorRuntime.wrap(function keys$(_context3) {
|
10951 | while (1) switch (_context3.prev = _context3.next) {
|
10952 | case 0:
|
10953 | _iterator3 = _createForOfIteratorHelper$2(this._pairs);
|
10954 | _context3.prev = 1;
|
10955 | _iterator3.s();
|
10956 | case 3:
|
10957 | if ((_step3 = _iterator3.n()).done) {
|
10958 | _context3.next = 9;
|
10959 | break;
|
10960 | }
|
10961 | _step3$value = _slicedToArray(_step3.value, 1), id = _step3$value[0];
|
10962 | _context3.next = 7;
|
10963 | return id;
|
10964 | case 7:
|
10965 | _context3.next = 3;
|
10966 | break;
|
10967 | case 9:
|
10968 | _context3.next = 14;
|
10969 | break;
|
10970 | case 11:
|
10971 | _context3.prev = 11;
|
10972 | _context3.t0 = _context3["catch"](1);
|
10973 | _iterator3.e(_context3.t0);
|
10974 | case 14:
|
10975 | _context3.prev = 14;
|
10976 | _iterator3.f();
|
10977 | return _context3.finish(14);
|
10978 | case 17:
|
10979 | case "end":
|
10980 | return _context3.stop();
|
10981 | }
|
10982 | }, keys, this, [[1, 11, 14, 17]]);
|
10983 | })
|
10984 | |
10985 |
|
10986 |
|
10987 | }, {
|
10988 | key: "values",
|
10989 | value:
|
10990 |
|
10991 | _regeneratorRuntime.mark(function values() {
|
10992 | var _iterator4, _step4, _step4$value, item;
|
10993 | return _regeneratorRuntime.wrap(function values$(_context4) {
|
10994 | while (1) switch (_context4.prev = _context4.next) {
|
10995 | case 0:
|
10996 | _iterator4 = _createForOfIteratorHelper$2(this._pairs);
|
10997 | _context4.prev = 1;
|
10998 | _iterator4.s();
|
10999 | case 3:
|
11000 | if ((_step4 = _iterator4.n()).done) {
|
11001 | _context4.next = 9;
|
11002 | break;
|
11003 | }
|
11004 | _step4$value = _slicedToArray(_step4.value, 2), item = _step4$value[1];
|
11005 | _context4.next = 7;
|
11006 | return item;
|
11007 | case 7:
|
11008 | _context4.next = 3;
|
11009 | break;
|
11010 | case 9:
|
11011 | _context4.next = 14;
|
11012 | break;
|
11013 | case 11:
|
11014 | _context4.prev = 11;
|
11015 | _context4.t0 = _context4["catch"](1);
|
11016 | _iterator4.e(_context4.t0);
|
11017 | case 14:
|
11018 | _context4.prev = 14;
|
11019 | _iterator4.f();
|
11020 | return _context4.finish(14);
|
11021 | case 17:
|
11022 | case "end":
|
11023 | return _context4.stop();
|
11024 | }
|
11025 | }, values, this, [[1, 11, 14, 17]]);
|
11026 | })
|
11027 | |
11028 |
|
11029 |
|
11030 |
|
11031 |
|
11032 |
|
11033 |
|
11034 | }, {
|
11035 | key: "toIdArray",
|
11036 | value: function toIdArray() {
|
11037 | var _context5;
|
11038 | return _mapInstanceProperty(_context5 = _toConsumableArray(this._pairs)).call(_context5, function (pair) {
|
11039 | return pair[0];
|
11040 | });
|
11041 | }
|
11042 | |
11043 |
|
11044 |
|
11045 |
|
11046 |
|
11047 |
|
11048 |
|
11049 | }, {
|
11050 | key: "toItemArray",
|
11051 | value: function toItemArray() {
|
11052 | var _context6;
|
11053 | return _mapInstanceProperty(_context6 = _toConsumableArray(this._pairs)).call(_context6, function (pair) {
|
11054 | return pair[1];
|
11055 | });
|
11056 | }
|
11057 | |
11058 |
|
11059 |
|
11060 |
|
11061 |
|
11062 |
|
11063 |
|
11064 | }, {
|
11065 | key: "toEntryArray",
|
11066 | value: function toEntryArray() {
|
11067 | return _toConsumableArray(this._pairs);
|
11068 | }
|
11069 | |
11070 |
|
11071 |
|
11072 |
|
11073 |
|
11074 |
|
11075 |
|
11076 | }, {
|
11077 | key: "toObjectMap",
|
11078 | value: function toObjectMap() {
|
11079 | var map = _Object$create(null);
|
11080 | var _iterator5 = _createForOfIteratorHelper$2(this._pairs),
|
11081 | _step5;
|
11082 | try {
|
11083 | for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
11084 | var _step5$value = _slicedToArray(_step5.value, 2),
|
11085 | id = _step5$value[0],
|
11086 | item = _step5$value[1];
|
11087 | map[id] = item;
|
11088 | }
|
11089 | } catch (err) {
|
11090 | _iterator5.e(err);
|
11091 | } finally {
|
11092 | _iterator5.f();
|
11093 | }
|
11094 | return map;
|
11095 | }
|
11096 | |
11097 |
|
11098 |
|
11099 |
|
11100 |
|
11101 | }, {
|
11102 | key: "toMap",
|
11103 | value: function toMap() {
|
11104 | return new _Map(this._pairs);
|
11105 | }
|
11106 | |
11107 |
|
11108 |
|
11109 |
|
11110 |
|
11111 | }, {
|
11112 | key: "toIdSet",
|
11113 | value: function toIdSet() {
|
11114 | return new _Set(this.toIdArray());
|
11115 | }
|
11116 | |
11117 |
|
11118 |
|
11119 |
|
11120 |
|
11121 | }, {
|
11122 | key: "toItemSet",
|
11123 | value: function toItemSet() {
|
11124 | return new _Set(this.toItemArray());
|
11125 | }
|
11126 | |
11127 |
|
11128 |
|
11129 |
|
11130 |
|
11131 |
|
11132 |
|
11133 |
|
11134 |
|
11135 |
|
11136 |
|
11137 |
|
11138 |
|
11139 |
|
11140 |
|
11141 |
|
11142 |
|
11143 |
|
11144 |
|
11145 |
|
11146 |
|
11147 |
|
11148 | }, {
|
11149 | key: "cache",
|
11150 | value: function cache() {
|
11151 | return new DataStream(_toConsumableArray(this._pairs));
|
11152 | }
|
11153 | |
11154 |
|
11155 |
|
11156 |
|
11157 |
|
11158 |
|
11159 |
|
11160 | }, {
|
11161 | key: "distinct",
|
11162 | value: function distinct(callback) {
|
11163 | var set = new _Set();
|
11164 | var _iterator6 = _createForOfIteratorHelper$2(this._pairs),
|
11165 | _step6;
|
11166 | try {
|
11167 | for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
|
11168 | var _step6$value = _slicedToArray(_step6.value, 2),
|
11169 | id = _step6$value[0],
|
11170 | item = _step6$value[1];
|
11171 | set.add(callback(item, id));
|
11172 | }
|
11173 | } catch (err) {
|
11174 | _iterator6.e(err);
|
11175 | } finally {
|
11176 | _iterator6.f();
|
11177 | }
|
11178 | return set;
|
11179 | }
|
11180 | /**
|
11181 | * Filter the items of the stream.
|
11182 | *
|
11183 | * @param callback - The function that decides whether an item will be included.
|
11184 | * @returns A new data stream with the filtered items.
|
11185 | */
|
11186 | }, {
|
11187 | key: "filter",
|
11188 | value: function filter(callback) {
|
11189 | var pairs = this._pairs;
|
11190 | return new DataStream({
|
11191 | [_Symbol$iterator]() {
|
11192 | return _regeneratorRuntime.mark(function _callee() {
|
11193 | var _iterator7, _step7, _step7$value, id, item;
|
11194 | return _regeneratorRuntime.wrap(function _callee$(_context7) {
|
11195 | while (1) switch (_context7.prev = _context7.next) {
|
11196 | case 0:
|
11197 | _iterator7 = _createForOfIteratorHelper$2(pairs);
|
11198 | _context7.prev = 1;
|
11199 | _iterator7.s();
|
11200 | case 3:
|
11201 | if ((_step7 = _iterator7.n()).done) {
|
11202 | _context7.next = 10;
|
11203 | break;
|
11204 | }
|
11205 | _step7$value = _slicedToArray(_step7.value, 2), id = _step7$value[0], item = _step7$value[1];
|
11206 | if (!callback(item, id)) {
|
11207 | _context7.next = 8;
|
11208 | break;
|
11209 | }
|
11210 | _context7.next = 8;
|
11211 | return [id, item];
|
11212 | case 8:
|
11213 | _context7.next = 3;
|
11214 | break;
|
11215 | case 10:
|
11216 | _context7.next = 15;
|
11217 | break;
|
11218 | case 12:
|
11219 | _context7.prev = 12;
|
11220 | _context7.t0 = _context7["catch"](1);
|
11221 | _iterator7.e(_context7.t0);
|
11222 | case 15:
|
11223 | _context7.prev = 15;
|
11224 | _iterator7.f();
|
11225 | return _context7.finish(15);
|
11226 | case 18:
|
11227 | case "end":
|
11228 | return _context7.stop();
|
11229 | }
|
11230 | }, _callee, null, [[1, 12, 15, 18]]);
|
11231 | })();
|
11232 | }
|
11233 | });
|
11234 | }
|
11235 | |
11236 |
|
11237 |
|
11238 |
|
11239 |
|
11240 | }, {
|
11241 | key: "forEach",
|
11242 | value: function forEach(callback) {
|
11243 | var _iterator8 = _createForOfIteratorHelper$2(this._pairs),
|
11244 | _step8;
|
11245 | try {
|
11246 | for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
|
11247 | var _step8$value = _slicedToArray(_step8.value, 2),
|
11248 | id = _step8$value[0],
|
11249 | item = _step8$value[1];
|
11250 | callback(item, id);
|
11251 | }
|
11252 | } catch (err) {
|
11253 | _iterator8.e(err);
|
11254 | } finally {
|
11255 | _iterator8.f();
|
11256 | }
|
11257 | }
|
11258 | |
11259 |
|
11260 |
|
11261 |
|
11262 |
|
11263 |
|
11264 |
|
11265 | }, {
|
11266 | key: "map",
|
11267 | value: function map(callback) {
|
11268 | var pairs = this._pairs;
|
11269 | return new DataStream({
|
11270 | [_Symbol$iterator]() {
|
11271 | return _regeneratorRuntime.mark(function _callee2() {
|
11272 | var _iterator9, _step9, _step9$value, id, item;
|
11273 | return _regeneratorRuntime.wrap(function _callee2$(_context8) {
|
11274 | while (1) switch (_context8.prev = _context8.next) {
|
11275 | case 0:
|
11276 | _iterator9 = _createForOfIteratorHelper$2(pairs);
|
11277 | _context8.prev = 1;
|
11278 | _iterator9.s();
|
11279 | case 3:
|
11280 | if ((_step9 = _iterator9.n()).done) {
|
11281 | _context8.next = 9;
|
11282 | break;
|
11283 | }
|
11284 | _step9$value = _slicedToArray(_step9.value, 2), id = _step9$value[0], item = _step9$value[1];
|
11285 | _context8.next = 7;
|
11286 | return [id, callback(item, id)];
|
11287 | case 7:
|
11288 | _context8.next = 3;
|
11289 | break;
|
11290 | case 9:
|
11291 | _context8.next = 14;
|
11292 | break;
|
11293 | case 11:
|
11294 | _context8.prev = 11;
|
11295 | _context8.t0 = _context8["catch"](1);
|
11296 | _iterator9.e(_context8.t0);
|
11297 | case 14:
|
11298 | _context8.prev = 14;
|
11299 | _iterator9.f();
|
11300 | return _context8.finish(14);
|
11301 | case 17:
|
11302 | case "end":
|
11303 | return _context8.stop();
|
11304 | }
|
11305 | }, _callee2, null, [[1, 11, 14, 17]]);
|
11306 | })();
|
11307 | }
|
11308 | });
|
11309 | }
|
11310 | |
11311 |
|
11312 |
|
11313 |
|
11314 |
|
11315 |
|
11316 | }, {
|
11317 | key: "max",
|
11318 | value: function max(callback) {
|
11319 | var iter = _getIterator(this._pairs);
|
11320 | var curr = iter.next();
|
11321 | if (curr.done) {
|
11322 | return null;
|
11323 | }
|
11324 | var maxItem = curr.value[1];
|
11325 | var maxValue = callback(curr.value[1], curr.value[0]);
|
11326 | while (!(curr = iter.next()).done) {
|
11327 | var _curr$value = _slicedToArray(curr.value, 2),
|
11328 | id = _curr$value[0],
|
11329 | item = _curr$value[1];
|
11330 | var _value = callback(item, id);
|
11331 | if (_value > maxValue) {
|
11332 | maxValue = _value;
|
11333 | maxItem = item;
|
11334 | }
|
11335 | }
|
11336 | return maxItem;
|
11337 | }
|
11338 | |
11339 |
|
11340 |
|
11341 |
|
11342 |
|
11343 |
|
11344 | }, {
|
11345 | key: "min",
|
11346 | value: function min(callback) {
|
11347 | var iter = _getIterator(this._pairs);
|
11348 | var curr = iter.next();
|
11349 | if (curr.done) {
|
11350 | return null;
|
11351 | }
|
11352 | var minItem = curr.value[1];
|
11353 | var minValue = callback(curr.value[1], curr.value[0]);
|
11354 | while (!(curr = iter.next()).done) {
|
11355 | var _curr$value2 = _slicedToArray(curr.value, 2),
|
11356 | id = _curr$value2[0],
|
11357 | item = _curr$value2[1];
|
11358 | var _value2 = callback(item, id);
|
11359 | if (_value2 < minValue) {
|
11360 | minValue = _value2;
|
11361 | minItem = item;
|
11362 | }
|
11363 | }
|
11364 | return minItem;
|
11365 | }
|
11366 | |
11367 |
|
11368 |
|
11369 |
|
11370 |
|
11371 |
|
11372 |
|
11373 |
|
11374 | }, {
|
11375 | key: "reduce",
|
11376 | value: function reduce(callback, accumulator) {
|
11377 | var _iterator10 = _createForOfIteratorHelper$2(this._pairs),
|
11378 | _step10;
|
11379 | try {
|
11380 | for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
|
11381 | var _step10$value = _slicedToArray(_step10.value, 2),
|
11382 | id = _step10$value[0],
|
11383 | item = _step10$value[1];
|
11384 | accumulator = callback(accumulator, item, id);
|
11385 | }
|
11386 | } catch (err) {
|
11387 | _iterator10.e(err);
|
11388 | } finally {
|
11389 | _iterator10.f();
|
11390 | }
|
11391 | return accumulator;
|
11392 | }
|
11393 | |
11394 |
|
11395 |
|
11396 |
|
11397 |
|
11398 |
|
11399 | }, {
|
11400 | key: "sort",
|
11401 | value: function sort(callback) {
|
11402 | var _this = this;
|
11403 | return new DataStream({
|
11404 | [_Symbol$iterator]: function () {
|
11405 | var _context9;
|
11406 | return _getIterator(_sortInstanceProperty(_context9 = _toConsumableArray(_this._pairs)).call(_context9, function (_ref, _ref2) {
|
11407 | var _ref3 = _slicedToArray(_ref, 2),
|
11408 | idA = _ref3[0],
|
11409 | itemA = _ref3[1];
|
11410 | var _ref4 = _slicedToArray(_ref2, 2),
|
11411 | idB = _ref4[0],
|
11412 | itemB = _ref4[1];
|
11413 | return callback(itemA, itemB, idA, idB);
|
11414 | }));
|
11415 | }
|
11416 | });
|
11417 | }
|
11418 | }]);
|
11419 | return DataStream;
|
11420 | }(_Symbol$iterator);
|
11421 |
|
11422 | function ownKeys$4(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = _filterInstanceProperty(o).call(o, function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
11423 | function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var _context10, _context11; var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? _forEachInstanceProperty(_context10 = ownKeys$4(Object(t), !0)).call(_context10, function (r) { _defineProperty(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : _forEachInstanceProperty(_context11 = ownKeys$4(Object(t))).call(_context11, function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
|
11424 | function _createForOfIteratorHelper$1(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray(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; } } }; }
|
11425 | function _unsupportedIterableToArray$1(o, minLen) { var _context9; if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = _sliceInstanceProperty$1(_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 _Array$from$1(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
|
11426 | function _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; }
|
11427 | function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
11428 | function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
11429 | |
11430 |
|
11431 |
|
11432 |
|
11433 |
|
11434 |
|
11435 |
|
11436 |
|
11437 |
|
11438 |
|
11439 |
|
11440 | function ensureFullItem(item, idProp) {
|
11441 | if (item[idProp] == null) {
|
11442 |
|
11443 | item[idProp] = v4();
|
11444 | }
|
11445 | return item;
|
11446 | }
|
11447 | |
11448 |
|
11449 |
|
11450 |
|
11451 |
|
11452 |
|
11453 |
|
11454 |
|
11455 |
|
11456 |
|
11457 |
|
11458 |
|
11459 |
|
11460 |
|
11461 |
|
11462 |
|
11463 |
|
11464 |
|
11465 |
|
11466 |
|
11467 |
|
11468 |
|
11469 |
|
11470 |
|
11471 |
|
11472 |
|
11473 |
|
11474 |
|
11475 |
|
11476 |
|
11477 |
|
11478 |
|
11479 |
|
11480 |
|
11481 |
|
11482 |
|
11483 |
|
11484 |
|
11485 |
|
11486 |
|
11487 |
|
11488 |
|
11489 |
|
11490 |
|
11491 |
|
11492 |
|
11493 |
|
11494 |
|
11495 |
|
11496 |
|
11497 |
|
11498 |
|
11499 |
|
11500 |
|
11501 |
|
11502 |
|
11503 |
|
11504 |
|
11505 |
|
11506 | var DataSet = function (_DataSetPart) {
|
11507 | _inherits(DataSet, _DataSetPart);
|
11508 | var _super = _createSuper$1(DataSet);
|
11509 | |
11510 |
|
11511 |
|
11512 |
|
11513 |
|
11514 |
|
11515 | function DataSet(data, options) {
|
11516 | var _this;
|
11517 | _classCallCheck(this, DataSet);
|
11518 | _this = _super.call(this);
|
11519 |
|
11520 | _defineProperty(_assertThisInitialized(_this), "_queue", null);
|
11521 | if (data && !_Array$isArray(data)) {
|
11522 | options = data;
|
11523 | data = [];
|
11524 | }
|
11525 | _this._options = options || {};
|
11526 | _this._data = new _Map();
|
11527 | _this.length = 0;
|
11528 | _this._idProp = _this._options.fieldId || "id";
|
11529 |
|
11530 | if (data && data.length) {
|
11531 | _this.add(data);
|
11532 | }
|
11533 | _this.setOptions(options);
|
11534 | return _this;
|
11535 | }
|
11536 | |
11537 |
|
11538 |
|
11539 |
|
11540 |
|
11541 | _createClass(DataSet, [{
|
11542 | key: "idProp",
|
11543 | get: /** Flush all queued calls. */
|
11544 |
|
11545 | /** @inheritDoc */
|
11546 |
|
11547 | /** @inheritDoc */
|
11548 | function get() {
|
11549 | return this._idProp;
|
11550 | }
|
11551 | }, {
|
11552 | key: "setOptions",
|
11553 | value: function setOptions(options) {
|
11554 | if (options && options.queue !== undefined) {
|
11555 | if (options.queue === false) {
|
11556 |
|
11557 | if (this._queue) {
|
11558 | this._queue.destroy();
|
11559 | this._queue = null;
|
11560 | }
|
11561 | } else {
|
11562 |
|
11563 | if (!this._queue) {
|
11564 | this._queue = Queue.extend(this, {
|
11565 | replace: ["add", "update", "remove"]
|
11566 | });
|
11567 | }
|
11568 | if (options.queue && typeof options.queue === "object") {
|
11569 | this._queue.setOptions(options.queue);
|
11570 | }
|
11571 | }
|
11572 | }
|
11573 | }
|
11574 | |
11575 |
|
11576 |
|
11577 |
|
11578 |
|
11579 |
|
11580 |
|
11581 |
|
11582 |
|
11583 |
|
11584 |
|
11585 |
|
11586 |
|
11587 |
|
11588 |
|
11589 |
|
11590 |
|
11591 |
|
11592 |
|
11593 |
|
11594 |
|
11595 |
|
11596 |
|
11597 |
|
11598 |
|
11599 |
|
11600 | }, {
|
11601 | key: "add",
|
11602 | value: function add(data, senderId) {
|
11603 | var _this2 = this;
|
11604 | var addedIds = [];
|
11605 | var id;
|
11606 | if (_Array$isArray(data)) {
|
11607 |
|
11608 | var idsToAdd = _mapInstanceProperty(data).call(data, function (d) {
|
11609 | return d[_this2._idProp];
|
11610 | });
|
11611 | if (_someInstanceProperty(idsToAdd).call(idsToAdd, function (id) {
|
11612 | return _this2._data.has(id);
|
11613 | })) {
|
11614 | throw new Error("A duplicate id was found in the parameter array.");
|
11615 | }
|
11616 | for (var i = 0, len = data.length; i < len; i++) {
|
11617 | id = this._addItem(data[i]);
|
11618 | addedIds.push(id);
|
11619 | }
|
11620 | } else if (data && typeof data === "object") {
|
11621 |
|
11622 | id = this._addItem(data);
|
11623 | addedIds.push(id);
|
11624 | } else {
|
11625 | throw new Error("Unknown dataType");
|
11626 | }
|
11627 | if (addedIds.length) {
|
11628 | this._trigger("add", {
|
11629 | items: addedIds
|
11630 | }, senderId);
|
11631 | }
|
11632 | return addedIds;
|
11633 | }
|
11634 | |
11635 |
|
11636 |
|
11637 |
|
11638 |
|
11639 |
|
11640 |
|
11641 |
|
11642 |
|
11643 |
|
11644 |
|
11645 |
|
11646 |
|
11647 |
|
11648 |
|
11649 |
|
11650 |
|
11651 |
|
11652 |
|
11653 |
|
11654 |
|
11655 |
|
11656 |
|
11657 |
|
11658 |
|
11659 |
|
11660 |
|
11661 |
|
11662 |
|
11663 |
|
11664 |
|
11665 |
|
11666 |
|
11667 |
|
11668 | }, {
|
11669 | key: "update",
|
11670 | value: function update(data, senderId) {
|
11671 | var _this3 = this;
|
11672 | var addedIds = [];
|
11673 | var updatedIds = [];
|
11674 | var oldData = [];
|
11675 | var updatedData = [];
|
11676 | var idProp = this._idProp;
|
11677 | var addOrUpdate = function addOrUpdate(item) {
|
11678 | var origId = item[idProp];
|
11679 | if (origId != null && _this3._data.has(origId)) {
|
11680 | var fullItem = item;
|
11681 | var oldItem = _Object$assign({}, _this3._data.get(origId));
|
11682 |
|
11683 | var id = _this3._updateItem(fullItem);
|
11684 | updatedIds.push(id);
|
11685 | updatedData.push(fullItem);
|
11686 | oldData.push(oldItem);
|
11687 | } else {
|
11688 |
|
11689 | var _id = _this3._addItem(item);
|
11690 | addedIds.push(_id);
|
11691 | }
|
11692 | };
|
11693 | if (_Array$isArray(data)) {
|
11694 |
|
11695 | for (var i = 0, len = data.length; i < len; i++) {
|
11696 | if (data[i] && typeof data[i] === "object") {
|
11697 | addOrUpdate(data[i]);
|
11698 | } else {
|
11699 | console.warn("Ignoring input item, which is not an object at index " + i);
|
11700 | }
|
11701 | }
|
11702 | } else if (data && typeof data === "object") {
|
11703 |
|
11704 | addOrUpdate(data);
|
11705 | } else {
|
11706 | throw new Error("Unknown dataType");
|
11707 | }
|
11708 | if (addedIds.length) {
|
11709 | this._trigger("add", {
|
11710 | items: addedIds
|
11711 | }, senderId);
|
11712 | }
|
11713 | if (updatedIds.length) {
|
11714 | var props = {
|
11715 | items: updatedIds,
|
11716 | oldData: oldData,
|
11717 | data: updatedData
|
11718 | };
|
11719 |
|
11720 |
|
11721 |
|
11722 |
|
11723 |
|
11724 |
|
11725 |
|
11726 | this._trigger("update", props, senderId);
|
11727 | }
|
11728 | return _concatInstanceProperty(addedIds).call(addedIds, updatedIds);
|
11729 | }
|
11730 | |
11731 |
|
11732 |
|
11733 |
|
11734 |
|
11735 |
|
11736 |
|
11737 |
|
11738 |
|
11739 |
|
11740 |
|
11741 |
|
11742 |
|
11743 |
|
11744 |
|
11745 |
|
11746 |
|
11747 |
|
11748 |
|
11749 |
|
11750 |
|
11751 |
|
11752 |
|
11753 |
|
11754 |
|
11755 |
|
11756 |
|
11757 |
|
11758 |
|
11759 |
|
11760 |
|
11761 |
|
11762 |
|
11763 |
|
11764 | }, {
|
11765 | key: "updateOnly",
|
11766 | value: function updateOnly(data, senderId) {
|
11767 | var _context,
|
11768 | _this4 = this;
|
11769 | if (!_Array$isArray(data)) {
|
11770 | data = [data];
|
11771 | }
|
11772 | var updateEventData = _mapInstanceProperty(_context = _mapInstanceProperty(data).call(data, function (update) {
|
11773 | var oldData = _this4._data.get(update[_this4._idProp]);
|
11774 | if (oldData == null) {
|
11775 | throw new Error("Updating non-existent items is not allowed.");
|
11776 | }
|
11777 | return {
|
11778 | oldData,
|
11779 | update
|
11780 | };
|
11781 | })).call(_context, function (_ref) {
|
11782 | var oldData = _ref.oldData,
|
11783 | update = _ref.update;
|
11784 | var id = oldData[_this4._idProp];
|
11785 | var updatedData = pureDeepObjectAssign(oldData, update);
|
11786 | _this4._data.set(id, updatedData);
|
11787 | return {
|
11788 | id,
|
11789 | oldData: oldData,
|
11790 | updatedData
|
11791 | };
|
11792 | });
|
11793 | if (updateEventData.length) {
|
11794 | var props = {
|
11795 | items: _mapInstanceProperty(updateEventData).call(updateEventData, function (value) {
|
11796 | return value.id;
|
11797 | }),
|
11798 | oldData: _mapInstanceProperty(updateEventData).call(updateEventData, function (value) {
|
11799 | return value.oldData;
|
11800 | }),
|
11801 | data: _mapInstanceProperty(updateEventData).call(updateEventData, function (value) {
|
11802 | return value.updatedData;
|
11803 | })
|
11804 | };
|
11805 |
|
11806 |
|
11807 |
|
11808 |
|
11809 |
|
11810 |
|
11811 |
|
11812 | this._trigger("update", props, senderId);
|
11813 | return props.items;
|
11814 | } else {
|
11815 | return [];
|
11816 | }
|
11817 | }
|
11818 |
|
11819 | }, {
|
11820 | key: "get",
|
11821 | value: function get(first, second) {
|
11822 |
|
11823 |
|
11824 | var id = undefined;
|
11825 | var ids = undefined;
|
11826 | var options = undefined;
|
11827 | if (isId(first)) {
|
11828 |
|
11829 | id = first;
|
11830 | options = second;
|
11831 | } else if (_Array$isArray(first)) {
|
11832 |
|
11833 | ids = first;
|
11834 | options = second;
|
11835 | } else {
|
11836 |
|
11837 | options = first;
|
11838 | }
|
11839 |
|
11840 | var returnType = options && options.returnType === "Object" ? "Object" : "Array";
|
11841 |
|
11842 |
|
11843 |
|
11844 |
|
11845 |
|
11846 |
|
11847 |
|
11848 |
|
11849 |
|
11850 |
|
11851 |
|
11852 |
|
11853 | var filter = options && _filterInstanceProperty(options);
|
11854 | var items = [];
|
11855 | var item = undefined;
|
11856 | var itemIds = undefined;
|
11857 | var itemId = undefined;
|
11858 |
|
11859 | if (id != null) {
|
11860 |
|
11861 | item = this._data.get(id);
|
11862 | if (item && filter && !filter(item)) {
|
11863 | item = undefined;
|
11864 | }
|
11865 | } else if (ids != null) {
|
11866 |
|
11867 | for (var i = 0, len = ids.length; i < len; i++) {
|
11868 | item = this._data.get(ids[i]);
|
11869 | if (item != null && (!filter || filter(item))) {
|
11870 | items.push(item);
|
11871 | }
|
11872 | }
|
11873 | } else {
|
11874 | var _context2;
|
11875 |
|
11876 | itemIds = _toConsumableArray(_keysInstanceProperty(_context2 = this._data).call(_context2));
|
11877 | for (var _i = 0, _len = itemIds.length; _i < _len; _i++) {
|
11878 | itemId = itemIds[_i];
|
11879 | item = this._data.get(itemId);
|
11880 | if (item != null && (!filter || filter(item))) {
|
11881 | items.push(item);
|
11882 | }
|
11883 | }
|
11884 | }
|
11885 |
|
11886 | if (options && options.order && id == undefined) {
|
11887 | this._sort(items, options.order);
|
11888 | }
|
11889 |
|
11890 | if (options && options.fields) {
|
11891 | var fields = options.fields;
|
11892 | if (id != undefined && item != null) {
|
11893 | item = this._filterFields(item, fields);
|
11894 | } else {
|
11895 | for (var _i2 = 0, _len2 = items.length; _i2 < _len2; _i2++) {
|
11896 | items[_i2] = this._filterFields(items[_i2], fields);
|
11897 | }
|
11898 | }
|
11899 | }
|
11900 |
|
11901 | if (returnType == "Object") {
|
11902 | var result = {};
|
11903 | for (var _i3 = 0, _len3 = items.length; _i3 < _len3; _i3++) {
|
11904 | var resultant = items[_i3];
|
11905 |
|
11906 |
|
11907 | var _id2 = resultant[this._idProp];
|
11908 | result[_id2] = resultant;
|
11909 | }
|
11910 | return result;
|
11911 | } else {
|
11912 | if (id != null) {
|
11913 | var _item;
|
11914 |
|
11915 | return (_item = item) !== null && _item !== void 0 ? _item : null;
|
11916 | } else {
|
11917 |
|
11918 | return items;
|
11919 | }
|
11920 | }
|
11921 | }
|
11922 |
|
11923 | }, {
|
11924 | key: "getIds",
|
11925 | value: function getIds(options) {
|
11926 | var data = this._data;
|
11927 | var filter = options && _filterInstanceProperty(options);
|
11928 | var order = options && options.order;
|
11929 | var itemIds = _toConsumableArray(_keysInstanceProperty(data).call(data));
|
11930 | var ids = [];
|
11931 | if (filter) {
|
11932 |
|
11933 | if (order) {
|
11934 |
|
11935 | var items = [];
|
11936 | for (var i = 0, len = itemIds.length; i < len; i++) {
|
11937 | var id = itemIds[i];
|
11938 | var item = this._data.get(id);
|
11939 | if (item != null && filter(item)) {
|
11940 | items.push(item);
|
11941 | }
|
11942 | }
|
11943 | this._sort(items, order);
|
11944 | for (var _i4 = 0, _len4 = items.length; _i4 < _len4; _i4++) {
|
11945 | ids.push(items[_i4][this._idProp]);
|
11946 | }
|
11947 | } else {
|
11948 |
|
11949 | for (var _i5 = 0, _len5 = itemIds.length; _i5 < _len5; _i5++) {
|
11950 | var _id3 = itemIds[_i5];
|
11951 | var _item2 = this._data.get(_id3);
|
11952 | if (_item2 != null && filter(_item2)) {
|
11953 | ids.push(_item2[this._idProp]);
|
11954 | }
|
11955 | }
|
11956 | }
|
11957 | } else {
|
11958 |
|
11959 | if (order) {
|
11960 |
|
11961 | var _items = [];
|
11962 | for (var _i6 = 0, _len6 = itemIds.length; _i6 < _len6; _i6++) {
|
11963 | var _id4 = itemIds[_i6];
|
11964 | _items.push(data.get(_id4));
|
11965 | }
|
11966 | this._sort(_items, order);
|
11967 | for (var _i7 = 0, _len7 = _items.length; _i7 < _len7; _i7++) {
|
11968 | ids.push(_items[_i7][this._idProp]);
|
11969 | }
|
11970 | } else {
|
11971 |
|
11972 | for (var _i8 = 0, _len8 = itemIds.length; _i8 < _len8; _i8++) {
|
11973 | var _id5 = itemIds[_i8];
|
11974 | var _item3 = data.get(_id5);
|
11975 | if (_item3 != null) {
|
11976 | ids.push(_item3[this._idProp]);
|
11977 | }
|
11978 | }
|
11979 | }
|
11980 | }
|
11981 | return ids;
|
11982 | }
|
11983 |
|
11984 | }, {
|
11985 | key: "getDataSet",
|
11986 | value: function getDataSet() {
|
11987 | return this;
|
11988 | }
|
11989 |
|
11990 | }, {
|
11991 | key: "forEach",
|
11992 | value: function forEach(callback, options) {
|
11993 | var filter = options && _filterInstanceProperty(options);
|
11994 | var data = this._data;
|
11995 | var itemIds = _toConsumableArray(_keysInstanceProperty(data).call(data));
|
11996 | if (options && options.order) {
|
11997 |
|
11998 | var items = this.get(options);
|
11999 | for (var i = 0, len = items.length; i < len; i++) {
|
12000 | var item = items[i];
|
12001 | var id = item[this._idProp];
|
12002 | callback(item, id);
|
12003 | }
|
12004 | } else {
|
12005 |
|
12006 | for (var _i9 = 0, _len9 = itemIds.length; _i9 < _len9; _i9++) {
|
12007 | var _id6 = itemIds[_i9];
|
12008 | var _item4 = this._data.get(_id6);
|
12009 | if (_item4 != null && (!filter || filter(_item4))) {
|
12010 | callback(_item4, _id6);
|
12011 | }
|
12012 | }
|
12013 | }
|
12014 | }
|
12015 |
|
12016 | }, {
|
12017 | key: "map",
|
12018 | value: function map(callback, options) {
|
12019 | var filter = options && _filterInstanceProperty(options);
|
12020 | var mappedItems = [];
|
12021 | var data = this._data;
|
12022 | var itemIds = _toConsumableArray(_keysInstanceProperty(data).call(data));
|
12023 |
|
12024 | for (var i = 0, len = itemIds.length; i < len; i++) {
|
12025 | var id = itemIds[i];
|
12026 | var item = this._data.get(id);
|
12027 | if (item != null && (!filter || filter(item))) {
|
12028 | mappedItems.push(callback(item, id));
|
12029 | }
|
12030 | }
|
12031 |
|
12032 | if (options && options.order) {
|
12033 | this._sort(mappedItems, options.order);
|
12034 | }
|
12035 | return mappedItems;
|
12036 | }
|
12037 | |
12038 |
|
12039 |
|
12040 |
|
12041 |
|
12042 |
|
12043 |
|
12044 |
|
12045 | }, {
|
12046 | key: "_filterFields",
|
12047 | value: function _filterFields(item, fields) {
|
12048 | var _context3;
|
12049 | if (!item) {
|
12050 |
|
12051 | return item;
|
12052 | }
|
12053 | return _reduceInstanceProperty(_context3 = _Array$isArray(fields) ?
|
12054 |
|
12055 | fields :
|
12056 |
|
12057 | _Object$keys(fields)).call(_context3, function (filteredItem, field) {
|
12058 | filteredItem[field] = item[field];
|
12059 | return filteredItem;
|
12060 | }, {});
|
12061 | }
|
12062 | |
12063 |
|
12064 |
|
12065 |
|
12066 |
|
12067 |
|
12068 |
|
12069 | }, {
|
12070 | key: "_sort",
|
12071 | value: function _sort(items, order) {
|
12072 | if (typeof order === "string") {
|
12073 |
|
12074 | var name = order;
|
12075 | _sortInstanceProperty(items).call(items, function (a, b) {
|
12076 |
|
12077 | var av = a[name];
|
12078 | var bv = b[name];
|
12079 | return av > bv ? 1 : av < bv ? -1 : 0;
|
12080 | });
|
12081 | } else if (typeof order === "function") {
|
12082 |
|
12083 | _sortInstanceProperty(items).call(items, order);
|
12084 | } else {
|
12085 |
|
12086 |
|
12087 | throw new TypeError("Order must be a function or a string");
|
12088 | }
|
12089 | }
|
12090 | |
12091 |
|
12092 |
|
12093 |
|
12094 |
|
12095 |
|
12096 |
|
12097 |
|
12098 |
|
12099 |
|
12100 |
|
12101 |
|
12102 |
|
12103 |
|
12104 |
|
12105 |
|
12106 |
|
12107 |
|
12108 |
|
12109 |
|
12110 |
|
12111 |
|
12112 |
|
12113 |
|
12114 |
|
12115 |
|
12116 | }, {
|
12117 | key: "remove",
|
12118 | value: function remove(id, senderId) {
|
12119 | var removedIds = [];
|
12120 | var removedItems = [];
|
12121 |
|
12122 | var ids = _Array$isArray(id) ? id : [id];
|
12123 | for (var i = 0, len = ids.length; i < len; i++) {
|
12124 | var item = this._remove(ids[i]);
|
12125 | if (item) {
|
12126 | var itemId = item[this._idProp];
|
12127 | if (itemId != null) {
|
12128 | removedIds.push(itemId);
|
12129 | removedItems.push(item);
|
12130 | }
|
12131 | }
|
12132 | }
|
12133 | if (removedIds.length) {
|
12134 | this._trigger("remove", {
|
12135 | items: removedIds,
|
12136 | oldData: removedItems
|
12137 | }, senderId);
|
12138 | }
|
12139 | return removedIds;
|
12140 | }
|
12141 | |
12142 |
|
12143 |
|
12144 |
|
12145 |
|
12146 |
|
12147 | }, {
|
12148 | key: "_remove",
|
12149 | value: function _remove(id) {
|
12150 |
|
12151 |
|
12152 | var ident;
|
12153 |
|
12154 | if (isId(id)) {
|
12155 | ident = id;
|
12156 | } else if (id && typeof id === "object") {
|
12157 | ident = id[this._idProp];
|
12158 | }
|
12159 |
|
12160 | if (ident != null && this._data.has(ident)) {
|
12161 | var item = this._data.get(ident) || null;
|
12162 | this._data.delete(ident);
|
12163 | --this.length;
|
12164 | return item;
|
12165 | }
|
12166 | return null;
|
12167 | }
|
12168 | |
12169 |
|
12170 |
|
12171 |
|
12172 |
|
12173 |
|
12174 |
|
12175 |
|
12176 | }, {
|
12177 | key: "clear",
|
12178 | value: function clear(senderId) {
|
12179 | var _context4;
|
12180 | var ids = _toConsumableArray(_keysInstanceProperty(_context4 = this._data).call(_context4));
|
12181 | var items = [];
|
12182 | for (var i = 0, len = ids.length; i < len; i++) {
|
12183 | items.push(this._data.get(ids[i]));
|
12184 | }
|
12185 | this._data.clear();
|
12186 | this.length = 0;
|
12187 | this._trigger("remove", {
|
12188 | items: ids,
|
12189 | oldData: items
|
12190 | }, senderId);
|
12191 | return ids;
|
12192 | }
|
12193 | |
12194 |
|
12195 |
|
12196 |
|
12197 |
|
12198 |
|
12199 | }, {
|
12200 | key: "max",
|
12201 | value: function max(field) {
|
12202 | var _context5;
|
12203 | var max = null;
|
12204 | var maxField = null;
|
12205 | var _iterator = _createForOfIteratorHelper$1(_valuesInstanceProperty(_context5 = this._data).call(_context5)),
|
12206 | _step;
|
12207 | try {
|
12208 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
12209 | var item = _step.value;
|
12210 | var itemField = item[field];
|
12211 | if (typeof itemField === "number" && (maxField == null || itemField > maxField)) {
|
12212 | max = item;
|
12213 | maxField = itemField;
|
12214 | }
|
12215 | }
|
12216 | } catch (err) {
|
12217 | _iterator.e(err);
|
12218 | } finally {
|
12219 | _iterator.f();
|
12220 | }
|
12221 | return max || null;
|
12222 | }
|
12223 | |
12224 |
|
12225 |
|
12226 |
|
12227 |
|
12228 |
|
12229 | }, {
|
12230 | key: "min",
|
12231 | value: function min(field) {
|
12232 | var _context6;
|
12233 | var min = null;
|
12234 | var minField = null;
|
12235 | var _iterator2 = _createForOfIteratorHelper$1(_valuesInstanceProperty(_context6 = this._data).call(_context6)),
|
12236 | _step2;
|
12237 | try {
|
12238 | for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
12239 | var item = _step2.value;
|
12240 | var itemField = item[field];
|
12241 | if (typeof itemField === "number" && (minField == null || itemField < minField)) {
|
12242 | min = item;
|
12243 | minField = itemField;
|
12244 | }
|
12245 | }
|
12246 | } catch (err) {
|
12247 | _iterator2.e(err);
|
12248 | } finally {
|
12249 | _iterator2.f();
|
12250 | }
|
12251 | return min || null;
|
12252 | }
|
12253 | |
12254 |
|
12255 |
|
12256 |
|
12257 |
|
12258 |
|
12259 | }, {
|
12260 | key: "distinct",
|
12261 | value: function distinct(prop) {
|
12262 | var data = this._data;
|
12263 | var itemIds = _toConsumableArray(_keysInstanceProperty(data).call(data));
|
12264 | var values = [];
|
12265 | var count = 0;
|
12266 | for (var i = 0, len = itemIds.length; i < len; i++) {
|
12267 | var id = itemIds[i];
|
12268 | var item = data.get(id);
|
12269 | var value = item[prop];
|
12270 | var exists = false;
|
12271 | for (var j = 0; j < count; j++) {
|
12272 | if (values[j] == value) {
|
12273 | exists = true;
|
12274 | break;
|
12275 | }
|
12276 | }
|
12277 | if (!exists && value !== undefined) {
|
12278 | values[count] = value;
|
12279 | count++;
|
12280 | }
|
12281 | }
|
12282 | return values;
|
12283 | }
|
12284 | |
12285 |
|
12286 |
|
12287 |
|
12288 |
|
12289 |
|
12290 | }, {
|
12291 | key: "_addItem",
|
12292 | value: function _addItem(item) {
|
12293 | var fullItem = ensureFullItem(item, this._idProp);
|
12294 | var id = fullItem[this._idProp];
|
12295 |
|
12296 | if (this._data.has(id)) {
|
12297 |
|
12298 | throw new Error("Cannot add item: item with id " + id + " already exists");
|
12299 | }
|
12300 | this._data.set(id, fullItem);
|
12301 | ++this.length;
|
12302 | return id;
|
12303 | }
|
12304 | |
12305 |
|
12306 |
|
12307 |
|
12308 |
|
12309 |
|
12310 |
|
12311 | }, {
|
12312 | key: "_updateItem",
|
12313 | value: function _updateItem(update) {
|
12314 | var id = update[this._idProp];
|
12315 | if (id == null) {
|
12316 | throw new Error("Cannot update item: item has no id (item: " + _JSON$stringify(update) + ")");
|
12317 | }
|
12318 | var item = this._data.get(id);
|
12319 | if (!item) {
|
12320 |
|
12321 | throw new Error("Cannot update item: no item with id " + id + " found");
|
12322 | }
|
12323 | this._data.set(id, _objectSpread(_objectSpread({}, item), update));
|
12324 | return id;
|
12325 | }
|
12326 |
|
12327 | }, {
|
12328 | key: "stream",
|
12329 | value: function stream(ids) {
|
12330 | if (ids) {
|
12331 | var data = this._data;
|
12332 | return new DataStream({
|
12333 | [_Symbol$iterator]() {
|
12334 | return _regeneratorRuntime.mark(function _callee() {
|
12335 | var _iterator3, _step3, id, item;
|
12336 | return _regeneratorRuntime.wrap(function _callee$(_context7) {
|
12337 | while (1) switch (_context7.prev = _context7.next) {
|
12338 | case 0:
|
12339 | _iterator3 = _createForOfIteratorHelper$1(ids);
|
12340 | _context7.prev = 1;
|
12341 | _iterator3.s();
|
12342 | case 3:
|
12343 | if ((_step3 = _iterator3.n()).done) {
|
12344 | _context7.next = 11;
|
12345 | break;
|
12346 | }
|
12347 | id = _step3.value;
|
12348 | item = data.get(id);
|
12349 | if (!(item != null)) {
|
12350 | _context7.next = 9;
|
12351 | break;
|
12352 | }
|
12353 | _context7.next = 9;
|
12354 | return [id, item];
|
12355 | case 9:
|
12356 | _context7.next = 3;
|
12357 | break;
|
12358 | case 11:
|
12359 | _context7.next = 16;
|
12360 | break;
|
12361 | case 13:
|
12362 | _context7.prev = 13;
|
12363 | _context7.t0 = _context7["catch"](1);
|
12364 | _iterator3.e(_context7.t0);
|
12365 | case 16:
|
12366 | _context7.prev = 16;
|
12367 | _iterator3.f();
|
12368 | return _context7.finish(16);
|
12369 | case 19:
|
12370 | case "end":
|
12371 | return _context7.stop();
|
12372 | }
|
12373 | }, _callee, null, [[1, 13, 16, 19]]);
|
12374 | })();
|
12375 | }
|
12376 | });
|
12377 | } else {
|
12378 | var _context8;
|
12379 | return new DataStream({
|
12380 | [_Symbol$iterator]: _bindInstanceProperty$1(_context8 = _entriesInstanceProperty(this._data)).call(_context8, this._data)
|
12381 | });
|
12382 | }
|
12383 | }
|
12384 |
|
12385 | }, {
|
12386 | key: "testLeakData",
|
12387 | get: function get() {
|
12388 | return this._data;
|
12389 | }
|
12390 | }, {
|
12391 | key: "testLeakIdProp",
|
12392 | get: function get() {
|
12393 | return this._idProp;
|
12394 | }
|
12395 | }, {
|
12396 | key: "testLeakOptions",
|
12397 | get: function get() {
|
12398 | return this._options;
|
12399 | }
|
12400 | }, {
|
12401 | key: "testLeakQueue",
|
12402 | get: function get() {
|
12403 | return this._queue;
|
12404 | },
|
12405 | set: function set(v) {
|
12406 | this._queue = v;
|
12407 | }
|
12408 | }]);
|
12409 | return DataSet;
|
12410 | }(DataSetPart);
|
12411 |
|
12412 | var $ = _export;
|
12413 | var ownKeys$3 = ownKeys$7;
|
12414 |
|
12415 |
|
12416 |
|
12417 | $({ target: 'Reflect', stat: true }, {
|
12418 | ownKeys: ownKeys$3
|
12419 | });
|
12420 |
|
12421 | var path = path$o;
|
12422 |
|
12423 | var ownKeys$2 = path.Reflect.ownKeys;
|
12424 |
|
12425 | var parent = ownKeys$2;
|
12426 |
|
12427 | var ownKeys$1 = parent;
|
12428 |
|
12429 | var ownKeys = ownKeys$1;
|
12430 |
|
12431 | var _Reflect$ownKeys = getDefaultExportFromCjs(ownKeys);
|
12432 |
|
12433 | function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && _getIteratorMethod(o) || o["@@iterator"]; if (!it) { if (_Array$isArray(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; } } }; }
|
12434 | function _unsupportedIterableToArray(o, minLen) { var _context5; if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = _sliceInstanceProperty$1(_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 _Array$from$1(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
12435 | function _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; }
|
12436 | function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
12437 | function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
12438 | |
12439 |
|
12440 |
|
12441 |
|
12442 |
|
12443 |
|
12444 |
|
12445 |
|
12446 |
|
12447 |
|
12448 |
|
12449 |
|
12450 |
|
12451 |
|
12452 |
|
12453 |
|
12454 |
|
12455 |
|
12456 |
|
12457 |
|
12458 |
|
12459 |
|
12460 |
|
12461 |
|
12462 |
|
12463 |
|
12464 |
|
12465 |
|
12466 |
|
12467 |
|
12468 |
|
12469 |
|
12470 |
|
12471 |
|
12472 |
|
12473 |
|
12474 |
|
12475 |
|
12476 |
|
12477 |
|
12478 |
|
12479 |
|
12480 |
|
12481 |
|
12482 |
|
12483 | var DataView = function (_DataSetPart) {
|
12484 | _inherits(DataView, _DataSetPart);
|
12485 | var _super = _createSuper(DataView);
|
12486 |
|
12487 |
|
12488 | |
12489 |
|
12490 |
|
12491 |
|
12492 |
|
12493 |
|
12494 | function DataView(data, options) {
|
12495 | var _context;
|
12496 | var _this;
|
12497 | _classCallCheck(this, DataView);
|
12498 | _this = _super.call(this);
|
12499 |
|
12500 | _defineProperty(_assertThisInitialized(_this), "length", 0);
|
12501 |
|
12502 | _defineProperty(_assertThisInitialized(_this), "_ids", new _Set());
|
12503 | _this._options = options || {};
|
12504 | _this._listener = _bindInstanceProperty$1(_context = _this._onEvent).call(_context, _assertThisInitialized(_this));
|
12505 | _this.setData(data);
|
12506 | return _this;
|
12507 | }
|
12508 |
|
12509 |
|
12510 | |
12511 |
|
12512 |
|
12513 |
|
12514 |
|
12515 |
|
12516 |
|
12517 |
|
12518 |
|
12519 |
|
12520 | _createClass(DataView, [{
|
12521 | key: "idProp",
|
12522 | get: /** @inheritDoc */
|
12523 | function get() {
|
12524 | return this.getDataSet().idProp;
|
12525 | }
|
12526 | }, {
|
12527 | key: "setData",
|
12528 | value: function setData(data) {
|
12529 | if (this._data) {
|
12530 |
|
12531 | if (this._data.off) {
|
12532 | this._data.off("*", this._listener);
|
12533 | }
|
12534 |
|
12535 | var ids = this._data.getIds({
|
12536 | filter: _filterInstanceProperty(this._options)
|
12537 | });
|
12538 | var items = this._data.get(ids);
|
12539 | this._ids.clear();
|
12540 | this.length = 0;
|
12541 | this._trigger("remove", {
|
12542 | items: ids,
|
12543 | oldData: items
|
12544 | });
|
12545 | }
|
12546 | if (data != null) {
|
12547 | this._data = data;
|
12548 |
|
12549 | var _ids = this._data.getIds({
|
12550 | filter: _filterInstanceProperty(this._options)
|
12551 | });
|
12552 | for (var i = 0, len = _ids.length; i < len; i++) {
|
12553 | var id = _ids[i];
|
12554 | this._ids.add(id);
|
12555 | }
|
12556 | this.length = _ids.length;
|
12557 | this._trigger("add", {
|
12558 | items: _ids
|
12559 | });
|
12560 | } else {
|
12561 | this._data = new DataSet();
|
12562 | }
|
12563 |
|
12564 | if (this._data.on) {
|
12565 | this._data.on("*", this._listener);
|
12566 | }
|
12567 | }
|
12568 | |
12569 |
|
12570 |
|
12571 |
|
12572 | }, {
|
12573 | key: "refresh",
|
12574 | value: function refresh() {
|
12575 | var ids = this._data.getIds({
|
12576 | filter: _filterInstanceProperty(this._options)
|
12577 | });
|
12578 | var oldIds = _toConsumableArray(this._ids);
|
12579 | var newIds = {};
|
12580 | var addedIds = [];
|
12581 | var removedIds = [];
|
12582 | var removedItems = [];
|
12583 |
|
12584 | for (var i = 0, len = ids.length; i < len; i++) {
|
12585 | var id = ids[i];
|
12586 | newIds[id] = true;
|
12587 | if (!this._ids.has(id)) {
|
12588 | addedIds.push(id);
|
12589 | this._ids.add(id);
|
12590 | }
|
12591 | }
|
12592 |
|
12593 | for (var _i = 0, _len = oldIds.length; _i < _len; _i++) {
|
12594 | var _id = oldIds[_i];
|
12595 | var item = this._data.get(_id);
|
12596 | if (item == null) {
|
12597 |
|
12598 |
|
12599 |
|
12600 |
|
12601 | console.error("If you see this, report it please.");
|
12602 | } else if (!newIds[_id]) {
|
12603 | removedIds.push(_id);
|
12604 | removedItems.push(item);
|
12605 | this._ids.delete(_id);
|
12606 | }
|
12607 | }
|
12608 | this.length += addedIds.length - removedIds.length;
|
12609 |
|
12610 | if (addedIds.length) {
|
12611 | this._trigger("add", {
|
12612 | items: addedIds
|
12613 | });
|
12614 | }
|
12615 | if (removedIds.length) {
|
12616 | this._trigger("remove", {
|
12617 | items: removedIds,
|
12618 | oldData: removedItems
|
12619 | });
|
12620 | }
|
12621 | }
|
12622 |
|
12623 | }, {
|
12624 | key: "get",
|
12625 | value: function get(first, second) {
|
12626 | if (this._data == null) {
|
12627 | return null;
|
12628 | }
|
12629 |
|
12630 | var ids = null;
|
12631 | var options;
|
12632 | if (isId(first) || _Array$isArray(first)) {
|
12633 | ids = first;
|
12634 | options = second;
|
12635 | } else {
|
12636 | options = first;
|
12637 | }
|
12638 |
|
12639 | var viewOptions = _Object$assign({}, this._options, options);
|
12640 |
|
12641 | var thisFilter = _filterInstanceProperty(this._options);
|
12642 | var optionsFilter = options && _filterInstanceProperty(options);
|
12643 | if (thisFilter && optionsFilter) {
|
12644 | viewOptions.filter = function (item) {
|
12645 | return thisFilter(item) && optionsFilter(item);
|
12646 | };
|
12647 | }
|
12648 | if (ids == null) {
|
12649 | return this._data.get(viewOptions);
|
12650 | } else {
|
12651 | return this._data.get(ids, viewOptions);
|
12652 | }
|
12653 | }
|
12654 |
|
12655 | }, {
|
12656 | key: "getIds",
|
12657 | value: function getIds(options) {
|
12658 | if (this._data.length) {
|
12659 | var defaultFilter = _filterInstanceProperty(this._options);
|
12660 | var optionsFilter = options != null ? _filterInstanceProperty(options) : null;
|
12661 | var filter;
|
12662 | if (optionsFilter) {
|
12663 | if (defaultFilter) {
|
12664 | filter = function filter(item) {
|
12665 | return defaultFilter(item) && optionsFilter(item);
|
12666 | };
|
12667 | } else {
|
12668 | filter = optionsFilter;
|
12669 | }
|
12670 | } else {
|
12671 | filter = defaultFilter;
|
12672 | }
|
12673 | return this._data.getIds({
|
12674 | filter: filter,
|
12675 | order: options && options.order
|
12676 | });
|
12677 | } else {
|
12678 | return [];
|
12679 | }
|
12680 | }
|
12681 |
|
12682 | }, {
|
12683 | key: "forEach",
|
12684 | value: function forEach(callback, options) {
|
12685 | if (this._data) {
|
12686 | var _context2;
|
12687 | var defaultFilter = _filterInstanceProperty(this._options);
|
12688 | var optionsFilter = options && _filterInstanceProperty(options);
|
12689 | var filter;
|
12690 | if (optionsFilter) {
|
12691 | if (defaultFilter) {
|
12692 | filter = function filter(item) {
|
12693 | return defaultFilter(item) && optionsFilter(item);
|
12694 | };
|
12695 | } else {
|
12696 | filter = optionsFilter;
|
12697 | }
|
12698 | } else {
|
12699 | filter = defaultFilter;
|
12700 | }
|
12701 | _forEachInstanceProperty(_context2 = this._data).call(_context2, callback, {
|
12702 | filter: filter,
|
12703 | order: options && options.order
|
12704 | });
|
12705 | }
|
12706 | }
|
12707 |
|
12708 | }, {
|
12709 | key: "map",
|
12710 | value: function map(callback, options) {
|
12711 | if (this._data) {
|
12712 | var _context3;
|
12713 | var defaultFilter = _filterInstanceProperty(this._options);
|
12714 | var optionsFilter = options && _filterInstanceProperty(options);
|
12715 | var filter;
|
12716 | if (optionsFilter) {
|
12717 | if (defaultFilter) {
|
12718 | filter = function filter(item) {
|
12719 | return defaultFilter(item) && optionsFilter(item);
|
12720 | };
|
12721 | } else {
|
12722 | filter = optionsFilter;
|
12723 | }
|
12724 | } else {
|
12725 | filter = defaultFilter;
|
12726 | }
|
12727 | return _mapInstanceProperty(_context3 = this._data).call(_context3, callback, {
|
12728 | filter: filter,
|
12729 | order: options && options.order
|
12730 | });
|
12731 | } else {
|
12732 | return [];
|
12733 | }
|
12734 | }
|
12735 |
|
12736 | }, {
|
12737 | key: "getDataSet",
|
12738 | value: function getDataSet() {
|
12739 | return this._data.getDataSet();
|
12740 | }
|
12741 |
|
12742 | }, {
|
12743 | key: "stream",
|
12744 | value: function stream(ids) {
|
12745 | var _context4;
|
12746 | return this._data.stream(ids || {
|
12747 | [_Symbol$iterator]: _bindInstanceProperty$1(_context4 = _keysInstanceProperty(this._ids)).call(_context4, this._ids)
|
12748 | });
|
12749 | }
|
12750 | |
12751 |
|
12752 |
|
12753 |
|
12754 |
|
12755 |
|
12756 |
|
12757 |
|
12758 | }, {
|
12759 | key: "dispose",
|
12760 | value: function dispose() {
|
12761 | var _this$_data;
|
12762 | if ((_this$_data = this._data) !== null && _this$_data !== void 0 && _this$_data.off) {
|
12763 | this._data.off("*", this._listener);
|
12764 | }
|
12765 | var message = "This data view has already been disposed of.";
|
12766 | var replacement = {
|
12767 | get: function get() {
|
12768 | throw new Error(message);
|
12769 | },
|
12770 | set: function set() {
|
12771 | throw new Error(message);
|
12772 | },
|
12773 | configurable: false
|
12774 | };
|
12775 | var _iterator = _createForOfIteratorHelper(_Reflect$ownKeys(DataView.prototype)),
|
12776 | _step;
|
12777 | try {
|
12778 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
12779 | var key = _step.value;
|
12780 | _Object$defineProperty(this, key, replacement);
|
12781 | }
|
12782 | } catch (err) {
|
12783 | _iterator.e(err);
|
12784 | } finally {
|
12785 | _iterator.f();
|
12786 | }
|
12787 | }
|
12788 | |
12789 |
|
12790 |
|
12791 |
|
12792 |
|
12793 |
|
12794 |
|
12795 | }, {
|
12796 | key: "_onEvent",
|
12797 | value: function _onEvent(event, params, senderId) {
|
12798 | if (!params || !params.items || !this._data) {
|
12799 | return;
|
12800 | }
|
12801 | var ids = params.items;
|
12802 | var addedIds = [];
|
12803 | var updatedIds = [];
|
12804 | var removedIds = [];
|
12805 | var oldItems = [];
|
12806 | var updatedItems = [];
|
12807 | var removedItems = [];
|
12808 | switch (event) {
|
12809 | case "add":
|
12810 |
|
12811 | for (var i = 0, len = ids.length; i < len; i++) {
|
12812 | var id = ids[i];
|
12813 | var item = this.get(id);
|
12814 | if (item) {
|
12815 | this._ids.add(id);
|
12816 | addedIds.push(id);
|
12817 | }
|
12818 | }
|
12819 | break;
|
12820 | case "update":
|
12821 |
|
12822 |
|
12823 | for (var _i2 = 0, _len2 = ids.length; _i2 < _len2; _i2++) {
|
12824 | var _id2 = ids[_i2];
|
12825 | var _item = this.get(_id2);
|
12826 | if (_item) {
|
12827 | if (this._ids.has(_id2)) {
|
12828 | updatedIds.push(_id2);
|
12829 | updatedItems.push(params.data[_i2]);
|
12830 | oldItems.push(params.oldData[_i2]);
|
12831 | } else {
|
12832 | this._ids.add(_id2);
|
12833 | addedIds.push(_id2);
|
12834 | }
|
12835 | } else {
|
12836 | if (this._ids.has(_id2)) {
|
12837 | this._ids.delete(_id2);
|
12838 | removedIds.push(_id2);
|
12839 | removedItems.push(params.oldData[_i2]);
|
12840 | }
|
12841 | }
|
12842 | }
|
12843 | break;
|
12844 | case "remove":
|
12845 |
|
12846 | for (var _i3 = 0, _len3 = ids.length; _i3 < _len3; _i3++) {
|
12847 | var _id3 = ids[_i3];
|
12848 | if (this._ids.has(_id3)) {
|
12849 | this._ids.delete(_id3);
|
12850 | removedIds.push(_id3);
|
12851 | removedItems.push(params.oldData[_i3]);
|
12852 | }
|
12853 | }
|
12854 | break;
|
12855 | }
|
12856 | this.length += addedIds.length - removedIds.length;
|
12857 | if (addedIds.length) {
|
12858 | this._trigger("add", {
|
12859 | items: addedIds
|
12860 | }, senderId);
|
12861 | }
|
12862 | if (updatedIds.length) {
|
12863 | this._trigger("update", {
|
12864 | items: updatedIds,
|
12865 | oldData: oldItems,
|
12866 | data: updatedItems
|
12867 | }, senderId);
|
12868 | }
|
12869 | if (removedIds.length) {
|
12870 | this._trigger("remove", {
|
12871 | items: removedIds,
|
12872 | oldData: removedItems
|
12873 | }, senderId);
|
12874 | }
|
12875 | }
|
12876 | }]);
|
12877 | return DataView;
|
12878 | }(DataSetPart);
|
12879 |
|
12880 | |
12881 |
|
12882 |
|
12883 |
|
12884 |
|
12885 |
|
12886 |
|
12887 | function isDataSetLike(idProp, v) {
|
12888 | return typeof v === "object" && v !== null && idProp === v.idProp && typeof v.add === "function" && typeof v.clear === "function" && typeof v.distinct === "function" && typeof _forEachInstanceProperty(v) === "function" && typeof v.get === "function" && typeof v.getDataSet === "function" && typeof v.getIds === "function" && typeof v.length === "number" && typeof _mapInstanceProperty(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";
|
12889 | }
|
12890 |
|
12891 | |
12892 |
|
12893 |
|
12894 |
|
12895 |
|
12896 |
|
12897 |
|
12898 | function isDataViewLike(idProp, v) {
|
12899 | return typeof v === "object" && v !== null && idProp === v.idProp && typeof _forEachInstanceProperty(v) === "function" && typeof v.get === "function" && typeof v.getDataSet === "function" && typeof v.getIds === "function" && typeof v.length === "number" && typeof _mapInstanceProperty(v) === "function" && typeof v.off === "function" && typeof v.on === "function" && typeof v.stream === "function" && isDataSetLike(idProp, v.getDataSet());
|
12900 | }
|
12901 |
|
12902 |
|
12903 | console.warn("You're running a development build.");
|
12904 |
|
12905 |
|
12906 | var index = {
|
12907 | DataSet,
|
12908 | DataView,
|
12909 | Queue
|
12910 | };
|
12911 |
|
12912 | exports.DELETE = DELETE;
|
12913 | exports.DataSet = DataSet;
|
12914 | exports.DataStream = DataStream;
|
12915 | exports.DataView = DataView;
|
12916 | exports.Queue = Queue;
|
12917 | exports.createNewDataPipeFrom = createNewDataPipeFrom;
|
12918 | exports.default = index;
|
12919 | exports.isDataSetLike = isDataSetLike;
|
12920 | exports.isDataViewLike = isDataViewLike;
|
12921 |
|
12922 | Object.defineProperty(exports, '__esModule', { value: true });
|
12923 |
|
12924 | }));
|
12925 |
|