@lucaismyname/ginger 0.0.1 → 0.0.3
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/dist/audio/GingerPlayer.d.ts.map +1 -1
- package/dist/components/controls/Controls.d.ts +24 -1
- package/dist/components/controls/Controls.d.ts.map +1 -1
- package/dist/components/playlist/GingerPlaylist.d.ts +28 -3
- package/dist/components/playlist/GingerPlaylist.d.ts.map +1 -1
- package/dist/context/GingerContext.d.ts +2 -0
- package/dist/context/GingerContext.d.ts.map +1 -1
- package/dist/context/GingerProvider.d.ts +1 -1
- package/dist/context/GingerProvider.d.ts.map +1 -1
- package/dist/core/playbackReducer.d.ts +5 -0
- package/dist/core/playbackReducer.d.ts.map +1 -1
- package/dist/ginger.d.ts +45 -41
- package/dist/ginger.d.ts.map +1 -1
- package/dist/hooks/useGinger.d.ts +2 -0
- 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 +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +678 -510
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +31 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,204 +1,214 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useContext as
|
|
3
|
-
const
|
|
1
|
+
import { jsx as l, jsxs as se } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as ce, createContext as de, useEffect as R, useMemo as U, useRef as ue, useReducer as Ke, useCallback as b } from "react";
|
|
3
|
+
const fe = de(null);
|
|
4
4
|
function g() {
|
|
5
|
-
const e =
|
|
5
|
+
const e = ce(fe);
|
|
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 le(e) {
|
|
10
|
+
const { buffered: r, duration: t } = e;
|
|
11
|
+
return !(t > 0) || r.length === 0 ? 0 : Math.min(1, r.end(r.length - 1) / t);
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
var
|
|
15
|
-
const { audioRef: i, dispatch:
|
|
16
|
-
return
|
|
17
|
-
const
|
|
18
|
-
|
|
13
|
+
function ze({ className: e, style: r, preload: t = "metadata", crossOrigin: n }) {
|
|
14
|
+
var f;
|
|
15
|
+
const { audioRef: i, dispatch: a, state: u, notifyEnded: o } = g(), c = ((f = u.tracks[u.currentIndex]) == null ? void 0 : f.fileUrl) ?? "";
|
|
16
|
+
return R(() => {
|
|
17
|
+
const s = i.current;
|
|
18
|
+
s && (s.volume = u.volume, s.muted = u.muted, s.playbackRate = u.playbackRate);
|
|
19
|
+
}, [i, u.volume, u.muted, u.playbackRate]), R(() => {
|
|
20
|
+
const s = i.current;
|
|
21
|
+
if (s) {
|
|
19
22
|
if (!c) {
|
|
20
|
-
|
|
23
|
+
s.removeAttribute("src");
|
|
21
24
|
return;
|
|
22
25
|
}
|
|
23
|
-
|
|
26
|
+
s.getAttribute("src") !== c && (s.src = c, s.load());
|
|
24
27
|
}
|
|
25
|
-
}, [i,
|
|
28
|
+
}, [i, u.currentIndex, u.tracks, c]), /* @__PURE__ */ l(
|
|
26
29
|
"audio",
|
|
27
30
|
{
|
|
28
31
|
ref: i,
|
|
29
32
|
className: e,
|
|
30
33
|
style: r,
|
|
31
|
-
preload:
|
|
32
|
-
crossOrigin:
|
|
34
|
+
preload: t,
|
|
35
|
+
crossOrigin: n,
|
|
33
36
|
controls: !1,
|
|
34
|
-
onTimeUpdate: (
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
+
onTimeUpdate: (s) => {
|
|
38
|
+
const d = s.currentTarget;
|
|
39
|
+
a({
|
|
37
40
|
type: "MEDIA_TIME_UPDATE",
|
|
38
41
|
payload: {
|
|
39
|
-
currentTime:
|
|
40
|
-
duration:
|
|
41
|
-
bufferedFraction:
|
|
42
|
+
currentTime: d.currentTime,
|
|
43
|
+
duration: d.duration,
|
|
44
|
+
bufferedFraction: le(d)
|
|
42
45
|
}
|
|
43
46
|
});
|
|
44
47
|
},
|
|
45
|
-
onLoadedMetadata: (
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
+
onLoadedMetadata: (s) => {
|
|
49
|
+
const d = s.currentTarget;
|
|
50
|
+
a({
|
|
48
51
|
type: "MEDIA_LOADED_METADATA",
|
|
49
52
|
payload: {
|
|
50
|
-
duration:
|
|
51
|
-
bufferedFraction:
|
|
53
|
+
duration: d.duration,
|
|
54
|
+
bufferedFraction: le(d)
|
|
52
55
|
}
|
|
53
56
|
});
|
|
54
57
|
},
|
|
55
|
-
onEnded: () =>
|
|
56
|
-
onPlay: () =>
|
|
57
|
-
onPause: () =>
|
|
58
|
-
onWaiting: () =>
|
|
59
|
-
onCanPlay: () =>
|
|
58
|
+
onEnded: () => o(),
|
|
59
|
+
onPlay: () => a({ type: "MEDIA_PLAY" }),
|
|
60
|
+
onPause: () => a({ type: "MEDIA_PAUSE" }),
|
|
61
|
+
onWaiting: () => a({ type: "MEDIA_WAITING" }),
|
|
62
|
+
onCanPlay: () => a({ type: "MEDIA_CANPLAY" }),
|
|
63
|
+
onVolumeChange: (s) => {
|
|
64
|
+
const d = s.currentTarget;
|
|
65
|
+
a({
|
|
66
|
+
type: "MEDIA_VOLUME_SYNC",
|
|
67
|
+
payload: { volume: d.volume, muted: d.muted }
|
|
68
|
+
});
|
|
69
|
+
},
|
|
60
70
|
onError: () => {
|
|
61
|
-
var
|
|
62
|
-
const
|
|
63
|
-
|
|
71
|
+
var P;
|
|
72
|
+
const s = i.current, d = (P = s == null ? void 0 : s.error) == null ? void 0 : P.code;
|
|
73
|
+
a({ type: "MEDIA_ERROR", payload: { message: d === 1 ? "MEDIA_ERR_ABORTED" : d === 2 ? "MEDIA_ERR_NETWORK" : d === 3 ? "MEDIA_ERR_DECODE" : d === 4 ? "MEDIA_ERR_SRC_NOT_SUPPORTED" : "MEDIA_ERR_UNKNOWN" } });
|
|
64
74
|
}
|
|
65
75
|
}
|
|
66
76
|
);
|
|
67
77
|
}
|
|
68
|
-
function
|
|
78
|
+
function S(e, r) {
|
|
69
79
|
return r <= 0 ? 0 : Math.max(0, Math.min(r - 1, e));
|
|
70
80
|
}
|
|
71
|
-
function
|
|
81
|
+
function pe(e, r) {
|
|
72
82
|
if (e.length <= 1) return [...e];
|
|
73
|
-
const
|
|
74
|
-
if (!
|
|
75
|
-
const
|
|
76
|
-
for (let i =
|
|
77
|
-
const
|
|
78
|
-
[
|
|
83
|
+
const t = e[r];
|
|
84
|
+
if (!t) return [...e];
|
|
85
|
+
const n = e.filter((i, a) => a !== r);
|
|
86
|
+
for (let i = n.length - 1; i > 0; i--) {
|
|
87
|
+
const a = Math.floor(Math.random() * (i + 1));
|
|
88
|
+
[n[i], n[a]] = [n[a], n[i]];
|
|
79
89
|
}
|
|
80
|
-
return [
|
|
90
|
+
return [t, ...n];
|
|
81
91
|
}
|
|
82
|
-
function
|
|
83
|
-
const
|
|
84
|
-
return
|
|
92
|
+
function qe(e, r) {
|
|
93
|
+
const t = e.findIndex((n) => n.fileUrl === r);
|
|
94
|
+
return t === -1 ? 0 : t;
|
|
85
95
|
}
|
|
86
|
-
function
|
|
87
|
-
const { tracks: r, currentIndex:
|
|
88
|
-
return i === 0 ? { kind: "stop", nextIndex: 0 } :
|
|
96
|
+
function He(e) {
|
|
97
|
+
const { tracks: r, currentIndex: t, repeatMode: n } = e, i = r.length;
|
|
98
|
+
return i === 0 ? { kind: "stop", nextIndex: 0 } : n === "one" ? { kind: "replay_same" } : t < i - 1 ? { kind: "advance", nextIndex: t + 1 } : n === "all" ? { kind: "wrap", nextIndex: 0 } : { kind: "stop", nextIndex: S(t, i) };
|
|
89
99
|
}
|
|
90
|
-
function
|
|
91
|
-
const { tracks: r, currentIndex:
|
|
92
|
-
return i === 0 ? 0 :
|
|
100
|
+
function Je(e) {
|
|
101
|
+
const { tracks: r, currentIndex: t, repeatMode: n } = e, i = r.length;
|
|
102
|
+
return i === 0 ? 0 : t < i - 1 ? t + 1 : n === "all" ? 0 : S(t, i);
|
|
93
103
|
}
|
|
94
|
-
function
|
|
95
|
-
const { tracks: r, currentIndex:
|
|
96
|
-
return i === 0 ? 0 :
|
|
104
|
+
function Ze(e) {
|
|
105
|
+
const { tracks: r, currentIndex: t, repeatMode: n } = e, i = r.length;
|
|
106
|
+
return i === 0 ? 0 : t > 0 ? t - 1 : n === "all" ? i - 1 : 0;
|
|
97
107
|
}
|
|
98
|
-
function
|
|
108
|
+
function er(e) {
|
|
99
109
|
return e === "off" ? "all" : e === "all" ? "one" : "off";
|
|
100
110
|
}
|
|
101
|
-
function
|
|
111
|
+
function rr(e, r) {
|
|
102
112
|
return (e == null ? void 0 : e.artworkUrl) ?? r ?? void 0;
|
|
103
113
|
}
|
|
104
|
-
function
|
|
114
|
+
function tr(e, r) {
|
|
105
115
|
return (e == null ? void 0 : e.album) ?? r ?? void 0;
|
|
106
116
|
}
|
|
107
|
-
function
|
|
117
|
+
function E(e) {
|
|
108
118
|
return e.tracks[e.currentIndex] ?? null;
|
|
109
119
|
}
|
|
110
|
-
function
|
|
120
|
+
function ge(e) {
|
|
111
121
|
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";
|
|
112
122
|
}
|
|
113
|
-
function
|
|
114
|
-
var
|
|
123
|
+
function C(e) {
|
|
124
|
+
var n;
|
|
115
125
|
const r = e.duration;
|
|
116
126
|
if (Number.isFinite(r) && r > 0) return r;
|
|
117
|
-
const
|
|
118
|
-
return typeof
|
|
127
|
+
const t = (n = e.tracks[e.currentIndex]) == null ? void 0 : n.durationSeconds;
|
|
128
|
+
return typeof t == "number" && Number.isFinite(t) && t > 0 ? t : 0;
|
|
119
129
|
}
|
|
120
|
-
function
|
|
121
|
-
const
|
|
122
|
-
return Number.isFinite(
|
|
130
|
+
function ye(e) {
|
|
131
|
+
const t = C(e) - e.currentTime;
|
|
132
|
+
return Number.isFinite(t) ? Math.max(0, t) : 0;
|
|
123
133
|
}
|
|
124
|
-
function
|
|
125
|
-
const r =
|
|
134
|
+
function O(e) {
|
|
135
|
+
const r = C(e);
|
|
126
136
|
return r > 0 ? Math.min(1, Math.max(0, e.currentTime / r)) : 0;
|
|
127
137
|
}
|
|
128
|
-
function
|
|
129
|
-
var
|
|
130
|
-
const r =
|
|
131
|
-
return
|
|
138
|
+
function me(e) {
|
|
139
|
+
var t;
|
|
140
|
+
const r = E(e);
|
|
141
|
+
return rr(r, (t = e.playlistMeta) == null ? void 0 : t.artworkUrl);
|
|
132
142
|
}
|
|
133
|
-
function
|
|
134
|
-
var
|
|
135
|
-
const r =
|
|
136
|
-
return
|
|
137
|
-
}
|
|
138
|
-
function
|
|
139
|
-
function n
|
|
140
|
-
const { state: i } = g(),
|
|
141
|
-
if (!
|
|
142
|
-
const
|
|
143
|
-
return
|
|
143
|
+
function he(e) {
|
|
144
|
+
var t;
|
|
145
|
+
const r = E(e);
|
|
146
|
+
return tr(r, (t = e.playlistMeta) == null ? void 0 : t.subtitle);
|
|
147
|
+
}
|
|
148
|
+
function v(e, r) {
|
|
149
|
+
function t(n) {
|
|
150
|
+
const { state: i } = g(), u = (r(i) ?? "").trim(), { className: o, style: c, fallback: f, empty: s, children: d } = n;
|
|
151
|
+
if (!u) {
|
|
152
|
+
const y = s ?? f ?? null;
|
|
153
|
+
return y ? /* @__PURE__ */ l("span", { className: o, style: c, children: y }) : null;
|
|
144
154
|
}
|
|
145
|
-
return
|
|
155
|
+
return d ? /* @__PURE__ */ l("span", { className: o, style: c, children: d(u, i) }) : /* @__PURE__ */ l("span", { className: o, style: c, children: u });
|
|
146
156
|
}
|
|
147
|
-
return
|
|
157
|
+
return t.displayName = e, t;
|
|
148
158
|
}
|
|
149
159
|
function I(e, r) {
|
|
150
|
-
return
|
|
160
|
+
return v(e, (t) => r(E(t)));
|
|
151
161
|
}
|
|
152
|
-
const
|
|
153
|
-
var
|
|
154
|
-
const r =
|
|
155
|
-
return (r == null ? void 0 : r.copyright) ?? ((
|
|
156
|
-
}),
|
|
162
|
+
const nr = I("Ginger.Current.Title", (e) => e == null ? void 0 : e.title), ir = I("Ginger.Current.Artist", (e) => e == null ? void 0 : e.artist), ar = v("Ginger.Current.Album", (e) => he(e)), ur = I("Ginger.Current.Description", (e) => e == null ? void 0 : e.description), lr = v("Ginger.Current.Copyright", (e) => {
|
|
163
|
+
var t;
|
|
164
|
+
const r = E(e);
|
|
165
|
+
return (r == null ? void 0 : r.copyright) ?? ((t = e.playlistMeta) == null ? void 0 : t.copyright);
|
|
166
|
+
}), or = I("Ginger.Current.Genre", (e) => e == null ? void 0 : e.genre), sr = I("Ginger.Current.Label", (e) => e == null ? void 0 : e.label), cr = I("Ginger.Current.Isrc", (e) => e == null ? void 0 : e.isrc), dr = I(
|
|
157
167
|
"Ginger.Current.TrackNumber",
|
|
158
168
|
(e) => (e == null ? void 0 : e.trackNumber) != null ? String(e.trackNumber) : void 0
|
|
159
169
|
);
|
|
160
|
-
function
|
|
161
|
-
var
|
|
162
|
-
const { state:
|
|
163
|
-
if (typeof
|
|
164
|
-
const
|
|
165
|
-
return
|
|
170
|
+
function be({ className: e, style: r, fallback: t, empty: n, children: i, format: a }) {
|
|
171
|
+
var f;
|
|
172
|
+
const { state: u } = g(), o = (f = E(u)) == null ? void 0 : f.year;
|
|
173
|
+
if (typeof o != "number" || !Number.isFinite(o)) {
|
|
174
|
+
const s = n ?? t ?? null;
|
|
175
|
+
return s ? /* @__PURE__ */ l("span", { className: e, style: r, children: s }) : null;
|
|
166
176
|
}
|
|
167
|
-
const c =
|
|
168
|
-
return i ? /* @__PURE__ */
|
|
177
|
+
const c = a ? a(o) : String(o);
|
|
178
|
+
return i ? /* @__PURE__ */ l("span", { className: e, style: r, children: i(c, u) }) : /* @__PURE__ */ l("span", { className: e, style: r, children: c });
|
|
169
179
|
}
|
|
170
|
-
|
|
171
|
-
function
|
|
172
|
-
var
|
|
173
|
-
const { state:
|
|
180
|
+
be.displayName = "Ginger.Current.Year";
|
|
181
|
+
function Pe({ className: e, style: r, fallback: t, empty: n, children: i, preserveWhitespace: a = !0 }) {
|
|
182
|
+
var s;
|
|
183
|
+
const { state: u } = g(), o = ((s = E(u)) == null ? void 0 : s.lyrics) ?? "", c = a ? o.replace(/^\s+|\s+$/g, "") : o.trim();
|
|
174
184
|
if (!c) {
|
|
175
|
-
const
|
|
176
|
-
return
|
|
185
|
+
const d = n ?? t ?? null;
|
|
186
|
+
return d ? /* @__PURE__ */ l("span", { className: e, style: r, children: d }) : null;
|
|
177
187
|
}
|
|
178
|
-
const
|
|
179
|
-
return i ? /* @__PURE__ */
|
|
188
|
+
const f = a ? { whiteSpace: "pre-wrap" } : void 0;
|
|
189
|
+
return i ? /* @__PURE__ */ l("span", { className: e, style: { ...f, ...r }, children: i(c, u) }) : /* @__PURE__ */ l("span", { className: e, style: { ...f, ...r }, children: c });
|
|
180
190
|
}
|
|
181
|
-
|
|
182
|
-
function
|
|
191
|
+
Pe.displayName = "Ginger.Current.Lyrics";
|
|
192
|
+
function ke({ visible: e = !1, className: r, style: t, fallback: n, empty: i, children: a }) {
|
|
183
193
|
var c;
|
|
184
|
-
const { state:
|
|
194
|
+
const { state: u } = g();
|
|
185
195
|
if (!e) return null;
|
|
186
|
-
const
|
|
187
|
-
if (!
|
|
188
|
-
const
|
|
189
|
-
return
|
|
196
|
+
const o = ((c = E(u)) == null ? void 0 : c.fileUrl) ?? "";
|
|
197
|
+
if (!o) {
|
|
198
|
+
const f = i ?? n ?? null;
|
|
199
|
+
return f ? /* @__PURE__ */ l("span", { className: r, style: t, children: f }) : null;
|
|
190
200
|
}
|
|
191
|
-
return
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
function
|
|
195
|
-
const { state:
|
|
196
|
-
if (!
|
|
197
|
-
const
|
|
198
|
-
return
|
|
201
|
+
return a ? /* @__PURE__ */ l("span", { className: r, style: t, children: a(o, u) }) : /* @__PURE__ */ l("span", { className: r, style: t, children: o });
|
|
202
|
+
}
|
|
203
|
+
ke.displayName = "Ginger.Current.FileUrl";
|
|
204
|
+
function Me({ className: e, style: r, fallback: t, empty: n, sizes: i, loading: a, onError: u, decoding: o, imgStyle: c }) {
|
|
205
|
+
const { state: f } = g(), s = E(f), d = me(f);
|
|
206
|
+
if (!d) {
|
|
207
|
+
const P = n ?? t ?? null;
|
|
208
|
+
return P ? /* @__PURE__ */ l("span", { className: e, style: r, children: P }) : null;
|
|
199
209
|
}
|
|
200
|
-
const
|
|
201
|
-
return /* @__PURE__ */
|
|
210
|
+
const y = [s == null ? void 0 : s.title, s == null ? void 0 : s.artist].filter(Boolean).join(" — ") || "Artwork";
|
|
211
|
+
return /* @__PURE__ */ l(
|
|
202
212
|
"span",
|
|
203
213
|
{
|
|
204
214
|
className: e,
|
|
@@ -209,15 +219,15 @@ function ce({ className: e, style: r, fallback: n, empty: t, sizes: i, loading:
|
|
|
209
219
|
overflow: "hidden",
|
|
210
220
|
...r
|
|
211
221
|
},
|
|
212
|
-
children: /* @__PURE__ */
|
|
222
|
+
children: /* @__PURE__ */ l(
|
|
213
223
|
"img",
|
|
214
224
|
{
|
|
215
|
-
src:
|
|
216
|
-
alt:
|
|
225
|
+
src: d,
|
|
226
|
+
alt: y,
|
|
217
227
|
sizes: i,
|
|
218
|
-
loading:
|
|
219
|
-
decoding:
|
|
220
|
-
onError:
|
|
228
|
+
loading: a,
|
|
229
|
+
decoding: o,
|
|
230
|
+
onError: u,
|
|
221
231
|
style: {
|
|
222
232
|
display: "block",
|
|
223
233
|
width: "100%",
|
|
@@ -230,238 +240,338 @@ function ce({ className: e, style: r, fallback: n, empty: t, sizes: i, loading:
|
|
|
230
240
|
}
|
|
231
241
|
);
|
|
232
242
|
}
|
|
233
|
-
|
|
234
|
-
function
|
|
235
|
-
const { state:
|
|
236
|
-
if (
|
|
237
|
-
const
|
|
238
|
-
return
|
|
243
|
+
Me.displayName = "Ginger.Current.Artwork";
|
|
244
|
+
function Te({ base: e = 0, className: r, style: t, fallback: n, empty: i, children: a }) {
|
|
245
|
+
const { state: u } = g();
|
|
246
|
+
if (u.tracks.length === 0) {
|
|
247
|
+
const f = i ?? n ?? null;
|
|
248
|
+
return f ? /* @__PURE__ */ l("span", { className: r, style: t, children: f }) : null;
|
|
239
249
|
}
|
|
240
|
-
const c = String(
|
|
241
|
-
return
|
|
250
|
+
const c = String(u.currentIndex + e);
|
|
251
|
+
return a ? /* @__PURE__ */ l("span", { className: r, style: t, children: a(c, u) }) : /* @__PURE__ */ l("span", { className: r, style: t, children: c });
|
|
242
252
|
}
|
|
243
|
-
|
|
244
|
-
function
|
|
245
|
-
const { state:
|
|
246
|
-
if (
|
|
247
|
-
const
|
|
248
|
-
return
|
|
253
|
+
Te.displayName = "Ginger.Current.QueueIndex";
|
|
254
|
+
function Ee({ className: e, style: r, fallback: t, empty: n, children: i }) {
|
|
255
|
+
const { state: a } = g(), u = String(a.tracks.length);
|
|
256
|
+
if (a.tracks.length === 0) {
|
|
257
|
+
const o = n ?? t ?? null;
|
|
258
|
+
return o ? /* @__PURE__ */ l("span", { className: e, style: r, children: o }) : null;
|
|
249
259
|
}
|
|
250
|
-
return i ? /* @__PURE__ */
|
|
260
|
+
return i ? /* @__PURE__ */ l("span", { className: e, style: r, children: i(u, a) }) : /* @__PURE__ */ l("span", { className: e, style: r, children: u });
|
|
251
261
|
}
|
|
252
|
-
|
|
253
|
-
function
|
|
262
|
+
Ee.displayName = "Ginger.Current.QueueLength";
|
|
263
|
+
function Ae({
|
|
254
264
|
base: e = 0,
|
|
255
265
|
separator: r = " / ",
|
|
256
|
-
className:
|
|
257
|
-
style:
|
|
266
|
+
className: t,
|
|
267
|
+
style: n,
|
|
258
268
|
fallback: i,
|
|
259
|
-
empty:
|
|
260
|
-
children:
|
|
269
|
+
empty: a,
|
|
270
|
+
children: u
|
|
261
271
|
}) {
|
|
262
|
-
const { state:
|
|
272
|
+
const { state: o } = g(), c = o.tracks.length;
|
|
263
273
|
if (c === 0) {
|
|
264
|
-
const
|
|
265
|
-
return
|
|
274
|
+
const y = a ?? i ?? null;
|
|
275
|
+
return y ? /* @__PURE__ */ l("span", { className: t, style: n, children: y }) : null;
|
|
266
276
|
}
|
|
267
|
-
const
|
|
268
|
-
return
|
|
277
|
+
const f = String(o.currentIndex + e), s = String(c), d = `${f}${r}${s}`;
|
|
278
|
+
return u ? /* @__PURE__ */ l("span", { className: t, style: n, children: u({ index: f, length: s, label: d }, o) }) : /* @__PURE__ */ l("span", { className: t, style: n, children: d });
|
|
269
279
|
}
|
|
270
|
-
|
|
271
|
-
function
|
|
280
|
+
Ae.displayName = "Ginger.Current.QueuePosition";
|
|
281
|
+
function fr(e) {
|
|
272
282
|
if (!Number.isFinite(e) || e < 0) return "0:00";
|
|
273
283
|
const r = Math.floor(e % 60);
|
|
274
284
|
return `${Math.floor(e / 60)}:${r.toString().padStart(2, "0")}`;
|
|
275
285
|
}
|
|
276
|
-
function
|
|
277
|
-
const { className:
|
|
286
|
+
function Y(e, r, t) {
|
|
287
|
+
const { className: n, style: i, fallback: a, empty: u, children: o, format: c = fr } = t;
|
|
278
288
|
if (!(e >= 0) || !Number.isFinite(e)) {
|
|
279
|
-
const
|
|
280
|
-
return
|
|
289
|
+
const s = u ?? a ?? null;
|
|
290
|
+
return s ? /* @__PURE__ */ l("span", { className: n, style: i, children: s }) : null;
|
|
281
291
|
}
|
|
282
|
-
const
|
|
283
|
-
return
|
|
292
|
+
const f = c(e);
|
|
293
|
+
return o ? /* @__PURE__ */ l("span", { className: n, style: i, children: o(f, r) }) : /* @__PURE__ */ l("span", { className: n, style: i, children: f });
|
|
284
294
|
}
|
|
285
|
-
function
|
|
295
|
+
function xe(e) {
|
|
286
296
|
const { state: r } = g();
|
|
287
|
-
return
|
|
297
|
+
return Y(r.currentTime, r, e);
|
|
288
298
|
}
|
|
289
|
-
|
|
290
|
-
function
|
|
299
|
+
xe.displayName = "Ginger.Current.Elapsed";
|
|
300
|
+
function ve(e) {
|
|
291
301
|
const { state: r } = g();
|
|
292
|
-
return
|
|
302
|
+
return Y(C(r), r, e);
|
|
293
303
|
}
|
|
294
|
-
|
|
295
|
-
function
|
|
304
|
+
ve.displayName = "Ginger.Current.Duration";
|
|
305
|
+
function Ie(e) {
|
|
296
306
|
const { state: r } = g();
|
|
297
|
-
return
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
function
|
|
301
|
-
const { state:
|
|
302
|
-
if (!(
|
|
303
|
-
const c =
|
|
304
|
-
return c ? /* @__PURE__ */
|
|
307
|
+
return Y(ye(r), r, e);
|
|
308
|
+
}
|
|
309
|
+
Ie.displayName = "Ginger.Current.Remaining";
|
|
310
|
+
function Re({ className: e, style: r, fallback: t, empty: n, children: i }) {
|
|
311
|
+
const { state: a } = g(), u = C(a), o = O(a);
|
|
312
|
+
if (!(u > 0)) {
|
|
313
|
+
const c = n ?? t ?? null;
|
|
314
|
+
return c ? /* @__PURE__ */ l("span", { className: e, style: r, children: c }) : null;
|
|
305
315
|
}
|
|
306
|
-
return i ? /* @__PURE__ */
|
|
316
|
+
return i ? /* @__PURE__ */ l("span", { className: e, style: r, children: i({ fraction: o, currentTime: a.currentTime, duration: u }, a) }) : /* @__PURE__ */ l("span", { className: e, style: r, children: `${Math.round(o * 100)}%` });
|
|
307
317
|
}
|
|
308
|
-
|
|
309
|
-
function
|
|
310
|
-
const { state:
|
|
311
|
-
return /* @__PURE__ */
|
|
318
|
+
Re.displayName = "Ginger.Current.Progress";
|
|
319
|
+
function Se({ className: e, style: r, height: t = 4 }) {
|
|
320
|
+
const { state: n } = g(), i = `${Math.round(O(n) * 100)}%`;
|
|
321
|
+
return /* @__PURE__ */ l(
|
|
312
322
|
"div",
|
|
313
323
|
{
|
|
314
324
|
className: e,
|
|
315
325
|
style: {
|
|
316
326
|
width: "100%",
|
|
317
|
-
height:
|
|
327
|
+
height: t,
|
|
318
328
|
background: "var(--ginger-muted-color, #e5e7eb)",
|
|
319
329
|
borderRadius: 999,
|
|
320
330
|
overflow: "hidden",
|
|
321
331
|
...r
|
|
322
332
|
},
|
|
323
333
|
"aria-hidden": !0,
|
|
324
|
-
children: /* @__PURE__ */
|
|
334
|
+
children: /* @__PURE__ */ l("div", { style: { width: i, height: "100%", background: "var(--ginger-primary-color, #111827)" } })
|
|
325
335
|
}
|
|
326
336
|
);
|
|
327
337
|
}
|
|
328
|
-
|
|
329
|
-
function
|
|
330
|
-
const { state:
|
|
331
|
-
return i ? /* @__PURE__ */
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
function
|
|
335
|
-
const { state:
|
|
336
|
-
if (!
|
|
337
|
-
const
|
|
338
|
-
return
|
|
338
|
+
Se.displayName = "Ginger.Current.TimeRail";
|
|
339
|
+
function Ge({ className: e, style: r, fallback: t, empty: n, children: i }) {
|
|
340
|
+
const { state: a } = g(), u = ge(a);
|
|
341
|
+
return i ? /* @__PURE__ */ l("span", { className: e, style: r, children: i(u, a) }) : /* @__PURE__ */ l("span", { className: e, style: r, children: u });
|
|
342
|
+
}
|
|
343
|
+
Ge.displayName = "Ginger.Current.PlaybackState";
|
|
344
|
+
function Ce({ className: e, style: r, fallback: t, empty: n, children: i }) {
|
|
345
|
+
const { state: a } = g(), u = a.errorMessage ?? "";
|
|
346
|
+
if (!u) {
|
|
347
|
+
const o = n ?? t ?? null;
|
|
348
|
+
return o ? /* @__PURE__ */ l("span", { className: e, style: r, children: o }) : null;
|
|
339
349
|
}
|
|
340
|
-
return i ? /* @__PURE__ */
|
|
350
|
+
return i ? /* @__PURE__ */ l("span", { className: e, style: r, children: i(u, a) }) : /* @__PURE__ */ l("span", { className: e, style: r, children: u });
|
|
341
351
|
}
|
|
342
|
-
|
|
343
|
-
function
|
|
344
|
-
const { state: i, togglePlayPause:
|
|
345
|
-
return /* @__PURE__ */
|
|
352
|
+
Ce.displayName = "Ginger.Current.ErrorMessage";
|
|
353
|
+
function _e({ playLabel: e = "Play", pauseLabel: r = "Pause", type: t = "button", ...n }) {
|
|
354
|
+
const { state: i, togglePlayPause: a } = g();
|
|
355
|
+
return /* @__PURE__ */ l("button", { type: t, "aria-label": i.isPaused ? "Play" : "Pause", onClick: a, ...n, children: i.isPaused ? e : r });
|
|
346
356
|
}
|
|
347
|
-
|
|
348
|
-
const
|
|
357
|
+
_e.displayName = "Ginger.Control.PlayPause";
|
|
358
|
+
const oe = {
|
|
349
359
|
off: "Repeat off",
|
|
350
360
|
all: "Repeat all",
|
|
351
361
|
one: "Repeat one"
|
|
352
362
|
};
|
|
353
|
-
function
|
|
354
|
-
const { state:
|
|
355
|
-
return /* @__PURE__ */
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
function
|
|
359
|
-
const { next:
|
|
360
|
-
return /* @__PURE__ */
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
function
|
|
364
|
-
const { prev:
|
|
365
|
-
return /* @__PURE__ */
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
function
|
|
369
|
-
const { state:
|
|
370
|
-
return /* @__PURE__ */
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
function
|
|
374
|
-
const { state:
|
|
375
|
-
return /* @__PURE__ */
|
|
363
|
+
function Ne({ type: e = "button", ...r }) {
|
|
364
|
+
const { state: t, cycleRepeat: n } = g();
|
|
365
|
+
return /* @__PURE__ */ l("button", { type: e, "aria-label": oe[t.repeatMode], onClick: n, ...r, children: oe[t.repeatMode] });
|
|
366
|
+
}
|
|
367
|
+
Ne.displayName = "Ginger.Control.Repeat";
|
|
368
|
+
function De({ type: e = "button", children: r = "Next", ...t }) {
|
|
369
|
+
const { next: n } = g();
|
|
370
|
+
return /* @__PURE__ */ l("button", { type: e, "aria-label": "Next track", onClick: n, ...t, children: r });
|
|
371
|
+
}
|
|
372
|
+
De.displayName = "Ginger.Control.Next";
|
|
373
|
+
function we({ type: e = "button", children: r = "Previous", ...t }) {
|
|
374
|
+
const { prev: n } = g();
|
|
375
|
+
return /* @__PURE__ */ l("button", { type: e, "aria-label": "Previous track", onClick: n, ...t, children: r });
|
|
376
|
+
}
|
|
377
|
+
we.displayName = "Ginger.Control.Previous";
|
|
378
|
+
function Ue({ type: e = "button", children: r = "Shuffle", ...t }) {
|
|
379
|
+
const { state: n, toggleShuffle: i } = g();
|
|
380
|
+
return /* @__PURE__ */ l("button", { type: e, "aria-pressed": n.isShuffled, "aria-label": "Shuffle", onClick: i, ...t, children: r });
|
|
381
|
+
}
|
|
382
|
+
Ue.displayName = "Ginger.Control.Shuffle";
|
|
383
|
+
function Le({ inputStyle: e, style: r, ...t }) {
|
|
384
|
+
const { state: n, seek: i } = g(), a = Number.isFinite(n.duration) && n.duration > 0 ? n.duration : 0, u = a > 0 ? n.currentTime : 0;
|
|
385
|
+
return /* @__PURE__ */ l(
|
|
376
386
|
"input",
|
|
377
387
|
{
|
|
378
388
|
type: "range",
|
|
379
389
|
min: 0,
|
|
380
|
-
max:
|
|
390
|
+
max: a > 0 ? a : 1,
|
|
381
391
|
step: "any",
|
|
382
|
-
value: Number.isFinite(
|
|
392
|
+
value: Number.isFinite(u) ? u : 0,
|
|
383
393
|
"aria-label": "Seek",
|
|
384
|
-
onChange: (
|
|
394
|
+
onChange: (o) => i(Number(o.currentTarget.value)),
|
|
385
395
|
style: { width: "100%", ...r, ...e },
|
|
386
|
-
...
|
|
396
|
+
...t
|
|
397
|
+
}
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
Le.displayName = "Ginger.Control.SeekBar";
|
|
401
|
+
function Fe({ inputStyle: e, style: r, ...t }) {
|
|
402
|
+
const { state: n, setVolume: i } = g();
|
|
403
|
+
return /* @__PURE__ */ l(
|
|
404
|
+
"input",
|
|
405
|
+
{
|
|
406
|
+
type: "range",
|
|
407
|
+
min: 0,
|
|
408
|
+
max: 1,
|
|
409
|
+
step: "any",
|
|
410
|
+
value: n.volume,
|
|
411
|
+
"aria-label": "Volume",
|
|
412
|
+
onChange: (a) => i(Number(a.currentTarget.value)),
|
|
413
|
+
style: { width: "100%", ...r, ...e },
|
|
414
|
+
...t
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
}
|
|
418
|
+
Fe.displayName = "Ginger.Control.Volume";
|
|
419
|
+
function Oe({
|
|
420
|
+
muteLabel: e = "Mute",
|
|
421
|
+
unmuteLabel: r = "Unmute",
|
|
422
|
+
type: t = "button",
|
|
423
|
+
...n
|
|
424
|
+
}) {
|
|
425
|
+
const { state: i, toggleMute: a } = g();
|
|
426
|
+
return /* @__PURE__ */ l(
|
|
427
|
+
"button",
|
|
428
|
+
{
|
|
429
|
+
type: t,
|
|
430
|
+
"aria-pressed": i.muted,
|
|
431
|
+
"aria-label": i.muted ? "Unmute" : "Mute",
|
|
432
|
+
onClick: a,
|
|
433
|
+
...n,
|
|
434
|
+
children: i.muted ? r : e
|
|
387
435
|
}
|
|
388
436
|
);
|
|
389
437
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
438
|
+
Oe.displayName = "Ginger.Control.Mute";
|
|
439
|
+
const pr = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
|
440
|
+
function Ye({ rates: e = pr, style: r, ...t }) {
|
|
441
|
+
const { state: n, setPlaybackRate: i } = g(), a = U(
|
|
442
|
+
() => Array.from(/* @__PURE__ */ new Set([...e, n.playbackRate])).sort((u, o) => u - o),
|
|
443
|
+
[e, n.playbackRate]
|
|
444
|
+
);
|
|
445
|
+
return /* @__PURE__ */ l(
|
|
446
|
+
"select",
|
|
447
|
+
{
|
|
448
|
+
"aria-label": "Playback speed",
|
|
449
|
+
value: String(n.playbackRate),
|
|
450
|
+
style: r,
|
|
451
|
+
onChange: (u) => i(Number(u.currentTarget.value)),
|
|
452
|
+
...t,
|
|
453
|
+
children: a.map((u) => /* @__PURE__ */ l("option", { value: String(u), children: u === 1 ? "1× normal" : `${u}×` }, u))
|
|
454
|
+
}
|
|
455
|
+
);
|
|
456
|
+
}
|
|
457
|
+
Ye.displayName = "Ginger.Control.PlaybackRate";
|
|
458
|
+
const F = de(null);
|
|
459
|
+
function gr() {
|
|
460
|
+
const e = ce(F);
|
|
461
|
+
if (!e)
|
|
462
|
+
throw new Error("Ginger.Playlist.Track must be used inside <Ginger.Playlist>");
|
|
463
|
+
return e;
|
|
464
|
+
}
|
|
465
|
+
function Be({
|
|
466
|
+
children: e,
|
|
467
|
+
rowStyle: r,
|
|
468
|
+
renderTrack: t,
|
|
394
469
|
playOnSelect: n = !0,
|
|
470
|
+
style: i,
|
|
471
|
+
...a
|
|
472
|
+
}) {
|
|
473
|
+
const { state: u, playTrackAt: o, selectTrackAt: c } = g(), f = {
|
|
474
|
+
listStyle: "none",
|
|
475
|
+
margin: 0,
|
|
476
|
+
padding: 0,
|
|
477
|
+
fontFamily: "var(--ginger-font-family, system-ui, sans-serif)",
|
|
478
|
+
fontSize: "var(--ginger-font-size, 14px)",
|
|
479
|
+
color: "var(--ginger-primary-color, #111827)",
|
|
480
|
+
...i
|
|
481
|
+
};
|
|
482
|
+
return e !== void 0 ? /* @__PURE__ */ l(F.Provider, { value: { playOnSelect: n }, children: /* @__PURE__ */ l("ul", { style: f, ...a, children: e }) }) : /* @__PURE__ */ l(F.Provider, { value: { playOnSelect: n }, children: /* @__PURE__ */ l("ul", { style: f, ...a, children: u.tracks.map((d, y) => {
|
|
483
|
+
const P = y === u.currentIndex;
|
|
484
|
+
return /* @__PURE__ */ l("li", { children: /* @__PURE__ */ l(
|
|
485
|
+
"button",
|
|
486
|
+
{
|
|
487
|
+
type: "button",
|
|
488
|
+
onClick: () => {
|
|
489
|
+
n ? o(y) : c(y);
|
|
490
|
+
},
|
|
491
|
+
style: {
|
|
492
|
+
width: "100%",
|
|
493
|
+
textAlign: "left",
|
|
494
|
+
border: "none",
|
|
495
|
+
background: P ? "rgba(17, 24, 39, 0.06)" : "transparent",
|
|
496
|
+
color: "inherit",
|
|
497
|
+
font: "inherit",
|
|
498
|
+
cursor: "pointer",
|
|
499
|
+
padding: "var(--ginger-playlist-row-padding, 6px 8px)",
|
|
500
|
+
...r
|
|
501
|
+
},
|
|
502
|
+
children: t ? t(d, y, P) : /* @__PURE__ */ se("span", { children: [
|
|
503
|
+
d.title,
|
|
504
|
+
d.artist ? ` — ${d.artist}` : ""
|
|
505
|
+
] })
|
|
506
|
+
}
|
|
507
|
+
) }, `${d.fileUrl}-${y}`);
|
|
508
|
+
}) }) });
|
|
509
|
+
}
|
|
510
|
+
Be.displayName = "Ginger.Playlist";
|
|
511
|
+
function Ve({
|
|
512
|
+
index: e,
|
|
513
|
+
className: r,
|
|
395
514
|
style: t,
|
|
396
|
-
|
|
515
|
+
children: n,
|
|
516
|
+
liProps: i,
|
|
517
|
+
onClick: a,
|
|
518
|
+
...u
|
|
397
519
|
}) {
|
|
398
|
-
const { state:
|
|
399
|
-
|
|
400
|
-
"
|
|
520
|
+
const { playOnSelect: o } = gr(), { state: c, playTrackAt: f, selectTrackAt: s } = g(), d = e === c.currentIndex, y = c.tracks[e], P = y != null ? /* @__PURE__ */ se("span", { children: [
|
|
521
|
+
y.title,
|
|
522
|
+
y.artist ? ` — ${y.artist}` : ""
|
|
523
|
+
] }) : null;
|
|
524
|
+
return /* @__PURE__ */ l("li", { ...i, children: /* @__PURE__ */ l(
|
|
525
|
+
"button",
|
|
401
526
|
{
|
|
527
|
+
type: "button",
|
|
528
|
+
"aria-current": d ? "true" : void 0,
|
|
529
|
+
"data-ginger-active": d || void 0,
|
|
530
|
+
className: r,
|
|
402
531
|
style: {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
532
|
+
width: "100%",
|
|
533
|
+
textAlign: "left",
|
|
534
|
+
border: "none",
|
|
535
|
+
background: d ? "rgba(17, 24, 39, 0.06)" : "transparent",
|
|
536
|
+
color: "inherit",
|
|
537
|
+
font: "inherit",
|
|
538
|
+
cursor: "pointer",
|
|
539
|
+
padding: "var(--ginger-playlist-row-padding, 6px 8px)",
|
|
409
540
|
...t
|
|
410
541
|
},
|
|
411
|
-
...
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
{
|
|
417
|
-
type: "button",
|
|
418
|
-
onClick: () => {
|
|
419
|
-
n ? a(d) : l(d);
|
|
420
|
-
},
|
|
421
|
-
style: {
|
|
422
|
-
width: "100%",
|
|
423
|
-
textAlign: "left",
|
|
424
|
-
border: "none",
|
|
425
|
-
background: o ? "rgba(17, 24, 39, 0.06)" : "transparent",
|
|
426
|
-
color: "inherit",
|
|
427
|
-
font: "inherit",
|
|
428
|
-
cursor: "pointer",
|
|
429
|
-
padding: "var(--ginger-playlist-row-padding, 6px 8px)",
|
|
430
|
-
...e
|
|
431
|
-
},
|
|
432
|
-
children: r ? r(c, d, o) : /* @__PURE__ */ De("span", { children: [
|
|
433
|
-
c.title,
|
|
434
|
-
c.artist ? ` — ${c.artist}` : ""
|
|
435
|
-
] })
|
|
436
|
-
}
|
|
437
|
-
) }, `${c.fileUrl}-${d}`);
|
|
438
|
-
})
|
|
542
|
+
...u,
|
|
543
|
+
onClick: (x) => {
|
|
544
|
+
a == null || a(x), !x.defaultPrevented && (o ? f(e) : s(e));
|
|
545
|
+
},
|
|
546
|
+
children: n ?? P
|
|
439
547
|
}
|
|
440
|
-
);
|
|
548
|
+
) });
|
|
441
549
|
}
|
|
442
|
-
|
|
443
|
-
const
|
|
550
|
+
Ve.displayName = "Ginger.Playlist.Track";
|
|
551
|
+
const yr = Object.assign(Be, {
|
|
552
|
+
Track: Ve
|
|
553
|
+
}), mr = v("Ginger.Queue.Title", (e) => {
|
|
444
554
|
var r;
|
|
445
555
|
return (r = e.playlistMeta) == null ? void 0 : r.title;
|
|
446
|
-
}),
|
|
556
|
+
}), hr = v("Ginger.Queue.Subtitle", (e) => {
|
|
447
557
|
var r;
|
|
448
558
|
return (r = e.playlistMeta) == null ? void 0 : r.subtitle;
|
|
449
|
-
}),
|
|
559
|
+
}), br = v("Ginger.Queue.Description", (e) => {
|
|
450
560
|
var r;
|
|
451
561
|
return (r = e.playlistMeta) == null ? void 0 : r.description;
|
|
452
|
-
}),
|
|
562
|
+
}), Pr = v("Ginger.Queue.Copyright", (e) => {
|
|
453
563
|
var r;
|
|
454
564
|
return (r = e.playlistMeta) == null ? void 0 : r.copyright;
|
|
455
565
|
});
|
|
456
|
-
function
|
|
457
|
-
var c,
|
|
458
|
-
const { state:
|
|
459
|
-
if (!
|
|
460
|
-
const
|
|
461
|
-
return
|
|
566
|
+
function $e({ className: e, style: r, fallback: t, empty: n, imgStyle: i }) {
|
|
567
|
+
var c, f;
|
|
568
|
+
const { state: a } = g(), u = (c = a.playlistMeta) == null ? void 0 : c.artworkUrl;
|
|
569
|
+
if (!u) {
|
|
570
|
+
const s = n ?? t ?? null;
|
|
571
|
+
return s ? /* @__PURE__ */ l("span", { className: e, style: r, children: s }) : null;
|
|
462
572
|
}
|
|
463
|
-
const
|
|
464
|
-
return /* @__PURE__ */
|
|
573
|
+
const o = ((f = a.playlistMeta) == null ? void 0 : f.title) ?? "Playlist artwork";
|
|
574
|
+
return /* @__PURE__ */ l(
|
|
465
575
|
"span",
|
|
466
576
|
{
|
|
467
577
|
className: e,
|
|
@@ -472,11 +582,11 @@ function ve({ className: e, style: r, fallback: n, empty: t, imgStyle: i }) {
|
|
|
472
582
|
overflow: "hidden",
|
|
473
583
|
...r
|
|
474
584
|
},
|
|
475
|
-
children: /* @__PURE__ */
|
|
585
|
+
children: /* @__PURE__ */ l(
|
|
476
586
|
"img",
|
|
477
587
|
{
|
|
478
|
-
src:
|
|
479
|
-
alt:
|
|
588
|
+
src: u,
|
|
589
|
+
alt: o,
|
|
480
590
|
style: {
|
|
481
591
|
display: "block",
|
|
482
592
|
width: "100%",
|
|
@@ -489,56 +599,83 @@ function ve({ className: e, style: r, fallback: n, empty: t, imgStyle: i }) {
|
|
|
489
599
|
}
|
|
490
600
|
);
|
|
491
601
|
}
|
|
492
|
-
|
|
493
|
-
|
|
602
|
+
$e.displayName = "Ginger.Queue.Artwork";
|
|
603
|
+
function L(e) {
|
|
604
|
+
return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : 1;
|
|
605
|
+
}
|
|
606
|
+
function B(e) {
|
|
607
|
+
return Number.isFinite(e) ? Math.min(4, Math.max(0.25, e)) : 1;
|
|
608
|
+
}
|
|
609
|
+
const G = {
|
|
494
610
|
currentTime: 0,
|
|
495
611
|
duration: 0,
|
|
496
612
|
bufferedFraction: 0,
|
|
497
613
|
isBuffering: !1,
|
|
498
614
|
errorMessage: null
|
|
615
|
+
}, kr = {
|
|
616
|
+
...G,
|
|
617
|
+
volume: 1,
|
|
618
|
+
muted: !1,
|
|
619
|
+
playbackRate: 1
|
|
499
620
|
};
|
|
500
|
-
function
|
|
621
|
+
function Qe(e) {
|
|
501
622
|
const r = [...e.tracks];
|
|
502
|
-
let
|
|
503
|
-
return e.isShuffled && r.length > 1 && (
|
|
623
|
+
let t = S(e.currentIndex ?? 0, r.length), n = null, i = r;
|
|
624
|
+
return e.isShuffled && r.length > 1 && (n = [...r], i = pe(r, t), t = 0), {
|
|
504
625
|
tracks: i,
|
|
505
|
-
currentIndex:
|
|
626
|
+
currentIndex: t,
|
|
506
627
|
isPaused: e.isPaused ?? !0,
|
|
507
628
|
isShuffled: !!(e.isShuffled && i.length > 1),
|
|
508
629
|
repeatMode: e.repeatMode ?? "off",
|
|
509
|
-
originalTracks:
|
|
630
|
+
originalTracks: n,
|
|
510
631
|
playlistMeta: e.playlistMeta ?? null,
|
|
511
|
-
...
|
|
632
|
+
...kr,
|
|
633
|
+
volume: L(e.volume ?? 1),
|
|
634
|
+
muted: e.muted ?? !1,
|
|
635
|
+
playbackRate: B(e.playbackRate ?? 1)
|
|
512
636
|
};
|
|
513
637
|
}
|
|
514
|
-
function
|
|
638
|
+
function Mr(e, r) {
|
|
515
639
|
switch (r.type) {
|
|
516
640
|
case "INIT": {
|
|
517
|
-
const {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
641
|
+
const {
|
|
642
|
+
tracks: t,
|
|
643
|
+
currentIndex: n,
|
|
644
|
+
playlistMeta: i,
|
|
645
|
+
isPaused: a,
|
|
646
|
+
isShuffled: u,
|
|
647
|
+
repeatMode: o,
|
|
648
|
+
volume: c,
|
|
649
|
+
muted: f,
|
|
650
|
+
playbackRate: s
|
|
651
|
+
} = r.payload;
|
|
652
|
+
return Qe({
|
|
653
|
+
tracks: t,
|
|
654
|
+
currentIndex: n,
|
|
521
655
|
playlistMeta: i ?? null,
|
|
522
|
-
isPaused:
|
|
523
|
-
isShuffled:
|
|
524
|
-
repeatMode:
|
|
656
|
+
isPaused: a ?? !0,
|
|
657
|
+
isShuffled: u ?? !1,
|
|
658
|
+
repeatMode: o ?? "off",
|
|
659
|
+
volume: c,
|
|
660
|
+
muted: f,
|
|
661
|
+
playbackRate: s
|
|
525
662
|
});
|
|
526
663
|
}
|
|
527
664
|
case "SET_QUEUE": {
|
|
528
|
-
const { tracks:
|
|
665
|
+
const { tracks: t, currentIndex: n } = r.payload, i = [...t], a = S(n ?? e.currentIndex, i.length);
|
|
529
666
|
return {
|
|
530
667
|
...e,
|
|
531
668
|
tracks: i,
|
|
532
|
-
currentIndex:
|
|
533
|
-
...
|
|
669
|
+
currentIndex: a,
|
|
670
|
+
...G
|
|
534
671
|
};
|
|
535
672
|
}
|
|
536
673
|
case "SET_INDEX": {
|
|
537
|
-
const
|
|
674
|
+
const t = S(r.payload.index, e.tracks.length), n = r.payload.autoPlay, i = n === !0 ? !1 : n === !1 ? !0 : e.isPaused;
|
|
538
675
|
return {
|
|
539
676
|
...e,
|
|
540
|
-
currentIndex:
|
|
541
|
-
...
|
|
677
|
+
currentIndex: t,
|
|
678
|
+
...G,
|
|
542
679
|
isPaused: i
|
|
543
680
|
};
|
|
544
681
|
}
|
|
@@ -551,44 +688,44 @@ function ur(e, r) {
|
|
|
551
688
|
case "SET_REPEAT":
|
|
552
689
|
return { ...e, repeatMode: r.payload };
|
|
553
690
|
case "CYCLE_REPEAT":
|
|
554
|
-
return { ...e, repeatMode:
|
|
691
|
+
return { ...e, repeatMode: er(e.repeatMode) };
|
|
555
692
|
case "TOGGLE_SHUFFLE": {
|
|
556
693
|
if (e.tracks.length <= 1) return { ...e, isShuffled: !1, originalTracks: null };
|
|
557
694
|
if (!e.isShuffled) {
|
|
558
|
-
const
|
|
695
|
+
const u = [...e.tracks], o = pe(u, e.currentIndex);
|
|
559
696
|
return {
|
|
560
697
|
...e,
|
|
561
698
|
isShuffled: !0,
|
|
562
|
-
originalTracks:
|
|
563
|
-
tracks:
|
|
699
|
+
originalTracks: u,
|
|
700
|
+
tracks: o,
|
|
564
701
|
currentIndex: 0
|
|
565
702
|
};
|
|
566
703
|
}
|
|
567
|
-
const
|
|
704
|
+
const t = e.originalTracks ? [...e.originalTracks] : [...e.tracks], n = e.tracks[e.currentIndex], i = (n == null ? void 0 : n.fileUrl) ?? "", a = qe(t, i);
|
|
568
705
|
return {
|
|
569
706
|
...e,
|
|
570
707
|
isShuffled: !1,
|
|
571
708
|
originalTracks: null,
|
|
572
|
-
tracks:
|
|
573
|
-
currentIndex:
|
|
709
|
+
tracks: t,
|
|
710
|
+
currentIndex: S(a, t.length)
|
|
574
711
|
};
|
|
575
712
|
}
|
|
576
713
|
case "NEXT": {
|
|
577
|
-
const
|
|
714
|
+
const t = Je(e), n = t === e.currentIndex;
|
|
578
715
|
return {
|
|
579
716
|
...e,
|
|
580
|
-
currentIndex:
|
|
581
|
-
...
|
|
582
|
-
isPaused:
|
|
717
|
+
currentIndex: t,
|
|
718
|
+
...n ? {} : G,
|
|
719
|
+
isPaused: n ? e.isPaused : !1
|
|
583
720
|
};
|
|
584
721
|
}
|
|
585
722
|
case "PREV": {
|
|
586
|
-
const
|
|
723
|
+
const t = Ze(e), n = t === e.currentIndex;
|
|
587
724
|
return {
|
|
588
725
|
...e,
|
|
589
|
-
currentIndex:
|
|
590
|
-
...
|
|
591
|
-
isPaused:
|
|
726
|
+
currentIndex: t,
|
|
727
|
+
...n ? {} : G,
|
|
728
|
+
isPaused: n ? e.isPaused : !1
|
|
592
729
|
};
|
|
593
730
|
}
|
|
594
731
|
case "MEDIA_TIME_UPDATE":
|
|
@@ -625,11 +762,23 @@ function ur(e, r) {
|
|
|
625
762
|
return { ...e, isPaused: !0 };
|
|
626
763
|
case "RESET_MEDIA_TIMES":
|
|
627
764
|
return { ...e, currentTime: 0, duration: 0, bufferedFraction: 0 };
|
|
765
|
+
case "SET_VOLUME":
|
|
766
|
+
return { ...e, volume: L(r.payload) };
|
|
767
|
+
case "SET_MUTED":
|
|
768
|
+
return { ...e, muted: r.payload };
|
|
769
|
+
case "TOGGLE_MUTE":
|
|
770
|
+
return { ...e, muted: !e.muted };
|
|
771
|
+
case "SET_PLAYBACK_RATE":
|
|
772
|
+
return { ...e, playbackRate: B(r.payload) };
|
|
773
|
+
case "MEDIA_VOLUME_SYNC": {
|
|
774
|
+
const { volume: t, muted: n } = r.payload, i = L(t);
|
|
775
|
+
return i === e.volume && n === e.muted ? e : { ...e, volume: i, muted: n };
|
|
776
|
+
}
|
|
628
777
|
default:
|
|
629
778
|
return e;
|
|
630
779
|
}
|
|
631
780
|
}
|
|
632
|
-
const
|
|
781
|
+
const Tr = {
|
|
633
782
|
"--ginger-primary-color": "#111827",
|
|
634
783
|
"--ginger-muted-color": "#6b7280",
|
|
635
784
|
"--ginger-font-size": "14px",
|
|
@@ -638,226 +787,243 @@ const ar = {
|
|
|
638
787
|
"--ginger-artwork-radius": "6px",
|
|
639
788
|
"--ginger-artwork-bg": "#f3f4f6"
|
|
640
789
|
};
|
|
641
|
-
function
|
|
790
|
+
function Er({
|
|
642
791
|
children: e,
|
|
643
792
|
initialTracks: r = [],
|
|
644
|
-
initialIndex:
|
|
645
|
-
initialPlaylistMeta:
|
|
793
|
+
initialIndex: t = 0,
|
|
794
|
+
initialPlaylistMeta: n = null,
|
|
646
795
|
initialShuffle: i = !1,
|
|
647
|
-
initialRepeatMode:
|
|
648
|
-
initialPaused:
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
796
|
+
initialRepeatMode: a = "off",
|
|
797
|
+
initialPaused: u = !0,
|
|
798
|
+
initialVolume: o = 1,
|
|
799
|
+
initialMuted: c = !1,
|
|
800
|
+
initialPlaybackRate: f = 1,
|
|
801
|
+
className: s,
|
|
802
|
+
style: d,
|
|
803
|
+
onTrackChange: y,
|
|
804
|
+
onPlay: P,
|
|
805
|
+
onPause: x,
|
|
806
|
+
onQueueEnd: _,
|
|
807
|
+
onError: M
|
|
656
808
|
}) {
|
|
657
|
-
var
|
|
658
|
-
const
|
|
659
|
-
|
|
809
|
+
var ae;
|
|
810
|
+
const A = ue(null), [m, h] = Ke(
|
|
811
|
+
Mr,
|
|
660
812
|
void 0,
|
|
661
|
-
() =>
|
|
813
|
+
() => Qe({
|
|
662
814
|
tracks: r,
|
|
663
|
-
currentIndex:
|
|
664
|
-
playlistMeta:
|
|
665
|
-
isPaused:
|
|
815
|
+
currentIndex: t,
|
|
816
|
+
playlistMeta: n,
|
|
817
|
+
isPaused: u,
|
|
666
818
|
isShuffled: i,
|
|
667
|
-
repeatMode:
|
|
819
|
+
repeatMode: a,
|
|
820
|
+
volume: o,
|
|
821
|
+
muted: c,
|
|
822
|
+
playbackRate: f
|
|
668
823
|
})
|
|
669
|
-
),
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
}, [
|
|
673
|
-
|
|
674
|
-
}, [
|
|
675
|
-
const
|
|
676
|
-
|
|
677
|
-
if (
|
|
678
|
-
|
|
824
|
+
), V = m.tracks[m.currentIndex] ?? null;
|
|
825
|
+
R(() => {
|
|
826
|
+
y == null || y(V, m.currentIndex);
|
|
827
|
+
}, [V, m.currentIndex, y]), R(() => {
|
|
828
|
+
m.errorMessage && (M == null || M(m.errorMessage));
|
|
829
|
+
}, [m.errorMessage, M]);
|
|
830
|
+
const N = ue(void 0);
|
|
831
|
+
R(() => {
|
|
832
|
+
if (N.current === void 0) {
|
|
833
|
+
N.current = m.isPaused;
|
|
679
834
|
return;
|
|
680
835
|
}
|
|
681
|
-
|
|
682
|
-
}, [
|
|
683
|
-
const
|
|
684
|
-
var
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
const
|
|
688
|
-
|
|
836
|
+
N.current !== m.isPaused && (m.isPaused ? x == null || x() : P == null || P()), N.current = m.isPaused;
|
|
837
|
+
}, [m.isPaused, x, P]);
|
|
838
|
+
const D = b(() => {
|
|
839
|
+
var p;
|
|
840
|
+
h({ type: "PLAY" }), (p = A.current) == null || p.play().catch((k) => {
|
|
841
|
+
h({ type: "PAUSE" });
|
|
842
|
+
const T = k instanceof Error ? k.message : "Playback failed";
|
|
843
|
+
M == null || M(T);
|
|
689
844
|
});
|
|
690
|
-
}, [
|
|
691
|
-
var
|
|
692
|
-
|
|
693
|
-
}, []),
|
|
694
|
-
|
|
695
|
-
}, [
|
|
696
|
-
const
|
|
697
|
-
|
|
698
|
-
}, []),
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
h
|
|
704
|
-
}, []),
|
|
705
|
-
|
|
706
|
-
}, []),
|
|
707
|
-
|
|
708
|
-
}, []),
|
|
709
|
-
|
|
710
|
-
}, []),
|
|
711
|
-
|
|
712
|
-
}, []),
|
|
713
|
-
|
|
714
|
-
}, []),
|
|
715
|
-
|
|
716
|
-
}, []),
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
845
|
+
}, [M]), w = b(() => {
|
|
846
|
+
var p;
|
|
847
|
+
h({ type: "PAUSE" }), (p = A.current) == null || p.pause();
|
|
848
|
+
}, []), $ = b(() => {
|
|
849
|
+
m.isPaused ? D() : w();
|
|
850
|
+
}, [w, D, m.isPaused]), Q = b((p) => {
|
|
851
|
+
const k = A.current;
|
|
852
|
+
k && Number.isFinite(p) && (k.currentTime = Math.max(0, p));
|
|
853
|
+
}, []), j = b((p) => {
|
|
854
|
+
h({ type: "SET_VOLUME", payload: L(p) });
|
|
855
|
+
}, []), X = b((p) => {
|
|
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(() => {
|
|
720
877
|
});
|
|
721
878
|
});
|
|
722
|
-
}, []),
|
|
723
|
-
|
|
724
|
-
}, []),
|
|
725
|
-
|
|
726
|
-
}, []),
|
|
727
|
-
|
|
728
|
-
const
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
const
|
|
732
|
-
|
|
879
|
+
}, []), te = b((p) => {
|
|
880
|
+
h({ type: "SET_INDEX", payload: { index: p, autoPlay: !1 } });
|
|
881
|
+
}, []), ne = b((p) => {
|
|
882
|
+
h({ type: "SET_PLAYLIST_META", payload: p });
|
|
883
|
+
}, []), je = (ae = m.tracks[m.currentIndex]) == null ? void 0 : ae.fileUrl;
|
|
884
|
+
R(() => {
|
|
885
|
+
const p = A.current;
|
|
886
|
+
p && (m.isPaused ? p.pause() : p.play().catch((k) => {
|
|
887
|
+
h({ type: "PAUSE" });
|
|
888
|
+
const T = k instanceof Error ? k.message : "Playback failed";
|
|
889
|
+
M == null || M(T);
|
|
733
890
|
}));
|
|
734
|
-
}, [
|
|
735
|
-
const
|
|
736
|
-
const
|
|
737
|
-
if (
|
|
738
|
-
const
|
|
739
|
-
|
|
740
|
-
})),
|
|
891
|
+
}, [m.isPaused, je, M]);
|
|
892
|
+
const ie = b(() => {
|
|
893
|
+
const p = He(m);
|
|
894
|
+
if (p.kind === "replay_same") {
|
|
895
|
+
const T = A.current;
|
|
896
|
+
T && (T.currentTime = 0, T.play().catch(() => {
|
|
897
|
+
})), h({ type: "PLAY" });
|
|
741
898
|
return;
|
|
742
899
|
}
|
|
743
|
-
if (
|
|
744
|
-
|
|
900
|
+
if (p.kind === "stop") {
|
|
901
|
+
h({ type: "PAUSE" }), _ == null || _();
|
|
745
902
|
return;
|
|
746
903
|
}
|
|
747
|
-
const
|
|
748
|
-
|
|
749
|
-
var
|
|
750
|
-
(
|
|
904
|
+
const k = p.nextIndex;
|
|
905
|
+
h({ type: "SET_INDEX", payload: { index: k, autoPlay: !0 } }), queueMicrotask(() => {
|
|
906
|
+
var T;
|
|
907
|
+
(T = A.current) == null || T.play().catch(() => {
|
|
751
908
|
});
|
|
752
909
|
});
|
|
753
|
-
}, [
|
|
910
|
+
}, [_, m]), Xe = U(
|
|
754
911
|
() => ({
|
|
755
|
-
state:
|
|
756
|
-
dispatch:
|
|
757
|
-
audioRef:
|
|
758
|
-
notifyEnded:
|
|
759
|
-
play:
|
|
760
|
-
pause:
|
|
761
|
-
togglePlayPause:
|
|
762
|
-
seek:
|
|
763
|
-
setVolume:
|
|
764
|
-
setMuted:
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
912
|
+
state: m,
|
|
913
|
+
dispatch: h,
|
|
914
|
+
audioRef: A,
|
|
915
|
+
notifyEnded: ie,
|
|
916
|
+
play: D,
|
|
917
|
+
pause: w,
|
|
918
|
+
togglePlayPause: $,
|
|
919
|
+
seek: Q,
|
|
920
|
+
setVolume: j,
|
|
921
|
+
setMuted: X,
|
|
922
|
+
toggleMute: W,
|
|
923
|
+
setPlaybackRate: K,
|
|
924
|
+
next: z,
|
|
925
|
+
prev: q,
|
|
926
|
+
setRepeatMode: H,
|
|
927
|
+
cycleRepeat: J,
|
|
928
|
+
toggleShuffle: Z,
|
|
929
|
+
setQueue: ee,
|
|
930
|
+
playTrackAt: re,
|
|
931
|
+
selectTrackAt: te,
|
|
932
|
+
setPlaylistMeta: ne
|
|
774
933
|
}),
|
|
775
934
|
[
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
$,
|
|
779
|
-
H,
|
|
780
|
-
_,
|
|
781
|
-
G,
|
|
782
|
-
W,
|
|
935
|
+
J,
|
|
936
|
+
h,
|
|
783
937
|
z,
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
938
|
+
ie,
|
|
939
|
+
w,
|
|
940
|
+
D,
|
|
941
|
+
re,
|
|
942
|
+
te,
|
|
789
943
|
q,
|
|
790
944
|
Q,
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
945
|
+
X,
|
|
946
|
+
K,
|
|
947
|
+
ee,
|
|
948
|
+
H,
|
|
949
|
+
ne,
|
|
950
|
+
j,
|
|
951
|
+
m,
|
|
952
|
+
W,
|
|
953
|
+
$,
|
|
954
|
+
Z
|
|
794
955
|
]
|
|
795
|
-
),
|
|
796
|
-
return /* @__PURE__ */
|
|
956
|
+
), We = U(() => ({ ...Tr, ...d }), [d]);
|
|
957
|
+
return /* @__PURE__ */ l(fe.Provider, { value: Xe, children: /* @__PURE__ */ l("div", { className: s, style: We, children: e }) });
|
|
797
958
|
}
|
|
798
|
-
const
|
|
799
|
-
Provider:
|
|
800
|
-
Player:
|
|
959
|
+
const vr = {
|
|
960
|
+
Provider: Er,
|
|
961
|
+
Player: ze,
|
|
801
962
|
Current: {
|
|
802
|
-
Title:
|
|
803
|
-
Artist:
|
|
804
|
-
Album:
|
|
805
|
-
Description:
|
|
806
|
-
Copyright:
|
|
807
|
-
Genre:
|
|
808
|
-
Label:
|
|
809
|
-
Isrc:
|
|
810
|
-
TrackNumber:
|
|
811
|
-
Year:
|
|
812
|
-
Lyrics:
|
|
813
|
-
FileUrl:
|
|
814
|
-
Artwork:
|
|
815
|
-
QueueIndex:
|
|
816
|
-
QueueLength:
|
|
817
|
-
QueuePosition:
|
|
818
|
-
Elapsed:
|
|
819
|
-
Duration:
|
|
820
|
-
Remaining:
|
|
821
|
-
Progress:
|
|
822
|
-
TimeRail:
|
|
823
|
-
PlaybackState:
|
|
824
|
-
ErrorMessage:
|
|
963
|
+
Title: nr,
|
|
964
|
+
Artist: ir,
|
|
965
|
+
Album: ar,
|
|
966
|
+
Description: ur,
|
|
967
|
+
Copyright: lr,
|
|
968
|
+
Genre: or,
|
|
969
|
+
Label: sr,
|
|
970
|
+
Isrc: cr,
|
|
971
|
+
TrackNumber: dr,
|
|
972
|
+
Year: be,
|
|
973
|
+
Lyrics: Pe,
|
|
974
|
+
FileUrl: ke,
|
|
975
|
+
Artwork: Me,
|
|
976
|
+
QueueIndex: Te,
|
|
977
|
+
QueueLength: Ee,
|
|
978
|
+
QueuePosition: Ae,
|
|
979
|
+
Elapsed: xe,
|
|
980
|
+
Duration: ve,
|
|
981
|
+
Remaining: Ie,
|
|
982
|
+
Progress: Re,
|
|
983
|
+
TimeRail: Se,
|
|
984
|
+
PlaybackState: Ge,
|
|
985
|
+
ErrorMessage: Ce
|
|
825
986
|
},
|
|
826
987
|
Queue: {
|
|
827
|
-
Title:
|
|
828
|
-
Subtitle:
|
|
829
|
-
Description:
|
|
830
|
-
Copyright:
|
|
831
|
-
Artwork:
|
|
988
|
+
Title: mr,
|
|
989
|
+
Subtitle: hr,
|
|
990
|
+
Description: br,
|
|
991
|
+
Copyright: Pr,
|
|
992
|
+
Artwork: $e
|
|
832
993
|
},
|
|
833
994
|
Control: {
|
|
834
|
-
PlayPause:
|
|
835
|
-
Repeat:
|
|
836
|
-
Next:
|
|
837
|
-
Previous:
|
|
838
|
-
Shuffle:
|
|
839
|
-
SeekBar:
|
|
995
|
+
PlayPause: _e,
|
|
996
|
+
Repeat: Ne,
|
|
997
|
+
Next: De,
|
|
998
|
+
Previous: we,
|
|
999
|
+
Shuffle: Ue,
|
|
1000
|
+
SeekBar: Le,
|
|
1001
|
+
Volume: Fe,
|
|
1002
|
+
Mute: Oe,
|
|
1003
|
+
PlaybackRate: Ye
|
|
840
1004
|
},
|
|
841
|
-
Playlist:
|
|
1005
|
+
Playlist: yr
|
|
842
1006
|
};
|
|
843
|
-
function
|
|
1007
|
+
function Ir() {
|
|
844
1008
|
const e = g(), { state: r } = e;
|
|
845
|
-
return
|
|
1009
|
+
return U(
|
|
846
1010
|
() => ({
|
|
847
1011
|
state: r,
|
|
848
|
-
currentTrack:
|
|
849
|
-
playbackUi:
|
|
850
|
-
duration:
|
|
851
|
-
remaining:
|
|
852
|
-
progress:
|
|
853
|
-
artworkUrl:
|
|
854
|
-
albumLine:
|
|
1012
|
+
currentTrack: E(r),
|
|
1013
|
+
playbackUi: ge(r),
|
|
1014
|
+
duration: C(r),
|
|
1015
|
+
remaining: ye(r),
|
|
1016
|
+
progress: O(r),
|
|
1017
|
+
artworkUrl: me(r),
|
|
1018
|
+
albumLine: he(r),
|
|
855
1019
|
play: e.play,
|
|
856
1020
|
pause: e.pause,
|
|
857
1021
|
togglePlayPause: e.togglePlayPause,
|
|
858
1022
|
seek: e.seek,
|
|
859
1023
|
setVolume: e.setVolume,
|
|
860
1024
|
setMuted: e.setMuted,
|
|
1025
|
+
toggleMute: e.toggleMute,
|
|
1026
|
+
setPlaybackRate: e.setPlaybackRate,
|
|
861
1027
|
next: e.next,
|
|
862
1028
|
prev: e.prev,
|
|
863
1029
|
setRepeatMode: e.setRepeatMode,
|
|
@@ -880,10 +1046,12 @@ function dr() {
|
|
|
880
1046
|
e.prev,
|
|
881
1047
|
e.seek,
|
|
882
1048
|
e.setMuted,
|
|
1049
|
+
e.setPlaybackRate,
|
|
883
1050
|
e.setPlaylistMeta,
|
|
884
1051
|
e.setQueue,
|
|
885
1052
|
e.setRepeatMode,
|
|
886
1053
|
e.setVolume,
|
|
1054
|
+
e.toggleMute,
|
|
887
1055
|
e.togglePlayPause,
|
|
888
1056
|
e.toggleShuffle,
|
|
889
1057
|
r
|
|
@@ -891,7 +1059,7 @@ function dr() {
|
|
|
891
1059
|
);
|
|
892
1060
|
}
|
|
893
1061
|
export {
|
|
894
|
-
|
|
895
|
-
|
|
1062
|
+
vr as Ginger,
|
|
1063
|
+
Ir as useGinger
|
|
896
1064
|
};
|
|
897
1065
|
//# sourceMappingURL=index.js.map
|