!function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=34)}({0:function(t,e,n){"use strict";var o=class{get(t=null){return new Promise((e,n)=>{const o="string"==typeof t||"number"==typeof t;chrome.storage[this.store].get(t,n=>{e(o?n[t]:n)})})}getBytesInUse(t=null){return new Promise((e,n)=>{chrome.storage[this.store].getBytesInUse(t,e)})}set(t){return new Promise((e,n)=>{chrome.storage[this.store].set(t,e)})}remove(t){return new Promise((e,n)=>{chrome.storage[this.store].remove(t,e)})}clear(){return new Promise((t,e)=>{chrome.storage[this.store].clear(t)})}listen(t,e){"function"==typeof t&&(e=t,t=null),chrome.storage.onChanged.addListener((n,o)=>{if(o===this.store)if(null!==t){if(n.hasOwnProperty(t)){const o=n[t].oldValue||null,r=n[t].newValue||null;e(o,r)}}else e(n)})}};new class extends o{constructor(){super(),this.store="local"}};const r=new class extends o{constructor(){super(),this.store="sync"}};new class{create(t=null,e){return"object"==typeof t&&(e=t,t=null),new Promise((n,o)=>{chrome.notifications.create(t,e,n)})}update(t,e){return new Promise((n,o)=>{chrome.notifications.update(t,e,n)})}clear(t){return new Promise((e,n)=>{chrome.notifications.clear(t,e)})}getAll(){return new Promise((t,e)=>{chrome.notifications.getAll(t)})}getPermissionLevel(){return new Promise((t,e)=>{chrome.notifications.getPermissionLevel(t)})}listen(t,e=null,n){if("function"==typeof e&&(n=e,e=null),"onPermissionLevelChanged"===t||"onShowSettings"===t)return this._nonNotificationIdListen(t,n);const o=null!==e?(t,...o)=>{e===t&&n(t,...o)}:n;chrome.notifications[t].addListener(o)}_nonNotificationIdListen(t,e){chrome.notifications[t].addListener(e)}};var i=n(1);e.a=new class extends i.EventEmitter{constructor(){super(),this._data=null,this.state="initiating",this._init()}async _init(){const t=await r.get();this._initListener(),this._data=t,this.state="ready",this.emit(this.state)}_initListener(){r.listen(t=>{Object.keys(t).forEach(e=>{t[e].hasOwnProperty("newValue")?this._data[e]=t[e].newValue:console.error("No newValue in sync storge change")}),this.emit("change",this.data,t)})}set(t){return r.set(t)}get data(){return this._data}has(t){return this.data.hasOwnProperty(t)}}},1:function(t,e,n){"use strict";var o,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};o=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,t.exports.once=function(t,e){return new Promise((function(n,o){function r(){void 0!==i&&t.removeListener("error",i),n([].slice.call(arguments))}var i;"error"!==e&&(i=function(n){t.removeListener(e,r),o(n)},t.once("error",i)),t.once(e,r)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function h(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function d(t,e,n,o){var r,i,a;if(l(n),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),i=t._events),a=i[e]),void 0===a)a=i[e]=n,++t._eventsCount;else if("function"==typeof a?a=i[e]=o?[n,a]:[a,n]:o?a.unshift(n):a.push(n),(r=h(t))>0&&a.length>r&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=a.length,function(t){console&&console.warn&&console.warn(t)}(s)}return t}function u(t,e,n){var o={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},r=function(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}.bind(o);return r.listener=n,o.wrapFn=r,r}function m(t,e,n){var o=t._events;if(void 0===o)return[];var r=o[e];return void 0===r?[]:"function"==typeof r?n?[r.listener||r]:[r]:n?function(t){for(var e=new Array(t.length),n=0;n0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=r[t];if(void 0===c)return!1;if("function"==typeof c)i(c,this,e);else{var l=c.length,h=f(c,l);for(n=0;n=0;i--)if(n[i]===e||n[i].listener===e){a=n[i].listener,r=i;break}if(r<0)return this;0===r?n.shift():function(t,e){for(;e+1=0;o--)this.removeListener(t,e[o]);return this},s.prototype.listeners=function(t){return m(this,t,!0)},s.prototype.rawListeners=function(t){return m(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?o(this._events):[]}},10:function(t,e,n){var o=n(11);"string"==typeof o&&(o=[[t.i,o,""]]);n(4)(o,{hmr:!0,transform:void 0,insertInto:void 0}),o.locals&&(t.exports=o.locals)},11:function(t,e,n){(t.exports=n(3)(!1)).push([t.i,".chat-color-0 #content #author-name {\n color: #536dfe !important;\n}\n.chat-color-1 #content #author-name {\n color: #2196f3 !important;\n}\n.chat-color-2 #content #author-name {\n color: #03a9f4 !important;\n}\n.chat-color-3 #content #author-name {\n color: #00bcd4 !important;\n}\n.chat-color-4 #content #author-name {\n color: #009688 !important;\n}\n.chat-color-5 #content #author-name {\n color: #4caf50 !important;\n}\n.chat-color-6 #content #author-name {\n color: #8bc34a !important;\n}\n.chat-color-7 #content #author-name {\n color: #cddc39 !important;\n}\n.chat-color-8 #content #author-name {\n color: #ffeb3b !important;\n}\n.chat-color-9 #content #author-name {\n color: #ffc107 !important;\n}\n.chat-color-A #content #author-name {\n color: #f44336 !important;\n}\n.chat-color-B #content #author-name {\n color: #e91e63 !important;\n}\n.chat-color-C #content #author-name {\n color: #9c27b0 !important;\n}\n.chat-color-D #content #author-name {\n color: #673ab7 !important;\n}\n.chat-color-E #content #author-name {\n color: #536dfe !important;\n}\n.chat-color-F #content #author-name {\n color: #2196f3 !important;\n}\n.chat-color-G #content #author-name {\n color: #03a9f4 !important;\n}\n.chat-color-H #content #author-name {\n color: #00bcd4 !important;\n}\n.chat-color-I #content #author-name {\n color: #009688 !important;\n}\n.chat-color-J #content #author-name {\n color: #4caf50 !important;\n}\n.chat-color-K #content #author-name {\n color: #8bc34a !important;\n}\n.chat-color-L #content #author-name {\n color: #cddc39 !important;\n}\n.chat-color-M #content #author-name {\n color: #ffeb3b !important;\n}\n.chat-color-N #content #author-name {\n color: #ffc107 !important;\n}\n.chat-color-O #content #author-name {\n color: #ff9800 !important;\n}\n.chat-color-P #content #author-name {\n color: #ff5722 !important;\n}\n.chat-color-Q #content #author-name {\n color: #f44336 !important;\n}\n.chat-color-R #content #author-name {\n color: #e91e63 !important;\n}\n.chat-color-S #content #author-name {\n color: #9c27b0 !important;\n}\n.chat-color-T #content #author-name {\n color: #673ab7 !important;\n}\n.chat-color-U #content #author-name {\n color: #536dfe !important;\n}\n.chat-color-V #content #author-name {\n color: #2196f3 !important;\n}\n.chat-color-W #content #author-name {\n color: #03a9f4 !important;\n}\n.chat-color-X #content #author-name {\n color: #00bcd4 !important;\n}\n.chat-color-Y #content #author-name {\n color: #009688 !important;\n}\n.chat-color-Z #content #author-name {\n color: #4caf50 !important;\n}\n.chat-color-a #content #author-name {\n color: #8bc34a !important;\n}\n.chat-color-b #content #author-name {\n color: #cddc39 !important;\n}\n.chat-color-c #content #author-name {\n color: #ffeb3b !important;\n}\n.chat-color-d #content #author-name {\n color: #ffc107 !important;\n}\n.chat-color-e #content #author-name {\n color: #ff9800 !important;\n}\n.chat-color-f #content #author-name {\n color: #ff5722 !important;\n}\n.chat-color-g #content #author-name {\n color: #f44336 !important;\n}\n.chat-color-h #content #author-name {\n color: #e91e63 !important;\n}\n.chat-color-i #content #author-name {\n color: #9c27b0 !important;\n}\n.chat-color-j #content #author-name {\n color: #673ab7 !important;\n}\n.chat-color-k #content #author-name {\n color: #536dfe !important;\n}\n.chat-color-l #content #author-name {\n color: #2196f3 !important;\n}\n.chat-color-m #content #author-name {\n color: #03a9f4 !important;\n}\n.chat-color-n #content #author-name {\n color: #00bcd4 !important;\n}\n.chat-color-o #content #author-name {\n color: #009688 !important;\n}\n.chat-color-p #content #author-name {\n color: #4caf50 !important;\n}\n.chat-color-q #content #author-name {\n color: #8bc34a !important;\n}\n.chat-color-r #content #author-name {\n color: #cddc39 !important;\n}\n.chat-color-s #content #author-name {\n color: #ffeb3b !important;\n}\n.chat-color-t #content #author-name {\n color: #ffc107 !important;\n}\n.chat-color-u #content #author-name {\n color: #ff9800 !important;\n}\n.chat-color-v #content #author-name {\n color: #ff5722 !important;\n}\n.chat-color-w #content #author-name {\n color: #f44336 !important;\n}\n.chat-color-x #content #author-name {\n color: #e91e63 !important;\n}\n.chat-color-y #content #author-name {\n color: #9c27b0 !important;\n}\n.chat-color-z #content #author-name {\n color: #673ab7 !important;\n}\n.chat-color-- #content #author-name {\n color: #ff9800 !important;\n}\n.chat-color-_ #content #author-name {\n color: #ff5722 !important;\n}\n.AuthorFix #author-photo.yt-live-chat-text-message-renderer img.yt-img-shadow {\n display: inline-block;\n vertical-align: middle;\n border-radius: 50%;\n height: 1.5em;\n width: 1.5em;\n vertical-align: sub;\n}\n.AuthorFix #content {\n display: inline-block;\n vertical-align: middle;\n}\n.AuthorFix #timestamp.yt-live-chat-text-message-renderer {\n font-size: 1em;\n display: inline-block;\n vertical-align: middle;\n}\n.showTimeStamp #timestamp.yt-live-chat-text-message-renderer {\n display: inline-block;\n}\n.Emote img {\n height: 1.75em;\n align-self: center;\n vertical-align: sub;\n display: inline-block;\n vertical-align: middle;\n}\nemote_div:hover {\n background-size: 100%;\n background-color: rgba(255,255,255,0.6);\n}\n.hideElement {\n display: none !important;\n}\n.set-background-color-one {\n background-color: #303030 !important;\n}\n.set-background-color-two {\n background-color: transparent !important;\n}\n.setTwitchColors {\n text-shadow: 0 0 1px #000, 0 0 2px #000 !important;\n background: #18181b !important;\n font-family: 'Roboto' !important;\n font-size: 1.3rem !important;\n line-height: 1.5em !important;\n color: #fafafa !important;\n}\n.setTwitchColors #timestamp.yt-live-chat-text-message-renderer {\n display: none;\n}\n.setTwitchColors yt-live-chat-author-chip[is-highlighted] #author-name.owner.yt-live-chat-author-chip,\n.setTwitchColors #author-name.owner.yt-live-chat-author-chip {\n background-color: transparent;\n color: #008000;\n}\n.setTwitchColors yt-live-chat-author-chip[is-highlighted] #author-name.yt-live-chat-author-chip {\n background-color: transparent;\n}\n.emoteDivider {\n width: 60vw;\n border: 2px solid #d3d3d3;\n border-radius: 5px;\n margin-top: 2%;\n margin-bottom: 2%;\n margin-left: auto;\n margin-right: auto;\n}\n.emotePopUpText {\n margin-bottom: 2%;\n}\n.popup {\n background-color: #202020;\n position: absolute;\n top: 15%;\n left: 0;\n right: 0;\n margin-left: auto;\n margin-right: auto;\n height: 70%;\n width: 75%;\n z-index: 999;\n text-align: center;\n border-radius: 5px;\n border: #303030 1px solid;\n font-size: 1em;\n overflow: hidden;\n overflow-y: scroll;\n padding: 1%;\n padding-top: 2%;\n}\n.emoteButton {\n background-color: rgba(255,255,255,0.1);\n background-image: url(\"https://cdn.frankerfacez.com/emoticon/447885/4\");\n background-repeat: no-repeat;\n background-position: center;\n background-size: 80% 80%;\n width: var(--yt-live-chat-32px-icon-button_-_width);\n height: var(--yt-live-chat-32px-icon-button_-_height);\n padding: var(--yt-live-chat-32px-icon-button_-_padding);\n border-radius: 10px;\n border: none;\n cursor: pointer;\n}\n.emoteButton:hover {\n background-color: rgba(255,255,255,0.8);\n}\n.emoteButton:focus {\n outline: 0;\n}\n.body_Fix {\n height: 100% !important;\n margin: 0 !important;\n overflow: hidden !important;\n}\n.theater_wrapper_fix {\n padding: 2px;\n background-color: #1e1e1e;\n position: fixed;\n z-index: 900 !important;\n height: 100vh !important;\n width: 100vw !important;\n}\n.movie_player_fix {\n height: 100vh;\n position: absolute;\n width: calc(100vw - 25vw);\n}\n.movie_player_fix video {\n left: 0 !important;\n top: 0 !important;\n height: 100vh !important;\n width: calc(100vw - 25vw) !important;\n}\n.movie_player_fix #html5-video-player {\n top: 0 !important;\n width: calc(100vw - 25vw) !important;\n}\n.movie_player_fix .ytp-title {\n color: rgba(255,255,255,0.8) !important;\n}\n.movie_player_fix .ytp-title-channel {\n all: unset;\n}\n.movie_player_fix .ytp-gradient-top {\n max-width: calc(100vw - 25vw) !important;\n}\n.movie_player_fix .ytp-chrome-bottom {\n width: calc(100vw - 25vw) !important;\n left: 0 !important;\n}\n.movie_player_fix .html5-endscreen {\n width: calc(100vw - 25vw) !important;\n}\n.movie_player_fix .ytp-chapter-hover-container {\n width: calc(100vw - 25vw) !important;\n}\n.movie_player_fix .ytp-gradient-bottom {\n width: calc(100vw - 25vw) !important;\n}\n.movie_player_fix .ytp-iv-video-content {\n width: calc(100vw - 25vw) !important;\n left: 0 !important;\n}\n.movie_player_fix .ytp-player-content.ytp-iv-player-content {\n width: calc(100vw - 25vw) !important;\n left: -12px !important;\n bottom: 10vh !important;\n}\n.movie_player_fix .ytp-upnext.ytp-player-content.ytp-upnext-autoplay-paused.ytp-suggestion-set {\n width: calc(100vw - 25vw) !important;\n left: 0 !important;\n}\n.movie_player_fix .ytp-bezel-text-hide {\n width: calc(100vw - 25vw) !important;\n left: 0 !important;\n}\n.movie_player_fix .ytp-spinner {\n left: 40% !important;\n}\n.movie_player_fix .ytp-cued-thumbnail-overlay {\n width: calc(100vw - 25vw) !important;\n}\n.info_contents_fix {\n z-index: 901 !important;\n height: 80px;\n top: 0;\n position: absolute !important;\n width: calc(100vw - 25vw) !important;\n}\n.info_contents_fix ytd-video-primary-info-renderer {\n padding: 1rem;\n border-bottom: none;\n}\n.chat_frame_fix {\n height: 100vh !important;\n width: calc(calc(100vw - 75vw) - 1px) !important;\n position: absolute !important;\n right: 0px !important;\n top: 0px !important;\n border: 1px solid #4e4e4e;\n}\n",""])},3:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",o=t[3];if(!o)return n;if(e&&"function"==typeof btoa){var r=function(t){return"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(t))))+" */"}(o),i=o.sources.map((function(t){return"/*# sourceURL="+o.sourceRoot+t+" */"}));return[n].concat(i).concat([r]).join("\n")}return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},r=0;r\n ${this.code}\n \n `.trim()}},i=new class{constructor(){this.dictionary=new Map,this.twitch_Dictionary=new Map,this.bttv_Dictionary=new Map,this.franker_Dictionary=new Map,this.specialEmotesDictionary=new Map,this.init=this.init.bind(this)}init(){return Promise.all([o.a.data.options.enableBTTVEmotes&&this.loadBTTVEmote(),o.a.data.options.enableFrankerEmotes&&this.loadFrankerEmotes(),o.a.data.options.enableTwitchEmotes&&this.loadTwitchEmotes(),this.specialEmotes()])}get(t){return this.dictionary.get(t)}set(t,e){return this.dictionary.set(t,new r(e))}has(t){return this.dictionary.has(t)}bbtv_ToDict(t){for(let e=0;e{let e=!1;t.forEach(t=>{if(void 0!==t.removedNodes&&!(t.removedNodes.length<=0))for(let n=0,o=t.removedNodes.length;n',n.parentNode.replaceChild(t,n)}}}o.a.data.options.setAuthorColor&&"owner"!==this.node.getAttribute("author-type")&&this.setAuthorColor();var n=this.node.querySelector("#author-photo");o.a.data.options.hideAuthorIcons&&n.classList.add("hideElement"),this.node.querySelector("#timestamp"),o.a.data.options.showTimeStamp&&this.node.classList.add("showTimeStamp"),this.node.querySelector("#author-name").addEventListener("click",(function(){var t=document.querySelector("#input.yt-live-chat-text-input-field-renderer"),e=document.querySelector("#label.yt-live-chat-text-input-field-renderer");t.innerText="@"+this.innerText,t.innerText.length,t.focus(),e.innerText=""}));var r=o.a.data.options.textSizeSlider;o.a.data.options.allowTextSlider&&(this.node.setAttribute("style","font-size:"+r+"px!important"),this.node.classList.add("AuthorFix")),o.a.data.options.setTwitchColors&&(this.node.classList.add("setTwitchColors"),n.classList.add("hideElement")),o.a.data.options.alternateLineColor&&this.alternateLineColor()}setAuthorColor(){let t=null;if(this.node.hasChildNodes&&this.node.contains(this.node.querySelector("#author-photo"))&&null!=this.node.querySelector("#author-photo").querySelector("img").src){t=this.node.querySelector("#author-photo").querySelector("img").src;const e=/\/-([A-Za-z-_\d])/;try{if(null!==e.exec(t)){const n=e.exec(t)[1];this.node.classList.add("chat-color-"+n)}}catch(e){console.log(e),console.log(t)}}}alternateLineColor(){a%2==0&&this.node.classList.add("set-background-color-one"),a%2!=0&&this.node.classList.add("set-background-color-two"),a++}removelternateLineColor(){this.node.classList.remove("set-background-color-one"),this.node.classList.remove("set-background-color-two")}},c=n(1),l=n.n(c),h=class extends l.a{constructor(){super(),this.target=document.querySelector("head > title"),this.observer=null,this.init()}init(){this.observer=new MutationObserver(t=>{t.forEach(t=>{"YouTube Gaming"===t.target.innerText?this.emit("main"):this.emit("change")})}),null!==this.target&&this.observer.observe(this.target,{childList:!0,attributes:!1,characterData:!0,subtree:!0})}};const d=()=>{const t=document.querySelector(".ytp-time-display"),e=document.querySelector("yt-live-chat-app"),n=document.querySelector(".yt-live-chat-renderer-0"),o=t&&t.classList.contains("ytp-live"),r=document.body.contains(e)||document.body.contains(n);return o||r};let u=null;const m=document.createElement("theater_wrapper");document.body.appendChild(m);var p=!1;function f(){p?(console.log("enterTheater"),p=!1,v()):document.getElementById("player-theater-container").contains(document.getElementById("player-container"))?(console.log("exitTheater"),function(){const t=document.getElementById("movie_player"),e=document.getElementById("chatframe"),n=document.getElementById("info-contents"),o=document.getElementById("player-container"),r=document.getElementById("player-container-inner"),i=document.getElementById("chat"),a=document.getElementById("meta");document.getElementById("masthead-container").hidden=!1,m.classList.remove("theater_wrapper_fix"),t.classList.remove("movie_player_fix"),e.classList.remove("chat_frame_fix"),n.classList.remove("info_contents_fix"),o.prepend(t),r.prepend(o),i.prepend(e),a.before(n),document.body.classList.remove("body_Fix")}()):(console.log("enterTheater"),v())}function v(){const t=document.getElementById("movie_player"),e=document.getElementById("chatframe"),n=document.getElementById("info-contents");document.getElementById("masthead-container").hidden=!0,m.classList.add("theater_wrapper_fix"),t.classList.add("movie_player_fix"),e.classList.add("chat_frame_fix"),n.classList.add("info_contents_fix"),m.append(n),m.append(t),m.append(e),document.body.classList.add("body_Fix")}o.a.on("ready",()=>{u=new class{constructor(){this.chatWatcher=null,this.chatScroller=null,this.routeWatcher=null,this.onRouteChange=this.onRouteChange.bind(this),this.load()}load(){this.routeWatcher=new h,this.routeWatcher.on("change",this.onRouteChange),this.onRouteChange()}onRouteChange(){d()&&(!!document.querySelector("ytg-app")||!!window.frameElement||!window.frameElement&&window.location!=window.parent.location||!window.frameElement&&!!window.location.href.includes("is_popout=1")&&!!window.location.href.includes("popout=1"))&&this.init(),d()&&o.a.data.options.theaterModeFix&&null!=document.getElementById("player-container")&&null!=document.getElementById("player-theater-container")&&function(){var t=document.querySelector("button.ytp-size-button.ytp-button");t&&(document.getElementById("player-theater-container").contains(document.getElementById("player-container"))&&(p=!0,f()),t.addEventListener("click",f,!1))}()}init(){this.chatWatcher=new class{constructor(){this.watchChat=this.watchChat.bind(this),this._chatContainer=null,this._observer=null,this.messages=new Map}init(){return new Promise((t,e)=>{this.getChatContainer().then(i.init).then(()=>{this.addEmotePopup(),this.watchChat(),this.parsePreloadedMessages()})})}getChatContainer(){const t=(e,n)=>{this._chatContainer=document.querySelector("#items.style-scope.yt-live-chat-item-list-renderer"),null!==this._chatContainer?e():setTimeout(t.bind(this,e,n),250)};return new Promise(t)}parsePreloadedMessages(){const t=this._chatContainer.children;for(let e=t.length-1;e>=0;e--){const n=t[e];this.isMessageNode(n)&&new s(n)}}watchChat(){console.log("Chat observer started"),this._observer=new MutationObserver(t=>{t.forEach(t=>{const{addedNodes:e,removedNodes:n}=t;if(void 0!==e&&e.length>0)for(let t=0,n=e.length-1;t<=n;t++){const n=e[t];this.isMessageNode(n)&&this.onNewMessage(n)}if(void 0!==n&&n.length>0)for(let t=0,e=n.length-1;t<=e;t++){const e=n[t];this.isMessageNode(e)&&this.isObservedMessage(e)&&this.onObservedMessageRemoved(e)}})}),this._observer.observe(this._chatContainer,{childList:!0,attributes:!1,characterData:!1,subtree:!1})}onNewMessage(t){const e=new s(t);e.hasEmotes&&this.messages.set(e.id,e)}onObservedMessageRemoved(t){const e=t.getAttribute("message-id"),n=this.messages.get(e);null!=n&&n.destroy(),this.messages.delete(e)}isMessageNode(t){return"YT-LIVE-CHAT-TEXT-MESSAGE-RENDERER"===t.tagName}isObservedMessage(t){return null!==t.getAttribute("message-id")}addEmotePopup(){const t=document.createElement("button");t.classList.add("emoteButton"),t.textContent="";const e=document.getElementById("action-buttons");e.parentNode.insertBefore(t,e);const n=document.createElement("div");function r(t){var e=document.createElement("hr");e.classList.add("emoteDivider");for(let e=0;e{this.scroller.addEventListener("mouseenter",this.stop),this.start()})}start(){this.interval=setInterval(this.scroll,250)}stop(){clearInterval(this.interval)}scroll(){this.scroller.scrollTop=9999}getScroller(){const t=(e,n)=>{this.scroller=document.getElementById("item-scroller"),null!==this.scroller?e():setTimeout(t.bind(this,e,n),250)};return new Promise(t)}},this.chatScroller.init(),o.a.data.options.setLiveChat&&document.getElementsByClassName("yt-simple-endpoint style-scope yt-dropdown-menu").item(1).click(),console.log("INIT")}}})},4:function(t,e,n){var o={},r=function(t){var e;return function(){return void 0===e&&(e=t.apply(this,arguments)),e}}((function(){return window&&document&&document.all&&!window.atob})),i=function(t){var e={};return function(t,n){if("function"==typeof t)return t();if(void 0===e[t]){var o=function(t,e){return e?e.querySelector(t):document.querySelector(t)}.call(this,t,n);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(t){o=null}e[t]=o}return e[t]}}(),a=null,s=0,c=[],l=n(5);function h(t,e){for(var n=0;n=0&&c.splice(e,1)}function p(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var o=n.nc;o&&(t.attrs.nonce=o)}return f(e,t.attrs),u(t,e),e}function f(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function v(t,e){var n,o,r,i;if(e.transform&&t.css){if(!(i=e.transform(t.css)))return function(){};t.css=i}if(e.singleton){var c=s++;n=a||(a=p(e)),o=g.bind(null,n,c,!1),r=g.bind(null,n,c,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",f(e,t.attrs),u(t,e),e}(e),o=function(t,e,n){var o=n.css,r=n.sourceMap,i=void 0===e.convertToAbsoluteUrls&&r;(e.convertToAbsoluteUrls||i)&&(o=l(o)),r&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var a=new Blob([o],{type:"text/css"}),s=t.href;t.href=URL.createObjectURL(a),s&&URL.revokeObjectURL(s)}.bind(null,n,e),r=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=p(e),o=function(t,e){var n=e.css,o=e.media;if(o&&t.setAttribute("media",o),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}.bind(null,n),r=function(){m(n)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else r()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=r()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=d(t,e);return h(n,e),function(t){for(var r=[],i=0;i