(function(g){var window=this;'use strict';var CYG=function(m){if(m instanceof g.bA)return m;if(typeof m.bC=="function")return m.bC(!1);if(g.cH(m)){var V=0,O=new g.bA;O.next=function(){for(;;){if(V>=m.length)return g.EQ;if(V in m)return g.nT(m[V++]);V++}}; return O}throw Error("Not implemented");},Ea5=function(m,V,O){if(g.cH(m))g.An(m,V,O); else for(m=CYG(m);;){var h=m.next();if(h.done)break;V.call(O,h.value,void 0,m)}},mn=function(m){g.g_(m,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.uz()).toString(36)); return m},Ve=function(m,V,O){Array.isArray(O)||(O=[String(O)]); g.EeI(m.T,V,O)},qgJ=function(m,V){var O=[]; Ea5(V,function(h){try{var w=g.bQ.prototype.RE.call(this,h,!0)}catch(y){if(y=="Storage: Invalid value was encountered")return;throw y;}w===void 0?O.push(h):g.Ywm(w)&&O.push(h)},m); return O},MBJ=function(m,V){qgJ(m,V).forEach(function(O){g.bQ.prototype.remove.call(this,O)},m)},fzA=function(m){if(m.LP){if(m.LP.locationOverrideToken)return{locationOverrideToken:m.LP.locationOverrideToken}; if(m.LP.latitudeE7!=null&&m.LP.longitudeE7!=null)return{latitudeE7:m.LP.latitudeE7,longitudeE7:m.LP.longitudeE7}}return null},xXA=function(m,V){g.vH(m,V)||m.push(V)},Raa=function(m){var V=0,O; for(O in m)V++;return V},oa5=function(m,V){return g.kS(m,V)},gaI=function(m){try{return g.WH.JSON.parse(m)}catch(V){}m=String(m); if(/^\s*$/.test(m)?0:/^[\],:{}\s\u2028\u2029]*$/.test(m.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("("+m+")")}catch(V){}throw Error("Invalid JSON string: "+m);},OK=function(m){if(g.WH.JSON)try{return g.WH.JSON.parse(m)}catch(V){}return gaI(m)},AKc=function(){var m=g.FI(); this.Z=m;m.h7("/client_streamz/youtube/living_room/mdx/channel/opened",g.xr("channel_type"))},UXH=function(){var m=g.FI(); this.Z=m;m.h7("/client_streamz/youtube/living_room/mdx/channel/closed",g.xr("channel_type"))},dXn=function(){var m=g.FI(); this.Z=m;m.h7("/client_streamz/youtube/living_room/mdx/channel/message_received",g.xr("channel_type"))},tBc=function(){var m=g.FI(); this.Z=m;m.h7("/client_streamz/youtube/living_room/mdx/channel/success")},KwJ=function(){var m=g.FI(); this.Z=m;m.h7("/client_streamz/youtube/living_room/mdx/channel/error",g.xr("channel_type"),g.xr("error_type"))},WwM=function(){var m=g.FI(); this.Z=m;m.h7("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},XAn=function(){var m=g.FI(); this.Z=m;m.h7("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},HZh=function(m,V,O,h){var w=new g.d7(null); m&&g.qX(w,m);V&&g.tI(w,V);O&&g.MX(w,O);h&&(w.L=h);return w},T_A=function(m,V){return new g.jF(m,V)},h$=function(m,V){return Object.prototype.hasOwnProperty.call(m,V)},$XM=function(m,V){return m===V},wW=function(m,V){this.L={}; this.Z=[];this.PA=this.size=0;var O=arguments.length;if(O>1){if(O%2)throw Error("Uneven number of arguments");for(var h=0;h5&&(m=m.slice(m.length-5)); var V=g.rb(GVA(),function(h){return h.loungeToken}),O=g.rb(m,function(h){return h.loungeToken}); g.cu(O,function(h){return!g.vH(V,h)})&&pA5(); g.I$("yt-remote-local-screens",m,31536E3)},f1=function(m){m||(g.uF("yt-remote-session-screen-id"),g.uF("yt-remote-session-video-id")); azA();m=qu();g.Om(m,Mu());swA(m)},lzZ=function(){if(!xf){var m=g.zO(); m&&(xf=new g.cD(m))}},QwA=function(){lzZ(); return xf?!!xf.get("yt-remote-use-staging-server"):!1},Rf=function(m,V){g.Pb[m]=!0; var O=g.Qa();O&&O.publish.apply(O,arguments);g.Pb[m]=!1},vaI=function(){var m=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return m?parseInt(m[1],10):0},PY$=function(m){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+m)!=-1||document.currentScript.src.indexOf("&"+m)!=-1)},ma$=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},of=function(m){m.length?VFa(m.shift(),function(){of(m)}):OYW()},hpa=function(m){return"chrome-extension://"+m+"/cast_sender.js"},VFa=function(m,V,O){var h=document.createElement("script"); h.onerror=V;O&&(h.onload=O);g.Ij(h,g.N7(m));(document.head||document.documentElement).appendChild(h)},wDA=function(){var m=vaI(),V=[]; if(m>1){var O=m-1;V.push("//www.gstatic.com/eureka/clank/"+m+"/cast_sender.js");V.push("//www.gstatic.com/eureka/clank/"+O+"/cast_sender.js")}return V},OYW=function(){var m=ma$(); m&&m(!1,"No cast extension found")},jMh=function(){if(yYM){var m=2,V=ma$(),O=function(){m--; m==0&&V&&V(!0)}; window.__onGCastApiAvailable=O;VFa("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",OYW,O)}},LqA=function(){jMh(); var m=wDA();m.push("//www.gstatic.com/eureka/clank/cast_sender.js");of(m)},CQA=function(){jMh(); var m=wDA();m.push.apply(m,g.b(JYZ.map(hpa)));m.push("//www.gstatic.com/eureka/clank/cast_sender.js");of(m)},gW=function(m,V,O){g.Z.call(this); this.N=O!=null?(0,g.IA)(m,O):m;this.QD=V;this.K=(0,g.IA)(this.qh,this);this.Z=!1;this.L=0;this.D=this.b2=null;this.T=[]},A$=function(){this.Z=g.uz()},ENz=function(){UK||(UK=new A$)},qMn=function(){UK||(UK=new A$)},dW=function(){},MFz=function(){g.yc.call(this,"p")},fDJ=function(){g.yc.call(this,"o")},Rp$=function(){return xaG=xaG||new g.dw},oNA=function(m){g.yc.call(this,"serverreachability",m)},t$=function(m){var V=Rp$(); V.dispatchEvent(new oNA(V,m))},gNc=function(m){g.yc.call(this,"statevent",m)},K1=function(m){var V=Rp$(); V.dispatchEvent(new gNc(V,m))},AYz=function(m,V,O,h){g.yc.call(this,"timingevent",m); this.size=V;this.rtt=O;this.retries=h},W4=function(m,V){if(typeof m!=="function")throw Error("Fn must not be null and must be a function"); return g.WH.setTimeout(function(){m()},V)},XF=function(){},H4=function(m,V,O,h){this.D=m; this.T=V;this.CP=O;this.kD=h||1;this.W6=new g.tK(this);this.pA=45E3;this.H6=null;this.N=!1;this.Qt=this.Xr=this.V=this.fA=this.mS=this.nA=this.Zu=null;this.Ae=[];this.Z=null;this.J=0;this.K=this.v6=null;this.Aj=-1;this.EH=!1;this.CA=0;this.Je=null;this.UU=this.Mf=this.LP=this.iH=!1;this.L=new Uah},Uah=function(){this.D=null; this.Z="";this.L=!1},tFz=function(m,V,O){m.fA=1; m.V=mn(V.clone());m.Qt=O;m.iH=!0;da5(m,null)},da5=function(m,V){m.mS=Date.now(); TT(m);m.Xr=m.V.clone();Ve(m.Xr,"t",m.kD);m.J=0;var O=m.D.Mf;m.L=new Uah;m.Z=Kqc(m.D,O?V:null,!m.Qt);m.CA>0&&(m.Je=new g.wO((0,g.IA)(m.A5,m,m.Z),m.CA));m.W6.listen(m.Z,"readystatechange",m.Fo);V=m.H6?g.bX(m.H6):{};m.Qt?(m.v6||(m.v6="POST"),V["Content-Type"]="application/x-www-form-urlencoded",m.Z.send(m.Xr,m.v6,m.Qt,V)):(m.v6="GET",m.Z.send(m.Xr,m.v6,null,V));t$(1)},XDA=function(m){if(!Wqz(m))return g.PU(m.Z); var V=g.mz(m.Z);if(V==="")return"";var O="",h=V.length,w=g.Qc(m.Z)==4;if(!m.L.D){if(typeof TextDecoder==="undefined")return $f(m),Yf(m),"";m.L.D=new g.WH.TextDecoder}for(var y=0;yV.length)return HYz;V=V.slice(h,h+O);m.J=h+O;return V},TT=function(m){m.nA=Date.now()+m.pA; YMz(m,m.pA)},YMz=function(m,V){if(m.Zu!=null)throw Error("WatchDog timer not null"); m.Zu=W4((0,g.IA)(m.Eq,m),V)},kOA=function(m){m.Zu&&(g.WH.clearTimeout(m.Zu),m.Zu=null)},Yf=function(m){m.D.wH()||m.EH||rYc(m.D,m)},$f=function(m){kOA(m); g.Ag(m.Je);m.Je=null;m.W6.removeAll();if(m.Z){var V=m.Z;m.Z=null;V.abort();V.dispose()}},epH=function(m,V){try{var O=m.D; if(O.VC!=0&&(O.Z==m||cYA(O.L,m)))if(!m.Mf&&cYA(O.L,m)&&O.VC==3){try{var h=O.wB.Z.parse(V)}catch(X){h=null}if(Array.isArray(h)&&h.length==3){var w=h;if(w[0]==0)a:{if(!O.V){if(O.Z)if(O.Z.mS+3E30&&(O.CA=1.5*E);h=O;var q=m.MM();if(q){var M=g.Vq(q,"X-Client-Wire-Protocol");if(M){var f=h.L;!f.Z&&(g.P8(M,"spdy")||g.P8(M,"quic")||g.P8(M,"h2"))&&(f.T=f.K,f.Z=new Set,f.L&&(bYc(f,f.L),f.L=null))}if(h.iH){var x=g.Vq(q,"X-HTTP-Session-Id");x&&(h.Y5=x,g.g_(h.H6,h.iH,x))}}O.VC=3;O.K&&O.K.gp();O.Rd&&(O.ma=Date.now()-m.mS);h=O;var R=m;h.BB=nNI(h,h.Mf?h.CP:null,h.Id); if(R.Mf){SMa(h.L,R);var A=R,K=h.CA;K&&A.setTimeout(K);A.Zu&&(kOA(A),TT(A));h.Z=R}else IDh(h);O.D.length>0&&D4(O)}else y[0]!="stop"&&y[0]!="close"||c4(O,7);else O.VC==3&&(y[0]=="stop"||y[0]=="close"?y[0]=="stop"?c4(O,7):O.disconnect():y[0]!="noop"&&O.K&&O.K.Ti(y),O.Ae=0)}t$(4)}catch(X){}},uQh=function(m,V){this.Z=m; this.map=V;this.context=null},zpG=function(m){this.K=m||10; g.WH.PerformanceNavigationTiming?(m=g.WH.performance.getEntriesByType("navigation"),m=m.length>0&&(m[0].nextHopProtocol=="hq"||m[0].nextHopProtocol=="h2")):m=!!(g.WH.chrome&&g.WH.chrome.loadTimes&&g.WH.chrome.loadTimes()&&g.WH.chrome.loadTimes().wasFetchedViaSpdy);this.T=m?this.K:1;this.Z=null;this.T>1&&(this.Z=new Set);this.L=null;this.D=[]},ZYA=function(m){return m.L?!0:m.Z?m.Z.size>=m.T:!1},NOI=function(m){return m.L?1:m.Z?m.Z.size:0},cYA=function(m,V){return m.L?m.L==V:m.Z?m.Z.has(V):!1},bYc= function(m,V){m.Z?m.Z.add(V):m.L=V},SMa=function(m,V){m.L&&m.L==V?m.L=null:m.Z&&m.Z.has(V)&&m.Z.delete(V)},sMI=function(m){if(m.L!=null)return m.D.concat(m.L.Ae); if(m.Z!=null&&m.Z.size!==0){var V=m.D;m=g.D(m.Z.values());for(var O=m.next();!O.done;O=m.next())V=V.concat(O.value.Ae);return V}return g.j5(m.D)},Fqn=function(m,V){var O=new XF; if(g.WH.Image){var h=new Image;h.onload=g.e$(Nu,O,"TestLoadImage: loaded",!0,V,h);h.onerror=g.e$(Nu,O,"TestLoadImage: error",!1,V,h);h.onabort=g.e$(Nu,O,"TestLoadImage: abort",!1,V,h);h.ontimeout=g.e$(Nu,O,"TestLoadImage: timeout",!1,V,h);g.WH.setTimeout(function(){if(h.ontimeout)h.ontimeout()},1E4); h.src=m}else V(!1)},aD$=function(m,V){var O=new XF,h=new AbortController,w=setTimeout(function(){h.abort(); Nu(O,"TestPingServer: timeout",!1,V)},1E4); fetch(m,{signal:h.signal}).then(function(y){clearTimeout(w);y.ok?Nu(O,"TestPingServer: ok",!0,V):Nu(O,"TestPingServer: server error",!1,V)}).catch(function(){clearTimeout(w); Nu(O,"TestPingServer: error",!1,V)})},Nu=function(m,V,O,h,w){try{w&&(w.onload=null,w.onerror=null,w.onabort=null,w.ontimeout=null),h(O)}catch(y){}},iYH=function(){this.Z=new dW},bM=function(m,V,O){return O&&O.R3e?O.R3e[m]||V:V},GOZ=function(m){this.D=[]; this.CP=this.BB=this.H6=this.Id=this.Z=this.Y5=this.iH=this.EH=this.J=this.LP=this.Qt=null;this.nf=this.Xr=0;this.GB=bM("failFast",!1,m);this.Je=this.Zu=this.V=this.N=this.K=null;this.nP=!0;this.l2=this.fA=-1;this.kD=this.Ae=this.mS=0;this.VF=bM("baseRetryDelayMs",5E3,m);this.SW=bM("retryDelaySeedMs",1E4,m);this.VV=bM("forwardChannelMaxRetries",2,m);this.uc=bM("forwardChannelRequestTimeoutMs",2E4,m);this.iU=m&&m.RBe||void 0;this.IF=m&&m.Clu||void 0;this.Wj=m&&m.lSe||!1;this.CA=void 0;this.Mf=m&&m.zdz|| !1;this.T="";this.L=new zpG(m&&m.m3H);this.tq=Math.min(m&&m.a2N||1E3,1E3);this.wB=new iYH;this.W6=m&&m.bEu||!1;this.nA=m&&m.M1e||!1;this.W6&&this.nA&&(this.nA=!1);this.WW=m&&m.hJA||!1;m&&m.Chu&&(this.nP=!1);this.Rd=!this.W6&&this.nP&&m&&m.vbe||!1;this.qq=void 0;m&&m.Gx&&m.Gx>0&&(this.qq=m.Gx);this.Aj=void 0;this.ma=0;this.pA=!1;this.UU=this.v6=null},rW=function(m){m.Z&&(pDW(m),m.Z.cancel(),m.Z=null)},BOc=function(m){rW(m); m.V&&(g.WH.clearTimeout(m.V),m.V=null);kf(m);m.L.cancel();m.N&&(typeof m.N==="number"&&g.WH.clearTimeout(m.N),m.N=null)},D4=function(m){ZYA(m.L)||m.N||(m.N=!0,g.rw(m.DC,m),m.mS=0)},QM$=function(m,V){if(NOI(m.L)>=m.L.T-(m.N?1:0))return!1; if(m.N)return m.D=V.Ae.concat(m.D),!0;if(m.VC==1||m.VC==2||m.mS>=(m.GB?0:m.VV))return!1;m.N=W4((0,g.IA)(m.DC,m,V),lDz(m,m.mS));m.mS++;return!0},PQc=function(m,V){var O; V?O=V.CP:O=m.Xr++;var h=m.H6.clone();g.g_(h,"SID",m.T);g.g_(h,"RID",O);g.g_(h,"AID",m.fA);n1(m,h);m.J&&m.Qt&&g.d_(h,m.J,m.Qt);O=new H4(m,m.T,O,m.mS+1);m.J===null&&(O.H6=m.Qt);V&&(m.D=V.Ae.concat(m.D));V=vN5(m,O,m.tq);O.setTimeout(Math.round(m.uc*.5)+Math.round(m.uc*.5*Math.random()));bYc(m.L,O);tFz(O,h,V)},n1=function(m,V){m.EH&&g.Mm(m.EH,function(O,h){g.g_(V,h,O)}); m.K&&g.Mm({},function(O,h){g.g_(V,h,O)})},vN5=function(m,V,O){O=Math.min(m.D.length,O); var h=m.K?(0,g.IA)(m.K.Yp,m.K,m):null;a:{for(var w=m.D,y=-1;;){var L=["count="+O];y==-1?O>0?(y=w[0].Z,L.push("ofs="+y)):y=0:L.push("ofs="+y);for(var C=!0,E=0;E=3)return!1; m.kD++;m.V=W4((0,g.IA)(m.Lt,m),lDz(m,m.Ae));m.Ae++;return!0},pDW=function(m){m.v6!=null&&(g.WH.clearTimeout(m.v6),m.v6=null)},m7A=function(m){m.Z=new H4(m,m.T,"rpc",m.kD); m.J===null&&(m.Z.H6=m.Qt);m.Z.CA=0;var V=m.BB.clone();g.g_(V,"RID","rpc");g.g_(V,"SID",m.T);g.g_(V,"AID",m.fA);g.g_(V,"CI",m.Je?"0":"1");!m.Je&&m.qq&&g.g_(V,"TO",m.qq);g.g_(V,"TYPE","xmlhttp");n1(m,V);m.J&&m.Qt&&g.d_(V,m.J,m.Qt);m.CA&&m.Z.setTimeout(m.CA);var O=m.Z;m=m.CP;O.fA=1;O.V=mn(V.clone());O.Qt=null;O.iH=!0;da5(O,m)},kf=function(m){m.Zu!=null&&(g.WH.clearTimeout(m.Zu),m.Zu=null)},rYc=function(m,V){var O=null; if(m.Z==V){kf(m);pDW(m);m.Z=null;var h=2}else if(cYA(m.L,V))O=V.Ae,SMa(m.L,V),h=1;else return;if(m.VC!=0)if(V.N)if(h==1){O=V.Qt?V.Qt.length:0;V=Date.now()-V.mS;var w=m.mS;h=Rp$();h.dispatchEvent(new AYz(h,O,V,w));D4(m)}else IDh(m);else{var y=V.Aj;w=V.getLastError();if(w==3||w==0&&y>0||!(h==1&&QM$(m,V)||h==2&&Dac(m)))switch(O&&O.length>0&&(V=m.L,V.D=V.D.concat(O)),w){case 1:c4(m,5);break;case 4:c4(m,10);break;case 3:c4(m,6);break;default:c4(m,2)}}},lDz=function(m,V){var O=m.VF+Math.floor(Math.random()* m.SW); m.isActive()||(O*=2);return O*V},c4=function(m,V){if(V==2){var O=(0,g.IA)(m.KO6,m),h=m.IF,w=!h; h=new g.d7(h||"//www.google.com/images/cleardot.gif");g.WH.location&&g.WH.location.protocol=="http"||g.qX(h,"https");mn(h);w?Fqn(h.toString(),O):aD$(h.toString(),O)}else K1(2);m.VC=0;m.K&&m.K.zi(V);VkJ(m);BOc(m)},VkJ=function(m){m.VC=0; m.UU=[];if(m.K){var V=sMI(m.L);if(V.length!=0||m.D.length!=0)g.L9(m.UU,V),g.L9(m.UU,m.D),m.L.D.length=0,g.j5(m.D),m.D.length=0;m.K.I_()}},OeA=function(m){if(m.VC==0)return m.UU; var V=[];g.L9(V,sMI(m.L));g.L9(V,m.D);return V},nNI=function(m,V,O){var h=g.IC(O); h.Z!=""?(V&&g.tI(h,V+"."+h.Z),g.MX(h,h.D)):(h=g.WH.location,h=HZh(h.protocol,V?V+"."+h.hostname:h.hostname,+h.port,O));V=m.iH;O=m.Y5;V&&O&&g.g_(h,V,O);g.g_(h,"VER",m.c$);n1(m,h);return h},Kqc=function(m,V,O){if(V&&!m.Mf)throw Error("Can't create secondary domain capable XhrIo object."); V=m.Wj&&!m.iU?new g.pt(new g.LZ({Pd:O})):new g.pt(m.iU);V.J=m.Mf;return V},hAA=function(){},wh$=function(){},If=function(m,V){g.dw.call(this); this.Z=new GOZ(V);this.K=m;this.L=V&&V.VUS||null;m=V&&V.jrN||null;V&&V.d3t&&(m?m["X-Client-Protocol"]="webchannel":m={"X-Client-Protocol":"webchannel"});this.Z.Qt=m;m=V&&V.iVN||null;V&&V.ow&&(m?m["X-WebChannel-Content-Type"]=V.ow:m={"X-WebChannel-Content-Type":V.ow});V&&V.I7&&(m?m["X-WebChannel-Client-Profile"]=V.I7:m={"X-WebChannel-Client-Profile":V.I7});this.Z.LP=m;(m=V&&V.z1A)&&!g.v8(m)&&(this.Z.J=m);this.N=V&&V.zdz||!1;this.T=V&&V.KAf||!1;(V=V&&V.VzS)&&!g.v8(V)&&(this.Z.iH=V,g.YS(this.L,V)&&(m= this.L,V in m&&delete m[V]));this.D=new Si(this)},yxh=function(m){MFz.call(this); m.__headers__&&(this.headers=m.__headers__,this.statusCode=m.__status__,delete m.__headers__,delete m.__status__);var V=m.__sm__;V?this.data=(this.Z=g.Xp(V))?g.DE(V,this.Z):V:this.data=m},j8I=function(m){fDJ.call(this); this.status=1;this.errorCode=m},Si=function(m){this.Z=m},LPH=function(m,V){this.L=m; this.Z=V},JxZ=function(m){return OeA(m.Z).map(function(V){var O=m.L; V=V.map;"__data__"in V?(V=V.__data__,O=O.T?gaI(V):V):O=V;return O})},ei=function(m,V){if(typeof m!=="function")throw Error("Fn must not be null and must be a function"); return g.WH.setTimeout(function(){m()},V)},zT=function(m){uM.dispatchEvent(new CjI(uM,m))},CjI=function(m){g.yc.call(this,"statevent",m)},Z4=function(m,V,O,h){this.Z=m; this.T=V;this.J=O;this.N=h||1;this.L=45E3;this.D=new g.tK(this);this.K=new g.ug;this.K.setInterval(250)},qnG=function(m,V,O){m.ao=1; m.Mg=mn(V.clone());m.BA=O;m.iH=!0;EFZ(m,null)},Mkn=function(m,V,O,h,w){m.ao=1; m.Mg=mn(V.clone());m.BA=null;m.iH=O;w&&(m.Bz=!1);EFZ(m,h)},EFZ=function(m,V){m.Ng=Date.now(); fCJ(m);m.X5=m.Mg.clone();Ve(m.X5,"t",m.N);m.sO=0;m.Eu=m.Z.tB(m.Z.JD()?V:null);m.o2>0&&(m.e7=new g.wO((0,g.IA)(m.v$,m,m.Eu),m.o2));m.D.listen(m.Eu,"readystatechange",m.Mh);V=m.pS?g.bX(m.pS):{};m.BA?(m.OO="POST",V["Content-Type"]="application/x-www-form-urlencoded",m.Eu.send(m.X5,m.OO,m.BA,V)):(m.OO="GET",m.Bz&&!g.Xm&&(V.Connection="close"),m.Eu.send(m.X5,m.OO,null,V));m.Z.Rt(1)},oFH=function(m,V){var O=m.sO,h=V.indexOf("\n",O); if(h==-1)return x75;O=Number(V.substring(O,h));if(isNaN(O))return RAa;h+=1;if(h+O>V.length)return x75;V=V.slice(h,h+O);m.sO=h+O;return V},fCJ=function(m){m.P4=Date.now()+m.L; gFM(m,m.L)},gFM=function(m,V){if(m.Jl!=null)throw Error("WatchDog timer not null"); m.Jl=ei((0,g.IA)(m.kp,m),V)},Ax$=function(m){m.Jl&&(g.WH.clearTimeout(m.Jl),m.Jl=null)},U7a=function(m){m.Z.wH()||m.P0||m.Z.JB(m)},sK=function(m){Ax$(m); g.Ag(m.e7);m.e7=null;m.K.stop();m.D.removeAll();if(m.Eu){var V=m.Eu;m.Eu=null;V.abort();V.dispose()}m.Zh&&(m.Zh=null)},d7z=function(m,V){try{m.Z.Gi(m,V),m.Z.Rt(4)}catch(O){}},KPJ=function(m,V,O,h,w){if(h==0)O(!1); else{var y=w||0;h--;tkM(m,V,function(L){L?O(!0):g.WH.setTimeout(function(){KPJ(m,V,O,h,y)},y)})}},tkM=function(m,V,O){var h=new Image; h.onload=function(){try{FF(h),O(!0)}catch(w){}}; h.onerror=function(){try{FF(h),O(!1)}catch(w){}}; h.onabort=function(){try{FF(h),O(!1)}catch(w){}}; h.ontimeout=function(){try{FF(h),O(!1)}catch(w){}}; g.WH.setTimeout(function(){if(h.ontimeout)h.ontimeout()},V); h.src=m},FF=function(m){m.onload=null; m.onerror=null;m.onabort=null;m.ontimeout=null},WPA=function(m){this.Z=m; this.L=new dW},Xha=function(m){var V=af(m.Z,m.UY,"/mail/images/cleardot.gif"); mn(V);KPJ(V.toString(),5E3,(0,g.IA)(m.l9,m),3,2E3);m.Rt(1)},He$=function(m){var V=m.Z.N; V!=null?(zT(5),V?(zT(11),iM(m.Z,m,!1)):(zT(12),iM(m.Z,m,!0))):(m.nU=new Z4(m),m.nU.pS=m.Nw,V=m.Z,V=af(V,V.JD()?m.rS:null,m.XO),zT(5),Ve(V,"TYPE","xmlhttp"),Mkn(m.nU,V,!1,m.rS,!1))},TSJ=function(m,V,O){this.Z=1; this.L=[];this.D=[];this.K=new dW;this.Qt=m||null;this.N=V!=null?V:null;this.V=O||!1},$7A=function(m,V){this.Z=m; this.map=V;this.context=null},Ynn=function(m,V,O,h){g.yc.call(this,"timingevent",m); this.size=V;this.rtt=O;this.retries=h},kgZ=function(m){g.yc.call(this,"serverreachability",m)},cxn=function(m){m.o3(1,0); m.wS=af(m,null,m.sD);rxI(m)},D7A=function(m){m.y4&&(m.y4.abort(),m.y4=null); m.QC&&(m.QC.cancel(),m.QC=null);m.jh&&(g.WH.clearTimeout(m.jh),m.jh=null);B4(m);m.ye&&(m.ye.cancel(),m.ye=null);m.j1&&(g.WH.clearTimeout(m.j1),m.j1=null)},NSn=function(m,V){if(m.Z==0)throw Error("Invalid operation: sending map when state is closed"); m.L.push(new $7A(m.Pq++,V));m.Z!=2&&m.Z!=3||rxI(m)},bec=function(m){var V=0; m.QC&&V++;m.ye&&V++;return V},rxI=function(m){m.ye||m.j1||(m.j1=ei((0,g.IA)(m.yE,m),0),m.Ov=0)},ICh=function(m,V){if(m.Z==1){if(!V){m.Xt=Math.floor(Math.random()*1E5); V=m.Xt++;var O=new Z4(m,"",V);O.pS=m.Os;var h=nFa(m),w=m.wS.clone();g.g_(w,"RID",V);g.g_(w,"CVER","1");lM(m,w);qnG(O,w,h);m.ye=O;m.Z=2}}else m.Z==3&&(V?SnW(m,V):m.L.length==0||m.ye||SnW(m))},SnW=function(m,V){if(V)if(m.xj>6){m.L=m.D.concat(m.L); m.D.length=0;var O=m.Xt-1;V=nFa(m)}else O=V.J,V=V.BA;else O=m.Xt++,V=nFa(m);var h=m.wS.clone();g.g_(h,"SID",m.T);g.g_(h,"RID",O);g.g_(h,"AID",m.r8);lM(m,h);O=new Z4(m,m.T,O,m.Ov+1);O.pS=m.Os;O.setTimeout(1E4+Math.round(1E4*Math.random()));m.ye=O;qnG(O,h,V)},lM=function(m,V){m.nC&&(m=m.nC.Mu())&&g.Mm(m,function(O,h){g.g_(V,h,O)})},nFa=function(m){var V=Math.min(m.L.length,1E3),O=["count="+V]; if(m.xj>6&&V>0){var h=m.L[0].Z;O.push("ofs="+h)}else h=0;for(var w={},y=0;y=3)return!1; m.J++;m.jh=ei((0,g.IA)(m.UE,m),uiW(m,m.Xq));m.Xq++;return!0},iM=function(m,V,O){m.jB=m.N==null?O:!m.N; m.Db=V.xe;m.V||cxn(m)},B4=function(m){m.jp!=null&&(g.WH.clearTimeout(m.jp),m.jp=null)},uiW=function(m,V){var O=5E3+Math.floor(Math.random()*1E4); m.isActive()||(O*=2);return O*V},Qe=function(m,V){if(V==2||V==9){var O=null; m.nC&&(O=null);var h=(0,g.IA)(m.GQe,m);O||(O=new g.d7("//www.google.com/images/cleardot.gif"),mn(O));tkM(O.toString(),1E4,h)}else zT(2);ZeJ(m,V)},ZeJ=function(m,V){m.Z=0; m.nC&&m.nC.EE(V);s8c(m);D7A(m)},s8c=function(m){m.Z=0; m.Db=-1;if(m.nC)if(m.D.length==0&&m.L.length==0)m.nC.rG();else{var V=g.j5(m.D),O=g.j5(m.L);m.D.length=0;m.L.length=0;m.nC.rG(V,O)}},af=function(m,V,O){var h=g.IC(O); if(h.Z!="")V&&g.tI(h,V+"."+h.Z),g.MX(h,h.D);else{var w=window.location;h=HZh(w.protocol,V?V+"."+w.hostname:w.hostname,+w.port,O)}m.ek&&g.Mm(m.ek,function(y,L){g.g_(h,L,y)}); g.g_(h,"VER",m.xj);lM(m,h);return h},FPH=function(){},aCW=function(){this.Z=[]; this.L=[]},ieA=function(m){g.yc.call(this,"channelMessage"); this.message=m},Ggn=function(m){g.yc.call(this,"channelError"); this.error=m},ph5=function(m,V){this.action=m; this.params=V||{}},v4=function(m,V){g.Z.call(this); this.Z=new g.mq(this.cRe,0,this);g.a(this,this.Z);this.QD=5E3;this.retryCount=this.j2=0;if(typeof m==="function")V&&(m=(0,g.IA)(m,V));else if(m&&typeof m.handleEvent==="function")m=(0,g.IA)(m.handleEvent,m);else throw Error("Invalid listener argument");this.L=m},BSM=function(m,V,O,h,w,y,L,C,E,q,M,f,x,R,A,K){var X=this; O=O===void 0?!1:O;h=h===void 0?function(){return""}:h; w=w===void 0?!1:w;y=y===void 0?!1:y;L=L===void 0?!1:L;C=C===void 0?function(){return g.bg({})}:C; E=E===void 0?!1:E;M=M===void 0?!1:M;f=f===void 0?!1:f;x=x===void 0?!1:x;R=R===void 0?!1:R;this.Je=m;this.mS=V;this.V=new g.rO;this.N=K;this.L=(this.D=!!A)?A(function(){X.hx()}):new v4(this.hx,this); this.Z=null;this.Qt=!1;this.Ae=null;this.iH="";this.v6=this.Zu=0;this.T=[];this.CP=O;this.H6=h;this.J=y;this.Mf=C;this.fA=q;this.Id=L;this.EH=null;this.K=g.bg();this.nP=w;this.kD=E;this.LP=M;this.Aj=f;this.Rd=x;this.UU=R;this.nA=new AKc;this.Xr=new UXH;this.W6=new tBc;this.pA=new dXn;this.CA=new KwJ;this.ma=new WwM;this.qq=new XAn},vFn=function(m,V,O,h,w){lC$(m); if(m.Z){var y=g.Vf("ID_TOKEN"),L=m.Z.Os||{};y?L["x-youtube-identity-token"]=y:delete L["x-youtube-identity-token"];m.Z.Os=L}Q8z(m);h?(h.getState()!=3&&bec(h)==0||h.getState(),m.Z.connect(V,O,m.mS,h.T,h.r8)):w?m.Z.connect(V,O,m.mS,w.sessionId,w.arrayId):m.Z.connect(V,O,m.mS);m.D&&!m.L.isActive()&&m.L.start();m.N&&m.N.bSS()},OJI=function(m,V){return m.Rd?!0:m.Aj?Object.values(Pj$).includes(V):m.LP?!Object.values(mBZ).includes(V):m.UU?Object.values(V6c).includes(V):!1},y6H=function(m){var V,O; g.u(function(h){if(h.Z==1)return g.C5(h,2),g.I(h,hic(m),2);g.MA(h);V=m.T;m.T=[];O=V.length;w7c(m,V,O);P4(m);return g.f5(h,0)})},w7c=function(m,V,O){for(var h=0;h0?O=Object.assign({},O,V):delete O.Authorization;m.Z.Os=O}},Q8z=function(m){m.fA&&!m.J&<Z(m,m.fA())},mI=function(m){this.scheme="https"; this.port=this.domain="";this.Z="/api/lounge";this.L=!0;m=m||document.location.href;var V=Number(g.XA(m)[4]||null)||"";V&&(this.port=":"+V);this.domain=g.HG(m)||"";m=g.wX();m.search("MSIE")>=0&&(m=m.match(/MSIE ([\d.]+)/)[1],g.hV(m,"10.0")<0&&(this.L=!1))},Vm=function(m,V){var O=m.Z; m.L&&(O=m.scheme+"://"+m.domain+m.port+m.Z);return g.N_(O+V,{})},J6c=function(m,V){g.dw.call(this); var O=this;this.handler=m();this.handler.subscribe("handlerOpened",this.Ji,this);this.handler.subscribe("handlerClosed",this.onClosed,this);this.handler.subscribe("handlerError",function(h,w){O.onError(w)}); this.handler.subscribe("handlerMessage",this.onMessage,this);this.Z=V},CBa=function(m,V,O){var h=this; O=O===void 0?function(){return""}:O; var w=w===void 0?new wh$:w;var y=y===void 0?new g.rO:y;this.pathPrefix=m;this.Z=V;this.mS=O;this.K=y;this.V=null;this.Qt=this.J=0;this.channel=null;this.N=0;this.D=new v4(function(){h.D.isActive();var L;((L=h.channel)==null?void 0:NOI((new LPH(L,L.Z)).Z.L))===0&&h.connect(h.V,h.J)}); this.T={};this.L={};this.Zu=!1;this.logger=null;this.Ae=[];this.P2=void 0;this.H6=new AKc;this.v6=new UXH;this.EH=new dXn;this.iH=new KwJ},E4Z=function(m){g.ft(m.channel,"m",function(){m.N=3; m.D.reset();m.V=null;m.J=0;for(var V=g.D(m.Ae),O=V.next();!O.done;O=V.next())O=O.value,m.channel&&m.channel.send(O);m.Ae=[];m.publish("webChannelOpened");m.H6.qC("WEB_CHANNEL")}); g.ft(m.channel,"n",function(){m.N=0;m.D.isActive()||m.publish("webChannelClosed");var V,O=(V=m.channel)==null?void 0:JxZ(new LPH(V,V.Z));O&&(m.Ae=[].concat(g.b(O)));m.v6.qC("WEB_CHANNEL")}); g.ft(m.channel,"p",function(V){var O=V.data;O[0]==="gracefulReconnect"?(m.D.start(),m.channel&&m.channel.close()):m.publish("webChannelMessage",new ph5(O[0],O[1]));m.P2=V.statusCode;m.EH.qC("WEB_CHANNEL")}); g.ft(m.channel,"o",function(){m.P2===401||m.D.start();m.publish("webChannelError");m.iH.qC("WEB_CHANNEL","")})},qxh=function(m){var V=m.mS(); V?m.T["x-youtube-lounge-xsrf-token"]=V:delete m.T["x-youtube-lounge-xsrf-token"]},M6$=function(m){g.dw.call(this); this.Z=m();this.Z.subscribe("webChannelOpened",this.eZ,this);this.Z.subscribe("webChannelClosed",this.onClosed,this);this.Z.subscribe("webChannelError",this.onError,this);this.Z.subscribe("webChannelMessage",this.onMessage,this)},fHZ=function(m,V,O,h,w){function y(){return new BSM(Vm(m,"/bc"),V,!1,O,h)} O=O===void 0?function(){return""}:O; return g.Tm("enable_mdx_web_channel_desktop")?new M6$(function(){return new CBa(Vm(m,"/wc"),V,O)}):new J6c(y,w)},g4W=function(){var m=xBh; Ri$();O8.push(m);o4a()},hA=function(m,V){Ri$(); var O=A6W(m,String(V));O8.length==0?UBZ(O):(o4a(),g.An(O8,function(h){h(O)}))},wl=function(m){hA("CP",m)},Ri$=function(){O8||(O8=g.$I("yt.mdx.remote.debug.handlers_")||[],g.TZ("yt.mdx.remote.debug.handlers_",O8))},UBZ=function(m){var V=(ym+1)%50; ym=V;jT[V]=m;Lv||(Lv=V==49)},o4a=function(){var m=O8; if(jT[0]){var V=Lv?ym:-1,O={};do O={Kn:void 0},V=(V+1)%50,O.Kn=jT[V],g.An(m,function(h){return function(w){w(h.Kn)}}(O)); while(V!=ym);jT=Array(50);ym=-1;Lv=!1}},A6W=function(m,V){var O=(Date.now()-dBh)/1E3; O.toFixed&&(O=O.toFixed(3));var h=[];h.push("[",O+"s","] ");h.push("[","yt.mdx.remote","] ");h.push(m+": "+V,"\n");return h.join("")},JA=function(m){g.yh.call(this); this.N=m;this.screens=[]},t6A=function(m,V){var O=m.get(V.uuid)||m.get(V.id); if(O)return m=O.name,O.id=V.id||O.id,O.name=V.name,O.token=V.token,O.uuid=V.uuid||O.uuid,O.name!=m;m.screens.push(V);return!0},KTA=function(m,V){var O=m.screens.length!=V.length; m.screens=g.uA(m.screens,function(y){return!!u05(V,y)}); for(var h=V.length,w=0;w0&&m.T0&&tA(m,O)},function(V){m.K=function(){}; m.jm(V)})},v4z=function(m){var V={}; V.pairingCode=m.v6;V.theme=m.fA;QwA()&&(V.env_useStageMdx=1);return g.DV(V)},PBa=function(m){return new Promise(function(V){m.v6=IzZ(); if(m.H6){var O=new chrome.cast.DialLaunchResponse(!0,v4z(m));V(O);QvG(m)}else m.Zu=function(){g.W7(m.Qt);m.Zu=function(){}; m.Qt=NaN;var h=new chrome.cast.DialLaunchResponse(!0,v4z(m));V(h);QvG(m)},m.Qt=g.t6(function(){m.Zu()},100)})},VUa=function(m,V,O){m.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(V)); var h=new L1(V);return(new Promise(function(w){m2A(m,h,function(y){y?(m.Ae=!0,xM(m.T,h),oD(m,h),tA(m,O)):g.wt(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(V)+" is not online."));w(y)},5)})).then(function(w){return w?new chrome.cast.DialLaunchResponse(!1):PBa(m)})},OpA=function(m,V){var O=m.V.receiver.label,h=m.L.friendlyName; return(new Promise(function(w){bJW(m.T,O,V,h,function(y){y&&y.token&&oD(m,y);w(y)},function(y){gl(m,"Failed to get DIAL screen: "+y); w(null)})})).then(function(w){return w&&w.token?new chrome.cast.DialLaunchResponse(!1):PBa(m)})},m2A=function(m,V,O,h){g.W7(m.N); m.N=0;SxA(m.T,V,function(w){w||h<0?O(w):m.N=g.t6(function(){m2A(m,V,O,h-1)},300)})},tA=function(m,V){m.info("getDialAppInfoWithTimeout_ "+V); dl(m)&&(g.W7(m.J),m.J=0,V==0?hyG(m):m.J=g.t6(function(){hyG(m)},V))},hyG=function(m){dl(m)&&m.D.getDialAppInfo(function(V){m.info("getDialAppInfo dialLaunchData: "+JSON.stringify(V)); V=V.extraData||{};var O=null;if(V.loungeToken){var h;((h=m.Z)==null?void 0:h.token)==V.loungeToken&&(O="staleLoungeToken")}else O="missingLoungeToken";O?(m.mS=O,tA(m,3E4)):(m.Ae=!1,m.mS="unknown",ziA(m,V.loungeToken),tA(m,V.loungeTokenRefreshIntervalMs))},function(V){m.info("getDialAppInfo error: "+V); m.mS="noLoungeTokenResponse";tA(m,3E4)})},wZA=function(m){g.W7(m.N); m.N=0;g.W7(m.J);m.J=0;m.K();m.K=function(){}; g.W7(m.Qt)},Kv=function(m,V){RD.call(this,m,V,"ManualSession"); this.D=g.t6((0,g.IA)(this.Xe,this,null),150)},WR=function(m,V){g.yh.call(this); this.config_=V;this.L=m;this.V=V.appId||"233637DE";this.T=V.theme||"cl";this.Qt=V.disableCastApi||!1;this.N=V.forceMirroring||!1;this.Z=null;this.J=!1;this.D=[];this.K=(0,g.IA)(this.HfH,this)},y8J=function(m,V){return V?g.p5(m.D,function(O){return J$(V,O.label)},m):null},XH=function(m){hA("Controller",m)},xBh=function(m){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(m)},HR=function(m){return m.J||!!m.D.length||!!m.Z},T2=function(m,V,O){V!=m.Z&&(g.Ag(m.Z),(m.Z=V)?(O?m.publish("yt-remote-cast2-receiver-resumed", V.L):m.publish("yt-remote-cast2-receiver-selected",V.L),V.subscribe("sessionScreen",(0,g.IA)(m.PO,m,V)),V.subscribe("sessionFailed",function(){return j$z(m,V)}),V.Z?m.publish("yt-remote-cast2-session-change",V.Z):O&&m.Z.Xe(null)):m.publish("yt-remote-cast2-session-change",null))},j$z=function(m,V){m.Z==V&&m.publish("yt-remote-cast2-session-failed")},LB$=function(m){var V=m.L.o_(),O=m.Z&&m.Z.L; m=g.rb(V,function(h){O&&J$(h,O.label)&&(O=null);var w=h.uuid?h.uuid:h.id,y=y8J(this,h);y?(y.label=w,y.friendlyName=h.name):(y=new chrome.cast.Receiver(w,h.name),y.receiverType=chrome.cast.ReceiverType.CUSTOM);return y},m); O&&(O.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(O=new chrome.cast.Receiver(O.label,O.friendlyName),O.receiverType=chrome.cast.ReceiverType.CUSTOM),m.push(O));return m},RyG=function(m,V,O,h){h.disableCastApi?$M("Cannot initialize because disabled by Mdx config."):J8W()?CFH(V,h)&&(Ek5(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?qbA(m,O):(window.__onGCastApiAvailable=function(w,y){w?qbA(m,O):(YM("Failed to load cast API: "+y),MUA(!1),Ek5(!1),g.uF("yt-remote-cast-available"),g.uF("yt-remote-cast-receiver"), fNI(),O(!1))},h.loadCastApiSetupScript?g.wo(x2J):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?vaI()>=60&&LqA():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?OYW():vaI()>=89?CQA():(jMh(),of(JYZ.map(hpa))))):$M("Cannot initialize because not running Chrome")},fNI=function(){$M("dispose"); var m=kM();m&&m.dispose();g.TZ("yt.mdx.remote.cloudview.instance_",null);okI(!1);g.OL(gkn);gkn.length=0},rl=function(){return!!g.eU("yt-remote-cast-installed")},A8$=function(){var m=g.eU("yt-remote-cast-receiver"); return m?m.friendlyName:null},U2A=function(){$M("clearCurrentReceiver"); g.uF("yt-remote-cast-receiver")},d2h=function(){return rl()?kM()?kM().getCastSession():(YM("getCastSelector: Cast is not initialized."),null):(YM("getCastSelector: Cast API is not installed!"),null)},tUh=function(){rl()?kM()?cR()?($M("Requesting cast selector."),kM().requestSession()):($M("Wait for cast API to be ready to request the session."),gkn.push(g.V4("yt-remote-cast2-api-ready",tUh))):YM("requestCastSelector: Cast is not initialized."):YM("requestCastSelector: Cast API is not installed!")}, Dd=function(m,V){cR()?kM().setConnectedScreenStatus(m,V):YM("setConnectedScreenStatus called before ready.")},J8W=function(){var m=g.wX().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.q3||m},KBn=function(m,V){kM().init(m,V)},CFH=function(m,V){var O=!1; kM()||(m=new WR(m,V),m.subscribe("yt-remote-cast2-availability-change",function(h){g.I$("yt-remote-cast-available",h);Rf("yt-remote-cast2-availability-change",h)}),m.subscribe("yt-remote-cast2-receiver-selected",function(h){$M("onReceiverSelected: "+h.friendlyName); g.I$("yt-remote-cast-receiver",h);Rf("yt-remote-cast2-receiver-selected",h)}),m.subscribe("yt-remote-cast2-receiver-resumed",function(h){$M("onReceiverResumed: "+h.friendlyName); g.I$("yt-remote-cast-receiver",h);Rf("yt-remote-cast2-receiver-resumed",h)}),m.subscribe("yt-remote-cast2-session-change",function(h){$M("onSessionChange: "+C1(h)); h||g.uF("yt-remote-cast-receiver");Rf("yt-remote-cast2-session-change",h)}),g.TZ("yt.mdx.remote.cloudview.instance_",m),O=!0); $M("cloudview.createSingleton_: "+O);return O},kM=function(){return g.$I("yt.mdx.remote.cloudview.instance_")},qbA=function(m,V){MUA(!0); Ek5(!1);KBn(m,function(O){O?(okI(!0),g.hc("yt-remote-cast2-api-ready")):(YM("Failed to initialize cast API."),MUA(!1),g.uF("yt-remote-cast-available"),g.uF("yt-remote-cast-receiver"),fNI());V(O)})},$M=function(m){hA("cloudview",m)},YM=function(m){hA("cloudview",m)},MUA=function(m){$M("setCastInstalled_ "+m); g.I$("yt-remote-cast-installed",m)},cR=function(){return!!g.$I("yt.mdx.remote.cloudview.apiReady_")},okI=function(m){$M("setApiReady_ "+m); g.TZ("yt.mdx.remote.cloudview.apiReady_",m)},Ek5=function(m){g.TZ("yt.mdx.remote.cloudview.initializing_",m)},Ne=function(m){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.hasNext=this.hasPrevious=!1;this.loadedTime=this.D=this.J=this.L=0;this.Z=NaN;this.T=!1;this.reset(m)},WBW=function(m){m.audioTrackId=null; m.trackData=null;m.playerState=-1;m.hasPrevious=!1;m.hasNext=!1;m.N=0;m.K=g.uz();m.L=0;m.J=0;m.D=0;m.loadedTime=0;m.Z=NaN;m.T=!1},bH=function(m){return m.isPlaying()?(g.uz()-m.K)/1E3:0},nv=function(m,V){m.N=V; m.K=g.uz()},ST=function(m){switch(m.playerState){case 1:case 1081:return(g.uz()-m.K)/1E3+m.N; case -1E3:return 0}return m.N},XZz=function(m){return m.T?m.J+bH(m):m.J},ID=function(m,V,O){var h=m.videoId; m.videoId=V;m.index=O;V!=h&&WBW(m)},HpG=function(m){var V={}; V.index=m.index;V.listId=m.listId;V.videoId=m.videoId;V.playerState=m.playerState;V.volume=m.volume;V.muted=m.muted;V.audioTrackId=m.audioTrackId;V.trackData=g.n9(m.trackData);V.hasPrevious=m.hasPrevious;V.hasNext=m.hasNext;V.playerTime=m.N;V.playerTimeAt=m.K;V.seekableStart=m.L;V.seekableEnd=m.J;V.duration=m.D;V.loadedTime=m.loadedTime;V.liveIngestionTime=m.Z;return V},uH=function(m,V){g.yh.call(this); var O=this;this.D=0;this.T=m;this.N=[];this.K=new aCW;this.L=this.Z=null;this.Qt=(0,g.IA)(this.ofS,this);this.J=(0,g.IA)(this.hV,this);this.V=(0,g.IA)(this.Mbz,this);this.Zu=(0,g.IA)(this.NYN,this);var h=0;m?(h=m.getProxyState(),h!=3&&(m.subscribe("proxyStateChange",this.Fm,this),T3h(this))):h=3;h!=0&&(V?this.Fm(h):g.t6(function(){O.Fm(h)},0)); (m=d2h())&&eT(this,m);this.subscribe("yt-remote-cast2-session-change",this.Zu)},z2=function(m){return new Ne(m.T.getPlayerContextData())},T3h=function(m){g.An("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(V){this.N.push(this.T.subscribe(V,g.e$(this.v2Y,V),this))},m)},$2G=function(m){g.An(m.N,function(V){this.T.unsubscribeByKey(V)},m); m.N.length=0},Zd=function(m){return m.getState()==1},s8=function(m,V){var O=m.K; O.Z.length+O.L.length<50&&m.K.enqueue(V)},YbI=function(m,V,O){var h=z2(m); nv(h,O);h.playerState!=-1E3&&(h.playerState=V);FH(m,h)},aD=function(m,V,O){m.T.sendMessage(V,O)},FH=function(m,V){$2G(m); m.T.setPlayerContextData(HpG(V));T3h(m)},eT=function(m,V){m.L&&(m.L.removeUpdateListener(m.Qt),m.L.removeMediaListener(m.J),m.hV(null)); m.L=V;m.L&&(wl("Setting cast session: "+m.L.sessionId),m.L.addUpdateListener(m.Qt),m.L.addMediaListener(m.J),m.L.media.length&&m.hV(m.L.media[0]))},kvn=function(m){var V=m.Z.media,O=m.Z.customData; if(V&&O){var h=z2(m);V.contentId!=h.videoId&&wl("Cast changing video to: "+V.contentId);h.videoId=V.contentId;h.playerState=O.playerState;nv(h,m.Z.getEstimatedTime());FH(m,h)}else wl("No cast media video. Ignoring state update.")},iH=function(m,V,O){return(0,g.IA)(function(h){this.D8("Failed to "+V+" with cast v2 channel. Error code: "+h.code); h.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.D8("Retrying "+V+" using MDx browser channel."),aD(this,V,O))},m)},BR=function(m,V,O,h){h=h===void 0?!1:h; g.yh.call(this);var w=this;this.N=NaN;this.v6=!1;this.Qt=this.V=this.Ae=this.mS=NaN;this.Zu=[];this.K=this.J=this.T=this.Z=this.L=null;this.H6=m;this.EH=h;this.Zu.push(g.Yk(window,"beforeunload",function(){w.y9(2)})); this.D=[];this.Z=new Ne;this.fA=V.id;this.iH=V.idType;this.L=fHZ(this.H6,O,this.eD,this.iH=="shortLived",this.fA);this.L.listen("channelOpened",function(){r85(w)}); this.L.listen("channelClosed",function(){G2("Channel closed");isNaN(w.N)?f1(!0):f1();w.dispose()}); this.L.listen("channelError",function(y){f1();isNaN(w.Jv())?(y==1&&w.iH=="shortLived"&&w.publish("browserChannelAuthError",y),G2("Channel error: "+y+" without reconnection"),w.dispose()):(w.v6=!0,G2("Channel error: "+y+" with reconnection in "+w.Jv()+" ms"),pv(w,2))}); this.L.listen("channelMessage",function(y){c8a(w,y)}); this.L.Fw(V.token);this.subscribe("remoteQueueChange",function(){var y=w.Z.videoId;g.zv()&&g.I$("yt-remote-session-video-id",y)})},D2H=function(m){return g.p5(m.D,function(V){return V.type=="LOUNGE_SCREEN"})},G2=function(m){hA("conn",m)},pv=function(m,V){m.publish("proxyStateChange",V)},N3A=function(m){m.N=g.t6(function(){G2("Connecting timeout"); m.y9(1)},2E4)},bpn=function(m){g.W7(m.N); m.N=NaN},nkc=function(m){g.W7(m.mS); m.mS=NaN},INa=function(m){SbM(m); m.Ae=g.t6(function(){lH(m,"getNowPlaying")},2E4)},SbM=function(m){g.W7(m.Ae); m.Ae=NaN},r85=function(m){G2("Channel opened"); m.v6&&(m.v6=!1,nkc(m),m.mS=g.t6(function(){G2("Timing out waiting for a screen.");m.y9(1)},15E3))},uS5=function(m,V){var O=null; if(V){var h=D2H(m);h&&(O={clientName:h.clientName,deviceMake:h.brand,deviceModel:h.model,osVersion:h.osVersion})}g.TZ("yt.mdx.remote.remoteClient_",O);V&&(bpn(m),nkc(m));O=m.L.CM()&&isNaN(m.N);V==O?V&&(pv(m,1),lH(m,"getSubtitlesTrack")):V?(m.tI()&&m.Z.reset(),pv(m,1),lH(m,"getNowPlaying"),eyW(m)):m.y9(1)},zyM=function(m,V){var O=V.params.videoId; delete V.params.videoId;O==m.Z.videoId&&(g.c8(V.params)?m.Z.trackData=null:m.Z.trackData=V.params,m.publish("remotePlayerChange"))},Zp5=function(m,V,O){var h=V.params.videoId||V.params.video_id,w=parseInt(V.params.currentIndex,10); m.Z.listId=V.params.listId||m.Z.listId;ID(m.Z,h,w);m.publish("remoteQueueChange",O)},FB$=function(m,V){V.params=V.params||{}; Zp5(m,V,"NOW_PLAYING_MAY_CHANGE");s$I(m,V);m.publish("autoplayDismissed")},s$I=function(m,V){var O=parseInt(V.params.currentTime||V.params.current_time,10); nv(m.Z,isNaN(O)?0:O);O=parseInt(V.params.state,10);O=isNaN(O)?-1:O;O==-1&&m.Z.playerState==-1E3&&(O=-1E3);m.Z.playerState=O;O=Number(V.params.loadedTime);m.Z.loadedTime=isNaN(O)?0:O;m.Z.qb(Number(V.params.duration));O=m.Z;var h=Number(V.params.liveIngestionTime);O.Z=h;O.T=isNaN(h)?!1:!0;O=m.Z;h=Number(V.params.seekableStartTime);V=Number(V.params.seekableEndTime);O.L=isNaN(h)?0:h;O.J=isNaN(V)?0:V;m.Z.playerState==1?INa(m):SbM(m);m.publish("remotePlayerChange")},aNH=function(m,V){if(m.Z.playerState!= -1E3){var O=1085; switch(parseInt(V.params.adState,10)){case 1:O=1081;break;case 2:O=1084;break;case 0:O=1083}m.Z.playerState=O;V=parseInt(V.params.currentTime,10);nv(m.Z,isNaN(V)?0:V);m.publish("remotePlayerChange")}},ipc=function(m,V){var O=V.params.muted=="true"; m.Z.volume=parseInt(V.params.volume,10);m.Z.muted=O;m.publish("remotePlayerChange")},Gv$=function(m,V){m.J=V.params.videoId; m.publish("nowAutoplaying",parseInt(V.params.timeout,10))},pZJ=function(m,V){m.J=V.params.videoId||null; m.publish("autoplayUpNext",m.J)},B3z=function(m,V){m.K=V.params.autoplayMode; m.publish("autoplayModeChange",m.K);m.K=="DISABLED"&&m.publish("autoplayDismissed")},lNz=function(m,V){var O=V.params.hasNext=="true"; m.Z.hasPrevious=V.params.hasPrevious=="true";m.Z.hasNext=O;m.publish("previousNextChange")},c8a=function(m,V){V=V.message; V.params?G2("Received: action="+V.action+", params="+g.ab(V.params)):G2("Received: action="+V.action+" {}");switch(V.action){case "loungeStatus":V=OK(V.params.devices);m.D=g.rb(V,function(h){return new ji(h)}); V=!!g.p5(m.D,function(h){return h.type=="LOUNGE_SCREEN"}); uS5(m,V);V=m.ej("mlm");m.publish("multiStateLoopEnabled",V);break;case "loungeScreenDisconnected":g.hn(m.D,function(h){return h.type=="LOUNGE_SCREEN"}); uS5(m,!1);break;case "remoteConnected":var O=new ji(OK(V.params.device));g.p5(m.D,function(h){return h.equals(O)})||xXA(m.D,O); break;case "remoteDisconnected":O=new ji(OK(V.params.device));g.hn(m.D,function(h){return h.equals(O)}); break;case "gracefulDisconnect":break;case "playlistModified":Zp5(m,V,"QUEUE_MODIFIED");break;case "nowPlaying":FB$(m,V);break;case "onStateChange":s$I(m,V);break;case "onAdStateChange":aNH(m,V);break;case "onVolumeChanged":ipc(m,V);break;case "onSubtitlesTrackChanged":zyM(m,V);break;case "nowAutoplaying":Gv$(m,V);break;case "autoplayDismissed":m.publish("autoplayDismissed");break;case "autoplayUpNext":pZJ(m,V);break;case "onAutoplayModeChanged":B3z(m,V);break;case "onHasPreviousNextChanged":lNz(m, V);break;case "requestAssistedSignIn":m.publish("assistedSignInRequested",V.params.authCode);break;case "onLoopModeChanged":m.publish("loopModeChange",V.params.loopMode);break;default:G2("Unrecognized action: "+V.action)}},eyW=function(m){g.W7(m.Qt); m.Qt=g.t6(function(){m.y9(1)},864E5)},lH=function(m,V,O){O?G2("Sending: action="+V+", params="+g.ab(O)):G2("Sending: action="+V); m.L.sendMessage(V,O)},Q$I=function(m){JA.call(this,"ScreenServiceProxy"); this.gy=m;this.Z=[];this.Z.push(this.gy.$_s("screenChange",(0,g.IA)(this.jZ,this)));this.Z.push(this.gy.$_s("onlineScreenChange",(0,g.IA)(this.E5z,this)))},O3n=function(m,V){lzZ(); if(!xf||!xf.get("yt-remote-disable-remote-module-for-dev")){V=g.Vf("MDX_CONFIG")||V;zaG();azA();Qm||(Qm=new mI(V?V.loungeApiHost:void 0),QwA()&&(Qm.Z="/api/loungedev"));vR||(vR=g.$I("yt.mdx.remote.deferredProxies_")||[],g.TZ("yt.mdx.remote.deferredProxies_",vR));vkJ();var O=PR();if(!O){var h=new fv(Qm,V?V.disableAutomaticScreenCache||!1:!1);g.TZ("yt.mdx.remote.screenService_",h);O=PR();var w={};V&&(w={appId:V.appId,disableDial:V.disableDial,theme:V.theme,loadCastApiSetupScript:V.loadCastApiSetupScript, disableCastApi:V.disableCastApi,enableDialLoungeToken:V.enableDialLoungeToken,enableCastLoungeToken:V.enableCastLoungeToken,forceMirroring:V.forceMirroring});g.TZ("yt.mdx.remote.enableConnectWithInitialState_",V?V.enableConnectWithInitialState||!1:!1);RyG(m,h,function(y){y?mX()&&Dd(mX(),"YouTube TV"):h.subscribe("onlineScreenChange",function(){Rf("yt-remote-receiver-availability-change")})},w)}V&&!g.$I("yt.mdx.remote.initialized_")&&(g.TZ("yt.mdx.remote.initialized_",!0),Vo("Initializing: "+g.ab(V)), O1.push(g.V4("yt-remote-cast2-api-ready",function(){Rf("yt-remote-api-ready")})),O1.push(g.V4("yt-remote-cast2-availability-change",function(){Rf("yt-remote-receiver-availability-change")})),O1.push(g.V4("yt-remote-cast2-receiver-selected",function(){he(null); Rf("yt-remote-auto-connect","cast-selector-receiver")})),O1.push(g.V4("yt-remote-cast2-receiver-resumed",function(){Rf("yt-remote-receiver-resumed","cast-selector-receiver")})),O1.push(g.V4("yt-remote-cast2-session-change",PFh)),O1.push(g.V4("yt-remote-connection-change",function(y){y?Dd(mX(),"YouTube TV"):wn()||(Dd(null,null),U2A())})),O1.push(g.V4("yt-remote-cast2-session-failed",function(){Rf("yt-remote-connection-failed")})),m=m9z(),V.isAuto&&(m.id+="#dial"),w=V.capabilities||[],w.length>0&&(m.capabilities= w),m.name=V.device,m.app=V.app,(V=V.theme)&&(m.theme=V),Vo(" -- with channel params: "+g.ab(m)),m?(g.I$("yt-remote-session-app",m.app),g.I$("yt-remote-session-name",m.name)):(g.uF("yt-remote-session-app"),g.uF("yt-remote-session-name")),g.TZ("yt.mdx.remote.channelParams_",m),O.start(),mX()||Vra())}},hQz=function(){var m=PR().gy.$_gos(); var V=yo();V&&jK()&&(u05(m,V)||m.push(V));return ea$(m)},yJa=function(){var m=wEn(); !m&&rl()&&A8$()&&(m={key:"cast-selector-receiver",name:A8$()});return m},wEn=function(){var m=hQz(),V=yo(); V||(V=wn());return g.p5(m,function(O){return V&&J$(V,O.key)?!0:!1})},yo=function(){var m=mX(); if(!m)return null;var V=PR().uC();return EK(V,m)},PFh=function(m){Vo("remote.onCastSessionChange_: "+C1(m)); if(m){var V=yo();if(V&&V.id==m.id){if(Dd(V.id,"YouTube TV"),m.idType=="shortLived"&&(m=m.token))Lg&&(Lg.token=m),(V=jK())&&V.Fw(m)}else V&&Je(),Cg(m,1)}else jK()&&Je()},Je=function(){cR()?kM().stopSession():YM("stopSession called before API ready."); var m=jK();m&&(m.disconnect(1),jez(null))},Lmn=function(){var m=jK(); return!!m&&m.getProxyState()!=3},Vo=function(m){hA("remote",m)},PR=function(){if(!JJM){var m=g.$I("yt.mdx.remote.screenService_"); JJM=m?new Q$I(m):null}return JJM},mX=function(){return g.$I("yt.mdx.remote.currentScreenId_")},CCn=function(m){g.TZ("yt.mdx.remote.currentScreenId_",m)},EBA=function(){return g.$I("yt.mdx.remote.connectData_")},he=function(m){g.TZ("yt.mdx.remote.connectData_",m)},jK=function(){return g.$I("yt.mdx.remote.connection_")},jez=function(m){var V=jK(); he(null);m||CCn("");g.TZ("yt.mdx.remote.connection_",m);vR&&(g.An(vR,function(O){O(m)}),vR.length=0); V&&!m?Rf("yt-remote-connection-change",!1):!V&&m&&Rf("yt-remote-connection-change",!0)},wn=function(){var m=g.zv(); if(!m)return null;var V=PR();if(!V)return null;V=V.uC();return EK(V,m)},Cg=function(m,V){mX(); yo()&&yo();if(E1)Lg=m;else{CCn(m.id);var O=g.$I("yt.mdx.remote.enableConnectWithInitialState_")||!1;m=new BR(Qm,m,m9z(),O);m.connect(V,EBA());m.subscribe("beforeDisconnect",function(h){Rf("yt-remote-before-disconnect",h)}); m.subscribe("beforeDispose",function(){jK()&&(jK(),jez(null))}); m.subscribe("browserChannelAuthError",function(){var h=yo();h&&h.idType=="shortLived"&&(cR()?kM().handleBrowserChannelAuthError():YM("refreshLoungeToken called before API ready."))}); jez(m)}},Vra=function(){var m=wn(); m?(Vo("Resume connection to: "+C1(m)),Cg(m,0)):(f1(),U2A(),Vo("Skipping connecting because no session screen found."))},vkJ=function(){var m=m9z(); if(g.c8(m)){m=Mu();var V=g.eU("yt-remote-session-name")||"",O=g.eU("yt-remote-session-app")||"";m={device:"REMOTE_CONTROL",id:m,name:V,app:O,mdxVersion:3};m.authuser=String(g.Vf("SESSION_INDEX","0"));(V=g.Vf("DELEGATED_SESSION_ID"))&&(m.pageId=String(V));g.TZ("yt.mdx.remote.channelParams_",m)}},m9z=function(){return g.$I("yt.mdx.remote.channelParams_")||{}},ftH=function(m,V,O){g.Z.call(this); var h=this;this.Z=m;this.U=V;this.hj=O;this.events=new g.Rc(this);this.K=!1;this.N=new g.KS(64);this.L=new g.mq(this.Um,500,this);this.D=new g.mq(this.yx,1E3,this);this.V=new gW(this.CNH,0,this);this.T={};this.Qt=new g.mq(this.YO,1E3,this);this.J=new g.wO(this.seekTo,1E3,this);this.Zu=this.events.C(this.U,"onVolumeChange",function(w){qdA(h,w)}); g.a(this,this.events);this.events.C(V,"onCaptionsTrackListChanged",this.Lnf);this.events.C(V,"captionschanged",this.YIu);this.events.C(V,"captionssettingschanged",this.aq);this.events.C(V,"videoplayerreset",this.S3);this.events.C(V,"mdxautoplaycancel",function(){h.hj.JW()}); V.Y("enable_mdx_video_play_directly")&&this.events.C(V,"videodatachange",function(){MrA(h.Z)||qd(h)||Md(h,0)}); m=this.hj;m.UH();m.subscribe("proxyStateChange",this.Fg,this);m.subscribe("remotePlayerChange",this.ut,this);m.subscribe("remoteQueueChange",this.S3,this);m.subscribe("previousNextChange",this.U1,this);m.subscribe("nowAutoplaying",this.T8,this);m.subscribe("autoplayDismissed",this.W5,this);g.a(this,this.L);g.a(this,this.D);g.a(this,this.V);g.a(this,this.Qt);g.a(this,this.J);this.aq();this.S3();this.ut()},qdA=function(m,V){if(qd(m)){m.hj.unsubscribe("remotePlayerChange",m.ut,m); var O=Math.round(V.volume);V=!!V.muted;var h=z2(m.hj);if(O!==h.volume||V!==h.muted)m.hj.setVolume(O,V),m.Qt.start();m.hj.subscribe("remotePlayerChange",m.ut,m)}},x9W=function(m){m.Yf(0); m.L.stop();m.Aq(new g.KS(64))},RQ$=function(m,V){if(qd(m)&&!m.K){var O=null; V&&(O={style:m.U.getSubtitlesUserSettings()},Object.assign(O,V));m.hj.J5(m.U.getVideoData(1).videoId,O);m.T=z2(m.hj).trackData}},Md=function(m,V){var O=m.U.getPlaylist(); if(O==null?0:O.listId){var h=O.index;var w=O.listId.toString()}O=m.U.getVideoData(1);m.hj.playVideo(O.videoId,V,h,w,O.playerParams,O.Zu,fzA(O));m.Aq(new g.KS(1))},oBc=function(m,V){if(V){var O=m.U.getOption("captions","tracklist",{Ew:1}); O&&O.length?(m.U.setOption("captions","track",V),m.K=!1):(m.U.loadModule("captions"),m.K=!0)}else m.U.setOption("captions","track",{})},qd=function(m){return z2(m.hj).videoId===m.U.getVideoData(1).videoId},gBc=function(m,V){g.u3.call(this,m); this.Z=V},fg=function(){g.p.call(this,{G:"div", X:"ytp-mdx-popup-dialog",B:{role:"dialog"},S:[{G:"div",X:"ytp-mdx-popup-dialog-inner-content",S:[{G:"div",X:"ytp-mdx-popup-title",c6:"Voc\u00ea n\u00e3o fez login"},{G:"div",X:"ytp-mdx-popup-description",c6:"Os v\u00eddeos que voc\u00ea assistir poder\u00e3o ser adicionados ao hist\u00f3rico de visualiza\u00e7\u00e3o da TV e influenciar\u00e3o as recomenda\u00e7\u00f5es dela. Para evitar isso, cancele e fa\u00e7a login no YouTube em um computador."},{G:"div",X:"ytp-mdx-privacy-popup-buttons",S:[{G:"button", KA:["ytp-button","ytp-mdx-privacy-popup-cancel"],c6:"Cancelar"},{G:"button",KA:["ytp-button","ytp-mdx-privacy-popup-confirm"],c6:"Confirmar"}]}]}]});this.fade=new g.OR(this,250);this.cancelButton=this.LA("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.LA("ytp-mdx-privacy-popup-confirm");g.a(this,this.fade);this.C(this.cancelButton,"click",this.Z);this.C(this.confirmButton,"click",this.L)},xt=function(m){g.p.call(this,{G:"div", X:"ytp-remote",S:[{G:"div",X:"ytp-remote-display-status",S:[{G:"div",X:"ytp-remote-display-status-icon",S:[g.svU()]},{G:"div",X:"ytp-remote-display-status-text",c6:"{{statustext}}"}]}]});this.api=m;this.fade=new g.OR(this,250);g.a(this,this.fade);this.C(m,"presentingplayerstatechange",this.onStateChange);this.Mq(m.getPlayerStateObject())},RN=function(m,V){g.$D.call(this,"Reproduzir em",1,m,V); this.U=m;this.SG={};this.C(m,"onMdxReceiversChange",this.L);this.C(m,"presentingplayerstatechange",this.L);this.L()},AJG=function(m){g.RZ.call(this,m); this.Qs={key:IzZ(),name:"Este computador"};this.pw=null;this.subscriptions=[];this.FR=this.hj=null;this.SG=[this.Qs];this.Eh=this.Qs;this.Ol=new g.KS(64);this.V_=0;this.In=-1;this.YX=!1;this.TQ=this.Fu=this.Hx=null;if(!g.l0(this.player.j())&&!g.Sm(this.player.j())){m=this.player;var V=g.Hz(m);V&&(V=V.tZ())&&(V=new RN(m,V),g.a(this,V));V=new xt(m);g.a(this,V);g.ib(m,V.element,4);this.Hx=new fg;g.a(this,this.Hx);g.ib(m,this.Hx.element,4);this.YX=!!wn()}},oN=function(m){m.Fu&&(m.player.removeEventListener("presentingplayerstatechange", m.Fu),m.Fu=null)},U9a=function(m,V,O){m.Ol=O; m.player.publish("presentingplayerstatechange",new g.q6(O,V))},gn=function(m,V){if(V.key!==m.Eh.key)if(V.key===m.Qs.key)Je(); else if(MrA(m)&&d95(m),m.Eh=V,!g.Sm(m.player.j())){var O=m.player.getPlaylistId();var h=m.player.getVideoData(1);var w=h.videoId;if(!O&&!w||(m.player.getAppState()===2||m.player.getAppState()===1)&&m.player.j().Y("should_clear_video_data_on_player_cued_unstarted"))h=null;else{var y=m.player.getPlaylist();if(y){var L=[];for(var C=0;C2*this.size&&ye(this),!0):!1}; g.U.get=function(m,V){return h$(this.L,m)?this.L[m]:V}; g.U.set=function(m,V){h$(this.L,m)||(this.size+=1,this.Z.push(m),this.PA++);this.L[m]=V}; g.U.forEach=function(m,V){for(var O=this.wz(),h=0;h=h.Z.length)return g.EQ;var y=h.Z[V++];return g.nT(m?y:h.L[y])}; return w}; var cKn={Dzu:"atp",zhe:"ska",tPz:"que",Eqr:"mus",D6H:"sus",Ss6:"dsp",VPz:"seq",TQr:"mic",L1e:"dpa",U2f:"mlm",diz:"dsdtr",tuu:"ntb",hhe:"vsp",qsz:"scn",Jfe:"rpe",Zwe:"dcn",uUf:"dcp",Vue:"pas",cdH:"drq",Odu:"opf",yde:"els",UiH:"isg",lbS:"svq",qWz:"mvp",ziY:"ads",U6Y:"stcp",ZXr:"sads",Adz:"dloc",IwH:"dcw",iqA:"asw",Tdt:"apw",glr:"wrc",DXN:"pcw",ORz:"ipv",XUS:"ndt",bUz:"ctops"},DXI={SoS:"u",P4r:"cl",pPt:"k",iR6:"i",VRt:"cr",FLz:"m",awS:"g",Tn:"up"},Pj$={xO:"adPlaying",Vm:"onAdStateChange"},mBZ={Jtt:"nowPlaying", rtz:"onStateChange",xO:"adPlaying",Vm:"onAdStateChange",xk:"nowPlayingShorts",Sx:"onShortsStateChange"},V6c={xk:"nowPlayingShorts",Sx:"onShortsStateChange"};ji.prototype.equals=function(m){return m?this.id==m.id:!1}; var Fw$="",xf=null,yYM=PY$("loadCastFramework")||PY$("loadCastApplicationFramework"),JYZ=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.Fh(gW,g.Z);g.U=gW.prototype;g.U.yO=function(m){this.T=arguments;this.Z=!1;this.b2?this.D=g.uz()+this.QD:this.b2=g.z0(this.K,this.QD)}; g.U.stop=function(){this.b2&&(g.WH.clearTimeout(this.b2),this.b2=null);this.D=null;this.Z=!1;this.T=[]}; g.U.pause=function(){++this.L}; g.U.resume=function(){this.L&&(--this.L,!this.L&&this.Z&&(this.Z=!1,this.N.apply(null,this.T)))}; g.U.d0=function(){this.stop();gW.jW.d0.call(this)}; g.U.qh=function(){this.b2&&(g.WH.clearTimeout(this.b2),this.b2=null);this.D?(this.b2=g.z0(this.K,this.D-g.uz()),this.D=null):this.L?this.Z=!0:(this.Z=!1,this.N.apply(null,this.T))};var UK=null;A$.prototype.set=function(m){this.Z=m}; A$.prototype.reset=function(){this.set(g.uz())}; A$.prototype.get=function(){return this.Z};g.Fh(qMn,ENz);dW.prototype.stringify=function(m){return g.WH.JSON.stringify(m,void 0)}; dW.prototype.parse=function(m){return g.WH.JSON.parse(m,void 0)};g.Fh(MFz,g.yc);g.Fh(fDJ,g.yc);var xaG=null;g.Fh(oNA,g.yc);g.Fh(gNc,g.yc);g.Fh(AYz,g.yc);XF.prototype.debug=function(){}; XF.prototype.info=function(){}; XF.prototype.warning=function(){};var TOJ={},HYz={};g.U=H4.prototype;g.U.setTimeout=function(m){this.pA=m}; g.U.Fo=function(m){m=m.target;var V=this.Je;V&&g.Qc(m)==3?V.Bc():this.A5(m)}; g.U.A5=function(m){try{if(m==this.Z)a:{var V=g.Qc(this.Z),O=this.Z.L,h=this.Z.getStatus();if(!(V<3)&&(V!=3||this.Z&&(this.L.L||g.PU(this.Z)||g.mz(this.Z)))){this.EH||V!=4||O==7||(O==8||h<=0?t$(3):t$(2));kOA(this);var w=this.Z.getStatus();this.Aj=w;var y=XDA(this);if(this.N=w==200){if(this.LP&&!this.Mf){b:{if(this.Z){var L=g.Vq(this.Z,"X-HTTP-Initial-Response");if(L&&!g.v8(L)){var C=L;break b}}C=null}if(m=C)this.Mf=!0,epH(this,m);else{this.N=!1;this.K=3;K1(12);$f(this);Yf(this);break a}}if(this.iH){m= !0;for(var E;!this.EH&&this.J0&&!this.UU&&(this.UU=!0,this.D.N4(this)):($f(this),Yf(this))}else epH(this,y);V==4&&$f(this);this.N&&!this.EH&&(V==4?rYc(this.D,this):(this.N=!1,TT(this)))}else g.Z6$(this.Z),w==400&&y.indexOf("Unknown SID")> 0?(this.K=3,K1(12)):(this.K=0,K1(13)),$f(this),Yf(this)}}}catch(q){}finally{}}; g.U.cancel=function(){this.EH=!0;$f(this)}; g.U.Eq=function(){this.Zu=null;var m=Date.now();m-this.nA>=0?(this.fA!=2&&(t$(3),K1(17)),$f(this),this.K=2,Yf(this)):YMz(this,this.nA-m)}; g.U.getLastError=function(){return this.K}; g.U.MM=function(){return this.Z};zpG.prototype.cancel=function(){this.D=sMI(this);if(this.L)this.L.cancel(),this.L=null;else if(this.Z&&this.Z.size!==0){for(var m=g.D(this.Z.values()),V=m.next();!V.done;V=m.next())V.value.cancel();this.Z.clear()}};g.U=GOZ.prototype;g.U.c$=8;g.U.VC=1;g.U.connect=function(m,V,O,h){K1(0);this.Id=m;this.EH=V||{};O&&h!==void 0&&(this.EH.OSID=O,this.EH.OAID=h);this.Je=this.nP;this.H6=nNI(this,null,this.Id);D4(this)}; g.U.disconnect=function(){BOc(this);if(this.VC==3){var m=this.Xr++,V=this.H6.clone();g.g_(V,"SID",this.T);g.g_(V,"RID",m);g.g_(V,"TYPE","terminate");n1(this,V);m=new H4(this,this.T,m);m.fA=2;m.V=mn(V.clone());V=!1;if(g.WH.navigator&&g.WH.navigator.sendBeacon)try{V=g.WH.navigator.sendBeacon(m.V.toString(),"")}catch(O){}!V&&g.WH.Image&&((new Image).src=m.V,V=!0);V||(m.Z=Kqc(m.D,null),m.Z.send(m.V));m.mS=Date.now();TT(m)}VkJ(this)}; g.U.wH=function(){return this.VC==0}; g.U.getState=function(){return this.VC}; g.U.DC=function(m){if(this.N)if(this.N=null,this.VC==1){if(!m){this.Xr=Math.floor(Math.random()*1E5);m=this.Xr++;var V=new H4(this,"",m),O=this.Qt;this.LP&&(O?(O=g.bX(O),g.S5(O,this.LP)):O=this.LP);this.J!==null||this.nA||(V.H6=O,O=null);var h;if(this.W6)a:{for(var w=h=0;w4096){h=w;break a}if(h===4096||w===this.D.length-1){h=w+1;break a}}h= this.tq}else h=this.tq;h=vN5(this,V,h);w=this.H6.clone();g.g_(w,"RID",m);g.g_(w,"CVER",22);this.iH&&g.g_(w,"X-HTTP-Session-Id",this.iH);n1(this,w);O&&(this.nA?h="headers="+g.FC(g.qNX(O))+"&"+h:this.J&&g.d_(w,this.J,O));bYc(this.L,V);this.WW&&g.g_(w,"TYPE","init");this.W6?(g.g_(w,"$req",h),g.g_(w,"SID","null"),V.LP=!0,tFz(V,w,null)):tFz(V,w,h);this.VC=2}}else this.VC==3&&(m?PQc(this,m):this.D.length==0||ZYA(this.L)||PQc(this))}; g.U.Lt=function(){this.V=null;m7A(this);if(this.Rd&&!(this.pA||this.Z==null||this.ma<=0)){var m=4*this.ma;this.v6=W4((0,g.IA)(this.ffz,this),m)}}; g.U.ffz=function(){this.v6&&(this.v6=null,this.Je=!1,this.pA=!0,K1(10),rW(this),m7A(this))}; g.U.N4=function(m){this.Z==m&&this.Rd&&!this.pA&&(pDW(this),this.pA=!0,K1(11))}; g.U.fh=function(){this.Zu!=null&&(this.Zu=null,rW(this),Dac(this),K1(19))}; g.U.KO6=function(m){m?K1(2):K1(1)}; g.U.isActive=function(){return!!this.K&&this.K.isActive(this)}; g.U=hAA.prototype;g.U.gp=function(){}; g.U.Ti=function(){}; g.U.zi=function(){}; g.U.I_=function(){}; g.U.isActive=function(){return!0}; g.U.Yp=function(){};g.Fh(If,g.dw);If.prototype.open=function(){this.Z.K=this.D;this.N&&(this.Z.Mf=!0);this.Z.connect(this.K,this.L||void 0)}; If.prototype.close=function(){this.Z.disconnect()}; If.prototype.send=function(m){var V=this.Z;if(typeof m==="string"){var O={};O.__data__=m;m=O}else this.T&&(O={},O.__data__=g.ab(m),m=O);V.D.push(new uQh(V.nf++,m));V.VC==3&&D4(V)}; If.prototype.d0=function(){this.Z.K=null;delete this.D;this.Z.disconnect();delete this.Z;If.jW.d0.call(this)}; g.Fh(yxh,MFz);g.Fh(j8I,fDJ);g.Fh(Si,hAA);Si.prototype.gp=function(){this.Z.dispatchEvent("m")}; Si.prototype.Ti=function(m){this.Z.dispatchEvent(new yxh(m))}; Si.prototype.zi=function(m){this.Z.dispatchEvent(new j8I(m))}; Si.prototype.I_=function(){this.Z.dispatchEvent("n")}; LPH.prototype.commit=function(m){this.Z.Aj=m};var uM=new g.dw;g.t(CjI,g.yc);g.U=Z4.prototype;g.U.pS=null;g.U.xb=!1;g.U.Jl=null;g.U.P4=null;g.U.Ng=null;g.U.ao=null;g.U.Mg=null;g.U.X5=null;g.U.BA=null;g.U.Eu=null;g.U.sO=0;g.U.Zh=null;g.U.OO=null;g.U.CS=null;g.U.tD=-1;g.U.Bz=!0;g.U.P0=!1;g.U.o2=0;g.U.e7=null;var RAa={},x75={};g.U=Z4.prototype;g.U.setTimeout=function(m){this.L=m}; g.U.Mh=function(m){m=m.target;var V=this.e7;V&&g.Qc(m)==3?V.Bc():this.v$(m)}; g.U.v$=function(m){try{if(m==this.Eu)a:{var V=g.Qc(this.Eu),O=this.Eu.L,h=this.Eu.getStatus();if(g.Xm&&!g.VS("420+")){if(V<4)break a}else if(V<3||V==3&&!g.PU(this.Eu))break a;this.P0||V!=4||O==7||(O==8||h<=0?this.Z.Rt(3):this.Z.Rt(2));Ax$(this);var w=this.Eu.getStatus();this.tD=w;var y=g.PU(this.Eu);if(this.xb=w==200){V==4&&sK(this);if(this.iH){for(m=!0;!this.P0&&this.sO0?(this.CS=3,zT(13)):(this.CS=0,zT(14)),sK(this),U7a(this)}}catch(C){}finally{}}; g.U.cancel=function(){this.P0=!0;sK(this)}; g.U.kp=function(){this.Jl=null;var m=Date.now();m-this.P4>=0?(this.ao!=2&&this.Z.Rt(3),sK(this),this.CS=2,zT(18),U7a(this)):gFM(this,this.P4-m)}; g.U.getLastError=function(){return this.CS};g.U=WPA.prototype;g.U.Nw=null;g.U.nU=null;g.U.Jx=!1;g.U.XO=null;g.U.aI=null;g.U.xe=-1;g.U.rS=null;g.U.UY=null;g.U.connect=function(m){this.XO=m;m=af(this.Z,null,this.XO);zT(3);Date.now();var V=this.Z.Qt;V!=null?(this.rS=V[0],(this.UY=V[1])?(this.aI=1,Xha(this)):(this.aI=2,He$(this))):(Ve(m,"MODE","init"),this.nU=new Z4(this),this.nU.pS=this.Nw,Mkn(this.nU,m,!1,null,!0),this.aI=0)}; g.U.l9=function(m){if(m)this.aI=2,He$(this);else{zT(4);var V=this.Z;V.Db=V.y4.xe;Qe(V,9)}m&&this.Rt(2)}; g.U.tB=function(m){return this.Z.tB(m)}; g.U.abort=function(){this.nU&&(this.nU.cancel(),this.nU=null);this.xe=-1}; g.U.wH=function(){return!1}; g.U.Gi=function(m,V){this.xe=m.tD;if(this.aI==0)if(V){try{var O=this.L.parse(V)}catch(h){m=this.Z;m.Db=this.xe;Qe(m,2);return}this.rS=O[0];this.UY=O[1]}else m=this.Z,m.Db=this.xe,Qe(m,2);else this.aI==2&&(this.Jx?(zT(7),Date.now()):V=="11111"?(zT(6),this.Jx=!0,Date.now(),this.xe=200,this.nU.cancel(),zT(12),iM(this.Z,this,!0)):(zT(8),Date.now(),this.Jx=!1))}; g.U.JB=function(){this.xe=this.nU.tD;if(this.nU.xb)this.aI==0?this.UY?(this.aI=1,Xha(this)):(this.aI=2,He$(this)):this.aI==2&&(this.Jx?(zT(12),iM(this.Z,this,!0)):(zT(11),iM(this.Z,this,!1)));else{this.aI==0?zT(9):this.aI==2&&zT(10);var m=this.Z;this.nU.getLastError();m.Db=this.xe;Qe(m,2)}}; g.U.JD=function(){return this.Z.JD()}; g.U.isActive=function(){return this.Z.isActive()}; g.U.Rt=function(m){this.Z.Rt(m)};g.U=TSJ.prototype;g.U.Os=null;g.U.ek=null;g.U.ye=null;g.U.QC=null;g.U.sD=null;g.U.wS=null;g.U.Kt=null;g.U.OD=null;g.U.Xt=0;g.U.Pq=0;g.U.nC=null;g.U.j1=null;g.U.jh=null;g.U.jp=null;g.U.y4=null;g.U.jB=null;g.U.r8=-1;g.U.H$=-1;g.U.Db=-1;g.U.Ov=0;g.U.Xq=0;g.U.xj=8;var trA={OK:0,szS:2,ct6:4,e9A:5,neS:6,STOP:7,Bg:8,gcA:9,zb0:10,iUA:11,vl0:12};g.Fh(Ynn,g.yc);g.Fh(kgZ,g.yc);g.U=TSJ.prototype; g.U.connect=function(m,V,O,h,w){zT(0);this.sD=V;this.ek=O||{};h&&w!==void 0&&(this.ek.OSID=h,this.ek.OAID=w);this.V?(ei((0,g.IA)(this.vG,this,m),100),cxn(this)):this.vG(m)}; g.U.disconnect=function(){D7A(this);if(this.Z==3){var m=this.Xt++,V=this.wS.clone();g.g_(V,"SID",this.T);g.g_(V,"RID",m);g.g_(V,"TYPE","terminate");lM(this,V);m=new Z4(this,this.T,m);m.ao=2;m.Mg=mn(V.clone());(new Image).src=m.Mg.toString();m.Ng=Date.now();fCJ(m)}s8c(this)}; g.U.vG=function(m){this.y4=new WPA(this);this.y4.Nw=this.Os;this.y4.L=this.K;this.y4.connect(m)}; g.U.wH=function(){return this.Z==0}; g.U.getState=function(){return this.Z}; g.U.yE=function(m){this.j1=null;ICh(this,m)}; g.U.UE=function(){this.jh=null;this.QC=new Z4(this,this.T,"rpc",this.J);this.QC.pS=this.Os;this.QC.o2=0;var m=this.Kt.clone();g.g_(m,"RID","rpc");g.g_(m,"SID",this.T);g.g_(m,"CI",this.jB?"0":"1");g.g_(m,"AID",this.r8);lM(this,m);g.g_(m,"TYPE","xmlhttp");Mkn(this.QC,m,!0,this.OD,!1)}; g.U.Gi=function(m,V){if(this.Z!=0&&(this.QC==m||this.ye==m))if(this.Db=m.tD,this.ye==m&&this.Z==3)if(this.xj>7){try{var O=this.K.parse(V)}catch(h){O=null}if(Array.isArray(O)&&O.length==3)if(m=O,m[0]==0)a:{if(!this.jh){if(this.QC)if(this.QC.Ng+3E30)){if(h=V==1)this.ye||this.j1||this.Z==1||this.Ov>=2?h=!1:(this.j1=ei((0,g.IA)(this.yE,this,m),uiW(this,this.Ov)),this.Ov++, h=!0);h=!(h||V==2&&zAI(this))}if(h)switch(O){case 1:Qe(this,5);break;case 4:Qe(this,10);break;case 3:Qe(this,6);break;case 7:Qe(this,12);break;default:Qe(this,2)}}}; g.U.o3=function(m){if(!g.vH(arguments,this.Z))throw Error("Unexpected channel state: "+this.Z);}; g.U.GQe=function(m){m?zT(2):(zT(1),ZeJ(this,8))}; g.U.tB=function(m){if(m)throw Error("Can't create secondary domain capable XhrIo object.");m=new g.pt;m.J=!1;return m}; g.U.isActive=function(){return!!this.nC&&this.nC.isActive(this)}; g.U.Rt=function(m){var V=uM;V.dispatchEvent(new kgZ(V,m))}; g.U.JD=function(){return!1}; new qMn;g.U=FPH.prototype;g.U.YR=function(){}; g.U.Fv=function(){}; g.U.kR=function(){}; g.U.EE=function(){}; g.U.rG=function(){}; g.U.Mu=function(){return{}}; g.U.isActive=function(){return!0};g.U=aCW.prototype;g.U.enqueue=function(m){this.L.push(m)}; g.U.isEmpty=function(){return this.Z.length===0&&this.L.length===0}; g.U.clear=function(){this.Z=[];this.L=[]}; g.U.contains=function(m){return g.vH(this.Z,m)||g.vH(this.L,m)}; g.U.remove=function(m){var V=this.Z;var O=(0,g.TlI)(V,m);O>=0?(g.Vg(V,O),V=!0):V=!1;return V||g.Om(this.L,m)}; g.U.AN=function(){for(var m=[],V=this.Z.length-1;V>=0;--V)m.push(this.Z[V]);V=this.L.length;for(var O=0;O0&&(this.N.NUz(this.L.n$(),this.D,!0),this.N.J3e());this.N&&this.N.Qte();this.D?(this.L.stop(),g.Ag(this.L),this.L=new v4(this.hx,this),this.D=!1):this.L.reset();this.Ae=null;this.Zu=0;if(this.T.length)if(this.J)y6H(this);else{var m=this.T;this.T=[];var V=m.length;Q8z(this);w7c(this,m,V);P4(this)}else P4(this)}; g.U.EE=function(m){var V=m==2&&this.Z.Db==401;m==4||V||(this.D&&!this.L.isActive()&&(g.Ag(this.L),this.L=new v4(this.hx,this),this.D=!1),this.L.start());this.publish("handlerError",m,V);V=Object.keys(trA).find(function(O){return trA[O]===m}); this.CA.qC("BROWSER_CHANNEL",V!=null?V:"UNKNOWN")}; g.U.rG=function(m,V){if(!this.L.isActive())this.publish("handlerClosed");else if(V)for(var O=V.length,h=0;h=KmM.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(m=KmM[this.L],this.b2=g.t6((0,g.IA)(this.cz,this),m),this.L++):this.publish("pairingFailed",Error("Server error "+m.status))}; g.U.rD=function(){this.Z=null;this.publish("pairingFailed",Error("Server not responding"))}; var KmM=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.Fh(E8,JA);g.U=E8.prototype;g.U.start=function(){Cv(this)&&this.publish("screenChange");!g.eU("yt-remote-lounge-token-expiration")&&HJH(this);g.W7(this.Z);this.Z=g.t6((0,g.IA)(this.start,this),1E4)}; g.U.add=function(m,V){Cv(this);t6A(this,m);qe(this,!1);this.publish("screenChange");V(m);m.token||HJH(this)}; g.U.remove=function(m,V){var O=Cv(this);WTh(this,m)&&(qe(this,!1),O=!0);V(m);O&&this.publish("screenChange")}; g.U.BL=function(m,V,O,h){var w=Cv(this),y=this.get(m.id);y?(y.name!=V&&(y.name=V,qe(this,!1),w=!0),O(m)):h(Error("no such local screen."));w&&this.publish("screenChange")}; g.U.d0=function(){g.W7(this.Z);E8.jW.d0.call(this)}; g.U.ENH=function(m){Cv(this);var V=this.screens.length;m=m&&m.screens||[];for(var O=m.length,h=0;h20)break a;C=V(y,L)}y=C}w.name=y}O(xM(this,w))},this), onError:(0,g.IA)(function(w){h(Error("pairing request failed: "+w.status))},this), onTimeout:(0,g.IA)(function(){h(Error("pairing request timed out."))},this)})}; g.U.d0=function(){g.Ag(this.L);g.Ag(this.Z);fv.jW.d0.call(this)}; g.U.tzA=function(){IHG(this);this.publish("screenChange");this.Z.update()}; fv.prototype.dispose=fv.prototype.dispose;g.Fh(RD,g.yh);g.U=RD.prototype;g.U.jm=function(m){this.UH()||(m&&(gl(this,""+m),this.publish("sessionFailed")),this.Z=null,this.publish("sessionScreen",null))}; g.U.info=function(m){hA(this.iH,m)}; g.U.t5=function(){return null}; g.U.HT=function(m){var V=this.L;m?(V.displayStatus=new chrome.cast.ReceiverDisplayStatus(m,[]),V.displayStatus.showStop=!0):V.displayStatus=null;chrome.cast.setReceiverDisplayStatus(V,(0,g.IA)(function(){this.info("Updated receiver status for "+V.friendlyName+": "+m)},this),(0,g.IA)(function(){gl(this,"Failed to update receiver status for: "+V.friendlyName)},this))}; g.U.d0=function(){this.HT("");RD.jW.d0.call(this)};g.t(AA,RD);g.U=AA.prototype;g.U.Ks=function(m){if(this.D){if(this.D==m)return;gl(this,"Overriding cast session with new session object");lHh(this);this.mS=!1;this.Qt="unknown";this.D.removeUpdateListener(this.Ae);this.D.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.v6)}this.D=m;this.D.addUpdateListener(this.Ae);this.D.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.v6);aH$(this,"getMdxSessionStatus")}; g.U.Xe=function(m){this.info("launchWithParams no-op for Cast: "+g.ab(m))}; g.U.stop=function(){this.D?this.D.stop((0,g.IA)(function(){this.jm()},this),(0,g.IA)(function(){this.jm(Error("Failed to stop receiver app."))},this)):this.jm(Error("Stopping cast device without session."))}; g.U.HT=function(){}; g.U.d0=function(){this.info("disposeInternal");lHh(this);this.D&&(this.D.removeUpdateListener(this.Ae),this.D.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.v6));this.D=null;RD.prototype.d0.call(this)}; g.U.UVY=function(m,V){if(!this.UH())if(V)if(V=OK(V),g.NA(V))switch(m=""+V.type,V=V.data||{},this.info("onYoutubeMessage_: "+m+" "+g.ab(V)),m){case "mdxSessionStatus":ZJA(this,V);break;case "loungeToken":iJA(this,V);break;default:gl(this,"Unknown youtube message: "+m)}else gl(this,"Unable to parse message.");else gl(this,"No data in message.")}; g.U.rf=function(m,V,O,h){g.W7(this.V);this.V=0;bJW(this.T,this.L.label,m,this.L.friendlyName,(0,g.IA)(function(w){w?V(w):h>=0?(gl(this,"Screen "+m+" appears to be offline. "+h+" retries left."),this.V=g.t6((0,g.IA)(this.rf,this,m,V,O,h-1),300)):O(Error("Unable to fetch screen."))},this),O)}; g.U.t5=function(){return this.D}; g.U.wD=function(m){this.UH()||m||(gl(this,"Cast session died."),this.jm())};g.t(U8,RD);g.U=U8.prototype;g.U.Ks=function(m){this.D=m;this.D.addUpdateListener(this.EH)}; g.U.Xe=function(m){this.H6=m;this.Zu()}; g.U.stop=function(){wZA(this);this.D?this.D.stop((0,g.IA)(this.jm,this,null),(0,g.IA)(this.jm,this,"Failed to stop DIAL device.")):this.jm()}; g.U.d0=function(){wZA(this);this.D&&this.D.removeUpdateListener(this.EH);this.D=null;RD.prototype.d0.call(this)}; g.U.ph=function(m){this.UH()||m||(gl(this,"DIAL session died."),this.K(),this.K=function(){},this.jm())};g.t(Kv,RD);Kv.prototype.stop=function(){this.jm()}; Kv.prototype.Ks=function(){}; Kv.prototype.Xe=function(){g.W7(this.D);this.D=NaN;var m=EK(this.T.uC(),this.L.label);m?oD(this,m):this.jm(Error("No such screen"))}; Kv.prototype.d0=function(){g.W7(this.D);this.D=NaN;RD.prototype.d0.call(this)};g.t(WR,g.yh);g.U=WR.prototype; g.U.init=function(m,V){chrome.cast.timeout.requestSession=3E4;var O=new chrome.cast.SessionRequest(this.V,[chrome.cast.Capability.AUDIO_OUT]);g.Tm("desktop_enable_cast_connect")&&(O.androidReceiverCompatible=!0);this.Qt||(O.dialRequest=new chrome.cast.DialRequest("YouTube"));var h=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;m=m||this.N?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var w=(0,g.IA)(this.qZA,this);O=new chrome.cast.ApiConfig(O,(0,g.IA)(this.M7, this),w,h,m);O.customDialLaunchCallback=(0,g.IA)(this.b4A,this);chrome.cast.initialize(O,(0,g.IA)(function(){this.UH()||(chrome.cast.addReceiverActionListener(this.K),g4W(),this.L.subscribe("onlineScreenChange",(0,g.IA)(this.Nu,this)),this.D=LB$(this),chrome.cast.setCustomReceivers(this.D,function(){},(0,g.IA)(function(y){this.D8("Failed to set initial custom receivers: "+g.ab(y))},this)),this.publish("yt-remote-cast2-availability-change",HR(this)),V(!0))},this),(0,g.IA)(function(y){this.D8("Failed to initialize API: "+ g.ab(y)); V(!1)},this))}; g.U.XjH=function(m,V){XH("Setting connected screen ID: "+m+" -> "+V);if(this.Z){var O=this.Z.Z;if(!m||O&&O.id!=m)XH("Unsetting old screen status: "+this.Z.L.friendlyName),T2(this,null)}if(m&&V){if(!this.Z){m=EK(this.L.uC(),m);if(!m){XH("setConnectedScreenStatus: Unknown screen.");return}if(m.idType=="shortLived"){XH("setConnectedScreenStatus: Screen with id type to be short lived.");return}O=y8J(this,m);O||(XH("setConnectedScreenStatus: Connected receiver not custom..."),O=new chrome.cast.Receiver(m.uuid? m.uuid:m.id,m.name),O.receiverType=chrome.cast.ReceiverType.CUSTOM,this.D.push(O),chrome.cast.setCustomReceivers(this.D,function(){},(0,g.IA)(function(h){this.D8("Failed to set initial custom receivers: "+g.ab(h))},this))); XH("setConnectedScreenStatus: new active receiver: "+O.friendlyName);T2(this,new Kv(this.L,O),!0)}this.Z.HT(V)}else XH("setConnectedScreenStatus: no screen.")}; g.U.rnH=function(m){this.UH()?this.D8("Setting connection data on disposed cast v2"):this.Z?this.Z.Xe(m):this.D8("Setting connection data without a session")}; g.U.Bq=function(){this.UH()?this.D8("Stopping session on disposed cast v2"):this.Z?(this.Z.stop(),T2(this,null)):XH("Stopping non-existing session")}; g.U.requestSession=function(){chrome.cast.requestSession((0,g.IA)(this.M7,this),(0,g.IA)(this.C6z,this))}; g.U.d0=function(){this.L.unsubscribe("onlineScreenChange",(0,g.IA)(this.Nu,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.K);var m=xBh,V=g.$I("yt.mdx.remote.debug.handlers_");g.Om(V||[],m);g.Ag(this.Z);g.yh.prototype.d0.call(this)}; g.U.D8=function(m){hA("Controller",m)}; g.U.PO=function(m,V){this.Z==m&&(V||T2(this,null),this.publish("yt-remote-cast2-session-change",V))}; g.U.HfH=function(m,V){if(!this.UH())if(m)switch(m.friendlyName=chrome.cast.unescape(m.friendlyName),XH("onReceiverAction_ "+m.label+" / "+m.friendlyName+"-- "+V),V){case chrome.cast.ReceiverAction.CAST:if(this.Z)if(this.Z.L.label!=m.label)XH("onReceiverAction_: Stopping active receiver: "+this.Z.L.friendlyName),this.Z.stop();else{XH("onReceiverAction_: Casting to active receiver.");this.Z.Z&&this.publish("yt-remote-cast2-session-change",this.Z.Z);break}switch(m.receiverType){case chrome.cast.ReceiverType.CUSTOM:T2(this, new Kv(this.L,m));break;case chrome.cast.ReceiverType.DIAL:T2(this,new U8(this.L,m,this.T,this.config_));break;case chrome.cast.ReceiverType.CAST:T2(this,new AA(this.L,m,this.config_));break;default:this.D8("Unknown receiver type: "+m.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.Z&&this.Z.L.label==m.label?this.Z.stop():this.D8("Stopping receiver w/o session: "+m.friendlyName)}else this.D8("onReceiverAction_ called without receiver.")}; g.U.b4A=function(m){if(this.UH())return Promise.reject(Error("disposed"));var V=m.receiver;V.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.D8("Not DIAL receiver: "+V.friendlyName),V.receiverType=chrome.cast.ReceiverType.DIAL);var O=this.Z?this.Z.L:null;if(!O||O.label!=V.label)return this.D8("Receiving DIAL launch request for non-clicked DIAL receiver: "+V.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(O&&O.label==V.label&&O.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.Z.Z)return XH("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.Z.Z),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.D8('Changing CAST intent from "'+O.receiverType+'" to "dial" for '+V.friendlyName);T2(this,new U8(this.L,V,this.T,this.config_))}V=this.Z;V.V=m;V.V.appState==chrome.cast.DialAppState.RUNNING?(m=V.V.extraData||{},O=m.screenId||null,dl(V)&&m.loungeToken?m.loungeTokenRefreshIntervalMs?m=VUa(V,{name:V.L.friendlyName,screenId:m.screenId,loungeToken:m.loungeToken,dialId:V.V.receiver.label, screenIdType:"shortLived"},m.loungeTokenRefreshIntervalMs):(g.wt(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(m)+".")),m=OpA(V,O)):m=OpA(V,O)):m=PBa(V);return m}; g.U.M7=function(m){var V=this;if(!this.UH()&&!this.N){XH("New cast session ID: "+m.sessionId);var O=m.receiver;if(O.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.Z)if(O.receiverType==chrome.cast.ReceiverType.CAST)XH("Got resumed cast session before resumed mdx connection."),O.friendlyName=chrome.cast.unescape(O.friendlyName),T2(this,new AA(this.L,O,this.config_),!0);else{this.D8("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var h=this.Z.L,w=EK(this.L.uC(), h.label);w&&J$(w,O.label)&&h.receiverType!=chrome.cast.ReceiverType.CAST&&O.receiverType==chrome.cast.ReceiverType.CAST&&(XH("onSessionEstablished_: manual to cast session change "+O.friendlyName),g.Ag(this.Z),this.Z=new AA(this.L,O,this.config_),this.Z.subscribe("sessionScreen",(0,g.IA)(this.PO,this,this.Z)),this.Z.subscribe("sessionFailed",function(){return j$z(V,V.Z)}),this.Z.Xe(null)); this.Z.Ks(m)}}}; g.U.Ch=function(){return this.Z?this.Z.t5():null}; g.U.C6z=function(m){this.UH()||(this.D8("Failed to estabilish a session: "+g.ab(m)),m.code!=chrome.cast.ErrorCode.CANCEL&&T2(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.U.qZA=function(m){XH("Receiver availability updated: "+m);if(!this.UH()){var V=HR(this);this.J=m==chrome.cast.ReceiverAvailability.AVAILABLE;HR(this)!=V&&this.publish("yt-remote-cast2-availability-change",HR(this))}}; g.U.Nu=function(){this.UH()||(this.D=LB$(this),XH("Updating custom receivers: "+g.ab(this.D)),chrome.cast.setCustomReceivers(this.D,function(){},(0,g.IA)(function(){this.D8("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",HR(this)))}; WR.prototype.setLaunchParams=WR.prototype.rnH;WR.prototype.setConnectedScreenStatus=WR.prototype.XjH;WR.prototype.stopSession=WR.prototype.Bq;WR.prototype.getCastSession=WR.prototype.Ch;WR.prototype.requestSession=WR.prototype.requestSession;WR.prototype.init=WR.prototype.init;WR.prototype.dispose=WR.prototype.dispose;var Wma=g.BX(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"]),gkn=[],x2J=g.fK(Wma);g.U=Ne.prototype; g.U.reset=function(m){this.listId="";this.index=-1;this.videoId="";WBW(this);this.volume=-1;this.muted=!1;m&&(this.index=m.index,this.listId=m.listId,this.videoId=m.videoId,this.playerState=m.playerState,this.volume=m.volume,this.muted=m.muted,this.audioTrackId=m.audioTrackId,this.trackData=m.trackData,this.hasPrevious=m.hasPrevious,this.hasNext=m.hasNext,this.N=m.playerTime,this.K=m.playerTimeAt,this.L=m.seekableStart,this.J=m.seekableEnd,this.D=m.duration,this.loadedTime=m.loadedTime,this.Z=m.liveIngestionTime, this.T=!isNaN(this.Z))}; g.U.isPlaying=function(){return this.playerState==1}; g.U.isBuffering=function(){return this.playerState==3}; g.U.qb=function(m){this.D=isNaN(m)?0:m}; g.U.getDuration=function(){return this.T?this.D+bH(this):this.D}; g.U.clone=function(){return new Ne(HpG(this))};g.t(uH,g.yh);g.U=uH.prototype;g.U.getState=function(){return this.D}; g.U.xE=function(){return this.T.getReconnectTimeout()}; g.U.bq=function(){this.T.reconnect()}; g.U.play=function(){Zd(this)?(this.Z?this.Z.play(null,g.G3,iH(this,"play")):aD(this,"play"),YbI(this,1,ST(z2(this))),this.publish("remotePlayerChange")):s8(this,this.play)}; g.U.pause=function(){Zd(this)?(this.Z?this.Z.pause(null,g.G3,iH(this,"pause")):aD(this,"pause"),YbI(this,2,ST(z2(this))),this.publish("remotePlayerChange")):s8(this,this.pause)}; g.U.seekTo=function(m){if(Zd(this)){if(this.Z){var V=z2(this),O=new chrome.cast.media.SeekRequest;O.currentTime=m;V.isPlaying()||V.isBuffering()?O.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:O.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.Z.seek(O,g.G3,iH(this,"seekTo",{newTime:m}))}else aD(this,"seekTo",{newTime:m});YbI(this,3,m);this.publish("remotePlayerChange")}else s8(this,g.e$(this.seekTo,m))}; g.U.stop=function(){if(Zd(this)){this.Z?this.Z.stop(null,g.G3,iH(this,"stopVideo")):aD(this,"stopVideo");var m=z2(this);m.index=-1;m.videoId="";WBW(m);FH(this,m);this.publish("remotePlayerChange")}else s8(this,this.stop)}; g.U.setVolume=function(m,V){if(Zd(this)){var O=z2(this);if(this.L){if(O.volume!=m){var h=Math.round(m)/100;this.L.setReceiverVolumeLevel(h,(0,g.IA)(function(){wl("set receiver volume: "+h)},this),(0,g.IA)(function(){this.D8("failed to set receiver volume.")},this))}O.muted!=V&&this.L.setReceiverMuted(V,(0,g.IA)(function(){wl("set receiver muted: "+V)},this),(0,g.IA)(function(){this.D8("failed to set receiver muted.")},this))}else{var w={volume:m, muted:V};O.volume!=-1&&(w.delta=m-O.volume);aD(this,"setVolume",w)}O.muted=V;O.volume=m;FH(this,O)}else s8(this,g.e$(this.setVolume,m,V))}; g.U.J5=function(m,V){if(Zd(this)){var O=z2(this);m={videoId:m};V&&(O.trackData={trackName:V.name,languageCode:V.languageCode,sourceLanguageCode:V.translationLanguage?V.translationLanguage.languageCode:"",languageName:V.languageName,kind:V.kind},m.style=g.ab(V.style),g.S5(m,O.trackData));aD(this,"setSubtitlesTrack",m);FH(this,O)}else s8(this,g.e$(this.J5,m,V))}; g.U.setAudioTrack=function(m,V){Zd(this)?(V=V.getLanguageInfo().getId(),aD(this,"setAudioTrack",{videoId:m,audioTrackId:V}),m=z2(this),m.audioTrackId=V,FH(this,m)):s8(this,g.e$(this.setAudioTrack,m,V))}; g.U.playVideo=function(m,V,O,h,w,y,L){h=h===void 0?null:h;w=w===void 0?null:w;y=y===void 0?null:y;L=L===void 0?null:L;var C=z2(this),E={videoId:m};O!==void 0&&(E.currentIndex=O);ID(C,m,O||0);V!==void 0&&(nv(C,V),E.currentTime=V);h&&(E.listId=h);w&&(E.playerParams=w);y&&(E.clickTrackingParams=y);L&&(E.locationInfo=g.ab(L));aD(this,"setPlaylist",E);h||FH(this,C)}; g.U.Uk=function(m,V){if(Zd(this)){if(m&&V){var O=z2(this);ID(O,m,V);FH(this,O)}aD(this,"previous")}else s8(this,g.e$(this.Uk,m,V))}; g.U.nextVideo=function(m,V){if(Zd(this)){if(m&&V){var O=z2(this);ID(O,m,V);FH(this,O)}aD(this,"next")}else s8(this,g.e$(this.nextVideo,m,V))}; g.U.C8=function(){if(Zd(this)){aD(this,"clearPlaylist");var m=z2(this);m.reset();FH(this,m);this.publish("remotePlayerChange")}else s8(this,this.C8)}; g.U.JW=function(){Zd(this)?aD(this,"dismissAutoplay"):s8(this,this.JW)}; g.U.dispose=function(){if(this.D!=3){var m=this.D;this.D=3;this.publish("proxyStateChange",m,this.D)}g.yh.prototype.dispose.call(this)}; g.U.d0=function(){$2G(this);this.T=null;this.K.clear();eT(this,null);g.yh.prototype.d0.call(this)}; g.U.Fm=function(m){if((m!=this.D||m==2)&&this.D!=3&&m!=0){var V=this.D;this.D=m;this.publish("proxyStateChange",V,m);if(m==1)for(;!this.K.isEmpty();)V=m=this.K,V.Z.length===0&&(V.Z=V.L,V.Z.reverse(),V.L=[]),m.Z.pop().apply(this);else m==3&&this.dispose()}}; g.U.v2Y=function(m,V){this.publish(m,V)}; g.U.ofS=function(m){if(!m)this.hV(null),eT(this,null);else if(this.L.receiver.volume){m=this.L.receiver.volume;var V=z2(this),O=Math.round(100*m.level||0);if(V.volume!=O||V.muted!=m.muted)wl("Cast volume update: "+m.level+(m.muted?" muted":"")),V.volume=O,V.muted=!!m.muted,FH(this,V)}}; g.U.hV=function(m){wl("Cast media: "+!!m);this.Z&&this.Z.removeUpdateListener(this.V);if(this.Z=m)this.Z.addUpdateListener(this.V),kvn(this),this.publish("remotePlayerChange")}; g.U.Mbz=function(m){m?(kvn(this),this.publish("remotePlayerChange")):this.hV(null)}; g.U.cF=function(){aD(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.U.NYN=function(){var m=d2h();m&&eT(this,m)}; g.U.D8=function(m){hA("CP",m)};g.t(BR,g.yh);g.U=BR.prototype; g.U.connect=function(m,V){if(V){var O=V.listId,h=V.videoId,w=V.videoIds,y=V.playerParams,L=V.clickTrackingParams,C=V.index,E={videoId:h},q=V.currentTime,M=V.locationInfo;V=V.loopMode;q!==void 0&&(E.currentTime=q<=5?0:q);y&&(E.playerParams=y);M&&(E.locationInfo=M);L&&(E.clickTrackingParams=L);O&&(E.listId=O);w&&w.length>0&&(E.videoIds=w.join(","));C!==void 0&&(E.currentIndex=C);this.EH&&(E.loopMode=V||"LOOP_MODE_OFF");O&&(this.Z.listId=O);this.Z.videoId=h;this.Z.index=C||0;this.Z.state=3;nv(this.Z, q);this.K="UNSUPPORTED";O=this.EH?"setInitialState":"setPlaylist";G2("Connecting with "+O+" and params: "+g.ab(E));this.L.connect({method:O,params:g.ab(E)},m,iZz())}else G2("Connecting without params"),this.L.connect({},m,iZz());N3A(this)}; g.U.Fw=function(m){this.L.Fw(m)}; g.U.dispose=function(){this.UH()||(g.TZ("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),pv(this,3));g.yh.prototype.dispose.call(this)}; g.U.d0=function(){bpn(this);SbM(this);nkc(this);g.W7(this.V);this.V=NaN;g.W7(this.Qt);this.Qt=NaN;this.T=null;g.kk(this.Zu);this.Zu.length=0;this.L.dispose();g.yh.prototype.d0.call(this);this.K=this.J=this.D=this.Z=this.L=null}; g.U.ej=function(m){if(!this.D||this.D.length===0)return!1;for(var V=g.D(this.D),O=V.next();!O.done;O=V.next())if(!O.value.capabilities.has(m))return!1;return!0}; g.U.QYr=function(){var m=3;this.UH()||(m=0,isNaN(this.Jv())?this.L.CM()&&isNaN(this.N)&&(m=1):m=2);return m}; g.U.y9=function(m){G2("Disconnecting with "+m);g.TZ("yt.mdx.remote.remoteClient_",null);bpn(this);this.publish("beforeDisconnect",m);m==1&&f1();this.L.disconnect(m);this.dispose()}; g.U.n0=function(){var m=this.Z;this.T&&(m=this.Z.clone(),ID(m,this.T,m.index));return HpG(m)}; g.U.pj6=function(m){var V=this,O=new Ne(m);O.videoId&&O.videoId!=this.Z.videoId&&(this.T=O.videoId,g.W7(this.V),this.V=g.t6(function(){if(V.T){var w=V.T;V.T=null;V.Z.videoId!=w&&lH(V,"getNowPlaying")}},5E3)); var h=[];this.Z.listId==O.listId&&this.Z.videoId==O.videoId&&this.Z.index==O.index||h.push("remoteQueueChange");this.Z.playerState==O.playerState&&this.Z.volume==O.volume&&this.Z.muted==O.muted&&ST(this.Z)==ST(O)&&g.ab(this.Z.trackData)==g.ab(O.trackData)||h.push("remotePlayerChange");this.Z.reset(m);g.An(h,function(w){this.publish(w)},this)}; g.U.tI=function(){var m=this.L.getDeviceId(),V=g.p5(this.D,function(O){return O.type=="REMOTE_CONTROL"&&O.id!=m}); return V?V.id:""}; g.U.Jv=function(){return this.L.xE()}; g.U.tM=function(){return this.K||"UNSUPPORTED"}; g.U.Nl=function(){return this.J||""}; g.U.xp=function(){!isNaN(this.Jv())&&this.L.bq()}; g.U.ttH=function(m,V){lH(this,m,V);eyW(this)}; g.U.eD=function(){var m=g.sx("SAPISID","")||g.sx("__Secure-1PAPISID")||"",V=g.sx("__Secure-3PAPISID","")||"";if(!m&&!V)return"";m=g.zI(g.uw(m),2);V=g.zI(g.uw(V),2);return g.zI(g.uw(","+m+","+V),2)}; BR.prototype.subscribe=BR.prototype.subscribe;BR.prototype.unsubscribeByKey=BR.prototype.jt;BR.prototype.getProxyState=BR.prototype.QYr;BR.prototype.disconnect=BR.prototype.y9;BR.prototype.getPlayerContextData=BR.prototype.n0;BR.prototype.setPlayerContextData=BR.prototype.pj6;BR.prototype.getOtherConnectedRemoteId=BR.prototype.tI;BR.prototype.getReconnectTimeout=BR.prototype.Jv;BR.prototype.getAutoplayMode=BR.prototype.tM;BR.prototype.getAutoplayVideoId=BR.prototype.Nl;BR.prototype.reconnect=BR.prototype.xp; BR.prototype.sendMessage=BR.prototype.ttH;BR.prototype.getXsrfToken=BR.prototype.eD;BR.prototype.isCapabilitySupportedOnConnectedDevices=BR.prototype.ej;g.t(Q$I,JA);g.U=Q$I.prototype;g.U.uC=function(m){return this.gy.$_gs(m)}; g.U.contains=function(m){return!!this.gy.$_c(m)}; g.U.get=function(m){return this.gy.$_g(m)}; g.U.start=function(){this.gy.$_st()}; g.U.add=function(m,V,O){this.gy.$_a(m,V,O)}; g.U.remove=function(m,V,O){this.gy.$_r(m,V,O)}; g.U.BL=function(m,V,O,h){this.gy.$_un(m,V,O,h)}; g.U.d0=function(){for(var m=this.Z.length,V=0;V1&&!this.U.getOption("remote","quickCast")?(this.SG=g.Um(m,this.Z,this),this.Wt(g.rb(m,this.Z)),m=this.U.getOption("remote","currentReceiver"),m=this.Z(m),this.options[m]&&this.St(m),this.enable(!0)):this.enable(!1)}; RN.prototype.Z=function(m){return m.key}; RN.prototype.fq=function(m){return m==="cast-selector-receiver"?"Elenco...":this.SG[m].name}; RN.prototype.Zk=function(m){g.$D.prototype.Zk.call(this,m);this.U.setOption("remote","currentReceiver",this.SG[m]);this.Qp.EU()};g.t(AJG,g.RZ);g.U=AJG.prototype; g.U.create=function(){var m=this.player.j(),V=g.BP(m);m={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:m.Y("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:m.Y("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:m.Y("enable_cast_short_lived_lounge_token")};O3n(V,m);this.subscriptions.push(g.V4("yt-remote-before-disconnect",this.Far,this));this.subscriptions.push(g.V4("yt-remote-connection-change",this.E2z,this));this.subscriptions.push(g.V4("yt-remote-receiver-availability-change",this.E1, this));this.subscriptions.push(g.V4("yt-remote-auto-connect",this.y66,this));this.subscriptions.push(g.V4("yt-remote-receiver-resumed",this.Uye,this));this.subscriptions.push(g.V4("mdx-privacy-popup-confirm",this.nAH,this));this.subscriptions.push(g.V4("mdx-privacy-popup-cancel",this.VJf,this));this.E1()}; g.U.load=function(){this.player.cancelPlayback();g.RZ.prototype.load.call(this);this.TQ=new gBc(this.player.j(),this);this.player.y$(this.TQ);this.pw=new ftH(this,this.player,this.hj);var m=(m=EBA())?m.currentTime:0;var V=Lmn()?new uH(jK(),void 0):null;m==0&&V&&(m=ST(z2(V)));m!==0&&this.Yf(m);U9a(this,this.Ol,this.Ol);this.player.ke(6)}; g.U.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.Wa();this.Eh=this.Qs;g.Uk(this.pw,this.hj);this.hj=this.TQ=this.pw=null;g.RZ.prototype.unload.call(this);this.player.ke(5);oN(this)}; g.U.d0=function(){g.OL(this.subscriptions);g.RZ.prototype.d0.call(this)}; g.U.XI=function(m){var V=g.AG.apply(1,arguments);this.loaded&&this.pw.d4.apply(this.pw,[m].concat(g.b(V)))}; g.U.getAdState=function(){return this.In}; g.U.hasPrevious=function(){return this.hj?z2(this.hj).hasPrevious:!1}; g.U.hasNext=function(){return this.hj?z2(this.hj).hasNext:!1}; g.U.Yf=function(m,V){this.V_=m||0;this.player.publish("progresssync",m,V);this.player.dB("onVideoProgress",m||0)}; g.U.getCurrentTime=function(){return this.V_}; g.U.getDuration=function(){return z2(this.hj).getDuration()||0}; g.U.K6=function(){var m=z2(this.hj);return m.T?m.Z+bH(m):m.Z}; g.U.X8=function(){return z2(this.hj).loadedTime}; g.U.qz=function(){return XZz(z2(this.hj))}; g.U.pQ=function(){var m=z2(this.hj);return m.L>0?m.L+bH(m):m.L}; g.U.getProgressState=function(){var m=z2(this.hj),V=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:m.playerState!=1081&&this.player.Cr(),clipEnd:V.clipEnd,clipStart:V.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:this.getDuration(),ingestionTime:this.K6(),isAtLiveHead:this.isAtLiveHead(),loaded:this.X8(),seekableEnd:this.qz(),seekableStart:this.pQ(),offset:0,viewerLivestreamJoinMediaTime:0}}; g.U.isAtLiveHead=function(){return XZz(z2(this.hj))-this.getCurrentTime()<=1}; g.U.nextVideo=function(){this.hj&&this.hj.nextVideo()}; g.U.Uk=function(){this.hj&&this.hj.Uk()}; g.U.Far=function(m){m===1&&(this.FR=this.hj?z2(this.hj):null)}; g.U.E2z=function(){var m=Lmn()?new uH(jK(),void 0):null;if(m){var V=this.Eh;this.loaded&&this.unload();this.hj=m;this.FR=null;V.key!==this.Qs.key&&(this.Eh=V,this.load())}else g.Ag(this.hj),this.hj=null,this.loaded&&(this.unload(),(m=this.FR)&&m.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(m.videoId,ST(m)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.U.E1=function(){var m=[this.Qs],V=m.concat,O=hQz();rl()&&g.eU("yt-remote-cast-available")&&O.push({key:"cast-selector-receiver",name:"Cast..."});this.SG=V.call(m,O);m=yJa()||this.Qs;gn(this,m);this.player.dB("onMdxReceiversChange")}; g.U.y66=function(){var m=yJa();gn(this,m)}; g.U.Uye=function(){this.Eh=yJa()}; g.U.nAH=function(){this.YX=!0;oN(this);E1=!1;Lg&&Cg(Lg,1);Lg=null}; g.U.VJf=function(){this.YX=!1;oN(this);gn(this,this.Qs);this.Eh=this.Qs;E1=!1;Lg=null;this.player.playVideo()}; g.U.QW=function(m,V){switch(m){case "casting":return this.loaded;case "receivers":return this.SG;case "currentReceiver":return V&&(V.key==="cast-selector-receiver"?tUh():gn(this,V)),this.loaded?this.Eh:this.Qs;case "quickCast":return this.SG.length===2&&this.SG[1].key==="cast-selector-receiver"?(V&&tUh(),!0):!1}}; g.U.cF=function(){this.hj.cF()}; g.U.Pf=function(){return!1}; g.U.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.U.isLoggedIn=function(){var m,V;return((m=g.Vf("PLAYER_CONFIG"))==null?void 0:(V=m.args)==null?void 0:V.authuser)!==void 0?!0:!(!g.Vf("SESSION_INDEX")&&!g.Vf("LOGGED_IN"))};g.xY("remote",AJG);})(_yt_player);