ecplayer 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -0
- package/dist/ecplayer.es.js +2607 -0
- package/dist/ecplayer.umd.js +266 -0
- package/dist/index.d.ts +124 -0
- package/dist/style.css +1 -0
- package/media/nanoaudioplayer.png +0 -0
- package/media/videoplayer.png +0 -0
- package/media/visualizeplayer.png +0 -0
- package/media/waveaudioplayer.png +0 -0
- package/package.json +46 -0
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
(function(ge,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],n):(ge=typeof globalThis<"u"?globalThis:ge||self,n(ge.EcPlayer={},ge.React))})(this,function(ge,n){"use strict";var et={exports:{}},$e={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var at;function ht(){if(at)return $e;at=1;var c=n,d=Symbol.for("react.element"),p=Symbol.for("react.fragment"),h=Object.prototype.hasOwnProperty,P=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0};function k(b,N,_){var M,O={},A=null,V=null;_!==void 0&&(A=""+_),N.key!==void 0&&(A=""+N.key),N.ref!==void 0&&(V=N.ref);for(M in N)h.call(N,M)&&!m.hasOwnProperty(M)&&(O[M]=N[M]);if(b&&b.defaultProps)for(M in N=b.defaultProps,N)O[M]===void 0&&(O[M]=N[M]);return{$$typeof:d,type:b,key:A,ref:V,props:O,_owner:P.current}}return $e.Fragment=p,$e.jsx=k,$e.jsxs=k,$e}var Ge={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var st;function yt(){return st||(st=1,process.env.NODE_ENV!=="production"&&function(){var c=n,d=Symbol.for("react.element"),p=Symbol.for("react.portal"),h=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),m=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),b=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),A=Symbol.for("react.lazy"),V=Symbol.for("react.offscreen"),U=Symbol.iterator,Y="@@iterator";function K(t){if(t===null||typeof t!="object")return null;var a=U&&t[U]||t[Y];return typeof a=="function"?a:null}var E=c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function v(t){{for(var a=arguments.length,u=new Array(a>1?a-1:0),y=1;y<a;y++)u[y-1]=arguments[y];je("error",t,u)}}function je(t,a,u){{var y=E.ReactDebugCurrentFrame,D=y.getStackAddendum();D!==""&&(a+="%s",u=u.concat([D]));var W=u.map(function(F){return String(F)});W.unshift("Warning: "+a),Function.prototype.apply.call(console[t],console,W)}}var pe=!1,Ee=!1,ne=!1,oe=!1,he=!1,me;me=Symbol.for("react.module.reference");function J(t){return!!(typeof t=="string"||typeof t=="function"||t===h||t===m||he||t===P||t===_||t===M||oe||t===V||pe||Ee||ne||typeof t=="object"&&t!==null&&(t.$$typeof===A||t.$$typeof===O||t.$$typeof===k||t.$$typeof===b||t.$$typeof===N||t.$$typeof===me||t.getModuleId!==void 0))}function we(t,a,u){var y=t.displayName;if(y)return y;var D=a.displayName||a.name||"";return D!==""?u+"("+D+")":u}function H(t){return t.displayName||"Context"}function L(t){if(t==null)return null;if(typeof t.tag=="number"&&v("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case h:return"Fragment";case p:return"Portal";case m:return"Profiler";case P:return"StrictMode";case _:return"Suspense";case M:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case b:var a=t;return H(a)+".Consumer";case k:var u=t;return H(u._context)+".Provider";case N:return we(t,t.render,"ForwardRef");case O:var y=t.displayName||null;return y!==null?y:L(t.type)||"Memo";case A:{var D=t,W=D._payload,F=D._init;try{return L(F(W))}catch{return null}}}return null}var z=Object.assign,ue=0,ye,ie,ae,C,x,B,se;function ke(){}ke.__reactDisabledLog=!0;function X(){{if(ue===0){ye=console.log,ie=console.info,ae=console.warn,C=console.error,x=console.group,B=console.groupCollapsed,se=console.groupEnd;var t={configurable:!0,enumerable:!0,value:ke,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}ue++}}function de(){{if(ue--,ue===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:z({},t,{value:ye}),info:z({},t,{value:ie}),warn:z({},t,{value:ae}),error:z({},t,{value:C}),group:z({},t,{value:x}),groupCollapsed:z({},t,{value:B}),groupEnd:z({},t,{value:se})})}ue<0&&v("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var te=E.ReactCurrentDispatcher,S;function le(t,a,u){{if(S===void 0)try{throw Error()}catch(D){var y=D.stack.trim().match(/\n( *(at )?)/);S=y&&y[1]||""}return`
|
|
18
|
+
`+S+t}}var re=!1,l;{var g=typeof WeakMap=="function"?WeakMap:Map;l=new g}function R(t,a){if(!t||re)return"";{var u=l.get(t);if(u!==void 0)return u}var y;re=!0;var D=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var W;W=te.current,te.current=null,X();try{if(a){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(xe){y=xe}Reflect.construct(t,[],F)}else{try{F.call()}catch(xe){y=xe}t.call(F.prototype)}}else{try{throw Error()}catch(xe){y=xe}t()}}catch(xe){if(xe&&y&&typeof xe.stack=="string"){for(var T=xe.stack.split(`
|
|
19
|
+
`),fe=y.stack.split(`
|
|
20
|
+
`),Z=T.length-1,ee=fe.length-1;Z>=1&&ee>=0&&T[Z]!==fe[ee];)ee--;for(;Z>=1&&ee>=0;Z--,ee--)if(T[Z]!==fe[ee]){if(Z!==1||ee!==1)do if(Z--,ee--,ee<0||T[Z]!==fe[ee]){var ve=`
|
|
21
|
+
`+T[Z].replace(" at new "," at ");return t.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",t.displayName)),typeof t=="function"&&l.set(t,ve),ve}while(Z>=1&&ee>=0);break}}}finally{re=!1,te.current=W,de(),Error.prepareStackTrace=D}var Ke=t?t.displayName||t.name:"",He=Ke?le(Ke):"";return typeof t=="function"&&l.set(t,He),He}function $(t,a,u){return R(t,!1)}function G(t){var a=t.prototype;return!!(a&&a.isReactComponent)}function q(t,a,u){if(t==null)return"";if(typeof t=="function")return R(t,G(t));if(typeof t=="string")return le(t);switch(t){case _:return le("Suspense");case M:return le("SuspenseList")}if(typeof t=="object")switch(t.$$typeof){case N:return $(t.render);case O:return q(t.type,a,u);case A:{var y=t,D=y._payload,W=y._init;try{return q(W(D),a,u)}catch{}}}return""}var f=Object.prototype.hasOwnProperty,j={},be=E.ReactDebugCurrentFrame;function Pe(t){if(t){var a=t._owner,u=q(t.type,t._source,a?a.type:null);be.setExtraStackFrame(u)}else be.setExtraStackFrame(null)}function Le(t,a,u,y,D){{var W=Function.call.bind(f);for(var F in t)if(W(t,F)){var T=void 0;try{if(typeof t[F]!="function"){var fe=Error((y||"React class")+": "+u+" type `"+F+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof t[F]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw fe.name="Invariant Violation",fe}T=t[F](a,F,y,u,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Z){T=Z}T&&!(T instanceof Error)&&(Pe(D),v("%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).",y||"React class",u,F,typeof T),Pe(null)),T instanceof Error&&!(T.message in j)&&(j[T.message]=!0,Pe(D),v("Failed %s type: %s",u,T.message),Pe(null))}}}var Re=Array.isArray;function Ae(t){return Re(t)}function Ce(t){{var a=typeof Symbol=="function"&&Symbol.toStringTag,u=a&&t[Symbol.toStringTag]||t.constructor.name||"Object";return u}}function We(t){try{return Me(t),!1}catch{return!0}}function Me(t){return""+t}function Oe(t){if(We(t))return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ce(t)),Me(t)}var ze=E.ReactCurrentOwner,Ve={key:!0,ref:!0,__self:!0,__source:!0},Ue,Ye;function Ie(t){if(f.call(t,"ref")){var a=Object.getOwnPropertyDescriptor(t,"ref").get;if(a&&a.isReactWarning)return!1}return t.ref!==void 0}function Je(t){if(f.call(t,"key")){var a=Object.getOwnPropertyDescriptor(t,"key").get;if(a&&a.isReactWarning)return!1}return t.key!==void 0}function Fe(t,a){typeof t.ref=="string"&&ze.current}function Se(t,a){{var u=function(){Ue||(Ue=!0,v("%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)",a))};u.isReactWarning=!0,Object.defineProperty(t,"key",{get:u,configurable:!0})}}function De(t,a){{var u=function(){Ye||(Ye=!0,v("%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)",a))};u.isReactWarning=!0,Object.defineProperty(t,"ref",{get:u,configurable:!0})}}var r=function(t,a,u,y,D,W,F){var T={$$typeof:d,type:t,key:a,ref:u,props:F,_owner:W};return T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(T,"_self",{configurable:!1,enumerable:!1,writable:!1,value:y}),Object.defineProperty(T,"_source",{configurable:!1,enumerable:!1,writable:!1,value:D}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T};function s(t,a,u,y,D){{var W,F={},T=null,fe=null;u!==void 0&&(Oe(u),T=""+u),Je(a)&&(Oe(a.key),T=""+a.key),Ie(a)&&(fe=a.ref,Fe(a,D));for(W in a)f.call(a,W)&&!Ve.hasOwnProperty(W)&&(F[W]=a[W]);if(t&&t.defaultProps){var Z=t.defaultProps;for(W in Z)F[W]===void 0&&(F[W]=Z[W])}if(T||fe){var ee=typeof t=="function"?t.displayName||t.name||"Unknown":t;T&&Se(F,ee),fe&&De(F,ee)}return r(t,T,fe,D,y,ze.current,F)}}var o=E.ReactCurrentOwner,i=E.ReactDebugCurrentFrame;function w(t){if(t){var a=t._owner,u=q(t.type,t._source,a?a.type:null);i.setExtraStackFrame(u)}else i.setExtraStackFrame(null)}var I;I=!1;function ce(t){return typeof t=="object"&&t!==null&&t.$$typeof===d}function Te(){{if(o.current){var t=L(o.current.type);if(t)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+t+"`."}return""}}function Be(t){return""}var Q={};function Xe(t){{var a=Te();if(!a){var u=typeof t=="string"?t:t.displayName||t.name;u&&(a=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+u+">.")}return a}}function xt(t,a){{if(!t._store||t._store.validated||t.key!=null)return;t._store.validated=!0;var u=Xe(a);if(Q[u])return;Q[u]=!0;var y="";t&&t._owner&&t._owner!==o.current&&(y=" It was passed a child from "+L(t._owner.type)+"."),w(t),v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',u,y),w(null)}}function gt(t,a){{if(typeof t!="object")return;if(Ae(t))for(var u=0;u<t.length;u++){var y=t[u];ce(y)&&xt(y,a)}else if(ce(t))t._store&&(t._store.validated=!0);else if(t){var D=K(t);if(typeof D=="function"&&D!==t.entries)for(var W=D.call(t),F;!(F=W.next()).done;)ce(F.value)&&xt(F.value,a)}}}function _t(t){{var a=t.type;if(a==null||typeof a=="string")return;var u;if(typeof a=="function")u=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===N||a.$$typeof===O))u=a.propTypes;else return;if(u){var y=L(a);Le(u,t.props,"prop",y,t)}else if(a.PropTypes!==void 0&&!I){I=!0;var D=L(a);v("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",D||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&v("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Pt(t){{for(var a=Object.keys(t.props),u=0;u<a.length;u++){var y=a[u];if(y!=="children"&&y!=="key"){w(t),v("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",y),w(null);break}}t.ref!==null&&(w(t),v("Invalid attribute `ref` supplied to `React.Fragment`."),w(null))}}var pt={};function mt(t,a,u,y,D,W){{var F=J(t);if(!F){var T="";(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(T+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var fe=Be();fe?T+=fe:T+=Te();var Z;t===null?Z="null":Ae(t)?Z="array":t!==void 0&&t.$$typeof===d?(Z="<"+(L(t.type)||"Unknown")+" />",T=" Did you accidentally export a JSX literal instead of a component?"):Z=typeof t,v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Z,T)}var ee=s(t,a,u,D,W);if(ee==null)return ee;if(F){var ve=a.children;if(ve!==void 0)if(y)if(Ae(ve)){for(var Ke=0;Ke<ve.length;Ke++)gt(ve[Ke],t);Object.freeze&&Object.freeze(ve)}else v("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 gt(ve,t)}if(f.call(a,"key")){var He=L(t),xe=Object.keys(a).filter(function(zt){return zt!=="key"}),nt=xe.length>0?"{key: someKey, "+xe.join(": ..., ")+": ...}":"{key: someKey}";if(!pt[He+nt]){var Ot=xe.length>0?"{"+xe.join(": ..., ")+": ...}":"{}";v(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,nt,He,Ot,He),pt[He+nt]=!0}}return t===h?Pt(ee):_t(ee),ee}}function At(t,a,u){return mt(t,a,u,!0)}function Ft(t,a,u){return mt(t,a,u,!1)}var Lt=Ft,Mt=At;Ge.Fragment=h,Ge.jsx=Lt,Ge.jsxs=Mt}()),Ge}process.env.NODE_ENV==="production"?et.exports=ht():et.exports=yt();var e=et.exports;/**
|
|
31
|
+
* @license lucide-react v0.540.0 - ISC
|
|
32
|
+
*
|
|
33
|
+
* This source code is licensed under the ISC license.
|
|
34
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
35
|
+
*/const bt=c=>c.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vt=c=>c.replace(/^([A-Z])|[\s-_]+(\w)/g,(d,p,h)=>h?h.toUpperCase():p.toLowerCase()),lt=c=>{const d=vt(c);return d.charAt(0).toUpperCase()+d.slice(1)},ot=(...c)=>c.filter((d,p,h)=>!!d&&d.trim()!==""&&h.indexOf(d)===p).join(" ").trim(),jt=c=>{for(const d in c)if(d.startsWith("aria-")||d==="role"||d==="title")return!0};/**
|
|
36
|
+
* @license lucide-react v0.540.0 - ISC
|
|
37
|
+
*
|
|
38
|
+
* This source code is licensed under the ISC license.
|
|
39
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
40
|
+
*/var wt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
41
|
+
* @license lucide-react v0.540.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/const kt=n.forwardRef(({color:c="currentColor",size:d=24,strokeWidth:p=2,absoluteStrokeWidth:h,className:P="",children:m,iconNode:k,...b},N)=>n.createElement("svg",{ref:N,...wt,width:d,height:d,stroke:c,strokeWidth:h?Number(p)*24/Number(d):p,className:ot("lucide",P),...!m&&!jt(b)&&{"aria-hidden":"true"},...b},[...k.map(([_,M])=>n.createElement(_,M)),...Array.isArray(m)?m:[m]]));/**
|
|
46
|
+
* @license lucide-react v0.540.0 - ISC
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the ISC license.
|
|
49
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/const Ne=(c,d)=>{const p=n.forwardRef(({className:h,...P},m)=>n.createElement(kt,{ref:m,iconNode:d,className:ot(`lucide-${bt(lt(c))}`,`lucide-${c}`,h),...P}));return p.displayName=lt(c),p};/**
|
|
51
|
+
* @license lucide-react v0.540.0 - ISC
|
|
52
|
+
*
|
|
53
|
+
* This source code is licensed under the ISC license.
|
|
54
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
+
*/const Nt=Ne("maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
|
|
56
|
+
* @license lucide-react v0.540.0 - ISC
|
|
57
|
+
*
|
|
58
|
+
* This source code is licensed under the ISC license.
|
|
59
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
+
*/const Et=Ne("minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]);/**
|
|
61
|
+
* @license lucide-react v0.540.0 - ISC
|
|
62
|
+
*
|
|
63
|
+
* This source code is licensed under the ISC license.
|
|
64
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
+
*/const Qe=Ne("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]);/**
|
|
66
|
+
* @license lucide-react v0.540.0 - ISC
|
|
67
|
+
*
|
|
68
|
+
* This source code is licensed under the ISC license.
|
|
69
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
+
*/const Ze=Ne("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);/**
|
|
71
|
+
* @license lucide-react v0.540.0 - ISC
|
|
72
|
+
*
|
|
73
|
+
* This source code is licensed under the ISC license.
|
|
74
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
+
*/const Rt=Ne("repeat",[["path",{d:"m17 2 4 4-4 4",key:"nntrym"}],["path",{d:"M3 11v-1a4 4 0 0 1 4-4h14",key:"84bu3i"}],["path",{d:"m7 22-4-4 4-4",key:"1wqhfi"}],["path",{d:"M21 13v1a4 4 0 0 1-4 4H3",key:"1rx37r"}]]);/**
|
|
76
|
+
* @license lucide-react v0.540.0 - ISC
|
|
77
|
+
*
|
|
78
|
+
* This source code is licensed under the ISC license.
|
|
79
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
+
*/const qe=Ne("sliders-vertical",[["line",{x1:"4",x2:"4",y1:"21",y2:"14",key:"1p332r"}],["line",{x1:"4",x2:"4",y1:"10",y2:"3",key:"gb41h5"}],["line",{x1:"12",x2:"12",y1:"21",y2:"12",key:"hf2csr"}],["line",{x1:"12",x2:"12",y1:"8",y2:"3",key:"1kfi7u"}],["line",{x1:"20",x2:"20",y1:"21",y2:"16",key:"1lhrwl"}],["line",{x1:"20",x2:"20",y1:"12",y2:"3",key:"16vvfq"}],["line",{x1:"2",x2:"6",y1:"14",y2:"14",key:"1uebub"}],["line",{x1:"10",x2:"14",y1:"8",y2:"8",key:"1yglbp"}],["line",{x1:"18",x2:"22",y1:"16",y2:"16",key:"1jxqpz"}]]);/**
|
|
81
|
+
* @license lucide-react v0.540.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*/const it=Ne("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
86
|
+
* @license lucide-react v0.540.0 - ISC
|
|
87
|
+
*
|
|
88
|
+
* This source code is licensed under the ISC license.
|
|
89
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
+
*/const Ct=Ne("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);/**
|
|
91
|
+
* @license lucide-react v0.540.0 - ISC
|
|
92
|
+
*
|
|
93
|
+
* This source code is licensed under the ISC license.
|
|
94
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
+
*/const tt=Ne("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
|
|
96
|
+
* @license lucide-react v0.540.0 - ISC
|
|
97
|
+
*
|
|
98
|
+
* This source code is licensed under the ISC license.
|
|
99
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
+
*/const rt=Ne("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]),_e={rainbow:{name:"Rainbow",bg:"linear-gradient(135deg, #ef444422 0%, #f9731622 15%, #f59e0b22 30%, #10b98122 45%, #06b6d422 60%, #3b82f622 75%, #6366f122 85%, #a855f722 92%, #ec489922 100%)",bars:["#ef4444","#f97316","#f59e0b","#eab308","#84cc16","#22c55e","#10b981","#06b6d4","#0ea5e9","#3b82f6","#6366f1","#8b5cf6","#a855f7","#d946ef","#ec4899","#f43f5e"],peak:"#a0a0a0ff",button:"#ec4899",buttonHover:"#d946ef",slider:"#ec4899"},ocean:{name:"Ocean Blue",bg:"linear-gradient(135deg, #667eea43 0%, #764ba243 100%)",bars:["#0ea5e9","#38bdf8","#06b6d4","#22d3ee"],peak:"#0369a1",button:"#0ea5e9",buttonHover:"#0284c7",slider:"#0ea5e9"},sunset:{name:"Sunset",bg:"linear-gradient(135deg, #f093fb43 0%, #f5576c43 100%)",bars:["#f43f5e","#fb7185","#fda4af","#fecdd3"],peak:"#be123c",button:"#f43f5e",buttonHover:"#e11d48",slider:"#f43f5e"},forest:{name:"Forest Green",bg:"linear-gradient(135deg, #0ba36043 0%, #3cba9243 100%)",bars:["#10b981","#34d399","#6ee7b7","#a7f3d0"],peak:"#047857",button:"#10b981",buttonHover:"#059669",slider:"#10b981"},midnight:{name:"Midnight",bg:"linear-gradient(135deg, #2c3e5043 0%, #3498db43 100%)",bars:["#3b82f6","#60a5fa","#93c5fd","#bfdbfe"],peak:"#1e40af",button:"#3b82f6",buttonHover:"#2563eb",slider:"#3b82f6"},neon:{name:"Neon Cyan",bg:"linear-gradient(135deg, #13547a43 0%, #80d0c743 100%)",bars:["#06b6d4","#22d3ee","#67e8f9","#a5f3fc"],peak:"#0e7490",button:"#06b6d4",buttonHover:"#0891b2",slider:"#06b6d4"},purple:{name:"Royal Purple",bg:"linear-gradient(135deg, #2f1c5622 0%, #764ba243 100%)",bars:["#8b5cf6","#a78bfa","#baabf9ff","#ddd6fe"],peak:"#6d28d9",button:"#8b5cf6",buttonHover:"#7c3aed",slider:"#8b5cf6"},amber:{name:"Amber Gold",bg:"linear-gradient(135deg, #f59e0b43 0%, #d9770643 100%)",bars:["#f59e0b","#fbbf24","#fcd34d","#fde68a"],peak:"#b45309",button:"#f59e0b",buttonHover:"#d97706",slider:"#f59e0b"},rose:{name:"Rose Pink",bg:"linear-gradient(135deg, #ec489943 0%, #be185d43 100%)",bars:["#ec4899","#f472b6","#f9a8d4","#fbcfe8"],peak:"#9f1239",button:"#ec4899",buttonHover:"#db2777",slider:"#ec4899"}};function ct({theme:c,setTheme:d,close:p}){const h=Object.keys(_e).map(P=>({key:P,name:_e[P].name,colors:_e[P].bars}));return e.jsxs("div",{className:"container-glass rounded-xl p-6 mb-6",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-800",children:"Choose Color Palette"}),e.jsx("button",{onClick:()=>p(),className:"text-gray-500 hover:text-gray-700 text-sm font-medium",children:"Close"})]}),e.jsx("div",{className:"theme-selector grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3",children:h.map(P=>e.jsxs("div",{className:`theme-card bg-white p-4 rounded-lg cursor-pointer border-2 transition-all ${c===P.key?"border-current shadow-lg":"border-transparent"}`,onClick:()=>d(P.key),children:[e.jsx("div",{className:"color-preview h-10 rounded mb-2",style:{background:`linear-gradient(to right, ${P.colors.join(", ")})`}}),e.jsx("div",{className:"text-sm font-medium text-gray-700",children:P.name})]},P.key))})]})}function ut({audio:c,name:d="No track loaded",author:p,theme:h="rainbow",volume:P=100,thumbnail:m=null,controls:k={play:!0,pause:!0,stop:!0,seekbar:!0,volume:!0,loop:!0,trackName:!0,equalizer:!0,speed:!0},mode:b="light",bands:N=null,transparent:_=!1,autoPlay:M=!1,equalizer:O={bass:0,mid:0,treble:0}}){const[A,V]=n.useState(!1),[U,Y]=n.useState(0),[K,E]=n.useState(0),[v,je]=n.useState(P||100),[pe,Ee]=n.useState(!1),[ne,oe]=n.useState(!1),[he,me]=n.useState(!1),[J,we]=n.useState([]),[H,L]=n.useState(!1),[z,ue]=n.useState({bass:O.bass||0,mid:O.mid||0,treble:O.treble||0}),[ye,ie]=n.useState(1),[ae,C]=n.useState(0),x=n.useRef(null),B=n.useRef(null),se=n.useRef(null),ke=n.useRef(null),X=n.useRef(null),de=n.useRef(null),te=n.useRef(null),S=n.useRef(null),le=n.useRef(null),re=n.useRef(null);n.useEffect(()=>{const r=re.current;if(!r)return;const s=new ResizeObserver(o=>{for(let i of o)C(i.contentRect.width)});return s.observe(r),()=>s.disconnect()},[]),n.useEffect(()=>{const r=[];if(c&&typeof c!="string"&&r.push(["TypeError","audio must be a string (URL or path)"]),d&&typeof d!="string"&&r.push(["TypeError","name must be a string"]),h&&typeof h!="string"&&typeof h!="object")r.push(["TypeError","theme must be a string or a valid theme object"]);else if(typeof h=="object"){const s=["name","bg","bars","peak","button","buttonHover","slider"];for(const o of s)o in h||r.push(["ThemeError",`theme object missing key: ${o}`])}(typeof P!="number"||P<0||P>100)&&r.push(["TypeError","volume must be a number between 0 and 100"]),typeof k!="object"||Array.isArray(k)?r.push(["TypeError","controls must be an object"]):["play","pause","stop","seekbar","volume","loop","trackName","equalizer"].forEach(o=>{k&&o in k&&typeof k[o]!="boolean"&&r.push(["TypeError",`controls.${o} must be a boolean`])}),N&&(Array.isArray(N)?N.length===0?r.push(["ValueError","bands array cannot be empty"]):N.forEach((s,o)=>{typeof s.freq!="number"&&r.push(["TypeError",`bands[${o}].freq must be a number`])}):r.push(["TypeError","bands must be an array"])),r.length>0?(we(r),console.group("%cVisualizePlayer: Prop validation failed","color:red"),r.forEach(s=>console.error(`${s[0]}: ${s[1]}`)),console.groupEnd()):we([])},[c,d,h,P,k,b,N]);const l=N||[{freq:0},{freq:10},{freq:20},{freq:25},{freq:31.5},{freq:40},{freq:50},{freq:63},{freq:80},{freq:100},{freq:125},{freq:160},{freq:200},{freq:250},{freq:315},{freq:400},{freq:500},{freq:630},{freq:800},{freq:1e3},{freq:1250},{freq:1600},{freq:2e3},{freq:2500},{freq:3150},{freq:4e3},{freq:5e3},{freq:6300},{freq:8e3},{freq:1e4},{freq:12500}],g=n.useRef(l.map(()=>0)),R=n.useRef(l.map(()=>0)),$=n.useRef(l.map(()=>0)),G=n.useRef(!1),q=n.useRef(typeof h=="string"?h:"purple");let f=typeof h=="string"?_e[h]||_e.purple:typeof h=="object"?h:_e.purple;const j=b==="dark",be=typeof k=="object"&&Object.keys(k).length===0;n.useEffect(()=>{typeof h=="string"?q.current=h:q.current="purple",Ce()},[h]),n.useEffect(()=>{x.current||(x.current=new Audio);const r=x.current,s=()=>{he||Y(r.currentTime)},o=()=>{E(r.duration)},i=()=>{ne||(V(!1),S.current&&cancelAnimationFrame(S.current))},w=()=>V(!0),I=()=>V(!1);return r.addEventListener("timeupdate",s),r.addEventListener("loadedmetadata",o),r.addEventListener("ended",i),r.addEventListener("play",w),r.addEventListener("pause",I),()=>{r.removeEventListener("timeupdate",s),r.removeEventListener("loadedmetadata",o),r.removeEventListener("ended",i),r.removeEventListener("play",w),r.removeEventListener("pause",I)}},[he,ne]),n.useEffect(()=>()=>{x.current&&(x.current.pause(),x.current.src="",x.current.load()),B.current&&B.current.close().catch(r=>console.warn("AudioContext cleanup error:",r)),S.current&&cancelAnimationFrame(S.current)},[]),n.useEffect(()=>{if(c){const r=A,s=v,o=ne;if(S.current&&(cancelAnimationFrame(S.current),S.current=null),ke.current){try{ke.current.disconnect()}catch(Q){console.warn("Source disconnect error:",Q)}ke.current=null}if(se.current){try{se.current.disconnect()}catch(Q){console.warn("Analyser disconnect error:",Q)}se.current=null}if(X.current){try{X.current.disconnect()}catch(Q){console.warn("Bass filter disconnect error:",Q)}X.current=null}if(de.current){try{de.current.disconnect()}catch(Q){console.warn("Mid filter disconnect error:",Q)}de.current=null}if(te.current){try{te.current.disconnect()}catch(Q){console.warn("Treble filter disconnect error:",Q)}te.current=null}B.current&&(B.current.close().catch(Q=>console.warn("AudioContext close error:",Q)),B.current=null),x.current&&(x.current.pause(),x.current.src="",x.current.load()),x.current=new Audio;try{x.current.crossOrigin="anonymous"}catch(Q){console.debug("Could not set crossOrigin on audio element",Q)}x.current.src=c,x.current.preload="auto",x.current.muted=!1,x.current.volume=pe?0:s/100,x.current.loop=o,x.current.load();const i=x.current,w=()=>{he||Y(i.currentTime)},I=()=>{E(i.duration)},ce=()=>{ne||(V(!1),S.current&&cancelAnimationFrame(S.current))},Te=()=>V(!0),Be=()=>V(!1);i.addEventListener("timeupdate",w),i.addEventListener("loadedmetadata",I),i.addEventListener("ended",ce),i.addEventListener("play",Te),i.addEventListener("pause",Be),Y(0),V(!1),console.debug("Audio element created",{src:x.current.src,volume:x.current.volume,loop:x.current.loop}),g.current=l.map(()=>0),R.current=l.map(()=>0),$.current=l.map(()=>0),Ce(),r&&x.current.play().catch(Q=>console.error("Play failed:",Q))}},[c]),n.useEffect(()=>{x.current&&(x.current.volume=pe?0:v/100)},[v,pe]),n.useEffect(()=>{x.current&&(x.current.loop=ne)},[ne]),n.useEffect(()=>{x.current&&(x.current.playbackRate=ye)},[ye]),n.useEffect(()=>{B.current&&(X.current&&(X.current.gain.value=z.bass),de.current&&(de.current.gain.value=z.mid),te.current&&(te.current.gain.value=z.treble))},[z]),n.useEffect(()=>{G.current=A,S.current&&(cancelAnimationFrame(S.current),S.current=null),A?(B.current||Pe(),Ae()):Re()},[A]);const Pe=()=>{if(!B.current&&x.current)try{const r=window.AudioContext||window.webkitAudioContext;if(r){const s=new r;B.current=s;const o=s.createBiquadFilter();o.type="lowshelf",o.frequency.value=320,o.gain.value=z.bass;const i=s.createBiquadFilter();i.type="peaking",i.frequency.value=1e3,i.Q.value=.5,i.gain.value=z.mid;const w=s.createBiquadFilter();w.type="highshelf",w.frequency.value=3200,w.gain.value=z.treble;const I=s.createAnalyser();I.fftSize=8192,I.smoothingTimeConstant=.7;const ce=s.createMediaElementSource(x.current);ce.connect(o),o.connect(i),i.connect(w),w.connect(I),I.connect(s.destination),X.current=o,de.current=i,te.current=w,se.current=I,ke.current=ce}}catch(r){console.error("Failed to setup audio context:",r)}},Le=r=>{const s=B.current,o=se.current;if(!s||!o)return 0;const i=s.sampleRate/2,w=Math.round(r/i*o.frequencyBinCount);return Math.min(w,o.frequencyBinCount-1)},Re=()=>{if(G.current)return;g.current=g.current.map(i=>i*.7);const r=Date.now();R.current=R.current.map((i,w)=>r-$.current[w]>1500?i*.95:i),Ce();const s=Math.max(...g.current),o=Math.max(...R.current);s>.01||o>.01?S.current=requestAnimationFrame(Re):(G.current||(g.current=l.map(()=>0),R.current=l.map(()=>0),$.current=l.map(()=>0),Ce()),S.current&&cancelAnimationFrame(S.current),S.current=null)},Ae=()=>{if(!se.current||!G.current)return;const r=se.current.frequencyBinCount,s=new Uint8Array(r);se.current.getByteFrequencyData(s),l.forEach((o,i)=>{const w=Le(o.freq),I=i<l.length-1?Le(l[i+1].freq):s.length;let ce=0,Te=0;for(let Xe=w;Xe<I;Xe++)ce+=s[Xe],Te++;let Be=Te>0?ce/Te/255:0;Be=Math.pow(Be,.6),g.current[i]=g.current[i]*.8+Be*.2;const Q=Date.now();g.current[i]>R.current[i]?(R.current[i]=g.current[i],$.current[i]=Q):Q-$.current[i]>1500&&(R.current[i]*=.95)}),Ce(),S.current=requestAnimationFrame(Ae)},Ce=()=>{if(!le.current)return;const r=_e[q.current]||_e.rainbow;let s="";l.forEach((o,i)=>{const w=g.current[i]*100,I=100-R.current[i]*100,ce=Math.floor(i/l.length*r.bars.length),Te=r.bars[Math.min(ce,r.bars.length-1)];s+=`
|
|
101
|
+
<div class="flex-1 h-full relative flex flex-col justify-end">
|
|
102
|
+
<div class="rounded-t transition-all duration-75" style="height: ${w}%; background: ${Te};">
|
|
103
|
+
${R.current[i]>.1?`<div class="absolute w-full h-0.5 transition-all duration-100" style="top: ${I}%; background: ${r.peak};"></div>`:""}
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
`}),le.current.innerHTML=s},We=()=>{!x.current||!c||(A?x.current.pause():(B.current&&B.current.state==="suspended"&&B.current.resume(),x.current.play().catch(r=>console.error("Play failed:",r))))},Me=()=>{x.current&&(x.current.pause(),x.current.currentTime=0,V(!1),Y(0),g.current=l.map(()=>0),R.current=l.map(()=>0),$.current=l.map(()=>0),Ce())},Oe=r=>{const o=parseFloat(r.target.value)/100*K;Y(o),x.current&&!he&&(x.current.currentTime=o)},ze=()=>{me(!0)},Ve=()=>{x.current&&(x.current.currentTime=U),me(!1)},Ue=r=>{const s=parseInt(r.target.value);je(s),Ee(s===0)},Ye=()=>{Ee(!pe)},Ie=r=>{ie(parseFloat(r.target.value))},Je=()=>{oe(!ne)},Fe=(r,s)=>{ue(o=>({...o,[r]:s}))},Se=()=>{ue({bass:0,mid:0,treble:0})};n.useEffect(()=>{((typeof k=="object"&&Object.keys(k).length===0||!k)&&!A||M)&&We()},[k]);const De=r=>{if(isNaN(r))return"0:00";const s=Math.floor(r/60),o=Math.floor(r%60);return`${s}:${o.toString().padStart(2,"0")}`};return J&&J.length>0?J.map((r,s)=>e.jsxs("div",{className:"text-red-500 text-sm bg-red-50 p-3 rounded mb-4 border border-red-300",children:[e.jsxs("strong",{children:[r[0],":"]})," ",r[1]]},s)):e.jsx("div",{ref:re,className:"w-full rounded-xl overflow-hidden",style:{backgroundColor:be||_?void 0:j?"#6060606a":"#ffffffab"},children:e.jsxs("div",{style:{background:be||_?void 0:f.bg},className:be||_?"":"p-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:`${_&&H?"opacity-30":""} ${be||_?"":j?"bg-black/40":"bg-white/70"} rounded-lg ${be?"":"mb-6"} ${be||_?"":"p-4"} shadow-sm`,children:e.jsx("div",{className:"flex justify-center items-end gap-1 h-64",ref:le})}),H&&e.jsxs("div",{className:`absolute inset-0 flex flex-col w-full justify-center z-10 ${!(be||_)&&(j?"bg-black/50":"bg-white/80")} rounded-lg p-4 shadow-sm transition-all duration-300`,children:[e.jsx("h3",{className:`text-sm font-medium mb-4 ${j?"text-gray-200":"text-gray-700"}`,children:"Equalizer"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:`text-xs ${j?"text-gray-300":"text-gray-600"}`,children:"Bass"}),e.jsxs("span",{className:`text-xs ${j?"text-gray-300":"text-gray-600"}`,children:[z.bass," dB"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs ${j?"text-gray-400":"text-gray-500"}`,children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:z.bass,onChange:r=>Fe("bass",parseInt(r.target.value)),className:"flex-1 h-8 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",style:{background:`linear-gradient(to right, ${f.slider} ${(z.bass+20)/40*100}%, ${f.slider+"30"} ${(z.bass+20)/40*100}%)`}}),e.jsx("span",{className:`text-xs ${j?"text-gray-400":"text-gray-500"}`,children:"+20"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:`text-xs ${j?"text-gray-300":"text-gray-600"}`,children:"Mid"}),e.jsxs("span",{className:`text-xs ${j?"text-gray-300":"text-gray-600"}`,children:[z.mid," dB"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs ${j?"text-gray-400":"text-gray-500"}`,children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:z.mid,onChange:r=>Fe("mid",parseInt(r.target.value)),className:"flex-1 h-8 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",style:{background:`linear-gradient(to right, ${f.slider} ${(z.mid+20)/40*100}%, ${f.slider+"30"} ${(z.mid+20)/40*100}%)`}}),e.jsx("span",{className:`text-xs ${j?"text-gray-400":"text-gray-500"}`,children:"+20"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:`text-xs ${j?"text-gray-300":"text-gray-600"}`,children:"Treble"}),e.jsxs("span",{className:`text-xs ${j?"text-gray-300":"text-gray-600"}`,children:[z.treble," dB"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs ${j?"text-gray-400":"text-gray-500"}`,children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:z.treble,onChange:r=>Fe("treble",parseInt(r.target.value)),className:"flex-1 h-8 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",style:{background:`linear-gradient(to right, ${f.slider} ${(z.treble+20)/40*100}%, ${f.slider+"30"} ${(z.treble+20)/40*100}%)`}}),e.jsx("span",{className:`text-xs ${j?"text-gray-400":"text-gray-500"}`,children:"+20"})]})]})]}),e.jsx("div",{className:"flex justify-end mt-4",children:e.jsx("button",{onClick:Se,className:`px-3 py-1 rounded text-xs ${j?"bg-gray-700 text-gray-200 hover:bg-gray-600":"bg-gray-200 text-gray-700 hover:bg-gray-300"} transition-all`,children:"Reset"})})]})]}),k.trackName&&e.jsxs("div",{className:"mb-6 flex items-center",children:[m&&e.jsx("div",{className:"mr-2",children:e.jsx("img",{src:m,alt:"",className:`${A?"animation-spin":""} h-12 w-12 rounded-full`})}),e.jsxs("div",{children:[e.jsx("div",{className:`${j?"text-gray-100":"text-gray-700"} font-medium truncate`,children:d}),p&&typeof p=="string"&&e.jsx("div",{className:`${j?"text-gray-300":"text-gray-500"} text-xs`,children:p})]})]}),k.seekbar&&e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"flex items-center md:gap-1",children:[e.jsx("span",{className:`text-xs ${j?"text-gray-100":"text-gray-600"} font-mono w-12`,children:De(U)}),e.jsx("input",{type:"range",min:"0",max:"100",value:K>0?U/K*100:0,onChange:Oe,onMouseDown:ze,onMouseUp:Ve,onTouchStart:ze,onTouchEnd:Ve,disabled:!c,className:"flex-1 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:c&&K>0?`linear-gradient(to right, ${f.slider} ${U/K*100}%, ${f.slider+"30"} ${U/K*100}%)`:f.slider+"30"}}),e.jsx("span",{className:`text-xs ${j?"text-gray-100":"text-gray-600"} font-mono w-12 text-right`,children:De(K)})]})}),e.jsxs("div",{className:`flex flex-wrap items-center ${ae<330?"gap-2":"gap-3"}`,children:[k.play&&e.jsxs("button",{onClick:We,disabled:!c,className:`${ae<350?"px-3 py-5":"px-4 py-2 md:w-24"} rounded-full text-sm font-medium text-white disabled:opacity-40 disabled:cursor-not-allowed flex items-center gap-2 transition-all hover:opacity-90`,style:{backgroundColor:f.button},children:[e.jsxs("div",{className:"relative w-4 flex items-center",children:[e.jsx(Qe,{size:16,className:`${A?"":"scale-0 translate-y-10"} transition-all absolute`}),e.jsx(Ze,{size:16,className:`${A?"scale-0 -translate-y-10":""} transition-all absolute`})]}),e.jsx("span",{style:{display:ae<350?"none":"block"},children:A?"Pause":"Play"})]}),k.stop&&e.jsxs("button",{onClick:Me,disabled:!c,className:`${j?"bg-gray-100 text-black":"bg-gray-700 text-white"} ${ae<600?"px-3 py-3":"px-4 py-2"} rounded-full text-sm font-medium ${j?"hover:bg-gray-300":"hover:bg-gray-800"} disabled:opacity-40 disabled:cursor-not-allowed flex items-center gap-2 transition-all`,children:[e.jsx(it,{size:16}),e.jsx("span",{style:{display:ae<600?"none":"block"},children:"Stop"})]}),k.equalizer&&e.jsxs("button",{onClick:()=>L(!H),disabled:!c,className:`${ae<600?"px-3 py-3":"px-4 py-2"} rounded-full text-sm font-medium flex items-center gap-2 transition-all ${H?"text-white":"bg-gray-100 text-gray-700 hover:bg-gray-300"} disabled:opacity-40 disabled:cursor-not-allowed`,style:H?{backgroundColor:f.button}:{},children:[e.jsx(qe,{size:16}),e.jsx("span",{style:{display:ae<600?"none":"block"},children:"EQ"})]}),k.loop&&e.jsxs("button",{onClick:Je,disabled:!c,className:`${ae<700?"px-3 py-3":"px-4 py-2"} rounded-full text-sm font-medium flex items-center gap-2 transition-all ${ne?"text-white":"bg-gray-100 text-gray-700 hover:bg-gray-300"} disabled:opacity-40 disabled:cursor-not-allowed`,style:ne?{backgroundColor:f.button}:{},children:[e.jsx(Rt,{size:16,className:`${ne?"rotate-180":""} transition-all`}),e.jsx("span",{style:{display:ae<700?"none":"block"},children:"Loop"})]}),k.speed&&e.jsx("div",{className:"flex items-center",children:e.jsxs("select",{value:ye,onChange:Ie,className:`rounded-full text-sm font-medium border-none outline-none cursor-pointer transition-all bg-transparent ${j?"text-gray-200":"text-gray-800"}`,children:[e.jsx("option",{value:"0.5",className:j?"bg-gray-800 text-gray-100":"bg-white text-gray-800",children:"0.5x"}),e.jsx("option",{value:"0.75",className:j?"bg-gray-800 text-gray-100":"bg-white text-gray-800",children:"0.75x"}),e.jsx("option",{value:"1",className:j?"bg-gray-800 text-gray-100":"bg-white text-gray-800",children:"1x"}),e.jsx("option",{value:"1.25",className:j?"bg-gray-800 text-gray-100":"bg-white text-gray-800",children:"1.25x"}),e.jsx("option",{value:"1.5",className:j?"bg-gray-800 text-gray-100":"bg-white text-gray-800",children:"1.5x"}),e.jsx("option",{value:"2",className:j?"bg-gray-800 text-gray-100":"bg-white text-gray-800",children:"2x"})]})}),k.volume&&e.jsxs("div",{className:"flex items-center gap-1 md:gap-3 ml-auto",children:[e.jsx("button",{onClick:Ye,className:"p-2 rounded-full hover:bg-gray-100/50 transition-all",children:pe||v===0?e.jsx(rt,{size:20,className:j?"text-gray-100":"text-gray-600"}):e.jsx(tt,{size:20,className:j?"text-gray-100":"text-gray-600"})}),e.jsx("input",{type:"range",min:"0",max:"100",value:v,onChange:Ue,className:"hide-for-xs w-24 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right, ${f.slider} ${v}%, ${f.slider+"30"} ${v}%)`,display:ae<460?"none":"block"}}),e.jsxs("span",{style:{display:ae<800?"none":"block"},className:`hidden sm:block text-xs ${j?"text-gray-100":"text-gray-700"} font-mono w-10 text-right`,children:[v,"%"]})]})]}),e.jsx("style",{children:`
|
|
107
|
+
input[type="range"]::-webkit-slider-thumb {
|
|
108
|
+
-webkit-appearance: none;
|
|
109
|
+
appearance: none;
|
|
110
|
+
width: 16px;
|
|
111
|
+
height: 16px;
|
|
112
|
+
border-radius: 50%;
|
|
113
|
+
background: ${f.slider};
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
border: 2px solid white;
|
|
116
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
input[type="range"]::-moz-range-thumb {
|
|
120
|
+
width: 16px;
|
|
121
|
+
height: 16px;
|
|
122
|
+
border-radius: 50%;
|
|
123
|
+
background: ${f.slider};
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
border: 2px solid white;
|
|
126
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
|
|
127
|
+
}
|
|
128
|
+
input[type="range"].eq-slider::-webkit-slider-thumb {
|
|
129
|
+
-webkit-appearance: none;
|
|
130
|
+
appearance: none;
|
|
131
|
+
width: 0;
|
|
132
|
+
height: 0;
|
|
133
|
+
background: transparent;
|
|
134
|
+
border: none;
|
|
135
|
+
box-shadow: none;
|
|
136
|
+
}
|
|
137
|
+
input[type="range"].eq-slider::-moz-range-thumb {
|
|
138
|
+
width: 0;
|
|
139
|
+
height: 0;
|
|
140
|
+
background: transparent;
|
|
141
|
+
border: none;
|
|
142
|
+
box-shadow: none;
|
|
143
|
+
}
|
|
144
|
+
.hide-for-xs {
|
|
145
|
+
display: flex;
|
|
146
|
+
}
|
|
147
|
+
@media (max-width: 480px) {
|
|
148
|
+
.hide-for-xs {
|
|
149
|
+
display: none;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
.animation-spin {
|
|
153
|
+
animation: spin 15s infinite linear;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
@keyframes spin {
|
|
157
|
+
from {
|
|
158
|
+
transform: rotate(0deg);
|
|
159
|
+
}
|
|
160
|
+
to {
|
|
161
|
+
transform: rotate(360deg)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
`})]})})}function dt({audio:c,gradient:d=["#cd7eff","#ff00f2"],background:p="#f4e4ffff",autoPlay:h=!1,thumbnail:P=null,width:m,equalizer:k={bass:0,mid:0,treble:0},mode:b="light"}){const[N,_]=n.useState(!1),[M,O]=n.useState(0),[A,V]=n.useState(0),[U,Y]=n.useState(!1),[K,E]=n.useState(80),[v,je]=n.useState(1),[pe,Ee]=n.useState([]),[ne,oe]=n.useState(null),[he,me]=n.useState(!1),[J,we]=n.useState({bass:k.bass||0,mid:k.mid||0,treble:k.treble||0}),H=n.useRef(null),L=n.useRef(null),z=n.useRef(null),ue=n.useRef(null),ye=n.useRef(null),ie=n.useRef(null),ae=()=>{const l=[];for(let g=0;g<100;g++){const R=20+Math.random()*60;l.push(R)}return l};n.useEffect(()=>{if(!c)return;if(!Array.isArray(d)||d.length<2){oe("Gradient must be an array with at least 2 colors");return}const l=H.current;if(!l)return;const g=()=>O(l.currentTime),R=()=>{V(l.duration),Ee(ae())},$=()=>_(!1),G=q=>{var f,j;oe(`Audio error: ${((j=(f=q.target)==null?void 0:f.error)==null?void 0:j.message)||"Failed to load audio"}`)};return l.addEventListener("timeupdate",g),l.addEventListener("loadedmetadata",R),l.addEventListener("ended",$),l.addEventListener("error",G),()=>{l.removeEventListener("timeupdate",g),l.removeEventListener("loadedmetadata",R),l.removeEventListener("ended",$),l.removeEventListener("error",G)}},[c,d,b]),n.useEffect(()=>{c&&H.current&&h&&(H.current.play().catch(l=>{console.error("Play failed:",l),_(!1)}),_(!0))},[c]),n.useEffect(()=>{if(H.current&&!L.current&&H.current){const l=window.AudioContext||window.webkitAudioContext;if(l){const g=new l;L.current=g;const R=g.createMediaElementSource(H.current);z.current=R;const $=g.createBiquadFilter();$.type="lowshelf",$.frequency.value=200,ue.current=$;const G=g.createBiquadFilter();G.type="peaking",G.frequency.value=1e3,G.Q.value=1,ye.current=G;const q=g.createBiquadFilter();q.type="highshelf",q.frequency.value=3e3,ie.current=q,R.connect($).connect(G).connect(q).connect(g.destination)}}},[c]),n.useEffect(()=>{H.current&&(H.current.volume=U?0:K/100)},[K,U]),n.useEffect(()=>{H.current&&(H.current.playbackRate=v)},[v]);const C=()=>{H.current&&(N?H.current.pause():H.current.play().catch(l=>{oe(`Playback failed: ${l instanceof Error?l.message:String(l)}`)}),_(!N))},x=()=>{Y(!U)},B=l=>{E(parseInt(l.target.value)),U&&parseInt(l.target.value)>0&&Y(!1)},se=l=>{je(parseFloat(l.target.value))},ke=l=>{const g=l.currentTarget.getBoundingClientRect(),G=(l.clientX-g.left)/g.width*A;H.current&&(H.current.currentTime=G,O(G))},X=(l,g)=>{we(R=>({...R,[l]:g})),l==="bass"&&ue.current&&(ue.current.gain.value=g),l==="mid"&&ye.current&&(ye.current.gain.value=g),l==="treble"&&ie.current&&(ie.current.gain.value=g)},de=()=>{X("bass",0),X("mid",0),X("treble",0)},te=l=>{if(isNaN(l))return"0:00";const g=Math.floor(l/60),R=Math.floor(l%60);return`${g}:${R.toString().padStart(2,"0")}`},S=A>0?M/A*100:0;if(ne)return e.jsx("div",{className:"w-lg p-6 rounded-xl",style:{background:p},children:e.jsxs("div",{className:`text-center ${b==="dark"?"text-red-300":"text-red-600"}`,children:[e.jsx("p",{className:"font-medium",children:"Error"}),e.jsx("p",{className:"text-sm",children:ne})]})});if(!c)return null;const le=b==="dark"?"text-gray-300":"text-gray-700",re=b==="dark"?"text-gray-400":"text-gray-500";return e.jsxs("div",{className:"w-full max-w-lg relative",style:{width:m+"px"},children:[e.jsx("audio",{ref:H,src:c}),e.jsx("div",{className:"rounded-2xl shadow-2xl",children:e.jsxs("div",{className:"rounded-2xl p-6 backdrop-blur-xl",style:{background:p},children:[P&&e.jsx("div",{className:"w-full p-4",children:e.jsx("img",{src:P,alt:"",className:"w-full aspect-square rounded-xl"})}),e.jsxs("div",{className:"relative h-20 mb-6 cursor-pointer",onClick:ke,children:[e.jsx("div",{className:"absolute inset-0 flex items-end justify-center h-full w-full gap-px",children:pe.map((l,g)=>{const $=g/pe.length*100<=S;return e.jsx("div",{className:"w-1 rounded-t transition-all duration-150",style:{height:`${l}%`,background:$?d[0]:d[1],opacity:$?1:.4}},g)})}),e.jsx("div",{className:"absolute top-0 h-full w-1 bg-white border-r border-black rounded-full transition-all duration-150",style:{left:`${S}%`,transform:"translateX(-50%)"}})]}),e.jsxs("div",{className:`flex justify-between text-sm ${re} mb-6`,children:[e.jsx("span",{children:te(M)}),e.jsx("span",{children:te(A)})]}),e.jsxs("div",{className:"grid grid-cols-3 items-center justify-between mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:x,className:"p-2 rounded-full transition-all",style:{background:`linear-gradient(135deg, ${d[0]}, ${d[1]})`},children:U||K===0?e.jsx(rt,{className:"w-4 h-4 text-white"}):e.jsx(tt,{className:"w-4 h-4 text-white"})}),e.jsx("input",{type:"range",min:"0",max:"100",value:K,onChange:B,className:`${m?"":"hidden sm:block"} w-20 h-1.5 rounded-lg appearance-none cursor-pointer`,style:{background:`linear-gradient(to right, ${d[0]} ${K}%, ${b==="dark"?"#374151":"#d1d5db"} ${K}%)`,display:m&&m<400?"none":void 0}}),m&&m<400&&e.jsx("div",{className:"flex items-center justify-end",children:e.jsx("button",{onClick:()=>me(!he),className:"p-2 rounded-full transition-all",style:{background:`linear-gradient(135deg, ${d[0]}, ${d[1]})`},children:e.jsx(qe,{className:"w-4 h-4 text-white"})})})]}),e.jsx("div",{className:"flex justify-center",children:e.jsx("button",{onClick:C,className:"p-4 rounded-full transition-all hover:scale-105 shadow-lg",style:{background:`linear-gradient(135deg, ${d[0]}, ${d[1]})`},children:N?e.jsx(Qe,{className:"w-6 h-6 text-white fill-white"}):e.jsx(Ze,{className:"w-6 h-6 text-white fill-white"})})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex items-center justify-end",children:e.jsxs("select",{value:v,style:{background:p,color:d[0]},onChange:se,className:`py-1 px-2 rounded-lg text-sm ${le} ${b==="dark"?"bg-gray-800":"bg-gray-100"}`,children:[e.jsx("option",{value:"0.5",children:"0.5x"}),e.jsx("option",{value:"0.75",children:"0.75x"}),e.jsx("option",{value:"1",children:"1x"}),e.jsx("option",{value:"1.25",children:"1.25x"}),e.jsx("option",{value:"1.5",children:"1.5x"}),e.jsx("option",{value:"2",children:"2x"})]})}),!(m&&m<400)&&e.jsx("div",{className:"flex items-center justify-end",children:e.jsx("button",{onClick:()=>me(!he),className:"p-2 rounded-full transition-all",style:{background:`linear-gradient(135deg, ${d[0]}, ${d[1]})`},children:e.jsx(qe,{className:"w-4 h-4 text-white"})})})]})]})]})}),he&&e.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-20 flex items-center justify-center z-10 rounded-2xl p-4",children:e.jsxs("div",{className:`max-w-xs w-full p-4 pt-2 rounded-xl ${b==="dark"?"bg-gray-800":"bg-white"}`,children:[e.jsx("h3",{className:`text-lg font-medium mb-2 ${b==="dark"?"text-gray-200":"text-gray-700"}`,children:"Equalizer"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:`text-xs ${b==="dark"?"text-gray-300":"text-gray-600"}`,children:"Bass"}),e.jsxs("span",{className:`text-xs ${b==="dark"?"text-gray-300":"text-gray-600"}`,children:[J.bass," dB"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs ${b==="dark"?"text-gray-400":"text-gray-500"}`,children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:J.bass,onChange:l=>X("bass",parseInt(l.target.value)),className:"flex-1 h-4 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",style:{background:`linear-gradient(to right, ${d[0]} ${(J.bass+20)/40*100}%, ${d[1]+"30"} ${(J.bass+20)/40*100}%)`}}),e.jsx("span",{className:`text-xs ${b==="dark"?"text-gray-400":"text-gray-500"}`,children:"+20"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:`text-xs ${b==="dark"?"text-gray-300":"text-gray-600"}`,children:"Mid"}),e.jsxs("span",{className:`text-xs ${b==="dark"?"text-gray-300":"text-gray-600"}`,children:[J.mid," dB"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs ${b==="dark"?"text-gray-400":"text-gray-500"}`,children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:J.mid,onChange:l=>X("mid",parseInt(l.target.value)),className:"flex-1 h-4 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",style:{background:`linear-gradient(to right, ${d[0]} ${(J.mid+20)/40*100}%, ${d[1]+"30"} ${(J.mid+20)/40*100}%)`}}),e.jsx("span",{className:`text-xs ${b==="dark"?"text-gray-400":"text-gray-500"}`,children:"+20"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:`text-xs ${b==="dark"?"text-gray-300":"text-gray-600"}`,children:"Treble"}),e.jsxs("span",{className:`text-xs ${b==="dark"?"text-gray-300":"text-gray-600"}`,children:[J.treble," dB"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs ${b==="dark"?"text-gray-400":"text-gray-500"}`,children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:J.treble,onChange:l=>X("treble",parseInt(l.target.value)),className:"flex-1 h-4 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",style:{background:`linear-gradient(to right, ${d[0]} ${(J.treble+20)/40*100}%, ${d[1]+"30"} ${(J.treble+20)/40*100}%)`}}),e.jsx("span",{className:`text-xs ${b==="dark"?"text-gray-400":"text-gray-500"}`,children:"+20"})]})]})]}),e.jsxs("div",{className:"flex justify-between mt-6",children:[e.jsx("button",{onClick:de,className:`px-3 py-1 rounded text-xs ${b==="dark"?"bg-gray-700 text-gray-200 hover:bg-gray-600":"bg-gray-200 text-gray-700 hover:bg-gray-300"} transition-all`,children:"Reset"}),e.jsx("button",{onClick:()=>me(!1),className:`px-3 py-1 rounded text-xs ${b==="dark"?"bg-gray-700 text-gray-200 hover:bg-gray-600":"bg-gray-200 text-gray-700 hover:bg-gray-300"} transition-all`,children:"Close"})]})]})}),e.jsx("style",{children:`
|
|
165
|
+
input[type="range"].eq-slider::-webkit-slider-thumb {
|
|
166
|
+
-webkit-appearance: none;
|
|
167
|
+
appearance: none;
|
|
168
|
+
width: 0;
|
|
169
|
+
height: 0;
|
|
170
|
+
background: transparent;
|
|
171
|
+
border: none;
|
|
172
|
+
box-shadow: none;
|
|
173
|
+
}
|
|
174
|
+
input[type="range"].eq-slider::-moz-range-thumb {
|
|
175
|
+
width: 0;
|
|
176
|
+
height: 0;
|
|
177
|
+
background: transparent;
|
|
178
|
+
border: none;
|
|
179
|
+
box-shadow: none;
|
|
180
|
+
}
|
|
181
|
+
`})]})}function ft({audio:c,thumbnail:d,gradient:p=["#cd7eff","#fe59f6"],background:h="#1f273a",autoPlay:P=!1}){const[m,k]=n.useState(!1),[,b]=n.useState(0),N=n.useRef(null),[_,M]=n.useState(0),[O,A]=n.useState(0),[V,U]=n.useState(0);n.useEffect(()=>{const E=N.current;if(!E)return;const v=()=>b(E.currentTime);return E.addEventListener("timeupdate",v),()=>E.removeEventListener("timeupdate",v)},[]),n.useEffect(()=>{const E=setInterval(()=>{m&&M(v=>v+.1)},100);return()=>clearInterval(E)},[m]),n.useEffect(()=>{const E=setInterval(()=>{m&&U(v=>v+.1)},100);return()=>clearInterval(E)},[m]),n.useEffect(()=>{c&&N.current&&P&&(N.current.play().catch(()=>k(!1)),k(!0))},[c]),n.useEffect(()=>{const E=N.current;if(!E)return;const v=()=>{A(E.duration),console.log("Audio duration:",E.duration)};return U(0),E.addEventListener("loadedmetadata",v),()=>{E.removeEventListener("loadedmetadata",v)}},[c]);const Y=()=>{N.current&&(m?N.current.pause():N.current.play().catch(E=>console.error("NanoPlayer play failed:",E)),k(!m))};if(!c)return null;const K={background:`linear-gradient(135deg, ${p[0]}, ${p[1]})`};return e.jsxs("div",{style:{backgroundColor:h},className:`
|
|
182
|
+
relative overflow-hidden inline-flex flex-col
|
|
183
|
+
${d?"rounded-2xl":"rounded-full"}
|
|
184
|
+
px-3 py-2 shadow-lg
|
|
185
|
+
${d?"w-[120px] h-[150px]":"w-[110px] h-[40px]"}
|
|
186
|
+
`,children:[e.jsx("audio",{ref:N,src:c,onEnded:()=>{k(!1),U(0)}}),e.jsx("div",{style:{width:`${(O>0?V/O:0)*100}%`,backgroundImage:K.background},className:"absolute top-0 left-0 h-full opacity-20"}),e.jsxs("div",{className:"absolute flex flex-col",children:[d&&e.jsx("div",{className:"w-24 pb-2",children:e.jsx("img",{src:d,alt:"",className:"w-24 aspect-square rounded-xl"})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:Y,style:K,className:"p-1.5 rounded-full hover:scale-110 transition-transform flex-shrink-0",children:m?e.jsx(Qe,{fill:h,className:"w-3 h-3 text-transparent"}):e.jsx(Ze,{fill:h,className:"w-3 h-3 text-transparent"})}),e.jsx("div",{className:"flex w-full min-w-12 items-center gap-0.5 h-6",children:[...Array(12)].map((E,v)=>e.jsx("div",{className:"rounded-full transition-all duration-200",style:{width:"100%",background:`linear-gradient(to top, ${p[0]}, ${p[1]})`,height:m?`${8+Math.sin((_*8+v)*.6)*10}px`:"8px",opacity:m?.8:.4}},v))})]})]})]})}function St({video:c,name:d="No video loaded",audioVisual:p=null,volume:h=100,thumbnail:P=null,controls:m={play:!0,pause:!0,stop:!0,seekbar:!0,volume:!0,fullscreen:!0,videoName:!0,equalizer:!0,speed:!0},mode:k="light",transparent:b=!1,autoPlay:N=!1,color:_="#3b82f6",equalizer:M={bass:0,mid:0,treble:0}}){const[O,A]=n.useState(!1),[V,U]=n.useState(0),[Y,K]=n.useState(0),[E,v]=n.useState(h||100),[je,pe]=n.useState(!1),[Ee,ne]=n.useState(!1),[oe,he]=n.useState(!1),[me,J]=n.useState([]),[we,H]=n.useState(!1),[L,z]=n.useState({bass:M.bass||0,mid:M.mid||0,treble:M.treble||0}),[ue,ye]=n.useState(1),[ie,ae]=n.useState(0),C=n.useRef(null),x=n.useRef(null),B=n.useRef(null),se=n.useRef(null),ke=n.useRef(null),X=n.useRef(null),de=n.useRef(null),te=n.useRef(null),S=n.useRef(null),le=n.useRef(null),re=n.useRef(0),l=n.useRef(0),g=n.useRef(0),R=n.useRef(0),$=n.useRef(0),G=n.useRef(0),q=n.useRef(!1),f=k==="dark"||oe,j=typeof m=="object"&&Object.keys(m).length===0;n.useEffect(()=>{const r=x.current;if(!r)return;const s=new ResizeObserver(o=>{for(let i of o)ae(i.contentRect.width)});return s.observe(r),()=>s.disconnect()},[]),n.useEffect(()=>{const r=[];c&&typeof c!="string"&&r.push(["TypeError","video must be a string (URL or path)"]),d&&typeof d!="string"&&r.push(["TypeError","name must be a string"]),(typeof h!="number"||h<0||h>100)&&r.push(["TypeError","volume must be a number between 0 and 100"]),p&&typeof p!="object"?r.push(["TypeError","audioVisual must be an object"]):p&&(["left","right","top","bottom"].includes(p.side)||r.push(["ValueError","audioVisual.side must be 'left', 'right', 'top', or 'bottom'"])),r.length>0?(J(r),console.group("%cVideoPlayer: Prop validation failed","color:red"),r.forEach(s=>console.error(`${s[0]}: ${s[1]}`)),console.groupEnd()):J([])},[c,d,h,p,m,k]),n.useEffect(()=>{if(!C.current)return;const r=C.current,s=()=>{Ee||U(r.currentTime)},o=()=>{K(r.duration)},i=()=>{A(!1),S.current&&cancelAnimationFrame(S.current)},w=()=>A(!0),I=()=>A(!1);return r.addEventListener("timeupdate",s),r.addEventListener("loadedmetadata",o),r.addEventListener("ended",i),r.addEventListener("play",w),r.addEventListener("pause",I),()=>{r.removeEventListener("timeupdate",s),r.removeEventListener("loadedmetadata",o),r.removeEventListener("ended",i),r.removeEventListener("play",w),r.removeEventListener("pause",I)}},[Ee]),n.useEffect(()=>{if(c){const r=O,s=E;if(C.current&&C.current.pause(),C.current){C.current.pause(),C.current.src=c,C.current.volume=je?0:s/100;const o=()=>{r&&C.current&&C.current.play().catch(i=>console.error("Play failed:",i)),C.current&&C.current.removeEventListener("canplay",o)};C.current.addEventListener("canplay",o),C.current.load()}U(0),A(!1),re.current=0,l.current=0,g.current=0,R.current=0,$.current=0,G.current=0,Re()}},[c]),n.useEffect(()=>{C.current&&(C.current.volume=je?0:E/100)},[E,je]),n.useEffect(()=>{C.current&&(C.current.playbackRate=ue)},[ue]),n.useEffect(()=>{B.current&&(X.current&&(X.current.gain.value=L.bass),de.current&&(de.current.gain.value=L.mid),te.current&&(te.current.gain.value=L.treble))},[L]),n.useEffect(()=>{q.current=O,S.current&&(cancelAnimationFrame(S.current),S.current=null),O&&p?(B.current||be(),Le()):!O&&p&&Pe()},[O,p]),n.useEffect(()=>{const r=()=>{he(!!document.fullscreenElement)};return document.addEventListener("fullscreenchange",r),()=>document.removeEventListener("fullscreenchange",r)},[]),n.useEffect(()=>()=>{S.current&&cancelAnimationFrame(S.current),B.current&&B.current.close().catch(r=>console.warn("AudioContext cleanup error:",r))},[]);const be=()=>{if(!B.current&&C.current)try{const r=window.AudioContext||window.webkitAudioContext;if(r){const s=new r;B.current=s;const o=s.createBiquadFilter();o.type="lowshelf",o.frequency.value=320,o.gain.value=L.bass;const i=s.createBiquadFilter();i.type="peaking",i.frequency.value=1e3,i.Q.value=.5,i.gain.value=L.mid;const w=s.createBiquadFilter();w.type="highshelf",w.frequency.value=3200,w.gain.value=L.treble;const I=s.createAnalyser();I.fftSize=2048,I.smoothingTimeConstant=.8;const ce=s.createMediaElementSource(C.current);ce.connect(o),o.connect(i),i.connect(w),w.connect(I),w.connect(s.destination),X.current=o,de.current=i,te.current=w,se.current=I,ke.current=ce}}catch(r){console.error("Failed to setup audio context:",r)}},Pe=()=>{if(q.current)return;re.current*=.7,l.current*=.7;const r=Date.now();r-$.current>1500&&(g.current*=.95),r-G.current>1500&&(R.current*=.95),Re();const s=Math.max(re.current,l.current),o=Math.max(g.current,R.current);s>.01||o>.01?S.current=requestAnimationFrame(Pe):(q.current||(re.current=0,l.current=0,g.current=0,R.current=0,Re()),S.current&&cancelAnimationFrame(S.current),S.current=null)},Le=()=>{if(!se.current||!q.current)return;const r=se.current.frequencyBinCount,s=new Uint8Array(r);se.current.getByteFrequencyData(s);let o=0;for(let I=0;I<r;I++)o+=s[I];let i=o/r/255;i=Math.pow(i,.5),re.current=re.current*.7+i*.3,l.current=l.current*.7+i*.3;const w=Date.now();re.current>g.current?(g.current=re.current,$.current=w):w-$.current>1500&&(g.current*=.95),l.current>R.current?(R.current=l.current,G.current=w):w-G.current>1500&&(R.current*=.95),Re(),S.current=requestAnimationFrame(Le)},Re=()=>{if(!le.current||!p)return;const r=p.color||"#00ff00",s=p.peak||"#ff0000",o=re.current*100,i=l.current*100,w=100-g.current*100,I=100-R.current*100;p.side==="top"||p.side==="bottom"?le.current.innerHTML=`
|
|
187
|
+
<div class="flex flex-col gap-1 h-full justify-center">
|
|
188
|
+
<div class="flex items-center justify-center gap-2">
|
|
189
|
+
<div class="text-xs ${f?"text-gray-100":"text-gray-900"} opacity-80 w-4 text-center">L</div>
|
|
190
|
+
<div class="relative flex-1 h-3 bg-black/40 rounded-full overflow-hidden flex justify-end">
|
|
191
|
+
<div class="h-full rounded-l-full transition-all duration-75" style="width: ${o}%; background: ${r};"></div>
|
|
192
|
+
${g.current>.1?`<div class="absolute top-0 w-1 h-full transition-all duration-100" style="right: ${g.current*100}%; background: ${s};"></div>`:""}
|
|
193
|
+
</div>
|
|
194
|
+
<div class="w-px h-4 bg-white/20"></div>
|
|
195
|
+
<div class="relative flex-1 h-3 bg-black/40 rounded-full overflow-hidden flex justify-start">
|
|
196
|
+
<div class="h-full rounded-r-full transition-all duration-75" style="width: ${i}%; background: ${r};"></div>
|
|
197
|
+
${R.current>.1?`<div class="absolute top-0 w-1 h-full transition-all duration-100" style="left: ${R.current*100}%; background: ${s};"></div>`:""}
|
|
198
|
+
</div>
|
|
199
|
+
<div class="text-xs ${f?"text-gray-100":"text-gray-900"} opacity-80 w-4 text-center">R</div>
|
|
200
|
+
</div>
|
|
201
|
+
</div>
|
|
202
|
+
`:le.current.innerHTML=`
|
|
203
|
+
<div class="flex gap-2 h-full">
|
|
204
|
+
<div class="flex-1 flex flex-col">
|
|
205
|
+
<div class="text-xs text-white opacity-70 text-center mb-1">L</div>
|
|
206
|
+
<div class="flex-1 relative flex flex-col justify-end bg-black/30 rounded-lg overflow-hidden">
|
|
207
|
+
<div class="rounded-t transition-all duration-75" style="height: ${o}%; background: ${r};">
|
|
208
|
+
${g.current>.1?`<div class="absolute w-full h-1 transition-all duration-100" style="top: ${w}%; background: ${s};"></div>`:""}
|
|
209
|
+
</div>
|
|
210
|
+
</div>
|
|
211
|
+
</div>
|
|
212
|
+
<div class="flex-1 flex flex-col">
|
|
213
|
+
<div class="text-xs text-white opacity-70 text-center mb-1">R</div>
|
|
214
|
+
<div class="flex-1 relative flex flex-col justify-end bg-black/30 rounded-lg overflow-hidden">
|
|
215
|
+
<div class="rounded-t transition-all duration-75" style="height: ${i}%; background: ${r};">
|
|
216
|
+
${R.current>.1?`<div class="absolute w-full h-1 transition-all duration-100" style="top: ${I}%; background: ${s};"></div>`:""}
|
|
217
|
+
</div>
|
|
218
|
+
</div>
|
|
219
|
+
</div>
|
|
220
|
+
`},Ae=()=>{!C.current||!c||(O?C.current.pause():(B.current&&B.current.state==="suspended"&&B.current.resume(),C.current.play().catch(r=>console.error("Play failed:",r))))},Ce=()=>{C.current&&(C.current.pause(),C.current.currentTime=0,A(!1),U(0),re.current=0,l.current=0,g.current=0,R.current=0,Re())},We=r=>{const o=parseFloat(r.target.value)/100*Y;U(o),C.current&&!Ee&&(C.current.currentTime=o)},Me=()=>ne(!0),Oe=()=>{C.current&&(C.current.currentTime=V),ne(!1)},ze=r=>{const s=parseInt(r.target.value);v(s),pe(s===0)},Ve=r=>{ye(parseFloat(r.target.value))},Ue=()=>pe(!je),Ye=()=>{x.current&&(document.fullscreenElement?document.exitFullscreen():x.current.requestFullscreen().catch(r=>console.error("Fullscreen failed:",r)))},Ie=(r,s)=>{z(o=>({...o,[r]:s})),B.current&&(r==="bass"&&X.current&&(X.current.gain.value=s),r==="mid"&&de.current&&(de.current.gain.value=s),r==="treble"&&te.current&&(te.current.gain.value=s))},Je=()=>{z({bass:0,mid:0,treble:0})},Fe=r=>{if(isNaN(r))return"0:00";const s=Math.floor(r/60),o=Math.floor(r%60);return`${s}:${o.toString().padStart(2,"0")}`};if(n.useEffect(()=>{(j&&!O||N)&&Ae()},[m]),me&&me.length>0)return me.map((r,s)=>e.jsxs("div",{className:"text-red-500 text-sm bg-red-50 p-3 rounded mb-4 border border-red-300",children:[e.jsxs("strong",{children:[r[0],":"]})," ",r[1]]},s));const Se=p?p.side:null,De=Se==="top"||Se==="bottom";return e.jsx("div",{ref:x,className:`rounded-xl overflow-hidden transition-all duration-300 ${oe?"fixed inset-0 z-[9999] flex flex-col h-screen w-screen bg-black":"relative"}`,style:{backgroundColor:j||b?void 0:f?"#49494937":"white"},children:e.jsxs("div",{style:{background:j||b?void 0:f?"#1a1a1ab0":"#f5f5f5",height:oe?"100%":"auto"},className:`${j||b?"":"p-4"} ${oe?"flex flex-col flex-1":""}`,children:[m.videoName&&!oe&&e.jsx("div",{className:"mb-4",children:e.jsx("div",{className:`${f?"text-gray-100":"text-gray-700"} font-medium`,children:d})}),e.jsxs("div",{className:`relative ${De?"flex flex-col gap-3":"flex gap-3"} ${oe?"flex-1 min-h-0":"mb-4"}`,children:[p&&Se==="top"&&e.jsx("div",{className:"w-full h-12",ref:le}),e.jsxs("div",{className:`flex ${!De&&"flex-1"} gap-3`,children:[p&&Se==="left"&&e.jsx("div",{className:"w-12 bg-black/50 rounded-lg p-1",ref:le}),e.jsxs("div",{className:`flex-1 ${f?"bg-black/70":"bg-white/70"} rounded-lg overflow-hidden relative`,children:[e.jsxs("video",{ref:C,className:"w-full h-full object-contain",poster:P||void 0,children:[c&&e.jsx("source",{src:c}),"Your browser does not support the video tag."]}),we&&e.jsx("div",{className:"absolute inset-0 flex flex-col w-full justify-center z-10 rounded-lg p-4 shadow-sm transition-all duration-300",children:e.jsxs("div",{className:`max-w-[600px] w-full mx-auto flex flex-col justify-center z-10 ${f?"bg-black/70":"bg-white/80"} rounded-lg p-4 shadow-sm transition-all duration-300`,children:[e.jsx("h3",{className:`text-sm font-medium mb-4 ${f?"text-gray-200":"text-gray-700"}`,children:"Equalizer"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:`text-xs ${f?"text-gray-300":"text-gray-600"}`,children:"Bass"}),e.jsxs("span",{className:`text-xs ${f?"text-gray-300":"text-gray-600"}`,children:[L.bass," dB"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs ${f?"text-gray-400":"text-gray-500"}`,children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:L.bass,onChange:r=>Ie("bass",parseInt(r.target.value)),className:"flex-1 h-6 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",style:{background:`linear-gradient(to right, ${_} ${(L.bass+20)/40*100}%, #e5e7eb ${(L.bass+20)/40*100}%)`}}),e.jsx("span",{className:`text-xs ${f?"text-gray-400":"text-gray-500"}`,children:"+20"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:`text-xs ${f?"text-gray-300":"text-gray-600"}`,children:"Mid"}),e.jsxs("span",{className:`text-xs ${f?"text-gray-300":"text-gray-600"}`,children:[L.mid," dB"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs ${f?"text-gray-400":"text-gray-500"}`,children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:L.mid,onChange:r=>Ie("mid",parseInt(r.target.value)),className:"flex-1 h-6 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",style:{background:`linear-gradient(to right, ${_} ${(L.mid+20)/40*100}%, #e5e7eb ${(L.mid+20)/40*100}%)`}}),e.jsx("span",{className:`text-xs ${f?"text-gray-400":"text-gray-500"}`,children:"+20"})]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex justify-between mb-1",children:[e.jsx("span",{className:`text-xs ${f?"text-gray-300":"text-gray-600"}`,children:"Treble"}),e.jsxs("span",{className:`text-xs ${f?"text-gray-300":"text-gray-600"}`,children:[L.treble," dB"]})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs ${f?"text-gray-400":"text-gray-500"}`,children:"-20"}),e.jsx("input",{type:"range",min:"-20",max:"20",value:L.treble,onChange:r=>Ie("treble",parseInt(r.target.value)),className:"flex-1 h-6 bg-gray-300 rounded-lg appearance-none cursor-pointer eq-slider",style:{background:`linear-gradient(to right, ${_} ${(L.treble+20)/40*100}%, #e5e7eb ${(L.treble+20)/40*100}%)`}}),e.jsx("span",{className:`text-xs ${f?"text-gray-400":"text-gray-500"}`,children:"+20"})]})]})]}),e.jsxs("div",{className:"flex justify-between mt-6",children:[e.jsx("button",{onClick:Je,className:`px-3 py-1 rounded text-xs ${f?"bg-gray-700 text-gray-200 hover:bg-gray-600":"bg-gray-200 text-gray-700 hover:bg-gray-300"} transition-all`,children:"Reset"}),e.jsx("button",{onClick:()=>H(!1),className:`ml-2 px-3 py-1 rounded text-xs ${f?"bg-gray-700 text-gray-200 hover:bg-gray-600":"bg-gray-200 text-gray-700 hover:bg-gray-300"} transition-all`,children:"Close"})]})]})})]}),p&&Se==="right"&&e.jsx("div",{className:"w-12 bg-black/50 rounded-lg p-1",ref:le})]}),p&&Se==="bottom"&&e.jsx("div",{className:"w-full h-12",ref:le})]}),m.seekbar&&e.jsx("div",{className:`mb-4 ${oe?"mt-3":""}`,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:`text-xs ${f?"text-gray-100":"text-gray-600"} font-mono w-12`,children:Fe(V)}),e.jsx("input",{type:"range",min:"0",max:"100",value:Y>0?V/Y*100:0,onChange:We,onMouseDown:Me,onMouseUp:Oe,onTouchStart:Me,onTouchEnd:Oe,disabled:!c,className:"flex-1 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer disabled:opacity-40 disabled:cursor-not-allowed",style:{background:c&&Y>0?`linear-gradient(to right, ${_} ${V/Y*100}%, #e5e7eb ${V/Y*100}%)`:"#e5e7eb"}}),e.jsx("span",{className:`text-xs ${f?"text-gray-100":"text-gray-600"} font-mono w-12 text-right`,children:Fe(Y)})]})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[m.play&&e.jsxs("button",{onClick:Ae,disabled:!c,style:{backgroundColor:_},className:`${ie>400?" px-4 py-2":"px-3 py-5"} rounded-full text-sm font-medium text-white hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed flex items-center gap-2 transition-all`,children:[e.jsxs("div",{className:"relative w-4 flex items-center",children:[e.jsx(Qe,{size:16,className:`${O?"":"scale-0 translate-y-10"} transition-all absolute`}),e.jsx(Ze,{size:16,className:`${O?"scale-0 -translate-y-10":""} transition-all absolute`})]}),ie>400&&(O?"Pause":"Play")]}),m.stop&&e.jsx("button",{onClick:Ce,disabled:!c,className:`${f?"bg-gray-100 text-black hover:bg-gray-300":"bg-gray-700 text-white hover:bg-gray-800"} px-3 py-3 rounded-full text-sm font-medium disabled:opacity-40 disabled:cursor-not-allowed flex items-center gap-2 transition-all`,children:e.jsx(it,{size:16})}),m.fullscreen&&e.jsxs("button",{onClick:Ye,className:`${ie<800?"px-3 py-3":"px-4 py-2"} rounded-full text-sm font-medium flex items-center gap-2 transition-all ${f?"bg-gray-100 text-black hover:bg-gray-300":"bg-gray-700 text-white hover:bg-gray-800"}`,children:[oe?e.jsx(Et,{size:16}):e.jsx(Nt,{size:16}),e.jsx("span",{style:{display:ie<800?"none":"block"},children:oe?"Exit":"Full"})]}),m.equalizer&&e.jsxs("button",{onClick:()=>H(!we),disabled:!c,className:`${ie<700?"px-3 py-3":"px-4 py-2"} rounded-full text-sm font-medium flex items-center gap-2 transition-all ${we?"text-white":"bg-gray-100 text-gray-700 hover:bg-gray-300"} disabled:opacity-40 disabled:cursor-not-allowed`,style:we?{backgroundColor:_}:{},children:[e.jsx(qe,{size:16}),e.jsx("span",{style:{display:ie<700?"none":"block"},children:"EQ"})]}),m.speed&&e.jsx("div",{className:"flex items-center",children:e.jsxs("select",{value:ue,onChange:Ve,className:`rounded-full text-sm font-medium border-none outline-none cursor-pointer transition-all bg-transparent ${f?"text-gray-200":"text-gray-800"}`,children:[e.jsx("option",{value:"0.5",className:f?"bg-gray-800 text-gray-100":"bg-gray-100 text-gray-800",children:"0.5x"}),e.jsx("option",{value:"0.75",className:f?"bg-gray-800 text-gray-100":"bg-gray-100 text-gray-800",children:"0.75x"}),e.jsx("option",{value:"1",className:f?"bg-gray-800 text-gray-100":"bg-gray-100 text-gray-800",children:"1x"}),e.jsx("option",{value:"1.25",className:f?"bg-gray-800 text-gray-100":"bg-gray-100 text-gray-800",children:"1.25x"}),e.jsx("option",{value:"1.5",className:f?"bg-gray-800 text-gray-100":"bg-gray-100 text-gray-800",children:"1.5x"}),e.jsx("option",{value:"2",className:f?"bg-gray-800 text-gray-100":"bg-gray-100 text-gray-800",children:"2x"})]})}),m.volume&&e.jsxs("div",{className:"flex items-center gap-1 md:gap-3 ml-auto",children:[e.jsx("button",{onClick:Ue,className:"p-2 rounded-lg hover:bg-gray-100 transition-all",children:je||E===0?e.jsx(rt,{size:20,className:f?"text-gray-100":"text-gray-600"}):e.jsx(tt,{size:20,className:f?"text-gray-100":"text-gray-600"})}),e.jsx("input",{type:"range",min:"0",max:"100",value:E,onChange:ze,className:"hide-for-xs w-24 h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right, ${_} ${E}%, #e5e7eb ${E}%)`,display:ie<460?"none":"block"}}),e.jsxs("span",{style:{display:ie<800?"none":"block"},className:`text-xs ${f?"text-gray-100":"text-gray-700"} font-mono w-10 text-right`,children:[E,"%"]})]})]}),e.jsx("style",{children:`
|
|
221
|
+
input[type="range"]::-webkit-slider-thumb {
|
|
222
|
+
-webkit-appearance: none;
|
|
223
|
+
appearance: none;
|
|
224
|
+
width: 16px;
|
|
225
|
+
height: 16px;
|
|
226
|
+
border-radius: 50%;
|
|
227
|
+
background: ${_};
|
|
228
|
+
cursor: pointer;
|
|
229
|
+
border: 2px solid white;
|
|
230
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
input[type="range"]::-moz-range-thumb {
|
|
234
|
+
width: 16px;
|
|
235
|
+
height: 16px;
|
|
236
|
+
border-radius: 50%;
|
|
237
|
+
background: ${_};
|
|
238
|
+
cursor: pointer;
|
|
239
|
+
border: 2px solid white;
|
|
240
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
|
|
241
|
+
}
|
|
242
|
+
input[type="range"].eq-slider::-webkit-slider-thumb {
|
|
243
|
+
-webkit-appearance: none;
|
|
244
|
+
appearance: none;
|
|
245
|
+
width: 0;
|
|
246
|
+
height: 0;
|
|
247
|
+
background: transparent;
|
|
248
|
+
border: none;
|
|
249
|
+
box-shadow: none;
|
|
250
|
+
}
|
|
251
|
+
input[type="range"].eq-slider::-moz-range-thumb {
|
|
252
|
+
width: 0;
|
|
253
|
+
height: 0;
|
|
254
|
+
background: transparent;
|
|
255
|
+
border: none;
|
|
256
|
+
box-shadow: none;
|
|
257
|
+
}
|
|
258
|
+
.hide-for-xs {
|
|
259
|
+
display: flex;
|
|
260
|
+
}
|
|
261
|
+
@media (max-width: 480px) {
|
|
262
|
+
.hide-for-xs {
|
|
263
|
+
display: none;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
`})]})})}function Tt(){const[c,d]=n.useState(null),[p,h]=n.useState("No track loaded"),[P,m]=n.useState("purple"),[k,b]=n.useState(!1),[N,_]=n.useState(!1),[M,O]=n.useState("light"),A=n.useRef(null),V=Y=>{var E;const K=(E=Y.target.files)==null?void 0:E[0];if(K){const v=URL.createObjectURL(K);d(v),h(K.name)}},U=()=>{var Y;(Y=A.current)==null||Y.click()};return e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4 md:p-8",style:{backgroundColor:M==="dark"?"#222":"white"},children:e.jsxs("div",{className:"w-full h-full md:h-auto md:max-w-4xl",children:[k&&e.jsx(ct,{theme:P,setTheme:m,close:()=>b(!1)}),e.jsxs("div",{className:"container-glass rounded-xl p-8",children:[e.jsxs("div",{className:"mb-6 flex justify-between items-start",children:[e.jsxs("div",{children:[e.jsx("h1",{className:`text-2xl font-semibold ${M==="dark"?"text-gray-200":"text-gray-800"} mb-1`,children:"Audio Visualizer"}),e.jsx("p",{className:"text-sm text-gray-500",children:"Professional frequency analyzer"})]}),e.jsxs("button",{onClick:()=>b(!k),className:"bg-white border border-gray-300 text-gray-700 px-4 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 flex items-center gap-2",children:[e.jsx("span",{children:"🎨"})," Themes"]})]}),e.jsx(ut,{audio:c||void 0,name:p||void 0,author:"K.Prabhasha",theme:P,autoPlay:!1,thumbnail:"https://cdn-icons-png.flaticon.com/512/3845/3845874.png",mode:M,transparent:N,volume:70,controls:{play:!0,pause:!0,stop:!0,seekbar:!0,volume:!0,loop:!0,trackName:!0}}),e.jsx(dt,{audio:c||"",width:400,thumbnail:"https://cdn-icons-png.flaticon.com/512/8316/8316619.png",autoPlay:!1,gradient:["#26ce3aff","#39eed9ff"],background:"#c0ffefff"}),e.jsx(ft,{audio:c||"",thumbnail:"https://cdn-icons-png.flaticon.com/512/17524/17524837.png",autoPlay:!1,gradient:["#26ce3aff","#39eed9ff"],background:"#c0ffefff"}),e.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-3",children:[e.jsx("input",{type:"file",ref:A,onChange:V,accept:"audio/*",className:"hidden"}),e.jsxs("button",{onClick:U,className:"bg-white border border-gray-300 text-gray-700 px-6 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 flex items-center gap-2",children:[e.jsx(Ct,{size:16}),"Load Audio"]}),e.jsx("button",{onClick:()=>O(M==="dark"?"light":"dark"),className:"bg-white border border-gray-300 text-gray-700 px-6 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 flex items-center gap-2",children:M==="dark"?"Light":"Dark"}),e.jsxs("button",{onClick:()=>_(!N),className:"bg-white border border-gray-300 text-gray-700 px-6 py-2 rounded-lg text-sm font-medium hover:bg-gray-50 flex items-center gap-2",children:["Transparent: ",String(N)]})]})]})]})})}ge.DemoVisualizePlayer=Tt,ge.NanoAudioPlayer=ft,ge.ThemeSelector=ct,ge.VideoPlayer=St,ge.VisualizePlayer=ut,ge.WaveAudioPlayer=dt,ge.themes=_e,Object.defineProperty(ge,Symbol.toStringTag,{value:"Module"})});
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
export declare function DemoVisualizePlayer(): JSX_2.Element;
|
|
4
|
+
|
|
5
|
+
export declare function NanoAudioPlayer({ audio: audioUrl, thumbnail, gradient: colors, background, autoPlay }: NanoAudioPlayerProps): JSX_2.Element | null;
|
|
6
|
+
|
|
7
|
+
export declare interface NanoAudioPlayerProps {
|
|
8
|
+
audio: string;
|
|
9
|
+
thumbnail?: string;
|
|
10
|
+
gradient?: string[];
|
|
11
|
+
background?: string;
|
|
12
|
+
autoPlay?: boolean;
|
|
13
|
+
mode?: 'light' | 'dark';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export declare interface Theme {
|
|
17
|
+
name: string;
|
|
18
|
+
bg: string;
|
|
19
|
+
bars: string[];
|
|
20
|
+
peak: string;
|
|
21
|
+
button: string;
|
|
22
|
+
buttonHover: string;
|
|
23
|
+
slider: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export declare type ThemeKey = 'rainbow' | 'ocean' | 'sunset' | 'forest' | 'midnight' | 'neon' | 'purple' | 'amber' | 'rose';
|
|
27
|
+
|
|
28
|
+
export declare type Themes = Record<ThemeKey, Theme>;
|
|
29
|
+
|
|
30
|
+
export declare const themes: Themes;
|
|
31
|
+
|
|
32
|
+
export declare function ThemeSelector({ theme, setTheme, close }: ThemeSelectorProps): JSX_2.Element;
|
|
33
|
+
|
|
34
|
+
export declare interface ThemeSelectorProps {
|
|
35
|
+
theme: ThemeKey | Theme;
|
|
36
|
+
setTheme: (theme: any) => void;
|
|
37
|
+
close: () => void;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export declare function VideoPlayer({ video, name, audioVisual, volume: vol, thumbnail, controls, mode, transparent, autoPlay, color, equalizer }: VideoPlayerProps): JSX_2.Element | JSX_2.Element[];
|
|
41
|
+
|
|
42
|
+
export declare interface VideoPlayerProps {
|
|
43
|
+
video: string;
|
|
44
|
+
name?: string;
|
|
45
|
+
audioVisual?: {
|
|
46
|
+
side: 'left' | 'right' | 'top' | 'bottom';
|
|
47
|
+
color?: string;
|
|
48
|
+
peak?: string;
|
|
49
|
+
} | null;
|
|
50
|
+
volume?: number;
|
|
51
|
+
thumbnail?: string | null;
|
|
52
|
+
controls?: {
|
|
53
|
+
play?: boolean;
|
|
54
|
+
pause?: boolean;
|
|
55
|
+
stop?: boolean;
|
|
56
|
+
seekbar?: boolean;
|
|
57
|
+
volume?: boolean;
|
|
58
|
+
fullscreen?: boolean;
|
|
59
|
+
videoName?: boolean;
|
|
60
|
+
equalizer?: boolean;
|
|
61
|
+
speed?: boolean;
|
|
62
|
+
};
|
|
63
|
+
mode?: 'light' | 'dark';
|
|
64
|
+
transparent?: boolean;
|
|
65
|
+
autoPlay?: boolean;
|
|
66
|
+
color?: string;
|
|
67
|
+
equalizer?: {
|
|
68
|
+
bass?: number;
|
|
69
|
+
mid?: number;
|
|
70
|
+
treble?: number;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export declare function VisualizePlayer({ audio, name, author, theme, volume: vol, thumbnail, controls, mode, bands: _bands, transparent, autoPlay, equalizer }: VisualizePlayerProps): JSX_2.Element | JSX_2.Element[];
|
|
75
|
+
|
|
76
|
+
export declare interface VisualizePlayerProps {
|
|
77
|
+
audio?: string;
|
|
78
|
+
name?: string;
|
|
79
|
+
author?: string;
|
|
80
|
+
theme?: ThemeKey | Theme;
|
|
81
|
+
volume?: number;
|
|
82
|
+
thumbnail?: string | null;
|
|
83
|
+
controls?: {
|
|
84
|
+
play?: boolean;
|
|
85
|
+
pause?: boolean;
|
|
86
|
+
stop?: boolean;
|
|
87
|
+
seekbar?: boolean;
|
|
88
|
+
volume?: boolean;
|
|
89
|
+
loop?: boolean;
|
|
90
|
+
trackName?: boolean;
|
|
91
|
+
equalizer?: boolean;
|
|
92
|
+
speed?: boolean;
|
|
93
|
+
};
|
|
94
|
+
mode?: 'light' | 'dark';
|
|
95
|
+
bands?: {
|
|
96
|
+
freq: number;
|
|
97
|
+
}[] | null;
|
|
98
|
+
transparent?: boolean;
|
|
99
|
+
autoPlay?: boolean;
|
|
100
|
+
equalizer?: {
|
|
101
|
+
bass?: number;
|
|
102
|
+
mid?: number;
|
|
103
|
+
treble?: number;
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export declare function WaveAudioPlayer({ audio: audioUrl, gradient, background, autoPlay, thumbnail, width, equalizer, mode, }: WaveAudioPlayerProps): JSX_2.Element | null;
|
|
108
|
+
|
|
109
|
+
export declare interface WaveAudioPlayerProps {
|
|
110
|
+
audio: string;
|
|
111
|
+
gradient?: string[];
|
|
112
|
+
background?: string;
|
|
113
|
+
autoPlay?: boolean;
|
|
114
|
+
thumbnail?: string | null;
|
|
115
|
+
width?: number;
|
|
116
|
+
equalizer?: {
|
|
117
|
+
bass?: number;
|
|
118
|
+
mid?: number;
|
|
119
|
+
treble?: number;
|
|
120
|
+
};
|
|
121
|
+
mode?: 'light' | 'dark';
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export { }
|
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.left-0{left:0}.top-0{top:0}.z-10{z-index:10}.z-\[9999\]{z-index:9999}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.ml-2{margin-left:.5rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-0\.5{height:.125rem}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-2{height:.5rem}.h-20{height:5rem}.h-3{height:.75rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-64{height:16rem}.h-8{height:2rem}.h-\[150px\]{height:150px}.h-\[40px\]{height:40px}.h-full{height:100%}.h-screen{height:100vh}.min-h-0{min-height:0px}.min-h-screen{min-height:100vh}.w-1{width:.25rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-20{width:5rem}.w-24{width:6rem}.w-3{width:.75rem}.w-4{width:1rem}.w-6{width:1.5rem}.w-\[110px\]{width:110px}.w-\[120px\]{width:120px}.w-full{width:100%}.w-px{width:1px}.w-screen{width:100vw}.min-w-12{min-width:3rem}.max-w-\[600px\]{max-width:600px}.max-w-lg{max-width:32rem}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-y-10{--tw-translate-y: -2.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-10{--tw-translate-y: 2.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-0{--tw-scale-x: 0;--tw-scale-y: 0;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.appearance-none{-webkit-appearance:none;-moz-appearance:none;appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-px{gap:1px}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}.rounded-l-full{border-top-left-radius:9999px;border-bottom-left-radius:9999px}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.border{border-width:1px}.border-2{border-width:2px}.border-r{border-right-width:1px}.border-none{border-style:none}.border-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity, 1))}.border-current{border-color:currentColor}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-red-300{--tw-border-opacity: 1;border-color:rgb(252 165 165 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity, 1))}.bg-black\/30{background-color:#0000004d}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-black\/70{background-color:#000000b3}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-700{--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/20{background-color:#fff3}.bg-white\/70{background-color:#ffffffb3}.bg-white\/80{background-color:#fffc}.bg-opacity-20{--tw-bg-opacity: .2}.fill-white{fill:#fff}.object-contain{-o-object-fit:contain;object-fit:contain}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-2{padding-bottom:.5rem}.pt-2{padding-top:.5rem}.text-center{text-align:center}.text-right{text-align:right}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-2xl{font-size:1.5rem;line-height:2rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-semibold{font-weight:600}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-gray-100{--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.text-gray-200{--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-xl{--tw-backdrop-blur: blur(24px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-100{transition-duration:.1s}.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-75{transition-duration:75ms}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-110:hover{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100\/50:hover{background-color:#f3f4f680}.hover\:bg-gray-300:hover{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-600:hover{--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-800:hover{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\:opacity-90:hover{opacity:.9}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}@media (min-width: 640px){.sm\:block{display:block}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 768px){.md\:h-auto{height:auto}.md\:w-24{width:6rem}.md\:max-w-4xl{max-width:56rem}.md\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.md\:gap-1{gap:.25rem}.md\:gap-3{gap:.75rem}.md\:p-8{padding:2rem}}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|