@arc-ui/community-components 3.2.0 → 3.4.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 (158) hide show
  1. package/.turbo/turbo-build.log +133 -13
  2. package/CHANGELOG.md +31 -0
  3. package/lib/Accordion/Accordion.cjs +2 -3
  4. package/lib/Accordion/Accordion.mjs +2 -3
  5. package/lib/ActionTile/ActionTile.cjs +4 -5
  6. package/lib/ActionTile/ActionTile.mjs +10 -11
  7. package/lib/ActionTile/styles.css +1 -1
  8. package/lib/ArticleSidebar/ArticleSidebar.cjs +9 -10
  9. package/lib/ArticleSidebar/ArticleSidebar.mjs +46 -47
  10. package/lib/Author/Author.cjs +2 -3
  11. package/lib/Author/Author.mjs +2 -3
  12. package/lib/BannerWithTabs/BannerWithTabs.cjs +4 -5
  13. package/lib/BannerWithTabs/BannerWithTabs.mjs +8 -9
  14. package/lib/ContentInfoWidget/ContentInfoWidget.cjs +3 -2
  15. package/lib/ContentInfoWidget/ContentInfoWidget.mjs +8 -7
  16. package/lib/CopyLead/CopyLead.cjs +32 -23
  17. package/lib/CopyLead/CopyLead.mjs +60 -51
  18. package/lib/DownloadList/DownloadList.cjs +6 -8
  19. package/lib/DownloadList/DownloadList.mjs +11 -13
  20. package/lib/FAQs/FAQs.cjs +5 -6
  21. package/lib/FAQs/FAQs.mjs +22 -23
  22. package/lib/FeaturePost/FeaturePost.cjs +14 -15
  23. package/lib/FeaturePost/FeaturePost.mjs +54 -55
  24. package/lib/Highlights/Highlights.cjs +11 -12
  25. package/lib/Highlights/Highlights.mjs +24 -25
  26. package/lib/InlineLinkGroup/InlineLinkGroup.cjs +25 -0
  27. package/lib/InlineLinkGroup/InlineLinkGroup.mjs +23 -0
  28. package/lib/InlineLinkGroup/styles.css +1 -0
  29. package/lib/LinkTile/LinkTile.cjs +6 -6
  30. package/lib/LinkTile/LinkTile.mjs +7 -7
  31. package/lib/LinkTile/styles.css +1 -1
  32. package/lib/ProductNavigation/ProductNavigation.cjs +6 -7
  33. package/lib/ProductNavigation/ProductNavigation.mjs +18 -19
  34. package/lib/PromoListing/PromoListing.cjs +7 -8
  35. package/lib/PromoListing/PromoListing.mjs +17 -18
  36. package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.cjs +7 -8
  37. package/lib/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.mjs +9 -10
  38. package/lib/Quote/Quote.cjs +5 -6
  39. package/lib/Quote/Quote.mjs +9 -10
  40. package/lib/SectionHeading/SectionHeading.cjs +2 -3
  41. package/lib/SectionHeading/SectionHeading.mjs +2 -3
  42. package/lib/Statistics/Statistics.cjs +21 -19
  43. package/lib/Statistics/Statistics.mjs +35 -33
  44. package/lib/Statistics/styles.css +1 -1
  45. package/lib/Summary/Summary.cjs +4 -4
  46. package/lib/Summary/Summary.mjs +13 -13
  47. package/lib/ThumbnailSignpost/ThumbnailSignpost.cjs +2 -3
  48. package/lib/ThumbnailSignpost/ThumbnailSignpost.mjs +2 -3
  49. package/lib/VideoHeroCard/VideoHeroCard.cjs +76 -0
  50. package/lib/VideoHeroCard/VideoHeroCard.mjs +74 -0
  51. package/lib/VideoPortraitCard/VideoPortraitCard.cjs +22 -0
  52. package/lib/VideoPortraitCard/VideoPortraitCard.mjs +20 -0
  53. package/lib/_shared/cjs/{Accordion-DfNGOjTm.cjs → Accordion-QqDoB3pY.cjs} +8 -9
  54. package/lib/_shared/cjs/{Author-D4dKNQem.cjs → Author-aL8YXi7C.cjs} +4 -5
  55. package/lib/_shared/cjs/Preview-Dx1kCzJ1.cjs +102 -0
  56. package/lib/_shared/cjs/{SectionHeading-DeSFM0HV.cjs → SectionHeading-Dj-dJfv3.cjs} +4 -5
  57. package/lib/_shared/cjs/{ThumbnailSignpost-GkOiwt-Z.cjs → ThumbnailSignpost-SBnrGooA.cjs} +4 -5
  58. package/lib/_shared/cjs/VideoCardThumbnail-BqYgpk0u.cjs +440 -0
  59. package/lib/_shared/cjs/dash.all.min-BPXzla24.cjs +6 -0
  60. package/lib/_shared/cjs/{tslib.es6-BxB9I209.cjs → filter-attrs-C26zOt4_.cjs} +25 -0
  61. package/lib/_shared/cjs/hls-Ckhp5fVA.cjs +36628 -0
  62. package/lib/_shared/cjs/index-DjiIVIaV.cjs +96 -0
  63. package/lib/_shared/cjs/index-oGP6D6gL.cjs +14826 -0
  64. package/lib/_shared/cjs/{index.es-Dq8bYrbW.cjs → index.es-B0J3cvrY.cjs} +1 -1
  65. package/lib/_shared/cjs/mixin-BFwaXKGB.cjs +1027 -0
  66. package/lib/_shared/cjs/react-CEvhi3LL.cjs +737 -0
  67. package/lib/_shared/cjs/react-CqsEClV0.cjs +466 -0
  68. package/lib/_shared/cjs/react-DE6M3seI.cjs +496 -0
  69. package/lib/_shared/cjs/react-Dri2yjKm.cjs +554 -0
  70. package/lib/_shared/cjs/react-DxToimBj.cjs +4239 -0
  71. package/lib/_shared/cjs/react-JTfV8OSA.cjs +325 -0
  72. package/lib/_shared/cjs/react-caXJFZ8W.cjs +400 -0
  73. package/lib/_shared/cjs/react-fep2ei7j.cjs +727 -0
  74. package/lib/_shared/esm/{Accordion-cd1oYvBv.mjs → Accordion-DtU7jbCv.mjs} +16 -17
  75. package/lib/_shared/esm/Author-CJQFrQM9.mjs +27 -0
  76. package/lib/_shared/esm/Preview-CmbKOgEO.mjs +100 -0
  77. package/lib/_shared/esm/{SectionHeading-CpDLCndw.mjs → SectionHeading-BskdQ2Tt.mjs} +10 -11
  78. package/lib/_shared/esm/{ThumbnailSignpost-BeRiXbUp.mjs → ThumbnailSignpost-CBSdQiHw.mjs} +13 -14
  79. package/lib/_shared/esm/VideoCardThumbnail-VfOKmPCv.mjs +437 -0
  80. package/lib/_shared/esm/dash.all.min-CbWI_8dN.mjs +4 -0
  81. package/lib/_shared/esm/{tslib.es6-D6Wu-xwB.mjs → filter-attrs-D-1kWaCP.mjs} +25 -1
  82. package/lib/_shared/esm/hls-AFbJDS9D.mjs +36625 -0
  83. package/lib/_shared/esm/index-CrcIrdjn.mjs +14799 -0
  84. package/lib/_shared/esm/index-DYnuIO1L.mjs +94 -0
  85. package/lib/_shared/esm/{index.es-Bfdys5__.mjs → index.es-DraZ-qKh.mjs} +1 -1
  86. package/lib/_shared/esm/mixin-BGGG8VrM.mjs +1024 -0
  87. package/lib/_shared/esm/react-BGimq-TB.mjs +4237 -0
  88. package/lib/_shared/esm/react-BHT4t_eQ.mjs +494 -0
  89. package/lib/_shared/esm/react-BSd0sGcO.mjs +464 -0
  90. package/lib/_shared/esm/react-CSr43fZV.mjs +552 -0
  91. package/lib/_shared/esm/react-Ca6E7Fr-.mjs +398 -0
  92. package/lib/_shared/esm/react-DG070IvZ.mjs +725 -0
  93. package/lib/_shared/esm/react-DZyqy7W7.mjs +735 -0
  94. package/lib/_shared/esm/react-WW_9iHcl.mjs +323 -0
  95. package/lib/index.cjs +299 -181
  96. package/lib/index.cjs.map +1 -1
  97. package/lib/index.d.cts +77 -63
  98. package/lib/index.d.mts +77 -63
  99. package/lib/index.mjs +297 -181
  100. package/lib/index.mjs.map +1 -1
  101. package/lib/styles.css +1 -1
  102. package/package.json +15 -12
  103. package/rollup.config.js +1 -1
  104. package/src/components/ActionTile/ActionTile.module.css +56 -37
  105. package/src/components/ActionTile/ActionTile.tsx +1 -1
  106. package/src/components/ArticleSidebar/ArticleSidebar.tsx +4 -6
  107. package/src/components/Author/Author.tsx +0 -3
  108. package/src/components/BannerWithTabs/BannerWithTabs.tsx +4 -6
  109. package/src/components/ContentInfoWidget/ContentInfoWidget.tsx +3 -4
  110. package/src/components/CopyLead/components/MediaContent/MediaContent.tsx +7 -6
  111. package/src/components/CopyLead/templates/Content/Content.tsx +5 -3
  112. package/src/components/CopyLead/templates/Media/Media.tsx +5 -6
  113. package/src/components/DownloadList/DownloadList.tsx +8 -8
  114. package/src/components/FeaturePost/FeaturePost.tsx +3 -7
  115. package/src/components/Highlights/Highlights.tsx +3 -2
  116. package/src/components/Highlights/components/HighlightItem/HighlightItem.tsx +3 -2
  117. package/src/components/Highlights/components/HighlightList/HighlightList.tsx +5 -2
  118. package/src/components/InlineLinkGroup/InlineLinkGroup.module.css +81 -0
  119. package/src/components/InlineLinkGroup/InlineLinkGroup.tsx +67 -0
  120. package/src/components/InlineLinkGroup/index.ts +5 -0
  121. package/src/components/LinkTile/LinkTile.module.css +62 -26
  122. package/src/components/LinkTile/LinkTile.tsx +8 -1
  123. package/src/components/PromoListing/PromoListing.tsx +3 -11
  124. package/src/components/PromoListingThumbnailSignpost/PromoListingThumbnailSignpost.tsx +2 -0
  125. package/src/components/Quote/Quote.tsx +1 -7
  126. package/src/components/Statistics/Statistics.module.css +0 -10
  127. package/src/components/Statistics/Statistics.tsx +35 -32
  128. package/src/components/Summary/Summary.tsx +3 -1
  129. package/src/components/VideoHeroCard/VideoHeroCard.tsx +63 -0
  130. package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.module.css +32 -0
  131. package/src/components/VideoHeroCard/components/VideoHeroCardContent/VideoHeroCardContent.tsx +97 -0
  132. package/src/components/VideoHeroCard/components/VideoHeroCardContent/index.ts +4 -0
  133. package/src/components/VideoHeroCard/index.ts +1 -0
  134. package/src/components/VideoPortraitCard/VideoPortraitCard.tsx +54 -0
  135. package/src/components/VideoPortraitCard/index.ts +4 -0
  136. package/src/components/index.ts +3 -1
  137. package/src/internal/MultiLineText/MultiLineText.tsx +25 -0
  138. package/src/internal/MultiLineText/index.ts +1 -0
  139. package/src/internal/VideoCardPlayer/VideoCardPlayer.module.css +54 -0
  140. package/src/internal/VideoCardPlayer/VideoCardPlayer.tsx +62 -0
  141. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.module.css +41 -0
  142. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/VideoCardPlayIcon.tsx +28 -0
  143. package/src/internal/VideoCardPlayer/components/VideoCardPlayIcon/index.ts +1 -0
  144. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.module.css +58 -0
  145. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/VideoCardThumbnail.tsx +38 -0
  146. package/src/internal/VideoCardPlayer/components/VideoCardThumbnail/index.ts +1 -0
  147. package/src/internal/VideoCardPlayer/index.ts +2 -0
  148. package/src/internal/VideoCardPlayer/types/player-props.ts +6 -0
  149. package/versions.json +1 -1
  150. package/lib/HeroLink/HeroLink.cjs +0 -35
  151. package/lib/HeroLink/HeroLink.mjs +0 -33
  152. package/lib/HeroLink/styles.css +0 -1
  153. package/lib/_shared/cjs/filter-attrs-BizjMsy0.cjs +0 -27
  154. package/lib/_shared/esm/Author-HnYsFTPT.mjs +0 -28
  155. package/lib/_shared/esm/filter-attrs-DZ7RCEZm.mjs +0 -25
  156. package/src/components/HeroLink/HeroLink.module.css +0 -44
  157. package/src/components/HeroLink/HeroLink.tsx +0 -136
  158. package/src/components/HeroLink/index.ts +0 -2
@@ -0,0 +1,494 @@
1
+ import React__default from 'react';
2
+
3
+ const EMBED_BASE = "https://open.spotify.com";
4
+ const MATCH_SRC = /open\.spotify\.com\/(\w+)\/(\w+)/i;
5
+ const API_URL = "https://open.spotify.com/embed-podcast/iframe-api/v1";
6
+ const API_GLOBAL = "SpotifyIframeApi";
7
+ const API_GLOBAL_READY = "onSpotifyIframeApiReady";
8
+ function getTemplateHTML(attrs, props = {}) {
9
+ const iframeAttrs = {
10
+ src: serializeIframeUrl(attrs, props),
11
+ scrolling: "no",
12
+ frameborder: 0,
13
+ width: "100%",
14
+ height: "100%",
15
+ allow: "accelerometer; fullscreen; autoplay; encrypted-media; gyroscope; picture-in-picture"
16
+ };
17
+ return (
18
+ /*html*/
19
+ `
20
+ <style>
21
+ :host {
22
+ display: inline-block;
23
+ min-width: 160px;
24
+ min-height: 80px;
25
+ position: relative;
26
+ }
27
+ iframe {
28
+ position: absolute;
29
+ top: 0;
30
+ left: 0;
31
+ width: 100%;
32
+ height: 100%;
33
+ overflow: hidden;
34
+ }
35
+ :host(:not([controls])) {
36
+ display: none !important;
37
+ }
38
+ </style>
39
+ <iframe${serializeAttributes(iframeAttrs)}></iframe>
40
+ `
41
+ );
42
+ }
43
+ function serializeIframeUrl(attrs, props) {
44
+ var _a, _b, _c;
45
+ if (!attrs.src) return;
46
+ const matches = attrs.src.match(MATCH_SRC);
47
+ const type = matches && matches[1];
48
+ const metaId = matches && matches[2];
49
+ const params = {
50
+ t: (_a = props.config) == null ? void 0 : _a.startAt,
51
+ theme: ((_b = props.config) == null ? void 0 : _b.theme) === "dark" ? "0" : null
52
+ };
53
+ const videoPath = ((_c = props.config) == null ? void 0 : _c.preferVideo) ? "/video" : "";
54
+ return `${EMBED_BASE}/embed/${type}/${metaId}${videoPath}?${serialize(params)}`;
55
+ }
56
+ class SpotifyAudioElement extends (globalThis.HTMLElement ?? class {
57
+ }) {
58
+ static getTemplateHTML = getTemplateHTML;
59
+ static shadowRootOptions = { mode: "open" };
60
+ static observedAttributes = [
61
+ "controls",
62
+ "loop",
63
+ "src"
64
+ ];
65
+ loadComplete = new PublicPromise();
66
+ #loadRequested;
67
+ #hasLoaded;
68
+ #isInit;
69
+ #isWaiting = false;
70
+ #closeToEnded = false;
71
+ #paused = true;
72
+ #currentTime = 0;
73
+ #duration = NaN;
74
+ #seeking = false;
75
+ #config = null;
76
+ constructor() {
77
+ super();
78
+ this.#upgradeProperty("config");
79
+ }
80
+ async load() {
81
+ var _a, _b, _c;
82
+ if (this.#loadRequested) return;
83
+ if (this.#hasLoaded) this.loadComplete = new PublicPromise();
84
+ this.#hasLoaded = true;
85
+ await (this.#loadRequested = Promise.resolve());
86
+ this.#loadRequested = null;
87
+ this.#isWaiting = false;
88
+ this.#closeToEnded = false;
89
+ this.#currentTime = 0;
90
+ this.#duration = NaN;
91
+ this.#seeking = false;
92
+ this.dispatchEvent(new Event("emptied"));
93
+ let oldApi = this.api;
94
+ this.api = null;
95
+ if (!this.src) {
96
+ return;
97
+ }
98
+ this.dispatchEvent(new Event("loadstart"));
99
+ const options = {
100
+ t: (_a = this.config) == null ? void 0 : _a.startAt,
101
+ theme: ((_b = this.config) == null ? void 0 : _b.theme) === "dark" ? "0" : null,
102
+ preferVideo: (_c = this.config) == null ? void 0 : _c.preferVideo
103
+ };
104
+ if (this.#isInit) {
105
+ this.api = oldApi;
106
+ this.api.iframeElement.src = serializeIframeUrl(namedNodeMapToObject(this.attributes), this);
107
+ } else {
108
+ this.#isInit = true;
109
+ if (!this.shadowRoot) {
110
+ this.attachShadow({ mode: "open" });
111
+ this.shadowRoot.innerHTML = getTemplateHTML(namedNodeMapToObject(this.attributes), this);
112
+ }
113
+ let iframe = this.shadowRoot.querySelector("iframe");
114
+ const Spotify = await loadScript(API_URL, API_GLOBAL, API_GLOBAL_READY);
115
+ this.api = await new Promise((resolve) => Spotify.createController(iframe, options, resolve));
116
+ this.api.iframeElement = iframe;
117
+ this.api.addListener("ready", () => {
118
+ this.dispatchEvent(new Event("loadedmetadata"));
119
+ this.dispatchEvent(new Event("durationchange"));
120
+ this.dispatchEvent(new Event("volumechange"));
121
+ });
122
+ this.api.addListener("playback_update", (event) => {
123
+ if (this.#closeToEnded && this.#paused && (event.data.isBuffering || !event.data.isPaused)) {
124
+ this.#closeToEnded = false;
125
+ this.currentTime = 1;
126
+ return;
127
+ }
128
+ if (event.data.duration / 1e3 !== this.#duration) {
129
+ this.#closeToEnded = false;
130
+ this.#duration = event.data.duration / 1e3;
131
+ this.dispatchEvent(new Event("durationchange"));
132
+ }
133
+ if (event.data.position / 1e3 !== this.#currentTime) {
134
+ this.#seeking = false;
135
+ this.#closeToEnded = false;
136
+ this.#currentTime = event.data.position / 1e3;
137
+ this.dispatchEvent(new Event("timeupdate"));
138
+ }
139
+ if (!this.#isWaiting && !this.#paused && event.data.isPaused) {
140
+ this.#paused = true;
141
+ this.dispatchEvent(new Event("pause"));
142
+ return;
143
+ }
144
+ if (this.#paused && (event.data.isBuffering || !event.data.isPaused)) {
145
+ this.#paused = false;
146
+ this.dispatchEvent(new Event("play"));
147
+ this.#isWaiting = event.data.isBuffering;
148
+ if (this.#isWaiting) {
149
+ this.dispatchEvent(new Event("waiting"));
150
+ } else {
151
+ this.dispatchEvent(new Event("playing"));
152
+ }
153
+ return;
154
+ }
155
+ if (this.#isWaiting && !event.data.isPaused) {
156
+ this.#isWaiting = false;
157
+ this.dispatchEvent(new Event("playing"));
158
+ return;
159
+ }
160
+ if (!this.paused && !this.seeking && !this.#closeToEnded && Math.ceil(this.currentTime) >= this.duration) {
161
+ this.#closeToEnded = true;
162
+ if (this.loop) {
163
+ this.currentTime = 1;
164
+ return;
165
+ }
166
+ if (!this.continuous) {
167
+ this.pause();
168
+ this.dispatchEvent(new Event("ended"));
169
+ }
170
+ return;
171
+ }
172
+ });
173
+ }
174
+ this.loadComplete.resolve();
175
+ await this.loadComplete;
176
+ }
177
+ async attributeChangedCallback(attrName, oldValue, newValue) {
178
+ if (oldValue === newValue) return;
179
+ switch (attrName) {
180
+ case "src": {
181
+ this.load();
182
+ return;
183
+ }
184
+ }
185
+ }
186
+ async play() {
187
+ var _a;
188
+ this.#paused = false;
189
+ this.#isWaiting = true;
190
+ this.dispatchEvent(new Event("play"));
191
+ await this.loadComplete;
192
+ return (_a = this.api) == null ? void 0 : _a.resume();
193
+ }
194
+ async pause() {
195
+ var _a;
196
+ await this.loadComplete;
197
+ return (_a = this.api) == null ? void 0 : _a.pause();
198
+ }
199
+ get config() {
200
+ return this.#config;
201
+ }
202
+ set config(value) {
203
+ this.#config = value;
204
+ }
205
+ get paused() {
206
+ return this.#paused ?? true;
207
+ }
208
+ get muted() {
209
+ return false;
210
+ }
211
+ set muted(val) {
212
+ }
213
+ get volume() {
214
+ return 1;
215
+ }
216
+ set volume(val) {
217
+ }
218
+ get ended() {
219
+ return Math.ceil(this.currentTime) >= this.duration;
220
+ }
221
+ get seeking() {
222
+ return this.#seeking;
223
+ }
224
+ get loop() {
225
+ return this.hasAttribute("loop");
226
+ }
227
+ set loop(val) {
228
+ if (this.loop == val) return;
229
+ this.toggleAttribute("loop", Boolean(val));
230
+ }
231
+ get currentTime() {
232
+ return this.#currentTime;
233
+ }
234
+ set currentTime(val) {
235
+ if (this.currentTime == val) return;
236
+ this.#seeking = true;
237
+ let oldTime = this.#currentTime;
238
+ this.#currentTime = val;
239
+ this.dispatchEvent(new Event("timeupdate"));
240
+ this.#currentTime = oldTime;
241
+ this.loadComplete.then(() => {
242
+ var _a;
243
+ (_a = this.api) == null ? void 0 : _a.seek(val);
244
+ });
245
+ }
246
+ get duration() {
247
+ return this.#duration;
248
+ }
249
+ get src() {
250
+ return this.getAttribute("src");
251
+ }
252
+ set src(val) {
253
+ this.setAttribute("src", `${val}`);
254
+ }
255
+ // This is a pattern to update property values that are set before
256
+ // the custom element is upgraded.
257
+ // https://web.dev/custom-elements-best-practices/#make-properties-lazy
258
+ #upgradeProperty(prop) {
259
+ if (Object.prototype.hasOwnProperty.call(this, prop)) {
260
+ const value = this[prop];
261
+ delete this[prop];
262
+ this[prop] = value;
263
+ }
264
+ }
265
+ }
266
+ function serializeAttributes(attrs) {
267
+ let html = "";
268
+ for (const key in attrs) {
269
+ const value = attrs[key];
270
+ if (value === "") html += ` ${key}`;
271
+ else html += ` ${key}="${value}"`;
272
+ }
273
+ return html;
274
+ }
275
+ function serialize(props) {
276
+ return String(new URLSearchParams(boolToBinary(props)));
277
+ }
278
+ function boolToBinary(props) {
279
+ let p = {};
280
+ for (let key in props) {
281
+ let val = props[key];
282
+ if (val === true || val === "") p[key] = 1;
283
+ else if (val === false) p[key] = 0;
284
+ else if (val != null) p[key] = val;
285
+ }
286
+ return p;
287
+ }
288
+ function namedNodeMapToObject(namedNodeMap) {
289
+ let obj = {};
290
+ for (let attr of namedNodeMap) {
291
+ obj[attr.name] = attr.value;
292
+ }
293
+ return obj;
294
+ }
295
+ const loadScriptCache = {};
296
+ async function loadScript(src, globalName, readyFnName) {
297
+ if (loadScriptCache[src]) return loadScriptCache[src];
298
+ if (self[globalName]) {
299
+ return Promise.resolve(self[globalName]);
300
+ }
301
+ return loadScriptCache[src] = new Promise(function(resolve, reject) {
302
+ const script = document.createElement("script");
303
+ script.src = src;
304
+ const ready = (api) => resolve(api);
305
+ self[readyFnName] = ready;
306
+ script.onload = () => !readyFnName;
307
+ script.onerror = reject;
308
+ document.head.append(script);
309
+ });
310
+ }
311
+ class PublicPromise extends Promise {
312
+ constructor(executor = () => {
313
+ }) {
314
+ let res, rej;
315
+ super((resolve, reject) => {
316
+ executor(resolve, reject);
317
+ res = resolve;
318
+ rej = reject;
319
+ });
320
+ this.resolve = res;
321
+ this.reject = rej;
322
+ }
323
+ }
324
+ if (globalThis.customElements && !globalThis.customElements.get("spotify-audio")) {
325
+ globalThis.customElements.define("spotify-audio", SpotifyAudioElement);
326
+ }
327
+ var spotify_audio_element_default = SpotifyAudioElement;
328
+
329
+ // ../../node_modules/ce-la-react/dist/ce-la-react.js
330
+ var reservedReactProps = /* @__PURE__ */ new Set([
331
+ "style",
332
+ "children",
333
+ "ref",
334
+ "key",
335
+ "suppressContentEditableWarning",
336
+ "suppressHydrationWarning",
337
+ "dangerouslySetInnerHTML"
338
+ ]);
339
+ var reactPropToAttrNameMap = {
340
+ className: "class",
341
+ htmlFor: "for"
342
+ };
343
+ function defaultToAttributeName(propName) {
344
+ return propName.toLowerCase();
345
+ }
346
+ function defaultToAttributeValue(propValue) {
347
+ if (typeof propValue === "boolean") return propValue ? "" : void 0;
348
+ if (typeof propValue === "function") return void 0;
349
+ if (typeof propValue === "object" && propValue !== null) return void 0;
350
+ return propValue;
351
+ }
352
+ function createComponent({
353
+ react: React2,
354
+ tagName,
355
+ elementClass,
356
+ events,
357
+ displayName,
358
+ defaultProps,
359
+ toAttributeName = defaultToAttributeName,
360
+ toAttributeValue = defaultToAttributeValue
361
+ }) {
362
+ const IS_REACT_19_OR_NEWER = Number.parseInt(React2.version) >= 19;
363
+ const ReactComponent = React2.forwardRef((props, ref) => {
364
+ var _a, _b;
365
+ const elementRef = React2.useRef(null);
366
+ const prevElemPropsRef = React2.useRef(/* @__PURE__ */ new Map());
367
+ const eventProps = {};
368
+ const attrs = {};
369
+ const reactProps = {};
370
+ const elementProps = {};
371
+ for (const [k, v] of Object.entries(props)) {
372
+ if (reservedReactProps.has(k)) {
373
+ reactProps[k] = v;
374
+ continue;
375
+ }
376
+ const attrName = toAttributeName(reactPropToAttrNameMap[k] ?? k);
377
+ if (elementClass.prototype && k in elementClass.prototype && !(k in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) && !((_b = elementClass.observedAttributes) == null ? void 0 : _b.some((attr) => attr === attrName))) {
378
+ elementProps[k] = v;
379
+ continue;
380
+ }
381
+ if (k.startsWith("on")) {
382
+ eventProps[k] = v;
383
+ continue;
384
+ }
385
+ const attrValue = toAttributeValue(v);
386
+ if (attrName && attrValue != null) {
387
+ attrs[attrName] = String(attrValue);
388
+ if (!IS_REACT_19_OR_NEWER) {
389
+ reactProps[attrName] = attrValue;
390
+ }
391
+ }
392
+ if (attrName && IS_REACT_19_OR_NEWER) {
393
+ const attrValueFromDefault = defaultToAttributeValue(v);
394
+ if (attrValue !== attrValueFromDefault) {
395
+ reactProps[attrName] = attrValue;
396
+ } else {
397
+ reactProps[attrName] = v;
398
+ }
399
+ }
400
+ }
401
+ if (typeof window !== "undefined") {
402
+ for (const propName in eventProps) {
403
+ const callback = eventProps[propName];
404
+ const useCapture = propName.endsWith("Capture");
405
+ const eventName = ((events == null ? void 0 : events[propName]) ?? propName.slice(2).toLowerCase()).slice(
406
+ 0,
407
+ useCapture ? -7 : void 0
408
+ );
409
+ React2.useLayoutEffect(() => {
410
+ const eventTarget = elementRef == null ? void 0 : elementRef.current;
411
+ if (!eventTarget || typeof callback !== "function") return;
412
+ eventTarget.addEventListener(eventName, callback, useCapture);
413
+ return () => {
414
+ eventTarget.removeEventListener(eventName, callback, useCapture);
415
+ };
416
+ }, [elementRef == null ? void 0 : elementRef.current, callback]);
417
+ }
418
+ React2.useLayoutEffect(() => {
419
+ if (elementRef.current === null) return;
420
+ const newElemProps = /* @__PURE__ */ new Map();
421
+ for (const key in elementProps) {
422
+ setProperty(elementRef.current, key, elementProps[key]);
423
+ prevElemPropsRef.current.delete(key);
424
+ newElemProps.set(key, elementProps[key]);
425
+ }
426
+ for (const [key, _value] of prevElemPropsRef.current) {
427
+ setProperty(elementRef.current, key, void 0);
428
+ }
429
+ prevElemPropsRef.current = newElemProps;
430
+ });
431
+ }
432
+ if (typeof window === "undefined" && (elementClass == null ? void 0 : elementClass.getTemplateHTML) && (elementClass == null ? void 0 : elementClass.shadowRootOptions)) {
433
+ const { mode, delegatesFocus } = elementClass.shadowRootOptions;
434
+ const templateShadowRoot = React2.createElement("template", {
435
+ shadowrootmode: mode,
436
+ shadowrootdelegatesfocus: delegatesFocus,
437
+ dangerouslySetInnerHTML: {
438
+ __html: elementClass.getTemplateHTML(attrs, props)
439
+ },
440
+ key: "ce-la-react-ssr-template-shadow-root"
441
+ });
442
+ reactProps.children = [templateShadowRoot, reactProps.children];
443
+ }
444
+ return React2.createElement(tagName, {
445
+ ...defaultProps,
446
+ ...reactProps,
447
+ ref: React2.useCallback(
448
+ (node) => {
449
+ elementRef.current = node;
450
+ if (typeof ref === "function") {
451
+ ref(node);
452
+ } else if (ref !== null) {
453
+ ref.current = node;
454
+ }
455
+ },
456
+ [ref]
457
+ )
458
+ }, reactProps.children);
459
+ });
460
+ ReactComponent.displayName = displayName ?? elementClass.name;
461
+ return ReactComponent;
462
+ }
463
+ function setProperty(node, name, value) {
464
+ var _a;
465
+ node[name] = value;
466
+ if (value == null && name in (((_a = globalThis.HTMLElement) == null ? void 0 : _a.prototype) ?? {})) {
467
+ node.removeAttribute(name);
468
+ }
469
+ }
470
+
471
+ // dist/react.ts
472
+ var react_default = createComponent({
473
+ react: React__default,
474
+ tagName: "spotify-audio",
475
+ elementClass: spotify_audio_element_default,
476
+ toAttributeName(propName) {
477
+ if (propName === "muted") return "";
478
+ if (propName === "defaultMuted") return "muted";
479
+ return defaultToAttributeName(propName);
480
+ }
481
+ });
482
+ /*! Bundled license information:
483
+
484
+ ce-la-react/dist/ce-la-react.js:
485
+ (**
486
+ * @license
487
+ * Copyright 2018 Google LLC
488
+ * SPDX-License-Identifier: BSD-3-Clause
489
+ *
490
+ * Modified version of `@lit/react` for vanilla custom elements with support for SSR.
491
+ *)
492
+ */
493
+
494
+ export { react_default as default };