(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.Fga(a.C,b,c)},pBb=function(a){if(a instanceof g.Ct)return a; if("function"==typeof a.Ul)return a.Ul(!1);if(g.ab(a)){var b=0,c=new g.Ct;c.next=function(){for(;;){if(b>=a.length)return g.s2;if(b in a)return g.Dt(a[b++]);b++}}; return c}throw Error("Not implemented");},qBb=function(a,b,c){if(g.ab(a))g.$b(a,b,c); else for(a=pBb(a);;){var d=a.next();if(d.done)break;b.call(c,d.value,void 0,a)}},rBb=function(a,b){var c=[]; qBb(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.vla(e)&&c.push(d)},a); return c},sBb=function(a,b){rBb(a,b).forEach(function(c){g.Qv.prototype.remove.call(this,c)},a)},tBb=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},uBb=function(a,b){g.Fb(a,b)||a.push(b)},vBb=function(a){var b=0,c; for(c in a)b++;return b},wBb=function(a,b){return g.fd(a,b)},xBb=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 xBb(a)},yBb=function(a){if(a.nm&&"function"==typeof a.nm)return a.nm(); 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 KCb;b=b.slice(d,d+c);a.N=d+c;return b},B8=function(a){a.rb=Date.now()+a.eb; NCb(a,a.eb)},NCb=function(a,b){if(null!=a.qa)throw Error("WatchDog timer not null"); a.qa=y8((0,g.gb)(a.b4,a),b)},OCb=function(a){a.qa&&(g.Ta.clearTimeout(a.qa),a.qa=null)},C8=function(a){a.C.Mg()||a.La||PCb(a.C,a)},D8=function(a){OCb(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()}},XCb=function(a,b){try{var c=a.C; if(0!=c.Ph&&(c.j==a||QCb(c.B,a)))if(!a.Va&&QCb(c.B,a)&&3==c.Ph){try{var d=c.Cf.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.e4,c),6E3));if(1>=SCb(c.B)&&c.Tc){try{c.Tc()}catch(w){}c.Tc=void 0}}else G8(c,11)}else if((a.Va||c.j==a)&&E8(c),!g.ec(b))for(e=c.Cf.j.parse(b),b=0;b=a.D:!1},SCb=function(a){return a.B?1:a.j?a.j.size:0},QCb=function(a,b){return a.B?a.B==b:a.j?a.j.has(b):!1},TCb= function(a,b){a.j?a.j.add(b):a.B=b},VCb=function(a,b){a.B&&a.B==b?a.B=null:a.j&&a.j.has(b)&&a.j.delete(b)},aDb=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)},bDb=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)},cDb=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){}},dDb=function(){this.j=new v8},eDb=function(a,b,c){var d=c||""; try{ABb(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.T8?c.T8[a]||b:b},fDb=function(a){this.C=[]; this.Qb=this.zd=this.Ma=this.Xb=this.j=this.Je=this.Ga=this.La=this.N=this.Hb=this.Y=null;this.Tf=this.Za=0;this.Rf=J8("failFast",!1,a);this.Va=this.qa=this.Z=this.K=this.G=null;this.vc=!0;this.Ud=this.Wa=-1;this.Jb=this.ra=this.Ca=0;this.ph=J8("baseRetryDelayMs",5E3,a);this.Uf=J8("retryDelaySeedMs",1E4,a);this.Sf=J8("forwardChannelMaxRetries",2,a);this.ke=J8("forwardChannelRequestTimeoutMs",2E4,a);this.Ae=a&&a.Eqb||void 0;this.eg=a&&a.wpb||void 0;this.Qe=a&&a.Bqb||!1;this.bb=void 0;this.Ra=a&&a.qda|| !1;this.D="";this.B=new ZCb(a&&a.ynb);this.Cf=new dDb;this.zb=a&&a.Pnb||!1;this.rb=a&&a.Enb||!1;this.zb&&this.rb&&(this.rb=!1);this.Vf=a&&a.onb||!1;a&&a.Rnb&&(this.vc=!1);this.Fc=!this.zb&&this.vc&&a&&a.Cnb||!1;this.jd=void 0;a&&a.hZ&&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.Ph||2==a.Ph||a.Ca>=(a.Rf?0:a.Sf))return!1;a.K=y8((0,g.gb)(a.aU,a,b),iDb(a,a.Ca));a.Ca++;return!0},lDb=function(a,b){var c; b?c=b.Xb:c=a.Za++;var d=a.Ma.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.Ma=a.Y);b&&(a.C=b.ra.concat(a.C));b=kDb(a,c,1E3);c.setTimeout(Math.round(.5*a.ke)+Math.round(.5*a.ke*Math.random()));TCb(a.B,c);HCb(c,d,b)},K8=function(a,b){a.La&&g.Vc(a.La,function(c,d){g.Fp(b,d,c)}); a.G&&ABb({},function(c,d){g.Fp(b,d,c)})},kDb=function(a,b,c){c=Math.min(a.C.length,c); var d=a.G?(0,g.gb)(a.G.f4,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{eDb(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},WCb=function(a){a.j||a.Z||(a.Jb=1,g.fg(a.ZT,a),a.ra=0)},RCb=function(a){if(a.j||a.Z||3<=a.ra)return!1; a.Jb++;a.Z=y8((0,g.gb)(a.ZT,a),iDb(a,a.ra));a.ra++;return!0},gDb=function(a){null!=a.Fa&&(g.Ta.clearTimeout(a.Fa),a.Fa=null)},mDb=function(a){a.j=new A8(a,a.D,"rpc",a.Jb); null===a.N&&(a.j.Ma=a.Y);a.j.bb=0;var b=a.zd.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.jd&&g.Fp(b,"TO",a.jd);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.Qb;c.Ra=1;c.Z=b8(b.clone());c.Y=null;c.Ga=!0;GCb(c,a)},E8=function(a){null!=a.qa&&(g.Ta.clearTimeout(a.qa),a.qa=null)},PCb=function(a,b){var c=null; if(a.j==b){E8(a);gDb(a);a.j=null;var d=2}else if(QCb(a.B,b))c=b.ra,VCb(a.B,b),d=1;else return;if(0!=a.Ph)if(b.K)if(1==d){c=b.Y?b.Y.length:0;b=Date.now()-b.Ca;var e=a.Ca;d=BCb();d.dispatchEvent(new ECb(d,c,b,e));H8(a)}else WCb(a);else{var f=b.Hb;e=b.getLastError();if(3==e||0==e&&0b.length)return ADb;b=b.slice(d,d+c);a.lH=d+c;return b},zDb=function(a){a.oM=Date.now()+a.B; DDb(a,a.B)},DDb=function(a,b){if(null!=a.Zx)throw Error("WatchDog timer not null"); a.Zx=N8((0,g.gb)(a.g4,a),b)},EDb=function(a){a.Zx&&(g.Ta.clearTimeout(a.Zx),a.Zx=null)},FDb=function(a){a.j.Mg()||a.qC||a.j.rM(a)},R8=function(a){EDb(a); g.vb(a.hH);a.hH=null;a.G.stop();a.C.removeAll();if(a.jj){var b=a.jj;a.jj=null;b.abort();b.dispose()}a.n1&&(a.n1=null)},GDb=function(a,b){try{a.j.gU(a,b),a.j.Br(4)}catch(c){}},IDb=function(a,b,c,d,e){if(0==d)c(!1); else{var f=e||0;d--;HDb(a,b,function(h){h?c(!0):g.Ta.setTimeout(function(){IDb(a,b,c,d,f)},f)})}},HDb=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},JDb=function(a){this.j=a; this.B=new v8},KDb=function(a){var b=T8(a.j,a.cD,"/mail/images/cleardot.gif"); b8(b);IDb(b.toString(),5E3,(0,g.gb)(a.o6,a),3,2E3);a.Br(1)},LDb=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.Fk=new Q8(a),a.Fk.Wu=a.qM,b=a.j,b=T8(b,b.tC()?a.mH:null,a.sM),P8(5),c8(b,"TYPE","xmlhttp"),yDb(a.Fk,b,!1,a.mH,!1))},MDb=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},NDb=function(a,b){this.j=a; this.map=b;this.context=null},ODb=function(a,b,c,d){g.zb.call(this,"timingevent",a); this.size=b;this.retries=d},PDb=function(a){g.zb.call(this,"serverreachability",a)},RDb=function(a){a.j4(1,0); a.nH=T8(a,null,a.uM);QDb(a)},SDb=function(a){a.Ks&&(a.Ks.abort(),a.Ks=null); a.Sg&&(a.Sg.cancel(),a.Sg=null);a.Aq&&(g.Ta.clearTimeout(a.Aq),a.Aq=null);V8(a);a.Wj&&(a.Wj.cancel(),a.Wj=null);a.us&&(g.Ta.clearTimeout(a.us),a.us=null)},TDb=function(a,b){if(0==a.j)throw Error("Invalid operation: sending map when state is closed"); a.B.push(new NDb(a.l4++,b));2!=a.j&&3!=a.j||QDb(a)},UDb=function(a){var b=0; a.Sg&&b++;a.Wj&&b++;return b},QDb=function(a){a.Wj||a.us||(a.us=N8((0,g.gb)(a.kU,a),0),a.gy=0)},XDb=function(a,b){if(1==a.j){if(!b){a.vC=Math.floor(1E5*Math.random()); b=a.vC++;var c=new Q8(a,"",b);c.Wu=a.Oo;var d=VDb(a),e=a.nH.clone();g.Fp(e,"RID",b);g.Fp(e,"CVER","1");W8(a,e);xDb(c,e,d);a.Wj=c;a.j=2}}else 3==a.j&&(b?WDb(a,b):0==a.B.length||a.Wj||WDb(a))},WDb=function(a,b){if(b)if(6=a.Zu?f:e.VE-d;try{g.Vc(h,function(l){return function(m,n){c.push("req"+l.VE+"_"+n+"="+encodeURIComponent(m))}}(e))}catch(l){c.push("req"+e.VE+"_type="+encodeURIComponent("_badmap"))}}a.C=a.C.concat(a.B.splice(0,b)); return c.join("&")},YDb=function(a){a.Sg||a.Aq||(a.N=1,a.Aq=N8((0,g.gb)(a.jU,a),0),a.ey=0)},$Db=function(a){if(a.Sg||a.Aq||3<=a.ey)return!1; a.N++;a.Aq=N8((0,g.gb)(a.jU,a),ZDb(a,a.ey));a.ey++;return!0},U8=function(a,b,c){a.KL=null==a.K?c:!a.K; a.Po=b.zq;a.Z||RDb(a)},V8=function(a){null!=a.bv&&(g.Ta.clearTimeout(a.bv),a.bv=null)},ZDb=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.Li&&(c=null);var d=(0,g.gb)(a.vda,a);c||(c=new g.Lo("//www.google.com/images/cleardot.gif"),b8(c));HDb(c.toString(),1E4,d)}else P8(2);aEb(a,b)},aEb=function(a,b){a.j=0; a.Li&&a.Li.lU(b);bEb(a);SDb(a)},bEb=function(a){a.j=0; a.Po=-1;if(a.Li)if(0==a.C.length&&0==a.B.length)a.Li.vM();else{var b=g.Lb(a.C),c=g.Lb(a.B);a.C.length=0;a.B.length=0;a.Li.vM(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=BBb(e.protocol,b?b+"."+e.hostname:e.hostname,+e.port,c)}a.uC&&g.Vc(a.uC,function(f,h){g.Fp(d,h,f)}); g.Fp(d,"VER",a.Zu);W8(a,d);return d},cEb=function(){},dEb=function(){this.j=[]; this.B=[]},eEb=function(a){g.zb.call(this,"channelMessage"); this.message=a},fEb=function(a){g.zb.call(this,"channelError"); this.error=a},gEb=function(a,b){this.action=a; this.params=b||{}},Y8=function(a,b){g.I.call(this); this.j=new g.kv(this.tba,0,this);g.N(this,this.j);this.Vi=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},hEb=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.Ica,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.Ma=new CBb;this.Fa=new EBb;this.La=new GBb;this.Ga=new IBb;this.Wa=new KBb;this.Za=new LBb},iEb=function(a){if(a.j){var b=a.ra(),c=a.j.Oo||{}; b?c["x-youtube-lounge-xsrf-token"]=b:delete c["x-youtube-lounge-xsrf-token"];a.j.Oo=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,{})},jEb=function(a,b){g.Dd.call(this); var c=this;this.Gd=a();this.Gd.subscribe("handlerOpened",this.n4,this);this.Gd.subscribe("handlerClosed",this.onClosed,this);this.Gd.subscribe("handlerError",function(d,e){c.onError(e)}); this.Gd.subscribe("handlerMessage",this.onMessage,this);this.j=b},kEb=function(a,b,c){var d=this; c=void 0===c?function(){return""}:c; var e=void 0===e?new qDb: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:SCb((new tDb(h,h.j)).j.B))&&d.connect(d.Z,d.N)}); this.D={};this.B={};this.qa=!1;this.logger=null;this.ra=[];this.Ag=void 0;this.Ma=new CBb;this.Fa=new EBb;this.La=new GBb;this.Ga=new IBb},lEb=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");DBb(a.Ma,"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:uDb(new tDb(b,b.j));c&&(a.ra=[].concat(g.qa(c)));FBb(a.Fa,"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 gEb(c[0],c[1]));a.Ag=b.statusCode;HBb(a.La,"WEB_CHANNEL")}); g.td(a.channel,"o",function(){401===a.Ag||a.C.start();a.publish("webChannelError");JBb(a.Ga,"WEB_CHANNEL")})},mEb=function(a){var b=a.Ca(); b?a.D["x-youtube-lounge-xsrf-token"]=b:delete a.D["x-youtube-lounge-xsrf-token"]},nEb=function(a){g.Dd.call(this); this.j=a();this.j.subscribe("webChannelOpened",this.o4,this);this.j.subscribe("webChannelClosed",this.onClosed,this);this.j.subscribe("webChannelError",this.onError,this);this.j.subscribe("webChannelMessage",this.onMessage,this)},oEb=function(a,b,c,d,e){function f(){return new hEb($8(a,"/bc"),b,!1,c,d)} c=void 0===c?function(){return""}:c; return g.kB("enable_mdx_web_channel_desktop")?new nEb(function(){return new kEb($8(a,"/wc"),b,c)}):new jEb(f,e)},sEb=function(){var a=pEb; qEb();a9.push(a);rEb()},b9=function(a,b){qEb(); var c=tEb(a,String(b));0==a9.length?uEb(c):(rEb(),g.$b(a9,function(d){d(c)}))},c9=function(a){b9("CP",a)},qEb=function(){a9||(a9=g.Xa("yt.mdx.remote.debug.handlers_")||[],g.Va("yt.mdx.remote.debug.handlers_",a9))},uEb=function(a){var b=(d9+1)%50; d9=b;e9[b]=a;f9||(f9=49==b)},rEb=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}},tEb=function(a,b){var c=(Date.now()-vEb)/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.iF.call(this); this.K=a;this.screens=[]},wEb=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},xEb=function(a,b){var c=a.screens.length!=b.length; a.screens=g.Ht(a.screens,function(f){return!!ZBb(b,f)}); for(var d=0,e=b.length;dd?c(e):a.K=g.gB(function(){WEb(a,b,c,d-1)},300)})},YEb=function(a){g.iB(a.Z); a.Z=0;g.iB(a.K);a.K=0;g.iB(a.qa);a.qa=0;g.iB(a.G);a.G=0;g.iB(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.Fa="";this.Ra=c;this.Ma=null;this.qa=function(){}; this.Y=NaN;this.La=(0,g.gb)(this.u4,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))},ZEb=function(a){a.G=a.D.qU(a.Fa,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.gB(function(){bFb(a,b,c,d-1)},300)})},t9=function(a,b){a.info("getDialAppInfoWithTimeout_ "+b); s9(a)&&(g.iB(a.N),a.N=0,0==b?eFb(a):a.N=g.gB(function(){eFb(a)},b))},eFb=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",PEb(a,b.loungeToken),t9(a,b.loungeTokenRefreshIntervalMs))},function(b){a.info("getDialAppInfo error: "+b); a.Ca="noLoungeTokenResponse";t9(a,3E4)})},fFb=function(a){g.iB(a.K); a.K=0;g.iB(a.N);a.N=0;a.G();a.G=function(){}; g.iB(a.Y)},u9=function(a,b){n9.call(this,a,b,"ManualSession"); this.C=g.gB((0,g.gb)(this.nA,this,null),150)},v9=function(a,b){g.iF.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.Baa,this)},gFb=function(a,b){return b?g.Db(a.C,function(c){return j8(b,c.label)},a):null},w9=function(a){b9("Controller",a)},pEb=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.j_,a,b)),b.subscribe("sessionFailed",function(){return hFb(a,b)}),b.j?a.publish("yt-remote-cast2-session-change",b.j):c&&a.j.nA(null)):a.publish("yt-remote-cast2-session-change",null))},hFb=function(a,b){a.j==b&&a.publish("yt-remote-cast2-session-failed")},iFb=function(a){var b=a.B.pU(),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=gFb(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},pFb=function(a,b,c,d){d.disableCastApi?z9("Cannot initialize because disabled by Mdx config."):jFb()?kFb(b,d)&&(lFb(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?mFb(a,c):(window.__onGCastApiAvailable=function(e,f){e?mFb(a,c):(A9("Failed to load cast API: "+f),nFb(!1),lFb(!1),g.gC("yt-remote-cast-available"),g.gC("yt-remote-cast-receiver"), oFb(),c(!1))},d.loadCastApiSetupScript?g.Zta("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<=lCb()&&uCb():!window.chrome||!window.navigator.presentation||0<=window.navigator.userAgent.indexOf("Edge")?pCb():89<=lCb()?wCb():(tCb(),s8(vCb.map(qCb))))):z9("Cannot initialize because not running Chrome")},oFb=function(){z9("dispose"); var a=B9();a&&a.dispose();g.Va("yt.mdx.remote.cloudview.instance_",null);qFb(!1);g.VD(rFb);rFb.length=0},C9=function(){return!!g.fC("yt-remote-cast-installed")},sFb=function(){var a=g.fC("yt-remote-cast-receiver"); return a?a.friendlyName:null},tFb=function(){z9("clearCurrentReceiver"); g.gC("yt-remote-cast-receiver")},uFb=function(){return C9()?B9()?B9().getCastSession():(A9("getCastSelector: Cast is not initialized."),null):(A9("getCastSelector: Cast API is not installed!"),null)},vFb=function(){C9()?B9()?D9()?(z9("Requesting cast selector."),B9().requestSession()):(z9("Wait for cast API to be ready to request the session."),rFb.push(g.UD("yt-remote-cast2-api-ready",vFb))):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.")},jFb=function(){var a=0<=g.qc().search(/ (CrMo|Chrome|CriOS)\//); return g.iK||a},wFb=function(a,b){B9().init(a,b)},kFb=function(a,b){var c=!1; B9()||(a=new v9(a,b),a.subscribe("yt-remote-cast2-availability-change",function(d){g.eC("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.eC("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.eC("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.gC("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_")},mFb=function(a,b){nFb(!0); lFb(!1);wFb(a,function(c){c?(qFb(!0),g.WD("yt-remote-cast2-api-ready")):(A9("Failed to initialize cast API."),nFb(!1),g.gC("yt-remote-cast-available"),g.gC("yt-remote-cast-receiver"),oFb());b(c)})},z9=function(a){b9("cloudview",a)},A9=function(a){b9("cloudview",a)},nFb=function(a){z9("setCastInstalled_ "+a); g.eC("yt-remote-cast-installed",a)},D9=function(){return!!g.Xa("yt.mdx.remote.cloudview.apiReady_")},qFb=function(a){z9("setApiReady_ "+a); g.Va("yt.mdx.remote.cloudview.apiReady_",a)},lFb=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.Rk=this.Cp=!1;this.Z=this.G=this.j=this.D=0;this.C=NaN;this.B=!1;this.reset(a)},xFb=function(a){a.audioTrackId=null; a.trackData=null;a.playerState=-1;a.Cp=!1;a.Rk=!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&&xFb(a)},yFb=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.Cp;b.hasNext=a.Rk;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.iF.call(this); var c=this;this.C=0;this.D=a;this.K=[];this.G=new dEb;this.B=this.j=null;this.Y=(0,g.gb)(this.n$,this);this.N=(0,g.gb)(this.iF,this);this.Z=(0,g.gb)(this.m$,this);this.qa=(0,g.gb)(this.p$,this);var d=0;a?(d=a.getProxyState(),3!=d&&(a.subscribe("proxyStateChange",this.pS,this),zFb(this))):d=3;0!=d&&(b?this.pS(d):g.gB(function(){c.pS(d)},0)); (a=uFb())&&K9(this,a);this.subscribe("yt-remote-cast2-session-change",this.qa)},M9=function(a){return new F9(a.D.getPlayerContextData())},zFb=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.zaa,b),this))},a)},AFb=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)},BFb=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){AFb(a); a.D.setPlayerContextData(yFb(b));zFb(a)},K9=function(a,b){a.B&&(a.B.removeUpdateListener(a.Y),a.B.removeMediaListener(a.N),a.iF(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.iF(a.B.media[0]))},CFb=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.iF.call(this);var e=this;this.K=NaN;this.Fa=!1;this.Y=this.Z=this.ra=this.Ca=NaN;this.qa=[];this.G=this.N=this.D=this.j=this.B=null;this.Ma=a;this.La=d;this.qa.push(g.WB(window,"beforeunload",function(){e.qz(2)})); this.C=[];this.j=new F9;this.Ra=b.id;this.Ga=b.idType;this.B=oEb(this.Ma,c,this.uU,"shortLived"==this.Ga,this.Ra);this.B.listen("channelOpened",function(){DFb(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.Ga&&e.publish("browserChannelAuthError",f),S9("Channel error: "+f+" without reconnection"),e.dispose()):(e.Fa=!0,S9("Channel error: "+f+" with reconnection in "+e.bE()+" ms"),T9(e,2))}); this.B.listen("channelMessage",function(f){EFb(e,f)}); this.B.Or(b.token);this.subscribe("remoteQueueChange",function(){var f=e.j.videoId;g.hC()&&g.eC("yt-remote-session-video-id",f)})},FFb=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)},GFb=function(a){a.K=g.gB(function(){S9("Connecting timeout"); a.qz(1)},2E4)},HFb=function(a){g.iB(a.K); a.K=NaN},IFb=function(a){g.iB(a.Ca); a.Ca=NaN},KFb=function(a){JFb(a); a.ra=g.gB(function(){V9(a,"getNowPlaying")},2E4)},JFb=function(a){g.iB(a.ra); a.ra=NaN},DFb=function(a){S9("Channel opened"); a.Fa&&(a.Fa=!1,IFb(a),a.Ca=g.gB(function(){S9("Timing out waiting for a screen.");a.qz(1)},15E3))},MFb=function(a,b){var c=null; if(b){var d=FFb(a);d&&(c={clientName:d.clientName,deviceMake:d.brand,deviceModel:d.model,osVersion:d.osVersion})}g.Va("yt.mdx.remote.remoteClient_",c);b&&(HFb(a),IFb(a));c=a.B.Zz()&&isNaN(a.K);b==c?b&&(T9(a,1),V9(a,"getSubtitlesTrack")):b?(a.AX()&&a.j.reset(),T9(a,1),V9(a,"getNowPlaying"),LFb(a)):a.qz(1)},NFb=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"))},OFb=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)},QFb=function(a,b){b.params=b.params||{}; OFb(a,b,"NOW_PLAYING_MAY_CHANGE");PFb(a,b);a.publish("autoplayDismissed")},PFb=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.vl(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?KFb(a):JFb(a);a.publish("remotePlayerChange")},RFb=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")}},SFb=function(a,b){var c="true"==b.params.muted; a.j.volume=parseInt(b.params.volume,10);a.j.muted=c;a.publish("remotePlayerChange")},TFb=function(a,b){a.N=b.params.videoId; a.publish("nowAutoplaying",parseInt(b.params.timeout,10))},UFb=function(a,b){a.N=b.params.videoId||null; a.publish("autoplayUpNext",a.N)},VFb=function(a,b){a.G=b.params.autoplayMode; a.publish("autoplayModeChange",a.G);"DISABLED"==a.G&&a.publish("autoplayDismissed")},WFb=function(a,b){var c="true"==b.params.hasNext; a.j.Cp="true"==b.params.hasPrevious;a.j.Rk=c;a.publish("previousNextChange")},EFb=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 QBb(d)}); b=!!g.Db(a.C,function(d){return"LOUNGE_SCREEN"==d.type}); MFb(a,b);b=a.AY("mlm");a.publish("multiStateLoopEnabled",b);break;case "loungeScreenDisconnected":g.Ib(a.C,function(d){return"LOUNGE_SCREEN"==d.type}); MFb(a,!1);break;case "remoteConnected":var c=new QBb(d8(b.params.device));g.Db(a.C,function(d){return c?d.id==c.id:!1})||uBb(a.C,c); break;case "remoteDisconnected":c=new QBb(d8(b.params.device));g.Ib(a.C,function(d){return c?d.id==c.id:!1}); break;case "gracefulDisconnect":break;case "playlistModified":OFb(a,b,"QUEUE_MODIFIED");break;case "nowPlaying":QFb(a,b);break;case "onStateChange":PFb(a,b);break;case "onAdStateChange":RFb(a,b);break;case "onVolumeChanged":SFb(a,b);break;case "onSubtitlesTrackChanged":NFb(a,b);break;case "nowAutoplaying":TFb(a,b);break;case "autoplayDismissed":a.publish("autoplayDismissed");break;case "autoplayUpNext":UFb(a,b);break;case "onAutoplayModeChanged":VFb(a,b);break;case "onHasPreviousNextChanged":WFb(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)}},LFb=function(a){g.iB(a.Y); a.Y=g.gB(function(){a.qz(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)},XFb=function(a){g9.call(this,"ScreenServiceProxy"); this.fh=a;this.j=[];this.j.push(this.fh.$_s("screenChange",(0,g.gb)(this.y4,this)));this.j.push(this.fh.$_s("onlineScreenChange",(0,g.gb)(this.eaa,this)))},bGb=function(a,b){iCb(); if(!p8||!p8.get("yt-remote-disable-remote-module-for-dev")){b=g.PA("MDX_CONFIG")||b;$Bb();dCb();W9||(W9=new Z8(b?b.loungeApiHost:void 0),jCb()&&(W9.j="/api/loungedev"));X9||(X9=g.Xa("yt.mdx.remote.deferredProxies_")||[],g.Va("yt.mdx.remote.deferredProxies_",X9));YFb();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);pFb(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.UD("yt-remote-cast2-api-ready",function(){q8("yt-remote-api-ready")})),a$.push(g.UD("yt-remote-cast2-availability-change",function(){q8("yt-remote-receiver-availability-change")})),a$.push(g.UD("yt-remote-cast2-receiver-selected",function(){b$(null); q8("yt-remote-auto-connect","cast-selector-receiver")})),a$.push(g.UD("yt-remote-cast2-receiver-resumed",function(){q8("yt-remote-receiver-resumed","cast-selector-receiver")})),a$.push(g.UD("yt-remote-cast2-session-change",ZFb)),a$.push(g.UD("yt-remote-connection-change",function(f){f?E9(Z9(),"YouTube TV"):c$()||(E9(null,null),tFb())})),a$.push(g.UD("yt-remote-cast2-session-failed",function(){q8("yt-remote-connection-failed")})),a=$Fb(),b.isAuto&&(a.id+="#dial"),e=b.capabilities||[],g.kB("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.Ju++);this.B[a]=b}; g.k.forEach=function(a,b){for(var c=this.Cn(),d=0;d=d.j.length)return g.s2;var f=d.j[b++];return g.Dt(a?f:d.B[f])}; return e}; var RBb={Hpa:"atp",F7a:"ska",O3a:"que",YVa:"mus",D7a:"sus",RGa:"dsp",E5a:"seq",vUa:"mic",sxa:"dpa",hra:"cds",MVa:"mlm",gxa:"dsdtr",yWa:"ntb",sjb:"vsp",gya:"scn",c4a:"rpe",dxa:"dcn",exa:"dcp",q0a:"pas",fxa:"drq",YZa:"opf",fya:"els",W5a:"svq",NVa:"mvp"},SBb={F5:"u",H2:"cl",k5:"k",d3:"i",K2:"cr",r5:"m",Y2:"g",pV:"up"},cCb="",p8=null; kCb.prototype.flush=function(a,b){a=void 0===a?[]:a;b=void 0===b?!1:b;if(g.kB("enable_client_streamz_web")){a=g.u(a);for(var c=a.next();!c.done;c=a.next())c=g.ifa(c.value),c={serializedIncrementBatch:g.Gg(c.j())},g.yC("streamzIncremented",c,{sendIsolatedPayload:b})}}; var r8,sCb=mCb("loadCastFramework")||mCb("loadCastApplicationFramework"),vCb=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.lb(t8,g.I);g.k=t8.prototype;g.k.Z3=function(a){this.D=arguments;this.j=!1;this.hd?this.C=g.kb()+this.Vi:this.hd=g.Bg(this.G,this.Vi)}; g.k.stop=function(){this.hd&&(g.Ta.clearTimeout(this.hd),this.hd=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.Qf.va.call(this)}; g.k.a4=function(){this.hd&&(g.Ta.clearTimeout(this.hd),this.hd=null);this.C?(this.hd=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.mM=function(a){this.C=arguments;this.hd||this.B?this.j=!0:xCb(this)}; g.k.stop=function(){this.hd&&(g.Ta.clearTimeout(this.hd),this.hd=null,this.j=!1,this.C=null)}; g.k.pause=function(){this.B++}; g.k.resume=function(){this.B--;this.B||!this.j||this.hd||(this.j=!1,xCb(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(yCb,g.zb);g.lb(zCb,g.zb);var ACb=null;g.lb(CCb,g.zb);g.lb(DCb,g.zb);g.lb(ECb,g.zb);z8.prototype.debug=function(){}; z8.prototype.info=function(){}; z8.prototype.warning=function(){};var LCb={},KCb={};g.k=A8.prototype;g.k.setTimeout=function(a){this.eb=a}; g.k.d4=function(a){a=a.target;var b=this.Wa;b&&3==g.Tn(a)?b.mM():this.VT(a)}; g.k.VT=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));OCb(this);var e=this.j.getStatus();this.Hb=e;b:if(JCb(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.Fa=y8((0,g.gb)(this.j$,this),a)}}; g.k.j$=function(){this.Fa&&(this.Fa=null,this.Va=!1,this.eb=!0,x8(10),F8(this),mDb(this))}; g.k.KQ=function(a){this.j==a&&this.Fc&&!this.eb&&(gDb(this),this.eb=!0,x8(11))}; g.k.e4=function(){null!=this.qa&&(this.qa=null,F8(this),RCb(this),x8(19))}; g.k.wda=function(a){a?x8(2):x8(1)}; g.k.isActive=function(){return!!this.G&&this.G.isActive(this)}; g.k=pDb.prototype;g.k.eU=function(){}; g.k.dU=function(){}; g.k.cU=function(){}; g.k.bU=function(){}; g.k.isActive=function(){return!0}; g.k.f4=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 YCb(b.Tf++,a));3==b.Ph&&H8(b)}; M8.prototype.va=function(){this.j.G=null;delete this.C;this.j.disconnect();delete this.j;M8.Qf.va.call(this)}; g.lb(rDb,yCb);g.lb(sDb,zCb);g.lb(L8,pDb);L8.prototype.eU=function(){this.j.dispatchEvent("m")}; L8.prototype.dU=function(a){this.j.dispatchEvent(new rDb(a))}; L8.prototype.cU=function(a){this.j.dispatchEvent(new sDb(a))}; L8.prototype.bU=function(){this.j.dispatchEvent("n")};var O8=new g.Dd;g.y(vDb,g.zb);g.k=Q8.prototype;g.k.Wu=null;g.k.qs=!1;g.k.Zx=null;g.k.oM=null;g.k.sC=null;g.k.jH=null;g.k.pC=null;g.k.iH=null;g.k.Yu=null;g.k.jj=null;g.k.lH=0;g.k.n1=null;g.k.kH=null;g.k.Xu=null;g.k.rC=-1;g.k.o0=!0;g.k.qC=!1;g.k.nM=0;g.k.hH=null;var BDb={},ADb={};g.k=Q8.prototype;g.k.setTimeout=function(a){this.B=a}; g.k.i4=function(a){a=a.target;var b=this.hH;b&&3==g.Tn(a)?b.mM():this.fU(a)}; g.k.fU=function(a){try{if(a==this.jj)a:{var b=g.Tn(this.jj),c=this.jj.B,d=this.jj.getStatus();if(g.Nc&&!g.Mc("420+")){if(4>b)break a}else if(3>b||3==b&&!g.Vn(this.jj))break a;this.qC||4!=b||7==c||(8==c||0>=d?this.j.Br(3):this.j.Br(2));EDb(this);var e=this.jj.getStatus();this.rC=e;var f=g.Vn(this.jj);if(this.qs=200==e){4==b&&R8(this);if(this.Ga){for(a=!0;!this.qC&&this.lHa[2]&&this.KL&&0==this.ey&&!this.bv&&(this.bv=N8((0,g.gb)(this.m4,this),6E3));else X8(this,11)}else null!=b&&X8(this,11);else if(this.Sg== a&&V8(this),!g.ec(b))for(a=this.G.parse(b),b=0;b=tGb.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(a=tGb[this.B],this.hd=g.gB((0,g.gb)(this.E_,this),a),this.B++):this.publish("pairingFailed",Error("Server error "+a.status))}; g.k.r4=function(){this.j=null;this.publish("pairingFailed",Error("Server not responding"))}; var tGb=[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.fC("yt-remote-lounge-token-expiration")&&AEb(this);g.iB(this.j);this.j=g.gB((0,g.gb)(this.start,this),1E4)}; g.k.add=function(a,b){h9(this);wEb(this,a);j9(this,!1);this.publish("screenChange");b(a);a.token||AEb(this)}; g.k.remove=function(a,b){var c=h9(this);yEb(this,a)&&(j9(this,!1),c=!0);b(a);c&&this.publish("screenChange")}; g.k.JL=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.iB(this.j);i9.Qf.va.call(this)}; g.k.l8=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.Ok(),a);if(!a){w9("setConnectedScreenStatus: Unknown screen.");return}if("shortLived"==a.idType){w9("setConnectedScreenStatus: Screen with id type to be short lived.");return}c=gFb(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.lS(b)}else w9("setConnectedScreenStatus: no screen.")}; g.k.Uca=function(a){this.Na()?this.dg("Setting connection data on disposed cast v2"):this.j?this.j.nA(a):this.dg("Setting connection data without a session")}; g.k.w4=function(){this.Na()?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.h_,this),(0,g.gb)(this.Zaa,this))}; g.k.va=function(){this.B.unsubscribe("onlineScreenChange",(0,g.gb)(this.sU,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.G);var a=pEb,b=g.Xa("yt.mdx.remote.debug.handlers_");g.Hb(b||[],a);g.vb(this.j);g.iF.prototype.va.call(this)}; g.k.dg=function(a){b9("Controller",a)}; g.k.j_=function(a,b){this.j==a&&(b||y9(this,null),this.publish("yt-remote-cast2-session-change",b))}; g.k.Baa=function(a,b){if(!this.Na())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.w$=function(a){if(this.Na())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=cFb(b,{name:b.B.friendlyName,screenId:a.screenId,loungeToken:a.loungeToken,dialId:b.Z.receiver.label, screenIdType:"shortLived"},a.loungeTokenRefreshIntervalMs):(g.SA(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(a)+".")),a=dFb(b,c)):a=dFb(b,c)):a=aFb(b);return a}; g.k.h_=function(a){var b=this;if(!this.Na()&&!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.Ok(), 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.j_,this,this.j)),this.j.subscribe("sessionFailed",function(){return hFb(b,b.j)}),this.j.nA(null)); this.j.iS(a)}}}; g.k.v4=function(){return this.j?this.j.rU():null}; g.k.Zaa=function(a){this.Na()||(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.Eaa=function(a){w9("Receiver availability updated: "+a);if(!this.Na()){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.sU=function(){this.Na()||(this.C=iFb(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.Uca;v9.prototype.setConnectedScreenStatus=v9.prototype.Rca;v9.prototype.stopSession=v9.prototype.w4;v9.prototype.getCastSession=v9.prototype.v4;v9.prototype.requestSession=v9.prototype.requestSession;v9.prototype.init=v9.prototype.init;v9.prototype.dispose=v9.prototype.dispose;var rFb=[];g.k=F9.prototype; g.k.reset=function(a){this.listId="";this.index=-1;this.videoId="";xFb(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.Cp=a.hasPrevious,this.Rk=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.vl=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(yFb(this))};g.y(L9,g.iF);g.k=L9.prototype;g.k.getState=function(){return this.C}; g.k.kt=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"),BFb(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"),BFb(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});BFb(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="";xFb(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.tU=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.tU,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.NK=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.NK,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.VH=function(){if(N9(this)){Q9(this,"clearPlaylist");var a=M9(this);a.reset();P9(this,a);this.publish("remotePlayerChange")}else O9(this,this.VH)}; g.k.MW=function(){N9(this)?Q9(this,"dismissAutoplay"):O9(this,this.MW)}; g.k.dispose=function(){if(3!=this.C){var a=this.C;this.C=3;this.publish("proxyStateChange",a,this.C)}g.iF.prototype.dispose.call(this)}; g.k.va=function(){AFb(this);this.D=null;this.G.clear();K9(this,null);g.iF.prototype.va.call(this)}; g.k.pS=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.zaa=function(a,b){this.publish(a,b)}; g.k.n$=function(a){if(!a)this.iF(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.iF=function(a){c9("Cast media: "+!!a);this.j&&this.j.removeUpdateListener(this.Z);if(this.j=a)this.j.addUpdateListener(this.Z),CFb(this),this.publish("remotePlayerChange")}; g.k.m$=function(a){a?(CFb(this),this.publish("remotePlayerChange")):this.iF(null)}; g.k.RS=function(){Q9(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.k.p$=function(){var a=uFb();a&&K9(this,a)}; g.k.dg=function(a){b9("CP",a)};g.y(U9,g.iF);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