vis-data 8.0.3 → 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 +1609 -743
  11. package/dist/esm.js.map +1 -1
  12. package/dist/umd.js +1609 -743
  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 +133 -138
  31. package/peer/esm/vis-data.js +1450 -685
  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 -685
  38. package/peer/esm/vis-data.mjs.map +1 -1
  39. package/peer/umd/vis-data.cjs +1450 -685
  40. package/peer/umd/vis-data.cjs.map +1 -1
  41. package/peer/umd/vis-data.js +1450 -685
  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 -685
  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 -685
  54. package/standalone/esm/vis-data.mjs.map +1 -1
  55. package/standalone/umd/vis-data.cjs +1450 -685
  56. package/standalone/umd/vis-data.cjs.map +1 -1
  57. package/standalone/umd/vis-data.js +1450 -685
  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.3
8
- * @date 2025-09-10T16:22:34.710Z
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);
@@ -10815,21 +11051,17 @@
10815
11051
  byteToHex[arr[offset + 15]]).toLowerCase();
10816
11052
  }
10817
11053
 
10818
- let getRandomValues;
10819
11054
  const rnds8 = new Uint8Array(16);
10820
11055
  function rng() {
10821
- if (!getRandomValues) {
10822
- if (typeof crypto === 'undefined' || !crypto.getRandomValues) {
10823
- throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
10824
- }
10825
- getRandomValues = crypto.getRandomValues.bind(crypto);
10826
- }
10827
- return getRandomValues(rnds8);
11056
+ return crypto.getRandomValues(rnds8);
10828
11057
  }
10829
11058
 
10830
- const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto);
10831
- var native = { randomUUID };
10832
-
11059
+ function v4(options, buf, offset) {
11060
+ if (crypto.randomUUID) {
11061
+ return crypto.randomUUID();
11062
+ }
11063
+ return _v4(options);
11064
+ }
10833
11065
  function _v4(options, buf, offset) {
10834
11066
  options = options || {};
10835
11067
  const rnds = options.random ?? options.rng?.() ?? rng();
@@ -10840,12 +11072,6 @@
10840
11072
  rnds[8] = (rnds[8] & 0x3f) | 0x80;
10841
11073
  return unsafeStringify(rnds);
10842
11074
  }
10843
- function v4(options, buf, offset) {
10844
- if (native.randomUUID && true && !options) {
10845
- return native.randomUUID();
10846
- }
10847
- return _v4(options);
10848
- }
10849
11075
 
10850
11076
  /**
10851
11077
  * Determine whether a value can be used as an id.
@@ -10856,529 +11082,712 @@
10856
11082
  return typeof value === "string" || typeof value === "number";
10857
11083
  }
10858
11084
 
10859
- var web_timers = {};
10860
-
10861
- var web_setInterval = {};
10862
-
10863
- var validateArgumentsLength;
10864
- var hasRequiredValidateArgumentsLength;
10865
-
10866
- function requireValidateArgumentsLength () {
10867
- if (hasRequiredValidateArgumentsLength) return validateArgumentsLength;
10868
- hasRequiredValidateArgumentsLength = 1;
10869
- var $TypeError = TypeError;
10870
-
10871
- validateArgumentsLength = function (passed, required) {
10872
- if (passed < required) throw new $TypeError('Not enough arguments');
10873
- return passed;
10874
- };
10875
- return validateArgumentsLength;
10876
- }
10877
-
10878
- var schedulersFix;
10879
- var hasRequiredSchedulersFix;
10880
-
10881
- function requireSchedulersFix () {
10882
- if (hasRequiredSchedulersFix) return schedulersFix;
10883
- hasRequiredSchedulersFix = 1;
10884
- var globalThis = /*@__PURE__*/ requireGlobalThis();
10885
- var apply = /*@__PURE__*/ requireFunctionApply();
10886
- var isCallable = /*@__PURE__*/ requireIsCallable();
10887
- var ENVIRONMENT = /*@__PURE__*/ requireEnvironment();
10888
- var USER_AGENT = /*@__PURE__*/ requireEnvironmentUserAgent();
10889
- var arraySlice = /*@__PURE__*/ requireArraySlice();
10890
- var validateArgumentsLength = /*@__PURE__*/ requireValidateArgumentsLength();
10891
-
10892
- var Function = globalThis.Function;
10893
- // dirty IE9- and Bun 0.3.0- checks
10894
- var WRAP = /MSIE .\./.test(USER_AGENT) || ENVIRONMENT === 'BUN' && (function () {
10895
- var version = globalThis.Bun.version.split('.');
10896
- return version.length < 3 || version[0] === '0' && (version[1] < 3 || version[1] === '3' && version[2] === '0');
10897
- })();
10898
-
10899
- // IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix
10900
- // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
10901
- // https://github.com/oven-sh/bun/issues/1633
10902
- schedulersFix = function (scheduler, hasTimeArg) {
10903
- var firstParamIndex = hasTimeArg ? 2 : 1;
10904
- return WRAP ? function (handler, timeout /* , ...arguments */) {
10905
- var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;
10906
- var fn = isCallable(handler) ? handler : Function(handler);
10907
- var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];
10908
- var callback = boundArgs ? function () {
10909
- apply(fn, this, params);
10910
- } : fn;
10911
- return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);
10912
- } : scheduler;
10913
- };
10914
- return schedulersFix;
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
+ }
10915
11144
  }
10916
11145
 
