twist-aplayer 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs ADDED
@@ -0,0 +1,1879 @@
1
+ import * as ee from "react";
2
+ import _e, { useMemo as K, useRef as F, useState as H, useEffect as I, useCallback as L } from "react";
3
+ var be = { exports: {} }, ie = {};
4
+ /**
5
+ * @license React
6
+ * react-jsx-runtime.production.min.js
7
+ *
8
+ * Copyright (c) Facebook, Inc. and its affiliates.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ var er;
14
+ function Br() {
15
+ if (er) return ie;
16
+ er = 1;
17
+ var e = _e, t = Symbol.for("react.element"), n = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, i = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, f = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function p(y, s, d) {
19
+ var b, l = {}, c = null, E = null;
20
+ d !== void 0 && (c = "" + d), s.key !== void 0 && (c = "" + s.key), s.ref !== void 0 && (E = s.ref);
21
+ for (b in s) a.call(s, b) && !f.hasOwnProperty(b) && (l[b] = s[b]);
22
+ if (y && y.defaultProps) for (b in s = y.defaultProps, s) l[b] === void 0 && (l[b] = s[b]);
23
+ return { $$typeof: t, type: y, key: c, ref: E, props: l, _owner: i.current };
24
+ }
25
+ return ie.Fragment = n, ie.jsx = p, ie.jsxs = p, ie;
26
+ }
27
+ var oe = {};
28
+ /**
29
+ * @license React
30
+ * react-jsx-runtime.development.js
31
+ *
32
+ * Copyright (c) Facebook, Inc. and its affiliates.
33
+ *
34
+ * This source code is licensed under the MIT license found in the
35
+ * LICENSE file in the root directory of this source tree.
36
+ */
37
+ var rr;
38
+ function zr() {
39
+ return rr || (rr = 1, process.env.NODE_ENV !== "production" && function() {
40
+ var e = _e, t = Symbol.for("react.element"), n = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), y = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), b = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), c = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), S = Symbol.iterator, o = "@@iterator";
41
+ function h(r) {
42
+ if (r === null || typeof r != "object")
43
+ return null;
44
+ var u = S && r[S] || r[o];
45
+ return typeof u == "function" ? u : null;
46
+ }
47
+ var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
48
+ function x(r) {
49
+ {
50
+ for (var u = arguments.length, m = new Array(u > 1 ? u - 1 : 0), _ = 1; _ < u; _++)
51
+ m[_ - 1] = arguments[_];
52
+ q("error", r, m);
53
+ }
54
+ }
55
+ function q(r, u, m) {
56
+ {
57
+ var _ = g.ReactDebugCurrentFrame, j = _.getStackAddendum();
58
+ j !== "" && (u += "%s", m = m.concat([j]));
59
+ var R = m.map(function(w) {
60
+ return String(w);
61
+ });
62
+ R.unshift("Warning: " + u), Function.prototype.apply.call(console[r], console, R);
63
+ }
64
+ }
65
+ var C = !1, re = !1, U = !1, B = !1, ce = !1, le;
66
+ le = Symbol.for("react.module.reference");
67
+ function Se(r) {
68
+ return !!(typeof r == "string" || typeof r == "function" || r === a || r === f || ce || r === i || r === d || r === b || B || r === E || C || re || U || typeof r == "object" && r !== null && (r.$$typeof === c || r.$$typeof === l || r.$$typeof === p || r.$$typeof === y || r.$$typeof === s || // This needs to include all possible module reference object
69
+ // types supported by any Flight configuration anywhere since
70
+ // we don't know which Flight build this will end up being used
71
+ // with.
72
+ r.$$typeof === le || r.getModuleId !== void 0));
73
+ }
74
+ function Te(r, u, m) {
75
+ var _ = r.displayName;
76
+ if (_)
77
+ return _;
78
+ var j = u.displayName || u.name || "";
79
+ return j !== "" ? m + "(" + j + ")" : m;
80
+ }
81
+ function fe(r) {
82
+ return r.displayName || "Context";
83
+ }
84
+ function V(r) {
85
+ if (r == null)
86
+ return null;
87
+ if (typeof r.tag == "number" && x("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
88
+ return r.displayName || r.name || null;
89
+ if (typeof r == "string")
90
+ return r;
91
+ switch (r) {
92
+ case a:
93
+ return "Fragment";
94
+ case n:
95
+ return "Portal";
96
+ case f:
97
+ return "Profiler";
98
+ case i:
99
+ return "StrictMode";
100
+ case d:
101
+ return "Suspense";
102
+ case b:
103
+ return "SuspenseList";
104
+ }
105
+ if (typeof r == "object")
106
+ switch (r.$$typeof) {
107
+ case y:
108
+ var u = r;
109
+ return fe(u) + ".Consumer";
110
+ case p:
111
+ var m = r;
112
+ return fe(m._context) + ".Provider";
113
+ case s:
114
+ return Te(r, r.render, "ForwardRef");
115
+ case l:
116
+ var _ = r.displayName || null;
117
+ return _ !== null ? _ : V(r.type) || "Memo";
118
+ case c: {
119
+ var j = r, R = j._payload, w = j._init;
120
+ try {
121
+ return V(w(R));
122
+ } catch {
123
+ return null;
124
+ }
125
+ }
126
+ }
127
+ return null;
128
+ }
129
+ var k = Object.assign, Y = 0, J, te, ne, ae, O, de, De;
130
+ function ke() {
131
+ }
132
+ ke.__reactDisabledLog = !0;
133
+ function yr() {
134
+ {
135
+ if (Y === 0) {
136
+ J = console.log, te = console.info, ne = console.warn, ae = console.error, O = console.group, de = console.groupCollapsed, De = console.groupEnd;
137
+ var r = {
138
+ configurable: !0,
139
+ enumerable: !0,
140
+ value: ke,
141
+ writable: !0
142
+ };
143
+ Object.defineProperties(console, {
144
+ info: r,
145
+ log: r,
146
+ warn: r,
147
+ error: r,
148
+ group: r,
149
+ groupCollapsed: r,
150
+ groupEnd: r
151
+ });
152
+ }
153
+ Y++;
154
+ }
155
+ }
156
+ function br() {
157
+ {
158
+ if (Y--, Y === 0) {
159
+ var r = {
160
+ configurable: !0,
161
+ enumerable: !0,
162
+ writable: !0
163
+ };
164
+ Object.defineProperties(console, {
165
+ log: k({}, r, {
166
+ value: J
167
+ }),
168
+ info: k({}, r, {
169
+ value: te
170
+ }),
171
+ warn: k({}, r, {
172
+ value: ne
173
+ }),
174
+ error: k({}, r, {
175
+ value: ae
176
+ }),
177
+ group: k({}, r, {
178
+ value: O
179
+ }),
180
+ groupCollapsed: k({}, r, {
181
+ value: de
182
+ }),
183
+ groupEnd: k({}, r, {
184
+ value: De
185
+ })
186
+ });
187
+ }
188
+ Y < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
+ }
190
+ }
191
+ var we = g.ReactCurrentDispatcher, je;
192
+ function ve(r, u, m) {
193
+ {
194
+ if (je === void 0)
195
+ try {
196
+ throw Error();
197
+ } catch (j) {
198
+ var _ = j.stack.trim().match(/\n( *(at )?)/);
199
+ je = _ && _[1] || "";
200
+ }
201
+ return `
202
+ ` + je + r;
203
+ }
204
+ }
205
+ var Oe = !1, me;
206
+ {
207
+ var gr = typeof WeakMap == "function" ? WeakMap : Map;
208
+ me = new gr();
209
+ }
210
+ function Ie(r, u) {
211
+ if (!r || Oe)
212
+ return "";
213
+ {
214
+ var m = me.get(r);
215
+ if (m !== void 0)
216
+ return m;
217
+ }
218
+ var _;
219
+ Oe = !0;
220
+ var j = Error.prepareStackTrace;
221
+ Error.prepareStackTrace = void 0;
222
+ var R;
223
+ R = we.current, we.current = null, yr();
224
+ try {
225
+ if (u) {
226
+ var w = function() {
227
+ throw Error();
228
+ };
229
+ if (Object.defineProperty(w.prototype, "props", {
230
+ set: function() {
231
+ throw Error();
232
+ }
233
+ }), typeof Reflect == "object" && Reflect.construct) {
234
+ try {
235
+ Reflect.construct(w, []);
236
+ } catch (z) {
237
+ _ = z;
238
+ }
239
+ Reflect.construct(r, [], w);
240
+ } else {
241
+ try {
242
+ w.call();
243
+ } catch (z) {
244
+ _ = z;
245
+ }
246
+ r.call(w.prototype);
247
+ }
248
+ } else {
249
+ try {
250
+ throw Error();
251
+ } catch (z) {
252
+ _ = z;
253
+ }
254
+ r();
255
+ }
256
+ } catch (z) {
257
+ if (z && _ && typeof z.stack == "string") {
258
+ for (var T = z.stack.split(`
259
+ `), M = _.stack.split(`
260
+ `), $ = T.length - 1, A = M.length - 1; $ >= 1 && A >= 0 && T[$] !== M[A]; )
261
+ A--;
262
+ for (; $ >= 1 && A >= 0; $--, A--)
263
+ if (T[$] !== M[A]) {
264
+ if ($ !== 1 || A !== 1)
265
+ do
266
+ if ($--, A--, A < 0 || T[$] !== M[A]) {
267
+ var D = `
268
+ ` + T[$].replace(" at new ", " at ");
269
+ return r.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", r.displayName)), typeof r == "function" && me.set(r, D), D;
270
+ }
271
+ while ($ >= 1 && A >= 0);
272
+ break;
273
+ }
274
+ }
275
+ } finally {
276
+ Oe = !1, we.current = R, br(), Error.prepareStackTrace = j;
277
+ }
278
+ var Q = r ? r.displayName || r.name : "", Ze = Q ? ve(Q) : "";
279
+ return typeof r == "function" && me.set(r, Ze), Ze;
280
+ }
281
+ function Er(r, u, m) {
282
+ return Ie(r, !1);
283
+ }
284
+ function xr(r) {
285
+ var u = r.prototype;
286
+ return !!(u && u.isReactComponent);
287
+ }
288
+ function he(r, u, m) {
289
+ if (r == null)
290
+ return "";
291
+ if (typeof r == "function")
292
+ return Ie(r, xr(r));
293
+ if (typeof r == "string")
294
+ return ve(r);
295
+ switch (r) {
296
+ case d:
297
+ return ve("Suspense");
298
+ case b:
299
+ return ve("SuspenseList");
300
+ }
301
+ if (typeof r == "object")
302
+ switch (r.$$typeof) {
303
+ case s:
304
+ return Er(r.render);
305
+ case l:
306
+ return he(r.type, u, m);
307
+ case c: {
308
+ var _ = r, j = _._payload, R = _._init;
309
+ try {
310
+ return he(R(j), u, m);
311
+ } catch {
312
+ }
313
+ }
314
+ }
315
+ return "";
316
+ }
317
+ var pe = Object.prototype.hasOwnProperty, Ve = {}, Fe = g.ReactDebugCurrentFrame;
318
+ function ye(r) {
319
+ if (r) {
320
+ var u = r._owner, m = he(r.type, r._source, u ? u.type : null);
321
+ Fe.setExtraStackFrame(m);
322
+ } else
323
+ Fe.setExtraStackFrame(null);
324
+ }
325
+ function _r(r, u, m, _, j) {
326
+ {
327
+ var R = Function.call.bind(pe);
328
+ for (var w in r)
329
+ if (R(r, w)) {
330
+ var T = void 0;
331
+ try {
332
+ if (typeof r[w] != "function") {
333
+ var M = Error((_ || "React class") + ": " + m + " type `" + w + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[w] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
334
+ throw M.name = "Invariant Violation", M;
335
+ }
336
+ T = r[w](u, w, _, m, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
337
+ } catch ($) {
338
+ T = $;
339
+ }
340
+ T && !(T instanceof Error) && (ye(j), x("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", _ || "React class", m, w, typeof T), ye(null)), T instanceof Error && !(T.message in Ve) && (Ve[T.message] = !0, ye(j), x("Failed %s type: %s", m, T.message), ye(null));
341
+ }
342
+ }
343
+ }
344
+ var Sr = Array.isArray;
345
+ function Re(r) {
346
+ return Sr(r);
347
+ }
348
+ function Tr(r) {
349
+ {
350
+ var u = typeof Symbol == "function" && Symbol.toStringTag, m = u && r[Symbol.toStringTag] || r.constructor.name || "Object";
351
+ return m;
352
+ }
353
+ }
354
+ function wr(r) {
355
+ try {
356
+ return Be(r), !1;
357
+ } catch {
358
+ return !0;
359
+ }
360
+ }
361
+ function Be(r) {
362
+ return "" + r;
363
+ }
364
+ function ze(r) {
365
+ if (wr(r))
366
+ return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Tr(r)), Be(r);
367
+ }
368
+ var He = g.ReactCurrentOwner, jr = {
369
+ key: !0,
370
+ ref: !0,
371
+ __self: !0,
372
+ __source: !0
373
+ }, We, Ue;
374
+ function Or(r) {
375
+ if (pe.call(r, "ref")) {
376
+ var u = Object.getOwnPropertyDescriptor(r, "ref").get;
377
+ if (u && u.isReactWarning)
378
+ return !1;
379
+ }
380
+ return r.ref !== void 0;
381
+ }
382
+ function Rr(r) {
383
+ if (pe.call(r, "key")) {
384
+ var u = Object.getOwnPropertyDescriptor(r, "key").get;
385
+ if (u && u.isReactWarning)
386
+ return !1;
387
+ }
388
+ return r.key !== void 0;
389
+ }
390
+ function Lr(r, u) {
391
+ typeof r.ref == "string" && He.current;
392
+ }
393
+ function Pr(r, u) {
394
+ {
395
+ var m = function() {
396
+ We || (We = !0, x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", u));
397
+ };
398
+ m.isReactWarning = !0, Object.defineProperty(r, "key", {
399
+ get: m,
400
+ configurable: !0
401
+ });
402
+ }
403
+ }
404
+ function $r(r, u) {
405
+ {
406
+ var m = function() {
407
+ Ue || (Ue = !0, x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", u));
408
+ };
409
+ m.isReactWarning = !0, Object.defineProperty(r, "ref", {
410
+ get: m,
411
+ configurable: !0
412
+ });
413
+ }
414
+ }
415
+ var Cr = function(r, u, m, _, j, R, w) {
416
+ var T = {
417
+ // This tag allows us to uniquely identify this as a React Element
418
+ $$typeof: t,
419
+ // Built-in properties that belong on the element
420
+ type: r,
421
+ key: u,
422
+ ref: m,
423
+ props: w,
424
+ // Record the component responsible for creating this element.
425
+ _owner: R
426
+ };
427
+ return T._store = {}, Object.defineProperty(T._store, "validated", {
428
+ configurable: !1,
429
+ enumerable: !1,
430
+ writable: !0,
431
+ value: !1
432
+ }), Object.defineProperty(T, "_self", {
433
+ configurable: !1,
434
+ enumerable: !1,
435
+ writable: !1,
436
+ value: _
437
+ }), Object.defineProperty(T, "_source", {
438
+ configurable: !1,
439
+ enumerable: !1,
440
+ writable: !1,
441
+ value: j
442
+ }), Object.freeze && (Object.freeze(T.props), Object.freeze(T)), T;
443
+ };
444
+ function Ar(r, u, m, _, j) {
445
+ {
446
+ var R, w = {}, T = null, M = null;
447
+ m !== void 0 && (ze(m), T = "" + m), Rr(u) && (ze(u.key), T = "" + u.key), Or(u) && (M = u.ref, Lr(u, j));
448
+ for (R in u)
449
+ pe.call(u, R) && !jr.hasOwnProperty(R) && (w[R] = u[R]);
450
+ if (r && r.defaultProps) {
451
+ var $ = r.defaultProps;
452
+ for (R in $)
453
+ w[R] === void 0 && (w[R] = $[R]);
454
+ }
455
+ if (T || M) {
456
+ var A = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
457
+ T && Pr(w, A), M && $r(w, A);
458
+ }
459
+ return Cr(r, T, M, j, _, He.current, w);
460
+ }
461
+ }
462
+ var Le = g.ReactCurrentOwner, Ye = g.ReactDebugCurrentFrame;
463
+ function X(r) {
464
+ if (r) {
465
+ var u = r._owner, m = he(r.type, r._source, u ? u.type : null);
466
+ Ye.setExtraStackFrame(m);
467
+ } else
468
+ Ye.setExtraStackFrame(null);
469
+ }
470
+ var Pe;
471
+ Pe = !1;
472
+ function $e(r) {
473
+ return typeof r == "object" && r !== null && r.$$typeof === t;
474
+ }
475
+ function Ge() {
476
+ {
477
+ if (Le.current) {
478
+ var r = V(Le.current.type);
479
+ if (r)
480
+ return `
481
+
482
+ Check the render method of \`` + r + "`.";
483
+ }
484
+ return "";
485
+ }
486
+ }
487
+ function Nr(r) {
488
+ return "";
489
+ }
490
+ var Ke = {};
491
+ function qr(r) {
492
+ {
493
+ var u = Ge();
494
+ if (!u) {
495
+ var m = typeof r == "string" ? r : r.displayName || r.name;
496
+ m && (u = `
497
+
498
+ Check the top-level render call using <` + m + ">.");
499
+ }
500
+ return u;
501
+ }
502
+ }
503
+ function Je(r, u) {
504
+ {
505
+ if (!r._store || r._store.validated || r.key != null)
506
+ return;
507
+ r._store.validated = !0;
508
+ var m = qr(u);
509
+ if (Ke[m])
510
+ return;
511
+ Ke[m] = !0;
512
+ var _ = "";
513
+ r && r._owner && r._owner !== Le.current && (_ = " It was passed a child from " + V(r._owner.type) + "."), X(r), x('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', m, _), X(null);
514
+ }
515
+ }
516
+ function Xe(r, u) {
517
+ {
518
+ if (typeof r != "object")
519
+ return;
520
+ if (Re(r))
521
+ for (var m = 0; m < r.length; m++) {
522
+ var _ = r[m];
523
+ $e(_) && Je(_, u);
524
+ }
525
+ else if ($e(r))
526
+ r._store && (r._store.validated = !0);
527
+ else if (r) {
528
+ var j = h(r);
529
+ if (typeof j == "function" && j !== r.entries)
530
+ for (var R = j.call(r), w; !(w = R.next()).done; )
531
+ $e(w.value) && Je(w.value, u);
532
+ }
533
+ }
534
+ }
535
+ function Mr(r) {
536
+ {
537
+ var u = r.type;
538
+ if (u == null || typeof u == "string")
539
+ return;
540
+ var m;
541
+ if (typeof u == "function")
542
+ m = u.propTypes;
543
+ else if (typeof u == "object" && (u.$$typeof === s || // Note: Memo only checks outer props here.
544
+ // Inner props are checked in the reconciler.
545
+ u.$$typeof === l))
546
+ m = u.propTypes;
547
+ else
548
+ return;
549
+ if (m) {
550
+ var _ = V(u);
551
+ _r(m, r.props, "prop", _, r);
552
+ } else if (u.PropTypes !== void 0 && !Pe) {
553
+ Pe = !0;
554
+ var j = V(u);
555
+ x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
556
+ }
557
+ typeof u.getDefaultProps == "function" && !u.getDefaultProps.isReactClassApproved && x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
558
+ }
559
+ }
560
+ function Dr(r) {
561
+ {
562
+ for (var u = Object.keys(r.props), m = 0; m < u.length; m++) {
563
+ var _ = u[m];
564
+ if (_ !== "children" && _ !== "key") {
565
+ X(r), x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", _), X(null);
566
+ break;
567
+ }
568
+ }
569
+ r.ref !== null && (X(r), x("Invalid attribute `ref` supplied to `React.Fragment`."), X(null));
570
+ }
571
+ }
572
+ function Qe(r, u, m, _, j, R) {
573
+ {
574
+ var w = Se(r);
575
+ if (!w) {
576
+ var T = "";
577
+ (r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (T += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
578
+ var M = Nr();
579
+ M ? T += M : T += Ge();
580
+ var $;
581
+ r === null ? $ = "null" : Re(r) ? $ = "array" : r !== void 0 && r.$$typeof === t ? ($ = "<" + (V(r.type) || "Unknown") + " />", T = " Did you accidentally export a JSX literal instead of a component?") : $ = typeof r, x("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", $, T);
582
+ }
583
+ var A = Ar(r, u, m, j, R);
584
+ if (A == null)
585
+ return A;
586
+ if (w) {
587
+ var D = u.children;
588
+ if (D !== void 0)
589
+ if (_)
590
+ if (Re(D)) {
591
+ for (var Q = 0; Q < D.length; Q++)
592
+ Xe(D[Q], r);
593
+ Object.freeze && Object.freeze(D);
594
+ } else
595
+ x("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
596
+ else
597
+ Xe(D, r);
598
+ }
599
+ return r === a ? Dr(A) : Mr(A), A;
600
+ }
601
+ }
602
+ function kr(r, u, m) {
603
+ return Qe(r, u, m, !0);
604
+ }
605
+ function Ir(r, u, m) {
606
+ return Qe(r, u, m, !1);
607
+ }
608
+ var Vr = Ir, Fr = kr;
609
+ oe.Fragment = a, oe.jsx = Vr, oe.jsxs = Fr;
610
+ }()), oe;
611
+ }
612
+ var tr;
613
+ function Hr() {
614
+ return tr || (tr = 1, process.env.NODE_ENV === "production" ? be.exports = Br() : be.exports = zr()), be.exports;
615
+ }
616
+ var v = Hr(), ge = (e) => `--${e}`, nr = (e) => `var(--${e})`, ar = (e, t) => `--${e}: ${t};`;
617
+ function Wr(e, t) {
618
+ const n = (a) => t;
619
+ return {
620
+ b: () => `${n()}-${e}`,
621
+ be: (a) => `${n()}-${e}__${a}`,
622
+ bm: (a) => `${n()}-${e}--${a}`,
623
+ bem: (a, i) => `${n()}-${e}__${a}--${i}`,
624
+ bs: (a) => `${n()}-${e}-${a}`,
625
+ ns: (a) => `${n()}-${a}`,
626
+ cb: () => `.${n()}-${e}`,
627
+ cbe: (a) => `.${n()}-${e}__${a}`,
628
+ cbm: (a) => `.${n()}-${e}--${a}`,
629
+ cbem: (a, i) => `.${n()}-${e}__${a}--${i}`,
630
+ cbs: (a) => `.${n()}-${e}-${a}`,
631
+ cns: (a) => `.${n()}-${a}`,
632
+ cv: (a) => ge(`${n()}-${e}-${a}`),
633
+ cvm: (a, i = {}) => {
634
+ const f = n();
635
+ for (const p of Object.keys(a))
636
+ i[ge(`${f}-${e}-${p}`)] = a[p];
637
+ return i;
638
+ },
639
+ gcv: (a) => nr(`${n()}-${e}-${a}`),
640
+ scv: (a, i) => ar(`${n()}-${e}-${a}`, i),
641
+ nv: (a) => ge(`${n()}-${a}`),
642
+ nvm: (a, i = {}) => {
643
+ const f = n();
644
+ for (const p of Object.keys(a))
645
+ i[ge(`${f}-${p}`)] = a[p];
646
+ return i;
647
+ },
648
+ gnv: (a) => nr(`${n()}-${a}`),
649
+ snv: (a, i) => ar(`${n()}-${a}`, i)
650
+ };
651
+ }
652
+ function W(e) {
653
+ return K(() => Wr(e, "twist"), [e]);
654
+ }
655
+ function Ce(e, t) {
656
+ if (!t.current) return 0;
657
+ let n = (e.clientX - t.current.getBoundingClientRect().left) / t.current.clientWidth;
658
+ return n = Math.max(n, 0), n = Math.min(n, 1), n = Math.floor(n * 100) / 100, n;
659
+ }
660
+ function Ae(e, t) {
661
+ if (!t.current) return 0;
662
+ let n = 1 - (e.clientY - t.current.getBoundingClientRect().top) / t.current.clientHeight;
663
+ return n = Math.max(n, 0), n = Math.min(n, 1), n = Math.floor(n * 100) / 100, n;
664
+ }
665
+ var dr = {
666
+ color: void 0,
667
+ size: void 0,
668
+ className: void 0,
669
+ style: void 0,
670
+ attrs: void 0
671
+ }, Me = /* @__PURE__ */ ee.createContext(dr);
672
+ Me.Provider;
673
+ function ue(e) {
674
+ "@babel/helpers - typeof";
675
+ return ue = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
676
+ return typeof t;
677
+ } : function(t) {
678
+ return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
679
+ }, ue(e);
680
+ }
681
+ var Ur = ["attrs", "size", "title", "spin", "rotate", "color"];
682
+ function Yr(e, t) {
683
+ return Jr(e) || Kr(e, t) || vr(e, t) || Gr();
684
+ }
685
+ function Gr() {
686
+ throw new TypeError(`Invalid attempt to destructure non-iterable instance.
687
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
688
+ }
689
+ function Kr(e, t) {
690
+ var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
691
+ if (n != null) {
692
+ var a, i, f, p, y = [], s = !0, d = !1;
693
+ try {
694
+ if (f = (n = n.call(e)).next, t !== 0) for (; !(s = (a = f.call(n)).done) && (y.push(a.value), y.length !== t); s = !0) ;
695
+ } catch (b) {
696
+ d = !0, i = b;
697
+ } finally {
698
+ try {
699
+ if (!s && n.return != null && (p = n.return(), Object(p) !== p)) return;
700
+ } finally {
701
+ if (d) throw i;
702
+ }
703
+ }
704
+ return y;
705
+ }
706
+ }
707
+ function Jr(e) {
708
+ if (Array.isArray(e)) return e;
709
+ }
710
+ function Xr(e, t) {
711
+ var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
712
+ if (!n) {
713
+ if (Array.isArray(e) || (n = vr(e)) || t) {
714
+ n && (e = n);
715
+ var a = 0, i = function() {
716
+ };
717
+ return { s: i, n: function() {
718
+ return a >= e.length ? { done: !0 } : { done: !1, value: e[a++] };
719
+ }, e: function(d) {
720
+ throw d;
721
+ }, f: i };
722
+ }
723
+ throw new TypeError(`Invalid attempt to iterate non-iterable instance.
724
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
725
+ }
726
+ var f, p = !0, y = !1;
727
+ return { s: function() {
728
+ n = n.call(e);
729
+ }, n: function() {
730
+ var d = n.next();
731
+ return p = d.done, d;
732
+ }, e: function(d) {
733
+ y = !0, f = d;
734
+ }, f: function() {
735
+ try {
736
+ p || n.return == null || n.return();
737
+ } finally {
738
+ if (y) throw f;
739
+ }
740
+ } };
741
+ }
742
+ function vr(e, t) {
743
+ if (e) {
744
+ if (typeof e == "string") return ir(e, t);
745
+ var n = {}.toString.call(e).slice(8, -1);
746
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ir(e, t) : void 0;
747
+ }
748
+ }
749
+ function ir(e, t) {
750
+ (t == null || t > e.length) && (t = e.length);
751
+ for (var n = 0, a = Array(t); n < t; n++) a[n] = e[n];
752
+ return a;
753
+ }
754
+ function xe() {
755
+ return xe = Object.assign ? Object.assign.bind() : function(e) {
756
+ for (var t = 1; t < arguments.length; t++) {
757
+ var n = arguments[t];
758
+ for (var a in n) ({}).hasOwnProperty.call(n, a) && (e[a] = n[a]);
759
+ }
760
+ return e;
761
+ }, xe.apply(null, arguments);
762
+ }
763
+ function or(e, t) {
764
+ var n = Object.keys(e);
765
+ if (Object.getOwnPropertySymbols) {
766
+ var a = Object.getOwnPropertySymbols(e);
767
+ t && (a = a.filter(function(i) {
768
+ return Object.getOwnPropertyDescriptor(e, i).enumerable;
769
+ })), n.push.apply(n, a);
770
+ }
771
+ return n;
772
+ }
773
+ function se(e) {
774
+ for (var t = 1; t < arguments.length; t++) {
775
+ var n = arguments[t] != null ? arguments[t] : {};
776
+ t % 2 ? or(Object(n), !0).forEach(function(a) {
777
+ Qr(e, a, n[a]);
778
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : or(Object(n)).forEach(function(a) {
779
+ Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(n, a));
780
+ });
781
+ }
782
+ return e;
783
+ }
784
+ function Qr(e, t, n) {
785
+ return (t = Zr(t)) in e ? Object.defineProperty(e, t, { value: n, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = n, e;
786
+ }
787
+ function Zr(e) {
788
+ var t = et(e, "string");
789
+ return ue(t) == "symbol" ? t : t + "";
790
+ }
791
+ function et(e, t) {
792
+ if (ue(e) != "object" || !e) return e;
793
+ var n = e[Symbol.toPrimitive];
794
+ if (n !== void 0) {
795
+ var a = n.call(e, t);
796
+ if (ue(a) != "object") return a;
797
+ throw new TypeError("@@toPrimitive must return a primitive value.");
798
+ }
799
+ return (t === "string" ? String : Number)(e);
800
+ }
801
+ function rt(e, t) {
802
+ if (e == null) return {};
803
+ var n, a, i = tt(e, t);
804
+ if (Object.getOwnPropertySymbols) {
805
+ var f = Object.getOwnPropertySymbols(e);
806
+ for (a = 0; a < f.length; a++) n = f[a], t.includes(n) || {}.propertyIsEnumerable.call(e, n) && (i[n] = e[n]);
807
+ }
808
+ return i;
809
+ }
810
+ function tt(e, t) {
811
+ if (e == null) return {};
812
+ var n = {};
813
+ for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
814
+ if (t.includes(a)) continue;
815
+ n[a] = e[a];
816
+ }
817
+ return n;
818
+ }
819
+ function nt(e) {
820
+ var t = e.attrs, n = e.size, a = e.title, i = e.spin, f = e.rotate, p = e.color, y = rt(e, Ur), s = function(b) {
821
+ var l = n || b.size || "1em", c, E = "", S = "";
822
+ return b.className && (c = b.className), e.className && (c = c ? "".concat(c, " ").concat(e.className) : e.className), i && (c ? c += " twist-icon-loading" : c = "twist-icon-loading"), f && (E = "rotate(".concat(f, "deg)"), S = "rotate(".concat(f, "deg)")), /* @__PURE__ */ ee.createElement("svg", xe({
823
+ xmlns: "http://www.w3.org/2000/svg"
824
+ }, b.attrs, t, y, {
825
+ className: c,
826
+ style: se(se({
827
+ color: p || b.color,
828
+ msTransform: E,
829
+ transform: S
830
+ }, b.style), e.style),
831
+ width: l,
832
+ height: l
833
+ }), a && /* @__PURE__ */ ee.createElement("title", null, a), e.children);
834
+ };
835
+ return Me !== void 0 ? /* @__PURE__ */ ee.createElement(Me.Consumer, null, function(d) {
836
+ return s(d);
837
+ }) : s(dr);
838
+ }
839
+ function at(e) {
840
+ var t = {}, n = e.split(";"), a = Xr(n), i;
841
+ try {
842
+ for (a.s(); !(i = a.n()).done; ) {
843
+ var f = i.value, p = f.split(":"), y = Yr(p, 2), s = y[0], d = y[1];
844
+ if (s && d) {
845
+ var b = s.trim().replace(/-./g, function(l) {
846
+ return l.charAt(1).toUpperCase();
847
+ });
848
+ t[b] = d.trim();
849
+ }
850
+ }
851
+ } catch (l) {
852
+ a.e(l);
853
+ } finally {
854
+ a.f();
855
+ }
856
+ return t;
857
+ }
858
+ function mr(e) {
859
+ return e && e.map(function(t, n) {
860
+ return /* @__PURE__ */ ee.createElement(t.tag, se(se({}, t.attrs), {}, {
861
+ key: n,
862
+ style: t.attrs.style ? at(t.attrs.style) : null
863
+ }), mr(t.children));
864
+ });
865
+ }
866
+ function N(e) {
867
+ return function(t) {
868
+ return /* @__PURE__ */ ee.createElement(nt, xe({
869
+ attrs: se({}, e.attrs)
870
+ }, t), mr(e.children));
871
+ };
872
+ }
873
+ function it(e) {
874
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12 2.25c-5.384 0-9.75 4.366-9.75 9.75s4.366 9.75 9.75 9.75v-2.437A7.312 7.312 0 1 1 19.313 12h2.437c0-5.384-4.366-9.75-9.75-9.75" } }] })(e);
875
+ }
876
+ function ot(e) {
877
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M18.25 12L8.5 17.629V6.37z" } }] })(e);
878
+ }
879
+ function hr(e) {
880
+ var t, n, a = "";
881
+ if (typeof e == "string" || typeof e == "number") a += e;
882
+ else if (typeof e == "object") if (Array.isArray(e)) {
883
+ var i = e.length;
884
+ for (t = 0; t < i; t++) e[t] && (n = hr(e[t])) && (a && (a += " "), a += n);
885
+ } else for (n in e) e[n] && (a && (a += " "), a += n);
886
+ return a;
887
+ }
888
+ function P() {
889
+ for (var e, t, n = 0, a = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = hr(e)) && (a && (a += " "), a += t);
890
+ return a;
891
+ }
892
+ function ut({
893
+ bufferedPercentage: e,
894
+ playedPercentage: t,
895
+ onSeek: n
896
+ }) {
897
+ const a = W("aplayer-bar"), i = W("aplayer-icon"), f = F(null), [p, y] = H(t), s = F(!1);
898
+ I(() => {
899
+ s.current || y(t);
900
+ }, [t]);
901
+ const d = L(
902
+ (b) => {
903
+ s.current = !0;
904
+ const l = Ce(b, f);
905
+ y(l);
906
+ const c = (S) => {
907
+ const o = Ce(S, f);
908
+ y(o);
909
+ }, E = (S) => {
910
+ document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", E);
911
+ const o = Ce(S, f);
912
+ y(o), n == null || n(o), s.current = !1;
913
+ };
914
+ document.addEventListener("mousemove", c), document.addEventListener("mouseup", E);
915
+ },
916
+ [n]
917
+ );
918
+ return /* @__PURE__ */ v.jsx(
919
+ "div",
920
+ {
921
+ ref: f,
922
+ className: P(a.b(), a.bs("vars")),
923
+ onMouseDown: d,
924
+ children: /* @__PURE__ */ v.jsxs("div", { className: a.be("inner"), children: [
925
+ typeof e < "u" ? /* @__PURE__ */ v.jsx(
926
+ "div",
927
+ {
928
+ className: a.be("loaded"),
929
+ style: { width: `${e * 100}%` }
930
+ }
931
+ ) : null,
932
+ typeof p < "u" ? /* @__PURE__ */ v.jsx(
933
+ "div",
934
+ {
935
+ className: a.be("played"),
936
+ style: {
937
+ width: `${p * 100}%`
938
+ },
939
+ children: /* @__PURE__ */ v.jsx(
940
+ "span",
941
+ {
942
+ className: a.be("thumb"),
943
+ children: /* @__PURE__ */ v.jsx("span", { className: P(i.bs("loading")), children: /* @__PURE__ */ v.jsx(it, {}) })
944
+ }
945
+ )
946
+ }
947
+ ) : null
948
+ ] })
949
+ }
950
+ );
951
+ }
952
+ function st(e) {
953
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M16.15 13H5q-.425 0-.712-.288T4 12t.288-.712T5 11h11.15L13.3 8.15q-.3-.3-.288-.7t.288-.7q.3-.3.713-.312t.712.287L19.3 11.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-4.575 4.575q-.3.3-.712.288t-.713-.313q-.275-.3-.288-.7t.288-.7z" } }] })(e);
954
+ }
955
+ function ct(e) {
956
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M10.5 17q1.05 0 1.775-.725T13 14.5V9h3V7h-4v5.5q-.325-.225-.7-.363T10.5 12q-1.05 0-1.775.725T8 14.5t.725 1.775T10.5 17M4 20q-.825 0-1.412-.587T2 18V6q0-.825.588-1.412T4 4h16q.825 0 1.413.588T22 6v12q0 .825-.587 1.413T20 20z" } }] })(e);
957
+ }
958
+ function lt(e) {
959
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14 19V5h4v14zm-8 0V5h4v14z" } }] })(e);
960
+ }
961
+ function ft(e) {
962
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712" } }] })(e);
963
+ }
964
+ function dt(e) {
965
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M11.5 10.5h-.75q-.325 0-.537-.213T10 9.75t.213-.537T10.75 9H12q.425 0 .713.288T13 10v4.25q0 .325-.213.538T12.25 15t-.537-.213t-.213-.537zM6.85 19l.85.85q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L3.7 18.7q-.15-.15-.213-.325T3.426 18t.063-.375t.212-.325l2.575-2.575q.3-.3.713-.287t.712.312q.275.3.288.7t-.288.7l-.85.85H17v-3q0-.425.288-.712T18 13t.713.288T19 14v3q0 .825-.587 1.413T17 19zm10.3-12H7v3q0 .425-.288.713T6 11t-.712-.288T5 10V7q0-.825.588-1.412T7 5h10.15l-.85-.85q-.3-.3-.288-.7t.288-.7q.3-.3.712-.312t.713.287L20.3 5.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-2.575 2.575q-.3.3-.712.288T16.3 9.25q-.275-.3-.288-.7t.288-.7z" } }] })(e);
966
+ }
967
+ function vt(e) {
968
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "m6.85 19l.85.85q.3.3.288.7t-.288.7q-.3.3-.712.313t-.713-.288L3.7 18.7q-.15-.15-.213-.325T3.426 18t.063-.375t.212-.325l2.575-2.575q.3-.3.713-.287t.712.312q.275.3.288.7t-.288.7l-.85.85H17v-3q0-.425.288-.712T18 13t.713.288T19 14v3q0 .825-.587 1.413T17 19zm10.3-12H7v3q0 .425-.288.713T6 11t-.712-.288T5 10V7q0-.825.588-1.412T7 5h10.15l-.85-.85q-.3-.3-.288-.7t.288-.7q.3-.3.712-.312t.713.287L20.3 5.3q.15.15.213.325t.062.375t-.062.375t-.213.325l-2.575 2.575q-.3.3-.712.288T16.3 9.25q-.275-.3-.288-.7t.288-.7z" } }] })(e);
969
+ }
970
+ function mt(e) {
971
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M9 15H6q-.425 0-.712-.288T5 14v-4q0-.425.288-.712T6 9h3l3.3-3.3q.475-.475 1.088-.213t.612.938v11.15q0 .675-.612.938T12.3 18.3zm9.5-3q0 1.05-.475 1.988t-1.25 1.537q-.25.15-.512.013T16 15.1V8.85q0-.3.263-.437t.512.012q.775.625 1.25 1.575t.475 2" } }] })(e);
972
+ }
973
+ function ht(e) {
974
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7 15V9h4l5-5v16l-5-5z" } }] })(e);
975
+ }
976
+ function pt(e) {
977
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M19 11.975q0-2.075-1.1-3.787t-2.95-2.563q-.375-.175-.55-.537t-.05-.738q.15-.4.538-.575t.787 0Q18.1 4.85 19.55 7.063T21 11.974t-1.45 4.913t-3.875 3.287q-.4.175-.788 0t-.537-.575q-.125-.375.05-.737t.55-.538q1.85-.85 2.95-2.562t1.1-3.788M7 15H4q-.425 0-.712-.288T3 14v-4q0-.425.288-.712T4 9h3l3.3-3.3q.475-.475 1.088-.213t.612.938v11.15q0 .675-.612.938T10.3 18.3zm9.5-3q0 1.05-.475 1.988t-1.25 1.537q-.25.15-.513.013T14 15.1V8.85q0-.3.263-.437t.512.012q.775.625 1.25 1.575t.475 2" } }] })(e);
978
+ }
979
+ function yt({
980
+ volume: e,
981
+ muted: t,
982
+ onToggleMuted: n,
983
+ onChangeVolume: a
984
+ }) {
985
+ const i = W("aplayer-volumn"), f = W("aplayer-icon"), p = F(null), [y, s] = H(!1), d = L(
986
+ (b) => {
987
+ a(Ae(b, p)), s(!0);
988
+ const l = (E) => {
989
+ a(Ae(E, p));
990
+ }, c = (E) => {
991
+ document.removeEventListener("mouseup", c), document.removeEventListener("mousemove", l), s(!1), a(Ae(E, p));
992
+ };
993
+ document.addEventListener("mousemove", l), document.addEventListener("mouseup", c);
994
+ },
995
+ [a]
996
+ );
997
+ return /* @__PURE__ */ v.jsxs("div", { className: P(i.b(), i.bs("vars")), children: [
998
+ /* @__PURE__ */ v.jsx(
999
+ "button",
1000
+ {
1001
+ type: "button",
1002
+ className: P(f.b(), f.bs("volume-down")),
1003
+ onClick: () => n(),
1004
+ children: t || !e ? /* @__PURE__ */ v.jsx(ht, {}) : e >= 1 ? /* @__PURE__ */ v.jsx(pt, {}) : /* @__PURE__ */ v.jsx(mt, {})
1005
+ }
1006
+ ),
1007
+ /* @__PURE__ */ v.jsx(
1008
+ "div",
1009
+ {
1010
+ className: P(i.be("bar-wrap"), {
1011
+ [i.bem("bar-wrap", "active")]: y
1012
+ }),
1013
+ ref: p,
1014
+ onMouseDown: d,
1015
+ children: /* @__PURE__ */ v.jsx("div", { className: i.be("bar"), children: /* @__PURE__ */ v.jsx(
1016
+ "div",
1017
+ {
1018
+ className: i.be("thumb"),
1019
+ style: {
1020
+ height: t ? 0 : `${e * 100}%`
1021
+ }
1022
+ }
1023
+ ) })
1024
+ }
1025
+ )
1026
+ ] });
1027
+ }
1028
+ function ur(e) {
1029
+ if (typeof e > "u")
1030
+ return "--:--";
1031
+ if (Number.isNaN(e))
1032
+ return "00:00";
1033
+ const t = (p) => p < 10 ? `0${p}` : `${p}`, n = Math.trunc(e / 60), a = Math.trunc(e - n * 60), i = Math.trunc(n / 60), f = Math.trunc(
1034
+ e / 60 - 60 * Math.trunc(e / 60 / 60)
1035
+ );
1036
+ return e >= 3600 ? `${t(i)}:${t(f)}:${t(a)}` : `${t(n)}:${t(a)}`;
1037
+ }
1038
+ function bt(e) {
1039
+ return N({ attrs: { viewBox: "0 0 1024 1024" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M485.6 249.9L198.2 498c-8.3 7.1-8.3 20.8 0 27.9l287.4 248.2c10.7 9.2 26.4.9 26.4-14V263.8c0-14.8-15.7-23.2-26.4-13.9m320 0L518.2 498a18.6 18.6 0 0 0-6.2 14c0 5.2 2.1 10.4 6.2 14l287.4 248.2c10.7 9.2 26.4.9 26.4-14V263.8c0-14.8-15.7-23.2-26.4-13.9" } }] })(e);
1040
+ }
1041
+ function gt(e) {
1042
+ return N({ attrs: { viewBox: "0 0 1024 1024" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M825.8 498L538.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L825.8 526c8.3-7.2 8.3-20.8 0-28m-320 0L218.4 249.9c-10.7-9.2-26.4-.9-26.4 14v496.3c0 14.9 15.7 23.2 26.4 14L505.8 526c4.1-3.6 6.2-8.8 6.2-14s-2.1-10.4-6.2-14" } }] })(e);
1043
+ }
1044
+ function Et(e) {
1045
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z" } }] })(e);
1046
+ }
1047
+ function xt(e) {
1048
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M2 5.27L3.28 4L20 20.72L18.73 22l-3-3H7v3l-4-4l4-4v3h6.73L7 10.27V11H5V8.27zM17 13h2v4.18l-2-2zm0-8V2l4 4l-4 4V7H8.82l-2-2z" } }] })(e);
1049
+ }
1050
+ function _t(e) {
1051
+ return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "m17 3l5.25 4.5L17 12l5.25 4.5L17 21v-3h-2.74l-2.82-2.82l2.12-2.12L15.5 15H17V9h-1.5l-9 9H2v-3h3.26l9-9H17zM2 6h4.5l2.82 2.82l-2.12 2.12L5.26 9H2z" } }] })(e);
1052
+ }
1053
+ function St({
1054
+ volume: e,
1055
+ onChangeVolume: t,
1056
+ muted: n,
1057
+ currentTime: a,
1058
+ audioDurationSeconds: i,
1059
+ bufferedSeconds: f,
1060
+ onToggleMenu: p,
1061
+ onToggleMuted: y,
1062
+ order: s,
1063
+ onOrderChange: d,
1064
+ loop: b,
1065
+ onLoopChange: l,
1066
+ onSeek: c,
1067
+ isPlaying: E,
1068
+ onTogglePlay: S,
1069
+ onSkipForward: o,
1070
+ onSkipBack: h,
1071
+ showLyrics: g = !0,
1072
+ onToggleLyrics: x
1073
+ }) {
1074
+ const q = W("aplayer-controller"), C = W("aplayer-icon"), re = L(() => {
1075
+ const B = {
1076
+ list: "random",
1077
+ random: "list"
1078
+ }[s];
1079
+ d(B);
1080
+ }, [s, d]), U = L(() => {
1081
+ const B = {
1082
+ all: "one",
1083
+ one: "none",
1084
+ none: "all"
1085
+ }[b];
1086
+ l(B);
1087
+ }, [b, l]);
1088
+ return /* @__PURE__ */ v.jsxs("div", { className: P(q.b(), q.bs("vars")), children: [
1089
+ /* @__PURE__ */ v.jsx(
1090
+ ut,
1091
+ {
1092
+ playedPercentage: typeof a > "u" || typeof i > "u" ? void 0 : a / i,
1093
+ bufferedPercentage: typeof f > "u" || typeof i > "u" ? void 0 : f / i,
1094
+ onSeek: (B) => c == null ? void 0 : c(B * i)
1095
+ }
1096
+ ),
1097
+ /* @__PURE__ */ v.jsxs("div", { className: q.be("time"), children: [
1098
+ /* @__PURE__ */ v.jsxs("span", { className: q.be("time-inner"), children: [
1099
+ /* @__PURE__ */ v.jsx("span", { className: q.be("ptime"), children: ur(a) }),
1100
+ " / ",
1101
+ /* @__PURE__ */ v.jsx("span", { className: q.be("dtime"), children: ur(i) })
1102
+ ] }),
1103
+ /* @__PURE__ */ v.jsx("span", { className: P(C.b(), C.bs("back")), onClick: h, children: /* @__PURE__ */ v.jsx(bt, {}) }),
1104
+ /* @__PURE__ */ v.jsx("span", { className: P(C.b(), C.bs("play")), onClick: S, children: E ? /* @__PURE__ */ v.jsx(lt, {}) : /* @__PURE__ */ v.jsx(ft, {}) }),
1105
+ /* @__PURE__ */ v.jsx(
1106
+ "span",
1107
+ {
1108
+ className: P(C.b(), C.bs("forward")),
1109
+ onClick: o,
1110
+ children: /* @__PURE__ */ v.jsx(gt, {})
1111
+ }
1112
+ ),
1113
+ /* @__PURE__ */ v.jsx(
1114
+ yt,
1115
+ {
1116
+ volume: e,
1117
+ muted: n,
1118
+ onToggleMuted: y,
1119
+ onChangeVolume: t
1120
+ }
1121
+ ),
1122
+ /* @__PURE__ */ v.jsx(
1123
+ "button",
1124
+ {
1125
+ className: P(C.b(), C.bs("order")),
1126
+ onClick: re,
1127
+ type: "button",
1128
+ children: { list: /* @__PURE__ */ v.jsx(st, {}), random: /* @__PURE__ */ v.jsx(_t, {}) }[s]
1129
+ }
1130
+ ),
1131
+ /* @__PURE__ */ v.jsx(
1132
+ "button",
1133
+ {
1134
+ className: P(C.b(), C.bs("order")),
1135
+ onClick: U,
1136
+ type: "button",
1137
+ children: {
1138
+ all: /* @__PURE__ */ v.jsx(vt, {}),
1139
+ one: /* @__PURE__ */ v.jsx(dt, {}),
1140
+ none: /* @__PURE__ */ v.jsx(xt, {})
1141
+ }[b]
1142
+ }
1143
+ ),
1144
+ /* @__PURE__ */ v.jsx(
1145
+ "button",
1146
+ {
1147
+ type: "button",
1148
+ className: P(C.b(), C.bs("menu")),
1149
+ onClick: () => p == null ? void 0 : p(),
1150
+ children: /* @__PURE__ */ v.jsx(Et, {})
1151
+ }
1152
+ ),
1153
+ /* @__PURE__ */ v.jsx(
1154
+ "button",
1155
+ {
1156
+ type: "button",
1157
+ className: P(C.b(), C.bs("lrc"), {
1158
+ [C.ns("lrc-inactivity")]: !g
1159
+ }),
1160
+ onClick: x,
1161
+ children: /* @__PURE__ */ v.jsx(ct, {})
1162
+ }
1163
+ )
1164
+ ] })
1165
+ ] });
1166
+ }
1167
+ function Tt({
1168
+ open: e,
1169
+ audio: t,
1170
+ playingAudioUrl: n,
1171
+ onPlayAudio: a,
1172
+ listMaxHeight: i
1173
+ }) {
1174
+ const f = W("aplayer-list"), p = i ? { maxHeight: i } : void 0, y = L((d) => d ? typeof d == "string" ? d : d.name ?? "Audio artist" : "Audio artist", []), s = F(null);
1175
+ return I(() => {
1176
+ if (s.current) {
1177
+ const d = s.current;
1178
+ return d.style.maxHeight = `${Math.min(
1179
+ d.scrollHeight,
1180
+ i ?? 1 / 0
1181
+ )}px`, () => {
1182
+ d.removeAttribute("style");
1183
+ };
1184
+ }
1185
+ }, [i]), /* @__PURE__ */ v.jsx(
1186
+ "div",
1187
+ {
1188
+ ref: s,
1189
+ className: P(f.b(), {
1190
+ [f.bm("hide")]: !e
1191
+ }),
1192
+ children: /* @__PURE__ */ v.jsx("ol", { style: p, children: t.map((d, b) => /* @__PURE__ */ v.jsxs(
1193
+ "li",
1194
+ {
1195
+ className: P({
1196
+ [f.bm("active")]: d.url === n
1197
+ }),
1198
+ onClick: () => {
1199
+ d.url !== n && (a == null || a(d));
1200
+ },
1201
+ children: [
1202
+ /* @__PURE__ */ v.jsx("span", { className: f.be("cur") }),
1203
+ /* @__PURE__ */ v.jsx("span", { className: f.be("index"), children: b + 1 }),
1204
+ /* @__PURE__ */ v.jsx("span", { className: f.be("title"), children: d.name ?? "Audio name" }),
1205
+ /* @__PURE__ */ v.jsx("span", { className: f.be("author"), children: y(d.artist) })
1206
+ ]
1207
+ },
1208
+ d.name || b
1209
+ )) })
1210
+ }
1211
+ );
1212
+ }
1213
+ function sr({ show: e, lrcText: t, currentTime: n }) {
1214
+ const a = W("aplayer-lrc"), i = K(() => wt(t), [t]), f = K(() => {
1215
+ for (let y = 0; y < i.length; y++) {
1216
+ const s = i[y], d = i[y + 1];
1217
+ if (n >= s[0] && (!d || n < d[0]))
1218
+ return y;
1219
+ }
1220
+ return 0;
1221
+ }, [n, i]), p = K(() => ({
1222
+ transform: `translateY(${-f * 16}px)`,
1223
+ WebkitTransform: `translateY(${-f * 16}px)`
1224
+ }), [f]);
1225
+ return /* @__PURE__ */ v.jsx(
1226
+ "div",
1227
+ {
1228
+ className: P(a.b(), {
1229
+ [a.bm("hide")]: !e
1230
+ }),
1231
+ children: t ? /* @__PURE__ */ v.jsx("div", { className: a.be("contents"), style: p, children: i.map(([, y], s) => /* @__PURE__ */ v.jsx(
1232
+ "p",
1233
+ {
1234
+ className: P({
1235
+ [a.be("current")]: s === f
1236
+ }),
1237
+ children: y
1238
+ },
1239
+ s
1240
+ )) }) : null
1241
+ }
1242
+ );
1243
+ }
1244
+ function wt(e) {
1245
+ if (e) {
1246
+ e = e.replace(/([^\]^\n])\[/g, (i, f) => `${f}
1247
+ [`);
1248
+ const t = e.split(`
1249
+ `), n = [], a = t.length;
1250
+ for (let i = 0; i < a; i++) {
1251
+ const f = t[i].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/g), p = t[i].replace(/.*\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/g, "").replace(/<(\d{2}):(\d{2})(\.(\d{2,3}))?>/g, "").replace(/^\s+|\s+$/g, "");
1252
+ if (f) {
1253
+ const y = f.length;
1254
+ for (let s = 0; s < y; s++) {
1255
+ const d = /\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/.exec(f[s]), b = d[1] * 60, l = Number.parseInt(d[2]), c = d[4] ? Number.parseInt(d[4]) / (`${d[4]}`.length === 2 ? 100 : 1e3) : 0, E = b + l + c;
1256
+ n.push([E, p]);
1257
+ }
1258
+ }
1259
+ }
1260
+ return n.sort((i, f) => i[0] - f[0]), n;
1261
+ } else
1262
+ return [];
1263
+ }
1264
+ var Ee = { exports: {} }, Ne = {};
1265
+ /**
1266
+ * @license React
1267
+ * use-sync-external-store-shim.production.js
1268
+ *
1269
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1270
+ *
1271
+ * This source code is licensed under the MIT license found in the
1272
+ * LICENSE file in the root directory of this source tree.
1273
+ */
1274
+ var cr;
1275
+ function jt() {
1276
+ if (cr) return Ne;
1277
+ cr = 1;
1278
+ var e = _e;
1279
+ function t(l, c) {
1280
+ return l === c && (l !== 0 || 1 / l === 1 / c) || l !== l && c !== c;
1281
+ }
1282
+ var n = typeof Object.is == "function" ? Object.is : t, a = e.useState, i = e.useEffect, f = e.useLayoutEffect, p = e.useDebugValue;
1283
+ function y(l, c) {
1284
+ var E = c(), S = a({ inst: { value: E, getSnapshot: c } }), o = S[0].inst, h = S[1];
1285
+ return f(
1286
+ function() {
1287
+ o.value = E, o.getSnapshot = c, s(o) && h({ inst: o });
1288
+ },
1289
+ [l, E, c]
1290
+ ), i(
1291
+ function() {
1292
+ return s(o) && h({ inst: o }), l(function() {
1293
+ s(o) && h({ inst: o });
1294
+ });
1295
+ },
1296
+ [l]
1297
+ ), p(E), E;
1298
+ }
1299
+ function s(l) {
1300
+ var c = l.getSnapshot;
1301
+ l = l.value;
1302
+ try {
1303
+ var E = c();
1304
+ return !n(l, E);
1305
+ } catch {
1306
+ return !0;
1307
+ }
1308
+ }
1309
+ function d(l, c) {
1310
+ return c();
1311
+ }
1312
+ var b = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? d : y;
1313
+ return Ne.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : b, Ne;
1314
+ }
1315
+ var qe = {};
1316
+ /**
1317
+ * @license React
1318
+ * use-sync-external-store-shim.development.js
1319
+ *
1320
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
1321
+ *
1322
+ * This source code is licensed under the MIT license found in the
1323
+ * LICENSE file in the root directory of this source tree.
1324
+ */
1325
+ var lr;
1326
+ function Ot() {
1327
+ return lr || (lr = 1, process.env.NODE_ENV !== "production" && function() {
1328
+ function e(E, S) {
1329
+ return E === S && (E !== 0 || 1 / E === 1 / S) || E !== E && S !== S;
1330
+ }
1331
+ function t(E, S) {
1332
+ b || i.startTransition === void 0 || (b = !0, console.error(
1333
+ "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
1334
+ ));
1335
+ var o = S();
1336
+ if (!l) {
1337
+ var h = S();
1338
+ f(o, h) || (console.error(
1339
+ "The result of getSnapshot should be cached to avoid an infinite loop"
1340
+ ), l = !0);
1341
+ }
1342
+ h = p({
1343
+ inst: { value: o, getSnapshot: S }
1344
+ });
1345
+ var g = h[0].inst, x = h[1];
1346
+ return s(
1347
+ function() {
1348
+ g.value = o, g.getSnapshot = S, n(g) && x({ inst: g });
1349
+ },
1350
+ [E, o, S]
1351
+ ), y(
1352
+ function() {
1353
+ return n(g) && x({ inst: g }), E(function() {
1354
+ n(g) && x({ inst: g });
1355
+ });
1356
+ },
1357
+ [E]
1358
+ ), d(o), o;
1359
+ }
1360
+ function n(E) {
1361
+ var S = E.getSnapshot;
1362
+ E = E.value;
1363
+ try {
1364
+ var o = S();
1365
+ return !f(E, o);
1366
+ } catch {
1367
+ return !0;
1368
+ }
1369
+ }
1370
+ function a(E, S) {
1371
+ return S();
1372
+ }
1373
+ typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
1374
+ var i = _e, f = typeof Object.is == "function" ? Object.is : e, p = i.useState, y = i.useEffect, s = i.useLayoutEffect, d = i.useDebugValue, b = !1, l = !1, c = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? a : t;
1375
+ qe.useSyncExternalStore = i.useSyncExternalStore !== void 0 ? i.useSyncExternalStore : c, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
1376
+ }()), qe;
1377
+ }
1378
+ var fr;
1379
+ function Rt() {
1380
+ return fr || (fr = 1, process.env.NODE_ENV === "production" ? Ee.exports = jt() : Ee.exports = Ot()), Ee.exports;
1381
+ }
1382
+ var G = Rt();
1383
+ const Z = [];
1384
+ function Lt(e) {
1385
+ const t = F();
1386
+ if (typeof document < "u" && !t.current) {
1387
+ const n = t.current = document.createElement("audio");
1388
+ typeof (e == null ? void 0 : e.src) < "u" && (n.src = e.src), typeof (e == null ? void 0 : e.autoPlay) < "u" && (n.autoplay = e.autoPlay), typeof (e == null ? void 0 : e.initialVolume) < "u" && (n.volume = e.initialVolume), Z.includes(n) || Z.push(n);
1389
+ }
1390
+ return I(() => {
1391
+ const n = t.current;
1392
+ if (n && (e != null && e.onError))
1393
+ return n.addEventListener("error", e.onError), () => {
1394
+ n.removeEventListener("error", e.onError);
1395
+ };
1396
+ }, [e == null ? void 0 : e.onError]), I(() => {
1397
+ const n = t.current;
1398
+ if (n && (e != null && e.onEnded))
1399
+ return n.addEventListener("ended", e.onEnded), () => {
1400
+ n.removeEventListener("ended", e.onEnded);
1401
+ };
1402
+ }, [e == null ? void 0 : e.onEnded]), I(() => () => {
1403
+ const n = t.current;
1404
+ if (n) {
1405
+ n.pause(), n.currentTime = 0;
1406
+ const a = Z.indexOf(n);
1407
+ a !== -1 && Z.splice(a, 1);
1408
+ }
1409
+ t.current = void 0;
1410
+ }, []), t;
1411
+ }
1412
+ function Pt(e) {
1413
+ const t = Lt(e), n = L((o) => {
1414
+ for (let h = 0; h < Z.length; h++) {
1415
+ const g = Z[h];
1416
+ g !== o && !g.paused && g.pause();
1417
+ }
1418
+ }, []), a = L(
1419
+ async (o) => {
1420
+ var g;
1421
+ const h = t.current;
1422
+ if (h) {
1423
+ e.mutex && n(h), h.src !== o && (h.pause(), h.currentTime = 0, h.src = o);
1424
+ try {
1425
+ await ((g = t.current) == null ? void 0 : g.play());
1426
+ } catch {
1427
+ }
1428
+ }
1429
+ },
1430
+ [t, e.mutex, n]
1431
+ ), i = L(
1432
+ (o) => {
1433
+ const h = t.current;
1434
+ h && (h.paused ? a(o) : h.pause());
1435
+ },
1436
+ [t, a]
1437
+ ), f = L(
1438
+ (o) => {
1439
+ t.current.currentTime = o;
1440
+ },
1441
+ [t]
1442
+ ), p = L(() => {
1443
+ t.current && (t.current.muted = !t.current.muted);
1444
+ }, [t]), y = L(
1445
+ (o) => {
1446
+ t.current && (t.current.volume = o);
1447
+ },
1448
+ [t]
1449
+ ), s = G.useSyncExternalStore(
1450
+ L(
1451
+ (o) => {
1452
+ var h;
1453
+ return (h = t.current) == null || h.addEventListener(
1454
+ "volumechange",
1455
+ o
1456
+ ), () => {
1457
+ var g;
1458
+ (g = t.current) == null || g.removeEventListener(
1459
+ "volumechange",
1460
+ o
1461
+ );
1462
+ };
1463
+ },
1464
+ [t]
1465
+ ),
1466
+ () => {
1467
+ var o;
1468
+ return (o = t.current) == null ? void 0 : o.volume;
1469
+ },
1470
+ () => {
1471
+ }
1472
+ ), d = G.useSyncExternalStore(
1473
+ L(
1474
+ (o) => {
1475
+ var h;
1476
+ return (h = t.current) == null || h.addEventListener(
1477
+ "volumechange",
1478
+ o
1479
+ ), () => {
1480
+ var g;
1481
+ (g = t.current) == null || g.removeEventListener(
1482
+ "volumechange",
1483
+ o
1484
+ );
1485
+ };
1486
+ },
1487
+ [t]
1488
+ ),
1489
+ () => {
1490
+ var o;
1491
+ return (o = t.current) == null ? void 0 : o.muted;
1492
+ },
1493
+ () => {
1494
+ }
1495
+ ), b = G.useSyncExternalStore(
1496
+ L(
1497
+ (o) => {
1498
+ var h;
1499
+ return (h = t.current) == null || h.addEventListener("timeupdate", o), () => {
1500
+ var g;
1501
+ (g = t.current) == null || g.removeEventListener(
1502
+ "timeupdate",
1503
+ o
1504
+ );
1505
+ };
1506
+ },
1507
+ [t]
1508
+ ),
1509
+ () => {
1510
+ if (t.current)
1511
+ return Math.round(t.current.currentTime);
1512
+ },
1513
+ () => {
1514
+ }
1515
+ ), l = G.useSyncExternalStore(
1516
+ L(
1517
+ (o) => {
1518
+ var h;
1519
+ return (h = t.current) == null || h.addEventListener(
1520
+ "durationchange",
1521
+ o
1522
+ ), () => {
1523
+ var g;
1524
+ (g = t.current) == null || g.removeEventListener(
1525
+ "durationchange",
1526
+ o
1527
+ );
1528
+ };
1529
+ },
1530
+ [t]
1531
+ ),
1532
+ () => {
1533
+ var o;
1534
+ return (o = t.current) == null ? void 0 : o.duration;
1535
+ },
1536
+ () => {
1537
+ }
1538
+ ), c = G.useSyncExternalStore(
1539
+ L(
1540
+ (o) => {
1541
+ var h;
1542
+ return (h = t.current) == null || h.addEventListener("progress", o), () => {
1543
+ var g;
1544
+ (g = t.current) == null || g.removeEventListener(
1545
+ "progress",
1546
+ o
1547
+ );
1548
+ };
1549
+ },
1550
+ [t]
1551
+ ),
1552
+ () => {
1553
+ const o = t.current;
1554
+ return o && o.buffered.length > 0 ? o.buffered.end(o.buffered.length - 1) : 0;
1555
+ },
1556
+ () => {
1557
+ }
1558
+ ), E = G.useSyncExternalStore(
1559
+ L(
1560
+ (o) => {
1561
+ var h, g;
1562
+ return (h = t.current) == null || h.addEventListener("play", o), (g = t.current) == null || g.addEventListener("pause", o), () => {
1563
+ var x, q;
1564
+ (x = t.current) == null || x.removeEventListener("play", o), (q = t.current) == null || q.removeEventListener("pause", o);
1565
+ };
1566
+ },
1567
+ [t]
1568
+ ),
1569
+ () => {
1570
+ const o = t.current;
1571
+ return o ? !o.paused : !1;
1572
+ },
1573
+ () => {
1574
+ }
1575
+ ), S = G.useSyncExternalStore(
1576
+ L(
1577
+ (o) => {
1578
+ var h, g;
1579
+ return (h = t.current) == null || h.addEventListener("playing", o), (g = t.current) == null || g.addEventListener("waiting", o), () => {
1580
+ var x, q;
1581
+ (x = t.current) == null || x.removeEventListener(
1582
+ "playing",
1583
+ o
1584
+ ), (q = t.current) == null || q.removeEventListener(
1585
+ "waiting",
1586
+ o
1587
+ );
1588
+ };
1589
+ },
1590
+ [t]
1591
+ ),
1592
+ () => {
1593
+ const o = t.current;
1594
+ return o ? o.networkState === o.NETWORK_LOADING : !1;
1595
+ },
1596
+ () => {
1597
+ }
1598
+ );
1599
+ return {
1600
+ playAudio: a,
1601
+ togglePlay: i,
1602
+ seek: f,
1603
+ toggleMuted: p,
1604
+ setVolume: y,
1605
+ volume: s,
1606
+ muted: d,
1607
+ currentTime: b,
1608
+ duration: l,
1609
+ bufferedSeconds: c,
1610
+ isPlaying: E,
1611
+ isLoading: S
1612
+ };
1613
+ }
1614
+ function pr() {
1615
+ const e = F([]);
1616
+ return I(() => {
1617
+ const n = e.current;
1618
+ return () => {
1619
+ for (const a of n)
1620
+ clearTimeout(a);
1621
+ };
1622
+ }, []), L((n, a) => {
1623
+ const i = setTimeout(n, a);
1624
+ return e.current.push(i), i;
1625
+ }, []);
1626
+ }
1627
+ function $t() {
1628
+ const e = F(), [t, n] = H({ text: "", style: { opacity: 0 } }), a = pr(), i = L(
1629
+ (f, p = 2e3) => {
1630
+ e.current && clearTimeout(e.current), n({ text: f, style: { opacity: 1 } }), e.current = a(() => {
1631
+ n({ text: f, style: { opacity: 0 } });
1632
+ }, p);
1633
+ },
1634
+ [a]
1635
+ );
1636
+ return [t, i];
1637
+ }
1638
+ function Ct(e) {
1639
+ return At(e.slice());
1640
+ }
1641
+ function At(e) {
1642
+ let t = e.length, n;
1643
+ for (; t !== 0; )
1644
+ n = Math.floor(Math.random() * t), t--, [e[t], e[n]] = [
1645
+ e[n],
1646
+ e[t]
1647
+ ];
1648
+ return e;
1649
+ }
1650
+ function Nt(e, {
1651
+ initialLoop: t = "all",
1652
+ initialOrder: n = "list",
1653
+ getSongId: a
1654
+ }) {
1655
+ const [i, f] = H(t), [p, y] = H(n), s = K(() => p === "list" ? e : Ct(e), [e, p]), [d, b] = H(s[0]);
1656
+ I(() => {
1657
+ const o = s.find(
1658
+ (h) => a(h) === a(d)
1659
+ );
1660
+ b(o || s[0]);
1661
+ }, [s, a, d]);
1662
+ const l = K(() => {
1663
+ if (i === "one")
1664
+ return { ...d };
1665
+ const o = s.indexOf(d);
1666
+ if (o < s.length - 1)
1667
+ return s[o + 1];
1668
+ if (i !== "none") return s[0];
1669
+ }, [s, d, i]), c = L(() => {
1670
+ l && b(l);
1671
+ }, [l, i]), E = L(() => {
1672
+ b((o) => {
1673
+ const h = s.indexOf(o);
1674
+ return h > 0 ? s[h - 1] : o;
1675
+ });
1676
+ }, [s]), S = L((o) => {
1677
+ b(o);
1678
+ }, []);
1679
+ return {
1680
+ currentSong: d,
1681
+ hasNextSong: typeof l < "u",
1682
+ next: c,
1683
+ previous: E,
1684
+ prioritize: S,
1685
+ order: p,
1686
+ setOrder: y,
1687
+ loop: i,
1688
+ setLoop: f,
1689
+ length: s.length
1690
+ };
1691
+ }
1692
+ function qt(e) {
1693
+ return N({ attrs: { viewBox: "0 0 512 512" }, children: [{ tag: "path", attrs: { d: "M294.1 256L167 129c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.3 34 0L345 239c9.1 9.1 9.3 23.7.7 33.1L201.1 417c-4.7 4.7-10.9 7-17 7s-12.3-2.3-17-7c-9.4-9.4-9.4-24.6 0-33.9l127-127.1z", fill: "currentColor" } }] })(e);
1694
+ }
1695
+ function Mt(e) {
1696
+ return N({ attrs: { viewBox: "0 0 512 512" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M208 432h-48a16 16 0 0 1-16-16V96a16 16 0 0 1 16-16h48a16 16 0 0 1 16 16v320a16 16 0 0 1-16 16m144 0h-48a16 16 0 0 1-16-16V96a16 16 0 0 1 16-16h48a16 16 0 0 1 16 16v320a16 16 0 0 1-16 16" } }] })(e);
1697
+ }
1698
+ function kt({
1699
+ audio: e,
1700
+ appearance: t = "normal",
1701
+ volume: n = 0.7,
1702
+ initialLoop: a,
1703
+ initialOrder: i,
1704
+ autoPlay: f = !1,
1705
+ listMaxHeight: p = 250,
1706
+ mini: y = !1,
1707
+ mutex: s = !0,
1708
+ listFolded: d = !1,
1709
+ theme: b = "light"
1710
+ }) {
1711
+ var te, ne, ae;
1712
+ const l = W("aplayer"), c = Nt(Array.isArray(e) ? e : [e], {
1713
+ initialLoop: a,
1714
+ initialOrder: i,
1715
+ getSongId: (O) => O.url
1716
+ }), [E, S] = $t(), o = pr(), h = F(), g = L(() => {
1717
+ h.current && (clearTimeout(h.current), h.current = void 0);
1718
+ }, []), x = Pt({
1719
+ src: c.currentSong.url,
1720
+ initialVolume: n,
1721
+ autoPlay: f,
1722
+ mutex: s,
1723
+ onError(O) {
1724
+ const { error: de } = O.target;
1725
+ de && S(
1726
+ "An audio error has occurred, player will skip forward in 2 seconds."
1727
+ ), c.hasNextSong && (h.current = o(() => {
1728
+ c.next();
1729
+ }, 2e3));
1730
+ },
1731
+ onEnded() {
1732
+ c.hasNextSong && c.next();
1733
+ }
1734
+ });
1735
+ I(() => {
1736
+ f && x.playAudio(c.currentSong.url);
1737
+ }, []);
1738
+ const q = F(!0);
1739
+ I(() => {
1740
+ q.current ? q.current = !1 : c.currentSong && x.playAudio(c.currentSong.url);
1741
+ }, [c.currentSong, x.playAudio]);
1742
+ const C = L(() => {
1743
+ g(), x.togglePlay(c.currentSong.url);
1744
+ }, [x, g, c.currentSong.url]), re = L((O) => O ? typeof O == "string" ? O : O.url ? /* @__PURE__ */ v.jsx("a", { href: O.url, target: "_blank", rel: "noreferrer", children: O.name ?? "Audio artist" }) : O.name ?? "Audio artist" : "Audio artist", []), U = c.length > 1, B = K(
1745
+ () => Array.isArray(e) ? e : [e],
1746
+ [e]
1747
+ ), { prioritize: ce } = c, le = L(
1748
+ (O) => {
1749
+ g(), ce(O);
1750
+ },
1751
+ [g, ce]
1752
+ ), [Se, Te] = H(() => U && !d), [fe, V] = H(y), [k, Y] = H(!0), J = F(null);
1753
+ return I(() => {
1754
+ V(y);
1755
+ }, [y]), I(() => {
1756
+ if (t === "fixed" && J.current) {
1757
+ const O = J.current;
1758
+ return O.style.width = `${O.offsetWidth - 18}px`, () => {
1759
+ O.removeAttribute("style");
1760
+ };
1761
+ }
1762
+ }, [t]), /* @__PURE__ */ v.jsxs(
1763
+ "div",
1764
+ {
1765
+ className: P(l.b(), {
1766
+ [l.bs(b)]: !0,
1767
+ [l.bs("vars")]: !0,
1768
+ [l.bm("fixed")]: t === "fixed",
1769
+ [l.bm("loading")]: x.isLoading,
1770
+ [l.bm("withlist")]: U,
1771
+ [l.bm("withlrc")]: !!c.currentSong.lrc && t !== "fixed",
1772
+ [l.bm("narrow")]: fe
1773
+ }),
1774
+ children: [
1775
+ /* @__PURE__ */ v.jsxs("div", { ref: J, className: l.be("body"), children: [
1776
+ /* @__PURE__ */ v.jsx(
1777
+ "div",
1778
+ {
1779
+ className: l.be("pic"),
1780
+ onClick: C,
1781
+ style: {
1782
+ backgroundImage: `url("${(te = c.currentSong) == null ? void 0 : te.cover}")`
1783
+ },
1784
+ children: /* @__PURE__ */ v.jsx(
1785
+ "div",
1786
+ {
1787
+ className: P(
1788
+ l.be("button"),
1789
+ x.isPlaying ? l.bm("pause") : l.bm("play")
1790
+ ),
1791
+ children: x.isPlaying ? /* @__PURE__ */ v.jsx(Mt, {}) : /* @__PURE__ */ v.jsx(ot, {})
1792
+ }
1793
+ )
1794
+ }
1795
+ ),
1796
+ /* @__PURE__ */ v.jsxs("div", { className: P(l.be("info")), children: [
1797
+ /* @__PURE__ */ v.jsxs("div", { className: P(l.be("music")), children: [
1798
+ /* @__PURE__ */ v.jsx("span", { className: P(l.be("title")), children: ((ne = c.currentSong) == null ? void 0 : ne.name) ?? "Audio name" }),
1799
+ /* @__PURE__ */ v.jsxs("span", { className: P(l.be("author")), children: [
1800
+ " ",
1801
+ "-",
1802
+ " ",
1803
+ re((ae = c.currentSong) == null ? void 0 : ae.artist)
1804
+ ] })
1805
+ ] }),
1806
+ t === "fixed" ? null : /* @__PURE__ */ v.jsx(
1807
+ sr,
1808
+ {
1809
+ show: k,
1810
+ lrcText: c.currentSong.lrc,
1811
+ currentTime: x.currentTime ?? 0
1812
+ }
1813
+ ),
1814
+ /* @__PURE__ */ v.jsx(
1815
+ St,
1816
+ {
1817
+ volume: x.volume ?? n,
1818
+ onChangeVolume: x.setVolume,
1819
+ muted: x.muted ?? !1,
1820
+ onToggleMuted: () => x.toggleMuted(),
1821
+ currentTime: x.currentTime,
1822
+ audioDurationSeconds: x.duration,
1823
+ bufferedSeconds: x.bufferedSeconds,
1824
+ onSeek: (O) => x.seek(O),
1825
+ onToggleMenu: () => Te((O) => !O),
1826
+ order: c.order,
1827
+ onOrderChange: c.setOrder,
1828
+ loop: c.loop,
1829
+ onLoopChange: c.setLoop,
1830
+ isPlaying: x.isPlaying ?? !1,
1831
+ onTogglePlay: C,
1832
+ onSkipForward: () => {
1833
+ c.hasNextSong && c.next();
1834
+ },
1835
+ onSkipBack: () => {
1836
+ c.previous();
1837
+ },
1838
+ showLyrics: k,
1839
+ onToggleLyrics: () => {
1840
+ Y((O) => !O);
1841
+ }
1842
+ }
1843
+ )
1844
+ ] }),
1845
+ /* @__PURE__ */ v.jsx("div", { className: l.be("notice"), style: E.style, children: E.text }),
1846
+ /* @__PURE__ */ v.jsx(
1847
+ "div",
1848
+ {
1849
+ className: l.be("miniswitcher"),
1850
+ onClick: () => V((O) => !O),
1851
+ children: /* @__PURE__ */ v.jsx("button", { className: l.bs("icon"), type: "button", children: /* @__PURE__ */ v.jsx(qt, {}) })
1852
+ }
1853
+ )
1854
+ ] }),
1855
+ U ? /* @__PURE__ */ v.jsx(
1856
+ Tt,
1857
+ {
1858
+ open: Se,
1859
+ audio: B,
1860
+ playingAudioUrl: c.currentSong.url,
1861
+ onPlayAudio: le,
1862
+ listMaxHeight: p
1863
+ }
1864
+ ) : null,
1865
+ t === "fixed" && /* @__PURE__ */ v.jsx(
1866
+ sr,
1867
+ {
1868
+ show: k,
1869
+ lrcText: c.currentSong.lrc,
1870
+ currentTime: x.currentTime ?? 0
1871
+ }
1872
+ )
1873
+ ]
1874
+ }
1875
+ );
1876
+ }
1877
+ export {
1878
+ kt as TwistAPlayer
1879
+ };