@arc-ui/components 13.5.0 → 13.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/lib/Alert/styles.css +1 -1
  2. package/lib/Align/styles.css +1 -1
  3. package/lib/AppButton/styles.css +1 -1
  4. package/lib/Avatar/Avatar.cjs +2 -2
  5. package/lib/Avatar/Avatar.mjs +2 -2
  6. package/lib/Avatar/styles.css +1 -1
  7. package/lib/AvatarGroup/AvatarGroup.cjs +2 -2
  8. package/lib/AvatarGroup/AvatarGroup.mjs +2 -2
  9. package/lib/AvatarGroup/styles.css +1 -1
  10. package/lib/Badge/styles.css +1 -1
  11. package/lib/Banner/Banner.cjs +4 -4
  12. package/lib/Banner/Banner.mjs +4 -4
  13. package/lib/Box/styles.css +1 -1
  14. package/lib/BrandLogo/styles.css +1 -1
  15. package/lib/Breadcrumbs/styles.css +1 -1
  16. package/lib/Button/styles.css +1 -1
  17. package/lib/ButtonGroup/styles.css +1 -1
  18. package/lib/ButtonV2/styles.css +1 -1
  19. package/lib/Calendar/Calendar.cjs +3 -3
  20. package/lib/Calendar/Calendar.mjs +3 -3
  21. package/lib/Calendar/styles.css +1 -1
  22. package/lib/CardFooter/styles.css +1 -1
  23. package/lib/CardHeading/CardHeading.cjs +2 -2
  24. package/lib/CardHeading/CardHeading.mjs +2 -2
  25. package/lib/CardHeading/styles.css +1 -1
  26. package/lib/Carousel/Carousel.cjs +1 -1
  27. package/lib/Carousel/Carousel.mjs +1 -1
  28. package/lib/Carousel/styles.css +1 -1
  29. package/lib/Checkbox/styles.css +1 -1
  30. package/lib/CheckboxIcon/styles.css +1 -1
  31. package/lib/Columns/styles.css +1 -1
  32. package/lib/ComboBox/styles.css +1 -1
  33. package/lib/ContentSwitcher/styles.css +1 -1
  34. package/lib/ContentSwitcherDropdown/styles.css +1 -1
  35. package/lib/DatePicker/DatePicker.cjs +3 -3
  36. package/lib/DatePicker/DatePicker.mjs +3 -3
  37. package/lib/DatePicker/styles.css +1 -1
  38. package/lib/Disclosure/Disclosure.cjs +1 -1
  39. package/lib/Disclosure/Disclosure.mjs +1 -1
  40. package/lib/Disclosure/styles.css +1 -1
  41. package/lib/DisclosureMini/styles.css +1 -1
  42. package/lib/Download/styles.css +1 -1
  43. package/lib/Drawer/Drawer.cjs +1 -1
  44. package/lib/Drawer/Drawer.mjs +1 -1
  45. package/lib/Drawer/styles.css +1 -1
  46. package/lib/Elevation/styles.css +1 -1
  47. package/lib/Filter/styles.css +1 -1
  48. package/lib/FormControl/styles.css +1 -1
  49. package/lib/GhostedHeroBanner/GhostedHeroBanner.cjs +1 -1
  50. package/lib/GhostedHeroBanner/GhostedHeroBanner.mjs +1 -1
  51. package/lib/GhostedHeroBanner/styles.css +1 -1
  52. package/lib/GradientPageBackground/GradientPageBackground.cjs +2 -2
  53. package/lib/GradientPageBackground/GradientPageBackground.mjs +2 -2
  54. package/lib/GradientPageBackground/styles.css +1 -1
  55. package/lib/Grid/styles.css +1 -1
  56. package/lib/Group/styles.css +1 -1
  57. package/lib/Heading/Heading.cjs +1 -1
  58. package/lib/Heading/Heading.mjs +1 -1
  59. package/lib/Heading/styles.css +1 -1
  60. package/lib/HeroBanner/HeroBanner.cjs +4 -4
  61. package/lib/HeroBanner/HeroBanner.mjs +4 -4
  62. package/lib/HeroBanner/styles.css +1 -1
  63. package/lib/HeroButton/styles.css +1 -1
  64. package/lib/HeroVideoBanner/HeroVideoBanner.cjs +58 -0
  65. package/lib/HeroVideoBanner/HeroVideoBanner.mjs +56 -0
  66. package/lib/HeroVideoBanner/styles.css +1 -0
  67. package/lib/Hidden/styles.css +1 -1
  68. package/lib/HorizontalCard/HorizontalCard.cjs +2 -2
  69. package/lib/HorizontalCard/HorizontalCard.mjs +2 -2
  70. package/lib/HorizontalCard/styles.css +1 -1
  71. package/lib/Icon/styles.css +1 -1
  72. package/lib/Image/styles.css +1 -1
  73. package/lib/ImpactCard/ImpactCard.cjs +2 -2
  74. package/lib/ImpactCard/ImpactCard.mjs +2 -2
  75. package/lib/ImpactCard/styles.css +1 -1
  76. package/lib/InformationCard/InformationCard.cjs +4 -4
  77. package/lib/InformationCard/InformationCard.mjs +4 -4
  78. package/lib/InformationCard/styles.css +1 -1
  79. package/lib/Link/styles.css +1 -1
  80. package/lib/Markup/styles.css +1 -1
  81. package/lib/MediaCard/MediaCard.cjs +2 -2
  82. package/lib/MediaCard/MediaCard.mjs +2 -2
  83. package/lib/MediaCard/styles.css +1 -1
  84. package/lib/Menu/styles.css +1 -1
  85. package/lib/Modal/Modal.cjs +1 -1
  86. package/lib/Modal/Modal.mjs +1 -1
  87. package/lib/Modal/styles.css +1 -1
  88. package/lib/NavigationHeader/NavigationHeader.cjs +14 -9
  89. package/lib/NavigationHeader/NavigationHeader.mjs +14 -9
  90. package/lib/NavigationHeader/styles.css +1 -1
  91. package/lib/Pagination/styles.css +1 -1
  92. package/lib/PaginationSimple/styles.css +1 -1
  93. package/lib/Popover/styles.css +1 -1
  94. package/lib/Poster/styles.css +1 -1
  95. package/lib/ProgressBar/ProgressBar.cjs +1 -1
  96. package/lib/ProgressBar/ProgressBar.mjs +1 -1
  97. package/lib/ProgressBar/styles.css +1 -1
  98. package/lib/ProgressStepper/styles.css +1 -1
  99. package/lib/ProgressStepperOverflow/styles.css +1 -1
  100. package/lib/RadioCardGroup/styles.css +1 -1
  101. package/lib/RadioGroup/styles.css +1 -1
  102. package/lib/Rule/styles.css +1 -1
  103. package/lib/ScrollToTop/styles.css +1 -1
  104. package/lib/Section/styles.css +1 -1
  105. package/lib/Select/styles.css +1 -1
  106. package/lib/SemanticButton/styles.css +1 -1
  107. package/lib/SemanticHeading/styles.css +1 -1
  108. package/lib/SemanticLink/styles.css +1 -1
  109. package/lib/SiteFooter/styles.css +1 -1
  110. package/lib/SiteFooterV2/styles.css +1 -1
  111. package/lib/SiteHeaderV2/SiteHeaderV2.cjs +1 -1
  112. package/lib/SiteHeaderV2/SiteHeaderV2.mjs +1 -1
  113. package/lib/SiteHeaderV2/styles.css +1 -1
  114. package/lib/Skeleton/styles.css +1 -1
  115. package/lib/SkipLink/styles.css +1 -1
  116. package/lib/Spacing/styles.css +1 -1
  117. package/lib/Spinner/styles.css +1 -1
  118. package/lib/Surface/styles.css +1 -1
  119. package/lib/Switch/styles.css +1 -1
  120. package/lib/TabbedBanner/TabbedBanner.cjs +4 -4
  121. package/lib/TabbedBanner/TabbedBanner.mjs +4 -4
  122. package/lib/TabbedBanner/styles.css +1 -1
  123. package/lib/Tabs/styles.css +1 -1
  124. package/lib/Tag/styles.css +1 -1
  125. package/lib/TemplateBanner/TemplateBanner.cjs +4 -4
  126. package/lib/TemplateBanner/TemplateBanner.mjs +4 -4
  127. package/lib/TemplateBanner/styles.css +1 -1
  128. package/lib/Text/styles.css +1 -1
  129. package/lib/TextArea/styles.css +1 -1
  130. package/lib/TextInput/styles.css +1 -1
  131. package/lib/Theme/Theme.cjs +1 -1
  132. package/lib/Theme/Theme.mjs +1 -1
  133. package/lib/Theme/styles.css +1 -1
  134. package/lib/ThemeIcon/styles.css +1 -1
  135. package/lib/ThumbnailSignpost/styles.css +1 -1
  136. package/lib/Toast/styles.css +1 -1
  137. package/lib/Tooltip/styles.css +1 -1
  138. package/lib/Truncate/styles.css +1 -1
  139. package/lib/TypographyCard/TypographyCard.cjs +2 -2
  140. package/lib/TypographyCard/TypographyCard.mjs +2 -2
  141. package/lib/TypographyCard/styles.css +1 -1
  142. package/lib/UniversalHeader/styles.css +1 -1
  143. package/lib/VerticalSpace/styles.css +1 -1
  144. package/lib/VideoPlayer/VideoPlayer.cjs +13 -3202
  145. package/lib/VideoPlayer/VideoPlayer.mjs +12 -3205
  146. package/lib/VideoPlayer/styles.css +1 -1
  147. package/lib/Visible/styles.css +1 -1
  148. package/lib/VisuallyHidden/styles.css +1 -1
  149. package/lib/_shared/cjs/{Avatar-CCKArHo9.cjs → Avatar-CYXaBl4s.cjs} +1 -1
  150. package/lib/_shared/cjs/{Calendar-DOI8slQy.cjs → Calendar-x-TJC12N.cjs} +2 -2
  151. package/lib/_shared/cjs/{CardHeading-DYXhbbAA.cjs → CardHeading-XASxN-OQ.cjs} +1 -1
  152. package/lib/_shared/cjs/{Heading-BYBmZkmS.cjs → Heading-CQ6V8dWX.cjs} +1 -1
  153. package/lib/_shared/cjs/{TemplateBanner-CUHZTp2K.cjs → TemplateBanner-fi8Xp8R7.cjs} +2 -2
  154. package/lib/_shared/cjs/VideoPlayer-K5n2domz.cjs +3207 -0
  155. package/lib/_shared/cjs/{arc-breakpoints-D2THNmxe.cjs → arc-breakpoints-BFeZhupn.cjs} +1 -1
  156. package/lib/_shared/cjs/{index.es-a0ndq8qQ.cjs → index.es-brnNzCzO.cjs} +1 -1
  157. package/lib/_shared/esm/{Avatar-BgK-wY7Z.mjs → Avatar-DAjYTtU7.mjs} +1 -1
  158. package/lib/_shared/esm/{Calendar-BgyYgEPb.mjs → Calendar-dD3cX6aM.mjs} +2 -2
  159. package/lib/_shared/esm/{CardHeading-qBsGPj6s.mjs → CardHeading-CVpRimLm.mjs} +1 -1
  160. package/lib/_shared/esm/{Heading-Da-o0d5x.mjs → Heading-Cy5w6sbI.mjs} +1 -1
  161. package/lib/_shared/esm/{TemplateBanner-Crclj4hH.mjs → TemplateBanner-CBGSP4hM.mjs} +2 -2
  162. package/lib/_shared/esm/VideoPlayer-qxBM7l1V.mjs +3205 -0
  163. package/lib/_shared/esm/{arc-breakpoints-6cC0tvcV.mjs → arc-breakpoints-Cd4sS7mw.mjs} +1 -1
  164. package/lib/_shared/esm/{index.es-DXwZFu6j.mjs → index.es-mnMhOE77.mjs} +1 -1
  165. package/lib/index.cjs +8054 -8011
  166. package/lib/index.cjs.map +1 -1
  167. package/lib/index.d.cts +97 -52
  168. package/lib/index.d.mts +97 -52
  169. package/lib/index.js.map +1 -1
  170. package/lib/index.mjs +8053 -8011
  171. package/lib/index.mjs.map +1 -1
  172. package/lib/styles.css +5 -3
  173. package/package.json +6 -6
