@dereekb/zoom 12.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -0
  3. package/index.cjs.d.ts +1 -0
  4. package/index.cjs.js +4346 -0
  5. package/index.esm.d.ts +1 -0
  6. package/index.esm.js +4293 -0
  7. package/nestjs/CHANGELOG.md +183 -0
  8. package/nestjs/README.md +11 -0
  9. package/nestjs/package.json +7 -0
  10. package/nestjs/src/index.d.ts +1 -0
  11. package/nestjs/src/index.js +5 -0
  12. package/nestjs/src/index.js.map +1 -0
  13. package/nestjs/src/lib/index.d.ts +2 -0
  14. package/nestjs/src/lib/index.js +6 -0
  15. package/nestjs/src/lib/index.js.map +1 -0
  16. package/nestjs/src/lib/oauth/index.d.ts +3 -0
  17. package/nestjs/src/lib/oauth/index.js +7 -0
  18. package/nestjs/src/lib/oauth/index.js.map +1 -0
  19. package/nestjs/src/lib/oauth/oauth.api.d.ts +12 -0
  20. package/nestjs/src/lib/oauth/oauth.api.js +41 -0
  21. package/nestjs/src/lib/oauth/oauth.api.js.map +1 -0
  22. package/nestjs/src/lib/oauth/oauth.config.d.ts +14 -0
  23. package/nestjs/src/lib/oauth/oauth.config.js +50 -0
  24. package/nestjs/src/lib/oauth/oauth.config.js.map +1 -0
  25. package/nestjs/src/lib/oauth/oauth.module.d.ts +29 -0
  26. package/nestjs/src/lib/oauth/oauth.module.js +36 -0
  27. package/nestjs/src/lib/oauth/oauth.module.js.map +1 -0
  28. package/nestjs/src/lib/oauth/oauth.service.d.ts +55 -0
  29. package/nestjs/src/lib/oauth/oauth.service.js +226 -0
  30. package/nestjs/src/lib/oauth/oauth.service.js.map +1 -0
  31. package/nestjs/src/lib/zoom/index.d.ts +3 -0
  32. package/nestjs/src/lib/zoom/index.js +7 -0
  33. package/nestjs/src/lib/zoom/index.js.map +1 -0
  34. package/nestjs/src/lib/zoom/zoom.api.d.ts +21 -0
  35. package/nestjs/src/lib/zoom/zoom.api.js +65 -0
  36. package/nestjs/src/lib/zoom/zoom.api.js.map +1 -0
  37. package/nestjs/src/lib/zoom/zoom.config.d.ts +10 -0
  38. package/nestjs/src/lib/zoom/zoom.config.js +15 -0
  39. package/nestjs/src/lib/zoom/zoom.config.js.map +1 -0
  40. package/nestjs/src/lib/zoom/zoom.module.d.ts +22 -0
  41. package/nestjs/src/lib/zoom/zoom.module.js +40 -0
  42. package/nestjs/src/lib/zoom/zoom.module.js.map +1 -0
  43. package/package.json +31 -0
  44. package/src/index.d.ts +1 -0
  45. package/src/lib/index.d.ts +7 -0
  46. package/src/lib/oauth/index.d.ts +5 -0
  47. package/src/lib/oauth/oauth.api.d.ts +39 -0
  48. package/src/lib/oauth/oauth.config.d.ts +44 -0
  49. package/src/lib/oauth/oauth.d.ts +71 -0
  50. package/src/lib/oauth/oauth.error.api.d.ts +30 -0
  51. package/src/lib/oauth/oauth.factory.d.ts +34 -0
  52. package/src/lib/zoom/index.d.ts +7 -0
  53. package/src/lib/zoom/zoom.api.meeting.d.ts +144 -0
  54. package/src/lib/zoom/zoom.api.meeting.type.d.ts +297 -0
  55. package/src/lib/zoom/zoom.api.user.d.ts +32 -0
  56. package/src/lib/zoom/zoom.api.user.type.d.ts +287 -0
  57. package/src/lib/zoom/zoom.config.d.ts +69 -0
  58. package/src/lib/zoom/zoom.error.api.d.ts +6 -0
  59. package/src/lib/zoom/zoom.factory.d.ts +23 -0
  60. package/src/lib/zoom.api.page.d.ts +73 -0
  61. package/src/lib/zoom.config.d.ts +39 -0
  62. package/src/lib/zoom.error.api.d.ts +145 -0
  63. package/src/lib/zoom.limit.d.ts +37 -0
  64. package/src/lib/zoom.type.d.ts +12 -0
