(function(g){var window=this;'use strict';var b8=function(a){g.Fp(a,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^g.kb()).toString(36));return a},c8=function(a,b,c){Array.isArray(c)||(c=[String(c)]); g.Ega(a.B,b,c)},OAb=function(a){if(a instanceof g.Ct)return a; if("function"==typeof a.Sl)return a.Sl(!1);if(g.ab(a)){var b=0,c=new g.Ct;c.next=function(){for(;;){if(b>=a.length)return g.t2;if(b in a)return g.Dt(a[b++]);b++}}; return c}throw Error("Not implemented");},PAb=function(a,b,c){if(g.ab(a))g.$b(a,b,c); else for(a=OAb(a);;){var d=a.next();if(d.done)break;b.call(c,d.value,void 0,a)}},QAb=function(a,b){var c=[]; PAb(b,function(d){try{var e=g.Rv.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.ula(e)&&c.push(d)},a); return c},RAb=function(a,b){QAb(a,b).forEach(function(c){g.Rv.prototype.remove.call(this,c)},a)},SAb=function(a){if(a.qa){if(a.qa.locationOverrideToken)return{locationOverrideToken:a.qa.locationOverrideToken}; if(null!=a.qa.latitudeE7&&null!=a.qa.longitudeE7)return{latitudeE7:a.qa.latitudeE7,longitudeE7:a.qa.longitudeE7}}return null},TAb=function(a,b){g.Fb(a,b)||a.push(b)},UAb=function(a){var b=0,c; for(c in a)b++;return b},VAb=function(a,b){return g.gd(a,b)},WAb=function(a){try{return g.Ta.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);},d8=function(a){if(g.Ta.JSON)try{return g.Ta.JSON.parse(a)}catch(b){}return WAb(a)},XAb=function(a){if(a.lm&&"function"==typeof a.lm)return a.lm(); if("undefined"!==typeof Map&&a instanceof Map||"undefined"!==typeof Set&&a instanceof Set)return Array.from(a.values());if("string"===typeof a)return a.split("");if(g.ab(a)){for(var b=[],c=a.length,d=0;db.length)return iCb;b=b.slice(d,d+c);a.N=d+c;return b},B8=function(a){a.rb=Date.now()+a.fb; lCb(a,a.fb)},lCb=function(a,b){if(null!=a.qa)throw Error("WatchDog timer not null"); a.qa=y8((0,g.gb)(a.R3,a),b)},mCb=function(a){a.qa&&(g.Ta.clearTimeout(a.qa),a.qa=null)},C8=function(a){a.C.Jg()||a.La||nCb(a.C,a)},D8=function(a){mCb(a); g.vb(a.Wa);a.Wa=null;a.zb.removeAll();if(a.j){var b=a.j;a.j=null;b.abort();b.dispose()}},vCb=function(a,b){try{var c=a.C; if(0!=c.Kh&&(c.j==a||oCb(c.B,a)))if(!a.Va&&oCb(c.B,a)&&3==c.Kh){try{var d=c.Bf.j.parse(b)}catch(w){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.qa&&(c.qa=y8((0,g.gb)(c.T3,c),6E3));if(1>=qCb(c.B)&&c.Sc){try{c.Sc()}catch(w){}c.Sc=void 0}}else G8(c,11)}else if((a.Va||c.j==a)&&E8(c),!g.ec(b))for(e=c.Bf.j.parse(b),b=0;b=a.D:!1},qCb=function(a){return a.B?1:a.j?a.j.size:0},oCb=function(a,b){return a.B?a.B==b:a.j?a.j.has(b):!1},rCb= function(a,b){a.j?a.j.add(b):a.B=b},tCb=function(a,b){a.B&&a.B==b?a.B=null:a.j&&a.j.has(b)&&a.j.delete(b)},zCb=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.Lb(a.C)},ACb=function(a,b){var c=new z8; if(g.Ta.Image){var d=new Image;d.onload=g.jb(I8,c,"TestLoadImage: loaded",!0,b,d);d.onerror=g.jb(I8,c,"TestLoadImage: error",!1,b,d);d.onabort=g.jb(I8,c,"TestLoadImage: abort",!1,b,d);d.ontimeout=g.jb(I8,c,"TestLoadImage: timeout",!1,b,d);g.Ta.setTimeout(function(){if(d.ontimeout)d.ontimeout()},1E4); d.src=a}else b(!1)},BCb=function(a,b){var c=new z8,d=new AbortController,e=setTimeout(function(){d.abort(); I8(c,"TestPingServer: timeout",!1,b)},1E4); fetch(a,{signal:d.signal}).then(function(f){clearTimeout(e);f.ok?I8(c,"TestPingServer: ok",!0,b):I8(c,"TestPingServer: server error",!1,b)}).catch(function(){clearTimeout(e); I8(c,"TestPingServer: error",!1,b)})},I8=function(a,b,c,d,e){try{e&&(e.onload=null,e.onerror=null,e.onabort=null,e.ontimeout=null),d(c)}catch(f){}},CCb=function(){this.j=new v8},DCb=function(a,b,c){var d=c||""; try{ZAb(a,function(e,f){var h=e;g.bb(e)&&(h=g.$m(e));b.push(d+f+"="+encodeURIComponent(h))})}catch(e){throw b.push(d+"type="+encodeURIComponent("_badmap")),e; }},J8=function(a,b,c){return c&&c.L8?c.L8[a]||b:b},ECb=function(a){this.C=[]; this.Pb=this.wd=this.Na=this.Xb=this.j=this.Ie=this.Da=this.La=this.N=this.Hb=this.Y=null;this.Rf=this.Za=0;this.Pf=J8("failFast",!1,a);this.Va=this.qa=this.Z=this.K=this.G=null;this.pc=!0;this.Ud=this.Wa=-1;this.Jb=this.ra=this.Ba=0;this.oh=J8("baseRetryDelayMs",5E3,a);this.Sf=J8("retryDelaySeedMs",1E4,a);this.Qf=J8("forwardChannelMaxRetries",2,a);this.ke=J8("forwardChannelRequestTimeoutMs",2E4,a);this.Ae=a&&a.lqb||void 0;this.eg=a&&a.bpb||void 0;this.Re=a&&a.iqb||!1;this.bb=void 0;this.Ra=a&&a.hda|| !1;this.D="";this.B=new xCb(a&&a.inb);this.Bf=new CCb;this.zb=a&&a.znb||!1;this.rb=a&&a.onb||!1;this.zb&&this.rb&&(this.rb=!1);this.Tf=a&&a.Ymb||!1;a&&a.Bnb&&(this.pc=!1);this.Dc=!this.zb&&this.pc&&a&&a.mnb||!1;this.hd=void 0;a&&a.XY&&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.Kh||2==a.Kh||a.Ba>=(a.Pf?0:a.Qf))return!1;a.K=y8((0,g.gb)(a.LT,a,b),HCb(a,a.Ba));a.Ba++;return!0},KCb=function(a,b){var c; b?c=b.Xb:c=a.Za++;var d=a.Na.clone();g.Fp(d,"SID",a.D);g.Fp(d,"RID",c);g.Fp(d,"AID",a.Wa);K8(a,d);a.N&&a.Y&&g.Jp(d,a.N,a.Y);c=new A8(a,a.D,c,a.Ba+1);null===a.N&&(c.Na=a.Y);b&&(a.C=b.ra.concat(a.C));b=JCb(a,c,1E3);c.setTimeout(Math.round(.5*a.ke)+Math.round(.5*a.ke*Math.random()));rCb(a.B,c);fCb(c,d,b)},K8=function(a,b){a.La&&g.Vc(a.La,function(c,d){g.Fp(b,d,c)}); a.G&&ZAb({},function(c,d){g.Fp(b,d,c)})},JCb=function(a,b,c){c=Math.min(a.C.length,c); var d=a.G?(0,g.gb)(a.G.U3,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{DCb(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},uCb=function(a){a.j||a.Z||(a.Jb=1,g.fg(a.KT,a),a.ra=0)},pCb=function(a){if(a.j||a.Z||3<=a.ra)return!1; a.Jb++;a.Z=y8((0,g.gb)(a.KT,a),HCb(a,a.ra));a.ra++;return!0},FCb=function(a){null!=a.Ga&&(g.Ta.clearTimeout(a.Ga),a.Ga=null)},LCb=function(a){a.j=new A8(a,a.D,"rpc",a.Jb); null===a.N&&(a.j.Na=a.Y);a.j.bb=0;var b=a.wd.clone();g.Fp(b,"RID","rpc");g.Fp(b,"SID",a.D);g.Fp(b,"AID",a.Wa);g.Fp(b,"CI",a.Va?"0":"1");!a.Va&&a.hd&&g.Fp(b,"TO",a.hd);g.Fp(b,"TYPE","xmlhttp");K8(a,b);a.N&&a.Y&&g.Jp(b,a.N,a.Y);a.bb&&a.j.setTimeout(a.bb);var c=a.j;a=a.Pb;c.Ra=1;c.Z=b8(b.clone());c.Y=null;c.Da=!0;eCb(c,a)},E8=function(a){null!=a.qa&&(g.Ta.clearTimeout(a.qa),a.qa=null)},nCb=function(a,b){var c=null; if(a.j==b){E8(a);FCb(a);a.j=null;var d=2}else if(oCb(a.B,b))c=b.ra,tCb(a.B,b),d=1;else return;if(0!=a.Kh)if(b.K)if(1==d){c=b.Y?b.Y.length:0;b=Date.now()-b.Ba;var e=a.Ba;d=$Bb();d.dispatchEvent(new cCb(d,c,b,e));H8(a)}else uCb(a);else{var f=b.Hb;e=b.getLastError();if(3==e||0==e&&0b.length)return ZCb;b=b.slice(d,d+c);a.YG=d+c;return b},YCb=function(a){a.bM=Date.now()+a.B; bDb(a,a.B)},bDb=function(a,b){if(null!=a.Ux)throw Error("WatchDog timer not null"); a.Ux=N8((0,g.gb)(a.V3,a),b)},cDb=function(a){a.Ux&&(g.Ta.clearTimeout(a.Ux),a.Ux=null)},dDb=function(a){a.j.Jg()||a.jC||a.j.eM(a)},R8=function(a){cDb(a); g.vb(a.UG);a.UG=null;a.G.stop();a.C.removeAll();if(a.ej){var b=a.ej;a.ej=null;b.abort();b.dispose()}a.Y0&&(a.Y0=null)},eDb=function(a,b){try{a.j.ST(a,b),a.j.qr(4)}catch(c){}},gDb=function(a,b,c,d,e){if(0==d)c(!1); else{var f=e||0;d--;fDb(a,b,function(h){h?c(!0):g.Ta.setTimeout(function(){gDb(a,b,c,d,f)},f)})}},fDb=function(a,b,c){var d=new Image; d.onload=function(){try{S8(d),c(!0)}catch(e){}}; d.onerror=function(){try{S8(d),c(!1)}catch(e){}}; d.onabort=function(){try{S8(d),c(!1)}catch(e){}}; d.ontimeout=function(){try{S8(d),c(!1)}catch(e){}}; g.Ta.setTimeout(function(){if(d.ontimeout)d.ontimeout()},b); d.src=a},S8=function(a){a.onload=null; a.onerror=null;a.onabort=null;a.ontimeout=null},hDb=function(a){this.j=a; this.B=new v8},iDb=function(a){var b=T8(a.j,a.VC,"/mail/images/cleardot.gif"); b8(b);gDb(b.toString(),5E3,(0,g.gb)(a.f6,a),3,2E3);a.qr(1)},jDb=function(a){var b=a.j.K; null!=b?(P8(5),b?(P8(11),U8(a.j,a,!1)):(P8(12),U8(a.j,a,!0))):(a.Ek=new Q8(a),a.Ek.Ru=a.dM,b=a.j,b=T8(b,b.mC()?a.ZG:null,a.fM),P8(5),c8(b,"TYPE","xmlhttp"),XCb(a.Ek,b,!1,a.ZG,!1))},kDb=function(a,b,c){this.j=1; this.B=[];this.C=[];this.G=new v8;this.Y=a||null;this.K=null!=b?b:null;this.Z=c||!1},lDb=function(a,b){this.j=a; this.map=b;this.context=null},mDb=function(a,b,c,d){g.zb.call(this,"timingevent",a); this.size=b;this.retries=d},nDb=function(a){g.zb.call(this,"serverreachability",a)},pDb=function(a){a.X3(1,0); a.aH=T8(a,null,a.hM);oDb(a)},qDb=function(a){a.Ds&&(a.Ds.abort(),a.Ds=null); a.Pg&&(a.Pg.cancel(),a.Pg=null);a.rq&&(g.Ta.clearTimeout(a.rq),a.rq=null);V8(a);a.Uj&&(a.Uj.cancel(),a.Uj=null);a.Yr&&(g.Ta.clearTimeout(a.Yr),a.Yr=null)},rDb=function(a,b){if(0==a.j)throw Error("Invalid operation: sending map when state is closed"); a.B.push(new lDb(a.Y3++,b));2!=a.j&&3!=a.j||oDb(a)},sDb=function(a){var b=0; a.Pg&&b++;a.Uj&&b++;return b},oDb=function(a){a.Uj||a.Yr||(a.Yr=N8((0,g.gb)(a.XT,a),0),a.Wx=0)},vDb=function(a,b){if(1==a.j){if(!b){a.oC=Math.floor(1E5*Math.random()); b=a.oC++;var c=new Q8(a,"",b);c.Ru=a.Jo;var d=tDb(a),e=a.aH.clone();g.Fp(e,"RID",b);g.Fp(e,"CVER","1");W8(a,e);WCb(c,e,d);a.Uj=c;a.j=2}}else 3==a.j&&(b?uDb(a,b):0==a.B.length||a.Uj||uDb(a))},uDb=function(a,b){if(b)if(6=a.Uu?f:e.ME-d;try{g.Vc(h,function(l){return function(m,n){c.push("req"+l.ME+"_"+n+"="+encodeURIComponent(m))}}(e))}catch(l){c.push("req"+e.ME+"_type="+encodeURIComponent("_badmap"))}}a.C=a.C.concat(a.B.splice(0,b)); return c.join("&")},wDb=function(a){a.Pg||a.rq||(a.N=1,a.rq=N8((0,g.gb)(a.VT,a),0),a.Vx=0)},yDb=function(a){if(a.Pg||a.rq||3<=a.Vx)return!1; a.N++;a.rq=N8((0,g.gb)(a.VT,a),xDb(a,a.Vx));a.Vx++;return!0},U8=function(a,b,c){a.AL=null==a.K?c:!a.K; a.Ko=b.qq;a.Z||pDb(a)},V8=function(a){null!=a.Vu&&(g.Ta.clearTimeout(a.Vu),a.Vu=null)},xDb=function(a,b){var c=5E3+Math.floor(1E4*Math.random()); a.isActive()||(c*=2);return c*b},X8=function(a,b){if(2==b||9==b){var c=null; a.Ii&&(c=null);var d=(0,g.gb)(a.mda,a);c||(c=new g.xp("//www.google.com/images/cleardot.gif"),b8(c));fDb(c.toString(),1E4,d)}else P8(2);zDb(a,b)},zDb=function(a,b){a.j=0; a.Ii&&a.Ii.ZT(b);ADb(a);qDb(a)},ADb=function(a){a.j=0; a.Ko=-1;if(a.Ii)if(0==a.C.length&&0==a.B.length)a.Ii.iM();else{var b=g.Lb(a.C),c=g.Lb(a.B);a.C.length=0;a.B.length=0;a.Ii.iM(b,c)}},T8=function(a,b,c){var d=g.Gp(c); if(""!=d.j)b&&g.zp(d,b+"."+d.j),g.Ap(d,d.D);else{var e=window.location;d=$Ab(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.nC&&g.Vc(a.nC,function(f,h){g.Fp(d,h,f)}); g.Fp(d,"VER",a.Uu);W8(a,d);return d},BDb=function(){},CDb=function(){this.j=[]; this.B=[]},DDb=function(a){g.zb.call(this,"channelMessage"); this.message=a},EDb=function(a){g.zb.call(this,"channelError"); this.error=a},FDb=function(a,b){this.action=a; this.params=b||{}},Y8=function(a,b){g.I.call(this); this.j=new g.lv(this.mba,0,this);g.O(this,this.j);this.Si=5E3;this.B=0;if("function"===typeof a)b&&(a=(0,g.gb)(a,b));else if(a&&"function"===typeof a.handleEvent)a=(0,g.gb)(a.handleEvent,a);else throw Error("Invalid listener argument");this.C=a},GDb=function(a,b,c,d,e){c=void 0===c?!1:c; d=void 0===d?function(){return""}:d; e=void 0===e?!1:e;this.Ba=a;this.N=b;this.C=new g.Nv;this.B=new Y8(this.Aca,this);this.j=null;this.qa=!1;this.K=null;this.Y="";this.Z=this.G=0;this.D=[];this.Ra=c;this.ra=d;this.Va=e;this.Na=new aBb;this.Ga=new cBb;this.La=new eBb;this.Da=new gBb;this.Wa=new iBb;this.Za=new jBb},HDb=function(a){if(a.j){var b=a.ra(),c=a.j.Jo||{}; b?c["x-youtube-lounge-xsrf-token"]=b:delete c["x-youtube-lounge-xsrf-token"];a.j.Jo=c}},Z8=function(a){this.scheme="https"; this.port=this.domain="";this.j="/api/lounge";this.B=!0;a=a||document.location.href;var b=Number(g.gn(4,a))||"";b&&(this.port=":"+b);this.domain=g.hn(a)||"";a=g.pc();0<=a.search("MSIE")&&(a=a.match(/MSIE ([\d.]+)/)[1],0>g.mc(a,"10.0")&&(this.B=!1))},$8=function(a,b){var c=a.j; a.B&&(c=a.scheme+"://"+a.domain+a.port+a.j);return g.Mn(c+b,{})},IDb=function(a,b){g.Dd.call(this); var c=this;this.Fd=a();this.Fd.subscribe("handlerOpened",this.a4,this);this.Fd.subscribe("handlerClosed",this.onClosed,this);this.Fd.subscribe("handlerError",function(d,e){c.onError(e)}); this.Fd.subscribe("handlerMessage",this.onMessage,this);this.j=b},JDb=function(a,b,c){var d=this; c=void 0===c?function(){return""}:c; var e=void 0===e?new PCb:e;var f=void 0===f?new g.Nv:f;this.pathPrefix=a;this.j=b;this.Ba=c;this.G=f;this.Z=null;this.Y=this.N=0;this.channel=null;this.K=0;this.C=new Y8(function(){d.C.isActive();var h;0===(null==(h=d.channel)?void 0:qCb((new SCb(h,h.j)).j.B))&&d.connect(d.Z,d.N)}); this.D={};this.B={};this.qa=!1;this.logger=null;this.ra=[];this.zg=void 0;this.Na=new aBb;this.Ga=new cBb;this.La=new eBb;this.Da=new gBb},KDb=function(a){g.td(a.channel,"m",function(){a.K=3; a.C.reset();a.Z=null;a.N=0;for(var b=g.u(a.ra),c=b.next();!c.done;c=b.next())c=c.value,a.channel&&a.channel.send(c);a.ra=[];a.publish("webChannelOpened");bBb(a.Na,"WEB_CHANNEL")}); g.td(a.channel,"n",function(){a.K=0;a.C.isActive()||a.publish("webChannelClosed");var b,c=null==(b=a.channel)?void 0:TCb(new SCb(b,b.j));c&&(a.ra=[].concat(g.qa(c)));dBb(a.Ga,"WEB_CHANNEL")}); g.td(a.channel,"p",function(b){var c=b.data;"gracefulReconnect"===c[0]?(a.C.start(),a.channel&&a.channel.close()):a.publish("webChannelMessage",new FDb(c[0],c[1]));a.zg=b.statusCode;fBb(a.La,"WEB_CHANNEL")}); g.td(a.channel,"o",function(){401===a.zg||a.C.start();a.publish("webChannelError");hBb(a.Da,"WEB_CHANNEL")})},LDb=function(a){var b=a.Ba(); b?a.D["x-youtube-lounge-xsrf-token"]=b:delete a.D["x-youtube-lounge-xsrf-token"]},MDb=function(a){g.Dd.call(this); this.j=a();this.j.subscribe("webChannelOpened",this.b4,this);this.j.subscribe("webChannelClosed",this.onClosed,this);this.j.subscribe("webChannelError",this.onError,this);this.j.subscribe("webChannelMessage",this.onMessage,this)},NDb=function(a,b,c,d,e){function f(){return new GDb($8(a,"/bc"),b,!1,c,d)} c=void 0===c?function(){return""}:c; return g.AB("enable_mdx_web_channel_desktop")?new MDb(function(){return new JDb($8(a,"/wc"),b,c)}):new IDb(f,e)},RDb=function(){var a=ODb; PDb();a9.push(a);QDb()},b9=function(a,b){PDb(); var c=SDb(a,String(b));0==a9.length?TDb(c):(QDb(),g.$b(a9,function(d){d(c)}))},c9=function(a){b9("CP",a)},PDb=function(){a9||(a9=g.Xa("yt.mdx.remote.debug.handlers_")||[],g.Va("yt.mdx.remote.debug.handlers_",a9))},TDb=function(a){var b=(d9+1)%50; d9=b;e9[b]=a;f9||(f9=49==b)},QDb=function(){var a=a9; if(e9[0]){var b=f9?d9:-1;do{b=(b+1)%50;var c=e9[b];g.$b(a,function(d){d(c)})}while(b!=d9); e9=Array(50);d9=-1;f9=!1}},SDb=function(a,b){var c=(Date.now()-UDb)/1E3; c.toFixed&&(c=c.toFixed(3));var d=[];d.push("[",c+"s","] ");d.push("[","yt.mdx.remote","] ");d.push(a+": "+b,"\n");return d.join("")},g9=function(a){g.wF.call(this); this.K=a;this.screens=[]},VDb=function(a,b){var c=a.get(b.uuid)||a.get(b.id); if(c)return a=c.name,c.id=b.id||c.id,c.name=b.name,c.token=b.token,c.uuid=b.uuid||c.uuid,c.name!=a;a.screens.push(b);return!0},WDb=function(a,b){var c=a.screens.length!=b.length; a.screens=g.Ht(a.screens,function(f){return!!xBb(b,f)}); for(var d=0,e=b.length;dd?c(e):a.K=g.wB(function(){uEb(a,b,c,d-1)},300)})},wEb=function(a){g.yB(a.Z); a.Z=0;g.yB(a.K);a.K=0;g.yB(a.qa);a.qa=0;g.yB(a.G);a.G=0;g.yB(a.N);a.N=0},r9=function(a,b,c,d){n9.call(this,a,b,"DialSession"); this.config_=d;this.C=this.Z=null;this.Ga="";this.Ra=c;this.Na=null;this.qa=function(){}; this.Y=NaN;this.La=(0,g.gb)(this.j4,this);this.G=function(){}; this.N=this.K=0;this.ra=!1;this.Ba="unknown"},s9=function(a){var b; return!!(a.config_.enableDialLoungeToken&&(null==(b=a.C)?0:b.getDialAppInfo))},xEb=function(a){a.G=a.D.eU(a.Ga,a.B.label,a.B.friendlyName,s9(a),function(b,c){a.G=function(){}; a.ra=!0;o9(a,b);"shortLived"==b.idType&&0d?c(e):a.K=g.wB(function(){AEb(a,b,c,d-1)},300)})},t9=function(a,b){a.info("getDialAppInfoWithTimeout_ "+b); s9(a)&&(g.yB(a.N),a.N=0,0==b?DEb(a):a.N=g.wB(function(){DEb(a)},b))},DEb=function(a){s9(a)&&a.C.getDialAppInfo(function(b){a.info("getDialAppInfo dialLaunchData: "+JSON.stringify(b)); b=b.extraData||{};var c=null;if(b.loungeToken){var d;(null==(d=a.j)?void 0:d.token)==b.loungeToken&&(c="staleLoungeToken")}else c="missingLoungeToken";c?(a.Ba=c,t9(a,3E4)):(a.ra=!1,a.Ba="unknown",nEb(a,b.loungeToken),t9(a,b.loungeTokenRefreshIntervalMs))},function(b){a.info("getDialAppInfo error: "+b); a.Ba="noLoungeTokenResponse";t9(a,3E4)})},EEb=function(a){g.yB(a.K); a.K=0;g.yB(a.N);a.N=0;a.G();a.G=function(){}; g.yB(a.Y)},u9=function(a,b){n9.call(this,a,b,"ManualSession"); this.C=g.wB((0,g.gb)(this.jA,this,null),150)},v9=function(a,b){g.wF.call(this); this.config_=b;this.B=a;this.Z=b.appId||"233637DE";this.D=b.theme||"cl";this.Y=b.disableCastApi||!1;this.K=b.forceMirroring||!1;this.j=null;this.N=!1;this.C=[];this.G=(0,g.gb)(this.vaa,this)},FEb=function(a,b){return b?g.Db(a.C,function(c){return j8(b,c.label)},a):null},w9=function(a){b9("Controller",a)},ODb=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},x9=function(a){return a.N||!!a.C.length||!!a.j},y9=function(a,b,c){b!=a.j&&(g.vb(a.j),(a.j=b)?(c?a.publish("yt-remote-cast2-receiver-resumed", b.B):a.publish("yt-remote-cast2-receiver-selected",b.B),b.subscribe("sessionScreen",(0,g.gb)(a.YZ,a,b)),b.subscribe("sessionFailed",function(){return GEb(a,b)}),b.j?a.publish("yt-remote-cast2-session-change",b.j):c&&a.j.jA(null)):a.publish("yt-remote-cast2-session-change",null))},GEb=function(a,b){a.j==b&&a.publish("yt-remote-cast2-session-failed")},HEb=function(a){var b=a.B.dU(),c=a.j&&a.j.B; a=g.Rr(b,function(d){c&&j8(d,c.label)&&(c=null);var e=d.uuid?d.uuid:d.id,f=FEb(this,d);f?(f.label=e,f.friendlyName=d.name):(f=new chrome.cast.Receiver(e,d.name),f.receiverType=chrome.cast.ReceiverType.CUSTOM);return f},a); c&&(c.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(c=new chrome.cast.Receiver(c.label,c.friendlyName),c.receiverType=chrome.cast.ReceiverType.CUSTOM),a.push(c));return a},OEb=function(a,b,c,d){d.disableCastApi?z9("Cannot initialize because disabled by Mdx config."):IEb()?JEb(b,d)&&(KEb(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?LEb(a,c):(window.__onGCastApiAvailable=function(e,f){e?LEb(a,c):(A9("Failed to load cast API: "+f),MEb(!1),KEb(!1),g.uC("yt-remote-cast-available"),g.uC("yt-remote-cast-receiver"), NEb(),c(!1))},d.loadCastApiSetupScript?g.Mta("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):0<=window.navigator.userAgent.indexOf("Android")&&0<=window.navigator.userAgent.indexOf("Chrome/")&&window.navigator.presentation?60<=KBb()&&TBb():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?OBb():89<=KBb()?VBb():(SBb(),s8(UBb.map(PBb))))):z9("Cannot initialize because not running Chrome")},NEb=function(){z9("dispose"); var a=B9();a&&a.dispose();g.Va("yt.mdx.remote.cloudview.instance_",null);PEb(!1);g.iE(QEb);QEb.length=0},C9=function(){return!!g.tC("yt-remote-cast-installed")},REb=function(){var a=g.tC("yt-remote-cast-receiver"); return a?a.friendlyName:null},SEb=function(){z9("clearCurrentReceiver"); g.uC("yt-remote-cast-receiver")},TEb=function(){return C9()?B9()?B9().getCastSession():(A9("getCastSelector: Cast is not initialized."),null):(A9("getCastSelector: Cast API is not installed!"),null)},UEb=function(){C9()?B9()?D9()?(z9("Requesting cast selector."),B9().requestSession()):(z9("Wait for cast API to be ready to request the session."),QEb.push(g.hE("yt-remote-cast2-api-ready",UEb))):A9("requestCastSelector: Cast is not initialized."):A9("requestCastSelector: Cast API is not installed!")}, E9=function(a,b){D9()?B9().setConnectedScreenStatus(a,b):A9("setConnectedScreenStatus called before ready.")},IEb=function(){var a=0<=g.pc().search(/ (CrMo|Chrome|CriOS)\//); return g.tK||a},VEb=function(a,b){B9().init(a,b)},JEb=function(a,b){var c=!1; B9()||(a=new v9(a,b),a.subscribe("yt-remote-cast2-availability-change",function(d){g.sC("yt-remote-cast-available",d);q8("yt-remote-cast2-availability-change",d)}),a.subscribe("yt-remote-cast2-receiver-selected",function(d){z9("onReceiverSelected: "+d.friendlyName); g.sC("yt-remote-cast-receiver",d);q8("yt-remote-cast2-receiver-selected",d)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(d){z9("onReceiverResumed: "+d.friendlyName); g.sC("yt-remote-cast-receiver",d);q8("yt-remote-cast2-receiver-resumed",d)}),a.subscribe("yt-remote-cast2-session-change",function(d){z9("onSessionChange: "+k8(d)); d||g.uC("yt-remote-cast-receiver");q8("yt-remote-cast2-session-change",d)}),g.Va("yt.mdx.remote.cloudview.instance_",a),c=!0); z9("cloudview.createSingleton_: "+c);return c},B9=function(){return g.Xa("yt.mdx.remote.cloudview.instance_")},LEb=function(a,b){MEb(!0); KEb(!1);VEb(a,function(c){c?(PEb(!0),g.jE("yt-remote-cast2-api-ready")):(A9("Failed to initialize cast API."),MEb(!1),g.uC("yt-remote-cast-available"),g.uC("yt-remote-cast-receiver"),NEb());b(c)})},z9=function(a){b9("cloudview",a)},A9=function(a){b9("cloudview",a)},MEb=function(a){z9("setCastInstalled_ "+a); g.sC("yt-remote-cast-installed",a)},D9=function(){return!!g.Xa("yt.mdx.remote.cloudview.apiReady_")},PEb=function(a){z9("setApiReady_ "+a); g.Va("yt.mdx.remote.cloudview.apiReady_",a)},KEb=function(a){g.Va("yt.mdx.remote.cloudview.initializing_",a)},F9=function(a){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.K=this.N=0;this.trackData=null;this.Pk=this.xp=!1;this.Z=this.G=this.j=this.D=0;this.C=NaN;this.B=!1;this.reset(a)},WEb=function(a){a.audioTrackId=null; a.trackData=null;a.playerState=-1;a.xp=!1;a.Pk=!1;a.N=0;a.K=g.kb();a.D=0;a.j=0;a.G=0;a.Z=0;a.C=NaN;a.B=!1},G9=function(a){return a.isPlaying()?(g.kb()-a.K)/1E3:0},H9=function(a,b){a.N=b; a.K=g.kb()},I9=function(a){switch(a.playerState){case 1:case 1081:return(g.kb()-a.K)/1E3+a.N; case -1E3:return 0}return a.N},J9=function(a,b,c){var d=a.videoId; a.videoId=b;a.index=c;b!=d&&WEb(a)},XEb=function(a){var b={}; b.index=a.index;b.listId=a.listId;b.videoId=a.videoId;b.playerState=a.playerState;b.volume=a.volume;b.muted=a.muted;b.audioTrackId=a.audioTrackId;b.trackData=g.nd(a.trackData);b.hasPrevious=a.xp;b.hasNext=a.Pk;b.playerTime=a.N;b.playerTimeAt=a.K;b.seekableStart=a.D;b.seekableEnd=a.j;b.duration=a.G;b.loadedTime=a.Z;b.liveIngestionTime=a.C;return b},L9=function(a,b){g.wF.call(this); var c=this;this.C=0;this.D=a;this.K=[];this.G=new CDb;this.B=this.j=null;this.Y=(0,g.gb)(this.h$,this);this.N=(0,g.gb)(this.ZE,this);this.Z=(0,g.gb)(this.g$,this);this.qa=(0,g.gb)(this.j$,this);var d=0;a?(d=a.getProxyState(),3!=d&&(a.subscribe("proxyStateChange",this.cS,this),YEb(this))):d=3;0!=d&&(b?this.cS(d):g.wB(function(){c.cS(d)},0)); (a=TEb())&&K9(this,a);this.subscribe("yt-remote-cast2-session-change",this.qa)},M9=function(a){return new F9(a.D.getPlayerContextData())},YEb=function(a){g.$b("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(b){this.K.push(this.D.subscribe(b,g.jb(this.taa,b),this))},a)},ZEb=function(a){g.$b(a.K,function(b){this.D.unsubscribeByKey(b)},a); a.K.length=0},N9=function(a){return 1==a.getState()},O9=function(a,b){var c=a.G; 50>c.j.length+c.B.length&&a.G.enqueue(b)},$Eb=function(a,b,c){var d=M9(a); H9(d,c);-1E3!=d.playerState&&(d.playerState=b);P9(a,d)},Q9=function(a,b,c){a.D.sendMessage(b,c)},P9=function(a,b){ZEb(a); a.D.setPlayerContextData(XEb(b));YEb(a)},K9=function(a,b){a.B&&(a.B.removeUpdateListener(a.Y),a.B.removeMediaListener(a.N),a.ZE(null)); a.B=b;a.B&&(c9("Setting cast session: "+a.B.sessionId),a.B.addUpdateListener(a.Y),a.B.addMediaListener(a.N),a.B.media.length&&a.ZE(a.B.media[0]))},aFb=function(a){var b=a.j.media,c=a.j.customData; if(b&&c){var d=M9(a);b.contentId!=d.videoId&&c9("Cast changing video to: "+b.contentId);d.videoId=b.contentId;d.playerState=c.playerState;H9(d,a.j.getEstimatedTime());P9(a,d)}else c9("No cast media video. Ignoring state update.")},R9=function(a,b,c){return(0,g.gb)(function(d){this.dg("Failed to "+b+" with cast v2 channel. Error code: "+d.code); d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.dg("Retrying "+b+" using MDx browser channel."),Q9(this,b,c))},a)},U9=function(a,b,c,d){d=void 0===d?!1:d; g.wF.call(this);var e=this;this.K=NaN;this.Ga=!1;this.Y=this.Z=this.ra=this.Ba=NaN;this.qa=[];this.G=this.N=this.D=this.j=this.B=null;this.Na=a;this.La=d;this.qa.push(g.jC(window,"beforeunload",function(){e.nz(2)})); this.C=[];this.j=new F9;this.Ra=b.id;this.Da=b.idType;this.B=NDb(this.Na,c,this.iU,"shortLived"==this.Da,this.Ra);this.B.listen("channelOpened",function(){bFb(e)}); this.B.listen("channelClosed",function(){S9("Channel closed");isNaN(e.K)?o8(!0):o8();e.dispose()}); this.B.listen("channelError",function(f){o8();isNaN(e.TD())?(1==f&&"shortLived"==e.Da&&e.publish("browserChannelAuthError",f),S9("Channel error: "+f+" without reconnection"),e.dispose()):(e.Ga=!0,S9("Channel error: "+f+" with reconnection in "+e.TD()+" ms"),T9(e,2))}); this.B.listen("channelMessage",function(f){cFb(e,f)}); this.B.Ir(b.token);this.subscribe("remoteQueueChange",function(){var f=e.j.videoId;g.vC()&&g.sC("yt-remote-session-video-id",f)})},dFb=function(a){return g.Db(a.C,function(b){return"LOUNGE_SCREEN"==b.type})},S9=function(a){b9("conn",a)},T9=function(a,b){a.publish("proxyStateChange",b)},eFb=function(a){a.K=g.wB(function(){S9("Connecting timeout"); a.nz(1)},2E4)},fFb=function(a){g.yB(a.K); a.K=NaN},gFb=function(a){g.yB(a.Ba); a.Ba=NaN},iFb=function(a){hFb(a); a.ra=g.wB(function(){V9(a,"getNowPlaying")},2E4)},hFb=function(a){g.yB(a.ra); a.ra=NaN},bFb=function(a){S9("Channel opened"); a.Ga&&(a.Ga=!1,gFb(a),a.Ba=g.wB(function(){S9("Timing out waiting for a screen.");a.nz(1)},15E3))},kFb=function(a,b){var c=null; if(b){var d=dFb(a);d&&(c={clientName:d.clientName,deviceMake:d.brand,deviceModel:d.model,osVersion:d.osVersion})}g.Va("yt.mdx.remote.remoteClient_",c);b&&(fFb(a),gFb(a));c=a.B.Vz()&&isNaN(a.K);b==c?b&&(T9(a,1),V9(a,"getSubtitlesTrack")):b?(a.mX()&&a.j.reset(),T9(a,1),V9(a,"getNowPlaying"),jFb(a)):a.nz(1)},lFb=function(a,b){var c=b.params.videoId; delete b.params.videoId;c==a.j.videoId&&(g.id(b.params)?a.j.trackData=null:a.j.trackData=b.params,a.publish("remotePlayerChange"))},mFb=function(a,b,c){var d=b.params.videoId||b.params.video_id,e=parseInt(b.params.currentIndex,10); a.j.listId=b.params.listId||a.j.listId;J9(a.j,d,e);a.publish("remoteQueueChange",c)},oFb=function(a,b){b.params=b.params||{}; mFb(a,b,"NOW_PLAYING_MAY_CHANGE");nFb(a,b);a.publish("autoplayDismissed")},nFb=function(a,b){var c=parseInt(b.params.currentTime||b.params.current_time,10); H9(a.j,isNaN(c)?0:c);c=parseInt(b.params.state,10);c=isNaN(c)?-1:c;-1==c&&-1E3==a.j.playerState&&(c=-1E3);a.j.playerState=c;c=Number(b.params.loadedTime);a.j.Z=isNaN(c)?0:c;a.j.jl(Number(b.params.duration));c=a.j;var d=Number(b.params.liveIngestionTime);c.C=d;c.B=isNaN(d)?!1:!0;c=a.j;d=Number(b.params.seekableStartTime);b=Number(b.params.seekableEndTime);c.D=isNaN(d)?0:d;c.j=isNaN(b)?0:b;1==a.j.playerState?iFb(a):hFb(a);a.publish("remotePlayerChange")},pFb=function(a,b){if(-1E3!=a.j.playerState){var c= 1085; switch(parseInt(b.params.adState,10)){case 1:c=1081;break;case 2:c=1084;break;case 0:c=1083}a.j.playerState=c;b=parseInt(b.params.currentTime,10);H9(a.j,isNaN(b)?0:b);a.publish("remotePlayerChange")}},qFb=function(a,b){var c="true"==b.params.muted; a.j.volume=parseInt(b.params.volume,10);a.j.muted=c;a.publish("remotePlayerChange")},rFb=function(a,b){a.N=b.params.videoId; a.publish("nowAutoplaying",parseInt(b.params.timeout,10))},sFb=function(a,b){a.N=b.params.videoId||null; a.publish("autoplayUpNext",a.N)},tFb=function(a,b){a.G=b.params.autoplayMode; a.publish("autoplayModeChange",a.G);"DISABLED"==a.G&&a.publish("autoplayDismissed")},uFb=function(a,b){var c="true"==b.params.hasNext; a.j.xp="true"==b.params.hasPrevious;a.j.Pk=c;a.publish("previousNextChange")},cFb=function(a,b){b=b.message; b.params?S9("Received: action="+b.action+", params="+g.$m(b.params)):S9("Received: action="+b.action+" {}");switch(b.action){case "loungeStatus":b=d8(b.params.devices);a.C=g.Rr(b,function(d){return new oBb(d)}); b=!!g.Db(a.C,function(d){return"LOUNGE_SCREEN"==d.type}); kFb(a,b);b=a.rY("mlm");a.publish("multiStateLoopEnabled",b);break;case "loungeScreenDisconnected":g.Jb(a.C,function(d){return"LOUNGE_SCREEN"==d.type}); kFb(a,!1);break;case "remoteConnected":var c=new oBb(d8(b.params.device));g.Db(a.C,function(d){return c?d.id==c.id:!1})||TAb(a.C,c); break;case "remoteDisconnected":c=new oBb(d8(b.params.device));g.Jb(a.C,function(d){return c?d.id==c.id:!1}); break;case "gracefulDisconnect":break;case "playlistModified":mFb(a,b,"QUEUE_MODIFIED");break;case "nowPlaying":oFb(a,b);break;case "onStateChange":nFb(a,b);break;case "onAdStateChange":pFb(a,b);break;case "onVolumeChanged":qFb(a,b);break;case "onSubtitlesTrackChanged":lFb(a,b);break;case "nowAutoplaying":rFb(a,b);break;case "autoplayDismissed":a.publish("autoplayDismissed");break;case "autoplayUpNext":sFb(a,b);break;case "onAutoplayModeChanged":tFb(a,b);break;case "onHasPreviousNextChanged":uFb(a, b);break;case "requestAssistedSignIn":a.publish("assistedSignInRequested",b.params.authCode);break;case "onLoopModeChanged":a.publish("loopModeChange",b.params.loopMode);break;default:S9("Unrecognized action: "+b.action)}},jFb=function(a){g.yB(a.Y); a.Y=g.wB(function(){a.nz(1)},864E5)},V9=function(a,b,c){c?S9("Sending: action="+b+", params="+g.$m(c)):S9("Sending: action="+b); a.B.sendMessage(b,c)},vFb=function(a){g9.call(this,"ScreenServiceProxy"); this.dh=a;this.j=[];this.j.push(this.dh.$_s("screenChange",(0,g.gb)(this.o4,this)));this.j.push(this.dh.$_s("onlineScreenChange",(0,g.gb)(this.Y$,this)))},AFb=function(a,b){HBb(); if(!p8||!p8.get("yt-remote-disable-remote-module-for-dev")){b=g.cB("MDX_CONFIG")||b;yBb();CBb();W9||(W9=new Z8(b?b.loungeApiHost:void 0),IBb()&&(W9.j="/api/loungedev"));X9||(X9=g.Xa("yt.mdx.remote.deferredProxies_")||[],g.Va("yt.mdx.remote.deferredProxies_",X9));wFb();var c=Y9();if(!c){var d=new l9(W9,b?b.disableAutomaticScreenCache||!1:!1);g.Va("yt.mdx.remote.screenService_",d);c=Y9();var e={};b&&(e={appId:b.appId,disableDial:b.disableDial,theme:b.theme,loadCastApiSetupScript:b.loadCastApiSetupScript, disableCastApi:b.disableCastApi,enableDialLoungeToken:b.enableDialLoungeToken,enableCastLoungeToken:b.enableCastLoungeToken,forceMirroring:b.forceMirroring});g.Va("yt.mdx.remote.enableConnectWithInitialState_",b?b.enableConnectWithInitialState||!1:!1);OEb(a,d,function(f){f?Z9()&&E9(Z9(),"YouTube TV"):d.subscribe("onlineScreenChange",function(){q8("yt-remote-receiver-availability-change")})},e)}b&&!g.Xa("yt.mdx.remote.initialized_")&&(g.Va("yt.mdx.remote.initialized_",!0),$9("Initializing: "+g.$m(b)), a$.push(g.hE("yt-remote-cast2-api-ready",function(){q8("yt-remote-api-ready")})),a$.push(g.hE("yt-remote-cast2-availability-change",function(){q8("yt-remote-receiver-availability-change")})),a$.push(g.hE("yt-remote-cast2-receiver-selected",function(){b$(null); q8("yt-remote-auto-connect","cast-selector-receiver")})),a$.push(g.hE("yt-remote-cast2-receiver-resumed",function(){q8("yt-remote-receiver-resumed","cast-selector-receiver")})),a$.push(g.hE("yt-remote-cast2-session-change",xFb)),a$.push(g.hE("yt-remote-connection-change",function(f){f?E9(Z9(),"YouTube TV"):c$()||(E9(null,null),SEb())})),a$.push(g.hE("yt-remote-cast2-session-failed",function(){q8("yt-remote-connection-failed")})),a=yFb(),b.isAuto&&(a.id+="#dial"),e=b.capabilities||[],g.AB("desktop_enable_autoplay")&& e.push("atp"),02*this.size&&h8(this),!0):!1}; g.k.get=function(a,b){return f8(this.B,a)?this.B[a]:b}; g.k.set=function(a,b){f8(this.B,a)||(this.size+=1,this.j.push(a),this.Fu++);this.B[a]=b}; g.k.forEach=function(a,b){for(var c=this.An(),d=0;d=d.j.length)return g.t2;var f=d.j[b++];return g.Dt(a?f:d.B[f])}; return e}; var pBb={wpa:"atp",q7a:"ska",z3a:"que",JVa:"mus",o7a:"sus",DGa:"dsp",p5a:"seq",hUa:"mic",ixa:"dpa",Uqa:"cds",yVa:"mlm",Wwa:"dsdtr",jWa:"ntb",cjb:"vsp",Wxa:"scn",N3a:"rpe",Twa:"dcn",Uwa:"dcp",b0a:"pas",Vwa:"drq",JZa:"opf",Vxa:"els",H5a:"svq"},qBb={x5:"u",t2:"cl",b5:"k",O2:"i",z2:"cr",j5:"m",L2:"g",cV:"up"},BBb="",p8=null; JBb.prototype.flush=function(a,b){a=void 0===a?[]:a;b=void 0===b?!1:b;if(g.AB("enable_client_streamz_web")){a=g.u(a);for(var c=a.next();!c.done;c=a.next())c=g.hfa(c.value),c={serializedIncrementBatch:g.Gg(c.j())},g.MC("streamzIncremented",c,{sendIsolatedPayload:b})}}; var r8,RBb=LBb("loadCastFramework")||LBb("loadCastApplicationFramework"),UBb=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.lb(t8,g.I);g.k=t8.prototype;g.k.P3=function(a){this.D=arguments;this.j=!1;this.fd?this.C=g.kb()+this.Si:this.fd=g.Bg(this.G,this.Si)}; g.k.stop=function(){this.fd&&(g.Ta.clearTimeout(this.fd),this.fd=null);this.C=null;this.j=!1;this.D=[]}; g.k.pause=function(){++this.B}; g.k.resume=function(){this.B&&(--this.B,!this.B&&this.j&&(this.j=!1,this.K.apply(null,this.D)))}; g.k.va=function(){this.stop();t8.Of.va.call(this)}; g.k.Q3=function(){this.fd&&(g.Ta.clearTimeout(this.fd),this.fd=null);this.C?(this.fd=g.Bg(this.G,this.C-g.kb()),this.C=null):this.B?this.j=!0:(this.j=!1,this.K.apply(null,this.D))};g.y(u8,g.I);g.k=u8.prototype;g.k.ZL=function(a){this.C=arguments;this.fd||this.B?this.j=!0:WBb(this)}; g.k.stop=function(){this.fd&&(g.Ta.clearTimeout(this.fd),this.fd=null,this.j=!1,this.C=null)}; g.k.pause=function(){this.B++}; g.k.resume=function(){this.B--;this.B||!this.j||this.fd||(this.j=!1,WBb(this))}; g.k.va=function(){g.I.prototype.va.call(this);this.stop()};v8.prototype.stringify=function(a){return g.Ta.JSON.stringify(a,void 0)}; v8.prototype.parse=function(a){return g.Ta.JSON.parse(a,void 0)};g.lb(XBb,g.zb);g.lb(YBb,g.zb);var ZBb=null;g.lb(aCb,g.zb);g.lb(bCb,g.zb);g.lb(cCb,g.zb);z8.prototype.debug=function(){}; z8.prototype.info=function(){}; z8.prototype.warning=function(){};var jCb={},iCb={};g.k=A8.prototype;g.k.setTimeout=function(a){this.fb=a}; g.k.S3=function(a){a=a.target;var b=this.Wa;b&&3==g.Tn(a)?b.ZL():this.IT(a)}; g.k.IT=function(a){try{if(a==this.j)a:{var b=g.Tn(this.j),c=this.j.B,d=this.j.getStatus();if(!(3>b)&&(3!=b||this.j&&(this.B.B||g.Vn(this.j)||g.Wn(this.j)))){this.La||4!=b||7==c||(8==c||0>=d?w8(3):w8(2));mCb(this);var e=this.j.getStatus();this.Hb=e;b:if(hCb(this)){var f=g.Wn(this.j);a="";var h=f.length,l=4==g.Tn(this.j);if(!this.B.C){if("undefined"===typeof TextDecoder){D8(this);C8(this);var m="";break b}this.B.C=new g.Ta.TextDecoder}for(c=0;c=this.Jd)){var a=2*this.Jd;this.Ga=y8((0,g.gb)(this.d$,this),a)}}; g.k.d$=function(){this.Ga&&(this.Ga=null,this.Va=!1,this.fb=!0,x8(10),F8(this),LCb(this))}; g.k.yQ=function(a){this.j==a&&this.Dc&&!this.fb&&(FCb(this),this.fb=!0,x8(11))}; g.k.T3=function(){null!=this.qa&&(this.qa=null,F8(this),pCb(this),x8(19))}; g.k.nda=function(a){a?x8(2):x8(1)}; g.k.isActive=function(){return!!this.G&&this.G.isActive(this)}; g.k=OCb.prototype;g.k.QT=function(){}; g.k.PT=function(){}; g.k.OT=function(){}; g.k.NT=function(){}; g.k.isActive=function(){return!0}; g.k.U3=function(){};g.lb(M8,g.Dd);M8.prototype.open=function(){this.j.G=this.C;this.K&&(this.j.Ra=!0);this.j.connect(this.G,this.B||void 0)}; M8.prototype.close=function(){this.j.disconnect()}; M8.prototype.send=function(a){var b=this.j;if("string"===typeof a){var c={};c.__data__=a;a=c}else this.D&&(c={},c.__data__=g.$m(a),a=c);b.C.push(new wCb(b.Rf++,a));3==b.Kh&&H8(b)}; M8.prototype.va=function(){this.j.G=null;delete this.C;this.j.disconnect();delete this.j;M8.Of.va.call(this)}; g.lb(QCb,XBb);g.lb(RCb,YBb);g.lb(L8,OCb);L8.prototype.QT=function(){this.j.dispatchEvent("m")}; L8.prototype.PT=function(a){this.j.dispatchEvent(new QCb(a))}; L8.prototype.OT=function(a){this.j.dispatchEvent(new RCb(a))}; L8.prototype.NT=function(){this.j.dispatchEvent("n")};var O8=new g.Dd;g.y(UCb,g.zb);g.k=Q8.prototype;g.k.Ru=null;g.k.Xr=!1;g.k.Ux=null;g.k.bM=null;g.k.lC=null;g.k.WG=null;g.k.iC=null;g.k.VG=null;g.k.Tu=null;g.k.ej=null;g.k.YG=0;g.k.Y0=null;g.k.XG=null;g.k.Su=null;g.k.kC=-1;g.k.d0=!0;g.k.jC=!1;g.k.aM=0;g.k.UG=null;var $Cb={},ZCb={};g.k=Q8.prototype;g.k.setTimeout=function(a){this.B=a}; g.k.W3=function(a){a=a.target;var b=this.UG;b&&3==g.Tn(a)?b.ZL():this.RT(a)}; g.k.RT=function(a){try{if(a==this.ej)a:{var b=g.Tn(this.ej),c=this.ej.B,d=this.ej.getStatus();if(g.Rc&&!g.Mc("420+")){if(4>b)break a}else if(3>b||3==b&&!g.Vn(this.ej))break a;this.jC||4!=b||7==c||(8==c||0>=d?this.j.qr(3):this.j.qr(2));cDb(this);var e=this.ej.getStatus();this.kC=e;var f=g.Vn(this.ej);if(this.Xr=200==e){4==b&&R8(this);if(this.Da){for(a=!0;!this.jC&&this.YGa[2]&&this.AL&&0==this.Vx&&!this.Vu&&(this.Vu=N8((0,g.gb)(this.Z3,this),6E3));else X8(this,11)}else null!=b&&X8(this,11);else if(this.Pg== a&&V8(this),!g.ec(b))for(a=this.G.parse(b),b=0;b=SFb.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(a=SFb[this.B],this.fd=g.wB((0,g.gb)(this.t_,this),a),this.B++):this.publish("pairingFailed",Error("Server error "+a.status))}; g.k.f4=function(){this.j=null;this.publish("pairingFailed",Error("Server not responding"))}; var SFb=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.lb(i9,g9);g.k=i9.prototype;g.k.start=function(){h9(this)&&this.publish("screenChange");!g.tC("yt-remote-lounge-token-expiration")&&ZDb(this);g.yB(this.j);this.j=g.wB((0,g.gb)(this.start,this),1E4)}; g.k.add=function(a,b){h9(this);VDb(this,a);j9(this,!1);this.publish("screenChange");b(a);a.token||ZDb(this)}; g.k.remove=function(a,b){var c=h9(this);XDb(this,a)&&(j9(this,!1),c=!0);b(a);c&&this.publish("screenChange")}; g.k.zL=function(a,b,c,d){var e=h9(this),f=this.get(a.id);f?(f.name!=b&&(f.name=b,j9(this,!1),e=!0),c(a)):d(Error("no such local screen."));e&&this.publish("screenChange")}; g.k.va=function(){g.yB(this.j);i9.Of.va.call(this)}; g.k.d8=function(a){h9(this);var b=this.screens.length;a=a&&a.screens||[];for(var c=0,d=a.length;c "+b);if(this.j){var c=this.j.j;if(!a||c&&c.id!=a)w9("Unsetting old screen status: "+this.j.B.friendlyName),y9(this,null)}if(a&&b){if(!this.j){a=l8(this.B.Mk(),a);if(!a){w9("setConnectedScreenStatus: Unknown screen.");return}if("shortLived"==a.idType){w9("setConnectedScreenStatus: Screen with id type to be short lived.");return}c=FEb(this,a);c||(w9("setConnectedScreenStatus: Connected receiver not custom..."),c=new chrome.cast.Receiver(a.uuid? a.uuid:a.id,a.name),c.receiverType=chrome.cast.ReceiverType.CUSTOM,this.C.push(c),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.gb)(function(d){this.dg("Failed to set initial custom receivers: "+g.$m(d))},this))); w9("setConnectedScreenStatus: new active receiver: "+c.friendlyName);y9(this,new u9(this.B,c),!0)}this.j.YR(b)}else w9("setConnectedScreenStatus: no screen.")}; g.k.Mca=function(a){this.Ma()?this.dg("Setting connection data on disposed cast v2"):this.j?this.j.jA(a):this.dg("Setting connection data without a session")}; g.k.m4=function(){this.Ma()?this.dg("Stopping session on disposed cast v2"):this.j?(this.j.stop(),y9(this,null)):w9("Stopping non-existing session")}; g.k.requestSession=function(){chrome.cast.requestSession((0,g.gb)(this.WZ,this),(0,g.gb)(this.Taa,this))}; g.k.va=function(){this.B.unsubscribe("onlineScreenChange",(0,g.gb)(this.gU,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.G);var a=ODb,b=g.Xa("yt.mdx.remote.debug.handlers_");g.Hb(b||[],a);g.vb(this.j);g.wF.prototype.va.call(this)}; g.k.dg=function(a){b9("Controller",a)}; g.k.YZ=function(a,b){this.j==a&&(b||y9(this,null),this.publish("yt-remote-cast2-session-change",b))}; g.k.vaa=function(a,b){if(!this.Ma())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),w9("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+b),b){case chrome.cast.ReceiverAction.CAST:if(this.j)if(this.j.B.label!=a.label)w9("onReceiverAction_: Stopping active receiver: "+this.j.B.friendlyName),this.j.stop();else{w9("onReceiverAction_: Casting to active receiver.");this.j.j&&this.publish("yt-remote-cast2-session-change",this.j.j);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:y9(this, new u9(this.B,a));break;case chrome.cast.ReceiverType.DIAL:y9(this,new r9(this.B,a,this.D,this.config_));break;case chrome.cast.ReceiverType.CAST:y9(this,new q9(this.B,a,this.config_));break;default:this.dg("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.j&&this.j.B.label==a.label?this.j.stop():this.dg("Stopping receiver w/o session: "+a.friendlyName)}else this.dg("onReceiverAction_ called without receiver.")}; g.k.q$=function(a){if(this.Ma())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.dg("Not DIAL receiver: "+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.j?this.j.B:null;if(!c||c.label!=b.label)return this.dg("Receiving DIAL launch request for non-clicked DIAL receiver: "+b.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(c&&c.label==b.label&&c.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.j.j)return w9("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.j.j),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.dg('Changing CAST intent from "'+c.receiverType+'" to "dial" for '+b.friendlyName);y9(this,new r9(this.B,b,this.D,this.config_))}b=this.j;b.Z=a;b.Z.appState==chrome.cast.DialAppState.RUNNING?(a=b.Z.extraData||{},c=a.screenId||null,s9(b)&&a.loungeToken?a.loungeTokenRefreshIntervalMs?a=BEb(b,{name:b.B.friendlyName,screenId:a.screenId,loungeToken:a.loungeToken,dialId:b.Z.receiver.label, screenIdType:"shortLived"},a.loungeTokenRefreshIntervalMs):(g.fB(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(a)+".")),a=CEb(b,c)):a=CEb(b,c)):a=zEb(b);return a}; g.k.WZ=function(a){var b=this;if(!this.Ma()&&!this.K){w9("New cast session ID: "+a.sessionId);var c=a.receiver;if(c.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.j)if(c.receiverType==chrome.cast.ReceiverType.CAST)w9("Got resumed cast session before resumed mdx connection."),c.friendlyName=chrome.cast.unescape(c.friendlyName),y9(this,new q9(this.B,c,this.config_),!0);else{this.dg("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var d=this.j.B,e=l8(this.B.Mk(), d.label);e&&j8(e,c.label)&&d.receiverType!=chrome.cast.ReceiverType.CAST&&c.receiverType==chrome.cast.ReceiverType.CAST&&(w9("onSessionEstablished_: manual to cast session change "+c.friendlyName),g.vb(this.j),this.j=new q9(this.B,c,this.config_),this.j.subscribe("sessionScreen",(0,g.gb)(this.YZ,this,this.j)),this.j.subscribe("sessionFailed",function(){return GEb(b,b.j)}),this.j.jA(null)); this.j.WR(a)}}}; g.k.l4=function(){return this.j?this.j.fU():null}; g.k.Taa=function(a){this.Ma()||(this.dg("Failed to estabilish a session: "+g.$m(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&y9(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.k.yaa=function(a){w9("Receiver availability updated: "+a);if(!this.Ma()){var b=x9(this);this.N=a==chrome.cast.ReceiverAvailability.AVAILABLE;x9(this)!=b&&this.publish("yt-remote-cast2-availability-change",x9(this))}}; g.k.gU=function(){this.Ma()||(this.C=HEb(this),w9("Updating custom receivers: "+g.$m(this.C)),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.gb)(function(){this.dg("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",x9(this)))}; v9.prototype.setLaunchParams=v9.prototype.Mca;v9.prototype.setConnectedScreenStatus=v9.prototype.Jca;v9.prototype.stopSession=v9.prototype.m4;v9.prototype.getCastSession=v9.prototype.l4;v9.prototype.requestSession=v9.prototype.requestSession;v9.prototype.init=v9.prototype.init;v9.prototype.dispose=v9.prototype.dispose;var QEb=[];g.k=F9.prototype; g.k.reset=function(a){this.listId="";this.index=-1;this.videoId="";WEb(this);this.volume=-1;this.muted=!1;a&&(this.index=a.index,this.listId=a.listId,this.videoId=a.videoId,this.playerState=a.playerState,this.volume=a.volume,this.muted=a.muted,this.audioTrackId=a.audioTrackId,this.trackData=a.trackData,this.xp=a.hasPrevious,this.Pk=a.hasNext,this.N=a.playerTime,this.K=a.playerTimeAt,this.D=a.seekableStart,this.j=a.seekableEnd,this.G=a.duration,this.Z=a.loadedTime,this.C=a.liveIngestionTime,this.B= !isNaN(this.C))}; g.k.isPlaying=function(){return 1==this.playerState}; g.k.jl=function(a){this.G=isNaN(a)?0:a}; g.k.getDuration=function(){return this.B?this.G+G9(this):this.G}; g.k.clone=function(){return new F9(XEb(this))};g.y(L9,g.wF);g.k=L9.prototype;g.k.getState=function(){return this.C}; g.k.Xs=function(){return this.D.getReconnectTimeout()}; g.k.kx=function(){this.D.reconnect()}; g.k.play=function(){N9(this)?(this.j?this.j.play(null,g.Jd,R9(this,"play")):Q9(this,"play"),$Eb(this,1,I9(M9(this))),this.publish("remotePlayerChange")):O9(this,this.play)}; g.k.pause=function(){N9(this)?(this.j?this.j.pause(null,g.Jd,R9(this,"pause")):Q9(this,"pause"),$Eb(this,2,I9(M9(this))),this.publish("remotePlayerChange")):O9(this,this.pause)}; g.k.seekTo=function(a){if(N9(this)){if(this.j){var b=M9(this),c=new chrome.cast.media.SeekRequest;c.currentTime=a;b.isPlaying()||3==b.playerState?c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:c.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.j.seek(c,g.Jd,R9(this,"seekTo",{newTime:a}))}else Q9(this,"seekTo",{newTime:a});$Eb(this,3,a);this.publish("remotePlayerChange")}else O9(this,g.jb(this.seekTo,a))}; g.k.stop=function(){if(N9(this)){this.j?this.j.stop(null,g.Jd,R9(this,"stopVideo")):Q9(this,"stopVideo");var a=M9(this);a.index=-1;a.videoId="";WEb(a);P9(this,a);this.publish("remotePlayerChange")}else O9(this,this.stop)}; g.k.setVolume=function(a,b){if(N9(this)){var c=M9(this);if(this.B){if(c.volume!=a){var d=Math.round(a)/100;this.B.setReceiverVolumeLevel(d,(0,g.gb)(function(){c9("set receiver volume: "+d)},this),(0,g.gb)(function(){this.dg("failed to set receiver volume.")},this))}c.muted!=b&&this.B.setReceiverMuted(b,(0,g.gb)(function(){c9("set receiver muted: "+b)},this),(0,g.gb)(function(){this.dg("failed to set receiver muted.")},this))}else{var e={volume:a, muted:b};-1!=c.volume&&(e.delta=a-c.volume);Q9(this,"setVolume",e)}c.muted=b;c.volume=a;P9(this,c)}else O9(this,g.jb(this.setVolume,a,b))}; g.k.hU=function(a,b){if(N9(this)){var c=M9(this);a={videoId:a};b&&(c.trackData={trackName:b.name,languageCode:b.languageCode,sourceLanguageCode:b.translationLanguage?b.translationLanguage.languageCode:"",languageName:b.languageName,kind:b.kind},a.style=g.$m(b.style),g.od(a,c.trackData));Q9(this,"setSubtitlesTrack",a);P9(this,c)}else O9(this,g.jb(this.hU,a,b))}; g.k.setAudioTrack=function(a,b){N9(this)?(b=b.getLanguageInfo().getId(),Q9(this,"setAudioTrack",{videoId:a,audioTrackId:b}),a=M9(this),a.audioTrackId=b,P9(this,a)):O9(this,g.jb(this.setAudioTrack,a,b))}; g.k.playVideo=function(a,b,c,d,e,f,h){d=void 0===d?null:d;e=void 0===e?null:e;f=void 0===f?null:f;h=void 0===h?null:h;var l=M9(this),m={videoId:a};void 0!==c&&(m.currentIndex=c);J9(l,a,c||0);void 0!==b&&(H9(l,b),m.currentTime=b);d&&(m.listId=d);e&&(m.playerParams=e);f&&(m.clickTrackingParams=f);h&&(m.locationInfo=g.$m(h));Q9(this,"setPlaylist",m);d||P9(this,l)}; g.k.BK=function(a,b){if(N9(this)){if(a&&b){var c=M9(this);J9(c,a,b);P9(this,c)}Q9(this,"previous")}else O9(this,g.jb(this.BK,a,b))}; g.k.nextVideo=function(a,b){if(N9(this)){if(a&&b){var c=M9(this);J9(c,a,b);P9(this,c)}Q9(this,"next")}else O9(this,g.jb(this.nextVideo,a,b))}; g.k.HH=function(){if(N9(this)){Q9(this,"clearPlaylist");var a=M9(this);a.reset();P9(this,a);this.publish("remotePlayerChange")}else O9(this,this.HH)}; g.k.wW=function(){N9(this)?Q9(this,"dismissAutoplay"):O9(this,this.wW)}; g.k.dispose=function(){if(3!=this.C){var a=this.C;this.C=3;this.publish("proxyStateChange",a,this.C)}g.wF.prototype.dispose.call(this)}; g.k.va=function(){ZEb(this);this.D=null;this.G.clear();K9(this,null);g.wF.prototype.va.call(this)}; g.k.cS=function(a){if((a!=this.C||2==a)&&3!=this.C&&0!=a){var b=this.C;this.C=a;this.publish("proxyStateChange",b,a);if(1==a)for(;!this.G.isEmpty();)b=a=this.G,0===b.j.length&&(b.j=b.B,b.j.reverse(),b.B=[]),a.j.pop().apply(this);else 3==a&&this.dispose()}}; g.k.taa=function(a,b){this.publish(a,b)}; g.k.h$=function(a){if(!a)this.ZE(null),K9(this,null);else if(this.B.receiver.volume){a=this.B.receiver.volume;var b=M9(this),c=Math.round(100*a.level||0);if(b.volume!=c||b.muted!=a.muted)c9("Cast volume update: "+a.level+(a.muted?" muted":"")),b.volume=c,b.muted=!!a.muted,P9(this,b)}}; g.k.ZE=function(a){c9("Cast media: "+!!a);this.j&&this.j.removeUpdateListener(this.Z);if(this.j=a)this.j.addUpdateListener(this.Z),aFb(this),this.publish("remotePlayerChange")}; g.k.g$=function(a){a?(aFb(this),this.publish("remotePlayerChange")):this.ZE(null)}; g.k.DS=function(){Q9(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.k.j$=function(){var a=TEb();a&&K9(this,a)}; g.k.dg=function(a){b9("CP",a)};g.y(U9,g.wF);g.k=U9.prototype; g.k.connect=function(a,b){if(b){var c=b.listId,d=b.videoId,e=b.videoIds,f=b.playerParams,h=b.clickTrackingParams,l=b.index,m={videoId:d},n=b.currentTime,p=b.locationInfo;b=b.loopMode;void 0!==n&&(m.currentTime=5>=n?0:n);f&&(m.playerParams=f);p&&(m.locationInfo=p);h&&(m.clickTrackingParams=h);c&&(m.listId=c);e&&0=(a.B?a.j+G9(a):a.j)-this.getCurrentTime(),loaded:a.Z,seekableEnd:a.B?a.j+G9(a):a.j,seekableStart:0