(function(g){var window=this;'use strict';var $7=function(a){g.uo(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^g.kb()).toString(36));return a},a8=function(a,b,c){Array.isArray(c)||(c=[String(c)]); g.Iga(a.B,b,c)},nxb=function(a){if(a instanceof g.Us)return a; if("function"==typeof a.Gk)return a.Gk(!1);if(g.Za(a)){var b=0,c=new g.Us;c.next=function(){for(;;){if(b>=a.length)return g.z2;if(b in a)return g.Vs(a[b++]);b++}}; return c}throw Error("Not implemented");},oxb=function(a,b,c){if(g.Za(a))g.cc(a,b,c); else for(a=nxb(a);;){var d=a.next();if(d.done)break;b.call(c,d.value,void 0,a)}},pxb=function(a,b){var c=[]; oxb(b,function(d){try{var e=g.jv.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.wla(e)&&c.push(d)},a); return c},qxb=function(a,b){pxb(a,b).forEach(function(c){g.jv.prototype.remove.call(this,c)},a)},rxb=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},sxb=function(a,b){g.Cb(a,b)||a.push(b)},txb=function(a){var b=0,c; for(c in a)b++;return b},uxb=function(a,b){return g.hd(a,b)},vxb=function(a){try{return g.Ra.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.Ra.JSON)try{return g.Ra.JSON.parse(a)}catch(b){}return vxb(a)},wxb=function(a,b,c,d){var e=new g.mo(null); a&&g.no(e,a);b&&g.oo(e,b);c&&g.po(e,c);d&&(e.C=d);return e},xxb=function(){this.j=c8(); this.j.Hk("/client_streamz/youtube/living_room/mdx/channel/opened",{Ue:3,Te:"channel_type"})},yxb=function(a,b){a.j.Tl("/client_streamz/youtube/living_room/mdx/channel/opened",b)},zxb=function(){this.j=c8(); this.j.Hk("/client_streamz/youtube/living_room/mdx/channel/closed",{Ue:3,Te:"channel_type"})},Axb=function(a,b){a.j.Tl("/client_streamz/youtube/living_room/mdx/channel/closed",b)},Bxb=function(){this.j=c8(); this.j.Hk("/client_streamz/youtube/living_room/mdx/channel/message_received",{Ue:3,Te:"channel_type"})},Cxb=function(a,b){a.j.Tl("/client_streamz/youtube/living_room/mdx/channel/message_received",b)},Dxb=function(){this.j=c8(); this.j.Hk("/client_streamz/youtube/living_room/mdx/channel/error",{Ue:3,Te:"channel_type"})},Exb=function(a,b){a.j.Tl("/client_streamz/youtube/living_room/mdx/channel/error",b)},Fxb=function(){this.j=c8(); this.j.Hk("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},Gxb=function(){this.j=c8(); this.j.Hk("/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.Su;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",Hxb(this,a.capabilities||""),Ixb(this,a.compatibleSenderThemes||""),Jxb(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")},Hxb=function(a,b){a.capabilities.clear(); g.Zs(b.split(","),g.gb(uxb,Kxb)).forEach(function(c){a.capabilities.add(c)})},Ixb=function(a,b){a.compatibleSenderThemes.clear(); g.Zs(b.split(","),g.gb(uxb,Lxb)).forEach(function(c){a.compatibleSenderThemes.add(c)})},Jxb=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)},Mxb=function(a){return{name:a.name, screenId:a.id,loungeToken:a.token,dialId:a.uuid,screenIdType:a.idType}},Nxb=function(a){return new e8(a)},Oxb=function(a){return Array.isArray(a)?g.lr(a,Nxb):[]},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"},Pxb=function(a){return Array.isArray(a)?"["+g.lr(a,g8).join(",")+"]":"null"},Qxb=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)})},Rxb=function(a){return g.lr(a,function(b){return{key:b.id, name:b.name}})},Sxb=function(a,b){return g.zb(a,function(c){return c||b?!c!=!b?!1:c.id==b.id:!0})},h8=function(a,b){return g.zb(a,function(c){return f8(c,b)})},Txb=function(){var a=(0,g.IC)(); a&&qxb(a,a.j.Gk(!0))},i8=function(){var a=g.KC("yt-remote-connected-devices")||[]; g.Xb(a);return a},Uxb=function(a){if(0==a.length)return[]; var b=a[0].indexOf("#"),c=-1==b?a[0]:a[0].substring(0,b);return g.lr(a,function(d,e){return 0==e?d:d.substring(c.length)})},Vxb=function(a){g.JC("yt-remote-connected-devices",a,86400)},j8=function(){if(Wxb)return Wxb; var a=g.KC("yt-remote-device-id");a||(a=Qxb(),g.JC("yt-remote-device-id",a,31536E3));for(var b=i8(),c=1,d=a;g.Cb(b,d);)c++,d=a+"#"+c;return Wxb=d},Xxb=function(){var a=i8(),b=j8(); g.MC()&&g.Zb(a,b);a=Uxb(a);if(0==a.length)try{g.Aoa("remote_sid")}catch(c){}else try{g.aC("remote_sid",a.join(","),-1)}catch(c){}},Yxb=function(){return g.KC("yt-remote-session-browser-channel")},Zxb=function(){return g.KC("yt-remote-local-screens")||[]},$xb=function(){g.JC("yt-remote-lounge-token-expiration",!0,86400)},ayb=function(a){5b.length)return Eyb;b=b.slice(d,d+c);a.K=d+c;return b},x8=function(a){a.Ib=Date.now()+a.sb; Iyb(a,a.sb)},Iyb=function(a,b){if(null!=a.ma)throw Error("WatchDog timer not null"); a.ma=u8((0,g.fb)(a.m2,a),b)},A8=function(a){a.ma&&(g.Ra.clearTimeout(a.ma),a.ma=null)},z8=function(a){a.G.fh()||a.Ka||Jyb(a.G,a)},y8=function(a){A8(a); g.sb(a.Ya);a.Ya=null;a.ob.stop();a.gb.Mf();if(a.j){var b=a.j;a.j=null;b.abort();b.dispose()}},Gyb=function(a,b){try{var c=a.G; if(0!=c.Fh&&(c.j==a||Kyb(c.B,a)))if(!a.Va&&Kyb(c.B,a)&&3==c.Fh){try{var d=c.Ef.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.Aa+3E3e[2]&&c.Va&&0==c.oa&&!c.ma&&(c.ma=u8((0,g.fb)(c.q2,c),6E3));if(1>=Myb(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.gc(b))for(e=c.Ef.j.parse(b),b=0;b=a.D:!1},Myb=function(a){return a.B?1:a.j?a.j.size:0},Kyb=function(a,b){return a.B?a.B==b:a.j?a.j.has(b):!1},Nyb= function(a,b){a.j?a.j.add(b):a.B=b},Pyb=function(a,b){a.B&&a.B==b?a.B=null:a.j&&a.j.has(b)&&a.j.delete(b)},Uyb=function(a){if(null!=a.B)return a.C.concat(a.B.oa); if(null!=a.j&&0!==a.j.size){var b=a.C;a=g.v(a.j.values());for(var c=a.next();!c.done;c=a.next())b=b.concat(c.value.oa);return b}return g.Jb(a.C)},Vyb=function(a,b){var c=new v8; if(g.Ra.Image){var d=new Image;d.onload=g.gb(F8,c,d,"TestLoadImage: loaded",!0,b);d.onerror=g.gb(F8,c,d,"TestLoadImage: error",!1,b);d.onabort=g.gb(F8,c,d,"TestLoadImage: abort",!1,b);d.ontimeout=g.gb(F8,c,d,"TestLoadImage: timeout",!1,b);g.Ra.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){}},Wyb=function(){this.j=new r8},Xyb=function(a,b,c){var d=c||""; try{g.lo(a,function(e,f){var h=e;g.$a(e)&&(h=g.Lm(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.t7?c.t7[a]||b:b},Yyb=function(a){this.C=[]; this.ac=this.ud=this.Na=this.hc=this.j=this.Ie=this.Fa=this.Ka=this.N=this.Ib=this.Y=null;this.Sf=this.bb=0;this.Qf=G8("failFast",!1,a);this.Va=this.ma=this.Z=this.K=this.G=null;this.Fc=!0;this.ze=this.Ya=-1;this.Lb=this.oa=this.Aa=0;this.Pf=G8("baseRetryDelayMs",5E3,a);this.Tf=G8("retryDelaySeedMs",1E4,a);this.Rf=G8("forwardChannelMaxRetries",2,a);this.ge=G8("forwardChannelRequestTimeoutMs",2E4,a);this.He=a&&a.ikb||void 0;this.Qe=a&&a.fkb||!1;this.gb=void 0;this.Sa=a&&a.Rba||!1;this.D="";this.B= new Syb(a&&a.thb);this.Ef=new Wyb;this.sb=a&&a.Jhb||!1;this.rb=a&&a.zhb||!1;this.sb&&this.rb&&(this.rb=!1);this.Uf=a&&a.lhb||!1;a&&a.Lhb&&(this.Fc=!1);this.fd=!this.sb&&this.Fc&&a&&a.xhb||!1;this.Ud=void 0;a&&a.eY&&0=a.B.D-(a.K?1:0))return!1; if(a.K)return a.C=b.oa.concat(a.C),!0;if(1==a.Fh||2==a.Fh||a.Aa>=(a.Qf?0:a.Rf))return!1;a.K=u8((0,g.fb)(a.bT,a,b),azb(a,a.Aa));a.Aa++;return!0},dzb=function(a,b){var c; b?c=b.Fc:c=a.bb++;var d=a.Na.clone();g.uo(d,"SID",a.D);g.uo(d,"RID",c);g.uo(d,"AID",a.Ya);H8(a,d);a.N&&a.Y&&g.Zo(d,a.N,a.Y);c=new w8(a,a.D,c,a.Aa+1);null===a.N&&(c.Na=a.Y);b&&(a.C=b.oa.concat(a.C));b=czb(a,c,1E3);c.setTimeout(Math.round(.5*a.ge)+Math.round(.5*a.ge*Math.random()));Nyb(a.B,c);Ayb(c,d,b)},H8=function(a,b){a.Ka&&g.Wc(a.Ka,function(c,d){g.uo(b,d,c)}); a.G&&g.lo({},function(c,d){g.uo(b,d,c)})},czb=function(a,b,c){c=Math.min(a.C.length,c); var d=a.G?(0,g.fb)(a.G.s2,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{Xyb(p,h,"req"+n+"_")}catch(q){d&&d(p)}}if(l){d=h.join("&");break a}}a=a.C.splice(0,c);b.oa=a;return d},Qyb=function(a){a.j||a.Z||(a.Lb=1,g.Tf(a.aT,a),a.oa=0)},Lyb=function(a){if(a.j||a.Z||3<=a.oa)return!1; a.Lb++;a.Z=u8((0,g.fb)(a.aT,a),azb(a,a.oa));a.oa++;return!0},Zyb=function(a){null!=a.Ea&&(g.Ra.clearTimeout(a.Ea),a.Ea=null)},ezb=function(a){a.j=new w8(a,a.D,"rpc",a.Lb); null===a.N&&(a.j.Na=a.Y);a.j.rb=0;var b=a.ud.clone();g.uo(b,"RID","rpc");g.uo(b,"SID",a.D);g.uo(b,"AID",a.Ya);g.uo(b,"CI",a.Va?"0":"1");!a.Va&&a.Ud&&g.uo(b,"TO",a.Ud);g.uo(b,"TYPE","xmlhttp");H8(a,b);a.N&&a.Y&&g.Zo(b,a.N,a.Y);a.gb&&a.j.setTimeout(a.gb);var c=a.j;a=a.ac;c.Sa=1;c.Z=$7(b.clone());c.Y=null;c.Fa=!0;zyb(c,a)},B8=function(a){null!=a.ma&&(g.Ra.clearTimeout(a.ma),a.ma=null)},Jyb=function(a,b){var c=null; if(a.j==b){B8(a);Zyb(a);a.j=null;var d=2}else if(Kyb(a.B,b))c=b.oa,Pyb(a.B,b),d=1;else return;if(0!=a.Fh)if(b.C)if(1==d){c=b.Y?b.Y.length:0;b=Date.now()-b.Aa;var e=a.Aa;d=uyb();d.dispatchEvent(new xyb(d,c,b,e));E8(a)}else Qyb(a);else{var f=b.Db;e=b.getLastError();if(3==e||0==e&&0b.length)return rzb;b=b.slice(d,d+c);a.pG=d+c;return b},vzb=function(a,b){a.Nx=Date.now(); O8(a);var c=b?window.location.hostname:"";a.gs=a.Yr.clone();g.uo(a.gs,"DOMAIN",c);g.uo(a.gs,"t",a.K);try{a.uo=new ActiveXObject("htmlfile")}catch(m){P8(a);a.Zr=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 uzb)f=R8[f]=uzb[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+='