@blackglory/structures 0.2.6 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +50 -13
  3. package/dist/es2015/index.min.mjs +16 -2
  4. package/dist/es2015/index.min.mjs.map +1 -1
  5. package/dist/es2015/index.mjs +1479 -319
  6. package/dist/es2015/index.mjs.map +1 -1
  7. package/dist/es2015/index.umd.js +1482 -318
  8. package/dist/es2015/index.umd.js.map +1 -1
  9. package/dist/es2015/index.umd.min.js +15 -2
  10. package/dist/es2015/index.umd.min.js.map +1 -1
  11. package/dist/es2018/index.min.mjs +16 -2
  12. package/dist/es2018/index.min.mjs.map +1 -1
  13. package/dist/es2018/index.mjs +1479 -319
  14. package/dist/es2018/index.mjs.map +1 -1
  15. package/dist/es2018/index.umd.js +1482 -318
  16. package/dist/es2018/index.umd.js.map +1 -1
  17. package/dist/es2018/index.umd.min.js +15 -2
  18. package/dist/es2018/index.umd.min.js.map +1 -1
  19. package/lib/es2015/box.d.ts +6 -0
  20. package/lib/es2015/box.js +30 -0
  21. package/lib/es2015/box.js.map +1 -0
  22. package/lib/es2015/finite-state-machine.d.ts +13 -0
  23. package/lib/es2015/finite-state-machine.js +46 -0
  24. package/lib/es2015/finite-state-machine.js.map +1 -0
  25. package/lib/es2015/index.d.ts +3 -0
  26. package/lib/es2015/index.js +3 -0
  27. package/lib/es2015/index.js.map +1 -1
  28. package/lib/es2015/observable-finite-state-machine.d.ts +13 -0
  29. package/lib/es2015/observable-finite-state-machine.js +28 -0
  30. package/lib/es2015/observable-finite-state-machine.js.map +1 -0
  31. package/lib/es2018/box.d.ts +6 -0
  32. package/lib/es2018/box.js +30 -0
  33. package/lib/es2018/box.js.map +1 -0
  34. package/lib/es2018/finite-state-machine.d.ts +13 -0
  35. package/lib/es2018/finite-state-machine.js +46 -0
  36. package/lib/es2018/finite-state-machine.js.map +1 -0
  37. package/lib/es2018/index.d.ts +3 -0
  38. package/lib/es2018/index.js +3 -0
  39. package/lib/es2018/index.js.map +1 -1
  40. package/lib/es2018/observable-finite-state-machine.d.ts +13 -0
  41. package/lib/es2018/observable-finite-state-machine.js +28 -0
  42. package/lib/es2018/observable-finite-state-machine.js.map +1 -0
  43. package/package.json +25 -23
