(function(g){var window=this;var QEa=function(a,b){return g.Zb(a,b)},c6=function(a){g.Zn(a,"zx",g.zc()); return a},d6=function(a,b,c){g.Ga(c)||(c=[String(c)]); g.bo(a.o,b,c)},REa=function(a,b){var c=[]; g.Hl(b,function(d){try{var e=g.DE.prototype.A.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}g.v(e)?g.CE(e)&&c.push(d):c.push(d)},a); return c},SEa=function(a,b){var c=REa(a,b); (0,g.E)(c,function(d){g.DE.prototype.remove.call(this,d)},a)},TEa=function(a){if(a.Ld){if(a.Ld.locationOverrideToken)return{locationOverrideToken:a.Ld.locationOverrideToken}; if(null!=a.Ld.latitudeE7&&null!=a.Ld.longitudeE7)return{latitudeE7:a.Ld.latitudeE7,longitudeE7:a.Ld.longitudeE7}}return null},UEa=function(a,b,c,d){var e=new g.Qn(null,void 0); a&&g.Rn(e,a);b&&g.Sn(e,b);c&&g.Tn(e,c);d&&g.Un(e,d);return e},e6=function(a,b){g.wF[a]=!0; var c=g.uF();c&&c.publish.apply(c,arguments);g.wF[a]=!1},f6=function(a){this.app=this.name=this.id=""; this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.C=!1;this.capabilities=new Set;this.experiments=new Set;this.theme="u";new g.Kn;this.o=this.A="";a&&(this.id=a.id||a.name,this.name=a.name,this.app=a.app,this.type=a.type||"REMOTE_CONTROL",this.username=a.user||"",this.avatar=a.userAvatarUri||"",this.obfuscatedGaiaId=a.obfuscatedGaiaId||"",this.theme=a.theme||"u",VEa(this,a.capabilities||""),WEa(this,a.experiments||""),this.A=a.remoteControllerUrl||"",this.o=a.localChannelEncryptionKey|| "")},VEa=function(a,b){a.capabilities.clear(); (0,g.se)(b.split(","),g.Na(QEa,XEa)).forEach(function(c){a.capabilities.add(c)})},WEa=function(a,b){a.experiments.clear(); b.split(",").forEach(function(c){a.experiments.add(c)})},g6=function(a){a=a||{}; this.name=a.name||"";this.id=a.id||a.screenId||"";this.token=a.token||a.loungeToken||"";this.uuid=a.uuid||a.dialId||""},h6=function(a,b){return!!b&&(a.id==b||a.uuid==b)},YEa=function(a){return{name:a.name, screenId:a.id,loungeToken:a.token,dialId:a.uuid}},ZEa=function(a){return new g6(a)},$Ea=function(a){return g.Ga(a)?(0,g.K)(a,ZEa):[]},i6=function(a){return a?'{name:"'+a.name+'",id:'+a.id.substr(0,6)+"..,token:"+(a.token?".."+a.token.slice(-6):"-")+",uuid:"+(a.uuid?".."+a.uuid.slice(-6):"-")+"}":"null"},j6=function(a){return g.Ga(a)?"["+(0,g.K)(a,i6).join(",")+"]":"null"},k6=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0; return("x"==a?b:b&3|8).toString(16)})},aFa=function(a){return(0,g.K)(a,function(b){return{key:b.id, name:b.name}})},l6=function(a,b){return g.Va(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},m6=function(a,b){return g.Va(a,function(c){return h6(c,b)})},bFa=function(){var a=(0,g.KI)(); a&&SEa(a,a.o.de(!0))},n6=function(){var a=g.NI("yt-remote-connected-devices")||[]; g.tb(a);return a},cFa=function(a){if(g.ab(a))return[]; var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return(0,g.K)(a,function(d,e){return 0==e?d:d.substring(c.length)})},dFa=function(a){g.MI("yt-remote-connected-devices",a,86400)},p6=function(){if(o6)return o6; var a=g.NI("yt-remote-device-id");a||(a=k6(),g.MI("yt-remote-device-id",a,31536E3));for(var b=n6(),c=1,d=a;g.Za(b,d);)c++,d=a+"#"+c;return o6=d},q6=function(){var a=n6(),b=p6(); g.Za(a,b);g.PI()&&g.vb(a,b);a=cFa(a);if(g.ab(a))try{g.lI("remote_sid")}catch(c){}else try{g.kI("remote_sid",a.join(","),-1)}catch(c){}},eFa=function(){return g.NI("yt-remote-session-browser-channel")},fFa=function(){return g.NI("yt-remote-local-screens")||[]},gFa=function(){g.MI("yt-remote-lounge-token-expiration",!0,86400)},hFa=function(a){5b.length)return C6;var e=b.substr(d,c);a.fo=d+c;return e},wFa=function(a,b){a.Zk=(0,g.J)(); B6(a);var c=b?window.location.hostname:"";a.ai=a.zh.clone();g.Zn(a.ai,"DOMAIN",c);g.Zn(a.ai,"t",a.F);try{a.Jf=new ActiveXObject("htmlfile")}catch(n){F6(a);a.Ah=7;D6(22);G6(a);return}var d="";if(b){for(var e="",f=0;f"==k)e+="\\x3e";else{var l=k;if(l in H6)k=H6[l];else if(l in vFa)k=H6[l]=vFa[l];else{var m=l.charCodeAt(0);if(31m)k=l;else{if(256>m){if(k="\\x",16>m||256m&&(k+="0");k+=m.toString(16).toUpperCase()}k= H6[l]=k}e+=k}}d+='