@arc-ui/community-components 3.3.0 → 3.5.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 (142) hide show
  1. package/.turbo/turbo-build.log +135 -15
  2. package/CHANGELOG.md +22 -0
  3. package/lib/Accordion/Accordion.cjs +3 -2
  4. package/lib/Accordion/Accordion.mjs +3 -2
  5. package/lib/ActionTile/ActionTile.cjs +7 -5
  6. package/lib/ActionTile/ActionTile.mjs +13 -11
  7. package/lib/ActionTile/styles.css +1 -1
  8. package/lib/ArticleSidebar/ArticleSidebar.cjs +10 -9
  9. package/lib/ArticleSidebar/ArticleSidebar.mjs +46 -45
  10. package/lib/Author/Author.cjs +3 -2
  11. package/lib/Author/Author.mjs +3 -2
  12. package/lib/BannerWithTabs/BannerWithTabs.cjs +5 -4
  13. package/lib/BannerWithTabs/BannerWithTabs.mjs +8 -7
  14. package/lib/BusinessSegmentSwitcher/BusinessSegmentSwitcher.cjs +81 -0
  15. package/lib/BusinessSegmentSwitcher/BusinessSegmentSwitcher.mjs +79 -0
  16. package/lib/BusinessSegmentSwitcher/styles.css +1 -0
  17. package/lib/ContentInfoWidget/ContentInfoWidget.cjs +4 -3
  18. package/lib/ContentInfoWidget/ContentInfoWidget.mjs +8 -7
  19. package/lib/CopyLead/CopyLead.cjs +33 -22
  20. package/lib/CopyLead/CopyLead.mjs +61 -50
  21. package/lib/DownloadList/DownloadList.cjs +6 -5
  22. package/lib/DownloadList/DownloadList.mjs +11 -10
  23. package/lib/FAQs/FAQs.cjs +6 -5
  24. package/lib/FAQs/FAQs.mjs +23 -22
  25. package/lib/FeaturePost/FeaturePost.cjs +13 -12
  26. package/lib/FeaturePost/FeaturePost.mjs +55 -54
  27. package/lib/Highlights/Highlights.cjs +11 -10
  28. package/lib/Highlights/Highlights.mjs +21 -20
  29. package/lib/InlineLinkGroup/InlineLinkGroup.cjs +4 -3
  30. package/lib/InlineLinkGroup/InlineLinkGroup.mjs +12 -11
  31. package/lib/LinkTile/LinkTile.cjs +3 -3
  32. package/lib/LinkTile/LinkTile.mjs +6 -6
  33. package/lib/LinkTile/styles.css +1 -1
  34. package/lib/ProductNavigation/ProductNavigation.cjs +7 -6
  35. package/lib/ProductNavigation/ProductNavigation.mjs +19 -18
  36. package/lib/PromoListing/PromoListing.cjs +8 -7
  37. package/lib/PromoListing/PromoListing.mjs +17 -16
  38. package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.cjs +8 -7
  39. package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.mjs +10 -9
  40. package/lib/Quote/Quote.cjs +6 -5
  41. package/lib/Quote/Quote.mjs +10 -9
  42. package/lib/SectionHeading/SectionHeading.cjs +3 -2
  43. package/lib/SectionHeading/SectionHeading.mjs +3 -2
  44. package/lib/Statistics/Statistics.cjs +6 -5
  45. package/lib/Statistics/Statistics.mjs +33 -32
  46. package/lib/Summary/Summary.cjs +5 -4
  47. package/lib/Summary/Summary.mjs +13 -12
  48. package/lib/ThumbnailSignpost/ThumbnailSignpost.cjs +3 -2
  49. package/lib/ThumbnailSignpost/ThumbnailSignpost.mjs +3 -2
  50. package/lib/VideoHeroCard/VideoHeroCard.cjs +77 -0
  51. package/lib/VideoHeroCard/VideoHeroCard.mjs +75 -0
  52. package/lib/VideoPortraitCard/VideoPortraitCard.cjs +23 -0
  53. package/lib/VideoPortraitCard/VideoPortraitCard.mjs +21 -0
  54. package/lib/_shared/cjs/{Accordion-QqDoB3pY.cjs → Accordion-DfNGOjTm.cjs} +9 -8
  55. package/lib/_shared/cjs/{Author-aL8YXi7C.cjs → Author-D4dKNQem.cjs} +5 -4
  56. package/lib/_shared/cjs/Preview-Dx1kCzJ1.cjs +102 -0
  57. package/lib/_shared/cjs/{SectionHeading-Dj-dJfv3.cjs → SectionHeading-DeSFM0HV.cjs} +5 -4
  58. package/lib/_shared/cjs/{ThumbnailSignpost-SBnrGooA.cjs → ThumbnailSignpost-GkOiwt-Z.cjs} +5 -4
  59. package/lib/_shared/cjs/VideoCardThumbnail-N5iC-cAU.cjs +441 -0
  60. package/lib/_shared/cjs/dash.all.min-BPXzla24.cjs +6 -0
  61. package/lib/_shared/cjs/filter-attrs-BizjMsy0.cjs +27 -0
  62. package/lib/_shared/cjs/hls-Ckhp5fVA.cjs +36628 -0
  63. package/lib/_shared/cjs/index-DjiIVIaV.cjs +96 -0
  64. package/lib/_shared/cjs/index-oGP6D6gL.cjs +14826 -0
  65. package/lib/_shared/cjs/{index.es-Dq8bYrbW.cjs → index.es-B0J3cvrY.cjs} +1 -1
  66. package/lib/_shared/cjs/mixin-BFwaXKGB.cjs +1027 -0
  67. package/lib/_shared/cjs/react-CEvhi3LL.cjs +737 -0
  68. package/lib/_shared/cjs/react-CqsEClV0.cjs +466 -0
  69. package/lib/_shared/cjs/react-DE6M3seI.cjs +496 -0
  70. package/lib/_shared/cjs/react-Dri2yjKm.cjs +554 -0
  71. package/lib/_shared/cjs/react-DxToimBj.cjs +4239 -0
  72. package/lib/_shared/cjs/react-JTfV8OSA.cjs +325 -0
  73. package/lib/_shared/cjs/react-caXJFZ8W.cjs +400 -0
  74. package/lib/_shared/cjs/react-fep2ei7j.cjs +727 -0
  75. package/lib/_shared/cjs/{filter-attrs-C26zOt4_.cjs → tslib.es6-BxB9I209.cjs} +0 -25
  76. package/lib/_shared/esm/{Accordion-DrOTh90S.mjs → Accordion-DSRlkcXi.mjs} +17 -16
  77. package/lib/_shared/esm/Author-CLMgH9ES.mjs +28 -0
  78. package/lib/_shared/esm/Preview-CmbKOgEO.mjs +100 -0
  79. package/lib/_shared/esm/{SectionHeading-DZOg_gYi.mjs → SectionHeading-DSwsdNSp.mjs} +11 -10
  80. package/lib/_shared/esm/{ThumbnailSignpost-DaZByYIH.mjs → ThumbnailSignpost-BtaHAB0h.mjs} +14 -13
  81. package/lib/_shared/esm/VideoCardThumbnail-Tbh7Xi-X.mjs +438 -0
  82. package/lib/_shared/esm/dash.all.min-CbWI_8dN.mjs +4 -0
  83. package/lib/_shared/esm/filter-attrs-DZ7RCEZm.mjs +25 -0
  84. package/lib/_shared/esm/hls-AFbJDS9D.mjs +36625 -0
  85. package/lib/_shared/esm/index-CrcIrdjn.mjs +14799 -0
  86. package/lib/_shared/esm/index-DYnuIO1L.mjs +94 -0
  87. package/lib/_shared/esm/{index.es-Bfdys5__.mjs → index.es-DraZ-qKh.mjs} +1 -1
  88. package/lib/_shared/esm/mixin-BGGG8VrM.mjs +1024 -0
  89. package/lib/_shared/esm/react-BGimq-TB.mjs +4237 -0
  90. package/lib/_shared/esm/react-BHT4t_eQ.mjs +494 -0
  91. package/lib/_shared/esm/react-BSd0sGcO.mjs +464 -0
  92. package/lib/_shared/esm/react-CSr43fZV.mjs +552 -0
  93. package/lib/_shared/esm/react-Ca6E7Fr-.mjs +398 -0
  94. package/lib/_shared/esm/react-DG070IvZ.mjs +725 -0
  95. package/lib/_shared/esm/react-DZyqy7W7.mjs +735 -0
  96. package/lib/_shared/esm/react-WW_9iHcl.mjs +323 -0
  97. package/lib/_shared/esm/{filter-attrs-D-1kWaCP.mjs → tslib.es6-BVXMhEem.mjs} +1 -25
  98. package/lib/index.cjs +323 -125
  99. package/lib/index.cjs.map +1 -1
  100. package/lib/index.d.cts +114 -3
  101. package/lib/index.d.mts +114 -3
  102. package/lib/index.mjs +321 -126
  103. package/lib/index.mjs.map +1 -1
  104. package/lib/styles.css +1 -1
  105. package/package.json +16 -13
  106. package/rollup.config.js +1 -1
  107. package/src/components/ActionTile/ActionTile.module.css +1 -0
  108. package/src/components/ActionTile/ActionTile.tsx +11 -3
  109. package/src/components/BusinessSegmentSwitcher/BusinessSegmentSwitcher.module.css +92 -0
  110. package/src/components/BusinessSegmentSwitcher/BusinessSegmentSwitcher.tsx +119 -0
  111. package/src/components/BusinessSegmentSwitcher/helpers/renderBusinessSegmentSwitcherCarousel.tsx +45 -0
  112. package/src/components/BusinessSegmentSwitcher/helpers/renderCard.tsx +17 -0
  113. package/src/components/BusinessSegmentSwitcher/index.ts +9 -0
  114. package/src/components/BusinessSegmentSwitcher/types/types.ts +45 -0
  115. package/src/components/CopyLead/components/MediaContent/MediaContent.tsx +7 -6
  116. package/src/components/CopyLead/templates/Content/Content.tsx +5 -3
  117. package/src/components/CopyLead/templates/Media/Media.tsx +5 -6
  118. package/src/components/LinkTile/LinkTile.module.css +8 -4
  119. package/src/components/LinkTile/LinkTile.tsx +1 -2
  120. package/src/components/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.tsx +2 -0
  121. package/src/components/VideoHeroCard/VideoHeroCard.tsx +63 -0
  122. package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.module.css +32 -0
  123. package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.tsx +97 -0
  124. package/src/components/VideoHeroCard/components/VideoHeroCardContent/index.ts +4 -0
  125. package/src/components/VideoHeroCard/index.ts +1 -0
  126. package/src/components/VideoPortraitCard/VideoPortraitCard.tsx +54 -0
  127. package/src/components/VideoPortraitCard/index.ts +4 -0
  128. package/src/components/index.ts +3 -0
  129. package/src/internal/MultiLineText/MultiLineText.tsx +25 -0
  130. package/src/internal/MultiLineText/index.ts +1 -0
  131. package/src/internal/VideoCardPlayer/VideoCardPlayer.module.css +54 -0
  132. package/src/internal/VideoCardPlayer/VideoCardPlayer.tsx +62 -0
  133. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.module.css +41 -0
  134. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.tsx +28 -0
  135. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/index.ts +1 -0
  136. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.module.css +58 -0
  137. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.tsx +38 -0
  138. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/index.ts +1 -0
  139. package/src/internal/VideoCardPlayer/index.ts +2 -0
  140. package/src/internal/VideoCardPlayer/types/player-props.ts +6 -0
  141. package/versions.json +1 -1
  142. package/lib/_shared/esm/Author-BVCRPgkl.mjs +0 -27
