twist-aplayer
Version:
A shadui theme aplayer
1,405 lines (1,403 loc) • 69.5 kB
JavaScript
import * as me from "react";
import Ae, { useMemo as Z, useRef as B, useState as z, useEffect as I, useCallback as R } from "react";
var Le = { exports: {} }, Ee = {};
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var ur;
function Yr() {
if (ur) return Ee;
ur = 1;
var e = Ae, t = Symbol.for("react.element"), a = Symbol.for("react.fragment"), n = 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 };
function p(h, s, b) {
var g, c = {}, v = null, x = null;
b !== void 0 && (v = "" + b), s.key !== void 0 && (v = "" + s.key), s.ref !== void 0 && (x = s.ref);
for (g in s) n.call(s, g) && !f.hasOwnProperty(g) && (c[g] = s[g]);
if (h && h.defaultProps) for (g in s = h.defaultProps, s) c[g] === void 0 && (c[g] = s[g]);
return { $$typeof: t, type: h, key: v, ref: x, props: c, _owner: i.current };
}
return Ee.Fragment = a, Ee.jsx = p, Ee.jsxs = p, Ee;
}
var Se = {};
/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var sr;
function Gr() {
return sr || (sr = 1, process.env.NODE_ENV !== "production" && function() {
var e = Ae, t = Symbol.for("react.element"), a = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), p = Symbol.for("react.provider"), h = Symbol.for("react.context"), s = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), c = Symbol.for("react.memo"), v = Symbol.for("react.lazy"), x = Symbol.for("react.offscreen"), S = Symbol.iterator, u = "@@iterator";
function l(r) {
if (r === null || typeof r != "object")
return null;
var o = S && r[S] || r[u];
return typeof o == "function" ? o : null;
}
var y = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
function T(r) {
{
for (var o = arguments.length, m = new Array(o > 1 ? o - 1 : 0), E = 1; E < o; E++)
m[E - 1] = arguments[E];
j("error", r, m);
}
}
function j(r, o, m) {
{
var E = y.ReactDebugCurrentFrame, O = E.getStackAddendum();
O !== "" && (o += "%s", m = m.concat([O]));
var P = m.map(function(w) {
return String(w);
});
P.unshift("Warning: " + o), Function.prototype.apply.call(console[r], console, P);
}
}
var C = !1, ee = !1, re = !1, H = !1, te = !1, oe;
oe = Symbol.for("react.module.reference");
function pe(r) {
return !!(typeof r == "string" || typeof r == "function" || r === n || r === f || te || r === i || r === b || r === g || H || r === x || C || ee || re || typeof r == "object" && r !== null && (r.$$typeof === v || r.$$typeof === c || r.$$typeof === p || r.$$typeof === h || r.$$typeof === s || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
r.$$typeof === oe || r.getModuleId !== void 0));
}
function he(r, o, m) {
var E = r.displayName;
if (E)
return E;
var O = o.displayName || o.name || "";
return O !== "" ? m + "(" + O + ")" : m;
}
function ue(r) {
return r.displayName || "Context";
}
function D(r) {
if (r == null)
return null;
if (typeof r.tag == "number" && T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof r == "function")
return r.displayName || r.name || null;
if (typeof r == "string")
return r;
switch (r) {
case n:
return "Fragment";
case a:
return "Portal";
case f:
return "Profiler";
case i:
return "StrictMode";
case b:
return "Suspense";
case g:
return "SuspenseList";
}
if (typeof r == "object")
switch (r.$$typeof) {
case h:
var o = r;
return ue(o) + ".Consumer";
case p:
var m = r;
return ue(m._context) + ".Provider";
case s:
return he(r, r.render, "ForwardRef");
case c:
var E = r.displayName || null;
return E !== null ? E : D(r.type) || "Memo";
case v: {
var O = r, P = O._payload, w = O._init;
try {
return D(w(P));
} catch {
return null;
}
}
}
return null;
}
var W = Object.assign, U = 0, Y, G, $, K, ye, Te, be;
function je() {
}
je.__reactDisabledLog = !0;
function Ne() {
{
if (U === 0) {
Y = console.log, G = console.info, $ = console.warn, K = console.error, ye = console.group, Te = console.groupCollapsed, be = console.groupEnd;
var r = {
configurable: !0,
enumerable: !0,
value: je,
writable: !0
};
Object.defineProperties(console, {
info: r,
log: r,
warn: r,
error: r,
group: r,
groupCollapsed: r,
groupEnd: r
});
}
U++;
}
}
function qe() {
{
if (U--, U === 0) {
var r = {
configurable: !0,
enumerable: !0,
writable: !0
};
Object.defineProperties(console, {
log: W({}, r, {
value: Y
}),
info: W({}, r, {
value: G
}),
warn: W({}, r, {
value: $
}),
error: W({}, r, {
value: K
}),
group: W({}, r, {
value: ye
}),
groupCollapsed: W({}, r, {
value: Te
}),
groupEnd: W({}, r, {
value: be
})
});
}
U < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
}
}
var ge = y.ReactCurrentDispatcher, xe;
function Q(r, o, m) {
{
if (xe === void 0)
try {
throw Error();
} catch (O) {
var E = O.stack.trim().match(/\n( *(at )?)/);
xe = E && E[1] || "";
}
return `
` + xe + r;
}
}
var se = !1, ne;
{
var V = typeof WeakMap == "function" ? WeakMap : Map;
ne = new V();
}
function le(r, o) {
if (!r || se)
return "";
{
var m = ne.get(r);
if (m !== void 0)
return m;
}
var E;
se = !0;
var O = Error.prepareStackTrace;
Error.prepareStackTrace = void 0;
var P;
P = ge.current, ge.current = null, Ne();
try {
if (o) {
var w = function() {
throw Error();
};
if (Object.defineProperty(w.prototype, "props", {
set: function() {
throw Error();
}
}), typeof Reflect == "object" && Reflect.construct) {
try {
Reflect.construct(w, []);
} catch (k) {
E = k;
}
Reflect.construct(r, [], w);
} else {
try {
w.call();
} catch (k) {
E = k;
}
r.call(w.prototype);
}
} else {
try {
throw Error();
} catch (k) {
E = k;
}
r();
}
} catch (k) {
if (k && E && typeof k.stack == "string") {
for (var _ = k.stack.split(`
`), q = E.stack.split(`
`), M = _.length - 1, A = q.length - 1; M >= 1 && A >= 0 && _[M] !== q[A]; )
A--;
for (; M >= 1 && A >= 0; M--, A--)
if (_[M] !== q[A]) {
if (M !== 1 || A !== 1)
do
if (M--, A--, A < 0 || _[M] !== q[A]) {
var F = `
` + _[M].replace(" at new ", " at ");
return r.displayName && F.includes("<anonymous>") && (F = F.replace("<anonymous>", r.displayName)), typeof r == "function" && ne.set(r, F), F;
}
while (M >= 1 && A >= 0);
break;
}
}
} finally {
se = !1, ge.current = P, qe(), Error.prepareStackTrace = O;
}
var de = r ? r.displayName || r.name : "", ae = de ? Q(de) : "";
return typeof r == "function" && ne.set(r, ae), ae;
}
function Oe(r, o, m) {
return le(r, !1);
}
function Re(r) {
var o = r.prototype;
return !!(o && o.isReactComponent);
}
function ce(r, o, m) {
if (r == null)
return "";
if (typeof r == "function")
return le(r, Re(r));
if (typeof r == "string")
return Q(r);
switch (r) {
case b:
return Q("Suspense");
case g:
return Q("SuspenseList");
}
if (typeof r == "object")
switch (r.$$typeof) {
case s:
return Oe(r.render);
case c:
return ce(r.type, o, m);
case v: {
var E = r, O = E._payload, P = E._init;
try {
return ce(P(O), o, m);
} catch {
}
}
}
return "";
}
var J = Object.prototype.hasOwnProperty, Ye = {}, Ge = y.ReactDebugCurrentFrame;
function Pe(r) {
if (r) {
var o = r._owner, m = ce(r.type, r._source, o ? o.type : null);
Ge.setExtraStackFrame(m);
} else
Ge.setExtraStackFrame(null);
}
function Tr(r, o, m, E, O) {
{
var P = Function.call.bind(J);
for (var w in r)
if (P(r, w)) {
var _ = void 0;
try {
if (typeof r[w] != "function") {
var q = Error((E || "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`.");
throw q.name = "Invariant Violation", q;
}
_ = r[w](o, w, E, m, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
} catch (M) {
_ = M;
}
_ && !(_ instanceof Error) && (Pe(O), T("%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).", E || "React class", m, w, typeof _), Pe(null)), _ instanceof Error && !(_.message in Ye) && (Ye[_.message] = !0, Pe(O), T("Failed %s type: %s", m, _.message), Pe(null));
}
}
}
var jr = Array.isArray;
function ke(r) {
return jr(r);
}
function Or(r) {
{
var o = typeof Symbol == "function" && Symbol.toStringTag, m = o && r[Symbol.toStringTag] || r.constructor.name || "Object";
return m;
}
}
function Rr(r) {
try {
return Ke(r), !1;
} catch {
return !0;
}
}
function Ke(r) {
return "" + r;
}
function Je(r) {
if (Rr(r))
return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Or(r)), Ke(r);
}
var Xe = y.ReactCurrentOwner, Pr = {
key: !0,
ref: !0,
__self: !0,
__source: !0
}, Qe, Ze;
function Lr(r) {
if (J.call(r, "ref")) {
var o = Object.getOwnPropertyDescriptor(r, "ref").get;
if (o && o.isReactWarning)
return !1;
}
return r.ref !== void 0;
}
function Cr(r) {
if (J.call(r, "key")) {
var o = Object.getOwnPropertyDescriptor(r, "key").get;
if (o && o.isReactWarning)
return !1;
}
return r.key !== void 0;
}
function Mr(r, o) {
typeof r.ref == "string" && Xe.current;
}
function $r(r, o) {
{
var m = function() {
Qe || (Qe = !0, T("%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)", o));
};
m.isReactWarning = !0, Object.defineProperty(r, "key", {
get: m,
configurable: !0
});
}
}
function Ar(r, o) {
{
var m = function() {
Ze || (Ze = !0, T("%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)", o));
};
m.isReactWarning = !0, Object.defineProperty(r, "ref", {
get: m,
configurable: !0
});
}
}
var Nr = function(r, o, m, E, O, P, w) {
var _ = {
// This tag allows us to uniquely identify this as a React Element
$$typeof: t,
// Built-in properties that belong on the element
type: r,
key: o,
ref: m,
props: w,
// Record the component responsible for creating this element.
_owner: P
};
return _._store = {}, Object.defineProperty(_._store, "validated", {
configurable: !1,
enumerable: !1,
writable: !0,
value: !1
}), Object.defineProperty(_, "_self", {
configurable: !1,
enumerable: !1,
writable: !1,
value: E
}), Object.defineProperty(_, "_source", {
configurable: !1,
enumerable: !1,
writable: !1,
value: O
}), Object.freeze && (Object.freeze(_.props), Object.freeze(_)), _;
};
function qr(r, o, m, E, O) {
{
var P, w = {}, _ = null, q = null;
m !== void 0 && (Je(m), _ = "" + m), Cr(o) && (Je(o.key), _ = "" + o.key), Lr(o) && (q = o.ref, Mr(o, O));
for (P in o)
J.call(o, P) && !Pr.hasOwnProperty(P) && (w[P] = o[P]);
if (r && r.defaultProps) {
var M = r.defaultProps;
for (P in M)
w[P] === void 0 && (w[P] = M[P]);
}
if (_ || q) {
var A = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
_ && $r(w, A), q && Ar(w, A);
}
return Nr(r, _, q, O, E, Xe.current, w);
}
}
var De = y.ReactCurrentOwner, er = y.ReactDebugCurrentFrame;
function fe(r) {
if (r) {
var o = r._owner, m = ce(r.type, r._source, o ? o.type : null);
er.setExtraStackFrame(m);
} else
er.setExtraStackFrame(null);
}
var Ie;
Ie = !1;
function Ve(r) {
return typeof r == "object" && r !== null && r.$$typeof === t;
}
function rr() {
{
if (De.current) {
var r = D(De.current.type);
if (r)
return `
Check the render method of \`` + r + "`.";
}
return "";
}
}
function kr(r) {
return "";
}
var tr = {};
function Dr(r) {
{
var o = rr();
if (!o) {
var m = typeof r == "string" ? r : r.displayName || r.name;
m && (o = `
Check the top-level render call using <` + m + ">.");
}
return o;
}
}
function nr(r, o) {
{
if (!r._store || r._store.validated || r.key != null)
return;
r._store.validated = !0;
var m = Dr(o);
if (tr[m])
return;
tr[m] = !0;
var E = "";
r && r._owner && r._owner !== De.current && (E = " It was passed a child from " + D(r._owner.type) + "."), fe(r), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', m, E), fe(null);
}
}
function ar(r, o) {
{
if (typeof r != "object")
return;
if (ke(r))
for (var m = 0; m < r.length; m++) {
var E = r[m];
Ve(E) && nr(E, o);
}
else if (Ve(r))
r._store && (r._store.validated = !0);
else if (r) {
var O = l(r);
if (typeof O == "function" && O !== r.entries)
for (var P = O.call(r), w; !(w = P.next()).done; )
Ve(w.value) && nr(w.value, o);
}
}
}
function Ir(r) {
{
var o = r.type;
if (o == null || typeof o == "string")
return;
var m;
if (typeof o == "function")
m = o.propTypes;
else if (typeof o == "object" && (o.$$typeof === s || // Note: Memo only checks outer props here.
// Inner props are checked in the reconciler.
o.$$typeof === c))
m = o.propTypes;
else
return;
if (m) {
var E = D(o);
Tr(m, r.props, "prop", E, r);
} else if (o.PropTypes !== void 0 && !Ie) {
Ie = !0;
var O = D(o);
T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", O || "Unknown");
}
typeof o.getDefaultProps == "function" && !o.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
}
}
function Vr(r) {
{
for (var o = Object.keys(r.props), m = 0; m < o.length; m++) {
var E = o[m];
if (E !== "children" && E !== "key") {
fe(r), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", E), fe(null);
break;
}
}
r.ref !== null && (fe(r), T("Invalid attribute `ref` supplied to `React.Fragment`."), fe(null));
}
}
var ir = {};
function or(r, o, m, E, O, P) {
{
var w = pe(r);
if (!w) {
var _ = "";
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (_ += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
var q = kr();
q ? _ += q : _ += rr();
var M;
r === null ? M = "null" : ke(r) ? M = "array" : r !== void 0 && r.$$typeof === t ? (M = "<" + (D(r.type) || "Unknown") + " />", _ = " Did you accidentally export a JSX literal instead of a component?") : M = typeof r, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", M, _);
}
var A = qr(r, o, m, O, P);
if (A == null)
return A;
if (w) {
var F = o.children;
if (F !== void 0)
if (E)
if (ke(F)) {
for (var de = 0; de < F.length; de++)
ar(F[de], r);
Object.freeze && Object.freeze(F);
} else
T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
else
ar(F, r);
}
if (J.call(o, "key")) {
var ae = D(r), k = Object.keys(o).filter(function(Ur) {
return Ur !== "key";
}), Fe = k.length > 0 ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}";
if (!ir[ae + Fe]) {
var Wr = k.length > 0 ? "{" + k.join(": ..., ") + ": ...}" : "{}";
T(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`, Fe, ae, Wr, ae), ir[ae + Fe] = !0;
}
}
return r === n ? Vr(A) : Ir(A), A;
}
}
function Fr(r, o, m) {
return or(r, o, m, !0);
}
function Br(r, o, m) {
return or(r, o, m, !1);
}
var zr = Br, Hr = Fr;
Se.Fragment = n, Se.jsx = zr, Se.jsxs = Hr;
}()), Se;
}
var lr;
function Kr() {
return lr || (lr = 1, process.env.NODE_ENV === "production" ? Le.exports = Yr() : Le.exports = Gr()), Le.exports;
}
var d = Kr(), Ce = (e) => `--${e}`, cr = (e) => `var(--${e})`, fr = (e, t) => `--${e}: ${t};`;
function Jr(e, t) {
const a = (n) => t;
return {
b: () => `${a()}-${e}`,
be: (n) => `${a()}-${e}__${n}`,
bm: (n) => `${a()}-${e}--${n}`,
bem: (n, i) => `${a()}-${e}__${n}--${i}`,
bs: (n) => `${a()}-${e}-${n}`,
ns: (n) => `${a()}-${n}`,
cb: () => `.${a()}-${e}`,
cbe: (n) => `.${a()}-${e}__${n}`,
cbm: (n) => `.${a()}-${e}--${n}`,
cbem: (n, i) => `.${a()}-${e}__${n}--${i}`,
cbs: (n) => `.${a()}-${e}-${n}`,
cns: (n) => `.${a()}-${n}`,
cv: (n) => Ce(`${a()}-${e}-${n}`),
cvm: (n, i = {}) => {
const f = a();
for (const p of Object.keys(n))
i[Ce(`${f}-${e}-${p}`)] = n[p];
return i;
},
gcv: (n) => cr(`${a()}-${e}-${n}`),
scv: (n, i) => fr(`${a()}-${e}-${n}`, i),
nv: (n) => Ce(`${a()}-${n}`),
nvm: (n, i = {}) => {
const f = a();
for (const p of Object.keys(n))
i[Ce(`${f}-${p}`)] = n[p];
return i;
},
gnv: (n) => cr(`${a()}-${n}`),
snv: (n, i) => fr(`${a()}-${n}`, i)
};
}
function X(e) {
return Z(() => Jr(e, "twist"), [e]);
}
var xr = {
color: void 0,
size: void 0,
className: void 0,
style: void 0,
attrs: void 0
}, Ue = /* @__PURE__ */ me.createContext(xr);
Ue.Provider;
function _e(e) {
"@babel/helpers - typeof";
return _e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, _e(e);
}
var Xr = ["attrs", "size", "title", "spin", "rotate", "color"];
function Qr(e, t) {
return rt(e) || et(e, t) || Er(e, t) || Zr();
}
function Zr() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function et(e, t) {
var a = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (a != null) {
var n, i, f, p, h = [], s = !0, b = !1;
try {
if (f = (a = a.call(e)).next, t !== 0) for (; !(s = (n = f.call(a)).done) && (h.push(n.value), h.length !== t); s = !0) ;
} catch (g) {
b = !0, i = g;
} finally {
try {
if (!s && a.return != null && (p = a.return(), Object(p) !== p)) return;
} finally {
if (b) throw i;
}
}
return h;
}
}
function rt(e) {
if (Array.isArray(e)) return e;
}
function tt(e, t) {
var a = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (!a) {
if (Array.isArray(e) || (a = Er(e)) || t) {
a && (e = a);
var n = 0, i = function() {
};
return { s: i, n: function() {
return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
}, e: function(b) {
throw b;
}, f: i };
}
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
var f, p = !0, h = !1;
return { s: function() {
a = a.call(e);
}, n: function() {
var b = a.next();
return p = b.done, b;
}, e: function(b) {
h = !0, f = b;
}, f: function() {
try {
p || a.return == null || a.return();
} finally {
if (h) throw f;
}
} };
}
function Er(e, t) {
if (e) {
if (typeof e == "string") return dr(e, t);
var a = {}.toString.call(e).slice(8, -1);
return a === "Object" && e.constructor && (a = e.constructor.name), a === "Map" || a === "Set" ? Array.from(e) : a === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a) ? dr(e, t) : void 0;
}
}
function dr(e, t) {
(t == null || t > e.length) && (t = e.length);
for (var a = 0, n = Array(t); a < t; a++) n[a] = e[a];
return n;
}
function $e() {
return $e = Object.assign ? Object.assign.bind() : function(e) {
for (var t = 1; t < arguments.length; t++) {
var a = arguments[t];
for (var n in a) ({}).hasOwnProperty.call(a, n) && (e[n] = a[n]);
}
return e;
}, $e.apply(null, arguments);
}
function vr(e, t) {
var a = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var n = Object.getOwnPropertySymbols(e);
t && (n = n.filter(function(i) {
return Object.getOwnPropertyDescriptor(e, i).enumerable;
})), a.push.apply(a, n);
}
return a;
}
function we(e) {
for (var t = 1; t < arguments.length; t++) {
var a = arguments[t] != null ? arguments[t] : {};
t % 2 ? vr(Object(a), !0).forEach(function(n) {
nt(e, n, a[n]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(a)) : vr(Object(a)).forEach(function(n) {
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(a, n));
});
}
return e;
}
function nt(e, t, a) {
return (t = at(t)) in e ? Object.defineProperty(e, t, { value: a, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = a, e;
}
function at(e) {
var t = it(e, "string");
return _e(t) == "symbol" ? t : t + "";
}
function it(e, t) {
if (_e(e) != "object" || !e) return e;
var a = e[Symbol.toPrimitive];
if (a !== void 0) {
var n = a.call(e, t);
if (_e(n) != "object") return n;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (t === "string" ? String : Number)(e);
}
function ot(e, t) {
if (e == null) return {};
var a, n, i = ut(e, t);
if (Object.getOwnPropertySymbols) {
var f = Object.getOwnPropertySymbols(e);
for (n = 0; n < f.length; n++) a = f[n], t.includes(a) || {}.propertyIsEnumerable.call(e, a) && (i[a] = e[a]);
}
return i;
}
function ut(e, t) {
if (e == null) return {};
var a = {};
for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
if (t.includes(n)) continue;
a[n] = e[n];
}
return a;
}
function st(e) {
var t = e.attrs, a = e.size, n = e.title, i = e.spin, f = e.rotate, p = e.color, h = ot(e, Xr), s = function(g) {
var c = a || g.size || "1em", v, x = "", S = "";
return g.className && (v = g.className), e.className && (v = v ? "".concat(v, " ").concat(e.className) : e.className), i && (v ? v += " twist-icon-loading" : v = "twist-icon-loading"), f && (x = "rotate(".concat(f, "deg)"), S = "rotate(".concat(f, "deg)")), /* @__PURE__ */ me.createElement("svg", $e({
xmlns: "http://www.w3.org/2000/svg"
}, g.attrs, t, h, {
className: v,
style: we(we({
color: p || g.color,
msTransform: x,
transform: S
}, g.style), e.style),
width: c,
height: c
}), n && /* @__PURE__ */ me.createElement("title", null, n), e.children);
};
return Ue !== void 0 ? /* @__PURE__ */ me.createElement(Ue.Consumer, null, function(b) {
return s(b);
}) : s(xr);
}
function lt(e) {
var t = {}, a = e.split(";"), n = tt(a), i;
try {
for (n.s(); !(i = n.n()).done; ) {
var f = i.value, p = f.split(":"), h = Qr(p, 2), s = h[0], b = h[1];
if (s && b) {
var g = s.trim().replace(/-./g, function(c) {
return c.charAt(1).toUpperCase();
});
t[g] = b.trim();
}
}
} catch (c) {
n.e(c);
} finally {
n.f();
}
return t;
}
function Sr(e) {
return e && e.map(function(t, a) {
return /* @__PURE__ */ me.createElement(t.tag, we(we({}, t.attrs), {}, {
key: a,
style: t.attrs.style ? lt(t.attrs.style) : null
}), Sr(t.children));
});
}
function N(e) {
return function(t) {
return /* @__PURE__ */ me.createElement(st, $e({
attrs: we({}, e.attrs)
}, t), Sr(e.children));
};
}
function ct(e) {
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);
}
function ft(e) {
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);
}
function dt(e) {
return N({ attrs: { viewBox: "0 0 1024 1024" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M512 1024c-69.1 0-136.2-13.5-199.3-40.2C251.7 958 197 921 150 874S66 772.3 40.2 711.3C13.5 648.2 0 581.1 0 512c0-19.9 16.1-36 36-36s36 16.1 36 36c0 59.4 11.6 117 34.6 171.3c22.2 52.4 53.9 99.5 94.3 139.9s87.5 72.2 139.9 94.3C395 940.4 452.6 952 512 952s117-11.6 171.3-34.6c52.4-22.2 99.5-53.9 139.9-94.3s72.2-87.5 94.3-139.9C940.4 629 952 571.4 952 512s-11.6-117-34.6-171.3a440.5 440.5 0 0 0-94.3-139.9a437.7 437.7 0 0 0-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.2C772.3 66 827 103 874 150s83.9 101.8 109.7 162.7c26.7 63.1 40.2 130.2 40.2 199.3s-13.5 136.2-40.2 199.3C958 772.3 921 827 874 874s-101.8 83.9-162.7 109.7c-63.1 26.8-130.2 40.3-199.3 40.3" } }] })(e);
}
function mr(e) {
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);
}
function vt(e) {
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);
}
function mt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z" } }] })(e);
}
function pt(e) {
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);
}
function ht(e) {
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);
}
function yt(e) {
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);
}
function bt(e) {
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);
}
function gt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14 19V5h4v14zm-8 0V5h4v14z" } }] })(e);
}
function xt(e) {
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);
}
function Et(e) {
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);
}
function St(e) {
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);
}
function _t(e) {
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);
}
function wt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M7 15V9h4l5-5v16l-5-5z" } }] })(e);
}
function Tt(e) {
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);
}
function jt(e) {
return N({ attrs: { viewBox: "0 0 24 24" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M18.25 12L8.5 17.629V6.37z" } }] })(e);
}
function Be(e, t) {
if (!t.current) return 0;
let a = (e.clientX - t.current.getBoundingClientRect().left) / t.current.clientWidth;
return a = Math.max(a, 0), a = Math.min(a, 1), a = Math.floor(a * 100) / 100, a;
}
function ze(e, t) {
if (!t.current) return 0;
let a = 1 - (e.clientY - t.current.getBoundingClientRect().top) / t.current.clientHeight;
return a = Math.max(a, 0), a = Math.min(a, 1), a = Math.floor(a * 100) / 100, a;
}
function _r(e) {
var t, a, n = "";
if (typeof e == "string" || typeof e == "number") n += e;
else if (typeof e == "object") if (Array.isArray(e)) {
var i = e.length;
for (t = 0; t < i; t++) e[t] && (a = _r(e[t])) && (n && (n += " "), n += a);
} else for (a in e) e[a] && (n && (n += " "), n += a);
return n;
}
function L() {
for (var e, t, a = 0, n = "", i = arguments.length; a < i; a++) (e = arguments[a]) && (t = _r(e)) && (n && (n += " "), n += t);
return n;
}
function Ot({
bufferedPercentage: e,
playedPercentage: t,
onSeek: a
}) {
const n = X("aplayer-bar"), i = X("aplayer-icon"), f = B(null), [p, h] = z(t), s = B(!1);
I(() => {
s.current || h(t);
}, [t]);
const b = R(
(g) => {
s.current = !0;
const c = Be(g, f);
h(c);
const v = (S) => {
const u = Be(S, f);
h(u);
}, x = (S) => {
document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", x);
const u = Be(S, f);
h(u), a == null || a(u), s.current = !1;
};
document.addEventListener("mousemove", v), document.addEventListener("mouseup", x);
},
[a]
);
return /* @__PURE__ */ d.jsx(
"div",
{
ref: f,
className: L(n.b(), n.bs("vars")),
onMouseDown: b,
role: "slider",
"aria-label": "Audio progress",
"aria-valuenow": p ? p * 100 : 0,
"aria-valuemin": 0,
"aria-valuemax": 100,
"aria-live": "polite",
children: /* @__PURE__ */ d.jsxs("div", { className: n.be("inner"), children: [
typeof e < "u" ? /* @__PURE__ */ d.jsx(
"div",
{
className: n.be("loaded"),
style: { width: `${e * 100}%` }
}
) : null,
typeof p < "u" ? /* @__PURE__ */ d.jsx(
"div",
{
className: n.be("played"),
style: {
width: `${p * 100}%`
},
children: /* @__PURE__ */ d.jsx(
"span",
{
className: n.be("thumb"),
children: /* @__PURE__ */ d.jsx("span", { className: L(i.bs("loading")), children: /* @__PURE__ */ d.jsx(dt, {}) })
}
)
}
) : null
] })
}
);
}
function Rt({
volume: e,
muted: t,
onToggleMuted: a,
onChangeVolume: n
}) {
const i = X("aplayer-volumn"), f = X("aplayer-icon"), p = B(null), [h, s] = z(!1), b = R(
(g) => {
n(ze(g, p)), s(!0);
const c = (x) => {
n(ze(x, p));
}, v = (x) => {
document.removeEventListener("mouseup", v), document.removeEventListener("mousemove", c), s(!1), n(ze(x, p));
};
document.addEventListener("mousemove", c), document.addEventListener("mouseup", v);
},
[n]
);
return /* @__PURE__ */ d.jsxs("div", { className: L(i.b(), i.bs("vars")), children: [
/* @__PURE__ */ d.jsx(
"button",
{
type: "button",
className: L(f.b(), f.bs("volume-down")),
onClick: () => a(),
"aria-label": t || !e ? "Muted" : "unMuted",
children: t || !e ? /* @__PURE__ */ d.jsx(wt, {}) : e >= 1 ? /* @__PURE__ */ d.jsx(Tt, {}) : /* @__PURE__ */ d.jsx(_t, {})
}
),
/* @__PURE__ */ d.jsx(
"div",
{
className: L(i.be("bar-wrap"), {
[i.bem("bar-wrap", "active")]: h
}),
ref: p,
onMouseDown: b,
children: /* @__PURE__ */ d.jsx("div", { className: i.be("bar"), children: /* @__PURE__ */ d.jsx(
"div",
{
className: i.be("thumb"),
style: {
height: t ? 0 : `${e * 100}%`
}
}
) })
}
)
] });
}
function pr(e) {
if (typeof e > "u")
return "--:--";
if (Number.isNaN(e))
return "00:00";
const t = (p) => p < 10 ? `0${p}` : `${p}`, a = Math.trunc(e / 60), n = Math.trunc(e - a * 60), i = Math.trunc(a / 60), f = Math.trunc(
e / 60 - 60 * Math.trunc(e / 60 / 60)
);
return e >= 3600 ? `${t(i)}:${t(f)}:${t(n)}` : `${t(a)}:${t(n)}`;
}
function Pt({
volume: e,
onChangeVolume: t,
muted: a,
currentTime: n,
audioDurationSeconds: i,
bufferedSeconds: f,
onToggleMenu: p,
onToggleMuted: h,
order: s,
onOrderChange: b,
loop: g,
onLoopChange: c,
onSeek: v,
isPlaying: x,
onTogglePlay: S,
onSkipForward: u,
onSkipBack: l,
showLyrics: y = !0,
onToggleLyrics: T
}) {
const j = X("aplayer-controller"), C = X("aplayer-icon"), ee = R(() => {
const H = {
list: "random",
random: "list"
}[s];
b(H);
}, [s, b]), re = R(() => {
const H = {
all: "one",
one: "none",
none: "all"
}[g];
c(H);
}, [g, c]);
return /* @__PURE__ */ d.jsxs(
"div",
{
className: L(j.b(), j.bs("vars")),
role: "group",
"aria-label": "Audio Controls",
children: [
/* @__PURE__ */ d.jsx(
Ot,
{
playedPercentage: typeof n > "u" || typeof i > "u" ? void 0 : n / i,
bufferedPercentage: typeof f > "u" || typeof i > "u" ? void 0 : f / i,
onSeek: (H) => v == null ? void 0 : v(H * i)
}
),
/* @__PURE__ */ d.jsxs("div", { className: j.be("time"), children: [
/* @__PURE__ */ d.jsxs("span", { className: j.be("time-inner"), "aria-live": "polite", children: [
/* @__PURE__ */ d.jsx("span", { className: j.be("ptime"), children: pr(n) }),
" / ",
/* @__PURE__ */ d.jsx("span", { className: j.be("dtime"), children: pr(i) })
] }),
/* @__PURE__ */ d.jsx(
"button",
{
className: L(C.b(), C.bs("back")),
onClick: l,
type: "button",
"aria-label": "Previous track",
children: /* @__PURE__ */ d.jsx(ct, {})
}
),
/* @__PURE__ */ d.jsx(
"button",
{
className: L(C.b(), C.bs("play")),
onClick: S,
type: "button",
"aria-label": x ? "Pause audio" : "Play audio",
children: x ? /* @__PURE__ */ d.jsx(gt, {}) : /* @__PURE__ */ d.jsx(xt, {})
}
),
/* @__PURE__ */ d.jsx(
"button",
{
className: L(C.b(), C.bs("forward")),
onClick: u,
type: "button",
"aria-label": "Next track",
children: /* @__PURE__ */ d.jsx(ft, {})
}
),
/* @__PURE__ */ d.jsx(
Rt,
{
volume: e,
muted: a,
onToggleMuted: h,
onChangeVolume: t
}
),
/* @__PURE__ */ d.jsx(
"button",
{
className: L(C.b(), C.bs("order")),
onClick: ee,
type: "button",
"aria-label": `Playback order: ${s}`,
children: { list: /* @__PURE__ */ d.jsx(yt, {}), random: /* @__PURE__ */ d.jsx(ht, {}) }[s]
}
),
/* @__PURE__ */ d.jsx(
"button",
{
className: L(C.b(), C.bs("order")),
onClick: re,
type: "button",
"aria-label": `Loop mode: ${g}`,
children: {
all: /* @__PURE__ */ d.jsx(St, {}),
one: /* @__PURE__ */ d.jsx(Et, {}),
none: /* @__PURE__ */ d.jsx(pt, {})
}[g]
}
),
/* @__PURE__ */ d.jsx(
"button",
{
type: "button",
className: L(C.b(), C.bs("menu")),
onClick: () => p == null ? void 0 : p(),
"aria-label": "Toggle playlist menu",
children: /* @__PURE__ */ d.jsx(mt, {})
}
),
/* @__PURE__ */ d.jsx(
"button",
{
type: "button",
className: L(C.b(), C.bs("lrc"), {
[C.ns("lrc-inactivity")]: !y
}),
onClick: T,
"aria-label": y ? "Hide lyrics" : "Show lyrics",
"aria-pressed": y,
children: /* @__PURE__ */ d.jsx(bt, {})
}
)
] })
]
}
);
}
function Lt({
open: e,
audio: t,
playingAudioUrl: a,
onPlayAudio: n,
listMaxHeight: i,
isMiniExpanded: f,
isSuperMiniExpanded: p
}) {
const h = X("aplayer-list"), s = i ? { maxHeight: i } : void 0, b = R((c) => c ? typeof c == "string" ? c : c.name ?? "Audio artist" : "Audio artist", []), g = B(null);
return I(() => {
if (g.current) {
const c = g.current;
return c.style.maxHeight = `${Math.min(
c.scrollHeight,
i ?? 1 / 0
)}px`, () => {
c.removeAttribute("style");
};
}
}, [
i,
f,
p
]), /* @__PURE__ */ d.jsx(
"div",
{
ref: g,
className: L(h.b(), {
[h.bm("hide")]: !e,
[h.bs("vars")]: !0
}),
"aria-label": "Audio playlist",
"aria-live": "polite",
children: /* @__PURE__ */ d.jsx("ol", { style: s, children: t.map((c, v) => /* @__PURE__ */ d.jsxs(
"li",
{
className: L({
[h.bm("active")]: c.url === a
}),
onClick: () => {
c.url !== a && (n == null || n(c));
},
role: "button",
"aria-label": `${c.name ?? "Audio name"} by ${b(c.artist)}}`,
children: [
/* @__PURE__ */ d.jsx("span", { className: h.be("cur") }),
/* @__PURE__ */ d.jsx("span", { className: h.be("index"), children: v + 1 }),
/* @__PURE__ */ d.jsx("span", { className: h.be("title"), children: c.name ?? "Audio name" }),
/* @__PURE__ */ d.jsx("span", { className: h.be("author"), children: b(c.artist) })
]
},
c.name || v
)) })
}
);
}
function hr({ show: e, lrcText: t, currentTime: a }) {
const n = X("aplayer-lrc"), i = Z(() => Ct(t), [t]), f = Z(() => {
for (let h = 0; h < i.length; h++) {
const s = i[h], b = i[h + 1];
if (a >= s[0] && (!b || a < b[0]))
return h;
}
return 0;
}, [a, i]), p = Z(() => ({
transform: `translateY(${-f * 16}px)`,
WebkitTransform: `translateY(${-f * 16}px)`
}), [f]);
return /* @__PURE__ */ d.jsx(
"div",
{
className: L(n.b(), {
[n.bm("hide")]: !e
}),
children: t ? /* @__PURE__ */ d.jsx("div", { className: n.be("contents"), style: p, children: i.map(([, h], s) => /* @__PURE__ */ d.jsx(
"p",
{
className: L({
[n.be("current")]: s === f
}),
children: h
},
s
)) }) : null
}
);
}
function Ct(e) {
if (e) {
e = e.replace(/([^\]^\n])\[/g, (i, f) => `${f}
[`);
const t = e.split(`
`), a = [], n = t.length;
for (let i = 0; i < n; i++) {
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, "");
if (f) {
const h = f.length;
for (let s = 0; s < h; s++) {
const b = /\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/.exec(f[s]), g = b[1] * 60, c = Number.parseInt(b[2]), v = b[4] ? Number.parseInt(b[4]) / (`${b[4]}`.length === 2 ? 100 : 1e3) : 0, x = g + c + v;
a.push([x, p]);
}
}
}
return a.sort((i, f) => i[0] - f[0]), a;
} else
return [];
}
var Me = { exports: {} }, He = {};
/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var yr;
function Mt() {
if (yr) return He;
yr = 1;
var e = Ae;
function t(c, v) {
return c === v && (c !== 0 || 1 / c === 1 / v) || c !== c && v !== v;
}
var a = typeof Object.is == "function" ? Object.is : t, n = e.useState, i = e.useEffect, f = e.useLayoutEffect, p = e.useDebugValue;
function h(c, v) {
var x = v(), S = n({ inst: { value: x, getSnapshot: v } }), u = S[0].inst, l = S[1];
return f(
function() {
u.value = x, u.getSnapshot = v, s(u) && l({ inst: u });
},
[c, x, v]
), i(
function() {
return s(u) && l({ inst: u }), c(function() {
s(u) && l({ inst: u });
});
},
[c]
), p(x), x;
}
function s(c) {
var v = c.getSnapshot;
c = c.value;
try {
var x = v();
return !a(c, x);
} catch {
return !0;
}
}
function b(c, v) {
return v();
}
var g = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? b : h;
return He.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : g, He;
}
var We = {};
/**
* @license React
* use-sync-external-store-shim.development.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
var br;
function $t() {
return br || (br = 1, process.env.NODE_ENV !== "production" && function() {
function e(x, S) {
return x === S && (x !== 0 || 1 / x === 1 / S) || x !== x && S !== S;
}
function t(x, S) {
g || i.startTransition === void 0 || (g = !0, console.error(
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim