react-modern-audio-player 2.2.0 → 2.3.1
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.
- package/README.md +75 -57
- package/dist/index.css +1 -1
- package/dist/index.es.js +994 -835
- package/dist/types/api/useAudioPlayer.d.ts +2 -0
- package/dist/types/api/useAudioPlayerPlayback.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Context/PlaybackContext.d.ts +1 -0
- package/dist/types/components/AudioPlayer/Context/StateContext/audio.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Context/StateContext/element.d.ts +1 -0
- package/dist/types/components/AudioPlayer/Context/StateContext/index.d.ts +2 -1
- package/dist/types/components/AudioPlayer/Context/StateContext/placement.d.ts +7 -5
- package/dist/types/components/AudioPlayer/Context/UIContext.d.ts +2 -1
- package/dist/types/components/AudioPlayer/Context/dispatchContext.d.ts +5 -2
- package/dist/types/components/AudioPlayer/Context/providerProps.d.ts +2 -1
- package/dist/types/components/AudioPlayer/Interface/Controller/SpeedSelector/SpeedSelector.d.ts +10 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/SpeedSelector/index.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/Controller/Tooltip/Volume/index.d.ts +5 -1
- package/dist/types/components/AudioPlayer/Interface/hooks/index.d.ts +2 -0
- package/dist/types/components/AudioPlayer/Interface/hooks/useDropdownAutoPlacement.d.ts +5 -0
- package/dist/types/components/AudioPlayer/Interface/hooks/useResolvedDropdownProps.d.ts +18 -0
- package/dist/types/components/AudioPlayer/Player/index.d.ts +2 -2
- package/dist/types/components/AudioPlayer/Provider/AudioPlayerStateProvider.d.ts +2 -2
- package/dist/types/components/AudioPlayer/index.d.ts +5 -3
- package/package.json +1 -1
- package/dist/types/components/AudioPlayer/Interface/Controller/Tooltip/Volume/useVolume.d.ts +0 -5
package/dist/index.es.js
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import './index.css';
|
|
3
|
-
import { jsx as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
3
|
+
import { jsx as c, Fragment as G, jsxs as w } from "react/jsx-runtime";
|
|
4
|
+
import te, { createContext as K, useContext as he, useReducer as xt, useMemo as x, forwardRef as Pe, useCallback as E, useRef as S, useEffect as P, memo as z, useState as N, useId as $e, useLayoutEffect as Mt, cloneElement as _t, isValidElement as Dt } from "react";
|
|
5
|
+
import Rt, { flushSync as Fe } from "react-dom";
|
|
6
|
+
const O = {
|
|
7
7
|
isPlaying: !1,
|
|
8
8
|
volume: 1,
|
|
9
9
|
muted: !1,
|
|
10
10
|
repeatType: "ALL",
|
|
11
11
|
currentTime: 0,
|
|
12
|
-
duration: 0
|
|
13
|
-
|
|
12
|
+
duration: 0,
|
|
13
|
+
playbackRate: 1
|
|
14
|
+
}, Or = 11, de = {
|
|
14
15
|
templateArea: {
|
|
15
16
|
artwork: "row1-1",
|
|
16
17
|
trackInfo: "row1-2",
|
|
@@ -20,17 +21,18 @@ const H = {
|
|
|
20
21
|
repeatType: "row1-6",
|
|
21
22
|
volume: "row1-7",
|
|
22
23
|
playButton: "row1-8",
|
|
23
|
-
playList: "row1-9"
|
|
24
|
+
playList: "row1-9",
|
|
25
|
+
playbackRate: "row1-10"
|
|
24
26
|
}
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
const
|
|
27
|
+
}, b = K(null);
|
|
28
|
+
b.displayName = "AudioPlayerDispatchContext";
|
|
29
|
+
const He = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Ke = (e, t) => Math.round(Math.random() * (t - e) + e), Ut = 1, Ve = (e, t, n) => {
|
|
28
30
|
if (n - t < 1) return e;
|
|
29
|
-
let a =
|
|
31
|
+
let a = Ke(t, n);
|
|
30
32
|
for (; a === e; )
|
|
31
|
-
a =
|
|
33
|
+
a = Ke(t, n);
|
|
32
34
|
return a;
|
|
33
|
-
},
|
|
35
|
+
}, Ot = (e, t) => {
|
|
34
36
|
switch (t.type) {
|
|
35
37
|
case "NEXT_AUDIO": {
|
|
36
38
|
if (e.playList.length === 0) return e;
|
|
@@ -78,7 +80,7 @@ const Fe = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Oe = (e, t) =>
|
|
|
78
80
|
};
|
|
79
81
|
}
|
|
80
82
|
case "PREV_AUDIO": {
|
|
81
|
-
const n = e.playList.length <= 1, a = t.currentTime >
|
|
83
|
+
const n = e.playList.length <= 1, a = t.currentTime > Ut, r = e.curAudioState.repeatType === "NONE" && e.curIdx === 0;
|
|
82
84
|
if (n || a || r)
|
|
83
85
|
return {
|
|
84
86
|
...e,
|
|
@@ -86,21 +88,23 @@ const Fe = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Oe = (e, t) =>
|
|
|
86
88
|
curAudioState: { ...e.curAudioState, currentTime: 0 }
|
|
87
89
|
};
|
|
88
90
|
if (e.curAudioState.repeatType === "SHUFFLE") {
|
|
89
|
-
const
|
|
91
|
+
const s = Ve(
|
|
90
92
|
e.curIdx,
|
|
91
93
|
0,
|
|
92
94
|
e.playList.length - 1
|
|
93
95
|
);
|
|
94
96
|
return {
|
|
95
97
|
...e,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
audioResetKey: e.audioResetKey + 1,
|
|
99
|
+
curPlayId: e.playList[s].id,
|
|
100
|
+
curIdx: s,
|
|
98
101
|
curAudioState: { ...e.curAudioState, currentTime: 0 }
|
|
99
102
|
};
|
|
100
103
|
}
|
|
101
104
|
const i = (e.curIdx - 1 + e.playList.length) % e.playList.length;
|
|
102
105
|
return {
|
|
103
106
|
...e,
|
|
107
|
+
audioResetKey: e.audioResetKey + 1,
|
|
104
108
|
curPlayId: e.playList[i].id,
|
|
105
109
|
curIdx: i,
|
|
106
110
|
curAudioState: {
|
|
@@ -154,7 +158,15 @@ const Fe = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Oe = (e, t) =>
|
|
|
154
158
|
...e,
|
|
155
159
|
curAudioState: {
|
|
156
160
|
...e.curAudioState,
|
|
157
|
-
volume:
|
|
161
|
+
volume: He(t.volume)
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
case "SET_PLAYBACK_RATE":
|
|
165
|
+
return {
|
|
166
|
+
...e,
|
|
167
|
+
curAudioState: {
|
|
168
|
+
...e.curAudioState,
|
|
169
|
+
playbackRate: t.playbackRate
|
|
158
170
|
}
|
|
159
171
|
};
|
|
160
172
|
case "SET_AUDIO_STATE":
|
|
@@ -247,26 +259,26 @@ const Fe = (e) => isFinite(e) ? Math.min(Math.max(e, 0), 1) : 1, Oe = (e, t) =>
|
|
|
247
259
|
default:
|
|
248
260
|
throw new Error("Unhandled action");
|
|
249
261
|
}
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
const Ie =
|
|
262
|
+
}, Se = K(null);
|
|
263
|
+
Se.displayName = "PlaybackContext";
|
|
264
|
+
const Ie = K(null);
|
|
253
265
|
Ie.displayName = "AudioAttrsContext";
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
const
|
|
257
|
-
|
|
258
|
-
const Le =
|
|
266
|
+
const we = K(null);
|
|
267
|
+
we.displayName = "TrackContext";
|
|
268
|
+
const be = K(null);
|
|
269
|
+
be.displayName = "UIContext";
|
|
270
|
+
const Le = K(null);
|
|
259
271
|
Le.displayName = "ResourceContext";
|
|
260
|
-
const Ne =
|
|
272
|
+
const Ne = K(null);
|
|
261
273
|
Ne.displayName = "TimeContext";
|
|
262
|
-
const
|
|
274
|
+
const A = (e) => {
|
|
263
275
|
const t = he(e);
|
|
264
276
|
if (!t) {
|
|
265
277
|
const n = e.displayName || "Context";
|
|
266
278
|
throw new Error(`${n} is not provided`);
|
|
267
279
|
}
|
|
268
280
|
return t;
|
|
269
|
-
},
|
|
281
|
+
}, k = () => A(Se), re = () => A(Ne), $ = () => A(we), M = () => A(be), L = () => A(Le), Kt = () => A(Ie);
|
|
270
282
|
function Vt(e) {
|
|
271
283
|
const {
|
|
272
284
|
playList: t,
|
|
@@ -274,12 +286,13 @@ function Vt(e) {
|
|
|
274
286
|
activeUI: a,
|
|
275
287
|
placement: r,
|
|
276
288
|
customIcons: i,
|
|
277
|
-
coverImgsCss:
|
|
278
|
-
} = e,
|
|
279
|
-
isPlaying: (n == null ? void 0 : n.isPlaying) ??
|
|
280
|
-
repeatType: (n == null ? void 0 : n.repeatType) ??
|
|
281
|
-
volume: typeof (n == null ? void 0 : n.volume) == "number" ?
|
|
282
|
-
muted: (n == null ? void 0 : n.muted) ??
|
|
289
|
+
coverImgsCss: s
|
|
290
|
+
} = e, o = {
|
|
291
|
+
isPlaying: (n == null ? void 0 : n.isPlaying) ?? O.isPlaying,
|
|
292
|
+
repeatType: (n == null ? void 0 : n.repeatType) ?? O.repeatType,
|
|
293
|
+
volume: typeof (n == null ? void 0 : n.volume) == "number" ? He(n.volume) : O.volume,
|
|
294
|
+
muted: (n == null ? void 0 : n.muted) ?? O.muted,
|
|
295
|
+
playbackRate: (n == null ? void 0 : n.playbackRate) ?? O.playbackRate
|
|
283
296
|
}, u = a || { playButton: !0 }, d = {
|
|
284
297
|
playerPlacement: r == null ? void 0 : r.player,
|
|
285
298
|
playListPlacement: (r == null ? void 0 : r.playList) || "bottom",
|
|
@@ -288,35 +301,36 @@ function Vt(e) {
|
|
|
288
301
|
playButton: de.templateArea.playButton
|
|
289
302
|
}
|
|
290
303
|
},
|
|
291
|
-
volumeSliderPlacement: r == null ? void 0 : r.volumeSlider
|
|
292
|
-
|
|
304
|
+
volumeSliderPlacement: r == null ? void 0 : r.volumeSlider,
|
|
305
|
+
speedSelectorPlacement: r == null ? void 0 : r.speedSelector
|
|
306
|
+
}, l = t.length === 0, m = n == null ? void 0 : n.curPlayId, p = m == null ? -1 : t.findIndex((v) => v.id === m);
|
|
293
307
|
return {
|
|
294
308
|
playList: t,
|
|
295
|
-
curPlayId: l ? 0 :
|
|
296
|
-
curIdx: l ? -1 :
|
|
297
|
-
curAudioState:
|
|
309
|
+
curPlayId: l ? 0 : p >= 0 ? m : t[0].id,
|
|
310
|
+
curIdx: l ? -1 : p >= 0 ? p : 0,
|
|
311
|
+
curAudioState: o,
|
|
298
312
|
activeUI: u,
|
|
299
313
|
audioResetKey: 0,
|
|
300
314
|
seekRequestKey: 0,
|
|
301
315
|
...d,
|
|
302
316
|
customIcons: i,
|
|
303
|
-
coverImgsCss:
|
|
317
|
+
coverImgsCss: s
|
|
304
318
|
};
|
|
305
319
|
}
|
|
306
|
-
const
|
|
320
|
+
const Bt = ({
|
|
307
321
|
children: e,
|
|
308
322
|
colorScheme: t,
|
|
309
323
|
...n
|
|
310
324
|
}) => {
|
|
311
|
-
var
|
|
312
|
-
const [a, r] =
|
|
313
|
-
|
|
325
|
+
var v, f;
|
|
326
|
+
const [a, r] = xt(
|
|
327
|
+
Ot,
|
|
314
328
|
n,
|
|
315
329
|
Vt
|
|
316
|
-
), i =
|
|
330
|
+
), i = x(
|
|
317
331
|
() => ({
|
|
318
|
-
currentTime: a.curAudioState.currentTime ??
|
|
319
|
-
duration: a.curAudioState.duration ??
|
|
332
|
+
currentTime: a.curAudioState.currentTime ?? O.currentTime,
|
|
333
|
+
duration: a.curAudioState.duration ?? O.duration,
|
|
320
334
|
seekRequestKey: a.seekRequestKey
|
|
321
335
|
}),
|
|
322
336
|
[
|
|
@@ -324,14 +338,15 @@ const Kt = ({
|
|
|
324
338
|
a.curAudioState.duration,
|
|
325
339
|
a.seekRequestKey
|
|
326
340
|
]
|
|
327
|
-
),
|
|
341
|
+
), s = x(
|
|
328
342
|
() => ({
|
|
329
|
-
isPlaying: a.curAudioState.isPlaying ??
|
|
330
|
-
volume: a.curAudioState.volume ??
|
|
331
|
-
muted: a.curAudioState.muted ??
|
|
343
|
+
isPlaying: a.curAudioState.isPlaying ?? O.isPlaying,
|
|
344
|
+
volume: a.curAudioState.volume ?? O.volume,
|
|
345
|
+
muted: a.curAudioState.muted ?? O.muted,
|
|
332
346
|
repeatType: a.curAudioState.repeatType,
|
|
333
347
|
isLoadedMetaData: a.curAudioState.isLoadedMetaData,
|
|
334
|
-
audioResetKey: a.audioResetKey
|
|
348
|
+
audioResetKey: a.audioResetKey,
|
|
349
|
+
playbackRate: a.curAudioState.playbackRate ?? O.playbackRate
|
|
335
350
|
}),
|
|
336
351
|
[
|
|
337
352
|
a.curAudioState.isPlaying,
|
|
@@ -339,22 +354,24 @@ const Kt = ({
|
|
|
339
354
|
a.curAudioState.volume,
|
|
340
355
|
a.curAudioState.muted,
|
|
341
356
|
a.curAudioState.repeatType,
|
|
357
|
+
a.curAudioState.playbackRate,
|
|
342
358
|
a.audioResetKey
|
|
343
359
|
]
|
|
344
|
-
),
|
|
360
|
+
), o = x(
|
|
345
361
|
() => ({
|
|
346
362
|
playList: a.playList,
|
|
347
363
|
curPlayId: a.curPlayId,
|
|
348
364
|
curIdx: a.curIdx
|
|
349
365
|
}),
|
|
350
366
|
[a.playList, a.curPlayId, a.curIdx]
|
|
351
|
-
), { audioInitialState: u } = n, d = u == null ? void 0 : u.playListExpanded, l =
|
|
367
|
+
), { audioInitialState: u } = n, d = u == null ? void 0 : u.playListExpanded, l = x(
|
|
352
368
|
() => ({
|
|
353
369
|
activeUI: a.activeUI,
|
|
354
370
|
playListPlacement: a.playListPlacement,
|
|
355
371
|
playerPlacement: a.playerPlacement,
|
|
356
372
|
interfacePlacement: a.interfacePlacement,
|
|
357
373
|
volumeSliderPlacement: a.volumeSliderPlacement,
|
|
374
|
+
speedSelectorPlacement: a.speedSelectorPlacement,
|
|
358
375
|
colorScheme: t,
|
|
359
376
|
playListExpanded: d
|
|
360
377
|
}),
|
|
@@ -364,82 +381,84 @@ const Kt = ({
|
|
|
364
381
|
a.playerPlacement,
|
|
365
382
|
a.interfacePlacement,
|
|
366
383
|
a.volumeSliderPlacement,
|
|
384
|
+
a.speedSelectorPlacement,
|
|
367
385
|
t,
|
|
368
386
|
d
|
|
369
387
|
]
|
|
370
|
-
),
|
|
388
|
+
), m = x(() => {
|
|
371
389
|
if (!u) return {};
|
|
372
390
|
const {
|
|
373
|
-
isPlaying:
|
|
391
|
+
isPlaying: y,
|
|
374
392
|
repeatType: T,
|
|
375
393
|
isLoadedMetaData: h,
|
|
376
|
-
currentTime:
|
|
377
|
-
duration:
|
|
378
|
-
volume:
|
|
394
|
+
currentTime: g,
|
|
395
|
+
duration: C,
|
|
396
|
+
volume: W,
|
|
379
397
|
muted: se,
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
398
|
+
playbackRate: R,
|
|
399
|
+
curPlayId: ce,
|
|
400
|
+
playListExpanded: ae,
|
|
401
|
+
...ye
|
|
383
402
|
} = u;
|
|
384
|
-
return
|
|
385
|
-
}, [u]),
|
|
403
|
+
return ye;
|
|
404
|
+
}, [u]), p = x(
|
|
386
405
|
() => ({
|
|
387
406
|
elementRefs: a.elementRefs,
|
|
388
407
|
customIcons: a.customIcons,
|
|
389
408
|
coverImgsCss: a.coverImgsCss
|
|
390
409
|
}),
|
|
391
410
|
[
|
|
392
|
-
(
|
|
411
|
+
(v = a.elementRefs) == null ? void 0 : v.audioEl,
|
|
393
412
|
(f = a.elementRefs) == null ? void 0 : f.waveformInst,
|
|
394
413
|
a.customIcons,
|
|
395
414
|
a.coverImgsCss
|
|
396
415
|
]
|
|
397
416
|
);
|
|
398
|
-
return /* @__PURE__ */
|
|
399
|
-
},
|
|
417
|
+
return /* @__PURE__ */ c(Ne.Provider, { value: i, children: /* @__PURE__ */ c(Se.Provider, { value: s, children: /* @__PURE__ */ c(we.Provider, { value: o, children: /* @__PURE__ */ c(be.Provider, { value: l, children: /* @__PURE__ */ c(Le.Provider, { value: p, children: /* @__PURE__ */ c(Ie.Provider, { value: m, children: /* @__PURE__ */ c(b.Provider, { value: r, children: e }) }) }) }) }) }) });
|
|
418
|
+
}, J = {
|
|
400
419
|
top: "auto",
|
|
401
420
|
right: "auto",
|
|
402
421
|
bottom: "auto",
|
|
403
422
|
left: "auto"
|
|
404
|
-
},
|
|
405
|
-
bottom: { ...
|
|
406
|
-
top: { ...
|
|
407
|
-
"bottom-left": { ...
|
|
408
|
-
"bottom-right": { ...
|
|
409
|
-
"top-left": { ...
|
|
410
|
-
"top-right": { ...
|
|
411
|
-
},
|
|
412
|
-
const { playerPlacement: n, colorScheme: a } =
|
|
413
|
-
() => n ?
|
|
423
|
+
}, $t = {
|
|
424
|
+
bottom: { ...J, bottom: 0 },
|
|
425
|
+
top: { ...J, top: 0 },
|
|
426
|
+
"bottom-left": { ...J, bottom: 0, left: 0 },
|
|
427
|
+
"bottom-right": { ...J, bottom: 0, right: 0 },
|
|
428
|
+
"top-left": { ...J, top: 0, left: 0 },
|
|
429
|
+
"top-right": { ...J, top: 0, right: 0 }
|
|
430
|
+
}, Ge = te.memo(({ children: e, rootContainerProps: t }) => {
|
|
431
|
+
const { playerPlacement: n, colorScheme: a } = M(), r = x(
|
|
432
|
+
() => n ? $t[n] : void 0,
|
|
414
433
|
[n]
|
|
415
|
-
),
|
|
434
|
+
), s = {
|
|
416
435
|
width: "100%",
|
|
417
436
|
position: n !== "static" && !!n ? "fixed" : "static",
|
|
418
437
|
...r,
|
|
419
438
|
...(t == null ? void 0 : t.style) ?? {}
|
|
420
439
|
};
|
|
421
|
-
return /* @__PURE__ */
|
|
440
|
+
return /* @__PURE__ */ c(
|
|
422
441
|
"div",
|
|
423
442
|
{
|
|
424
443
|
...t,
|
|
425
444
|
className: `rmap-player-provider${t != null && t.className ? ` ${t.className}` : ""}`,
|
|
426
445
|
"data-theme": a ?? void 0,
|
|
427
|
-
style:
|
|
446
|
+
style: s,
|
|
428
447
|
children: e
|
|
429
448
|
}
|
|
430
449
|
);
|
|
431
450
|
});
|
|
432
|
-
|
|
433
|
-
const
|
|
451
|
+
Ge.displayName = "AudioPlayerContainer";
|
|
452
|
+
const Ft = ({
|
|
434
453
|
areas: e,
|
|
435
454
|
columns: t,
|
|
436
455
|
alignItems: n,
|
|
437
456
|
justifyContent: a,
|
|
438
457
|
minHeight: r,
|
|
439
458
|
UNSAFE_className: i,
|
|
440
|
-
children:
|
|
459
|
+
children: s
|
|
441
460
|
}) => {
|
|
442
|
-
const
|
|
461
|
+
const o = {
|
|
443
462
|
display: "grid",
|
|
444
463
|
gridTemplateAreas: e == null ? void 0 : e.map((u) => `"${u}"`).join(" "),
|
|
445
464
|
gridTemplateColumns: t == null ? void 0 : t.join(" "),
|
|
@@ -447,8 +466,8 @@ const $t = ({
|
|
|
447
466
|
justifyContent: a,
|
|
448
467
|
minHeight: r
|
|
449
468
|
};
|
|
450
|
-
return /* @__PURE__ */
|
|
451
|
-
},
|
|
469
|
+
return /* @__PURE__ */ c("div", { className: i, style: o, children: s });
|
|
470
|
+
}, Ht = Ft, ze = Pe(
|
|
452
471
|
({
|
|
453
472
|
children: e,
|
|
454
473
|
visible: t = !0,
|
|
@@ -456,8 +475,8 @@ const $t = ({
|
|
|
456
475
|
width: a,
|
|
457
476
|
justifySelf: r = "center",
|
|
458
477
|
padding: i,
|
|
459
|
-
UNSAFE_className:
|
|
460
|
-
style:
|
|
478
|
+
UNSAFE_className: s,
|
|
479
|
+
style: o,
|
|
461
480
|
...u
|
|
462
481
|
}, d) => {
|
|
463
482
|
if (!t) return null;
|
|
@@ -466,21 +485,21 @@ const $t = ({
|
|
|
466
485
|
width: a,
|
|
467
486
|
justifySelf: r,
|
|
468
487
|
padding: i ?? "0 5px",
|
|
469
|
-
...
|
|
488
|
+
...o
|
|
470
489
|
};
|
|
471
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ c("div", { ref: d, className: s, style: l, ...u, children: e });
|
|
472
491
|
}
|
|
473
492
|
);
|
|
474
|
-
|
|
475
|
-
const _ =
|
|
476
|
-
_.Item =
|
|
477
|
-
const
|
|
493
|
+
ze.displayName = "GridItem";
|
|
494
|
+
const _ = Ht;
|
|
495
|
+
_.Item = ze;
|
|
496
|
+
const Gt = ({
|
|
478
497
|
children: e,
|
|
479
498
|
id: t,
|
|
480
499
|
...n
|
|
481
500
|
}) => {
|
|
482
|
-
var l,
|
|
483
|
-
const a =
|
|
501
|
+
var l, m;
|
|
502
|
+
const a = k(), r = re(), i = $(), s = M(), o = L(), u = {
|
|
484
503
|
curAudioState: {
|
|
485
504
|
isPlaying: a.isPlaying,
|
|
486
505
|
volume: a.volume,
|
|
@@ -493,123 +512,131 @@ const Ht = ({
|
|
|
493
512
|
audioResetKey: a.audioResetKey,
|
|
494
513
|
...r,
|
|
495
514
|
...i,
|
|
496
|
-
...
|
|
497
|
-
...
|
|
498
|
-
}, d = (
|
|
499
|
-
return /* @__PURE__ */
|
|
515
|
+
...s,
|
|
516
|
+
...o
|
|
517
|
+
}, d = (m = (l = s.interfacePlacement) == null ? void 0 : l.customComponentsArea) == null ? void 0 : m[t];
|
|
518
|
+
return /* @__PURE__ */ c(
|
|
500
519
|
_.Item,
|
|
501
520
|
{
|
|
502
521
|
UNSAFE_className: "rmap-custom-component",
|
|
503
522
|
gridArea: d,
|
|
504
523
|
...n,
|
|
505
|
-
children:
|
|
524
|
+
children: te.cloneElement(e, { audioPlayerState: u })
|
|
506
525
|
}
|
|
507
526
|
);
|
|
508
|
-
},
|
|
509
|
-
|
|
510
|
-
const
|
|
527
|
+
}, We = "PlayListEmpty", je = () => null;
|
|
528
|
+
je.displayName = We;
|
|
529
|
+
const zt = () => {
|
|
511
530
|
const {
|
|
512
531
|
isPlaying: e,
|
|
513
532
|
volume: t,
|
|
514
533
|
repeatType: n,
|
|
515
|
-
audioResetKey: a
|
|
516
|
-
|
|
534
|
+
audioResetKey: a,
|
|
535
|
+
playbackRate: r
|
|
536
|
+
} = k(), { currentTime: i, seekRequestKey: s } = re(), { elementRefs: o } = L(), u = A(b), d = E(
|
|
517
537
|
(y) => {
|
|
518
538
|
if (y.currentTarget.readyState === 0) return;
|
|
519
|
-
const
|
|
520
|
-
|
|
539
|
+
const T = y.currentTarget.currentTime;
|
|
540
|
+
u({
|
|
521
541
|
type: "SET_AUDIO_STATE",
|
|
522
|
-
audioState: { currentTime:
|
|
542
|
+
audioState: { currentTime: T }
|
|
523
543
|
});
|
|
524
544
|
},
|
|
525
|
-
[
|
|
526
|
-
),
|
|
545
|
+
[u]
|
|
546
|
+
), l = E(() => {
|
|
527
547
|
if (o != null && o.audioEl) {
|
|
528
548
|
if (n === "ONE") {
|
|
529
|
-
|
|
530
|
-
|
|
549
|
+
Fe(() => {
|
|
550
|
+
u({ type: "SEEK", time: 0 });
|
|
531
551
|
}), o.audioEl.play();
|
|
532
552
|
return;
|
|
533
553
|
}
|
|
534
|
-
|
|
554
|
+
u({ type: "NEXT_AUDIO" });
|
|
535
555
|
}
|
|
536
|
-
}, [
|
|
556
|
+
}, [u, n, o == null ? void 0 : o.audioEl]), m = E(
|
|
557
|
+
(y) => {
|
|
558
|
+
t != null && (y.volume = t), r != null && (y.playbackRate = r);
|
|
559
|
+
},
|
|
560
|
+
[t, r]
|
|
561
|
+
), p = E(
|
|
537
562
|
(y) => {
|
|
538
|
-
const { duration:
|
|
539
|
-
|
|
563
|
+
const { duration: T } = y.currentTarget;
|
|
564
|
+
m(y.currentTarget), u({
|
|
540
565
|
type: "SET_AUDIO_STATE",
|
|
541
|
-
audioState: { isLoadedMetaData: !0, duration:
|
|
566
|
+
audioState: { isLoadedMetaData: !0, duration: T }
|
|
542
567
|
});
|
|
543
568
|
},
|
|
544
|
-
[
|
|
545
|
-
),
|
|
569
|
+
[u, m]
|
|
570
|
+
), v = S(!1);
|
|
546
571
|
P(() => {
|
|
547
572
|
if (o != null && o.audioEl) {
|
|
548
|
-
if (!
|
|
549
|
-
|
|
573
|
+
if (!v.current) {
|
|
574
|
+
v.current = !0;
|
|
550
575
|
return;
|
|
551
576
|
}
|
|
552
577
|
o.audioEl.currentTime = 0;
|
|
553
578
|
}
|
|
554
579
|
}, [a, o == null ? void 0 : o.audioEl]), P(() => {
|
|
555
|
-
o != null && o.audioEl && (e ? o.audioEl.play().catch(() => {
|
|
556
|
-
|
|
580
|
+
o != null && o.audioEl && (e ? o.audioEl.play().catch((y) => {
|
|
581
|
+
(y == null ? void 0 : y.name) !== "AbortError" && u({
|
|
557
582
|
type: "SET_AUDIO_STATE",
|
|
558
583
|
audioState: { isPlaying: !1 }
|
|
559
584
|
});
|
|
560
585
|
}) : o.audioEl.pause());
|
|
561
|
-
}, [o == null ? void 0 : o.audioEl, e,
|
|
586
|
+
}, [o == null ? void 0 : o.audioEl, e, u, a]), P(() => {
|
|
562
587
|
!(o != null && o.audioEl) || t == null || (o.audioEl.volume = t);
|
|
563
|
-
}, [o == null ? void 0 : o.audioEl, t])
|
|
564
|
-
|
|
588
|
+
}, [o == null ? void 0 : o.audioEl, t]), P(() => {
|
|
589
|
+
!(o != null && o.audioEl) || r == null || (o.audioEl.playbackRate = r);
|
|
590
|
+
}, [o == null ? void 0 : o.audioEl, r]);
|
|
591
|
+
const f = S(0);
|
|
565
592
|
return P(() => {
|
|
566
|
-
if (
|
|
567
|
-
|
|
593
|
+
if (s === f.current) return;
|
|
594
|
+
f.current = s;
|
|
568
595
|
const y = o == null ? void 0 : o.audioEl;
|
|
569
|
-
if (!y ||
|
|
570
|
-
y.currentTime =
|
|
571
|
-
const
|
|
572
|
-
if (!
|
|
573
|
-
const
|
|
574
|
-
|
|
596
|
+
if (!y || i == null) return;
|
|
597
|
+
y.currentTime = i;
|
|
598
|
+
const T = o == null ? void 0 : o.waveformInst, h = y.duration, g = Number.isFinite(h) && h > 0;
|
|
599
|
+
if (!T || !g) return;
|
|
600
|
+
const C = i / h, W = Math.min(1, Math.max(0, C));
|
|
601
|
+
T.seekTo(W);
|
|
575
602
|
}, [
|
|
603
|
+
s,
|
|
576
604
|
i,
|
|
577
|
-
r,
|
|
578
605
|
o == null ? void 0 : o.audioEl,
|
|
579
606
|
o == null ? void 0 : o.waveformInst
|
|
580
607
|
]), {
|
|
581
|
-
onTimeUpdate:
|
|
582
|
-
onEnded:
|
|
583
|
-
onLoadedMetadata:
|
|
608
|
+
onTimeUpdate: d,
|
|
609
|
+
onEnded: l,
|
|
610
|
+
onLoadedMetadata: p
|
|
584
611
|
};
|
|
585
|
-
},
|
|
586
|
-
const t =
|
|
612
|
+
}, Ye = te.memo(({ audioRef: e }) => {
|
|
613
|
+
const t = S(null), { muted: n } = k(), { curPlayId: a, playList: r } = $(), i = Kt(), s = A(b), o = r.find(
|
|
587
614
|
(d) => d.id === a
|
|
588
|
-
), u =
|
|
615
|
+
), u = zt();
|
|
589
616
|
return P(() => {
|
|
590
|
-
t.current && (
|
|
617
|
+
t.current && (s({
|
|
591
618
|
type: "SET_ELEMENT_REFS",
|
|
592
619
|
elementRefs: { audioEl: t.current }
|
|
593
620
|
}), e && (e.current = t.current));
|
|
594
|
-
}, [
|
|
621
|
+
}, [s, e]), /* @__PURE__ */ c(
|
|
595
622
|
"audio",
|
|
596
623
|
{
|
|
597
624
|
id: "rm-audio-player-audio",
|
|
598
625
|
...i,
|
|
599
626
|
muted: n,
|
|
600
627
|
ref: t,
|
|
601
|
-
src:
|
|
628
|
+
src: o == null ? void 0 : o.src,
|
|
602
629
|
...u
|
|
603
630
|
}
|
|
604
631
|
);
|
|
605
632
|
});
|
|
606
|
-
|
|
607
|
-
function
|
|
633
|
+
Ye.displayName = "Audio";
|
|
634
|
+
function B(e, t) {
|
|
608
635
|
var a, r;
|
|
609
|
-
const { interfacePlacement: n } =
|
|
636
|
+
const { interfacePlacement: n } = M();
|
|
610
637
|
return t ?? ((a = n == null ? void 0 : n.itemCustomArea) == null ? void 0 : a[e]) ?? ((r = n == null ? void 0 : n.templateArea) == null ? void 0 : r[e]) ?? de.templateArea[e];
|
|
611
638
|
}
|
|
612
|
-
const
|
|
639
|
+
const q = Pe(({ className: e, type: t = "button", ...n }, a) => /* @__PURE__ */ c(
|
|
613
640
|
"button",
|
|
614
641
|
{
|
|
615
642
|
ref: a,
|
|
@@ -618,10 +645,10 @@ const j = Pe(({ className: e, type: t = "button", ...n }, a) => /* @__PURE__ */
|
|
|
618
645
|
...n
|
|
619
646
|
}
|
|
620
647
|
));
|
|
621
|
-
|
|
622
|
-
const
|
|
648
|
+
q.displayName = "StyledBtn";
|
|
649
|
+
const ke = (e) => (
|
|
623
650
|
// eslint-disable-next-line react/display-name
|
|
624
|
-
({ size: t = "1em", color: n, style: a, ...r }) => /* @__PURE__ */
|
|
651
|
+
({ size: t = "1em", color: n, style: a, ...r }) => /* @__PURE__ */ c(
|
|
625
652
|
"svg",
|
|
626
653
|
{
|
|
627
654
|
"aria-hidden": "true",
|
|
@@ -639,9 +666,9 @@ const be = (e) => (
|
|
|
639
666
|
dangerouslySetInnerHTML: { __html: e }
|
|
640
667
|
}
|
|
641
668
|
)
|
|
642
|
-
),
|
|
669
|
+
), X = (e) => (
|
|
643
670
|
// eslint-disable-next-line react/display-name
|
|
644
|
-
({ size: t = "1em", color: n, style: a, ...r }) => /* @__PURE__ */
|
|
671
|
+
({ size: t = "1em", color: n, style: a, ...r }) => /* @__PURE__ */ c(
|
|
645
672
|
"svg",
|
|
646
673
|
{
|
|
647
674
|
"aria-hidden": "true",
|
|
@@ -661,9 +688,9 @@ const be = (e) => (
|
|
|
661
688
|
dangerouslySetInnerHTML: { __html: e }
|
|
662
689
|
}
|
|
663
690
|
)
|
|
664
|
-
),
|
|
691
|
+
), qe = (e, t = "0 0 16 16") => (
|
|
665
692
|
// eslint-disable-next-line react/display-name
|
|
666
|
-
({ size: n = "1em", color: a, style: r, ...i }) => /* @__PURE__ */
|
|
693
|
+
({ size: n = "1em", color: a, style: r, ...i }) => /* @__PURE__ */ c(
|
|
667
694
|
"svg",
|
|
668
695
|
{
|
|
669
696
|
"aria-hidden": "true",
|
|
@@ -681,94 +708,94 @@ const be = (e) => (
|
|
|
681
708
|
dangerouslySetInnerHTML: { __html: e }
|
|
682
709
|
}
|
|
683
710
|
)
|
|
684
|
-
),
|
|
711
|
+
), Xe = ke(
|
|
685
712
|
'<path fill="none" d="M0 0h24v24H0z"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z"/>'
|
|
686
713
|
);
|
|
687
|
-
|
|
688
|
-
const
|
|
714
|
+
Xe.displayName = "MdPlayCircleFilled";
|
|
715
|
+
const Qe = ke(
|
|
689
716
|
'<path fill="none" d="M0 0h24v24H0z"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 14H9V8h2v8zm4 0h-2V8h2v8z"/>'
|
|
690
717
|
);
|
|
691
|
-
|
|
692
|
-
const
|
|
718
|
+
Qe.displayName = "MdPauseCircleFilled";
|
|
719
|
+
const Je = ke(
|
|
693
720
|
'<path fill="none" d="M0 0h24v24H0z"/><path d="M3 10h11v2H3zM3 6h11v2H3zM3 14h7v2H3zM16 13v8l6-4z"/>'
|
|
694
721
|
);
|
|
695
|
-
|
|
696
|
-
const
|
|
722
|
+
Je.displayName = "MdPlaylistPlay";
|
|
723
|
+
const Ze = X(
|
|
697
724
|
'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3"/><path d="M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3"/>'
|
|
698
725
|
);
|
|
699
|
-
|
|
700
|
-
const
|
|
726
|
+
Ze.displayName = "TbRepeat";
|
|
727
|
+
const et = X(
|
|
701
728
|
'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3"/><path d="M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3"/><path d="M11 11l1 -1v4"/>'
|
|
702
729
|
);
|
|
703
|
-
|
|
704
|
-
const
|
|
730
|
+
et.displayName = "TbRepeatOnce";
|
|
731
|
+
const tt = X(
|
|
705
732
|
'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M4 12v-3c0 -1.336 .873 -2.468 2.08 -2.856m3.92 -.144h10m-3 -3l3 3l-3 3"/><path d="M20 12v3a3 3 0 0 1 -.133 .886m-1.99 1.984a3 3 0 0 1 -.877 .13h-13m3 3l-3 -3l3 -3"/><path d="M3 3l18 18"/>'
|
|
706
733
|
);
|
|
707
|
-
|
|
708
|
-
const
|
|
734
|
+
tt.displayName = "TbRepeatOff";
|
|
735
|
+
const rt = X(
|
|
709
736
|
'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 4l3 3l-3 3"/><path d="M18 20l3 -3l-3 -3"/><path d="M3 7h3a5 5 0 0 1 5 5a5 5 0 0 0 5 5h5"/><path d="M21 7h-5a4.978 4.978 0 0 0 -2.998 .998m-4.002 8.003a4.984 4.984 0 0 1 -3 .999h-3"/>'
|
|
710
737
|
);
|
|
711
|
-
|
|
712
|
-
const
|
|
738
|
+
rt.displayName = "TbArrowsShuffle";
|
|
739
|
+
const at = X(
|
|
713
740
|
'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 8a5 5 0 0 1 0 8"/><path d="M17.7 5a9 9 0 0 1 0 14"/><path d="M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a0.8 .8 0 0 1 1.5 .5v14a0.8 .8 0 0 1 -1.5 .5l-3.5 -4.5"/>'
|
|
714
741
|
);
|
|
715
|
-
|
|
716
|
-
const
|
|
742
|
+
at.displayName = "TbVolume";
|
|
743
|
+
const nt = X(
|
|
717
744
|
'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M15 8a5 5 0 0 1 0 8"/><path d="M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a0.8 .8 0 0 1 1.5 .5v14a0.8 .8 0 0 1 -1.5 .5l-3.5 -4.5"/>'
|
|
718
745
|
);
|
|
719
|
-
|
|
720
|
-
const
|
|
746
|
+
nt.displayName = "TbVolume2";
|
|
747
|
+
const ot = X(
|
|
721
748
|
'<path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 15h-2a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1h2l3.5 -4.5a0.8 .8 0 0 1 1.5 .5v14a0.8 .8 0 0 1 -1.5 .5l-3.5 -4.5"/><path d="M16 10l4 4m0 -4l-4 4"/>'
|
|
722
749
|
);
|
|
723
|
-
|
|
724
|
-
const
|
|
750
|
+
ot.displayName = "TbVolume3";
|
|
751
|
+
const it = qe(
|
|
725
752
|
'<path d="M8 0c-4.418 0-8 3.582-8 8s3.582 8 8 8 8-3.582 8-8-3.582-8-8-8zM8 14.5c-3.59 0-6.5-2.91-6.5-6.5s2.91-6.5 6.5-6.5 6.5 2.91 6.5 6.5-2.91 6.5-6.5 6.5z"/><path d="M7 8l4-3v6z"/><path d="M5 5h2v6h-2v-6z"/>'
|
|
726
753
|
);
|
|
727
|
-
|
|
728
|
-
const
|
|
754
|
+
it.displayName = "ImPrevious";
|
|
755
|
+
const st = qe(
|
|
729
756
|
'<path d="M8 0c4.418 0 8 3.582 8 8s-3.582 8-8 8-8-3.582-8-8 3.582-8 8-8zM8 14.5c3.59 0 6.5-2.91 6.5-6.5s-2.91-6.5-6.5-6.5-6.5 2.91-6.5 6.5 2.91 6.5 6.5 6.5z"/><path d="M9 8l-4-3v6z"/><path d="M11 5h-2v6h2v-6z"/>'
|
|
730
757
|
);
|
|
731
|
-
|
|
732
|
-
const
|
|
733
|
-
const { isPlaying: t } =
|
|
734
|
-
return /* @__PURE__ */
|
|
735
|
-
|
|
758
|
+
st.displayName = "ImNext";
|
|
759
|
+
const D = ({ render: e, customIcon: t }) => /* @__PURE__ */ c(G, { children: t ?? e }), Wt = z(function() {
|
|
760
|
+
const { isPlaying: t } = k(), { customIcons: n } = L(), a = A(b);
|
|
761
|
+
return /* @__PURE__ */ c(
|
|
762
|
+
q,
|
|
736
763
|
{
|
|
737
764
|
type: "button",
|
|
738
765
|
"aria-label": t ? "Pause" : "Play",
|
|
739
766
|
onClick: () => a({ type: "CHANGE_PLAYING_STATE" }),
|
|
740
767
|
className: "rmap-play-btn",
|
|
741
768
|
"data-testid": "play-btn",
|
|
742
|
-
children: t ? /* @__PURE__ */
|
|
743
|
-
|
|
769
|
+
children: t ? /* @__PURE__ */ c(
|
|
770
|
+
D,
|
|
744
771
|
{
|
|
745
|
-
render: /* @__PURE__ */
|
|
772
|
+
render: /* @__PURE__ */ c(Qe, {}),
|
|
746
773
|
customIcon: n == null ? void 0 : n.pause
|
|
747
774
|
}
|
|
748
|
-
) : /* @__PURE__ */
|
|
775
|
+
) : /* @__PURE__ */ c(D, { render: /* @__PURE__ */ c(Xe, {}), customIcon: n == null ? void 0 : n.play })
|
|
749
776
|
}
|
|
750
777
|
);
|
|
751
|
-
}),
|
|
752
|
-
const { customIcons: n, elementRefs: a } =
|
|
753
|
-
return t ? /* @__PURE__ */
|
|
754
|
-
|
|
778
|
+
}), jt = z(function({ isVisible: t }) {
|
|
779
|
+
const { customIcons: n, elementRefs: a } = L(), r = A(b);
|
|
780
|
+
return t ? /* @__PURE__ */ c(
|
|
781
|
+
q,
|
|
755
782
|
{
|
|
756
783
|
type: "button",
|
|
757
784
|
"aria-label": "Previous track",
|
|
758
785
|
onClick: () => {
|
|
759
|
-
var
|
|
760
|
-
const
|
|
761
|
-
r({ type: "PREV_AUDIO", currentTime:
|
|
786
|
+
var o;
|
|
787
|
+
const s = ((o = a == null ? void 0 : a.audioEl) == null ? void 0 : o.currentTime) ?? 0;
|
|
788
|
+
r({ type: "PREV_AUDIO", currentTime: s });
|
|
762
789
|
},
|
|
763
790
|
className: "rmap-prev-btn",
|
|
764
791
|
"data-testid": "prev-btn",
|
|
765
|
-
children: /* @__PURE__ */
|
|
792
|
+
children: /* @__PURE__ */ c(D, { render: /* @__PURE__ */ c(it, {}), customIcon: n == null ? void 0 : n.prev })
|
|
766
793
|
}
|
|
767
794
|
) : null;
|
|
768
|
-
}),
|
|
769
|
-
const { customIcons: n } =
|
|
770
|
-
return t ? /* @__PURE__ */
|
|
771
|
-
|
|
795
|
+
}), Yt = z(function({ isVisible: t }) {
|
|
796
|
+
const { customIcons: n } = L(), a = A(b);
|
|
797
|
+
return t ? /* @__PURE__ */ c(
|
|
798
|
+
q,
|
|
772
799
|
{
|
|
773
800
|
type: "button",
|
|
774
801
|
"aria-label": "Next track",
|
|
@@ -777,83 +804,83 @@ const M = ({ render: e, customIcon: t }) => /* @__PURE__ */ s(R, { children: t ?
|
|
|
777
804
|
},
|
|
778
805
|
className: "rmap-next-btn",
|
|
779
806
|
"data-testid": "next-btn",
|
|
780
|
-
children: /* @__PURE__ */
|
|
807
|
+
children: /* @__PURE__ */ c(D, { render: /* @__PURE__ */ c(st, {}), customIcon: n == null ? void 0 : n.next })
|
|
781
808
|
}
|
|
782
809
|
) : null;
|
|
783
|
-
}),
|
|
810
|
+
}), ct = ({
|
|
784
811
|
gridArea: e,
|
|
785
812
|
visible: t,
|
|
786
813
|
...n
|
|
787
814
|
}) => {
|
|
788
|
-
const { activeUI: a } =
|
|
789
|
-
return /* @__PURE__ */
|
|
815
|
+
const { activeUI: a } = M(), r = !!(a.prevNnext ?? a.all), i = B("playButton", e);
|
|
816
|
+
return /* @__PURE__ */ c(_.Item, { gridArea: i, visible: t ?? !0, ...n, children: /* @__PURE__ */ w(
|
|
790
817
|
"div",
|
|
791
818
|
{
|
|
792
819
|
className: "rmap-ctrl-btn-wrapper",
|
|
793
820
|
role: "group",
|
|
794
821
|
"aria-label": "Playback controls",
|
|
795
822
|
children: [
|
|
796
|
-
/* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
/* @__PURE__ */
|
|
823
|
+
/* @__PURE__ */ c(jt, { isVisible: r }),
|
|
824
|
+
/* @__PURE__ */ c(Wt, {}),
|
|
825
|
+
/* @__PURE__ */ c(Yt, { isVisible: r })
|
|
799
826
|
]
|
|
800
827
|
}
|
|
801
828
|
) });
|
|
802
|
-
},
|
|
829
|
+
}, qt = {
|
|
803
830
|
ALL: "Repeat: All tracks",
|
|
804
831
|
ONE: "Repeat: One track",
|
|
805
832
|
NONE: "Repeat: Off",
|
|
806
833
|
SHUFFLE: "Shuffle"
|
|
807
|
-
},
|
|
834
|
+
}, Xt = {
|
|
808
835
|
ALL: "ONE",
|
|
809
836
|
ONE: "NONE",
|
|
810
837
|
NONE: "SHUFFLE",
|
|
811
838
|
SHUFFLE: "ALL"
|
|
812
|
-
},
|
|
839
|
+
}, lt = z(
|
|
813
840
|
function({ gridArea: t, visible: n, ...a }) {
|
|
814
|
-
const { repeatType: r } =
|
|
815
|
-
|
|
816
|
-
),
|
|
817
|
-
|
|
841
|
+
const { repeatType: r } = k(), { customIcons: i } = L(), s = A(
|
|
842
|
+
b
|
|
843
|
+
), o = () => {
|
|
844
|
+
s({
|
|
818
845
|
type: "SET_REPEAT_TYPE",
|
|
819
|
-
repeatType:
|
|
846
|
+
repeatType: Xt[r]
|
|
820
847
|
});
|
|
821
|
-
}, u =
|
|
822
|
-
return /* @__PURE__ */
|
|
848
|
+
}, u = B("repeatType", t);
|
|
849
|
+
return /* @__PURE__ */ c(
|
|
823
850
|
_.Item,
|
|
824
851
|
{
|
|
825
852
|
gridArea: u,
|
|
826
853
|
visible: n ?? !0,
|
|
827
854
|
...a,
|
|
828
855
|
children: /* @__PURE__ */ w(
|
|
829
|
-
|
|
856
|
+
q,
|
|
830
857
|
{
|
|
831
858
|
type: "button",
|
|
832
|
-
"aria-label":
|
|
833
|
-
onClick:
|
|
859
|
+
"aria-label": qt[r],
|
|
860
|
+
onClick: o,
|
|
834
861
|
className: "rmap-repeat-btn",
|
|
835
862
|
"data-testid": "repeat-btn",
|
|
836
863
|
"data-repeattype": r,
|
|
837
864
|
children: [
|
|
838
|
-
r === "ALL" && /* @__PURE__ */
|
|
839
|
-
r === "ONE" && /* @__PURE__ */
|
|
840
|
-
|
|
865
|
+
r === "ALL" && /* @__PURE__ */ c(D, { render: /* @__PURE__ */ c(Ze, {}), customIcon: i == null ? void 0 : i.repeatAll }),
|
|
866
|
+
r === "ONE" && /* @__PURE__ */ c(
|
|
867
|
+
D,
|
|
841
868
|
{
|
|
842
|
-
render: /* @__PURE__ */
|
|
869
|
+
render: /* @__PURE__ */ c(et, {}),
|
|
843
870
|
customIcon: i == null ? void 0 : i.repeatOne
|
|
844
871
|
}
|
|
845
872
|
),
|
|
846
|
-
r === "NONE" && /* @__PURE__ */
|
|
847
|
-
|
|
873
|
+
r === "NONE" && /* @__PURE__ */ c(
|
|
874
|
+
D,
|
|
848
875
|
{
|
|
849
|
-
render: /* @__PURE__ */
|
|
876
|
+
render: /* @__PURE__ */ c(tt, {}),
|
|
850
877
|
customIcon: i == null ? void 0 : i.repeatNone
|
|
851
878
|
}
|
|
852
879
|
),
|
|
853
|
-
r === "SHUFFLE" && /* @__PURE__ */
|
|
854
|
-
|
|
880
|
+
r === "SHUFFLE" && /* @__PURE__ */ c(
|
|
881
|
+
D,
|
|
855
882
|
{
|
|
856
|
-
render: /* @__PURE__ */
|
|
883
|
+
render: /* @__PURE__ */ c(rt, {}),
|
|
857
884
|
customIcon: i == null ? void 0 : i.repeatShuffle
|
|
858
885
|
}
|
|
859
886
|
)
|
|
@@ -863,33 +890,33 @@ const M = ({ render: e, customIcon: t }) => /* @__PURE__ */ s(R, { children: t ?
|
|
|
863
890
|
}
|
|
864
891
|
);
|
|
865
892
|
}
|
|
866
|
-
),
|
|
867
|
-
var
|
|
868
|
-
const { volume: e, muted: t } =
|
|
869
|
-
return t || r === 0 ? /* @__PURE__ */
|
|
870
|
-
|
|
893
|
+
), Te = { size: "100%" }, ut = z(() => {
|
|
894
|
+
var s;
|
|
895
|
+
const { volume: e, muted: t } = k(), { customIcons: n, elementRefs: a } = L(), r = e ?? ((s = a == null ? void 0 : a.audioEl) == null ? void 0 : s.volume) ?? 0, i = r > 0 && r <= 0.5;
|
|
896
|
+
return t || r === 0 ? /* @__PURE__ */ c(
|
|
897
|
+
D,
|
|
871
898
|
{
|
|
872
|
-
render: /* @__PURE__ */
|
|
899
|
+
render: /* @__PURE__ */ c(ot, { ...Te }),
|
|
873
900
|
customIcon: n == null ? void 0 : n.volumeMuted
|
|
874
901
|
}
|
|
875
|
-
) : i ? /* @__PURE__ */
|
|
876
|
-
|
|
902
|
+
) : i ? /* @__PURE__ */ c(
|
|
903
|
+
D,
|
|
877
904
|
{
|
|
878
|
-
render: /* @__PURE__ */
|
|
905
|
+
render: /* @__PURE__ */ c(nt, { ...Te }),
|
|
879
906
|
customIcon: n == null ? void 0 : n.volumeHalf
|
|
880
907
|
}
|
|
881
|
-
) : /* @__PURE__ */
|
|
882
|
-
|
|
908
|
+
) : /* @__PURE__ */ c(
|
|
909
|
+
D,
|
|
883
910
|
{
|
|
884
|
-
render: /* @__PURE__ */
|
|
911
|
+
render: /* @__PURE__ */ c(at, { ...Te }),
|
|
885
912
|
customIcon: n == null ? void 0 : n.volumeFull
|
|
886
913
|
}
|
|
887
914
|
);
|
|
888
915
|
});
|
|
889
|
-
|
|
890
|
-
const ie =
|
|
916
|
+
ut.displayName = "VolumeIcon";
|
|
917
|
+
const ie = K(null);
|
|
891
918
|
ie.displayName = "DrawerContext";
|
|
892
|
-
const
|
|
919
|
+
const dt = (e, t) => {
|
|
893
920
|
P(() => {
|
|
894
921
|
const n = (a) => {
|
|
895
922
|
const r = e.current, { target: i } = a;
|
|
@@ -897,7 +924,7 @@ const lt = (e, t) => {
|
|
|
897
924
|
};
|
|
898
925
|
return document.addEventListener("click", n), () => document.removeEventListener("click", n);
|
|
899
926
|
}, [e, t]);
|
|
900
|
-
},
|
|
927
|
+
}, oe = ({
|
|
901
928
|
outboundClickActive: e = !1,
|
|
902
929
|
placement: t = "bottom",
|
|
903
930
|
children: n,
|
|
@@ -905,165 +932,165 @@ const lt = (e, t) => {
|
|
|
905
932
|
onOpenChange: r,
|
|
906
933
|
initialOpen: i
|
|
907
934
|
}) => {
|
|
908
|
-
const
|
|
935
|
+
const s = S(null), [o, u] = te.Children.toArray(n), [d, l] = N(
|
|
909
936
|
a !== void 0 ? a : i ?? !1
|
|
910
|
-
),
|
|
911
|
-
|
|
937
|
+
), m = $e();
|
|
938
|
+
dt(s, () => {
|
|
912
939
|
e && (l(!1), r && r(!1));
|
|
913
940
|
}), P(() => {
|
|
914
941
|
a !== void 0 && l(a);
|
|
915
942
|
}, [a]);
|
|
916
|
-
const
|
|
917
|
-
() => ({ isOpen: d, setIsOpen: l, onOpenChange: r, drawerId:
|
|
918
|
-
[d, l, r,
|
|
943
|
+
const p = x(
|
|
944
|
+
() => ({ isOpen: d, setIsOpen: l, onOpenChange: r, drawerId: m }),
|
|
945
|
+
[d, l, r, m]
|
|
919
946
|
);
|
|
920
|
-
return /* @__PURE__ */
|
|
947
|
+
return /* @__PURE__ */ c("div", { className: "rmap-drawer-container", ref: s, children: /* @__PURE__ */ c(ie.Provider, { value: p, children: /* @__PURE__ */ w(G, { children: [
|
|
921
948
|
t === "top" && u,
|
|
922
|
-
|
|
949
|
+
o,
|
|
923
950
|
t === "bottom" && u
|
|
924
951
|
] }) }) });
|
|
925
|
-
},
|
|
952
|
+
}, pt = typeof window < "u", ge = pt ? Mt : P, Ce = ({
|
|
926
953
|
visible: e,
|
|
927
954
|
name: t,
|
|
928
955
|
leaveTime: n,
|
|
929
956
|
enterTime: a,
|
|
930
957
|
clearTime: r,
|
|
931
958
|
onExited: i,
|
|
932
|
-
onEntered:
|
|
933
|
-
children:
|
|
959
|
+
onEntered: s,
|
|
960
|
+
children: o
|
|
934
961
|
}) => {
|
|
935
|
-
const [u, d] =
|
|
936
|
-
return
|
|
937
|
-
|
|
938
|
-
}),
|
|
939
|
-
const
|
|
940
|
-
e && !l &&
|
|
962
|
+
const [u, d] = N(""), [l, m] = N(!1), p = S(s), v = S(i), f = S(t), y = S(a), T = S(n), h = S(r);
|
|
963
|
+
return ge(() => {
|
|
964
|
+
p.current = s, v.current = i, f.current = t, y.current = a, T.current = n, h.current = r;
|
|
965
|
+
}), ge(() => {
|
|
966
|
+
const g = e ? "enter" : "leave", C = f.current, W = e ? y.current : T.current;
|
|
967
|
+
e && !l && m(!0), d(`${C}-${g}`);
|
|
941
968
|
const se = setTimeout(() => {
|
|
942
|
-
var ce,
|
|
969
|
+
var ce, ae;
|
|
943
970
|
d(
|
|
944
|
-
`${
|
|
945
|
-
),
|
|
946
|
-
},
|
|
947
|
-
e || (d(
|
|
948
|
-
},
|
|
971
|
+
`${C}-${g} ${C}-${g}-active`
|
|
972
|
+
), g === "leave" ? (ce = v.current) == null || ce.call(v) : (ae = p.current) == null || ae.call(p);
|
|
973
|
+
}, W), R = setTimeout(() => {
|
|
974
|
+
e || (d(C), m(!1));
|
|
975
|
+
}, W + h.current);
|
|
949
976
|
return () => {
|
|
950
|
-
clearTimeout(se), clearTimeout(
|
|
977
|
+
clearTimeout(se), clearTimeout(R);
|
|
951
978
|
};
|
|
952
|
-
}, [e, l]), l ?
|
|
953
|
-
className: `${
|
|
979
|
+
}, [e, l]), l ? _t(o, {
|
|
980
|
+
className: `${o.props.className} ${u}`
|
|
954
981
|
}) : null;
|
|
955
|
-
},
|
|
982
|
+
}, Qt = 'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]), [role="button"]:not([aria-disabled="true"])', Jt = ({
|
|
956
983
|
children: e,
|
|
957
984
|
isWithAnimation: t = !0,
|
|
958
985
|
"aria-label": n = "Dialog"
|
|
959
986
|
}) => {
|
|
960
|
-
const { isOpen: a, setIsOpen: r, onOpenChange: i, drawerId:
|
|
987
|
+
const { isOpen: a, setIsOpen: r, onOpenChange: i, drawerId: s } = A(ie), o = S(null), u = S(null), d = E(
|
|
961
988
|
() => {
|
|
962
|
-
var
|
|
963
|
-
return (
|
|
989
|
+
var y;
|
|
990
|
+
return (y = o.current) == null ? void 0 : y.querySelectorAll(Qt);
|
|
964
991
|
},
|
|
965
992
|
[]
|
|
966
|
-
), l =
|
|
967
|
-
var
|
|
968
|
-
(T = (
|
|
969
|
-
}, [d]),
|
|
993
|
+
), l = E(() => {
|
|
994
|
+
var y, T;
|
|
995
|
+
(T = (y = d()) == null ? void 0 : y[0]) == null || T.focus();
|
|
996
|
+
}, [d]), m = E(() => {
|
|
970
997
|
u.current = document.activeElement, l();
|
|
971
|
-
}, [l]),
|
|
972
|
-
var
|
|
973
|
-
(
|
|
998
|
+
}, [l]), p = E(() => {
|
|
999
|
+
var y;
|
|
1000
|
+
(y = u.current) == null || y.focus();
|
|
974
1001
|
}, []);
|
|
975
1002
|
P(() => {
|
|
976
|
-
var
|
|
977
|
-
a && !t ? (u.current = document.activeElement, l()) : !a && !t && ((
|
|
1003
|
+
var y;
|
|
1004
|
+
a && !t ? (u.current = document.activeElement, l()) : !a && !t && ((y = u.current) == null || y.focus());
|
|
978
1005
|
}, [a, t, l]);
|
|
979
|
-
const
|
|
980
|
-
(
|
|
981
|
-
if (
|
|
1006
|
+
const v = E(
|
|
1007
|
+
(y) => {
|
|
1008
|
+
if (y.key === "Escape") {
|
|
982
1009
|
r(!1), i && i(!1);
|
|
983
1010
|
return;
|
|
984
1011
|
}
|
|
985
|
-
if (
|
|
1012
|
+
if (y.key === "Tab") {
|
|
986
1013
|
const T = d();
|
|
987
1014
|
if (!T || T.length === 0) return;
|
|
988
|
-
const h = T[0],
|
|
989
|
-
|
|
1015
|
+
const h = T[0], g = T[T.length - 1];
|
|
1016
|
+
y.shiftKey ? document.activeElement === h && (y.preventDefault(), g.focus()) : document.activeElement === g && (y.preventDefault(), h.focus());
|
|
990
1017
|
}
|
|
991
1018
|
},
|
|
992
1019
|
[r, i, d]
|
|
993
|
-
), f = /* @__PURE__ */
|
|
1020
|
+
), f = /* @__PURE__ */ c(
|
|
994
1021
|
"div",
|
|
995
1022
|
{
|
|
996
|
-
ref:
|
|
1023
|
+
ref: o,
|
|
997
1024
|
className: "rmap-drawer-content-container",
|
|
998
1025
|
role: "dialog",
|
|
999
1026
|
"aria-modal": "true",
|
|
1000
1027
|
"aria-label": n,
|
|
1001
|
-
id:
|
|
1002
|
-
onKeyDown:
|
|
1028
|
+
id: s,
|
|
1029
|
+
onKeyDown: v,
|
|
1003
1030
|
children: e
|
|
1004
1031
|
}
|
|
1005
1032
|
);
|
|
1006
|
-
return t ? /* @__PURE__ */
|
|
1007
|
-
|
|
1033
|
+
return t ? /* @__PURE__ */ c(
|
|
1034
|
+
Ce,
|
|
1008
1035
|
{
|
|
1009
1036
|
visible: a,
|
|
1010
1037
|
name: "rmap-drawer-content",
|
|
1011
1038
|
enterTime: 20,
|
|
1012
1039
|
leaveTime: 60,
|
|
1013
1040
|
clearTime: 300,
|
|
1014
|
-
onEntered:
|
|
1015
|
-
onExited:
|
|
1041
|
+
onEntered: m,
|
|
1042
|
+
onExited: p,
|
|
1016
1043
|
children: f
|
|
1017
1044
|
}
|
|
1018
1045
|
) : a ? f : null;
|
|
1019
|
-
},
|
|
1046
|
+
}, Zt = ({
|
|
1020
1047
|
children: e,
|
|
1021
1048
|
"aria-label": t,
|
|
1022
1049
|
"data-testid": n
|
|
1023
1050
|
}) => {
|
|
1024
|
-
const { isOpen: a, setIsOpen: r, onOpenChange: i, drawerId:
|
|
1051
|
+
const { isOpen: a, setIsOpen: r, onOpenChange: i, drawerId: s } = A(ie), o = E(() => {
|
|
1025
1052
|
const u = !a;
|
|
1026
1053
|
r(u), i == null || i(u);
|
|
1027
1054
|
}, [a, r, i]);
|
|
1028
|
-
return /* @__PURE__ */
|
|
1029
|
-
|
|
1055
|
+
return /* @__PURE__ */ c(
|
|
1056
|
+
q,
|
|
1030
1057
|
{
|
|
1031
1058
|
className: "rmap-drawer-trigger",
|
|
1032
1059
|
type: "button",
|
|
1033
1060
|
"aria-expanded": a,
|
|
1034
|
-
"aria-controls":
|
|
1061
|
+
"aria-controls": s,
|
|
1035
1062
|
"aria-label": t,
|
|
1036
1063
|
"data-testid": n,
|
|
1037
|
-
onClick:
|
|
1064
|
+
onClick: o,
|
|
1038
1065
|
children: e
|
|
1039
1066
|
}
|
|
1040
1067
|
);
|
|
1041
1068
|
};
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
const
|
|
1069
|
+
oe.Content = Jt;
|
|
1070
|
+
oe.Trigger = Zt;
|
|
1071
|
+
const Ee = ({ children: e }) => /* @__PURE__ */ c("ul", { className: "rmap-sortable-list-container", "aria-label": "Sortable list", children: e }), er = ({
|
|
1045
1072
|
index: e,
|
|
1046
1073
|
dragStartIdx: t,
|
|
1047
1074
|
listData: n,
|
|
1048
1075
|
draggable: a = !0,
|
|
1049
1076
|
onDragStart: r,
|
|
1050
1077
|
onDragOver: i,
|
|
1051
|
-
onDrop:
|
|
1052
|
-
onReorder:
|
|
1078
|
+
onDrop: s,
|
|
1079
|
+
onReorder: o,
|
|
1053
1080
|
onClick: u
|
|
1054
1081
|
}) => {
|
|
1055
|
-
const d = (l,
|
|
1082
|
+
const d = (l, m) => {
|
|
1056
1083
|
if (l < 0 || l >= n.length) return;
|
|
1057
|
-
const
|
|
1058
|
-
|
|
1059
|
-
const f =
|
|
1084
|
+
const p = [...n], v = p.splice(e, 1)[0];
|
|
1085
|
+
p.splice(l, 0, v);
|
|
1086
|
+
const f = p.map((T, h) => ({
|
|
1060
1087
|
...T,
|
|
1061
1088
|
index: h
|
|
1062
|
-
})),
|
|
1063
|
-
if (
|
|
1064
|
-
|
|
1065
|
-
}),
|
|
1066
|
-
const T =
|
|
1089
|
+
})), y = (m == null ? void 0 : m.parentElement) ?? null;
|
|
1090
|
+
if (Fe(() => {
|
|
1091
|
+
o == null || o(f);
|
|
1092
|
+
}), y) {
|
|
1093
|
+
const T = y.children[l];
|
|
1067
1094
|
T == null || T.focus();
|
|
1068
1095
|
}
|
|
1069
1096
|
};
|
|
@@ -1080,16 +1107,16 @@ const ge = ({ children: e }) => /* @__PURE__ */ s("ul", { className: "rmap-sorta
|
|
|
1080
1107
|
if (l.preventDefault(), a && l.altKey)
|
|
1081
1108
|
d(e - 1, l.currentTarget);
|
|
1082
1109
|
else {
|
|
1083
|
-
const
|
|
1084
|
-
|
|
1110
|
+
const m = l.currentTarget.previousElementSibling;
|
|
1111
|
+
m == null || m.focus();
|
|
1085
1112
|
}
|
|
1086
1113
|
break;
|
|
1087
1114
|
case "ArrowDown":
|
|
1088
1115
|
if (l.preventDefault(), a && l.altKey)
|
|
1089
1116
|
d(e + 1, l.currentTarget);
|
|
1090
1117
|
else {
|
|
1091
|
-
const
|
|
1092
|
-
|
|
1118
|
+
const m = l.currentTarget.nextElementSibling;
|
|
1119
|
+
m == null || m.focus();
|
|
1093
1120
|
}
|
|
1094
1121
|
break;
|
|
1095
1122
|
}
|
|
@@ -1111,40 +1138,40 @@ const ge = ({ children: e }) => /* @__PURE__ */ s("ul", { className: "rmap-sorta
|
|
|
1111
1138
|
},
|
|
1112
1139
|
onDrop: (l) => {
|
|
1113
1140
|
l.stopPropagation(), l.currentTarget.classList.remove("rmap-drag-over");
|
|
1114
|
-
const
|
|
1115
|
-
|
|
1116
|
-
const
|
|
1117
|
-
...
|
|
1118
|
-
|
|
1119
|
-
...
|
|
1120
|
-
].map((f,
|
|
1121
|
-
|
|
1141
|
+
const m = [...n], p = n[t];
|
|
1142
|
+
m.splice(t, 1);
|
|
1143
|
+
const v = [
|
|
1144
|
+
...m.slice(0, e),
|
|
1145
|
+
p,
|
|
1146
|
+
...m.slice(e, m.length)
|
|
1147
|
+
].map((f, y) => ({ ...f, index: y }));
|
|
1148
|
+
s == null || s(l, v);
|
|
1122
1149
|
},
|
|
1123
1150
|
onClick: (l) => {
|
|
1124
1151
|
l.stopPropagation(), u == null || u(l);
|
|
1125
1152
|
}
|
|
1126
1153
|
};
|
|
1127
|
-
},
|
|
1128
|
-
const { children: t, ...n } = e, a =
|
|
1129
|
-
return /* @__PURE__ */
|
|
1154
|
+
}, tr = (e) => {
|
|
1155
|
+
const { children: t, ...n } = e, a = er(n);
|
|
1156
|
+
return /* @__PURE__ */ c("li", { className: "rmap-sortable-item", ...a, children: /* @__PURE__ */ c("div", { className: "rmap-sortable-item-inner", children: t }) });
|
|
1130
1157
|
};
|
|
1131
|
-
|
|
1132
|
-
const
|
|
1133
|
-
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
const
|
|
1158
|
+
Ee.Item = tr;
|
|
1159
|
+
const xe = K(null);
|
|
1160
|
+
xe.displayName = "PlayListPortalContext";
|
|
1161
|
+
const Me = K(null);
|
|
1162
|
+
Me.displayName = "PlayListEmptyContext";
|
|
1163
|
+
const rr = z(function({
|
|
1137
1164
|
data: t
|
|
1138
1165
|
}) {
|
|
1139
|
-
const { curPlayId: n } =
|
|
1140
|
-
return /* @__PURE__ */
|
|
1166
|
+
const { curPlayId: n } = $(), { coverImgsCss: a } = L(), r = n === t.id;
|
|
1167
|
+
return /* @__PURE__ */ c(
|
|
1141
1168
|
"div",
|
|
1142
1169
|
{
|
|
1143
1170
|
className: `rmap-playlist-item${r ? " rmap-cur-played" : ""}`,
|
|
1144
1171
|
"data-testid": "playlist-item",
|
|
1145
1172
|
"aria-current": r ? "true" : void 0,
|
|
1146
1173
|
children: /* @__PURE__ */ w("div", { className: "rmap-playlist-item-contents", children: [
|
|
1147
|
-
/* @__PURE__ */
|
|
1174
|
+
/* @__PURE__ */ c("div", { className: "rmap-playlist-album-cover", children: t.img && /* @__PURE__ */ c(
|
|
1148
1175
|
"img",
|
|
1149
1176
|
{
|
|
1150
1177
|
src: t.img,
|
|
@@ -1153,22 +1180,22 @@ const er = G(function({
|
|
|
1153
1180
|
}
|
|
1154
1181
|
) }),
|
|
1155
1182
|
/* @__PURE__ */ w("div", { className: "rmap-playlist-album-info", children: [
|
|
1156
|
-
t.writer && /* @__PURE__ */
|
|
1157
|
-
t.name && /* @__PURE__ */
|
|
1158
|
-
t.description && /* @__PURE__ */
|
|
1183
|
+
t.writer && /* @__PURE__ */ c("span", { className: "rmap-playlist-writer", children: t.writer }),
|
|
1184
|
+
t.name && /* @__PURE__ */ c("span", { className: "rmap-playlist-title", children: t.name }),
|
|
1185
|
+
t.description && /* @__PURE__ */ c("div", { className: "rmap-playlist-description", children: t.description })
|
|
1159
1186
|
] })
|
|
1160
1187
|
] })
|
|
1161
1188
|
}
|
|
1162
1189
|
);
|
|
1163
|
-
}),
|
|
1190
|
+
}), ar = ({
|
|
1164
1191
|
setIsOpen: e
|
|
1165
1192
|
}) => {
|
|
1166
|
-
const { playList: t } =
|
|
1167
|
-
(
|
|
1193
|
+
const { playList: t } = $(), { activeUI: n } = M(), a = A(b), [r, i] = N(0), s = E(
|
|
1194
|
+
(o) => {
|
|
1168
1195
|
a({
|
|
1169
1196
|
type: "SET_CURRENT_AUDIO",
|
|
1170
|
-
currentIndex:
|
|
1171
|
-
currentAudioId: t[
|
|
1197
|
+
currentIndex: o,
|
|
1198
|
+
currentAudioId: t[o].id
|
|
1172
1199
|
});
|
|
1173
1200
|
},
|
|
1174
1201
|
[a, t]
|
|
@@ -1181,31 +1208,31 @@ const er = G(function({
|
|
|
1181
1208
|
sortableItemEventProps: {
|
|
1182
1209
|
draggable: n.playList !== "unSortable",
|
|
1183
1210
|
dragStartIdx: r,
|
|
1184
|
-
onDragStart: (
|
|
1185
|
-
onDrop: (
|
|
1211
|
+
onDragStart: (o) => i(o),
|
|
1212
|
+
onDrop: (o, u) => a({
|
|
1186
1213
|
type: "UPDATE_PLAY_LIST",
|
|
1187
1214
|
playList: u
|
|
1188
1215
|
}),
|
|
1189
|
-
onReorder: (
|
|
1216
|
+
onReorder: (o) => a({
|
|
1190
1217
|
type: "UPDATE_PLAY_LIST",
|
|
1191
|
-
playList:
|
|
1218
|
+
playList: o
|
|
1192
1219
|
}),
|
|
1193
|
-
onClick: (
|
|
1220
|
+
onClick: (o) => s(o)
|
|
1194
1221
|
}
|
|
1195
1222
|
};
|
|
1196
|
-
},
|
|
1197
|
-
const { playList: e } =
|
|
1223
|
+
}, nr = () => {
|
|
1224
|
+
const { playList: e } = $(), { isOpen: t, setIsOpen: n } = A(ie), a = he(xe), r = he(Me), { cssTransitionEventProps: i, sortableItemEventProps: s } = ar({
|
|
1198
1225
|
setIsOpen: n
|
|
1199
1226
|
}), {
|
|
1200
|
-
onClick:
|
|
1227
|
+
onClick: o,
|
|
1201
1228
|
onDragStart: u,
|
|
1202
1229
|
...d
|
|
1203
|
-
} =
|
|
1204
|
-
if (!a) return /* @__PURE__ */
|
|
1230
|
+
} = s;
|
|
1231
|
+
if (!a) return /* @__PURE__ */ c(G, {});
|
|
1205
1232
|
const l = e.length === 0;
|
|
1206
|
-
return l && !r ? /* @__PURE__ */
|
|
1207
|
-
/* @__PURE__ */
|
|
1208
|
-
|
|
1233
|
+
return l && !r ? /* @__PURE__ */ c(G, {}) : Rt.createPortal(
|
|
1234
|
+
/* @__PURE__ */ c(
|
|
1235
|
+
Ce,
|
|
1209
1236
|
{
|
|
1210
1237
|
visible: t,
|
|
1211
1238
|
name: "rmap-playlist-content",
|
|
@@ -1213,68 +1240,68 @@ const er = G(function({
|
|
|
1213
1240
|
leaveTime: 20,
|
|
1214
1241
|
clearTime: 300,
|
|
1215
1242
|
...i,
|
|
1216
|
-
children: /* @__PURE__ */
|
|
1217
|
-
|
|
1243
|
+
children: /* @__PURE__ */ c("div", { className: "rmap-playlist-container", children: l ? r : /* @__PURE__ */ c(Ee, { children: e.map((m, p) => /* @__PURE__ */ c(
|
|
1244
|
+
Ee.Item,
|
|
1218
1245
|
{
|
|
1219
|
-
index:
|
|
1246
|
+
index: p,
|
|
1220
1247
|
listData: e,
|
|
1221
|
-
onClick: () =>
|
|
1222
|
-
onDragStart: () => u(
|
|
1248
|
+
onClick: () => o(p),
|
|
1249
|
+
onDragStart: () => u(p),
|
|
1223
1250
|
...d,
|
|
1224
|
-
children: /* @__PURE__ */
|
|
1251
|
+
children: /* @__PURE__ */ c(rr, { data: m })
|
|
1225
1252
|
},
|
|
1226
|
-
|
|
1253
|
+
m.id
|
|
1227
1254
|
)) }) })
|
|
1228
1255
|
}
|
|
1229
1256
|
),
|
|
1230
1257
|
a
|
|
1231
1258
|
);
|
|
1232
|
-
},
|
|
1233
|
-
const { customIcons: e } =
|
|
1234
|
-
return /* @__PURE__ */
|
|
1235
|
-
|
|
1259
|
+
}, or = () => {
|
|
1260
|
+
const { customIcons: e } = L();
|
|
1261
|
+
return /* @__PURE__ */ c(
|
|
1262
|
+
D,
|
|
1236
1263
|
{
|
|
1237
|
-
render: /* @__PURE__ */
|
|
1264
|
+
render: /* @__PURE__ */ c(Je, { size: "100%" }),
|
|
1238
1265
|
customIcon: e == null ? void 0 : e.playList
|
|
1239
1266
|
}
|
|
1240
1267
|
);
|
|
1241
|
-
},
|
|
1268
|
+
}, mt = ({
|
|
1242
1269
|
initialExpanded: e,
|
|
1243
1270
|
gridArea: t,
|
|
1244
1271
|
visible: n,
|
|
1245
1272
|
...a
|
|
1246
1273
|
}) => {
|
|
1247
|
-
const { playListExpanded: r } =
|
|
1248
|
-
return /* @__PURE__ */
|
|
1249
|
-
/* @__PURE__ */
|
|
1250
|
-
|
|
1274
|
+
const { playListExpanded: r } = M(), i = e ?? r, s = B("playList", t);
|
|
1275
|
+
return /* @__PURE__ */ c(_.Item, { gridArea: s, visible: n ?? !0, ...a, children: /* @__PURE__ */ w(oe, { initialOpen: i, children: [
|
|
1276
|
+
/* @__PURE__ */ c(
|
|
1277
|
+
oe.Trigger,
|
|
1251
1278
|
{
|
|
1252
1279
|
"aria-label": "Playlist",
|
|
1253
1280
|
"data-testid": "playlist-trigger-btn",
|
|
1254
|
-
children: /* @__PURE__ */
|
|
1281
|
+
children: /* @__PURE__ */ c(or, {})
|
|
1255
1282
|
}
|
|
1256
1283
|
),
|
|
1257
|
-
/* @__PURE__ */
|
|
1284
|
+
/* @__PURE__ */ c(oe.Content, { "aria-label": "Playlist", children: /* @__PURE__ */ c(nr, {}) })
|
|
1258
1285
|
] }) });
|
|
1259
|
-
},
|
|
1286
|
+
}, ee = (e) => {
|
|
1260
1287
|
const t = `${Math.floor(e / 60)}`.padStart(2, "0"), n = `${Math.floor(e % 60)}`.padStart(2, "0");
|
|
1261
1288
|
return `${t}:${n}`;
|
|
1262
|
-
},
|
|
1289
|
+
}, pe = (e, t, n = 0) => {
|
|
1263
1290
|
if (!t) return n;
|
|
1264
1291
|
const a = e / t;
|
|
1265
1292
|
return isFinite(a) ? a : n;
|
|
1266
|
-
},
|
|
1267
|
-
const { isLoadedMetaData: e } =
|
|
1293
|
+
}, yt = () => {
|
|
1294
|
+
const { isLoadedMetaData: e } = k(), { elementRefs: t } = L(), [n, a] = N(!1), r = E(
|
|
1268
1295
|
(i) => {
|
|
1269
1296
|
if (!(t != null && t.audioEl) || !e) return;
|
|
1270
|
-
const { clientX:
|
|
1297
|
+
const { clientX: s } = i, { clientWidth: o } = i.currentTarget, u = i.currentTarget.getBoundingClientRect(), d = s - u.x, l = pe(d, o) * t.audioEl.duration;
|
|
1271
1298
|
t.audioEl.currentTime = l;
|
|
1272
1299
|
},
|
|
1273
1300
|
[e, t == null ? void 0 : t.audioEl]
|
|
1274
1301
|
);
|
|
1275
1302
|
return P(() => {
|
|
1276
1303
|
if (!n) return;
|
|
1277
|
-
const i = (
|
|
1304
|
+
const i = (s) => s.preventDefault();
|
|
1278
1305
|
return document.addEventListener("selectstart", i), () => {
|
|
1279
1306
|
document.removeEventListener("selectstart", i);
|
|
1280
1307
|
};
|
|
@@ -1285,9 +1312,9 @@ const er = G(function({
|
|
|
1285
1312
|
onMouseMove: n ? r : void 0,
|
|
1286
1313
|
onClick: r
|
|
1287
1314
|
};
|
|
1288
|
-
},
|
|
1289
|
-
const { isLoadedMetaData: t } =
|
|
1290
|
-
return
|
|
1315
|
+
}, vt = (e) => {
|
|
1316
|
+
const { isLoadedMetaData: t } = k(), { elementRefs: n } = L();
|
|
1317
|
+
return E(
|
|
1291
1318
|
(a) => {
|
|
1292
1319
|
if (!(n != null && n.audioEl) || !t) return;
|
|
1293
1320
|
const r = n.audioEl;
|
|
@@ -1312,18 +1339,18 @@ const er = G(function({
|
|
|
1312
1339
|
},
|
|
1313
1340
|
[n == null ? void 0 : n.audioEl, t, e]
|
|
1314
1341
|
);
|
|
1315
|
-
},
|
|
1316
|
-
const { currentTime: e, duration: t } =
|
|
1342
|
+
}, ir = () => {
|
|
1343
|
+
const { currentTime: e, duration: t } = re(), n = S(null), [a, r] = N(0);
|
|
1317
1344
|
P(() => {
|
|
1318
1345
|
const d = n.current;
|
|
1319
1346
|
if (!d) return;
|
|
1320
1347
|
r(d.offsetWidth);
|
|
1321
|
-
const l = new ResizeObserver(([
|
|
1322
|
-
r(
|
|
1348
|
+
const l = new ResizeObserver(([m]) => {
|
|
1349
|
+
r(m.contentBoxSize[0].inlineSize);
|
|
1323
1350
|
});
|
|
1324
1351
|
return l.observe(d), () => l.disconnect();
|
|
1325
1352
|
}, []);
|
|
1326
|
-
const i =
|
|
1353
|
+
const i = pe(e, t), s = yt(), o = vt(), u = i * a;
|
|
1327
1354
|
return /* @__PURE__ */ w(
|
|
1328
1355
|
"div",
|
|
1329
1356
|
{
|
|
@@ -1336,20 +1363,20 @@ const er = G(function({
|
|
|
1336
1363
|
"aria-valuemin": 0,
|
|
1337
1364
|
"aria-valuemax": 100,
|
|
1338
1365
|
"aria-valuenow": Math.round(i * 100),
|
|
1339
|
-
"aria-valuetext": `${
|
|
1366
|
+
"aria-valuetext": `${ee(
|
|
1340
1367
|
e
|
|
1341
|
-
)} of ${
|
|
1342
|
-
onKeyDown:
|
|
1343
|
-
...
|
|
1368
|
+
)} of ${ee(t)}`,
|
|
1369
|
+
onKeyDown: o,
|
|
1370
|
+
...s,
|
|
1344
1371
|
children: [
|
|
1345
|
-
/* @__PURE__ */
|
|
1372
|
+
/* @__PURE__ */ c("div", { className: "rmap-progress-bar", children: /* @__PURE__ */ c(
|
|
1346
1373
|
"div",
|
|
1347
1374
|
{
|
|
1348
1375
|
className: "rmap-progress-fill",
|
|
1349
1376
|
style: { transform: `scaleX(${i})` }
|
|
1350
1377
|
}
|
|
1351
1378
|
) }),
|
|
1352
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ c(
|
|
1353
1380
|
"div",
|
|
1354
1381
|
{
|
|
1355
1382
|
className: "rmap-progress-handle",
|
|
@@ -1361,65 +1388,65 @@ const er = G(function({
|
|
|
1361
1388
|
]
|
|
1362
1389
|
}
|
|
1363
1390
|
);
|
|
1364
|
-
},
|
|
1365
|
-
const n =
|
|
1391
|
+
}, sr = (e, t) => {
|
|
1392
|
+
const n = S(), a = E(() => {
|
|
1366
1393
|
const r = document.getElementsByClassName("rmap-player-provider")[0];
|
|
1367
1394
|
if (!r) return;
|
|
1368
1395
|
const i = Object.entries(
|
|
1369
1396
|
e
|
|
1370
1397
|
).reduce(
|
|
1371
|
-
(
|
|
1372
|
-
...
|
|
1373
|
-
[
|
|
1398
|
+
(s, [o, u]) => ({
|
|
1399
|
+
...s,
|
|
1400
|
+
[o]: window.getComputedStyle(r).getPropertyValue(`${u}`)
|
|
1374
1401
|
}),
|
|
1375
1402
|
{}
|
|
1376
1403
|
);
|
|
1377
1404
|
n.current = i;
|
|
1378
1405
|
}, [e]);
|
|
1379
|
-
return
|
|
1406
|
+
return ge(() => {
|
|
1380
1407
|
a();
|
|
1381
1408
|
const r = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1382
1409
|
return r.addEventListener("change", a), () => r.removeEventListener("change", a);
|
|
1383
1410
|
}, [a, t]), n;
|
|
1384
|
-
},
|
|
1411
|
+
}, cr = {
|
|
1385
1412
|
progressColor: "--rm-audio-player-waveform-bar",
|
|
1386
1413
|
waveColor: "--rm-audio-player-waveform-background"
|
|
1387
|
-
},
|
|
1414
|
+
}, lr = (e) => {
|
|
1388
1415
|
const t = e.backend;
|
|
1389
1416
|
if (!(!(t != null && t.media) || !t.mediaListeners))
|
|
1390
1417
|
for (const [n, a] of Object.entries(t.mediaListeners))
|
|
1391
1418
|
t.media.removeEventListener(n, a);
|
|
1392
|
-
},
|
|
1393
|
-
const t =
|
|
1394
|
-
|
|
1395
|
-
var
|
|
1396
|
-
if (r != null && r.waveformInst || !((
|
|
1419
|
+
}, ur = (e) => {
|
|
1420
|
+
const t = A(b), { isPlaying: n } = k(), { curPlayId: a } = $(), { elementRefs: r } = L(), { colorScheme: i } = M(), s = sr(cr, i), o = S(r == null ? void 0 : r.waveformInst);
|
|
1421
|
+
o.current = r == null ? void 0 : r.waveformInst, P(() => {
|
|
1422
|
+
var v, f;
|
|
1423
|
+
if (r != null && r.waveformInst || !((v = s.current) != null && v.progressColor) || !((f = s.current) != null && f.waveColor))
|
|
1397
1424
|
return;
|
|
1398
|
-
let
|
|
1399
|
-
return import("./wavesurfer-_j5aw4gZ.mjs").then((
|
|
1400
|
-
var h,
|
|
1401
|
-
if (
|
|
1425
|
+
let p = !1;
|
|
1426
|
+
return import("./wavesurfer-_j5aw4gZ.mjs").then((y) => y.w).then(({ default: y }) => {
|
|
1427
|
+
var h, g;
|
|
1428
|
+
if (p || !e.current || !((h = s.current) != null && h.progressColor) || !((g = s.current) != null && g.waveColor)) {
|
|
1402
1429
|
console.error("[useWaveSurfer] missing required dependencies");
|
|
1403
1430
|
return;
|
|
1404
1431
|
}
|
|
1405
1432
|
let T;
|
|
1406
1433
|
try {
|
|
1407
|
-
T =
|
|
1434
|
+
T = y.create({
|
|
1408
1435
|
barWidth: 1,
|
|
1409
1436
|
cursorWidth: 2,
|
|
1410
1437
|
container: e.current,
|
|
1411
1438
|
height: 80,
|
|
1412
|
-
progressColor:
|
|
1439
|
+
progressColor: s.current.progressColor,
|
|
1413
1440
|
responsive: !0,
|
|
1414
|
-
waveColor:
|
|
1441
|
+
waveColor: s.current.waveColor,
|
|
1415
1442
|
cursorColor: "var(--rm-audio-player-waveform-cursor)",
|
|
1416
1443
|
backend: "MediaElement",
|
|
1417
1444
|
removeMediaElementOnDestroy: !1
|
|
1418
1445
|
});
|
|
1419
|
-
} catch (
|
|
1446
|
+
} catch (C) {
|
|
1420
1447
|
console.error(
|
|
1421
1448
|
"[useWaveSurfer] failed to create WaveSurfer instance",
|
|
1422
|
-
|
|
1449
|
+
C
|
|
1423
1450
|
);
|
|
1424
1451
|
return;
|
|
1425
1452
|
}
|
|
@@ -1427,41 +1454,41 @@ const er = G(function({
|
|
|
1427
1454
|
type: "SET_ELEMENT_REFS",
|
|
1428
1455
|
elementRefs: { waveformInst: T }
|
|
1429
1456
|
});
|
|
1430
|
-
}).catch((
|
|
1431
|
-
console.error("[useWaveSurfer] failed to load wavesurfer.js",
|
|
1457
|
+
}).catch((y) => {
|
|
1458
|
+
console.error("[useWaveSurfer] failed to load wavesurfer.js", y);
|
|
1432
1459
|
}), () => {
|
|
1433
|
-
|
|
1460
|
+
p = !0;
|
|
1434
1461
|
};
|
|
1435
|
-
}, [r == null ? void 0 : r.waveformInst, t,
|
|
1436
|
-
const u =
|
|
1462
|
+
}, [r == null ? void 0 : r.waveformInst, t, s]);
|
|
1463
|
+
const u = S(a);
|
|
1437
1464
|
P(() => {
|
|
1438
1465
|
if (!(r != null && r.audioEl) || !(r != null && r.waveformInst)) return;
|
|
1439
|
-
const
|
|
1440
|
-
if (!
|
|
1441
|
-
const
|
|
1466
|
+
const p = r.audioEl;
|
|
1467
|
+
if (!p.getAttribute("src")) return;
|
|
1468
|
+
const v = r.waveformInst, f = u.current !== a;
|
|
1442
1469
|
u.current = a;
|
|
1443
|
-
const
|
|
1444
|
-
|
|
1470
|
+
const y = f ? 0 : p.currentTime, T = n;
|
|
1471
|
+
lr(v), v.load(p);
|
|
1445
1472
|
const h = () => {
|
|
1446
|
-
!f &&
|
|
1473
|
+
!f && y > 0 && p.duration && (p.currentTime = y, v.seekTo(y / p.duration)), T && p.play();
|
|
1447
1474
|
};
|
|
1448
|
-
return
|
|
1449
|
-
|
|
1475
|
+
return v.on("ready", h), () => {
|
|
1476
|
+
v.un("ready", h);
|
|
1450
1477
|
};
|
|
1451
1478
|
}, [a, r == null ? void 0 : r.audioEl, r == null ? void 0 : r.waveformInst]), P(() => {
|
|
1452
1479
|
if (!e.current || !(r != null && r.waveformInst)) return;
|
|
1453
|
-
const
|
|
1454
|
-
var f,
|
|
1455
|
-
(
|
|
1456
|
-
},
|
|
1457
|
-
return
|
|
1458
|
-
|
|
1480
|
+
const p = () => {
|
|
1481
|
+
var f, y;
|
|
1482
|
+
(y = (f = r.waveformInst) == null ? void 0 : f.drawer) == null || y.fireEvent("redraw");
|
|
1483
|
+
}, v = new ResizeObserver(p);
|
|
1484
|
+
return v.observe(e.current), () => {
|
|
1485
|
+
v.disconnect();
|
|
1459
1486
|
};
|
|
1460
1487
|
}, [r == null ? void 0 : r.waveformInst, e]), P(
|
|
1461
1488
|
() => () => {
|
|
1462
|
-
var
|
|
1463
|
-
const
|
|
1464
|
-
|
|
1489
|
+
var v, f;
|
|
1490
|
+
const p = (v = e.current) == null ? void 0 : v.querySelector("wave");
|
|
1491
|
+
p && p.remove(), (f = o.current) == null || f.destroy(), t({
|
|
1465
1492
|
type: "SET_ELEMENT_REFS",
|
|
1466
1493
|
elementRefs: { waveformInst: void 0 }
|
|
1467
1494
|
});
|
|
@@ -1470,31 +1497,31 @@ const er = G(function({
|
|
|
1470
1497
|
[t]
|
|
1471
1498
|
);
|
|
1472
1499
|
const d = () => {
|
|
1473
|
-
var
|
|
1474
|
-
const
|
|
1475
|
-
if (!(
|
|
1476
|
-
const
|
|
1477
|
-
|
|
1478
|
-
}, l =
|
|
1500
|
+
var y, T;
|
|
1501
|
+
const p = o.current;
|
|
1502
|
+
if (!(p != null && p.isReady)) return;
|
|
1503
|
+
const v = (y = s.current) == null ? void 0 : y.waveColor, f = (T = s.current) == null ? void 0 : T.progressColor;
|
|
1504
|
+
v && p.setWaveColor(v), f && p.setProgressColor(f);
|
|
1505
|
+
}, l = S(d);
|
|
1479
1506
|
l.current = d;
|
|
1480
|
-
const
|
|
1507
|
+
const m = S(i);
|
|
1481
1508
|
P(() => {
|
|
1482
|
-
|
|
1509
|
+
m.current !== i && (m.current = i, l.current());
|
|
1483
1510
|
}, [i, r == null ? void 0 : r.waveformInst]), P(() => {
|
|
1484
|
-
const
|
|
1485
|
-
return
|
|
1511
|
+
const p = () => l.current(), v = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1512
|
+
return v.addEventListener("change", p), () => v.removeEventListener("change", p);
|
|
1486
1513
|
}, []);
|
|
1487
|
-
},
|
|
1488
|
-
var u, d, l,
|
|
1489
|
-
const t =
|
|
1490
|
-
|
|
1514
|
+
}, dr = ({ isActive: e }) => {
|
|
1515
|
+
var u, d, l, m;
|
|
1516
|
+
const t = S(null), { isLoadedMetaData: n, isPlaying: a } = k(), { elementRefs: r } = L();
|
|
1517
|
+
ur(t), P(() => {
|
|
1491
1518
|
if (!e || !(r != null && r.waveformInst) || !(r != null && r.audioEl) || !n || a)
|
|
1492
1519
|
return;
|
|
1493
|
-
const
|
|
1520
|
+
const p = pe(
|
|
1494
1521
|
r.audioEl.currentTime,
|
|
1495
1522
|
r.audioEl.duration
|
|
1496
1523
|
);
|
|
1497
|
-
r.waveformInst.seekTo(
|
|
1524
|
+
r.waveformInst.seekTo(p);
|
|
1498
1525
|
}, [
|
|
1499
1526
|
e,
|
|
1500
1527
|
n,
|
|
@@ -1502,14 +1529,14 @@ const er = G(function({
|
|
|
1502
1529
|
r == null ? void 0 : r.audioEl,
|
|
1503
1530
|
a
|
|
1504
1531
|
]);
|
|
1505
|
-
const i =
|
|
1506
|
-
(
|
|
1532
|
+
const i = yt(), s = E(
|
|
1533
|
+
(p, v) => {
|
|
1507
1534
|
var f;
|
|
1508
|
-
|
|
1535
|
+
v && ((f = r == null ? void 0 : r.waveformInst) == null || f.seekTo(pe(p, v)));
|
|
1509
1536
|
},
|
|
1510
1537
|
[r == null ? void 0 : r.waveformInst]
|
|
1511
|
-
),
|
|
1512
|
-
return /* @__PURE__ */
|
|
1538
|
+
), o = vt(s);
|
|
1539
|
+
return /* @__PURE__ */ c("div", { className: "rmap-waveform-wrapper", "data-active": e, children: /* @__PURE__ */ c(
|
|
1513
1540
|
"div",
|
|
1514
1541
|
{
|
|
1515
1542
|
id: "rm-waveform",
|
|
@@ -1522,105 +1549,60 @@ const er = G(function({
|
|
|
1522
1549
|
"aria-valuenow": Math.round(
|
|
1523
1550
|
(((u = r == null ? void 0 : r.audioEl) == null ? void 0 : u.currentTime) ?? 0) / (((d = r == null ? void 0 : r.audioEl) == null ? void 0 : d.duration) || 1) * 100
|
|
1524
1551
|
),
|
|
1525
|
-
"aria-valuetext": `${
|
|
1552
|
+
"aria-valuetext": `${ee(
|
|
1526
1553
|
((l = r == null ? void 0 : r.audioEl) == null ? void 0 : l.currentTime) ?? 0
|
|
1527
|
-
)} of ${
|
|
1528
|
-
onKeyDown:
|
|
1554
|
+
)} of ${ee(((m = r == null ? void 0 : r.audioEl) == null ? void 0 : m.duration) ?? 0)}`,
|
|
1555
|
+
onKeyDown: o,
|
|
1529
1556
|
...i
|
|
1530
1557
|
}
|
|
1531
1558
|
) });
|
|
1532
|
-
},
|
|
1559
|
+
}, ft = ({
|
|
1533
1560
|
gridArea: e,
|
|
1534
1561
|
visible: t,
|
|
1535
1562
|
type: n,
|
|
1536
1563
|
width: a,
|
|
1537
1564
|
...r
|
|
1538
1565
|
}) => {
|
|
1539
|
-
const { activeUI: i } =
|
|
1566
|
+
const { activeUI: i } = M(), s = n ?? (i.progress === "waveform" ? "waveform" : "bar"), o = s === "waveform", u = s === "bar", [d, l] = N(o);
|
|
1540
1567
|
P(() => {
|
|
1541
|
-
|
|
1542
|
-
}, [
|
|
1543
|
-
const
|
|
1544
|
-
return /* @__PURE__ */
|
|
1568
|
+
o && !d && l(!0);
|
|
1569
|
+
}, [o, d]);
|
|
1570
|
+
const m = B("progress", e);
|
|
1571
|
+
return /* @__PURE__ */ c(
|
|
1545
1572
|
_.Item,
|
|
1546
1573
|
{
|
|
1547
|
-
gridArea:
|
|
1574
|
+
gridArea: m,
|
|
1548
1575
|
width: a ?? "100%",
|
|
1549
1576
|
visible: t ?? !0,
|
|
1550
1577
|
...r,
|
|
1551
1578
|
children: /* @__PURE__ */ w("div", { className: "rmap-progress-container", children: [
|
|
1552
|
-
d && /* @__PURE__ */
|
|
1553
|
-
u && /* @__PURE__ */
|
|
1579
|
+
d && /* @__PURE__ */ c(dr, { isActive: o }),
|
|
1580
|
+
u && /* @__PURE__ */ c(ir, {})
|
|
1554
1581
|
] })
|
|
1555
1582
|
}
|
|
1556
1583
|
);
|
|
1557
|
-
},
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
var p;
|
|
1561
|
-
const t = A(null), { volume: n, muted: a } = C(), { elementRefs: r } = N(), i = E(L), o = g(
|
|
1562
|
-
(m) => {
|
|
1563
|
-
m.stopPropagation(), m.preventDefault(), a && i({ type: "SET_MUTED", muted: !1 });
|
|
1564
|
-
const { value: y } = m.target, f = parseFloat(y);
|
|
1565
|
-
i({
|
|
1566
|
-
type: "SET_VOLUME",
|
|
1567
|
-
volume: f
|
|
1568
|
-
});
|
|
1569
|
-
},
|
|
1570
|
-
[a, i]
|
|
1571
|
-
), c = n ?? ((p = r == null ? void 0 : r.audioEl) == null ? void 0 : p.volume) ?? 0, u = c * 100, d = Math.round(u), l = k(
|
|
1572
|
-
() => ({
|
|
1573
|
-
"--rm-audio-player-volume-value": `${u}%`
|
|
1574
|
-
}),
|
|
1575
|
-
[u]
|
|
1576
|
-
);
|
|
1577
|
-
return /* @__PURE__ */ s(
|
|
1578
|
-
"div",
|
|
1579
|
-
{
|
|
1580
|
-
ref: t,
|
|
1581
|
-
className: "rmap-volume-container",
|
|
1582
|
-
"data-placement": e,
|
|
1583
|
-
"data-testid": "volume-slider",
|
|
1584
|
-
style: l,
|
|
1585
|
-
children: /* @__PURE__ */ s("div", { className: "rmap-volume-panel", children: /* @__PURE__ */ s(
|
|
1586
|
-
"input",
|
|
1587
|
-
{
|
|
1588
|
-
className: "rmap-volume-slider",
|
|
1589
|
-
type: "range",
|
|
1590
|
-
style: { cursor: "pointer" },
|
|
1591
|
-
value: c,
|
|
1592
|
-
onChange: o,
|
|
1593
|
-
min: "0",
|
|
1594
|
-
max: "1",
|
|
1595
|
-
step: "0.01",
|
|
1596
|
-
"aria-label": a ? "Volume (muted)" : "Volume",
|
|
1597
|
-
"aria-valuetext": `${d} percent`
|
|
1598
|
-
}
|
|
1599
|
-
) })
|
|
1600
|
-
}
|
|
1601
|
-
);
|
|
1602
|
-
}, pe = O(null);
|
|
1603
|
-
pe.displayName = "DropdownContext";
|
|
1604
|
-
const vt = ({
|
|
1584
|
+
}, me = K(null);
|
|
1585
|
+
me.displayName = "DropdownContext";
|
|
1586
|
+
const Tt = ({
|
|
1605
1587
|
clickArea: e,
|
|
1606
1588
|
triggerType: t,
|
|
1607
1589
|
isOpen: n,
|
|
1608
1590
|
setIsOpen: a,
|
|
1609
1591
|
onOpenChange: r
|
|
1610
1592
|
}) => {
|
|
1611
|
-
const i =
|
|
1612
|
-
const
|
|
1593
|
+
const i = S(), s = (l) => {
|
|
1594
|
+
const m = () => {
|
|
1613
1595
|
clearTimeout(i.current), i.current = void 0;
|
|
1614
|
-
},
|
|
1615
|
-
a(
|
|
1596
|
+
}, p = (v) => {
|
|
1597
|
+
a(v), r && r(v), m();
|
|
1616
1598
|
};
|
|
1617
|
-
if (
|
|
1618
|
-
i.current = window.setTimeout(() =>
|
|
1599
|
+
if (m(), l) {
|
|
1600
|
+
i.current = window.setTimeout(() => p(!0), 100);
|
|
1619
1601
|
return;
|
|
1620
1602
|
}
|
|
1621
|
-
i.current = window.setTimeout(() =>
|
|
1622
|
-
},
|
|
1623
|
-
t === "hover" &&
|
|
1603
|
+
i.current = window.setTimeout(() => p(!1), 100);
|
|
1604
|
+
}, o = (l) => {
|
|
1605
|
+
t === "hover" && s(l);
|
|
1624
1606
|
};
|
|
1625
1607
|
return {
|
|
1626
1608
|
onClick: e === "content" ? (l) => {
|
|
@@ -1628,56 +1610,56 @@ const vt = ({
|
|
|
1628
1610
|
} : () => {
|
|
1629
1611
|
t === "click" && (a(!n), r && r(!n));
|
|
1630
1612
|
},
|
|
1631
|
-
onKeyUp: () =>
|
|
1632
|
-
onMouseEnter: () =>
|
|
1633
|
-
onMouseLeave: () =>
|
|
1634
|
-
onFocus: () =>
|
|
1635
|
-
onBlur: () =>
|
|
1613
|
+
onKeyUp: () => o(!0),
|
|
1614
|
+
onMouseEnter: () => o(!0),
|
|
1615
|
+
onMouseLeave: () => o(!1),
|
|
1616
|
+
onFocus: () => o(!0),
|
|
1617
|
+
onBlur: () => o(!1)
|
|
1636
1618
|
};
|
|
1637
|
-
},
|
|
1619
|
+
}, j = ({
|
|
1638
1620
|
triggerType: e = "click",
|
|
1639
1621
|
outboundClickActive: t = !0,
|
|
1640
1622
|
children: n,
|
|
1641
1623
|
isOpen: a,
|
|
1642
1624
|
placement: r = "bottom",
|
|
1643
1625
|
disabled: i = !1,
|
|
1644
|
-
onOpenChange:
|
|
1645
|
-
"data-testid":
|
|
1626
|
+
onOpenChange: s,
|
|
1627
|
+
"data-testid": o
|
|
1646
1628
|
}) => {
|
|
1647
|
-
const u =
|
|
1648
|
-
setIsOpen:
|
|
1649
|
-
isOpen:
|
|
1629
|
+
const u = S(null), [d, l] = te.Children.toArray(n), [m, p] = N(!1), v = Tt({
|
|
1630
|
+
setIsOpen: p,
|
|
1631
|
+
isOpen: m,
|
|
1650
1632
|
triggerType: e,
|
|
1651
1633
|
clickArea: "root"
|
|
1652
|
-
}), f =
|
|
1653
|
-
|
|
1654
|
-
a !== void 0 &&
|
|
1634
|
+
}), f = $e();
|
|
1635
|
+
dt(u, () => t && p(!1)), P(() => {
|
|
1636
|
+
a !== void 0 && p(a);
|
|
1655
1637
|
}, [a]);
|
|
1656
|
-
const
|
|
1638
|
+
const y = x(
|
|
1657
1639
|
() => ({
|
|
1658
1640
|
dropdownRef: u,
|
|
1659
1641
|
placement: r,
|
|
1660
|
-
isOpen:
|
|
1661
|
-
setIsOpen:
|
|
1662
|
-
onOpenChange:
|
|
1642
|
+
isOpen: m,
|
|
1643
|
+
setIsOpen: p,
|
|
1644
|
+
onOpenChange: s,
|
|
1663
1645
|
dropdownId: f
|
|
1664
1646
|
}),
|
|
1665
|
-
[r,
|
|
1647
|
+
[r, m, s, f]
|
|
1666
1648
|
);
|
|
1667
|
-
return /* @__PURE__ */
|
|
1649
|
+
return /* @__PURE__ */ c(me.Provider, { value: y, children: /* @__PURE__ */ c(
|
|
1668
1650
|
"div",
|
|
1669
1651
|
{
|
|
1670
1652
|
className: "rmap-dropdown-container",
|
|
1671
1653
|
ref: u,
|
|
1672
|
-
"data-testid":
|
|
1673
|
-
...
|
|
1674
|
-
children: /* @__PURE__ */ w(
|
|
1654
|
+
"data-testid": o,
|
|
1655
|
+
...v,
|
|
1656
|
+
children: /* @__PURE__ */ w(G, { children: [
|
|
1675
1657
|
d,
|
|
1676
1658
|
!i && l
|
|
1677
1659
|
] })
|
|
1678
1660
|
}
|
|
1679
1661
|
) });
|
|
1680
|
-
},
|
|
1662
|
+
}, pr = (e, t) => x(() => {
|
|
1681
1663
|
if (t)
|
|
1682
1664
|
return {
|
|
1683
1665
|
position: "absolute",
|
|
@@ -1693,46 +1675,46 @@ const vt = ({
|
|
|
1693
1675
|
isWithAnimation: t = !0,
|
|
1694
1676
|
...n
|
|
1695
1677
|
}) => {
|
|
1696
|
-
const { dropdownRef: a, placement: r, isOpen: i, setIsOpen:
|
|
1697
|
-
setIsOpen:
|
|
1678
|
+
const { dropdownRef: a, placement: r, isOpen: i, setIsOpen: s, dropdownId: o } = A(me), [u, d] = N(), { onClick: l } = Tt({
|
|
1679
|
+
setIsOpen: s,
|
|
1698
1680
|
isOpen: i,
|
|
1699
1681
|
clickArea: "content"
|
|
1700
|
-
}),
|
|
1682
|
+
}), m = () => s(!1), p = () => s(!0);
|
|
1701
1683
|
P(() => {
|
|
1702
1684
|
a.current && d({
|
|
1703
1685
|
width: a.current.offsetWidth,
|
|
1704
1686
|
height: a.current.offsetHeight
|
|
1705
1687
|
});
|
|
1706
1688
|
}, [a]);
|
|
1707
|
-
const
|
|
1689
|
+
const v = pr(r, u), f = u ? /* @__PURE__ */ c(
|
|
1708
1690
|
"div",
|
|
1709
1691
|
{
|
|
1710
1692
|
...n,
|
|
1711
|
-
id:
|
|
1712
|
-
style: { ...
|
|
1693
|
+
id: o,
|
|
1694
|
+
style: { ...v, ...n.style },
|
|
1713
1695
|
onClick: l,
|
|
1714
1696
|
children: e
|
|
1715
1697
|
}
|
|
1716
1698
|
) : null;
|
|
1717
|
-
return t ? /* @__PURE__ */
|
|
1718
|
-
|
|
1699
|
+
return t ? /* @__PURE__ */ c(
|
|
1700
|
+
Ce,
|
|
1719
1701
|
{
|
|
1720
1702
|
visible: i,
|
|
1721
1703
|
name: "rmap-dropdown-content",
|
|
1722
1704
|
enterTime: 20,
|
|
1723
1705
|
leaveTime: 60,
|
|
1724
1706
|
clearTime: 300,
|
|
1725
|
-
onExited:
|
|
1726
|
-
onEntered:
|
|
1707
|
+
onExited: m,
|
|
1708
|
+
onEntered: p,
|
|
1727
1709
|
children: f
|
|
1728
1710
|
}
|
|
1729
1711
|
) : i ? f : null;
|
|
1730
|
-
},
|
|
1731
|
-
const { isOpen: r, dropdownId: i } =
|
|
1732
|
-
return /* @__PURE__ */
|
|
1733
|
-
|
|
1712
|
+
}, ht = Pe(({ children: e, className: t, ...n }, a) => {
|
|
1713
|
+
const { isOpen: r, dropdownId: i } = A(me), s = t ? `rmap-dropdown-trigger ${t}` : "rmap-dropdown-trigger";
|
|
1714
|
+
return /* @__PURE__ */ c(
|
|
1715
|
+
q,
|
|
1734
1716
|
{
|
|
1735
|
-
className:
|
|
1717
|
+
className: s,
|
|
1736
1718
|
type: "button",
|
|
1737
1719
|
...n,
|
|
1738
1720
|
"aria-haspopup": "true",
|
|
@@ -1743,103 +1725,263 @@ const vt = ({
|
|
|
1743
1725
|
}
|
|
1744
1726
|
);
|
|
1745
1727
|
});
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
const
|
|
1728
|
+
ht.displayName = "DropdownTrigger";
|
|
1729
|
+
j.Content = mr;
|
|
1730
|
+
j.Trigger = ht;
|
|
1731
|
+
const yr = ({
|
|
1750
1732
|
triggerRef: e,
|
|
1751
1733
|
initialState: t
|
|
1752
1734
|
}) => {
|
|
1753
|
-
const { playerPlacement: n } =
|
|
1735
|
+
const { playerPlacement: n } = M(), [a, r] = N(t);
|
|
1754
1736
|
return P(() => {
|
|
1755
1737
|
if (e.current) {
|
|
1756
|
-
const i = () => e.current.getBoundingClientRect().top < window.innerHeight / 2 ? "bottom" : "top",
|
|
1738
|
+
const i = () => e.current.getBoundingClientRect().top < window.innerHeight / 2 ? "bottom" : "top", s = setTimeout(() => {
|
|
1757
1739
|
r(i());
|
|
1758
1740
|
}, 0);
|
|
1759
1741
|
return () => {
|
|
1760
|
-
clearTimeout(
|
|
1742
|
+
clearTimeout(s);
|
|
1761
1743
|
};
|
|
1762
1744
|
}
|
|
1763
1745
|
}, [n, e]), a;
|
|
1764
|
-
},
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1746
|
+
}, gt = ({
|
|
1747
|
+
triggerType: e,
|
|
1748
|
+
placement: t,
|
|
1749
|
+
contextPlacement: n,
|
|
1750
|
+
triggerRef: a,
|
|
1751
|
+
defaults: r
|
|
1752
|
+
}) => {
|
|
1753
|
+
const i = yr({
|
|
1772
1754
|
triggerRef: a,
|
|
1773
|
-
initialState:
|
|
1774
|
-
}),
|
|
1775
|
-
return
|
|
1776
|
-
|
|
1755
|
+
initialState: r.placement
|
|
1756
|
+
}), s = e ?? r.triggerType;
|
|
1757
|
+
return {
|
|
1758
|
+
triggerType: s,
|
|
1759
|
+
placement: t ?? n ?? i,
|
|
1760
|
+
contentRole: s === "hover" ? "tooltip" : "dialog"
|
|
1761
|
+
};
|
|
1762
|
+
}, vr = [
|
|
1763
|
+
0.5,
|
|
1764
|
+
0.75,
|
|
1765
|
+
1,
|
|
1766
|
+
1.25,
|
|
1767
|
+
1.5,
|
|
1768
|
+
1.75,
|
|
1769
|
+
2
|
|
1770
|
+
], fr = (e) => `${e}×`, _e = z(
|
|
1771
|
+
function({
|
|
1772
|
+
gridArea: t,
|
|
1773
|
+
visible: n,
|
|
1774
|
+
options: a,
|
|
1775
|
+
formatRate: r,
|
|
1776
|
+
triggerType: i,
|
|
1777
|
+
placement: s,
|
|
1778
|
+
...o
|
|
1779
|
+
}) {
|
|
1780
|
+
const u = S(null), { playbackRate: d } = k(), l = A(
|
|
1781
|
+
b
|
|
1782
|
+
), { speedSelectorPlacement: m } = M(), p = B("playbackRate", t), v = a ?? vr, f = r ?? fr, { triggerType: y, placement: T } = gt({
|
|
1783
|
+
triggerType: i,
|
|
1784
|
+
placement: s,
|
|
1785
|
+
contextPlacement: m,
|
|
1786
|
+
triggerRef: u,
|
|
1787
|
+
defaults: { triggerType: "click", placement: "top" }
|
|
1788
|
+
}), h = E(
|
|
1789
|
+
(g) => {
|
|
1790
|
+
l({ type: "SET_PLAYBACK_RATE", playbackRate: g });
|
|
1791
|
+
},
|
|
1792
|
+
[l]
|
|
1793
|
+
);
|
|
1794
|
+
return /* @__PURE__ */ c(
|
|
1795
|
+
_.Item,
|
|
1796
|
+
{
|
|
1797
|
+
gridArea: p,
|
|
1798
|
+
visible: n ?? !0,
|
|
1799
|
+
padding: "0",
|
|
1800
|
+
...o,
|
|
1801
|
+
children: /* @__PURE__ */ w(
|
|
1802
|
+
j,
|
|
1803
|
+
{
|
|
1804
|
+
triggerType: y,
|
|
1805
|
+
placement: T,
|
|
1806
|
+
"data-testid": "speed-selector-dropdown",
|
|
1807
|
+
children: [
|
|
1808
|
+
/* @__PURE__ */ c(
|
|
1809
|
+
j.Trigger,
|
|
1810
|
+
{
|
|
1811
|
+
ref: u,
|
|
1812
|
+
"aria-label": `Playback speed, currently ${f(
|
|
1813
|
+
d
|
|
1814
|
+
)}`,
|
|
1815
|
+
className: "rmap-speed-selector-trigger",
|
|
1816
|
+
"data-testid": "speed-selector-trigger",
|
|
1817
|
+
children: f(d)
|
|
1818
|
+
}
|
|
1819
|
+
),
|
|
1820
|
+
/* @__PURE__ */ c(j.Content, { children: /* @__PURE__ */ c(
|
|
1821
|
+
"ul",
|
|
1822
|
+
{
|
|
1823
|
+
role: "menu",
|
|
1824
|
+
"aria-label": "Playback speed",
|
|
1825
|
+
className: "rmap-speed-selector-menu",
|
|
1826
|
+
children: v.map((g) => {
|
|
1827
|
+
const C = g === d;
|
|
1828
|
+
return /* @__PURE__ */ c("li", { role: "none", children: /* @__PURE__ */ c(
|
|
1829
|
+
"button",
|
|
1830
|
+
{
|
|
1831
|
+
type: "button",
|
|
1832
|
+
role: "menuitemradio",
|
|
1833
|
+
"aria-checked": C,
|
|
1834
|
+
className: C ? "rmap-speed-selector-option rmap-speed-selector-option--active" : "rmap-speed-selector-option",
|
|
1835
|
+
"data-testid": "speed-selector-option",
|
|
1836
|
+
"data-rate": g,
|
|
1837
|
+
onClick: () => h(g),
|
|
1838
|
+
children: f(g)
|
|
1839
|
+
}
|
|
1840
|
+
) }, g);
|
|
1841
|
+
})
|
|
1842
|
+
}
|
|
1843
|
+
) })
|
|
1844
|
+
]
|
|
1845
|
+
}
|
|
1846
|
+
)
|
|
1847
|
+
}
|
|
1848
|
+
);
|
|
1849
|
+
}
|
|
1850
|
+
);
|
|
1851
|
+
_e.displayName = "SpeedSelector";
|
|
1852
|
+
const Tr = ({
|
|
1853
|
+
placement: e
|
|
1854
|
+
}) => {
|
|
1855
|
+
var m;
|
|
1856
|
+
const t = S(null), { volume: n, muted: a } = k(), { elementRefs: r } = L(), i = A(b), s = E(
|
|
1857
|
+
(p) => {
|
|
1858
|
+
p.stopPropagation(), p.preventDefault(), a && i({ type: "SET_MUTED", muted: !1 });
|
|
1859
|
+
const { value: v } = p.target, f = parseFloat(v);
|
|
1860
|
+
i({
|
|
1861
|
+
type: "SET_VOLUME",
|
|
1862
|
+
volume: f
|
|
1863
|
+
});
|
|
1864
|
+
},
|
|
1865
|
+
[a, i]
|
|
1866
|
+
), o = n ?? ((m = r == null ? void 0 : r.audioEl) == null ? void 0 : m.volume) ?? 0, u = o * 100, d = Math.round(u), l = x(
|
|
1867
|
+
() => ({
|
|
1868
|
+
"--rm-audio-player-volume-value": `${u}%`
|
|
1869
|
+
}),
|
|
1870
|
+
[u]
|
|
1871
|
+
);
|
|
1872
|
+
return /* @__PURE__ */ c(
|
|
1873
|
+
"div",
|
|
1777
1874
|
{
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1875
|
+
ref: t,
|
|
1876
|
+
className: "rmap-volume-container",
|
|
1877
|
+
"data-placement": e,
|
|
1878
|
+
"data-testid": "volume-slider",
|
|
1879
|
+
style: l,
|
|
1880
|
+
children: /* @__PURE__ */ c("div", { className: "rmap-volume-panel", children: /* @__PURE__ */ c(
|
|
1881
|
+
"input",
|
|
1882
|
+
{
|
|
1883
|
+
className: "rmap-volume-slider",
|
|
1884
|
+
type: "range",
|
|
1885
|
+
style: { cursor: "pointer" },
|
|
1886
|
+
value: o,
|
|
1887
|
+
onChange: s,
|
|
1888
|
+
min: "0",
|
|
1889
|
+
max: "1",
|
|
1890
|
+
step: "0.01",
|
|
1891
|
+
"aria-label": a ? "Volume (muted)" : "Volume",
|
|
1892
|
+
"aria-valuetext": `${d} percent`
|
|
1893
|
+
}
|
|
1894
|
+
) })
|
|
1895
|
+
}
|
|
1896
|
+
);
|
|
1897
|
+
}, Et = ({
|
|
1898
|
+
gridArea: e,
|
|
1899
|
+
visible: t,
|
|
1900
|
+
triggerType: n,
|
|
1901
|
+
placement: a,
|
|
1902
|
+
...r
|
|
1903
|
+
}) => {
|
|
1904
|
+
const i = S(null), { muted: s } = k(), o = A(b), u = E(
|
|
1905
|
+
() => o({ type: "SET_MUTED", muted: !s }),
|
|
1906
|
+
[o, s]
|
|
1907
|
+
), {
|
|
1908
|
+
activeUI: { volumeSlider: d },
|
|
1909
|
+
volumeSliderPlacement: l
|
|
1910
|
+
} = M(), m = B("volume", e), {
|
|
1911
|
+
triggerType: p,
|
|
1912
|
+
placement: v,
|
|
1913
|
+
contentRole: f
|
|
1914
|
+
} = gt({
|
|
1915
|
+
triggerType: n,
|
|
1916
|
+
placement: a,
|
|
1917
|
+
contextPlacement: l,
|
|
1918
|
+
triggerRef: i,
|
|
1919
|
+
defaults: { triggerType: "hover", placement: "bottom" }
|
|
1920
|
+
});
|
|
1921
|
+
return /* @__PURE__ */ c(_.Item, { gridArea: m, visible: t ?? !0, ...r, children: /* @__PURE__ */ w(
|
|
1922
|
+
j,
|
|
1923
|
+
{
|
|
1924
|
+
placement: v,
|
|
1925
|
+
triggerType: p,
|
|
1926
|
+
disabled: d === !1,
|
|
1781
1927
|
"data-testid": "volume-dropdown",
|
|
1782
1928
|
children: [
|
|
1783
|
-
/* @__PURE__ */
|
|
1784
|
-
|
|
1929
|
+
/* @__PURE__ */ c(
|
|
1930
|
+
j.Trigger,
|
|
1785
1931
|
{
|
|
1786
|
-
ref:
|
|
1787
|
-
"aria-label":
|
|
1788
|
-
"aria-pressed":
|
|
1789
|
-
onClick:
|
|
1932
|
+
ref: i,
|
|
1933
|
+
"aria-label": s ? "Unmute" : "Mute",
|
|
1934
|
+
"aria-pressed": s,
|
|
1935
|
+
onClick: u,
|
|
1790
1936
|
className: "rmap-volume-trigger",
|
|
1791
1937
|
"data-testid": "volume-trigger-btn",
|
|
1792
|
-
"data-muted": String(
|
|
1793
|
-
children: /* @__PURE__ */
|
|
1938
|
+
"data-muted": String(s),
|
|
1939
|
+
children: /* @__PURE__ */ c(ut, {})
|
|
1794
1940
|
}
|
|
1795
1941
|
),
|
|
1796
|
-
/* @__PURE__ */
|
|
1797
|
-
ur,
|
|
1798
|
-
{
|
|
1799
|
-
placement: u || d
|
|
1800
|
-
}
|
|
1801
|
-
) })
|
|
1942
|
+
/* @__PURE__ */ c(j.Content, { role: f, children: /* @__PURE__ */ c(Tr, { placement: v }) })
|
|
1802
1943
|
]
|
|
1803
1944
|
}
|
|
1804
1945
|
) });
|
|
1805
|
-
},
|
|
1806
|
-
const { activeUI: e } =
|
|
1807
|
-
return /* @__PURE__ */ w(
|
|
1808
|
-
/* @__PURE__ */
|
|
1809
|
-
/* @__PURE__ */
|
|
1810
|
-
/* @__PURE__ */
|
|
1811
|
-
/* @__PURE__ */
|
|
1812
|
-
/* @__PURE__ */
|
|
1946
|
+
}, hr = () => {
|
|
1947
|
+
const { activeUI: e } = M(), t = (n) => !!(e[n] ?? e.all);
|
|
1948
|
+
return /* @__PURE__ */ w(G, { children: [
|
|
1949
|
+
/* @__PURE__ */ c(ft, { visible: t("progress") }),
|
|
1950
|
+
/* @__PURE__ */ c(lt, { visible: t("repeatType") }),
|
|
1951
|
+
/* @__PURE__ */ c(ct, { visible: t("playButton") }),
|
|
1952
|
+
/* @__PURE__ */ c(Et, { visible: t("volume") }),
|
|
1953
|
+
/* @__PURE__ */ c(_e, { visible: t("playbackRate") }),
|
|
1954
|
+
/* @__PURE__ */ c(mt, { visible: t("playList") })
|
|
1813
1955
|
] });
|
|
1814
|
-
},
|
|
1956
|
+
}, At = z(function({
|
|
1815
1957
|
gridArea: t,
|
|
1816
1958
|
visible: n,
|
|
1817
1959
|
...a
|
|
1818
1960
|
}) {
|
|
1819
|
-
const { playList: r, curIdx: i } =
|
|
1820
|
-
return /* @__PURE__ */
|
|
1961
|
+
const { playList: r, curIdx: i } = $(), { coverImgsCss: s } = L(), o = r[i], u = [o == null ? void 0 : o.writer, o == null ? void 0 : o.name].filter(Boolean).join(" - ") || "Album artwork", d = B("artwork", t);
|
|
1962
|
+
return /* @__PURE__ */ c(_.Item, { gridArea: d, visible: n ?? !0, ...a, children: /* @__PURE__ */ c("div", { className: "rmap-artwork-container", children: o != null && o.img ? /* @__PURE__ */ c("img", { src: o.img, alt: u, style: s == null ? void 0 : s.artwork }) : /* @__PURE__ */ c(
|
|
1821
1963
|
"div",
|
|
1822
1964
|
{
|
|
1823
1965
|
className: "rmap-artwork-fallback",
|
|
1824
1966
|
role: "img",
|
|
1825
1967
|
"aria-label": u,
|
|
1826
|
-
style:
|
|
1827
|
-
children: (
|
|
1968
|
+
style: s == null ? void 0 : s.artwork,
|
|
1969
|
+
children: (o == null ? void 0 : o.name) || "♪"
|
|
1828
1970
|
}
|
|
1829
1971
|
) }) });
|
|
1830
|
-
}),
|
|
1972
|
+
}), De = z(function({
|
|
1831
1973
|
gridArea: t,
|
|
1832
1974
|
visible: n,
|
|
1833
1975
|
...a
|
|
1834
1976
|
}) {
|
|
1835
|
-
const { playList: r, curIdx: i } =
|
|
1836
|
-
return /* @__PURE__ */
|
|
1837
|
-
(
|
|
1838
|
-
(
|
|
1977
|
+
const { playList: r, curIdx: i } = $(), s = r[i], o = B("trackInfo", t);
|
|
1978
|
+
return /* @__PURE__ */ c(_.Item, { gridArea: o, visible: n ?? !0, ...a, children: /* @__PURE__ */ c("div", { className: "rmap-track-info-container", children: s != null && s.customTrackInfo ? s.customTrackInfo : /* @__PURE__ */ w(G, { children: [
|
|
1979
|
+
(s == null ? void 0 : s.name) && /* @__PURE__ */ c("span", { className: "title", "data-testid": "track-title", children: s.name }),
|
|
1980
|
+
(s == null ? void 0 : s.writer) && /* @__PURE__ */ c("span", { className: "writer", children: s.writer })
|
|
1839
1981
|
] }) }) });
|
|
1840
1982
|
});
|
|
1841
|
-
|
|
1842
|
-
const
|
|
1983
|
+
De.displayName = "TrackInfo";
|
|
1984
|
+
const Pt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */ c(
|
|
1843
1985
|
"div",
|
|
1844
1986
|
{
|
|
1845
1987
|
className: `rmap-track-time-container${t ? ` ${t}` : ""}`,
|
|
@@ -1847,31 +1989,31 @@ const gt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */
|
|
|
1847
1989
|
...a,
|
|
1848
1990
|
children: n
|
|
1849
1991
|
}
|
|
1850
|
-
),
|
|
1851
|
-
const { currentTime: t } =
|
|
1852
|
-
return /* @__PURE__ */
|
|
1992
|
+
), gr = ({ position: e }) => {
|
|
1993
|
+
const { currentTime: t } = re();
|
|
1994
|
+
return /* @__PURE__ */ c(Pt, { position: e, className: "rmap-track-time-current", children: /* @__PURE__ */ c(
|
|
1853
1995
|
"span",
|
|
1854
1996
|
{
|
|
1855
1997
|
className: "rmap-track-current-time",
|
|
1856
1998
|
"data-testid": "track-current-time",
|
|
1857
|
-
children:
|
|
1999
|
+
children: ee(t)
|
|
1858
2000
|
}
|
|
1859
2001
|
) });
|
|
1860
|
-
},
|
|
1861
|
-
const { duration: t } =
|
|
1862
|
-
return /* @__PURE__ */
|
|
1863
|
-
|
|
2002
|
+
}, Er = ({ position: e }) => {
|
|
2003
|
+
const { duration: t } = re();
|
|
2004
|
+
return /* @__PURE__ */ c(
|
|
2005
|
+
Pt,
|
|
1864
2006
|
{
|
|
1865
2007
|
position: e,
|
|
1866
2008
|
className: "rmap-track-time-duration",
|
|
1867
|
-
children: /* @__PURE__ */
|
|
2009
|
+
children: /* @__PURE__ */ c("span", { className: "rmap-track-duration", children: ee(t) })
|
|
1868
2010
|
}
|
|
1869
2011
|
);
|
|
1870
|
-
},
|
|
1871
|
-
const t =
|
|
2012
|
+
}, St = ({ visible: e }) => {
|
|
2013
|
+
const t = B("trackTimeCurrent"), n = B("trackTimeDuration"), a = E(
|
|
1872
2014
|
(d) => +d.split(/[^\d]/).join(""),
|
|
1873
2015
|
[]
|
|
1874
|
-
), r = a(t), i = a(n),
|
|
2016
|
+
), r = a(t), i = a(n), s = E(
|
|
1875
2017
|
(d) => {
|
|
1876
2018
|
switch (d) {
|
|
1877
2019
|
case 1:
|
|
@@ -1883,28 +2025,28 @@ const gt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */
|
|
|
1883
2025
|
}
|
|
1884
2026
|
},
|
|
1885
2027
|
[]
|
|
1886
|
-
),
|
|
1887
|
-
current:
|
|
1888
|
-
duration:
|
|
2028
|
+
), o = {
|
|
2029
|
+
current: s(r - i),
|
|
2030
|
+
duration: s(i - r)
|
|
1889
2031
|
}, u = e ?? !0;
|
|
1890
|
-
return /* @__PURE__ */ w(
|
|
1891
|
-
/* @__PURE__ */
|
|
1892
|
-
/* @__PURE__ */
|
|
2032
|
+
return /* @__PURE__ */ w(G, { children: [
|
|
2033
|
+
/* @__PURE__ */ c(_.Item, { gridArea: t, visible: u, children: /* @__PURE__ */ c(gr, { position: o.current }) }),
|
|
2034
|
+
/* @__PURE__ */ c(_.Item, { gridArea: n, visible: u, children: /* @__PURE__ */ c(Er, { position: o.duration }) })
|
|
1893
2035
|
] });
|
|
1894
|
-
},
|
|
1895
|
-
var r, i,
|
|
1896
|
-
const { playList: e, curIdx: t } =
|
|
1897
|
-
return /* @__PURE__ */ w(
|
|
1898
|
-
/* @__PURE__ */
|
|
1899
|
-
|
|
2036
|
+
}, Ar = () => {
|
|
2037
|
+
var r, i, s, o;
|
|
2038
|
+
const { playList: e, curIdx: t } = $(), { activeUI: n } = M(), a = !!(((r = e[t]) == null ? void 0 : r.customTrackInfo) ?? ((i = e[t]) == null ? void 0 : i.writer) ?? ((s = e[t]) == null ? void 0 : s.name)) && !!(n.trackInfo ?? n.all);
|
|
2039
|
+
return /* @__PURE__ */ w(G, { children: [
|
|
2040
|
+
/* @__PURE__ */ c(
|
|
2041
|
+
At,
|
|
1900
2042
|
{
|
|
1901
|
-
visible: !!((
|
|
2043
|
+
visible: !!((o = e[t]) != null && o.img && (n.artwork ?? n.all))
|
|
1902
2044
|
}
|
|
1903
2045
|
),
|
|
1904
|
-
/* @__PURE__ */
|
|
1905
|
-
/* @__PURE__ */
|
|
2046
|
+
/* @__PURE__ */ c(De, { visible: a }),
|
|
2047
|
+
/* @__PURE__ */ c(St, { visible: !!(n.trackTime ?? n.all) })
|
|
1906
2048
|
] });
|
|
1907
|
-
},
|
|
2049
|
+
}, Ae = {
|
|
1908
2050
|
Progress: { displayName: "Progress", activeUIKey: "progress" },
|
|
1909
2051
|
Volume: { displayName: "Volume", activeUIKey: "volume" },
|
|
1910
2052
|
SortablePlayList: { displayName: "PlayList", activeUIKey: "playList" },
|
|
@@ -1912,201 +2054,202 @@ const gt = ({ position: e, className: t, children: n, ...a }) => /* @__PURE__ */
|
|
|
1912
2054
|
RepeatTypeBtn: { displayName: "RepeatButton", activeUIKey: "repeatType" },
|
|
1913
2055
|
Artwork: { displayName: "Artwork", activeUIKey: "artwork" },
|
|
1914
2056
|
TrackInfo: { displayName: "TrackInfo", activeUIKey: "trackInfo" },
|
|
1915
|
-
TrackTime: { displayName: "TrackTime", activeUIKey: "trackTime" }
|
|
2057
|
+
TrackTime: { displayName: "TrackTime", activeUIKey: "trackTime" },
|
|
2058
|
+
SpeedSelector: { displayName: "SpeedSelector", activeUIKey: "playbackRate" }
|
|
1916
2059
|
};
|
|
1917
|
-
function
|
|
2060
|
+
function Pr(e, t) {
|
|
1918
2061
|
const n = e[t];
|
|
1919
2062
|
return n === !1 ? !1 : n !== void 0 ? !0 : !!e.all;
|
|
1920
2063
|
}
|
|
1921
|
-
function
|
|
2064
|
+
function Re(e) {
|
|
1922
2065
|
const t = e.type;
|
|
1923
2066
|
if (!t) return;
|
|
1924
2067
|
const n = t.type ?? t;
|
|
1925
2068
|
return n.displayName || n.name || void 0;
|
|
1926
2069
|
}
|
|
1927
|
-
const
|
|
1928
|
-
const r =
|
|
1929
|
-
() => (a ?? []).map(
|
|
2070
|
+
const Sr = (e, t, n, a) => {
|
|
2071
|
+
const r = x(
|
|
2072
|
+
() => (a ?? []).map(Re).map(
|
|
1930
2073
|
(h) => {
|
|
1931
|
-
var
|
|
1932
|
-
return h ? (
|
|
2074
|
+
var g;
|
|
2075
|
+
return h ? (g = Ae[h]) == null ? void 0 : g.activeUIKey : void 0;
|
|
1933
2076
|
}
|
|
1934
2077
|
).filter((h) => h !== void 0),
|
|
1935
2078
|
[a]
|
|
1936
|
-
), i =
|
|
2079
|
+
), i = x(
|
|
1937
2080
|
() => [...r].sort().join(","),
|
|
1938
2081
|
[r]
|
|
1939
|
-
),
|
|
1940
|
-
(h,
|
|
2082
|
+
), s = E(
|
|
2083
|
+
(h, g, C, W) => {
|
|
1941
2084
|
const se = Object.keys(
|
|
1942
2085
|
de.templateArea
|
|
1943
|
-
).filter((
|
|
1944
|
-
for (const
|
|
1945
|
-
|
|
2086
|
+
).filter((I) => (I === "trackTimeCurrent" || I === "trackTimeDuration") && h.trackTime === !1 ? !1 : h[I] !== void 0 ? h[I] : !0), R = h.all ? se : Object.entries(h).filter(([, I]) => I).map(([I]) => I);
|
|
2087
|
+
for (const I of W)
|
|
2088
|
+
R.includes(I) || R.push(I);
|
|
1946
2089
|
(() => {
|
|
1947
|
-
|
|
2090
|
+
R.find((I) => I === "trackTime") && (R.splice(R.indexOf("trackTime"), 1), R.push("trackTimeCurrent"), R.push("trackTimeDuration"));
|
|
1948
2091
|
})();
|
|
1949
|
-
const
|
|
2092
|
+
const ae = {
|
|
1950
2093
|
...de.templateArea,
|
|
1951
|
-
...
|
|
1952
|
-
},
|
|
1953
|
-
|
|
1954
|
-
).filter(([
|
|
2094
|
+
...g
|
|
2095
|
+
}, ye = Object.entries(
|
|
2096
|
+
ae
|
|
2097
|
+
).filter(([I]) => R.includes(I));
|
|
1955
2098
|
let le = 1;
|
|
1956
|
-
const ue = {},
|
|
1957
|
-
...
|
|
1958
|
-
...Object.entries(
|
|
1959
|
-
].flatMap(([
|
|
2099
|
+
const ue = {}, wt = [
|
|
2100
|
+
...ye,
|
|
2101
|
+
...Object.entries(C || {})
|
|
2102
|
+
].flatMap(([I, U]) => {
|
|
1960
2103
|
if (U == null) return [];
|
|
1961
|
-
const [
|
|
1962
|
-
return le = Math.max(le,
|
|
2104
|
+
const [F, H] = U.split("-"), Y = +F.split("row")[1];
|
|
2105
|
+
return le = Math.max(le, Y), ue[Y] = ue[Y] ? ue[Y] + 1 : 1, [
|
|
1963
2106
|
{
|
|
1964
|
-
key:
|
|
1965
|
-
row:
|
|
1966
|
-
col: +
|
|
2107
|
+
key: I,
|
|
2108
|
+
row: Y,
|
|
2109
|
+
col: +H
|
|
1967
2110
|
}
|
|
1968
2111
|
];
|
|
1969
|
-
}).sort((
|
|
1970
|
-
let
|
|
1971
|
-
const
|
|
1972
|
-
let
|
|
1973
|
-
const
|
|
1974
|
-
if (
|
|
2112
|
+
}).sort((I, U) => I.col - U.col), ve = Math.max(...Object.values(ue));
|
|
2113
|
+
let Ue;
|
|
2114
|
+
const bt = new Array(le).fill("").map((I, U) => {
|
|
2115
|
+
let F = "", H;
|
|
2116
|
+
const Y = wt.filter((V) => V.row !== U + 1 ? !1 : (V.key === "progress" && (H = V), !0));
|
|
2117
|
+
if (H) {
|
|
1975
2118
|
const V = /* @__PURE__ */ new Map();
|
|
1976
|
-
|
|
1977
|
-
const
|
|
1978
|
-
for (let
|
|
1979
|
-
const
|
|
1980
|
-
V.has(
|
|
2119
|
+
Y.forEach((Q) => V.set(Q.col, Q));
|
|
2120
|
+
const fe = `row${U + 1}-${H.col}`, ne = [];
|
|
2121
|
+
for (let Q = 0; Q < ve; Q++) {
|
|
2122
|
+
const Oe = Q + 1;
|
|
2123
|
+
V.has(Oe) ? ne.push(`row${U + 1}-${Oe}`) : ne.push(fe);
|
|
1981
2124
|
}
|
|
1982
|
-
const
|
|
1983
|
-
|
|
2125
|
+
const kt = ne.indexOf(fe), Ct = ne.lastIndexOf(fe);
|
|
2126
|
+
Ue = Math.floor((kt + Ct) / 2), F = " " + ne.join(" ");
|
|
1984
2127
|
} else
|
|
1985
|
-
for (let V = 0; V <
|
|
1986
|
-
|
|
1987
|
-
return
|
|
1988
|
-
}),
|
|
1989
|
-
let
|
|
1990
|
-
for (let
|
|
1991
|
-
if (
|
|
1992
|
-
|
|
2128
|
+
for (let V = 0; V < ve; V++)
|
|
2129
|
+
F += ` row${U + 1}-${V + 1}`;
|
|
2130
|
+
return F.trimStart();
|
|
2131
|
+
}), Lt = pt ? window.innerWidth - 100 : 1500, Nt = new Array(le).fill("").map((I, U) => {
|
|
2132
|
+
let F = "";
|
|
2133
|
+
for (let H = 0; H < ve; H++) {
|
|
2134
|
+
if (Ue === H && U === 0) {
|
|
2135
|
+
F += " 1fr";
|
|
1993
2136
|
continue;
|
|
1994
2137
|
}
|
|
1995
|
-
|
|
2138
|
+
F += ` fit-content(${Lt}px)`;
|
|
1996
2139
|
}
|
|
1997
|
-
return
|
|
2140
|
+
return F.trimStart();
|
|
1998
2141
|
});
|
|
1999
|
-
return { gridAreas:
|
|
2142
|
+
return { gridAreas: bt, gridColumns: Nt };
|
|
2000
2143
|
},
|
|
2001
2144
|
[]
|
|
2002
|
-
), [
|
|
2145
|
+
), [o, u] = N(e), [d, l] = N(i), [m, p] = N({
|
|
2003
2146
|
templateArea: t,
|
|
2004
2147
|
customComponentsArea: n
|
|
2005
|
-
}), [
|
|
2006
|
-
if (!
|
|
2007
|
-
const { gridAreas: h, gridColumns:
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2148
|
+
}), [v, f] = N();
|
|
2149
|
+
if (!v) {
|
|
2150
|
+
const { gridAreas: h, gridColumns: g } = s(
|
|
2151
|
+
o,
|
|
2152
|
+
m.templateArea,
|
|
2153
|
+
m.customComponentsArea,
|
|
2011
2154
|
r
|
|
2012
2155
|
);
|
|
2013
|
-
return f({ gridAreas: h, gridColumns:
|
|
2156
|
+
return f({ gridAreas: h, gridColumns: g }), [h, g];
|
|
2014
2157
|
}
|
|
2015
|
-
if (
|
|
2016
|
-
u(e), l(i),
|
|
2017
|
-
const { gridAreas: h, gridColumns:
|
|
2158
|
+
if (o !== e || d !== i || m.templateArea !== t || m.customComponentsArea !== n) {
|
|
2159
|
+
u(e), l(i), p({ templateArea: t, customComponentsArea: n });
|
|
2160
|
+
const { gridAreas: h, gridColumns: g } = s(
|
|
2018
2161
|
e,
|
|
2019
2162
|
t,
|
|
2020
2163
|
n,
|
|
2021
2164
|
r
|
|
2022
2165
|
);
|
|
2023
|
-
f({ gridAreas: h, gridColumns:
|
|
2166
|
+
f({ gridAreas: h, gridColumns: g });
|
|
2024
2167
|
}
|
|
2025
|
-
const { gridAreas:
|
|
2026
|
-
return [
|
|
2168
|
+
const { gridAreas: y, gridColumns: T } = v;
|
|
2169
|
+
return [y, T];
|
|
2027
2170
|
};
|
|
2028
|
-
function
|
|
2029
|
-
return
|
|
2030
|
-
const t =
|
|
2171
|
+
function Ir(e) {
|
|
2172
|
+
return x(() => {
|
|
2173
|
+
const t = te.Children.toArray(e).filter(Dt), n = t.find(Be);
|
|
2031
2174
|
return {
|
|
2032
2175
|
compoundChildren: t.filter(
|
|
2033
|
-
(a) => !
|
|
2176
|
+
(a) => !Be(a)
|
|
2034
2177
|
),
|
|
2035
|
-
playListEmptyNode:
|
|
2178
|
+
playListEmptyNode: wr(n)
|
|
2036
2179
|
};
|
|
2037
2180
|
}, [e]);
|
|
2038
2181
|
}
|
|
2039
|
-
function
|
|
2040
|
-
return
|
|
2182
|
+
function Be(e) {
|
|
2183
|
+
return Re(e) === We;
|
|
2041
2184
|
}
|
|
2042
|
-
function
|
|
2185
|
+
function wr(e) {
|
|
2043
2186
|
if (!e) return null;
|
|
2044
2187
|
const t = e.props;
|
|
2045
2188
|
return (t == null ? void 0 : t.children) ?? null;
|
|
2046
2189
|
}
|
|
2047
|
-
function
|
|
2190
|
+
function br({
|
|
2048
2191
|
compoundChildren: e,
|
|
2049
2192
|
activeUI: t
|
|
2050
2193
|
}) {
|
|
2051
|
-
const n = e.map(
|
|
2194
|
+
const n = e.map(Re).filter((a) => !!(a && Ae[a])).sort().join(",");
|
|
2052
2195
|
P(() => {
|
|
2053
2196
|
if (process.env.NODE_ENV === "production" || !n) return;
|
|
2054
2197
|
const a = /* @__PURE__ */ new Set();
|
|
2055
2198
|
for (const r of n.split(",")) {
|
|
2056
|
-
const i =
|
|
2057
|
-
i && (a.has(i.displayName) ||
|
|
2199
|
+
const i = Ae[r];
|
|
2200
|
+
i && (a.has(i.displayName) || Pr(t, i.activeUIKey) && (a.add(i.displayName), console.warn(
|
|
2058
2201
|
`[react-modern-audio-player] Both preset and compound '${i.displayName}' are rendered. Set \`activeUI.${i.activeUIKey}=false\` to replace the preset control.`
|
|
2059
2202
|
)));
|
|
2060
2203
|
}
|
|
2061
2204
|
}, [n, t]);
|
|
2062
2205
|
}
|
|
2063
|
-
const
|
|
2064
|
-
const { interfacePlacement: t, activeUI: n, playListPlacement: a } =
|
|
2065
|
-
|
|
2066
|
-
const [
|
|
2206
|
+
const Lr = ({ children: e }) => {
|
|
2207
|
+
const { interfacePlacement: t, activeUI: n, playListPlacement: a } = M(), { compoundChildren: r, playListEmptyNode: i } = Ir(e);
|
|
2208
|
+
br({ compoundChildren: r, activeUI: n });
|
|
2209
|
+
const [s, o] = Sr(
|
|
2067
2210
|
n,
|
|
2068
2211
|
t == null ? void 0 : t.templateArea,
|
|
2069
2212
|
t == null ? void 0 : t.customComponentsArea,
|
|
2070
2213
|
r
|
|
2071
|
-
), [u, d] =
|
|
2072
|
-
return /* @__PURE__ */
|
|
2214
|
+
), [u, d] = N(null);
|
|
2215
|
+
return /* @__PURE__ */ c(
|
|
2073
2216
|
"div",
|
|
2074
2217
|
{
|
|
2075
2218
|
className: "rmap-interface-container",
|
|
2076
2219
|
"data-testid": "audio-player",
|
|
2077
2220
|
role: "region",
|
|
2078
2221
|
"aria-label": "Audio player",
|
|
2079
|
-
children: /* @__PURE__ */
|
|
2080
|
-
a === "top" && /* @__PURE__ */
|
|
2222
|
+
children: /* @__PURE__ */ c(xe.Provider, { value: u, children: /* @__PURE__ */ w(Me.Provider, { value: i, children: [
|
|
2223
|
+
a === "top" && /* @__PURE__ */ c("div", { ref: d, className: "rmap-sortable-playlist" }),
|
|
2081
2224
|
/* @__PURE__ */ w(
|
|
2082
2225
|
_,
|
|
2083
2226
|
{
|
|
2084
2227
|
alignItems: "center",
|
|
2085
2228
|
justifyContent: "center",
|
|
2086
|
-
areas:
|
|
2229
|
+
areas: s,
|
|
2087
2230
|
minHeight: "30px",
|
|
2088
|
-
columns:
|
|
2231
|
+
columns: o,
|
|
2089
2232
|
UNSAFE_className: "rmap-interface-grid",
|
|
2090
2233
|
children: [
|
|
2091
|
-
/* @__PURE__ */
|
|
2092
|
-
/* @__PURE__ */
|
|
2234
|
+
/* @__PURE__ */ c(Ar, {}),
|
|
2235
|
+
/* @__PURE__ */ c(hr, {}),
|
|
2093
2236
|
r
|
|
2094
2237
|
]
|
|
2095
2238
|
}
|
|
2096
2239
|
),
|
|
2097
|
-
a === "bottom" && /* @__PURE__ */
|
|
2240
|
+
a === "bottom" && /* @__PURE__ */ c("div", { ref: d, className: "rmap-sortable-playlist" })
|
|
2098
2241
|
] }) })
|
|
2099
2242
|
}
|
|
2100
2243
|
);
|
|
2101
|
-
},
|
|
2102
|
-
const n =
|
|
2244
|
+
}, Z = (e, t) => {
|
|
2245
|
+
const n = S(!1);
|
|
2103
2246
|
P(() => {
|
|
2104
2247
|
if (n.current)
|
|
2105
2248
|
return e();
|
|
2106
2249
|
}, t), P(() => (n.current = !0, () => {
|
|
2107
2250
|
n.current = !1;
|
|
2108
2251
|
}), []);
|
|
2109
|
-
},
|
|
2252
|
+
}, Nr = ({
|
|
2110
2253
|
placement: e = {},
|
|
2111
2254
|
activeUI: t,
|
|
2112
2255
|
coverImgsCss: n,
|
|
@@ -2114,73 +2257,87 @@ const Ir = ({ children: e }) => {
|
|
|
2114
2257
|
playList: r,
|
|
2115
2258
|
customIcons: i
|
|
2116
2259
|
}) => {
|
|
2117
|
-
const
|
|
2118
|
-
|
|
2260
|
+
const s = A(b);
|
|
2261
|
+
Z(() => {
|
|
2119
2262
|
const {
|
|
2120
|
-
player:
|
|
2263
|
+
player: o,
|
|
2121
2264
|
playList: u,
|
|
2122
2265
|
interface: d,
|
|
2123
2266
|
volumeSlider: l
|
|
2124
2267
|
} = e;
|
|
2125
|
-
|
|
2268
|
+
s({
|
|
2126
2269
|
type: "SET_PLACEMENTS",
|
|
2127
|
-
playerPlacement:
|
|
2270
|
+
playerPlacement: o,
|
|
2128
2271
|
playListPlacement: u,
|
|
2129
2272
|
interfacePlacement: d,
|
|
2130
2273
|
volumeSliderPlacement: l
|
|
2131
2274
|
});
|
|
2132
|
-
}, [
|
|
2133
|
-
t &&
|
|
2134
|
-
}, [t,
|
|
2135
|
-
n &&
|
|
2136
|
-
}, [
|
|
2137
|
-
a &&
|
|
2275
|
+
}, [s, e]), Z(() => {
|
|
2276
|
+
t && s({ type: "SET_ACTIVE_UI", activeUI: t });
|
|
2277
|
+
}, [t, s]), Z(() => {
|
|
2278
|
+
n && s({ type: "SET_COVER_IMGS_CSS", coverImgsCss: n });
|
|
2279
|
+
}, [s, n]), Z(() => {
|
|
2280
|
+
a && s({
|
|
2138
2281
|
type: "SET_INITIAL_STATES",
|
|
2139
2282
|
audioState: a,
|
|
2140
2283
|
curPlayId: a.curPlayId
|
|
2141
2284
|
});
|
|
2142
|
-
}, [a,
|
|
2143
|
-
|
|
2144
|
-
}, [
|
|
2145
|
-
i &&
|
|
2146
|
-
}, [i,
|
|
2147
|
-
},
|
|
2285
|
+
}, [a, s]), Z(() => {
|
|
2286
|
+
s({ type: "UPDATE_PLAY_LIST", playList: r });
|
|
2287
|
+
}, [s, r]), Z(() => {
|
|
2288
|
+
i && s({ type: "SET_CUSTOM_ICONS", customIcons: i });
|
|
2289
|
+
}, [i, s]);
|
|
2290
|
+
}, kr = ({
|
|
2148
2291
|
audioRef: e,
|
|
2149
2292
|
children: t,
|
|
2150
2293
|
...n
|
|
2151
|
-
}) => (
|
|
2152
|
-
/* @__PURE__ */
|
|
2153
|
-
/* @__PURE__ */
|
|
2294
|
+
}) => (Nr(n), /* @__PURE__ */ w("div", { id: "rm-audio-player", className: "rmap-player-container", children: [
|
|
2295
|
+
/* @__PURE__ */ c(Ye, { audioRef: e }),
|
|
2296
|
+
/* @__PURE__ */ c(Lr, { children: t })
|
|
2154
2297
|
] }));
|
|
2155
|
-
function
|
|
2298
|
+
function It({
|
|
2156
2299
|
rootContainerProps: e,
|
|
2157
2300
|
...t
|
|
2158
2301
|
}) {
|
|
2159
|
-
return /* @__PURE__ */
|
|
2302
|
+
return /* @__PURE__ */ c(Bt, { ...t, children: /* @__PURE__ */ c(Ge, { rootContainerProps: e, children: /* @__PURE__ */ c(kr, { ...t }) }) });
|
|
2160
2303
|
}
|
|
2161
|
-
|
|
2162
|
-
const
|
|
2163
|
-
Progress:
|
|
2164
|
-
Volume:
|
|
2165
|
-
PlayList:
|
|
2166
|
-
PlayListEmpty:
|
|
2167
|
-
PlayButton:
|
|
2168
|
-
RepeatButton:
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2304
|
+
It.displayName = "AudioPlayerWithProviders";
|
|
2305
|
+
const Kr = Object.assign(It, {
|
|
2306
|
+
Progress: ft,
|
|
2307
|
+
Volume: Et,
|
|
2308
|
+
PlayList: mt,
|
|
2309
|
+
PlayListEmpty: je,
|
|
2310
|
+
PlayButton: ct,
|
|
2311
|
+
RepeatButton: lt,
|
|
2312
|
+
SpeedSelector: _e,
|
|
2313
|
+
Artwork: At,
|
|
2314
|
+
TrackInfo: De,
|
|
2315
|
+
TrackTime: St,
|
|
2316
|
+
CustomComponent: Gt
|
|
2317
|
+
}), Cr = () => {
|
|
2318
|
+
const e = A(b), { isPlaying: t, repeatType: n, playbackRate: a } = k(), r = E(() => {
|
|
2175
2319
|
e({ type: "CHANGE_PLAYING_STATE", state: !0 });
|
|
2176
|
-
}, [e]),
|
|
2320
|
+
}, [e]), i = E(() => {
|
|
2177
2321
|
e({ type: "CHANGE_PLAYING_STATE", state: !1 });
|
|
2178
|
-
}, [e]),
|
|
2322
|
+
}, [e]), s = E(() => {
|
|
2179
2323
|
e({ type: "CHANGE_PLAYING_STATE" });
|
|
2180
|
-
}, [e])
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2324
|
+
}, [e]), o = E(
|
|
2325
|
+
(u) => {
|
|
2326
|
+
e({ type: "SET_PLAYBACK_RATE", playbackRate: u });
|
|
2327
|
+
},
|
|
2328
|
+
[e]
|
|
2329
|
+
);
|
|
2330
|
+
return {
|
|
2331
|
+
isPlaying: t,
|
|
2332
|
+
repeatType: n,
|
|
2333
|
+
playbackRate: a,
|
|
2334
|
+
play: r,
|
|
2335
|
+
pause: i,
|
|
2336
|
+
togglePlay: s,
|
|
2337
|
+
setPlaybackRate: o
|
|
2338
|
+
};
|
|
2339
|
+
}, xr = () => {
|
|
2340
|
+
const e = A(b), { playList: t, curIdx: n, curPlayId: a } = $(), { elementRefs: r } = L(), i = E(
|
|
2184
2341
|
(u) => {
|
|
2185
2342
|
const d = t[u];
|
|
2186
2343
|
d && e({
|
|
@@ -2190,9 +2347,9 @@ const Dr = Object.assign(Pt, {
|
|
|
2190
2347
|
});
|
|
2191
2348
|
},
|
|
2192
2349
|
[e, t]
|
|
2193
|
-
),
|
|
2350
|
+
), s = E(() => {
|
|
2194
2351
|
t.length !== 0 && e({ type: "NEXT_AUDIO" });
|
|
2195
|
-
}, [e, t.length]),
|
|
2352
|
+
}, [e, t.length]), o = E(() => {
|
|
2196
2353
|
var d;
|
|
2197
2354
|
if (t.length === 0) return;
|
|
2198
2355
|
const u = ((d = r == null ? void 0 : r.audioEl) == null ? void 0 : d.currentTime) ?? 0;
|
|
@@ -2204,29 +2361,29 @@ const Dr = Object.assign(Pt, {
|
|
|
2204
2361
|
playList: t,
|
|
2205
2362
|
currentTrack: t[n] ?? null,
|
|
2206
2363
|
setTrack: i,
|
|
2207
|
-
next:
|
|
2208
|
-
prev:
|
|
2364
|
+
next: s,
|
|
2365
|
+
prev: o
|
|
2209
2366
|
};
|
|
2210
|
-
},
|
|
2211
|
-
const e =
|
|
2367
|
+
}, Mr = () => {
|
|
2368
|
+
const e = A(b), { volume: t, muted: n } = k(), a = E(
|
|
2212
2369
|
(i) => {
|
|
2213
2370
|
e({ type: "SET_VOLUME", volume: i });
|
|
2214
2371
|
},
|
|
2215
2372
|
[e]
|
|
2216
|
-
), r =
|
|
2373
|
+
), r = E(() => {
|
|
2217
2374
|
e({ type: "SET_MUTED", muted: !n });
|
|
2218
2375
|
}, [e, n]);
|
|
2219
2376
|
return { volume: t, muted: n, setVolume: a, toggleMute: r };
|
|
2220
|
-
},
|
|
2221
|
-
const e =
|
|
2377
|
+
}, _r = () => {
|
|
2378
|
+
const e = A(b), { currentTime: t, duration: n } = re(), a = E(
|
|
2222
2379
|
(r) => {
|
|
2223
2380
|
e({ type: "SEEK", time: r });
|
|
2224
2381
|
},
|
|
2225
2382
|
[e]
|
|
2226
2383
|
);
|
|
2227
2384
|
return { currentTime: t, duration: n, seek: a };
|
|
2228
|
-
},
|
|
2229
|
-
const e =
|
|
2385
|
+
}, Vr = () => {
|
|
2386
|
+
const e = Cr(), t = xr(), n = Mr(), a = _r();
|
|
2230
2387
|
return {
|
|
2231
2388
|
isPlaying: e.isPlaying,
|
|
2232
2389
|
volume: n.volume,
|
|
@@ -2234,6 +2391,7 @@ const Dr = Object.assign(Pt, {
|
|
|
2234
2391
|
duration: a.duration,
|
|
2235
2392
|
repeatType: e.repeatType,
|
|
2236
2393
|
muted: n.muted,
|
|
2394
|
+
playbackRate: e.playbackRate,
|
|
2237
2395
|
currentTrack: t.currentTrack,
|
|
2238
2396
|
currentIndex: t.currentIndex,
|
|
2239
2397
|
playList: t.playList,
|
|
@@ -2245,41 +2403,42 @@ const Dr = Object.assign(Pt, {
|
|
|
2245
2403
|
seek: a.seek,
|
|
2246
2404
|
setVolume: n.setVolume,
|
|
2247
2405
|
toggleMute: n.toggleMute,
|
|
2248
|
-
setTrack: t.setTrack
|
|
2406
|
+
setTrack: t.setTrack,
|
|
2407
|
+
setPlaybackRate: e.setPlaybackRate
|
|
2249
2408
|
};
|
|
2250
|
-
},
|
|
2251
|
-
const { elementRefs: e } =
|
|
2409
|
+
}, Br = () => {
|
|
2410
|
+
const { elementRefs: e } = L();
|
|
2252
2411
|
return {
|
|
2253
2412
|
audioEl: e == null ? void 0 : e.audioEl,
|
|
2254
2413
|
waveformInst: e == null ? void 0 : e.waveformInst
|
|
2255
2414
|
};
|
|
2256
2415
|
};
|
|
2257
2416
|
export {
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2417
|
+
kr as AudioPlayer,
|
|
2418
|
+
Ge as AudioPlayerContainer,
|
|
2419
|
+
Bt as AudioPlayerStateProvider,
|
|
2420
|
+
O as DEFAULT_AUDIO_STATE,
|
|
2421
|
+
Or as DEFAULT_INTERFACE_GRID_BOUND,
|
|
2262
2422
|
Ie as audioAttrsContext,
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2423
|
+
b as audioPlayerDispatchContext,
|
|
2424
|
+
Ot as audioPlayerReducer,
|
|
2425
|
+
Kr as default,
|
|
2266
2426
|
de as defaultInterfacePlacement,
|
|
2267
|
-
|
|
2268
|
-
Ae as playbackContext,
|
|
2427
|
+
Se as playbackContext,
|
|
2269
2428
|
Le as resourceContext,
|
|
2270
2429
|
Ne as timeContext,
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2430
|
+
we as trackContext,
|
|
2431
|
+
be as uiContext,
|
|
2432
|
+
Kt as useAudioAttrsContext,
|
|
2433
|
+
Vr as useAudioPlayer,
|
|
2434
|
+
Br as useAudioPlayerElement,
|
|
2435
|
+
Cr as useAudioPlayerPlayback,
|
|
2436
|
+
_r as useAudioPlayerTime,
|
|
2437
|
+
xr as useAudioPlayerTrack,
|
|
2438
|
+
Mr as useAudioPlayerVolume,
|
|
2439
|
+
k as usePlaybackContext,
|
|
2440
|
+
L as useResourceContext,
|
|
2441
|
+
re as useTimeContext,
|
|
2442
|
+
$ as useTrackContext,
|
|
2443
|
+
M as useUIContext
|
|
2285
2444
|
};
|