(function(g){var window=this;var SCa=function(a,b){return g.Ub(a,b)},i6=function(a){g.Qm(a,"zx",g.xb()); return a},j6=function(a,b,c){g.za(c)||(c=[String(c)]); g.Tm(a.o,b,c)},TCa=function(a,b){var c=[]; g.Fk(b,function(a){try{var b=g.oD.prototype.A.call(this,a,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}g.u(b)?g.nD(b)&&c.push(a):c.push(a)},a); return c},UCa=function(a,b){var c=TCa(a,b); (0,g.D)(c,function(a){g.oD.prototype.remove.call(this,a)},a)},VCa=function(a){if(a.Jd){if(a.Jd.locationOverrideToken)return{locationOverrideToken:a.Jd.locationOverrideToken}; if(null!=a.Jd.latitudeE7&&null!=a.Jd.longitudeE7)return{latitudeE7:a.Jd.latitudeE7,longitudeE7:a.Jd.longitudeE7}}return null},WCa=function(a,b,c,d){var e=new g.Hm(null,void 0); a&&g.Im(e,a);b&&g.Jm(e,b);c&&g.Km(e,c);d&&g.Lm(e,d);return e},XCa=function(a){g.dG[a]&&(a=g.dG[a],(0,g.D)(a,function(a){g.bG[a]&&delete g.bG[a]}),a.length=0)},YCa=function(a){var b=g.aG(); if(b)if(b.clear(a),a)XCa(a);else for(var c in g.dG)XCa(c)},k6=function(a){this.app=this.name=this.id=""; this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.B=!1;this.capabilities=new window.Set;this.experiments=new window.Set;this.theme="u";new g.Bm;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",ZCa(this,a.capabilities||""),$Ca(this,a.experiments||""),this.A=a.remoteControllerUrl||"", this.o=a.localChannelEncryptionKey||"")},ZCa=function(a,b){a.capabilities.clear(); (0,g.Ud)(b.split(","),g.Fa(SCa,aDa)).forEach(function(b){a.capabilities.add(b)})},$Ca=function(a,b){a.experiments.clear(); b.split(",").forEach(function(b){a.experiments.add(b)})},l6=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||""},m6=function(a,b){return!!b&&(a.id==b||a.uuid==b)},bDa=function(a){return{name:a.name, screenId:a.id,loungeToken:a.token,dialId:a.uuid}},cDa=function(a){return new l6(a)},dDa=function(a){return g.za(a)?(0,g.I)(a,cDa):[]},n6=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"},o6=function(a){return g.za(a)?"["+(0,g.I)(a,n6).join(",")+"]":"null"},p6=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)})},eDa=function(a){return(0,g.I)(a,function(a){return{key:a.id, name:a.name}})},q6=function(a,b){return g.Ka(a,function(a){return a||b?!a!=!b?!1:a.id==b.id:!0})},r6=function(a,b){return g.Ka(a,function(a){return m6(a,b)})},fDa=function(){var a=(0,g.bH)(); a&&UCa(a,a.o.fe(!0))},s6=function(){var a=g.eH("yt-remote-connected-devices")||[]; g.fb(a);return a},gDa=function(a){if(g.Pa(a))return[]; var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return(0,g.I)(a,function(a,b){return 0==b?a:a.substring(c.length)})},hDa=function(a){g.dH("yt-remote-connected-devices",a,86400)},u6=function(){if(t6)return t6; var a=g.eH("yt-remote-device-id");a||(a=p6(),g.dH("yt-remote-device-id",a,31536E3));for(var b=s6(),c=1,d=a;g.Oa(b,d);)c++,d=a+"#"+c;return t6=d},v6=function(){var a=s6(),b=u6(); g.Oa(a,b);g.gH()&&g.ib(a,b);a=gDa(a);if(g.Pa(a))try{g.MG("remote_sid")}catch(c){}else try{g.LG("remote_sid",a.join(","),-1)}catch(c){}},iDa=function(){return g.eH("yt-remote-session-browser-channel")},jDa=function(){return g.eH("yt-remote-local-screens")||[]},kDa=function(){g.dH("yt-remote-lounge-token-expiration",!0,86400)},lDa=function(a){5b.length)return J6;var e=b.substr(d,c);a.Xn=d+c;return e},DDa=function(a,b){a.rl=(0,g.H)(); I6(a);var c=b?window.location.hostname:"";a.xi=a.Rh.clone();g.Qm(a.xi,"DOMAIN",c);g.Qm(a.xi,"t",a.F);try{a.Sf=new window.ActiveXObject("htmlfile")}catch(n){M6(a);a.Sh=7;K6(22);N6(a);return}var d="";if(b){for(var e="",f=0;f"==k)e+="\\x3e";else{var l=k;if(l in O6)k=O6[l];else if(l in CDa)k=O6[l]=CDa[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=O6[l]=k}e+=k}}d+='