10917
- var hasRequiredWeb_setInterval;
10918
-
10919
- function requireWeb_setInterval () {
10920
- if (hasRequiredWeb_setInterval) return web_setInterval;
10921
- hasRequiredWeb_setInterval = 1;
10922
- var $ = /*@__PURE__*/ require_export();
10923
- var globalThis = /*@__PURE__*/ requireGlobalThis();
10924
- var schedulersFix = /*@__PURE__*/ requireSchedulersFix();
11146
+ var isArray$2;
11147
+ var hasRequiredIsArray$2;
10925
11148
 
10926
- var setInterval = schedulersFix(globalThis.setInterval, true);
11149
+ function requireIsArray$2 () {
11150
+ if (hasRequiredIsArray$2) return isArray$2;
11151
+ hasRequiredIsArray$2 = 1;
11152
+ var parent = /*@__PURE__*/ requireIsArray$4();
10927
11153
 
10928
- // Bun / IE9- setInterval additional parameters fix
10929
- // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
10930
- $({ global: true, bind: true, forced: globalThis.setInterval !== setInterval }, {
10931
- setInterval: setInterval
10932
- });
10933
- return web_setInterval;
11154
+ isArray$2 = parent;
11155
+ return isArray$2;
10934
11156
  }
10935
11157
 
10936
- var web_setTimeout = {};
11158
+ var isArray$1;
11159
+ var hasRequiredIsArray$1;
10937
11160
 
10938
- var hasRequiredWeb_setTimeout;
11161
+ function requireIsArray$1 () {
11162
+ if (hasRequiredIsArray$1) return isArray$1;
11163
+ hasRequiredIsArray$1 = 1;
11164
+ var parent = /*@__PURE__*/ requireIsArray$2();
10939
11165
 
10940
- function requireWeb_setTimeout () {
10941
- if (hasRequiredWeb_setTimeout) return web_setTimeout;
10942
- hasRequiredWeb_setTimeout = 1;
10943
- var $ = /*@__PURE__*/ require_export();
10944
- var globalThis = /*@__PURE__*/ requireGlobalThis();
10945
- var schedulersFix = /*@__PURE__*/ requireSchedulersFix();
11166
+ isArray$1 = parent;
11167
+ return isArray$1;
11168
+ }
10946
11169
 
10947
- var setTimeout = schedulersFix(globalThis.setTimeout, true);
11170
+ var isArray;
11171
+ var hasRequiredIsArray;
10948
11172
 
10949
- // Bun / IE9- setTimeout additional parameters fix
10950
- // https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
10951
- $({ global: true, bind: true, forced: globalThis.setTimeout !== setTimeout }, {
10952
- setTimeout: setTimeout
10953
- });
10954
- return web_setTimeout;
11173
+ function requireIsArray () {
11174
+ if (hasRequiredIsArray) return isArray;
11175
+ hasRequiredIsArray = 1;
11176
+ isArray = /*@__PURE__*/ requireIsArray$1();
11177
+ return isArray;
10955
11178
  }
10956
11179
 
10957
- var hasRequiredWeb_timers;
11180
+ var isArrayExports = /*@__PURE__*/ requireIsArray();
11181
+ var _Array$isArray = /*@__PURE__*/getDefaultExportFromCjs(isArrayExports);
10958
11182
 
10959
- function requireWeb_timers () {
10960
- if (hasRequiredWeb_timers) return web_timers;
10961
- hasRequiredWeb_timers = 1;
10962
- // TODO: Remove this module from `core-js@4` since it's split to modules listed below
10963
- requireWeb_setInterval();
10964
- requireWeb_setTimeout();
10965
- return web_timers;
11183
+ function _arrayWithHoles(r) {
11184
+ if (_Array$isArray(r)) return r;
10966
11185
  }
10967
11186
 
10968
- var setTimeout$2;
10969
- var hasRequiredSetTimeout$1;
11187
+ var getIteratorMethod_1;
11188
+ var hasRequiredGetIteratorMethod$4;
10970
11189
 
10971
- function requireSetTimeout$1 () {
10972
- if (hasRequiredSetTimeout$1) return setTimeout$2;
10973
- hasRequiredSetTimeout$1 = 1;
10974
- requireWeb_timers();
10975
- var path = /*@__PURE__*/ requirePath();
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();
10976
11196
 
10977
- setTimeout$2 = path.setTimeout;
10978
- return setTimeout$2;
11197
+ getIteratorMethod_1 = getIteratorMethod;
11198
+ return getIteratorMethod_1;
10979
11199
  }
10980
11200
 
10981
- var setTimeout$1;
10982
- var hasRequiredSetTimeout;
11201
+ var getIteratorMethod$3;
11202
+ var hasRequiredGetIteratorMethod$3;
10983
11203
 
10984
- function requireSetTimeout () {
10985
- if (hasRequiredSetTimeout) return setTimeout$1;
10986
- hasRequiredSetTimeout = 1;
10987
- setTimeout$1 = /*@__PURE__*/ requireSetTimeout$1();
10988
- return setTimeout$1;
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;
10989
11212
  }
10990
11213
 
10991
- var setTimeoutExports = requireSetTimeout();
10992
- var _setTimeout = /*@__PURE__*/getDefaultExportFromCjs(setTimeoutExports);
11214
+ var getIteratorMethod$2;
11215
+ var hasRequiredGetIteratorMethod$2;
10993
11216
 
10994
- var es_array_splice = {};
11217
+ function requireGetIteratorMethod$2 () {
11218
+ if (hasRequiredGetIteratorMethod$2) return getIteratorMethod$2;
11219
+ hasRequiredGetIteratorMethod$2 = 1;
11220
+ var parent = /*@__PURE__*/ requireGetIteratorMethod$3();
10995
11221
 
10996
- var arraySetLength;
10997
- var hasRequiredArraySetLength;
11222
+ getIteratorMethod$2 = parent;
11223
+ return getIteratorMethod$2;
11224
+ }
10998
11225
 
10999
- function requireArraySetLength () {
11000
- if (hasRequiredArraySetLength) return arraySetLength;
11001
- hasRequiredArraySetLength = 1;
11002
- var DESCRIPTORS = /*@__PURE__*/ requireDescriptors();
11003
- var isArray = /*@__PURE__*/ requireIsArray$3();
11226
+ var getIteratorMethod$1;
11227
+ var hasRequiredGetIteratorMethod$1;
11004
11228
 
11005
- var $TypeError = TypeError;
11006
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
11007
- var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
11229
+ function requireGetIteratorMethod$1 () {
11230
+ if (hasRequiredGetIteratorMethod$1) return getIteratorMethod$1;
11231
+ hasRequiredGetIteratorMethod$1 = 1;
11232
+ var parent = /*@__PURE__*/ requireGetIteratorMethod$2();
11008
11233
 
11009
- // Safari < 13 does not throw an error in this case
11010
- var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
11011
- // makes no sense without proper strict mode support
11012
- if (this !== undefined) return true;
11013
- try {
11014
- // eslint-disable-next-line es/no-object-defineproperty -- safe
11015
- Object.defineProperty([], 'length', { writable: false }).length = 1;
11016
- } catch (error) {
11017
- return error instanceof TypeError;
11018
- }
11019
- }();
11234
+ getIteratorMethod$1 = parent;
11235
+ return getIteratorMethod$1;
11236
+ }
11020
11237
 
11021
- arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
11022
- if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
11023
- throw new $TypeError('Cannot set read only .length');
11024
- } return O.length = length;
11025
- } : function (O, length) {
11026
- return O.length = length;
11027
- };
11028
- return arraySetLength;
11238
+ var getIteratorMethod;
11239
+ var hasRequiredGetIteratorMethod;
11240
+
11241
+ function requireGetIteratorMethod () {
11242
+ if (hasRequiredGetIteratorMethod) return getIteratorMethod;
11243
+ hasRequiredGetIteratorMethod = 1;
11244
+ getIteratorMethod = /*@__PURE__*/ requireGetIteratorMethod$1();
11245
+ return getIteratorMethod;
11029
11246
  }
11030
11247
 
11031
- var hasRequiredEs_array_splice;
11248
+ var getIteratorMethodExports = /*@__PURE__*/ requireGetIteratorMethod();
11249
+ var _getIteratorMethod = /*@__PURE__*/getDefaultExportFromCjs(getIteratorMethodExports);
11032
11250
 
11033
- function requireEs_array_splice () {
11034
- if (hasRequiredEs_array_splice) return es_array_splice;
11035
- hasRequiredEs_array_splice = 1;
11251
+ var es_array_push = {};
11252
+
11253
+ var hasRequiredEs_array_push;
11254
+
11255
+ function requireEs_array_push () {
11256
+ if (hasRequiredEs_array_push) return es_array_push;
11257
+ hasRequiredEs_array_push = 1;
11036
11258
  var $ = /*@__PURE__*/ require_export();
11037
11259
  var toObject = /*@__PURE__*/ requireToObject();
11038
- var toAbsoluteIndex = /*@__PURE__*/ requireToAbsoluteIndex();
11039
- var toIntegerOrInfinity = /*@__PURE__*/ requireToIntegerOrInfinity();
11040
11260
  var lengthOfArrayLike = /*@__PURE__*/ requireLengthOfArrayLike();
11041
11261
  var setArrayLength = /*@__PURE__*/ requireArraySetLength();
11042
11262
  var doesNotExceedSafeInteger = /*@__PURE__*/ requireDoesNotExceedSafeInteger();
11043
- var arraySpeciesCreate = /*@__PURE__*/ requireArraySpeciesCreate();
11044
- var createProperty = /*@__PURE__*/ requireCreateProperty();
11045
- var deletePropertyOrThrow = /*@__PURE__*/ requireDeletePropertyOrThrow();
11046
- var arrayMethodHasSpeciesSupport = /*@__PURE__*/ requireArrayMethodHasSpeciesSupport();
11263
+ var fails = /*@__PURE__*/ requireFails();
11047
11264
 
11048
- var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
11265
+ var INCORRECT_TO_LENGTH = fails(function () {
11266
+ return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
11267
+ });
11049
11268
 
11050
- var max = Math.max;
11051
- var min = Math.min;
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 () {
11272
+ try {
11273
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
11274
+ Object.defineProperty([], 'length', { writable: false }).push();
11275
+ } catch (error) {
11276
+ return error instanceof TypeError;
11277
+ }
11278
+ };
11052
11279
 
11053
- // `Array.prototype.splice` method
11054
- // https://tc39.es/ecma262/#sec-array.prototype.splice
11055
- // with adding support of @@species
11056
- $({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
11057
- splice: function splice(start, deleteCount /* , ...items */) {
11280
+ var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
11281
+
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) {
11058
11287
  var O = toObject(this);
11059
11288
  var len = lengthOfArrayLike(O);
11060
- var actualStart = toAbsoluteIndex(start, len);
11061
- var argumentsLength = arguments.length;
11062
- var insertCount, actualDeleteCount, A, k, from, to;
11063
- if (argumentsLength === 0) {
11064
- insertCount = actualDeleteCount = 0;
11065
- } else if (argumentsLength === 1) {
11066
- insertCount = 0;
11067
- actualDeleteCount = len - actualStart;
11068
- } else {
11069
- insertCount = argumentsLength - 2;
11070
- actualDeleteCount = min(max(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
11071
- }
11072
- doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
11073
- A = arraySpeciesCreate(O, actualDeleteCount);
11074
- for (k = 0; k < actualDeleteCount; k++) {
11075
- from = actualStart + k;
11076
- if (from in O) createProperty(A, k, O[from]);
11077
- }
11078
- A.length = actualDeleteCount;
11079
- if (insertCount < actualDeleteCount) {
11080
- for (k = actualStart; k < len - actualDeleteCount; k++) {
11081
- from = k + actualDeleteCount;
11082
- to = k + insertCount;
11083
- if (from in O) O[to] = O[from];
11084
- else deletePropertyOrThrow(O, to);
11085
- }
11086
- for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow(O, k - 1);
11087
- } else if (insertCount > actualDeleteCount) {
11088
- for (k = len - actualDeleteCount; k > actualStart; k--) {
11089
- from = k + actualDeleteCount - 1;
11090
- to = k + insertCount - 1;
11091
- if (from in O) O[to] = O[from];
11092
- else deletePropertyOrThrow(O, to);
11093
- }
11289
+ var argCount = arguments.length;
11290
+ doesNotExceedSafeInteger(len + argCount);
11291
+ for (var i = 0; i < argCount; i++) {
11292
+ O[len] = arguments[i];
11293
+ len++;
11094
11294
  }
11095
- for (k = 0; k < insertCount; k++) {
11096
- O[k + actualStart] = arguments[k + 2];
11097
- }
11098
- setArrayLength(O, len - actualDeleteCount + insertCount);
11099
- return A;
11295
+ setArrayLength(O, len);
11296
+ return len;
11100
11297
  }
11101
11298
  });
11102
- return es_array_splice;
11299
+ return es_array_push;
11103
11300
  }
11104
11301
 
11105
- var splice$3;
11106
- var hasRequiredSplice$3;
11302
+ var push$5;
11303
+ var hasRequiredPush$5;
11107
11304
 
11108
- function requireSplice$3 () {
11109
- if (hasRequiredSplice$3) return splice$3;
11110
- hasRequiredSplice$3 = 1;
11111
- requireEs_array_splice();
11305
+ function requirePush$5 () {
11306
+ if (hasRequiredPush$5) return push$5;
11307
+ hasRequiredPush$5 = 1;
11308
+ requireEs_array_push();
11112
11309
  var getBuiltInPrototypeMethod = /*@__PURE__*/ requireGetBuiltInPrototypeMethod();
11113
11310
 
11114
- splice$3 = getBuiltInPrototypeMethod('Array', 'splice');
11115
- return splice$3;
11311
+ push$5 = getBuiltInPrototypeMethod('Array', 'push');
11312
+ return push$5;
11116
11313
  }
11117
11314
 
11118
- var splice$2;
11119
- var hasRequiredSplice$2;
11315
+ var push$4;
11316
+ var hasRequiredPush$4;
11120
11317
 
11121
- function requireSplice$2 () {
11122
- if (hasRequiredSplice$2) return splice$2;
11123
- hasRequiredSplice$2 = 1;
11318
+ function requirePush$4 () {
11319
+ if (hasRequiredPush$4) return push$4;
11320
+ hasRequiredPush$4 = 1;
11124
11321
  var isPrototypeOf = /*@__PURE__*/ requireObjectIsPrototypeOf();
11125
- var method = /*@__PURE__*/ requireSplice$3();
11322
+ var method = /*@__PURE__*/ requirePush$5();
11126
11323
 
11127
11324
  var ArrayPrototype = Array.prototype;
11128
11325
 
11129
- splice$2 = function (it) {
11130
- var own = it.splice;
11131
- 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;
11132
11329
  };
11133
- return splice$2;
11330
+ return push$4;
11134
11331
  }
11135
11332
 
11136
- var splice$1;
11137
- var hasRequiredSplice$1;
11333
+ var push$3;
11334
+ var hasRequiredPush$3;
11138
11335
 
11139
- function requireSplice$1 () {
11140
- if (hasRequiredSplice$1) return splice$1;
11141
- hasRequiredSplice$1 = 1;
11142
- 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();
11143
11340
 
11144
- splice$1 = parent;
11145
- return splice$1;
11341
+ push$3 = parent;
11342
+ return push$3;
11146
11343
  }
11147
11344
 
11148
- var splice;
11149
- var hasRequiredSplice;
11345
+ var push$2;
11346
+ var hasRequiredPush$2;
11150
11347
 
11151
- function requireSplice () {
11152
- if (hasRequiredSplice) return splice;
11153
- hasRequiredSplice = 1;
11154
- splice = /*@__PURE__*/ requireSplice$1();
11155
- 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;
11156
11355
  }
11157
11356
 
11158
- var spliceExports = requireSplice();
11159
- var _spliceInstanceProperty = /*@__PURE__*/getDefaultExportFromCjs(spliceExports);
11357
+ var push$1;
11358
+ var hasRequiredPush$1;
11160
11359
 
11161
- /**
11162
- * A queue.
11163
- * @typeParam T - The type of method names to be replaced by queued versions.
11164
- */
11165
- class Queue {
11166
- /**
11167
- * Construct a new Queue.
11168
- * @param options - Queue configuration.
11169
- */
11170
- constructor(options) {
11171
- /** Delay in milliseconds. If defined the queue will be periodically flushed. */
11172
- /** Maximum number of entries in the queue before it will be flushed. */
11173
- _defineProperty(this, "_queue", []);
11174
- _defineProperty(this, "_timeout", null);
11175
- _defineProperty(this, "_extended", null);
11176
- // options
11177
- this.delay = null;
11178
- this.max = Infinity;
11179
- this.setOptions(options);
11180
- }
11181
- /**
11182
- * Update the configuration of the queue.
11183
- * @param options - Queue configuration.
11184
- */
11185
- setOptions(options) {
11186
- if (options && typeof options.delay !== "undefined") {
11187
- this.delay = options.delay;
11188
- }
11189
- if (options && typeof options.max !== "undefined") {
11190
- this.max = options.max;
11191
- }
11192
- this._flushIfNeeded();
11193
- }
11194
- /**
11195
- * Extend an object with queuing functionality.
11196
- * The object will be extended with a function flush, and the methods provided in options.replace will be replaced with queued ones.
11197
- * @param object - The object to be extended.
11198
- * @param options - Additional options.
11199
- * @returns The created queue.
11200
- */
11201
- static extend(object, options) {
11202
- const queue = new Queue(options);
11203
- if (object.flush !== undefined) {
11204
- throw new Error("Target object already has a property flush");
11205
- }
11206
- object.flush = () => {
11207
- queue.flush();
11208
- };
11209
- const methods = [{
11210
- name: "flush",
11211
- original: undefined
11212
- }];
11213
- if (options && options.replace) {
11214
- for (let i = 0; i < options.replace.length; i++) {
11215
- const name = options.replace[i];
11216
- methods.push({
11217
- name: name,
11218
- // @TODO: better solution?
11219
- original: object[name]
11220
- });
11221
- // @TODO: better solution?
11222
- queue.replace(object, name);
11223
- }
11224
- }
11225
- queue._extended = {
11226
- object: object,
11227
- methods: methods
11228
- };
11229
- return queue;
11230
- }
11231
- /**
11232
- * Destroy the queue. The queue will first flush all queued actions, and in case it has extended an object, will restore the original object.
11233
- */
11234
- destroy() {
11235
- this.flush();
11236
- if (this._extended) {
11237
- const object = this._extended.object;
11238
- const methods = this._extended.methods;
11239
- for (let i = 0; i < methods.length; i++) {
11240
- const method = methods[i];
11241
- if (method.original) {
11242
- // @TODO: better solution?
11243
- object[method.name] = method.original;
11244
- } else {
11245
- // @TODO: better solution?
11246
- delete object[method.name];
11247
- }
11248
- }
11249
- this._extended = null;
11250
- }
11251
- }
11252
- /**
11253
- * Replace a method on an object with a queued version.
11254
- * @param object - Object having the method.
11255
- * @param method - The method name.
11256
- */
11257
- replace(object, method) {
11258
- /* 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. */
11259
- const me = this;
11260
- const original = object[method];
11261
- if (!original) {
11262
- throw new Error("Method " + method + " undefined");
11263
- }
11264
- object[method] = function () {
11265
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
11266
- args[_key] = arguments[_key];
11267
- }
11268
- // add this call to the queue
11269
- me.queue({
11270
- args: args,
11271
- fn: original,
11272
- context: this
11273
- });
11274
- };
11275
- }
11276
- /**
11277
- * Queue a call.
11278
- * @param entry - The function or entry to be queued.
11279
- */
11280
- queue(entry) {
11281
- if (typeof entry === "function") {
11282
- this._queue.push({
11283
- fn: entry
11284
- });
11285
- } else {
11286
- this._queue.push(entry);
11287
- }
11288
- this._flushIfNeeded();
11289
- }
11290
- /**
11291
- * Check whether the queue needs to be flushed.
11292
- */
11293
- _flushIfNeeded() {
11294
- // flush when the maximum is exceeded.
11295
- if (this._queue.length > this.max) {
11296
- this.flush();
11297
- }
11298
- // flush after a period of inactivity when a delay is configured
11299
- if (this._timeout != null) {
11300
- clearTimeout(this._timeout);
11301
- this._timeout = null;
11302
- }
11303
- if (this.queue.length > 0 && typeof this.delay === "number") {
11304
- this._timeout = _setTimeout(() => {
11305
- this.flush();
11306
- }, this.delay);
11307
- }
11308
- }
11309
- /**
11310
- * Flush all queued calls
11311
- */
11312
- flush() {
11313
- var _context, _context2;
11314
- _forEachInstanceProperty(_context = _spliceInstanceProperty(_context2 = this._queue).call(_context2, 0)).call(_context, entry => {
11315
- entry.fn.apply(entry.context || entry.fn, entry.args || []);
11316
- });
11317
- }
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;
11318
11367
  }
11319
11368
 
11320
- /**
11321
- * {@link DataSet} code that can be reused in {@link DataView} or other similar implementations of {@link DataInterface}.
11322
- * @typeParam Item - Item type that may or may not have an id.
11323
- * @typeParam IdProp - Name of the property that contains the id.
11324
- */
11325
- class DataSetPart {
11326
- constructor() {
11327
- _defineProperty(this, "_subscribers", {
11328
- "*": [],
11329
- add: [],
11330
- remove: [],
11331
- update: []
11332
- });
11333
- /**
11334
- * @deprecated Use on instead (PS: DataView.subscribe === DataView.on).
11335
- */
11336
- _defineProperty(this, "subscribe", DataSetPart.prototype.on);
11337
- /**
11338
- * @deprecated Use off instead (PS: DataView.unsubscribe === DataView.off).
11339
- */
11340
- _defineProperty(this, "unsubscribe", DataSetPart.prototype.off);
11341
- }
11342
- /**
11343
- * Trigger an event
11344
- * @param event - Event name.
11345
- * @param payload - Event payload.
11346
- * @param senderId - Id of the sender.
11347
- */
11348
- _trigger(event, payload, senderId) {
11349
- var _context;
11350
- if (event === "*") {
11351
- throw new Error("Cannot trigger event *");
11352
- }
11353
- _forEachInstanceProperty(_context = [...this._subscribers[event], ...this._subscribers["*"]]).call(_context, subscriber => {
11354
- subscriber(event, payload, senderId != null ? senderId : null);
11355
- });
11356
- }
11357
- /**
11358
- * Subscribe to an event, add an event listener.
11359
- * @remarks Non-function callbacks are ignored.
11360
- * @param event - Event name.
11361
- * @param callback - Callback method.
11362
- */
11363
- on(event, callback) {
11364
- if (typeof callback === "function") {
11365
- 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
+ }
11366
11405
  }
11367
- // @TODO: Maybe throw for invalid callbacks?
11368
- }
11369
- /**
11370
- * Unsubscribe from an event, remove an event listener.
11371
- * @remarks If the same callback was subscribed more than once **all** occurences will be removed.
11372
- * @param event - Event name.
11373
- * @param callback - Callback method.
11374
- */
11375
- off(event, callback) {
11376
- var _context2;
11377
- this._subscribers[event] = _filterInstanceProperty(_context2 = this._subscribers[event]).call(_context2, subscriber => subscriber !== callback);
11406
+ return a;
11378
11407
  }
11379
11408
  }
11380
11409
 
11381
- var es_object_create = {};
11410
+ var es_array_slice = {};
11411
+
11412
+ var hasRequiredEs_array_slice;
11413
+
11414
+ function requireEs_array_slice () {
11415
+ if (hasRequiredEs_array_slice) return es_array_slice;
11416
+ hasRequiredEs_array_slice = 1;
11417
+ var $ = /*@__PURE__*/ require_export();
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();
11429
+
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 = {};
11382
11791
 
11383
11792
  var hasRequiredEs_object_create;
11384
11793
 
@@ -11669,7 +12078,7 @@
11669
12078
  var O = aSet(this);
11670
12079
  var otherRec = getSetRecord(other);
11671
12080
  var result = clone(O);
11672
- if (size(O) <= otherRec.size) iterateSet(O, function (e) {
12081
+ if (size(result) <= otherRec.size) iterateSet(result, function (e) {
11673
12082
  if (otherRec.includes(e)) remove(result, e);
11674
12083
  });
11675
12084
  else iterateSimple(otherRec.getIterator(), function (e) {
@@ -11828,7 +12237,7 @@
11828
12237
  }, true) !== false;
11829
12238
  var iterator = otherRec.getIterator();
11830
12239
  return iterateSimple(iterator, function (e) {
11831
- if (has(O, e)) return iteratorClose(iterator, 'normal', false);
12240
+ if (has(O, e)) return iteratorClose(iterator.iterator, 'normal', false);
11832
12241
  }) !== false;
11833
12242
  };
11834
12243
  return setIsDisjointFrom;
@@ -11925,7 +12334,7 @@
11925
12334
  if (size(O) < otherRec.size) return false;
11926
12335
  var iterator = otherRec.getIterator();
11927
12336
  return iterateSimple(iterator, function (e) {
11928
- if (!has(O, e)) return iteratorClose(iterator, 'normal', false);
12337
+ if (!has(O, e)) return iteratorClose(iterator.iterator, 'normal', false);
11929
12338
  }) !== false;
11930
12339
  };
11931
12340
  return setIsSupersetOf;
@@ -12233,7 +12642,10 @@
12233
12642
  * Return an iterable of key, value pairs for every entry in the stream.
12234
12643
  */
12235
12644
  *[_Symbol$iterator]() {
12236
- for (const [id, item] of this._pairs) {
12645
+ for (const _ref of this._pairs) {
12646
+ var _ref2 = _slicedToArray(_ref, 2);
12647
+ const id = _ref2[0];
12648
+ const item = _ref2[1];
12237
12649
  yield [id, item];
12238
12650
  }
12239
12651
  }
@@ -12241,7 +12653,10 @@
12241
12653
  * Return an iterable of key, value pairs for every entry in the stream.
12242
12654
  */
12243
12655
  *entries() {
12244
- for (const [id, item] of this._pairs) {
12656
+ for (const _ref3 of this._pairs) {
12657
+ var _ref4 = _slicedToArray(_ref3, 2);
12658
+ const id = _ref4[0];
12659
+ const item = _ref4[1];
12245
12660
  yield [id, item];
12246
12661
  }
12247
12662
  }
@@ -12249,7 +12664,9 @@
12249
12664
  * Return an iterable of keys in the stream.
12250
12665
  */
12251
12666
  *keys() {
12252
- for (const [id] of this._pairs) {
12667
+ for (const _ref5 of this._pairs) {
12668
+ var _ref6 = _slicedToArray(_ref5, 1);
12669
+ const id = _ref6[0];
12253
12670
  yield id;
12254
12671
  }
12255
12672
  }
@@ -12257,7 +12674,9 @@
12257
12674
  * Return an iterable of values in the stream.
12258
12675
  */
12259
12676
  *values() {
12260
- for (const [, item] of this._pairs) {
12677
+ for (const _ref7 of this._pairs) {
12678
+ var _ref8 = _slicedToArray(_ref7, 2);
12679
+ const item = _ref8[1];
12261
12680
  yield item;
12262
12681
  }
12263
12682
  }
@@ -12298,7 +12717,10 @@
12298
12717
  */
12299
12718
  toObjectMap() {
12300
12719
  const map = _Object$create(null);
12301
- for (const [id, item] of this._pairs) {
12720
+ for (const _ref9 of this._pairs) {
12721
+ var _ref0 = _slicedToArray(_ref9, 2);
12722
+ const id = _ref0[0];
12723
+ const item = _ref0[1];
12302
12724
  map[id] = item;
12303
12725
  }
12304
12726
  return map;
@@ -12325,158 +12747,604 @@
12325
12747
  return new _Set(this.toItemArray());
12326
12748
  }
12327
12749
  /**
12328
- * Cache the items from this stream.
12329
- * @remarks
12330
- * This method allows for items to be fetched immediatelly and used (possibly multiple times) later.
12331
- * It can also be used to optimize performance as {@link DataStream} would otherwise reevaluate everything upon each iteration.
12332
- *
12333
- * ## Example
12334
- * ```javascript
12335
- * const ds = new DataSet([…])
12336
- *
12337
- * const cachedStream = ds.stream()
12338
- * .filter(…)
12339
- * .sort(…)
12340
- * .map(…)
12341
- * .cached(…) // Data are fetched, processed and cached here.
12342
- *
12343
- * ds.clear()
12344
- * chachedStream // Still has all the items.
12345
- * ```
12346
- * @returns A new {@link DataStream} with cached items (detached from the original {@link DataSet}).
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 = {};
12927
+
12928
+ var web_setInterval = {};
12929
+
12930
+ var validateArgumentsLength;
12931
+ var hasRequiredValidateArgumentsLength;
12932
+
12933
+ function requireValidateArgumentsLength () {
12934
+ if (hasRequiredValidateArgumentsLength) return validateArgumentsLength;
12935
+ hasRequiredValidateArgumentsLength = 1;
12936
+ var $TypeError = TypeError;
12937
+
12938
+ validateArgumentsLength = function (passed, required) {
12939
+ if (passed < required) throw new $TypeError('Not enough arguments');
12940
+ return passed;
12941
+ };
12942
+ return validateArgumentsLength;
12943
+ }
12944
+
12945
+ var schedulersFix;
12946
+ var hasRequiredSchedulersFix;
12947
+
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();
12958
+
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;
12980
+ };
12981
+ return schedulersFix;
12982
+ }
12983
+
12984
+ var hasRequiredWeb_setInterval;
12985
+
12986
+ function requireWeb_setInterval () {
12987
+ if (hasRequiredWeb_setInterval) return web_setInterval;
12988
+ hasRequiredWeb_setInterval = 1;
12989
+ var $ = /*@__PURE__*/ require_export();
12990
+ var globalThis = /*@__PURE__*/ requireGlobalThis();
12991
+ var schedulersFix = /*@__PURE__*/ requireSchedulersFix();
12992
+
12993
+ var setInterval = schedulersFix(globalThis.setInterval, true);
12994
+
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
12999
+ });
13000
+ return web_setInterval;
13001
+ }
13002
+
13003
+ var web_setTimeout = {};
13004
+
13005
+ var hasRequiredWeb_setTimeout;
13006
+
13007
+ function requireWeb_setTimeout () {
13008
+ if (hasRequiredWeb_setTimeout) return web_setTimeout;
13009
+ hasRequiredWeb_setTimeout = 1;
13010
+ var $ = /*@__PURE__*/ require_export();
13011
+ var globalThis = /*@__PURE__*/ requireGlobalThis();
13012
+ var schedulersFix = /*@__PURE__*/ requireSchedulersFix();
13013
+
13014
+ var setTimeout = schedulersFix(globalThis.setTimeout, true);
13015
+
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
13020
+ });
13021
+ return web_setTimeout;
13022
+ }
13023
+
13024
+ var hasRequiredWeb_timers;
13025
+
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;
13033
+ }
13034
+
13035
+ var setTimeout$2;
13036
+ var hasRequiredSetTimeout$1;
13037
+
13038
+ function requireSetTimeout$1 () {
13039
+ if (hasRequiredSetTimeout$1) return setTimeout$2;
13040
+ hasRequiredSetTimeout$1 = 1;
13041
+ requireWeb_timers();
13042
+ var path = /*@__PURE__*/ requirePath();
13043
+
13044
+ setTimeout$2 = path.setTimeout;
13045
+ return setTimeout$2;
13046
+ }
13047
+
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;
13056
+ }
13057
+
13058
+ var setTimeoutExports = requireSetTimeout();
13059
+ var _setTimeout = /*@__PURE__*/getDefaultExportFromCjs(setTimeoutExports);
13060
+
13061
+ var es_array_splice = {};
13062
+
13063
+ var hasRequiredEs_array_splice;
13064
+
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();
13079
+
13080
+ var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('splice');
13081
+
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;
13135
+ }
13136
+
13137
+ var splice$3;
13138
+ var hasRequiredSplice$3;
13139
+
13140
+ function requireSplice$3 () {
13141
+ if (hasRequiredSplice$3) return splice$3;
13142
+ hasRequiredSplice$3 = 1;
13143
+ requireEs_array_splice();
13144
+ var getBuiltInPrototypeMethod = /*@__PURE__*/ requireGetBuiltInPrototypeMethod();
13145
+
13146
+ splice$3 = getBuiltInPrototypeMethod('Array', 'splice');
13147
+ return splice$3;
13148
+ }
13149
+
13150
+ var splice$2;
13151
+ var hasRequiredSplice$2;
13152
+
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();
13158
+
13159
+ var ArrayPrototype = Array.prototype;
13160
+
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;
13166
+ }
13167
+
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 {
13198
+ /**
13199
+ * Construct a new Queue.
13200
+ * @param options - Queue configuration.
12347
13201
  */
12348
- cache() {
12349
- 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);
12350
13212
  }
12351
13213
  /**
12352
- * Get the distinct values of given property.
12353
- * @param callback - The function that picks and possibly converts the property.
12354
- * @typeParam T - The type of the distinct value.
12355
- * @returns A set of all distinct properties.
13214
+ * Update the configuration of the queue.
13215
+ * @param options - Queue configuration.
12356
13216
  */
12357
- distinct(callback) {
12358
- const set = new _Set();
12359
- for (const [id, item] of this._pairs) {
12360
- set.add(callback(item, id));
13217
+ setOptions(options) {
13218
+ if (options && typeof options.delay !== "undefined") {
13219
+ this.delay = options.delay;
12361
13220
  }
12362
- return set;
13221
+ if (options && typeof options.max !== "undefined") {
13222
+ this.max = options.max;
13223
+ }
13224
+ this._flushIfNeeded();
12363
13225
  }
12364
13226
  /**
12365
- * Filter the items of the stream.
12366
- * @param callback - The function that decides whether an item will be included.
12367
- * @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.
12368
13232
  */
12369
- filter(callback) {
12370
- const pairs = this._pairs;
12371
- return new DataStream({
12372
- *[_Symbol$iterator]() {
12373
- for (const [id, item] of pairs) {
12374
- if (callback(item, id)) {
12375
- yield [id, item];
12376
- }
12377
- }
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);
12378
13255
  }
12379
- });
12380
- }
12381
- /**
12382
- * Execute a callback for each item of the stream.
12383
- * @param callback - The function that will be invoked for each item.
12384
- */
12385
- forEach(callback) {
12386
- for (const [id, item] of this._pairs) {
12387
- callback(item, id);
12388
13256
  }
13257
+ queue._extended = {
13258
+ object: object,
13259
+ methods: methods
13260
+ };
13261
+ return queue;
12389
13262
  }
12390
13263
  /**
12391
- * Map the items into a different type.
12392
- * @param callback - The function that does the conversion.
12393
- * @typeParam Mapped - The type of the item after mapping.
12394
- * @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.
12395
13265
  */
12396
- map(callback) {
12397
- const pairs = this._pairs;
12398
- return new DataStream({
12399
- *[_Symbol$iterator]() {
12400
- for (const [id, item] of pairs) {
12401
- 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];
12402
13279
  }
12403
13280
  }
12404
- });
13281
+ this._extended = null;
13282
+ }
12405
13283
  }
12406
13284
  /**
12407
- * Get the item with the maximum value of given property.
12408
- * @param callback - The function that picks and possibly converts the property.
12409
- * @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.
12410
13288
  */
12411
- max(callback) {
12412
- const iter = _getIterator(this._pairs);
12413
- let curr = iter.next();
12414
- if (curr.done) {
12415
- 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");
12416
13295
  }
12417
- let maxItem = curr.value[1];
12418
- let maxValue = callback(curr.value[1], curr.value[0]);
12419
- while (!(curr = iter.next()).done) {
12420
- const [id, item] = curr.value;
12421
- const value = callback(item, id);
12422
- if (value > maxValue) {
12423
- maxValue = value;
12424
- 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];
12425
13299
  }
12426
- }
12427
- return maxItem;
13300
+ // add this call to the queue
13301
+ me.queue({
13302
+ args: args,
13303
+ fn: original,
13304
+ context: this
13305
+ });
13306
+ };
12428
13307
  }
