(function(g){var window=this;'use strict';var w5p=function(a){if(a instanceof g.B9)return a;if(typeof a.lM=="function")return a.lM(!1);if(g.sG(a)){var x=0,y=new g.B9;y.next=function(){for(;;){if(x>=a.length)return g.Fw;if(x in a)return g.hG(a[x++]);x++}}; return y}throw Error("Not implemented");},Cb7=function(a,x,y){if(g.sG(a))g.qJ(a,x,y); else for(a=w5p(a);;){var D=a.next();if(D.done)break;x.call(y,D.value,void 0,a)}},IO=function(a){g.QM(a,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.At()).toString(36)); return a},eg=function(a,x,y){Array.isArray(y)||(y=[String(y)]); g.JX7(a.U,x,y)},q_y=function(a,x){var y=[]; Cb7(x,function(D){try{var M=g.sb.prototype.Rr.call(this,D,!0)}catch(N){if(N=="Storage: Invalid value was encountered")return;throw N;}M===void 0?y.push(D):g.mrq(M)&&y.push(D)},a); return y},dNh=function(a,x){q_y(a,x).forEach(function(y){g.sb.prototype.remove.call(this,y)},a)},Zrp=function(a){if(a.Af){if(a.Af.locationOverrideToken)return{locationOverrideToken:a.Af.locationOverrideToken}; if(a.Af.latitudeE7!=null&&a.Af.longitudeE7!=null)return{latitudeE7:a.Af.latitudeE7,longitudeE7:a.Af.longitudeE7}}return null},nXP=function(a,x){g.a4(a,x)||a.push(x)},vXn=function(a){var x=0,y; for(y in a)x++;return x},PbV=function(a,x){return g.WX(a,x)},TR7=function(a){try{return g.lF.JSON.parse(a)}catch(x){}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(x){}throw Error("Invalid JSON string: "+a);},ag=function(a){if(g.lF.JSON)try{return g.lF.JSON.parse(a)}catch(x){}return TR7(a)},lmV=function(){var a=xw(); this.T=a;a.Zg("/client_streamz/youtube/living_room/mdx/channel/opened",g.Gx("channel_type"))},kwG=function(){var a=xw(); this.T=a;a.Zg("/client_streamz/youtube/living_room/mdx/channel/closed",g.Gx("channel_type"))},u9V=function(){var a=xw(); this.T=a;a.Zg("/client_streamz/youtube/living_room/mdx/channel/message_received",g.Gx("channel_type"))},mNs=function(){var a=xw(); this.T=a;a.Zg("/client_streamz/youtube/living_room/mdx/channel/success")},WRF=function(){var a=xw(); this.T=a;a.Zg("/client_streamz/youtube/living_room/mdx/channel/error",g.Gx("channel_type"),g.Gx("error_type"))},EXh=function(){var a=xw(); this.T=a;a.Zg("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},snP=function(){var a=xw(); this.T=a;a.Zg("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},BRY=function(a,x,y,D){var M=new g.w8(null); a&&g.FZ(M,a);x&&g.Cz(M,x);y&&g.zu(M,y);D&&(M.B=D);return M},hoL=function(a,x){return new g.D2(a,x)},yI=function(a,x){return Object.prototype.hasOwnProperty.call(a,x)},$Nn=function(a,x){return a===x},DT=function(a,x){this.B={}; this.T=[];this.WL=this.size=0;var y=arguments.length;if(y>1){if(y%2)throw Error("Uneven number of arguments");for(var D=0;D5&&(a=a.slice(a.length-5)); var x=g.sk(xlh(),function(D){return D.loungeToken}),y=g.sk(a,function(D){return D.loungeToken}); g.Bc(y,function(D){return!g.a4(x,D)})&&yPn(); g.fI("yt-remote-local-screens",a,31536E3)},QI=function(a){a||(g.Re("yt-remote-session-screen-id"),g.Re("yt-remote-session-video-id")); eoD();a=Jy();g.Dk(a,GQ());p5G(a)},DlV=function(){if(!Sa){var a=g.R9(); a&&(Sa=new g.mv(a))}},MNY=function(){DlV(); return Sa?!!Sa.get("yt-remote-use-staging-server"):!1},Kx=function(a,x){g.x0[a]=!0; var y=g.eL();y&&y.publish.apply(y,arguments);g.x0[a]=!1},NvD=function(){},xw=function(){if(!Lx){Lx=new g.Ye(new NvD); var a=g.lj("client_streamz_web_flush_count",-1);a!==-1&&(Lx.J=a)}return Lx},F5t=function(){var a=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return a?parseInt(a[1],10):0},zSy=function(a){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+a)!=-1||document.currentScript.src.indexOf("&"+a)!=-1)},cPL=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},wO=function(a){a.length?oR7(a.shift(),function(){wO(a)}):JPh()},GuJ=function(a){return"chrome-extension://"+a+"/cast_sender.js"},oR7=function(a,x,y){var D=document.createElement("script"); D.onerror=x;y&&(D.onload=y);g.Yh(D,g.BY(a));(document.head||document.documentElement).appendChild(D)},Qdp=function(){var a=F5t(),x=[]; if(a>1){var y=a-1;x.push("//www.gstatic.com/eureka/clank/"+a+"/cast_sender.js");x.push("//www.gstatic.com/eureka/clank/"+y+"/cast_sender.js")}return x},JPh=function(){var a=cPL(); a&&a(!1,"No cast extension found")},K5V=function(){if(SsJ){var a=2,x=cPL(),y=function(){a--; a==0&&x&&x(!0)}; window.__onGCastApiAvailable=y;oR7("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",JPh,y)}},L5p=function(){K5V(); var a=Qdp();a.push("//www.gstatic.com/eureka/clank/cast_sender.js");wO(a)},CMF=function(){K5V(); var a=Qdp();a.push.apply(a,g.tS(wBF.map(GuJ)));a.push("//www.gstatic.com/eureka/clank/cast_sender.js");wO(a)},Cx=function(a,x,y){g.A.call(this); this.D=y!=null?(0,g.RP)(a,y):a;this.jR=x;this.N=(0,g.RP)(this.WV,this);this.T=!1;this.B=0;this.J=this.MG=null;this.U=[]},q4=function(){},qsV=function(){g.yz.call(this,"p")},dlJ=function(){g.yz.call(this,"o")},nR7=function(){return ZZs=ZZs||new g.wT},vRG=function(a){g.yz.call(this,"serverreachability",a)},dO=function(a){var x=nR7(); x.dispatchEvent(new vRG(x,a))},PMn=function(a){g.yz.call(this,"statevent",a)},ZT=function(a){var x=nR7(); x.dispatchEvent(new PMn(x,a))},TvF=function(a,x,y,D){g.yz.call(this,"timingevent",a); this.size=x;this.rtt=y;this.retries=D},nx=function(a,x){if(typeof a!=="function")throw Error("Fn must not be null and must be a function"); return g.lF.setTimeout(function(){a()},x)},vU=function(){},PU=function(a,x,y,D){this.J=a; this.U=x;this.vG=y;this.bO=D||1;this.S8=new g.wv(this);this.zt=45E3;this.N1=null;this.D=!1;this.BJ=this.YG=this.V=this.e8=this.tP=this.iY=this.cJ=null;this.dS=[];this.T=null;this.Y=0;this.N=this.OJ=null;this.Af=-1;this.yP=!1;this.EJ=0;this.Gt=null;this.O6=this.Cc=this.tf=this.UJ=!1;this.B=new l4n},l4n=function(){this.J=null; this.T="";this.B=!1},uZL=function(a,x,y){a.e8=1; a.V=IO(x.clone());a.BJ=y;a.UJ=!0;kuF(a,null)},kuF=function(a,x){a.tP=Date.now(); TQ(a);a.YG=a.V.clone();eg(a.YG,"t",a.bO);a.Y=0;var y=a.J.Cc;a.B=new l4n;a.T=mlY(a.J,y?x:null,!a.BJ);a.EJ>0&&(a.Gt=new g.yw((0,g.RP)(a.a8,a,a.T),a.EJ));a.S8.listen(a.T,"readystatechange",a.xC);x=a.N1?g.gQ(a.N1):{};a.BJ?(a.OJ||(a.OJ="POST"),x["Content-Type"]="application/x-www-form-urlencoded",a.T.send(a.YG,a.OJ,a.BJ,x)):(a.OJ="GET",a.T.send(a.YG,a.OJ,null,x));dO(1)},ERp=function(a){if(!W5D(a))return g.bT(a.T); var x=g.pB(a.T);if(x==="")return"";var y="",D=x.length,M=g.tD(a.T)==4;if(!a.B.J){if(typeof TextDecoder==="undefined")return lt(a),kw(a),"";a.B.J=new g.lF.TextDecoder}for(var N=0;Nx.length)return sdt;x=x.slice(D,D+y);a.Y=D+y;return x},TQ=function(a){a.iY=Date.now()+a.zt; $ln(a,a.zt)},$ln=function(a,x){if(a.cJ!=null)throw Error("WatchDog timer not null"); a.cJ=nx((0,g.RP)(a.Ok,a),x)},f4y=function(a){a.cJ&&(g.lF.clearTimeout(a.cJ),a.cJ=null)},kw=function(a){a.J.l0()||a.yP||gRL(a.J,a)},lt=function(a){f4y(a); g.wg(a.Gt);a.Gt=null;a.S8.removeAll();if(a.T){var x=a.T;a.T=null;x.abort();x.dispose()}},VNJ=function(a,x){try{var y=a.J; if(y.vO!=0&&(y.T==a||RSP(y.B,a)))if(!a.Cc&&RSP(y.B,a)&&y.vO==3){try{var D=y.Of.T.parse(x)}catch(v){D=null}if(Array.isArray(D)&&D.length==3){var M=D;if(M[0]==0)a:{if(!y.V){if(y.T)if(y.T.tP+3E30&&(y.EJ=1.5*J);D=y;var G=a.eg();if(G){var Q=g.I7(G,"X-Client-Wire-Protocol");if(Q){var S=D.B;!S.T&&(g.xh(Q,"spdy")||g.xh(Q,"quic")||g.xh(Q,"h2"))&&(S.U=S.N,S.T=new Set,S.B&&(UlP(S,S.B),S.B=null))}if(D.UJ){var K=g.I7(G,"X-HTTP-Session-Id");K&&(D.XJ=K,g.QM(D.N1,D.UJ,K))}}y.vO=3;y.N&&y.N.o8();y.Vn&&(y.AK=Date.now()-a.tP);D=y;var L=a;D.rF=HZh(D,D.Cc?D.vG:null,D.Fn); if(L.Cc){iZF(D.B,L);var w=L,Z=D.EJ;Z&&w.setTimeout(Z);w.cJ&&(f4y(w),TQ(w));D.T=L}else OZn(D);y.J.length>0&&Eo(y)}else N[0]!="stop"&&N[0]!="close"||WU(y,7);else y.vO==3&&(N[0]=="stop"||N[0]=="close"?N[0]=="stop"?WU(y,7):y.disconnect():N[0]!="noop"&&y.N&&y.N.yR(N),y.dS=0)}dO(4)}catch(v){}},rPh=function(a,x){this.T=a; this.map=x;this.context=null},tNn=function(a){this.N=a||10; g.lF.PerformanceNavigationTiming?(a=g.lF.performance.getEntriesByType("navigation"),a=a.length>0&&(a[0].nextHopProtocol=="hq"||a[0].nextHopProtocol=="h2")):a=!!(g.lF.chrome&&g.lF.chrome.loadTimes&&g.lF.chrome.loadTimes()&&g.lF.chrome.loadTimes().wasFetchedViaSpdy);this.U=a?this.N:1;this.T=null;this.U>1&&(this.T=new Set);this.B=null;this.J=[]},XBG=function(a){return a.B?!0:a.T?a.T.size>=a.U:!1},APy=function(a){return a.B?1:a.T?a.T.size:0},RSP=function(a,x){return a.B?a.B==x:a.T?a.T.has(x):!1},UlP= function(a,x){a.T?a.T.add(x):a.B=x},iZF=function(a,x){a.B&&a.B==x?a.B=null:a.T&&a.T.has(x)&&a.T.delete(x)},bZG=function(a){if(a.B!=null)return a.J.concat(a.B.dS); if(a.T!=null&&a.T.size!==0){var x=a.J;a=g.W(a.T.values());for(var y=a.next();!y.done;y=a.next())x=x.concat(y.value.dS);return x}return g.Fe(a.J)},pBF=function(a,x){var y=new vU; if(g.lF.Image){var D=new Image;D.onload=g.Yy(so,y,"TestLoadImage: loaded",!0,x,D);D.onerror=g.Yy(so,y,"TestLoadImage: error",!1,x,D);D.onabort=g.Yy(so,y,"TestLoadImage: abort",!1,x,D);D.ontimeout=g.Yy(so,y,"TestLoadImage: timeout",!1,x,D);g.lF.setTimeout(function(){if(D.ontimeout)D.ontimeout()},1E4); D.src=a}else x(!1)},I4p=function(a,x){var y=new vU,D=new AbortController,M=setTimeout(function(){D.abort(); so(y,"TestPingServer: timeout",!1,x)},1E4); fetch(a,{signal:D.signal}).then(function(N){clearTimeout(M);N.ok?so(y,"TestPingServer: ok",!0,x):so(y,"TestPingServer: server error",!1,x)}).catch(function(){clearTimeout(M); so(y,"TestPingServer: error",!1,x)})},so=function(a,x,y,D,M){try{M&&(M.onload=null,M.onerror=null,M.onabort=null,M.ontimeout=null),D(y)}catch(N){}},eSn=function(){this.T=new q4},$w=function(a,x,y){return y&&y.vG8?y.vG8[a]||x:x},a2y=function(a){this.J=[]; this.vG=this.rF=this.N1=this.Fn=this.T=this.XJ=this.UJ=this.yP=this.Y=this.tf=this.BJ=null;this.zZ=this.YG=0;this.FM=$w("failFast",!1,a);this.Gt=this.cJ=this.V=this.D=this.N=null;this.n1=!0;this.Fq=this.e8=-1;this.bO=this.dS=this.tP=0;this.zF=$w("baseRetryDelayMs",5E3,a);this.El=$w("retryDelaySeedMs",1E4,a);this.XM=$w("forwardChannelMaxRetries",2,a);this.kN=$w("forwardChannelRequestTimeoutMs",2E4,a);this.VS=a&&a.RS7||void 0;this.qh=a&&a.yOJ||void 0;this.aK=a&&a.oHJ||!1;this.EJ=void 0;this.Cc=a&&a.Tet|| !1;this.U="";this.B=new tNn(a&&a.K_G);this.Of=new eSn;this.S8=a&&a.CJP||!1;this.iY=a&&a.ao8||!1;this.S8&&this.iY&&(this.iY=!1);this.VA=a&&a.zDJ||!1;a&&a.pe8&&(this.n1=!1);this.Vn=!this.S8&&this.n1&&a&&a.d4R||!1;this.hK=void 0;a&&a.Gk&&a.Gk>0&&(this.hK=a.Gk);this.Af=void 0;this.AK=0;this.zt=!1;this.O6=this.OJ=null},mc=function(a){a.T&&(xEG(a),a.T.cancel(),a.T=null)},ygG=function(a){mc(a); a.V&&(g.lF.clearTimeout(a.V),a.V=null);ut(a);a.B.cancel();a.D&&(typeof a.D==="number"&&g.lF.clearTimeout(a.D),a.D=null)},Eo=function(a){XBG(a.B)||a.D||(a.D=!0,g.ke(a.hZ,a),a.tP=0)},DEF=function(a,x){if(APy(a.B)>=a.B.U-(a.D?1:0))return!1; if(a.D)return a.J=x.dS.concat(a.J),!0;if(a.vO==1||a.vO==2||a.tP>=(a.FM?0:a.XM))return!1;a.D=nx((0,g.RP)(a.hZ,a,x),j9P(a,a.tP));a.tP++;return!0},Nm7=function(a,x){var y; x?y=x.vG:y=a.YG++;var D=a.N1.clone();g.QM(D,"SID",a.U);g.QM(D,"RID",y);g.QM(D,"AID",a.e8);fx(a,D);a.Y&&a.BJ&&g.LZ(D,a.Y,a.BJ);y=new PU(a,a.U,y,a.tP+1);a.Y===null&&(y.N1=a.BJ);x&&(a.J=x.dS.concat(a.J));x=M0D(a,y,1E3);y.setTimeout(Math.round(a.kN*.5)+Math.round(a.kN*.5*Math.random()));UlP(a.B,y);uZL(y,D,x)},fx=function(a,x){a.yP&&g.hS(a.yP,function(y,D){g.QM(x,D,y)}); a.N&&g.hS({},function(y,D){g.QM(x,D,y)})},M0D=function(a,x,y){y=Math.min(a.J.length,y); var D=a.N?(0,g.RP)(a.N.NN,a.N,a):null;a:{for(var M=a.J,N=-1;;){var F=["count="+y];N==-1?y>0?(N=M[0].T,F.push("ofs="+N)):N=0:F.push("ofs="+N);for(var c=!0,J=0;J=3)return!1; a.bO++;a.V=nx((0,g.RP)(a.N_,a),j9P(a,a.dS));a.dS++;return!0},xEG=function(a){a.OJ!=null&&(g.lF.clearTimeout(a.OJ),a.OJ=null)},FvF=function(a){a.T=new PU(a,a.U,"rpc",a.bO); a.Y===null&&(a.T.N1=a.BJ);a.T.EJ=0;var x=a.rF.clone();g.QM(x,"RID","rpc");g.QM(x,"SID",a.U);g.QM(x,"AID",a.e8);g.QM(x,"CI",a.Gt?"0":"1");!a.Gt&&a.hK&&g.QM(x,"TO",a.hK);g.QM(x,"TYPE","xmlhttp");fx(a,x);a.Y&&a.BJ&&g.LZ(x,a.Y,a.BJ);a.EJ&&a.T.setTimeout(a.EJ);var y=a.T;a=a.vG;y.e8=1;y.V=IO(x.clone());y.BJ=null;y.UJ=!0;kuF(y,a)},ut=function(a){a.cJ!=null&&(g.lF.clearTimeout(a.cJ),a.cJ=null)},gRL=function(a,x){var y=null; if(a.T==x){ut(a);xEG(a);a.T=null;var D=2}else if(RSP(a.B,x))y=x.dS,iZF(a.B,x),D=1;else return;if(a.vO!=0)if(x.D)if(D==1){y=x.BJ?x.BJ.length:0;x=Date.now()-x.tP;var M=a.tP;D=nR7();D.dispatchEvent(new TvF(D,y,x,M));Eo(a)}else OZn(a);else{var N=x.Af;M=x.getLastError();if(M==3||M==0&&N>0||!(D==1&&DEF(a,x)||D==2&&Ysh(a)))switch(y&&y.length>0&&(x=a.B,x.J=x.J.concat(y)),M){case 1:WU(a,5);break;case 4:WU(a,10);break;case 3:WU(a,6);break;default:WU(a,2)}}},j9P=function(a,x){var y=a.zF+Math.floor(Math.random()* a.El); a.isActive()||(y*=2);return y*x},WU=function(a,x){if(x==2){var y=(0,g.RP)(a.n5P,a),D=a.qh,M=!D; D=new g.w8(D||"//www.google.com/images/cleardot.gif");g.lF.location&&g.lF.location.protocol=="http"||g.FZ(D,"https");IO(D);M?pBF(D.toString(),y):I4p(D.toString(),y)}else ZT(2);a.vO=0;a.N&&a.N.bd(x);z_7(a);ygG(a)},z_7=function(a){a.vO=0; a.O6=[];if(a.N){var x=bZG(a.B);if(x.length!=0||a.J.length!=0)g.zj(a.O6,x),g.zj(a.O6,a.J),a.B.J.length=0,g.Fe(a.J),a.J.length=0;a.N.Lk()}},cgh=function(a){if(a.vO==0)return a.O6; var x=[];g.zj(x,bZG(a.B));g.zj(x,a.J);return x},HZh=function(a,x,y){var D=g.g8(y); D.T!=""?(x&&g.Cz(D,x+"."+D.T),g.zu(D,D.J)):(D=g.lF.location,D=BRY(D.protocol,x?x+"."+D.hostname:D.hostname,+D.port,y));x=a.UJ;y=a.XJ;x&&y&&g.QM(D,x,y);g.QM(D,"VER",a.Oe);fx(a,D);return D},mlY=function(a,x,y){if(x&&!a.Cc)throw Error("Can't create secondary domain capable XhrIo object."); x=a.aK&&!a.VS?new g.OI(new g.jN({RU:y})):new g.OI(a.VS);x.Y=a.Cc;return x},o1n=function(){},JgG=function(){},Rg=function(a,x){g.wT.call(this); this.T=new a2y(x);this.N=a;this.B=x&&x.Dw8||null;a=x&&x.pGy||null;x&&x.HHt&&(a?a["X-Client-Protocol"]="webchannel":a={"X-Client-Protocol":"webchannel"});this.T.BJ=a;a=x&&x.Sr6||null;x&&x.EA&&(a?a["X-WebChannel-Content-Type"]=x.EA:a={"X-WebChannel-Content-Type":x.EA});x&&x.ox&&(a?a["X-WebChannel-Client-Profile"]=x.ox:a={"X-WebChannel-Client-Profile":x.ox});this.T.tf=a;(a=x&&x.KER)&&!g.af(a)&&(this.T.Y=a);this.D=x&&x.Tet||!1;this.U=x&&x.KSy||!1;(x=x&&x.D1c)&&!g.af(x)&&(this.T.UJ=x,g.mh(this.B,x)&&(a= this.B,x in a&&delete a[x]));this.J=new gO(this)},GtY=function(a){qsV.call(this); a.__headers__&&(this.headers=a.__headers__,this.statusCode=a.__status__,delete a.__headers__,delete a.__status__);var x=a.__sm__;x?this.data=(this.T=g.Tj(x))?g.BX(x,this.T):x:this.data=a},Q9L=function(a){dlJ.call(this); this.status=1;this.errorCode=a},gO=function(a){this.T=a},SbD=function(a,x){this.B=a; this.T=x},KvF=function(a){return cgh(a.T).map(function(x){var y=a.B; x=x.map;"__data__"in x?(x=x.__data__,y=y.U?TR7(x):x):y=x;return y})},Yw=function(a,x){if(typeof a!=="function")throw Error("Fn must not be null and must be a function"); return g.lF.setTimeout(function(){a()},x)},Uo=function(a){Ay.dispatchEvent(new Lvh(Ay,a))},Lvh=function(a){g.yz.call(this,"statevent",a)},HU=function(a,x,y,D){this.T=a; this.U=x;this.Y=y;this.D=D||1;this.B=45E3;this.J=new g.wv(this);this.N=new g.fB;this.N.setInterval(250)},ClD=function(a,x,y){a.tN=1; a.n9=IO(x.clone());a.RX=y;a.UJ=!0;wID(a,null)},qbP=function(a,x,y,D,M){a.tN=1; a.n9=IO(x.clone());a.RX=null;a.UJ=y;M&&(a.Hj=!1);wID(a,D)},wID=function(a,x){a.f9=Date.now(); dEy(a);a.mz=a.n9.clone();eg(a.mz,"t",a.D);a.fW=0;a.au=a.T.fg(a.T.Jm()?x:null);a.t9>0&&(a.nW=new g.yw((0,g.RP)(a.Ck,a,a.au),a.t9));a.J.listen(a.au,"readystatechange",a.LF);x=a.e0?g.gQ(a.e0):{};a.RX?(a.Q_="POST",x["Content-Type"]="application/x-www-form-urlencoded",a.au.send(a.mz,a.Q_,a.RX,x)):(a.Q_="GET",a.Hj&&!g.lH&&(x.Connection="close"),a.au.send(a.mz,a.Q_,null,x));a.T.v8(1)},v1p=function(a,x){var y=a.fW,D=x.indexOf("\n",y); if(D==-1)return ZGJ;y=Number(x.substring(y,D));if(isNaN(y))return n1J;D+=1;if(D+y>x.length)return ZGJ;x=x.slice(D,D+y);a.fW=D+y;return x},dEy=function(a){a.Q0=Date.now()+a.B; PlL(a,a.B)},PlL=function(a,x){if(a.xO!=null)throw Error("WatchDog timer not null"); a.xO=Yw((0,g.RP)(a.hB,a),x)},Tms=function(a){a.xO&&(g.lF.clearTimeout(a.xO),a.xO=null)},l2n=function(a){a.T.l0()||a.mH||a.T.sQ(a)},Oo=function(a){Tms(a); g.wg(a.nW);a.nW=null;a.N.stop();a.J.removeAll();if(a.au){var x=a.au;a.au=null;x.abort();x.dispose()}a.HK&&(a.HK=null)},ktV=function(a,x){try{a.T.kh(a,x),a.T.v8(4)}catch(y){}},mEG=function(a,x,y,D,M){if(D==0)y(!1); else{var N=M||0;D--;uRs(a,x,function(F){F?y(!0):g.lF.setTimeout(function(){mEG(a,x,y,D,N)},N)})}},uRs=function(a,x,y){var D=new Image; D.onload=function(){try{VI(D),y(!0)}catch(M){}}; D.onerror=function(){try{VI(D),y(!1)}catch(M){}}; D.onabort=function(){try{VI(D),y(!1)}catch(M){}}; D.ontimeout=function(){try{VI(D),y(!1)}catch(M){}}; g.lF.setTimeout(function(){if(D.ontimeout)D.ontimeout()},x); D.src=a},VI=function(a){a.onload=null; a.onerror=null;a.onabort=null;a.ontimeout=null},Wvs=function(a){this.T=a; this.B=new q4},E1n=function(a){var x=rO(a.T,a.A8,"/mail/images/cleardot.gif"); IO(x);mEG(x.toString(),5E3,(0,g.RP)(a.X8,a),3,2E3);a.v8(1)},s9P=function(a){var x=a.T.D; x!=null?(Uo(5),x?(Uo(11),ty(a.T,a,!1)):(Uo(12),ty(a.T,a,!0))):(a.qy=new HU(a),a.qy.e0=a.J9,x=a.T,x=rO(x,x.Jm()?a.JN:null,a.IJ),Uo(5),eg(x,"TYPE","xmlhttp"),qbP(a.qy,x,!1,a.JN,!1))},Bmn=function(a,x,y){this.T=1; this.B=[];this.J=[];this.N=new q4;this.BJ=a||null;this.D=x!=null?x:null;this.V=y||!1},h_F=function(a,x){this.T=a; this.map=x;this.context=null},$E7=function(a,x,y,D){g.yz.call(this,"timingevent",a); this.size=x;this.rtt=y;this.retries=D},f2n=function(a){g.yz.call(this,"serverreachability",a)},R_h=function(a){a.bZ(1,0); a.IN=rO(a,null,a.WR);g1D(a)},Yby=function(a){a.dG&&(a.dG.abort(),a.dG=null); a.g1&&(a.g1.cancel(),a.g1=null);a.Zs&&(g.lF.clearTimeout(a.Zs),a.Zs=null);XN(a);a.a9&&(a.a9.cancel(),a.a9=null);a.Do&&(g.lF.clearTimeout(a.Do),a.Do=null)},AgP=function(a,x){if(a.T==0)throw Error("Invalid operation: sending map when state is closed"); a.B.push(new h_F(a.yh++,x));a.T!=2&&a.T!=3||g1D(a)},UEG=function(a){var x=0; a.g1&&x++;a.a9&&x++;return x},g1D=function(a){a.a9||a.Do||(a.Do=Yw((0,g.RP)(a.Yh,a),0),a.Np=0)},OGF=function(a,x){if(a.T==1){if(!x){a.Uv=Math.floor(Math.random()*1E5); x=a.Uv++;var y=new HU(a,"",x);y.e0=a.Dg;var D=HG7(a),M=a.IN.clone();g.QM(M,"RID",x);g.QM(M,"CVER","1");bt(a,M);ClD(y,M,D);a.a9=y;a.T=2}}else a.T==3&&(x?iGn(a,x):a.B.length==0||a.a9||iGn(a))},iGn=function(a,x){if(x)if(a.Co>6){a.B=a.J.concat(a.B); a.J.length=0;var y=a.Uv-1;x=HG7(a)}else y=x.Y,x=x.RX;else y=a.Uv++,x=HG7(a);var D=a.IN.clone();g.QM(D,"SID",a.U);g.QM(D,"RID",y);g.QM(D,"AID",a.hg);bt(a,D);y=new HU(a,a.U,y,a.Np+1);y.e0=a.Dg;y.setTimeout(1E4+Math.round(1E4*Math.random()));a.a9=y;ClD(y,D,x)},bt=function(a,x){a.FJ&&(a=a.FJ.ud())&&g.hS(a,function(y,D){g.QM(x,D,y)})},HG7=function(a){var x=Math.min(a.B.length,1E3),y=["count="+x]; if(a.Co>6&&x>0){var D=a.B[0].T;y.push("ofs="+D)}else D=0;for(var M={},N=0;N=3)return!1; a.Y++;a.Zs=Yw((0,g.RP)(a.GG,a),rgV(a,a.w2));a.w2++;return!0},ty=function(a,x,y){a.hn=a.D==null?y:!a.D; a.nR=x.Mq;a.V||R_h(a)},XN=function(a){a.kH!=null&&(g.lF.clearTimeout(a.kH),a.kH=null)},rgV=function(a,x){var y=5E3+Math.floor(Math.random()*1E4); a.isActive()||(y*=2);return y*x},px=function(a,x){if(x==2||x==9){var y=null; a.FJ&&(y=null);var D=(0,g.RP)(a.PVJ,a);y||(y=new g.w8("//www.google.com/images/cleardot.gif"),IO(y));uRs(y.toString(),1E4,D)}else Uo(2);XIJ(a,x)},XIJ=function(a,x){a.T=0; a.FJ&&a.FJ.M_(x);bGP(a);Yby(a)},bGP=function(a){a.T=0; a.nR=-1;if(a.FJ)if(a.J.length==0&&a.B.length==0)a.FJ.aJ();else{var x=g.Fe(a.J),y=g.Fe(a.B);a.J.length=0;a.B.length=0;a.FJ.aJ(x,y)}},rO=function(a,x,y){var D=g.g8(y); if(D.T!="")x&&g.Cz(D,x+"."+D.T),g.zu(D,D.J);else{var M=window.location;D=BRY(M.protocol,x?x+"."+M.hostname:M.hostname,+M.port,y)}a.Iq&&g.hS(a.Iq,function(N,F){g.QM(D,F,N)}); g.QM(D,"VER",a.Co);bt(a,D);return D},pIy=function(){},I2J=function(){this.T=[]; this.B=[]},e_G=function(a){g.yz.call(this,"channelMessage"); this.message=a},a9s=function(a){g.yz.call(this,"channelError"); this.error=a},xzs=function(a,x){this.action=a; this.params=x||{}},Ig=function(a,x){g.A.call(this); this.T=new g.Id(this.VYY,0,this);g.U(this,this.T);this.jR=5E3;this.aZ=0;if(typeof a==="function")x&&(a=(0,g.RP)(a,x));else if(a&&typeof a.handleEvent==="function")a=(0,g.RP)(a.handleEvent,a);else throw Error("Invalid listener argument");this.B=a},yks=function(a,x,y,D,M,N,F,c,J,G,Q,S,K,L,w){var Z=this; y=y===void 0?!1:y;D=D===void 0?function(){return""}:D; M=M===void 0?!1:M;N=N===void 0?!1:N;F=F===void 0?!1:F;c=c===void 0?function(){return g.EI({})}:c; J=J===void 0?!1:J;Q=Q===void 0?!1:Q;S=S===void 0?!1:S;K=K===void 0?!1:K;L=L===void 0?!1:L;this.Cc=a;this.dS=x;this.Y=new g.ul;this.B=(this.D=!!w)?w(function(){Z.WY()}):new Ig(this.WY,this); this.T=null;this.V=!1;this.cJ=null;this.OJ="";this.tP=this.BJ=0;this.J=[];this.bO=y;this.yP=D;this.N=N;this.e8=c;this.N1=G;this.vG=F;this.UJ=null;this.U=g.EI();this.Fn=M;this.O6=J;this.Af=Q;this.S8=S;this.n1=K;this.tf=L;this.zt=new lmV;this.Gt=new kwG;this.iY=new mNs;this.EJ=new u9V;this.YG=new WRF;this.Vn=new EXh;this.AK=new snP},MYh=function(a,x,y,D,M){jBt(a); if(a.T){var N=g.am("ID_TOKEN"),F=a.T.Dg||{};N?F["x-youtube-identity-token"]=N:delete F["x-youtube-identity-token"];a.T.Dg=F}DzD(a);D?(D.getState()!=3&&UEG(D)==0||D.getState(),a.T.connect(x,y,a.dS,D.U,D.hg)):M?a.T.connect(x,y,a.dS,M.sessionId,M.arrayId):a.T.connect(x,y,a.dS);a.D&&!a.B.isActive()&&a.B.start()},ckn=function(a,x){return a.n1?!0:a.S8?Object.values(NKF).includes(x):a.Af?!Object.values(FO7).includes(x):a.tf?Object.values(zYt).includes(x):!1},Gmn=function(a){var x,y; g.R(function(D){if(D.T==1)return g.Jt(D,2),g.B(D,oHJ(a),2);g.SV(D);x=a.J;a.J=[];y=x.length;JkP(a,x,y);ea(a);return g.K7(D,0)})},JkP=function(a,x,y){for(var D=0;D0?y=Object.assign({},y,x):delete y.Authorization;a.T.Dg=y}},DzD=function(a){a.N1&&!a.N&&S6V(a,a.N1())},aj=function(a){this.scheme="https"; this.port=this.domain="";this.T="/api/lounge";this.B=!0;a=a||document.location.href;var x=Number(g.Pw(a)[4]||null)||"";x&&(this.port=":"+x);this.domain=g.T_(a)||"";a=g.NG();a.search("MSIE")>=0&&(a=a.match(/MSIE ([\d.]+)/)[1],g.MG(a,"10.0")<0&&(this.B=!1))},xa=function(a,x){var y=a.T; a.B&&(y=a.scheme+"://"+a.domain+a.port+a.T);return g.sS(y+x,{})},KOJ=function(a,x){g.wT.call(this); var y=this;this.handler=a();this.handler.subscribe("handlerOpened",this.o2,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(D,M){y.onError(M)}); this.handler.subscribe("handlerMessage",this.onMessage,this);this.T=x},LOV=function(a,x,y){var D=this; y=y===void 0?function(){return""}:y; var M=M===void 0?new JgG:M;var N=N===void 0?new g.ul:N;this.pathPrefix=a;this.T=x;this.tP=y;this.N=N;this.V=null;this.BJ=this.Y=0;this.channel=null;this.D=0;this.J=new Ig(function(){D.J.isActive();var F;((F=D.channel)==null?void 0:APy((new SbD(F,F.T)).T.B))===0&&D.connect(D.V,D.Y)}); this.U={};this.B={};this.cJ=!1;this.logger=null;this.dS=[];this.yQ=void 0;this.N1=new lmV;this.OJ=new kwG;this.yP=new u9V;this.UJ=new WRF},wYJ=function(a){g.o7(a.channel,"m",function(){a.D=3; a.J.reset();a.V=null;a.Y=0;for(var x=g.W(a.dS),y=x.next();!y.done;y=x.next())y=y.value,a.channel&&a.channel.send(y);a.dS=[];a.publish("webChannelOpened");a.N1.Nh("WEB_CHANNEL")}); g.o7(a.channel,"n",function(){a.D=0;a.J.isActive()||a.publish("webChannelClosed");var x,y=(x=a.channel)==null?void 0:KvF(new SbD(x,x.T));y&&(a.dS=[].concat(g.tS(y)));a.OJ.Nh("WEB_CHANNEL")}); g.o7(a.channel,"p",function(x){var y=x.data;y[0]==="gracefulReconnect"?(a.J.start(),a.channel&&a.channel.close()):a.publish("webChannelMessage",new xzs(y[0],y[1]));a.yQ=x.statusCode;a.yP.Nh("WEB_CHANNEL")}); g.o7(a.channel,"o",function(){a.yQ===401||a.J.start();a.publish("webChannelError");a.UJ.Nh("WEB_CHANNEL","")})},Cot=function(a){var x=a.tP(); x?a.U["x-youtube-lounge-xsrf-token"]=x:delete a.U["x-youtube-lounge-xsrf-token"]},q6F=function(a){g.wT.call(this); this.T=a();this.T.subscribe("webChannelOpened",this.R2,this);this.T.subscribe("webChannelClosed",this.onClosed,this);this.T.subscribe("webChannelError",this.onError,this);this.T.subscribe("webChannelMessage",this.onMessage,this)},dzt=function(a,x,y,D,M){function N(){return new yks(xa(a,"/bc"),x,!1,y,D)} y=y===void 0?function(){return""}:y; return g.Te("enable_mdx_web_channel_desktop")?new q6F(function(){return new LOV(xa(a,"/wc"),x,y)}):new KOJ(N,M)},Poh=function(){var a=Zp7; nHF();yK.push(a);vHL()},jC=function(a,x){nHF(); var y=TKG(a,String(x));yK.length==0?l9Y(y):(vHL(),g.qJ(yK,function(D){D(y)}))},Dx=function(a){jC("CP",a)},nHF=function(){yK||(yK=g.uF("yt.mdx.remote.debug.handlers_")||[],g.ky("yt.mdx.remote.debug.handlers_",yK))},l9Y=function(a){var x=(MH+1)%50; MH=x;NH[x]=a;FK||(FK=x==49)},vHL=function(){var a=yK; if(NH[0]){var x=FK?MH:-1,y={};do y={yK:void 0},x=(x+1)%50,y.yK=NH[x],g.qJ(a,function(D){return function(M){M(D.yK)}}(y)); while(x!=MH);NH=Array(50);MH=-1;FK=!1}},TKG=function(a,x){var y=(Date.now()-kmn)/1E3; y.toFixed&&(y=y.toFixed(3));var D=[];D.push("[",y+"s","] ");D.push("[","yt.mdx.remote","] ");D.push(a+": "+x,"\n");return D.join("")},z8=function(a){g.Mf.call(this); this.D=a;this.screens=[]},uXL=function(a,x){var y=a.get(x.uuid)||a.get(x.id); if(y)return a=y.name,y.id=x.id||y.id,y.name=x.name,y.token=x.token,y.uuid=x.uuid||y.uuid,y.name!=a;a.screens.push(x);return!0},mzL=function(a,x){var y=a.screens.length!=x.length; a.screens=g.RH(a.screens,function(N){return!!tJp(x,N)}); for(var D=x.length,M=0;M0&&a.U0&&Zx(a,y)},function(x){a.N=function(){}; a.Zk(x)})},MMs=function(a){var x={}; x.pairingCode=a.OJ;x.theme=a.e8;MNY()&&(x.env_useStageMdx=1);return g.ES(x)},NxF=function(a){return new Promise(function(x){a.OJ=VJY(); if(a.N1){var y=new chrome.cast.DialLaunchResponse(!0,MMs(a));x(y);D9G(a)}else a.cJ=function(){g.n6(a.BJ);a.cJ=function(){}; a.BJ=NaN;var D=new chrome.cast.DialLaunchResponse(!0,MMs(a));x(D);D9G(a)},a.BJ=g.dx(function(){a.cJ()},100)})},zsD=function(a,x,y){a.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(x)); var D=new FN(x);return(new Promise(function(M){FNF(a,D,function(N){N?(a.dS=!0,SC(a.U,D),Lg(a,D),Zx(a,y)):g.jM(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(x)+" is not online."));M(N)},5)})).then(function(M){return M?new chrome.cast.DialLaunchResponse(!1):NxF(a)})},cYY=function(a,x){var y=a.V.receiver.label,D=a.B.friendlyName; return(new Promise(function(M){UzF(a.U,y,x,D,function(N){N&&N.token&&Lg(a,N);M(N)},function(N){w2(a,"Failed to get DIAL screen: "+N); M(null)})})).then(function(M){return M&&M.token?new chrome.cast.DialLaunchResponse(!1):NxF(a)})},FNF=function(a,x,y,D){g.n6(a.D); a.D=0;ips(a.U,x,function(M){M||D<0?y(M):a.D=g.dx(function(){FNF(a,x,y,D-1)},300)})},Zx=function(a,x){a.info("getDialAppInfoWithTimeout_ "+x); d2(a)&&(g.n6(a.Y),a.Y=0,x==0?o4p(a):a.Y=g.dx(function(){o4p(a)},x))},o4p=function(a){d2(a)&&a.J.getDialAppInfo(function(x){a.info("getDialAppInfo dialLaunchData: "+JSON.stringify(x)); x=x.extraData||{};var y=null;if(x.loungeToken){var D;((D=a.T)==null?void 0:D.token)==x.loungeToken&&(y="staleLoungeToken")}else y="missingLoungeToken";y?(a.tP=y,Zx(a,3E4)):(a.dS=!1,a.tP="unknown",tYt(a,x.loungeToken),Zx(a,x.loungeTokenRefreshIntervalMs))},function(x){a.info("getDialAppInfo error: "+x); a.tP="noLoungeTokenResponse";Zx(a,3E4)})},JYL=function(a){g.n6(a.D); a.D=0;g.n6(a.Y);a.Y=0;a.N();a.N=function(){}; g.n6(a.BJ)},ng=function(a,x){Kg.call(this,a,x,"ManualSession"); this.J=g.dx((0,g.RP)(this.A3,this,null),150)},vF=function(a,x){g.Mf.call(this); this.config_=x;this.B=a;this.V=x.appId||"233637DE";this.U=x.theme||"cl";this.BJ=x.disableCastApi||!1;this.D=x.forceMirroring||!1;this.T=null;this.Y=!1;this.J=[];this.N=(0,g.RP)(this.dhJ,this)},Gey=function(a,x){return x?g.Xh(a.J,function(y){return zQ(x,y.label)},a):null},PF=function(a){jC("Controller",a)},Zp7=function(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)},T8=function(a){return a.Y||!!a.J.length||!!a.T},lm=function(a,x,y){x!=a.T&&(g.wg(a.T),(a.T=x)?(y?a.publish("yt-remote-cast2-receiver-resumed", x.B):a.publish("yt-remote-cast2-receiver-selected",x.B),x.subscribe("sessionScreen",(0,g.RP)(a.Ex,a,x)),x.subscribe("sessionFailed",function(){return Qmh(a,x)}),x.T?a.publish("yt-remote-cast2-session-change",x.T):y&&a.T.A3(null)):a.publish("yt-remote-cast2-session-change",null))},Qmh=function(a,x){a.T==x&&a.publish("yt-remote-cast2-session-failed")},S2L=function(a){var x=a.B.Xi(),y=a.T&&a.T.B; a=g.sk(x,function(D){y&&zQ(D,y.label)&&(y=null);var M=D.uuid?D.uuid:D.id,N=Gey(this,D);N?(N.label=M,N.friendlyName=D.name):(N=new chrome.cast.Receiver(M,D.name),N.receiverType=chrome.cast.ReceiverType.CUSTOM);return N},a); y&&(y.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(y=new chrome.cast.Receiver(y.label,y.friendlyName),y.receiverType=chrome.cast.ReceiverType.CUSTOM),a.push(y));return a},n47=function(a,x,y,D){D.disableCastApi?ka("Cannot initialize because disabled by Mdx config."):KN7()?LNP(x,D)&&(wms(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Cjy(a,y):(window.__onGCastApiAvailable=function(M,N){M?Cjy(a,y):(um("Failed to load cast API: "+N),q2P(!1),wms(!1),g.Re("yt-remote-cast-available"),g.Re("yt-remote-cast-receiver"), d97(),y(!1))},D.loadCastApiSetupScript?g.Na(Z6n):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?F5t()>=60&&L5p():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?JPh():F5t()>=89?CMF():(K5V(),wO(wBF.map(GuJ))))):ka("Cannot initialize because not running Chrome")},d97=function(){ka("dispose"); var a=m9();a&&a.dispose();g.ky("yt.mdx.remote.cloudview.instance_",null);v4F(!1);g.D5(PjV);PjV.length=0},WF=function(){return!!g.gX("yt-remote-cast-installed")},Tx7=function(){var a=g.gX("yt-remote-cast-receiver"); return a?a.friendlyName:null},lfy=function(){ka("clearCurrentReceiver"); g.Re("yt-remote-cast-receiver")},keF=function(){return WF()?m9()?m9().getCastSession():(um("getCastSelector: Cast is not initialized."),null):(um("getCastSelector: Cast API is not installed!"),null)},uVs=function(){WF()?m9()?El()?(ka("Requesting cast selector."),m9().requestSession()):(ka("Wait for cast API to be ready to request the session."),PjV.push(g.jX("yt-remote-cast2-api-ready",uVs))):um("requestCastSelector: Cast is not initialized."):um("requestCastSelector: Cast API is not installed!")}, sl=function(a,x){El()?m9().setConnectedScreenStatus(a,x):um("setConnectedScreenStatus called before ready.")},KN7=function(){var a=g.NG().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.DY||a},m9F=function(a,x){m9().init(a,x)},LNP=function(a,x){var y=!1; m9()||(a=new vF(a,x),a.subscribe("yt-remote-cast2-availability-change",function(D){g.fI("yt-remote-cast-available",D);Kx("yt-remote-cast2-availability-change",D)}),a.subscribe("yt-remote-cast2-receiver-selected",function(D){ka("onReceiverSelected: "+D.friendlyName); g.fI("yt-remote-cast-receiver",D);Kx("yt-remote-cast2-receiver-selected",D)}),a.subscribe("yt-remote-cast2-receiver-resumed",function(D){ka("onReceiverResumed: "+D.friendlyName); g.fI("yt-remote-cast-receiver",D);Kx("yt-remote-cast2-receiver-resumed",D)}),a.subscribe("yt-remote-cast2-session-change",function(D){ka("onSessionChange: "+cU(D)); D||g.Re("yt-remote-cast-receiver");Kx("yt-remote-cast2-session-change",D)}),g.ky("yt.mdx.remote.cloudview.instance_",a),y=!0); ka("cloudview.createSingleton_: "+y);return y},m9=function(){return g.uF("yt.mdx.remote.cloudview.instance_")},Cjy=function(a,x){q2P(!0); wms(!1);m9F(a,function(y){y?(v4F(!0),g.Ma("yt-remote-cast2-api-ready")):(um("Failed to initialize cast API."),q2P(!1),g.Re("yt-remote-cast-available"),g.Re("yt-remote-cast-receiver"),d97());x(y)})},ka=function(a){jC("cloudview",a)},um=function(a){jC("cloudview",a)},q2P=function(a){ka("setCastInstalled_ "+a); g.fI("yt-remote-cast-installed",a)},El=function(){return!!g.uF("yt.mdx.remote.cloudview.apiReady_")},v4F=function(a){ka("setApiReady_ "+a); g.ky("yt.mdx.remote.cloudview.apiReady_",a)},wms=function(a){g.ky("yt.mdx.remote.cloudview.initializing_",a)},BF=function(a){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.N=this.D=0;this.trackData=null;this.hasNext=this.hasPrevious=!1;this.loadedTime=this.J=this.Y=this.B=0;this.T=NaN;this.U=!1;this.reset(a)},WNV=function(a){a.audioTrackId=null; a.trackData=null;a.playerState=-1;a.hasPrevious=!1;a.hasNext=!1;a.D=0;a.N=g.At();a.B=0;a.Y=0;a.J=0;a.loadedTime=0;a.T=NaN;a.U=!1},hm=function(a){return a.isPlaying()?(g.At()-a.N)/1E3:0},$a=function(a,x){a.D=x; a.N=g.At()},fg=function(a){switch(a.playerState){case 1:case 1081:return(g.At()-a.N)/1E3+a.D; case -1E3:return 0}return a.D},E4L=function(a){return a.U?a.Y+hm(a):a.Y},g2=function(a,x,y){var D=a.videoId; a.videoId=x;a.index=y;x!=D&&WNV(a)},smF=function(a){var x={}; x.index=a.index;x.listId=a.listId;x.videoId=a.videoId;x.playerState=a.playerState;x.volume=a.volume;x.muted=a.muted;x.audioTrackId=a.audioTrackId;x.trackData=g.R4(a.trackData);x.hasPrevious=a.hasPrevious;x.hasNext=a.hasNext;x.playerTime=a.D;x.playerTimeAt=a.N;x.seekableStart=a.B;x.seekableEnd=a.Y;x.duration=a.J;x.loadedTime=a.loadedTime;x.liveIngestionTime=a.T;return x},Ya=function(a,x){g.Mf.call(this); var y=this;this.J=0;this.U=a;this.D=[];this.N=new I2J;this.B=this.T=null;this.BJ=(0,g.RP)(this.UG7,this);this.Y=(0,g.RP)(this.h2,this);this.V=(0,g.RP)(this.IKG,this);this.cJ=(0,g.RP)(this.aK8,this);var D=0;a?(D=a.getProxyState(),D!=3&&(a.subscribe("proxyStateChange",this.D6,this),BxV(this))):D=3;D!=0&&(x?this.D6(D):g.dx(function(){y.D6(D)},0)); (a=keF())&&Rj(this,a);this.subscribe("yt-remote-cast2-session-change",this.cJ)},Am=function(a){return new BF(a.U.getPlayerContextData())},BxV=function(a){g.qJ("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(x){this.D.push(this.U.subscribe(x,g.Yy(this.Bsc,x),this))},a)},hsG=function(a){g.qJ(a.D,function(x){this.U.unsubscribeByKey(x)},a); a.D.length=0},Ul=function(a){return a.getState()==1},HF=function(a,x){var y=a.N; y.T.length+y.B.length<50&&a.N.enqueue(x)},$9n=function(a,x,y){var D=Am(a); $a(D,y);D.playerState!=-1E3&&(D.playerState=x);im(a,D)},Ol=function(a,x,y){a.U.sendMessage(x,y)},im=function(a,x){hsG(a); a.U.setPlayerContextData(smF(x));BxV(a)},Rj=function(a,x){a.B&&(a.B.removeUpdateListener(a.BJ),a.B.removeMediaListener(a.Y),a.h2(null)); a.B=x;a.B&&(Dx("Setting cast session: "+a.B.sessionId),a.B.addUpdateListener(a.BJ),a.B.addMediaListener(a.Y),a.B.media.length&&a.h2(a.B.media[0]))},ffV=function(a){var x=a.T.media,y=a.T.customData; if(x&&y){var D=Am(a);x.contentId!=D.videoId&&Dx("Cast changing video to: "+x.contentId);D.videoId=x.contentId;D.playerState=y.playerState;$a(D,a.T.getEstimatedTime());im(a,D)}else Dx("No cast media video. Ignoring state update.")},VK=function(a,x,y){return(0,g.RP)(function(D){this.nJ("Failed to "+x+" with cast v2 channel. Error code: "+D.code); D.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.nJ("Retrying "+x+" using MDx browser channel."),Ol(this,x,y))},a)},XK=function(a,x,y,D){D=D===void 0?!1:D; g.Mf.call(this);var M=this;this.D=NaN;this.OJ=!1;this.BJ=this.V=this.dS=this.tP=NaN;this.cJ=[];this.N=this.Y=this.U=this.T=this.B=null;this.N1=a;this.yP=D;this.cJ.push(g.k3(window,"beforeunload",function(){M.Hh(2)})); this.J=[];this.T=new BF;this.e8=x.id;this.UJ=x.idType;this.B=dzt(this.N1,y,this.gt,this.UJ=="shortLived",this.e8);this.B.listen("channelOpened",function(){g4n(M)}); this.B.listen("channelClosed",function(){r2("Channel closed");isNaN(M.D)?QI(!0):QI();M.dispose()}); this.B.listen("channelError",function(N){QI();isNaN(M.nE())?(N==1&&M.UJ=="shortLived"&&M.publish("browserChannelAuthError",N),r2("Channel error: "+N+" without reconnection"),M.dispose()):(M.OJ=!0,r2("Channel error: "+N+" with reconnection in "+M.nE()+" ms"),tm(M,2))}); this.B.listen("channelMessage",function(N){RsF(M,N)}); this.B.Ja(x.token);this.subscribe("remoteQueueChange",function(){var N=M.T.videoId;g.Y3()&&g.fI("yt-remote-session-video-id",N)})},Y2p=function(a){return g.Xh(a.J,function(x){return x.type=="LOUNGE_SCREEN"})},r2=function(a){jC("conn",a)},tm=function(a,x){a.publish("proxyStateChange",x)},AYF=function(a){a.D=g.dx(function(){r2("Connecting timeout"); a.Hh(1)},2E4)},U9p=function(a){g.n6(a.D); a.D=NaN},H67=function(a){g.n6(a.tP); a.tP=NaN},O6F=function(a){i6h(a); a.dS=g.dx(function(){bm(a,"getNowPlaying")},2E4)},i6h=function(a){g.n6(a.dS); a.dS=NaN},g4n=function(a){r2("Channel opened"); a.OJ&&(a.OJ=!1,H67(a),a.tP=g.dx(function(){r2("Timing out waiting for a screen.");a.Hh(1)},15E3))},rYs=function(a,x){var y=null; if(x){var D=Y2p(a);D&&(y={clientName:D.clientName,deviceMake:D.brand,deviceModel:D.model,osVersion:D.osVersion})}g.ky("yt.mdx.remote.remoteClient_",y);x&&(U9p(a),H67(a));y=a.B.bu()&&isNaN(a.D);x==y?x&&(tm(a,1),bm(a,"getSubtitlesTrack")):x?(a.jT()&&a.T.reset(),tm(a,1),bm(a,"getNowPlaying"),VMF(a)):a.Hh(1)},tMh=function(a,x){var y=x.params.videoId; delete x.params.videoId;y==a.T.videoId&&(g.sJ(x.params)?a.T.trackData=null:a.T.trackData=x.params,a.publish("remotePlayerChange"))},Xm7=function(a,x,y){var D=x.params.videoId||x.params.video_id,M=parseInt(x.params.currentIndex,10); a.T.listId=x.params.listId||a.T.listId;g2(a.T,D,M);a.publish("remoteQueueChange",y)},pmh=function(a,x){x.params=x.params||{}; Xm7(a,x,"NOW_PLAYING_MAY_CHANGE");b6J(a,x);a.publish("autoplayDismissed")},b6J=function(a,x){var y=parseInt(x.params.currentTime||x.params.current_time,10); $a(a.T,isNaN(y)?0:y);y=parseInt(x.params.state,10);y=isNaN(y)?-1:y;y==-1&&a.T.playerState==-1E3&&(y=-1E3);a.T.playerState=y;y=Number(x.params.loadedTime);a.T.loadedTime=isNaN(y)?0:y;a.T.L_(Number(x.params.duration));y=a.T;var D=Number(x.params.liveIngestionTime);y.T=D;y.U=isNaN(D)?!1:!0;y=a.T;D=Number(x.params.seekableStartTime);x=Number(x.params.seekableEndTime);y.B=isNaN(D)?0:D;y.Y=isNaN(x)?0:x;a.T.playerState==1?O6F(a):i6h(a);a.publish("remotePlayerChange")},IfV=function(a,x){if(a.T.playerState!= -1E3){var y=1085; switch(parseInt(x.params.adState,10)){case 1:y=1081;break;case 2:y=1084;break;case 0:y=1083}a.T.playerState=y;x=parseInt(x.params.currentTime,10);$a(a.T,isNaN(x)?0:x);a.publish("remotePlayerChange")}},esn=function(a,x){var y=x.params.muted=="true"; a.T.volume=parseInt(x.params.volume,10);a.T.muted=y;a.publish("remotePlayerChange")},aXP=function(a,x){a.Y=x.params.videoId; a.publish("nowAutoplaying",parseInt(x.params.timeout,10))},xBh=function(a,x){a.Y=x.params.videoId||null; a.publish("autoplayUpNext",a.Y)},y6J=function(a,x){a.N=x.params.autoplayMode; a.publish("autoplayModeChange",a.N);a.N=="DISABLED"&&a.publish("autoplayDismissed")},jeF=function(a,x){var y=x.params.hasNext=="true"; a.T.hasPrevious=x.params.hasPrevious=="true";a.T.hasNext=y;a.publish("previousNextChange")},RsF=function(a,x){x=x.message; x.params?r2("Received: action="+x.action+", params="+g.UI(x.params)):r2("Received: action="+x.action+" {}");switch(x.action){case "loungeStatus":x=ag(x.params.devices);a.J=g.sk(x,function(D){return new N4(D)}); x=!!g.Xh(a.J,function(D){return D.type=="LOUNGE_SCREEN"}); rYs(a,x);x=a.iB("mlm");a.publish("multiStateLoopEnabled",x);break;case "loungeScreenDisconnected":g.MJ(a.J,function(D){return D.type=="LOUNGE_SCREEN"}); rYs(a,!1);break;case "remoteConnected":var y=new N4(ag(x.params.device));g.Xh(a.J,function(D){return D.equals(y)})||nXP(a.J,y); break;case "remoteDisconnected":y=new N4(ag(x.params.device));g.MJ(a.J,function(D){return D.equals(y)}); break;case "gracefulDisconnect":break;case "playlistModified":Xm7(a,x,"QUEUE_MODIFIED");break;case "nowPlaying":pmh(a,x);break;case "onStateChange":b6J(a,x);break;case "onAdStateChange":IfV(a,x);break;case "onVolumeChanged":esn(a,x);break;case "onSubtitlesTrackChanged":tMh(a,x);break;case "nowAutoplaying":aXP(a,x);break;case "autoplayDismissed":a.publish("autoplayDismissed");break;case "autoplayUpNext":xBh(a,x);break;case "onAutoplayModeChanged":y6J(a,x);break;case "onHasPreviousNextChanged":jeF(a, x);break;case "requestAssistedSignIn":a.publish("assistedSignInRequested",x.params.authCode);break;case "onLoopModeChanged":a.publish("loopModeChange",x.params.loopMode);break;default:r2("Unrecognized action: "+x.action)}},VMF=function(a){g.n6(a.BJ); a.BJ=g.dx(function(){a.Hh(1)},864E5)},bm=function(a,x,y){y?r2("Sending: action="+x+", params="+g.UI(y)):r2("Sending: action="+x); a.B.sendMessage(x,y)},DBY=function(a){z8.call(this,"ScreenServiceProxy"); this.Ae=a;this.T=[];this.T.push(this.Ae.$_s("screenChange",(0,g.RP)(this.ZW,this)));this.T.push(this.Ae.$_s("onlineScreenChange",(0,g.RP)(this.tWJ,this)))},c6J=function(a,x){DlV(); if(!Sa||!Sa.get("yt-remote-disable-remote-module-for-dev")){x=g.am("MDX_CONFIG")||x;X5h();eoD();pg||(pg=new aj(x?x.loungeApiHost:void 0),MNY()&&(pg.T="/api/loungedev"));Ij||(Ij=g.uF("yt.mdx.remote.deferredProxies_")||[],g.ky("yt.mdx.remote.deferredProxies_",Ij));Mwh();var y=eC();if(!y){var D=new QK(pg,x?x.disableAutomaticScreenCache||!1:!1);g.ky("yt.mdx.remote.screenService_",D);y=eC();var M={};x&&(M={appId:x.appId,disableDial:x.disableDial,theme:x.theme,loadCastApiSetupScript:x.loadCastApiSetupScript, disableCastApi:x.disableCastApi,enableDialLoungeToken:x.enableDialLoungeToken,enableCastLoungeToken:x.enableCastLoungeToken,forceMirroring:x.forceMirroring});g.ky("yt.mdx.remote.enableConnectWithInitialState_",x?x.enableConnectWithInitialState||!1:!1);n47(a,D,function(N){N?aa()&&sl(aa(),"YouTube TV"):D.subscribe("onlineScreenChange",function(){Kx("yt-remote-receiver-availability-change")})},M)}x&&!g.uF("yt.mdx.remote.initialized_")&&(g.ky("yt.mdx.remote.initialized_",!0),xI("Initializing: "+g.UI(x)), ys.push(g.jX("yt-remote-cast2-api-ready",function(){Kx("yt-remote-api-ready")})),ys.push(g.jX("yt-remote-cast2-availability-change",function(){Kx("yt-remote-receiver-availability-change")})),ys.push(g.jX("yt-remote-cast2-receiver-selected",function(){js(null); Kx("yt-remote-auto-connect","cast-selector-receiver")})),ys.push(g.jX("yt-remote-cast2-receiver-resumed",function(){Kx("yt-remote-receiver-resumed","cast-selector-receiver")})),ys.push(g.jX("yt-remote-cast2-session-change",NXh)),ys.push(g.jX("yt-remote-connection-change",function(N){N?sl(aa(),"YouTube TV"):Dn()||(sl(null,null),lfy())})),ys.push(g.jX("yt-remote-cast2-session-failed",function(){Kx("yt-remote-connection-failed")})),a=FUn(),x.isAuto&&(a.id+="#dial"),M=x.capabilities||[],M.length>0&&(a.capabilities= M),a.name=x.device,a.app=x.app,(x=x.theme)&&(a.theme=x),xI(" -- with channel params: "+g.UI(a)),a?(g.fI("yt-remote-session-app",a.app),g.fI("yt-remote-session-name",a.name)):(g.Re("yt-remote-session-app"),g.Re("yt-remote-session-name")),g.ky("yt.mdx.remote.channelParams_",a),y.start(),aa()||zCG())}},o3L=function(){var a=eC().Ae.$_gos(); var x=MX();x&&NX()&&(tJp(a,x)||a.push(x));return rCp(a)},G4p=function(){var a=J6s(); !a&&WF()&&Tx7()&&(a={key:"cast-selector-receiver",name:Tx7()});return a},J6s=function(){var a=o3L(),x=MX(); x||(x=Dn());return g.Xh(a,function(y){return x&&zQ(x,y.key)?!0:!1})},MX=function(){var a=aa(); if(!a)return null;var x=eC().T5();return og(x,a)},NXh=function(a){xI("remote.onCastSessionChange_: "+cU(a)); if(a){var x=MX();if(x&&x.id==a.id){if(sl(x.id,"YouTube TV"),a.idType=="shortLived"&&(a=a.token))FG&&(FG.token=a),(x=NX())&&x.Ja(a)}else x&&zU(),c1(a,1)}else NX()&&zU()},zU=function(){El()?m9().stopSession():um("stopSession called before API ready."); var a=NX();a&&(a.disconnect(1),QeY(null))},SNF=function(){var a=NX(); return!!a&&a.getProxyState()!=3},xI=function(a){jC("remote",a)},eC=function(){if(!KUP){var a=g.uF("yt.mdx.remote.screenService_"); KUP=a?new DBY(a):null}return KUP},aa=function(){return g.uF("yt.mdx.remote.currentScreenId_")},LUs=function(a){g.ky("yt.mdx.remote.currentScreenId_",a)},w3Y=function(){return g.uF("yt.mdx.remote.connectData_")},js=function(a){g.ky("yt.mdx.remote.connectData_",a)},NX=function(){return g.uF("yt.mdx.remote.connection_")},QeY=function(a){var x=NX(); js(null);a||LUs("");g.ky("yt.mdx.remote.connection_",a);Ij&&(g.qJ(Ij,function(y){y(a)}),Ij.length=0); x&&!a?Kx("yt-remote-connection-change",!1):!x&&a&&Kx("yt-remote-connection-change",!0)},Dn=function(){var a=g.Y3(); if(!a)return null;var x=eC();if(!x)return null;x=x.T5();return og(x,a)},c1=function(a,x){aa(); MX()&&MX();if(oa)FG=a;else{LUs(a.id);var y=g.uF("yt.mdx.remote.enableConnectWithInitialState_")||!1;a=new XK(pg,a,FUn(),y);a.connect(x,w3Y());a.subscribe("beforeDisconnect",function(D){Kx("yt-remote-before-disconnect",D)}); a.subscribe("beforeDispose",function(){NX()&&(NX(),QeY(null))}); a.subscribe("browserChannelAuthError",function(){var D=MX();D&&D.idType=="shortLived"&&(El()?m9().handleBrowserChannelAuthError():um("refreshLoungeToken called before API ready."))}); QeY(a)}},zCG=function(){var a=Dn(); a?(xI("Resume connection to: "+cU(a)),c1(a,0)):(QI(),lfy(),xI("Skipping connecting because no session screen found."))},Mwh=function(){var a=FUn(); if(g.sJ(a)){a=GQ();var x=g.gX("yt-remote-session-name")||"",y=g.gX("yt-remote-session-app")||"";a={device:"REMOTE_CONTROL",id:a,name:x,app:y,mdxVersion:3};a.authuser=String(g.am("SESSION_INDEX","0"));(x=g.am("DELEGATED_SESSION_ID"))&&(a.pageId=String(x));g.ky("yt.mdx.remote.channelParams_",a)}},FUn=function(){return g.uF("yt.mdx.remote.channelParams_")||{}},dBh=function(a,x,y){g.A.call(this); var D=this;this.T=a;this.L=x;this.g0=y;this.events=new g.zW(this);this.N=!1;this.D=new g.S8(64);this.B=new g.Id(this.Nj,500,this);this.J=new g.Id(this.h5,1E3,this);this.V=new Cx(this.GMc,0,this);this.U={};this.BJ=new g.Id(this.Na,1E3,this);this.Y=new g.yw(this.seekTo,1E3,this);this.cJ=this.events.Z(this.L,"onVolumeChange",function(M){C8L(D,M)}); g.U(this,this.events);this.events.Z(x,"onCaptionsTrackListChanged",this.gUS);this.events.Z(x,"captionschanged",this.JKP);this.events.Z(x,"captionssettingschanged",this.GS);this.events.Z(x,"videoplayerreset",this.Lw);this.events.Z(x,"mdxautoplaycancel",function(){D.g0.iD()}); x.C("enable_mdx_video_play_directly")&&this.events.Z(x,"videodatachange",function(){qNJ(D.T)||Jq(D)||GU(D,0)}); a=this.g0;a.hP();a.subscribe("proxyStateChange",this.Za,this);a.subscribe("remotePlayerChange",this.oZ,this);a.subscribe("remoteQueueChange",this.Lw,this);a.subscribe("previousNextChange",this.GU,this);a.subscribe("nowAutoplaying",this.oB,this);a.subscribe("autoplayDismissed",this.fT,this);g.U(this,this.B);g.U(this,this.J);g.U(this,this.V);g.U(this,this.BJ);g.U(this,this.Y);this.GS();this.Lw();this.oZ()},C8L=function(a,x){if(Jq(a)){a.g0.unsubscribe("remotePlayerChange",a.oZ,a); var y=Math.round(x.volume);x=!!x.muted;var D=Am(a.g0);if(y!==D.volume||x!==D.muted)a.g0.setVolume(y,x),a.BJ.start();a.g0.subscribe("remotePlayerChange",a.oZ,a)}},ZIJ=function(a){a.NG(0); a.B.stop();a.TH(new g.S8(64))},n3y=function(a,x){if(Jq(a)&&!a.N){var y=null; x&&(y={style:a.L.getSubtitlesUserSettings()},Object.assign(y,x));a.g0.q_(a.L.getVideoData(1).videoId,y);a.U=Am(a.g0).trackData}},GU=function(a,x){var y=a.L.getPlaylist(); if(y==null?0:y.listId){var D=y.index;var M=y.listId.toString()}y=a.L.getVideoData(1);a.g0.playVideo(y.videoId,x,D,M,y.playerParams,y.cJ,Zrp(y));a.TH(new g.S8(1))},v3t=function(a,x){if(x){var y=a.L.getOption("captions","tracklist",{MZ:1}); y&&y.length?(a.L.setOption("captions","track",x),a.N=!1):(a.L.loadModule("captions"),a.N=!0)}else a.L.setOption("captions","track",{})},Jq=function(a){return Am(a.g0).videoId===a.L.getVideoData(1).videoId},P8G=function(a,x){g.Ro.call(this,a); this.T=x},Qs=function(){g.O.call(this,{W:"div", G:"ytp-mdx-popup-dialog",X:{role:"dialog"},K:[{W:"div",G:"ytp-mdx-popup-dialog-inner-content",K:[{W:"div",G:"ytp-mdx-popup-title",PJ:"You're signed out"},{W:"div",G:"ytp-mdx-popup-description",PJ:"Videos you watch may be added to the TV's watch history and influence TV recommendations. To avoid this, cancel and sign in to YouTube on your computer."},{W:"div",G:"ytp-mdx-privacy-popup-buttons",K:[{W:"button",wS:["ytp-button","ytp-mdx-privacy-popup-cancel"],PJ:"Cancel"},{W:"button",wS:["ytp-button", "ytp-mdx-privacy-popup-confirm"],PJ:"Confirm"}]}]}]});this.fade=new g.yj(this,250);this.cancelButton=this.QP("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.QP("ytp-mdx-privacy-popup-confirm");g.U(this,this.fade);this.Z(this.cancelButton,"click",this.T);this.Z(this.confirmButton,"click",this.B)},Ss=function(a){g.O.call(this,{W:"div", G:"ytp-remote",K:[{W:"div",G:"ytp-remote-display-status",K:[{W:"div",G:"ytp-remote-display-status-icon",K:[g.O61()]},{W:"div",G:"ytp-remote-display-status-text",PJ:"{{statustext}}"}]}]});this.api=a;this.fade=new g.yj(this,250);g.U(this,this.fade);this.Z(a,"presentingplayerstatechange",this.onStateChange);this.yS(a.getPlayerStateObject())},Ka=function(a,x){g.km.call(this,"Play on",1,a,x); this.L=a;this.GT={};this.Z(a,"onMdxReceiversChange",this.B);this.Z(a,"presentingplayerstatechange",this.B);this.B()},TXh=function(a){g.Lf.call(this,a); this.jH={key:VJY(),name:"This computer"};this.MV=null;this.subscriptions=[];this.Rb=this.g0=null;this.GT=[this.jH];this.n6=this.jH;this.kx=new g.S8(64);this.fP=0;this.c9=-1;this.K2=!1;this.P9=this.HA=this.vn=null;if(!g.Ad(this.player.j())&&!g.f9(this.player.j())){a=this.player;var x=g.wj(a);x&&(x=x.Rv())&&(x=new Ka(a,x),g.U(this,x));x=new Ss(a);g.U(this,x);g.f1(a,x.element,4);this.vn=new Qs;g.U(this,this.vn);g.f1(a,this.vn.element,4);this.K2=!!Dn()}},La=function(a){a.HA&&(a.player.removeEventListener("presentingplayerstatechange", a.HA),a.HA=null)},lXs=function(a,x,y){a.kx=y; a.player.publish("presentingplayerstatechange",new g.J7(y,x))},w3=function(a,x){if(x.key!==a.n6.key)if(x.key===a.jH.key)zU(); else if(qNJ(a)&&k4y(a),a.n6=x,!g.f9(a.player.j())){var y=a.player.getPlaylistId();var D=a.player.getVideoData(1);var M=D.videoId;if(!y&&!M||(a.player.getAppState()===2||a.player.getAppState()===1)&&a.player.j().C("should_clear_video_data_on_player_cued_unstarted"))D=null;else{var N=a.player.getPlaylist();if(N){var F=[];for(var c=0;c2*this.size&&M4(this),!0):!1}; g.C.get=function(a,x){return yI(this.B,a)?this.B[a]:x}; g.C.set=function(a,x){yI(this.B,a)||(this.size+=1,this.T.push(a),this.WL++);this.B[a]=x}; g.C.forEach=function(a,x){for(var y=this.pR(),D=0;D=D.T.length)return g.Fw;var N=D.T[x++];return g.hG(a?N:D.B[N])}; return M}; var Y_s={czY:"atp",Ak7:"ska",LdY:"que",U5J:"mus",BMJ:"sus",XqG:"dsp",vYP:"seq",d5J:"mic",B6R:"dpa",shJ:"mlm",SOG:"dsdtr",LGy:"ntb",zbS:"vsp",UV7:"scn",yUt:"rpe",j97:"dcn",iOy:"dcp",vsP:"pas",Kst:"drq",CcR:"opf",Igy:"els",sI7:"isg",EYy:"svq",ITc:"mvp",dKt:"ads",Jk7:"stcp",gYJ:"sads",HOS:"dloc",AyJ:"dcw",nr7:"asw",P$7:"apw",mK7:"wrc",BiS:"pcw",CTJ:"ipv",osP:"ndt",DyP:"ctops"},ACV={uAc:"u",LsR:"cl",Go7:"k",PTY:"i",FsR:"cr",WGP:"m",CMY:"g",PZ:"up"},NKF={ZU:"adPlaying",uA:"onAdStateChange"},FO7={yX7:"nowPlaying", kfJ:"onStateChange",ZU:"adPlaying",uA:"onAdStateChange",Mi:"nowPlayingShorts",XE:"onShortsStateChange"},zYt={Mi:"nowPlayingShorts",XE:"onShortsStateChange"};N4.prototype.equals=function(a){return a?this.id==a.id:!1}; var ImY="",Sa=null;g.d(NvD,g.RK);var Lx,SsJ=zSy("loadCastFramework")||zSy("loadCastApplicationFramework"),wBF=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.iF(Cx,g.A);g.C=Cx.prototype;g.C.Uk=function(a){this.U=arguments;this.T=!1;this.MG?this.J=g.At()+this.jR:this.MG=g.gT(this.N,this.jR)}; g.C.stop=function(){this.MG&&(g.lF.clearTimeout(this.MG),this.MG=null);this.J=null;this.T=!1;this.U=[]}; g.C.pause=function(){++this.B}; g.C.resume=function(){this.B&&(--this.B,!this.B&&this.T&&(this.T=!1,this.D.apply(null,this.U)))}; g.C.m6=function(){this.stop();Cx.v$.m6.call(this)}; g.C.WV=function(){this.MG&&(g.lF.clearTimeout(this.MG),this.MG=null);this.J?(this.MG=g.gT(this.N,this.J-g.At()),this.J=null):this.B?this.T=!0:(this.T=!1,this.D.apply(null,this.U))};q4.prototype.stringify=function(a){return g.lF.JSON.stringify(a,void 0)}; q4.prototype.parse=function(a){return g.lF.JSON.parse(a,void 0)};g.iF(qsV,g.yz);g.iF(dlJ,g.yz);var ZZs=null;g.iF(vRG,g.yz);g.iF(PMn,g.yz);g.iF(TvF,g.yz);vU.prototype.debug=function(){}; vU.prototype.info=function(){}; vU.prototype.warning=function(){};var Bv7={},sdt={};g.C=PU.prototype;g.C.setTimeout=function(a){this.zt=a}; g.C.xC=function(a){a=a.target;var x=this.Gt;x&&g.tD(a)==3?x.aN():this.a8(a)}; g.C.a8=function(a){try{if(a==this.T)a:{var x=g.tD(this.T),y=this.T.B,D=this.T.getStatus();if(!(x<3)&&(x!=3||this.T&&(this.B.B||g.bT(this.T)||g.pB(this.T)))){this.yP||x!=4||y==7||(y==8||D<=0?dO(3):dO(2));f4y(this);var M=this.T.getStatus();this.Af=M;var N=ERp(this);if(this.D=M==200){if(this.tf&&!this.Cc){b:{if(this.T){var F=g.I7(this.T,"X-HTTP-Initial-Response");if(F&&!g.af(F)){var c=F;break b}}c=null}if(a=c)this.Cc=!0,VNJ(this,a);else{this.D=!1;this.N=3;ZT(12);lt(this);kw(this);break a}}if(this.UJ){a= !0;for(var J;!this.yP&&this.Y0&&!this.O6&&(this.O6=!0,this.J.Cr(this)):(lt(this),kw(this))}else VNJ(this,N);x==4&<(this);this.D&&!this.yP&&(x==4?gRL(this.J,this):(this.D=!1,TQ(this)))}else g.iX7(this.T),M==400&&N.indexOf("Unknown SID")> 0?(this.N=3,ZT(12)):(this.N=0,ZT(13)),lt(this),kw(this)}}}catch(G){}finally{}}; g.C.cancel=function(){this.yP=!0;lt(this)}; g.C.Ok=function(){this.cJ=null;var a=Date.now();a-this.iY>=0?(this.e8!=2&&(dO(3),ZT(17)),lt(this),this.N=2,kw(this)):$ln(this,this.iY-a)}; g.C.getLastError=function(){return this.N}; g.C.eg=function(){return this.T};tNn.prototype.cancel=function(){this.J=bZG(this);if(this.B)this.B.cancel(),this.B=null;else if(this.T&&this.T.size!==0){for(var a=g.W(this.T.values()),x=a.next();!x.done;x=a.next())x.value.cancel();this.T.clear()}};g.C=a2y.prototype;g.C.Oe=8;g.C.vO=1;g.C.connect=function(a,x,y,D){ZT(0);this.Fn=a;this.yP=x||{};y&&D!==void 0&&(this.yP.OSID=y,this.yP.OAID=D);this.Gt=this.n1;this.N1=HZh(this,null,this.Fn);Eo(this)}; g.C.disconnect=function(){ygG(this);if(this.vO==3){var a=this.YG++,x=this.N1.clone();g.QM(x,"SID",this.U);g.QM(x,"RID",a);g.QM(x,"TYPE","terminate");fx(this,x);a=new PU(this,this.U,a);a.e8=2;a.V=IO(x.clone());x=!1;if(g.lF.navigator&&g.lF.navigator.sendBeacon)try{x=g.lF.navigator.sendBeacon(a.V.toString(),"")}catch(y){}!x&&g.lF.Image&&((new Image).src=a.V,x=!0);x||(a.T=mlY(a.J,null),a.T.send(a.V));a.tP=Date.now();TQ(a)}z_7(this)}; g.C.l0=function(){return this.vO==0}; g.C.getState=function(){return this.vO}; g.C.hZ=function(a){if(this.D)if(this.D=null,this.vO==1){if(!a){this.YG=Math.floor(Math.random()*1E5);a=this.YG++;var x=new PU(this,"",a),y=this.BJ;this.tf&&(y?(y=g.gQ(y),g.Y2(y,this.tf)):y=this.tf);this.Y!==null||this.iY||(x.N1=y,y=null);var D;if(this.S8)a:{for(var M=D=0;M4096){D=M;break a}if(D===4096||M===this.J.length-1){D=M+1;break a}}D= 1E3}else D=1E3;D=M0D(this,x,D);M=this.N1.clone();g.QM(M,"RID",a);g.QM(M,"CVER",22);this.UJ&&g.QM(M,"X-HTTP-Session-Id",this.UJ);fx(this,M);y&&(this.iY?D="headers="+g.Vp(g.Gyz(y))+"&"+D:this.Y&&g.LZ(M,this.Y,y));UlP(this.B,x);this.VA&&g.QM(M,"TYPE","init");this.S8?(g.QM(M,"$req",D),g.QM(M,"SID","null"),x.tf=!0,uZL(x,M,null)):uZL(x,M,D);this.vO=2}}else this.vO==3&&(a?Nm7(this,a):this.J.length==0||XBG(this.B)||Nm7(this))}; g.C.N_=function(){this.V=null;FvF(this);if(this.Vn&&!(this.zt||this.T==null||this.AK<=0)){var a=4*this.AK;this.OJ=nx((0,g.RP)(this.fK1,this),a)}}; g.C.fK1=function(){this.OJ&&(this.OJ=null,this.Gt=!1,this.zt=!0,ZT(10),mc(this),FvF(this))}; g.C.Cr=function(a){this.T==a&&this.Vn&&!this.zt&&(xEG(this),this.zt=!0,ZT(11))}; g.C.wP=function(){this.cJ!=null&&(this.cJ=null,mc(this),Ysh(this),ZT(19))}; g.C.n5P=function(a){a?ZT(2):ZT(1)}; g.C.isActive=function(){return!!this.N&&this.N.isActive(this)}; g.C=o1n.prototype;g.C.o8=function(){}; g.C.yR=function(){}; g.C.bd=function(){}; g.C.Lk=function(){}; g.C.isActive=function(){return!0}; g.C.NN=function(){};g.iF(Rg,g.wT);Rg.prototype.open=function(){this.T.N=this.J;this.D&&(this.T.Cc=!0);this.T.connect(this.N,this.B||void 0)}; Rg.prototype.close=function(){this.T.disconnect()}; Rg.prototype.send=function(a){var x=this.T;if(typeof a==="string"){var y={};y.__data__=a;a=y}else this.U&&(y={},y.__data__=g.UI(a),a=y);x.J.push(new rPh(x.zZ++,a));x.vO==3&&Eo(x)}; Rg.prototype.m6=function(){this.T.N=null;delete this.J;this.T.disconnect();delete this.T;Rg.v$.m6.call(this)}; g.iF(GtY,qsV);g.iF(Q9L,dlJ);g.iF(gO,o1n);gO.prototype.o8=function(){this.T.dispatchEvent("m")}; gO.prototype.yR=function(a){this.T.dispatchEvent(new GtY(a))}; gO.prototype.bd=function(a){this.T.dispatchEvent(new Q9L(a))}; gO.prototype.Lk=function(){this.T.dispatchEvent("n")}; SbD.prototype.commit=function(a){this.T.Af=a};var Ay=new g.wT;g.d(Lvh,g.yz);g.C=HU.prototype;g.C.e0=null;g.C.kQ=!1;g.C.xO=null;g.C.Q0=null;g.C.f9=null;g.C.tN=null;g.C.n9=null;g.C.mz=null;g.C.RX=null;g.C.au=null;g.C.fW=0;g.C.HK=null;g.C.Q_=null;g.C.oX=null;g.C.Qj=-1;g.C.Hj=!0;g.C.mH=!1;g.C.t9=0;g.C.nW=null;var n1J={},ZGJ={};g.C=HU.prototype;g.C.setTimeout=function(a){this.B=a}; g.C.LF=function(a){a=a.target;var x=this.nW;x&&g.tD(a)==3?x.aN():this.Ck(a)}; g.C.Ck=function(a){try{if(a==this.au)a:{var x=g.tD(this.au),y=this.au.B,D=this.au.getStatus();if(g.lH&&!g.jq("420+")){if(x<4)break a}else if(x<3||x==3&&!g.bT(this.au))break a;this.mH||x!=4||y==7||(y==8||D<=0?this.T.v8(3):this.T.v8(2));Tms(this);var M=this.au.getStatus();this.Qj=M;var N=g.bT(this.au);if(this.kQ=M==200){x==4&&Oo(this);if(this.UJ){for(a=!0;!this.mH&&this.fW0?(this.oX=3,Uo(13)):(this.oX=0,Uo(14)),Oo(this),l2n(this)}}catch(c){}finally{}}; g.C.cancel=function(){this.mH=!0;Oo(this)}; g.C.hB=function(){this.xO=null;var a=Date.now();a-this.Q0>=0?(this.tN!=2&&this.T.v8(3),Oo(this),this.oX=2,Uo(18),l2n(this)):PlL(this,this.Q0-a)}; g.C.getLastError=function(){return this.oX};g.C=Wvs.prototype;g.C.J9=null;g.C.qy=null;g.C.Bz=!1;g.C.IJ=null;g.C.pZ=null;g.C.Mq=-1;g.C.JN=null;g.C.A8=null;g.C.connect=function(a){this.IJ=a;a=rO(this.T,null,this.IJ);Uo(3);Date.now();var x=this.T.BJ;x!=null?(this.JN=x[0],(this.A8=x[1])?(this.pZ=1,E1n(this)):(this.pZ=2,s9P(this))):(eg(a,"MODE","init"),this.qy=new HU(this),this.qy.e0=this.J9,qbP(this.qy,a,!1,null,!0),this.pZ=0)}; g.C.X8=function(a){if(a)this.pZ=2,s9P(this);else{Uo(4);var x=this.T;x.nR=x.dG.Mq;px(x,9)}a&&this.v8(2)}; g.C.fg=function(a){return this.T.fg(a)}; g.C.abort=function(){this.qy&&(this.qy.cancel(),this.qy=null);this.Mq=-1}; g.C.l0=function(){return!1}; g.C.kh=function(a,x){this.Mq=a.Qj;if(this.pZ==0)if(x){try{var y=this.B.parse(x)}catch(D){a=this.T;a.nR=this.Mq;px(a,2);return}this.JN=y[0];this.A8=y[1]}else a=this.T,a.nR=this.Mq,px(a,2);else this.pZ==2&&(this.Bz?(Uo(7),Date.now()):x=="11111"?(Uo(6),this.Bz=!0,Date.now(),this.Mq=200,this.qy.cancel(),Uo(12),ty(this.T,this,!0)):(Uo(8),Date.now(),this.Bz=!1))}; g.C.sQ=function(){this.Mq=this.qy.Qj;if(this.qy.kQ)this.pZ==0?this.A8?(this.pZ=1,E1n(this)):(this.pZ=2,s9P(this)):this.pZ==2&&(this.Bz?(Uo(12),ty(this.T,this,!0)):(Uo(11),ty(this.T,this,!1)));else{this.pZ==0?Uo(9):this.pZ==2&&Uo(10);var a=this.T;this.qy.getLastError();a.nR=this.Mq;px(a,2)}}; g.C.Jm=function(){return this.T.Jm()}; g.C.isActive=function(){return this.T.isActive()}; g.C.v8=function(a){this.T.v8(a)};g.C=Bmn.prototype;g.C.Dg=null;g.C.Iq=null;g.C.a9=null;g.C.g1=null;g.C.WR=null;g.C.IN=null;g.C.pk=null;g.C.UQ=null;g.C.Uv=0;g.C.yh=0;g.C.FJ=null;g.C.Do=null;g.C.Zs=null;g.C.kH=null;g.C.dG=null;g.C.hn=null;g.C.hg=-1;g.C.D1=-1;g.C.nR=-1;g.C.Np=0;g.C.w2=0;g.C.Co=8;var uQh={OK:0,rUY:2,H_8:4,ecP:5,FOc:6,STOP:7,lA:8,my7:9,dy1:10,nd7:11,tbJ:12};g.iF($E7,g.yz);g.iF(f2n,g.yz);g.C=Bmn.prototype; g.C.connect=function(a,x,y,D,M){Uo(0);this.WR=x;this.Iq=y||{};D&&M!==void 0&&(this.Iq.OSID=D,this.Iq.OAID=M);this.V?(Yw((0,g.RP)(this.DQ,this,a),100),R_h(this)):this.DQ(a)}; g.C.disconnect=function(){Yby(this);if(this.T==3){var a=this.Uv++,x=this.IN.clone();g.QM(x,"SID",this.U);g.QM(x,"RID",a);g.QM(x,"TYPE","terminate");bt(this,x);a=new HU(this,this.U,a);a.tN=2;a.n9=IO(x.clone());(new Image).src=a.n9.toString();a.f9=Date.now();dEy(a)}bGP(this)}; g.C.DQ=function(a){this.dG=new Wvs(this);this.dG.J9=this.Dg;this.dG.B=this.N;this.dG.connect(a)}; g.C.l0=function(){return this.T==0}; g.C.getState=function(){return this.T}; g.C.Yh=function(a){this.Do=null;OGF(this,a)}; g.C.GG=function(){this.Zs=null;this.g1=new HU(this,this.U,"rpc",this.Y);this.g1.e0=this.Dg;this.g1.t9=0;var a=this.pk.clone();g.QM(a,"RID","rpc");g.QM(a,"SID",this.U);g.QM(a,"CI",this.hn?"0":"1");g.QM(a,"AID",this.hg);bt(this,a);g.QM(a,"TYPE","xmlhttp");qbP(this.g1,a,!0,this.UQ,!1)}; g.C.kh=function(a,x){if(this.T!=0&&(this.g1==a||this.a9==a))if(this.nR=a.Qj,this.a9==a&&this.T==3)if(this.Co>7){try{var y=this.N.parse(x)}catch(D){y=null}if(Array.isArray(y)&&y.length==3)if(a=y,a[0]==0)a:{if(!this.Zs){if(this.g1)if(this.g1.f9+3E30)){if(D=x==1)this.a9||this.Do||this.T==1||this.Np>=2?D=!1:(this.Do=Yw((0,g.RP)(this.Yh,this,a),rgV(this,this.Np)),this.Np++, D=!0);D=!(D||x==2&&t0p(this))}if(D)switch(y){case 1:px(this,5);break;case 4:px(this,10);break;case 3:px(this,6);break;case 7:px(this,12);break;default:px(this,2)}}}; g.C.bZ=function(a){if(!g.a4(arguments,this.T))throw Error("Unexpected channel state: "+this.T);}; g.C.PVJ=function(a){a?Uo(2):(Uo(1),XIJ(this,8))}; g.C.fg=function(a){if(a)throw Error("Can't create secondary domain capable XhrIo object.");a=new g.OI;a.Y=!1;return a}; g.C.isActive=function(){return!!this.FJ&&this.FJ.isActive(this)}; g.C.v8=function(a){var x=Ay;x.dispatchEvent(new f2n(x,a))}; g.C.Jm=function(){return!1}; g.C=pIy.prototype;g.C.vQ=function(){}; g.C.Z1=function(){}; g.C.Fi=function(){}; g.C.M_=function(){}; g.C.aJ=function(){}; g.C.ud=function(){return{}}; g.C.isActive=function(){return!0};g.C=I2J.prototype;g.C.enqueue=function(a){this.B.push(a)}; g.C.isEmpty=function(){return this.T.length===0&&this.B.length===0}; g.C.clear=function(){this.T=[];this.B=[]}; g.C.contains=function(a){return g.a4(this.T,a)||g.a4(this.B,a)}; g.C.remove=function(a){var x=this.T;var y=(0,g.fTz)(x,a);y>=0?(g.x2(x,y),x=!0):x=!1;return x||g.Dk(this.B,a)}; g.C.To=function(){for(var a=[],x=this.T.length-1;x>=0;--x)a.push(this.T[x]);x=this.B.length;for(var y=0;y=mBL.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(a=mBL[this.B],this.MG=g.dx((0,g.RP)(this.UW,this),a),this.B++):this.publish("pairingFailed",Error("Server error "+a.status))}; g.C.kC=function(){this.T=null;this.publish("pairingFailed",Error("Server not responding"))}; var mBL=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.iF(oj,z8);g.C=oj.prototype;g.C.start=function(){cF(this)&&this.publish("screenChange");!g.gX("yt-remote-lounge-token-expiration")&&sBF(this);g.n6(this.T);this.T=g.dx((0,g.RP)(this.start,this),1E4)}; g.C.add=function(a,x){cF(this);uXL(this,a);Jm(this,!1);this.publish("screenChange");x(a);a.token||sBF(this)}; g.C.remove=function(a,x){var y=cF(this);WOh(this,a)&&(Jm(this,!1),y=!0);x(a);y&&this.publish("screenChange")}; g.C.wY=function(a,x,y,D){var M=cF(this),N=this.get(a.id);N?(N.name!=x&&(N.name=x,Jm(this,!1),M=!0),y(a)):D(Error("no such local screen."));M&&this.publish("screenChange")}; g.C.m6=function(){g.n6(this.T);oj.v$.m6.call(this)}; g.C.t8R=function(a){cF(this);var x=this.screens.length;a=a&&a.screens||[];for(var y=a.length,D=0;D20)break a;c=x(N,F)}N=c}M.name=N}y(SC(this,M))},this), onError:(0,g.RP)(function(M){D(Error("pairing request failed: "+M.status))},this), onTimeout:(0,g.RP)(function(){D(Error("pairing request timed out."))},this)})}; g.C.m6=function(){g.wg(this.B);g.wg(this.T);QK.v$.m6.call(this)}; g.C.ayJ=function(){OpY(this);this.publish("screenChange");this.T.update()}; QK.prototype.dispose=QK.prototype.dispose;g.iF(Kg,g.Mf);g.C=Kg.prototype;g.C.Zk=function(a){this.hP()||(a&&(w2(this,""+a),this.publish("sessionFailed")),this.T=null,this.publish("sessionScreen",null))}; g.C.info=function(a){jC(this.UJ,a)}; g.C.Ee=function(){return null}; g.C.Ry=function(a){var x=this.B;a?(x.displayStatus=new chrome.cast.ReceiverDisplayStatus(a,[]),x.displayStatus.showStop=!0):x.displayStatus=null;chrome.cast.setReceiverDisplayStatus(x,(0,g.RP)(function(){this.info("Updated receiver status for "+x.friendlyName+": "+a)},this),(0,g.RP)(function(){w2(this,"Failed to update receiver status for: "+x.friendlyName)},this))}; g.C.m6=function(){this.Ry("");Kg.v$.m6.call(this)};g.d(Cg,Kg);g.C=Cg.prototype;g.C.oy=function(a){if(this.J){if(this.J==a)return;w2(this,"Overriding cast session with new session object");jmh(this);this.tP=!1;this.BJ="unknown";this.J.removeUpdateListener(this.dS);this.J.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.OJ)}this.J=a;this.J.addUpdateListener(this.dS);this.J.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.OJ);I9y(this,"getMdxSessionStatus")}; g.C.A3=function(a){this.info("launchWithParams no-op for Cast: "+g.UI(a))}; g.C.stop=function(){this.J?this.J.stop((0,g.RP)(function(){this.Zk()},this),(0,g.RP)(function(){this.Zk(Error("Failed to stop receiver app."))},this)):this.Zk(Error("Stopping cast device without session."))}; g.C.Ry=function(){}; g.C.m6=function(){this.info("disposeInternal");jmh(this);this.J&&(this.J.removeUpdateListener(this.dS),this.J.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.OJ));this.J=null;Kg.prototype.m6.call(this)}; g.C.nNG=function(a,x){if(!this.hP())if(x)if(x=ag(x),g.BJ(x))switch(a=""+x.type,x=x.data||{},this.info("onYoutubeMessage_: "+a+" "+g.UI(x)),a){case "mdxSessionStatus":XYh(this,x);break;case "loungeToken":eYY(this,x);break;default:w2(this,"Unknown youtube message: "+a)}else w2(this,"Unable to parse message.");else w2(this,"No data in message.")}; g.C.Bw=function(a,x,y,D){g.n6(this.V);this.V=0;UzF(this.U,this.B.label,a,this.B.friendlyName,(0,g.RP)(function(M){M?x(M):D>=0?(w2(this,"Screen "+a+" appears to be offline. "+D+" retries left."),this.V=g.dx((0,g.RP)(this.Bw,this,a,x,y,D-1),300)):y(Error("Unable to fetch screen."))},this),y)}; g.C.Ee=function(){return this.J}; g.C.DW=function(a){this.hP()||a||(w2(this,"Cast session died."),this.Zk())};g.d(qH,Kg);g.C=qH.prototype;g.C.oy=function(a){this.J=a;this.J.addUpdateListener(this.yP)}; g.C.A3=function(a){this.N1=a;this.cJ()}; g.C.stop=function(){JYL(this);this.J?this.J.stop((0,g.RP)(this.Zk,this,null),(0,g.RP)(this.Zk,this,"Failed to stop DIAL device.")):this.Zk()}; g.C.m6=function(){JYL(this);this.J&&this.J.removeUpdateListener(this.yP);this.J=null;Kg.prototype.m6.call(this)}; g.C.GN=function(a){this.hP()||a||(w2(this,"DIAL session died."),this.N(),this.N=function(){},this.Zk())};g.d(ng,Kg);ng.prototype.stop=function(){this.Zk()}; ng.prototype.oy=function(){}; ng.prototype.A3=function(){g.n6(this.J);this.J=NaN;var a=og(this.U.T5(),this.B.label);a?Lg(this,a):this.Zk(Error("No such screen"))}; ng.prototype.m6=function(){g.n6(this.J);this.J=NaN;Kg.prototype.m6.call(this)};g.d(vF,g.Mf);g.C=vF.prototype; g.C.init=function(a,x){chrome.cast.timeout.requestSession=3E4;var y=new chrome.cast.SessionRequest(this.V,[chrome.cast.Capability.AUDIO_OUT]);g.Te("desktop_enable_cast_connect")&&(y.androidReceiverCompatible=!0);this.BJ||(y.dialRequest=new chrome.cast.DialRequest("YouTube"));var D=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;a=a||this.D?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var M=(0,g.RP)(this.mhJ,this);y=new chrome.cast.ApiConfig(y,(0,g.RP)(this.XS, this),M,D,a);y.customDialLaunchCallback=(0,g.RP)(this.eoy,this);chrome.cast.initialize(y,(0,g.RP)(function(){this.hP()||(chrome.cast.addReceiverActionListener(this.N),Poh(),this.B.subscribe("onlineScreenChange",(0,g.RP)(this.VR,this)),this.J=S2L(this),chrome.cast.setCustomReceivers(this.J,function(){},(0,g.RP)(function(N){this.nJ("Failed to set initial custom receivers: "+g.UI(N))},this)),this.publish("yt-remote-cast2-availability-change",T8(this)),x(!0))},this),(0,g.RP)(function(N){this.nJ("Failed to initialize API: "+ g.UI(N)); x(!1)},this))}; g.C.bKJ=function(a,x){PF("Setting connected screen ID: "+a+" -> "+x);if(this.T){var y=this.T.T;if(!a||y&&y.id!=a)PF("Unsetting old screen status: "+this.T.B.friendlyName),lm(this,null)}if(a&&x){if(!this.T){a=og(this.B.T5(),a);if(!a){PF("setConnectedScreenStatus: Unknown screen.");return}if(a.idType=="shortLived"){PF("setConnectedScreenStatus: Screen with id type to be short lived.");return}y=Gey(this,a);y||(PF("setConnectedScreenStatus: Connected receiver not custom..."),y=new chrome.cast.Receiver(a.uuid? a.uuid:a.id,a.name),y.receiverType=chrome.cast.ReceiverType.CUSTOM,this.J.push(y),chrome.cast.setCustomReceivers(this.J,function(){},(0,g.RP)(function(D){this.nJ("Failed to set initial custom receivers: "+g.UI(D))},this))); PF("setConnectedScreenStatus: new active receiver: "+y.friendlyName);lm(this,new ng(this.B,y),!0)}this.T.Ry(x)}else PF("setConnectedScreenStatus: no screen.")}; g.C.RyP=function(a){this.hP()?this.nJ("Setting connection data on disposed cast v2"):this.T?this.T.A3(a):this.nJ("Setting connection data without a session")}; g.C.lZ=function(){this.hP()?this.nJ("Stopping session on disposed cast v2"):this.T?(this.T.stop(),lm(this,null)):PF("Stopping non-existing session")}; g.C.requestSession=function(){chrome.cast.requestSession((0,g.RP)(this.XS,this),(0,g.RP)(this.r6J,this))}; g.C.m6=function(){this.B.unsubscribe("onlineScreenChange",(0,g.RP)(this.VR,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.N);var a=Zp7,x=g.uF("yt.mdx.remote.debug.handlers_");g.Dk(x||[],a);g.wg(this.T);g.Mf.prototype.m6.call(this)}; g.C.nJ=function(a){jC("Controller",a)}; g.C.Ex=function(a,x){this.T==a&&(x||lm(this,null),this.publish("yt-remote-cast2-session-change",x))}; g.C.dhJ=function(a,x){if(!this.hP())if(a)switch(a.friendlyName=chrome.cast.unescape(a.friendlyName),PF("onReceiverAction_ "+a.label+" / "+a.friendlyName+"-- "+x),x){case chrome.cast.ReceiverAction.CAST:if(this.T)if(this.T.B.label!=a.label)PF("onReceiverAction_: Stopping active receiver: "+this.T.B.friendlyName),this.T.stop();else{PF("onReceiverAction_: Casting to active receiver.");this.T.T&&this.publish("yt-remote-cast2-session-change",this.T.T);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:lm(this, new ng(this.B,a));break;case chrome.cast.ReceiverType.DIAL:lm(this,new qH(this.B,a,this.U,this.config_));break;case chrome.cast.ReceiverType.CAST:lm(this,new Cg(this.B,a,this.config_));break;default:this.nJ("Unknown receiver type: "+a.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.T&&this.T.B.label==a.label?this.T.stop():this.nJ("Stopping receiver w/o session: "+a.friendlyName)}else this.nJ("onReceiverAction_ called without receiver.")}; g.C.eoy=function(a){if(this.hP())return Promise.reject(Error("disposed"));var x=a.receiver;x.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.nJ("Not DIAL receiver: "+x.friendlyName),x.receiverType=chrome.cast.ReceiverType.DIAL);var y=this.T?this.T.B:null;if(!y||y.label!=x.label)return this.nJ("Receiving DIAL launch request for non-clicked DIAL receiver: "+x.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(y&&y.label==x.label&&y.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.T.T)return PF("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.T.T),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.nJ('Changing CAST intent from "'+y.receiverType+'" to "dial" for '+x.friendlyName);lm(this,new qH(this.B,x,this.U,this.config_))}x=this.T;x.V=a;x.V.appState==chrome.cast.DialAppState.RUNNING?(a=x.V.extraData||{},y=a.screenId||null,d2(x)&&a.loungeToken?a.loungeTokenRefreshIntervalMs?a=zsD(x,{name:x.B.friendlyName,screenId:a.screenId,loungeToken:a.loungeToken,dialId:x.V.receiver.label, screenIdType:"shortLived"},a.loungeTokenRefreshIntervalMs):(g.jM(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(a)+".")),a=cYY(x,y)):a=cYY(x,y)):a=NxF(x);return a}; g.C.XS=function(a){var x=this;if(!this.hP()&&!this.D){PF("New cast session ID: "+a.sessionId);var y=a.receiver;if(y.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.T)if(y.receiverType==chrome.cast.ReceiverType.CAST)PF("Got resumed cast session before resumed mdx connection."),y.friendlyName=chrome.cast.unescape(y.friendlyName),lm(this,new Cg(this.B,y,this.config_),!0);else{this.nJ("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var D=this.T.B,M=og(this.B.T5(), D.label);M&&zQ(M,y.label)&&D.receiverType!=chrome.cast.ReceiverType.CAST&&y.receiverType==chrome.cast.ReceiverType.CAST&&(PF("onSessionEstablished_: manual to cast session change "+y.friendlyName),g.wg(this.T),this.T=new Cg(this.B,y,this.config_),this.T.subscribe("sessionScreen",(0,g.RP)(this.Ex,this,this.T)),this.T.subscribe("sessionFailed",function(){return Qmh(x,x.T)}),this.T.A3(null)); this.T.oy(a)}}}; g.C.YC=function(){return this.T?this.T.Ee():null}; g.C.r6J=function(a){this.hP()||(this.nJ("Failed to estabilish a session: "+g.UI(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&lm(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.C.mhJ=function(a){PF("Receiver availability updated: "+a);if(!this.hP()){var x=T8(this);this.Y=a==chrome.cast.ReceiverAvailability.AVAILABLE;T8(this)!=x&&this.publish("yt-remote-cast2-availability-change",T8(this))}}; g.C.VR=function(){this.hP()||(this.J=S2L(this),PF("Updating custom receivers: "+g.UI(this.J)),chrome.cast.setCustomReceivers(this.J,function(){},(0,g.RP)(function(){this.nJ("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",T8(this)))}; vF.prototype.setLaunchParams=vF.prototype.RyP;vF.prototype.setConnectedScreenStatus=vF.prototype.bKJ;vF.prototype.stopSession=vF.prototype.lZ;vF.prototype.getCastSession=vF.prototype.YC;vF.prototype.requestSession=vF.prototype.requestSession;vF.prototype.init=vF.prototype.init;vF.prototype.dispose=vF.prototype.dispose;var WUJ=g.pz(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),PjV=[],Z6n=g.K0(WUJ);g.C=BF.prototype; g.C.reset=function(a){this.listId="";this.index=-1;this.videoId="";WNV(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.hasPrevious=a.hasPrevious,this.hasNext=a.hasNext,this.D=a.playerTime,this.N=a.playerTimeAt,this.B=a.seekableStart,this.Y=a.seekableEnd,this.J=a.duration,this.loadedTime=a.loadedTime,this.T=a.liveIngestionTime, this.U=!isNaN(this.T))}; g.C.isPlaying=function(){return this.playerState==1}; g.C.isBuffering=function(){return this.playerState==3}; g.C.L_=function(a){this.J=isNaN(a)?0:a}; g.C.getDuration=function(){return this.U?this.J+hm(this):this.J}; g.C.clone=function(){return new BF(smF(this))};g.d(Ya,g.Mf);g.C=Ya.prototype;g.C.getState=function(){return this.J}; g.C.e1=function(){return this.U.getReconnectTimeout()}; g.C.yF=function(){this.U.reconnect()}; g.C.play=function(){Ul(this)?(this.T?this.T.play(null,g.Xz,VK(this,"play")):Ol(this,"play"),$9n(this,1,fg(Am(this))),this.publish("remotePlayerChange")):HF(this,this.play)}; g.C.pause=function(){Ul(this)?(this.T?this.T.pause(null,g.Xz,VK(this,"pause")):Ol(this,"pause"),$9n(this,2,fg(Am(this))),this.publish("remotePlayerChange")):HF(this,this.pause)}; g.C.seekTo=function(a){if(Ul(this)){if(this.T){var x=Am(this),y=new chrome.cast.media.SeekRequest;y.currentTime=a;x.isPlaying()||x.isBuffering()?y.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:y.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.T.seek(y,g.Xz,VK(this,"seekTo",{newTime:a}))}else Ol(this,"seekTo",{newTime:a});$9n(this,3,a);this.publish("remotePlayerChange")}else HF(this,g.Yy(this.seekTo,a))}; g.C.stop=function(){if(Ul(this)){this.T?this.T.stop(null,g.Xz,VK(this,"stopVideo")):Ol(this,"stopVideo");var a=Am(this);a.index=-1;a.videoId="";WNV(a);im(this,a);this.publish("remotePlayerChange")}else HF(this,this.stop)}; g.C.setVolume=function(a,x){if(Ul(this)){var y=Am(this);if(this.B){if(y.volume!=a){var D=Math.round(a)/100;this.B.setReceiverVolumeLevel(D,(0,g.RP)(function(){Dx("set receiver volume: "+D)},this),(0,g.RP)(function(){this.nJ("failed to set receiver volume.")},this))}y.muted!=x&&this.B.setReceiverMuted(x,(0,g.RP)(function(){Dx("set receiver muted: "+x)},this),(0,g.RP)(function(){this.nJ("failed to set receiver muted.")},this))}else{var M={volume:a, muted:x};y.volume!=-1&&(M.delta=a-y.volume);Ol(this,"setVolume",M)}y.muted=x;y.volume=a;im(this,y)}else HF(this,g.Yy(this.setVolume,a,x))}; g.C.q_=function(a,x){if(Ul(this)){var y=Am(this);a={videoId:a};x&&(y.trackData={trackName:x.name,languageCode:x.languageCode,sourceLanguageCode:x.translationLanguage?x.translationLanguage.languageCode:"",languageName:x.languageName,kind:x.kind},a.style=g.UI(x.style),g.Y2(a,y.trackData));Ol(this,"setSubtitlesTrack",a);im(this,y)}else HF(this,g.Yy(this.q_,a,x))}; g.C.setAudioTrack=function(a,x){Ul(this)?(x=x.getLanguageInfo().getId(),Ol(this,"setAudioTrack",{videoId:a,audioTrackId:x}),a=Am(this),a.audioTrackId=x,im(this,a)):HF(this,g.Yy(this.setAudioTrack,a,x))}; g.C.playVideo=function(a,x,y,D,M,N,F){D=D===void 0?null:D;M=M===void 0?null:M;N=N===void 0?null:N;F=F===void 0?null:F;var c=Am(this),J={videoId:a};y!==void 0&&(J.currentIndex=y);g2(c,a,y||0);x!==void 0&&($a(c,x),J.currentTime=x);D&&(J.listId=D);M&&(J.playerParams=M);N&&(J.clickTrackingParams=N);F&&(J.locationInfo=g.UI(F));Ol(this,"setPlaylist",J);D||im(this,c)}; g.C.E7=function(a,x){if(Ul(this)){if(a&&x){var y=Am(this);g2(y,a,x);im(this,y)}Ol(this,"previous")}else HF(this,g.Yy(this.E7,a,x))}; g.C.nextVideo=function(a,x){if(Ul(this)){if(a&&x){var y=Am(this);g2(y,a,x);im(this,y)}Ol(this,"next")}else HF(this,g.Yy(this.nextVideo,a,x))}; g.C.YM=function(){if(Ul(this)){Ol(this,"clearPlaylist");var a=Am(this);a.reset();im(this,a);this.publish("remotePlayerChange")}else HF(this,this.YM)}; g.C.iD=function(){Ul(this)?Ol(this,"dismissAutoplay"):HF(this,this.iD)}; g.C.dispose=function(){if(this.J!=3){var a=this.J;this.J=3;this.publish("proxyStateChange",a,this.J)}g.Mf.prototype.dispose.call(this)}; g.C.m6=function(){hsG(this);this.U=null;this.N.clear();Rj(this,null);g.Mf.prototype.m6.call(this)}; g.C.D6=function(a){if((a!=this.J||a==2)&&this.J!=3&&a!=0){var x=this.J;this.J=a;this.publish("proxyStateChange",x,a);if(a==1)for(;!this.N.isEmpty();)x=a=this.N,x.T.length===0&&(x.T=x.B,x.T.reverse(),x.B=[]),a.T.pop().apply(this);else a==3&&this.dispose()}}; g.C.Bsc=function(a,x){this.publish(a,x)}; g.C.UG7=function(a){if(!a)this.h2(null),Rj(this,null);else if(this.B.receiver.volume){a=this.B.receiver.volume;var x=Am(this),y=Math.round(100*a.level||0);if(x.volume!=y||x.muted!=a.muted)Dx("Cast volume update: "+a.level+(a.muted?" muted":"")),x.volume=y,x.muted=!!a.muted,im(this,x)}}; g.C.h2=function(a){Dx("Cast media: "+!!a);this.T&&this.T.removeUpdateListener(this.V);if(this.T=a)this.T.addUpdateListener(this.V),ffV(this),this.publish("remotePlayerChange")}; g.C.IKG=function(a){a?(ffV(this),this.publish("remotePlayerChange")):this.h2(null)}; g.C.fm=function(){Ol(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.C.aK8=function(){var a=keF();a&&Rj(this,a)}; g.C.nJ=function(a){jC("CP",a)};g.d(XK,g.Mf);g.C=XK.prototype; g.C.connect=function(a,x){if(x){var y=x.listId,D=x.videoId,M=x.videoIds,N=x.playerParams,F=x.clickTrackingParams,c=x.index,J={videoId:D},G=x.currentTime,Q=x.locationInfo;x=x.loopMode;G!==void 0&&(J.currentTime=G<=5?0:G);N&&(J.playerParams=N);Q&&(J.locationInfo=Q);F&&(J.clickTrackingParams=F);y&&(J.listId=y);M&&M.length>0&&(J.videoIds=M.join(","));c!==void 0&&(J.currentIndex=c);this.yP&&(J.loopMode=x||"LOOP_MODE_OFF");y&&(this.T.listId=y);this.T.videoId=D;this.T.index=c||0;this.T.state=3;$a(this.T, G);this.N="UNSUPPORTED";y=this.yP?"setInitialState":"setPlaylist";r2("Connecting with "+y+" and params: "+g.UI(J));this.B.connect({method:y,params:g.UI(J)},a,a4n())}else r2("Connecting without params"),this.B.connect({},a,a4n());AYF(this)}; g.C.Ja=function(a){this.B.Ja(a)}; g.C.dispose=function(){this.hP()||(g.ky("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),tm(this,3));g.Mf.prototype.dispose.call(this)}; g.C.m6=function(){U9p(this);i6h(this);H67(this);g.n6(this.V);this.V=NaN;g.n6(this.BJ);this.BJ=NaN;this.U=null;g.u8(this.cJ);this.cJ.length=0;this.B.dispose();g.Mf.prototype.m6.call(this);this.N=this.Y=this.J=this.T=this.B=null}; g.C.iB=function(a){if(!this.J||this.J.length===0)return!1;for(var x=g.W(this.J),y=x.next();!y.done;y=x.next())if(!y.value.capabilities.has(a))return!1;return!0}; g.C.vk=function(){var a=3;this.hP()||(a=0,isNaN(this.nE())?this.B.bu()&&isNaN(this.D)&&(a=1):a=2);return a}; g.C.Hh=function(a){r2("Disconnecting with "+a);g.ky("yt.mdx.remote.remoteClient_",null);U9p(this);this.publish("beforeDisconnect",a);a==1&&QI();this.B.disconnect(a);this.dispose()}; g.C.py=function(){var a=this.T;this.U&&(a=this.T.clone(),g2(a,this.U,a.index));return smF(a)}; g.C.k$t=function(a){var x=this,y=new BF(a);y.videoId&&y.videoId!=this.T.videoId&&(this.U=y.videoId,g.n6(this.V),this.V=g.dx(function(){if(x.U){var M=x.U;x.U=null;x.T.videoId!=M&&bm(x,"getNowPlaying")}},5E3)); var D=[];this.T.listId==y.listId&&this.T.videoId==y.videoId&&this.T.index==y.index||D.push("remoteQueueChange");this.T.playerState==y.playerState&&this.T.volume==y.volume&&this.T.muted==y.muted&&fg(this.T)==fg(y)&&g.UI(this.T.trackData)==g.UI(y.trackData)||D.push("remotePlayerChange");this.T.reset(a);g.qJ(D,function(M){this.publish(M)},this)}; g.C.jT=function(){var a=this.B.getDeviceId(),x=g.Xh(this.J,function(y){return y.type=="REMOTE_CONTROL"&&y.id!=a}); return x?x.id:""}; g.C.nE=function(){return this.B.e1()}; g.C.UL=function(){return this.N||"UNSUPPORTED"}; g.C.Wk=function(){return this.Y||""}; g.C.MN=function(){!isNaN(this.nE())&&this.B.yF()}; g.C.wOJ=function(a,x){bm(this,a,x);VMF(this)}; g.C.gt=function(){var a=g.U2("SAPISID","")||g.U2("__Secure-1PAPISID")||"",x=g.U2("__Secure-3PAPISID","")||"";if(!a&&!x)return"";a=g.Hc(g.Uk(a),2);x=g.Hc(g.Uk(x),2);return g.Hc(g.Uk(","+a+","+x),2)}; XK.prototype.subscribe=XK.prototype.subscribe;XK.prototype.unsubscribeByKey=XK.prototype.Zj;XK.prototype.getProxyState=XK.prototype.vk;XK.prototype.disconnect=XK.prototype.Hh;XK.prototype.getPlayerContextData=XK.prototype.py;XK.prototype.setPlayerContextData=XK.prototype.k$t;XK.prototype.getOtherConnectedRemoteId=XK.prototype.jT;XK.prototype.getReconnectTimeout=XK.prototype.nE;XK.prototype.getAutoplayMode=XK.prototype.UL;XK.prototype.getAutoplayVideoId=XK.prototype.Wk;XK.prototype.reconnect=XK.prototype.MN; XK.prototype.sendMessage=XK.prototype.wOJ;XK.prototype.getXsrfToken=XK.prototype.gt;XK.prototype.isCapabilitySupportedOnConnectedDevices=XK.prototype.iB;g.d(DBY,z8);g.C=DBY.prototype;g.C.T5=function(a){return this.Ae.$_gs(a)}; g.C.contains=function(a){return!!this.Ae.$_c(a)}; g.C.get=function(a){return this.Ae.$_g(a)}; g.C.start=function(){this.Ae.$_st()}; g.C.add=function(a,x,y){this.Ae.$_a(a,x,y)}; g.C.remove=function(a,x,y){this.Ae.$_r(a,x,y)}; g.C.wY=function(a,x,y,D){this.Ae.$_un(a,x,y,D)}; g.C.m6=function(){for(var a=this.T.length,x=0;x1&&!this.L.getOption("remote","quickCast")?(this.GT=g.dQ(a,this.T,this),this.gk(g.sk(a,this.T)),a=this.L.getOption("remote","currentReceiver"),a=this.T(a),this.options[a]&&this.uF(a),this.enable(!0)):this.enable(!1)}; Ka.prototype.T=function(a){return a.key}; Ka.prototype.By=function(a){return a==="cast-selector-receiver"?"Cast...":this.GT[a].name}; Ka.prototype.j7=function(a){g.km.prototype.j7.call(this,a);this.L.setOption("remote","currentReceiver",this.GT[a]);this.TY.Nw()};g.d(TXh,g.Lf);g.C=TXh.prototype; g.C.create=function(){var a=this.player.j(),x=g.YL(a);a={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:a.C("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:a.C("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:a.C("enable_cast_short_lived_lounge_token")};c6J(x,a);this.subscriptions.push(g.jX("yt-remote-before-disconnect",this.QjJ,this));this.subscriptions.push(g.jX("yt-remote-connection-change",this.tYP,this));this.subscriptions.push(g.jX("yt-remote-receiver-availability-change",this.Mx, this));this.subscriptions.push(g.jX("yt-remote-auto-connect",this.n_P,this));this.subscriptions.push(g.jX("yt-remote-receiver-resumed",this.Pk7,this));this.subscriptions.push(g.jX("mdx-privacy-popup-confirm",this.GJ1,this));this.subscriptions.push(g.jX("mdx-privacy-popup-cancel",this.Dm7,this));this.Mx()}; g.C.load=function(){this.player.cancelPlayback();g.Lf.prototype.load.call(this);this.P9=new P8G(this.player.j(),this);this.player.VI(this.P9);this.MV=new dBh(this,this.player,this.g0);var a=(a=w3Y())?a.currentTime:0;var x=SNF()?new Ya(NX(),void 0):null;a==0&&x&&(a=fg(Am(x)));a!==0&&this.NG(a);lXs(this,this.kx,this.kx);this.player.hk(6)}; g.C.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.Nk();this.n6=this.jH;g.CD(this.MV,this.g0);this.g0=this.P9=this.MV=null;g.Lf.prototype.unload.call(this);this.player.hk(5);La(this)}; g.C.m6=function(){g.D5(this.subscriptions);g.Lf.prototype.m6.call(this)}; g.C.d7=function(a){var x=g.qY.apply(1,arguments);this.loaded&&this.MV.cI.apply(this.MV,[a].concat(g.tS(x)))}; g.C.getAdState=function(){return this.c9}; g.C.hasPrevious=function(){return this.g0?Am(this.g0).hasPrevious:!1}; g.C.hasNext=function(){return this.g0?Am(this.g0).hasNext:!1}; g.C.NG=function(a,x){this.fP=a||0;this.player.publish("progresssync",a,x);this.player.Bm("onVideoProgress",a||0)}; g.C.getCurrentTime=function(){return this.fP}; g.C.getDuration=function(){return Am(this.g0).getDuration()||0}; g.C.Pm=function(){var a=Am(this.g0);return a.U?a.T+hm(a):a.T}; g.C.q6=function(){return Am(this.g0).loadedTime}; g.C.eb=function(){return E4L(Am(this.g0))}; g.C.fH=function(){var a=Am(this.g0);return a.B>0?a.B+hm(a):a.B}; g.C.getProgressState=function(){var a=Am(this.g0),x=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:a.playerState!=1081&&this.player.Mm(),clipEnd:x.clipEnd,clipStart:x.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.Pm(),isAtLiveHead:this.isAtLiveHead(),loaded:this.q6(),seekableEnd:this.eb(),seekableStart:this.fH(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.C.isAtLiveHead=function(){return E4L(Am(this.g0))-this.getCurrentTime()<=1}; g.C.nextVideo=function(){this.g0&&this.g0.nextVideo()}; g.C.E7=function(){this.g0&&this.g0.E7()}; g.C.QjJ=function(a){a===1&&(this.Rb=this.g0?Am(this.g0):null)}; g.C.tYP=function(){var a=SNF()?new Ya(NX(),void 0):null;if(a){var x=this.n6;this.loaded&&this.unload();this.g0=a;this.Rb=null;x.key!==this.jH.key&&(this.n6=x,this.load())}else g.wg(this.g0),this.g0=null,this.loaded&&(this.unload(),(a=this.Rb)&&a.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(a.videoId,fg(a)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.C.Mx=function(){var a=[this.jH],x=a.concat,y=o3L();WF()&&g.gX("yt-remote-cast-available")&&y.push({key:"cast-selector-receiver",name:"Cast..."});this.GT=x.call(a,y);a=G4p()||this.jH;w3(this,a);this.player.Bm("onMdxReceiversChange")}; g.C.n_P=function(){var a=G4p();w3(this,a)}; g.C.Pk7=function(){this.n6=G4p()}; g.C.GJ1=function(){this.K2=!0;La(this);oa=!1;FG&&c1(FG,1);FG=null}; g.C.Dm7=function(){this.K2=!1;La(this);w3(this,this.jH);this.n6=this.jH;oa=!1;FG=null;this.player.playVideo()}; g.C.qY=function(a,x){switch(a){case "casting":return this.loaded;case "receivers":return this.GT;case "currentReceiver":return x&&(x.key==="cast-selector-receiver"?uVs():w3(this,x)),this.loaded?this.n6:this.jH;case "quickCast":return this.GT.length===2&&this.GT[1].key==="cast-selector-receiver"?(x&&uVs(),!0):!1}}; g.C.fm=function(){this.g0.fm()}; g.C.a5=function(){return!1}; g.C.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.C.isLoggedIn=function(){var a,x;return((a=g.am("PLAYER_CONFIG"))==null?void 0:(x=a.args)==null?void 0:x.authuser)!==void 0?!0:!(!g.am("SESSION_INDEX")&&!g.am("LOGGED_IN"))};g.Kf("remote",TXh);})(_yt_player);