@@ -1,12 +1,3 @@
1
- function convertConsToArray([value, next]) {
2
- if (next === null)
3
- return [value];
4
- return [value, ...convertConsToArray(next)];
5
- }
6
- function convertArrayToCons([value, ...next]) {
7
- return [value, next.length ? convertArrayToCons(next) : null];
8
- }
9
-
10
1
  /*! *****************************************************************************
11
2
  Copyright (c) Microsoft Corporation.
12
3
 
@@ -35,6 +26,30 @@ function __classPrivateFieldSet(receiver, state, value, kind, f) {
35
26
  return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
36
27
  }
37
28
 
29
+ var _Box_value;
30
+ class Box {
31
+ constructor(value) {
32
+ _Box_value.set(this, void 0);
33
+ __classPrivateFieldSet(this, _Box_value, value, "f");
34
+ }
35
+ set(value) {
36
+ __classPrivateFieldSet(this, _Box_value, value, "f");
37
+ }
38
+ get() {
39
+ return __classPrivateFieldGet(this, _Box_value, "f");
40
+ }
41
+ }
42
+ _Box_value = new WeakMap();
43
+
44
+ function convertConsToArray([value, next]) {
45
+ if (next === null)
46
+ return [value];
47
+ return [value, ...convertConsToArray(next)];
48
+ }
49
+ function convertArrayToCons([value, ...next]) {
50
+ return [value, next.length ? convertArrayToCons(next) : null];
51
+ }
52
+
38
53
  var _Emitter_map;
39
54
  class Emitter {
40
55
  constructor() {
@@ -163,7 +178,7 @@ class Queue {
163
178
 
164
179
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
165
180
 
166
- var es2018$4 = {};
181
+ var es2018$6 = {};
167
182
 
168
183
  var customError = {};
169
184
 
@@ -241,15 +256,15 @@ __exportStar(normalize$1, exports);
241
256
  __exportStar(refute$1, exports);
242
257
  __exportStar(assert$1, exports);
243
258
 
244
- }(es2018$4));
259
+ }(es2018$6));
245
260
 
246
- var es2018$3 = {};
261
+ var es2018$5 = {};
247
262
 
248
263
  var middleware = {};
249
264
 
250
265
  var chunkAsync$1 = {};
251
266
 
252
- var es2018$2 = {};
267
+ var es2018$4 = {};
253
268
 
254
269
  var go$1 = {};
255
270
 
@@ -271,11 +286,11 @@ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m
271
286
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
272
287
  };__exportStar(go$1, exports);
273
288
 
274
- }(es2018$2));
289
+ }(es2018$4));
275
290
 
276
291
  chunkAsync$1.chunkAsync = void 0;
277
- const go_1$f = es2018$2;
278
- const errors_1$f = es2018$4;
292
+ const go_1$f = es2018$4;
293
+ const errors_1$f = es2018$6;
279
294
  function chunkAsync(iterable, size) {
280
295
  (0, errors_1$f.assert)(Number.isInteger(size), 'The parameter size must be an integer');
281
296
  (0, errors_1$f.assert)(size > 0, 'The parameter size must be greater than 0');
@@ -296,297 +311,297 @@ chunkAsync$1.chunkAsync = chunkAsync;
296
311
 
297
312
  var chunkByAsync$1 = {};
298
313
 
299
- var es2018$1 = {};
314
+ var es2018$3 = {};
300
315
 
301
- var array = {};
316
+ var array$1 = {};
302
317
 
303
- array.isntEmptyArray = array.isEmptyArray = array.isntArray = array.isArray = void 0;
304
- function isArray(val) {
318
+ array$1.isntEmptyArray = array$1.isEmptyArray = array$1.isntArray = array$1.isArray = void 0;
319
+ function isArray$1(val) {
305
320
  return Array.isArray(val);
306
321
  }
307
- array.isArray = isArray;
308
- function isntArray(val) {
309
- return !isArray(val);
322
+ array$1.isArray = isArray$1;
323
+ function isntArray$1(val) {
324
+ return !isArray$1(val);
310
325
  }
311
- array.isntArray = isntArray;
312
- function isEmptyArray(val) {
326
+ array$1.isntArray = isntArray$1;
327
+ function isEmptyArray$1(val) {
313
328
  return val.length === 0;
314
329
  }
315
- array.isEmptyArray = isEmptyArray;
316
- function isntEmptyArray(val) {
330
+ array$1.isEmptyArray = isEmptyArray$1;
331
+ function isntEmptyArray$1(val) {
317
332
  return val.length !== 0;
318
333
  }
319
- array.isntEmptyArray = isntEmptyArray;
334
+ array$1.isntEmptyArray = isntEmptyArray$1;
320
335
 
321
- var asyncIterable = {};
336
+ var asyncIterable$1 = {};
322
337
 
323
- var _null = {};
338
+ var _null$1 = {};
324
339
 
325
- _null.isntNull = _null.isNull = void 0;
326
- function isNull(val) {
340
+ _null$1.isntNull = _null$1.isNull = void 0;
341
+ function isNull$1(val) {
327
342
  return val === null;
328
343
  }
329
- _null.isNull = isNull;
330
- function isntNull(val) {
331
- return !isNull(val);
344
+ _null$1.isNull = isNull$1;
345
+ function isntNull$1(val) {
346
+ return !isNull$1(val);
332
347
  }
333
- _null.isntNull = isntNull;
348
+ _null$1.isntNull = isntNull$1;
334
349
 
335
- var _undefined = {};
350
+ var _undefined$1 = {};
336
351
 
337
- _undefined.isntUndefined = _undefined.isUndefined = void 0;
338
- function isUndefined(val) {
352
+ _undefined$1.isntUndefined = _undefined$1.isUndefined = void 0;
353
+ function isUndefined$1(val) {
339
354
  return val === undefined;
340
355
  }
341
- _undefined.isUndefined = isUndefined;
342
- function isntUndefined(val) {
343
- return !isUndefined(val);
356
+ _undefined$1.isUndefined = isUndefined$1;
357
+ function isntUndefined$1(val) {
358
+ return !isUndefined$1(val);
344
359
  }
345
- _undefined.isntUndefined = isntUndefined;
360
+ _undefined$1.isntUndefined = isntUndefined$1;
346
361
 
347
- asyncIterable.isntAsyncIterable = asyncIterable.isAsyncIterable = void 0;
348
- const null_1$1 = _null;
349
- const undefined_1$2 = _undefined;
350
- function isAsyncIterable(val) {
351
- return (0, null_1$1.isntNull)(val)
352
- && (0, undefined_1$2.isntUndefined)(val)
362
+ asyncIterable$1.isntAsyncIterable = asyncIterable$1.isAsyncIterable = void 0;
363
+ const null_1$3 = _null$1;
364
+ const undefined_1$5 = _undefined$1;
365
+ function isAsyncIterable$1(val) {
366
+ return (0, null_1$3.isntNull)(val)
367
+ && (0, undefined_1$5.isntUndefined)(val)
353
368
  && typeof val[Symbol.asyncIterator] === 'function';
354
369
  }
355
- asyncIterable.isAsyncIterable = isAsyncIterable;
356
- function isntAsyncIterable(val) {
357
- return !isAsyncIterable(val);
370
+ asyncIterable$1.isAsyncIterable = isAsyncIterable$1;
371
+ function isntAsyncIterable$1(val) {
372
+ return !isAsyncIterable$1(val);
358
373
  }
359
- asyncIterable.isntAsyncIterable = isntAsyncIterable;
374
+ asyncIterable$1.isntAsyncIterable = isntAsyncIterable$1;
360
375
 
361
- var bigint = {};
376
+ var bigint$1 = {};
362
377
 
363
- bigint.isntBigInt = bigint.isBigInt = void 0;
364
- function isBigInt(val) {
378
+ bigint$1.isntBigInt = bigint$1.isBigInt = void 0;
379
+ function isBigInt$1(val) {
365
380
  return typeof val === 'bigint';
366
381
  }
367
- bigint.isBigInt = isBigInt;
368
- function isntBigInt(val) {
369
- return !isBigInt(val);
382
+ bigint$1.isBigInt = isBigInt$1;
383
+ function isntBigInt$1(val) {
384
+ return !isBigInt$1(val);
370
385
  }
371
- bigint.isntBigInt = isntBigInt;
386
+ bigint$1.isntBigInt = isntBigInt$1;
372
387
 
373
- var boolean = {};
388
+ var boolean$1 = {};
374
389
 
375
- boolean.isntBoolean = boolean.isBoolean = void 0;
376
- function isBoolean(val) {
390
+ boolean$1.isntBoolean = boolean$1.isBoolean = void 0;
391
+ function isBoolean$1(val) {
377
392
  return typeof val === 'boolean';
378
393
  }
379
- boolean.isBoolean = isBoolean;
380
- function isntBoolean(val) {
381
- return !isBoolean(val);
394
+ boolean$1.isBoolean = isBoolean$1;
395
+ function isntBoolean$1(val) {
396
+ return !isBoolean$1(val);
382
397
  }
383
- boolean.isntBoolean = isntBoolean;
398
+ boolean$1.isntBoolean = isntBoolean$1;
384
399
 
385
- var char = {};
400
+ var char$1 = {};
386
401
 
387
- var string = {};
402
+ var string$1 = {};
388
403
 
389
- string.isntString = string.isString = void 0;
390
- function isString(val) {
404
+ string$1.isntString = string$1.isString = void 0;
405
+ function isString$1(val) {
391
406
  return typeof val === 'string';
392
407
  }
393
- string.isString = isString;
394
- function isntString(val) {
395
- return !isString(val);
408
+ string$1.isString = isString$1;
409
+ function isntString$1(val) {
410
+ return !isString$1(val);
396
411
  }
397
- string.isntString = isntString;
412
+ string$1.isntString = isntString$1;
398
413
 
399
- char.isntChar = char.isChar = void 0;
400
- const string_1$1 = string;
401
- function isChar(val) {
402
- return (0, string_1$1.isString)(val)
414
+ char$1.isntChar = char$1.isChar = void 0;
415
+ const string_1$3 = string$1;
416
+ function isChar$1(val) {
417
+ return (0, string_1$3.isString)(val)
403
418
  && val.length === 1;
404
419
  }
405
- char.isChar = isChar;
406
- function isntChar(val) {
407
- return !isChar(val);
420
+ char$1.isChar = isChar$1;
421
+ function isntChar$1(val) {
422
+ return !isChar$1(val);
408
423
  }
409
- char.isntChar = isntChar;
424
+ char$1.isntChar = isntChar$1;
410
425
 
411
- var date = {};
426
+ var date$1 = {};
412
427
 
413
- date.isntDate = date.isDate = void 0;
414
- function isDate(val) {
428
+ date$1.isntDate = date$1.isDate = void 0;
429
+ function isDate$1(val) {
415
430
  return val instanceof Date;
416
431
  }
417
- date.isDate = isDate;
418
- function isntDate(val) {
419
- return !isDate(val);
432
+ date$1.isDate = isDate$1;
433
+ function isntDate$1(val) {
434
+ return !isDate$1(val);
420
435
  }
421
- date.isntDate = isntDate;
436
+ date$1.isntDate = isntDate$1;
422
437
 
423
- var _enum = {};
438
+ var _enum$1 = {};
424
439
 
425
- _enum.inEnum = void 0;
426
- function inEnum(val, _enum) {
440
+ _enum$1.inEnum = void 0;
441
+ function inEnum$1(val, _enum) {
427
442
  return Object.values(_enum).includes(val);
428
443
  }
429
- _enum.inEnum = inEnum;
444
+ _enum$1.inEnum = inEnum$1;
430
445
 
431
- var error = {};
446
+ var error$1 = {};
432
447
 
433
- error.isntError = error.isError = void 0;
434
- function isError(val) {
448
+ error$1.isntError = error$1.isError = void 0;
449
+ function isError$1(val) {
435
450
  return val instanceof Error;
436
451
  }
437
- error.isError = isError;
438
- function isntError(val) {
439
- return !isError(val);
452
+ error$1.isError = isError$1;
453
+ function isntError$1(val) {
454
+ return !isError$1(val);
440
455
  }
441
- error.isntError = isntError;
456
+ error$1.isntError = isntError$1;
442
457
 
443
- var falsy = {};
458
+ var falsy$1 = {};
444
459
 
445
- falsy.isntFalsy = falsy.isFalsy = void 0;
446
- function isFalsy(val) {
460
+ falsy$1.isntFalsy = falsy$1.isFalsy = void 0;
461
+ function isFalsy$1(val) {
447
462
  return !val;
448
463
  }
449
- falsy.isFalsy = isFalsy;
450
- function isntFalsy(val) {
451
- return !isFalsy(val);
464
+ falsy$1.isFalsy = isFalsy$1;
465
+ function isntFalsy$1(val) {
466
+ return !isFalsy$1(val);
452
467
  }
453
- falsy.isntFalsy = isntFalsy;
468
+ falsy$1.isntFalsy = isntFalsy$1;
454
469
 
455
- var _function = {};
470
+ var _function$1 = {};
456
471
 
457
- _function.isntFunction = _function.isFunction = void 0;
458
- function isFunction(val) {
472
+ _function$1.isntFunction = _function$1.isFunction = void 0;
473
+ function isFunction$2(val) {
459
474
  return typeof val === 'function';
460
475
  }
461
- _function.isFunction = isFunction;
462
- function isntFunction(val) {
463
- return !isFunction(val);
476
+ _function$1.isFunction = isFunction$2;
477
+ function isntFunction$1(val) {
478
+ return !isFunction$2(val);
464
479
  }
465
- _function.isntFunction = isntFunction;
480
+ _function$1.isntFunction = isntFunction$1;
466
481
 
467
- var iterable = {};
482
+ var iterable$1 = {};
468
483
 
469
- iterable.isntIterable = iterable.isIterable = void 0;
470
- const null_1 = _null;
471
- const undefined_1$1 = _undefined;
472
- function isIterable(val) {
473
- return (0, null_1.isntNull)(val)
474
- && (0, undefined_1$1.isntUndefined)(val)
484
+ iterable$1.isntIterable = iterable$1.isIterable = void 0;
485
+ const null_1$2 = _null$1;
486
+ const undefined_1$4 = _undefined$1;
487
+ function isIterable$1(val) {
488
+ return (0, null_1$2.isntNull)(val)
489
+ && (0, undefined_1$4.isntUndefined)(val)
475
490
  && typeof val[Symbol.iterator] === 'function';
476
491
  }
477
- iterable.isIterable = isIterable;
478
- function isntIterable(val) {
479
- return !isIterable(val);
492
+ iterable$1.isIterable = isIterable$1;
493
+ function isntIterable$1(val) {
494
+ return !isIterable$1(val);
480
495
  }
481
- iterable.isntIterable = isntIterable;
496
+ iterable$1.isntIterable = isntIterable$1;
482
497
 
483
- var jsonRpc = {};
498
+ var jsonRpc$1 = {};
484
499
 
485
- var object = {};
500
+ var object$1 = {};
486
501
 
487
- object.isntEmptyObject = object.isEmptyObject = object.isRecord = object.isntObject = object.isObject = void 0;
488
- function isObject(val) {
502
+ object$1.isntEmptyObject = object$1.isEmptyObject = object$1.isRecord = object$1.isntObject = object$1.isObject = void 0;
503
+ function isObject$1(val) {
489
504
  return val !== null && typeof val === 'object';
490
505
  }
491
- object.isObject = isObject;
492
- function isntObject(val) {
493
- return !isObject(val);
506
+ object$1.isObject = isObject$1;
507
+ function isntObject$1(val) {
508
+ return !isObject$1(val);
494
509
  }
495
- object.isntObject = isntObject;
496
- function isRecord(val) {
497
- return isObject(val);
510
+ object$1.isntObject = isntObject$1;
511
+ function isRecord$1(val) {
512
+ return isObject$1(val);
498
513
  }
499
- object.isRecord = isRecord;
500
- function isEmptyObject(val) {
514
+ object$1.isRecord = isRecord$1;
515
+ function isEmptyObject$1(val) {
501
516
  return Object.keys(val).length === 0;
502
517
  }
503
- object.isEmptyObject = isEmptyObject;
504
- function isntEmptyObject(val) {
518
+ object$1.isEmptyObject = isEmptyObject$1;
519
+ function isntEmptyObject$1(val) {
505
520
  return Object.keys(val).length !== 0;
506
521
  }
507
- object.isntEmptyObject = isntEmptyObject;
522
+ object$1.isntEmptyObject = isntEmptyObject$1;
508
523
 
509
- var number = {};
524
+ var number$1 = {};
510
525
 
511
- number.isntNumber = number.isNumber = void 0;
512
- function isNumber(val) {
526
+ number$1.isntNumber = number$1.isNumber = void 0;
527
+ function isNumber$1(val) {
513
528
  return typeof val === 'number';
514
529
  }
515
- number.isNumber = isNumber;
516
- function isntNumber(val) {
517
- return !isNumber(val);
518
- }
519
- number.isntNumber = isntNumber;
520
-
521
- jsonRpc.isntJsonRpcError = jsonRpc.isJsonRpcError = jsonRpc.isntJsonRpcSuccess = jsonRpc.isJsonRpcSuccess = jsonRpc.isntJsonRpcRequest = jsonRpc.isJsonRpcRequest = jsonRpc.isntJsonRpcNotification = jsonRpc.isJsonRpcNotification = void 0;
522
- const array_1 = array;
523
- const object_1 = object;
524
- const string_1 = string;
525
- const number_1 = number;
526
- const undefined_1 = _undefined;
527
- function isJsonRpcId(val) {
528
- return (0, string_1.isString)(val) || (0, number_1.isNumber)(val);
529
- }
530
- function isJsonRpcParams(val) {
531
- return (0, array_1.isArray)(val) || (0, object_1.isObject)(val);
532
- }
533
- function isJsonRpcNotification(val) {
534
- return (0, object_1.isRecord)(val)
535
- && (0, string_1.isString)(val.jsonrpc)
536
- && (0, string_1.isString)(val.method)
537
- && (0, undefined_1.isUndefined)(val.id)
538
- && isJsonRpcParams(val.params);
539
- }
540
- jsonRpc.isJsonRpcNotification = isJsonRpcNotification;
541
- function isntJsonRpcNotification(val) {
542
- return !isJsonRpcNotification(val);
543
- }
544
- jsonRpc.isntJsonRpcNotification = isntJsonRpcNotification;
545
- function isJsonRpcRequest(val) {
546
- return (0, object_1.isRecord)(val)
547
- && (0, string_1.isString)(val.jsonrpc)
548
- && (0, string_1.isString)(val.method)
549
- && isJsonRpcId(val.id)
550
- && isJsonRpcParams(val.params);
551
- }
552
- jsonRpc.isJsonRpcRequest = isJsonRpcRequest;
553
- function isntJsonRpcRequest(val) {
554
- return !isJsonRpcRequest(val);
555
- }
556
- jsonRpc.isntJsonRpcRequest = isntJsonRpcRequest;
557
- function isJsonRpcSuccess(val) {
558
- return (0, object_1.isRecord)(val)
559
- && (0, string_1.isString)(val.jsonrpc)
560
- && (0, string_1.isString)(val.id)
561
- && (0, undefined_1.isntUndefined)(val.result);
562
- }
563
- jsonRpc.isJsonRpcSuccess = isJsonRpcSuccess;
564
- function isntJsonRpcSuccess(val) {
565
- return !isJsonRpcSuccess(val);
566
- }
567
- jsonRpc.isntJsonRpcSuccess = isntJsonRpcSuccess;
568
- function isJsonRpcError(val) {
569
- return (0, object_1.isRecord)(val)
570
- && (0, string_1.isString)(val.jsonrpc)
571
- && isJsonRpcId(val.id)
572
- && isJsonRpcErrorObject(val.error);
573
- }
574
- jsonRpc.isJsonRpcError = isJsonRpcError;
575
- function isntJsonRpcError(val) {
576
- return !isJsonRpcError(val);
577
- }
578
- jsonRpc.isntJsonRpcError = isntJsonRpcError;
579
- function isJsonRpcErrorObject(val) {
580
- return (0, object_1.isRecord)(val)
581
- && (0, number_1.isNumber)(val.code)
582
- && (0, string_1.isString)(val.message)
583
- && ((0, undefined_1.isUndefined)(val.data) || (0, object_1.isObject)(val.data));
584
- }
585
-
586
- var json = {};
587
-
588
- json.isntJson = json.isJson = void 0;
589
- function isJson(val) {
530
+ number$1.isNumber = isNumber$1;
531
+ function isntNumber$1(val) {
532
+ return !isNumber$1(val);
533
+ }
534
+ number$1.isntNumber = isntNumber$1;
535
+
536
+ jsonRpc$1.isntJsonRpcError = jsonRpc$1.isJsonRpcError = jsonRpc$1.isntJsonRpcSuccess = jsonRpc$1.isJsonRpcSuccess = jsonRpc$1.isntJsonRpcRequest = jsonRpc$1.isJsonRpcRequest = jsonRpc$1.isntJsonRpcNotification = jsonRpc$1.isJsonRpcNotification = void 0;
537
+ const array_1$1 = array$1;
538
+ const object_1$1 = object$1;
539
+ const string_1$2 = string$1;
540
+ const number_1$1 = number$1;
541
+ const undefined_1$3 = _undefined$1;
542
+ function isJsonRpcId$1(val) {
543
+ return (0, string_1$2.isString)(val) || (0, number_1$1.isNumber)(val);
544
+ }
545
+ function isJsonRpcParams$1(val) {
546
+ return (0, array_1$1.isArray)(val) || (0, object_1$1.isObject)(val);
547
+ }
548
+ function isJsonRpcNotification$1(val) {
549
+ return (0, object_1$1.isRecord)(val)
550
+ && (0, string_1$2.isString)(val.jsonrpc)
551
+ && (0, string_1$2.isString)(val.method)
552
+ && (0, undefined_1$3.isUndefined)(val.id)
553
+ && isJsonRpcParams$1(val.params);
554
+ }
555
+ jsonRpc$1.isJsonRpcNotification = isJsonRpcNotification$1;
556
+ function isntJsonRpcNotification$1(val) {
557
+ return !isJsonRpcNotification$1(val);
558
+ }
559
+ jsonRpc$1.isntJsonRpcNotification = isntJsonRpcNotification$1;
560
+ function isJsonRpcRequest$1(val) {
561
+ return (0, object_1$1.isRecord)(val)
562
+ && (0, string_1$2.isString)(val.jsonrpc)
563
+ && (0, string_1$2.isString)(val.method)
564
+ && isJsonRpcId$1(val.id)
565
+ && isJsonRpcParams$1(val.params);
566
+ }
567
+ jsonRpc$1.isJsonRpcRequest = isJsonRpcRequest$1;
568
+ function isntJsonRpcRequest$1(val) {
569
+ return !isJsonRpcRequest$1(val);
570
+ }
571
+ jsonRpc$1.isntJsonRpcRequest = isntJsonRpcRequest$1;
572
+ function isJsonRpcSuccess$1(val) {
573
+ return (0, object_1$1.isRecord)(val)
574
+ && (0, string_1$2.isString)(val.jsonrpc)
575
+ && (0, string_1$2.isString)(val.id)
576
+ && (0, undefined_1$3.isntUndefined)(val.result);
577
+ }
578
+ jsonRpc$1.isJsonRpcSuccess = isJsonRpcSuccess$1;
579
+ function isntJsonRpcSuccess$1(val) {
580
+ return !isJsonRpcSuccess$1(val);
581
+ }
582
+ jsonRpc$1.isntJsonRpcSuccess = isntJsonRpcSuccess$1;
583
+ function isJsonRpcError$1(val) {
584
+ return (0, object_1$1.isRecord)(val)
585
+ && (0, string_1$2.isString)(val.jsonrpc)
586
+ && isJsonRpcId$1(val.id)
587
+ && isJsonRpcErrorObject$1(val.error);
588
+ }
589
+ jsonRpc$1.isJsonRpcError = isJsonRpcError$1;
590
+ function isntJsonRpcError$1(val) {
591
+ return !isJsonRpcError$1(val);
592
+ }
593
+ jsonRpc$1.isntJsonRpcError = isntJsonRpcError$1;
594
+ function isJsonRpcErrorObject$1(val) {
595
+ return (0, object_1$1.isRecord)(val)
596
+ && (0, number_1$1.isNumber)(val.code)
597
+ && (0, string_1$2.isString)(val.message)
598
+ && ((0, undefined_1$3.isUndefined)(val.data) || (0, object_1$1.isObject)(val.data));
599
+ }
600
+
601
+ var json$1 = {};
602
+
603
+ json$1.isntJson = json$1.isJson = void 0;
604
+ function isJson$1(val) {
590
605
  try {
591
606
  JSON.stringify(val);
592
607
  return true;
@@ -595,16 +610,16 @@ function isJson(val) {
595
610
  return false;
596
611
  }
597
612
  }
598
- json.isJson = isJson;
599
- function isntJson(val) {
600
- return !isntJson();
613
+ json$1.isJson = isJson$1;
614
+ function isntJson$1(val) {
615
+ return !isntJson$1();
601
616
  }
602
- json.isntJson = isntJson;
617
+ json$1.isntJson = isntJson$1;
603
618
 
604
- var url = {};
619
+ var url$1 = {};
605
620
 
606
- url.isAbsoluteURL = void 0;
607
- function isAbsoluteURL(str) {
621
+ url$1.isAbsoluteURL = void 0;
622
+ function isAbsoluteURL$1(str) {
608
623
  try {
609
624
  new URL(str);
610
625
  return true;
@@ -613,7 +628,7 @@ function isAbsoluteURL(str) {
613
628
  return false;
614
629
  }
615
630
  }
616
- url.isAbsoluteURL = isAbsoluteURL;
631
+ url$1.isAbsoluteURL = isAbsoluteURL$1;
617
632
 
618
633
  (function (exports) {
619
634
  var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
@@ -625,30 +640,30 @@ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Obj
625
640
  }));
626
641
  var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
627
642
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
628
- };__exportStar(array, exports);
629
- __exportStar(asyncIterable, exports);
630
- __exportStar(bigint, exports);
631
- __exportStar(boolean, exports);
632
- __exportStar(char, exports);
633
- __exportStar(date, exports);
634
- __exportStar(_enum, exports);
635
- __exportStar(error, exports);
636
- __exportStar(falsy, exports);
637
- __exportStar(_function, exports);
638
- __exportStar(iterable, exports);
639
- __exportStar(jsonRpc, exports);
640
- __exportStar(json, exports);
641
- __exportStar(_null, exports);
642
- __exportStar(number, exports);
643
- __exportStar(object, exports);
644
- __exportStar(string, exports);
645
- __exportStar(_undefined, exports);
646
- __exportStar(url, exports);
643
+ };__exportStar(array$1, exports);
644
+ __exportStar(asyncIterable$1, exports);
645
+ __exportStar(bigint$1, exports);
646
+ __exportStar(boolean$1, exports);
647
+ __exportStar(char$1, exports);
648
+ __exportStar(date$1, exports);
649
+ __exportStar(_enum$1, exports);
650
+ __exportStar(error$1, exports);
651
+ __exportStar(falsy$1, exports);
652
+ __exportStar(_function$1, exports);
653
+ __exportStar(iterable$1, exports);
654
+ __exportStar(jsonRpc$1, exports);
655
+ __exportStar(json$1, exports);
656
+ __exportStar(_null$1, exports);
657
+ __exportStar(number$1, exports);
658
+ __exportStar(object$1, exports);
659
+ __exportStar(string$1, exports);
660
+ __exportStar(_undefined$1, exports);
661
+ __exportStar(url$1, exports);
647
662
 
648
- }(es2018$1));
663
+ }(es2018$3));
649
664
 
650
665
  chunkByAsync$1.chunkByAsync = void 0;
651
- const types_1$h = es2018$1;
666
+ const types_1$h = es2018$3;
652
667
  function chunkByAsync(iterable, predicate) {
653
668
  if ((0, types_1$h.isAsyncIterable)(iterable)) {
654
669
  return chunkByAsyncIterable(iterable);
@@ -709,8 +724,8 @@ chunkBy$1.chunkBy = chunkBy;
709
724
  var chunk$1 = {};
710
725
 
711
726
  chunk$1.chunk = void 0;
712
- const go_1$e = es2018$2;
713
- const errors_1$e = es2018$4;
727
+ const go_1$e = es2018$4;
728
+ const errors_1$e = es2018$6;
714
729
  function chunk(iterable, size) {
715
730
  (0, errors_1$e.assert)(Number.isInteger(size), 'The parameter size must be an integer');
716
731
  (0, errors_1$e.assert)(size > 0, 'The parameter size must be greater than 0');
@@ -732,8 +747,8 @@ chunk$1.chunk = chunk;
732
747
  var concatAsync$1 = {};
733
748
 
734
749
  concatAsync$1.concatAsync = void 0;
735
- const types_1$g = es2018$1;
736
- const go_1$d = es2018$2;
750
+ const types_1$g = es2018$3;
751
+ const go_1$d = es2018$4;
737
752
  function concatAsync(iterable, ...otherIterables) {
738
753
  return (0, go_1$d.go)(async function* () {
739
754
  for (const iter of [iterable, ...otherIterables]) {
@@ -755,7 +770,7 @@ concatAsync$1.concatAsync = concatAsync;
755
770
  var concat$1 = {};
756
771
 
757
772
  concat$1.concat = void 0;
758
- const go_1$c = es2018$2;
773
+ const go_1$c = es2018$4;
759
774
  function concat(iterable, ...otherIterables) {
760
775
  return (0, go_1$c.go)(function* () {
761
776
  for (const iter of [iterable, ...otherIterables]) {
@@ -784,9 +799,9 @@ function* copyIterable(iterable) {
784
799
  utils.copyIterable = copyIterable;
785
800
 
786
801
  dropAsync$1.dropAsync = void 0;
787
- const go_1$b = es2018$2;
802
+ const go_1$b = es2018$4;
788
803
  const utils_1$3 = utils;
789
- const errors_1$d = es2018$4;
804
+ const errors_1$d = es2018$6;
790
805
  function dropAsync(iterable, count) {
791
806
  (0, errors_1$d.assert)(Number.isInteger(count), 'The parameter count must be an integer');
792
807
  (0, errors_1$d.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -819,9 +834,9 @@ dropAsync$1.dropAsync = dropAsync;
819
834
  var dropRightAsync$1 = {};
820
835
 
821
836
  dropRightAsync$1.dropRightAsync = void 0;
822
- const go_1$a = es2018$2;
837
+ const go_1$a = es2018$4;
823
838
  const utils_1$2 = utils;
824
- const errors_1$c = es2018$4;
839
+ const errors_1$c = es2018$6;
825
840
  function dropRightAsync(iterable, count) {
826
841
  (0, errors_1$c.assert)(Number.isInteger(count), 'The parameter count must be an integer');
827
842
  (0, errors_1$c.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -847,9 +862,9 @@ async function toArrayAsync$2(iterable) {
847
862
  var dropRight$1 = {};
848
863
 
849
864
  dropRight$1.dropRight = void 0;
850
- const go_1$9 = es2018$2;
865
+ const go_1$9 = es2018$4;
851
866
  const utils_1$1 = utils;
852
- const errors_1$b = es2018$4;
867
+ const errors_1$b = es2018$6;
853
868
  function dropRight(iterable, count) {
854
869
  (0, errors_1$b.assert)(Number.isInteger(count), 'The parameter count must be an integer');
855
870
  (0, errors_1$b.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -865,7 +880,7 @@ dropRight$1.dropRight = dropRight;
865
880
  var dropUntilAsync$1 = {};
866
881
 
867
882
  dropUntilAsync$1.dropUntilAsync = void 0;
868
- const types_1$f = es2018$1;
883
+ const types_1$f = es2018$3;
869
884
  function dropUntilAsync(iterable, predicate) {
870
885
  if ((0, types_1$f.isAsyncIterable)(iterable)) {
871
886
  return dropUntilAsyncIterable(iterable);
@@ -947,9 +962,9 @@ dropUntil$1.dropUntil = dropUntil;
947
962
  var drop$1 = {};
948
963
 
949
964
  drop$1.drop = void 0;
950
- const go_1$8 = es2018$2;
965
+ const go_1$8 = es2018$4;
951
966
  const utils_1 = utils;
952
- const errors_1$a = es2018$4;
967
+ const errors_1$a = es2018$6;
953
968
  function drop(iterable, count) {
954
969
  (0, errors_1$a.assert)(Number.isInteger(count), 'The parameter count must be an integer');
955
970
  (0, errors_1$a.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -982,7 +997,7 @@ drop$1.drop = drop;
982
997
  var filterAsync$1 = {};
983
998
 
984
999
  filterAsync$1.filterAsync = void 0;
985
- const types_1$e = es2018$1;
1000
+ const types_1$e = es2018$3;
986
1001
  function filterAsync(iterable, predicate) {
987
1002
  if ((0, types_1$e.isAsyncIterable)(iterable)) {
988
1003
  return filterAsyncIterable(iterable);
@@ -1029,7 +1044,7 @@ var flattenDeepAsync$1 = {};
1029
1044
  var flattenByAsync$1 = {};
1030
1045
 
1031
1046
  flattenByAsync$1.flattenByAsync = void 0;
1032
- const types_1$d = es2018$1;
1047
+ const types_1$d = es2018$3;
1033
1048
  function flattenByAsync(iterable, predicate) {
1034
1049
  if ((0, types_1$d.isAsyncIterable)(iterable)) {
1035
1050
  return flattenByAsyncIterable(iterable);
@@ -1069,7 +1084,7 @@ function isFiniteIterable$1(val) {
1069
1084
 
1070
1085
  flattenDeepAsync$1.flattenDeepAsync = void 0;
1071
1086
  const flatten_by_async_1 = flattenByAsync$1;
1072
- const errors_1$9 = es2018$4;
1087
+ const errors_1$9 = es2018$6;
1073
1088
  function flattenDeepAsync(iterable, depth = Infinity) {
1074
1089
  (0, errors_1$9.assert)(depth === Infinity || Number.isInteger(depth), 'The parameter depth must be an integer');
1075
1090
  (0, errors_1$9.assert)(depth >= 0, 'The parameter depth must be greater than or equal to 0');
@@ -1087,7 +1102,7 @@ flattenAsync$1.flattenAsync = flattenAsync;
1087
1102
  var flattenBy$1 = {};
1088
1103
 
1089
1104
  flattenBy$1.flattenBy = void 0;
1090
- const types_1$c = es2018$1;
1105
+ const types_1$c = es2018$3;
1091
1106
  function flattenBy(iterable, predicate) {
1092
1107
  return flatten(iterable, 1);
1093
1108
  function* flatten(iterable, level) {
@@ -1110,7 +1125,7 @@ var flattenDeep$1 = {};
1110
1125
 
1111
1126
  flattenDeep$1.flattenDeep = void 0;
1112
1127
  const flatten_by_1 = flattenBy$1;
1113
- const errors_1$8 = es2018$4;
1128
+ const errors_1$8 = es2018$6;
1114
1129
  function flattenDeep(iterable, depth = Infinity) {
1115
1130
  (0, errors_1$8.assert)(depth === Infinity || Number.isInteger(depth), 'The parameter depth must be an integer');
1116
1131
  (0, errors_1$8.assert)(depth >= 0, 'The parameter depth must be greater than or equal to 0');
@@ -1130,7 +1145,7 @@ flatten$1.flatten = flatten;
1130
1145
  var mapAsync$1 = {};
1131
1146
 
1132
1147
  mapAsync$1.mapAsync = void 0;
1133
- const types_1$b = es2018$1;
1148
+ const types_1$b = es2018$3;
1134
1149
  function mapAsync(iterable, fn) {
1135
1150
  if ((0, types_1$b.isAsyncIterable)(iterable)) {
1136
1151
  return mapAsyncIterable(iterable);
@@ -1170,8 +1185,8 @@ map$1.map = map;
1170
1185
  var repeatAsync$1 = {};
1171
1186
 
1172
1187
  repeatAsync$1.repeatAsync = void 0;
1173
- const go_1$7 = es2018$2;
1174
- const errors_1$7 = es2018$4;
1188
+ const go_1$7 = es2018$4;
1189
+ const errors_1$7 = es2018$6;
1175
1190
  function repeatAsync(iterable, times) {
1176
1191
  (0, errors_1$7.assert)(times === Infinity || Number.isInteger(times), 'The parameter times must be an integer');
1177
1192
  (0, errors_1$7.assert)(times >= 0, 'The parameter times must be greater than or equal to 0');
@@ -1205,8 +1220,8 @@ function isProduction$1() {
1205
1220
  var repeat$1 = {};
1206
1221
 
1207
1222
  repeat$1.repeat = void 0;
1208
- const go_1$6 = es2018$2;
1209
- const errors_1$6 = es2018$4;
1223
+ const go_1$6 = es2018$4;
1224
+ const errors_1$6 = es2018$6;
1210
1225
  function repeat(iterable, times) {
1211
1226
  (0, errors_1$6.assert)(times === Infinity || Number.isInteger(times), 'The parameter times must be an integer');
1212
1227
  (0, errors_1$6.assert)(times >= 0, 'The parameter times must be greater than or equal to 0');
@@ -1240,8 +1255,8 @@ function isProduction() {
1240
1255
  var sliceAsync$1 = {};
1241
1256
 
1242
1257
  sliceAsync$1.sliceAsync = void 0;
1243
- const go_1$5 = es2018$2;
1244
- const errors_1$5 = es2018$4;
1258
+ const go_1$5 = es2018$4;
1259
+ const errors_1$5 = es2018$6;
1245
1260
  function sliceAsync(iterable, start, end = Infinity) {
1246
1261
  (0, errors_1$5.assert)(Number.isInteger(start), 'The parameter start must be an integer');
1247
1262
  (0, errors_1$5.assert)(start >= 0, 'The parameter start must be greater than or equal to 0');
@@ -1263,8 +1278,8 @@ sliceAsync$1.sliceAsync = sliceAsync;
1263
1278
  var slice$1 = {};
1264
1279
 
1265
1280
  slice$1.slice = void 0;
1266
- const go_1$4 = es2018$2;
1267
- const errors_1$4 = es2018$4;
1281
+ const go_1$4 = es2018$4;
1282
+ const errors_1$4 = es2018$6;
1268
1283
  function slice(iterable, start, end = Infinity) {
1269
1284
  (0, errors_1$4.assert)(Number.isInteger(start), 'The parameter start must be an integer');
1270
1285
  (0, errors_1$4.assert)(start >= 0, 'The parameter start must be greater than or equal to 0');
@@ -1304,7 +1319,7 @@ splitAsync$1.splitAsync = splitAsync;
1304
1319
  var splitByAsync$1 = {};
1305
1320
 
1306
1321
  splitByAsync$1.splitByAsync = void 0;
1307
- const types_1$a = es2018$1;
1322
+ const types_1$a = es2018$3;
1308
1323
  function splitByAsync(iterable, predicate) {
1309
1324
  if ((0, types_1$a.isAsyncIterable)(iterable)) {
1310
1325
  return splitByAsyncIterable(iterable);
@@ -1386,8 +1401,8 @@ split$1.split = split;
1386
1401
  var takeAsync$1 = {};
1387
1402
 
1388
1403
  takeAsync$1.takeAsync = void 0;
1389
- const go_1$3 = es2018$2;
1390
- const errors_1$3 = es2018$4;
1404
+ const go_1$3 = es2018$4;
1405
+ const errors_1$3 = es2018$6;
1391
1406
  function takeAsync(iterable, count) {
1392
1407
  (0, errors_1$3.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1393
1408
  (0, errors_1$3.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1407,8 +1422,8 @@ takeAsync$1.takeAsync = takeAsync;
1407
1422
  var takeRightAsync$1 = {};
1408
1423
 
1409
1424
  takeRightAsync$1.takeRightAsync = void 0;
1410
- const go_1$2 = es2018$2;
1411
- const errors_1$2 = es2018$4;
1425
+ const go_1$2 = es2018$4;
1426
+ const errors_1$2 = es2018$6;
1412
1427
  function takeRightAsync(iterable, count) {
1413
1428
  (0, errors_1$2.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1414
1429
  (0, errors_1$2.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1437,8 +1452,8 @@ takeRightAsync$1.takeRightAsync = takeRightAsync;
1437
1452
  var takeRight$1 = {};
1438
1453
 
1439
1454
  takeRight$1.takeRight = void 0;
1440
- const go_1$1 = es2018$2;
1441
- const errors_1$1 = es2018$4;
1455
+ const go_1$1 = es2018$4;
1456
+ const errors_1$1 = es2018$6;
1442
1457
  function takeRight(iterable, count) {
1443
1458
  (0, errors_1$1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1444
1459
  (0, errors_1$1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1467,7 +1482,7 @@ takeRight$1.takeRight = takeRight;
1467
1482
  var takeUntilAsync$1 = {};
1468
1483
 
1469
1484
  takeUntilAsync$1.takeUntilAsync = void 0;
1470
- const types_1$9 = es2018$1;
1485
+ const types_1$9 = es2018$3;
1471
1486
  function takeUntilAsync(iterable, predicate) {
1472
1487
  if ((0, types_1$9.isAsyncIterable)(iterable)) {
1473
1488
  return takeUntilAsyncIterable(iterable);
@@ -1513,8 +1528,8 @@ takeUntil$1.takeUntil = takeUntil;
1513
1528
  var take$1 = {};
1514
1529
 
1515
1530
  take$1.take = void 0;
1516
- const go_1 = es2018$2;
1517
- const errors_1 = es2018$4;
1531
+ const go_1 = es2018$4;
1532
+ const errors_1 = es2018$6;
1518
1533
  function take(iterable, count) {
1519
1534
  (0, errors_1.assert)(Number.isInteger(count), 'The parameter count must be an integer');
1520
1535
  (0, errors_1.assert)(count >= 0, 'The parameter count must be greater than or equal to 0');
@@ -1534,7 +1549,7 @@ take$1.take = take;
1534
1549
  var tapAsync$1 = {};
1535
1550
 
1536
1551
  tapAsync$1.tapAsync = void 0;
1537
- const types_1$8 = es2018$1;
1552
+ const types_1$8 = es2018$3;
1538
1553
  function tapAsync(iterable, fn) {
1539
1554
  if ((0, types_1$8.isAsyncIterable)(iterable)) {
1540
1555
  return tapAsyncIterable(iterable);
@@ -1617,7 +1632,7 @@ uniqAsync$1.uniqAsync = uniqAsync;
1617
1632
  var uniqByAsync$1 = {};
1618
1633
 
1619
1634
  uniqByAsync$1.uniqByAsync = void 0;
1620
- const types_1$7 = es2018$1;
1635
+ const types_1$7 = es2018$3;
1621
1636
  function uniqByAsync(iterable, fn) {
1622
1637
  if ((0, types_1$7.isAsyncIterable)(iterable)) {
1623
1638
  return uniqByAsyncIterable(iterable);
@@ -1686,7 +1701,7 @@ uniq$1.uniq = uniq;
1686
1701
  var zipAsync$1 = {};
1687
1702
 
1688
1703
  zipAsync$1.zipAsync = void 0;
1689
- const types_1$6 = es2018$1;
1704
+ const types_1$6 = es2018$3;
1690
1705
  var Kind;
1691
1706
  (function (Kind) {
1692
1707
  Kind[Kind["Sync"] = 0] = "Sync";
@@ -1846,7 +1861,7 @@ consume$1.consume = consume;
1846
1861
  var eachAsync$1 = {};
1847
1862
 
1848
1863
  eachAsync$1.eachAsync = void 0;
1849
- const types_1$5 = es2018$1;
1864
+ const types_1$5 = es2018$3;
1850
1865
  function eachAsync(iterable, fn) {
1851
1866
  if ((0, types_1$5.isAsyncIterable)(iterable)) {
1852
1867
  return eachAsyncIterable(iterable);
@@ -1886,7 +1901,7 @@ each$1.each = each;
1886
1901
  var everyAsync$1 = {};
1887
1902
 
1888
1903
  everyAsync$1.everyAsync = void 0;
1889
- const types_1$4 = es2018$1;
1904
+ const types_1$4 = es2018$3;
1890
1905
  function everyAsync(iterable, predicate) {
1891
1906
  if ((0, types_1$4.isAsyncIterable)(iterable)) {
1892
1907
  return everyAsyncIterable(iterable);
@@ -1932,7 +1947,7 @@ every$1.every = every;
1932
1947
  var findAsync$1 = {};
1933
1948
 
1934
1949
  findAsync$1.findAsync = void 0;
1935
- const types_1$3 = es2018$1;
1950
+ const types_1$3 = es2018$3;
1936
1951
  function findAsync(iterable, predicate) {
1937
1952
  if ((0, types_1$3.isAsyncIterable)(iterable)) {
1938
1953
  return findAsyncIterable(iterable);
@@ -2056,7 +2071,7 @@ match$1.match = match;
2056
2071
  var reduceAsync$1 = {};
2057
2072
 
2058
2073
  reduceAsync$1.reduceAsync = void 0;
2059
- const types_1$2 = es2018$1;
2074
+ const types_1$2 = es2018$3;
2060
2075
  function reduceAsync(iterable, fn, initialValue) {
2061
2076
  if ((0, types_1$2.isUndefined)(initialValue)) {
2062
2077
  return reduceAsyncWithoutInitialValue(iterable, fn);
@@ -2152,7 +2167,7 @@ function reduceAsyncWithoutInitialValue(iterable, fn) {
2152
2167
  var reduce$1 = {};
2153
2168
 
2154
2169
  reduce$1.reduce = void 0;
2155
- const types_1$1 = es2018$1;
2170
+ const types_1$1 = es2018$3;
2156
2171
  function reduce(iterable, fn, initialValue) {
2157
2172
  if ((0, types_1$1.isUndefined)(initialValue)) {
2158
2173
  return reduceWithoutInitialValue(iterable, fn);
@@ -2199,7 +2214,7 @@ function reduceWithoutInitialValue(iterable, fn) {
2199
2214
  var someAsync$1 = {};
2200
2215
 
2201
2216
  someAsync$1.someAsync = void 0;
2202
- const types_1 = es2018$1;
2217
+ const types_1 = es2018$3;
2203
2218
  function someAsync(iterable, predicate) {
2204
2219
  if ((0, types_1.isAsyncIterable)(iterable)) {
2205
2220
  return someAsyncIterable(iterable);
@@ -2383,15 +2398,15 @@ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m
2383
2398
  };__exportStar(middleware, exports);
2384
2399
  __exportStar(output, exports);
2385
2400
 
2386
- }(es2018$3));
2401
+ }(es2018$5));
2387
2402
 
2388
2403
  var _LRUMap_limit, _LRUMap_map;
2389
2404
  class LRUMap {
2390
2405
  constructor(limit) {
2391
2406
  _LRUMap_limit.set(this, void 0);
2392
2407
  _LRUMap_map.set(this, new Map());
2393
- es2018$4.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
2394
- es2018$4.assert(limit > 0, 'The parameter limit must be a positive value');
2408
+ es2018$6.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
2409
+ es2018$6.assert(limit > 0, 'The parameter limit must be a positive value');
2395
2410
  __classPrivateFieldSet(this, _LRUMap_limit, limit, "f");
2396
2411
  }
2397
2412
  get [(_LRUMap_limit = new WeakMap(), _LRUMap_map = new WeakMap(), Symbol.toStringTag)]() {
@@ -2439,25 +2454,86 @@ class LRUMap {
2439
2454
  * Return the earliest key inserted in the Map
2440
2455
  */
