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