@vonage/vivid 3.0.0-next.11 → 3.0.0-next.110

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