2441
2456
  getColdestKey() {
2442
- return es2018$3.first(__classPrivateFieldGet(this, _LRUMap_map, "f").keys());
2457
+ return es2018$5.first(__classPrivateFieldGet(this, _LRUMap_map, "f").keys());
2443
2458
  }
2444
2459
  }
2445
2460
 
2446
- var es2018 = {};
2461
+ var es2018$2 = {};
2462
+
2463
+ var exponentialBackoff = {};
2464
+
2465
+ var es2018$1 = {};
2466
+
2467
+ var random$1 = {};
2468
+
2469
+ random$1.random = void 0;
2470
+ function random(min, max) {
2471
+ return Math.random() * (max - min) + min;
2472
+ }
2473
+ random$1.random = random;
2474
+
2475
+ var randomInt$1 = {};
2476
+
2477
+ randomInt$1.randomInt = void 0;
2478
+ function randomInt(min, max) {
2479
+ min = Math.ceil(min);
2480
+ max = Math.floor(max);
2481
+ return Math.floor(Math.random() * (max - min)) + min;
2482
+ }
2483
+ randomInt$1.randomInt = randomInt;
2484
+
2485
+ var randomIntInclusive$1 = {};
2486
+
2487
+ randomIntInclusive$1.randomIntInclusive = void 0;
2488
+ function randomIntInclusive(min, max) {
2489
+ min = Math.ceil(min);
2490
+ max = Math.floor(max);
2491
+ return Math.floor(Math.random() * (max - min + 1)) + min;
2492
+ }
2493
+ randomIntInclusive$1.randomIntInclusive = randomIntInclusive;
2494
+
2495
+ (function (exports) {
2496
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2497
+ if (k2 === undefined) k2 = k;
2498
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
2499
+ }) : (function(o, m, k, k2) {
2500
+ if (k2 === undefined) k2 = k;
2501
+ o[k2] = m[k];
2502
+ }));
2503
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
2504
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2505
+ };__exportStar(random$1, exports);
2506
+ __exportStar(randomInt$1, exports);
2507
+ __exportStar(randomIntInclusive$1, exports);
2508
+
2509
+ }(es2018$1));
2510
+
2511
+ exponentialBackoff.calculateExponentialBackoffTimeout = void 0;
2512
+ const extra_rand_1 = es2018$1;
2513
+ function calculateExponentialBackoffTimeout({ baseTimeout, retries, maxTimeout = Infinity, factor = 2, jitter = true }) {
2514
+ const timeout = Math.min(factor ** retries * baseTimeout, maxTimeout);
2515
+ if (jitter) {
2516
+ return (0, extra_rand_1.randomIntInclusive)(0, timeout);
2517
+ }
2518
+ else {
2519
+ return timeout;
2520
+ }
2521
+ }
2522
+ exponentialBackoff.calculateExponentialBackoffTimeout = calculateExponentialBackoffTimeout;
2447
2523
 
