@izzai/one-js 1.1.2 → 1.1.22

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.js CHANGED
@@ -1,13 +1,4326 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.One = void 0;
4
- const services_1 = require("./services");
5
- const base_1 = require("./services/base");
6
- class One extends base_1.BaseService {
7
- _services;
1
+ import require$$0$1 from 'util';
2
+ import require$$0$2 from 'path';
3
+
4
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
5
+
6
+ function getDefaultExportFromCjs (x) {
7
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
8
+ }
9
+
10
+ var type;
11
+ var hasRequiredType;
12
+
13
+ function requireType () {
14
+ if (hasRequiredType) return type;
15
+ hasRequiredType = 1;
16
+
17
+ /** @type {import('./type')} */
18
+ type = TypeError;
19
+ return type;
20
+ }
21
+
22
+ var util_inspect;
23
+ var hasRequiredUtil_inspect;
24
+
25
+ function requireUtil_inspect () {
26
+ if (hasRequiredUtil_inspect) return util_inspect;
27
+ hasRequiredUtil_inspect = 1;
28
+ util_inspect = require$$0$1.inspect;
29
+ return util_inspect;
30
+ }
31
+
32
+ var objectInspect;
33
+ var hasRequiredObjectInspect;
34
+
35
+ function requireObjectInspect () {
36
+ if (hasRequiredObjectInspect) return objectInspect;
37
+ hasRequiredObjectInspect = 1;
38
+ var hasMap = typeof Map === 'function' && Map.prototype;
39
+ var mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;
40
+ var mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;
41
+ var mapForEach = hasMap && Map.prototype.forEach;
42
+ var hasSet = typeof Set === 'function' && Set.prototype;
43
+ var setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;
44
+ var setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;
45
+ var setForEach = hasSet && Set.prototype.forEach;
46
+ var hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;
47
+ var weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;
48
+ var hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;
49
+ var weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;
50
+ var hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;
51
+ var weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;
52
+ var booleanValueOf = Boolean.prototype.valueOf;
53
+ var objectToString = Object.prototype.toString;
54
+ var functionToString = Function.prototype.toString;
55
+ var $match = String.prototype.match;
56
+ var $slice = String.prototype.slice;
57
+ var $replace = String.prototype.replace;
58
+ var $toUpperCase = String.prototype.toUpperCase;
59
+ var $toLowerCase = String.prototype.toLowerCase;
60
+ var $test = RegExp.prototype.test;
61
+ var $concat = Array.prototype.concat;
62
+ var $join = Array.prototype.join;
63
+ var $arrSlice = Array.prototype.slice;
64
+ var $floor = Math.floor;
65
+ var bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;
66
+ var gOPS = Object.getOwnPropertySymbols;
67
+ var symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;
68
+ var hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';
69
+ // ie, `has-tostringtag/shams
70
+ var toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')
71
+ ? Symbol.toStringTag
72
+ : null;
73
+ var isEnumerable = Object.prototype.propertyIsEnumerable;
74
+
75
+ var gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (
76
+ [].__proto__ === Array.prototype // eslint-disable-line no-proto
77
+ ? function (O) {
78
+ return O.__proto__; // eslint-disable-line no-proto
79
+ }
80
+ : null
81
+ );
82
+
83
+ function addNumericSeparator(num, str) {
84
+ if (
85
+ num === Infinity
86
+ || num === -Infinity
87
+ || num !== num
88
+ || (num && num > -1e3 && num < 1000)
89
+ || $test.call(/e/, str)
90
+ ) {
91
+ return str;
92
+ }
93
+ var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
94
+ if (typeof num === 'number') {
95
+ var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)
96
+ if (int !== num) {
97
+ var intStr = String(int);
98
+ var dec = $slice.call(str, intStr.length + 1);
99
+ return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');
100
+ }
101
+ }
102
+ return $replace.call(str, sepRegex, '$&_');
103
+ }
104
+
105
+ var utilInspect = /*@__PURE__*/ requireUtil_inspect();
106
+ var inspectCustom = utilInspect.custom;
107
+ var inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;
108
+
109
+ var quotes = {
110
+ __proto__: null,
111
+ 'double': '"',
112
+ single: "'"
113
+ };
114
+ var quoteREs = {
115
+ __proto__: null,
116
+ 'double': /(["\\])/g,
117
+ single: /(['\\])/g
118
+ };
119
+
120
+ objectInspect = function inspect_(obj, options, depth, seen) {
121
+ var opts = options || {};
122
+
123
+ if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {
124
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
125
+ }
126
+ if (
127
+ has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'
128
+ ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity
129
+ : opts.maxStringLength !== null
130
+ )
131
+ ) {
132
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
133
+ }
134
+ var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;
135
+ if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {
136
+ throw new TypeError('option "customInspect", if provided, must be `true`, `false`, or `\'symbol\'`');
137
+ }
138
+
139
+ if (
140
+ has(opts, 'indent')
141
+ && opts.indent !== null
142
+ && opts.indent !== '\t'
143
+ && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)
144
+ ) {
145
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
146
+ }
147
+ if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {
148
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
149
+ }
150
+ var numericSeparator = opts.numericSeparator;
151
+
152
+ if (typeof obj === 'undefined') {
153
+ return 'undefined';
154
+ }
155
+ if (obj === null) {
156
+ return 'null';
157
+ }
158
+ if (typeof obj === 'boolean') {
159
+ return obj ? 'true' : 'false';
160
+ }
161
+
162
+ if (typeof obj === 'string') {
163
+ return inspectString(obj, opts);
164
+ }
165
+ if (typeof obj === 'number') {
166
+ if (obj === 0) {
167
+ return Infinity / obj > 0 ? '0' : '-0';
168
+ }
169
+ var str = String(obj);
170
+ return numericSeparator ? addNumericSeparator(obj, str) : str;
171
+ }
172
+ if (typeof obj === 'bigint') {
173
+ var bigIntStr = String(obj) + 'n';
174
+ return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;
175
+ }
176
+
177
+ var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;
178
+ if (typeof depth === 'undefined') { depth = 0; }
179
+ if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {
180
+ return isArray(obj) ? '[Array]' : '[Object]';
181
+ }
182
+
183
+ var indent = getIndent(opts, depth);
184
+
185
+ if (typeof seen === 'undefined') {
186
+ seen = [];
187
+ } else if (indexOf(seen, obj) >= 0) {
188
+ return '[Circular]';
189
+ }
190
+
191
+ function inspect(value, from, noIndent) {
192
+ if (from) {
193
+ seen = $arrSlice.call(seen);
194
+ seen.push(from);
195
+ }
196
+ if (noIndent) {
197
+ var newOpts = {
198
+ depth: opts.depth
199
+ };
200
+ if (has(opts, 'quoteStyle')) {
201
+ newOpts.quoteStyle = opts.quoteStyle;
202
+ }
203
+ return inspect_(value, newOpts, depth + 1, seen);
204
+ }
205
+ return inspect_(value, opts, depth + 1, seen);
206
+ }
207
+
208
+ if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable
209
+ var name = nameOf(obj);
210
+ var keys = arrObjKeys(obj, inspect);
211
+ return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');
212
+ }
213
+ if (isSymbol(obj)) {
214
+ var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\(.*\))_[^)]*$/, '$1') : symToString.call(obj);
215
+ return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;
216
+ }
217
+ if (isElement(obj)) {
218
+ var s = '<' + $toLowerCase.call(String(obj.nodeName));
219
+ var attrs = obj.attributes || [];
220
+ for (var i = 0; i < attrs.length; i++) {
221
+ s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);
222
+ }
223
+ s += '>';
224
+ if (obj.childNodes && obj.childNodes.length) { s += '...'; }
225
+ s += '</' + $toLowerCase.call(String(obj.nodeName)) + '>';
226
+ return s;
227
+ }
228
+ if (isArray(obj)) {
229
+ if (obj.length === 0) { return '[]'; }
230
+ var xs = arrObjKeys(obj, inspect);
231
+ if (indent && !singleLineValues(xs)) {
232
+ return '[' + indentedJoin(xs, indent) + ']';
233
+ }
234
+ return '[ ' + $join.call(xs, ', ') + ' ]';
235
+ }
236
+ if (isError(obj)) {
237
+ var parts = arrObjKeys(obj, inspect);
238
+ if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {
239
+ return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';
240
+ }
241
+ if (parts.length === 0) { return '[' + String(obj) + ']'; }
242
+ return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';
243
+ }
244
+ if (typeof obj === 'object' && customInspect) {
245
+ if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {
246
+ return utilInspect(obj, { depth: maxDepth - depth });
247
+ } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {
248
+ return obj.inspect();
249
+ }
250
+ }
251
+ if (isMap(obj)) {
252
+ var mapParts = [];
253
+ if (mapForEach) {
254
+ mapForEach.call(obj, function (value, key) {
255
+ mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));
256
+ });
257
+ }
258
+ return collectionOf('Map', mapSize.call(obj), mapParts, indent);
259
+ }
260
+ if (isSet(obj)) {
261
+ var setParts = [];
262
+ if (setForEach) {
263
+ setForEach.call(obj, function (value) {
264
+ setParts.push(inspect(value, obj));
265
+ });
266
+ }
267
+ return collectionOf('Set', setSize.call(obj), setParts, indent);
268
+ }
269
+ if (isWeakMap(obj)) {
270
+ return weakCollectionOf('WeakMap');
271
+ }
272
+ if (isWeakSet(obj)) {
273
+ return weakCollectionOf('WeakSet');
274
+ }
275
+ if (isWeakRef(obj)) {
276
+ return weakCollectionOf('WeakRef');
277
+ }
278
+ if (isNumber(obj)) {
279
+ return markBoxed(inspect(Number(obj)));
280
+ }
281
+ if (isBigInt(obj)) {
282
+ return markBoxed(inspect(bigIntValueOf.call(obj)));
283
+ }
284
+ if (isBoolean(obj)) {
285
+ return markBoxed(booleanValueOf.call(obj));
286
+ }
287
+ if (isString(obj)) {
288
+ return markBoxed(inspect(String(obj)));
289
+ }
290
+ // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other
291
+ /* eslint-env browser */
292
+ if (typeof window !== 'undefined' && obj === window) {
293
+ return '{ [object Window] }';
294
+ }
295
+ if (
296
+ (typeof globalThis !== 'undefined' && obj === globalThis)
297
+ || (typeof commonjsGlobal !== 'undefined' && obj === commonjsGlobal)
298
+ ) {
299
+ return '{ [object globalThis] }';
300
+ }
301
+ if (!isDate(obj) && !isRegExp(obj)) {
302
+ var ys = arrObjKeys(obj, inspect);
303
+ var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
304
+ var protoTag = obj instanceof Object ? '' : 'null prototype';
305
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';
306
+ var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';
307
+ var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');
308
+ if (ys.length === 0) { return tag + '{}'; }
309
+ if (indent) {
310
+ return tag + '{' + indentedJoin(ys, indent) + '}';
311
+ }
312
+ return tag + '{ ' + $join.call(ys, ', ') + ' }';
313
+ }
314
+ return String(obj);
315
+ };
316
+
317
+ function wrapQuotes(s, defaultStyle, opts) {
318
+ var style = opts.quoteStyle || defaultStyle;
319
+ var quoteChar = quotes[style];
320
+ return quoteChar + s + quoteChar;
321
+ }
322
+
323
+ function quote(s) {
324
+ return $replace.call(String(s), /"/g, '&quot;');
325
+ }
326
+
327
+ function canTrustToString(obj) {
328
+ return !toStringTag || !(typeof obj === 'object' && (toStringTag in obj || typeof obj[toStringTag] !== 'undefined'));
329
+ }
330
+ function isArray(obj) { return toStr(obj) === '[object Array]' && canTrustToString(obj); }
331
+ function isDate(obj) { return toStr(obj) === '[object Date]' && canTrustToString(obj); }
332
+ function isRegExp(obj) { return toStr(obj) === '[object RegExp]' && canTrustToString(obj); }
333
+ function isError(obj) { return toStr(obj) === '[object Error]' && canTrustToString(obj); }
334
+ function isString(obj) { return toStr(obj) === '[object String]' && canTrustToString(obj); }
335
+ function isNumber(obj) { return toStr(obj) === '[object Number]' && canTrustToString(obj); }
336
+ function isBoolean(obj) { return toStr(obj) === '[object Boolean]' && canTrustToString(obj); }
337
+
338
+ // Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives
339
+ function isSymbol(obj) {
340
+ if (hasShammedSymbols) {
341
+ return obj && typeof obj === 'object' && obj instanceof Symbol;
342
+ }
343
+ if (typeof obj === 'symbol') {
344
+ return true;
345
+ }
346
+ if (!obj || typeof obj !== 'object' || !symToString) {
347
+ return false;
348
+ }
349
+ try {
350
+ symToString.call(obj);
351
+ return true;
352
+ } catch (e) {}
353
+ return false;
354
+ }
355
+
356
+ function isBigInt(obj) {
357
+ if (!obj || typeof obj !== 'object' || !bigIntValueOf) {
358
+ return false;
359
+ }
360
+ try {
361
+ bigIntValueOf.call(obj);
362
+ return true;
363
+ } catch (e) {}
364
+ return false;
365
+ }
366
+
367
+ var hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };
368
+ function has(obj, key) {
369
+ return hasOwn.call(obj, key);
370
+ }
371
+
372
+ function toStr(obj) {
373
+ return objectToString.call(obj);
374
+ }
375
+
376
+ function nameOf(f) {
377
+ if (f.name) { return f.name; }
378
+ var m = $match.call(functionToString.call(f), /^function\s*([\w$]+)/);
379
+ if (m) { return m[1]; }
380
+ return null;
381
+ }
382
+
383
+ function indexOf(xs, x) {
384
+ if (xs.indexOf) { return xs.indexOf(x); }
385
+ for (var i = 0, l = xs.length; i < l; i++) {
386
+ if (xs[i] === x) { return i; }
387
+ }
388
+ return -1;
389
+ }
390
+
391
+ function isMap(x) {
392
+ if (!mapSize || !x || typeof x !== 'object') {
393
+ return false;
394
+ }
395
+ try {
396
+ mapSize.call(x);
397
+ try {
398
+ setSize.call(x);
399
+ } catch (s) {
400
+ return true;
401
+ }
402
+ return x instanceof Map; // core-js workaround, pre-v2.5.0
403
+ } catch (e) {}
404
+ return false;
405
+ }
406
+
407
+ function isWeakMap(x) {
408
+ if (!weakMapHas || !x || typeof x !== 'object') {
409
+ return false;
410
+ }
411
+ try {
412
+ weakMapHas.call(x, weakMapHas);
413
+ try {
414
+ weakSetHas.call(x, weakSetHas);
415
+ } catch (s) {
416
+ return true;
417
+ }
418
+ return x instanceof WeakMap; // core-js workaround, pre-v2.5.0
419
+ } catch (e) {}
420
+ return false;
421
+ }
422
+
423
+ function isWeakRef(x) {
424
+ if (!weakRefDeref || !x || typeof x !== 'object') {
425
+ return false;
426
+ }
427
+ try {
428
+ weakRefDeref.call(x);
429
+ return true;
430
+ } catch (e) {}
431
+ return false;
432
+ }
433
+
434
+ function isSet(x) {
435
+ if (!setSize || !x || typeof x !== 'object') {
436
+ return false;
437
+ }
438
+ try {
439
+ setSize.call(x);
440
+ try {
441
+ mapSize.call(x);
442
+ } catch (m) {
443
+ return true;
444
+ }
445
+ return x instanceof Set; // core-js workaround, pre-v2.5.0
446
+ } catch (e) {}
447
+ return false;
448
+ }
449
+
450
+ function isWeakSet(x) {
451
+ if (!weakSetHas || !x || typeof x !== 'object') {
452
+ return false;
453
+ }
454
+ try {
455
+ weakSetHas.call(x, weakSetHas);
456
+ try {
457
+ weakMapHas.call(x, weakMapHas);
458
+ } catch (s) {
459
+ return true;
460
+ }
461
+ return x instanceof WeakSet; // core-js workaround, pre-v2.5.0
462
+ } catch (e) {}
463
+ return false;
464
+ }
465
+
466
+ function isElement(x) {
467
+ if (!x || typeof x !== 'object') { return false; }
468
+ if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {
469
+ return true;
470
+ }
471
+ return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';
472
+ }
473
+
474
+ function inspectString(str, opts) {
475
+ if (str.length > opts.maxStringLength) {
476
+ var remaining = str.length - opts.maxStringLength;
477
+ var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');
478
+ return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;
479
+ }
480
+ var quoteRE = quoteREs[opts.quoteStyle || 'single'];
481
+ quoteRE.lastIndex = 0;
482
+ // eslint-disable-next-line no-control-regex
483
+ var s = $replace.call($replace.call(str, quoteRE, '\\$1'), /[\x00-\x1f]/g, lowbyte);
484
+ return wrapQuotes(s, 'single', opts);
485
+ }
486
+
487
+ function lowbyte(c) {
488
+ var n = c.charCodeAt(0);
489
+ var x = {
490
+ 8: 'b',
491
+ 9: 't',
492
+ 10: 'n',
493
+ 12: 'f',
494
+ 13: 'r'
495
+ }[n];
496
+ if (x) { return '\\' + x; }
497
+ return '\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));
498
+ }
499
+
500
+ function markBoxed(str) {
501
+ return 'Object(' + str + ')';
502
+ }
503
+
504
+ function weakCollectionOf(type) {
505
+ return type + ' { ? }';
506
+ }
507
+
508
+ function collectionOf(type, size, entries, indent) {
509
+ var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');
510
+ return type + ' (' + size + ') {' + joinedEntries + '}';
511
+ }
512
+
513
+ function singleLineValues(xs) {
514
+ for (var i = 0; i < xs.length; i++) {
515
+ if (indexOf(xs[i], '\n') >= 0) {
516
+ return false;
517
+ }
518
+ }
519
+ return true;
520
+ }
521
+
522
+ function getIndent(opts, depth) {
523
+ var baseIndent;
524
+ if (opts.indent === '\t') {
525
+ baseIndent = '\t';
526
+ } else if (typeof opts.indent === 'number' && opts.indent > 0) {
527
+ baseIndent = $join.call(Array(opts.indent + 1), ' ');
528
+ } else {
529
+ return null;
530
+ }
531
+ return {
532
+ base: baseIndent,
533
+ prev: $join.call(Array(depth + 1), baseIndent)
534
+ };
535
+ }
536
+
537
+ function indentedJoin(xs, indent) {
538
+ if (xs.length === 0) { return ''; }
539
+ var lineJoiner = '\n' + indent.prev + indent.base;
540
+ return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\n' + indent.prev;
541
+ }
542
+
543
+ function arrObjKeys(obj, inspect) {
544
+ var isArr = isArray(obj);
545
+ var xs = [];
546
+ if (isArr) {
547
+ xs.length = obj.length;
548
+ for (var i = 0; i < obj.length; i++) {
549
+ xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';
550
+ }
551
+ }
552
+ var syms = typeof gOPS === 'function' ? gOPS(obj) : [];
553
+ var symMap;
554
+ if (hasShammedSymbols) {
555
+ symMap = {};
556
+ for (var k = 0; k < syms.length; k++) {
557
+ symMap['$' + syms[k]] = syms[k];
558
+ }
559
+ }
560
+
561
+ for (var key in obj) { // eslint-disable-line no-restricted-syntax
562
+ if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
563
+ if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue
564
+ if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {
565
+ // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section
566
+ continue; // eslint-disable-line no-restricted-syntax, no-continue
567
+ } else if ($test.call(/[^\w$]/, key)) {
568
+ xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));
569
+ } else {
570
+ xs.push(key + ': ' + inspect(obj[key], obj));
571
+ }
572
+ }
573
+ if (typeof gOPS === 'function') {
574
+ for (var j = 0; j < syms.length; j++) {
575
+ if (isEnumerable.call(obj, syms[j])) {
576
+ xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));
577
+ }
578
+ }
579
+ }
580
+ return xs;
581
+ }
582
+ return objectInspect;
583
+ }
584
+
585
+ var sideChannelList;
586
+ var hasRequiredSideChannelList;
587
+
588
+ function requireSideChannelList () {
589
+ if (hasRequiredSideChannelList) return sideChannelList;
590
+ hasRequiredSideChannelList = 1;
591
+
592
+ var inspect = /*@__PURE__*/ requireObjectInspect();
593
+
594
+ var $TypeError = /*@__PURE__*/ requireType();
595
+
596
+ /*
597
+ * This function traverses the list returning the node corresponding to the given key.
598
+ *
599
+ * That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list.
600
+ * By doing so, all the recently used nodes can be accessed relatively quickly.
601
+ */
602
+ /** @type {import('./list.d.ts').listGetNode} */
603
+ // eslint-disable-next-line consistent-return
604
+ var listGetNode = function (list, key, isDelete) {
605
+ /** @type {typeof list | NonNullable<(typeof list)['next']>} */
606
+ var prev = list;
607
+ /** @type {(typeof list)['next']} */
608
+ var curr;
609
+ // eslint-disable-next-line eqeqeq
610
+ for (; (curr = prev.next) != null; prev = curr) {
611
+ if (curr.key === key) {
612
+ prev.next = curr.next;
613
+ if (!isDelete) {
614
+ // eslint-disable-next-line no-extra-parens
615
+ curr.next = /** @type {NonNullable<typeof list.next>} */ (list.next);
616
+ list.next = curr; // eslint-disable-line no-param-reassign
617
+ }
618
+ return curr;
619
+ }
620
+ }
621
+ };
622
+
623
+ /** @type {import('./list.d.ts').listGet} */
624
+ var listGet = function (objects, key) {
625
+ if (!objects) {
626
+ return void undefined;
627
+ }
628
+ var node = listGetNode(objects, key);
629
+ return node && node.value;
630
+ };
631
+ /** @type {import('./list.d.ts').listSet} */
632
+ var listSet = function (objects, key, value) {
633
+ var node = listGetNode(objects, key);
634
+ if (node) {
635
+ node.value = value;
636
+ } else {
637
+ // Prepend the new node to the beginning of the list
638
+ objects.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens
639
+ key: key,
640
+ next: objects.next,
641
+ value: value
642
+ });
643
+ }
644
+ };
645
+ /** @type {import('./list.d.ts').listHas} */
646
+ var listHas = function (objects, key) {
647
+ if (!objects) {
648
+ return false;
649
+ }
650
+ return !!listGetNode(objects, key);
651
+ };
652
+ /** @type {import('./list.d.ts').listDelete} */
653
+ // eslint-disable-next-line consistent-return
654
+ var listDelete = function (objects, key) {
655
+ if (objects) {
656
+ return listGetNode(objects, key, true);
657
+ }
658
+ };
659
+
660
+ /** @type {import('.')} */
661
+ sideChannelList = function getSideChannelList() {
662
+ /** @typedef {ReturnType<typeof getSideChannelList>} Channel */
663
+ /** @typedef {Parameters<Channel['get']>[0]} K */
664
+ /** @typedef {Parameters<Channel['set']>[1]} V */
665
+
666
+ /** @type {import('./list.d.ts').RootNode<V, K> | undefined} */ var $o;
667
+
668
+ /** @type {Channel} */
669
+ var channel = {
670
+ assert: function (key) {
671
+ if (!channel.has(key)) {
672
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
673
+ }
674
+ },
675
+ 'delete': function (key) {
676
+ var root = $o && $o.next;
677
+ var deletedNode = listDelete($o, key);
678
+ if (deletedNode && root && root === deletedNode) {
679
+ $o = void undefined;
680
+ }
681
+ return !!deletedNode;
682
+ },
683
+ get: function (key) {
684
+ return listGet($o, key);
685
+ },
686
+ has: function (key) {
687
+ return listHas($o, key);
688
+ },
689
+ set: function (key, value) {
690
+ if (!$o) {
691
+ // Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head
692
+ $o = {
693
+ next: void undefined
694
+ };
695
+ }
696
+ // eslint-disable-next-line no-extra-parens
697
+ listSet(/** @type {NonNullable<typeof $o>} */ ($o), key, value);
698
+ }
699
+ };
700
+ // @ts-expect-error TODO: figure out why this is erroring
701
+ return channel;
702
+ };
703
+ return sideChannelList;
704
+ }
705
+
706
+ var esObjectAtoms;
707
+ var hasRequiredEsObjectAtoms;
708
+
709
+ function requireEsObjectAtoms () {
710
+ if (hasRequiredEsObjectAtoms) return esObjectAtoms;
711
+ hasRequiredEsObjectAtoms = 1;
712
+
713
+ /** @type {import('.')} */
714
+ esObjectAtoms = Object;
715
+ return esObjectAtoms;
716
+ }
717
+
718
+ var esErrors;
719
+ var hasRequiredEsErrors;
720
+
721
+ function requireEsErrors () {
722
+ if (hasRequiredEsErrors) return esErrors;
723
+ hasRequiredEsErrors = 1;
724
+
725
+ /** @type {import('.')} */
726
+ esErrors = Error;
727
+ return esErrors;
728
+ }
729
+
730
+ var _eval;
731
+ var hasRequired_eval;
732
+
733
+ function require_eval () {
734
+ if (hasRequired_eval) return _eval;
735
+ hasRequired_eval = 1;
736
+
737
+ /** @type {import('./eval')} */
738
+ _eval = EvalError;
739
+ return _eval;
740
+ }
741
+
742
+ var range;
743
+ var hasRequiredRange;
744
+
745
+ function requireRange () {
746
+ if (hasRequiredRange) return range;
747
+ hasRequiredRange = 1;
748
+
749
+ /** @type {import('./range')} */
750
+ range = RangeError;
751
+ return range;
752
+ }
753
+
754
+ var ref;
755
+ var hasRequiredRef;
756
+
757
+ function requireRef () {
758
+ if (hasRequiredRef) return ref;
759
+ hasRequiredRef = 1;
760
+
761
+ /** @type {import('./ref')} */
762
+ ref = ReferenceError;
763
+ return ref;
764
+ }
765
+
766
+ var syntax;
767
+ var hasRequiredSyntax;
768
+
769
+ function requireSyntax () {
770
+ if (hasRequiredSyntax) return syntax;
771
+ hasRequiredSyntax = 1;
772
+
773
+ /** @type {import('./syntax')} */
774
+ syntax = SyntaxError;
775
+ return syntax;
776
+ }
777
+
778
+ var uri;
779
+ var hasRequiredUri;
780
+
781
+ function requireUri () {
782
+ if (hasRequiredUri) return uri;
783
+ hasRequiredUri = 1;
784
+
785
+ /** @type {import('./uri')} */
786
+ uri = URIError;
787
+ return uri;
788
+ }
789
+
790
+ var abs;
791
+ var hasRequiredAbs;
792
+
793
+ function requireAbs () {
794
+ if (hasRequiredAbs) return abs;
795
+ hasRequiredAbs = 1;
796
+
797
+ /** @type {import('./abs')} */
798
+ abs = Math.abs;
799
+ return abs;
800
+ }
801
+
802
+ var floor;
803
+ var hasRequiredFloor;
804
+
805
+ function requireFloor () {
806
+ if (hasRequiredFloor) return floor;
807
+ hasRequiredFloor = 1;
808
+
809
+ /** @type {import('./floor')} */
810
+ floor = Math.floor;
811
+ return floor;
812
+ }
813
+
814
+ var max;
815
+ var hasRequiredMax;
816
+
817
+ function requireMax () {
818
+ if (hasRequiredMax) return max;
819
+ hasRequiredMax = 1;
820
+
821
+ /** @type {import('./max')} */
822
+ max = Math.max;
823
+ return max;
824
+ }
825
+
826
+ var min;
827
+ var hasRequiredMin;
828
+
829
+ function requireMin () {
830
+ if (hasRequiredMin) return min;
831
+ hasRequiredMin = 1;
832
+
833
+ /** @type {import('./min')} */
834
+ min = Math.min;
835
+ return min;
836
+ }
837
+
838
+ var pow;
839
+ var hasRequiredPow;
840
+
841
+ function requirePow () {
842
+ if (hasRequiredPow) return pow;
843
+ hasRequiredPow = 1;
844
+
845
+ /** @type {import('./pow')} */
846
+ pow = Math.pow;
847
+ return pow;
848
+ }
849
+
850
+ var round;
851
+ var hasRequiredRound;
852
+
853
+ function requireRound () {
854
+ if (hasRequiredRound) return round;
855
+ hasRequiredRound = 1;
856
+
857
+ /** @type {import('./round')} */
858
+ round = Math.round;
859
+ return round;
860
+ }
861
+
862
+ var _isNaN;
863
+ var hasRequired_isNaN;
864
+
865
+ function require_isNaN () {
866
+ if (hasRequired_isNaN) return _isNaN;
867
+ hasRequired_isNaN = 1;
868
+
869
+ /** @type {import('./isNaN')} */
870
+ _isNaN = Number.isNaN || function isNaN(a) {
871
+ return a !== a;
872
+ };
873
+ return _isNaN;
874
+ }
875
+
876
+ var sign;
877
+ var hasRequiredSign;
878
+
879
+ function requireSign () {
880
+ if (hasRequiredSign) return sign;
881
+ hasRequiredSign = 1;
882
+
883
+ var $isNaN = /*@__PURE__*/ require_isNaN();
884
+
885
+ /** @type {import('./sign')} */
886
+ sign = function sign(number) {
887
+ if ($isNaN(number) || number === 0) {
888
+ return number;
889
+ }
890
+ return number < 0 ? -1 : 1;
891
+ };
892
+ return sign;
893
+ }
894
+
895
+ var gOPD;
896
+ var hasRequiredGOPD;
897
+
898
+ function requireGOPD () {
899
+ if (hasRequiredGOPD) return gOPD;
900
+ hasRequiredGOPD = 1;
901
+
902
+ /** @type {import('./gOPD')} */
903
+ gOPD = Object.getOwnPropertyDescriptor;
904
+ return gOPD;
905
+ }
906
+
907
+ var gopd;
908
+ var hasRequiredGopd;
909
+
910
+ function requireGopd () {
911
+ if (hasRequiredGopd) return gopd;
912
+ hasRequiredGopd = 1;
913
+
914
+ /** @type {import('.')} */
915
+ var $gOPD = /*@__PURE__*/ requireGOPD();
916
+
917
+ if ($gOPD) {
918
+ try {
919
+ $gOPD([], 'length');
920
+ } catch (e) {
921
+ // IE 8 has a broken gOPD
922
+ $gOPD = null;
923
+ }
924
+ }
925
+
926
+ gopd = $gOPD;
927
+ return gopd;
928
+ }
929
+
930
+ var esDefineProperty;
931
+ var hasRequiredEsDefineProperty;
932
+
933
+ function requireEsDefineProperty () {
934
+ if (hasRequiredEsDefineProperty) return esDefineProperty;
935
+ hasRequiredEsDefineProperty = 1;
936
+
937
+ /** @type {import('.')} */
938
+ var $defineProperty = Object.defineProperty || false;
939
+ if ($defineProperty) {
940
+ try {
941
+ $defineProperty({}, 'a', { value: 1 });
942
+ } catch (e) {
943
+ // IE 8 has a broken defineProperty
944
+ $defineProperty = false;
945
+ }
946
+ }
947
+
948
+ esDefineProperty = $defineProperty;
949
+ return esDefineProperty;
950
+ }
951
+
952
+ var shams;
953
+ var hasRequiredShams;
954
+
955
+ function requireShams () {
956
+ if (hasRequiredShams) return shams;
957
+ hasRequiredShams = 1;
958
+
959
+ /** @type {import('./shams')} */
960
+ /* eslint complexity: [2, 18], max-statements: [2, 33] */
961
+ shams = function hasSymbols() {
962
+ if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
963
+ if (typeof Symbol.iterator === 'symbol') { return true; }
964
+
965
+ /** @type {{ [k in symbol]?: unknown }} */
966
+ var obj = {};
967
+ var sym = Symbol('test');
968
+ var symObj = Object(sym);
969
+ if (typeof sym === 'string') { return false; }
970
+
971
+ if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
972
+ if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
973
+
974
+ // temp disabled per https://github.com/ljharb/object.assign/issues/17
975
+ // if (sym instanceof Symbol) { return false; }
976
+ // temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
977
+ // if (!(symObj instanceof Symbol)) { return false; }
978
+
979
+ // if (typeof Symbol.prototype.toString !== 'function') { return false; }
980
+ // if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
981
+
982
+ var symVal = 42;
983
+ obj[sym] = symVal;
984
+ for (var _ in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
985
+ if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
986
+
987
+ if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
988
+
989
+ var syms = Object.getOwnPropertySymbols(obj);
990
+ if (syms.length !== 1 || syms[0] !== sym) { return false; }
991
+
992
+ if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
993
+
994
+ if (typeof Object.getOwnPropertyDescriptor === 'function') {
995
+ // eslint-disable-next-line no-extra-parens
996
+ var descriptor = /** @type {PropertyDescriptor} */ (Object.getOwnPropertyDescriptor(obj, sym));
997
+ if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
998
+ }
999
+
1000
+ return true;
1001
+ };
1002
+ return shams;
1003
+ }
1004
+
1005
+ var hasSymbols;
1006
+ var hasRequiredHasSymbols;
1007
+
1008
+ function requireHasSymbols () {
1009
+ if (hasRequiredHasSymbols) return hasSymbols;
1010
+ hasRequiredHasSymbols = 1;
1011
+
1012
+ var origSymbol = typeof Symbol !== 'undefined' && Symbol;
1013
+ var hasSymbolSham = requireShams();
1014
+
1015
+ /** @type {import('.')} */
1016
+ hasSymbols = function hasNativeSymbols() {
1017
+ if (typeof origSymbol !== 'function') { return false; }
1018
+ if (typeof Symbol !== 'function') { return false; }
1019
+ if (typeof origSymbol('foo') !== 'symbol') { return false; }
1020
+ if (typeof Symbol('bar') !== 'symbol') { return false; }
1021
+
1022
+ return hasSymbolSham();
1023
+ };
1024
+ return hasSymbols;
1025
+ }
1026
+
1027
+ var Reflect_getPrototypeOf;
1028
+ var hasRequiredReflect_getPrototypeOf;
1029
+
1030
+ function requireReflect_getPrototypeOf () {
1031
+ if (hasRequiredReflect_getPrototypeOf) return Reflect_getPrototypeOf;
1032
+ hasRequiredReflect_getPrototypeOf = 1;
1033
+
1034
+ /** @type {import('./Reflect.getPrototypeOf')} */
1035
+ Reflect_getPrototypeOf = (typeof Reflect !== 'undefined' && Reflect.getPrototypeOf) || null;
1036
+ return Reflect_getPrototypeOf;
1037
+ }
1038
+
1039
+ var Object_getPrototypeOf;
1040
+ var hasRequiredObject_getPrototypeOf;
1041
+
1042
+ function requireObject_getPrototypeOf () {
1043
+ if (hasRequiredObject_getPrototypeOf) return Object_getPrototypeOf;
1044
+ hasRequiredObject_getPrototypeOf = 1;
1045
+
1046
+ var $Object = /*@__PURE__*/ requireEsObjectAtoms();
1047
+
1048
+ /** @type {import('./Object.getPrototypeOf')} */
1049
+ Object_getPrototypeOf = $Object.getPrototypeOf || null;
1050
+ return Object_getPrototypeOf;
1051
+ }
1052
+
1053
+ var implementation;
1054
+ var hasRequiredImplementation;
1055
+
1056
+ function requireImplementation () {
1057
+ if (hasRequiredImplementation) return implementation;
1058
+ hasRequiredImplementation = 1;
1059
+
1060
+ /* eslint no-invalid-this: 1 */
1061
+
1062
+ var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
1063
+ var toStr = Object.prototype.toString;
1064
+ var max = Math.max;
1065
+ var funcType = '[object Function]';
1066
+
1067
+ var concatty = function concatty(a, b) {
1068
+ var arr = [];
1069
+
1070
+ for (var i = 0; i < a.length; i += 1) {
1071
+ arr[i] = a[i];
1072
+ }
1073
+ for (var j = 0; j < b.length; j += 1) {
1074
+ arr[j + a.length] = b[j];
1075
+ }
1076
+
1077
+ return arr;
1078
+ };
1079
+
1080
+ var slicy = function slicy(arrLike, offset) {
1081
+ var arr = [];
1082
+ for (var i = offset, j = 0; i < arrLike.length; i += 1, j += 1) {
1083
+ arr[j] = arrLike[i];
1084
+ }
1085
+ return arr;
1086
+ };
1087
+
1088
+ var joiny = function (arr, joiner) {
1089
+ var str = '';
1090
+ for (var i = 0; i < arr.length; i += 1) {
1091
+ str += arr[i];
1092
+ if (i + 1 < arr.length) {
1093
+ str += joiner;
1094
+ }
1095
+ }
1096
+ return str;
1097
+ };
1098
+
1099
+ implementation = function bind(that) {
1100
+ var target = this;
1101
+ if (typeof target !== 'function' || toStr.apply(target) !== funcType) {
1102
+ throw new TypeError(ERROR_MESSAGE + target);
1103
+ }
1104
+ var args = slicy(arguments, 1);
1105
+
1106
+ var bound;
1107
+ var binder = function () {
1108
+ if (this instanceof bound) {
1109
+ var result = target.apply(
1110
+ this,
1111
+ concatty(args, arguments)
1112
+ );
1113
+ if (Object(result) === result) {
1114
+ return result;
1115
+ }
1116
+ return this;
1117
+ }
1118
+ return target.apply(
1119
+ that,
1120
+ concatty(args, arguments)
1121
+ );
1122
+
1123
+ };
1124
+
1125
+ var boundLength = max(0, target.length - args.length);
1126
+ var boundArgs = [];
1127
+ for (var i = 0; i < boundLength; i++) {
1128
+ boundArgs[i] = '$' + i;
1129
+ }
1130
+
1131
+ bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);
1132
+
1133
+ if (target.prototype) {
1134
+ var Empty = function Empty() {};
1135
+ Empty.prototype = target.prototype;
1136
+ bound.prototype = new Empty();
1137
+ Empty.prototype = null;
1138
+ }
1139
+
1140
+ return bound;
1141
+ };
1142
+ return implementation;
1143
+ }
1144
+
1145
+ var functionBind;
1146
+ var hasRequiredFunctionBind;
1147
+
1148
+ function requireFunctionBind () {
1149
+ if (hasRequiredFunctionBind) return functionBind;
1150
+ hasRequiredFunctionBind = 1;
1151
+
1152
+ var implementation = requireImplementation();
1153
+
1154
+ functionBind = Function.prototype.bind || implementation;
1155
+ return functionBind;
1156
+ }
1157
+
1158
+ var functionCall;
1159
+ var hasRequiredFunctionCall;
1160
+
1161
+ function requireFunctionCall () {
1162
+ if (hasRequiredFunctionCall) return functionCall;
1163
+ hasRequiredFunctionCall = 1;
1164
+
1165
+ /** @type {import('./functionCall')} */
1166
+ functionCall = Function.prototype.call;
1167
+ return functionCall;
1168
+ }
1169
+
1170
+ var functionApply;
1171
+ var hasRequiredFunctionApply;
1172
+
1173
+ function requireFunctionApply () {
1174
+ if (hasRequiredFunctionApply) return functionApply;
1175
+ hasRequiredFunctionApply = 1;
1176
+
1177
+ /** @type {import('./functionApply')} */
1178
+ functionApply = Function.prototype.apply;
1179
+ return functionApply;
1180
+ }
1181
+
1182
+ var reflectApply;
1183
+ var hasRequiredReflectApply;
1184
+
1185
+ function requireReflectApply () {
1186
+ if (hasRequiredReflectApply) return reflectApply;
1187
+ hasRequiredReflectApply = 1;
1188
+
1189
+ /** @type {import('./reflectApply')} */
1190
+ reflectApply = typeof Reflect !== 'undefined' && Reflect && Reflect.apply;
1191
+ return reflectApply;
1192
+ }
1193
+
1194
+ var actualApply;
1195
+ var hasRequiredActualApply;
1196
+
1197
+ function requireActualApply () {
1198
+ if (hasRequiredActualApply) return actualApply;
1199
+ hasRequiredActualApply = 1;
1200
+
1201
+ var bind = requireFunctionBind();
1202
+
1203
+ var $apply = requireFunctionApply();
1204
+ var $call = requireFunctionCall();
1205
+ var $reflectApply = requireReflectApply();
1206
+
1207
+ /** @type {import('./actualApply')} */
1208
+ actualApply = $reflectApply || bind.call($call, $apply);
1209
+ return actualApply;
1210
+ }
1211
+
1212
+ var callBindApplyHelpers;
1213
+ var hasRequiredCallBindApplyHelpers;
1214
+
1215
+ function requireCallBindApplyHelpers () {
1216
+ if (hasRequiredCallBindApplyHelpers) return callBindApplyHelpers;
1217
+ hasRequiredCallBindApplyHelpers = 1;
1218
+
1219
+ var bind = requireFunctionBind();
1220
+ var $TypeError = /*@__PURE__*/ requireType();
1221
+
1222
+ var $call = requireFunctionCall();
1223
+ var $actualApply = requireActualApply();
1224
+
1225
+ /** @type {(args: [Function, thisArg?: unknown, ...args: unknown[]]) => Function} TODO FIXME, find a way to use import('.') */
1226
+ callBindApplyHelpers = function callBindBasic(args) {
1227
+ if (args.length < 1 || typeof args[0] !== 'function') {
1228
+ throw new $TypeError('a function is required');
1229
+ }
1230
+ return $actualApply(bind, $call, args);
1231
+ };
1232
+ return callBindApplyHelpers;
1233
+ }
1234
+
1235
+ var get;
1236
+ var hasRequiredGet;
1237
+
1238
+ function requireGet () {
1239
+ if (hasRequiredGet) return get;
1240
+ hasRequiredGet = 1;
1241
+
1242
+ var callBind = requireCallBindApplyHelpers();
1243
+ var gOPD = /*@__PURE__*/ requireGopd();
1244
+
1245
+ var hasProtoAccessor;
1246
+ try {
1247
+ // eslint-disable-next-line no-extra-parens, no-proto
1248
+ hasProtoAccessor = /** @type {{ __proto__?: typeof Array.prototype }} */ ([]).__proto__ === Array.prototype;
1249
+ } catch (e) {
1250
+ if (!e || typeof e !== 'object' || !('code' in e) || e.code !== 'ERR_PROTO_ACCESS') {
1251
+ throw e;
1252
+ }
1253
+ }
1254
+
1255
+ // eslint-disable-next-line no-extra-parens
1256
+ var desc = !!hasProtoAccessor && gOPD && gOPD(Object.prototype, /** @type {keyof typeof Object.prototype} */ ('__proto__'));
1257
+
1258
+ var $Object = Object;
1259
+ var $getPrototypeOf = $Object.getPrototypeOf;
1260
+
1261
+ /** @type {import('./get')} */
1262
+ get = desc && typeof desc.get === 'function'
1263
+ ? callBind([desc.get])
1264
+ : typeof $getPrototypeOf === 'function'
1265
+ ? /** @type {import('./get')} */ function getDunder(value) {
1266
+ // eslint-disable-next-line eqeqeq
1267
+ return $getPrototypeOf(value == null ? value : $Object(value));
1268
+ }
1269
+ : false;
1270
+ return get;
1271
+ }
1272
+
1273
+ var getProto;
1274
+ var hasRequiredGetProto;
1275
+
1276
+ function requireGetProto () {
1277
+ if (hasRequiredGetProto) return getProto;
1278
+ hasRequiredGetProto = 1;
1279
+
1280
+ var reflectGetProto = requireReflect_getPrototypeOf();
1281
+ var originalGetProto = requireObject_getPrototypeOf();
1282
+
1283
+ var getDunderProto = /*@__PURE__*/ requireGet();
1284
+
1285
+ /** @type {import('.')} */
1286
+ getProto = reflectGetProto
1287
+ ? function getProto(O) {
1288
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
1289
+ return reflectGetProto(O);
1290
+ }
1291
+ : originalGetProto
1292
+ ? function getProto(O) {
1293
+ if (!O || (typeof O !== 'object' && typeof O !== 'function')) {
1294
+ throw new TypeError('getProto: not an object');
1295
+ }
1296
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
1297
+ return originalGetProto(O);
1298
+ }
1299
+ : getDunderProto
1300
+ ? function getProto(O) {
1301
+ // @ts-expect-error TS can't narrow inside a closure, for some reason
1302
+ return getDunderProto(O);
1303
+ }
1304
+ : null;
1305
+ return getProto;
1306
+ }
1307
+
1308
+ var hasown;
1309
+ var hasRequiredHasown;
1310
+
1311
+ function requireHasown () {
1312
+ if (hasRequiredHasown) return hasown;
1313
+ hasRequiredHasown = 1;
1314
+
1315
+ var call = Function.prototype.call;
1316
+ var $hasOwn = Object.prototype.hasOwnProperty;
1317
+ var bind = requireFunctionBind();
1318
+
1319
+ /** @type {import('.')} */
1320
+ hasown = bind.call(call, $hasOwn);
1321
+ return hasown;
1322
+ }
1323
+
1324
+ var getIntrinsic;
1325
+ var hasRequiredGetIntrinsic;
1326
+
1327
+ function requireGetIntrinsic () {
1328
+ if (hasRequiredGetIntrinsic) return getIntrinsic;
1329
+ hasRequiredGetIntrinsic = 1;
1330
+
1331
+ var undefined$1;
1332
+
1333
+ var $Object = /*@__PURE__*/ requireEsObjectAtoms();
1334
+
1335
+ var $Error = /*@__PURE__*/ requireEsErrors();
1336
+ var $EvalError = /*@__PURE__*/ require_eval();
1337
+ var $RangeError = /*@__PURE__*/ requireRange();
1338
+ var $ReferenceError = /*@__PURE__*/ requireRef();
1339
+ var $SyntaxError = /*@__PURE__*/ requireSyntax();
1340
+ var $TypeError = /*@__PURE__*/ requireType();
1341
+ var $URIError = /*@__PURE__*/ requireUri();
1342
+
1343
+ var abs = /*@__PURE__*/ requireAbs();
1344
+ var floor = /*@__PURE__*/ requireFloor();
1345
+ var max = /*@__PURE__*/ requireMax();
1346
+ var min = /*@__PURE__*/ requireMin();
1347
+ var pow = /*@__PURE__*/ requirePow();
1348
+ var round = /*@__PURE__*/ requireRound();
1349
+ var sign = /*@__PURE__*/ requireSign();
1350
+
1351
+ var $Function = Function;
1352
+
1353
+ // eslint-disable-next-line consistent-return
1354
+ var getEvalledConstructor = function (expressionSyntax) {
1355
+ try {
1356
+ return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
1357
+ } catch (e) {}
1358
+ };
1359
+
1360
+ var $gOPD = /*@__PURE__*/ requireGopd();
1361
+ var $defineProperty = /*@__PURE__*/ requireEsDefineProperty();
1362
+
1363
+ var throwTypeError = function () {
1364
+ throw new $TypeError();
1365
+ };
1366
+ var ThrowTypeError = $gOPD
1367
+ ? (function () {
1368
+ try {
1369
+ // eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
1370
+ arguments.callee; // IE 8 does not throw here
1371
+ return throwTypeError;
1372
+ } catch (calleeThrows) {
1373
+ try {
1374
+ // IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
1375
+ return $gOPD(arguments, 'callee').get;
1376
+ } catch (gOPDthrows) {
1377
+ return throwTypeError;
1378
+ }
1379
+ }
1380
+ }())
1381
+ : throwTypeError;
1382
+
1383
+ var hasSymbols = requireHasSymbols()();
1384
+
1385
+ var getProto = requireGetProto();
1386
+ var $ObjectGPO = requireObject_getPrototypeOf();
1387
+ var $ReflectGPO = requireReflect_getPrototypeOf();
1388
+
1389
+ var $apply = requireFunctionApply();
1390
+ var $call = requireFunctionCall();
1391
+
1392
+ var needsEval = {};
1393
+
1394
+ var TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined$1 : getProto(Uint8Array);
1395
+
1396
+ var INTRINSICS = {
1397
+ __proto__: null,
1398
+ '%AggregateError%': typeof AggregateError === 'undefined' ? undefined$1 : AggregateError,
1399
+ '%Array%': Array,
1400
+ '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined$1 : ArrayBuffer,
1401
+ '%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined$1,
1402
+ '%AsyncFromSyncIteratorPrototype%': undefined$1,
1403
+ '%AsyncFunction%': needsEval,
1404
+ '%AsyncGenerator%': needsEval,
1405
+ '%AsyncGeneratorFunction%': needsEval,
1406
+ '%AsyncIteratorPrototype%': needsEval,
1407
+ '%Atomics%': typeof Atomics === 'undefined' ? undefined$1 : Atomics,
1408
+ '%BigInt%': typeof BigInt === 'undefined' ? undefined$1 : BigInt,
1409
+ '%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined$1 : BigInt64Array,
1410
+ '%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined$1 : BigUint64Array,
1411
+ '%Boolean%': Boolean,
1412
+ '%DataView%': typeof DataView === 'undefined' ? undefined$1 : DataView,
1413
+ '%Date%': Date,
1414
+ '%decodeURI%': decodeURI,
1415
+ '%decodeURIComponent%': decodeURIComponent,
1416
+ '%encodeURI%': encodeURI,
1417
+ '%encodeURIComponent%': encodeURIComponent,
1418
+ '%Error%': $Error,
1419
+ '%eval%': eval, // eslint-disable-line no-eval
1420
+ '%EvalError%': $EvalError,
1421
+ '%Float16Array%': typeof Float16Array === 'undefined' ? undefined$1 : Float16Array,
1422
+ '%Float32Array%': typeof Float32Array === 'undefined' ? undefined$1 : Float32Array,
1423
+ '%Float64Array%': typeof Float64Array === 'undefined' ? undefined$1 : Float64Array,
1424
+ '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined$1 : FinalizationRegistry,
1425
+ '%Function%': $Function,
1426
+ '%GeneratorFunction%': needsEval,
1427
+ '%Int8Array%': typeof Int8Array === 'undefined' ? undefined$1 : Int8Array,
1428
+ '%Int16Array%': typeof Int16Array === 'undefined' ? undefined$1 : Int16Array,
1429
+ '%Int32Array%': typeof Int32Array === 'undefined' ? undefined$1 : Int32Array,
1430
+ '%isFinite%': isFinite,
1431
+ '%isNaN%': isNaN,
1432
+ '%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined$1,
1433
+ '%JSON%': typeof JSON === 'object' ? JSON : undefined$1,
1434
+ '%Map%': typeof Map === 'undefined' ? undefined$1 : Map,
1435
+ '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Map()[Symbol.iterator]()),
1436
+ '%Math%': Math,
1437
+ '%Number%': Number,
1438
+ '%Object%': $Object,
1439
+ '%Object.getOwnPropertyDescriptor%': $gOPD,
1440
+ '%parseFloat%': parseFloat,
1441
+ '%parseInt%': parseInt,
1442
+ '%Promise%': typeof Promise === 'undefined' ? undefined$1 : Promise,
1443
+ '%Proxy%': typeof Proxy === 'undefined' ? undefined$1 : Proxy,
1444
+ '%RangeError%': $RangeError,
1445
+ '%ReferenceError%': $ReferenceError,
1446
+ '%Reflect%': typeof Reflect === 'undefined' ? undefined$1 : Reflect,
1447
+ '%RegExp%': RegExp,
1448
+ '%Set%': typeof Set === 'undefined' ? undefined$1 : Set,
1449
+ '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined$1 : getProto(new Set()[Symbol.iterator]()),
1450
+ '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined$1 : SharedArrayBuffer,
1451
+ '%String%': String,
1452
+ '%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined$1,
1453
+ '%Symbol%': hasSymbols ? Symbol : undefined$1,
1454
+ '%SyntaxError%': $SyntaxError,
1455
+ '%ThrowTypeError%': ThrowTypeError,
1456
+ '%TypedArray%': TypedArray,
1457
+ '%TypeError%': $TypeError,
1458
+ '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined$1 : Uint8Array,
1459
+ '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined$1 : Uint8ClampedArray,
1460
+ '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined$1 : Uint16Array,
1461
+ '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined$1 : Uint32Array,
1462
+ '%URIError%': $URIError,
1463
+ '%WeakMap%': typeof WeakMap === 'undefined' ? undefined$1 : WeakMap,
1464
+ '%WeakRef%': typeof WeakRef === 'undefined' ? undefined$1 : WeakRef,
1465
+ '%WeakSet%': typeof WeakSet === 'undefined' ? undefined$1 : WeakSet,
1466
+
1467
+ '%Function.prototype.call%': $call,
1468
+ '%Function.prototype.apply%': $apply,
1469
+ '%Object.defineProperty%': $defineProperty,
1470
+ '%Object.getPrototypeOf%': $ObjectGPO,
1471
+ '%Math.abs%': abs,
1472
+ '%Math.floor%': floor,
1473
+ '%Math.max%': max,
1474
+ '%Math.min%': min,
1475
+ '%Math.pow%': pow,
1476
+ '%Math.round%': round,
1477
+ '%Math.sign%': sign,
1478
+ '%Reflect.getPrototypeOf%': $ReflectGPO
1479
+ };
1480
+
1481
+ if (getProto) {
1482
+ try {
1483
+ null.error; // eslint-disable-line no-unused-expressions
1484
+ } catch (e) {
1485
+ // https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229
1486
+ var errorProto = getProto(getProto(e));
1487
+ INTRINSICS['%Error.prototype%'] = errorProto;
1488
+ }
1489
+ }
1490
+
1491
+ var doEval = function doEval(name) {
1492
+ var value;
1493
+ if (name === '%AsyncFunction%') {
1494
+ value = getEvalledConstructor('async function () {}');
1495
+ } else if (name === '%GeneratorFunction%') {
1496
+ value = getEvalledConstructor('function* () {}');
1497
+ } else if (name === '%AsyncGeneratorFunction%') {
1498
+ value = getEvalledConstructor('async function* () {}');
1499
+ } else if (name === '%AsyncGenerator%') {
1500
+ var fn = doEval('%AsyncGeneratorFunction%');
1501
+ if (fn) {
1502
+ value = fn.prototype;
1503
+ }
1504
+ } else if (name === '%AsyncIteratorPrototype%') {
1505
+ var gen = doEval('%AsyncGenerator%');
1506
+ if (gen && getProto) {
1507
+ value = getProto(gen.prototype);
1508
+ }
1509
+ }
1510
+
1511
+ INTRINSICS[name] = value;
1512
+
1513
+ return value;
1514
+ };
1515
+
1516
+ var LEGACY_ALIASES = {
1517
+ __proto__: null,
1518
+ '%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
1519
+ '%ArrayPrototype%': ['Array', 'prototype'],
1520
+ '%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
1521
+ '%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
1522
+ '%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
1523
+ '%ArrayProto_values%': ['Array', 'prototype', 'values'],
1524
+ '%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
1525
+ '%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
1526
+ '%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
1527
+ '%BooleanPrototype%': ['Boolean', 'prototype'],
1528
+ '%DataViewPrototype%': ['DataView', 'prototype'],
1529
+ '%DatePrototype%': ['Date', 'prototype'],
1530
+ '%ErrorPrototype%': ['Error', 'prototype'],
1531
+ '%EvalErrorPrototype%': ['EvalError', 'prototype'],
1532
+ '%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
1533
+ '%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
1534
+ '%FunctionPrototype%': ['Function', 'prototype'],
1535
+ '%Generator%': ['GeneratorFunction', 'prototype'],
1536
+ '%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
1537
+ '%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
1538
+ '%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
1539
+ '%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
1540
+ '%JSONParse%': ['JSON', 'parse'],
1541
+ '%JSONStringify%': ['JSON', 'stringify'],
1542
+ '%MapPrototype%': ['Map', 'prototype'],
1543
+ '%NumberPrototype%': ['Number', 'prototype'],
1544
+ '%ObjectPrototype%': ['Object', 'prototype'],
1545
+ '%ObjProto_toString%': ['Object', 'prototype', 'toString'],
1546
+ '%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
1547
+ '%PromisePrototype%': ['Promise', 'prototype'],
1548
+ '%PromiseProto_then%': ['Promise', 'prototype', 'then'],
1549
+ '%Promise_all%': ['Promise', 'all'],
1550
+ '%Promise_reject%': ['Promise', 'reject'],
1551
+ '%Promise_resolve%': ['Promise', 'resolve'],
1552
+ '%RangeErrorPrototype%': ['RangeError', 'prototype'],
1553
+ '%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
1554
+ '%RegExpPrototype%': ['RegExp', 'prototype'],
1555
+ '%SetPrototype%': ['Set', 'prototype'],
1556
+ '%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
1557
+ '%StringPrototype%': ['String', 'prototype'],
1558
+ '%SymbolPrototype%': ['Symbol', 'prototype'],
1559
+ '%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
1560
+ '%TypedArrayPrototype%': ['TypedArray', 'prototype'],
1561
+ '%TypeErrorPrototype%': ['TypeError', 'prototype'],
1562
+ '%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
1563
+ '%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
1564
+ '%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
1565
+ '%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
1566
+ '%URIErrorPrototype%': ['URIError', 'prototype'],
1567
+ '%WeakMapPrototype%': ['WeakMap', 'prototype'],
1568
+ '%WeakSetPrototype%': ['WeakSet', 'prototype']
1569
+ };
1570
+
1571
+ var bind = requireFunctionBind();
1572
+ var hasOwn = /*@__PURE__*/ requireHasown();
1573
+ var $concat = bind.call($call, Array.prototype.concat);
1574
+ var $spliceApply = bind.call($apply, Array.prototype.splice);
1575
+ var $replace = bind.call($call, String.prototype.replace);
1576
+ var $strSlice = bind.call($call, String.prototype.slice);
1577
+ var $exec = bind.call($call, RegExp.prototype.exec);
1578
+
1579
+ /* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
1580
+ var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
1581
+ var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
1582
+ var stringToPath = function stringToPath(string) {
1583
+ var first = $strSlice(string, 0, 1);
1584
+ var last = $strSlice(string, -1);
1585
+ if (first === '%' && last !== '%') {
1586
+ throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
1587
+ } else if (last === '%' && first !== '%') {
1588
+ throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
1589
+ }
1590
+ var result = [];
1591
+ $replace(string, rePropName, function (match, number, quote, subString) {
1592
+ result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
1593
+ });
1594
+ return result;
1595
+ };
1596
+ /* end adaptation */
1597
+
1598
+ var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
1599
+ var intrinsicName = name;
1600
+ var alias;
1601
+ if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
1602
+ alias = LEGACY_ALIASES[intrinsicName];
1603
+ intrinsicName = '%' + alias[0] + '%';
1604
+ }
1605
+
1606
+ if (hasOwn(INTRINSICS, intrinsicName)) {
1607
+ var value = INTRINSICS[intrinsicName];
1608
+ if (value === needsEval) {
1609
+ value = doEval(intrinsicName);
1610
+ }
1611
+ if (typeof value === 'undefined' && !allowMissing) {
1612
+ throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
1613
+ }
1614
+
1615
+ return {
1616
+ alias: alias,
1617
+ name: intrinsicName,
1618
+ value: value
1619
+ };
1620
+ }
1621
+
1622
+ throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
1623
+ };
1624
+
1625
+ getIntrinsic = function GetIntrinsic(name, allowMissing) {
1626
+ if (typeof name !== 'string' || name.length === 0) {
1627
+ throw new $TypeError('intrinsic name must be a non-empty string');
1628
+ }
1629
+ if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
1630
+ throw new $TypeError('"allowMissing" argument must be a boolean');
1631
+ }
1632
+
1633
+ if ($exec(/^%?[^%]*%?$/, name) === null) {
1634
+ throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');
1635
+ }
1636
+ var parts = stringToPath(name);
1637
+ var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
1638
+
1639
+ var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
1640
+ var intrinsicRealName = intrinsic.name;
1641
+ var value = intrinsic.value;
1642
+ var skipFurtherCaching = false;
1643
+
1644
+ var alias = intrinsic.alias;
1645
+ if (alias) {
1646
+ intrinsicBaseName = alias[0];
1647
+ $spliceApply(parts, $concat([0, 1], alias));
1648
+ }
1649
+
1650
+ for (var i = 1, isOwn = true; i < parts.length; i += 1) {
1651
+ var part = parts[i];
1652
+ var first = $strSlice(part, 0, 1);
1653
+ var last = $strSlice(part, -1);
1654
+ if (
1655
+ (
1656
+ (first === '"' || first === "'" || first === '`')
1657
+ || (last === '"' || last === "'" || last === '`')
1658
+ )
1659
+ && first !== last
1660
+ ) {
1661
+ throw new $SyntaxError('property names with quotes must have matching quotes');
1662
+ }
1663
+ if (part === 'constructor' || !isOwn) {
1664
+ skipFurtherCaching = true;
1665
+ }
1666
+
1667
+ intrinsicBaseName += '.' + part;
1668
+ intrinsicRealName = '%' + intrinsicBaseName + '%';
1669
+
1670
+ if (hasOwn(INTRINSICS, intrinsicRealName)) {
1671
+ value = INTRINSICS[intrinsicRealName];
1672
+ } else if (value != null) {
1673
+ if (!(part in value)) {
1674
+ if (!allowMissing) {
1675
+ throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
1676
+ }
1677
+ return void undefined$1;
1678
+ }
1679
+ if ($gOPD && (i + 1) >= parts.length) {
1680
+ var desc = $gOPD(value, part);
1681
+ isOwn = !!desc;
1682
+
1683
+ // By convention, when a data property is converted to an accessor
1684
+ // property to emulate a data property that does not suffer from
1685
+ // the override mistake, that accessor's getter is marked with
1686
+ // an `originalValue` property. Here, when we detect this, we
1687
+ // uphold the illusion by pretending to see that original data
1688
+ // property, i.e., returning the value rather than the getter
1689
+ // itself.
1690
+ if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
1691
+ value = desc.get;
1692
+ } else {
1693
+ value = value[part];
1694
+ }
1695
+ } else {
1696
+ isOwn = hasOwn(value, part);
1697
+ value = value[part];
1698
+ }
1699
+
1700
+ if (isOwn && !skipFurtherCaching) {
1701
+ INTRINSICS[intrinsicRealName] = value;
1702
+ }
1703
+ }
1704
+ }
1705
+ return value;
1706
+ };
1707
+ return getIntrinsic;
1708
+ }
1709
+
1710
+ var callBound;
1711
+ var hasRequiredCallBound;
1712
+
1713
+ function requireCallBound () {
1714
+ if (hasRequiredCallBound) return callBound;
1715
+ hasRequiredCallBound = 1;
1716
+
1717
+ var GetIntrinsic = /*@__PURE__*/ requireGetIntrinsic();
1718
+
1719
+ var callBindBasic = requireCallBindApplyHelpers();
1720
+
1721
+ /** @type {(thisArg: string, searchString: string, position?: number) => number} */
1722
+ var $indexOf = callBindBasic([GetIntrinsic('%String.prototype.indexOf%')]);
1723
+
1724
+ /** @type {import('.')} */
1725
+ callBound = function callBoundIntrinsic(name, allowMissing) {
1726
+ /* eslint no-extra-parens: 0 */
1727
+
1728
+ var intrinsic = /** @type {(this: unknown, ...args: unknown[]) => unknown} */ (GetIntrinsic(name, !!allowMissing));
1729
+ if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
1730
+ return callBindBasic(/** @type {const} */ ([intrinsic]));
1731
+ }
1732
+ return intrinsic;
1733
+ };
1734
+ return callBound;
1735
+ }
1736
+
1737
+ var sideChannelMap;
1738
+ var hasRequiredSideChannelMap;
1739
+
1740
+ function requireSideChannelMap () {
1741
+ if (hasRequiredSideChannelMap) return sideChannelMap;
1742
+ hasRequiredSideChannelMap = 1;
1743
+
1744
+ var GetIntrinsic = /*@__PURE__*/ requireGetIntrinsic();
1745
+ var callBound = /*@__PURE__*/ requireCallBound();
1746
+ var inspect = /*@__PURE__*/ requireObjectInspect();
1747
+
1748
+ var $TypeError = /*@__PURE__*/ requireType();
1749
+ var $Map = GetIntrinsic('%Map%', true);
1750
+
1751
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => V} */
1752
+ var $mapGet = callBound('Map.prototype.get', true);
1753
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K, value: V) => void} */
1754
+ var $mapSet = callBound('Map.prototype.set', true);
1755
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
1756
+ var $mapHas = callBound('Map.prototype.has', true);
1757
+ /** @type {<K, V>(thisArg: Map<K, V>, key: K) => boolean} */
1758
+ var $mapDelete = callBound('Map.prototype.delete', true);
1759
+ /** @type {<K, V>(thisArg: Map<K, V>) => number} */
1760
+ var $mapSize = callBound('Map.prototype.size', true);
1761
+
1762
+ /** @type {import('.')} */
1763
+ sideChannelMap = !!$Map && /** @type {Exclude<import('.'), false>} */ function getSideChannelMap() {
1764
+ /** @typedef {ReturnType<typeof getSideChannelMap>} Channel */
1765
+ /** @typedef {Parameters<Channel['get']>[0]} K */
1766
+ /** @typedef {Parameters<Channel['set']>[1]} V */
1767
+
1768
+ /** @type {Map<K, V> | undefined} */ var $m;
1769
+
1770
+ /** @type {Channel} */
1771
+ var channel = {
1772
+ assert: function (key) {
1773
+ if (!channel.has(key)) {
1774
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
1775
+ }
1776
+ },
1777
+ 'delete': function (key) {
1778
+ if ($m) {
1779
+ var result = $mapDelete($m, key);
1780
+ if ($mapSize($m) === 0) {
1781
+ $m = void undefined;
1782
+ }
1783
+ return result;
1784
+ }
1785
+ return false;
1786
+ },
1787
+ get: function (key) { // eslint-disable-line consistent-return
1788
+ if ($m) {
1789
+ return $mapGet($m, key);
1790
+ }
1791
+ },
1792
+ has: function (key) {
1793
+ if ($m) {
1794
+ return $mapHas($m, key);
1795
+ }
1796
+ return false;
1797
+ },
1798
+ set: function (key, value) {
1799
+ if (!$m) {
1800
+ // @ts-expect-error TS can't handle narrowing a variable inside a closure
1801
+ $m = new $Map();
1802
+ }
1803
+ $mapSet($m, key, value);
1804
+ }
1805
+ };
1806
+
1807
+ // @ts-expect-error TODO: figure out why TS is erroring here
1808
+ return channel;
1809
+ };
1810
+ return sideChannelMap;
1811
+ }
1812
+
1813
+ var sideChannelWeakmap;
1814
+ var hasRequiredSideChannelWeakmap;
1815
+
1816
+ function requireSideChannelWeakmap () {
1817
+ if (hasRequiredSideChannelWeakmap) return sideChannelWeakmap;
1818
+ hasRequiredSideChannelWeakmap = 1;
1819
+
1820
+ var GetIntrinsic = /*@__PURE__*/ requireGetIntrinsic();
1821
+ var callBound = /*@__PURE__*/ requireCallBound();
1822
+ var inspect = /*@__PURE__*/ requireObjectInspect();
1823
+ var getSideChannelMap = requireSideChannelMap();
1824
+
1825
+ var $TypeError = /*@__PURE__*/ requireType();
1826
+ var $WeakMap = GetIntrinsic('%WeakMap%', true);
1827
+
1828
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => V} */
1829
+ var $weakMapGet = callBound('WeakMap.prototype.get', true);
1830
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K, value: V) => void} */
1831
+ var $weakMapSet = callBound('WeakMap.prototype.set', true);
1832
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
1833
+ var $weakMapHas = callBound('WeakMap.prototype.has', true);
1834
+ /** @type {<K extends object, V>(thisArg: WeakMap<K, V>, key: K) => boolean} */
1835
+ var $weakMapDelete = callBound('WeakMap.prototype.delete', true);
1836
+
1837
+ /** @type {import('.')} */
1838
+ sideChannelWeakmap = $WeakMap
1839
+ ? /** @type {Exclude<import('.'), false>} */ function getSideChannelWeakMap() {
1840
+ /** @typedef {ReturnType<typeof getSideChannelWeakMap>} Channel */
1841
+ /** @typedef {Parameters<Channel['get']>[0]} K */
1842
+ /** @typedef {Parameters<Channel['set']>[1]} V */
1843
+
1844
+ /** @type {WeakMap<K & object, V> | undefined} */ var $wm;
1845
+ /** @type {Channel | undefined} */ var $m;
1846
+
1847
+ /** @type {Channel} */
1848
+ var channel = {
1849
+ assert: function (key) {
1850
+ if (!channel.has(key)) {
1851
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
1852
+ }
1853
+ },
1854
+ 'delete': function (key) {
1855
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1856
+ if ($wm) {
1857
+ return $weakMapDelete($wm, key);
1858
+ }
1859
+ } else if (getSideChannelMap) {
1860
+ if ($m) {
1861
+ return $m['delete'](key);
1862
+ }
1863
+ }
1864
+ return false;
1865
+ },
1866
+ get: function (key) {
1867
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1868
+ if ($wm) {
1869
+ return $weakMapGet($wm, key);
1870
+ }
1871
+ }
1872
+ return $m && $m.get(key);
1873
+ },
1874
+ has: function (key) {
1875
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1876
+ if ($wm) {
1877
+ return $weakMapHas($wm, key);
1878
+ }
1879
+ }
1880
+ return !!$m && $m.has(key);
1881
+ },
1882
+ set: function (key, value) {
1883
+ if ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {
1884
+ if (!$wm) {
1885
+ $wm = new $WeakMap();
1886
+ }
1887
+ $weakMapSet($wm, key, value);
1888
+ } else if (getSideChannelMap) {
1889
+ if (!$m) {
1890
+ $m = getSideChannelMap();
1891
+ }
1892
+ // eslint-disable-next-line no-extra-parens
1893
+ /** @type {NonNullable<typeof $m>} */ ($m).set(key, value);
1894
+ }
1895
+ }
1896
+ };
1897
+
1898
+ // @ts-expect-error TODO: figure out why this is erroring
1899
+ return channel;
1900
+ }
1901
+ : getSideChannelMap;
1902
+ return sideChannelWeakmap;
1903
+ }
1904
+
1905
+ var sideChannel;
1906
+ var hasRequiredSideChannel;
1907
+
1908
+ function requireSideChannel () {
1909
+ if (hasRequiredSideChannel) return sideChannel;
1910
+ hasRequiredSideChannel = 1;
1911
+
1912
+ var $TypeError = /*@__PURE__*/ requireType();
1913
+ var inspect = /*@__PURE__*/ requireObjectInspect();
1914
+ var getSideChannelList = requireSideChannelList();
1915
+ var getSideChannelMap = requireSideChannelMap();
1916
+ var getSideChannelWeakMap = requireSideChannelWeakmap();
1917
+
1918
+ var makeChannel = getSideChannelWeakMap || getSideChannelMap || getSideChannelList;
1919
+
1920
+ /** @type {import('.')} */
1921
+ sideChannel = function getSideChannel() {
1922
+ /** @typedef {ReturnType<typeof getSideChannel>} Channel */
1923
+
1924
+ /** @type {Channel | undefined} */ var $channelData;
1925
+
1926
+ /** @type {Channel} */
1927
+ var channel = {
1928
+ assert: function (key) {
1929
+ if (!channel.has(key)) {
1930
+ throw new $TypeError('Side channel does not contain ' + inspect(key));
1931
+ }
1932
+ },
1933
+ 'delete': function (key) {
1934
+ return !!$channelData && $channelData['delete'](key);
1935
+ },
1936
+ get: function (key) {
1937
+ return $channelData && $channelData.get(key);
1938
+ },
1939
+ has: function (key) {
1940
+ return !!$channelData && $channelData.has(key);
1941
+ },
1942
+ set: function (key, value) {
1943
+ if (!$channelData) {
1944
+ $channelData = makeChannel();
1945
+ }
1946
+
1947
+ $channelData.set(key, value);
1948
+ }
1949
+ };
1950
+ // @ts-expect-error TODO: figure out why this is erroring
1951
+ return channel;
1952
+ };
1953
+ return sideChannel;
1954
+ }
1955
+
1956
+ var formats;
1957
+ var hasRequiredFormats;
1958
+
1959
+ function requireFormats () {
1960
+ if (hasRequiredFormats) return formats;
1961
+ hasRequiredFormats = 1;
1962
+
1963
+ var replace = String.prototype.replace;
1964
+ var percentTwenties = /%20/g;
1965
+
1966
+ var Format = {
1967
+ RFC1738: 'RFC1738',
1968
+ RFC3986: 'RFC3986'
1969
+ };
1970
+
1971
+ formats = {
1972
+ 'default': Format.RFC3986,
1973
+ formatters: {
1974
+ RFC1738: function (value) {
1975
+ return replace.call(value, percentTwenties, '+');
1976
+ },
1977
+ RFC3986: function (value) {
1978
+ return String(value);
1979
+ }
1980
+ },
1981
+ RFC1738: Format.RFC1738,
1982
+ RFC3986: Format.RFC3986
1983
+ };
1984
+ return formats;
1985
+ }
1986
+
1987
+ var utils;
1988
+ var hasRequiredUtils;
1989
+
1990
+ function requireUtils () {
1991
+ if (hasRequiredUtils) return utils;
1992
+ hasRequiredUtils = 1;
1993
+
1994
+ var formats = /*@__PURE__*/ requireFormats();
1995
+
1996
+ var has = Object.prototype.hasOwnProperty;
1997
+ var isArray = Array.isArray;
1998
+
1999
+ var hexTable = (function () {
2000
+ var array = [];
2001
+ for (var i = 0; i < 256; ++i) {
2002
+ array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());
2003
+ }
2004
+
2005
+ return array;
2006
+ }());
2007
+
2008
+ var compactQueue = function compactQueue(queue) {
2009
+ while (queue.length > 1) {
2010
+ var item = queue.pop();
2011
+ var obj = item.obj[item.prop];
2012
+
2013
+ if (isArray(obj)) {
2014
+ var compacted = [];
2015
+
2016
+ for (var j = 0; j < obj.length; ++j) {
2017
+ if (typeof obj[j] !== 'undefined') {
2018
+ compacted.push(obj[j]);
2019
+ }
2020
+ }
2021
+
2022
+ item.obj[item.prop] = compacted;
2023
+ }
2024
+ }
2025
+ };
2026
+
2027
+ var arrayToObject = function arrayToObject(source, options) {
2028
+ var obj = options && options.plainObjects ? { __proto__: null } : {};
2029
+ for (var i = 0; i < source.length; ++i) {
2030
+ if (typeof source[i] !== 'undefined') {
2031
+ obj[i] = source[i];
2032
+ }
2033
+ }
2034
+
2035
+ return obj;
2036
+ };
2037
+
2038
+ var merge = function merge(target, source, options) {
2039
+ /* eslint no-param-reassign: 0 */
2040
+ if (!source) {
2041
+ return target;
2042
+ }
2043
+
2044
+ if (typeof source !== 'object' && typeof source !== 'function') {
2045
+ if (isArray(target)) {
2046
+ target.push(source);
2047
+ } else if (target && typeof target === 'object') {
2048
+ if (
2049
+ (options && (options.plainObjects || options.allowPrototypes))
2050
+ || !has.call(Object.prototype, source)
2051
+ ) {
2052
+ target[source] = true;
2053
+ }
2054
+ } else {
2055
+ return [target, source];
2056
+ }
2057
+
2058
+ return target;
2059
+ }
2060
+
2061
+ if (!target || typeof target !== 'object') {
2062
+ return [target].concat(source);
2063
+ }
2064
+
2065
+ var mergeTarget = target;
2066
+ if (isArray(target) && !isArray(source)) {
2067
+ mergeTarget = arrayToObject(target, options);
2068
+ }
2069
+
2070
+ if (isArray(target) && isArray(source)) {
2071
+ source.forEach(function (item, i) {
2072
+ if (has.call(target, i)) {
2073
+ var targetItem = target[i];
2074
+ if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {
2075
+ target[i] = merge(targetItem, item, options);
2076
+ } else {
2077
+ target.push(item);
2078
+ }
2079
+ } else {
2080
+ target[i] = item;
2081
+ }
2082
+ });
2083
+ return target;
2084
+ }
2085
+
2086
+ return Object.keys(source).reduce(function (acc, key) {
2087
+ var value = source[key];
2088
+
2089
+ if (has.call(acc, key)) {
2090
+ acc[key] = merge(acc[key], value, options);
2091
+ } else {
2092
+ acc[key] = value;
2093
+ }
2094
+ return acc;
2095
+ }, mergeTarget);
2096
+ };
2097
+
2098
+ var assign = function assignSingleSource(target, source) {
2099
+ return Object.keys(source).reduce(function (acc, key) {
2100
+ acc[key] = source[key];
2101
+ return acc;
2102
+ }, target);
2103
+ };
2104
+
2105
+ var decode = function (str, defaultDecoder, charset) {
2106
+ var strWithoutPlus = str.replace(/\+/g, ' ');
2107
+ if (charset === 'iso-8859-1') {
2108
+ // unescape never throws, no try...catch needed:
2109
+ return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);
2110
+ }
2111
+ // utf-8
2112
+ try {
2113
+ return decodeURIComponent(strWithoutPlus);
2114
+ } catch (e) {
2115
+ return strWithoutPlus;
2116
+ }
2117
+ };
2118
+
2119
+ var limit = 1024;
2120
+
2121
+ /* eslint operator-linebreak: [2, "before"] */
2122
+
2123
+ var encode = function encode(str, defaultEncoder, charset, kind, format) {
2124
+ // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
2125
+ // It has been adapted here for stricter adherence to RFC 3986
2126
+ if (str.length === 0) {
2127
+ return str;
2128
+ }
2129
+
2130
+ var string = str;
2131
+ if (typeof str === 'symbol') {
2132
+ string = Symbol.prototype.toString.call(str);
2133
+ } else if (typeof str !== 'string') {
2134
+ string = String(str);
2135
+ }
2136
+
2137
+ if (charset === 'iso-8859-1') {
2138
+ return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {
2139
+ return '%26%23' + parseInt($0.slice(2), 16) + '%3B';
2140
+ });
2141
+ }
2142
+
2143
+ var out = '';
2144
+ for (var j = 0; j < string.length; j += limit) {
2145
+ var segment = string.length >= limit ? string.slice(j, j + limit) : string;
2146
+ var arr = [];
2147
+
2148
+ for (var i = 0; i < segment.length; ++i) {
2149
+ var c = segment.charCodeAt(i);
2150
+ if (
2151
+ c === 0x2D // -
2152
+ || c === 0x2E // .
2153
+ || c === 0x5F // _
2154
+ || c === 0x7E // ~
2155
+ || (c >= 0x30 && c <= 0x39) // 0-9
2156
+ || (c >= 0x41 && c <= 0x5A) // a-z
2157
+ || (c >= 0x61 && c <= 0x7A) // A-Z
2158
+ || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )
2159
+ ) {
2160
+ arr[arr.length] = segment.charAt(i);
2161
+ continue;
2162
+ }
2163
+
2164
+ if (c < 0x80) {
2165
+ arr[arr.length] = hexTable[c];
2166
+ continue;
2167
+ }
2168
+
2169
+ if (c < 0x800) {
2170
+ arr[arr.length] = hexTable[0xC0 | (c >> 6)]
2171
+ + hexTable[0x80 | (c & 0x3F)];
2172
+ continue;
2173
+ }
2174
+
2175
+ if (c < 0xD800 || c >= 0xE000) {
2176
+ arr[arr.length] = hexTable[0xE0 | (c >> 12)]
2177
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
2178
+ + hexTable[0x80 | (c & 0x3F)];
2179
+ continue;
2180
+ }
2181
+
2182
+ i += 1;
2183
+ c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));
2184
+
2185
+ arr[arr.length] = hexTable[0xF0 | (c >> 18)]
2186
+ + hexTable[0x80 | ((c >> 12) & 0x3F)]
2187
+ + hexTable[0x80 | ((c >> 6) & 0x3F)]
2188
+ + hexTable[0x80 | (c & 0x3F)];
2189
+ }
2190
+
2191
+ out += arr.join('');
2192
+ }
2193
+
2194
+ return out;
2195
+ };
2196
+
2197
+ var compact = function compact(value) {
2198
+ var queue = [{ obj: { o: value }, prop: 'o' }];
2199
+ var refs = [];
2200
+
2201
+ for (var i = 0; i < queue.length; ++i) {
2202
+ var item = queue[i];
2203
+ var obj = item.obj[item.prop];
2204
+
2205
+ var keys = Object.keys(obj);
2206
+ for (var j = 0; j < keys.length; ++j) {
2207
+ var key = keys[j];
2208
+ var val = obj[key];
2209
+ if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {
2210
+ queue.push({ obj: obj, prop: key });
2211
+ refs.push(val);
2212
+ }
2213
+ }
2214
+ }
2215
+
2216
+ compactQueue(queue);
2217
+
2218
+ return value;
2219
+ };
2220
+
2221
+ var isRegExp = function isRegExp(obj) {
2222
+ return Object.prototype.toString.call(obj) === '[object RegExp]';
2223
+ };
2224
+
2225
+ var isBuffer = function isBuffer(obj) {
2226
+ if (!obj || typeof obj !== 'object') {
2227
+ return false;
2228
+ }
2229
+
2230
+ return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
2231
+ };
2232
+
2233
+ var combine = function combine(a, b) {
2234
+ return [].concat(a, b);
2235
+ };
2236
+
2237
+ var maybeMap = function maybeMap(val, fn) {
2238
+ if (isArray(val)) {
2239
+ var mapped = [];
2240
+ for (var i = 0; i < val.length; i += 1) {
2241
+ mapped.push(fn(val[i]));
2242
+ }
2243
+ return mapped;
2244
+ }
2245
+ return fn(val);
2246
+ };
2247
+
2248
+ utils = {
2249
+ arrayToObject: arrayToObject,
2250
+ assign: assign,
2251
+ combine: combine,
2252
+ compact: compact,
2253
+ decode: decode,
2254
+ encode: encode,
2255
+ isBuffer: isBuffer,
2256
+ isRegExp: isRegExp,
2257
+ maybeMap: maybeMap,
2258
+ merge: merge
2259
+ };
2260
+ return utils;
2261
+ }
2262
+
2263
+ var stringify_1;
2264
+ var hasRequiredStringify;
2265
+
2266
+ function requireStringify () {
2267
+ if (hasRequiredStringify) return stringify_1;
2268
+ hasRequiredStringify = 1;
2269
+
2270
+ var getSideChannel = requireSideChannel();
2271
+ var utils = /*@__PURE__*/ requireUtils();
2272
+ var formats = /*@__PURE__*/ requireFormats();
2273
+ var has = Object.prototype.hasOwnProperty;
2274
+
2275
+ var arrayPrefixGenerators = {
2276
+ brackets: function brackets(prefix) {
2277
+ return prefix + '[]';
2278
+ },
2279
+ comma: 'comma',
2280
+ indices: function indices(prefix, key) {
2281
+ return prefix + '[' + key + ']';
2282
+ },
2283
+ repeat: function repeat(prefix) {
2284
+ return prefix;
2285
+ }
2286
+ };
2287
+
2288
+ var isArray = Array.isArray;
2289
+ var push = Array.prototype.push;
2290
+ var pushToArray = function (arr, valueOrArray) {
2291
+ push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);
2292
+ };
2293
+
2294
+ var toISO = Date.prototype.toISOString;
2295
+
2296
+ var defaultFormat = formats['default'];
2297
+ var defaults = {
2298
+ addQueryPrefix: false,
2299
+ allowDots: false,
2300
+ allowEmptyArrays: false,
2301
+ arrayFormat: 'indices',
2302
+ charset: 'utf-8',
2303
+ charsetSentinel: false,
2304
+ commaRoundTrip: false,
2305
+ delimiter: '&',
2306
+ encode: true,
2307
+ encodeDotInKeys: false,
2308
+ encoder: utils.encode,
2309
+ encodeValuesOnly: false,
2310
+ filter: void undefined,
2311
+ format: defaultFormat,
2312
+ formatter: formats.formatters[defaultFormat],
2313
+ // deprecated
2314
+ indices: false,
2315
+ serializeDate: function serializeDate(date) {
2316
+ return toISO.call(date);
2317
+ },
2318
+ skipNulls: false,
2319
+ strictNullHandling: false
2320
+ };
2321
+
2322
+ var isNonNullishPrimitive = function isNonNullishPrimitive(v) {
2323
+ return typeof v === 'string'
2324
+ || typeof v === 'number'
2325
+ || typeof v === 'boolean'
2326
+ || typeof v === 'symbol'
2327
+ || typeof v === 'bigint';
2328
+ };
2329
+
2330
+ var sentinel = {};
2331
+
2332
+ var stringify = function stringify(
2333
+ object,
2334
+ prefix,
2335
+ generateArrayPrefix,
2336
+ commaRoundTrip,
2337
+ allowEmptyArrays,
2338
+ strictNullHandling,
2339
+ skipNulls,
2340
+ encodeDotInKeys,
2341
+ encoder,
2342
+ filter,
2343
+ sort,
2344
+ allowDots,
2345
+ serializeDate,
2346
+ format,
2347
+ formatter,
2348
+ encodeValuesOnly,
2349
+ charset,
2350
+ sideChannel
2351
+ ) {
2352
+ var obj = object;
2353
+
2354
+ var tmpSc = sideChannel;
2355
+ var step = 0;
2356
+ var findFlag = false;
2357
+ while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {
2358
+ // Where object last appeared in the ref tree
2359
+ var pos = tmpSc.get(object);
2360
+ step += 1;
2361
+ if (typeof pos !== 'undefined') {
2362
+ if (pos === step) {
2363
+ throw new RangeError('Cyclic object value');
2364
+ } else {
2365
+ findFlag = true; // Break while
2366
+ }
2367
+ }
2368
+ if (typeof tmpSc.get(sentinel) === 'undefined') {
2369
+ step = 0;
2370
+ }
2371
+ }
2372
+
2373
+ if (typeof filter === 'function') {
2374
+ obj = filter(prefix, obj);
2375
+ } else if (obj instanceof Date) {
2376
+ obj = serializeDate(obj);
2377
+ } else if (generateArrayPrefix === 'comma' && isArray(obj)) {
2378
+ obj = utils.maybeMap(obj, function (value) {
2379
+ if (value instanceof Date) {
2380
+ return serializeDate(value);
2381
+ }
2382
+ return value;
2383
+ });
2384
+ }
2385
+
2386
+ if (obj === null) {
2387
+ if (strictNullHandling) {
2388
+ return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;
2389
+ }
2390
+
2391
+ obj = '';
2392
+ }
2393
+
2394
+ if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {
2395
+ if (encoder) {
2396
+ var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);
2397
+ return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];
2398
+ }
2399
+ return [formatter(prefix) + '=' + formatter(String(obj))];
2400
+ }
2401
+
2402
+ var values = [];
2403
+
2404
+ if (typeof obj === 'undefined') {
2405
+ return values;
2406
+ }
2407
+
2408
+ var objKeys;
2409
+ if (generateArrayPrefix === 'comma' && isArray(obj)) {
2410
+ // we need to join elements in
2411
+ if (encodeValuesOnly && encoder) {
2412
+ obj = utils.maybeMap(obj, encoder);
2413
+ }
2414
+ objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];
2415
+ } else if (isArray(filter)) {
2416
+ objKeys = filter;
2417
+ } else {
2418
+ var keys = Object.keys(obj);
2419
+ objKeys = sort ? keys.sort(sort) : keys;
2420
+ }
2421
+
2422
+ var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\./g, '%2E') : String(prefix);
2423
+
2424
+ var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;
2425
+
2426
+ if (allowEmptyArrays && isArray(obj) && obj.length === 0) {
2427
+ return adjustedPrefix + '[]';
2428
+ }
2429
+
2430
+ for (var j = 0; j < objKeys.length; ++j) {
2431
+ var key = objKeys[j];
2432
+ var value = typeof key === 'object' && key && typeof key.value !== 'undefined'
2433
+ ? key.value
2434
+ : obj[key];
2435
+
2436
+ if (skipNulls && value === null) {
2437
+ continue;
2438
+ }
2439
+
2440
+ var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\./g, '%2E') : String(key);
2441
+ var keyPrefix = isArray(obj)
2442
+ ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix
2443
+ : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');
2444
+
2445
+ sideChannel.set(object, step);
2446
+ var valueSideChannel = getSideChannel();
2447
+ valueSideChannel.set(sentinel, sideChannel);
2448
+ pushToArray(values, stringify(
2449
+ value,
2450
+ keyPrefix,
2451
+ generateArrayPrefix,
2452
+ commaRoundTrip,
2453
+ allowEmptyArrays,
2454
+ strictNullHandling,
2455
+ skipNulls,
2456
+ encodeDotInKeys,
2457
+ generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,
2458
+ filter,
2459
+ sort,
2460
+ allowDots,
2461
+ serializeDate,
2462
+ format,
2463
+ formatter,
2464
+ encodeValuesOnly,
2465
+ charset,
2466
+ valueSideChannel
2467
+ ));
2468
+ }
2469
+
2470
+ return values;
2471
+ };
2472
+
2473
+ var normalizeStringifyOptions = function normalizeStringifyOptions(opts) {
2474
+ if (!opts) {
2475
+ return defaults;
2476
+ }
2477
+
2478
+ if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
2479
+ throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
2480
+ }
2481
+
2482
+ if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {
2483
+ throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');
2484
+ }
2485
+
2486
+ if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {
2487
+ throw new TypeError('Encoder has to be a function.');
2488
+ }
2489
+
2490
+ var charset = opts.charset || defaults.charset;
2491
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2492
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2493
+ }
2494
+
2495
+ var format = formats['default'];
2496
+ if (typeof opts.format !== 'undefined') {
2497
+ if (!has.call(formats.formatters, opts.format)) {
2498
+ throw new TypeError('Unknown format option provided.');
2499
+ }
2500
+ format = opts.format;
2501
+ }
2502
+ var formatter = formats.formatters[format];
2503
+
2504
+ var filter = defaults.filter;
2505
+ if (typeof opts.filter === 'function' || isArray(opts.filter)) {
2506
+ filter = opts.filter;
2507
+ }
2508
+
2509
+ var arrayFormat;
2510
+ if (opts.arrayFormat in arrayPrefixGenerators) {
2511
+ arrayFormat = opts.arrayFormat;
2512
+ } else if ('indices' in opts) {
2513
+ arrayFormat = opts.indices ? 'indices' : 'repeat';
2514
+ } else {
2515
+ arrayFormat = defaults.arrayFormat;
2516
+ }
2517
+
2518
+ if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {
2519
+ throw new TypeError('`commaRoundTrip` must be a boolean, or absent');
2520
+ }
2521
+
2522
+ var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
2523
+
2524
+ return {
2525
+ addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,
2526
+ allowDots: allowDots,
2527
+ allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
2528
+ arrayFormat: arrayFormat,
2529
+ charset: charset,
2530
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
2531
+ commaRoundTrip: !!opts.commaRoundTrip,
2532
+ delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,
2533
+ encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,
2534
+ encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,
2535
+ encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,
2536
+ encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,
2537
+ filter: filter,
2538
+ format: format,
2539
+ formatter: formatter,
2540
+ serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,
2541
+ skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,
2542
+ sort: typeof opts.sort === 'function' ? opts.sort : null,
2543
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling
2544
+ };
2545
+ };
2546
+
2547
+ stringify_1 = function (object, opts) {
2548
+ var obj = object;
2549
+ var options = normalizeStringifyOptions(opts);
2550
+
2551
+ var objKeys;
2552
+ var filter;
2553
+
2554
+ if (typeof options.filter === 'function') {
2555
+ filter = options.filter;
2556
+ obj = filter('', obj);
2557
+ } else if (isArray(options.filter)) {
2558
+ filter = options.filter;
2559
+ objKeys = filter;
2560
+ }
2561
+
2562
+ var keys = [];
2563
+
2564
+ if (typeof obj !== 'object' || obj === null) {
2565
+ return '';
2566
+ }
2567
+
2568
+ var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];
2569
+ var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;
2570
+
2571
+ if (!objKeys) {
2572
+ objKeys = Object.keys(obj);
2573
+ }
2574
+
2575
+ if (options.sort) {
2576
+ objKeys.sort(options.sort);
2577
+ }
2578
+
2579
+ var sideChannel = getSideChannel();
2580
+ for (var i = 0; i < objKeys.length; ++i) {
2581
+ var key = objKeys[i];
2582
+ var value = obj[key];
2583
+
2584
+ if (options.skipNulls && value === null) {
2585
+ continue;
2586
+ }
2587
+ pushToArray(keys, stringify(
2588
+ value,
2589
+ key,
2590
+ generateArrayPrefix,
2591
+ commaRoundTrip,
2592
+ options.allowEmptyArrays,
2593
+ options.strictNullHandling,
2594
+ options.skipNulls,
2595
+ options.encodeDotInKeys,
2596
+ options.encode ? options.encoder : null,
2597
+ options.filter,
2598
+ options.sort,
2599
+ options.allowDots,
2600
+ options.serializeDate,
2601
+ options.format,
2602
+ options.formatter,
2603
+ options.encodeValuesOnly,
2604
+ options.charset,
2605
+ sideChannel
2606
+ ));
2607
+ }
2608
+
2609
+ var joined = keys.join(options.delimiter);
2610
+ var prefix = options.addQueryPrefix === true ? '?' : '';
2611
+
2612
+ if (options.charsetSentinel) {
2613
+ if (options.charset === 'iso-8859-1') {
2614
+ // encodeURIComponent('&#10003;'), the "numeric entity" representation of a checkmark
2615
+ prefix += 'utf8=%26%2310003%3B&';
2616
+ } else {
2617
+ // encodeURIComponent('✓')
2618
+ prefix += 'utf8=%E2%9C%93&';
2619
+ }
2620
+ }
2621
+
2622
+ return joined.length > 0 ? prefix + joined : '';
2623
+ };
2624
+ return stringify_1;
2625
+ }
2626
+
2627
+ var parse;
2628
+ var hasRequiredParse;
2629
+
2630
+ function requireParse () {
2631
+ if (hasRequiredParse) return parse;
2632
+ hasRequiredParse = 1;
2633
+
2634
+ var utils = /*@__PURE__*/ requireUtils();
2635
+
2636
+ var has = Object.prototype.hasOwnProperty;
2637
+ var isArray = Array.isArray;
2638
+
2639
+ var defaults = {
2640
+ allowDots: false,
2641
+ allowEmptyArrays: false,
2642
+ allowPrototypes: false,
2643
+ allowSparse: false,
2644
+ arrayLimit: 20,
2645
+ charset: 'utf-8',
2646
+ charsetSentinel: false,
2647
+ comma: false,
2648
+ decodeDotInKeys: false,
2649
+ decoder: utils.decode,
2650
+ delimiter: '&',
2651
+ depth: 5,
2652
+ duplicates: 'combine',
2653
+ ignoreQueryPrefix: false,
2654
+ interpretNumericEntities: false,
2655
+ parameterLimit: 1000,
2656
+ parseArrays: true,
2657
+ plainObjects: false,
2658
+ strictDepth: false,
2659
+ strictNullHandling: false,
2660
+ throwOnLimitExceeded: false
2661
+ };
2662
+
2663
+ var interpretNumericEntities = function (str) {
2664
+ return str.replace(/&#(\d+);/g, function ($0, numberStr) {
2665
+ return String.fromCharCode(parseInt(numberStr, 10));
2666
+ });
2667
+ };
2668
+
2669
+ var parseArrayValue = function (val, options, currentArrayLength) {
2670
+ if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {
2671
+ return val.split(',');
2672
+ }
2673
+
2674
+ if (options.throwOnLimitExceeded && currentArrayLength >= options.arrayLimit) {
2675
+ throw new RangeError('Array limit exceeded. Only ' + options.arrayLimit + ' element' + (options.arrayLimit === 1 ? '' : 's') + ' allowed in an array.');
2676
+ }
2677
+
2678
+ return val;
2679
+ };
2680
+
2681
+ // This is what browsers will submit when the ✓ character occurs in an
2682
+ // application/x-www-form-urlencoded body and the encoding of the page containing
2683
+ // the form is iso-8859-1, or when the submitted form has an accept-charset
2684
+ // attribute of iso-8859-1. Presumably also with other charsets that do not contain
2685
+ // the ✓ character, such as us-ascii.
2686
+ var isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('&#10003;')
2687
+
2688
+ // These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.
2689
+ var charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')
2690
+
2691
+ var parseValues = function parseQueryStringValues(str, options) {
2692
+ var obj = { __proto__: null };
2693
+
2694
+ var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, '') : str;
2695
+ cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');
2696
+
2697
+ var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;
2698
+ var parts = cleanStr.split(
2699
+ options.delimiter,
2700
+ options.throwOnLimitExceeded ? limit + 1 : limit
2701
+ );
2702
+
2703
+ if (options.throwOnLimitExceeded && parts.length > limit) {
2704
+ throw new RangeError('Parameter limit exceeded. Only ' + limit + ' parameter' + (limit === 1 ? '' : 's') + ' allowed.');
2705
+ }
2706
+
2707
+ var skipIndex = -1; // Keep track of where the utf8 sentinel was found
2708
+ var i;
2709
+
2710
+ var charset = options.charset;
2711
+ if (options.charsetSentinel) {
2712
+ for (i = 0; i < parts.length; ++i) {
2713
+ if (parts[i].indexOf('utf8=') === 0) {
2714
+ if (parts[i] === charsetSentinel) {
2715
+ charset = 'utf-8';
2716
+ } else if (parts[i] === isoSentinel) {
2717
+ charset = 'iso-8859-1';
2718
+ }
2719
+ skipIndex = i;
2720
+ i = parts.length; // The eslint settings do not allow break;
2721
+ }
2722
+ }
2723
+ }
2724
+
2725
+ for (i = 0; i < parts.length; ++i) {
2726
+ if (i === skipIndex) {
2727
+ continue;
2728
+ }
2729
+ var part = parts[i];
2730
+
2731
+ var bracketEqualsPos = part.indexOf(']=');
2732
+ var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;
2733
+
2734
+ var key;
2735
+ var val;
2736
+ if (pos === -1) {
2737
+ key = options.decoder(part, defaults.decoder, charset, 'key');
2738
+ val = options.strictNullHandling ? null : '';
2739
+ } else {
2740
+ key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');
2741
+
2742
+ val = utils.maybeMap(
2743
+ parseArrayValue(
2744
+ part.slice(pos + 1),
2745
+ options,
2746
+ isArray(obj[key]) ? obj[key].length : 0
2747
+ ),
2748
+ function (encodedVal) {
2749
+ return options.decoder(encodedVal, defaults.decoder, charset, 'value');
2750
+ }
2751
+ );
2752
+ }
2753
+
2754
+ if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {
2755
+ val = interpretNumericEntities(String(val));
2756
+ }
2757
+
2758
+ if (part.indexOf('[]=') > -1) {
2759
+ val = isArray(val) ? [val] : val;
2760
+ }
2761
+
2762
+ var existing = has.call(obj, key);
2763
+ if (existing && options.duplicates === 'combine') {
2764
+ obj[key] = utils.combine(obj[key], val);
2765
+ } else if (!existing || options.duplicates === 'last') {
2766
+ obj[key] = val;
2767
+ }
2768
+ }
2769
+
2770
+ return obj;
2771
+ };
2772
+
2773
+ var parseObject = function (chain, val, options, valuesParsed) {
2774
+ var currentArrayLength = 0;
2775
+ if (chain.length > 0 && chain[chain.length - 1] === '[]') {
2776
+ var parentKey = chain.slice(0, -1).join('');
2777
+ currentArrayLength = Array.isArray(val) && val[parentKey] ? val[parentKey].length : 0;
2778
+ }
2779
+
2780
+ var leaf = valuesParsed ? val : parseArrayValue(val, options, currentArrayLength);
2781
+
2782
+ for (var i = chain.length - 1; i >= 0; --i) {
2783
+ var obj;
2784
+ var root = chain[i];
2785
+
2786
+ if (root === '[]' && options.parseArrays) {
2787
+ obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))
2788
+ ? []
2789
+ : utils.combine([], leaf);
2790
+ } else {
2791
+ obj = options.plainObjects ? { __proto__: null } : {};
2792
+ var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;
2793
+ var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;
2794
+ var index = parseInt(decodedRoot, 10);
2795
+ if (!options.parseArrays && decodedRoot === '') {
2796
+ obj = { 0: leaf };
2797
+ } else if (
2798
+ !isNaN(index)
2799
+ && root !== decodedRoot
2800
+ && String(index) === decodedRoot
2801
+ && index >= 0
2802
+ && (options.parseArrays && index <= options.arrayLimit)
2803
+ ) {
2804
+ obj = [];
2805
+ obj[index] = leaf;
2806
+ } else if (decodedRoot !== '__proto__') {
2807
+ obj[decodedRoot] = leaf;
2808
+ }
2809
+ }
2810
+
2811
+ leaf = obj;
2812
+ }
2813
+
2814
+ return leaf;
2815
+ };
2816
+
2817
+ var parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {
2818
+ if (!givenKey) {
2819
+ return;
2820
+ }
2821
+
2822
+ // Transform dot notation to bracket notation
2823
+ var key = options.allowDots ? givenKey.replace(/\.([^.[]+)/g, '[$1]') : givenKey;
2824
+
2825
+ // The regex chunks
2826
+
2827
+ var brackets = /(\[[^[\]]*])/;
2828
+ var child = /(\[[^[\]]*])/g;
2829
+
2830
+ // Get the parent
2831
+
2832
+ var segment = options.depth > 0 && brackets.exec(key);
2833
+ var parent = segment ? key.slice(0, segment.index) : key;
2834
+
2835
+ // Stash the parent if it exists
2836
+
2837
+ var keys = [];
2838
+ if (parent) {
2839
+ // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties
2840
+ if (!options.plainObjects && has.call(Object.prototype, parent)) {
2841
+ if (!options.allowPrototypes) {
2842
+ return;
2843
+ }
2844
+ }
2845
+
2846
+ keys.push(parent);
2847
+ }
2848
+
2849
+ // Loop through children appending to the array until we hit depth
2850
+
2851
+ var i = 0;
2852
+ while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {
2853
+ i += 1;
2854
+ if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {
2855
+ if (!options.allowPrototypes) {
2856
+ return;
2857
+ }
2858
+ }
2859
+ keys.push(segment[1]);
2860
+ }
2861
+
2862
+ // If there's a remainder, check strictDepth option for throw, else just add whatever is left
2863
+
2864
+ if (segment) {
2865
+ if (options.strictDepth === true) {
2866
+ throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');
2867
+ }
2868
+ keys.push('[' + key.slice(segment.index) + ']');
2869
+ }
2870
+
2871
+ return parseObject(keys, val, options, valuesParsed);
2872
+ };
2873
+
2874
+ var normalizeParseOptions = function normalizeParseOptions(opts) {
2875
+ if (!opts) {
2876
+ return defaults;
2877
+ }
2878
+
2879
+ if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {
2880
+ throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');
2881
+ }
2882
+
2883
+ if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {
2884
+ throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');
2885
+ }
2886
+
2887
+ if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {
2888
+ throw new TypeError('Decoder has to be a function.');
2889
+ }
2890
+
2891
+ if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {
2892
+ throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');
2893
+ }
2894
+
2895
+ if (typeof opts.throwOnLimitExceeded !== 'undefined' && typeof opts.throwOnLimitExceeded !== 'boolean') {
2896
+ throw new TypeError('`throwOnLimitExceeded` option must be a boolean');
2897
+ }
2898
+
2899
+ var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;
2900
+
2901
+ var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;
2902
+
2903
+ if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {
2904
+ throw new TypeError('The duplicates option must be either combine, first, or last');
2905
+ }
2906
+
2907
+ var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;
2908
+
2909
+ return {
2910
+ allowDots: allowDots,
2911
+ allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,
2912
+ allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,
2913
+ allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,
2914
+ arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,
2915
+ charset: charset,
2916
+ charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,
2917
+ comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,
2918
+ decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,
2919
+ decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,
2920
+ delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,
2921
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
2922
+ depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,
2923
+ duplicates: duplicates,
2924
+ ignoreQueryPrefix: opts.ignoreQueryPrefix === true,
2925
+ interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,
2926
+ parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,
2927
+ parseArrays: opts.parseArrays !== false,
2928
+ plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,
2929
+ strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,
2930
+ strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling,
2931
+ throwOnLimitExceeded: typeof opts.throwOnLimitExceeded === 'boolean' ? opts.throwOnLimitExceeded : false
2932
+ };
2933
+ };
2934
+
2935
+ parse = function (str, opts) {
2936
+ var options = normalizeParseOptions(opts);
2937
+
2938
+ if (str === '' || str === null || typeof str === 'undefined') {
2939
+ return options.plainObjects ? { __proto__: null } : {};
2940
+ }
2941
+
2942
+ var tempObj = typeof str === 'string' ? parseValues(str, options) : str;
2943
+ var obj = options.plainObjects ? { __proto__: null } : {};
2944
+
2945
+ // Iterate over the keys and setup the new object
2946
+
2947
+ var keys = Object.keys(tempObj);
2948
+ for (var i = 0; i < keys.length; ++i) {
2949
+ var key = keys[i];
2950
+ var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');
2951
+ obj = utils.merge(obj, newObj, options);
2952
+ }
2953
+
2954
+ if (options.allowSparse === true) {
2955
+ return obj;
2956
+ }
2957
+
2958
+ return utils.compact(obj);
2959
+ };
2960
+ return parse;
2961
+ }
2962
+
2963
+ var lib;
2964
+ var hasRequiredLib;
2965
+
2966
+ function requireLib () {
2967
+ if (hasRequiredLib) return lib;
2968
+ hasRequiredLib = 1;
2969
+
2970
+ var stringify = /*@__PURE__*/ requireStringify();
2971
+ var parse = /*@__PURE__*/ requireParse();
2972
+ var formats = /*@__PURE__*/ requireFormats();
2973
+
2974
+ lib = {
2975
+ formats: formats,
2976
+ parse: parse,
2977
+ stringify: stringify
2978
+ };
2979
+ return lib;
2980
+ }
2981
+
2982
+ var libExports = /*@__PURE__*/ requireLib();
2983
+
2984
+ var httpErrors = {exports: {}};
2985
+
2986
+ /*!
2987
+ * depd
2988
+ * Copyright(c) 2014-2018 Douglas Christopher Wilson
2989
+ * MIT Licensed
2990
+ */
2991
+
2992
+ var depd_1;
2993
+ var hasRequiredDepd;
2994
+
2995
+ function requireDepd () {
2996
+ if (hasRequiredDepd) return depd_1;
2997
+ hasRequiredDepd = 1;
2998
+ /**
2999
+ * Module dependencies.
3000
+ */
3001
+
3002
+ var relative = require$$0$2.relative;
3003
+
3004
+ /**
3005
+ * Module exports.
3006
+ */
3007
+
3008
+ depd_1 = depd;
3009
+
3010
+ /**
3011
+ * Get the path to base files on.
3012
+ */
3013
+
3014
+ var basePath = process.cwd();
3015
+
3016
+ /**
3017
+ * Determine if namespace is contained in the string.
3018
+ */
3019
+
3020
+ function containsNamespace (str, namespace) {
3021
+ var vals = str.split(/[ ,]+/);
3022
+ var ns = String(namespace).toLowerCase();
3023
+
3024
+ for (var i = 0; i < vals.length; i++) {
3025
+ var val = vals[i];
3026
+
3027
+ // namespace contained
3028
+ if (val && (val === '*' || val.toLowerCase() === ns)) {
3029
+ return true
3030
+ }
3031
+ }
3032
+
3033
+ return false
3034
+ }
3035
+
3036
+ /**
3037
+ * Convert a data descriptor to accessor descriptor.
3038
+ */
3039
+
3040
+ function convertDataDescriptorToAccessor (obj, prop, message) {
3041
+ var descriptor = Object.getOwnPropertyDescriptor(obj, prop);
3042
+ var value = descriptor.value;
3043
+
3044
+ descriptor.get = function getter () { return value };
3045
+
3046
+ if (descriptor.writable) {
3047
+ descriptor.set = function setter (val) { return (value = val) };
3048
+ }
3049
+
3050
+ delete descriptor.value;
3051
+ delete descriptor.writable;
3052
+
3053
+ Object.defineProperty(obj, prop, descriptor);
3054
+
3055
+ return descriptor
3056
+ }
3057
+
3058
+ /**
3059
+ * Create arguments string to keep arity.
3060
+ */
3061
+
3062
+ function createArgumentsString (arity) {
3063
+ var str = '';
3064
+
3065
+ for (var i = 0; i < arity; i++) {
3066
+ str += ', arg' + i;
3067
+ }
3068
+
3069
+ return str.substr(2)
3070
+ }
3071
+
3072
+ /**
3073
+ * Create stack string from stack.
3074
+ */
3075
+
3076
+ function createStackString (stack) {
3077
+ var str = this.name + ': ' + this.namespace;
3078
+
3079
+ if (this.message) {
3080
+ str += ' deprecated ' + this.message;
3081
+ }
3082
+
3083
+ for (var i = 0; i < stack.length; i++) {
3084
+ str += '\n at ' + stack[i].toString();
3085
+ }
3086
+
3087
+ return str
3088
+ }
3089
+
3090
+ /**
3091
+ * Create deprecate for namespace in caller.
3092
+ */
3093
+
3094
+ function depd (namespace) {
3095
+ if (!namespace) {
3096
+ throw new TypeError('argument namespace is required')
3097
+ }
3098
+
3099
+ var stack = getStack();
3100
+ var site = callSiteLocation(stack[1]);
3101
+ var file = site[0];
3102
+
3103
+ function deprecate (message) {
3104
+ // call to self as log
3105
+ log.call(deprecate, message);
3106
+ }
3107
+
3108
+ deprecate._file = file;
3109
+ deprecate._ignored = isignored(namespace);
3110
+ deprecate._namespace = namespace;
3111
+ deprecate._traced = istraced(namespace);
3112
+ deprecate._warned = Object.create(null);
3113
+
3114
+ deprecate.function = wrapfunction;
3115
+ deprecate.property = wrapproperty;
3116
+
3117
+ return deprecate
3118
+ }
3119
+
3120
+ /**
3121
+ * Determine if event emitter has listeners of a given type.
3122
+ *
3123
+ * The way to do this check is done three different ways in Node.js >= 0.8
3124
+ * so this consolidates them into a minimal set using instance methods.
3125
+ *
3126
+ * @param {EventEmitter} emitter
3127
+ * @param {string} type
3128
+ * @returns {boolean}
3129
+ * @private
3130
+ */
3131
+
3132
+ function eehaslisteners (emitter, type) {
3133
+ var count = typeof emitter.listenerCount !== 'function'
3134
+ ? emitter.listeners(type).length
3135
+ : emitter.listenerCount(type);
3136
+
3137
+ return count > 0
3138
+ }
3139
+
3140
+ /**
3141
+ * Determine if namespace is ignored.
3142
+ */
3143
+
3144
+ function isignored (namespace) {
3145
+ if (process.noDeprecation) {
3146
+ // --no-deprecation support
3147
+ return true
3148
+ }
3149
+
3150
+ var str = process.env.NO_DEPRECATION || '';
3151
+
3152
+ // namespace ignored
3153
+ return containsNamespace(str, namespace)
3154
+ }
3155
+
3156
+ /**
3157
+ * Determine if namespace is traced.
3158
+ */
3159
+
3160
+ function istraced (namespace) {
3161
+ if (process.traceDeprecation) {
3162
+ // --trace-deprecation support
3163
+ return true
3164
+ }
3165
+
3166
+ var str = process.env.TRACE_DEPRECATION || '';
3167
+
3168
+ // namespace traced
3169
+ return containsNamespace(str, namespace)
3170
+ }
3171
+
3172
+ /**
3173
+ * Display deprecation message.
3174
+ */
3175
+
3176
+ function log (message, site) {
3177
+ var haslisteners = eehaslisteners(process, 'deprecation');
3178
+
3179
+ // abort early if no destination
3180
+ if (!haslisteners && this._ignored) {
3181
+ return
3182
+ }
3183
+
3184
+ var caller;
3185
+ var callFile;
3186
+ var callSite;
3187
+ var depSite;
3188
+ var i = 0;
3189
+ var seen = false;
3190
+ var stack = getStack();
3191
+ var file = this._file;
3192
+
3193
+ if (site) {
3194
+ // provided site
3195
+ depSite = site;
3196
+ callSite = callSiteLocation(stack[1]);
3197
+ callSite.name = depSite.name;
3198
+ file = callSite[0];
3199
+ } else {
3200
+ // get call site
3201
+ i = 2;
3202
+ depSite = callSiteLocation(stack[i]);
3203
+ callSite = depSite;
3204
+ }
3205
+
3206
+ // get caller of deprecated thing in relation to file
3207
+ for (; i < stack.length; i++) {
3208
+ caller = callSiteLocation(stack[i]);
3209
+ callFile = caller[0];
3210
+
3211
+ if (callFile === file) {
3212
+ seen = true;
3213
+ } else if (callFile === this._file) {
3214
+ file = this._file;
3215
+ } else if (seen) {
3216
+ break
3217
+ }
3218
+ }
3219
+
3220
+ var key = caller
3221
+ ? depSite.join(':') + '__' + caller.join(':')
3222
+ : undefined;
3223
+
3224
+ if (key !== undefined && key in this._warned) {
3225
+ // already warned
3226
+ return
3227
+ }
3228
+
3229
+ this._warned[key] = true;
3230
+
3231
+ // generate automatic message from call site
3232
+ var msg = message;
3233
+ if (!msg) {
3234
+ msg = callSite === depSite || !callSite.name
3235
+ ? defaultMessage(depSite)
3236
+ : defaultMessage(callSite);
3237
+ }
3238
+
3239
+ // emit deprecation if listeners exist
3240
+ if (haslisteners) {
3241
+ var err = DeprecationError(this._namespace, msg, stack.slice(i));
3242
+ process.emit('deprecation', err);
3243
+ return
3244
+ }
3245
+
3246
+ // format and write message
3247
+ var format = process.stderr.isTTY
3248
+ ? formatColor
3249
+ : formatPlain;
3250
+ var output = format.call(this, msg, caller, stack.slice(i));
3251
+ process.stderr.write(output + '\n', 'utf8');
3252
+ }
3253
+
3254
+ /**
3255
+ * Get call site location as array.
3256
+ */
3257
+
3258
+ function callSiteLocation (callSite) {
3259
+ var file = callSite.getFileName() || '<anonymous>';
3260
+ var line = callSite.getLineNumber();
3261
+ var colm = callSite.getColumnNumber();
3262
+
3263
+ if (callSite.isEval()) {
3264
+ file = callSite.getEvalOrigin() + ', ' + file;
3265
+ }
3266
+
3267
+ var site = [file, line, colm];
3268
+
3269
+ site.callSite = callSite;
3270
+ site.name = callSite.getFunctionName();
3271
+
3272
+ return site
3273
+ }
3274
+
3275
+ /**
3276
+ * Generate a default message from the site.
3277
+ */
3278
+
3279
+ function defaultMessage (site) {
3280
+ var callSite = site.callSite;
3281
+ var funcName = site.name;
3282
+
3283
+ // make useful anonymous name
3284
+ if (!funcName) {
3285
+ funcName = '<anonymous@' + formatLocation(site) + '>';
3286
+ }
3287
+
3288
+ var context = callSite.getThis();
3289
+ var typeName = context && callSite.getTypeName();
3290
+
3291
+ // ignore useless type name
3292
+ if (typeName === 'Object') {
3293
+ typeName = undefined;
3294
+ }
3295
+
3296
+ // make useful type name
3297
+ if (typeName === 'Function') {
3298
+ typeName = context.name || typeName;
3299
+ }
3300
+
3301
+ return typeName && callSite.getMethodName()
3302
+ ? typeName + '.' + funcName
3303
+ : funcName
3304
+ }
3305
+
3306
+ /**
3307
+ * Format deprecation message without color.
3308
+ */
3309
+
3310
+ function formatPlain (msg, caller, stack) {
3311
+ var timestamp = new Date().toUTCString();
3312
+
3313
+ var formatted = timestamp +
3314
+ ' ' + this._namespace +
3315
+ ' deprecated ' + msg;
3316
+
3317
+ // add stack trace
3318
+ if (this._traced) {
3319
+ for (var i = 0; i < stack.length; i++) {
3320
+ formatted += '\n at ' + stack[i].toString();
3321
+ }
3322
+
3323
+ return formatted
3324
+ }
3325
+
3326
+ if (caller) {
3327
+ formatted += ' at ' + formatLocation(caller);
3328
+ }
3329
+
3330
+ return formatted
3331
+ }
3332
+
3333
+ /**
3334
+ * Format deprecation message with color.
3335
+ */
3336
+
3337
+ function formatColor (msg, caller, stack) {
3338
+ var formatted = '\x1b[36;1m' + this._namespace + '\x1b[22;39m' + // bold cyan
3339
+ ' \x1b[33;1mdeprecated\x1b[22;39m' + // bold yellow
3340
+ ' \x1b[0m' + msg + '\x1b[39m'; // reset
3341
+
3342
+ // add stack trace
3343
+ if (this._traced) {
3344
+ for (var i = 0; i < stack.length; i++) {
3345
+ formatted += '\n \x1b[36mat ' + stack[i].toString() + '\x1b[39m'; // cyan
3346
+ }
3347
+
3348
+ return formatted
3349
+ }
3350
+
3351
+ if (caller) {
3352
+ formatted += ' \x1b[36m' + formatLocation(caller) + '\x1b[39m'; // cyan
3353
+ }
3354
+
3355
+ return formatted
3356
+ }
3357
+
3358
+ /**
3359
+ * Format call site location.
3360
+ */
3361
+
3362
+ function formatLocation (callSite) {
3363
+ return relative(basePath, callSite[0]) +
3364
+ ':' + callSite[1] +
3365
+ ':' + callSite[2]
3366
+ }
3367
+
3368
+ /**
3369
+ * Get the stack as array of call sites.
3370
+ */
3371
+
3372
+ function getStack () {
3373
+ var limit = Error.stackTraceLimit;
3374
+ var obj = {};
3375
+ var prep = Error.prepareStackTrace;
3376
+
3377
+ Error.prepareStackTrace = prepareObjectStackTrace;
3378
+ Error.stackTraceLimit = Math.max(10, limit);
3379
+
3380
+ // capture the stack
3381
+ Error.captureStackTrace(obj);
3382
+
3383
+ // slice this function off the top
3384
+ var stack = obj.stack.slice(1);
3385
+
3386
+ Error.prepareStackTrace = prep;
3387
+ Error.stackTraceLimit = limit;
3388
+
3389
+ return stack
3390
+ }
3391
+
3392
+ /**
3393
+ * Capture call site stack from v8.
3394
+ */
3395
+
3396
+ function prepareObjectStackTrace (obj, stack) {
3397
+ return stack
3398
+ }
3399
+
3400
+ /**
3401
+ * Return a wrapped function in a deprecation message.
3402
+ */
3403
+
3404
+ function wrapfunction (fn, message) {
3405
+ if (typeof fn !== 'function') {
3406
+ throw new TypeError('argument fn must be a function')
3407
+ }
3408
+
3409
+ var args = createArgumentsString(fn.length);
3410
+ var stack = getStack();
3411
+ var site = callSiteLocation(stack[1]);
3412
+
3413
+ site.name = fn.name;
3414
+
3415
+ // eslint-disable-next-line no-new-func
3416
+ var deprecatedfn = new Function('fn', 'log', 'deprecate', 'message', 'site',
3417
+ '"use strict"\n' +
3418
+ 'return function (' + args + ') {' +
3419
+ 'log.call(deprecate, message, site)\n' +
3420
+ 'return fn.apply(this, arguments)\n' +
3421
+ '}')(fn, log, this, message, site);
3422
+
3423
+ return deprecatedfn
3424
+ }
3425
+
3426
+ /**
3427
+ * Wrap property in a deprecation message.
3428
+ */
3429
+
3430
+ function wrapproperty (obj, prop, message) {
3431
+ if (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {
3432
+ throw new TypeError('argument obj must be object')
3433
+ }
3434
+
3435
+ var descriptor = Object.getOwnPropertyDescriptor(obj, prop);
3436
+
3437
+ if (!descriptor) {
3438
+ throw new TypeError('must call property on owner object')
3439
+ }
3440
+
3441
+ if (!descriptor.configurable) {
3442
+ throw new TypeError('property must be configurable')
3443
+ }
3444
+
3445
+ var deprecate = this;
3446
+ var stack = getStack();
3447
+ var site = callSiteLocation(stack[1]);
3448
+
3449
+ // set site name
3450
+ site.name = prop;
3451
+
3452
+ // convert data descriptor
3453
+ if ('value' in descriptor) {
3454
+ descriptor = convertDataDescriptorToAccessor(obj, prop);
3455
+ }
3456
+
3457
+ var get = descriptor.get;
3458
+ var set = descriptor.set;
3459
+
3460
+ // wrap getter
3461
+ if (typeof get === 'function') {
3462
+ descriptor.get = function getter () {
3463
+ log.call(deprecate, message, site);
3464
+ return get.apply(this, arguments)
3465
+ };
3466
+ }
3467
+
3468
+ // wrap setter
3469
+ if (typeof set === 'function') {
3470
+ descriptor.set = function setter () {
3471
+ log.call(deprecate, message, site);
3472
+ return set.apply(this, arguments)
3473
+ };
3474
+ }
3475
+
3476
+ Object.defineProperty(obj, prop, descriptor);
3477
+ }
3478
+
3479
+ /**
3480
+ * Create DeprecationError for deprecation
3481
+ */
3482
+
3483
+ function DeprecationError (namespace, message, stack) {
3484
+ var error = new Error();
3485
+ var stackString;
3486
+
3487
+ Object.defineProperty(error, 'constructor', {
3488
+ value: DeprecationError
3489
+ });
3490
+
3491
+ Object.defineProperty(error, 'message', {
3492
+ configurable: true,
3493
+ enumerable: false,
3494
+ value: message,
3495
+ writable: true
3496
+ });
3497
+
3498
+ Object.defineProperty(error, 'name', {
3499
+ enumerable: false,
3500
+ configurable: true,
3501
+ value: 'DeprecationError',
3502
+ writable: true
3503
+ });
3504
+
3505
+ Object.defineProperty(error, 'namespace', {
3506
+ configurable: true,
3507
+ enumerable: false,
3508
+ value: namespace,
3509
+ writable: true
3510
+ });
3511
+
3512
+ Object.defineProperty(error, 'stack', {
3513
+ configurable: true,
3514
+ enumerable: false,
3515
+ get: function () {
3516
+ if (stackString !== undefined) {
3517
+ return stackString
3518
+ }
3519
+
3520
+ // prepare stack trace
3521
+ return (stackString = createStackString.call(this, stack))
3522
+ },
3523
+ set: function setter (val) {
3524
+ stackString = val;
3525
+ }
3526
+ });
3527
+
3528
+ return error
3529
+ }
3530
+ return depd_1;
3531
+ }
3532
+
3533
+ var setprototypeof;
3534
+ var hasRequiredSetprototypeof;
3535
+
3536
+ function requireSetprototypeof () {
3537
+ if (hasRequiredSetprototypeof) return setprototypeof;
3538
+ hasRequiredSetprototypeof = 1;
3539
+ /* eslint no-proto: 0 */
3540
+ setprototypeof = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? setProtoOf : mixinProperties);
3541
+
3542
+ function setProtoOf (obj, proto) {
3543
+ obj.__proto__ = proto;
3544
+ return obj
3545
+ }
3546
+
3547
+ function mixinProperties (obj, proto) {
3548
+ for (var prop in proto) {
3549
+ if (!Object.prototype.hasOwnProperty.call(obj, prop)) {
3550
+ obj[prop] = proto[prop];
3551
+ }
3552
+ }
3553
+ return obj
3554
+ }
3555
+ return setprototypeof;
3556
+ }
3557
+
3558
+ var require$$0 = {
3559
+ "100": "Continue",
3560
+ "101": "Switching Protocols",
3561
+ "102": "Processing",
3562
+ "103": "Early Hints",
3563
+ "200": "OK",
3564
+ "201": "Created",
3565
+ "202": "Accepted",
3566
+ "203": "Non-Authoritative Information",
3567
+ "204": "No Content",
3568
+ "205": "Reset Content",
3569
+ "206": "Partial Content",
3570
+ "207": "Multi-Status",
3571
+ "208": "Already Reported",
3572
+ "226": "IM Used",
3573
+ "300": "Multiple Choices",
3574
+ "301": "Moved Permanently",
3575
+ "302": "Found",
3576
+ "303": "See Other",
3577
+ "304": "Not Modified",
3578
+ "305": "Use Proxy",
3579
+ "307": "Temporary Redirect",
3580
+ "308": "Permanent Redirect",
3581
+ "400": "Bad Request",
3582
+ "401": "Unauthorized",
3583
+ "402": "Payment Required",
3584
+ "403": "Forbidden",
3585
+ "404": "Not Found",
3586
+ "405": "Method Not Allowed",
3587
+ "406": "Not Acceptable",
3588
+ "407": "Proxy Authentication Required",
3589
+ "408": "Request Timeout",
3590
+ "409": "Conflict",
3591
+ "410": "Gone",
3592
+ "411": "Length Required",
3593
+ "412": "Precondition Failed",
3594
+ "413": "Payload Too Large",
3595
+ "414": "URI Too Long",
3596
+ "415": "Unsupported Media Type",
3597
+ "416": "Range Not Satisfiable",
3598
+ "417": "Expectation Failed",
3599
+ "418": "I'm a Teapot",
3600
+ "421": "Misdirected Request",
3601
+ "422": "Unprocessable Entity",
3602
+ "423": "Locked",
3603
+ "424": "Failed Dependency",
3604
+ "425": "Too Early",
3605
+ "426": "Upgrade Required",
3606
+ "428": "Precondition Required",
3607
+ "429": "Too Many Requests",
3608
+ "431": "Request Header Fields Too Large",
3609
+ "451": "Unavailable For Legal Reasons",
3610
+ "500": "Internal Server Error",
3611
+ "501": "Not Implemented",
3612
+ "502": "Bad Gateway",
3613
+ "503": "Service Unavailable",
3614
+ "504": "Gateway Timeout",
3615
+ "505": "HTTP Version Not Supported",
3616
+ "506": "Variant Also Negotiates",
3617
+ "507": "Insufficient Storage",
3618
+ "508": "Loop Detected",
3619
+ "509": "Bandwidth Limit Exceeded",
3620
+ "510": "Not Extended",
3621
+ "511": "Network Authentication Required"
3622
+ };
3623
+
3624
+ /*!
3625
+ * statuses
3626
+ * Copyright(c) 2014 Jonathan Ong
3627
+ * Copyright(c) 2016 Douglas Christopher Wilson
3628
+ * MIT Licensed
3629
+ */
3630
+
3631
+ var statuses;
3632
+ var hasRequiredStatuses;
3633
+
3634
+ function requireStatuses () {
3635
+ if (hasRequiredStatuses) return statuses;
3636
+ hasRequiredStatuses = 1;
3637
+
3638
+ /**
3639
+ * Module dependencies.
3640
+ * @private
3641
+ */
3642
+
3643
+ var codes = require$$0;
3644
+
3645
+ /**
3646
+ * Module exports.
3647
+ * @public
3648
+ */
3649
+
3650
+ statuses = status;
3651
+
3652
+ // status code to message map
3653
+ status.message = codes;
3654
+
3655
+ // status message (lower-case) to code map
3656
+ status.code = createMessageToStatusCodeMap(codes);
3657
+
3658
+ // array of status codes
3659
+ status.codes = createStatusCodeList(codes);
3660
+
3661
+ // status codes for redirects
3662
+ status.redirect = {
3663
+ 300: true,
3664
+ 301: true,
3665
+ 302: true,
3666
+ 303: true,
3667
+ 305: true,
3668
+ 307: true,
3669
+ 308: true
3670
+ };
3671
+
3672
+ // status codes for empty bodies
3673
+ status.empty = {
3674
+ 204: true,
3675
+ 205: true,
3676
+ 304: true
3677
+ };
3678
+
3679
+ // status codes for when you should retry the request
3680
+ status.retry = {
3681
+ 502: true,
3682
+ 503: true,
3683
+ 504: true
3684
+ };
3685
+
3686
+ /**
3687
+ * Create a map of message to status code.
3688
+ * @private
3689
+ */
3690
+
3691
+ function createMessageToStatusCodeMap (codes) {
3692
+ var map = {};
3693
+
3694
+ Object.keys(codes).forEach(function forEachCode (code) {
3695
+ var message = codes[code];
3696
+ var status = Number(code);
3697
+
3698
+ // populate map
3699
+ map[message.toLowerCase()] = status;
3700
+ });
3701
+
3702
+ return map
3703
+ }
3704
+
3705
+ /**
3706
+ * Create a list of all status codes.
3707
+ * @private
3708
+ */
3709
+
3710
+ function createStatusCodeList (codes) {
3711
+ return Object.keys(codes).map(function mapCode (code) {
3712
+ return Number(code)
3713
+ })
3714
+ }
3715
+
3716
+ /**
3717
+ * Get the status code for given message.
3718
+ * @private
3719
+ */
3720
+
3721
+ function getStatusCode (message) {
3722
+ var msg = message.toLowerCase();
3723
+
3724
+ if (!Object.prototype.hasOwnProperty.call(status.code, msg)) {
3725
+ throw new Error('invalid status message: "' + message + '"')
3726
+ }
3727
+
3728
+ return status.code[msg]
3729
+ }
3730
+
3731
+ /**
3732
+ * Get the status message for given code.
3733
+ * @private
3734
+ */
3735
+
3736
+ function getStatusMessage (code) {
3737
+ if (!Object.prototype.hasOwnProperty.call(status.message, code)) {
3738
+ throw new Error('invalid status code: ' + code)
3739
+ }
3740
+
3741
+ return status.message[code]
3742
+ }
3743
+
3744
+ /**
3745
+ * Get the status code.
3746
+ *
3747
+ * Given a number, this will throw if it is not a known status
3748
+ * code, otherwise the code will be returned. Given a string,
3749
+ * the string will be parsed for a number and return the code
3750
+ * if valid, otherwise will lookup the code assuming this is
3751
+ * the status message.
3752
+ *
3753
+ * @param {string|number} code
3754
+ * @returns {number}
3755
+ * @public
3756
+ */
3757
+
3758
+ function status (code) {
3759
+ if (typeof code === 'number') {
3760
+ return getStatusMessage(code)
3761
+ }
3762
+
3763
+ if (typeof code !== 'string') {
3764
+ throw new TypeError('code must be a number or string')
3765
+ }
3766
+
3767
+ // '403'
3768
+ var n = parseInt(code, 10);
3769
+ if (!isNaN(n)) {
3770
+ return getStatusMessage(n)
3771
+ }
3772
+
3773
+ return getStatusCode(code)
3774
+ }
3775
+ return statuses;
3776
+ }
3777
+
3778
+ var inherits = {exports: {}};
3779
+
3780
+ var inherits_browser = {exports: {}};
3781
+
3782
+ var hasRequiredInherits_browser;
3783
+
3784
+ function requireInherits_browser () {
3785
+ if (hasRequiredInherits_browser) return inherits_browser.exports;
3786
+ hasRequiredInherits_browser = 1;
3787
+ if (typeof Object.create === 'function') {
3788
+ // implementation from standard node.js 'util' module
3789
+ inherits_browser.exports = function inherits(ctor, superCtor) {
3790
+ if (superCtor) {
3791
+ ctor.super_ = superCtor;
3792
+ ctor.prototype = Object.create(superCtor.prototype, {
3793
+ constructor: {
3794
+ value: ctor,
3795
+ enumerable: false,
3796
+ writable: true,
3797
+ configurable: true
3798
+ }
3799
+ });
3800
+ }
3801
+ };
3802
+ } else {
3803
+ // old school shim for old browsers
3804
+ inherits_browser.exports = function inherits(ctor, superCtor) {
3805
+ if (superCtor) {
3806
+ ctor.super_ = superCtor;
3807
+ var TempCtor = function () {};
3808
+ TempCtor.prototype = superCtor.prototype;
3809
+ ctor.prototype = new TempCtor();
3810
+ ctor.prototype.constructor = ctor;
3811
+ }
3812
+ };
3813
+ }
3814
+ return inherits_browser.exports;
3815
+ }
3816
+
3817
+ var hasRequiredInherits;
3818
+
3819
+ function requireInherits () {
3820
+ if (hasRequiredInherits) return inherits.exports;
3821
+ hasRequiredInherits = 1;
3822
+ try {
3823
+ var util = require('util');
3824
+ /* istanbul ignore next */
3825
+ if (typeof util.inherits !== 'function') throw '';
3826
+ inherits.exports = util.inherits;
3827
+ } catch (e) {
3828
+ /* istanbul ignore next */
3829
+ inherits.exports = requireInherits_browser();
3830
+ }
3831
+ return inherits.exports;
3832
+ }
3833
+
3834
+ /*!
3835
+ * toidentifier
3836
+ * Copyright(c) 2016 Douglas Christopher Wilson
3837
+ * MIT Licensed
3838
+ */
3839
+
3840
+ var toidentifier;
3841
+ var hasRequiredToidentifier;
3842
+
3843
+ function requireToidentifier () {
3844
+ if (hasRequiredToidentifier) return toidentifier;
3845
+ hasRequiredToidentifier = 1;
3846
+
3847
+ /**
3848
+ * Module exports.
3849
+ * @public
3850
+ */
3851
+
3852
+ toidentifier = toIdentifier;
3853
+
3854
+ /**
3855
+ * Trasform the given string into a JavaScript identifier
3856
+ *
3857
+ * @param {string} str
3858
+ * @returns {string}
3859
+ * @public
3860
+ */
3861
+
3862
+ function toIdentifier (str) {
3863
+ return str
3864
+ .split(' ')
3865
+ .map(function (token) {
3866
+ return token.slice(0, 1).toUpperCase() + token.slice(1)
3867
+ })
3868
+ .join('')
3869
+ .replace(/[^ _0-9a-z]/gi, '')
3870
+ }
3871
+ return toidentifier;
3872
+ }
3873
+
3874
+ /*!
3875
+ * http-errors
3876
+ * Copyright(c) 2014 Jonathan Ong
3877
+ * Copyright(c) 2016 Douglas Christopher Wilson
3878
+ * MIT Licensed
3879
+ */
3880
+
3881
+ var hasRequiredHttpErrors;
3882
+
3883
+ function requireHttpErrors () {
3884
+ if (hasRequiredHttpErrors) return httpErrors.exports;
3885
+ hasRequiredHttpErrors = 1;
3886
+ (function (module) {
3887
+
3888
+ /**
3889
+ * Module dependencies.
3890
+ * @private
3891
+ */
3892
+
3893
+ var deprecate = requireDepd()('http-errors');
3894
+ var setPrototypeOf = requireSetprototypeof();
3895
+ var statuses = requireStatuses();
3896
+ var inherits = requireInherits();
3897
+ var toIdentifier = requireToidentifier();
3898
+
3899
+ /**
3900
+ * Module exports.
3901
+ * @public
3902
+ */
3903
+
3904
+ module.exports = createError;
3905
+ module.exports.HttpError = createHttpErrorConstructor();
3906
+ module.exports.isHttpError = createIsHttpErrorFunction(module.exports.HttpError);
3907
+
3908
+ // Populate exports for all constructors
3909
+ populateConstructorExports(module.exports, statuses.codes, module.exports.HttpError);
3910
+
3911
+ /**
3912
+ * Get the code class of a status code.
3913
+ * @private
3914
+ */
3915
+
3916
+ function codeClass (status) {
3917
+ return Number(String(status).charAt(0) + '00')
3918
+ }
3919
+
3920
+ /**
3921
+ * Create a new HTTP Error.
3922
+ *
3923
+ * @returns {Error}
3924
+ * @public
3925
+ */
3926
+
3927
+ function createError () {
3928
+ // so much arity going on ~_~
3929
+ var err;
3930
+ var msg;
3931
+ var status = 500;
3932
+ var props = {};
3933
+ for (var i = 0; i < arguments.length; i++) {
3934
+ var arg = arguments[i];
3935
+ var type = typeof arg;
3936
+ if (type === 'object' && arg instanceof Error) {
3937
+ err = arg;
3938
+ status = err.status || err.statusCode || status;
3939
+ } else if (type === 'number' && i === 0) {
3940
+ status = arg;
3941
+ } else if (type === 'string') {
3942
+ msg = arg;
3943
+ } else if (type === 'object') {
3944
+ props = arg;
3945
+ } else {
3946
+ throw new TypeError('argument #' + (i + 1) + ' unsupported type ' + type)
3947
+ }
3948
+ }
3949
+
3950
+ if (typeof status === 'number' && (status < 400 || status >= 600)) {
3951
+ deprecate('non-error status code; use only 4xx or 5xx status codes');
3952
+ }
3953
+
3954
+ if (typeof status !== 'number' ||
3955
+ (!statuses.message[status] && (status < 400 || status >= 600))) {
3956
+ status = 500;
3957
+ }
3958
+
3959
+ // constructor
3960
+ var HttpError = createError[status] || createError[codeClass(status)];
3961
+
3962
+ if (!err) {
3963
+ // create error
3964
+ err = HttpError
3965
+ ? new HttpError(msg)
3966
+ : new Error(msg || statuses.message[status]);
3967
+ Error.captureStackTrace(err, createError);
3968
+ }
3969
+
3970
+ if (!HttpError || !(err instanceof HttpError) || err.status !== status) {
3971
+ // add properties to generic error
3972
+ err.expose = status < 500;
3973
+ err.status = err.statusCode = status;
3974
+ }
3975
+
3976
+ for (var key in props) {
3977
+ if (key !== 'status' && key !== 'statusCode') {
3978
+ err[key] = props[key];
3979
+ }
3980
+ }
3981
+
3982
+ return err
3983
+ }
3984
+
3985
+ /**
3986
+ * Create HTTP error abstract base class.
3987
+ * @private
3988
+ */
3989
+
3990
+ function createHttpErrorConstructor () {
3991
+ function HttpError () {
3992
+ throw new TypeError('cannot construct abstract class')
3993
+ }
3994
+
3995
+ inherits(HttpError, Error);
3996
+
3997
+ return HttpError
3998
+ }
3999
+
4000
+ /**
4001
+ * Create a constructor for a client error.
4002
+ * @private
4003
+ */
4004
+
4005
+ function createClientErrorConstructor (HttpError, name, code) {
4006
+ var className = toClassName(name);
4007
+
4008
+ function ClientError (message) {
4009
+ // create the error object
4010
+ var msg = message != null ? message : statuses.message[code];
4011
+ var err = new Error(msg);
4012
+
4013
+ // capture a stack trace to the construction point
4014
+ Error.captureStackTrace(err, ClientError);
4015
+
4016
+ // adjust the [[Prototype]]
4017
+ setPrototypeOf(err, ClientError.prototype);
4018
+
4019
+ // redefine the error message
4020
+ Object.defineProperty(err, 'message', {
4021
+ enumerable: true,
4022
+ configurable: true,
4023
+ value: msg,
4024
+ writable: true
4025
+ });
4026
+
4027
+ // redefine the error name
4028
+ Object.defineProperty(err, 'name', {
4029
+ enumerable: false,
4030
+ configurable: true,
4031
+ value: className,
4032
+ writable: true
4033
+ });
4034
+
4035
+ return err
4036
+ }
4037
+
4038
+ inherits(ClientError, HttpError);
4039
+ nameFunc(ClientError, className);
4040
+
4041
+ ClientError.prototype.status = code;
4042
+ ClientError.prototype.statusCode = code;
4043
+ ClientError.prototype.expose = true;
4044
+
4045
+ return ClientError
4046
+ }
4047
+
4048
+ /**
4049
+ * Create function to test is a value is a HttpError.
4050
+ * @private
4051
+ */
4052
+
4053
+ function createIsHttpErrorFunction (HttpError) {
4054
+ return function isHttpError (val) {
4055
+ if (!val || typeof val !== 'object') {
4056
+ return false
4057
+ }
4058
+
4059
+ if (val instanceof HttpError) {
4060
+ return true
4061
+ }
4062
+
4063
+ return val instanceof Error &&
4064
+ typeof val.expose === 'boolean' &&
4065
+ typeof val.statusCode === 'number' && val.status === val.statusCode
4066
+ }
4067
+ }
4068
+
4069
+ /**
4070
+ * Create a constructor for a server error.
4071
+ * @private
4072
+ */
4073
+
4074
+ function createServerErrorConstructor (HttpError, name, code) {
4075
+ var className = toClassName(name);
4076
+
4077
+ function ServerError (message) {
4078
+ // create the error object
4079
+ var msg = message != null ? message : statuses.message[code];
4080
+ var err = new Error(msg);
4081
+
4082
+ // capture a stack trace to the construction point
4083
+ Error.captureStackTrace(err, ServerError);
4084
+
4085
+ // adjust the [[Prototype]]
4086
+ setPrototypeOf(err, ServerError.prototype);
4087
+
4088
+ // redefine the error message
4089
+ Object.defineProperty(err, 'message', {
4090
+ enumerable: true,
4091
+ configurable: true,
4092
+ value: msg,
4093
+ writable: true
4094
+ });
4095
+
4096
+ // redefine the error name
4097
+ Object.defineProperty(err, 'name', {
4098
+ enumerable: false,
4099
+ configurable: true,
4100
+ value: className,
4101
+ writable: true
4102
+ });
4103
+
4104
+ return err
4105
+ }
4106
+
4107
+ inherits(ServerError, HttpError);
4108
+ nameFunc(ServerError, className);
4109
+
4110
+ ServerError.prototype.status = code;
4111
+ ServerError.prototype.statusCode = code;
4112
+ ServerError.prototype.expose = false;
4113
+
4114
+ return ServerError
4115
+ }
4116
+
4117
+ /**
4118
+ * Set the name of a function, if possible.
4119
+ * @private
4120
+ */
4121
+
4122
+ function nameFunc (func, name) {
4123
+ var desc = Object.getOwnPropertyDescriptor(func, 'name');
4124
+
4125
+ if (desc && desc.configurable) {
4126
+ desc.value = name;
4127
+ Object.defineProperty(func, 'name', desc);
4128
+ }
4129
+ }
4130
+
4131
+ /**
4132
+ * Populate the exports object with constructors for every error class.
4133
+ * @private
4134
+ */
4135
+
4136
+ function populateConstructorExports (exports$1, codes, HttpError) {
4137
+ codes.forEach(function forEachCode (code) {
4138
+ var CodeError;
4139
+ var name = toIdentifier(statuses.message[code]);
4140
+
4141
+ switch (codeClass(code)) {
4142
+ case 400:
4143
+ CodeError = createClientErrorConstructor(HttpError, name, code);
4144
+ break
4145
+ case 500:
4146
+ CodeError = createServerErrorConstructor(HttpError, name, code);
4147
+ break
4148
+ }
4149
+
4150
+ if (CodeError) {
4151
+ // export the constructor
4152
+ exports$1[code] = CodeError;
4153
+ exports$1[name] = CodeError;
4154
+ }
4155
+ });
4156
+ }
4157
+
4158
+ /**
4159
+ * Get a class name from a name identifier.
4160
+ * @private
4161
+ */
4162
+
4163
+ function toClassName (name) {
4164
+ return name.substr(-5) !== 'Error'
4165
+ ? name + 'Error'
4166
+ : name
4167
+ }
4168
+ } (httpErrors));
4169
+ return httpErrors.exports;
4170
+ }
4171
+
4172
+ var httpErrorsExports = requireHttpErrors();
4173
+ var HttpErrors = /*@__PURE__*/getDefaultExportFromCjs(httpErrorsExports);
4174
+
4175
+ class BaseService {
4176
+ constructor(instanceId, auth, baseUrl) {
4177
+ this.instanceId = instanceId;
4178
+ this.auth = auth;
4179
+ this.baseUrl = baseUrl;
4180
+ if (!this.instanceId ||
4181
+ (typeof this.auth === 'string' && !this.auth) ||
4182
+ (typeof this.auth === 'object' && (!this.auth.email || !this.auth.apiKey))) {
4183
+ throw new HttpErrors.UnprocessableEntity('izz.ONE service is not properly configured');
4184
+ }
4185
+ }
4186
+ headers(extra = {}) {
4187
+ return {
4188
+ ...extra,
4189
+ 'x-environment-id': this.instanceId,
4190
+ ...(typeof this.auth === 'string'
4191
+ ? {
4192
+ 'izz-access-token': this.auth,
4193
+ }
4194
+ : {
4195
+ Authorization: `Basic ${Buffer.from([this.auth.email, this.auth.apiKey].join(':')).toString('base64')}`,
4196
+ }),
4197
+ };
4198
+ }
4199
+ async _request(path, options = {}) {
4200
+ options.headers || (options.headers = this.headers());
4201
+ return await fetch(new URL(path, this.baseUrl), options);
4202
+ }
4203
+ async sendPost(path, body) {
4204
+ return await this._request(path, {
4205
+ method: 'POST',
4206
+ headers: this.headers(body instanceof FormData ? {} : { 'Content-Type': 'application/json' }),
4207
+ body: body instanceof FormData ? body : JSON.stringify(body),
4208
+ });
4209
+ }
4210
+ async sendPatch(path, body) {
4211
+ return await this._request(path, {
4212
+ method: 'PATCH',
4213
+ body: body instanceof FormData ? body : JSON.stringify(body),
4214
+ });
4215
+ }
4216
+ async sendPut(path, body) {
4217
+ return await this._request(path, {
4218
+ method: 'PUT',
4219
+ body: body instanceof FormData ? body : JSON.stringify(body),
4220
+ });
4221
+ }
4222
+ async sendGet(path) {
4223
+ return await this._request(path, {
4224
+ method: 'GET',
4225
+ });
4226
+ }
4227
+ async sendDelete(path) {
4228
+ return await this._request(path, {
4229
+ method: 'DELETE',
4230
+ });
4231
+ }
4232
+ }
4233
+
4234
+ class AgentService extends BaseService {
4235
+ async list(search = '', limit = 20, offset = 0) {
4236
+ const query = libExports.stringify({
4237
+ q: search,
4238
+ limit,
4239
+ offset,
4240
+ populate: [{ path: 'steps' }],
4241
+ });
4242
+ const response = await this.sendGet(`/v1/agent?${query}`).then((res) => res.json());
4243
+ return response.data || [];
4244
+ }
4245
+ }
4246
+
4247
+ class ChatService extends BaseService {
4248
+ async chat(msg, options, messageMode = 'user-message') {
4249
+ const chatOptions = {
4250
+ msg,
4251
+ ...(options || {}),
4252
+ };
4253
+ chatOptions.datasources || (chatOptions.datasources = []);
4254
+ chatOptions.tags || (chatOptions.tags = []);
4255
+ chatOptions.tags.push('one-js-sdk');
4256
+ const response = await this.sendPost('/v1/chat', chatOptions).then((res) => res.json());
4257
+ if (!response.messages?.length) {
4258
+ throw new HttpErrors.InternalServerError('No messages found in response');
4259
+ }
4260
+ if (messageMode === 'user-message') {
4261
+ const userMessage = response.messages.find((m) => m.role === 'user');
4262
+ return userMessage;
4263
+ }
4264
+ if (messageMode === 'ai-message') {
4265
+ const aiMessage = response.messages.find((m) => m.role === 'assistant');
4266
+ return aiMessage;
4267
+ }
4268
+ return response;
4269
+ }
4270
+ async chatWithFile(msg, file, fileName, options, messageMode = 'user-message') {
4271
+ const formData = new FormData();
4272
+ formData.append('file', file, fileName);
4273
+ formData.append('msg', msg);
4274
+ options || (options = {});
4275
+ options.datasources || (options.datasources = []);
4276
+ const params = new URLSearchParams(libExports.stringify(options, { allowEmptyArrays: true }));
4277
+ for (const [key, value] of params.entries()) {
4278
+ formData.append(key, value);
4279
+ }
4280
+ const response = await this.sendPost('/v1/chat', formData).then((res) => res.json());
4281
+ if (messageMode === 'user-message') {
4282
+ const userMessage = response.messages.find((m) => m.role === 'user');
4283
+ return userMessage;
4284
+ }
4285
+ if (messageMode === 'ai-message') {
4286
+ const aiMessage = response.messages.find((m) => m.role === 'assistant');
4287
+ return aiMessage;
4288
+ }
4289
+ return response;
4290
+ }
4291
+ }
4292
+
4293
+ class DatasourceService extends BaseService {
4294
+ async list(search = '', limit = 20, offset = 0) {
4295
+ const query = libExports.stringify({ q: search, limit, offset });
4296
+ const response = await this.sendGet(`/v1/datasource?${query}`).then((res) => res.json());
4297
+ return response.data || [];
4298
+ }
4299
+ }
4300
+
4301
+ class GptService extends BaseService {
4302
+ async list(search = '', limit = 20, offset = 0) {
4303
+ const query = libExports.stringify({
4304
+ q: search,
4305
+ limit,
4306
+ offset,
4307
+ });
4308
+ const response = await this.sendGet(`/v1/gpt?${query}`).then((res) => res.json());
4309
+ return response.data || [];
4310
+ }
4311
+ }
4312
+
4313
+ const services = (instanceId, auth, baseUrl) => ({
4314
+ agent: new AgentService(instanceId, auth, baseUrl),
4315
+ chat: new ChatService(instanceId, auth, baseUrl),
4316
+ datasource: new DatasourceService(instanceId, auth, baseUrl),
4317
+ gpt: new GptService(instanceId, auth, baseUrl),
4318
+ });
4319
+
4320
+ class One extends BaseService {
8
4321
  constructor(instanceId, auth, baseUrl) {
9
4322
  super(instanceId, auth, baseUrl);
10
- this._services ||= (0, services_1.services)(this.instanceId, this.auth, this.baseUrl);
4323
+ this._services || (this._services = services(this.instanceId, this.auth, this.baseUrl));
11
4324
  }
12
4325
  get agent() {
13
4326
  return this._services.agent;
@@ -22,4 +4335,6 @@ class One extends base_1.BaseService {
22
4335
  return this._services.gpt;
23
4336
  }
24
4337
  }
25
- exports.One = One;
4338
+
4339
+ export { One };
4340
+ //# sourceMappingURL=index.js.map