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