package/index.esm.js ADDED
@@ -0,0 +1,4293 @@
1
+ import { fetchPageFactory, FetchResponseError, mergeMakeUrlSearchParamsOptions, makeUrlSearchParams, FetchRequestFactoryError, rateLimitedFetchHandler, fetchJsonFunction, returnNullHandleFetchJsonParseErrorFunction, fetchApiFetchService } from '@dereekb/util/fetch';
2
+ import { MS_IN_MINUTE, asArray, resetPeriodPromiseRateLimiter, MS_IN_SECOND } from '@dereekb/util';
3
+ import { BaseError } from 'make-error';
4
+
5
+ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
+
7
+ var check = function (it) {
8
+ return it && it.Math === Math && it;
9
+ };
10
+
11
+ // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
12
+ var global$j =
13
+ // eslint-disable-next-line es/no-global-this -- safe
14
+ check(typeof globalThis == 'object' && globalThis) ||
15
+ check(typeof window == 'object' && window) ||
16
+ // eslint-disable-next-line no-restricted-globals -- safe
17
+ check(typeof self == 'object' && self) ||
18
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
19
+ check(typeof commonjsGlobal == 'object' && commonjsGlobal) ||
20
+ // eslint-disable-next-line no-new-func -- fallback
21
+ (function () { return this; })() || Function('return this')();
22
+
23
+ var objectGetOwnPropertyDescriptor = {};
24
+
25
+ var fails$h = function (exec) {
26
+ try {
27
+ return !!exec();
28
+ } catch (error) {
29
+ return true;
30
+ }
31
+ };
32
+
33
+ var fails$g = fails$h;
34
+
35
+ // Detect IE8's incomplete defineProperty implementation
36
+ var descriptors = !fails$g(function () {
37
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
38
+ return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
39
+ });
40
+
41
+ var fails$f = fails$h;
42
+
43
+ var functionBindNative = !fails$f(function () {
44
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
45
+ var test = (function () { /* empty */ }).bind();
46
+ // eslint-disable-next-line no-prototype-builtins -- safe
47
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
48
+ });
49
+
50
+ var NATIVE_BIND$3 = functionBindNative;
51
+
52
+ var call$h = Function.prototype.call;
53
+
54
+ var functionCall = NATIVE_BIND$3 ? call$h.bind(call$h) : function () {
55
+ return call$h.apply(call$h, arguments);
56
+ };
57
+
58
+ var objectPropertyIsEnumerable = {};
59
+
60
+ var $propertyIsEnumerable = {}.propertyIsEnumerable;
61
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
62
+ var getOwnPropertyDescriptor$2 = Object.getOwnPropertyDescriptor;
63
+
64
+ // Nashorn ~ JDK8 bug
65
+ var NASHORN_BUG = getOwnPropertyDescriptor$2 && !$propertyIsEnumerable.call({ 1: 2 }, 1);
66
+
67
+ // `Object.prototype.propertyIsEnumerable` method implementation
68
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
69
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
70
+ var descriptor = getOwnPropertyDescriptor$2(this, V);
71
+ return !!descriptor && descriptor.enumerable;
72
+ } : $propertyIsEnumerable;
73
+
74
+ var createPropertyDescriptor$4 = function (bitmap, value) {
75
+ return {
76
+ enumerable: !(bitmap & 1),
77
+ configurable: !(bitmap & 2),
78
+ writable: !(bitmap & 4),
79
+ value: value
80
+ };
81
+ };
82
+
83
+ var NATIVE_BIND$2 = functionBindNative;
84
+
85
+ var FunctionPrototype$2 = Function.prototype;
86
+ var call$g = FunctionPrototype$2.call;
87
+ var uncurryThisWithBind = NATIVE_BIND$2 && FunctionPrototype$2.bind.bind(call$g, call$g);
88
+
89
+ var functionUncurryThis = NATIVE_BIND$2 ? uncurryThisWithBind : function (fn) {
90
+ return function () {
91
+ return call$g.apply(fn, arguments);
92
+ };
93
+ };
94
+
95
+ var uncurryThis$j = functionUncurryThis;
96
+
97
+ var toString$4 = uncurryThis$j({}.toString);
98
+ var stringSlice$1 = uncurryThis$j(''.slice);
99
+
100
+ var classofRaw$2 = function (it) {
101
+ return stringSlice$1(toString$4(it), 8, -1);
102
+ };
103
+
104
+ var uncurryThis$i = functionUncurryThis;
105
+ var fails$e = fails$h;
106
+ var classof$7 = classofRaw$2;
107
+
108
+ var $Object$4 = Object;
109
+ var split = uncurryThis$i(''.split);
110
+
111
+ // fallback for non-array-like ES3 and non-enumerable old V8 strings
112
+ var indexedObject = fails$e(function () {
113
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
114
+ // eslint-disable-next-line no-prototype-builtins -- safe
115
+ return !$Object$4('z').propertyIsEnumerable(0);
116
+ }) ? function (it) {
117
+ return classof$7(it) === 'String' ? split(it, '') : $Object$4(it);
118
+ } : $Object$4;
119
+
120
+ // we can't use just `it == null` since of `document.all` special case
121
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
122
+ var isNullOrUndefined$4 = function (it) {
123
+ return it === null || it === undefined;
124
+ };
125
+
126
+ var isNullOrUndefined$3 = isNullOrUndefined$4;
127
+
128
+ var $TypeError$d = TypeError;
129
+
130
+ // `RequireObjectCoercible` abstract operation
131
+ // https://tc39.es/ecma262/#sec-requireobjectcoercible
132
+ var requireObjectCoercible$3 = function (it) {
133
+ if (isNullOrUndefined$3(it)) throw new $TypeError$d("Can't call method on " + it);
134
+ return it;
135
+ };
136
+
137
+ // toObject with fallback for non-array-like ES3 strings
138
+ var IndexedObject$1 = indexedObject;
139
+ var requireObjectCoercible$2 = requireObjectCoercible$3;
140
+
141
+ var toIndexedObject$5 = function (it) {
142
+ return IndexedObject$1(requireObjectCoercible$2(it));
143
+ };
144
+
145
+ // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
146
+ var documentAll = typeof document == 'object' && document.all;
147
+
148
+ // `IsCallable` abstract operation
149
+ // https://tc39.es/ecma262/#sec-iscallable
150
+ // eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
151
+ var isCallable$m = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
152
+ return typeof argument == 'function' || argument === documentAll;
153
+ } : function (argument) {
154
+ return typeof argument == 'function';
155
+ };
156
+
157
+ var isCallable$l = isCallable$m;
158
+
159
+ var isObject$c = function (it) {
160
+ return typeof it == 'object' ? it !== null : isCallable$l(it);
161
+ };
162
+
163
+ var global$i = global$j;
164
+ var isCallable$k = isCallable$m;
165
+
166
+ var aFunction = function (argument) {
167
+ return isCallable$k(argument) ? argument : undefined;
168
+ };
169
+
170
+ var getBuiltIn$a = function (namespace, method) {
171
+ return arguments.length < 2 ? aFunction(global$i[namespace]) : global$i[namespace] && global$i[namespace][method];
172
+ };
173
+
174
+ var uncurryThis$h = functionUncurryThis;
175
+
176
+ var objectIsPrototypeOf = uncurryThis$h({}.isPrototypeOf);
177
+
178
+ var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
179
+
180
+ var global$h = global$j;
181
+ var userAgent$3 = engineUserAgent;
182
+
183
+ var process$3 = global$h.process;
184
+ var Deno$1 = global$h.Deno;
185
+ var versions = process$3 && process$3.versions || Deno$1 && Deno$1.version;
186
+ var v8 = versions && versions.v8;
187
+ var match, version;
188
+
189
+ if (v8) {
190
+ match = v8.split('.');
191
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
192
+ // but their correct versions are not interesting for us
193
+ version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
194
+ }
195
+
196
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
197
+ // so check `userAgent` even if `.v8` exists, but 0
198
+ if (!version && userAgent$3) {
199
+ match = userAgent$3.match(/Edge\/(\d+)/);
200
+ if (!match || match[1] >= 74) {
201
+ match = userAgent$3.match(/Chrome\/(\d+)/);
202
+ if (match) version = +match[1];
203
+ }
204
+ }
205
+
206
+ var engineV8Version = version;
207
+
208
+ /* eslint-disable es/no-symbol -- required for testing */
209
+ var V8_VERSION$1 = engineV8Version;
210
+ var fails$d = fails$h;
211
+ var global$g = global$j;
212
+
213
+ var $String$6 = global$g.String;
214
+
215
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
216
+ var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$d(function () {
217
+ var symbol = Symbol('symbol detection');
218
+ // Chrome 38 Symbol has incorrect toString conversion
219
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
220
+ // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
221
+ // of course, fail.
222
+ return !$String$6(symbol) || !(Object(symbol) instanceof Symbol) ||
223
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
224
+ !Symbol.sham && V8_VERSION$1 && V8_VERSION$1 < 41;
225
+ });
226
+
227
+ /* eslint-disable es/no-symbol -- required for testing */
228
+ var NATIVE_SYMBOL$2 = symbolConstructorDetection;
229
+
230
+ var useSymbolAsUid = NATIVE_SYMBOL$2
231
+ && !Symbol.sham
232
+ && typeof Symbol.iterator == 'symbol';
233
+
234
+ var getBuiltIn$9 = getBuiltIn$a;
235
+ var isCallable$j = isCallable$m;
236
+ var isPrototypeOf$4 = objectIsPrototypeOf;
237
+ var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
238
+
239
+ var $Object$3 = Object;
240
+
241
+ var isSymbol$3 = USE_SYMBOL_AS_UID$1 ? function (it) {
242
+ return typeof it == 'symbol';
243
+ } : function (it) {
244
+ var $Symbol = getBuiltIn$9('Symbol');
245
+ return isCallable$j($Symbol) && isPrototypeOf$4($Symbol.prototype, $Object$3(it));
246
+ };
247
+
248
+ var $String$5 = String;
249
+
250
+ var tryToString$4 = function (argument) {
251
+ try {
252
+ return $String$5(argument);
253
+ } catch (error) {
254
+ return 'Object';
255
+ }
256
+ };
257
+
258
+ var isCallable$i = isCallable$m;
259
+ var tryToString$3 = tryToString$4;
260
+
261
+ var $TypeError$c = TypeError;
262
+
263
+ // `Assert: IsCallable(argument) is true`
264
+ var aCallable$9 = function (argument) {
265
+ if (isCallable$i(argument)) return argument;
266
+ throw new $TypeError$c(tryToString$3(argument) + ' is not a function');
267
+ };
268
+
269
+ var aCallable$8 = aCallable$9;
270
+ var isNullOrUndefined$2 = isNullOrUndefined$4;
271
+
272
+ // `GetMethod` abstract operation
273
+ // https://tc39.es/ecma262/#sec-getmethod
274
+ var getMethod$3 = function (V, P) {
275
+ var func = V[P];
276
+ return isNullOrUndefined$2(func) ? undefined : aCallable$8(func);
277
+ };
278
+
279
+ var call$f = functionCall;
280
+ var isCallable$h = isCallable$m;
281
+ var isObject$b = isObject$c;
282
+
283
+ var $TypeError$b = TypeError;
284
+
285
+ // `OrdinaryToPrimitive` abstract operation
286
+ // https://tc39.es/ecma262/#sec-ordinarytoprimitive
287
+ var ordinaryToPrimitive$1 = function (input, pref) {
288
+ var fn, val;
289
+ if (pref === 'string' && isCallable$h(fn = input.toString) && !isObject$b(val = call$f(fn, input))) return val;
290
+ if (isCallable$h(fn = input.valueOf) && !isObject$b(val = call$f(fn, input))) return val;
291
+ if (pref !== 'string' && isCallable$h(fn = input.toString) && !isObject$b(val = call$f(fn, input))) return val;
292
+ throw new $TypeError$b("Can't convert object to primitive value");
293
+ };
294
+
295
+ var sharedStore = {exports: {}};
296
+
297
+ var global$f = global$j;
298
+
299
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
300
+ var defineProperty$7 = Object.defineProperty;
301
+
302
+ var defineGlobalProperty$3 = function (key, value) {
303
+ try {
304
+ defineProperty$7(global$f, key, { value: value, configurable: true, writable: true });
305
+ } catch (error) {
306
+ global$f[key] = value;
307
+ } return value;
308
+ };
309
+
310
+ var globalThis$1 = global$j;
311
+ var defineGlobalProperty$2 = defineGlobalProperty$3;
312
+
313
+ var SHARED = '__core-js_shared__';
314
+ var store$3 = sharedStore.exports = globalThis$1[SHARED] || defineGlobalProperty$2(SHARED, {});
315
+
316
+ (store$3.versions || (store$3.versions = [])).push({
317
+ version: '3.36.1',
318
+ mode: 'global',
319
+ copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
320
+ license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
321
+ source: 'https://github.com/zloirock/core-js'
322
+ });
323
+
324
+ var sharedStoreExports = sharedStore.exports;
325
+
326
+ var store$2 = sharedStoreExports;
327
+
328
+ var shared$3 = function (key, value) {
329
+ return store$2[key] || (store$2[key] = value || {});
330
+ };
331
+
332
+ var requireObjectCoercible$1 = requireObjectCoercible$3;
333
+
334
+ var $Object$2 = Object;
335
+
336
+ // `ToObject` abstract operation
337
+ // https://tc39.es/ecma262/#sec-toobject
338
+ var toObject$3 = function (argument) {
339
+ return $Object$2(requireObjectCoercible$1(argument));
340
+ };
341
+
342
+ var uncurryThis$g = functionUncurryThis;
343
+ var toObject$2 = toObject$3;
344
+
345
+ var hasOwnProperty = uncurryThis$g({}.hasOwnProperty);
346
+
347
+ // `HasOwnProperty` abstract operation
348
+ // https://tc39.es/ecma262/#sec-hasownproperty
349
+ // eslint-disable-next-line es/no-object-hasown -- safe
350
+ var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
351
+ return hasOwnProperty(toObject$2(it), key);
352
+ };
353
+
354
+ var uncurryThis$f = functionUncurryThis;
355
+
356
+ var id = 0;
357
+ var postfix = Math.random();
358
+ var toString$3 = uncurryThis$f(1.0.toString);
359
+
360
+ var uid$2 = function (key) {
361
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
362
+ };
363
+
364
+ var global$e = global$j;
365
+ var shared$2 = shared$3;
366
+ var hasOwn$b = hasOwnProperty_1;
367
+ var uid$1 = uid$2;
368
+ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
369
+ var USE_SYMBOL_AS_UID = useSymbolAsUid;
370
+
371
+ var Symbol$1 = global$e.Symbol;
372
+ var WellKnownSymbolsStore = shared$2('wks');
373
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1['for'] || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
374
+
375
+ var wellKnownSymbol$e = function (name) {
376
+ if (!hasOwn$b(WellKnownSymbolsStore, name)) {
377
+ WellKnownSymbolsStore[name] = NATIVE_SYMBOL$1 && hasOwn$b(Symbol$1, name)
378
+ ? Symbol$1[name]
379
+ : createWellKnownSymbol('Symbol.' + name);
380
+ } return WellKnownSymbolsStore[name];
381
+ };
382
+
383
+ var call$e = functionCall;
384
+ var isObject$a = isObject$c;
385
+ var isSymbol$2 = isSymbol$3;
386
+ var getMethod$2 = getMethod$3;
387
+ var ordinaryToPrimitive = ordinaryToPrimitive$1;
388
+ var wellKnownSymbol$d = wellKnownSymbol$e;
389
+
390
+ var $TypeError$a = TypeError;
391
+ var TO_PRIMITIVE = wellKnownSymbol$d('toPrimitive');
392
+
393
+ // `ToPrimitive` abstract operation
394
+ // https://tc39.es/ecma262/#sec-toprimitive
395
+ var toPrimitive$1 = function (input, pref) {
396
+ if (!isObject$a(input) || isSymbol$2(input)) return input;
397
+ var exoticToPrim = getMethod$2(input, TO_PRIMITIVE);
398
+ var result;
399
+ if (exoticToPrim) {
400
+ if (pref === undefined) pref = 'default';
401
+ result = call$e(exoticToPrim, input, pref);
402
+ if (!isObject$a(result) || isSymbol$2(result)) return result;
403
+ throw new $TypeError$a("Can't convert object to primitive value");
404
+ }
405
+ if (pref === undefined) pref = 'number';
406
+ return ordinaryToPrimitive(input, pref);
407
+ };
408
+
409
+ var toPrimitive = toPrimitive$1;
410
+ var isSymbol$1 = isSymbol$3;
411
+
412
+ // `ToPropertyKey` abstract operation
413
+ // https://tc39.es/ecma262/#sec-topropertykey
414
+ var toPropertyKey$2 = function (argument) {
415
+ var key = toPrimitive(argument, 'string');
416
+ return isSymbol$1(key) ? key : key + '';
417
+ };
418
+
419
+ var global$d = global$j;
420
+ var isObject$9 = isObject$c;
421
+
422
+ var document$3 = global$d.document;
423
+ // typeof document.createElement is 'object' in old IE
424
+ var EXISTS$1 = isObject$9(document$3) && isObject$9(document$3.createElement);
425
+
426
+ var documentCreateElement$2 = function (it) {
427
+ return EXISTS$1 ? document$3.createElement(it) : {};
428
+ };
429
+
430
+ var DESCRIPTORS$c = descriptors;
431
+ var fails$c = fails$h;
432
+ var createElement$1 = documentCreateElement$2;
433
+
434
+ // Thanks to IE8 for its funny defineProperty
435
+ var ie8DomDefine = !DESCRIPTORS$c && !fails$c(function () {
436
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
437
+ return Object.defineProperty(createElement$1('div'), 'a', {
438
+ get: function () { return 7; }
439
+ }).a !== 7;
440
+ });
441
+
442
+ var DESCRIPTORS$b = descriptors;
443
+ var call$d = functionCall;
444
+ var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
445
+ var createPropertyDescriptor$3 = createPropertyDescriptor$4;
446
+ var toIndexedObject$4 = toIndexedObject$5;
447
+ var toPropertyKey$1 = toPropertyKey$2;
448
+ var hasOwn$a = hasOwnProperty_1;
449
+ var IE8_DOM_DEFINE$1 = ie8DomDefine;
450
+
451
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
452
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
453
+
454
+ // `Object.getOwnPropertyDescriptor` method
455
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
456
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$b ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
457
+ O = toIndexedObject$4(O);
458
+ P = toPropertyKey$1(P);
459
+ if (IE8_DOM_DEFINE$1) try {
460
+ return $getOwnPropertyDescriptor$1(O, P);
461
+ } catch (error) { /* empty */ }
462
+ if (hasOwn$a(O, P)) return createPropertyDescriptor$3(!call$d(propertyIsEnumerableModule$1.f, O, P), O[P]);
463
+ };
464
+
465
+ var objectDefineProperty = {};
466
+
467
+ var DESCRIPTORS$a = descriptors;
468
+ var fails$b = fails$h;
469
+
470
+ // V8 ~ Chrome 36-
471
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
472
+ var v8PrototypeDefineBug = DESCRIPTORS$a && fails$b(function () {
473
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
474
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
475
+ value: 42,
476
+ writable: false
477
+ }).prototype !== 42;
478
+ });
479
+
480
+ var isObject$8 = isObject$c;
481
+
482
+ var $String$4 = String;
483
+ var $TypeError$9 = TypeError;
484
+
485
+ // `Assert: Type(argument) is Object`
486
+ var anObject$c = function (argument) {
487
+ if (isObject$8(argument)) return argument;
488
+ throw new $TypeError$9($String$4(argument) + ' is not an object');
489
+ };
490
+
491
+ var DESCRIPTORS$9 = descriptors;
492
+ var IE8_DOM_DEFINE = ie8DomDefine;
493
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
494
+ var anObject$b = anObject$c;
495
+ var toPropertyKey = toPropertyKey$2;
496
+
497
+ var $TypeError$8 = TypeError;
498
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
499
+ var $defineProperty = Object.defineProperty;
500
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
501
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
502
+ var ENUMERABLE = 'enumerable';
503
+ var CONFIGURABLE$1 = 'configurable';
504
+ var WRITABLE = 'writable';
505
+
506
+ // `Object.defineProperty` method
507
+ // https://tc39.es/ecma262/#sec-object.defineproperty
508
+ objectDefineProperty.f = DESCRIPTORS$9 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
509
+ anObject$b(O);
510
+ P = toPropertyKey(P);
511
+ anObject$b(Attributes);
512
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
513
+ var current = $getOwnPropertyDescriptor(O, P);
514
+ if (current && current[WRITABLE]) {
515
+ O[P] = Attributes.value;
516
+ Attributes = {
517
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
518
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
519
+ writable: false
520
+ };
521
+ }
522
+ } return $defineProperty(O, P, Attributes);
523
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
524
+ anObject$b(O);
525
+ P = toPropertyKey(P);
526
+ anObject$b(Attributes);
527
+ if (IE8_DOM_DEFINE) try {
528
+ return $defineProperty(O, P, Attributes);
529
+ } catch (error) { /* empty */ }
530
+ if ('get' in Attributes || 'set' in Attributes) throw new $TypeError$8('Accessors not supported');
531
+ if ('value' in Attributes) O[P] = Attributes.value;
532
+ return O;
533
+ };
534
+
535
+ var DESCRIPTORS$8 = descriptors;
536
+ var definePropertyModule$3 = objectDefineProperty;
537
+ var createPropertyDescriptor$2 = createPropertyDescriptor$4;
538
+
539
+ var createNonEnumerableProperty$7 = DESCRIPTORS$8 ? function (object, key, value) {
540
+ return definePropertyModule$3.f(object, key, createPropertyDescriptor$2(1, value));
541
+ } : function (object, key, value) {
542
+ object[key] = value;
543
+ return object;
544
+ };
545
+
546
+ var makeBuiltIn$3 = {exports: {}};
547
+
548
+ var DESCRIPTORS$7 = descriptors;
549
+ var hasOwn$9 = hasOwnProperty_1;
550
+
551
+ var FunctionPrototype$1 = Function.prototype;
552
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
553
+ var getDescriptor = DESCRIPTORS$7 && Object.getOwnPropertyDescriptor;
554
+
555
+ var EXISTS = hasOwn$9(FunctionPrototype$1, 'name');
556
+ // additional protection from minified / mangled / dropped function names
557
+ var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
558
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$7 || (DESCRIPTORS$7 && getDescriptor(FunctionPrototype$1, 'name').configurable));
559
+
560
+ var functionName = {
561
+ EXISTS: EXISTS,
562
+ PROPER: PROPER,
563
+ CONFIGURABLE: CONFIGURABLE
564
+ };
565
+
566
+ var uncurryThis$e = functionUncurryThis;
567
+ var isCallable$g = isCallable$m;
568
+ var store$1 = sharedStoreExports;
569
+
570
+ var functionToString = uncurryThis$e(Function.toString);
571
+
572
+ // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
573
+ if (!isCallable$g(store$1.inspectSource)) {
574
+ store$1.inspectSource = function (it) {
575
+ return functionToString(it);
576
+ };
577
+ }
578
+
579
+ var inspectSource$3 = store$1.inspectSource;
580
+
581
+ var global$c = global$j;
582
+ var isCallable$f = isCallable$m;
583
+
584
+ var WeakMap$1 = global$c.WeakMap;
585
+
586
+ var weakMapBasicDetection = isCallable$f(WeakMap$1) && /native code/.test(String(WeakMap$1));
587
+
588
+ var shared$1 = shared$3;
589
+ var uid = uid$2;
590
+
591
+ var keys$1 = shared$1('keys');
592
+
593
+ var sharedKey$3 = function (key) {
594
+ return keys$1[key] || (keys$1[key] = uid(key));
595
+ };
596
+
597
+ var hiddenKeys$4 = {};
598
+
599
+ var NATIVE_WEAK_MAP = weakMapBasicDetection;
600
+ var global$b = global$j;
601
+ var isObject$7 = isObject$c;
602
+ var createNonEnumerableProperty$6 = createNonEnumerableProperty$7;
603
+ var hasOwn$8 = hasOwnProperty_1;
604
+ var shared = sharedStoreExports;
605
+ var sharedKey$2 = sharedKey$3;
606
+ var hiddenKeys$3 = hiddenKeys$4;
607
+
608
+ var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
609
+ var TypeError$2 = global$b.TypeError;
610
+ var WeakMap = global$b.WeakMap;
611
+ var set$1, get, has$6;
612
+
613
+ var enforce = function (it) {
614
+ return has$6(it) ? get(it) : set$1(it, {});
615
+ };
616
+
617
+ var getterFor = function (TYPE) {
618
+ return function (it) {
619
+ var state;
620
+ if (!isObject$7(it) || (state = get(it)).type !== TYPE) {
621
+ throw new TypeError$2('Incompatible receiver, ' + TYPE + ' required');
622
+ } return state;
623
+ };
624
+ };
625
+
626
+ if (NATIVE_WEAK_MAP || shared.state) {
627
+ var store = shared.state || (shared.state = new WeakMap());
628
+ /* eslint-disable no-self-assign -- prototype methods protection */
629
+ store.get = store.get;
630
+ store.has = store.has;
631
+ store.set = store.set;
632
+ /* eslint-enable no-self-assign -- prototype methods protection */
633
+ set$1 = function (it, metadata) {
634
+ if (store.has(it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
635
+ metadata.facade = it;
636
+ store.set(it, metadata);
637
+ return metadata;
638
+ };
639
+ get = function (it) {
640
+ return store.get(it) || {};
641
+ };
642
+ has$6 = function (it) {
643
+ return store.has(it);
644
+ };
645
+ } else {
646
+ var STATE = sharedKey$2('state');
647
+ hiddenKeys$3[STATE] = true;
648
+ set$1 = function (it, metadata) {
649
+ if (hasOwn$8(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
650
+ metadata.facade = it;
651
+ createNonEnumerableProperty$6(it, STATE, metadata);
652
+ return metadata;
653
+ };
654
+ get = function (it) {
655
+ return hasOwn$8(it, STATE) ? it[STATE] : {};
656
+ };
657
+ has$6 = function (it) {
658
+ return hasOwn$8(it, STATE);
659
+ };
660
+ }
661
+
662
+ var internalState = {
663
+ set: set$1,
664
+ get: get,
665
+ has: has$6,
666
+ enforce: enforce,
667
+ getterFor: getterFor
668
+ };
669
+
670
+ var uncurryThis$d = functionUncurryThis;
671
+ var fails$a = fails$h;
672
+ var isCallable$e = isCallable$m;
673
+ var hasOwn$7 = hasOwnProperty_1;
674
+ var DESCRIPTORS$6 = descriptors;
675
+ var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
676
+ var inspectSource$2 = inspectSource$3;
677
+ var InternalStateModule$2 = internalState;
678
+
679
+ var enforceInternalState = InternalStateModule$2.enforce;
680
+ var getInternalState$1 = InternalStateModule$2.get;
681
+ var $String$3 = String;
682
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
683
+ var defineProperty$6 = Object.defineProperty;
684
+ var stringSlice = uncurryThis$d(''.slice);
685
+ var replace$2 = uncurryThis$d(''.replace);
686
+ var join = uncurryThis$d([].join);
687
+
688
+ var CONFIGURABLE_LENGTH = DESCRIPTORS$6 && !fails$a(function () {
689
+ return defineProperty$6(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
690
+ });
691
+
692
+ var TEMPLATE = String(String).split('String');
693
+
694
+ var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
695
+ if (stringSlice($String$3(name), 0, 7) === 'Symbol(') {
696
+ name = '[' + replace$2($String$3(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
697
+ }
698
+ if (options && options.getter) name = 'get ' + name;
699
+ if (options && options.setter) name = 'set ' + name;
700
+ if (!hasOwn$7(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
701
+ if (DESCRIPTORS$6) defineProperty$6(value, 'name', { value: name, configurable: true });
702
+ else value.name = name;
703
+ }
704
+ if (CONFIGURABLE_LENGTH && options && hasOwn$7(options, 'arity') && value.length !== options.arity) {
705
+ defineProperty$6(value, 'length', { value: options.arity });
706
+ }
707
+ try {
708
+ if (options && hasOwn$7(options, 'constructor') && options.constructor) {
709
+ if (DESCRIPTORS$6) defineProperty$6(value, 'prototype', { writable: false });
710
+ // in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
711
+ } else if (value.prototype) value.prototype = undefined;
712
+ } catch (error) { /* empty */ }
713
+ var state = enforceInternalState(value);
714
+ if (!hasOwn$7(state, 'source')) {
715
+ state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
716
+ } return value;
717
+ };
718
+
719
+ // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
720
+ // eslint-disable-next-line no-extend-native -- required
721
+ Function.prototype.toString = makeBuiltIn$2(function toString() {
722
+ return isCallable$e(this) && getInternalState$1(this).source || inspectSource$2(this);
723
+ }, 'toString');
724
+
725
+ var makeBuiltInExports = makeBuiltIn$3.exports;
726
+
727
+ var isCallable$d = isCallable$m;
728
+ var definePropertyModule$2 = objectDefineProperty;
729
+ var makeBuiltIn$1 = makeBuiltInExports;
730
+ var defineGlobalProperty$1 = defineGlobalProperty$3;
731
+
732
+ var defineBuiltIn$6 = function (O, key, value, options) {
733
+ if (!options) options = {};
734
+ var simple = options.enumerable;
735
+ var name = options.name !== undefined ? options.name : key;
736
+ if (isCallable$d(value)) makeBuiltIn$1(value, name, options);
737
+ if (options.global) {
738
+ if (simple) O[key] = value;
739
+ else defineGlobalProperty$1(key, value);
740
+ } else {
741
+ try {
742
+ if (!options.unsafe) delete O[key];
743
+ else if (O[key]) simple = true;
744
+ } catch (error) { /* empty */ }
745
+ if (simple) O[key] = value;
746
+ else definePropertyModule$2.f(O, key, {
747
+ value: value,
748
+ enumerable: false,
749
+ configurable: !options.nonConfigurable,
750
+ writable: !options.nonWritable
751
+ });
752
+ } return O;
753
+ };
754
+
755
+ var objectGetOwnPropertyNames = {};
756
+
757
+ var ceil = Math.ceil;
758
+ var floor = Math.floor;
759
+
760
+ // `Math.trunc` method
761
+ // https://tc39.es/ecma262/#sec-math.trunc
762
+ // eslint-disable-next-line es/no-math-trunc -- safe
763
+ var mathTrunc = Math.trunc || function trunc(x) {
764
+ var n = +x;
765
+ return (n > 0 ? floor : ceil)(n);
766
+ };
767
+
768
+ var trunc = mathTrunc;
769
+
770
+ // `ToIntegerOrInfinity` abstract operation
771
+ // https://tc39.es/ecma262/#sec-tointegerorinfinity
772
+ var toIntegerOrInfinity$3 = function (argument) {
773
+ var number = +argument;
774
+ // eslint-disable-next-line no-self-compare -- NaN check
775
+ return number !== number || number === 0 ? 0 : trunc(number);
776
+ };
777
+
778
+ var toIntegerOrInfinity$2 = toIntegerOrInfinity$3;
779
+
780
+ var max$1 = Math.max;
781
+ var min$1 = Math.min;
782
+
783
+ // Helper for a popular repeating case of the spec:
784
+ // Let integer be ? ToInteger(index).
785
+ // If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
786
+ var toAbsoluteIndex$1 = function (index, length) {
787
+ var integer = toIntegerOrInfinity$2(index);
788
+ return integer < 0 ? max$1(integer + length, 0) : min$1(integer, length);
789
+ };
790
+
791
+ var toIntegerOrInfinity$1 = toIntegerOrInfinity$3;
792
+
793
+ var min = Math.min;
794
+
795
+ // `ToLength` abstract operation
796
+ // https://tc39.es/ecma262/#sec-tolength
797
+ var toLength$1 = function (argument) {
798
+ var len = toIntegerOrInfinity$1(argument);
799
+ return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
800
+ };
801
+
802
+ var toLength = toLength$1;
803
+
804
+ // `LengthOfArrayLike` abstract operation
805
+ // https://tc39.es/ecma262/#sec-lengthofarraylike
806
+ var lengthOfArrayLike$2 = function (obj) {
807
+ return toLength(obj.length);
808
+ };
809
+
810
+ var toIndexedObject$3 = toIndexedObject$5;
811
+ var toAbsoluteIndex = toAbsoluteIndex$1;
812
+ var lengthOfArrayLike$1 = lengthOfArrayLike$2;
813
+
814
+ // `Array.prototype.{ indexOf, includes }` methods implementation
815
+ var createMethod = function (IS_INCLUDES) {
816
+ return function ($this, el, fromIndex) {
817
+ var O = toIndexedObject$3($this);
818
+ var length = lengthOfArrayLike$1(O);
819
+ if (length === 0) return !IS_INCLUDES && -1;
820
+ var index = toAbsoluteIndex(fromIndex, length);
821
+ var value;
822
+ // Array#includes uses SameValueZero equality algorithm
823
+ // eslint-disable-next-line no-self-compare -- NaN check
824
+ if (IS_INCLUDES && el !== el) while (length > index) {
825
+ value = O[index++];
826
+ // eslint-disable-next-line no-self-compare -- NaN check
827
+ if (value !== value) return true;
828
+ // Array#indexOf ignores holes, Array#includes - not
829
+ } else for (;length > index; index++) {
830
+ if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
831
+ } return !IS_INCLUDES && -1;
832
+ };
833
+ };
834
+
835
+ var arrayIncludes = {
836
+ // `Array.prototype.includes` method
837
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
838
+ includes: createMethod(true),
839
+ // `Array.prototype.indexOf` method
840
+ // https://tc39.es/ecma262/#sec-array.prototype.indexof
841
+ indexOf: createMethod(false)
842
+ };
843
+
844
+ var uncurryThis$c = functionUncurryThis;
845
+ var hasOwn$6 = hasOwnProperty_1;
846
+ var toIndexedObject$2 = toIndexedObject$5;
847
+ var indexOf = arrayIncludes.indexOf;
848
+ var hiddenKeys$2 = hiddenKeys$4;
849
+
850
+ var push$1 = uncurryThis$c([].push);
851
+
852
+ var objectKeysInternal = function (object, names) {
853
+ var O = toIndexedObject$2(object);
854
+ var i = 0;
855
+ var result = [];
856
+ var key;
857
+ for (key in O) !hasOwn$6(hiddenKeys$2, key) && hasOwn$6(O, key) && push$1(result, key);
858
+ // Don't enum bug & hidden keys
859
+ while (names.length > i) if (hasOwn$6(O, key = names[i++])) {
860
+ ~indexOf(result, key) || push$1(result, key);
861
+ }
862
+ return result;
863
+ };
864
+
865
+ // IE8- don't enum bug keys
866
+ var enumBugKeys$3 = [
867
+ 'constructor',
868
+ 'hasOwnProperty',
869
+ 'isPrototypeOf',
870
+ 'propertyIsEnumerable',
871
+ 'toLocaleString',
872
+ 'toString',
873
+ 'valueOf'
874
+ ];
875
+
876
+ var internalObjectKeys$1 = objectKeysInternal;
877
+ var enumBugKeys$2 = enumBugKeys$3;
878
+
879
+ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
880
+
881
+ // `Object.getOwnPropertyNames` method
882
+ // https://tc39.es/ecma262/#sec-object.getownpropertynames
883
+ // eslint-disable-next-line es/no-object-getownpropertynames -- safe
884
+ objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
885
+ return internalObjectKeys$1(O, hiddenKeys$1);
886
+ };
887
+
888
+ var objectGetOwnPropertySymbols = {};
889
+
890
+ // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
891
+ objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
892
+
893
+ var getBuiltIn$8 = getBuiltIn$a;
894
+ var uncurryThis$b = functionUncurryThis;
895
+ var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
896
+ var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
897
+ var anObject$a = anObject$c;
898
+
899
+ var concat$1 = uncurryThis$b([].concat);
900
+
901
+ // all object keys, includes non-enumerable and symbols
902
+ var ownKeys$1 = getBuiltIn$8('Reflect', 'ownKeys') || function ownKeys(it) {
903
+ var keys = getOwnPropertyNamesModule.f(anObject$a(it));
904
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
905
+ return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
906
+ };
907
+
908
+ var hasOwn$5 = hasOwnProperty_1;
909
+ var ownKeys = ownKeys$1;
910
+ var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
911
+ var definePropertyModule$1 = objectDefineProperty;
912
+
913
+ var copyConstructorProperties$2 = function (target, source, exceptions) {
914
+ var keys = ownKeys(source);
915
+ var defineProperty = definePropertyModule$1.f;
916
+ var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
917
+ for (var i = 0; i < keys.length; i++) {
918
+ var key = keys[i];
919
+ if (!hasOwn$5(target, key) && !(exceptions && hasOwn$5(exceptions, key))) {
920
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
921
+ }
922
+ }
923
+ };
924
+
925
+ var fails$9 = fails$h;
926
+ var isCallable$c = isCallable$m;
927
+
928
+ var replacement = /#|\.prototype\./;
929
+
930
+ var isForced$2 = function (feature, detection) {
931
+ var value = data[normalize(feature)];
932
+ return value === POLYFILL ? true
933
+ : value === NATIVE ? false
934
+ : isCallable$c(detection) ? fails$9(detection)
935
+ : !!detection;
936
+ };
937
+
938
+ var normalize = isForced$2.normalize = function (string) {
939
+ return String(string).replace(replacement, '.').toLowerCase();
940
+ };
941
+
942
+ var data = isForced$2.data = {};
943
+ var NATIVE = isForced$2.NATIVE = 'N';
944
+ var POLYFILL = isForced$2.POLYFILL = 'P';
945
+
946
+ var isForced_1 = isForced$2;
947
+
948
+ var global$a = global$j;
949
+ var getOwnPropertyDescriptor$1 = objectGetOwnPropertyDescriptor.f;
950
+ var createNonEnumerableProperty$5 = createNonEnumerableProperty$7;
951
+ var defineBuiltIn$5 = defineBuiltIn$6;
952
+ var defineGlobalProperty = defineGlobalProperty$3;
953
+ var copyConstructorProperties$1 = copyConstructorProperties$2;
954
+ var isForced$1 = isForced_1;
955
+
956
+ /*
957
+ options.target - name of the target object
958
+ options.global - target is the global object
959
+ options.stat - export as static methods of target
960
+ options.proto - export as prototype methods of target
961
+ options.real - real prototype method for the `pure` version
962
+ options.forced - export even if the native feature is available
963
+ options.bind - bind methods to the target, required for the `pure` version
964
+ options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
965
+ options.unsafe - use the simple assignment of property instead of delete + defineProperty
966
+ options.sham - add a flag to not completely full polyfills
967
+ options.enumerable - export as enumerable property
968
+ options.dontCallGetSet - prevent calling a getter on target
969
+ options.name - the .name of the function if it does not match the key
970
+ */
971
+ var _export = function (options, source) {
972
+ var TARGET = options.target;
973
+ var GLOBAL = options.global;
974
+ var STATIC = options.stat;
975
+ var FORCED, target, key, targetProperty, sourceProperty, descriptor;
976
+ if (GLOBAL) {
977
+ target = global$a;
978
+ } else if (STATIC) {
979
+ target = global$a[TARGET] || defineGlobalProperty(TARGET, {});
980
+ } else {
981
+ target = global$a[TARGET] && global$a[TARGET].prototype;
982
+ }
983
+ if (target) for (key in source) {
984
+ sourceProperty = source[key];
985
+ if (options.dontCallGetSet) {
986
+ descriptor = getOwnPropertyDescriptor$1(target, key);
987
+ targetProperty = descriptor && descriptor.value;
988
+ } else targetProperty = target[key];
989
+ FORCED = isForced$1(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
990
+ // contained in target
991
+ if (!FORCED && targetProperty !== undefined) {
992
+ if (typeof sourceProperty == typeof targetProperty) continue;
993
+ copyConstructorProperties$1(sourceProperty, targetProperty);
994
+ }
995
+ // add a flag to not completely full polyfills
996
+ if (options.sham || (targetProperty && targetProperty.sham)) {
997
+ createNonEnumerableProperty$5(sourceProperty, 'sham', true);
998
+ }
999
+ defineBuiltIn$5(target, key, sourceProperty, options);
1000
+ }
1001
+ };
1002
+
1003
+ var NATIVE_BIND$1 = functionBindNative;
1004
+
1005
+ var FunctionPrototype = Function.prototype;
1006
+ var apply$3 = FunctionPrototype.apply;
1007
+ var call$c = FunctionPrototype.call;
1008
+
1009
+ // eslint-disable-next-line es/no-reflect -- safe
1010
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$c.bind(apply$3) : function () {
1011
+ return call$c.apply(apply$3, arguments);
1012
+ });
1013
+
1014
+ var uncurryThis$a = functionUncurryThis;
1015
+
1016
+ var arraySlice$2 = uncurryThis$a([].slice);
1017
+
1018
+ var classof$6 = classofRaw$2;
1019
+
1020
+ // `IsArray` abstract operation
1021
+ // https://tc39.es/ecma262/#sec-isarray
1022
+ // eslint-disable-next-line es/no-array-isarray -- safe
1023
+ var isArray$1 = Array.isArray || function isArray(argument) {
1024
+ return classof$6(argument) === 'Array';
1025
+ };
1026
+
1027
+ var wellKnownSymbol$c = wellKnownSymbol$e;
1028
+
1029
+ var TO_STRING_TAG$2 = wellKnownSymbol$c('toStringTag');
1030
+ var test = {};
1031
+
1032
+ test[TO_STRING_TAG$2] = 'z';
1033
+
1034
+ var toStringTagSupport = String(test) === '[object z]';
1035
+
1036
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1037
+ var isCallable$b = isCallable$m;
1038
+ var classofRaw$1 = classofRaw$2;
1039
+ var wellKnownSymbol$b = wellKnownSymbol$e;
1040
+
1041
+ var TO_STRING_TAG$1 = wellKnownSymbol$b('toStringTag');
1042
+ var $Object$1 = Object;
1043
+
1044
+ // ES3 wrong here
1045
+ var CORRECT_ARGUMENTS = classofRaw$1(function () { return arguments; }()) === 'Arguments';
1046
+
1047
+ // fallback for IE11 Script Access Denied error
1048
+ var tryGet = function (it, key) {
1049
+ try {
1050
+ return it[key];
1051
+ } catch (error) { /* empty */ }
1052
+ };
1053
+
1054
+ // getting tag from ES6+ `Object.prototype.toString`
1055
+ var classof$5 = TO_STRING_TAG_SUPPORT ? classofRaw$1 : function (it) {
1056
+ var O, tag, result;
1057
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
1058
+ // @@toStringTag case
1059
+ : typeof (tag = tryGet(O = $Object$1(it), TO_STRING_TAG$1)) == 'string' ? tag
1060
+ // builtinTag case
1061
+ : CORRECT_ARGUMENTS ? classofRaw$1(O)
1062
+ // ES3 arguments fallback
1063
+ : (result = classofRaw$1(O)) === 'Object' && isCallable$b(O.callee) ? 'Arguments' : result;
1064
+ };
1065
+
1066
+ var classof$4 = classof$5;
1067
+
1068
+ var $String$2 = String;
1069
+
1070
+ var toString$2 = function (argument) {
1071
+ if (classof$4(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
1072
+ return $String$2(argument);
1073
+ };
1074
+
1075
+ var uncurryThis$9 = functionUncurryThis;
1076
+ var isArray = isArray$1;
1077
+ var isCallable$a = isCallable$m;
1078
+ var classof$3 = classofRaw$2;
1079
+ var toString$1 = toString$2;
1080
+
1081
+ var push = uncurryThis$9([].push);
1082
+
1083
+ var getJsonReplacerFunction = function (replacer) {
1084
+ if (isCallable$a(replacer)) return replacer;
1085
+ if (!isArray(replacer)) return;
1086
+ var rawLength = replacer.length;
1087
+ var keys = [];
1088
+ for (var i = 0; i < rawLength; i++) {
1089
+ var element = replacer[i];
1090
+ if (typeof element == 'string') push(keys, element);
1091
+ else if (typeof element == 'number' || classof$3(element) === 'Number' || classof$3(element) === 'String') push(keys, toString$1(element));
1092
+ }
1093
+ var keysLength = keys.length;
1094
+ var root = true;
1095
+ return function (key, value) {
1096
+ if (root) {
1097
+ root = false;
1098
+ return value;
1099
+ }
1100
+ if (isArray(this)) return value;
1101
+ for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
1102
+ };
1103
+ };
1104
+
1105
+ var $$g = _export;
1106
+ var getBuiltIn$7 = getBuiltIn$a;
1107
+ var apply$2 = functionApply;
1108
+ var call$b = functionCall;
1109
+ var uncurryThis$8 = functionUncurryThis;
1110
+ var fails$8 = fails$h;
1111
+ var isCallable$9 = isCallable$m;
1112
+ var isSymbol = isSymbol$3;
1113
+ var arraySlice$1 = arraySlice$2;
1114
+ var getReplacerFunction = getJsonReplacerFunction;
1115
+ var NATIVE_SYMBOL = symbolConstructorDetection;
1116
+
1117
+ var $String$1 = String;
1118
+ var $stringify = getBuiltIn$7('JSON', 'stringify');
1119
+ var exec$1 = uncurryThis$8(/./.exec);
1120
+ var charAt = uncurryThis$8(''.charAt);
1121
+ var charCodeAt = uncurryThis$8(''.charCodeAt);
1122
+ var replace$1 = uncurryThis$8(''.replace);
1123
+ var numberToString = uncurryThis$8(1.0.toString);
1124
+
1125
+ var tester = /[\uD800-\uDFFF]/g;
1126
+ var low = /^[\uD800-\uDBFF]$/;
1127
+ var hi = /^[\uDC00-\uDFFF]$/;
1128
+
1129
+ var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$8(function () {
1130
+ var symbol = getBuiltIn$7('Symbol')('stringify detection');
1131
+ // MS Edge converts symbol values to JSON as {}
1132
+ return $stringify([symbol]) !== '[null]'
1133
+ // WebKit converts symbol values to JSON as null
1134
+ || $stringify({ a: symbol }) !== '{}'
1135
+ // V8 throws on boxed symbols
1136
+ || $stringify(Object(symbol)) !== '{}';
1137
+ });
1138
+
1139
+ // https://github.com/tc39/proposal-well-formed-stringify
1140
+ var ILL_FORMED_UNICODE = fails$8(function () {
1141
+ return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
1142
+ || $stringify('\uDEAD') !== '"\\udead"';
1143
+ });
1144
+
1145
+ var stringifyWithSymbolsFix = function (it, replacer) {
1146
+ var args = arraySlice$1(arguments);
1147
+ var $replacer = getReplacerFunction(replacer);
1148
+ if (!isCallable$9($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined
1149
+ args[1] = function (key, value) {
1150
+ // some old implementations (like WebKit) could pass numbers as keys
1151
+ if (isCallable$9($replacer)) value = call$b($replacer, this, $String$1(key), value);
1152
+ if (!isSymbol(value)) return value;
1153
+ };
1154
+ return apply$2($stringify, null, args);
1155
+ };
1156
+
1157
+ var fixIllFormed = function (match, offset, string) {
1158
+ var prev = charAt(string, offset - 1);
1159
+ var next = charAt(string, offset + 1);
1160
+ if ((exec$1(low, match) && !exec$1(hi, next)) || (exec$1(hi, match) && !exec$1(low, prev))) {
1161
+ return '\\u' + numberToString(charCodeAt(match, 0), 16);
1162
+ } return match;
1163
+ };
1164
+
1165
+ if ($stringify) {
1166
+ // `JSON.stringify` method
1167
+ // https://tc39.es/ecma262/#sec-json.stringify
1168
+ $$g({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
1169
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
1170
+ stringify: function stringify(it, replacer, space) {
1171
+ var args = arraySlice$1(arguments);
1172
+ var result = apply$2(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
1173
+ return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$1(result, tester, fixIllFormed) : result;
1174
+ }
1175
+ });
1176
+ }
1177
+
1178
+ var internalObjectKeys = objectKeysInternal;
1179
+ var enumBugKeys$1 = enumBugKeys$3;
1180
+
1181
+ // `Object.keys` method
1182
+ // https://tc39.es/ecma262/#sec-object.keys
1183
+ // eslint-disable-next-line es/no-object-keys -- safe
1184
+ var objectKeys$2 = Object.keys || function keys(O) {
1185
+ return internalObjectKeys(O, enumBugKeys$1);
1186
+ };
1187
+
1188
+ var DESCRIPTORS$5 = descriptors;
1189
+ var uncurryThis$7 = functionUncurryThis;
1190
+ var call$a = functionCall;
1191
+ var fails$7 = fails$h;
1192
+ var objectKeys$1 = objectKeys$2;
1193
+ var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
1194
+ var propertyIsEnumerableModule = objectPropertyIsEnumerable;
1195
+ var toObject$1 = toObject$3;
1196
+ var IndexedObject = indexedObject;
1197
+
1198
+ // eslint-disable-next-line es/no-object-assign -- safe
1199
+ var $assign = Object.assign;
1200
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
1201
+ var defineProperty$5 = Object.defineProperty;
1202
+ var concat = uncurryThis$7([].concat);
1203
+
1204
+ // `Object.assign` method
1205
+ // https://tc39.es/ecma262/#sec-object.assign
1206
+ var objectAssign = !$assign || fails$7(function () {
1207
+ // should have correct order of operations (Edge bug)
1208
+ if (DESCRIPTORS$5 && $assign({ b: 1 }, $assign(defineProperty$5({}, 'a', {
1209
+ enumerable: true,
1210
+ get: function () {
1211
+ defineProperty$5(this, 'b', {
1212
+ value: 3,
1213
+ enumerable: false
1214
+ });
1215
+ }
1216
+ }), { b: 2 })).b !== 1) return true;
1217
+ // should work with symbols and should have deterministic property order (V8 bug)
1218
+ var A = {};
1219
+ var B = {};
1220
+ // eslint-disable-next-line es/no-symbol -- safe
1221
+ var symbol = Symbol('assign detection');
1222
+ var alphabet = 'abcdefghijklmnopqrst';
1223
+ A[symbol] = 7;
1224
+ alphabet.split('').forEach(function (chr) { B[chr] = chr; });
1225
+ return $assign({}, A)[symbol] !== 7 || objectKeys$1($assign({}, B)).join('') !== alphabet;
1226
+ }) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
1227
+ var T = toObject$1(target);
1228
+ var argumentsLength = arguments.length;
1229
+ var index = 1;
1230
+ var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
1231
+ var propertyIsEnumerable = propertyIsEnumerableModule.f;
1232
+ while (argumentsLength > index) {
1233
+ var S = IndexedObject(arguments[index++]);
1234
+ var keys = getOwnPropertySymbols ? concat(objectKeys$1(S), getOwnPropertySymbols(S)) : objectKeys$1(S);
1235
+ var length = keys.length;
1236
+ var j = 0;
1237
+ var key;
1238
+ while (length > j) {
1239
+ key = keys[j++];
1240
+ if (!DESCRIPTORS$5 || call$a(propertyIsEnumerable, S, key)) T[key] = S[key];
1241
+ }
1242
+ } return T;
1243
+ } : $assign;
1244
+
1245
+ var $$f = _export;
1246
+ var assign = objectAssign;
1247
+
1248
+ // `Object.assign` method
1249
+ // https://tc39.es/ecma262/#sec-object.assign
1250
+ // eslint-disable-next-line es/no-object-assign -- required for testing
1251
+ $$f({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign }, {
1252
+ assign: assign
1253
+ });
1254
+
1255
+ /**
1256
+ * The Zoom API returns the data for a page for a specific key.
1257
+ *
1258
+ * This function maps the data under that key to a ZoomPageResult with the data on the "data" variable.
1259
+
1260
+ * @param dataTypeKey
1261
+ * @returns
1262
+ */
1263
+ function mapToZoomPageResult(dataTypeKey) {
1264
+ return data => {
1265
+ const {
1266
+ next_page_token,
1267
+ page_count,
1268
+ page_number,
1269
+ page_size,
1270
+ total_records
1271
+ } = data;
1272
+ return {
1273
+ data: data[dataTypeKey],
1274
+ next_page_token,
1275
+ page_count,
1276
+ page_number,
1277
+ page_size,
1278
+ total_records
1279
+ };
1280
+ };
1281
+ }
1282
+ /**
1283
+ * Creates a FetchPageFactory using the input ZoomFetchPageFetchFunction.
1284
+ *
1285
+ * @param fetch
1286
+ * @param defaults
1287
+ * @returns
1288
+ */
1289
+ function zoomFetchPageFactory(fetch, defaults) {
1290
+ return fetchPageFactory(Object.assign({}, defaults, {
1291
+ fetch,
1292
+ readFetchPageResultInfo: function (result) {
1293
+ return {
1294
+ nextPageCursor: result.next_page_token,
1295
+ hasNext: Boolean(result.next_page_token) // has more when a non-empty next_page_token is returned
1296
+ };
1297
+ },
1298
+ buildInputForNextPage: function (pageResult, input, options) {
1299
+ var _options$maxItemsPerP;
1300
+ return Object.assign({}, input, {
1301
+ next_page_token: pageResult.nextPageCursor,
1302
+ page_size: (_options$maxItemsPerP = options.maxItemsPerPage) != null ? _options$maxItemsPerP : input.page_size
1303
+ });
1304
+ }
1305
+ }));
1306
+ }
1307
+
1308
+ var objectDefineProperties = {};
1309
+
1310
+ var DESCRIPTORS$4 = descriptors;
1311
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1312
+ var definePropertyModule = objectDefineProperty;
1313
+ var anObject$9 = anObject$c;
1314
+ var toIndexedObject$1 = toIndexedObject$5;
1315
+ var objectKeys = objectKeys$2;
1316
+
1317
+ // `Object.defineProperties` method
1318
+ // https://tc39.es/ecma262/#sec-object.defineproperties
1319
+ // eslint-disable-next-line es/no-object-defineproperties -- safe
1320
+ objectDefineProperties.f = DESCRIPTORS$4 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1321
+ anObject$9(O);
1322
+ var props = toIndexedObject$1(Properties);
1323
+ var keys = objectKeys(Properties);
1324
+ var length = keys.length;
1325
+ var index = 0;
1326
+ var key;
1327
+ while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
1328
+ return O;
1329
+ };
1330
+
1331
+ var getBuiltIn$6 = getBuiltIn$a;
1332
+
1333
+ var html$2 = getBuiltIn$6('document', 'documentElement');
1334
+
1335
+ /* global ActiveXObject -- old IE, WSH */
1336
+ var anObject$8 = anObject$c;
1337
+ var definePropertiesModule = objectDefineProperties;
1338
+ var enumBugKeys = enumBugKeys$3;
1339
+ var hiddenKeys = hiddenKeys$4;
1340
+ var html$1 = html$2;
1341
+ var documentCreateElement$1 = documentCreateElement$2;
1342
+ var sharedKey$1 = sharedKey$3;
1343
+
1344
+ var GT = '>';
1345
+ var LT = '<';
1346
+ var PROTOTYPE = 'prototype';
1347
+ var SCRIPT = 'script';
1348
+ var IE_PROTO$1 = sharedKey$1('IE_PROTO');
1349
+
1350
+ var EmptyConstructor = function () { /* empty */ };
1351
+
1352
+ var scriptTag = function (content) {
1353
+ return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
1354
+ };
1355
+
1356
+ // Create object with fake `null` prototype: use ActiveX Object with cleared prototype
1357
+ var NullProtoObjectViaActiveX = function (activeXDocument) {
1358
+ activeXDocument.write(scriptTag(''));
1359
+ activeXDocument.close();
1360
+ var temp = activeXDocument.parentWindow.Object;
1361
+ activeXDocument = null; // avoid memory leak
1362
+ return temp;
1363
+ };
1364
+
1365
+ // Create object with fake `null` prototype: use iframe Object with cleared prototype
1366
+ var NullProtoObjectViaIFrame = function () {
1367
+ // Thrash, waste and sodomy: IE GC bug
1368
+ var iframe = documentCreateElement$1('iframe');
1369
+ var JS = 'java' + SCRIPT + ':';
1370
+ var iframeDocument;
1371
+ iframe.style.display = 'none';
1372
+ html$1.appendChild(iframe);
1373
+ // https://github.com/zloirock/core-js/issues/475
1374
+ iframe.src = String(JS);
1375
+ iframeDocument = iframe.contentWindow.document;
1376
+ iframeDocument.open();
1377
+ iframeDocument.write(scriptTag('document.F=Object'));
1378
+ iframeDocument.close();
1379
+ return iframeDocument.F;
1380
+ };
1381
+
1382
+ // Check for document.domain and active x support
1383
+ // No need to use active x approach when document.domain is not set
1384
+ // see https://github.com/es-shims/es5-shim/issues/150
1385
+ // variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
1386
+ // avoid IE GC bug
1387
+ var activeXDocument;
1388
+ var NullProtoObject = function () {
1389
+ try {
1390
+ activeXDocument = new ActiveXObject('htmlfile');
1391
+ } catch (error) { /* ignore */ }
1392
+ NullProtoObject = typeof document != 'undefined'
1393
+ ? document.domain && activeXDocument
1394
+ ? NullProtoObjectViaActiveX(activeXDocument) // old IE
1395
+ : NullProtoObjectViaIFrame()
1396
+ : NullProtoObjectViaActiveX(activeXDocument); // WSH
1397
+ var length = enumBugKeys.length;
1398
+ while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
1399
+ return NullProtoObject();
1400
+ };
1401
+
1402
+ hiddenKeys[IE_PROTO$1] = true;
1403
+
1404
+ // `Object.create` method
1405
+ // https://tc39.es/ecma262/#sec-object.create
1406
+ // eslint-disable-next-line es/no-object-create -- safe
1407
+ var objectCreate = Object.create || function create(O, Properties) {
1408
+ var result;
1409
+ if (O !== null) {
1410
+ EmptyConstructor[PROTOTYPE] = anObject$8(O);
1411
+ result = new EmptyConstructor();
1412
+ EmptyConstructor[PROTOTYPE] = null;
1413
+ // add "__proto__" for Object.getPrototypeOf polyfill
1414
+ result[IE_PROTO$1] = O;
1415
+ } else result = NullProtoObject();
1416
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1417
+ };
1418
+
1419
+ var wellKnownSymbol$a = wellKnownSymbol$e;
1420
+ var create$1 = objectCreate;
1421
+ var defineProperty$4 = objectDefineProperty.f;
1422
+
1423
+ var UNSCOPABLES = wellKnownSymbol$a('unscopables');
1424
+ var ArrayPrototype$1 = Array.prototype;
1425
+
1426
+ // Array.prototype[@@unscopables]
1427
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1428
+ if (ArrayPrototype$1[UNSCOPABLES] === undefined) {
1429
+ defineProperty$4(ArrayPrototype$1, UNSCOPABLES, {
1430
+ configurable: true,
1431
+ value: create$1(null)
1432
+ });
1433
+ }
1434
+
1435
+ // add a key to Array.prototype[@@unscopables]
1436
+ var addToUnscopables$1 = function (key) {
1437
+ ArrayPrototype$1[UNSCOPABLES][key] = true;
1438
+ };
1439
+
1440
+ var iterators = {};
1441
+
1442
+ var fails$6 = fails$h;
1443
+
1444
+ var correctPrototypeGetter = !fails$6(function () {
1445
+ function F() { /* empty */ }
1446
+ F.prototype.constructor = null;
1447
+ // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1448
+ return Object.getPrototypeOf(new F()) !== F.prototype;
1449
+ });
1450
+
1451
+ var hasOwn$4 = hasOwnProperty_1;
1452
+ var isCallable$8 = isCallable$m;
1453
+ var toObject = toObject$3;
1454
+ var sharedKey = sharedKey$3;
1455
+ var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
1456
+
1457
+ var IE_PROTO = sharedKey('IE_PROTO');
1458
+ var $Object = Object;
1459
+ var ObjectPrototype = $Object.prototype;
1460
+
1461
+ // `Object.getPrototypeOf` method
1462
+ // https://tc39.es/ecma262/#sec-object.getprototypeof
1463
+ // eslint-disable-next-line es/no-object-getprototypeof -- safe
1464
+ var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
1465
+ var object = toObject(O);
1466
+ if (hasOwn$4(object, IE_PROTO)) return object[IE_PROTO];
1467
+ var constructor = object.constructor;
1468
+ if (isCallable$8(constructor) && object instanceof constructor) {
1469
+ return constructor.prototype;
1470
+ } return object instanceof $Object ? ObjectPrototype : null;
1471
+ };
1472
+
1473
+ var fails$5 = fails$h;
1474
+ var isCallable$7 = isCallable$m;
1475
+ var isObject$6 = isObject$c;
1476
+ var getPrototypeOf$1 = objectGetPrototypeOf;
1477
+ var defineBuiltIn$4 = defineBuiltIn$6;
1478
+ var wellKnownSymbol$9 = wellKnownSymbol$e;
1479
+
1480
+ var ITERATOR$5 = wellKnownSymbol$9('iterator');
1481
+ var BUGGY_SAFARI_ITERATORS$1 = false;
1482
+
1483
+ // `%IteratorPrototype%` object
1484
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1485
+ var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1486
+
1487
+ /* eslint-disable es/no-array-prototype-keys -- safe */
1488
+ if ([].keys) {
1489
+ arrayIterator = [].keys();
1490
+ // Safari 8 has buggy iterators w/o `next`
1491
+ if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS$1 = true;
1492
+ else {
1493
+ PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
1494
+ if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
1495
+ }
1496
+ }
1497
+
1498
+ var NEW_ITERATOR_PROTOTYPE = !isObject$6(IteratorPrototype$2) || fails$5(function () {
1499
+ var test = {};
1500
+ // FF44- legacy iterators case
1501
+ return IteratorPrototype$2[ITERATOR$5].call(test) !== test;
1502
+ });
1503
+
1504
+ if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1505
+
1506
+ // `%IteratorPrototype%[@@iterator]()` method
1507
+ // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1508
+ if (!isCallable$7(IteratorPrototype$2[ITERATOR$5])) {
1509
+ defineBuiltIn$4(IteratorPrototype$2, ITERATOR$5, function () {
1510
+ return this;
1511
+ });
1512
+ }
1513
+
1514
+ var iteratorsCore = {
1515
+ IteratorPrototype: IteratorPrototype$2,
1516
+ BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1517
+ };
1518
+
1519
+ var defineProperty$3 = objectDefineProperty.f;
1520
+ var hasOwn$3 = hasOwnProperty_1;
1521
+ var wellKnownSymbol$8 = wellKnownSymbol$e;
1522
+
1523
+ var TO_STRING_TAG = wellKnownSymbol$8('toStringTag');
1524
+
1525
+ var setToStringTag$4 = function (target, TAG, STATIC) {
1526
+ if (target && !STATIC) target = target.prototype;
1527
+ if (target && !hasOwn$3(target, TO_STRING_TAG)) {
1528
+ defineProperty$3(target, TO_STRING_TAG, { configurable: true, value: TAG });
1529
+ }
1530
+ };
1531
+
1532
+ var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
1533
+ var create = objectCreate;
1534
+ var createPropertyDescriptor$1 = createPropertyDescriptor$4;
1535
+ var setToStringTag$3 = setToStringTag$4;
1536
+ var Iterators$4 = iterators;
1537
+
1538
+ var returnThis$1 = function () { return this; };
1539
+
1540
+ var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1541
+ var TO_STRING_TAG = NAME + ' Iterator';
1542
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor$1(+!ENUMERABLE_NEXT, next) });
1543
+ setToStringTag$3(IteratorConstructor, TO_STRING_TAG, false);
1544
+ Iterators$4[TO_STRING_TAG] = returnThis$1;
1545
+ return IteratorConstructor;
1546
+ };
1547
+
1548
+ var uncurryThis$6 = functionUncurryThis;
1549
+ var aCallable$7 = aCallable$9;
1550
+
1551
+ var functionUncurryThisAccessor = function (object, key, method) {
1552
+ try {
1553
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1554
+ return uncurryThis$6(aCallable$7(Object.getOwnPropertyDescriptor(object, key)[method]));
1555
+ } catch (error) { /* empty */ }
1556
+ };
1557
+
1558
+ var isObject$5 = isObject$c;
1559
+
1560
+ var isPossiblePrototype$1 = function (argument) {
1561
+ return isObject$5(argument) || argument === null;
1562
+ };
1563
+
1564
+ var isPossiblePrototype = isPossiblePrototype$1;
1565
+
1566
+ var $String = String;
1567
+ var $TypeError$7 = TypeError;
1568
+
1569
+ var aPossiblePrototype$1 = function (argument) {
1570
+ if (isPossiblePrototype(argument)) return argument;
1571
+ throw new $TypeError$7("Can't set " + $String(argument) + ' as a prototype');
1572
+ };
1573
+
1574
+ /* eslint-disable no-proto -- safe */
1575
+ var uncurryThisAccessor$1 = functionUncurryThisAccessor;
1576
+ var isObject$4 = isObject$c;
1577
+ var requireObjectCoercible = requireObjectCoercible$3;
1578
+ var aPossiblePrototype = aPossiblePrototype$1;
1579
+
1580
+ // `Object.setPrototypeOf` method
1581
+ // https://tc39.es/ecma262/#sec-object.setprototypeof
1582
+ // Works with __proto__ only. Old v8 can't work with null proto objects.
1583
+ // eslint-disable-next-line es/no-object-setprototypeof -- safe
1584
+ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1585
+ var CORRECT_SETTER = false;
1586
+ var test = {};
1587
+ var setter;
1588
+ try {
1589
+ setter = uncurryThisAccessor$1(Object.prototype, '__proto__', 'set');
1590
+ setter(test, []);
1591
+ CORRECT_SETTER = test instanceof Array;
1592
+ } catch (error) { /* empty */ }
1593
+ return function setPrototypeOf(O, proto) {
1594
+ requireObjectCoercible(O);
1595
+ aPossiblePrototype(proto);
1596
+ if (!isObject$4(O)) return O;
1597
+ if (CORRECT_SETTER) setter(O, proto);
1598
+ else O.__proto__ = proto;
1599
+ return O;
1600
+ };
1601
+ }() : undefined);
1602
+
1603
+ var $$e = _export;
1604
+ var call$9 = functionCall;
1605
+ var FunctionName = functionName;
1606
+ var isCallable$6 = isCallable$m;
1607
+ var createIteratorConstructor = iteratorCreateConstructor;
1608
+ var getPrototypeOf = objectGetPrototypeOf;
1609
+ var setPrototypeOf$3 = objectSetPrototypeOf;
1610
+ var setToStringTag$2 = setToStringTag$4;
1611
+ var createNonEnumerableProperty$4 = createNonEnumerableProperty$7;
1612
+ var defineBuiltIn$3 = defineBuiltIn$6;
1613
+ var wellKnownSymbol$7 = wellKnownSymbol$e;
1614
+ var Iterators$3 = iterators;
1615
+ var IteratorsCore = iteratorsCore;
1616
+
1617
+ var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
1618
+ var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1619
+ var IteratorPrototype = IteratorsCore.IteratorPrototype;
1620
+ var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1621
+ var ITERATOR$4 = wellKnownSymbol$7('iterator');
1622
+ var KEYS = 'keys';
1623
+ var VALUES = 'values';
1624
+ var ENTRIES = 'entries';
1625
+
1626
+ var returnThis = function () { return this; };
1627
+
1628
+ var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
1629
+ createIteratorConstructor(IteratorConstructor, NAME, next);
1630
+
1631
+ var getIterationMethod = function (KIND) {
1632
+ if (KIND === DEFAULT && defaultIterator) return defaultIterator;
1633
+ if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
1634
+
1635
+ switch (KIND) {
1636
+ case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
1637
+ case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
1638
+ case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
1639
+ }
1640
+
1641
+ return function () { return new IteratorConstructor(this); };
1642
+ };
1643
+
1644
+ var TO_STRING_TAG = NAME + ' Iterator';
1645
+ var INCORRECT_VALUES_NAME = false;
1646
+ var IterablePrototype = Iterable.prototype;
1647
+ var nativeIterator = IterablePrototype[ITERATOR$4]
1648
+ || IterablePrototype['@@iterator']
1649
+ || DEFAULT && IterablePrototype[DEFAULT];
1650
+ var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
1651
+ var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
1652
+ var CurrentIteratorPrototype, methods, KEY;
1653
+
1654
+ // fix native
1655
+ if (anyNativeIterator) {
1656
+ CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
1657
+ if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
1658
+ if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1659
+ if (setPrototypeOf$3) {
1660
+ setPrototypeOf$3(CurrentIteratorPrototype, IteratorPrototype);
1661
+ } else if (!isCallable$6(CurrentIteratorPrototype[ITERATOR$4])) {
1662
+ defineBuiltIn$3(CurrentIteratorPrototype, ITERATOR$4, returnThis);
1663
+ }
1664
+ }
1665
+ // Set @@toStringTag to native iterators
1666
+ setToStringTag$2(CurrentIteratorPrototype, TO_STRING_TAG, true);
1667
+ }
1668
+ }
1669
+
1670
+ // fix Array.prototype.{ values, @@iterator }.name in V8 / FF
1671
+ if (PROPER_FUNCTION_NAME$1 && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
1672
+ if (CONFIGURABLE_FUNCTION_NAME) {
1673
+ createNonEnumerableProperty$4(IterablePrototype, 'name', VALUES);
1674
+ } else {
1675
+ INCORRECT_VALUES_NAME = true;
1676
+ defaultIterator = function values() { return call$9(nativeIterator, this); };
1677
+ }
1678
+ }
1679
+
1680
+ // export additional methods
1681
+ if (DEFAULT) {
1682
+ methods = {
1683
+ values: getIterationMethod(VALUES),
1684
+ keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
1685
+ entries: getIterationMethod(ENTRIES)
1686
+ };
1687
+ if (FORCED) for (KEY in methods) {
1688
+ if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
1689
+ defineBuiltIn$3(IterablePrototype, KEY, methods[KEY]);
1690
+ }
1691
+ } else $$e({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
1692
+ }
1693
+
1694
+ // define iterator
1695
+ if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
1696
+ defineBuiltIn$3(IterablePrototype, ITERATOR$4, defaultIterator, { name: DEFAULT });
1697
+ }
1698
+ Iterators$3[NAME] = defaultIterator;
1699
+
1700
+ return methods;
1701
+ };
1702
+
1703
+ // `CreateIterResultObject` abstract operation
1704
+ // https://tc39.es/ecma262/#sec-createiterresultobject
1705
+ var createIterResultObject$1 = function (value, done) {
1706
+ return { value: value, done: done };
1707
+ };
1708
+
1709
+ var toIndexedObject = toIndexedObject$5;
1710
+ var addToUnscopables = addToUnscopables$1;
1711
+ var Iterators$2 = iterators;
1712
+ var InternalStateModule$1 = internalState;
1713
+ var defineProperty$2 = objectDefineProperty.f;
1714
+ var defineIterator = iteratorDefine;
1715
+ var createIterResultObject = createIterResultObject$1;
1716
+ var DESCRIPTORS$3 = descriptors;
1717
+
1718
+ var ARRAY_ITERATOR = 'Array Iterator';
1719
+ var setInternalState$1 = InternalStateModule$1.set;
1720
+ var getInternalState = InternalStateModule$1.getterFor(ARRAY_ITERATOR);
1721
+
1722
+ // `Array.prototype.entries` method
1723
+ // https://tc39.es/ecma262/#sec-array.prototype.entries
1724
+ // `Array.prototype.keys` method
1725
+ // https://tc39.es/ecma262/#sec-array.prototype.keys
1726
+ // `Array.prototype.values` method
1727
+ // https://tc39.es/ecma262/#sec-array.prototype.values
1728
+ // `Array.prototype[@@iterator]` method
1729
+ // https://tc39.es/ecma262/#sec-array.prototype-@@iterator
1730
+ // `CreateArrayIterator` internal method
1731
+ // https://tc39.es/ecma262/#sec-createarrayiterator
1732
+ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind) {
1733
+ setInternalState$1(this, {
1734
+ type: ARRAY_ITERATOR,
1735
+ target: toIndexedObject(iterated), // target
1736
+ index: 0, // next index
1737
+ kind: kind // kind
1738
+ });
1739
+ // `%ArrayIteratorPrototype%.next` method
1740
+ // https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
1741
+ }, function () {
1742
+ var state = getInternalState(this);
1743
+ var target = state.target;
1744
+ var index = state.index++;
1745
+ if (!target || index >= target.length) {
1746
+ state.target = undefined;
1747
+ return createIterResultObject(undefined, true);
1748
+ }
1749
+ switch (state.kind) {
1750
+ case 'keys': return createIterResultObject(index, false);
1751
+ case 'values': return createIterResultObject(target[index], false);
1752
+ } return createIterResultObject([index, target[index]], false);
1753
+ }, 'values');
1754
+
1755
+ // argumentsList[@@iterator] is %ArrayProto_values%
1756
+ // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1757
+ // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1758
+ var values = Iterators$2.Arguments = Iterators$2.Array;
1759
+
1760
+ // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1761
+ addToUnscopables('keys');
1762
+ addToUnscopables('values');
1763
+ addToUnscopables('entries');
1764
+
1765
+ // V8 ~ Chrome 45- bug
1766
+ if (DESCRIPTORS$3 && values.name !== 'values') try {
1767
+ defineProperty$2(values, 'name', { value: 'values' });
1768
+ } catch (error) { /* empty */ }
1769
+
1770
+ var global$9 = global$j;
1771
+ var classof$2 = classofRaw$2;
1772
+
1773
+ var engineIsNode = classof$2(global$9.process) === 'process';
1774
+
1775
+ var makeBuiltIn = makeBuiltInExports;
1776
+ var defineProperty$1 = objectDefineProperty;
1777
+
1778
+ var defineBuiltInAccessor$1 = function (target, name, descriptor) {
1779
+ if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
1780
+ if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
1781
+ return defineProperty$1.f(target, name, descriptor);
1782
+ };
1783
+
1784
+ var getBuiltIn$5 = getBuiltIn$a;
1785
+ var defineBuiltInAccessor = defineBuiltInAccessor$1;
1786
+ var wellKnownSymbol$6 = wellKnownSymbol$e;
1787
+ var DESCRIPTORS$2 = descriptors;
1788
+
1789
+ var SPECIES$2 = wellKnownSymbol$6('species');
1790
+
1791
+ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
1792
+ var Constructor = getBuiltIn$5(CONSTRUCTOR_NAME);
1793
+
1794
+ if (DESCRIPTORS$2 && Constructor && !Constructor[SPECIES$2]) {
1795
+ defineBuiltInAccessor(Constructor, SPECIES$2, {
1796
+ configurable: true,
1797
+ get: function () { return this; }
1798
+ });
1799
+ }
1800
+ };
1801
+
1802
+ var isPrototypeOf$3 = objectIsPrototypeOf;
1803
+
1804
+ var $TypeError$6 = TypeError;
1805
+
1806
+ var anInstance$1 = function (it, Prototype) {
1807
+ if (isPrototypeOf$3(Prototype, it)) return it;
1808
+ throw new $TypeError$6('Incorrect invocation');
1809
+ };
1810
+
1811
+ var uncurryThis$5 = functionUncurryThis;
1812
+ var fails$4 = fails$h;
1813
+ var isCallable$5 = isCallable$m;
1814
+ var classof$1 = classof$5;
1815
+ var getBuiltIn$4 = getBuiltIn$a;
1816
+ var inspectSource$1 = inspectSource$3;
1817
+
1818
+ var noop = function () { /* empty */ };
1819
+ var construct = getBuiltIn$4('Reflect', 'construct');
1820
+ var constructorRegExp = /^\s*(?:class|function)\b/;
1821
+ var exec = uncurryThis$5(constructorRegExp.exec);
1822
+ var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
1823
+
1824
+ var isConstructorModern = function isConstructor(argument) {
1825
+ if (!isCallable$5(argument)) return false;
1826
+ try {
1827
+ construct(noop, [], argument);
1828
+ return true;
1829
+ } catch (error) {
1830
+ return false;
1831
+ }
1832
+ };
1833
+
1834
+ var isConstructorLegacy = function isConstructor(argument) {
1835
+ if (!isCallable$5(argument)) return false;
1836
+ switch (classof$1(argument)) {
1837
+ case 'AsyncFunction':
1838
+ case 'GeneratorFunction':
1839
+ case 'AsyncGeneratorFunction': return false;
1840
+ }
1841
+ try {
1842
+ // we can't check .prototype since constructors produced by .bind haven't it
1843
+ // `Function#toString` throws on some built-it function in some legacy engines
1844
+ // (for example, `DOMQuad` and similar in FF41-)
1845
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource$1(argument));
1846
+ } catch (error) {
1847
+ return true;
1848
+ }
1849
+ };
1850
+
1851
+ isConstructorLegacy.sham = true;
1852
+
1853
+ // `IsConstructor` abstract operation
1854
+ // https://tc39.es/ecma262/#sec-isconstructor
1855
+ var isConstructor$1 = !construct || fails$4(function () {
1856
+ var called;
1857
+ return isConstructorModern(isConstructorModern.call)
1858
+ || !isConstructorModern(Object)
1859
+ || !isConstructorModern(function () { called = true; })
1860
+ || called;
1861
+ }) ? isConstructorLegacy : isConstructorModern;
1862
+
1863
+ var isConstructor = isConstructor$1;
1864
+ var tryToString$2 = tryToString$4;
1865
+
1866
+ var $TypeError$5 = TypeError;
1867
+
1868
+ // `Assert: IsConstructor(argument) is true`
1869
+ var aConstructor$1 = function (argument) {
1870
+ if (isConstructor(argument)) return argument;
1871
+ throw new $TypeError$5(tryToString$2(argument) + ' is not a constructor');
1872
+ };
1873
+
1874
+ var anObject$7 = anObject$c;
1875
+ var aConstructor = aConstructor$1;
1876
+ var isNullOrUndefined$1 = isNullOrUndefined$4;
1877
+ var wellKnownSymbol$5 = wellKnownSymbol$e;
1878
+
1879
+ var SPECIES$1 = wellKnownSymbol$5('species');
1880
+
1881
+ // `SpeciesConstructor` abstract operation
1882
+ // https://tc39.es/ecma262/#sec-speciesconstructor
1883
+ var speciesConstructor$1 = function (O, defaultConstructor) {
1884
+ var C = anObject$7(O).constructor;
1885
+ var S;
1886
+ return C === undefined || isNullOrUndefined$1(S = anObject$7(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
1887
+ };
1888
+
1889
+ var classofRaw = classofRaw$2;
1890
+ var uncurryThis$4 = functionUncurryThis;
1891
+
1892
+ var functionUncurryThisClause = function (fn) {
1893
+ // Nashorn bug:
1894
+ // https://github.com/zloirock/core-js/issues/1128
1895
+ // https://github.com/zloirock/core-js/issues/1130
1896
+ if (classofRaw(fn) === 'Function') return uncurryThis$4(fn);
1897
+ };
1898
+
1899
+ var uncurryThis$3 = functionUncurryThisClause;
1900
+ var aCallable$6 = aCallable$9;
1901
+ var NATIVE_BIND = functionBindNative;
1902
+
1903
+ var bind$4 = uncurryThis$3(uncurryThis$3.bind);
1904
+
1905
+ // optional / simple context binding
1906
+ var functionBindContext = function (fn, that) {
1907
+ aCallable$6(fn);
1908
+ return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
1909
+ return fn.apply(that, arguments);
1910
+ };
1911
+ };
1912
+
1913
+ var $TypeError$4 = TypeError;
1914
+
1915
+ var validateArgumentsLength$1 = function (passed, required) {
1916
+ if (passed < required) throw new $TypeError$4('Not enough arguments');
1917
+ return passed;
1918
+ };
1919
+
1920
+ var userAgent$2 = engineUserAgent;
1921
+
1922
+ // eslint-disable-next-line redos/no-vulnerable -- safe
1923
+ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
1924
+
1925
+ var global$8 = global$j;
1926
+ var apply$1 = functionApply;
1927
+ var bind$3 = functionBindContext;
1928
+ var isCallable$4 = isCallable$m;
1929
+ var hasOwn$2 = hasOwnProperty_1;
1930
+ var fails$3 = fails$h;
1931
+ var html = html$2;
1932
+ var arraySlice = arraySlice$2;
1933
+ var createElement = documentCreateElement$2;
1934
+ var validateArgumentsLength = validateArgumentsLength$1;
1935
+ var IS_IOS$1 = engineIsIos;
1936
+ var IS_NODE$3 = engineIsNode;
1937
+
1938
+ var set = global$8.setImmediate;
1939
+ var clear = global$8.clearImmediate;
1940
+ var process$2 = global$8.process;
1941
+ var Dispatch = global$8.Dispatch;
1942
+ var Function$1 = global$8.Function;
1943
+ var MessageChannel = global$8.MessageChannel;
1944
+ var String$1 = global$8.String;
1945
+ var counter = 0;
1946
+ var queue$2 = {};
1947
+ var ONREADYSTATECHANGE = 'onreadystatechange';
1948
+ var $location, defer, channel, port;
1949
+
1950
+ fails$3(function () {
1951
+ // Deno throws a ReferenceError on `location` access without `--location` flag
1952
+ $location = global$8.location;
1953
+ });
1954
+
1955
+ var run = function (id) {
1956
+ if (hasOwn$2(queue$2, id)) {
1957
+ var fn = queue$2[id];
1958
+ delete queue$2[id];
1959
+ fn();
1960
+ }
1961
+ };
1962
+
1963
+ var runner = function (id) {
1964
+ return function () {
1965
+ run(id);
1966
+ };
1967
+ };
1968
+
1969
+ var eventListener = function (event) {
1970
+ run(event.data);
1971
+ };
1972
+
1973
+ var globalPostMessageDefer = function (id) {
1974
+ // old engines have not location.origin
1975
+ global$8.postMessage(String$1(id), $location.protocol + '//' + $location.host);
1976
+ };
1977
+
1978
+ // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
1979
+ if (!set || !clear) {
1980
+ set = function setImmediate(handler) {
1981
+ validateArgumentsLength(arguments.length, 1);
1982
+ var fn = isCallable$4(handler) ? handler : Function$1(handler);
1983
+ var args = arraySlice(arguments, 1);
1984
+ queue$2[++counter] = function () {
1985
+ apply$1(fn, undefined, args);
1986
+ };
1987
+ defer(counter);
1988
+ return counter;
1989
+ };
1990
+ clear = function clearImmediate(id) {
1991
+ delete queue$2[id];
1992
+ };
1993
+ // Node.js 0.8-
1994
+ if (IS_NODE$3) {
1995
+ defer = function (id) {
1996
+ process$2.nextTick(runner(id));
1997
+ };
1998
+ // Sphere (JS game engine) Dispatch API
1999
+ } else if (Dispatch && Dispatch.now) {
2000
+ defer = function (id) {
2001
+ Dispatch.now(runner(id));
2002
+ };
2003
+ // Browsers with MessageChannel, includes WebWorkers
2004
+ // except iOS - https://github.com/zloirock/core-js/issues/624
2005
+ } else if (MessageChannel && !IS_IOS$1) {
2006
+ channel = new MessageChannel();
2007
+ port = channel.port2;
2008
+ channel.port1.onmessage = eventListener;
2009
+ defer = bind$3(port.postMessage, port);
2010
+ // Browsers with postMessage, skip WebWorkers
2011
+ // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
2012
+ } else if (
2013
+ global$8.addEventListener &&
2014
+ isCallable$4(global$8.postMessage) &&
2015
+ !global$8.importScripts &&
2016
+ $location && $location.protocol !== 'file:' &&
2017
+ !fails$3(globalPostMessageDefer)
2018
+ ) {
2019
+ defer = globalPostMessageDefer;
2020
+ global$8.addEventListener('message', eventListener, false);
2021
+ // IE8-
2022
+ } else if (ONREADYSTATECHANGE in createElement('script')) {
2023
+ defer = function (id) {
2024
+ html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
2025
+ html.removeChild(this);
2026
+ run(id);
2027
+ };
2028
+ };
2029
+ // Rest old browsers
2030
+ } else {
2031
+ defer = function (id) {
2032
+ setTimeout(runner(id), 0);
2033
+ };
2034
+ }
2035
+ }
2036
+
2037
+ var task$1 = {
2038
+ set: set,
2039
+ clear: clear
2040
+ };
2041
+
2042
+ var global$7 = global$j;
2043
+ var DESCRIPTORS$1 = descriptors;
2044
+
2045
+ // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
2046
+ var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
2047
+
2048
+ // Avoid NodeJS experimental warning
2049
+ var safeGetBuiltIn$1 = function (name) {
2050
+ if (!DESCRIPTORS$1) return global$7[name];
2051
+ var descriptor = getOwnPropertyDescriptor(global$7, name);
2052
+ return descriptor && descriptor.value;
2053
+ };
2054
+
2055
+ var Queue$2 = function () {
2056
+ this.head = null;
2057
+ this.tail = null;
2058
+ };
2059
+
2060
+ Queue$2.prototype = {
2061
+ add: function (item) {
2062
+ var entry = { item: item, next: null };
2063
+ var tail = this.tail;
2064
+ if (tail) tail.next = entry;
2065
+ else this.head = entry;
2066
+ this.tail = entry;
2067
+ },
2068
+ get: function () {
2069
+ var entry = this.head;
2070
+ if (entry) {
2071
+ var next = this.head = entry.next;
2072
+ if (next === null) this.tail = null;
2073
+ return entry.item;
2074
+ }
2075
+ }
2076
+ };
2077
+
2078
+ var queue$1 = Queue$2;
2079
+
2080
+ var userAgent$1 = engineUserAgent;
2081
+
2082
+ var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && typeof Pebble != 'undefined';
2083
+
2084
+ var userAgent = engineUserAgent;
2085
+
2086
+ var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
2087
+
2088
+ var global$6 = global$j;
2089
+ var safeGetBuiltIn = safeGetBuiltIn$1;
2090
+ var bind$2 = functionBindContext;
2091
+ var macrotask = task$1.set;
2092
+ var Queue$1 = queue$1;
2093
+ var IS_IOS = engineIsIos;
2094
+ var IS_IOS_PEBBLE = engineIsIosPebble;
2095
+ var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
2096
+ var IS_NODE$2 = engineIsNode;
2097
+
2098
+ var MutationObserver = global$6.MutationObserver || global$6.WebKitMutationObserver;
2099
+ var document$2 = global$6.document;
2100
+ var process$1 = global$6.process;
2101
+ var Promise$1 = global$6.Promise;
2102
+ var microtask$1 = safeGetBuiltIn('queueMicrotask');
2103
+ var notify$1, toggle, node, promise, then;
2104
+
2105
+ // modern engines have queueMicrotask method
2106
+ if (!microtask$1) {
2107
+ var queue = new Queue$1();
2108
+
2109
+ var flush = function () {
2110
+ var parent, fn;
2111
+ if (IS_NODE$2 && (parent = process$1.domain)) parent.exit();
2112
+ while (fn = queue.get()) try {
2113
+ fn();
2114
+ } catch (error) {
2115
+ if (queue.head) notify$1();
2116
+ throw error;
2117
+ }
2118
+ if (parent) parent.enter();
2119
+ };
2120
+
2121
+ // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
2122
+ // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
2123
+ if (!IS_IOS && !IS_NODE$2 && !IS_WEBOS_WEBKIT && MutationObserver && document$2) {
2124
+ toggle = true;
2125
+ node = document$2.createTextNode('');
2126
+ new MutationObserver(flush).observe(node, { characterData: true });
2127
+ notify$1 = function () {
2128
+ node.data = toggle = !toggle;
2129
+ };
2130
+ // environments with maybe non-completely correct, but existent Promise
2131
+ } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
2132
+ // Promise.resolve without an argument throws an error in LG WebOS 2
2133
+ promise = Promise$1.resolve(undefined);
2134
+ // workaround of WebKit ~ iOS Safari 10.1 bug
2135
+ promise.constructor = Promise$1;
2136
+ then = bind$2(promise.then, promise);
2137
+ notify$1 = function () {
2138
+ then(flush);
2139
+ };
2140
+ // Node.js without promises
2141
+ } else if (IS_NODE$2) {
2142
+ notify$1 = function () {
2143
+ process$1.nextTick(flush);
2144
+ };
2145
+ // for other environments - macrotask based on:
2146
+ // - setImmediate
2147
+ // - MessageChannel
2148
+ // - window.postMessage
2149
+ // - onreadystatechange
2150
+ // - setTimeout
2151
+ } else {
2152
+ // `webpack` dev server bug on IE global methods - use bind(fn, global)
2153
+ macrotask = bind$2(macrotask, global$6);
2154
+ notify$1 = function () {
2155
+ macrotask(flush);
2156
+ };
2157
+ }
2158
+
2159
+ microtask$1 = function (fn) {
2160
+ if (!queue.head) notify$1();
2161
+ queue.add(fn);
2162
+ };
2163
+ }
2164
+
2165
+ var microtask_1 = microtask$1;
2166
+
2167
+ var hostReportErrors$1 = function (a, b) {
2168
+ try {
2169
+ // eslint-disable-next-line no-console -- safe
2170
+ arguments.length === 1 ? console.error(a) : console.error(a, b);
2171
+ } catch (error) { /* empty */ }
2172
+ };
2173
+
2174
+ var perform$3 = function (exec) {
2175
+ try {
2176
+ return { error: false, value: exec() };
2177
+ } catch (error) {
2178
+ return { error: true, value: error };
2179
+ }
2180
+ };
2181
+
2182
+ var global$5 = global$j;
2183
+
2184
+ var promiseNativeConstructor = global$5.Promise;
2185
+
2186
+ /* global Deno -- Deno case */
2187
+ var engineIsDeno = typeof Deno == 'object' && Deno && typeof Deno.version == 'object';
2188
+
2189
+ var IS_DENO$1 = engineIsDeno;
2190
+ var IS_NODE$1 = engineIsNode;
2191
+
2192
+ var engineIsBrowser = !IS_DENO$1 && !IS_NODE$1
2193
+ && typeof window == 'object'
2194
+ && typeof document == 'object';
2195
+
2196
+ var global$4 = global$j;
2197
+ var NativePromiseConstructor$3 = promiseNativeConstructor;
2198
+ var isCallable$3 = isCallable$m;
2199
+ var isForced = isForced_1;
2200
+ var inspectSource = inspectSource$3;
2201
+ var wellKnownSymbol$4 = wellKnownSymbol$e;
2202
+ var IS_BROWSER = engineIsBrowser;
2203
+ var IS_DENO = engineIsDeno;
2204
+ var V8_VERSION = engineV8Version;
2205
+
2206
+ NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
2207
+ var SPECIES = wellKnownSymbol$4('species');
2208
+ var SUBCLASSING = false;
2209
+ var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$3(global$4.PromiseRejectionEvent);
2210
+
2211
+ var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
2212
+ var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$3);
2213
+ var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$3);
2214
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
2215
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
2216
+ // We can't detect it synchronously, so just check versions
2217
+ if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
2218
+ // We can't use @@species feature detection in V8 since it causes
2219
+ // deoptimization and performance degradation
2220
+ // https://github.com/zloirock/core-js/issues/679
2221
+ if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
2222
+ // Detect correctness of subclassing with @@species support
2223
+ var promise = new NativePromiseConstructor$3(function (resolve) { resolve(1); });
2224
+ var FakePromise = function (exec) {
2225
+ exec(function () { /* empty */ }, function () { /* empty */ });
2226
+ };
2227
+ var constructor = promise.constructor = {};
2228
+ constructor[SPECIES] = FakePromise;
2229
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
2230
+ if (!SUBCLASSING) return true;
2231
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
2232
+ } return !GLOBAL_CORE_JS_PROMISE && (IS_BROWSER || IS_DENO) && !NATIVE_PROMISE_REJECTION_EVENT$1;
2233
+ });
2234
+
2235
+ var promiseConstructorDetection = {
2236
+ CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
2237
+ REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
2238
+ SUBCLASSING: SUBCLASSING
2239
+ };
2240
+
2241
+ var newPromiseCapability$2 = {};
2242
+
2243
+ var aCallable$5 = aCallable$9;
2244
+
2245
+ var $TypeError$3 = TypeError;
2246
+
2247
+ var PromiseCapability = function (C) {
2248
+ var resolve, reject;
2249
+ this.promise = new C(function ($$resolve, $$reject) {
2250
+ if (resolve !== undefined || reject !== undefined) throw new $TypeError$3('Bad Promise constructor');
2251
+ resolve = $$resolve;
2252
+ reject = $$reject;
2253
+ });
2254
+ this.resolve = aCallable$5(resolve);
2255
+ this.reject = aCallable$5(reject);
2256
+ };
2257
+
2258
+ // `NewPromiseCapability` abstract operation
2259
+ // https://tc39.es/ecma262/#sec-newpromisecapability
2260
+ newPromiseCapability$2.f = function (C) {
2261
+ return new PromiseCapability(C);
2262
+ };
2263
+
2264
+ var $$d = _export;
2265
+ var IS_NODE = engineIsNode;
2266
+ var global$3 = global$j;
2267
+ var call$8 = functionCall;
2268
+ var defineBuiltIn$2 = defineBuiltIn$6;
2269
+ var setPrototypeOf$2 = objectSetPrototypeOf;
2270
+ var setToStringTag$1 = setToStringTag$4;
2271
+ var setSpecies = setSpecies$1;
2272
+ var aCallable$4 = aCallable$9;
2273
+ var isCallable$2 = isCallable$m;
2274
+ var isObject$3 = isObject$c;
2275
+ var anInstance = anInstance$1;
2276
+ var speciesConstructor = speciesConstructor$1;
2277
+ var task = task$1.set;
2278
+ var microtask = microtask_1;
2279
+ var hostReportErrors = hostReportErrors$1;
2280
+ var perform$2 = perform$3;
2281
+ var Queue = queue$1;
2282
+ var InternalStateModule = internalState;
2283
+ var NativePromiseConstructor$2 = promiseNativeConstructor;
2284
+ var PromiseConstructorDetection = promiseConstructorDetection;
2285
+ var newPromiseCapabilityModule$3 = newPromiseCapability$2;
2286
+
2287
+ var PROMISE = 'Promise';
2288
+ var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
2289
+ var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
2290
+ var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
2291
+ var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
2292
+ var setInternalState = InternalStateModule.set;
2293
+ var NativePromisePrototype$1 = NativePromiseConstructor$2 && NativePromiseConstructor$2.prototype;
2294
+ var PromiseConstructor = NativePromiseConstructor$2;
2295
+ var PromisePrototype = NativePromisePrototype$1;
2296
+ var TypeError$1 = global$3.TypeError;
2297
+ var document$1 = global$3.document;
2298
+ var process = global$3.process;
2299
+ var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
2300
+ var newGenericPromiseCapability = newPromiseCapability$1;
2301
+
2302
+ var DISPATCH_EVENT = !!(document$1 && document$1.createEvent && global$3.dispatchEvent);
2303
+ var UNHANDLED_REJECTION = 'unhandledrejection';
2304
+ var REJECTION_HANDLED = 'rejectionhandled';
2305
+ var PENDING = 0;
2306
+ var FULFILLED = 1;
2307
+ var REJECTED = 2;
2308
+ var HANDLED = 1;
2309
+ var UNHANDLED = 2;
2310
+
2311
+ var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
2312
+
2313
+ // helpers
2314
+ var isThenable = function (it) {
2315
+ var then;
2316
+ return isObject$3(it) && isCallable$2(then = it.then) ? then : false;
2317
+ };
2318
+
2319
+ var callReaction = function (reaction, state) {
2320
+ var value = state.value;
2321
+ var ok = state.state === FULFILLED;
2322
+ var handler = ok ? reaction.ok : reaction.fail;
2323
+ var resolve = reaction.resolve;
2324
+ var reject = reaction.reject;
2325
+ var domain = reaction.domain;
2326
+ var result, then, exited;
2327
+ try {
2328
+ if (handler) {
2329
+ if (!ok) {
2330
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
2331
+ state.rejection = HANDLED;
2332
+ }
2333
+ if (handler === true) result = value;
2334
+ else {
2335
+ if (domain) domain.enter();
2336
+ result = handler(value); // can throw
2337
+ if (domain) {
2338
+ domain.exit();
2339
+ exited = true;
2340
+ }
2341
+ }
2342
+ if (result === reaction.promise) {
2343
+ reject(new TypeError$1('Promise-chain cycle'));
2344
+ } else if (then = isThenable(result)) {
2345
+ call$8(then, result, resolve, reject);
2346
+ } else resolve(result);
2347
+ } else reject(value);
2348
+ } catch (error) {
2349
+ if (domain && !exited) domain.exit();
2350
+ reject(error);
2351
+ }
2352
+ };
2353
+
2354
+ var notify = function (state, isReject) {
2355
+ if (state.notified) return;
2356
+ state.notified = true;
2357
+ microtask(function () {
2358
+ var reactions = state.reactions;
2359
+ var reaction;
2360
+ while (reaction = reactions.get()) {
2361
+ callReaction(reaction, state);
2362
+ }
2363
+ state.notified = false;
2364
+ if (isReject && !state.rejection) onUnhandled(state);
2365
+ });
2366
+ };
2367
+
2368
+ var dispatchEvent = function (name, promise, reason) {
2369
+ var event, handler;
2370
+ if (DISPATCH_EVENT) {
2371
+ event = document$1.createEvent('Event');
2372
+ event.promise = promise;
2373
+ event.reason = reason;
2374
+ event.initEvent(name, false, true);
2375
+ global$3.dispatchEvent(event);
2376
+ } else event = { promise: promise, reason: reason };
2377
+ if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global$3['on' + name])) handler(event);
2378
+ else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
2379
+ };
2380
+
2381
+ var onUnhandled = function (state) {
2382
+ call$8(task, global$3, function () {
2383
+ var promise = state.facade;
2384
+ var value = state.value;
2385
+ var IS_UNHANDLED = isUnhandled(state);
2386
+ var result;
2387
+ if (IS_UNHANDLED) {
2388
+ result = perform$2(function () {
2389
+ if (IS_NODE) {
2390
+ process.emit('unhandledRejection', value, promise);
2391
+ } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
2392
+ });
2393
+ // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
2394
+ state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
2395
+ if (result.error) throw result.value;
2396
+ }
2397
+ });
2398
+ };
2399
+
2400
+ var isUnhandled = function (state) {
2401
+ return state.rejection !== HANDLED && !state.parent;
2402
+ };
2403
+
2404
+ var onHandleUnhandled = function (state) {
2405
+ call$8(task, global$3, function () {
2406
+ var promise = state.facade;
2407
+ if (IS_NODE) {
2408
+ process.emit('rejectionHandled', promise);
2409
+ } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
2410
+ });
2411
+ };
2412
+
2413
+ var bind$1 = function (fn, state, unwrap) {
2414
+ return function (value) {
2415
+ fn(state, value, unwrap);
2416
+ };
2417
+ };
2418
+
2419
+ var internalReject = function (state, value, unwrap) {
2420
+ if (state.done) return;
2421
+ state.done = true;
2422
+ if (unwrap) state = unwrap;
2423
+ state.value = value;
2424
+ state.state = REJECTED;
2425
+ notify(state, true);
2426
+ };
2427
+
2428
+ var internalResolve = function (state, value, unwrap) {
2429
+ if (state.done) return;
2430
+ state.done = true;
2431
+ if (unwrap) state = unwrap;
2432
+ try {
2433
+ if (state.facade === value) throw new TypeError$1("Promise can't be resolved itself");
2434
+ var then = isThenable(value);
2435
+ if (then) {
2436
+ microtask(function () {
2437
+ var wrapper = { done: false };
2438
+ try {
2439
+ call$8(then, value,
2440
+ bind$1(internalResolve, wrapper, state),
2441
+ bind$1(internalReject, wrapper, state)
2442
+ );
2443
+ } catch (error) {
2444
+ internalReject(wrapper, error, state);
2445
+ }
2446
+ });
2447
+ } else {
2448
+ state.value = value;
2449
+ state.state = FULFILLED;
2450
+ notify(state, false);
2451
+ }
2452
+ } catch (error) {
2453
+ internalReject({ done: false }, error, state);
2454
+ }
2455
+ };
2456
+
2457
+ // constructor polyfill
2458
+ if (FORCED_PROMISE_CONSTRUCTOR$4) {
2459
+ // 25.4.3.1 Promise(executor)
2460
+ PromiseConstructor = function Promise(executor) {
2461
+ anInstance(this, PromisePrototype);
2462
+ aCallable$4(executor);
2463
+ call$8(Internal, this);
2464
+ var state = getInternalPromiseState(this);
2465
+ try {
2466
+ executor(bind$1(internalResolve, state), bind$1(internalReject, state));
2467
+ } catch (error) {
2468
+ internalReject(state, error);
2469
+ }
2470
+ };
2471
+
2472
+ PromisePrototype = PromiseConstructor.prototype;
2473
+
2474
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
2475
+ Internal = function Promise(executor) {
2476
+ setInternalState(this, {
2477
+ type: PROMISE,
2478
+ done: false,
2479
+ notified: false,
2480
+ parent: false,
2481
+ reactions: new Queue(),
2482
+ rejection: false,
2483
+ state: PENDING,
2484
+ value: undefined
2485
+ });
2486
+ };
2487
+
2488
+ // `Promise.prototype.then` method
2489
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
2490
+ Internal.prototype = defineBuiltIn$2(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
2491
+ var state = getInternalPromiseState(this);
2492
+ var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
2493
+ state.parent = true;
2494
+ reaction.ok = isCallable$2(onFulfilled) ? onFulfilled : true;
2495
+ reaction.fail = isCallable$2(onRejected) && onRejected;
2496
+ reaction.domain = IS_NODE ? process.domain : undefined;
2497
+ if (state.state === PENDING) state.reactions.add(reaction);
2498
+ else microtask(function () {
2499
+ callReaction(reaction, state);
2500
+ });
2501
+ return reaction.promise;
2502
+ });
2503
+
2504
+ OwnPromiseCapability = function () {
2505
+ var promise = new Internal();
2506
+ var state = getInternalPromiseState(promise);
2507
+ this.promise = promise;
2508
+ this.resolve = bind$1(internalResolve, state);
2509
+ this.reject = bind$1(internalReject, state);
2510
+ };
2511
+
2512
+ newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
2513
+ return C === PromiseConstructor || C === PromiseWrapper
2514
+ ? new OwnPromiseCapability(C)
2515
+ : newGenericPromiseCapability(C);
2516
+ };
2517
+
2518
+ if (isCallable$2(NativePromiseConstructor$2) && NativePromisePrototype$1 !== Object.prototype) {
2519
+ nativeThen = NativePromisePrototype$1.then;
2520
+
2521
+ if (!NATIVE_PROMISE_SUBCLASSING) {
2522
+ // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
2523
+ defineBuiltIn$2(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
2524
+ var that = this;
2525
+ return new PromiseConstructor(function (resolve, reject) {
2526
+ call$8(nativeThen, that, resolve, reject);
2527
+ }).then(onFulfilled, onRejected);
2528
+ // https://github.com/zloirock/core-js/issues/640
2529
+ }, { unsafe: true });
2530
+ }
2531
+
2532
+ // make `.constructor === Promise` work for native promise-based APIs
2533
+ try {
2534
+ delete NativePromisePrototype$1.constructor;
2535
+ } catch (error) { /* empty */ }
2536
+
2537
+ // make `instanceof Promise` work for native promise-based APIs
2538
+ if (setPrototypeOf$2) {
2539
+ setPrototypeOf$2(NativePromisePrototype$1, PromisePrototype);
2540
+ }
2541
+ }
2542
+ }
2543
+
2544
+ $$d({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
2545
+ Promise: PromiseConstructor
2546
+ });
2547
+
2548
+ setToStringTag$1(PromiseConstructor, PROMISE, false);
2549
+ setSpecies(PROMISE);
2550
+
2551
+ var wellKnownSymbol$3 = wellKnownSymbol$e;
2552
+ var Iterators$1 = iterators;
2553
+
2554
+ var ITERATOR$3 = wellKnownSymbol$3('iterator');
2555
+ var ArrayPrototype = Array.prototype;
2556
+
2557
+ // check on default Array iterator
2558
+ var isArrayIteratorMethod$1 = function (it) {
2559
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$3] === it);
2560
+ };
2561
+
2562
+ var classof = classof$5;
2563
+ var getMethod$1 = getMethod$3;
2564
+ var isNullOrUndefined = isNullOrUndefined$4;
2565
+ var Iterators = iterators;
2566
+ var wellKnownSymbol$2 = wellKnownSymbol$e;
2567
+
2568
+ var ITERATOR$2 = wellKnownSymbol$2('iterator');
2569
+
2570
+ var getIteratorMethod$2 = function (it) {
2571
+ if (!isNullOrUndefined(it)) return getMethod$1(it, ITERATOR$2)
2572
+ || getMethod$1(it, '@@iterator')
2573
+ || Iterators[classof(it)];
2574
+ };
2575
+
2576
+ var call$7 = functionCall;
2577
+ var aCallable$3 = aCallable$9;
2578
+ var anObject$6 = anObject$c;
2579
+ var tryToString$1 = tryToString$4;
2580
+ var getIteratorMethod$1 = getIteratorMethod$2;
2581
+
2582
+ var $TypeError$2 = TypeError;
2583
+
2584
+ var getIterator$1 = function (argument, usingIterator) {
2585
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
2586
+ if (aCallable$3(iteratorMethod)) return anObject$6(call$7(iteratorMethod, argument));
2587
+ throw new $TypeError$2(tryToString$1(argument) + ' is not iterable');
2588
+ };
2589
+
2590
+ var call$6 = functionCall;
2591
+ var anObject$5 = anObject$c;
2592
+ var getMethod = getMethod$3;
2593
+
2594
+ var iteratorClose$3 = function (iterator, kind, value) {
2595
+ var innerResult, innerError;
2596
+ anObject$5(iterator);
2597
+ try {
2598
+ innerResult = getMethod(iterator, 'return');
2599
+ if (!innerResult) {
2600
+ if (kind === 'throw') throw value;
2601
+ return value;
2602
+ }
2603
+ innerResult = call$6(innerResult, iterator);
2604
+ } catch (error) {
2605
+ innerError = true;
2606
+ innerResult = error;
2607
+ }
2608
+ if (kind === 'throw') throw value;
2609
+ if (innerError) throw innerResult;
2610
+ anObject$5(innerResult);
2611
+ return value;
2612
+ };
2613
+
2614
+ var bind = functionBindContext;
2615
+ var call$5 = functionCall;
2616
+ var anObject$4 = anObject$c;
2617
+ var tryToString = tryToString$4;
2618
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
2619
+ var lengthOfArrayLike = lengthOfArrayLike$2;
2620
+ var isPrototypeOf$2 = objectIsPrototypeOf;
2621
+ var getIterator = getIterator$1;
2622
+ var getIteratorMethod = getIteratorMethod$2;
2623
+ var iteratorClose$2 = iteratorClose$3;
2624
+
2625
+ var $TypeError$1 = TypeError;
2626
+
2627
+ var Result = function (stopped, result) {
2628
+ this.stopped = stopped;
2629
+ this.result = result;
2630
+ };
2631
+
2632
+ var ResultPrototype = Result.prototype;
2633
+
2634
+ var iterate$4 = function (iterable, unboundFunction, options) {
2635
+ var that = options && options.that;
2636
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
2637
+ var IS_RECORD = !!(options && options.IS_RECORD);
2638
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
2639
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
2640
+ var fn = bind(unboundFunction, that);
2641
+ var iterator, iterFn, index, length, result, next, step;
2642
+
2643
+ var stop = function (condition) {
2644
+ if (iterator) iteratorClose$2(iterator, 'normal', condition);
2645
+ return new Result(true, condition);
2646
+ };
2647
+
2648
+ var callFn = function (value) {
2649
+ if (AS_ENTRIES) {
2650
+ anObject$4(value);
2651
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
2652
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
2653
+ };
2654
+
2655
+ if (IS_RECORD) {
2656
+ iterator = iterable.iterator;
2657
+ } else if (IS_ITERATOR) {
2658
+ iterator = iterable;
2659
+ } else {
2660
+ iterFn = getIteratorMethod(iterable);
2661
+ if (!iterFn) throw new $TypeError$1(tryToString(iterable) + ' is not iterable');
2662
+ // optimisation for array iterators
2663
+ if (isArrayIteratorMethod(iterFn)) {
2664
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
2665
+ result = callFn(iterable[index]);
2666
+ if (result && isPrototypeOf$2(ResultPrototype, result)) return result;
2667
+ } return new Result(false);
2668
+ }
2669
+ iterator = getIterator(iterable, iterFn);
2670
+ }
2671
+
2672
+ next = IS_RECORD ? iterable.next : iterator.next;
2673
+ while (!(step = call$5(next, iterator)).done) {
2674
+ try {
2675
+ result = callFn(step.value);
2676
+ } catch (error) {
2677
+ iteratorClose$2(iterator, 'throw', error);
2678
+ }
2679
+ if (typeof result == 'object' && result && isPrototypeOf$2(ResultPrototype, result)) return result;
2680
+ } return new Result(false);
2681
+ };
2682
+
2683
+ var wellKnownSymbol$1 = wellKnownSymbol$e;
2684
+
2685
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
2686
+ var SAFE_CLOSING = false;
2687
+
2688
+ try {
2689
+ var called = 0;
2690
+ var iteratorWithReturn = {
2691
+ next: function () {
2692
+ return { done: !!called++ };
2693
+ },
2694
+ 'return': function () {
2695
+ SAFE_CLOSING = true;
2696
+ }
2697
+ };
2698
+ iteratorWithReturn[ITERATOR$1] = function () {
2699
+ return this;
2700
+ };
2701
+ // eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
2702
+ Array.from(iteratorWithReturn, function () { throw 2; });
2703
+ } catch (error) { /* empty */ }
2704
+
2705
+ var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
2706
+ try {
2707
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
2708
+ } catch (error) { return false; } // workaround of old WebKit + `eval` bug
2709
+ var ITERATION_SUPPORT = false;
2710
+ try {
2711
+ var object = {};
2712
+ object[ITERATOR$1] = function () {
2713
+ return {
2714
+ next: function () {
2715
+ return { done: ITERATION_SUPPORT = true };
2716
+ }
2717
+ };
2718
+ };
2719
+ exec(object);
2720
+ } catch (error) { /* empty */ }
2721
+ return ITERATION_SUPPORT;
2722
+ };
2723
+
2724
+ var NativePromiseConstructor$1 = promiseNativeConstructor;
2725
+ var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
2726
+ var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
2727
+
2728
+ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
2729
+ NativePromiseConstructor$1.all(iterable).then(undefined, function () { /* empty */ });
2730
+ });
2731
+
2732
+ var $$c = _export;
2733
+ var call$4 = functionCall;
2734
+ var aCallable$2 = aCallable$9;
2735
+ var newPromiseCapabilityModule$2 = newPromiseCapability$2;
2736
+ var perform$1 = perform$3;
2737
+ var iterate$3 = iterate$4;
2738
+ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
2739
+
2740
+ // `Promise.all` method
2741
+ // https://tc39.es/ecma262/#sec-promise.all
2742
+ $$c({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
2743
+ all: function all(iterable) {
2744
+ var C = this;
2745
+ var capability = newPromiseCapabilityModule$2.f(C);
2746
+ var resolve = capability.resolve;
2747
+ var reject = capability.reject;
2748
+ var result = perform$1(function () {
2749
+ var $promiseResolve = aCallable$2(C.resolve);
2750
+ var values = [];
2751
+ var counter = 0;
2752
+ var remaining = 1;
2753
+ iterate$3(iterable, function (promise) {
2754
+ var index = counter++;
2755
+ var alreadyCalled = false;
2756
+ remaining++;
2757
+ call$4($promiseResolve, C, promise).then(function (value) {
2758
+ if (alreadyCalled) return;
2759
+ alreadyCalled = true;
2760
+ values[index] = value;
2761
+ --remaining || resolve(values);
2762
+ }, reject);
2763
+ });
2764
+ --remaining || resolve(values);
2765
+ });
2766
+ if (result.error) reject(result.value);
2767
+ return capability.promise;
2768
+ }
2769
+ });
2770
+
2771
+ var $$b = _export;
2772
+ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
2773
+ var NativePromiseConstructor = promiseNativeConstructor;
2774
+ var getBuiltIn$3 = getBuiltIn$a;
2775
+ var isCallable$1 = isCallable$m;
2776
+ var defineBuiltIn$1 = defineBuiltIn$6;
2777
+
2778
+ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
2779
+
2780
+ // `Promise.prototype.catch` method
2781
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
2782
+ $$b({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
2783
+ 'catch': function (onRejected) {
2784
+ return this.then(undefined, onRejected);
2785
+ }
2786
+ });
2787
+
2788
+ // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
2789
+ if (isCallable$1(NativePromiseConstructor)) {
2790
+ var method = getBuiltIn$3('Promise').prototype['catch'];
2791
+ if (NativePromisePrototype['catch'] !== method) {
2792
+ defineBuiltIn$1(NativePromisePrototype, 'catch', method, { unsafe: true });
2793
+ }
2794
+ }
2795
+
2796
+ var $$a = _export;
2797
+ var call$3 = functionCall;
2798
+ var aCallable$1 = aCallable$9;
2799
+ var newPromiseCapabilityModule$1 = newPromiseCapability$2;
2800
+ var perform = perform$3;
2801
+ var iterate$2 = iterate$4;
2802
+ var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
2803
+
2804
+ // `Promise.race` method
2805
+ // https://tc39.es/ecma262/#sec-promise.race
2806
+ $$a({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
2807
+ race: function race(iterable) {
2808
+ var C = this;
2809
+ var capability = newPromiseCapabilityModule$1.f(C);
2810
+ var reject = capability.reject;
2811
+ var result = perform(function () {
2812
+ var $promiseResolve = aCallable$1(C.resolve);
2813
+ iterate$2(iterable, function (promise) {
2814
+ call$3($promiseResolve, C, promise).then(capability.resolve, reject);
2815
+ });
2816
+ });
2817
+ if (result.error) reject(result.value);
2818
+ return capability.promise;
2819
+ }
2820
+ });
2821
+
2822
+ var $$9 = _export;
2823
+ var newPromiseCapabilityModule = newPromiseCapability$2;
2824
+ var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
2825
+
2826
+ // `Promise.reject` method
2827
+ // https://tc39.es/ecma262/#sec-promise.reject
2828
+ $$9({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
2829
+ reject: function reject(r) {
2830
+ var capability = newPromiseCapabilityModule.f(this);
2831
+ var capabilityReject = capability.reject;
2832
+ capabilityReject(r);
2833
+ return capability.promise;
2834
+ }
2835
+ });
2836
+
2837
+ var anObject$3 = anObject$c;
2838
+ var isObject$2 = isObject$c;
2839
+ var newPromiseCapability = newPromiseCapability$2;
2840
+
2841
+ var promiseResolve$1 = function (C, x) {
2842
+ anObject$3(C);
2843
+ if (isObject$2(x) && x.constructor === C) return x;
2844
+ var promiseCapability = newPromiseCapability.f(C);
2845
+ var resolve = promiseCapability.resolve;
2846
+ resolve(x);
2847
+ return promiseCapability.promise;
2848
+ };
2849
+
2850
+ var $$8 = _export;
2851
+ var getBuiltIn$2 = getBuiltIn$a;
2852
+ var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
2853
+ var promiseResolve = promiseResolve$1;
2854
+
2855
+ getBuiltIn$2('Promise');
2856
+
2857
+ // `Promise.resolve` method
2858
+ // https://tc39.es/ecma262/#sec-promise.resolve
2859
+ $$8({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
2860
+ resolve: function resolve(x) {
2861
+ return promiseResolve(this, x);
2862
+ }
2863
+ });
2864
+
2865
+ var uncurryThis$2 = functionUncurryThis;
2866
+
2867
+ // eslint-disable-next-line es/no-set -- safe
2868
+ var SetPrototype$1 = Set.prototype;
2869
+
2870
+ var setHelpers = {
2871
+ // eslint-disable-next-line es/no-set -- safe
2872
+ Set: Set,
2873
+ add: uncurryThis$2(SetPrototype$1.add),
2874
+ has: uncurryThis$2(SetPrototype$1.has),
2875
+ remove: uncurryThis$2(SetPrototype$1['delete']),
2876
+ proto: SetPrototype$1
2877
+ };
2878
+
2879
+ var has$5 = setHelpers.has;
2880
+
2881
+ // Perform ? RequireInternalSlot(M, [[SetData]])
2882
+ var aSet$7 = function (it) {
2883
+ has$5(it);
2884
+ return it;
2885
+ };
2886
+
2887
+ var call$2 = functionCall;
2888
+
2889
+ var iterateSimple$7 = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {
2890
+ var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;
2891
+ var next = record.next;
2892
+ var step, result;
2893
+ while (!(step = call$2(next, iterator)).done) {
2894
+ result = fn(step.value);
2895
+ if (result !== undefined) return result;
2896
+ }
2897
+ };
2898
+
2899
+ var uncurryThis$1 = functionUncurryThis;
2900
+ var iterateSimple$6 = iterateSimple$7;
2901
+ var SetHelpers$5 = setHelpers;
2902
+
2903
+ var Set$3 = SetHelpers$5.Set;
2904
+ var SetPrototype = SetHelpers$5.proto;
2905
+ var forEach = uncurryThis$1(SetPrototype.forEach);
2906
+ var keys = uncurryThis$1(SetPrototype.keys);
2907
+ var next = keys(new Set$3()).next;
2908
+
2909
+ var setIterate = function (set, fn, interruptible) {
2910
+ return interruptible ? iterateSimple$6({ iterator: keys(set), next: next }, fn) : forEach(set, fn);
2911
+ };
2912
+
2913
+ var SetHelpers$4 = setHelpers;
2914
+ var iterate$1 = setIterate;
2915
+
2916
+ var Set$2 = SetHelpers$4.Set;
2917
+ var add$3 = SetHelpers$4.add;
2918
+
2919
+ var setClone = function (set) {
2920
+ var result = new Set$2();
2921
+ iterate$1(set, function (it) {
2922
+ add$3(result, it);
2923
+ });
2924
+ return result;
2925
+ };
2926
+
2927
+ var uncurryThisAccessor = functionUncurryThisAccessor;
2928
+ var SetHelpers$3 = setHelpers;
2929
+
2930
+ var setSize = uncurryThisAccessor(SetHelpers$3.proto, 'size', 'get') || function (set) {
2931
+ return set.size;
2932
+ };
2933
+
2934
+ // `GetIteratorDirect(obj)` abstract operation
2935
+ // https://tc39.es/proposal-iterator-helpers/#sec-getiteratordirect
2936
+ var getIteratorDirect$1 = function (obj) {
2937
+ return {
2938
+ iterator: obj,
2939
+ next: obj.next,
2940
+ done: false
2941
+ };
2942
+ };
2943
+
2944
+ var aCallable = aCallable$9;
2945
+ var anObject$2 = anObject$c;
2946
+ var call$1 = functionCall;
2947
+ var toIntegerOrInfinity = toIntegerOrInfinity$3;
2948
+ var getIteratorDirect = getIteratorDirect$1;
2949
+
2950
+ var INVALID_SIZE = 'Invalid size';
2951
+ var $RangeError = RangeError;
2952
+ var $TypeError = TypeError;
2953
+ var max = Math.max;
2954
+
2955
+ var SetRecord = function (set, intSize) {
2956
+ this.set = set;
2957
+ this.size = max(intSize, 0);
2958
+ this.has = aCallable(set.has);
2959
+ this.keys = aCallable(set.keys);
2960
+ };
2961
+
2962
+ SetRecord.prototype = {
2963
+ getIterator: function () {
2964
+ return getIteratorDirect(anObject$2(call$1(this.keys, this.set)));
2965
+ },
2966
+ includes: function (it) {
2967
+ return call$1(this.has, this.set, it);
2968
+ }
2969
+ };
2970
+
2971
+ // `GetSetRecord` abstract operation
2972
+ // https://tc39.es/proposal-set-methods/#sec-getsetrecord
2973
+ var getSetRecord$7 = function (obj) {
2974
+ anObject$2(obj);
2975
+ var numSize = +obj.size;
2976
+ // NOTE: If size is undefined, then numSize will be NaN
2977
+ // eslint-disable-next-line no-self-compare -- NaN check
2978
+ if (numSize !== numSize) throw new $TypeError(INVALID_SIZE);
2979
+ var intSize = toIntegerOrInfinity(numSize);
2980
+ if (intSize < 0) throw new $RangeError(INVALID_SIZE);
2981
+ return new SetRecord(obj, intSize);
2982
+ };
2983
+
2984
+ var aSet$6 = aSet$7;
2985
+ var SetHelpers$2 = setHelpers;
2986
+ var clone$2 = setClone;
2987
+ var size$4 = setSize;
2988
+ var getSetRecord$6 = getSetRecord$7;
2989
+ var iterateSet$2 = setIterate;
2990
+ var iterateSimple$5 = iterateSimple$7;
2991
+
2992
+ var has$4 = SetHelpers$2.has;
2993
+ var remove$1 = SetHelpers$2.remove;
2994
+
2995
+ // `Set.prototype.difference` method
2996
+ // https://github.com/tc39/proposal-set-methods
2997
+ var setDifference = function difference(other) {
2998
+ var O = aSet$6(this);
2999
+ var otherRec = getSetRecord$6(other);
3000
+ var result = clone$2(O);
3001
+ if (size$4(O) <= otherRec.size) iterateSet$2(O, function (e) {
3002
+ if (otherRec.includes(e)) remove$1(result, e);
3003
+ });
3004
+ else iterateSimple$5(otherRec.getIterator(), function (e) {
3005
+ if (has$4(O, e)) remove$1(result, e);
3006
+ });
3007
+ return result;
3008
+ };
3009
+
3010
+ var getBuiltIn$1 = getBuiltIn$a;
3011
+
3012
+ var createSetLike = function (size) {
3013
+ return {
3014
+ size: size,
3015
+ has: function () {
3016
+ return false;
3017
+ },
3018
+ keys: function () {
3019
+ return {
3020
+ next: function () {
3021
+ return { done: true };
3022
+ }
3023
+ };
3024
+ }
3025
+ };
3026
+ };
3027
+
3028
+ var setMethodAcceptSetLike$7 = function (name) {
3029
+ var Set = getBuiltIn$1('Set');
3030
+ try {
3031
+ new Set()[name](createSetLike(0));
3032
+ try {
3033
+ // late spec change, early WebKit ~ Safari 17.0 beta implementation does not pass it
3034
+ // https://github.com/tc39/proposal-set-methods/pull/88
3035
+ new Set()[name](createSetLike(-1));
3036
+ return false;
3037
+ } catch (error2) {
3038
+ return true;
3039
+ }
3040
+ } catch (error) {
3041
+ return false;
3042
+ }
3043
+ };
3044
+
3045
+ var $$7 = _export;
3046
+ var difference = setDifference;
3047
+ var setMethodAcceptSetLike$6 = setMethodAcceptSetLike$7;
3048
+
3049
+ // `Set.prototype.difference` method
3050
+ // https://github.com/tc39/proposal-set-methods
3051
+ $$7({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$6('difference') }, {
3052
+ difference: difference
3053
+ });
3054
+
3055
+ var aSet$5 = aSet$7;
3056
+ var SetHelpers$1 = setHelpers;
3057
+ var size$3 = setSize;
3058
+ var getSetRecord$5 = getSetRecord$7;
3059
+ var iterateSet$1 = setIterate;
3060
+ var iterateSimple$4 = iterateSimple$7;
3061
+
3062
+ var Set$1 = SetHelpers$1.Set;
3063
+ var add$2 = SetHelpers$1.add;
3064
+ var has$3 = SetHelpers$1.has;
3065
+
3066
+ // `Set.prototype.intersection` method
3067
+ // https://github.com/tc39/proposal-set-methods
3068
+ var setIntersection = function intersection(other) {
3069
+ var O = aSet$5(this);
3070
+ var otherRec = getSetRecord$5(other);
3071
+ var result = new Set$1();
3072
+
3073
+ if (size$3(O) > otherRec.size) {
3074
+ iterateSimple$4(otherRec.getIterator(), function (e) {
3075
+ if (has$3(O, e)) add$2(result, e);
3076
+ });
3077
+ } else {
3078
+ iterateSet$1(O, function (e) {
3079
+ if (otherRec.includes(e)) add$2(result, e);
3080
+ });
3081
+ }
3082
+
3083
+ return result;
3084
+ };
3085
+
3086
+ var $$6 = _export;
3087
+ var fails$2 = fails$h;
3088
+ var intersection = setIntersection;
3089
+ var setMethodAcceptSetLike$5 = setMethodAcceptSetLike$7;
3090
+
3091
+ var INCORRECT = !setMethodAcceptSetLike$5('intersection') || fails$2(function () {
3092
+ // eslint-disable-next-line es/no-array-from, es/no-set -- testing
3093
+ return String(Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))) !== '3,2';
3094
+ });
3095
+
3096
+ // `Set.prototype.intersection` method
3097
+ // https://github.com/tc39/proposal-set-methods
3098
+ $$6({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
3099
+ intersection: intersection
3100
+ });
3101
+
3102
+ var aSet$4 = aSet$7;
3103
+ var has$2 = setHelpers.has;
3104
+ var size$2 = setSize;
3105
+ var getSetRecord$4 = getSetRecord$7;
3106
+ var iterateSet = setIterate;
3107
+ var iterateSimple$3 = iterateSimple$7;
3108
+ var iteratorClose$1 = iteratorClose$3;
3109
+
3110
+ // `Set.prototype.isDisjointFrom` method
3111
+ // https://tc39.github.io/proposal-set-methods/#Set.prototype.isDisjointFrom
3112
+ var setIsDisjointFrom = function isDisjointFrom(other) {
3113
+ var O = aSet$4(this);
3114
+ var otherRec = getSetRecord$4(other);
3115
+ if (size$2(O) <= otherRec.size) return iterateSet(O, function (e) {
3116
+ if (otherRec.includes(e)) return false;
3117
+ }, true) !== false;
3118
+ var iterator = otherRec.getIterator();
3119
+ return iterateSimple$3(iterator, function (e) {
3120
+ if (has$2(O, e)) return iteratorClose$1(iterator, 'normal', false);
3121
+ }) !== false;
3122
+ };
3123
+
3124
+ var $$5 = _export;
3125
+ var isDisjointFrom = setIsDisjointFrom;
3126
+ var setMethodAcceptSetLike$4 = setMethodAcceptSetLike$7;
3127
+
3128
+ // `Set.prototype.isDisjointFrom` method
3129
+ // https://github.com/tc39/proposal-set-methods
3130
+ $$5({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$4('isDisjointFrom') }, {
3131
+ isDisjointFrom: isDisjointFrom
3132
+ });
3133
+
3134
+ var aSet$3 = aSet$7;
3135
+ var size$1 = setSize;
3136
+ var iterate = setIterate;
3137
+ var getSetRecord$3 = getSetRecord$7;
3138
+
3139
+ // `Set.prototype.isSubsetOf` method
3140
+ // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSubsetOf
3141
+ var setIsSubsetOf = function isSubsetOf(other) {
3142
+ var O = aSet$3(this);
3143
+ var otherRec = getSetRecord$3(other);
3144
+ if (size$1(O) > otherRec.size) return false;
3145
+ return iterate(O, function (e) {
3146
+ if (!otherRec.includes(e)) return false;
3147
+ }, true) !== false;
3148
+ };
3149
+
3150
+ var $$4 = _export;
3151
+ var isSubsetOf = setIsSubsetOf;
3152
+ var setMethodAcceptSetLike$3 = setMethodAcceptSetLike$7;
3153
+
3154
+ // `Set.prototype.isSubsetOf` method
3155
+ // https://github.com/tc39/proposal-set-methods
3156
+ $$4({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$3('isSubsetOf') }, {
3157
+ isSubsetOf: isSubsetOf
3158
+ });
3159
+
3160
+ var aSet$2 = aSet$7;
3161
+ var has$1 = setHelpers.has;
3162
+ var size = setSize;
3163
+ var getSetRecord$2 = getSetRecord$7;
3164
+ var iterateSimple$2 = iterateSimple$7;
3165
+ var iteratorClose = iteratorClose$3;
3166
+
3167
+ // `Set.prototype.isSupersetOf` method
3168
+ // https://tc39.github.io/proposal-set-methods/#Set.prototype.isSupersetOf
3169
+ var setIsSupersetOf = function isSupersetOf(other) {
3170
+ var O = aSet$2(this);
3171
+ var otherRec = getSetRecord$2(other);
3172
+ if (size(O) < otherRec.size) return false;
3173
+ var iterator = otherRec.getIterator();
3174
+ return iterateSimple$2(iterator, function (e) {
3175
+ if (!has$1(O, e)) return iteratorClose(iterator, 'normal', false);
3176
+ }) !== false;
3177
+ };
3178
+
3179
+ var $$3 = _export;
3180
+ var isSupersetOf = setIsSupersetOf;
3181
+ var setMethodAcceptSetLike$2 = setMethodAcceptSetLike$7;
3182
+
3183
+ // `Set.prototype.isSupersetOf` method
3184
+ // https://github.com/tc39/proposal-set-methods
3185
+ $$3({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$2('isSupersetOf') }, {
3186
+ isSupersetOf: isSupersetOf
3187
+ });
3188
+
3189
+ var aSet$1 = aSet$7;
3190
+ var SetHelpers = setHelpers;
3191
+ var clone$1 = setClone;
3192
+ var getSetRecord$1 = getSetRecord$7;
3193
+ var iterateSimple$1 = iterateSimple$7;
3194
+
3195
+ var add$1 = SetHelpers.add;
3196
+ var has = SetHelpers.has;
3197
+ var remove = SetHelpers.remove;
3198
+
3199
+ // `Set.prototype.symmetricDifference` method
3200
+ // https://github.com/tc39/proposal-set-methods
3201
+ var setSymmetricDifference = function symmetricDifference(other) {
3202
+ var O = aSet$1(this);
3203
+ var keysIter = getSetRecord$1(other).getIterator();
3204
+ var result = clone$1(O);
3205
+ iterateSimple$1(keysIter, function (e) {
3206
+ if (has(O, e)) remove(result, e);
3207
+ else add$1(result, e);
3208
+ });
3209
+ return result;
3210
+ };
3211
+
3212
+ var $$2 = _export;
3213
+ var symmetricDifference = setSymmetricDifference;
3214
+ var setMethodAcceptSetLike$1 = setMethodAcceptSetLike$7;
3215
+
3216
+ // `Set.prototype.symmetricDifference` method
3217
+ // https://github.com/tc39/proposal-set-methods
3218
+ $$2({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike$1('symmetricDifference') }, {
3219
+ symmetricDifference: symmetricDifference
3220
+ });
3221
+
3222
+ var aSet = aSet$7;
3223
+ var add = setHelpers.add;
3224
+ var clone = setClone;
3225
+ var getSetRecord = getSetRecord$7;
3226
+ var iterateSimple = iterateSimple$7;
3227
+
3228
+ // `Set.prototype.union` method
3229
+ // https://github.com/tc39/proposal-set-methods
3230
+ var setUnion = function union(other) {
3231
+ var O = aSet(this);
3232
+ var keysIter = getSetRecord(other).getIterator();
3233
+ var result = clone(O);
3234
+ iterateSimple(keysIter, function (it) {
3235
+ add(result, it);
3236
+ });
3237
+ return result;
3238
+ };
3239
+
3240
+ var $$1 = _export;
3241
+ var union = setUnion;
3242
+ var setMethodAcceptSetLike = setMethodAcceptSetLike$7;
3243
+
3244
+ // `Set.prototype.union` method
3245
+ // https://github.com/tc39/proposal-set-methods
3246
+ $$1({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, {
3247
+ union: union
3248
+ });
3249
+
3250
+ // iterable DOM collections
3251
+ // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
3252
+ var domIterables = {
3253
+ CSSRuleList: 0,
3254
+ CSSStyleDeclaration: 0,
3255
+ CSSValueList: 0,
3256
+ ClientRectList: 0,
3257
+ DOMRectList: 0,
3258
+ DOMStringList: 0,
3259
+ DOMTokenList: 1,
3260
+ DataTransferItemList: 0,
3261
+ FileList: 0,
3262
+ HTMLAllCollection: 0,
3263
+ HTMLCollection: 0,
3264
+ HTMLFormElement: 0,
3265
+ HTMLSelectElement: 0,
3266
+ MediaList: 0,
3267
+ MimeTypeArray: 0,
3268
+ NamedNodeMap: 0,
3269
+ NodeList: 1,
3270
+ PaintRequestList: 0,
3271
+ Plugin: 0,
3272
+ PluginArray: 0,
3273
+ SVGLengthList: 0,
3274
+ SVGNumberList: 0,
3275
+ SVGPathSegList: 0,
3276
+ SVGPointList: 0,
3277
+ SVGStringList: 0,
3278
+ SVGTransformList: 0,
3279
+ SourceBufferList: 0,
3280
+ StyleSheetList: 0,
3281
+ TextTrackCueList: 0,
3282
+ TextTrackList: 0,
3283
+ TouchList: 0
3284
+ };
3285
+
3286
+ // in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
3287
+ var documentCreateElement = documentCreateElement$2;
3288
+
3289
+ var classList = documentCreateElement('span').classList;
3290
+ var DOMTokenListPrototype$1 = classList && classList.constructor && classList.constructor.prototype;
3291
+
3292
+ var domTokenListPrototype = DOMTokenListPrototype$1 === Object.prototype ? undefined : DOMTokenListPrototype$1;
3293
+
3294
+ var global$2 = global$j;
3295
+ var DOMIterables = domIterables;
3296
+ var DOMTokenListPrototype = domTokenListPrototype;
3297
+ var ArrayIteratorMethods = es_array_iterator;
3298
+ var createNonEnumerableProperty$3 = createNonEnumerableProperty$7;
3299
+ var setToStringTag = setToStringTag$4;
3300
+ var wellKnownSymbol = wellKnownSymbol$e;
3301
+
3302
+ var ITERATOR = wellKnownSymbol('iterator');
3303
+ var ArrayValues = ArrayIteratorMethods.values;
3304
+
3305
+ var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
3306
+ if (CollectionPrototype) {
3307
+ // some Chrome versions have non-configurable methods on DOMTokenList
3308
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
3309
+ createNonEnumerableProperty$3(CollectionPrototype, ITERATOR, ArrayValues);
3310
+ } catch (error) {
3311
+ CollectionPrototype[ITERATOR] = ArrayValues;
3312
+ }
3313
+ setToStringTag(CollectionPrototype, COLLECTION_NAME, true);
3314
+ if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
3315
+ // some Chrome versions have non-configurable methods on DOMTokenList
3316
+ if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
3317
+ createNonEnumerableProperty$3(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
3318
+ } catch (error) {
3319
+ CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
3320
+ }
3321
+ }
3322
+ }
3323
+ };
3324
+
3325
+ for (var COLLECTION_NAME in DOMIterables) {
3326
+ handlePrototype(global$2[COLLECTION_NAME] && global$2[COLLECTION_NAME].prototype, COLLECTION_NAME);
3327
+ }
3328
+
3329
+ handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
3330
+
3331
+ /**
3332
+ * A code used in some cases to denote success.
3333
+ */
3334
+ const ZOOM_SUCCESS_CODE = 'SUCCESS';
3335
+ /**
3336
+ * Zoom Server Error
3337
+ */
3338
+ class ZoomServerError extends BaseError {
3339
+ get code() {
3340
+ return this.error.code;
3341
+ }
3342
+ constructor(error) {
3343
+ super(error.message);
3344
+ this.error = void 0;
3345
+ this.error = error;
3346
+ }
3347
+ }
3348
+ /**
3349
+ * Zoom Server Error that includes the FetchResponseError
3350
+ */
3351
+ class ZoomServerFetchResponseError extends ZoomServerError {
3352
+ constructor(data, responseError) {
3353
+ super(data);
3354
+ this.data = void 0;
3355
+ this.responseError = void 0;
3356
+ this.data = data;
3357
+ this.responseError = responseError;
3358
+ }
3359
+ }
3360
+ /**
3361
+ * Creates a logZoomServerErrorFunction that logs the error to console.
3362
+ *
3363
+ * @param zoomApiNamePrefix Prefix to use when logging. I.E. ZoomError, etc.
3364
+ * @returns
3365
+ */
3366
+ function logZoomServerErrorFunction(zoomApiNamePrefix) {
3367
+ return error => {
3368
+ if (error instanceof ZoomServerFetchResponseError) {
3369
+ console.log(`${zoomApiNamePrefix}Error(${error.responseError.response.status}): `, {
3370
+ error,
3371
+ errorData: error.data
3372
+ });
3373
+ } else if (error instanceof ZoomServerError) {
3374
+ console.log(`${zoomApiNamePrefix}Error(code:${error.code}): `, {
3375
+ error
3376
+ });
3377
+ } else {
3378
+ console.log(`${zoomApiNamePrefix}Error(name:${error.name}): `, {
3379
+ error
3380
+ });
3381
+ }
3382
+ };
3383
+ }
3384
+ /**
3385
+ * Wraps a ConfiguredFetch to support handling errors returned by fetch.
3386
+ *
3387
+ * @param fetch
3388
+ * @returns
3389
+ */
3390
+ function handleZoomErrorFetchFactory(parseZoomError, defaultLogError) {
3391
+ return (fetch, logError = defaultLogError) => {
3392
+ return async (x, y) => {
3393
+ try {
3394
+ return await fetch(x, y); // await to catch thrown errors
3395
+ } catch (e) {
3396
+ if (e instanceof FetchResponseError) {
3397
+ const error = await parseZoomError(e);
3398
+ if (error) {
3399
+ logError(error); // log before throwing.
3400
+ throw error;
3401
+ }
3402
+ }
3403
+ throw e;
3404
+ }
3405
+ };
3406
+ };
3407
+ }
3408
+ // MARK: Parsed Errors
3409
+ /**
3410
+ * The status code that Zoom uses to indicates that too many requests have been made in a short period of time.
3411
+ */
3412
+ const ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE = 429;
3413
+ const ZOOM_RATE_LIMIT_CATEGORY_HEADER = 'X-RateLimit-Category';
3414
+ const ZOOM_RATE_LIMIT_TYPE_HEADER = 'X-RateLimit-Type';
3415
+ const ZOOM_RATE_LIMIT_LIMIT_HEADER = 'X-RateLimit-Limit';
3416
+ const ZOOM_RATE_LIMIT_REMAINING_HEADER = 'X-RateLimit-Remaining';
3417
+ const ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER = 'Retry-After';
3418
+ const DEFAULT_ZOOM_API_RATE_LIMIT = 100;
3419
+ const DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD = MS_IN_MINUTE;
3420
+ function zoomRateLimitHeaderDetails(headers) {
3421
+ const limitHeader = headers.get(ZOOM_RATE_LIMIT_LIMIT_HEADER);
3422
+ const remainingHeader = headers.get(ZOOM_RATE_LIMIT_REMAINING_HEADER);
3423
+ const retryAfterHeader = headers.get(ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER);
3424
+ const categoryHeader = headers.get(ZOOM_RATE_LIMIT_CATEGORY_HEADER);
3425
+ const typeHeader = headers.get(ZOOM_RATE_LIMIT_TYPE_HEADER);
3426
+ let result = null;
3427
+ if (limitHeader != null && remainingHeader != null && retryAfterHeader != null) {
3428
+ const limit = Number(limitHeader);
3429
+ const remaining = Number(remainingHeader);
3430
+ const retryAfter = Number(retryAfterHeader);
3431
+ const retryAfterAt = new Date(retryAfter);
3432
+ const category = categoryHeader;
3433
+ const type = typeHeader;
3434
+ result = {
3435
+ limit,
3436
+ remaining,
3437
+ retryAfter,
3438
+ retryAfterAt,
3439
+ category,
3440
+ type
3441
+ };
3442
+ }
3443
+ return result;
3444
+ }
3445
+ class ZoomTooManyRequestsError extends ZoomServerFetchResponseError {
3446
+ get headerDetails() {
3447
+ return zoomRateLimitHeaderDetails(this.responseError.response.headers);
3448
+ }
3449
+ }
3450
+ /**
3451
+ * Function that parses/transforms a ZoomServerErrorData into a general ZoomServerError or other known error type.
3452
+ *
3453
+ * @param errorResponseData
3454
+ * @param responseError
3455
+ * @returns
3456
+ */
3457
+ function parseZoomServerErrorData(zoomServerError, responseError) {
3458
+ let result;
3459
+ if (responseError.response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE) {
3460
+ result = new ZoomTooManyRequestsError(zoomServerError, responseError);
3461
+ } else if (zoomServerError) {
3462
+ switch (zoomServerError.code) {
3463
+ default:
3464
+ result = new ZoomServerFetchResponseError(zoomServerError, responseError);
3465
+ break;
3466
+ }
3467
+ }
3468
+ return result;
3469
+ }
3470
+ /**
3471
+ * Returns a pre-configured MakeUrlSearchParamsOptions that omits the silenceError key.
3472
+ *
3473
+ * If other options are input, it merges those two options together and adds silenceError to the omitted keys.
3474
+ */
3475
+ function omitSilenceZoomErrorKeys(options) {
3476
+ const omitKeys = ['silenceError'];
3477
+ return mergeMakeUrlSearchParamsOptions([options, {
3478
+ omitKeys
3479
+ }]);
3480
+ }
3481
+ function silenceZoomErrorWithCodesFunction(codes, returnFn) {
3482
+ const codesSet = new Set(asArray(codes));
3483
+ return silence => {
3484
+ return reason => {
3485
+ if (silence !== false && reason instanceof ZoomServerFetchResponseError) {
3486
+ if (codesSet.has(reason.code)) {
3487
+ return returnFn == null ? void 0 : returnFn(reason);
3488
+ }
3489
+ }
3490
+ throw reason;
3491
+ };
3492
+ };
3493
+ }
3494
+
3495
+ /**
3496
+ * https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meeting
3497
+ */
3498
+ function getMeeting(context) {
3499
+ return input => context.fetchJson(`/meetings/${input.meetingId}`, 'GET');
3500
+ }
3501
+ /**
3502
+ * https://developers.zoom.us/docs/api/rest/reference/zoom-api/methods/#operation/meetings
3503
+ */
3504
+ function listMeetingsForUser(context) {
3505
+ return input => context.fetchJson(`/users/${input.user}/meetings`, 'GET').then(mapToZoomPageResult('meetings'));
3506
+ }
3507
+ function listMeetingsForUserPageFactory(context) {
3508
+ return zoomFetchPageFactory(listMeetingsForUser(context));
3509
+ }
3510
+ /**
3511
+ * https://developers.zoom.us/docs/api/meetings/#tag/meetings/POST/users/{userId}/meetings
3512
+ */
3513
+ function createMeetingForUser(context) {
3514
+ return input => {
3515
+ return context.fetchJson(`/users/${input.user}/meetings`, {
3516
+ method: 'POST',
3517
+ body: JSON.stringify(input.template)
3518
+ });
3519
+ };
3520
+ }
3521
+ const DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE = 3001;
3522
+ /**
3523
+ * https://developers.zoom.us/docs/api/meetings/#tag/meetings/DELETE/meetings/{meetingId}
3524
+ */
3525
+ function deleteMeeting(context) {
3526
+ const silenceDoesNotExistError = silenceZoomErrorWithCodesFunction(DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE);
3527
+ return input => context.fetchJson(`/meetings/${input.meetingId}?${makeUrlSearchParams(input, omitSilenceZoomErrorKeys())}`, 'DELETE').catch(silenceDoesNotExistError(input.silenceError));
3528
+ }
3529
+
3530
+ var ZoomMeetingType;
3531
+ (function (ZoomMeetingType) {
3532
+ ZoomMeetingType[ZoomMeetingType["INSTANT"] = 1] = "INSTANT";
3533
+ ZoomMeetingType[ZoomMeetingType["SCHEDULED"] = 2] = "SCHEDULED";
3534
+ ZoomMeetingType[ZoomMeetingType["RECURRING_NO_FIXED_TIME"] = 3] = "RECURRING_NO_FIXED_TIME";
3535
+ ZoomMeetingType[ZoomMeetingType["RECURRING_FIXED_TIME"] = 8] = "RECURRING_FIXED_TIME";
3536
+ })(ZoomMeetingType || (ZoomMeetingType = {}));
3537
+ var ZoomRecurrenceType;
3538
+ (function (ZoomRecurrenceType) {
3539
+ ZoomRecurrenceType[ZoomRecurrenceType["DAILY"] = 1] = "DAILY";
3540
+ ZoomRecurrenceType[ZoomRecurrenceType["WEEKLY"] = 2] = "WEEKLY";
3541
+ ZoomRecurrenceType[ZoomRecurrenceType["MONTHLY"] = 3] = "MONTHLY";
3542
+ })(ZoomRecurrenceType || (ZoomRecurrenceType = {}));
3543
+ var ZoomMonthlyWeek;
3544
+ (function (ZoomMonthlyWeek) {
3545
+ ZoomMonthlyWeek[ZoomMonthlyWeek["LAST_WEEK"] = -1] = "LAST_WEEK";
3546
+ ZoomMonthlyWeek[ZoomMonthlyWeek["FIRST_WEEK"] = 1] = "FIRST_WEEK";
3547
+ ZoomMonthlyWeek[ZoomMonthlyWeek["SECOND_WEEK"] = 2] = "SECOND_WEEK";
3548
+ ZoomMonthlyWeek[ZoomMonthlyWeek["THIRD_WEEK"] = 3] = "THIRD_WEEK";
3549
+ ZoomMonthlyWeek[ZoomMonthlyWeek["FOURTH_WEEK"] = 4] = "FOURTH_WEEK";
3550
+ })(ZoomMonthlyWeek || (ZoomMonthlyWeek = {}));
3551
+ var ZoomMonthlyWeekDay;
3552
+ (function (ZoomMonthlyWeekDay) {
3553
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["SUNDAY"] = 1] = "SUNDAY";
3554
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["MONDAY"] = 2] = "MONDAY";
3555
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["TUESDAY"] = 3] = "TUESDAY";
3556
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["WEDNESDAY"] = 4] = "WEDNESDAY";
3557
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["THURSDAY"] = 5] = "THURSDAY";
3558
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["FRIDAY"] = 6] = "FRIDAY";
3559
+ ZoomMonthlyWeekDay[ZoomMonthlyWeekDay["SATURDAY"] = 7] = "SATURDAY";
3560
+ })(ZoomMonthlyWeekDay || (ZoomMonthlyWeekDay = {}));
3561
+ var ZoomApprovalType;
3562
+ (function (ZoomApprovalType) {
3563
+ /**
3564
+ * Automatically approve.
3565
+ */
3566
+ ZoomApprovalType[ZoomApprovalType["AUTOMATICALLY_APPROVE"] = 0] = "AUTOMATICALLY_APPROVE";
3567
+ /**
3568
+ * Manually approve.
3569
+ */
3570
+ ZoomApprovalType[ZoomApprovalType["MANUALLY_APPROVE"] = 1] = "MANUALLY_APPROVE";
3571
+ /**
3572
+ * No registration required.
3573
+ */
3574
+ ZoomApprovalType[ZoomApprovalType["NO_REGISTRATION_REQUIRED"] = 2] = "NO_REGISTRATION_REQUIRED";
3575
+ })(ZoomApprovalType || (ZoomApprovalType = {}));
3576
+ var ZoomRegistrationType;
3577
+ (function (ZoomRegistrationType) {
3578
+ /**
3579
+ * Attendees register once and can attend any meeting occurrence.
3580
+ */
3581
+ ZoomRegistrationType[ZoomRegistrationType["REGISTER_ONCE_ATTEND_ANY"] = 1] = "REGISTER_ONCE_ATTEND_ANY";
3582
+ /**
3583
+ * Attendees must register for each meeting occurrence.
3584
+ */
3585
+ ZoomRegistrationType[ZoomRegistrationType["REGISTER_FOR_EACH_OCCURRENCE"] = 2] = "REGISTER_FOR_EACH_OCCURRENCE";
3586
+ /**
3587
+ * Attendees register once and can select one or more meeting occurrences to attend.
3588
+ */
3589
+ ZoomRegistrationType[ZoomRegistrationType["REGISTER_ONCE_CHOOSE_OCCURRENCES"] = 3] = "REGISTER_ONCE_CHOOSE_OCCURRENCES";
3590
+ })(ZoomRegistrationType || (ZoomRegistrationType = {}));
3591
+
3592
+ /**
3593
+ * https://developers.zoom.us/docs/api/users/#tag/users/GET/users/{userId}
3594
+ *
3595
+ * @param context
3596
+ * @returns
3597
+ */
3598
+ function getUser(context) {
3599
+ return input => context.fetchJson(`/users/${input.userId}`, 'GET');
3600
+ }
3601
+ /**
3602
+ * https://developers.zoom.us/docs/api/users/#tag/users/GET/users
3603
+ *
3604
+ * @param context
3605
+ * @returns
3606
+ */
3607
+ function listUsers(context) {
3608
+ return input => context.fetchJson(`/users?${makeUrlSearchParams(input)}`, 'GET').then(mapToZoomPageResult('users'));
3609
+ }
3610
+ function listUsersPageFactory(context) {
3611
+ return zoomFetchPageFactory(listUsers(context));
3612
+ }
3613
+
3614
+ var ZoomUserType;
3615
+ (function (ZoomUserType) {
3616
+ ZoomUserType[ZoomUserType["Basic"] = 1] = "Basic";
3617
+ ZoomUserType[ZoomUserType["Licensed"] = 2] = "Licensed";
3618
+ ZoomUserType[ZoomUserType["Unassigned"] = 4] = "Unassigned";
3619
+ ZoomUserType[ZoomUserType["None"] = 99] = "None";
3620
+ })(ZoomUserType || (ZoomUserType = {}));
3621
+
3622
+ // MARK: Parser
3623
+ const logZoomErrorToConsole = logZoomServerErrorFunction('Zoom');
3624
+ async function parseZoomApiError(responseError) {
3625
+ const data = await responseError.response.json().catch(x => undefined);
3626
+ let result;
3627
+ if (data) {
3628
+ result = parseZoomApiServerErrorResponseData(data, responseError);
3629
+ }
3630
+ return result;
3631
+ }
3632
+ function parseZoomApiServerErrorResponseData(zoomServerError, responseError) {
3633
+ let result;
3634
+ if (zoomServerError) {
3635
+ switch (zoomServerError.code) {
3636
+ default:
3637
+ result = parseZoomServerErrorData(zoomServerError, responseError);
3638
+ break;
3639
+ }
3640
+ }
3641
+ return result;
3642
+ }
3643
+ const handleZoomErrorFetch = handleZoomErrorFetchFactory(parseZoomApiError, logZoomErrorToConsole);
3644
+
3645
+ /**
3646
+ * Error in the following cases:
3647
+ * - the refresh token string is invalid
3648
+ */
3649
+ const ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE = 'invalid_grant';
3650
+ /**
3651
+ * Thrown if the call to the Zoom API creating an access token using a refresh token fails.
3652
+ */
3653
+ class ZoomOAuthAccessTokenError extends FetchRequestFactoryError {
3654
+ constructor(errorCode) {
3655
+ super(`ZoomOAuthAccessTokenError: ${errorCode}`);
3656
+ this.errorCode = void 0;
3657
+ this.errorCode = errorCode;
3658
+ }
3659
+ }
3660
+ /**
3661
+ * Thrown if a valid ZoomAccessToken cannot be retrieved successfully.
3662
+ */
3663
+ class ZoomOAuthAuthFailureError extends FetchRequestFactoryError {
3664
+ constructor(reason) {
3665
+ super(`Failed to retrieve proper authentication for the API call. Reason: ${reason}`);
3666
+ this.reason = void 0;
3667
+ this.reason = reason;
3668
+ }
3669
+ }
3670
+ const logZoomOAuthErrorToConsole = logZoomServerErrorFunction('ZoomOAuth');
3671
+ async function parseZoomOAuthError(responseError) {
3672
+ const data = await responseError.response.json().catch(x => undefined);
3673
+ let result;
3674
+ if (data) {
3675
+ result = parseZoomOAuthServerErrorResponseData(data, responseError);
3676
+ }
3677
+ return result;
3678
+ }
3679
+ function parseZoomOAuthServerErrorResponseData(zoomServerError, responseError) {
3680
+ let result;
3681
+ if (zoomServerError) {
3682
+ const potentialErrorStringCode = zoomServerError.error;
3683
+ const errorCode = potentialErrorStringCode != null ? potentialErrorStringCode : zoomServerError.code;
3684
+ switch (errorCode) {
3685
+ case ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE:
3686
+ result = new ZoomOAuthAccessTokenError(errorCode);
3687
+ break;
3688
+ default:
3689
+ result = parseZoomServerErrorData(zoomServerError, responseError);
3690
+ break;
3691
+ }
3692
+ }
3693
+ return result;
3694
+ }
3695
+ const handleZoomOAuthErrorFetch = handleZoomErrorFetchFactory(parseZoomOAuthError, logZoomOAuthErrorToConsole);
3696
+
3697
+ /**
3698
+ * Generates a new ZoomAccessTokenStringFactory.
3699
+ */
3700
+ function zoomAccessTokenStringFactory(zoomAccessTokenFactory) {
3701
+ return async () => {
3702
+ const token = await zoomAccessTokenFactory();
3703
+ if (!(token != null && token.accessToken)) {
3704
+ throw new ZoomOAuthAuthFailureError();
3705
+ }
3706
+ return token.accessToken;
3707
+ };
3708
+ }
3709
+
3710
+ const DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION = headers => {
3711
+ console.warn(`zoomRateLimitedFetchHandler(): Too many requests made. The limit is ${headers.limit} requests per reset period. RetryAt is set for ${headers.retryAfterAt}.`);
3712
+ };
3713
+ function zoomRateLimitedFetchHandler(config) {
3714
+ var _config$onTooManyRequ, _config$maxRateLimit, _config$resetPeriod;
3715
+ const onTooManyRequests = (config == null ? void 0 : config.onTooManyRequests) !== false ? (_config$onTooManyRequ = config == null ? void 0 : config.onTooManyRequests) != null ? _config$onTooManyRequ : DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION : undefined;
3716
+ const defaultLimit = (_config$maxRateLimit = config == null ? void 0 : config.maxRateLimit) != null ? _config$maxRateLimit : DEFAULT_ZOOM_API_RATE_LIMIT;
3717
+ const defaultResetPeriod = (_config$resetPeriod = config == null ? void 0 : config.resetPeriod) != null ? _config$resetPeriod : DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD;
3718
+ function configForLimit(limit, resetAt) {
3719
+ return {
3720
+ limit: defaultLimit,
3721
+ startLimitAt: Math.ceil(limit / 10),
3722
+ // can do 10% of the requests of the limit before rate limiting begins
3723
+ cooldownRate: 1.2 * (limit / (defaultResetPeriod / MS_IN_SECOND)),
3724
+ exponentRate: 1.08,
3725
+ maxWaitTime: MS_IN_SECOND * 10,
3726
+ resetPeriod: defaultResetPeriod,
3727
+ resetAt
3728
+ };
3729
+ }
3730
+ const defaultConfig = configForLimit(defaultLimit);
3731
+ const rateLimiter = resetPeriodPromiseRateLimiter(defaultConfig);
3732
+ return rateLimitedFetchHandler({
3733
+ rateLimiter,
3734
+ updateWithResponse: function (response, fetchResponseError) {
3735
+ const hasLimitHeader = response.headers.has(ZOOM_RATE_LIMIT_REMAINING_HEADER);
3736
+ let shouldRetry = false;
3737
+ let enabled = false;
3738
+ if (hasLimitHeader) {
3739
+ const headerDetails = zoomRateLimitHeaderDetails(response.headers);
3740
+ if (headerDetails) {
3741
+ const {
3742
+ limit,
3743
+ retryAfterAt,
3744
+ remaining
3745
+ } = headerDetails;
3746
+ if (limit !== defaultLimit) {
3747
+ const newConfig = configForLimit(limit, retryAfterAt);
3748
+ rateLimiter.setConfig(newConfig, false);
3749
+ }
3750
+ rateLimiter.setRemainingLimit(remaining);
3751
+ rateLimiter.setNextResetAt(retryAfterAt);
3752
+ enabled = true;
3753
+ // only retry if it's a TOO MANY REQUESTS error
3754
+ if (response.status === ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE) {
3755
+ shouldRetry = true;
3756
+ try {
3757
+ onTooManyRequests == null || onTooManyRequests(headerDetails, response, fetchResponseError);
3758
+ } catch (e) {}
3759
+ }
3760
+ }
3761
+ }
3762
+ rateLimiter.setEnabled(enabled);
3763
+ return shouldRetry;
3764
+ }
3765
+ });
3766
+ }
3767
+
3768
+ /**
3769
+ * The Zoom API URL for the US datacenter.
3770
+ */
3771
+ const ZOOM_API_URL = 'https://api.zoom.us/v2';
3772
+
3773
+ function zoomFactory(factoryConfig) {
3774
+ const {
3775
+ oauthContext
3776
+ } = factoryConfig;
3777
+ const serverAccessTokenStringFactory = zoomAccessTokenStringFactory(oauthContext.loadAccessToken);
3778
+ const fetchHandler = zoomRateLimitedFetchHandler(factoryConfig.rateLimiterConfig);
3779
+ const {
3780
+ logZoomServerErrorFunction,
3781
+ fetchFactory = input => fetchApiFetchService.makeFetch({
3782
+ baseUrl: ZOOM_API_URL,
3783
+ baseRequest: async () => ({
3784
+ headers: {
3785
+ 'Content-Type': 'application/json',
3786
+ Authorization: `Bearer ${await input.zoomAccessTokenStringFactory()}`
3787
+ }
3788
+ }),
3789
+ fetchHandler,
3790
+ timeout: 20 * 1000,
3791
+ // 20 second timeout
3792
+ requireOkResponse: true,
3793
+ // enforce ok response
3794
+ useTimeout: true // use timeout
3795
+ })
3796
+ } = factoryConfig;
3797
+ return config => {
3798
+ const baseFetch = fetchFactory({
3799
+ zoomAccessTokenStringFactory: serverAccessTokenStringFactory
3800
+ });
3801
+ const serverFetch = handleZoomErrorFetch(baseFetch, logZoomServerErrorFunction);
3802
+ const serverFetchJson = fetchJsonFunction(serverFetch, {
3803
+ handleFetchJsonParseErrorFunction: returnNullHandleFetchJsonParseErrorFunction
3804
+ });
3805
+ // MARK: Make User Context
3806
+ const makeUserContext = input => {
3807
+ const userAccessTokenFactory = oauthContext.makeUserAccessTokenFactory({
3808
+ refreshToken: input.refreshToken,
3809
+ userAccessTokenCache: input.accessTokenCache
3810
+ });
3811
+ const userAccessTokenStringFactory = zoomAccessTokenStringFactory(userAccessTokenFactory);
3812
+ const userFetch = fetchFactory({
3813
+ zoomAccessTokenStringFactory: userAccessTokenStringFactory
3814
+ });
3815
+ const userFetchJson = fetchJsonFunction(userFetch, {
3816
+ handleFetchJsonParseErrorFunction: returnNullHandleFetchJsonParseErrorFunction
3817
+ });
3818
+ const result = {
3819
+ zoomServerContext: zoomContext,
3820
+ type: 'user',
3821
+ fetch: userFetch,
3822
+ fetchJson: userFetchJson,
3823
+ userFetch,
3824
+ userFetchJson,
3825
+ zoomRateLimiter: fetchHandler._rateLimiter
3826
+ };
3827
+ return result;
3828
+ };
3829
+ const zoomContext = {
3830
+ type: 'server',
3831
+ fetch: serverFetch,
3832
+ fetchJson: serverFetchJson,
3833
+ serverFetch,
3834
+ serverFetchJson,
3835
+ makeUserContext,
3836
+ config,
3837
+ zoomRateLimiter: fetchHandler._rateLimiter
3838
+ };
3839
+ const zoom = {
3840
+ zoomServerContext: zoomContext
3841
+ };
3842
+ return zoom;
3843
+ };
3844
+ }
3845
+
3846
+ var anObject$1 = anObject$c;
3847
+
3848
+ // `RegExp.prototype.flags` getter implementation
3849
+ // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
3850
+ var regexpFlags = function () {
3851
+ var that = anObject$1(this);
3852
+ var result = '';
3853
+ if (that.hasIndices) result += 'd';
3854
+ if (that.global) result += 'g';
3855
+ if (that.ignoreCase) result += 'i';
3856
+ if (that.multiline) result += 'm';
3857
+ if (that.dotAll) result += 's';
3858
+ if (that.unicode) result += 'u';
3859
+ if (that.unicodeSets) result += 'v';
3860
+ if (that.sticky) result += 'y';
3861
+ return result;
3862
+ };
3863
+
3864
+ var call = functionCall;
3865
+ var hasOwn$1 = hasOwnProperty_1;
3866
+ var isPrototypeOf$1 = objectIsPrototypeOf;
3867
+ var regExpFlags = regexpFlags;
3868
+
3869
+ var RegExpPrototype$1 = RegExp.prototype;
3870
+
3871
+ var regexpGetFlags = function (R) {
3872
+ var flags = R.flags;
3873
+ return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$1(R, 'flags') && isPrototypeOf$1(RegExpPrototype$1, R)
3874
+ ? call(regExpFlags, R) : flags;
3875
+ };
3876
+
3877
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
3878
+ var defineBuiltIn = defineBuiltIn$6;
3879
+ var anObject = anObject$c;
3880
+ var $toString = toString$2;
3881
+ var fails$1 = fails$h;
3882
+ var getRegExpFlags = regexpGetFlags;
3883
+
3884
+ var TO_STRING = 'toString';
3885
+ var RegExpPrototype = RegExp.prototype;
3886
+ var nativeToString = RegExpPrototype[TO_STRING];
3887
+
3888
+ var NOT_GENERIC = fails$1(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
3889
+ // FF44- RegExp#toString has a wrong name
3890
+ var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
3891
+
3892
+ // `RegExp.prototype.toString` method
3893
+ // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
3894
+ if (NOT_GENERIC || INCORRECT_NAME) {
3895
+ defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
3896
+ var R = anObject(this);
3897
+ var pattern = $toString(R.source);
3898
+ var flags = $toString(getRegExpFlags(R));
3899
+ return '/' + pattern + '/' + flags;
3900
+ }, { unsafe: true });
3901
+ }
3902
+
3903
+ /**
3904
+ * Retrieves a new AccessToken for Server to Server authentication.
3905
+ *
3906
+ * @param context
3907
+ * @returns
3908
+ */
3909
+ function serverAccessToken(context) {
3910
+ return input => {
3911
+ var _input$accountId;
3912
+ return context.fetchJson(`/token?grant_type=account_credentials&account_id=${(_input$accountId = input == null ? void 0 : input.accountId) != null ? _input$accountId : context.config.accountId}`, zoomOAuthApiFetchJsonInput(context, input));
3913
+ };
3914
+ }
3915
+ /**
3916
+ * Retrieves a new AccessToken for a user using their refresh token.
3917
+ *
3918
+ * @param context
3919
+ * @returns
3920
+ */
3921
+ function userAccessToken(context) {
3922
+ return input => {
3923
+ const refreshToken = input.refreshToken;
3924
+ return context.fetchJson(`/token?grant_type=refresh_token&refresh_token=${refreshToken}`, zoomOAuthApiFetchJsonInput(context, input));
3925
+ };
3926
+ }
3927
+ function zoomOAuthApiFetchJsonInput(context, input) {
3928
+ var _input$client$clientI, _input$client, _input$client$clientS, _input$client2;
3929
+ const clientId = (_input$client$clientI = input == null || (_input$client = input.client) == null ? void 0 : _input$client.clientId) != null ? _input$client$clientI : context.config.clientId;
3930
+ const clientSecret = (_input$client$clientS = input == null || (_input$client2 = input.client) == null ? void 0 : _input$client2.clientSecret) != null ? _input$client$clientS : context.config.clientSecret;
3931
+ const fetchJsonInput = {
3932
+ headers: {
3933
+ Authorization: zoomOAuthServerBasicAuthorizationHeaderValue({
3934
+ clientId,
3935
+ clientSecret
3936
+ })
3937
+ },
3938
+ method: 'POST'
3939
+ };
3940
+ return fetchJsonInput;
3941
+ }
3942
+ function zoomOAuthServerBasicAuthorizationHeaderValue(input) {
3943
+ return `Basic ${Buffer.from(`${input.clientId}:${input.clientSecret}`).toString('base64')}`;
3944
+ }
3945
+
3946
+ /**
3947
+ * The Zoom OAuth API URL for the US datacenter.
3948
+ */
3949
+ const ZOOM_OAUTH_API_URL = 'https://zoom.us/oauth';
3950
+
3951
+ var defineProperty = objectDefineProperty.f;
3952
+
3953
+ var proxyAccessor$1 = function (Target, Source, key) {
3954
+ key in Target || defineProperty(Target, key, {
3955
+ configurable: true,
3956
+ get: function () { return Source[key]; },
3957
+ set: function (it) { Source[key] = it; }
3958
+ });
3959
+ };
3960
+
3961
+ var isCallable = isCallable$m;
3962
+ var isObject$1 = isObject$c;
3963
+ var setPrototypeOf$1 = objectSetPrototypeOf;
3964
+
3965
+ // makes subclassing work correct for wrapped built-ins
3966
+ var inheritIfRequired$1 = function ($this, dummy, Wrapper) {
3967
+ var NewTarget, NewTargetPrototype;
3968
+ if (
3969
+ // it can work only with native `setPrototypeOf`
3970
+ setPrototypeOf$1 &&
3971
+ // we haven't completely correct pre-ES6 way for getting `new.target`, so use this
3972
+ isCallable(NewTarget = dummy.constructor) &&
3973
+ NewTarget !== Wrapper &&
3974
+ isObject$1(NewTargetPrototype = NewTarget.prototype) &&
3975
+ NewTargetPrototype !== Wrapper.prototype
3976
+ ) setPrototypeOf$1($this, NewTargetPrototype);
3977
+ return $this;
3978
+ };
3979
+
3980
+ var toString = toString$2;
3981
+
3982
+ var normalizeStringArgument$1 = function (argument, $default) {
3983
+ return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
3984
+ };
3985
+
3986
+ var isObject = isObject$c;
3987
+ var createNonEnumerableProperty$2 = createNonEnumerableProperty$7;
3988
+
3989
+ // `InstallErrorCause` abstract operation
3990
+ // https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause
3991
+ var installErrorCause$1 = function (O, options) {
3992
+ if (isObject(options) && 'cause' in options) {
3993
+ createNonEnumerableProperty$2(O, 'cause', options.cause);
3994
+ }
3995
+ };
3996
+
3997
+ var uncurryThis = functionUncurryThis;
3998
+
3999
+ var $Error = Error;
4000
+ var replace = uncurryThis(''.replace);
4001
+
4002
+ var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
4003
+ // eslint-disable-next-line redos/no-vulnerable -- safe
4004
+ var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
4005
+ var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
4006
+
4007
+ var errorStackClear = function (stack, dropEntries) {
4008
+ if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
4009
+ while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
4010
+ } return stack;
4011
+ };
4012
+
4013
+ var fails = fails$h;
4014
+ var createPropertyDescriptor = createPropertyDescriptor$4;
4015
+
4016
+ var errorStackInstallable = !fails(function () {
4017
+ var error = new Error('a');
4018
+ if (!('stack' in error)) return true;
4019
+ // eslint-disable-next-line es/no-object-defineproperty -- safe
4020
+ Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
4021
+ return error.stack !== 7;
4022
+ });
4023
+
4024
+ var createNonEnumerableProperty$1 = createNonEnumerableProperty$7;
4025
+ var clearErrorStack = errorStackClear;
4026
+ var ERROR_STACK_INSTALLABLE = errorStackInstallable;
4027
+
4028
+ // non-standard V8
4029
+ var captureStackTrace = Error.captureStackTrace;
4030
+
4031
+ var errorStackInstall = function (error, C, stack, dropEntries) {
4032
+ if (ERROR_STACK_INSTALLABLE) {
4033
+ if (captureStackTrace) captureStackTrace(error, C);
4034
+ else createNonEnumerableProperty$1(error, 'stack', clearErrorStack(stack, dropEntries));
4035
+ }
4036
+ };
4037
+
4038
+ var getBuiltIn = getBuiltIn$a;
4039
+ var hasOwn = hasOwnProperty_1;
4040
+ var createNonEnumerableProperty = createNonEnumerableProperty$7;
4041
+ var isPrototypeOf = objectIsPrototypeOf;
4042
+ var setPrototypeOf = objectSetPrototypeOf;
4043
+ var copyConstructorProperties = copyConstructorProperties$2;
4044
+ var proxyAccessor = proxyAccessor$1;
4045
+ var inheritIfRequired = inheritIfRequired$1;
4046
+ var normalizeStringArgument = normalizeStringArgument$1;
4047
+ var installErrorCause = installErrorCause$1;
4048
+ var installErrorStack = errorStackInstall;
4049
+ var DESCRIPTORS = descriptors;
4050
+
4051
+ var wrapErrorConstructorWithCause$1 = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
4052
+ var STACK_TRACE_LIMIT = 'stackTraceLimit';
4053
+ var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
4054
+ var path = FULL_NAME.split('.');
4055
+ var ERROR_NAME = path[path.length - 1];
4056
+ var OriginalError = getBuiltIn.apply(null, path);
4057
+
4058
+ if (!OriginalError) return;
4059
+
4060
+ var OriginalErrorPrototype = OriginalError.prototype;
4061
+
4062
+ // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
4063
+ if (hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
4064
+
4065
+ if (!FORCED) return OriginalError;
4066
+
4067
+ var BaseError = getBuiltIn('Error');
4068
+
4069
+ var WrappedError = wrapper(function (a, b) {
4070
+ var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
4071
+ var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
4072
+ if (message !== undefined) createNonEnumerableProperty(result, 'message', message);
4073
+ installErrorStack(result, WrappedError, result.stack, 2);
4074
+ if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
4075
+ if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
4076
+ return result;
4077
+ });
4078
+
4079
+ WrappedError.prototype = OriginalErrorPrototype;
4080
+
4081
+ if (ERROR_NAME !== 'Error') {
4082
+ if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);
4083
+ else copyConstructorProperties(WrappedError, BaseError, { name: true });
4084
+ } else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {
4085
+ proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
4086
+ proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
4087
+ }
4088
+
4089
+ copyConstructorProperties(WrappedError, OriginalError);
4090
+
4091
+ try {
4092
+ // Safari 13- bug: WebAssembly errors does not have a proper `.name`
4093
+ if (OriginalErrorPrototype.name !== ERROR_NAME) {
4094
+ createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);
4095
+ }
4096
+ OriginalErrorPrototype.constructor = WrappedError;
4097
+ } catch (error) { /* empty */ }
4098
+
4099
+ return WrappedError;
4100
+ };
4101
+
4102
+ /* eslint-disable no-unused-vars -- required for functions `.length` */
4103
+ var $ = _export;
4104
+ var global$1 = global$j;
4105
+ var apply = functionApply;
4106
+ var wrapErrorConstructorWithCause = wrapErrorConstructorWithCause$1;
4107
+
4108
+ var WEB_ASSEMBLY = 'WebAssembly';
4109
+ var WebAssembly = global$1[WEB_ASSEMBLY];
4110
+
4111
+ // eslint-disable-next-line es/no-error-cause -- feature detection
4112
+ var FORCED = new Error('e', { cause: 7 }).cause !== 7;
4113
+
4114
+ var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
4115
+ var O = {};
4116
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);
4117
+ $({ global: true, constructor: true, arity: 1, forced: FORCED }, O);
4118
+ };
4119
+
4120
+ var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
4121
+ if (WebAssembly && WebAssembly[ERROR_NAME]) {
4122
+ var O = {};
4123
+ O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);
4124
+ $({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);
4125
+ }
4126
+ };
4127
+
4128
+ // https://tc39.es/ecma262/#sec-nativeerror
4129
+ exportGlobalErrorCauseWrapper('Error', function (init) {
4130
+ return function Error(message) { return apply(init, this, arguments); };
4131
+ });
4132
+ exportGlobalErrorCauseWrapper('EvalError', function (init) {
4133
+ return function EvalError(message) { return apply(init, this, arguments); };
4134
+ });
4135
+ exportGlobalErrorCauseWrapper('RangeError', function (init) {
4136
+ return function RangeError(message) { return apply(init, this, arguments); };
4137
+ });
4138
+ exportGlobalErrorCauseWrapper('ReferenceError', function (init) {
4139
+ return function ReferenceError(message) { return apply(init, this, arguments); };
4140
+ });
4141
+ exportGlobalErrorCauseWrapper('SyntaxError', function (init) {
4142
+ return function SyntaxError(message) { return apply(init, this, arguments); };
4143
+ });
4144
+ exportGlobalErrorCauseWrapper('TypeError', function (init) {
4145
+ return function TypeError(message) { return apply(init, this, arguments); };
4146
+ });
4147
+ exportGlobalErrorCauseWrapper('URIError', function (init) {
4148
+ return function URIError(message) { return apply(init, this, arguments); };
4149
+ });
4150
+ exportWebAssemblyErrorCauseWrapper('CompileError', function (init) {
4151
+ return function CompileError(message) { return apply(init, this, arguments); };
4152
+ });
4153
+ exportWebAssemblyErrorCauseWrapper('LinkError', function (init) {
4154
+ return function LinkError(message) { return apply(init, this, arguments); };
4155
+ });
4156
+ exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
4157
+ return function RuntimeError(message) { return apply(init, this, arguments); };
4158
+ });
4159
+
4160
+ function zoomOAuthFactory(factoryConfig) {
4161
+ const fetchHandler = zoomRateLimitedFetchHandler();
4162
+ const {
4163
+ logZoomServerErrorFunction,
4164
+ fetchFactory = _ => fetchApiFetchService.makeFetch({
4165
+ baseUrl: ZOOM_OAUTH_API_URL,
4166
+ baseRequest: {
4167
+ headers: {
4168
+ 'Content-Type': 'application/json'
4169
+ }
4170
+ },
4171
+ fetchHandler,
4172
+ timeout: 20 * 1000,
4173
+ // 20 second timeout
4174
+ requireOkResponse: true,
4175
+ // enforce ok response
4176
+ useTimeout: true // use timeout
4177
+ })
4178
+ } = factoryConfig;
4179
+ return config => {
4180
+ if (!config.clientId) {
4181
+ throw new Error('ZoomOAuthConfig missing clientId.');
4182
+ } else if (!config.clientSecret) {
4183
+ throw new Error('ZoomOAuthConfig missing clientSecret.');
4184
+ } else if (!config.accountId) {
4185
+ throw new Error('ZoomOAuthConfig missing accountId.');
4186
+ }
4187
+ const baseFetch = fetchFactory();
4188
+ const fetch = handleZoomOAuthErrorFetch(baseFetch, logZoomServerErrorFunction);
4189
+ const fetchJson = fetchJsonFunction(fetch, {
4190
+ handleFetchJsonParseErrorFunction: returnNullHandleFetchJsonParseErrorFunction
4191
+ });
4192
+ function accessTokenFromTokenResponse(result) {
4193
+ const createdAt = new Date().getTime();
4194
+ const {
4195
+ access_token,
4196
+ api_url,
4197
+ scope,
4198
+ expires_in
4199
+ } = result;
4200
+ const accessToken = {
4201
+ accessToken: access_token,
4202
+ apiDomain: api_url,
4203
+ expiresIn: expires_in,
4204
+ expiresAt: new Date(createdAt + expires_in * MS_IN_SECOND),
4205
+ scope
4206
+ };
4207
+ return accessToken;
4208
+ }
4209
+ const tokenRefresher = async () => {
4210
+ const accessToken = await serverAccessToken(oauthContext)();
4211
+ return accessTokenFromTokenResponse(accessToken);
4212
+ };
4213
+ const loadAccessToken = zoomOAuthZoomAccessTokenFactory({
4214
+ tokenRefresher,
4215
+ accessTokenCache: config.accessTokenCache
4216
+ });
4217
+ // User Access Token
4218
+ const makeUserAccessTokenFactory = input => {
4219
+ const userTokenRefresher = async () => {
4220
+ const accessToken = await userAccessToken(oauthContext)(input);
4221
+ return accessTokenFromTokenResponse(accessToken);
4222
+ };
4223
+ return zoomOAuthZoomAccessTokenFactory({
4224
+ tokenRefresher: userTokenRefresher,
4225
+ accessTokenCache: input.userAccessTokenCache
4226
+ });
4227
+ };
4228
+ const oauthContext = {
4229
+ fetch,
4230
+ fetchJson,
4231
+ loadAccessToken,
4232
+ makeUserAccessTokenFactory,
4233
+ config
4234
+ };
4235
+ const zoomOAuth = {
4236
+ oauthContext
4237
+ };
4238
+ return zoomOAuth;
4239
+ };
4240
+ }
4241
+ /**
4242
+ * Creates a ZoomOAuthZoomAccessTokenFactoryConfig
4243
+ *
4244
+ * @param config
4245
+ * @returns
4246
+ */
4247
+ function zoomOAuthZoomAccessTokenFactory(config) {
4248
+ const {
4249
+ tokenRefresher,
4250
+ accessTokenCache,
4251
+ tokenExpirationBuffer: inputTokenExpirationBuffer
4252
+ } = config;
4253
+ const tokenExpirationBuffer = inputTokenExpirationBuffer != null ? inputTokenExpirationBuffer : MS_IN_MINUTE;
4254
+ /**
4255
+ * Caches the token internally here until it expires.
4256
+ */
4257
+ let currentToken = null;
4258
+ return async () => {
4259
+ // load from cache
4260
+ if (!currentToken) {
4261
+ const cachedToken = await (accessTokenCache == null ? void 0 : accessTokenCache.loadCachedToken());
4262
+ if (cachedToken) {
4263
+ currentToken = cachedToken;
4264
+ }
4265
+ }
4266
+ // check expiration
4267
+ if (currentToken != null) {
4268
+ const isExpired = new Date().getTime() + tokenExpirationBuffer >= currentToken.expiresAt.getTime();
4269
+ if (isExpired) {
4270
+ currentToken = null;
4271
+ }
4272
+ }
4273
+ // load from source
4274
+ if (!currentToken) {
4275
+ try {
4276
+ currentToken = await tokenRefresher();
4277
+ } catch (e) {
4278
+ console.error(`zoomOAuthZoomAccessTokenFactory(): Failed retrieving new token from tokenRefresher: `, e);
4279
+ throw new ZoomOAuthAuthFailureError('Token Refresh Failed');
4280
+ }
4281
+ if (currentToken) {
4282
+ try {
4283
+ await (accessTokenCache == null ? void 0 : accessTokenCache.updateCachedToken(currentToken));
4284
+ } catch (e) {
4285
+ // do nothing
4286
+ }
4287
+ }
4288
+ }
4289
+ return currentToken;
4290
+ };
4291
+ }
4292
+
4293
+ export { DEFAULT_ZOOM_API_RATE_LIMIT, DEFAULT_ZOOM_API_RATE_LIMIT_RESET_PERIOD, DEFAULT_ZOOM_RATE_LIMITED_TOO_MANY_REQUETS_LOG_FUNCTION, DELETE_MEETING_DOES_NOT_EXIST_ERROR_CODE, ZOOM_ACCOUNTS_INVALID_GRANT_ERROR_CODE, ZOOM_API_URL, ZOOM_OAUTH_API_URL, ZOOM_RATE_LIMIT_CATEGORY_HEADER, ZOOM_RATE_LIMIT_LIMIT_HEADER, ZOOM_RATE_LIMIT_REMAINING_HEADER, ZOOM_RATE_LIMIT_RETRY_AFTER_HEADER, ZOOM_RATE_LIMIT_TYPE_HEADER, ZOOM_SUCCESS_CODE, ZOOM_TOO_MANY_REQUESTS_HTTP_STATUS_CODE, ZoomApprovalType, ZoomMeetingType, ZoomMonthlyWeek, ZoomMonthlyWeekDay, ZoomOAuthAccessTokenError, ZoomOAuthAuthFailureError, ZoomRecurrenceType, ZoomRegistrationType, ZoomServerError, ZoomServerFetchResponseError, ZoomTooManyRequestsError, ZoomUserType, createMeetingForUser, deleteMeeting, getMeeting, getUser, handleZoomErrorFetch, handleZoomErrorFetchFactory, handleZoomOAuthErrorFetch, listMeetingsForUser, listMeetingsForUserPageFactory, listUsers, listUsersPageFactory, logZoomErrorToConsole, logZoomOAuthErrorToConsole, logZoomServerErrorFunction, mapToZoomPageResult, omitSilenceZoomErrorKeys, parseZoomApiError, parseZoomApiServerErrorResponseData, parseZoomOAuthError, parseZoomOAuthServerErrorResponseData, parseZoomServerErrorData, serverAccessToken, silenceZoomErrorWithCodesFunction, userAccessToken, zoomAccessTokenStringFactory, zoomFactory, zoomFetchPageFactory, zoomOAuthApiFetchJsonInput, zoomOAuthFactory, zoomOAuthServerBasicAuthorizationHeaderValue, zoomOAuthZoomAccessTokenFactory, zoomRateLimitHeaderDetails, zoomRateLimitedFetchHandler };