'use strict';chrome.i18n.getMessage("4528089202128275824");chrome.i18n.getMessage("2810417817914017289");chrome.i18n.getMessage("3413021810593924462");var g=chrome.i18n.getMessage("7603034707785674700"),h=chrome.i18n.getMessage("8009014317872238527");chrome.i18n.getMessage("8636962961150071298");chrome.i18n.getMessage("1802762746589457177");var k=chrome.i18n.getMessage("1779193092441017833"),l=chrome.i18n.getMessage("3506175733260505131");var n=function(a,d,c,f,e,b,q,r,t,u){this.s=a;this.l=d;this.f=c;this.g=f;this.h=e;this.i=b;this.j=q;this.o=r;this.m=t;this.b=this.c=!1;this.a=null;m(this,u)},m=function(a,d){if(d=d||window.location.search){for(var c={},f=/([^&=]+)=?([^&]*)/g,e;e=f.exec(d.substring(1));)c[decodeURIComponent(e[1])]=decodeURIComponent(e[2]);if(d=c.routeId)a.s.textContent="Casting:",a.l.textContent="",a.f.title=g,a.g.title=h,p(a),c=function(b){b&&b.key&&" "!=b.key&&"Enter"!=b.key||(a.a&&"connected"==a.a.state&&(a.c=!a.c,
a.a.send('{"type":"MUTE", "data": {"mute":'+a.c+"}}")),p(a))},a.f.onclick=c,a.f.onkeydown=c,a.g.onclick=c,a.g.onkeydown=c,a.o.textContent=k,a.m.textContent=l,c=function(b){b&&b.key&&" "!=b.key&&"Enter"!=b.key||(a.a&&"connected"==a.a.state&&(a.b=!a.b,a.a.send('{"type":"LOCAL_PRESENT", "data": {"local":'+a.b+"}}")),v(a))},a.h.onclick=c,a.h.onkeydown=c,(new PresentationRequest("https://hangouts.google.com/cloudmrp-mirroring")).reconnect(d).then(function(b){a.a=b;a.a.onmessage=a.u.bind(a);a.a.onconnect=
function(){a.a.send('{"type":"STATUS_REQUEST"}')}},null)}},p=function(a){a.c?(a.g.style.display="",a.f.style.display="none"):(a.g.style.display="none",a.f.style.display="")},v=function(a){a.b?(a.i.className="checked paper-checkbox",a.j.className="paper-checkbox"):(a.i.className="paper-checkbox",a.j.className="hidden paper-checkbox")};
n.prototype.u=function(a){if(a=a.data)a=JSON.parse(a),"STATUS_RESPONSE"==a.type&&a.data&&(a=a.data,a.routeDescription&&(this.l.textContent=a.routeDescription),void 0!=a.mute&&(this.c=a.mute,p(this)),void 0!=a.local&&(this.b=a.local,v(this)))};window.addEventListener("DOMContentLoaded",function(){window.routeController=new n(document.getElementById("displayNameHolder"),document.getElementById("statusTextHolder"),document.getElementById("mute"),document.getElementById("unmute"),document.getElementById("checkboxElement"),document.getElementById("checkbox"),document.getElementById("checkmark"),document.getElementById("checkboxLabelTitle"),document.getElementById("checkboxLabelSubtitle"))});
