@vonage/vivid 3.0.0-next.2 → 3.0.0-next.20

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 (122) hide show
  1. package/README.md +49 -4
  2. package/accordion/index.js +61 -0
  3. package/accordion-item/index.js +120 -0
  4. package/action-group/index.js +34 -0
  5. package/badge/index.js +24 -22
  6. package/banner/index.js +148 -0
  7. package/breadcrumb/index.js +102 -0
  8. package/breadcrumb-item/index.js +14 -9
  9. package/button/index.js +36 -663
  10. package/calendar/index.js +1526 -0
  11. package/card/index.js +139 -0
  12. package/elevation/index.js +8 -15
  13. package/fab/index.js +94 -0
  14. package/focus/index.js +20 -3
  15. package/icon/index.js +38 -5
  16. package/index.d.ts +1 -0
  17. package/index.js +43 -12
  18. package/layout/index.js +5 -5
  19. package/lib/accordion/accordion.d.ts +9 -0
  20. package/lib/accordion/accordion.template.d.ts +4 -0
  21. package/lib/accordion/index.d.ts +2 -0
  22. package/lib/accordion-item/accordion-item.d.ts +13 -0
  23. package/lib/accordion-item/accordion-item.template.d.ts +4 -0
  24. package/lib/accordion-item/index.d.ts +3 -0
  25. package/lib/action-group/action-group.d.ts +9 -0
  26. package/lib/action-group/action-group.template.d.ts +4 -0
  27. package/lib/action-group/index.d.ts +2 -0
  28. package/lib/badge/badge.d.ts +8 -8
  29. package/lib/badge/index.d.ts +1 -1
  30. package/lib/banner/banner.d.ts +20 -0
  31. package/lib/banner/banner.template.d.ts +6 -0
  32. package/lib/banner/index.d.ts +2 -0
  33. package/lib/breadcrumb/breadcrumb.d.ts +3 -0
  34. package/lib/breadcrumb/index.d.ts +2 -0
  35. package/lib/breadcrumb-item/breadcrumb-item.d.ts +3 -3
  36. package/lib/breadcrumb-item/breadcrumb-item.template.d.ts +0 -1
  37. package/lib/breadcrumb-item/index.d.ts +1 -0
  38. package/lib/button/button.d.ts +9 -8
  39. package/lib/button/index.d.ts +2 -19
  40. package/lib/calendar/calendar.d.ts +11 -0
  41. package/lib/calendar/calendar.template.d.ts +4 -0
  42. package/lib/calendar/helpers/calendar.date-functions.d.ts +2 -0
  43. package/lib/calendar/helpers/calendar.event-context.d.ts +6 -0
  44. package/lib/calendar/helpers/calendar.keyboard-interactions.d.ts +9 -0
  45. package/lib/calendar/index.d.ts +3 -0
  46. package/lib/card/card.d.ts +10 -0
  47. package/lib/card/card.template.d.ts +4 -0
  48. package/lib/card/index.d.ts +5 -0
  49. package/lib/components.d.ts +19 -3
  50. package/lib/elevation/elevation.d.ts +1 -1
  51. package/lib/elevation/index.d.ts +1 -1
  52. package/lib/enums.d.ts +14 -7
  53. package/lib/fab/fab.d.ts +10 -0
  54. package/lib/fab/fab.template.d.ts +4 -0
  55. package/lib/fab/index.d.ts +4 -0
  56. package/lib/focus/index.d.ts +1 -1
  57. package/lib/icon/icon.d.ts +4 -5
  58. package/lib/layout/index.d.ts +1 -1
  59. package/lib/layout/layout.d.ts +3 -3
  60. package/lib/note/index.d.ts +2 -0
  61. package/lib/note/note.d.ts +10 -0
  62. package/lib/note/note.template.d.ts +5 -0
  63. package/lib/popup/index.d.ts +4 -0
  64. package/lib/popup/popup.d.ts +17 -0
  65. package/lib/popup/popup.template.d.ts +4 -0
  66. package/lib/progress/index.d.ts +2 -0
  67. package/lib/progress/progress.d.ts +9 -0
  68. package/lib/progress/progress.template.d.ts +5 -0
  69. package/lib/progress-ring/index.d.ts +2 -0
  70. package/lib/progress-ring/progress-ring.d.ts +7 -0
  71. package/lib/progress-ring/progress-ring.template.d.ts +4 -0
  72. package/lib/side-drawer/index.d.ts +2 -0
  73. package/lib/side-drawer/side-drawer.d.ts +8 -0
  74. package/lib/side-drawer/side-drawer.template.d.ts +4 -0
  75. package/lib/sidenav-item/sidenav-item.d.ts +4 -5
  76. package/lib/text/index.d.ts +2 -0
  77. package/lib/text/text.d.ts +10 -0
  78. package/lib/text/text.template.d.ts +4 -0
  79. package/lib/text-anchor/text-anchor.d.ts +4 -1
  80. package/lib/text-field/index.d.ts +4 -0
  81. package/lib/text-field/text-field.d.ts +20 -0
  82. package/lib/text-field/text-field.template.d.ts +5 -0
  83. package/lib/tooltip/index.d.ts +3 -0
  84. package/lib/tooltip/tooltip.d.ts +8 -0
  85. package/lib/tooltip/tooltip.template.d.ts +4 -0
  86. package/note/index.js +65 -0
  87. package/package.json +33 -6
  88. package/popup/index.js +2106 -0
  89. package/progress/index.js +99 -0
  90. package/progress-ring/index.js +82 -0
  91. package/shared/_has.js +58 -0
  92. package/shared/affix.js +10 -25
  93. package/shared/anchor.js +11 -4
  94. package/shared/aria-global.js +20 -20
  95. package/shared/base-progress.js +70 -0
  96. package/shared/breadcrumb-item.js +25 -0
  97. package/shared/button.js +195 -0
  98. package/shared/enums.js +79 -0
  99. package/shared/es.object.assign.js +69 -0
  100. package/shared/focus.js +5 -0
  101. package/shared/focus2.js +468 -0
  102. package/shared/icon.js +1435 -0
  103. package/shared/index.js +4940 -1426
  104. package/shared/object-set-prototype-of.js +1030 -0
  105. package/shared/patterns/affix.d.ts +3 -4
  106. package/shared/patterns/focus.d.ts +3 -0
  107. package/shared/patterns/index.d.ts +1 -0
  108. package/shared/slotted.js +119 -0
  109. package/shared/text-anchor.js +12 -0
  110. package/shared/text-anchor.template.js +14 -19
  111. package/shared/web.dom-collections.iterator.js +46 -1051
  112. package/shared/when.js +15 -0
  113. package/side-drawer/index.js +82 -0
  114. package/sidenav-item/index.js +17 -57
  115. package/styles/themes/dark.css +16 -4
  116. package/styles/themes/light.css +16 -4
  117. package/text/index.js +46 -0
  118. package/text-anchor/index.js +7 -2
  119. package/text-field/index.js +389 -0
  120. package/tooltip/index.js +66 -0
  121. package/shared/index2.js +0 -4911
  122. package/shared/index3.js +0 -21
