UNPKG

react-audio-player-component

Version:

A mobile-friendly audio player for React with a modern look and convenient usage.

1,445 lines (1,439 loc) 70.5 kB
import Ke, { forwardRef as wr, useRef as Lr, useState as H, useImperativeHandle as vr, useEffect as sr } from "react"; var cr = { exports: {} }, He = {}; /** * @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 Mr; function Ir() { if (Mr) return He; Mr = 1; var v = Ke, j = Symbol.for("react.element"), z = Symbol.for("react.fragment"), I = Object.prototype.hasOwnProperty, m = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, O = { key: !0, ref: !0, __self: !0, __source: !0 }; function T(w, M, g) { var s, N = {}, D = null, A = null; g !== void 0 && (D = "" + g), M.key !== void 0 && (D = "" + M.key), M.ref !== void 0 && (A = M.ref); for (s in M) I.call(M, s) && !O.hasOwnProperty(s) && (N[s] = M[s]); if (w && w.defaultProps) for (s in M = w.defaultProps, M) N[s] === void 0 && (N[s] = M[s]); return { $$typeof: j, type: w, key: D, ref: A, props: N, _owner: m.current }; } return He.Fragment = z, He.jsx = T, He.jsxs = T, He; } var Je = {}; /** * @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 Nr; function zr() { return Nr || (Nr = 1, process.env.NODE_ENV !== "production" && function() { var v = Ke, j = Symbol.for("react.element"), z = Symbol.for("react.portal"), I = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), w = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), s = Symbol.for("react.suspense_list"), N = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), A = Symbol.for("react.offscreen"), x = Symbol.iterator, U = "@@iterator"; function Y(e) { if (e === null || typeof e != "object") return null; var r = x && e[x] || e[U]; return typeof r == "function" ? r : null; } var d = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function c(e) { { for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++) t[n - 1] = arguments[n]; L("error", e, t); } } function L(e, r, t) { { var n = d.ReactDebugCurrentFrame, o = n.getStackAddendum(); o !== "" && (r += "%s", t = t.concat([o])); var u = t.map(function(i) { return String(i); }); u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u); } } var ae = !1, ie = !1, $ = !1, he = !1, ke = !1, Me; Me = Symbol.for("react.module.reference"); function xe(e) { return !!(typeof e == "string" || typeof e == "function" || e === I || e === O || ke || e === m || e === g || e === s || he || e === A || ae || ie || $ || typeof e == "object" && e !== null && (e.$$typeof === D || e.$$typeof === N || e.$$typeof === T || e.$$typeof === w || e.$$typeof === M || // 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. e.$$typeof === Me || e.getModuleId !== void 0)); } function Ue(e, r, t) { var n = e.displayName; if (n) return n; var o = r.displayName || r.name || ""; return o !== "" ? t + "(" + o + ")" : t; } function Ne(e) { return e.displayName || "Context"; } function E(e) { if (e == null) return null; if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null; if (typeof e == "string") return e; switch (e) { case I: return "Fragment"; case z: return "Portal"; case O: return "Profiler"; case m: return "StrictMode"; case g: return "Suspense"; case s: return "SuspenseList"; } if (typeof e == "object") switch (e.$$typeof) { case w: var r = e; return Ne(r) + ".Consumer"; case T: var t = e; return Ne(t._context) + ".Provider"; case M: return Ue(e, e.render, "ForwardRef"); case N: var n = e.displayName || null; return n !== null ? n : E(e.type) || "Memo"; case D: { var o = e, u = o._payload, i = o._init; try { return E(i(u)); } catch { return null; } } } return null; } var C = Object.assign, R = 0, oe, fe, ye, je, ue, ge, de; function De() { } De.__reactDisabledLog = !0; function Oe() { { if (R === 0) { oe = console.log, fe = console.info, ye = console.warn, je = console.error, ue = console.group, ge = console.groupCollapsed, de = console.groupEnd; var e = { configurable: !0, enumerable: !0, value: De, writable: !0 }; Object.defineProperties(console, { info: e, log: e, warn: e, error: e, group: e, groupCollapsed: e, groupEnd: e }); } R++; } } function Ye() { { if (R--, R === 0) { var e = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: C({}, e, { value: oe }), info: C({}, e, { value: fe }), warn: C({}, e, { value: ye }), error: C({}, e, { value: je }), group: C({}, e, { value: ue }), groupCollapsed: C({}, e, { value: ge }), groupEnd: C({}, e, { value: de }) }); } R < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var K = d.ReactCurrentDispatcher, q; function G(e, r, t) { { if (q === void 0) try { throw Error(); } catch (o) { var n = o.stack.trim().match(/\n( *(at )?)/); q = n && n[1] || ""; } return ` ` + q + e; } } var ee = !1, B; { var be = typeof WeakMap == "function" ? WeakMap : Map; B = new be(); } function Le(e, r) { if (!e || ee) return ""; { var t = B.get(e); if (t !== void 0) return t; } var n; ee = !0; var o = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var u; u = K.current, K.current = null, Oe(); try { if (r) { var i = function() { throw Error(); }; if (Object.defineProperty(i.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(i, []); } catch (k) { n = k; } Reflect.construct(e, [], i); } else { try { i.call(); } catch (k) { n = k; } e.call(i.prototype); } } else { try { throw Error(); } catch (k) { n = k; } e(); } } catch (k) { if (k && n && typeof k.stack == "string") { for (var a = k.stack.split(` `), p = n.stack.split(` `), f = a.length - 1, y = p.length - 1; f >= 1 && y >= 0 && a[f] !== p[y]; ) y--; for (; f >= 1 && y >= 0; f--, y--) if (a[f] !== p[y]) { if (f !== 1 || y !== 1) do if (f--, y--, y < 0 || a[f] !== p[y]) { var S = ` ` + a[f].replace(" at new ", " at "); return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && B.set(e, S), S; } while (f >= 1 && y >= 0); break; } } } finally { ee = !1, K.current = u, Ye(), Error.prepareStackTrace = o; } var V = e ? e.displayName || e.name : "", Fe = V ? G(V) : ""; return typeof e == "function" && B.set(e, Fe), Fe; } function l(e, r, t) { return Le(e, !1); } function J(e) { var r = e.prototype; return !!(r && r.isReactComponent); } function _(e, r, t) { if (e == null) return ""; if (typeof e == "function") return Le(e, J(e)); if (typeof e == "string") return G(e); switch (e) { case g: return G("Suspense"); case s: return G("SuspenseList"); } if (typeof e == "object") switch (e.$$typeof) { case M: return l(e.render); case N: return _(e.type, r, t); case D: { var n = e, o = n._payload, u = n._init; try { return _(u(o), r, t); } catch { } } } return ""; } var P = Object.prototype.hasOwnProperty, se = {}, X = d.ReactDebugCurrentFrame; function W(e) { if (e) { var r = e._owner, t = _(e.type, e._source, r ? r.type : null); X.setExtraStackFrame(t); } else X.setExtraStackFrame(null); } function Re(e, r, t, n, o) { { var u = Function.call.bind(P); for (var i in e) if (u(e, i)) { var a = void 0; try { if (typeof e[i] != "function") { var p = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw p.name = "Invariant Violation", p; } a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (f) { a = f; } a && !(a instanceof Error) && (W(o), c("%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).", n || "React class", t, i, typeof a), W(null)), a instanceof Error && !(a.message in se) && (se[a.message] = !0, W(o), c("Failed %s type: %s", t, a.message), W(null)); } } } var Pe = Array.isArray; function F(e) { return Pe(e); } function pe(e) { { var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object"; return t; } } function Ae(e) { try { return we(e), !1; } catch { return !0; } } function we(e) { return "" + e; } function ce(e) { if (Ae(e)) return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", pe(e)), we(e); } var Q = d.ReactCurrentOwner, ve = { key: !0, ref: !0, __self: !0, __source: !0 }, Ie, ze, re; re = {}; function te(e) { if (P.call(e, "ref")) { var r = Object.getOwnPropertyDescriptor(e, "ref").get; if (r && r.isReactWarning) return !1; } return e.ref !== void 0; } function Qe(e) { if (P.call(e, "key")) { var r = Object.getOwnPropertyDescriptor(e, "key").get; if (r && r.isReactWarning) return !1; } return e.key !== void 0; } function Ee(e, r) { if (typeof e.ref == "string" && Q.current && r && Q.current.stateNode !== r) { var t = E(Q.current.type); re[t] || (c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', E(Q.current.type), e.ref), re[t] = !0); } } function Ce(e, r) { { var t = function() { Ie || (Ie = !0, c("%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)", r)); }; t.isReactWarning = !0, Object.defineProperty(e, "key", { get: t, configurable: !0 }); } } function We(e, r) { { var t = function() { ze || (ze = !0, c("%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)", r)); }; t.isReactWarning = !0, Object.defineProperty(e, "ref", { get: t, configurable: !0 }); } } var h = function(e, r, t, n, o, u, i) { var a = { // This tag allows us to uniquely identify this as a React Element $$typeof: j, // Built-in properties that belong on the element type: e, key: r, ref: t, props: i, // Record the component responsible for creating this element. _owner: u }; return a._store = {}, Object.defineProperty(a._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(a, "_self", { configurable: !1, enumerable: !1, writable: !1, value: n }), Object.defineProperty(a, "_source", { configurable: !1, enumerable: !1, writable: !1, value: o }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a; }; function ne(e, r, t, n, o) { { var u, i = {}, a = null, p = null; t !== void 0 && (ce(t), a = "" + t), Qe(r) && (ce(r.key), a = "" + r.key), te(r) && (p = r.ref, Ee(r, o)); for (u in r) P.call(r, u) && !ve.hasOwnProperty(u) && (i[u] = r[u]); if (e && e.defaultProps) { var f = e.defaultProps; for (u in f) i[u] === void 0 && (i[u] = f[u]); } if (a || p) { var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e; a && Ce(i, y), p && We(i, y); } return h(e, a, p, o, n, Q.current, i); } } var le = d.ReactCurrentOwner, me = d.ReactDebugCurrentFrame; function Z(e) { if (e) { var r = e._owner, t = _(e.type, e._source, r ? r.type : null); me.setExtraStackFrame(t); } else me.setExtraStackFrame(null); } var Se; Se = !1; function Te(e) { return typeof e == "object" && e !== null && e.$$typeof === j; } function Ze() { { if (le.current) { var e = E(le.current.type); if (e) return ` Check the render method of \`` + e + "`."; } return ""; } } function qe(e) { { if (e !== void 0) { var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber; return ` Check your code at ` + r + ":" + t + "."; } return ""; } } var Ve = {}; function er(e) { { var r = Ze(); if (!r) { var t = typeof e == "string" ? e : e.displayName || e.name; t && (r = ` Check the top-level render call using <` + t + ">."); } return r; } } function _e(e, r) { { if (!e._store || e._store.validated || e.key != null) return; e._store.validated = !0; var t = er(r); if (Ve[t]) return; Ve[t] = !0; var n = ""; e && e._owner && e._owner !== le.current && (n = " It was passed a child from " + E(e._owner.type) + "."), Z(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), Z(null); } } function Ge(e, r) { { if (typeof e != "object") return; if (F(e)) for (var t = 0; t < e.length; t++) { var n = e[t]; Te(n) && _e(n, r); } else if (Te(e)) e._store && (e._store.validated = !0); else if (e) { var o = Y(e); if (typeof o == "function" && o !== e.entries) for (var u = o.call(e), i; !(i = u.next()).done; ) Te(i.value) && _e(i.value, r); } } } function rr(e) { { var r = e.type; if (r == null || typeof r == "string") return; var t; if (typeof r == "function") t = r.propTypes; else if (typeof r == "object" && (r.$$typeof === M || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. r.$$typeof === N)) t = r.propTypes; else return; if (t) { var n = E(r); Re(t, e.props, "prop", n, e); } else if (r.PropTypes !== void 0 && !Se) { Se = !0; var o = E(r); c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown"); } typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function tr(e) { { for (var r = Object.keys(e.props), t = 0; t < r.length; t++) { var n = r[t]; if (n !== "children" && n !== "key") { Z(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), Z(null); break; } } e.ref !== null && (Z(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), Z(null)); } } function Be(e, r, t, n, o, u) { { var i = xe(e); if (!i) { var a = ""; (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " 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 p = qe(o); p ? a += p : a += Ze(); var f; e === null ? f = "null" : F(e) ? f = "array" : e !== void 0 && e.$$typeof === j ? (f = "<" + (E(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, a); } var y = ne(e, r, t, o, u); if (y == null) return y; if (i) { var S = r.children; if (S !== void 0) if (n) if (F(S)) { for (var V = 0; V < S.length; V++) Ge(S[V], e); Object.freeze && Object.freeze(S); } else c("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 Ge(S, e); } return e === I ? tr(y) : rr(y), y; } } function nr(e, r, t) { return Be(e, r, t, !0); } function ar(e, r, t) { return Be(e, r, t, !1); } var ir = ar, or = nr; Je.Fragment = I, Je.jsx = ir, Je.jsxs = or; }()), Je; } process.env.NODE_ENV === "production" ? cr.exports = Ir() : cr.exports = zr(); var b = cr.exports, lr = { exports: {} }, Xe = {}; /** * @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 fr; function mr() { if (fr) return Xe; fr = 1; var v = Ke, j = Symbol.for("react.element"), z = Symbol.for("react.fragment"), I = Object.prototype.hasOwnProperty, m = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, O = { key: !0, ref: !0, __self: !0, __source: !0 }; function T(w, M, g) { var s, N = {}, D = null, A = null; g !== void 0 && (D = "" + g), M.key !== void 0 && (D = "" + M.key), M.ref !== void 0 && (A = M.ref); for (s in M) I.call(M, s) && !O.hasOwnProperty(s) && (N[s] = M[s]); if (w && w.defaultProps) for (s in M = w.defaultProps, M) N[s] === void 0 && (N[s] = M[s]); return { $$typeof: j, type: w, key: D, ref: A, props: N, _owner: m.current }; } return Xe.Fragment = z, Xe.jsx = T, Xe.jsxs = T, Xe; } var $e = {}; /** * @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 yr; function Sr() { return yr || (yr = 1, process.env.NODE_ENV !== "production" && function() { var v = Ke, j = Symbol.for("react.element"), z = Symbol.for("react.portal"), I = Symbol.for("react.fragment"), m = Symbol.for("react.strict_mode"), O = Symbol.for("react.profiler"), T = Symbol.for("react.provider"), w = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), s = Symbol.for("react.suspense_list"), N = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), A = Symbol.for("react.offscreen"), x = Symbol.iterator, U = "@@iterator"; function Y(e) { if (e === null || typeof e != "object") return null; var r = x && e[x] || e[U]; return typeof r == "function" ? r : null; } var d = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function c(e) { { for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++) t[n - 1] = arguments[n]; L("error", e, t); } } function L(e, r, t) { { var n = d.ReactDebugCurrentFrame, o = n.getStackAddendum(); o !== "" && (r += "%s", t = t.concat([o])); var u = t.map(function(i) { return String(i); }); u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u); } } var ae = !1, ie = !1, $ = !1, he = !1, ke = !1, Me; Me = Symbol.for("react.module.reference"); function xe(e) { return !!(typeof e == "string" || typeof e == "function" || e === I || e === O || ke || e === m || e === g || e === s || he || e === A || ae || ie || $ || typeof e == "object" && e !== null && (e.$$typeof === D || e.$$typeof === N || e.$$typeof === T || e.$$typeof === w || e.$$typeof === M || // 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. e.$$typeof === Me || e.getModuleId !== void 0)); } function Ue(e, r, t) { var n = e.displayName; if (n) return n; var o = r.displayName || r.name || ""; return o !== "" ? t + "(" + o + ")" : t; } function Ne(e) { return e.displayName || "Context"; } function E(e) { if (e == null) return null; if (typeof e.tag == "number" && c("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function") return e.displayName || e.name || null; if (typeof e == "string") return e; switch (e) { case I: return "Fragment"; case z: return "Portal"; case O: return "Profiler"; case m: return "StrictMode"; case g: return "Suspense"; case s: return "SuspenseList"; } if (typeof e == "object") switch (e.$$typeof) { case w: var r = e; return Ne(r) + ".Consumer"; case T: var t = e; return Ne(t._context) + ".Provider"; case M: return Ue(e, e.render, "ForwardRef"); case N: var n = e.displayName || null; return n !== null ? n : E(e.type) || "Memo"; case D: { var o = e, u = o._payload, i = o._init; try { return E(i(u)); } catch { return null; } } } return null; } var C = Object.assign, R = 0, oe, fe, ye, je, ue, ge, de; function De() { } De.__reactDisabledLog = !0; function Oe() { { if (R === 0) { oe = console.log, fe = console.info, ye = console.warn, je = console.error, ue = console.group, ge = console.groupCollapsed, de = console.groupEnd; var e = { configurable: !0, enumerable: !0, value: De, writable: !0 }; Object.defineProperties(console, { info: e, log: e, warn: e, error: e, group: e, groupCollapsed: e, groupEnd: e }); } R++; } } function Ye() { { if (R--, R === 0) { var e = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: C({}, e, { value: oe }), info: C({}, e, { value: fe }), warn: C({}, e, { value: ye }), error: C({}, e, { value: je }), group: C({}, e, { value: ue }), groupCollapsed: C({}, e, { value: ge }), groupEnd: C({}, e, { value: de }) }); } R < 0 && c("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var K = d.ReactCurrentDispatcher, q; function G(e, r, t) { { if (q === void 0) try { throw Error(); } catch (o) { var n = o.stack.trim().match(/\n( *(at )?)/); q = n && n[1] || ""; } return ` ` + q + e; } } var ee = !1, B; { var be = typeof WeakMap == "function" ? WeakMap : Map; B = new be(); } function Le(e, r) { if (!e || ee) return ""; { var t = B.get(e); if (t !== void 0) return t; } var n; ee = !0; var o = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var u; u = K.current, K.current = null, Oe(); try { if (r) { var i = function() { throw Error(); }; if (Object.defineProperty(i.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(i, []); } catch (k) { n = k; } Reflect.construct(e, [], i); } else { try { i.call(); } catch (k) { n = k; } e.call(i.prototype); } } else { try { throw Error(); } catch (k) { n = k; } e(); } } catch (k) { if (k && n && typeof k.stack == "string") { for (var a = k.stack.split(` `), p = n.stack.split(` `), f = a.length - 1, y = p.length - 1; f >= 1 && y >= 0 && a[f] !== p[y]; ) y--; for (; f >= 1 && y >= 0; f--, y--) if (a[f] !== p[y]) { if (f !== 1 || y !== 1) do if (f--, y--, y < 0 || a[f] !== p[y]) { var S = ` ` + a[f].replace(" at new ", " at "); return e.displayName && S.includes("<anonymous>") && (S = S.replace("<anonymous>", e.displayName)), typeof e == "function" && B.set(e, S), S; } while (f >= 1 && y >= 0); break; } } } finally { ee = !1, K.current = u, Ye(), Error.prepareStackTrace = o; } var V = e ? e.displayName || e.name : "", Fe = V ? G(V) : ""; return typeof e == "function" && B.set(e, Fe), Fe; } function l(e, r, t) { return Le(e, !1); } function J(e) { var r = e.prototype; return !!(r && r.isReactComponent); } function _(e, r, t) { if (e == null) return ""; if (typeof e == "function") return Le(e, J(e)); if (typeof e == "string") return G(e); switch (e) { case g: return G("Suspense"); case s: return G("SuspenseList"); } if (typeof e == "object") switch (e.$$typeof) { case M: return l(e.render); case N: return _(e.type, r, t); case D: { var n = e, o = n._payload, u = n._init; try { return _(u(o), r, t); } catch { } } } return ""; } var P = Object.prototype.hasOwnProperty, se = {}, X = d.ReactDebugCurrentFrame; function W(e) { if (e) { var r = e._owner, t = _(e.type, e._source, r ? r.type : null); X.setExtraStackFrame(t); } else X.setExtraStackFrame(null); } function Re(e, r, t, n, o) { { var u = Function.call.bind(P); for (var i in e) if (u(e, i)) { var a = void 0; try { if (typeof e[i] != "function") { var p = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw p.name = "Invariant Violation", p; } a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (f) { a = f; } a && !(a instanceof Error) && (W(o), c("%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).", n || "React class", t, i, typeof a), W(null)), a instanceof Error && !(a.message in se) && (se[a.message] = !0, W(o), c("Failed %s type: %s", t, a.message), W(null)); } } } var Pe = Array.isArray; function F(e) { return Pe(e); } function pe(e) { { var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object"; return t; } } function Ae(e) { try { return we(e), !1; } catch { return !0; } } function we(e) { return "" + e; } function ce(e) { if (Ae(e)) return c("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", pe(e)), we(e); } var Q = d.ReactCurrentOwner, ve = { key: !0, ref: !0, __self: !0, __source: !0 }, Ie, ze, re; re = {}; function te(e) { if (P.call(e, "ref")) { var r = Object.getOwnPropertyDescriptor(e, "ref").get; if (r && r.isReactWarning) return !1; } return e.ref !== void 0; } function Qe(e) { if (P.call(e, "key")) { var r = Object.getOwnPropertyDescriptor(e, "key").get; if (r && r.isReactWarning) return !1; } return e.key !== void 0; } function Ee(e, r) { if (typeof e.ref == "string" && Q.current && r && Q.current.stateNode !== r) { var t = E(Q.current.type); re[t] || (c('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', E(Q.current.type), e.ref), re[t] = !0); } } function Ce(e, r) { { var t = function() { Ie || (Ie = !0, c("%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)", r)); }; t.isReactWarning = !0, Object.defineProperty(e, "key", { get: t, configurable: !0 }); } } function We(e, r) { { var t = function() { ze || (ze = !0, c("%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)", r)); }; t.isReactWarning = !0, Object.defineProperty(e, "ref", { get: t, configurable: !0 }); } } var h = function(e, r, t, n, o, u, i) { var a = { // This tag allows us to uniquely identify this as a React Element $$typeof: j, // Built-in properties that belong on the element type: e, key: r, ref: t, props: i, // Record the component responsible for creating this element. _owner: u }; return a._store = {}, Object.defineProperty(a._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(a, "_self", { configurable: !1, enumerable: !1, writable: !1, value: n }), Object.defineProperty(a, "_source", { configurable: !1, enumerable: !1, writable: !1, value: o }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a; }; function ne(e, r, t, n, o) { { var u, i = {}, a = null, p = null; t !== void 0 && (ce(t), a = "" + t), Qe(r) && (ce(r.key), a = "" + r.key), te(r) && (p = r.ref, Ee(r, o)); for (u in r) P.call(r, u) && !ve.hasOwnProperty(u) && (i[u] = r[u]); if (e && e.defaultProps) { var f = e.defaultProps; for (u in f) i[u] === void 0 && (i[u] = f[u]); } if (a || p) { var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e; a && Ce(i, y), p && We(i, y); } return h(e, a, p, o, n, Q.current, i); } } var le = d.ReactCurrentOwner, me = d.ReactDebugCurrentFrame; function Z(e) { if (e) { var r = e._owner, t = _(e.type, e._source, r ? r.type : null); me.setExtraStackFrame(t); } else me.setExtraStackFrame(null); } var Se; Se = !1; function Te(e) { return typeof e == "object" && e !== null && e.$$typeof === j; } function Ze() { { if (le.current) { var e = E(le.current.type); if (e) return ` Check the render method of \`` + e + "`."; } return ""; } } function qe(e) { { if (e !== void 0) { var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber; return ` Check your code at ` + r + ":" + t + "."; } return ""; } } var Ve = {}; function er(e) { { var r = Ze(); if (!r) { var t = typeof e == "string" ? e : e.displayName || e.name; t && (r = ` Check the top-level render call using <` + t + ">."); } return r; } } function _e(e, r) { { if (!e._store || e._store.validated || e.key != null) return; e._store.validated = !0; var t = er(r); if (Ve[t]) return; Ve[t] = !0; var n = ""; e && e._owner && e._owner !== le.current && (n = " It was passed a child from " + E(e._owner.type) + "."), Z(e), c('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), Z(null); } } function Ge(e, r) { { if (typeof e != "object") return; if (F(e)) for (var t = 0; t < e.length; t++) { var n = e[t]; Te(n) && _e(n, r); } else if (Te(e)) e._store && (e._store.validated = !0); else if (e) { var o = Y(e); if (typeof o == "function" && o !== e.entries) for (var u = o.call(e), i; !(i = u.next()).done; ) Te(i.value) && _e(i.value, r); } } } function rr(e) { { var r = e.type; if (r == null || typeof r == "string") return; var t; if (typeof r == "function") t = r.propTypes; else if (typeof r == "object" && (r.$$typeof === M || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. r.$$typeof === N)) t = r.propTypes; else return; if (t) { var n = E(r); Re(t, e.props, "prop", n, e); } else if (r.PropTypes !== void 0 && !Se) { Se = !0; var o = E(r); c("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown"); } typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && c("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function tr(e) { { for (var r = Object.keys(e.props), t = 0; t < r.length; t++) { var n = r[t]; if (n !== "children" && n !== "key") { Z(e), c("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), Z(null); break; } } e.ref !== null && (Z(e), c("Invalid attribute `ref` supplied to `React.Fragment`."), Z(null)); } } function Be(e, r, t, n, o, u) { { var i = xe(e); if (!i) { var a = ""; (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " 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 p = qe(o); p ? a += p : a += Ze(); var f; e === null ? f = "null" : F(e) ? f = "array" : e !== void 0 && e.$$typeof === j ? (f = "<" + (E(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : f = typeof e, c("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", f, a); } var y = ne(e, r, t, o, u); if (y == null) return y; if (i) { var S = r.children; if (S !== void 0) if (n) if (F(S)) { for (var V = 0; V < S.length; V++) Ge(S[V], e); Object.freeze && Object.freeze(S); } else c("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 Ge(S, e); } return e === I ? tr(y) : rr(y), y; } } function nr(e, r, t) { return Be(e, r, t, !0); } function ar(e, r, t) { return Be(e, r, t, !1); } var ir = ar, or = nr; $e.Fragment = I, $e.jsx = ir, $e.jsxs = or; }()), $e; } process.env.NODE_ENV === "production" ? lr.exports = mr() : lr.exports = Sr(); var Tr = lr.exports; const Or = (v, j, z, I, m) => { const O = v.getChannelData(0), T = z / (I + m), w = Math.floor(O.length / T), M = j / 2; let g = [], s = 0; for (let N = 0; N < T; N++) { const D = []; let A = 0; const x = []; let U = 0; for (let c = 0; c < w && N * w + c < v.length; c++) { const L = O[N * w + c]; L <= 0 && (D.push(L), A++), L > 0 && (x.push(L), U++); } const Y = D.reduce((c, L) => c + L, 0) / A, d = { max: x.reduce((c, L) => c + L, 0) / U, min: Y }; d.max > s && (s = d.max), Math.abs(d.min) > s && (s = Math.abs(d.min)), g.push(d); } if (M * 0.8 > s * M) { const N = M * 0.8 / s; g = g.map((D) => ({ max: D.max * N, min: D.min * N })); } return g; }, ur = (v, j, z, I, m, O, T, w = 0, M = 1) => { const g = j.height / 2, s = j.getContext("2d"); if (!s) return; s.clearRect(0, 0, j.width, j.height), m !== "transparent" && (s.fillStyle = m, s.fillRect(0, 0, j.width, j.height)); const N = (w || 0) / M; v.forEach((D, A) => { const x = A / v.length, U = N > x; s.fillStyle = U && T ? T : O; const Y = A * (z + I), d = g + D.min, c = z, L = g + D.max - d; s.beginPath(), s.roundRect ? (s.roundRect(Y, d, c, L, 50), s.fill()) : s.fillRect(Y, d, c, L); }); }, pr = wr( ({ blob: v, width: j, height: z, barWidth: I = 2, gap: m = 1, currentTime: O, style: T, backgroundColor: w = "transparent", barColor: M = "rgb(184, 184, 184)", barPlayedColor: g = "rgb(160, 198, 255)" }, s) => { const N = Lr(null), [D, A] = H([]), [x, U] = H(0); return vr( s, () => N.current, [] ), sr(() => { (async () => { if (!N.current) return; if (!v) { const d = Array.from({ length: 100 }, () => ({ max: 0, min: 0 })); ur( d, N.current, I, m, w, M, g ); return; } const Y = await v.arrayBuffer(); await new AudioContext().decodeAudioData(Y, (d) => { if (!N.current) return; U(d.duration); const c = Or( d, z, j, I, m ); A(c), ur( c, N.current, I, m, w, M, g ); }); })(); }, [v, N.current]), sr(() => { N.current && ur( D, N.current, I, m, w, M, g, O, x ); }, [O, x]), /* @__PURE__ */ Tr.jsx( "canvas", { ref: N, width: j, height: z, style: { ...T } } ); } ); pr.displayName = "AudioVisualizer"; const br = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pgo8IS0tIEdlbmVyYXRvcjogQWRvYmUgSWxsdXN0cmF0b3IgMTkuMC4wLCBTVkcgRXhwb3J0IFBsdWctSW4gLiBTVkcgVmVyc2lvbjogNi4wMCBCdWlsZCAwKSAgLS0+CjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDQ5NC4xNDggNDk0LjE0OCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgNDk0LjE0OCA0OTQuMTQ4OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+Cgk8Zz4KCQk8Zz4KCQkJPHBhdGggZD0iTTQwNS4yODQsMjAxLjE4OEwxMzAuODA0LDEzLjI4QzExOC4xMjgsNC41OTYsMTA1LjM1NiwwLDk0Ljc0LDBDNzQuMjE2LDAsNjEuNTIsMTYuNDcyLDYxLjUyLDQ0LjA0NHY0MDYuMTI0CgkJCQljMCwyNy41NCwxMi42OCw0My45OCwzMy4xNTYsNDMuOThjMTAuNjMyLDAsMjMuMi00LjYsMzUuOTA0LTEzLjMwOGwyNzQuNjA4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LjUsNTguODMzMyAtMC41LDMwLjE2NjcgLTAuNSwxLjVDIDAuNSwxLjE2NjY3IDEuMTY2NjcsMC41IDEuNSwtMC41IFoiLz48L2c+CjxnPjxwYXRoIHN0eWxlPSJvcGFjaXR5OjAuOTgxIiBmaWxsPSIjMDAwMDAwIiBkPSJNIDc3LjUsLTAuNSBDIDgwLjUsLTAuNSA4My41LC0wLjUgODYuNSwtMC41QyA4Ny4xNjY3LDAuODMzMzMzIDg4LjE2NjcsMS44MzMzMyA4OS41LDIuNUMgODkuNSwzMC41IDg5LjUsNTguNSA4OS41LDg2LjVDIDg4LjE2NjcsODcuMTY2NyA4Ny4xNjY3LDg4LjE2NjcgODYuNSw4OS41QyA4My41LDg5LjUgODAuNSw4OS41IDc3LjUsODkuNUMgNzYuODc4Myw4OC4zNzM0IDc2LjA0NSw4Ny4zNzM0IDc1LDg2LjVDIDc0LjMzMzMsNTguNSA3NC4zMzMzLDMwLjUgNzUsMi41QyA3Ni4wNDUsMS42MjY1NiA3Ni44NzgzLDAuNjI2NTYxIDc3LjUsLTAuNSBaIi8+PC9nPgo8L3N2Zz4K", gr = ({ isPlaying: v, allowSkip: j, onPlayClick: z, onPauseClick: I, onSkipForwardClick: m, onSkipBackwardClick: O }) => /* @__PURE__ */ b.jsxs( "div", { style: { display: "flex", alignItems: "center", gridColumn: "2 / 2", gap: 15 }, children: [ j && /* @__PURE__ */ b.jsx( "img", { src: jr, onClick: O, title: "Skip backwards", style: { cursor: "pointer", height: 16, width: 16, transform: "rotate(180deg)" }, "data-testid": "skip-back" } ), /* @__PURE__ */ b.jsx( "img", { src: v ? Ar : br, onClick: v ? I : z, title: v ? "Pause" : "Play", style: { cursor: "pointer", height: "20px", width: "20px" }, "data-testid": "play-pause" } ), j && /* @__PURE__ */ b.jsx( "img", { src: jr, onClick: m, title: "Skip forwards", style: { cursor: "pointer", height: 16, width: 16 }, "data-testid": "skip-forward" } ) ] } ), dr = ({ current: v, setCurrent: j, total: z, showTrack: I = !0, showKnob: m = !0, trackHeight: O =