@lucaismyname/ginger 0.0.3 → 0.0.8
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 +745 -0
- package/dist/audio/GingerPlayer.d.ts.map +1 -1
- package/dist/components/controls/Controls.d.ts +7 -3
- package/dist/components/controls/Controls.d.ts.map +1 -1
- package/dist/components/current/Artwork.d.ts.map +1 -1
- package/dist/components/current/Time.d.ts +11 -1
- package/dist/components/current/Time.d.ts.map +1 -1
- package/dist/components/current/index.d.ts +1 -1
- package/dist/components/current/index.d.ts.map +1 -1
- package/dist/components/playlist/GingerPlaylist.d.ts.map +1 -1
- package/dist/context/GingerContext.d.ts +3 -1
- package/dist/context/GingerContext.d.ts.map +1 -1
- package/dist/context/GingerLocaleContext.d.ts +9 -0
- package/dist/context/GingerLocaleContext.d.ts.map +1 -0
- package/dist/context/GingerProvider.d.ts +1 -1
- package/dist/context/GingerProvider.d.ts.map +1 -1
- package/dist/context/GingerSplitContexts.d.ts +42 -0
- package/dist/context/GingerSplitContexts.d.ts.map +1 -0
- package/dist/core/playbackReducer.d.ts.map +1 -1
- package/dist/core/playbackReducer.test.d.ts +2 -0
- package/dist/core/playbackReducer.test.d.ts.map +1 -0
- package/dist/core/queue.d.ts +2 -1
- package/dist/core/queue.d.ts.map +1 -1
- package/dist/core/transitions.test.d.ts +2 -0
- package/dist/core/transitions.test.d.ts.map +1 -0
- package/dist/ginger.d.ts +1 -0
- package/dist/ginger.d.ts.map +1 -1
- package/dist/hooks/useControlBindings.d.ts +40 -0
- package/dist/hooks/useControlBindings.d.ts.map +1 -0
- package/dist/hooks/useGinger.d.ts +3 -1
- package/dist/hooks/useGinger.d.ts.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +10 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +999 -647
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +33 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +19 -5
package/dist/index.js
CHANGED
|
@@ -1,233 +1,295 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as
|
|
3
|
-
const
|
|
4
|
-
function
|
|
5
|
-
const e =
|
|
1
|
+
import { jsx as o, jsxs as he } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as O, createContext as Y, useRef as L, useEffect as S, useMemo as E, useReducer as pr, useCallback as h } from "react";
|
|
3
|
+
const Ee = Y(null);
|
|
4
|
+
function gr() {
|
|
5
|
+
const e = O(Ee);
|
|
6
6
|
if (!e) throw new Error("Ginger components must be used within <Ginger.Provider>");
|
|
7
7
|
return e;
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
const { buffered: r, duration:
|
|
11
|
-
return !(
|
|
9
|
+
function xe(e) {
|
|
10
|
+
const { buffered: r, duration: n } = e;
|
|
11
|
+
return !(n > 0) || r.length === 0 ? 0 : Math.min(1, r.end(r.length - 1) / n);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
var
|
|
15
|
-
const { audioRef:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
const
|
|
21
|
-
|
|
13
|
+
function yr({ className: e, style: r, preload: n = "metadata", crossOrigin: t }) {
|
|
14
|
+
var b;
|
|
15
|
+
const { audioRef: a, dispatch: u, state: i, notifyEnded: l } = gr(), c = ((b = i.tracks[i.currentIndex]) == null ? void 0 : b.fileUrl) ?? "", f = L({
|
|
16
|
+
currentTime: -1,
|
|
17
|
+
duration: -1,
|
|
18
|
+
bufferedFraction: -1
|
|
19
|
+
}), p = (d, y = !1) => {
|
|
20
|
+
const k = {
|
|
21
|
+
currentTime: d.currentTime,
|
|
22
|
+
duration: d.duration,
|
|
23
|
+
bufferedFraction: xe(d)
|
|
24
|
+
}, v = f.current, A = Math.abs(k.currentTime - v.currentTime) >= 0.25 || Math.abs(k.duration - v.duration) >= 0.01 || Math.abs(k.bufferedFraction - v.bufferedFraction) >= 0.01;
|
|
25
|
+
!y && !A || (f.current = k, u({
|
|
26
|
+
type: "MEDIA_TIME_UPDATE",
|
|
27
|
+
payload: k
|
|
28
|
+
}));
|
|
29
|
+
};
|
|
30
|
+
return S(() => {
|
|
31
|
+
const d = a.current;
|
|
32
|
+
d && (d.volume = i.volume, d.muted = i.muted, d.playbackRate = i.playbackRate);
|
|
33
|
+
}, [a, i.volume, i.muted, i.playbackRate]), S(() => {
|
|
34
|
+
const d = a.current;
|
|
35
|
+
if (d) {
|
|
22
36
|
if (!c) {
|
|
23
|
-
|
|
37
|
+
d.removeAttribute("src"), f.current = { currentTime: -1, duration: -1, bufferedFraction: -1 };
|
|
24
38
|
return;
|
|
25
39
|
}
|
|
26
|
-
|
|
40
|
+
d.getAttribute("src") !== c && (d.src = c, d.load(), f.current = { currentTime: -1, duration: -1, bufferedFraction: -1 });
|
|
27
41
|
}
|
|
28
|
-
}, [
|
|
42
|
+
}, [a, i.currentIndex, i.tracks, c]), /* @__PURE__ */ o(
|
|
29
43
|
"audio",
|
|
30
44
|
{
|
|
31
|
-
ref:
|
|
45
|
+
ref: a,
|
|
32
46
|
className: e,
|
|
33
47
|
style: r,
|
|
34
|
-
preload:
|
|
35
|
-
crossOrigin:
|
|
48
|
+
preload: n,
|
|
49
|
+
crossOrigin: t,
|
|
36
50
|
controls: !1,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
type: "MEDIA_TIME_UPDATE",
|
|
41
|
-
payload: {
|
|
42
|
-
currentTime: d.currentTime,
|
|
43
|
-
duration: d.duration,
|
|
44
|
-
bufferedFraction: le(d)
|
|
45
|
-
}
|
|
46
|
-
});
|
|
51
|
+
playsInline: !0,
|
|
52
|
+
onTimeUpdate: (d) => {
|
|
53
|
+
p(d.currentTarget);
|
|
47
54
|
},
|
|
48
|
-
onLoadedMetadata: (
|
|
49
|
-
const
|
|
50
|
-
|
|
55
|
+
onLoadedMetadata: (d) => {
|
|
56
|
+
const y = d.currentTarget;
|
|
57
|
+
f.current = { currentTime: -1, duration: -1, bufferedFraction: -1 }, u({
|
|
51
58
|
type: "MEDIA_LOADED_METADATA",
|
|
52
59
|
payload: {
|
|
53
|
-
duration:
|
|
54
|
-
bufferedFraction:
|
|
60
|
+
duration: y.duration,
|
|
61
|
+
bufferedFraction: xe(y)
|
|
55
62
|
}
|
|
56
63
|
});
|
|
57
64
|
},
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
onSeeking: (d) => p(d.currentTarget, !0),
|
|
66
|
+
onSeeked: (d) => p(d.currentTarget, !0),
|
|
67
|
+
onEnded: () => l(),
|
|
68
|
+
onPlay: () => u({ type: "MEDIA_PLAY" }),
|
|
69
|
+
onPause: () => u({ type: "MEDIA_PAUSE" }),
|
|
70
|
+
onWaiting: () => u({ type: "MEDIA_WAITING" }),
|
|
71
|
+
onCanPlay: () => u({ type: "MEDIA_CANPLAY" }),
|
|
72
|
+
onProgress: (d) => p(d.currentTarget, !0),
|
|
73
|
+
onVolumeChange: (d) => {
|
|
74
|
+
const y = d.currentTarget;
|
|
75
|
+
u({
|
|
66
76
|
type: "MEDIA_VOLUME_SYNC",
|
|
67
|
-
payload: { volume:
|
|
77
|
+
payload: { volume: y.volume, muted: y.muted }
|
|
68
78
|
});
|
|
69
79
|
},
|
|
70
80
|
onError: () => {
|
|
71
|
-
var
|
|
72
|
-
const
|
|
73
|
-
|
|
81
|
+
var v;
|
|
82
|
+
const d = a.current, y = (v = d == null ? void 0 : d.error) == null ? void 0 : v.code;
|
|
83
|
+
u({ type: "MEDIA_ERROR", payload: { message: y === 1 ? "MEDIA_ERR_ABORTED" : y === 2 ? "MEDIA_ERR_NETWORK" : y === 3 ? "MEDIA_ERR_DECODE" : y === 4 ? "MEDIA_ERR_SRC_NOT_SUPPORTED" : "MEDIA_ERR_UNKNOWN" } });
|
|
74
84
|
}
|
|
75
85
|
}
|
|
76
86
|
);
|
|
77
87
|
}
|
|
78
|
-
function
|
|
88
|
+
function D(e, r) {
|
|
79
89
|
return r <= 0 ? 0 : Math.max(0, Math.min(r - 1, e));
|
|
80
90
|
}
|
|
81
|
-
function
|
|
91
|
+
function Ie(e, r) {
|
|
82
92
|
if (e.length <= 1) return [...e];
|
|
83
|
-
const
|
|
84
|
-
if (!
|
|
85
|
-
const
|
|
86
|
-
for (let
|
|
87
|
-
const
|
|
88
|
-
[
|
|
93
|
+
const n = e[r];
|
|
94
|
+
if (!n) return [...e];
|
|
95
|
+
const t = e.filter((a, u) => u !== r);
|
|
96
|
+
for (let a = t.length - 1; a > 0; a--) {
|
|
97
|
+
const u = Math.floor(Math.random() * (a + 1));
|
|
98
|
+
[t[a], t[u]] = [t[u], t[a]];
|
|
89
99
|
}
|
|
90
|
-
return [
|
|
100
|
+
return [n, ...t];
|
|
101
|
+
}
|
|
102
|
+
function me(e) {
|
|
103
|
+
return e ? e.id != null && e.id !== "" ? `id:${e.id}` : `file:${e.fileUrl}` : "";
|
|
91
104
|
}
|
|
92
|
-
function
|
|
93
|
-
const
|
|
105
|
+
function mr(e, r) {
|
|
106
|
+
const n = me(r);
|
|
107
|
+
if (!n) return 0;
|
|
108
|
+
const t = e.findIndex((a) => me(a) === n);
|
|
94
109
|
return t === -1 ? 0 : t;
|
|
95
110
|
}
|
|
96
|
-
function
|
|
97
|
-
const { tracks: r, currentIndex:
|
|
98
|
-
return
|
|
111
|
+
function br(e) {
|
|
112
|
+
const { tracks: r, currentIndex: n, repeatMode: t } = e, a = r.length;
|
|
113
|
+
return a === 0 ? { kind: "stop", nextIndex: 0 } : t === "one" ? { kind: "replay_same" } : n < a - 1 ? { kind: "advance", nextIndex: n + 1 } : t === "all" ? { kind: "wrap", nextIndex: 0 } : { kind: "stop", nextIndex: D(n, a) };
|
|
99
114
|
}
|
|
100
|
-
function
|
|
101
|
-
const { tracks: r, currentIndex:
|
|
102
|
-
return
|
|
115
|
+
function hr(e) {
|
|
116
|
+
const { tracks: r, currentIndex: n, repeatMode: t } = e, a = r.length;
|
|
117
|
+
return a === 0 ? 0 : n < a - 1 ? n + 1 : t === "all" ? 0 : D(n, a);
|
|
103
118
|
}
|
|
104
|
-
function
|
|
105
|
-
const { tracks: r, currentIndex:
|
|
106
|
-
return
|
|
119
|
+
function kr(e) {
|
|
120
|
+
const { tracks: r, currentIndex: n, repeatMode: t } = e, a = r.length;
|
|
121
|
+
return a === 0 ? 0 : n > 0 ? n - 1 : t === "all" ? a - 1 : 0;
|
|
107
122
|
}
|
|
108
|
-
function
|
|
123
|
+
function Pr(e) {
|
|
109
124
|
return e === "off" ? "all" : e === "all" ? "one" : "off";
|
|
110
125
|
}
|
|
111
|
-
function
|
|
126
|
+
function vr(e, r) {
|
|
112
127
|
return (e == null ? void 0 : e.artworkUrl) ?? r ?? void 0;
|
|
113
128
|
}
|
|
114
|
-
function
|
|
129
|
+
function Mr(e, r) {
|
|
115
130
|
return (e == null ? void 0 : e.album) ?? r ?? void 0;
|
|
116
131
|
}
|
|
117
|
-
function
|
|
132
|
+
function I(e) {
|
|
118
133
|
return e.tracks[e.currentIndex] ?? null;
|
|
119
134
|
}
|
|
120
|
-
function
|
|
135
|
+
function ke(e) {
|
|
121
136
|
return e.errorMessage ? "error" : e.tracks.length === 0 ? "idle" : e.isBuffering ? "loading" : e.isPaused ? Number.isFinite(e.duration) && e.duration > 0 && e.currentTime >= e.duration - 0.05 ? "ended" : "paused" : "playing";
|
|
122
137
|
}
|
|
123
|
-
function
|
|
124
|
-
var
|
|
138
|
+
function F(e) {
|
|
139
|
+
var t;
|
|
125
140
|
const r = e.duration;
|
|
126
141
|
if (Number.isFinite(r) && r > 0) return r;
|
|
127
|
-
const
|
|
128
|
-
return typeof
|
|
142
|
+
const n = (t = e.tracks[e.currentIndex]) == null ? void 0 : t.durationSeconds;
|
|
143
|
+
return typeof n == "number" && Number.isFinite(n) && n > 0 ? n : 0;
|
|
129
144
|
}
|
|
130
|
-
function
|
|
131
|
-
const
|
|
132
|
-
return Number.isFinite(
|
|
145
|
+
function Ae(e) {
|
|
146
|
+
const n = F(e) - e.currentTime;
|
|
147
|
+
return Number.isFinite(n) ? Math.max(0, n) : 0;
|
|
133
148
|
}
|
|
134
|
-
function
|
|
135
|
-
const r =
|
|
149
|
+
function Pe(e) {
|
|
150
|
+
const r = F(e);
|
|
136
151
|
return r > 0 ? Math.min(1, Math.max(0, e.currentTime / r)) : 0;
|
|
137
152
|
}
|
|
138
|
-
function
|
|
139
|
-
var
|
|
140
|
-
const r =
|
|
141
|
-
return
|
|
153
|
+
function Re(e) {
|
|
154
|
+
var n;
|
|
155
|
+
const r = I(e);
|
|
156
|
+
return vr(r, (n = e.playlistMeta) == null ? void 0 : n.artworkUrl);
|
|
142
157
|
}
|
|
143
|
-
function
|
|
144
|
-
var
|
|
145
|
-
const r =
|
|
146
|
-
return
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
158
|
+
function Se(e) {
|
|
159
|
+
var n;
|
|
160
|
+
const r = I(e);
|
|
161
|
+
return Mr(r, (n = e.playlistMeta) == null ? void 0 : n.subtitle);
|
|
162
|
+
}
|
|
163
|
+
const _e = Y(null), Ge = Y(null);
|
|
164
|
+
function T() {
|
|
165
|
+
const e = O(_e);
|
|
166
|
+
if (!e) throw new Error("Ginger hooks must be used within <Ginger.Provider>");
|
|
167
|
+
return e;
|
|
168
|
+
}
|
|
169
|
+
function U() {
|
|
170
|
+
const e = O(Ge);
|
|
171
|
+
if (!e) throw new Error("Ginger hooks must be used within <Ginger.Provider>");
|
|
172
|
+
return e;
|
|
173
|
+
}
|
|
174
|
+
function P() {
|
|
175
|
+
const e = T(), r = U();
|
|
176
|
+
return E(() => pe(e, r), [e, r]);
|
|
177
|
+
}
|
|
178
|
+
function qr(e, r) {
|
|
179
|
+
return { ...e, ...r };
|
|
180
|
+
}
|
|
181
|
+
function pe(e, r) {
|
|
182
|
+
const {
|
|
183
|
+
init: n,
|
|
184
|
+
play: t,
|
|
185
|
+
pause: a,
|
|
186
|
+
togglePlayPause: u,
|
|
187
|
+
next: i,
|
|
188
|
+
prev: l,
|
|
189
|
+
setRepeatMode: c,
|
|
190
|
+
cycleRepeat: f,
|
|
191
|
+
toggleShuffle: p,
|
|
192
|
+
setQueue: b,
|
|
193
|
+
playTrackAt: d,
|
|
194
|
+
selectTrackAt: y,
|
|
195
|
+
setPlaylistMeta: k,
|
|
196
|
+
dispatch: v,
|
|
197
|
+
...A
|
|
198
|
+
} = e, {
|
|
199
|
+
seek: V,
|
|
200
|
+
setVolume: B,
|
|
201
|
+
setMuted: R,
|
|
202
|
+
toggleMute: s,
|
|
203
|
+
setPlaybackRate: m,
|
|
204
|
+
audioRef: ge,
|
|
205
|
+
notifyEnded: ye,
|
|
206
|
+
dispatch: C,
|
|
207
|
+
...Q
|
|
208
|
+
} = r;
|
|
209
|
+
return { ...A, ...Q };
|
|
210
|
+
}
|
|
211
|
+
function _(e, r) {
|
|
212
|
+
function n(t) {
|
|
213
|
+
const a = P(), i = (r(a) ?? "").trim(), { className: l, style: c, fallback: f, empty: p, children: b } = t;
|
|
214
|
+
if (!i) {
|
|
215
|
+
const d = p ?? f ?? null;
|
|
216
|
+
return d ? /* @__PURE__ */ o("span", { className: l, style: c, children: d }) : null;
|
|
154
217
|
}
|
|
155
|
-
return
|
|
218
|
+
return b ? /* @__PURE__ */ o("span", { className: l, style: c, children: b(i, a) }) : /* @__PURE__ */ o("span", { className: l, style: c, children: i });
|
|
156
219
|
}
|
|
157
|
-
return
|
|
220
|
+
return n.displayName = e, n;
|
|
158
221
|
}
|
|
159
|
-
function
|
|
160
|
-
return
|
|
222
|
+
function G(e, r) {
|
|
223
|
+
return _(e, (n) => r(I(n)));
|
|
161
224
|
}
|
|
162
|
-
const
|
|
163
|
-
var
|
|
164
|
-
const r =
|
|
165
|
-
return (r == null ? void 0 : r.copyright) ?? ((
|
|
166
|
-
}),
|
|
225
|
+
const Tr = G("Ginger.Current.Title", (e) => e == null ? void 0 : e.title), xr = G("Ginger.Current.Artist", (e) => e == null ? void 0 : e.artist), Er = _("Ginger.Current.Album", (e) => Se(e)), Ir = G("Ginger.Current.Description", (e) => e == null ? void 0 : e.description), Ar = _("Ginger.Current.Copyright", (e) => {
|
|
226
|
+
var n;
|
|
227
|
+
const r = I(e);
|
|
228
|
+
return (r == null ? void 0 : r.copyright) ?? ((n = e.playlistMeta) == null ? void 0 : n.copyright);
|
|
229
|
+
}), Rr = G("Ginger.Current.Genre", (e) => e == null ? void 0 : e.genre), Sr = G("Ginger.Current.Label", (e) => e == null ? void 0 : e.label), _r = G("Ginger.Current.Isrc", (e) => e == null ? void 0 : e.isrc), Gr = G(
|
|
167
230
|
"Ginger.Current.TrackNumber",
|
|
168
231
|
(e) => (e == null ? void 0 : e.trackNumber) != null ? String(e.trackNumber) : void 0
|
|
169
232
|
);
|
|
170
|
-
function
|
|
233
|
+
function Ce({ className: e, style: r, fallback: n, empty: t, children: a, format: u }) {
|
|
171
234
|
var f;
|
|
172
|
-
const
|
|
173
|
-
if (typeof
|
|
174
|
-
const
|
|
175
|
-
return
|
|
235
|
+
const i = P(), l = (f = I(i)) == null ? void 0 : f.year;
|
|
236
|
+
if (typeof l != "number" || !Number.isFinite(l)) {
|
|
237
|
+
const p = t ?? n ?? null;
|
|
238
|
+
return p ? /* @__PURE__ */ o("span", { className: e, style: r, children: p }) : null;
|
|
176
239
|
}
|
|
177
|
-
const c =
|
|
178
|
-
return
|
|
240
|
+
const c = u ? u(l) : String(l);
|
|
241
|
+
return a ? /* @__PURE__ */ o("span", { className: e, style: r, children: a(c, i) }) : /* @__PURE__ */ o("span", { className: e, style: r, children: c });
|
|
179
242
|
}
|
|
180
|
-
|
|
181
|
-
function
|
|
182
|
-
var
|
|
183
|
-
const
|
|
243
|
+
Ce.displayName = "Ginger.Current.Year";
|
|
244
|
+
function Ne({ className: e, style: r, fallback: n, empty: t, children: a, preserveWhitespace: u = !0 }) {
|
|
245
|
+
var p;
|
|
246
|
+
const i = P(), l = ((p = I(i)) == null ? void 0 : p.lyrics) ?? "", c = u ? l.replace(/^\s+|\s+$/g, "") : l.trim();
|
|
184
247
|
if (!c) {
|
|
185
|
-
const
|
|
186
|
-
return
|
|
248
|
+
const b = t ?? n ?? null;
|
|
249
|
+
return b ? /* @__PURE__ */ o("span", { className: e, style: r, children: b }) : null;
|
|
187
250
|
}
|
|
188
|
-
const f =
|
|
189
|
-
return
|
|
251
|
+
const f = u ? { whiteSpace: "pre-wrap" } : void 0;
|
|
252
|
+
return a ? /* @__PURE__ */ o("span", { className: e, style: { ...f, ...r }, children: a(c, i) }) : /* @__PURE__ */ o("span", { className: e, style: { ...f, ...r }, children: c });
|
|
190
253
|
}
|
|
191
|
-
|
|
192
|
-
function
|
|
254
|
+
Ne.displayName = "Ginger.Current.Lyrics";
|
|
255
|
+
function we({ visible: e = !1, className: r, style: n, fallback: t, empty: a, children: u }) {
|
|
193
256
|
var c;
|
|
194
|
-
const
|
|
257
|
+
const i = P();
|
|
195
258
|
if (!e) return null;
|
|
196
|
-
const
|
|
197
|
-
if (!
|
|
198
|
-
const f =
|
|
199
|
-
return f ? /* @__PURE__ */
|
|
259
|
+
const l = ((c = I(i)) == null ? void 0 : c.fileUrl) ?? "";
|
|
260
|
+
if (!l) {
|
|
261
|
+
const f = a ?? t ?? null;
|
|
262
|
+
return f ? /* @__PURE__ */ o("span", { className: r, style: n, children: f }) : null;
|
|
200
263
|
}
|
|
201
|
-
return
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
function
|
|
205
|
-
const
|
|
206
|
-
if (!
|
|
207
|
-
const
|
|
208
|
-
return
|
|
264
|
+
return u ? /* @__PURE__ */ o("span", { className: r, style: n, children: u(l, i) }) : /* @__PURE__ */ o("span", { className: r, style: n, children: l });
|
|
265
|
+
}
|
|
266
|
+
we.displayName = "Ginger.Current.FileUrl";
|
|
267
|
+
function Le({ className: e, style: r, fallback: n, empty: t, sizes: a, loading: u, onError: i, decoding: l, imgStyle: c }) {
|
|
268
|
+
const f = P(), p = I(f), b = Re(f);
|
|
269
|
+
if (!b) {
|
|
270
|
+
const y = t ?? n ?? null;
|
|
271
|
+
return y ? /* @__PURE__ */ o("span", { className: e, style: r, children: y }) : null;
|
|
209
272
|
}
|
|
210
|
-
const
|
|
211
|
-
return /* @__PURE__ */
|
|
212
|
-
"
|
|
273
|
+
const d = [p == null ? void 0 : p.title, p == null ? void 0 : p.artist].filter(Boolean).join(" — ") || "Artwork";
|
|
274
|
+
return /* @__PURE__ */ o(
|
|
275
|
+
"div",
|
|
213
276
|
{
|
|
214
277
|
className: e,
|
|
215
278
|
style: {
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
borderRadius: "var(--ginger-artwork-radius, 6px)",
|
|
279
|
+
background: "var(--ginger-artwork-bg, transparent)",
|
|
280
|
+
borderRadius: "var(--ginger-artwork-radius, 0)",
|
|
219
281
|
overflow: "hidden",
|
|
220
282
|
...r
|
|
221
283
|
},
|
|
222
|
-
children: /* @__PURE__ */
|
|
284
|
+
children: /* @__PURE__ */ o(
|
|
223
285
|
"img",
|
|
224
286
|
{
|
|
225
|
-
src:
|
|
226
|
-
alt:
|
|
227
|
-
sizes:
|
|
228
|
-
loading:
|
|
229
|
-
decoding:
|
|
230
|
-
onError:
|
|
287
|
+
src: b,
|
|
288
|
+
alt: d,
|
|
289
|
+
sizes: a,
|
|
290
|
+
loading: u,
|
|
291
|
+
decoding: l,
|
|
292
|
+
onError: i,
|
|
231
293
|
style: {
|
|
232
294
|
display: "block",
|
|
233
295
|
width: "100%",
|
|
@@ -240,288 +302,439 @@ function Me({ className: e, style: r, fallback: t, empty: n, sizes: i, loading:
|
|
|
240
302
|
}
|
|
241
303
|
);
|
|
242
304
|
}
|
|
243
|
-
|
|
244
|
-
function
|
|
245
|
-
const
|
|
246
|
-
if (
|
|
247
|
-
const f =
|
|
248
|
-
return f ? /* @__PURE__ */
|
|
305
|
+
Le.displayName = "Ginger.Current.Artwork";
|
|
306
|
+
function De({ base: e = 0, className: r, style: n, fallback: t, empty: a, children: u }) {
|
|
307
|
+
const i = P();
|
|
308
|
+
if (i.tracks.length === 0) {
|
|
309
|
+
const f = a ?? t ?? null;
|
|
310
|
+
return f ? /* @__PURE__ */ o("span", { className: r, style: n, children: f }) : null;
|
|
249
311
|
}
|
|
250
|
-
const c = String(
|
|
251
|
-
return
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function
|
|
255
|
-
const
|
|
256
|
-
if (
|
|
257
|
-
const
|
|
258
|
-
return
|
|
312
|
+
const c = String(i.currentIndex + e);
|
|
313
|
+
return u ? /* @__PURE__ */ o("span", { className: r, style: n, children: u(c, i) }) : /* @__PURE__ */ o("span", { className: r, style: n, children: c });
|
|
314
|
+
}
|
|
315
|
+
De.displayName = "Ginger.Current.QueueIndex";
|
|
316
|
+
function Fe({ className: e, style: r, fallback: n, empty: t, children: a }) {
|
|
317
|
+
const u = P(), i = String(u.tracks.length);
|
|
318
|
+
if (u.tracks.length === 0) {
|
|
319
|
+
const l = t ?? n ?? null;
|
|
320
|
+
return l ? /* @__PURE__ */ o("span", { className: e, style: r, children: l }) : null;
|
|
259
321
|
}
|
|
260
|
-
return
|
|
322
|
+
return a ? /* @__PURE__ */ o("span", { className: e, style: r, children: a(i, u) }) : /* @__PURE__ */ o("span", { className: e, style: r, children: i });
|
|
261
323
|
}
|
|
262
|
-
|
|
263
|
-
function
|
|
324
|
+
Fe.displayName = "Ginger.Current.QueueLength";
|
|
325
|
+
function Ue({
|
|
264
326
|
base: e = 0,
|
|
265
327
|
separator: r = " / ",
|
|
266
|
-
className:
|
|
267
|
-
style:
|
|
268
|
-
fallback:
|
|
269
|
-
empty:
|
|
270
|
-
children:
|
|
328
|
+
className: n,
|
|
329
|
+
style: t,
|
|
330
|
+
fallback: a,
|
|
331
|
+
empty: u,
|
|
332
|
+
children: i
|
|
271
333
|
}) {
|
|
272
|
-
const
|
|
334
|
+
const l = P(), c = l.tracks.length;
|
|
273
335
|
if (c === 0) {
|
|
274
|
-
const
|
|
275
|
-
return
|
|
336
|
+
const d = u ?? a ?? null;
|
|
337
|
+
return d ? /* @__PURE__ */ o("span", { className: n, style: t, children: d }) : null;
|
|
276
338
|
}
|
|
277
|
-
const f = String(
|
|
278
|
-
return
|
|
339
|
+
const f = String(l.currentIndex + e), p = String(c), b = `${f}${r}${p}`;
|
|
340
|
+
return i ? /* @__PURE__ */ o("span", { className: n, style: t, children: i({ index: f, length: p, label: b }, l) }) : /* @__PURE__ */ o("span", { className: n, style: t, children: b });
|
|
279
341
|
}
|
|
280
|
-
|
|
281
|
-
function
|
|
342
|
+
Ue.displayName = "Ginger.Current.QueuePosition";
|
|
343
|
+
function ce(e) {
|
|
282
344
|
if (!Number.isFinite(e) || e < 0) return "0:00";
|
|
283
345
|
const r = Math.floor(e % 60);
|
|
284
346
|
return `${Math.floor(e / 60)}:${r.toString().padStart(2, "0")}`;
|
|
285
347
|
}
|
|
286
|
-
function
|
|
287
|
-
const { className:
|
|
348
|
+
function ve(e, r, n) {
|
|
349
|
+
const { className: t, style: a, fallback: u, empty: i, children: l, format: c = ce } = n;
|
|
288
350
|
if (!(e >= 0) || !Number.isFinite(e)) {
|
|
289
|
-
const
|
|
290
|
-
return
|
|
351
|
+
const p = i ?? u ?? null;
|
|
352
|
+
return p ? /* @__PURE__ */ o("span", { className: t, style: a, children: p }) : null;
|
|
291
353
|
}
|
|
292
354
|
const f = c(e);
|
|
293
|
-
return
|
|
355
|
+
return l ? /* @__PURE__ */ o("span", { className: t, style: a, children: l(f, r) }) : /* @__PURE__ */ o("span", { className: t, style: a, children: f });
|
|
294
356
|
}
|
|
295
|
-
function
|
|
296
|
-
const
|
|
297
|
-
return
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
function
|
|
301
|
-
const
|
|
302
|
-
return
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
function
|
|
306
|
-
const
|
|
307
|
-
return
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
function
|
|
311
|
-
const
|
|
312
|
-
if (!(
|
|
313
|
-
const c =
|
|
314
|
-
return c ? /* @__PURE__ */
|
|
357
|
+
function Ve(e) {
|
|
358
|
+
const r = P();
|
|
359
|
+
return ve(r.currentTime, r, e);
|
|
360
|
+
}
|
|
361
|
+
Ve.displayName = "Ginger.Current.Elapsed";
|
|
362
|
+
function Be(e) {
|
|
363
|
+
const r = P();
|
|
364
|
+
return ve(F(r), r, e);
|
|
365
|
+
}
|
|
366
|
+
Be.displayName = "Ginger.Current.Duration";
|
|
367
|
+
function $e(e) {
|
|
368
|
+
const r = P();
|
|
369
|
+
return ve(Ae(r), r, e);
|
|
370
|
+
}
|
|
371
|
+
$e.displayName = "Ginger.Current.Remaining";
|
|
372
|
+
function Oe({ className: e, style: r, fallback: n, empty: t, children: a }) {
|
|
373
|
+
const u = P(), i = F(u), l = Pe(u);
|
|
374
|
+
if (!(i > 0)) {
|
|
375
|
+
const c = t ?? n ?? null;
|
|
376
|
+
return c ? /* @__PURE__ */ o("span", { className: e, style: r, children: c }) : null;
|
|
315
377
|
}
|
|
316
|
-
return
|
|
378
|
+
return a ? /* @__PURE__ */ o("span", { className: e, style: r, children: a({ fraction: l, currentTime: u.currentTime, duration: i }, u) }) : /* @__PURE__ */ o("span", { className: e, style: r, children: `${Math.round(l * 100)}%` });
|
|
317
379
|
}
|
|
318
|
-
|
|
319
|
-
function
|
|
320
|
-
const
|
|
321
|
-
return /* @__PURE__ */
|
|
380
|
+
Oe.displayName = "Ginger.Current.Progress";
|
|
381
|
+
function Ye({ className: e, style: r, height: n = 4, showBuffered: t = !1 }) {
|
|
382
|
+
const a = P(), u = `${Math.round(Pe(a) * 100)}%`, i = `${Math.round(Math.min(1, Math.max(0, a.bufferedFraction)) * 100)}%`;
|
|
383
|
+
return /* @__PURE__ */ he(
|
|
322
384
|
"div",
|
|
323
385
|
{
|
|
324
386
|
className: e,
|
|
325
387
|
style: {
|
|
326
388
|
width: "100%",
|
|
327
|
-
height:
|
|
389
|
+
height: n,
|
|
328
390
|
background: "var(--ginger-muted-color, #e5e7eb)",
|
|
329
391
|
borderRadius: 999,
|
|
330
392
|
overflow: "hidden",
|
|
393
|
+
position: "relative",
|
|
331
394
|
...r
|
|
332
395
|
},
|
|
333
396
|
"aria-hidden": !0,
|
|
334
|
-
children:
|
|
397
|
+
children: [
|
|
398
|
+
t ? /* @__PURE__ */ o(
|
|
399
|
+
"div",
|
|
400
|
+
{
|
|
401
|
+
style: {
|
|
402
|
+
position: "absolute",
|
|
403
|
+
left: 0,
|
|
404
|
+
top: 0,
|
|
405
|
+
height: "100%",
|
|
406
|
+
width: i,
|
|
407
|
+
background: "var(--ginger-buffer-color, rgba(107, 114, 128, 0.35))"
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
) : null,
|
|
411
|
+
/* @__PURE__ */ o(
|
|
412
|
+
"div",
|
|
413
|
+
{
|
|
414
|
+
style: {
|
|
415
|
+
position: "relative",
|
|
416
|
+
width: u,
|
|
417
|
+
height: "100%",
|
|
418
|
+
background: "var(--ginger-primary-color, #111827)"
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
)
|
|
422
|
+
]
|
|
335
423
|
}
|
|
336
424
|
);
|
|
337
425
|
}
|
|
338
|
-
|
|
339
|
-
function
|
|
340
|
-
const
|
|
341
|
-
return
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
426
|
+
Ye.displayName = "Ginger.Current.TimeRail";
|
|
427
|
+
function Qe({ className: e, style: r, height: n = 4 }) {
|
|
428
|
+
const t = P(), a = `${Math.round(Math.min(1, Math.max(0, t.bufferedFraction)) * 100)}%`;
|
|
429
|
+
return /* @__PURE__ */ o(
|
|
430
|
+
"div",
|
|
431
|
+
{
|
|
432
|
+
className: e,
|
|
433
|
+
style: {
|
|
434
|
+
width: "100%",
|
|
435
|
+
height: n,
|
|
436
|
+
background: "var(--ginger-muted-color, #e5e7eb)",
|
|
437
|
+
borderRadius: 999,
|
|
438
|
+
overflow: "hidden",
|
|
439
|
+
...r
|
|
440
|
+
},
|
|
441
|
+
"aria-hidden": !0,
|
|
442
|
+
children: /* @__PURE__ */ o(
|
|
443
|
+
"div",
|
|
444
|
+
{
|
|
445
|
+
style: {
|
|
446
|
+
width: a,
|
|
447
|
+
height: "100%",
|
|
448
|
+
background: "var(--ginger-buffer-color, rgba(107, 114, 128, 0.35))"
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
)
|
|
452
|
+
}
|
|
453
|
+
);
|
|
454
|
+
}
|
|
455
|
+
Qe.displayName = "Ginger.Current.BufferRail";
|
|
456
|
+
function je({ className: e, style: r, fallback: n, empty: t, children: a }) {
|
|
457
|
+
const u = P(), i = ke(u);
|
|
458
|
+
return a ? /* @__PURE__ */ o("span", { className: e, style: r, children: a(i, u) }) : /* @__PURE__ */ o("span", { className: e, style: r, children: i });
|
|
459
|
+
}
|
|
460
|
+
je.displayName = "Ginger.Current.PlaybackState";
|
|
461
|
+
function Xe({ className: e, style: r, fallback: n, empty: t, children: a }) {
|
|
462
|
+
const u = P(), i = u.errorMessage ?? "";
|
|
463
|
+
if (!i) {
|
|
464
|
+
const l = t ?? n ?? null;
|
|
465
|
+
return l ? /* @__PURE__ */ o("span", { className: e, style: r, children: l }) : null;
|
|
349
466
|
}
|
|
350
|
-
return
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
467
|
+
return a ? /* @__PURE__ */ o("span", { className: e, style: r, children: a(i, u) }) : /* @__PURE__ */ o("span", { className: e, style: r, children: i });
|
|
468
|
+
}
|
|
469
|
+
Xe.displayName = "Ginger.Current.ErrorMessage";
|
|
470
|
+
const de = {
|
|
471
|
+
seek: "Seek",
|
|
472
|
+
volume: "Volume",
|
|
473
|
+
playbackSpeed: "Playback speed",
|
|
474
|
+
nextTrack: "Next track",
|
|
475
|
+
previousTrack: "Previous track",
|
|
476
|
+
shuffle: "Shuffle",
|
|
477
|
+
mute: "Mute",
|
|
478
|
+
unmute: "Unmute",
|
|
479
|
+
play: "Play",
|
|
480
|
+
pause: "Pause",
|
|
481
|
+
repeat: {
|
|
482
|
+
off: "Repeat off",
|
|
483
|
+
all: "Repeat all",
|
|
484
|
+
one: "Repeat one"
|
|
485
|
+
},
|
|
486
|
+
playbackRateNormal: "1× normal",
|
|
487
|
+
playbackRateTimes: (e) => `${e}×`
|
|
362
488
|
};
|
|
363
|
-
function
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
function
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
return
|
|
489
|
+
function Cr(e) {
|
|
490
|
+
return e ? {
|
|
491
|
+
...de,
|
|
492
|
+
...e,
|
|
493
|
+
repeat: { ...de.repeat, ...e.repeat }
|
|
494
|
+
} : de;
|
|
495
|
+
}
|
|
496
|
+
const We = Y(de);
|
|
497
|
+
function Nr({
|
|
498
|
+
locale: e,
|
|
499
|
+
children: r
|
|
500
|
+
}) {
|
|
501
|
+
const n = Cr(e);
|
|
502
|
+
return /* @__PURE__ */ o(We.Provider, { value: n, children: r });
|
|
503
|
+
}
|
|
504
|
+
function x() {
|
|
505
|
+
return O(We);
|
|
506
|
+
}
|
|
507
|
+
function wr() {
|
|
508
|
+
const e = T(), r = U(), n = x(), t = E(() => pe(e, r), [e, r]), a = F(t), u = a > 0 ? t.currentTime : 0, i = Number.isFinite(u) ? u : 0, l = a > 0 ? `${ce(i)} of ${ce(a)}` : ce(i), c = (f) => {
|
|
509
|
+
r.seek(Number(f.currentTarget.value));
|
|
510
|
+
};
|
|
511
|
+
return {
|
|
512
|
+
state: t,
|
|
513
|
+
value: i,
|
|
514
|
+
min: 0,
|
|
515
|
+
max: a > 0 ? a : 1,
|
|
516
|
+
step: "any",
|
|
517
|
+
ariaValueText: l,
|
|
518
|
+
ariaLabel: n.seek,
|
|
519
|
+
onSeekInput: c,
|
|
520
|
+
onSeekChange: c
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
function Lr() {
|
|
524
|
+
const e = T(), r = U(), n = x(), t = E(() => pe(e, r), [e, r]), a = (u) => {
|
|
525
|
+
r.setVolume(Number(u.currentTarget.value));
|
|
526
|
+
};
|
|
527
|
+
return {
|
|
528
|
+
state: t,
|
|
529
|
+
value: t.volume,
|
|
530
|
+
min: 0,
|
|
531
|
+
max: 1,
|
|
532
|
+
step: "any",
|
|
533
|
+
ariaValueText: `${Math.round(t.volume * 100)}%`,
|
|
534
|
+
ariaLabel: n.volume,
|
|
535
|
+
onVolumeInput: a,
|
|
536
|
+
onVolumeChange: a
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
function Dr(e) {
|
|
540
|
+
const r = T(), n = x(), t = (e == null ? void 0 : e.playAriaLabel) ?? n.play, a = (e == null ? void 0 : e.pauseAriaLabel) ?? n.pause;
|
|
541
|
+
return {
|
|
542
|
+
isPaused: r.isPaused,
|
|
543
|
+
toggle: r.togglePlayPause,
|
|
544
|
+
ariaLabel: r.isPaused ? t : a
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
function ze({
|
|
548
|
+
playLabel: e = "Play",
|
|
549
|
+
pauseLabel: r = "Pause",
|
|
550
|
+
playAriaLabel: n,
|
|
551
|
+
pauseAriaLabel: t,
|
|
552
|
+
type: a = "button",
|
|
553
|
+
...u
|
|
554
|
+
}) {
|
|
555
|
+
const i = x(), l = typeof e == "string" ? e : i.play, c = typeof r == "string" ? r : i.pause, f = Dr({
|
|
556
|
+
playAriaLabel: n ?? l,
|
|
557
|
+
pauseAriaLabel: t ?? c
|
|
558
|
+
});
|
|
559
|
+
return /* @__PURE__ */ o("button", { type: a, "aria-label": f.ariaLabel, onClick: f.toggle, ...u, children: f.isPaused ? e : r });
|
|
560
|
+
}
|
|
561
|
+
ze.displayName = "Ginger.Control.PlayPause";
|
|
562
|
+
function He({ type: e = "button", ...r }) {
|
|
563
|
+
const { repeatMode: n, cycleRepeat: t } = T(), u = x().repeat[n];
|
|
564
|
+
return /* @__PURE__ */ o("button", { type: e, "aria-label": u, onClick: t, ...r, children: u });
|
|
565
|
+
}
|
|
566
|
+
He.displayName = "Ginger.Control.Repeat";
|
|
567
|
+
function qe({ type: e = "button", children: r = "Next", ...n }) {
|
|
568
|
+
const { next: t } = T(), a = x();
|
|
569
|
+
return /* @__PURE__ */ o("button", { type: e, "aria-label": a.nextTrack, onClick: t, ...n, children: r });
|
|
570
|
+
}
|
|
571
|
+
qe.displayName = "Ginger.Control.Next";
|
|
572
|
+
function Ke({ type: e = "button", children: r = "Previous", ...n }) {
|
|
573
|
+
const { prev: t } = T(), a = x();
|
|
574
|
+
return /* @__PURE__ */ o("button", { type: e, "aria-label": a.previousTrack, onClick: t, ...n, children: r });
|
|
575
|
+
}
|
|
576
|
+
Ke.displayName = "Ginger.Control.Previous";
|
|
577
|
+
function Je({ type: e = "button", children: r = "Shuffle", ...n }) {
|
|
578
|
+
const { isShuffled: t, toggleShuffle: a } = T(), u = x();
|
|
579
|
+
return /* @__PURE__ */ o(
|
|
580
|
+
"button",
|
|
581
|
+
{
|
|
582
|
+
type: e,
|
|
583
|
+
"aria-pressed": t,
|
|
584
|
+
"aria-label": u.shuffle,
|
|
585
|
+
onClick: a,
|
|
586
|
+
...n,
|
|
587
|
+
children: r
|
|
588
|
+
}
|
|
589
|
+
);
|
|
590
|
+
}
|
|
591
|
+
Je.displayName = "Ginger.Control.Shuffle";
|
|
592
|
+
function Ze({ inputStyle: e, style: r, ...n }) {
|
|
593
|
+
const t = wr();
|
|
594
|
+
return /* @__PURE__ */ o(
|
|
386
595
|
"input",
|
|
387
596
|
{
|
|
597
|
+
...n,
|
|
388
598
|
type: "range",
|
|
389
|
-
min:
|
|
390
|
-
max:
|
|
391
|
-
step:
|
|
392
|
-
value:
|
|
393
|
-
"aria-label":
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
599
|
+
min: t.min,
|
|
600
|
+
max: t.max,
|
|
601
|
+
step: t.step,
|
|
602
|
+
value: t.value,
|
|
603
|
+
"aria-label": t.ariaLabel,
|
|
604
|
+
"aria-valuetext": t.ariaValueText,
|
|
605
|
+
onInput: t.onSeekInput,
|
|
606
|
+
onChange: t.onSeekChange,
|
|
607
|
+
style: { width: "100%", ...r, ...e }
|
|
397
608
|
}
|
|
398
609
|
);
|
|
399
610
|
}
|
|
400
|
-
|
|
401
|
-
function
|
|
402
|
-
const
|
|
403
|
-
return /* @__PURE__ */
|
|
611
|
+
Ze.displayName = "Ginger.Control.SeekBar";
|
|
612
|
+
function er({ inputStyle: e, style: r, ...n }) {
|
|
613
|
+
const t = Lr();
|
|
614
|
+
return /* @__PURE__ */ o(
|
|
404
615
|
"input",
|
|
405
616
|
{
|
|
617
|
+
...n,
|
|
406
618
|
type: "range",
|
|
407
|
-
min:
|
|
408
|
-
max:
|
|
409
|
-
step:
|
|
410
|
-
value:
|
|
411
|
-
"aria-label":
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
619
|
+
min: t.min,
|
|
620
|
+
max: t.max,
|
|
621
|
+
step: t.step,
|
|
622
|
+
value: t.value,
|
|
623
|
+
"aria-label": t.ariaLabel,
|
|
624
|
+
"aria-valuetext": t.ariaValueText,
|
|
625
|
+
onInput: t.onVolumeInput,
|
|
626
|
+
onChange: t.onVolumeChange,
|
|
627
|
+
style: { width: "100%", ...r, ...e }
|
|
415
628
|
}
|
|
416
629
|
);
|
|
417
630
|
}
|
|
418
|
-
|
|
419
|
-
function
|
|
420
|
-
muteLabel: e
|
|
421
|
-
unmuteLabel: r
|
|
422
|
-
type:
|
|
423
|
-
...
|
|
631
|
+
er.displayName = "Ginger.Control.Volume";
|
|
632
|
+
function rr({
|
|
633
|
+
muteLabel: e,
|
|
634
|
+
unmuteLabel: r,
|
|
635
|
+
type: n = "button",
|
|
636
|
+
...t
|
|
424
637
|
}) {
|
|
425
|
-
const {
|
|
426
|
-
return /* @__PURE__ */
|
|
638
|
+
const { muted: a, toggleMute: u } = U(), i = x(), l = e ?? i.mute, c = r ?? i.unmute;
|
|
639
|
+
return /* @__PURE__ */ o(
|
|
427
640
|
"button",
|
|
428
641
|
{
|
|
429
|
-
type:
|
|
430
|
-
"aria-pressed":
|
|
431
|
-
"aria-label":
|
|
432
|
-
onClick:
|
|
433
|
-
...
|
|
434
|
-
children:
|
|
642
|
+
type: n,
|
|
643
|
+
"aria-pressed": a,
|
|
644
|
+
"aria-label": a ? i.unmute : i.mute,
|
|
645
|
+
onClick: u,
|
|
646
|
+
...t,
|
|
647
|
+
children: a ? c : l
|
|
435
648
|
}
|
|
436
649
|
);
|
|
437
650
|
}
|
|
438
|
-
|
|
439
|
-
const
|
|
440
|
-
function
|
|
441
|
-
const {
|
|
442
|
-
() => Array.from(/* @__PURE__ */ new Set([...e,
|
|
443
|
-
[e,
|
|
651
|
+
rr.displayName = "Ginger.Control.Mute";
|
|
652
|
+
const Fr = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
653
|
+
function nr({ rates: e = Fr, style: r, ...n }) {
|
|
654
|
+
const { playbackRate: t, setPlaybackRate: a } = U(), u = x(), i = E(
|
|
655
|
+
() => Array.from(/* @__PURE__ */ new Set([...e, t])).sort((l, c) => l - c),
|
|
656
|
+
[e, t]
|
|
444
657
|
);
|
|
445
|
-
return /* @__PURE__ */
|
|
658
|
+
return /* @__PURE__ */ o(
|
|
446
659
|
"select",
|
|
447
660
|
{
|
|
448
|
-
|
|
449
|
-
|
|
661
|
+
...n,
|
|
662
|
+
"aria-label": u.playbackSpeed,
|
|
663
|
+
value: String(t),
|
|
450
664
|
style: r,
|
|
451
|
-
onChange: (
|
|
452
|
-
|
|
453
|
-
children: a.map((u) => /* @__PURE__ */ l("option", { value: String(u), children: u === 1 ? "1× normal" : `${u}×` }, u))
|
|
665
|
+
onChange: (l) => a(Number(l.currentTarget.value)),
|
|
666
|
+
children: i.map((l) => /* @__PURE__ */ o("option", { value: String(l), children: l === 1 ? u.playbackRateNormal : u.playbackRateTimes(l) }, l))
|
|
454
667
|
}
|
|
455
668
|
);
|
|
456
669
|
}
|
|
457
|
-
|
|
458
|
-
const
|
|
459
|
-
function
|
|
460
|
-
const e =
|
|
670
|
+
nr.displayName = "Ginger.Control.PlaybackRate";
|
|
671
|
+
const be = Y(null);
|
|
672
|
+
function Ur() {
|
|
673
|
+
const e = O(be);
|
|
461
674
|
if (!e)
|
|
462
675
|
throw new Error("Ginger.Playlist.Track must be used inside <Ginger.Playlist>");
|
|
463
676
|
return e;
|
|
464
677
|
}
|
|
465
|
-
function
|
|
678
|
+
function tr({
|
|
466
679
|
children: e,
|
|
467
680
|
rowStyle: r,
|
|
468
|
-
renderTrack:
|
|
469
|
-
playOnSelect:
|
|
470
|
-
style:
|
|
471
|
-
...
|
|
681
|
+
renderTrack: n,
|
|
682
|
+
playOnSelect: t = !0,
|
|
683
|
+
style: a,
|
|
684
|
+
...u
|
|
472
685
|
}) {
|
|
473
|
-
const {
|
|
686
|
+
const { tracks: i, currentIndex: l, playTrackAt: c, selectTrackAt: f } = T(), p = {
|
|
474
687
|
listStyle: "none",
|
|
475
688
|
margin: 0,
|
|
476
689
|
padding: 0,
|
|
477
690
|
fontFamily: "var(--ginger-font-family, system-ui, sans-serif)",
|
|
478
691
|
fontSize: "var(--ginger-font-size, 14px)",
|
|
479
692
|
color: "var(--ginger-primary-color, #111827)",
|
|
480
|
-
...
|
|
693
|
+
...a
|
|
481
694
|
};
|
|
482
|
-
return e !== void 0 ? /* @__PURE__ */
|
|
483
|
-
const
|
|
484
|
-
return /* @__PURE__ */
|
|
695
|
+
return e !== void 0 ? /* @__PURE__ */ o(be.Provider, { value: { playOnSelect: t }, children: /* @__PURE__ */ o("ul", { style: p, ...u, children: e }) }) : /* @__PURE__ */ o(be.Provider, { value: { playOnSelect: t }, children: /* @__PURE__ */ o("ul", { style: p, ...u, children: i.map((d, y) => {
|
|
696
|
+
const k = y === l;
|
|
697
|
+
return /* @__PURE__ */ o("li", { children: /* @__PURE__ */ o(
|
|
485
698
|
"button",
|
|
486
699
|
{
|
|
487
700
|
type: "button",
|
|
488
701
|
onClick: () => {
|
|
489
|
-
|
|
702
|
+
t ? c(y) : f(y);
|
|
490
703
|
},
|
|
491
704
|
style: {
|
|
492
705
|
width: "100%",
|
|
493
706
|
textAlign: "left",
|
|
494
707
|
border: "none",
|
|
495
|
-
background:
|
|
708
|
+
background: k ? "var(--ginger-playlist-active-bg, rgba(17, 24, 39, 0.06))" : "transparent",
|
|
496
709
|
color: "inherit",
|
|
497
710
|
font: "inherit",
|
|
498
711
|
cursor: "pointer",
|
|
499
712
|
padding: "var(--ginger-playlist-row-padding, 6px 8px)",
|
|
500
713
|
...r
|
|
501
714
|
},
|
|
502
|
-
children:
|
|
715
|
+
children: n ? n(d, y, k) : /* @__PURE__ */ he("span", { children: [
|
|
503
716
|
d.title,
|
|
504
717
|
d.artist ? ` — ${d.artist}` : ""
|
|
505
718
|
] })
|
|
506
719
|
}
|
|
507
|
-
) }, `${
|
|
720
|
+
) }, `${y}-${me(d)}`);
|
|
508
721
|
}) }) });
|
|
509
722
|
}
|
|
510
|
-
|
|
511
|
-
function
|
|
723
|
+
tr.displayName = "Ginger.Playlist";
|
|
724
|
+
function ar({
|
|
512
725
|
index: e,
|
|
513
726
|
className: r,
|
|
514
|
-
style:
|
|
515
|
-
children:
|
|
516
|
-
liProps:
|
|
517
|
-
onClick:
|
|
518
|
-
...
|
|
727
|
+
style: n,
|
|
728
|
+
children: t,
|
|
729
|
+
liProps: a,
|
|
730
|
+
onClick: u,
|
|
731
|
+
...i
|
|
519
732
|
}) {
|
|
520
|
-
const { playOnSelect:
|
|
733
|
+
const { playOnSelect: l } = Ur(), { tracks: c, currentIndex: f, playTrackAt: p, selectTrackAt: b } = T(), d = e === f, y = c[e], k = y != null ? /* @__PURE__ */ he("span", { children: [
|
|
521
734
|
y.title,
|
|
522
735
|
y.artist ? ` — ${y.artist}` : ""
|
|
523
736
|
] }) : null;
|
|
524
|
-
return /* @__PURE__ */
|
|
737
|
+
return /* @__PURE__ */ o("li", { ...a, children: /* @__PURE__ */ o(
|
|
525
738
|
"button",
|
|
526
739
|
{
|
|
527
740
|
type: "button",
|
|
@@ -532,46 +745,46 @@ function Ve({
|
|
|
532
745
|
width: "100%",
|
|
533
746
|
textAlign: "left",
|
|
534
747
|
border: "none",
|
|
535
|
-
background: d ? "rgba(17, 24, 39, 0.06)" : "transparent",
|
|
748
|
+
background: d ? "var(--ginger-playlist-active-bg, rgba(17, 24, 39, 0.06))" : "transparent",
|
|
536
749
|
color: "inherit",
|
|
537
750
|
font: "inherit",
|
|
538
751
|
cursor: "pointer",
|
|
539
752
|
padding: "var(--ginger-playlist-row-padding, 6px 8px)",
|
|
540
|
-
...
|
|
753
|
+
...n
|
|
541
754
|
},
|
|
542
|
-
...
|
|
543
|
-
onClick: (
|
|
544
|
-
|
|
755
|
+
...i,
|
|
756
|
+
onClick: (v) => {
|
|
757
|
+
u == null || u(v), !v.defaultPrevented && (l ? p(e) : b(e));
|
|
545
758
|
},
|
|
546
|
-
children:
|
|
759
|
+
children: t ?? k
|
|
547
760
|
}
|
|
548
761
|
) });
|
|
549
762
|
}
|
|
550
|
-
|
|
551
|
-
const
|
|
552
|
-
Track:
|
|
553
|
-
}),
|
|
763
|
+
ar.displayName = "Ginger.Playlist.Track";
|
|
764
|
+
const Vr = Object.assign(tr, {
|
|
765
|
+
Track: ar
|
|
766
|
+
}), Br = _("Ginger.Queue.Title", (e) => {
|
|
554
767
|
var r;
|
|
555
768
|
return (r = e.playlistMeta) == null ? void 0 : r.title;
|
|
556
|
-
}),
|
|
769
|
+
}), $r = _("Ginger.Queue.Subtitle", (e) => {
|
|
557
770
|
var r;
|
|
558
771
|
return (r = e.playlistMeta) == null ? void 0 : r.subtitle;
|
|
559
|
-
}),
|
|
772
|
+
}), Or = _("Ginger.Queue.Description", (e) => {
|
|
560
773
|
var r;
|
|
561
774
|
return (r = e.playlistMeta) == null ? void 0 : r.description;
|
|
562
|
-
}),
|
|
775
|
+
}), Yr = _("Ginger.Queue.Copyright", (e) => {
|
|
563
776
|
var r;
|
|
564
777
|
return (r = e.playlistMeta) == null ? void 0 : r.copyright;
|
|
565
778
|
});
|
|
566
|
-
function
|
|
779
|
+
function ur({ className: e, style: r, fallback: n, empty: t, imgStyle: a }) {
|
|
567
780
|
var c, f;
|
|
568
|
-
const
|
|
569
|
-
if (!
|
|
570
|
-
const
|
|
571
|
-
return
|
|
781
|
+
const u = P(), i = (c = u.playlistMeta) == null ? void 0 : c.artworkUrl;
|
|
782
|
+
if (!i) {
|
|
783
|
+
const p = t ?? n ?? null;
|
|
784
|
+
return p ? /* @__PURE__ */ o("span", { className: e, style: r, children: p }) : null;
|
|
572
785
|
}
|
|
573
|
-
const
|
|
574
|
-
return /* @__PURE__ */
|
|
786
|
+
const l = ((f = u.playlistMeta) == null ? void 0 : f.title) ?? "Playlist artwork";
|
|
787
|
+
return /* @__PURE__ */ o(
|
|
575
788
|
"span",
|
|
576
789
|
{
|
|
577
790
|
className: e,
|
|
@@ -582,101 +795,103 @@ function $e({ className: e, style: r, fallback: t, empty: n, imgStyle: i }) {
|
|
|
582
795
|
overflow: "hidden",
|
|
583
796
|
...r
|
|
584
797
|
},
|
|
585
|
-
children: /* @__PURE__ */
|
|
798
|
+
children: /* @__PURE__ */ o(
|
|
586
799
|
"img",
|
|
587
800
|
{
|
|
588
|
-
src:
|
|
589
|
-
alt:
|
|
801
|
+
src: i,
|
|
802
|
+
alt: l,
|
|
590
803
|
style: {
|
|
591
804
|
display: "block",
|
|
592
805
|
width: "100%",
|
|
593
806
|
height: "100%",
|
|
594
807
|
objectFit: "cover",
|
|
595
|
-
...
|
|
808
|
+
...a
|
|
596
809
|
}
|
|
597
810
|
}
|
|
598
811
|
)
|
|
599
812
|
}
|
|
600
813
|
);
|
|
601
814
|
}
|
|
602
|
-
|
|
603
|
-
function
|
|
815
|
+
ur.displayName = "Ginger.Queue.Artwork";
|
|
816
|
+
function fe(e) {
|
|
604
817
|
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : 1;
|
|
605
818
|
}
|
|
606
|
-
function
|
|
819
|
+
function Me(e) {
|
|
607
820
|
return Number.isFinite(e) ? Math.min(4, Math.max(0.25, e)) : 1;
|
|
608
821
|
}
|
|
609
|
-
const
|
|
822
|
+
const $ = {
|
|
610
823
|
currentTime: 0,
|
|
611
824
|
duration: 0,
|
|
612
825
|
bufferedFraction: 0,
|
|
613
826
|
isBuffering: !1,
|
|
614
827
|
errorMessage: null
|
|
615
|
-
},
|
|
616
|
-
|
|
828
|
+
}, Qr = {
|
|
829
|
+
...$,
|
|
617
830
|
volume: 1,
|
|
618
831
|
muted: !1,
|
|
619
832
|
playbackRate: 1
|
|
620
833
|
};
|
|
621
|
-
function
|
|
834
|
+
function ir(e) {
|
|
622
835
|
const r = [...e.tracks];
|
|
623
|
-
let
|
|
624
|
-
return e.isShuffled && r.length > 1 && (
|
|
625
|
-
tracks:
|
|
626
|
-
currentIndex:
|
|
836
|
+
let n = D(e.currentIndex ?? 0, r.length), t = null, a = r;
|
|
837
|
+
return e.isShuffled && r.length > 1 && (t = [...r], a = Ie(r, n), n = 0), {
|
|
838
|
+
tracks: a,
|
|
839
|
+
currentIndex: n,
|
|
627
840
|
isPaused: e.isPaused ?? !0,
|
|
628
|
-
isShuffled: !!(e.isShuffled &&
|
|
841
|
+
isShuffled: !!(e.isShuffled && a.length > 1),
|
|
629
842
|
repeatMode: e.repeatMode ?? "off",
|
|
630
|
-
originalTracks:
|
|
843
|
+
originalTracks: t,
|
|
631
844
|
playlistMeta: e.playlistMeta ?? null,
|
|
632
|
-
...
|
|
633
|
-
volume:
|
|
845
|
+
...Qr,
|
|
846
|
+
volume: fe(e.volume ?? 1),
|
|
634
847
|
muted: e.muted ?? !1,
|
|
635
|
-
playbackRate:
|
|
848
|
+
playbackRate: Me(e.playbackRate ?? 1)
|
|
636
849
|
};
|
|
637
850
|
}
|
|
638
|
-
function
|
|
851
|
+
function jr(e, r) {
|
|
639
852
|
switch (r.type) {
|
|
640
853
|
case "INIT": {
|
|
641
854
|
const {
|
|
642
|
-
tracks:
|
|
643
|
-
currentIndex:
|
|
644
|
-
playlistMeta:
|
|
645
|
-
isPaused:
|
|
646
|
-
isShuffled:
|
|
647
|
-
repeatMode:
|
|
855
|
+
tracks: n,
|
|
856
|
+
currentIndex: t,
|
|
857
|
+
playlistMeta: a,
|
|
858
|
+
isPaused: u,
|
|
859
|
+
isShuffled: i,
|
|
860
|
+
repeatMode: l,
|
|
648
861
|
volume: c,
|
|
649
862
|
muted: f,
|
|
650
|
-
playbackRate:
|
|
863
|
+
playbackRate: p
|
|
651
864
|
} = r.payload;
|
|
652
|
-
return
|
|
653
|
-
tracks:
|
|
654
|
-
currentIndex:
|
|
655
|
-
playlistMeta:
|
|
656
|
-
isPaused:
|
|
657
|
-
isShuffled:
|
|
658
|
-
repeatMode:
|
|
865
|
+
return ir({
|
|
866
|
+
tracks: n,
|
|
867
|
+
currentIndex: t,
|
|
868
|
+
playlistMeta: a ?? null,
|
|
869
|
+
isPaused: u ?? !0,
|
|
870
|
+
isShuffled: i ?? !1,
|
|
871
|
+
repeatMode: l ?? "off",
|
|
659
872
|
volume: c,
|
|
660
873
|
muted: f,
|
|
661
|
-
playbackRate:
|
|
874
|
+
playbackRate: p
|
|
662
875
|
});
|
|
663
876
|
}
|
|
664
877
|
case "SET_QUEUE": {
|
|
665
|
-
const { tracks:
|
|
878
|
+
const { tracks: n, currentIndex: t } = r.payload, a = [...n], u = D(t ?? e.currentIndex, a.length);
|
|
666
879
|
return {
|
|
667
880
|
...e,
|
|
668
|
-
tracks:
|
|
669
|
-
currentIndex:
|
|
670
|
-
|
|
881
|
+
tracks: a,
|
|
882
|
+
currentIndex: u,
|
|
883
|
+
isShuffled: !1,
|
|
884
|
+
originalTracks: null,
|
|
885
|
+
...$
|
|
671
886
|
};
|
|
672
887
|
}
|
|
673
888
|
case "SET_INDEX": {
|
|
674
|
-
const
|
|
889
|
+
const n = D(r.payload.index, e.tracks.length), t = r.payload.autoPlay, a = t === !0 ? !1 : t === !1 ? !0 : e.isPaused;
|
|
675
890
|
return {
|
|
676
891
|
...e,
|
|
677
|
-
currentIndex:
|
|
678
|
-
|
|
679
|
-
isPaused:
|
|
892
|
+
currentIndex: n,
|
|
893
|
+
...$,
|
|
894
|
+
isPaused: a
|
|
680
895
|
};
|
|
681
896
|
}
|
|
682
897
|
case "PLAY":
|
|
@@ -688,44 +903,44 @@ function Mr(e, r) {
|
|
|
688
903
|
case "SET_REPEAT":
|
|
689
904
|
return { ...e, repeatMode: r.payload };
|
|
690
905
|
case "CYCLE_REPEAT":
|
|
691
|
-
return { ...e, repeatMode:
|
|
906
|
+
return { ...e, repeatMode: Pr(e.repeatMode) };
|
|
692
907
|
case "TOGGLE_SHUFFLE": {
|
|
693
908
|
if (e.tracks.length <= 1) return { ...e, isShuffled: !1, originalTracks: null };
|
|
694
909
|
if (!e.isShuffled) {
|
|
695
|
-
const u = [...e.tracks],
|
|
910
|
+
const u = [...e.tracks], i = Ie(u, e.currentIndex);
|
|
696
911
|
return {
|
|
697
912
|
...e,
|
|
698
913
|
isShuffled: !0,
|
|
699
914
|
originalTracks: u,
|
|
700
|
-
tracks:
|
|
915
|
+
tracks: i,
|
|
701
916
|
currentIndex: 0
|
|
702
917
|
};
|
|
703
918
|
}
|
|
704
|
-
const
|
|
919
|
+
const n = e.originalTracks ? [...e.originalTracks] : [...e.tracks], t = e.tracks[e.currentIndex], a = mr(n, t);
|
|
705
920
|
return {
|
|
706
921
|
...e,
|
|
707
922
|
isShuffled: !1,
|
|
708
923
|
originalTracks: null,
|
|
709
|
-
tracks:
|
|
710
|
-
currentIndex:
|
|
924
|
+
tracks: n,
|
|
925
|
+
currentIndex: D(a, n.length)
|
|
711
926
|
};
|
|
712
927
|
}
|
|
713
928
|
case "NEXT": {
|
|
714
|
-
const
|
|
929
|
+
const n = hr(e), t = n === e.currentIndex;
|
|
715
930
|
return {
|
|
716
931
|
...e,
|
|
717
|
-
currentIndex:
|
|
718
|
-
...
|
|
719
|
-
isPaused:
|
|
932
|
+
currentIndex: n,
|
|
933
|
+
...t ? {} : $,
|
|
934
|
+
isPaused: t ? e.isPaused : !1
|
|
720
935
|
};
|
|
721
936
|
}
|
|
722
937
|
case "PREV": {
|
|
723
|
-
const
|
|
938
|
+
const n = kr(e), t = n === e.currentIndex;
|
|
724
939
|
return {
|
|
725
940
|
...e,
|
|
726
|
-
currentIndex:
|
|
727
|
-
...
|
|
728
|
-
isPaused:
|
|
941
|
+
currentIndex: n,
|
|
942
|
+
...t ? {} : $,
|
|
943
|
+
isPaused: t ? e.isPaused : !1
|
|
729
944
|
};
|
|
730
945
|
}
|
|
731
946
|
case "MEDIA_TIME_UPDATE":
|
|
@@ -763,303 +978,440 @@ function Mr(e, r) {
|
|
|
763
978
|
case "RESET_MEDIA_TIMES":
|
|
764
979
|
return { ...e, currentTime: 0, duration: 0, bufferedFraction: 0 };
|
|
765
980
|
case "SET_VOLUME":
|
|
766
|
-
return { ...e, volume:
|
|
981
|
+
return { ...e, volume: fe(r.payload) };
|
|
767
982
|
case "SET_MUTED":
|
|
768
983
|
return { ...e, muted: r.payload };
|
|
769
984
|
case "TOGGLE_MUTE":
|
|
770
985
|
return { ...e, muted: !e.muted };
|
|
771
986
|
case "SET_PLAYBACK_RATE":
|
|
772
|
-
return { ...e, playbackRate:
|
|
987
|
+
return { ...e, playbackRate: Me(r.payload) };
|
|
773
988
|
case "MEDIA_VOLUME_SYNC": {
|
|
774
|
-
const { volume:
|
|
775
|
-
return
|
|
989
|
+
const { volume: n, muted: t } = r.payload, a = fe(n);
|
|
990
|
+
return a === e.volume && t === e.muted ? e : { ...e, volume: a, muted: t };
|
|
776
991
|
}
|
|
777
992
|
default:
|
|
778
993
|
return e;
|
|
779
994
|
}
|
|
780
995
|
}
|
|
781
|
-
const
|
|
996
|
+
const Xr = {
|
|
782
997
|
"--ginger-primary-color": "#111827",
|
|
783
998
|
"--ginger-muted-color": "#6b7280",
|
|
784
999
|
"--ginger-font-size": "14px",
|
|
785
1000
|
"--ginger-font-family": "system-ui, sans-serif",
|
|
786
1001
|
"--ginger-playlist-row-padding": "6px 8px",
|
|
787
1002
|
"--ginger-artwork-radius": "6px",
|
|
788
|
-
"--ginger-artwork-bg": "#f3f4f6"
|
|
1003
|
+
"--ginger-artwork-bg": "#f3f4f6",
|
|
1004
|
+
"--ginger-playlist-active-bg": "rgba(17, 24, 39, 0.06)",
|
|
1005
|
+
"--ginger-buffer-color": "rgba(107, 114, 128, 0.35)",
|
|
1006
|
+
"--ginger-focus-ring": "0 0 0 2px rgba(59, 130, 246, 0.45)"
|
|
789
1007
|
};
|
|
790
|
-
function
|
|
1008
|
+
function Wr({
|
|
791
1009
|
children: e,
|
|
792
1010
|
initialTracks: r = [],
|
|
793
|
-
initialIndex:
|
|
794
|
-
initialPlaylistMeta:
|
|
795
|
-
initialShuffle:
|
|
796
|
-
initialRepeatMode:
|
|
797
|
-
initialPaused:
|
|
798
|
-
initialVolume:
|
|
1011
|
+
initialIndex: n = 0,
|
|
1012
|
+
initialPlaylistMeta: t = null,
|
|
1013
|
+
initialShuffle: a = !1,
|
|
1014
|
+
initialRepeatMode: u = "off",
|
|
1015
|
+
initialPaused: i = !0,
|
|
1016
|
+
initialVolume: l = 1,
|
|
799
1017
|
initialMuted: c = !1,
|
|
800
1018
|
initialPlaybackRate: f = 1,
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
1019
|
+
initialStateKey: p,
|
|
1020
|
+
locale: b,
|
|
1021
|
+
className: d,
|
|
1022
|
+
style: y,
|
|
1023
|
+
onTrackChange: k,
|
|
1024
|
+
onPlay: v,
|
|
1025
|
+
onPause: A,
|
|
1026
|
+
onQueueEnd: V,
|
|
1027
|
+
onError: B
|
|
808
1028
|
}) {
|
|
809
|
-
var
|
|
810
|
-
const
|
|
811
|
-
|
|
1029
|
+
var Te;
|
|
1030
|
+
const R = L(null), [s, m] = pr(
|
|
1031
|
+
jr,
|
|
812
1032
|
void 0,
|
|
813
|
-
() =>
|
|
1033
|
+
() => ir({
|
|
814
1034
|
tracks: r,
|
|
815
|
-
currentIndex:
|
|
816
|
-
playlistMeta:
|
|
817
|
-
isPaused:
|
|
818
|
-
isShuffled:
|
|
819
|
-
repeatMode:
|
|
820
|
-
volume:
|
|
1035
|
+
currentIndex: n,
|
|
1036
|
+
playlistMeta: t,
|
|
1037
|
+
isPaused: i,
|
|
1038
|
+
isShuffled: a,
|
|
1039
|
+
repeatMode: u,
|
|
1040
|
+
volume: l,
|
|
821
1041
|
muted: c,
|
|
822
1042
|
playbackRate: f
|
|
823
1043
|
})
|
|
824
|
-
),
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
1044
|
+
), ge = L(s), ye = L({
|
|
1045
|
+
tracks: r,
|
|
1046
|
+
currentIndex: n,
|
|
1047
|
+
playlistMeta: t,
|
|
1048
|
+
isPaused: i,
|
|
1049
|
+
isShuffled: a,
|
|
1050
|
+
repeatMode: u,
|
|
1051
|
+
volume: l,
|
|
1052
|
+
muted: c,
|
|
1053
|
+
playbackRate: f
|
|
1054
|
+
});
|
|
1055
|
+
ye.current = {
|
|
1056
|
+
tracks: r,
|
|
1057
|
+
currentIndex: n,
|
|
1058
|
+
playlistMeta: t,
|
|
1059
|
+
isPaused: i,
|
|
1060
|
+
isShuffled: a,
|
|
1061
|
+
repeatMode: u,
|
|
1062
|
+
volume: l,
|
|
1063
|
+
muted: c,
|
|
1064
|
+
playbackRate: f
|
|
1065
|
+
};
|
|
1066
|
+
const C = L(void 0);
|
|
1067
|
+
S(() => {
|
|
1068
|
+
if (p === void 0) {
|
|
1069
|
+
C.current = void 0;
|
|
834
1070
|
return;
|
|
835
1071
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
h({ type: "SET_MUTED", payload: p });
|
|
857
|
-
}, []), W = b(() => {
|
|
858
|
-
h({ type: "TOGGLE_MUTE" });
|
|
859
|
-
}, []), K = b((p) => {
|
|
860
|
-
h({ type: "SET_PLAYBACK_RATE", payload: B(p) });
|
|
861
|
-
}, []), z = b(() => {
|
|
862
|
-
h({ type: "NEXT" });
|
|
863
|
-
}, []), q = b(() => {
|
|
864
|
-
h({ type: "PREV" });
|
|
865
|
-
}, []), H = b((p) => {
|
|
866
|
-
h({ type: "SET_REPEAT", payload: p });
|
|
867
|
-
}, []), J = b(() => {
|
|
868
|
-
h({ type: "CYCLE_REPEAT" });
|
|
869
|
-
}, []), Z = b(() => {
|
|
870
|
-
h({ type: "TOGGLE_SHUFFLE" });
|
|
871
|
-
}, []), ee = b((p, k) => {
|
|
872
|
-
h({ type: "SET_QUEUE", payload: { tracks: p, currentIndex: k } });
|
|
873
|
-
}, []), re = b((p) => {
|
|
874
|
-
h({ type: "SET_INDEX", payload: { index: p, autoPlay: !0 } }), queueMicrotask(() => {
|
|
875
|
-
var k;
|
|
876
|
-
(k = A.current) == null || k.play().catch(() => {
|
|
877
|
-
});
|
|
1072
|
+
if (C.current === void 0) {
|
|
1073
|
+
C.current = p;
|
|
1074
|
+
return;
|
|
1075
|
+
}
|
|
1076
|
+
if (C.current === p) return;
|
|
1077
|
+
C.current = p;
|
|
1078
|
+
const g = ye.current;
|
|
1079
|
+
m({
|
|
1080
|
+
type: "INIT",
|
|
1081
|
+
payload: {
|
|
1082
|
+
tracks: g.tracks,
|
|
1083
|
+
currentIndex: g.currentIndex,
|
|
1084
|
+
playlistMeta: g.playlistMeta,
|
|
1085
|
+
isPaused: g.isPaused,
|
|
1086
|
+
isShuffled: g.isShuffled,
|
|
1087
|
+
repeatMode: g.repeatMode,
|
|
1088
|
+
volume: g.volume,
|
|
1089
|
+
muted: g.muted,
|
|
1090
|
+
playbackRate: g.playbackRate
|
|
1091
|
+
}
|
|
878
1092
|
});
|
|
879
|
-
}, []),
|
|
880
|
-
|
|
881
|
-
}, [])
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
1093
|
+
}, [p]), S(() => {
|
|
1094
|
+
ge.current = s;
|
|
1095
|
+
}, [s]);
|
|
1096
|
+
const Q = s.tracks[s.currentIndex] ?? null;
|
|
1097
|
+
S(() => {
|
|
1098
|
+
k == null || k(Q, s.currentIndex);
|
|
1099
|
+
}, [Q, s.currentIndex, k]), S(() => {
|
|
1100
|
+
s.errorMessage && (B == null || B(s.errorMessage));
|
|
1101
|
+
}, [s.errorMessage, B]);
|
|
1102
|
+
const j = L(void 0);
|
|
1103
|
+
S(() => {
|
|
1104
|
+
if (j.current === void 0) {
|
|
1105
|
+
j.current = s.isPaused;
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
j.current !== s.isPaused && (s.isPaused ? A == null || A() : v == null || v()), j.current = s.isPaused;
|
|
1109
|
+
}, [s.isPaused, A, v]);
|
|
1110
|
+
const N = h(() => {
|
|
1111
|
+
m({ type: "PLAY" });
|
|
1112
|
+
}, []), w = h(() => {
|
|
1113
|
+
var g;
|
|
1114
|
+
m({ type: "PAUSE" }), (g = R.current) == null || g.pause();
|
|
1115
|
+
}, []), X = h(() => {
|
|
1116
|
+
s.isPaused ? N() : w();
|
|
1117
|
+
}, [w, N, s.isPaused]), W = h((g) => {
|
|
1118
|
+
const M = R.current;
|
|
1119
|
+
M && Number.isFinite(g) && (M.currentTime = Math.max(0, g));
|
|
1120
|
+
}, []), z = h((g) => {
|
|
1121
|
+
m({ type: "SET_VOLUME", payload: fe(g) });
|
|
1122
|
+
}, []), H = h((g) => {
|
|
1123
|
+
m({ type: "SET_MUTED", payload: g });
|
|
1124
|
+
}, []), q = h(() => {
|
|
1125
|
+
m({ type: "TOGGLE_MUTE" });
|
|
1126
|
+
}, []), K = h((g) => {
|
|
1127
|
+
m({ type: "SET_PLAYBACK_RATE", payload: Me(g) });
|
|
1128
|
+
}, []), J = h(() => {
|
|
1129
|
+
m({ type: "NEXT" });
|
|
1130
|
+
}, []), Z = h(() => {
|
|
1131
|
+
m({ type: "PREV" });
|
|
1132
|
+
}, []), ee = h((g) => {
|
|
1133
|
+
m({ type: "SET_REPEAT", payload: g });
|
|
1134
|
+
}, []), re = h(() => {
|
|
1135
|
+
m({ type: "CYCLE_REPEAT" });
|
|
1136
|
+
}, []), ne = h(() => {
|
|
1137
|
+
m({ type: "TOGGLE_SHUFFLE" });
|
|
1138
|
+
}, []), te = h((g, M) => {
|
|
1139
|
+
m({ type: "SET_QUEUE", payload: { tracks: g, currentIndex: M } });
|
|
1140
|
+
}, []), ae = h((g) => {
|
|
1141
|
+
m({ type: "SET_INDEX", payload: { index: g, autoPlay: !0 } });
|
|
1142
|
+
}, []), ue = h((g) => {
|
|
1143
|
+
m({ type: "SET_INDEX", payload: { index: g, autoPlay: !1 } });
|
|
1144
|
+
}, []), ie = h((g) => {
|
|
1145
|
+
m({ type: "SET_PLAYLIST_META", payload: g });
|
|
1146
|
+
}, []), oe = h((g) => {
|
|
1147
|
+
m({ type: "INIT", payload: g });
|
|
1148
|
+
}, []), or = (Te = s.tracks[s.currentIndex]) == null ? void 0 : Te.fileUrl;
|
|
1149
|
+
S(() => {
|
|
1150
|
+
const g = R.current;
|
|
1151
|
+
g && (s.isPaused ? g.pause() : g.play().catch((M) => {
|
|
1152
|
+
const se = M instanceof Error ? M.message : typeof M == "string" ? M : "Playback failed (e.g. autoplay blocked or unavailable source)";
|
|
1153
|
+
m({ type: "MEDIA_ERROR", payload: { message: se } });
|
|
890
1154
|
}));
|
|
891
|
-
}, [
|
|
892
|
-
const
|
|
893
|
-
const
|
|
894
|
-
if (
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
})), h({ type: "PLAY" });
|
|
1155
|
+
}, [s.isPaused, or]);
|
|
1156
|
+
const le = h(() => {
|
|
1157
|
+
const g = br(ge.current);
|
|
1158
|
+
if (g.kind === "replay_same") {
|
|
1159
|
+
const se = R.current;
|
|
1160
|
+
se && (se.currentTime = 0), m({ type: "PLAY" });
|
|
898
1161
|
return;
|
|
899
1162
|
}
|
|
900
|
-
if (
|
|
901
|
-
|
|
1163
|
+
if (g.kind === "stop") {
|
|
1164
|
+
m({ type: "PAUSE" }), V == null || V();
|
|
902
1165
|
return;
|
|
903
1166
|
}
|
|
904
|
-
const
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
(T = A.current) == null || T.play().catch(() => {
|
|
908
|
-
});
|
|
909
|
-
});
|
|
910
|
-
}, [_, m]), Xe = U(
|
|
1167
|
+
const M = g.nextIndex;
|
|
1168
|
+
m({ type: "SET_INDEX", payload: { index: M, autoPlay: !0 } });
|
|
1169
|
+
}, [V]), lr = E(
|
|
911
1170
|
() => ({
|
|
912
|
-
state:
|
|
913
|
-
dispatch:
|
|
914
|
-
audioRef:
|
|
915
|
-
notifyEnded:
|
|
916
|
-
|
|
1171
|
+
state: s,
|
|
1172
|
+
dispatch: m,
|
|
1173
|
+
audioRef: R,
|
|
1174
|
+
notifyEnded: le,
|
|
1175
|
+
init: oe,
|
|
1176
|
+
play: N,
|
|
917
1177
|
pause: w,
|
|
918
|
-
togglePlayPause:
|
|
919
|
-
seek:
|
|
920
|
-
setVolume:
|
|
921
|
-
setMuted:
|
|
922
|
-
toggleMute:
|
|
1178
|
+
togglePlayPause: X,
|
|
1179
|
+
seek: W,
|
|
1180
|
+
setVolume: z,
|
|
1181
|
+
setMuted: H,
|
|
1182
|
+
toggleMute: q,
|
|
923
1183
|
setPlaybackRate: K,
|
|
924
|
-
next:
|
|
925
|
-
prev:
|
|
926
|
-
setRepeatMode:
|
|
927
|
-
cycleRepeat:
|
|
928
|
-
toggleShuffle:
|
|
929
|
-
setQueue:
|
|
930
|
-
playTrackAt:
|
|
931
|
-
selectTrackAt:
|
|
932
|
-
setPlaylistMeta:
|
|
1184
|
+
next: J,
|
|
1185
|
+
prev: Z,
|
|
1186
|
+
setRepeatMode: ee,
|
|
1187
|
+
cycleRepeat: re,
|
|
1188
|
+
toggleShuffle: ne,
|
|
1189
|
+
setQueue: te,
|
|
1190
|
+
playTrackAt: ae,
|
|
1191
|
+
selectTrackAt: ue,
|
|
1192
|
+
setPlaylistMeta: ie
|
|
933
1193
|
}),
|
|
934
1194
|
[
|
|
1195
|
+
re,
|
|
1196
|
+
m,
|
|
1197
|
+
oe,
|
|
935
1198
|
J,
|
|
936
|
-
|
|
937
|
-
z,
|
|
938
|
-
ie,
|
|
1199
|
+
le,
|
|
939
1200
|
w,
|
|
940
|
-
|
|
941
|
-
|
|
1201
|
+
N,
|
|
1202
|
+
ae,
|
|
1203
|
+
ue,
|
|
1204
|
+
Z,
|
|
1205
|
+
W,
|
|
1206
|
+
H,
|
|
1207
|
+
K,
|
|
942
1208
|
te,
|
|
1209
|
+
ee,
|
|
1210
|
+
ie,
|
|
1211
|
+
z,
|
|
1212
|
+
s,
|
|
943
1213
|
q,
|
|
944
|
-
Q,
|
|
945
1214
|
X,
|
|
946
|
-
|
|
1215
|
+
ne
|
|
1216
|
+
]
|
|
1217
|
+
), sr = E(
|
|
1218
|
+
() => ({
|
|
1219
|
+
tracks: s.tracks,
|
|
1220
|
+
currentIndex: s.currentIndex,
|
|
1221
|
+
isPaused: s.isPaused,
|
|
1222
|
+
isShuffled: s.isShuffled,
|
|
1223
|
+
repeatMode: s.repeatMode,
|
|
1224
|
+
originalTracks: s.originalTracks,
|
|
1225
|
+
playlistMeta: s.playlistMeta,
|
|
1226
|
+
init: oe,
|
|
1227
|
+
play: N,
|
|
1228
|
+
pause: w,
|
|
1229
|
+
togglePlayPause: X,
|
|
1230
|
+
next: J,
|
|
1231
|
+
prev: Z,
|
|
1232
|
+
setRepeatMode: ee,
|
|
1233
|
+
cycleRepeat: re,
|
|
1234
|
+
toggleShuffle: ne,
|
|
1235
|
+
setQueue: te,
|
|
1236
|
+
playTrackAt: ae,
|
|
1237
|
+
selectTrackAt: ue,
|
|
1238
|
+
setPlaylistMeta: ie,
|
|
1239
|
+
dispatch: m
|
|
1240
|
+
}),
|
|
1241
|
+
[
|
|
1242
|
+
s.tracks,
|
|
1243
|
+
s.currentIndex,
|
|
1244
|
+
s.isPaused,
|
|
1245
|
+
s.isShuffled,
|
|
1246
|
+
s.repeatMode,
|
|
1247
|
+
s.originalTracks,
|
|
1248
|
+
s.playlistMeta,
|
|
1249
|
+
oe,
|
|
1250
|
+
N,
|
|
1251
|
+
w,
|
|
1252
|
+
X,
|
|
1253
|
+
J,
|
|
1254
|
+
Z,
|
|
947
1255
|
ee,
|
|
948
|
-
|
|
1256
|
+
re,
|
|
949
1257
|
ne,
|
|
950
|
-
|
|
951
|
-
|
|
1258
|
+
te,
|
|
1259
|
+
ae,
|
|
1260
|
+
ue,
|
|
1261
|
+
ie,
|
|
1262
|
+
m
|
|
1263
|
+
]
|
|
1264
|
+
), cr = E(
|
|
1265
|
+
() => ({
|
|
1266
|
+
currentTime: s.currentTime,
|
|
1267
|
+
duration: s.duration,
|
|
1268
|
+
bufferedFraction: s.bufferedFraction,
|
|
1269
|
+
isBuffering: s.isBuffering,
|
|
1270
|
+
errorMessage: s.errorMessage,
|
|
1271
|
+
volume: s.volume,
|
|
1272
|
+
muted: s.muted,
|
|
1273
|
+
playbackRate: s.playbackRate,
|
|
1274
|
+
seek: W,
|
|
1275
|
+
setVolume: z,
|
|
1276
|
+
setMuted: H,
|
|
1277
|
+
toggleMute: q,
|
|
1278
|
+
setPlaybackRate: K,
|
|
1279
|
+
audioRef: R,
|
|
1280
|
+
notifyEnded: le,
|
|
1281
|
+
dispatch: m
|
|
1282
|
+
}),
|
|
1283
|
+
[
|
|
1284
|
+
s.currentTime,
|
|
1285
|
+
s.duration,
|
|
1286
|
+
s.bufferedFraction,
|
|
1287
|
+
s.isBuffering,
|
|
1288
|
+
s.errorMessage,
|
|
1289
|
+
s.volume,
|
|
1290
|
+
s.muted,
|
|
1291
|
+
s.playbackRate,
|
|
952
1292
|
W,
|
|
953
|
-
|
|
954
|
-
|
|
1293
|
+
z,
|
|
1294
|
+
H,
|
|
1295
|
+
q,
|
|
1296
|
+
K,
|
|
1297
|
+
R,
|
|
1298
|
+
le,
|
|
1299
|
+
m
|
|
955
1300
|
]
|
|
956
|
-
),
|
|
957
|
-
return /* @__PURE__ */
|
|
1301
|
+
), dr = ke(s), fr = E(() => ({ ...Xr, ...y }), [y]);
|
|
1302
|
+
return /* @__PURE__ */ o(Nr, { locale: b, children: /* @__PURE__ */ o(_e.Provider, { value: sr, children: /* @__PURE__ */ o(Ge.Provider, { value: cr, children: /* @__PURE__ */ o(Ee.Provider, { value: lr, children: /* @__PURE__ */ o(
|
|
1303
|
+
"div",
|
|
1304
|
+
{
|
|
1305
|
+
className: d,
|
|
1306
|
+
style: fr,
|
|
1307
|
+
"data-ginger-playback": dr,
|
|
1308
|
+
children: e
|
|
1309
|
+
}
|
|
1310
|
+
) }) }) }) });
|
|
958
1311
|
}
|
|
959
|
-
const
|
|
960
|
-
Provider:
|
|
961
|
-
Player:
|
|
1312
|
+
const Kr = {
|
|
1313
|
+
Provider: Wr,
|
|
1314
|
+
Player: yr,
|
|
962
1315
|
Current: {
|
|
963
|
-
Title:
|
|
964
|
-
Artist:
|
|
965
|
-
Album:
|
|
966
|
-
Description:
|
|
967
|
-
Copyright:
|
|
968
|
-
Genre:
|
|
969
|
-
Label:
|
|
970
|
-
Isrc:
|
|
971
|
-
TrackNumber:
|
|
972
|
-
Year:
|
|
973
|
-
Lyrics:
|
|
974
|
-
FileUrl:
|
|
975
|
-
Artwork:
|
|
976
|
-
QueueIndex:
|
|
977
|
-
QueueLength:
|
|
978
|
-
QueuePosition:
|
|
979
|
-
Elapsed:
|
|
980
|
-
Duration:
|
|
981
|
-
Remaining:
|
|
982
|
-
Progress:
|
|
983
|
-
TimeRail:
|
|
984
|
-
|
|
985
|
-
|
|
1316
|
+
Title: Tr,
|
|
1317
|
+
Artist: xr,
|
|
1318
|
+
Album: Er,
|
|
1319
|
+
Description: Ir,
|
|
1320
|
+
Copyright: Ar,
|
|
1321
|
+
Genre: Rr,
|
|
1322
|
+
Label: Sr,
|
|
1323
|
+
Isrc: _r,
|
|
1324
|
+
TrackNumber: Gr,
|
|
1325
|
+
Year: Ce,
|
|
1326
|
+
Lyrics: Ne,
|
|
1327
|
+
FileUrl: we,
|
|
1328
|
+
Artwork: Le,
|
|
1329
|
+
QueueIndex: De,
|
|
1330
|
+
QueueLength: Fe,
|
|
1331
|
+
QueuePosition: Ue,
|
|
1332
|
+
Elapsed: Ve,
|
|
1333
|
+
Duration: Be,
|
|
1334
|
+
Remaining: $e,
|
|
1335
|
+
Progress: Oe,
|
|
1336
|
+
TimeRail: Ye,
|
|
1337
|
+
BufferRail: Qe,
|
|
1338
|
+
PlaybackState: je,
|
|
1339
|
+
ErrorMessage: Xe
|
|
986
1340
|
},
|
|
987
1341
|
Queue: {
|
|
988
|
-
Title:
|
|
989
|
-
Subtitle:
|
|
990
|
-
Description:
|
|
991
|
-
Copyright:
|
|
992
|
-
Artwork:
|
|
1342
|
+
Title: Br,
|
|
1343
|
+
Subtitle: $r,
|
|
1344
|
+
Description: Or,
|
|
1345
|
+
Copyright: Yr,
|
|
1346
|
+
Artwork: ur
|
|
993
1347
|
},
|
|
994
1348
|
Control: {
|
|
995
|
-
PlayPause:
|
|
996
|
-
Repeat:
|
|
997
|
-
Next:
|
|
998
|
-
Previous:
|
|
999
|
-
Shuffle:
|
|
1000
|
-
SeekBar:
|
|
1001
|
-
Volume:
|
|
1002
|
-
Mute:
|
|
1003
|
-
PlaybackRate:
|
|
1349
|
+
PlayPause: ze,
|
|
1350
|
+
Repeat: He,
|
|
1351
|
+
Next: qe,
|
|
1352
|
+
Previous: Ke,
|
|
1353
|
+
Shuffle: Je,
|
|
1354
|
+
SeekBar: Ze,
|
|
1355
|
+
Volume: er,
|
|
1356
|
+
Mute: rr,
|
|
1357
|
+
PlaybackRate: nr
|
|
1004
1358
|
},
|
|
1005
|
-
Playlist:
|
|
1359
|
+
Playlist: Vr
|
|
1006
1360
|
};
|
|
1007
|
-
function
|
|
1008
|
-
const e =
|
|
1009
|
-
return
|
|
1010
|
-
() =>
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
e.playTrackAt,
|
|
1045
|
-
e.selectTrackAt,
|
|
1046
|
-
e.prev,
|
|
1047
|
-
e.seek,
|
|
1048
|
-
e.setMuted,
|
|
1049
|
-
e.setPlaybackRate,
|
|
1050
|
-
e.setPlaylistMeta,
|
|
1051
|
-
e.setQueue,
|
|
1052
|
-
e.setRepeatMode,
|
|
1053
|
-
e.setVolume,
|
|
1054
|
-
e.toggleMute,
|
|
1055
|
-
e.togglePlayPause,
|
|
1056
|
-
e.toggleShuffle,
|
|
1057
|
-
r
|
|
1058
|
-
]
|
|
1361
|
+
function Jr() {
|
|
1362
|
+
const e = T(), r = U();
|
|
1363
|
+
return E(
|
|
1364
|
+
() => {
|
|
1365
|
+
const n = pe(e, r);
|
|
1366
|
+
return {
|
|
1367
|
+
state: n,
|
|
1368
|
+
currentTrack: I(n),
|
|
1369
|
+
playbackUi: ke(n),
|
|
1370
|
+
duration: F(n),
|
|
1371
|
+
remaining: Ae(n),
|
|
1372
|
+
progress: Pe(n),
|
|
1373
|
+
artworkUrl: Re(n),
|
|
1374
|
+
albumLine: Se(n),
|
|
1375
|
+
play: e.play,
|
|
1376
|
+
pause: e.pause,
|
|
1377
|
+
togglePlayPause: e.togglePlayPause,
|
|
1378
|
+
seek: r.seek,
|
|
1379
|
+
setVolume: r.setVolume,
|
|
1380
|
+
setMuted: r.setMuted,
|
|
1381
|
+
toggleMute: r.toggleMute,
|
|
1382
|
+
setPlaybackRate: r.setPlaybackRate,
|
|
1383
|
+
next: e.next,
|
|
1384
|
+
prev: e.prev,
|
|
1385
|
+
setRepeatMode: e.setRepeatMode,
|
|
1386
|
+
cycleRepeat: e.cycleRepeat,
|
|
1387
|
+
toggleShuffle: e.toggleShuffle,
|
|
1388
|
+
setQueue: e.setQueue,
|
|
1389
|
+
playTrackAt: e.playTrackAt,
|
|
1390
|
+
selectTrackAt: e.selectTrackAt,
|
|
1391
|
+
setPlaylistMeta: e.setPlaylistMeta,
|
|
1392
|
+
init: e.init,
|
|
1393
|
+
audioRef: r.audioRef,
|
|
1394
|
+
dispatch: e.dispatch
|
|
1395
|
+
};
|
|
1396
|
+
},
|
|
1397
|
+
[e, r]
|
|
1059
1398
|
);
|
|
1060
1399
|
}
|
|
1061
1400
|
export {
|
|
1062
|
-
|
|
1063
|
-
|
|
1401
|
+
Kr as Ginger,
|
|
1402
|
+
Me as clampPlaybackRate,
|
|
1403
|
+
fe as clampVolume,
|
|
1404
|
+
de as defaultGingerLocale,
|
|
1405
|
+
ke as derivePlaybackUiState,
|
|
1406
|
+
pe as gingerStateFromContextValues,
|
|
1407
|
+
qr as gingerStateFromContexts,
|
|
1408
|
+
Jr as useGinger,
|
|
1409
|
+
x as useGingerLocale,
|
|
1410
|
+
U as useGingerMedia,
|
|
1411
|
+
T as useGingerPlayback,
|
|
1412
|
+
P as useGingerState,
|
|
1413
|
+
Dr as usePlayPauseBinding,
|
|
1414
|
+
wr as useSeekBarBinding,
|
|
1415
|
+
Lr as useVolumeSlider
|
|
1064
1416
|
};
|
|
1065
1417
|
//# sourceMappingURL=index.js.map
|