2448
- var setTimeout$1 = {};
2524
+ var setTimeout$2 = {};
2449
2525
 
2450
- setTimeout$1.setTimeout = void 0;
2451
- function setTimeout(timeout, cb) {
2526
+ setTimeout$2.setTimeout = void 0;
2527
+ function setTimeout$1(timeout, cb) {
2452
2528
  const timer = globalThis.setTimeout(cb, timeout);
2453
2529
  return () => clearTimeout(timer);
2454
2530
  }
2455
- setTimeout$1.setTimeout = setTimeout;
2531
+ setTimeout$2.setTimeout = setTimeout$1;
2456
2532
 
2457
2533
  var setSchedule$1 = {};
2458
2534
 
2459
2535
  setSchedule$1.setSchedule = void 0;
2460
- const set_timeout_1$3 = setTimeout$1;
2536
+ const set_timeout_1$3 = setTimeout$2;
2461
2537
  function setSchedule(timestamp, cb) {
2462
2538
  const timeout = timestamp - Date.now();
2463
2539
  return (0, set_timeout_1$3.setTimeout)(timeout, cb);
@@ -2476,7 +2552,7 @@ setInterval$1.setInterval = setInterval;
2476
2552
  var setImmediate$1 = {};
2477
2553
 
2478
2554
  setImmediate$1.setImmediate = void 0;
2479
- const set_timeout_1$2 = setTimeout$1;
2555
+ const set_timeout_1$2 = setTimeout$2;
2480
2556
  function setImmediate(cb) {
2481
2557
  if (globalThis.setImmediate) {
2482
2558
  const timer = globalThis.setImmediate(cb);
@@ -2491,7 +2567,7 @@ setImmediate$1.setImmediate = setImmediate;
2491
2567
  var setTimeoutLoop$1 = {};
2492
2568
 
2493
2569
  setTimeoutLoop$1.setTimeoutLoop = void 0;
2494
- const set_timeout_1$1 = setTimeout$1;
2570
+ const set_timeout_1$1 = setTimeout$2;
2495
2571
  function setTimeoutLoop(timeout, cb) {
2496
2572
  let isCancelled = false;
2497
2573
  let cancel = (0, set_timeout_1$1.setTimeout)(timeout, loop);
@@ -2501,8 +2577,9 @@ function setTimeoutLoop(timeout, cb) {
2501
2577
  };
2502
2578
  async function loop() {
2503
2579
  await cb();
2504
- if (!isCancelled)
2580
+ if (!isCancelled) {
2505
2581
  cancel = (0, set_timeout_1$1.setTimeout)(timeout, loop);
2582
+ }
2506
2583
  }
2507
2584
  }
2508
2585
  setTimeoutLoop$1.setTimeoutLoop = setTimeoutLoop;
@@ -2510,7 +2587,7 @@ setTimeoutLoop$1.setTimeoutLoop = setTimeoutLoop;
2510
2587
  var setDynamicTimeoutLoop$1 = {};
2511
2588
 
2512
2589
  setDynamicTimeoutLoop$1.setDynamicTimeoutLoop = void 0;
2513
- const set_timeout_1 = setTimeout$1;
2590
+ const set_timeout_1 = setTimeout$2;
2514
2591
  function setDynamicTimeoutLoop(timeout, cb) {
2515
2592
  let isCancelled = false;
2516
2593
  let cancel = (0, set_timeout_1.setTimeout)(timeout, loop);
@@ -2522,8 +2599,9 @@ function setDynamicTimeoutLoop(timeout, cb) {
2522
2599
  const start = Date.now();
2523
2600
  await cb();
2524
2601
  const elapsed = Date.now() - start;
2525
- if (!isCancelled)
2602
+ if (!isCancelled) {
2526
2603
  cancel = (0, set_timeout_1.setTimeout)(Math.max(timeout - elapsed, 0), loop);
2604
+ }
2527
2605
  }
2528
2606
  }
2529
2607
  setDynamicTimeoutLoop$1.setDynamicTimeoutLoop = setDynamicTimeoutLoop;
@@ -2538,14 +2616,15 @@ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Obj
2538
2616
  }));
2539
2617
  var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
2540
2618
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2541
- };__exportStar(setTimeout$1, exports);
2619
+ };__exportStar(exponentialBackoff, exports);
2620
+ __exportStar(setTimeout$2, exports);
2542
2621
  __exportStar(setSchedule$1, exports);
