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QhE,EAAQwB,QAAQkD,MACnCF,EAAOR,IAAI,KAAMhE,EAAQwB,QAAQ6C,IACjCM,MAAML,EAASM,YACVC,MAAKC,UACFC,EAAKC,GACLjF,EAAYC,QAAe+E,EAAKE,QAGhClD,QAAQkB,KAAK,kBAAkB8B,EAAKG,UAAUH,EAAKI,aACvD,IAECC,MAAMrD,QAAQsD,MACvB,MACK,GAAIrF,EAAQwB,QAAQ8D,IAAK,CAC1B,MAAMC,EAAgB,CAAC,CACfC,KAAMxF,EAAQwB,QAAQgE,MAAQxF,EAAQwB,QAAQiE,OAAS,aACvDC,OAAQ1F,EAAQwB,QAAQkE,QAAU1F,EAAQwB,QAAQmE,QAAU,eAC5DL,IAAKtF,EAAQwB,QAAQ8D,IACrBM,MAAO5F,EAAQwB,QAAQoE,OAAS5F,EAAQwB,QAAQqE,IAChD1E,IAAKnB,EAAQwB,QAAQL,IACrBuD,KAAM1E,EAAQwB,QAAQkD,MAAQ,SAEtC3E,EAAYC,EAASuF,EACzB,CACJ,EAUAO,EAAAA,EAAAA,GAAiB,iBAAkB5C,IACnC4C,EAAAA,EAAAA,GAAiB,oBAAqBjD,IACtCiD,EAAAA,EAAAA,GAAiB,cAAeC,IAChCD,EAAAA,EAAAA,GAAiB,eAAe,IAAMhG,GAX1C,CACA,SAASiG,EAAYC,GACjB,MAAM9B,EAAahC,SAASiC,uBAAuB,WACnD,IAAK,MAAMC,KAAKF,EACZnE,EAAYqE,EAAG4B,EAEvB,C","sources":["webpack://sakurairo-scripts/./src/app/aplayer.ts"],"sourcesContent":["//@ts-ignore\nimport APlayer from 'aplayer';\nimport { loadCSS } from 'fg-loadcss';\nimport { registerOnGlobal } from '../common/sakurairo_global';\nlet aplayers = [];\nfunction initAplayer(element, audio) {\n const default_option = {\n container: element,\n audio: audio,\n mini: null,\n fixed: null,\n autoplay: false,\n mutex: true,\n lrcType: 3,\n listFolded: 1,\n preload: 'auto',\n theme: '#2980b9',\n loop: 'all',\n order: 'list',\n volume: null,\n listMaxHeight: null,\n customAudioType: null,\n storageName: 'metingjs'\n };\n if (audio.length) {\n audio[0].lrc || (default_option.lrcType = 0);\n const d = {};\n for (const key in default_option) {\n const key_lowercase = key.toLowerCase();\n if (element.dataset.hasOwnProperty(key_lowercase) || element.dataset.hasOwnProperty(key) || default_option[key] !== null) {\n d[key] = element.dataset[key_lowercase] || element.dataset[key] || default_option[key];\n if ('true' === d[key] || 'false' === d[key]) {\n d[key] = 'true' == d[key];\n }\n }\n }\n aplayers.push(new APlayer(d));\n }\n for (let f = 0; f < aplayers.length; f++)\n try {\n aplayers[f].lrc.hide();\n }\n catch (a) {\n console.log(a);\n }\n let lrcTag = 1;\n document.querySelector(\".aplayer.aplayer-fixed\").addEventListener(\"click\", () => {\n if (lrcTag == 1) {\n for (let f = 0; f < aplayers.length; f++)\n try {\n aplayers[f].lrc.show();\n }\n catch (a) {\n console.log(a);\n }\n }\n lrcTag = 2;\n });\n let apSwitchTag = 0, aplayer_body = document.querySelector(\".aplayer.aplayer-fixed .aplayer-body\"), aplayer_minisw = document.querySelector(\".aplayer-miniswitcher\");\n aplayer_body && aplayer_body.classList.add(\"ap-hover\");\n aplayer_minisw && aplayer_minisw.addEventListener(\"click\", () => {\n if (apSwitchTag == 0) {\n aplayer_body && aplayer_body.classList.remove(\"ap-hover\");\n document.getElementById(\"secondary\") && document.getElementById(\"secondary\").classList.add(\"active\");\n apSwitchTag = 1;\n }\n else {\n aplayer_body && aplayer_body.classList.add(\"ap-hover\");\n document.getElementById(\"secondary\") && document.getElementById(\"secondary\").classList.remove(\"active\");\n apSwitchTag = 0;\n }\n });\n}\nexport function destroyAllAplayer() {\n try {\n for (let i = 0; i < aplayers.length; i++) {\n aplayers[i].destroy();\n }\n aplayers = [];\n }\n catch (reason) {\n console.warn(reason);\n }\n}\n/**\n * @return 返回曾在播放的aplayer列表\n */\nexport function pauseAllPlayer() {\n const playingAplayer = [];\n try {\n for (const player of aplayers) {\n if (!player.paused) {\n playingAplayer.push(player);\n }\n player.pause();\n }\n }\n catch (reason) {\n console.warn(reason);\n }\n return playingAplayer;\n}\nexport function aplayerInit() {\n //document.addEventListener('DOMContentLoaded', loadMeting, /* !1 *//**false与什么都不传递作用相等 */);\n if (_iro.ext_shared_lib) {\n loadCSS('https://s.nmxc.ltd/aplayer/dist/APlayer.min.css');\n //loadCSS(\"https://cdn.jsdelivr.net/gh/Fuukei/APlayer@1.10.2/dist/APlayer.min.css\");\n }\n else {\n //@ts-ignore\n import(/* webpackMode: \"eager\" */ 'aplayer/dist/APlayer.min.css');\n }\n let meting_api_path;\n if (typeof meting_api == 'string') {\n meting_api_path = new URL(meting_api);\n }\n else {\n meting_api_path = new URL(_iro.meting_api_url);\n meting_api_path.searchParams.set('_wpnonce', _iro.nonce);\n }\n destroyAllAplayer();\n const collection = document.getElementsByClassName('aplayer');\n for (let e = 0; e < collection.length; e++) {\n const element = collection[e], id = element.dataset.id;\n if (id) {\n const api_path = element.dataset.api ? new URL(element.dataset.api) : meting_api_path;\n const params = api_path.searchParams;\n params.set('server', element.dataset.server);\n params.set('type', element.dataset.type);\n params.set('id', element.dataset.id);\n fetch(api_path.toString())\n .then(async (resp) => {\n if (resp.ok) {\n initAplayer(element, await resp.json());\n }\n else {\n console.warn(`(APlayer) HTTP ${resp.status}:${resp.statusText}`);\n }\n })\n .catch(console.error);\n }\n else if (element.dataset.url) {\n const playlist_info = [{\n name: element.dataset.name || element.dataset.title || 'Audio name',\n artist: element.dataset.artist || element.dataset.author || 'Audio artist',\n url: element.dataset.url,\n cover: element.dataset.cover || element.dataset.pic,\n lrc: element.dataset.lrc,\n type: element.dataset.type || 'auto'\n }];\n initAplayer(element, playlist_info);\n }\n }\n registerMethods();\n}\nfunction loadAPlayer(playlist) {\n const collection = document.getElementsByClassName('aplayer');\n for (const e of collection) {\n initAplayer(e, playlist);\n }\n}\nfunction registerMethods() {\n registerOnGlobal('pauseAllPlayer', pauseAllPlayer);\n registerOnGlobal('destroyAllAplayer', destroyAllAplayer);\n registerOnGlobal('loadAPlayer', loadAPlayer);\n registerOnGlobal('getAPlayers', () => aplayers);\n}\n"],"names":["aplayers","initAplayer","element","audio","default_option","container","mini","fixed","autoplay","mutex","lrcType","listFolded","preload","theme","loop","order","volume","listMaxHeight","customAudioType","storageName","length","lrc","d","key","key_lowercase","toLowerCase","dataset","hasOwnProperty","push","APlayer","f","hide","a","console","log","lrcTag","document","querySelector","addEventListener","show","apSwitchTag","aplayer_body","aplayer_minisw","classList","add","remove","getElementById","destroyAllAplayer","i","destroy","reason","warn","pauseAllPlayer","playingAplayer","player","paused","pause","aplayerInit","meting_api_path","_iro","ext_shared_lib","loadCSS","meting_api","URL","meting_api_url","searchParams","set","nonce","collection","getElementsByClassName","e","id","api_path","api","params","server","type","fetch","toString","then","async","resp","ok","json","status","statusText","catch","error","url","playlist_info","name","title","artist","author","cover","pic","registerOnGlobal","loadAPlayer","playlist"],"sourceRoot":""}