@@ -0,0 +1,441 @@
1
+ 'use strict';
2
+
3
+ var tslib_es6 = require('./tslib.es6-BxB9I209.cjs');
4
+ var React = require('react');
5
+ var index = require('./index-Bp6Dd2i1.cjs');
6
+ var filterAttrs = require('./filter-attrs-BizjMsy0.cjs');
7
+ var Icon = require('@arc-ui/components/Icon');
8
+ var Visible = require('@arc-ui/components/Visible');
9
+
10
+ /**
11
+ * Do not edit directly
12
+ * Generated file
13
+ */
14
+
15
+ const ArcIconPlay =
16
+ "data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 56 56'%3e%3cpath fill='currentColor' d='M36.468 26.32 23.907 19.07A1.938 1.938 0 0 0 21 20.745V35.25a1.935 1.935 0 0 0 2.907 1.68l12.561-7.254a1.938 1.938 0 0 0 0-3.354m-.875 1.84-12.561 7.254a.18.18 0 0 1-.187 0 .18.18 0 0 1-.095-.165V20.745a.18.18 0 0 1 .095-.16.18.18 0 0 1 .187 0l12.561 7.25a.18.18 0 0 1 .095.164.18.18 0 0 1-.095.16'/%3e%3c/svg%3e";
17
+
18
+ const AUDIO_EXTENSIONS = /\.(m4a|m4b|mp4a|mpga|mp2|mp2a|mp3|m2a|m3a|wav|weba|aac|oga|spx)($|\?)/i;
19
+ const VIDEO_EXTENSIONS = /\.(mp4|og[gv]|webm|mov|m4v)(#t=[,\d+]+)?($|\?)/i;
20
+ const HLS_EXTENSIONS = /\.(m3u8)($|\?)/i;
21
+ const DASH_EXTENSIONS = /\.(mpd)($|\?)/i;
22
+ const MATCH_URL_MUX = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/;
23
+ 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\//;
24
+ const MATCH_URL_VIMEO = /vimeo\.com\/(?!progressive_redirect).+/;
25
+ const MATCH_URL_WISTIA = /(?:wistia\.(?:com|net)|wi\.st)\/(?:medias|embed)\/(?:iframe\/)?([^?]+)/;
26
+ const MATCH_URL_SPOTIFY = /open\.spotify\.com\/(\w+)\/(\w+)/i;
27
+ const MATCH_URL_TWITCH = /(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+|(videos?\/|\?video=)\d+)($|\?)/;
28
+ const MATCH_URL_TIKTOK = /tiktok\.com\/(?:player\/v1\/|share\/video\/|@[^/]+\/video\/)([0-9]+)/;
29
+ const canPlayFile = (url, test) => {
30
+ if (Array.isArray(url)) {
31
+ for (const item of url) {
32
+ if (typeof item === "string" && canPlayFile(item, test)) {
33
+ return true;
34
+ }
35
+ if (canPlayFile(item.src, test)) {
36
+ return true;
37
+ }
38
+ }
39
+ return false;
40
+ }
41
+ return test(url);
42
+ };
43
+ const canPlay = {
44
+ html: (url) => canPlayFile(url, (u) => AUDIO_EXTENSIONS.test(u) || VIDEO_EXTENSIONS.test(u)),
45
+ hls: (url) => canPlayFile(url, (u) => HLS_EXTENSIONS.test(u)),
46
+ dash: (url) => canPlayFile(url, (u) => DASH_EXTENSIONS.test(u)),
47
+ mux: (url) => MATCH_URL_MUX.test(url),
48
+ youtube: (url) => MATCH_URL_YOUTUBE.test(url),
49
+ vimeo: (url) => MATCH_URL_VIMEO.test(url) && !VIDEO_EXTENSIONS.test(url) && !HLS_EXTENSIONS.test(url),
50
+ wistia: (url) => MATCH_URL_WISTIA.test(url),
51
+ spotify: (url) => MATCH_URL_SPOTIFY.test(url),
52
+ twitch: (url) => MATCH_URL_TWITCH.test(url),
53
+ tiktok: (url) => MATCH_URL_TIKTOK.test(url)
54
+ };
55
+
56
+ const HtmlPlayer = React.forwardRef((props, ref) => {
57
+ const Media = AUDIO_EXTENSIONS.test(`${props.src}`) ? "audio" : "video";
58
+ return /* @__PURE__ */ React.createElement(Media, { ...props, ref }, props.children);
59
+ });
60
+ var HtmlPlayer_default = HtmlPlayer;
61
+
62
+ const Players = [
63
+ {
64
+ key: "hls",
65
+ name: "hls.js",
66
+ canPlay: canPlay.hls,
67
+ canEnablePIP: () => true,
68
+ player: React.lazy(
69
+ () => Promise.resolve().then(function () { return require(
70
+ /* webpackChunkName: 'reactPlayerHls' */
71
+ './react-caXJFZ8W.cjs'
72
+ ); })
73
+ )
74
+ },
75
+ {
76
+ key: "dash",
77
+ name: "dash.js",
78
+ canPlay: canPlay.dash,
79
+ canEnablePIP: () => true,
80
+ player: React.lazy(
81
+ () => Promise.resolve().then(function () { return require(
82
+ /* webpackChunkName: 'reactPlayerDash' */
83
+ './react-JTfV8OSA.cjs'
84
+ ); })
85
+ )
86
+ },
87
+ {
88
+ key: "mux",
89
+ name: "Mux",
90
+ canPlay: canPlay.mux,
91
+ canEnablePIP: () => true,
92
+ player: React.lazy(
93
+ () => Promise.resolve().then(function () { return require(
94
+ /* webpackChunkName: 'reactPlayerMux' */
95
+ './index-oGP6D6gL.cjs'
96
+ ); })
97
+ )
98
+ },
99
+ {
100
+ key: "youtube",
101
+ name: "YouTube",
102
+ canPlay: canPlay.youtube,
103
+ player: React.lazy(
104
+ () => Promise.resolve().then(function () { return require(
105
+ /* webpackChunkName: 'reactPlayerYouTube' */
106
+ './react-CEvhi3LL.cjs'
107
+ ); })
108
+ )
109
+ },
110
+ {
111
+ key: "vimeo",
112
+ name: "Vimeo",
113
+ canPlay: canPlay.vimeo,
114
+ player: React.lazy(
115
+ () => Promise.resolve().then(function () { return require(
116
+ /* webpackChunkName: 'reactPlayerVimeo' */
117
+ './react-DxToimBj.cjs'
118
+ ); })
119
+ )
120
+ },
121
+ {
122
+ key: "wistia",
123
+ name: "Wistia",
124
+ canPlay: canPlay.wistia,
125
+ canEnablePIP: () => true,
126
+ player: React.lazy(
127
+ () => Promise.resolve().then(function () { return require(
128
+ /* webpackChunkName: 'reactPlayerWistia' */
129
+ './react-fep2ei7j.cjs'
130
+ ); })
131
+ )
132
+ },
133
+ {
134
+ key: "spotify",
135
+ name: "Spotify",
136
+ canPlay: canPlay.spotify,
137
+ canEnablePIP: () => false,
138
+ player: React.lazy(
139
+ () => Promise.resolve().then(function () { return require(
140
+ /* webpackChunkName: 'reactPlayerSpotify' */
141
+ './react-DE6M3seI.cjs'
142
+ ); })
143
+ )
144
+ },
145
+ {
146
+ key: "twitch",
147
+ name: "Twitch",
148
+ canPlay: canPlay.twitch,
149
+ canEnablePIP: () => false,
150
+ player: React.lazy(
151
+ () => Promise.resolve().then(function () { return require(
152
+ /* webpackChunkName: 'reactPlayerTwitch' */
153
+ './react-Dri2yjKm.cjs'
154
+ ); })
155
+ )
156
+ },
157
+ {
158
+ key: "tiktok",
159
+ name: "TikTok",
160
+ canPlay: canPlay.tiktok,
161
+ canEnablePIP: () => false,
162
+ player: React.lazy(
163
+ () => Promise.resolve().then(function () { return require(
164
+ /* webpackChunkName: 'reactPlayerTiktok' */
165
+ './react-CqsEClV0.cjs'
166
+ ); })
167
+ )
168
+ },
169
+ {
170
+ key: "html",
171
+ name: "html",
172
+ canPlay: canPlay.html,
173
+ canEnablePIP: () => true,
174
+ player: HtmlPlayer_default
175
+ }
176
+ ];
177
+ var players_default = Players;
178
+
179
+ const defaultProps = {
180
+ // Falsy values don't need to be defined
181
+ //
182
+ // native video attrs
183
+ // src: undefined,
184
+ // preload: undefined,
185
+ // crossOrigin: undefined,
186
+ // autoPlay: false,
187
+ // muted: false,
188
+ // loop: false,
189
+ // controls: false,
190
+ // playsInline: false,
191
+ // disableRemotePlayback: false,
192
+ width: "320px",
193
+ height: "180px",
194
+ // native video props
195
+ volume: 1,
196
+ playbackRate: 1,
197
+ // custom props
198
+ // playing: undefined,
199
+ // pip: false,
200
+ // light: false,
201
+ // fallback: null,
202
+ previewTabIndex: 0,
203
+ previewAriaLabel: "",
204
+ oEmbedUrl: "https://noembed.com/embed?url={url}"
205
+ };
206
+
207
+ const Player = React.forwardRef((props, ref) => {
208
+ const { playing, pip } = props;
209
+ const Player2 = props.activePlayer;
210
+ const playerRef = React.useRef(null);
211
+ const startOnPlayRef = React.useRef(true);
212
+ React.useEffect(() => {
213
+ var _a, _b;
214
+ if (!playerRef.current) return;
215
+ if (playerRef.current.paused && playing === true) {
216
+ playerRef.current.play();
217
+ }
218
+ if (!playerRef.current.paused && playing === false) {
219
+ playerRef.current.pause();
220
+ }
221
+ playerRef.current.playbackRate = (_a = props.playbackRate) != null ? _a : 1;
222
+ playerRef.current.volume = (_b = props.volume) != null ? _b : 1;
223
+ });
224
+ React.useEffect(() => {
225
+ var _a, _b, _c, _d, _e;
226
+ if (!playerRef.current || !globalThis.document) return;
227
+ if (pip && !document.pictureInPictureElement) {
228
+ try {
229
+ (_b = (_a = playerRef.current).requestPictureInPicture) == null ? void 0 : _b.call(_a);
230
+ } catch (err) {
231
+ }
232
+ }
233
+ if (!pip && document.pictureInPictureElement) {
234
+ try {
235
+ (_d = (_c = playerRef.current).exitPictureInPicture) == null ? void 0 : _d.call(_c);
236
+ (_e = document.exitPictureInPicture) == null ? void 0 : _e.call(document);
237
+ } catch (err) {
238
+ }
239
+ }
240
+ }, [pip]);
241
+ const handleLoadStart = (event) => {
242
+ var _a, _b;
243
+ startOnPlayRef.current = true;
244
+ (_a = props.onReady) == null ? void 0 : _a.call(props);
245
+ (_b = props.onLoadStart) == null ? void 0 : _b.call(props, event);
246
+ };
247
+ const handlePlay = (event) => {
248
+ var _a, _b;
249
+ if (startOnPlayRef.current) {
250
+ startOnPlayRef.current = false;
251
+ (_a = props.onStart) == null ? void 0 : _a.call(props, event);
252
+ }
253
+ (_b = props.onPlay) == null ? void 0 : _b.call(props, event);
254
+ };
255
+ if (!Player2) {
256
+ return null;
257
+ }
258
+ const eventProps = {};
259
+ const reactPlayerEventHandlers = ["onReady", "onStart"];
260
+ for (const key in props) {
261
+ if (key.startsWith("on") && !reactPlayerEventHandlers.includes(key)) {
262
+ eventProps[key] = props[key];
263
+ }
264
+ }
265
+ return /* @__PURE__ */ React.createElement(
266
+ Player2,
267
+ {
268
+ ...eventProps,
269
+ style: props.style,
270
+ className: props.className,
271
+ slot: props.slot,
272
+ ref: React.useCallback(
273
+ (node) => {
274
+ playerRef.current = node;
275
+ if (typeof ref === "function") {
276
+ ref(node);
277
+ } else if (ref !== null) {
278
+ ref.current = node;
279
+ }
280
+ },
281
+ [ref]
282
+ ),
283
+ src: props.src,
284
+ crossOrigin: props.crossOrigin,
285
+ preload: props.preload,
286
+ controls: props.controls,
287
+ muted: props.muted,
288
+ autoPlay: props.autoPlay,
289
+ loop: props.loop,
290
+ playsInline: props.playsInline,
291
+ disableRemotePlayback: props.disableRemotePlayback,
292
+ config: props.config,
293
+ onLoadStart: handleLoadStart,
294
+ onPlay: handlePlay
295
+ },
296
+ props.children
297
+ );
298
+ });
299
+ Player.displayName = "Player";
300
+ var Player_default = Player;
301
+
302
+ const Preview = React.lazy(() => Promise.resolve().then(function () { return require(
303
+ /* webpackChunkName: 'reactPlayerPreview' */
304
+ './Preview-Dx1kCzJ1.cjs'
305
+ ); }));
306
+ const customPlayers = [];
307
+ const createReactPlayer = (players, playerFallback) => {
308
+ const getActivePlayer = (src) => {
309
+ for (const player of [...customPlayers, ...players]) {
310
+ if (src && player.canPlay(src)) {
311
+ return player;
312
+ }
313
+ }
314
+ if (playerFallback) {
315
+ return playerFallback;
316
+ }
317
+ return null;
318
+ };
319
+ const ReactPlayer = React.forwardRef((_props, ref) => {
320
+ const props = { ...defaultProps, ..._props };
321
+ const { src, slot, className, style, width, height, fallback, wrapper } = props;
322
+ const [showPreview, setShowPreview] = React.useState(!!props.light);
323
+ React.useEffect(() => {
324
+ if (props.light) {
325
+ setShowPreview(true);
326
+ } else {
327
+ setShowPreview(false);
328
+ }
329
+ }, [props.light]);
330
+ const handleClickPreview = (e) => {
331
+ var _a;
332
+ setShowPreview(false);
333
+ (_a = props.onClickPreview) == null ? void 0 : _a.call(props, e);
334
+ };
335
+ const renderPreview = (src2) => {
336
+ if (!src2) return null;
337
+ const { light, playIcon, previewTabIndex, oEmbedUrl, previewAriaLabel } = props;
338
+ return /* @__PURE__ */ React.createElement(
339
+ Preview,
340
+ {
341
+ src: src2,
342
+ light,
343
+ playIcon,
344
+ previewTabIndex,
345
+ previewAriaLabel,
346
+ oEmbedUrl,
347
+ onClickPreview: handleClickPreview
348
+ }
349
+ );
350
+ };
351
+ const renderActivePlayer = (src2) => {
352
+ var _a, _b;
353
+ const player = getActivePlayer(src2);
354
+ if (!player) return null;
355
+ const { style: style2, width: width2, height: height2, wrapper: wrapper2 } = props;
356
+ const config = (_a = props.config) == null ? void 0 : _a[player.key];
357
+ return /* @__PURE__ */ React.createElement(
358
+ Player_default,
359
+ {
360
+ ...props,
361
+ ref,
362
+ activePlayer: (_b = player.player) != null ? _b : player,
363
+ slot: wrapper2 ? void 0 : slot,
364
+ className: wrapper2 ? void 0 : className,
365
+ style: wrapper2 ? { display: "block", width: "100%", height: "100%" } : { display: "block", width: width2, height: height2, ...style2 },
366
+ config
367
+ }
368
+ );
369
+ };
370
+ const Wrapper = wrapper == null ? ForwardChildren : wrapper;
371
+ const UniversalSuspense = fallback === false ? ForwardChildren : React.Suspense;
372
+ return /* @__PURE__ */ React.createElement(Wrapper, { slot, className, style: { width, height, ...style } }, /* @__PURE__ */ React.createElement(UniversalSuspense, { fallback }, showPreview ? renderPreview(src) : renderActivePlayer(src)));
373
+ });
374
+ ReactPlayer.displayName = "ReactPlayer";
375
+ ReactPlayer.addCustomPlayer = (player) => {
376
+ customPlayers.push(player);
377
+ };
378
+ ReactPlayer.removeCustomPlayers = () => {
379
+ customPlayers.length = 0;
380
+ };
381
+ ReactPlayer.canPlay = (src) => {
382
+ if (src) {
383
+ for (const Player2 of [...customPlayers, ...players]) {
384
+ if (Player2.canPlay(src)) {
385
+ return true;
386
+ }
387
+ }
388
+ }
389
+ return false;
390
+ };
391
+ ReactPlayer.canEnablePIP = (src) => {
392
+ var _a;
393
+ if (src) {
394
+ for (const Player2 of [...customPlayers, ...players]) {
395
+ if (Player2.canPlay(src) && ((_a = Player2.canEnablePIP) == null ? void 0 : _a.call(Player2))) {
396
+ return true;
397
+ }
398
+ }
399
+ }
400
+ return false;
401
+ };
402
+ return ReactPlayer;
403
+ };
404
+ const ForwardChildren = ({ children }) => children;
405
+
406
+ const fallback = players_default[players_default.length - 1];
407
+ var src_default = createReactPlayer(players_default, fallback);
408
+
409
+ var styles$2 = {"playIconContainer":"VideoCardPlayIcon-module_playIconContainer__ZqZP3","playIconContainer--s":"VideoCardPlayIcon-module_playIconContainer--s__ETbOZ","playIconContainer--l":"VideoCardPlayIcon-module_playIconContainer--l__OGccg","playIcon":"VideoCardPlayIcon-module_playIcon__kzito"};
410
+
411
+ var VideoCardPlayIcon = function (_a) {
412
+ var _b = _a.size, size = _b === void 0 ? "l" : _b;
413
+ return (React.createElement("div", { className: index.classNames(styles$2.playIconContainer, styles$2["playIconContainer--".concat(size)]) },
414
+ React.createElement("div", { className: styles$2.playIcon },
415
+ React.createElement(Icon.Icon, { icon: ArcIconPlay }))));
416
+ };
417
+
418
+ var styles$1 = {"container":"VideoCardPlayer-module_container__G-Uta","player":"VideoCardPlayer-module_player__BgueT","playerWrapper":"VideoCardPlayer-module_playerWrapper__UcH1q","playerWrapper--landscape":"VideoCardPlayer-module_playerWrapper--landscape__shKv-","playerWrapper--portrait":"VideoCardPlayer-module_playerWrapper--portrait__7bKAr"};
419
+
420
+ var VideoCardPlayer = function (_a) {
421
+ var thumbnail = _a.thumbnail, playIconSize = _a.playIconSize, orientation = _a.orientation, children = _a.children, player = _a.player, props = tslib_es6.__rest(_a, ["thumbnail", "playIconSize", "orientation", "children", "player"]);
422
+ var _b = React.useState(false), isClient = _b[0], setIsClient = _b[1];
423
+ React.useEffect(function () {
424
+ setIsClient(true);
425
+ }, []);
426
+ var playerProps = tslib_es6.__assign(tslib_es6.__assign({}, player), { light: thumbnail, playIcon: React.createElement(VideoCardPlayIcon, { size: playIconSize }), muted: !thumbnail, playing: true, controls: true, className: styles$1.player, width: "100%", height: "100%" });
427
+ return (React.createElement("div", tslib_es6.__assign({ className: styles$1.container }, filterAttrs.filterAttrs(props)),
428
+ React.createElement("div", { "data-testid": "arc-video-card", className: index.classNames(styles$1.playerWrapper, styles$1["playerWrapper--".concat(orientation)]) }, isClient && React.createElement(src_default, tslib_es6.__assign({}, playerProps))),
429
+ children));
430
+ };
431
+
432
+ var styles = {"thumbnail":"VideoCardThumbnail-module_thumbnail__Yamk0","thumbnail--landscape":"VideoCardThumbnail-module_thumbnail--landscape__FmnLk","thumbnail--portrait":"VideoCardThumbnail-module_thumbnail--portrait__FZS93","thumbnailContent":"VideoCardThumbnail-module_thumbnailContent__cHham"};
433
+
434
+ var VideoCardThumbnail = function (_a) {
435
+ var orientation = _a.orientation, contentVisibility = _a.contentVisibility, src = _a.src, children = _a.children;
436
+ var content = React.createElement("div", { className: styles.thumbnailContent }, children);
437
+ return (React.createElement("div", { className: index.classNames(styles.thumbnail, styles["thumbnail--".concat(orientation)]), style: { backgroundImage: "url(".concat(src, ")") } }, contentVisibility ? (React.createElement(Visible.Visible, tslib_es6.__assign({}, contentVisibility), content)) : (content)));
438
+ };
439
+
440
+ exports.VideoCardPlayer = VideoCardPlayer;
441
+ exports.VideoCardThumbnail = VideoCardThumbnail;