12429
13308
  /**
12430
- * Get the item with the minimum value of given property.
12431
- * @param callback - The function that picks and possibly converts the property.
12432
- * @returns The item with the minimum if found otherwise null.
13309
+ * Queue a call.
13310
+ * @param entry - The function or entry to be queued.
12433
13311
  */
12434
- min(callback) {
12435
- const iter = _getIterator(this._pairs);
12436
- let curr = iter.next();
12437
- if (curr.done) {
12438
- return null;
12439
- }
12440
- let minItem = curr.value[1];
12441
- let minValue = callback(curr.value[1], curr.value[0]);
12442
- while (!(curr = iter.next()).done) {
12443
- const [id, item] = curr.value;
12444
- const value = callback(item, id);
12445
- if (value < minValue) {
12446
- minValue = value;
12447
- minItem = item;
12448
- }
13312
+ queue(entry) {
13313
+ if (typeof entry === "function") {
13314
+ this._queue.push({
13315
+ fn: entry
13316
+ });
13317
+ } else {
13318
+ this._queue.push(entry);
12449
13319
  }
12450
- return minItem;
13320
+ this._flushIfNeeded();
12451
13321
  }
12452
13322
  /**
12453
- * Reduce the items into a single value.
12454
- * @param callback - The function that does the reduction.
12455
- * @param accumulator - The initial value of the accumulator.
12456
- * @typeParam T - The type of the accumulated value.
12457
- * @returns The reduced value.
13323
+ * Check whether the queue needs to be flushed.
12458
13324
  */
12459
- reduce(callback, accumulator) {
12460
- for (const [id, item] of this._pairs) {
12461
- 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);
12462
13339
  }
12463
- return accumulator;
12464
13340
  }
12465
13341
  /**
12466
- * Sort the items.
12467
- * @param callback - Item comparator.
12468
- * @returns A new stream with sorted items.
13342
+ * Flush all queued calls
12469
13343
  */
12470
- sort(callback) {
12471
- return new DataStream({
12472
- [_Symbol$iterator]: () => {
12473
- var _context3;
12474
- return _getIterator(_sortInstanceProperty(_context3 = [...this._pairs]).call(_context3, (_ref, _ref2) => {
12475
- let [idA, itemA] = _ref;
12476
- let [idB, itemB] = _ref2;
12477
- return callback(itemA, itemB, idA, idB);
12478
- }));
12479
- }
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 || []);
12480
13348
  });
12481
13349
  }
