@canton-network/core-token-standard 1.10.0 → 1.11.0

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.
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  var createClient = require('openapi-fetch');
4
4
  var jsonTypeValidation = require('@mojotech/json-type-validation');
5
- var types = require('@daml/types');
5
+ var lodash = require('lodash');
6
6
 
7
7
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
8
8
 
@@ -26,7 +26,7 @@ function _interopNamespace(e) {
26
26
 
27
27
  var createClient__default = /*#__PURE__*/_interopDefault(createClient);
28
28
  var jsonTypeValidation__namespace = /*#__PURE__*/_interopNamespace(jsonTypeValidation);
29
- var types__namespace = /*#__PURE__*/_interopNamespace(types);
29
+ var lodash__namespace = /*#__PURE__*/_interopNamespace(lodash);
30
30
 
31
31
  // Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
32
32
  // SPDX-License-Identifier: Apache-2.0
@@ -95,6 +95,8 @@ const MERGE_DELEGATION_PROPOSAL_TEMPLATE_ID = '#splice-util-token-standard-walle
95
95
  const MERGE_DELEGATION_TEMPLATE_ID = '#splice-util-token-standard-wallet:Splice.Util.Token.Wallet.MergeDelegation:MergeDelegation';
96
96
  const MERGE_DELEGATION_BATCH_MERGE_UTILITY = '#splice-util-token-standard-wallet:Splice.Util.Token.Wallet.MergeDelegation:BatchMergeUtility';
97
97
 
98
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
99
+
98
100
  function getAugmentedNamespace(n) {
99
101
  if (Object.prototype.hasOwnProperty.call(n, '__esModule')) return n;
100
102
  var f = n.default;
@@ -136,9 +138,3112 @@ var AllocationInstructionV1$1 = {};
136
138
 
137
139
  var module$8 = {};
138
140
 
139
- var require$$0 = /*@__PURE__*/getAugmentedNamespace(jsonTypeValidation__namespace);
141
+ var require$$0$1 = /*@__PURE__*/getAugmentedNamespace(jsonTypeValidation__namespace);
142
+
143
+ var types = {};
144
+
145
+ var lodash_isequal = {exports: {}};
146
+
147
+ /**
148
+ * Lodash (Custom Build) <https://lodash.com/>
149
+ * Build: `lodash modularize exports="npm" -o ./`
150
+ * Copyright JS Foundation and other contributors <https://js.foundation/>
151
+ * Released under MIT license <https://lodash.com/license>
152
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
153
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
154
+ */
155
+ lodash_isequal.exports;
156
+
157
+ var hasRequiredLodash_isequal;
158
+
159
+ function requireLodash_isequal () {
160
+ if (hasRequiredLodash_isequal) return lodash_isequal.exports;
161
+ hasRequiredLodash_isequal = 1;
162
+ (function (module, exports) {
163
+ /** Used as the size to enable large array optimizations. */
164
+ var LARGE_ARRAY_SIZE = 200;
165
+
166
+ /** Used to stand-in for `undefined` hash values. */
167
+ var HASH_UNDEFINED = '__lodash_hash_undefined__';
168
+
169
+ /** Used to compose bitmasks for value comparisons. */
170
+ var COMPARE_PARTIAL_FLAG = 1,
171
+ COMPARE_UNORDERED_FLAG = 2;
172
+
173
+ /** Used as references for various `Number` constants. */
174
+ var MAX_SAFE_INTEGER = 9007199254740991;
175
+
176
+ /** `Object#toString` result references. */
177
+ var argsTag = '[object Arguments]',
178
+ arrayTag = '[object Array]',
179
+ asyncTag = '[object AsyncFunction]',
180
+ boolTag = '[object Boolean]',
181
+ dateTag = '[object Date]',
182
+ errorTag = '[object Error]',
183
+ funcTag = '[object Function]',
184
+ genTag = '[object GeneratorFunction]',
185
+ mapTag = '[object Map]',
186
+ numberTag = '[object Number]',
187
+ nullTag = '[object Null]',
188
+ objectTag = '[object Object]',
189
+ promiseTag = '[object Promise]',
190
+ proxyTag = '[object Proxy]',
191
+ regexpTag = '[object RegExp]',
192
+ setTag = '[object Set]',
193
+ stringTag = '[object String]',
194
+ symbolTag = '[object Symbol]',
195
+ undefinedTag = '[object Undefined]',
196
+ weakMapTag = '[object WeakMap]';
197
+
198
+ var arrayBufferTag = '[object ArrayBuffer]',
199
+ dataViewTag = '[object DataView]',
200
+ float32Tag = '[object Float32Array]',
201
+ float64Tag = '[object Float64Array]',
202
+ int8Tag = '[object Int8Array]',
203
+ int16Tag = '[object Int16Array]',
204
+ int32Tag = '[object Int32Array]',
205
+ uint8Tag = '[object Uint8Array]',
206
+ uint8ClampedTag = '[object Uint8ClampedArray]',
207
+ uint16Tag = '[object Uint16Array]',
208
+ uint32Tag = '[object Uint32Array]';
209
+
210
+ /**
211
+ * Used to match `RegExp`
212
+ * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
213
+ */
214
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
215
+
216
+ /** Used to detect host constructors (Safari). */
217
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
218
+
219
+ /** Used to detect unsigned integer values. */
220
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
221
+
222
+ /** Used to identify `toStringTag` values of typed arrays. */
223
+ var typedArrayTags = {};
224
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
225
+ typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
226
+ typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
227
+ typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
228
+ typedArrayTags[uint32Tag] = true;
229
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] =
230
+ typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
231
+ typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =
232
+ typedArrayTags[errorTag] = typedArrayTags[funcTag] =
233
+ typedArrayTags[mapTag] = typedArrayTags[numberTag] =
234
+ typedArrayTags[objectTag] = typedArrayTags[regexpTag] =
235
+ typedArrayTags[setTag] = typedArrayTags[stringTag] =
236
+ typedArrayTags[weakMapTag] = false;
237
+
238
+ /** Detect free variable `global` from Node.js. */
239
+ var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
240
+
241
+ /** Detect free variable `self`. */
242
+ var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
243
+
244
+ /** Used as a reference to the global object. */
245
+ var root = freeGlobal || freeSelf || Function('return this')();
246
+
247
+ /** Detect free variable `exports`. */
248
+ var freeExports = exports && !exports.nodeType && exports;
249
+
250
+ /** Detect free variable `module`. */
251
+ var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
252
+
253
+ /** Detect the popular CommonJS extension `module.exports`. */
254
+ var moduleExports = freeModule && freeModule.exports === freeExports;
255
+
256
+ /** Detect free variable `process` from Node.js. */
257
+ var freeProcess = moduleExports && freeGlobal.process;
258
+
259
+ /** Used to access faster Node.js helpers. */
260
+ var nodeUtil = (function() {
261
+ try {
262
+ return freeProcess && freeProcess.binding && freeProcess.binding('util');
263
+ } catch (e) {}
264
+ }());
265
+
266
+ /* Node.js helper references. */
267
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
268
+
269
+ /**
270
+ * A specialized version of `_.filter` for arrays without support for
271
+ * iteratee shorthands.
272
+ *
273
+ * @private
274
+ * @param {Array} [array] The array to iterate over.
275
+ * @param {Function} predicate The function invoked per iteration.
276
+ * @returns {Array} Returns the new filtered array.
277
+ */
278
+ function arrayFilter(array, predicate) {
279
+ var index = -1,
280
+ length = array == null ? 0 : array.length,
281
+ resIndex = 0,
282
+ result = [];
283
+
284
+ while (++index < length) {
285
+ var value = array[index];
286
+ if (predicate(value, index, array)) {
287
+ result[resIndex++] = value;
288
+ }
289
+ }
290
+ return result;
291
+ }
292
+
293
+ /**
294
+ * Appends the elements of `values` to `array`.
295
+ *
296
+ * @private
297
+ * @param {Array} array The array to modify.
298
+ * @param {Array} values The values to append.
299
+ * @returns {Array} Returns `array`.
300
+ */
301
+ function arrayPush(array, values) {
302
+ var index = -1,
303
+ length = values.length,
304
+ offset = array.length;
305
+
306
+ while (++index < length) {
307
+ array[offset + index] = values[index];
308
+ }
309
+ return array;
310
+ }
311
+
312
+ /**
313
+ * A specialized version of `_.some` for arrays without support for iteratee
314
+ * shorthands.
315
+ *
316
+ * @private
317
+ * @param {Array} [array] The array to iterate over.
318
+ * @param {Function} predicate The function invoked per iteration.
319
+ * @returns {boolean} Returns `true` if any element passes the predicate check,
320
+ * else `false`.
321
+ */
322
+ function arraySome(array, predicate) {
323
+ var index = -1,
324
+ length = array == null ? 0 : array.length;
325
+
326
+ while (++index < length) {
327
+ if (predicate(array[index], index, array)) {
328
+ return true;
329
+ }
330
+ }
331
+ return false;
332
+ }
333
+
334
+ /**
335
+ * The base implementation of `_.times` without support for iteratee shorthands
336
+ * or max array length checks.
337
+ *
338
+ * @private
339
+ * @param {number} n The number of times to invoke `iteratee`.
340
+ * @param {Function} iteratee The function invoked per iteration.
341
+ * @returns {Array} Returns the array of results.
342
+ */
343
+ function baseTimes(n, iteratee) {
344
+ var index = -1,
345
+ result = Array(n);
346
+
347
+ while (++index < n) {
348
+ result[index] = iteratee(index);
349
+ }
350
+ return result;
351
+ }
352
+
353
+ /**
354
+ * The base implementation of `_.unary` without support for storing metadata.
355
+ *
356
+ * @private
357
+ * @param {Function} func The function to cap arguments for.
358
+ * @returns {Function} Returns the new capped function.
359
+ */
360
+ function baseUnary(func) {
361
+ return function(value) {
362
+ return func(value);
363
+ };
364
+ }
365
+
366
+ /**
367
+ * Checks if a `cache` value for `key` exists.
368
+ *
369
+ * @private
370
+ * @param {Object} cache The cache to query.
371
+ * @param {string} key The key of the entry to check.
372
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
373
+ */
374
+ function cacheHas(cache, key) {
375
+ return cache.has(key);
376
+ }
377
+
378
+ /**
379
+ * Gets the value at `key` of `object`.
380
+ *
381
+ * @private
382
+ * @param {Object} [object] The object to query.
383
+ * @param {string} key The key of the property to get.
384
+ * @returns {*} Returns the property value.
385
+ */
386
+ function getValue(object, key) {
387
+ return object == null ? undefined : object[key];
388
+ }
389
+
390
+ /**
391
+ * Converts `map` to its key-value pairs.
392
+ *
393
+ * @private
394
+ * @param {Object} map The map to convert.
395
+ * @returns {Array} Returns the key-value pairs.
396
+ */
397
+ function mapToArray(map) {
398
+ var index = -1,
399
+ result = Array(map.size);
400
+
401
+ map.forEach(function(value, key) {
402
+ result[++index] = [key, value];
403
+ });
404
+ return result;
405
+ }
406
+
407
+ /**
408
+ * Creates a unary function that invokes `func` with its argument transformed.
409
+ *
410
+ * @private
411
+ * @param {Function} func The function to wrap.
412
+ * @param {Function} transform The argument transform.
413
+ * @returns {Function} Returns the new function.
414
+ */
415
+ function overArg(func, transform) {
416
+ return function(arg) {
417
+ return func(transform(arg));
418
+ };
419
+ }
420
+
421
+ /**
422
+ * Converts `set` to an array of its values.
423
+ *
424
+ * @private
425
+ * @param {Object} set The set to convert.
426
+ * @returns {Array} Returns the values.
427
+ */
428
+ function setToArray(set) {
429
+ var index = -1,
430
+ result = Array(set.size);
431
+
432
+ set.forEach(function(value) {
433
+ result[++index] = value;
434
+ });
435
+ return result;
436
+ }
437
+
438
+ /** Used for built-in method references. */
439
+ var arrayProto = Array.prototype,
440
+ funcProto = Function.prototype,
441
+ objectProto = Object.prototype;
442
+
443
+ /** Used to detect overreaching core-js shims. */
444
+ var coreJsData = root['__core-js_shared__'];
445
+
446
+ /** Used to resolve the decompiled source of functions. */
447
+ var funcToString = funcProto.toString;
448
+
449
+ /** Used to check objects for own properties. */
450
+ var hasOwnProperty = objectProto.hasOwnProperty;
451
+
452
+ /** Used to detect methods masquerading as native. */
453
+ var maskSrcKey = (function() {
454
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
455
+ return uid ? ('Symbol(src)_1.' + uid) : '';
456
+ }());
457
+
458
+ /**
459
+ * Used to resolve the
460
+ * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
461
+ * of values.
462
+ */
463
+ var nativeObjectToString = objectProto.toString;
464
+
465
+ /** Used to detect if a method is native. */
466
+ var reIsNative = RegExp('^' +
467
+ funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
468
+ .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
469
+ );
470
+
471
+ /** Built-in value references. */
472
+ var Buffer = moduleExports ? root.Buffer : undefined,
473
+ Symbol = root.Symbol,
474
+ Uint8Array = root.Uint8Array,
475
+ propertyIsEnumerable = objectProto.propertyIsEnumerable,
476
+ splice = arrayProto.splice,
477
+ symToStringTag = Symbol ? Symbol.toStringTag : undefined;
478
+
479
+ /* Built-in method references for those with the same name as other `lodash` methods. */
480
+ var nativeGetSymbols = Object.getOwnPropertySymbols,
481
+ nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,
482
+ nativeKeys = overArg(Object.keys, Object);
483
+
484
+ /* Built-in method references that are verified to be native. */
485
+ var DataView = getNative(root, 'DataView'),
486
+ Map = getNative(root, 'Map'),
487
+ Promise = getNative(root, 'Promise'),
488
+ Set = getNative(root, 'Set'),
489
+ WeakMap = getNative(root, 'WeakMap'),
490
+ nativeCreate = getNative(Object, 'create');
491
+
492
+ /** Used to detect maps, sets, and weakmaps. */
493
+ var dataViewCtorString = toSource(DataView),
494
+ mapCtorString = toSource(Map),
495
+ promiseCtorString = toSource(Promise),
496
+ setCtorString = toSource(Set),
497
+ weakMapCtorString = toSource(WeakMap);
498
+
499
+ /** Used to convert symbols to primitives and strings. */
500
+ var symbolProto = Symbol ? Symbol.prototype : undefined,
501
+ symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
502
+
503
+ /**
504
+ * Creates a hash object.
505
+ *
506
+ * @private
507
+ * @constructor
508
+ * @param {Array} [entries] The key-value pairs to cache.
509
+ */
510
+ function Hash(entries) {
511
+ var index = -1,
512
+ length = entries == null ? 0 : entries.length;
513
+
514
+ this.clear();
515
+ while (++index < length) {
516
+ var entry = entries[index];
517
+ this.set(entry[0], entry[1]);
518
+ }
519
+ }
520
+
521
+ /**
522
+ * Removes all key-value entries from the hash.
523
+ *
524
+ * @private
525
+ * @name clear
526
+ * @memberOf Hash
527
+ */
528
+ function hashClear() {
529
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
530
+ this.size = 0;
531
+ }
532
+
533
+ /**
534
+ * Removes `key` and its value from the hash.
535
+ *
536
+ * @private
537
+ * @name delete
538
+ * @memberOf Hash
539
+ * @param {Object} hash The hash to modify.
540
+ * @param {string} key The key of the value to remove.
541
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
542
+ */
543
+ function hashDelete(key) {
544
+ var result = this.has(key) && delete this.__data__[key];
545
+ this.size -= result ? 1 : 0;
546
+ return result;
547
+ }
548
+
549
+ /**
550
+ * Gets the hash value for `key`.
551
+ *
552
+ * @private
553
+ * @name get
554
+ * @memberOf Hash
555
+ * @param {string} key The key of the value to get.
556
+ * @returns {*} Returns the entry value.
557
+ */
558
+ function hashGet(key) {
559
+ var data = this.__data__;
560
+ if (nativeCreate) {
561
+ var result = data[key];
562
+ return result === HASH_UNDEFINED ? undefined : result;
563
+ }
564
+ return hasOwnProperty.call(data, key) ? data[key] : undefined;
565
+ }
566
+
567
+ /**
568
+ * Checks if a hash value for `key` exists.
569
+ *
570
+ * @private
571
+ * @name has
572
+ * @memberOf Hash
573
+ * @param {string} key The key of the entry to check.
574
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
575
+ */
576
+ function hashHas(key) {
577
+ var data = this.__data__;
578
+ return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);
579
+ }
580
+
581
+ /**
582
+ * Sets the hash `key` to `value`.
583
+ *
584
+ * @private
585
+ * @name set
586
+ * @memberOf Hash
587
+ * @param {string} key The key of the value to set.
588
+ * @param {*} value The value to set.
589
+ * @returns {Object} Returns the hash instance.
590
+ */
591
+ function hashSet(key, value) {
592
+ var data = this.__data__;
593
+ this.size += this.has(key) ? 0 : 1;
594
+ data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
595
+ return this;
596
+ }
597
+
598
+ // Add methods to `Hash`.
599
+ Hash.prototype.clear = hashClear;
600
+ Hash.prototype['delete'] = hashDelete;
601
+ Hash.prototype.get = hashGet;
602
+ Hash.prototype.has = hashHas;
603
+ Hash.prototype.set = hashSet;
604
+
605
+ /**
606
+ * Creates an list cache object.
607
+ *
608
+ * @private
609
+ * @constructor
610
+ * @param {Array} [entries] The key-value pairs to cache.
611
+ */
612
+ function ListCache(entries) {
613
+ var index = -1,
614
+ length = entries == null ? 0 : entries.length;
615
+
616
+ this.clear();
617
+ while (++index < length) {
618
+ var entry = entries[index];
619
+ this.set(entry[0], entry[1]);
620
+ }
621
+ }
622
+
623
+ /**
624
+ * Removes all key-value entries from the list cache.
625
+ *
626
+ * @private
627
+ * @name clear
628
+ * @memberOf ListCache
629
+ */
630
+ function listCacheClear() {
631
+ this.__data__ = [];
632
+ this.size = 0;
633
+ }
634
+
635
+ /**
636
+ * Removes `key` and its value from the list cache.
637
+ *
638
+ * @private
639
+ * @name delete
640
+ * @memberOf ListCache
641
+ * @param {string} key The key of the value to remove.
642
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
643
+ */
644
+ function listCacheDelete(key) {
645
+ var data = this.__data__,
646
+ index = assocIndexOf(data, key);
647
+
648
+ if (index < 0) {
649
+ return false;
650
+ }
651
+ var lastIndex = data.length - 1;
652
+ if (index == lastIndex) {
653
+ data.pop();
654
+ } else {
655
+ splice.call(data, index, 1);
656
+ }
657
+ --this.size;
658
+ return true;
659
+ }
660
+
661
+ /**
662
+ * Gets the list cache value for `key`.
663
+ *
664
+ * @private
665
+ * @name get
666
+ * @memberOf ListCache
667
+ * @param {string} key The key of the value to get.
668
+ * @returns {*} Returns the entry value.
669
+ */
670
+ function listCacheGet(key) {
671
+ var data = this.__data__,
672
+ index = assocIndexOf(data, key);
673
+
674
+ return index < 0 ? undefined : data[index][1];
675
+ }
676
+
677
+ /**
678
+ * Checks if a list cache value for `key` exists.
679
+ *
680
+ * @private
681
+ * @name has
682
+ * @memberOf ListCache
683
+ * @param {string} key The key of the entry to check.
684
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
685
+ */
686
+ function listCacheHas(key) {
687
+ return assocIndexOf(this.__data__, key) > -1;
688
+ }
689
+
690
+ /**
691
+ * Sets the list cache `key` to `value`.
692
+ *
693
+ * @private
694
+ * @name set
695
+ * @memberOf ListCache
696
+ * @param {string} key The key of the value to set.
697
+ * @param {*} value The value to set.
698
+ * @returns {Object} Returns the list cache instance.
699
+ */
700
+ function listCacheSet(key, value) {
701
+ var data = this.__data__,
702
+ index = assocIndexOf(data, key);
703
+
704
+ if (index < 0) {
705
+ ++this.size;
706
+ data.push([key, value]);
707
+ } else {
708
+ data[index][1] = value;
709
+ }
710
+ return this;
711
+ }
712
+
713
+ // Add methods to `ListCache`.
714
+ ListCache.prototype.clear = listCacheClear;
715
+ ListCache.prototype['delete'] = listCacheDelete;
716
+ ListCache.prototype.get = listCacheGet;
717
+ ListCache.prototype.has = listCacheHas;
718
+ ListCache.prototype.set = listCacheSet;
719
+
720
+ /**
721
+ * Creates a map cache object to store key-value pairs.
722
+ *
723
+ * @private
724
+ * @constructor
725
+ * @param {Array} [entries] The key-value pairs to cache.
726
+ */
727
+ function MapCache(entries) {
728
+ var index = -1,
729
+ length = entries == null ? 0 : entries.length;
730
+
731
+ this.clear();
732
+ while (++index < length) {
733
+ var entry = entries[index];
734
+ this.set(entry[0], entry[1]);
735
+ }
736
+ }
737
+
738
+ /**
739
+ * Removes all key-value entries from the map.
740
+ *
741
+ * @private
742
+ * @name clear
743
+ * @memberOf MapCache
744
+ */
745
+ function mapCacheClear() {
746
+ this.size = 0;
747
+ this.__data__ = {
748
+ 'hash': new Hash,
749
+ 'map': new (Map || ListCache),
750
+ 'string': new Hash
751
+ };
752
+ }
753
+
754
+ /**
755
+ * Removes `key` and its value from the map.
756
+ *
757
+ * @private
758
+ * @name delete
759
+ * @memberOf MapCache
760
+ * @param {string} key The key of the value to remove.
761
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
762
+ */
763
+ function mapCacheDelete(key) {
764
+ var result = getMapData(this, key)['delete'](key);
765
+ this.size -= result ? 1 : 0;
766
+ return result;
767
+ }
768
+
769
+ /**
770
+ * Gets the map value for `key`.
771
+ *
772
+ * @private
773
+ * @name get
774
+ * @memberOf MapCache
775
+ * @param {string} key The key of the value to get.
776
+ * @returns {*} Returns the entry value.
777
+ */
778
+ function mapCacheGet(key) {
779
+ return getMapData(this, key).get(key);
780
+ }
781
+
782
+ /**
783
+ * Checks if a map value for `key` exists.
784
+ *
785
+ * @private
786
+ * @name has
787
+ * @memberOf MapCache
788
+ * @param {string} key The key of the entry to check.
789
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
790
+ */
791
+ function mapCacheHas(key) {
792
+ return getMapData(this, key).has(key);
793
+ }
794
+
795
+ /**
796
+ * Sets the map `key` to `value`.
797
+ *
798
+ * @private
799
+ * @name set
800
+ * @memberOf MapCache
801
+ * @param {string} key The key of the value to set.
802
+ * @param {*} value The value to set.
803
+ * @returns {Object} Returns the map cache instance.
804
+ */
805
+ function mapCacheSet(key, value) {
806
+ var data = getMapData(this, key),
807
+ size = data.size;
808
+
809
+ data.set(key, value);
810
+ this.size += data.size == size ? 0 : 1;
811
+ return this;
812
+ }
813
+
814
+ // Add methods to `MapCache`.
815
+ MapCache.prototype.clear = mapCacheClear;
816
+ MapCache.prototype['delete'] = mapCacheDelete;
817
+ MapCache.prototype.get = mapCacheGet;
818
+ MapCache.prototype.has = mapCacheHas;
819
+ MapCache.prototype.set = mapCacheSet;
820
+
821
+ /**
822
+ *
823
+ * Creates an array cache object to store unique values.
824
+ *
825
+ * @private
826
+ * @constructor
827
+ * @param {Array} [values] The values to cache.
828
+ */
829
+ function SetCache(values) {
830
+ var index = -1,
831
+ length = values == null ? 0 : values.length;
832
+
833
+ this.__data__ = new MapCache;
834
+ while (++index < length) {
835
+ this.add(values[index]);
836
+ }
837
+ }
838
+
839
+ /**
840
+ * Adds `value` to the array cache.
841
+ *
842
+ * @private
843
+ * @name add
844
+ * @memberOf SetCache
845
+ * @alias push
846
+ * @param {*} value The value to cache.
847
+ * @returns {Object} Returns the cache instance.
848
+ */
849
+ function setCacheAdd(value) {
850
+ this.__data__.set(value, HASH_UNDEFINED);
851
+ return this;
852
+ }
853
+
854
+ /**
855
+ * Checks if `value` is in the array cache.
856
+ *
857
+ * @private
858
+ * @name has
859
+ * @memberOf SetCache
860
+ * @param {*} value The value to search for.
861
+ * @returns {number} Returns `true` if `value` is found, else `false`.
862
+ */
863
+ function setCacheHas(value) {
864
+ return this.__data__.has(value);
865
+ }
866
+
867
+ // Add methods to `SetCache`.
868
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
869
+ SetCache.prototype.has = setCacheHas;
870
+
871
+ /**
872
+ * Creates a stack cache object to store key-value pairs.
873
+ *
874
+ * @private
875
+ * @constructor
876
+ * @param {Array} [entries] The key-value pairs to cache.
877
+ */
878
+ function Stack(entries) {
879
+ var data = this.__data__ = new ListCache(entries);
880
+ this.size = data.size;
881
+ }
882
+
883
+ /**
884
+ * Removes all key-value entries from the stack.
885
+ *
886
+ * @private
887
+ * @name clear
888
+ * @memberOf Stack
889
+ */
890
+ function stackClear() {
891
+ this.__data__ = new ListCache;
892
+ this.size = 0;
893
+ }
894
+
895
+ /**
896
+ * Removes `key` and its value from the stack.
897
+ *
898
+ * @private
899
+ * @name delete
900
+ * @memberOf Stack
901
+ * @param {string} key The key of the value to remove.
902
+ * @returns {boolean} Returns `true` if the entry was removed, else `false`.
903
+ */
904
+ function stackDelete(key) {
905
+ var data = this.__data__,
906
+ result = data['delete'](key);
907
+
908
+ this.size = data.size;
909
+ return result;
910
+ }
911
+
912
+ /**
913
+ * Gets the stack value for `key`.
914
+ *
915
+ * @private
916
+ * @name get
917
+ * @memberOf Stack
918
+ * @param {string} key The key of the value to get.
919
+ * @returns {*} Returns the entry value.
920
+ */
921
+ function stackGet(key) {
922
+ return this.__data__.get(key);
923
+ }
924
+
925
+ /**
926
+ * Checks if a stack value for `key` exists.
927
+ *
928
+ * @private
929
+ * @name has
930
+ * @memberOf Stack
931
+ * @param {string} key The key of the entry to check.
932
+ * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
933
+ */
934
+ function stackHas(key) {
935
+ return this.__data__.has(key);
936
+ }
937
+
938
+ /**
939
+ * Sets the stack `key` to `value`.
940
+ *
941
+ * @private
942
+ * @name set
943
+ * @memberOf Stack
944
+ * @param {string} key The key of the value to set.
945
+ * @param {*} value The value to set.
946
+ * @returns {Object} Returns the stack cache instance.
947
+ */
948
+ function stackSet(key, value) {
949
+ var data = this.__data__;
950
+ if (data instanceof ListCache) {
951
+ var pairs = data.__data__;
952
+ if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
953
+ pairs.push([key, value]);
954
+ this.size = ++data.size;
955
+ return this;
956
+ }
957
+ data = this.__data__ = new MapCache(pairs);
958
+ }
959
+ data.set(key, value);
960
+ this.size = data.size;
961
+ return this;
962
+ }
963
+
964
+ // Add methods to `Stack`.
965
+ Stack.prototype.clear = stackClear;
966
+ Stack.prototype['delete'] = stackDelete;
967
+ Stack.prototype.get = stackGet;
968
+ Stack.prototype.has = stackHas;
969
+ Stack.prototype.set = stackSet;
970
+
971
+ /**
972
+ * Creates an array of the enumerable property names of the array-like `value`.
973
+ *
974
+ * @private
975
+ * @param {*} value The value to query.
976
+ * @param {boolean} inherited Specify returning inherited property names.
977
+ * @returns {Array} Returns the array of property names.
978
+ */
979
+ function arrayLikeKeys(value, inherited) {
980
+ var isArr = isArray(value),
981
+ isArg = !isArr && isArguments(value),
982
+ isBuff = !isArr && !isArg && isBuffer(value),
983
+ isType = !isArr && !isArg && !isBuff && isTypedArray(value),
984
+ skipIndexes = isArr || isArg || isBuff || isType,
985
+ result = skipIndexes ? baseTimes(value.length, String) : [],
986
+ length = result.length;
987
+
988
+ for (var key in value) {
989
+ if ((hasOwnProperty.call(value, key)) &&
990
+ !(skipIndexes && (
991
+ // Safari 9 has enumerable `arguments.length` in strict mode.
992
+ key == 'length' ||
993
+ // Node.js 0.10 has enumerable non-index properties on buffers.
994
+ (isBuff && (key == 'offset' || key == 'parent')) ||
995
+ // PhantomJS 2 has enumerable non-index properties on typed arrays.
996
+ (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
997
+ // Skip index properties.
998
+ isIndex(key, length)
999
+ ))) {
1000
+ result.push(key);
1001
+ }
1002
+ }
1003
+ return result;
1004
+ }
140
1005
 
141
- var require$$1 = /*@__PURE__*/getAugmentedNamespace(types__namespace);
1006
+ /**
1007
+ * Gets the index at which the `key` is found in `array` of key-value pairs.
1008
+ *
1009
+ * @private
1010
+ * @param {Array} array The array to inspect.
1011
+ * @param {*} key The key to search for.
1012
+ * @returns {number} Returns the index of the matched value, else `-1`.
1013
+ */
1014
+ function assocIndexOf(array, key) {
1015
+ var length = array.length;
1016
+ while (length--) {
1017
+ if (eq(array[length][0], key)) {
1018
+ return length;
1019
+ }
1020
+ }
1021
+ return -1;
1022
+ }
1023
+
1024
+ /**
1025
+ * The base implementation of `getAllKeys` and `getAllKeysIn` which uses
1026
+ * `keysFunc` and `symbolsFunc` to get the enumerable property names and
1027
+ * symbols of `object`.
1028
+ *
1029
+ * @private
1030
+ * @param {Object} object The object to query.
1031
+ * @param {Function} keysFunc The function to get the keys of `object`.
1032
+ * @param {Function} symbolsFunc The function to get the symbols of `object`.
1033
+ * @returns {Array} Returns the array of property names and symbols.
1034
+ */
1035
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
1036
+ var result = keysFunc(object);
1037
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
1038
+ }
1039
+
1040
+ /**
1041
+ * The base implementation of `getTag` without fallbacks for buggy environments.
1042
+ *
1043
+ * @private
1044
+ * @param {*} value The value to query.
1045
+ * @returns {string} Returns the `toStringTag`.
1046
+ */
1047
+ function baseGetTag(value) {
1048
+ if (value == null) {
1049
+ return value === undefined ? undefinedTag : nullTag;
1050
+ }
1051
+ return (symToStringTag && symToStringTag in Object(value))
1052
+ ? getRawTag(value)
1053
+ : objectToString(value);
1054
+ }
1055
+
1056
+ /**
1057
+ * The base implementation of `_.isArguments`.
1058
+ *
1059
+ * @private
1060
+ * @param {*} value The value to check.
1061
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1062
+ */
1063
+ function baseIsArguments(value) {
1064
+ return isObjectLike(value) && baseGetTag(value) == argsTag;
1065
+ }
1066
+
1067
+ /**
1068
+ * The base implementation of `_.isEqual` which supports partial comparisons
1069
+ * and tracks traversed objects.
1070
+ *
1071
+ * @private
1072
+ * @param {*} value The value to compare.
1073
+ * @param {*} other The other value to compare.
1074
+ * @param {boolean} bitmask The bitmask flags.
1075
+ * 1 - Unordered comparison
1076
+ * 2 - Partial comparison
1077
+ * @param {Function} [customizer] The function to customize comparisons.
1078
+ * @param {Object} [stack] Tracks traversed `value` and `other` objects.
1079
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1080
+ */
1081
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
1082
+ if (value === other) {
1083
+ return true;
1084
+ }
1085
+ if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {
1086
+ return value !== value && other !== other;
1087
+ }
1088
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
1089
+ }
1090
+
1091
+ /**
1092
+ * A specialized version of `baseIsEqual` for arrays and objects which performs
1093
+ * deep comparisons and tracks traversed objects enabling objects with circular
1094
+ * references to be compared.
1095
+ *
1096
+ * @private
1097
+ * @param {Object} object The object to compare.
1098
+ * @param {Object} other The other object to compare.
1099
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1100
+ * @param {Function} customizer The function to customize comparisons.
1101
+ * @param {Function} equalFunc The function to determine equivalents of values.
1102
+ * @param {Object} [stack] Tracks traversed `object` and `other` objects.
1103
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1104
+ */
1105
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
1106
+ var objIsArr = isArray(object),
1107
+ othIsArr = isArray(other),
1108
+ objTag = objIsArr ? arrayTag : getTag(object),
1109
+ othTag = othIsArr ? arrayTag : getTag(other);
1110
+
1111
+ objTag = objTag == argsTag ? objectTag : objTag;
1112
+ othTag = othTag == argsTag ? objectTag : othTag;
1113
+
1114
+ var objIsObj = objTag == objectTag,
1115
+ othIsObj = othTag == objectTag,
1116
+ isSameTag = objTag == othTag;
1117
+
1118
+ if (isSameTag && isBuffer(object)) {
1119
+ if (!isBuffer(other)) {
1120
+ return false;
1121
+ }
1122
+ objIsArr = true;
1123
+ objIsObj = false;
1124
+ }
1125
+ if (isSameTag && !objIsObj) {
1126
+ stack || (stack = new Stack);
1127
+ return (objIsArr || isTypedArray(object))
1128
+ ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)
1129
+ : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
1130
+ }
1131
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
1132
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
1133
+ othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
1134
+
1135
+ if (objIsWrapped || othIsWrapped) {
1136
+ var objUnwrapped = objIsWrapped ? object.value() : object,
1137
+ othUnwrapped = othIsWrapped ? other.value() : other;
1138
+
1139
+ stack || (stack = new Stack);
1140
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
1141
+ }
1142
+ }
1143
+ if (!isSameTag) {
1144
+ return false;
1145
+ }
1146
+ stack || (stack = new Stack);
1147
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
1148
+ }
1149
+
1150
+ /**
1151
+ * The base implementation of `_.isNative` without bad shim checks.
1152
+ *
1153
+ * @private
1154
+ * @param {*} value The value to check.
1155
+ * @returns {boolean} Returns `true` if `value` is a native function,
1156
+ * else `false`.
1157
+ */
1158
+ function baseIsNative(value) {
1159
+ if (!isObject(value) || isMasked(value)) {
1160
+ return false;
1161
+ }
1162
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
1163
+ return pattern.test(toSource(value));
1164
+ }
1165
+
1166
+ /**
1167
+ * The base implementation of `_.isTypedArray` without Node.js optimizations.
1168
+ *
1169
+ * @private
1170
+ * @param {*} value The value to check.
1171
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1172
+ */
1173
+ function baseIsTypedArray(value) {
1174
+ return isObjectLike(value) &&
1175
+ isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
1176
+ }
1177
+
1178
+ /**
1179
+ * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
1180
+ *
1181
+ * @private
1182
+ * @param {Object} object The object to query.
1183
+ * @returns {Array} Returns the array of property names.
1184
+ */
1185
+ function baseKeys(object) {
1186
+ if (!isPrototype(object)) {
1187
+ return nativeKeys(object);
1188
+ }
1189
+ var result = [];
1190
+ for (var key in Object(object)) {
1191
+ if (hasOwnProperty.call(object, key) && key != 'constructor') {
1192
+ result.push(key);
1193
+ }
1194
+ }
1195
+ return result;
1196
+ }
1197
+
1198
+ /**
1199
+ * A specialized version of `baseIsEqualDeep` for arrays with support for
1200
+ * partial deep comparisons.
1201
+ *
1202
+ * @private
1203
+ * @param {Array} array The array to compare.
1204
+ * @param {Array} other The other array to compare.
1205
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1206
+ * @param {Function} customizer The function to customize comparisons.
1207
+ * @param {Function} equalFunc The function to determine equivalents of values.
1208
+ * @param {Object} stack Tracks traversed `array` and `other` objects.
1209
+ * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
1210
+ */
1211
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
1212
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
1213
+ arrLength = array.length,
1214
+ othLength = other.length;
1215
+
1216
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
1217
+ return false;
1218
+ }
1219
+ // Assume cyclic values are equal.
1220
+ var stacked = stack.get(array);
1221
+ if (stacked && stack.get(other)) {
1222
+ return stacked == other;
1223
+ }
1224
+ var index = -1,
1225
+ result = true,
1226
+ seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;
1227
+
1228
+ stack.set(array, other);
1229
+ stack.set(other, array);
1230
+
1231
+ // Ignore non-index properties.
1232
+ while (++index < arrLength) {
1233
+ var arrValue = array[index],
1234
+ othValue = other[index];
1235
+
1236
+ if (customizer) {
1237
+ var compared = isPartial
1238
+ ? customizer(othValue, arrValue, index, other, array, stack)
1239
+ : customizer(arrValue, othValue, index, array, other, stack);
1240
+ }
1241
+ if (compared !== undefined) {
1242
+ if (compared) {
1243
+ continue;
1244
+ }
1245
+ result = false;
1246
+ break;
1247
+ }
1248
+ // Recursively compare arrays (susceptible to call stack limits).
1249
+ if (seen) {
1250
+ if (!arraySome(other, function(othValue, othIndex) {
1251
+ if (!cacheHas(seen, othIndex) &&
1252
+ (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
1253
+ return seen.push(othIndex);
1254
+ }
1255
+ })) {
1256
+ result = false;
1257
+ break;
1258
+ }
1259
+ } else if (!(
1260
+ arrValue === othValue ||
1261
+ equalFunc(arrValue, othValue, bitmask, customizer, stack)
1262
+ )) {
1263
+ result = false;
1264
+ break;
1265
+ }
1266
+ }
1267
+ stack['delete'](array);
1268
+ stack['delete'](other);
1269
+ return result;
1270
+ }
1271
+
1272
+ /**
1273
+ * A specialized version of `baseIsEqualDeep` for comparing objects of
1274
+ * the same `toStringTag`.
1275
+ *
1276
+ * **Note:** This function only supports comparing values with tags of
1277
+ * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
1278
+ *
1279
+ * @private
1280
+ * @param {Object} object The object to compare.
1281
+ * @param {Object} other The other object to compare.
1282
+ * @param {string} tag The `toStringTag` of the objects to compare.
1283
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1284
+ * @param {Function} customizer The function to customize comparisons.
1285
+ * @param {Function} equalFunc The function to determine equivalents of values.
1286
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
1287
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1288
+ */
1289
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
1290
+ switch (tag) {
1291
+ case dataViewTag:
1292
+ if ((object.byteLength != other.byteLength) ||
1293
+ (object.byteOffset != other.byteOffset)) {
1294
+ return false;
1295
+ }
1296
+ object = object.buffer;
1297
+ other = other.buffer;
1298
+
1299
+ case arrayBufferTag:
1300
+ if ((object.byteLength != other.byteLength) ||
1301
+ !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
1302
+ return false;
1303
+ }
1304
+ return true;
1305
+
1306
+ case boolTag:
1307
+ case dateTag:
1308
+ case numberTag:
1309
+ // Coerce booleans to `1` or `0` and dates to milliseconds.
1310
+ // Invalid dates are coerced to `NaN`.
1311
+ return eq(+object, +other);
1312
+
1313
+ case errorTag:
1314
+ return object.name == other.name && object.message == other.message;
1315
+
1316
+ case regexpTag:
1317
+ case stringTag:
1318
+ // Coerce regexes to strings and treat strings, primitives and objects,
1319
+ // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
1320
+ // for more details.
1321
+ return object == (other + '');
1322
+
1323
+ case mapTag:
1324
+ var convert = mapToArray;
1325
+
1326
+ case setTag:
1327
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
1328
+ convert || (convert = setToArray);
1329
+
1330
+ if (object.size != other.size && !isPartial) {
1331
+ return false;
1332
+ }
1333
+ // Assume cyclic values are equal.
1334
+ var stacked = stack.get(object);
1335
+ if (stacked) {
1336
+ return stacked == other;
1337
+ }
1338
+ bitmask |= COMPARE_UNORDERED_FLAG;
1339
+
1340
+ // Recursively compare objects (susceptible to call stack limits).
1341
+ stack.set(object, other);
1342
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
1343
+ stack['delete'](object);
1344
+ return result;
1345
+
1346
+ case symbolTag:
1347
+ if (symbolValueOf) {
1348
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
1349
+ }
1350
+ }
1351
+ return false;
1352
+ }
1353
+
1354
+ /**
1355
+ * A specialized version of `baseIsEqualDeep` for objects with support for
1356
+ * partial deep comparisons.
1357
+ *
1358
+ * @private
1359
+ * @param {Object} object The object to compare.
1360
+ * @param {Object} other The other object to compare.
1361
+ * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
1362
+ * @param {Function} customizer The function to customize comparisons.
1363
+ * @param {Function} equalFunc The function to determine equivalents of values.
1364
+ * @param {Object} stack Tracks traversed `object` and `other` objects.
1365
+ * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
1366
+ */
1367
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
1368
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG,
1369
+ objProps = getAllKeys(object),
1370
+ objLength = objProps.length,
1371
+ othProps = getAllKeys(other),
1372
+ othLength = othProps.length;
1373
+
1374
+ if (objLength != othLength && !isPartial) {
1375
+ return false;
1376
+ }
1377
+ var index = objLength;
1378
+ while (index--) {
1379
+ var key = objProps[index];
1380
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
1381
+ return false;
1382
+ }
1383
+ }
1384
+ // Assume cyclic values are equal.
1385
+ var stacked = stack.get(object);
1386
+ if (stacked && stack.get(other)) {
1387
+ return stacked == other;
1388
+ }
1389
+ var result = true;
1390
+ stack.set(object, other);
1391
+ stack.set(other, object);
1392
+
1393
+ var skipCtor = isPartial;
1394
+ while (++index < objLength) {
1395
+ key = objProps[index];
1396
+ var objValue = object[key],
1397
+ othValue = other[key];
1398
+
1399
+ if (customizer) {
1400
+ var compared = isPartial
1401
+ ? customizer(othValue, objValue, key, other, object, stack)
1402
+ : customizer(objValue, othValue, key, object, other, stack);
1403
+ }
1404
+ // Recursively compare objects (susceptible to call stack limits).
1405
+ if (!(compared === undefined
1406
+ ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
1407
+ : compared
1408
+ )) {
1409
+ result = false;
1410
+ break;
1411
+ }
1412
+ skipCtor || (skipCtor = key == 'constructor');
1413
+ }
1414
+ if (result && !skipCtor) {
1415
+ var objCtor = object.constructor,
1416
+ othCtor = other.constructor;
1417
+
1418
+ // Non `Object` object instances with different constructors are not equal.
1419
+ if (objCtor != othCtor &&
1420
+ ('constructor' in object && 'constructor' in other) &&
1421
+ !(typeof objCtor == 'function' && objCtor instanceof objCtor &&
1422
+ typeof othCtor == 'function' && othCtor instanceof othCtor)) {
1423
+ result = false;
1424
+ }
1425
+ }
1426
+ stack['delete'](object);
1427
+ stack['delete'](other);
1428
+ return result;
1429
+ }
1430
+
1431
+ /**
1432
+ * Creates an array of own enumerable property names and symbols of `object`.
1433
+ *
1434
+ * @private
1435
+ * @param {Object} object The object to query.
1436
+ * @returns {Array} Returns the array of property names and symbols.
1437
+ */
1438
+ function getAllKeys(object) {
1439
+ return baseGetAllKeys(object, keys, getSymbols);
1440
+ }
1441
+
1442
+ /**
1443
+ * Gets the data for `map`.
1444
+ *
1445
+ * @private
1446
+ * @param {Object} map The map to query.
1447
+ * @param {string} key The reference key.
1448
+ * @returns {*} Returns the map data.
1449
+ */
1450
+ function getMapData(map, key) {
1451
+ var data = map.__data__;
1452
+ return isKeyable(key)
1453
+ ? data[typeof key == 'string' ? 'string' : 'hash']
1454
+ : data.map;
1455
+ }
1456
+
1457
+ /**
1458
+ * Gets the native function at `key` of `object`.
1459
+ *
1460
+ * @private
1461
+ * @param {Object} object The object to query.
1462
+ * @param {string} key The key of the method to get.
1463
+ * @returns {*} Returns the function if it's native, else `undefined`.
1464
+ */
1465
+ function getNative(object, key) {
1466
+ var value = getValue(object, key);
1467
+ return baseIsNative(value) ? value : undefined;
1468
+ }
1469
+
1470
+ /**
1471
+ * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
1472
+ *
1473
+ * @private
1474
+ * @param {*} value The value to query.
1475
+ * @returns {string} Returns the raw `toStringTag`.
1476
+ */
1477
+ function getRawTag(value) {
1478
+ var isOwn = hasOwnProperty.call(value, symToStringTag),
1479
+ tag = value[symToStringTag];
1480
+
1481
+ try {
1482
+ value[symToStringTag] = undefined;
1483
+ var unmasked = true;
1484
+ } catch (e) {}
1485
+
1486
+ var result = nativeObjectToString.call(value);
1487
+ if (unmasked) {
1488
+ if (isOwn) {
1489
+ value[symToStringTag] = tag;
1490
+ } else {
1491
+ delete value[symToStringTag];
1492
+ }
1493
+ }
1494
+ return result;
1495
+ }
1496
+
1497
+ /**
1498
+ * Creates an array of the own enumerable symbols of `object`.
1499
+ *
1500
+ * @private
1501
+ * @param {Object} object The object to query.
1502
+ * @returns {Array} Returns the array of symbols.
1503
+ */
1504
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
1505
+ if (object == null) {
1506
+ return [];
1507
+ }
1508
+ object = Object(object);
1509
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
1510
+ return propertyIsEnumerable.call(object, symbol);
1511
+ });
1512
+ };
1513
+
1514
+ /**
1515
+ * Gets the `toStringTag` of `value`.
1516
+ *
1517
+ * @private
1518
+ * @param {*} value The value to query.
1519
+ * @returns {string} Returns the `toStringTag`.
1520
+ */
1521
+ var getTag = baseGetTag;
1522
+
1523
+ // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
1524
+ if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||
1525
+ (Map && getTag(new Map) != mapTag) ||
1526
+ (Promise && getTag(Promise.resolve()) != promiseTag) ||
1527
+ (Set && getTag(new Set) != setTag) ||
1528
+ (WeakMap && getTag(new WeakMap) != weakMapTag)) {
1529
+ getTag = function(value) {
1530
+ var result = baseGetTag(value),
1531
+ Ctor = result == objectTag ? value.constructor : undefined,
1532
+ ctorString = Ctor ? toSource(Ctor) : '';
1533
+
1534
+ if (ctorString) {
1535
+ switch (ctorString) {
1536
+ case dataViewCtorString: return dataViewTag;
1537
+ case mapCtorString: return mapTag;
1538
+ case promiseCtorString: return promiseTag;
1539
+ case setCtorString: return setTag;
1540
+ case weakMapCtorString: return weakMapTag;
1541
+ }
1542
+ }
1543
+ return result;
1544
+ };
1545
+ }
1546
+
1547
+ /**
1548
+ * Checks if `value` is a valid array-like index.
1549
+ *
1550
+ * @private
1551
+ * @param {*} value The value to check.
1552
+ * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
1553
+ * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
1554
+ */
1555
+ function isIndex(value, length) {
1556
+ length = length == null ? MAX_SAFE_INTEGER : length;
1557
+ return !!length &&
1558
+ (typeof value == 'number' || reIsUint.test(value)) &&
1559
+ (value > -1 && value % 1 == 0 && value < length);
1560
+ }
1561
+
1562
+ /**
1563
+ * Checks if `value` is suitable for use as unique object key.
1564
+ *
1565
+ * @private
1566
+ * @param {*} value The value to check.
1567
+ * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
1568
+ */
1569
+ function isKeyable(value) {
1570
+ var type = typeof value;
1571
+ return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
1572
+ ? (value !== '__proto__')
1573
+ : (value === null);
1574
+ }
1575
+
1576
+ /**
1577
+ * Checks if `func` has its source masked.
1578
+ *
1579
+ * @private
1580
+ * @param {Function} func The function to check.
1581
+ * @returns {boolean} Returns `true` if `func` is masked, else `false`.
1582
+ */
1583
+ function isMasked(func) {
1584
+ return !!maskSrcKey && (maskSrcKey in func);
1585
+ }
1586
+
1587
+ /**
1588
+ * Checks if `value` is likely a prototype object.
1589
+ *
1590
+ * @private
1591
+ * @param {*} value The value to check.
1592
+ * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
1593
+ */
1594
+ function isPrototype(value) {
1595
+ var Ctor = value && value.constructor,
1596
+ proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;
1597
+
1598
+ return value === proto;
1599
+ }
1600
+
1601
+ /**
1602
+ * Converts `value` to a string using `Object.prototype.toString`.
1603
+ *
1604
+ * @private
1605
+ * @param {*} value The value to convert.
1606
+ * @returns {string} Returns the converted string.
1607
+ */
1608
+ function objectToString(value) {
1609
+ return nativeObjectToString.call(value);
1610
+ }
1611
+
1612
+ /**
1613
+ * Converts `func` to its source code.
1614
+ *
1615
+ * @private
1616
+ * @param {Function} func The function to convert.
1617
+ * @returns {string} Returns the source code.
1618
+ */
1619
+ function toSource(func) {
1620
+ if (func != null) {
1621
+ try {
1622
+ return funcToString.call(func);
1623
+ } catch (e) {}
1624
+ try {
1625
+ return (func + '');
1626
+ } catch (e) {}
1627
+ }
1628
+ return '';
1629
+ }
1630
+
1631
+ /**
1632
+ * Performs a
1633
+ * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
1634
+ * comparison between two values to determine if they are equivalent.
1635
+ *
1636
+ * @static
1637
+ * @memberOf _
1638
+ * @since 4.0.0
1639
+ * @category Lang
1640
+ * @param {*} value The value to compare.
1641
+ * @param {*} other The other value to compare.
1642
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1643
+ * @example
1644
+ *
1645
+ * var object = { 'a': 1 };
1646
+ * var other = { 'a': 1 };
1647
+ *
1648
+ * _.eq(object, object);
1649
+ * // => true
1650
+ *
1651
+ * _.eq(object, other);
1652
+ * // => false
1653
+ *
1654
+ * _.eq('a', 'a');
1655
+ * // => true
1656
+ *
1657
+ * _.eq('a', Object('a'));
1658
+ * // => false
1659
+ *
1660
+ * _.eq(NaN, NaN);
1661
+ * // => true
1662
+ */
1663
+ function eq(value, other) {
1664
+ return value === other || (value !== value && other !== other);
1665
+ }
1666
+
1667
+ /**
1668
+ * Checks if `value` is likely an `arguments` object.
1669
+ *
1670
+ * @static
1671
+ * @memberOf _
1672
+ * @since 0.1.0
1673
+ * @category Lang
1674
+ * @param {*} value The value to check.
1675
+ * @returns {boolean} Returns `true` if `value` is an `arguments` object,
1676
+ * else `false`.
1677
+ * @example
1678
+ *
1679
+ * _.isArguments(function() { return arguments; }());
1680
+ * // => true
1681
+ *
1682
+ * _.isArguments([1, 2, 3]);
1683
+ * // => false
1684
+ */
1685
+ var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {
1686
+ return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&
1687
+ !propertyIsEnumerable.call(value, 'callee');
1688
+ };
1689
+
1690
+ /**
1691
+ * Checks if `value` is classified as an `Array` object.
1692
+ *
1693
+ * @static
1694
+ * @memberOf _
1695
+ * @since 0.1.0
1696
+ * @category Lang
1697
+ * @param {*} value The value to check.
1698
+ * @returns {boolean} Returns `true` if `value` is an array, else `false`.
1699
+ * @example
1700
+ *
1701
+ * _.isArray([1, 2, 3]);
1702
+ * // => true
1703
+ *
1704
+ * _.isArray(document.body.children);
1705
+ * // => false
1706
+ *
1707
+ * _.isArray('abc');
1708
+ * // => false
1709
+ *
1710
+ * _.isArray(_.noop);
1711
+ * // => false
1712
+ */
1713
+ var isArray = Array.isArray;
1714
+
1715
+ /**
1716
+ * Checks if `value` is array-like. A value is considered array-like if it's
1717
+ * not a function and has a `value.length` that's an integer greater than or
1718
+ * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
1719
+ *
1720
+ * @static
1721
+ * @memberOf _
1722
+ * @since 4.0.0
1723
+ * @category Lang
1724
+ * @param {*} value The value to check.
1725
+ * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
1726
+ * @example
1727
+ *
1728
+ * _.isArrayLike([1, 2, 3]);
1729
+ * // => true
1730
+ *
1731
+ * _.isArrayLike(document.body.children);
1732
+ * // => true
1733
+ *
1734
+ * _.isArrayLike('abc');
1735
+ * // => true
1736
+ *
1737
+ * _.isArrayLike(_.noop);
1738
+ * // => false
1739
+ */
1740
+ function isArrayLike(value) {
1741
+ return value != null && isLength(value.length) && !isFunction(value);
1742
+ }
1743
+
1744
+ /**
1745
+ * Checks if `value` is a buffer.
1746
+ *
1747
+ * @static
1748
+ * @memberOf _
1749
+ * @since 4.3.0
1750
+ * @category Lang
1751
+ * @param {*} value The value to check.
1752
+ * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
1753
+ * @example
1754
+ *
1755
+ * _.isBuffer(new Buffer(2));
1756
+ * // => true
1757
+ *
1758
+ * _.isBuffer(new Uint8Array(2));
1759
+ * // => false
1760
+ */
1761
+ var isBuffer = nativeIsBuffer || stubFalse;
1762
+
1763
+ /**
1764
+ * Performs a deep comparison between two values to determine if they are
1765
+ * equivalent.
1766
+ *
1767
+ * **Note:** This method supports comparing arrays, array buffers, booleans,
1768
+ * date objects, error objects, maps, numbers, `Object` objects, regexes,
1769
+ * sets, strings, symbols, and typed arrays. `Object` objects are compared
1770
+ * by their own, not inherited, enumerable properties. Functions and DOM
1771
+ * nodes are compared by strict equality, i.e. `===`.
1772
+ *
1773
+ * @static
1774
+ * @memberOf _
1775
+ * @since 0.1.0
1776
+ * @category Lang
1777
+ * @param {*} value The value to compare.
1778
+ * @param {*} other The other value to compare.
1779
+ * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
1780
+ * @example
1781
+ *
1782
+ * var object = { 'a': 1 };
1783
+ * var other = { 'a': 1 };
1784
+ *
1785
+ * _.isEqual(object, other);
1786
+ * // => true
1787
+ *
1788
+ * object === other;
1789
+ * // => false
1790
+ */
1791
+ function isEqual(value, other) {
1792
+ return baseIsEqual(value, other);
1793
+ }
1794
+
1795
+ /**
1796
+ * Checks if `value` is classified as a `Function` object.
1797
+ *
1798
+ * @static
1799
+ * @memberOf _
1800
+ * @since 0.1.0
1801
+ * @category Lang
1802
+ * @param {*} value The value to check.
1803
+ * @returns {boolean} Returns `true` if `value` is a function, else `false`.
1804
+ * @example
1805
+ *
1806
+ * _.isFunction(_);
1807
+ * // => true
1808
+ *
1809
+ * _.isFunction(/abc/);
1810
+ * // => false
1811
+ */
1812
+ function isFunction(value) {
1813
+ if (!isObject(value)) {
1814
+ return false;
1815
+ }
1816
+ // The use of `Object#toString` avoids issues with the `typeof` operator
1817
+ // in Safari 9 which returns 'object' for typed arrays and other constructors.
1818
+ var tag = baseGetTag(value);
1819
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
1820
+ }
1821
+
1822
+ /**
1823
+ * Checks if `value` is a valid array-like length.
1824
+ *
1825
+ * **Note:** This method is loosely based on
1826
+ * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
1827
+ *
1828
+ * @static
1829
+ * @memberOf _
1830
+ * @since 4.0.0
1831
+ * @category Lang
1832
+ * @param {*} value The value to check.
1833
+ * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
1834
+ * @example
1835
+ *
1836
+ * _.isLength(3);
1837
+ * // => true
1838
+ *
1839
+ * _.isLength(Number.MIN_VALUE);
1840
+ * // => false
1841
+ *
1842
+ * _.isLength(Infinity);
1843
+ * // => false
1844
+ *
1845
+ * _.isLength('3');
1846
+ * // => false
1847
+ */
1848
+ function isLength(value) {
1849
+ return typeof value == 'number' &&
1850
+ value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
1851
+ }
1852
+
1853
+ /**
1854
+ * Checks if `value` is the
1855
+ * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
1856
+ * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
1857
+ *
1858
+ * @static
1859
+ * @memberOf _
1860
+ * @since 0.1.0
1861
+ * @category Lang
1862
+ * @param {*} value The value to check.
1863
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
1864
+ * @example
1865
+ *
1866
+ * _.isObject({});
1867
+ * // => true
1868
+ *
1869
+ * _.isObject([1, 2, 3]);
1870
+ * // => true
1871
+ *
1872
+ * _.isObject(_.noop);
1873
+ * // => true
1874
+ *
1875
+ * _.isObject(null);
1876
+ * // => false
1877
+ */
1878
+ function isObject(value) {
1879
+ var type = typeof value;
1880
+ return value != null && (type == 'object' || type == 'function');
1881
+ }
1882
+
1883
+ /**
1884
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
1885
+ * and has a `typeof` result of "object".
1886
+ *
1887
+ * @static
1888
+ * @memberOf _
1889
+ * @since 4.0.0
1890
+ * @category Lang
1891
+ * @param {*} value The value to check.
1892
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
1893
+ * @example
1894
+ *
1895
+ * _.isObjectLike({});
1896
+ * // => true
1897
+ *
1898
+ * _.isObjectLike([1, 2, 3]);
1899
+ * // => true
1900
+ *
1901
+ * _.isObjectLike(_.noop);
1902
+ * // => false
1903
+ *
1904
+ * _.isObjectLike(null);
1905
+ * // => false
1906
+ */
1907
+ function isObjectLike(value) {
1908
+ return value != null && typeof value == 'object';
1909
+ }
1910
+
1911
+ /**
1912
+ * Checks if `value` is classified as a typed array.
1913
+ *
1914
+ * @static
1915
+ * @memberOf _
1916
+ * @since 3.0.0
1917
+ * @category Lang
1918
+ * @param {*} value The value to check.
1919
+ * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
1920
+ * @example
1921
+ *
1922
+ * _.isTypedArray(new Uint8Array);
1923
+ * // => true
1924
+ *
1925
+ * _.isTypedArray([]);
1926
+ * // => false
1927
+ */
1928
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
1929
+
1930
+ /**
1931
+ * Creates an array of the own enumerable property names of `object`.
1932
+ *
1933
+ * **Note:** Non-object values are coerced to objects. See the
1934
+ * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
1935
+ * for more details.
1936
+ *
1937
+ * @static
1938
+ * @since 0.1.0
1939
+ * @memberOf _
1940
+ * @category Object
1941
+ * @param {Object} object The object to query.
1942
+ * @returns {Array} Returns the array of property names.
1943
+ * @example
1944
+ *
1945
+ * function Foo() {
1946
+ * this.a = 1;
1947
+ * this.b = 2;
1948
+ * }
1949
+ *
1950
+ * Foo.prototype.c = 3;
1951
+ *
1952
+ * _.keys(new Foo);
1953
+ * // => ['a', 'b'] (iteration order is not guaranteed)
1954
+ *
1955
+ * _.keys('hi');
1956
+ * // => ['0', '1']
1957
+ */
1958
+ function keys(object) {
1959
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
1960
+ }
1961
+
1962
+ /**
1963
+ * This method returns a new empty array.
1964
+ *
1965
+ * @static
1966
+ * @memberOf _
1967
+ * @since 4.13.0
1968
+ * @category Util
1969
+ * @returns {Array} Returns the new empty array.
1970
+ * @example
1971
+ *
1972
+ * var arrays = _.times(2, _.stubArray);
1973
+ *
1974
+ * console.log(arrays);
1975
+ * // => [[], []]
1976
+ *
1977
+ * console.log(arrays[0] === arrays[1]);
1978
+ * // => false
1979
+ */
1980
+ function stubArray() {
1981
+ return [];
1982
+ }
1983
+
1984
+ /**
1985
+ * This method returns `false`.
1986
+ *
1987
+ * @static
1988
+ * @memberOf _
1989
+ * @since 4.13.0
1990
+ * @category Util
1991
+ * @returns {boolean} Returns `false`.
1992
+ * @example
1993
+ *
1994
+ * _.times(2, _.stubFalse);
1995
+ * // => [false, false]
1996
+ */
1997
+ function stubFalse() {
1998
+ return false;
1999
+ }
2000
+
2001
+ module.exports = isEqual;
2002
+ } (lodash_isequal, lodash_isequal.exports));
2003
+ return lodash_isequal.exports;
2004
+ }
2005
+
2006
+ /**
2007
+ * Wraps values in an `Ok` type.
2008
+ *
2009
+ * Example: `ok(5) // => {ok: true, result: 5}`
2010
+ */
2011
+
2012
+ var ok = function (result) { return ({ ok: true, result: result }); };
2013
+ /**
2014
+ * Typeguard for `Ok`.
2015
+ */
2016
+ var isOk = function (r) { return r.ok === true; };
2017
+ /**
2018
+ * Wraps errors in an `Err` type.
2019
+ *
2020
+ * Example: `err('on fire') // => {ok: false, error: 'on fire'}`
2021
+ */
2022
+ var err = function (error) { return ({ ok: false, error: error }); };
2023
+ /**
2024
+ * Typeguard for `Err`.
2025
+ */
2026
+ var isErr = function (r) { return r.ok === false; };
2027
+ /**
2028
+ * Create a `Promise` that either resolves with the result of `Ok` or rejects
2029
+ * with the error of `Err`.
2030
+ */
2031
+ var asPromise = function (r) {
2032
+ return r.ok === true ? Promise.resolve(r.result) : Promise.reject(r.error);
2033
+ };
2034
+ /**
2035
+ * Unwraps a `Result` and returns either the result of an `Ok`, or
2036
+ * `defaultValue`.
2037
+ *
2038
+ * Example:
2039
+ * ```
2040
+ * Result.withDefault(5, number().run(json))
2041
+ * ```
2042
+ *
2043
+ * It would be nice if `Decoder` had an instance method that mirrored this
2044
+ * function. Such a method would look something like this:
2045
+ * ```
2046
+ * class Decoder<A> {
2047
+ * runWithDefault = (defaultValue: A, json: any): A =>
2048
+ * Result.withDefault(defaultValue, this.run(json));
2049
+ * }
2050
+ *
2051
+ * number().runWithDefault(5, json)
2052
+ * ```
2053
+ * Unfortunately, the type of `defaultValue: A` on the method causes issues
2054
+ * with type inference on the `object` decoder in some situations. While these
2055
+ * inference issues can be solved by providing the optional type argument for
2056
+ * `object`s, the extra trouble and confusion doesn't seem worth it.
2057
+ */
2058
+ var withDefault = function (defaultValue, r) {
2059
+ return r.ok === true ? r.result : defaultValue;
2060
+ };
2061
+ /**
2062
+ * Return the successful result, or throw an error.
2063
+ */
2064
+ var withException = function (r) {
2065
+ if (r.ok === true) {
2066
+ return r.result;
2067
+ }
2068
+ else {
2069
+ throw r.error;
2070
+ }
2071
+ };
2072
+ /**
2073
+ * Given an array of `Result`s, return the successful values.
2074
+ */
2075
+ var successes = function (results) {
2076
+ return results.reduce(function (acc, r) { return (r.ok === true ? acc.concat(r.result) : acc); }, []);
2077
+ };
2078
+ /**
2079
+ * Apply `f` to the result of an `Ok`, or pass the error through.
2080
+ */
2081
+ var map = function (f, r) {
2082
+ return r.ok === true ? ok(f(r.result)) : r;
2083
+ };
2084
+ /**
2085
+ * Apply `f` to the result of two `Ok`s, or pass an error through. If both
2086
+ * `Result`s are errors then the first one is returned.
2087
+ */
2088
+ var map2 = function (f, ar, br) {
2089
+ return ar.ok === false ? ar :
2090
+ br.ok === false ? br :
2091
+ ok(f(ar.result, br.result));
2092
+ };
2093
+ /**
2094
+ * Apply `f` to the error of an `Err`, or pass the success through.
2095
+ */
2096
+ var mapError = function (f, r) {
2097
+ return r.ok === true ? r : err(f(r.error));
2098
+ };
2099
+ /**
2100
+ * Chain together a sequence of computations that may fail, similar to a
2101
+ * `Promise`. If the first computation fails then the error will propagate
2102
+ * through. If it succeeds, then `f` will be applied to the value, returning a
2103
+ * new `Result`.
2104
+ */
2105
+ var andThen = function (f, r) {
2106
+ return r.ok === true ? f(r.result) : r;
2107
+ };
2108
+
2109
+
2110
+ var result = Object.freeze({
2111
+ ok: ok,
2112
+ isOk: isOk,
2113
+ err: err,
2114
+ isErr: isErr,
2115
+ asPromise: asPromise,
2116
+ withDefault: withDefault,
2117
+ withException: withException,
2118
+ successes: successes,
2119
+ map: map,
2120
+ map2: map2,
2121
+ mapError: mapError,
2122
+ andThen: andThen
2123
+ });
2124
+
2125
+ /*! *****************************************************************************
2126
+ Copyright (c) Microsoft Corporation. All rights reserved.
2127
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
2128
+ this file except in compliance with the License. You may obtain a copy of the
2129
+ License at http://www.apache.org/licenses/LICENSE-2.0
2130
+
2131
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
2132
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
2133
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
2134
+ MERCHANTABLITY OR NON-INFRINGEMENT.
2135
+
2136
+ See the Apache Version 2.0 License for specific language governing permissions
2137
+ and limitations under the License.
2138
+ ***************************************************************************** */
2139
+ /* global Reflect, Promise */
2140
+
2141
+
2142
+
2143
+ var __assign = function() {
2144
+ __assign = Object.assign || function __assign(t) {
2145
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2146
+ s = arguments[i];
2147
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
2148
+ }
2149
+ return t;
2150
+ };
2151
+ return __assign.apply(this, arguments);
2152
+ };
2153
+
2154
+ function __rest(s, e) {
2155
+ var t = {};
2156
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
2157
+ t[p] = s[p];
2158
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
2159
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)
2160
+ t[p[i]] = s[p[i]];
2161
+ return t;
2162
+ }
2163
+
2164
+ var isEqual = requireLodash_isequal(); // this syntax avoids TS1192
2165
+ /**
2166
+ * Type guard for `DecoderError`. One use case of the type guard is in the
2167
+ * `catch` of a promise. Typescript types the error argument of `catch` as
2168
+ * `any`, so when dealing with a decoder as a promise you may need to
2169
+ * distinguish between a `DecoderError` and an error string.
2170
+ */
2171
+ var isDecoderError = function (a) {
2172
+ return a.kind === 'DecoderError' && typeof a.at === 'string' && typeof a.message === 'string';
2173
+ };
2174
+ /*
2175
+ * Helpers
2176
+ */
2177
+ var isJsonArray = function (json) { return Array.isArray(json); };
2178
+ var isJsonObject = function (json) {
2179
+ return typeof json === 'object' && json !== null && !isJsonArray(json);
2180
+ };
2181
+ var typeString = function (json) {
2182
+ switch (typeof json) {
2183
+ case 'string':
2184
+ return 'a string';
2185
+ case 'number':
2186
+ return 'a number';
2187
+ case 'boolean':
2188
+ return 'a boolean';
2189
+ case 'undefined':
2190
+ return 'undefined';
2191
+ case 'object':
2192
+ if (json instanceof Array) {
2193
+ return 'an array';
2194
+ }
2195
+ else if (json === null) {
2196
+ return 'null';
2197
+ }
2198
+ else {
2199
+ return 'an object';
2200
+ }
2201
+ default:
2202
+ return JSON.stringify(json);
2203
+ }
2204
+ };
2205
+ var expectedGot = function (expected, got) {
2206
+ return "expected " + expected + ", got " + typeString(got);
2207
+ };
2208
+ var printPath = function (paths) {
2209
+ return paths.map(function (path) { return (typeof path === 'string' ? "." + path : "[" + path + "]"); }).join('');
2210
+ };
2211
+ var prependAt = function (newAt, _a) {
2212
+ var at = _a.at, rest = __rest(_a, ["at"]);
2213
+ return (__assign({ at: newAt + (at || '') }, rest));
2214
+ };
2215
+ /**
2216
+ * Decoders transform json objects with unknown structure into known and
2217
+ * verified forms. You can create objects of type `Decoder<A>` with either the
2218
+ * primitive decoder functions, such as `boolean()` and `string()`, or by
2219
+ * applying higher-order decoders to the primitives, such as `array(boolean())`
2220
+ * or `dict(string())`.
2221
+ *
2222
+ * Each of the decoder functions are available both as a static method on
2223
+ * `Decoder` and as a function alias -- for example the string decoder is
2224
+ * defined at `Decoder.string()`, but is also aliased to `string()`. Using the
2225
+ * function aliases exported with the library is recommended.
2226
+ *
2227
+ * `Decoder` exposes a number of 'run' methods, which all decode json in the
2228
+ * same way, but communicate success and failure in different ways. The `map`
2229
+ * and `andThen` methods modify decoders without having to call a 'run' method.
2230
+ *
2231
+ * Alternatively, the main decoder `run()` method returns an object of type
2232
+ * `Result<A, DecoderError>`. This library provides a number of helper
2233
+ * functions for dealing with the `Result` type, so you can do all the same
2234
+ * things with a `Result` as with the decoder methods.
2235
+ */
2236
+ var Decoder = /** @class */ (function () {
2237
+ /**
2238
+ * The Decoder class constructor is kept private to separate the internal
2239
+ * `decode` function from the external `run` function. The distinction
2240
+ * between the two functions is that `decode` returns a
2241
+ * `Partial<DecoderError>` on failure, which contains an unfinished error
2242
+ * report. When `run` is called on a decoder, the relevant series of `decode`
2243
+ * calls is made, and then on failure the resulting `Partial<DecoderError>`
2244
+ * is turned into a `DecoderError` by filling in the missing information.
2245
+ *
2246
+ * While hiding the constructor may seem restrictive, leveraging the
2247
+ * provided decoder combinators and helper functions such as
2248
+ * `andThen` and `map` should be enough to build specialized decoders as
2249
+ * needed.
2250
+ */
2251
+ function Decoder(decode) {
2252
+ var _this = this;
2253
+ this.decode = decode;
2254
+ /**
2255
+ * Run the decoder and return a `Result` with either the decoded value or a
2256
+ * `DecoderError` containing the json input, the location of the error, and
2257
+ * the error message.
2258
+ *
2259
+ * Examples:
2260
+ * ```
2261
+ * number().run(12)
2262
+ * // => {ok: true, result: 12}
2263
+ *
2264
+ * string().run(9001)
2265
+ * // =>
2266
+ * // {
2267
+ * // ok: false,
2268
+ * // error: {
2269
+ * // kind: 'DecoderError',
2270
+ * // input: 9001,
2271
+ * // at: 'input',
2272
+ * // message: 'expected a string, got 9001'
2273
+ * // }
2274
+ * // }
2275
+ * ```
2276
+ */
2277
+ this.run = function (json) {
2278
+ return mapError(function (error) { return ({
2279
+ kind: 'DecoderError',
2280
+ input: json,
2281
+ at: 'input' + (error.at || ''),
2282
+ message: error.message || ''
2283
+ }); }, _this.decode(json));
2284
+ };
2285
+ /**
2286
+ * Run the decoder as a `Promise`.
2287
+ */
2288
+ this.runPromise = function (json) { return asPromise(_this.run(json)); };
2289
+ /**
2290
+ * Run the decoder and return the value on success, or throw an exception
2291
+ * with a formatted error string.
2292
+ */
2293
+ this.runWithException = function (json) { return withException(_this.run(json)); };
2294
+ /**
2295
+ * Construct a new decoder that applies a transformation to the decoded
2296
+ * result. If the decoder succeeds then `f` will be applied to the value. If
2297
+ * it fails the error will propagated through.
2298
+ *
2299
+ * Example:
2300
+ * ```
2301
+ * number().map(x => x * 5).run(10)
2302
+ * // => {ok: true, result: 50}
2303
+ * ```
2304
+ */
2305
+ this.map = function (f) {
2306
+ return new Decoder(function (json) { return map(f, _this.decode(json)); });
2307
+ };
2308
+ /**
2309
+ * Chain together a sequence of decoders. The first decoder will run, and
2310
+ * then the function will determine what decoder to run second. If the result
2311
+ * of the first decoder succeeds then `f` will be applied to the decoded
2312
+ * value. If it fails the error will propagate through.
2313
+ *
2314
+ * This is a very powerful method -- it can act as both the `map` and `where`
2315
+ * methods, can improve error messages for edge cases, and can be used to
2316
+ * make a decoder for custom types.
2317
+ *
2318
+ * Example of adding an error message:
2319
+ * ```
2320
+ * const versionDecoder = valueAt(['version'], number());
2321
+ * const infoDecoder3 = object({a: boolean()});
2322
+ *
2323
+ * const decoder = versionDecoder.andThen(version => {
2324
+ * switch (version) {
2325
+ * case 3:
2326
+ * return infoDecoder3;
2327
+ * default:
2328
+ * return fail(`Unable to decode info, version ${version} is not supported.`);
2329
+ * }
2330
+ * });
2331
+ *
2332
+ * decoder.run({version: 3, a: true})
2333
+ * // => {ok: true, result: {a: true}}
2334
+ *
2335
+ * decoder.run({version: 5, x: 'abc'})
2336
+ * // =>
2337
+ * // {
2338
+ * // ok: false,
2339
+ * // error: {... message: 'Unable to decode info, version 5 is not supported.'}
2340
+ * // }
2341
+ * ```
2342
+ *
2343
+ * Example of decoding a custom type:
2344
+ * ```
2345
+ * // nominal type for arrays with a length of at least one
2346
+ * type NonEmptyArray<T> = T[] & { __nonEmptyArrayBrand__: void };
2347
+ *
2348
+ * const nonEmptyArrayDecoder = <T>(values: Decoder<T>): Decoder<NonEmptyArray<T>> =>
2349
+ * array(values).andThen(arr =>
2350
+ * arr.length > 0
2351
+ * ? succeed(createNonEmptyArray(arr))
2352
+ * : fail(`expected a non-empty array, got an empty array`)
2353
+ * );
2354
+ * ```
2355
+ */
2356
+ this.andThen = function (f) {
2357
+ return new Decoder(function (json) {
2358
+ return andThen(function (value) { return f(value).decode(json); }, _this.decode(json));
2359
+ });
2360
+ };
2361
+ /**
2362
+ * Add constraints to a decoder _without_ changing the resulting type. The
2363
+ * `test` argument is a predicate function which returns true for valid
2364
+ * inputs. When `test` fails on an input, the decoder fails with the given
2365
+ * `errorMessage`.
2366
+ *
2367
+ * ```
2368
+ * const chars = (length: number): Decoder<string> =>
2369
+ * string().where(
2370
+ * (s: string) => s.length === length,
2371
+ * `expected a string of length ${length}`
2372
+ * );
2373
+ *
2374
+ * chars(5).run('12345')
2375
+ * // => {ok: true, result: '12345'}
2376
+ *
2377
+ * chars(2).run('HELLO')
2378
+ * // => {ok: false, error: {... message: 'expected a string of length 2'}}
2379
+ *
2380
+ * chars(12).run(true)
2381
+ * // => {ok: false, error: {... message: 'expected a string, got a boolean'}}
2382
+ * ```
2383
+ */
2384
+ this.where = function (test, errorMessage) {
2385
+ return _this.andThen(function (value) { return (test(value) ? Decoder.succeed(value) : Decoder.fail(errorMessage)); });
2386
+ };
2387
+ }
2388
+ /**
2389
+ * Decoder primitive that validates strings, and fails on all other input.
2390
+ */
2391
+ Decoder.string = function () {
2392
+ return new Decoder(function (json) {
2393
+ return typeof json === 'string'
2394
+ ? ok(json)
2395
+ : err({ message: expectedGot('a string', json) });
2396
+ });
2397
+ };
2398
+ /**
2399
+ * Decoder primitive that validates numbers, and fails on all other input.
2400
+ */
2401
+ Decoder.number = function () {
2402
+ return new Decoder(function (json) {
2403
+ return typeof json === 'number'
2404
+ ? ok(json)
2405
+ : err({ message: expectedGot('a number', json) });
2406
+ });
2407
+ };
2408
+ /**
2409
+ * Decoder primitive that validates booleans, and fails on all other input.
2410
+ */
2411
+ Decoder.boolean = function () {
2412
+ return new Decoder(function (json) {
2413
+ return typeof json === 'boolean'
2414
+ ? ok(json)
2415
+ : err({ message: expectedGot('a boolean', json) });
2416
+ });
2417
+ };
2418
+ Decoder.constant = function (value) {
2419
+ return new Decoder(function (json) {
2420
+ return isEqual(json, value)
2421
+ ? ok(value)
2422
+ : err({ message: "expected " + JSON.stringify(value) + ", got " + JSON.stringify(json) });
2423
+ });
2424
+ };
2425
+ Decoder.object = function (decoders) {
2426
+ return new Decoder(function (json) {
2427
+ if (isJsonObject(json) && decoders) {
2428
+ var obj = {};
2429
+ for (var key in decoders) {
2430
+ if (decoders.hasOwnProperty(key)) {
2431
+ var r = decoders[key].decode(json[key]);
2432
+ if (r.ok === true) {
2433
+ // tslint:disable-next-line:strict-type-predicates
2434
+ if (r.result !== undefined) {
2435
+ obj[key] = r.result;
2436
+ }
2437
+ }
2438
+ else if (json[key] === undefined) {
2439
+ return err({ message: "the key '" + key + "' is required but was not present" });
2440
+ }
2441
+ else {
2442
+ return err(prependAt("." + key, r.error));
2443
+ }
2444
+ }
2445
+ }
2446
+ return ok(obj);
2447
+ }
2448
+ else if (isJsonObject(json)) {
2449
+ return ok(json);
2450
+ }
2451
+ else {
2452
+ return err({ message: expectedGot('an object', json) });
2453
+ }
2454
+ });
2455
+ };
2456
+ Decoder.array = function (decoder) {
2457
+ return new Decoder(function (json) {
2458
+ if (isJsonArray(json) && decoder) {
2459
+ var decodeValue_1 = function (v, i) {
2460
+ return mapError(function (err$$1) { return prependAt("[" + i + "]", err$$1); }, decoder.decode(v));
2461
+ };
2462
+ return json.reduce(function (acc, v, i) {
2463
+ return map2(function (arr, result) { return arr.concat([result]); }, acc, decodeValue_1(v, i));
2464
+ }, ok([]));
2465
+ }
2466
+ else if (isJsonArray(json)) {
2467
+ return ok(json);
2468
+ }
2469
+ else {
2470
+ return err({ message: expectedGot('an array', json) });
2471
+ }
2472
+ });
2473
+ };
2474
+ Decoder.tuple = function (decoders) {
2475
+ return new Decoder(function (json) {
2476
+ if (isJsonArray(json)) {
2477
+ if (json.length !== decoders.length) {
2478
+ return err({
2479
+ message: "expected a tuple of length " + decoders.length + ", got one of length " + json.length
2480
+ });
2481
+ }
2482
+ var result = [];
2483
+ for (var i = 0; i < decoders.length; i++) {
2484
+ var nth = decoders[i].decode(json[i]);
2485
+ if (nth.ok) {
2486
+ result[i] = nth.result;
2487
+ }
2488
+ else {
2489
+ return err(prependAt("[" + i + "]", nth.error));
2490
+ }
2491
+ }
2492
+ return ok(result);
2493
+ }
2494
+ else {
2495
+ return err({ message: expectedGot("a tuple of length " + decoders.length, json) });
2496
+ }
2497
+ });
2498
+ };
2499
+ Decoder.union = function (ad, bd) {
2500
+ var decoders = [];
2501
+ for (var _i = 2; _i < arguments.length; _i++) {
2502
+ decoders[_i - 2] = arguments[_i];
2503
+ }
2504
+ return Decoder.oneOf.apply(Decoder, [ad, bd].concat(decoders));
2505
+ };
2506
+ Decoder.intersection = function (ad, bd) {
2507
+ var ds = [];
2508
+ for (var _i = 2; _i < arguments.length; _i++) {
2509
+ ds[_i - 2] = arguments[_i];
2510
+ }
2511
+ return new Decoder(function (json) {
2512
+ return [ad, bd].concat(ds).reduce(function (acc, decoder) { return map2(Object.assign, acc, decoder.decode(json)); }, ok({}));
2513
+ });
2514
+ };
2515
+ /**
2516
+ * Escape hatch to bypass validation. Always succeeds and types the result as
2517
+ * `any`. Useful for defining decoders incrementally, particularly for
2518
+ * complex objects.
2519
+ *
2520
+ * Example:
2521
+ * ```
2522
+ * interface User {
2523
+ * name: string;
2524
+ * complexUserData: ComplexType;
2525
+ * }
2526
+ *
2527
+ * const userDecoder: Decoder<User> = object({
2528
+ * name: string(),
2529
+ * complexUserData: anyJson()
2530
+ * });
2531
+ * ```
2532
+ */
2533
+ Decoder.anyJson = function () { return new Decoder(function (json) { return ok(json); }); };
2534
+ /**
2535
+ * Decoder identity function which always succeeds and types the result as
2536
+ * `unknown`.
2537
+ */
2538
+ Decoder.unknownJson = function () {
2539
+ return new Decoder(function (json) { return ok(json); });
2540
+ };
2541
+ /**
2542
+ * Decoder for json objects where the keys are unknown strings, but the values
2543
+ * should all be of the same type.
2544
+ *
2545
+ * Example:
2546
+ * ```
2547
+ * dict(number()).run({chocolate: 12, vanilla: 10, mint: 37});
2548
+ * // => {ok: true, result: {chocolate: 12, vanilla: 10, mint: 37}}
2549
+ * ```
2550
+ */
2551
+ Decoder.dict = function (decoder) {
2552
+ return new Decoder(function (json) {
2553
+ if (isJsonObject(json)) {
2554
+ var obj = {};
2555
+ for (var key in json) {
2556
+ if (json.hasOwnProperty(key)) {
2557
+ var r = decoder.decode(json[key]);
2558
+ if (r.ok === true) {
2559
+ obj[key] = r.result;
2560
+ }
2561
+ else {
2562
+ return err(prependAt("." + key, r.error));
2563
+ }
2564
+ }
2565
+ }
2566
+ return ok(obj);
2567
+ }
2568
+ else {
2569
+ return err({ message: expectedGot('an object', json) });
2570
+ }
2571
+ });
2572
+ };
2573
+ /**
2574
+ * Decoder for values that may be `undefined`. This is primarily helpful for
2575
+ * decoding interfaces with optional fields.
2576
+ *
2577
+ * Example:
2578
+ * ```
2579
+ * interface User {
2580
+ * id: number;
2581
+ * isOwner?: boolean;
2582
+ * }
2583
+ *
2584
+ * const decoder: Decoder<User> = object({
2585
+ * id: number(),
2586
+ * isOwner: optional(boolean())
2587
+ * });
2588
+ * ```
2589
+ */
2590
+ Decoder.optional = function (decoder) {
2591
+ return new Decoder(function (json) { return (json === undefined ? ok(undefined) : decoder.decode(json)); });
2592
+ };
2593
+ /**
2594
+ * Decoder that attempts to run each decoder in `decoders` and either succeeds
2595
+ * with the first successful decoder, or fails after all decoders have failed.
2596
+ *
2597
+ * Note that `oneOf` expects the decoders to all have the same return type,
2598
+ * while `union` creates a decoder for the union type of all the input
2599
+ * decoders.
2600
+ *
2601
+ * Examples:
2602
+ * ```
2603
+ * oneOf(string(), number().map(String))
2604
+ * oneOf(constant('start'), constant('stop'), succeed('unknown'))
2605
+ * ```
2606
+ */
2607
+ Decoder.oneOf = function () {
2608
+ var decoders = [];
2609
+ for (var _i = 0; _i < arguments.length; _i++) {
2610
+ decoders[_i] = arguments[_i];
2611
+ }
2612
+ return new Decoder(function (json) {
2613
+ var errors = [];
2614
+ for (var i = 0; i < decoders.length; i++) {
2615
+ var r = decoders[i].decode(json);
2616
+ if (r.ok === true) {
2617
+ return r;
2618
+ }
2619
+ else {
2620
+ errors[i] = r.error;
2621
+ }
2622
+ }
2623
+ var errorsList = errors
2624
+ .map(function (error) { return "at error" + (error.at || '') + ": " + error.message; })
2625
+ .join('", "');
2626
+ return err({
2627
+ message: "expected a value matching one of the decoders, got the errors [\"" + errorsList + "\"]"
2628
+ });
2629
+ });
2630
+ };
2631
+ /**
2632
+ * Decoder that always succeeds with either the decoded value, or a fallback
2633
+ * default value.
2634
+ */
2635
+ Decoder.withDefault = function (defaultValue, decoder) {
2636
+ return new Decoder(function (json) {
2637
+ return ok(withDefault(defaultValue, decoder.decode(json)));
2638
+ });
2639
+ };
2640
+ /**
2641
+ * Decoder that pulls a specific field out of a json structure, instead of
2642
+ * decoding and returning the full structure. The `paths` array describes the
2643
+ * object keys and array indices to traverse, so that values can be pulled out
2644
+ * of a nested structure.
2645
+ *
2646
+ * Example:
2647
+ * ```
2648
+ * const decoder = valueAt(['a', 'b', 0], string());
2649
+ *
2650
+ * decoder.run({a: {b: ['surprise!']}})
2651
+ * // => {ok: true, result: 'surprise!'}
2652
+ *
2653
+ * decoder.run({a: {x: 'cats'}})
2654
+ * // => {ok: false, error: {... at: 'input.a.b[0]' message: 'path does not exist'}}
2655
+ * ```
2656
+ *
2657
+ * Note that the `decoder` is ran on the value found at the last key in the
2658
+ * path, even if the last key is not found. This allows the `optional`
2659
+ * decoder to succeed when appropriate.
2660
+ * ```
2661
+ * const optionalDecoder = valueAt(['a', 'b', 'c'], optional(string()));
2662
+ *
2663
+ * optionalDecoder.run({a: {b: {c: 'surprise!'}}})
2664
+ * // => {ok: true, result: 'surprise!'}
2665
+ *
2666
+ * optionalDecoder.run({a: {b: 'cats'}})
2667
+ * // => {ok: false, error: {... at: 'input.a.b.c' message: 'expected an object, got "cats"'}
2668
+ *
2669
+ * optionalDecoder.run({a: {b: {z: 1}}})
2670
+ * // => {ok: true, result: undefined}
2671
+ * ```
2672
+ */
2673
+ Decoder.valueAt = function (paths, decoder) {
2674
+ return new Decoder(function (json) {
2675
+ var jsonAtPath = json;
2676
+ for (var i = 0; i < paths.length; i++) {
2677
+ if (jsonAtPath === undefined) {
2678
+ return err({
2679
+ at: printPath(paths.slice(0, i + 1)),
2680
+ message: 'path does not exist'
2681
+ });
2682
+ }
2683
+ else if (typeof paths[i] === 'string' && !isJsonObject(jsonAtPath)) {
2684
+ return err({
2685
+ at: printPath(paths.slice(0, i + 1)),
2686
+ message: expectedGot('an object', jsonAtPath)
2687
+ });
2688
+ }
2689
+ else if (typeof paths[i] === 'number' && !isJsonArray(jsonAtPath)) {
2690
+ return err({
2691
+ at: printPath(paths.slice(0, i + 1)),
2692
+ message: expectedGot('an array', jsonAtPath)
2693
+ });
2694
+ }
2695
+ else {
2696
+ jsonAtPath = jsonAtPath[paths[i]];
2697
+ }
2698
+ }
2699
+ return mapError(function (error) {
2700
+ return jsonAtPath === undefined
2701
+ ? { at: printPath(paths), message: 'path does not exist' }
2702
+ : prependAt(printPath(paths), error);
2703
+ }, decoder.decode(jsonAtPath));
2704
+ });
2705
+ };
2706
+ /**
2707
+ * Decoder that ignores the input json and always succeeds with `fixedValue`.
2708
+ */
2709
+ Decoder.succeed = function (fixedValue) {
2710
+ return new Decoder(function (json) { return ok(fixedValue); });
2711
+ };
2712
+ /**
2713
+ * Decoder that ignores the input json and always fails with `errorMessage`.
2714
+ */
2715
+ Decoder.fail = function (errorMessage) {
2716
+ return new Decoder(function (json) { return err({ message: errorMessage }); });
2717
+ };
2718
+ /**
2719
+ * Decoder that allows for validating recursive data structures. Unlike with
2720
+ * functions, decoders assigned to variables can't reference themselves
2721
+ * before they are fully defined. We can avoid prematurely referencing the
2722
+ * decoder by wrapping it in a function that won't be called until use, at
2723
+ * which point the decoder has been defined.
2724
+ *
2725
+ * Example:
2726
+ * ```
2727
+ * interface Comment {
2728
+ * msg: string;
2729
+ * replies: Comment[];
2730
+ * }
2731
+ *
2732
+ * const decoder: Decoder<Comment> = object({
2733
+ * msg: string(),
2734
+ * replies: lazy(() => array(decoder))
2735
+ * });
2736
+ * ```
2737
+ */
2738
+ Decoder.lazy = function (mkDecoder) {
2739
+ return new Decoder(function (json) { return mkDecoder().decode(json); });
2740
+ };
2741
+ return Decoder;
2742
+ }());
2743
+
2744
+ /* tslint:disable:variable-name */
2745
+ /** See `Decoder.string` */
2746
+ var string = Decoder.string;
2747
+ /** See `Decoder.number` */
2748
+ var number = Decoder.number;
2749
+ /** See `Decoder.boolean` */
2750
+ var boolean = Decoder.boolean;
2751
+ /** See `Decoder.anyJson` */
2752
+ var anyJson = Decoder.anyJson;
2753
+ /** See `Decoder.unknownJson` */
2754
+ var unknownJson = Decoder.unknownJson;
2755
+ /** See `Decoder.constant` */
2756
+ var constant = Decoder.constant;
2757
+ /** See `Decoder.object` */
2758
+ var object = Decoder.object;
2759
+ /** See `Decoder.array` */
2760
+ var array = Decoder.array;
2761
+ /** See `Decoder.tuple` */
2762
+ var tuple = Decoder.tuple;
2763
+ /** See `Decoder.dict` */
2764
+ var dict = Decoder.dict;
2765
+ /** See `Decoder.optional` */
2766
+ var optional = Decoder.optional;
2767
+ /** See `Decoder.oneOf` */
2768
+ var oneOf = Decoder.oneOf;
2769
+ /** See `Decoder.union` */
2770
+ var union = Decoder.union;
2771
+ /** See `Decoder.intersection` */
2772
+ var intersection = Decoder.intersection;
2773
+ /** See `Decoder.withDefault` */
2774
+ var withDefault$1 = Decoder.withDefault;
2775
+ /** See `Decoder.valueAt` */
2776
+ var valueAt = Decoder.valueAt;
2777
+ /** See `Decoder.succeed` */
2778
+ var succeed = Decoder.succeed;
2779
+ /** See `Decoder.fail` */
2780
+ var fail = Decoder.fail;
2781
+ /** See `Decoder.lazy` */
2782
+ var lazy = Decoder.lazy;
2783
+
2784
+ var index_es5 = /*#__PURE__*/Object.freeze({
2785
+ __proto__: null,
2786
+ Decoder: Decoder,
2787
+ Result: result,
2788
+ anyJson: anyJson,
2789
+ array: array,
2790
+ boolean: boolean,
2791
+ constant: constant,
2792
+ dict: dict,
2793
+ fail: fail,
2794
+ intersection: intersection,
2795
+ isDecoderError: isDecoderError,
2796
+ lazy: lazy,
2797
+ number: number,
2798
+ object: object,
2799
+ oneOf: oneOf,
2800
+ optional: optional,
2801
+ string: string,
2802
+ succeed: succeed,
2803
+ tuple: tuple,
2804
+ union: union,
2805
+ unknownJson: unknownJson,
2806
+ valueAt: valueAt,
2807
+ withDefault: withDefault$1
2808
+ });
2809
+
2810
+ var require$$0 = /*@__PURE__*/getAugmentedNamespace(index_es5);
2811
+
2812
+ var require$$1 = /*@__PURE__*/getAugmentedNamespace(lodash__namespace);
2813
+
2814
+ var hasRequiredTypes$1;
2815
+
2816
+ function requireTypes$1 () {
2817
+ if (hasRequiredTypes$1) return types;
2818
+ hasRequiredTypes$1 = 1;
2819
+ (function (exports) {
2820
+ var __assign = (types && types.__assign) || function () {
2821
+ __assign = Object.assign || function(t) {
2822
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
2823
+ s = arguments[i];
2824
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
2825
+ t[p] = s[p];
2826
+ }
2827
+ return t;
2828
+ };
2829
+ return __assign.apply(this, arguments);
2830
+ };
2831
+ var __createBinding = (types && types.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2832
+ if (k2 === undefined) k2 = k;
2833
+ var desc = Object.getOwnPropertyDescriptor(m, k);
2834
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2835
+ desc = { enumerable: true, get: function() { return m[k]; } };
2836
+ }
2837
+ Object.defineProperty(o, k2, desc);
2838
+ }) : (function(o, m, k, k2) {
2839
+ if (k2 === undefined) k2 = k;
2840
+ o[k2] = m[k];
2841
+ }));
2842
+ var __setModuleDefault = (types && types.__setModuleDefault) || (Object.create ? (function(o, v) {
2843
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
2844
+ }) : function(o, v) {
2845
+ o["default"] = v;
2846
+ });
2847
+ var __importStar = (types && types.__importStar) || (function () {
2848
+ var ownKeys = function(o) {
2849
+ ownKeys = Object.getOwnPropertyNames || function (o) {
2850
+ var ar = [];
2851
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
2852
+ return ar;
2853
+ };
2854
+ return ownKeys(o);
2855
+ };
2856
+ return function (mod) {
2857
+ if (mod && mod.__esModule) return mod;
2858
+ var result = {};
2859
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
2860
+ __setModuleDefault(result, mod);
2861
+ return result;
2862
+ };
2863
+ })();
2864
+ var __generator = (types && types.__generator) || function (thisArg, body) {
2865
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
2866
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
2867
+ function verb(n) { return function (v) { return step([n, v]); }; }
2868
+ function step(op) {
2869
+ if (f) throw new TypeError("Generator is already executing.");
2870
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
2871
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
2872
+ if (y = 0, t) op = [op[0] & 2, t.value];
2873
+ switch (op[0]) {
2874
+ case 0: case 1: t = op; break;
2875
+ case 4: _.label++; return { value: op[1], done: false };
2876
+ case 5: _.label++; y = op[1]; op = [0]; continue;
2877
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
2878
+ default:
2879
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
2880
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
2881
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
2882
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
2883
+ if (t[2]) _.ops.pop();
2884
+ _.trys.pop(); continue;
2885
+ }
2886
+ op = body.call(thisArg, _);
2887
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
2888
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
2889
+ }
2890
+ };
2891
+ var __importDefault = (types && types.__importDefault) || function (mod) {
2892
+ return (mod && mod.__esModule) ? mod : { "default": mod };
2893
+ };
2894
+ Object.defineProperty(exports, "__esModule", { value: true });
2895
+ exports.Map = exports.emptyMap = exports.TextMap = exports.Optional = exports.ContractId = exports.Date = exports.List = exports.Party = exports.Time = exports.Text = exports.Decimal = exports.Numeric = exports.Int = exports.Bool = exports.Unit = exports.lookupTemplate = exports.templateIdWithPackageId = exports.registerTemplate = void 0;
2896
+ exports.assembleTemplate = assembleTemplate;
2897
+ exports.assembleInterface = assembleInterface;
2898
+ exports.memo = memo;
2899
+ exports.lazyMemo = lazyMemo;
2900
+ // Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
2901
+ // SPDX-License-Identifier: Apache-2.0
2902
+ var jtv = __importStar(require$$0);
2903
+ var lodash_1 = __importDefault(require$$1);
2904
+ function toInterfaceMixin() {
2905
+ return {
2906
+ toInterface: function (_, cid) {
2907
+ return cid;
2908
+ },
2909
+ unsafeFromInterface: function (_, cid) {
2910
+ return cid;
2911
+ },
2912
+ };
2913
+ }
2914
+ /**
2915
+ * @internal
2916
+ */
2917
+ function assembleTemplate(template) {
2918
+ return __assign(__assign({}, toInterfaceMixin()), template);
2919
+ }
2920
+ /**
2921
+ * @internal
2922
+ */
2923
+ function assembleInterface(templateId, templatIdWithPackageId, decoderSource, choices) {
2924
+ return __assign({ templateId: templateId, templateIdWithPackageId: templatIdWithPackageId, componentVersionString: "3.5.2",
2925
+ // `Interface<I> &` is a phantom intersection
2926
+ decoder: lazyMemo(function () { return decoderSource().decoder; }), keyDecoder: jtv.succeed(undefined) }, choices);
2927
+ }
2928
+ /**
2929
+ * @internal
2930
+ */
2931
+ var registeredTemplates = {};
2932
+ /**
2933
+ * @internal
2934
+ */
2935
+ var registerTemplate = function (template, packageSpecifiers) {
2936
+ if (packageSpecifiers === void 0) { packageSpecifiers = []; }
2937
+ var aliases = packageSpecifiers.map((0, exports.templateIdWithPackageId)(template));
2938
+ new Set([template.templateId].concat(aliases)).forEach(function (templateId) {
2939
+ if (templateId in registeredTemplates) {
2940
+ console.warn("Trying to re-register template ".concat(templateId, "."));
2941
+ }
2942
+ else {
2943
+ registeredTemplates[templateId] = template;
2944
+ console.debug("Registered template ".concat(templateId, "."));
2945
+ }
2946
+ });
2947
+ };
2948
+ exports.registerTemplate = registerTemplate;
2949
+ /**
2950
+ * @internal
2951
+ */
2952
+ var templateIdWithPackageId = function (t) {
2953
+ return function (pkgId) {
2954
+ return [pkgId].concat(t.templateId.split(":").slice(1)).join(":");
2955
+ };
2956
+ };
2957
+ exports.templateIdWithPackageId = templateIdWithPackageId;
2958
+ /**
2959
+ * @internal
2960
+ */
2961
+ var lookupTemplate = function (templateId) {
2962
+ var template = registeredTemplates[templateId];
2963
+ if (template === undefined) {
2964
+ throw Error("Failed to look up template ".concat(templateId, ". Make sure your @daml/types version agrees with the used Daml SDK version."));
2965
+ }
2966
+ return template;
2967
+ };
2968
+ exports.lookupTemplate = lookupTemplate;
2969
+ /**
2970
+ * @internal Turn a thunk into a memoized version of itself. The memoized thunk
2971
+ * invokes the original thunk only on its first invocation and caches the result
2972
+ * for later uses. We use this to implement a version of `jtv.lazy` with
2973
+ * memoization.
2974
+ */
2975
+ function memo(thunk) {
2976
+ var memoized = function () {
2977
+ var cache = thunk();
2978
+ memoized = function () { return cache; };
2979
+ return cache;
2980
+ };
2981
+ // NOTE(MH): Since we change `memoized` when the resultung thunk is invoked
2982
+ // for the first time, we need to return it "by reference". Thus, we return
2983
+ // a closure which contains a reference to `memoized`.
2984
+ return function () { return memoized(); };
2985
+ }
2986
+ /**
2987
+ * @internal Variation of `jtv.lazy` which memoizes the computed decoder on its
2988
+ * first invocation.
2989
+ */
2990
+ function lazyMemo(mkDecoder) {
2991
+ return jtv.lazy(memo(mkDecoder));
2992
+ }
2993
+ /**
2994
+ * Companion object of the [[Unit]] type.
2995
+ */
2996
+ exports.Unit = {
2997
+ decoder: jtv.object({}),
2998
+ encode: function (t) { return t; },
2999
+ };
3000
+ /**
3001
+ * Companion object of the [[Bool]] type.
3002
+ */
3003
+ exports.Bool = {
3004
+ decoder: jtv.boolean(),
3005
+ encode: function (b) { return b; },
3006
+ };
3007
+ /**
3008
+ * Companion object of the [[Int]] type.
3009
+ */
3010
+ exports.Int = {
3011
+ decoder: jtv.string(),
3012
+ encode: function (i) { return i; },
3013
+ };
3014
+ /**
3015
+ * Companion function of the [[Numeric]] type.
3016
+ */
3017
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3018
+ var Numeric = function (_) { return ({
3019
+ decoder: jtv.string(),
3020
+ encode: function (n) { return n; },
3021
+ }); };
3022
+ exports.Numeric = Numeric;
3023
+ /**
3024
+ * Companion object of the [[Decimal]] type.
3025
+ */
3026
+ exports.Decimal = (0, exports.Numeric)(10);
3027
+ /**
3028
+ * Companion object of the [[Text]] type.
3029
+ */
3030
+ exports.Text = {
3031
+ decoder: jtv.string(),
3032
+ encode: function (t) { return t; },
3033
+ };
3034
+ /**
3035
+ * Companion object of the [[Time]] type.
3036
+ */
3037
+ exports.Time = {
3038
+ decoder: jtv.string(),
3039
+ encode: function (t) { return t; },
3040
+ };
3041
+ /**
3042
+ * Companion object of the [[Party]] type.
3043
+ */
3044
+ exports.Party = {
3045
+ decoder: jtv.string(),
3046
+ encode: function (p) { return p; },
3047
+ };
3048
+ /**
3049
+ * Companion object of the [[List]] type.
3050
+ */
3051
+ var List = function (t) { return ({
3052
+ decoder: jtv.array(t.decoder),
3053
+ encode: function (l) { return l.map(function (element) { return t.encode(element); }); },
3054
+ }); };
3055
+ exports.List = List;
3056
+ /**
3057
+ * Companion object of the [[Date]] type.
3058
+ */
3059
+ exports.Date = {
3060
+ decoder: jtv.string(),
3061
+ encode: function (d) { return d; },
3062
+ };
3063
+ /**
3064
+ * Companion object of the [[ContractId]] type.
3065
+ */
3066
+ var ContractId = function (_t) { return ({
3067
+ decoder: jtv.string(),
3068
+ encode: function (c) { return c; },
3069
+ }); };
3070
+ exports.ContractId = ContractId;
3071
+ /**
3072
+ * This class does the actual work behind the [[Optional]] companion function. In addition to
3073
+ * implementing the [[Serializable]] interface it also stores the [[Serializable]] instance of the
3074
+ * payload of the [[Optional]] and uses it to provide a decoder for the [[OptionalInner]] type.
3075
+ *
3076
+ * @typeparam T The type of the optionally present value.
3077
+ */
3078
+ var OptionalWorker = /** @class */ (function () {
3079
+ function OptionalWorker(payload) {
3080
+ if (payload instanceof OptionalWorker) {
3081
+ var payloadInnerDecoder = payload.innerDecoder;
3082
+ this.innerDecoder = jtv.oneOf(jtv.constant([]), jtv.tuple([payloadInnerDecoder]));
3083
+ this.encode = function (o) {
3084
+ if (o === null) {
3085
+ // Top-level enclosing Optional where the type argument is also
3086
+ // Optional and we represent None.
3087
+ return null;
3088
+ }
3089
+ else {
3090
+ // The current type is Optional<Optional<...>> and the current value
3091
+ // is Some x. Therefore the nested value is represented as [] for
3092
+ // x = None or as [y] for x = Some y. In both cases mapping the
3093
+ // encoder of the type parameter does the right thing.
3094
+ return o.map(function (nested) { return payload.encode(nested); });
3095
+ }
3096
+ };
3097
+ }
3098
+ else {
3099
+ // NOTE(MH): `T` is not of the form `Optional<U>` here and hence `null`
3100
+ // does not extend `T`. Thus, `OptionalInner<T> = T`.
3101
+ this.innerDecoder = payload.decoder;
3102
+ this.encode = function (o) {
3103
+ if (o === null) {
3104
+ // This branch is only reached if we are at the top-level and the
3105
+ // entire type is a non-nested Optional, i.e. Optional<U> where U is
3106
+ // not Optional. Recursive calls from the other branch would stop
3107
+ // before reaching this case, as nested None are empty lists and
3108
+ // never null.
3109
+ return null;
3110
+ }
3111
+ else {
3112
+ return payload.encode(o);
3113
+ }
3114
+ };
3115
+ }
3116
+ this.decoder = jtv
3117
+ .optional(jtv.oneOf(jtv.constant(null), this.innerDecoder))
3118
+ .map(function (x) { return (x === undefined ? null : x); });
3119
+ }
3120
+ return OptionalWorker;
3121
+ }());
3122
+ /**
3123
+ * Companion function of the [[Optional]] type.
3124
+ */
3125
+ var Optional = function (t) {
3126
+ return new OptionalWorker(t);
3127
+ };
3128
+ exports.Optional = Optional;
3129
+ /**
3130
+ * Companion object of the [[TextMap]] type.
3131
+ */
3132
+ var TextMap = function (t) { return ({
3133
+ decoder: jtv.dict(t.decoder),
3134
+ encode: function (tm) {
3135
+ var out = {};
3136
+ Object.keys(tm).forEach(function (k) {
3137
+ out[k] = t.encode(tm[k]);
3138
+ });
3139
+ return out;
3140
+ },
3141
+ }); };
3142
+ exports.TextMap = TextMap;
3143
+ function it(arr) {
3144
+ var i;
3145
+ return __generator(this, function (_a) {
3146
+ switch (_a.label) {
3147
+ case 0:
3148
+ i = 0;
3149
+ _a.label = 1;
3150
+ case 1:
3151
+ if (!(i < arr.length)) return [3 /*break*/, 4];
3152
+ return [4 /*yield*/, lodash_1.default.cloneDeep(arr[i])];
3153
+ case 2:
3154
+ _a.sent();
3155
+ _a.label = 3;
3156
+ case 3:
3157
+ i++;
3158
+ return [3 /*break*/, 1];
3159
+ case 4: return [2 /*return*/, undefined];
3160
+ }
3161
+ });
3162
+ }
3163
+ // This code assumes that the decoder is only ever used in decoding values
3164
+ // straight from the API responses, and said raw responses are never reused
3165
+ // afterwards. This should be enforced by this class not being exported and the
3166
+ // daml-ledger module not letting raw JSON responses escape without going
3167
+ // through this.
3168
+ //
3169
+ // Without that assumption, the constructor would need to deep-copy its kvs
3170
+ // argument.
3171
+ var MapImpl = /** @class */ (function () {
3172
+ function MapImpl(kvs) {
3173
+ // sorting done so that generic object deep comparison would find equal
3174
+ // maps equal (as defined by jest's expect().toEqual())
3175
+ this._kvs = lodash_1.default.sortBy(kvs, function (kv) { return JSON.stringify(kv[0]); });
3176
+ this._keys = this._kvs.map(function (e) { return e[0]; });
3177
+ this._values = this._kvs.map(function (e) { return e[1]; });
3178
+ }
3179
+ MapImpl.prototype._idx = function (k) {
3180
+ return this._keys.findIndex(function (l) { return lodash_1.default.isEqual(k, l); });
3181
+ };
3182
+ MapImpl.prototype.has = function (k) {
3183
+ return this._idx(k) !== -1;
3184
+ };
3185
+ MapImpl.prototype.get = function (k) {
3186
+ return lodash_1.default.cloneDeep(this._values[this._idx(k)]);
3187
+ };
3188
+ MapImpl.prototype.set = function (k, v) {
3189
+ if (this.has(k)) {
3190
+ var cpy = this._kvs.slice();
3191
+ cpy[this._idx(k)] = lodash_1.default.cloneDeep([k, v]);
3192
+ return new MapImpl(cpy);
3193
+ }
3194
+ else {
3195
+ var head = lodash_1.default.cloneDeep([[k, v]]);
3196
+ return new MapImpl(head.concat(this._kvs));
3197
+ }
3198
+ };
3199
+ MapImpl.prototype.delete = function (k) {
3200
+ var i = this._idx(k);
3201
+ if (i !== -1) {
3202
+ return new MapImpl(this._kvs.slice(0, i).concat(this._kvs.slice(i + 1)));
3203
+ }
3204
+ else {
3205
+ return this;
3206
+ }
3207
+ };
3208
+ MapImpl.prototype.keys = function () {
3209
+ return it(this._keys);
3210
+ };
3211
+ MapImpl.prototype.values = function () {
3212
+ return it(this._values);
3213
+ };
3214
+ MapImpl.prototype.entries = function () {
3215
+ return it(this._kvs);
3216
+ };
3217
+ MapImpl.prototype.entriesArray = function () {
3218
+ return lodash_1.default.cloneDeep(this._kvs);
3219
+ };
3220
+ MapImpl.prototype.forEach = function (f, u) {
3221
+ var g = u ? f.bind(u) : f;
3222
+ for (var _i = 0, _a = this._kvs; _i < _a.length; _i++) {
3223
+ var _b = _a[_i], k = _b[0], v = _b[1];
3224
+ g(v, k, this);
3225
+ }
3226
+ };
3227
+ return MapImpl;
3228
+ }());
3229
+ var emptyMap = function () { return new MapImpl([]); };
3230
+ exports.emptyMap = emptyMap;
3231
+ /**
3232
+ * Companion function of the [[GenMap]] type.
3233
+ */
3234
+ var Map = function (kd, vd) { return ({
3235
+ decoder: jtv
3236
+ .array(jtv.tuple([kd.decoder, vd.decoder]))
3237
+ .map(function (kvs) { return new MapImpl(kvs); }),
3238
+ encode: function (m) {
3239
+ return m.entriesArray().map(function (e) { return [kd.encode(e[0]), vd.encode(e[1])]; });
3240
+ },
3241
+ }); };
3242
+ exports.Map = Map;
3243
+
3244
+ } (types));
3245
+ return types;
3246
+ }
142
3247
 
