@nsshunt/stsobservability 1.0.92 → 1.0.94

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.
@@ -1197,675 +1197,696 @@ SetVal_fn4 = function(updatedValue) {
1197
1197
  __privateSet(this, _start, performance.now() - updatedValue);
1198
1198
  }
1199
1199
  };
1200
- var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
1201
1200
  function getDefaultExportFromCjs(x) {
1202
1201
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1203
1202
  }
1204
1203
  var timsort$1 = {};
1205
- (function(exports) {
1206
- (function(global2, factory) {
1207
- {
1208
- factory(exports);
1209
- }
1210
- })(commonjsGlobal, function(exports2) {
1211
- exports2.__esModule = true;
1212
- exports2.sort = sort;
1213
- function _classCallCheck(instance, Constructor) {
1214
- if (!(instance instanceof Constructor)) {
1215
- throw new TypeError("Cannot call a class as a function");
1216
- }
1217
- }
1218
- var DEFAULT_MIN_MERGE = 32;
1219
- var DEFAULT_MIN_GALLOPING = 7;
1220
- var DEFAULT_TMP_STORAGE_LENGTH = 256;
1221
- var POWERS_OF_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9];
1222
- function log10(x) {
1223
- if (x < 1e5) {
1224
- if (x < 100) {
1225
- return x < 10 ? 0 : 1;
1226
- }
1227
- if (x < 1e4) {
1228
- return x < 1e3 ? 2 : 3;
1204
+ var hasRequiredTimsort$1;
1205
+ function requireTimsort$1() {
1206
+ if (hasRequiredTimsort$1) return timsort$1;
1207
+ hasRequiredTimsort$1 = 1;
1208
+ (function(exports) {
1209
+ (function(global, factory) {
1210
+ {
1211
+ factory(exports);
1212
+ }
1213
+ })(timsort$1, function(exports2) {
1214
+ exports2.__esModule = true;
1215
+ exports2.sort = sort;
1216
+ function _classCallCheck(instance, Constructor) {
1217
+ if (!(instance instanceof Constructor)) {
1218
+ throw new TypeError("Cannot call a class as a function");
1229
1219
  }
1230
- return 4;
1231
- }
1232
- if (x < 1e7) {
1233
- return x < 1e6 ? 5 : 6;
1234
- }
1235
- if (x < 1e9) {
1236
- return x < 1e8 ? 7 : 8;
1237
- }
1238
- return 9;
1239
- }
1240
- function alphabeticalCompare(a, b) {
1241
- if (a === b) {
1242
- return 0;
1243
1220
  }
1244
- if (~~a === a && ~~b === b) {
1245
- if (a === 0 || b === 0) {
1246
- return a < b ? -1 : 1;
1247
- }
1248
- if (a < 0 || b < 0) {
1249
- if (b >= 0) {
1250
- return -1;
1221
+ var DEFAULT_MIN_MERGE = 32;
1222
+ var DEFAULT_MIN_GALLOPING = 7;
1223
+ var DEFAULT_TMP_STORAGE_LENGTH = 256;
1224
+ var POWERS_OF_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9];
1225
+ function log10(x) {
1226
+ if (x < 1e5) {
1227
+ if (x < 100) {
1228
+ return x < 10 ? 0 : 1;
1251
1229
  }
1252
- if (a >= 0) {
1253
- return 1;
1230
+ if (x < 1e4) {
1231
+ return x < 1e3 ? 2 : 3;
1254
1232
  }
1255
- a = -a;
1256
- b = -b;
1233
+ return 4;
1257
1234
  }
1258
- var al = log10(a);
1259
- var bl = log10(b);
1260
- var t = 0;
1261
- if (al < bl) {
1262
- a *= POWERS_OF_TEN[bl - al - 1];
1263
- b /= 10;
1264
- t = -1;
1265
- } else if (al > bl) {
1266
- b *= POWERS_OF_TEN[al - bl - 1];
1267
- a /= 10;
1268
- t = 1;
1235
+ if (x < 1e7) {
1236
+ return x < 1e6 ? 5 : 6;
1269
1237
  }
1270
- if (a === b) {
1271
- return t;
1238
+ if (x < 1e9) {
1239
+ return x < 1e8 ? 7 : 8;
1272
1240
  }
1273
- return a < b ? -1 : 1;
1241
+ return 9;
1274
1242
  }
1275
- var aStr = String(a);
1276
- var bStr = String(b);
1277
- if (aStr === bStr) {
1278
- return 0;
1279
- }
1280
- return aStr < bStr ? -1 : 1;
1281
- }
1282
- function minRunLength(n) {
1283
- var r = 0;
1284
- while (n >= DEFAULT_MIN_MERGE) {
1285
- r |= n & 1;
1286
- n >>= 1;
1287
- }
1288
- return n + r;
1289
- }
1290
- function makeAscendingRun(array, lo, hi, compare) {
1291
- var runHi = lo + 1;
1292
- if (runHi === hi) {
1293
- return 1;
1294
- }
1295
- if (compare(array[runHi++], array[lo]) < 0) {
1296
- while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {
1297
- runHi++;
1243
+ function alphabeticalCompare(a, b) {
1244
+ if (a === b) {
1245
+ return 0;
1298
1246
  }
1299
- reverseRun(array, lo, runHi);
1300
- } else {
1301
- while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {
1302
- runHi++;
1247
+ if (~~a === a && ~~b === b) {
1248
+ if (a === 0 || b === 0) {
1249
+ return a < b ? -1 : 1;
1250
+ }
1251
+ if (a < 0 || b < 0) {
1252
+ if (b >= 0) {
1253
+ return -1;
1254
+ }
1255
+ if (a >= 0) {
1256
+ return 1;
1257
+ }
1258
+ a = -a;
1259
+ b = -b;
1260
+ }
1261
+ var al = log10(a);
1262
+ var bl = log10(b);
1263
+ var t = 0;
1264
+ if (al < bl) {
1265
+ a *= POWERS_OF_TEN[bl - al - 1];
1266
+ b /= 10;
1267
+ t = -1;
1268
+ } else if (al > bl) {
1269
+ b *= POWERS_OF_TEN[al - bl - 1];
1270
+ a /= 10;
1271
+ t = 1;
1272
+ }
1273
+ if (a === b) {
1274
+ return t;
1275
+ }
1276
+ return a < b ? -1 : 1;
1303
1277
  }
1278
+ var aStr = String(a);
1279
+ var bStr = String(b);
1280
+ if (aStr === bStr) {
1281
+ return 0;
1282
+ }
1283
+ return aStr < bStr ? -1 : 1;
1304
1284
  }
1305
- return runHi - lo;
1306
- }
1307
- function reverseRun(array, lo, hi) {
1308
- hi--;
1309
- while (lo < hi) {
1310
- var t = array[lo];
1311
- array[lo++] = array[hi];
1312
- array[hi--] = t;
1313
- }
1314
- }
1315
- function binaryInsertionSort(array, lo, hi, start, compare) {
1316
- if (start === lo) {
1317
- start++;
1285
+ function minRunLength(n) {
1286
+ var r = 0;
1287
+ while (n >= DEFAULT_MIN_MERGE) {
1288
+ r |= n & 1;
1289
+ n >>= 1;
1290
+ }
1291
+ return n + r;
1318
1292
  }
1319
- for (; start < hi; start++) {
1320
- var pivot = array[start];
1321
- var left = lo;
1322
- var right = start;
1323
- while (left < right) {
1324
- var mid = left + right >>> 1;
1325
- if (compare(pivot, array[mid]) < 0) {
1326
- right = mid;
1327
- } else {
1328
- left = mid + 1;
1293
+ function makeAscendingRun(array, lo, hi, compare) {
1294
+ var runHi = lo + 1;
1295
+ if (runHi === hi) {
1296
+ return 1;
1297
+ }
1298
+ if (compare(array[runHi++], array[lo]) < 0) {
1299
+ while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {
1300
+ runHi++;
1301
+ }
1302
+ reverseRun(array, lo, runHi);
1303
+ } else {
1304
+ while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {
1305
+ runHi++;
1329
1306
  }
1330
1307
  }
1331
- var n = start - left;
1332
- switch (n) {
1333
- case 3:
1334
- array[left + 3] = array[left + 2];
1335
- case 2:
1336
- array[left + 2] = array[left + 1];
1337
- case 1:
1338
- array[left + 1] = array[left];
1339
- break;
1340
- default:
1341
- while (n > 0) {
1342
- array[left + n] = array[left + n - 1];
1343
- n--;
1344
- }
1308
+ return runHi - lo;
1309
+ }
1310
+ function reverseRun(array, lo, hi) {
1311
+ hi--;
1312
+ while (lo < hi) {
1313
+ var t = array[lo];
1314
+ array[lo++] = array[hi];
1315
+ array[hi--] = t;
1345
1316
  }
1346
- array[left] = pivot;
1347
- }
1348
- }
1349
- function gallopLeft(value, array, start, length, hint, compare) {
1350
- var lastOffset = 0;
1351
- var maxOffset = 0;
1352
- var offset = 1;
1353
- if (compare(value, array[start + hint]) > 0) {
1354
- maxOffset = length - hint;
1355
- while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {
1356
- lastOffset = offset;
1357
- offset = (offset << 1) + 1;
1358
- if (offset <= 0) {
1359
- offset = maxOffset;
1360
- }
1317
+ }
1318
+ function binaryInsertionSort(array, lo, hi, start, compare) {
1319
+ if (start === lo) {
1320
+ start++;
1361
1321
  }
1362
- if (offset > maxOffset) {
1363
- offset = maxOffset;
1322
+ for (; start < hi; start++) {
1323
+ var pivot = array[start];
1324
+ var left = lo;
1325
+ var right = start;
1326
+ while (left < right) {
1327
+ var mid = left + right >>> 1;
1328
+ if (compare(pivot, array[mid]) < 0) {
1329
+ right = mid;
1330
+ } else {
1331
+ left = mid + 1;
1332
+ }
1333
+ }
1334
+ var n = start - left;
1335
+ switch (n) {
1336
+ case 3:
1337
+ array[left + 3] = array[left + 2];
1338
+ case 2:
1339
+ array[left + 2] = array[left + 1];
1340
+ case 1:
1341
+ array[left + 1] = array[left];
1342
+ break;
1343
+ default:
1344
+ while (n > 0) {
1345
+ array[left + n] = array[left + n - 1];
1346
+ n--;
1347
+ }
1348
+ }
1349
+ array[left] = pivot;
1364
1350
  }
1365
- lastOffset += hint;
1366
- offset += hint;
1367
- } else {
1368
- maxOffset = hint + 1;
1369
- while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {
1370
- lastOffset = offset;
1371
- offset = (offset << 1) + 1;
1372
- if (offset <= 0) {
1351
+ }
1352
+ function gallopLeft(value, array, start, length, hint, compare) {
1353
+ var lastOffset = 0;
1354
+ var maxOffset = 0;
1355
+ var offset = 1;
1356
+ if (compare(value, array[start + hint]) > 0) {
1357
+ maxOffset = length - hint;
1358
+ while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {
1359
+ lastOffset = offset;
1360
+ offset = (offset << 1) + 1;
1361
+ if (offset <= 0) {
1362
+ offset = maxOffset;
1363
+ }
1364
+ }
1365
+ if (offset > maxOffset) {
1373
1366
  offset = maxOffset;
1374
1367
  }
1375
- }
1376
- if (offset > maxOffset) {
1377
- offset = maxOffset;
1378
- }
1379
- var tmp = lastOffset;
1380
- lastOffset = hint - offset;
1381
- offset = hint - tmp;
1382
- }
1383
- lastOffset++;
1384
- while (lastOffset < offset) {
1385
- var m = lastOffset + (offset - lastOffset >>> 1);
1386
- if (compare(value, array[start + m]) > 0) {
1387
- lastOffset = m + 1;
1368
+ lastOffset += hint;
1369
+ offset += hint;
1388
1370
  } else {
1389
- offset = m;
1390
- }
1391
- }
1392
- return offset;
1393
- }
1394
- function gallopRight(value, array, start, length, hint, compare) {
1395
- var lastOffset = 0;
1396
- var maxOffset = 0;
1397
- var offset = 1;
1398
- if (compare(value, array[start + hint]) < 0) {
1399
- maxOffset = hint + 1;
1400
- while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {
1401
- lastOffset = offset;
1402
- offset = (offset << 1) + 1;
1403
- if (offset <= 0) {
1371
+ maxOffset = hint + 1;
1372
+ while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {
1373
+ lastOffset = offset;
1374
+ offset = (offset << 1) + 1;
1375
+ if (offset <= 0) {
1376
+ offset = maxOffset;
1377
+ }
1378
+ }
1379
+ if (offset > maxOffset) {
1404
1380
  offset = maxOffset;
1405
1381
  }
1382
+ var tmp = lastOffset;
1383
+ lastOffset = hint - offset;
1384
+ offset = hint - tmp;
1406
1385
  }
1407
- if (offset > maxOffset) {
1408
- offset = maxOffset;
1386
+ lastOffset++;
1387
+ while (lastOffset < offset) {
1388
+ var m = lastOffset + (offset - lastOffset >>> 1);
1389
+ if (compare(value, array[start + m]) > 0) {
1390
+ lastOffset = m + 1;
1391
+ } else {
1392
+ offset = m;
1393
+ }
1409
1394
  }
1410
- var tmp = lastOffset;
1411
- lastOffset = hint - offset;
1412
- offset = hint - tmp;
1413
- } else {
1414
- maxOffset = length - hint;
1415
- while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {
1416
- lastOffset = offset;
1417
- offset = (offset << 1) + 1;
1418
- if (offset <= 0) {
1395
+ return offset;
1396
+ }
1397
+ function gallopRight(value, array, start, length, hint, compare) {
1398
+ var lastOffset = 0;
1399
+ var maxOffset = 0;
1400
+ var offset = 1;
1401
+ if (compare(value, array[start + hint]) < 0) {
1402
+ maxOffset = hint + 1;
1403
+ while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {
1404
+ lastOffset = offset;
1405
+ offset = (offset << 1) + 1;
1406
+ if (offset <= 0) {
1407
+ offset = maxOffset;
1408
+ }
1409
+ }
1410
+ if (offset > maxOffset) {
1419
1411
  offset = maxOffset;
1420
1412
  }
1421
- }
1422
- if (offset > maxOffset) {
1423
- offset = maxOffset;
1424
- }
1425
- lastOffset += hint;
1426
- offset += hint;
1427
- }
1428
- lastOffset++;
1429
- while (lastOffset < offset) {
1430
- var m = lastOffset + (offset - lastOffset >>> 1);
1431
- if (compare(value, array[start + m]) < 0) {
1432
- offset = m;
1413
+ var tmp = lastOffset;
1414
+ lastOffset = hint - offset;
1415
+ offset = hint - tmp;
1433
1416
  } else {
1434
- lastOffset = m + 1;
1435
- }
1436
- }
1437
- return offset;
1438
- }
1439
- var TimSort = function() {
1440
- function TimSort2(array, compare) {
1441
- _classCallCheck(this, TimSort2);
1442
- this.array = null;
1443
- this.compare = null;
1444
- this.minGallop = DEFAULT_MIN_GALLOPING;
1445
- this.length = 0;
1446
- this.tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;
1447
- this.stackLength = 0;
1448
- this.runStart = null;
1449
- this.runLength = null;
1450
- this.stackSize = 0;
1451
- this.array = array;
1452
- this.compare = compare;
1453
- this.length = array.length;
1454
- if (this.length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {
1455
- this.tmpStorageLength = this.length >>> 1;
1456
- }
1457
- this.tmp = new Array(this.tmpStorageLength);
1458
- this.stackLength = this.length < 120 ? 5 : this.length < 1542 ? 10 : this.length < 119151 ? 19 : 40;
1459
- this.runStart = new Array(this.stackLength);
1460
- this.runLength = new Array(this.stackLength);
1461
- }
1462
- TimSort2.prototype.pushRun = function pushRun(runStart, runLength) {
1463
- this.runStart[this.stackSize] = runStart;
1464
- this.runLength[this.stackSize] = runLength;
1465
- this.stackSize += 1;
1466
- };
1467
- TimSort2.prototype.mergeRuns = function mergeRuns() {
1468
- while (this.stackSize > 1) {
1469
- var n = this.stackSize - 2;
1470
- if (n >= 1 && this.runLength[n - 1] <= this.runLength[n] + this.runLength[n + 1] || n >= 2 && this.runLength[n - 2] <= this.runLength[n] + this.runLength[n - 1]) {
1471
- if (this.runLength[n - 1] < this.runLength[n + 1]) {
1472
- n--;
1417
+ maxOffset = length - hint;
1418
+ while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {
1419
+ lastOffset = offset;
1420
+ offset = (offset << 1) + 1;
1421
+ if (offset <= 0) {
1422
+ offset = maxOffset;
1473
1423
  }
1474
- } else if (this.runLength[n] > this.runLength[n + 1]) {
1475
- break;
1476
1424
  }
1477
- this.mergeAt(n);
1478
- }
1479
- };
1480
- TimSort2.prototype.forceMergeRuns = function forceMergeRuns() {
1481
- while (this.stackSize > 1) {
1482
- var n = this.stackSize - 2;
1483
- if (n > 0 && this.runLength[n - 1] < this.runLength[n + 1]) {
1484
- n--;
1425
+ if (offset > maxOffset) {
1426
+ offset = maxOffset;
1485
1427
  }
1486
- this.mergeAt(n);
1487
- }
1488
- };
1489
- TimSort2.prototype.mergeAt = function mergeAt(i) {
1490
- var compare = this.compare;
1491
- var array = this.array;
1492
- var start1 = this.runStart[i];
1493
- var length1 = this.runLength[i];
1494
- var start2 = this.runStart[i + 1];
1495
- var length2 = this.runLength[i + 1];
1496
- this.runLength[i] = length1 + length2;
1497
- if (i === this.stackSize - 3) {
1498
- this.runStart[i + 1] = this.runStart[i + 2];
1499
- this.runLength[i + 1] = this.runLength[i + 2];
1500
- }
1501
- this.stackSize--;
1502
- var k = gallopRight(array[start2], array, start1, length1, 0, compare);
1503
- start1 += k;
1504
- length1 -= k;
1505
- if (length1 === 0) {
1506
- return;
1507
- }
1508
- length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);
1509
- if (length2 === 0) {
1510
- return;
1428
+ lastOffset += hint;
1429
+ offset += hint;
1511
1430
  }
1512
- if (length1 <= length2) {
1513
- this.mergeLow(start1, length1, start2, length2);
1514
- } else {
1515
- this.mergeHigh(start1, length1, start2, length2);
1431
+ lastOffset++;
1432
+ while (lastOffset < offset) {
1433
+ var m = lastOffset + (offset - lastOffset >>> 1);
1434
+ if (compare(value, array[start + m]) < 0) {
1435
+ offset = m;
1436
+ } else {
1437
+ lastOffset = m + 1;
1438
+ }
1516
1439
  }
1517
- };
1518
- TimSort2.prototype.mergeLow = function mergeLow(start1, length1, start2, length2) {
1519
- var compare = this.compare;
1520
- var array = this.array;
1521
- var tmp = this.tmp;
1522
- var i = 0;
1523
- for (i = 0; i < length1; i++) {
1524
- tmp[i] = array[start1 + i];
1440
+ return offset;
1441
+ }
1442
+ var TimSort = function() {
1443
+ function TimSort2(array, compare) {
1444
+ _classCallCheck(this, TimSort2);
1445
+ this.array = null;
1446
+ this.compare = null;
1447
+ this.minGallop = DEFAULT_MIN_GALLOPING;
1448
+ this.length = 0;
1449
+ this.tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;
1450
+ this.stackLength = 0;
1451
+ this.runStart = null;
1452
+ this.runLength = null;
1453
+ this.stackSize = 0;
1454
+ this.array = array;
1455
+ this.compare = compare;
1456
+ this.length = array.length;
1457
+ if (this.length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {
1458
+ this.tmpStorageLength = this.length >>> 1;
1459
+ }
1460
+ this.tmp = new Array(this.tmpStorageLength);
1461
+ this.stackLength = this.length < 120 ? 5 : this.length < 1542 ? 10 : this.length < 119151 ? 19 : 40;
1462
+ this.runStart = new Array(this.stackLength);
1463
+ this.runLength = new Array(this.stackLength);
1525
1464
  }
1526
- var cursor1 = 0;
1527
- var cursor2 = start2;
1528
- var dest = start1;
1529
- array[dest++] = array[cursor2++];
1530
- if (--length2 === 0) {
1465
+ TimSort2.prototype.pushRun = function pushRun(runStart, runLength) {
1466
+ this.runStart[this.stackSize] = runStart;
1467
+ this.runLength[this.stackSize] = runLength;
1468
+ this.stackSize += 1;
1469
+ };
1470
+ TimSort2.prototype.mergeRuns = function mergeRuns() {
1471
+ while (this.stackSize > 1) {
1472
+ var n = this.stackSize - 2;
1473
+ if (n >= 1 && this.runLength[n - 1] <= this.runLength[n] + this.runLength[n + 1] || n >= 2 && this.runLength[n - 2] <= this.runLength[n] + this.runLength[n - 1]) {
1474
+ if (this.runLength[n - 1] < this.runLength[n + 1]) {
1475
+ n--;
1476
+ }
1477
+ } else if (this.runLength[n] > this.runLength[n + 1]) {
1478
+ break;
1479
+ }
1480
+ this.mergeAt(n);
1481
+ }
1482
+ };
1483
+ TimSort2.prototype.forceMergeRuns = function forceMergeRuns() {
1484
+ while (this.stackSize > 1) {
1485
+ var n = this.stackSize - 2;
1486
+ if (n > 0 && this.runLength[n - 1] < this.runLength[n + 1]) {
1487
+ n--;
1488
+ }
1489
+ this.mergeAt(n);
1490
+ }
1491
+ };
1492
+ TimSort2.prototype.mergeAt = function mergeAt(i) {
1493
+ var compare = this.compare;
1494
+ var array = this.array;
1495
+ var start1 = this.runStart[i];
1496
+ var length1 = this.runLength[i];
1497
+ var start2 = this.runStart[i + 1];
1498
+ var length2 = this.runLength[i + 1];
1499
+ this.runLength[i] = length1 + length2;
1500
+ if (i === this.stackSize - 3) {
1501
+ this.runStart[i + 1] = this.runStart[i + 2];
1502
+ this.runLength[i + 1] = this.runLength[i + 2];
1503
+ }
1504
+ this.stackSize--;
1505
+ var k = gallopRight(array[start2], array, start1, length1, 0, compare);
1506
+ start1 += k;
1507
+ length1 -= k;
1508
+ if (length1 === 0) {
1509
+ return;
1510
+ }
1511
+ length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);
1512
+ if (length2 === 0) {
1513
+ return;
1514
+ }
1515
+ if (length1 <= length2) {
1516
+ this.mergeLow(start1, length1, start2, length2);
1517
+ } else {
1518
+ this.mergeHigh(start1, length1, start2, length2);
1519
+ }
1520
+ };
1521
+ TimSort2.prototype.mergeLow = function mergeLow(start1, length1, start2, length2) {
1522
+ var compare = this.compare;
1523
+ var array = this.array;
1524
+ var tmp = this.tmp;
1525
+ var i = 0;
1531
1526
  for (i = 0; i < length1; i++) {
1532
- array[dest + i] = tmp[cursor1 + i];
1527
+ tmp[i] = array[start1 + i];
1533
1528
  }
1534
- return;
1535
- }
1536
- if (length1 === 1) {
1537
- for (i = 0; i < length2; i++) {
1538
- array[dest + i] = array[cursor2 + i];
1529
+ var cursor1 = 0;
1530
+ var cursor2 = start2;
1531
+ var dest = start1;
1532
+ array[dest++] = array[cursor2++];
1533
+ if (--length2 === 0) {
1534
+ for (i = 0; i < length1; i++) {
1535
+ array[dest + i] = tmp[cursor1 + i];
1536
+ }
1537
+ return;
1539
1538
  }
1540
- array[dest + length2] = tmp[cursor1];
1541
- return;
1542
- }
1543
- var minGallop = this.minGallop;
1544
- while (true) {
1545
- var count1 = 0;
1546
- var count2 = 0;
1547
- var exit = false;
1548
- do {
1549
- if (compare(array[cursor2], tmp[cursor1]) < 0) {
1539
+ if (length1 === 1) {
1540
+ for (i = 0; i < length2; i++) {
1541
+ array[dest + i] = array[cursor2 + i];
1542
+ }
1543
+ array[dest + length2] = tmp[cursor1];
1544
+ return;
1545
+ }
1546
+ var minGallop = this.minGallop;
1547
+ while (true) {
1548
+ var count1 = 0;
1549
+ var count2 = 0;
1550
+ var exit = false;
1551
+ do {
1552
+ if (compare(array[cursor2], tmp[cursor1]) < 0) {
1553
+ array[dest++] = array[cursor2++];
1554
+ count2++;
1555
+ count1 = 0;
1556
+ if (--length2 === 0) {
1557
+ exit = true;
1558
+ break;
1559
+ }
1560
+ } else {
1561
+ array[dest++] = tmp[cursor1++];
1562
+ count1++;
1563
+ count2 = 0;
1564
+ if (--length1 === 1) {
1565
+ exit = true;
1566
+ break;
1567
+ }
1568
+ }
1569
+ } while ((count1 | count2) < minGallop);
1570
+ if (exit) {
1571
+ break;
1572
+ }
1573
+ do {
1574
+ count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);
1575
+ if (count1 !== 0) {
1576
+ for (i = 0; i < count1; i++) {
1577
+ array[dest + i] = tmp[cursor1 + i];
1578
+ }
1579
+ dest += count1;
1580
+ cursor1 += count1;
1581
+ length1 -= count1;
1582
+ if (length1 <= 1) {
1583
+ exit = true;
1584
+ break;
1585
+ }
1586
+ }
1550
1587
  array[dest++] = array[cursor2++];
1551
- count2++;
1552
- count1 = 0;
1553
1588
  if (--length2 === 0) {
1554
1589
  exit = true;
1555
1590
  break;
1556
1591
  }
1557
- } else {
1592
+ count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);
1593
+ if (count2 !== 0) {
1594
+ for (i = 0; i < count2; i++) {
1595
+ array[dest + i] = array[cursor2 + i];
1596
+ }
1597
+ dest += count2;
1598
+ cursor2 += count2;
1599
+ length2 -= count2;
1600
+ if (length2 === 0) {
1601
+ exit = true;
1602
+ break;
1603
+ }
1604
+ }
1558
1605
  array[dest++] = tmp[cursor1++];
1559
- count1++;
1560
- count2 = 0;
1561
1606
  if (--length1 === 1) {
1562
1607
  exit = true;
1563
1608
  break;
1564
1609
  }
1565
- }
1566
- } while ((count1 | count2) < minGallop);
1567
- if (exit) {
1568
- break;
1569
- }
1570
- do {
1571
- count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);
1572
- if (count1 !== 0) {
1573
- for (i = 0; i < count1; i++) {
1574
- array[dest + i] = tmp[cursor1 + i];
1575
- }
1576
- dest += count1;
1577
- cursor1 += count1;
1578
- length1 -= count1;
1579
- if (length1 <= 1) {
1580
- exit = true;
1581
- break;
1582
- }
1583
- }
1584
- array[dest++] = array[cursor2++];
1585
- if (--length2 === 0) {
1586
- exit = true;
1610
+ minGallop--;
1611
+ } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
1612
+ if (exit) {
1587
1613
  break;
1588
1614
  }
1589
- count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);
1590
- if (count2 !== 0) {
1591
- for (i = 0; i < count2; i++) {
1592
- array[dest + i] = array[cursor2 + i];
1593
- }
1594
- dest += count2;
1595
- cursor2 += count2;
1596
- length2 -= count2;
1597
- if (length2 === 0) {
1598
- exit = true;
1599
- break;
1600
- }
1601
- }
1602
- array[dest++] = tmp[cursor1++];
1603
- if (--length1 === 1) {
1604
- exit = true;
1605
- break;
1615
+ if (minGallop < 0) {
1616
+ minGallop = 0;
1606
1617
  }
1607
- minGallop--;
1608
- } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
1609
- if (exit) {
1610
- break;
1611
- }
1612
- if (minGallop < 0) {
1613
- minGallop = 0;
1618
+ minGallop += 2;
1614
1619
  }
1615
- minGallop += 2;
1616
- }
1617
- this.minGallop = minGallop;
1618
- if (minGallop < 1) {
1619
- this.minGallop = 1;
1620
- }
1621
- if (length1 === 1) {
1622
- for (i = 0; i < length2; i++) {
1623
- array[dest + i] = array[cursor2 + i];
1620
+ this.minGallop = minGallop;
1621
+ if (minGallop < 1) {
1622
+ this.minGallop = 1;
1624
1623
  }
1625
- array[dest + length2] = tmp[cursor1];
1626
- } else if (length1 === 0) {
1627
- throw new Error("mergeLow preconditions were not respected");
1628
- } else {
1629
- for (i = 0; i < length1; i++) {
1630
- array[dest + i] = tmp[cursor1 + i];
1624
+ if (length1 === 1) {
1625
+ for (i = 0; i < length2; i++) {
1626
+ array[dest + i] = array[cursor2 + i];
1627
+ }
1628
+ array[dest + length2] = tmp[cursor1];
1629
+ } else if (length1 === 0) {
1630
+ throw new Error("mergeLow preconditions were not respected");
1631
+ } else {
1632
+ for (i = 0; i < length1; i++) {
1633
+ array[dest + i] = tmp[cursor1 + i];
1634
+ }
1631
1635
  }
1632
- }
1633
- };
1634
- TimSort2.prototype.mergeHigh = function mergeHigh(start1, length1, start2, length2) {
1635
- var compare = this.compare;
1636
- var array = this.array;
1637
- var tmp = this.tmp;
1638
- var i = 0;
1639
- for (i = 0; i < length2; i++) {
1640
- tmp[i] = array[start2 + i];
1641
- }
1642
- var cursor1 = start1 + length1 - 1;
1643
- var cursor2 = length2 - 1;
1644
- var dest = start2 + length2 - 1;
1645
- var customCursor = 0;
1646
- var customDest = 0;
1647
- array[dest--] = array[cursor1--];
1648
- if (--length1 === 0) {
1649
- customCursor = dest - (length2 - 1);
1636
+ };
1637
+ TimSort2.prototype.mergeHigh = function mergeHigh(start1, length1, start2, length2) {
1638
+ var compare = this.compare;
1639
+ var array = this.array;
1640
+ var tmp = this.tmp;
1641
+ var i = 0;
1650
1642
  for (i = 0; i < length2; i++) {
1651
- array[customCursor + i] = tmp[i];
1643
+ tmp[i] = array[start2 + i];
1652
1644
  }
1653
- return;
1654
- }
1655
- if (length2 === 1) {
1656
- dest -= length1;
1657
- cursor1 -= length1;
1658
- customDest = dest + 1;
1659
- customCursor = cursor1 + 1;
1660
- for (i = length1 - 1; i >= 0; i--) {
1661
- array[customDest + i] = array[customCursor + i];
1645
+ var cursor1 = start1 + length1 - 1;
1646
+ var cursor2 = length2 - 1;
1647
+ var dest = start2 + length2 - 1;
1648
+ var customCursor = 0;
1649
+ var customDest = 0;
1650
+ array[dest--] = array[cursor1--];
1651
+ if (--length1 === 0) {
1652
+ customCursor = dest - (length2 - 1);
1653
+ for (i = 0; i < length2; i++) {
1654
+ array[customCursor + i] = tmp[i];
1655
+ }
1656
+ return;
1662
1657
  }
1663
- array[dest] = tmp[cursor2];
1664
- return;
1665
- }
1666
- var minGallop = this.minGallop;
1667
- while (true) {
1668
- var count1 = 0;
1669
- var count2 = 0;
1670
- var exit = false;
1671
- do {
1672
- if (compare(tmp[cursor2], array[cursor1]) < 0) {
1673
- array[dest--] = array[cursor1--];
1674
- count1++;
1675
- count2 = 0;
1676
- if (--length1 === 0) {
1677
- exit = true;
1678
- break;
1658
+ if (length2 === 1) {
1659
+ dest -= length1;
1660
+ cursor1 -= length1;
1661
+ customDest = dest + 1;
1662
+ customCursor = cursor1 + 1;
1663
+ for (i = length1 - 1; i >= 0; i--) {
1664
+ array[customDest + i] = array[customCursor + i];
1665
+ }
1666
+ array[dest] = tmp[cursor2];
1667
+ return;
1668
+ }
1669
+ var minGallop = this.minGallop;
1670
+ while (true) {
1671
+ var count1 = 0;
1672
+ var count2 = 0;
1673
+ var exit = false;
1674
+ do {
1675
+ if (compare(tmp[cursor2], array[cursor1]) < 0) {
1676
+ array[dest--] = array[cursor1--];
1677
+ count1++;
1678
+ count2 = 0;
1679
+ if (--length1 === 0) {
1680
+ exit = true;
1681
+ break;
1682
+ }
1683
+ } else {
1684
+ array[dest--] = tmp[cursor2--];
1685
+ count2++;
1686
+ count1 = 0;
1687
+ if (--length2 === 1) {
1688
+ exit = true;
1689
+ break;
1690
+ }
1691
+ }
1692
+ } while ((count1 | count2) < minGallop);
1693
+ if (exit) {
1694
+ break;
1695
+ }
1696
+ do {
1697
+ count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);
1698
+ if (count1 !== 0) {
1699
+ dest -= count1;
1700
+ cursor1 -= count1;
1701
+ length1 -= count1;
1702
+ customDest = dest + 1;
1703
+ customCursor = cursor1 + 1;
1704
+ for (i = count1 - 1; i >= 0; i--) {
1705
+ array[customDest + i] = array[customCursor + i];
1706
+ }
1707
+ if (length1 === 0) {
1708
+ exit = true;
1709
+ break;
1710
+ }
1679
1711
  }
1680
- } else {
1681
1712
  array[dest--] = tmp[cursor2--];
1682
- count2++;
1683
- count1 = 0;
1684
1713
  if (--length2 === 1) {
1685
1714
  exit = true;
1686
1715
  break;
1687
1716
  }
1688
- }
1689
- } while ((count1 | count2) < minGallop);
1690
- if (exit) {
1691
- break;
1692
- }
1693
- do {
1694
- count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);
1695
- if (count1 !== 0) {
1696
- dest -= count1;
1697
- cursor1 -= count1;
1698
- length1 -= count1;
1699
- customDest = dest + 1;
1700
- customCursor = cursor1 + 1;
1701
- for (i = count1 - 1; i >= 0; i--) {
1702
- array[customDest + i] = array[customCursor + i];
1717
+ count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);
1718
+ if (count2 !== 0) {
1719
+ dest -= count2;
1720
+ cursor2 -= count2;
1721
+ length2 -= count2;
1722
+ customDest = dest + 1;
1723
+ customCursor = cursor2 + 1;
1724
+ for (i = 0; i < count2; i++) {
1725
+ array[customDest + i] = tmp[customCursor + i];
1726
+ }
1727
+ if (length2 <= 1) {
1728
+ exit = true;
1729
+ break;
1730
+ }
1703
1731
  }
1704
- if (length1 === 0) {
1732
+ array[dest--] = array[cursor1--];
1733
+ if (--length1 === 0) {
1705
1734
  exit = true;
1706
1735
  break;
1707
1736
  }
1708
- }
1709
- array[dest--] = tmp[cursor2--];
1710
- if (--length2 === 1) {
1711
- exit = true;
1737
+ minGallop--;
1738
+ } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
1739
+ if (exit) {
1712
1740
  break;
1713
1741
  }
1714
- count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);
1715
- if (count2 !== 0) {
1716
- dest -= count2;
1717
- cursor2 -= count2;
1718
- length2 -= count2;
1719
- customDest = dest + 1;
1720
- customCursor = cursor2 + 1;
1721
- for (i = 0; i < count2; i++) {
1722
- array[customDest + i] = tmp[customCursor + i];
1723
- }
1724
- if (length2 <= 1) {
1725
- exit = true;
1726
- break;
1727
- }
1728
- }
1729
- array[dest--] = array[cursor1--];
1730
- if (--length1 === 0) {
1731
- exit = true;
1732
- break;
1742
+ if (minGallop < 0) {
1743
+ minGallop = 0;
1733
1744
  }
1734
- minGallop--;
1735
- } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
1736
- if (exit) {
1737
- break;
1745
+ minGallop += 2;
1738
1746
  }
1739
- if (minGallop < 0) {
1740
- minGallop = 0;
1747
+ this.minGallop = minGallop;
1748
+ if (minGallop < 1) {
1749
+ this.minGallop = 1;
1741
1750
  }
1742
- minGallop += 2;
1751
+ if (length2 === 1) {
1752
+ dest -= length1;
1753
+ cursor1 -= length1;
1754
+ customDest = dest + 1;
1755
+ customCursor = cursor1 + 1;
1756
+ for (i = length1 - 1; i >= 0; i--) {
1757
+ array[customDest + i] = array[customCursor + i];
1758
+ }
1759
+ array[dest] = tmp[cursor2];
1760
+ } else if (length2 === 0) {
1761
+ throw new Error("mergeHigh preconditions were not respected");
1762
+ } else {
1763
+ customCursor = dest - (length2 - 1);
1764
+ for (i = 0; i < length2; i++) {
1765
+ array[customCursor + i] = tmp[i];
1766
+ }
1767
+ }
1768
+ };
1769
+ return TimSort2;
1770
+ }();
1771
+ function sort(array, compare, lo, hi) {
1772
+ if (!Array.isArray(array)) {
1773
+ throw new TypeError("Can only sort arrays");
1743
1774
  }
1744
- this.minGallop = minGallop;
1745
- if (minGallop < 1) {
1746
- this.minGallop = 1;
1775
+ if (!compare) {
1776
+ compare = alphabeticalCompare;
1777
+ } else if (typeof compare !== "function") {
1778
+ hi = lo;
1779
+ lo = compare;
1780
+ compare = alphabeticalCompare;
1747
1781
  }
1748
- if (length2 === 1) {
1749
- dest -= length1;
1750
- cursor1 -= length1;
1751
- customDest = dest + 1;
1752
- customCursor = cursor1 + 1;
1753
- for (i = length1 - 1; i >= 0; i--) {
1754
- array[customDest + i] = array[customCursor + i];
1755
- }
1756
- array[dest] = tmp[cursor2];
1757
- } else if (length2 === 0) {
1758
- throw new Error("mergeHigh preconditions were not respected");
1759
- } else {
1760
- customCursor = dest - (length2 - 1);
1761
- for (i = 0; i < length2; i++) {
1762
- array[customCursor + i] = tmp[i];
1763
- }
1782
+ if (!lo) {
1783
+ lo = 0;
1764
1784
  }
1765
- };
1766
- return TimSort2;
1767
- }();
1768
- function sort(array, compare, lo, hi) {
1769
- if (!Array.isArray(array)) {
1770
- throw new TypeError("Can only sort arrays");
1771
- }
1772
- if (!compare) {
1773
- compare = alphabeticalCompare;
1774
- } else if (typeof compare !== "function") {
1775
- hi = lo;
1776
- lo = compare;
1777
- compare = alphabeticalCompare;
1778
- }
1779
- if (!lo) {
1780
- lo = 0;
1781
- }
1782
- if (!hi) {
1783
- hi = array.length;
1784
- }
1785
- var remaining = hi - lo;
1786
- if (remaining < 2) {
1787
- return;
1788
- }
1789
- var runLength = 0;
1790
- if (remaining < DEFAULT_MIN_MERGE) {
1791
- runLength = makeAscendingRun(array, lo, hi, compare);
1792
- binaryInsertionSort(array, lo, hi, lo + runLength, compare);
1793
- return;
1794
- }
1795
- var ts = new TimSort(array, compare);
1796
- var minRun = minRunLength(remaining);
1797
- do {
1798
- runLength = makeAscendingRun(array, lo, hi, compare);
1799
- if (runLength < minRun) {
1800
- var force = remaining;
1801
- if (force > minRun) {
1802
- force = minRun;
1803
- }
1804
- binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);
1805
- runLength = force;
1785
+ if (!hi) {
1786
+ hi = array.length;
1806
1787
  }
1807
- ts.pushRun(lo, runLength);
1808
- ts.mergeRuns();
1809
- remaining -= runLength;
1810
- lo += runLength;
1811
- } while (remaining !== 0);
1812
- ts.forceMergeRuns();
1813
- }
1814
- });
1815
- })(timsort$1);
1816
- var timsort = timsort$1;
1817
- function lessThanZeroError(p) {
1818
- return 'Expect percentile to be >= 0 but given "' + p + '" and its type is "' + typeof p + '".';
1819
- }
1820
- function greaterThanHundredError(p) {
1821
- return 'Expect percentile to be <= 100 but given "' + p + '" and its type is "' + typeof p + '".';
1822
- }
1823
- function nanError(p) {
1824
- return 'Expect percentile to be a number but given "' + p + '" and its type is "' + typeof p + '".';
1825
- }
1826
- function validateInput(ps) {
1827
- return ps.reduce(function(errors, p) {
1828
- if (isNaN(Number(p))) {
1829
- errors.push(nanError(p));
1830
- } else if (p < 0) {
1831
- errors.push(lessThanZeroError(p));
1832
- } else if (p > 100) {
1833
- errors.push(greaterThanHundredError(p));
1834
- }
1835
- return errors;
1836
- }, []);
1788
+ var remaining = hi - lo;
1789
+ if (remaining < 2) {
1790
+ return;
1791
+ }
1792
+ var runLength = 0;
1793
+ if (remaining < DEFAULT_MIN_MERGE) {
1794
+ runLength = makeAscendingRun(array, lo, hi, compare);
1795
+ binaryInsertionSort(array, lo, hi, lo + runLength, compare);
1796
+ return;
1797
+ }
1798
+ var ts = new TimSort(array, compare);
1799
+ var minRun = minRunLength(remaining);
1800
+ do {
1801
+ runLength = makeAscendingRun(array, lo, hi, compare);
1802
+ if (runLength < minRun) {
1803
+ var force = remaining;
1804
+ if (force > minRun) {
1805
+ force = minRun;
1806
+ }
1807
+ binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);
1808
+ runLength = force;
1809
+ }
1810
+ ts.pushRun(lo, runLength);
1811
+ ts.mergeRuns();
1812
+ remaining -= runLength;
1813
+ lo += runLength;
1814
+ } while (remaining !== 0);
1815
+ ts.forceMergeRuns();
1816
+ }
1817
+ });
1818
+ })(timsort$1);
1819
+ return timsort$1;
1837
1820
  }
1838
- function getPsValue(p, list) {
1839
- if (p === 0) return list[0];
1840
- var kIndex = Math.ceil(list.length * (p / 100)) - 1;
1841
- return list[kIndex];
1821
+ var timsort;
1822
+ var hasRequiredTimsort;
1823
+ function requireTimsort() {
1824
+ if (hasRequiredTimsort) return timsort;
1825
+ hasRequiredTimsort = 1;
1826
+ timsort = requireTimsort$1();
1827
+ return timsort;
1842
1828
  }
1843
- function percentile(pOrPs, list, fn) {
1844
- var ps = Array.isArray(pOrPs) ? pOrPs : [pOrPs];
1845
- var validationErrors = validateInput(ps);
1846
- if (validationErrors.length) {
1847
- throw new Error(validationErrors.join(" "));
1848
- }
1849
- list = list.slice().sort(function(a, b) {
1850
- if (fn) {
1851
- a = fn(a);
1852
- b = fn(b);
1853
- }
1854
- a = Number.isNaN(a) ? Number.NEGATIVE_INFINITY : a;
1855
- b = Number.isNaN(b) ? Number.NEGATIVE_INFINITY : b;
1856
- if (a > b) return 1;
1857
- if (a < b) return -1;
1858
- return 0;
1859
- });
1860
- if (ps.length === 1) {
1861
- return getPsValue(ps[0], list);
1829
+ var timsortExports = requireTimsort();
1830
+ var lib;
1831
+ var hasRequiredLib;
1832
+ function requireLib() {
1833
+ if (hasRequiredLib) return lib;
1834
+ hasRequiredLib = 1;
1835
+ function lessThanZeroError(p) {
1836
+ return 'Expect percentile to be >= 0 but given "' + p + '" and its type is "' + typeof p + '".';
1837
+ }
1838
+ function greaterThanHundredError(p) {
1839
+ return 'Expect percentile to be <= 100 but given "' + p + '" and its type is "' + typeof p + '".';
1840
+ }
1841
+ function nanError(p) {
1842
+ return 'Expect percentile to be a number but given "' + p + '" and its type is "' + typeof p + '".';
1843
+ }
1844
+ function validateInput(ps) {
1845
+ return ps.reduce(function(errors, p) {
1846
+ if (isNaN(Number(p))) {
1847
+ errors.push(nanError(p));
1848
+ } else if (p < 0) {
1849
+ errors.push(lessThanZeroError(p));
1850
+ } else if (p > 100) {
1851
+ errors.push(greaterThanHundredError(p));
1852
+ }
1853
+ return errors;
1854
+ }, []);
1855
+ }
1856
+ function getPsValue(p, list) {
1857
+ if (p === 0) return list[0];
1858
+ var kIndex = Math.ceil(list.length * (p / 100)) - 1;
1859
+ return list[kIndex];
1860
+ }
1861
+ function percentile2(pOrPs, list, fn) {
1862
+ var ps = Array.isArray(pOrPs) ? pOrPs : [pOrPs];
1863
+ var validationErrors = validateInput(ps);
1864
+ if (validationErrors.length) {
1865
+ throw new Error(validationErrors.join(" "));
1866
+ }
1867
+ list = list.slice().sort(function(a, b) {
1868
+ if (fn) {
1869
+ a = fn(a);
1870
+ b = fn(b);
1871
+ }
1872
+ a = Number.isNaN(a) ? Number.NEGATIVE_INFINITY : a;
1873
+ b = Number.isNaN(b) ? Number.NEGATIVE_INFINITY : b;
1874
+ if (a > b) return 1;
1875
+ if (a < b) return -1;
1876
+ return 0;
1877
+ });
1878
+ if (ps.length === 1) {
1879
+ return getPsValue(ps[0], list);
1880
+ }
1881
+ return ps.map(function(p) {
1882
+ return getPsValue(p, list);
1883
+ });
1862
1884
  }
1863
- return ps.map(function(p) {
1864
- return getPsValue(p, list);
1865
- });
1885
+ lib = percentile2;
1886
+ return lib;
1866
1887
  }
1867
- var lib = percentile;
1868
- const percentile$1 = /* @__PURE__ */ getDefaultExportFromCjs(lib);
1888
+ var libExports = requireLib();
1889
+ const percentile = /* @__PURE__ */ getDefaultExportFromCjs(libExports);
1869
1890
  class InstrumentGaugeOptions extends InstrumentBaseOptions {
1870
1891
  constructor() {
1871
1892
  super(...arguments);
@@ -2131,8 +2152,8 @@ NumberCompare_fn = function(a, b) {
2131
2152
  };
2132
2153
  GetPercentileData_fn = function() {
2133
2154
  const sortedList = __privateGet(this, _timeSeriesList).slice(0);
2134
- timsort.sort(sortedList, __privateMethod(this, _InstrumentGauge_instances, NumberCompare_fn));
2135
- return percentile$1([50, 80, 90, 95, 99, 99.95], sortedList);
2155
+ timsortExports.sort(sortedList, __privateMethod(this, _InstrumentGauge_instances, NumberCompare_fn));
2156
+ return percentile([50, 80, 90, 95, 99, 99.95], sortedList);
2136
2157
  };
2137
2158
  class InstrumentObjectOptions extends InstrumentBaseOptions {
2138
2159
  constructor() {
@@ -2472,7 +2493,7 @@ class RequestLoggerMiddleware extends STSOptionsBase {
2472
2493
  }
2473
2494
  _tinyEmitter = new WeakMap();
2474
2495
  _RequestCompleted = new WeakMap();
2475
- var ansiStyles$1 = { exports: {} };
2496
+ var ansiStyles = { exports: {} };
2476
2497
  var colorName;
2477
2498
  var hasRequiredColorName;
2478
2499
  function requireColorName() {
@@ -3435,181 +3456,200 @@ function requireColorConvert() {
3435
3456
  colorConvert = convert;
3436
3457
  return colorConvert;
3437
3458
  }
3438
- ansiStyles$1.exports;
3439
- (function(module) {
3440
- const wrapAnsi16 = (fn, offset) => (...args) => {
3441
- const code = fn(...args);
3442
- return `\x1B[${code + offset}m`;
3443
- };
3444
- const wrapAnsi256 = (fn, offset) => (...args) => {
3445
- const code = fn(...args);
3446
- return `\x1B[${38 + offset};5;${code}m`;
3447
- };
3448
- const wrapAnsi16m = (fn, offset) => (...args) => {
3449
- const rgb = fn(...args);
3450
- return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
3451
- };
3452
- const ansi2ansi = (n) => n;
3453
- const rgb2rgb = (r, g, b) => [r, g, b];
3454
- const setLazyProperty = (object, property, get) => {
3455
- Object.defineProperty(object, property, {
3456
- get: () => {
3457
- const value = get();
3458
- Object.defineProperty(object, property, {
3459
- value,
3460
- enumerable: true,
3461
- configurable: true
3462
- });
3463
- return value;
3464
- },
3465
- enumerable: true,
3466
- configurable: true
3467
- });
3468
- };
3469
- let colorConvert2;
3470
- const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
3471
- if (colorConvert2 === void 0) {
3472
- colorConvert2 = requireColorConvert();
3473
- }
3474
- const offset = isBackground ? 10 : 0;
3475
- const styles2 = {};
3476
- for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
3477
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
3478
- if (sourceSpace === targetSpace) {
3479
- styles2[name] = wrap(identity, offset);
3480
- } else if (typeof suite === "object") {
3481
- styles2[name] = wrap(suite[targetSpace], offset);
3482
- }
3483
- }
3484
- return styles2;
3485
- };
3486
- function assembleStyles() {
3487
- const codes = /* @__PURE__ */ new Map();
3488
- const styles2 = {
3489
- modifier: {
3490
- reset: [0, 0],
3491
- // 21 isn't widely supported and 22 does the same thing
3492
- bold: [1, 22],
3493
- dim: [2, 22],
3494
- italic: [3, 23],
3495
- underline: [4, 24],
3496
- inverse: [7, 27],
3497
- hidden: [8, 28],
3498
- strikethrough: [9, 29]
3499
- },
3500
- color: {
3501
- black: [30, 39],
3502
- red: [31, 39],
3503
- green: [32, 39],
3504
- yellow: [33, 39],
3505
- blue: [34, 39],
3506
- magenta: [35, 39],
3507
- cyan: [36, 39],
3508
- white: [37, 39],
3509
- // Bright color
3510
- blackBright: [90, 39],
3511
- redBright: [91, 39],
3512
- greenBright: [92, 39],
3513
- yellowBright: [93, 39],
3514
- blueBright: [94, 39],
3515
- magentaBright: [95, 39],
3516
- cyanBright: [96, 39],
3517
- whiteBright: [97, 39]
3518
- },
3519
- bgColor: {
3520
- bgBlack: [40, 49],
3521
- bgRed: [41, 49],
3522
- bgGreen: [42, 49],
3523
- bgYellow: [43, 49],
3524
- bgBlue: [44, 49],
3525
- bgMagenta: [45, 49],
3526
- bgCyan: [46, 49],
3527
- bgWhite: [47, 49],
3528
- // Bright color
3529
- bgBlackBright: [100, 49],
3530
- bgRedBright: [101, 49],
3531
- bgGreenBright: [102, 49],
3532
- bgYellowBright: [103, 49],
3533
- bgBlueBright: [104, 49],
3534
- bgMagentaBright: [105, 49],
3535
- bgCyanBright: [106, 49],
3536
- bgWhiteBright: [107, 49]
3459
+ ansiStyles.exports;
3460
+ var hasRequiredAnsiStyles;
3461
+ function requireAnsiStyles() {
3462
+ if (hasRequiredAnsiStyles) return ansiStyles.exports;
3463
+ hasRequiredAnsiStyles = 1;
3464
+ (function(module) {
3465
+ const wrapAnsi16 = (fn, offset) => (...args) => {
3466
+ const code = fn(...args);
3467
+ return `\x1B[${code + offset}m`;
3468
+ };
3469
+ const wrapAnsi256 = (fn, offset) => (...args) => {
3470
+ const code = fn(...args);
3471
+ return `\x1B[${38 + offset};5;${code}m`;
3472
+ };
3473
+ const wrapAnsi16m = (fn, offset) => (...args) => {
3474
+ const rgb = fn(...args);
3475
+ return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
3476
+ };
3477
+ const ansi2ansi = (n) => n;
3478
+ const rgb2rgb = (r, g, b) => [r, g, b];
3479
+ const setLazyProperty = (object, property, get) => {
3480
+ Object.defineProperty(object, property, {
3481
+ get: () => {
3482
+ const value = get();
3483
+ Object.defineProperty(object, property, {
3484
+ value,
3485
+ enumerable: true,
3486
+ configurable: true
3487
+ });
3488
+ return value;
3489
+ },
3490
+ enumerable: true,
3491
+ configurable: true
3492
+ });
3493
+ };
3494
+ let colorConvert2;
3495
+ const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
3496
+ if (colorConvert2 === void 0) {
3497
+ colorConvert2 = requireColorConvert();
3498
+ }
3499
+ const offset = isBackground ? 10 : 0;
3500
+ const styles = {};
3501
+ for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
3502
+ const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
3503
+ if (sourceSpace === targetSpace) {
3504
+ styles[name] = wrap(identity, offset);
3505
+ } else if (typeof suite === "object") {
3506
+ styles[name] = wrap(suite[targetSpace], offset);
3507
+ }
3537
3508
  }
3509
+ return styles;
3538
3510
  };
3539
- styles2.color.gray = styles2.color.blackBright;
3540
- styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
3541
- styles2.color.grey = styles2.color.blackBright;
3542
- styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
3543
- for (const [groupName, group] of Object.entries(styles2)) {
3544
- for (const [styleName, style] of Object.entries(group)) {
3545
- styles2[styleName] = {
3546
- open: `\x1B[${style[0]}m`,
3547
- close: `\x1B[${style[1]}m`
3548
- };
3549
- group[styleName] = styles2[styleName];
3550
- codes.set(style[0], style[1]);
3511
+ function assembleStyles() {
3512
+ const codes = /* @__PURE__ */ new Map();
3513
+ const styles = {
3514
+ modifier: {
3515
+ reset: [0, 0],
3516
+ // 21 isn't widely supported and 22 does the same thing
3517
+ bold: [1, 22],
3518
+ dim: [2, 22],
3519
+ italic: [3, 23],
3520
+ underline: [4, 24],
3521
+ inverse: [7, 27],
3522
+ hidden: [8, 28],
3523
+ strikethrough: [9, 29]
3524
+ },
3525
+ color: {
3526
+ black: [30, 39],
3527
+ red: [31, 39],
3528
+ green: [32, 39],
3529
+ yellow: [33, 39],
3530
+ blue: [34, 39],
3531
+ magenta: [35, 39],
3532
+ cyan: [36, 39],
3533
+ white: [37, 39],
3534
+ // Bright color
3535
+ blackBright: [90, 39],
3536
+ redBright: [91, 39],
3537
+ greenBright: [92, 39],
3538
+ yellowBright: [93, 39],
3539
+ blueBright: [94, 39],
3540
+ magentaBright: [95, 39],
3541
+ cyanBright: [96, 39],
3542
+ whiteBright: [97, 39]
3543
+ },
3544
+ bgColor: {
3545
+ bgBlack: [40, 49],
3546
+ bgRed: [41, 49],
3547
+ bgGreen: [42, 49],
3548
+ bgYellow: [43, 49],
3549
+ bgBlue: [44, 49],
3550
+ bgMagenta: [45, 49],
3551
+ bgCyan: [46, 49],
3552
+ bgWhite: [47, 49],
3553
+ // Bright color
3554
+ bgBlackBright: [100, 49],
3555
+ bgRedBright: [101, 49],
3556
+ bgGreenBright: [102, 49],
3557
+ bgYellowBright: [103, 49],
3558
+ bgBlueBright: [104, 49],
3559
+ bgMagentaBright: [105, 49],
3560
+ bgCyanBright: [106, 49],
3561
+ bgWhiteBright: [107, 49]
3562
+ }
3563
+ };
3564
+ styles.color.gray = styles.color.blackBright;
3565
+ styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
3566
+ styles.color.grey = styles.color.blackBright;
3567
+ styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
3568
+ for (const [groupName, group] of Object.entries(styles)) {
3569
+ for (const [styleName, style] of Object.entries(group)) {
3570
+ styles[styleName] = {
3571
+ open: `\x1B[${style[0]}m`,
3572
+ close: `\x1B[${style[1]}m`
3573
+ };
3574
+ group[styleName] = styles[styleName];
3575
+ codes.set(style[0], style[1]);
3576
+ }
3577
+ Object.defineProperty(styles, groupName, {
3578
+ value: group,
3579
+ enumerable: false
3580
+ });
3551
3581
  }
3552
- Object.defineProperty(styles2, groupName, {
3553
- value: group,
3582
+ Object.defineProperty(styles, "codes", {
3583
+ value: codes,
3554
3584
  enumerable: false
3555
3585
  });
3556
- }
3557
- Object.defineProperty(styles2, "codes", {
3558
- value: codes,
3559
- enumerable: false
3586
+ styles.color.close = "\x1B[39m";
3587
+ styles.bgColor.close = "\x1B[49m";
3588
+ setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
3589
+ setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
3590
+ setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
3591
+ setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
3592
+ setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
3593
+ setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
3594
+ return styles;
3595
+ }
3596
+ Object.defineProperty(module, "exports", {
3597
+ enumerable: true,
3598
+ get: assembleStyles
3560
3599
  });
3561
- styles2.color.close = "\x1B[39m";
3562
- styles2.bgColor.close = "\x1B[49m";
3563
- setLazyProperty(styles2.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
3564
- setLazyProperty(styles2.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
3565
- setLazyProperty(styles2.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
3566
- setLazyProperty(styles2.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
3567
- setLazyProperty(styles2.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
3568
- setLazyProperty(styles2.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
3569
- return styles2;
3570
- }
3571
- Object.defineProperty(module, "exports", {
3572
- enumerable: true,
3573
- get: assembleStyles
3574
- });
3575
- })(ansiStyles$1);
3576
- var ansiStylesExports = ansiStyles$1.exports;
3577
- var browser = {
3578
- stdout: false,
3579
- stderr: false
3580
- };
3581
- const stringReplaceAll$1 = (string, substring, replacer) => {
3582
- let index = string.indexOf(substring);
3583
- if (index === -1) {
3584
- return string;
3585
- }
3586
- const substringLength = substring.length;
3587
- let endIndex = 0;
3588
- let returnValue = "";
3589
- do {
3590
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
3591
- endIndex = index + substringLength;
3592
- index = string.indexOf(substring, endIndex);
3593
- } while (index !== -1);
3594
- returnValue += string.substr(endIndex);
3595
- return returnValue;
3596
- };
3597
- const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
3598
- let endIndex = 0;
3599
- let returnValue = "";
3600
- do {
3601
- const gotCR = string[index - 1] === "\r";
3602
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
3603
- endIndex = index + 1;
3604
- index = string.indexOf("\n", endIndex);
3605
- } while (index !== -1);
3606
- returnValue += string.substr(endIndex);
3607
- return returnValue;
3608
- };
3609
- var util = {
3610
- stringReplaceAll: stringReplaceAll$1,
3611
- stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
3612
- };
3600
+ })(ansiStyles);
3601
+ return ansiStyles.exports;
3602
+ }
3603
+ var browser;
3604
+ var hasRequiredBrowser;
3605
+ function requireBrowser() {
3606
+ if (hasRequiredBrowser) return browser;
3607
+ hasRequiredBrowser = 1;
3608
+ browser = {
3609
+ stdout: false,
3610
+ stderr: false
3611
+ };
3612
+ return browser;
3613
+ }
3614
+ var util;
3615
+ var hasRequiredUtil;
3616
+ function requireUtil() {
3617
+ if (hasRequiredUtil) return util;
3618
+ hasRequiredUtil = 1;
3619
+ const stringReplaceAll = (string, substring, replacer) => {
3620
+ let index = string.indexOf(substring);
3621
+ if (index === -1) {
3622
+ return string;
3623
+ }
3624
+ const substringLength = substring.length;
3625
+ let endIndex = 0;
3626
+ let returnValue = "";
3627
+ do {
3628
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
3629
+ endIndex = index + substringLength;
3630
+ index = string.indexOf(substring, endIndex);
3631
+ } while (index !== -1);
3632
+ returnValue += string.substr(endIndex);
3633
+ return returnValue;
3634
+ };
3635
+ const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
3636
+ let endIndex = 0;
3637
+ let returnValue = "";
3638
+ do {
3639
+ const gotCR = string[index - 1] === "\r";
3640
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
3641
+ endIndex = index + 1;
3642
+ index = string.indexOf("\n", endIndex);
3643
+ } while (index !== -1);
3644
+ returnValue += string.substr(endIndex);
3645
+ return returnValue;
3646
+ };
3647
+ util = {
3648
+ stringReplaceAll,
3649
+ stringEncaseCRLFWithFirstIndex
3650
+ };
3651
+ return util;
3652
+ }
3613
3653
  var templates;
3614
3654
  var hasRequiredTemplates;
3615
3655
  function requireTemplates() {
@@ -3673,27 +3713,27 @@ function requireTemplates() {
3673
3713
  }
3674
3714
  return results;
3675
3715
  }
3676
- function buildStyle(chalk2, styles2) {
3716
+ function buildStyle(chalk2, styles) {
3677
3717
  const enabled = {};
3678
- for (const layer of styles2) {
3718
+ for (const layer of styles) {
3679
3719
  for (const style of layer.styles) {
3680
3720
  enabled[style[0]] = layer.inverse ? null : style.slice(1);
3681
3721
  }
3682
3722
  }
3683
3723
  let current = chalk2;
3684
- for (const [styleName, styles3] of Object.entries(enabled)) {
3685
- if (!Array.isArray(styles3)) {
3724
+ for (const [styleName, styles2] of Object.entries(enabled)) {
3725
+ if (!Array.isArray(styles2)) {
3686
3726
  continue;
3687
3727
  }
3688
3728
  if (!(styleName in current)) {
3689
3729
  throw new Error(`Unknown Chalk style: ${styleName}`);
3690
3730
  }
3691
- current = styles3.length > 0 ? current[styleName](...styles3) : current[styleName];
3731
+ current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
3692
3732
  }
3693
3733
  return current;
3694
3734
  }
3695
3735
  templates = (chalk2, temporary) => {
3696
- const styles2 = [];
3736
+ const styles = [];
3697
3737
  const chunks = [];
3698
3738
  let chunk = [];
3699
3739
  temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
@@ -3702,200 +3742,208 @@ function requireTemplates() {
3702
3742
  } else if (style) {
3703
3743
  const string = chunk.join("");
3704
3744
  chunk = [];
3705
- chunks.push(styles2.length === 0 ? string : buildStyle(chalk2, styles2)(string));
3706
- styles2.push({ inverse, styles: parseStyle(style) });
3745
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
3746
+ styles.push({ inverse, styles: parseStyle(style) });
3707
3747
  } else if (close) {
3708
- if (styles2.length === 0) {
3748
+ if (styles.length === 0) {
3709
3749
  throw new Error("Found extraneous } in Chalk template literal");
3710
3750
  }
3711
- chunks.push(buildStyle(chalk2, styles2)(chunk.join("")));
3751
+ chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
3712
3752
  chunk = [];
3713
- styles2.pop();
3753
+ styles.pop();
3714
3754
  } else {
3715
3755
  chunk.push(character);
3716
3756
  }
3717
3757
  });
3718
3758
  chunks.push(chunk.join(""));
3719
- if (styles2.length > 0) {
3720
- const errMessage = `Chalk template literal is missing ${styles2.length} closing bracket${styles2.length === 1 ? "" : "s"} (\`}\`)`;
3759
+ if (styles.length > 0) {
3760
+ const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
3721
3761
  throw new Error(errMessage);
3722
3762
  }
3723
3763
  return chunks.join("");
3724
3764
  };
3725
3765
  return templates;
3726
3766
  }
3727
- const ansiStyles = ansiStylesExports;
3728
- const { stdout: stdoutColor, stderr: stderrColor } = browser;
3729
- const {
3730
- stringReplaceAll,
3731
- stringEncaseCRLFWithFirstIndex
3732
- } = util;
3733
- const { isArray } = Array;
3734
- const levelMapping = [
3735
- "ansi",
3736
- "ansi",
3737
- "ansi256",
3738
- "ansi16m"
3739
- ];
3740
- const styles = /* @__PURE__ */ Object.create(null);
3741
- const applyOptions = (object, options = {}) => {
3742
- if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
3743
- throw new Error("The `level` option should be an integer from 0 to 3");
3744
- }
3745
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
3746
- object.level = options.level === void 0 ? colorLevel : options.level;
3747
- };
3748
- class ChalkClass {
3749
- constructor(options) {
3767
+ var source;
3768
+ var hasRequiredSource;
3769
+ function requireSource() {
3770
+ if (hasRequiredSource) return source;
3771
+ hasRequiredSource = 1;
3772
+ const ansiStyles2 = requireAnsiStyles();
3773
+ const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
3774
+ const {
3775
+ stringReplaceAll,
3776
+ stringEncaseCRLFWithFirstIndex
3777
+ } = requireUtil();
3778
+ const { isArray } = Array;
3779
+ const levelMapping = [
3780
+ "ansi",
3781
+ "ansi",
3782
+ "ansi256",
3783
+ "ansi16m"
3784
+ ];
3785
+ const styles = /* @__PURE__ */ Object.create(null);
3786
+ const applyOptions = (object, options = {}) => {
3787
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
3788
+ throw new Error("The `level` option should be an integer from 0 to 3");
3789
+ }
3790
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
3791
+ object.level = options.level === void 0 ? colorLevel : options.level;
3792
+ };
3793
+ class ChalkClass {
3794
+ constructor(options) {
3795
+ return chalkFactory(options);
3796
+ }
3797
+ }
3798
+ const chalkFactory = (options) => {
3799
+ const chalk3 = {};
3800
+ applyOptions(chalk3, options);
3801
+ chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
3802
+ Object.setPrototypeOf(chalk3, Chalk.prototype);
3803
+ Object.setPrototypeOf(chalk3.template, chalk3);
3804
+ chalk3.template.constructor = () => {
3805
+ throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
3806
+ };
3807
+ chalk3.template.Instance = ChalkClass;
3808
+ return chalk3.template;
3809
+ };
3810
+ function Chalk(options) {
3750
3811
  return chalkFactory(options);
3751
3812
  }
3752
- }
3753
- const chalkFactory = (options) => {
3754
- const chalk2 = {};
3755
- applyOptions(chalk2, options);
3756
- chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
3757
- Object.setPrototypeOf(chalk2, Chalk.prototype);
3758
- Object.setPrototypeOf(chalk2.template, chalk2);
3759
- chalk2.template.constructor = () => {
3760
- throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
3761
- };
3762
- chalk2.template.Instance = ChalkClass;
3763
- return chalk2.template;
3764
- };
3765
- function Chalk(options) {
3766
- return chalkFactory(options);
3767
- }
3768
- for (const [styleName, style] of Object.entries(ansiStyles)) {
3769
- styles[styleName] = {
3813
+ for (const [styleName, style] of Object.entries(ansiStyles2)) {
3814
+ styles[styleName] = {
3815
+ get() {
3816
+ const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
3817
+ Object.defineProperty(this, styleName, { value: builder });
3818
+ return builder;
3819
+ }
3820
+ };
3821
+ }
3822
+ styles.visible = {
3770
3823
  get() {
3771
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
3772
- Object.defineProperty(this, styleName, { value: builder });
3824
+ const builder = createBuilder(this, this._styler, true);
3825
+ Object.defineProperty(this, "visible", { value: builder });
3773
3826
  return builder;
3774
3827
  }
3775
3828
  };
3776
- }
3777
- styles.visible = {
3778
- get() {
3779
- const builder = createBuilder(this, this._styler, true);
3780
- Object.defineProperty(this, "visible", { value: builder });
3781
- return builder;
3829
+ const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
3830
+ for (const model of usedModels) {
3831
+ styles[model] = {
3832
+ get() {
3833
+ const { level } = this;
3834
+ return function(...arguments_) {
3835
+ const styler = createStyler(ansiStyles2.color[levelMapping[level]][model](...arguments_), ansiStyles2.color.close, this._styler);
3836
+ return createBuilder(this, styler, this._isEmpty);
3837
+ };
3838
+ }
3839
+ };
3782
3840
  }
3783
- };
3784
- const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
3785
- for (const model of usedModels) {
3786
- styles[model] = {
3787
- get() {
3788
- const { level } = this;
3789
- return function(...arguments_) {
3790
- const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
3791
- return createBuilder(this, styler, this._isEmpty);
3792
- };
3841
+ for (const model of usedModels) {
3842
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
3843
+ styles[bgModel] = {
3844
+ get() {
3845
+ const { level } = this;
3846
+ return function(...arguments_) {
3847
+ const styler = createStyler(ansiStyles2.bgColor[levelMapping[level]][model](...arguments_), ansiStyles2.bgColor.close, this._styler);
3848
+ return createBuilder(this, styler, this._isEmpty);
3849
+ };
3850
+ }
3851
+ };
3852
+ }
3853
+ const proto = Object.defineProperties(() => {
3854
+ }, {
3855
+ ...styles,
3856
+ level: {
3857
+ enumerable: true,
3858
+ get() {
3859
+ return this._generator.level;
3860
+ },
3861
+ set(level) {
3862
+ this._generator.level = level;
3863
+ }
3793
3864
  }
3794
- };
3795
- }
3796
- for (const model of usedModels) {
3797
- const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
3798
- styles[bgModel] = {
3799
- get() {
3800
- const { level } = this;
3801
- return function(...arguments_) {
3802
- const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
3803
- return createBuilder(this, styler, this._isEmpty);
3804
- };
3865
+ });
3866
+ const createStyler = (open, close, parent) => {
3867
+ let openAll;
3868
+ let closeAll;
3869
+ if (parent === void 0) {
3870
+ openAll = open;
3871
+ closeAll = close;
3872
+ } else {
3873
+ openAll = parent.openAll + open;
3874
+ closeAll = close + parent.closeAll;
3805
3875
  }
3876
+ return {
3877
+ open,
3878
+ close,
3879
+ openAll,
3880
+ closeAll,
3881
+ parent
3882
+ };
3806
3883
  };
3807
- }
3808
- const proto = Object.defineProperties(() => {
3809
- }, {
3810
- ...styles,
3811
- level: {
3812
- enumerable: true,
3813
- get() {
3814
- return this._generator.level;
3815
- },
3816
- set(level) {
3817
- this._generator.level = level;
3818
- }
3819
- }
3820
- });
3821
- const createStyler = (open, close, parent) => {
3822
- let openAll;
3823
- let closeAll;
3824
- if (parent === void 0) {
3825
- openAll = open;
3826
- closeAll = close;
3827
- } else {
3828
- openAll = parent.openAll + open;
3829
- closeAll = close + parent.closeAll;
3830
- }
3831
- return {
3832
- open,
3833
- close,
3834
- openAll,
3835
- closeAll,
3836
- parent
3884
+ const createBuilder = (self, _styler, _isEmpty) => {
3885
+ const builder = (...arguments_) => {
3886
+ if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
3887
+ return applyStyle(builder, chalkTag(builder, ...arguments_));
3888
+ }
3889
+ return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
3890
+ };
3891
+ Object.setPrototypeOf(builder, proto);
3892
+ builder._generator = self;
3893
+ builder._styler = _styler;
3894
+ builder._isEmpty = _isEmpty;
3895
+ return builder;
3837
3896
  };
3838
- };
3839
- const createBuilder = (self2, _styler, _isEmpty) => {
3840
- const builder = (...arguments_) => {
3841
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
3842
- return applyStyle(builder, chalkTag(builder, ...arguments_));
3897
+ const applyStyle = (self, string) => {
3898
+ if (self.level <= 0 || !string) {
3899
+ return self._isEmpty ? "" : string;
3900
+ }
3901
+ let styler = self._styler;
3902
+ if (styler === void 0) {
3903
+ return string;
3843
3904
  }
3844
- return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
3905
+ const { openAll, closeAll } = styler;
3906
+ if (string.indexOf("\x1B") !== -1) {
3907
+ while (styler !== void 0) {
3908
+ string = stringReplaceAll(string, styler.close, styler.open);
3909
+ styler = styler.parent;
3910
+ }
3911
+ }
3912
+ const lfIndex = string.indexOf("\n");
3913
+ if (lfIndex !== -1) {
3914
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
3915
+ }
3916
+ return openAll + string + closeAll;
3845
3917
  };
3846
- Object.setPrototypeOf(builder, proto);
3847
- builder._generator = self2;
3848
- builder._styler = _styler;
3849
- builder._isEmpty = _isEmpty;
3850
- return builder;
3851
- };
3852
- const applyStyle = (self2, string) => {
3853
- if (self2.level <= 0 || !string) {
3854
- return self2._isEmpty ? "" : string;
3855
- }
3856
- let styler = self2._styler;
3857
- if (styler === void 0) {
3858
- return string;
3859
- }
3860
- const { openAll, closeAll } = styler;
3861
- if (string.indexOf("\x1B") !== -1) {
3862
- while (styler !== void 0) {
3863
- string = stringReplaceAll(string, styler.close, styler.open);
3864
- styler = styler.parent;
3918
+ let template;
3919
+ const chalkTag = (chalk3, ...strings) => {
3920
+ const [firstString] = strings;
3921
+ if (!isArray(firstString) || !isArray(firstString.raw)) {
3922
+ return strings.join(" ");
3923
+ }
3924
+ const arguments_ = strings.slice(1);
3925
+ const parts = [firstString.raw[0]];
3926
+ for (let i = 1; i < firstString.length; i++) {
3927
+ parts.push(
3928
+ String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
3929
+ String(firstString.raw[i])
3930
+ );
3865
3931
  }
3866
- }
3867
- const lfIndex = string.indexOf("\n");
3868
- if (lfIndex !== -1) {
3869
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
3870
- }
3871
- return openAll + string + closeAll;
3872
- };
3873
- let template;
3874
- const chalkTag = (chalk2, ...strings) => {
3875
- const [firstString] = strings;
3876
- if (!isArray(firstString) || !isArray(firstString.raw)) {
3877
- return strings.join(" ");
3878
- }
3879
- const arguments_ = strings.slice(1);
3880
- const parts = [firstString.raw[0]];
3881
- for (let i = 1; i < firstString.length; i++) {
3882
- parts.push(
3883
- String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
3884
- String(firstString.raw[i])
3885
- );
3886
- }
3887
- if (template === void 0) {
3888
- template = requireTemplates();
3889
- }
3890
- return template(chalk2, parts.join(""));
3891
- };
3892
- Object.defineProperties(Chalk.prototype, styles);
3893
- const chalk = Chalk();
3894
- chalk.supportsColor = stdoutColor;
3895
- chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
3896
- chalk.stderr.supportsColor = stderrColor;
3897
- var source = chalk;
3898
- const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
3932
+ if (template === void 0) {
3933
+ template = requireTemplates();
3934
+ }
3935
+ return template(chalk3, parts.join(""));
3936
+ };
3937
+ Object.defineProperties(Chalk.prototype, styles);
3938
+ const chalk2 = Chalk();
3939
+ chalk2.supportsColor = stdoutColor;
3940
+ chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
3941
+ chalk2.stderr.supportsColor = stderrColor;
3942
+ source = chalk2;
3943
+ return source;
3944
+ }
3945
+ var sourceExports = requireSource();
3946
+ const chalk = /* @__PURE__ */ getDefaultExportFromCjs(sourceExports);
3899
3947
  function utf8Count(str) {
3900
3948
  var strLength = str.length;
3901
3949
  var byteLength = 0;
@@ -4007,8 +4055,8 @@ var DecodeError = (
4007
4055
  __extends(DecodeError2, _super);
4008
4056
  function DecodeError2(message) {
4009
4057
  var _this = _super.call(this, message) || this;
4010
- var proto2 = Object.create(DecodeError2.prototype);
4011
- Object.setPrototypeOf(_this, proto2);
4058
+ var proto = Object.create(DecodeError2.prototype);
4059
+ Object.setPrototypeOf(_this, proto);
4012
4060
  Object.defineProperty(_this, "name", {
4013
4061
  configurable: true,
4014
4062
  enumerable: false,
@@ -4541,7 +4589,7 @@ class PublishTransportRESTServer extends STSOptionsBase {
4541
4589
  __publicField(this, "Publish", async (payload) => {
4542
4590
  try {
4543
4591
  if (this.options.showPublishPayload) {
4544
- console.log(chalk$1.grey(`PublishTransportRESTServer::Publish() url: [${this.options.url}]`));
4592
+ console.log(chalk.grey(`PublishTransportRESTServer::Publish() url: [${this.options.url}]`));
4545
4593
  console.log(payload);
4546
4594
  }
4547
4595
  const encodedData = encode(payload, { ignoreUndefined: true });
@@ -4568,19 +4616,19 @@ class PublishTransportRESTServer extends STSOptionsBase {
4568
4616
  }
4569
4617
  if (retVal.status !== 200) {
4570
4618
  if (this.options.showPublishPayload) {
4571
- console.log(chalk$1.red(`PublishTransportRESTServer::Publish() Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
4619
+ console.log(chalk.red(`PublishTransportRESTServer::Publish() Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
4572
4620
  }
4573
- this.options.logger.debug(chalk$1.red(`Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
4621
+ this.options.logger.debug(chalk.red(`Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
4574
4622
  return false;
4575
4623
  } else {
4576
4624
  if (this.options.showPublishPayload) {
4577
- console.log(chalk$1.grey(`PublishTransportRESTServer::Publish() _PerformPublishRESTAPI:_PerformPublish:#publishmessage: [${this.options.url}] - Valid response from server: [${retVal.status}]`));
4625
+ console.log(chalk.grey(`PublishTransportRESTServer::Publish() _PerformPublishRESTAPI:_PerformPublish:#publishmessage: [${this.options.url}] - Valid response from server: [${retVal.status}]`));
4578
4626
  }
4579
4627
  }
4580
4628
  return true;
4581
4629
  } catch (error) {
4582
4630
  if (this.options.showPublishPayload) {
4583
- console.log(chalk$1.red(`PublishTransportRESTServer::Publish() Error (PublishRESTServer:_PerformPublishRESTAPI:Error: [${error}]`));
4631
+ console.log(chalk.red(`PublishTransportRESTServer::Publish() Error (PublishRESTServer:_PerformPublishRESTAPI:Error: [${error}]`));
4584
4632
  }
4585
4633
  return false;
4586
4634
  }
@@ -4638,7 +4686,7 @@ class PublishInstruments extends STSOptionsBase {
4638
4686
  }
4639
4687
  async StartPublish() {
4640
4688
  if (__privateGet(this, _publishState) !== 0) {
4641
- this.options.logger.debug(chalk$1.yellow(`StartPublish:${this.options.processContext.nid}: StartPublish called when not currently in the init state. Current State: [${__privateGet(this, _publishState)}]`));
4689
+ this.options.logger.debug(chalk.yellow(`StartPublish:${this.options.processContext.nid}: StartPublish called when not currently in the init state. Current State: [${__privateGet(this, _publishState)}]`));
4642
4690
  return false;
4643
4691
  }
4644
4692
  __privateMethod(this, _PublishInstruments_instances, UpdateState_fn).call(this, 1, "StartPublish()");
@@ -4647,7 +4695,7 @@ class PublishInstruments extends STSOptionsBase {
4647
4695
  }
4648
4696
  async EndPublish() {
4649
4697
  if (__privateGet(this, _publishState) !== 1) {
4650
- this.options.logger.debug(chalk$1.yellow(`EndPublish:${this.options.processContext.nid}: EndPublish called when not within the started state. Current State: [${__privateGet(this, _publishState)}]`));
4698
+ this.options.logger.debug(chalk.yellow(`EndPublish:${this.options.processContext.nid}: EndPublish called when not within the started state. Current State: [${__privateGet(this, _publishState)}]`));
4651
4699
  return false;
4652
4700
  }
4653
4701
  __privateMethod(this, _PublishInstruments_instances, UpdateState_fn).call(this, 2, "EndPublish() (1)");
@@ -4687,7 +4735,7 @@ PublishTimeoutLoop_fn = function(publishInterval) {
4687
4735
  UpdateState_fn = function(newState, comment) {
4688
4736
  const previousState = __privateGet(this, _publishState);
4689
4737
  __privateSet(this, _publishState, newState);
4690
- this.options.logger.debug(chalk$1.yellow(`#UpdateState:${this.options.processContext.nid}: Previous State: [${previousState}]. Current State: [${__privateGet(this, _publishState)}]. Comment: [${comment}]`));
4738
+ this.options.logger.debug(chalk.yellow(`#UpdateState:${this.options.processContext.nid}: Previous State: [${previousState}]. Current State: [${__privateGet(this, _publishState)}]. Comment: [${comment}]`));
4691
4739
  };
4692
4740
  var ePublishState = /* @__PURE__ */ ((ePublishState2) => {
4693
4741
  ePublishState2[ePublishState2["init"] = 0] = "init";
@@ -4750,11 +4798,11 @@ const _PublishInstrumentController = class _PublishInstrumentController extends
4750
4798
  }
4751
4799
  SetupInstrumentation() {
4752
4800
  if (!this.options.instrumentDefinitions) {
4753
- this.options.logger.debug(chalk$1.yellow(`SetupInstrumentation:${this.options.processContext.nid}: No instrument(s) defined within supplied options.`));
4801
+ this.options.logger.debug(chalk.yellow(`SetupInstrumentation:${this.options.processContext.nid}: No instrument(s) defined within supplied options.`));
4754
4802
  return;
4755
4803
  }
4756
4804
  if (!this.options.processContext) {
4757
- this.options.logger.debug(chalk$1.yellow(`SetupInstrumentation: No context defined within supplied options.`));
4805
+ this.options.logger.debug(chalk.yellow(`SetupInstrumentation: No context defined within supplied options.`));
4758
4806
  return;
4759
4807
  }
4760
4808
  __privateMethod(this, _PublishInstrumentController_instances, CreateInstruments_fn).call(this, this.options.instrumentDefinitions);
@@ -4779,7 +4827,7 @@ const _PublishInstrumentController = class _PublishInstrumentController extends
4779
4827
  if (__privateGet(this, _instruments)[instrumentName]) {
4780
4828
  __privateMethod(this, _PublishInstrumentController_instances, ProcessTelemetryCommand_fn).call(this, instrumentName, telemetry);
4781
4829
  } else {
4782
- this.options.logger.debug(chalk$1.red(`UpdateInstrument:${this.options.processContext.nid}: Attempted to UpdateInstrument before initialised.`));
4830
+ this.options.logger.debug(chalk.red(`UpdateInstrument:${this.options.processContext.nid}: Attempted to UpdateInstrument before initialised.`));
4783
4831
  }
4784
4832
  }
4785
4833
  /**
@@ -4852,21 +4900,21 @@ const GetSTSInstrumentController = (app) => {
4852
4900
  const STSInstrumentControllerPlugin = {
4853
4901
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4854
4902
  install: (app, options) => {
4855
- options.logger.debug(chalk$1.yellow(`STSInstrumentControllerPlugin:install:Start`));
4903
+ options.logger.debug(chalk.yellow(`STSInstrumentControllerPlugin:install:Start`));
4856
4904
  const aic = new PublishInstrumentController(options);
4857
4905
  if (!app.config.globalProperties.$sts) {
4858
- options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] does not exist.`));
4906
+ options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] does not exist.`));
4859
4907
  app.config.globalProperties.$sts = {};
4860
- options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: created empty [app.config.globalProperties.$sts].`));
4908
+ options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: created empty [app.config.globalProperties.$sts].`));
4861
4909
  } else {
4862
- options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] already exists.`));
4910
+ options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] already exists.`));
4863
4911
  }
4864
4912
  app.config.globalProperties.$sts.aic = aic;
4865
4913
  app.config.globalProperties.$sts[STSInstrumentControllerPluginKey] = aic;
4866
- options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into [app.config.globalProperties.$sts] using: [${String(STSInstrumentControllerPluginKey)}].`));
4914
+ options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into [app.config.globalProperties.$sts] using: [${String(STSInstrumentControllerPluginKey)}].`));
4867
4915
  app.provide(STSInstrumentControllerPluginKey, aic);
4868
- options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into 'provide' using: [${String(STSInstrumentControllerPluginKey)}].`));
4869
- options.logger.debug(chalk$1.green(`STSInstrumentControllerPlugin:install:End`));
4916
+ options.logger.debug(chalk.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into 'provide' using: [${String(STSInstrumentControllerPluginKey)}].`));
4917
+ options.logger.debug(chalk.green(`STSInstrumentControllerPlugin:install:End`));
4870
4918
  }
4871
4919
  };
4872
4920
  var SubscriptionTopic = /* @__PURE__ */ ((SubscriptionTopic2) => {
@@ -5475,7 +5523,7 @@ class ObservabilityRESTAPISubscriber {
5475
5523
  subscription.cb(payload);
5476
5524
  }
5477
5525
  } catch (error) {
5478
- __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5526
+ __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5479
5527
  __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subscription);
5480
5528
  }
5481
5529
  });
@@ -5487,11 +5535,11 @@ class ObservabilityRESTAPISubscriber {
5487
5535
  async Subscribe(subscriptions) {
5488
5536
  subscriptions.map(async (subId) => {
5489
5537
  __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subId);
5490
- __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk$1.yellow(`ObservabilityRESTAPISubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5538
+ __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk.yellow(`ObservabilityRESTAPISubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5491
5539
  try {
5492
5540
  __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, AddKeepAlive_fn).call(this, subId);
5493
5541
  } catch (error) {
5494
- __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
5542
+ __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk.red(`ObservabilityRESTAPISubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
5495
5543
  __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subId);
5496
5544
  }
5497
5545
  });
@@ -5502,7 +5550,7 @@ class ObservabilityRESTAPISubscriber {
5502
5550
  UnSubscribe(subscriptions) {
5503
5551
  subscriptions.map(async (subId) => {
5504
5552
  __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subId);
5505
- __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk$1.yellow(`ObservabilityRESTAPISubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5553
+ __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk.yellow(`ObservabilityRESTAPISubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5506
5554
  });
5507
5555
  }
5508
5556
  }
@@ -5519,6 +5567,7 @@ InvokeRESTAPI_fn = async function(subscription) {
5519
5567
  const { subscriptionKey } = subscription;
5520
5568
  let url = "";
5521
5569
  switch (subscriptionKey.topic) {
5570
+ // Services -------------------------------------------------------------------------------------------
5522
5571
  case SubscriptionTopic.AllServicesCombined:
5523
5572
  url = `/metrics`;
5524
5573
  break;
@@ -5540,6 +5589,7 @@ InvokeRESTAPI_fn = async function(subscription) {
5540
5589
  } else {
5541
5590
  throw new Error(`#OutputSubscription(Services): key not provided for subscription: [${JSON.stringify(subscriptionKey)}]`);
5542
5591
  }
5592
+ // Lambdas -------------------------------------------------------------------------------------------
5543
5593
  case SubscriptionTopic.AllLambdasCombined:
5544
5594
  url = `/metrics`;
5545
5595
  break;
@@ -5561,6 +5611,7 @@ InvokeRESTAPI_fn = async function(subscription) {
5561
5611
  } else {
5562
5612
  throw new Error(`#OutputSubscription(Lambdas): key not provided for subscription: [${JSON.stringify(subscriptionKey)}]`);
5563
5613
  }
5614
+ // User Agents -------------------------------------------------------------------------------------------
5564
5615
  case SubscriptionTopic.AllAgentsCombined:
5565
5616
  url = `/metrics`;
5566
5617
  break;
@@ -5626,10 +5677,10 @@ SetupTimeout_fn = function(socketSubscribeKeepAlive, subscription, timeout) {
5626
5677
  }
5627
5678
  socketSubscribeKeepAlive.timeout = __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, SetupTimeout_fn).call(this, socketSubscribeKeepAlive, subscription, timeoutDuration);
5628
5679
  } else {
5629
- __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk$1.yellow(`Subscription removed: [${socketSubscribeKeepAlive.id}]. Processing terminate.`));
5680
+ __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk.yellow(`Subscription removed: [${socketSubscribeKeepAlive.id}]. Processing terminate.`));
5630
5681
  }
5631
5682
  } catch (error) {
5632
- __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5683
+ __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogErrorMessage_fn).call(this, chalk.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5633
5684
  __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, RemoveKeepAlive_fn).call(this, subscription);
5634
5685
  }
5635
5686
  }, timeout);
@@ -5645,40 +5696,38 @@ AddKeepAlive_fn = function(subscription) {
5645
5696
  };
5646
5697
  RemoveKeepAlive_fn = function(subscription) {
5647
5698
  if (__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id]) {
5648
- __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk$1.gray(`ObservabilityRESTAPISubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
5699
+ __privateMethod(this, _ObservabilityRESTAPISubscriber_instances, LogDebugMessage_fn).call(this, chalk.gray(`ObservabilityRESTAPISubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
5649
5700
  clearTimeout(__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id].timeout);
5650
5701
  delete __privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id].timeout;
5651
5702
  delete __privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id];
5652
5703
  }
5653
5704
  };
5654
- var byteToHex = [];
5655
- for (var i = 0; i < 256; ++i) {
5705
+ const byteToHex = [];
5706
+ for (let i = 0; i < 256; ++i) {
5656
5707
  byteToHex.push((i + 256).toString(16).slice(1));
5657
5708
  }
5658
5709
  function unsafeStringify(arr, offset = 0) {
5659
5710
  return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
5660
5711
  }
5661
- var getRandomValues;
5662
- var rnds8 = new Uint8Array(16);
5712
+ let getRandomValues;
5713
+ const rnds8 = new Uint8Array(16);
5663
5714
  function rng() {
5664
5715
  if (!getRandomValues) {
5665
- getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
5666
- if (!getRandomValues) {
5716
+ if (typeof crypto === "undefined" || !crypto.getRandomValues) {
5667
5717
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
5668
5718
  }
5719
+ getRandomValues = crypto.getRandomValues.bind(crypto);
5669
5720
  }
5670
5721
  return getRandomValues(rnds8);
5671
5722
  }
5672
- var randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
5673
- const native = {
5674
- randomUUID
5675
- };
5723
+ const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
5724
+ const native = { randomUUID };
5676
5725
  function v4(options, buf, offset) {
5677
5726
  if (native.randomUUID && !buf && !options) {
5678
5727
  return native.randomUUID();
5679
5728
  }
5680
5729
  options = options || {};
5681
- var rnds = options.random || (options.rng || rng)();
5730
+ const rnds = options.random || (options.rng || rng)();
5682
5731
  rnds[6] = rnds[6] & 15 | 64;
5683
5732
  rnds[8] = rnds[8] & 63 | 128;
5684
5733
  return unsafeStringify(rnds);
@@ -5715,7 +5764,7 @@ class SocketIoMessageSender {
5715
5764
  return __privateGet(this, _socket);
5716
5765
  }
5717
5766
  set socket(socket) {
5718
- __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.cyan(`SocketIoMessageSender:set socket(): new socket assigned`));
5767
+ __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.cyan(`SocketIoMessageSender:set socket(): new socket assigned`));
5719
5768
  __privateSet(this, _socket, socket);
5720
5769
  }
5721
5770
  AckListener(message, payload) {
@@ -5728,25 +5777,25 @@ class SocketIoMessageSender {
5728
5777
  message.status = "SUCCESS";
5729
5778
  message.subscriptionKeyResponse = payload;
5730
5779
  delete __privateGet(this, _messageWithAckPayloadRecords)[message.id];
5731
- __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.grey(`SocketIoMessageSender:AckListener(): ack received, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5780
+ __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.grey(`SocketIoMessageSender:AckListener(): ack received, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5732
5781
  message.resolve(message);
5733
5782
  }
5734
5783
  }
5735
5784
  ResponseTimout(message) {
5736
- __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached: [${__privateGet(this, _timeoutValue)}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5785
+ __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached: [${__privateGet(this, _timeoutValue)}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5737
5786
  delete message.timeoutId;
5738
5787
  __privateGet(this, _socket).off(__privateMethod(this, _SocketIoMessageSender_instances, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
5739
5788
  message.endTime = performance.now();
5740
5789
  if (message.retryCount >= __privateGet(this, _maxReties)) {
5741
5790
  message.status = "FAIL";
5742
- __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.red(`SocketIoMessageSender:ResponseTimout(): timeout reached after ${__privateGet(this, _maxReties)} retries, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5791
+ __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.red(`SocketIoMessageSender:ResponseTimout(): timeout reached after ${__privateGet(this, _maxReties)} retries, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5743
5792
  delete __privateGet(this, _messageWithAckPayloadRecords)[message.id];
5744
5793
  message.reject(message);
5745
5794
  return;
5746
5795
  }
5747
5796
  message.status = "INRETRY";
5748
5797
  message.retryCount++;
5749
- __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached, retrying. Retries: [${message.retryCount}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5798
+ __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached, retrying. Retries: [${message.retryCount}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5750
5799
  this.SendMessage(message);
5751
5800
  }
5752
5801
  SendMessage(message) {
@@ -5759,7 +5808,7 @@ class SocketIoMessageSender {
5759
5808
  };
5760
5809
  message.BoundAckListenerCallback = AckListenerCallback.bind(this);
5761
5810
  __privateGet(this, _socket).on(__privateMethod(this, _SocketIoMessageSender_instances, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
5762
- __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.gray(`SocketIoMessageSender:SendMessage(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5811
+ __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.gray(`SocketIoMessageSender:SendMessage(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5763
5812
  __privateGet(this, _socket).emit(message.eventName, message.subscriptionKey);
5764
5813
  }
5765
5814
  SendMessageWithAck(eventName, subscriptionKey) {
@@ -5783,7 +5832,7 @@ class SocketIoMessageSender {
5783
5832
  const killIds = [];
5784
5833
  for (const [, message] of Object.entries(__privateGet(this, _messageWithAckPayloadRecords))) {
5785
5834
  if (message.subscriptionKey.id.localeCompare(subscriptionKey.id) === 0) {
5786
- __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk$1.blue(`SocketIoMessageSender:KillMessageInFlight(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5835
+ __privateMethod(this, _SocketIoMessageSender_instances, LogDebugMessage_fn2).call(this, chalk.blue(`SocketIoMessageSender:KillMessageInFlight(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5787
5836
  clearTimeout(message.timeoutId);
5788
5837
  delete message.timeoutId;
5789
5838
  __privateGet(this, _socket).off(__privateMethod(this, _SocketIoMessageSender_instances, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
@@ -5829,7 +5878,7 @@ class ObservabilitySocketIOSubscriber {
5829
5878
  return __privateGet(this, _socket2);
5830
5879
  }
5831
5880
  set socket(socket) {
5832
- __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.cyan(`ObservabilitySocketIOSubscriber:set socket(): new socket assigned`));
5881
+ __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.cyan(`ObservabilitySocketIOSubscriber:set socket(): new socket assigned`));
5833
5882
  __privateSet(this, _socket2, socket);
5834
5883
  __privateGet(this, _socketIoMessageSender).socket = socket;
5835
5884
  }
@@ -5840,14 +5889,14 @@ class ObservabilitySocketIOSubscriber {
5840
5889
  const socket = __privateGet(this, _socket2);
5841
5890
  subscriptions.map(async (subId) => {
5842
5891
  __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subId);
5843
- __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5892
+ __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.yellow(`ObservabilitySocketIOSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5844
5893
  try {
5845
5894
  const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("subscribe", subId.subscriptionKey);
5846
- __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:Subscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5895
+ __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.green(`ObservabilitySocketIOSubscriber:Subscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5847
5896
  __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, AddKeepAlive_fn2).call(this, socket, subId);
5848
5897
  socket.on(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
5849
5898
  } catch (error) {
5850
- __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
5899
+ __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
5851
5900
  socket.off(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
5852
5901
  __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subId);
5853
5902
  }
@@ -5862,12 +5911,12 @@ class ObservabilitySocketIOSubscriber {
5862
5911
  socket.off(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
5863
5912
  __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subId);
5864
5913
  __privateGet(this, _socketIoMessageSender).KillMessageInFlight(subId.subscriptionKey);
5865
- __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5914
+ __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.yellow(`ObservabilitySocketIOSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5866
5915
  try {
5867
5916
  const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("unsubscribe", subId.subscriptionKey);
5868
- __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:UnSubscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5917
+ __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.green(`ObservabilitySocketIOSubscriber:UnSubscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5869
5918
  } catch (error) {
5870
- __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error response: [${JSON.stringify(error)}]`));
5919
+ __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error response: [${JSON.stringify(error)}]`));
5871
5920
  }
5872
5921
  });
5873
5922
  }
@@ -5901,13 +5950,13 @@ AddKeepAlive_fn2 = function(socket, subscription) {
5901
5950
  __privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id] = {
5902
5951
  id: subscription.subscriptionKey.id,
5903
5952
  timeout: setTimeout(async () => {
5904
- __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:#AddKeepAlive:timeoutCheck(): Sending keepAlive: subscriptionKey: [${subscription.subscriptionKey.id}]`));
5953
+ __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.yellow(`ObservabilitySocketIOSubscriber:#AddKeepAlive:timeoutCheck(): Sending keepAlive: subscriptionKey: [${subscription.subscriptionKey.id}]`));
5905
5954
  try {
5906
5955
  const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("subscribeKeepAlive", subscription.subscriptionKey);
5907
- __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5956
+ __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.green(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5908
5957
  __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, AddKeepAlive_fn2).call(this, socket, subscription);
5909
5958
  } catch (error) {
5910
- __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5959
+ __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogErrorMessage_fn2).call(this, chalk.red(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5911
5960
  socket.off(GetSocketIOSubscriptionKey(subscription.subscriptionKey), subscription.cb);
5912
5961
  __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, RemoveKeepAlive_fn2).call(this, subscription);
5913
5962
  }
@@ -5916,7 +5965,7 @@ AddKeepAlive_fn2 = function(socket, subscription) {
5916
5965
  };
5917
5966
  RemoveKeepAlive_fn2 = function(subscription) {
5918
5967
  if (__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id]) {
5919
- __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk$1.gray(`ObservabilitySocketIOSubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
5968
+ __privateMethod(this, _ObservabilitySocketIOSubscriber_instances, LogDebugMessage_fn3).call(this, chalk.gray(`ObservabilitySocketIOSubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
5920
5969
  clearTimeout(__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id].timeout);
5921
5970
  delete __privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id];
5922
5971
  }
@@ -5963,7 +6012,7 @@ class ObservabilitySubscriptionManager {
5963
6012
  subscriptions.map((subscription) => {
5964
6013
  const retVal = this.subscriptions.find((v) => v.subscriptionKey.id.localeCompare(subscription.subscriptionKey.id) === 0);
5965
6014
  if (retVal) {
5966
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.magenta(`AddSubscription(): Subscription: [${retVal.subscriptionKey.id}] already exists - ignoring.`));
6015
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.magenta(`AddSubscription(): Subscription: [${retVal.subscriptionKey.id}] already exists - ignoring.`));
5967
6016
  } else {
5968
6017
  subscriptionsToAdd.push(subscription);
5969
6018
  }
@@ -5972,7 +6021,7 @@ class ObservabilitySubscriptionManager {
5972
6021
  subscriptionsToAdd.map((s) => this.subscriptions.push(s));
5973
6022
  (_a2 = __privateGet(this, _observabilitySocketIOSubscriber)) == null ? void 0 : _a2.Subscribe(subscriptionsToAdd);
5974
6023
  } else {
5975
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.magenta(`AddSubscription(): No valid subscriptions to subscribe.`));
6024
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.magenta(`AddSubscription(): No valid subscriptions to subscribe.`));
5976
6025
  }
5977
6026
  }
5978
6027
  RemoveSubscriptionsByKey(keyToFind) {
@@ -6021,6 +6070,7 @@ class ObservabilitySubscriptionManager {
6021
6070
  }
6022
6071
  TransformSubscriptionPayloadCallback(subscriptionPayload, subscribeToKafka) {
6023
6072
  switch (subscriptionPayload.subscriptionKey.topic) {
6073
+ // Services -----------------------------------------------------------------------------
6024
6074
  case SubscriptionTopic.AllServicesCombined:
6025
6075
  this.CreateModelAllServicesCombined(subscriptionPayload, subscribeToKafka);
6026
6076
  break;
@@ -6033,6 +6083,7 @@ class ObservabilitySubscriptionManager {
6033
6083
  case SubscriptionTopic.ServiceInstance:
6034
6084
  this.CreateModelServiceInstance(subscriptionPayload, subscribeToKafka);
6035
6085
  break;
6086
+ // Lambda -----------------------------------------------------------------------------
6036
6087
  case SubscriptionTopic.AllLambdasCombined:
6037
6088
  this.CreateModelAllLambdasCombined(subscriptionPayload, subscribeToKafka);
6038
6089
  break;
@@ -6045,6 +6096,7 @@ class ObservabilitySubscriptionManager {
6045
6096
  case SubscriptionTopic.LambdaSubTechnologiesInstance:
6046
6097
  this.CreateModelLambdaSubTechnologiesInstance(subscriptionPayload, subscribeToKafka);
6047
6098
  break;
6099
+ // Agents -----------------------------------------------------------------------------
6048
6100
  case SubscriptionTopic.AllAgentsCombined:
6049
6101
  this.CreateModelAllAgentsCombined(subscriptionPayload, subscribeToKafka);
6050
6102
  break;
@@ -6067,7 +6119,7 @@ class ObservabilitySubscriptionManager {
6067
6119
  if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllServicesCombined.toString()) === 0) {
6068
6120
  __privateGet(this, _serviceModel)["STS-Service"] = ObservabilityModelUtils.GetModelForService("STS-Service", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
6069
6121
  if (__privateGet(this, _serviceModel)["STS-Service"] === null) {
6070
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllServicesCombined():Error: GetModelForService() returned null`));
6122
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelAllServicesCombined():Error: GetModelForService() returned null`));
6071
6123
  }
6072
6124
  }
6073
6125
  } catch (error) {
@@ -6082,7 +6134,7 @@ class ObservabilitySubscriptionManager {
6082
6134
  for (const [serviceId, serviceTelemetry] of Object.entries(subscriptionPayload.data)) {
6083
6135
  __privateGet(this, _serviceModel)[serviceId] = ObservabilityModelUtils.GetModelForService(serviceId, serviceTelemetry, subscribeToKafka, __privateGet(this, _options5).logger);
6084
6136
  if (__privateGet(this, _serviceModel)[serviceId] === null) {
6085
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServices():Error: GetModelForService() returned null`));
6137
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelServices():Error: GetModelForService() returned null`));
6086
6138
  }
6087
6139
  }
6088
6140
  } catch (error) {
@@ -6116,7 +6168,7 @@ class ObservabilitySubscriptionManager {
6116
6168
  }
6117
6169
  }
6118
6170
  } else {
6119
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServiceInstances():Error: GetModelForService() returned null`));
6171
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelServiceInstances():Error: GetModelForService() returned null`));
6120
6172
  }
6121
6173
  } else {
6122
6174
  if (subscribeToKafka) {
@@ -6159,7 +6211,7 @@ class ObservabilitySubscriptionManager {
6159
6211
  }
6160
6212
  }
6161
6213
  } else {
6162
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServiceInstance():Error: GetModelForService() returned null`));
6214
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelServiceInstance():Error: GetModelForService() returned null`));
6163
6215
  }
6164
6216
  } else {
6165
6217
  if (subscribeToKafka) {
@@ -6184,7 +6236,7 @@ class ObservabilitySubscriptionManager {
6184
6236
  if (Object.keys(subscriptionPayload.data).length !== 0) {
6185
6237
  __privateGet(this, _agentModel)["STS-Agent"] = ObservabilityModelUtils.GetModelForAgent("STS-Agent", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
6186
6238
  if (__privateGet(this, _agentModel)["STS-Agent"] === null) {
6187
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllAgentsCombined():Error: GetModelForAgent() returned null`));
6239
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelAllAgentsCombined():Error: GetModelForAgent() returned null`));
6188
6240
  }
6189
6241
  }
6190
6242
  }
@@ -6218,7 +6270,7 @@ class ObservabilitySubscriptionManager {
6218
6270
  }
6219
6271
  }
6220
6272
  } else {
6221
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgents():Error: GetModelForAgent() returned null`));
6273
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelAgents():Error: GetModelForAgent() returned null`));
6222
6274
  }
6223
6275
  } else {
6224
6276
  if (subscribeToKafka) {
@@ -6229,7 +6281,7 @@ class ObservabilitySubscriptionManager {
6229
6281
  }
6230
6282
  }
6231
6283
  } catch (error) {
6232
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgent:CreateModel(): Error: [${error}]`));
6284
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk.red(`UIControllerAgent:CreateModel(): Error: [${error}]`));
6233
6285
  }
6234
6286
  }
6235
6287
  // /agentId/agentWorkerId
@@ -6262,7 +6314,7 @@ class ObservabilitySubscriptionManager {
6262
6314
  }
6263
6315
  }
6264
6316
  } else {
6265
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgentWorkers():Error: GetModelForAgent() returned null`));
6317
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelAgentWorkers():Error: GetModelForAgent() returned null`));
6266
6318
  }
6267
6319
  } else {
6268
6320
  if (subscribeToKafka) {
@@ -6274,7 +6326,7 @@ class ObservabilitySubscriptionManager {
6274
6326
  }
6275
6327
  }
6276
6328
  } catch (error) {
6277
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgentThreads:CreateModel(): Error: [${error}]`));
6329
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk.red(`UIControllerAgentThreads:CreateModel(): Error: [${error}]`));
6278
6330
  }
6279
6331
  }
6280
6332
  // /agentId/agentWorkerId/asyncRunnerId
@@ -6304,7 +6356,7 @@ class ObservabilitySubscriptionManager {
6304
6356
  }
6305
6357
  }
6306
6358
  } else {
6307
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgentWorker():Error: GetModelForAgent() returned null`));
6359
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelAgentWorker():Error: GetModelForAgent() returned null`));
6308
6360
  }
6309
6361
  } else {
6310
6362
  if (subscribeToKafka) {
@@ -6317,7 +6369,7 @@ class ObservabilitySubscriptionManager {
6317
6369
  }
6318
6370
  }
6319
6371
  } catch (error) {
6320
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgentThread:CreateModel(): Error: [${error}]`));
6372
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogErrorMessage_fn3).call(this, chalk.red(`UIControllerAgentThread:CreateModel(): Error: [${error}]`));
6321
6373
  }
6322
6374
  }
6323
6375
  // --- [ Lambdas ] ------------------------------------------------------------------------------------------------------------------------------------------------
@@ -6328,7 +6380,7 @@ class ObservabilitySubscriptionManager {
6328
6380
  if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllLambdasCombined.toString()) === 0) {
6329
6381
  __privateGet(this, _lambdaModel)["STS-Lambda"] = ObservabilityModelUtils.GetModelForLambda("STS-Lambda", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
6330
6382
  if (__privateGet(this, _lambdaModel)["STS-Lambda"] === null) {
6331
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllLambdasCombined():Error: GetModelForLambda() returned null`));
6383
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelAllLambdasCombined():Error: GetModelForLambda() returned null`));
6332
6384
  }
6333
6385
  }
6334
6386
  } catch (error) {
@@ -6343,7 +6395,7 @@ class ObservabilitySubscriptionManager {
6343
6395
  for (const [technologyId, technologyTelemetry] of Object.entries(subscriptionPayload.data)) {
6344
6396
  __privateGet(this, _lambdaModel)[technologyId] = ObservabilityModelUtils.GetModelForLambda(technologyId, technologyTelemetry, subscribeToKafka, __privateGet(this, _options5).logger);
6345
6397
  if (__privateGet(this, _lambdaModel)[technologyId] === null) {
6346
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaTechnologies():Error: GetModelForLambda() returned null`));
6398
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelLambdaTechnologies():Error: GetModelForLambda() returned null`));
6347
6399
  }
6348
6400
  }
6349
6401
  } catch (error) {
@@ -6377,7 +6429,7 @@ class ObservabilitySubscriptionManager {
6377
6429
  }
6378
6430
  }
6379
6431
  } else {
6380
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaSubTechnologies():Error: GetModelForLambda() returned null`));
6432
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelLambdaSubTechnologies():Error: GetModelForLambda() returned null`));
6381
6433
  }
6382
6434
  } else {
6383
6435
  if (subscribeToKafka) {
@@ -6420,7 +6472,7 @@ class ObservabilitySubscriptionManager {
6420
6472
  }
6421
6473
  }
6422
6474
  } else {
6423
- __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaSubTechnologiesInstance():Error: GetModelForLambda() returned null`));
6475
+ __privateMethod(this, _ObservabilitySubscriptionManager_instances, LogDebugMessage_fn4).call(this, chalk.red(`CreateModelLambdaSubTechnologiesInstance():Error: GetModelForLambda() returned null`));
6424
6476
  }
6425
6477
  } else {
6426
6478
  if (subscribeToKafka) {