@@ -0,0 +1,3205 @@
1
+ import { _ as __rest, a as __assign } from './tslib.es6-w7hdJ3oZ.mjs';
2
+ import React__default, { useState, useEffect } from 'react';
3
+ import { b as getAugmentedNamespace, a as commonjsGlobal, g as getDefaultExportFromCjs, c as classNames } from './index-5C0-U8cc.mjs';
4
+ import { f as filterAttrs } from './filter-attrs-v_SweZXP.mjs';
5
+ import { V as VisuallyHidden } from './VisuallyHidden-aSQ4RA1o.mjs';
6
+ import { V as VerticalSpace } from './VerticalSpace-BLWB02I7.mjs';
7
+ import { H as Heading } from './Heading-Cy5w6sbI.mjs';
8
+ import { T as Text } from './Text-BAzOkkzN.mjs';
9
+ import { D as Download } from './Download-CsJLNRAD.mjs';
10
+ import { D as DisclosureMini } from './DisclosureMini-DeQZyvDN.mjs';
11
+ import { T as ThemeIcon } from './ThemeIcon-B0n6cKRb.mjs';
12
+
13
+ var cjs;
14
+ var hasRequiredCjs;
15
+
16
+ function requireCjs () {
17
+ if (hasRequiredCjs) return cjs;
18
+ hasRequiredCjs = 1;
19
+
20
+ var isMergeableObject = function isMergeableObject(value) {
21
+ return isNonNullObject(value)
22
+ && !isSpecial(value)
23
+ };
24
+
25
+ function isNonNullObject(value) {
26
+ return !!value && typeof value === 'object'
27
+ }
28
+
29
+ function isSpecial(value) {
30
+ var stringValue = Object.prototype.toString.call(value);
31
+
32
+ return stringValue === '[object RegExp]'
33
+ || stringValue === '[object Date]'
34
+ || isReactElement(value)
35
+ }
36
+
37
+ // see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
38
+ var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
39
+ var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
40
+
41
+ function isReactElement(value) {
42
+ return value.$$typeof === REACT_ELEMENT_TYPE
43
+ }
44
+
45
+ function emptyTarget(val) {
46
+ return Array.isArray(val) ? [] : {}
47
+ }
48
+
49
+ function cloneUnlessOtherwiseSpecified(value, options) {
50
+ return (options.clone !== false && options.isMergeableObject(value))
51
+ ? deepmerge(emptyTarget(value), value, options)
52
+ : value
53
+ }
54
+
55
+ function defaultArrayMerge(target, source, options) {
56
+ return target.concat(source).map(function(element) {
57
+ return cloneUnlessOtherwiseSpecified(element, options)
58
+ })
59
+ }
60
+
61
+ function getMergeFunction(key, options) {
62
+ if (!options.customMerge) {
63
+ return deepmerge
64
+ }
65
+ var customMerge = options.customMerge(key);
66
+ return typeof customMerge === 'function' ? customMerge : deepmerge
67
+ }
68
+
69
+ function getEnumerableOwnPropertySymbols(target) {
70
+ return Object.getOwnPropertySymbols
71
+ ? Object.getOwnPropertySymbols(target).filter(function(symbol) {
72
+ return Object.propertyIsEnumerable.call(target, symbol)
73
+ })
74
+ : []
75
+ }
76
+
77
+ function getKeys(target) {
78
+ return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
79
+ }
80
+
81
+ function propertyIsOnObject(object, property) {
82
+ try {
83
+ return property in object
84
+ } catch(_) {
85
+ return false
86
+ }
87
+ }
88
+
89
+ // Protects from prototype poisoning and unexpected merging up the prototype chain.
90
+ function propertyIsUnsafe(target, key) {
91
+ return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
92
+ && !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
93
+ && Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
94
+ }
95
+
96
+ function mergeObject(target, source, options) {
97
+ var destination = {};
98
+ if (options.isMergeableObject(target)) {
99
+ getKeys(target).forEach(function(key) {
100
+ destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
101
+ });
102
+ }
103
+ getKeys(source).forEach(function(key) {
104
+ if (propertyIsUnsafe(target, key)) {
105
+ return
106
+ }
107
+
108
+ if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
109
+ destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
110
+ } else {
111
+ destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
112
+ }
113
+ });
114
+ return destination
115
+ }
116
+
117
+ function deepmerge(target, source, options) {
118
+ options = options || {};
119
+ options.arrayMerge = options.arrayMerge || defaultArrayMerge;
120
+ options.isMergeableObject = options.isMergeableObject || isMergeableObject;
121
+ // cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
122
+ // implementations can use it. The caller may not replace it.
123
+ options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
124
+
125
+ var sourceIsArray = Array.isArray(source);
126
+ var targetIsArray = Array.isArray(target);
127
+ var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
128
+
129
+ if (!sourceAndTargetTypesMatch) {
130
+ return cloneUnlessOtherwiseSpecified(source, options)
131
+ } else if (sourceIsArray) {
132
+ return options.arrayMerge(target, source, options)
133
+ } else {
134
+ return mergeObject(target, source, options)
135
+ }
136
+ }
137
+
138
+ deepmerge.all = function deepmergeAll(array, options) {
139
+ if (!Array.isArray(array)) {
140
+ throw new Error('first argument should be an array')
141
+ }
142
+
143
+ return array.reduce(function(prev, next) {
144
+ return deepmerge(prev, next, options)
145
+ }, {})
146
+ };
147
+
148
+ var deepmerge_1 = deepmerge;
149
+
150
+ cjs = deepmerge_1;
151
+ return cjs;
152
+ }
153
+
154
+ var safeIsNaN = Number.isNaN ||
155
+ function ponyfill(value) {
156
+ return typeof value === 'number' && value !== value;
157
+ };
158
+ function isEqual(first, second) {
159
+ if (first === second) {
160
+ return true;
161
+ }
162
+ if (safeIsNaN(first) && safeIsNaN(second)) {
163
+ return true;
164
+ }
165
+ return false;
166
+ }
167
+ function areInputsEqual(newInputs, lastInputs) {
168
+ if (newInputs.length !== lastInputs.length) {
169
+ return false;
170
+ }
171
+ for (var i = 0; i < newInputs.length; i++) {
172
+ if (!isEqual(newInputs[i], lastInputs[i])) {
173
+ return false;
174
+ }
175
+ }
176
+ return true;
177
+ }
178
+
179
+ function memoizeOne(resultFn, isEqual) {
180
+ if (isEqual === void 0) { isEqual = areInputsEqual; }
181
+ var lastThis;
182
+ var lastArgs = [];
183
+ var lastResult;
184
+ var calledOnce = false;
185
+ function memoized() {
186
+ var newArgs = [];
187
+ for (var _i = 0; _i < arguments.length; _i++) {
188
+ newArgs[_i] = arguments[_i];
189
+ }
190
+ if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {
191
+ return lastResult;
192
+ }
193
+ lastResult = resultFn.apply(this, newArgs);
194
+ calledOnce = true;
195
+ lastThis = this;
196
+ lastArgs = newArgs;
197
+ return lastResult;
198
+ }
199
+ return memoized;
200
+ }
201
+
202
+ var memoizeOne_esm = /*#__PURE__*/Object.freeze({
203
+ __proto__: null,
204
+ default: memoizeOne
205
+ });
206
+
207
+ var require$$2 = /*@__PURE__*/getAugmentedNamespace(memoizeOne_esm);
208
+
209
+ /* global Map:readonly, Set:readonly, ArrayBuffer:readonly */
210
+
211
+ var reactFastCompare;
212
+ var hasRequiredReactFastCompare;
213
+
214
+ function requireReactFastCompare () {
215
+ if (hasRequiredReactFastCompare) return reactFastCompare;
216
+ hasRequiredReactFastCompare = 1;
217
+ var hasElementType = typeof Element !== 'undefined';
218
+ var hasMap = typeof Map === 'function';
219
+ var hasSet = typeof Set === 'function';
220
+ var hasArrayBuffer = typeof ArrayBuffer === 'function' && !!ArrayBuffer.isView;
221
+
222
+ // Note: We **don't** need `envHasBigInt64Array` in fde es6/index.js
223
+
224
+ function equal(a, b) {
225
+ // START: fast-deep-equal es6/index.js 3.1.3
226
+ if (a === b) return true;
227
+
228
+ if (a && b && typeof a == 'object' && typeof b == 'object') {
229
+ if (a.constructor !== b.constructor) return false;
230
+
231
+ var length, i, keys;
232
+ if (Array.isArray(a)) {
233
+ length = a.length;
234
+ if (length != b.length) return false;
235
+ for (i = length; i-- !== 0;)
236
+ if (!equal(a[i], b[i])) return false;
237
+ return true;
238
+ }
239
+
240
+ // START: Modifications:
241
+ // 1. Extra `has<Type> &&` helpers in initial condition allow es6 code
242
+ // to co-exist with es5.
243
+ // 2. Replace `for of` with es5 compliant iteration using `for`.
244
+ // Basically, take:
245
+ //
246
+ // ```js
247
+ // for (i of a.entries())
248
+ // if (!b.has(i[0])) return false;
249
+ // ```
250
+ //
251
+ // ... and convert to:
252
+ //
253
+ // ```js
254
+ // it = a.entries();
255
+ // while (!(i = it.next()).done)
256
+ // if (!b.has(i.value[0])) return false;
257
+ // ```
258
+ //
259
+ // **Note**: `i` access switches to `i.value`.
260
+ var it;
261
+ if (hasMap && (a instanceof Map) && (b instanceof Map)) {
262
+ if (a.size !== b.size) return false;
263
+ it = a.entries();
264
+ while (!(i = it.next()).done)
265
+ if (!b.has(i.value[0])) return false;
266
+ it = a.entries();
267
+ while (!(i = it.next()).done)
268
+ if (!equal(i.value[1], b.get(i.value[0]))) return false;
269
+ return true;
270
+ }
271
+
272
+ if (hasSet && (a instanceof Set) && (b instanceof Set)) {
273
+ if (a.size !== b.size) return false;
274
+ it = a.entries();
275
+ while (!(i = it.next()).done)
276
+ if (!b.has(i.value[0])) return false;
277
+ return true;
278
+ }
279
+ // END: Modifications
280
+
281
+ if (hasArrayBuffer && ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
282
+ length = a.length;
283
+ if (length != b.length) return false;
284
+ for (i = length; i-- !== 0;)
285
+ if (a[i] !== b[i]) return false;
286
+ return true;
287
+ }
288
+
289
+ if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
290
+ // START: Modifications:
291
+ // Apply guards for `Object.create(null)` handling. See:
292
+ // - https://github.com/FormidableLabs/react-fast-compare/issues/64
293
+ // - https://github.com/epoberezkin/fast-deep-equal/issues/49
294
+ if (a.valueOf !== Object.prototype.valueOf && typeof a.valueOf === 'function' && typeof b.valueOf === 'function') return a.valueOf() === b.valueOf();
295
+ if (a.toString !== Object.prototype.toString && typeof a.toString === 'function' && typeof b.toString === 'function') return a.toString() === b.toString();
296
+ // END: Modifications
297
+
298
+ keys = Object.keys(a);
299
+ length = keys.length;
300
+ if (length !== Object.keys(b).length) return false;
301
+
302
+ for (i = length; i-- !== 0;)
303
+ if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
304
+ // END: fast-deep-equal
305
+
306
+ // START: react-fast-compare
307
+ // custom handling for DOM elements
308
+ if (hasElementType && a instanceof Element) return false;
309
+
310
+ // custom handling for React/Preact
311
+ for (i = length; i-- !== 0;) {
312
+ if ((keys[i] === '_owner' || keys[i] === '__v' || keys[i] === '__o') && a.$$typeof) {
313
+ // React-specific: avoid traversing React elements' _owner
314
+ // Preact-specific: avoid traversing Preact elements' __v and __o
315
+ // __v = $_original / $_vnode
316
+ // __o = $_owner
317
+ // These properties contain circular references and are not needed when
318
+ // comparing the actual elements (and not their owners)
319
+ // .$$typeof and ._store on just reasonable markers of elements
320
+
321
+ continue;
322
+ }
323
+
324
+ // all other properties should be traversed as usual
325
+ if (!equal(a[keys[i]], b[keys[i]])) return false;
326
+ }
327
+ // END: react-fast-compare
328
+
329
+ // START: fast-deep-equal
330
+ return true;
331
+ }
332
+
333
+ return a !== a && b !== b;
334
+ }
335
+ // end fast-deep-equal
336
+
337
+ reactFastCompare = function isEqual(a, b) {
338
+ try {
339
+ return equal(a, b);
340
+ } catch (error) {
341
+ if (((error.message || '').match(/stack|recursion/i))) {
342
+ // warn on circular references, don't crash
343
+ // browsers give this different errors name and messages:
344
+ // chrome/safari: "RangeError", "Maximum call stack size exceeded"
345
+ // firefox: "InternalError", too much recursion"
346
+ // edge: "Error", "Out of stack space"
347
+ console.warn('react-fast-compare cannot handle circular refs');
348
+ return false;
349
+ }
350
+ // some other error. we should definitely know about these
351
+ throw error;
352
+ }
353
+ };
354
+ return reactFastCompare;
355
+ }
356
+
357
+ var propTypes = {exports: {}};
358
+
359
+ var reactIs = {exports: {}};
360
+
361
+ var reactIs_production_min = {};
362
+
363
+ /** @license React v16.13.1
364
+ * react-is.production.min.js
365
+ *
366
+ * Copyright (c) Facebook, Inc. and its affiliates.
367
+ *
368
+ * This source code is licensed under the MIT license found in the
369
+ * LICENSE file in the root directory of this source tree.
370
+ */
371
+
372
+ var hasRequiredReactIs_production_min;
373
+
374
+ function requireReactIs_production_min () {
375
+ if (hasRequiredReactIs_production_min) return reactIs_production_min;
376
+ hasRequiredReactIs_production_min = 1;
377
+ var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
378
+ Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
379
+ function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
380
+ reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
381
+ reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
382
+ reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
383
+ return reactIs_production_min;
384
+ }
385
+
386
+ var reactIs_development = {};
387
+
388
+ /** @license React v16.13.1
389
+ * react-is.development.js
390
+ *
391
+ * Copyright (c) Facebook, Inc. and its affiliates.
392
+ *
393
+ * This source code is licensed under the MIT license found in the
394
+ * LICENSE file in the root directory of this source tree.
395
+ */
396
+
397
+ var hasRequiredReactIs_development;
398
+
399
+ function requireReactIs_development () {
400
+ if (hasRequiredReactIs_development) return reactIs_development;
401
+ hasRequiredReactIs_development = 1;
402
+
403
+
404
+
405
+ if (process.env.NODE_ENV !== "production") {
406
+ (function() {
407
+
408
+ // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
409
+ // nor polyfill, then a plain number is used for performance.
410
+ var hasSymbol = typeof Symbol === 'function' && Symbol.for;
411
+ var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
412
+ var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
413
+ var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
414
+ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
415
+ var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
416
+ var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
417
+ var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
418
+ // (unstable) APIs that have been removed. Can we remove the symbols?
419
+
420
+ var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
421
+ var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
422
+ var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
423
+ var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
424
+ var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
425
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
426
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
427
+ var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
428
+ var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
429
+ var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
430
+ var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
431
+
432
+ function isValidElementType(type) {
433
+ return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
434
+ type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
435
+ }
436
+
437
+ function typeOf(object) {
438
+ if (typeof object === 'object' && object !== null) {
439
+ var $$typeof = object.$$typeof;
440
+
441
+ switch ($$typeof) {
442
+ case REACT_ELEMENT_TYPE:
443
+ var type = object.type;
444
+
445
+ switch (type) {
446
+ case REACT_ASYNC_MODE_TYPE:
447
+ case REACT_CONCURRENT_MODE_TYPE:
448
+ case REACT_FRAGMENT_TYPE:
449
+ case REACT_PROFILER_TYPE:
450
+ case REACT_STRICT_MODE_TYPE:
451
+ case REACT_SUSPENSE_TYPE:
452
+ return type;
453
+
454
+ default:
455
+ var $$typeofType = type && type.$$typeof;
456
+
457
+ switch ($$typeofType) {
458
+ case REACT_CONTEXT_TYPE:
459
+ case REACT_FORWARD_REF_TYPE:
460
+ case REACT_LAZY_TYPE:
461
+ case REACT_MEMO_TYPE:
462
+ case REACT_PROVIDER_TYPE:
463
+ return $$typeofType;
464
+
465
+ default:
466
+ return $$typeof;
467
+ }
468
+
469
+ }
470
+
471
+ case REACT_PORTAL_TYPE:
472
+ return $$typeof;
473
+ }
474
+ }
475
+
476
+ return undefined;
477
+ } // AsyncMode is deprecated along with isAsyncMode
478
+
479
+ var AsyncMode = REACT_ASYNC_MODE_TYPE;
480
+ var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
481
+ var ContextConsumer = REACT_CONTEXT_TYPE;
482
+ var ContextProvider = REACT_PROVIDER_TYPE;
483
+ var Element = REACT_ELEMENT_TYPE;
484
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
485
+ var Fragment = REACT_FRAGMENT_TYPE;
486
+ var Lazy = REACT_LAZY_TYPE;
487
+ var Memo = REACT_MEMO_TYPE;
488
+ var Portal = REACT_PORTAL_TYPE;
489
+ var Profiler = REACT_PROFILER_TYPE;
490
+ var StrictMode = REACT_STRICT_MODE_TYPE;
491
+ var Suspense = REACT_SUSPENSE_TYPE;
492
+ var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
493
+
494
+ function isAsyncMode(object) {
495
+ {
496
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
497
+ hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
498
+
499
+ console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
500
+ }
501
+ }
502
+
503
+ return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
504
+ }
505
+ function isConcurrentMode(object) {
506
+ return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
507
+ }
508
+ function isContextConsumer(object) {
509
+ return typeOf(object) === REACT_CONTEXT_TYPE;
510
+ }
511
+ function isContextProvider(object) {
512
+ return typeOf(object) === REACT_PROVIDER_TYPE;
513
+ }
514
+ function isElement(object) {
515
+ return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
516
+ }
517
+ function isForwardRef(object) {
518
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
519
+ }
520
+ function isFragment(object) {
521
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
522
+ }
523
+ function isLazy(object) {
524
+ return typeOf(object) === REACT_LAZY_TYPE;
525
+ }
526
+ function isMemo(object) {
527
+ return typeOf(object) === REACT_MEMO_TYPE;
528
+ }
529
+ function isPortal(object) {
530
+ return typeOf(object) === REACT_PORTAL_TYPE;
531
+ }
532
+ function isProfiler(object) {
533
+ return typeOf(object) === REACT_PROFILER_TYPE;
534
+ }
535
+ function isStrictMode(object) {
536
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
537
+ }
538
+ function isSuspense(object) {
539
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
540
+ }
541
+
542
+ reactIs_development.AsyncMode = AsyncMode;
543
+ reactIs_development.ConcurrentMode = ConcurrentMode;
544
+ reactIs_development.ContextConsumer = ContextConsumer;
545
+ reactIs_development.ContextProvider = ContextProvider;
546
+ reactIs_development.Element = Element;
547
+ reactIs_development.ForwardRef = ForwardRef;
548
+ reactIs_development.Fragment = Fragment;
549
+ reactIs_development.Lazy = Lazy;
550
+ reactIs_development.Memo = Memo;
551
+ reactIs_development.Portal = Portal;
552
+ reactIs_development.Profiler = Profiler;
553
+ reactIs_development.StrictMode = StrictMode;
554
+ reactIs_development.Suspense = Suspense;
555
+ reactIs_development.isAsyncMode = isAsyncMode;
556
+ reactIs_development.isConcurrentMode = isConcurrentMode;
557
+ reactIs_development.isContextConsumer = isContextConsumer;
558
+ reactIs_development.isContextProvider = isContextProvider;
559
+ reactIs_development.isElement = isElement;
560
+ reactIs_development.isForwardRef = isForwardRef;
561
+ reactIs_development.isFragment = isFragment;
562
+ reactIs_development.isLazy = isLazy;
563
+ reactIs_development.isMemo = isMemo;
564
+ reactIs_development.isPortal = isPortal;
565
+ reactIs_development.isProfiler = isProfiler;
566
+ reactIs_development.isStrictMode = isStrictMode;
567
+ reactIs_development.isSuspense = isSuspense;
568
+ reactIs_development.isValidElementType = isValidElementType;
569
+ reactIs_development.typeOf = typeOf;
570
+ })();
571
+ }
572
+ return reactIs_development;
573
+ }
574
+
575
+ var hasRequiredReactIs;
576
+
577
+ function requireReactIs () {
578
+ if (hasRequiredReactIs) return reactIs.exports;
579
+ hasRequiredReactIs = 1;
580
+
581
+ if (process.env.NODE_ENV === 'production') {
582
+ reactIs.exports = requireReactIs_production_min();
583
+ } else {
584
+ reactIs.exports = requireReactIs_development();
585
+ }
586
+ return reactIs.exports;
587
+ }
588
+
589
+ /*
590
+ object-assign
591
+ (c) Sindre Sorhus
592
+ @license MIT
593
+ */
594
+
595
+ var objectAssign;
596
+ var hasRequiredObjectAssign;
597
+
598
+ function requireObjectAssign () {
599
+ if (hasRequiredObjectAssign) return objectAssign;
600
+ hasRequiredObjectAssign = 1;
601
+ /* eslint-disable no-unused-vars */
602
+ var getOwnPropertySymbols = Object.getOwnPropertySymbols;
603
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
604
+ var propIsEnumerable = Object.prototype.propertyIsEnumerable;
605
+
606
+ function toObject(val) {
607
+ if (val === null || val === undefined) {
608
+ throw new TypeError('Object.assign cannot be called with null or undefined');
609
+ }
610
+
611
+ return Object(val);
612
+ }
613
+
614
+ function shouldUseNative() {
615
+ try {
616
+ if (!Object.assign) {
617
+ return false;
618
+ }
619
+
620
+ // Detect buggy property enumeration order in older V8 versions.
621
+
622
+ // https://bugs.chromium.org/p/v8/issues/detail?id=4118
623
+ var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
624
+ test1[5] = 'de';
625
+ if (Object.getOwnPropertyNames(test1)[0] === '5') {
626
+ return false;
627
+ }
628
+
629
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
630
+ var test2 = {};
631
+ for (var i = 0; i < 10; i++) {
632
+ test2['_' + String.fromCharCode(i)] = i;
633
+ }
634
+ var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
635
+ return test2[n];
636
+ });
637
+ if (order2.join('') !== '0123456789') {
638
+ return false;
639
+ }
640
+
641
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3056
642
+ var test3 = {};
643
+ 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
644
+ test3[letter] = letter;
645
+ });
646
+ if (Object.keys(Object.assign({}, test3)).join('') !==
647
+ 'abcdefghijklmnopqrst') {
648
+ return false;
649
+ }
650
+
651
+ return true;
652
+ } catch (err) {
653
+ // We don't expect any of the above to throw, but better to be safe.
654
+ return false;
655
+ }
656
+ }
657
+
658
+ objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
659
+ var from;
660
+ var to = toObject(target);
661
+ var symbols;
662
+
663
+ for (var s = 1; s < arguments.length; s++) {
664
+ from = Object(arguments[s]);
665
+
666
+ for (var key in from) {
667
+ if (hasOwnProperty.call(from, key)) {
668
+ to[key] = from[key];
669
+ }
670
+ }
671
+
672
+ if (getOwnPropertySymbols) {
673
+ symbols = getOwnPropertySymbols(from);
674
+ for (var i = 0; i < symbols.length; i++) {
675
+ if (propIsEnumerable.call(from, symbols[i])) {
676
+ to[symbols[i]] = from[symbols[i]];
677
+ }
678
+ }
679
+ }
680
+ }
681
+
682
+ return to;
683
+ };
684
+ return objectAssign;
685
+ }
686
+
687
+ /**
688
+ * Copyright (c) 2013-present, Facebook, Inc.
689
+ *
690
+ * This source code is licensed under the MIT license found in the
691
+ * LICENSE file in the root directory of this source tree.
692
+ */
693
+
694
+ var ReactPropTypesSecret_1;
695
+ var hasRequiredReactPropTypesSecret;
696
+
697
+ function requireReactPropTypesSecret () {
698
+ if (hasRequiredReactPropTypesSecret) return ReactPropTypesSecret_1;
699
+ hasRequiredReactPropTypesSecret = 1;
700
+
701
+ var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
702
+
703
+ ReactPropTypesSecret_1 = ReactPropTypesSecret;
704
+ return ReactPropTypesSecret_1;
705
+ }
706
+
707
+ var has;
708
+ var hasRequiredHas;
709
+
710
+ function requireHas () {
711
+ if (hasRequiredHas) return has;
712
+ hasRequiredHas = 1;
713
+ has = Function.call.bind(Object.prototype.hasOwnProperty);
714
+ return has;
715
+ }
716
+
717
+ /**
718
+ * Copyright (c) 2013-present, Facebook, Inc.
719
+ *
720
+ * This source code is licensed under the MIT license found in the
721
+ * LICENSE file in the root directory of this source tree.
722
+ */
723
+
724
+ var checkPropTypes_1;
725
+ var hasRequiredCheckPropTypes;
726
+
727
+ function requireCheckPropTypes () {
728
+ if (hasRequiredCheckPropTypes) return checkPropTypes_1;
729
+ hasRequiredCheckPropTypes = 1;
730
+
731
+ var printWarning = function() {};
732
+
733
+ if (process.env.NODE_ENV !== 'production') {
734
+ var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
735
+ var loggedTypeFailures = {};
736
+ var has = /*@__PURE__*/ requireHas();
737
+
738
+ printWarning = function(text) {
739
+ var message = 'Warning: ' + text;
740
+ if (typeof console !== 'undefined') {
741
+ console.error(message);
742
+ }
743
+ try {
744
+ // --- Welcome to debugging React ---
745
+ // This error was thrown as a convenience so that you can use this stack
746
+ // to find the callsite that caused this warning to fire.
747
+ throw new Error(message);
748
+ } catch (x) { /**/ }
749
+ };
750
+ }
751
+
752
+ /**
753
+ * Assert that the values match with the type specs.
754
+ * Error messages are memorized and will only be shown once.
755
+ *
756
+ * @param {object} typeSpecs Map of name to a ReactPropType
757
+ * @param {object} values Runtime values that need to be type-checked
758
+ * @param {string} location e.g. "prop", "context", "child context"
759
+ * @param {string} componentName Name of the component for error messages.
760
+ * @param {?Function} getStack Returns the component stack.
761
+ * @private
762
+ */
763
+ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
764
+ if (process.env.NODE_ENV !== 'production') {
765
+ for (var typeSpecName in typeSpecs) {
766
+ if (has(typeSpecs, typeSpecName)) {
767
+ var error;
768
+ // Prop type validation may throw. In case they do, we don't want to
769
+ // fail the render phase where it didn't fail before. So we log it.
770
+ // After these have been cleaned up, we'll let them throw.
771
+ try {
772
+ // This is intentionally an invariant that gets caught. It's the same
773
+ // behavior as without this statement except with a better message.
774
+ if (typeof typeSpecs[typeSpecName] !== 'function') {
775
+ var err = Error(
776
+ (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
777
+ 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
778
+ 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
779
+ );
780
+ err.name = 'Invariant Violation';
781
+ throw err;
782
+ }
783
+ error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
784
+ } catch (ex) {
785
+ error = ex;
786
+ }
787
+ if (error && !(error instanceof Error)) {
788
+ printWarning(
789
+ (componentName || 'React class') + ': type specification of ' +
790
+ location + ' `' + typeSpecName + '` is invalid; the type checker ' +
791
+ 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
792
+ 'You may have forgotten to pass an argument to the type checker ' +
793
+ 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
794
+ 'shape all require an argument).'
795
+ );
796
+ }
797
+ if (error instanceof Error && !(error.message in loggedTypeFailures)) {
798
+ // Only monitor this failure once because there tends to be a lot of the
799
+ // same error.
800
+ loggedTypeFailures[error.message] = true;
801
+
802
+ var stack = getStack ? getStack() : '';
803
+
804
+ printWarning(
805
+ 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
806
+ );
807
+ }
808
+ }
809
+ }
810
+ }
811
+ }
812
+
813
+ /**
814
+ * Resets warning cache when testing.
815
+ *
816
+ * @private
817
+ */
818
+ checkPropTypes.resetWarningCache = function() {
819
+ if (process.env.NODE_ENV !== 'production') {
820
+ loggedTypeFailures = {};
821
+ }
822
+ };
823
+
824
+ checkPropTypes_1 = checkPropTypes;
825
+ return checkPropTypes_1;
826
+ }
827
+
828
+ /**
829
+ * Copyright (c) 2013-present, Facebook, Inc.
830
+ *
831
+ * This source code is licensed under the MIT license found in the
832
+ * LICENSE file in the root directory of this source tree.
833
+ */
834
+
835
+ var factoryWithTypeCheckers;
836
+ var hasRequiredFactoryWithTypeCheckers;
837
+
838
+ function requireFactoryWithTypeCheckers () {
839
+ if (hasRequiredFactoryWithTypeCheckers) return factoryWithTypeCheckers;
840
+ hasRequiredFactoryWithTypeCheckers = 1;
841
+
842
+ var ReactIs = requireReactIs();
843
+ var assign = requireObjectAssign();
844
+
845
+ var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
846
+ var has = /*@__PURE__*/ requireHas();
847
+ var checkPropTypes = /*@__PURE__*/ requireCheckPropTypes();
848
+
849
+ var printWarning = function() {};
850
+
851
+ if (process.env.NODE_ENV !== 'production') {
852
+ printWarning = function(text) {
853
+ var message = 'Warning: ' + text;
854
+ if (typeof console !== 'undefined') {
855
+ console.error(message);
856
+ }
857
+ try {
858
+ // --- Welcome to debugging React ---
859
+ // This error was thrown as a convenience so that you can use this stack
860
+ // to find the callsite that caused this warning to fire.
861
+ throw new Error(message);
862
+ } catch (x) {}
863
+ };
864
+ }
865
+
866
+ function emptyFunctionThatReturnsNull() {
867
+ return null;
868
+ }
869
+
870
+ factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
871
+ /* global Symbol */
872
+ var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
873
+ var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
874
+
875
+ /**
876
+ * Returns the iterator method function contained on the iterable object.
877
+ *
878
+ * Be sure to invoke the function with the iterable as context:
879
+ *
880
+ * var iteratorFn = getIteratorFn(myIterable);
881
+ * if (iteratorFn) {
882
+ * var iterator = iteratorFn.call(myIterable);
883
+ * ...
884
+ * }
885
+ *
886
+ * @param {?object} maybeIterable
887
+ * @return {?function}
888
+ */
889
+ function getIteratorFn(maybeIterable) {
890
+ var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
891
+ if (typeof iteratorFn === 'function') {
892
+ return iteratorFn;
893
+ }
894
+ }
895
+
896
+ /**
897
+ * Collection of methods that allow declaration and validation of props that are
898
+ * supplied to React components. Example usage:
899
+ *
900
+ * var Props = require('ReactPropTypes');
901
+ * var MyArticle = React.createClass({
902
+ * propTypes: {
903
+ * // An optional string prop named "description".
904
+ * description: Props.string,
905
+ *
906
+ * // A required enum prop named "category".
907
+ * category: Props.oneOf(['News','Photos']).isRequired,
908
+ *
909
+ * // A prop named "dialog" that requires an instance of Dialog.
910
+ * dialog: Props.instanceOf(Dialog).isRequired
911
+ * },
912
+ * render: function() { ... }
913
+ * });
914
+ *
915
+ * A more formal specification of how these methods are used:
916
+ *
917
+ * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
918
+ * decl := ReactPropTypes.{type}(.isRequired)?
919
+ *
920
+ * Each and every declaration produces a function with the same signature. This
921
+ * allows the creation of custom validation functions. For example:
922
+ *
923
+ * var MyLink = React.createClass({
924
+ * propTypes: {
925
+ * // An optional string or URI prop named "href".
926
+ * href: function(props, propName, componentName) {
927
+ * var propValue = props[propName];
928
+ * if (propValue != null && typeof propValue !== 'string' &&
929
+ * !(propValue instanceof URI)) {
930
+ * return new Error(
931
+ * 'Expected a string or an URI for ' + propName + ' in ' +
932
+ * componentName
933
+ * );
934
+ * }
935
+ * }
936
+ * },
937
+ * render: function() {...}
938
+ * });
939
+ *
940
+ * @internal
941
+ */
942
+
943
+ var ANONYMOUS = '<<anonymous>>';
944
+
945
+ // Important!
946
+ // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
947
+ var ReactPropTypes = {
948
+ array: createPrimitiveTypeChecker('array'),
949
+ bigint: createPrimitiveTypeChecker('bigint'),
950
+ bool: createPrimitiveTypeChecker('boolean'),
951
+ func: createPrimitiveTypeChecker('function'),
952
+ number: createPrimitiveTypeChecker('number'),
953
+ object: createPrimitiveTypeChecker('object'),
954
+ string: createPrimitiveTypeChecker('string'),
955
+ symbol: createPrimitiveTypeChecker('symbol'),
956
+
957
+ any: createAnyTypeChecker(),
958
+ arrayOf: createArrayOfTypeChecker,
959
+ element: createElementTypeChecker(),
960
+ elementType: createElementTypeTypeChecker(),
961
+ instanceOf: createInstanceTypeChecker,
962
+ node: createNodeChecker(),
963
+ objectOf: createObjectOfTypeChecker,
964
+ oneOf: createEnumTypeChecker,
965
+ oneOfType: createUnionTypeChecker,
966
+ shape: createShapeTypeChecker,
967
+ exact: createStrictShapeTypeChecker,
968
+ };
969
+
970
+ /**
971
+ * inlined Object.is polyfill to avoid requiring consumers ship their own
972
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
973
+ */
974
+ /*eslint-disable no-self-compare*/
975
+ function is(x, y) {
976
+ // SameValue algorithm
977
+ if (x === y) {
978
+ // Steps 1-5, 7-10
979
+ // Steps 6.b-6.e: +0 != -0
980
+ return x !== 0 || 1 / x === 1 / y;
981
+ } else {
982
+ // Step 6.a: NaN == NaN
983
+ return x !== x && y !== y;
984
+ }
985
+ }
986
+ /*eslint-enable no-self-compare*/
987
+
988
+ /**
989
+ * We use an Error-like object for backward compatibility as people may call
990
+ * PropTypes directly and inspect their output. However, we don't use real
991
+ * Errors anymore. We don't inspect their stack anyway, and creating them
992
+ * is prohibitively expensive if they are created too often, such as what
993
+ * happens in oneOfType() for any type before the one that matched.
994
+ */
995
+ function PropTypeError(message, data) {
996
+ this.message = message;
997
+ this.data = data && typeof data === 'object' ? data: {};
998
+ this.stack = '';
999
+ }
1000
+ // Make `instanceof Error` still work for returned errors.
1001
+ PropTypeError.prototype = Error.prototype;
1002
+
1003
+ function createChainableTypeChecker(validate) {
1004
+ if (process.env.NODE_ENV !== 'production') {
1005
+ var manualPropTypeCallCache = {};
1006
+ var manualPropTypeWarningCount = 0;
1007
+ }
1008
+ function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
1009
+ componentName = componentName || ANONYMOUS;
1010
+ propFullName = propFullName || propName;
1011
+
1012
+ if (secret !== ReactPropTypesSecret) {
1013
+ if (throwOnDirectAccess) {
1014
+ // New behavior only for users of `prop-types` package
1015
+ var err = new Error(
1016
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1017
+ 'Use `PropTypes.checkPropTypes()` to call them. ' +
1018
+ 'Read more at http://fb.me/use-check-prop-types'
1019
+ );
1020
+ err.name = 'Invariant Violation';
1021
+ throw err;
1022
+ } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
1023
+ // Old behavior for people using React.PropTypes
1024
+ var cacheKey = componentName + ':' + propName;
1025
+ if (
1026
+ !manualPropTypeCallCache[cacheKey] &&
1027
+ // Avoid spamming the console because they are often not actionable except for lib authors
1028
+ manualPropTypeWarningCount < 3
1029
+ ) {
1030
+ printWarning(
1031
+ 'You are manually calling a React.PropTypes validation ' +
1032
+ 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
1033
+ 'and will throw in the standalone `prop-types` package. ' +
1034
+ 'You may be seeing this warning due to a third-party PropTypes ' +
1035
+ 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
1036
+ );
1037
+ manualPropTypeCallCache[cacheKey] = true;
1038
+ manualPropTypeWarningCount++;
1039
+ }
1040
+ }
1041
+ }
1042
+ if (props[propName] == null) {
1043
+ if (isRequired) {
1044
+ if (props[propName] === null) {
1045
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
1046
+ }
1047
+ return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
1048
+ }
1049
+ return null;
1050
+ } else {
1051
+ return validate(props, propName, componentName, location, propFullName);
1052
+ }
1053
+ }
1054
+
1055
+ var chainedCheckType = checkType.bind(null, false);
1056
+ chainedCheckType.isRequired = checkType.bind(null, true);
1057
+
1058
+ return chainedCheckType;
1059
+ }
1060
+
1061
+ function createPrimitiveTypeChecker(expectedType) {
1062
+ function validate(props, propName, componentName, location, propFullName, secret) {
1063
+ var propValue = props[propName];
1064
+ var propType = getPropType(propValue);
1065
+ if (propType !== expectedType) {
1066
+ // `propValue` being instance of, say, date/regexp, pass the 'object'
1067
+ // check, but we can offer a more precise error message here rather than
1068
+ // 'of type `object`'.
1069
+ var preciseType = getPreciseType(propValue);
1070
+
1071
+ return new PropTypeError(
1072
+ 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
1073
+ {expectedType: expectedType}
1074
+ );
1075
+ }
1076
+ return null;
1077
+ }
1078
+ return createChainableTypeChecker(validate);
1079
+ }
1080
+
1081
+ function createAnyTypeChecker() {
1082
+ return createChainableTypeChecker(emptyFunctionThatReturnsNull);
1083
+ }
1084
+
1085
+ function createArrayOfTypeChecker(typeChecker) {
1086
+ function validate(props, propName, componentName, location, propFullName) {
1087
+ if (typeof typeChecker !== 'function') {
1088
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
1089
+ }
1090
+ var propValue = props[propName];
1091
+ if (!Array.isArray(propValue)) {
1092
+ var propType = getPropType(propValue);
1093
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
1094
+ }
1095
+ for (var i = 0; i < propValue.length; i++) {
1096
+ var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);
1097
+ if (error instanceof Error) {
1098
+ return error;
1099
+ }
1100
+ }
1101
+ return null;
1102
+ }
1103
+ return createChainableTypeChecker(validate);
1104
+ }
1105
+
1106
+ function createElementTypeChecker() {
1107
+ function validate(props, propName, componentName, location, propFullName) {
1108
+ var propValue = props[propName];
1109
+ if (!isValidElement(propValue)) {
1110
+ var propType = getPropType(propValue);
1111
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
1112
+ }
1113
+ return null;
1114
+ }
1115
+ return createChainableTypeChecker(validate);
1116
+ }
1117
+
1118
+ function createElementTypeTypeChecker() {
1119
+ function validate(props, propName, componentName, location, propFullName) {
1120
+ var propValue = props[propName];
1121
+ if (!ReactIs.isValidElementType(propValue)) {
1122
+ var propType = getPropType(propValue);
1123
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
1124
+ }
1125
+ return null;
1126
+ }
1127
+ return createChainableTypeChecker(validate);
1128
+ }
1129
+
1130
+ function createInstanceTypeChecker(expectedClass) {
1131
+ function validate(props, propName, componentName, location, propFullName) {
1132
+ if (!(props[propName] instanceof expectedClass)) {
1133
+ var expectedClassName = expectedClass.name || ANONYMOUS;
1134
+ var actualClassName = getClassName(props[propName]);
1135
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
1136
+ }
1137
+ return null;
1138
+ }
1139
+ return createChainableTypeChecker(validate);
1140
+ }
1141
+
1142
+ function createEnumTypeChecker(expectedValues) {
1143
+ if (!Array.isArray(expectedValues)) {
1144
+ if (process.env.NODE_ENV !== 'production') {
1145
+ if (arguments.length > 1) {
1146
+ printWarning(
1147
+ 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
1148
+ 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
1149
+ );
1150
+ } else {
1151
+ printWarning('Invalid argument supplied to oneOf, expected an array.');
1152
+ }
1153
+ }
1154
+ return emptyFunctionThatReturnsNull;
1155
+ }
1156
+
1157
+ function validate(props, propName, componentName, location, propFullName) {
1158
+ var propValue = props[propName];
1159
+ for (var i = 0; i < expectedValues.length; i++) {
1160
+ if (is(propValue, expectedValues[i])) {
1161
+ return null;
1162
+ }
1163
+ }
1164
+
1165
+ var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
1166
+ var type = getPreciseType(value);
1167
+ if (type === 'symbol') {
1168
+ return String(value);
1169
+ }
1170
+ return value;
1171
+ });
1172
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
1173
+ }
1174
+ return createChainableTypeChecker(validate);
1175
+ }
1176
+
1177
+ function createObjectOfTypeChecker(typeChecker) {
1178
+ function validate(props, propName, componentName, location, propFullName) {
1179
+ if (typeof typeChecker !== 'function') {
1180
+ return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
1181
+ }
1182
+ var propValue = props[propName];
1183
+ var propType = getPropType(propValue);
1184
+ if (propType !== 'object') {
1185
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
1186
+ }
1187
+ for (var key in propValue) {
1188
+ if (has(propValue, key)) {
1189
+ var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1190
+ if (error instanceof Error) {
1191
+ return error;
1192
+ }
1193
+ }
1194
+ }
1195
+ return null;
1196
+ }
1197
+ return createChainableTypeChecker(validate);
1198
+ }
1199
+
1200
+ function createUnionTypeChecker(arrayOfTypeCheckers) {
1201
+ if (!Array.isArray(arrayOfTypeCheckers)) {
1202
+ process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
1203
+ return emptyFunctionThatReturnsNull;
1204
+ }
1205
+
1206
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1207
+ var checker = arrayOfTypeCheckers[i];
1208
+ if (typeof checker !== 'function') {
1209
+ printWarning(
1210
+ 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
1211
+ 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
1212
+ );
1213
+ return emptyFunctionThatReturnsNull;
1214
+ }
1215
+ }
1216
+
1217
+ function validate(props, propName, componentName, location, propFullName) {
1218
+ var expectedTypes = [];
1219
+ for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
1220
+ var checker = arrayOfTypeCheckers[i];
1221
+ var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret);
1222
+ if (checkerResult == null) {
1223
+ return null;
1224
+ }
1225
+ if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
1226
+ expectedTypes.push(checkerResult.data.expectedType);
1227
+ }
1228
+ }
1229
+ var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
1230
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
1231
+ }
1232
+ return createChainableTypeChecker(validate);
1233
+ }
1234
+
1235
+ function createNodeChecker() {
1236
+ function validate(props, propName, componentName, location, propFullName) {
1237
+ if (!isNode(props[propName])) {
1238
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
1239
+ }
1240
+ return null;
1241
+ }
1242
+ return createChainableTypeChecker(validate);
1243
+ }
1244
+
1245
+ function invalidValidatorError(componentName, location, propFullName, key, type) {
1246
+ return new PropTypeError(
1247
+ (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
1248
+ 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
1249
+ );
1250
+ }
1251
+
1252
+ function createShapeTypeChecker(shapeTypes) {
1253
+ function validate(props, propName, componentName, location, propFullName) {
1254
+ var propValue = props[propName];
1255
+ var propType = getPropType(propValue);
1256
+ if (propType !== 'object') {
1257
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1258
+ }
1259
+ for (var key in shapeTypes) {
1260
+ var checker = shapeTypes[key];
1261
+ if (typeof checker !== 'function') {
1262
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1263
+ }
1264
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1265
+ if (error) {
1266
+ return error;
1267
+ }
1268
+ }
1269
+ return null;
1270
+ }
1271
+ return createChainableTypeChecker(validate);
1272
+ }
1273
+
1274
+ function createStrictShapeTypeChecker(shapeTypes) {
1275
+ function validate(props, propName, componentName, location, propFullName) {
1276
+ var propValue = props[propName];
1277
+ var propType = getPropType(propValue);
1278
+ if (propType !== 'object') {
1279
+ return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
1280
+ }
1281
+ // We need to check all keys in case some are required but missing from props.
1282
+ var allKeys = assign({}, props[propName], shapeTypes);
1283
+ for (var key in allKeys) {
1284
+ var checker = shapeTypes[key];
1285
+ if (has(shapeTypes, key) && typeof checker !== 'function') {
1286
+ return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
1287
+ }
1288
+ if (!checker) {
1289
+ return new PropTypeError(
1290
+ 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
1291
+ '\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
1292
+ '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
1293
+ );
1294
+ }
1295
+ var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);
1296
+ if (error) {
1297
+ return error;
1298
+ }
1299
+ }
1300
+ return null;
1301
+ }
1302
+
1303
+ return createChainableTypeChecker(validate);
1304
+ }
1305
+
1306
+ function isNode(propValue) {
1307
+ switch (typeof propValue) {
1308
+ case 'number':
1309
+ case 'string':
1310
+ case 'undefined':
1311
+ return true;
1312
+ case 'boolean':
1313
+ return !propValue;
1314
+ case 'object':
1315
+ if (Array.isArray(propValue)) {
1316
+ return propValue.every(isNode);
1317
+ }
1318
+ if (propValue === null || isValidElement(propValue)) {
1319
+ return true;
1320
+ }
1321
+
1322
+ var iteratorFn = getIteratorFn(propValue);
1323
+ if (iteratorFn) {
1324
+ var iterator = iteratorFn.call(propValue);
1325
+ var step;
1326
+ if (iteratorFn !== propValue.entries) {
1327
+ while (!(step = iterator.next()).done) {
1328
+ if (!isNode(step.value)) {
1329
+ return false;
1330
+ }
1331
+ }
1332
+ } else {
1333
+ // Iterator will provide entry [k,v] tuples rather than values.
1334
+ while (!(step = iterator.next()).done) {
1335
+ var entry = step.value;
1336
+ if (entry) {
1337
+ if (!isNode(entry[1])) {
1338
+ return false;
1339
+ }
1340
+ }
1341
+ }
1342
+ }
1343
+ } else {
1344
+ return false;
1345
+ }
1346
+
1347
+ return true;
1348
+ default:
1349
+ return false;
1350
+ }
1351
+ }
1352
+
1353
+ function isSymbol(propType, propValue) {
1354
+ // Native Symbol.
1355
+ if (propType === 'symbol') {
1356
+ return true;
1357
+ }
1358
+
1359
+ // falsy value can't be a Symbol
1360
+ if (!propValue) {
1361
+ return false;
1362
+ }
1363
+
1364
+ // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
1365
+ if (propValue['@@toStringTag'] === 'Symbol') {
1366
+ return true;
1367
+ }
1368
+
1369
+ // Fallback for non-spec compliant Symbols which are polyfilled.
1370
+ if (typeof Symbol === 'function' && propValue instanceof Symbol) {
1371
+ return true;
1372
+ }
1373
+
1374
+ return false;
1375
+ }
1376
+
1377
+ // Equivalent of `typeof` but with special handling for array and regexp.
1378
+ function getPropType(propValue) {
1379
+ var propType = typeof propValue;
1380
+ if (Array.isArray(propValue)) {
1381
+ return 'array';
1382
+ }
1383
+ if (propValue instanceof RegExp) {
1384
+ // Old webkits (at least until Android 4.0) return 'function' rather than
1385
+ // 'object' for typeof a RegExp. We'll normalize this here so that /bla/
1386
+ // passes PropTypes.object.
1387
+ return 'object';
1388
+ }
1389
+ if (isSymbol(propType, propValue)) {
1390
+ return 'symbol';
1391
+ }
1392
+ return propType;
1393
+ }
1394
+
1395
+ // This handles more types than `getPropType`. Only used for error messages.
1396
+ // See `createPrimitiveTypeChecker`.
1397
+ function getPreciseType(propValue) {
1398
+ if (typeof propValue === 'undefined' || propValue === null) {
1399
+ return '' + propValue;
1400
+ }
1401
+ var propType = getPropType(propValue);
1402
+ if (propType === 'object') {
1403
+ if (propValue instanceof Date) {
1404
+ return 'date';
1405
+ } else if (propValue instanceof RegExp) {
1406
+ return 'regexp';
1407
+ }
1408
+ }
1409
+ return propType;
1410
+ }
1411
+
1412
+ // Returns a string that is postfixed to a warning about an invalid type.
1413
+ // For example, "undefined" or "of type array"
1414
+ function getPostfixForTypeWarning(value) {
1415
+ var type = getPreciseType(value);
1416
+ switch (type) {
1417
+ case 'array':
1418
+ case 'object':
1419
+ return 'an ' + type;
1420
+ case 'boolean':
1421
+ case 'date':
1422
+ case 'regexp':
1423
+ return 'a ' + type;
1424
+ default:
1425
+ return type;
1426
+ }
1427
+ }
1428
+
1429
+ // Returns class name of the object, if any.
1430
+ function getClassName(propValue) {
1431
+ if (!propValue.constructor || !propValue.constructor.name) {
1432
+ return ANONYMOUS;
1433
+ }
1434
+ return propValue.constructor.name;
1435
+ }
1436
+
1437
+ ReactPropTypes.checkPropTypes = checkPropTypes;
1438
+ ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
1439
+ ReactPropTypes.PropTypes = ReactPropTypes;
1440
+
1441
+ return ReactPropTypes;
1442
+ };
1443
+ return factoryWithTypeCheckers;
1444
+ }
1445
+
1446
+ /**
1447
+ * Copyright (c) 2013-present, Facebook, Inc.
1448
+ *
1449
+ * This source code is licensed under the MIT license found in the
1450
+ * LICENSE file in the root directory of this source tree.
1451
+ */
1452
+
1453
+ var factoryWithThrowingShims;
1454
+ var hasRequiredFactoryWithThrowingShims;
1455
+
1456
+ function requireFactoryWithThrowingShims () {
1457
+ if (hasRequiredFactoryWithThrowingShims) return factoryWithThrowingShims;
1458
+ hasRequiredFactoryWithThrowingShims = 1;
1459
+
1460
+ var ReactPropTypesSecret = /*@__PURE__*/ requireReactPropTypesSecret();
1461
+
1462
+ function emptyFunction() {}
1463
+ function emptyFunctionWithReset() {}
1464
+ emptyFunctionWithReset.resetWarningCache = emptyFunction;
1465
+
1466
+ factoryWithThrowingShims = function() {
1467
+ function shim(props, propName, componentName, location, propFullName, secret) {
1468
+ if (secret === ReactPropTypesSecret) {
1469
+ // It is still safe when called from React.
1470
+ return;
1471
+ }
1472
+ var err = new Error(
1473
+ 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
1474
+ 'Use PropTypes.checkPropTypes() to call them. ' +
1475
+ 'Read more at http://fb.me/use-check-prop-types'
1476
+ );
1477
+ err.name = 'Invariant Violation';
1478
+ throw err;
1479
+ } shim.isRequired = shim;
1480
+ function getShim() {
1481
+ return shim;
1482
+ } // Important!
1483
+ // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
1484
+ var ReactPropTypes = {
1485
+ array: shim,
1486
+ bigint: shim,
1487
+ bool: shim,
1488
+ func: shim,
1489
+ number: shim,
1490
+ object: shim,
1491
+ string: shim,
1492
+ symbol: shim,
1493
+
1494
+ any: shim,
1495
+ arrayOf: getShim,
1496
+ element: shim,
1497
+ elementType: shim,
1498
+ instanceOf: getShim,
1499
+ node: shim,
1500
+ objectOf: getShim,
1501
+ oneOf: getShim,
1502
+ oneOfType: getShim,
1503
+ shape: getShim,
1504
+ exact: getShim,
1505
+
1506
+ checkPropTypes: emptyFunctionWithReset,
1507
+ resetWarningCache: emptyFunction
1508
+ };
1509
+
1510
+ ReactPropTypes.PropTypes = ReactPropTypes;
1511
+
1512
+ return ReactPropTypes;
1513
+ };
1514
+ return factoryWithThrowingShims;
1515
+ }
1516
+
1517
+ /**
1518
+ * Copyright (c) 2013-present, Facebook, Inc.
1519
+ *
1520
+ * This source code is licensed under the MIT license found in the
1521
+ * LICENSE file in the root directory of this source tree.
1522
+ */
1523
+
1524
+ var hasRequiredPropTypes;
1525
+
1526
+ function requirePropTypes () {
1527
+ if (hasRequiredPropTypes) return propTypes.exports;
1528
+ hasRequiredPropTypes = 1;
1529
+ if (process.env.NODE_ENV !== 'production') {
1530
+ var ReactIs = requireReactIs();
1531
+
1532
+ // By explicitly using `prop-types` you are opting into new development behavior.
1533
+ // http://fb.me/prop-types-in-prod
1534
+ var throwOnDirectAccess = true;
1535
+ propTypes.exports = /*@__PURE__*/ requireFactoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess);
1536
+ } else {
1537
+ // By explicitly using `prop-types` you are opting into new production behavior.
1538
+ // http://fb.me/prop-types-in-prod
1539
+ propTypes.exports = /*@__PURE__*/ requireFactoryWithThrowingShims()();
1540
+ }
1541
+ return propTypes.exports;
1542
+ }
1543
+
1544
+ var props;
1545
+ var hasRequiredProps;
1546
+
1547
+ function requireProps () {
1548
+ if (hasRequiredProps) return props;
1549
+ hasRequiredProps = 1;
1550
+ var __create = Object.create;
1551
+ var __defProp = Object.defineProperty;
1552
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1553
+ var __getOwnPropNames = Object.getOwnPropertyNames;
1554
+ var __getProtoOf = Object.getPrototypeOf;
1555
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
1556
+ var __export = (target, all) => {
1557
+ for (var name in all)
1558
+ __defProp(target, name, { get: all[name], enumerable: true });
1559
+ };
1560
+ var __copyProps = (to, from, except, desc) => {
1561
+ if (from && typeof from === "object" || typeof from === "function") {
1562
+ for (let key of __getOwnPropNames(from))
1563
+ if (!__hasOwnProp.call(to, key) && key !== except)
1564
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
1565
+ }
1566
+ return to;
1567
+ };
1568
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
1569
+ // If the importer is in node compatibility mode or this is not an ESM
1570
+ // file that has been converted to a CommonJS file using a Babel-
1571
+ // compatible transform (i.e. "__esModule" has not been set), then set
1572
+ // "default" to the CommonJS "module.exports" for node compatibility.
1573
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
1574
+ mod
1575
+ ));
1576
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1577
+ var props_exports = {};
1578
+ __export(props_exports, {
1579
+ defaultProps: () => defaultProps,
1580
+ propTypes: () => propTypes
1581
+ });
1582
+ props = __toCommonJS(props_exports);
1583
+ var import_prop_types = __toESM(/*@__PURE__*/ requirePropTypes());
1584
+ const { string, bool, number, array, oneOfType, shape, object, func, node } = import_prop_types.default;
1585
+ const propTypes = {
1586
+ url: oneOfType([string, array, object]),
1587
+ playing: bool,
1588
+ loop: bool,
1589
+ controls: bool,
1590
+ volume: number,
1591
+ muted: bool,
1592
+ playbackRate: number,
1593
+ width: oneOfType([string, number]),
1594
+ height: oneOfType([string, number]),
1595
+ style: object,
1596
+ progressInterval: number,
1597
+ playsinline: bool,
1598
+ pip: bool,
1599
+ stopOnUnmount: bool,
1600
+ light: oneOfType([bool, string, object]),
1601
+ playIcon: node,
1602
+ previewTabIndex: number,
1603
+ previewAriaLabel: string,
1604
+ fallback: node,
1605
+ oEmbedUrl: string,
1606
+ wrapper: oneOfType([
1607
+ string,
1608
+ func,
1609
+ shape({ render: func.isRequired })
1610
+ ]),
1611
+ config: shape({
1612
+ soundcloud: shape({
1613
+ options: object
1614
+ }),
1615
+ youtube: shape({
1616
+ playerVars: object,
1617
+ embedOptions: object,
1618
+ onUnstarted: func
1619
+ }),
1620
+ facebook: shape({
1621
+ appId: string,
1622
+ version: string,
1623
+ playerId: string,
1624
+ attributes: object
1625
+ }),
1626
+ dailymotion: shape({
1627
+ params: object
1628
+ }),
1629
+ vimeo: shape({
1630
+ playerOptions: object,
1631
+ title: string
1632
+ }),
1633
+ mux: shape({
1634
+ attributes: object,
1635
+ version: string
1636
+ }),
1637
+ file: shape({
1638
+ attributes: object,
1639
+ tracks: array,
1640
+ forceVideo: bool,
1641
+ forceAudio: bool,
1642
+ forceHLS: bool,
1643
+ forceSafariHLS: bool,
1644
+ forceDisableHls: bool,
1645
+ forceDASH: bool,
1646
+ forceFLV: bool,
1647
+ hlsOptions: object,
1648
+ hlsVersion: string,
1649
+ dashVersion: string,
1650
+ flvVersion: string
1651
+ }),
1652
+ wistia: shape({
1653
+ options: object,
1654
+ playerId: string,
1655
+ customControls: array
1656
+ }),
1657
+ mixcloud: shape({
1658
+ options: object
1659
+ }),
1660
+ twitch: shape({
1661
+ options: object,
1662
+ playerId: string
1663
+ }),
1664
+ vidyard: shape({
1665
+ options: object
1666
+ })
1667
+ }),
1668
+ onReady: func,
1669
+ onStart: func,
1670
+ onPlay: func,
1671
+ onPause: func,
1672
+ onBuffer: func,
1673
+ onBufferEnd: func,
1674
+ onEnded: func,
1675
+ onError: func,
1676
+ onDuration: func,
1677
+ onSeek: func,
1678
+ onPlaybackRateChange: func,
1679
+ onPlaybackQualityChange: func,
1680
+ onProgress: func,
1681
+ onClickPreview: func,
1682
+ onEnablePIP: func,
1683
+ onDisablePIP: func
1684
+ };
1685
+ const noop = () => {
1686
+ };
1687
+ const defaultProps = {
1688
+ playing: false,
1689
+ loop: false,
1690
+ controls: false,
1691
+ volume: null,
1692
+ muted: false,
1693
+ playbackRate: 1,
1694
+ width: "640px",
1695
+ height: "360px",
1696
+ style: {},
1697
+ progressInterval: 1e3,
1698
+ playsinline: false,
1699
+ pip: false,
1700
+ stopOnUnmount: true,
1701
+ light: false,
1702
+ fallback: null,
1703
+ wrapper: "div",
1704
+ previewTabIndex: 0,
1705
+ previewAriaLabel: "",
1706
+ oEmbedUrl: "https://noembed.com/embed?url={url}",
1707
+ config: {
1708
+ soundcloud: {
1709
+ options: {
1710
+ visual: true,
1711
+ // Undocumented, but makes player fill container and look better
1712
+ buying: false,
1713
+ liking: false,
1714
+ download: false,
1715
+ sharing: false,
1716
+ show_comments: false,
1717
+ show_playcount: false
1718
+ }
1719
+ },
1720
+ youtube: {
1721
+ playerVars: {
1722
+ playsinline: 1,
1723
+ showinfo: 0,
1724
+ rel: 0,
1725
+ iv_load_policy: 3,
1726
+ modestbranding: 1
1727
+ },
1728
+ embedOptions: {},
1729
+ onUnstarted: noop
1730
+ },
1731
+ facebook: {
1732
+ appId: "1309697205772819",
1733
+ version: "v3.3",
1734
+ playerId: null,
1735
+ attributes: {}
1736
+ },
1737
+ dailymotion: {
1738
+ params: {
1739
+ api: 1,
1740
+ "endscreen-enable": false
1741
+ }
1742
+ },
1743
+ vimeo: {
1744
+ playerOptions: {
1745
+ autopause: false,
1746
+ byline: false,
1747
+ portrait: false,
1748
+ title: false
1749
+ },
1750
+ title: null
1751
+ },
1752
+ mux: {
1753
+ attributes: {},
1754
+ version: "2"
1755
+ },
1756
+ file: {
1757
+ attributes: {},
1758
+ tracks: [],
1759
+ forceVideo: false,
1760
+ forceAudio: false,
1761
+ forceHLS: false,
1762
+ forceDASH: false,
1763
+ forceFLV: false,
1764
+ hlsOptions: {},
1765
+ hlsVersion: "1.1.4",
1766
+ dashVersion: "3.1.3",
1767
+ flvVersion: "1.5.0",
1768
+ forceDisableHls: false
1769
+ },
1770
+ wistia: {
1771
+ options: {},
1772
+ playerId: null,
1773
+ customControls: null
1774
+ },
1775
+ mixcloud: {
1776
+ options: {
1777
+ hide_cover: 1
1778
+ }
1779
+ },
1780
+ twitch: {
1781
+ options: {},
1782
+ playerId: null
1783
+ },
1784
+ vidyard: {
1785
+ options: {}
1786
+ }
1787
+ },
1788
+ onReady: noop,
1789
+ onStart: noop,
1790
+ onPlay: noop,
1791
+ onPause: noop,
1792
+ onBuffer: noop,
1793
+ onBufferEnd: noop,
1794
+ onEnded: noop,
1795
+ onError: noop,
1796
+ onDuration: noop,
1797
+ onSeek: noop,
1798
+ onPlaybackRateChange: noop,
1799
+ onPlaybackQualityChange: noop,
1800
+ onProgress: noop,
1801
+ onClickPreview: noop,
1802
+ onEnablePIP: noop,
1803
+ onDisablePIP: noop
1804
+ };
1805
+ return props;
1806
+ }
1807
+
1808
+ var loadScript;
1809
+ var hasRequiredLoadScript;
1810
+
1811
+ function requireLoadScript () {
1812
+ if (hasRequiredLoadScript) return loadScript;
1813
+ hasRequiredLoadScript = 1;
1814
+ loadScript = function load (src, opts, cb) {
1815
+ var head = document.head || document.getElementsByTagName('head')[0];
1816
+ var script = document.createElement('script');
1817
+
1818
+ if (typeof opts === 'function') {
1819
+ cb = opts;
1820
+ opts = {};
1821
+ }
1822
+
1823
+ opts = opts || {};
1824
+ cb = cb || function() {};
1825
+
1826
+ script.type = opts.type || 'text/javascript';
1827
+ script.charset = opts.charset || 'utf8';
1828
+ script.async = 'async' in opts ? !!opts.async : true;
1829
+ script.src = src;
1830
+
1831
+ if (opts.attrs) {
1832
+ setAttributes(script, opts.attrs);
1833
+ }
1834
+
1835
+ if (opts.text) {
1836
+ script.text = '' + opts.text;
1837
+ }
1838
+
1839
+ var onend = 'onload' in script ? stdOnEnd : ieOnEnd;
1840
+ onend(script, cb);
1841
+
1842
+ // some good legacy browsers (firefox) fail the 'in' detection above
1843
+ // so as a fallback we always set onload
1844
+ // old IE will ignore this and new IE will set onload
1845
+ if (!script.onload) {
1846
+ stdOnEnd(script, cb);
1847
+ }
1848
+
1849
+ head.appendChild(script);
1850
+ };
1851
+
1852
+ function setAttributes(script, attrs) {
1853
+ for (var attr in attrs) {
1854
+ script.setAttribute(attr, attrs[attr]);
1855
+ }
1856
+ }
1857
+
1858
+ function stdOnEnd (script, cb) {
1859
+ script.onload = function () {
1860
+ this.onerror = this.onload = null;
1861
+ cb(null, script);
1862
+ };
1863
+ script.onerror = function () {
1864
+ // this.onload = null here is necessary
1865
+ // because even IE9 works not like others
1866
+ this.onerror = this.onload = null;
1867
+ cb(new Error('Failed to load ' + this.src), script);
1868
+ };
1869
+ }
1870
+
1871
+ function ieOnEnd (script, cb) {
1872
+ script.onreadystatechange = function () {
1873
+ if (this.readyState != 'complete' && this.readyState != 'loaded') return
1874
+ this.onreadystatechange = null;
1875
+ cb(null, script); // there is no way to catch loading errors in IE8
1876
+ };
1877
+ }
1878
+ return loadScript;
1879
+ }
1880
+
1881
+ var utils;
1882
+ var hasRequiredUtils;
1883
+
1884
+ function requireUtils () {
1885
+ if (hasRequiredUtils) return utils;
1886
+ hasRequiredUtils = 1;
1887
+ var __create = Object.create;
1888
+ var __defProp = Object.defineProperty;
1889
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
1890
+ var __getOwnPropNames = Object.getOwnPropertyNames;
1891
+ var __getProtoOf = Object.getPrototypeOf;
1892
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
1893
+ var __export = (target, all) => {
1894
+ for (var name in all)
1895
+ __defProp(target, name, { get: all[name], enumerable: true });
1896
+ };
1897
+ var __copyProps = (to, from, except, desc) => {
1898
+ if (from && typeof from === "object" || typeof from === "function") {
1899
+ for (let key of __getOwnPropNames(from))
1900
+ if (!__hasOwnProp.call(to, key) && key !== except)
1901
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
1902
+ }
1903
+ return to;
1904
+ };
1905
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
1906
+ // If the importer is in node compatibility mode or this is not an ESM
1907
+ // file that has been converted to a CommonJS file using a Babel-
1908
+ // compatible transform (i.e. "__esModule" has not been set), then set
1909
+ // "default" to the CommonJS "module.exports" for node compatibility.
1910
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
1911
+ mod
1912
+ ));
1913
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
1914
+ var utils_exports = {};
1915
+ __export(utils_exports, {
1916
+ callPlayer: () => callPlayer,
1917
+ getConfig: () => getConfig,
1918
+ getSDK: () => getSDK,
1919
+ isBlobUrl: () => isBlobUrl,
1920
+ isMediaStream: () => isMediaStream,
1921
+ lazy: () => lazy,
1922
+ omit: () => omit,
1923
+ parseEndTime: () => parseEndTime,
1924
+ parseStartTime: () => parseStartTime,
1925
+ queryString: () => queryString,
1926
+ randomString: () => randomString,
1927
+ supportsWebKitPresentationMode: () => supportsWebKitPresentationMode
1928
+ });
1929
+ utils = __toCommonJS(utils_exports);
1930
+ var import_react = __toESM(React__default);
1931
+ var import_load_script = __toESM(requireLoadScript());
1932
+ var import_deepmerge = __toESM(requireCjs());
1933
+ const lazy = (componentImportFn) => import_react.default.lazy(async () => {
1934
+ const obj = await componentImportFn();
1935
+ return typeof obj.default === "function" ? obj : obj.default;
1936
+ });
1937
+ const MATCH_START_QUERY = /[?&#](?:start|t)=([0-9hms]+)/;
1938
+ const MATCH_END_QUERY = /[?&#]end=([0-9hms]+)/;
1939
+ const MATCH_START_STAMP = /(\d+)(h|m|s)/g;
1940
+ const MATCH_NUMERIC = /^\d+$/;
1941
+ function parseTimeParam(url, pattern) {
1942
+ if (url instanceof Array) {
1943
+ return void 0;
1944
+ }
1945
+ const match = url.match(pattern);
1946
+ if (match) {
1947
+ const stamp = match[1];
1948
+ if (stamp.match(MATCH_START_STAMP)) {
1949
+ return parseTimeString(stamp);
1950
+ }
1951
+ if (MATCH_NUMERIC.test(stamp)) {
1952
+ return parseInt(stamp);
1953
+ }
1954
+ }
1955
+ return void 0;
1956
+ }
1957
+ function parseTimeString(stamp) {
1958
+ let seconds = 0;
1959
+ let array = MATCH_START_STAMP.exec(stamp);
1960
+ while (array !== null) {
1961
+ const [, count, period] = array;
1962
+ if (period === "h")
1963
+ seconds += parseInt(count, 10) * 60 * 60;
1964
+ if (period === "m")
1965
+ seconds += parseInt(count, 10) * 60;
1966
+ if (period === "s")
1967
+ seconds += parseInt(count, 10);
1968
+ array = MATCH_START_STAMP.exec(stamp);
1969
+ }
1970
+ return seconds;
1971
+ }
1972
+ function parseStartTime(url) {
1973
+ return parseTimeParam(url, MATCH_START_QUERY);
1974
+ }
1975
+ function parseEndTime(url) {
1976
+ return parseTimeParam(url, MATCH_END_QUERY);
1977
+ }
1978
+ function randomString() {
1979
+ return Math.random().toString(36).substr(2, 5);
1980
+ }
1981
+ function queryString(object) {
1982
+ return Object.keys(object).map((key) => `${key}=${object[key]}`).join("&");
1983
+ }
1984
+ function getGlobal(key) {
1985
+ if (window[key]) {
1986
+ return window[key];
1987
+ }
1988
+ if (window.exports && window.exports[key]) {
1989
+ return window.exports[key];
1990
+ }
1991
+ if (window.module && window.module.exports && window.module.exports[key]) {
1992
+ return window.module.exports[key];
1993
+ }
1994
+ return null;
1995
+ }
1996
+ const requests = {};
1997
+ const getSDK = enableStubOn(function getSDK2(url, sdkGlobal, sdkReady = null, isLoaded = () => true, fetchScript = import_load_script.default) {
1998
+ const existingGlobal = getGlobal(sdkGlobal);
1999
+ if (existingGlobal && isLoaded(existingGlobal)) {
2000
+ return Promise.resolve(existingGlobal);
2001
+ }
2002
+ return new Promise((resolve, reject) => {
2003
+ if (requests[url]) {
2004
+ requests[url].push({ resolve, reject });
2005
+ return;
2006
+ }
2007
+ requests[url] = [{ resolve, reject }];
2008
+ const onLoaded = (sdk) => {
2009
+ requests[url].forEach((request) => request.resolve(sdk));
2010
+ };
2011
+ if (sdkReady) {
2012
+ const previousOnReady = window[sdkReady];
2013
+ window[sdkReady] = function() {
2014
+ if (previousOnReady)
2015
+ previousOnReady();
2016
+ onLoaded(getGlobal(sdkGlobal));
2017
+ };
2018
+ }
2019
+ fetchScript(url, (err) => {
2020
+ if (err) {
2021
+ requests[url].forEach((request) => request.reject(err));
2022
+ requests[url] = null;
2023
+ } else if (!sdkReady) {
2024
+ onLoaded(getGlobal(sdkGlobal));
2025
+ }
2026
+ });
2027
+ });
2028
+ });
2029
+ function getConfig(props, defaultProps) {
2030
+ return (0, import_deepmerge.default)(defaultProps.config, props.config);
2031
+ }
2032
+ function omit(object, ...arrays) {
2033
+ const omitKeys = [].concat(...arrays);
2034
+ const output = {};
2035
+ const keys = Object.keys(object);
2036
+ for (const key of keys) {
2037
+ if (omitKeys.indexOf(key) === -1) {
2038
+ output[key] = object[key];
2039
+ }
2040
+ }
2041
+ return output;
2042
+ }
2043
+ function callPlayer(method, ...args) {
2044
+ if (!this.player || !this.player[method]) {
2045
+ let message = `ReactPlayer: ${this.constructor.displayName} player could not call %c${method}%c \u2013 `;
2046
+ if (!this.player) {
2047
+ message += "The player was not available";
2048
+ } else if (!this.player[method]) {
2049
+ message += "The method was not available";
2050
+ }
2051
+ console.warn(message, "font-weight: bold", "");
2052
+ return null;
2053
+ }
2054
+ return this.player[method](...args);
2055
+ }
2056
+ function isMediaStream(url) {
2057
+ return typeof window !== "undefined" && typeof window.MediaStream !== "undefined" && url instanceof window.MediaStream;
2058
+ }
2059
+ function isBlobUrl(url) {
2060
+ return /^blob:/.test(url);
2061
+ }
2062
+ function supportsWebKitPresentationMode(video = document.createElement("video")) {
2063
+ const notMobile = /iPhone|iPod/.test(navigator.userAgent) === false;
2064
+ return video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === "function" && notMobile;
2065
+ }
2066
+ function enableStubOn(fn) {
2067
+ return fn;
2068
+ }
2069
+ return utils;
2070
+ }
2071
+
2072
+ var Player_1;
2073
+ var hasRequiredPlayer;
2074
+
2075
+ function requirePlayer () {
2076
+ if (hasRequiredPlayer) return Player_1;
2077
+ hasRequiredPlayer = 1;
2078
+ var __create = Object.create;
2079
+ var __defProp = Object.defineProperty;
2080
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2081
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2082
+ var __getProtoOf = Object.getPrototypeOf;
2083
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2084
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2085
+ var __export = (target, all) => {
2086
+ for (var name in all)
2087
+ __defProp(target, name, { get: all[name], enumerable: true });
2088
+ };
2089
+ var __copyProps = (to, from, except, desc) => {
2090
+ if (from && typeof from === "object" || typeof from === "function") {
2091
+ for (let key of __getOwnPropNames(from))
2092
+ if (!__hasOwnProp.call(to, key) && key !== except)
2093
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
2094
+ }
2095
+ return to;
2096
+ };
2097
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
2098
+ // If the importer is in node compatibility mode or this is not an ESM
2099
+ // file that has been converted to a CommonJS file using a Babel-
2100
+ // compatible transform (i.e. "__esModule" has not been set), then set
2101
+ // "default" to the CommonJS "module.exports" for node compatibility.
2102
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
2103
+ mod
2104
+ ));
2105
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2106
+ var __publicField = (obj, key, value) => {
2107
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
2108
+ return value;
2109
+ };
2110
+ var Player_exports = {};
2111
+ __export(Player_exports, {
2112
+ default: () => Player
2113
+ });
2114
+ Player_1 = __toCommonJS(Player_exports);
2115
+ var import_react = __toESM(React__default);
2116
+ var import_react_fast_compare = __toESM(requireReactFastCompare());
2117
+ var import_props = /*@__PURE__*/ requireProps();
2118
+ var import_utils = /*@__PURE__*/ requireUtils();
2119
+ const SEEK_ON_PLAY_EXPIRY = 5e3;
2120
+ class Player extends import_react.Component {
2121
+ constructor() {
2122
+ super(...arguments);
2123
+ __publicField(this, "mounted", false);
2124
+ __publicField(this, "isReady", false);
2125
+ __publicField(this, "isPlaying", false);
2126
+ // Track playing state internally to prevent bugs
2127
+ __publicField(this, "isLoading", true);
2128
+ // Use isLoading to prevent onPause when switching URL
2129
+ __publicField(this, "loadOnReady", null);
2130
+ __publicField(this, "startOnPlay", true);
2131
+ __publicField(this, "seekOnPlay", null);
2132
+ __publicField(this, "onDurationCalled", false);
2133
+ __publicField(this, "handlePlayerMount", (player) => {
2134
+ if (this.player) {
2135
+ this.progress();
2136
+ return;
2137
+ }
2138
+ this.player = player;
2139
+ this.player.load(this.props.url);
2140
+ this.progress();
2141
+ });
2142
+ __publicField(this, "getInternalPlayer", (key) => {
2143
+ if (!this.player)
2144
+ return null;
2145
+ return this.player[key];
2146
+ });
2147
+ __publicField(this, "progress", () => {
2148
+ if (this.props.url && this.player && this.isReady) {
2149
+ const playedSeconds = this.getCurrentTime() || 0;
2150
+ const loadedSeconds = this.getSecondsLoaded();
2151
+ const duration = this.getDuration();
2152
+ if (duration) {
2153
+ const progress = {
2154
+ playedSeconds,
2155
+ played: playedSeconds / duration
2156
+ };
2157
+ if (loadedSeconds !== null) {
2158
+ progress.loadedSeconds = loadedSeconds;
2159
+ progress.loaded = loadedSeconds / duration;
2160
+ }
2161
+ if (progress.playedSeconds !== this.prevPlayed || progress.loadedSeconds !== this.prevLoaded) {
2162
+ this.props.onProgress(progress);
2163
+ }
2164
+ this.prevPlayed = progress.playedSeconds;
2165
+ this.prevLoaded = progress.loadedSeconds;
2166
+ }
2167
+ }
2168
+ this.progressTimeout = setTimeout(this.progress, this.props.progressFrequency || this.props.progressInterval);
2169
+ });
2170
+ __publicField(this, "handleReady", () => {
2171
+ if (!this.mounted)
2172
+ return;
2173
+ this.isReady = true;
2174
+ this.isLoading = false;
2175
+ const { onReady, playing, volume, muted } = this.props;
2176
+ onReady();
2177
+ if (!muted && volume !== null) {
2178
+ this.player.setVolume(volume);
2179
+ }
2180
+ if (this.loadOnReady) {
2181
+ this.player.load(this.loadOnReady, true);
2182
+ this.loadOnReady = null;
2183
+ } else if (playing) {
2184
+ this.player.play();
2185
+ }
2186
+ this.handleDurationCheck();
2187
+ });
2188
+ __publicField(this, "handlePlay", () => {
2189
+ this.isPlaying = true;
2190
+ this.isLoading = false;
2191
+ const { onStart, onPlay, playbackRate } = this.props;
2192
+ if (this.startOnPlay) {
2193
+ if (this.player.setPlaybackRate && playbackRate !== 1) {
2194
+ this.player.setPlaybackRate(playbackRate);
2195
+ }
2196
+ onStart();
2197
+ this.startOnPlay = false;
2198
+ }
2199
+ onPlay();
2200
+ if (this.seekOnPlay) {
2201
+ this.seekTo(this.seekOnPlay);
2202
+ this.seekOnPlay = null;
2203
+ }
2204
+ this.handleDurationCheck();
2205
+ });
2206
+ __publicField(this, "handlePause", (e) => {
2207
+ this.isPlaying = false;
2208
+ if (!this.isLoading) {
2209
+ this.props.onPause(e);
2210
+ }
2211
+ });
2212
+ __publicField(this, "handleEnded", () => {
2213
+ const { activePlayer, loop, onEnded } = this.props;
2214
+ if (activePlayer.loopOnEnded && loop) {
2215
+ this.seekTo(0);
2216
+ }
2217
+ if (!loop) {
2218
+ this.isPlaying = false;
2219
+ onEnded();
2220
+ }
2221
+ });
2222
+ __publicField(this, "handleError", (...args) => {
2223
+ this.isLoading = false;
2224
+ this.props.onError(...args);
2225
+ });
2226
+ __publicField(this, "handleDurationCheck", () => {
2227
+ clearTimeout(this.durationCheckTimeout);
2228
+ const duration = this.getDuration();
2229
+ if (duration) {
2230
+ if (!this.onDurationCalled) {
2231
+ this.props.onDuration(duration);
2232
+ this.onDurationCalled = true;
2233
+ }
2234
+ } else {
2235
+ this.durationCheckTimeout = setTimeout(this.handleDurationCheck, 100);
2236
+ }
2237
+ });
2238
+ __publicField(this, "handleLoaded", () => {
2239
+ this.isLoading = false;
2240
+ });
2241
+ }
2242
+ componentDidMount() {
2243
+ this.mounted = true;
2244
+ }
2245
+ componentWillUnmount() {
2246
+ clearTimeout(this.progressTimeout);
2247
+ clearTimeout(this.durationCheckTimeout);
2248
+ if (this.isReady && this.props.stopOnUnmount) {
2249
+ this.player.stop();
2250
+ if (this.player.disablePIP) {
2251
+ this.player.disablePIP();
2252
+ }
2253
+ }
2254
+ this.mounted = false;
2255
+ }
2256
+ componentDidUpdate(prevProps) {
2257
+ if (!this.player) {
2258
+ return;
2259
+ }
2260
+ const { url, playing, volume, muted, playbackRate, pip, loop, activePlayer, disableDeferredLoading } = this.props;
2261
+ if (!(0, import_react_fast_compare.default)(prevProps.url, url)) {
2262
+ if (this.isLoading && !activePlayer.forceLoad && !disableDeferredLoading && !(0, import_utils.isMediaStream)(url)) {
2263
+ console.warn(`ReactPlayer: the attempt to load ${url} is being deferred until the player has loaded`);
2264
+ this.loadOnReady = url;
2265
+ return;
2266
+ }
2267
+ this.isLoading = true;
2268
+ this.startOnPlay = true;
2269
+ this.onDurationCalled = false;
2270
+ this.player.load(url, this.isReady);
2271
+ }
2272
+ if (!prevProps.playing && playing && !this.isPlaying) {
2273
+ this.player.play();
2274
+ }
2275
+ if (prevProps.playing && !playing && this.isPlaying) {
2276
+ this.player.pause();
2277
+ }
2278
+ if (!prevProps.pip && pip && this.player.enablePIP) {
2279
+ this.player.enablePIP();
2280
+ }
2281
+ if (prevProps.pip && !pip && this.player.disablePIP) {
2282
+ this.player.disablePIP();
2283
+ }
2284
+ if (prevProps.volume !== volume && volume !== null) {
2285
+ this.player.setVolume(volume);
2286
+ }
2287
+ if (prevProps.muted !== muted) {
2288
+ if (muted) {
2289
+ this.player.mute();
2290
+ } else {
2291
+ this.player.unmute();
2292
+ if (volume !== null) {
2293
+ setTimeout(() => this.player.setVolume(volume));
2294
+ }
2295
+ }
2296
+ }
2297
+ if (prevProps.playbackRate !== playbackRate && this.player.setPlaybackRate) {
2298
+ this.player.setPlaybackRate(playbackRate);
2299
+ }
2300
+ if (prevProps.loop !== loop && this.player.setLoop) {
2301
+ this.player.setLoop(loop);
2302
+ }
2303
+ }
2304
+ getDuration() {
2305
+ if (!this.isReady)
2306
+ return null;
2307
+ return this.player.getDuration();
2308
+ }
2309
+ getCurrentTime() {
2310
+ if (!this.isReady)
2311
+ return null;
2312
+ return this.player.getCurrentTime();
2313
+ }
2314
+ getSecondsLoaded() {
2315
+ if (!this.isReady)
2316
+ return null;
2317
+ return this.player.getSecondsLoaded();
2318
+ }
2319
+ seekTo(amount, type, keepPlaying) {
2320
+ if (!this.isReady) {
2321
+ if (amount !== 0) {
2322
+ this.seekOnPlay = amount;
2323
+ setTimeout(() => {
2324
+ this.seekOnPlay = null;
2325
+ }, SEEK_ON_PLAY_EXPIRY);
2326
+ }
2327
+ return;
2328
+ }
2329
+ const isFraction = !type ? amount > 0 && amount < 1 : type === "fraction";
2330
+ if (isFraction) {
2331
+ const duration = this.player.getDuration();
2332
+ if (!duration) {
2333
+ console.warn("ReactPlayer: could not seek using fraction \u2013\xA0duration not yet available");
2334
+ return;
2335
+ }
2336
+ this.player.seekTo(duration * amount, keepPlaying);
2337
+ return;
2338
+ }
2339
+ this.player.seekTo(amount, keepPlaying);
2340
+ }
2341
+ render() {
2342
+ const Player2 = this.props.activePlayer;
2343
+ if (!Player2) {
2344
+ return null;
2345
+ }
2346
+ return /* @__PURE__ */ import_react.default.createElement(
2347
+ Player2,
2348
+ {
2349
+ ...this.props,
2350
+ onMount: this.handlePlayerMount,
2351
+ onReady: this.handleReady,
2352
+ onPlay: this.handlePlay,
2353
+ onPause: this.handlePause,
2354
+ onEnded: this.handleEnded,
2355
+ onLoaded: this.handleLoaded,
2356
+ onError: this.handleError
2357
+ }
2358
+ );
2359
+ }
2360
+ }
2361
+ __publicField(Player, "displayName", "Player");
2362
+ __publicField(Player, "propTypes", import_props.propTypes);
2363
+ __publicField(Player, "defaultProps", import_props.defaultProps);
2364
+ return Player_1;
2365
+ }
2366
+
2367
+ var ReactPlayer;
2368
+ var hasRequiredReactPlayer;
2369
+
2370
+ function requireReactPlayer () {
2371
+ if (hasRequiredReactPlayer) return ReactPlayer;
2372
+ hasRequiredReactPlayer = 1;
2373
+ var __create = Object.create;
2374
+ var __defProp = Object.defineProperty;
2375
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2376
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2377
+ var __getProtoOf = Object.getPrototypeOf;
2378
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2379
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2380
+ var __export = (target, all) => {
2381
+ for (var name in all)
2382
+ __defProp(target, name, { get: all[name], enumerable: true });
2383
+ };
2384
+ var __copyProps = (to, from, except, desc) => {
2385
+ if (from && typeof from === "object" || typeof from === "function") {
2386
+ for (let key of __getOwnPropNames(from))
2387
+ if (!__hasOwnProp.call(to, key) && key !== except)
2388
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
2389
+ }
2390
+ return to;
2391
+ };
2392
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
2393
+ // If the importer is in node compatibility mode or this is not an ESM
2394
+ // file that has been converted to a CommonJS file using a Babel-
2395
+ // compatible transform (i.e. "__esModule" has not been set), then set
2396
+ // "default" to the CommonJS "module.exports" for node compatibility.
2397
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
2398
+ mod
2399
+ ));
2400
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2401
+ var __publicField = (obj, key, value) => {
2402
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
2403
+ return value;
2404
+ };
2405
+ var ReactPlayer_exports = {};
2406
+ __export(ReactPlayer_exports, {
2407
+ createReactPlayer: () => createReactPlayer
2408
+ });
2409
+ ReactPlayer = __toCommonJS(ReactPlayer_exports);
2410
+ var import_react = __toESM(React__default);
2411
+ var import_deepmerge = __toESM(requireCjs());
2412
+ var import_memoize_one = __toESM(require$$2);
2413
+ var import_react_fast_compare = __toESM(requireReactFastCompare());
2414
+ var import_props = /*@__PURE__*/ requireProps();
2415
+ var import_utils = /*@__PURE__*/ requireUtils();
2416
+ var import_Player = __toESM(/*@__PURE__*/ requirePlayer());
2417
+ const Preview = (0, import_utils.lazy)(() => import(
2418
+ /* webpackChunkName: 'reactPlayerPreview' */
2419
+ './Preview-AHYIJh9S.mjs'
2420
+ ).then(function (n) { return n.P; }));
2421
+ const IS_BROWSER = typeof window !== "undefined" && window.document && typeof document !== "undefined";
2422
+ const IS_GLOBAL = typeof commonjsGlobal !== "undefined" && commonjsGlobal.window && commonjsGlobal.window.document;
2423
+ const SUPPORTED_PROPS = Object.keys(import_props.propTypes);
2424
+ const UniversalSuspense = IS_BROWSER || IS_GLOBAL ? import_react.Suspense : () => null;
2425
+ const customPlayers = [];
2426
+ const createReactPlayer = (players, fallback) => {
2427
+ var _a;
2428
+ return _a = class extends import_react.Component {
2429
+ constructor() {
2430
+ super(...arguments);
2431
+ __publicField(this, "state", {
2432
+ showPreview: !!this.props.light
2433
+ });
2434
+ // Use references, as refs is used by React
2435
+ __publicField(this, "references", {
2436
+ wrapper: (wrapper) => {
2437
+ this.wrapper = wrapper;
2438
+ },
2439
+ player: (player) => {
2440
+ this.player = player;
2441
+ }
2442
+ });
2443
+ __publicField(this, "handleClickPreview", (e) => {
2444
+ this.setState({ showPreview: false });
2445
+ this.props.onClickPreview(e);
2446
+ });
2447
+ __publicField(this, "showPreview", () => {
2448
+ this.setState({ showPreview: true });
2449
+ });
2450
+ __publicField(this, "getDuration", () => {
2451
+ if (!this.player)
2452
+ return null;
2453
+ return this.player.getDuration();
2454
+ });
2455
+ __publicField(this, "getCurrentTime", () => {
2456
+ if (!this.player)
2457
+ return null;
2458
+ return this.player.getCurrentTime();
2459
+ });
2460
+ __publicField(this, "getSecondsLoaded", () => {
2461
+ if (!this.player)
2462
+ return null;
2463
+ return this.player.getSecondsLoaded();
2464
+ });
2465
+ __publicField(this, "getInternalPlayer", (key = "player") => {
2466
+ if (!this.player)
2467
+ return null;
2468
+ return this.player.getInternalPlayer(key);
2469
+ });
2470
+ __publicField(this, "seekTo", (fraction, type, keepPlaying) => {
2471
+ if (!this.player)
2472
+ return null;
2473
+ this.player.seekTo(fraction, type, keepPlaying);
2474
+ });
2475
+ __publicField(this, "handleReady", () => {
2476
+ this.props.onReady(this);
2477
+ });
2478
+ __publicField(this, "getActivePlayer", (0, import_memoize_one.default)((url) => {
2479
+ for (const player of [...customPlayers, ...players]) {
2480
+ if (player.canPlay(url)) {
2481
+ return player;
2482
+ }
2483
+ }
2484
+ if (fallback) {
2485
+ return fallback;
2486
+ }
2487
+ return null;
2488
+ }));
2489
+ __publicField(this, "getConfig", (0, import_memoize_one.default)((url, key) => {
2490
+ const { config } = this.props;
2491
+ return import_deepmerge.default.all([
2492
+ import_props.defaultProps.config,
2493
+ import_props.defaultProps.config[key] || {},
2494
+ config,
2495
+ config[key] || {}
2496
+ ]);
2497
+ }));
2498
+ __publicField(this, "getAttributes", (0, import_memoize_one.default)((url) => {
2499
+ return (0, import_utils.omit)(this.props, SUPPORTED_PROPS);
2500
+ }));
2501
+ __publicField(this, "renderActivePlayer", (url) => {
2502
+ if (!url)
2503
+ return null;
2504
+ const player = this.getActivePlayer(url);
2505
+ if (!player)
2506
+ return null;
2507
+ const config = this.getConfig(url, player.key);
2508
+ return /* @__PURE__ */ import_react.default.createElement(
2509
+ import_Player.default,
2510
+ {
2511
+ ...this.props,
2512
+ key: player.key,
2513
+ ref: this.references.player,
2514
+ config,
2515
+ activePlayer: player.lazyPlayer || player,
2516
+ onReady: this.handleReady
2517
+ }
2518
+ );
2519
+ });
2520
+ }
2521
+ shouldComponentUpdate(nextProps, nextState) {
2522
+ return !(0, import_react_fast_compare.default)(this.props, nextProps) || !(0, import_react_fast_compare.default)(this.state, nextState);
2523
+ }
2524
+ componentDidUpdate(prevProps) {
2525
+ const { light } = this.props;
2526
+ if (!prevProps.light && light) {
2527
+ this.setState({ showPreview: true });
2528
+ }
2529
+ if (prevProps.light && !light) {
2530
+ this.setState({ showPreview: false });
2531
+ }
2532
+ }
2533
+ renderPreview(url) {
2534
+ if (!url)
2535
+ return null;
2536
+ const { light, playIcon, previewTabIndex, oEmbedUrl, previewAriaLabel } = this.props;
2537
+ return /* @__PURE__ */ import_react.default.createElement(
2538
+ Preview,
2539
+ {
2540
+ url,
2541
+ light,
2542
+ playIcon,
2543
+ previewTabIndex,
2544
+ previewAriaLabel,
2545
+ oEmbedUrl,
2546
+ onClick: this.handleClickPreview
2547
+ }
2548
+ );
2549
+ }
2550
+ render() {
2551
+ const { url, style, width, height, fallback: fallback2, wrapper: Wrapper } = this.props;
2552
+ const { showPreview } = this.state;
2553
+ const attributes = this.getAttributes(url);
2554
+ const wrapperRef = typeof Wrapper === "string" ? this.references.wrapper : void 0;
2555
+ return /* @__PURE__ */ import_react.default.createElement(Wrapper, { ref: wrapperRef, style: { ...style, width, height }, ...attributes }, /* @__PURE__ */ import_react.default.createElement(UniversalSuspense, { fallback: fallback2 }, showPreview ? this.renderPreview(url) : this.renderActivePlayer(url)));
2556
+ }
2557
+ }, __publicField(_a, "displayName", "ReactPlayer"), __publicField(_a, "propTypes", import_props.propTypes), __publicField(_a, "defaultProps", import_props.defaultProps), __publicField(_a, "addCustomPlayer", (player) => {
2558
+ customPlayers.push(player);
2559
+ }), __publicField(_a, "removeCustomPlayers", () => {
2560
+ customPlayers.length = 0;
2561
+ }), __publicField(_a, "canPlay", (url) => {
2562
+ for (const Player2 of [...customPlayers, ...players]) {
2563
+ if (Player2.canPlay(url)) {
2564
+ return true;
2565
+ }
2566
+ }
2567
+ return false;
2568
+ }), __publicField(_a, "canEnablePIP", (url) => {
2569
+ for (const Player2 of [...customPlayers, ...players]) {
2570
+ if (Player2.canEnablePIP && Player2.canEnablePIP(url)) {
2571
+ return true;
2572
+ }
2573
+ }
2574
+ return false;
2575
+ }), _a;
2576
+ };
2577
+ return ReactPlayer;
2578
+ }
2579
+
2580
+ var patterns;
2581
+ var hasRequiredPatterns;
2582
+
2583
+ function requirePatterns () {
2584
+ if (hasRequiredPatterns) return patterns;
2585
+ hasRequiredPatterns = 1;
2586
+ var __defProp = Object.defineProperty;
2587
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2588
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2589
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2590
+ var __export = (target, all) => {
2591
+ for (var name in all)
2592
+ __defProp(target, name, { get: all[name], enumerable: true });
2593
+ };
2594
+ var __copyProps = (to, from, except, desc) => {
2595
+ if (from && typeof from === "object" || typeof from === "function") {
2596
+ for (let key of __getOwnPropNames(from))
2597
+ if (!__hasOwnProp.call(to, key) && key !== except)
2598
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
2599
+ }
2600
+ return to;
2601
+ };
2602
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2603
+ var patterns_exports = {};
2604
+ __export(patterns_exports, {
2605
+ AUDIO_EXTENSIONS: () => AUDIO_EXTENSIONS,
2606
+ DASH_EXTENSIONS: () => DASH_EXTENSIONS,
2607
+ FLV_EXTENSIONS: () => FLV_EXTENSIONS,
2608
+ HLS_EXTENSIONS: () => HLS_EXTENSIONS,
2609
+ MATCH_URL_DAILYMOTION: () => MATCH_URL_DAILYMOTION,
2610
+ MATCH_URL_FACEBOOK: () => MATCH_URL_FACEBOOK,
2611
+ MATCH_URL_FACEBOOK_WATCH: () => MATCH_URL_FACEBOOK_WATCH,
2612
+ MATCH_URL_KALTURA: () => MATCH_URL_KALTURA,
2613
+ MATCH_URL_MIXCLOUD: () => MATCH_URL_MIXCLOUD,
2614
+ MATCH_URL_MUX: () => MATCH_URL_MUX,
2615
+ MATCH_URL_SOUNDCLOUD: () => MATCH_URL_SOUNDCLOUD,
2616
+ MATCH_URL_STREAMABLE: () => MATCH_URL_STREAMABLE,
2617
+ MATCH_URL_TWITCH_CHANNEL: () => MATCH_URL_TWITCH_CHANNEL,
2618
+ MATCH_URL_TWITCH_VIDEO: () => MATCH_URL_TWITCH_VIDEO,
2619
+ MATCH_URL_VIDYARD: () => MATCH_URL_VIDYARD,
2620
+ MATCH_URL_VIMEO: () => MATCH_URL_VIMEO,
2621
+ MATCH_URL_WISTIA: () => MATCH_URL_WISTIA,
2622
+ MATCH_URL_YOUTUBE: () => MATCH_URL_YOUTUBE,
2623
+ VIDEO_EXTENSIONS: () => VIDEO_EXTENSIONS,
2624
+ canPlay: () => canPlay
2625
+ });
2626
+ patterns = __toCommonJS(patterns_exports);
2627
+ var import_utils = /*@__PURE__*/ requireUtils();
2628
+ const MATCH_URL_YOUTUBE = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\//;
2629
+ const MATCH_URL_SOUNDCLOUD = /(?:soundcloud\.com|snd\.sc)\/[^.]+$/;
2630
+ const MATCH_URL_VIMEO = /vimeo\.com\/(?!progressive_redirect).+/;
2631
+ const MATCH_URL_MUX = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/;
2632
+ const MATCH_URL_FACEBOOK = /^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/;
2633
+ const MATCH_URL_FACEBOOK_WATCH = /^https?:\/\/fb\.watch\/.+$/;
2634
+ const MATCH_URL_STREAMABLE = /streamable\.com\/([a-z0-9]+)$/;
2635
+ const MATCH_URL_WISTIA = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/;
2636
+ const MATCH_URL_TWITCH_VIDEO = /(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/;
2637
+ const MATCH_URL_TWITCH_CHANNEL = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/;
2638
+ const MATCH_URL_DAILYMOTION = /^(?:(?:https?):)?(?:\/\/)?(?:www\.)?(?:(?:dailymotion\.com(?:\/embed)?\/video)|dai\.ly)\/([a-zA-Z0-9]+)(?:_[\w_-]+)?(?:[\w.#_-]+)?/;
2639
+ const MATCH_URL_MIXCLOUD = /mixcloud\.com\/([^/]+\/[^/]+)/;
2640
+ const MATCH_URL_VIDYARD = /vidyard.com\/(?:watch\/)?([a-zA-Z0-9-_]+)/;
2641
+ const MATCH_URL_KALTURA = /^https?:\/\/[a-zA-Z]+\.kaltura.(com|org)\/p\/([0-9]+)\/sp\/([0-9]+)00\/embedIframeJs\/uiconf_id\/([0-9]+)\/partner_id\/([0-9]+)(.*)entry_id.([a-zA-Z0-9-_].*)$/;
2642
+ const AUDIO_EXTENSIONS = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i;
2643
+ const VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i;
2644
+ const HLS_EXTENSIONS = /\.(m3u8)($|\?)/i;
2645
+ const DASH_EXTENSIONS = /\.(mpd)($|\?)/i;
2646
+ const FLV_EXTENSIONS = /\.(flv)($|\?)/i;
2647
+ const canPlayFile = (url) => {
2648
+ if (url instanceof Array) {
2649
+ for (const item of url) {
2650
+ if (typeof item === "string" && canPlayFile(item)) {
2651
+ return true;
2652
+ }
2653
+ if (canPlayFile(item.src)) {
2654
+ return true;
2655
+ }
2656
+ }
2657
+ return false;
2658
+ }
2659
+ if ((0, import_utils.isMediaStream)(url) || (0, import_utils.isBlobUrl)(url)) {
2660
+ return true;
2661
+ }
2662
+ return AUDIO_EXTENSIONS.test(url) || VIDEO_EXTENSIONS.test(url) || HLS_EXTENSIONS.test(url) || DASH_EXTENSIONS.test(url) || FLV_EXTENSIONS.test(url);
2663
+ };
2664
+ const canPlay = {
2665
+ youtube: (url) => {
2666
+ if (url instanceof Array) {
2667
+ return url.every((item) => MATCH_URL_YOUTUBE.test(item));
2668
+ }
2669
+ return MATCH_URL_YOUTUBE.test(url);
2670
+ },
2671
+ soundcloud: (url) => MATCH_URL_SOUNDCLOUD.test(url) && !AUDIO_EXTENSIONS.test(url),
2672
+ vimeo: (url) => MATCH_URL_VIMEO.test(url) && !VIDEO_EXTENSIONS.test(url) && !HLS_EXTENSIONS.test(url),
2673
+ mux: (url) => MATCH_URL_MUX.test(url),
2674
+ facebook: (url) => MATCH_URL_FACEBOOK.test(url) || MATCH_URL_FACEBOOK_WATCH.test(url),
2675
+ streamable: (url) => MATCH_URL_STREAMABLE.test(url),
2676
+ wistia: (url) => MATCH_URL_WISTIA.test(url),
2677
+ twitch: (url) => MATCH_URL_TWITCH_VIDEO.test(url) || MATCH_URL_TWITCH_CHANNEL.test(url),
2678
+ dailymotion: (url) => MATCH_URL_DAILYMOTION.test(url),
2679
+ mixcloud: (url) => MATCH_URL_MIXCLOUD.test(url),
2680
+ vidyard: (url) => MATCH_URL_VIDYARD.test(url),
2681
+ kaltura: (url) => MATCH_URL_KALTURA.test(url),
2682
+ file: canPlayFile
2683
+ };
2684
+ return patterns;
2685
+ }
2686
+
2687
+ var YouTube_1;
2688
+ var hasRequiredYouTube;
2689
+
2690
+ function requireYouTube () {
2691
+ if (hasRequiredYouTube) return YouTube_1;
2692
+ hasRequiredYouTube = 1;
2693
+ var __create = Object.create;
2694
+ var __defProp = Object.defineProperty;
2695
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2696
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2697
+ var __getProtoOf = Object.getPrototypeOf;
2698
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2699
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2700
+ var __export = (target, all) => {
2701
+ for (var name in all)
2702
+ __defProp(target, name, { get: all[name], enumerable: true });
2703
+ };
2704
+ var __copyProps = (to, from, except, desc) => {
2705
+ if (from && typeof from === "object" || typeof from === "function") {
2706
+ for (let key of __getOwnPropNames(from))
2707
+ if (!__hasOwnProp.call(to, key) && key !== except)
2708
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
2709
+ }
2710
+ return to;
2711
+ };
2712
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
2713
+ // If the importer is in node compatibility mode or this is not an ESM
2714
+ // file that has been converted to a CommonJS file using a Babel-
2715
+ // compatible transform (i.e. "__esModule" has not been set), then set
2716
+ // "default" to the CommonJS "module.exports" for node compatibility.
2717
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
2718
+ mod
2719
+ ));
2720
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2721
+ var __publicField = (obj, key, value) => {
2722
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
2723
+ return value;
2724
+ };
2725
+ var YouTube_exports = {};
2726
+ __export(YouTube_exports, {
2727
+ default: () => YouTube
2728
+ });
2729
+ YouTube_1 = __toCommonJS(YouTube_exports);
2730
+ var import_react = __toESM(React__default);
2731
+ var import_utils = /*@__PURE__*/ requireUtils();
2732
+ var import_patterns = /*@__PURE__*/ requirePatterns();
2733
+ const SDK_URL = "https://www.youtube.com/iframe_api";
2734
+ const SDK_GLOBAL = "YT";
2735
+ const SDK_GLOBAL_READY = "onYouTubeIframeAPIReady";
2736
+ const MATCH_PLAYLIST = /[?&](?:list|channel)=([a-zA-Z0-9_-]+)/;
2737
+ const MATCH_USER_UPLOADS = /user\/([a-zA-Z0-9_-]+)\/?/;
2738
+ const MATCH_NOCOOKIE = /youtube-nocookie\.com/;
2739
+ const NOCOOKIE_HOST = "https://www.youtube-nocookie.com";
2740
+ class YouTube extends import_react.Component {
2741
+ constructor() {
2742
+ super(...arguments);
2743
+ __publicField(this, "callPlayer", import_utils.callPlayer);
2744
+ __publicField(this, "parsePlaylist", (url) => {
2745
+ if (url instanceof Array) {
2746
+ return {
2747
+ listType: "playlist",
2748
+ playlist: url.map(this.getID).join(",")
2749
+ };
2750
+ }
2751
+ if (MATCH_PLAYLIST.test(url)) {
2752
+ const [, playlistId] = url.match(MATCH_PLAYLIST);
2753
+ return {
2754
+ listType: "playlist",
2755
+ list: playlistId.replace(/^UC/, "UU")
2756
+ };
2757
+ }
2758
+ if (MATCH_USER_UPLOADS.test(url)) {
2759
+ const [, username] = url.match(MATCH_USER_UPLOADS);
2760
+ return {
2761
+ listType: "user_uploads",
2762
+ list: username
2763
+ };
2764
+ }
2765
+ return {};
2766
+ });
2767
+ __publicField(this, "onStateChange", (event) => {
2768
+ const { data } = event;
2769
+ const { onPlay, onPause, onBuffer, onBufferEnd, onEnded, onReady, loop, config: { playerVars, onUnstarted } } = this.props;
2770
+ const { UNSTARTED, PLAYING, PAUSED, BUFFERING, ENDED, CUED } = window[SDK_GLOBAL].PlayerState;
2771
+ if (data === UNSTARTED)
2772
+ onUnstarted();
2773
+ if (data === PLAYING) {
2774
+ onPlay();
2775
+ onBufferEnd();
2776
+ }
2777
+ if (data === PAUSED)
2778
+ onPause();
2779
+ if (data === BUFFERING)
2780
+ onBuffer();
2781
+ if (data === ENDED) {
2782
+ const isPlaylist = !!this.callPlayer("getPlaylist");
2783
+ if (loop && !isPlaylist) {
2784
+ if (playerVars.start) {
2785
+ this.seekTo(playerVars.start);
2786
+ } else {
2787
+ this.play();
2788
+ }
2789
+ }
2790
+ onEnded();
2791
+ }
2792
+ if (data === CUED)
2793
+ onReady();
2794
+ });
2795
+ __publicField(this, "mute", () => {
2796
+ this.callPlayer("mute");
2797
+ });
2798
+ __publicField(this, "unmute", () => {
2799
+ this.callPlayer("unMute");
2800
+ });
2801
+ __publicField(this, "ref", (container) => {
2802
+ this.container = container;
2803
+ });
2804
+ }
2805
+ componentDidMount() {
2806
+ this.props.onMount && this.props.onMount(this);
2807
+ }
2808
+ getID(url) {
2809
+ if (!url || url instanceof Array || MATCH_PLAYLIST.test(url)) {
2810
+ return null;
2811
+ }
2812
+ return url.match(import_patterns.MATCH_URL_YOUTUBE)[1];
2813
+ }
2814
+ load(url, isReady) {
2815
+ const { playing, muted, playsinline, controls, loop, config, onError } = this.props;
2816
+ const { playerVars, embedOptions } = config;
2817
+ const id = this.getID(url);
2818
+ if (isReady) {
2819
+ if (MATCH_PLAYLIST.test(url) || MATCH_USER_UPLOADS.test(url) || url instanceof Array) {
2820
+ this.player.loadPlaylist(this.parsePlaylist(url));
2821
+ return;
2822
+ }
2823
+ this.player.cueVideoById({
2824
+ videoId: id,
2825
+ startSeconds: (0, import_utils.parseStartTime)(url) || playerVars.start,
2826
+ endSeconds: (0, import_utils.parseEndTime)(url) || playerVars.end
2827
+ });
2828
+ return;
2829
+ }
2830
+ (0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL, SDK_GLOBAL_READY, (YT) => YT.loaded).then((YT) => {
2831
+ if (!this.container)
2832
+ return;
2833
+ this.player = new YT.Player(this.container, {
2834
+ width: "100%",
2835
+ height: "100%",
2836
+ videoId: id,
2837
+ playerVars: {
2838
+ autoplay: playing ? 1 : 0,
2839
+ mute: muted ? 1 : 0,
2840
+ controls: controls ? 1 : 0,
2841
+ start: (0, import_utils.parseStartTime)(url),
2842
+ end: (0, import_utils.parseEndTime)(url),
2843
+ origin: window.location.origin,
2844
+ playsinline: playsinline ? 1 : 0,
2845
+ ...this.parsePlaylist(url),
2846
+ ...playerVars
2847
+ },
2848
+ events: {
2849
+ onReady: () => {
2850
+ if (loop) {
2851
+ this.player.setLoop(true);
2852
+ }
2853
+ this.props.onReady();
2854
+ },
2855
+ onPlaybackRateChange: (event) => this.props.onPlaybackRateChange(event.data),
2856
+ onPlaybackQualityChange: (event) => this.props.onPlaybackQualityChange(event),
2857
+ onStateChange: this.onStateChange,
2858
+ onError: (event) => onError(event.data)
2859
+ },
2860
+ host: MATCH_NOCOOKIE.test(url) ? NOCOOKIE_HOST : void 0,
2861
+ ...embedOptions
2862
+ });
2863
+ }, onError);
2864
+ if (embedOptions.events) {
2865
+ console.warn("Using `embedOptions.events` will likely break things. Use ReactPlayer\u2019s callback props instead, eg onReady, onPlay, onPause");
2866
+ }
2867
+ }
2868
+ play() {
2869
+ this.callPlayer("playVideo");
2870
+ }
2871
+ pause() {
2872
+ this.callPlayer("pauseVideo");
2873
+ }
2874
+ stop() {
2875
+ if (!document.body.contains(this.callPlayer("getIframe")))
2876
+ return;
2877
+ this.callPlayer("stopVideo");
2878
+ }
2879
+ seekTo(amount, keepPlaying = false) {
2880
+ this.callPlayer("seekTo", amount);
2881
+ if (!keepPlaying && !this.props.playing) {
2882
+ this.pause();
2883
+ }
2884
+ }
2885
+ setVolume(fraction) {
2886
+ this.callPlayer("setVolume", fraction * 100);
2887
+ }
2888
+ setPlaybackRate(rate) {
2889
+ this.callPlayer("setPlaybackRate", rate);
2890
+ }
2891
+ setLoop(loop) {
2892
+ this.callPlayer("setLoop", loop);
2893
+ }
2894
+ getDuration() {
2895
+ return this.callPlayer("getDuration");
2896
+ }
2897
+ getCurrentTime() {
2898
+ return this.callPlayer("getCurrentTime");
2899
+ }
2900
+ getSecondsLoaded() {
2901
+ return this.callPlayer("getVideoLoadedFraction") * this.getDuration();
2902
+ }
2903
+ render() {
2904
+ const { display } = this.props;
2905
+ const style = {
2906
+ width: "100%",
2907
+ height: "100%",
2908
+ display
2909
+ };
2910
+ return /* @__PURE__ */ import_react.default.createElement("div", { style }, /* @__PURE__ */ import_react.default.createElement("div", { ref: this.ref }));
2911
+ }
2912
+ }
2913
+ __publicField(YouTube, "displayName", "YouTube");
2914
+ __publicField(YouTube, "canPlay", import_patterns.canPlay.youtube);
2915
+ return YouTube_1;
2916
+ }
2917
+
2918
+ var youtube;
2919
+ var hasRequiredYoutube;
2920
+
2921
+ function requireYoutube () {
2922
+ if (hasRequiredYoutube) return youtube;
2923
+ hasRequiredYoutube = 1;
2924
+ var createReactPlayer = /*@__PURE__*/ requireReactPlayer().createReactPlayer;
2925
+ var Player = /*@__PURE__*/ requireYouTube().default;
2926
+ youtube = createReactPlayer([{
2927
+ key: 'youtube',
2928
+ canPlay: Player.canPlay,
2929
+ lazyPlayer: Player
2930
+ }]);
2931
+ return youtube;
2932
+ }
2933
+
2934
+ var youtubeExports = /*@__PURE__*/ requireYoutube();
2935
+ var ReactPlayerYoutube = /*@__PURE__*/getDefaultExportFromCjs(youtubeExports);
2936
+
2937
+ var Vimeo_1;
2938
+ var hasRequiredVimeo$1;
2939
+
2940
+ function requireVimeo$1 () {
2941
+ if (hasRequiredVimeo$1) return Vimeo_1;
2942
+ hasRequiredVimeo$1 = 1;
2943
+ var __create = Object.create;
2944
+ var __defProp = Object.defineProperty;
2945
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
2946
+ var __getOwnPropNames = Object.getOwnPropertyNames;
2947
+ var __getProtoOf = Object.getPrototypeOf;
2948
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
2949
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2950
+ var __export = (target, all) => {
2951
+ for (var name in all)
2952
+ __defProp(target, name, { get: all[name], enumerable: true });
2953
+ };
2954
+ var __copyProps = (to, from, except, desc) => {
2955
+ if (from && typeof from === "object" || typeof from === "function") {
2956
+ for (let key of __getOwnPropNames(from))
2957
+ if (!__hasOwnProp.call(to, key) && key !== except)
2958
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
2959
+ }
2960
+ return to;
2961
+ };
2962
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
2963
+ // If the importer is in node compatibility mode or this is not an ESM
2964
+ // file that has been converted to a CommonJS file using a Babel-
2965
+ // compatible transform (i.e. "__esModule" has not been set), then set
2966
+ // "default" to the CommonJS "module.exports" for node compatibility.
2967
+ !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
2968
+ mod
2969
+ ));
2970
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
2971
+ var __publicField = (obj, key, value) => {
2972
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
2973
+ return value;
2974
+ };
2975
+ var Vimeo_exports = {};
2976
+ __export(Vimeo_exports, {
2977
+ default: () => Vimeo
2978
+ });
2979
+ Vimeo_1 = __toCommonJS(Vimeo_exports);
2980
+ var import_react = __toESM(React__default);
2981
+ var import_utils = /*@__PURE__*/ requireUtils();
2982
+ var import_patterns = /*@__PURE__*/ requirePatterns();
2983
+ const SDK_URL = "https://player.vimeo.com/api/player.js";
2984
+ const SDK_GLOBAL = "Vimeo";
2985
+ const cleanUrl = (url) => {
2986
+ return url.replace("/manage/videos", "");
2987
+ };
2988
+ class Vimeo extends import_react.Component {
2989
+ constructor() {
2990
+ super(...arguments);
2991
+ // Prevent checking isLoading when URL changes
2992
+ __publicField(this, "callPlayer", import_utils.callPlayer);
2993
+ __publicField(this, "duration", null);
2994
+ __publicField(this, "currentTime", null);
2995
+ __publicField(this, "secondsLoaded", null);
2996
+ __publicField(this, "mute", () => {
2997
+ this.setMuted(true);
2998
+ });
2999
+ __publicField(this, "unmute", () => {
3000
+ this.setMuted(false);
3001
+ });
3002
+ __publicField(this, "ref", (container) => {
3003
+ this.container = container;
3004
+ });
3005
+ }
3006
+ componentDidMount() {
3007
+ this.props.onMount && this.props.onMount(this);
3008
+ }
3009
+ load(url) {
3010
+ this.duration = null;
3011
+ (0, import_utils.getSDK)(SDK_URL, SDK_GLOBAL).then((Vimeo2) => {
3012
+ if (!this.container)
3013
+ return;
3014
+ const { playerOptions, title } = this.props.config;
3015
+ this.player = new Vimeo2.Player(this.container, {
3016
+ url: cleanUrl(url),
3017
+ autoplay: this.props.playing,
3018
+ muted: this.props.muted,
3019
+ loop: this.props.loop,
3020
+ playsinline: this.props.playsinline,
3021
+ controls: this.props.controls,
3022
+ ...playerOptions
3023
+ });
3024
+ this.player.ready().then(() => {
3025
+ const iframe = this.container.querySelector("iframe");
3026
+ iframe.style.width = "100%";
3027
+ iframe.style.height = "100%";
3028
+ if (title) {
3029
+ iframe.title = title;
3030
+ }
3031
+ }).catch(this.props.onError);
3032
+ this.player.on("loaded", () => {
3033
+ this.props.onReady();
3034
+ this.refreshDuration();
3035
+ });
3036
+ this.player.on("play", () => {
3037
+ this.props.onPlay();
3038
+ this.refreshDuration();
3039
+ });
3040
+ this.player.on("pause", this.props.onPause);
3041
+ this.player.on("seeked", (e) => this.props.onSeek(e.seconds));
3042
+ this.player.on("ended", this.props.onEnded);
3043
+ this.player.on("error", this.props.onError);
3044
+ this.player.on("timeupdate", ({ seconds }) => {
3045
+ this.currentTime = seconds;
3046
+ });
3047
+ this.player.on("progress", ({ seconds }) => {
3048
+ this.secondsLoaded = seconds;
3049
+ });
3050
+ this.player.on("bufferstart", this.props.onBuffer);
3051
+ this.player.on("bufferend", this.props.onBufferEnd);
3052
+ this.player.on("playbackratechange", (e) => this.props.onPlaybackRateChange(e.playbackRate));
3053
+ }, this.props.onError);
3054
+ }
3055
+ refreshDuration() {
3056
+ this.player.getDuration().then((duration) => {
3057
+ this.duration = duration;
3058
+ });
3059
+ }
3060
+ play() {
3061
+ const promise = this.callPlayer("play");
3062
+ if (promise) {
3063
+ promise.catch(this.props.onError);
3064
+ }
3065
+ }
3066
+ pause() {
3067
+ this.callPlayer("pause");
3068
+ }
3069
+ stop() {
3070
+ this.callPlayer("unload");
3071
+ }
3072
+ seekTo(seconds, keepPlaying = true) {
3073
+ this.callPlayer("setCurrentTime", seconds);
3074
+ if (!keepPlaying) {
3075
+ this.pause();
3076
+ }
3077
+ }
3078
+ setVolume(fraction) {
3079
+ this.callPlayer("setVolume", fraction);
3080
+ }
3081
+ setMuted(muted) {
3082
+ this.callPlayer("setMuted", muted);
3083
+ }
3084
+ setLoop(loop) {
3085
+ this.callPlayer("setLoop", loop);
3086
+ }
3087
+ setPlaybackRate(rate) {
3088
+ this.callPlayer("setPlaybackRate", rate);
3089
+ }
3090
+ getDuration() {
3091
+ return this.duration;
3092
+ }
3093
+ getCurrentTime() {
3094
+ return this.currentTime;
3095
+ }
3096
+ getSecondsLoaded() {
3097
+ return this.secondsLoaded;
3098
+ }
3099
+ render() {
3100
+ const { display } = this.props;
3101
+ const style = {
3102
+ width: "100%",
3103
+ height: "100%",
3104
+ overflow: "hidden",
3105
+ display
3106
+ };
3107
+ return /* @__PURE__ */ import_react.default.createElement(
3108
+ "div",
3109
+ {
3110
+ key: this.props.url,
3111
+ ref: this.ref,
3112
+ style
3113
+ }
3114
+ );
3115
+ }
3116
+ }
3117
+ __publicField(Vimeo, "displayName", "Vimeo");
3118
+ __publicField(Vimeo, "canPlay", import_patterns.canPlay.vimeo);
3119
+ __publicField(Vimeo, "forceLoad", true);
3120
+ return Vimeo_1;
3121
+ }
3122
+
3123
+ var vimeo;
3124
+ var hasRequiredVimeo;
3125
+
3126
+ function requireVimeo () {
3127
+ if (hasRequiredVimeo) return vimeo;
3128
+ hasRequiredVimeo = 1;
3129
+ var createReactPlayer = /*@__PURE__*/ requireReactPlayer().createReactPlayer;
3130
+ var Player = /*@__PURE__*/ requireVimeo$1().default;
3131
+ vimeo = createReactPlayer([{
3132
+ key: 'vimeo',
3133
+ canPlay: Player.canPlay,
3134
+ lazyPlayer: Player
3135
+ }]);
3136
+ return vimeo;
3137
+ }
3138
+
3139
+ var vimeoExports = /*@__PURE__*/ requireVimeo();
3140
+ var ReactPlayerVimeo = /*@__PURE__*/getDefaultExportFromCjs(vimeoExports);
3141
+
3142
+ /**
3143
+ * Use `VideoPlayer` to embed videos from YouTube or Vimeo.
3144
+ */
3145
+ var VideoPlayer = function (_a) {
3146
+ var title = _a.title, description = _a.description, transcriptLink = _a.transcriptLink, transcriptContent = _a.transcriptContent, light = _a.light, url = _a.url, onReady = _a.onReady, onPlay = _a.onPlay, onStart = _a.onStart, onPause = _a.onPause, onError = _a.onError, onEnded = _a.onEnded, _b = _a.isBorderRadius, isBorderRadius = _b === void 0 ? false : _b, _c = _a.isSupportingTextHidden, isSupportingTextHidden = _c === void 0 ? false : _c, _d = _a.titleWordWrap, titleWordWrap = _d === void 0 ? false : _d, props = __rest(_a, ["title", "description", "transcriptLink", "transcriptContent", "light", "url", "onReady", "onPlay", "onStart", "onPause", "onError", "onEnded", "isBorderRadius", "isSupportingTextHidden", "titleWordWrap"]);
3147
+ var TextWrapper = isSupportingTextHidden ? VisuallyHidden : "div";
3148
+ var isVimeo = new URL(url).hostname.includes("vimeo");
3149
+ var _e = useState(false), isClient = _e[0], setIsClient = _e[1];
3150
+ // https://nextjs.org/docs/messages/react-hydration-error#solution-1-using-useeffect-to-run-on-the-client-only
3151
+ useEffect(function () {
3152
+ setIsClient(true);
3153
+ }, []);
3154
+ var playerProps = {
3155
+ url: url,
3156
+ light: light,
3157
+ onReady: onReady,
3158
+ onPlay: onPlay,
3159
+ onStart: onStart,
3160
+ onPause: onPause,
3161
+ onError: onError,
3162
+ onEnded: onEnded,
3163
+ playIcon: (React__default.createElement("div", { className: "arc-VideoPlayer-iconContainer" },
3164
+ React__default.createElement("div", { className: "arc-VideoPlayer-icon" },
3165
+ React__default.createElement(ThemeIcon, { icon: "videoPlayerPlay" })))),
3166
+ playing: Boolean(light),
3167
+ controls: true,
3168
+ className: "arc-VideoPlayer",
3169
+ width: "100%",
3170
+ height: "100%",
3171
+ };
3172
+ return (React__default.createElement("div", __assign({}, filterAttrs(props)),
3173
+ React__default.createElement("div", { "data-testid": "arc-video-player", className: classNames("arc-VideoPlayer-wrapper", {
3174
+ "arc-VideoPlayer-wrapper--borderRadius": isBorderRadius,
3175
+ }) }, isVimeo
3176
+ ? isClient && React__default.createElement(ReactPlayerVimeo, __assign({}, playerProps))
3177
+ : isClient && React__default.createElement(ReactPlayerYoutube, __assign({}, playerProps))),
3178
+ React__default.createElement(TextWrapper, null,
3179
+ React__default.createElement(VerticalSpace, { size: "24" }),
3180
+ React__default.createElement(Heading, { level: "3", size: "s", isWordWrap: titleWordWrap }, title),
3181
+ React__default.createElement(VerticalSpace, { size: "8" }),
3182
+ React__default.createElement(Text, null, description)),
3183
+ transcriptLink && (React__default.createElement(React__default.Fragment, null,
3184
+ React__default.createElement(VerticalSpace, { size: "24" }),
3185
+ React__default.createElement(Download, { isCompact: true, icon: "downloadAccessibility", href: transcriptLink.url, name: transcriptLink.text, type: transcriptLink.format, size: transcriptLink.fileSize }))),
3186
+ transcriptContent && (React__default.createElement(React__default.Fragment, null,
3187
+ React__default.createElement(VerticalSpace, { size: "24" }),
3188
+ React__default.createElement(DisclosureMini, { summary: "Audio Described Transcript" },
3189
+ React__default.createElement(VerticalSpace, { size: "8" }),
3190
+ React__default.createElement(Heading, null, transcriptContent.heading.toUpperCase()),
3191
+ React__default.createElement(VerticalSpace, { size: "32" }),
3192
+ React__default.createElement(Text, null, transcriptContent.description),
3193
+ React__default.createElement(VerticalSpace, { size: "24" }),
3194
+ transcriptContent.content.map(function (_a, i) {
3195
+ var heading = _a.heading, text = _a.text;
3196
+ return (React__default.createElement("div", { key: "".concat(text, "-").concat(i) },
3197
+ React__default.createElement(VerticalSpace, { size: "24" }),
3198
+ heading && (React__default.createElement(React__default.Fragment, null,
3199
+ React__default.createElement(Heading, { isInline: true }, heading === null || heading === void 0 ? void 0 : heading.toUpperCase()),
3200
+ "\u00A0")),
3201
+ React__default.createElement(Text, { isInline: true }, text)));
3202
+ }))))));
3203
+ };
3204
+
3205
+ export { VideoPlayer as V };