twist-aplayer 1.0.1 → 1.0.2
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.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.mjs +64 -62
- package/dist/twist-aplayer.umd.js +7 -7
- package/package.json +1 -12
package/dist/index.d.ts
CHANGED
|
@@ -80,6 +80,6 @@ declare type PlaylistLoop = 'all' | 'one' | 'none';
|
|
|
80
80
|
|
|
81
81
|
declare type PlaylistOrder = 'list' | 'random';
|
|
82
82
|
|
|
83
|
-
export declare function TwistAPlayer({ audio, appearance, volume, initialLoop, initialOrder, autoPlay, listMaxHeight, mini: _mini, mutex, listFolded, theme }: APlayerProps): JSX_2.Element;
|
|
83
|
+
export declare function TwistAPlayer({ audio, appearance, volume, initialLoop, initialOrder, autoPlay, listMaxHeight, mini: _mini, mutex, listFolded, theme, }: APlayerProps): JSX_2.Element;
|
|
84
84
|
|
|
85
85
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Je;function Ir(){return Je||(Je=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),b=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),T=Symbol.iterator,i="@@iterator";function p(r){if(r===null||typeof r!="object")return null;var u=T&&r[T]||r[i];return typeof u=="function"?u:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(r){{for(var u=arguments.length,h=new Array(u>1?u-1:0),_=1;_<u;_++)h[_-1]=arguments[_];N("error",r,h)}}function N(r,u,h){{var _=E.ReactDebugCurrentFrame,O=_.getStackAddendum();O!==""&&(u+="%s",h=h.concat([O]));var C=h.map(function(
|
|
18
|
-
`+xe+r}}var Se=!1,le;{var mr=typeof WeakMap=="function"?WeakMap:Map;le=new mr}function Me(r,u){if(!r||Se)return"";{var h=le.get(r);if(h!==void 0)return h}var _;Se=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=Ee.current,Ee.current=null,dr();try{if(u){var
|
|
17
|
+
*/var Je;function Ir(){return Je||(Je=1,process.env.NODE_ENV!=="production"&&function(){var e=m,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),y=Symbol.for("react.provider"),b=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),g=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),c=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),T=Symbol.iterator,i="@@iterator";function p(r){if(r===null||typeof r!="object")return null;var u=T&&r[T]||r[i];return typeof u=="function"?u:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(r){{for(var u=arguments.length,h=new Array(u>1?u-1:0),_=1;_<u;_++)h[_-1]=arguments[_];N("error",r,h)}}function N(r,u,h){{var _=E.ReactDebugCurrentFrame,O=_.getStackAddendum();O!==""&&(u+="%s",h=h.concat([O]));var C=h.map(function(j){return String(j)});C.unshift("Warning: "+u),Function.prototype.apply.call(console[r],console,C)}}var $=!1,X=!1,z=!1,V=!1,oe=!1,ie;ie=Symbol.for("react.module.reference");function be(r){return!!(typeof r=="string"||typeof r=="function"||r===a||r===f||oe||r===o||r===d||r===g||V||r===x||$||X||z||typeof r=="object"&&r!==null&&(r.$$typeof===c||r.$$typeof===l||r.$$typeof===y||r.$$typeof===b||r.$$typeof===s||r.$$typeof===ie||r.getModuleId!==void 0))}function ge(r,u,h){var _=r.displayName;if(_)return _;var O=u.displayName||u.name||"";return O!==""?h+"("+O+")":h}function ue(r){return r.displayName||"Context"}function I(r){if(r==null)return null;if(typeof r.tag=="number"&&S("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 a:return"Fragment";case n:return"Portal";case f:return"Profiler";case o:return"StrictMode";case d:return"Suspense";case g:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case b:var u=r;return ue(u)+".Consumer";case y:var h=r;return ue(h._context)+".Provider";case s:return ge(r,r.render,"ForwardRef");case l:var _=r.displayName||null;return _!==null?_:I(r.type)||"Memo";case c:{var O=r,C=O._payload,j=O._init;try{return I(j(C))}catch{return null}}}return null}var D=Object.assign,H=0,U,Q,Z,ee,R,se,$e;function Ae(){}Ae.__reactDisabledLog=!0;function dr(){{if(H===0){U=console.log,Q=console.info,Z=console.warn,ee=console.error,R=console.group,se=console.groupCollapsed,$e=console.groupEnd;var r={configurable:!0,enumerable:!0,value:Ae,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}H++}}function vr(){{if(H--,H===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},r,{value:U}),info:D({},r,{value:Q}),warn:D({},r,{value:Z}),error:D({},r,{value:ee}),group:D({},r,{value:R}),groupCollapsed:D({},r,{value:se}),groupEnd:D({},r,{value:$e})})}H<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ee=E.ReactCurrentDispatcher,xe;function ce(r,u,h){{if(xe===void 0)try{throw Error()}catch(O){var _=O.stack.trim().match(/\n( *(at )?)/);xe=_&&_[1]||""}return`
|
|
18
|
+
`+xe+r}}var Se=!1,le;{var mr=typeof WeakMap=="function"?WeakMap:Map;le=new mr}function Me(r,u){if(!r||Se)return"";{var h=le.get(r);if(h!==void 0)return h}var _;Se=!0;var O=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=Ee.current,Ee.current=null,dr();try{if(u){var j=function(){throw Error()};if(Object.defineProperty(j.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(j,[])}catch(F){_=F}Reflect.construct(r,[],j)}else{try{j.call()}catch(F){_=F}r.call(j.prototype)}}else{try{throw Error()}catch(F){_=F}r()}}catch(F){if(F&&_&&typeof F.stack=="string"){for(var w=F.stack.split(`
|
|
19
19
|
`),k=_.stack.split(`
|
|
20
|
-
`),P=
|
|
21
|
-
`+
|
|
20
|
+
`),P=w.length-1,A=k.length-1;P>=1&&A>=0&&w[P]!==k[A];)A--;for(;P>=1&&A>=0;P--,A--)if(w[P]!==k[A]){if(P!==1||A!==1)do if(P--,A--,A<0||w[P]!==k[A]){var q=`
|
|
21
|
+
`+w[P].replace(" at new "," at ");return r.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",r.displayName)),typeof r=="function"&&le.set(r,q),q}while(P>=1&&A>=0);break}}}finally{Se=!1,Ee.current=C,vr(),Error.prepareStackTrace=O}var G=r?r.displayName||r.name:"",Ge=G?ce(G):"";return typeof r=="function"&&le.set(r,Ge),Ge}function hr(r,u,h){return Me(r,!1)}function pr(r){var u=r.prototype;return!!(u&&u.isReactComponent)}function fe(r,u,h){if(r==null)return"";if(typeof r=="function")return Me(r,pr(r));if(typeof r=="string")return ce(r);switch(r){case d:return ce("Suspense");case g:return ce("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case s:return hr(r.render);case l:return fe(r.type,u,h);case c:{var _=r,O=_._payload,C=_._init;try{return fe(C(O),u,h)}catch{}}}return""}var de=Object.prototype.hasOwnProperty,Ne={},ke=E.ReactDebugCurrentFrame;function ve(r){if(r){var u=r._owner,h=fe(r.type,r._source,u?u.type:null);ke.setExtraStackFrame(h)}else ke.setExtraStackFrame(null)}function yr(r,u,h,_,O){{var C=Function.call.bind(de);for(var j in r)if(C(r,j)){var w=void 0;try{if(typeof r[j]!="function"){var k=Error((_||"React class")+": "+h+" type `"+j+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[j]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw k.name="Invariant Violation",k}w=r[j](u,j,_,h,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(P){w=P}w&&!(w instanceof Error)&&(ve(O),S("%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",h,j,typeof w),ve(null)),w instanceof Error&&!(w.message in Ne)&&(Ne[w.message]=!0,ve(O),S("Failed %s type: %s",h,w.message),ve(null))}}}var br=Array.isArray;function _e(r){return br(r)}function gr(r){{var u=typeof Symbol=="function"&&Symbol.toStringTag,h=u&&r[Symbol.toStringTag]||r.constructor.name||"Object";return h}}function Er(r){try{return qe(r),!1}catch{return!0}}function qe(r){return""+r}function De(r){if(Er(r))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",gr(r)),qe(r)}var Ie=E.ReactCurrentOwner,xr={key:!0,ref:!0,__self:!0,__source:!0},Ve,Fe;function Sr(r){if(de.call(r,"ref")){var u=Object.getOwnPropertyDescriptor(r,"ref").get;if(u&&u.isReactWarning)return!1}return r.ref!==void 0}function _r(r){if(de.call(r,"key")){var u=Object.getOwnPropertyDescriptor(r,"key").get;if(u&&u.isReactWarning)return!1}return r.key!==void 0}function Tr(r,u){typeof r.ref=="string"&&Ie.current}function wr(r,u){{var h=function(){Ve||(Ve=!0,S("%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))};h.isReactWarning=!0,Object.defineProperty(r,"key",{get:h,configurable:!0})}}function jr(r,u){{var h=function(){Fe||(Fe=!0,S("%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))};h.isReactWarning=!0,Object.defineProperty(r,"ref",{get:h,configurable:!0})}}var Or=function(r,u,h,_,O,C,j){var w={$$typeof:t,type:r,key:u,ref:h,props:j,_owner:C};return w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(w,"_self",{configurable:!1,enumerable:!1,writable:!1,value:_}),Object.defineProperty(w,"_source",{configurable:!1,enumerable:!1,writable:!1,value:O}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w};function Rr(r,u,h,_,O){{var C,j={},w=null,k=null;h!==void 0&&(De(h),w=""+h),_r(u)&&(De(u.key),w=""+u.key),Sr(u)&&(k=u.ref,Tr(u,O));for(C in u)de.call(u,C)&&!xr.hasOwnProperty(C)&&(j[C]=u[C]);if(r&&r.defaultProps){var P=r.defaultProps;for(C in P)j[C]===void 0&&(j[C]=P[C])}if(w||k){var A=typeof r=="function"?r.displayName||r.name||"Unknown":r;w&&wr(j,A),k&&jr(j,A)}return Or(r,w,k,O,_,Ie.current,j)}}var Te=E.ReactCurrentOwner,Be=E.ReactDebugCurrentFrame;function Y(r){if(r){var u=r._owner,h=fe(r.type,r._source,u?u.type:null);Be.setExtraStackFrame(h)}else Be.setExtraStackFrame(null)}var we;we=!1;function je(r){return typeof r=="object"&&r!==null&&r.$$typeof===t}function ze(){{if(Te.current){var r=I(Te.current.type);if(r)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+r+"`."}return""}}function Cr(r){return""}var He={};function Lr(r){{var u=ze();if(!u){var h=typeof r=="string"?r:r.displayName||r.name;h&&(u=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+h+">.")}return u}}function We(r,u){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var h=Lr(u);if(He[h])return;He[h]=!0;var _="";r&&r._owner&&r._owner!==Te.current&&(_=" It was passed a child from "+I(r._owner.type)+"."),Y(r),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,_),Y(null)}}function Ue(r,u){{if(typeof r!="object")return;if(_e(r))for(var h=0;h<r.length;h++){var _=r[h];
|
|
25
|
+
Check the top-level render call using <`+h+">.")}return u}}function We(r,u){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var h=Lr(u);if(He[h])return;He[h]=!0;var _="";r&&r._owner&&r._owner!==Te.current&&(_=" It was passed a child from "+I(r._owner.type)+"."),Y(r),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,_),Y(null)}}function Ue(r,u){{if(typeof r!="object")return;if(_e(r))for(var h=0;h<r.length;h++){var _=r[h];je(_)&&We(_,u)}else if(je(r))r._store&&(r._store.validated=!0);else if(r){var O=p(r);if(typeof O=="function"&&O!==r.entries)for(var C=O.call(r),j;!(j=C.next()).done;)je(j.value)&&We(j.value,u)}}}function Pr(r){{var u=r.type;if(u==null||typeof u=="string")return;var h;if(typeof u=="function")h=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===s||u.$$typeof===l))h=u.propTypes;else return;if(h){var _=I(u);yr(h,r.props,"prop",_,r)}else if(u.PropTypes!==void 0&&!we){we=!0;var O=I(u);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",O||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $r(r){{for(var u=Object.keys(r.props),h=0;h<u.length;h++){var _=u[h];if(_!=="children"&&_!=="key"){Y(r),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",_),Y(null);break}}r.ref!==null&&(Y(r),S("Invalid attribute `ref` supplied to `React.Fragment`."),Y(null))}}function Ye(r,u,h,_,O,C){{var j=be(r);if(!j){var w="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(w+=" 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 k=Cr();k?w+=k:w+=ze();var P;r===null?P="null":_e(r)?P="array":r!==void 0&&r.$$typeof===t?(P="<"+(I(r.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):P=typeof r,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",P,w)}var A=Rr(r,u,h,O,C);if(A==null)return A;if(j){var q=u.children;if(q!==void 0)if(_)if(_e(q)){for(var G=0;G<q.length;G++)Ue(q[G],r);Object.freeze&&Object.freeze(q)}else S("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 Ue(q,r)}return r===a?$r(A):Pr(A),A}}function Ar(r,u,h){return Ye(r,u,h,!0)}function Mr(r,u,h){return Ye(r,u,h,!1)}var Nr=Mr,kr=Ar;te.Fragment=a,te.jsx=Nr,te.jsxs=kr}()),te}var Xe;function Vr(){return Xe||(Xe=1,process.env.NODE_ENV==="production"?me.exports=Dr():me.exports=Ir()),me.exports}var v=Vr(),he=e=>`--${e}`,Qe=e=>`var(--${e})`,Ze=(e,t)=>`--${e}: ${t};`;function Fr(e,t){const n=a=>t;return{b:()=>`${n()}-${e}`,be:a=>`${n()}-${e}__${a}`,bm:a=>`${n()}-${e}--${a}`,bem:(a,o)=>`${n()}-${e}__${a}--${o}`,bs:a=>`${n()}-${e}-${a}`,ns:a=>`${n()}-${a}`,cb:()=>`.${n()}-${e}`,cbe:a=>`.${n()}-${e}__${a}`,cbm:a=>`.${n()}-${e}--${a}`,cbem:(a,o)=>`.${n()}-${e}__${a}--${o}`,cbs:a=>`.${n()}-${e}-${a}`,cns:a=>`.${n()}-${a}`,cv:a=>he(`${n()}-${e}-${a}`),cvm:(a,o={})=>{const f=n();for(const y of Object.keys(a))o[he(`${f}-${e}-${y}`)]=a[y];return o},gcv:a=>Qe(`${n()}-${e}-${a}`),scv:(a,o)=>Ze(`${n()}-${e}-${a}`,o),nv:a=>he(`${n()}-${a}`),nvm:(a,o={})=>{const f=n();for(const y of Object.keys(a))o[he(`${f}-${y}`)]=a[y];return o},gnv:a=>Qe(`${n()}-${a}`),snv:(a,o)=>Ze(`${n()}-${a}`,o)}}function B(e){return m.useMemo(()=>Fr(e,"twist"),[e])}function Oe(e,t){if(!t.current)return 0;let n=(e.clientX-t.current.getBoundingClientRect().left)/t.current.clientWidth;return n=Math.max(n,0),n=Math.min(n,1),n=Math.floor(n*100)/100,n}function Re(e,t){if(!t.current)return 0;let n=1-(e.clientY-t.current.getBoundingClientRect().top)/t.current.clientHeight;return n=Math.max(n,0),n=Math.min(n,1),n=Math.floor(n*100)/100,n}var ur={color:void 0,size:void 0,className:void 0,style:void 0,attrs:void 0},Pe=J.createContext(ur);Pe.Provider;function ne(e){"@babel/helpers - typeof";return ne=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},ne(e)}var Br=["attrs","size","title","spin","rotate","color"];function zr(e,t){return Ur(e)||Wr(e,t)||sr(e,t)||Hr()}function Hr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
26
26
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wr(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,o,f,y,b=[],s=!0,d=!1;try{if(f=(n=n.call(e)).next,t!==0)for(;!(s=(a=f.call(n)).done)&&(b.push(a.value),b.length!==t);s=!0);}catch(g){d=!0,o=g}finally{try{if(!s&&n.return!=null&&(y=n.return(),Object(y)!==y))return}finally{if(d)throw o}}return b}}function Ur(e){if(Array.isArray(e))return e}function Yr(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=sr(e))||t){n&&(e=n);var a=0,o=function(){};return{s:o,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(d){throw d},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
27
27
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var f,y=!0,b=!1;return{s:function(){n=n.call(e)},n:function(){var d=n.next();return y=d.done,d},e:function(d){b=!0,f=d},f:function(){try{y||n.return==null||n.return()}finally{if(b)throw f}}}}function sr(e,t){if(e){if(typeof e=="string")return er(e,t);var n={}.toString.call(e).slice(8,-1);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)?er(e,t):void 0}}function er(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},ye.apply(null,arguments)}function rr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,a)}return n}function ae(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?rr(Object(n),!0).forEach(function(a){Gr(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rr(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function Gr(e,t,n){return(t=Kr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kr(e){var t=Jr(e,"string");return ne(t)=="symbol"?t:t+""}function Jr(e,t){if(ne(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(ne(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xr(e,t){if(e==null)return{};var n,a,o=Qr(e,t);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(e);for(a=0;a<f.length;a++)n=f[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function Qr(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}function Zr(e){var t=e.attrs,n=e.size,a=e.title,o=e.spin,f=e.rotate,y=e.color,b=Xr(e,Br),s=function(g){var l=n||g.size||"1em",c,x="",T="";return g.className&&(c=g.className),e.className&&(c=c?"".concat(c," ").concat(e.className):e.className),o&&(c?c+=" twist-icon-loading":c="twist-icon-loading"),f&&(x="rotate(".concat(f,"deg)"),T="rotate(".concat(f,"deg)")),J.createElement("svg",ye({xmlns:"http://www.w3.org/2000/svg"},g.attrs,t,b,{className:c,style:ae(ae({color:y||g.color,msTransform:x,transform:T},g.style),e.style),width:l,height:l}),a&&J.createElement("title",null,a),e.children)};return Pe!==void 0?J.createElement(Pe.Consumer,null,function(d){return s(d)}):s(ur)}function et(e){var t={},n=e.split(";"),a=Yr(n),o;try{for(a.s();!(o=a.n()).done;){var f=o.value,y=f.split(":"),b=zr(y,2),s=b[0],d=b[1];if(s&&d){var g=s.trim().replace(/-./g,function(l){return l.charAt(1).toUpperCase()});t[g]=d.trim()}}}catch(l){a.e(l)}finally{a.f()}return t}function cr(e){return e&&e.map(function(t,n){return J.createElement(t.tag,ae(ae({},t.attrs),{},{key:n,style:t.attrs.style?et(t.attrs.style):null}),cr(t.children))})}function M(e){return function(t){return J.createElement(Zr,ye({attrs:ae({},e.attrs)},t),cr(e.children))}}function rt(e){return M({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)}function tt(e){return M({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M18.25 12L8.5 17.629V6.37z"}}]})(e)}function lr(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=lr(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function L(){for(var e,t,n=0,a="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=lr(e))&&(a&&(a+=" "),a+=t);return a}function nt({bufferedPercentage:e,playedPercentage:t,onSeek:n}){const a=B("aplayer-bar"),o=B("aplayer-icon"),f=m.useRef(null),[y,b]=m.useState(t),s=m.useRef(!1);m.useEffect(()=>{s.current||b(t)},[t]);const d=m.useCallback(g=>{s.current=!0;const l=Oe(g,f);b(l);const c=T=>{const i=Oe(T,f);b(i)},x=T=>{document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",x);const i=Oe(T,f);b(i),n==null||n(i),s.current=!1};document.addEventListener("mousemove",c),document.addEventListener("mouseup",x)},[n]);return v.jsx("div",{ref:f,className:L(a.b(),a.bs("vars")),onMouseDown:d,children:v.jsxs("div",{className:a.be("inner"),children:[typeof e<"u"?v.jsx("div",{className:a.be("loaded"),style:{width:`${e*100}%`}}):null,typeof y<"u"?v.jsx("div",{className:a.be("played"),style:{width:`${y*100}%`},children:v.jsx("span",{className:a.be("thumb"),children:v.jsx("span",{className:L(o.bs("loading")),children:v.jsx(rt,{})})})}):null]})})}function at(e){return M({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 ot(e){return M({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 it(e){return M({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14 19V5h4v14zm-8 0V5h4v14z"}}]})(e)}function ut(e){return M({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 st(e){return M({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 ct(e){return M({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 lt(e){return M({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 ft(e){return M({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7 15V9h4l5-5v16l-5-5z"}}]})(e)}function dt(e){return M({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 vt({volume:e,muted:t,onToggleMuted:n,onChangeVolume:a}){const o=B("aplayer-volumn"),f=B("aplayer-icon"),y=m.useRef(null),[b,s]=m.useState(!1),d=m.useCallback(g=>{a(Re(g,y)),s(!0);const l=x=>{a(Re(x,y))},c=x=>{document.removeEventListener("mouseup",c),document.removeEventListener("mousemove",l),s(!1),a(Re(x,y))};document.addEventListener("mousemove",l),document.addEventListener("mouseup",c)},[a]);return v.jsxs("div",{className:L(o.b(),o.bs("vars")),children:[v.jsx("button",{type:"button",className:L(f.b(),f.bs("volume-down")),onClick:()=>n(),children:t||!e?v.jsx(ft,{}):e>=1?v.jsx(dt,{}):v.jsx(lt,{})}),v.jsx("div",{className:L(o.be("bar-wrap"),{[o.bem("bar-wrap","active")]:b}),ref:y,onMouseDown:d,children:v.jsx("div",{className:o.be("bar"),children:v.jsx("div",{className:o.be("thumb"),style:{height:t?0:`${e*100}%`}})})})]})}function tr(e){if(typeof e>"u")return"--:--";if(Number.isNaN(e))return"00:00";const t=y=>y<10?`0${y}`:`${y}`,n=Math.trunc(e/60),a=Math.trunc(e-n*60),o=Math.trunc(n/60),f=Math.trunc(e/60-60*Math.trunc(e/60/60));return e>=3600?`${t(o)}:${t(f)}:${t(a)}`:`${t(n)}:${t(a)}`}function mt(e){return M({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 ht(e){return M({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 pt(e){return M({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"}}]})(e)}function yt(e){return M({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 bt(e){return M({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 gt({volume:e,onChangeVolume:t,muted:n,currentTime:a,audioDurationSeconds:o,bufferedSeconds:f,onToggleMenu:y,onToggleMuted:b,order:s,onOrderChange:d,loop:g,onLoopChange:l,onSeek:c,isPlaying:x,onTogglePlay:T,onSkipForward:i,onSkipBack:p,showLyrics:E=!0,onToggleLyrics:S}){const N=B("aplayer-controller"),$=B("aplayer-icon"),X=m.useCallback(()=>{const V={list:"random",random:"list"}[s];d(V)},[s,d]),z=m.useCallback(()=>{const V={all:"one",one:"none",none:"all"}[g];l(V)},[g,l]);return v.jsxs("div",{className:L(N.b(),N.bs("vars")),children:[v.jsx(nt,{playedPercentage:typeof a>"u"||typeof o>"u"?void 0:a/o,bufferedPercentage:typeof f>"u"||typeof o>"u"?void 0:f/o,onSeek:V=>c==null?void 0:c(V*o)}),v.jsxs("div",{className:N.be("time"),children:[v.jsxs("span",{className:N.be("time-inner"),children:[v.jsx("span",{className:N.be("ptime"),children:tr(a)})," / ",v.jsx("span",{className:N.be("dtime"),children:tr(o)})]}),v.jsx("span",{className:L($.b(),$.bs("back")),onClick:p,children:v.jsx(mt,{})}),v.jsx("span",{className:L($.b(),$.bs("play")),onClick:T,children:x?v.jsx(it,{}):v.jsx(ut,{})}),v.jsx("span",{className:L($.b(),$.bs("forward")),onClick:i,children:v.jsx(ht,{})}),v.jsx(vt,{volume:e,muted:n,onToggleMuted:b,onChangeVolume:t}),v.jsx("button",{className:L($.b(),$.bs("order")),onClick:X,type:"button",children:{list:v.jsx(at,{}),random:v.jsx(bt,{})}[s]}),v.jsx("button",{className:L($.b(),$.bs("order")),onClick:z,type:"button",children:{all:v.jsx(ct,{}),one:v.jsx(st,{}),none:v.jsx(yt,{})}[g]}),v.jsx("button",{type:"button",className:L($.b(),$.bs("menu")),onClick:()=>y==null?void 0:y(),children:v.jsx(pt,{})}),v.jsx("button",{type:"button",className:L($.b(),$.bs("lrc"),{[$.ns("lrc-inactivity")]:!E}),onClick:S,children:v.jsx(ot,{})})]})]})}function Et({open:e,audio:t,playingAudioUrl:n,onPlayAudio:a,listMaxHeight:o}){const f=B("aplayer-list"),y=o?{maxHeight:o}:void 0,b=m.useCallback(d=>d?typeof d=="string"?d:d.name??"Audio artist":"Audio artist",[]),s=m.useRef(null);return m.useEffect(()=>{if(s.current){const d=s.current;return d.style.maxHeight=`${Math.min(d.scrollHeight,o??1/0)}px`,()=>{d.removeAttribute("style")}}},[o]),v.jsx("div",{ref:s,className:L(f.b(),{[f.bm("hide")]:!e}),children:v.jsx("ol",{style:y,children:t.map((d,g)=>v.jsxs("li",{className:L({[f.bm("active")]:d.url===n}),onClick:()=>{d.url!==n&&(a==null||a(d))},children:[v.jsx("span",{className:f.be("cur")}),v.jsx("span",{className:f.be("index"),children:g+1}),v.jsx("span",{className:f.be("title"),children:d.name??"Audio name"}),v.jsx("span",{className:f.be("author"),children:b(d.artist)})]},d.name||g))})})}function nr({show:e,lrcText:t,currentTime:n}){const a=B("aplayer-lrc"),o=m.useMemo(()=>xt(t),[t]),f=m.useMemo(()=>{for(let b=0;b<o.length;b++){const s=o[b],d=o[b+1];if(n>=s[0]&&(!d||n<d[0]))return b}return 0},[n,o]),y=m.useMemo(()=>({transform:`translateY(${-f*16}px)`,WebkitTransform:`translateY(${-f*16}px)`}),[f]);return v.jsx("div",{className:L(a.b(),{[a.bm("hide")]:!e}),children:t?v.jsx("div",{className:a.be("contents"),style:y,children:o.map(([,b],s)=>v.jsx("p",{className:L({[a.be("current")]:s===f}),children:b},s))}):null})}function xt(e){if(e){e=e.replace(/([^\]^\n])\[/g,(o,f)=>`${f}
|
|
28
28
|
[`);const t=e.split(`
|
|
@@ -42,4 +42,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the MIT license found in the
|
|
44
44
|
* LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/var or;function _t(){return or||(or=1,process.env.NODE_ENV!=="production"&&function(){function e(x,T){return x===T&&(x!==0||1/x===1/T)||x!==x&&T!==T}function t(x,T){g||o.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 will not work correctly. Upgrade to a newer pre-release."));var i=T();if(!l){var p=T();f(i,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}p=y({inst:{value:i,getSnapshot:T}});var E=p[0].inst,S=p[1];return s(function(){E.value=i,E.getSnapshot=T,n(E)&&S({inst:E})},[x,i,T]),b(function(){return n(E)&&S({inst:E}),x(function(){n(E)&&S({inst:E})})},[x]),d(i),i}function n(x){var T=x.getSnapshot;x=x.value;try{var i=T();return!f(x,i)}catch{return!0}}function a(x,T){return T()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=m,f=typeof Object.is=="function"?Object.is:e,y=o.useState,b=o.useEffect,s=o.useLayoutEffect,d=o.useDebugValue,g=!1,l=!1,c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?a:t;Le.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Le}var ir;function Tt(){return ir||(ir=1,process.env.NODE_ENV==="production"?pe.exports=St():pe.exports=_t()),pe.exports}var W=Tt();const K=[];function jt(e){const t=m.useRef();if(typeof document<"u"&&!t.current){const n=t.current=document.createElement("audio");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),K.includes(n)||K.push(n)}return m.useEffect(()=>{const n=t.current;if(n&&(e!=null&&e.onError))return n.addEventListener("error",e.onError),()=>{n.removeEventListener("error",e.onError)}},[e==null?void 0:e.onError]),m.useEffect(()=>{const n=t.current;if(n&&(e!=null&&e.onEnded))return n.addEventListener("ended",e.onEnded),()=>{n.removeEventListener("ended",e.onEnded)}},[e==null?void 0:e.onEnded]),m.useEffect(()=>()=>{const n=t.current;if(n){n.pause(),n.currentTime=0;const a=K.indexOf(n);a!==-1&&K.splice(a,1)}t.current=void 0},[]),t}function wt(e){const t=jt(e),n=m.useCallback(i=>{for(let p=0;p<K.length;p++){const E=K[p];E!==i&&!E.paused&&E.pause()}},[]),a=m.useCallback(async i=>{var E;const p=t.current;if(p){e.mutex&&n(p),p.src!==i&&(p.pause(),p.currentTime=0,p.src=i);try{await((E=t.current)==null?void 0:E.play())}catch{}}},[t,e.mutex,n]),o=m.useCallback(i=>{const p=t.current;p&&(p.paused?a(i):p.pause())},[t,a]),f=m.useCallback(i=>{t.current.currentTime=i},[t]),y=m.useCallback(()=>{t.current&&(t.current.muted=!t.current.muted)},[t]),b=m.useCallback(i=>{t.current&&(t.current.volume=i)},[t]),s=W.useSyncExternalStore(m.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("volumechange",i),()=>{var E;(E=t.current)==null||E.removeEventListener("volumechange",i)}},[t]),()=>{var i;return(i=t.current)==null?void 0:i.volume},()=>{}),d=W.useSyncExternalStore(m.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("volumechange",i),()=>{var E;(E=t.current)==null||E.removeEventListener("volumechange",i)}},[t]),()=>{var i;return(i=t.current)==null?void 0:i.muted},()=>{}),g=W.useSyncExternalStore(m.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("timeupdate",i),()=>{var E;(E=t.current)==null||E.removeEventListener("timeupdate",i)}},[t]),()=>{if(t.current)return Math.round(t.current.currentTime)},()=>{}),l=W.useSyncExternalStore(m.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("durationchange",i),()=>{var E;(E=t.current)==null||E.removeEventListener("durationchange",i)}},[t]),()=>{var i;return(i=t.current)==null?void 0:i.duration},()=>{}),c=W.useSyncExternalStore(m.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("progress",i),()=>{var E;(E=t.current)==null||E.removeEventListener("progress",i)}},[t]),()=>{const i=t.current;return i&&i.buffered.length>0?i.buffered.end(i.buffered.length-1):0},()=>{}),x=W.useSyncExternalStore(m.useCallback(i=>{var p,E;return(p=t.current)==null||p.addEventListener("play",i),(E=t.current)==null||E.addEventListener("pause",i),()=>{var S,N;(S=t.current)==null||S.removeEventListener("play",i),(N=t.current)==null||N.removeEventListener("pause",i)}},[t]),()=>{const i=t.current;return i?!i.paused:!1},()=>{}),T=W.useSyncExternalStore(m.useCallback(i=>{var p,E;return(p=t.current)==null||p.addEventListener("playing",i),(E=t.current)==null||E.addEventListener("waiting",i),()=>{var S,N;(S=t.current)==null||S.removeEventListener("playing",i),(N=t.current)==null||N.removeEventListener("waiting",i)}},[t]),()=>{const i=t.current;return i?i.networkState===i.NETWORK_LOADING:!1},()=>{});return{playAudio:a,togglePlay:o,seek:f,toggleMuted:y,setVolume:b,volume:s,muted:d,currentTime:g,duration:l,bufferedSeconds:c,isPlaying:x,isLoading:T}}function fr(){const e=m.useRef([]);return m.useEffect(()=>{const n=e.current;return()=>{for(const a of n)clearTimeout(a)}},[]),m.useCallback((n,a)=>{const o=setTimeout(n,a);return e.current.push(o),o},[])}function Ot(){const e=m.useRef(),[t,n]=m.useState({text:"",style:{opacity:0}}),a=fr(),o=m.useCallback((f,y=2e3)=>{e.current&&clearTimeout(e.current),n({text:f,style:{opacity:1}}),e.current=a(()=>{n({text:f,style:{opacity:0}})},y)},[a]);return[t,o]}function Rt(e){return Ct(e.slice())}function Ct(e){let t=e.length,n;for(;t!==0;)n=Math.floor(Math.random()*t),t--,[e[t],e[n]]=[e[n],e[t]];return e}function Lt(e,{initialLoop:t="all",initialOrder:n="list",getSongId:a}){const[o,f]=m.useState(t),[y,b]=m.useState(n),s=m.useMemo(()=>y==="list"?e:Rt(e),[e,y]),[d,g]=m.useState(s[0]);m.useEffect(()=>{const i=s.find(p=>a(p)===a(d));g(i||s[0])},[s,a,d]);const l=m.useMemo(()=>{if(o==="one")return{...d};const i=s.indexOf(d);if(i<s.length-1)return s[i+1];if(o!=="none")return s[0]},[s,d,o]),c=m.useCallback(()=>{l&&g(l)},[l,o]),x=m.useCallback(()=>{g(i=>{const p=s.indexOf(i);return p>0?s[p-1]:i})},[s]),T=m.useCallback(i=>{g(i)},[]);return{currentSong:d,hasNextSong:typeof l<"u",next:c,previous:x,prioritize:T,order:y,setOrder:b,loop:o,setLoop:f,length:s.length}}function Pt(e){return M({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 $t(e){return M({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 At({audio:e,appearance:t="normal",volume:n=.7,initialLoop:a,initialOrder:o,autoPlay:f=!1,listMaxHeight:y=250,mini:b=!1,mutex:s=!0,listFolded:d=!1,theme:g="light"}){var Q,Z,ee;const l=B("aplayer"),c=Lt(Array.isArray(e)?e:[e],{initialLoop:a,initialOrder:o,getSongId:R=>R.url}),[x,T]=Ot(),i=fr(),p=m.useRef(),E=m.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=void 0)},[]),S=wt({src:c.currentSong.url,initialVolume:n,autoPlay:f,mutex:s,onError(R){const{error:se}=R.target;se&&T("An audio error has occurred, player will skip forward in 2 seconds."),c.hasNextSong&&(p.current=i(()=>{c.next()},2e3))},onEnded(){c.hasNextSong&&c.next()}});m.useEffect(()=>{f&&S.playAudio(c.currentSong.url)},[]);const N=m.useRef(!0);m.useEffect(()=>{N.current?N.current=!1:c.currentSong&&S.playAudio(c.currentSong.url)},[c.currentSong,S.playAudio]);const $=m.useCallback(()=>{E(),S.togglePlay(c.currentSong.url)},[S,E,c.currentSong.url]),X=m.useCallback(R=>R?typeof R=="string"?R:R.url?v.jsx("a",{href:R.url,target:"_blank",rel:"noreferrer",children:R.name??"Audio artist"}):R.name??"Audio artist":"Audio artist",[]),z=c.length>1,V=m.useMemo(()=>Array.isArray(e)?e:[e],[e]),{prioritize:oe}=c,ie=m.useCallback(R=>{E(),oe(R)},[E,oe]),[be,ge]=m.useState(()=>z&&!d),[ue,I]=m.useState(b),[D,H]=m.useState(!0),U=m.useRef(null);return m.useEffect(()=>{I(b)},[b]),m.useEffect(()=>{if(t==="fixed"&&U.current){const R=U.current;return R.style.width=`${R.offsetWidth-18}px`,()=>{R.removeAttribute("style")}}},[t]),v.jsxs("div",{className:L(l.b(),{[l.bs(g)]:!0,[l.bs("vars")]:!0,[l.bm("fixed")]:t==="fixed",[l.bm("loading")]:S.isLoading,[l.bm("withlist")]:z,[l.bm("withlrc")]:!!c.currentSong.lrc&&t!=="fixed",[l.bm("narrow")]:ue}),children:[v.jsxs("div",{ref:U,className:l.be("body"),children:[v.jsx("div",{className:l.be("pic"),onClick:$,style:{backgroundImage:`url("${(Q=c.currentSong)==null?void 0:Q.cover}")`},children:v.jsx("div",{className:L(l.be("button"),S.isPlaying?l.bm("pause"):l.bm("play")),children:S.isPlaying?v.jsx($t,{}):v.jsx(tt,{})})}),v.jsxs("div",{className:L(l.be("info")),children:[v.jsxs("div",{className:L(l.be("music")),children:[v.jsx("span",{className:L(l.be("title")),children:((Z=c.currentSong)==null?void 0:Z.name)??"Audio name"}),v.jsxs("span",{className:L(l.be("author")),children:[" ","-"," ",X((ee=c.currentSong)==null?void 0:ee.artist)]})]}),t==="fixed"?null:v.jsx(nr,{show:D,lrcText:c.currentSong.lrc,currentTime:S.currentTime??0}),v.jsx(gt,{volume:S.volume??n,onChangeVolume:S.setVolume,muted:S.muted??!1,onToggleMuted:()=>S.toggleMuted(),currentTime:S.currentTime,audioDurationSeconds:S.duration,bufferedSeconds:S.bufferedSeconds,onSeek:R=>S.seek(R),onToggleMenu:()=>ge(R=>!R),order:c.order,onOrderChange:c.setOrder,loop:c.loop,onLoopChange:c.setLoop,isPlaying:S.isPlaying??!1,onTogglePlay:$,onSkipForward:()=>{c.hasNextSong&&c.next()},onSkipBack:()=>{c.previous()},showLyrics:D,onToggleLyrics:()=>{H(R=>!R)}})]}),v.jsx("div",{className:l.be("notice"),style:x.style,children:x.text}),v.jsx("div",{className:l.be("miniswitcher"),onClick:()=>I(R=>!R),children:v.jsx("button",{className:l.bs("icon"),type:"button",children:v.jsx(Pt,{})})})]}),z?v.jsx(Et,{open:be,audio:V,playingAudioUrl:c.currentSong.url,onPlayAudio:ie,listMaxHeight:y}):null,t==="fixed"&&v.jsx(nr,{show:D,lrcText:c.currentSong.lrc,currentTime:S.currentTime??0})]})}exports.TwistAPlayer=At;
|
|
45
|
+
*/var or;function _t(){return or||(or=1,process.env.NODE_ENV!=="production"&&function(){function e(x,T){return x===T&&(x!==0||1/x===1/T)||x!==x&&T!==T}function t(x,T){g||o.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 will not work correctly. Upgrade to a newer pre-release."));var i=T();if(!l){var p=T();f(i,p)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}p=y({inst:{value:i,getSnapshot:T}});var E=p[0].inst,S=p[1];return s(function(){E.value=i,E.getSnapshot=T,n(E)&&S({inst:E})},[x,i,T]),b(function(){return n(E)&&S({inst:E}),x(function(){n(E)&&S({inst:E})})},[x]),d(i),i}function n(x){var T=x.getSnapshot;x=x.value;try{var i=T();return!f(x,i)}catch{return!0}}function a(x,T){return T()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var o=m,f=typeof Object.is=="function"?Object.is:e,y=o.useState,b=o.useEffect,s=o.useLayoutEffect,d=o.useDebugValue,g=!1,l=!1,c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?a:t;Le.useSyncExternalStore=o.useSyncExternalStore!==void 0?o.useSyncExternalStore:c,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Le}var ir;function Tt(){return ir||(ir=1,process.env.NODE_ENV==="production"?pe.exports=St():pe.exports=_t()),pe.exports}var W=Tt();const K=[];function wt(e){const t=m.useRef();if(typeof window<"u"&&!t.current){const n=t.current=document.createElement("audio");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),K.includes(n)||K.push(n)}return m.useEffect(()=>{if(typeof window>"u")return;const n=t.current;if(n&&(e!=null&&e.onError))return n.addEventListener("error",e.onError),()=>{n.removeEventListener("error",e.onError)}},[e==null?void 0:e.onError]),m.useEffect(()=>{if(typeof window>"u")return;const n=t.current;if(n&&(e!=null&&e.onEnded))return n.addEventListener("ended",e.onEnded),()=>{n.removeEventListener("ended",e.onEnded)}},[e==null?void 0:e.onEnded]),m.useEffect(()=>()=>{const n=t.current;if(n){n.pause(),n.currentTime=0;const a=K.indexOf(n);a!==-1&&K.splice(a,1)}t.current=void 0},[]),t}function jt(e){const t=wt(e),n=m.useCallback(i=>{for(let p=0;p<K.length;p++){const E=K[p];E!==i&&!E.paused&&E.pause()}},[]),a=m.useCallback(async i=>{var E;const p=t.current;if(p){e.mutex&&n(p),p.src!==i&&(p.pause(),p.currentTime=0,p.src=i);try{await((E=t.current)==null?void 0:E.play())}catch{}}},[t,e.mutex,n]),o=m.useCallback(i=>{const p=t.current;p&&(p.paused?a(i):p.pause())},[t,a]),f=m.useCallback(i=>{t.current.currentTime=i},[t]),y=m.useCallback(()=>{t.current&&(t.current.muted=!t.current.muted)},[t]),b=m.useCallback(i=>{t.current&&(t.current.volume=i)},[t]),s=W.useSyncExternalStore(m.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("volumechange",i),()=>{var E;(E=t.current)==null||E.removeEventListener("volumechange",i)}},[t]),()=>{var i;return(i=t.current)==null?void 0:i.volume},()=>{}),d=W.useSyncExternalStore(m.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("volumechange",i),()=>{var E;(E=t.current)==null||E.removeEventListener("volumechange",i)}},[t]),()=>{var i;return(i=t.current)==null?void 0:i.muted},()=>{}),g=W.useSyncExternalStore(m.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("timeupdate",i),()=>{var E;(E=t.current)==null||E.removeEventListener("timeupdate",i)}},[t]),()=>{if(t.current)return Math.round(t.current.currentTime)},()=>{}),l=W.useSyncExternalStore(m.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("durationchange",i),()=>{var E;(E=t.current)==null||E.removeEventListener("durationchange",i)}},[t]),()=>{var i;return(i=t.current)==null?void 0:i.duration},()=>{}),c=W.useSyncExternalStore(m.useCallback(i=>{var p;return(p=t.current)==null||p.addEventListener("progress",i),()=>{var E;(E=t.current)==null||E.removeEventListener("progress",i)}},[t]),()=>{const i=t.current;return i&&i.buffered.length>0?i.buffered.end(i.buffered.length-1):0},()=>{}),x=W.useSyncExternalStore(m.useCallback(i=>{var p,E;return(p=t.current)==null||p.addEventListener("play",i),(E=t.current)==null||E.addEventListener("pause",i),()=>{var S,N;(S=t.current)==null||S.removeEventListener("play",i),(N=t.current)==null||N.removeEventListener("pause",i)}},[t]),()=>{const i=t.current;return i?!i.paused:!1},()=>{}),T=W.useSyncExternalStore(m.useCallback(i=>{var p,E;return(p=t.current)==null||p.addEventListener("playing",i),(E=t.current)==null||E.addEventListener("waiting",i),()=>{var S,N;(S=t.current)==null||S.removeEventListener("playing",i),(N=t.current)==null||N.removeEventListener("waiting",i)}},[t]),()=>{const i=t.current;return i?i.networkState===i.NETWORK_LOADING:!1},()=>{});return{playAudio:a,togglePlay:o,seek:f,toggleMuted:y,setVolume:b,volume:s,muted:d,currentTime:g,duration:l,bufferedSeconds:c,isPlaying:x,isLoading:T}}function fr(){const e=m.useRef([]);return m.useEffect(()=>{const n=e.current;return()=>{for(const a of n)clearTimeout(a)}},[]),m.useCallback((n,a)=>{const o=setTimeout(n,a);return e.current.push(o),o},[])}function Ot(){const e=m.useRef(),[t,n]=m.useState({text:"",style:{opacity:0}}),a=fr(),o=m.useCallback((f,y=2e3)=>{e.current&&clearTimeout(e.current),n({text:f,style:{opacity:1}}),e.current=a(()=>{n({text:f,style:{opacity:0}})},y)},[a]);return[t,o]}function Rt(e){return Ct(e.slice())}function Ct(e){let t=e.length,n;for(;t!==0;)n=Math.floor(Math.random()*t),t--,[e[t],e[n]]=[e[n],e[t]];return e}function Lt(e,{initialLoop:t="all",initialOrder:n="list",getSongId:a}){const[o,f]=m.useState(t),[y,b]=m.useState(n),s=m.useMemo(()=>y==="list"?e:Rt(e),[e,y]),[d,g]=m.useState(s[0]);m.useEffect(()=>{const i=s.find(p=>a(p)===a(d));g(i||s[0])},[s,a,d]);const l=m.useMemo(()=>{if(o==="one")return{...d};const i=s.indexOf(d);if(i<s.length-1)return s[i+1];if(o!=="none")return s[0]},[s,d,o]),c=m.useCallback(()=>{l&&g(l)},[l,o]),x=m.useCallback(()=>{g(i=>{const p=s.indexOf(i);return p>0?s[p-1]:i})},[s]),T=m.useCallback(i=>{g(i)},[]);return{currentSong:d,hasNextSong:typeof l<"u",next:c,previous:x,prioritize:T,order:y,setOrder:b,loop:o,setLoop:f,length:s.length}}function Pt(e){return M({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 $t(e){return M({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 At({audio:e,appearance:t="normal",volume:n=.7,initialLoop:a,initialOrder:o,autoPlay:f=!1,listMaxHeight:y=250,mini:b=!1,mutex:s=!0,listFolded:d=!1,theme:g="light"}){var Q,Z,ee;const l=B("aplayer"),c=Lt(Array.isArray(e)?e:[e],{initialLoop:a,initialOrder:o,getSongId:R=>R.url}),[x,T]=Ot(),i=fr(),p=m.useRef(),E=m.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=void 0)},[]),S=jt({src:c.currentSong.url,initialVolume:n,autoPlay:f,mutex:s,onError(R){const{error:se}=R.target;se&&T("An audio error has occurred, player will skip forward in 2 seconds."),c.hasNextSong&&(p.current=i(()=>{c.next()},2e3))},onEnded(){c.hasNextSong&&c.next()}});m.useEffect(()=>{f&&S.playAudio(c.currentSong.url)},[]);const N=m.useRef(!0);m.useEffect(()=>{N.current?N.current=!1:c.currentSong&&S.playAudio(c.currentSong.url)},[c.currentSong,S.playAudio]);const $=m.useCallback(()=>{E(),S.togglePlay(c.currentSong.url)},[S,E,c.currentSong.url]),X=m.useCallback(R=>R?typeof R=="string"?R:R.url?v.jsx("a",{href:R.url,target:"_blank",rel:"noreferrer",children:R.name??"Audio artist"}):R.name??"Audio artist":"Audio artist",[]),z=c.length>1,V=m.useMemo(()=>Array.isArray(e)?e:[e],[e]),{prioritize:oe}=c,ie=m.useCallback(R=>{E(),oe(R)},[E,oe]),[be,ge]=m.useState(()=>z&&!d),[ue,I]=m.useState(b),[D,H]=m.useState(!0),U=m.useRef(null);return m.useEffect(()=>{I(b)},[b]),m.useEffect(()=>{if(t==="fixed"&&U.current){const R=U.current;return R.style.width=`${R.offsetWidth-18}px`,()=>{R.removeAttribute("style")}}},[t]),v.jsxs("div",{className:L(l.b(),{[l.bs(g)]:!0,[l.bs("vars")]:!0,[l.bm("fixed")]:t==="fixed",[l.bm("loading")]:S.isLoading,[l.bm("withlist")]:z,[l.bm("withlrc")]:!!c.currentSong.lrc&&t!=="fixed",[l.bm("narrow")]:ue}),children:[v.jsxs("div",{ref:U,className:l.be("body"),children:[v.jsx("div",{className:l.be("pic"),onClick:$,style:{backgroundImage:`url("${(Q=c.currentSong)==null?void 0:Q.cover}")`},children:v.jsx("div",{className:L(l.be("button"),S.isPlaying?l.bm("pause"):l.bm("play")),children:S.isPlaying?v.jsx($t,{}):v.jsx(tt,{})})}),v.jsxs("div",{className:L(l.be("info")),children:[v.jsxs("div",{className:L(l.be("music")),children:[v.jsx("span",{className:L(l.be("title")),children:((Z=c.currentSong)==null?void 0:Z.name)??"Audio name"}),v.jsxs("span",{className:L(l.be("author")),children:[" ","-"," ",X((ee=c.currentSong)==null?void 0:ee.artist)]})]}),t==="fixed"?null:v.jsx(nr,{show:D,lrcText:c.currentSong.lrc,currentTime:S.currentTime??0}),v.jsx(gt,{volume:S.volume??n,onChangeVolume:S.setVolume,muted:S.muted??!1,onToggleMuted:()=>S.toggleMuted(),currentTime:S.currentTime,audioDurationSeconds:S.duration,bufferedSeconds:S.bufferedSeconds,onSeek:R=>S.seek(R),onToggleMenu:()=>ge(R=>!R),order:c.order,onOrderChange:c.setOrder,loop:c.loop,onLoopChange:c.setLoop,isPlaying:S.isPlaying??!1,onTogglePlay:$,onSkipForward:()=>{c.hasNextSong&&c.next()},onSkipBack:()=>{c.previous()},showLyrics:D,onToggleLyrics:()=>{H(R=>!R)}})]}),v.jsx("div",{className:l.be("notice"),style:x.style,children:x.text}),v.jsx("div",{className:l.be("miniswitcher"),onClick:()=>I(R=>!R),children:v.jsx("button",{className:l.bs("icon"),type:"button",children:v.jsx(Pt,{})})})]}),z?v.jsx(Et,{open:be,audio:V,playingAudioUrl:c.currentSong.url,onPlayAudio:ie,listMaxHeight:y}):null,t==="fixed"&&v.jsx(nr,{show:D,lrcText:c.currentSong.lrc,currentTime:S.currentTime??0})]})}exports.TwistAPlayer=At;
|
package/dist/index.mjs
CHANGED
|
@@ -56,8 +56,8 @@ function zr() {
|
|
|
56
56
|
{
|
|
57
57
|
var _ = g.ReactDebugCurrentFrame, j = _.getStackAddendum();
|
|
58
58
|
j !== "" && (u += "%s", m = m.concat([j]));
|
|
59
|
-
var R = m.map(function(
|
|
60
|
-
return String(
|
|
59
|
+
var R = m.map(function(T) {
|
|
60
|
+
return String(T);
|
|
61
61
|
});
|
|
62
62
|
R.unshift("Warning: " + u), Function.prototype.apply.call(console[r], console, R);
|
|
63
63
|
}
|
|
@@ -71,7 +71,7 @@ function zr() {
|
|
|
71
71
|
// with.
|
|
72
72
|
r.$$typeof === le || r.getModuleId !== void 0));
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function we(r, u, m) {
|
|
75
75
|
var _ = r.displayName;
|
|
76
76
|
if (_)
|
|
77
77
|
return _;
|
|
@@ -111,14 +111,14 @@ function zr() {
|
|
|
111
111
|
var m = r;
|
|
112
112
|
return fe(m._context) + ".Provider";
|
|
113
113
|
case s:
|
|
114
|
-
return
|
|
114
|
+
return we(r, r.render, "ForwardRef");
|
|
115
115
|
case l:
|
|
116
116
|
var _ = r.displayName || null;
|
|
117
117
|
return _ !== null ? _ : V(r.type) || "Memo";
|
|
118
118
|
case c: {
|
|
119
|
-
var j = r, R = j._payload,
|
|
119
|
+
var j = r, R = j._payload, T = j._init;
|
|
120
120
|
try {
|
|
121
|
-
return V(
|
|
121
|
+
return V(T(R));
|
|
122
122
|
} catch {
|
|
123
123
|
return null;
|
|
124
124
|
}
|
|
@@ -188,7 +188,7 @@ function zr() {
|
|
|
188
188
|
Y < 0 && x("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
var
|
|
191
|
+
var Te = g.ReactCurrentDispatcher, je;
|
|
192
192
|
function ve(r, u, m) {
|
|
193
193
|
{
|
|
194
194
|
if (je === void 0)
|
|
@@ -220,30 +220,30 @@ function zr() {
|
|
|
220
220
|
var j = Error.prepareStackTrace;
|
|
221
221
|
Error.prepareStackTrace = void 0;
|
|
222
222
|
var R;
|
|
223
|
-
R =
|
|
223
|
+
R = Te.current, Te.current = null, yr();
|
|
224
224
|
try {
|
|
225
225
|
if (u) {
|
|
226
|
-
var
|
|
226
|
+
var T = function() {
|
|
227
227
|
throw Error();
|
|
228
228
|
};
|
|
229
|
-
if (Object.defineProperty(
|
|
229
|
+
if (Object.defineProperty(T.prototype, "props", {
|
|
230
230
|
set: function() {
|
|
231
231
|
throw Error();
|
|
232
232
|
}
|
|
233
233
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
234
234
|
try {
|
|
235
|
-
Reflect.construct(
|
|
235
|
+
Reflect.construct(T, []);
|
|
236
236
|
} catch (z) {
|
|
237
237
|
_ = z;
|
|
238
238
|
}
|
|
239
|
-
Reflect.construct(r, [],
|
|
239
|
+
Reflect.construct(r, [], T);
|
|
240
240
|
} else {
|
|
241
241
|
try {
|
|
242
|
-
|
|
242
|
+
T.call();
|
|
243
243
|
} catch (z) {
|
|
244
244
|
_ = z;
|
|
245
245
|
}
|
|
246
|
-
r.call(
|
|
246
|
+
r.call(T.prototype);
|
|
247
247
|
}
|
|
248
248
|
} else {
|
|
249
249
|
try {
|
|
@@ -255,17 +255,17 @@ function zr() {
|
|
|
255
255
|
}
|
|
256
256
|
} catch (z) {
|
|
257
257
|
if (z && _ && typeof z.stack == "string") {
|
|
258
|
-
for (var
|
|
258
|
+
for (var w = z.stack.split(`
|
|
259
259
|
`), M = _.stack.split(`
|
|
260
|
-
`), $ =
|
|
260
|
+
`), $ = w.length - 1, A = M.length - 1; $ >= 1 && A >= 0 && w[$] !== M[A]; )
|
|
261
261
|
A--;
|
|
262
262
|
for (; $ >= 1 && A >= 0; $--, A--)
|
|
263
|
-
if (
|
|
263
|
+
if (w[$] !== M[A]) {
|
|
264
264
|
if ($ !== 1 || A !== 1)
|
|
265
265
|
do
|
|
266
|
-
if ($--, A--, A < 0 ||
|
|
266
|
+
if ($--, A--, A < 0 || w[$] !== M[A]) {
|
|
267
267
|
var D = `
|
|
268
|
-
` +
|
|
268
|
+
` + w[$].replace(" at new ", " at ");
|
|
269
269
|
return r.displayName && D.includes("<anonymous>") && (D = D.replace("<anonymous>", r.displayName)), typeof r == "function" && me.set(r, D), D;
|
|
270
270
|
}
|
|
271
271
|
while ($ >= 1 && A >= 0);
|
|
@@ -273,7 +273,7 @@ function zr() {
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
} finally {
|
|
276
|
-
Oe = !1,
|
|
276
|
+
Oe = !1, Te.current = R, br(), Error.prepareStackTrace = j;
|
|
277
277
|
}
|
|
278
278
|
var Q = r ? r.displayName || r.name : "", Ze = Q ? ve(Q) : "";
|
|
279
279
|
return typeof r == "function" && me.set(r, Ze), Ze;
|
|
@@ -325,19 +325,19 @@ function zr() {
|
|
|
325
325
|
function _r(r, u, m, _, j) {
|
|
326
326
|
{
|
|
327
327
|
var R = Function.call.bind(pe);
|
|
328
|
-
for (var
|
|
329
|
-
if (R(r,
|
|
330
|
-
var
|
|
328
|
+
for (var T in r)
|
|
329
|
+
if (R(r, T)) {
|
|
330
|
+
var w = void 0;
|
|
331
331
|
try {
|
|
332
|
-
if (typeof r[
|
|
333
|
-
var M = Error((_ || "React class") + ": " + m + " type `" +
|
|
332
|
+
if (typeof r[T] != "function") {
|
|
333
|
+
var M = Error((_ || "React class") + ": " + m + " type `" + T + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof r[T] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
334
334
|
throw M.name = "Invariant Violation", M;
|
|
335
335
|
}
|
|
336
|
-
|
|
336
|
+
w = r[T](u, T, _, m, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
337
337
|
} catch ($) {
|
|
338
|
-
|
|
338
|
+
w = $;
|
|
339
339
|
}
|
|
340
|
-
|
|
340
|
+
w && !(w 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, T, typeof w), ye(null)), w instanceof Error && !(w.message in Ve) && (Ve[w.message] = !0, ye(j), x("Failed %s type: %s", m, w.message), ye(null));
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
343
|
}
|
|
@@ -345,13 +345,13 @@ function zr() {
|
|
|
345
345
|
function Re(r) {
|
|
346
346
|
return Sr(r);
|
|
347
347
|
}
|
|
348
|
-
function
|
|
348
|
+
function wr(r) {
|
|
349
349
|
{
|
|
350
350
|
var u = typeof Symbol == "function" && Symbol.toStringTag, m = u && r[Symbol.toStringTag] || r.constructor.name || "Object";
|
|
351
351
|
return m;
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
function
|
|
354
|
+
function Tr(r) {
|
|
355
355
|
try {
|
|
356
356
|
return Be(r), !1;
|
|
357
357
|
} catch {
|
|
@@ -362,8 +362,8 @@ function zr() {
|
|
|
362
362
|
return "" + r;
|
|
363
363
|
}
|
|
364
364
|
function ze(r) {
|
|
365
|
-
if (
|
|
366
|
-
return x("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",
|
|
365
|
+
if (Tr(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.", wr(r)), Be(r);
|
|
367
367
|
}
|
|
368
368
|
var He = g.ReactCurrentOwner, jr = {
|
|
369
369
|
key: !0,
|
|
@@ -412,51 +412,51 @@ function zr() {
|
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
var Cr = function(r, u, m, _, j, R,
|
|
416
|
-
var
|
|
415
|
+
var Cr = function(r, u, m, _, j, R, T) {
|
|
416
|
+
var w = {
|
|
417
417
|
// This tag allows us to uniquely identify this as a React Element
|
|
418
418
|
$$typeof: t,
|
|
419
419
|
// Built-in properties that belong on the element
|
|
420
420
|
type: r,
|
|
421
421
|
key: u,
|
|
422
422
|
ref: m,
|
|
423
|
-
props:
|
|
423
|
+
props: T,
|
|
424
424
|
// Record the component responsible for creating this element.
|
|
425
425
|
_owner: R
|
|
426
426
|
};
|
|
427
|
-
return
|
|
427
|
+
return w._store = {}, Object.defineProperty(w._store, "validated", {
|
|
428
428
|
configurable: !1,
|
|
429
429
|
enumerable: !1,
|
|
430
430
|
writable: !0,
|
|
431
431
|
value: !1
|
|
432
|
-
}), Object.defineProperty(
|
|
432
|
+
}), Object.defineProperty(w, "_self", {
|
|
433
433
|
configurable: !1,
|
|
434
434
|
enumerable: !1,
|
|
435
435
|
writable: !1,
|
|
436
436
|
value: _
|
|
437
|
-
}), Object.defineProperty(
|
|
437
|
+
}), Object.defineProperty(w, "_source", {
|
|
438
438
|
configurable: !1,
|
|
439
439
|
enumerable: !1,
|
|
440
440
|
writable: !1,
|
|
441
441
|
value: j
|
|
442
|
-
}), Object.freeze && (Object.freeze(
|
|
442
|
+
}), Object.freeze && (Object.freeze(w.props), Object.freeze(w)), w;
|
|
443
443
|
};
|
|
444
444
|
function Ar(r, u, m, _, j) {
|
|
445
445
|
{
|
|
446
|
-
var R,
|
|
447
|
-
m !== void 0 && (ze(m),
|
|
446
|
+
var R, T = {}, w = null, M = null;
|
|
447
|
+
m !== void 0 && (ze(m), w = "" + m), Rr(u) && (ze(u.key), w = "" + u.key), Or(u) && (M = u.ref, Lr(u, j));
|
|
448
448
|
for (R in u)
|
|
449
|
-
pe.call(u, R) && !jr.hasOwnProperty(R) && (
|
|
449
|
+
pe.call(u, R) && !jr.hasOwnProperty(R) && (T[R] = u[R]);
|
|
450
450
|
if (r && r.defaultProps) {
|
|
451
451
|
var $ = r.defaultProps;
|
|
452
452
|
for (R in $)
|
|
453
|
-
|
|
453
|
+
T[R] === void 0 && (T[R] = $[R]);
|
|
454
454
|
}
|
|
455
|
-
if (
|
|
455
|
+
if (w || M) {
|
|
456
456
|
var A = typeof r == "function" ? r.displayName || r.name || "Unknown" : r;
|
|
457
|
-
|
|
457
|
+
w && Pr(T, A), M && $r(T, A);
|
|
458
458
|
}
|
|
459
|
-
return Cr(r,
|
|
459
|
+
return Cr(r, w, M, j, _, He.current, T);
|
|
460
460
|
}
|
|
461
461
|
}
|
|
462
462
|
var Le = g.ReactCurrentOwner, Ye = g.ReactDebugCurrentFrame;
|
|
@@ -527,8 +527,8 @@ Check the top-level render call using <` + m + ">.");
|
|
|
527
527
|
else if (r) {
|
|
528
528
|
var j = h(r);
|
|
529
529
|
if (typeof j == "function" && j !== r.entries)
|
|
530
|
-
for (var R = j.call(r),
|
|
531
|
-
$e(
|
|
530
|
+
for (var R = j.call(r), T; !(T = R.next()).done; )
|
|
531
|
+
$e(T.value) && Je(T.value, u);
|
|
532
532
|
}
|
|
533
533
|
}
|
|
534
534
|
}
|
|
@@ -571,19 +571,19 @@ Check the top-level render call using <` + m + ">.");
|
|
|
571
571
|
}
|
|
572
572
|
function Qe(r, u, m, _, j, R) {
|
|
573
573
|
{
|
|
574
|
-
var
|
|
575
|
-
if (!
|
|
576
|
-
var
|
|
577
|
-
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (
|
|
574
|
+
var T = Se(r);
|
|
575
|
+
if (!T) {
|
|
576
|
+
var w = "";
|
|
577
|
+
(r === void 0 || typeof r == "object" && r !== null && Object.keys(r).length === 0) && (w += " 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
578
|
var M = Nr();
|
|
579
|
-
M ?
|
|
579
|
+
M ? w += M : w += Ge();
|
|
580
580
|
var $;
|
|
581
|
-
r === null ? $ = "null" : Re(r) ? $ = "array" : r !== void 0 && r.$$typeof === t ? ($ = "<" + (V(r.type) || "Unknown") + " />",
|
|
581
|
+
r === null ? $ = "null" : Re(r) ? $ = "array" : r !== void 0 && r.$$typeof === t ? ($ = "<" + (V(r.type) || "Unknown") + " />", w = " 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", $, w);
|
|
582
582
|
}
|
|
583
583
|
var A = Ar(r, u, m, j, R);
|
|
584
584
|
if (A == null)
|
|
585
585
|
return A;
|
|
586
|
-
if (
|
|
586
|
+
if (T) {
|
|
587
587
|
var D = u.children;
|
|
588
588
|
if (D !== void 0)
|
|
589
589
|
if (_)
|
|
@@ -1164,7 +1164,7 @@ function St({
|
|
|
1164
1164
|
] })
|
|
1165
1165
|
] });
|
|
1166
1166
|
}
|
|
1167
|
-
function
|
|
1167
|
+
function wt({
|
|
1168
1168
|
open: e,
|
|
1169
1169
|
audio: t,
|
|
1170
1170
|
playingAudioUrl: n,
|
|
@@ -1211,7 +1211,7 @@ function Tt({
|
|
|
1211
1211
|
);
|
|
1212
1212
|
}
|
|
1213
1213
|
function sr({ show: e, lrcText: t, currentTime: n }) {
|
|
1214
|
-
const a = W("aplayer-lrc"), i = K(() =>
|
|
1214
|
+
const a = W("aplayer-lrc"), i = K(() => Tt(t), [t]), f = K(() => {
|
|
1215
1215
|
for (let y = 0; y < i.length; y++) {
|
|
1216
1216
|
const s = i[y], d = i[y + 1];
|
|
1217
1217
|
if (n >= s[0] && (!d || n < d[0]))
|
|
@@ -1241,7 +1241,7 @@ function sr({ show: e, lrcText: t, currentTime: n }) {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
);
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1244
|
+
function Tt(e) {
|
|
1245
1245
|
if (e) {
|
|
1246
1246
|
e = e.replace(/([^\]^\n])\[/g, (i, f) => `${f}
|
|
1247
1247
|
[`);
|
|
@@ -1383,17 +1383,19 @@ var G = Rt();
|
|
|
1383
1383
|
const Z = [];
|
|
1384
1384
|
function Lt(e) {
|
|
1385
1385
|
const t = F();
|
|
1386
|
-
if (typeof
|
|
1386
|
+
if (typeof window < "u" && !t.current) {
|
|
1387
1387
|
const n = t.current = document.createElement("audio");
|
|
1388
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
1389
|
}
|
|
1390
1390
|
return I(() => {
|
|
1391
|
+
if (typeof window > "u") return;
|
|
1391
1392
|
const n = t.current;
|
|
1392
1393
|
if (n && (e != null && e.onError))
|
|
1393
1394
|
return n.addEventListener("error", e.onError), () => {
|
|
1394
1395
|
n.removeEventListener("error", e.onError);
|
|
1395
1396
|
};
|
|
1396
1397
|
}, [e == null ? void 0 : e.onError]), I(() => {
|
|
1398
|
+
if (typeof window > "u") return;
|
|
1397
1399
|
const n = t.current;
|
|
1398
1400
|
if (n && (e != null && e.onEnded))
|
|
1399
1401
|
return n.addEventListener("ended", e.onEnded), () => {
|
|
@@ -1749,7 +1751,7 @@ function kt({
|
|
|
1749
1751
|
g(), ce(O);
|
|
1750
1752
|
},
|
|
1751
1753
|
[g, ce]
|
|
1752
|
-
), [Se,
|
|
1754
|
+
), [Se, we] = H(() => U && !d), [fe, V] = H(y), [k, Y] = H(!0), J = F(null);
|
|
1753
1755
|
return I(() => {
|
|
1754
1756
|
V(y);
|
|
1755
1757
|
}, [y]), I(() => {
|
|
@@ -1822,7 +1824,7 @@ function kt({
|
|
|
1822
1824
|
audioDurationSeconds: x.duration,
|
|
1823
1825
|
bufferedSeconds: x.bufferedSeconds,
|
|
1824
1826
|
onSeek: (O) => x.seek(O),
|
|
1825
|
-
onToggleMenu: () =>
|
|
1827
|
+
onToggleMenu: () => we((O) => !O),
|
|
1826
1828
|
order: c.order,
|
|
1827
1829
|
onOrderChange: c.setOrder,
|
|
1828
1830
|
loop: c.loop,
|
|
@@ -1853,7 +1855,7 @@ function kt({
|
|
|
1853
1855
|
)
|
|
1854
1856
|
] }),
|
|
1855
1857
|
U ? /* @__PURE__ */ v.jsx(
|
|
1856
|
-
|
|
1858
|
+
wt,
|
|
1857
1859
|
{
|
|
1858
1860
|
open: Se,
|
|
1859
1861
|
audio: B,
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/return e.NODE_ENV!=="production"&&function(){var t=f,n=Symbol.for("react.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),s=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),o=Symbol.iterator,p="@@iterator";function _(r){if(r===null||typeof r!="object")return null;var u=o&&r[o]||r[p];return typeof u=="function"?u:null}var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function
|
|
18
|
-
`+Oe+r}}var Ce=!1,me;{var vt=typeof WeakMap=="function"?WeakMap:Map;me=new vt}function Ze(r,u){if(!r||Ce)return"";{var h=me.get(r);if(h!==void 0)return h}var E;Ce=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var P;P=
|
|
17
|
+
*/return e.NODE_ENV!=="production"&&function(){var t=f,n=Symbol.for("react.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),b=Symbol.for("react.provider"),s=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),T=Symbol.for("react.offscreen"),o=Symbol.iterator,p="@@iterator";function _(r){if(r===null||typeof r!="object")return null;var u=o&&r[o]||r[p];return typeof u=="function"?u:null}var x=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function j(r){{for(var u=arguments.length,h=new Array(u>1?u-1:0),E=1;E<u;E++)h[E-1]=arguments[E];M("error",r,h)}}function M(r,u,h){{var E=x.ReactDebugCurrentFrame,C=E.getStackAddendum();C!==""&&(u+="%s",h=h.concat([C]));var P=h.map(function(O){return String(O)});P.unshift("Warning: "+u),Function.prototype.apply.call(console[r],console,P)}}var re=!1,U=!1,V=!1,ce=!1,Se=!1,fe;fe=Symbol.for("react.module.reference");function Te(r){return!!(typeof r=="string"||typeof r=="function"||r===i||r===y||Se||r===c||r===g||r===d||ce||r===T||re||U||V||typeof r=="object"&&r!==null&&(r.$$typeof===S||r.$$typeof===l||r.$$typeof===b||r.$$typeof===s||r.$$typeof===v||r.$$typeof===fe||r.getModuleId!==void 0))}function we(r,u,h){var E=r.displayName;if(E)return E;var C=u.displayName||u.name||"";return C!==""?h+"("+C+")":h}function te(r){return r.displayName||"Context"}function D(r){if(r==null)return null;if(typeof r.tag=="number"&&j("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 i:return"Fragment";case a:return"Portal";case y:return"Profiler";case c:return"StrictMode";case g:return"Suspense";case d:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case s:var u=r;return te(u)+".Consumer";case b:var h=r;return te(h._context)+".Provider";case v:return we(r,r.render,"ForwardRef");case l:var E=r.displayName||null;return E!==null?E:D(r.type)||"Memo";case S:{var C=r,P=C._payload,O=C._init;try{return D(O(P))}catch{return null}}}return null}var F=Object.assign,B=0,ne,ae,oe,L,de,Je,Xe;function Qe(){}Qe.__reactDisabledLog=!0;function ft(){{if(B===0){ne=console.log,ae=console.info,oe=console.warn,L=console.error,de=console.group,Je=console.groupCollapsed,Xe=console.groupEnd;var r={configurable:!0,enumerable:!0,value:Qe,writable:!0};Object.defineProperties(console,{info:r,log:r,warn:r,error:r,group:r,groupCollapsed:r,groupEnd:r})}B++}}function dt(){{if(B--,B===0){var r={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:F({},r,{value:ne}),info:F({},r,{value:ae}),warn:F({},r,{value:oe}),error:F({},r,{value:L}),group:F({},r,{value:de}),groupCollapsed:F({},r,{value:Je}),groupEnd:F({},r,{value:Xe})})}B<0&&j("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var je=x.ReactCurrentDispatcher,Oe;function ve(r,u,h){{if(Oe===void 0)try{throw Error()}catch(C){var E=C.stack.trim().match(/\n( *(at )?)/);Oe=E&&E[1]||""}return`
|
|
18
|
+
`+Oe+r}}var Ce=!1,me;{var vt=typeof WeakMap=="function"?WeakMap:Map;me=new vt}function Ze(r,u){if(!r||Ce)return"";{var h=me.get(r);if(h!==void 0)return h}var E;Ce=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var P;P=je.current,je.current=null,ft();try{if(u){var O=function(){throw Error()};if(Object.defineProperty(O.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(O,[])}catch(z){E=z}Reflect.construct(r,[],O)}else{try{O.call()}catch(z){E=z}r.call(O.prototype)}}else{try{throw Error()}catch(z){E=z}r()}}catch(z){if(z&&E&&typeof z.stack=="string"){for(var w=z.stack.split(`
|
|
19
19
|
`),k=E.stack.split(`
|
|
20
|
-
`),A=
|
|
21
|
-
`+
|
|
20
|
+
`),A=w.length-1,N=k.length-1;A>=1&&N>=0&&w[A]!==k[N];)N--;for(;A>=1&&N>=0;A--,N--)if(w[A]!==k[N]){if(A!==1||N!==1)do if(A--,N--,N<0||w[A]!==k[N]){var R=`
|
|
21
|
+
`+w[A].replace(" at new "," at ");return r.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",r.displayName)),typeof r=="function"&&me.set(r,R),R}while(A>=1&&N>=0);break}}}finally{Ce=!1,je.current=P,dt(),Error.prepareStackTrace=C}var J=r?r.displayName||r.name:"",vr=J?ve(J):"";return typeof r=="function"&&me.set(r,vr),vr}function mt(r,u,h){return Ze(r,!1)}function ht(r){var u=r.prototype;return!!(u&&u.isReactComponent)}function he(r,u,h){if(r==null)return"";if(typeof r=="function")return Ze(r,ht(r));if(typeof r=="string")return ve(r);switch(r){case g:return ve("Suspense");case d:return ve("SuspenseList")}if(typeof r=="object")switch(r.$$typeof){case v:return mt(r.render);case l:return he(r.type,u,h);case S:{var E=r,C=E._payload,P=E._init;try{return he(P(C),u,h)}catch{}}}return""}var pe=Object.prototype.hasOwnProperty,er={},rr=x.ReactDebugCurrentFrame;function ye(r){if(r){var u=r._owner,h=he(r.type,r._source,u?u.type:null);rr.setExtraStackFrame(h)}else rr.setExtraStackFrame(null)}function pt(r,u,h,E,C){{var P=Function.call.bind(pe);for(var O in r)if(P(r,O)){var w=void 0;try{if(typeof r[O]!="function"){var k=Error((E||"React class")+": "+h+" type `"+O+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof r[O]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw k.name="Invariant Violation",k}w=r[O](u,O,E,h,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(A){w=A}w&&!(w instanceof Error)&&(ye(C),j("%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",h,O,typeof w),ye(null)),w instanceof Error&&!(w.message in er)&&(er[w.message]=!0,ye(C),j("Failed %s type: %s",h,w.message),ye(null))}}}var yt=Array.isArray;function Le(r){return yt(r)}function bt(r){{var u=typeof Symbol=="function"&&Symbol.toStringTag,h=u&&r[Symbol.toStringTag]||r.constructor.name||"Object";return h}}function gt(r){try{return tr(r),!1}catch{return!0}}function tr(r){return""+r}function nr(r){if(gt(r))return j("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",bt(r)),tr(r)}var ar=x.ReactCurrentOwner,Et={key:!0,ref:!0,__self:!0,__source:!0},or,ir;function xt(r){if(pe.call(r,"ref")){var u=Object.getOwnPropertyDescriptor(r,"ref").get;if(u&&u.isReactWarning)return!1}return r.ref!==void 0}function _t(r){if(pe.call(r,"key")){var u=Object.getOwnPropertyDescriptor(r,"key").get;if(u&&u.isReactWarning)return!1}return r.key!==void 0}function St(r,u){typeof r.ref=="string"&&ar.current}function Tt(r,u){{var h=function(){or||(or=!0,j("%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))};h.isReactWarning=!0,Object.defineProperty(r,"key",{get:h,configurable:!0})}}function wt(r,u){{var h=function(){ir||(ir=!0,j("%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))};h.isReactWarning=!0,Object.defineProperty(r,"ref",{get:h,configurable:!0})}}var jt=function(r,u,h,E,C,P,O){var w={$$typeof:n,type:r,key:u,ref:h,props:O,_owner:P};return w._store={},Object.defineProperty(w._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(w,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty(w,"_source",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.freeze&&(Object.freeze(w.props),Object.freeze(w)),w};function Ot(r,u,h,E,C){{var P,O={},w=null,k=null;h!==void 0&&(nr(h),w=""+h),_t(u)&&(nr(u.key),w=""+u.key),xt(u)&&(k=u.ref,St(u,C));for(P in u)pe.call(u,P)&&!Et.hasOwnProperty(P)&&(O[P]=u[P]);if(r&&r.defaultProps){var A=r.defaultProps;for(P in A)O[P]===void 0&&(O[P]=A[P])}if(w||k){var N=typeof r=="function"?r.displayName||r.name||"Unknown":r;w&&Tt(O,N),k&&wt(O,N)}return jt(r,w,k,C,E,ar.current,O)}}var Pe=x.ReactCurrentOwner,ur=x.ReactDebugCurrentFrame;function K(r){if(r){var u=r._owner,h=he(r.type,r._source,u?u.type:null);ur.setExtraStackFrame(h)}else ur.setExtraStackFrame(null)}var $e;$e=!1;function Ae(r){return typeof r=="object"&&r!==null&&r.$$typeof===n}function sr(){{if(Pe.current){var r=D(Pe.current.type);if(r)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+r+"`."}return""}}function Ct(r){return""}var lr={};function Lt(r){{var u=sr();if(!u){var h=typeof r=="string"?r:r.displayName||r.name;h&&(u=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+h+">.")}return u}}function cr(r,u){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var h=Lt(u);if(lr[h])return;lr[h]=!0;var E="";r&&r._owner&&r._owner!==Pe.current&&(E=" It was passed a child from "+D(r._owner.type)+"."),K(r),
|
|
25
|
+
Check the top-level render call using <`+h+">.")}return u}}function cr(r,u){{if(!r._store||r._store.validated||r.key!=null)return;r._store.validated=!0;var h=Lt(u);if(lr[h])return;lr[h]=!0;var E="";r&&r._owner&&r._owner!==Pe.current&&(E=" It was passed a child from "+D(r._owner.type)+"."),K(r),j('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',h,E),K(null)}}function fr(r,u){{if(typeof r!="object")return;if(Le(r))for(var h=0;h<r.length;h++){var E=r[h];Ae(E)&&cr(E,u)}else if(Ae(r))r._store&&(r._store.validated=!0);else if(r){var C=_(r);if(typeof C=="function"&&C!==r.entries)for(var P=C.call(r),O;!(O=P.next()).done;)Ae(O.value)&&cr(O.value,u)}}}function Pt(r){{var u=r.type;if(u==null||typeof u=="string")return;var h;if(typeof u=="function")h=u.propTypes;else if(typeof u=="object"&&(u.$$typeof===v||u.$$typeof===l))h=u.propTypes;else return;if(h){var E=D(u);pt(h,r.props,"prop",E,r)}else if(u.PropTypes!==void 0&&!$e){$e=!0;var C=D(u);j("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",C||"Unknown")}typeof u.getDefaultProps=="function"&&!u.getDefaultProps.isReactClassApproved&&j("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function $t(r){{for(var u=Object.keys(r.props),h=0;h<u.length;h++){var E=u[h];if(E!=="children"&&E!=="key"){K(r),j("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),K(null);break}}r.ref!==null&&(K(r),j("Invalid attribute `ref` supplied to `React.Fragment`."),K(null))}}function dr(r,u,h,E,C,P){{var O=Te(r);if(!O){var w="";(r===void 0||typeof r=="object"&&r!==null&&Object.keys(r).length===0)&&(w+=" 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 k=Ct();k?w+=k:w+=sr();var A;r===null?A="null":Le(r)?A="array":r!==void 0&&r.$$typeof===n?(A="<"+(D(r.type)||"Unknown")+" />",w=" Did you accidentally export a JSX literal instead of a component?"):A=typeof r,j("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,w)}var N=Ot(r,u,h,C,P);if(N==null)return N;if(O){var R=u.children;if(R!==void 0)if(E)if(Le(R)){for(var J=0;J<R.length;J++)fr(R[J],r);Object.freeze&&Object.freeze(R)}else j("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 fr(R,r)}return r===i?$t(N):Pt(N),N}}function At(r,u,h){return dr(r,u,h,!0)}function Mt(r,u,h){return dr(r,u,h,!1)}var Nt=Mt,qt=At;Q.Fragment=i,Q.jsx=Nt,Q.jsxs=qt}(),Q}var qe;function yr(){if(qe)return ie.exports;qe=1;var e={};return e.NODE_ENV==="production"?ie.exports=hr():ie.exports=pr(),ie.exports}var m=yr(),ue=e=>`--${e}`,ke=e=>`var(--${e})`,Re=(e,t)=>`--${e}: ${t};`;function br(e,t){const n=a=>t;return{b:()=>`${n()}-${e}`,be:a=>`${n()}-${e}__${a}`,bm:a=>`${n()}-${e}--${a}`,bem:(a,i)=>`${n()}-${e}__${a}--${i}`,bs:a=>`${n()}-${e}-${a}`,ns:a=>`${n()}-${a}`,cb:()=>`.${n()}-${e}`,cbe:a=>`.${n()}-${e}__${a}`,cbm:a=>`.${n()}-${e}--${a}`,cbem:(a,i)=>`.${n()}-${e}__${a}--${i}`,cbs:a=>`.${n()}-${e}-${a}`,cns:a=>`.${n()}-${a}`,cv:a=>ue(`${n()}-${e}-${a}`),cvm:(a,i={})=>{const c=n();for(const y of Object.keys(a))i[ue(`${c}-${e}-${y}`)]=a[y];return i},gcv:a=>ke(`${n()}-${e}-${a}`),scv:(a,i)=>Re(`${n()}-${e}-${a}`,i),nv:a=>ue(`${n()}-${a}`),nvm:(a,i={})=>{const c=n();for(const y of Object.keys(a))i[ue(`${c}-${y}`)]=a[y];return i},gnv:a=>ke(`${n()}-${a}`),snv:(a,i)=>Re(`${n()}-${a}`,i)}}function I(e){return f.useMemo(()=>br(e,"twist"),[e])}function be(e,t){if(!t.current)return 0;let n=(e.clientX-t.current.getBoundingClientRect().left)/t.current.clientWidth;return n=Math.max(n,0),n=Math.min(n,1),n=Math.floor(n*100)/100,n}function ge(e,t){if(!t.current)return 0;let n=1-(e.clientY-t.current.getBoundingClientRect().top)/t.current.clientHeight;return n=Math.max(n,0),n=Math.min(n,1),n=Math.floor(n*100)/100,n}var De={color:void 0,size:void 0,className:void 0,style:void 0,attrs:void 0},Ee=Y.createContext(De);Ee.Provider;function Z(e){"@babel/helpers - typeof";return Z=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},Z(e)}var gr=["attrs","size","title","spin","rotate","color"];function Er(e,t){return Sr(e)||_r(e,t)||Ie(e,t)||xr()}function xr(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
26
26
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _r(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var a,i,c,y,b=[],s=!0,v=!1;try{if(c=(n=n.call(e)).next,t!==0)for(;!(s=(a=c.call(n)).done)&&(b.push(a.value),b.length!==t);s=!0);}catch(g){v=!0,i=g}finally{try{if(!s&&n.return!=null&&(y=n.return(),Object(y)!==y))return}finally{if(v)throw i}}return b}}function Sr(e){if(Array.isArray(e))return e}function Tr(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Ie(e))||t){n&&(e=n);var a=0,i=function(){};return{s:i,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(v){throw v},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
27
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,y=!0,b=!1;return{s:function(){n=n.call(e)},n:function(){var v=n.next();return y=v.done,v},e:function(v){b=!0,c=v},f:function(){try{y||n.return==null||n.return()}finally{if(b)throw c}}}}function Ie(e,t){if(e){if(typeof e=="string")return Ve(e,t);var n={}.toString.call(e).slice(8,-1);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)?Ve(e,t):void 0}}function Ve(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},se.apply(null,arguments)}function Fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,a)}return n}function ee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fe(Object(n),!0).forEach(function(a){jr(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function jr(e,t,n){return(t=wr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wr(e){var t=Or(e,"string");return Z(t)=="symbol"?t:t+""}function Or(e,t){if(Z(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(Z(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cr(e,t){if(e==null)return{};var n,a,i=Lr(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a<c.length;a++)n=c[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lr(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}function Pr(e){var t=e.attrs,n=e.size,a=e.title,i=e.spin,c=e.rotate,y=e.color,b=Cr(e,gr),s=function(g){var d=n||g.size||"1em",l,S="",T="";return g.className&&(l=g.className),e.className&&(l=l?"".concat(l," ").concat(e.className):e.className),i&&(l?l+=" twist-icon-loading":l="twist-icon-loading"),c&&(S="rotate(".concat(c,"deg)"),T="rotate(".concat(c,"deg)")),Y.createElement("svg",se({xmlns:"http://www.w3.org/2000/svg"},g.attrs,t,b,{className:l,style:ee(ee({color:y||g.color,msTransform:S,transform:T},g.style),e.style),width:d,height:d}),a&&Y.createElement("title",null,a),e.children)};return Ee!==void 0?Y.createElement(Ee.Consumer,null,function(v){return s(v)}):s(De)}function $r(e){var t={},n=e.split(";"),a=Tr(n),i;try{for(a.s();!(i=a.n()).done;){var c=i.value,y=c.split(":"),b=Er(y,2),s=b[0],v=b[1];if(s&&v){var g=s.trim().replace(/-./g,function(d){return d.charAt(1).toUpperCase()});t[g]=v.trim()}}}catch(d){a.e(d)}finally{a.f()}return t}function Be(e){return e&&e.map(function(t,n){return Y.createElement(t.tag,ee(ee({},t.attrs),{},{key:n,style:t.attrs.style?$r(t.attrs.style):null}),Be(t.children))})}function q(e){return function(t){return Y.createElement(Pr,se({attrs:ee({},e.attrs)},t),Be(e.children))}}function Ar(e){return q({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)}function Mr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M18.25 12L8.5 17.629V6.37z"}}]})(e)}function ze(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ze(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function $(){for(var e,t,n=0,a="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ze(e))&&(a&&(a+=" "),a+=t);return a}function Nr({bufferedPercentage:e,playedPercentage:t,onSeek:n}){const a=I("aplayer-bar"),i=I("aplayer-icon"),c=f.useRef(null),[y,b]=f.useState(t),s=f.useRef(!1);f.useEffect(()=>{s.current||b(t)},[t]);const v=f.useCallback(g=>{s.current=!0;const d=be(g,c);b(d);const l=T=>{const o=be(T,c);b(o)},S=T=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",S);const o=be(T,c);b(o),n==null||n(o),s.current=!1};document.addEventListener("mousemove",l),document.addEventListener("mouseup",S)},[n]);return m.jsx("div",{ref:c,className:$(a.b(),a.bs("vars")),onMouseDown:v,children:m.jsxs("div",{className:a.be("inner"),children:[typeof e<"u"?m.jsx("div",{className:a.be("loaded"),style:{width:`${e*100}%`}}):null,typeof y<"u"?m.jsx("div",{className:a.be("played"),style:{width:`${y*100}%`},children:m.jsx("span",{className:a.be("thumb"),children:m.jsx("span",{className:$(i.bs("loading")),children:m.jsx(Ar,{})})})}):null]})})}function qr(e){return q({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 kr(e){return q({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 Rr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14 19V5h4v14zm-8 0V5h4v14z"}}]})(e)}function Dr(e){return q({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 Ir(e){return q({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 Vr(e){return q({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 Fr(e){return q({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 Br(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7 15V9h4l5-5v16l-5-5z"}}]})(e)}function zr(e){return q({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 Hr({volume:e,muted:t,onToggleMuted:n,onChangeVolume:a}){const i=I("aplayer-volumn"),c=I("aplayer-icon"),y=f.useRef(null),[b,s]=f.useState(!1),v=f.useCallback(g=>{a(ge(g,y)),s(!0);const d=S=>{a(ge(S,y))},l=S=>{document.removeEventListener("mouseup",l),document.removeEventListener("mousemove",d),s(!1),a(ge(S,y))};document.addEventListener("mousemove",d),document.addEventListener("mouseup",l)},[a]);return m.jsxs("div",{className:$(i.b(),i.bs("vars")),children:[m.jsx("button",{type:"button",className:$(c.b(),c.bs("volume-down")),onClick:()=>n(),children:t||!e?m.jsx(Br,{}):e>=1?m.jsx(zr,{}):m.jsx(Fr,{})}),m.jsx("div",{className:$(i.be("bar-wrap"),{[i.bem("bar-wrap","active")]:b}),ref:y,onMouseDown:v,children:m.jsx("div",{className:i.be("bar"),children:m.jsx("div",{className:i.be("thumb"),style:{height:t?0:`${e*100}%`}})})})]})}function He(e){if(typeof e>"u")return"--:--";if(Number.isNaN(e))return"00:00";const t=y=>y<10?`0${y}`:`${y}`,n=Math.trunc(e/60),a=Math.trunc(e-n*60),i=Math.trunc(n/60),c=Math.trunc(e/60-60*Math.trunc(e/60/60));return e>=3600?`${t(i)}:${t(c)}:${t(a)}`:`${t(n)}:${t(a)}`}function Wr(e){return q({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 Ur(e){return q({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 Yr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"}}]})(e)}function Gr(e){return q({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 Kr(e){return q({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 Jr({volume:e,onChangeVolume:t,muted:n,currentTime:a,audioDurationSeconds:i,bufferedSeconds:c,onToggleMenu:y,onToggleMuted:b,order:s,onOrderChange:v,loop:g,onLoopChange:d,onSeek:l,isPlaying:S,onTogglePlay:T,onSkipForward:o,onSkipBack:p,showLyrics:_=!0,onToggleLyrics:x}){const w=I("aplayer-controller"),M=I("aplayer-icon"),re=f.useCallback(()=>{const V={list:"random",random:"list"}[s];v(V)},[s,v]),U=f.useCallback(()=>{const V={all:"one",one:"none",none:"all"}[g];d(V)},[g,d]);return m.jsxs("div",{className:$(w.b(),w.bs("vars")),children:[m.jsx(Nr,{playedPercentage:typeof a>"u"||typeof i>"u"?void 0:a/i,bufferedPercentage:typeof c>"u"||typeof i>"u"?void 0:c/i,onSeek:V=>l==null?void 0:l(V*i)}),m.jsxs("div",{className:w.be("time"),children:[m.jsxs("span",{className:w.be("time-inner"),children:[m.jsx("span",{className:w.be("ptime"),children:He(a)})," / ",m.jsx("span",{className:w.be("dtime"),children:He(i)})]}),m.jsx("span",{className:$(M.b(),M.bs("back")),onClick:p,children:m.jsx(Wr,{})}),m.jsx("span",{className:$(M.b(),M.bs("play")),onClick:T,children:S?m.jsx(Rr,{}):m.jsx(Dr,{})}),m.jsx("span",{className:$(M.b(),M.bs("forward")),onClick:o,children:m.jsx(Ur,{})}),m.jsx(Hr,{volume:e,muted:n,onToggleMuted:b,onChangeVolume:t}),m.jsx("button",{className:$(M.b(),M.bs("order")),onClick:re,type:"button",children:{list:m.jsx(qr,{}),random:m.jsx(Kr,{})}[s]}),m.jsx("button",{className:$(M.b(),M.bs("order")),onClick:U,type:"button",children:{all:m.jsx(Vr,{}),one:m.jsx(Ir,{}),none:m.jsx(Gr,{})}[g]}),m.jsx("button",{type:"button",className:$(M.b(),M.bs("menu")),onClick:()=>y==null?void 0:y(),children:m.jsx(Yr,{})}),m.jsx("button",{type:"button",className:$(M.b(),M.bs("lrc"),{[M.ns("lrc-inactivity")]:!_}),onClick:x,children:m.jsx(kr,{})})]})]})}function Xr({open:e,audio:t,playingAudioUrl:n,onPlayAudio:a,listMaxHeight:i}){const c=I("aplayer-list"),y=i?{maxHeight:i}:void 0,b=f.useCallback(v=>v?typeof v=="string"?v:v.name??"Audio artist":"Audio artist",[]),s=f.useRef(null);return f.useEffect(()=>{if(s.current){const v=s.current;return v.style.maxHeight=`${Math.min(v.scrollHeight,i??1/0)}px`,()=>{v.removeAttribute("style")}}},[i]),m.jsx("div",{ref:s,className:$(c.b(),{[c.bm("hide")]:!e}),children:m.jsx("ol",{style:y,children:t.map((v,g)=>m.jsxs("li",{className:$({[c.bm("active")]:v.url===n}),onClick:()=>{v.url!==n&&(a==null||a(v))},children:[m.jsx("span",{className:c.be("cur")}),m.jsx("span",{className:c.be("index"),children:g+1}),m.jsx("span",{className:c.be("title"),children:v.name??"Audio name"}),m.jsx("span",{className:c.be("author"),children:b(v.artist)})]},v.name||g))})})}function We({show:e,lrcText:t,currentTime:n}){const a=I("aplayer-lrc"),i=f.useMemo(()=>Qr(t),[t]),c=f.useMemo(()=>{for(let b=0;b<i.length;b++){const s=i[b],v=i[b+1];if(n>=s[0]&&(!v||n<v[0]))return b}return 0},[n,i]),y=f.useMemo(()=>({transform:`translateY(${-c*16}px)`,WebkitTransform:`translateY(${-c*16}px)`}),[c]);return m.jsx("div",{className:$(a.b(),{[a.bm("hide")]:!e}),children:t?m.jsx("div",{className:a.be("contents"),style:y,children:i.map(([,b],s)=>m.jsx("p",{className:$({[a.be("current")]:s===c}),children:b},s))}):null})}function Qr(e){if(e){e=e.replace(/([^\]^\n])\[/g,(i,c)=>`${c}
|
|
27
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var c,y=!0,b=!1;return{s:function(){n=n.call(e)},n:function(){var v=n.next();return y=v.done,v},e:function(v){b=!0,c=v},f:function(){try{y||n.return==null||n.return()}finally{if(b)throw c}}}}function Ie(e,t){if(e){if(typeof e=="string")return Ve(e,t);var n={}.toString.call(e).slice(8,-1);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)?Ve(e,t):void 0}}function Ve(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,a=Array(t);n<t;n++)a[n]=e[n];return a}function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var a in n)({}).hasOwnProperty.call(n,a)&&(e[a]=n[a])}return e},se.apply(null,arguments)}function Fe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,a)}return n}function ee(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Fe(Object(n),!0).forEach(function(a){wr(e,a,n[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fe(Object(n)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(n,a))})}return e}function wr(e,t,n){return(t=jr(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jr(e){var t=Or(e,"string");return Z(t)=="symbol"?t:t+""}function Or(e,t){if(Z(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var a=n.call(e,t);if(Z(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Cr(e,t){if(e==null)return{};var n,a,i=Lr(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(a=0;a<c.length;a++)n=c[a],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Lr(e,t){if(e==null)return{};var n={};for(var a in e)if({}.hasOwnProperty.call(e,a)){if(t.includes(a))continue;n[a]=e[a]}return n}function Pr(e){var t=e.attrs,n=e.size,a=e.title,i=e.spin,c=e.rotate,y=e.color,b=Cr(e,gr),s=function(g){var d=n||g.size||"1em",l,S="",T="";return g.className&&(l=g.className),e.className&&(l=l?"".concat(l," ").concat(e.className):e.className),i&&(l?l+=" twist-icon-loading":l="twist-icon-loading"),c&&(S="rotate(".concat(c,"deg)"),T="rotate(".concat(c,"deg)")),Y.createElement("svg",se({xmlns:"http://www.w3.org/2000/svg"},g.attrs,t,b,{className:l,style:ee(ee({color:y||g.color,msTransform:S,transform:T},g.style),e.style),width:d,height:d}),a&&Y.createElement("title",null,a),e.children)};return Ee!==void 0?Y.createElement(Ee.Consumer,null,function(v){return s(v)}):s(De)}function $r(e){var t={},n=e.split(";"),a=Tr(n),i;try{for(a.s();!(i=a.n()).done;){var c=i.value,y=c.split(":"),b=Er(y,2),s=b[0],v=b[1];if(s&&v){var g=s.trim().replace(/-./g,function(d){return d.charAt(1).toUpperCase()});t[g]=v.trim()}}}catch(d){a.e(d)}finally{a.f()}return t}function Be(e){return e&&e.map(function(t,n){return Y.createElement(t.tag,ee(ee({},t.attrs),{},{key:n,style:t.attrs.style?$r(t.attrs.style):null}),Be(t.children))})}function q(e){return function(t){return Y.createElement(Pr,se({attrs:ee({},e.attrs)},t),Be(e.children))}}function Ar(e){return q({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)}function Mr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M18.25 12L8.5 17.629V6.37z"}}]})(e)}function ze(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ze(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function $(){for(var e,t,n=0,a="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ze(e))&&(a&&(a+=" "),a+=t);return a}function Nr({bufferedPercentage:e,playedPercentage:t,onSeek:n}){const a=I("aplayer-bar"),i=I("aplayer-icon"),c=f.useRef(null),[y,b]=f.useState(t),s=f.useRef(!1);f.useEffect(()=>{s.current||b(t)},[t]);const v=f.useCallback(g=>{s.current=!0;const d=be(g,c);b(d);const l=T=>{const o=be(T,c);b(o)},S=T=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",S);const o=be(T,c);b(o),n==null||n(o),s.current=!1};document.addEventListener("mousemove",l),document.addEventListener("mouseup",S)},[n]);return m.jsx("div",{ref:c,className:$(a.b(),a.bs("vars")),onMouseDown:v,children:m.jsxs("div",{className:a.be("inner"),children:[typeof e<"u"?m.jsx("div",{className:a.be("loaded"),style:{width:`${e*100}%`}}):null,typeof y<"u"?m.jsx("div",{className:a.be("played"),style:{width:`${y*100}%`},children:m.jsx("span",{className:a.be("thumb"),children:m.jsx("span",{className:$(i.bs("loading")),children:m.jsx(Ar,{})})})}):null]})})}function qr(e){return q({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 kr(e){return q({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 Rr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14 19V5h4v14zm-8 0V5h4v14z"}}]})(e)}function Dr(e){return q({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 Ir(e){return q({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 Vr(e){return q({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 Fr(e){return q({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 Br(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M7 15V9h4l5-5v16l-5-5z"}}]})(e)}function zr(e){return q({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 Hr({volume:e,muted:t,onToggleMuted:n,onChangeVolume:a}){const i=I("aplayer-volumn"),c=I("aplayer-icon"),y=f.useRef(null),[b,s]=f.useState(!1),v=f.useCallback(g=>{a(ge(g,y)),s(!0);const d=S=>{a(ge(S,y))},l=S=>{document.removeEventListener("mouseup",l),document.removeEventListener("mousemove",d),s(!1),a(ge(S,y))};document.addEventListener("mousemove",d),document.addEventListener("mouseup",l)},[a]);return m.jsxs("div",{className:$(i.b(),i.bs("vars")),children:[m.jsx("button",{type:"button",className:$(c.b(),c.bs("volume-down")),onClick:()=>n(),children:t||!e?m.jsx(Br,{}):e>=1?m.jsx(zr,{}):m.jsx(Fr,{})}),m.jsx("div",{className:$(i.be("bar-wrap"),{[i.bem("bar-wrap","active")]:b}),ref:y,onMouseDown:v,children:m.jsx("div",{className:i.be("bar"),children:m.jsx("div",{className:i.be("thumb"),style:{height:t?0:`${e*100}%`}})})})]})}function He(e){if(typeof e>"u")return"--:--";if(Number.isNaN(e))return"00:00";const t=y=>y<10?`0${y}`:`${y}`,n=Math.trunc(e/60),a=Math.trunc(e-n*60),i=Math.trunc(n/60),c=Math.trunc(e/60-60*Math.trunc(e/60/60));return e>=3600?`${t(i)}:${t(c)}:${t(a)}`:`${t(n)}:${t(a)}`}function Wr(e){return q({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 Ur(e){return q({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 Yr(e){return q({attrs:{viewBox:"0 0 24 24"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3 6h18v2H3zm0 5h18v2H3zm0 5h18v2H3z"}}]})(e)}function Gr(e){return q({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 Kr(e){return q({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 Jr({volume:e,onChangeVolume:t,muted:n,currentTime:a,audioDurationSeconds:i,bufferedSeconds:c,onToggleMenu:y,onToggleMuted:b,order:s,onOrderChange:v,loop:g,onLoopChange:d,onSeek:l,isPlaying:S,onTogglePlay:T,onSkipForward:o,onSkipBack:p,showLyrics:_=!0,onToggleLyrics:x}){const j=I("aplayer-controller"),M=I("aplayer-icon"),re=f.useCallback(()=>{const V={list:"random",random:"list"}[s];v(V)},[s,v]),U=f.useCallback(()=>{const V={all:"one",one:"none",none:"all"}[g];d(V)},[g,d]);return m.jsxs("div",{className:$(j.b(),j.bs("vars")),children:[m.jsx(Nr,{playedPercentage:typeof a>"u"||typeof i>"u"?void 0:a/i,bufferedPercentage:typeof c>"u"||typeof i>"u"?void 0:c/i,onSeek:V=>l==null?void 0:l(V*i)}),m.jsxs("div",{className:j.be("time"),children:[m.jsxs("span",{className:j.be("time-inner"),children:[m.jsx("span",{className:j.be("ptime"),children:He(a)})," / ",m.jsx("span",{className:j.be("dtime"),children:He(i)})]}),m.jsx("span",{className:$(M.b(),M.bs("back")),onClick:p,children:m.jsx(Wr,{})}),m.jsx("span",{className:$(M.b(),M.bs("play")),onClick:T,children:S?m.jsx(Rr,{}):m.jsx(Dr,{})}),m.jsx("span",{className:$(M.b(),M.bs("forward")),onClick:o,children:m.jsx(Ur,{})}),m.jsx(Hr,{volume:e,muted:n,onToggleMuted:b,onChangeVolume:t}),m.jsx("button",{className:$(M.b(),M.bs("order")),onClick:re,type:"button",children:{list:m.jsx(qr,{}),random:m.jsx(Kr,{})}[s]}),m.jsx("button",{className:$(M.b(),M.bs("order")),onClick:U,type:"button",children:{all:m.jsx(Vr,{}),one:m.jsx(Ir,{}),none:m.jsx(Gr,{})}[g]}),m.jsx("button",{type:"button",className:$(M.b(),M.bs("menu")),onClick:()=>y==null?void 0:y(),children:m.jsx(Yr,{})}),m.jsx("button",{type:"button",className:$(M.b(),M.bs("lrc"),{[M.ns("lrc-inactivity")]:!_}),onClick:x,children:m.jsx(kr,{})})]})]})}function Xr({open:e,audio:t,playingAudioUrl:n,onPlayAudio:a,listMaxHeight:i}){const c=I("aplayer-list"),y=i?{maxHeight:i}:void 0,b=f.useCallback(v=>v?typeof v=="string"?v:v.name??"Audio artist":"Audio artist",[]),s=f.useRef(null);return f.useEffect(()=>{if(s.current){const v=s.current;return v.style.maxHeight=`${Math.min(v.scrollHeight,i??1/0)}px`,()=>{v.removeAttribute("style")}}},[i]),m.jsx("div",{ref:s,className:$(c.b(),{[c.bm("hide")]:!e}),children:m.jsx("ol",{style:y,children:t.map((v,g)=>m.jsxs("li",{className:$({[c.bm("active")]:v.url===n}),onClick:()=>{v.url!==n&&(a==null||a(v))},children:[m.jsx("span",{className:c.be("cur")}),m.jsx("span",{className:c.be("index"),children:g+1}),m.jsx("span",{className:c.be("title"),children:v.name??"Audio name"}),m.jsx("span",{className:c.be("author"),children:b(v.artist)})]},v.name||g))})})}function We({show:e,lrcText:t,currentTime:n}){const a=I("aplayer-lrc"),i=f.useMemo(()=>Qr(t),[t]),c=f.useMemo(()=>{for(let b=0;b<i.length;b++){const s=i[b],v=i[b+1];if(n>=s[0]&&(!v||n<v[0]))return b}return 0},[n,i]),y=f.useMemo(()=>({transform:`translateY(${-c*16}px)`,WebkitTransform:`translateY(${-c*16}px)`}),[c]);return m.jsx("div",{className:$(a.b(),{[a.bm("hide")]:!e}),children:t?m.jsx("div",{className:a.be("contents"),style:y,children:i.map(([,b],s)=>m.jsx("p",{className:$({[a.be("current")]:s===c}),children:b},s))}):null})}function Qr(e){if(e){e=e.replace(/([^\]^\n])\[/g,(i,c)=>`${c}
|
|
28
28
|
[`);const t=e.split(`
|
|
29
29
|
`),n=[],a=t.length;for(let i=0;i<a;i++){const c=t[i].match(/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/g),y=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(c){const b=c.length;for(let s=0;s<b;s++){const v=/\[(\d{2}):(\d{2})(\.(\d{2,3}))?\]/.exec(c[s]),g=v[1]*60,d=Number.parseInt(v[2]),l=v[4]?Number.parseInt(v[4])/(`${v[4]}`.length===2?100:1e3):0,S=g+d+l;n.push([S,y])}}}return n.sort((i,c)=>i[0]-c[0]),n}else return[]}var le={exports:{}},xe={};/**
|
|
30
30
|
* @license React
|
|
@@ -42,4 +42,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
42
42
|
*
|
|
43
43
|
* This source code is licensed under the MIT license found in the
|
|
44
44
|
* LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/return e.NODE_ENV!=="production"&&function(){function t(T,o){return T===o&&(T!==0||1/T===1/o)||T!==T&&o!==o}function n(T,o){d||c.startTransition===void 0||(d=!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 will not work correctly. Upgrade to a newer pre-release."));var p=o();if(!l){var _=o();y(p,_)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}_=b({inst:{value:p,getSnapshot:o}});var x=_[0].inst,w=_[1];return v(function(){x.value=p,x.getSnapshot=o,a(x)&&w({inst:x})},[T,p,o]),s(function(){return a(x)&&w({inst:x}),T(function(){a(x)&&w({inst:x})})},[T]),g(p),p}function a(T){var o=T.getSnapshot;T=T.value;try{var p=o();return!y(T,p)}catch{return!0}}function i(T,o){return o()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var c=f,y=typeof Object.is=="function"?Object.is:t,b=c.useState,s=c.useEffect,v=c.useLayoutEffect,g=c.useDebugValue,d=!1,l=!1,S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i:n;_e.useSyncExternalStore=c.useSyncExternalStore!==void 0?c.useSyncExternalStore:S,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}(),_e}var Ge;function rt(){if(Ge)return le.exports;Ge=1;var e={};return e.NODE_ENV==="production"?le.exports=Zr():le.exports=et(),le.exports}var W=rt();const G=[];function tt(e){const t=f.useRef();if(typeof document<"u"&&!t.current){const n=t.current=document.createElement("audio");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),G.includes(n)||G.push(n)}return f.useEffect(()=>{const n=t.current;if(n&&(e!=null&&e.onError))return n.addEventListener("error",e.onError),()=>{n.removeEventListener("error",e.onError)}},[e==null?void 0:e.onError]),f.useEffect(()=>{const n=t.current;if(n&&(e!=null&&e.onEnded))return n.addEventListener("ended",e.onEnded),()=>{n.removeEventListener("ended",e.onEnded)}},[e==null?void 0:e.onEnded]),f.useEffect(()=>()=>{const n=t.current;if(n){n.pause(),n.currentTime=0;const a=G.indexOf(n);a!==-1&&G.splice(a,1)}t.current=void 0},[]),t}function nt(e){const t=tt(e),n=f.useCallback(o=>{for(let p=0;p<G.length;p++){const _=G[p];_!==o&&!_.paused&&_.pause()}},[]),a=f.useCallback(async o=>{var _;const p=t.current;if(p){e.mutex&&n(p),p.src!==o&&(p.pause(),p.currentTime=0,p.src=o);try{await((_=t.current)==null?void 0:_.play())}catch{}}},[t,e.mutex,n]),i=f.useCallback(o=>{const p=t.current;p&&(p.paused?a(o):p.pause())},[t,a]),c=f.useCallback(o=>{t.current.currentTime=o},[t]),y=f.useCallback(()=>{t.current&&(t.current.muted=!t.current.muted)},[t]),b=f.useCallback(o=>{t.current&&(t.current.volume=o)},[t]),s=W.useSyncExternalStore(f.useCallback(o=>{var p;return(p=t.current)==null||p.addEventListener("volumechange",o),()=>{var _;(_=t.current)==null||_.removeEventListener("volumechange",o)}},[t]),()=>{var o;return(o=t.current)==null?void 0:o.volume},()=>{}),v=W.useSyncExternalStore(f.useCallback(o=>{var p;return(p=t.current)==null||p.addEventListener("volumechange",o),()=>{var _;(_=t.current)==null||_.removeEventListener("volumechange",o)}},[t]),()=>{var o;return(o=t.current)==null?void 0:o.muted},()=>{}),g=W.useSyncExternalStore(f.useCallback(o=>{var p;return(p=t.current)==null||p.addEventListener("timeupdate",o),()=>{var _;(_=t.current)==null||_.removeEventListener("timeupdate",o)}},[t]),()=>{if(t.current)return Math.round(t.current.currentTime)},()=>{}),d=W.useSyncExternalStore(f.useCallback(o=>{var p;return(p=t.current)==null||p.addEventListener("durationchange",o),()=>{var _;(_=t.current)==null||_.removeEventListener("durationchange",o)}},[t]),()=>{var o;return(o=t.current)==null?void 0:o.duration},()=>{}),l=W.useSyncExternalStore(f.useCallback(o=>{var p;return(p=t.current)==null||p.addEventListener("progress",o),()=>{var _;(_=t.current)==null||_.removeEventListener("progress",o)}},[t]),()=>{const o=t.current;return o&&o.buffered.length>0?o.buffered.end(o.buffered.length-1):0},()=>{}),S=W.useSyncExternalStore(f.useCallback(o=>{var p,_;return(p=t.current)==null||p.addEventListener("play",o),(_=t.current)==null||_.addEventListener("pause",o),()=>{var x,w;(x=t.current)==null||x.removeEventListener("play",o),(w=t.current)==null||w.removeEventListener("pause",o)}},[t]),()=>{const o=t.current;return o?!o.paused:!1},()=>{}),T=W.useSyncExternalStore(f.useCallback(o=>{var p,_;return(p=t.current)==null||p.addEventListener("playing",o),(_=t.current)==null||_.addEventListener("waiting",o),()=>{var x,w;(x=t.current)==null||x.removeEventListener("playing",o),(w=t.current)==null||w.removeEventListener("waiting",o)}},[t]),()=>{const o=t.current;return o?o.networkState===o.NETWORK_LOADING:!1},()=>{});return{playAudio:a,togglePlay:i,seek:c,toggleMuted:y,setVolume:b,volume:s,muted:v,currentTime:g,duration:d,bufferedSeconds:l,isPlaying:S,isLoading:T}}function Ke(){const e=f.useRef([]);return f.useEffect(()=>{const n=e.current;return()=>{for(const a of n)clearTimeout(a)}},[]),f.useCallback((n,a)=>{const i=setTimeout(n,a);return e.current.push(i),i},[])}function at(){const e=f.useRef(),[t,n]=f.useState({text:"",style:{opacity:0}}),a=Ke(),i=f.useCallback((c,y=2e3)=>{e.current&&clearTimeout(e.current),n({text:c,style:{opacity:1}}),e.current=a(()=>{n({text:c,style:{opacity:0}})},y)},[a]);return[t,i]}function ot(e){return it(e.slice())}function it(e){let t=e.length,n;for(;t!==0;)n=Math.floor(Math.random()*t),t--,[e[t],e[n]]=[e[n],e[t]];return e}function ut(e,{initialLoop:t="all",initialOrder:n="list",getSongId:a}){const[i,c]=f.useState(t),[y,b]=f.useState(n),s=f.useMemo(()=>y==="list"?e:ot(e),[e,y]),[v,g]=f.useState(s[0]);f.useEffect(()=>{const o=s.find(p=>a(p)===a(v));g(o||s[0])},[s,a,v]);const d=f.useMemo(()=>{if(i==="one")return{...v};const o=s.indexOf(v);if(o<s.length-1)return s[o+1];if(i!=="none")return s[0]},[s,v,i]),l=f.useCallback(()=>{d&&g(d)},[d,i]),S=f.useCallback(()=>{g(o=>{const p=s.indexOf(o);return p>0?s[p-1]:o})},[s]),T=f.useCallback(o=>{g(o)},[]);return{currentSong:v,hasNextSong:typeof d<"u",next:l,previous:S,prioritize:T,order:y,setOrder:b,loop:i,setLoop:c,length:s.length}}function st(e){return q({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 lt(e){return q({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 ct({audio:e,appearance:t="normal",volume:n=.7,initialLoop:a,initialOrder:i,autoPlay:c=!1,listMaxHeight:y=250,mini:b=!1,mutex:s=!0,listFolded:v=!1,theme:g="light"}){var ne,ae,oe;const d=I("aplayer"),l=ut(Array.isArray(e)?e:[e],{initialLoop:a,initialOrder:i,getSongId:L=>L.url}),[S,T]=at(),o=Ke(),p=f.useRef(),_=f.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=void 0)},[]),x=nt({src:l.currentSong.url,initialVolume:n,autoPlay:c,mutex:s,onError(L){const{error:de}=L.target;de&&T("An audio error has occurred, player will skip forward in 2 seconds."),l.hasNextSong&&(p.current=o(()=>{l.next()},2e3))},onEnded(){l.hasNextSong&&l.next()}});f.useEffect(()=>{c&&x.playAudio(l.currentSong.url)},[]);const w=f.useRef(!0);f.useEffect(()=>{w.current?w.current=!1:l.currentSong&&x.playAudio(l.currentSong.url)},[l.currentSong,x.playAudio]);const M=f.useCallback(()=>{_(),x.togglePlay(l.currentSong.url)},[x,_,l.currentSong.url]),re=f.useCallback(L=>L?typeof L=="string"?L:L.url?m.jsx("a",{href:L.url,target:"_blank",rel:"noreferrer",children:L.name??"Audio artist"}):L.name??"Audio artist":"Audio artist",[]),U=l.length>1,V=f.useMemo(()=>Array.isArray(e)?e:[e],[e]),{prioritize:ce}=l,Se=f.useCallback(L=>{_(),ce(L)},[_,ce]),[fe,Te]=f.useState(()=>U&&!v),[je,te]=f.useState(b),[D,F]=f.useState(!0),B=f.useRef(null);return f.useEffect(()=>{te(b)},[b]),f.useEffect(()=>{if(t==="fixed"&&B.current){const L=B.current;return L.style.width=`${L.offsetWidth-18}px`,()=>{L.removeAttribute("style")}}},[t]),m.jsxs("div",{className:$(d.b(),{[d.bs(g)]:!0,[d.bs("vars")]:!0,[d.bm("fixed")]:t==="fixed",[d.bm("loading")]:x.isLoading,[d.bm("withlist")]:U,[d.bm("withlrc")]:!!l.currentSong.lrc&&t!=="fixed",[d.bm("narrow")]:je}),children:[m.jsxs("div",{ref:B,className:d.be("body"),children:[m.jsx("div",{className:d.be("pic"),onClick:M,style:{backgroundImage:`url("${(ne=l.currentSong)==null?void 0:ne.cover}")`},children:m.jsx("div",{className:$(d.be("button"),x.isPlaying?d.bm("pause"):d.bm("play")),children:x.isPlaying?m.jsx(lt,{}):m.jsx(Mr,{})})}),m.jsxs("div",{className:$(d.be("info")),children:[m.jsxs("div",{className:$(d.be("music")),children:[m.jsx("span",{className:$(d.be("title")),children:((ae=l.currentSong)==null?void 0:ae.name)??"Audio name"}),m.jsxs("span",{className:$(d.be("author")),children:[" ","-"," ",re((oe=l.currentSong)==null?void 0:oe.artist)]})]}),t==="fixed"?null:m.jsx(We,{show:D,lrcText:l.currentSong.lrc,currentTime:x.currentTime??0}),m.jsx(Jr,{volume:x.volume??n,onChangeVolume:x.setVolume,muted:x.muted??!1,onToggleMuted:()=>x.toggleMuted(),currentTime:x.currentTime,audioDurationSeconds:x.duration,bufferedSeconds:x.bufferedSeconds,onSeek:L=>x.seek(L),onToggleMenu:()=>Te(L=>!L),order:l.order,onOrderChange:l.setOrder,loop:l.loop,onLoopChange:l.setLoop,isPlaying:x.isPlaying??!1,onTogglePlay:M,onSkipForward:()=>{l.hasNextSong&&l.next()},onSkipBack:()=>{l.previous()},showLyrics:D,onToggleLyrics:()=>{F(L=>!L)}})]}),m.jsx("div",{className:d.be("notice"),style:S.style,children:S.text}),m.jsx("div",{className:d.be("miniswitcher"),onClick:()=>te(L=>!L),children:m.jsx("button",{className:d.bs("icon"),type:"button",children:m.jsx(st,{})})})]}),U?m.jsx(Xr,{open:fe,audio:V,playingAudioUrl:l.currentSong.url,onPlayAudio:Se,listMaxHeight:y}):null,t==="fixed"&&m.jsx(We,{show:D,lrcText:l.currentSong.lrc,currentTime:x.currentTime??0})]})}H.TwistAPlayer=ct,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
|
|
45
|
+
*/return e.NODE_ENV!=="production"&&function(){function t(T,o){return T===o&&(T!==0||1/T===1/o)||T!==T&&o!==o}function n(T,o){d||c.startTransition===void 0||(d=!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 will not work correctly. Upgrade to a newer pre-release."));var p=o();if(!l){var _=o();y(p,_)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),l=!0)}_=b({inst:{value:p,getSnapshot:o}});var x=_[0].inst,j=_[1];return v(function(){x.value=p,x.getSnapshot=o,a(x)&&j({inst:x})},[T,p,o]),s(function(){return a(x)&&j({inst:x}),T(function(){a(x)&&j({inst:x})})},[T]),g(p),p}function a(T){var o=T.getSnapshot;T=T.value;try{var p=o();return!y(T,p)}catch{return!0}}function i(T,o){return o()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var c=f,y=typeof Object.is=="function"?Object.is:t,b=c.useState,s=c.useEffect,v=c.useLayoutEffect,g=c.useDebugValue,d=!1,l=!1,S=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?i:n;_e.useSyncExternalStore=c.useSyncExternalStore!==void 0?c.useSyncExternalStore:S,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}(),_e}var Ge;function rt(){if(Ge)return le.exports;Ge=1;var e={};return e.NODE_ENV==="production"?le.exports=Zr():le.exports=et(),le.exports}var W=rt();const G=[];function tt(e){const t=f.useRef();if(typeof window<"u"&&!t.current){const n=t.current=document.createElement("audio");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),G.includes(n)||G.push(n)}return f.useEffect(()=>{if(typeof window>"u")return;const n=t.current;if(n&&(e!=null&&e.onError))return n.addEventListener("error",e.onError),()=>{n.removeEventListener("error",e.onError)}},[e==null?void 0:e.onError]),f.useEffect(()=>{if(typeof window>"u")return;const n=t.current;if(n&&(e!=null&&e.onEnded))return n.addEventListener("ended",e.onEnded),()=>{n.removeEventListener("ended",e.onEnded)}},[e==null?void 0:e.onEnded]),f.useEffect(()=>()=>{const n=t.current;if(n){n.pause(),n.currentTime=0;const a=G.indexOf(n);a!==-1&&G.splice(a,1)}t.current=void 0},[]),t}function nt(e){const t=tt(e),n=f.useCallback(o=>{for(let p=0;p<G.length;p++){const _=G[p];_!==o&&!_.paused&&_.pause()}},[]),a=f.useCallback(async o=>{var _;const p=t.current;if(p){e.mutex&&n(p),p.src!==o&&(p.pause(),p.currentTime=0,p.src=o);try{await((_=t.current)==null?void 0:_.play())}catch{}}},[t,e.mutex,n]),i=f.useCallback(o=>{const p=t.current;p&&(p.paused?a(o):p.pause())},[t,a]),c=f.useCallback(o=>{t.current.currentTime=o},[t]),y=f.useCallback(()=>{t.current&&(t.current.muted=!t.current.muted)},[t]),b=f.useCallback(o=>{t.current&&(t.current.volume=o)},[t]),s=W.useSyncExternalStore(f.useCallback(o=>{var p;return(p=t.current)==null||p.addEventListener("volumechange",o),()=>{var _;(_=t.current)==null||_.removeEventListener("volumechange",o)}},[t]),()=>{var o;return(o=t.current)==null?void 0:o.volume},()=>{}),v=W.useSyncExternalStore(f.useCallback(o=>{var p;return(p=t.current)==null||p.addEventListener("volumechange",o),()=>{var _;(_=t.current)==null||_.removeEventListener("volumechange",o)}},[t]),()=>{var o;return(o=t.current)==null?void 0:o.muted},()=>{}),g=W.useSyncExternalStore(f.useCallback(o=>{var p;return(p=t.current)==null||p.addEventListener("timeupdate",o),()=>{var _;(_=t.current)==null||_.removeEventListener("timeupdate",o)}},[t]),()=>{if(t.current)return Math.round(t.current.currentTime)},()=>{}),d=W.useSyncExternalStore(f.useCallback(o=>{var p;return(p=t.current)==null||p.addEventListener("durationchange",o),()=>{var _;(_=t.current)==null||_.removeEventListener("durationchange",o)}},[t]),()=>{var o;return(o=t.current)==null?void 0:o.duration},()=>{}),l=W.useSyncExternalStore(f.useCallback(o=>{var p;return(p=t.current)==null||p.addEventListener("progress",o),()=>{var _;(_=t.current)==null||_.removeEventListener("progress",o)}},[t]),()=>{const o=t.current;return o&&o.buffered.length>0?o.buffered.end(o.buffered.length-1):0},()=>{}),S=W.useSyncExternalStore(f.useCallback(o=>{var p,_;return(p=t.current)==null||p.addEventListener("play",o),(_=t.current)==null||_.addEventListener("pause",o),()=>{var x,j;(x=t.current)==null||x.removeEventListener("play",o),(j=t.current)==null||j.removeEventListener("pause",o)}},[t]),()=>{const o=t.current;return o?!o.paused:!1},()=>{}),T=W.useSyncExternalStore(f.useCallback(o=>{var p,_;return(p=t.current)==null||p.addEventListener("playing",o),(_=t.current)==null||_.addEventListener("waiting",o),()=>{var x,j;(x=t.current)==null||x.removeEventListener("playing",o),(j=t.current)==null||j.removeEventListener("waiting",o)}},[t]),()=>{const o=t.current;return o?o.networkState===o.NETWORK_LOADING:!1},()=>{});return{playAudio:a,togglePlay:i,seek:c,toggleMuted:y,setVolume:b,volume:s,muted:v,currentTime:g,duration:d,bufferedSeconds:l,isPlaying:S,isLoading:T}}function Ke(){const e=f.useRef([]);return f.useEffect(()=>{const n=e.current;return()=>{for(const a of n)clearTimeout(a)}},[]),f.useCallback((n,a)=>{const i=setTimeout(n,a);return e.current.push(i),i},[])}function at(){const e=f.useRef(),[t,n]=f.useState({text:"",style:{opacity:0}}),a=Ke(),i=f.useCallback((c,y=2e3)=>{e.current&&clearTimeout(e.current),n({text:c,style:{opacity:1}}),e.current=a(()=>{n({text:c,style:{opacity:0}})},y)},[a]);return[t,i]}function ot(e){return it(e.slice())}function it(e){let t=e.length,n;for(;t!==0;)n=Math.floor(Math.random()*t),t--,[e[t],e[n]]=[e[n],e[t]];return e}function ut(e,{initialLoop:t="all",initialOrder:n="list",getSongId:a}){const[i,c]=f.useState(t),[y,b]=f.useState(n),s=f.useMemo(()=>y==="list"?e:ot(e),[e,y]),[v,g]=f.useState(s[0]);f.useEffect(()=>{const o=s.find(p=>a(p)===a(v));g(o||s[0])},[s,a,v]);const d=f.useMemo(()=>{if(i==="one")return{...v};const o=s.indexOf(v);if(o<s.length-1)return s[o+1];if(i!=="none")return s[0]},[s,v,i]),l=f.useCallback(()=>{d&&g(d)},[d,i]),S=f.useCallback(()=>{g(o=>{const p=s.indexOf(o);return p>0?s[p-1]:o})},[s]),T=f.useCallback(o=>{g(o)},[]);return{currentSong:v,hasNextSong:typeof d<"u",next:l,previous:S,prioritize:T,order:y,setOrder:b,loop:i,setLoop:c,length:s.length}}function st(e){return q({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 lt(e){return q({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 ct({audio:e,appearance:t="normal",volume:n=.7,initialLoop:a,initialOrder:i,autoPlay:c=!1,listMaxHeight:y=250,mini:b=!1,mutex:s=!0,listFolded:v=!1,theme:g="light"}){var ne,ae,oe;const d=I("aplayer"),l=ut(Array.isArray(e)?e:[e],{initialLoop:a,initialOrder:i,getSongId:L=>L.url}),[S,T]=at(),o=Ke(),p=f.useRef(),_=f.useCallback(()=>{p.current&&(clearTimeout(p.current),p.current=void 0)},[]),x=nt({src:l.currentSong.url,initialVolume:n,autoPlay:c,mutex:s,onError(L){const{error:de}=L.target;de&&T("An audio error has occurred, player will skip forward in 2 seconds."),l.hasNextSong&&(p.current=o(()=>{l.next()},2e3))},onEnded(){l.hasNextSong&&l.next()}});f.useEffect(()=>{c&&x.playAudio(l.currentSong.url)},[]);const j=f.useRef(!0);f.useEffect(()=>{j.current?j.current=!1:l.currentSong&&x.playAudio(l.currentSong.url)},[l.currentSong,x.playAudio]);const M=f.useCallback(()=>{_(),x.togglePlay(l.currentSong.url)},[x,_,l.currentSong.url]),re=f.useCallback(L=>L?typeof L=="string"?L:L.url?m.jsx("a",{href:L.url,target:"_blank",rel:"noreferrer",children:L.name??"Audio artist"}):L.name??"Audio artist":"Audio artist",[]),U=l.length>1,V=f.useMemo(()=>Array.isArray(e)?e:[e],[e]),{prioritize:ce}=l,Se=f.useCallback(L=>{_(),ce(L)},[_,ce]),[fe,Te]=f.useState(()=>U&&!v),[we,te]=f.useState(b),[D,F]=f.useState(!0),B=f.useRef(null);return f.useEffect(()=>{te(b)},[b]),f.useEffect(()=>{if(t==="fixed"&&B.current){const L=B.current;return L.style.width=`${L.offsetWidth-18}px`,()=>{L.removeAttribute("style")}}},[t]),m.jsxs("div",{className:$(d.b(),{[d.bs(g)]:!0,[d.bs("vars")]:!0,[d.bm("fixed")]:t==="fixed",[d.bm("loading")]:x.isLoading,[d.bm("withlist")]:U,[d.bm("withlrc")]:!!l.currentSong.lrc&&t!=="fixed",[d.bm("narrow")]:we}),children:[m.jsxs("div",{ref:B,className:d.be("body"),children:[m.jsx("div",{className:d.be("pic"),onClick:M,style:{backgroundImage:`url("${(ne=l.currentSong)==null?void 0:ne.cover}")`},children:m.jsx("div",{className:$(d.be("button"),x.isPlaying?d.bm("pause"):d.bm("play")),children:x.isPlaying?m.jsx(lt,{}):m.jsx(Mr,{})})}),m.jsxs("div",{className:$(d.be("info")),children:[m.jsxs("div",{className:$(d.be("music")),children:[m.jsx("span",{className:$(d.be("title")),children:((ae=l.currentSong)==null?void 0:ae.name)??"Audio name"}),m.jsxs("span",{className:$(d.be("author")),children:[" ","-"," ",re((oe=l.currentSong)==null?void 0:oe.artist)]})]}),t==="fixed"?null:m.jsx(We,{show:D,lrcText:l.currentSong.lrc,currentTime:x.currentTime??0}),m.jsx(Jr,{volume:x.volume??n,onChangeVolume:x.setVolume,muted:x.muted??!1,onToggleMuted:()=>x.toggleMuted(),currentTime:x.currentTime,audioDurationSeconds:x.duration,bufferedSeconds:x.bufferedSeconds,onSeek:L=>x.seek(L),onToggleMenu:()=>Te(L=>!L),order:l.order,onOrderChange:l.setOrder,loop:l.loop,onLoopChange:l.setLoop,isPlaying:x.isPlaying??!1,onTogglePlay:M,onSkipForward:()=>{l.hasNextSong&&l.next()},onSkipBack:()=>{l.previous()},showLyrics:D,onToggleLyrics:()=>{F(L=>!L)}})]}),m.jsx("div",{className:d.be("notice"),style:S.style,children:S.text}),m.jsx("div",{className:d.be("miniswitcher"),onClick:()=>te(L=>!L),children:m.jsx("button",{className:d.bs("icon"),type:"button",children:m.jsx(st,{})})})]}),U?m.jsx(Xr,{open:fe,audio:V,playingAudioUrl:l.currentSong.url,onPlayAudio:Se,listMaxHeight:y}):null,t==="fixed"&&m.jsx(We,{show:D,lrcText:l.currentSong.lrc,currentTime:x.currentTime??0})]})}H.TwistAPlayer=ct,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twist-aplayer",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "A shadui theme aplayer",
|
|
7
7
|
"author": {
|
|
@@ -20,17 +20,6 @@
|
|
|
20
20
|
"twist"
|
|
21
21
|
],
|
|
22
22
|
"sideEffects": ["*.css"],
|
|
23
|
-
"exports": {
|
|
24
|
-
".": {
|
|
25
|
-
"types": "./dist/index.d.ts",
|
|
26
|
-
"import": "./dist/index.mjs",
|
|
27
|
-
"require": "./dist/index.js"
|
|
28
|
-
},
|
|
29
|
-
"./dist/index.css": {
|
|
30
|
-
"import": "./dist/index.css",
|
|
31
|
-
"require": "./dist/index.css"
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
23
|
"main": "dist/index.js",
|
|
35
24
|
"module": "dist/index.mjs",
|
|
36
25
|
"unpkg": "dist/twist-aplayer.umd.js",
|