package/shared/icon.js ADDED
@@ -0,0 +1,1435 @@
1
+ import { A as classofRaw$1, z as global$8, w as wellKnownSymbol$8, B as getBuiltIn$5, a as objectDefineProperty, d as descriptors, C as objectIsPrototypeOf, j as isCallable$7, D as functionUncurryThis, g as fails$4, E as inspectSource$2, F as tryToString$3, b as anObject$5, G as functionBindNative, H as aCallable$6, I as engineUserAgent, c as html$1, f as documentCreateElement, i as hasOwnProperty_1, J as objectGetOwnPropertyDescriptor, K as isForced_1, L as engineV8Version, _ as _export, l as defineBuiltIn$3, q as objectSetPrototypeOf, n as setToStringTag$1, u as functionCall, M as isObject$2, y as internalState, p as iterators, N as getMethod$2, O as lengthOfArrayLike$1, P as requireObjectCoercible$1, x as functionName } from './object-set-prototype-of.js';
2
+ import { F as FoundationElement, _ as __decorate, a as attr, b as __metadata, o as observable } from './index.js';
3
+ import { _ as _curry1, a as _curry2, b as _has } from './_has.js';
4
+
5
+ var classof$4 = classofRaw$1;
6
+ var global$7 = global$8;
7
+
8
+ var engineIsNode = classof$4(global$7.process) == 'process';
9
+
10
+ var getBuiltIn$4 = getBuiltIn$5;
11
+ var definePropertyModule = objectDefineProperty;
12
+ var wellKnownSymbol$7 = wellKnownSymbol$8;
13
+ var DESCRIPTORS = descriptors;
14
+
15
+ var SPECIES$2 = wellKnownSymbol$7('species');
16
+
17
+ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
18
+ var Constructor = getBuiltIn$4(CONSTRUCTOR_NAME);
19
+ var defineProperty = definePropertyModule.f;
20
+
21
+ if (DESCRIPTORS && Constructor && !Constructor[SPECIES$2]) {
22
+ defineProperty(Constructor, SPECIES$2, {
23
+ configurable: true,
24
+ get: function () { return this; }
25
+ });
26
+ }
27
+ };
28
+
29
+ var isPrototypeOf$1 = objectIsPrototypeOf;
30
+
31
+ var $TypeError$4 = TypeError;
32
+
33
+ var anInstance$1 = function (it, Prototype) {
34
+ if (isPrototypeOf$1(Prototype, it)) return it;
35
+ throw $TypeError$4('Incorrect invocation');
36
+ };
37
+
38
+ var wellKnownSymbol$6 = wellKnownSymbol$8;
39
+
40
+ var TO_STRING_TAG$1 = wellKnownSymbol$6('toStringTag');
41
+ var test = {};
42
+
43
+ test[TO_STRING_TAG$1] = 'z';
44
+
45
+ var toStringTagSupport = String(test) === '[object z]';
46
+
47
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
48
+ var isCallable$6 = isCallable$7;
49
+ var classofRaw = classofRaw$1;
50
+ var wellKnownSymbol$5 = wellKnownSymbol$8;
51
+
52
+ var TO_STRING_TAG = wellKnownSymbol$5('toStringTag');
53
+ var $Object = Object;
54
+
55
+ // ES3 wrong here
56
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
57
+
58
+ // fallback for IE11 Script Access Denied error
59
+ var tryGet = function (it, key) {
60
+ try {
61
+ return it[key];
62
+ } catch (error) { /* empty */ }
63
+ };
64
+
65
+ // getting tag from ES6+ `Object.prototype.toString`
66
+ var classof$3 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
67
+ var O, tag, result;
68
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
69
+ // @@toStringTag case
70
+ : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
71
+ // builtinTag case
72
+ : CORRECT_ARGUMENTS ? classofRaw(O)
73
+ // ES3 arguments fallback
74
+ : (result = classofRaw(O)) == 'Object' && isCallable$6(O.callee) ? 'Arguments' : result;
75
+ };
76
+
77
+ var uncurryThis$3 = functionUncurryThis;
78
+ var fails$3 = fails$4;
79
+ var isCallable$5 = isCallable$7;
80
+ var classof$2 = classof$3;
81
+ var getBuiltIn$3 = getBuiltIn$5;
82
+ var inspectSource$1 = inspectSource$2;
83
+
84
+ var noop = function () { /* empty */ };
85
+ var empty = [];
86
+ var construct = getBuiltIn$3('Reflect', 'construct');
87
+ var constructorRegExp = /^\s*(?:class|function)\b/;
88
+ var exec = uncurryThis$3(constructorRegExp.exec);
89
+ var INCORRECT_TO_STRING = !constructorRegExp.exec(noop);
90
+
91
+ var isConstructorModern = function isConstructor(argument) {
92
+ if (!isCallable$5(argument)) return false;
93
+ try {
94
+ construct(noop, empty, argument);
95
+ return true;
96
+ } catch (error) {
97
+ return false;
98
+ }
99
+ };
100
+
101
+ var isConstructorLegacy = function isConstructor(argument) {
102
+ if (!isCallable$5(argument)) return false;
103
+ switch (classof$2(argument)) {
104
+ case 'AsyncFunction':
105
+ case 'GeneratorFunction':
106
+ case 'AsyncGeneratorFunction': return false;
107
+ }
108
+ try {
109
+ // we can't check .prototype since constructors produced by .bind haven't it
110
+ // `Function#toString` throws on some built-it function in some legacy engines
111
+ // (for example, `DOMQuad` and similar in FF41-)
112
+ return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource$1(argument));
113
+ } catch (error) {
114
+ return true;
115
+ }
116
+ };
117
+
118
+ isConstructorLegacy.sham = true;
119
+
120
+ // `IsConstructor` abstract operation
121
+ // https://tc39.es/ecma262/#sec-isconstructor
122
+ var isConstructor$1 = !construct || fails$3(function () {
123
+ var called;
124
+ return isConstructorModern(isConstructorModern.call)
125
+ || !isConstructorModern(Object)
126
+ || !isConstructorModern(function () { called = true; })
127
+ || called;
128
+ }) ? isConstructorLegacy : isConstructorModern;
129
+
130
+ var isConstructor = isConstructor$1;
131
+ var tryToString$2 = tryToString$3;
132
+
133
+ var $TypeError$3 = TypeError;
134
+
135
+ // `Assert: IsConstructor(argument) is true`
136
+ var aConstructor$1 = function (argument) {
137
+ if (isConstructor(argument)) return argument;
138
+ throw $TypeError$3(tryToString$2(argument) + ' is not a constructor');
139
+ };
140
+
141
+ var anObject$4 = anObject$5;
142
+ var aConstructor = aConstructor$1;
143
+ var wellKnownSymbol$4 = wellKnownSymbol$8;
144
+
145
+ var SPECIES$1 = wellKnownSymbol$4('species');
146
+
147
+ // `SpeciesConstructor` abstract operation
148
+ // https://tc39.es/ecma262/#sec-speciesconstructor
149
+ var speciesConstructor$2 = function (O, defaultConstructor) {
150
+ var C = anObject$4(O).constructor;
151
+ var S;
152
+ return C === undefined || (S = anObject$4(C)[SPECIES$1]) == undefined ? defaultConstructor : aConstructor(S);
153
+ };
154
+
155
+ var NATIVE_BIND$1 = functionBindNative;
156
+
157
+ var FunctionPrototype = Function.prototype;
158
+ var apply$1 = FunctionPrototype.apply;
159
+ var call$7 = FunctionPrototype.call;
160
+
161
+ // eslint-disable-next-line es-x/no-reflect -- safe
162
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$7.bind(apply$1) : function () {
163
+ return call$7.apply(apply$1, arguments);
164
+ });
165
+
166
+ var uncurryThis$2 = functionUncurryThis;
167
+ var aCallable$5 = aCallable$6;
168
+ var NATIVE_BIND = functionBindNative;
169
+
170
+ var bind$4 = uncurryThis$2(uncurryThis$2.bind);
171
+
172
+ // optional / simple context binding
173
+ var functionBindContext = function (fn, that) {
174
+ aCallable$5(fn);
175
+ return that === undefined ? fn : NATIVE_BIND ? bind$4(fn, that) : function (/* ...args */) {
176
+ return fn.apply(that, arguments);
177
+ };
178
+ };
179
+
180
+ var uncurryThis$1 = functionUncurryThis;
181
+
182
+ var arraySlice$1 = uncurryThis$1([].slice);
183
+
184
+ var $TypeError$2 = TypeError;
185
+
186
+ var validateArgumentsLength$1 = function (passed, required) {
187
+ if (passed < required) throw $TypeError$2('Not enough arguments');
188
+ return passed;
189
+ };
190
+
191
+ var userAgent$2 = engineUserAgent;
192
+
193
+ var engineIsIos = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent$2);
194
+
195
+ var global$6 = global$8;
196
+ var apply = functionApply;
197
+ var bind$3 = functionBindContext;
198
+ var isCallable$4 = isCallable$7;
199
+ var hasOwn = hasOwnProperty_1;
200
+ var fails$2 = fails$4;
201
+ var html = html$1;
202
+ var arraySlice = arraySlice$1;
203
+ var createElement = documentCreateElement;
204
+ var validateArgumentsLength = validateArgumentsLength$1;
205
+ var IS_IOS$1 = engineIsIos;
206
+ var IS_NODE$2 = engineIsNode;
207
+
208
+ var set = global$6.setImmediate;
209
+ var clear = global$6.clearImmediate;
210
+ var process$2 = global$6.process;
211
+ var Dispatch = global$6.Dispatch;
212
+ var Function$1 = global$6.Function;
213
+ var MessageChannel = global$6.MessageChannel;
214
+ var String$1 = global$6.String;
215
+ var counter = 0;
216
+ var queue$1 = {};
217
+ var ONREADYSTATECHANGE = 'onreadystatechange';
218
+ var location, defer, channel, port;
219
+
220
+ try {
221
+ // Deno throws a ReferenceError on `location` access without `--location` flag
222
+ location = global$6.location;
223
+ } catch (error) { /* empty */ }
224
+
225
+ var run = function (id) {
226
+ if (hasOwn(queue$1, id)) {
227
+ var fn = queue$1[id];
228
+ delete queue$1[id];
229
+ fn();
230
+ }
231
+ };
232
+
233
+ var runner = function (id) {
234
+ return function () {
235
+ run(id);
236
+ };
237
+ };
238
+
239
+ var listener = function (event) {
240
+ run(event.data);
241
+ };
242
+
243
+ var post = function (id) {
244
+ // old engines have not location.origin
245
+ global$6.postMessage(String$1(id), location.protocol + '//' + location.host);
246
+ };
247
+
248
+ // Node.js 0.9+ & IE10+ has setImmediate, otherwise:
249
+ if (!set || !clear) {
250
+ set = function setImmediate(handler) {
251
+ validateArgumentsLength(arguments.length, 1);
252
+ var fn = isCallable$4(handler) ? handler : Function$1(handler);
253
+ var args = arraySlice(arguments, 1);
254
+ queue$1[++counter] = function () {
255
+ apply(fn, undefined, args);
256
+ };
257
+ defer(counter);
258
+ return counter;
259
+ };
260
+ clear = function clearImmediate(id) {
261
+ delete queue$1[id];
262
+ };
263
+ // Node.js 0.8-
264
+ if (IS_NODE$2) {
265
+ defer = function (id) {
266
+ process$2.nextTick(runner(id));
267
+ };
268
+ // Sphere (JS game engine) Dispatch API
269
+ } else if (Dispatch && Dispatch.now) {
270
+ defer = function (id) {
271
+ Dispatch.now(runner(id));
272
+ };
273
+ // Browsers with MessageChannel, includes WebWorkers
274
+ // except iOS - https://github.com/zloirock/core-js/issues/624
275
+ } else if (MessageChannel && !IS_IOS$1) {
276
+ channel = new MessageChannel();
277
+ port = channel.port2;
278
+ channel.port1.onmessage = listener;
279
+ defer = bind$3(port.postMessage, port);
280
+ // Browsers with postMessage, skip WebWorkers
281
+ // IE8 has postMessage, but it's sync & typeof its postMessage is 'object'
282
+ } else if (
283
+ global$6.addEventListener &&
284
+ isCallable$4(global$6.postMessage) &&
285
+ !global$6.importScripts &&
286
+ location && location.protocol !== 'file:' &&
287
+ !fails$2(post)
288
+ ) {
289
+ defer = post;
290
+ global$6.addEventListener('message', listener, false);
291
+ // IE8-
292
+ } else if (ONREADYSTATECHANGE in createElement('script')) {
293
+ defer = function (id) {
294
+ html.appendChild(createElement('script'))[ONREADYSTATECHANGE] = function () {
295
+ html.removeChild(this);
296
+ run(id);
297
+ };
298
+ };
299
+ // Rest old browsers
300
+ } else {
301
+ defer = function (id) {
302
+ setTimeout(runner(id), 0);
303
+ };
304
+ }
305
+ }
306
+
307
+ var task$1 = {
308
+ set: set,
309
+ clear: clear
310
+ };
311
+
312
+ var userAgent$1 = engineUserAgent;
313
+ var global$5 = global$8;
314
+
315
+ var engineIsIosPebble = /ipad|iphone|ipod/i.test(userAgent$1) && global$5.Pebble !== undefined;
316
+
317
+ var userAgent = engineUserAgent;
318
+
319
+ var engineIsWebosWebkit = /web0s(?!.*chrome)/i.test(userAgent);
320
+
321
+ var global$4 = global$8;
322
+ var bind$2 = functionBindContext;
323
+ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
324
+ var macrotask = task$1.set;
325
+ var IS_IOS = engineIsIos;
326
+ var IS_IOS_PEBBLE = engineIsIosPebble;
327
+ var IS_WEBOS_WEBKIT = engineIsWebosWebkit;
328
+ var IS_NODE$1 = engineIsNode;
329
+
330
+ var MutationObserver = global$4.MutationObserver || global$4.WebKitMutationObserver;
331
+ var document$1 = global$4.document;
332
+ var process$1 = global$4.process;
333
+ var Promise$1 = global$4.Promise;
334
+ // Node.js 11 shows ExperimentalWarning on getting `queueMicrotask`
335
+ var queueMicrotaskDescriptor = getOwnPropertyDescriptor(global$4, 'queueMicrotask');
336
+ var queueMicrotask = queueMicrotaskDescriptor && queueMicrotaskDescriptor.value;
337
+
338
+ var flush, head, last, notify$1, toggle, node, promise, then;
339
+
340
+ // modern engines have queueMicrotask method
341
+ if (!queueMicrotask) {
342
+ flush = function () {
343
+ var parent, fn;
344
+ if (IS_NODE$1 && (parent = process$1.domain)) parent.exit();
345
+ while (head) {
346
+ fn = head.fn;
347
+ head = head.next;
348
+ try {
349
+ fn();
350
+ } catch (error) {
351
+ if (head) notify$1();
352
+ else last = undefined;
353
+ throw error;
354
+ }
355
+ } last = undefined;
356
+ if (parent) parent.enter();
357
+ };
358
+
359
+ // browsers with MutationObserver, except iOS - https://github.com/zloirock/core-js/issues/339
360
+ // also except WebOS Webkit https://github.com/zloirock/core-js/issues/898
361
+ if (!IS_IOS && !IS_NODE$1 && !IS_WEBOS_WEBKIT && MutationObserver && document$1) {
362
+ toggle = true;
363
+ node = document$1.createTextNode('');
364
+ new MutationObserver(flush).observe(node, { characterData: true });
365
+ notify$1 = function () {
366
+ node.data = toggle = !toggle;
367
+ };
368
+ // environments with maybe non-completely correct, but existent Promise
369
+ } else if (!IS_IOS_PEBBLE && Promise$1 && Promise$1.resolve) {
370
+ // Promise.resolve without an argument throws an error in LG WebOS 2
371
+ promise = Promise$1.resolve(undefined);
372
+ // workaround of WebKit ~ iOS Safari 10.1 bug
373
+ promise.constructor = Promise$1;
374
+ then = bind$2(promise.then, promise);
375
+ notify$1 = function () {
376
+ then(flush);
377
+ };
378
+ // Node.js without promises
379
+ } else if (IS_NODE$1) {
380
+ notify$1 = function () {
381
+ process$1.nextTick(flush);
382
+ };
383
+ // for other environments - macrotask based on:
384
+ // - setImmediate
385
+ // - MessageChannel
386
+ // - window.postMessage
387
+ // - onreadystatechange
388
+ // - setTimeout
389
+ } else {
390
+ // strange IE + webpack dev server bug - use .bind(global)
391
+ macrotask = bind$2(macrotask, global$4);
392
+ notify$1 = function () {
393
+ macrotask(flush);
394
+ };
395
+ }
396
+ }
397
+
398
+ var microtask$1 = queueMicrotask || function (fn) {
399
+ var task = { fn: fn, next: undefined };
400
+ if (last) last.next = task;
401
+ if (!head) {
402
+ head = task;
403
+ notify$1();
404
+ } last = task;
405
+ };
406
+
407
+ var global$3 = global$8;
408
+
409
+ var hostReportErrors$1 = function (a, b) {
410
+ var console = global$3.console;
411
+ if (console && console.error) {
412
+ arguments.length == 1 ? console.error(a) : console.error(a, b);
413
+ }
414
+ };
415
+
416
+ var perform$3 = function (exec) {
417
+ try {
418
+ return { error: false, value: exec() };
419
+ } catch (error) {
420
+ return { error: true, value: error };
421
+ }
422
+ };
423
+
424
+ var Queue$1 = function () {
425
+ this.head = null;
426
+ this.tail = null;
427
+ };
428
+
429
+ Queue$1.prototype = {
430
+ add: function (item) {
431
+ var entry = { item: item, next: null };
432
+ if (this.head) this.tail.next = entry;
433
+ else this.head = entry;
434
+ this.tail = entry;
435
+ },
436
+ get: function () {
437
+ var entry = this.head;
438
+ if (entry) {
439
+ this.head = entry.next;
440
+ if (this.tail === entry) this.tail = null;
441
+ return entry.item;
442
+ }
443
+ }
444
+ };
445
+
446
+ var queue = Queue$1;
447
+
448
+ var global$2 = global$8;
449
+
450
+ var promiseNativeConstructor = global$2.Promise;
451
+
452
+ var engineIsBrowser = typeof window == 'object' && typeof Deno != 'object';
453
+
454
+ var global$1 = global$8;
455
+ var NativePromiseConstructor$4 = promiseNativeConstructor;
456
+ var isCallable$3 = isCallable$7;
457
+ var isForced = isForced_1;
458
+ var inspectSource = inspectSource$2;
459
+ var wellKnownSymbol$3 = wellKnownSymbol$8;
460
+ var IS_BROWSER = engineIsBrowser;
461
+ var V8_VERSION = engineV8Version;
462
+
463
+ NativePromiseConstructor$4 && NativePromiseConstructor$4.prototype;
464
+ var SPECIES = wellKnownSymbol$3('species');
465
+ var SUBCLASSING = false;
466
+ var NATIVE_PROMISE_REJECTION_EVENT$1 = isCallable$3(global$1.PromiseRejectionEvent);
467
+
468
+ var FORCED_PROMISE_CONSTRUCTOR$5 = isForced('Promise', function () {
469
+ var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor$4);
470
+ var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor$4);
471
+ // V8 6.6 (Node 10 and Chrome 66) have a bug with resolving custom thenables
472
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=830565
473
+ // We can't detect it synchronously, so just check versions
474
+ if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66) return true;
475
+ // We can't use @@species feature detection in V8 since it causes
476
+ // deoptimization and performance degradation
477
+ // https://github.com/zloirock/core-js/issues/679
478
+ if (V8_VERSION >= 51 && /native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) return false;
479
+ // Detect correctness of subclassing with @@species support
480
+ var promise = new NativePromiseConstructor$4(function (resolve) { resolve(1); });
481
+ var FakePromise = function (exec) {
482
+ exec(function () { /* empty */ }, function () { /* empty */ });
483
+ };
484
+ var constructor = promise.constructor = {};
485
+ constructor[SPECIES] = FakePromise;
486
+ SUBCLASSING = promise.then(function () { /* empty */ }) instanceof FakePromise;
487
+ if (!SUBCLASSING) return true;
488
+ // Unhandled rejections tracking support, NodeJS Promise without it fails @@species test
489
+ return !GLOBAL_CORE_JS_PROMISE && IS_BROWSER && !NATIVE_PROMISE_REJECTION_EVENT$1;
490
+ });
491
+
492
+ var promiseConstructorDetection = {
493
+ CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR$5,
494
+ REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT$1,
495
+ SUBCLASSING: SUBCLASSING
496
+ };
497
+
498
+ var newPromiseCapability$2 = {};
499
+
500
+ var aCallable$4 = aCallable$6;
501
+
502
+ var PromiseCapability = function (C) {
503
+ var resolve, reject;
504
+ this.promise = new C(function ($$resolve, $$reject) {
505
+ if (resolve !== undefined || reject !== undefined) throw TypeError('Bad Promise constructor');
506
+ resolve = $$resolve;
507
+ reject = $$reject;
508
+ });
509
+ this.resolve = aCallable$4(resolve);
510
+ this.reject = aCallable$4(reject);
511
+ };
512
+
513
+ // `NewPromiseCapability` abstract operation
514
+ // https://tc39.es/ecma262/#sec-newpromisecapability
515
+ newPromiseCapability$2.f = function (C) {
516
+ return new PromiseCapability(C);
517
+ };
518
+
519
+ var $$7 = _export;
520
+ var IS_NODE = engineIsNode;
521
+ var global = global$8;
522
+ var call$6 = functionCall;
523
+ var defineBuiltIn$2 = defineBuiltIn$3;
524
+ var setPrototypeOf = objectSetPrototypeOf;
525
+ var setToStringTag = setToStringTag$1;
526
+ var setSpecies = setSpecies$1;
527
+ var aCallable$3 = aCallable$6;
528
+ var isCallable$2 = isCallable$7;
529
+ var isObject$1 = isObject$2;
530
+ var anInstance = anInstance$1;
531
+ var speciesConstructor$1 = speciesConstructor$2;
532
+ var task = task$1.set;
533
+ var microtask = microtask$1;
534
+ var hostReportErrors = hostReportErrors$1;
535
+ var perform$2 = perform$3;
536
+ var Queue = queue;
537
+ var InternalStateModule = internalState;
538
+ var NativePromiseConstructor$3 = promiseNativeConstructor;
539
+ var PromiseConstructorDetection = promiseConstructorDetection;
540
+ var newPromiseCapabilityModule$3 = newPromiseCapability$2;
541
+
542
+ var PROMISE = 'Promise';
543
+ var FORCED_PROMISE_CONSTRUCTOR$4 = PromiseConstructorDetection.CONSTRUCTOR;
544
+ var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
545
+ var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
546
+ var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
547
+ var setInternalState = InternalStateModule.set;
548
+ var NativePromisePrototype$2 = NativePromiseConstructor$3 && NativePromiseConstructor$3.prototype;
549
+ var PromiseConstructor = NativePromiseConstructor$3;
550
+ var PromisePrototype = NativePromisePrototype$2;
551
+ var TypeError$1 = global.TypeError;
552
+ var document = global.document;
553
+ var process = global.process;
554
+ var newPromiseCapability$1 = newPromiseCapabilityModule$3.f;
555
+ var newGenericPromiseCapability = newPromiseCapability$1;
556
+
557
+ var DISPATCH_EVENT = !!(document && document.createEvent && global.dispatchEvent);
558
+ var UNHANDLED_REJECTION = 'unhandledrejection';
559
+ var REJECTION_HANDLED = 'rejectionhandled';
560
+ var PENDING = 0;
561
+ var FULFILLED = 1;
562
+ var REJECTED = 2;
563
+ var HANDLED = 1;
564
+ var UNHANDLED = 2;
565
+
566
+ var Internal, OwnPromiseCapability, PromiseWrapper, nativeThen;
567
+
568
+ // helpers
569
+ var isThenable = function (it) {
570
+ var then;
571
+ return isObject$1(it) && isCallable$2(then = it.then) ? then : false;
572
+ };
573
+
574
+ var callReaction = function (reaction, state) {
575
+ var value = state.value;
576
+ var ok = state.state == FULFILLED;
577
+ var handler = ok ? reaction.ok : reaction.fail;
578
+ var resolve = reaction.resolve;
579
+ var reject = reaction.reject;
580
+ var domain = reaction.domain;
581
+ var result, then, exited;
582
+ try {
583
+ if (handler) {
584
+ if (!ok) {
585
+ if (state.rejection === UNHANDLED) onHandleUnhandled(state);
586
+ state.rejection = HANDLED;
587
+ }
588
+ if (handler === true) result = value;
589
+ else {
590
+ if (domain) domain.enter();
591
+ result = handler(value); // can throw
592
+ if (domain) {
593
+ domain.exit();
594
+ exited = true;
595
+ }
596
+ }
597
+ if (result === reaction.promise) {
598
+ reject(TypeError$1('Promise-chain cycle'));
599
+ } else if (then = isThenable(result)) {
600
+ call$6(then, result, resolve, reject);
601
+ } else resolve(result);
602
+ } else reject(value);
603
+ } catch (error) {
604
+ if (domain && !exited) domain.exit();
605
+ reject(error);
606
+ }
607
+ };
608
+
609
+ var notify = function (state, isReject) {
610
+ if (state.notified) return;
611
+ state.notified = true;
612
+ microtask(function () {
613
+ var reactions = state.reactions;
614
+ var reaction;
615
+ while (reaction = reactions.get()) {
616
+ callReaction(reaction, state);
617
+ }
618
+ state.notified = false;
619
+ if (isReject && !state.rejection) onUnhandled(state);
620
+ });
621
+ };
622
+
623
+ var dispatchEvent = function (name, promise, reason) {
624
+ var event, handler;
625
+ if (DISPATCH_EVENT) {
626
+ event = document.createEvent('Event');
627
+ event.promise = promise;
628
+ event.reason = reason;
629
+ event.initEvent(name, false, true);
630
+ global.dispatchEvent(event);
631
+ } else event = { promise: promise, reason: reason };
632
+ if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = global['on' + name])) handler(event);
633
+ else if (name === UNHANDLED_REJECTION) hostReportErrors('Unhandled promise rejection', reason);
634
+ };
635
+
636
+ var onUnhandled = function (state) {
637
+ call$6(task, global, function () {
638
+ var promise = state.facade;
639
+ var value = state.value;
640
+ var IS_UNHANDLED = isUnhandled(state);
641
+ var result;
642
+ if (IS_UNHANDLED) {
643
+ result = perform$2(function () {
644
+ if (IS_NODE) {
645
+ process.emit('unhandledRejection', value, promise);
646
+ } else dispatchEvent(UNHANDLED_REJECTION, promise, value);
647
+ });
648
+ // Browsers should not trigger `rejectionHandled` event if it was handled here, NodeJS - should
649
+ state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
650
+ if (result.error) throw result.value;
651
+ }
652
+ });
653
+ };
654
+
655
+ var isUnhandled = function (state) {
656
+ return state.rejection !== HANDLED && !state.parent;
657
+ };
658
+
659
+ var onHandleUnhandled = function (state) {
660
+ call$6(task, global, function () {
661
+ var promise = state.facade;
662
+ if (IS_NODE) {
663
+ process.emit('rejectionHandled', promise);
664
+ } else dispatchEvent(REJECTION_HANDLED, promise, state.value);
665
+ });
666
+ };
667
+
668
+ var bind$1 = function (fn, state, unwrap) {
669
+ return function (value) {
670
+ fn(state, value, unwrap);
671
+ };
672
+ };
673
+
674
+ var internalReject = function (state, value, unwrap) {
675
+ if (state.done) return;
676
+ state.done = true;
677
+ if (unwrap) state = unwrap;
678
+ state.value = value;
679
+ state.state = REJECTED;
680
+ notify(state, true);
681
+ };
682
+
683
+ var internalResolve = function (state, value, unwrap) {
684
+ if (state.done) return;
685
+ state.done = true;
686
+ if (unwrap) state = unwrap;
687
+ try {
688
+ if (state.facade === value) throw TypeError$1("Promise can't be resolved itself");
689
+ var then = isThenable(value);
690
+ if (then) {
691
+ microtask(function () {
692
+ var wrapper = { done: false };
693
+ try {
694
+ call$6(then, value,
695
+ bind$1(internalResolve, wrapper, state),
696
+ bind$1(internalReject, wrapper, state)
697
+ );
698
+ } catch (error) {
699
+ internalReject(wrapper, error, state);
700
+ }
701
+ });
702
+ } else {
703
+ state.value = value;
704
+ state.state = FULFILLED;
705
+ notify(state, false);
706
+ }
707
+ } catch (error) {
708
+ internalReject({ done: false }, error, state);
709
+ }
710
+ };
711
+
712
+ // constructor polyfill
713
+ if (FORCED_PROMISE_CONSTRUCTOR$4) {
714
+ // 25.4.3.1 Promise(executor)
715
+ PromiseConstructor = function Promise(executor) {
716
+ anInstance(this, PromisePrototype);
717
+ aCallable$3(executor);
718
+ call$6(Internal, this);
719
+ var state = getInternalPromiseState(this);
720
+ try {
721
+ executor(bind$1(internalResolve, state), bind$1(internalReject, state));
722
+ } catch (error) {
723
+ internalReject(state, error);
724
+ }
725
+ };
726
+
727
+ PromisePrototype = PromiseConstructor.prototype;
728
+
729
+ // eslint-disable-next-line no-unused-vars -- required for `.length`
730
+ Internal = function Promise(executor) {
731
+ setInternalState(this, {
732
+ type: PROMISE,
733
+ done: false,
734
+ notified: false,
735
+ parent: false,
736
+ reactions: new Queue(),
737
+ rejection: false,
738
+ state: PENDING,
739
+ value: undefined
740
+ });
741
+ };
742
+
743
+ // `Promise.prototype.then` method
744
+ // https://tc39.es/ecma262/#sec-promise.prototype.then
745
+ Internal.prototype = defineBuiltIn$2(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
746
+ var state = getInternalPromiseState(this);
747
+ var reaction = newPromiseCapability$1(speciesConstructor$1(this, PromiseConstructor));
748
+ state.parent = true;
749
+ reaction.ok = isCallable$2(onFulfilled) ? onFulfilled : true;
750
+ reaction.fail = isCallable$2(onRejected) && onRejected;
751
+ reaction.domain = IS_NODE ? process.domain : undefined;
752
+ if (state.state == PENDING) state.reactions.add(reaction);
753
+ else microtask(function () {
754
+ callReaction(reaction, state);
755
+ });
756
+ return reaction.promise;
757
+ });
758
+
759
+ OwnPromiseCapability = function () {
760
+ var promise = new Internal();
761
+ var state = getInternalPromiseState(promise);
762
+ this.promise = promise;
763
+ this.resolve = bind$1(internalResolve, state);
764
+ this.reject = bind$1(internalReject, state);
765
+ };
766
+
767
+ newPromiseCapabilityModule$3.f = newPromiseCapability$1 = function (C) {
768
+ return C === PromiseConstructor || C === PromiseWrapper
769
+ ? new OwnPromiseCapability(C)
770
+ : newGenericPromiseCapability(C);
771
+ };
772
+
773
+ if (isCallable$2(NativePromiseConstructor$3) && NativePromisePrototype$2 !== Object.prototype) {
774
+ nativeThen = NativePromisePrototype$2.then;
775
+
776
+ if (!NATIVE_PROMISE_SUBCLASSING) {
777
+ // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
778
+ defineBuiltIn$2(NativePromisePrototype$2, 'then', function then(onFulfilled, onRejected) {
779
+ var that = this;
780
+ return new PromiseConstructor(function (resolve, reject) {
781
+ call$6(nativeThen, that, resolve, reject);
782
+ }).then(onFulfilled, onRejected);
783
+ // https://github.com/zloirock/core-js/issues/640
784
+ }, { unsafe: true });
785
+ }
786
+
787
+ // make `.constructor === Promise` work for native promise-based APIs
788
+ try {
789
+ delete NativePromisePrototype$2.constructor;
790
+ } catch (error) { /* empty */ }
791
+
792
+ // make `instanceof Promise` work for native promise-based APIs
793
+ if (setPrototypeOf) {
794
+ setPrototypeOf(NativePromisePrototype$2, PromisePrototype);
795
+ }
796
+ }
797
+ }
798
+
799
+ $$7({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR$4 }, {
800
+ Promise: PromiseConstructor
801
+ });
802
+
803
+ setToStringTag(PromiseConstructor, PROMISE, false);
804
+ setSpecies(PROMISE);
805
+
806
+ var wellKnownSymbol$2 = wellKnownSymbol$8;
807
+ var Iterators$1 = iterators;
808
+
809
+ var ITERATOR$2 = wellKnownSymbol$2('iterator');
810
+ var ArrayPrototype = Array.prototype;
811
+
812
+ // check on default Array iterator
813
+ var isArrayIteratorMethod$1 = function (it) {
814
+ return it !== undefined && (Iterators$1.Array === it || ArrayPrototype[ITERATOR$2] === it);
815
+ };
816
+
817
+ var classof$1 = classof$3;
818
+ var getMethod$1 = getMethod$2;
819
+ var Iterators = iterators;
820
+ var wellKnownSymbol$1 = wellKnownSymbol$8;
821
+
822
+ var ITERATOR$1 = wellKnownSymbol$1('iterator');
823
+
824
+ var getIteratorMethod$2 = function (it) {
825
+ if (it != undefined) return getMethod$1(it, ITERATOR$1)
826
+ || getMethod$1(it, '@@iterator')
827
+ || Iterators[classof$1(it)];
828
+ };
829
+
830
+ var call$5 = functionCall;
831
+ var aCallable$2 = aCallable$6;
832
+ var anObject$3 = anObject$5;
833
+ var tryToString$1 = tryToString$3;
834
+ var getIteratorMethod$1 = getIteratorMethod$2;
835
+
836
+ var $TypeError$1 = TypeError;
837
+
838
+ var getIterator$1 = function (argument, usingIterator) {
839
+ var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
840
+ if (aCallable$2(iteratorMethod)) return anObject$3(call$5(iteratorMethod, argument));
841
+ throw $TypeError$1(tryToString$1(argument) + ' is not iterable');
842
+ };
843
+
844
+ var call$4 = functionCall;
845
+ var anObject$2 = anObject$5;
846
+ var getMethod = getMethod$2;
847
+
848
+ var iteratorClose$1 = function (iterator, kind, value) {
849
+ var innerResult, innerError;
850
+ anObject$2(iterator);
851
+ try {
852
+ innerResult = getMethod(iterator, 'return');
853
+ if (!innerResult) {
854
+ if (kind === 'throw') throw value;
855
+ return value;
856
+ }
857
+ innerResult = call$4(innerResult, iterator);
858
+ } catch (error) {
859
+ innerError = true;
860
+ innerResult = error;
861
+ }
862
+ if (kind === 'throw') throw value;
863
+ if (innerError) throw innerResult;
864
+ anObject$2(innerResult);
865
+ return value;
866
+ };
867
+
868
+ var bind = functionBindContext;
869
+ var call$3 = functionCall;
870
+ var anObject$1 = anObject$5;
871
+ var tryToString = tryToString$3;
872
+ var isArrayIteratorMethod = isArrayIteratorMethod$1;
873
+ var lengthOfArrayLike = lengthOfArrayLike$1;
874
+ var isPrototypeOf = objectIsPrototypeOf;
875
+ var getIterator = getIterator$1;
876
+ var getIteratorMethod = getIteratorMethod$2;
877
+ var iteratorClose = iteratorClose$1;
878
+
879
+ var $TypeError = TypeError;
880
+
881
+ var Result = function (stopped, result) {
882
+ this.stopped = stopped;
883
+ this.result = result;
884
+ };
885
+
886
+ var ResultPrototype = Result.prototype;
887
+
888
+ var iterate$2 = function (iterable, unboundFunction, options) {
889
+ var that = options && options.that;
890
+ var AS_ENTRIES = !!(options && options.AS_ENTRIES);
891
+ var IS_ITERATOR = !!(options && options.IS_ITERATOR);
892
+ var INTERRUPTED = !!(options && options.INTERRUPTED);
893
+ var fn = bind(unboundFunction, that);
894
+ var iterator, iterFn, index, length, result, next, step;
895
+
896
+ var stop = function (condition) {
897
+ if (iterator) iteratorClose(iterator, 'normal', condition);
898
+ return new Result(true, condition);
899
+ };
900
+
901
+ var callFn = function (value) {
902
+ if (AS_ENTRIES) {
903
+ anObject$1(value);
904
+ return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
905
+ } return INTERRUPTED ? fn(value, stop) : fn(value);
906
+ };
907
+
908
+ if (IS_ITERATOR) {
909
+ iterator = iterable;
910
+ } else {
911
+ iterFn = getIteratorMethod(iterable);
912
+ if (!iterFn) throw $TypeError(tryToString(iterable) + ' is not iterable');
913
+ // optimisation for array iterators
914
+ if (isArrayIteratorMethod(iterFn)) {
915
+ for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
916
+ result = callFn(iterable[index]);
917
+ if (result && isPrototypeOf(ResultPrototype, result)) return result;
918
+ } return new Result(false);
919
+ }
920
+ iterator = getIterator(iterable, iterFn);
921
+ }
922
+
923
+ next = iterator.next;
924
+ while (!(step = call$3(next, iterator)).done) {
925
+ try {
926
+ result = callFn(step.value);
927
+ } catch (error) {
928
+ iteratorClose(iterator, 'throw', error);
929
+ }
930
+ if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
931
+ } return new Result(false);
932
+ };
933
+
934
+ var wellKnownSymbol = wellKnownSymbol$8;
935
+
936
+ var ITERATOR = wellKnownSymbol('iterator');
937
+ var SAFE_CLOSING = false;
938
+
939
+ try {
940
+ var called = 0;
941
+ var iteratorWithReturn = {
942
+ next: function () {
943
+ return { done: !!called++ };
944
+ },
945
+ 'return': function () {
946
+ SAFE_CLOSING = true;
947
+ }
948
+ };
949
+ iteratorWithReturn[ITERATOR] = function () {
950
+ return this;
951
+ };
952
+ // eslint-disable-next-line es-x/no-array-from, no-throw-literal -- required for testing
953
+ Array.from(iteratorWithReturn, function () { throw 2; });
954
+ } catch (error) { /* empty */ }
955
+
956
+ var checkCorrectnessOfIteration$1 = function (exec, SKIP_CLOSING) {
957
+ if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
958
+ var ITERATION_SUPPORT = false;
959
+ try {
960
+ var object = {};
961
+ object[ITERATOR] = function () {
962
+ return {
963
+ next: function () {
964
+ return { done: ITERATION_SUPPORT = true };
965
+ }
966
+ };
967
+ };
968
+ exec(object);
969
+ } catch (error) { /* empty */ }
970
+ return ITERATION_SUPPORT;
971
+ };
972
+
973
+ var NativePromiseConstructor$2 = promiseNativeConstructor;
974
+ var checkCorrectnessOfIteration = checkCorrectnessOfIteration$1;
975
+ var FORCED_PROMISE_CONSTRUCTOR$3 = promiseConstructorDetection.CONSTRUCTOR;
976
+
977
+ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCorrectnessOfIteration(function (iterable) {
978
+ NativePromiseConstructor$2.all(iterable).then(undefined, function () { /* empty */ });
979
+ });
980
+
981
+ var $$6 = _export;
982
+ var call$2 = functionCall;
983
+ var aCallable$1 = aCallable$6;
984
+ var newPromiseCapabilityModule$2 = newPromiseCapability$2;
985
+ var perform$1 = perform$3;
986
+ var iterate$1 = iterate$2;
987
+ var PROMISE_STATICS_INCORRECT_ITERATION$1 = promiseStaticsIncorrectIteration;
988
+
989
+ // `Promise.all` method
990
+ // https://tc39.es/ecma262/#sec-promise.all
991
+ $$6({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION$1 }, {
992
+ all: function all(iterable) {
993
+ var C = this;
994
+ var capability = newPromiseCapabilityModule$2.f(C);
995
+ var resolve = capability.resolve;
996
+ var reject = capability.reject;
997
+ var result = perform$1(function () {
998
+ var $promiseResolve = aCallable$1(C.resolve);
999
+ var values = [];
1000
+ var counter = 0;
1001
+ var remaining = 1;
1002
+ iterate$1(iterable, function (promise) {
1003
+ var index = counter++;
1004
+ var alreadyCalled = false;
1005
+ remaining++;
1006
+ call$2($promiseResolve, C, promise).then(function (value) {
1007
+ if (alreadyCalled) return;
1008
+ alreadyCalled = true;
1009
+ values[index] = value;
1010
+ --remaining || resolve(values);
1011
+ }, reject);
1012
+ });
1013
+ --remaining || resolve(values);
1014
+ });
1015
+ if (result.error) reject(result.value);
1016
+ return capability.promise;
1017
+ }
1018
+ });
1019
+
1020
+ var $$5 = _export;
1021
+ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
1022
+ var NativePromiseConstructor$1 = promiseNativeConstructor;
1023
+ var getBuiltIn$2 = getBuiltIn$5;
1024
+ var isCallable$1 = isCallable$7;
1025
+ var defineBuiltIn$1 = defineBuiltIn$3;
1026
+
1027
+ var NativePromisePrototype$1 = NativePromiseConstructor$1 && NativePromiseConstructor$1.prototype;
1028
+
1029
+ // `Promise.prototype.catch` method
1030
+ // https://tc39.es/ecma262/#sec-promise.prototype.catch
1031
+ $$5({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real: true }, {
1032
+ 'catch': function (onRejected) {
1033
+ return this.then(undefined, onRejected);
1034
+ }
1035
+ });
1036
+
1037
+ // makes sure that native promise-based APIs `Promise#catch` properly works with patched `Promise#then`
1038
+ if (isCallable$1(NativePromiseConstructor$1)) {
1039
+ var method$1 = getBuiltIn$2('Promise').prototype['catch'];
1040
+ if (NativePromisePrototype$1['catch'] !== method$1) {
1041
+ defineBuiltIn$1(NativePromisePrototype$1, 'catch', method$1, { unsafe: true });
1042
+ }
1043
+ }
1044
+
1045
+ var $$4 = _export;
1046
+ var call$1 = functionCall;
1047
+ var aCallable = aCallable$6;
1048
+ var newPromiseCapabilityModule$1 = newPromiseCapability$2;
1049
+ var perform = perform$3;
1050
+ var iterate = iterate$2;
1051
+ var PROMISE_STATICS_INCORRECT_ITERATION = promiseStaticsIncorrectIteration;
1052
+
1053
+ // `Promise.race` method
1054
+ // https://tc39.es/ecma262/#sec-promise.race
1055
+ $$4({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
1056
+ race: function race(iterable) {
1057
+ var C = this;
1058
+ var capability = newPromiseCapabilityModule$1.f(C);
1059
+ var reject = capability.reject;
1060
+ var result = perform(function () {
1061
+ var $promiseResolve = aCallable(C.resolve);
1062
+ iterate(iterable, function (promise) {
1063
+ call$1($promiseResolve, C, promise).then(capability.resolve, reject);
1064
+ });
1065
+ });
1066
+ if (result.error) reject(result.value);
1067
+ return capability.promise;
1068
+ }
1069
+ });
1070
+
1071
+ var $$3 = _export;
1072
+ var call = functionCall;
1073
+ var newPromiseCapabilityModule = newPromiseCapability$2;
1074
+ var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
1075
+
1076
+ // `Promise.reject` method
1077
+ // https://tc39.es/ecma262/#sec-promise.reject
1078
+ $$3({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
1079
+ reject: function reject(r) {
1080
+ var capability = newPromiseCapabilityModule.f(this);
1081
+ call(capability.reject, undefined, r);
1082
+ return capability.promise;
1083
+ }
1084
+ });
1085
+
1086
+ var anObject = anObject$5;
1087
+ var isObject = isObject$2;
1088
+ var newPromiseCapability = newPromiseCapability$2;
1089
+
1090
+ var promiseResolve$2 = function (C, x) {
1091
+ anObject(C);
1092
+ if (isObject(x) && x.constructor === C) return x;
1093
+ var promiseCapability = newPromiseCapability.f(C);
1094
+ var resolve = promiseCapability.resolve;
1095
+ resolve(x);
1096
+ return promiseCapability.promise;
1097
+ };
1098
+
1099
+ var $$2 = _export;
1100
+ var getBuiltIn$1 = getBuiltIn$5;
1101
+ var FORCED_PROMISE_CONSTRUCTOR = promiseConstructorDetection.CONSTRUCTOR;
1102
+ var promiseResolve$1 = promiseResolve$2;
1103
+
1104
+ getBuiltIn$1('Promise');
1105
+
1106
+ // `Promise.resolve` method
1107
+ // https://tc39.es/ecma262/#sec-promise.resolve
1108
+ $$2({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
1109
+ resolve: function resolve(x) {
1110
+ return promiseResolve$1(this, x);
1111
+ }
1112
+ });
1113
+
1114
+ var classof = classof$3;
1115
+
1116
+ var $String = String;
1117
+
1118
+ var toString$1 = function (argument) {
1119
+ if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1120
+ return $String(argument);
1121
+ };
1122
+
1123
+ // a string of all valid unicode whitespaces
1124
+ var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1125
+ '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1126
+
1127
+ var uncurryThis = functionUncurryThis;
1128
+ var requireObjectCoercible = requireObjectCoercible$1;
1129
+ var toString = toString$1;
1130
+ var whitespaces$1 = whitespaces$2;
1131
+
1132
+ var replace = uncurryThis(''.replace);
1133
+ var whitespace = '[' + whitespaces$1 + ']';
1134
+ var ltrim = RegExp('^' + whitespace + whitespace + '*');
1135
+ var rtrim = RegExp(whitespace + whitespace + '*$');
1136
+
1137
+ // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1138
+ var createMethod = function (TYPE) {
1139
+ return function ($this) {
1140
+ var string = toString(requireObjectCoercible($this));
1141
+ if (TYPE & 1) string = replace(string, ltrim, '');
1142
+ if (TYPE & 2) string = replace(string, rtrim, '');
1143
+ return string;
1144
+ };
1145
+ };
1146
+
1147
+ var stringTrim = {
1148
+ // `String.prototype.{ trimLeft, trimStart }` methods
1149
+ // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1150
+ start: createMethod(1),
1151
+ // `String.prototype.{ trimRight, trimEnd }` methods
1152
+ // https://tc39.es/ecma262/#sec-string.prototype.trimend
1153
+ end: createMethod(2),
1154
+ // `String.prototype.trim` method
1155
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
1156
+ trim: createMethod(3)
1157
+ };
1158
+
1159
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
1160
+ var fails$1 = fails$4;
1161
+ var whitespaces = whitespaces$2;
1162
+
1163
+ var non = '\u200B\u0085\u180E';
1164
+
1165
+ // check that a method works with the correct list
1166
+ // of whitespaces and has a correct name
1167
+ var stringTrimForced = function (METHOD_NAME) {
1168
+ return fails$1(function () {
1169
+ return !!whitespaces[METHOD_NAME]()
1170
+ || non[METHOD_NAME]() !== non
1171
+ || (PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME);
1172
+ });
1173
+ };
1174
+
1175
+ var $$1 = _export;
1176
+ var $trim = stringTrim.trim;
1177
+ var forcedStringTrimMethod = stringTrimForced;
1178
+
1179
+ // `String.prototype.trim` method
1180
+ // https://tc39.es/ecma262/#sec-string.prototype.trim
1181
+ $$1({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
1182
+ trim: function trim() {
1183
+ return $trim(this);
1184
+ }
1185
+ });
1186
+
1187
+ var $ = _export;
1188
+ var NativePromiseConstructor = promiseNativeConstructor;
1189
+ var fails = fails$4;
1190
+ var getBuiltIn = getBuiltIn$5;
1191
+ var isCallable = isCallable$7;
1192
+ var speciesConstructor = speciesConstructor$2;
1193
+ var promiseResolve = promiseResolve$2;
1194
+ var defineBuiltIn = defineBuiltIn$3;
1195
+
1196
+ var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
1197
+
1198
+ // Safari bug https://bugs.webkit.org/show_bug.cgi?id=200829
1199
+ var NON_GENERIC = !!NativePromiseConstructor && fails(function () {
1200
+ // eslint-disable-next-line unicorn/no-thenable -- required for testing
1201
+ NativePromisePrototype['finally'].call({ then: function () { /* empty */ } }, function () { /* empty */ });
1202
+ });
1203
+
1204
+ // `Promise.prototype.finally` method
1205
+ // https://tc39.es/ecma262/#sec-promise.prototype.finally
1206
+ $({ target: 'Promise', proto: true, real: true, forced: NON_GENERIC }, {
1207
+ 'finally': function (onFinally) {
1208
+ var C = speciesConstructor(this, getBuiltIn('Promise'));
1209
+ var isFunction = isCallable(onFinally);
1210
+ return this.then(
1211
+ isFunction ? function (x) {
1212
+ return promiseResolve(C, onFinally()).then(function () { return x; });
1213
+ } : onFinally,
1214
+ isFunction ? function (e) {
1215
+ return promiseResolve(C, onFinally()).then(function () { throw e; });
1216
+ } : onFinally
1217
+ );
1218
+ }
1219
+ });
1220
+
1221
+ // makes sure that native promise-based APIs `Promise#finally` properly works with patched `Promise#then`
1222
+ if (isCallable(NativePromiseConstructor)) {
1223
+ var method = getBuiltIn('Promise').prototype['finally'];
1224
+ if (NativePromisePrototype['finally'] !== method) {
1225
+ defineBuiltIn(NativePromisePrototype, 'finally', method, { unsafe: true });
1226
+ }
1227
+ }
1228
+
1229
+ function _arity(n, fn) {
1230
+ /* eslint-disable no-unused-vars */
1231
+ switch (n) {
1232
+ case 0:
1233
+ return function () {
1234
+ return fn.apply(this, arguments);
1235
+ };
1236
+
1237
+ case 1:
1238
+ return function (a0) {
1239
+ return fn.apply(this, arguments);
1240
+ };
1241
+
1242
+ case 2:
1243
+ return function (a0, a1) {
1244
+ return fn.apply(this, arguments);
1245
+ };
1246
+
1247
+ case 3:
1248
+ return function (a0, a1, a2) {
1249
+ return fn.apply(this, arguments);
1250
+ };
1251
+
1252
+ case 4:
1253
+ return function (a0, a1, a2, a3) {
1254
+ return fn.apply(this, arguments);
1255
+ };
1256
+
1257
+ case 5:
1258
+ return function (a0, a1, a2, a3, a4) {
1259
+ return fn.apply(this, arguments);
1260
+ };
1261
+
1262
+ case 6:
1263
+ return function (a0, a1, a2, a3, a4, a5) {
1264
+ return fn.apply(this, arguments);
1265
+ };
1266
+
1267
+ case 7:
1268
+ return function (a0, a1, a2, a3, a4, a5, a6) {
1269
+ return fn.apply(this, arguments);
1270
+ };
1271
+
1272
+ case 8:
1273
+ return function (a0, a1, a2, a3, a4, a5, a6, a7) {
1274
+ return fn.apply(this, arguments);
1275
+ };
1276
+
1277
+ case 9:
1278
+ return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {
1279
+ return fn.apply(this, arguments);
1280
+ };
1281
+
1282
+ case 10:
1283
+ return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
1284
+ return fn.apply(this, arguments);
1285
+ };
1286
+
1287
+ default:
1288
+ throw new Error('First argument to _arity must be a non-negative integer no greater than ten');
1289
+ }
1290
+ }
1291
+
1292
+ function _identity(x) {
1293
+ return x;
1294
+ }
1295
+
1296
+ /**
1297
+ * A function that does nothing but return the parameter supplied to it. Good
1298
+ * as a default or placeholder function.
1299
+ *
1300
+ * @func
1301
+ * @memberOf R
1302
+ * @since v0.1.0
1303
+ * @category Function
1304
+ * @sig a -> a
1305
+ * @param {*} x The value to return.
1306
+ * @return {*} The input value, `x`.
1307
+ * @example
1308
+ *
1309
+ * R.identity(1); //=> 1
1310
+ *
1311
+ * const obj = {};
1312
+ * R.identity(obj) === obj; //=> true
1313
+ * @symb R.identity(a) = a
1314
+ */
1315
+
1316
+ var identity =
1317
+ /*#__PURE__*/
1318
+ _curry1(_identity);
1319
+
1320
+ var identity$1 = identity;
1321
+
1322
+ /**
1323
+ * Creates a new function that, when invoked, caches the result of calling `fn`
1324
+ * for a given argument set and returns the result. Subsequent calls to the
1325
+ * memoized `fn` with the same argument set will not result in an additional
1326
+ * call to `fn`; instead, the cached result for that set of arguments will be
1327
+ * returned.
1328
+ *
1329
+ *
1330
+ * @func
1331
+ * @memberOf R
1332
+ * @since v0.24.0
1333
+ * @category Function
1334
+ * @sig (*... -> String) -> (*... -> a) -> (*... -> a)
1335
+ * @param {Function} fn The function to generate the cache key.
1336
+ * @param {Function} fn The function to memoize.
1337
+ * @return {Function} Memoized version of `fn`.
1338
+ * @example
1339
+ *
1340
+ * let count = 0;
1341
+ * const factorial = R.memoizeWith(R.identity, n => {
1342
+ * count += 1;
1343
+ * return R.product(R.range(1, n + 1));
1344
+ * });
1345
+ * factorial(5); //=> 120
1346
+ * factorial(5); //=> 120
1347
+ * factorial(5); //=> 120
1348
+ * count; //=> 1
1349
+ */
1350
+
1351
+ var memoizeWith =
1352
+ /*#__PURE__*/
1353
+ _curry2(function memoizeWith(mFn, fn) {
1354
+ var cache = {};
1355
+ return _arity(fn.length, function () {
1356
+ var key = mFn.apply(this, arguments);
1357
+
1358
+ if (!_has(key, cache)) {
1359
+ cache[key] = fn.apply(this, arguments);
1360
+ }
1361
+
1362
+ return cache[key];
1363
+ });
1364
+ });
1365
+
1366
+ var memoizeWith$1 = memoizeWith;
1367
+
1368
+ const PLACEHOLDER_ICON = `<svg width="80%" height="80%" viewBox="0 0 64 64">
1369
+ <g>
1370
+ <g stroke-width="6" stroke-linecap="round" fill="none">
1371
+ <path stroke="currentColor" d="M4,32 c0,15,12,28,28,28c8,0,16-4,21-9">
1372
+ </path>
1373
+ <path d="M60,32 C60,16,47.464,4,32,4S4,16,4,32">
1374
+ </path>
1375
+ <animateTransform values="0,32,32;360,32,32" attributeName="transform" type="rotate" repeatCount="indefinite" dur="750ms">
1376
+ </animateTransform>
1377
+ </g>
1378
+ </g>
1379
+ </svg>`;
1380
+
1381
+ const BASE_URL = 'https://icon.resources.vonage.com';
1382
+ const ICON_SET_VERSION = '4.0.28';
1383
+ const PLACEHOLDER_DELAY = 500;
1384
+ const PLACEHOLDER_TIMEOUT = 2000;
1385
+
1386
+ const baseUrlTemplate = (resource, version) => [BASE_URL, `v${version}`, resource].join('/');
1387
+
1388
+ const assertIsValidResponse = ({
1389
+ ok,
1390
+ headers
1391
+ }) => {
1392
+ if (!ok || headers.get('content-type') !== 'image/svg+xml') {
1393
+ throw new Error('Something went wrong');
1394
+ }
1395
+ };
1396
+
1397
+ const extractSvg = response => {
1398
+ assertIsValidResponse(response);
1399
+ return response.text();
1400
+ };
1401
+
1402
+ const loadSvg = iconId => fetch(baseUrlTemplate([iconId, 'svg'].join('.'), ICON_SET_VERSION)).then(extractSvg);
1403
+
1404
+ const resolveIcon = memoizeWith$1(identity$1, (iconId = '') => iconId.trim() ? loadSvg(iconId) : Promise.resolve(''));
1405
+ class Icon extends FoundationElement {
1406
+ async typeChanged() {
1407
+ this.svg = undefined;
1408
+ let timeout = setTimeout(() => {
1409
+ this.svg = PLACEHOLDER_ICON;
1410
+ timeout = setTimeout(() => {
1411
+ if (this.svg === PLACEHOLDER_ICON) {
1412
+ this.svg = undefined;
1413
+ }
1414
+ }, PLACEHOLDER_TIMEOUT);
1415
+ }, PLACEHOLDER_DELAY);
1416
+ await resolveIcon(this.type).then(svg => {
1417
+ this.svg = svg;
1418
+ }).catch(() => {
1419
+ this.svg = undefined;
1420
+ }).finally(() => {
1421
+ clearTimeout(timeout);
1422
+ });
1423
+ }
1424
+
1425
+ }
1426
+
1427
+ __decorate([attr, __metadata("design:type", String)], Icon.prototype, "connotation", void 0);
1428
+
1429
+ __decorate([attr, __metadata("design:type", String)], Icon.prototype, "size", void 0);
1430
+
1431
+ __decorate([observable, __metadata("design:type", String)], Icon.prototype, "svg", void 0);
1432
+
1433
+ __decorate([attr, __metadata("design:type", String)], Icon.prototype, "type", void 0);
1434
+
1435
+ export { Icon as I, functionApply as f, speciesConstructor$2 as s, toString$1 as t };