/*! For license information please see 8619.js.LICENSE.txt */
(globalThis.webpackChunksakurairo_scripts=globalThis.webpackChunksakurairo_scripts||[]).push([[8619],{3875:(t,e,i)=>{i.d(e,{A:()=>n});var s={800:function(t,e,i){var s=i(90);t.exports=function(t){t=t||{};var e="",i=s.$each,a=t.audio,r=(t.$value,t.$index,s.$escape),o=t.theme,n=t.index;return i(a,(function(t,i){e+='
',e+=r(i+n),e+=' ',e+=r(t.name),e+=' ',e+=r(t.artist),e+=" "})),e}},107:function(t,e,i){var s=i(90);t.exports=function(t){t=t||{};var e="",i=s.$each,a=t.lyrics,r=(t.$value,t.$index,s.$escape);return i(a,(function(t,i){e+=" ",e+=r(t[1]),e+="
"})),e}},336:function(t,e,i){var s=i(90);t.exports=function(t){var e="",a=(t=t||{}).options,r=t.cover,o=s.$escape,n=t.icons,l=function(t){return e+=t},h=t.getObject;return t.theme,t.audio,t.index,a.fixed?(e+=' ',l(i(800)(h({theme:a.theme,audio:a.audio,index:1}))),e+=' No audio
00:00 / 00:00 ',e+=n.skip,e+=' ',e+=n.play,e+=' ',e+=n.skip,e+=' ',"list"===a.order?e+=n.orderList:"random"===a.order&&(e+=n.orderRandom),e+=' ',"one"===a.loop?e+=n.loopOne:"all"===a.loop?e+=n.loopAll:"none"===a.loop&&(e+=n.loopNone),e+=' ',e+=n.lrc,e+='
',e+=n.right,e+='
'):(e+=' No audio
00:00 / 00:00 ',e+=n.skip,e+=' ',e+=n.play,e+=' ',e+=n.skip,e+=' ',"list"===a.order?e+=n.orderList:"random"===a.order&&(e+=n.orderRandom),e+=' ',"one"===a.loop?e+=n.loopOne:"all"===a.loop?e+=n.loopAll:"none"===a.loop&&(e+=n.loopNone),e+=' ',e+=n.lrc,e+='
',e+=n.right,e+='
',l(i(800)(h({theme:a.theme,audio:a.audio,index:1}))),e+=" "),e}},42:function(t,e,i){var s="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==i.g?i.g:{},a=Object.create(s),r=/["&'<>]/;function o(t){return"string"!=typeof t&&(t=null==t?"":"function"==typeof t?o(t.call(t)):JSON.stringify(t)),t}a.$escape=function(t){return function(t){var e=""+t,i=r.exec(e);if(!i)return t;var s="",a=void 0,o=void 0,n=void 0;for(a=i.index,o=0;as?e:t+(e-t)*function(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}(i/s)},e=function(e,i,s,a){i=i||500;var r=(a=a||window).scrollTop||window.pageYOffset;if("number"==typeof e)var o=parseInt(e);else o=function(t,e){return"HTML"===t.nodeName?-e:t.getBoundingClientRect().top+e}(e,r);var n=Date.now(),l=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(t){window.setTimeout(t,15)},h=function(){var p=Date.now()-n;a!==window?a.scrollTop=t(r,o,p,i):window.scroll(0,t(r,o,p,i)),p>i?"function"==typeof s&&s(e):l(h)};h()},i=function(t){if(!t.defaultPrevented){t.preventDefault(),location.hash!==this.hash&&window.history.pushState(null,null,this.hash);var i=document.getElementById(this.hash.substring(1));if(!i)return;e(i,500,(function(t){location.replace("#"+t.id)}))}};return document.addEventListener("DOMContentLoaded",(function(){for(var t,e=document.querySelectorAll('a[href^="#"]:not([href="#"])'),s=e.length;t=e[--s];)t.addEventListener("click",i,!1)})),e}},void 0===(a=s.call(e,i,e,t))||(t.exports=a)},112:function(t){t.exports=' '},133:function(t){t.exports=' '},537:function(t){t.exports=' '},155:function(t){t.exports=' '},812:function(t){t.exports=' '},440:function(t){t.exports=' '},690:function(t){t.exports=' '},343:function(t){t.exports=' '},723:function(t){t.exports=' '},7:function(t){t.exports=' '},381:function(t){t.exports=' '},632:function(t){t.exports=' '},813:function(t){t.exports=' '},480:function(t){t.exports=' '},848:function(t){t.exports=' '}},a={};function r(t){var e=a[t];if(void 0!==e)return e.exports;var i=a[t]={exports:{}};return s[t].call(i.exports,i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var i in e)r.o(e,i)&&!r.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var o={};!function(){r.d(o,{Z:function(){return K}});const t=/mobile/i.test(window.navigator.userAgent);var e={secondToTime:t=>{const e=Math.floor(t/3600),i=Math.floor((t-3600*e)/60),s=Math.floor(t-3600*e-60*i);return(e>0?[e,i,s]:[i,s]).map((t=>t<10?"0"+t:""+t)).join(":")},isMobile:t,storage:{set:(t,e)=>{localStorage.setItem(t,e)},get:t=>localStorage.getItem(t)},nameMap:{dragStart:t?"touchstart":"mousedown",dragMove:t?"touchmove":"mousemove",dragEnd:t?"touchend":"mouseup"},randomOrder:t=>function(t){for(let e=t.length-1;e>=0;e--){const i=Math.floor(Math.random()*(e+1)),s=t[i];t[i]=t[e],t[e]=s}return t}([...Array(t)].map((function(t,e){return e})))},i=r(7),s=r.n(i),a=r(723),n=r.n(a),l=r(848),h=r.n(l),p=r(813),d=r.n(p),c=r(480),u=r.n(c),y=r(343),m=r.n(y),v=r(690),g=r.n(v),w=r(440),f=r.n(w),b=r(133),x=r.n(b),M=r(155),L=r.n(M),q=r(537),T=r.n(q),k=r(112),B=r.n(k),S=r(381),E=r.n(S),O=r(632),H=r.n(O),A=r(812),C=r.n(A),z={play:s(),pause:n(),volumeUp:h(),volumeDown:d(),volumeOff:u(),orderRandom:m(),orderList:g(),menu:f(),loopAll:x(),loopOne:L(),loopNone:T(),loading:B(),right:E(),skip:H(),lrc:C()},N=r(336),I=r.n(N),$=class{constructor(t){this.container=t.container,this.options=t.options,this.randomOrder=t.randomOrder,this.init()}init(){let t="";this.options.audio.length&&(t="random"===this.options.order?this.options.audio[this.randomOrder[0]].cover:this.options.audio[0].cover),this.container.innerHTML=I()({options:this.options,icons:z,cover:t,getObject:t=>t}),this.lrc=this.container.querySelector(".aplayer-lrc-contents"),this.lrcWrap=this.container.querySelector(".aplayer-lrc"),this.ptime=this.container.querySelector(".aplayer-ptime"),this.info=this.container.querySelector(".aplayer-info"),this.time=this.container.querySelector(".aplayer-time"),this.barWrap=this.container.querySelector(".aplayer-bar-wrap"),this.button=this.container.querySelector(".aplayer-button"),this.body=this.container.querySelector(".aplayer-body"),this.list=this.container.querySelector(".aplayer-list"),this.listCurs=this.container.querySelectorAll(".aplayer-list-cur"),this.played=this.container.querySelector(".aplayer-played"),this.loaded=this.container.querySelector(".aplayer-loaded"),this.thumb=this.container.querySelector(".aplayer-thumb"),this.volume=this.container.querySelector(".aplayer-volume"),this.volumeBar=this.container.querySelector(".aplayer-volume-bar"),this.volumeButton=this.container.querySelector(".aplayer-time button"),this.volumeBarWrap=this.container.querySelector(".aplayer-volume-bar-wrap"),this.loop=this.container.querySelector(".aplayer-icon-loop"),this.order=this.container.querySelector(".aplayer-icon-order"),this.menu=this.container.querySelector(".aplayer-icon-menu"),this.pic=this.container.querySelector(".aplayer-pic"),this.title=this.container.querySelector(".aplayer-title"),this.author=this.container.querySelector(".aplayer-author"),this.dtime=this.container.querySelector(".aplayer-dtime"),this.notice=this.container.querySelector(".aplayer-notice"),this.miniSwitcher=this.container.querySelector(".aplayer-miniswitcher"),this.skipBackButton=this.container.querySelector(".aplayer-icon-back"),this.skipForwardButton=this.container.querySelector(".aplayer-icon-forward"),this.skipPlayButton=this.container.querySelector(".aplayer-icon-play"),this.lrcButton=this.container.querySelector(".aplayer-icon-lrc")}},P=class{constructor(t){this.elements={},this.elements.volume=t.volume,this.elements.played=t.played,this.elements.loaded=t.loaded}set(t,e,i){e=Math.max(e,0),e=Math.min(e,1),this.elements[t].style[i]=100*e+"%"}get(t,e){return parseFloat(this.elements[t].style[e])/100}},F=class{constructor(t){this.storageName=t.options.storageName,this.data=JSON.parse(e.storage.get(this.storageName)),this.data||(this.data={}),this.data.volume=this.data.volume||t.options.volume}get(t){return this.data[t]}set(t,i){this.data[t]=i,e.storage.set(this.storageName,JSON.stringify(this.data))}},W=r(107),R=r.n(W),j=class{constructor(t){this.container=t.container,this.async=t.async,this.player=t.player,this.parsed=[],this.index=0,this.current=[]}show(){this.player.events.trigger("lrcshow"),this.player.template.lrcWrap.classList.remove("aplayer-lrc-hide")}hide(){this.player.events.trigger("lrchide"),this.player.template.lrcWrap.classList.add("aplayer-lrc-hide")}toggle(){this.player.template.lrcWrap.classList.contains("aplayer-lrc-hide")?this.show():this.hide()}update(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.player.audio.currentTime;if(this.index>this.current.length-1||t=this.current[this.index+1][0])for(let e=0;e=this.current[e][0]&&(!this.current[e+1]||t{t===this.player.list.index&&4===e.readyState&&(e.status>=200&&e.status<300||304===e.status?this.parsed[t]=this.parse(e.responseText):(this.player.notice(`LRC file request fails: status ${e.status}`),this.parsed[t]=[["00:00","Not available"]]),this.container.innerHTML=R()({lyrics:this.parsed[t]}),this.update(0),this.current=this.parsed[t])};const i=this.player.list.audios[t].lrc;e.open("get",i,!0),e.send(null)}else this.player.list.audios[t].lrc?this.parsed[t]=this.parse(this.player.list.audios[t].lrc):this.parsed[t]=[["00:00","Not available"]];this.container.innerHTML=R()({lyrics:this.parsed[t]}),this.current=this.parsed[t],this.update(0)}parse(t){if(t){t.startsWith('"')&&t.endsWith('"')&&(t=JSON.parse(t));const e=(t=t.replace(/([^\]^\n])\[/g,((t,e)=>e+"\n["))).split("\n");let i=[];const s=e.length;for(let t=0;t/g,"").replace(/^\s+|\s+$/g,"");if(s){const t=s.length;for(let e=0;et[1])),i.sort(((t,e)=>t[0]-e[0])),i}return[]}remove(t){this.parsed.splice(t,1)}clear(){this.parsed=[],this.container.innerHTML=""}},U=class{constructor(t){this.player=t,this.initPlayButton(),this.initPlayBar(),this.initOrderButton(),this.initLoopButton(),this.initMenuButton(),e.isMobile||this.initVolumeButton(),this.initMiniSwitcher(),this.initSkipButton(),this.initLrcButton()}initPlayButton(){this.player.template.pic.addEventListener("click",(()=>{this.player.toggle()}))}initPlayBar(){const t=t=>{let i=((t.clientX||t.changedTouches[0].clientX)-this.player.template.barWrap.getBoundingClientRect().left)/this.player.template.barWrap.clientWidth;i=Math.max(i,0),i=Math.min(i,1),this.player.bar.set("played",i,"width"),this.player.lrc&&this.player.lrc.update(i*this.player.duration),this.player.template.ptime.innerHTML=e.secondToTime(i*this.player.duration)},i=s=>{document.removeEventListener(e.nameMap.dragEnd,i),document.removeEventListener(e.nameMap.dragMove,t);let a=((s.clientX||s.changedTouches[0].clientX)-this.player.template.barWrap.getBoundingClientRect().left)/this.player.template.barWrap.clientWidth;a=Math.max(a,0),a=Math.min(a,1),this.player.bar.set("played",a,"width"),this.player.seek(a*this.player.duration),this.player.disableTimeupdate=!1};this.player.template.barWrap.addEventListener(e.nameMap.dragStart,(()=>{this.player.disableTimeupdate=!0,document.addEventListener(e.nameMap.dragMove,t),document.addEventListener(e.nameMap.dragEnd,i)}))}initVolumeButton(){this.player.template.volumeButton.addEventListener("click",(()=>{this.player.audio.muted?this.player.volume(this.player.audio.volume,!0):(this.player.audio.muted=!0,this.player.switchVolumeIcon(),this.player.bar.set("volume",0,"height"))}));const t=t=>{let e=1-((t.clientY||t.changedTouches[0].clientY)-this.player.template.volumeBar.getBoundingClientRect().top)/this.player.template.volumeBar.clientHeight;e=Math.max(e,0),e=Math.min(e,1),this.player.volume(e)},i=s=>{this.player.template.volumeBarWrap.classList.remove("aplayer-volume-bar-wrap-active"),document.removeEventListener(e.nameMap.dragEnd,i),document.removeEventListener(e.nameMap.dragMove,t);let a=1-((s.clientY||s.changedTouches[0].clientY)-this.player.template.volumeBar.getBoundingClientRect().top)/this.player.template.volumeBar.clientHeight;a=Math.max(a,0),a=Math.min(a,1),this.player.volume(a)};this.player.template.volumeBarWrap.addEventListener(e.nameMap.dragStart,(()=>{this.player.template.volumeBarWrap.classList.add("aplayer-volume-bar-wrap-active"),document.addEventListener(e.nameMap.dragMove,t),document.addEventListener(e.nameMap.dragEnd,i)}))}initOrderButton(){this.player.template.order.addEventListener("click",(()=>{"list"===this.player.options.order?(this.player.options.order="random",this.player.template.order.innerHTML=z.orderRandom):"random"===this.player.options.order&&(this.player.options.order="list",this.player.template.order.innerHTML=z.orderList)}))}initLoopButton(){this.player.template.loop.addEventListener("click",(()=>{this.player.list.audios.length>1?"one"===this.player.options.loop?(this.player.options.loop="none",this.player.template.loop.innerHTML=z.loopNone):"none"===this.player.options.loop?(this.player.options.loop="all",this.player.template.loop.innerHTML=z.loopAll):"all"===this.player.options.loop&&(this.player.options.loop="one",this.player.template.loop.innerHTML=z.loopOne):"one"===this.player.options.loop||"all"===this.player.options.loop?(this.player.options.loop="none",this.player.template.loop.innerHTML=z.loopNone):"none"===this.player.options.loop&&(this.player.options.loop="all",this.player.template.loop.innerHTML=z.loopAll)}))}initMenuButton(){this.player.template.menu.addEventListener("click",(()=>{this.player.list.toggle()}))}initMiniSwitcher(){this.player.template.miniSwitcher.addEventListener("click",(()=>{this.player.setMode("mini"===this.player.mode?"normal":"mini")}))}initSkipButton(){this.player.template.skipBackButton.addEventListener("click",(()=>{this.player.skipBack()})),this.player.template.skipForwardButton.addEventListener("click",(()=>{this.player.skipForward()})),this.player.template.skipPlayButton.addEventListener("click",(()=>{this.player.toggle()}))}initLrcButton(){this.player.template.lrcButton.addEventListener("click",(()=>{this.player.template.lrcButton.classList.contains("aplayer-icon-lrc-inactivity")?(this.player.template.lrcButton.classList.remove("aplayer-icon-lrc-inactivity"),this.player.lrc&&this.player.lrc.show()):(this.player.template.lrcButton.classList.add("aplayer-icon-lrc-inactivity"),this.player.lrc&&this.player.lrc.hide())}))}},Y=class{constructor(t){this.player=t,window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){window.setTimeout(t,1e3/60)},this.types=["loading"],this.init()}init(){this.types.forEach((t=>{this[`init${t}Checker`]()}))}initloadingChecker(){let t=0,e=0,i=!1;this.loadingChecker=setInterval((()=>{this.enableloadingChecker&&(e=this.player.audio.currentTime,i||e!==t||this.player.audio.paused||(this.player.container.classList.add("aplayer-loading"),i=!0),i&&e>t&&!this.player.audio.paused&&(this.player.container.classList.remove("aplayer-loading"),i=!1),t=e)}),100)}enable(t){this[`enable${t}Checker`]=!0,"fps"===t&&this.initfpsChecker()}disable(t){this[`enable${t}Checker`]=!1}destroy(){this.types.forEach((t=>{this[`enable${t}Checker`]=!1,this[`${t}Checker`]&&clearInterval(this[`${t}Checker`])}))}},D=class{constructor(){this.events={},this.audioEvents=["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","mozaudioavailable","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"],this.playerEvents=["destroy","listshow","listhide","listadd","listremove","listswitch","listclear","noticeshow","noticehide","lrcshow","lrchide"]}on(t,e){this.type(t)&&"function"==typeof e&&(this.events[t]||(this.events[t]=[]),this.events[t].push(e))}trigger(t,e){if(this.events[t]&&this.events[t].length)for(let i=0;i{let e;e="LI"===t.target.tagName.toUpperCase()?t.target:t.target.parentElement;const i=parseInt(e.getElementsByClassName("aplayer-list-index")[0].innerHTML)-1;i!==this.index?(this.switch(i),this.player.play()):this.player.toggle()}))}show(){this.showing=!0,this.player.template.list.scrollTop=33*this.index,this.player.template.list.style.height=`${Math.min(this.player.template.list.scrollHeight,this.player.options.listMaxHeight)}px`,this.player.events.trigger("listshow")}hide(){this.showing=!1,this.player.template.list.style.height=`${Math.min(this.player.template.list.scrollHeight,this.player.options.listMaxHeight)}px`,setTimeout((()=>{this.player.template.list.style.height="0px",this.player.events.trigger("listhide")}),0)}toggle(){this.showing?this.hide():this.show()}add(t){this.player.events.trigger("listadd",{audios:t}),"[object Array]"!==Object.prototype.toString.call(t)&&(t=[t]),t.map((t=>(t.name=t.name||t.title||"Audio name",t.artist=t.artist||t.author||"Audio artist",t.cover=t.cover||t.pic,t.type=t.type||"normal",t)));const i=!(this.audios.length>1),s=0===this.audios.length;this.player.template.list.innerHTML+=X()({theme:this.player.options.theme,audio:t,index:this.audios.length+1}),this.audios=this.audios.concat(t),i&&this.audios.length>1&&this.player.container.classList.add("aplayer-withlist"),this.player.randomOrder=e.randomOrder(this.audios.length),this.player.template.listCurs=this.player.container.querySelectorAll(".aplayer-list-cur"),this.player.template.listCurs[this.audios.length-1].style.backgroundColor=t.theme||this.player.options.theme,s&&("random"===this.player.options.order?this.switch(this.player.randomOrder[0]):this.switch(0))}remove(t){if(this.player.events.trigger("listremove",{index:t}),this.audios[t])if(this.audios.length>1){const e=this.player.container.querySelectorAll(".aplayer-list li");e[t].remove(),this.audios.splice(t,1),this.player.lrc&&this.player.lrc.remove(t),t===this.index&&(this.audios[t]?this.switch(t):this.switch(t-1)),this.index>t&&this.index--;for(let i=t;i{const e={container:t.element||document.getElementsByClassName("aplayer")[0],mini:t.narrow||t.fixed||!1,fixed:!1,autoplay:!1,mutex:!0,lrcType:t.showlrc||t.lrc||0,preload:"metadata",theme:"#b7daff",loop:"all",order:"list",volume:.7,listFolded:t.fixed,listMaxHeight:t.listmaxheight||250,audio:t.music||[],storageName:"aplayer-setting"};for(const i in e)e.hasOwnProperty(i)&&!t.hasOwnProperty(i)&&(t[i]=e[i]);return t.listMaxHeight=parseFloat(t.listMaxHeight),"[object Array]"!==Object.prototype.toString.call(t.audio)&&(t.audio=[t.audio]),t.audio.map((t=>(t.name=t.name||t.title||"Audio name",t.artist=t.artist||t.author||"Audio artist",t.cover=t.cover||t.pic,t.type=t.type||"normal",t))),t.audio.length<=1&&"one"===t.loop&&(t.loop="all"),t})(t),this.container=this.options.container,this.paused=!0,this.playedPromise=Promise.resolve(),this.mode="normal",this.randomOrder=e.randomOrder(this.options.audio.length),this.container.classList.add("aplayer"),this.options.lrcType&&!this.options.fixed&&this.container.classList.add("aplayer-withlrc"),this.options.audio.length>1&&this.container.classList.add("aplayer-withlist"),e.isMobile&&this.container.classList.add("aplayer-mobile"),this.arrow=this.container.offsetWidth<=300,this.arrow&&this.container.classList.add("aplayer-arrow"),2===this.options.lrcType||!0===this.options.lrcType){const t=this.container.getElementsByClassName("aplayer-lrc-content");for(let e=0;e{this.events.trigger(this.events.audioEvents[t],e)}));this.volume(this.storage.get("volume"),!0)}bindEvents(){let t;this.on("play",(()=>{this.paused&&this.setUIPlaying()})),this.on("pause",(()=>{this.paused||this.setUIPaused()})),this.on("timeupdate",(()=>{if(!this.disableTimeupdate){this.bar.set("played",this.audio.currentTime/this.duration,"width"),this.lrc&&this.lrc.update();const t=e.secondToTime(this.audio.currentTime);this.template.ptime.innerHTML!==t&&(this.template.ptime.innerHTML=t)}})),this.on("durationchange",(()=>{1!==this.duration&&(this.template.dtime.innerHTML=e.secondToTime(this.duration))})),this.on("loadedmetadata",(()=>{this.seek(0),this.paused||this.audio.play()})),this.on("canplay",(()=>{const t=this.audio.buffered.length?this.audio.buffered.end(this.audio.buffered.length-1)/this.duration:0;this.bar.set("loaded",t,"width")})),this.on("progress",(()=>{const t=this.audio.buffered.length?this.audio.buffered.end(this.audio.buffered.length-1)/this.duration:0;this.bar.set("loaded",t,"width")})),this.on("error",(()=>{this.list.audios.length>1?(this.notice("An audio error has occurred, player will skip forward in 2 seconds."),t=setTimeout((()=>{this.skipForward(),this.paused||this.play()}),2e3)):1===this.list.audios.length&&this.notice("An audio error has occurred.")})),this.events.on("listswitch",(()=>{t&&clearTimeout(t)})),this.on("ended",(()=>{"none"===this.options.loop?"list"===this.options.order?this.list.index0&&void 0!==arguments[0]?arguments[0]:this.list.audios[this.list.index].theme||this.options.theme,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.list.index;(!(arguments.length>2&&void 0!==arguments[2])||arguments[2])&&this.list.audios[e]&&(this.list.audios[e].theme=t),this.template.listCurs[e]&&(this.template.listCurs[e].style.backgroundColor=t),e===this.list.index&&(this.template.pic.style.backgroundColor=t,this.template.played.style.background=t,this.template.thumb.style.background=t,this.template.volume.style.background=t)}seek(t){t=Math.max(t,0),t=Math.min(t,this.duration),this.audio.currentTime=t,this.bar.set("played",t/this.duration,"width"),this.template.ptime.innerHTML=e.secondToTime(t)}get duration(){return isNaN(this.audio.duration)?0:this.audio.duration}setUIPlaying(){if(this.paused&&(this.paused=!1,this.template.button.classList.remove("aplayer-play"),this.template.button.classList.add("aplayer-pause"),this.template.button.innerHTML="",setTimeout((()=>{this.template.button.innerHTML=z.pause}),100),this.template.skipPlayButton.innerHTML=z.pause),this.timer.enable("loading"),this.options.mutex)for(let t=0;t{console.warn(t),"NotAllowedError"===t.name&&this.setUIPaused()}))}setUIPaused(){this.paused||(this.paused=!0,this.template.button.classList.remove("aplayer-pause"),this.template.button.classList.add("aplayer-play"),this.template.button.innerHTML="",setTimeout((()=>{this.template.button.innerHTML=z.play}),100),this.template.skipPlayButton.innerHTML=z.play),this.container.classList.remove("aplayer-loading"),this.timer.disable("loading")}pause(){this.setUIPaused(),this.audio.pause()}switchVolumeIcon(){this.volume()>=.95?this.template.volumeButton.innerHTML=z.volumeUp:this.volume()>0?this.template.volumeButton.innerHTML=z.volumeDown:this.template.volumeButton.innerHTML=z.volumeOff}volume(t,e){return t=parseFloat(t),isNaN(t)||(t=Math.max(t,0),t=Math.min(t,1),this.bar.set("volume",t,"height"),e||this.storage.set("volume",t),this.audio.volume=t,this.audio.muted&&(this.audio.muted=!1),this.switchVolumeIcon()),this.audio.muted?0:this.audio.volume}on(t,e){this.events.on(t,e)}toggle(){this.template.button.classList.contains("aplayer-play")?this.play():this.template.button.classList.contains("aplayer-pause")&&this.pause()}switchAudio(t){this.list.switch(t)}addAudio(t){this.list.add(t)}removeAudio(t){this.list.remove(t)}destroy(){G.splice(G.indexOf(this),1),this.pause(),this.container.innerHTML="",this.audio.src="",this.timer.destroy(),this.events.trigger("destroy")}setMode(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"normal";this.mode=t,"mini"===t?this.container.classList.add("aplayer-narrow"):"normal"===t&&this.container.classList.remove("aplayer-narrow")}notice(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2e3,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:.8;this.template.notice.innerHTML=t,this.template.notice.style.opacity=i,this.noticeTime&&clearTimeout(this.noticeTime),this.events.trigger("noticeshow",{text:t}),e&&(this.noticeTime=setTimeout((()=>{this.template.notice.style.opacity=0,this.events.trigger("noticehide")}),e))}prevIndex(){if(!(this.list.audios.length>1))return 0;if("list"===this.options.order)return this.list.index-1<0?this.list.audios.length-1:this.list.index-1;if("random"===this.options.order){const t=this.randomOrder.indexOf(this.list.index);return 0===t?this.randomOrder[this.randomOrder.length-1]:this.randomOrder[t-1]}}nextIndex(){if(!(this.list.audios.length>1))return 0;if("list"===this.options.order)return(this.list.index+1)%this.list.audios.length;if("random"===this.options.order){const t=this.randomOrder.indexOf(this.list.index);return t===this.randomOrder.length-1?this.randomOrder[0]:this.randomOrder[t+1]}}skipBack(){this.list.switch(this.prevIndex())}skipForward(){this.list.switch(this.nextIndex())}static get version(){return"1.10.1"}}}();var n=o.Z},7629:(t,e,i)=>{i.r(e)}}]);
//# sourceMappingURL=8619.js.map