diff --git a/dist/4chan-sounds-player.meta.js b/dist/4chan-sounds-player.meta.js index 6051dde..5409510 100644 --- a/dist/4chan-sounds-player.meta.js +++ b/dist/4chan-sounds-player.meta.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan sounds player -// @version 3.5.4 +// @version 3.5.5 // @namespace rccom // @description A player designed for 4chan sounds threads. // @author RCC diff --git a/dist/4chan-sounds-player.user.js b/dist/4chan-sounds-player.user.js index be2ab1e..a9f6289 100644 --- a/dist/4chan-sounds-player.user.js +++ b/dist/4chan-sounds-player.user.js @@ -1,6 +1,6 @@ // ==UserScript== // @name 4chan sounds player -// @version 3.5.4 +// @version 3.5.5 // @namespace rccom // @description A player designed for 4chan sounds threads. // @author RCC @@ -43,4 +43,4 @@ // ==/UserScript== -(()=>{var e={5226:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},4292:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},8997:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},991:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},1730:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},5331:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},3264:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},1733:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},6818:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},9908:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},188:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},6042:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},2793:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},794:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},416:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},706:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},9520:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},4855:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},2181:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},5737:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},187:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},2277:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},8979:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},5916:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},5763:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n \n \n'},4708:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},8250:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},5540:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},1786:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},6001:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},8472:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},2487:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},137:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},7453:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},1992:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},1590:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},8998:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},7119:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},6289:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},6933:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},2602:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},4250:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},7568:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},7654:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n \n'},3220:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n \n'},2340:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},6325:e=>{const t=e.exports;function a(e,t){const a=Math.max(0,t-e);return[a%60,Math.floor(a/60)%60,Math.floor(a/60/60)%24,Math.floor(a/60/60/24)%7,Math.floor(a/60/60/24/7)]}e.exports.set=function(e,t,a){const n=t.split("."),s=n.pop(),r=n.reduce(((e,t)=>e[t]||(e[t]={})),e);return r&&(r[s]=a),e},e.exports.get=function(e,t,a){if("string"!=typeof t)return a;if(""===t)return e;const n=t.split("."),s=n.pop(),r=n.reduce(((e,t)=>e&&e[t]),e);return r&&s in r?r[s]:a},e.exports.isEqual=function e(a,n,s=!0){if(typeof a!=typeof n)return!1;if(Array.isArray(a,n))return a===n||a.length===n.length&&a.every(((t,a)=>e(t,n[a])));if(a&&n&&"object"==typeof a&&a!==n){const e=Object.keys(a);return e.push(...Object.keys(n).filter((t=>!e.includes(t)))),e.every((e=>t.isEqual(a[e],n[e])))}return s?a===n:a==n},e.exports.toDuration=function(e){e=Math.floor(e||0);let[t,n,s]=a(0,e);return t<10&&(t="0"+t),s&&n<10&&(n="0"+n),(s?s+":":"")+n+":"+t},e.exports.timeAgo=function(e){const[t,n,s,r,l]=a(Math.floor(e),Math.floor(Date.now()/1e3));return l>1?l+" weeks ago":r>0?r+(1===r?" day":" days")+" ago":s>0?s+(1===s?" hour":" hours")+" ago":n>0?n+(1===n?" minute":" minutes")+" ago":t+(1===t?" second":" seconds")+" ago"},e.exports.element=function(e,a,n="beforeend"){let s;if(e instanceof Node)s=e;else{const t=document.createElement("div");t.innerHTML=e,s=t.children[0]}return a&&a.insertAdjacentElement(n,s),s instanceof Element&&t.elementHandler(s),s},e.exports.elementHTML=function(e,a){e.innerHTML=a,t.elementHandler(e)},e.exports.elementHandler=function(e){e.querySelectorAll(`.${ns}-expander`).forEach((e=>{e.classList.add("no-touch-action"),Player.events.set(e,"pointdragstart","position.initResize"),Player.events.set(e,"pointdrag.unbound","position.doResize"),Player.events.set(e,"pointdragend","position.stopResize")}));const t=Array.from(e.querySelectorAll(`.${ns}-popover`));e.classList.contains(`${ns}-popover`)&&t.push(e),t.forEach((e=>{e.addEventListener("mouseenter",Player.display._popoverMouseEnter),e.addEventListener("mouseleave",Player.display._popoverMouseLeave),"A"!==e.nodeName&&e.addEventListener("click",Player.display._popoverClick)})),Player.events.apply(e)},e.exports.escAttr=function(e,t){return e.replace(";",";").replace(/'/g,"'").replace(/"/g,t?"\\"":""").replace(/\n/g,"\\n")}},6672:e=>{const t={};e.exports={get:async function(e){return new Promise((function(a,n){const s={};t[e]&&(s["If-Modified-Since"]=t[e].lastModified),GM.xmlHttpRequest({method:"GET",url:e,headers:s,responseType:"json",onload:n=>{n.status>=200&&n.status<300&&(t[e]={lastModified:n.responseHeaders["last-modified"],response:n.response}),a(304===n.status?t[e].response:n.response)},onerror:n})}))}}},2189:e=>{e.exports={atRoot:["togglePlay","play","pause","next","previous","stop","toggleMute","volumeUp","volumeDown"],public:["togglePlay","play","pause","next","previous","stop","toggleMute","volumeUp","volumeDown"],initialize(){Player.controls._audio=Player.audio},togglePlay(){Player.audio.paused?Player.play():Player.pause()},async play(e,{paused:t}={}){try{if("string"==typeof e&&(e=Player.sounds.find((t=>t.id===e))),e||Player.playing||!Player.sounds.length||(e=Player.sounds[0]),e&&e!==Player.playing){Player.playing&&(Player.playing.playing=!1),Player.video.removeEventListener("canplaythrough",Player.actions.playOnceLoaded),Player.audio.removeEventListener("canplaythrough",Player.actions.playOnceLoaded);const t=Player.controls.audioEvents;for(let a in t){(Array.isArray(t[a])?t[a]:[t[a]]).forEach((t=>{const n=Player.getHandler(t);Player.video.removeEventListener(a,n),e.standaloneVideo&&Player.video.addEventListener(a,n)}))}e.playing=!0,Player.playing=e,Player.audio.src=e.src,Player.isVideo=e.image.endsWith(".webm")||"video/webm"===e.type,Player.isStandalone=e.standaloneVideo,Player.video.loop=!Player.isStandalone,Player.audio=e.standaloneVideo?Player.video:Player.controls._audio,Player.audio._linked=Player.isVideo&&!Player.isStandalone&&Player.video,Player.video._linked=Player.isVideo&&!Player.isStandalone&&Player.audio,Player.container.classList[Player.isVideo?"add":"remove"]("playing-video"),Player.container.classList[Player.isVideo||e.image.endsWith("gif")?"add":"remove"]("playing-animated"),await Player.trigger("playsound",e)}t||(!Player.isStandalone&&Player.isVideo&&(Player.video.readyState<3||Player.audio.readyState<3)?(Player.video.addEventListener("canplaythrough",Player.actions.playOnceLoaded),Player.audio.addEventListener("canplaythrough",Player.actions.playOnceLoaded)):Player.audio.play())}catch(e){Player.logError("There was an error playing the sound. Please check the console for details.",e)}},playOnceLoaded(e){e.currentTarget.readyState>3&&e.currentTarget._linked.readyState>3?(e.currentTarget.removeEventListener("canplaythrough",Player.actions.playOnceLoaded),e.currentTarget._linked.removeEventListener("canplaythrough",Player.actions.playOnceLoaded),e.currentTarget._inlinePlayer&&e.currentTarget._inlinePlayer.pendingControls&&e.currentTarget._inlinePlayer.pendingControls(),e.currentTarget._linked.play(),e.currentTarget.play()):(!e.currentTarget.paused&&e.currentTarget.pause(),!e.currentTarget._linked.paused&&e.currentTarget._linked.pause(),0!==e.currentTarget.currentTime&&(e.currentTarget.currentTime=0),0!==e.currentTarget._linked.currentTime&&(e.currentTarget._linked.currentTime=0))},pause(){Player.audio&&Player.audio.pause()},stop(){Player.audio.src=null,Player.playing=null,Player.isVideo=!1,Player.isStandalone=!1,Player.trigger("stop")},next(e){Player.actions._movePlaying(1,e)},previous(e){const t="number"==typeof Player.config.restartSeconds&&Player.config.restartSeconds;t&&Player.audio.currentTime>t?Player.audio.currentTime=0:Player.actions._movePlaying(-1,e)},_movePlaying(e,{force:t,group:a,paused:n}={}){if(!Player.sounds.length)return;const s=Player.sounds.indexOf(Player.playing);if(-1===s)return Player.play(Player.sounds[0]);let r;if(t||"one"!==Player.config.repeat){let t=s;do{t="all"===Player.config.repeat?(t+e+Player.sounds.length)%Player.sounds.length:t+e,r=Player.sounds[t]}while(a&&r&&t!==s&&(!r.post||r.post===Player.playing.post))}else r=Player.sounds[s];r&&Player.play(r,{paused:n})},volumeUp(){Player.audio.volume=Math.min(Player.audio.volume+.05,1)},volumeDown(){Player.audio.volume=Math.max(Player.audio.volume-.05,0)},toggleMute(){Player.audio.volume=(Player._lastVolume||.5)*!Player.audio.volume}}},9912:(e,t,a)=>{var n=a(6325);e.exports={template:a(3980),audioEvents:{ended:()=>Player.config.autoplayNext&&Player.next(),pause:"controls.handleMediaEvent",play:"controls.handleMediaEvent",seeked:"controls.handleMediaEvent",waiting:"controls.handleMediaEvent",ratechange:"controls.handleMediaEvent",timeupdate:"controls.updateDuration",loadedmetadata:["controls.updateDuration","controls"],durationchange:"controls.updateDuration",volumechange:"controls.updateVolume",loadstart:"controls.pollForLoading",error:"controls.handleAudioError"},actions:{previous:"previous({ force: true })",playPause:"togglePlay",next:"next({ force: true })",seek:'controls.handleSeek($event, "main")',mute:"toggleMute",volume:'controls.handleVolume($event, "main")',fullscreen:"display.toggleFullScreen"},async initialize(){GM.getValue("volume").then((e=>e>=0&&e<=1&&(Player.audio.volume=e))),Player.on("show",(()=>Player._hiddenWhilePolling&&Player.controls.pollForLoading())),Player.on("hide",(()=>{Player._hiddenWhilePolling=!!Player._loadingPoll,Player.controls.stopPollingForLoading()})),Player.on("rendered",(()=>{Player.video=Player.$(`.${ns}-video`),Player.video.dataset.id="main",Player.audio.volumeBar=Player.video.volumeBar=Player.$(`.${ns}-volume-bar .${ns}-current-bar`),Player.audio.currentTimeBar=Player.video.currentTimeBar=Player.$(`.${ns}-seek-bar .${ns}-current-bar`),Player.audio.loadedBar=Player.video.loadedBar=Player.$(`.${ns}-seek-bar .${ns}-loaded-bar`),Player.controls.updateDuration({currentTarget:Player.audio}),Player.controls.updateVolume({currentTarget:Player.audio}),Player.controls.preventWrapping()})),Player.on("config:preventControlsWrapping",(e=>!e&&Player.controls.showAllControls())),Player.on("config:controlsHideOrder",(()=>{Player.controls.setHideOrder(),Player.controls.preventWrapping()})),document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&Player.controls.sync(Player.audio)}))},handleAudioError(e){Player.playing&&(Player.logError(`Failed to play ${Player.playing.title}. Please check the console for details.`,e,"warning"),Player.playing.error=e,setTimeout((()=>Player.next({paused:!0})),3e3))},handleMediaEvent(e){const t=e.currentTarget._inlineAudio||e.currentTarget;Player.controls.sync(e.currentTarget),Player.controls.updateDuration(e),document.querySelectorAll(`.${ns}-play-button[data-audio="${t.dataset.id}"]`).forEach((e=>{e.classList[t.paused?"add":"remove"](`${ns}-play`)}))},sync(e){const t=e._linked;e&&e.readyState>3&&t&&t.readyState>3&&(t.currentTime=e.currentTime%t.duration,t[e.paused?"pause":"play"](),t.playbackRate=e.playbackRate,t.defaultPlaybackRate=e.defaultPlaybackRate)},pollForLoading(){Player._loadingPoll=Player._loadingPoll||setInterval(Player.controls.updateLoaded,1e3)},stopPollingForLoading(){Player._loadingPoll&&clearInterval(Player._loadingPoll),Player._loadingPoll=null},updateLoaded(){const e=Player.audio.buffered.length,t=e>0?Player.audio.buffered.end(e-1)/Player.audio.duration*100:0;100===t&&Player.controls.stopPollingForLoading(),Player.audio.loadedBar.style.width=t+"%"},updateDuration(e){const t=e.currentTarget,a=t._inlineAudio||t,s=t._inlinePlayer?t._inlinePlayer.controls:document,r=n.toDuration(t.currentTime),l=n.toDuration(t.duration),o=a.dataset.id;s&&s.querySelectorAll(`.${ns}-current-time[data-audio="${o}"]`).forEach((e=>e.childNodes[0].textContent=r)),s&&s.querySelectorAll(`.${ns}-duration[data-audio="${o}"]`).forEach((e=>e.childNodes[0].textContent=l)),Player.controls.updateProgressBarPosition(a.currentTimeBar,t.currentTime,t.duration)},updateVolume(e){const t=e.currentTarget._inlineAudio||e.currentTarget,a=t._inlinePlayer?t._inlinePlayer.controls:Player.container,n=t.volume;t===Player.audio&&(n>0&&(Player._lastVolume=n),GM.setValue("volume",n)),a&&a.querySelectorAll(`.${ns}-volume-button[data-audio="${t.dataset.id}"]`).forEach((e=>{e.classList[0===n?"add":"remove"]("mute"),e.classList[n>0?"add":"remove"]("up")})),Player.controls.updateProgressBarPosition(t.volumeBar,t.volume,1)},updateProgressBarPosition(e,t,a){if(!e)return;t||(t=0),a||(a=0);const n=a?Math.max(0,Math.min((t||0)/a,1)):0;e.style.width=`calc(${100*n}% - ${.8*n-.4}rem)`},handleSeek(e,t){const a="main"===t?Player.audio:Player.inline.audio[t]._inlinePlayer.master;a&&a.duration&&a.duration!==1/0&&(a.currentTime=a.duration*Player.controls._getBarXRatio(e))},handleVolume(e,t){("main"===t?Player.audio:Player.inline.audio[t]).volume=Player.controls._getBarXRatio(e)},_getBarXRatio(e){const t=.4*Player.remSize,a=e.offsetX||e.targetTouches[0].pageX-e.currentTarget.getBoundingClientRect().left;return Math.max(0,Math.min(1,(a-t)/(parseInt(getComputedStyle(e.currentTarget).width,10)-2*t)))},showAllControls(){Player.$all(`.${ns}-controls [data-hide-id]`).forEach((e=>e.style.display=null))},preventWrapping(){if(!Player.config.preventControlWrapping)return;const e=Player.$(`.${ns}-controls`),t=parseFloat(window.getComputedStyle(e).paddingTop),a=Player.controls.hideOrder||Player.controls.setHideOrder();let n=Array.prototype.slice.call(e.children),s=n.pop(),r=0;for(Player.controls.showAllControls();s.offsetTop>t&&rt!==e)),e===s&&(s=n.pop())}},setHideOrder(){Array.isArray(Player.config.controlsHideOrder)||Player.settings.reset("controlsHideOrder");const e=Player.$(`.${ns}-controls`);return Player.controls.hideOrder=Player.config.controlsHideOrder.map((t=>e.querySelector(`[data-hide-id="${t}"]`))).filter((e=>e)).sort(((e,t)=>e.dataset.hideOrder-t.dataset.hideOrder))}}},6764:(e,t,a)=>{var n=a(6325);const s=a(42),r=a(9449),l=a(2674),o={themes:a(3272),views:a(928)},i={},d={},c="function"==typeof NoSleep&&new NoSleep,p=()=>c.enable(),y=()=>c.disable();e.exports={atRoot:["show","hide"],public:["show","hide"],template:a(172),_noSleepEnabled:!1,async initialize(){try{Player.display.dismissed=(await GM.getValue("dismissed")).split(",")}catch(e){Player.display.dismissed=[]}Player.on("playsound",(()=>{Player.display._marquees={},!Player.display._marqueeTO&&Player.display.runTitleMarquee()})),Player.remSize=parseFloat(getComputedStyle(document.documentElement).fontSize),Player.on("config:preventSleep",Player.display._initNoSleep),Player.display._initNoSleep(Player.config.preventSleep),document.body.addEventListener("click",Player.display.closeDialogs),document.body.addEventListener("keydown",(e=>"Escape"===e.key&&Player.display.closeDialogs(e))),Player.on("playsound",Player.display.updateFullScreenDetails),Player.on("tags-loaded",(e=>e===Player.playing&&Player.display.updateFullScreenDetails()))},createPlayerButton(){if("FoolFuuka"===Site){const e=document.querySelector(".navbar-inner .nav:nth-child(2)");n.element('
  • Sounds
  • ',e).children[0].addEventListener("click",Player.display.toggle)}else if("Fuuka"===Site){const e=document.querySelector("div:has(#simple-search-form) + hr");e.parentNode.insertBefore(document.createTextNode("["),e),n.element('Sounds',e,"beforebegin"),e.parentNode.insertBefore(document.createTextNode("]"),e)}else isChanX?n.element('\n\t\t\t\tSounds\n\t\t\t',document.getElementById("shortcut-settings"),"beforebegin"):document.querySelectorAll("#settingsWindowLink, #settingsWindowLinkBot").forEach((function(e){n.element('Sounds',e,"beforebegin"),e.parentNode.insertBefore(document.createTextNode("] ["),e)}))},async render(){try{Player.container&&(document.body.removeChild(Player.container),document.head.removeChild(Player.stylesheet)),Player.stylesheet=Player.stylesheet||n.element('',document.head),Player.stylesheet.innerHTML=(isChanX?"":"/* 4chanX Polyfill */\n\n"+l())+"\n\n/* Sounds Player CSS */\n\n"+s(),Player.display.updateCSSVars();const e=Thread&&!isChanX&&document.body.querySelector(".board")||document.body;Player.container=n.element(Player.display.template(),e),await Player.trigger("rendered")}catch(e){throw Player.logError("There was an error rendering the sound player.",e),e}},updateCSSVars(){Player.varsCSS=Player.varsCSS||n.element('',document.head),Player.varsCSS.innerHTML="\n\n/* Sounds Player CSS variables */\n\n"+r()},async setViewStyle(e){const t=Player.config.viewStyle;if("fullscreen"!==e&&document.fullscreenElement&&document.exitFullscreen(),Player.set("viewStyle",e),Player.container.setAttribute("data-view-style",e),"playlist"!==e&&"image"!==e||Player.controls.preventWrapping(),"fullscreen"!==t||"fullscreen"===e){const[e,t]=(await GM.getValue("size")||"").split(":");e&&t&&Player.position.resize(parseInt(e,10),parseInt(t,10)),Player.position.setPostWidths()}Player.trigger("view",e,t)},toggle(){"none"===Player.container.style.display?(Player.theme.applyBoardTheme(),Player.show()):Player.hide()},hide(){Player.container.style.display="none",Player.isHidden=!0,Player.trigger("hide")},async show(){Player.container.style.display&&(Player.container.style.display=null,Player.isHidden=!1,await Player.trigger("show"))},async close(){Player.stop(),Player.hide()},async toggleFullScreen(){document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),document.body.removeEventListener("pointermove",Player.display._fullscreenMouseMove)):(Player.isHidden&&Player.show(),Player.$(`.${ns}-player`).requestFullscreen(),document.body.addEventListener("pointermove",Player.display._fullscreenMouseMove),Player.display._fullscreenMouseMove())},_fullscreenMouseMove(){Player.container.classList.remove("cursor-inactive"),Player.display.fullscreenCursorTO&&clearTimeout(Player.display.fullscreenCursorTO),Player.display.fullscreenCursorTO=setTimeout((function(){Player.container.classList.add("cursor-inactive")}),2e3)},updateFullScreenDetails(){const e=Player.playing.tags||{};document.querySelector(".fullscreen-details").innerHTML=[Player.playing.name,[e.title,e.artist].filter(Boolean).join(" - ")].filter(Boolean).join(" • ")||Player.playing.title},_handleFullScreenChange(){document.fullscreenElement?(Player.display.setViewStyle("fullscreen"),document.querySelector(`.${ns}-image-link`).removeAttribute("href")):(Player.playing&&(document.querySelector(`.${ns}-image-link`).href=Player.playing.image),Player.playlist.restore()),Player.controls.preventWrapping()},async restore(e){const t=Player.display.dismissed.indexOf(e);e&&t>-1&&(Player.display.dismissed.splice(t,1),Player.$all(`[\\@click^='display.restore("${e}")']`).forEach((t=>{n.element(i[e],t,"beforebegin"),t.parentNode.removeChild(t)})),await GM.setValue("dismissed",Player.display.dismissed.join(",")))},async dismiss(e){e&&!Player.display.dismissed.includes(e)&&(Player.display.dismissed.push(e),Player.$all(`[data-dismiss-id="${e}"]`).forEach((t=>{n.element(`${d[e]}`,t,"beforebegin"),t.parentNode.removeChild(t)})),await GM.setValue("dismissed",Player.display.dismissed.join(",")))},ifNotDismissed:(e,t,a)=>(i[e]=a,d[e]=t,Player.display.dismissed.includes(e)?`${t}`:a),showMenu(e,t,a){const s="string"==typeof t?n.element(o[t]()):t;Player.display.closeDialogs(),a||(a=Player.container),a.appendChild(s),Player.position.showRelativeTo(s,e),s.querySelectorAll(".entry").forEach((e=>{e.addEventListener("mouseenter",(t=>{Player.display._setFocusedMenuItem(t),e.dispatchEvent(new CustomEvent("entry-focus"))}))})),s._keepOpenFor=Array.from(s.querySelectorAll(".entry.has-submenu")),s._closeFor=Array.from(s.querySelectorAll(".submenu")),Player.trigger("menu-open",s)},_setFocusedMenuItem(e){const t=e.currentTarget.querySelector(".submenu");e.currentTarget.closest(".dialog").querySelectorAll(".focused").forEach((e=>{e.classList.remove("focused"),e.dispatchEvent(new CustomEvent("entry-blur"))})),e.currentTarget.classList.add("focused"),t&&t.getBoundingClientRect().right>document.documentElement.clientWidth&&(t.style.inset="0px 100% auto auto")},closeDialogs(e){document.querySelectorAll(`.${ns}-dialog`).forEach((t=>{const a=(t._keepOpenFor||[]).concat(t.dataset.allowClick?t:[]);(!e||!a.find((t=>t===e.target||t.contains(e.target)))||(t._closeFor||[]).find((t=>t===e.target||t.contains(e.target))))&&(t.parentNode.removeChild(t),Player.trigger("menu-close",t))}))},async runTitleMarquee(){Player.display._marqueeTO=setTimeout(Player.display.runTitleMarquee,1e3),document.querySelectorAll(`.${ns}-title-marquee`).forEach((e=>{const t=e.parentNode.getBoundingClientRect().width-(e.scrollWidth+1),a=e.getAttribute("data-location");if(t>=0)return e.style.marginLeft=null;const n=Player.display._marquees[a]=Player.display._marquees[a]||{direction:1,position:parseInt(e.style.marginLeft,10)||0};n.pause>0?n.pause--:(n.position-=20*n.direction,(n.position>0||n.position{const t=e.currentTarget,a=t.classList.contains("wide");t.infoEl&&Player.container.contains(t.infoEl)||(t.infoEl=n.element(`
    ${t.dataset.content}
    `,Player.container),t.infoEl._keepOpenFor=[t],Player.position.showRelativeTo(t.infoEl,t))},_popoverMouseLeave:e=>{const t=e.currentTarget;t.infoEl&&!t.infoEl._clicked&&(t.infoEl.parentNode.removeChild(t.infoEl),delete t.infoEl)},_popoverClick:e=>{const t=e.currentTarget;t.infoEl&&Player.container.contains(t.infoEl)?(t.infoEl._clicked=!t.infoEl._clicked)||Player.display._popoverMouseLeave(e):Player.display._popoverMouseEnter(e)},_initNoSleep:e=>{const t=e?"addEventListener":"removeEventListener";c&&!!e!==Player.display._noSleepEnabled&&(Player.audio[t]("play",p),Player.audio[t]("pause",y),Player.audio[t]("ended",y),Player.display._noSleepEnabled=!!e,Player.audio.paused||c[e?"enable":"disable"]())},untz(){const e=Player.$(`.${ns}-image-link`);if(Player.untzing=!Player.untzing,Player.audio.playbackRate=Player.audio.defaultPlaybackRate=Player.untzing?1.3:1,Player.container.classList[Player.untzing?"add":"remove"]("untz"),Player.untzing){const t=Player.$(".image-color-overlay");let a=0;t.style.filter=`brightness(1.5); hue-rotate(${a}deg)`,function e(){t.style.filter=`hue-rotate(${a=360-a}deg)`,Player.untzColorTO=setTimeout(e,500)}(),function t(){Player.untzing&&(e.style.transform=`scale(${1+.05*Math.random()})`,e.style.filter=`brightness(${1+.5*Math.random()}) blur(${3*Math.random()}px)`,Player.untzBounceTO=setTimeout(t,200))}()}else e.style.transform=null,e.style.filter=null,clearTimeout(Player.untzBounceTO),clearTimeout(Player.untzColorTO)}}},3319:e=>{e.exports={atRoot:["on","off","trigger"],_events:{},initialize(){const e={Player,...Player.components},t=[];for(let a of Object.values(e))a.audioEvents&&t.push(a.audioEvents);document.body.addEventListener("pointerup",Player.events.clearMousedown),document.body.addEventListener("pointercancel",Player.events.clearMousedown),Player.on("rendered",(function(){for(let e of t)for(let t in e){(Array.isArray(e[t])?e[t]:[e[t]]).forEach((e=>Player.audio.addEventListener(t,Player.getHandler(e))))}}))},apply(e){const t=[],a=document.evaluate('.//attribute::*[starts-with(name(), "@")]',e,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(let e=0;e(e[t]=!0,e)),{}),l=e._eventListeners||(e._eventListeners={});l[n]&&e.removeEventListener(n,l[n]);let o=a&&(Player.getHandler(a)||function(e){const t=document.createElement("script");t.innerText=`window.${ns}Handler = function(Player, $event) { with (Player) { ${a} } };`,document.head.appendChild(t),o=unsafeWindow[`${ns}Handler`].bind(null,Player),delete unsafeWindow[`${ns}Handler`],o(e)});const i=function(e){return r.prevent&&e.preventDefault(),r.stop&&e.stopPropagation(),r.disabled&&e.currentTarget.classList.contains("disabled")&&e.currentTarget.classList.contains("disabled"),o&&o.call(this,e,Player)};if("pointdrag"===n){const t=t=>{t._dragInit||(t._dragInit=!0,l.pointdragstart&&l.pointdragstart(t),t.preventDrag||(e.setPointerCapture(t.pointerId),Player._mousedown=e,Player._mousedownListener=i,Player._mousedownMoveEl=r.unbound?document.documentElement:e,Player._mousedownMoveEl.addEventListener("pointermove",i,r),e.addEventListener("pointerleave",i,r),r.boxed&&e.addEventListener("pointerleave",Player.events.clearMousedown),!r.move&&i(t)))};e.addEventListener("pointerdown",t),l.pointerdown=t}else"pointdragstart"===n||"pointdragend"===n||e.addEventListener(n,i,r),l[n]=i},on(e,t){(Array.isArray(e)?e:[e]).forEach((e=>{Player.events._events[e]||(Player.events._events[e]=[]),Player.events._events[e].push(t)}))},off(e,t){const a=Player.events._events[e]&&Player.events._events[e].indexOf(t);a>-1&&Player.events._events[e].splice(a,1)},async trigger(e,...t){const a=Player.events._events[e]||[];for(let e of a)await e(...t)},clearMousedown(e){Player._mousedown&&(Player._mousedown.releasePointerCapture(e.pointerId),Player._mousedownMoveEl.removeEventListener("pointermove",Player._mousedownListener),Player._mousedown.removeEventListener("pointerleave",Player._mousedownListener),Player._mousedown._eventListeners.pointdragend&&Player._mousedown._eventListeners.pointdragend(e),Player._mousedown=Player._mousedownListener=null)}}},337:(e,t,a)=>{var n=a(6325);e.exports={template:()=>Player.userTemplate.build({template:Player.config.footerTemplate+`
    `,location:"footer",sound:Player.playing,defaultName:"4chan Sounds",outerClass:`${ns}-col-auto`}),initialize(){Player.userTemplate.maintain(Player.footer,"footerTemplate")},render(){n.elementHTML(Player.$(`.${ns}-footer`),Player.footer.template())}}},8563:(e,t,a)=>{var n=a(6325);e.exports={template:()=>Player.userTemplate.build({template:Player.config.headerTemplate+`
    `,location:"header",sound:Player.playing,defaultName:"4chan Sounds",outerClass:`${ns}-col-auto`}),initialize(){Player.userTemplate.maintain(Player.header,"headerTemplate")},render(){n.elementHTML(Player.$(`.${ns}-header`),Player.header.template())}}},9433:(e,t,a)=>{const n=a(5303);let s;e.exports={_keyMap:{" ":"space",arrowleft:"left",arrowright:"right",arrowup:"up",arrowdown:"down"},initialize(){if(Player.on("rendered",Player.hotkeys.apply),Player.on("config:hotkeys",Player.hotkeys.apply),s=n.reduce(((e,t)=>("hotkey_bindings"===t.property&&t.settings.forEach((t=>e[t.property.slice(16)]=t)),e)),{}),"mediaSession"in navigator&&Player.config.hardwareMediaKeys){const e=[["play",()=>Player.play()],["pause",()=>Player.pause()],["stop",()=>Player.pause()],["previoustrack",()=>Player.previous()],["nexttrack",()=>Player.next()],["seekbackward",e=>Player.audio.currentTime-=e.seekOffset||10],["seekforward",e=>Player.audio.currentTime+=e.seekOffset||10],["seekto",e=>Player.audio.currentTime+=e.seekTime]];for(let[t,a]of e)try{navigator.mediaSession.setActionHandler(t,a)}catch(e){}Player.audio.addEventListener("pause",(()=>navigator.mediaSession.playbackState="paused")),Player.audio.addEventListener("ended",(()=>navigator.mediaSession.playbackState="paused")),Player.audio.addEventListener("play",Player.hotkeys.setMediaMetadata),Player.audio.addEventListener("ratechange",Player.hotkeys.setMediaPosition),Player.audio.addEventListener("seeked",Player.hotkeys.setMediaPosition),Player.on("tags-loaded",(e=>e===Player.playing&&Player.hotkeys.setMediaMetadata()))}},async setMediaMetadata(){const e=Player.playing,t=e.tags||{};navigator.mediaSession.playbackState="playing";const a={title:t.title||e.name||e.title,artist:t.artist||`/${Board}/ - ${Thread||"4chan Sounds Player"}`,album:t.album||document.title,artwork:[{src:Player.playing.thumb,sizes:"125x125"}]};if(!Player.isVideo)if(e._fullDimension)a.artwork.push({src:Player.playing.image,sizes:e._fullDimension});else{const t=new Image;t.onload=function(){e._fullDimension=t.width+"x"+t.height,Player.hotkeys.setMediaMetadata()},t.src=Player.playing.image}navigator.mediaSession.metadata=new MediaMetadata(a),Player.hotkeys.setMediaPosition()},setMediaPosition(){navigator.mediaSession.setPositionState({duration:Player.audio.duration||0,playbackRate:Player.audio.playbackRate,position:Player.audio.currentTime})},addHandler:()=>{Player.hotkeys.removeHandler(),document.body.addEventListener("keydown",Player.hotkeys.handle)},removeHandler:()=>{document.body.removeEventListener("keydown",Player.hotkeys.handle)},apply(){const e=Player.config.hotkeys;Player.hotkeys.removeHandler(),Player.off("show",Player.hotkeys.addHandler),Player.off("hide",Player.hotkeys.removeHandler),"always"===e?Player.hotkeys.addHandler():"open"===e&&(Player.isHidden||Player.hotkeys.addHandler(),Player.on("show",Player.hotkeys.addHandler),Player.on("hide",Player.hotkeys.removeHandler))},handle(e){if(Player.isHidden&&("always"!==Player.config.hotkeys||!Player.sounds.length))return;const t=["INPUT","SELECT","TEXTAREA","INPUT"].includes(e.target.nodeName),a=e.key.toLowerCase(),n=Player.config.hotkey_bindings||{};Object.entries(n).forEach((function n([r,l]){if(Array.isArray(l))return l.find((e=>n([r,e])));const o=a===l.key&&!!l.shiftKey==!!e.shiftKey&&!!l.ctrlKey==!!e.ctrlKey&&!!l.metaKey==!!e.metaKey&&(!l.ignoreRepeat||!e.repeat)&&s[r];!o||t&&!o.allowFocusedInput||(e.preventDefault(),e._binding=l,Player.getHandler(o.keyHandler)(e))}))},stringifyKey(e){let t=e.key.toLowerCase();return Player.hotkeys._keyMap[t]&&(t=Player.hotkeys._keyMap[t]),(e.ctrlKey?"Ctrl+":"")+(e.shiftKey?"Shift+":"")+(e.metaKey?"Meta+":"")+t},parseKey(e){const t=e.split("+");let a=t.pop();Object.keys(Player.hotkeys._keyMap).find((e=>Player.hotkeys._keyMap[e]===a&&(a=e)));const n={key:a};return t.forEach((e=>n[e.toLowerCase()+"Key"]=!0)),n}}},6431:(e,t,a)=>{var n=a(6325);const s=a(218),r=a(3980);e.exports={idx:0,audio:{},expandedNodes:[],mediaEvents:{ended:e=>Player.inline._movePlaying(e.currentTarget.dataset.id,+("one"!==Player.config.expandedRepeat)),pause:"controls.handleMediaEvent",play:"controls.handleMediaEvent",seeked:"controls.handleMediaEvent",waiting:"controls.handleMediaEvent",timeupdate:"controls.updateDuration",loadedmetadata:"controls.updateDuration",durationchange:"controls.updateDuration",volumechange:"controls.updateVolume"},initialize(){is4chan&&(Player.inline.observer=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach(Player.inline.handleAddedNode),e.removedNodes.forEach(Player.inline.handleRemovedNode)}))})),Player.on("config:playExpandedImages",Player.inline._handleConfChange),Player.on("config:playHoveredImages",Player.inline._handleConfChange),Player.inline._handleConfChange())},_handleConfChange(){Player.config.playExpandedImages||Player.config.playHoveredImages?Player.inline.start():Player.inline.stop()},handleAddedNode(e){try{if("IMG"!==e.nodeName&&"VIDEO"!==e.nodeName)return;const a=Player.config.playExpandedImages&&e.matches(s.expandedImage),l=Player.config.playHoveredImages&&e.matches(s.hoverImage);if(a||l){const o="VIDEO"===e.nodeName;let i;try{i=isChanX?e.dataset.fileID.split(".")[1]:(a?e:document.querySelector(`a[href$="${e.src.replace(/^https?:/,"")}"]`)).closest(s.posts).id.slice(s.postIdPrefix.length)}catch(h){return}let d=i&&Player.sounds.filter((e=>e.post===i&&!e.standaloneVideo))||[];if(Player.config.expandedAllowFiltered&&(d=d.concat(Player.filteredSounds.filter((e=>e.post===i&&!e.disallow.host)))),!d.length)return;const c=new Audio(d[0].src),p=c.dataset.id=Player.inline.idx++,y=o&&"video"===Player.config.expandedLoopMaster?e:c;Player.inline.audio[p]=c,Player.inline.expandedNodes.push(e),e.classList.add(`${ns}-has-inline-audio`),e._inlineAudio=c,c._inlinePlayer=e._inlinePlayer={master:y,video:e,isVideo:o,audio:c,sounds:d,index:0},o&&(e._linked=c,c._linked=e),c.src=d[0].src,c.volume=Player.audio.volume,c.currentTime=0,Player.inline.updateSyncListeners(y,"add");const u=a&&Player.config.expandedControls;function t(){delete e._inlinePlayer.pendingControls,e.parentNode.classList.add(`${ns}-has-controls`);const t=c._inlinePlayer.controls=n.element(r({audio:c,multiple:d.length>1,audioId:p,inline:!0,actions:{previous:`inline.previous("${p}")`,playPause:`inline.playPause("${p}")`,next:`inline.next("${p}")`,seek:`controls.handleSeek($event, "${p}")`,mute:`inline.mute("${p}")`,volume:`controls.handleVolume($event, "${p}")`}}),e.parentNode);t.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation()})),c.volumeBar=t.querySelector(`.${ns}-volume-bar .${ns}-current-bar`),c.currentTimeBar=t.querySelector(`.${ns}-seek-bar .${ns}-current-bar`),Player.controls.updateProgressBarPosition(c.volumeBar,c.volume,1)}o&&u&&(e.controls=!1,e.controlsObserver=new MutationObserver((()=>e.controls=!1)),e.controlsObserver.observe(e,{attributes:!0}),e.addEventListener("click",(()=>Player.inline.playPause(p)))),o&&(e.readyState<3||c.readyState<3)?(c.pause(),e.pause(),e._inlinePlayer.pendingControls=u&&t,e.addEventListener("canplaythrough",Player.actions.playOnceLoaded),c.addEventListener("canplaythrough",Player.actions.playOnceLoaded)):(u&&t(),c.play())}}catch(g){Player.logError("Failed to play sound.",g)}},handleRemovedNode(e){const t=[e];e.querySelectorAll&&t.push(...e.querySelectorAll(`.${ns}-has-inline-audio`)),t.forEach((e=>{e._inlineAudio&&Player.inline._removeForNode(e)}))},_removeForNode(e){e.controlsObserver&&e.controlsObserver.disconnect(),Player.inline.updateSyncListeners(e._inlinePlayer.master,"remove");const t=e._inlineAudio._inlinePlayer.controls;t&&(t.parentNode.classList.remove(`${ns}-has-controls`),t.parentNode.removeChild(t)),e._inlineAudio.pause(),delete Player.inline.audio[e._inlineAudio.dataset.id],delete e._inlineAudio,Player.inline.expandedNodes=Player.inline.expandedNodes.filter((t=>t!==e))},updateSyncListeners(e,t){if("VIDEO"===e.nodeName||"AUDIO"===e.nodeName){const a=e._inlineAudio||e;if("remove"===t){a._inlinePlayer.video.removeEventListener("canplaythrough",Player.actions.playOnceLoaded),a.removeEventListener("canplaythrough",Player.actions.playOnceLoaded)}Object.entries(Player.inline.mediaEvents).forEach((([a,n])=>{e[`${t}EventListener`](a,Player.getHandler(n))}))}},start(){Player.inline.observer.observe(document.body,{childList:!0,subtree:!0})},stop(){Player.inline.observer.disconnect(),Player.inline.expandedNodes.forEach(Player.inline._removeForNode),Player.inline.expandedNodes=[]},previous(e){const t=Player.inline.audio[e];t.currentTime>3?t.currentTime=0:Player.inline._movePlaying(e,-1)},next(e){Player.inline._movePlaying(e,1)},_movePlaying(e,t){const a=Player.inline.audio[e],n=a&&a._inlinePlayer,s=n.sounds.length,r=Player.config.expandedRepeat;if(n&&("none"!==r||n.index+t>=0&&n.index+t{var n=a(6325),s=a(4302);e.exports={_showingPIP:!1,initialize(){isChanX&&Player.userTemplate.maintain(Player.minimised,"chanXTemplate",["chanXControls"],["show","hide","stop"]),Player.on("rendered",Player.minimised.render),Player.on("show",Player.minimised.hidePIP),Player.on("hide",Player.minimised.showPIP),Player.on("stop",Player.minimised.hidePIP),Player.on("playsound",Player.minimised.showPIP)},render(){if(Player.container&&isChanX){let e=document.querySelector(`.${ns}-chan-x-controls`);if(e||(e=n.element(``,document.querySelector("#shortcuts"),"afterbegin")),"never"===Player.config.chanXControls||"closed"===Player.config.chanXControls&&!Player.isHidden)return e.innerHTML="";const t=Player.audio.dataset.id;n.elementHTML(e,Player.userTemplate.build({template:Player.config.chanXTemplate,location:"4chan-X-controls",sound:Player.playing,replacements:{"prev-button":`${s.skipStart} ${s.skipStartFill}`,"play-button":`${s.play} ${s.pause} ${s.playFill} ${s.pauseFill}`,"next-button":`${s.skipEnd} ${s.skipEndFill} `,"sound-current-time":`0:00`,"sound-duration":`0:00`}}))}},showPIP(){if(!Player.isHidden||!Player.config.pip||!Player.playing||Player.minimised._showingPIP)return;Player.minimised._showingPIP=!0;const e=document.querySelector(`.${ns}-image-link`);document.body.appendChild(e),e.classList.add(`${ns}-pip`),e.style.bottom=Player.position.getHeaderOffset().bottom+10+"px",e.style.height=null,e.addEventListener("click",Player.minimised._handleImageClick)},hidePIP(){Player.minimised._showingPIP=!1;const e=document.querySelector(`.${ns}-image-link`),t=Player.$(`.${ns}-controls`);t.parentNode.insertBefore(document.querySelector(`.${ns}-image-link`),t),e.classList.remove(`${ns}-pip`),e.style.bottom=null,e.style.height=Player.config.imageHeight+"px",e.removeEventListener("click",Player.minimised._handleImageClick)},_handleImageClick:e=>{e.preventDefault(),Player.show()}}},9200:(e,t,a)=>{var n=a(6325),s=a(4302);const{postIdPrefix:r}=a(218),l=a(3571),o=a(2663);e.exports={atRoot:["add","remove"],public:["search"],tagLoadTO:{},template:a(4837),listTemplate:a(4486),tagsDialogTemplate:a(8808),initialize(){Player.playlist._lastView="playlist"===Player.config.viewStyle||"image"===Player.config.viewStyle?Player.config.viewStyle:"playlist",Player.on("view",(e=>{"playlist"===e&&Player.playlist.scrollToPlaying(),"playlist"!==e&&"image"!==e||(Player.playlist._lastView=e)})),Player.on("rendered",Player.playlist.afterRender),Player.on("playsound",(e=>{Player.playlist.showImage(e),Player.$all(`.${ns}-list-item.playing, .${ns}-list-item[data-id="${Player.playing.id}"]`).forEach((e=>{const t=Player.playlist.listTemplate({sounds:[Player.sounds.find((t=>t.id===e.dataset.id))]});n.element(t,e,"beforebegin"),e.parentNode.removeChild(e)})),"fullscreen"!==Player.config.viewStyle&&Player.playlist.scrollToPlaying("nearest"),Player.config.autoScrollThread&&e.post&&(location.href=location.href.split("#")[0]+"#"+r+e.post),Player.playlist.loadTags(Player.playing.id)})),Player.on("stop",(()=>{Player.$all(`.${ns}-list-item.playing`).forEach((e=>e.classList.remove("playing")));const e=Player.$(`.${ns}-image-link`);e.href="#",Player.$(`.${ns}-background-image`).src=Player.video.src="",Player.$(`.${ns}-image`).src=`data:image/svg+xml;base64,${btoa(s.fcSounds)}`,e.classList.remove(`${ns}-show-video`)})),Player.on("config:filters",Player.playlist.applyFilters),Player.on("config:allow",Player.playlist.applyFilters),Player.on("config:hoverImages",Player.playlist.setHoverImageVisibility),Player.on("menu-open",Player.playlist.setHoverImageVisibility),Player.on("menu-close",Player.playlist.setHoverImageVisibility),Player.on("config:showPlaylistSearch",Player.playlist.toggleSearch),Player.on("config:shuffle",Player.playlist._handleShuffle),Player.on("tags-loaded",(e=>{const t=Player.$(`.tags-dialog[data-sound-id="${e.id}"]`);t&&n.elementHTML(t,Player.playlist.tagsDialogTemplate(e))})),Player.on("config:imageHeight",(e=>Player.$(`.${ns}-image-link`).style.height=e+"px")),Player.on(["playsound","order"],(()=>{const e=Player.sounds[(Player.sounds.indexOf(Player.playing)+1)%Player.sounds.length];e&&Player.playlist.preload(e)})),Player.userTemplate.maintain(Player.playlist,"rowTemplate",["shuffle"]),Player.playlist.imageResizeObserver=new ResizeObserver(Player.playlist.resizeTransBG)},render(){n.elementHTML(Player.$(`.${ns}-list-container`),Player.playlist.listTemplate()),Player.playlist.afterRender()},afterRender(){Player.playlist.image=Player.$(`.${ns}-image`),Player.playlist.transparentImageBG=Player.$(`.${ns}-image-transparent-bg`),Player.playlist.hoverImage=Player.$(`.${ns}-hover-image`),Player.playlist.imageResizeObserver.disconnect(),Player.playlist.imageResizeObserver.observe(Player.playlist.image),Player.playlist.image.onload=Player.playlist.resizeTransBG},restore(){Player.display.setViewStyle(Player.playlist._lastView||"playlist")},showImage(e){const t=document.querySelector(`.${ns}-image-link`),a=t.querySelector(`.${ns}-image`),n=t.querySelector(`.${ns}-background-image`);a.src=n.src="",a.src=n.src=e.imageOrThumb,Player.isVideo&&(Player.video.src=e.image),"fullscreen"!==Player.config.viewStyle&&(t.href=e.image),t.classList[Player.isVideo?"add":"remove"](ns+"-show-video")},resizeTransBG(){const e=Player.playlist.image.width/Player.playlist.image.height,t=Player.playlist.image.naturalWidth/Player.playlist.image.naturalHeight,a=Player.playlist.transparentImageBG;a.style.width=Math.min(t/e*100,100)+"%",a.style.height=Math.min(e/t*100,100)+"%"},toggleView(e){e&&e.preventDefault();let t="playlist"===Player.config.viewStyle?"image":"image"===Player.config.viewStyle?"playlist":Player.playlist._lastView;Player.display.setViewStyle(t)},add(e,t){try{const a=e.id;if(Player.sounds.find((e=>e.id===a)))return;let s=Player.config.shuffle?Math.floor(Math.random()*Player.sounds.length-1):Player.sounds.findIndex((e=>Player.compareIds(e.id,a)>1));if(s<0&&(s=Player.sounds.length),Player.sounds.splice(s,0,e),Player.container){if(!t){const t=Player.$(`.${ns}-list-container`);let a=n.element(`
    ${Player.playlist.listTemplate({sounds:[e]})}
    `);if(s!e.standaloneVideo)).length&&Player.show(),Player.trigger("add",e)}}catch(t){Player.logError("There was an error adding to the sound player. Please check the console for details.",t),console.log("[4chan sounds player]",e)}},addFromDrop(e){for(let t of e.dataTransfer.items){const e=t.getAsEntry?t.getAsEntry():t.webkitGetAsEntry();e&&Player.playlist._scanEntry(e)}},_scanEntry:e=>e.isDirectory?Player.playlist._readEntries(e.createReader()):e.file((e=>Player.playlist.addFromFiles([e]))),_readEntries(e){e.readEntries((t=>{t.length&&(t.forEach(Player.playlist._scanEntry),Player.playlist._readEntries(e))}))},addFromFiles(e){[...e].forEach((e=>{if(!e.type.startsWith("image")&&"video/webm"!==e.type)return;const t=URL.createObjectURL(e),a=e.type;let n=t;if("video/webm"!==e.type)return o();const s=document.createElement("canvas"),r=document.createElement("video"),l=s.getContext("2d");function o(){const{sounds:s}=Player.posts.getSounds(e.name,t,null,n,null,!0);s.forEach((e=>Player.add({...e,local:!0,type:a})))}r.addEventListener("seeked",(function(){s.width=r.videoWidth,s.height=r.videoHeight,l.drawImage(r,0,0,r.videoWidth,r.videoHeight),n=s.toDataURL(),o()})),r.src=t,r.currentTime=.001}))},selectLocalFiles(){Player.$(`.${ns}-add-local-file-input`).click()},remove(e){"object"!=typeof e&&(e=Player.sounds.find((t=>t.id===""+e)));const t=Player.sounds.indexOf(e);Player.playing===e&&Player.next({force:!0,paused:Player.audio.paused}),t>-1&&Player.sounds.splice(t,1);const a=e&&Player.$(`.${ns}-list-item[data-id="${e.id}"]`);a&&Player.$(`.${ns}-list-container`).removeChild(a),e&&Player.trigger("remove",e)},toggleRepeat(){const e=["all","one","none"],t=e.indexOf(Player.config.repeat);Player.set("repeat",e[(t+4)%3])},toggleShuffle(){Player.set("shuffle",!Player.config.shuffle)},_handleShuffle(){if(Player.config.shuffle){const e=Player.sounds;for(let t=e.length-1;t>0;t--){const a=Math.floor(Math.random()*(t+1));[e[t],e[a]]=[e[a],e[t]]}}else Player.sounds.sort(((e,t)=>Player.compareIds(e.id,t.id)));Player.trigger("order")},handleSelect(e){if("A"===e.target.nodeName||e.target.closest("a"))return;const t=e.currentTarget.getAttribute("data-id"),a=t&&Player.sounds.find((e=>e.id===t));a&&Player.play(a)},handleItemMenu(e,t){const a=Player.sounds.find((e=>e.id===t)),s=e.currentTarget.closest(`.${ns}-list-container`)||Player.container,l=o({sound:a,postIdPrefix:r}),i=n.element(l,s),d=e.currentTarget.classList.contains(`${ns}-item-menu-button`)?e.currentTarget:e;Player.display.showMenu(d,i,s)},toggleHoverImages(e){e&&e.preventDefault(),Player.set("hoverImages",!Player.config.hoverImages)},setHoverImageVisibility(){const e=Player.$(`.${ns}-player`),t=!Player.config.hoverImages||Player.playlist._dragging||e.querySelector(`.${ns}-menu`);e.classList[t?"add":"remove"](`${ns}-hide-hover-image`)},updateHoverImage(e){const t=e.currentTarget.getAttribute("data-id"),a=Player.sounds.find((e=>e.id===t));Player.playlist.hoverImage.style.display="block",Player.playlist.hoverImage.setAttribute("src",a.thumb),Player.playlist.positionHoverImage(e)},positionHoverImage(e){const{width:t,height:a}=Player.playlist.hoverImage.getBoundingClientRect(),n=document.documentElement.clientWidth-t-5;Player.playlist.hoverImage.style.left=Math.min(e.clientX,n)+5+"px",Player.playlist.hoverImage.style.top=e.clientY-a-10+"px"},removeHoverImage(){Player.playlist.hoverImage.style.display="none"},handleDragStart(e){Player.playlist._dragging=e.currentTarget,Player.playlist.setHoverImageVisibility(),e.currentTarget.classList.add(`${ns}-dragging`);const t=document.createElement("img");t.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",t.opacity=0,e.dataTransfer.setDragImage(t,0,0),e.dataTransfer.dropEffect="move",e.dataTransfer.setData("text/plain",e.currentTarget.getAttribute("data-id"))},handleDragEnter(e){if(!Player.playlist._dragging)return;const t=Player.playlist._dragging,a=t.getAttribute("data-id");let n=e.target.closest&&e.target.closest(`.${ns}-list-item`);if(!n||t===n)return;const s=Player.sounds.findIndex((e=>e.id===a)),r=t.parentNode;if(4&t.compareDocumentPosition(n)&&(n=n.nextElementSibling),n){const e=n.getAttribute("data-id"),a=Player.sounds.findIndex((t=>t.id===e)),l=s{e.disallow=Player.disallowedSound(e),e.disallow&&(Player.playlist.remove(e),Player.filteredSounds.push(e),Player.posts.updateButtons(e.post))})),Player.filteredSounds.forEach(((e,t)=>{e.disallow=Player.disallowedSound(e),e.disallow||(Player.filteredSounds.splice(t,1),Player.playlist.add(e),Player.posts.updateButtons(e.post))})),Player.trigger("filters-applied")},addFilter(e){e&&Player.set("filters",Player.config.filters.concat(e))},_handleSearch(e){Player.playlist.search(e.currentTarget.value.toLowerCase())},search(e){const t=Player.playlist._lastSearch;Player.playlist._lastSearch=e,e!==t&&Player.playlist.render()},matchesSearch(e){const t=Player.playlist._lastSearch;return!t||e.title.toLowerCase().includes(t)||e.post&&String(e.post.toLowerCase()).includes(t)||String(e.src.toLowerCase()).includes(t)},toggleSearch(e){const t=Player.$(`.${ns}-playlist-search`);!e&&Player.playlist._lastSearch&&Player.playlist.search(),t.style.display=e?null:"none",e&&t.focus()},loadTags(e){const t=Player.sounds.find((t=>t.id===e));function a(e){t.tags=e&&Object.entries(e.tags||{}).reduce(((e,[t,a])=>("string"==typeof a&&(e[t]=a),e)),{}),Player.trigger("tags-loaded",t)}t.tags||(Player.playlist.tagLoadTO[e]=setTimeout((()=>{const e=new jsmediatags.Reader(t.src);e._findFileReader().prototype._createXHRObject=()=>new l.GM,e.read({onSuccess:a,onError:a})}),150))},abortTags(e){clearTimeout(Player.playlist.tagLoadTO[e]),delete Player.playlist.tagLoadTO[e]},expandImageStart(e){0!==e.button||Player.isHidden||"playlist"!==Player.config.viewStyle||(Player.$(`.${ns}-image-link`).style.cursor="ns-resize",Player._imageResizeStartY=(e.touches&&e.touches[0]||e).clientY,Player._imageResizeStartHeight=Player.config.imageHeight,Player._imageResized=!1,Player._imageReizeMaxHeight=Player.$(`.${ns}-player`).getBoundingClientRect().height-Player.$(`.${ns}-controls`).getBoundingClientRect().height)},expandImage(e){if(!Player.isHidden&&"playlist"===Player.config.viewStyle){Player._imageResized=!0;const t=(e.touches&&e.touches[0]||e).clientY,a=Player._imageResizeStartHeight+t-Player._imageResizeStartY;Player.$(`.${ns}-image-link`).style.height=Math.min(Math.max(125,a),Player._imageReizeMaxHeight)+"px"}},setImageHeight(){if(!Player.isHidden&&"playlist"===Player.config.viewStyle){Player.$(`.${ns}-image-link`).style.cursor=null;const e=Player.$(`.${ns}-image-link`),t=parseInt(e.style.height),a=Player.$(`.${ns}-player`).getBoundingClientRect().height-Player.$(`.${ns}-controls`).getBoundingClientRect().height,n=Math.max(125,Math.min(t,a));e.style.height=n+"px",Player.set("imageHeight",n)}},expandImageClick(e){!Player.isHidden&&"playlist"===Player.config.viewStyle&&Player._imageResized&&e.preventDefault()},async preload(e){if(e.preloading)return;e.preloading=!0;const t=e.image.endsWith(".webm")||"video/webm"===e.type;await Promise.all([!e.standaloneVideo&&new Promise((t=>{const a=new Audio;a.addEventListener("canplaythrough",t),a.addEventListener("error",t),a.src=e.src})),t&&new Promise((t=>{const a=document.createElement("video");a.addEventListener("canplaythrough",t),a.addEventListener("error",t),a.src=e.image}))]),e.preloading=!1}}},2473:(e,t,a)=>{const n=a(218);e.exports={initialize(){const{top:e,bottom:t}=Player.position.getHeaderOffset();Player.config.offsetTop=e+"px",Player.config.offsetBottom=t+"px",Player.on("show",(async function(){const[e,t]=(await GM.getValue("position")||"").split(":"),[a,n]=(await GM.getValue("size")||"").split(":");+a&&+n&&Player.position.resize(a,n,!0),+e&&+t&&Player.position.move(e,t),Player.config.limitPostWidths&&(Player.position.setPostWidths(),window.addEventListener("scroll",Player.position.setPostWidths))})),Player.on("hide",(function(){Player.position.setPostWidths(),window.removeEventListener("scroll",Player.position.setPostWidths)})),Player.on("config",(e=>{"limitPostWidths"!==e&&"minPostWidth"!==e||(window.removeEventListener("scroll",Player.position.setPostWidths),Player.position.setPostWidths(),Player.config.limitPostWidths&&window.addEventListener("scroll",Player.position.setPostWidths))})),new MutationObserver((function(){document.querySelectorAll("#hoverUI .postContainer, .inline .postContainer, .backlink_container article").forEach((e=>{e.style.maxWidth=null,e.style.minWidth=null}))})).observe(document.body,{childList:!0,subtree:!0}),Player.syncTab("position",(e=>Player.position.move(...e.split(":").concat(!0)))),Player.syncTab("size",(e=>Player.position.resize(...e.split(":"))))},setPostWidths(){const e=document.documentElement.clientWidth-Player.container.offsetLeft+10,t=!Player.isHidden&&Player.config.limitPostWidths,a=Player.container.offsetTop,s=Player.container.getBoundingClientRect().height+a;document.querySelectorAll(n.limitWidthOf).forEach((n=>{const r=t&&n.getBoundingClientRect(),l=t&&r.top+r.height>a&&r.topdocument.documentElement.clientWidth&&(e.style.left=a.left+a.width-n+"px"),a.top+a.height+s>document.documentElement.clientHeight-Player.position.getHeaderOffset().bottom&&(e.style.top=a.top-s+"px")}}},1:(e,t,a)=>{var n=a(6325);const s=a(218),r=a(5463),l=/^(https?:)?\/\//,o=new RegExp("(.*?)[[({]("+Object.keys(r).join("|")+")[ =:|$](.*?)[\\])}]","gi");let i=0;e.exports={addPosts(e,t){let a=!1;(e.classList.contains("post")?[e]:e.querySelectorAll(s.posts)).forEach((e=>Player.posts.addPost(e,t)&&(a=!0))),a&&t&&Player.container&&Player.playlist.render()},addPost(e,t){try{let a=e.parentElement,n=a&&a.parentElement;if(e.classList.contains("style-fetcher")||n&&"qp"===n.id||a&&a.classList.contains("noFile"))return;const r=e.id.slice(s.postIdPrefix.length);let l=e.querySelector(`.${ns}-play-link`),o=e.querySelector(`.${ns}-unfilter-link`);if(l||o)return l&&Player.events.apply(l),void(o&&Player.events.apply(o));let i=null,d=s.filename;if(Object.keys(d).some((function(t){const a=e.querySelector(t);return a&&(i=a[d[t]])})),!i)return;s.filenameParser&&(i=s.filenameParser(i));const c=e.querySelector(s.thumb).closest("a"),p=c&&c.href,y=c&&c.querySelector("img"),u=y&&y.src,h="Fuuka"===Site?e.querySelector(":scope > br + a").href.split("/").pop():y&&y.getAttribute("data-md5");"HO0kbeZNQqBye1CF7Tq7hg=="===h&&e.innerHTML.includes("[futari no christmas]")&&(i="futari no christmas[sound=files.catbox.moe/ahvi2c.opus]");const{sounds:g,filtered:m}=Player.posts.getSounds(i,p,r,u,h);return(g.length||m.length)&&(g.forEach((e=>Player.add(e,t))),m.forEach((e=>Player.filteredSounds.push(e))),Player.posts.updateButtons(r),m.length&&Player.trigger("filters-applied")),g.length>0}catch(t){Player.logError("There was an issue parsing the files. Please check the console for details.",t),console.log("[4chan sounds player]",e)}},getSounds(e,t,a,n,s,d){if(!e)return{sounds:[],filtered:[]};const c=t.endsWith("webm")?n:t,p=[];let y;for(;null!==(y=o.exec(e));)p.push(y);p.length||"always"!==Player.config.addWebm&&("soundBoards"!==Player.config.addWebm||"gif"!==Board&&"wsg"!==Board)||!e.endsWith(".webm")||p.push([null,e.slice(0,-5),t]);const u=p[0]&&p[0][1]||a||"Local Sound "+i;return p.length&&!a&&i++,p.reduce((({sounds:o,filtered:y},h,g)=>{let m=h[2],v=h[3];const f=(a||"local"+i)+":"+g,P=h[1].trim(),$=P||u+(p.length>1?` (${g+1})`:""),w=v===t;try{r[m].decode?(v.includes("%")&&(v=decodeURIComponent(v)),v.startsWith("blob:")||null!==v.match(l)||(v=location.protocol+"//"+v)):v=location.protocol+r[m].filepath+v}catch(e){return{sounds:o,filtered:y}}const b={src:v,id:f,title:$,name:P,post:a,image:t,imageOrThumb:c,filename:e,thumb:n,imageMD5:s,standaloneVideo:w};return b.disallow=!d&&Player.disallowedSound(b),b.disallow?b.disallow.invalid||y.push(b):o.push(b),{sounds:o,filtered:y}}),{sounds:[],filtered:[]})},refresh(){Player.posts.addPosts(document.body)},updateButtons(e){const t=document.getElementById(s.postIdPrefix+e);if(t){const a=s.playLink,r=a.relative&&t.querySelector(a.relative);let l=r.parentNode.querySelector(`.${ns}-unfilter-link`);const o=Player.posts.getFilters(e);if(o.host.length||o.image||o.sound.length){t.classList.add("filtered-sound");const s=[o.image&&"image",o.sound.length&&"sound"].filter(Boolean).join(" and "),i=(o.host.length>1?`The hosts ${o.host.join(", ")} are not allowed`:"")+(1===o.host.length?`The host ${o.host[0]} is not allowed`:"")+(s?`${o.host.length?", and the":"The"} player filters disallow this ${s}`:"")+". Click to allow and add to the player.";l?l.dataset.content=i:n.element(""+(a.prependText||"")+`${a.unfilterText||""}`+(a.appendText||"")+"",r,a.position)}else t.classList.remove("filtered-sound"),l&&l.parentNode.parentNode.removeChild(l.parentNode),l&&l.infoEl&&l.infoEl.parentNode.removeChild(l.infoEl);let i=t.querySelector(`.${ns}-play-link`);const d=Player.sounds.find((t=>t.post===e));i&&!d?i.parentNode.parentNode.removeChild(i.parentNode):!i&&d&&n.element(""+(a.prependText||"")+`${a.text||""}`+(a.appendText||"")+"",r,a.position)}},getFilters:e=>Player.filteredSounds.reduce(((t,a)=>(a.post===e&&(t.host=t.host.concat(a.disallow.host||[]),t.image=t.image||a.disallow.image,t.sound=t.sound.concat(a.disallow.sound||[])),t)),{host:[],image:!1,sound:[]}),allowPost(e){const t=Player.posts.getFilters(e);t.host.length&&Player.set("allow",Player.config.allow.concat(t.host)),(t.image||t.sound.length)&&Player.set("filters",Player.config.filters.filter((e=>e!==t.image&&!t.sound.find((t=>e.replace(/^(https?:)?\/\//,"")===t)))))}}},3378:(e,t,a)=>{var n=a(6325);const s=a(9480),r=200,l=200;e.exports={initialize(){Player.on("menu-close",(e=>e._input&&delete e._input._colorpicker))},create(e){const t=e.currentTarget.parentNode,a="INPUT"===e.currentTarget.nodeName?e.currentTarget:t.querySelector("input"),o=t.querySelector(`.${ns}-cp-preview`);if(!a||a._colorpicker)return;Player.display.closeDialogs();const i=Player.colorpicker.parseRGB(window.getComputedStyle(o).backgroundColor),d=n.element(s({HEIGHT:r,WIDTH:l,rgb:i}),t);Player.position.showRelativeTo(d,a),a._colorpicker=d,d._input=a,d._colorpicker={hsv:[0,1,1,1],rgb:i},Player.colorpicker.updateOutput(d)},hueMove(e){const t=e.currentTarget.closest(`.${ns}-colorpicker`),a=Math.max(0,e.clientY-e.currentTarget.getBoundingClientRect().top);t._colorpicker.hsv[0]=a/r;const n=Player.colorpicker.hsv2rgb(t._colorpicker.hsv[0],1,1,1);t.querySelector(`.${ns}-cp-saturation`).style.background=`linear-gradient(to right, white, rgb(${n[0]}, ${n[1]}, ${n[2]}))`,e.currentTarget.querySelector(".position").style.top=Math.max(-3,a-6)+"px",Player.colorpicker.updateOutput(t,!0)},satMove(e){const t=e.currentTarget.closest(`.${ns}-colorpicker`),a=e.currentTarget.querySelector(".position"),n=Math.max(0,e.clientX-e.currentTarget.getBoundingClientRect().left),s=Math.max(0,e.clientY-e.currentTarget.getBoundingClientRect().top);t._colorpicker.hsv[1]=n/l,t._colorpicker.hsv[2]=1-s/r,a.style.top=Math.min(197,Math.max(-3,s-6))+"px",a.style.left=Math.min(197,Math.max(-3,n-5))+"px",Player.colorpicker.updateOutput(t,!0)},inputRGBA(e){const t=e.currentTarget.closest(`.${ns}-colorpicker`);t._colorpicker.rgb[+e.currentTarget.getAttribute("data-color")]=e.currentTarget.value,Player.colorpicker.updateOutput(t)},updateOutput(e,t){const a=t?["hsv","rgb"]:["rgb","hsv"];e._colorpicker[a[1]]=Player.colorpicker[`${a[0]}2${a[1]}`](...e._colorpicker[a[0]]);const[n,s,o,i]=e._colorpicker.rgb;if(t)e.querySelector(`.${ns}-rgb-input[data-color="0"]`).value=n,e.querySelector(`.${ns}-rgb-input[data-color="1"]`).value=s,e.querySelector(`.${ns}-rgb-input[data-color="2"]`).value=o,e.querySelector(`.${ns}-rgb-input[data-color="3"]`).value=i;else{const[t,a,n]=e._colorpicker.hsv,s=e.querySelector(`.${ns}-cp-hue .position`),o=e.querySelector(`.${ns}-cp-saturation .position`),i=Player.colorpicker.hsv2rgb(t,1,1,1);e.querySelector(`.${ns}-cp-saturation`).style.background=`linear-gradient(to right, white, rgb(${i[0]}, ${i[1]}, ${i[2]}))`,s.style.top=r*t-3+"px",o.style.left=a*l-3+"px",o.style.top=(1-n)*l-3+"px"}e.querySelector(".output-color").style.background=`rgb(${n}, ${s}, ${o}, ${i})`},apply(e){const t=e.currentTarget.closest(`.${ns}-colorpicker`),[a,n,s,r]=t._colorpicker.rgb,l=t._input;l.value=`rgb(${a}, ${n}, ${s}, ${r})`,delete l._colorpicker,t.parentNode.removeChild(t),l.focus(),l.blur()},parseRGB(e){const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);return[+t[1]||0,+t[2]||0,+t[3]||0,isNaN(+t[4])?1:t[4]]},hsv2rgb(e,t,a,n){const s=Math.floor(6*e),r=6*e-s,l=a*(1-t),o=a*(1-r*t),i=a*(1-(1-r)*t),d=s%6,c=[a,o,l,l,i,a][d],p=[i,a,a,o,l,l][d],y=[l,l,i,a,a,o][d];return[Math.round(255*c),Math.round(255*p),Math.round(255*y),n||1]},rgb2hsv(e,t,a,n){const s=Math.max(e,t,a),r=Math.min(e,t,a),l=s-r,o=0===s?0:l/s,i=s/255;let d;switch(s){case r:d=0;break;case e:d=t-a+l*(t{function n(e){try{return new URL(e.replace(/%s/,"sound").replace(/^(https?\/\/)?/,"https://")),!0}catch(e){return!1}}e.exports={template:a(8210),fields:{name:"Name",url:"URL",responsePath:"Response Path",responseMatch:"Response Match",soundUrl:"File URL Format"},parse(e,t,a){t={...t};const s=a.currentTarget.closest(`.${ns}-host-input`);let r=s.getAttribute("data-host-name"),l=t[r]={...t[r]};const o=a.currentTarget.getAttribute("name");try{if("name"===o&&e!==r){if(!e||t[e])throw new PlayerError("A unique name for the host is required.","warning");s.setAttribute("data-host-name",e),t[e]=l,delete t[r],r=e}if(("url"===o||"soundUrl"===o&&e)&&!n(e))throw new PlayerError("The value must be a valid URL.","warning");if("data"===o)try{e=JSON.parse(e)}catch(e){throw new PlayerError("The data must be valid JSON.","warning")}if("headers"===o)try{e=e?JSON.parse(e):void 0}catch(e){throw new PlayerError("The headers must be valid JSON.","warning")}}catch(e){throw l.invalid=!0,s.classList.add("invalid"),e}void 0===e?delete l[o]:l[o]=e;try{const e=s.querySelector("[name=soundUrl]").value,t=s.querySelector("[name=headers]").value;!(r&&JSON.parse(s.querySelector("[name=data]").value)&&n(s.querySelector("[name=url]").value))||e&&!n(e)||t&&!JSON.parse(t)||(delete l.invalid,s.classList.remove("invalid"))}catch(e){}return t},add(){let e,t="New Host";for(e="";Player.config.uploadHosts[`${t}${e}`];e=" "+ ++e);const a={[`${t}${e}`]:{invalid:!0,data:{file:"$file"}},...Player.config.uploadHosts};Player.settings.set("uploadHosts",a,{bypassValidation:!0,silent:!0})},remove(e){const t=Player.config.uploadHosts,a=e.currentTarget.closest(`.${ns}-host-input`),n=a.getAttribute("data-host-name");Player.settings.findDefault("uploadHosts").default[n]?t[n]=null:delete t[n],a.parentNode.removeChild(a),Player.settings.set("uploadHosts",t,{bypassValidation:!0,bypassRender:!0})},setDefault(e,t,a){const n=a.currentTarget.closest(`.${ns}-host-input`).getAttribute("data-host-name");return n===Player.config.defaultUploadHost||Object.keys(Player.config.uploadHosts).forEach((e=>{const t=Player.$(`.${ns}-host-input[data-host-name="${e}"] input[data-property="defaultUploadHost"]`);t&&(t.checked=e===n)})),n},restoreDefaults(){Object.assign(Player.config.uploadHosts,Player.settings.findDefault("uploadHosts").default),Player.set("uploadHosts",Player.config.uploadHosts,{bypassValidation:!0})}}},6279:(e,t,a)=>{var n=a(6325);const s=a(5303),r=a(851),l=a(780);e.exports={asdf:"asdf",atRoot:["set"],public:["set","export","import","reset","load"],hosts:l,template:a(1262),settingTemplate:a(1555),inputTemplates:{checkbox:a(1470),input:a(1691),select:a(9045),textarea:a(8475)},changelog:"https://github.com/rcc11/4chan-sounds-player/releases",groups:s.reduce(((e,t)=>(t.displayGroup&&(e[t.displayGroup]||(e[t.displayGroup]=[]),e[t.displayGroup].push(t)),e)),{}),async initialize(){Player.settings.view="Display",Player.theme.applyBoardTheme({bypassRender:!0}),await Player.settings.load(await GM.getValue("settings")||{},{applyDefault:!0,bypassAll:!0}),Player.config.showUpdatedNotification&&Player.config.VERSION&&"3.5.4"!==Player.config.VERSION&&Player.alert(`4chan Sounds Player has been updated to version 3.5.4.`),Player.on("hide",(function(){Player.config.pauseOnHide&&Player.pause()})),Player.syncTab("settings",(e=>Player.settings.load(e,{bypassSave:!0,applyDefault:!0,ignore:["viewStyle"]}))),Player.on("rendered",Player.settings.setChangeListeners)},render(){const e=Player.$(`.${ns}-settings`);n.elementHTML(e,Player.settings.template()),Player.settings.setChangeListeners()},renderSetting(e){const t=Player.$(`.${ns}-setting[data-property="${e.property}"]`),a=n.element(Player.settings.settingTemplate(e),t,"beforebegin");t.parentNode.removeChild(t),Player.settings.setChangeListeners(a)},set(e,t,{bypassAll:a,bypassValidation:s,bypassSave:r,bypassRender:l,silent:o,bypassStylesheet:i,settingConfig:d}={}){d=d||Player.settings.findDefault(e);const c=n.get(Player.config,e);if(s||!n.isEqual(c,t))return n.set(Player.config,e,t),a||(!i&&d&&d.updateCSSVars&&Player.display.updateCSSVars(),!o&&Player.trigger("config",e,t,c),!o&&Player.trigger("config:"+e,t,c),!r&&Player.settings.save(),!l&&d.displayGroup&&Player.settings.renderSetting(d),(!l||"self"===l)&&d.dependentRender&&d.dependentRender.forEach((e=>Player.settings.renderSetting(Player.settings.findDefault(e))))),[c,t]},reset(e,t){let a=Player.settings.findDefault(e);Player.set(e,a.default,{...t,settingConfig:a})},async load(e,t={}){"string"==typeof e&&(e=JSON.parse(e));const a={};s.forEach((function s(r){if(r.settings)return r.settings.forEach((e=>s({property:r.property,default:r.default,...e})));if(t.ignore&&t.ignore.includes(r.property))return;let l=n.get(e,r.property,t.applyDefault?r.default:void 0);if(void 0!==l){r.mix&&(l={...r.default,...l||{}});const e=Player.set(r.property,l,{bypassAll:!0,settingConfig:r});e&&(a[r.property]=e)}})),Object.entries(await Player.settings.migrate(e.VERSION)).forEach((([e,[t,n]])=>{a[e]=[a[e]?a[e][1]:t,n]})),t.bypassAll||(!t.bypassStylesheet&&Player.display.updateCSSVars(),!t.silent&&Object.entries(a).forEach((([e,[t,a]])=>{Player.trigger("config",e,a,t),Player.trigger("config:"+e,a,t)})),!t.bypassSave&&Player.settings.save(),!t.bypassRender&&Player.settings.render())},save(){try{const e=s.reduce((function e(t,a){if(a.settings)a.settings.forEach((n=>e(t,{property:a.property,default:a.default,...n})));else{let e=n.get(Player.config,a.property);void 0===e||n.isEqual(e,a.default)||(a.mix&&(e=Object.keys(e).reduce(((t,s)=>(n.isEqual(a.default[s],e[s])||(t[s]=e[s]),t)),{})),n.set(t,a.property,e))}return t}),{});return e.viewStyle=Player.playlist._lastView,e.VERSION="3.5.4",GM.setValue("settings",JSON.stringify(e))}catch(e){Player.logError("There was an error saving the sound player settings.",e)}},async migrate(e){if(!e||"3.5.4"===e)return{};const t={};for(let a=0;a{t[e]=[a,t[e]?t[e][1]:n]}))}catch(e){console.error(e)}}return t},compareVersions(e,t){const[a,n]=e.split("-"),[s,r]=t.split("-"),l=a.split("."),o=s.split(".");for(let e=0;e<3;e++){if(+l[e]>+o[e])return 1;if(+l[e]<+o[e])return-1}return n!==r},findDefault(e){let t;return s.find((function(a){if(a.property===e)return t=a;if(a.settings){let n=a.settings.find((t=>t.property===e));return n&&(t={...a,actions:null,settings:null,description:null,...n,isSubSetting:!0})}return!1})),t||{property:e}},toggle(e){let t=Player.$(`.${ns}-settings :focus`);if(t&&t.blur(),!e&&"settings"===Player.config.viewStyle)return Player.playlist.restore();"settings"!==Player.config.viewStyle&&Player.display.setViewStyle("settings"),e&&e!==Player.settings.view&&Player.settings.showGroup(e)},showGroup(e){Player.settings.view=e;const t=Player.$(`.${ns}-settings-group.active`),a=Player.$(`.${ns}-settings-tab.active`);t&&t.classList.remove("active"),a&&a.classList.remove("active"),Player.$(`.${ns}-settings-group[data-group="${e}"]`).classList.add("active"),Player.$(`.${ns}-settings-tab[data-group="${e}"]`).classList.add("active")},async import(){const e=n.element(''),t=async()=>{let a;try{a=await(await fetch(URL.createObjectURL(e.files[0]))).json()}catch(t){Player.logError(`Expected a JSON config file and got ${e.files[0].type}.`,t,"warning")}e.removeEventListener("change",t),Player.settings.load(a)};e.addEventListener("change",t),e.click()},async export(e){const t=e&&e.shiftKey?JSON.stringify(Player.config,null,4):await GM.getValue("settings")||"{}",a=new Blob([t],{type:"application/json"}),s=n.element(``);s.click(),URL.revokeObjectURL(s.href)},setChangeListeners(e){const t=e||Player.$(`.${ns}-settings`);t.querySelectorAll(`.${ns}-settings input, .${ns}-settings textarea`).forEach((e=>{e.addEventListener("focusout",Player.settings.handleChange)})),t.querySelectorAll(`.${ns}-settings input[type=checkbox], .${ns}-settings select`).forEach((e=>{e.addEventListener("change",Player.settings.handleChange)}))},handleChange(e){try{const t=e.currentTarget,a=t.getAttribute("data-property");if(!a)return;let s=Player.settings.findDefault(a);const r=n.get(Player.config,a);let l=t["checkbox"===t.getAttribute("type")?"checked":"value"];s.parse&&(l=Player.getHandler(s.parse)(l,r,e)),n.isEqual(r,l,!s.looseCompare)||Player.set(a,l,{bypassValidation:!0,bypassRender:"self",settingConfig:s})}catch(e){Player.logError("There was an error updating the setting.",e)}},handleKeyChange(e){e.preventDefault(),"Shift"!==e.key&&"Control"!==e.key&&"Meta"!==e.key&&(e.currentTarget.value=8===e.which||"backspace"===e.key.toLowerCase()?"":Player.hotkeys.stringifyKey(e))}}},2475:(e,t,a)=>{var n=a(6325);const s=a(218),r=a(5303),l=a(5080);e.exports={public:["switch","next","previous"],savedThemesTemplate:a(6305),themeKeybindsTemplate:a(3038),async initialize(){Player.theme.render(),Player.userTemplate.maintain(Player.theme,"customCSS"),Player.theme.validateOrder()},render(){Player.userStylesheet=Player.userStylesheet||n.element('',document.head),Player.userStylesheet.innerHTML=Player.userTemplate.build({template:"/* Sounds Player User CSS */\n\n"+Player.config.customCSS,sound:Player.playing,ignoreButtons:!0,ignoreDisplayBlocks:!0,ignoreSoundName:!0,ignoreVersion:!0})},forceBoardTheme(){Player.theme.applyBoardTheme({force:!0}),Player.settings.save()},applyBoardTheme(e={}){const t=n.element(`
    `,document.body),a=document.defaultView.getComputedStyle(t);if("rgba(0, 0, 0, 0)"===a.backgroundColor)return setTimeout(Player.display.applyBoardTheme,0);Object.assign(a,{page_background:window.getComputedStyle(document.body).backgroundColor});const l={"colors.text":a.color,"colors.background":a.backgroundColor,"colors.odd_row":a.backgroundColor,"colors.border":a.borderBottomColor,"colors.even_row":a.borderBottomColor===a.color?a.backgroundColor:a.borderBottomColor,"colors.page_background":window.getComputedStyle(document.body).backgroundColor,"colors.playing":(()=>{const e=Player.colorpicker.rgb2hsv(...Player.colorpicker.parseRGB(a.backgroundColor)),t=Player.colorpicker.hsv2rgb(e[0],Math.min(1,e[1]+.25),Math.min(1,e[2]+.15));return`rgb(${t[0]}, ${t[1]}, ${t[2]})`})()};r.find((e=>"colors"===e.property)).settings.forEach((t=>{const a=e.force||t.default===n.get(Player.config,t.property);l[t.property]&&(t.default=l[t.property]),a&&Player.set(t.property,t.default,{bypassSave:!0,bypassRender:!0,bypassStylesheet:!0})})),document.body.removeChild(t),e.bypassRender||(Player.display.updateCSSVars(),Player.settings.render())},next(){const e=["Default"].concat(Player.config.savedThemesOrder),t=e.indexOf(Player.config.selectedTheme),a=e[(t+e.length+1)%e.length];Player.theme.switch(a)},previous(){const e=["Default"].concat(Player.config.savedThemesOrder),t=e.indexOf(Player.config.selectedTheme),a=e[(t+e.length-1)%e.length];Player.theme.switch(a)},switch(e){if("Default"!==e&&!Player.config.savedThemes[e])return Player.logError(`Theme '${e}' does not exist.`,null,"warning");Player.set("selectedTheme",e),"Default"===e?(["headerTemplate","footerTemplate","rowTemplate","chanXTemplate","customCSS"].forEach((e=>{Player.settings.reset(e,{bypassRender:!0,bypassStylesheet:!0})})),Player.settings.render(),Player.display.updateCSSVars()):Player.settings.load(Player.config.savedThemes[e])},validateOrder(){const e=Player.config.savedThemesOrder;let t;Player.config.savedThemesOrder=e.concat(Object.keys(Player.config.savedThemes)).filter(((a,n)=>Player.config.savedThemes[a]&&(t=e.indexOf(a),-1===t||t===n)))},parseSwitch(e,t,a){t=[...t];const n=a.currentTarget.parentNode.dataset.name;"Default"===n||Player.config.savedThemes[n]||Player.logError(`No theme named '${n}'.`,null,"warning");const s=Player.hotkeys.parseKey(e);if(s.key){let e=t.find((e=>e.themeName===n));e||t.push(e={themeName:n}),Object.assign(e,s)}else t=t.filter((e=>e.themeName!==n));return t},handleSwitch(e){Player.theme.switch(e._binding.themeName)},moveUp:e=>Player.theme._swapOrder(e,-1),moveDown:e=>Player.theme._swapOrder(e,1),_swapOrder(e,t){const a=e.currentTarget.closest("[data-theme]").dataset.theme,n=Player.config.savedThemesOrder,s=n.indexOf(a);s+t>=0&&s+te!==n)),a.parentNode.removeChild(a),Player.settings.set("savedThemes",t,{bypassValidation:!0,bypassRender:!0});const s=Player.config.hotkey_bindings.switchTheme.find((e=>e.themeName===n));s&&Player.set("hotkey_bindings.switchTheme",Player.config.hotkey_bindings.switchTheme.splice(s,1),{bypassValidation:!0})},restoreDefaults(){Object.assign(Player.config.savedThemes,Player.settings.findDefault("savedThemes").default),Player.theme.validateOrder(),Player.set("savedThemes",Player.config.savedThemes,{bypassValidation:!0})},showSaveOptions(e){const t=Player.$(`.${ns}-theme-save-options`);if(t)return Player.container.removeChild(t);const a=n.element(l({settingsConfig:r}),Player.container);Player.position.showRelativeTo(a,e.currentTarget),Player.$(`.${ns}-save-theme-name`).focus()},toggleSaveFields(){Player.$(`.${ns}-theme-save-options`).classList.toggle("fields-collapsed"),Player.position.showRelativeTo(Player.$(`.${ns}-theme-save-options`),Player.$('[\\@click^="theme.showSaveOptions"]'))},toggleSaveButtonText(e){Player.$(`.${ns}-save-theme`).innerHTML=Player.config.savedThemes[e.currentTarget.value]?"Update":"Create"},save(){const e=Player.$(`.${ns}-save-theme-name`).value;if(!e)return Player.logError("A name is required to save a theme.",null,"warning");const t=[...Player.$all(`.${ns}-theme-save-options input:checked`)].reduce(((e,t)=>n.set(e,t.value,n.get(Player.config,t.value))),{});Player.config.savedThemes[e]=t,-1===Player.config.savedThemesOrder.indexOf(e)&&Player.config.savedThemesOrder.push(e),Player.set("savedThemes",Player.config.savedThemes,{bypassValidation:!0}),Player.container.removeChild(Player.$(`.${ns}-theme-save-options`))}}},1469:e=>{e.exports={"Fixed Playlist":{chanXControls:"always",headerTemplate:'
    \nrepeat-button shuffle-button hover-images-button playlist-button\nsound-title-marquee\nview-menu-button add-button theme-menu-button close-button',rowTemplate:'sound-title\np:{}\n',customCSS:'/* Fix the player to the right at full height (minus the 4chan X header) */\n#fcsp-container[data-view-style="playlist"] {\n\t/* Fixed width *\\/\n\twidth: 25rem !important;/**/\n\theight: auto !important;\n\ttop: $config[offsetTop] !important;\n\tright: 0px !important;\n\tbottom: $config[offsetBottom] !important;\n\tleft: auto !important;\n\theight: auto !important;\n\tmax-height: calc(100% - 24px);\n\tbackground: none !important;\n\tborder: none !important;\n}\n\n/* Hide things when the playlist is open */\n/* Hide the image with the playlist open, unless it\'s a webm.\n * To show gifs as well change playing-video to playing-animated. */\n#fcsp-container[data-view-style="playlist"]:not(.playing-video) .fcsp-image-link,/**/ \n#fcsp-container[data-view-style="playlist"] .fcsp-controls,\n#fcsp-container[data-view-style="playlist"] .fcsp-hover-image,\n#fcsp-container[data-view-style="playlist"] .fcsp-footer,\n#fcsp-container[data-view-style="fullscreen"] .fcsp-row-thumb,\n#fcsp-container[data-view-style="fullscreen"] .fcsp-row-image {\n\tdisplay: none !important;\n}\n/* Header is shown with adjustments to handle the changed container style */\n/* Opacity and absolute position are used to auto hide the header */\n#fcsp-container[data-view-style="playlist"] .fcsp-header {\n\tposition: absolute !important;\n\topacity: 0;\n\tz-index: 9;\n\tcursor: inherit;\n\tbackground: $config[colors.background];\n\tborder-width: 0 1px 1px 0;\n\ttransition: all .3s ease;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-header:hover {\n\topacity: 1;\n}\n\n/* Don\'t show a scrollbar for the playlist for aesthetic reasons */\n#fcsp-container[data-view-style="playlist"] .fcsp-under-image {\n\tscrollbar-width: none;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-under-image::-webkit-scrollbar {\n\tdisplay: none;\n}\n\n/* Chunky playlist items, with no background and a squared thumbnail image. */\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item {\n\tbackground: none !important;\n\theight: auto !important;\n\tline-height: initial;\n\ttext-align: right;\n\talign-items: center;\n\ttransition: all .5s ease;\n\tfont-size: 1rem;\n\tcolor: $config[colors.text];\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-row-thumb, #fcsp-container[data-view-style="playlist"] .fcsp-row-image {\n\theight: 3rem;\n\twidth: 3rem;\n\tobject-fit: cover;\n\ttransition: all .5s ease;\n}\n/* Show a gradient background and increase the size of list items when you hover over them. */\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item:hover {\n\tfont-size: 1.5rem;\n\tfont-weight: bold;\n\tbackground-image: radial-gradient(circle at -50%, #0000 70%, $config[colors.odd_row]) !important;\n\tcolor: $config[colors.background];\n\t-webkit-text-stroke: 1px black;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item:hover .fcsp-row-thumb {\n\theight: 4rem;\n\twidth: 4rem;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-row-image {\n\theight: 7rem;\n\twidth: 7rem;\n}\n/* Add a gradient background to the playing item, make the text bigger, and style the text. */\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item.playing {\n\tbackground-image: radial-gradient(circle at -50%, #0000 70%, $config[colors.playing]) !important;\n\tpadding-left: 2px;\n\tfont-weight: bold;\n\tfont-size: 1.5rem;\n\tcolor: $config[colors.page_background];\n\t-webkit-text-stroke: 1px black;\n\ttext-shadow: 0 0 2px $config[colors.border];\n}\n/* Swap the thumb image with the full image for the playing item. */\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item:not(.playing) .fcsp-row-image {\n\tdisplay: none;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item.playing .fcsp-row-thumb {\n\tdisplay: none;\n}\n/* Same gradient background style for dragging items. */\n#fcsp-container[data-view-style="playlist"] .fcsp-dragging {\n\tbackground-image: radial-gradient(circle at -50%, #0000 70%, $config[colors.dragging]) !important\n}\n\n/* Add a resizer to the left of the header when the playlist is open. */\n.playlist-resizer {\n\topacity: 1 !important;\n\tmargin: 0 !important;\n\twidth: .25rem !important;\n\theight: auto !important;\n\tbackground-color: $config[colors.border] !important;\n\tposition: absolute;\n\tleft: -.25rem !important;\n\ttop: 0 !important;\n\tbottom: 0 !important;\n\tborder-radius: 100% 0 0 100%;\n\tcursor: ew-resize !important;\n\tdisplay: none;\n\ttransition: all .5s ease;\n}\n.playlist-resizer:hover {\n\twidth: .4rem !important;\n\tleft: -.4rem !important;\n}\n#fcsp-container[data-view-style="playlist"] .playlist-resizer {\n\tdisplay: block;\n}\n/* Hide the default resizers */\n#fcsp-container[data-view-style="playlist"] .fcsp-expander:not(.playlist-resizer) {\n\tdisplay: none;\n}\n'}}},591:(e,t,a)=>{var n=a(6325);const{get:s}=a(6672);e.exports={template:a(7870),boardsTemplate:a(6844),listsTemplate:a(1675),boardList:null,soundThreads:null,displayThreads:{},selectedBoards:Board?[Board]:["a"],showAllBoards:!1,async initialize(){Player.threads.hasParser=is4chan&&"undefined"!=typeof Parser,Player.threads.hasParser&&!Parser.customSpoiler&&(Parser.customSpoiler={}),Player.on("show",Player.threads._initialFetch),Player.on("view",Player.threads._initialFetch),Player.on("rendered",Player.threads.afterRender),Player.on("config:threadsViewStyle",Player.threads.render);try{const e=await GM.getValue("threads_board_selection");e&&(Player.threads.selectedBoards=e.split(","))}catch(e){}},_initialFetch(){Player.container&&"threads"===Player.config.viewStyle&&null===Player.threads.boardList&&(Player.threads.fetchBoards(!0),Player.off("show",Player.threads._initialFetch),Player.off("view",Player.threads._initialFetch))},render(){Player.container&&(n.elementHTML(Player.$(`.${ns}-threads`),Player.threads.template()),Player.threads.afterRender())},afterRender(){const e=Player.$(`.${ns}-thread-list`);if(e){const t=document.defaultView.getComputedStyle(document.body);e.style.background=t.backgroundColor,e.style.backgroundImage=t.backgroundImage,e.style.backgroundRepeat=t.backgroundRepeat,e.style.backgroundPosition=t.backgroundPosition}Player.threads.renderThreads()},renderThreads(){if(Player.threads.hasParser&&"table"!==Player.config.threadsViewStyle)try{const e=Player.$(`.${ns}-thread-list`);e.innerHTML="";for(let t in Player.threads.displayThreads){const a=Player.threads.boardList.find((e=>e.board===t)),s=`/${a.board}/ - ${a.title}`;n.element(`
    ${s}
    `,e);const r=Player.threads.displayThreads[t];for(let t=0;t',e)}}catch(e){Player.logError("Unable to display the threads board view.",e,"warning"),Player.set("threadsViewStyle","table"),Player.renderThreads()}else n.elementHTML(Player.$(`.${ns}-threads-body`),Player.threads.listsTemplate())},renderBoards(){n.elementHTML(Player.$(`.${ns}-thread-board-list`),Player.threads.boardsTemplate())},toggle(){"threads"===Player.config.viewStyle?Player.playlist.restore():Player.display.setViewStyle("threads")},toggleBoardList(){Player.threads.showAllBoards=!Player.threads.showAllBoards,Player.$(`.${ns}-all-boards-link`).innerHTML=Player.threads.showAllBoards?"Selected Only":"Show All",Player.threads.renderBoards()},async toggleBoard(e,t){t?!Player.threads.selectedBoards.includes(e)&&Player.threads.selectedBoards.unshift(e):Player.threads.selectedBoards=Player.threads.selectedBoards.filter((t=>t!==e)),await GM.setValue("threads_board_selection",Player.threads.selectedBoards.slice(0,10).join(","))},async fetchBoards(e){Player.threads.loading=!0,Player.threads.render(),Player.threads.boardList=(await s("https://a.4cdn.org/boards.json")).boards,e?Player.threads.fetch():(Player.threads.loading=!1,Player.threads.render())},async fetch(){if(Player.threads.loading=!0,Player.threads.render(),!Player.threads.boardList)try{await Player.threads.fetchBoards()}catch(e){return Player.logError("Failed fetching the boards list.",e)}const e=[];try{await Promise.all(Player.threads.selectedBoards.map((async t=>{const a=Player.threads.boardList.find((e=>e.board===t));if(!a)return;(a&&await s("https://a.4cdn.org/%s/catalog.json".replace("%s",t))||[]).forEach((({page:n,threads:s})=>{e.push(...s.map((e=>Object.assign(e,{board:t,page:n,ws_board:a.ws_board}))))}))}))),Player.threads.soundThreads=e.filter((e=>{const{sounds:t}=Player.posts.getSounds(e.filename,`https://i.4cdn.org/${e.board}/${e.tim}${e.ext}`,e.no,`https://i.4cdn.org/${e.board}/${e.tim}s${e.ext}`,e.md5,!0);return t.length}))}catch(e){Player.logError("Failed searching for sounds threads.",e)}Player.threads.loading=!1,Player.threads.filter(Player.$(`.${ns}-threads-filter`).value,!0),Player.threads.render()},filter(e,t){e=e.toLowerCase(),Player.threads.filterValue=e||"",null!==Player.threads.soundThreads&&(Player.threads.displayThreads=Player.threads.soundThreads.reduce(((t,a)=>((!e||a.sub&&a.sub.toLowerCase().includes(e)||a.com&&a.com.toLowerCase().includes(e))&&(t[a.board]||(t[a.board]=[]),t[a.board].push(a)),t)),{}),!t&&Player.threads.renderThreads())}}},8433:(e,t,a)=>{var n=a(6325),s=a(4302);const r=a(4859),l=a(9103),o=e.exports={_uploadIdx:0,createTemplate:a(5257),createHostsTemplate:l,createCompleteTemplate:r,initialize(){Player.on("config:uploadHosts",(()=>Player.$(`.${ns}-create-hosts-container`).innerHTML=l())),Player.on("config:defaultUploadHost",(e=>Player.$(`.${ns}-create-sound-host`).value=e)),Player.on("rendered",o.afterRender)},afterRender(){o.status=Player.$(`.${ns}-create-sound-status`),Player.tools.imgInput=Player.$(`.${ns}-create-sound-img`),Player.tools.sndInput=Player.$(`.${ns}-create-sound-snd`)},async handleImageSelect(e){const t=(e&&e.currentTarget||Player.tools.imgInput).files[0];let a=t.name.replace(/\.[^/.]+$/,"");await Player.tools.hasAudio(t)&&Player.logError("Audio not allowed for the image webm.",null,"warning"),Player.$(`.${ns}-create-sound-name`).setAttribute("placeholder",a)},handleFileSelect(e,t){const a=e.closest(`.${ns}-file-input`),r=a.querySelector(".text"),l=a.querySelector(`.${ns}-file-list`);t||(t=[...e.files]),a.classList[t.length?"remove":"add"]("placeholder"),r.innerHTML=t.length>1?t.length+" files":t[0]&&t[0].name||"",l&&n.elementHTML(l,t.length<2?"":t.map(((e,t)=>`
    \n\t\t\t\t
    ${e.name}
    \n\t\t\t\t${s.close}\n\t\t\t
    `)).join(""))},handleFileRemove(e){const t=+e.currentTarget.getAttribute("data-idx"),a=e.currentTarget.closest(`.${ns}-file-input`).querySelector('input[type="file"]'),n=new DataTransfer;for(let e=0;e{const a=e.type.startsWith("video"),n=e.type.startsWith("image")||"video/webm"===e.type,s=e.type.startsWith("audio");if(a||n||s){const a="video/webm"===e.type&&t?t:n?Player.tools.imgInput:Player.tools.sndInput,s=new DataTransfer;a.multiple&&[...a.files].forEach((e=>s.items.add(e))),s.items.add(e),a.files=s.files,Player.tools.handleFileSelect(a),a===Player.tools.imgInput&&Player.tools.handleImageSelect(),a===Player.tools.sndInput&&Player.tools.useSoundURL&&Player.tools.toggleSoundInput("file")}})),!1},async handleCreate(){Player.tools._createdImageURL&&URL.revokeObjectURL(Player.tools._createdImageURL),Player.tools._createdImage=null,o.status.style.display="block",o.status.innerHTML="Creating sound image",Player.$(`.${ns}-create-button`).disabled=!0;const e=Player.config.uploadHosts[Player.$(`.${ns}-create-sound-host`).value],t=Player.tools.useSoundURL;let a=Player.tools.imgInput.files[0],s=t&&Player.$(`.${ns}-create-sound-snd-url`).value.split(",").map((e=>e.trim())).filter((e=>e)),l=(Player.$(`.${ns}-use-video`)||{}).checked&&a&&a.type.startsWith("video")?a&&[a]:[...Player.tools.sndInput.files];const i=Player.$(`.${ns}-create-sound-name`).value,d=i?((s||l).length>1?i.split(","):[i]).map((e=>e.trim())):a&&[a.name.replace(/\.[^/.]+$/,"")];try{if(!a)throw new PlayerError("Select an image or webm.","warning");if(a.type.startsWith("video")&&await Player.tools.hasAudio(a))throw o.status.innerHTML+="
    Audio not allowed for the image webm.
    Remove the audio from the webm and try again.",new PlayerError("Audio not allowed for the image webm.","warning");const i=d.join("").length+8*(s||l).length;if(t){try{s=s.map((e=>new URL(e)&&e.replace(/^(https?:)?\/\//,"")))}catch(e){throw new PlayerError("The provided sound URL is invalid.","warning")}if(2188)throw new PlayerError("The generated image filename is too long.","warning");l=await Promise.all(l.map((async e=>{if(e.type.startsWith("video")&&!await Player.tools.hasAudio(e))throw new PlayerError(`The selected video has no audio. (${e.name})`,"warning");return e})));try{s=await Promise.all(l.map((async t=>Player.tools.postFile(t,e))))}catch(e){throw new PlayerError("Upload failed.","error",e)}}if(!s.length)throw new PlayerError("No sounds selected.","warning");let c="";for(let e=0;eFailed! "+(e instanceof PlayerError?e.reason:""),Player.logError("Failed to create sound image",e)}Player.$(`.${ns}-create-button`).disabled=!1},hasAudio:e=>!(!e.type.startsWith("audio")&&!e.type.startsWith("video"))&&new Promise(((t,a)=>{const n=URL.createObjectURL(e),s=document.createElement("video");s.addEventListener("loadeddata",(()=>{URL.revokeObjectURL(n),t(s.mozHasAudio||!!s.webkitAudioDecodedByteCount)})),s.addEventListener("error",a),s.src=n})),async postFile(e,t){const a=Player.tools._uploadIdx++;if(!t||t.invalid)throw new PlayerError("Invalid upload host.","error");const s=new FormData;return Object.keys(t.data).forEach((a=>{null!==t.data[a]&&s.append(a,"$file"===t.data[a]?e:t.data[a])})),o.status.innerHTML+=`
    Uploading ${e.name}`,new Promise(((r,l)=>{GM.xmlHttpRequest({method:"POST",url:t.url,data:s,responseType:t.responsePath?"json":"text",headers:t.headers,onload:async s=>{if(s.status<200||s.status>=300)return l(s);const o=t.responsePath?n.get(s.response,t.responsePath):t.responseMatch?(s.responseText.match(new RegExp(t.responseMatch))||[])[1]:s.responseText,i=(t.soundUrl?t.soundUrl.replace("%s",o):o).trim();Player.$(`.${ns}-upload-status-${a}`).innerHTML=`Uploaded ${e.name} to ${i}`,r(i)},upload:{onprogress:t=>{const n=t.total>0?t.total:e.size;Player.$(`.${ns}-upload-status-${a}`).innerHTML=`Uploading ${e.name} - ${Math.floor(t.loaded/n*100)}%`}},onerror:l})}))},addCreatedToPlayer(){Player.playlist.addFromFiles([Player.tools._createdImage])},addCreatedToQR(){if(!is4chan)return;const e=document.querySelector(isChanX?".qr-link":".open-qr-link"),t=new DataTransfer;if(t.items.add(Player.tools._createdImage),isChanX&&e){e.click();const a=new CustomEvent("drop",{view:window,bubbles:!0,cancelable:!0});a.dataTransfer=t,document.querySelector("#qr").dispatchEvent(a)}else e?(e.click(),document.querySelector("#qrFile").files=t.files):(document.querySelector("#togglePostFormLink a").click(),document.querySelector("#postFile").files=t.files,document.querySelector(".postForm").scrollIntoView())}}},6533:(e,t,a)=>{var n=a(6325);const s=a(5563),r=(e,t)=>{let a,n=new Promise(((n,s)=>{a=GM.xmlHttpRequest({method:"GET",url:e,responseType:"blob",onload:e=>n(e.response),onerror:e=>s(e),onabort:e=>{e.aborted=!0,s(e)},...t||{}})}));return t&&t.catch&&(n=n.catch(t.catch)),n.abort=a.abort,n},l=e.exports={downloadTemplate:a(4805),_downloading:null,initialize(){Player.on("rendered",l.afterRender)},afterRender(){l.resetDownloadButtons()},async _handleDownloadCancel(){Player.tools._downloading&&(Player.tools._downloadAllCanceled=!0,Player.tools._downloading.forEach((e=>e.forEach((e=>e&&e.abort())))))},async _handleDownload(e){Player.tools._downloadAllCanceled=!1,e.currentTarget.style.display="none",Player.$(`.${ns}-download-all-cancel`).style.display=null,await Player.tools.downloadThread({includeImages:Player.$(".download-all-images").checked,includeSounds:Player.$(".download-all-audio").checked,ignoreDownloaded:Player.$(".download-all-ignore-downloaded").checked,maxSounds:+Player.$(".download-all-max-sounds").value||0,concurrency:Math.max(1,+Player.$(".download-all-concurrency").value||1),compression:Math.max(0,Math.min(+Player.$(".download-all-compression").value||0,9)),status:Player.$(`.${ns}-download-all-status`)}).catch((()=>{})),Player.tools.resetDownloadButtons()},resetDownloadButtons(){Player.$(`.${ns}-download-all-start`).style.display=Player.tools._downloading?"none":null,Player.$(`.${ns}-download-all-cancel`).style.display=Player.tools._downloading?null:"none",Player.$(`.${ns}-download-all-save`).style.display=Player.tools.threadDownloadBlob?null:"none",Player.$(`.${ns}-download-all-clear`).style.display=Player.tools.threadDownloadBlob?null:"none",Player.$(`.${ns}-ignore-downloaded`).style.display=Player.sounds.some((e=>e.downloaded))?null:"none"},async download(e,t){try{const a=await r(e),s=n.element(``);s.click(),URL.revokeObjectURL(s.href)}catch(e){Player.logError("There was an error downloading.",e,"warning")}},async downloadThread({includeImages:e,includeSounds:t,ignoreDownloaded:a,maxSounds:l,concurrency:o,compression:i,status:d}){const c=new JSZip;!(l>0)&&(l=1/0);const p=Player.sounds.filter((e=>e.post&&(!a||!e.downloaded))).slice(0,l),y=p.length;if(d&&(d.style.display="block"),!y||!e&&!t)return d&&(d.innerHTML="Nothing to download.");Player.tools._downloading=[],d&&(d.innerHTML=`Downloading ${y} sound images.

    \n\t\t\tThis may take a while. You can leave it running in the background, but if you background the tab your browser will slow it down.\n\t\t\tYou'll be prompted to download the zip file once complete.

    `);const u=new Array(o).fill(0).map((()=>{const a=d&&n.element(s({includeSounds:t,includeImages:e}),d),r=[];return Player.tools._downloading.push(r),a&&(a.querySelector(`.${ns}-cancel-download`).onclick=()=>r.forEach((e=>e&&e.abort()))),{dlRef:r,el:a,status:a&&a.querySelector(`.${ns}-current-status`),image:a&&a.querySelector(`.${ns}-image-bar`),sound:a&&a.querySelector(`.${ns}-sound-bar`)}}));let h=0;const g=(e,t,a)=>({responseType:"arraybuffer",onprogress:e[a]&&(t=>e[a].style.width=t.loaded/t.total*100+"%"),catch:e=>{if(e.aborted)return"aborted";e.aborted||Player.tools._downloadAllCanceled||(console.error("[4chan sounds player] Download failed",e),d&&n.element(`

    Failed to download ${t.title} ${a}!

    `,u[0].el,"beforebegin"))}});await Promise.all(u.map((async function a(s){const l=p.shift();if(!l||Player.tools._downloadAllCanceled)return void(s.el&&d.removeChild(s.el));const o=++h;s.el&&(s.status.textContent=`${o} / ${y}: ${l.title}`,s.image.style.width=s.sound.style.width="0");const i=e&&t?l.post+"/":"",[m,v]=await Promise.all([s.dlRef[0]=e&&r(l.image,g(s,l,"image")),s.dlRef[1]=t&&r(l.src,g(s,l,"sound"))]);Player.tools._downloadAllCanceled||("aborted"===m||"aborted"===v?d&&n.element(`

    Skipped ${l.title}.

    `,u[0].el,"beforebegin"):(m&&c.file(`${i}${l.filename}`,m),v&&c.file(`${i}${encodeURIComponent(l.src)}`,v),l.downloaded=!0)),await a(s)}))),Player.tools._downloadAllCanceled&&n.element(`Canceled at ${h} / ${y}.`,d);const m=d&&n.element("
    Generating zip file...
    ",d);try{const e={type:"blob",compression:i?"DEFLATE":"STORE",compressionOptions:{level:i}};Player.tools.threadDownloadBlob=await c.generateAsync(e,(e=>{d&&(m.textContent=`Generating zip file (${e.percent.toFixed(2)}%)...`)})),d&&n.element("Complete!",d),Player.tools.saveThreadDownload()}catch(e){console.error("[4chan sounds player] Failed to generate zip",e),d&&(m.textContent="Failed to generate zip file!")}Player.tools._downloading=null,Player.tools.resetDownloadButtons()},saveThreadDownload(){const e=Thread||"-",t=n.element(``);t.click(),URL.revokeObjectURL(t.href)},clearDownloadBlob(){delete Player.tools.threadDownloadBlob,Player.tools.resetDownloadButtons()}}},5305:(e,t,a)=>{var n=a(6325);const s=a(8433),r=a(6533);e.exports={template:a(2230),...s,...r,initialize(){s.initialize(),r.initialize()},render(){n.elementHTML(Player.$(`.${ns}-tools`).innerHTML,Player.tools.template()),s.afterRender(),r.afterRender()},toggle(){"tools"===Player.config.viewStyle?Player.playlist.restore():Player.display.setViewStyle("tools")},handleDecoded(e){Player.$(`.${ns}-encoded-input`).value=encodeURIComponent(e.currentTarget.value)},handleEncoded(e){Player.$(`.${ns}-decoded-input`).value=decodeURIComponent(e.currentTarget.value)}}},5535:(e,t,a)=>{var n=a(4302),s=a(6325);const{postIdPrefix:r}=a(218);e.exports=[{property:"repeat",tplName:"repeat",action:"playlist.toggleRepeat",actionMods:".prevent",values:{all:{attrs:['title="Repeat All"'],icon:n.arrowRepeat},one:{attrs:['title="Repeat One"'],icon:n.arrowClockwise},none:{attrs:['title="No Repeat"'],class:"muted",icon:n.arrowRepeat}}},{property:"shuffle",tplName:"shuffle",action:"playlist.toggleShuffle",actionMods:".prevent",values:{true:{attrs:['title="Shuffled"'],icon:n.shuffle},false:{attrs:['title="Ordered"'],class:"muted",icon:n.shuffle}}},{property:"viewStyle",tplName:"playlist",action:"playlist.toggleView",values:{default:{attrs:['title="Player"'],class:"muted",icon:()=>"playlist"===Player.playlist._lastView?n.arrowsExpand:n.arrowsCollapse},playlist:{attrs:['title="Hide Playlist"'],icon:n.arrowsExpand},image:{attrs:['title="Show Playlist"'],icon:n.arrowsCollapse}}},{property:"hoverImages",tplName:"hover-images",action:"playlist.toggleHoverImages",values:{true:{attrs:['title="Hover Images Enabled"'],icon:n.image},false:{attrs:['title="Hover Images Disabled"'],class:"muted",icon:n.image}}},{tplName:"add",action:"playlist.selectLocalFiles",actionMods:".prevent",icon:n.plus,attrs:['title="Add local files"']},{tplName:"reload",action:"posts.refresh",actionMods:".prevent",icon:n.reboot,attrs:['title="Reload the playlist"']},{property:"viewStyle",tplName:"settings",action:"settings.toggle()",actionMods:".prevent",icon:n.gear,attrs:['title="Settings"'],values:{default:{class:"muted"},settings:{}}},{property:"viewStyle",tplName:"threads",action:"threads.toggle",actionMods:".prevent",icon:n.search,attrs:['title="Threads"'],values:{default:{class:"muted"},threads:{}}},{property:"viewStyle",tplName:"tools",action:"tools.toggle",actionMods:".prevent",icon:n.tools,attrs:['title="Tools"'],values:{default:{class:"muted"},tools:{}}},{tplName:"close",action:"hide",actionMods:".prevent",icon:n.close,attrs:['title="Hide the player"']},{tplName:"playing",requireSound:!0,action:'playlist.scrollToPlaying("center")',actionMods:".prevent",icon:n.musicNoteList,attrs:['title="Scroll the playlist to the currently playing sound."']},{tplName:"post",requireSound:!0,icon:n.chatRightQuote,showIf:e=>e.sound.post,attrs:e=>["href="+("#"+r+e.sound.post),'title="Jump to the post for the current sound"']},{tplName:"image",requireSound:!0,icon:n.image,attrs:e=>[`href=${e.sound.image}`,'title="Open the image in a new tab"','target="_blank"']},{tplName:"sound",requireSound:!0,icon:n.soundwave,attrs:e=>[`href=${e.sound.src}`,'title="Open the sound in a new tab"','target="_blank"']},{tplName:/dl-(image|sound)/,requireSound:!0,action:e=>{const t=e.sound["image"===e.tplNameMatch[1]?"image":"src"],a=e.sound["image"===e.tplNameMatch[1]?"filename":"name"]||"";return`tools.download("${s.escAttr(t,!0)}", "${s.escAttr(a,!0)}")`},actionMods:".prevent",icon:e=>"image"===e.tplNameMatch[1]?n.fileEarmarkImage:n.fileEarmarkMusic,attrs:e=>[`title="${"image"===e.tplNameMatch[1]?"Download the image with the original filename":"Download the sound"}"`]},{tplName:/filter-(image|sound)/,requireSound:!0,action:e=>`playlist.addFilter("${"image"===e.tplNameMatch[1]?e.sound.imageMD5:e.sound.src.replace(/^(https?:)?\/\//,"")}")`,actionMods:".prevent",icon:n.filter,showIf:e=>"sound"===e.tplNameMatch[1]||e.sound.imageMD5,attrs:e=>[`title="Add the ${"image"===e.tplNameMatch[1]?"image MD5":"sound URL"} to the filters."`]},{tplName:"remove",requireSound:!0,action:e=>`remove("${e.sound.id}")`,icon:n.trash,attrs:e=>['title="Filter the image."',`data-id="${e.sound.id}"`]},{tplName:"menu",requireSound:!0,class:`${ns}-item-menu-button`,action:e=>`playlist.handleItemMenu($event, "${e.sound.id}")`,actionMods:".prevent.stop",icon:n.chevronDown},{tplName:"view-menu",action:'display.showMenu($event.currentTarget, "views")',actionMods:".prevent.stop",icon:n.chevronDown,attrs:['title="Switch View"']},{tplName:"theme-menu",action:'display.showMenu($event.currentTarget, "themes")',actionMods:".prevent.stop",icon:n.layoutTextWindow,attrs:['title="Switch Theme"']},{tplName:"untz",action:"display.untz",icon:n.speaker,attrs:['title="UNTZ"']}]},3722:(e,t,a)=>{var n=a(6325);const s=a(5535),r=/p: ?{([^}]*)}/g,l=/h: ?{([^}]*)}/g,o=s.map((e=>`${e.tplName.source&&e.tplName.source.replace(/\(/g,"(?:")||e.tplName}`)),i=new RegExp(`(${o.join("|")})-(?:button|link)(?:\\:"([^"]+?)")?`,"g"),d=/sound-title/g,c=/sound-title-marquee/g,p=/sound-index/g,y=/sound-count/g,u=/sound-(src|id|name|post|imageOrThumb|image|thumb|filename|imageMD5)(-esc)?/g,h=/filtered-count/g,g=/\$config\[([^\]]+)\]/g,m=[];e.exports={buttons:s,initialize(){Player.on("config",Player.userTemplate._handleConfig),Player.on("playsound",(()=>Player.userTemplate._handleEvent("playsound"))),["add","remove","order","show","hide","stop"].forEach((e=>{Player.on(e,Player.userTemplate._handleEvent.bind(null,e))}))},build(e){const t=e.outerClass||"",a=e.sound&&e.sound.title||e.defaultName;let s={...e};const o=e=>"function"==typeof e?e(s):e;let m=e.template.replace(g,((...e)=>n.get(Player.config,e[1])));if(!e.ignoreDisplayBlocks&&(m=m.replace(r,Player.playing&&Player.playing===e.sound?"$1":"").replace(l,`$1`)),!e.ignoreButtons&&(m=m.replace(i,(function(a,r,l){let i=Player.userTemplate._findButtonConf(r);if(s.tplNameMatch=i.tplNameMatch,i.requireSound&&!e.sound||i.showIf&&!i.showIf(s))return"";if(i.values){i={...i,...i.values[n.get(Player.config,i.property)]||i.values[Object.keys(i.values)[0]]}}const d=[...o(i.attrs)||[]];return d.some((e=>e.startsWith("href")))||d.push('href="javascript:;"'),(i.class||t)&&d.push(`class="${i.class||""} ${t||""}"`),i.action&&d.push(`@click${i.actionMods||""}='${o(i.action)}'`),`${l&&l.replace(/ /g," ")||o(i.icon)||o(i.text)}`}))),!e.ignoreSoundName&&(m=m.replace(c,a?`
    ${a}
    `:"").replace(d,a?`
    ${a}
    `:"")),!e.ignoreSoundProperties&&(m=m.replace(u,((...t)=>e.sound?t[2]?n.escAttr(e.sound[t[1]],!0):e.sound[t[1]]:"")).replace(p,e.sound?Player.sounds.indexOf(e.sound)+1:0).replace(y,Player.sounds.length).replace(h,Player.filteredSounds.length)),!e.ignoreVersion&&(m=m.replace(/%v/g,"3.5.4")),e.replacements)for(let t of Object.keys(e.replacements))m=m.replace(new RegExp(t,"g"),e.replacements[t]);return m},maintain(e,t,a=[],n=[]){m.push({component:e,property:t,...Player.userTemplate.findDependencies(t,null),alwaysRenderConfigs:a,alwaysRenderEvents:n})},findDependencies(e,t){t||(t=n.get(Player.config,e));const a=[],s=y.test(t),l=d.test(t)||u.test(t),o=p.test(t),c=r.test(t),m=h.test(t);s&&a.push("add","remove"),"rowTemplate"!==e&&(l||o||c)&&a.push("playsound","stop"),o&&a.push("order"),m&&a.push("filters-applied");const v=[];let f;for(;null!==(f=i.exec(t));)if(!f[2]){let e=Player.userTemplate._findButtonConf(f[1]);e.property&&v.push(e.property)}for(;null!==(f=g.exec(t));)v.push(f[1]);return{events:a,config:v}},_handleConfig(e,t){m.forEach((a=>{a.property===e&&(Object.assign(a,Player.userTemplate.findDependencies(e,t)),a.component.render())})),m.forEach((t=>{(t.alwaysRenderConfigs.includes(e)||t.config.includes(e))&&t.component.render()}))},_handleEvent(e){m.forEach((t=>{(t.alwaysRenderEvents.includes(e)||t.events.includes(e))&&t.component.render()}))},_findButtonConf:e=>{let t,a=s.find((a=>t=a.tplName===e?[e]:a.tplName.test&&e.match(a.tplName)));return a&&{...a,tplNameMatch:t}}}},1277:e=>{e.exports=[{property:"autoshow",default:!0,title:"Autoshow",description:"Automatically show the player when the thread contains sounds.",displayGroup:"Display"},{property:"pauseOnHide",default:!0,title:"Pause On Hide",description:"Pause the player when it's hidden.",displayGroup:"Display",allowInTheme:!0},{property:"showUpdatedNotification",default:!0,title:"Show Update Notifications",description:"Show notifications when the player is successfully updated.",displayGroup:"Display"},{property:"hoverImages",title:"Hover Images",default:!1,allowInTheme:!0},{title:"Controls",displayGroup:"Display",allowInTheme:!0,settings:[{property:"preventControlWrapping",title:"Prevent Wrapping",description:"Hide controls to prevent wrapping when the player is too small",default:!0},{property:"controlsHideOrder",title:"Hide Order",description:'Order controls are hidden in to prevent wrapping. Available controls are
    previous
    next
    seek-bar
    time
    duration
    volume
    volume-button
    volume-bar
    and
    fullscreen
    .',default:["fullscreen","duration","volume-bar","seek-bar","time","previous"],displayMethod:"textarea",inlineTextarea:!0,format:e=>e.join("\n"),parse:e=>e.split(/\s+/)}]},{title:"Minimised Display",description:"Optional displays for when the player is minimised.",displayGroup:"Display",allowInTheme:!0,settings:[{property:"pip",title:"Thumbnail",description:"Display a fixed thumbnail of the playing sound in the bottom right of the thread.",default:!0},{property:"maxPIPWidth",title:"Max Width",description:"Maximum width for the thumbnail.",default:"150px",updateCSSVars:!0},{property:"chanXControls",title:"4chan X Header Controls",description:"Show playback controls in the 4chan X header. The display can be customised in Settings>Theme.",displayMethod:isChanX||null,default:"closed",options:{always:"Always",closed:"Only with the player closed",never:"Never"}}]},{title:"Thread",displayGroup:"Display",allowInTheme:!0,settings:[{property:"autoScrollThread",description:"Automatically scroll the thread to posts as sounds play.",title:"Auto Scroll",default:!1},{property:"limitPostWidths",description:"Limit the width of posts so they aren't hidden under the player.",title:"Limit Post Widths",default:!0},{property:"minPostWidth",title:"Minimum Width",default:"50%"}]},{property:"threadsViewStyle",title:"Threads View",description:"How threads in the threads view are listed.",settings:[{title:"Display",default:"table",options:{table:"Table",board:"Board"}}]},{title:"Colors",displayGroup:"Display",property:"colors",updateCSSVars:!0,allowInTheme:!0,class:`${ns}-colorpicker-input`,attrs:'@focusout.stop.prevent="colorpicker._updatePreview" @click="colorpicker.create"',displayMethod:({value:e,attrs:t})=>`
    \n\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    `,actions:[{title:"Match Theme",handler:"theme.forceBoardTheme",mods:".prevent"}],settings:[{property:"colors.text",default:"#000000",title:"Text"},{property:"colors.background",default:"#d6daf0",title:"Background"},{property:"colors.border",default:"#b7c5d9",title:"Border"},{property:"colors.odd_row",default:"#d6daf0",title:"Odd Row"},{property:"colors.even_row",default:"#b7c5d9",title:"Even Row"},{property:"colors.playing",default:"#98bff7",title:"Playing Row"},{property:"colors.dragging",default:"#c396c8",title:"Dragging Row"},{property:"colors.controls_background",default:"#3f3f44",title:"Controls Background",description:"The controls container element background.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_background")',mods:".prevent"}]},{property:"colors.controls_inactive",default:"#FFFFFF",title:"Control Items",description:"The playback controls and played bar.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_inactive")',mods:".prevent"}]},{property:"colors.controls_active",default:"#00b6f0",title:"Focused Control Items",description:"The control items when hovered.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_active")',mods:".prevent"}]},{property:"colors.controls_empty_bar",default:"#131314",title:"Volume/Seek Bar Background",decscription:"The background of the volume and seek bars.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_empty_bar")',mods:".prevent"}]},{property:"colors.controls_loaded_bar",default:"#5a5a5b",title:"Loaded Bar Background",description:"The loaded bar within the seek bar.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_loaded_bar")',mods:".prevent"}]},{property:"colors.page_background",default:"rgb(238, 242, 255)",displayMethod:null,allowInTheme:!1}]}]},2345:e=>{e.exports=[{property:"addWebm",title:"Include WebM",description:"Whether to add all WebM files regardless of a sound filename.",default:"soundBoards",displayGroup:"Filter",options:{always:"Always",soundBoards:"Boards with sound",never:"Never"}},{property:"allow",title:"Allowed Hosts",description:"Which domains sounds are allowed to be loaded from.",default:["4cdn.org","catbox.moe","dmca.gripe","lewd.se","pomf.cat","zz.ht","zz.fo"],actions:[{title:"Reset",handler:'settings.reset("allow")',mods:".prevent"}],displayGroup:"Filter",displayMethod:"textarea",attrs:"rows=10",format:e=>e.join("\n"),parse:e=>e.split("\n")},{property:"filters",default:["# Image MD5 or sound URL"],title:"Filters",description:"List of URLs or image MD5s to filter, one per line.\nLines starting with a # will be ignored.",actions:[{title:"Reset",handler:'settings.reset("filters")',mods:".prevent"}],displayGroup:"Filter",displayMethod:"textarea",attrs:"rows=10",format:e=>e.join("\n"),parse:e=>e.split("\n")}]},8620:e=>{e.exports=[{property:"defaultUploadHost",default:"catbox",parse:"settings.hosts.setDefault"},{property:"uploadHosts",title:"Hosts",actions:[{title:"Add",handler:"settings.hosts.add",mods:".prevent"},{title:"Restore Defaults",handler:"settings.hosts.restoreDefaults",mods:".prevent"}],displayGroup:"Hosts",displayMethod:"settings.hosts.template",parse:"settings.hosts.parse",looseCompare:!0,wideDesc:!0,description:'Each host needs a unique name and URL that points to an upload endpoint.

    The form data is a JSON representation of the data sent with the upload, with the file being indicated as "$file". The form data and headers allow for any other information to be sent, such as a user token.

    A response path or match can optionally be provided to get a link to the uploaded file from the response. Use "Response Path" for JSON responses to set where a link or filename can be found in the response. For all other responses "Response Match" takes a regular expression (without slashes) that is applied to the result, with the first capture group being the link or filename. File URL format can be set if you only have part of the link, such as the filename. The response, or response path/match result, will be inserted in place of %s.',mix:!0,default:{catbox:{default:!0,url:"https://catbox.moe/user/api.php",data:{reqtype:"fileupload",fileToUpload:"$file",userhash:null},filenameLength:29},pomf:{url:"https://pomf.cat/upload.php",data:{"files[]":"$file"},responsePath:"files.0.url",soundUrl:"a.pomf.cat/%s",filenameLength:23},zz:{url:"https://zz.ht/api/upload",responsePath:"files.0.url",data:{"files[]":"$file"},headers:{token:null},filenameLength:19},lewd:{url:"https://lewd.se/upload",data:{file:"$file"},headers:{token:null,shortUrl:!0},responsePath:"data.link",filenameLength:30}}}]},5303:(e,t,a)=>{e.exports=[...a(1277),...a(7022),...a(2345),...a(6270),...a(5066),...a(8620),{property:"viewStyle",default:"playlist"},{property:"showPlaylistSearch",default:!0},{property:"imageHeight",default:125},{property:"offsetTop",default:"0"},{property:"offsetBottom",default:"0"}]},6270:e=>{const t="mediaSession"in navigator,a={displayGroup:"Keybinds",format:"hotkeys.stringifyKey",parse:"hotkeys.parseKey",attrs:'@keydown="settings.handleKeyChange"',property:"hotkey_bindings",allowInTheme:!0};e.exports=[{title:"Keybinds",displayGroup:"Keybinds",settings:[{property:"hotkeys",default:"open",title:"Enabled",options:{always:"Always",open:"Only with the player open",never:"Never"}},{property:"hardwareMediaKeys",title:"Hardware Media Keys",displayGroup:"Keybinds",description:"Enable playback control via hardware media keys."+(t?"":" Your browser does not support this feature."),default:t,attrs:!t&&"disabled"}]},{title:"Playback",themeFieldTitle:"Playback Keybinds",...a,settings:[{property:"hotkey_bindings.playPause",title:"Play/Pause",keyHandler:"togglePlay",ignoreRepeat:!0,default:{key:" "}},{property:"hotkey_bindings.previous",title:"Previous",keyHandler:()=>Player.previous({force:!0}),ignoreRepeat:!0,default:{key:"arrowleft"}},{property:"hotkey_bindings.next",title:"Next",keyHandler:()=>Player.next({force:!0}),ignoreRepeat:!0,default:{key:"arrowright"}},{property:"hotkey_bindings.previousGroup",title:"Previous Group",keyHandler:()=>Player.previous({force:!0,group:!0}),ignoreRepeat:!0,default:{shiftKey:!0,key:"arrowleft"}},{property:"hotkey_bindings.nextGroup",title:"Next Group",keyHandler:()=>Player.next({force:!0,group:!0}),ignoreRepeat:!0,default:{shiftKey:!0,key:"arrowright"}},{property:"hotkey_bindings.volumeUp",title:"Volume Up",keyHandler:"actions.volumeUp",default:{shiftKey:!0,key:"arrowup"}},{property:"hotkey_bindings.volumeDown",title:"Volume Down",keyHandler:"actions.volumeDown",default:{shiftKey:!0,key:"arrowdown"}},{property:"hotkey_bindings.shuffle",title:"Shuffle",keyHandler:"playlist.toggleShuffle",default:{key:""}},{property:"hotkey_bindings.repeat",title:"Toggle Repeat",keyHandler:"playlist.toggleRepeat",default:{key:""}}]},{title:"Display",themeFieldTitle:"Display Keybinds",...a,settings:[{property:"hotkey_bindings.closePlayer",title:"Close",keyHandler:"display.close",default:{key:""}},{property:"hotkey_bindings.togglePlayer",title:"Show/Hide",keyHandler:"display.toggle",default:{key:"h"}},{property:"hotkey_bindings.toggleFullscreen",title:"Toggle Fullscreen",keyHandler:"display.toggleFullScreen",default:{key:""},allowFocusedInput:!0},{property:"hotkey_bindings.togglePlaylist",title:"Toggle Playlist",keyHandler:"playlist.toggleView",default:{key:""}},{property:"hotkey_bindings.toggleSearch",title:"Toggle Playlist Search",keyHandler:()=>Player.set("showPlaylistSearch",!Player.config.showPlaylistSearch),default:{key:""},allowFocusedInput:!0},{property:"hotkey_bindings.scrollToPlaying",title:"Jump To Playing",keyHandler:()=>Player.playlist.scrollToPlaying(),default:{key:""}},{property:"hotkey_bindings.toggleHoverImages",title:"Toggle Hover Images",keyHandler:"playlist.toggleHoverImages",default:{key:""}},{property:"hotkey_bindings.toggleAutoScroll",title:"Toggle Thread Scroll",keyHandler:()=>Player.set("autoScrollThread",!Player.config.autoScrollThread),default:{key:""}}]},{title:"Theme",themeFieldTitle:"Theme Keybinds",...a,settings:[{property:"hotkey_bindings.nextTheme",title:"Next Theme",keyHandler:"theme.next",default:{key:""}},{property:"hotkey_bindings.previousTheme",title:"Previous Theme",keyHandler:"theme.previous",default:{key:""}},{property:"hotkey_bindings.switchTheme",title:"Select Theme",keyHandler:"theme.handleSwitch",default:[],displayMethod:"theme.themeKeybindsTemplate",parse:"theme.parseSwitch",format:null}]}]},7022:e=>{e.exports=[{property:"shuffle",title:"Shuffle",displayGroup:"Playback",default:!1},{property:"repeat",title:"Repeat",displayGroup:"Playback",default:"all",options:{all:"All",one:"One",none:"None"}},{property:"preventSleep",title:"Prevent Sleep",displayGroup:"Playback",description:"Prevent sleeping while audio is playing. This only works when the browser and tab are in the foreground.",default:!0},{property:"autoplayNext",title:"Autoplay Next",displayGroup:"Playback",description:"Automatically play the next sound when the current one finishes.",default:!0},{property:"restartSeconds",title:"Restart After",displayGroup:"Playback",description:"How long into a track until selecting previous restarts the track instead. Set to 0 to disable.",default:3,parse:e=>+e>=0&&+e<1/0?+e:0},{title:"Inline Player",displayGroup:"Playback",settings:[{property:"playExpandedImages",title:"Expanded Image",description:"Play audio when sound images are expanded.",default:!0,dependentRender:["expandedControls"]},{property:"expandedControls",title:"Expanded Controls",description:"Show playback controls for expanded images.",default:!0,attrs:()=>Player.config.playExpandedImages?"":"disabled"},{property:"expandedLoopMaster",title:"Master Source",default:"sound",description:"Which media source to play in full for audio and video of different durations.",options:{sound:"Audio",video:"Video"}},{property:"expandedAllowFiltered",title:"Allow Filtered",default:!0,description:"Allow sounds that have been filtered to be played inline. Sounds from unknown hosts will not be played regardless of this setting."},{property:"expandedRepeat",title:"Repeat",default:"all",description:"How to repeat expanded images with multiple sounds.",options:{all:"All",one:"One",none:"None"}},{property:"playHoveredImages",title:"Hover Image",description:"Play audio when sound hover images are shown. This applies to hover images displayed by the native extention or 4chan X.",default:!0}]}]},5066:(e,t,a)=>{e.exports=[{property:"savedThemes",title:"Saved Themes",actions:[{title:"Restore Defaults",handler:"theme.restoreDefaults",mods:".prevent"},{title:"Save Current",handler:"theme.showSaveOptions",mods:".prevent.stop"}],displayGroup:"Theme",displayMethod:"theme.savedThemesTemplate",mix:!0,default:a(1469)},{property:"savedThemesOrder",default:[]},{property:"selectedTheme",default:"Default"},{property:"headerTemplate",title:"Header",actions:[{title:"Reset",handler:'settings.reset("headerTemplate")',mods:".prevent"}],default:"repeat-button shuffle-button hover-images-button playlist-button\nsound-title-marquee\nview-menu-button add-button theme-menu-button close-button",displayGroup:"Theme",displayMethod:"textarea",themeField:!0},{property:"rowTemplate",title:"Row",actions:[{title:"Reset",handler:'settings.reset("rowTemplate")',mods:".prevent"}],default:"sound-title h:{menu-button}",displayGroup:"Theme",displayMethod:"textarea",themeField:!0},{property:"footerTemplate",title:"Footer",actions:[{title:"Reset",handler:'settings.reset("footerTemplate")',mods:".prevent"}],default:`playing-button:"sound-index / " sound-count sounds\n
    \np:{\n\t\tpost-link\n\t\tOpen [ image-link sound-link ]\n\t\tDownload [ dl-image-button dl-sound-button ]\n}\n
    \n`,displayGroup:"Theme",displayMethod:"textarea",attrs:'rows="10"',themeField:!0},{property:"chanXTemplate",title:"4chan X Header",default:'p:{\n\tpost-link:"sound-title"\n\tprev-button\n\tplay-button\n\tnext-button\n\tsound-current-time / sound-duration\n}',actions:[{title:"Reset",handler:'settings.reset("chanXTemplate")',mods:".prevent"}],displayGroup:"Theme",displayMethod:"textarea",attrs:'rows="10"',themeField:!0},{property:"customCSS",title:"Custom CSS",default:"",displayGroup:"Theme",displayMethod:"textarea",attrs:'rows="10"',themeField:!0}]},1952:()=>{window.ns="fcsp",window.is4chan=location.hostname.includes("4chan.org")||location.hostname.includes("4channel.org"),window.isChanX=document.documentElement&&document.documentElement.classList.contains("fourchan-x"),window.isOneeChan=document.documentElement&&document.documentElement.classList.contains("oneechan"),window.Board=location.pathname.split("/")[1],window.Thread=(location.href.match(/\/thread\/(\d+)/)||[])[1],window.Site=is4chan?"4chan":((document.head.querySelector('meta[name="generator"]')||{}).content||"").includes("FoolFuuka")?"FoolFuuka":location.hostname.includes("warosu.org")?"Fuuka":"FoolFuuka";class e extends Error{constructor(e,t,a){super(e),this.reason=e,this.type=t,this.error=a}}window.PlayerError=e},5463:e=>{e.exports={catbox:{filepath:"//files.catbox.moe/",decode:!1},audio:{decode:!0},sound:{decode:!0}}},4302:(e,t,a)=>{e.exports={fcSounds:'4sp',arrowClockwise:a(5226).A,arrowsCollapse:a(1730).A,arrowDown:a(4292).A,arrowsExpand:a(5331).A,arrowRepeat:a(8997).A,arrowUp:a(991).A,boxArrowInLeft:a(1733).A,boxArrowRight:a(6818).A,chatRightQuote:a(9908).A,checkSquare:a(188).A,chevronDown:a(6042).A,chevronUp:a(2793).A,close:a(2340).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),gear:a(2181).A,fileEarmarkImage:a(794).A,fileEarmarkMusic:a(416).A,filter:a(706).A,fullscreen:a(4855).A,fullscreenExit:a(9520).A,github:a(5737).A,image:a(187).A,infoCircle:a(2277).A,layoutTextWindow:a(8979).A,link:a(5916).A,musicNoteList:a(5763).A,play:a(1786).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),playFill:a(5540).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),pause:a(8250).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),pauseFill:a(4708).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),plus:a(6001).A,reboot:a(3264).A,search:a(8472).A,shuffle:a(2487).A,skipEnd:a(7453).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),skipEndFill:a(137).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),skipStart:a(1590).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),skipStartFill:a(1992).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),soundwave:a(8998).A,speaker:a(7119).A,square:a(6289).A,tools:a(6933).A,trash:a(2602).A,volumeMute:a(7568).A.replace(/viewBox="[^"]+"/,'viewBox="1 1 14 14"'),volumeMuteFill:a(4250).A.replace(/viewBox="[^"]+"/,'viewBox="1 1 14 14"'),volumeUp:a(3220).A.replace(/viewBox="[^"]+"/,'viewBox="1 1 14 14"'),volumeUpFill:a(7654).A.replace(/viewBox="[^"]+"/,'viewBox="1 1 14 14"')}},3980:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\t
    \n\t\t${e.inline&&!e.multiple?"":`\n\t\t\t
    \n\t\t\t\t${n.skipStart} ${n.skipStartFill}\n\t\t\t
    \n\t\t`}\n\t\t
    \n\t\t\t${n.play} ${n.pause} ${n.playFill} ${n.pauseFill}\n\t\t
    \n\t\t${e.inline&&!e.multiple?"":`\n\t\t\t
    \n\t\t\t\t${n.skipEnd} ${n.skipEndFill}\n\t\t\t
    \n\t\t`}\n\t
    \n\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t
    \n\t
    \n\t\t\n\t\t\t0:00\n\t\t\t\n\t\t\t\t/ 0:00\n\t\t\t\n\t\t\n\t
    \n\t
    \n\t\t
    \n\t\t\t${n.volumeMute} ${n.volumeMuteFill}\n\t\t\t${n.volumeUp} ${n.volumeUpFill}\n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t
    \n\t${e.inline?"":`\n\t\t
    \n\t\t\t
    \n\t\t\t\t${n.fullscreen} ${n.fullscreenExit}\n\t\t\t
    \n\t\t
    \n\t`}\n
    `},172:e=>{e.exports=(e={})=>``},3272:e=>{e.exports=(e={})=>``},928:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>``},2663:(e,t,a)=>{var n=a(6325);e.exports=(e={})=>``},4486:e=>{e.exports=(e={})=>(e.sounds||Player.sounds).map((e=>Player.playlist.matchesSearch(e)?`\n\t\n\t\t${Player.userTemplate.build({template:Player.config.rowTemplate,location:"item-"+e.id,sound:e,outerClass:`${ns}-col-auto`})}\n\t`:"")).join("")},4837:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`\n\t
    \n\t
    \n\t\n\t
    \n\t\n\t\n\n${Player.controls.template({audio:Player.audio,audioId:Player.audio.dataset.id,actions:Player.controls.actions})}\n
    \n\t\n\t
    \n\t\t${Player.playlist.listTemplate()}\n\t
    \n
    \n`},8808:e=>{e.exports=(e={})=>{if(!e.tags)return'
    Loading
    ';const t=Object.entries(e.tags);return t.length?t.map((([e,t])=>`
    \n\t\t\n\t\t\t${e[0].toUpperCase()+e.slice(1)}:\n\t\t\n\t\t${t}\n\t
    `)).join(""):'
    No data
    '}},9480:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\t
    \n\t\t
    \n\t
    \n\t
    \n\t\t
    \n\t
    \n\t
    \n\t\t${n.close}\n\t\t
    \n\n\t\t\n\t\t\t${["R","G","B","A"].map(((t,a)=>`\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`)).join("")}\n\t\t
    ${t}:\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\n\t\t
    \n\t
    \n
    `},8210:e=>{e.exports=(e={})=>Object.entries(Player.config.uploadHosts).map((([e,t])=>`\n\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t\t\n\t\t
    \n\t\t
    \n\t\t\t${Object.entries(Player.settings.hosts.fields).map((([a,n])=>`\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t`)).join("")}\n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t
    \n\t
    \n`)).join("")},1470:e=>{e.exports=(e={})=>`
    \n\t\n
    `},1691:e=>{e.exports=(e={})=>`
    \n\t\n
    `},9045:e=>{e.exports=(e={})=>`
    \n\t\n
    `},8475:e=>{e.exports=(e={})=>`
    \n\t\n
    `},1555:(e,t,a)=>{var n=a(6325),s=a(4302);e.exports=(e={})=>null===e.displayMethod?"":`\n
    \n\t
    \n\t\t\n\t\t\t${e.title}\n\t\t\t${e.description?`${s.infoCircle}`:""}\n\t\t\n\t\t${e.actions&&e.actions.length?`
    \n\t\t\t${(e.actions||[]).map((e=>`\n\t\t\t\t${e.title}\n\t\t\t`)).join(" ")}\n\t\t
    `:""}\n\t
    \n\n\t${e.dismissTextId?`
    \n\t\t\t${Player.display.ifNotDismissed(e.dismissTextId,e.dismissRestoreText,`
    \n\t\t\t\t\t${e.text}\n\t\t\t\t\t\n\t\t\t\t\t\tDismiss\n\t\t\t\t\t\n\t\t\t\t
    `)}\n\t\t
    `:e.text?e.text:""}\n\n\t${(()=>{if(e.settings)return e.settings.map((t=>Player.settings.settingTemplate({...e,actions:null,settings:null,description:null,...t,isSubSetting:!0}))).join("");value=n.get(Player.config,e.property,e.default),attrs=("function"==typeof e.attrs?e.attrs():e.attrs||"")+(e.class?` class="${e.class}"`:"")+` data-property="${e.property}"`,e.format&&(value=Player.getHandler(e.format)(value));let t=typeof value;return"object"===t&&(value=JSON.stringify(value,null,4)),inputTemplate="function"==typeof e.displayMethod&&e.displayMethod||n.get(Player,e.displayMethod)||e.displayMethod&&Player.settings.inputTemplates[e.displayMethod]||"boolean"===t&&Player.settings.inputTemplates.checkbox||"object"===t&&Player.settings.inputTemplates.textarea||e.options&&Player.settings.inputTemplates.select||Player.settings.inputTemplates.input,inputTemplate({value,attrs,setting:e})})()}\n
    `},1262:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\t\n\t
    \n\t\t${Object.keys(Player.settings.groups).map((e=>`\n\t\t\t\t${e}\n\t\t\t`)).join(" | ")}\n\t
    \n
    \n${Object.entries(Player.settings.groups).map((([e,t])=>`\n\t
    \n\t\t${t.map(Player.settings.settingTemplate).join("")}\n\t
    \n`)).join("")}`},5080:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\t
    \n\t\t
    \n\t\t\t\n\t\t
    \n\t\t
    \n\t\t\tCreate\n\t\t
    \n\t
    \n\t\n\t\tIncluded Settings\n\t\t${n.chevronDown}\n\t\t${n.chevronUp}\n\t\n\t${function e(t,a){return t.map((t=>{const n=t.property&&`theme_field-${t.property.replace(/\./g,"_")}`;return t.settings?e(t.settings,t):{...a||{},...t}.allowInTheme||t.themeField?`
    `:""})).join("")}(e.settingsConfig)}\n
    `},6305:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\t\n\t${Player.config.savedThemesOrder.map(((e,t)=>`\n\t\t
    \n\t\t\t
    ${e}
    \n\t\t\t\n\t\t
    \n\t`)).join("")}\n
    `},3038:e=>{e.exports=(e={})=>["Default"].concat(Player.config.savedThemesOrder).map((e=>`\n\t
    \n\t\t
    - ${e}
    \n\t\t
    \n\t\t\tt.themeName===e))||{key:""})}"\n\t\t\t\tdata-property="hotkey_bindings.switchTheme"\n\t\t\t/>\n\t\t
    \n\t
    \n`)).join("")},6844:e=>{e.exports=(e={})=>(Player.threads.boardList||[]).map((e=>{let t=Player.threads.selectedBoards.includes(e.board);return t||Player.threads.showAllBoards?`\n\t\t`:""})).join("")},1675:(e,t,a)=>{var n=a(6325);e.exports=(e={})=>Object.keys(Player.threads.displayThreads).reduce(((e,t)=>e.concat(Player.threads.displayThreads[t].map((e=>`\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t>>>/${e.board}/${e.no}\n\t\t\t\t\n\t\t\t\n\t\t\t${e.sub||""}\n\t\t\t${e.replies} / ${e.images}\n\t\t\t${n.timeAgo(e.time)}\n\t\t\t${n.timeAgo(e.last_modified)}\n\t\t\n\t`)))),[]).join("")},7870:e=>{e.exports=(e={})=>`
    \n\tActive Threads\n\t${Player.threads.loading?"":`- Update`}\n
    \n\n
    Loading
    \n\n
    \n\t
    \n\t\tFilter\n\t
    \n\t\n\n\t\n\t
    \n\t\t${Player.threads.boardsTemplate(e)}\n\t
    \n\n\t${Player.threads.hasParser?`
    \n\t\t\t${"table"!==Player.config.threadsViewStyle?`Table`:"Table"}\n\t\t\t|\n\t\t\t${"board"!==Player.config.threadsViewStyle?`Board`:"Board"}\n\t\t
    `:""}\n\t${Player.threads.hasParser&&"table"!==Player.config.threadsViewStyle?`
    `:`\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
    ThreadSubjectReplies/ImagesStartedUpdated
    `}\n
    `},4859:e=>{e.exports=(e={})=>`\n\t
    Complete!
    \n\t${is4chan?'Post - ':""}\n\tAdd -\n\tDownload\n
    `},5257:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\tCreate Sound Image\n
    \n
    \n\t
    \n\t\t
    \n\t\t\t${Player.display.ifNotDismissed("createSoundDetails","Show Help",`
    \n\t\t\t\tSelect an image and sound to combine as a sound image.\n\t\t\t\tThe sound will be uploaded to the selected file host and the url will be added to the image filename.
    \n\t\t\t\t
    \n\t\t\t\tMultiple sound files, or a comma-separated list of sound URLs, can be given for a single image.\n\t\t\t\tIf you do have multiple sounds the name will also be a considered comma-separated list.
    \n\t\t\t\tDismiss\n\t\t\t
    `)}\n\t\t
    \n\n\t\t
    \n\t\t\tHost - Config\n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t${Player.tools.createHostsTemplate()}\n\t\t\t
    \n\t\t
    \n\n\t\t
    \n\t\t\tData\n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t
    \n\n\t\t
    \n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\tSelect/Drop Image\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\tSelect/Drop Sound/s\n\t\t\t\t\t\t\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t${n.link}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t${n.fileEarmarkMusic}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\n\t\t
    \n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t
    \n\t
    \n\n\t
    \n\t\t${Player.tools._createdImage?Player.tools.createCompleteTemplate():""}\n\t
    \n
    `},5563:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\t
    \n\t\t${n.close}\n\t\t\n\t
    \n\t
    \n\t\t
    ${n.image}
    \n\t\t
    \n\t
    \n\t
    \n\t\t
    ${n.soundwave}
    \n\t\t
    \n\t
    \n
    `},4805:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    Download All
    \n
    \n\t
    \n\t\t\n\t\t\n\t\t\n\t\t
    \n\t\t\t
    Download Concurrency
    \n\t\t\t
    \n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\tCompression Level\n\t\t\t\t${n.infoCircle}\n\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\tMax Sounds\n\t\t\t\t${n.infoCircle}\n\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t
    \n\t\n\t
    \n\t\t\n\t\t\n\t\t\n\t\t
    \n\t\t\tClear${n.infoCircle}\n\t\t
    \n\t
    \n
    `},9103:e=>{e.exports=(e={})=>``},2230:e=>{e.exports=(e={})=>`${Player.tools.createTemplate()}\n${Player.tools.downloadTemplate()}\n\n
    Encode / Decode URL
    \n
    \n\t
    \n\t\t\n\t\t\n\t
    \n
    `},2674:e=>{e.exports=(e={})=>'.dialog{background:var(--fcsp-background);background:var(--fcsp-background);border-color:var(--fcsp-border);border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.15);border-radius:3px;padding-top:1px;padding-bottom:3px}.entry{position:relative;display:block;padding:.125rem .5rem;min-width:70px;white-space:nowrap}.entry.has-submenu::after{content:"";border-left:.5em solid;border-top:.3em solid transparent;border-bottom:.3em solid transparent;display:inline-block;margin:.35em;position:absolute;right:3px}.entry.focused{background:rgba(255,255,255,.33)}.entry.focused>.submenu{display:block}.submenu{position:absolute;display:none}'},9449:e=>{e.exports=(e={})=>`:root{--fcsp-text: ${Player.config.colors.text};--fcsp-background: ${Player.config.colors.background};--fcsp-border: ${Player.config.colors.border};--fcsp-odd-row: ${Player.config.colors.odd_row};--fcsp-even-row: ${Player.config.colors.even_row};--fcsp-playing: ${Player.config.colors.playing};--fcsp-dragging: ${Player.config.colors.dragging};--fcsp-controls-background: ${Player.config.colors.controls_background};--fcsp-controls-active: ${Player.config.colors.controls_active};--fcsp-controls-inactive: ${Player.config.colors.controls_inactive};--fcsp-controls-empty-bar: ${Player.config.colors.controls_empty_bar};--fcsp-controls-loaded-bar: ${Player.config.colors.controls_loaded_bar};--fcsp-muted: #909090;--fcsp-max-pip-size: ${Player.config.maxPIPWidth}}`},42:e=>{e.exports=(e={})=>`.${ns}-colorpicker{position:fixed;padding:.25rem;white-space:nowrap;z-index:999}.${ns}-colorpicker .${ns}-cp-saturation{display:inline-block;position:relative}.${ns}-colorpicker .${ns}-cp-saturation .position{width:5px}.${ns}-colorpicker .${ns}-cp-saturation::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-radius:inherit;background:#000;-webkit-mask-image:linear-gradient(#0000, #000);mask-image:linear-gradient(#0000, #000)}.${ns}-colorpicker .${ns}-cp-hue{margin-left:.5rem;display:inline-block;position:relative;width:30px;background:linear-gradient(to bottom, #F00, #FF0, #0F0, #0FF, #00F, #F0F, #F00)}.${ns}-colorpicker .${ns}-cp-hue .position{top:-3px;left:-1px;right:-1px}.${ns}-colorpicker .${ns}-cp-saturation .position,.${ns}-colorpicker .${ns}-cp-hue .position{position:absolute;height:5px;border-radius:1rem}.${ns}-colorpicker .${ns}-output{vertical-align:top;margin-left:1rem;display:inline-block}.${ns}-colorpicker .${ns}-output .${ns}-rgb-input{width:2rem}.${ns}-colorpicker .${ns}-output .output-color{height:40px;margin:.25rem 0}.${ns}-cp-preview,.${ns}-cp-saturation .position,.${ns}-cp-hue .position,.${ns}-output .output-color{border:solid 1px #000;box-shadow:inset 0 0 0 1px #eee}.${ns}-cp-preview{height:1em;width:1em;margin-left:.125rem}.${ns}-text-muted{color:var(--fcsp-muted)}.${ns}-controls{align-items:center;padding:.5rem 0;position:relative;background:var(--fcsp-controls-background);justify-content:space-between}.${ns}-controls>div{margin:0 .5rem}.${ns}-controls .${ns}-current-time{color:var(--fcsp-controls-inactive)}.${ns}-controls .${ns}-media-control{width:1.5rem;height:1.5rem;font-size:1rem;color:var(--fcsp-controls-inactive)}.${ns}-controls .${ns}-media-control.disabled{cursor:inherit;filter:brightness(0.5) grayscale(1)}.${ns}-controls .${ns}-media-control:hover:not(.disabled){color:var(--fcsp-controls-active)}.${ns}-media-control{display:flex;justify-content:center;align-items:center;cursor:pointer}.${ns}-media-control.${ns}-hover-fill svg[class$=-fill],.${ns}-media-control.${ns}-hover-fill svg[class*="-fill "]{display:none}.${ns}-media-control.${ns}-hover-fill:hover:not(.disabled) svg{display:none}.${ns}-media-control.${ns}-hover-fill:hover:not(.disabled) svg[class$=-fill],.${ns}-media-control.${ns}-hover-fill:hover:not(.disabled) svg[class*="-fill "]{display:block}.${ns}-media-control.${ns}-play-button:not(.${ns}-play) svg.bi-play-fill,.${ns}-media-control.${ns}-play-button:not(.${ns}-play) svg.bi-play{display:none !important}.${ns}-media-control.${ns}-play-button.${ns}-play svg.bi-pause-fill,.${ns}-media-control.${ns}-play-button.${ns}-play svg.bi-pause{display:none !important}.${ns}-media-control.${ns}-fullscreen-button svg.bi-fullscreen-exit{display:none}#${ns}-container[data-view-style=fullscreen] .${ns}-media-control.${ns}-fullscreen-button svg.bi-fullscreen-exit{display:block}#${ns}-container[data-view-style=fullscreen] .${ns}-media-control.${ns}-fullscreen-button svg.bi-fullscreen{display:none}.${ns}-media-control.${ns}-volume-button.mute .bi:not(.bi-volume-mute):not(.bi-volume-mute-fill){display:none}.${ns}-media-control.${ns}-volume-button.up .bi:not(.bi-volume-up):not(.bi-volume-up-fill){display:none}.${ns}-progress-bar{min-width:3.5rem;height:1.5rem;display:flex;align-items:center}.${ns}-progress-bar:hover .${ns}-current-bar:after{background:var(--fcsp-controls-active)}.${ns}-full-bar{height:.3rem;width:100%;background:var(--fcsp-controls-empty-bar);border-radius:1rem;position:relative}.${ns}-full-bar>div{position:absolute;top:0;bottom:0;border-radius:1rem}.${ns}-full-bar .${ns}-loaded-bar{background:var(--fcsp-controls-loaded-bar)}.${ns}-full-bar .${ns}-current-bar{display:flex;justify-content:flex-end;align-items:center}.${ns}-full-bar .${ns}-current-bar:after{content:"";background:var(--fcsp-controls-inactive);height:.8rem;min-width:.8rem;border-radius:1rem;box-shadow:rgba(0,0,0,.76) 0 0 3px 0;margin-right:-0.4rem}.${ns}-seek-bar .${ns}-current-bar{background:var(--fcsp-controls-active)}.${ns}-volume-bar .${ns}-current-bar{background:var(--fcsp-controls-inactive)}.${ns}-chan-x-controls .${ns}-current-time,.${ns}-chan-x-controls .${ns}-duration{margin:0 .25rem}.${ns}-header,.${ns}-footer{text-align:center;padding:.125rem;max-width:100%;line-height:1rem}.${ns}-header .${ns}-expander,.${ns}-footer .${ns}-expander{opacity:0;position:absolute;bottom:-0.25rem;right:-0.25rem;height:.75rem;width:.75rem;cursor:se-resize;background:linear-gradient(to bottom right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 50%, var(--fcsp-border) 55%, var(--fcsp-border) 100%)}.${ns}-header .${ns}-expander[data-direction=sw],.${ns}-footer .${ns}-expander[data-direction=sw]{left:-0.25rem;right:auto;transform:rotate(90deg);cursor:sw-resize}.${ns}-header .${ns}-expander[data-direction=nw],.${ns}-footer .${ns}-expander[data-direction=nw]{left:-0.25rem;top:-0.25rem;right:auto;bottom:auto;transform:rotate(180deg);cursor:nw-resize}.${ns}-header .${ns}-expander[data-direction=ne],.${ns}-footer .${ns}-expander[data-direction=ne]{right:-0.25rem;top:-0.25rem;bottom:auto;transform:rotate(270deg);cursor:ne-resize}.${ns}-header{cursor:grab;border-bottom:solid 1px var(--fcsp-border)}.${ns}-footer{cursor:grab;border-top:solid 1px var(--fcsp-border)}.${ns}-title-marquee{transition:margin-left 1s linear}.${ns}-menu svg.bi{margin:0 -0.25rem 0 .25rem}.${ns}-header svg.bi,.${ns}-footer svg.bi{margin:0 .125rem}.muted svg.bi{opacity:.45}svg.bi{overflow:visible;height:1em;width:1em}.fileText svg.bi{vertical-align:text-bottom}.${ns}-image-link{text-align:center;display:flex;flex-grow:1;justify-content:center;align-items:center;overflow:hidden;position:relative}.${ns}-image-link.${ns}-show-video .${ns}-video{display:block}.${ns}-image-link.${ns}-show-video .${ns}-image{display:none}.${ns}-image-link.${ns}-pip{position:fixed;right:10px;align-items:end}.${ns}-image-link.${ns}-pip .${ns}-image,.${ns}-image-link.${ns}-pip .${ns}-video{width:auto;height:auto;max-height:var(--fcsp-max-pip-size);max-width:var(--fcsp-max-pip-size);object-fit:contain}.${ns}-image-link.${ns}-pip .${ns}-image-transparent-bg,.${ns}-image-link.${ns}-pip .${ns}-background-image{display:none}.${ns}-image-link .${ns}-video{display:none}.${ns}-image-link .${ns}-image,.${ns}-image-link .${ns}-video{height:100%;width:100%;object-fit:contain;z-index:1}.${ns}-image-link .${ns}-background-image{position:absolute;top:-20px;bottom:-20px;left:-20px;right:-20px;object-fit:cover;object-position:center;height:calc(100% + 40px);width:calc(100% + 40px);filter:blur(10px) brightness(0.7) saturate(0.5) contrast(0.7);z-index:-1}.${ns}-image-link .${ns}-background-image:not([src]){display:none}.${ns}-image-link .${ns}-image-transparent-bg{background-color:var(--fcsp-background);position:absolute}.untz .${ns}-image-link{transition:all .1s linear}#${ns}-container[data-view-style=fullscreen].playing-video .${ns}-background-image{display:none}#${ns}-container[data-view-style=fullscreen].playing-video .${ns}-image-link,#${ns}-container[data-view-style=fullscreen] .${ns}-image-transparent-bg{background:#000}#${ns}-container.playing-video .${ns}-image-transparent-bg{display:none}.image-color-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,255,0,.5);transition:all .5s linear;display:none}.untz .image-color-overlay{display:block}.${ns}-has-controls{position:relative}.${ns}-has-controls .${ns}-controls{cursor:auto;flex-wrap:nowrap;overflow:hidden;min-width:auto;position:absolute;left:0;right:0;bottom:0}.${ns}-has-controls:not(:hover) .${ns}-controls{display:none}html:not(.fourchan-x) .${ns}-has-controls>video+.${ns}-controls{left:20px;right:20px}#${ns}-container{position:fixed;display:flex;flex-direction:column;background:var(--fcsp-background);color:var(--fcsp-text);border:1px solid var(--fcsp-border);box-sizing:border-box;min-width:7rem;line-height:1rem}#${ns}-container .w-100{width:100%;min-width:100%}#${ns}-container input[type=text],#${ns}-container input[type=number],#${ns}-container select,#${ns}-container .${ns}-file-overlay{background:#fff;color:#000;height:1.5rem !important;padding:2px 4px 3px;box-sizing:border-box;margin:0;border-radius:0;border:solid 1px var(--fcsp-border);padding:0 .25rem}#${ns}-container .m-0{margin:0}#${ns}-container .mx-0{margin-right:0;margin-left:0}#${ns}-container .my-0{margin-top:0;margin-bottom:0}#${ns}-container .mr-0{margin-right:0}#${ns}-container .ml-0{margin-left:0}#${ns}-container .mt-0{margin-top:0}#${ns}-container .mb-0{margin-bottom:0}#${ns}-container .m-1{margin:.125rem}#${ns}-container .mx-1{margin-right:.125rem;margin-left:.125rem}#${ns}-container .my-1{margin-top:.125rem;margin-bottom:.125rem}#${ns}-container .mr-1{margin-right:.125rem}#${ns}-container .ml-1{margin-left:.125rem}#${ns}-container .mt-1{margin-top:.125rem}#${ns}-container .mb-1{margin-bottom:.125rem}#${ns}-container .m-2{margin:.25rem}#${ns}-container .mx-2{margin-right:.25rem;margin-left:.25rem}#${ns}-container .my-2{margin-top:.25rem;margin-bottom:.25rem}#${ns}-container .mr-2{margin-right:.25rem}#${ns}-container .ml-2{margin-left:.25rem}#${ns}-container .mt-2{margin-top:.25rem}#${ns}-container .mb-2{margin-bottom:.25rem}#${ns}-container .m-3{margin:.375rem}#${ns}-container .mx-3{margin-right:.375rem;margin-left:.375rem}#${ns}-container .my-3{margin-top:.375rem;margin-bottom:.375rem}#${ns}-container .mr-3{margin-right:.375rem}#${ns}-container .ml-3{margin-left:.375rem}#${ns}-container .mt-3{margin-top:.375rem}#${ns}-container .mb-3{margin-bottom:.375rem}#${ns}-container .m-4{margin:.5rem}#${ns}-container .mx-4{margin-right:.5rem;margin-left:.5rem}#${ns}-container .my-4{margin-top:.5rem;margin-bottom:.5rem}#${ns}-container .mr-4{margin-right:.5rem}#${ns}-container .ml-4{margin-left:.5rem}#${ns}-container .mt-4{margin-top:.5rem}#${ns}-container .mb-4{margin-bottom:.5rem}#${ns}-container .m-5{margin:1rem}#${ns}-container .mx-5{margin-right:1rem;margin-left:1rem}#${ns}-container .my-5{margin-top:1rem;margin-bottom:1rem}#${ns}-container .mr-5{margin-right:1rem}#${ns}-container .ml-5{margin-left:1rem}#${ns}-container .mt-5{margin-top:1rem}#${ns}-container .mb-5{margin-bottom:1rem}#${ns}-container .pointer{cursor:pointer}.${ns}-panel{padding:0 .25rem;height:100%;width:calc(100% - .5rem);overflow:auto}.${ns}-heading{font-weight:600;margin:.5rem 0}.${ns}-heading.lined{border-bottom:solid 1px var(--fcsp-border)}.${ns}-heading.lined .${ns}-heading-action{text-decoration:none}.${ns}-heading-action{font-weight:normal;text-decoration:underline;display:inline-flex}.${ns}-row{display:flex;flex-wrap:wrap;min-width:100%;box-sizing:border-box}.${ns}-row.nowrap{flex-wrap:nowrap}.${ns}-col-auto{flex:0 0 auto;width:auto;max-width:100%;display:inline-flex}.${ns}-col{flex-basis:0;flex-grow:1;max-width:100%;width:100%;position:relative}.${ns}-hover-display{display:none}.${ns}-hover-trigger:hover .${ns}-hover-display{display:flex}[\\@pointdrag],.no-touch-action{touch-action:none}.${ns}-truncate-text{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.${ns}-align-center{align-items:center;align-content:center;align-self:center}.${ns}-align-start{align-items:start;align-content:start;align-self:start}.${ns}-space-between{justify-content:space-between}.${ns}-player{display:flex;flex-direction:column;flex-grow:1;overflow:auto}.${ns}-player .${ns}-hover-image{position:fixed;max-height:125px;max-width:125px;z-index:2}.${ns}-player.${ns}-hide-hover-image .${ns}-hover-image{display:none !important}.${ns}-under-image{flex-grow:1;overflow:auto}.${ns}-list-item{list-style-type:none;padding:.15rem .25rem;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;background:var(--fcsp-odd-row);overflow:hidden;height:1.3rem}.${ns}-list-item:nth-child(2n){background:var(--fcsp-even-row)}.${ns}-list-item:nth-child(n).playing{background:var(--fcsp-playing)}.${ns}-list-item .${ns}-item-menu-button{right:.25rem}.${ns}-list-item.${ns}-dragging{background:var(--fcsp-dragging)}.dialog .tags-dialog .entry{cursor:initial}.${ns}-settings textarea{border:solid 1px var(--fcsp-border);min-width:100%;min-height:4rem;box-sizing:border-box;white-space:pre}.${ns}-settings .${ns}-sub-settings .${ns}-heading{font-weight:normal;margin:0;justify-content:space-between}.${ns}-settings .${ns}-sub-settings .${ns}-col{min-height:1.55rem;display:flex;align-items:center;align-content:center;white-space:nowrap}.${ns}-settings .${ns}-settings-tabs{justify-content:space-between;flex-direction:row-reverse;margin:0 -0.25rem}.${ns}-settings .${ns}-settings-tab-group{text-align:center;white-space:nowrap;align-items:center}.${ns}-settings .${ns}-settings-tab{display:flex;margin:.25rem;text-decoration:underline;text-align:center}.${ns}-settings .${ns}-settings-tab.active{font-weight:bold}.${ns}-settings .${ns}-settings-tab svg.bi{margin:0 -0.125rem}.${ns}-settings .${ns}-settings-group{display:none}.${ns}-settings .${ns}-settings-group.active{display:block}.${ns}-settings .${ns}-host-input{margin:.5rem 0;border-top:solid 1px var(--fcsp-border)}.${ns}-settings .${ns}-host-input.invalid{border:solid 1px red}.${ns}-settings .${ns}-host-input .${ns}-host-controls{align-items:center;justify-content:space-between;margin:.125rem 0}.${ns}-settings .${ns}-host-input input[type=text]{min-width:100%;box-sizing:border-box}.${ns}-theme-save-options{position:fixed;max-height:20rem;overflow:auto;padding:.25rem}.${ns}-theme-save-options:not(.fields-collapsed) .bi-chevron-down,.${ns}-theme-save-options.fields-collapsed .bi-chevron-up,.${ns}-theme-save-options.fields-collapsed input[type=checkbox]:not(:checked),.${ns}-theme-save-options.fields-collapsed input[type=checkbox]:not(:checked)+label{display:none}.${ns}-info-circle{cursor:pointer}.${ns}-info-circle svg{height:.8em;width:.8em}.${ns}-popover-body{position:fixed;padding:.25rem;max-width:12rem;text-align:center;border-radius:.3rem}.${ns}-popover-body.wide{max-width:20rem}pre.option{display:inline;background:#f5f5f5;border:1px solid #b7c5d9;border-radius:4px;padding:0 .3em;font-size:.9em;white-space:nowrap}.${ns}-threads .${ns}-thread-board-list label{display:inline-block;width:4rem}.${ns}-threads .${ns}-thread-list{margin:.5rem -0.25rem 0;padding:.5rem 1rem;border-top:solid 1px var(--fcsp-border)}.${ns}-threads .${ns}-thread-list .boardBanner{margin:1rem 0}.${ns}-threads table{border-top:solid 1px var(--fcsp-border);width:100%;margin-top:.5rem;border-collapse:collapse}.${ns}-threads table th{border-bottom:solid 1px var(--fcsp-border)}.${ns}-threads table th,.${ns}-threads table td{text-align:left;padding:.25rem}.${ns}-threads table tr{padding:.25rem 0}.${ns}-threads table .${ns}-threads-body tr{background:var(--fcsp-even-row)}.${ns}-threads table .${ns}-threads-body tr:nth-child(2n){background:var(--fcsp-odd-row)}.${ns}-download-all-status,.${ns}-create-sound-status{margin-top:.5rem;border:solid 1px var(--fcsp-border);border-radius:5px;padding:.25rem}.${ns}-file-overlay,.${ns}-tools input[type=text]{display:flex;align-items:center}.${ns}-file-input.placeholder span,.${ns}-create-sound-form input[type=text]::placeholder{color:#aaa;opacity:1}.${ns}-file-input .${ns}-file-overlay{position:relative;background:#fff}.${ns}-file-input .placeholder-text{display:none}.${ns}-file-input.placeholder .placeholder-text{display:inherit}.${ns}-file-input span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.${ns}-file-input input[type=file]{width:100%;box-sizing:border-box;height:100%;position:absolute;left:0;opacity:0}.${ns}-file-input .overfile{z-index:9999}.${ns}-file-input .${ns}-file-list{padding:0 .25rem}.${ns}-file-input .${ns}-file-list:empty{display:none}.${ns}-input-append{position:absolute;display:flex;align-items:center;background:#fff;padding-left:.25rem;right:.125rem}.${ns}-tools .${ns}-full-bar{background:none;height:5px}.${ns}-tools .${ns}-full-bar>div{background:var(--fcsp-border)}.${ns}-threads,.${ns}-settings,.${ns}-tools,.${ns}-player,.fullscreen-details{display:none}#${ns}-container[data-view-style=settings] .${ns}-settings{display:block}#${ns}-container[data-view-style=threads] .${ns}-threads{display:block}#${ns}-container[data-view-style=tools] .${ns}-tools{display:block}#${ns}-container[data-view-style=image] .${ns}-player,#${ns}-container[data-view-style=playlist] .${ns}-player,#${ns}-container[data-view-style=fullscreen] .${ns}-player{display:flex}#${ns}-container[data-view-style=image] .${ns}-under-image{display:none}#${ns}-container[data-view-style=image] .${ns}-image-link{height:auto}#${ns}-container[data-view-style=playlist] .${ns}-image-link{flex-shrink:0;flex-grow:0}#${ns}-container[data-view-style=fullscreen] .${ns}-player{scrollbar-width:none}#${ns}-container[data-view-style=fullscreen] .${ns}-player::-webkit-scrollbar{display:none}#${ns}-container[data-view-style=fullscreen].cursor-inactive .${ns}-player{cursor:none}#${ns}-container[data-view-style=fullscreen].cursor-inactive .${ns}-controls,#${ns}-container[data-view-style=fullscreen].cursor-inactive .fullscreen-details{opacity:0}#${ns}-container[data-view-style=fullscreen] .${ns}-image-link{height:calc(100% - .4rem) !important}#${ns}-container[data-view-style=fullscreen] .${ns}-controls{position:absolute;left:0;right:0;bottom:0;opacity:.7;transition:opacity .3s ease;z-index:2}#${ns}-container[data-view-style=fullscreen] .${ns}-under-image{position:absolute;top:100%;width:100%}#${ns}-container[data-view-style=fullscreen] .fullscreen-details{display:block;opacity:.7;position:absolute;top:.5rem;left:.5rem;text-align:left;background:var(--fcsp-controls-background);color:var(--fcsp-controls-inactive);padding:.5rem 1rem;font-size:1.5rem;line-height:1.5rem;border-radius:.375rem;z-index:2}`},851:e=>{e.exports=[{version:"3.0.0",name:"hosts-filename-length",async run(){const e=Player.settings.findDefault("uploadHosts").default;return Object.keys(e).forEach((t=>{Player.config.uploadHosts[t].filenameLength=e[t].filenameLength})),{}}},{version:"3.3.0",name:"sound-name-title-swap",async run(){const e=Player.config,t={};return["headerTemplate","rowTemplate","footerTemplate","chanXTemplate","customCSS"].forEach((a=>{/sound-name/.test(e[a])&&(t[a]=[e[a],e[a]=e[a].replace(/sound-name/g,"sound-title")])})),t}},{version:"3.4.0",name:"disable-inline-player-for-existing-users",run:async()=>(Player.config.playExpandedImages=!1,Player.config.playHoveredImages=!1,{playExpandedImages:[!0,!1],playHoveredImages:[!0,!1]})},{version:"3.4.7",name:"zz-ht-to-zz-fo",async run(){const e=[...Player.config.allow];return Player.config.allow.push("zz.fo"),{allow:[e,Player.config.allow]}}}]},9211:(e,t,a)=>{var n=a(6325);const s={settings:a(6279),events:a(3319),actions:a(2189),colorpicker:a(3378),controls:a(9912),display:a(6764),footer:a(337),header:a(8563),hotkeys:a(9433),inline:a(6431),minimised:a(3613),playlist:a(9200),position:a(2473),posts:a(1),theme:a(2475),threads:a(591),tools:a(5305),userTemplate:a(3722)},r=window.Player=e.exports={ns,components:s,audio:new Audio,sounds:[],filteredSounds:[],isHidden:!0,container:null,ui:{},_public:[],config:{},$:(...e)=>r.container&&r.container.querySelector(...e),$all:(...e)=>r.container&&r.container.querySelectorAll(...e),async initialize(){if(!r.initialized){r.initialized=!0;try{r.audio.dataset.id="main",r.sounds=[];for(let e in s)s[e].initialize&&await s[e].initialize();r.display.createPlayerButton(),await r.display.render(),document.addEventListener("PlayerEvent",(e=>{if(e.detail.action&&r._public.includes(e.detail.action))return n.get(r,e.detail.action).apply(window,e.detail.arguments)}))}catch(e){throw r.logError("There was an error initializing the sound player. Please check the console for details.",e),e}}},getHandler:e=>"string"==typeof e?n.get(r,e):e,compareIds(e,t){const[a,n]=e.split(":"),[s,r]=t.split(":"),l=a-s;return 0!==l?l:n-r},disallowedSound({src:e,imageMD5:t}){try{const a=new URL(e);e=e.replace(/^(https?:)?\/\//,"");const n=a.hostname.toLowerCase(),s={};s.host=!r.config.allow.find((e=>n===e||n.endsWith("."+e)))&&n;for(let a of r.config.filters)if(s.image=s.image||a===t&&t,s.sound=s.sound||a.replace(/^(https?:)?\/\//,"")===e&&e,s.image&&s.sound)break;return!!(s.host||s.image||s.sound)&&s}catch(e){return{invalid:!0}}},syncTab:(e,t)=>"undefined"!=typeof GM_addValueChangeListener&&GM_addValueChangeListener(e,((e,a,n,s)=>{s&&t(n,a)})),logError(e,t,a){console.error("[4chan sounds player]",e,t),t instanceof PlayerError&&(t.error&&console.error("[4chan sound player]",t.error),e=t.reason,a=t.type||a),r.alert(e,a||"error",5)},alert(e,t="info",a=5){isChanX?(e=n.element(`${e}r[t]=r[e][t])),(r[e].public||[]).forEach((t=>{r._public.push((r[e].atRoot||[]).includes(t)?t:`${e}.${t}`)}))},218:(e,t,a)=>{var n=a(4302);e.exports={"4chan":{postIdPrefix:"p",posts:".post",filename:{".fileText .file-info .fnfull":"textContent",".fileText .file-info > a":"textContent",".fileText > a":"title",".fileText":"textContent"},thumb:".fileThumb",expandedImage:isChanX?".full-image":".expanded-thumb, .expandedWebm",hoverImage:isChanX?"#ihover":"#image-hover",playLink:{class:"",text:n.playFill,relative:".fileText a",position:"afterend",prependText:" ",unfilterText:n.filter},styleFetcher:"post reply style-fetcher",limitWidthOf:".thread > .postContainer"},FoolFuuka:{postIdPrefix:"",posts:"article",filename:{".thread_image_box .post_file_filename":"textContent",".post_file_filename":"title"},thumb:".thread_image_link",playLink:{class:"btnr",text:"Play",relative:".post_controls",position:"beforeend",unfilterText:"Add"},styleFetcher:"post_wrapper style-fetcher",limitWidthOf:".posts > article.post"},Fuuka:{postIdPrefix:"p",posts:".content > div, td.reply",filename:{":scope > br + span":"textContent"},filenameParser:e=>e.split(", ").slice(2).join(", "),thumb:".thumb",playLink:{class:"",text:"play",relative:"br:nth-of-type(2)",position:"beforebegin",prependText:" [",appendText:"]",unfilterText:"add"},styleFetcher:"reply style-fetcher",limitWidthOf:".content > div, .content > table"}}[Site]},3571:e=>{const t=XMLHttpRequest,a=function(){let e,t,a,n={};return this.open=(a,n)=>{e=a,t=n},this.setRequestHeader=(e,t)=>n[e]=t,this.getAllResponseHeaders=()=>this.responseHeaders,this.getResponseHeader=e=>this._responseHeaders[e.toLowerCase()],this.overrideMimeType=e=>a=e,this.send=s=>{GM.xmlHttpRequest({method:e,url:t,headers:n,data:s,responseType:this.responseType,onload:e=>{Object.assign(this,e),this._responseHeaders=(e.responseHeaders||"").split("\n").reduce(((e,t)=>{let[a,...n]=t.split(": ");return e[a.toLowerCase()]=n.join(": "),e}),{}),this.responseText=e.responseText,this.onload(this)},onerror:this.onerror,onreadystatechange:this.onreadystatechange,ontimeout:this.ontimeout,timeout:this.timeout,overrideMimeType:a})},this.onload=null,this};e.exports.GM=a,e.exports.native=t,e.exports.toGM=function(){XMLHttpRequest=a},e.exports.toNative=function(){XMLHttpRequest=t}}},t={};function a(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,a),r.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";async function e(){a(1952);const e=a(9211);await e.initialize(),e.posts.addPosts(document.body,!0);new MutationObserver((function(t){t.forEach((function(t){"childList"===t.type&&t.addedNodes.forEach((function(t){t.nodeType===Node.ELEMENT_NODE&&e.posts.addPosts(t)}))}))})).observe(document.body,{childList:!0,subtree:!0}),is4chan&&isOneeChan&&t()}function t(){document.querySelector("#OneeChanLink")?Player.theme.applyBoardTheme():window.setTimeout(t,50)}document.addEventListener("4chanXInitFinished",e),setTimeout((function(){a(1952),isChanX||("loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e))}),0)})()})(); \ No newline at end of file +(()=>{var e={5226:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},4292:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},8997:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},991:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},1730:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},5331:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},3264:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},1733:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},6818:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},9908:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},188:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},6042:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},2793:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},794:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},416:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},706:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},9520:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},4855:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},2181:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},5737:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},187:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},2277:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},8979:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},5916:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},5763:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n \n \n'},4708:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},8250:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},5540:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},1786:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},6001:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},8472:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},2487:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},137:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},7453:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},1992:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},1590:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},8998:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},7119:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},6289:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},6933:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},2602:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n'},4250:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},7568:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},7654:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n \n'},3220:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n \n \n'},2340:(e,t,a)=>{"use strict";a.d(t,{A:()=>n});const n='\n \n'},6325:e=>{const t=e.exports;function a(e,t){const a=Math.max(0,t-e);return[a%60,Math.floor(a/60)%60,Math.floor(a/60/60)%24,Math.floor(a/60/60/24)%7,Math.floor(a/60/60/24/7)]}e.exports.set=function(e,t,a){const n=t.split("."),s=n.pop(),r=n.reduce(((e,t)=>e[t]||(e[t]={})),e);return r&&(r[s]=a),e},e.exports.get=function(e,t,a){if("string"!=typeof t)return a;if(""===t)return e;const n=t.split("."),s=n.pop(),r=n.reduce(((e,t)=>e&&e[t]),e);return r&&s in r?r[s]:a},e.exports.isEqual=function e(a,n,s=!0){if(typeof a!=typeof n)return!1;if(Array.isArray(a,n))return a===n||a.length===n.length&&a.every(((t,a)=>e(t,n[a])));if(a&&n&&"object"==typeof a&&a!==n){const e=Object.keys(a);return e.push(...Object.keys(n).filter((t=>!e.includes(t)))),e.every((e=>t.isEqual(a[e],n[e])))}return s?a===n:a==n},e.exports.toDuration=function(e){e=Math.floor(e||0);let[t,n,s]=a(0,e);return t<10&&(t="0"+t),s&&n<10&&(n="0"+n),(s?s+":":"")+n+":"+t},e.exports.timeAgo=function(e){const[t,n,s,r,l]=a(Math.floor(e),Math.floor(Date.now()/1e3));return l>1?l+" weeks ago":r>0?r+(1===r?" day":" days")+" ago":s>0?s+(1===s?" hour":" hours")+" ago":n>0?n+(1===n?" minute":" minutes")+" ago":t+(1===t?" second":" seconds")+" ago"},e.exports.element=function(e,a,n="beforeend"){let s;if(e instanceof Node)s=e;else{const t=document.createElement("div");t.innerHTML=e,s=t.children[0]}return a&&a.insertAdjacentElement(n,s),s instanceof Element&&t.elementHandler(s),s},e.exports.elementHTML=function(e,a){e.innerHTML=a,t.elementHandler(e)},e.exports.elementHandler=function(e){e.querySelectorAll(`.${ns}-expander`).forEach((e=>{e.classList.add("no-touch-action"),Player.events.set(e,"pointdragstart","position.initResize"),Player.events.set(e,"pointdrag.unbound","position.doResize"),Player.events.set(e,"pointdragend","position.stopResize")}));const t=Array.from(e.querySelectorAll(`.${ns}-popover`));e.classList.contains(`${ns}-popover`)&&t.push(e),t.forEach((e=>{e.addEventListener("mouseenter",Player.display._popoverMouseEnter),e.addEventListener("mouseleave",Player.display._popoverMouseLeave),"A"!==e.nodeName&&e.addEventListener("click",Player.display._popoverClick)})),Player.events.apply(e)},e.exports.escAttr=function(e,t){return e.replace(";",";").replace(/'/g,"'").replace(/"/g,t?"\\"":""").replace(/\n/g,"\\n")}},6672:e=>{const t={};e.exports={get:async function(e){return new Promise((function(a,n){const s={};t[e]&&(s["If-Modified-Since"]=t[e].lastModified),GM.xmlHttpRequest({method:"GET",url:e,headers:s,responseType:"json",onload:n=>{n.status>=200&&n.status<300&&(t[e]={lastModified:n.responseHeaders["last-modified"],response:n.response}),a(304===n.status?t[e].response:n.response)},onerror:n})}))}}},2189:e=>{e.exports={atRoot:["togglePlay","play","pause","next","previous","stop","toggleMute","volumeUp","volumeDown"],public:["togglePlay","play","pause","next","previous","stop","toggleMute","volumeUp","volumeDown"],initialize(){Player.controls._audio=Player.audio},togglePlay(){Player.audio.paused?Player.play():Player.pause()},async play(e,{paused:t}={}){try{if("string"==typeof e&&(e=Player.sounds.find((t=>t.id===e))),e||Player.playing||!Player.sounds.length||(e=Player.sounds[0]),e&&e!==Player.playing){Player.playing&&(Player.playing.playing=!1),Player.video.removeEventListener("canplaythrough",Player.actions.playOnceLoaded),Player.audio.removeEventListener("canplaythrough",Player.actions.playOnceLoaded);const t=Player.controls.audioEvents;for(let a in t){(Array.isArray(t[a])?t[a]:[t[a]]).forEach((t=>{const n=Player.getHandler(t);Player.video.removeEventListener(a,n),e.standaloneVideo&&Player.video.addEventListener(a,n)}))}e.playing=!0,Player.playing=e,Player.audio.src=e.src,Player.isVideo=e.image.endsWith(".webm")||"video/webm"===e.type,Player.isStandalone=e.standaloneVideo,Player.video.loop=!Player.isStandalone,Player.audio=e.standaloneVideo?Player.video:Player.controls._audio,Player.audio._linked=Player.isVideo&&!Player.isStandalone&&Player.video,Player.video._linked=Player.isVideo&&!Player.isStandalone&&Player.audio,Player.container.classList[Player.isVideo?"add":"remove"]("playing-video"),Player.container.classList[Player.isVideo||e.image.endsWith("gif")?"add":"remove"]("playing-animated"),await Player.trigger("playsound",e)}t||(!Player.isStandalone&&Player.isVideo&&(Player.video.readyState<3||Player.audio.readyState<3)?(Player.video.addEventListener("canplaythrough",Player.actions.playOnceLoaded),Player.audio.addEventListener("canplaythrough",Player.actions.playOnceLoaded)):Player.audio.play())}catch(e){Player.logError("There was an error playing the sound. Please check the console for details.",e)}},playOnceLoaded(e){e.currentTarget.readyState>3&&e.currentTarget._linked.readyState>3?(e.currentTarget.removeEventListener("canplaythrough",Player.actions.playOnceLoaded),e.currentTarget._linked.removeEventListener("canplaythrough",Player.actions.playOnceLoaded),e.currentTarget._inlinePlayer&&e.currentTarget._inlinePlayer.pendingControls&&e.currentTarget._inlinePlayer.pendingControls(),e.currentTarget._linked.play(),e.currentTarget.play()):(!e.currentTarget.paused&&e.currentTarget.pause(),!e.currentTarget._linked.paused&&e.currentTarget._linked.pause(),0!==e.currentTarget.currentTime&&(e.currentTarget.currentTime=0),0!==e.currentTarget._linked.currentTime&&(e.currentTarget._linked.currentTime=0))},pause(){Player.audio&&Player.audio.pause()},stop(){Player.audio.src=null,Player.playing=null,Player.isVideo=!1,Player.isStandalone=!1,Player.trigger("stop")},next(e){Player.actions._movePlaying(1,e)},previous(e){const t="number"==typeof Player.config.restartSeconds&&Player.config.restartSeconds;t&&Player.audio.currentTime>t?Player.audio.currentTime=0:Player.actions._movePlaying(-1,e)},_movePlaying(e,{force:t,group:a,paused:n}={}){if(!Player.sounds.length)return;const s=Player.sounds.indexOf(Player.playing);if(-1===s)return Player.play(Player.sounds[0]);let r;if(t||"one"!==Player.config.repeat){let t=s;do{t="all"===Player.config.repeat?(t+e+Player.sounds.length)%Player.sounds.length:t+e,r=Player.sounds[t]}while(a&&r&&t!==s&&(!r.post||r.post===Player.playing.post))}else r=Player.sounds[s];r&&Player.play(r,{paused:n})},volumeUp(){Player.audio.volume=Math.min(Player.audio.volume+.05,1)},volumeDown(){Player.audio.volume=Math.max(Player.audio.volume-.05,0)},toggleMute(){Player.audio.volume=(Player._lastVolume||.5)*!Player.audio.volume}}},9912:(e,t,a)=>{var n=a(6325);e.exports={template:a(3980),audioEvents:{ended:()=>Player.config.autoplayNext&&Player.next(),pause:"controls.handleMediaEvent",play:"controls.handleMediaEvent",seeked:"controls.handleMediaEvent",waiting:"controls.handleMediaEvent",ratechange:"controls.handleMediaEvent",timeupdate:"controls.updateDuration",loadedmetadata:["controls.updateDuration","controls"],durationchange:"controls.updateDuration",volumechange:"controls.updateVolume",loadstart:"controls.pollForLoading",error:"controls.handleAudioError"},actions:{previous:"previous({ force: true })",playPause:"togglePlay",next:"next({ force: true })",seek:'controls.handleSeek($event, "main")',mute:"toggleMute",volume:'controls.handleVolume($event, "main")',fullscreen:"display.toggleFullScreen"},async initialize(){GM.getValue("volume").then((e=>e>=0&&e<=1&&(Player.audio.volume=e))),Player.on("show",(()=>Player._hiddenWhilePolling&&Player.controls.pollForLoading())),Player.on("hide",(()=>{Player._hiddenWhilePolling=!!Player._loadingPoll,Player.controls.stopPollingForLoading()})),Player.on("rendered",(()=>{Player.video=Player.$(`.${ns}-video`),Player.video.dataset.id="main",Player.audio.volumeBar=Player.video.volumeBar=Player.$(`.${ns}-volume-bar .${ns}-current-bar`),Player.audio.currentTimeBar=Player.video.currentTimeBar=Player.$(`.${ns}-seek-bar .${ns}-current-bar`),Player.audio.loadedBar=Player.video.loadedBar=Player.$(`.${ns}-seek-bar .${ns}-loaded-bar`),Player.controls.updateDuration({currentTarget:Player.audio}),Player.controls.updateVolume({currentTarget:Player.audio}),Player.controls.preventWrapping()})),Player.on("config:preventControlsWrapping",(e=>!e&&Player.controls.showAllControls())),Player.on("config:controlsHideOrder",(()=>{Player.controls.setHideOrder(),Player.controls.preventWrapping()})),document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&Player.controls.sync(Player.audio)}))},handleAudioError(e){Player.playing&&(Player.logError(`Failed to play ${Player.playing.title}. Please check the console for details.`,e,"warning"),Player.playing.error=e,setTimeout((()=>Player.next({paused:!0})),3e3))},handleMediaEvent(e){const t=e.currentTarget._inlineAudio||e.currentTarget;Player.controls.sync(e.currentTarget),Player.controls.updateDuration(e),document.querySelectorAll(`.${ns}-play-button[data-audio="${t.dataset.id}"]`).forEach((e=>{e.classList[t.paused?"add":"remove"](`${ns}-play`)}))},sync(e){const t=e._linked;e&&e.readyState>3&&t&&t.readyState>3&&(t.currentTime=e.currentTime%t.duration,t[e.paused?"pause":"play"](),t.playbackRate=e.playbackRate,t.defaultPlaybackRate=e.defaultPlaybackRate)},pollForLoading(){Player._loadingPoll=Player._loadingPoll||setInterval(Player.controls.updateLoaded,1e3)},stopPollingForLoading(){Player._loadingPoll&&clearInterval(Player._loadingPoll),Player._loadingPoll=null},updateLoaded(){const e=Player.audio.buffered.length,t=e>0?Player.audio.buffered.end(e-1)/Player.audio.duration*100:0;100===t&&Player.controls.stopPollingForLoading(),Player.audio.loadedBar.style.width=t+"%"},updateDuration(e){const t=e.currentTarget,a=t._inlineAudio||t,s=t._inlinePlayer?t._inlinePlayer.controls:document,r=n.toDuration(t.currentTime),l=n.toDuration(t.duration),o=a.dataset.id;s&&s.querySelectorAll(`.${ns}-current-time[data-audio="${o}"]`).forEach((e=>e.childNodes[0].textContent=r)),s&&s.querySelectorAll(`.${ns}-duration[data-audio="${o}"]`).forEach((e=>e.childNodes[0].textContent=l)),Player.controls.updateProgressBarPosition(a.currentTimeBar,t.currentTime,t.duration)},updateVolume(e){const t=e.currentTarget._inlineAudio||e.currentTarget,a=t._inlinePlayer?t._inlinePlayer.controls:Player.container,n=t.volume;t===Player.audio&&(n>0&&(Player._lastVolume=n),GM.setValue("volume",n)),a&&a.querySelectorAll(`.${ns}-volume-button[data-audio="${t.dataset.id}"]`).forEach((e=>{e.classList[0===n?"add":"remove"]("mute"),e.classList[n>0?"add":"remove"]("up")})),Player.controls.updateProgressBarPosition(t.volumeBar,t.volume,1)},updateProgressBarPosition(e,t,a){if(!e)return;t||(t=0),a||(a=0);const n=a?Math.max(0,Math.min((t||0)/a,1)):0;e.style.width=`calc(${100*n}% - ${.8*n-.4}rem)`},handleSeek(e,t){const a="main"===t?Player.audio:Player.inline.audio[t]._inlinePlayer.master;a&&a.duration&&a.duration!==1/0&&(a.currentTime=a.duration*Player.controls._getBarXRatio(e))},handleVolume(e,t){("main"===t?Player.audio:Player.inline.audio[t]).volume=Player.controls._getBarXRatio(e)},_getBarXRatio(e){const t=.4*Player.remSize,a=e.offsetX||e.targetTouches[0].pageX-e.currentTarget.getBoundingClientRect().left;return Math.max(0,Math.min(1,(a-t)/(parseInt(getComputedStyle(e.currentTarget).width,10)-2*t)))},showAllControls(){Player.$all(`.${ns}-controls [data-hide-id]`).forEach((e=>e.style.display=null))},preventWrapping(){if(!Player.config.preventControlWrapping)return;const e=Player.$(`.${ns}-controls`),t=parseFloat(window.getComputedStyle(e).paddingTop),a=Player.controls.hideOrder||Player.controls.setHideOrder();let n=Array.prototype.slice.call(e.children),s=n.pop(),r=0;for(Player.controls.showAllControls();s.offsetTop>t&&rt!==e)),e===s&&(s=n.pop())}},setHideOrder(){Array.isArray(Player.config.controlsHideOrder)||Player.settings.reset("controlsHideOrder");const e=Player.$(`.${ns}-controls`);return Player.controls.hideOrder=Player.config.controlsHideOrder.map((t=>e.querySelector(`[data-hide-id="${t}"]`))).filter((e=>e)).sort(((e,t)=>e.dataset.hideOrder-t.dataset.hideOrder))}}},6764:(e,t,a)=>{var n=a(6325);const s=a(42),r=a(9449),l=a(2674),o={themes:a(3272),views:a(928)},i={},d={},c="function"==typeof NoSleep&&new NoSleep,p=()=>c.enable(),y=()=>c.disable();e.exports={atRoot:["show","hide"],public:["show","hide"],template:a(172),_noSleepEnabled:!1,async initialize(){try{Player.display.dismissed=(await GM.getValue("dismissed")).split(",")}catch(e){Player.display.dismissed=[]}Player.on("playsound",(()=>{Player.display._marquees={},!Player.display._marqueeTO&&Player.display.runTitleMarquee()})),Player.remSize=parseFloat(getComputedStyle(document.documentElement).fontSize),Player.on("config:preventSleep",Player.display._initNoSleep),Player.display._initNoSleep(Player.config.preventSleep),document.body.addEventListener("click",Player.display.closeDialogs),document.body.addEventListener("keydown",(e=>"Escape"===e.key&&Player.display.closeDialogs(e))),Player.on("playsound",Player.display.updateFullScreenDetails),Player.on("tags-loaded",(e=>e===Player.playing&&Player.display.updateFullScreenDetails()))},createPlayerButton(){if("FoolFuuka"===Site){const e=document.querySelector(".navbar-inner .nav:nth-child(2)");n.element('
  • Sounds
  • ',e).children[0].addEventListener("click",Player.display.toggle)}else if("Fuuka"===Site){const e=document.querySelector("div:has(#simple-search-form) + hr");e.parentNode.insertBefore(document.createTextNode("["),e),n.element('Sounds',e,"beforebegin"),e.parentNode.insertBefore(document.createTextNode("]"),e)}else isChanXT?n.element('\n\t\t\t\tSounds\n\t\t\t',document.getElementById("shortcut-settings"),"beforebegin"):isChanX?n.element('\n\t\t\t\tSounds\n\t\t\t',document.getElementById("shortcut-settings"),"beforebegin"):document.querySelectorAll("#settingsWindowLink, #settingsWindowLinkBot").forEach((function(e){n.element('Sounds',e,"beforebegin"),e.parentNode.insertBefore(document.createTextNode("] ["),e)}))},async render(){try{Player.container&&(document.body.removeChild(Player.container),document.head.removeChild(Player.stylesheet)),Player.stylesheet=Player.stylesheet||n.element('',document.head),Player.stylesheet.innerHTML=(isChanX?"":"/* 4chanX Polyfill */\n\n"+l())+"\n\n/* Sounds Player CSS */\n\n"+s(),Player.display.updateCSSVars();const e=Thread&&!isChanX&&document.body.querySelector(".board")||document.body;Player.container=n.element(Player.display.template(),e),await Player.trigger("rendered")}catch(e){throw Player.logError("There was an error rendering the sound player.",e),e}},updateCSSVars(){Player.varsCSS=Player.varsCSS||n.element('',document.head),Player.varsCSS.innerHTML="\n\n/* Sounds Player CSS variables */\n\n"+r()},async setViewStyle(e){const t=Player.config.viewStyle;if("fullscreen"!==e&&document.fullscreenElement&&document.exitFullscreen(),Player.set("viewStyle",e),Player.container.setAttribute("data-view-style",e),"playlist"!==e&&"image"!==e||Player.controls.preventWrapping(),"fullscreen"!==t||"fullscreen"===e){const[e,t]=(await GM.getValue("size")||"").split(":");e&&t&&Player.position.resize(parseInt(e,10),parseInt(t,10)),Player.position.setPostWidths()}Player.trigger("view",e,t)},toggle(){"none"===Player.container.style.display?(Player.theme.applyBoardTheme(),Player.show()):Player.hide()},hide(){Player.container.style.display="none",Player.isHidden=!0,Player.trigger("hide")},async show(){Player.container.style.display&&(Player.container.style.display=null,Player.isHidden=!1,await Player.trigger("show"))},async close(){Player.stop(),Player.hide()},async toggleFullScreen(){document.fullscreenElement?document.exitFullscreen&&(document.exitFullscreen(),document.body.removeEventListener("pointermove",Player.display._fullscreenMouseMove)):(Player.isHidden&&Player.show(),Player.$(`.${ns}-player`).requestFullscreen(),document.body.addEventListener("pointermove",Player.display._fullscreenMouseMove),Player.display._fullscreenMouseMove())},_fullscreenMouseMove(){Player.container.classList.remove("cursor-inactive"),Player.display.fullscreenCursorTO&&clearTimeout(Player.display.fullscreenCursorTO),Player.display.fullscreenCursorTO=setTimeout((function(){Player.container.classList.add("cursor-inactive")}),2e3)},updateFullScreenDetails(){const e=Player.playing.tags||{};document.querySelector(".fullscreen-details").innerHTML=[Player.playing.name,[e.title,e.artist].filter(Boolean).join(" - ")].filter(Boolean).join(" • ")||Player.playing.title},_handleFullScreenChange(){document.fullscreenElement?(Player.display.setViewStyle("fullscreen"),document.querySelector(`.${ns}-image-link`).removeAttribute("href")):(Player.playing&&(document.querySelector(`.${ns}-image-link`).href=Player.playing.image),Player.playlist.restore()),Player.controls.preventWrapping()},async restore(e){const t=Player.display.dismissed.indexOf(e);e&&t>-1&&(Player.display.dismissed.splice(t,1),Player.$all(`[\\@click^='display.restore("${e}")']`).forEach((t=>{n.element(i[e],t,"beforebegin"),t.parentNode.removeChild(t)})),await GM.setValue("dismissed",Player.display.dismissed.join(",")))},async dismiss(e){e&&!Player.display.dismissed.includes(e)&&(Player.display.dismissed.push(e),Player.$all(`[data-dismiss-id="${e}"]`).forEach((t=>{n.element(`${d[e]}`,t,"beforebegin"),t.parentNode.removeChild(t)})),await GM.setValue("dismissed",Player.display.dismissed.join(",")))},ifNotDismissed:(e,t,a)=>(i[e]=a,d[e]=t,Player.display.dismissed.includes(e)?`${t}`:a),showMenu(e,t,a){const s="string"==typeof t?n.element(o[t]()):t;Player.display.closeDialogs(),a||(a=Player.container),a.appendChild(s),Player.position.showRelativeTo(s,e),s.querySelectorAll(".entry").forEach((e=>{e.addEventListener("mouseenter",(t=>{Player.display._setFocusedMenuItem(t),e.dispatchEvent(new CustomEvent("entry-focus"))}))})),s._keepOpenFor=Array.from(s.querySelectorAll(".entry.has-submenu")),s._closeFor=Array.from(s.querySelectorAll(".submenu")),Player.trigger("menu-open",s)},_setFocusedMenuItem(e){const t=e.currentTarget.querySelector(".submenu");e.currentTarget.closest(".dialog").querySelectorAll(".focused").forEach((e=>{e.classList.remove("focused"),e.dispatchEvent(new CustomEvent("entry-blur"))})),e.currentTarget.classList.add("focused"),t&&t.getBoundingClientRect().right>document.documentElement.clientWidth&&(t.style.inset="0px 100% auto auto")},closeDialogs(e){document.querySelectorAll(`.${ns}-dialog`).forEach((t=>{const a=(t._keepOpenFor||[]).concat(t.dataset.allowClick?t:[]);(!e||!a.find((t=>t===e.target||t.contains(e.target)))||(t._closeFor||[]).find((t=>t===e.target||t.contains(e.target))))&&(t.parentNode.removeChild(t),Player.trigger("menu-close",t))}))},async runTitleMarquee(){Player.display._marqueeTO=setTimeout(Player.display.runTitleMarquee,1e3),document.querySelectorAll(`.${ns}-title-marquee`).forEach((e=>{const t=e.parentNode.getBoundingClientRect().width-(e.scrollWidth+1),a=e.getAttribute("data-location");if(t>=0)return e.style.marginLeft=null;const n=Player.display._marquees[a]=Player.display._marquees[a]||{direction:1,position:parseInt(e.style.marginLeft,10)||0};n.pause>0?n.pause--:(n.position-=20*n.direction,(n.position>0||n.position{const t=e.currentTarget,a=t.classList.contains("wide");t.infoEl&&Player.container.contains(t.infoEl)||(t.infoEl=n.element(`
    ${t.dataset.content}
    `,Player.container),t.infoEl._keepOpenFor=[t],Player.position.showRelativeTo(t.infoEl,t))},_popoverMouseLeave:e=>{const t=e.currentTarget;t.infoEl&&!t.infoEl._clicked&&(t.infoEl.parentNode.removeChild(t.infoEl),delete t.infoEl)},_popoverClick:e=>{const t=e.currentTarget;t.infoEl&&Player.container.contains(t.infoEl)?(t.infoEl._clicked=!t.infoEl._clicked)||Player.display._popoverMouseLeave(e):Player.display._popoverMouseEnter(e)},_initNoSleep:e=>{const t=e?"addEventListener":"removeEventListener";c&&!!e!==Player.display._noSleepEnabled&&(Player.audio[t]("play",p),Player.audio[t]("pause",y),Player.audio[t]("ended",y),Player.display._noSleepEnabled=!!e,Player.audio.paused||c[e?"enable":"disable"]())},untz(){const e=Player.$(`.${ns}-image-link`);if(Player.untzing=!Player.untzing,Player.audio.playbackRate=Player.audio.defaultPlaybackRate=Player.untzing?1.3:1,Player.container.classList[Player.untzing?"add":"remove"]("untz"),Player.untzing){const t=Player.$(".image-color-overlay");let a=0;t.style.filter=`brightness(1.5); hue-rotate(${a}deg)`,function e(){t.style.filter=`hue-rotate(${a=360-a}deg)`,Player.untzColorTO=setTimeout(e,500)}(),function t(){Player.untzing&&(e.style.transform=`scale(${1+.05*Math.random()})`,e.style.filter=`brightness(${1+.5*Math.random()}) blur(${3*Math.random()}px)`,Player.untzBounceTO=setTimeout(t,200))}()}else e.style.transform=null,e.style.filter=null,clearTimeout(Player.untzBounceTO),clearTimeout(Player.untzColorTO)}}},3319:e=>{e.exports={atRoot:["on","off","trigger"],_events:{},initialize(){const e={Player,...Player.components},t=[];for(let a of Object.values(e))a.audioEvents&&t.push(a.audioEvents);document.body.addEventListener("pointerup",Player.events.clearMousedown),document.body.addEventListener("pointercancel",Player.events.clearMousedown),Player.on("rendered",(function(){for(let e of t)for(let t in e){(Array.isArray(e[t])?e[t]:[e[t]]).forEach((e=>Player.audio.addEventListener(t,Player.getHandler(e))))}}))},apply(e){const t=[],a=document.evaluate('.//attribute::*[starts-with(name(), "@")]',e,null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(let e=0;e(e[t]=!0,e)),{}),l=e._eventListeners||(e._eventListeners={});l[n]&&e.removeEventListener(n,l[n]);let o=a&&(Player.getHandler(a)||function(e){const t=document.createElement("script");t.innerText=`window.${ns}Handler = function(Player, $event) { with (Player) { ${a} } };`,document.head.appendChild(t),o=unsafeWindow[`${ns}Handler`].bind(null,Player),delete unsafeWindow[`${ns}Handler`],o(e)});const i=function(e){return r.prevent&&e.preventDefault(),r.stop&&e.stopPropagation(),r.disabled&&e.currentTarget.classList.contains("disabled")&&e.currentTarget.classList.contains("disabled"),o&&o.call(this,e,Player)};if("pointdrag"===n){const t=t=>{t._dragInit||(t._dragInit=!0,l.pointdragstart&&l.pointdragstart(t),t.preventDrag||(e.setPointerCapture(t.pointerId),Player._mousedown=e,Player._mousedownListener=i,Player._mousedownMoveEl=r.unbound?document.documentElement:e,Player._mousedownMoveEl.addEventListener("pointermove",i,r),e.addEventListener("pointerleave",i,r),r.boxed&&e.addEventListener("pointerleave",Player.events.clearMousedown),!r.move&&i(t)))};e.addEventListener("pointerdown",t),l.pointerdown=t}else"pointdragstart"===n||"pointdragend"===n||e.addEventListener(n,i,r),l[n]=i},on(e,t){(Array.isArray(e)?e:[e]).forEach((e=>{Player.events._events[e]||(Player.events._events[e]=[]),Player.events._events[e].push(t)}))},off(e,t){const a=Player.events._events[e]&&Player.events._events[e].indexOf(t);a>-1&&Player.events._events[e].splice(a,1)},async trigger(e,...t){const a=Player.events._events[e]||[];for(let e of a)await e(...t)},clearMousedown(e){Player._mousedown&&(Player._mousedown.releasePointerCapture(e.pointerId),Player._mousedownMoveEl.removeEventListener("pointermove",Player._mousedownListener),Player._mousedown.removeEventListener("pointerleave",Player._mousedownListener),Player._mousedown._eventListeners.pointdragend&&Player._mousedown._eventListeners.pointdragend(e),Player._mousedown=Player._mousedownListener=null)}}},337:(e,t,a)=>{var n=a(6325);e.exports={template:()=>Player.userTemplate.build({template:Player.config.footerTemplate+`
    `,location:"footer",sound:Player.playing,defaultName:"4chan Sounds",outerClass:`${ns}-col-auto`}),initialize(){Player.userTemplate.maintain(Player.footer,"footerTemplate")},render(){n.elementHTML(Player.$(`.${ns}-footer`),Player.footer.template())}}},8563:(e,t,a)=>{var n=a(6325);e.exports={template:()=>Player.userTemplate.build({template:Player.config.headerTemplate+`
    `,location:"header",sound:Player.playing,defaultName:"4chan Sounds",outerClass:`${ns}-col-auto`}),initialize(){Player.userTemplate.maintain(Player.header,"headerTemplate")},render(){n.elementHTML(Player.$(`.${ns}-header`),Player.header.template())}}},9433:(e,t,a)=>{const n=a(5303);let s;e.exports={_keyMap:{" ":"space",arrowleft:"left",arrowright:"right",arrowup:"up",arrowdown:"down"},initialize(){if(Player.on("rendered",Player.hotkeys.apply),Player.on("config:hotkeys",Player.hotkeys.apply),s=n.reduce(((e,t)=>("hotkey_bindings"===t.property&&t.settings.forEach((t=>e[t.property.slice(16)]=t)),e)),{}),"mediaSession"in navigator&&Player.config.hardwareMediaKeys){const e=[["play",()=>Player.play()],["pause",()=>Player.pause()],["stop",()=>Player.pause()],["previoustrack",()=>Player.previous()],["nexttrack",()=>Player.next()],["seekbackward",e=>Player.audio.currentTime-=e.seekOffset||10],["seekforward",e=>Player.audio.currentTime+=e.seekOffset||10],["seekto",e=>Player.audio.currentTime+=e.seekTime]];for(let[t,a]of e)try{navigator.mediaSession.setActionHandler(t,a)}catch(e){}Player.audio.addEventListener("pause",(()=>navigator.mediaSession.playbackState="paused")),Player.audio.addEventListener("ended",(()=>navigator.mediaSession.playbackState="paused")),Player.audio.addEventListener("play",Player.hotkeys.setMediaMetadata),Player.audio.addEventListener("ratechange",Player.hotkeys.setMediaPosition),Player.audio.addEventListener("seeked",Player.hotkeys.setMediaPosition),Player.on("tags-loaded",(e=>e===Player.playing&&Player.hotkeys.setMediaMetadata()))}},async setMediaMetadata(){const e=Player.playing,t=e.tags||{};navigator.mediaSession.playbackState="playing";const a={title:t.title||e.name||e.title,artist:t.artist||`/${Board}/ - ${Thread||"4chan Sounds Player"}`,album:t.album||document.title,artwork:[{src:Player.playing.thumb,sizes:"125x125"}]};if(!Player.isVideo)if(e._fullDimension)a.artwork.push({src:Player.playing.image,sizes:e._fullDimension});else{const t=new Image;t.onload=function(){e._fullDimension=t.width+"x"+t.height,Player.hotkeys.setMediaMetadata()},t.src=Player.playing.image}navigator.mediaSession.metadata=new MediaMetadata(a),Player.hotkeys.setMediaPosition()},setMediaPosition(){navigator.mediaSession.setPositionState({duration:Player.audio.duration||0,playbackRate:Player.audio.playbackRate,position:Player.audio.currentTime})},addHandler:()=>{Player.hotkeys.removeHandler(),document.body.addEventListener("keydown",Player.hotkeys.handle)},removeHandler:()=>{document.body.removeEventListener("keydown",Player.hotkeys.handle)},apply(){const e=Player.config.hotkeys;Player.hotkeys.removeHandler(),Player.off("show",Player.hotkeys.addHandler),Player.off("hide",Player.hotkeys.removeHandler),"always"===e?Player.hotkeys.addHandler():"open"===e&&(Player.isHidden||Player.hotkeys.addHandler(),Player.on("show",Player.hotkeys.addHandler),Player.on("hide",Player.hotkeys.removeHandler))},handle(e){if(Player.isHidden&&("always"!==Player.config.hotkeys||!Player.sounds.length))return;const t=["INPUT","SELECT","TEXTAREA","INPUT"].includes(e.target.nodeName),a=e.key.toLowerCase(),n=Player.config.hotkey_bindings||{};Object.entries(n).forEach((function n([r,l]){if(Array.isArray(l))return l.find((e=>n([r,e])));const o=a===l.key&&!!l.shiftKey==!!e.shiftKey&&!!l.ctrlKey==!!e.ctrlKey&&!!l.metaKey==!!e.metaKey&&(!l.ignoreRepeat||!e.repeat)&&s[r];!o||t&&!o.allowFocusedInput||(e.preventDefault(),e._binding=l,Player.getHandler(o.keyHandler)(e))}))},stringifyKey(e){let t=e.key.toLowerCase();return Player.hotkeys._keyMap[t]&&(t=Player.hotkeys._keyMap[t]),(e.ctrlKey?"Ctrl+":"")+(e.shiftKey?"Shift+":"")+(e.metaKey?"Meta+":"")+t},parseKey(e){const t=e.split("+");let a=t.pop();Object.keys(Player.hotkeys._keyMap).find((e=>Player.hotkeys._keyMap[e]===a&&(a=e)));const n={key:a};return t.forEach((e=>n[e.toLowerCase()+"Key"]=!0)),n}}},6431:(e,t,a)=>{var n=a(6325);const s=a(218),r=a(3980);e.exports={idx:0,audio:{},expandedNodes:[],mediaEvents:{ended:e=>Player.inline._movePlaying(e.currentTarget.dataset.id,+("one"!==Player.config.expandedRepeat)),pause:"controls.handleMediaEvent",play:"controls.handleMediaEvent",seeked:"controls.handleMediaEvent",waiting:"controls.handleMediaEvent",timeupdate:"controls.updateDuration",loadedmetadata:"controls.updateDuration",durationchange:"controls.updateDuration",volumechange:"controls.updateVolume"},initialize(){is4chan&&(Player.inline.observer=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach(Player.inline.handleAddedNode),e.removedNodes.forEach(Player.inline.handleRemovedNode)}))})),Player.on("config:playExpandedImages",Player.inline._handleConfChange),Player.on("config:playHoveredImages",Player.inline._handleConfChange),Player.inline._handleConfChange())},_handleConfChange(){Player.config.playExpandedImages||Player.config.playHoveredImages?Player.inline.start():Player.inline.stop()},handleAddedNode(e){try{if("IMG"!==e.nodeName&&"VIDEO"!==e.nodeName)return;const a=Player.config.playExpandedImages&&e.matches(s.expandedImage),l=Player.config.playHoveredImages&&e.matches(s.hoverImage);if(a||l){const o="VIDEO"===e.nodeName;let i;try{i=isChanX?e.dataset.fileID.split(".")[1]:(a?e:document.querySelector(`a[href$="${e.src.replace(/^https?:/,"")}"]`)).closest(s.posts).id.slice(s.postIdPrefix.length)}catch(h){return}let d=i&&Player.sounds.filter((e=>e.post===i&&!e.standaloneVideo))||[];if(Player.config.expandedAllowFiltered&&(d=d.concat(Player.filteredSounds.filter((e=>e.post===i&&!e.disallow.host)))),!d.length)return;const c=new Audio(d[0].src),p=c.dataset.id=Player.inline.idx++,y=o&&"video"===Player.config.expandedLoopMaster?e:c;Player.inline.audio[p]=c,Player.inline.expandedNodes.push(e),e.classList.add(`${ns}-has-inline-audio`),e._inlineAudio=c,c._inlinePlayer=e._inlinePlayer={master:y,video:e,isVideo:o,audio:c,sounds:d,index:0},o&&(e._linked=c,c._linked=e),c.src=d[0].src,c.volume=Player.audio.volume,c.currentTime=0,Player.inline.updateSyncListeners(y,"add");const u=a&&Player.config.expandedControls;function t(){delete e._inlinePlayer.pendingControls,e.parentNode.classList.add(`${ns}-has-controls`);const t=c._inlinePlayer.controls=n.element(r({audio:c,multiple:d.length>1,audioId:p,inline:!0,actions:{previous:`inline.previous("${p}")`,playPause:`inline.playPause("${p}")`,next:`inline.next("${p}")`,seek:`controls.handleSeek($event, "${p}")`,mute:`inline.mute("${p}")`,volume:`controls.handleVolume($event, "${p}")`}}),e.parentNode);t.addEventListener("click",(e=>{e.preventDefault(),e.stopPropagation()})),c.volumeBar=t.querySelector(`.${ns}-volume-bar .${ns}-current-bar`),c.currentTimeBar=t.querySelector(`.${ns}-seek-bar .${ns}-current-bar`),Player.controls.updateProgressBarPosition(c.volumeBar,c.volume,1)}o&&u&&(e.controls=!1,e.controlsObserver=new MutationObserver((()=>e.controls=!1)),e.controlsObserver.observe(e,{attributes:!0}),e.addEventListener("click",(()=>Player.inline.playPause(p)))),o&&(e.readyState<3||c.readyState<3)?(c.pause(),e.pause(),e._inlinePlayer.pendingControls=u&&t,e.addEventListener("canplaythrough",Player.actions.playOnceLoaded),c.addEventListener("canplaythrough",Player.actions.playOnceLoaded)):(u&&t(),c.play())}}catch(g){Player.logError("Failed to play sound.",g)}},handleRemovedNode(e){const t=[e];e.querySelectorAll&&t.push(...e.querySelectorAll(`.${ns}-has-inline-audio`)),t.forEach((e=>{e._inlineAudio&&Player.inline._removeForNode(e)}))},_removeForNode(e){e.controlsObserver&&e.controlsObserver.disconnect(),Player.inline.updateSyncListeners(e._inlinePlayer.master,"remove");const t=e._inlineAudio._inlinePlayer.controls;t&&(t.parentNode.classList.remove(`${ns}-has-controls`),t.parentNode.removeChild(t)),e._inlineAudio.pause(),delete Player.inline.audio[e._inlineAudio.dataset.id],delete e._inlineAudio,Player.inline.expandedNodes=Player.inline.expandedNodes.filter((t=>t!==e))},updateSyncListeners(e,t){if("VIDEO"===e.nodeName||"AUDIO"===e.nodeName){const a=e._inlineAudio||e;if("remove"===t){a._inlinePlayer.video.removeEventListener("canplaythrough",Player.actions.playOnceLoaded),a.removeEventListener("canplaythrough",Player.actions.playOnceLoaded)}Object.entries(Player.inline.mediaEvents).forEach((([a,n])=>{e[`${t}EventListener`](a,Player.getHandler(n))}))}},start(){Player.inline.observer.observe(document.body,{childList:!0,subtree:!0})},stop(){Player.inline.observer.disconnect(),Player.inline.expandedNodes.forEach(Player.inline._removeForNode),Player.inline.expandedNodes=[]},previous(e){const t=Player.inline.audio[e];t.currentTime>3?t.currentTime=0:Player.inline._movePlaying(e,-1)},next(e){Player.inline._movePlaying(e,1)},_movePlaying(e,t){const a=Player.inline.audio[e],n=a&&a._inlinePlayer,s=n.sounds.length,r=Player.config.expandedRepeat;if(n&&("none"!==r||n.index+t>=0&&n.index+t{var n=a(6325),s=a(4302);e.exports={_showingPIP:!1,initialize(){isChanX&&Player.userTemplate.maintain(Player.minimised,"chanXTemplate",["chanXControls"],["show","hide","stop"]),Player.on("rendered",Player.minimised.render),Player.on("show",Player.minimised.hidePIP),Player.on("hide",Player.minimised.showPIP),Player.on("stop",Player.minimised.hidePIP),Player.on("playsound",Player.minimised.showPIP)},render(){if(Player.container&&isChanX){let e=document.querySelector(`.${ns}-chan-x-controls`);if(e||(e=n.element(``,document.querySelector("#shortcuts"),"afterbegin")),"never"===Player.config.chanXControls||"closed"===Player.config.chanXControls&&!Player.isHidden)return e.innerHTML="";const t=Player.audio.dataset.id;n.elementHTML(e,Player.userTemplate.build({template:Player.config.chanXTemplate,location:"4chan-X-controls",sound:Player.playing,replacements:{"prev-button":`${s.skipStart} ${s.skipStartFill}`,"play-button":`${s.play} ${s.pause} ${s.playFill} ${s.pauseFill}`,"next-button":`${s.skipEnd} ${s.skipEndFill} `,"sound-current-time":`0:00`,"sound-duration":`0:00`}}))}},showPIP(){if(!Player.isHidden||!Player.config.pip||!Player.playing||Player.minimised._showingPIP)return;Player.minimised._showingPIP=!0;const e=document.querySelector(`.${ns}-image-link`);document.body.appendChild(e),e.classList.add(`${ns}-pip`),e.style.bottom=Player.position.getHeaderOffset().bottom+10+"px",e.style.height=null,e.addEventListener("click",Player.minimised._handleImageClick)},hidePIP(){Player.minimised._showingPIP=!1;const e=document.querySelector(`.${ns}-image-link`),t=Player.$(`.${ns}-controls`);t.parentNode.insertBefore(document.querySelector(`.${ns}-image-link`),t),e.classList.remove(`${ns}-pip`),e.style.bottom=null,e.style.height=Player.config.imageHeight+"px",e.removeEventListener("click",Player.minimised._handleImageClick)},_handleImageClick:e=>{e.preventDefault(),Player.show()}}},9200:(e,t,a)=>{var n=a(6325),s=a(4302);const{postIdPrefix:r}=a(218),l=a(3571),o=a(2663);e.exports={atRoot:["add","remove"],public:["search"],tagLoadTO:{},template:a(4837),listTemplate:a(4486),tagsDialogTemplate:a(8808),initialize(){Player.playlist._lastView="playlist"===Player.config.viewStyle||"image"===Player.config.viewStyle?Player.config.viewStyle:"playlist",Player.on("view",(e=>{"playlist"===e&&Player.playlist.scrollToPlaying(),"playlist"!==e&&"image"!==e||(Player.playlist._lastView=e)})),Player.on("rendered",Player.playlist.afterRender),Player.on("playsound",(e=>{Player.playlist.showImage(e),Player.$all(`.${ns}-list-item.playing, .${ns}-list-item[data-id="${Player.playing.id}"]`).forEach((e=>{const t=Player.playlist.listTemplate({sounds:[Player.sounds.find((t=>t.id===e.dataset.id))]});n.element(t,e,"beforebegin"),e.parentNode.removeChild(e)})),"fullscreen"!==Player.config.viewStyle&&Player.playlist.scrollToPlaying("nearest"),Player.config.autoScrollThread&&e.post&&(location.href=location.href.split("#")[0]+"#"+r+e.post),Player.playlist.loadTags(Player.playing.id)})),Player.on("stop",(()=>{Player.$all(`.${ns}-list-item.playing`).forEach((e=>e.classList.remove("playing")));const e=Player.$(`.${ns}-image-link`);e.href="#",Player.$(`.${ns}-background-image`).src=Player.video.src="",Player.$(`.${ns}-image`).src=`data:image/svg+xml;base64,${btoa(s.fcSounds)}`,e.classList.remove(`${ns}-show-video`)})),Player.on("config:filters",Player.playlist.applyFilters),Player.on("config:allow",Player.playlist.applyFilters),Player.on("config:hoverImages",Player.playlist.setHoverImageVisibility),Player.on("menu-open",Player.playlist.setHoverImageVisibility),Player.on("menu-close",Player.playlist.setHoverImageVisibility),Player.on("config:showPlaylistSearch",Player.playlist.toggleSearch),Player.on("config:shuffle",Player.playlist._handleShuffle),Player.on("tags-loaded",(e=>{const t=Player.$(`.tags-dialog[data-sound-id="${e.id}"]`);t&&n.elementHTML(t,Player.playlist.tagsDialogTemplate(e))})),Player.on("config:imageHeight",(e=>Player.$(`.${ns}-image-link`).style.height=e+"px")),Player.on(["playsound","order"],(()=>{const e=Player.sounds[(Player.sounds.indexOf(Player.playing)+1)%Player.sounds.length];e&&Player.playlist.preload(e)})),Player.userTemplate.maintain(Player.playlist,"rowTemplate",["shuffle"]),Player.playlist.imageResizeObserver=new ResizeObserver(Player.playlist.resizeTransBG)},render(){n.elementHTML(Player.$(`.${ns}-list-container`),Player.playlist.listTemplate()),Player.playlist.afterRender()},afterRender(){Player.playlist.image=Player.$(`.${ns}-image`),Player.playlist.transparentImageBG=Player.$(`.${ns}-image-transparent-bg`),Player.playlist.hoverImage=Player.$(`.${ns}-hover-image`),Player.playlist.imageResizeObserver.disconnect(),Player.playlist.imageResizeObserver.observe(Player.playlist.image),Player.playlist.image.onload=Player.playlist.resizeTransBG},restore(){Player.display.setViewStyle(Player.playlist._lastView||"playlist")},showImage(e){const t=document.querySelector(`.${ns}-image-link`),a=t.querySelector(`.${ns}-image`),n=t.querySelector(`.${ns}-background-image`);a.src=n.src="",a.src=n.src=e.imageOrThumb,Player.isVideo&&(Player.video.src=e.image),"fullscreen"!==Player.config.viewStyle&&(t.href=e.image),t.classList[Player.isVideo?"add":"remove"](ns+"-show-video")},resizeTransBG(){const e=Player.playlist.image.width/Player.playlist.image.height,t=Player.playlist.image.naturalWidth/Player.playlist.image.naturalHeight,a=Player.playlist.transparentImageBG;a.style.width=Math.min(t/e*100,100)+"%",a.style.height=Math.min(e/t*100,100)+"%"},toggleView(e){e&&e.preventDefault();let t="playlist"===Player.config.viewStyle?"image":"image"===Player.config.viewStyle?"playlist":Player.playlist._lastView;Player.display.setViewStyle(t)},add(e,t){try{const a=e.id;if(Player.sounds.find((e=>e.id===a)))return;let s=Player.config.shuffle?Math.floor(Math.random()*Player.sounds.length-1):Player.sounds.findIndex((e=>Player.compareIds(e.id,a)>1));if(s<0&&(s=Player.sounds.length),Player.sounds.splice(s,0,e),Player.container){if(!t){const t=Player.$(`.${ns}-list-container`);let a=n.element(`
    ${Player.playlist.listTemplate({sounds:[e]})}
    `);if(s!e.standaloneVideo)).length&&Player.show(),Player.trigger("add",e)}}catch(t){Player.logError("There was an error adding to the sound player. Please check the console for details.",t),console.log("[4chan sounds player]",e)}},addFromDrop(e){for(let t of e.dataTransfer.items){const e=t.getAsEntry?t.getAsEntry():t.webkitGetAsEntry();e&&Player.playlist._scanEntry(e)}},_scanEntry:e=>e.isDirectory?Player.playlist._readEntries(e.createReader()):e.file((e=>Player.playlist.addFromFiles([e]))),_readEntries(e){e.readEntries((t=>{t.length&&(t.forEach(Player.playlist._scanEntry),Player.playlist._readEntries(e))}))},addFromFiles(e){[...e].forEach((e=>{if(!e.type.startsWith("image")&&"video/webm"!==e.type)return;const t=URL.createObjectURL(e),a=e.type;let n=t;if("video/webm"!==e.type)return o();const s=document.createElement("canvas"),r=document.createElement("video"),l=s.getContext("2d");function o(){const{sounds:s}=Player.posts.getSounds(e.name,t,null,n,null,!0);s.forEach((e=>Player.add({...e,local:!0,type:a})))}r.addEventListener("seeked",(function(){s.width=r.videoWidth,s.height=r.videoHeight,l.drawImage(r,0,0,r.videoWidth,r.videoHeight),n=s.toDataURL(),o()})),r.src=t,r.currentTime=.001}))},selectLocalFiles(){Player.$(`.${ns}-add-local-file-input`).click()},remove(e){"object"!=typeof e&&(e=Player.sounds.find((t=>t.id===""+e)));const t=Player.sounds.indexOf(e);Player.playing===e&&Player.next({force:!0,paused:Player.audio.paused}),t>-1&&Player.sounds.splice(t,1);const a=e&&Player.$(`.${ns}-list-item[data-id="${e.id}"]`);a&&Player.$(`.${ns}-list-container`).removeChild(a),e&&Player.trigger("remove",e)},toggleRepeat(){const e=["all","one","none"],t=e.indexOf(Player.config.repeat);Player.set("repeat",e[(t+4)%3])},toggleShuffle(){Player.set("shuffle",!Player.config.shuffle)},_handleShuffle(){if(Player.config.shuffle){const e=Player.sounds;for(let t=e.length-1;t>0;t--){const a=Math.floor(Math.random()*(t+1));[e[t],e[a]]=[e[a],e[t]]}}else Player.sounds.sort(((e,t)=>Player.compareIds(e.id,t.id)));Player.trigger("order")},handleSelect(e){if("A"===e.target.nodeName||e.target.closest("a"))return;const t=e.currentTarget.getAttribute("data-id"),a=t&&Player.sounds.find((e=>e.id===t));a&&Player.play(a)},handleItemMenu(e,t){const a=Player.sounds.find((e=>e.id===t)),s=e.currentTarget.closest(`.${ns}-list-container`)||Player.container,l=o({sound:a,postIdPrefix:r}),i=n.element(l,s),d=e.currentTarget.classList.contains(`${ns}-item-menu-button`)?e.currentTarget:e;Player.display.showMenu(d,i,s)},toggleHoverImages(e){e&&e.preventDefault(),Player.set("hoverImages",!Player.config.hoverImages)},setHoverImageVisibility(){const e=Player.$(`.${ns}-player`),t=!Player.config.hoverImages||Player.playlist._dragging||e.querySelector(`.${ns}-menu`);e.classList[t?"add":"remove"](`${ns}-hide-hover-image`)},updateHoverImage(e){const t=e.currentTarget.getAttribute("data-id"),a=Player.sounds.find((e=>e.id===t));Player.playlist.hoverImage.style.display="block",Player.playlist.hoverImage.setAttribute("src",a.thumb),Player.playlist.positionHoverImage(e)},positionHoverImage(e){const{width:t,height:a}=Player.playlist.hoverImage.getBoundingClientRect(),n=document.documentElement.clientWidth-t-5;Player.playlist.hoverImage.style.left=Math.min(e.clientX,n)+5+"px",Player.playlist.hoverImage.style.top=e.clientY-a-10+"px"},removeHoverImage(){Player.playlist.hoverImage.style.display="none"},handleDragStart(e){Player.playlist._dragging=e.currentTarget,Player.playlist.setHoverImageVisibility(),e.currentTarget.classList.add(`${ns}-dragging`);const t=document.createElement("img");t.src="data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",t.opacity=0,e.dataTransfer.setDragImage(t,0,0),e.dataTransfer.dropEffect="move",e.dataTransfer.setData("text/plain",e.currentTarget.getAttribute("data-id"))},handleDragEnter(e){if(!Player.playlist._dragging)return;const t=Player.playlist._dragging,a=t.getAttribute("data-id");let n=e.target.closest&&e.target.closest(`.${ns}-list-item`);if(!n||t===n)return;const s=Player.sounds.findIndex((e=>e.id===a)),r=t.parentNode;if(4&t.compareDocumentPosition(n)&&(n=n.nextElementSibling),n){const e=n.getAttribute("data-id"),a=Player.sounds.findIndex((t=>t.id===e)),l=s{e.disallow=Player.disallowedSound(e),e.disallow&&(Player.playlist.remove(e),Player.filteredSounds.push(e),Player.posts.updateButtons(e.post))})),Player.filteredSounds.forEach(((e,t)=>{e.disallow=Player.disallowedSound(e),e.disallow||(Player.filteredSounds.splice(t,1),Player.playlist.add(e),Player.posts.updateButtons(e.post))})),Player.trigger("filters-applied")},addFilter(e){e&&Player.set("filters",Player.config.filters.concat(e))},_handleSearch(e){Player.playlist.search(e.currentTarget.value.toLowerCase())},search(e){const t=Player.playlist._lastSearch;Player.playlist._lastSearch=e,e!==t&&Player.playlist.render()},matchesSearch(e){const t=Player.playlist._lastSearch;return!t||e.title.toLowerCase().includes(t)||e.post&&String(e.post.toLowerCase()).includes(t)||String(e.src.toLowerCase()).includes(t)},toggleSearch(e){const t=Player.$(`.${ns}-playlist-search`);!e&&Player.playlist._lastSearch&&Player.playlist.search(),t.style.display=e?null:"none",e&&t.focus()},loadTags(e){const t=Player.sounds.find((t=>t.id===e));function a(e){t.tags=e&&Object.entries(e.tags||{}).reduce(((e,[t,a])=>("string"==typeof a&&(e[t]=a),e)),{}),Player.trigger("tags-loaded",t)}t.tags||(Player.playlist.tagLoadTO[e]=setTimeout((()=>{const e=new jsmediatags.Reader(t.src);e._findFileReader().prototype._createXHRObject=()=>new l.GM,e.read({onSuccess:a,onError:a})}),150))},abortTags(e){clearTimeout(Player.playlist.tagLoadTO[e]),delete Player.playlist.tagLoadTO[e]},expandImageStart(e){0!==e.button||Player.isHidden||"playlist"!==Player.config.viewStyle||(Player.$(`.${ns}-image-link`).style.cursor="ns-resize",Player._imageResizeStartY=(e.touches&&e.touches[0]||e).clientY,Player._imageResizeStartHeight=Player.config.imageHeight,Player._imageResized=!1,Player._imageReizeMaxHeight=Player.$(`.${ns}-player`).getBoundingClientRect().height-Player.$(`.${ns}-controls`).getBoundingClientRect().height)},expandImage(e){if(!Player.isHidden&&"playlist"===Player.config.viewStyle){Player._imageResized=!0;const t=(e.touches&&e.touches[0]||e).clientY,a=Player._imageResizeStartHeight+t-Player._imageResizeStartY;Player.$(`.${ns}-image-link`).style.height=Math.min(Math.max(125,a),Player._imageReizeMaxHeight)+"px"}},setImageHeight(){if(!Player.isHidden&&"playlist"===Player.config.viewStyle){Player.$(`.${ns}-image-link`).style.cursor=null;const e=Player.$(`.${ns}-image-link`),t=parseInt(e.style.height),a=Player.$(`.${ns}-player`).getBoundingClientRect().height-Player.$(`.${ns}-controls`).getBoundingClientRect().height,n=Math.max(125,Math.min(t,a));e.style.height=n+"px",Player.set("imageHeight",n)}},expandImageClick(e){!Player.isHidden&&"playlist"===Player.config.viewStyle&&Player._imageResized&&e.preventDefault()},async preload(e){if(e.preloading)return;e.preloading=!0;const t=e.image.endsWith(".webm")||"video/webm"===e.type;await Promise.all([!e.standaloneVideo&&new Promise((t=>{const a=new Audio;a.addEventListener("canplaythrough",t),a.addEventListener("error",t),a.src=e.src})),t&&new Promise((t=>{const a=document.createElement("video");a.addEventListener("canplaythrough",t),a.addEventListener("error",t),a.src=e.image}))]),e.preloading=!1}}},2473:(e,t,a)=>{const n=a(218);e.exports={initialize(){const{top:e,bottom:t}=Player.position.getHeaderOffset();Player.config.offsetTop=e+"px",Player.config.offsetBottom=t+"px",Player.on("show",(async function(){const[e,t]=(await GM.getValue("position")||"").split(":"),[a,n]=(await GM.getValue("size")||"").split(":");+a&&+n&&Player.position.resize(a,n,!0),+e&&+t&&Player.position.move(e,t),Player.config.limitPostWidths&&(Player.position.setPostWidths(),window.addEventListener("scroll",Player.position.setPostWidths))})),Player.on("hide",(function(){Player.position.setPostWidths(),window.removeEventListener("scroll",Player.position.setPostWidths)})),Player.on("config",(e=>{"limitPostWidths"!==e&&"minPostWidth"!==e||(window.removeEventListener("scroll",Player.position.setPostWidths),Player.position.setPostWidths(),Player.config.limitPostWidths&&window.addEventListener("scroll",Player.position.setPostWidths))})),new MutationObserver((function(){document.querySelectorAll("#hoverUI .postContainer, .inline .postContainer, .backlink_container article").forEach((e=>{e.style.maxWidth=null,e.style.minWidth=null}))})).observe(document.body,{childList:!0,subtree:!0}),Player.syncTab("position",(e=>Player.position.move(...e.split(":").concat(!0)))),Player.syncTab("size",(e=>Player.position.resize(...e.split(":"))))},setPostWidths(){const e=document.documentElement.clientWidth-Player.container.offsetLeft+10,t=!Player.isHidden&&Player.config.limitPostWidths,a=Player.container.offsetTop,s=Player.container.getBoundingClientRect().height+a;document.querySelectorAll(n.limitWidthOf).forEach((n=>{const r=t&&n.getBoundingClientRect(),l=t&&r.top+r.height>a&&r.topdocument.documentElement.clientWidth&&(e.style.left=a.left+a.width-n+"px"),a.top+a.height+s>document.documentElement.clientHeight-Player.position.getHeaderOffset().bottom&&(e.style.top=a.top-s+"px")}}},1:(e,t,a)=>{var n=a(6325);const s=a(218),r=a(5463),l=/^(https?:)?\/\//,o=new RegExp("(.*?)[[({]("+Object.keys(r).join("|")+")[ =:|$](.*?)[\\])}]","gi");let i=0;e.exports={addPosts(e,t){let a=!1;(e.classList.contains("post")?[e]:e.querySelectorAll(s.posts)).forEach((e=>Player.posts.addPost(e,t)&&(a=!0))),a&&t&&Player.container&&Player.playlist.render()},addPost(e,t){try{let a=e.parentElement,n=a&&a.parentElement;if(e.classList.contains("style-fetcher")||n&&"qp"===n.id||a&&a.classList.contains("noFile"))return;const r=e.id.slice(s.postIdPrefix.length);let l=e.querySelector(`.${ns}-play-link`),o=e.querySelector(`.${ns}-unfilter-link`);if(l||o)return l&&Player.events.apply(l),void(o&&Player.events.apply(o));let i=null,d=s.filename;if(Object.keys(d).some((function(t){const a=e.querySelector(t);return a&&(i=a[d[t]])})),!i)return;s.filenameParser&&(i=s.filenameParser(i));const c=e.querySelector(s.thumb).closest("a"),p=c&&c.href,y=c&&c.querySelector("img"),u=y&&y.src,h="Fuuka"===Site?e.querySelector(":scope > br + a").href.split("/").pop():y&&y.getAttribute("data-md5");"HO0kbeZNQqBye1CF7Tq7hg=="===h&&e.innerHTML.includes("[futari no christmas]")&&(i="futari no christmas[sound=files.catbox.moe/ahvi2c.opus]");const{sounds:g,filtered:m}=Player.posts.getSounds(i,p,r,u,h);return(g.length||m.length)&&(g.forEach((e=>Player.add(e,t))),m.forEach((e=>Player.filteredSounds.push(e))),Player.posts.updateButtons(r),m.length&&Player.trigger("filters-applied")),g.length>0}catch(t){Player.logError("There was an issue parsing the files. Please check the console for details.",t),console.log("[4chan sounds player]",e)}},getSounds(e,t,a,n,s,d){if(!e)return{sounds:[],filtered:[]};const c=t.endsWith("webm")?n:t,p=[];let y;for(;null!==(y=o.exec(e));)p.push(y);p.length||"always"!==Player.config.addWebm&&("soundBoards"!==Player.config.addWebm||"gif"!==Board&&"wsg"!==Board)||!e.endsWith(".webm")||p.push([null,e.slice(0,-5),t]);const u=p[0]&&p[0][1]||a||"Local Sound "+i;return p.length&&!a&&i++,p.reduce((({sounds:o,filtered:y},h,g)=>{let m=h[2],v=h[3];const f=(a||"local"+i)+":"+g,P=h[1].trim(),$=P||u+(p.length>1?` (${g+1})`:""),w=v===t;try{r[m].decode?(v.includes("%")&&(v=decodeURIComponent(v)),v.startsWith("blob:")||null!==v.match(l)||(v=location.protocol+"//"+v)):v=location.protocol+r[m].filepath+v}catch(e){return{sounds:o,filtered:y}}const b={src:v,id:f,title:$,name:P,post:a,image:t,imageOrThumb:c,filename:e,thumb:n,imageMD5:s,standaloneVideo:w};return b.disallow=!d&&Player.disallowedSound(b),b.disallow?b.disallow.invalid||y.push(b):o.push(b),{sounds:o,filtered:y}}),{sounds:[],filtered:[]})},refresh(){Player.posts.addPosts(document.body)},updateButtons(e){const t=document.getElementById(s.postIdPrefix+e);if(t){const a=s.playLink,r=a.relative&&t.querySelector(a.relative);let l=r.parentNode.querySelector(`.${ns}-unfilter-link`);const o=Player.posts.getFilters(e);if(o.host.length||o.image||o.sound.length){t.classList.add("filtered-sound");const s=[o.image&&"image",o.sound.length&&"sound"].filter(Boolean).join(" and "),i=(o.host.length>1?`The hosts ${o.host.join(", ")} are not allowed`:"")+(1===o.host.length?`The host ${o.host[0]} is not allowed`:"")+(s?`${o.host.length?", and the":"The"} player filters disallow this ${s}`:"")+". Click to allow and add to the player.";l?l.dataset.content=i:n.element(""+(a.prependText||"")+`${a.unfilterText||""}`+(a.appendText||"")+"",r,a.position)}else t.classList.remove("filtered-sound"),l&&l.parentNode.parentNode.removeChild(l.parentNode),l&&l.infoEl&&l.infoEl.parentNode.removeChild(l.infoEl);let i=t.querySelector(`.${ns}-play-link`);const d=Player.sounds.find((t=>t.post===e));i&&!d?i.parentNode.parentNode.removeChild(i.parentNode):!i&&d&&n.element(""+(a.prependText||"")+`${a.text||""}`+(a.appendText||"")+"",r,a.position)}},getFilters:e=>Player.filteredSounds.reduce(((t,a)=>(a.post===e&&(t.host=t.host.concat(a.disallow.host||[]),t.image=t.image||a.disallow.image,t.sound=t.sound.concat(a.disallow.sound||[])),t)),{host:[],image:!1,sound:[]}),allowPost(e){const t=Player.posts.getFilters(e);t.host.length&&Player.set("allow",Player.config.allow.concat(t.host)),(t.image||t.sound.length)&&Player.set("filters",Player.config.filters.filter((e=>e!==t.image&&!t.sound.find((t=>e.replace(/^(https?:)?\/\//,"")===t)))))}}},3378:(e,t,a)=>{var n=a(6325);const s=a(9480),r=200,l=200;e.exports={initialize(){Player.on("menu-close",(e=>e._input&&delete e._input._colorpicker))},create(e){const t=e.currentTarget.parentNode,a="INPUT"===e.currentTarget.nodeName?e.currentTarget:t.querySelector("input"),o=t.querySelector(`.${ns}-cp-preview`);if(!a||a._colorpicker)return;Player.display.closeDialogs();const i=Player.colorpicker.parseRGB(window.getComputedStyle(o).backgroundColor),d=n.element(s({HEIGHT:r,WIDTH:l,rgb:i}),t);Player.position.showRelativeTo(d,a),a._colorpicker=d,d._input=a,d._colorpicker={hsv:[0,1,1,1],rgb:i},Player.colorpicker.updateOutput(d)},hueMove(e){const t=e.currentTarget.closest(`.${ns}-colorpicker`),a=Math.max(0,e.clientY-e.currentTarget.getBoundingClientRect().top);t._colorpicker.hsv[0]=a/r;const n=Player.colorpicker.hsv2rgb(t._colorpicker.hsv[0],1,1,1);t.querySelector(`.${ns}-cp-saturation`).style.background=`linear-gradient(to right, white, rgb(${n[0]}, ${n[1]}, ${n[2]}))`,e.currentTarget.querySelector(".position").style.top=Math.max(-3,a-6)+"px",Player.colorpicker.updateOutput(t,!0)},satMove(e){const t=e.currentTarget.closest(`.${ns}-colorpicker`),a=e.currentTarget.querySelector(".position"),n=Math.max(0,e.clientX-e.currentTarget.getBoundingClientRect().left),s=Math.max(0,e.clientY-e.currentTarget.getBoundingClientRect().top);t._colorpicker.hsv[1]=n/l,t._colorpicker.hsv[2]=1-s/r,a.style.top=Math.min(197,Math.max(-3,s-6))+"px",a.style.left=Math.min(197,Math.max(-3,n-5))+"px",Player.colorpicker.updateOutput(t,!0)},inputRGBA(e){const t=e.currentTarget.closest(`.${ns}-colorpicker`);t._colorpicker.rgb[+e.currentTarget.getAttribute("data-color")]=e.currentTarget.value,Player.colorpicker.updateOutput(t)},updateOutput(e,t){const a=t?["hsv","rgb"]:["rgb","hsv"];e._colorpicker[a[1]]=Player.colorpicker[`${a[0]}2${a[1]}`](...e._colorpicker[a[0]]);const[n,s,o,i]=e._colorpicker.rgb;if(t)e.querySelector(`.${ns}-rgb-input[data-color="0"]`).value=n,e.querySelector(`.${ns}-rgb-input[data-color="1"]`).value=s,e.querySelector(`.${ns}-rgb-input[data-color="2"]`).value=o,e.querySelector(`.${ns}-rgb-input[data-color="3"]`).value=i;else{const[t,a,n]=e._colorpicker.hsv,s=e.querySelector(`.${ns}-cp-hue .position`),o=e.querySelector(`.${ns}-cp-saturation .position`),i=Player.colorpicker.hsv2rgb(t,1,1,1);e.querySelector(`.${ns}-cp-saturation`).style.background=`linear-gradient(to right, white, rgb(${i[0]}, ${i[1]}, ${i[2]}))`,s.style.top=r*t-3+"px",o.style.left=a*l-3+"px",o.style.top=(1-n)*l-3+"px"}e.querySelector(".output-color").style.background=`rgb(${n}, ${s}, ${o}, ${i})`},apply(e){const t=e.currentTarget.closest(`.${ns}-colorpicker`),[a,n,s,r]=t._colorpicker.rgb,l=t._input;l.value=`rgb(${a}, ${n}, ${s}, ${r})`,delete l._colorpicker,t.parentNode.removeChild(t),l.focus(),l.blur()},parseRGB(e){const t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?\)/);return[+t[1]||0,+t[2]||0,+t[3]||0,isNaN(+t[4])?1:t[4]]},hsv2rgb(e,t,a,n){const s=Math.floor(6*e),r=6*e-s,l=a*(1-t),o=a*(1-r*t),i=a*(1-(1-r)*t),d=s%6,c=[a,o,l,l,i,a][d],p=[i,a,a,o,l,l][d],y=[l,l,i,a,a,o][d];return[Math.round(255*c),Math.round(255*p),Math.round(255*y),n||1]},rgb2hsv(e,t,a,n){const s=Math.max(e,t,a),r=Math.min(e,t,a),l=s-r,o=0===s?0:l/s,i=s/255;let d;switch(s){case r:d=0;break;case e:d=t-a+l*(t{function n(e){try{return new URL(e.replace(/%s/,"sound").replace(/^(https?\/\/)?/,"https://")),!0}catch(e){return!1}}e.exports={template:a(8210),fields:{name:"Name",url:"URL",responsePath:"Response Path",responseMatch:"Response Match",soundUrl:"File URL Format"},parse(e,t,a){t={...t};const s=a.currentTarget.closest(`.${ns}-host-input`);let r=s.getAttribute("data-host-name"),l=t[r]={...t[r]};const o=a.currentTarget.getAttribute("name");try{if("name"===o&&e!==r){if(!e||t[e])throw new PlayerError("A unique name for the host is required.","warning");s.setAttribute("data-host-name",e),t[e]=l,delete t[r],r=e}if(("url"===o||"soundUrl"===o&&e)&&!n(e))throw new PlayerError("The value must be a valid URL.","warning");if("data"===o)try{e=JSON.parse(e)}catch(e){throw new PlayerError("The data must be valid JSON.","warning")}if("headers"===o)try{e=e?JSON.parse(e):void 0}catch(e){throw new PlayerError("The headers must be valid JSON.","warning")}}catch(e){throw l.invalid=!0,s.classList.add("invalid"),e}void 0===e?delete l[o]:l[o]=e;try{const e=s.querySelector("[name=soundUrl]").value,t=s.querySelector("[name=headers]").value;!(r&&JSON.parse(s.querySelector("[name=data]").value)&&n(s.querySelector("[name=url]").value))||e&&!n(e)||t&&!JSON.parse(t)||(delete l.invalid,s.classList.remove("invalid"))}catch(e){}return t},add(){let e,t="New Host";for(e="";Player.config.uploadHosts[`${t}${e}`];e=" "+ ++e);const a={[`${t}${e}`]:{invalid:!0,data:{file:"$file"}},...Player.config.uploadHosts};Player.settings.set("uploadHosts",a,{bypassValidation:!0,silent:!0})},remove(e){const t=Player.config.uploadHosts,a=e.currentTarget.closest(`.${ns}-host-input`),n=a.getAttribute("data-host-name");Player.settings.findDefault("uploadHosts").default[n]?t[n]=null:delete t[n],a.parentNode.removeChild(a),Player.settings.set("uploadHosts",t,{bypassValidation:!0,bypassRender:!0})},setDefault(e,t,a){const n=a.currentTarget.closest(`.${ns}-host-input`).getAttribute("data-host-name");return n===Player.config.defaultUploadHost||Object.keys(Player.config.uploadHosts).forEach((e=>{const t=Player.$(`.${ns}-host-input[data-host-name="${e}"] input[data-property="defaultUploadHost"]`);t&&(t.checked=e===n)})),n},restoreDefaults(){Object.assign(Player.config.uploadHosts,Player.settings.findDefault("uploadHosts").default),Player.set("uploadHosts",Player.config.uploadHosts,{bypassValidation:!0})}}},6279:(e,t,a)=>{var n=a(6325);const s=a(5303),r=a(851),l=a(780);e.exports={asdf:"asdf",atRoot:["set"],public:["set","export","import","reset","load"],hosts:l,template:a(1262),settingTemplate:a(1555),inputTemplates:{checkbox:a(1470),input:a(1691),select:a(9045),textarea:a(8475)},changelog:"https://github.com/rcc11/4chan-sounds-player/releases",groups:s.reduce(((e,t)=>(t.displayGroup&&(e[t.displayGroup]||(e[t.displayGroup]=[]),e[t.displayGroup].push(t)),e)),{}),async initialize(){Player.settings.view="Display",Player.theme.applyBoardTheme({bypassRender:!0}),await Player.settings.load(await GM.getValue("settings")||{},{applyDefault:!0,bypassAll:!0}),Player.config.showUpdatedNotification&&Player.config.VERSION&&"3.5.5"!==Player.config.VERSION&&Player.alert(`4chan Sounds Player has been updated to version 3.5.5.`),Player.on("hide",(function(){Player.config.pauseOnHide&&Player.pause()})),Player.syncTab("settings",(e=>Player.settings.load(e,{bypassSave:!0,applyDefault:!0,ignore:["viewStyle"]}))),Player.on("rendered",Player.settings.setChangeListeners)},render(){const e=Player.$(`.${ns}-settings`);n.elementHTML(e,Player.settings.template()),Player.settings.setChangeListeners()},renderSetting(e){const t=Player.$(`.${ns}-setting[data-property="${e.property}"]`),a=n.element(Player.settings.settingTemplate(e),t,"beforebegin");t.parentNode.removeChild(t),Player.settings.setChangeListeners(a)},set(e,t,{bypassAll:a,bypassValidation:s,bypassSave:r,bypassRender:l,silent:o,bypassStylesheet:i,settingConfig:d}={}){d=d||Player.settings.findDefault(e);const c=n.get(Player.config,e);if(s||!n.isEqual(c,t))return n.set(Player.config,e,t),a||(!i&&d&&d.updateCSSVars&&Player.display.updateCSSVars(),!o&&Player.trigger("config",e,t,c),!o&&Player.trigger("config:"+e,t,c),!r&&Player.settings.save(),!l&&d.displayGroup&&Player.settings.renderSetting(d),(!l||"self"===l)&&d.dependentRender&&d.dependentRender.forEach((e=>Player.settings.renderSetting(Player.settings.findDefault(e))))),[c,t]},reset(e,t){let a=Player.settings.findDefault(e);Player.set(e,a.default,{...t,settingConfig:a})},async load(e,t={}){"string"==typeof e&&(e=JSON.parse(e));const a={};s.forEach((function s(r){if(r.settings)return r.settings.forEach((e=>s({property:r.property,default:r.default,...e})));if(t.ignore&&t.ignore.includes(r.property))return;let l=n.get(e,r.property,t.applyDefault?r.default:void 0);if(void 0!==l){r.mix&&(l={...r.default,...l||{}});const e=Player.set(r.property,l,{bypassAll:!0,settingConfig:r});e&&(a[r.property]=e)}})),Object.entries(await Player.settings.migrate(e.VERSION)).forEach((([e,[t,n]])=>{a[e]=[a[e]?a[e][1]:t,n]})),t.bypassAll||(!t.bypassStylesheet&&Player.display.updateCSSVars(),!t.silent&&Object.entries(a).forEach((([e,[t,a]])=>{Player.trigger("config",e,a,t),Player.trigger("config:"+e,a,t)})),!t.bypassSave&&Player.settings.save(),!t.bypassRender&&Player.settings.render())},save(){try{const e=s.reduce((function e(t,a){if(a.settings)a.settings.forEach((n=>e(t,{property:a.property,default:a.default,...n})));else{let e=n.get(Player.config,a.property);void 0===e||n.isEqual(e,a.default)||(a.mix&&(e=Object.keys(e).reduce(((t,s)=>(n.isEqual(a.default[s],e[s])||(t[s]=e[s]),t)),{})),n.set(t,a.property,e))}return t}),{});return e.viewStyle=Player.playlist._lastView,e.VERSION="3.5.5",GM.setValue("settings",JSON.stringify(e))}catch(e){Player.logError("There was an error saving the sound player settings.",e)}},async migrate(e){if(!e||"3.5.5"===e)return{};const t={};for(let a=0;a{t[e]=[a,t[e]?t[e][1]:n]}))}catch(e){console.error(e)}}return t},compareVersions(e,t){const[a,n]=e.split("-"),[s,r]=t.split("-"),l=a.split("."),o=s.split(".");for(let e=0;e<3;e++){if(+l[e]>+o[e])return 1;if(+l[e]<+o[e])return-1}return n!==r},findDefault(e){let t;return s.find((function(a){if(a.property===e)return t=a;if(a.settings){let n=a.settings.find((t=>t.property===e));return n&&(t={...a,actions:null,settings:null,description:null,...n,isSubSetting:!0})}return!1})),t||{property:e}},toggle(e){let t=Player.$(`.${ns}-settings :focus`);if(t&&t.blur(),!e&&"settings"===Player.config.viewStyle)return Player.playlist.restore();"settings"!==Player.config.viewStyle&&Player.display.setViewStyle("settings"),e&&e!==Player.settings.view&&Player.settings.showGroup(e)},showGroup(e){Player.settings.view=e;const t=Player.$(`.${ns}-settings-group.active`),a=Player.$(`.${ns}-settings-tab.active`);t&&t.classList.remove("active"),a&&a.classList.remove("active"),Player.$(`.${ns}-settings-group[data-group="${e}"]`).classList.add("active"),Player.$(`.${ns}-settings-tab[data-group="${e}"]`).classList.add("active")},async import(){const e=n.element(''),t=async()=>{let a;try{a=await(await fetch(URL.createObjectURL(e.files[0]))).json()}catch(t){Player.logError(`Expected a JSON config file and got ${e.files[0].type}.`,t,"warning")}e.removeEventListener("change",t),Player.settings.load(a)};e.addEventListener("change",t),e.click()},async export(e){const t=e&&e.shiftKey?JSON.stringify(Player.config,null,4):await GM.getValue("settings")||"{}",a=new Blob([t],{type:"application/json"}),s=n.element(``);s.click(),URL.revokeObjectURL(s.href)},setChangeListeners(e){const t=e||Player.$(`.${ns}-settings`);t.querySelectorAll(`.${ns}-settings input, .${ns}-settings textarea`).forEach((e=>{e.addEventListener("focusout",Player.settings.handleChange)})),t.querySelectorAll(`.${ns}-settings input[type=checkbox], .${ns}-settings select`).forEach((e=>{e.addEventListener("change",Player.settings.handleChange)}))},handleChange(e){try{const t=e.currentTarget,a=t.getAttribute("data-property");if(!a)return;let s=Player.settings.findDefault(a);const r=n.get(Player.config,a);let l=t["checkbox"===t.getAttribute("type")?"checked":"value"];s.parse&&(l=Player.getHandler(s.parse)(l,r,e)),n.isEqual(r,l,!s.looseCompare)||Player.set(a,l,{bypassValidation:!0,bypassRender:"self",settingConfig:s})}catch(e){Player.logError("There was an error updating the setting.",e)}},handleKeyChange(e){e.preventDefault(),"Shift"!==e.key&&"Control"!==e.key&&"Meta"!==e.key&&(e.currentTarget.value=8===e.which||"backspace"===e.key.toLowerCase()?"":Player.hotkeys.stringifyKey(e))}}},2475:(e,t,a)=>{var n=a(6325);const s=a(218),r=a(5303),l=a(5080);e.exports={public:["switch","next","previous"],savedThemesTemplate:a(6305),themeKeybindsTemplate:a(3038),async initialize(){Player.theme.render(),Player.userTemplate.maintain(Player.theme,"customCSS"),Player.theme.validateOrder()},render(){Player.userStylesheet=Player.userStylesheet||n.element('',document.head),Player.userStylesheet.innerHTML=Player.userTemplate.build({template:"/* Sounds Player User CSS */\n\n"+Player.config.customCSS,sound:Player.playing,ignoreButtons:!0,ignoreDisplayBlocks:!0,ignoreSoundName:!0,ignoreVersion:!0})},forceBoardTheme(){Player.theme.applyBoardTheme({force:!0}),Player.settings.save()},applyBoardTheme(e={}){const t=n.element(`
    `,document.body),a=document.defaultView.getComputedStyle(t);if("rgba(0, 0, 0, 0)"===a.backgroundColor)return setTimeout(Player.display.applyBoardTheme,0);Object.assign(a,{page_background:window.getComputedStyle(document.body).backgroundColor});const l={"colors.text":a.color,"colors.background":a.backgroundColor,"colors.odd_row":a.backgroundColor,"colors.border":a.borderBottomColor,"colors.even_row":a.borderBottomColor===a.color?a.backgroundColor:a.borderBottomColor,"colors.page_background":window.getComputedStyle(document.body).backgroundColor,"colors.playing":(()=>{const e=Player.colorpicker.rgb2hsv(...Player.colorpicker.parseRGB(a.backgroundColor)),t=Player.colorpicker.hsv2rgb(e[0],Math.min(1,e[1]+.25),Math.min(1,e[2]+.15));return`rgb(${t[0]}, ${t[1]}, ${t[2]})`})()};r.find((e=>"colors"===e.property)).settings.forEach((t=>{const a=e.force||t.default===n.get(Player.config,t.property);l[t.property]&&(t.default=l[t.property]),a&&Player.set(t.property,t.default,{bypassSave:!0,bypassRender:!0,bypassStylesheet:!0})})),document.body.removeChild(t),e.bypassRender||(Player.display.updateCSSVars(),Player.settings.render())},next(){const e=["Default"].concat(Player.config.savedThemesOrder),t=e.indexOf(Player.config.selectedTheme),a=e[(t+e.length+1)%e.length];Player.theme.switch(a)},previous(){const e=["Default"].concat(Player.config.savedThemesOrder),t=e.indexOf(Player.config.selectedTheme),a=e[(t+e.length-1)%e.length];Player.theme.switch(a)},switch(e){if("Default"!==e&&!Player.config.savedThemes[e])return Player.logError(`Theme '${e}' does not exist.`,null,"warning");Player.set("selectedTheme",e),"Default"===e?(["headerTemplate","footerTemplate","rowTemplate","chanXTemplate","customCSS"].forEach((e=>{Player.settings.reset(e,{bypassRender:!0,bypassStylesheet:!0})})),Player.settings.render(),Player.display.updateCSSVars()):Player.settings.load(Player.config.savedThemes[e])},validateOrder(){const e=Player.config.savedThemesOrder;let t;Player.config.savedThemesOrder=e.concat(Object.keys(Player.config.savedThemes)).filter(((a,n)=>Player.config.savedThemes[a]&&(t=e.indexOf(a),-1===t||t===n)))},parseSwitch(e,t,a){t=[...t];const n=a.currentTarget.parentNode.dataset.name;"Default"===n||Player.config.savedThemes[n]||Player.logError(`No theme named '${n}'.`,null,"warning");const s=Player.hotkeys.parseKey(e);if(s.key){let e=t.find((e=>e.themeName===n));e||t.push(e={themeName:n}),Object.assign(e,s)}else t=t.filter((e=>e.themeName!==n));return t},handleSwitch(e){Player.theme.switch(e._binding.themeName)},moveUp:e=>Player.theme._swapOrder(e,-1),moveDown:e=>Player.theme._swapOrder(e,1),_swapOrder(e,t){const a=e.currentTarget.closest("[data-theme]").dataset.theme,n=Player.config.savedThemesOrder,s=n.indexOf(a);s+t>=0&&s+te!==n)),a.parentNode.removeChild(a),Player.settings.set("savedThemes",t,{bypassValidation:!0,bypassRender:!0});const s=Player.config.hotkey_bindings.switchTheme.find((e=>e.themeName===n));s&&Player.set("hotkey_bindings.switchTheme",Player.config.hotkey_bindings.switchTheme.splice(s,1),{bypassValidation:!0})},restoreDefaults(){Object.assign(Player.config.savedThemes,Player.settings.findDefault("savedThemes").default),Player.theme.validateOrder(),Player.set("savedThemes",Player.config.savedThemes,{bypassValidation:!0})},showSaveOptions(e){const t=Player.$(`.${ns}-theme-save-options`);if(t)return Player.container.removeChild(t);const a=n.element(l({settingsConfig:r}),Player.container);Player.position.showRelativeTo(a,e.currentTarget),Player.$(`.${ns}-save-theme-name`).focus()},toggleSaveFields(){Player.$(`.${ns}-theme-save-options`).classList.toggle("fields-collapsed"),Player.position.showRelativeTo(Player.$(`.${ns}-theme-save-options`),Player.$('[\\@click^="theme.showSaveOptions"]'))},toggleSaveButtonText(e){Player.$(`.${ns}-save-theme`).innerHTML=Player.config.savedThemes[e.currentTarget.value]?"Update":"Create"},save(){const e=Player.$(`.${ns}-save-theme-name`).value;if(!e)return Player.logError("A name is required to save a theme.",null,"warning");const t=[...Player.$all(`.${ns}-theme-save-options input:checked`)].reduce(((e,t)=>n.set(e,t.value,n.get(Player.config,t.value))),{});Player.config.savedThemes[e]=t,-1===Player.config.savedThemesOrder.indexOf(e)&&Player.config.savedThemesOrder.push(e),Player.set("savedThemes",Player.config.savedThemes,{bypassValidation:!0}),Player.container.removeChild(Player.$(`.${ns}-theme-save-options`))}}},1469:e=>{e.exports={"Fixed Playlist":{chanXControls:"always",headerTemplate:'
    \nrepeat-button shuffle-button hover-images-button playlist-button\nsound-title-marquee\nview-menu-button add-button theme-menu-button close-button',rowTemplate:'sound-title\np:{}\n',customCSS:'/* Fix the player to the right at full height (minus the 4chan X header) */\n#fcsp-container[data-view-style="playlist"] {\n\t/* Fixed width *\\/\n\twidth: 25rem !important;/**/\n\theight: auto !important;\n\ttop: $config[offsetTop] !important;\n\tright: 0px !important;\n\tbottom: $config[offsetBottom] !important;\n\tleft: auto !important;\n\theight: auto !important;\n\tmax-height: calc(100% - 24px);\n\tbackground: none !important;\n\tborder: none !important;\n}\n\n/* Hide things when the playlist is open */\n/* Hide the image with the playlist open, unless it\'s a webm.\n * To show gifs as well change playing-video to playing-animated. */\n#fcsp-container[data-view-style="playlist"]:not(.playing-video) .fcsp-image-link,/**/ \n#fcsp-container[data-view-style="playlist"] .fcsp-controls,\n#fcsp-container[data-view-style="playlist"] .fcsp-hover-image,\n#fcsp-container[data-view-style="playlist"] .fcsp-footer,\n#fcsp-container[data-view-style="fullscreen"] .fcsp-row-thumb,\n#fcsp-container[data-view-style="fullscreen"] .fcsp-row-image {\n\tdisplay: none !important;\n}\n/* Header is shown with adjustments to handle the changed container style */\n/* Opacity and absolute position are used to auto hide the header */\n#fcsp-container[data-view-style="playlist"] .fcsp-header {\n\tposition: absolute !important;\n\topacity: 0;\n\tz-index: 9;\n\tcursor: inherit;\n\tbackground: $config[colors.background];\n\tborder-width: 0 1px 1px 0;\n\ttransition: all .3s ease;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-header:hover {\n\topacity: 1;\n}\n\n/* Don\'t show a scrollbar for the playlist for aesthetic reasons */\n#fcsp-container[data-view-style="playlist"] .fcsp-under-image {\n\tscrollbar-width: none;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-under-image::-webkit-scrollbar {\n\tdisplay: none;\n}\n\n/* Chunky playlist items, with no background and a squared thumbnail image. */\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item {\n\tbackground: none !important;\n\theight: auto !important;\n\tline-height: initial;\n\ttext-align: right;\n\talign-items: center;\n\ttransition: all .5s ease;\n\tfont-size: 1rem;\n\tcolor: $config[colors.text];\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-row-thumb, #fcsp-container[data-view-style="playlist"] .fcsp-row-image {\n\theight: 3rem;\n\twidth: 3rem;\n\tobject-fit: cover;\n\ttransition: all .5s ease;\n}\n/* Show a gradient background and increase the size of list items when you hover over them. */\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item:hover {\n\tfont-size: 1.5rem;\n\tfont-weight: bold;\n\tbackground-image: radial-gradient(circle at -50%, #0000 70%, $config[colors.odd_row]) !important;\n\tcolor: $config[colors.background];\n\t-webkit-text-stroke: 1px black;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item:hover .fcsp-row-thumb {\n\theight: 4rem;\n\twidth: 4rem;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-row-image {\n\theight: 7rem;\n\twidth: 7rem;\n}\n/* Add a gradient background to the playing item, make the text bigger, and style the text. */\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item.playing {\n\tbackground-image: radial-gradient(circle at -50%, #0000 70%, $config[colors.playing]) !important;\n\tpadding-left: 2px;\n\tfont-weight: bold;\n\tfont-size: 1.5rem;\n\tcolor: $config[colors.page_background];\n\t-webkit-text-stroke: 1px black;\n\ttext-shadow: 0 0 2px $config[colors.border];\n}\n/* Swap the thumb image with the full image for the playing item. */\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item:not(.playing) .fcsp-row-image {\n\tdisplay: none;\n}\n#fcsp-container[data-view-style="playlist"] .fcsp-list-item.playing .fcsp-row-thumb {\n\tdisplay: none;\n}\n/* Same gradient background style for dragging items. */\n#fcsp-container[data-view-style="playlist"] .fcsp-dragging {\n\tbackground-image: radial-gradient(circle at -50%, #0000 70%, $config[colors.dragging]) !important\n}\n\n/* Add a resizer to the left of the header when the playlist is open. */\n.playlist-resizer {\n\topacity: 1 !important;\n\tmargin: 0 !important;\n\twidth: .25rem !important;\n\theight: auto !important;\n\tbackground-color: $config[colors.border] !important;\n\tposition: absolute;\n\tleft: -.25rem !important;\n\ttop: 0 !important;\n\tbottom: 0 !important;\n\tborder-radius: 100% 0 0 100%;\n\tcursor: ew-resize !important;\n\tdisplay: none;\n\ttransition: all .5s ease;\n}\n.playlist-resizer:hover {\n\twidth: .4rem !important;\n\tleft: -.4rem !important;\n}\n#fcsp-container[data-view-style="playlist"] .playlist-resizer {\n\tdisplay: block;\n}\n/* Hide the default resizers */\n#fcsp-container[data-view-style="playlist"] .fcsp-expander:not(.playlist-resizer) {\n\tdisplay: none;\n}\n'}}},591:(e,t,a)=>{var n=a(6325);const{get:s}=a(6672);e.exports={template:a(7870),boardsTemplate:a(6844),listsTemplate:a(1675),boardList:null,soundThreads:null,displayThreads:{},selectedBoards:Board?[Board]:["a"],showAllBoards:!1,async initialize(){Player.threads.hasParser=is4chan&&"undefined"!=typeof Parser,Player.threads.hasParser&&!Parser.customSpoiler&&(Parser.customSpoiler={}),Player.on("show",Player.threads._initialFetch),Player.on("view",Player.threads._initialFetch),Player.on("rendered",Player.threads.afterRender),Player.on("config:threadsViewStyle",Player.threads.render);try{const e=await GM.getValue("threads_board_selection");e&&(Player.threads.selectedBoards=e.split(","))}catch(e){}},_initialFetch(){Player.container&&"threads"===Player.config.viewStyle&&null===Player.threads.boardList&&(Player.threads.fetchBoards(!0),Player.off("show",Player.threads._initialFetch),Player.off("view",Player.threads._initialFetch))},render(){Player.container&&(n.elementHTML(Player.$(`.${ns}-threads`),Player.threads.template()),Player.threads.afterRender())},afterRender(){const e=Player.$(`.${ns}-thread-list`);if(e){const t=document.defaultView.getComputedStyle(document.body);e.style.background=t.backgroundColor,e.style.backgroundImage=t.backgroundImage,e.style.backgroundRepeat=t.backgroundRepeat,e.style.backgroundPosition=t.backgroundPosition}Player.threads.renderThreads()},renderThreads(){if(Player.threads.hasParser&&"table"!==Player.config.threadsViewStyle)try{const e=Player.$(`.${ns}-thread-list`);e.innerHTML="";for(let t in Player.threads.displayThreads){const a=Player.threads.boardList.find((e=>e.board===t)),s=`/${a.board}/ - ${a.title}`;n.element(`
    ${s}
    `,e);const r=Player.threads.displayThreads[t];for(let t=0;t',e)}}catch(e){Player.logError("Unable to display the threads board view.",e,"warning"),Player.set("threadsViewStyle","table"),Player.renderThreads()}else n.elementHTML(Player.$(`.${ns}-threads-body`),Player.threads.listsTemplate())},renderBoards(){n.elementHTML(Player.$(`.${ns}-thread-board-list`),Player.threads.boardsTemplate())},toggle(){"threads"===Player.config.viewStyle?Player.playlist.restore():Player.display.setViewStyle("threads")},toggleBoardList(){Player.threads.showAllBoards=!Player.threads.showAllBoards,Player.$(`.${ns}-all-boards-link`).innerHTML=Player.threads.showAllBoards?"Selected Only":"Show All",Player.threads.renderBoards()},async toggleBoard(e,t){t?!Player.threads.selectedBoards.includes(e)&&Player.threads.selectedBoards.unshift(e):Player.threads.selectedBoards=Player.threads.selectedBoards.filter((t=>t!==e)),await GM.setValue("threads_board_selection",Player.threads.selectedBoards.slice(0,10).join(","))},async fetchBoards(e){Player.threads.loading=!0,Player.threads.render(),Player.threads.boardList=(await s("https://a.4cdn.org/boards.json")).boards,e?Player.threads.fetch():(Player.threads.loading=!1,Player.threads.render())},async fetch(){if(Player.threads.loading=!0,Player.threads.render(),!Player.threads.boardList)try{await Player.threads.fetchBoards()}catch(e){return Player.logError("Failed fetching the boards list.",e)}const e=[];try{await Promise.all(Player.threads.selectedBoards.map((async t=>{const a=Player.threads.boardList.find((e=>e.board===t));if(!a)return;(a&&await s("https://a.4cdn.org/%s/catalog.json".replace("%s",t))||[]).forEach((({page:n,threads:s})=>{e.push(...s.map((e=>Object.assign(e,{board:t,page:n,ws_board:a.ws_board}))))}))}))),Player.threads.soundThreads=e.filter((e=>{const{sounds:t}=Player.posts.getSounds(e.filename,`https://i.4cdn.org/${e.board}/${e.tim}${e.ext}`,e.no,`https://i.4cdn.org/${e.board}/${e.tim}s${e.ext}`,e.md5,!0);return t.length}))}catch(e){Player.logError("Failed searching for sounds threads.",e)}Player.threads.loading=!1,Player.threads.filter(Player.$(`.${ns}-threads-filter`).value,!0),Player.threads.render()},filter(e,t){e=e.toLowerCase(),Player.threads.filterValue=e||"",null!==Player.threads.soundThreads&&(Player.threads.displayThreads=Player.threads.soundThreads.reduce(((t,a)=>((!e||a.sub&&a.sub.toLowerCase().includes(e)||a.com&&a.com.toLowerCase().includes(e))&&(t[a.board]||(t[a.board]=[]),t[a.board].push(a)),t)),{}),!t&&Player.threads.renderThreads())}}},8433:(e,t,a)=>{var n=a(6325),s=a(4302);const r=a(4859),l=a(9103),o=e.exports={_uploadIdx:0,createTemplate:a(5257),createHostsTemplate:l,createCompleteTemplate:r,initialize(){Player.on("config:uploadHosts",(()=>Player.$(`.${ns}-create-hosts-container`).innerHTML=l())),Player.on("config:defaultUploadHost",(e=>Player.$(`.${ns}-create-sound-host`).value=e)),Player.on("rendered",o.afterRender)},afterRender(){o.status=Player.$(`.${ns}-create-sound-status`),Player.tools.imgInput=Player.$(`.${ns}-create-sound-img`),Player.tools.sndInput=Player.$(`.${ns}-create-sound-snd`)},async handleImageSelect(e){const t=(e&&e.currentTarget||Player.tools.imgInput).files[0];let a=t.name.replace(/\.[^/.]+$/,"");await Player.tools.hasAudio(t)&&Player.logError("Audio not allowed for the image webm.",null,"warning"),Player.$(`.${ns}-create-sound-name`).setAttribute("placeholder",a)},handleFileSelect(e,t){const a=e.closest(`.${ns}-file-input`),r=a.querySelector(".text"),l=a.querySelector(`.${ns}-file-list`);t||(t=[...e.files]),a.classList[t.length?"remove":"add"]("placeholder"),r.innerHTML=t.length>1?t.length+" files":t[0]&&t[0].name||"",l&&n.elementHTML(l,t.length<2?"":t.map(((e,t)=>`
    \n\t\t\t\t
    ${e.name}
    \n\t\t\t\t${s.close}\n\t\t\t
    `)).join(""))},handleFileRemove(e){const t=+e.currentTarget.getAttribute("data-idx"),a=e.currentTarget.closest(`.${ns}-file-input`).querySelector('input[type="file"]'),n=new DataTransfer;for(let e=0;e{const a=e.type.startsWith("video"),n=e.type.startsWith("image")||"video/webm"===e.type,s=e.type.startsWith("audio");if(a||n||s){const a="video/webm"===e.type&&t?t:n?Player.tools.imgInput:Player.tools.sndInput,s=new DataTransfer;a.multiple&&[...a.files].forEach((e=>s.items.add(e))),s.items.add(e),a.files=s.files,Player.tools.handleFileSelect(a),a===Player.tools.imgInput&&Player.tools.handleImageSelect(),a===Player.tools.sndInput&&Player.tools.useSoundURL&&Player.tools.toggleSoundInput("file")}})),!1},async handleCreate(){Player.tools._createdImageURL&&URL.revokeObjectURL(Player.tools._createdImageURL),Player.tools._createdImage=null,o.status.style.display="block",o.status.innerHTML="Creating sound image",Player.$(`.${ns}-create-button`).disabled=!0;const e=Player.config.uploadHosts[Player.$(`.${ns}-create-sound-host`).value],t=Player.tools.useSoundURL;let a=Player.tools.imgInput.files[0],s=t&&Player.$(`.${ns}-create-sound-snd-url`).value.split(",").map((e=>e.trim())).filter((e=>e)),l=(Player.$(`.${ns}-use-video`)||{}).checked&&a&&a.type.startsWith("video")?a&&[a]:[...Player.tools.sndInput.files];const i=Player.$(`.${ns}-create-sound-name`).value,d=i?((s||l).length>1?i.split(","):[i]).map((e=>e.trim())):a&&[a.name.replace(/\.[^/.]+$/,"")];try{if(!a)throw new PlayerError("Select an image or webm.","warning");if(a.type.startsWith("video")&&await Player.tools.hasAudio(a))throw o.status.innerHTML+="
    Audio not allowed for the image webm.
    Remove the audio from the webm and try again.",new PlayerError("Audio not allowed for the image webm.","warning");const i=d.join("").length+8*(s||l).length;if(t){try{s=s.map((e=>new URL(e)&&e.replace(/^(https?:)?\/\//,"")))}catch(e){throw new PlayerError("The provided sound URL is invalid.","warning")}if(2188)throw new PlayerError("The generated image filename is too long.","warning");l=await Promise.all(l.map((async e=>{if(e.type.startsWith("video")&&!await Player.tools.hasAudio(e))throw new PlayerError(`The selected video has no audio. (${e.name})`,"warning");return e})));try{s=await Promise.all(l.map((async t=>Player.tools.postFile(t,e))))}catch(e){throw new PlayerError("Upload failed.","error",e)}}if(!s.length)throw new PlayerError("No sounds selected.","warning");let c="";for(let e=0;eFailed! "+(e instanceof PlayerError?e.reason:""),Player.logError("Failed to create sound image",e)}Player.$(`.${ns}-create-button`).disabled=!1},hasAudio:e=>!(!e.type.startsWith("audio")&&!e.type.startsWith("video"))&&new Promise(((t,a)=>{const n=URL.createObjectURL(e),s=document.createElement("video");s.addEventListener("loadeddata",(()=>{URL.revokeObjectURL(n),t(s.mozHasAudio||!!s.webkitAudioDecodedByteCount)})),s.addEventListener("error",a),s.src=n})),async postFile(e,t){const a=Player.tools._uploadIdx++;if(!t||t.invalid)throw new PlayerError("Invalid upload host.","error");const s=new FormData;return Object.keys(t.data).forEach((a=>{null!==t.data[a]&&s.append(a,"$file"===t.data[a]?e:t.data[a])})),o.status.innerHTML+=`
    Uploading ${e.name}`,new Promise(((r,l)=>{GM.xmlHttpRequest({method:"POST",url:t.url,data:s,responseType:t.responsePath?"json":"text",headers:t.headers,onload:async s=>{if(s.status<200||s.status>=300)return l(s);const o=t.responsePath?n.get(s.response,t.responsePath):t.responseMatch?(s.responseText.match(new RegExp(t.responseMatch))||[])[1]:s.responseText,i=(t.soundUrl?t.soundUrl.replace("%s",o):o).trim();Player.$(`.${ns}-upload-status-${a}`).innerHTML=`Uploaded ${e.name} to ${i}`,r(i)},upload:{onprogress:t=>{const n=t.total>0?t.total:e.size;Player.$(`.${ns}-upload-status-${a}`).innerHTML=`Uploading ${e.name} - ${Math.floor(t.loaded/n*100)}%`}},onerror:l})}))},addCreatedToPlayer(){Player.playlist.addFromFiles([Player.tools._createdImage])},addCreatedToQR(){if(!is4chan)return;const e=document.querySelector(isChanX?".qr-link":".open-qr-link"),t=new DataTransfer;if(t.items.add(Player.tools._createdImage),isChanX&&e){e.click();const a=new CustomEvent("drop",{view:window,bubbles:!0,cancelable:!0});a.dataTransfer=t,document.querySelector("#qr").dispatchEvent(a)}else e?(e.click(),document.querySelector("#qrFile").files=t.files):(document.querySelector("#togglePostFormLink a").click(),document.querySelector("#postFile").files=t.files,document.querySelector(".postForm").scrollIntoView())}}},6533:(e,t,a)=>{var n=a(6325);const s=a(5563),r=(e,t)=>{let a,n=new Promise(((n,s)=>{a=GM.xmlHttpRequest({method:"GET",url:e,responseType:"blob",onload:e=>n(e.response),onerror:e=>s(e),onabort:e=>{e.aborted=!0,s(e)},...t||{}})}));return t&&t.catch&&(n=n.catch(t.catch)),n.abort=a.abort,n},l=e.exports={downloadTemplate:a(4805),_downloading:null,initialize(){Player.on("rendered",l.afterRender)},afterRender(){l.resetDownloadButtons()},async _handleDownloadCancel(){Player.tools._downloading&&(Player.tools._downloadAllCanceled=!0,Player.tools._downloading.forEach((e=>e.forEach((e=>e&&e.abort())))))},async _handleDownload(e){Player.tools._downloadAllCanceled=!1,e.currentTarget.style.display="none",Player.$(`.${ns}-download-all-cancel`).style.display=null,await Player.tools.downloadThread({includeImages:Player.$(".download-all-images").checked,includeSounds:Player.$(".download-all-audio").checked,ignoreDownloaded:Player.$(".download-all-ignore-downloaded").checked,maxSounds:+Player.$(".download-all-max-sounds").value||0,concurrency:Math.max(1,+Player.$(".download-all-concurrency").value||1),compression:Math.max(0,Math.min(+Player.$(".download-all-compression").value||0,9)),status:Player.$(`.${ns}-download-all-status`)}).catch((()=>{})),Player.tools.resetDownloadButtons()},resetDownloadButtons(){Player.$(`.${ns}-download-all-start`).style.display=Player.tools._downloading?"none":null,Player.$(`.${ns}-download-all-cancel`).style.display=Player.tools._downloading?null:"none",Player.$(`.${ns}-download-all-save`).style.display=Player.tools.threadDownloadBlob?null:"none",Player.$(`.${ns}-download-all-clear`).style.display=Player.tools.threadDownloadBlob?null:"none",Player.$(`.${ns}-ignore-downloaded`).style.display=Player.sounds.some((e=>e.downloaded))?null:"none"},async download(e,t){try{const a=await r(e),s=n.element(``);s.click(),URL.revokeObjectURL(s.href)}catch(e){Player.logError("There was an error downloading.",e,"warning")}},async downloadThread({includeImages:e,includeSounds:t,ignoreDownloaded:a,maxSounds:l,concurrency:o,compression:i,status:d}){const c=new JSZip;!(l>0)&&(l=1/0);const p=Player.sounds.filter((e=>e.post&&(!a||!e.downloaded))).slice(0,l),y=p.length;if(d&&(d.style.display="block"),!y||!e&&!t)return d&&(d.innerHTML="Nothing to download.");Player.tools._downloading=[],d&&(d.innerHTML=`Downloading ${y} sound images.

    \n\t\t\tThis may take a while. You can leave it running in the background, but if you background the tab your browser will slow it down.\n\t\t\tYou'll be prompted to download the zip file once complete.

    `);const u=new Array(o).fill(0).map((()=>{const a=d&&n.element(s({includeSounds:t,includeImages:e}),d),r=[];return Player.tools._downloading.push(r),a&&(a.querySelector(`.${ns}-cancel-download`).onclick=()=>r.forEach((e=>e&&e.abort()))),{dlRef:r,el:a,status:a&&a.querySelector(`.${ns}-current-status`),image:a&&a.querySelector(`.${ns}-image-bar`),sound:a&&a.querySelector(`.${ns}-sound-bar`)}}));let h=0;const g=(e,t,a)=>({responseType:"arraybuffer",onprogress:e[a]&&(t=>e[a].style.width=t.loaded/t.total*100+"%"),catch:e=>{if(e.aborted)return"aborted";e.aborted||Player.tools._downloadAllCanceled||(console.error("[4chan sounds player] Download failed",e),d&&n.element(`

    Failed to download ${t.title} ${a}!

    `,u[0].el,"beforebegin"))}});await Promise.all(u.map((async function a(s){const l=p.shift();if(!l||Player.tools._downloadAllCanceled)return void(s.el&&d.removeChild(s.el));const o=++h;s.el&&(s.status.textContent=`${o} / ${y}: ${l.title}`,s.image.style.width=s.sound.style.width="0");const i=e&&t?l.post+"/":"",[m,v]=await Promise.all([s.dlRef[0]=e&&r(l.image,g(s,l,"image")),s.dlRef[1]=t&&r(l.src,g(s,l,"sound"))]);Player.tools._downloadAllCanceled||("aborted"===m||"aborted"===v?d&&n.element(`

    Skipped ${l.title}.

    `,u[0].el,"beforebegin"):(m&&c.file(`${i}${l.filename}`,m),v&&c.file(`${i}${encodeURIComponent(l.src)}`,v),l.downloaded=!0)),await a(s)}))),Player.tools._downloadAllCanceled&&n.element(`Canceled at ${h} / ${y}.`,d);const m=d&&n.element("
    Generating zip file...
    ",d);try{const e={type:"blob",compression:i?"DEFLATE":"STORE",compressionOptions:{level:i}};Player.tools.threadDownloadBlob=await c.generateAsync(e,(e=>{d&&(m.textContent=`Generating zip file (${e.percent.toFixed(2)}%)...`)})),d&&n.element("Complete!",d),Player.tools.saveThreadDownload()}catch(e){console.error("[4chan sounds player] Failed to generate zip",e),d&&(m.textContent="Failed to generate zip file!")}Player.tools._downloading=null,Player.tools.resetDownloadButtons()},saveThreadDownload(){const e=Thread||"-",t=n.element(``);t.click(),URL.revokeObjectURL(t.href)},clearDownloadBlob(){delete Player.tools.threadDownloadBlob,Player.tools.resetDownloadButtons()}}},5305:(e,t,a)=>{var n=a(6325);const s=a(8433),r=a(6533);e.exports={template:a(2230),...s,...r,initialize(){s.initialize(),r.initialize()},render(){n.elementHTML(Player.$(`.${ns}-tools`).innerHTML,Player.tools.template()),s.afterRender(),r.afterRender()},toggle(){"tools"===Player.config.viewStyle?Player.playlist.restore():Player.display.setViewStyle("tools")},handleDecoded(e){Player.$(`.${ns}-encoded-input`).value=encodeURIComponent(e.currentTarget.value)},handleEncoded(e){Player.$(`.${ns}-decoded-input`).value=decodeURIComponent(e.currentTarget.value)}}},5535:(e,t,a)=>{var n=a(4302),s=a(6325);const{postIdPrefix:r}=a(218);e.exports=[{property:"repeat",tplName:"repeat",action:"playlist.toggleRepeat",actionMods:".prevent",values:{all:{attrs:['title="Repeat All"'],icon:n.arrowRepeat},one:{attrs:['title="Repeat One"'],icon:n.arrowClockwise},none:{attrs:['title="No Repeat"'],class:"muted",icon:n.arrowRepeat}}},{property:"shuffle",tplName:"shuffle",action:"playlist.toggleShuffle",actionMods:".prevent",values:{true:{attrs:['title="Shuffled"'],icon:n.shuffle},false:{attrs:['title="Ordered"'],class:"muted",icon:n.shuffle}}},{property:"viewStyle",tplName:"playlist",action:"playlist.toggleView",values:{default:{attrs:['title="Player"'],class:"muted",icon:()=>"playlist"===Player.playlist._lastView?n.arrowsExpand:n.arrowsCollapse},playlist:{attrs:['title="Hide Playlist"'],icon:n.arrowsExpand},image:{attrs:['title="Show Playlist"'],icon:n.arrowsCollapse}}},{property:"hoverImages",tplName:"hover-images",action:"playlist.toggleHoverImages",values:{true:{attrs:['title="Hover Images Enabled"'],icon:n.image},false:{attrs:['title="Hover Images Disabled"'],class:"muted",icon:n.image}}},{tplName:"add",action:"playlist.selectLocalFiles",actionMods:".prevent",icon:n.plus,attrs:['title="Add local files"']},{tplName:"reload",action:"posts.refresh",actionMods:".prevent",icon:n.reboot,attrs:['title="Reload the playlist"']},{property:"viewStyle",tplName:"settings",action:"settings.toggle()",actionMods:".prevent",icon:n.gear,attrs:['title="Settings"'],values:{default:{class:"muted"},settings:{}}},{property:"viewStyle",tplName:"threads",action:"threads.toggle",actionMods:".prevent",icon:n.search,attrs:['title="Threads"'],values:{default:{class:"muted"},threads:{}}},{property:"viewStyle",tplName:"tools",action:"tools.toggle",actionMods:".prevent",icon:n.tools,attrs:['title="Tools"'],values:{default:{class:"muted"},tools:{}}},{tplName:"close",action:"hide",actionMods:".prevent",icon:n.close,attrs:['title="Hide the player"']},{tplName:"playing",requireSound:!0,action:'playlist.scrollToPlaying("center")',actionMods:".prevent",icon:n.musicNoteList,attrs:['title="Scroll the playlist to the currently playing sound."']},{tplName:"post",requireSound:!0,icon:n.chatRightQuote,showIf:e=>e.sound.post,attrs:e=>["href="+("#"+r+e.sound.post),'title="Jump to the post for the current sound"']},{tplName:"image",requireSound:!0,icon:n.image,attrs:e=>[`href=${e.sound.image}`,'title="Open the image in a new tab"','target="_blank"']},{tplName:"sound",requireSound:!0,icon:n.soundwave,attrs:e=>[`href=${e.sound.src}`,'title="Open the sound in a new tab"','target="_blank"']},{tplName:/dl-(image|sound)/,requireSound:!0,action:e=>{const t=e.sound["image"===e.tplNameMatch[1]?"image":"src"],a=e.sound["image"===e.tplNameMatch[1]?"filename":"name"]||"";return`tools.download("${s.escAttr(t,!0)}", "${s.escAttr(a,!0)}")`},actionMods:".prevent",icon:e=>"image"===e.tplNameMatch[1]?n.fileEarmarkImage:n.fileEarmarkMusic,attrs:e=>[`title="${"image"===e.tplNameMatch[1]?"Download the image with the original filename":"Download the sound"}"`]},{tplName:/filter-(image|sound)/,requireSound:!0,action:e=>`playlist.addFilter("${"image"===e.tplNameMatch[1]?e.sound.imageMD5:e.sound.src.replace(/^(https?:)?\/\//,"")}")`,actionMods:".prevent",icon:n.filter,showIf:e=>"sound"===e.tplNameMatch[1]||e.sound.imageMD5,attrs:e=>[`title="Add the ${"image"===e.tplNameMatch[1]?"image MD5":"sound URL"} to the filters."`]},{tplName:"remove",requireSound:!0,action:e=>`remove("${e.sound.id}")`,icon:n.trash,attrs:e=>['title="Filter the image."',`data-id="${e.sound.id}"`]},{tplName:"menu",requireSound:!0,class:`${ns}-item-menu-button`,action:e=>`playlist.handleItemMenu($event, "${e.sound.id}")`,actionMods:".prevent.stop",icon:n.chevronDown},{tplName:"view-menu",action:'display.showMenu($event.currentTarget, "views")',actionMods:".prevent.stop",icon:n.chevronDown,attrs:['title="Switch View"']},{tplName:"theme-menu",action:'display.showMenu($event.currentTarget, "themes")',actionMods:".prevent.stop",icon:n.layoutTextWindow,attrs:['title="Switch Theme"']},{tplName:"untz",action:"display.untz",icon:n.speaker,attrs:['title="UNTZ"']}]},3722:(e,t,a)=>{var n=a(6325);const s=a(5535),r=/p: ?{([^}]*)}/g,l=/h: ?{([^}]*)}/g,o=s.map((e=>`${e.tplName.source&&e.tplName.source.replace(/\(/g,"(?:")||e.tplName}`)),i=new RegExp(`(${o.join("|")})-(?:button|link)(?:\\:"([^"]+?)")?`,"g"),d=/sound-title/g,c=/sound-title-marquee/g,p=/sound-index/g,y=/sound-count/g,u=/sound-(src|id|name|post|imageOrThumb|image|thumb|filename|imageMD5)(-esc)?/g,h=/filtered-count/g,g=/\$config\[([^\]]+)\]/g,m=[];e.exports={buttons:s,initialize(){Player.on("config",Player.userTemplate._handleConfig),Player.on("playsound",(()=>Player.userTemplate._handleEvent("playsound"))),["add","remove","order","show","hide","stop"].forEach((e=>{Player.on(e,Player.userTemplate._handleEvent.bind(null,e))}))},build(e){const t=e.outerClass||"",a=e.sound&&e.sound.title||e.defaultName;let s={...e};const o=e=>"function"==typeof e?e(s):e;let m=e.template.replace(g,((...e)=>n.get(Player.config,e[1])));if(!e.ignoreDisplayBlocks&&(m=m.replace(r,Player.playing&&Player.playing===e.sound?"$1":"").replace(l,`$1`)),!e.ignoreButtons&&(m=m.replace(i,(function(a,r,l){let i=Player.userTemplate._findButtonConf(r);if(s.tplNameMatch=i.tplNameMatch,i.requireSound&&!e.sound||i.showIf&&!i.showIf(s))return"";if(i.values){i={...i,...i.values[n.get(Player.config,i.property)]||i.values[Object.keys(i.values)[0]]}}const d=[...o(i.attrs)||[]];return d.some((e=>e.startsWith("href")))||d.push('href="javascript:;"'),(i.class||t)&&d.push(`class="${i.class||""} ${t||""}"`),i.action&&d.push(`@click${i.actionMods||""}='${o(i.action)}'`),`${l&&l.replace(/ /g," ")||o(i.icon)||o(i.text)}`}))),!e.ignoreSoundName&&(m=m.replace(c,a?`
    ${a}
    `:"").replace(d,a?`
    ${a}
    `:"")),!e.ignoreSoundProperties&&(m=m.replace(u,((...t)=>e.sound?t[2]?n.escAttr(e.sound[t[1]],!0):e.sound[t[1]]:"")).replace(p,e.sound?Player.sounds.indexOf(e.sound)+1:0).replace(y,Player.sounds.length).replace(h,Player.filteredSounds.length)),!e.ignoreVersion&&(m=m.replace(/%v/g,"3.5.5")),e.replacements)for(let t of Object.keys(e.replacements))m=m.replace(new RegExp(t,"g"),e.replacements[t]);return m},maintain(e,t,a=[],n=[]){m.push({component:e,property:t,...Player.userTemplate.findDependencies(t,null),alwaysRenderConfigs:a,alwaysRenderEvents:n})},findDependencies(e,t){t||(t=n.get(Player.config,e));const a=[],s=y.test(t),l=d.test(t)||u.test(t),o=p.test(t),c=r.test(t),m=h.test(t);s&&a.push("add","remove"),"rowTemplate"!==e&&(l||o||c)&&a.push("playsound","stop"),o&&a.push("order"),m&&a.push("filters-applied");const v=[];let f;for(;null!==(f=i.exec(t));)if(!f[2]){let e=Player.userTemplate._findButtonConf(f[1]);e.property&&v.push(e.property)}for(;null!==(f=g.exec(t));)v.push(f[1]);return{events:a,config:v}},_handleConfig(e,t){m.forEach((a=>{a.property===e&&(Object.assign(a,Player.userTemplate.findDependencies(e,t)),a.component.render())})),m.forEach((t=>{(t.alwaysRenderConfigs.includes(e)||t.config.includes(e))&&t.component.render()}))},_handleEvent(e){m.forEach((t=>{(t.alwaysRenderEvents.includes(e)||t.events.includes(e))&&t.component.render()}))},_findButtonConf:e=>{let t,a=s.find((a=>t=a.tplName===e?[e]:a.tplName.test&&e.match(a.tplName)));return a&&{...a,tplNameMatch:t}}}},1277:e=>{e.exports=[{property:"autoshow",default:!0,title:"Autoshow",description:"Automatically show the player when the thread contains sounds.",displayGroup:"Display"},{property:"pauseOnHide",default:!0,title:"Pause On Hide",description:"Pause the player when it's hidden.",displayGroup:"Display",allowInTheme:!0},{property:"showUpdatedNotification",default:!0,title:"Show Update Notifications",description:"Show notifications when the player is successfully updated.",displayGroup:"Display"},{property:"hoverImages",title:"Hover Images",default:!1,allowInTheme:!0},{title:"Controls",displayGroup:"Display",allowInTheme:!0,settings:[{property:"preventControlWrapping",title:"Prevent Wrapping",description:"Hide controls to prevent wrapping when the player is too small",default:!0},{property:"controlsHideOrder",title:"Hide Order",description:'Order controls are hidden in to prevent wrapping. Available controls are
    previous
    next
    seek-bar
    time
    duration
    volume
    volume-button
    volume-bar
    and
    fullscreen
    .',default:["fullscreen","duration","volume-bar","seek-bar","time","previous"],displayMethod:"textarea",inlineTextarea:!0,format:e=>e.join("\n"),parse:e=>e.split(/\s+/)}]},{title:"Minimised Display",description:"Optional displays for when the player is minimised.",displayGroup:"Display",allowInTheme:!0,settings:[{property:"pip",title:"Thumbnail",description:"Display a fixed thumbnail of the playing sound in the bottom right of the thread.",default:!0},{property:"maxPIPWidth",title:"Max Width",description:"Maximum width for the thumbnail.",default:"150px",updateCSSVars:!0},{property:"chanXControls",title:"4chan X Header Controls",description:"Show playback controls in the 4chan X header. The display can be customised in Settings>Theme.",displayMethod:isChanX||null,default:"closed",options:{always:"Always",closed:"Only with the player closed",never:"Never"}}]},{title:"Thread",displayGroup:"Display",allowInTheme:!0,settings:[{property:"autoScrollThread",description:"Automatically scroll the thread to posts as sounds play.",title:"Auto Scroll",default:!1},{property:"limitPostWidths",description:"Limit the width of posts so they aren't hidden under the player.",title:"Limit Post Widths",default:!0},{property:"minPostWidth",title:"Minimum Width",default:"50%"}]},{property:"threadsViewStyle",title:"Threads View",description:"How threads in the threads view are listed.",settings:[{title:"Display",default:"table",options:{table:"Table",board:"Board"}}]},{title:"Colors",displayGroup:"Display",property:"colors",updateCSSVars:!0,allowInTheme:!0,class:`${ns}-colorpicker-input`,attrs:'@focusout.stop.prevent="colorpicker._updatePreview" @click="colorpicker.create"',displayMethod:({value:e,attrs:t})=>`
    \n\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    `,actions:[{title:"Match Theme",handler:"theme.forceBoardTheme",mods:".prevent"}],settings:[{property:"colors.text",default:"#000000",title:"Text"},{property:"colors.background",default:"#d6daf0",title:"Background"},{property:"colors.border",default:"#b7c5d9",title:"Border"},{property:"colors.odd_row",default:"#d6daf0",title:"Odd Row"},{property:"colors.even_row",default:"#b7c5d9",title:"Even Row"},{property:"colors.playing",default:"#98bff7",title:"Playing Row"},{property:"colors.dragging",default:"#c396c8",title:"Dragging Row"},{property:"colors.controls_background",default:"#3f3f44",title:"Controls Background",description:"The controls container element background.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_background")',mods:".prevent"}]},{property:"colors.controls_inactive",default:"#FFFFFF",title:"Control Items",description:"The playback controls and played bar.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_inactive")',mods:".prevent"}]},{property:"colors.controls_active",default:"#00b6f0",title:"Focused Control Items",description:"The control items when hovered.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_active")',mods:".prevent"}]},{property:"colors.controls_empty_bar",default:"#131314",title:"Volume/Seek Bar Background",decscription:"The background of the volume and seek bars.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_empty_bar")',mods:".prevent"}]},{property:"colors.controls_loaded_bar",default:"#5a5a5b",title:"Loaded Bar Background",description:"The loaded bar within the seek bar.",actions:[{title:"Reset",handler:'settings.reset("colors.controls_loaded_bar")',mods:".prevent"}]},{property:"colors.page_background",default:"rgb(238, 242, 255)",displayMethod:null,allowInTheme:!1}]}]},2345:e=>{e.exports=[{property:"addWebm",title:"Include WebM",description:"Whether to add all WebM files regardless of a sound filename.",default:"soundBoards",displayGroup:"Filter",options:{always:"Always",soundBoards:"Boards with sound",never:"Never"}},{property:"allow",title:"Allowed Hosts",description:"Which domains sounds are allowed to be loaded from.",default:["4cdn.org","catbox.moe","dmca.gripe","lewd.se","pomf.cat","zz.ht","zz.fo"],actions:[{title:"Reset",handler:'settings.reset("allow")',mods:".prevent"}],displayGroup:"Filter",displayMethod:"textarea",attrs:"rows=10",format:e=>e.join("\n"),parse:e=>e.split("\n")},{property:"filters",default:["# Image MD5 or sound URL"],title:"Filters",description:"List of URLs or image MD5s to filter, one per line.\nLines starting with a # will be ignored.",actions:[{title:"Reset",handler:'settings.reset("filters")',mods:".prevent"}],displayGroup:"Filter",displayMethod:"textarea",attrs:"rows=10",format:e=>e.join("\n"),parse:e=>e.split("\n")}]},8620:e=>{e.exports=[{property:"defaultUploadHost",default:"catbox",parse:"settings.hosts.setDefault"},{property:"uploadHosts",title:"Hosts",actions:[{title:"Add",handler:"settings.hosts.add",mods:".prevent"},{title:"Restore Defaults",handler:"settings.hosts.restoreDefaults",mods:".prevent"}],displayGroup:"Hosts",displayMethod:"settings.hosts.template",parse:"settings.hosts.parse",looseCompare:!0,wideDesc:!0,description:'Each host needs a unique name and URL that points to an upload endpoint.

    The form data is a JSON representation of the data sent with the upload, with the file being indicated as "$file". The form data and headers allow for any other information to be sent, such as a user token.

    A response path or match can optionally be provided to get a link to the uploaded file from the response. Use "Response Path" for JSON responses to set where a link or filename can be found in the response. For all other responses "Response Match" takes a regular expression (without slashes) that is applied to the result, with the first capture group being the link or filename. File URL format can be set if you only have part of the link, such as the filename. The response, or response path/match result, will be inserted in place of %s.',mix:!0,default:{catbox:{default:!0,url:"https://catbox.moe/user/api.php",data:{reqtype:"fileupload",fileToUpload:"$file",userhash:null},filenameLength:29},pomf:{url:"https://pomf.cat/upload.php",data:{"files[]":"$file"},responsePath:"files.0.url",soundUrl:"a.pomf.cat/%s",filenameLength:23},zz:{url:"https://zz.ht/api/upload",responsePath:"files.0.url",data:{"files[]":"$file"},headers:{token:null},filenameLength:19},lewd:{url:"https://lewd.se/upload",data:{file:"$file"},headers:{token:null,shortUrl:!0},responsePath:"data.link",filenameLength:30}}}]},5303:(e,t,a)=>{e.exports=[...a(1277),...a(7022),...a(2345),...a(6270),...a(5066),...a(8620),{property:"viewStyle",default:"playlist"},{property:"showPlaylistSearch",default:!0},{property:"imageHeight",default:125},{property:"offsetTop",default:"0"},{property:"offsetBottom",default:"0"}]},6270:e=>{const t="mediaSession"in navigator,a={displayGroup:"Keybinds",format:"hotkeys.stringifyKey",parse:"hotkeys.parseKey",attrs:'@keydown="settings.handleKeyChange"',property:"hotkey_bindings",allowInTheme:!0};e.exports=[{title:"Keybinds",displayGroup:"Keybinds",settings:[{property:"hotkeys",default:"open",title:"Enabled",options:{always:"Always",open:"Only with the player open",never:"Never"}},{property:"hardwareMediaKeys",title:"Hardware Media Keys",displayGroup:"Keybinds",description:"Enable playback control via hardware media keys."+(t?"":" Your browser does not support this feature."),default:t,attrs:!t&&"disabled"}]},{title:"Playback",themeFieldTitle:"Playback Keybinds",...a,settings:[{property:"hotkey_bindings.playPause",title:"Play/Pause",keyHandler:"togglePlay",ignoreRepeat:!0,default:{key:" "}},{property:"hotkey_bindings.previous",title:"Previous",keyHandler:()=>Player.previous({force:!0}),ignoreRepeat:!0,default:{key:"arrowleft"}},{property:"hotkey_bindings.next",title:"Next",keyHandler:()=>Player.next({force:!0}),ignoreRepeat:!0,default:{key:"arrowright"}},{property:"hotkey_bindings.previousGroup",title:"Previous Group",keyHandler:()=>Player.previous({force:!0,group:!0}),ignoreRepeat:!0,default:{shiftKey:!0,key:"arrowleft"}},{property:"hotkey_bindings.nextGroup",title:"Next Group",keyHandler:()=>Player.next({force:!0,group:!0}),ignoreRepeat:!0,default:{shiftKey:!0,key:"arrowright"}},{property:"hotkey_bindings.volumeUp",title:"Volume Up",keyHandler:"actions.volumeUp",default:{shiftKey:!0,key:"arrowup"}},{property:"hotkey_bindings.volumeDown",title:"Volume Down",keyHandler:"actions.volumeDown",default:{shiftKey:!0,key:"arrowdown"}},{property:"hotkey_bindings.shuffle",title:"Shuffle",keyHandler:"playlist.toggleShuffle",default:{key:""}},{property:"hotkey_bindings.repeat",title:"Toggle Repeat",keyHandler:"playlist.toggleRepeat",default:{key:""}}]},{title:"Display",themeFieldTitle:"Display Keybinds",...a,settings:[{property:"hotkey_bindings.closePlayer",title:"Close",keyHandler:"display.close",default:{key:""}},{property:"hotkey_bindings.togglePlayer",title:"Show/Hide",keyHandler:"display.toggle",default:{key:"h"}},{property:"hotkey_bindings.toggleFullscreen",title:"Toggle Fullscreen",keyHandler:"display.toggleFullScreen",default:{key:""},allowFocusedInput:!0},{property:"hotkey_bindings.togglePlaylist",title:"Toggle Playlist",keyHandler:"playlist.toggleView",default:{key:""}},{property:"hotkey_bindings.toggleSearch",title:"Toggle Playlist Search",keyHandler:()=>Player.set("showPlaylistSearch",!Player.config.showPlaylistSearch),default:{key:""},allowFocusedInput:!0},{property:"hotkey_bindings.scrollToPlaying",title:"Jump To Playing",keyHandler:()=>Player.playlist.scrollToPlaying(),default:{key:""}},{property:"hotkey_bindings.toggleHoverImages",title:"Toggle Hover Images",keyHandler:"playlist.toggleHoverImages",default:{key:""}},{property:"hotkey_bindings.toggleAutoScroll",title:"Toggle Thread Scroll",keyHandler:()=>Player.set("autoScrollThread",!Player.config.autoScrollThread),default:{key:""}}]},{title:"Theme",themeFieldTitle:"Theme Keybinds",...a,settings:[{property:"hotkey_bindings.nextTheme",title:"Next Theme",keyHandler:"theme.next",default:{key:""}},{property:"hotkey_bindings.previousTheme",title:"Previous Theme",keyHandler:"theme.previous",default:{key:""}},{property:"hotkey_bindings.switchTheme",title:"Select Theme",keyHandler:"theme.handleSwitch",default:[],displayMethod:"theme.themeKeybindsTemplate",parse:"theme.parseSwitch",format:null}]}]},7022:e=>{e.exports=[{property:"shuffle",title:"Shuffle",displayGroup:"Playback",default:!1},{property:"repeat",title:"Repeat",displayGroup:"Playback",default:"all",options:{all:"All",one:"One",none:"None"}},{property:"preventSleep",title:"Prevent Sleep",displayGroup:"Playback",description:"Prevent sleeping while audio is playing. This only works when the browser and tab are in the foreground.",default:!0},{property:"autoplayNext",title:"Autoplay Next",displayGroup:"Playback",description:"Automatically play the next sound when the current one finishes.",default:!0},{property:"restartSeconds",title:"Restart After",displayGroup:"Playback",description:"How long into a track until selecting previous restarts the track instead. Set to 0 to disable.",default:3,parse:e=>+e>=0&&+e<1/0?+e:0},{title:"Inline Player",displayGroup:"Playback",settings:[{property:"playExpandedImages",title:"Expanded Image",description:"Play audio when sound images are expanded.",default:!0,dependentRender:["expandedControls"]},{property:"expandedControls",title:"Expanded Controls",description:"Show playback controls for expanded images.",default:!0,attrs:()=>Player.config.playExpandedImages?"":"disabled"},{property:"expandedLoopMaster",title:"Master Source",default:"sound",description:"Which media source to play in full for audio and video of different durations.",options:{sound:"Audio",video:"Video"}},{property:"expandedAllowFiltered",title:"Allow Filtered",default:!0,description:"Allow sounds that have been filtered to be played inline. Sounds from unknown hosts will not be played regardless of this setting."},{property:"expandedRepeat",title:"Repeat",default:"all",description:"How to repeat expanded images with multiple sounds.",options:{all:"All",one:"One",none:"None"}},{property:"playHoveredImages",title:"Hover Image",description:"Play audio when sound hover images are shown. This applies to hover images displayed by the native extention or 4chan X.",default:!0}]}]},5066:(e,t,a)=>{e.exports=[{property:"savedThemes",title:"Saved Themes",actions:[{title:"Restore Defaults",handler:"theme.restoreDefaults",mods:".prevent"},{title:"Save Current",handler:"theme.showSaveOptions",mods:".prevent.stop"}],displayGroup:"Theme",displayMethod:"theme.savedThemesTemplate",mix:!0,default:a(1469)},{property:"savedThemesOrder",default:[]},{property:"selectedTheme",default:"Default"},{property:"headerTemplate",title:"Header",actions:[{title:"Reset",handler:'settings.reset("headerTemplate")',mods:".prevent"}],default:"repeat-button shuffle-button hover-images-button playlist-button\nsound-title-marquee\nview-menu-button add-button theme-menu-button close-button",displayGroup:"Theme",displayMethod:"textarea",themeField:!0},{property:"rowTemplate",title:"Row",actions:[{title:"Reset",handler:'settings.reset("rowTemplate")',mods:".prevent"}],default:"sound-title h:{menu-button}",displayGroup:"Theme",displayMethod:"textarea",themeField:!0},{property:"footerTemplate",title:"Footer",actions:[{title:"Reset",handler:'settings.reset("footerTemplate")',mods:".prevent"}],default:`playing-button:"sound-index / " sound-count sounds\n
    \np:{\n\t\tpost-link\n\t\tOpen [ image-link sound-link ]\n\t\tDownload [ dl-image-button dl-sound-button ]\n}\n
    \n`,displayGroup:"Theme",displayMethod:"textarea",attrs:'rows="10"',themeField:!0},{property:"chanXTemplate",title:"4chan X Header",default:'p:{\n\tpost-link:"sound-title"\n\tprev-button\n\tplay-button\n\tnext-button\n\tsound-current-time / sound-duration\n}',actions:[{title:"Reset",handler:'settings.reset("chanXTemplate")',mods:".prevent"}],displayGroup:"Theme",displayMethod:"textarea",attrs:'rows="10"',themeField:!0},{property:"customCSS",title:"Custom CSS",default:"",displayGroup:"Theme",displayMethod:"textarea",attrs:'rows="10"',themeField:!0}]},1952:()=>{window.ns="fcsp",window.is4chan=location.hostname.includes("4chan.org")||location.hostname.includes("4channel.org"),window.isChanX=document.documentElement&&document.documentElement.classList.contains("fourchan-x"),window.isChanXT=document.documentElement&&document.documentElement.classList.contains("fourchan-xt"),window.isOneeChan=document.documentElement&&document.documentElement.classList.contains("oneechan"),window.Board=location.pathname.split("/")[1],window.Thread=(location.href.match(/\/thread\/(\d+)/)||[])[1],window.Site=is4chan?"4chan":((document.head.querySelector('meta[name="generator"]')||{}).content||"").includes("FoolFuuka")?"FoolFuuka":location.hostname.includes("warosu.org")?"Fuuka":"FoolFuuka";class e extends Error{constructor(e,t,a){super(e),this.reason=e,this.type=t,this.error=a}}window.PlayerError=e},5463:e=>{e.exports={catbox:{filepath:"//files.catbox.moe/",decode:!1},audio:{decode:!0},sound:{decode:!0}}},4302:(e,t,a)=>{e.exports={fcSounds:'4sp',arrowClockwise:a(5226).A,arrowsCollapse:a(1730).A,arrowDown:a(4292).A,arrowsExpand:a(5331).A,arrowRepeat:a(8997).A,arrowUp:a(991).A,boxArrowInLeft:a(1733).A,boxArrowRight:a(6818).A,chatRightQuote:a(9908).A,checkSquare:a(188).A,chevronDown:a(6042).A,chevronUp:a(2793).A,close:a(2340).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),gear:a(2181).A,fileEarmarkImage:a(794).A,fileEarmarkMusic:a(416).A,filter:a(706).A,fullscreen:a(4855).A,fullscreenExit:a(9520).A,github:a(5737).A,image:a(187).A,infoCircle:a(2277).A,layoutTextWindow:a(8979).A,link:a(5916).A,musicNoteList:a(5763).A,play:a(1786).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),playFill:a(5540).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),pause:a(8250).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),pauseFill:a(4708).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),plus:a(6001).A,reboot:a(3264).A,search:a(8472).A,shuffle:a(2487).A,skipEnd:a(7453).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),skipEndFill:a(137).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),skipStart:a(1590).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),skipStartFill:a(1992).A.replace(/viewBox="[^"]+"/,'viewBox="2 2 12 12"'),soundwave:a(8998).A,speaker:a(7119).A,square:a(6289).A,tools:a(6933).A,trash:a(2602).A,volumeMute:a(7568).A.replace(/viewBox="[^"]+"/,'viewBox="1 1 14 14"'),volumeMuteFill:a(4250).A.replace(/viewBox="[^"]+"/,'viewBox="1 1 14 14"'),volumeUp:a(3220).A.replace(/viewBox="[^"]+"/,'viewBox="1 1 14 14"'),volumeUpFill:a(7654).A.replace(/viewBox="[^"]+"/,'viewBox="1 1 14 14"')}},3980:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\t
    \n\t\t${e.inline&&!e.multiple?"":`\n\t\t\t
    \n\t\t\t\t${n.skipStart} ${n.skipStartFill}\n\t\t\t
    \n\t\t`}\n\t\t
    \n\t\t\t${n.play} ${n.pause} ${n.playFill} ${n.pauseFill}\n\t\t
    \n\t\t${e.inline&&!e.multiple?"":`\n\t\t\t
    \n\t\t\t\t${n.skipEnd} ${n.skipEndFill}\n\t\t\t
    \n\t\t`}\n\t
    \n\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t
    \n\t
    \n\t\t\n\t\t\t0:00\n\t\t\t\n\t\t\t\t/ 0:00\n\t\t\t\n\t\t\n\t
    \n\t
    \n\t\t
    \n\t\t\t${n.volumeMute} ${n.volumeMuteFill}\n\t\t\t${n.volumeUp} ${n.volumeUpFill}\n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t
    \n\t${e.inline?"":`\n\t\t
    \n\t\t\t
    \n\t\t\t\t${n.fullscreen} ${n.fullscreenExit}\n\t\t\t
    \n\t\t
    \n\t`}\n
    `},172:e=>{e.exports=(e={})=>``},3272:e=>{e.exports=(e={})=>``},928:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>``},2663:(e,t,a)=>{var n=a(6325);e.exports=(e={})=>``},4486:e=>{e.exports=(e={})=>(e.sounds||Player.sounds).map((e=>Player.playlist.matchesSearch(e)?`\n\t\n\t\t${Player.userTemplate.build({template:Player.config.rowTemplate,location:"item-"+e.id,sound:e,outerClass:`${ns}-col-auto`})}\n\t`:"")).join("")},4837:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`\n\t
    \n\t
    \n\t\n\t
    \n\t\n\t\n\n${Player.controls.template({audio:Player.audio,audioId:Player.audio.dataset.id,actions:Player.controls.actions})}\n
    \n\t\n\t
    \n\t\t${Player.playlist.listTemplate()}\n\t
    \n
    \n`},8808:e=>{e.exports=(e={})=>{if(!e.tags)return'
    Loading
    ';const t=Object.entries(e.tags);return t.length?t.map((([e,t])=>`
    \n\t\t\n\t\t\t${e[0].toUpperCase()+e.slice(1)}:\n\t\t\n\t\t${t}\n\t
    `)).join(""):'
    No data
    '}},9480:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\t
    \n\t\t
    \n\t
    \n\t
    \n\t\t
    \n\t
    \n\t
    \n\t\t${n.close}\n\t\t
    \n\n\t\t\n\t\t\t${["R","G","B","A"].map(((t,a)=>`\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`)).join("")}\n\t\t
    ${t}:\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\n\t\t
    \n\t
    \n
    `},8210:e=>{e.exports=(e={})=>Object.entries(Player.config.uploadHosts).map((([e,t])=>`\n\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t\t\n\t\t
    \n\t\t
    \n\t\t\t${Object.entries(Player.settings.hosts.fields).map((([a,n])=>`\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t`)).join("")}\n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t
    \n\t
    \n`)).join("")},1470:e=>{e.exports=(e={})=>`
    \n\t\n
    `},1691:e=>{e.exports=(e={})=>`
    \n\t\n
    `},9045:e=>{e.exports=(e={})=>`
    \n\t\n
    `},8475:e=>{e.exports=(e={})=>`
    \n\t\n
    `},1555:(e,t,a)=>{var n=a(6325),s=a(4302);e.exports=(e={})=>null===e.displayMethod?"":`\n
    \n\t
    \n\t\t\n\t\t\t${e.title}\n\t\t\t${e.description?`${s.infoCircle}`:""}\n\t\t\n\t\t${e.actions&&e.actions.length?`
    \n\t\t\t${(e.actions||[]).map((e=>`\n\t\t\t\t${e.title}\n\t\t\t`)).join(" ")}\n\t\t
    `:""}\n\t
    \n\n\t${e.dismissTextId?`
    \n\t\t\t${Player.display.ifNotDismissed(e.dismissTextId,e.dismissRestoreText,`
    \n\t\t\t\t\t${e.text}\n\t\t\t\t\t\n\t\t\t\t\t\tDismiss\n\t\t\t\t\t\n\t\t\t\t
    `)}\n\t\t
    `:e.text?e.text:""}\n\n\t${(()=>{if(e.settings)return e.settings.map((t=>Player.settings.settingTemplate({...e,actions:null,settings:null,description:null,...t,isSubSetting:!0}))).join("");value=n.get(Player.config,e.property,e.default),attrs=("function"==typeof e.attrs?e.attrs():e.attrs||"")+(e.class?` class="${e.class}"`:"")+` data-property="${e.property}"`,e.format&&(value=Player.getHandler(e.format)(value));let t=typeof value;return"object"===t&&(value=JSON.stringify(value,null,4)),inputTemplate="function"==typeof e.displayMethod&&e.displayMethod||n.get(Player,e.displayMethod)||e.displayMethod&&Player.settings.inputTemplates[e.displayMethod]||"boolean"===t&&Player.settings.inputTemplates.checkbox||"object"===t&&Player.settings.inputTemplates.textarea||e.options&&Player.settings.inputTemplates.select||Player.settings.inputTemplates.input,inputTemplate({value,attrs,setting:e})})()}\n
    `},1262:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\t\n\t
    \n\t\t${Object.keys(Player.settings.groups).map((e=>`\n\t\t\t\t${e}\n\t\t\t`)).join(" | ")}\n\t
    \n
    \n${Object.entries(Player.settings.groups).map((([e,t])=>`\n\t
    \n\t\t${t.map(Player.settings.settingTemplate).join("")}\n\t
    \n`)).join("")}`},5080:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\t
    \n\t\t
    \n\t\t\t\n\t\t
    \n\t\t
    \n\t\t\tCreate\n\t\t
    \n\t
    \n\t\n\t\tIncluded Settings\n\t\t${n.chevronDown}\n\t\t${n.chevronUp}\n\t\n\t${function e(t,a){return t.map((t=>{const n=t.property&&`theme_field-${t.property.replace(/\./g,"_")}`;return t.settings?e(t.settings,t):{...a||{},...t}.allowInTheme||t.themeField?`
    `:""})).join("")}(e.settingsConfig)}\n
    `},6305:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\t\n\t${Player.config.savedThemesOrder.map(((e,t)=>`\n\t\t
    \n\t\t\t
    ${e}
    \n\t\t\t\n\t\t
    \n\t`)).join("")}\n
    `},3038:e=>{e.exports=(e={})=>["Default"].concat(Player.config.savedThemesOrder).map((e=>`\n\t
    \n\t\t
    - ${e}
    \n\t\t
    \n\t\t\tt.themeName===e))||{key:""})}"\n\t\t\t\tdata-property="hotkey_bindings.switchTheme"\n\t\t\t/>\n\t\t
    \n\t
    \n`)).join("")},6844:e=>{e.exports=(e={})=>(Player.threads.boardList||[]).map((e=>{let t=Player.threads.selectedBoards.includes(e.board);return t||Player.threads.showAllBoards?`\n\t\t`:""})).join("")},1675:(e,t,a)=>{var n=a(6325);e.exports=(e={})=>Object.keys(Player.threads.displayThreads).reduce(((e,t)=>e.concat(Player.threads.displayThreads[t].map((e=>`\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t>>>/${e.board}/${e.no}\n\t\t\t\t\n\t\t\t\n\t\t\t${e.sub||""}\n\t\t\t${e.replies} / ${e.images}\n\t\t\t${n.timeAgo(e.time)}\n\t\t\t${n.timeAgo(e.last_modified)}\n\t\t\n\t`)))),[]).join("")},7870:e=>{e.exports=(e={})=>`
    \n\tActive Threads\n\t${Player.threads.loading?"":`- Update`}\n
    \n\n
    Loading
    \n\n
    \n\t
    \n\t\tFilter\n\t
    \n\t\n\n\t\n\t
    \n\t\t${Player.threads.boardsTemplate(e)}\n\t
    \n\n\t${Player.threads.hasParser?`
    \n\t\t\t${"table"!==Player.config.threadsViewStyle?`Table`:"Table"}\n\t\t\t|\n\t\t\t${"board"!==Player.config.threadsViewStyle?`Board`:"Board"}\n\t\t
    `:""}\n\t${Player.threads.hasParser&&"table"!==Player.config.threadsViewStyle?`
    `:`\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t
    ThreadSubjectReplies/ImagesStartedUpdated
    `}\n
    `},4859:e=>{e.exports=(e={})=>`\n\t
    Complete!
    \n\t${is4chan?'Post - ':""}\n\tAdd -\n\tDownload\n
    `},5257:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\tCreate Sound Image\n
    \n
    \n\t
    \n\t\t
    \n\t\t\t${Player.display.ifNotDismissed("createSoundDetails","Show Help",`
    \n\t\t\t\tSelect an image and sound to combine as a sound image.\n\t\t\t\tThe sound will be uploaded to the selected file host and the url will be added to the image filename.
    \n\t\t\t\t
    \n\t\t\t\tMultiple sound files, or a comma-separated list of sound URLs, can be given for a single image.\n\t\t\t\tIf you do have multiple sounds the name will also be a considered comma-separated list.
    \n\t\t\t\tDismiss\n\t\t\t
    `)}\n\t\t
    \n\n\t\t
    \n\t\t\tHost - Config\n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t${Player.tools.createHostsTemplate()}\n\t\t\t
    \n\t\t
    \n\n\t\t
    \n\t\t\tData\n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t
    \n\n\t\t
    \n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\tSelect/Drop Image\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t
    \n\n\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t\t\tSelect/Drop Sound/s\n\t\t\t\t\t\t\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t${n.link}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\t\t${n.fileEarmarkMusic}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t
    \n\t\t
    \n\n\t\t
    \n\t\t\t
    \n\t\t\t\t\n\t\t\t
    \n\t\t
    \n\t
    \n\n\t
    \n\t\t${Player.tools._createdImage?Player.tools.createCompleteTemplate():""}\n\t
    \n
    `},5563:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    \n\t
    \n\t\t${n.close}\n\t\t\n\t
    \n\t
    \n\t\t
    ${n.image}
    \n\t\t
    \n\t
    \n\t
    \n\t\t
    ${n.soundwave}
    \n\t\t
    \n\t
    \n
    `},4805:(e,t,a)=>{var n=a(4302);e.exports=(e={})=>`
    Download All
    \n
    \n\t
    \n\t\t\n\t\t\n\t\t\n\t\t
    \n\t\t\t
    Download Concurrency
    \n\t\t\t
    \n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\tCompression Level\n\t\t\t\t${n.infoCircle}\n\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t\t
    \n\t\t\t
    \n\t\t\t\tMax Sounds\n\t\t\t\t${n.infoCircle}\n\t\t\t
    \n\t\t\t
    \n\t\t
    \n\t
    \n\t\n\t
    \n\t\t\n\t\t\n\t\t\n\t\t
    \n\t\t\tClear${n.infoCircle}\n\t\t
    \n\t
    \n
    `},9103:e=>{e.exports=(e={})=>``},2230:e=>{e.exports=(e={})=>`${Player.tools.createTemplate()}\n${Player.tools.downloadTemplate()}\n\n
    Encode / Decode URL
    \n
    \n\t
    \n\t\t\n\t\t\n\t
    \n
    `},2674:e=>{e.exports=(e={})=>'.dialog{background:var(--fcsp-background);background:var(--fcsp-background);border-color:var(--fcsp-border);border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.15);border-radius:3px;padding-top:1px;padding-bottom:3px}.entry{position:relative;display:block;padding:.125rem .5rem;min-width:70px;white-space:nowrap}.entry.has-submenu::after{content:"";border-left:.5em solid;border-top:.3em solid transparent;border-bottom:.3em solid transparent;display:inline-block;margin:.35em;position:absolute;right:3px}.entry.focused{background:rgba(255,255,255,.33)}.entry.focused>.submenu{display:block}.submenu{position:absolute;display:none}'},9449:e=>{e.exports=(e={})=>`:root{--fcsp-text: ${Player.config.colors.text};--fcsp-background: ${Player.config.colors.background};--fcsp-border: ${Player.config.colors.border};--fcsp-odd-row: ${Player.config.colors.odd_row};--fcsp-even-row: ${Player.config.colors.even_row};--fcsp-playing: ${Player.config.colors.playing};--fcsp-dragging: ${Player.config.colors.dragging};--fcsp-controls-background: ${Player.config.colors.controls_background};--fcsp-controls-active: ${Player.config.colors.controls_active};--fcsp-controls-inactive: ${Player.config.colors.controls_inactive};--fcsp-controls-empty-bar: ${Player.config.colors.controls_empty_bar};--fcsp-controls-loaded-bar: ${Player.config.colors.controls_loaded_bar};--fcsp-muted: #909090;--fcsp-max-pip-size: ${Player.config.maxPIPWidth}}`},42:e=>{e.exports=(e={})=>`.${ns}-colorpicker{position:fixed;padding:.25rem;white-space:nowrap;z-index:999}.${ns}-colorpicker .${ns}-cp-saturation{display:inline-block;position:relative}.${ns}-colorpicker .${ns}-cp-saturation .position{width:5px}.${ns}-colorpicker .${ns}-cp-saturation::before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;border-radius:inherit;background:#000;-webkit-mask-image:linear-gradient(#0000, #000);mask-image:linear-gradient(#0000, #000)}.${ns}-colorpicker .${ns}-cp-hue{margin-left:.5rem;display:inline-block;position:relative;width:30px;background:linear-gradient(to bottom, #F00, #FF0, #0F0, #0FF, #00F, #F0F, #F00)}.${ns}-colorpicker .${ns}-cp-hue .position{top:-3px;left:-1px;right:-1px}.${ns}-colorpicker .${ns}-cp-saturation .position,.${ns}-colorpicker .${ns}-cp-hue .position{position:absolute;height:5px;border-radius:1rem}.${ns}-colorpicker .${ns}-output{vertical-align:top;margin-left:1rem;display:inline-block}.${ns}-colorpicker .${ns}-output .${ns}-rgb-input{width:2rem}.${ns}-colorpicker .${ns}-output .output-color{height:40px;margin:.25rem 0}.${ns}-cp-preview,.${ns}-cp-saturation .position,.${ns}-cp-hue .position,.${ns}-output .output-color{border:solid 1px #000;box-shadow:inset 0 0 0 1px #eee}.${ns}-cp-preview{height:1em;width:1em;margin-left:.125rem}.${ns}-text-muted{color:var(--fcsp-muted)}.${ns}-controls{align-items:center;padding:.5rem 0;position:relative;background:var(--fcsp-controls-background);justify-content:space-between}.${ns}-controls>div{margin:0 .5rem}.${ns}-controls .${ns}-current-time{color:var(--fcsp-controls-inactive)}.${ns}-controls .${ns}-media-control{width:1.5rem;height:1.5rem;font-size:1rem;color:var(--fcsp-controls-inactive)}.${ns}-controls .${ns}-media-control.disabled{cursor:inherit;filter:brightness(0.5) grayscale(1)}.${ns}-controls .${ns}-media-control:hover:not(.disabled){color:var(--fcsp-controls-active)}.${ns}-media-control{display:flex;justify-content:center;align-items:center;cursor:pointer}.${ns}-media-control.${ns}-hover-fill svg[class$=-fill],.${ns}-media-control.${ns}-hover-fill svg[class*="-fill "]{display:none}.${ns}-media-control.${ns}-hover-fill:hover:not(.disabled) svg{display:none}.${ns}-media-control.${ns}-hover-fill:hover:not(.disabled) svg[class$=-fill],.${ns}-media-control.${ns}-hover-fill:hover:not(.disabled) svg[class*="-fill "]{display:block}.${ns}-media-control.${ns}-play-button:not(.${ns}-play) svg.bi-play-fill,.${ns}-media-control.${ns}-play-button:not(.${ns}-play) svg.bi-play{display:none !important}.${ns}-media-control.${ns}-play-button.${ns}-play svg.bi-pause-fill,.${ns}-media-control.${ns}-play-button.${ns}-play svg.bi-pause{display:none !important}.${ns}-media-control.${ns}-fullscreen-button svg.bi-fullscreen-exit{display:none}#${ns}-container[data-view-style=fullscreen] .${ns}-media-control.${ns}-fullscreen-button svg.bi-fullscreen-exit{display:block}#${ns}-container[data-view-style=fullscreen] .${ns}-media-control.${ns}-fullscreen-button svg.bi-fullscreen{display:none}.${ns}-media-control.${ns}-volume-button.mute .bi:not(.bi-volume-mute):not(.bi-volume-mute-fill){display:none}.${ns}-media-control.${ns}-volume-button.up .bi:not(.bi-volume-up):not(.bi-volume-up-fill){display:none}.${ns}-progress-bar{min-width:3.5rem;height:1.5rem;display:flex;align-items:center}.${ns}-progress-bar:hover .${ns}-current-bar:after{background:var(--fcsp-controls-active)}.${ns}-full-bar{height:.3rem;width:100%;background:var(--fcsp-controls-empty-bar);border-radius:1rem;position:relative}.${ns}-full-bar>div{position:absolute;top:0;bottom:0;border-radius:1rem}.${ns}-full-bar .${ns}-loaded-bar{background:var(--fcsp-controls-loaded-bar)}.${ns}-full-bar .${ns}-current-bar{display:flex;justify-content:flex-end;align-items:center}.${ns}-full-bar .${ns}-current-bar:after{content:"";background:var(--fcsp-controls-inactive);height:.8rem;min-width:.8rem;border-radius:1rem;box-shadow:rgba(0,0,0,.76) 0 0 3px 0;margin-right:-0.4rem}.${ns}-seek-bar .${ns}-current-bar{background:var(--fcsp-controls-active)}.${ns}-volume-bar .${ns}-current-bar{background:var(--fcsp-controls-inactive)}.${ns}-chan-x-controls .${ns}-current-time,.${ns}-chan-x-controls .${ns}-duration{margin:0 .25rem}.${ns}-header,.${ns}-footer{text-align:center;padding:.125rem;max-width:100%;line-height:1rem}.${ns}-header .${ns}-expander,.${ns}-footer .${ns}-expander{opacity:0;position:absolute;bottom:-0.25rem;right:-0.25rem;height:.75rem;width:.75rem;cursor:se-resize;background:linear-gradient(to bottom right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 50%, var(--fcsp-border) 55%, var(--fcsp-border) 100%)}.${ns}-header .${ns}-expander[data-direction=sw],.${ns}-footer .${ns}-expander[data-direction=sw]{left:-0.25rem;right:auto;transform:rotate(90deg);cursor:sw-resize}.${ns}-header .${ns}-expander[data-direction=nw],.${ns}-footer .${ns}-expander[data-direction=nw]{left:-0.25rem;top:-0.25rem;right:auto;bottom:auto;transform:rotate(180deg);cursor:nw-resize}.${ns}-header .${ns}-expander[data-direction=ne],.${ns}-footer .${ns}-expander[data-direction=ne]{right:-0.25rem;top:-0.25rem;bottom:auto;transform:rotate(270deg);cursor:ne-resize}.${ns}-header{cursor:grab;border-bottom:solid 1px var(--fcsp-border)}.${ns}-footer{cursor:grab;border-top:solid 1px var(--fcsp-border)}.${ns}-title-marquee{transition:margin-left 1s linear}.${ns}-menu svg.bi{margin:0 -0.25rem 0 .25rem}.${ns}-header svg.bi,.${ns}-footer svg.bi{margin:0 .125rem}.muted svg.bi{opacity:.45}svg.bi{overflow:visible;height:1em;width:1em}.fileText svg.bi{vertical-align:text-bottom}.${ns}-image-link{text-align:center;display:flex;flex-grow:1;justify-content:center;align-items:center;overflow:hidden;position:relative}.${ns}-image-link.${ns}-show-video .${ns}-video{display:block}.${ns}-image-link.${ns}-show-video .${ns}-image{display:none}.${ns}-image-link.${ns}-pip{position:fixed;right:10px;align-items:end}.${ns}-image-link.${ns}-pip .${ns}-image,.${ns}-image-link.${ns}-pip .${ns}-video{width:auto;height:auto;max-height:var(--fcsp-max-pip-size);max-width:var(--fcsp-max-pip-size);object-fit:contain}.${ns}-image-link.${ns}-pip .${ns}-image-transparent-bg,.${ns}-image-link.${ns}-pip .${ns}-background-image{display:none}.${ns}-image-link .${ns}-video{display:none}.${ns}-image-link .${ns}-image,.${ns}-image-link .${ns}-video{height:100%;width:100%;object-fit:contain;z-index:1}.${ns}-image-link .${ns}-background-image{position:absolute;top:-20px;bottom:-20px;left:-20px;right:-20px;object-fit:cover;object-position:center;height:calc(100% + 40px);width:calc(100% + 40px);filter:blur(10px) brightness(0.7) saturate(0.5) contrast(0.7);z-index:-1}.${ns}-image-link .${ns}-background-image:not([src]){display:none}.${ns}-image-link .${ns}-image-transparent-bg{background-color:var(--fcsp-background);position:absolute}.untz .${ns}-image-link{transition:all .1s linear}#${ns}-container[data-view-style=fullscreen].playing-video .${ns}-background-image{display:none}#${ns}-container[data-view-style=fullscreen].playing-video .${ns}-image-link,#${ns}-container[data-view-style=fullscreen] .${ns}-image-transparent-bg{background:#000}#${ns}-container.playing-video .${ns}-image-transparent-bg{display:none}.image-color-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:rgba(0,255,0,.5);transition:all .5s linear;display:none}.untz .image-color-overlay{display:block}.${ns}-has-controls{position:relative}.${ns}-has-controls .${ns}-controls{cursor:auto;flex-wrap:nowrap;overflow:hidden;min-width:auto;position:absolute;left:0;right:0;bottom:0}.${ns}-has-controls:not(:hover) .${ns}-controls{display:none}html:not(.fourchan-x) .${ns}-has-controls>video+.${ns}-controls{left:20px;right:20px}#${ns}-container{position:fixed;display:flex;flex-direction:column;background:var(--fcsp-background);color:var(--fcsp-text);border:1px solid var(--fcsp-border);box-sizing:border-box;min-width:7rem;line-height:1rem}#${ns}-container .w-100{width:100%;min-width:100%}#${ns}-container input[type=text],#${ns}-container input[type=number],#${ns}-container select,#${ns}-container .${ns}-file-overlay{background:#fff;color:#000;height:1.5rem !important;padding:2px 4px 3px;box-sizing:border-box;margin:0;border-radius:0;border:solid 1px var(--fcsp-border);padding:0 .25rem}#${ns}-container .m-0{margin:0}#${ns}-container .mx-0{margin-right:0;margin-left:0}#${ns}-container .my-0{margin-top:0;margin-bottom:0}#${ns}-container .mr-0{margin-right:0}#${ns}-container .ml-0{margin-left:0}#${ns}-container .mt-0{margin-top:0}#${ns}-container .mb-0{margin-bottom:0}#${ns}-container .m-1{margin:.125rem}#${ns}-container .mx-1{margin-right:.125rem;margin-left:.125rem}#${ns}-container .my-1{margin-top:.125rem;margin-bottom:.125rem}#${ns}-container .mr-1{margin-right:.125rem}#${ns}-container .ml-1{margin-left:.125rem}#${ns}-container .mt-1{margin-top:.125rem}#${ns}-container .mb-1{margin-bottom:.125rem}#${ns}-container .m-2{margin:.25rem}#${ns}-container .mx-2{margin-right:.25rem;margin-left:.25rem}#${ns}-container .my-2{margin-top:.25rem;margin-bottom:.25rem}#${ns}-container .mr-2{margin-right:.25rem}#${ns}-container .ml-2{margin-left:.25rem}#${ns}-container .mt-2{margin-top:.25rem}#${ns}-container .mb-2{margin-bottom:.25rem}#${ns}-container .m-3{margin:.375rem}#${ns}-container .mx-3{margin-right:.375rem;margin-left:.375rem}#${ns}-container .my-3{margin-top:.375rem;margin-bottom:.375rem}#${ns}-container .mr-3{margin-right:.375rem}#${ns}-container .ml-3{margin-left:.375rem}#${ns}-container .mt-3{margin-top:.375rem}#${ns}-container .mb-3{margin-bottom:.375rem}#${ns}-container .m-4{margin:.5rem}#${ns}-container .mx-4{margin-right:.5rem;margin-left:.5rem}#${ns}-container .my-4{margin-top:.5rem;margin-bottom:.5rem}#${ns}-container .mr-4{margin-right:.5rem}#${ns}-container .ml-4{margin-left:.5rem}#${ns}-container .mt-4{margin-top:.5rem}#${ns}-container .mb-4{margin-bottom:.5rem}#${ns}-container .m-5{margin:1rem}#${ns}-container .mx-5{margin-right:1rem;margin-left:1rem}#${ns}-container .my-5{margin-top:1rem;margin-bottom:1rem}#${ns}-container .mr-5{margin-right:1rem}#${ns}-container .ml-5{margin-left:1rem}#${ns}-container .mt-5{margin-top:1rem}#${ns}-container .mb-5{margin-bottom:1rem}#${ns}-container .pointer{cursor:pointer}.${ns}-panel{padding:0 .25rem;height:100%;width:calc(100% - .5rem);overflow:auto}.${ns}-heading{font-weight:600;margin:.5rem 0}.${ns}-heading.lined{border-bottom:solid 1px var(--fcsp-border)}.${ns}-heading.lined .${ns}-heading-action{text-decoration:none}.${ns}-heading-action{font-weight:normal;text-decoration:underline;display:inline-flex}.${ns}-row{display:flex;flex-wrap:wrap;min-width:100%;box-sizing:border-box}.${ns}-row.nowrap{flex-wrap:nowrap}.${ns}-col-auto{flex:0 0 auto;width:auto;max-width:100%;display:inline-flex}.${ns}-col{flex-basis:0;flex-grow:1;max-width:100%;width:100%;position:relative}.${ns}-hover-display{display:none}.${ns}-hover-trigger:hover .${ns}-hover-display{display:flex}[\\@pointdrag],.no-touch-action{touch-action:none}.${ns}-truncate-text{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.${ns}-align-center{align-items:center;align-content:center;align-self:center}.${ns}-align-start{align-items:start;align-content:start;align-self:start}.${ns}-space-between{justify-content:space-between}.${ns}-player{display:flex;flex-direction:column;flex-grow:1;overflow:auto}.${ns}-player .${ns}-hover-image{position:fixed;max-height:125px;max-width:125px;z-index:2}.${ns}-player.${ns}-hide-hover-image .${ns}-hover-image{display:none !important}.${ns}-under-image{flex-grow:1;overflow:auto}.${ns}-list-item{list-style-type:none;padding:.15rem .25rem;white-space:nowrap;text-overflow:ellipsis;cursor:pointer;background:var(--fcsp-odd-row);overflow:hidden;height:1.3rem}.${ns}-list-item:nth-child(2n){background:var(--fcsp-even-row)}.${ns}-list-item:nth-child(n).playing{background:var(--fcsp-playing)}.${ns}-list-item .${ns}-item-menu-button{right:.25rem}.${ns}-list-item.${ns}-dragging{background:var(--fcsp-dragging)}.dialog .tags-dialog .entry{cursor:initial}.${ns}-settings textarea{border:solid 1px var(--fcsp-border);min-width:100%;min-height:4rem;box-sizing:border-box;white-space:pre}.${ns}-settings .${ns}-sub-settings .${ns}-heading{font-weight:normal;margin:0;justify-content:space-between}.${ns}-settings .${ns}-sub-settings .${ns}-col{min-height:1.55rem;display:flex;align-items:center;align-content:center;white-space:nowrap}.${ns}-settings .${ns}-settings-tabs{justify-content:space-between;flex-direction:row-reverse;margin:0 -0.25rem}.${ns}-settings .${ns}-settings-tab-group{text-align:center;white-space:nowrap;align-items:center}.${ns}-settings .${ns}-settings-tab{display:flex;margin:.25rem;text-decoration:underline;text-align:center}.${ns}-settings .${ns}-settings-tab.active{font-weight:bold}.${ns}-settings .${ns}-settings-tab svg.bi{margin:0 -0.125rem}.${ns}-settings .${ns}-settings-group{display:none}.${ns}-settings .${ns}-settings-group.active{display:block}.${ns}-settings .${ns}-host-input{margin:.5rem 0;border-top:solid 1px var(--fcsp-border)}.${ns}-settings .${ns}-host-input.invalid{border:solid 1px red}.${ns}-settings .${ns}-host-input .${ns}-host-controls{align-items:center;justify-content:space-between;margin:.125rem 0}.${ns}-settings .${ns}-host-input input[type=text]{min-width:100%;box-sizing:border-box}.${ns}-theme-save-options{position:fixed;max-height:20rem;overflow:auto;padding:.25rem}.${ns}-theme-save-options:not(.fields-collapsed) .bi-chevron-down,.${ns}-theme-save-options.fields-collapsed .bi-chevron-up,.${ns}-theme-save-options.fields-collapsed input[type=checkbox]:not(:checked),.${ns}-theme-save-options.fields-collapsed input[type=checkbox]:not(:checked)+label{display:none}.${ns}-info-circle{cursor:pointer}.${ns}-info-circle svg{height:.8em;width:.8em}.${ns}-popover-body{position:fixed;padding:.25rem;max-width:12rem;text-align:center;border-radius:.3rem}.${ns}-popover-body.wide{max-width:20rem}pre.option{display:inline;background:#f5f5f5;border:1px solid #b7c5d9;border-radius:4px;padding:0 .3em;font-size:.9em;white-space:nowrap}.${ns}-threads .${ns}-thread-board-list label{display:inline-block;width:4rem}.${ns}-threads .${ns}-thread-list{margin:.5rem -0.25rem 0;padding:.5rem 1rem;border-top:solid 1px var(--fcsp-border)}.${ns}-threads .${ns}-thread-list .boardBanner{margin:1rem 0}.${ns}-threads table{border-top:solid 1px var(--fcsp-border);width:100%;margin-top:.5rem;border-collapse:collapse}.${ns}-threads table th{border-bottom:solid 1px var(--fcsp-border)}.${ns}-threads table th,.${ns}-threads table td{text-align:left;padding:.25rem}.${ns}-threads table tr{padding:.25rem 0}.${ns}-threads table .${ns}-threads-body tr{background:var(--fcsp-even-row)}.${ns}-threads table .${ns}-threads-body tr:nth-child(2n){background:var(--fcsp-odd-row)}.${ns}-download-all-status,.${ns}-create-sound-status{margin-top:.5rem;border:solid 1px var(--fcsp-border);border-radius:5px;padding:.25rem}.${ns}-file-overlay,.${ns}-tools input[type=text]{display:flex;align-items:center}.${ns}-file-input.placeholder span,.${ns}-create-sound-form input[type=text]::placeholder{color:#aaa;opacity:1}.${ns}-file-input .${ns}-file-overlay{position:relative;background:#fff}.${ns}-file-input .placeholder-text{display:none}.${ns}-file-input.placeholder .placeholder-text{display:inherit}.${ns}-file-input span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.${ns}-file-input input[type=file]{width:100%;box-sizing:border-box;height:100%;position:absolute;left:0;opacity:0}.${ns}-file-input .overfile{z-index:9999}.${ns}-file-input .${ns}-file-list{padding:0 .25rem}.${ns}-file-input .${ns}-file-list:empty{display:none}.${ns}-input-append{position:absolute;display:flex;align-items:center;background:#fff;padding-left:.25rem;right:.125rem}.${ns}-tools .${ns}-full-bar{background:none;height:5px}.${ns}-tools .${ns}-full-bar>div{background:var(--fcsp-border)}.${ns}-threads,.${ns}-settings,.${ns}-tools,.${ns}-player,.fullscreen-details{display:none}#${ns}-container[data-view-style=settings] .${ns}-settings{display:block}#${ns}-container[data-view-style=threads] .${ns}-threads{display:block}#${ns}-container[data-view-style=tools] .${ns}-tools{display:block}#${ns}-container[data-view-style=image] .${ns}-player,#${ns}-container[data-view-style=playlist] .${ns}-player,#${ns}-container[data-view-style=fullscreen] .${ns}-player{display:flex}#${ns}-container[data-view-style=image] .${ns}-under-image{display:none}#${ns}-container[data-view-style=image] .${ns}-image-link{height:auto}#${ns}-container[data-view-style=playlist] .${ns}-image-link{flex-shrink:0;flex-grow:0}#${ns}-container[data-view-style=fullscreen] .${ns}-player{scrollbar-width:none}#${ns}-container[data-view-style=fullscreen] .${ns}-player::-webkit-scrollbar{display:none}#${ns}-container[data-view-style=fullscreen].cursor-inactive .${ns}-player{cursor:none}#${ns}-container[data-view-style=fullscreen].cursor-inactive .${ns}-controls,#${ns}-container[data-view-style=fullscreen].cursor-inactive .fullscreen-details{opacity:0}#${ns}-container[data-view-style=fullscreen] .${ns}-image-link{height:calc(100% - .4rem) !important}#${ns}-container[data-view-style=fullscreen] .${ns}-controls{position:absolute;left:0;right:0;bottom:0;opacity:.7;transition:opacity .3s ease;z-index:2}#${ns}-container[data-view-style=fullscreen] .${ns}-under-image{position:absolute;top:100%;width:100%}#${ns}-container[data-view-style=fullscreen] .fullscreen-details{display:block;opacity:.7;position:absolute;top:.5rem;left:.5rem;text-align:left;background:var(--fcsp-controls-background);color:var(--fcsp-controls-inactive);padding:.5rem 1rem;font-size:1.5rem;line-height:1.5rem;border-radius:.375rem;z-index:2}`},851:e=>{e.exports=[{version:"3.0.0",name:"hosts-filename-length",async run(){const e=Player.settings.findDefault("uploadHosts").default;return Object.keys(e).forEach((t=>{Player.config.uploadHosts[t].filenameLength=e[t].filenameLength})),{}}},{version:"3.3.0",name:"sound-name-title-swap",async run(){const e=Player.config,t={};return["headerTemplate","rowTemplate","footerTemplate","chanXTemplate","customCSS"].forEach((a=>{/sound-name/.test(e[a])&&(t[a]=[e[a],e[a]=e[a].replace(/sound-name/g,"sound-title")])})),t}},{version:"3.4.0",name:"disable-inline-player-for-existing-users",run:async()=>(Player.config.playExpandedImages=!1,Player.config.playHoveredImages=!1,{playExpandedImages:[!0,!1],playHoveredImages:[!0,!1]})},{version:"3.4.7",name:"zz-ht-to-zz-fo",async run(){const e=[...Player.config.allow];return Player.config.allow.push("zz.fo"),{allow:[e,Player.config.allow]}}}]},9211:(e,t,a)=>{var n=a(6325);const s={settings:a(6279),events:a(3319),actions:a(2189),colorpicker:a(3378),controls:a(9912),display:a(6764),footer:a(337),header:a(8563),hotkeys:a(9433),inline:a(6431),minimised:a(3613),playlist:a(9200),position:a(2473),posts:a(1),theme:a(2475),threads:a(591),tools:a(5305),userTemplate:a(3722)},r=window.Player=e.exports={ns,components:s,audio:new Audio,sounds:[],filteredSounds:[],isHidden:!0,container:null,ui:{},_public:[],config:{},$:(...e)=>r.container&&r.container.querySelector(...e),$all:(...e)=>r.container&&r.container.querySelectorAll(...e),async initialize(){if(!r.initialized){r.initialized=!0;try{r.audio.dataset.id="main",r.sounds=[];for(let e in s)s[e].initialize&&await s[e].initialize();r.display.createPlayerButton(),await r.display.render(),document.addEventListener("PlayerEvent",(e=>{if(e.detail.action&&r._public.includes(e.detail.action))return n.get(r,e.detail.action).apply(window,e.detail.arguments)}))}catch(e){throw r.logError("There was an error initializing the sound player. Please check the console for details.",e),e}}},getHandler:e=>"string"==typeof e?n.get(r,e):e,compareIds(e,t){const[a,n]=e.split(":"),[s,r]=t.split(":"),l=a-s;return 0!==l?l:n-r},disallowedSound({src:e,imageMD5:t}){try{const a=new URL(e);e=e.replace(/^(https?:)?\/\//,"");const n=a.hostname.toLowerCase(),s={};s.host=!r.config.allow.find((e=>n===e||n.endsWith("."+e)))&&n;for(let a of r.config.filters)if(s.image=s.image||a===t&&t,s.sound=s.sound||a.replace(/^(https?:)?\/\//,"")===e&&e,s.image&&s.sound)break;return!!(s.host||s.image||s.sound)&&s}catch(e){return{invalid:!0}}},syncTab:(e,t)=>"undefined"!=typeof GM_addValueChangeListener&&GM_addValueChangeListener(e,((e,a,n,s)=>{s&&t(n,a)})),logError(e,t,a){console.error("[4chan sounds player]",e,t),t instanceof PlayerError&&(t.error&&console.error("[4chan sound player]",t.error),e=t.reason,a=t.type||a),r.alert(e,a||"error",5)},alert(e,t="info",a=5){isChanX?(e=n.element(`${e}r[t]=r[e][t])),(r[e].public||[]).forEach((t=>{r._public.push((r[e].atRoot||[]).includes(t)?t:`${e}.${t}`)}))},218:(e,t,a)=>{var n=a(4302);e.exports={"4chan":{postIdPrefix:"p",posts:".post",filename:{".fileText .file-info .fnfull":"textContent",".fileText .file-info > a":"textContent",".fileText > a":"title",".fileText":"textContent"},thumb:".fileThumb",expandedImage:isChanX?".full-image":".expanded-thumb, .expandedWebm",hoverImage:isChanX?"#ihover":"#image-hover",playLink:{class:"",text:n.playFill,relative:".fileText a",position:"afterend",prependText:" ",unfilterText:n.filter},styleFetcher:"post reply style-fetcher",limitWidthOf:".thread > .postContainer"},FoolFuuka:{postIdPrefix:"",posts:"article",filename:{".thread_image_box .post_file_filename":"textContent",".post_file_filename":"title"},thumb:".thread_image_link",playLink:{class:"btnr",text:"Play",relative:".post_controls",position:"beforeend",unfilterText:"Add"},styleFetcher:"post_wrapper style-fetcher",limitWidthOf:".posts > article.post"},Fuuka:{postIdPrefix:"p",posts:".content > div, td.reply",filename:{":scope > br + span":"textContent"},filenameParser:e=>e.split(", ").slice(2).join(", "),thumb:".thumb",playLink:{class:"",text:"play",relative:"br:nth-of-type(2)",position:"beforebegin",prependText:" [",appendText:"]",unfilterText:"add"},styleFetcher:"reply style-fetcher",limitWidthOf:".content > div, .content > table"}}[Site]},3571:e=>{const t=XMLHttpRequest,a=function(){let e,t,a,n={};return this.open=(a,n)=>{e=a,t=n},this.setRequestHeader=(e,t)=>n[e]=t,this.getAllResponseHeaders=()=>this.responseHeaders,this.getResponseHeader=e=>this._responseHeaders[e.toLowerCase()],this.overrideMimeType=e=>a=e,this.send=s=>{GM.xmlHttpRequest({method:e,url:t,headers:n,data:s,responseType:this.responseType,onload:e=>{Object.assign(this,e),this._responseHeaders=(e.responseHeaders||"").split("\n").reduce(((e,t)=>{let[a,...n]=t.split(": ");return e[a.toLowerCase()]=n.join(": "),e}),{}),this.responseText=e.responseText,this.onload(this)},onerror:this.onerror,onreadystatechange:this.onreadystatechange,ontimeout:this.ontimeout,timeout:this.timeout,overrideMimeType:a})},this.onload=null,this};e.exports.GM=a,e.exports.native=t,e.exports.toGM=function(){XMLHttpRequest=a},e.exports.toNative=function(){XMLHttpRequest=t}}},t={};function a(n){var s=t[n];if(void 0!==s)return s.exports;var r=t[n]={exports:{}};return e[n](r,r.exports,a),r.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";async function e(){a(1952);const e=a(9211);await e.initialize(),e.posts.addPosts(document.body,!0);new MutationObserver((function(t){t.forEach((function(t){"childList"===t.type&&t.addedNodes.forEach((function(t){t.nodeType===Node.ELEMENT_NODE&&e.posts.addPosts(t)}))}))})).observe(document.body,{childList:!0,subtree:!0}),is4chan&&isOneeChan&&t()}function t(){document.querySelector("#OneeChanLink")?Player.theme.applyBoardTheme():window.setTimeout(t,50)}document.addEventListener("4chanXInitFinished",e),setTimeout((function(){a(1952),isChanX||("loading"!==document.readyState?e():document.addEventListener("DOMContentLoaded",e))}),0)})()})(); \ No newline at end of file diff --git a/package.json b/package.json index f99609c..de6ad53 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "4chan-sounds-player", - "version": "3.5.4", + "version": "3.5.5", "description": "Play that faggy music weeb boi", "main": "main.js", "scripts": {