12482
13350
  }
@@ -12576,7 +13444,7 @@
12576
13444
  super();
12577
13445
  // correctly read optional arguments
12578
13446
  _defineProperty(this, "_queue", null);
12579
- if (data && !_Array$isArray(data)) {
13447
+ if (data && !_Array$isArray$1(data)) {
12580
13448
  options = data;
12581
13449
  data = [];
12582
13450
  }
@@ -12643,7 +13511,7 @@
12643
13511
  add(data, senderId) {
12644
13512
  const addedIds = [];
12645
13513
  let id;
12646
- if (_Array$isArray(data)) {
13514
+ if (_Array$isArray$1(data)) {
12647
13515
  // Array
12648
13516
  const idsToAdd = _mapInstanceProperty(data).call(data, d => d[this._idProp]);
12649
13517
  if (_someInstanceProperty(idsToAdd).call(idsToAdd, id => this._data.has(id))) {
@@ -12722,7 +13590,7 @@
12722
13590
  addedIds.push(id);
12723
13591
  }
12724
13592
  };
12725
- if (_Array$isArray(data)) {
13593
+ if (_Array$isArray$1(data)) {
12726
13594
  // Array
12727
13595
  for (let i = 0, len = data.length; i < len; i++) {
12728
13596
  if (data[i] && typeof data[i] === "object") {
@@ -12794,7 +13662,7 @@
12794
13662
  */
12795
13663
  updateOnly(data, senderId) {
12796
13664
  var _context;
12797
- if (!_Array$isArray(data)) {
13665
+ if (!_Array$isArray$1(data)) {
12798
13666
  data = [data];
12799
13667
  }
12800
13668
  const updateEventData = _mapInstanceProperty(_context = _mapInstanceProperty(data).call(data, update => {
@@ -12807,10 +13675,8 @@
12807
13675
  update
12808
13676
  };
12809
13677
  })).call(_context, _ref => {
12810
- let {
12811
- oldData,
12812
- update
12813
- } = _ref;
13678
+ let oldData = _ref.oldData,
13679
+ update = _ref.update;
12814
13680
  const id = oldData[this._idProp];
12815
13681
  const updatedData = pureDeepObjectAssign(oldData, update);
12816
13682
  this._data.set(id, updatedData);
@@ -12850,7 +13716,7 @@
12850
13716
  // get(id [, options])
12851
13717
  id = first;
12852
13718
  options = second;
12853
- } else if (_Array$isArray(first)) {
13719
+ } else if (_Array$isArray$1(first)) {
12854
13720
  // get(ids [, options])
12855
13721
  ids = first;
12856
13722
  options = second;
@@ -13060,7 +13926,7 @@
13060
13926
  // item is null
13061
13927
  return item;
13062
13928
  }
13063
- return _reduceInstanceProperty(_context3 = _Array$isArray(fields) ?
13929
+ return _reduceInstanceProperty(_context3 = _Array$isArray$1(fields) ?
13064
13930
  // Use the supplied array
13065
13931
  fields :
13066
13932
  // Use the keys of the supplied object
@@ -13123,7 +13989,7 @@
13123
13989
  const removedIds = [];
13124
13990
  const removedItems = [];
13125
13991
  // force everything to be an array for simplicity
13126
- const ids = _Array$isArray(id) ? id : [id];
13992
+ const ids = _Array$isArray$1(id) ? id : [id];
13127
13993
  for (let i = 0, len = ids.length; i < len; i++) {
13128
13994
  const item = this._remove(ids[i]);
13129
13995
  if (item) {
@@ -13545,7 +14411,7 @@
13545
14411
  // parse the arguments
13546
14412
  let ids = null;
13547
14413
  let options;
13548
- if (isId(first) || _Array$isArray(first)) {
14414
+ if (isId(first) || _Array$isArray$1(first)) {
13549
14415
  ids = first;
13550
14416
  options = second;
13551
14417
  } else {