vis-data 8.0.4 → 8.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/declarations/data-interface.d.ts.map +1 -1
  2. package/declarations/data-pipe.d.ts.map +1 -1
  3. package/declarations/data-set-part.d.ts.map +1 -1
  4. package/declarations/data-set.d.ts +3 -2
  5. package/declarations/data-set.d.ts.map +1 -1
  6. package/declarations/data-view-check.d.ts +1 -1
  7. package/declarations/data-view-check.d.ts.map +1 -1
  8. package/declarations/data-view.d.ts +2 -2
  9. package/declarations/data-view.d.ts.map +1 -1
  10. package/dist/esm.js +1924 -1048
  11. package/dist/esm.js.map +1 -1
  12. package/dist/umd.js +1924 -1048
  13. package/dist/umd.js.map +1 -1
  14. package/esnext/esm/vis-data.js +162 -162
  15. package/esnext/esm/vis-data.js.map +1 -1
  16. package/esnext/esm/vis-data.min.js +3 -3
  17. package/esnext/esm/vis-data.min.js.map +1 -1
  18. package/esnext/esm/vis-data.min.mjs +3 -3
  19. package/esnext/esm/vis-data.min.mjs.map +1 -1
  20. package/esnext/esm/vis-data.mjs +162 -162
  21. package/esnext/esm/vis-data.mjs.map +1 -1
  22. package/esnext/umd/vis-data.cjs +162 -162
  23. package/esnext/umd/vis-data.cjs.map +1 -1
  24. package/esnext/umd/vis-data.js +162 -162
  25. package/esnext/umd/vis-data.js.map +1 -1
  26. package/esnext/umd/vis-data.min.cjs +3 -3
  27. package/esnext/umd/vis-data.min.cjs.map +1 -1
  28. package/esnext/umd/vis-data.min.js +3 -3
  29. package/esnext/umd/vis-data.min.js.map +1 -1
  30. package/package.json +132 -136
  31. package/peer/esm/vis-data.js +1450 -675
  32. package/peer/esm/vis-data.js.map +1 -1
  33. package/peer/esm/vis-data.min.js +4 -4
  34. package/peer/esm/vis-data.min.js.map +1 -1
  35. package/peer/esm/vis-data.min.mjs +4 -4
  36. package/peer/esm/vis-data.min.mjs.map +1 -1
  37. package/peer/esm/vis-data.mjs +1450 -675
  38. package/peer/esm/vis-data.mjs.map +1 -1
  39. package/peer/umd/vis-data.cjs +1450 -675
  40. package/peer/umd/vis-data.cjs.map +1 -1
  41. package/peer/umd/vis-data.js +1450 -675
  42. package/peer/umd/vis-data.js.map +1 -1
  43. package/peer/umd/vis-data.min.cjs +4 -4
  44. package/peer/umd/vis-data.min.cjs.map +1 -1
  45. package/peer/umd/vis-data.min.js +4 -4
  46. package/peer/umd/vis-data.min.js.map +1 -1
  47. package/standalone/esm/vis-data.js +1450 -675
  48. package/standalone/esm/vis-data.js.map +1 -1
  49. package/standalone/esm/vis-data.min.js +4 -4
  50. package/standalone/esm/vis-data.min.js.map +1 -1
  51. package/standalone/esm/vis-data.min.mjs +4 -4
  52. package/standalone/esm/vis-data.min.mjs.map +1 -1
  53. package/standalone/esm/vis-data.mjs +1450 -675
  54. package/standalone/esm/vis-data.mjs.map +1 -1
  55. package/standalone/umd/vis-data.cjs +1450 -675
  56. package/standalone/umd/vis-data.cjs.map +1 -1
  57. package/standalone/umd/vis-data.js +1450 -675
  58. package/standalone/umd/vis-data.js.map +1 -1
  59. package/standalone/umd/vis-data.min.cjs +4 -4
  60. package/standalone/umd/vis-data.min.cjs.map +1 -1
  61. package/standalone/umd/vis-data.min.js +4 -4
  62. package/standalone/umd/vis-data.min.js.map +1 -1
package/dist/umd.js CHANGED
@@ -4,8 +4,8 @@
4
4
  *
5
5
  * Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
6
6
  *
7
- * @version 8.0.4
8
- * @date 2026-05-07T14:01:37.689Z
7
+ * @version 8.0.5
8
+ * @date 2026-08-06T17:35:50.737Z
9
9
  *
10
10
  * @copyright (c) 2011-2017 Almende B.V, http://almende.com
11
11
  * @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
@@ -90,7 +90,7 @@
90
90
 
91
91
  functionBindNative = !fails(function () {
92
92
  // eslint-disable-next-line es/no-function-prototype-bind -- safe
93
- var test = (function () { /* empty */ }).bind();
93
+ var test = function () { /* empty */ }.bind();
94
94
  // eslint-disable-next-line no-prototype-builtins -- safe
95
95
  return typeof test != 'function' || test.hasOwnProperty('prototype');
96
96
  });
@@ -636,10 +636,10 @@
636
636
  var store = sharedStore.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
637
637
 
638
638
  (store.versions || (store.versions = [])).push({
639
- version: '3.44.0',
639
+ version: '3.49.0',
640
640
  mode: IS_PURE ? 'pure' : 'global',
641
- copyright: '© 2014-2025 Denis Pushkarev (zloirock.ru)',
642
- license: 'https://github.com/zloirock/core-js/blob/v3.44.0/LICENSE',
641
+ copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
642
+ license: 'https://github.com/zloirock/core-js/blob/v3.49.0/LICENSE',
643
643
  source: 'https://github.com/zloirock/core-js'
644
644
  });
645
645
  return sharedStore.exports;
@@ -1166,11 +1166,11 @@
1166
1166
 
1167
1167
  var Object = path.Object;
1168
1168
 
1169
- var defineProperty = defineProperty$5.exports = function defineProperty(it, key, desc) {
1169
+ var $defineProperty = defineProperty$5.exports = function defineProperty(it, key, desc) {
1170
1170
  return Object.defineProperty(it, key, desc);
1171
1171
  };
1172
1172
 
1173
- if (Object.defineProperty.sham) defineProperty.sham = true;
1173
+ if (Object.defineProperty.sham) $defineProperty.sham = true;
1174
1174
  return defineProperty$5.exports;
1175
1175
  }
1176
1176
 
@@ -1225,21 +1225,21 @@
1225
1225
 
1226
1226
  var es_array_concat = {};
1227
1227
 
1228
- var isArray$3;
1229
- var hasRequiredIsArray$3;
1228
+ var isArray$6;
1229
+ var hasRequiredIsArray$6;
1230
1230
 
1231
- function requireIsArray$3 () {
1232
- if (hasRequiredIsArray$3) return isArray$3;
1233
- hasRequiredIsArray$3 = 1;
1231
+ function requireIsArray$6 () {
1232
+ if (hasRequiredIsArray$6) return isArray$6;
1233
+ hasRequiredIsArray$6 = 1;
1234
1234
  var classof = /*@__PURE__*/ requireClassofRaw();
1235
1235
 
1236
1236
  // `IsArray` abstract operation
1237
1237
  // https://tc39.es/ecma262/#sec-isarray
1238
1238
  // eslint-disable-next-line es/no-array-isarray -- safe
1239
- isArray$3 = Array.isArray || function isArray(argument) {
1239
+ isArray$6 = Array.isArray || function isArray(argument) {
1240
1240
  return classof(argument) === 'Array';
1241
1241
  };
1242
- return isArray$3;
1242
+ return isArray$6;
1243
1243
  }
1244
1244
 
1245
1245
  var mathTrunc;
@@ -1324,7 +1324,7 @@
1324
1324
  var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
1325
1325
 
1326
1326
  doesNotExceedSafeInteger = function (it) {
1327
- if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
1327
+ if (it > MAX_SAFE_INTEGER) throw new $TypeError('Maximum allowed index exceeded');
1328
1328
  return it;
1329
1329
  };
1330
1330
  return doesNotExceedSafeInteger;
@@ -1347,6 +1347,41 @@
1347
1347
  return createProperty;
1348
1348
  }
1349
1349
 
1350
+ var arraySetLength;
1351
+ var hasRequiredArraySetLength;
1352
+
1353
+ function requireArraySetLength () {
1354
+ if (hasRequiredArraySetLength) return arraySetLength;
1355
+ hasRequiredArraySetLength = 1;
1356
+ var DESCRIPTORS = /*@__PURE__*/ requireDescriptors();
1357
+ var isArray = /*@__PURE__*/ requireIsArray$6();
1358
+
1359
+ var $TypeError = TypeError;
1360
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1361
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
1362
+
1363
+ // Safari < 13 does not throw an error in this case
1364
+ var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
1365
+ // makes no sense without proper strict mode support
1366
+ if (this !== undefined) return true;
1367
+ try {
1368
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
1369
+ Object.defineProperty([], 'length', { writable: false }).length = 1;
1370
+ } catch (error) {
1371
+ return error instanceof TypeError;
1372
+ }
1373
+ }();
1374
+
1375
+ arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
1376
+ if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
1377
+ throw new $TypeError('Cannot set read only .length');
1378
+ } return O.length = length;
1379
+ } : function (O, length) {
1380
+ return O.length = length;
1381
+ };
1382
+ return arraySetLength;
1383
+ }
1384
+
1350
1385
  var toStringTagSupport;
1351
1386
  var hasRequiredToStringTagSupport;
1352
1387
 
@@ -1357,7 +1392,7 @@
1357
1392
 
1358
1393
  var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1359
1394
  var test = {};
1360
-
1395
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
1361
1396
  test[TO_STRING_TAG] = 'z';
1362
1397
 
1363
1398
  toStringTagSupport = String(test) === '[object z]';
@@ -1491,7 +1526,7 @@
1491
1526
  function requireArraySpeciesConstructor () {
1492
1527
  if (hasRequiredArraySpeciesConstructor) return arraySpeciesConstructor;
1493
1528
  hasRequiredArraySpeciesConstructor = 1;
1494
- var isArray = /*@__PURE__*/ requireIsArray$3();
1529
+ var isArray = /*@__PURE__*/ requireIsArray$6();
1495
1530
  var isConstructor = /*@__PURE__*/ requireIsConstructor();
1496
1531
  var isObject = /*@__PURE__*/ requireIsObject();
1497
1532
  var wellKnownSymbol = /*@__PURE__*/ requireWellKnownSymbol();
@@ -1567,12 +1602,13 @@
1567
1602
  hasRequiredEs_array_concat = 1;
1568
1603
  var $ = /*@__PURE__*/ require_export();
1569
1604
  var fails = /*@__PURE__*/ requireFails();
1570
- var isArray = /*@__PURE__*/ requireIsArray$3();
1605
+ var isArray = /*@__PURE__*/ requireIsArray$6();
1571
1606
  var isObject = /*@__PURE__*/ requireIsObject();
1572
1607
  var toObject = /*@__PURE__*/ requireToObject();
1573
1608
  var lengthOfArrayLike = /*@__PURE__*/ requireLengthOfArrayLike();
1574
1609
  var doesNotExceedSafeInteger = /*@__PURE__*/ requireDoesNotExceedSafeInteger();
1575
1610
  var createProperty = /*@__PURE__*/ requireCreateProperty();
1611
+ var setArrayLength = /*@__PURE__*/ requireArraySetLength();
1576
1612
  var arraySpeciesCreate = /*@__PURE__*/ requireArraySpeciesCreate();
1577
1613
  var arrayMethodHasSpeciesSupport = /*@__PURE__*/ requireArrayMethodHasSpeciesSupport();
1578
1614
  var wellKnownSymbol = /*@__PURE__*/ requireWellKnownSymbol();
@@ -1618,7 +1654,7 @@
1618
1654
  createProperty(A, n++, E);
1619
1655
  }
1620
1656
  }
1621
- A.length = n;
1657
+ setArrayLength(A, n);
1622
1658
  return A;
1623
1659
  }
1624
1660
  });
@@ -2254,13 +2290,11 @@
2254
2290
  if (hasRequiredArrayIteration) return arrayIteration;
2255
2291
  hasRequiredArrayIteration = 1;
2256
2292
  var bind = /*@__PURE__*/ requireFunctionBindContext();
2257
- var uncurryThis = /*@__PURE__*/ requireFunctionUncurryThis();
2258
2293
  var IndexedObject = /*@__PURE__*/ requireIndexedObject();
2259
2294
  var toObject = /*@__PURE__*/ requireToObject();
2260
2295
  var lengthOfArrayLike = /*@__PURE__*/ requireLengthOfArrayLike();
2261
2296
  var arraySpeciesCreate = /*@__PURE__*/ requireArraySpeciesCreate();
2262
-
2263
- var push = uncurryThis([].push);
2297
+ var createProperty = /*@__PURE__*/ requireCreateProperty();
2264
2298
 
2265
2299
  // `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
