(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.zga(a.C,b,c)},nBb=function(a){if(a instanceof g.Ct)return a; if("function"==typeof a.Ql)return a.Ql(!1);if(g.ab(a)){var b=0,c=new g.Ct;c.next=function(){for(;;){if(b>=a.length)return g.r2;if(b in a)return g.Dt(a[b++]);b++}}; return c}throw Error("Not implemented");},oBb=function(a,b,c){if(g.ab(a))g.$b(a,b,c); else for(a=nBb(a);;){var d=a.next();if(d.done)break;b.call(c,d.value,void 0,a)}},pBb=function(a,b){var c=[]; oBb(b,function(d){try{var e=g.Qv.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.pla(e)&&c.push(d)},a); return c},qBb=function(a,b){pBb(a,b).forEach(function(c){g.Qv.prototype.remove.call(this,c)},a)},rBb=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},sBb=function(a,b){g.Fb(a,b)||a.push(b)},tBb=function(a){var b=0,c; for(c in a)b++;return b},uBb=function(a,b){return g.fd(a,b)},vBb=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 vBb(a)},wBb=function(a){if(a.im&&"function"==typeof a.im)return a.im(); 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.eb; LCb(a,a.eb)},LCb=function(a,b){if(null!=a.qa)throw Error("WatchDog timer not null"); a.qa=y8((0,g.gb)(a.X3,a),b)},MCb=function(a){a.qa&&(g.Ta.clearTimeout(a.qa),a.qa=null)},C8=function(a){a.C.Hg()||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.Nh&&(c.j==a||OCb(c.B,a)))if(!a.Va&&OCb(c.B,a)&&3==c.Nh){try{var d=c.yf.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.Ca+3E3e[2]&&c.Va&&0==c.ra&&!c.qa&&(c.qa=y8((0,g.gb)(c.Z3,c),6E3));if(1>=QCb(c.B)&&c.Pc){try{c.Pc()}catch(w){}c.Pc=void 0}}else G8(c,11)}else if((a.Va||c.j==a)&&E8(c),!g.ec(b))for(e=c.yf.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)},$Cb=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)},aDb=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){}},bDb=function(){this.j=new v8},cDb=function(a,b,c){var d=c||""; try{yBb(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.S8?c.S8[a]||b:b},dDb=function(a){this.C=[]; this.Nb=this.rd=this.Na=this.Wb=this.j=this.Ie=this.Ea=this.La=this.N=this.Hb=this.Y=null;this.Pf=this.Za=0;this.Nf=J8("failFast",!1,a);this.Va=this.qa=this.Z=this.K=this.G=null;this.uc=!0;this.Qd=this.Wa=-1;this.Jb=this.ra=this.Ca=0;this.kh=J8("baseRetryDelayMs",5E3,a);this.Qf=J8("retryDelaySeedMs",1E4,a);this.Of=J8("forwardChannelMaxRetries",2,a);this.He=J8("forwardChannelRequestTimeoutMs",2E4,a);this.xe=a&&a.Bqb||void 0;this.cg=a&&a.spb||void 0;this.Oe=a&&a.yqb||!1;this.bb=void 0;this.Ra=a&&a.pda|| !1;this.D="";this.B=new XCb(a&&a.wnb);this.yf=new bDb;this.zb=a&&a.Nnb||!1;this.rb=a&&a.Cnb||!1;this.zb&&this.rb&&(this.rb=!1);this.Rf=a&&a.mnb||!1;a&&a.Pnb&&(this.uc=!1);this.Dc=!this.zb&&this.uc&&a&&a.Anb||!1;this.md=void 0;a&&a.fZ&&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.Nh||2==a.Nh||a.Ca>=(a.Nf?0:a.Of))return!1;a.K=y8((0,g.gb)(a.bU,a,b),gDb(a,a.Ca));a.Ca++;return!0},jDb=function(a,b){var c; b?c=b.Wb: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.Ca+1);null===a.N&&(c.Na=a.Y);b&&(a.C=b.ra.concat(a.C));b=iDb(a,c,1E3);c.setTimeout(Math.round(.5*a.He)+Math.round(.5*a.He*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&&yBb({},function(c,d){g.Fp(b,d,c)})},iDb=function(a,b,c){c=Math.min(a.C.length,c); var d=a.G?(0,g.gb)(a.G.a4,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{cDb(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.aU,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.aU,a),gDb(a,a.ra));a.ra++;return!0},eDb=function(a){null!=a.Ga&&(g.Ta.clearTimeout(a.Ga),a.Ga=null)},kDb=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.rd.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.md&&g.Fp(b,"TO",a.md);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.Nb;c.Ra=1;c.Z=b8(b.clone());c.Y=null;c.Ea=!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);eDb(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.Nh)if(b.K)if(1==d){c=b.Y?b.Y.length:0;b=Date.now()-b.Ca;var e=a.Ca;d=zCb();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 yDb;b=b.slice(d,d+c);a.jH=d+c;return b},xDb=function(a){a.mM=Date.now()+a.B; BDb(a,a.B)},BDb=function(a,b){if(null!=a.Yx)throw Error("WatchDog timer not null"); a.Yx=N8((0,g.gb)(a.b4,a),b)},CDb=function(a){a.Yx&&(g.Ta.clearTimeout(a.Yx),a.Yx=null)},DDb=function(a){a.j.Hg()||a.pC||a.j.pM(a)},R8=function(a){CDb(a); g.vb(a.fH);a.fH=null;a.G.stop();a.C.removeAll();if(a.cj){var b=a.cj;a.cj=null;b.abort();b.dispose()}a.l1&&(a.l1=null)},EDb=function(a,b){try{a.j.hU(a,b),a.j.zr(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.cD,"/mail/images/cleardot.gif"); b8(b);GDb(b.toString(),5E3,(0,g.gb)(a.k6,a),3,2E3);a.zr(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.Bk=new Q8(a),a.Bk.Xu=a.oM,b=a.j,b=T8(b,b.sC()?a.kH:null,a.qM),P8(5),c8(b,"TYPE","xmlhttp"),wDb(a.Bk,b,!1,a.kH,!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.e4(1,0); a.lH=T8(a,null,a.sM);ODb(a)},QDb=function(a){a.Js&&(a.Js.abort(),a.Js=null); a.Ng&&(a.Ng.cancel(),a.Ng=null);a.xq&&(g.Ta.clearTimeout(a.xq),a.xq=null);V8(a);a.Rj&&(a.Rj.cancel(),a.Rj=null);a.qs&&(g.Ta.clearTimeout(a.qs),a.qs=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.f4++,b));2!=a.j&&3!=a.j||ODb(a)},SDb=function(a){var b=0; a.Ng&&b++;a.Rj&&b++;return b},ODb=function(a){a.Rj||a.qs||(a.qs=N8((0,g.gb)(a.lU,a),0),a.ey=0)},VDb=function(a,b){if(1==a.j){if(!b){a.uC=Math.floor(1E5*Math.random()); b=a.uC++;var c=new Q8(a,"",b);c.Xu=a.Ko;var d=TDb(a),e=a.lH.clone();g.Fp(e,"RID",b);g.Fp(e,"CVER","1");W8(a,e);vDb(c,e,d);a.Rj=c;a.j=2}}else 3==a.j&&(b?UDb(a,b):0==a.B.length||a.Rj||UDb(a))},UDb=function(a,b){if(b)if(6=a.bv?f:e.UE-d;try{g.Vc(h,function(l){return function(m,n){c.push("req"+l.UE+"_"+n+"="+encodeURIComponent(m))}}(e))}catch(l){c.push("req"+e.UE+"_type="+encodeURIComponent("_badmap"))}}a.C=a.C.concat(a.B.splice(0,b)); return c.join("&")},WDb=function(a){a.Ng||a.xq||(a.N=1,a.xq=N8((0,g.gb)(a.kU,a),0),a.Zx=0)},YDb=function(a){if(a.Ng||a.xq||3<=a.Zx)return!1; a.N++;a.xq=N8((0,g.gb)(a.kU,a),XDb(a,a.Zx));a.Zx++;return!0},U8=function(a,b,c){a.IL=null==a.K?c:!a.K; a.Lo=b.wq;a.Z||PDb(a)},V8=function(a){null!=a.ev&&(g.Ta.clearTimeout(a.ev),a.ev=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.Gi&&(c=null);var d=(0,g.gb)(a.uda,a);c||(c=new g.Lo("//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.Gi&&a.Gi.mU(b);$Db(a);QDb(a)},$Db=function(a){a.j=0; a.Lo=-1;if(a.Gi)if(0==a.C.length&&0==a.B.length)a.Gi.tM();else{var b=g.Lb(a.C),c=g.Lb(a.B);a.C.length=0;a.B.length=0;a.Gi.tM(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=zBb(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.tC&&g.Vc(a.tC,function(f,h){g.Fp(d,h,f)}); g.Fp(d,"VER",a.bv);W8(a,d);return d},aEb=function(){},bEb=function(){this.j=[]; this.B=[]},cEb=function(a){g.zb.call(this,"channelMessage"); this.message=a},dEb=function(a){g.zb.call(this,"channelError"); this.error=a},eEb=function(a,b){this.action=a; this.params=b||{}},Y8=function(a,b){g.I.call(this); this.j=new g.kv(this.rba,0,this);g.N(this,this.j);this.Pi=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},fEb=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.Ca=a;this.N=b;this.C=new g.Mv;this.B=new Y8(this.Hca,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.Ea=new GBb;this.Wa=new IBb;this.Za=new JBb},gEb=function(a){if(a.j){var b=a.ra(),c=a.j.Ko||{}; b?c["x-youtube-lounge-xsrf-token"]=b:delete c["x-youtube-lounge-xsrf-token"];a.j.Ko=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.qc();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,{})},hEb=function(a,b){g.Dd.call(this); var c=this;this.Cd=a();this.Cd.subscribe("handlerOpened",this.i4,this);this.Cd.subscribe("handlerClosed",this.onClosed,this);this.Cd.subscribe("handlerError",function(d,e){c.onError(e)}); this.Cd.subscribe("handlerMessage",this.onMessage,this);this.j=b},iEb=function(a,b,c){var d=this; c=void 0===c?function(){return""}:c; var e=void 0===e?new oDb:e;var f=void 0===f?new g.Mv:f;this.pathPrefix=a;this.j=b;this.Ca=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 rDb(h,h.j)).j.B))&&d.connect(d.Z,d.N)}); this.D={};this.B={};this.qa=!1;this.logger=null;this.ra=[];this.vg=void 0;this.Na=new ABb;this.Ga=new CBb;this.La=new EBb;this.Ea=new GBb},jEb=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:sDb(new rDb(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 eEb(c[0],c[1]));a.vg=b.statusCode;FBb(a.La,"WEB_CHANNEL")}); g.td(a.channel,"o",function(){401===a.vg||a.C.start();a.publish("webChannelError");HBb(a.Ea,"WEB_CHANNEL")})},kEb=function(a){var b=a.Ca(); b?a.D["x-youtube-lounge-xsrf-token"]=b:delete a.D["x-youtube-lounge-xsrf-token"]},lEb=function(a){g.Dd.call(this); this.j=a();this.j.subscribe("webChannelOpened",this.j4,this);this.j.subscribe("webChannelClosed",this.onClosed,this);this.j.subscribe("webChannelError",this.onError,this);this.j.subscribe("webChannelMessage",this.onMessage,this)},mEb=function(a,b,c,d,e){function f(){return new fEb($8(a,"/bc"),b,!1,c,d)} c=void 0===c?function(){return""}:c; return g.nB("enable_mdx_web_channel_desktop")?new lEb(function(){return new iEb($8(a,"/wc"),b,c)}):new hEb(f,e)},qEb=function(){var a=nEb; oEb();a9.push(a);pEb()},b9=function(a,b){oEb(); var c=rEb(a,String(b));0==a9.length?sEb(c):(pEb(),g.$b(a9,function(d){d(c)}))},c9=function(a){b9("CP",a)},oEb=function(){a9||(a9=g.Xa("yt.mdx.remote.debug.handlers_")||[],g.Va("yt.mdx.remote.debug.handlers_",a9))},sEb=function(a){var b=(d9+1)%50; d9=b;e9[b]=a;f9||(f9=49==b)},pEb=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}},rEb=function(a,b){var c=(Date.now()-tEb)/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.lF.call(this); this.K=a;this.screens=[]},uEb=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},vEb=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.jB(function(){UEb(a,b,c,d-1)},300)})},WEb=function(a){g.lB(a.Z); a.Z=0;g.lB(a.K);a.K=0;g.lB(a.qa);a.qa=0;g.lB(a.G);a.G=0;g.lB(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.q4,this);this.G=function(){}; this.N=this.K=0;this.ra=!1;this.Ca="unknown"},s9=function(a){var b; return!!(a.config_.enableDialLoungeToken&&(null==(b=a.C)?0:b.getDialAppInfo))},XEb=function(a){a.G=a.D.rU(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.jB(function(){$Eb(a,b,c,d-1)},300)})},t9=function(a,b){a.info("getDialAppInfoWithTimeout_ "+b); s9(a)&&(g.lB(a.N),a.N=0,0==b?cFb(a):a.N=g.jB(function(){cFb(a)},b))},cFb=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.Ca=c,t9(a,3E4)):(a.ra=!1,a.Ca="unknown",NEb(a,b.loungeToken),t9(a,b.loungeTokenRefreshIntervalMs))},function(b){a.info("getDialAppInfo error: "+b); a.Ca="noLoungeTokenResponse";t9(a,3E4)})},dFb=function(a){g.lB(a.K); a.K=0;g.lB(a.N);a.N=0;a.G();a.G=function(){}; g.lB(a.Y)},u9=function(a,b){n9.call(this,a,b,"ManualSession"); this.C=g.jB((0,g.gb)(this.mA,this,null),150)},v9=function(a,b){g.lF.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.Aaa,this)},eFb=function(a,b){return b?g.Db(a.C,function(c){return j8(b,c.label)},a):null},w9=function(a){b9("Controller",a)},nEb=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.h_,a,b)),b.subscribe("sessionFailed",function(){return fFb(a,b)}),b.j?a.publish("yt-remote-cast2-session-change",b.j):c&&a.j.mA(null)):a.publish("yt-remote-cast2-session-change",null))},fFb=function(a,b){a.j==b&&a.publish("yt-remote-cast2-session-failed")},gFb=function(a){var b=a.B.qU(),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=eFb(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},nFb=function(a,b,c,d){d.disableCastApi?z9("Cannot initialize because disabled by Mdx config."):hFb()?iFb(b,d)&&(jFb(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?kFb(a,c):(window.__onGCastApiAvailable=function(e,f){e?kFb(a,c):(A9("Failed to load cast API: "+f),lFb(!1),jFb(!1),g.jC("yt-remote-cast-available"),g.jC("yt-remote-cast-receiver"), mFb(),c(!1))},d.loadCastApiSetupScript?g.Qta("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<=jCb()&&sCb():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?nCb():89<=jCb()?uCb():(rCb(),s8(tCb.map(oCb))))):z9("Cannot initialize because not running Chrome")},mFb=function(){z9("dispose"); var a=B9();a&&a.dispose();g.Va("yt.mdx.remote.cloudview.instance_",null);oFb(!1);g.YD(pFb);pFb.length=0},C9=function(){return!!g.iC("yt-remote-cast-installed")},qFb=function(){var a=g.iC("yt-remote-cast-receiver"); return a?a.friendlyName:null},rFb=function(){z9("clearCurrentReceiver"); g.jC("yt-remote-cast-receiver")},sFb=function(){return C9()?B9()?B9().getCastSession():(A9("getCastSelector: Cast is not initialized."),null):(A9("getCastSelector: Cast API is not installed!"),null)},tFb=function(){C9()?B9()?D9()?(z9("Requesting cast selector."),B9().requestSession()):(z9("Wait for cast API to be ready to request the session."),pFb.push(g.XD("yt-remote-cast2-api-ready",tFb))):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.")},hFb=function(){var a=0<=g.qc().search(/ (CrMo|Chrome|CriOS)\//); return g.lK||a},uFb=function(a,b){B9().init(a,b)},iFb=function(a,b){var c=!1; B9()||(a=new v9(a,b),a.subscribe("yt-remote-cast2-availability-change",function(d){g.hC("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.hC("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.hC("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.jC("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_")},kFb=function(a,b){lFb(!0); jFb(!1);uFb(a,function(c){c?(oFb(!0),g.ZD("yt-remote-cast2-api-ready")):(A9("Failed to initialize cast API."),lFb(!1),g.jC("yt-remote-cast-available"),g.jC("yt-remote-cast-receiver"),mFb());b(c)})},z9=function(a){b9("cloudview",a)},A9=function(a){b9("cloudview",a)},lFb=function(a){z9("setCastInstalled_ "+a); g.hC("yt-remote-cast-installed",a)},D9=function(){return!!g.Xa("yt.mdx.remote.cloudview.apiReady_")},oFb=function(a){z9("setApiReady_ "+a); g.Va("yt.mdx.remote.cloudview.apiReady_",a)},jFb=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.Nk=this.yp=!1;this.Z=this.G=this.j=this.D=0;this.C=NaN;this.B=!1;this.reset(a)},vFb=function(a){a.audioTrackId=null; a.trackData=null;a.playerState=-1;a.yp=!1;a.Nk=!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&&vFb(a)},wFb=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.yp;b.hasNext=a.Nk;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.lF.call(this); var c=this;this.C=0;this.D=a;this.K=[];this.G=new bEb;this.B=this.j=null;this.Y=(0,g.gb)(this.m$,this);this.N=(0,g.gb)(this.hF,this);this.Z=(0,g.gb)(this.l$,this);this.qa=(0,g.gb)(this.o$,this);var d=0;a?(d=a.getProxyState(),3!=d&&(a.subscribe("proxyStateChange",this.oS,this),xFb(this))):d=3;0!=d&&(b?this.oS(d):g.jB(function(){c.oS(d)},0)); (a=sFb())&&K9(this,a);this.subscribe("yt-remote-cast2-session-change",this.qa)},M9=function(a){return new F9(a.D.getPlayerContextData())},xFb=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.yaa,b),this))},a)},yFb=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)},zFb=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){yFb(a); a.D.setPlayerContextData(wFb(b));xFb(a)},K9=function(a,b){a.B&&(a.B.removeUpdateListener(a.Y),a.B.removeMediaListener(a.N),a.hF(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.hF(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.ag("Failed to "+b+" with cast v2 channel. Error code: "+d.code); d.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.ag("Retrying "+b+" using MDx browser channel."),Q9(this,b,c))},a)},U9=function(a,b,c,d){d=void 0===d?!1:d; g.lF.call(this);var e=this;this.K=NaN;this.Ga=!1;this.Y=this.Z=this.ra=this.Ca=NaN;this.qa=[];this.G=this.N=this.D=this.j=this.B=null;this.Na=a;this.La=d;this.qa.push(g.ZB(window,"beforeunload",function(){e.pz(2)})); this.C=[];this.j=new F9;this.Ra=b.id;this.Ea=b.idType;this.B=mEb(this.Na,c,this.vU,"shortLived"==this.Ea,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.bE())?(1==f&&"shortLived"==e.Ea&&e.publish("browserChannelAuthError",f),S9("Channel error: "+f+" without reconnection"),e.dispose()):(e.Ga=!0,S9("Channel error: "+f+" with reconnection in "+e.bE()+" ms"),T9(e,2))}); this.B.listen("channelMessage",function(f){CFb(e,f)}); this.B.Nr(b.token);this.subscribe("remoteQueueChange",function(){var f=e.j.videoId;g.kC()&&g.hC("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.jB(function(){S9("Connecting timeout"); a.pz(1)},2E4)},FFb=function(a){g.lB(a.K); a.K=NaN},GFb=function(a){g.lB(a.Ca); a.Ca=NaN},IFb=function(a){HFb(a); a.ra=g.jB(function(){V9(a,"getNowPlaying")},2E4)},HFb=function(a){g.lB(a.ra); a.ra=NaN},BFb=function(a){S9("Channel opened"); a.Ga&&(a.Ga=!1,GFb(a),a.Ca=g.jB(function(){S9("Timing out waiting for a screen.");a.pz(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.Yz()&&isNaN(a.K);b==c?b&&(T9(a,1),V9(a,"getSubtitlesTrack")):b?(a.AX()&&a.j.reset(),T9(a,1),V9(a,"getNowPlaying"),JFb(a)):a.pz(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.fl(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.yp="true"==b.params.hasPrevious;a.j.Nk=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.zY("mlm");a.publish("multiStateLoopEnabled",b);break;case "loungeScreenDisconnected":g.Ib(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})||sBb(a.C,c); break;case "remoteDisconnected":c=new OBb(d8(b.params.device));g.Ib(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.lB(a.Y); a.Y=g.jB(function(){a.pz(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.Yg=a;this.j=[];this.j.push(this.Yg.$_s("screenChange",(0,g.gb)(this.u4,this)));this.j.push(this.Yg.$_s("onlineScreenChange",(0,g.gb)(this.daa,this)))},$Fb=function(a,b){gCb(); if(!p8||!p8.get("yt-remote-disable-remote-module-for-dev")){b=g.SA("MDX_CONFIG")||b;YBb();bCb();W9||(W9=new Z8(b?b.loungeApiHost:void 0),hCb()&&(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);nFb(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.XD("yt-remote-cast2-api-ready",function(){q8("yt-remote-api-ready")})),a$.push(g.XD("yt-remote-cast2-availability-change",function(){q8("yt-remote-receiver-availability-change")})),a$.push(g.XD("yt-remote-cast2-receiver-selected",function(){b$(null); q8("yt-remote-auto-connect","cast-selector-receiver")})),a$.push(g.XD("yt-remote-cast2-receiver-resumed",function(){q8("yt-remote-receiver-resumed","cast-selector-receiver")})),a$.push(g.XD("yt-remote-cast2-session-change",XFb)),a$.push(g.XD("yt-remote-connection-change",function(f){f?E9(Z9(),"YouTube TV"):c$()||(E9(null,null),rFb())})),a$.push(g.XD("yt-remote-cast2-session-failed",function(){q8("yt-remote-connection-failed")})),a=YFb(),b.isAuto&&(a.id+="#dial"),e=b.capabilities||[],g.nB("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.Ku++);this.B[a]=b}; g.k.forEach=function(a,b){for(var c=this.xn(),d=0;d=d.j.length)return g.r2;var f=d.j[b++];return g.Dt(a?f:d.B[f])}; return e}; var PBb={Fpa:"atp",D7a:"ska",M3a:"que",WVa:"mus",B7a:"sus",PGa:"dsp",C5a:"seq",tUa:"mic",rxa:"dpa",fra:"cds",KVa:"mlm",fxa:"dsdtr",wWa:"ntb",qjb:"vsp",fya:"scn",a4a:"rpe",cxa:"dcn",dxa:"dcp",o0a:"pas",exa:"drq",WZa:"opf",eya:"els",U5a:"svq",LVa:"mvp"},QBb={B5:"u",F2:"cl",f5:"k",X2:"i",I2:"cr",n5:"m",U2:"g",rV:"up"},aCb="",p8=null; iCb.prototype.flush=function(a,b){a=void 0===a?[]:a;b=void 0===b?!1:b;if(g.nB("enable_client_streamz_web")){a=g.u(a);for(var c=a.next();!c.done;c=a.next())c=g.cfa(c.value),c={serializedIncrementBatch:g.Gg(c.j())},g.BC("streamzIncremented",c,{sendIsolatedPayload:b})}}; var r8,qCb=kCb("loadCastFramework")||kCb("loadCastApplicationFramework"),tCb=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.lb(t8,g.I);g.k=t8.prototype;g.k.V3=function(a){this.D=arguments;this.j=!1;this.Yc?this.C=g.kb()+this.Pi:this.Yc=g.Bg(this.G,this.Pi)}; g.k.stop=function(){this.Yc&&(g.Ta.clearTimeout(this.Yc),this.Yc=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.Mf.va.call(this)}; g.k.W3=function(){this.Yc&&(g.Ta.clearTimeout(this.Yc),this.Yc=null);this.C?(this.Yc=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.kM=function(a){this.C=arguments;this.Yc||this.B?this.j=!0:vCb(this)}; g.k.stop=function(){this.Yc&&(g.Ta.clearTimeout(this.Yc),this.Yc=null,this.j=!1,this.C=null)}; g.k.pause=function(){this.B++}; g.k.resume=function(){this.B--;this.B||!this.j||this.Yc||(this.j=!1,vCb(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(wCb,g.zb);g.lb(xCb,g.zb);var yCb=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.eb=a}; g.k.Y3=function(a){a=a.target;var b=this.Wa;b&&3==g.Tn(a)?b.kM():this.XT(a)}; g.k.XT=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.Fd)){var a=2*this.Fd;this.Ga=y8((0,g.gb)(this.i$,this),a)}}; g.k.i$=function(){this.Ga&&(this.Ga=null,this.Va=!1,this.eb=!0,x8(10),F8(this),kDb(this))}; g.k.JQ=function(a){this.j==a&&this.Dc&&!this.eb&&(eDb(this),this.eb=!0,x8(11))}; g.k.Z3=function(){null!=this.qa&&(this.qa=null,F8(this),PCb(this),x8(19))}; g.k.vda=function(a){a?x8(2):x8(1)}; g.k.isActive=function(){return!!this.G&&this.G.isActive(this)}; g.k=nDb.prototype;g.k.fU=function(){}; g.k.eU=function(){}; g.k.dU=function(){}; g.k.cU=function(){}; g.k.isActive=function(){return!0}; g.k.a4=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.Pf++,a));3==b.Nh&&H8(b)}; M8.prototype.va=function(){this.j.G=null;delete this.C;this.j.disconnect();delete this.j;M8.Mf.va.call(this)}; g.lb(pDb,wCb);g.lb(qDb,xCb);g.lb(L8,nDb);L8.prototype.fU=function(){this.j.dispatchEvent("m")}; L8.prototype.eU=function(a){this.j.dispatchEvent(new pDb(a))}; L8.prototype.dU=function(a){this.j.dispatchEvent(new qDb(a))}; L8.prototype.cU=function(){this.j.dispatchEvent("n")};var O8=new g.Dd;g.y(tDb,g.zb);g.k=Q8.prototype;g.k.Xu=null;g.k.ls=!1;g.k.Yx=null;g.k.mM=null;g.k.rC=null;g.k.hH=null;g.k.oC=null;g.k.gH=null;g.k.Zu=null;g.k.cj=null;g.k.jH=0;g.k.l1=null;g.k.iH=null;g.k.Yu=null;g.k.qC=-1;g.k.m0=!0;g.k.pC=!1;g.k.lM=0;g.k.fH=null;var zDb={},yDb={};g.k=Q8.prototype;g.k.setTimeout=function(a){this.B=a}; g.k.d4=function(a){a=a.target;var b=this.fH;b&&3==g.Tn(a)?b.kM():this.gU(a)}; g.k.gU=function(a){try{if(a==this.cj)a:{var b=g.Tn(this.cj),c=this.cj.B,d=this.cj.getStatus();if(g.Nc&&!g.Mc("420+")){if(4>b)break a}else if(3>b||3==b&&!g.Vn(this.cj))break a;this.pC||4!=b||7==c||(8==c||0>=d?this.j.zr(3):this.j.zr(2));CDb(this);var e=this.cj.getStatus();this.qC=e;var f=g.Vn(this.cj);if(this.ls=200==e){4==b&&R8(this);if(this.Ea){for(a=!0;!this.pC&&this.jHa[2]&&this.IL&&0==this.Zx&&!this.ev&&(this.ev=N8((0,g.gb)(this.g4,this),6E3));else X8(this,11)}else null!=b&&X8(this,11);else if(this.Ng== a&&V8(this),!g.ec(b))for(a=this.G.parse(b),b=0;b=rGb.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(a=rGb[this.B],this.Yc=g.jB((0,g.gb)(this.C_,this),a),this.B++):this.publish("pairingFailed",Error("Server error "+a.status))}; g.k.n4=function(){this.j=null;this.publish("pairingFailed",Error("Server not responding"))}; var rGb=[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.iC("yt-remote-lounge-token-expiration")&&yEb(this);g.lB(this.j);this.j=g.jB((0,g.gb)(this.start,this),1E4)}; g.k.add=function(a,b){h9(this);uEb(this,a);j9(this,!1);this.publish("screenChange");b(a);a.token||yEb(this)}; g.k.remove=function(a,b){var c=h9(this);wEb(this,a)&&(j9(this,!1),c=!0);b(a);c&&this.publish("screenChange")}; g.k.HL=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.lB(this.j);i9.Mf.va.call(this)}; g.k.k8=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.Kk(),a);if(!a){w9("setConnectedScreenStatus: Unknown screen.");return}if("shortLived"==a.idType){w9("setConnectedScreenStatus: Screen with id type to be short lived.");return}c=eFb(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.ag("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.kS(b)}else w9("setConnectedScreenStatus: no screen.")}; g.k.Tca=function(a){this.Ma()?this.ag("Setting connection data on disposed cast v2"):this.j?this.j.mA(a):this.ag("Setting connection data without a session")}; g.k.s4=function(){this.Ma()?this.ag("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.f_,this),(0,g.gb)(this.Yaa,this))}; g.k.va=function(){this.B.unsubscribe("onlineScreenChange",(0,g.gb)(this.tU,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.G);var a=nEb,b=g.Xa("yt.mdx.remote.debug.handlers_");g.Hb(b||[],a);g.vb(this.j);g.lF.prototype.va.call(this)}; g.k.ag=function(a){b9("Controller",a)}; g.k.h_=function(a,b){this.j==a&&(b||y9(this,null),this.publish("yt-remote-cast2-session-change",b))}; g.k.Aaa=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.ag("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.j&&this.j.B.label==a.label?this.j.stop():this.ag("Stopping receiver w/o session: "+a.friendlyName)}else this.ag("onReceiverAction_ called without receiver.")}; g.k.v$=function(a){if(this.Ma())return Promise.reject(Error("disposed"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.ag("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.ag("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.ag('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=aFb(b,{name:b.B.friendlyName,screenId:a.screenId,loungeToken:a.loungeToken,dialId:b.Z.receiver.label, screenIdType:"shortLived"},a.loungeTokenRefreshIntervalMs):(g.VA(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(a)+".")),a=bFb(b,c)):a=bFb(b,c)):a=ZEb(b);return a}; g.k.f_=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.ag("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var d=this.j.B,e=l8(this.B.Kk(), 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.h_,this,this.j)),this.j.subscribe("sessionFailed",function(){return fFb(b,b.j)}),this.j.mA(null)); this.j.hS(a)}}}; g.k.r4=function(){return this.j?this.j.sU():null}; g.k.Yaa=function(a){this.Ma()||(this.ag("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.Daa=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.tU=function(){this.Ma()||(this.C=gFb(this),w9("Updating custom receivers: "+g.$m(this.C)),chrome.cast.setCustomReceivers(this.C,function(){},(0,g.gb)(function(){this.ag("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",x9(this)))}; v9.prototype.setLaunchParams=v9.prototype.Tca;v9.prototype.setConnectedScreenStatus=v9.prototype.Qca;v9.prototype.stopSession=v9.prototype.s4;v9.prototype.getCastSession=v9.prototype.r4;v9.prototype.requestSession=v9.prototype.requestSession;v9.prototype.init=v9.prototype.init;v9.prototype.dispose=v9.prototype.dispose;var pFb=[];g.k=F9.prototype; g.k.reset=function(a){this.listId="";this.index=-1;this.videoId="";vFb(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.yp=a.hasPrevious,this.Nk=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.isBuffering=function(){return 3==this.playerState}; g.k.Kn=function(){return 1081==this.playerState}; g.k.fl=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(wFb(this))};g.y(L9,g.lF);g.k=L9.prototype;g.k.getState=function(){return this.C}; g.k.jt=function(){return this.D.getReconnectTimeout()}; g.k.tx=function(){this.D.reconnect()}; g.k.play=function(){N9(this)?(this.j?this.j.play(null,g.Jd,R9(this,"play")):Q9(this,"play"),zFb(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"),zFb(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()||b.isBuffering()?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});zFb(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="";vFb(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.ag("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.ag("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.uU=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.uU,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.LK=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.LK,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.TH=function(){if(N9(this)){Q9(this,"clearPlaylist");var a=M9(this);a.reset();P9(this,a);this.publish("remotePlayerChange")}else O9(this,this.TH)}; g.k.OW=function(){N9(this)?Q9(this,"dismissAutoplay"):O9(this,this.OW)}; g.k.dispose=function(){if(3!=this.C){var a=this.C;this.C=3;this.publish("proxyStateChange",a,this.C)}g.lF.prototype.dispose.call(this)}; g.k.va=function(){yFb(this);this.D=null;this.G.clear();K9(this,null);g.lF.prototype.va.call(this)}; g.k.oS=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.yaa=function(a,b){this.publish(a,b)}; g.k.m$=function(a){if(!a)this.hF(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.hF=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.l$=function(a){a?(AFb(this),this.publish("remotePlayerChange")):this.hF(null)}; g.k.QS=function(){Q9(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.k.o$=function(){var a=sFb();a&&K9(this,a)}; g.k.ag=function(a){b9("CP",a)};g.y(U9,g.lF);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