2543
2622
  __exportStar(setInterval$1, exports);
2544
2623
  __exportStar(setImmediate$1, exports);
2545
2624
  __exportStar(setTimeoutLoop$1, exports);
2546
2625
  __exportStar(setDynamicTimeoutLoop$1, exports);
2547
2626
 
2548
- }(es2018));
2627
+ }(es2018$2));
2549
2628
 
2550
2629
  var _ExpirableMap_map, _ExpirableMap_cancelClearTimeout;
2551
2630
  class ExpirableMap {
@@ -2635,7 +2714,7 @@ class ExpirableMap {
2635
2714
  if (this.itemMetadataSortedByExpirationTime.length > 0) {
2636
2715
  const item = this.itemMetadataSortedByExpirationTime[0];
2637
2716
  if (Number.isFinite(item.expirationTime)) {
2638
- const cancel = es2018.setSchedule(item.expirationTime, () => {
2717
+ const cancel = es2018$2.setSchedule(item.expirationTime, () => {
2639
2718
  this.clearExpiredItems(Date.now());
2640
2719
  this.rescheduleClearTimeout();
2641
2720
  });
@@ -2661,8 +2740,8 @@ class TLRUMap {
2661
2740
  * 按过期时间升序排列所有项目的元数据
2662
2741
  */
2663
2742
  this.itemMetadataSortedByExpirationTime = [];
2664
- es2018$4.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
2665
- es2018$4.assert(limit > 0, 'The parameter limit must be a positive value');
2743
+ es2018$6.assert(Number.isInteger(limit), 'The parameter limit must be an integer');
2744
+ es2018$6.assert(limit > 0, 'The parameter limit must be a positive value');
2666
2745
  __classPrivateFieldSet(this, _TLRUMap_limit, limit, "f");
2667
2746
  }
2668
2747
  get [(_TLRUMap_limit = new WeakMap(), _TLRUMap_map = new WeakMap(), _TLRUMap_cancelClearTimeout = new WeakMap(), Symbol.toStringTag)]() {
@@ -2766,7 +2845,7 @@ class TLRUMap {
2766
2845
  if (this.itemMetadataSortedByExpirationTime.length > 0) {
2767
2846
  const item = this.itemMetadataSortedByExpirationTime[0];
2768
2847
  if (Number.isFinite(item.expirationTime)) {
2769
- const cancel = es2018.setSchedule(item.expirationTime, () => {
2848
+ const cancel = es2018$2.setSchedule(item.expirationTime, () => {
2770
2849
  this.clearExpiredItems(Date.now());
2771
2850
  this.rescheduleClearTimeout();
2772
2851
  });
@@ -2781,7 +2860,7 @@ class TLRUMap {
2781
2860
  * Return the earliest key inserted in the Map
2782
2861
  */
2783
2862
  getColdestKey() {
2784
- return es2018$3.first(__classPrivateFieldGet(this, _TLRUMap_map, "f").keys());
2863
+ return es2018$5.first(__classPrivateFieldGet(this, _TLRUMap_map, "f").keys());
2785
2864
  }
2786
2865
  }
2787
2866
 
@@ -2849,7 +2928,7 @@ class TrieMap {
2849
2928
  delete node.value;
2850
2929
  // 如果节点没有后缀, 则代表这是末端节点, 往前删除其前缀
2851
2930
  if (node.children.size === 0) {
2852
- for (const [part, parentNode] of es2018$3.toArray(es2018$3.zip(key, parentNodes)).reverse()) {
2931
+ for (const [part, parentNode] of es2018$5.toArray(es2018$5.zip(key, parentNodes)).reverse()) {
2853
2932
  parentNode.children.delete(part);
2854
2933
  if (parentNode.children.size !== 0)
2855
2934
  break;
@@ -2859,5 +2938,1086 @@ class TrieMap {
2859
2938
  }
2860
2939
  }
2861
2940
 
2862
- export { Emitter, ExpirableMap, HashMap, HashSet, LRUMap, Queue, TLRUMap, TrieMap, convertArrayToCons, convertConsToArray };
2941
+ var _FiniteStateMachine_state;
2942
+ class FiniteStateMachine {
2943
+ constructor(schema, initialState) {
2944
+ this.schema = schema;
2945
+ _FiniteStateMachine_state.set(this, void 0);
2946
+ __classPrivateFieldSet(this, _FiniteStateMachine_state, initialState, "f");
2947
+ }
2948
+ get state() {
2949
+ return __classPrivateFieldGet(this, _FiniteStateMachine_state, "f");
2950
+ }
2951
+ matches(state) {
2952
+ return __classPrivateFieldGet(this, _FiniteStateMachine_state, "f") === state;
2953
+ }
2954
+ /**
2955
+ * @throws {BadEventError}
2956
+ */
2957
+ send(event) {
2958
+ if (event in this.schema[this.state]) {
2959
+ __classPrivateFieldSet(this, _FiniteStateMachine_state, this.schema[this.state][event], "f");
2960
+ }
2961
+ else {
2962
+ throw new BadEventError(this.state, event);
2963
+ }
2964
+ }
2965
+ }
2966
+ _FiniteStateMachine_state = new WeakMap();
2967
+ class BadEventError extends es2018$6.CustomError {
2968
+ constructor(state, event) {
2969
+ super(`State ${state} cannot react to event ${event}`);
2970
+ }
2971
+ }
2972
+
2973
+ /*! *****************************************************************************
2974
+ Copyright (c) Microsoft Corporation.
2975
+
2976
+ Permission to use, copy, modify, and/or distribute this software for any
2977
+ purpose with or without fee is hereby granted.
2978
+
2979
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
2980
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
2981
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
2982
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
2983
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
2984
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
2985
+ PERFORMANCE OF THIS SOFTWARE.
2986
+ ***************************************************************************** */
2987
+ /* global Reflect, Promise */
2988
+
2989
+ var extendStatics = function(d, b) {
2990
+ extendStatics = Object.setPrototypeOf ||
2991
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
2992
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
2993
+ return extendStatics(d, b);
2994
+ };
2995
+
2996
+ function __extends(d, b) {
2997
+ if (typeof b !== "function" && b !== null)
2998
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
2999
+ extendStatics(d, b);
3000
+ function __() { this.constructor = d; }
3001
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
3002
+ }
3003
+
3004
+ function __values(o) {
3005
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
3006
+ if (m) return m.call(o);
3007
+ if (o && typeof o.length === "number") return {
3008
+ next: function () {
3009
+ if (o && i >= o.length) o = void 0;
3010
+ return { value: o && o[i++], done: !o };
3011
+ }
3012
+ };
3013
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
3014
+ }
3015
+
3016
+ function __read(o, n) {
3017
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
3018
+ if (!m) return o;
3019
+ var i = m.call(o), r, ar = [], e;
3020
+ try {
3021
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
3022
+ }
3023
+ catch (error) { e = { error: error }; }
3024
+ finally {
3025
+ try {
3026
+ if (r && !r.done && (m = i["return"])) m.call(i);
3027
+ }
3028
+ finally { if (e) throw e.error; }
3029
+ }
3030
+ return ar;
3031
+ }
3032
+
3033
+ function __spreadArray(to, from) {
3034
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
3035
+ to[j] = from[i];
3036
+ return to;
3037
+ }
3038
+
3039
+ function isFunction$1(value) {
3040
+ return typeof value === 'function';
3041
+ }
3042
+
3043
+ function createErrorClass(createImpl) {
3044
+ var _super = function (instance) {
3045
+ Error.call(instance);
3046
+ instance.stack = new Error().stack;
3047
+ };
3048
+ var ctorFunc = createImpl(_super);
3049
+ ctorFunc.prototype = Object.create(Error.prototype);
3050
+ ctorFunc.prototype.constructor = ctorFunc;
3051
+ return ctorFunc;
3052
+ }
3053
+
3054
+ var UnsubscriptionError = createErrorClass(function (_super) {
3055
+ return function UnsubscriptionErrorImpl(errors) {
3056
+ _super(this);
3057
+ this.message = errors
3058
+ ? errors.length + " errors occurred during unsubscription:\n" + errors.map(function (err, i) { return i + 1 + ") " + err.toString(); }).join('\n ')
3059
+ : '';
3060
+ this.name = 'UnsubscriptionError';
3061
+ this.errors = errors;
3062
+ };
3063
+ });
3064
+
3065
+ function arrRemove(arr, item) {
3066
+ if (arr) {
3067
+ var index = arr.indexOf(item);
3068
+ 0 <= index && arr.splice(index, 1);
3069
+ }
3070
+ }
3071
+
3072
+ var Subscription = (function () {
3073
+ function Subscription(initialTeardown) {
3074
+ this.initialTeardown = initialTeardown;
3075
+ this.closed = false;
3076
+ this._parentage = null;
3077
+ this._teardowns = null;
3078
+ }
3079
+ Subscription.prototype.unsubscribe = function () {
3080
+ var e_1, _a, e_2, _b;
3081
+ var errors;
3082
+ if (!this.closed) {
3083
+ this.closed = true;
3084
+ var _parentage = this._parentage;
3085
+ if (_parentage) {
3086
+ this._parentage = null;
3087
+ if (Array.isArray(_parentage)) {
3088
+ try {
3089
+ for (var _parentage_1 = __values(_parentage), _parentage_1_1 = _parentage_1.next(); !_parentage_1_1.done; _parentage_1_1 = _parentage_1.next()) {
3090
+ var parent_1 = _parentage_1_1.value;
3091
+ parent_1.remove(this);
3092
+ }
3093
+ }
3094
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
3095
+ finally {
3096
+ try {
3097
+ if (_parentage_1_1 && !_parentage_1_1.done && (_a = _parentage_1.return)) _a.call(_parentage_1);
3098
+ }
3099
+ finally { if (e_1) throw e_1.error; }
3100
+ }
3101
+ }
3102
+ else {
3103
+ _parentage.remove(this);
3104
+ }
3105
+ }
3106
+ var initialTeardown = this.initialTeardown;
3107
+ if (isFunction$1(initialTeardown)) {
3108
+ try {
3109
+ initialTeardown();
3110
+ }
3111
+ catch (e) {
3112
+ errors = e instanceof UnsubscriptionError ? e.errors : [e];
3113
+ }
3114
+ }
3115
+ var _teardowns = this._teardowns;
3116
+ if (_teardowns) {
3117
+ this._teardowns = null;
3118
+ try {
3119
+ for (var _teardowns_1 = __values(_teardowns), _teardowns_1_1 = _teardowns_1.next(); !_teardowns_1_1.done; _teardowns_1_1 = _teardowns_1.next()) {
3120
+ var teardown_1 = _teardowns_1_1.value;
3121
+ try {
3122
+ execTeardown(teardown_1);
3123
+ }
3124
+ catch (err) {
3125
+ errors = errors !== null && errors !== void 0 ? errors : [];
3126
+ if (err instanceof UnsubscriptionError) {
3127
+ errors = __spreadArray(__spreadArray([], __read(errors)), __read(err.errors));
3128
+ }
3129
+ else {
3130
+ errors.push(err);
3131
+ }
3132
+ }
3133
+ }
3134
+ }
3135
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
3136
+ finally {
3137
+ try {
3138
+ if (_teardowns_1_1 && !_teardowns_1_1.done && (_b = _teardowns_1.return)) _b.call(_teardowns_1);
3139
+ }
3140
+ finally { if (e_2) throw e_2.error; }
3141
+ }
3142
+ }
3143
+ if (errors) {
3144
+ throw new UnsubscriptionError(errors);
3145
+ }
3146
+ }
3147
+ };
3148
+ Subscription.prototype.add = function (teardown) {
3149
+ var _a;
3150
+ if (teardown && teardown !== this) {
3151
+ if (this.closed) {
3152
+ execTeardown(teardown);
3153
+ }
3154
+ else {
3155
+ if (teardown instanceof Subscription) {
3156
+ if (teardown.closed || teardown._hasParent(this)) {
3157
+ return;
3158
+ }
3159
+ teardown._addParent(this);
3160
+ }
3161
+ (this._teardowns = (_a = this._teardowns) !== null && _a !== void 0 ? _a : []).push(teardown);
3162
+ }
3163
+ }
3164
+ };
3165
+ Subscription.prototype._hasParent = function (parent) {
3166
+ var _parentage = this._parentage;
3167
+ return _parentage === parent || (Array.isArray(_parentage) && _parentage.includes(parent));
3168
+ };
3169
+ Subscription.prototype._addParent = function (parent) {
3170
+ var _parentage = this._parentage;
3171
+ this._parentage = Array.isArray(_parentage) ? (_parentage.push(parent), _parentage) : _parentage ? [_parentage, parent] : parent;
3172
+ };
3173
+ Subscription.prototype._removeParent = function (parent) {
3174
+ var _parentage = this._parentage;
3175
+ if (_parentage === parent) {
3176
+ this._parentage = null;
3177
+ }
3178
+ else if (Array.isArray(_parentage)) {
3179
+ arrRemove(_parentage, parent);
3180
+ }
3181
+ };
3182
+ Subscription.prototype.remove = function (teardown) {
3183
+ var _teardowns = this._teardowns;
3184
+ _teardowns && arrRemove(_teardowns, teardown);
3185
+ if (teardown instanceof Subscription) {
3186
+ teardown._removeParent(this);
3187
+ }
3188
+ };
3189
+ Subscription.EMPTY = (function () {
3190
+ var empty = new Subscription();
3191
+ empty.closed = true;
3192
+ return empty;
3193
+ })();
3194
+ return Subscription;
3195
+ }());
3196
+ var EMPTY_SUBSCRIPTION = Subscription.EMPTY;
3197
+ function isSubscription(value) {
3198
+ return (value instanceof Subscription ||
3199
+ (value && 'closed' in value && isFunction$1(value.remove) && isFunction$1(value.add) && isFunction$1(value.unsubscribe)));
3200
+ }
3201
+ function execTeardown(teardown) {
3202
+ if (isFunction$1(teardown)) {
3203
+ teardown();
3204
+ }
3205
+ else {
3206
+ teardown.unsubscribe();
3207
+ }
3208
+ }
3209
+
3210
+ var config = {
3211
+ onUnhandledError: null,
3212
+ onStoppedNotification: null,
3213
+ Promise: undefined,
3214
+ useDeprecatedSynchronousErrorHandling: false,
3215
+ useDeprecatedNextContext: false,
3216
+ };
3217
+
3218
+ var timeoutProvider = {
3219
+ setTimeout: function () {
3220
+ var args = [];
3221
+ for (var _i = 0; _i < arguments.length; _i++) {
3222
+ args[_i] = arguments[_i];
3223
+ }
3224
+ var delegate = timeoutProvider.delegate;
3225
+ return ((delegate === null || delegate === void 0 ? void 0 : delegate.setTimeout) || setTimeout).apply(void 0, __spreadArray([], __read(args)));
3226
+ },
3227
+ clearTimeout: function (handle) {
3228
+ var delegate = timeoutProvider.delegate;
3229
+ return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearTimeout) || clearTimeout)(handle);
3230
+ },
3231
+ delegate: undefined,
3232
+ };
3233
+
3234
+ function reportUnhandledError(err) {
3235
+ timeoutProvider.setTimeout(function () {
3236
+ {
3237
+ throw err;
3238
+ }
3239
+ });
3240
+ }
3241
+
3242
+ function noop() { }
3243
+
3244
+ var context = null;
3245
+ function errorContext(cb) {
3246
+ if (config.useDeprecatedSynchronousErrorHandling) {
3247
+ var isRoot = !context;
3248
+ if (isRoot) {
3249
+ context = { errorThrown: false, error: null };
3250
+ }
3251
+ cb();
3252
+ if (isRoot) {
3253
+ var _a = context, errorThrown = _a.errorThrown, error = _a.error;
3254
+ context = null;
3255
+ if (errorThrown) {
3256
+ throw error;
3257
+ }
3258
+ }
3259
+ }
3260
+ else {
3261
+ cb();
3262
+ }
3263
+ }
3264
+
3265
+ var Subscriber = (function (_super) {
3266
+ __extends(Subscriber, _super);
3267
+ function Subscriber(destination) {
3268
+ var _this = _super.call(this) || this;
3269
+ _this.isStopped = false;
3270
+ if (destination) {
3271
+ _this.destination = destination;
3272
+ if (isSubscription(destination)) {
3273
+ destination.add(_this);
3274
+ }
3275
+ }
3276
+ else {
3277
+ _this.destination = EMPTY_OBSERVER;
3278
+ }
3279
+ return _this;
3280
+ }
3281
+ Subscriber.create = function (next, error, complete) {
3282
+ return new SafeSubscriber(next, error, complete);
3283
+ };
3284
+ Subscriber.prototype.next = function (value) {
3285
+ if (this.isStopped) ;
3286
+ else {
3287
+ this._next(value);
3288
+ }
3289
+ };
3290
+ Subscriber.prototype.error = function (err) {
3291
+ if (this.isStopped) ;
3292
+ else {
3293
+ this.isStopped = true;
3294
+ this._error(err);
3295
+ }
3296
+ };
3297
+ Subscriber.prototype.complete = function () {
3298
+ if (this.isStopped) ;
3299
+ else {
3300
+ this.isStopped = true;
3301
+ this._complete();
3302
+ }
3303
+ };
3304
+ Subscriber.prototype.unsubscribe = function () {
3305
+ if (!this.closed) {
3306
+ this.isStopped = true;
3307
+ _super.prototype.unsubscribe.call(this);
3308
+ this.destination = null;
3309
+ }
3310
+ };
3311
+ Subscriber.prototype._next = function (value) {
3312
+ this.destination.next(value);
3313
+ };
3314
+ Subscriber.prototype._error = function (err) {
3315
+ try {
3316
+ this.destination.error(err);
3317
+ }
3318
+ finally {
3319
+ this.unsubscribe();
3320
+ }
3321
+ };
3322
+ Subscriber.prototype._complete = function () {
3323
+ try {
3324
+ this.destination.complete();
3325
+ }
3326
+ finally {
3327
+ this.unsubscribe();
3328
+ }
3329
+ };
3330
+ return Subscriber;
3331
+ }(Subscription));
3332
+ var SafeSubscriber = (function (_super) {
3333
+ __extends(SafeSubscriber, _super);
3334
+ function SafeSubscriber(observerOrNext, error, complete) {
3335
+ var _this = _super.call(this) || this;
3336
+ var next;
3337
+ if (isFunction$1(observerOrNext)) {
3338
+ next = observerOrNext;
3339
+ }
3340
+ else if (observerOrNext) {
3341
+ (next = observerOrNext.next, error = observerOrNext.error, complete = observerOrNext.complete);
3342
+ var context_1;
3343
+ if (_this && config.useDeprecatedNextContext) {
3344
+ context_1 = Object.create(observerOrNext);
3345
+ context_1.unsubscribe = function () { return _this.unsubscribe(); };
3346
+ }
3347
+ else {
3348
+ context_1 = observerOrNext;
3349
+ }
3350
+ next = next === null || next === void 0 ? void 0 : next.bind(context_1);
3351
+ error = error === null || error === void 0 ? void 0 : error.bind(context_1);
3352
+ complete = complete === null || complete === void 0 ? void 0 : complete.bind(context_1);
3353
+ }
3354
+ _this.destination = {
3355
+ next: next ? wrapForErrorHandling(next) : noop,
3356
+ error: wrapForErrorHandling(error !== null && error !== void 0 ? error : defaultErrorHandler),
3357
+ complete: complete ? wrapForErrorHandling(complete) : noop,
3358
+ };
3359
+ return _this;
3360
+ }
3361
+ return SafeSubscriber;
3362
+ }(Subscriber));
3363
+ function wrapForErrorHandling(handler, instance) {
3364
+ return function () {
3365
+ var args = [];
3366
+ for (var _i = 0; _i < arguments.length; _i++) {
3367
+ args[_i] = arguments[_i];
3368
+ }
3369
+ try {
3370
+ handler.apply(void 0, __spreadArray([], __read(args)));
3371
+ }
3372
+ catch (err) {
3373
+ {
3374
+ reportUnhandledError(err);
3375
+ }
3376
+ }
3377
+ };
3378
+ }
3379
+ function defaultErrorHandler(err) {
3380
+ throw err;
3381
+ }
3382
+ var EMPTY_OBSERVER = {
3383
+ closed: true,
3384
+ next: noop,
3385
+ error: defaultErrorHandler,
3386
+ complete: noop,
3387
+ };
3388
+
3389
+ var observable = (function () { return (typeof Symbol === 'function' && Symbol.observable) || '@@observable'; })();
3390
+
3391
+ function identity(x) {
3392
+ return x;
3393
+ }
3394
+
3395
+ function pipeFromArray(fns) {
3396
+ if (fns.length === 0) {
3397
+ return identity;
3398
+ }
3399
+ if (fns.length === 1) {
3400
+ return fns[0];
3401
+ }
3402
+ return function piped(input) {
3403
+ return fns.reduce(function (prev, fn) { return fn(prev); }, input);
3404
+ };
3405
+ }
3406
+
3407
+ var Observable = (function () {
3408
+ function Observable(subscribe) {
3409
+ if (subscribe) {
3410
+ this._subscribe = subscribe;
3411
+ }
3412
+ }
3413
+ Observable.prototype.lift = function (operator) {
3414
+ var observable = new Observable();
3415
+ observable.source = this;
3416
+ observable.operator = operator;
3417
+ return observable;
3418
+ };
3419
+ Observable.prototype.subscribe = function (observerOrNext, error, complete) {
3420
+ var _this = this;
3421
+ var subscriber = isSubscriber(observerOrNext) ? observerOrNext : new SafeSubscriber(observerOrNext, error, complete);
3422
+ errorContext(function () {
3423
+ var _a = _this, operator = _a.operator, source = _a.source;
3424
+ subscriber.add(operator
3425
+ ?
3426
+ operator.call(subscriber, source)
3427
+ : source
3428
+ ?
3429
+ _this._subscribe(subscriber)
3430
+ :
3431
+ _this._trySubscribe(subscriber));
3432
+ });
3433
+ return subscriber;
3434
+ };
3435
+ Observable.prototype._trySubscribe = function (sink) {
3436
+ try {
3437
+ return this._subscribe(sink);
3438
+ }
3439
+ catch (err) {
3440
+ sink.error(err);
3441
+ }
3442
+ };
3443
+ Observable.prototype.forEach = function (next, promiseCtor) {
3444
+ var _this = this;
3445
+ promiseCtor = getPromiseCtor(promiseCtor);
3446
+ return new promiseCtor(function (resolve, reject) {
3447
+ var subscription;
3448
+ subscription = _this.subscribe(function (value) {
3449
+ try {
3450
+ next(value);
3451
+ }
3452
+ catch (err) {
3453
+ reject(err);
3454
+ subscription === null || subscription === void 0 ? void 0 : subscription.unsubscribe();
3455
+ }
3456
+ }, reject, resolve);
3457
+ });
3458
+ };
3459
+ Observable.prototype._subscribe = function (subscriber) {
3460
+ var _a;
3461
+ return (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber);
3462
+ };
3463
+ Observable.prototype[observable] = function () {
3464
+ return this;
3465
+ };
3466
+ Observable.prototype.pipe = function () {
3467
+ var operations = [];
3468
+ for (var _i = 0; _i < arguments.length; _i++) {
3469
+ operations[_i] = arguments[_i];
3470
+ }
3471
+ return pipeFromArray(operations)(this);
3472
+ };
3473
+ Observable.prototype.toPromise = function (promiseCtor) {
3474
+ var _this = this;
3475
+ promiseCtor = getPromiseCtor(promiseCtor);
3476
+ return new promiseCtor(function (resolve, reject) {
3477
+ var value;
3478
+ _this.subscribe(function (x) { return (value = x); }, function (err) { return reject(err); }, function () { return resolve(value); });
3479
+ });
3480
+ };
3481
+ Observable.create = function (subscribe) {
3482
+ return new Observable(subscribe);
3483
+ };
3484
+ return Observable;
3485
+ }());
3486
+ function getPromiseCtor(promiseCtor) {
3487
+ var _a;
3488
+ return (_a = promiseCtor !== null && promiseCtor !== void 0 ? promiseCtor : config.Promise) !== null && _a !== void 0 ? _a : Promise;
3489
+ }
3490
+ function isObserver(value) {
3491
+ return value && isFunction$1(value.next) && isFunction$1(value.error) && isFunction$1(value.complete);
3492
+ }
3493
+ function isSubscriber(value) {
3494
+ return (value && value instanceof Subscriber) || (isObserver(value) && isSubscription(value));
3495
+ }
3496
+
3497
+ var ObjectUnsubscribedError = createErrorClass(function (_super) {
3498
+ return function ObjectUnsubscribedErrorImpl() {
3499
+ _super(this);
3500
+ this.name = 'ObjectUnsubscribedError';
3501
+ this.message = 'object unsubscribed';
3502
+ };
3503
+ });
3504
+
3505
+ var Subject = (function (_super) {
3506
+ __extends(Subject, _super);
3507
+ function Subject() {
3508
+ var _this = _super.call(this) || this;
3509
+ _this.closed = false;
3510
+ _this.observers = [];
3511
+ _this.isStopped = false;
3512
+ _this.hasError = false;
3513
+ _this.thrownError = null;
3514
+ return _this;
3515
+ }
3516
+ Subject.prototype.lift = function (operator) {
3517
+ var subject = new AnonymousSubject(this, this);
3518
+ subject.operator = operator;
3519
+ return subject;
3520
+ };
3521
+ Subject.prototype._throwIfClosed = function () {
3522
+ if (this.closed) {
3523
+ throw new ObjectUnsubscribedError();
3524
+ }
3525
+ };
3526
+ Subject.prototype.next = function (value) {
3527
+ var _this = this;
3528
+ errorContext(function () {
3529
+ var e_1, _a;
3530
+ _this._throwIfClosed();
3531
+ if (!_this.isStopped) {
3532
+ var copy = _this.observers.slice();
3533
+ try {
3534
+ for (var copy_1 = __values(copy), copy_1_1 = copy_1.next(); !copy_1_1.done; copy_1_1 = copy_1.next()) {
3535
+ var observer = copy_1_1.value;
3536
+ observer.next(value);
3537
+ }
3538
+ }
3539
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
3540
+ finally {
3541
+ try {
3542
+ if (copy_1_1 && !copy_1_1.done && (_a = copy_1.return)) _a.call(copy_1);
3543
+ }
3544
+ finally { if (e_1) throw e_1.error; }
3545
+ }
3546
+ }
3547
+ });
3548
+ };
3549
+ Subject.prototype.error = function (err) {
3550
+ var _this = this;
3551
+ errorContext(function () {
3552
+ _this._throwIfClosed();
3553
+ if (!_this.isStopped) {
3554
+ _this.hasError = _this.isStopped = true;
3555
+ _this.thrownError = err;
3556
+ var observers = _this.observers;
3557
+ while (observers.length) {
3558
+ observers.shift().error(err);
3559
+ }
3560
+ }
3561
+ });
3562
+ };
3563
+ Subject.prototype.complete = function () {
3564
+ var _this = this;
3565
+ errorContext(function () {
3566
+ _this._throwIfClosed();
3567
+ if (!_this.isStopped) {
3568
+ _this.isStopped = true;
3569
+ var observers = _this.observers;
3570
+ while (observers.length) {
3571
+ observers.shift().complete();
3572
+ }
3573
+ }
3574
+ });
3575
+ };
3576
+ Subject.prototype.unsubscribe = function () {
3577
+ this.isStopped = this.closed = true;
3578
+ this.observers = null;
3579
+ };
3580
+ Object.defineProperty(Subject.prototype, "observed", {
3581
+ get: function () {
3582
+ var _a;
3583
+ return ((_a = this.observers) === null || _a === void 0 ? void 0 : _a.length) > 0;
3584
+ },
3585
+ enumerable: false,
3586
+ configurable: true
3587
+ });
3588
+ Subject.prototype._trySubscribe = function (subscriber) {
3589
+ this._throwIfClosed();
3590
+ return _super.prototype._trySubscribe.call(this, subscriber);
3591
+ };
3592
+ Subject.prototype._subscribe = function (subscriber) {
3593
+ this._throwIfClosed();
3594
+ this._checkFinalizedStatuses(subscriber);
3595
+ return this._innerSubscribe(subscriber);
3596
+ };
3597
+ Subject.prototype._innerSubscribe = function (subscriber) {
3598
+ var _a = this, hasError = _a.hasError, isStopped = _a.isStopped, observers = _a.observers;
3599
+ return hasError || isStopped
3600
+ ? EMPTY_SUBSCRIPTION
3601
+ : (observers.push(subscriber), new Subscription(function () { return arrRemove(observers, subscriber); }));
3602
+ };
3603
+ Subject.prototype._checkFinalizedStatuses = function (subscriber) {
3604
+ var _a = this, hasError = _a.hasError, thrownError = _a.thrownError, isStopped = _a.isStopped;
3605
+ if (hasError) {
3606
+ subscriber.error(thrownError);
3607
+ }
3608
+ else if (isStopped) {
3609
+ subscriber.complete();
3610
+ }
3611
+ };
3612
+ Subject.prototype.asObservable = function () {
3613
+ var observable = new Observable();
3614
+ observable.source = this;
3615
+ return observable;
3616
+ };
3617
+ Subject.create = function (destination, source) {
3618
+ return new AnonymousSubject(destination, source);
3619
+ };
3620
+ return Subject;
3621
+ }(Observable));
3622
+ var AnonymousSubject = (function (_super) {
3623
+ __extends(AnonymousSubject, _super);
3624
+ function AnonymousSubject(destination, source) {
3625
+ var _this = _super.call(this) || this;
3626
+ _this.destination = destination;
3627
+ _this.source = source;
3628
+ return _this;
3629
+ }
3630
+ AnonymousSubject.prototype.next = function (value) {
3631
+ var _a, _b;
3632
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.next) === null || _b === void 0 ? void 0 : _b.call(_a, value);
3633
+ };
3634
+ AnonymousSubject.prototype.error = function (err) {
3635
+ var _a, _b;
3636
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.error) === null || _b === void 0 ? void 0 : _b.call(_a, err);
3637
+ };
3638
+ AnonymousSubject.prototype.complete = function () {
3639
+ var _a, _b;
3640
+ (_b = (_a = this.destination) === null || _a === void 0 ? void 0 : _a.complete) === null || _b === void 0 ? void 0 : _b.call(_a);
3641
+ };
3642
+ AnonymousSubject.prototype._subscribe = function (subscriber) {
3643
+ var _a, _b;
3644
+ return (_b = (_a = this.source) === null || _a === void 0 ? void 0 : _a.subscribe(subscriber)) !== null && _b !== void 0 ? _b : EMPTY_SUBSCRIPTION;
3645
+ };
3646
+ return AnonymousSubject;
3647
+ }(Subject));
3648
+
3649
+ var es2018 = {};
3650
+
3651
+ var array = {};
3652
+
3653
+ array.isntEmptyArray = array.isEmptyArray = array.isntArray = array.isArray = void 0;
3654
+ function isArray(val) {
3655
+ return Array.isArray(val);
3656
+ }
3657
+ array.isArray = isArray;
3658
+ function isntArray(val) {
3659
+ return !isArray(val);
3660
+ }
3661
+ array.isntArray = isntArray;
3662
+ function isEmptyArray(val) {
3663
+ return val.length === 0;
3664
+ }
3665
+ array.isEmptyArray = isEmptyArray;
3666
+ function isntEmptyArray(val) {
3667
+ return val.length !== 0;
3668
+ }
3669
+ array.isntEmptyArray = isntEmptyArray;
3670
+
3671
+ var asyncIterable = {};
3672
+
3673
+ var _null = {};
3674
+
3675
+ _null.isntNull = _null.isNull = void 0;
3676
+ function isNull(val) {
3677
+ return val === null;
3678
+ }
3679
+ _null.isNull = isNull;
3680
+ function isntNull(val) {
3681
+ return !isNull(val);
3682
+ }
3683
+ _null.isntNull = isntNull;
3684
+
3685
+ var _undefined = {};
3686
+
3687
+ _undefined.isntUndefined = _undefined.isUndefined = void 0;
3688
+ function isUndefined(val) {
3689
+ return val === undefined;
3690
+ }
3691
+ _undefined.isUndefined = isUndefined;
3692
+ function isntUndefined(val) {
3693
+ return !isUndefined(val);
3694
+ }
3695
+ _undefined.isntUndefined = isntUndefined;
3696
+
3697
+ asyncIterable.isntAsyncIterable = asyncIterable.isAsyncIterable = void 0;
3698
+ const null_1$1 = _null;
3699
+ const undefined_1$2 = _undefined;
3700
+ function isAsyncIterable(val) {
3701
+ return (0, null_1$1.isntNull)(val)
3702
+ && (0, undefined_1$2.isntUndefined)(val)
3703
+ && typeof val[Symbol.asyncIterator] === 'function';
3704
+ }
3705
+ asyncIterable.isAsyncIterable = isAsyncIterable;
3706
+ function isntAsyncIterable(val) {
3707
+ return !isAsyncIterable(val);
3708
+ }
3709
+ asyncIterable.isntAsyncIterable = isntAsyncIterable;
3710
+
3711
+ var bigint = {};
3712
+
3713
+ bigint.isntBigInt = bigint.isBigInt = void 0;
3714
+ function isBigInt(val) {
3715
+ return typeof val === 'bigint';
3716
+ }
3717
+ bigint.isBigInt = isBigInt;
3718
+ function isntBigInt(val) {
3719
+ return !isBigInt(val);
3720
+ }
3721
+ bigint.isntBigInt = isntBigInt;
3722
+
3723
+ var boolean = {};
3724
+
3725
+ boolean.isntBoolean = boolean.isBoolean = void 0;
3726
+ function isBoolean(val) {
3727
+ return typeof val === 'boolean';
3728
+ }
3729
+ boolean.isBoolean = isBoolean;
3730
+ function isntBoolean(val) {
3731
+ return !isBoolean(val);
3732
+ }
3733
+ boolean.isntBoolean = isntBoolean;
3734
+
3735
+ var char = {};
3736
+
3737
+ var string = {};
3738
+
3739
+ string.isntString = string.isString = void 0;
3740
+ function isString(val) {
3741
+ return typeof val === 'string';
3742
+ }
3743
+ string.isString = isString;
3744
+ function isntString(val) {
3745
+ return !isString(val);
3746
+ }
3747
+ string.isntString = isntString;
3748
+
3749
+ char.isntChar = char.isChar = void 0;
3750
+ const string_1$1 = string;
3751
+ function isChar(val) {
3752
+ return (0, string_1$1.isString)(val)
3753
+ && val.length === 1;
3754
+ }
3755
+ char.isChar = isChar;
3756
+ function isntChar(val) {
3757
+ return !isChar(val);
3758
+ }
3759
+ char.isntChar = isntChar;
3760
+
3761
+ var date = {};
3762
+
3763
+ date.isntDate = date.isDate = void 0;
3764
+ function isDate(val) {
3765
+ return val instanceof Date;
3766
+ }
3767
+ date.isDate = isDate;
3768
+ function isntDate(val) {
3769
+ return !isDate(val);
3770
+ }
3771
+ date.isntDate = isntDate;
3772
+
3773
+ var _enum = {};
3774
+
3775
+ _enum.inEnum = void 0;
3776
+ function inEnum(val, _enum) {
3777
+ return Object.values(_enum).includes(val);
3778
+ }
3779
+ _enum.inEnum = inEnum;
3780
+
3781
+ var error = {};
3782
+
3783
+ error.isntError = error.isError = void 0;
3784
+ function isError(val) {
3785
+ return val instanceof Error;
3786
+ }
3787
+ error.isError = isError;
3788
+ function isntError(val) {
3789
+ return !isError(val);
3790
+ }
3791
+ error.isntError = isntError;
3792
+
3793
+ var falsy = {};
3794
+
3795
+ falsy.isntFalsy = falsy.isFalsy = void 0;
3796
+ function isFalsy(val) {
3797
+ return !val;
3798
+ }
3799
+ falsy.isFalsy = isFalsy;
3800
+ function isntFalsy(val) {
3801
+ return !isFalsy(val);
3802
+ }
3803
+ falsy.isntFalsy = isntFalsy;
3804
+
3805
+ var _function = {};
3806
+
3807
+ _function.isntFunction = _function.isFunction = void 0;
3808
+ function isFunction(val) {
3809
+ return typeof val === 'function';
3810
+ }
3811
+ _function.isFunction = isFunction;
3812
+ function isntFunction(val) {
3813
+ return !isFunction(val);
3814
+ }
3815
+ _function.isntFunction = isntFunction;
3816
+
3817
+ var iterable = {};
3818
+
3819
+ iterable.isntIterable = iterable.isIterable = void 0;
3820
+ const null_1 = _null;
3821
+ const undefined_1$1 = _undefined;
3822
+ function isIterable(val) {
3823
+ return (0, null_1.isntNull)(val)
3824
+ && (0, undefined_1$1.isntUndefined)(val)
3825
+ && typeof val[Symbol.iterator] === 'function';
3826
+ }
3827
+ iterable.isIterable = isIterable;
3828
+ function isntIterable(val) {
3829
+ return !isIterable(val);
3830
+ }
3831
+ iterable.isntIterable = isntIterable;
3832
+
3833
+ var jsonRpc = {};
3834
+
3835
+ var object = {};
3836
+
3837
+ object.isntEmptyObject = object.isEmptyObject = object.isRecord = object.isntObject = object.isObject = void 0;
3838
+ function isObject(val) {
3839
+ return val !== null && typeof val === 'object';
3840
+ }
3841
+ object.isObject = isObject;
3842
+ function isntObject(val) {
3843
+ return !isObject(val);
3844
+ }
3845
+ object.isntObject = isntObject;
3846
+ function isRecord(val) {
3847
+ return isObject(val);
3848
+ }
3849
+ object.isRecord = isRecord;
3850
+ function isEmptyObject(val) {
3851
+ return Object.keys(val).length === 0;
3852
+ }
3853
+ object.isEmptyObject = isEmptyObject;
3854
+ function isntEmptyObject(val) {
3855
+ return Object.keys(val).length !== 0;
3856
+ }
3857
+ object.isntEmptyObject = isntEmptyObject;
3858
+
3859
+ var number = {};
3860
+
3861
+ number.isntNumber = number.isNumber = void 0;
3862
+ function isNumber(val) {
3863
+ return typeof val === 'number';
3864
+ }
3865
+ number.isNumber = isNumber;
3866
+ function isntNumber(val) {
3867
+ return !isNumber(val);
3868
+ }
3869
+ number.isntNumber = isntNumber;
3870
+
3871
+ jsonRpc.isntJsonRpcError = jsonRpc.isJsonRpcError = jsonRpc.isntJsonRpcSuccess = jsonRpc.isJsonRpcSuccess = jsonRpc.isntJsonRpcRequest = jsonRpc.isJsonRpcRequest = jsonRpc.isntJsonRpcNotification = jsonRpc.isJsonRpcNotification = void 0;
3872
+ const array_1 = array;
3873
+ const object_1 = object;
3874
+ const string_1 = string;
3875
+ const number_1 = number;
3876
+ const undefined_1 = _undefined;
3877
+ function isJsonRpcId(val) {
3878
+ return (0, string_1.isString)(val) || (0, number_1.isNumber)(val);
3879
+ }
3880
+ function isJsonRpcParams(val) {
3881
+ return (0, array_1.isArray)(val) || (0, object_1.isObject)(val);
3882
+ }
3883
+ function isJsonRpcNotification(val) {
3884
+ return (0, object_1.isRecord)(val)
3885
+ && (0, string_1.isString)(val.jsonrpc)
3886
+ && (0, string_1.isString)(val.method)
3887
+ && (0, undefined_1.isUndefined)(val.id)
3888
+ && isJsonRpcParams(val.params);
3889
+ }
3890
+ jsonRpc.isJsonRpcNotification = isJsonRpcNotification;
3891
+ function isntJsonRpcNotification(val) {
3892
+ return !isJsonRpcNotification(val);
3893
+ }
3894
+ jsonRpc.isntJsonRpcNotification = isntJsonRpcNotification;
3895
+ function isJsonRpcRequest(val) {
3896
+ return (0, object_1.isRecord)(val)
3897
+ && (0, string_1.isString)(val.jsonrpc)
3898
+ && (0, string_1.isString)(val.method)
3899
+ && isJsonRpcId(val.id)
3900
+ && isJsonRpcParams(val.params);
3901
+ }
3902
+ jsonRpc.isJsonRpcRequest = isJsonRpcRequest;
3903
+ function isntJsonRpcRequest(val) {
3904
+ return !isJsonRpcRequest(val);
3905
+ }
3906
+ jsonRpc.isntJsonRpcRequest = isntJsonRpcRequest;
3907
+ function isJsonRpcSuccess(val) {
3908
+ return (0, object_1.isRecord)(val)
3909
+ && (0, string_1.isString)(val.jsonrpc)
3910
+ && (0, string_1.isString)(val.id)
3911
+ && 'result' in val;
3912
+ }
3913
+ jsonRpc.isJsonRpcSuccess = isJsonRpcSuccess;
3914
+ function isntJsonRpcSuccess(val) {
3915
+ return !isJsonRpcSuccess(val);
3916
+ }
3917
+ jsonRpc.isntJsonRpcSuccess = isntJsonRpcSuccess;
3918
+ function isJsonRpcError(val) {
3919
+ return (0, object_1.isRecord)(val)
3920
+ && (0, string_1.isString)(val.jsonrpc)
3921
+ && isJsonRpcId(val.id)
3922
+ && isJsonRpcErrorObject(val.error);
3923
+ }
3924
+ jsonRpc.isJsonRpcError = isJsonRpcError;
3925
+ function isntJsonRpcError(val) {
3926
+ return !isJsonRpcError(val);
3927
+ }
3928
+ jsonRpc.isntJsonRpcError = isntJsonRpcError;
3929
+ function isJsonRpcErrorObject(val) {
3930
+ return (0, object_1.isRecord)(val)
3931
+ && (0, number_1.isNumber)(val.code)
3932
+ && (0, string_1.isString)(val.message)
3933
+ && ((0, undefined_1.isUndefined)(val.data) || (0, object_1.isObject)(val.data));
3934
+ }
3935
+
3936
+ var json = {};
3937
+
3938
+ json.isntJson = json.isJson = void 0;
3939
+ function isJson(val) {
3940
+ try {
3941
+ JSON.stringify(val);
3942
+ return true;
3943
+ }
3944
+ catch (_a) {
3945
+ return false;
3946
+ }
3947
+ }
3948
+ json.isJson = isJson;
3949
+ function isntJson(val) {
3950
+ return !isntJson();
3951
+ }
3952
+ json.isntJson = isntJson;
3953
+
3954
+ var url = {};
3955
+
3956
+ url.isAbsoluteURL = void 0;
3957
+ function isAbsoluteURL(str) {
3958
+ try {
3959
+ new URL(str);
3960
+ return true;
3961
+ }
3962
+ catch (_a) {
3963
+ return false;
3964
+ }
3965
+ }
3966
+ url.isAbsoluteURL = isAbsoluteURL;
3967
+
3968
+ (function (exports) {
3969
+ var __createBinding = (commonjsGlobal && commonjsGlobal.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3970
+ if (k2 === undefined) k2 = k;
3971
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
3972
+ }) : (function(o, m, k, k2) {
3973
+ if (k2 === undefined) k2 = k;
3974
+ o[k2] = m[k];
3975
+ }));
3976
+ var __exportStar = (commonjsGlobal && commonjsGlobal.__exportStar) || function(m, exports) {
3977
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
3978
+ };__exportStar(array, exports);
3979
+ __exportStar(asyncIterable, exports);
3980
+ __exportStar(bigint, exports);
3981
+ __exportStar(boolean, exports);
3982
+ __exportStar(char, exports);
3983
+ __exportStar(date, exports);
3984
+ __exportStar(_enum, exports);
3985
+ __exportStar(error, exports);
3986
+ __exportStar(falsy, exports);
3987
+ __exportStar(_function, exports);
3988
+ __exportStar(iterable, exports);
3989
+ __exportStar(jsonRpc, exports);
3990
+ __exportStar(json, exports);
3991
+ __exportStar(_null, exports);
3992
+ __exportStar(number, exports);
3993
+ __exportStar(object, exports);
3994
+ __exportStar(string, exports);
3995
+ __exportStar(_undefined, exports);
3996
+ __exportStar(url, exports);
3997
+
3998
+ }(es2018));
3999
+
4000
+ class ObservableFiniteStateMachine extends FiniteStateMachine {
4001
+ constructor() {
4002
+ super(...arguments);
4003
+ this.stateChanges = new Subject();
4004
+ }
4005
+ observeStateChanges() {
4006
+ return this.stateChanges;
4007
+ }
4008
+ /**
4009
+ * @throws {BadEventError}
4010
+ */
4011
+ send(event) {
4012
+ const oldState = this.state;
4013
+ super.send(event);
4014
+ const newState = this.state;
4015
+ this.stateChanges.next({ event, oldState, newState });
4016
+ if (es2018.isEmptyObject(this.schema[newState])) {
4017
+ this.stateChanges.complete();
4018
+ }
4019
+ }
4020
+ }
4021
+
4022
+ export { BadEventError, Box, Emitter, ExpirableMap, FiniteStateMachine, HashMap, HashSet, LRUMap, ObservableFiniteStateMachine, Queue, TLRUMap, TrieMap, convertArrayToCons, convertConsToArray };
2863
4023
  //# sourceMappingURL=index.mjs.map