2266
2300
  var createMethod = function (TYPE) {
@@ -2271,28 +2305,28 @@
2271
2305
  var IS_FIND_INDEX = TYPE === 6;
2272
2306
  var IS_FILTER_REJECT = TYPE === 7;
2273
2307
  var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
2274
- return function ($this, callbackfn, that, specificCreate) {
2308
+ return function ($this, callbackfn, that) {
2275
2309
  var O = toObject($this);
2276
2310
  var self = IndexedObject(O);
2277
2311
  var length = lengthOfArrayLike(self);
2278
2312
  var boundFunction = bind(callbackfn, that);
2279
2313
  var index = 0;
2280
- var create = specificCreate || arraySpeciesCreate;
2281
- var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
2314
+ var resIndex = 0;
2315
+ var target = IS_MAP ? arraySpeciesCreate($this, length) : IS_FILTER || IS_FILTER_REJECT ? arraySpeciesCreate($this, 0) : undefined;
2282
2316
  var value, result;
2283
2317
  for (;length > index; index++) if (NO_HOLES || index in self) {
2284
2318
  value = self[index];
2285
2319
  result = boundFunction(value, index, O);
2286
2320
  if (TYPE) {
2287
- if (IS_MAP) target[index] = result; // map
2321
+ if (IS_MAP) createProperty(target, index, result); // map
2288
2322
  else if (result) switch (TYPE) {
2289
- case 3: return true; // some
2290
- case 5: return value; // find
2291
- case 6: return index; // findIndex
2292
- case 2: push(target, value); // filter
2323
+ case 3: return true; // some
2324
+ case 5: return value; // find
2325
+ case 6: return index; // findIndex
2326
+ case 2: createProperty(target, resIndex++, value); // filter
2293
2327
  } else switch (TYPE) {
2294
- case 4: return false; // every
2295
- case 7: push(target, value); // filterReject
2328
+ case 4: return false; // every
2329
+ case 7: createProperty(target, resIndex++, value); // filterReject
2296
2330
  }
2297
2331
  }
2298
2332
  }
@@ -2405,7 +2439,7 @@
2405
2439
  nativeDefineProperty(O, P, Attributes);
2406
2440
  if (ObjectPrototypeDescriptor && O !== ObjectPrototype) {
2407
2441
  nativeDefineProperty(ObjectPrototype, P, ObjectPrototypeDescriptor);
2408
- }
2442
+ } return O;
2409
2443
  };
2410
2444
 
2411
2445
  var setSymbolDescriptor = DESCRIPTORS && fails(function () {
@@ -2431,7 +2465,8 @@
2431
2465
  var key = toPropertyKey(P);
2432
2466
  anObject(Attributes);
2433
2467
  if (hasOwn(AllSymbols, key)) {
2434
- if (!Attributes.enumerable) {
2468
+ // first definition - default non-enumerable; redefinition - preserve existing state
2469
+ if (!('enumerable' in Attributes) ? !hasOwn(O, key) || (hasOwn(O, HIDDEN) && O[HIDDEN][key]) : !Attributes.enumerable) {
2435
2470
  if (!hasOwn(O, HIDDEN)) nativeDefineProperty(O, HIDDEN, createPropertyDescriptor(1, nativeObjectCreate(null)));
2436
2471
  O[HIDDEN][key] = true;
2437
2472
  } else {
@@ -2673,42 +2708,104 @@
2673
2708
 
2674
2709
  var es_json_stringify = {};
2675
2710
 
2676
- var getJsonReplacerFunction;
2677
- var hasRequiredGetJsonReplacerFunction;
2711
+ var isRawJson;
2712
+ var hasRequiredIsRawJson;
2713
+
2714
+ function requireIsRawJson () {
2715
+ if (hasRequiredIsRawJson) return isRawJson;
2716
+ hasRequiredIsRawJson = 1;
2717
+ var isObject = /*@__PURE__*/ requireIsObject();
2718
+ var getInternalState = /*@__PURE__*/ requireInternalState().get;
2719
+
2720
+ isRawJson = function isRawJSON(O) {
2721
+ if (!isObject(O)) return false;
2722
+ var state = getInternalState(O);
2723
+ return !!state && state.type === 'RawJSON';
2724
+ };
2725
+ return isRawJson;
2726
+ }
2727
+
2728
+ var parseJsonString;
2729
+ var hasRequiredParseJsonString;
2678
2730
 
2679
- function requireGetJsonReplacerFunction () {
2680
- if (hasRequiredGetJsonReplacerFunction) return getJsonReplacerFunction;
2681
- hasRequiredGetJsonReplacerFunction = 1;
2731
+ function requireParseJsonString () {
2732
+ if (hasRequiredParseJsonString) return parseJsonString;
2733
+ hasRequiredParseJsonString = 1;
2682
2734
  var uncurryThis = /*@__PURE__*/ requireFunctionUncurryThis();
2683
- var isArray = /*@__PURE__*/ requireIsArray$3();
2684
- var isCallable = /*@__PURE__*/ requireIsCallable();
2685
- var classof = /*@__PURE__*/ requireClassofRaw();
2686
- var toString = /*@__PURE__*/ requireToString();
2735
+ var hasOwn = /*@__PURE__*/ requireHasOwnProperty();
2687
2736
 
2688
- var push = uncurryThis([].push);
2737
+ var $SyntaxError = SyntaxError;
2738
+ var $parseInt = parseInt;
2739
+ var fromCharCode = String.fromCharCode;
2740
+ var at = uncurryThis(''.charAt);
2741
+ var slice = uncurryThis(''.slice);
2742
+ var exec = uncurryThis(/./.exec);
2689
2743
 
2690
- getJsonReplacerFunction = function (replacer) {
2691
- if (isCallable(replacer)) return replacer;
2692
- if (!isArray(replacer)) return;
2693
- var rawLength = replacer.length;
2694
- var keys = [];
2695
- for (var i = 0; i < rawLength; i++) {
2696
- var element = replacer[i];
2697
- if (typeof element == 'string') push(keys, element);
2698
- else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element));
2699
- }
2700
- var keysLength = keys.length;
2701
- var root = true;
2702
- return function (key, value) {
2703
- if (root) {
2704
- root = false;
2705
- return value;
2744
+ var codePoints = {
2745
+ '\\"': '"',
2746
+ '\\\\': '\\',
2747
+ '\\/': '/',
2748
+ '\\b': '\b',
2749
+ '\\f': '\f',
2750
+ '\\n': '\n',
2751
+ '\\r': '\r',
2752
+ '\\t': '\t'
2753
+ };
2754
+
2755
+ var IS_4_HEX_DIGITS = /^[\da-f]{4}$/i;
2756
+ // eslint-disable-next-line regexp/no-control-character -- safe
2757
+ var IS_C0_CONTROL_CODE = /^[\u0000-\u001F]$/;
2758
+
2759
+ parseJsonString = function (source, i) {
2760
+ var unterminated = true;
2761
+ var value = '';
2762
+ while (i < source.length) {
2763
+ var chr = at(source, i);
2764
+ if (chr === '\\') {
2765
+ var twoChars = slice(source, i, i + 2);
2766
+ if (hasOwn(codePoints, twoChars)) {
2767
+ value += codePoints[twoChars];
2768
+ i += 2;
2769
+ } else if (twoChars === '\\u') {
2770
+ i += 2;
2771
+ var fourHexDigits = slice(source, i, i + 4);
2772
+ if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw new $SyntaxError('Bad Unicode escape at: ' + i);
2773
+ value += fromCharCode($parseInt(fourHexDigits, 16));
2774
+ i += 4;
2775
+ } else throw new $SyntaxError('Unknown escape sequence: "' + twoChars + '"');
2776
+ } else if (chr === '"') {
2777
+ unterminated = false;
2778
+ i++;
2779
+ break;
2780
+ } else {
2781
+ if (exec(IS_C0_CONTROL_CODE, chr)) throw new $SyntaxError('Bad control character in string literal at: ' + i);
2782
+ value += chr;
2783
+ i++;
2706
2784
  }
2707
- if (isArray(this)) return value;
2708
- for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
2709
- };
2785
+ }
2786
+ if (unterminated) throw new $SyntaxError('Unterminated string at: ' + i);
2787
+ return { value: value, end: i };
2710
2788
  };
2711
- return getJsonReplacerFunction;
2789
+ return parseJsonString;
2790
+ }
2791
+
2792
+ var nativeRawJson;
2793
+ var hasRequiredNativeRawJson;
2794
+
2795
+ function requireNativeRawJson () {
2796
+ if (hasRequiredNativeRawJson) return nativeRawJson;
2797
+ hasRequiredNativeRawJson = 1;
2798
+ /* eslint-disable es/no-json -- safe */
2799
+ var fails = /*@__PURE__*/ requireFails();
2800
+
2801
+ nativeRawJson = !fails(function () {
2802
+ var unsafeInt = '9007199254740993';
2803
+ // eslint-disable-next-line es/no-json-rawjson -- feature detection
2804
+ var raw = JSON.rawJSON(unsafeInt);
2805
+ // eslint-disable-next-line es/no-json-israwjson -- feature detection
2806
+ return !JSON.isRawJSON(raw) || JSON.stringify(raw) !== unsafeInt;
2807
+ });
2808
+ return nativeRawJson;
2712
2809
  }
2713
2810
 
2714
2811
  var hasRequiredEs_json_stringify;
@@ -2722,11 +2819,17 @@
2722
2819
  var call = /*@__PURE__*/ requireFunctionCall();
2723
2820
  var uncurryThis = /*@__PURE__*/ requireFunctionUncurryThis();
2724
2821
  var fails = /*@__PURE__*/ requireFails();
2822
+ var isArray = /*@__PURE__*/ requireIsArray$6();
2725
2823
  var isCallable = /*@__PURE__*/ requireIsCallable();
2824
+ var isRawJSON = /*@__PURE__*/ requireIsRawJson();
2726
2825
  var isSymbol = /*@__PURE__*/ requireIsSymbol();
2826
+ var classof = /*@__PURE__*/ requireClassofRaw();
2827
+ var toString = /*@__PURE__*/ requireToString();
2727
2828
  var arraySlice = /*@__PURE__*/ requireArraySlice();
2728
- var getReplacerFunction = /*@__PURE__*/ requireGetJsonReplacerFunction();
2829
+ var parseJSONString = /*@__PURE__*/ requireParseJsonString();
2830
+ var uid = /*@__PURE__*/ requireUid();
2729
2831
  var NATIVE_SYMBOL = /*@__PURE__*/ requireSymbolConstructorDetection();
2832
+ var NATIVE_RAW_JSON = /*@__PURE__*/ requireNativeRawJson();
2730
2833
 
2731
2834
  var $String = String;
2732
2835
  var $stringify = getBuiltIn('JSON', 'stringify');
@@ -2734,11 +2837,16 @@
2734
2837
  var charAt = uncurryThis(''.charAt);
2735
2838
  var charCodeAt = uncurryThis(''.charCodeAt);
2736
2839
  var replace = uncurryThis(''.replace);
2840
+ var slice = uncurryThis(''.slice);
2841
+ var push = uncurryThis([].push);
2737
2842
  var numberToString = uncurryThis(1.1.toString);
2738
2843
 
2739
- var tester = /[\uD800-\uDFFF]/g;
2740
- var low = /^[\uD800-\uDBFF]$/;
2741
- var hi = /^[\uDC00-\uDFFF]$/;
2844
+ var surrogates = /[\uD800-\uDFFF]/g;
2845
+ var leadingSurrogates = /^[\uD800-\uDBFF]$/;
2846
+ var trailingSurrogates = /^[\uDC00-\uDFFF]$/;
2847
+
2848
+ var MARK = uid();
2849
+ var MARK_LENGTH = MARK.length;
2742
2850
 
2743
2851
  var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
2744
2852
  var symbol = getBuiltIn('Symbol')('stringify detection');
@@ -2756,7 +2864,7 @@
2756
2864
  || $stringify('\uDEAD') !== '"\\udead"';
2757
2865
  });
2758
2866
 
2759
- var stringifyWithSymbolsFix = function (it, replacer) {
2867
+ var stringifyWithProperSymbolsConversion = WRONG_SYMBOLS_CONVERSION ? function (it, replacer) {
2760
2868
  var args = arraySlice(arguments);
2761
2869
  var $replacer = getReplacerFunction(replacer);
2762
2870
  if (!isCallable($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined
@@ -2766,28 +2874,79 @@
2766
2874
  if (!isSymbol(value)) return value;
2767
2875
  };
2768
2876
  return apply($stringify, null, args);
2769
- };
2877
+ } : $stringify;
2770
2878
 
2771
- var fixIllFormed = function (match, offset, string) {
2879
+ var fixIllFormedJSON = function (match, offset, string) {
2772
2880
  var prev = charAt(string, offset - 1);
2773
2881
  var next = charAt(string, offset + 1);
2774
- if ((exec(low, match) && !exec(hi, next)) || (exec(hi, match) && !exec(low, prev))) {
2882
+ if (
2883
+ (exec(leadingSurrogates, match) && !exec(trailingSurrogates, next)) ||
2884
+ (exec(trailingSurrogates, match) && !exec(leadingSurrogates, prev))
2885
+ ) {
2775
2886
  return '\\u' + numberToString(charCodeAt(match, 0), 16);
2776
2887
  } return match;
2777
2888
  };
2778
2889
 
2779
- if ($stringify) {
2780
- // `JSON.stringify` method
2781
- // https://tc39.es/ecma262/#sec-json.stringify
2782
- $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
2783
- // eslint-disable-next-line no-unused-vars -- required for `.length`
2784
- stringify: function stringify(it, replacer, space) {
2785
- var args = arraySlice(arguments);
2786
- var result = apply(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
2787
- return ILL_FORMED_UNICODE && typeof result == 'string' ? replace(result, tester, fixIllFormed) : result;
2890
+ var getReplacerFunction = function (replacer) {
2891
+ if (isCallable(replacer)) return replacer;
2892
+ if (!isArray(replacer)) return;
2893
+ var rawLength = replacer.length;
2894
+ var keys = [];
2895
+ for (var i = 0; i < rawLength; i++) {
2896
+ var element = replacer[i];
2897
+ if (typeof element == 'string') push(keys, element);
2898
+ else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') push(keys, toString(element));
2899
+ }
2900
+ var keysLength = keys.length;
2901
+ var root = true;
2902
+ return function (key, value) {
2903
+ if (root) {
2904
+ root = false;
2905
+ return value;
2906
+ }
2907
+ if (isArray(this)) return value;
2908
+ for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
2909
+ };
2910
+ };
2911
+
2912
+ // `JSON.stringify` method
2913
+ // https://tc39.es/ecma262/#sec-json.stringify
2914
+ // https://github.com/tc39/proposal-json-parse-with-source
2915
+ if ($stringify) $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE || !NATIVE_RAW_JSON }, {
2916
+ stringify: function stringify(text, replacer, space) {
2917
+ var replacerFunction = getReplacerFunction(replacer);
2918
+ var rawStrings = [];
2919
+
2920
+ var json = stringifyWithProperSymbolsConversion(text, function (key, value) {
2921
+ // some old implementations (like WebKit) could pass numbers as keys
2922
+ var v = isCallable(replacerFunction) ? call(replacerFunction, this, $String(key), value) : value;
2923
+ return !NATIVE_RAW_JSON && isRawJSON(v) ? MARK + (push(rawStrings, v.rawJSON) - 1) : v;
2924
+ }, space);
2925
+
2926
+ if (typeof json != 'string') return json;
2927
+
2928
+ if (ILL_FORMED_UNICODE) json = replace(json, surrogates, fixIllFormedJSON);
2929
+
2930
+ if (NATIVE_RAW_JSON) return json;
2931
+
2932
+ var result = '';
2933
+ var length = json.length;
2934
+
2935
+ for (var i = 0; i < length; i++) {
2936
+ var chr = charAt(json, i);
2937
+ if (chr === '"') {
2938
+ var end = parseJSONString(json, ++i).end - 1;
2939
+ var string = slice(json, i, end);
2940
+ result += slice(string, 0, MARK_LENGTH) === MARK
2941
+ ? rawStrings[slice(string, MARK_LENGTH)]
2942
+ : '"' + string + '"';
2943
+ i = end;
2944
+ } else result += chr;
2788
2945
  }
2789
- });
2790
- }
2946
+
2947
+ return result;
2948
+ }
2949
+ });
2791
2950
  return es_json_stringify;
2792
2951
  }
2793
2952
 
@@ -3152,7 +3311,7 @@
3152
3311
 
3153
3312
  var EXISTS = hasOwn(FunctionPrototype, 'name');
3154
3313
  // additional protection from minified / mangled / dropped function names
3155
- var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
3314
+ var PROPER = EXISTS && function something() { /* empty */ }.name === 'something';
3156
3315
  var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
3157
3316
 
3158
3317
  functionName = {
@@ -4748,10 +4907,11 @@
4748
4907
  function requireFlattenIntoArray () {
4749
4908
  if (hasRequiredFlattenIntoArray) return flattenIntoArray_1;
4750
4909
  hasRequiredFlattenIntoArray = 1;
4751
- var isArray = /*@__PURE__*/ requireIsArray$3();
4910
+ var isArray = /*@__PURE__*/ requireIsArray$6();
4752
4911
  var lengthOfArrayLike = /*@__PURE__*/ requireLengthOfArrayLike();
4753
4912
  var doesNotExceedSafeInteger = /*@__PURE__*/ requireDoesNotExceedSafeInteger();
4754
4913
  var bind = /*@__PURE__*/ requireFunctionBindContext();
4914
+ var createProperty = /*@__PURE__*/ requireCreateProperty();
4755
4915
 
4756
4916
  // `FlattenIntoArray` abstract operation
4757
4917
  // https://tc39.es/ecma262/#sec-flattenintoarray
@@ -4770,7 +4930,7 @@
4770
4930
  targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
4771
4931
  } else {
4772
4932
  doesNotExceedSafeInteger(targetIndex + 1);
4773
- target[targetIndex] = element;
4933
+ createProperty(target, targetIndex, element);
4774
4934
  }
4775
4935
 
4776
4936
  targetIndex++;
@@ -4805,7 +4965,7 @@
4805
4965
  var A;
4806
4966
  aCallable(callbackfn);
4807
4967
  A = arraySpeciesCreate(O, 0);
4808
- A.length = flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
4968
+ flattenIntoArray(A, O, O, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
4809
4969
  return A;
4810
4970
  }
4811
4971
  });
@@ -8574,11 +8734,11 @@
8574
8734
 
8575
8735
  var Object = path.Object;
8576
8736
 
8577
- var getOwnPropertyDescriptor = getOwnPropertyDescriptor$2.exports = function getOwnPropertyDescriptor(it, key) {
8737
+ var $getOwnPropertyDescriptor = getOwnPropertyDescriptor$2.exports = function getOwnPropertyDescriptor(it, key) {
8578
8738
  return Object.getOwnPropertyDescriptor(it, key);
8579
8739
  };
8580
8740
 
8581
- if (Object.getOwnPropertyDescriptor.sham) getOwnPropertyDescriptor.sham = true;
8741
+ if (Object.getOwnPropertyDescriptor.sham) $getOwnPropertyDescriptor.sham = true;
8582
8742
  return getOwnPropertyDescriptor$2.exports;
8583
8743
  }
8584
8744
 
@@ -8837,11 +8997,11 @@
8837
8997
 
8838
8998
  var Object = path.Object;
8839
8999
 
8840
- var defineProperties = defineProperties$2.exports = function defineProperties(T, D) {
9000
+ var $defineProperties = defineProperties$2.exports = function defineProperties(T, D) {
8841
9001
  return Object.defineProperties(T, D);
8842
9002
  };
8843
9003
 
8844
- if (Object.defineProperties.sham) defineProperties.sham = true;
9004
+ if (Object.defineProperties.sham) $defineProperties.sham = true;
8845
9005
  return defineProperties$2.exports;
8846
9006
  }
8847
9007
 
@@ -8891,7 +9051,7 @@
8891
9051
  if (hasRequiredEs_array_isArray) return es_array_isArray;
8892
9052
  hasRequiredEs_array_isArray = 1;
8893
9053
  var $ = /*@__PURE__*/ require_export();
8894
- var isArray = /*@__PURE__*/ requireIsArray$3();
9054
+ var isArray = /*@__PURE__*/ requireIsArray$6();
8895
9055
 
8896
9056
  // `Array.isArray` method
8897
9057
  // https://tc39.es/ecma262/#sec-array.isarray
@@ -8901,43 +9061,43 @@
8901
9061
  return es_array_isArray;
8902
9062
  }
8903
9063
 
8904
- var isArray$2;
8905
- var hasRequiredIsArray$2;
9064
+ var isArray$5;
9065
+ var hasRequiredIsArray$5;
8906
9066
 
8907
- function requireIsArray$2 () {
8908
- if (hasRequiredIsArray$2) return isArray$2;
8909
- hasRequiredIsArray$2 = 1;
9067
+ function requireIsArray$5 () {
9068
+ if (hasRequiredIsArray$5) return isArray$5;
9069
+ hasRequiredIsArray$5 = 1;
8910
9070
  requireEs_array_isArray();
8911
9071
  var path = /*@__PURE__*/ requirePath();
8912
9072
 
8913
- isArray$2 = path.Array.isArray;
8914
- return isArray$2;
9073
+ isArray$5 = path.Array.isArray;
9074
+ return isArray$5;
8915
9075
  }
8916
9076
 
8917
- var isArray$1;
8918
- var hasRequiredIsArray$1;
9077
+ var isArray$4;
9078
+ var hasRequiredIsArray$4;
8919
9079
 
8920
- function requireIsArray$1 () {
8921
- if (hasRequiredIsArray$1) return isArray$1;
8922
- hasRequiredIsArray$1 = 1;
8923
- var parent = /*@__PURE__*/ requireIsArray$2();
9080
+ function requireIsArray$4 () {
9081
+ if (hasRequiredIsArray$4) return isArray$4;
9082
+ hasRequiredIsArray$4 = 1;
9083
+ var parent = /*@__PURE__*/ requireIsArray$5();
8924
9084
 
8925
- isArray$1 = parent;
8926
- return isArray$1;
9085
+ isArray$4 = parent;
9086
+ return isArray$4;
8927
9087
  }
8928
9088
 
8929
- var isArray;
8930
- var hasRequiredIsArray;
9089
+ var isArray$3;
9090
+ var hasRequiredIsArray$3;
8931
9091
 
8932
- function requireIsArray () {
8933
- if (hasRequiredIsArray) return isArray;
8934
- hasRequiredIsArray = 1;
8935
- isArray = /*@__PURE__*/ requireIsArray$1();
8936
- return isArray;
9092
+ function requireIsArray$3 () {
9093
+ if (hasRequiredIsArray$3) return isArray$3;
9094
+ hasRequiredIsArray$3 = 1;
9095
+ isArray$3 = /*@__PURE__*/ requireIsArray$4();
9096
+ return isArray$3;
8937
9097
  }
8938
9098
 
8939
- var isArrayExports = requireIsArray();
8940
- var _Array$isArray = /*@__PURE__*/getDefaultExportFromCjs(isArrayExports);
9099
+ var isArrayExports$1 = requireIsArray$3();
9100
+ var _Array$isArray$1 = /*@__PURE__*/getDefaultExportFromCjs(isArrayExports$1);
8941
9101
 
8942
9102
  var es_map = {};
8943
9103
 
@@ -9070,6 +9230,7 @@
9070
9230
  var getOwnPropertyNames = getOwnPropertyNamesModule.f;
9071
9231
  var splice = uncurryThis([].splice);
9072
9232
  var test = {};
9233
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
9073
9234
  test[METADATA] = 1;
9074
9235
 
9075
9236
  // prevent exposing of metadata key
@@ -9120,12 +9281,12 @@
9120
9281
  return isArrayIteratorMethod;
9121
9282
  }
9122
9283
 
9123
- var getIteratorMethod;
9124
- var hasRequiredGetIteratorMethod;
9284
+ var getIteratorMethod$4;
9285
+ var hasRequiredGetIteratorMethod$5;
9125
9286
 
9126
- function requireGetIteratorMethod () {
9127
- if (hasRequiredGetIteratorMethod) return getIteratorMethod;
9128
- hasRequiredGetIteratorMethod = 1;
9287
+ function requireGetIteratorMethod$5 () {
9288
+ if (hasRequiredGetIteratorMethod$5) return getIteratorMethod$4;
9289
+ hasRequiredGetIteratorMethod$5 = 1;
9129
9290
  var classof = /*@__PURE__*/ requireClassof();
9130
9291
  var getMethod = /*@__PURE__*/ requireGetMethod();
9131
9292
  var isNullOrUndefined = /*@__PURE__*/ requireIsNullOrUndefined();
@@ -9134,12 +9295,12 @@
9134
9295
 
9135
9296
  var ITERATOR = wellKnownSymbol('iterator');
9136
9297
 
9137
- getIteratorMethod = function (it) {
9298
+ getIteratorMethod$4 = function (it) {
9138
9299
  if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
9139
9300
  || getMethod(it, '@@iterator')
9140
9301
  || Iterators[classof(it)];
9141
9302
  };
9142
- return getIteratorMethod;
9303
+ return getIteratorMethod$4;
9143
9304
  }
9144
9305
 
9145
9306
  var getIterator$5;
@@ -9152,7 +9313,7 @@
9152
9313
  var aCallable = /*@__PURE__*/ requireACallable();
9153
9314
  var anObject = /*@__PURE__*/ requireAnObject();
9154
9315
  var tryToString = /*@__PURE__*/ requireTryToString();
9155
- var getIteratorMethod = /*@__PURE__*/ requireGetIteratorMethod();
9316
+ var getIteratorMethod = /*@__PURE__*/ requireGetIteratorMethod$5();
9156
9317
 
9157
9318
  var $TypeError = TypeError;
9158
9319
 
@@ -9210,7 +9371,7 @@
9210
9371
  var lengthOfArrayLike = /*@__PURE__*/ requireLengthOfArrayLike();
9211
9372
  var isPrototypeOf = /*@__PURE__*/ requireObjectIsPrototypeOf();
9212
9373
  var getIterator = /*@__PURE__*/ requireGetIterator$6();
9213
- var getIteratorMethod = /*@__PURE__*/ requireGetIteratorMethod();
9374
+ var getIteratorMethod = /*@__PURE__*/ requireGetIteratorMethod$5();
9214
9375
  var iteratorClose = /*@__PURE__*/ requireIteratorClose();
9215
9376
 
9216
9377
  var $TypeError = TypeError;
@@ -9232,7 +9393,9 @@
9232
9393
  var iterator, iterFn, index, length, result, next, step;
9233
9394
 
9234
9395
  var stop = function (condition) {
9235
- if (iterator) iteratorClose(iterator, 'normal');
9396
+ var $iterator = iterator;
9397
+ iterator = undefined;
9398
+ if ($iterator) iteratorClose($iterator, 'normal');
9236
9399
  return new Result(true, condition);
9237
9400
  };
9238
9401
 
@@ -9262,10 +9425,13 @@
9262
9425
 
9263
9426
  next = IS_RECORD ? iterable.next : iterator.next;
9264
9427
  while (!(step = call(next, iterator)).done) {
9428
+ // `IteratorValue` errors should propagate without closing the iterator
9429
+ var value = step.value;
9265
9430
  try {
9266
- result = callFn(step.value);
9431
+ result = callFn(value);
9267
9432
  } catch (error) {
9268
- iteratorClose(iterator, 'throw', error);
9433
+ if (iterator) iteratorClose(iterator, 'throw', error);
9434
+ else throw error;
9269
9435
  }
9270
9436
  if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
9271
9437
  } return new Result(false);
@@ -9299,6 +9465,7 @@
9299
9465
  var $ = /*@__PURE__*/ require_export();
9300
9466
  var globalThis = /*@__PURE__*/ requireGlobalThis();
9301
9467
  var InternalMetadataModule = /*@__PURE__*/ requireInternalMetadata();
9468
+ var call = /*@__PURE__*/ requireFunctionCall();
9302
9469
  var fails = /*@__PURE__*/ requireFails();
9303
9470
  var createNonEnumerableProperty = /*@__PURE__*/ requireCreateNonEnumerableProperty();
9304
9471
  var iterate = /*@__PURE__*/ requireIterate();
@@ -9347,10 +9514,13 @@
9347
9514
  var IS_ADDER = KEY === 'add' || KEY === 'set';
9348
9515
  if (KEY in NativePrototype && !(IS_WEAK && KEY === 'clear')) {
9349
9516
  createNonEnumerableProperty(Prototype, KEY, function (a, b) {
9350
- var collection = getInternalState(this).collection;
9517
+ var that = this;
9518
+ var collection = getInternalState(that).collection;
9351
9519
  if (!IS_ADDER && IS_WEAK && !isObject(a)) return KEY === 'get' ? undefined : false;
9352
- var result = collection[KEY](a === 0 ? 0 : a, b);
9353
- return IS_ADDER ? this : result;
9520
+ var result = collection[KEY](KEY === 'forEach' ? function (value, key) {
9521
+ call(a, b, value, key, that);
9522
+ } : a === 0 ? 0 : a, b);
9523
+ return IS_ADDER ? that : result;
9354
9524
  });
9355
9525
  }
9356
9526
  });
@@ -9744,6 +9914,66 @@
9744
9914
  return es_map_groupBy;
9745
9915
  }
9746
9916
 
9917
+ var es_map_getOrInsert = {};
9918
+
9919
+ var hasRequiredEs_map_getOrInsert;
9920
+
9921
+ function requireEs_map_getOrInsert () {
9922
+ if (hasRequiredEs_map_getOrInsert) return es_map_getOrInsert;
9923
+ hasRequiredEs_map_getOrInsert = 1;
9924
+ var $ = /*@__PURE__*/ require_export();
9925
+ var MapHelpers = /*@__PURE__*/ requireMapHelpers();
9926
+ var IS_PURE = /*@__PURE__*/ requireIsPure();
9927
+
9928
+ var get = MapHelpers.get;
9929
+ var has = MapHelpers.has;
9930
+ var set = MapHelpers.set;
9931
+
9932
+ // `Map.prototype.getOrInsert` method
9933
+ // https://tc39.es/ecma262/#sec-map.prototype.getorinsert
9934
+ $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
9935
+ getOrInsert: function getOrInsert(key, value) {
9936
+ if (has(this, key)) return get(this, key);
9937
+ set(this, key, value);
9938
+ return value;
9939
+ }
9940
+ });
9941
+ return es_map_getOrInsert;
9942
+ }
9943
+
9944
+ var es_map_getOrInsertComputed = {};
9945
+
9946
+ var hasRequiredEs_map_getOrInsertComputed;
9947
+
9948
+ function requireEs_map_getOrInsertComputed () {
9949
+ if (hasRequiredEs_map_getOrInsertComputed) return es_map_getOrInsertComputed;
9950
+ hasRequiredEs_map_getOrInsertComputed = 1;
9951
+ var $ = /*@__PURE__*/ require_export();
9952
+ var aCallable = /*@__PURE__*/ requireACallable();
9953
+ var MapHelpers = /*@__PURE__*/ requireMapHelpers();
9954
+ var IS_PURE = /*@__PURE__*/ requireIsPure();
9955
+
9956
+ var get = MapHelpers.get;
9957
+ var has = MapHelpers.has;
9958
+ var set = MapHelpers.set;
9959
+
9960
+ // `Map.prototype.getOrInsertComputed` method
9961
+ // https://tc39.es/ecma262/#sec-map.prototype.getorinsertcomputed
9962
+ $({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
9963
+ getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
9964
+ var hasKey = has(this, key);
9965
+ aCallable(callbackfn);
9966
+ if (hasKey) return get(this, key);
9967
+ // CanonicalizeKeyedCollectionKey
9968
+ if (key === 0 && 1 / key === -Infinity) key = 0;
9969
+ var value = callbackfn(key);
9970
+ set(this, key, value);
9971
+ return value;
9972
+ }
9973
+ });
9974
+ return es_map_getOrInsertComputed;
9975
+ }
9976
+
9747
9977
  var map$2;
9748
9978
  var hasRequiredMap$2;
9749
9979
 
@@ -9753,6 +9983,8 @@
9753
9983
  requireEs_array_iterator();
9754
9984
  requireEs_map();
9755
9985
  requireEs_map_groupBy();
9986
+ requireEs_map_getOrInsert();
9987
+ requireEs_map_getOrInsertComputed();
9756
9988
  requireEs_string_iterator();
9757
9989
  var path = /*@__PURE__*/ requirePath();
9758
9990
 
@@ -10356,7 +10588,9 @@
10356
10588
  if (y === undefined) return -1;
10357
10589
  if (x === undefined) return 1;
10358
10590
  if (comparefn !== undefined) return +comparefn(x, y) || 0;
10359
- return toString(x) > toString(y) ? 1 : -1;
10591
+ var xString = toString(x);
10592
+ var yString = toString(y);
10593
+ return xString === yString ? 0 : xString > yString ? 1 : -1;
10360
10594
  };
