(function(g){var window=this;'use strict';var $7=function(a){g.xo(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^g.gb()).toString(36));return a},a8=function(a,b,c){Array.isArray(c)||(c=[String(c)]); g.Hga(a.B,b,c)},ixb=function(a){if(a instanceof g.Xs)return a; if("function"==typeof a.Ek)return a.Ek(!1);if(g.Ya(a)){var b=0,c=new g.Xs;c.next=function(){for(;;){if(b>=a.length)return g.J2;if(b in a)return g.Ys(a[b++]);b++}}; return c}throw Error("Not implemented");},jxb=function(a,b,c){if(g.Ya(a))g.Xb(a,b,c); else for(a=ixb(a);;){var d=a.next();if(d.done)break;b.call(c,d.value,void 0,a)}},kxb=function(a,b){var c=[]; jxb(b,function(d){try{var e=g.mv.prototype.B.call(this,d,!0)}catch(f){if("Storage: Invalid value was encountered"==f)return;throw f;}void 0===e?c.push(d):g.vla(e)&&c.push(d)},a); return c},lxb=function(a,b){kxb(a,b).forEach(function(c){g.mv.prototype.remove.call(this,c)},a)},mxb=function(a){if(a.ma){if(a.ma.locationOverrideToken)return{locationOverrideToken:a.ma.locationOverrideToken}; if(null!=a.ma.latitudeE7&&null!=a.ma.longitudeE7)return{latitudeE7:a.ma.latitudeE7,longitudeE7:a.ma.longitudeE7}}return null},nxb=function(a,b){g.Fb(a,b)||a.push(b)},oxb=function(a){var b=0,c; for(c in a)b++;return b},pxb=function(a,b){return g.gd(a,b)},qxb=function(a){try{return g.Qa.JSON.parse(a)}catch(b){}a=String(a); if(/^\s*$/.test(a)?0:/^[\],:{}\s\u2028\u2029]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/(?:"[^"\\\n\r\u2028\u2029\x00-\x08\x0a-\x1f]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)[\s\u2028\u2029]*(?=:|,|]|}|$)/g,"]").replace(/(?:^|:|,)(?:[\s\u2028\u2029]*\[)+/g,"")))try{return eval("("+a+")")}catch(b){}throw Error("Invalid JSON string: "+a);},b8=function(a){if(g.Qa.JSON)try{return g.Qa.JSON.parse(a)}catch(b){}return qxb(a)},rxb=function(a,b,c,d){var e=new g.po(null); a&&g.qo(e,a);b&&g.ro(e,b);c&&g.so(e,c);d&&(e.C=d);return e},sxb=function(){this.j=c8(); this.j.Fk("/client_streamz/youtube/living_room/mdx/channel/opened",{Ue:3,Te:"channel_type"})},txb=function(a,b){a.j.Ol("/client_streamz/youtube/living_room/mdx/channel/opened",b)},uxb=function(){this.j=c8(); this.j.Fk("/client_streamz/youtube/living_room/mdx/channel/closed",{Ue:3,Te:"channel_type"})},vxb=function(a,b){a.j.Ol("/client_streamz/youtube/living_room/mdx/channel/closed",b)},wxb=function(){this.j=c8(); this.j.Fk("/client_streamz/youtube/living_room/mdx/channel/message_received",{Ue:3,Te:"channel_type"})},xxb=function(a,b){a.j.Ol("/client_streamz/youtube/living_room/mdx/channel/message_received",b)},yxb=function(){this.j=c8(); this.j.Fk("/client_streamz/youtube/living_room/mdx/channel/error",{Ue:3,Te:"channel_type"})},zxb=function(a,b){a.j.Ol("/client_streamz/youtube/living_room/mdx/channel/error",b)},Axb=function(){this.j=c8(); this.j.Fk("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},Bxb=function(){this.j=c8(); this.j.Fk("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},d8=function(a){this.name=this.id=""; this.clientName="UNKNOWN_INTERFACE";this.app="";this.type="REMOTE_CONTROL";this.obfuscatedGaiaId=this.avatar=this.username="";this.capabilities=new Set;this.compatibleSenderThemes=new Set;this.experiments=new Set;this.theme="u";new g.Vu;this.model=this.brand="";this.year=0;this.chipset=this.osVersion=this.os="";this.mdxDialServerType="MDX_DIAL_SERVER_TYPE_UNKNOWN";a&&(this.id=a.id||a.name,this.name=a.name,this.clientName=a.clientName?a.clientName.toUpperCase():"UNKNOWN_INTERFACE",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",Cxb(this,a.capabilities||""),Dxb(this,a.compatibleSenderThemes||""),Exb(this,a.experiments||""),this.brand=a.brand||"",this.model=a.model||"",this.year=a.year||0,this.os=a.os||"",this.osVersion=a.osVersion||"",this.chipset=a.chipset||"",this.mdxDialServerType=a.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN",a=a.deviceInfo)&&(a=JSON.parse(a),this.brand= a.brand||"",this.model=a.model||"",this.year=a.year||0,this.os=a.os||"",this.osVersion=a.osVersion||"",this.chipset=a.chipset||"",this.clientName=a.clientName?a.clientName.toUpperCase():"UNKNOWN_INTERFACE",this.mdxDialServerType=a.mdxDialServerType||"MDX_DIAL_SERVER_TYPE_UNKNOWN")},Cxb=function(a,b){a.capabilities.clear(); g.bt(b.split(","),g.fb(pxb,Fxb)).forEach(function(c){a.capabilities.add(c)})},Dxb=function(a,b){a.compatibleSenderThemes.clear(); g.bt(b.split(","),g.fb(pxb,Gxb)).forEach(function(c){a.compatibleSenderThemes.add(c)})},Exb=function(a,b){a.experiments.clear(); b.split(",").forEach(function(c){a.experiments.add(c)})},e8=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||"";this.idType=a.screenIdType||"normal"},f8=function(a,b){return!!b&&(a.id==b||a.uuid==b)},Hxb=function(a){return{name:a.name, screenId:a.id,loungeToken:a.token,dialId:a.uuid,screenIdType:a.idType}},Ixb=function(a){return new e8(a)},Jxb=function(a){return Array.isArray(a)?g.pr(a,Ixb):[]},g8=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):"-")+",idType:"+a.idType+"}"):"null"},Kxb=function(a){return Array.isArray(a)?"["+g.pr(a,g8).join(",")+"]":"null"},Lxb=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)})},Mxb=function(a){return g.pr(a,function(b){return{key:b.id, name:b.name}})},Nxb=function(a,b){return g.Db(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},h8=function(a,b){return g.Db(a,function(c){return f8(c,b)})},Oxb=function(){var a=(0,g.WC)(); a&&lxb(a,a.j.Ek(!0))},i8=function(){var a=g.YC("yt-remote-connected-devices")||[]; g.Ub(a);return a},Pxb=function(a){if(0==a.length)return[]; var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return g.pr(a,function(d,e){return 0==e?d:d.substring(c.length)})},Qxb=function(a){g.XC("yt-remote-connected-devices",a,86400)},j8=function(){if(Rxb)return Rxb; var a=g.YC("yt-remote-device-id");a||(a=Lxb(),g.XC("yt-remote-device-id",a,31536E3));for(var b=i8(),c=1,d=a;g.Fb(b,d);)c++,d=a+"#"+c;return Rxb=d},Sxb=function(){var a=i8(),b=j8(); g.$C()&&g.Wb(a,b);a=Pxb(a);if(0==a.length)try{g.qoa("remote_sid")}catch(c){}else try{g.oC("remote_sid",a.join(","),-1)}catch(c){}},Txb=function(){return g.YC("yt-remote-session-browser-channel")},Uxb=function(){return g.YC("yt-remote-local-screens")||[]},Vxb=function(){g.XC("yt-remote-lounge-token-expiration",!0,86400)},Wxb=function(a){5b.length)return zyb;b=b.slice(d,d+c);a.K=d+c;return b},x8=function(a){a.Jb=Date.now()+a.tb; Dyb(a,a.tb)},Dyb=function(a,b){if(null!=a.ma)throw Error("WatchDog timer not null"); a.ma=u8((0,g.eb)(a.Y1,a),b)},A8=function(a){a.ma&&(g.Qa.clearTimeout(a.ma),a.ma=null)},z8=function(a){a.G.Pg()||a.La||Eyb(a.G,a)},y8=function(a){A8(a); g.ub(a.Xa);a.Xa=null;a.kb.stop();a.bb.Jf();if(a.j){var b=a.j;a.j=null;b.abort();b.dispose()}},Byb=function(a,b){try{var c=a.G; if(0!=c.Gh&&(c.j==a||Fyb(c.B,a)))if(!a.Va&&Fyb(c.B,a)&&3==c.Gh){try{var d=c.zf.j.parse(b)}catch(x){d=null}if(Array.isArray(d)&&3==d.length){var e=d;if(0==e[0])a:{if(!c.Z){if(c.j)if(c.j.Ba+3E3e[2]&&c.Va&&0==c.ra&&!c.ma&&(c.ma=u8((0,g.eb)(c.d2,c),6E3));if(1>=Hyb(c.B)&&c.hd){try{c.hd()}catch(x){}c.hd=void 0}}else D8(c,11)}else if((a.Va||c.j==a)&&B8(c),!g.cc(b))for(e=c.zf.j.parse(b),b=0;b=a.D:!1},Hyb=function(a){return a.B?1:a.j?a.j.size:0},Fyb=function(a,b){return a.B?a.B==b:a.j?a.j.has(b):!1},Iyb= function(a,b){a.j?a.j.add(b):a.B=b},Kyb=function(a,b){a.B&&a.B==b?a.B=null:a.j&&a.j.has(b)&&a.j.delete(b)},Pyb=function(a){if(null!=a.B)return a.C.concat(a.B.ra); if(null!=a.j&&0!==a.j.size){var b=a.C;a=g.u(a.j.values());for(var c=a.next();!c.done;c=a.next())b=b.concat(c.value.ra);return b}return g.Kb(a.C)},Qyb=function(a,b){var c=new v8; if(g.Qa.Image){var d=new Image;d.onload=g.fb(F8,c,d,"TestLoadImage: loaded",!0,b);d.onerror=g.fb(F8,c,d,"TestLoadImage: error",!1,b);d.onabort=g.fb(F8,c,d,"TestLoadImage: abort",!1,b);d.ontimeout=g.fb(F8,c,d,"TestLoadImage: timeout",!1,b);g.Qa.setTimeout(function(){if(d.ontimeout)d.ontimeout()},1E4); d.src=a}else b(!1)},F8=function(a,b,c,d,e){try{b.onload=null,b.onerror=null,b.onabort=null,b.ontimeout=null,e(d)}catch(f){}},Ryb=function(){this.j=new r8},Syb=function(a,b,c){var d=c||""; try{g.oo(a,function(e,f){var h=e;g.$a(e)&&(h=g.Mm(e));b.push(d+f+"="+encodeURIComponent(h))})}catch(e){throw b.push(d+"type="+encodeURIComponent("_badmap")),e; }},G8=function(a,b,c){return c&&c.n7?c.n7[a]||b:b},Tyb=function(a){this.C=[]; this.Ub=this.Bd=this.Na=this.ac=this.j=this.Ie=this.Ga=this.La=this.N=this.Jb=this.W=null;this.Of=this.Za=0;this.Mf=G8("failFast",!1,a);this.Va=this.ma=this.Z=this.K=this.G=null;this.Ic=!0;this.ue=this.Xa=-1;this.Rb=this.ra=this.Ba=0;this.lh=G8("baseRetryDelayMs",5E3,a);this.Qf=G8("retryDelaySeedMs",1E4,a);this.Nf=G8("forwardChannelMaxRetries",2,a);this.Pe=G8("forwardChannelRequestTimeoutMs",2E4,a);this.He=a&&a.Ykb||void 0;this.yf=a&&a.Ukb||!1;this.bb=void 0;this.Qa=a&&a.Kba||!1;this.D="";this.B= new Nyb(a&&a.gib);this.zf=new Ryb;this.tb=a&&a.wib||!1;this.rb=a&&a.mib||!1;this.tb&&this.rb&&(this.rb=!1);this.Rf=a&&a.Yhb||!1;a&&a.yib&&(this.Ic=!1);this.Oc=!this.tb&&this.Ic&&a&&a.kib||!1;this.jd=void 0;a&&a.WX&&0=a.B.D-(a.K?1:0))return!1; if(a.K)return a.C=b.ra.concat(a.C),!0;if(1==a.Gh||2==a.Gh||a.Ba>=(a.Mf?0:a.Nf))return!1;a.K=u8((0,g.eb)(a.RS,a,b),Wyb(a,a.Ba));a.Ba++;return!0},Zyb=function(a,b){var c; b?c=b.Ic:c=a.Za++;var d=a.Na.clone();g.xo(d,"SID",a.D);g.xo(d,"RID",c);g.xo(d,"AID",a.Xa);H8(a,d);a.N&&a.W&&g.bp(d,a.N,a.W);c=new w8(a,a.D,c,a.Ba+1);null===a.N&&(c.Na=a.W);b&&(a.C=b.ra.concat(a.C));b=Yyb(a,c,1E3);c.setTimeout(Math.round(.5*a.Pe)+Math.round(.5*a.Pe*Math.random()));Iyb(a.B,c);vyb(c,d,b)},H8=function(a,b){a.La&&g.Wc(a.La,function(c,d){g.xo(b,d,c)}); a.G&&g.oo({},function(c,d){g.xo(b,d,c)})},Yyb=function(a,b,c){c=Math.min(a.C.length,c); var d=a.G?(0,g.eb)(a.G.e2,a.G,a):null;a:for(var e=a.C,f=-1;;){var h=["count="+c];-1==f?0n)f=Math.max(0,e[m].j-100),l=!1;else try{Syb(p,h,"req"+n+"_")}catch(q){d&&d(p)}}if(l){d=h.join("&");break a}}a=a.C.splice(0,c);b.ra=a;return d},Lyb=function(a){a.j||a.Z||(a.Rb=1,g.If(a.QS,a),a.ra=0)},Gyb=function(a){if(a.j||a.Z||3<=a.ra)return!1; a.Rb++;a.Z=u8((0,g.eb)(a.QS,a),Wyb(a,a.ra));a.ra++;return!0},Uyb=function(a){null!=a.Ea&&(g.Qa.clearTimeout(a.Ea),a.Ea=null)},$yb=function(a){a.j=new w8(a,a.D,"rpc",a.Rb); null===a.N&&(a.j.Na=a.W);a.j.rb=0;var b=a.Bd.clone();g.xo(b,"RID","rpc");g.xo(b,"SID",a.D);g.xo(b,"AID",a.Xa);g.xo(b,"CI",a.Va?"0":"1");!a.Va&&a.jd&&g.xo(b,"TO",a.jd);g.xo(b,"TYPE","xmlhttp");H8(a,b);a.N&&a.W&&g.bp(b,a.N,a.W);a.bb&&a.j.setTimeout(a.bb);var c=a.j;a=a.Ub;c.Qa=1;c.Z=$7(b.clone());c.W=null;c.Ga=!0;uyb(c,a)},B8=function(a){null!=a.ma&&(g.Qa.clearTimeout(a.ma),a.ma=null)},Eyb=function(a,b){var c=null; if(a.j==b){B8(a);Uyb(a);a.j=null;var d=2}else if(Fyb(a.B,b))c=b.ra,Kyb(a.B,b),d=1;else return;if(0!=a.Gh)if(b.C)if(1==d){c=b.W?b.W.length:0;b=Date.now()-b.Ba;var e=a.Ba;d=pyb();d.dispatchEvent(new syb(d,c,b,e));E8(a)}else Lyb(a);else{var f=b.Bb;e=b.getLastError();if(3==e||0==e&&0b.length)return mzb;b=b.slice(d,d+c);a.tG=d+c;return b},qzb=function(a,b){a.Lx=Date.now(); O8(a);var c=b?window.location.hostname:"";a.Vr=a.Tr.clone();g.xo(a.Vr,"DOMAIN",c);g.xo(a.Vr,"t",a.K);try{a.Bo=new ActiveXObject("htmlfile")}catch(m){P8(a);a.Ur=7;M8(22);Q8(a);return}var d="";if(b){var e="";for(b=0;b"==f)f=e+"\\x3e";else{if(f in R8)f=R8[f];else if(f in pzb)f=R8[f]=pzb[f];else{var h=f.charCodeAt(0);if(31h)var l=f;else{if(256>h){if(l="\\x",16>h||256h&&(l+="0");l+=h.toString(16).toUpperCase()}f= R8[f]=l}f=e+f}e=f}d+='