143
3248
  var lib$1 = {};
144
3249
 
@@ -158,9 +3263,9 @@ function requireModule$7 () {
158
3263
  (function (exports) {
159
3264
  Object.defineProperty(exports, "__esModule", { value: true });
160
3265
  /* eslint-disable-next-line no-unused-vars */
161
- var jtv = require$$0;
3266
+ var jtv = require$$0$1;
162
3267
  /* eslint-disable-next-line no-unused-vars */
163
- var damlTypes = require$$1;
3268
+ var damlTypes = requireTypes$1();
164
3269
 
165
3270
 
166
3271
  exports.Archive = {
@@ -254,9 +3359,9 @@ function requireModule$6 () {
254
3359
  (function (exports) {
255
3360
  Object.defineProperty(exports, "__esModule", { value: true });
256
3361
  /* eslint-disable-next-line no-unused-vars */
257
- var jtv = require$$0;
3362
+ var jtv = require$$0$1;
258
3363
  /* eslint-disable-next-line no-unused-vars */
259
- var damlTypes = require$$1;
3364
+ var damlTypes = requireTypes$1();
260
3365
 
261
3366
 
262
3367
  exports.RelTime = {
@@ -339,9 +3444,9 @@ function requireModule$5 () {
339
3444
  (function (exports) {
340
3445
  Object.defineProperty(exports, "__esModule", { value: true });
341
3446
  /* eslint-disable-next-line no-unused-vars */
342
- var jtv = require$$0;
3447
+ var jtv = require$$0$1;
343
3448
  /* eslint-disable-next-line no-unused-vars */
344
- var damlTypes = require$$1;
3449
+ var damlTypes = requireTypes$1();
345
3450
 
346
3451
  var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = requireLib$2();
347
3452
  var pkgb70db8369e1c461d5c70f1c86f526a29e9776c655e6ffc2560f95b05ccb8b946 = requireLib$1();
@@ -455,9 +3560,9 @@ function requireModule$4 () {
455
3560
  (function (exports) {
456
3561
  Object.defineProperty(exports, "__esModule", { value: true });
457
3562
  /* eslint-disable-next-line no-unused-vars */
458
- var jtv = require$$0;
3563
+ var jtv = require$$0$1;
459
3564
  /* eslint-disable-next-line no-unused-vars */
460
- var damlTypes = require$$1;
3565
+ var damlTypes = requireTypes$1();
461
3566
 
462
3567
  var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = requireLib$2();
463
3568
  var pkgb70db8369e1c461d5c70f1c86f526a29e9776c655e6ffc2560f95b05ccb8b946 = requireLib$1();
@@ -534,9 +3639,9 @@ function requireModule$3 () {
534
3639
  (function (exports) {
535
3640
  Object.defineProperty(exports, "__esModule", { value: true });
536
3641
  /* eslint-disable-next-line no-unused-vars */
537
- var jtv = require$$0;
3642
+ var jtv = require$$0$1;
538
3643
  /* eslint-disable-next-line no-unused-vars */
539
- var damlTypes = require$$1;
3644
+ var damlTypes = requireTypes$1();
540
3645
 
541
3646
  var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = requireLib$2();
542
3647
 
@@ -743,9 +3848,9 @@ function requireModule$2 () {
743
3848
  (function (exports) {
744
3849
  Object.defineProperty(exports, "__esModule", { value: true });
745
3850
  /* eslint-disable-next-line no-unused-vars */
746
- var jtv = require$$0;
3851
+ var jtv = require$$0$1;
747
3852
  /* eslint-disable-next-line no-unused-vars */
748
- var damlTypes = require$$1;
3853
+ var damlTypes = requireTypes$1();
749
3854
 
750
3855
  var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = requireLib$2();
751
3856
 
@@ -983,9 +4088,9 @@ function requireModule$1 () {
983
4088
  (function (exports) {
984
4089
  Object.defineProperty(exports, "__esModule", { value: true });
985
4090
  /* eslint-disable-next-line no-unused-vars */
986
- var jtv = require$$0;
4091
+ var jtv = require$$0$1;
987
4092
  /* eslint-disable-next-line no-unused-vars */
988
- var damlTypes = require$$1;
4093
+ var damlTypes = requireTypes$1();
989
4094
 
990
4095
  var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = requireLib$2();
991
4096
 
@@ -1151,9 +4256,9 @@ function requireModule () {
1151
4256
  (function (exports) {
1152
4257
  Object.defineProperty(exports, "__esModule", { value: true });
1153
4258
  /* eslint-disable-next-line no-unused-vars */
1154
- var jtv = require$$0;
4259
+ var jtv = require$$0$1;
1155
4260
  /* eslint-disable-next-line no-unused-vars */
1156
- var damlTypes = require$$1;
4261
+ var damlTypes = requireTypes$1();
1157
4262
 
1158
4263
  var pkg9e70a8b3510d617f8a136213f33d6a903a10ca0eeec76bb06ba55d1ed9680f69 = requireLib$2();
1159
4264