10361
10595
  };
10362
10596
 
@@ -10526,6 +10760,7 @@
10526
10760
  var requireObjectCoercible = /*@__PURE__*/ requireRequireObjectCoercible();
10527
10761
 
10528
10762
  var $RangeError = RangeError;
10763
+ var floor = Math.floor;
10529
10764
 
10530
10765
  // `String.prototype.repeat` method implementation
10531
10766
  // https://tc39.es/ecma262/#sec-string.prototype.repeat
@@ -10534,7 +10769,7 @@
10534
10769
  var result = '';
10535
10770
  var n = toIntegerOrInfinity(count);
10536
10771
  if (n < 0 || n === Infinity) throw new $RangeError('Wrong number of repetitions');
10537
- for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;
10772
+ for (;n > 0; (n = floor(n / 2)) && (str += str)) if (n % 2) result += str;
10538
10773
  return result;
10539
10774
  };
10540
10775
  return stringRepeat;
@@ -10562,9 +10797,10 @@
10562
10797
  var S = toString(requireObjectCoercible($this));
10563
10798
  var intMaxLength = toLength(maxLength);
10564
10799
  var stringLength = S.length;
10800
+ if (intMaxLength <= stringLength) return S;
10565
10801
  var fillStr = fillString === undefined ? ' ' : toString(fillString);
10566
10802
  var fillLen, stringFiller;
10567
- if (intMaxLength <= stringLength || fillStr === '') return S;
10803
+ if (fillStr === '') return S;
10568
10804
  fillLen = intMaxLength - stringLength;
10569
10805
  stringFiller = repeat(fillStr, ceil(fillLen / fillStr.length));
10570
10806
  if (stringFiller.length > fillLen) stringFiller = stringSlice(stringFiller, 0, fillLen);
@@ -10846,543 +11082,726 @@
10846
11082
  return typeof value === "string" || typeof value === "number";
10847
11083
  }
10848
11084
 
10849
- var web_timers = {};
10850
-
10851
- var web_setInterval = {};
11085
+ /**
11086
+ * {@link DataSet} code that can be reused in {@link DataView} or other similar implementations of {@link DataInterface}.
11087
+ * @typeParam Item - Item type that may or may not have an id.
11088
+ * @typeParam IdProp - Name of the property that contains the id.
11089
+ */
11090
+ class DataSetPart {
11091
+ constructor() {
11092
+ _defineProperty(this, "_subscribers", {
11093
+ "*": [],
11094
+ add: [],
11095
+ remove: [],
11096
+ update: []
11097
+ });
11098
+ /**
11099
+ * @deprecated Use on instead (PS: DataView.subscribe === DataView.on).
11100
+ */
11101
+ _defineProperty(this, "subscribe", DataSetPart.prototype.on);
11102
+ /**
11103
+ * @deprecated Use off instead (PS: DataView.unsubscribe === DataView.off).
11104
+ */
11105
+ _defineProperty(this, "unsubscribe", DataSetPart.prototype.off);
11106
+ }
11107
+ /**
11108
+ * Trigger an event
11109
+ * @param event - Event name.
11110
+ * @param payload - Event payload.
11111
+ * @param senderId - Id of the sender.
11112
+ */
11113
+ _trigger(event, payload, senderId) {
11114
+ var _context;
11115
+ if (event === "*") {
11116
+ throw new Error("Cannot trigger event *");
11117
+ }
11118
+ _forEachInstanceProperty(_context = [...this._subscribers[event], ...this._subscribers["*"]]).call(_context, subscriber => {
11119
+ subscriber(event, payload, senderId != null ? senderId : null);
11120
+ });
11121
+ }
11122
+ /**
11123
+ * Subscribe to an event, add an event listener.
11124
+ * @remarks Non-function callbacks are ignored.
11125
+ * @param event - Event name.
11126
+ * @param callback - Callback method.
11127
+ */
11128
+ on(event, callback) {
11129
+ if (typeof callback === "function") {
11130
+ this._subscribers[event].push(callback);
11131
+ }
11132
+ // @TODO: Maybe throw for invalid callbacks?
11133
+ }
11134
+ /**
11135
+ * Unsubscribe from an event, remove an event listener.
11136
+ * @remarks If the same callback was subscribed more than once **all** occurences will be removed.
11137
+ * @param event - Event name.
11138
+ * @param callback - Callback method.
11139
+ */
11140
+ off(event, callback) {
11141
+ var _context2;
11142
+ this._subscribers[event] = _filterInstanceProperty(_context2 = this._subscribers[event]).call(_context2, subscriber => subscriber !== callback);
11143
+ }
11144
+ }
10852
11145
 
10853
- var validateArgumentsLength;
10854
- var hasRequiredValidateArgumentsLength;
11146
+ var isArray$2;
11147
+ var hasRequiredIsArray$2;
10855
11148
 
10856
- function requireValidateArgumentsLength () {
10857
- if (hasRequiredValidateArgumentsLength) return validateArgumentsLength;
10858
- hasRequiredValidateArgumentsLength = 1;
10859
- var $TypeError = TypeError;
11149
+ function requireIsArray$2 () {
11150
+ if (hasRequiredIsArray$2) return isArray$2;
11151
+ hasRequiredIsArray$2 = 1;
11152
+ var parent = /*@__PURE__*/ requireIsArray$4();
10860
11153
 
10861
- validateArgumentsLength = function (passed, required) {
10862
- if (passed < required) throw new $TypeError('Not enough arguments');
10863
- return passed;
10864
- };
10865
- return validateArgumentsLength;
11154
+ isArray$2 = parent;
11155
+ return isArray$2;
10866
11156
  }
10867
11157
 
10868
- var schedulersFix;
10869
- var hasRequiredSchedulersFix;
10870
-
10871
- function requireSchedulersFix () {
10872
- if (hasRequiredSchedulersFix) return schedulersFix;
10873
- hasRequiredSchedulersFix = 1;
10874
- var globalThis = /*@__PURE__*/ requireGlobalThis();
10875
- var apply = /*@__PURE__*/ requireFunctionApply();
10876
- var isCallable = /*@__PURE__*/ requireIsCallable();
10877
- var ENVIRONMENT = /*@__PURE__*/ requireEnvironment();
10878
- var USER_AGENT = /*@__PURE__*/ requireEnvironmentUserAgent();
10879
- var arraySlice = /*@__PURE__*/ requireArraySlice();
10880
- var validateArgumentsLength = /*@__PURE__*/ requireValidateArgumentsLength();
11158
+ var isArray$1;
11159
+ var hasRequiredIsArray$1;
10881
11160
 
10882
- var Function = globalThis.Function;
10883
- // dirty IE9- and Bun 0.3.0- checks
10884
- var WRAP = /MSIE .\./.test(USER_AGENT) || ENVIRONMENT === 'BUN' && (function () {
10885
- var version = globalThis.Bun.version.split('.');
10886
- return version.length < 3 || version[0] === '0' && (version[1] < 3 || version[1] === '3' && version[2] === '0');
10887
- })();
11161
+ function requireIsArray$1 () {
11162
+ if (hasRequiredIsArray$1) return isArray$1;
11163
+ hasRequiredIsArray$1 = 1;
11164
+ var parent = /*@__PURE__*/ requireIsArray$2();
10888
11165
 
10889
- // IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix
10890
- // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
10891
- // https://github.com/oven-sh/bun/issues/1633
10892
- schedulersFix = function (scheduler, hasTimeArg) {
10893
- var firstParamIndex = hasTimeArg ? 2 : 1;
10894
- return WRAP ? function (handler, timeout /* , ...arguments */) {
10895
- var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;
10896
- var fn = isCallable(handler) ? handler : Function(handler);
10897
- var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];
10898
- var callback = boundArgs ? function () {
10899
- apply(fn, this, params);
10900
- } : fn;
10901
- return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);
10902
- } : scheduler;
10903
- };
10904
- return schedulersFix;
11166
+ isArray$1 = parent;
11167
+ return isArray$1;
10905
11168
  }
10906
11169
 
10907
- var hasRequiredWeb_setInterval;
11170
+ var isArray;
11171
+ var hasRequiredIsArray;
10908
11172
 
