@bigbinary/neeto-commons-frontend 2.1.7 → 2.1.9

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.
@@ -12,8 +12,9 @@ var reactRouterDom = require('react-router-dom');
12
12
  var pure = require('@bigbinary/neeto-commons-frontend/pure');
13
13
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
14
14
  var axios = require('axios');
15
- var utils = require('@bigbinary/neeto-commons-frontend/utils');
15
+ var utils$3 = require('@bigbinary/neeto-commons-frontend/utils');
16
16
  var reactQuery = require('react-query');
17
+ var require$$0 = require('util');
17
18
  var reactHelmet = require('react-helmet');
18
19
 
19
20
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -40,6 +41,7 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
40
41
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
41
42
  var ErrorPage__default = /*#__PURE__*/_interopDefaultLegacy(ErrorPage);
42
43
  var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
44
+ var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
43
45
 
44
46
  var IGNORABLE_ERRORS_REGEX = /(window\.requestAnimationFrame|ResizeObserver|ChunkLoadError|window\.webkit\.messageHandlers|Request aborted|Network Error)/;
45
47
 
@@ -286,31 +288,31 @@ var QUERY_KEYS = {
286
288
  var QUERY_CACHE_NAME_SPACE = "queryCache";
287
289
  var NEETO_APPS_LIST_STALE_TIME = 30 * 24 * 60 * 60 * 1000; // 30 days
288
290
 
289
- function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
290
- function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
291
+ function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
292
+ function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$3(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
291
293
  var useFetchNeetoApps = function useFetchNeetoApps(options) {
292
294
  var _globalProps$user;
293
295
  var scopedQueryKey = "".concat(QUERY_KEYS.NEETO_APPS_LIST, "-").concat((_globalProps$user = globalProps.user) === null || _globalProps$user === void 0 ? void 0 : _globalProps$user.id);
294
296
  var neetoApps = reactUtils.usePersistedQuery.getCache(scopedQueryKey);
295
- return reactUtils.usePersistedQuery(scopedQueryKey, neetoAppsApi.fetch, _objectSpread$2({
297
+ return reactUtils.usePersistedQuery(scopedQueryKey, neetoAppsApi.fetch, _objectSpread$3({
296
298
  staleTime: NEETO_APPS_LIST_STALE_TIME,
297
299
  enabled: pure.isNotPresent(neetoApps === null || neetoApps === void 0 ? void 0 : neetoApps.data)
298
300
  }, options));
299
301
  };
300
302
 
301
- function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
302
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
303
+ function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
304
+ function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$2(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
303
305
  var localStorageQueryCache = {
304
306
  set: function set(key, data) {
305
307
  var cache = localStorageQueryCache.getAll();
306
- var newCache = _objectSpread$1(_objectSpread$1({}, cache), {}, _defineProperty({}, key, {
308
+ var newCache = _objectSpread$2(_objectSpread$2({}, cache), {}, _defineProperty({}, key, {
307
309
  data: data,
308
310
  modifiedAt: Date.now()
309
311
  }));
310
312
  localStorage.setItem(QUERY_CACHE_NAME_SPACE, JSON.stringify(newCache));
311
313
  },
312
314
  getAll: function getAll() {
313
- var cache = utils.getFromLocalStorage(QUERY_CACHE_NAME_SPACE);
315
+ var cache = utils$3.getFromLocalStorage(QUERY_CACHE_NAME_SPACE);
314
316
  if (!cache) return {};
315
317
  return cache;
316
318
  },
@@ -331,11 +333,11 @@ var usePersistedQuery = function usePersistedQuery(queryKey, fetch, options) {
331
333
  localStorageQueryCache.set(queryKey, queryResult.data);
332
334
  }, [queryKey, queryResult.data, queryResult.isSuccess]);
333
335
  if (isOutdated(localCache, options === null || options === void 0 ? void 0 : options.staleTime)) {
334
- return _objectSpread$1(_objectSpread$1({}, queryResult), {}, {
336
+ return _objectSpread$2(_objectSpread$2({}, queryResult), {}, {
335
337
  isFreshLoading: queryResult.isLoading
336
338
  });
337
339
  }
338
- return _objectSpread$1(_objectSpread$1({}, queryResult), {}, {
340
+ return _objectSpread$2(_objectSpread$2({}, queryResult), {}, {
339
341
  data: queryResult.data || localCache.data,
340
342
  isFreshLoading: false
341
343
  });
@@ -3594,15 +3596,15 @@ var useLocalStorage = function useLocalStorage(key, defaultValue) {
3594
3596
 
3595
3597
  var _excluded = ["keysToInvalidate"],
3596
3598
  _excluded2 = ["onSuccess"];
3597
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3598
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3599
+ function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3600
+ function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
3599
3601
  var useMutationWithInvalidation = function useMutationWithInvalidation(mutationFn, _ref) {
3600
3602
  var keysToInvalidate = _ref.keysToInvalidate,
3601
3603
  options = _objectWithoutProperties(_ref, _excluded);
3602
3604
  var queryClient = reactQuery.useQueryClient();
3603
3605
  var _onSuccess = options.onSuccess,
3604
3606
  otherOptions = _objectWithoutProperties(options, _excluded2);
3605
- return reactQuery.useMutation(mutationFn, _objectSpread({
3607
+ return reactQuery.useMutation(mutationFn, _objectSpread$1({
3606
3608
  onSuccess: function onSuccess(data, variables, context) {
3607
3609
  keysToInvalidate.forEach(function (key) {
3608
3610
  var keyToInvalidate = typeof key === "function" ? key(data, variables, context) : key;
@@ -3639,6 +3641,2048 @@ var usePrevious = function usePrevious(value) {
3639
3641
  return ref.current;
3640
3642
  };
3641
3643
 
3644
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
3645
+ var shams = function hasSymbols() {
3646
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
3647
+ if (typeof Symbol.iterator === 'symbol') { return true; }
3648
+
3649
+ var obj = {};
3650
+ var sym = Symbol('test');
3651
+ var symObj = Object(sym);
3652
+ if (typeof sym === 'string') { return false; }
3653
+
3654
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
3655
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
3656
+
3657
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
3658
+ // if (sym instanceof Symbol) { return false; }
3659
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
3660
+ // if (!(symObj instanceof Symbol)) { return false; }
3661
+
3662
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
3663
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
3664
+
3665
+ var symVal = 42;
3666
+ obj[sym] = symVal;
3667
+ for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
3668
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
3669
+
3670
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
3671
+
3672
+ var syms = Object.getOwnPropertySymbols(obj);
3673
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
3674
+
3675
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
3676
+
3677
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
3678
+ var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
3679
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
3680
+ }
3681
+
3682
+ return true;
3683
+ };
3684
+
3685
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
3686
+ var hasSymbolSham = shams;
3687
+
3688
+ var hasSymbols$1 = function hasNativeSymbols() {
3689
+ if (typeof origSymbol !== 'function') { return false; }
3690
+ if (typeof Symbol !== 'function') { return false; }
3691
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
3692
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
3693
+
3694
+ return hasSymbolSham();
3695
+ };
3696
+
3697
+ /* eslint no-invalid-this: 1 */
3698
+
3699
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
3700
+ var slice = Array.prototype.slice;
3701
+ var toStr$1 = Object.prototype.toString;
3702
+ var funcType = '[object Function]';
3703
+
3704
+ var implementation$1 = function bind(that) {
3705
+ var target = this;
3706
+ if (typeof target !== 'function' || toStr$1.call(target) !== funcType) {
3707
+ throw new TypeError(ERROR_MESSAGE + target);
3708
+ }
3709
+ var args = slice.call(arguments, 1);
3710
+
3711
+ var bound;
3712
+ var binder = function () {
3713
+ if (this instanceof bound) {
3714
+ var result = target.apply(
3715
+ this,
3716
+ args.concat(slice.call(arguments))
3717
+ );
3718
+ if (Object(result) === result) {
3719
+ return result;
3720
+ }
3721
+ return this;
3722
+ } else {
3723
+ return target.apply(
3724
+ that,
3725
+ args.concat(slice.call(arguments))
3726
+ );
3727
+ }
3728
+ };
3729
+
3730
+ var boundLength = Math.max(0, target.length - args.length);
3731
+ var boundArgs = [];
3732
+ for (var i = 0; i < boundLength; i++) {
3733
+ boundArgs.push('$' + i);
3734
+ }
3735
+
3736
+ bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
3737
+
3738
+ if (target.prototype) {
3739
+ var Empty = function Empty() {};
3740
+ Empty.prototype = target.prototype;
3741
+ bound.prototype = new Empty();
3742
+ Empty.prototype = null;
3743
+ }
3744
+
3745
+ return bound;
3746
+ };
3747
+
3748
+ var implementation = implementation$1;
3749
+
3750
+ var functionBind = Function.prototype.bind || implementation;
3751
+
3752
+ var bind$1 = functionBind;
3753
+
3754
+ var src = bind$1.call(Function.call, Object.prototype.hasOwnProperty);
3755
+
3756
+ var undefined$1;
3757
+
3758
+ var $SyntaxError = SyntaxError;
3759
+ var $Function = Function;
3760
+ var $TypeError$1 = TypeError;
3761
+
3762
+ // eslint-disable-next-line consistent-return
3763
+ var getEvalledConstructor = function (expressionSyntax) {
3764
+ try {
3765
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
3766
+ } catch (e) {}
3767
+ };
3768
+
3769
+ var $gOPD = Object.getOwnPropertyDescriptor;
3770
+ if ($gOPD) {
3771
+ try {
3772
+ $gOPD({}, '');
3773
+ } catch (e) {
3774
+ $gOPD = null; // this is IE 8, which has a broken gOPD
3775
+ }
3776
+ }
3777
+
3778
+ var throwTypeError = function () {
3779
+ throw new $TypeError$1();
3780
+ };
3781
+ var ThrowTypeError = $gOPD
3782
+ ? (function () {
3783
+ try {
3784
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
3785
+ arguments.callee; // IE 8 does not throw here
3786
+ return throwTypeError;
3787
+ } catch (calleeThrows) {
3788
+ try {
3789
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
3790
+ return $gOPD(arguments, 'callee').get;
3791
+ } catch (gOPDthrows) {
3792
+ return throwTypeError;
3793
+ }
3794
+ }
3795
+ }())
3796
+ : throwTypeError;
3797
+
3798
+ var hasSymbols = hasSymbols$1();
3799
+
3800
+ var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
3801
+
3802
+ var needsEval = {};
3803
+
3804
+ var TypedArray = typeof Uint8Array === 'undefined' ? undefined$1 : getProto(Uint8Array);
3805
+
3806
+ var INTRINSICS = {
3807
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
3808
+ '%Array%': Array,
3809
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
3810
+ '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined$1,
3811
+ '%AsyncFromSyncIteratorPrototype%': undefined$1,
3812
+ '%AsyncFunction%': needsEval,
3813
+ '%AsyncGenerator%': needsEval,
3814
+ '%AsyncGeneratorFunction%': needsEval,
3815
+ '%AsyncIteratorPrototype%': needsEval,
3816
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
3817
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
3818
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
3819
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
3820
+ '%Boolean%': Boolean,
3821
+ '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
3822
+ '%Date%': Date,
3823
+ '%decodeURI%': decodeURI,
3824
+ '%decodeURIComponent%': decodeURIComponent,
3825
+ '%encodeURI%': encodeURI,
3826
+ '%encodeURIComponent%': encodeURIComponent,
3827
+ '%Error%': Error,
3828
+ '%eval%': eval, // eslint-disable-line no-eval
3829
+ '%EvalError%': EvalError,
3830
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
3831
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
3832
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
3833
+ '%Function%': $Function,
3834
+ '%GeneratorFunction%': needsEval,
3835
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
3836
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
3837
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
3838
+ '%isFinite%': isFinite,
3839
+ '%isNaN%': isNaN,
3840
+ '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
3841
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
3842
+ '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
3843
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
3844
+ '%Math%': Math,
3845
+ '%Number%': Number,
3846
+ '%Object%': Object,
3847
+ '%parseFloat%': parseFloat,
3848
+ '%parseInt%': parseInt,
3849
+ '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
3850
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
3851
+ '%RangeError%': RangeError,
3852
+ '%ReferenceError%': ReferenceError,
3853
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
3854
+ '%RegExp%': RegExp,
3855
+ '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
3856
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
3857
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
3858
+ '%String%': String,
3859
+ '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined$1,
3860
+ '%Symbol%': hasSymbols ? Symbol : undefined$1,
3861
+ '%SyntaxError%': $SyntaxError,
3862
+ '%ThrowTypeError%': ThrowTypeError,
3863
+ '%TypedArray%': TypedArray,
3864
+ '%TypeError%': $TypeError$1,
3865
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
3866
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
3867
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
3868
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
3869
+ '%URIError%': URIError,
3870
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
3871
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
3872
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet
3873
+ };
3874
+
3875
+ try {
3876
+ null.error; // eslint-disable-line no-unused-expressions
3877
+ } catch (e) {
3878
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
3879
+ var errorProto = getProto(getProto(e));
3880
+ INTRINSICS['%Error.prototype%'] = errorProto;
3881
+ }
3882
+
3883
+ var doEval = function doEval(name) {
3884
+ var value;
3885
+ if (name === '%AsyncFunction%') {
3886
+ value = getEvalledConstructor('async function () {}');
3887
+ } else if (name === '%GeneratorFunction%') {
3888
+ value = getEvalledConstructor('function* () {}');
3889
+ } else if (name === '%AsyncGeneratorFunction%') {
3890
+ value = getEvalledConstructor('async function* () {}');
3891
+ } else if (name === '%AsyncGenerator%') {
3892
+ var fn = doEval('%AsyncGeneratorFunction%');
3893
+ if (fn) {
3894
+ value = fn.prototype;
3895
+ }
3896
+ } else if (name === '%AsyncIteratorPrototype%') {
3897
+ var gen = doEval('%AsyncGenerator%');
3898
+ if (gen) {
3899
+ value = getProto(gen.prototype);
3900
+ }
3901
+ }
3902
+
3903
+ INTRINSICS[name] = value;
3904
+
3905
+ return value;
3906
+ };
3907
+
3908
+ var LEGACY_ALIASES = {
3909
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
3910
+ '%ArrayPrototype%': ['Array', 'prototype'],
3911
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
3912
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
3913
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
3914
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
3915
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
3916
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
3917
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
3918
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
3919
+ '%DataViewPrototype%': ['DataView', 'prototype'],
3920
+ '%DatePrototype%': ['Date', 'prototype'],
3921
+ '%ErrorPrototype%': ['Error', 'prototype'],
3922
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
3923
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
3924
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
3925
+ '%FunctionPrototype%': ['Function', 'prototype'],
3926
+ '%Generator%': ['GeneratorFunction', 'prototype'],
3927
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
3928
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
3929
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
3930
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
3931
+ '%JSONParse%': ['JSON', 'parse'],
3932
+ '%JSONStringify%': ['JSON', 'stringify'],
3933
+ '%MapPrototype%': ['Map', 'prototype'],
3934
+ '%NumberPrototype%': ['Number', 'prototype'],
3935
+ '%ObjectPrototype%': ['Object', 'prototype'],
3936
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
3937
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
3938
+ '%PromisePrototype%': ['Promise', 'prototype'],
3939
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
3940
+ '%Promise_all%': ['Promise', 'all'],
3941
+ '%Promise_reject%': ['Promise', 'reject'],
3942
+ '%Promise_resolve%': ['Promise', 'resolve'],
3943
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
3944
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
3945
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
3946
+ '%SetPrototype%': ['Set', 'prototype'],
3947
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
3948
+ '%StringPrototype%': ['String', 'prototype'],
3949
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
3950
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
3951
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
3952
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
3953
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
3954
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
3955
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
3956
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
3957
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
3958
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
3959
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
3960
+ };
3961
+
3962
+ var bind = functionBind;
3963
+ var hasOwn$1 = src;
3964
+ var $concat$1 = bind.call(Function.call, Array.prototype.concat);
3965
+ var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
3966
+ var $replace$1 = bind.call(Function.call, String.prototype.replace);
3967
+ var $strSlice = bind.call(Function.call, String.prototype.slice);
3968
+ var $exec = bind.call(Function.call, RegExp.prototype.exec);
3969
+
3970
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
3971
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
3972
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
3973
+ var stringToPath = function stringToPath(string) {
3974
+ var first = $strSlice(string, 0, 1);
3975
+ var last = $strSlice(string, -1);
3976
+ if (first === '%' && last !== '%') {
3977
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
3978
+ } else if (last === '%' && first !== '%') {
3979
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
3980
+ }
3981
+ var result = [];
3982
+ $replace$1(string, rePropName, function (match, number, quote, subString) {
3983
+ result[result.length] = quote ? $replace$1(subString, reEscapeChar, '$1') : number || match;
3984
+ });
3985
+ return result;
3986
+ };
3987
+ /* end adaptation */
3988
+
3989
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
3990
+ var intrinsicName = name;
3991
+ var alias;
3992
+ if (hasOwn$1(LEGACY_ALIASES, intrinsicName)) {
3993
+ alias = LEGACY_ALIASES[intrinsicName];
3994
+ intrinsicName = '%' + alias[0] + '%';
3995
+ }
3996
+
3997
+ if (hasOwn$1(INTRINSICS, intrinsicName)) {
3998
+ var value = INTRINSICS[intrinsicName];
3999
+ if (value === needsEval) {
4000
+ value = doEval(intrinsicName);
4001
+ }
4002
+ if (typeof value === 'undefined' && !allowMissing) {
4003
+ throw new $TypeError$1('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
4004
+ }
4005
+
4006
+ return {
4007
+ alias: alias,
4008
+ name: intrinsicName,
4009
+ value: value
4010
+ };
4011
+ }
4012
+
4013
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
4014
+ };
4015
+
4016
+ var getIntrinsic = function GetIntrinsic(name, allowMissing) {
4017
+ if (typeof name !== 'string' || name.length === 0) {
4018
+ throw new $TypeError$1('intrinsic name must be a non-empty string');
4019
+ }
4020
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
4021
+ throw new $TypeError$1('"allowMissing" argument must be a boolean');
4022
+ }
4023
+
4024
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
4025
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
4026
+ }
4027
+ var parts = stringToPath(name);
4028
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
4029
+
4030
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
4031
+ var intrinsicRealName = intrinsic.name;
4032
+ var value = intrinsic.value;
4033
+ var skipFurtherCaching = false;
4034
+
4035
+ var alias = intrinsic.alias;
4036
+ if (alias) {
4037
+ intrinsicBaseName = alias[0];
4038
+ $spliceApply(parts, $concat$1([0, 1], alias));
4039
+ }
4040
+
4041
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
4042
+ var part = parts[i];
4043
+ var first = $strSlice(part, 0, 1);
4044
+ var last = $strSlice(part, -1);
4045
+ if (
4046
+ (
4047
+ (first === '"' || first === "'" || first === '`')
4048
+ || (last === '"' || last === "'" || last === '`')
4049
+ )
4050
+ && first !== last
4051
+ ) {
4052
+ throw new $SyntaxError('property names with quotes must have matching quotes');
4053
+ }
4054
+ if (part === 'constructor' || !isOwn) {
4055
+ skipFurtherCaching = true;
4056
+ }
4057
+
4058
+ intrinsicBaseName += '.' + part;
4059
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
4060
+
4061
+ if (hasOwn$1(INTRINSICS, intrinsicRealName)) {
4062
+ value = INTRINSICS[intrinsicRealName];
4063
+ } else if (value != null) {
4064
+ if (!(part in value)) {
4065
+ if (!allowMissing) {
4066
+ throw new $TypeError$1('base intrinsic for ' + name + ' exists, but the property is not available.');
4067
+ }
4068
+ return void undefined$1;
4069
+ }
4070
+ if ($gOPD && (i + 1) >= parts.length) {
4071
+ var desc = $gOPD(value, part);
4072
+ isOwn = !!desc;
4073
+
4074
+ // By convention, when a data property is converted to an accessor
4075
+ // property to emulate a data property that does not suffer from
4076
+ // the override mistake, that accessor's getter is marked with
4077
+ // an `originalValue` property. Here, when we detect this, we
4078
+ // uphold the illusion by pretending to see that original data
4079
+ // property, i.e., returning the value rather than the getter
4080
+ // itself.
4081
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
4082
+ value = desc.get;
4083
+ } else {
4084
+ value = value[part];
4085
+ }
4086
+ } else {
4087
+ isOwn = hasOwn$1(value, part);
4088
+ value = value[part];
4089
+ }
4090
+
4091
+ if (isOwn && !skipFurtherCaching) {
4092
+ INTRINSICS[intrinsicRealName] = value;
4093
+ }
4094
+ }
4095
+ }
4096
+ return value;
4097
+ };
4098
+
4099
+ var callBind$1 = {exports: {}};
4100
+
4101
+ (function (module) {
4102
+
4103
+ var bind = functionBind;
4104
+ var GetIntrinsic = getIntrinsic;
4105
+
4106
+ var $apply = GetIntrinsic('%Function.prototype.apply%');
4107
+ var $call = GetIntrinsic('%Function.prototype.call%');
4108
+ var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
4109
+
4110
+ var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
4111
+ var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
4112
+ var $max = GetIntrinsic('%Math.max%');
4113
+
4114
+ if ($defineProperty) {
4115
+ try {
4116
+ $defineProperty({}, 'a', { value: 1 });
4117
+ } catch (e) {
4118
+ // IE 8 has a broken defineProperty
4119
+ $defineProperty = null;
4120
+ }
4121
+ }
4122
+
4123
+ module.exports = function callBind(originalFunction) {
4124
+ var func = $reflectApply(bind, $call, arguments);
4125
+ if ($gOPD && $defineProperty) {
4126
+ var desc = $gOPD(func, 'length');
4127
+ if (desc.configurable) {
4128
+ // original length, plus the receiver, minus any additional arguments (after the receiver)
4129
+ $defineProperty(
4130
+ func,
4131
+ 'length',
4132
+ { value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
4133
+ );
4134
+ }
4135
+ }
4136
+ return func;
4137
+ };
4138
+
4139
+ var applyBind = function applyBind() {
4140
+ return $reflectApply(bind, $apply, arguments);
4141
+ };
4142
+
4143
+ if ($defineProperty) {
4144
+ $defineProperty(module.exports, 'apply', { value: applyBind });
4145
+ } else {
4146
+ module.exports.apply = applyBind;
4147
+ }
4148
+ } (callBind$1));
4149
+
4150
+ var GetIntrinsic$1 = getIntrinsic;
4151
+
4152
+ var callBind = callBind$1.exports;
4153
+
4154
+ var $indexOf = callBind(GetIntrinsic$1('String.prototype.indexOf'));
4155
+
4156
+ var callBound$1 = function callBoundIntrinsic(name, allowMissing) {
4157
+ var intrinsic = GetIntrinsic$1(name, !!allowMissing);
4158
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
4159
+ return callBind(intrinsic);
4160
+ }
4161
+ return intrinsic;
4162
+ };
4163
+
4164
+ var util_inspect = require$$0__default["default"].inspect;
4165
+
4166
+ var hasMap = typeof Map === 'function' && Map.prototype;
4167
+ var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
4168
+ var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
4169
+ var mapForEach = hasMap && Map.prototype.forEach;
4170
+ var hasSet = typeof Set === 'function' && Set.prototype;
4171
+ var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
4172
+ var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
4173
+ var setForEach = hasSet && Set.prototype.forEach;
4174
+ var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
4175
+ var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
4176
+ var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
4177
+ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
4178
+ var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
4179
+ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
4180
+ var booleanValueOf = Boolean.prototype.valueOf;
4181
+ var objectToString = Object.prototype.toString;
4182
+ var functionToString = Function.prototype.toString;
4183
+ var $match = String.prototype.match;
4184
+ var $slice = String.prototype.slice;
4185
+ var $replace = String.prototype.replace;
4186
+ var $toUpperCase = String.prototype.toUpperCase;
4187
+ var $toLowerCase = String.prototype.toLowerCase;
4188
+ var $test = RegExp.prototype.test;
4189
+ var $concat = Array.prototype.concat;
4190
+ var $join = Array.prototype.join;
4191
+ var $arrSlice = Array.prototype.slice;
4192
+ var $floor = Math.floor;
4193
+ var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
4194
+ var gOPS = Object.getOwnPropertySymbols;
4195
+ var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
4196
+ var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
4197
+ // ie, `has-tostringtag/shams
4198
+ var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
4199
+ ? Symbol.toStringTag
4200
+ : null;
4201
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
4202
+
4203
+ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
4204
+ [].__proto__ === Array.prototype // eslint-disable-line no-proto
4205
+ ? function (O) {
4206
+ return O.__proto__; // eslint-disable-line no-proto
4207
+ }
4208
+ : null
4209
+ );
4210
+
4211
+ function addNumericSeparator(num, str) {
4212
+ if (
4213
+ num === Infinity
4214
+ || num === -Infinity
4215
+ || num !== num
4216
+ || (num && num > -1000 && num < 1000)
4217
+ || $test.call(/e/, str)
4218
+ ) {
4219
+ return str;
4220
+ }
4221
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
4222
+ if (typeof num === 'number') {
4223
+ var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
4224
+ if (int !== num) {
4225
+ var intStr = String(int);
4226
+ var dec = $slice.call(str, intStr.length + 1);
4227
+ return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
4228
+ }
4229
+ }
4230
+ return $replace.call(str, sepRegex, '$&_');
4231
+ }
4232
+
4233
+ var utilInspect = util_inspect;
4234
+ var inspectCustom = utilInspect.custom;
4235
+ var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
4236
+
4237
+ var objectInspect = function inspect_(obj, options, depth, seen) {
4238
+ var opts = options || {};
4239
+
4240
+ if (has$3(opts, 'quoteStyle') && (opts.quoteStyle !== 'single' && opts.quoteStyle !== 'double')) {
4241
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
4242
+ }
4243
+ if (
4244
+ has$3(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
4245
+ ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
4246
+ : opts.maxStringLength !== null
4247
+ )
4248
+ ) {
4249
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
4250
+ }
4251
+ var customInspect = has$3(opts, 'customInspect') ? opts.customInspect : true;
4252
+ if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
4253
+ throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
4254
+ }
4255
+
4256
+ if (
4257
+ has$3(opts, 'indent')
4258
+ && opts.indent !== null
4259
+ && opts.indent !== '\t'
4260
+ && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
4261
+ ) {
4262
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
4263
+ }
4264
+ if (has$3(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
4265
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
4266
+ }
4267
+ var numericSeparator = opts.numericSeparator;
4268
+
4269
+ if (typeof obj === 'undefined') {
4270
+ return 'undefined';
4271
+ }
4272
+ if (obj === null) {
4273
+ return 'null';
4274
+ }
4275
+ if (typeof obj === 'boolean') {
4276
+ return obj ? 'true' : 'false';
4277
+ }
4278
+
4279
+ if (typeof obj === 'string') {
4280
+ return inspectString(obj, opts);
4281
+ }
4282
+ if (typeof obj === 'number') {
4283
+ if (obj === 0) {
4284
+ return Infinity / obj > 0 ? '0' : '-0';
4285
+ }
4286
+ var str = String(obj);
4287
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
4288
+ }
4289
+ if (typeof obj === 'bigint') {
4290
+ var bigIntStr = String(obj) + 'n';
4291
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
4292
+ }
4293
+
4294
+ var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
4295
+ if (typeof depth === 'undefined') { depth = 0; }
4296
+ if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
4297
+ return isArray$3(obj) ? '[Array]' : '[Object]';
4298
+ }
4299
+
4300
+ var indent = getIndent(opts, depth);
4301
+
4302
+ if (typeof seen === 'undefined') {
4303
+ seen = [];
4304
+ } else if (indexOf(seen, obj) >= 0) {
4305
+ return '[Circular]';
4306
+ }
4307
+
4308
+ function inspect(value, from, noIndent) {
4309
+ if (from) {
4310
+ seen = $arrSlice.call(seen);
4311
+ seen.push(from);
4312
+ }
4313
+ if (noIndent) {
4314
+ var newOpts = {
4315
+ depth: opts.depth
4316
+ };
4317
+ if (has$3(opts, 'quoteStyle')) {
4318
+ newOpts.quoteStyle = opts.quoteStyle;
4319
+ }
4320
+ return inspect_(value, newOpts, depth + 1, seen);
4321
+ }
4322
+ return inspect_(value, opts, depth + 1, seen);
4323
+ }
4324
+
4325
+ if (typeof obj === 'function' && !isRegExp$1(obj)) { // in older engines, regexes are callable
4326
+ var name = nameOf(obj);
4327
+ var keys = arrObjKeys(obj, inspect);
4328
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
4329
+ }
4330
+ if (isSymbol(obj)) {
4331
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
4332
+ return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
4333
+ }
4334
+ if (isElement(obj)) {
4335
+ var s = '<' + $toLowerCase.call(String(obj.nodeName));
4336
+ var attrs = obj.attributes || [];
4337
+ for (var i = 0; i < attrs.length; i++) {
4338
+ s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
4339
+ }
4340
+ s += '>';
4341
+ if (obj.childNodes && obj.childNodes.length) { s += '...'; }
4342
+ s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
4343
+ return s;
4344
+ }
4345
+ if (isArray$3(obj)) {
4346
+ if (obj.length === 0) { return '[]'; }
4347
+ var xs = arrObjKeys(obj, inspect);
4348
+ if (indent && !singleLineValues(xs)) {
4349
+ return '[' + indentedJoin(xs, indent) + ']';
4350
+ }
4351
+ return '[ ' + $join.call(xs, ', ') + ' ]';
4352
+ }
4353
+ if (isError(obj)) {
4354
+ var parts = arrObjKeys(obj, inspect);
4355
+ if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
4356
+ return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
4357
+ }
4358
+ if (parts.length === 0) { return '[' + String(obj) + ']'; }
4359
+ return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
4360
+ }
4361
+ if (typeof obj === 'object' && customInspect) {
4362
+ if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
4363
+ return utilInspect(obj, { depth: maxDepth - depth });
4364
+ } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
4365
+ return obj.inspect();
4366
+ }
4367
+ }
4368
+ if (isMap(obj)) {
4369
+ var mapParts = [];
4370
+ if (mapForEach) {
4371
+ mapForEach.call(obj, function (value, key) {
4372
+ mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
4373
+ });
4374
+ }
4375
+ return collectionOf('Map', mapSize.call(obj), mapParts, indent);
4376
+ }
4377
+ if (isSet(obj)) {
4378
+ var setParts = [];
4379
+ if (setForEach) {
4380
+ setForEach.call(obj, function (value) {
4381
+ setParts.push(inspect(value, obj));
4382
+ });
4383
+ }
4384
+ return collectionOf('Set', setSize.call(obj), setParts, indent);
4385
+ }
4386
+ if (isWeakMap(obj)) {
4387
+ return weakCollectionOf('WeakMap');
4388
+ }
4389
+ if (isWeakSet(obj)) {
4390
+ return weakCollectionOf('WeakSet');
4391
+ }
4392
+ if (isWeakRef(obj)) {
4393
+ return weakCollectionOf('WeakRef');
4394
+ }
4395
+ if (isNumber(obj)) {
4396
+ return markBoxed(inspect(Number(obj)));
4397
+ }
4398
+ if (isBigInt(obj)) {
4399
+ return markBoxed(inspect(bigIntValueOf.call(obj)));
4400
+ }
4401
+ if (isBoolean(obj)) {
4402
+ return markBoxed(booleanValueOf.call(obj));
4403
+ }
4404
+ if (isString(obj)) {
4405
+ return markBoxed(inspect(String(obj)));
4406
+ }
4407
+ if (!isDate(obj) && !isRegExp$1(obj)) {
4408
+ var ys = arrObjKeys(obj, inspect);
4409
+ var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
4410
+ var protoTag = obj instanceof Object ? '' : 'null prototype';
4411
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
4412
+ var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
4413
+ var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
4414
+ if (ys.length === 0) { return tag + '{}'; }
4415
+ if (indent) {
4416
+ return tag + '{' + indentedJoin(ys, indent) + '}';
4417
+ }
4418
+ return tag + '{ ' + $join.call(ys, ', ') + ' }';
4419
+ }
4420
+ return String(obj);
4421
+ };
4422
+
4423
+ function wrapQuotes(s, defaultStyle, opts) {
4424
+ var quoteChar = (opts.quoteStyle || defaultStyle) === 'double' ? '"' : "'";
4425
+ return quoteChar + s + quoteChar;
4426
+ }
4427
+
4428
+ function quote(s) {
4429
+ return $replace.call(String(s), /"/g, '&quot;');
4430
+ }
4431
+
4432
+ function isArray$3(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4433
+ function isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4434
+ function isRegExp$1(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4435
+ function isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4436
+ function isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4437
+ function isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4438
+ function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }
4439
+
4440
+ // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
4441
+ function isSymbol(obj) {
4442
+ if (hasShammedSymbols) {
4443
+ return obj && typeof obj === 'object' && obj instanceof Symbol;
4444
+ }
4445
+ if (typeof obj === 'symbol') {
4446
+ return true;
4447
+ }
4448
+ if (!obj || typeof obj !== 'object' || !symToString) {
4449
+ return false;
4450
+ }
4451
+ try {
4452
+ symToString.call(obj);
4453
+ return true;
4454
+ } catch (e) {}
4455
+ return false;
4456
+ }
4457
+
4458
+ function isBigInt(obj) {
4459
+ if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
4460
+ return false;
4461
+ }
4462
+ try {
4463
+ bigIntValueOf.call(obj);
4464
+ return true;
4465
+ } catch (e) {}
4466
+ return false;
4467
+ }
4468
+
4469
+ var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
4470
+ function has$3(obj, key) {
4471
+ return hasOwn.call(obj, key);
4472
+ }
4473
+
4474
+ function toStr(obj) {
4475
+ return objectToString.call(obj);
4476
+ }
4477
+
4478
+ function nameOf(f) {
4479
+ if (f.name) { return f.name; }
4480
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
4481
+ if (m) { return m[1]; }
4482
+ return null;
4483
+ }
4484
+
4485
+ function indexOf(xs, x) {
4486
+ if (xs.indexOf) { return xs.indexOf(x); }
4487
+ for (var i = 0, l = xs.length; i < l; i++) {
4488
+ if (xs[i] === x) { return i; }
4489
+ }
4490
+ return -1;
4491
+ }
4492
+
4493
+ function isMap(x) {
4494
+ if (!mapSize || !x || typeof x !== 'object') {
4495
+ return false;
4496
+ }
4497
+ try {
4498
+ mapSize.call(x);
4499
+ try {
4500
+ setSize.call(x);
4501
+ } catch (s) {
4502
+ return true;
4503
+ }
4504
+ return x instanceof Map; // core-js workaround, pre-v2.5.0
4505
+ } catch (e) {}
4506
+ return false;
4507
+ }
4508
+
4509
+ function isWeakMap(x) {
4510
+ if (!weakMapHas || !x || typeof x !== 'object') {
4511
+ return false;
4512
+ }
4513
+ try {
4514
+ weakMapHas.call(x, weakMapHas);
4515
+ try {
4516
+ weakSetHas.call(x, weakSetHas);
4517
+ } catch (s) {
4518
+ return true;
4519
+ }
4520
+ return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
4521
+ } catch (e) {}
4522
+ return false;
4523
+ }
4524
+
4525
+ function isWeakRef(x) {
4526
+ if (!weakRefDeref || !x || typeof x !== 'object') {
4527
+ return false;
4528
+ }
4529
+ try {
4530
+ weakRefDeref.call(x);
4531
+ return true;
4532
+ } catch (e) {}
4533
+ return false;
4534
+ }
4535
+
4536
+ function isSet(x) {
4537
+ if (!setSize || !x || typeof x !== 'object') {
4538
+ return false;
4539
+ }
4540
+ try {
4541
+ setSize.call(x);
4542
+ try {
4543
+ mapSize.call(x);
4544
+ } catch (m) {
4545
+ return true;
4546
+ }
4547
+ return x instanceof Set; // core-js workaround, pre-v2.5.0
4548
+ } catch (e) {}
4549
+ return false;
4550
+ }
4551
+
4552
+ function isWeakSet(x) {
4553
+ if (!weakSetHas || !x || typeof x !== 'object') {
4554
+ return false;
4555
+ }
4556
+ try {
4557
+ weakSetHas.call(x, weakSetHas);
4558
+ try {
4559
+ weakMapHas.call(x, weakMapHas);
4560
+ } catch (s) {
4561
+ return true;
4562
+ }
4563
+ return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
4564
+ } catch (e) {}
4565
+ return false;
4566
+ }
4567
+
4568
+ function isElement(x) {
4569
+ if (!x || typeof x !== 'object') { return false; }
4570
+ if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
4571
+ return true;
4572
+ }
4573
+ return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
4574
+ }
4575
+
4576
+ function inspectString(str, opts) {
4577
+ if (str.length > opts.maxStringLength) {
4578
+ var remaining = str.length - opts.maxStringLength;
4579
+ var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
4580
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
4581
+ }
4582
+ // eslint-disable-next-line no-control-regex
4583
+ var s = $replace.call($replace.call(str, /(['\\])/g, '\\$1'), /[\x00-\x1f]/g, lowbyte);
4584
+ return wrapQuotes(s, 'single', opts);
4585
+ }
4586
+
4587
+ function lowbyte(c) {
4588
+ var n = c.charCodeAt(0);
4589
+ var x = {
4590
+ 8: 'b',
4591
+ 9: 't',
4592
+ 10: 'n',
4593
+ 12: 'f',
4594
+ 13: 'r'
4595
+ }[n];
4596
+ if (x) { return '\\' + x; }
4597
+ return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
4598
+ }
4599
+
4600
+ function markBoxed(str) {
4601
+ return 'Object(' + str + ')';
4602
+ }
4603
+
4604
+ function weakCollectionOf(type) {
4605
+ return type + ' { ? }';
4606
+ }
4607
+
4608
+ function collectionOf(type, size, entries, indent) {
4609
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
4610
+ return type + ' (' + size + ') {' + joinedEntries + '}';
4611
+ }
4612
+
4613
+ function singleLineValues(xs) {
4614
+ for (var i = 0; i < xs.length; i++) {
4615
+ if (indexOf(xs[i], '\n') >= 0) {
4616
+ return false;
4617
+ }
4618
+ }
4619
+ return true;
4620
+ }
4621
+
4622
+ function getIndent(opts, depth) {
4623
+ var baseIndent;
4624
+ if (opts.indent === '\t') {
4625
+ baseIndent = '\t';
4626
+ } else if (typeof opts.indent === 'number' && opts.indent > 0) {
4627
+ baseIndent = $join.call(Array(opts.indent + 1), ' ');
4628
+ } else {
4629
+ return null;
4630
+ }
4631
+ return {
4632
+ base: baseIndent,
4633
+ prev: $join.call(Array(depth + 1), baseIndent)
4634
+ };
4635
+ }
4636
+
4637
+ function indentedJoin(xs, indent) {
4638
+ if (xs.length === 0) { return ''; }
4639
+ var lineJoiner = '\n' + indent.prev + indent.base;
4640
+ return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
4641
+ }
4642
+
4643
+ function arrObjKeys(obj, inspect) {
4644
+ var isArr = isArray$3(obj);
4645
+ var xs = [];
4646
+ if (isArr) {
4647
+ xs.length = obj.length;
4648
+ for (var i = 0; i < obj.length; i++) {
4649
+ xs[i] = has$3(obj, i) ? inspect(obj[i], obj) : '';
4650
+ }
4651
+ }
4652
+ var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
4653
+ var symMap;
4654
+ if (hasShammedSymbols) {
4655
+ symMap = {};
4656
+ for (var k = 0; k < syms.length; k++) {
4657
+ symMap['$' + syms[k]] = syms[k];
4658
+ }
4659
+ }
4660
+
4661
+ for (var key in obj) { // eslint-disable-line no-restricted-syntax
4662
+ if (!has$3(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
4663
+ if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
4664
+ if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
4665
+ // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
4666
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
4667
+ } else if ($test.call(/[^\w$]/, key)) {
4668
+ xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
4669
+ } else {
4670
+ xs.push(key + ': ' + inspect(obj[key], obj));
4671
+ }
4672
+ }
4673
+ if (typeof gOPS === 'function') {
4674
+ for (var j = 0; j < syms.length; j++) {
4675
+ if (isEnumerable.call(obj, syms[j])) {
4676
+ xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
4677
+ }
4678
+ }
4679
+ }
4680
+ return xs;
4681
+ }
4682
+
4683
+ var GetIntrinsic = getIntrinsic;
4684
+ var callBound = callBound$1;
4685
+ var inspect = objectInspect;
4686
+
4687
+ var $TypeError = GetIntrinsic('%TypeError%');
4688
+ var $WeakMap = GetIntrinsic('%WeakMap%', true);
4689
+ var $Map = GetIntrinsic('%Map%', true);
4690
+
4691
+ var $weakMapGet = callBound('WeakMap.prototype.get', true);
4692
+ var $weakMapSet = callBound('WeakMap.prototype.set', true);
4693
+ var $weakMapHas = callBound('WeakMap.prototype.has', true);
4694
+ var $mapGet = callBound('Map.prototype.get', true);
4695
+ var $mapSet = callBound('Map.prototype.set', true);
4696
+ var $mapHas = callBound('Map.prototype.has', true);
4697
+
4698
+ /*
4699
+ * This function traverses the list returning the node corresponding to the
4700
+ * given key.
4701
+ *
4702
+ * That node is also moved to the head of the list, so that if it's accessed
4703
+ * again we don't need to traverse the whole list. By doing so, all the recently
4704
+ * used nodes can be accessed relatively quickly.
4705
+ */
4706
+ var listGetNode = function (list, key) { // eslint-disable-line consistent-return
4707
+ for (var prev = list, curr; (curr = prev.next) !== null; prev = curr) {
4708
+ if (curr.key === key) {
4709
+ prev.next = curr.next;
4710
+ curr.next = list.next;
4711
+ list.next = curr; // eslint-disable-line no-param-reassign
4712
+ return curr;
4713
+ }
4714
+ }
4715
+ };
4716
+
4717
+ var listGet = function (objects, key) {
4718
+ var node = listGetNode(objects, key);
4719
+ return node && node.value;
4720
+ };
4721
+ var listSet = function (objects, key, value) {
4722
+ var node = listGetNode(objects, key);
4723
+ if (node) {
4724
+ node.value = value;
4725
+ } else {
4726
+ // Prepend the new node to the beginning of the list
4727
+ objects.next = { // eslint-disable-line no-param-reassign
4728
+ key: key,
4729
+ next: objects.next,
4730
+ value: value
4731
+ };
4732
+ }
4733
+ };
4734
+ var listHas = function (objects, key) {
4735
+ return !!listGetNode(objects, key);
4736
+ };
4737
+
4738
+ var sideChannel = function getSideChannel() {
4739
+ var $wm;
4740
+ var $m;
4741
+ var $o;
4742
+ var channel = {
4743
+ assert: function (key) {
4744
+ if (!channel.has(key)) {
4745
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
4746
+ }
4747
+ },
4748
+ get: function (key) { // eslint-disable-line consistent-return
4749
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
4750
+ if ($wm) {
4751
+ return $weakMapGet($wm, key);
4752
+ }
4753
+ } else if ($Map) {
4754
+ if ($m) {
4755
+ return $mapGet($m, key);
4756
+ }
4757
+ } else {
4758
+ if ($o) { // eslint-disable-line no-lonely-if
4759
+ return listGet($o, key);
4760
+ }
4761
+ }
4762
+ },
4763
+ has: function (key) {
4764
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
4765
+ if ($wm) {
4766
+ return $weakMapHas($wm, key);
4767
+ }
4768
+ } else if ($Map) {
4769
+ if ($m) {
4770
+ return $mapHas($m, key);
4771
+ }
4772
+ } else {
4773
+ if ($o) { // eslint-disable-line no-lonely-if
4774
+ return listHas($o, key);
4775
+ }
4776
+ }
4777
+ return false;
4778
+ },
4779
+ set: function (key, value) {
4780
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
4781
+ if (!$wm) {
4782
+ $wm = new $WeakMap();
4783
+ }
4784
+ $weakMapSet($wm, key, value);
4785
+ } else if ($Map) {
4786
+ if (!$m) {
4787
+ $m = new $Map();
4788
+ }
4789
+ $mapSet($m, key, value);
4790
+ } else {
4791
+ if (!$o) {
4792
+ /*
4793
+ * Initialize the linked list as an empty node, so that we don't have
4794
+ * to special-case handling of the first node: we can always refer to
4795
+ * it as (previous node).next, instead of something like (list).head
4796
+ */
4797
+ $o = { key: {}, next: null };
4798
+ }
4799
+ listSet($o, key, value);
4800
+ }
4801
+ }
4802
+ };
4803
+ return channel;
4804
+ };
4805
+
4806
+ var replace = String.prototype.replace;
4807
+ var percentTwenties = /%20/g;
4808
+
4809
+ var Format = {
4810
+ RFC1738: 'RFC1738',
4811
+ RFC3986: 'RFC3986'
4812
+ };
4813
+
4814
+ var formats$3 = {
4815
+ 'default': Format.RFC3986,
4816
+ formatters: {
4817
+ RFC1738: function (value) {
4818
+ return replace.call(value, percentTwenties, '+');
4819
+ },
4820
+ RFC3986: function (value) {
4821
+ return String(value);
4822
+ }
4823
+ },
4824
+ RFC1738: Format.RFC1738,
4825
+ RFC3986: Format.RFC3986
4826
+ };
4827
+
4828
+ var formats$2 = formats$3;
4829
+
4830
+ var has$2 = Object.prototype.hasOwnProperty;
4831
+ var isArray$2 = Array.isArray;
4832
+
4833
+ var hexTable = (function () {
4834
+ var array = [];
4835
+ for (var i = 0; i < 256; ++i) {
4836
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
4837
+ }
4838
+
4839
+ return array;
4840
+ }());
4841
+
4842
+ var compactQueue = function compactQueue(queue) {
4843
+ while (queue.length > 1) {
4844
+ var item = queue.pop();
4845
+ var obj = item.obj[item.prop];
4846
+
4847
+ if (isArray$2(obj)) {
4848
+ var compacted = [];
4849
+
4850
+ for (var j = 0; j < obj.length; ++j) {
4851
+ if (typeof obj[j] !== 'undefined') {
4852
+ compacted.push(obj[j]);
4853
+ }
4854
+ }
4855
+
4856
+ item.obj[item.prop] = compacted;
4857
+ }
4858
+ }
4859
+ };
4860
+
4861
+ var arrayToObject = function arrayToObject(source, options) {
4862
+ var obj = options && options.plainObjects ? Object.create(null) : {};
4863
+ for (var i = 0; i < source.length; ++i) {
4864
+ if (typeof source[i] !== 'undefined') {
4865
+ obj[i] = source[i];
4866
+ }
4867
+ }
4868
+
4869
+ return obj;
4870
+ };
4871
+
4872
+ var merge = function merge(target, source, options) {
4873
+ /* eslint no-param-reassign: 0 */
4874
+ if (!source) {
4875
+ return target;
4876
+ }
4877
+
4878
+ if (typeof source !== 'object') {
4879
+ if (isArray$2(target)) {
4880
+ target.push(source);
4881
+ } else if (target && typeof target === 'object') {
4882
+ if ((options && (options.plainObjects || options.allowPrototypes)) || !has$2.call(Object.prototype, source)) {
4883
+ target[source] = true;
4884
+ }
4885
+ } else {
4886
+ return [target, source];
4887
+ }
4888
+
4889
+ return target;
4890
+ }
4891
+
4892
+ if (!target || typeof target !== 'object') {
4893
+ return [target].concat(source);
4894
+ }
4895
+
4896
+ var mergeTarget = target;
4897
+ if (isArray$2(target) && !isArray$2(source)) {
4898
+ mergeTarget = arrayToObject(target, options);
4899
+ }
4900
+
4901
+ if (isArray$2(target) && isArray$2(source)) {
4902
+ source.forEach(function (item, i) {
4903
+ if (has$2.call(target, i)) {
4904
+ var targetItem = target[i];
4905
+ if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
4906
+ target[i] = merge(targetItem, item, options);
4907
+ } else {
4908
+ target.push(item);
4909
+ }
4910
+ } else {
4911
+ target[i] = item;
4912
+ }
4913
+ });
4914
+ return target;
4915
+ }
4916
+
4917
+ return Object.keys(source).reduce(function (acc, key) {
4918
+ var value = source[key];
4919
+
4920
+ if (has$2.call(acc, key)) {
4921
+ acc[key] = merge(acc[key], value, options);
4922
+ } else {
4923
+ acc[key] = value;
4924
+ }
4925
+ return acc;
4926
+ }, mergeTarget);
4927
+ };
4928
+
4929
+ var assign = function assignSingleSource(target, source) {
4930
+ return Object.keys(source).reduce(function (acc, key) {
4931
+ acc[key] = source[key];
4932
+ return acc;
4933
+ }, target);
4934
+ };
4935
+
4936
+ var decode = function (str, decoder, charset) {
4937
+ var strWithoutPlus = str.replace(/\+/g, ' ');
4938
+ if (charset === 'iso-8859-1') {
4939
+ // unescape never throws, no try...catch needed:
4940
+ return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
4941
+ }
4942
+ // utf-8
4943
+ try {
4944
+ return decodeURIComponent(strWithoutPlus);
4945
+ } catch (e) {
4946
+ return strWithoutPlus;
4947
+ }
4948
+ };
4949
+
4950
+ var encode = function encode(str, defaultEncoder, charset, kind, format) {
4951
+ // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
4952
+ // It has been adapted here for stricter adherence to RFC 3986
4953
+ if (str.length === 0) {
4954
+ return str;
4955
+ }
4956
+
4957
+ var string = str;
4958
+ if (typeof str === 'symbol') {
4959
+ string = Symbol.prototype.toString.call(str);
4960
+ } else if (typeof str !== 'string') {
4961
+ string = String(str);
4962
+ }
4963
+
4964
+ if (charset === 'iso-8859-1') {
4965
+ return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
4966
+ return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
4967
+ });
4968
+ }
4969
+
4970
+ var out = '';
4971
+ for (var i = 0; i < string.length; ++i) {
4972
+ var c = string.charCodeAt(i);
4973
+
4974
+ if (
4975
+ c === 0x2D // -
4976
+ || c === 0x2E // .
4977
+ || c === 0x5F // _
4978
+ || c === 0x7E // ~
4979
+ || (c >= 0x30 && c <= 0x39) // 0-9
4980
+ || (c >= 0x41 && c <= 0x5A) // a-z
4981
+ || (c >= 0x61 && c <= 0x7A) // A-Z
4982
+ || (format === formats$2.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
4983
+ ) {
4984
+ out += string.charAt(i);
4985
+ continue;
4986
+ }
4987
+
4988
+ if (c < 0x80) {
4989
+ out = out + hexTable[c];
4990
+ continue;
4991
+ }
4992
+
4993
+ if (c < 0x800) {
4994
+ out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
4995
+ continue;
4996
+ }
4997
+
4998
+ if (c < 0xD800 || c >= 0xE000) {
4999
+ out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
5000
+ continue;
5001
+ }
5002
+
5003
+ i += 1;
5004
+ c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
5005
+ /* eslint operator-linebreak: [2, "before"] */
5006
+ out += hexTable[0xF0 | (c >> 18)]
5007
+ + hexTable[0x80 | ((c >> 12) & 0x3F)]
5008
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
5009
+ + hexTable[0x80 | (c & 0x3F)];
5010
+ }
5011
+
5012
+ return out;
5013
+ };
5014
+
5015
+ var compact = function compact(value) {
5016
+ var queue = [{ obj: { o: value }, prop: 'o' }];
5017
+ var refs = [];
5018
+
5019
+ for (var i = 0; i < queue.length; ++i) {
5020
+ var item = queue[i];
5021
+ var obj = item.obj[item.prop];
5022
+
5023
+ var keys = Object.keys(obj);
5024
+ for (var j = 0; j < keys.length; ++j) {
5025
+ var key = keys[j];
5026
+ var val = obj[key];
5027
+ if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
5028
+ queue.push({ obj: obj, prop: key });
5029
+ refs.push(val);
5030
+ }
5031
+ }
5032
+ }
5033
+
5034
+ compactQueue(queue);
5035
+
5036
+ return value;
5037
+ };
5038
+
5039
+ var isRegExp = function isRegExp(obj) {
5040
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
5041
+ };
5042
+
5043
+ var isBuffer = function isBuffer(obj) {
5044
+ if (!obj || typeof obj !== 'object') {
5045
+ return false;
5046
+ }
5047
+
5048
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
5049
+ };
5050
+
5051
+ var combine = function combine(a, b) {
5052
+ return [].concat(a, b);
5053
+ };
5054
+
5055
+ var maybeMap = function maybeMap(val, fn) {
5056
+ if (isArray$2(val)) {
5057
+ var mapped = [];
5058
+ for (var i = 0; i < val.length; i += 1) {
5059
+ mapped.push(fn(val[i]));
5060
+ }
5061
+ return mapped;
5062
+ }
5063
+ return fn(val);
5064
+ };
5065
+
5066
+ var utils$2 = {
5067
+ arrayToObject: arrayToObject,
5068
+ assign: assign,
5069
+ combine: combine,
5070
+ compact: compact,
5071
+ decode: decode,
5072
+ encode: encode,
5073
+ isBuffer: isBuffer,
5074
+ isRegExp: isRegExp,
5075
+ maybeMap: maybeMap,
5076
+ merge: merge
5077
+ };
5078
+
5079
+ var getSideChannel = sideChannel;
5080
+ var utils$1 = utils$2;
5081
+ var formats$1 = formats$3;
5082
+ var has$1 = Object.prototype.hasOwnProperty;
5083
+
5084
+ var arrayPrefixGenerators = {
5085
+ brackets: function brackets(prefix) {
5086
+ return prefix + '[]';
5087
+ },
5088
+ comma: 'comma',
5089
+ indices: function indices(prefix, key) {
5090
+ return prefix + '[' + key + ']';
5091
+ },
5092
+ repeat: function repeat(prefix) {
5093
+ return prefix;
5094
+ }
5095
+ };
5096
+
5097
+ var isArray$1 = Array.isArray;
5098
+ var split = String.prototype.split;
5099
+ var push = Array.prototype.push;
5100
+ var pushToArray = function (arr, valueOrArray) {
5101
+ push.apply(arr, isArray$1(valueOrArray) ? valueOrArray : [valueOrArray]);
5102
+ };
5103
+
5104
+ var toISO = Date.prototype.toISOString;
5105
+
5106
+ var defaultFormat = formats$1['default'];
5107
+ var defaults$1 = {
5108
+ addQueryPrefix: false,
5109
+ allowDots: false,
5110
+ charset: 'utf-8',
5111
+ charsetSentinel: false,
5112
+ delimiter: '&',
5113
+ encode: true,
5114
+ encoder: utils$1.encode,
5115
+ encodeValuesOnly: false,
5116
+ format: defaultFormat,
5117
+ formatter: formats$1.formatters[defaultFormat],
5118
+ // deprecated
5119
+ indices: false,
5120
+ serializeDate: function serializeDate(date) {
5121
+ return toISO.call(date);
5122
+ },
5123
+ skipNulls: false,
5124
+ strictNullHandling: false
5125
+ };
5126
+
5127
+ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
5128
+ return typeof v === 'string'
5129
+ || typeof v === 'number'
5130
+ || typeof v === 'boolean'
5131
+ || typeof v === 'symbol'
5132
+ || typeof v === 'bigint';
5133
+ };
5134
+
5135
+ var sentinel = {};
5136
+
5137
+ var stringify$1 = function stringify(
5138
+ object,
5139
+ prefix,
5140
+ generateArrayPrefix,
5141
+ commaRoundTrip,
5142
+ strictNullHandling,
5143
+ skipNulls,
5144
+ encoder,
5145
+ filter,
5146
+ sort,
5147
+ allowDots,
5148
+ serializeDate,
5149
+ format,
5150
+ formatter,
5151
+ encodeValuesOnly,
5152
+ charset,
5153
+ sideChannel
5154
+ ) {
5155
+ var obj = object;
5156
+
5157
+ var tmpSc = sideChannel;
5158
+ var step = 0;
5159
+ var findFlag = false;
5160
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
5161
+ // Where object last appeared in the ref tree
5162
+ var pos = tmpSc.get(object);
5163
+ step += 1;
5164
+ if (typeof pos !== 'undefined') {
5165
+ if (pos === step) {
5166
+ throw new RangeError('Cyclic object value');
5167
+ } else {
5168
+ findFlag = true; // Break while
5169
+ }
5170
+ }
5171
+ if (typeof tmpSc.get(sentinel) === 'undefined') {
5172
+ step = 0;
5173
+ }
5174
+ }
5175
+
5176
+ if (typeof filter === 'function') {
5177
+ obj = filter(prefix, obj);
5178
+ } else if (obj instanceof Date) {
5179
+ obj = serializeDate(obj);
5180
+ } else if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
5181
+ obj = utils$1.maybeMap(obj, function (value) {
5182
+ if (value instanceof Date) {
5183
+ return serializeDate(value);
5184
+ }
5185
+ return value;
5186
+ });
5187
+ }
5188
+
5189
+ if (obj === null) {
5190
+ if (strictNullHandling) {
5191
+ return encoder && !encodeValuesOnly ? encoder(prefix, defaults$1.encoder, charset, 'key', format) : prefix;
5192
+ }
5193
+
5194
+ obj = '';
5195
+ }
5196
+
5197
+ if (isNonNullishPrimitive(obj) || utils$1.isBuffer(obj)) {
5198
+ if (encoder) {
5199
+ var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults$1.encoder, charset, 'key', format);
5200
+ if (generateArrayPrefix === 'comma' && encodeValuesOnly) {
5201
+ var valuesArray = split.call(String(obj), ',');
5202
+ var valuesJoined = '';
5203
+ for (var i = 0; i < valuesArray.length; ++i) {
5204
+ valuesJoined += (i === 0 ? '' : ',') + formatter(encoder(valuesArray[i], defaults$1.encoder, charset, 'value', format));
5205
+ }
5206
+ return [formatter(keyValue) + (commaRoundTrip && isArray$1(obj) && valuesArray.length === 1 ? '[]' : '') + '=' + valuesJoined];
5207
+ }
5208
+ return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults$1.encoder, charset, 'value', format))];
5209
+ }
5210
+ return [formatter(prefix) + '=' + formatter(String(obj))];
5211
+ }
5212
+
5213
+ var values = [];
5214
+
5215
+ if (typeof obj === 'undefined') {
5216
+ return values;
5217
+ }
5218
+
5219
+ var objKeys;
5220
+ if (generateArrayPrefix === 'comma' && isArray$1(obj)) {
5221
+ // we need to join elements in
5222
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
5223
+ } else if (isArray$1(filter)) {
5224
+ objKeys = filter;
5225
+ } else {
5226
+ var keys = Object.keys(obj);
5227
+ objKeys = sort ? keys.sort(sort) : keys;
5228
+ }
5229
+
5230
+ var adjustedPrefix = commaRoundTrip && isArray$1(obj) && obj.length === 1 ? prefix + '[]' : prefix;
5231
+
5232
+ for (var j = 0; j < objKeys.length; ++j) {
5233
+ var key = objKeys[j];
5234
+ var value = typeof key === 'object' && typeof key.value !== 'undefined' ? key.value : obj[key];
5235
+
5236
+ if (skipNulls && value === null) {
5237
+ continue;
5238
+ }
5239
+
5240
+ var keyPrefix = isArray$1(obj)
5241
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, key) : adjustedPrefix
5242
+ : adjustedPrefix + (allowDots ? '.' + key : '[' + key + ']');
5243
+
5244
+ sideChannel.set(object, step);
5245
+ var valueSideChannel = getSideChannel();
5246
+ valueSideChannel.set(sentinel, sideChannel);
5247
+ pushToArray(values, stringify(
5248
+ value,
5249
+ keyPrefix,
5250
+ generateArrayPrefix,
5251
+ commaRoundTrip,
5252
+ strictNullHandling,
5253
+ skipNulls,
5254
+ encoder,
5255
+ filter,
5256
+ sort,
5257
+ allowDots,
5258
+ serializeDate,
5259
+ format,
5260
+ formatter,
5261
+ encodeValuesOnly,
5262
+ charset,
5263
+ valueSideChannel
5264
+ ));
5265
+ }
5266
+
5267
+ return values;
5268
+ };
5269
+
5270
+ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
5271
+ if (!opts) {
5272
+ return defaults$1;
5273
+ }
5274
+
5275
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
5276
+ throw new TypeError('Encoder has to be a function.');
5277
+ }
5278
+
5279
+ var charset = opts.charset || defaults$1.charset;
5280
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
5281
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
5282
+ }
5283
+
5284
+ var format = formats$1['default'];
5285
+ if (typeof opts.format !== 'undefined') {
5286
+ if (!has$1.call(formats$1.formatters, opts.format)) {
5287
+ throw new TypeError('Unknown format option provided.');
5288
+ }
5289
+ format = opts.format;
5290
+ }
5291
+ var formatter = formats$1.formatters[format];
5292
+
5293
+ var filter = defaults$1.filter;
5294
+ if (typeof opts.filter === 'function' || isArray$1(opts.filter)) {
5295
+ filter = opts.filter;
5296
+ }
5297
+
5298
+ return {
5299
+ addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults$1.addQueryPrefix,
5300
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults$1.allowDots : !!opts.allowDots,
5301
+ charset: charset,
5302
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults$1.charsetSentinel,
5303
+ delimiter: typeof opts.delimiter === 'undefined' ? defaults$1.delimiter : opts.delimiter,
5304
+ encode: typeof opts.encode === 'boolean' ? opts.encode : defaults$1.encode,
5305
+ encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults$1.encoder,
5306
+ encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults$1.encodeValuesOnly,
5307
+ filter: filter,
5308
+ format: format,
5309
+ formatter: formatter,
5310
+ serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults$1.serializeDate,
5311
+ skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults$1.skipNulls,
5312
+ sort: typeof opts.sort === 'function' ? opts.sort : null,
5313
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults$1.strictNullHandling
5314
+ };
5315
+ };
5316
+
5317
+ var stringify_1 = function (object, opts) {
5318
+ var obj = object;
5319
+ var options = normalizeStringifyOptions(opts);
5320
+
5321
+ var objKeys;
5322
+ var filter;
5323
+
5324
+ if (typeof options.filter === 'function') {
5325
+ filter = options.filter;
5326
+ obj = filter('', obj);
5327
+ } else if (isArray$1(options.filter)) {
5328
+ filter = options.filter;
5329
+ objKeys = filter;
5330
+ }
5331
+
5332
+ var keys = [];
5333
+
5334
+ if (typeof obj !== 'object' || obj === null) {
5335
+ return '';
5336
+ }
5337
+
5338
+ var arrayFormat;
5339
+ if (opts && opts.arrayFormat in arrayPrefixGenerators) {
5340
+ arrayFormat = opts.arrayFormat;
5341
+ } else if (opts && 'indices' in opts) {
5342
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
5343
+ } else {
5344
+ arrayFormat = 'indices';
5345
+ }
5346
+
5347
+ var generateArrayPrefix = arrayPrefixGenerators[arrayFormat];
5348
+ if (opts && 'commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
5349
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
5350
+ }
5351
+ var commaRoundTrip = generateArrayPrefix === 'comma' && opts && opts.commaRoundTrip;
5352
+
5353
+ if (!objKeys) {
5354
+ objKeys = Object.keys(obj);
5355
+ }
5356
+
5357
+ if (options.sort) {
5358
+ objKeys.sort(options.sort);
5359
+ }
5360
+
5361
+ var sideChannel = getSideChannel();
5362
+ for (var i = 0; i < objKeys.length; ++i) {
5363
+ var key = objKeys[i];
5364
+
5365
+ if (options.skipNulls && obj[key] === null) {
5366
+ continue;
5367
+ }
5368
+ pushToArray(keys, stringify$1(
5369
+ obj[key],
5370
+ key,
5371
+ generateArrayPrefix,
5372
+ commaRoundTrip,
5373
+ options.strictNullHandling,
5374
+ options.skipNulls,
5375
+ options.encode ? options.encoder : null,
5376
+ options.filter,
5377
+ options.sort,
5378
+ options.allowDots,
5379
+ options.serializeDate,
5380
+ options.format,
5381
+ options.formatter,
5382
+ options.encodeValuesOnly,
5383
+ options.charset,
5384
+ sideChannel
5385
+ ));
5386
+ }
5387
+
5388
+ var joined = keys.join(options.delimiter);
5389
+ var prefix = options.addQueryPrefix === true ? '?' : '';
5390
+
5391
+ if (options.charsetSentinel) {
5392
+ if (options.charset === 'iso-8859-1') {
5393
+ // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
5394
+ prefix += 'utf8=%26%2310003%3B&';
5395
+ } else {
5396
+ // encodeURIComponent('✓')
5397
+ prefix += 'utf8=%E2%9C%93&';
5398
+ }
5399
+ }
5400
+
5401
+ return joined.length > 0 ? prefix + joined : '';
5402
+ };
5403
+
5404
+ var utils = utils$2;
5405
+
5406
+ var has = Object.prototype.hasOwnProperty;
5407
+ var isArray = Array.isArray;
5408
+
5409
+ var defaults = {
5410
+ allowDots: false,
5411
+ allowPrototypes: false,
5412
+ allowSparse: false,
5413
+ arrayLimit: 20,
5414
+ charset: 'utf-8',
5415
+ charsetSentinel: false,
5416
+ comma: false,
5417
+ decoder: utils.decode,
5418
+ delimiter: '&',
5419
+ depth: 5,
5420
+ ignoreQueryPrefix: false,
5421
+ interpretNumericEntities: false,
5422
+ parameterLimit: 1000,
5423
+ parseArrays: true,
5424
+ plainObjects: false,
5425
+ strictNullHandling: false
5426
+ };
5427
+
5428
+ var interpretNumericEntities = function (str) {
5429
+ return str.replace(/&#(\d+);/g, function ($0, numberStr) {
5430
+ return String.fromCharCode(parseInt(numberStr, 10));
5431
+ });
5432
+ };
5433
+
5434
+ var parseArrayValue = function (val, options) {
5435
+ if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
5436
+ return val.split(',');
5437
+ }
5438
+
5439
+ return val;
5440
+ };
5441
+
5442
+ // This is what browsers will submit when the ✓ character occurs in an
5443
+ // application/x-www-form-urlencoded body and the encoding of the page containing
5444
+ // the form is iso-8859-1, or when the submitted form has an accept-charset
5445
+ // attribute of iso-8859-1. Presumably also with other charsets that do not contain
5446
+ // the ✓ character, such as us-ascii.
5447
+ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
5448
+
5449
+ // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
5450
+ var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
5451
+
5452
+ var parseValues = function parseQueryStringValues(str, options) {
5453
+ var obj = {};
5454
+ var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
5455
+ var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
5456
+ var parts = cleanStr.split(options.delimiter, limit);
5457
+ var skipIndex = -1; // Keep track of where the utf8 sentinel was found
5458
+ var i;
5459
+
5460
+ var charset = options.charset;
5461
+ if (options.charsetSentinel) {
5462
+ for (i = 0; i < parts.length; ++i) {
5463
+ if (parts[i].indexOf('utf8=') === 0) {
5464
+ if (parts[i] === charsetSentinel) {
5465
+ charset = 'utf-8';
5466
+ } else if (parts[i] === isoSentinel) {
5467
+ charset = 'iso-8859-1';
5468
+ }
5469
+ skipIndex = i;
5470
+ i = parts.length; // The eslint settings do not allow break;
5471
+ }
5472
+ }
5473
+ }
5474
+
5475
+ for (i = 0; i < parts.length; ++i) {
5476
+ if (i === skipIndex) {
5477
+ continue;
5478
+ }
5479
+ var part = parts[i];
5480
+
5481
+ var bracketEqualsPos = part.indexOf(']=');
5482
+ var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
5483
+
5484
+ var key, val;
5485
+ if (pos === -1) {
5486
+ key = options.decoder(part, defaults.decoder, charset, 'key');
5487
+ val = options.strictNullHandling ? null : '';
5488
+ } else {
5489
+ key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
5490
+ val = utils.maybeMap(
5491
+ parseArrayValue(part.slice(pos + 1), options),
5492
+ function (encodedVal) {
5493
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
5494
+ }
5495
+ );
5496
+ }
5497
+
5498
+ if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
5499
+ val = interpretNumericEntities(val);
5500
+ }
5501
+
5502
+ if (part.indexOf('[]=') > -1) {
5503
+ val = isArray(val) ? [val] : val;
5504
+ }
5505
+
5506
+ if (has.call(obj, key)) {
5507
+ obj[key] = utils.combine(obj[key], val);
5508
+ } else {
5509
+ obj[key] = val;
5510
+ }
5511
+ }
5512
+
5513
+ return obj;
5514
+ };
5515
+
5516
+ var parseObject = function (chain, val, options, valuesParsed) {
5517
+ var leaf = valuesParsed ? val : parseArrayValue(val, options);
5518
+
5519
+ for (var i = chain.length - 1; i >= 0; --i) {
5520
+ var obj;
5521
+ var root = chain[i];
5522
+
5523
+ if (root === '[]' && options.parseArrays) {
5524
+ obj = [].concat(leaf);
5525
+ } else {
5526
+ obj = options.plainObjects ? Object.create(null) : {};
5527
+ var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
5528
+ var index = parseInt(cleanRoot, 10);
5529
+ if (!options.parseArrays && cleanRoot === '') {
5530
+ obj = { 0: leaf };
5531
+ } else if (
5532
+ !isNaN(index)
5533
+ && root !== cleanRoot
5534
+ && String(index) === cleanRoot
5535
+ && index >= 0
5536
+ && (options.parseArrays && index <= options.arrayLimit)
5537
+ ) {
5538
+ obj = [];
5539
+ obj[index] = leaf;
5540
+ } else if (cleanRoot !== '__proto__') {
5541
+ obj[cleanRoot] = leaf;
5542
+ }
5543
+ }
5544
+
5545
+ leaf = obj;
5546
+ }
5547
+
5548
+ return leaf;
5549
+ };
5550
+
5551
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
5552
+ if (!givenKey) {
5553
+ return;
5554
+ }
5555
+
5556
+ // Transform dot notation to bracket notation
5557
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
5558
+
5559
+ // The regex chunks
5560
+
5561
+ var brackets = /(\[[^[\]]*])/;
5562
+ var child = /(\[[^[\]]*])/g;
5563
+
5564
+ // Get the parent
5565
+
5566
+ var segment = options.depth > 0 && brackets.exec(key);
5567
+ var parent = segment ? key.slice(0, segment.index) : key;
5568
+
5569
+ // Stash the parent if it exists
5570
+
5571
+ var keys = [];
5572
+ if (parent) {
5573
+ // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
5574
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
5575
+ if (!options.allowPrototypes) {
5576
+ return;
5577
+ }
5578
+ }
5579
+
5580
+ keys.push(parent);
5581
+ }
5582
+
5583
+ // Loop through children appending to the array until we hit depth
5584
+
5585
+ var i = 0;
5586
+ while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
5587
+ i += 1;
5588
+ if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
5589
+ if (!options.allowPrototypes) {
5590
+ return;
5591
+ }
5592
+ }
5593
+ keys.push(segment[1]);
5594
+ }
5595
+
5596
+ // If there's a remainder, just add whatever is left
5597
+
5598
+ if (segment) {
5599
+ keys.push('[' + key.slice(segment.index) + ']');
5600
+ }
5601
+
5602
+ return parseObject(keys, val, options, valuesParsed);
5603
+ };
5604
+
5605
+ var normalizeParseOptions = function normalizeParseOptions(opts) {
5606
+ if (!opts) {
5607
+ return defaults;
5608
+ }
5609
+
5610
+ if (opts.decoder !== null && opts.decoder !== undefined && typeof opts.decoder !== 'function') {
5611
+ throw new TypeError('Decoder has to be a function.');
5612
+ }
5613
+
5614
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
5615
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
5616
+ }
5617
+ var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
5618
+
5619
+ return {
5620
+ allowDots: typeof opts.allowDots === 'undefined' ? defaults.allowDots : !!opts.allowDots,
5621
+ allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
5622
+ allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
5623
+ arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
5624
+ charset: charset,
5625
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
5626
+ comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
5627
+ decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
5628
+ delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
5629
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
5630
+ depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
5631
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
5632
+ interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
5633
+ parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
5634
+ parseArrays: opts.parseArrays !== false,
5635
+ plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
5636
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
5637
+ };
5638
+ };
5639
+
5640
+ var parse$2 = function (str, opts) {
5641
+ var options = normalizeParseOptions(opts);
5642
+
5643
+ if (str === '' || str === null || typeof str === 'undefined') {
5644
+ return options.plainObjects ? Object.create(null) : {};
5645
+ }
5646
+
5647
+ var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
5648
+ var obj = options.plainObjects ? Object.create(null) : {};
5649
+
5650
+ // Iterate over the keys and setup the new object
5651
+
5652
+ var keys = Object.keys(tempObj);
5653
+ for (var i = 0; i < keys.length; ++i) {
5654
+ var key = keys[i];
5655
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
5656
+ obj = utils.merge(obj, newObj, options);
5657
+ }
5658
+
5659
+ if (options.allowSparse === true) {
5660
+ return obj;
5661
+ }
5662
+
5663
+ return utils.compact(obj);
5664
+ };
5665
+
5666
+ var stringify = stringify_1;
5667
+ var parse$1 = parse$2;
5668
+ var formats = formats$3;
5669
+
5670
+ var lib = {
5671
+ formats: formats,
5672
+ parse: parse$1,
5673
+ stringify: stringify
5674
+ };
5675
+
5676
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
5677
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5678
+ var useQueryParams = function useQueryParams() {
5679
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
5680
+ var location = reactRouterDom.useLocation();
5681
+ return lib.parse(location.search, _objectSpread({
5682
+ ignoreQueryPrefix: true
5683
+ }, options));
5684
+ };
5685
+
3642
5686
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
3643
5687
  try {
3644
5688
  var info = gen[key](arg);
@@ -4882,6 +6926,7 @@ exports.useNavigationCheckpoints = useNavigationCheckpoints;
4882
6926
  exports.useOnClickOutside = useOnClickOutside;
4883
6927
  exports.usePersistedQuery = usePersistedQuery;
4884
6928
  exports.usePrevious = usePrevious;
6929
+ exports.useQueryParams = useQueryParams;
4885
6930
  exports.useRegisterNavigationCheckpoint = useRegisterNavigationCheckpoint;
4886
6931
  exports.useStateWithDependency = useStateWithDependency;
4887
6932
  exports.useTimer = useTimer;