!function(e){!functiont(e,n,o){functioni(s,a){if(!n[s]){if(!e[s]){varl="function"==typeofrequire&&require;if(!a&&l)returnl(s,!0);if(r)returnr(s,!0);thrownewError("Cannot find module '"+s+"'")}varc=n[s]={exports:{}};e[s][0].call(c.exports,function(t){varn=e[s][1][t];returni(n?n:t)},c,c.exports,t,e,n,o)}returnn[s].exports}for(varr="function"==typeofrequire&&require,s=0;s<o.length;s++)i(o[s]);returni}({1:[function(t){varn=e.FrankerFaceZ,o=t("./constants"),i=t("./utils");n.prototype.setup_badges=function(){this.log("Preparing badge system."),this.badges={},this.log("Creating badge style element.");vare=this._badge_style=document.createElement("style");e.id="ffz-badge-css",document.head.appendChild(e),this.log("Adding legacy donor badges."),this._legacy_add_donors()};varr=function(e){return".badges .ffz-badge-"+e.id+" { background-color: "+e.color+'; background-image: url("'+e.image+'"); '+(e.extra_css||"")+"}"};n.prototype.bttv_badges=function(e){vart=e.sender,n=this.users[t],o=[],i=-1;if(n&&n.badges){for(varr=0;r<e.badges.length;r++){vars=e.badges[r];if("subscriber"==s.type||"turbo"==s.type){i=r;break}}for(varainn.badges)if(n.badges.hasOwnProperty(a)){vars=n.badges[a],l=this.badges[s.id]||{},c=s.title||l.title,u="",d=BetterTTV.settings.get("alphaTags");s.image&&(u+='background-image: url(\\"'+s.image+'\\"); '),s.color&&!d&&(u+="background-color: "+s.color+"; "),s.extra_css&&(u+=s.extra_css),u&&(c+='" style="'+u),o.push([(-1==i?1:-1)*a,{type:"ffz-badge-"+s.id+(d?" alpha":""),name:"",description:c}])}if(o.sort(function(e,t){returne[0]-t[0]}),-1==i)for(;o.length;)e.badges.push(o.shift()[1]);elsefor(;o.length;)e.badges.insertAt(i,o.shift()[1])}},n.prototype.render_badge=function(e){vart=e.get("context.model.from"),n=e.get("context.parentController.content.id"),o=e.$(".badges"),i=this.users[t];if(i&&i.badges){varr=o.find(".badge").filter(function(){vare=this.title.toLowerCase();return"subscriber"==e||"turbo"==e}).first(),s=[],a=!!r.length;for(varlini.badges)if(i.badges.hasOwnProperty(l)){varc=i.badges[l],u=this.badges[c.id]||{};if(void0!==u.visible){vard=u.visible;if("function"==typeofd)try{d=d.bind(this)(n,t)}catch(h){}if(!d)continue}varp=document.createElement("div");p.className="badge float-left tooltip ffz-badge-"+c.id,p.setAttribute("title",c.title||u.title),c.image&&(p.style.backgroundImage='url("'+c.image+'")'),c.color&&(p.style.backgroundColor=c.color),c.extra_css&&(p.style.cssText+=c.extra_css),s.push([(a?1:-1)*l,p])}if(s.sort(function(e,t){returne[0]-t[0]}),a)for(;s.length;)r.before(s.shift()[1]);elsefor(;s.length;)o.append(s.shift()[1])}},n.known_bots=["quoteconut","quoconut","zenwan","nightbot","moobot","xanbot"],n.prototype._legacy_add_donors=function(e){this.badges[1]={id:1,title:"FFZ Donor",color:"#755000",image:"//cdn.frankerfacez.com/channel/global/donoricon.png"},i.update_css(this._badge_style,1,r(this.badges[1])),this.badges[0]={id:0,title:"FFZ Developer",color:"#FAAF19",image:"//cdn.frankerfacez.com/channel/global/devicon.png"},i.update_css(this._badge_style,0,r(this.badges[0])),this.users.sirstendec={badges:{0:{id:0}}},jQuery.ajax(o.SERVER+"script/donors.txt",{cache:!1,context:this}).done(function(e){this._legacy_parse_donors(e)}).fail(function(t){return404!=t.status?(e=(e||0)+1,10>e?this._legacy_add_donors(e):void0):void0})},n.prototype._legacy_parse_donors=function(e){vart=0;if(null!=e)for(varn=e.trim().split(/\W+/),o=0;o<n.length;o++){varr=n[o],s=this.users[r]=this.users[r]||{},a=s.badges=s.badges||{};a[0]||(a[0]={id:1},t+=1)}this.log("Added donor badge to "+i.number_commas(t)+" users.")}},{"./constants":3,"./utils":27}],2:[function(){vart=e.FrankerFaceZ;t.ffz_commands.log=function(e){this._pastebin(this._log_data.join("\n"),function(t){returnt?voidthis.room_message(e,"Your FrankerFaceZ log has been pasted to: "+t):this.room_message(e,"There was an error uploading the FrankerFaceZ log.")})},t.ffz_commands.massunmod=function(e,t){if(t=t.join(" ").trim(),!t.length)return"You must provide a list of users to unmod.";t=t.split(/\W*,\W*/);varn=this.get_user();i
}).fail(function(o){return404==o.status?this._legacy_load_room_css(e,t,null):(n=n||0,n++,10>n?this._legacy_add_room(e,t,n):void0)})},n.prototype._legacy_load_room_css=function(e,t,n){vars=e,a=s.match(r);a&&a[1]&&(s=a[1]);varl={id:e,menu_sets:[s],sets:[s],moderator_badge:null,css:null};returnn&&(n=n.replace(o,"").trim()),n&&(n=n.replace(i,function(e,t){returnl.moderator_badge||"modicon.png"!==t.substr(-11)?e:(l.moderator_badge=t,"")})),l.css=n||null,this._load_room_json(e,t,l)}},{"../constants":3,"../utils":27}],9:[function(){vart=e.FrankerFaceZ;t.prototype.setup_viewers=function(){this.log("Hooking the Ember Viewers controller.");vare=App.__container__.resolve("controller:viewers");this._modify_viewers(e)},t.prototype._modify_viewers=function(e){varn=this;e.reopen({lines:function(){vare=this._super();try{varo=[],i={},r=null,s=App.__container__.lookup("controller:channel"),a=this.get("parentController.model.id"),l=s&&s.get("id");if(l){varc=s.get("display_name");c&&(t.capitalization[l]=[c,Date.now()])}a!=l&&(l=null);for(varu=0;u<e.length;u++){vard=e[u];if(d.category)r=d.category,o.push(r),i[r]=[];else{varh=d.chatter.toLowerCase();if(!h)continue;h==l?(o.unshift("Broadcaster"),i.Broadcaster=[h]):i.hasOwnProperty(r)&&i[r].push(h)}}e=[];for(varu=0;u<o.length;u++){varp=o[u],m=i[p];if(m&&m.length)for(e.push({category:p}),e.push({chatter:""}),m.sort();m.length;){varh=m.shift();h=t.get_capitalization(h),e.push({chatter:h})}}}catch(_){n.error("ViewersController lines: "+_)}returne}.property("content.chatters")})}},{}],10:[function(t){varn=e.FrankerFaceZ,o=/\.([\w\-_]+)\s*?\{content:\s*?"([^"]+)";\s*?background-image:\s*?url\("([^"]+)"\);\s*?height:\s*?(\d+)px;\s*?width:\s*?(\d+)px;\s*?margin:([^;}]+);?([^}]*)\}/gm,i=/[^\n}]*\.badges\s+\.moderator\s*{\s*background-image:\s*url\(\s*['"]([^'"]+)['"][^}]+(?:}|$)/,r=t("./constants"),s=t("./utils"),a=function(e,t,n){t&&(n.global=!0,this.global_sets.push(e))},l=function(e,t){varn=e.split(/ +/);return2!=n.length?e:(n[0]=parseFloat(n[0]),n[1]=parseFloat(n[1]),n[0]==(t-18)/-2&&0==n[1]?null:e)},c=function(e){vart=e.margins;returnt||(t=(e.height-18)/-2+"px 0"),".ffz-emote-"+e.id+' { background-image: url("'+e.url+'"); height: '+e.height+"px; width: "+e.width+"px; margin: "+t+(e.extra_css?"; "+e.extra_css:"")+"}\n"},u=function(e){returne.margins||e.extra_css?c(e)+'img[src="'+e.url+'"] { '+(e.margins?"margin: "+e.margins+";":"")+(e.extra_css||"")+" }\n":c(e)},d=u;n.prototype.setup_emoticons=function(){this.log("Preparing emoticon system."),this.emote_sets={},this.global_sets=[],this._last_emote_id=0,this.log("Creating emoticon style element.");vare=this._emote_style=document.createElement("style");e.id="ffz-emoticon-css",document.head.appendChild(e),this.log("Loading global emote set."),this.load_set("global",a.bind(this,"global"))},n.prototype.getEmotes=function(e,t){varn=this.users[e],o=this.rooms[t];return_.union(n&&n.sets||[],o&&o.sets||[],this.global_sets)},n.ws_commands.reload_set=function(e){this.load_set(e)},n.prototype.load_set=function(e,t){returnthis._legacy_load_set(e,t)},n.prototype.unload_set=function(e){vart=this.emote_sets[e];if(t){this.log("Unloading emoticons for set: "+e),s.update_css(this._emote_style,e,null),deletethis.emote_sets[e];for(varn=0;n<t.users.length;n++){varo=this.rooms[t.users[n]];o&&o.sets.removeObject(e)}}},n.prototype._load_set_json=function(e,t,n){this.emote_sets[e]=n,n.users=[],n.global=!1,n.count=0;varo="";for(variinn.emotes)if(n.emotes.hasOwnProperty(i)){varr=n.emotes[i];r.klass="ffz-emote-"+r.id,r.regex="!"===r.name[r.name.length-1]?newRegExp("\\b"+r.name+"(?=\\W|$)","g"):newRegExp("\\b"+r.name+"\\b","g"),o+=d(r),n.count++}s.update_css(this._emote_style,e,o+(n.extra_css||"")),this.log("Updated emoticons for set: "+e,n),this.update_ui_link(),t&&t(!0,n)},n.prototype._legacy_load_set=function(e,t,n){jQuery.ajax(r.SERVER+"channel/"+e+".css",{cache:!1,context:this}).done(function(n){this._legacy_load_css(e,t,n)}).fail(function(o){return404==o.status?"function"==typeoft&&t(!1):(n=n||0,n++,10>n?this._legacy_load_set(e,t
var_='image-set(url("'+i+p.id+'/1.0") 1x, url("'+i+p.id+'/2.0") 2x, url("'+i+p.id+'/3.0") 4x)';m.style.backgroundImage="-webkit-"+_,m.style.backgroundImage="-moz-"+_,m.style.backgroundImage="-ms-"+_,m.style.backgroundImage=_,m.title=p.code,m.addEventListener("click",a._add_emote.bind(a,e,p.code)),d.appendChild(m)}t.appendChild(d)}if(!r.length){vard=document.createElement("div");d.className="chat-menu-content center",d.innerHTML="Error Loading Subscriptions",t.appendChild(d)}}catch(f){a.log("My Emotes Menu Error",f),t.innerHTML="";vard=document.createElement("div"),u=document.createElement("div"),g=document.createElement("p");u.className="heading",u.innerHTML="Error Loading Menu",d.appendChild(u),g.className="clearfix",g.textContent=f,d.appendChild(g),d.className="chat-menu-content",t.appendChild(d)}})}}},{"../constants":3}],23:[function(){vart=e.FrankerFaceZ;t.prototype.setup_notifications=function(){this.log("Adding event handler for window focus."),e.addEventListener("focus",this.clear_notifications.bind(this))},t.settings_info.highlight_notifications={type:"boolean",value:!1,category:"Chat",visible:function(){return!this.has_bttv},name:"Highlight Notifications",help:"Display notifications when a highlighted word appears in chat in an unfocused tab.",on_update:function(e,t){if(e&&t){if("denied"===Notification.permission)returnthis.log("Notifications have been denied by the user."),voidthis.settings.set("highlight_notifications",!1);if("granted"!==Notification.permission){varn=this;Notification.requestPermission(function(e){"denied"===e&&(n.log("Notifications have been denied by the user."),n.settings.set("highlight_notifications",!1))})}}}},t.ws_commands.message=function(e){this.show_message(e)},t._notifications={},t._last_notification=0,t.prototype.clear_notifications=function(){for(vareint._notifications){varn=t._notifications[e];if(n)try{n.close()}catch(o){}}t._notifications={},t._last_notification=0},t.prototype.show_notification=function(e,n,o,i,r,s){vara=Notification.permission;if("denied "===a)return!1;if("granted"===a){n=n||"FrankerFaceZ",i=i||1e4;varl={lang:"en-US",dir:"ltr",body:e,tag:o||"FrankerFaceZ",icon:"http://cdn.frankerfacez.com/icon32.png"},c=this,u=newNotification(n,l),d=t._last_notification++;returnt._notifications[d]=u,u.addEventListener("click",function(){deletet._notifications[d],r&&r.bind(c)()}),u.addEventListener("close",function(){deletet._notifications[d],s&&s.bind(c)()}),void("number"==typeofi&&u.addEventListener("show",function(){setTimeout(function(){deletet._notifications[d],u.close()},i)}))}varc=this;Notification.requestPermission(function(){c.show_notification(e,n,o)})},t.prototype.show_message=function(t){e.noty({text:t,theme:"ffzTheme",layout:"bottomCenter",closeWith:["button"]}).show()}},{}],24:[function(t){varn=e.FrankerFaceZ,o=t("../utils");n.prototype.setup_races=function(){this.log("Initializing race support."),this.srl_races={}},n.settings_info.srl_races={type:"boolean",value:!0,category:"Channel Metadata",name:"SRL Race Information",help:'Display information about <a href="http://www.speedrunslive.com/" target="_new">SpeedRunsLive</a> races under channels.',on_update:function(){this.rebuild_race_ui()}},n.ws_on_close.push(function(){vare=App.__container__.lookup("controller:channel"),t=e.get("id"),n=!1;for(varointhis.srl_races)deletethis.srl_races[o],o==t&&(n=!0);n&&this.rebuild_race_ui()}),n.ws_commands.srl_race=function(e){for(vart=App.__container__.lookup("controller:channel"),n=t.get("id"),o=!1,i=0;i<e[0].length;i++){varr=e[0][i];this.srl_races[r]=e[1],r==n&&(o=!0)}if(e[1]){vars=e[1],a=s.twitch_entrants={};for(varlins.entrants)s.entrants.hasOwnProperty(l)&&(s.entrants[l].channel&&(a[s.entrants[l].channel]=l),s.entrants[l].name=l)}o&&this.rebuild_race_ui()},n.prototype.rebuild_race_ui=function(){vare=App.__container__.lookup("controller:channel"),t=e.get("id"),n=this.srl_races[t],o=this.settings.srl_races,i=document.querySelector(".stats-and-actions .channel-actions"),r=i.querySelector("#ffz-ui-race");if(!n||!o)returnr&&r.parentElement.remov