10909
- function requireWeb_setInterval () {
10910
- if (hasRequiredWeb_setInterval) return web_setInterval;
10911
- hasRequiredWeb_setInterval = 1;
10912
- var $ = /*@__PURE__*/ require_export();
10913
- var globalThis = /*@__PURE__*/ requireGlobalThis();
10914
- var schedulersFix = /*@__PURE__*/ requireSchedulersFix();
11173
+ function requireIsArray () {
11174
+ if (hasRequiredIsArray) return isArray;
11175
+ hasRequiredIsArray = 1;
11176
+ isArray = /*@__PURE__*/ requireIsArray$1();
11177
+ return isArray;
11178
+ }
10915
11179
 
10916
- var setInterval = schedulersFix(globalThis.setInterval, true);
11180
+ var isArrayExports = /*@__PURE__*/ requireIsArray();
11181
+ var _Array$isArray = /*@__PURE__*/getDefaultExportFromCjs(isArrayExports);
10917
11182
 
10918
- // Bun / IE9- setInterval additional parameters fix
10919
- // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
10920
- $({ global: true, bind: true, forced: globalThis.setInterval !== setInterval }, {
10921
- setInterval: setInterval
10922
- });
10923
- return web_setInterval;
11183
+ function _arrayWithHoles(r) {
11184
+ if (_Array$isArray(r)) return r;
10924
11185
  }
10925
11186
 
10926
- var web_setTimeout = {};
11187
+ var getIteratorMethod_1;
11188
+ var hasRequiredGetIteratorMethod$4;
10927
11189
 
10928
- var hasRequiredWeb_setTimeout;
11190
+ function requireGetIteratorMethod$4 () {
11191
+ if (hasRequiredGetIteratorMethod$4) return getIteratorMethod_1;
11192
+ hasRequiredGetIteratorMethod$4 = 1;
11193
+ requireEs_array_iterator();
11194
+ requireEs_string_iterator();
11195
+ var getIteratorMethod = /*@__PURE__*/ requireGetIteratorMethod$5();
10929
11196
 
10930
- function requireWeb_setTimeout () {
10931
- if (hasRequiredWeb_setTimeout) return web_setTimeout;
10932
- hasRequiredWeb_setTimeout = 1;
10933
- var $ = /*@__PURE__*/ require_export();
10934
- var globalThis = /*@__PURE__*/ requireGlobalThis();
10935
- var schedulersFix = /*@__PURE__*/ requireSchedulersFix();
11197
+ getIteratorMethod_1 = getIteratorMethod;
11198
+ return getIteratorMethod_1;
11199
+ }
10936
11200
 
10937
- var setTimeout = schedulersFix(globalThis.setTimeout, true);
11201
+ var getIteratorMethod$3;
11202
+ var hasRequiredGetIteratorMethod$3;
10938
11203
 
10939
- // Bun / IE9- setTimeout additional parameters fix
10940
- // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
10941
- $({ global: true, bind: true, forced: globalThis.setTimeout !== setTimeout }, {
10942
- setTimeout: setTimeout
10943
- });
10944
- return web_setTimeout;
11204
+ function requireGetIteratorMethod$3 () {
11205
+ if (hasRequiredGetIteratorMethod$3) return getIteratorMethod$3;
11206
+ hasRequiredGetIteratorMethod$3 = 1;
11207
+ var parent = /*@__PURE__*/ requireGetIteratorMethod$4();
11208
+ requireWeb_domCollections_iterator();
11209
+
11210
+ getIteratorMethod$3 = parent;
11211
+ return getIteratorMethod$3;
10945
11212
  }
10946
11213
 
10947
- var hasRequiredWeb_timers;
11214
+ var getIteratorMethod$2;
11215
+ var hasRequiredGetIteratorMethod$2;
10948
11216
 
10949
- function requireWeb_timers () {
10950
- if (hasRequiredWeb_timers) return web_timers;
10951
- hasRequiredWeb_timers = 1;
10952
- // TODO: Remove this module from `core-js@4` since it's split to modules listed below
10953
- requireWeb_setInterval();
10954
- requireWeb_setTimeout();
10955
- return web_timers;
11217
+ function requireGetIteratorMethod$2 () {
11218
+ if (hasRequiredGetIteratorMethod$2) return getIteratorMethod$2;
11219
+ hasRequiredGetIteratorMethod$2 = 1;
11220
+ var parent = /*@__PURE__*/ requireGetIteratorMethod$3();
11221
+
11222
+ getIteratorMethod$2 = parent;
11223
+ return getIteratorMethod$2;
10956
11224
  }
10957
11225
 
10958
- var setTimeout$2;
10959
- var hasRequiredSetTimeout$1;
11226
+ var getIteratorMethod$1;
11227
+ var hasRequiredGetIteratorMethod$1;
10960
11228
 
10961
- function requireSetTimeout$1 () {
10962
- if (hasRequiredSetTimeout$1) return setTimeout$2;
10963
- hasRequiredSetTimeout$1 = 1;
10964
- requireWeb_timers();
10965
- var path = /*@__PURE__*/ requirePath();
11229
+ function requireGetIteratorMethod$1 () {
11230
+ if (hasRequiredGetIteratorMethod$1) return getIteratorMethod$1;
11231
+ hasRequiredGetIteratorMethod$1 = 1;
11232
+ var parent = /*@__PURE__*/ requireGetIteratorMethod$2();
10966
11233
 
10967
- setTimeout$2 = path.setTimeout;
10968
- return setTimeout$2;
11234
+ getIteratorMethod$1 = parent;
11235
+ return getIteratorMethod$1;
10969
11236
  }
10970
11237
 
10971
- var setTimeout$1;
10972
- var hasRequiredSetTimeout;
11238
+ var getIteratorMethod;
11239
+ var hasRequiredGetIteratorMethod;
10973
11240
 
10974
- function requireSetTimeout () {
10975
- if (hasRequiredSetTimeout) return setTimeout$1;
10976
- hasRequiredSetTimeout = 1;
10977
- setTimeout$1 = /*@__PURE__*/ requireSetTimeout$1();
10978
- return setTimeout$1;
11241
+ function requireGetIteratorMethod () {
11242
+ if (hasRequiredGetIteratorMethod) return getIteratorMethod;
11243
+ hasRequiredGetIteratorMethod = 1;
11244
+ getIteratorMethod = /*@__PURE__*/ requireGetIteratorMethod$1();
11245
+ return getIteratorMethod;
10979
11246
  }
10980
11247
 
10981
- var setTimeoutExports = requireSetTimeout();
10982
- var _setTimeout = /*@__PURE__*/getDefaultExportFromCjs(setTimeoutExports);
11248
+ var getIteratorMethodExports = /*@__PURE__*/ requireGetIteratorMethod();
11249
+ var _getIteratorMethod = /*@__PURE__*/getDefaultExportFromCjs(getIteratorMethodExports);
10983
11250
 
10984
- var es_array_splice = {};
11251
+ var es_array_push = {};
10985
11252
 
10986
- var arraySetLength;
10987
- var hasRequiredArraySetLength;
11253
+ var hasRequiredEs_array_push;
10988
11254
 
10989
- function requireArraySetLength () {
10990
- if (hasRequiredArraySetLength) return arraySetLength;
10991
- hasRequiredArraySetLength = 1;
10992
- var DESCRIPTORS = /*@__PURE__*/ requireDescriptors();
10993
- var isArray = /*@__PURE__*/ requireIsArray$3();
11255
+ function requireEs_array_push () {
11256
+ if (hasRequiredEs_array_push) return es_array_push;
11257
+ hasRequiredEs_array_push = 1;
11258
+ var $ = /*@__PURE__*/ require_export();
11259
+ var toObject = /*@__PURE__*/ requireToObject();
11260
+ var lengthOfArrayLike = /*@__PURE__*/ requireLengthOfArrayLike();
11261
+ var setArrayLength = /*@__PURE__*/ requireArraySetLength();
11262
+ var doesNotExceedSafeInteger = /*@__PURE__*/ requireDoesNotExceedSafeInteger();
11263
+ var fails = /*@__PURE__*/ requireFails();
10994
11264
 
10995
- var $TypeError = TypeError;
10996
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
10997
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
11265
+ var INCORRECT_TO_LENGTH = fails(function () {
11266
+ return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
11267
+ });
10998
11268
 
10999
- // Safari < 13 does not throw an error in this case
11000
- var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
11001
- // makes no sense without proper strict mode support
11002
- if (this !== undefined) return true;
11269
+ // V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError
11270
+ // https://bugs.chromium.org/p/v8/issues/detail?id=12681
11271
+ var properErrorOnNonWritableLength = function () {
11003
11272
  try {
11004
11273
  // eslint-disable-next-line es/no-object-defineproperty -- safe
11005
- Object.defineProperty([], 'length', { writable: false }).length = 1;
11274
+ Object.defineProperty([], 'length', { writable: false }).push();
11006
11275
  } catch (error) {
11007
11276
  return error instanceof TypeError;
11008
11277
  }
11009
- }();
11010
-
11011
- arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
11012
- if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
11013
- throw new $TypeError('Cannot set read only .length');
11014
- } return O.length = length;
11015
- } : function (O, length) {
11016
- return O.length = length;
11017
11278
  };
11018
- return arraySetLength;
11019
- }
11020
-
11021
- var hasRequiredEs_array_splice;
11022
-
11023
- function requireEs_array_splice () {
11024
- if (hasRequiredEs_array_splice) return es_array_splice;
11025
- hasRequiredEs_array_splice = 1;
11026
- var $ = /*@__PURE__*/ require_export();
11027
- var toObject = /*@__PURE__*/ requireToObject();
11028
- var toAbsoluteIndex = /*@__PURE__*/ requireToAbsoluteIndex();
11029
- var toIntegerOrInfinity = /*@__PURE__*/ requireToIntegerOrInfinity();
11030
- var lengthOfArrayLike = /*@__PURE__*/ requireLengthOfArrayLike();
11031
- var setArrayLength = /*@__PURE__*/ requireArraySetLength();
11032
- var doesNotExceedSafeInteger = /*@__PURE__*/ requireDoesNotExceedSafeInteger();
11033
- var arraySpeciesCreate = /*@__PURE__*/ requireArraySpeciesCreate();
11034
- var createProperty = /*@__PURE__*/ requireCreateProperty();
11035
- var deletePropertyOrThrow = /*@__PURE__*/ requireDeletePropertyOrThrow();
11036
- var arrayMethodHasSpeciesSupport = /*@__PURE__*/ requireArrayMethodHasSpeciesSupport();
11037
-
11038
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
11039
11279
 
11040
- var max = Math.max;
11041
- var min = Math.min;
11280
+ var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
11042
11281
 
11043
- // `Array.prototype.splice` method
11044
- // https://tc39.es/ecma262/#sec-array.prototype.splice
11045
- // with adding support of @@species
11046
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
11047
- splice: function splice(start, deleteCount /* , ...items */) {
11282
+ // `Array.prototype.push` method
11283
+ // https://tc39.es/ecma262/#sec-array.prototype.push
11284
+ $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
11285
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
11286
+ push: function push(item) {
11048
11287
  var O = toObject(this);
11049
11288
  var len = lengthOfArrayLike(O);
11050
- var actualStart = toAbsoluteIndex(start, len);
11051
- var argumentsLength = arguments.length;
11052
- var insertCount, actualDeleteCount, A, k, from, to;
11053
- if (argumentsLength === 0) {
11054
- insertCount = actualDeleteCount = 0;
11055
- } else if (argumentsLength === 1) {
11056
- insertCount = 0;
11057
- actualDeleteCount = len - actualStart;
11058
- } else {
11059
- insertCount = argumentsLength - 2;
11060
- actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
11061
- }
11062
- doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
11063
- A = arraySpeciesCreate(O, actualDeleteCount);
11064
- for (k = 0; k < actualDeleteCount; k++) {
11065
- from = actualStart + k;
11066
- if (from in O) createProperty(A, k, O[from]);
11067
- }
11068
- A.length = actualDeleteCount;
11069
- if (insertCount < actualDeleteCount) {
11070
- for (k = actualStart; k < len - actualDeleteCount; k++) {
11071
- from = k + actualDeleteCount;
11072
- to = k + insertCount;
11073
- if (from in O) O[to] = O[from];
11074
- else deletePropertyOrThrow(O, to);
11075
- }
11076
- for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
11077
- } else if (insertCount > actualDeleteCount) {
11078
- for (k = len - actualDeleteCount; k > actualStart; k--) {
11079
- from = k + actualDeleteCount - 1;
11080
- to = k + insertCount - 1;
11081
- if (from in O) O[to] = O[from];
11082
- else deletePropertyOrThrow(O, to);
11083
- }
11084
- }
11085
- for (k = 0; k < insertCount; k++) {
11086
- O[k + actualStart] = arguments[k + 2];
11289
+ var argCount = arguments.length;
11290
+ doesNotExceedSafeInteger(len + argCount);
11291
+ for (var i = 0; i < argCount; i++) {
11292
+ O[len] = arguments[i];
11293
+ len++;
11087
11294
  }
11088
- setArrayLength(O, len - actualDeleteCount + insertCount);
11089
- return A;
11295
+ setArrayLength(O, len);
11296
+ return len;
11090
11297
  }
11091
11298
  });
11092
- return es_array_splice;
11299
+ return es_array_push;
11093
11300
  }
11094
11301
 
11095
- var splice$3;
11096
- var hasRequiredSplice$3;
11302
+ var push$5;
11303
+ var hasRequiredPush$5;
11097
11304
 
11098
- function requireSplice$3 () {
11099
- if (hasRequiredSplice$3) return splice$3;
11100
- hasRequiredSplice$3 = 1;
11101
- requireEs_array_splice();
11305
+ function requirePush$5 () {
11306
+ if (hasRequiredPush$5) return push$5;
11307
+ hasRequiredPush$5 = 1;
11308
+ requireEs_array_push();
11102
11309
  var getBuiltInPrototypeMethod = /*@__PURE__*/ requireGetBuiltInPrototypeMethod();
11103
11310
 
11104
- splice$3 = getBuiltInPrototypeMethod('Array', 'splice');
11105
- return splice$3;
11311
+ push$5 = getBuiltInPrototypeMethod('Array', 'push');
11312
+ return push$5;
11106
11313
  }
11107
11314
 
11108
- var splice$2;
11109
- var hasRequiredSplice$2;
11315
+ var push$4;
11316
+ var hasRequiredPush$4;
11110
11317
 
11111
- function requireSplice$2 () {
11112
- if (hasRequiredSplice$2) return splice$2;
11113
- hasRequiredSplice$2 = 1;
11318
+ function requirePush$4 () {
11319
+ if (hasRequiredPush$4) return push$4;
11320
+ hasRequiredPush$4 = 1;
11114
11321
  var isPrototypeOf = /*@__PURE__*/ requireObjectIsPrototypeOf();
11115
- var method = /*@__PURE__*/ requireSplice$3();
11322
+ var method = /*@__PURE__*/ requirePush$5();
11116
11323
 
11117
11324
  var ArrayPrototype = Array.prototype;
11118
11325
 
11119
- splice$2 = function (it) {
11120
- var own = it.splice;
11121
- return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.splice) ? method : own;
11326
+ push$4 = function (it) {
11327
+ var own = it.push;
11328
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.push) ? method : own;
11122
11329
  };
11123
- return splice$2;
11330
+ return push$4;
11124
11331
  }
11125
11332
 
11126
- var splice$1;
11127
- var hasRequiredSplice$1;
11333
+ var push$3;
11334
+ var hasRequiredPush$3;
11128
11335
 
11129
- function requireSplice$1 () {
11130
- if (hasRequiredSplice$1) return splice$1;
11131
- hasRequiredSplice$1 = 1;
11132
- var parent = /*@__PURE__*/ requireSplice$2();
11336
+ function requirePush$3 () {
11337
+ if (hasRequiredPush$3) return push$3;
11338
+ hasRequiredPush$3 = 1;
11339
+ var parent = /*@__PURE__*/ requirePush$4();
11133
11340
 
11134
- splice$1 = parent;
11135
- return splice$1;
11341
+ push$3 = parent;
11342
+ return push$3;
11136
11343
  }
11137
11344
 
11138
- var splice;
11139
- var hasRequiredSplice;
11345
+ var push$2;
11346
+ var hasRequiredPush$2;
11140
11347
 
11141
- function requireSplice () {
11142
- if (hasRequiredSplice) return splice;
11143
- hasRequiredSplice = 1;
11144
- splice = /*@__PURE__*/ requireSplice$1();
11145
- return splice;
11348
+ function requirePush$2 () {
11349
+ if (hasRequiredPush$2) return push$2;
11350
+ hasRequiredPush$2 = 1;
11351
+ var parent = /*@__PURE__*/ requirePush$3();
11352
+
11353
+ push$2 = parent;
11354
+ return push$2;
11146
11355
  }
11147
11356
 
11148
- var spliceExports = requireSplice();
11149
- var _spliceInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(spliceExports);
11357
+ var push$1;
11358
+ var hasRequiredPush$1;
11150
11359
 
11151
- /**
11152
- * A queue.
11153
- * @typeParam T - The type of method names to be replaced by queued versions.
11154
- */
11155
- class Queue {
11156
- /**
11157
- * Construct a new Queue.
11158
- * @param options - Queue configuration.
11159
- */
11160
- constructor(options) {
11161
- /** Delay in milliseconds. If defined the queue will be periodically flushed. */
11162
- /** Maximum number of entries in the queue before it will be flushed. */
11163
- _defineProperty(this, "_queue", []);
11164
- _defineProperty(this, "_timeout", null);
11165
- _defineProperty(this, "_extended", null);
11166
- // options
11167
- this.delay = null;
11168
- this.max = Infinity;
11169
- this.setOptions(options);
11170
- }
11171
- /**
11172
- * Update the configuration of the queue.
11173
- * @param options - Queue configuration.
11174
- */
11175
- setOptions(options) {
11176
- if (options && typeof options.delay !== "undefined") {
11177
- this.delay = options.delay;
11178
- }
11179
- if (options && typeof options.max !== "undefined") {
11180
- this.max = options.max;
11181
- }
11182
- this._flushIfNeeded();
11183
- }
11184
- /**
11185
- * Extend an object with queuing functionality.
11186
- * The object will be extended with a function flush, and the methods provided in options.replace will be replaced with queued ones.
11187
- * @param object - The object to be extended.
11188
- * @param options - Additional options.
11189
- * @returns The created queue.
11190
- */
11191
- static extend(object, options) {
11192
- const queue = new Queue(options);
11193
- if (object.flush !== undefined) {
11194
- throw new Error("Target object already has a property flush");
11195
- }
11196
- object.flush = () => {
11197
- queue.flush();
11198
- };
11199
- const methods = [{
11200
- name: "flush",
11201
- original: undefined
11202
- }];
11203
- if (options && options.replace) {
11204
- for (let i = 0; i < options.replace.length; i++) {
11205
- const name = options.replace[i];
11206
- methods.push({
11207
- name: name,
11208
- // @TODO: better solution?
11209
- original: object[name]
11210
- });
11211
- // @TODO: better solution?
11212
- queue.replace(object, name);
11213
- }
11214
- }
11215
- queue._extended = {
11216
- object: object,
11217
- methods: methods
11218
- };
11219
- return queue;
11220
- }
11221
- /**
11222
- * Destroy the queue. The queue will first flush all queued actions, and in case it has extended an object, will restore the original object.
11223
- */
11224
- destroy() {
11225
- this.flush();
11226
- if (this._extended) {
11227
- const object = this._extended.object;
11228
- const methods = this._extended.methods;
11229
- for (let i = 0; i < methods.length; i++) {
11230
- const method = methods[i];
11231
- if (method.original) {
11232
- // @TODO: better solution?
11233
- object[method.name] = method.original;
11234
- } else {
11235
- // @TODO: better solution?
11236
- delete object[method.name];
11237
- }
11238
- }
11239
- this._extended = null;
11240
- }
11241
- }
11242
- /**
11243
- * Replace a method on an object with a queued version.
11244
- * @param object - Object having the method.
11245
- * @param method - The method name.
11246
- */
11247
- replace(object, method) {
11248
- /* eslint-disable-next-line @typescript-eslint/no-this-alias -- Function this is necessary in the function bellow, so class this has to be saved into a variable here. */
11249
- const me = this;
11250
- const original = object[method];
11251
- if (!original) {
11252
- throw new Error("Method " + method + " undefined");
11253
- }
11254
- object[method] = function () {
11255
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11256
- args[_key] = arguments[_key];
11257
- }
11258
- // add this call to the queue
11259
- me.queue({
11260
- args: args,
11261
- fn: original,
11262
- context: this
11263
- });
11264
- };
11265
- }
11266
- /**
11267
- * Queue a call.
11268
- * @param entry - The function or entry to be queued.
11269
- */
11270
- queue(entry) {
11271
- if (typeof entry === "function") {
11272
- this._queue.push({
11273
- fn: entry
11274
- });
11275
- } else {
11276
- this._queue.push(entry);
11277
- }
11278
- this._flushIfNeeded();
11279
- }
11280
- /**
11281
- * Check whether the queue needs to be flushed.
11282
- */
11283
- _flushIfNeeded() {
11284
- // flush when the maximum is exceeded.
11285
- if (this._queue.length > this.max) {
11286
- this.flush();
11287
- }
11288
- // flush after a period of inactivity when a delay is configured
11289
- if (this._timeout != null) {
11290
- clearTimeout(this._timeout);
11291
- this._timeout = null;
11292
- }
11293
- if (this.queue.length > 0 && typeof this.delay === "number") {
11294
- this._timeout = _setTimeout(() => {
11295
- this.flush();
11296
- }, this.delay);
11297
- }
11298
- }
11299
- /**
11300
- * Flush all queued calls
11301
- */
11302
- flush() {
11303
- var _context, _context2;
11304
- _forEachInstanceProperty(_context = _spliceInstanceProperty(_context2 = this._queue).call(_context2, 0)).call(_context, entry => {
11305
- entry.fn.apply(entry.context || entry.fn, entry.args || []);
11306
- });
11307
- }
11360
+ function requirePush$1 () {
11361
+ if (hasRequiredPush$1) return push$1;
11362
+ hasRequiredPush$1 = 1;
11363
+ var parent = /*@__PURE__*/ requirePush$2();
11364
+
11365
+ push$1 = parent;
11366
+ return push$1;
11308
11367
  }
11309
11368
 
11310
- /**
11311
- * {@link DataSet} code that can be reused in {@link DataView} or other similar implementations of {@link DataInterface}.
11312
- * @typeParam Item - Item type that may or may not have an id.
11313
- * @typeParam IdProp - Name of the property that contains the id.
11314
- */
11315
- class DataSetPart {
11316
- constructor() {
11317
- _defineProperty(this, "_subscribers", {
11318
- "*": [],
11319
- add: [],
11320
- remove: [],
11321
- update: []
11322
- });
11323
- /**
11324
- * @deprecated Use on instead (PS: DataView.subscribe === DataView.on).
11325
- */
11326
- _defineProperty(this, "subscribe", DataSetPart.prototype.on);
11327
- /**
11328
- * @deprecated Use off instead (PS: DataView.unsubscribe === DataView.off).
11329
- */
11330
- _defineProperty(this, "unsubscribe", DataSetPart.prototype.off);
11331
- }
11332
- /**
11333
- * Trigger an event
11334
- * @param event - Event name.
11335
- * @param payload - Event payload.
11336
- * @param senderId - Id of the sender.
11337
- */
11338
- _trigger(event, payload, senderId) {
11339
- var _context;
11340
- if (event === "*") {
11341
- throw new Error("Cannot trigger event *");
11342
- }
11343
- _forEachInstanceProperty(_context = [...this._subscribers[event], ...this._subscribers["*"]]).call(_context, subscriber => {
11344
- subscriber(event, payload, senderId != null ? senderId : null);
11345
- });
11346
- }
11347
- /**
11348
- * Subscribe to an event, add an event listener.
11349
- * @remarks Non-function callbacks are ignored.
11350
- * @param event - Event name.
11351
- * @param callback - Callback method.
11352
- */
11353
- on(event, callback) {
11354
- if (typeof callback === "function") {
11355
- this._subscribers[event].push(callback);
11369
+ var push;
11370
+ var hasRequiredPush;
11371
+
11372
+ function requirePush () {
11373
+ if (hasRequiredPush) return push;
11374
+ hasRequiredPush = 1;
11375
+ push = /*@__PURE__*/ requirePush$1();
11376
+ return push;
11377
+ }
11378
+
11379
+ var pushExports = /*@__PURE__*/ requirePush();
11380
+ var _pushInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(pushExports);
11381
+
11382
+ function _iterableToArrayLimit(r, l) {
11383
+ var t = null == r ? null : "undefined" != typeof _Symbol && _getIteratorMethod(r) || r["@@iterator"];
11384
+ if (null != t) {
11385
+ var e,
11386
+ n,
11387
+ i,
11388
+ u,
11389
+ a = [],
11390
+ f = true,
11391
+ o = false;
11392
+ try {
11393
+ if (i = (t = t.call(r)).next, 0 === l) {
11394
+ if (Object(t) !== t) return;
11395
+ f = !1;
11396
+ } else for (; !(f = (e = i.call(t)).done) && (_pushInstanceProperty(a).call(a, e.value), a.length !== l); f = !0);
11397
+ } catch (r) {
11398
+ o = true, n = r;
11399
+ } finally {
11400
+ try {
11401
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
11402
+ } finally {
11403
+ if (o) throw n;
11404
+ }
11356
11405
  }
11357
- // @TODO: Maybe throw for invalid callbacks?
11358
- }
11359
- /**
11360
- * Unsubscribe from an event, remove an event listener.
11361
- * @remarks If the same callback was subscribed more than once **all** occurences will be removed.
11362
- * @param event - Event name.
11363
- * @param callback - Callback method.
11364
- */
11365
- off(event, callback) {
11366
- var _context2;
11367
- this._subscribers[event] = _filterInstanceProperty(_context2 = this._subscribers[event]).call(_context2, subscriber => subscriber !== callback);
11406
+ return a;
11368
11407
  }
11369
11408
  }
11370
11409
 
11371
- var es_object_create = {};
11410
+ var es_array_slice = {};
11372
11411
 
11373
- var hasRequiredEs_object_create;
11412
+ var hasRequiredEs_array_slice;
11374
11413
 
11375
- function requireEs_object_create () {
11376
- if (hasRequiredEs_object_create) return es_object_create;
11377
- hasRequiredEs_object_create = 1;
11378
- // TODO: Remove from `core-js@4`
11414
+ function requireEs_array_slice () {
11415
+ if (hasRequiredEs_array_slice) return es_array_slice;
11416
+ hasRequiredEs_array_slice = 1;
11379
11417
  var $ = /*@__PURE__*/ require_export();
11380
- var DESCRIPTORS = /*@__PURE__*/ requireDescriptors();
11381
- var create = /*@__PURE__*/ requireObjectCreate();
11418
+ var isArray = /*@__PURE__*/ requireIsArray$6();
11419
+ var isConstructor = /*@__PURE__*/ requireIsConstructor();
11420
+ var isObject = /*@__PURE__*/ requireIsObject();
11421
+ var toAbsoluteIndex = /*@__PURE__*/ requireToAbsoluteIndex();
11422
+ var lengthOfArrayLike = /*@__PURE__*/ requireLengthOfArrayLike();
11423
+ var toIndexedObject = /*@__PURE__*/ requireToIndexedObject();
11424
+ var createProperty = /*@__PURE__*/ requireCreateProperty();
11425
+ var setArrayLength = /*@__PURE__*/ requireArraySetLength();
11426
+ var wellKnownSymbol = /*@__PURE__*/ requireWellKnownSymbol();
11427
+ var arrayMethodHasSpeciesSupport = /*@__PURE__*/ requireArrayMethodHasSpeciesSupport();
11428
+ var nativeSlice = /*@__PURE__*/ requireArraySlice();
11382
11429
 
11383
- // `Object.create` method
11384
- // https://tc39.es/ecma262/#sec-object.create
11385
- $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
11430
+ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('slice');
11431
+
11432
+ var SPECIES = wellKnownSymbol('species');
11433
+ var $Array = Array;
11434
+ var max = Math.max;
11435
+
11436
+ // `Array.prototype.slice` method
11437
+ // https://tc39.es/ecma262/#sec-array.prototype.slice
11438
+ // fallback for not array-like ES3 strings and DOM objects
11439
+ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
11440
+ slice: function slice(start, end) {
11441
+ var O = toIndexedObject(this);
11442
+ var length = lengthOfArrayLike(O);
11443
+ var k = toAbsoluteIndex(start, length);
11444
+ var fin = toAbsoluteIndex(end === undefined ? length : end, length);
11445
+ // inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
11446
+ var Constructor, result, n;
11447
+ if (isArray(O)) {
11448
+ Constructor = O.constructor;
11449
+ // cross-realm fallback
11450
+ if (isConstructor(Constructor) && (Constructor === $Array || isArray(Constructor.prototype))) {
11451
+ Constructor = undefined;
11452
+ } else if (isObject(Constructor)) {
11453
+ Constructor = Constructor[SPECIES];
11454
+ if (Constructor === null) Constructor = undefined;
11455
+ }
11456
+ if (Constructor === $Array || Constructor === undefined) {
11457
+ return nativeSlice(O, k, fin);
11458
+ }
11459
+ }
11460
+ result = new (Constructor === undefined ? $Array : Constructor)(max(fin - k, 0));
11461
+ for (n = 0; k < fin; k++, n++) if (k in O) createProperty(result, n, O[k]);
11462
+ setArrayLength(result, n);
11463
+ return result;
11464
+ }
11465
+ });
11466
+ return es_array_slice;
11467
+ }
11468
+
11469
+ var slice$5;
11470
+ var hasRequiredSlice$5;
11471
+
11472
+ function requireSlice$5 () {
11473
+ if (hasRequiredSlice$5) return slice$5;
11474
+ hasRequiredSlice$5 = 1;
11475
+ requireEs_array_slice();
11476
+ var getBuiltInPrototypeMethod = /*@__PURE__*/ requireGetBuiltInPrototypeMethod();
11477
+
11478
+ slice$5 = getBuiltInPrototypeMethod('Array', 'slice');
11479
+ return slice$5;
11480
+ }
11481
+
11482
+ var slice$4;
11483
+ var hasRequiredSlice$4;
11484
+
11485
+ function requireSlice$4 () {
11486
+ if (hasRequiredSlice$4) return slice$4;
11487
+ hasRequiredSlice$4 = 1;
11488
+ var isPrototypeOf = /*@__PURE__*/ requireObjectIsPrototypeOf();
11489
+ var method = /*@__PURE__*/ requireSlice$5();
11490
+
11491
+ var ArrayPrototype = Array.prototype;
11492
+
11493
+ slice$4 = function (it) {
11494
+ var own = it.slice;
11495
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.slice) ? method : own;
11496
+ };
11497
+ return slice$4;
11498
+ }
11499
+
11500
+ var slice$3;
11501
+ var hasRequiredSlice$3;
11502
+
11503
+ function requireSlice$3 () {
11504
+ if (hasRequiredSlice$3) return slice$3;
11505
+ hasRequiredSlice$3 = 1;
11506
+ var parent = /*@__PURE__*/ requireSlice$4();
11507
+
11508
+ slice$3 = parent;
11509
+ return slice$3;
11510
+ }
11511
+
11512
+ var slice$2;
11513
+ var hasRequiredSlice$2;
11514
+
11515
+ function requireSlice$2 () {
11516
+ if (hasRequiredSlice$2) return slice$2;
11517
+ hasRequiredSlice$2 = 1;
11518
+ var parent = /*@__PURE__*/ requireSlice$3();
11519
+
11520
+ slice$2 = parent;
11521
+ return slice$2;
11522
+ }
11523
+
11524
+ var slice$1;
11525
+ var hasRequiredSlice$1;
11526
+
11527
+ function requireSlice$1 () {
11528
+ if (hasRequiredSlice$1) return slice$1;
11529
+ hasRequiredSlice$1 = 1;
11530
+ var parent = /*@__PURE__*/ requireSlice$2();
11531
+
11532
+ slice$1 = parent;
11533
+ return slice$1;
11534
+ }
11535
+
11536
+ var slice;
11537
+ var hasRequiredSlice;
11538
+
11539
+ function requireSlice () {
11540
+ if (hasRequiredSlice) return slice;
11541
+ hasRequiredSlice = 1;
11542
+ slice = /*@__PURE__*/ requireSlice$1();
11543
+ return slice;
11544
+ }
11545
+
11546
+ var sliceExports = /*@__PURE__*/ requireSlice();
11547
+ var _sliceInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(sliceExports);
11548
+
11549
+ var es_array_from = {};
11550
+
11551
+ var callWithSafeIterationClosing;
11552
+ var hasRequiredCallWithSafeIterationClosing;
11553
+
11554
+ function requireCallWithSafeIterationClosing () {
11555
+ if (hasRequiredCallWithSafeIterationClosing) return callWithSafeIterationClosing;
11556
+ hasRequiredCallWithSafeIterationClosing = 1;
11557
+ var anObject = /*@__PURE__*/ requireAnObject();
11558
+ var iteratorClose = /*@__PURE__*/ requireIteratorClose();
11559
+
11560
+ // call something on iterator step with safe closing on error
11561
+ callWithSafeIterationClosing = function (iterator, fn, value, ENTRIES) {
11562
+ try {
11563
+ return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
11564
+ } catch (error) {
11565
+ iteratorClose(iterator, 'throw', error);
11566
+ }
11567
+ };
11568
+ return callWithSafeIterationClosing;
11569
+ }
11570
+
11571
+ var arrayFrom;
11572
+ var hasRequiredArrayFrom;
11573
+
11574
+ function requireArrayFrom () {
11575
+ if (hasRequiredArrayFrom) return arrayFrom;
11576
+ hasRequiredArrayFrom = 1;
11577
+ var bind = /*@__PURE__*/ requireFunctionBindContext();
11578
+ var call = /*@__PURE__*/ requireFunctionCall();
11579
+ var toObject = /*@__PURE__*/ requireToObject();
11580
+ var callWithSafeIterationClosing = /*@__PURE__*/ requireCallWithSafeIterationClosing();
11581
+ var isArrayIteratorMethod = /*@__PURE__*/ requireIsArrayIteratorMethod();
11582
+ var isConstructor = /*@__PURE__*/ requireIsConstructor();
11583
+ var lengthOfArrayLike = /*@__PURE__*/ requireLengthOfArrayLike();
11584
+ var createProperty = /*@__PURE__*/ requireCreateProperty();
11585
+ var setArrayLength = /*@__PURE__*/ requireArraySetLength();
11586
+ var getIterator = /*@__PURE__*/ requireGetIterator$6();
11587
+ var getIteratorMethod = /*@__PURE__*/ requireGetIteratorMethod$5();
11588
+ var iteratorClose = /*@__PURE__*/ requireIteratorClose();
11589
+
11590
+ var $Array = Array;
11591
+
11592
+ // `Array.from` method implementation
11593
+ // https://tc39.es/ecma262/#sec-array.from
11594
+ arrayFrom = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
11595
+ var IS_CONSTRUCTOR = isConstructor(this);
11596
+ var argumentsLength = arguments.length;
11597
+ var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
11598
+ var mapping = mapfn !== undefined;
11599
+ if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
11600
+ var O = toObject(arrayLike);
11601
+ var iteratorMethod = getIteratorMethod(O);
11602
+ var index = 0;
11603
+ var length, result, step, iterator, next, value;
11604
+ // if the target is not iterable or it's an array with the default iterator - use a simple case
11605
+ if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
11606
+ result = IS_CONSTRUCTOR ? new this() : [];
11607
+ iterator = getIterator(O, iteratorMethod);
11608
+ next = iterator.next;
11609
+ for (;!(step = call(next, iterator)).done; index++) {
11610
+ value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
11611
+ try {
11612
+ createProperty(result, index, value);
11613
+ } catch (error) {
11614
+ iteratorClose(iterator, 'throw', error);
11615
+ }
11616
+ }
11617
+ } else {
11618
+ length = lengthOfArrayLike(O);
11619
+ result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
11620
+ for (;length > index; index++) {
11621
+ value = mapping ? mapfn(O[index], index) : O[index];
11622
+ createProperty(result, index, value);
11623
+ }
11624
+ }
11625
+ setArrayLength(result, index);
11626
+ return result;
11627
+ };
11628
+ return arrayFrom;
11629
+ }
11630
+
11631
+ var checkCorrectnessOfIteration;
11632
+ var hasRequiredCheckCorrectnessOfIteration;
11633
+
11634
+ function requireCheckCorrectnessOfIteration () {
11635
+ if (hasRequiredCheckCorrectnessOfIteration) return checkCorrectnessOfIteration;
11636
+ hasRequiredCheckCorrectnessOfIteration = 1;
11637
+ var wellKnownSymbol = /*@__PURE__*/ requireWellKnownSymbol();
11638
+
11639
+ var ITERATOR = wellKnownSymbol('iterator');
11640
+ var SAFE_CLOSING = false;
11641
+
11642
+ try {
11643
+ var called = 0;
11644
+ var iteratorWithReturn = {
11645
+ next: function () {
11646
+ return { done: !!called++ };
11647
+ },
11648
+ 'return': function () {
11649
+ SAFE_CLOSING = true;
11650
+ }
11651
+ };
11652
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
11653
+ iteratorWithReturn[ITERATOR] = function () {
11654
+ return this;
11655
+ };
11656
+ // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
11657
+ Array.from(iteratorWithReturn, function () { throw 2; });
11658
+ } catch (error) { /* empty */ }
11659
+
11660
+ checkCorrectnessOfIteration = function (exec, SKIP_CLOSING) {
11661
+ try {
11662
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
11663
+ } catch (error) { return false; } // workaround of old WebKit + `eval` bug
11664
+ var ITERATION_SUPPORT = false;
11665
+ try {
11666
+ var object = {};
11667
+ // eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
11668
+ object[ITERATOR] = function () {
11669
+ return {
11670
+ next: function () {
11671
+ return { done: ITERATION_SUPPORT = true };
11672
+ }
11673
+ };
11674
+ };
11675
+ exec(object);
11676
+ } catch (error) { /* empty */ }
11677
+ return ITERATION_SUPPORT;
11678
+ };
11679
+ return checkCorrectnessOfIteration;
11680
+ }
11681
+
11682
+ var hasRequiredEs_array_from;
11683
+
11684
+ function requireEs_array_from () {
11685
+ if (hasRequiredEs_array_from) return es_array_from;
11686
+ hasRequiredEs_array_from = 1;
11687
+ var $ = /*@__PURE__*/ require_export();
11688
+ var from = /*@__PURE__*/ requireArrayFrom();
11689
+ var checkCorrectnessOfIteration = /*@__PURE__*/ requireCheckCorrectnessOfIteration();
11690
+
11691
+ var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function (iterable) {
11692
+ // eslint-disable-next-line es/no-array-from -- required for testing
11693
+ Array.from(iterable);
11694
+ });
11695
+
11696
+ // `Array.from` method
11697
+ // https://tc39.es/ecma262/#sec-array.from
11698
+ $({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
11699
+ from: from
11700
+ });
11701
+ return es_array_from;
11702
+ }
11703
+
11704
+ var from$4;
11705
+ var hasRequiredFrom$4;
11706
+
11707
+ function requireFrom$4 () {
11708
+ if (hasRequiredFrom$4) return from$4;
11709
+ hasRequiredFrom$4 = 1;
11710
+ requireEs_string_iterator();
11711
+ requireEs_array_from();
11712
+ var path = /*@__PURE__*/ requirePath();
11713
+
11714
+ from$4 = path.Array.from;
11715
+ return from$4;
11716
+ }
11717
+
11718
+ var from$3;
11719
+ var hasRequiredFrom$3;
11720
+
11721
+ function requireFrom$3 () {
11722
+ if (hasRequiredFrom$3) return from$3;
11723
+ hasRequiredFrom$3 = 1;
11724
+ var parent = /*@__PURE__*/ requireFrom$4();
11725
+
11726
+ from$3 = parent;
11727
+ return from$3;
11728
+ }
11729
+
11730
+ var from$2;
11731
+ var hasRequiredFrom$2;
11732
+
11733
+ function requireFrom$2 () {
11734
+ if (hasRequiredFrom$2) return from$2;
11735
+ hasRequiredFrom$2 = 1;
11736
+ var parent = /*@__PURE__*/ requireFrom$3();
11737
+
11738
+ from$2 = parent;
11739
+ return from$2;
11740
+ }
11741
+
11742
+ var from$1;
11743
+ var hasRequiredFrom$1;
11744
+
11745
+ function requireFrom$1 () {
11746
+ if (hasRequiredFrom$1) return from$1;
11747
+ hasRequiredFrom$1 = 1;
11748
+ var parent = /*@__PURE__*/ requireFrom$2();
11749
+
11750
+ from$1 = parent;
11751
+ return from$1;
11752
+ }
11753
+
11754
+ var from;
11755
+ var hasRequiredFrom;
11756
+
11757
+ function requireFrom () {
11758
+ if (hasRequiredFrom) return from;
11759
+ hasRequiredFrom = 1;
11760
+ from = /*@__PURE__*/ requireFrom$1();
11761
+ return from;
11762
+ }
11763
+
11764
+ var fromExports = /*@__PURE__*/ requireFrom();
11765
+ var _Array$from = /*@__PURE__*/getDefaultExportFromCjs(fromExports);
11766
+
11767
+ function _arrayLikeToArray(r, a) {
11768
+ (null == a || a > r.length) && (a = r.length);
11769
+ for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
11770
+ return n;
11771
+ }
11772
+
11773
+ function _unsupportedIterableToArray(r, a) {
11774
+ if (r) {
11775
+ var _context;
11776
+ if ("string" == typeof r) return _arrayLikeToArray(r, a);
11777
+ var t = _sliceInstanceProperty(_context = {}.toString.call(r)).call(_context, 8, -1);
11778
+ return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? _Array$from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
11779
+ }
11780
+ }
11781
+
11782
+ function _nonIterableRest() {
11783
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
11784
+ }
11785
+
11786
+ function _slicedToArray(r, e) {
11787
+ return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
11788
+ }
11789
+
11790
+ var es_object_create = {};
11791
+
11792
+ var hasRequiredEs_object_create;
11793
+
11794
+ function requireEs_object_create () {
11795
+ if (hasRequiredEs_object_create) return es_object_create;
11796
+ hasRequiredEs_object_create = 1;
11797
+ // TODO: Remove from `core-js@4`
11798
+ var $ = /*@__PURE__*/ require_export();
11799
+ var DESCRIPTORS = /*@__PURE__*/ requireDescriptors();
11800
+ var create = /*@__PURE__*/ requireObjectCreate();
11801
+
11802
+ // `Object.create` method
11803
+ // https://tc39.es/ecma262/#sec-object.create
11804
+ $({ target: 'Object', stat: true, sham: !DESCRIPTORS }, {
11386
11805
  create: create
11387
11806
  });
11388
11807
  return es_object_create;
@@ -11659,7 +12078,7 @@
11659
12078
  var O = aSet(this);
11660
12079
  var otherRec = getSetRecord(other);
11661
12080
  var result = clone(O);
11662
- if (size(O) <= otherRec.size) iterateSet(O, function (e) {
12081
+ if (size(result) <= otherRec.size) iterateSet(result, function (e) {
11663
12082
  if (otherRec.includes(e)) remove(result, e);
11664
12083
  });
11665
12084
  else iterateSimple(otherRec.getIterator(), function (e) {
@@ -11818,7 +12237,7 @@
11818
12237
  }, true) !== false;
11819
12238
  var iterator = otherRec.getIterator();
11820
12239
  return iterateSimple(iterator, function (e) {
11821
- if (has(O, e)) return iteratorClose(iterator, 'normal', false);
12240
+ if (has(O, e)) return iteratorClose(iterator.iterator, 'normal', false);
11822
12241
  }) !== false;
11823
12242
  };
11824
12243
  return setIsDisjointFrom;
@@ -11915,7 +12334,7 @@
11915
12334
  if (size(O) < otherRec.size) return false;
11916
12335
  var iterator = otherRec.getIterator();
11917
12336
  return iterateSimple(iterator, function (e) {
11918
- if (!has(O, e)) return iteratorClose(iterator, 'normal', false);
12337
+ if (!has(O, e)) return iteratorClose(iterator.iterator, 'normal', false);
11919
12338
  }) !== false;
11920
12339
  };
11921
12340
  return setIsSupersetOf;
@@ -11942,531 +12361,990 @@
11942
12361
  return es_set_isSupersetOf_v2;
11943
12362
  }
11944
12363
 
11945
- var es_set_symmetricDifference_v2 = {};
12364
+ var es_set_symmetricDifference_v2 = {};
12365
+
12366
+ var setSymmetricDifference;
12367
+ var hasRequiredSetSymmetricDifference;
12368
+
12369
+ function requireSetSymmetricDifference () {
12370
+ if (hasRequiredSetSymmetricDifference) return setSymmetricDifference;
12371
+ hasRequiredSetSymmetricDifference = 1;
12372
+ var aSet = /*@__PURE__*/ requireASet();
12373
+ var SetHelpers = /*@__PURE__*/ requireSetHelpers();
12374
+ var clone = /*@__PURE__*/ requireSetClone();
12375
+ var getSetRecord = /*@__PURE__*/ requireGetSetRecord();
12376
+ var iterateSimple = /*@__PURE__*/ requireIterateSimple();
12377
+
12378
+ var add = SetHelpers.add;
12379
+ var has = SetHelpers.has;
12380
+ var remove = SetHelpers.remove;
12381
+
12382
+ // `Set.prototype.symmetricDifference` method
12383
+ // https://tc39.es/ecma262/#sec-set.prototype.symmetricdifference
12384
+ setSymmetricDifference = function symmetricDifference(other) {
12385
+ var O = aSet(this);
12386
+ var keysIter = getSetRecord(other).getIterator();
12387
+ var result = clone(O);
12388
+ iterateSimple(keysIter, function (e) {
12389
+ if (has(O, e)) remove(result, e);
12390
+ else add(result, e);
12391
+ });
12392
+ return result;
12393
+ };
12394
+ return setSymmetricDifference;
12395
+ }
12396
+
12397
+ var setMethodGetKeysBeforeCloningDetection;
12398
+ var hasRequiredSetMethodGetKeysBeforeCloningDetection;
12399
+
12400
+ function requireSetMethodGetKeysBeforeCloningDetection () {
12401
+ if (hasRequiredSetMethodGetKeysBeforeCloningDetection) return setMethodGetKeysBeforeCloningDetection;
12402
+ hasRequiredSetMethodGetKeysBeforeCloningDetection = 1;
12403
+ // Should get iterator record of a set-like object before cloning this
12404
+ // https://bugs.webkit.org/show_bug.cgi?id=289430
12405
+ setMethodGetKeysBeforeCloningDetection = function (METHOD_NAME) {
12406
+ try {
12407
+ // eslint-disable-next-line es/no-set -- needed for test
12408
+ var baseSet = new Set();
12409
+ var setLike = {
12410
+ size: 0,
12411
+ has: function () { return true; },
12412
+ keys: function () {
12413
+ // eslint-disable-next-line es/no-object-defineproperty -- needed for test
12414
+ return Object.defineProperty({}, 'next', {
12415
+ get: function () {
12416
+ baseSet.clear();
12417
+ baseSet.add(4);
12418
+ return function () {
12419
+ return { done: true };
12420
+ };
12421
+ }
12422
+ });
12423
+ }
12424
+ };
12425
+ var result = baseSet[METHOD_NAME](setLike);
12426
+
12427
+ return result.size === 1 && result.values().next().value === 4;
12428
+ } catch (error) {
12429
+ return false;
12430
+ }
12431
+ };
12432
+ return setMethodGetKeysBeforeCloningDetection;
12433
+ }
12434
+
12435
+ var hasRequiredEs_set_symmetricDifference_v2;
12436
+
12437
+ function requireEs_set_symmetricDifference_v2 () {
12438
+ if (hasRequiredEs_set_symmetricDifference_v2) return es_set_symmetricDifference_v2;
12439
+ hasRequiredEs_set_symmetricDifference_v2 = 1;
12440
+ var $ = /*@__PURE__*/ require_export();
12441
+ var symmetricDifference = /*@__PURE__*/ requireSetSymmetricDifference();
12442
+ var setMethodGetKeysBeforeCloning = /*@__PURE__*/ requireSetMethodGetKeysBeforeCloningDetection();
12443
+ var setMethodAcceptSetLike = /*@__PURE__*/ requireSetMethodAcceptSetLike();
12444
+
12445
+ var FORCED = !setMethodAcceptSetLike('symmetricDifference') || !setMethodGetKeysBeforeCloning('symmetricDifference');
12446
+
12447
+ // `Set.prototype.symmetricDifference` method
12448
+ // https://tc39.es/ecma262/#sec-set.prototype.symmetricdifference
12449
+ $({ target: 'Set', proto: true, real: true, forced: FORCED }, {
12450
+ symmetricDifference: symmetricDifference
12451
+ });
12452
+ return es_set_symmetricDifference_v2;
12453
+ }
12454
+
12455
+ var es_set_union_v2 = {};
12456
+
12457
+ var setUnion;
12458
+ var hasRequiredSetUnion;
12459
+
12460
+ function requireSetUnion () {
12461
+ if (hasRequiredSetUnion) return setUnion;
12462
+ hasRequiredSetUnion = 1;
12463
+ var aSet = /*@__PURE__*/ requireASet();
12464
+ var add = /*@__PURE__*/ requireSetHelpers().add;
12465
+ var clone = /*@__PURE__*/ requireSetClone();
12466
+ var getSetRecord = /*@__PURE__*/ requireGetSetRecord();
12467
+ var iterateSimple = /*@__PURE__*/ requireIterateSimple();
12468
+
12469
+ // `Set.prototype.union` method
12470
+ // https://tc39.es/ecma262/#sec-set.prototype.union
12471
+ setUnion = function union(other) {
12472
+ var O = aSet(this);
12473
+ var keysIter = getSetRecord(other).getIterator();
12474
+ var result = clone(O);
12475
+ iterateSimple(keysIter, function (it) {
12476
+ add(result, it);
12477
+ });
12478
+ return result;
12479
+ };
12480
+ return setUnion;
12481
+ }
12482
+
12483
+ var hasRequiredEs_set_union_v2;
12484
+
12485
+ function requireEs_set_union_v2 () {
12486
+ if (hasRequiredEs_set_union_v2) return es_set_union_v2;
12487
+ hasRequiredEs_set_union_v2 = 1;
12488
+ var $ = /*@__PURE__*/ require_export();
12489
+ var union = /*@__PURE__*/ requireSetUnion();
12490
+ var setMethodGetKeysBeforeCloning = /*@__PURE__*/ requireSetMethodGetKeysBeforeCloningDetection();
12491
+ var setMethodAcceptSetLike = /*@__PURE__*/ requireSetMethodAcceptSetLike();
12492
+
12493
+ var FORCED = !setMethodAcceptSetLike('union') || !setMethodGetKeysBeforeCloning('union');
12494
+
12495
+ // `Set.prototype.union` method
12496
+ // https://tc39.es/ecma262/#sec-set.prototype.union
12497
+ $({ target: 'Set', proto: true, real: true, forced: FORCED }, {
12498
+ union: union
12499
+ });
12500
+ return es_set_union_v2;
12501
+ }
12502
+
12503
+ var set$2;
12504
+ var hasRequiredSet$2;
12505
+
12506
+ function requireSet$2 () {
12507
+ if (hasRequiredSet$2) return set$2;
12508
+ hasRequiredSet$2 = 1;
12509
+ requireEs_array_iterator();
12510
+ requireEs_set();
12511
+ requireEs_set_difference_v2();
12512
+ requireEs_set_intersection_v2();
12513
+ requireEs_set_isDisjointFrom_v2();
12514
+ requireEs_set_isSubsetOf_v2();
12515
+ requireEs_set_isSupersetOf_v2();
12516
+ requireEs_set_symmetricDifference_v2();
12517
+ requireEs_set_union_v2();
12518
+ requireEs_string_iterator();
12519
+ var path = /*@__PURE__*/ requirePath();
12520
+
12521
+ set$2 = path.Set;
12522
+ return set$2;
12523
+ }
12524
+
12525
+ var set$1;
12526
+ var hasRequiredSet$1;
12527
+
12528
+ function requireSet$1 () {
12529
+ if (hasRequiredSet$1) return set$1;
12530
+ hasRequiredSet$1 = 1;
12531
+ var parent = /*@__PURE__*/ requireSet$2();
12532
+ requireWeb_domCollections_iterator();
12533
+
12534
+ set$1 = parent;
12535
+ return set$1;
12536
+ }
12537
+
12538
+ var set;
12539
+ var hasRequiredSet;
12540
+
12541
+ function requireSet () {
12542
+ if (hasRequiredSet) return set;
12543
+ hasRequiredSet = 1;
12544
+ set = /*@__PURE__*/ requireSet$1();
12545
+ return set;
12546
+ }
12547
+
12548
+ var setExports = requireSet();
12549
+ var _Set = /*@__PURE__*/getDefaultExportFromCjs(setExports);
12550
+
12551
+ var getIterator_1;
12552
+ var hasRequiredGetIterator$5;
12553
+
12554
+ function requireGetIterator$5 () {
12555
+ if (hasRequiredGetIterator$5) return getIterator_1;
12556
+ hasRequiredGetIterator$5 = 1;
12557
+ requireEs_array_iterator();
12558
+ requireEs_string_iterator();
12559
+ var getIterator = /*@__PURE__*/ requireGetIterator$6();
12560
+
12561
+ getIterator_1 = getIterator;
12562
+ return getIterator_1;
12563
+ }
12564
+
12565
+ var getIterator$4;
12566
+ var hasRequiredGetIterator$4;
12567
+
12568
+ function requireGetIterator$4 () {
12569
+ if (hasRequiredGetIterator$4) return getIterator$4;
12570
+ hasRequiredGetIterator$4 = 1;
12571
+ var parent = /*@__PURE__*/ requireGetIterator$5();
12572
+ requireWeb_domCollections_iterator();
12573
+
12574
+ getIterator$4 = parent;
12575
+ return getIterator$4;
12576
+ }
12577
+
12578
+ var getIterator$3;
12579
+ var hasRequiredGetIterator$3;
12580
+
12581
+ function requireGetIterator$3 () {
12582
+ if (hasRequiredGetIterator$3) return getIterator$3;
12583
+ hasRequiredGetIterator$3 = 1;
12584
+ var parent = /*@__PURE__*/ requireGetIterator$4();
12585
+
12586
+ getIterator$3 = parent;
12587
+ return getIterator$3;
12588
+ }
12589
+
12590
+ var getIterator$2;
12591
+ var hasRequiredGetIterator$2;
12592
+
12593
+ function requireGetIterator$2 () {
12594
+ if (hasRequiredGetIterator$2) return getIterator$2;
12595
+ hasRequiredGetIterator$2 = 1;
12596
+ var parent = /*@__PURE__*/ requireGetIterator$3();
12597
+
12598
+ getIterator$2 = parent;
12599
+ return getIterator$2;
12600
+ }
12601
+
12602
+ var getIterator$1;
12603
+ var hasRequiredGetIterator$1;
12604
+
12605
+ function requireGetIterator$1 () {
12606
+ if (hasRequiredGetIterator$1) return getIterator$1;
12607
+ hasRequiredGetIterator$1 = 1;
12608
+ getIterator$1 = /*@__PURE__*/ requireGetIterator$2();
12609
+ return getIterator$1;
12610
+ }
12611
+
12612
+ var getIterator;
12613
+ var hasRequiredGetIterator;
12614
+
12615
+ function requireGetIterator () {
12616
+ if (hasRequiredGetIterator) return getIterator;
12617
+ hasRequiredGetIterator = 1;
12618
+ getIterator = /*@__PURE__*/ requireGetIterator$1();
12619
+ return getIterator;
12620
+ }
12621
+
12622
+ var getIteratorExports = requireGetIterator();
12623
+ var _getIterator = /*@__PURE__*/getDefaultExportFromCjs(getIteratorExports);
12624
+
12625
+ /**
12626
+ * Data stream
12627
+ * @remarks
12628
+ * {@link DataStream} offers an always up to date stream of items from a {@link DataSet} or {@link DataView}.
12629
+ * That means that the stream is evaluated at the time of iteration, conversion to another data type or when {@link cache} is called, not when the {@link DataStream} was created.
12630
+ * Multiple invocations of for example {@link toItemArray} may yield different results (if the data source like for example {@link DataSet} gets modified).
12631
+ * @typeParam Item - The item type this stream is going to work with.
12632
+ */
12633
+ class DataStream {
12634
+ /**
12635
+ * Create a new data stream.
12636
+ * @param pairs - The id, item pairs.
12637
+ */
12638
+ constructor(pairs) {
12639
+ this._pairs = pairs;
12640
+ }
12641
+ /**
12642
+ * Return an iterable of key, value pairs for every entry in the stream.
12643
+ */
12644
+ *[_Symbol$iterator]() {
12645
+ for (const _ref of this._pairs) {
12646
+ var _ref2 = _slicedToArray(_ref, 2);
12647
+ const id = _ref2[0];
12648
+ const item = _ref2[1];
12649
+ yield [id, item];
12650
+ }
12651
+ }
12652
+ /**
12653
+ * Return an iterable of key, value pairs for every entry in the stream.
12654
+ */
12655
+ *entries() {
12656
+ for (const _ref3 of this._pairs) {
12657
+ var _ref4 = _slicedToArray(_ref3, 2);
12658
+ const id = _ref4[0];
12659
+ const item = _ref4[1];
12660
+ yield [id, item];
12661
+ }
12662
+ }
12663
+ /**
12664
+ * Return an iterable of keys in the stream.
12665
+ */
12666
+ *keys() {
12667
+ for (const _ref5 of this._pairs) {
12668
+ var _ref6 = _slicedToArray(_ref5, 1);
12669
+ const id = _ref6[0];
12670
+ yield id;
12671
+ }
12672
+ }
12673
+ /**
12674
+ * Return an iterable of values in the stream.
12675
+ */
12676
+ *values() {
12677
+ for (const _ref7 of this._pairs) {
12678
+ var _ref8 = _slicedToArray(_ref7, 2);
12679
+ const item = _ref8[1];
12680
+ yield item;
12681
+ }
12682
+ }
12683
+ /**
12684
+ * Return an array containing all the ids in this stream.
12685
+ * @remarks
12686
+ * The array may contain duplicities.
12687
+ * @returns The array with all ids from this stream.
12688
+ */
12689
+ toIdArray() {
12690
+ var _context;
12691
+ return _mapInstanceProperty(_context = [...this._pairs]).call(_context, pair => pair[0]);
12692
+ }
12693
+ /**
12694
+ * Return an array containing all the items in this stream.
12695
+ * @remarks
12696
+ * The array may contain duplicities.
12697
+ * @returns The array with all items from this stream.
12698
+ */
12699
+ toItemArray() {
12700
+ var _context2;
12701
+ return _mapInstanceProperty(_context2 = [...this._pairs]).call(_context2, pair => pair[1]);
12702
+ }
12703
+ /**
12704
+ * Return an array containing all the entries in this stream.
12705
+ * @remarks
12706
+ * The array may contain duplicities.
12707
+ * @returns The array with all entries from this stream.
12708
+ */
12709
+ toEntryArray() {
12710
+ return [...this._pairs];
12711
+ }
12712
+ /**
12713
+ * Return an object map containing all the items in this stream accessible by ids.
12714
+ * @remarks
12715
+ * In case of duplicate ids (coerced to string so `7 == '7'`) the last encoutered appears in the returned object.
12716
+ * @returns The object map of all id → item pairs from this stream.
12717
+ */
12718
+ toObjectMap() {
12719
+ const map = _Object$create(null);
12720
+ for (const _ref9 of this._pairs) {
12721
+ var _ref0 = _slicedToArray(_ref9, 2);
12722
+ const id = _ref0[0];
12723
+ const item = _ref0[1];
12724
+ map[id] = item;
12725
+ }
12726
+ return map;
12727
+ }
12728
+ /**
12729
+ * Return a map containing all the items in this stream accessible by ids.
12730
+ * @returns The map of all id → item pairs from this stream.
12731
+ */
12732
+ toMap() {
12733
+ return new _Map(this._pairs);
12734
+ }
12735
+ /**
12736
+ * Return a set containing all the (unique) ids in this stream.
12737
+ * @returns The set of all ids from this stream.
12738
+ */
12739
+ toIdSet() {
12740
+ return new _Set(this.toIdArray());
12741
+ }
12742
+ /**
12743
+ * Return a set containing all the (unique) items in this stream.
12744
+ * @returns The set of all items from this stream.
12745
+ */
12746
+ toItemSet() {
12747
+ return new _Set(this.toItemArray());
12748
+ }
12749
+ /**
12750
+ * Cache the items from this stream.
12751
+ * @remarks
12752
+ * This method allows for items to be fetched immediatelly and used (possibly multiple times) later.
12753
+ * It can also be used to optimize performance as {@link DataStream} would otherwise reevaluate everything upon each iteration.
12754
+ *
12755
+ * ## Example
12756
+ * ```javascript
12757
+ * const ds = new DataSet([…])
12758
+ *
12759
+ * const cachedStream = ds.stream()
12760
+ * .filter(…)
12761
+ * .sort(…)
12762
+ * .map(…)
12763
+ * .cached(…) // Data are fetched, processed and cached here.
12764
+ *
12765
+ * ds.clear()
12766
+ * chachedStream // Still has all the items.
12767
+ * ```
12768
+ * @returns A new {@link DataStream} with cached items (detached from the original {@link DataSet}).
12769
+ */
12770
+ cache() {
12771
+ return new DataStream([...this._pairs]);
12772
+ }
12773
+ /**
12774
+ * Get the distinct values of given property.
12775
+ * @param callback - The function that picks and possibly converts the property.
12776
+ * @typeParam T - The type of the distinct value.
12777
+ * @returns A set of all distinct properties.
12778
+ */
12779
+ distinct(callback) {
12780
+ const set = new _Set();
12781
+ for (const _ref1 of this._pairs) {
12782
+ var _ref10 = _slicedToArray(_ref1, 2);
12783
+ const id = _ref10[0];
12784
+ const item = _ref10[1];
12785
+ set.add(callback(item, id));
12786
+ }
12787
+ return set;
12788
+ }
12789
+ /**
12790
+ * Filter the items of the stream.
12791
+ * @param callback - The function that decides whether an item will be included.
12792
+ * @returns A new data stream with the filtered items.
12793
+ */
12794
+ filter(callback) {
12795
+ const pairs = this._pairs;
12796
+ return new DataStream({
12797
+ *[_Symbol$iterator]() {
12798
+ for (const _ref11 of pairs) {
12799
+ var _ref12 = _slicedToArray(_ref11, 2);
12800
+ const id = _ref12[0];
12801
+ const item = _ref12[1];
12802
+ if (callback(item, id)) {
12803
+ yield [id, item];
12804
+ }
12805
+ }
12806
+ }
12807
+ });
12808
+ }
12809
+ /**
12810
+ * Execute a callback for each item of the stream.
12811
+ * @param callback - The function that will be invoked for each item.
12812
+ */
12813
+ forEach(callback) {
12814
+ for (const _ref13 of this._pairs) {
12815
+ var _ref14 = _slicedToArray(_ref13, 2);
12816
+ const id = _ref14[0];
12817
+ const item = _ref14[1];
12818
+ callback(item, id);
12819
+ }
12820
+ }
12821
+ /**
12822
+ * Map the items into a different type.
12823
+ * @param callback - The function that does the conversion.
12824
+ * @typeParam Mapped - The type of the item after mapping.
12825
+ * @returns A new data stream with the mapped items.
12826
+ */
12827
+ map(callback) {
12828
+ const pairs = this._pairs;
12829
+ return new DataStream({
12830
+ *[_Symbol$iterator]() {
12831
+ for (const _ref15 of pairs) {
12832
+ var _ref16 = _slicedToArray(_ref15, 2);
12833
+ const id = _ref16[0];
12834
+ const item = _ref16[1];
12835
+ yield [id, callback(item, id)];
12836
+ }
12837
+ }
12838
+ });
12839
+ }
12840
+ /**
12841
+ * Get the item with the maximum value of given property.
12842
+ * @param callback - The function that picks and possibly converts the property.
12843
+ * @returns The item with the maximum if found otherwise null.
12844
+ */
12845
+ max(callback) {
12846
+ const iter = _getIterator(this._pairs);
12847
+ let curr = iter.next();
12848
+ if (curr.done) {
12849
+ return null;
12850
+ }
12851
+ let maxItem = curr.value[1];
12852
+ let maxValue = callback(curr.value[1], curr.value[0]);
12853
+ while (!(curr = iter.next()).done) {
12854
+ const _curr$value = _slicedToArray(curr.value, 2),
12855
+ id = _curr$value[0],
12856
+ item = _curr$value[1];
12857
+ const value = callback(item, id);
12858
+ if (value > maxValue) {
12859
+ maxValue = value;
12860
+ maxItem = item;
12861
+ }
12862
+ }
12863
+ return maxItem;
12864
+ }
12865
+ /**
12866
+ * Get the item with the minimum value of given property.
12867
+ * @param callback - The function that picks and possibly converts the property.
12868
+ * @returns The item with the minimum if found otherwise null.
12869
+ */
12870
+ min(callback) {
12871
+ const iter = _getIterator(this._pairs);
12872
+ let curr = iter.next();
12873
+ if (curr.done) {
12874
+ return null;
12875
+ }
12876
+ let minItem = curr.value[1];
12877
+ let minValue = callback(curr.value[1], curr.value[0]);
12878
+ while (!(curr = iter.next()).done) {
12879
+ const _curr$value2 = _slicedToArray(curr.value, 2),
12880
+ id = _curr$value2[0],
12881
+ item = _curr$value2[1];
12882
+ const value = callback(item, id);
12883
+ if (value < minValue) {
12884
+ minValue = value;
12885
+ minItem = item;
12886
+ }
12887
+ }
12888
+ return minItem;
12889
+ }
12890
+ /**
12891
+ * Reduce the items into a single value.
12892
+ * @param callback - The function that does the reduction.
12893
+ * @param accumulator - The initial value of the accumulator.
12894
+ * @typeParam T - The type of the accumulated value.
12895
+ * @returns The reduced value.
12896
+ */
12897
+ reduce(callback, accumulator) {
12898
+ for (const _ref17 of this._pairs) {
12899
+ var _ref18 = _slicedToArray(_ref17, 2);
12900
+ const id = _ref18[0];
12901
+ const item = _ref18[1];
12902
+ accumulator = callback(accumulator, item, id);
12903
+ }
12904
+ return accumulator;
12905
+ }
12906
+ /**
12907
+ * Sort the items.
12908
+ * @param callback - Item comparator.
12909
+ * @returns A new stream with sorted items.
12910
+ */
12911
+ sort(callback) {
12912
+ return new DataStream({
12913
+ [_Symbol$iterator]: () => _getIterator([...this._pairs].toSorted((_ref19, _ref20) => {
12914
+ let _ref21 = _slicedToArray(_ref19, 2),
12915
+ idA = _ref21[0],
12916
+ itemA = _ref21[1];
12917
+ let _ref22 = _slicedToArray(_ref20, 2),
12918
+ idB = _ref22[0],
12919
+ itemB = _ref22[1];
12920
+ return callback(itemA, itemB, idA, idB);
12921
+ }))
12922
+ });
12923
+ }
12924
+ }
12925
+
12926
+ var web_timers = {};
11946
12927
 
11947
- var setSymmetricDifference;
11948
- var hasRequiredSetSymmetricDifference;
12928
+ var web_setInterval = {};
11949
12929
 
11950
- function requireSetSymmetricDifference () {
11951
- if (hasRequiredSetSymmetricDifference) return setSymmetricDifference;
11952
- hasRequiredSetSymmetricDifference = 1;
11953
- var aSet = /*@__PURE__*/ requireASet();
11954
- var SetHelpers = /*@__PURE__*/ requireSetHelpers();
11955
- var clone = /*@__PURE__*/ requireSetClone();
11956
- var getSetRecord = /*@__PURE__*/ requireGetSetRecord();
11957
- var iterateSimple = /*@__PURE__*/ requireIterateSimple();
12930
+ var validateArgumentsLength;
12931
+ var hasRequiredValidateArgumentsLength;
11958
12932
 
11959
- var add = SetHelpers.add;
11960
- var has = SetHelpers.has;
11961
- var remove = SetHelpers.remove;
12933
+ function requireValidateArgumentsLength () {
12934
+ if (hasRequiredValidateArgumentsLength) return validateArgumentsLength;
12935
+ hasRequiredValidateArgumentsLength = 1;
12936
+ var $TypeError = TypeError;
11962
12937
 
11963
- // `Set.prototype.symmetricDifference` method
11964
- // https://tc39.es/ecma262/#sec-set.prototype.symmetricdifference
11965
- setSymmetricDifference = function symmetricDifference(other) {
11966
- var O = aSet(this);
11967
- var keysIter = getSetRecord(other).getIterator();
11968
- var result = clone(O);
11969
- iterateSimple(keysIter, function (e) {
11970
- if (has(O, e)) remove(result, e);
11971
- else add(result, e);
11972
- });
11973
- return result;
12938
+ validateArgumentsLength = function (passed, required) {
12939
+ if (passed < required) throw new $TypeError('Not enough arguments');
12940
+ return passed;
11974
12941
  };
11975
- return setSymmetricDifference;
12942
+ return validateArgumentsLength;
11976
12943
  }
11977
12944
 
11978
- var setMethodGetKeysBeforeCloningDetection;
11979
- var hasRequiredSetMethodGetKeysBeforeCloningDetection;
12945
+ var schedulersFix;
12946
+ var hasRequiredSchedulersFix;
11980
12947
 
11981
- function requireSetMethodGetKeysBeforeCloningDetection () {
11982
- if (hasRequiredSetMethodGetKeysBeforeCloningDetection) return setMethodGetKeysBeforeCloningDetection;
11983
- hasRequiredSetMethodGetKeysBeforeCloningDetection = 1;
11984
- // Should get iterator record of a set-like object before cloning this
11985
- // https://bugs.webkit.org/show_bug.cgi?id=289430
11986
- setMethodGetKeysBeforeCloningDetection = function (METHOD_NAME) {
11987
- try {
11988
- // eslint-disable-next-line es/no-set -- needed for test
11989
- var baseSet = new Set();
11990
- var setLike = {
11991
- size: 0,
11992
- has: function () { return true; },
11993
- keys: function () {
11994
- // eslint-disable-next-line es/no-object-defineproperty -- needed for test
11995
- return Object.defineProperty({}, 'next', {
11996
- get: function () {
11997
- baseSet.clear();
11998
- baseSet.add(4);
11999
- return function () {
12000
- return { done: true };
12001
- };
12002
- }
12003
- });
12004
- }
12005
- };
12006
- var result = baseSet[METHOD_NAME](setLike);
12948
+ function requireSchedulersFix () {
12949
+ if (hasRequiredSchedulersFix) return schedulersFix;
12950
+ hasRequiredSchedulersFix = 1;
12951
+ var globalThis = /*@__PURE__*/ requireGlobalThis();
12952
+ var apply = /*@__PURE__*/ requireFunctionApply();
12953
+ var isCallable = /*@__PURE__*/ requireIsCallable();
12954
+ var ENVIRONMENT = /*@__PURE__*/ requireEnvironment();
12955
+ var USER_AGENT = /*@__PURE__*/ requireEnvironmentUserAgent();
12956
+ var arraySlice = /*@__PURE__*/ requireArraySlice();
12957
+ var validateArgumentsLength = /*@__PURE__*/ requireValidateArgumentsLength();
12007
12958
 
12008
- return result.size === 1 && result.values().next().value === 4;
12009
- } catch (error) {
12010
- return false;
12011
- }
12959
+ var Function = globalThis.Function;
12960
+ // dirty IE9- and Bun 0.3.0- checks
12961
+ var WRAP = /MSIE .\./.test(USER_AGENT) || ENVIRONMENT === 'BUN' && (function () {
12962
+ var version = globalThis.Bun.version.split('.');
12963
+ return version.length < 3 || version[0] === '0' && (version[1] < 3 || version[1] === '3' && version[2] === '0');
12964
+ })();
12965
+
12966
+ // IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix
12967
+ // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
12968
+ // https://github.com/oven-sh/bun/issues/1633
12969
+ schedulersFix = function (scheduler, hasTimeArg) {
12970
+ var firstParamIndex = hasTimeArg ? 2 : 1;
12971
+ return WRAP ? function (handler, timeout /* , ...arguments */) {
12972
+ var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;
12973
+ var fn = isCallable(handler) ? handler : Function(handler);
12974
+ var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];
12975
+ var callback = boundArgs ? function () {
12976
+ apply(fn, this, params);
12977
+ } : fn;
12978
+ return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);
12979
+ } : scheduler;
12012
12980
  };
12013
- return setMethodGetKeysBeforeCloningDetection;
12981
+ return schedulersFix;
12014
12982
  }
12015
12983
 
12016
- var hasRequiredEs_set_symmetricDifference_v2;
12984
+ var hasRequiredWeb_setInterval;
12017
12985
 
12018
- function requireEs_set_symmetricDifference_v2 () {
12019
- if (hasRequiredEs_set_symmetricDifference_v2) return es_set_symmetricDifference_v2;
12020
- hasRequiredEs_set_symmetricDifference_v2 = 1;
12986
+ function requireWeb_setInterval () {
12987
+ if (hasRequiredWeb_setInterval) return web_setInterval;
12988
+ hasRequiredWeb_setInterval = 1;
12021
12989
  var $ = /*@__PURE__*/ require_export();
12022
- var symmetricDifference = /*@__PURE__*/ requireSetSymmetricDifference();
12023
- var setMethodGetKeysBeforeCloning = /*@__PURE__*/ requireSetMethodGetKeysBeforeCloningDetection();
12024
- var setMethodAcceptSetLike = /*@__PURE__*/ requireSetMethodAcceptSetLike();
12990
+ var globalThis = /*@__PURE__*/ requireGlobalThis();
12991
+ var schedulersFix = /*@__PURE__*/ requireSchedulersFix();
12025
12992
 
12026
- var FORCED = !setMethodAcceptSetLike('symmetricDifference') || !setMethodGetKeysBeforeCloning('symmetricDifference');
12993
+ var setInterval = schedulersFix(globalThis.setInterval, true);
12027
12994
 
12028
- // `Set.prototype.symmetricDifference` method
12029
- // https://tc39.es/ecma262/#sec-set.prototype.symmetricdifference
12030
- $({ target: 'Set', proto: true, real: true, forced: FORCED }, {
12031
- symmetricDifference: symmetricDifference
12995
+ // Bun / IE9- setInterval additional parameters fix
12996
+ // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
12997
+ $({ global: true, bind: true, forced: globalThis.setInterval !== setInterval }, {
12998
+ setInterval: setInterval
12032
12999
  });
12033
- return es_set_symmetricDifference_v2;
13000
+ return web_setInterval;
12034
13001
  }
12035
13002
 
12036
- var es_set_union_v2 = {};
12037
-
12038
- var setUnion;
12039
- var hasRequiredSetUnion;
12040
-
12041
- function requireSetUnion () {
12042
- if (hasRequiredSetUnion) return setUnion;
12043
- hasRequiredSetUnion = 1;
12044
- var aSet = /*@__PURE__*/ requireASet();
12045
- var add = /*@__PURE__*/ requireSetHelpers().add;
12046
- var clone = /*@__PURE__*/ requireSetClone();
12047
- var getSetRecord = /*@__PURE__*/ requireGetSetRecord();
12048
- var iterateSimple = /*@__PURE__*/ requireIterateSimple();
12049
-
12050
- // `Set.prototype.union` method
12051
- // https://tc39.es/ecma262/#sec-set.prototype.union
12052
- setUnion = function union(other) {
12053
- var O = aSet(this);
12054
- var keysIter = getSetRecord(other).getIterator();
12055
- var result = clone(O);
12056
- iterateSimple(keysIter, function (it) {
12057
- add(result, it);
12058
- });
12059
- return result;
12060
- };
12061
- return setUnion;
12062
- }
13003
+ var web_setTimeout = {};
12063
13004
 
12064
- var hasRequiredEs_set_union_v2;
13005
+ var hasRequiredWeb_setTimeout;
12065
13006
 
12066
- function requireEs_set_union_v2 () {
12067
- if (hasRequiredEs_set_union_v2) return es_set_union_v2;
12068
- hasRequiredEs_set_union_v2 = 1;
13007
+ function requireWeb_setTimeout () {
13008
+ if (hasRequiredWeb_setTimeout) return web_setTimeout;
13009
+ hasRequiredWeb_setTimeout = 1;
12069
13010
  var $ = /*@__PURE__*/ require_export();
12070
- var union = /*@__PURE__*/ requireSetUnion();
12071
- var setMethodGetKeysBeforeCloning = /*@__PURE__*/ requireSetMethodGetKeysBeforeCloningDetection();
12072
- var setMethodAcceptSetLike = /*@__PURE__*/ requireSetMethodAcceptSetLike();
13011
+ var globalThis = /*@__PURE__*/ requireGlobalThis();
13012
+ var schedulersFix = /*@__PURE__*/ requireSchedulersFix();
12073
13013
 
12074
- var FORCED = !setMethodAcceptSetLike('union') || !setMethodGetKeysBeforeCloning('union');
13014
+ var setTimeout = schedulersFix(globalThis.setTimeout, true);
12075
13015
 
12076
- // `Set.prototype.union` method
12077
- // https://tc39.es/ecma262/#sec-set.prototype.union
12078
- $({ target: 'Set', proto: true, real: true, forced: FORCED }, {
12079
- union: union
13016
+ // Bun / IE9- setTimeout additional parameters fix
13017
+ // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
13018
+ $({ global: true, bind: true, forced: globalThis.setTimeout !== setTimeout }, {
13019
+ setTimeout: setTimeout
12080
13020
  });
12081
- return es_set_union_v2;
12082
- }
12083
-
12084
- var set$2;
12085
- var hasRequiredSet$2;
12086
-
12087
- function requireSet$2 () {
12088
- if (hasRequiredSet$2) return set$2;
12089
- hasRequiredSet$2 = 1;
12090
- requireEs_array_iterator();
12091
- requireEs_set();
12092
- requireEs_set_difference_v2();
12093
- requireEs_set_intersection_v2();
12094
- requireEs_set_isDisjointFrom_v2();
12095
- requireEs_set_isSubsetOf_v2();
12096
- requireEs_set_isSupersetOf_v2();
12097
- requireEs_set_symmetricDifference_v2();
12098
- requireEs_set_union_v2();
12099
- requireEs_string_iterator();
12100
- var path = /*@__PURE__*/ requirePath();
12101
-
12102
- set$2 = path.Set;
12103
- return set$2;
12104
- }
12105
-
12106
- var set$1;
12107
- var hasRequiredSet$1;
12108
-
12109
- function requireSet$1 () {
12110
- if (hasRequiredSet$1) return set$1;
12111
- hasRequiredSet$1 = 1;
12112
- var parent = /*@__PURE__*/ requireSet$2();
12113
- requireWeb_domCollections_iterator();
12114
-
12115
- set$1 = parent;
12116
- return set$1;
13021
+ return web_setTimeout;
12117
13022
  }
12118
13023
 
12119
- var set;
12120
- var hasRequiredSet;
13024
+ var hasRequiredWeb_timers;
12121
13025
 
12122
- function requireSet () {
12123
- if (hasRequiredSet) return set;
12124
- hasRequiredSet = 1;
12125
- set = /*@__PURE__*/ requireSet$1();
12126
- return set;
13026
+ function requireWeb_timers () {
13027
+ if (hasRequiredWeb_timers) return web_timers;
13028
+ hasRequiredWeb_timers = 1;
13029
+ // TODO: Remove this module from `core-js@4` since it's split to modules listed below
13030
+ requireWeb_setInterval();
13031
+ requireWeb_setTimeout();
13032
+ return web_timers;
12127
13033
  }
12128
13034
 
12129
- var setExports = requireSet();
12130
- var _Set = /*@__PURE__*/getDefaultExportFromCjs(setExports);
13035
+ var setTimeout$2;
13036
+ var hasRequiredSetTimeout$1;
12131
13037
 
12132
- var getIterator_1;
12133
- var hasRequiredGetIterator$5;
13038
+ function requireSetTimeout$1 () {
13039
+ if (hasRequiredSetTimeout$1) return setTimeout$2;
13040
+ hasRequiredSetTimeout$1 = 1;
13041
+ requireWeb_timers();
13042
+ var path = /*@__PURE__*/ requirePath();
12134
13043
 
12135
- function requireGetIterator$5 () {
12136
- if (hasRequiredGetIterator$5) return getIterator_1;
12137
- hasRequiredGetIterator$5 = 1;
12138
- requireEs_array_iterator();
12139
- requireEs_string_iterator();
12140
- var getIterator = /*@__PURE__*/ requireGetIterator$6();
13044
+ setTimeout$2 = path.setTimeout;
13045
+ return setTimeout$2;
13046
+ }
12141
13047
 
12142
- getIterator_1 = getIterator;
12143
- return getIterator_1;
13048
+ var setTimeout$1;
13049
+ var hasRequiredSetTimeout;
13050
+
13051
+ function requireSetTimeout () {
13052
+ if (hasRequiredSetTimeout) return setTimeout$1;
13053
+ hasRequiredSetTimeout = 1;
13054
+ setTimeout$1 = /*@__PURE__*/ requireSetTimeout$1();
13055
+ return setTimeout$1;
12144
13056
  }
12145
13057
 
12146
- var getIterator$4;
12147
- var hasRequiredGetIterator$4;
13058
+ var setTimeoutExports = requireSetTimeout();
13059
+ var _setTimeout = /*@__PURE__*/getDefaultExportFromCjs(setTimeoutExports);
12148
13060
 
12149
- function requireGetIterator$4 () {
12150
- if (hasRequiredGetIterator$4) return getIterator$4;
12151
- hasRequiredGetIterator$4 = 1;
12152
- var parent = /*@__PURE__*/ requireGetIterator$5();
12153
- requireWeb_domCollections_iterator();
13061
+ var es_array_splice = {};
12154
13062
 
12155
- getIterator$4 = parent;
12156
- return getIterator$4;
12157
- }
13063
+ var hasRequiredEs_array_splice;
12158
13064
 
12159
- var getIterator$3;
12160
- var hasRequiredGetIterator$3;
13065
+ function requireEs_array_splice () {
13066
+ if (hasRequiredEs_array_splice) return es_array_splice;
13067
+ hasRequiredEs_array_splice = 1;
13068
+ var $ = /*@__PURE__*/ require_export();
13069
+ var toObject = /*@__PURE__*/ requireToObject();
13070
+ var toAbsoluteIndex = /*@__PURE__*/ requireToAbsoluteIndex();
13071
+ var toIntegerOrInfinity = /*@__PURE__*/ requireToIntegerOrInfinity();
13072
+ var lengthOfArrayLike = /*@__PURE__*/ requireLengthOfArrayLike();
13073
+ var setArrayLength = /*@__PURE__*/ requireArraySetLength();
13074
+ var doesNotExceedSafeInteger = /*@__PURE__*/ requireDoesNotExceedSafeInteger();
13075
+ var arraySpeciesCreate = /*@__PURE__*/ requireArraySpeciesCreate();
13076
+ var createProperty = /*@__PURE__*/ requireCreateProperty();
13077
+ var deletePropertyOrThrow = /*@__PURE__*/ requireDeletePropertyOrThrow();
13078
+ var arrayMethodHasSpeciesSupport = /*@__PURE__*/ requireArrayMethodHasSpeciesSupport();
12161
13079
 
12162
- function requireGetIterator$3 () {
12163
- if (hasRequiredGetIterator$3) return getIterator$3;
12164
- hasRequiredGetIterator$3 = 1;
12165
- var parent = /*@__PURE__*/ requireGetIterator$4();
13080
+ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
12166
13081
 
12167
- getIterator$3 = parent;
12168
- return getIterator$3;
13082
+ var max = Math.max;
13083
+ var min = Math.min;
13084
+
13085
+ // `Array.prototype.splice` method
13086
+ // https://tc39.es/ecma262/#sec-array.prototype.splice
13087
+ // with adding support of @@species
13088
+ $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
13089
+ splice: function splice(start, deleteCount /* , ...items */) {
13090
+ var O = toObject(this);
13091
+ var len = lengthOfArrayLike(O);
13092
+ var actualStart = toAbsoluteIndex(start, len);
13093
+ var argumentsLength = arguments.length;
13094
+ var insertCount, actualDeleteCount, A, k, from, to;
13095
+ if (argumentsLength === 0) {
13096
+ insertCount = actualDeleteCount = 0;
13097
+ } else if (argumentsLength === 1) {
13098
+ insertCount = 0;
13099
+ actualDeleteCount = len - actualStart;
13100
+ } else {
13101
+ insertCount = argumentsLength - 2;
13102
+ actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
13103
+ }
13104
+ doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
13105
+ A = arraySpeciesCreate(O, actualDeleteCount);
13106
+ for (k = 0; k < actualDeleteCount; k++) {
13107
+ from = actualStart + k;
13108
+ if (from in O) createProperty(A, k, O[from]);
13109
+ }
13110
+ setArrayLength(A, actualDeleteCount);
13111
+ if (insertCount < actualDeleteCount) {
13112
+ for (k = actualStart; k < len - actualDeleteCount; k++) {
13113
+ from = k + actualDeleteCount;
13114
+ to = k + insertCount;
13115
+ if (from in O) O[to] = O[from];
13116
+ else deletePropertyOrThrow(O, to);
13117
+ }
13118
+ for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
13119
+ } else if (insertCount > actualDeleteCount) {
13120
+ for (k = len - actualDeleteCount; k > actualStart; k--) {
13121
+ from = k + actualDeleteCount - 1;
13122
+ to = k + insertCount - 1;
13123
+ if (from in O) O[to] = O[from];
13124
+ else deletePropertyOrThrow(O, to);
13125
+ }
13126
+ }
13127
+ for (k = 0; k < insertCount; k++) {
13128
+ O[k + actualStart] = arguments[k + 2];
13129
+ }
13130
+ setArrayLength(O, len - actualDeleteCount + insertCount);
13131
+ return A;
13132
+ }
13133
+ });
13134
+ return es_array_splice;
12169
13135
  }
12170
13136
 
12171
- var getIterator$2;
12172
- var hasRequiredGetIterator$2;
13137
+ var splice$3;
13138
+ var hasRequiredSplice$3;
12173
13139
 
12174
- function requireGetIterator$2 () {
12175
- if (hasRequiredGetIterator$2) return getIterator$2;
12176
- hasRequiredGetIterator$2 = 1;
12177
- var parent = /*@__PURE__*/ requireGetIterator$3();
13140
+ function requireSplice$3 () {
13141
+ if (hasRequiredSplice$3) return splice$3;
13142
+ hasRequiredSplice$3 = 1;
13143
+ requireEs_array_splice();
13144
+ var getBuiltInPrototypeMethod = /*@__PURE__*/ requireGetBuiltInPrototypeMethod();
12178
13145
 
12179
- getIterator$2 = parent;
12180
- return getIterator$2;
13146
+ splice$3 = getBuiltInPrototypeMethod('Array', 'splice');
13147
+ return splice$3;
12181
13148
  }
12182
13149
 
12183
- var getIterator$1;
12184
- var hasRequiredGetIterator$1;
13150
+ var splice$2;
13151
+ var hasRequiredSplice$2;
12185
13152
 
12186
- function requireGetIterator$1 () {
12187
- if (hasRequiredGetIterator$1) return getIterator$1;
12188
- hasRequiredGetIterator$1 = 1;
12189
- getIterator$1 = /*@__PURE__*/ requireGetIterator$2();
12190
- return getIterator$1;
12191
- }
13153
+ function requireSplice$2 () {
13154
+ if (hasRequiredSplice$2) return splice$2;
13155
+ hasRequiredSplice$2 = 1;
13156
+ var isPrototypeOf = /*@__PURE__*/ requireObjectIsPrototypeOf();
13157
+ var method = /*@__PURE__*/ requireSplice$3();
12192
13158
 
12193
- var getIterator;
12194
- var hasRequiredGetIterator;
13159
+ var ArrayPrototype = Array.prototype;
12195
13160
 
12196
- function requireGetIterator () {
12197
- if (hasRequiredGetIterator) return getIterator;
12198
- hasRequiredGetIterator = 1;
12199
- getIterator = /*@__PURE__*/ requireGetIterator$1();
12200
- return getIterator;
13161
+ splice$2 = function (it) {
13162
+ var own = it.splice;
13163
+ return it === ArrayPrototype || (isPrototypeOf(ArrayPrototype, it) && own === ArrayPrototype.splice) ? method : own;
13164
+ };
13165
+ return splice$2;
12201
13166
  }
12202
13167
 
12203
- var getIteratorExports = requireGetIterator();
12204
- var _getIterator = /*@__PURE__*/getDefaultExportFromCjs(getIteratorExports);
12205
-
12206
- /**
12207
- * Data stream
12208
- * @remarks
12209
- * {@link DataStream} offers an always up to date stream of items from a {@link DataSet} or {@link DataView}.
12210
- * That means that the stream is evaluated at the time of iteration, conversion to another data type or when {@link cache} is called, not when the {@link DataStream} was created.
12211
- * Multiple invocations of for example {@link toItemArray} may yield different results (if the data source like for example {@link DataSet} gets modified).
12212
- * @typeParam Item - The item type this stream is going to work with.
12213
- */
12214
- class DataStream {
12215
- /**
12216
- * Create a new data stream.
12217
- * @param pairs - The id, item pairs.
12218
- */
12219
- constructor(pairs) {
12220
- this._pairs = pairs;
12221
- }
12222
- /**
12223
- * Return an iterable of key, value pairs for every entry in the stream.
12224
- */
12225
- *[_Symbol$iterator]() {
12226
- for (const [id, item] of this._pairs) {
12227
- yield [id, item];
12228
- }
12229
- }
12230
- /**
12231
- * Return an iterable of key, value pairs for every entry in the stream.
12232
- */
12233
- *entries() {
12234
- for (const [id, item] of this._pairs) {
12235
- yield [id, item];
12236
- }
12237
- }
12238
- /**
12239
- * Return an iterable of keys in the stream.
12240
- */
12241
- *keys() {
12242
- for (const [id] of this._pairs) {
12243
- yield id;
12244
- }
12245
- }
12246
- /**
12247
- * Return an iterable of values in the stream.
12248
- */
12249
- *values() {
12250
- for (const [, item] of this._pairs) {
12251
- yield item;
12252
- }
12253
- }
12254
- /**
12255
- * Return an array containing all the ids in this stream.
12256
- * @remarks
12257
- * The array may contain duplicities.
12258
- * @returns The array with all ids from this stream.
12259
- */
12260
- toIdArray() {
12261
- var _context;
12262
- return _mapInstanceProperty(_context = [...this._pairs]).call(_context, pair => pair[0]);
12263
- }
12264
- /**
12265
- * Return an array containing all the items in this stream.
12266
- * @remarks
12267
- * The array may contain duplicities.
12268
- * @returns The array with all items from this stream.
12269
- */
12270
- toItemArray() {
12271
- var _context2;
12272
- return _mapInstanceProperty(_context2 = [...this._pairs]).call(_context2, pair => pair[1]);
12273
- }
12274
- /**
12275
- * Return an array containing all the entries in this stream.
12276
- * @remarks
12277
- * The array may contain duplicities.
12278
- * @returns The array with all entries from this stream.
12279
- */
12280
- toEntryArray() {
12281
- return [...this._pairs];
12282
- }
12283
- /**
12284
- * Return an object map containing all the items in this stream accessible by ids.
12285
- * @remarks
12286
- * In case of duplicate ids (coerced to string so `7 == '7'`) the last encoutered appears in the returned object.
12287
- * @returns The object map of all id → item pairs from this stream.
12288
- */
12289
- toObjectMap() {
12290
- const map = _Object$create(null);
12291
- for (const [id, item] of this._pairs) {
12292
- map[id] = item;
12293
- }
12294
- return map;
12295
- }
12296
- /**
12297
- * Return a map containing all the items in this stream accessible by ids.
12298
- * @returns The map of all id → item pairs from this stream.
12299
- */
12300
- toMap() {
12301
- return new _Map(this._pairs);
12302
- }
12303
- /**
12304
- * Return a set containing all the (unique) ids in this stream.
12305
- * @returns The set of all ids from this stream.
12306
- */
12307
- toIdSet() {
12308
- return new _Set(this.toIdArray());
12309
- }
12310
- /**
12311
- * Return a set containing all the (unique) items in this stream.
12312
- * @returns The set of all items from this stream.
12313
- */
12314
- toItemSet() {
12315
- return new _Set(this.toItemArray());
12316
- }
13168
+ var splice$1;
13169
+ var hasRequiredSplice$1;
13170
+
13171
+ function requireSplice$1 () {
13172
+ if (hasRequiredSplice$1) return splice$1;
13173
+ hasRequiredSplice$1 = 1;
13174
+ var parent = /*@__PURE__*/ requireSplice$2();
13175
+
13176
+ splice$1 = parent;
13177
+ return splice$1;
13178
+ }
13179
+
13180
+ var splice;
13181
+ var hasRequiredSplice;
13182
+
13183
+ function requireSplice () {
13184
+ if (hasRequiredSplice) return splice;
13185
+ hasRequiredSplice = 1;
13186
+ splice = /*@__PURE__*/ requireSplice$1();
13187
+ return splice;
13188
+ }
13189
+
13190
+ var spliceExports = requireSplice();
13191
+ var _spliceInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(spliceExports);
13192
+
13193
+ /**
13194
+ * A queue.
13195
+ * @typeParam T - The type of method names to be replaced by queued versions.
13196
+ */
13197
+ class Queue {
12317
13198
  /**
12318
- * Cache the items from this stream.
12319
- * @remarks
12320
- * This method allows for items to be fetched immediatelly and used (possibly multiple times) later.
12321
- * It can also be used to optimize performance as {@link DataStream} would otherwise reevaluate everything upon each iteration.
12322
- *
12323
- * ## Example
12324
- * ```javascript
12325
- * const ds = new DataSet([…])
12326
- *
12327
- * const cachedStream = ds.stream()
12328
- * .filter(…)
12329
- * .sort(…)
12330
- * .map(…)
12331
- * .cached(…) // Data are fetched, processed and cached here.
12332
- *
12333
- * ds.clear()
12334
- * chachedStream // Still has all the items.
12335
- * ```
12336
- * @returns A new {@link DataStream} with cached items (detached from the original {@link DataSet}).
13199
+ * Construct a new Queue.
13200
+ * @param options - Queue configuration.
12337
13201
  */
12338
- cache() {
12339
- return new DataStream([...this._pairs]);
13202
+ constructor(options) {
13203
+ /** Delay in milliseconds. If defined the queue will be periodically flushed. */
13204
+ /** Maximum number of entries in the queue before it will be flushed. */
13205
+ _defineProperty(this, "_queue", []);
13206
+ _defineProperty(this, "_timeout", null);
13207
+ _defineProperty(this, "_extended", null);
13208
+ // options
13209
+ this.delay = null;
13210
+ this.max = Infinity;
13211
+ this.setOptions(options);
12340
13212
  }
12341
13213
  /**
12342
- * Get the distinct values of given property.
12343
- * @param callback - The function that picks and possibly converts the property.
12344
- * @typeParam T - The type of the distinct value.
12345
- * @returns A set of all distinct properties.
13214
+ * Update the configuration of the queue.
13215
+ * @param options - Queue configuration.
12346
13216
  */
12347
- distinct(callback) {
12348
- const set = new _Set();
12349
- for (const [id, item] of this._pairs) {
12350
- set.add(callback(item, id));
13217
+ setOptions(options) {
13218
+ if (options && typeof options.delay !== "undefined") {
13219
+ this.delay = options.delay;
12351
13220
  }
12352
- return set;
13221
+ if (options && typeof options.max !== "undefined") {
13222
+ this.max = options.max;
13223
+ }
13224
+ this._flushIfNeeded();
12353
13225
  }
12354
13226
  /**
12355
- * Filter the items of the stream.
12356
- * @param callback - The function that decides whether an item will be included.
12357
- * @returns A new data stream with the filtered items.
13227
+ * Extend an object with queuing functionality.
13228
+ * The object will be extended with a function flush, and the methods provided in options.replace will be replaced with queued ones.
13229
+ * @param object - The object to be extended.
13230
+ * @param options - Additional options.
13231
+ * @returns The created queue.
12358
13232
  */
12359
- filter(callback) {
12360
- const pairs = this._pairs;
12361
- return new DataStream({
12362
- *[_Symbol$iterator]() {
12363
- for (const [id, item] of pairs) {
12364
- if (callback(item, id)) {
12365
- yield [id, item];
12366
- }
12367
- }
13233
+ static extend(object, options) {
13234
+ const queue = new Queue(options);
13235
+ if (object.flush !== undefined) {
13236
+ throw new Error("Target object already has a property flush");
13237
+ }
13238
+ object.flush = () => {
13239
+ queue.flush();
13240
+ };
13241
+ const methods = [{
13242
+ name: "flush",
13243
+ original: undefined
13244
+ }];
13245
+ if (options && options.replace) {
13246
+ for (let i = 0; i < options.replace.length; i++) {
13247
+ const name = options.replace[i];
13248
+ methods.push({
13249
+ name: name,
13250
+ // @TODO: better solution?
13251
+ original: object[name]
13252
+ });
13253
+ // @TODO: better solution?
13254
+ queue.replace(object, name);
12368
13255
  }
12369
- });
12370
- }
12371
- /**
12372
- * Execute a callback for each item of the stream.
12373
- * @param callback - The function that will be invoked for each item.
12374
- */
12375
- forEach(callback) {
12376
- for (const [id, item] of this._pairs) {
12377
- callback(item, id);
12378
13256
  }
13257
+ queue._extended = {
13258
+ object: object,
13259
+ methods: methods
13260
+ };
13261
+ return queue;
12379
13262
  }
12380
13263
  /**
12381
- * Map the items into a different type.
12382
- * @param callback - The function that does the conversion.
12383
- * @typeParam Mapped - The type of the item after mapping.
12384
- * @returns A new data stream with the mapped items.
13264
+ * Destroy the queue. The queue will first flush all queued actions, and in case it has extended an object, will restore the original object.
12385
13265
  */
12386
- map(callback) {
12387
- const pairs = this._pairs;
12388
- return new DataStream({
12389
- *[_Symbol$iterator]() {
12390
- for (const [id, item] of pairs) {
12391
- yield [id, callback(item, id)];
13266
+ destroy() {
13267
+ this.flush();
13268
+ if (this._extended) {
13269
+ const object = this._extended.object;
13270
+ const methods = this._extended.methods;
13271
+ for (let i = 0; i < methods.length; i++) {
13272
+ const method = methods[i];
13273
+ if (method.original) {
13274
+ // @TODO: better solution?
13275
+ object[method.name] = method.original;
13276
+ } else {
13277
+ // @TODO: better solution?
13278
+ delete object[method.name];
12392
13279
  }
12393
13280
  }
12394
- });
13281
+ this._extended = null;
13282
+ }
12395
13283
  }
12396
13284
  /**
12397
- * Get the item with the maximum value of given property.
12398
- * @param callback - The function that picks and possibly converts the property.
12399
- * @returns The item with the maximum if found otherwise null.
13285
+ * Replace a method on an object with a queued version.
13286
+ * @param object - Object having the method.
13287
+ * @param method - The method name.
12400
13288
  */
12401
- max(callback) {
12402
- const iter = _getIterator(this._pairs);
12403
- let curr = iter.next();
12404
- if (curr.done) {
12405
- return null;
13289
+ replace(object, method) {
13290
+ /* eslint-disable-next-line @typescript-eslint/no-this-alias -- Function this is necessary in the function bellow, so class this has to be saved into a variable here. */
13291
+ const me = this;
13292
+ const original = object[method];
13293
+ if (!original) {
13294
+ throw new Error("Method " + method + " undefined");
12406
13295
  }
12407
- let maxItem = curr.value[1];
12408
- let maxValue = callback(curr.value[1], curr.value[0]);
12409
- while (!(curr = iter.next()).done) {
12410
- const [id, item] = curr.value;
12411
- const value = callback(item, id);
12412
- if (value > maxValue) {
12413
- maxValue = value;
12414
- maxItem = item;
13296
+ object[method] = function () {
13297
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
13298
+ args[_key] = arguments[_key];
12415
13299
  }
12416
- }
12417
- return maxItem;
13300
+ // add this call to the queue
13301
+ me.queue({
13302
+ args: args,
13303
+ fn: original,
13304
+ context: this
13305
+ });
13306
+ };
12418
13307
  }
12419
13308
  /**
12420
- * Get the item with the minimum value of given property.
12421
- * @param callback - The function that picks and possibly converts the property.
12422
- * @returns The item with the minimum if found otherwise null.
13309
+ * Queue a call.
13310
+ * @param entry - The function or entry to be queued.
12423
13311
  */
12424
- min(callback) {
12425
- const iter = _getIterator(this._pairs);
12426
- let curr = iter.next();
12427
- if (curr.done) {
12428
- return null;
12429
- }
12430
- let minItem = curr.value[1];
12431
- let minValue = callback(curr.value[1], curr.value[0]);
12432
- while (!(curr = iter.next()).done) {
12433
- const [id, item] = curr.value;
12434
- const value = callback(item, id);
12435
- if (value < minValue) {
12436
- minValue = value;
12437
- minItem = item;
12438
- }
13312
+ queue(entry) {
13313
+ if (typeof entry === "function") {
13314
+ this._queue.push({
13315
+ fn: entry
13316
+ });
13317
+ } else {
13318
+ this._queue.push(entry);
12439
13319
  }
12440
- return minItem;
13320
+ this._flushIfNeeded();
12441
13321
  }
12442
13322
  /**
12443
- * Reduce the items into a single value.
12444
- * @param callback - The function that does the reduction.
12445
- * @param accumulator - The initial value of the accumulator.
12446
- * @typeParam T - The type of the accumulated value.
12447
- * @returns The reduced value.
13323
+ * Check whether the queue needs to be flushed.
12448
13324
  */
12449
- reduce(callback, accumulator) {
12450
- for (const [id, item] of this._pairs) {
12451
- accumulator = callback(accumulator, item, id);
13325
+ _flushIfNeeded() {
13326
+ // flush when the maximum is exceeded.
13327
+ if (this._queue.length > this.max) {
13328
+ this.flush();
13329
+ }
13330
+ // flush after a period of inactivity when a delay is configured
13331
+ if (this._timeout != null) {
13332
+ clearTimeout(this._timeout);
13333
+ this._timeout = null;
13334
+ }
13335
+ if (this.queue.length > 0 && typeof this.delay === "number") {
13336
+ this._timeout = _setTimeout(() => {
13337
+ this.flush();
13338
+ }, this.delay);
12452
13339
  }
12453
- return accumulator;
12454
13340
  }
12455
13341
  /**
12456
- * Sort the items.
12457
- * @param callback - Item comparator.
12458
- * @returns A new stream with sorted items.
13342
+ * Flush all queued calls
12459
13343
  */
12460
- sort(callback) {
12461
- return new DataStream({
12462
- [_Symbol$iterator]: () => {
12463
- var _context3;
12464
- return _getIterator(_sortInstanceProperty(_context3 = [...this._pairs]).call(_context3, (_ref, _ref2) => {
12465
- let [idA, itemA] = _ref;
12466
- let [idB, itemB] = _ref2;
12467
- return callback(itemA, itemB, idA, idB);
12468
- }));
12469
- }
13344
+ flush() {
13345
+ var _context, _context2;
13346
+ _forEachInstanceProperty(_context = _spliceInstanceProperty(_context2 = this._queue).call(_context2, 0)).call(_context, entry => {
13347
+ entry.fn.apply(entry.context || entry.fn, entry.args || []);
12470
13348
  });
12471
13349
  }
12472
13350
  }
@@ -12566,7 +13444,7 @@
12566
13444
  super();
12567
13445
  // correctly read optional arguments
12568
13446
  _defineProperty(this, "_queue", null);
12569
- if (data && !_Array$isArray(data)) {
13447
+ if (data && !_Array$isArray$1(data)) {
12570
13448
  options = data;
12571
13449
  data = [];
12572
13450
  }
@@ -12633,7 +13511,7 @@
12633
13511
  add(data, senderId) {
12634
13512
  const addedIds = [];
12635
13513
  let id;
12636
- if (_Array$isArray(data)) {
13514
+ if (_Array$isArray$1(data)) {
12637
13515
  // Array
12638
13516
  const idsToAdd = _mapInstanceProperty(data).call(data, d => d[this._idProp]);
12639
13517
  if (_someInstanceProperty(idsToAdd).call(idsToAdd, id => this._data.has(id))) {
@@ -12712,7 +13590,7 @@
12712
13590
  addedIds.push(id);
12713
13591
  }
12714
13592
  };
12715
- if (_Array$isArray(data)) {
13593
+ if (_Array$isArray$1(data)) {
12716
13594
  // Array
12717
13595
  for (let i = 0, len = data.length; i < len; i++) {
12718
13596
  if (data[i] && typeof data[i] === "object") {
@@ -12784,7 +13662,7 @@
12784
13662
  */
12785
13663
  updateOnly(data, senderId) {
12786
13664
  var _context;
12787
- if (!_Array$isArray(data)) {
13665
+ if (!_Array$isArray$1(data)) {
12788
13666
  data = [data];
12789
13667
  }
12790
13668
  const updateEventData = _mapInstanceProperty(_context = _mapInstanceProperty(data).call(data, update => {
@@ -12797,10 +13675,8 @@
12797
13675
  update
12798
13676
  };
12799
13677
  })).call(_context, _ref => {
12800
- let {
12801
- oldData,
12802
- update
12803
- } = _ref;
13678
+ let oldData = _ref.oldData,
13679
+ update = _ref.update;
12804
13680
  const id = oldData[this._idProp];
12805
13681
  const updatedData = pureDeepObjectAssign(oldData, update);
12806
13682
  this._data.set(id, updatedData);
@@ -12840,7 +13716,7 @@
12840
13716
  // get(id [, options])
12841
13717
  id = first;
12842
13718
  options = second;
12843
- } else if (_Array$isArray(first)) {
13719
+ } else if (_Array$isArray$1(first)) {
12844
13720
  // get(ids [, options])
12845
13721
  ids = first;
12846
13722
  options = second;
@@ -13050,7 +13926,7 @@
13050
13926
  // item is null
13051
13927
  return item;
13052
13928
  }
13053
- return _reduceInstanceProperty(_context3 = _Array$isArray(fields) ?
13929
+ return _reduceInstanceProperty(_context3 = _Array$isArray$1(fields) ?
13054
13930
  // Use the supplied array
13055
13931
  fields :
13056
13932
  // Use the keys of the supplied object
@@ -13113,7 +13989,7 @@
13113
13989
  const removedIds = [];
13114
13990
  const removedItems = [];
13115
13991
  // force everything to be an array for simplicity
13116
- const ids = _Array$isArray(id) ? id : [id];
13992
+ const ids = _Array$isArray$1(id) ? id : [id];
13117
13993
  for (let i = 0, len = ids.length; i < len; i++) {
13118
13994
  const item = this._remove(ids[i]);
13119
13995
  if (item) {
@@ -13535,7 +14411,7 @@
13535
14411
  // parse the arguments
13536
14412
  let ids = null;
13537
14413
  let options;
13538
- if (isId(first) || _Array$isArray(first)) {
14414
+ if (isId(first) || _Array$isArray$1(first)) {
13539
14415
  ids = first;
13540
14416
  options = second;
13541
14417
  } else {