(function(g){var window=this;'use strict';var EGm=function(U){if(U instanceof g.kW)return U;if(typeof U.Km=="function")return U.Km(!1);if(g.UO(U)){var Y=0,A=new g.kW;A.next=function(){for(;;){if(Y>=U.length)return g.EL;if(Y in U)return g.RJ(U[Y++]);Y++}}; return A}throw Error("Not implemented");},oGO=function(U,Y,A){if(g.UO(U))g.MF(U,Y,A); else for(U=EGm(U);;){var c=U.next();if(c.done)break;Y.call(A,c.value,void 0,U)}},CP=function(U){g.PP(U,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^g.om()).toString(36)); return U},Uo=function(U,Y,A){Array.isArray(A)||(A=[String(A)]); g.bLX(U.j,Y,A)},zHq=function(U,Y){var A=[]; oGO(Y,function(c){try{var d=g.au.prototype.T.call(this,c,!0)}catch(T){if(T=="Storage: Invalid value was encountered")return;throw T;}d===void 0?A.push(c):g.Im4(d)&&A.push(c)},U); return A},Lmo=function(U,Y){zHq(U,Y).forEach(function(A){g.au.prototype.remove.call(this,A)},U)},rfw=function(U){if(U.sT){if(U.sT.locationOverrideToken)return{locationOverrideToken:U.sT.locationOverrideToken}; if(U.sT.latitudeE7!=null&&U.sT.longitudeE7!=null)return{latitudeE7:U.sT.latitudeE7,longitudeE7:U.sT.longitudeE7}}return null},lDw=function(U,Y){g.Go(U,Y)||U.push(Y)},Prq=function(U){var Y=0,A; for(A in U)Y++;return Y},VrT=function(U,Y){return g.uw(U,Y)},$Lm=function(U){try{return g.Dc.JSON.parse(U)}catch(Y){}U=String(U); if(/^\s*$/.test(U)?0:/^[\],:{}\s\u2028\u2029]*$/.test(U.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("("+U+")")}catch(Y){}throw Error("Invalid JSON string: "+U);},YY=function(U){if(g.Dc.JSON)try{return g.Dc.JSON.parse(U)}catch(Y){}return $Lm(U)},vGz=function(){var U=Ae(); this.Y=U;U.S2("/client_streamz/youtube/living_room/mdx/channel/opened",g.lY("channel_type"))},Hlm=function(){var U=Ae(); this.Y=U;U.S2("/client_streamz/youtube/living_room/mdx/channel/closed",g.lY("channel_type"))},Gwz=function(){var U=Ae(); this.Y=U;U.S2("/client_streamz/youtube/living_room/mdx/channel/message_received",g.lY("channel_type"))},WmT=function(){var U=Ae(); this.Y=U;U.S2("/client_streamz/youtube/living_room/mdx/channel/success")},wnz=function(){var U=Ae(); this.Y=U;U.S2("/client_streamz/youtube/living_room/mdx/channel/error",g.lY("channel_type"),g.lY("error_type"))},ilq=function(){var U=Ae(); this.Y=U;U.S2("/client_streamz/youtube/living_room/mdx/browser_channel/pending_maps")},Jfo=function(){var U=Ae(); this.Y=U;U.S2("/client_streamz/youtube/living_room/mdx/browser_channel/undelivered_maps")},FmT=function(U){if(U.Bm&&typeof U.Bm=="function")return U.Bm(); if(typeof Map!=="undefined"&&U instanceof Map||typeof Set!=="undefined"&&U instanceof Set)return Array.from(U.values());if(typeof U==="string")return U.split("");if(g.UO(U)){for(var Y=[],A=U.length,c=0;c1){if(A%2)throw Error("Uneven number of arguments");for(var c=0;c5&&(U=U.slice(U.length-5)); var Y=g.mk(loY(),function(c){return c.loungeToken}),A=g.mk(U,function(c){return c.loungeToken}); g.gv(A,function(c){return!g.Go(Y,c)})&&PHY(); g.fU("yt-remote-local-screens",U,31536E3)},VD=function(U){U||(g.Sh("yt-remote-session-screen-id"),g.Sh("yt-remote-session-video-id")); LzF();U=l4();g.wL(U,P6());oxI(U)},$Rq=function(){if(!$Y){var U=g.MQ(); U&&($Y=new g.X7(U))}},vxw=function(){$Rq(); return $Y?!!$Y.get("yt-remote-use-staging-server"):!1},v6=function(U,Y){g.T4[U]=!0; var A=g.cx();A&&A.publish.apply(A,arguments);g.T4[U]=!1},HUq=function(){},Ae=function(){if(!H6){H6=new g.pe(new HUq); var U=g.Jf("client_streamz_web_flush_count",-1);U!==-1&&(H6.W=U)}return H6},G0Y=function(){var U=window.navigator.userAgent.match(/Chrome\/([0-9]+)/); return U?parseInt(U[1],10):0},Wzo=function(U){return!!document.currentScript&&(document.currentScript.src.indexOf("?"+U)!=-1||document.currentScript.src.indexOf("&"+U)!=-1)},w5T=function(){return typeof window.__onGCastApiAvailable=="function"?window.__onGCastApiAvailable:null},G9=function(U){U.length?iUj(U.shift(),function(){G9(U)}):Juw()},FzL=function(U){return"chrome-extension://"+U+"/cast_sender.js"},iUj=function(U,Y,A){var c=document.createElement("script"); c.onerror=Y;A&&(c.onload=A);g.z$(c,g.ta(U));(document.head||document.documentElement).appendChild(c)},jbz=function(){var U=G0Y(),Y=[]; if(U>1){var A=U-1;Y.push("//www.gstatic.com/eureka/clank/"+U+"/cast_sender.js");Y.push("//www.gstatic.com/eureka/clank/"+A+"/cast_sender.js")}return Y},Juw=function(){var U=w5T(); U&&U(!1,"No cast extension found")},tho=function(){if(N3m){var U=2,Y=w5T(),A=function(){U--; U==0&&Y&&Y(!0)}; window.__onGCastApiAvailable=A;iUj("//www.gstatic.com/cast/sdk/libs/sender/1.0/cast_framework.js",Juw,A)}},eYF=function(){tho(); var U=jbz();U.push("//www.gstatic.com/eureka/clank/cast_sender.js");G9(U)},X5I=function(){tho(); var U=jbz();U.push.apply(U,g.X(B3w.map(FzL)));U.push("//www.gstatic.com/eureka/clank/cast_sender.js");G9(U)},W6=function(U,Y,A){g.p.call(this); this.J=A!=null?(0,g.dL)(U,A):U;this.Ar=Y;this.K=(0,g.dL)(this.OQ,this);this.Y=!1;this.T=0;this.W=this.Z5=null;this.j=[]},wm=function(){},k0Y=function(){g.uY.call(this,"p")},RYO=function(){g.uY.call(this,"o")},xRT=function(){return aoz=aoz||new g.PO},sbL=function(U){g.uY.call(this,"serverreachability",U)},i4=function(U){var Y=xRT(); Y.dispatchEvent(new sbL(Y,U))},foq=function(U){g.uY.call(this,"statevent",U)},Je=function(U){var Y=xRT(); Y.dispatchEvent(new foq(Y,U))},hYW=function(U,Y,A,c){g.uY.call(this,"timingevent",U); this.size=Y;this.rtt=A;this.retries=c},F5=function(U,Y){if(typeof U!=="function")throw Error("Fn must not be null and must be a function"); return g.Dc.setTimeout(function(){U()},Y)},jX=function(){},Nh=function(U,Y,A,c){this.W=U; this.j=Y;this.mH=A;this.R1=c||1;this.i$=new g.G6(this);this.qI=45E3;this.Uv=null;this.J=!1;this.X=this.Zf=this.Z=this.kE=this.ov=this.VJ=this.Pw=null;this.Hw=[];this.Y=null;this.G=0;this.K=this.jX=null;this.ws=-1;this.eX=!1;this.Ly=0;this.dW=null;this.AP=this.yJ=this.Tk=this.QJ=!1;this.T=new SIW},SIW=function(){this.W=null; this.Y="";this.T=!1},bUz=function(U,Y,A){U.kE=1; U.Z=CP(Y.clone());U.X=A;U.QJ=!0;Mhm(U,null)},Mhm=function(U,Y){U.ov=Date.now(); te(U);U.Zf=U.Z.clone();Uo(U.Zf,"t",U.R1);U.G=0;var A=U.W.kE;U.T=new SIW;U.Y=p5O(U.W,A?Y:null,!U.X);U.Ly>0&&(U.dW=new g.Yc((0,g.dL)(U.fS,U,U.Y),U.Ly));U.i$.listen(U.Y,"readystatechange",U.z0);Y=U.Uv?g.YR(U.Uv):{};U.X?(U.jX||(U.jX="POST"),Y["Content-Type"]="application/x-www-form-urlencoded",U.Y.send(U.Zf,U.jX,U.X,Y)):(U.jX="GET",U.Y.send(U.Zf,U.jX,null,Y));i4(1)},ZUL=function(U){if(!QbO(U))return g.u7(U.Y); var Y=g.Ke(U.Y);if(Y==="")return"";var A="",c=Y.length,d=g.Dm(U.Y)==4;if(!U.T.W){if(typeof TextDecoder==="undefined")return eX(U),B6(U),"";U.T.W=new g.Dc.TextDecoder}for(var T=0;TY.length)return OUI;Y=Y.slice(c,c+A);U.G=c+A;return Y},te=function(U){U.VJ=Date.now()+U.qI; yuq(U,U.qI)},yuq=function(U,Y){if(U.Pw!=null)throw Error("WatchDog timer not null"); U.Pw=F5((0,g.dL)(U.dR,U),Y)},nxF=function(U){U.Pw&&(g.Dc.clearTimeout(U.Pw),U.Pw=null)},B6=function(U){U.W.oe()||U.eX||DRW(U.W,U)},eX=function(U){nxF(U); g.P7(U.dW);U.dW=null;U.i$.removeAll();if(U.Y){var Y=U.Y;U.Y=null;Y.abort();Y.dispose()}},AQq=function(U,Y){try{var A=U.W; if(A.YC!=0&&(A.Y==U||Ioo(A.T,U)))if(!U.yJ&&Ioo(A.T,U)&&A.YC==3){try{var c=A.Ix.Y.parse(Y)}catch(F){c=null}if(Array.isArray(c)&&c.length==3){var d=c;if(d[0]==0)a:{if(!A.Z){if(A.Y)if(A.Y.ov+3E30&&(A.Ly=1.5*L);c=A;var r=U.G1();if(r){var l=g.q3(r,"X-Client-Wire-Protocol");if(l){var P=c.T;!P.Y&&(g.Gd(l,"spdy")||g.Gd(l,"quic")||g.Gd(l,"h2"))&&(P.j=P.K,P.Y=new Set,P.T&&(qIO(P,P.T),P.T=null))}if(c.QJ){var V=g.q3(r,"X-HTTP-Session-Id");V&&(c.o2=V,g.PP(c.Uv,c.QJ,V))}}A.YC=3;A.K&&A.K.Ei();A.qz&&(A.KU=Date.now()-U.ov);c=A;var v=U;c.tb=CHI(c,c.kE?c.R1:null,c.mH);if(v.yJ){UCj(c.T, v);var H=v,G=c.Ly;G&&H.setTimeout(G);H.Pw&&(nxF(H),te(H));c.Y=v}else YuI(c);A.W.length>0&&ai(A)}else T[0]!="stop"&&T[0]!="close"||Ri(A,7);else A.YC==3&&(T[0]=="stop"||T[0]=="close"?T[0]=="stop"?Ri(A,7):A.disconnect():T[0]!="noop"&&A.K&&A.K.aq(T),A.Hw=0)}i4(4)}catch(F){}},cQI=function(U,Y){this.Y=U; this.map=Y;this.context=null},dCm=function(U){this.K=U||10; g.Dc.PerformanceNavigationTiming?(U=g.Dc.performance.getEntriesByType("navigation"),U=U.length>0&&(U[0].nextHopProtocol=="hq"||U[0].nextHopProtocol=="h2")):U=!!(g.Dc.chrome&&g.Dc.chrome.loadTimes&&g.Dc.chrome.loadTimes()&&g.Dc.chrome.loadTimes().wasFetchedViaSpdy);this.j=U?this.K:1;this.Y=null;this.j>1&&(this.Y=new Set);this.T=null;this.W=[]},T7o=function(U){return U.T?!0:U.Y?U.Y.size>=U.j:!1},Kzm=function(U){return U.T?1:U.Y?U.Y.size:0},Ioo=function(U,Y){return U.T?U.T==Y:U.Y?U.Y.has(Y):!1},qIO= function(U,Y){U.Y?U.Y.add(Y):U.T=Y},UCj=function(U,Y){U.T&&U.T==Y?U.T=null:U.Y&&U.Y.has(Y)&&U.Y.delete(Y)},E6q=function(U){if(U.T!=null)return U.W.concat(U.T.Hw); if(U.Y!=null&&U.Y.size!==0){var Y=U.W;U=g.J(U.Y.values());for(var A=U.next();!A.done;A=U.next())Y=Y.concat(A.value.Hw);return Y}return g.FI(U.W)},o6O=function(U,Y){var A=new jX; if(g.Dc.Image){var c=new Image;c.onload=g.EO(xY,A,"TestLoadImage: loaded",!0,Y,c);c.onerror=g.EO(xY,A,"TestLoadImage: error",!1,Y,c);c.onabort=g.EO(xY,A,"TestLoadImage: abort",!1,Y,c);c.ontimeout=g.EO(xY,A,"TestLoadImage: timeout",!1,Y,c);g.Dc.setTimeout(function(){if(c.ontimeout)c.ontimeout()},1E4); c.src=U}else Y(!1)},z9I=function(U,Y){var A=new jX,c=new AbortController,d=setTimeout(function(){c.abort(); xY(A,"TestPingServer: timeout",!1,Y)},1E4); fetch(U,{signal:c.signal}).then(function(T){clearTimeout(d);T.ok?xY(A,"TestPingServer: ok",!0,Y):xY(A,"TestPingServer: server error",!1,Y)}).catch(function(){clearTimeout(d); xY(A,"TestPingServer: error",!1,Y)})},xY=function(U,Y,A,c,d){try{d&&(d.onload=null,d.onerror=null,d.onabort=null,d.ontimeout=null),c(A)}catch(T){}},Lvo=function(){this.Y=new wm},rQz=function(U,Y,A){var c=A||""; try{NFz(U,function(d,T){var E=d;g.Yz(d)&&(E=g.Zm(d));Y.push(c+T+"="+encodeURIComponent(E))})}catch(d){throw Y.push(c+"type="+encodeURIComponent("_badmap")),d; }},so=function(U,Y,A){return A&&A.IfX?A.IfX[U]||Y:Y},lNw=function(U){this.W=[]; this.R1=this.tb=this.Uv=this.mH=this.Y=this.o2=this.QJ=this.eX=this.G=this.ws=this.X=null;this.Bu=this.Zf=0;this.mA=so("failFast",!1,U);this.yJ=this.Pw=this.Z=this.J=this.K=null;this.Lr=!0;this.Va=this.dW=-1;this.AP=this.Hw=this.ov=0;this.zs=so("baseRetryDelayMs",5E3,U);this.fV=so("retryDelaySeedMs",1E4,U);this.b1=so("forwardChannelMaxRetries",2,U);this.qe=so("forwardChannelRequestTimeoutMs",2E4,U);this.q5=U&&U.syW||void 0;this.Zh=U&&U.wrY||void 0;this.sT=U&&U.o9J||!1;this.Ly=void 0;this.kE=U&&U.QeI|| !1;this.j="";this.T=new dCm(U&&U.fHn);this.Ix=new Lvo;this.i$=U&&U.ofY||!1;this.VJ=U&&U.V4I||!1;this.i$&&this.VJ&&(this.VJ=!1);this.NU=U&&U.gDY||!1;U&&U.AUE&&(this.Lr=!1);this.qz=!this.i$&&this.Lr&&U&&U.LpJ||!1;this.nU=void 0;U&&U.xq&&U.xq>0&&(this.nU=U.xq);this.Me=void 0;this.KU=0;this.qI=!1;this.Tk=this.jX=null},kY=function(U){U.Y&&(PWf(U),U.Y.cancel(),U.Y=null)},VAT=function(U){kY(U); U.Z&&(g.Dc.clearTimeout(U.Z),U.Z=null);X5(U);U.T.cancel();U.J&&(typeof U.J==="number"&&g.Dc.clearTimeout(U.J),U.J=null)},ai=function(U){T7o(U.T)||U.J||(U.J=!0,g.jW(U.l7,U),U.ov=0)},v6T=function(U,Y){if(Kzm(U.T)>=U.T.j-(U.J?1:0))return!1; if(U.J)return U.W=Y.Hw.concat(U.W),!0;if(U.YC==1||U.YC==2||U.ov>=(U.mA?0:U.b1))return!1;U.J=F5((0,g.dL)(U.l7,U,Y),$Cq(U,U.ov));U.ov++;return!0},G1T=function(U,Y){var A; Y?A=Y.mH:A=U.Zf++;var c=U.Uv.clone();g.PP(c,"SID",U.j);g.PP(c,"RID",A);g.PP(c,"AID",U.dW);fp(U,c);U.G&&U.X&&g.HP(c,U.G,U.X);A=new Nh(U,U.j,A,U.ov+1);U.G===null&&(A.Uv=U.X);Y&&(U.W=Y.Hw.concat(U.W));Y=HgW(U,A,1E3);A.setTimeout(Math.round(U.qe*.5)+Math.round(U.qe*.5*Math.random()));qIO(U.T,A);bUz(A,c,Y)},fp=function(U,Y){U.eX&&g.QY(U.eX,function(A,c){g.PP(Y,c,A)}); U.K&&NFz({},function(A,c){g.PP(Y,c,A)})},HgW=function(U,Y,A){A=Math.min(U.W.length,A); var c=U.K?(0,g.dL)(U.K.tf,U.K,U):null;a:{for(var d=U.W,T=-1;;){var E=["count="+A];T==-1?A>0?(T=d[0].Y,E.push("ofs="+T)):T=0:E.push("ofs="+T);for(var L=!0,r=0;r=3)return!1; U.AP++;U.Z=F5((0,g.dL)(U.Zi,U),$Cq(U,U.Hw));U.Hw++;return!0},PWf=function(U){U.jX!=null&&(g.Dc.clearTimeout(U.jX),U.jX=null)},WvL=function(U){U.Y=new Nh(U,U.j,"rpc",U.AP); U.G===null&&(U.Y.Uv=U.X);U.Y.Ly=0;var Y=U.tb.clone();g.PP(Y,"RID","rpc");g.PP(Y,"SID",U.j);g.PP(Y,"AID",U.dW);g.PP(Y,"CI",U.yJ?"0":"1");!U.yJ&&U.nU&&g.PP(Y,"TO",U.nU);g.PP(Y,"TYPE","xmlhttp");fp(U,Y);U.G&&U.X&&g.HP(Y,U.G,U.X);U.Ly&&U.Y.setTimeout(U.Ly);var A=U.Y;U=U.R1;A.kE=1;A.Z=CP(Y.clone());A.X=null;A.QJ=!0;Mhm(A,U)},X5=function(U){U.Pw!=null&&(g.Dc.clearTimeout(U.Pw),U.Pw=null)},DRW=function(U,Y){var A=null; if(U.Y==Y){X5(U);PWf(U);U.Y=null;var c=2}else if(Ioo(U.T,Y))A=Y.Hw,UCj(U.T,Y),c=1;else return;if(U.YC!=0)if(Y.J)if(c==1){A=Y.X?Y.X.length:0;Y=Date.now()-Y.ov;var d=U.ov;c=xRT();c.dispatchEvent(new hYW(c,A,Y,d));ai(U)}else YuI(U);else{var T=Y.ws;d=Y.getLastError();if(d==3||d==0&&T>0||!(c==1&&v6T(U,Y)||c==2&&uCT(U)))switch(A&&A.length>0&&(Y=U.T,Y.W=Y.W.concat(A)),d){case 1:Ri(U,5);break;case 4:Ri(U,10);break;case 3:Ri(U,6);break;default:Ri(U,2)}}},$Cq=function(U,Y){var A=U.zs+Math.floor(Math.random()* U.fV); U.isActive()||(A*=2);return A*Y},Ri=function(U,Y){if(Y==2){var A=(0,g.dL)(U.S9n,U),c=U.Zh,d=!c; c=new g.dq(c||"//www.google.com/images/cleardot.gif");g.Dc.location&&g.Dc.location.protocol=="http"||g.T6(c,"https");CP(c);d?o6O(c.toString(),A):z9I(c.toString(),A)}else Je(2);U.YC=0;U.K&&U.K.qr(Y);wAF(U);VAT(U)},wAF=function(U){U.YC=0; U.Tk=[];if(U.K){var Y=E6q(U.T);if(Y.length!=0||U.W.length!=0)g.NF(U.Tk,Y),g.NF(U.Tk,U.W),U.T.W.length=0,g.FI(U.W),U.W.length=0;U.K.LS()}},igj=function(U){if(U.YC==0)return U.Tk; var Y=[];g.NF(Y,E6q(U.T));g.NF(Y,U.W);return Y},CHI=function(U,Y,A){var c=g.VH(A); c.Y!=""?(Y&&g.EA(c,Y+"."+c.Y),g.oM(c,c.W)):(c=g.Dc.location,c=trm(c.protocol,Y?Y+"."+c.hostname:c.hostname,+c.port,A));Y=U.QJ;A=U.o2;Y&&A&&g.PP(c,Y,A);g.PP(c,"VER",U.Nr);fp(U,c);return c},p5O=function(U,Y,A){if(Y&&!U.kE)throw Error("Can't create secondary domain capable XhrIo object."); Y=U.sT&&!U.q5?new g.g9(new g.UA({jV:A})):new g.g9(U.q5);Y.G=U.kE;return Y},JQf=function(){},Fvw=function(){},SX=function(U,Y){g.PO.call(this); this.Y=new lNw(Y);this.K=U;this.T=Y&&Y.oty||null;U=Y&&Y.xzW||null;Y&&Y.b4y&&(U?U["X-Client-Protocol"]="webchannel":U={"X-Client-Protocol":"webchannel"});this.Y.X=U;U=Y&&Y.g$Y||null;Y&&Y.IM&&(U?U["X-WebChannel-Content-Type"]=Y.IM:U={"X-WebChannel-Content-Type":Y.IM});Y&&Y.DW&&(U?U["X-WebChannel-Client-Profile"]=Y.DW:U={"X-WebChannel-Client-Profile":Y.DW});this.Y.ws=U;(U=Y&&Y.ycE)&&!g.HG(U)&&(this.Y.G=U);this.J=Y&&Y.QeI||!1;this.j=Y&&Y.GAY||!1;(Y=Y&&Y.jvr)&&!g.HG(Y)&&(this.Y.QJ=Y,g.Df(this.T,Y)&&(U= this.T,Y in U&&delete U[Y]));this.W=new he(this)},jEj=function(U){k0Y.call(this); U.__headers__&&(this.headers=U.__headers__,this.statusCode=U.__status__,delete U.__headers__,delete U.__status__);var Y=U.__sm__;Y?this.data=(this.Y=g.gL(Y))?g.Cj(Y,this.Y):Y:this.data=U},N7T=function(U){RYO.call(this); this.status=1;this.errorCode=U},he=function(U){this.Y=U},tAm=function(U,Y){this.T=U; this.Y=Y},e9j=function(U){return igj(U.Y).map(function(Y){var A=U.T; Y=Y.map;"__data__"in Y?(Y=Y.__data__,A=A.j?$Lm(Y):Y):A=Y;return A})},Mh=function(U,Y){if(typeof U!=="function")throw Error("Fn must not be null and must be a function"); return g.Dc.setTimeout(function(){U()},Y)},pp=function(U){b4.dispatchEvent(new B7o(b4,U))},B7o=function(U){g.uY.call(this,"statevent",U)},QD=function(U,Y,A,c){this.Y=U; this.j=Y;this.G=A;this.J=c||1;this.T=45E3;this.W=new g.G6(this);this.K=new g.SW;this.K.setInterval(250)},k1q=function(U,Y,A){U.PB=1; U.ra=CP(Y.clone());U.hv=A;U.QJ=!0;XAo(U,null)},R9j=function(U,Y,A,c,d){U.PB=1; U.ra=CP(Y.clone());U.hv=null;U.QJ=A;d&&(U.mR=!1);XAo(U,c)},XAo=function(U,Y){U.cW=Date.now(); aNW(U);U.w_=U.ra.clone();Uo(U.w_,"t",U.J);U.YM=0;U.k5=U.Y.Kq(U.Y.O5()?Y:null);U.U0>0&&(U.iM=new g.Yc((0,g.dL)(U.pS,U,U.k5),U.U0));U.W.listen(U.k5,"readystatechange",U.Be);Y=U.Ci?g.YR(U.Ci):{};U.hv?(U.HB="POST",Y["Content-Type"]="application/x-www-form-urlencoded",U.k5.send(U.w_,U.HB,U.hv,Y)):(U.HB="GET",U.mR&&!g.DH&&(Y.Connection="close"),U.k5.send(U.w_,U.HB,null,Y));U.Y.BK(1)},fNz=function(U,Y){var A=U.YM,c=Y.indexOf("\n",A); if(c==-1)return xCw;A=Number(Y.substring(A,c));if(isNaN(A))return sEW;c+=1;if(c+A>Y.length)return xCw;Y=Y.slice(c,c+A);U.YM=c+A;return Y},aNW=function(U){U.JL=Date.now()+U.T; h9z(U,U.T)},h9z=function(U,Y){if(U.oD!=null)throw Error("WatchDog timer not null"); U.oD=Mh((0,g.dL)(U.b3,U),Y)},Suw=function(U){U.oD&&(g.Dc.clearTimeout(U.oD),U.oD=null)},MAo=function(U){U.Y.oe()||U.GL||U.Y.SA(U)},Z2=function(U){Suw(U); g.P7(U.iM);U.iM=null;U.K.stop();U.W.removeAll();if(U.k5){var Y=U.k5;U.k5=null;Y.abort();Y.dispose()}U.bR&&(U.bR=null)},bgF=function(U,Y){try{U.Y.Rq(U,Y),U.Y.BK(4)}catch(A){}},QEO=function(U,Y,A,c,d){if(c==0)A(!1); else{var T=d||0;c--;pAj(U,Y,function(E){E?A(!0):g.Dc.setTimeout(function(){QEO(U,Y,A,c,T)},T)})}},pAj=function(U,Y,A){var c=new Image; c.onload=function(){try{Oo(c),A(!0)}catch(d){}}; c.onerror=function(){try{Oo(c),A(!1)}catch(d){}}; c.onabort=function(){try{Oo(c),A(!1)}catch(d){}}; c.ontimeout=function(){try{Oo(c),A(!1)}catch(d){}}; g.Dc.setTimeout(function(){if(c.ontimeout)c.ontimeout()},Y); c.src=U},Oo=function(U){U.onload=null; U.onerror=null;U.onabort=null;U.ontimeout=null},Zgo=function(U){this.Y=U; this.T=new wm},Ogz=function(U){var Y=m_(U.Y,U.yg,"/mail/images/cleardot.gif"); CP(Y);QEO(Y.toString(),5E3,(0,g.dL)(U.jY,U),3,2E3);U.BK(1)},mCF=function(U){var Y=U.Y.J; Y!=null?(pp(5),Y?(pp(11),gm(U.Y,U,!1)):(pp(12),gm(U.Y,U,!0))):(U.IX=new QD(U),U.IX.Ci=U.eA,Y=U.Y,Y=m_(Y,Y.O5()?U.T4:null,U.rS),pp(5),Uo(Y,"TYPE","xmlhttp"),R9j(U.IX,Y,!1,U.T4,!1))},g6z=function(U,Y,A){this.Y=1; this.T=[];this.W=[];this.K=new wm;this.X=U||null;this.J=Y!=null?Y:null;this.Z=A||!1},yQf=function(U,Y){this.Y=U; this.map=Y;this.context=null},n6I=function(U,Y,A,c){g.uY.call(this,"timingevent",U); this.size=Y;this.rtt=A;this.retries=c},DCI=function(U){g.uY.call(this,"serverreachability",U)},u4o=function(U){U.fu(1,0); U.xM=m_(U,null,U.yf);INT(U)},Kvw=function(U){U.fI&&(U.fI.abort(),U.fI=null); U.QG&&(U.QG.cancel(),U.QG=null);U.VH&&(g.Dc.clearTimeout(U.VH),U.VH=null);yD(U);U.g9&&(U.g9.cancel(),U.g9=null);U.KI&&(g.Dc.clearTimeout(U.KI),U.KI=null)},quY=function(U,Y){if(U.Y==0)throw Error("Invalid operation: sending map when state is closed"); U.T.push(new yQf(U.NC++,Y));U.Y!=2&&U.Y!=3||INT(U)},CWq=function(U){var Y=0; U.QG&&Y++;U.g9&&Y++;return Y},INT=function(U){U.g9||U.KI||(U.KI=Mh((0,g.dL)(U.hV,U),0),U.AG=0)},AbT=function(U,Y){if(U.Y==1){if(!Y){U.tY=Math.floor(Math.random()*1E5); Y=U.tY++;var A=new QD(U,"",Y);A.Ci=U.Qe;var c=UbT(U),d=U.xM.clone();g.PP(d,"RID",Y);g.PP(d,"CVER","1");np(U,d);k1q(A,d,c);U.g9=A;U.Y=2}}else U.Y==3&&(Y?YCO(U,Y):U.T.length==0||U.g9||YCO(U))},YCO=function(U,Y){if(Y)if(U.Xb>6){U.T=U.W.concat(U.T); U.W.length=0;var A=U.tY-1;Y=UbT(U)}else A=Y.G,Y=Y.hv;else A=U.tY++,Y=UbT(U);var c=U.xM.clone();g.PP(c,"SID",U.j);g.PP(c,"RID",A);g.PP(c,"AID",U.v_);np(U,c);A=new QD(U,U.j,A,U.AG+1);A.Ci=U.Qe;A.setTimeout(1E4+Math.round(1E4*Math.random()));U.g9=A;k1q(A,c,Y)},np=function(U,Y){U.Th&&(U=U.Th.Hd())&&g.QY(U,function(A,c){g.PP(Y,c,A)})},UbT=function(U){var Y=Math.min(U.T.length,1E3),A=["count="+Y]; if(U.Xb>6&&Y>0){var c=U.T[0].Y;A.push("ofs="+c)}else c=0;for(var d={},T=0;T=3)return!1; U.G++;U.VH=Mh((0,g.dL)(U.VY,U),dbT(U,U.W_));U.W_++;return!0},gm=function(U,Y,A){U.Xv=U.J==null?A:!U.J; U.Eb=Y.Cl;U.Z||u4o(U)},yD=function(U){U.M3!=null&&(g.Dc.clearTimeout(U.M3),U.M3=null)},dbT=function(U,Y){var A=5E3+Math.floor(Math.random()*1E4); U.isActive()||(A*=2);return A*Y},D2=function(U,Y){if(Y==2||Y==9){var A=null; U.Th&&(A=null);var c=(0,g.dL)(U.e6I,U);A||(A=new g.dq("//www.google.com/images/cleardot.gif"),CP(A));pAj(A.toString(),1E4,c)}else pp(2);EFo(U,Y)},EFo=function(U,Y){U.Y=0; U.Th&&U.Th.X2(Y);oFW(U);Kvw(U)},oFW=function(U){U.Y=0; U.Eb=-1;if(U.Th)if(U.W.length==0&&U.T.length==0)U.Th.gS();else{var Y=g.FI(U.W),A=g.FI(U.T);U.W.length=0;U.T.length=0;U.Th.gS(Y,A)}},m_=function(U,Y,A){var c=g.VH(A); if(c.Y!="")Y&&g.EA(c,Y+"."+c.Y),g.oM(c,c.W);else{var d=window.location;c=trm(d.protocol,Y?Y+"."+d.hostname:d.hostname,+d.port,A)}U.zL&&g.QY(U.zL,function(T,E){g.PP(c,E,T)}); g.PP(c,"VER",U.Xb);np(U,c);return c},zFq=function(){},LwW=function(){this.Y=[]; this.T=[]},rbF=function(U){g.uY.call(this,"channelMessage"); this.message=U},l1z=function(U){g.uY.call(this,"channelError"); this.error=U},PzT=function(U,Y){this.action=U; this.params=Y||{}},Ii=function(U,Y){g.p.call(this); this.Y=new g.IM(this.xUJ,0,this);g.Z(this,this.Y);this.Ar=5E3;this.T=0;if(typeof U==="function")Y&&(U=(0,g.dL)(U,Y));else if(U&&typeof U.handleEvent==="function")U=(0,g.dL)(U.handleEvent,U);else throw Error("Invalid listener argument");this.W=U},V3Y=function(U,Y,A,c,d,T,E,L,r,l,P,V,v,H){A=A===void 0?!1:A; c=c===void 0?function(){return""}:c; d=d===void 0?!1:d;T=T===void 0?!1:T;E=E===void 0?!1:E;L=L===void 0?function(){return g.BO({})}:L; r=r===void 0?!1:r;P=P===void 0?!1:P;V=V===void 0?!1:V;v=v===void 0?!1:v;H=H===void 0?!1:H;this.kE=U;this.Pw=Y;this.J=new g.BF;this.T=new Ii(this.KiJ,this);this.Y=null;this.G=!1;this.X=null;this.ov="";this.Hw=this.Z=0;this.W=[];this.AP=A;this.QJ=c;this.K=T;this.Uv=L;this.eX=l;this.R1=E;this.jX=null;this.j=g.BO();this.mH=d;this.Tk=r;this.i$=P;this.VJ=V;this.Lr=v;this.ws=H;this.Ly=new vGz;this.yJ=new Hlm;this.qI=new WmT;this.Zf=new Gwz;this.dW=new wnz;this.qz=new ilq;this.Me=new Jfo},Hcj=function(U, Y,A,c,d){$bW(U); if(U.Y){var T=g.DQ("ID_TOKEN"),E=U.Y.Qe||{};T?E["x-youtube-identity-token"]=T:delete E["x-youtube-identity-token"];U.Y.Qe=E}vFo(U);c?(c.getState()!=3&&CWq(c)==0||c.getState(),U.Y.connect(Y,A,U.Pw,c.j,c.v_)):d?U.Y.connect(Y,A,U.Pw,d.sessionId,d.arrayId):U.Y.connect(Y,A,U.Pw)},icL=function(U,Y){return U.Lr?!0:U.VJ?Object.values(GPo).includes(Y):U.i$?!Object.values(Wwf).includes(Y):U.ws?Object.values(w9Y).includes(Y):!1},jUz=function(U){var Y,A; g.S(function(c){if(c.T==1)return g.jS(c,2),g.x(c,Jbw(U),2);g.Rc(c);Y=U.W;U.W=[];A=Y.length;Fwz(U,Y,A);u4(U);return g.xl(c,0)})},Fwz=function(U,Y,A){for(var c=0;c0?A=Object.assign({},A,Y):delete A.Authorization;U.Y.Qe=A}},vFo=function(U){U.eX&&!U.K&&t3m(U,U.eX())},Kp=function(U){this.scheme="https"; this.port=this.domain="";this.Y="/api/lounge";this.T=!0;U=U||document.location.href;var Y=Number(g.Nw(U)[4]||null)||"";Y&&(this.port=":"+Y);this.domain=g.tD(U)||"";U=g.tF();U.search("MSIE")>=0&&(U=U.match(/MSIE ([\d.]+)/)[1],g.Fv(U,"10.0")<0&&(this.T=!1))},qh=function(U,Y){var A=U.Y; U.T&&(A=U.scheme+"://"+U.domain+U.port+U.Y);return g.xJ(A+Y,{})},eFz=function(U,Y){g.PO.call(this); var A=this;this.Yr=U();this.Yr.subscribe("handlerOpened",this.l3,this);this.Yr.subscribe("handlerClosed",this.onClosed,this);this.Yr.subscribe("handlerError",function(c,d){A.onError(d)}); this.Yr.subscribe("handlerMessage",this.onMessage,this);this.Y=Y},BUL=function(U,Y,A){var c=this; A=A===void 0?function(){return""}:A; var d=d===void 0?new Fvw:d;var T=T===void 0?new g.BF:T;this.pathPrefix=U;this.Y=Y;this.ov=A;this.K=T;this.Z=null;this.X=this.G=0;this.channel=null;this.J=0;this.W=new Ii(function(){c.W.isActive();var E;((E=c.channel)==null?void 0:Kzm((new tAm(E,E.Y)).Y.T))===0&&c.connect(c.Z,c.G)}); this.j={};this.T={};this.Pw=!1;this.logger=null;this.Hw=[];this.ZA=void 0;this.Uv=new vGz;this.jX=new Hlm;this.eX=new Gwz;this.QJ=new wnz},X9z=function(U){g.d9(U.channel,"m",function(){U.J=3; U.W.reset();U.Z=null;U.G=0;for(var Y=g.J(U.Hw),A=Y.next();!A.done;A=Y.next())A=A.value,U.channel&&U.channel.send(A);U.Hw=[];U.publish("webChannelOpened");U.Uv.ax("WEB_CHANNEL")}); g.d9(U.channel,"n",function(){U.J=0;U.W.isActive()||U.publish("webChannelClosed");var Y,A=(Y=U.channel)==null?void 0:e9j(new tAm(Y,Y.Y));A&&(U.Hw=[].concat(g.X(A)));U.jX.ax("WEB_CHANNEL")}); g.d9(U.channel,"p",function(Y){var A=Y.data;A[0]==="gracefulReconnect"?(U.W.start(),U.channel&&U.channel.close()):U.publish("webChannelMessage",new PzT(A[0],A[1]));U.ZA=Y.statusCode;U.eX.ax("WEB_CHANNEL")}); g.d9(U.channel,"o",function(){U.ZA===401||U.W.start();U.publish("webChannelError");U.QJ.ax("WEB_CHANNEL","")})},kPL=function(U){var Y=U.ov(); Y?U.j["x-youtube-lounge-xsrf-token"]=Y:delete U.j["x-youtube-lounge-xsrf-token"]},RFo=function(U){g.PO.call(this); this.Y=U();this.Y.subscribe("webChannelOpened",this.Lu,this);this.Y.subscribe("webChannelClosed",this.onClosed,this);this.Y.subscribe("webChannelError",this.onError,this);this.Y.subscribe("webChannelMessage",this.onMessage,this)},a1z=function(U,Y,A,c,d){function T(){return new V3Y(qh(U,"/bc"),Y,!1,A,c)} A=A===void 0?function(){return""}:A; return g.ir("enable_mdx_web_channel_desktop")?new RFo(function(){return new BUL(qh(U,"/wc"),Y,A)}):new eFz(T,d)},hFY=function(){var U=xbY; sUT();Cp.push(U);f1T()},Uf=function(U,Y){sUT(); var A=SCz(U,String(Y));Cp.length==0?M3w(A):(f1T(),g.MF(Cp,function(c){c(A)}))},Y9=function(U){Uf("CP",U)},sUT=function(){Cp||(Cp=g.u8("yt.mdx.remote.debug.handlers_")||[],g.Ic("yt.mdx.remote.debug.handlers_",Cp))},M3w=function(U){var Y=(AP+1)%50; AP=Y;cf[Y]=U;dx||(dx=Y==49)},f1T=function(){var U=Cp; if(cf[0]){var Y=dx?AP:-1,A={};do A={WX:void 0},Y=(Y+1)%50,A.WX=cf[Y],g.MF(U,function(c){return function(d){d(c.WX)}}(A)); while(Y!=AP);cf=Array(50);AP=-1;dx=!1}},SCz=function(U,Y){var A=(Date.now()-bcT)/1E3; A.toFixed&&(A=A.toFixed(3));var c=[];c.push("[",A+"s","] ");c.push("[","yt.mdx.remote","] ");c.push(U+": "+Y,"\n");return c.join("")},TD=function(U){g.l6.call(this); this.J=U;this.screens=[]},p9w=function(U,Y){var A=U.get(Y.uuid)||U.get(Y.id); if(A)return U=A.name,A.id=Y.id||A.id,A.name=Y.name,A.token=Y.token,A.uuid=Y.uuid||A.uuid,A.name!=U;U.screens.push(Y);return!0},QUW=function(U,Y){var A=U.screens.length!=Y.length; U.screens=g.fu(U.screens,function(T){return!!dRY(Y,T)}); for(var c=Y.length,d=0;d0&&U.j0&&Wf(U,A)},function(Y){U.K=function(){}; U.RJ(Y)})},HTW=function(U){var Y={}; Y.pairingCode=U.jX;Y.theme=U.kE;vxw()&&(Y.env_useStageMdx=1);return g.aw(Y)},G4T=function(U){return new Promise(function(Y){U.jX=AuT(); if(U.Uv){var A=new chrome.cast.DialLaunchResponse(!0,HTW(U));Y(A);vSj(U)}else U.Pw=function(){g.Gw(U.X);U.Pw=function(){}; U.X=NaN;var c=new chrome.cast.DialLaunchResponse(!0,HTW(U));Y(c);vSj(U)},U.X=g.vn(function(){U.Pw()},100)})},wxW=function(U,Y,A){U.info("initOnConnectedScreenDataPromise_: Received screenData: "+JSON.stringify(Y)); var c=new oi(Y);return(new Promise(function(d){Wqw(U,c,function(T){T?(U.Hw=!0,lJ(U.j,c),Vg(U,c),Wf(U,A)):g.KF(Error("DialSession, RemoteScreen from screenData: "+JSON.stringify(Y)+" is not online."));d(T)},5)})).then(function(d){return d?new chrome.cast.DialLaunchResponse(!1):G4T(U)})},iTw=function(U,Y){var A=U.Z.receiver.label,c=U.T.friendlyName; return(new Promise(function(d){CzW(U.j,A,Y,c,function(T){T&&T.token&&Vg(U,T);d(T)},function(T){$9(U,"Failed to get DIAL screen: "+T); d(null)})})).then(function(d){return d&&d.token?new chrome.cast.DialLaunchResponse(!1):G4T(U)})},Wqw=function(U,Y,A,c){g.Gw(U.J); U.J=0;YiY(U.j,Y,function(d){d||c<0?A(d):U.J=g.vn(function(){Wqw(U,Y,A,c-1)},300)})},Wf=function(U,Y){U.info("getDialAppInfoWithTimeout_ "+Y); GD(U)&&(g.Gw(U.G),U.G=0,Y==0?JHL(U):U.G=g.vn(function(){JHL(U)},Y))},JHL=function(U){GD(U)&&U.W.getDialAppInfo(function(Y){U.info("getDialAppInfo dialLaunchData: "+JSON.stringify(Y)); Y=Y.extraData||{};var A=null;if(Y.loungeToken){var c;((c=U.Y)==null?void 0:c.token)==Y.loungeToken&&(A="staleLoungeToken")}else A="missingLoungeToken";A?(U.ov=A,Wf(U,3E4)):(U.Hw=!1,U.ov="unknown",TnF(U,Y.loungeToken),Wf(U,Y.loungeTokenRefreshIntervalMs))},function(Y){U.info("getDialAppInfo error: "+Y); U.ov="noLoungeTokenResponse";Wf(U,3E4)})},Fqo=function(U){g.Gw(U.J); U.J=0;g.Gw(U.G);U.G=0;U.K();U.K=function(){}; g.Gw(U.X)},wx=function(U,Y){Pf.call(this,U,Y,"ManualSession"); this.W=g.vn((0,g.dL)(this.xb,this,null),150)},iJ=function(U,Y){g.l6.call(this); this.config_=Y;this.T=U;this.Z=Y.appId||"233637DE";this.j=Y.theme||"cl";this.X=Y.disableCastApi||!1;this.J=Y.forceMirroring||!1;this.Y=null;this.G=!1;this.W=[];this.K=(0,g.dL)(this.SHI,this)},jQo=function(U,Y){return Y?g.$z(U.W,function(A){return z9(Y,A.label)},U):null},JP=function(U){Uf("Controller",U)},xbY=function(U){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(U)},F8=function(U){return U.G||!!U.W.length||!!U.Y},jN=function(U,Y,A){Y!=U.Y&&(g.P7(U.Y),(U.Y=Y)?(A?U.publish("yt-remote-cast2-receiver-resumed", Y.T):U.publish("yt-remote-cast2-receiver-selected",Y.T),Y.subscribe("sessionScreen",(0,g.dL)(U.Jy,U,Y)),Y.subscribe("sessionFailed",function(){return Nnq(U,Y)}),Y.Y?U.publish("yt-remote-cast2-session-change",Y.Y):A&&U.Y.xb(null)):U.publish("yt-remote-cast2-session-change",null))},Nnq=function(U,Y){U.Y==Y&&U.publish("yt-remote-cast2-session-failed")},tHI=function(U){var Y=U.T.Y2(),A=U.Y&&U.Y.T; U=g.mk(Y,function(c){A&&z9(c,A.label)&&(A=null);var d=c.uuid?c.uuid:c.id,T=jQo(this,c);T?(T.label=d,T.friendlyName=c.name):(T=new chrome.cast.Receiver(d,c.name),T.receiverType=chrome.cast.ReceiverType.CUSTOM);return T},U); A&&(A.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(A=new chrome.cast.Receiver(A.label,A.friendlyName),A.receiverType=chrome.cast.ReceiverType.CUSTOM),U.push(A));return U},xkj=function(U,Y,A,c){c.disableCastApi?Nt("Cannot initialize because disabled by Mdx config."):eKo()?Bnz(Y,c)&&(Xxj(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?k4z(U,A):(window.__onGCastApiAvailable=function(d,T){d?k4z(U,A):(tP("Failed to load cast API: "+T),RKO(!1),Xxj(!1),g.Sh("yt-remote-cast-available"),g.Sh("yt-remote-cast-receiver"), asW(),A(!1))},c.loadCastApiSetupScript?g.rn("https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"):window.navigator.userAgent.indexOf("Android")>=0&&window.navigator.userAgent.indexOf("Chrome/")>=0&&window.navigator.presentation?G0Y()>=60&&eYF():!window.chrome||!window.navigator.presentation||window.navigator.userAgent.indexOf("Edge")>=0?Juw():G0Y()>=89?X5I():(tho(),G9(B3w.map(FzL))))):Nt("Cannot initialize because not running Chrome")},asW=function(){Nt("dispose"); var U=eN();U&&U.dispose();g.Ic("yt.mdx.remote.cloudview.instance_",null);sQo(!1);g.z4(fsO);fsO.length=0},Bf=function(){return!!g.hu("yt-remote-cast-installed")},hKL=function(){var U=g.hu("yt-remote-cast-receiver"); return U?U.friendlyName:null},SiI=function(){Nt("clearCurrentReceiver"); g.Sh("yt-remote-cast-receiver")},MHW=function(){return Bf()?eN()?eN().getCastSession():(tP("getCastSelector: Cast is not initialized."),null):(tP("getCastSelector: Cast API is not installed!"),null)},bTO=function(){Bf()?eN()?X8()?(Nt("Requesting cast selector."),eN().requestSession()):(Nt("Wait for cast API to be ready to request the session."),fsO.push(g.oQ("yt-remote-cast2-api-ready",bTO))):tP("requestCastSelector: Cast is not initialized."):tP("requestCastSelector: Cast API is not installed!")}, k9=function(U,Y){X8()?eN().setConnectedScreenStatus(U,Y):tP("setConnectedScreenStatus called before ready.")},eKo=function(){var U=g.tF().search(/ (CrMo|Chrome|CriOS)\//)>=0; return g.Sf||U},pxF=function(U,Y){eN().init(U,Y)},Bnz=function(U,Y){var A=!1; eN()||(U=new iJ(U,Y),U.subscribe("yt-remote-cast2-availability-change",function(c){g.fU("yt-remote-cast-available",c);v6("yt-remote-cast2-availability-change",c)}),U.subscribe("yt-remote-cast2-receiver-selected",function(c){Nt("onReceiverSelected: "+c.friendlyName); g.fU("yt-remote-cast-receiver",c);v6("yt-remote-cast2-receiver-selected",c)}),U.subscribe("yt-remote-cast2-receiver-resumed",function(c){Nt("onReceiverResumed: "+c.friendlyName); g.fU("yt-remote-cast-receiver",c);v6("yt-remote-cast2-receiver-resumed",c)}),U.subscribe("yt-remote-cast2-session-change",function(c){Nt("onSessionChange: "+Lp(c)); c||g.Sh("yt-remote-cast-receiver");v6("yt-remote-cast2-session-change",c)}),g.Ic("yt.mdx.remote.cloudview.instance_",U),A=!0); Nt("cloudview.createSingleton_: "+A);return A},eN=function(){return g.u8("yt.mdx.remote.cloudview.instance_")},k4z=function(U,Y){RKO(!0); Xxj(!1);pxF(U,function(A){A?(sQo(!0),g.LT("yt-remote-cast2-api-ready")):(tP("Failed to initialize cast API."),RKO(!1),g.Sh("yt-remote-cast-available"),g.Sh("yt-remote-cast-receiver"),asW());Y(A)})},Nt=function(U){Uf("cloudview",U)},tP=function(U){Uf("cloudview",U)},RKO=function(U){Nt("setCastInstalled_ "+U); g.fU("yt-remote-cast-installed",U)},X8=function(){return!!g.u8("yt.mdx.remote.cloudview.apiReady_")},sQo=function(U){Nt("setApiReady_ "+U); g.Ic("yt.mdx.remote.cloudview.apiReady_",U)},Xxj=function(U){g.Ic("yt.mdx.remote.cloudview.initializing_",U)},RT=function(U){this.index=-1; this.videoId=this.listId="";this.volume=this.playerState=-1;this.muted=!1;this.audioTrackId=null;this.J=this.G=0;this.trackData=null;this.pX=this.kD=!1;this.Z=this.K=this.Y=this.j=0;this.W=NaN;this.T=!1;this.reset(U)},QQq=function(U){U.audioTrackId=null; U.trackData=null;U.playerState=-1;U.kD=!1;U.pX=!1;U.G=0;U.J=g.om();U.j=0;U.Y=0;U.K=0;U.Z=0;U.W=NaN;U.T=!1},aT=function(U){return U.isPlaying()?(g.om()-U.J)/1E3:0},x9=function(U,Y){U.G=Y; U.J=g.om()},sf=function(U){switch(U.playerState){case 1:case 1081:return(g.om()-U.J)/1E3+U.G; case -1E3:return 0}return U.G},fb=function(U,Y,A){var c=U.videoId; U.videoId=Y;U.index=A;Y!=c&&QQq(U)},ZTz=function(U){var Y={}; Y.index=U.index;Y.listId=U.listId;Y.videoId=U.videoId;Y.playerState=U.playerState;Y.volume=U.volume;Y.muted=U.muted;Y.audioTrackId=U.audioTrackId;Y.trackData=g.AF(U.trackData);Y.hasPrevious=U.kD;Y.hasNext=U.pX;Y.playerTime=U.G;Y.playerTimeAt=U.J;Y.seekableStart=U.j;Y.seekableEnd=U.Y;Y.duration=U.K;Y.loadedTime=U.Z;Y.liveIngestionTime=U.W;return Y},SN=function(U,Y){g.l6.call(this); var A=this;this.W=0;this.j=U;this.J=[];this.K=new LwW;this.T=this.Y=null;this.X=(0,g.dL)(this.lmX,this);this.G=(0,g.dL)(this.VW,this);this.Z=(0,g.dL)(this.ZrY,this);this.Pw=(0,g.dL)(this.q3w,this);var c=0;U?(c=U.getProxyState(),c!=3&&(U.subscribe("proxyStateChange",this.YS,this),OTo(this))):c=3;c!=0&&(Y?this.YS(c):g.vn(function(){A.YS(c)},0)); (U=MHW())&&hP(this,U);this.subscribe("yt-remote-cast2-session-change",this.Pw)},Mt=function(U){return new RT(U.j.getPlayerContextData())},OTo=function(U){g.MF("nowAutoplaying autoplayDismissed remotePlayerChange remoteQueueChange autoplayModeChange autoplayUpNext previousNextChange multiStateLoopEnabled loopModeChange".split(" "),function(Y){this.J.push(this.j.subscribe(Y,g.EO(this.JBy,Y),this))},U)},mkI=function(U){g.MF(U.J,function(Y){this.j.unsubscribeByKey(Y)},U); U.J.length=0},bJ=function(U){return U.getState()==1},pb=function(U,Y){var A=U.K; A.Y.length+A.T.length<50&&U.K.enqueue(Y)},gSO=function(U,Y,A){var c=Mt(U); x9(c,A);c.playerState!=-1E3&&(c.playerState=Y);Qg(U,c)},Z6=function(U,Y,A){U.j.sendMessage(Y,A)},Qg=function(U,Y){mkI(U); U.j.setPlayerContextData(ZTz(Y));OTo(U)},hP=function(U,Y){U.T&&(U.T.removeUpdateListener(U.X),U.T.removeMediaListener(U.G),U.VW(null)); U.T=Y;U.T&&(Y9("Setting cast session: "+U.T.sessionId),U.T.addUpdateListener(U.X),U.T.addMediaListener(U.G),U.T.media.length&&U.VW(U.T.media[0]))},yHL=function(U){var Y=U.Y.media,A=U.Y.customData; if(Y&&A){var c=Mt(U);Y.contentId!=c.videoId&&Y9("Cast changing video to: "+Y.contentId);c.videoId=Y.contentId;c.playerState=A.playerState;x9(c,U.Y.getEstimatedTime());Qg(U,c)}else Y9("No cast media video. Ignoring state update.")},Of=function(U,Y,A){return(0,g.dL)(function(c){this.eI("Failed to "+Y+" with cast v2 channel. Error code: "+c.code); c.code!=chrome.cast.ErrorCode.TIMEOUT&&(this.eI("Retrying "+Y+" using MDx browser channel."),Z6(this,Y,A))},U)},yg=function(U,Y,A,c){c=c===void 0?!1:c; g.l6.call(this);var d=this;this.J=NaN;this.jX=!1;this.X=this.Z=this.Hw=this.ov=NaN;this.Pw=[];this.K=this.G=this.j=this.Y=this.T=null;this.Uv=U;this.eX=c;this.Pw.push(g.jh(window,"beforeunload",function(){d.hG(2)})); this.W=[];this.Y=new RT;this.kE=Y.id;this.QJ=Y.idType;this.T=a1z(this.Uv,A,this.sE,this.QJ=="shortLived",this.kE);this.T.listen("channelOpened",function(){nSL(d)}); this.T.listen("channelClosed",function(){mY("Channel closed");isNaN(d.J)?VD(!0):VD();d.dispose()}); this.T.listen("channelError",function(T){VD();isNaN(d.B1())?(T==1&&d.QJ=="shortLived"&&d.publish("browserChannelAuthError",T),mY("Channel error: "+T+" without reconnection"),d.dispose()):(d.jX=!0,mY("Channel error: "+T+" with reconnection in "+d.B1()+" ms"),gx(d,2))}); this.T.listen("channelMessage",function(T){DkW(d,T)}); this.T.Hr(Y.token);this.subscribe("remoteQueueChange",function(){var T=d.Y.videoId;g.MR()&&g.fU("yt-remote-session-video-id",T)})},IsL=function(U){return g.$z(U.W,function(Y){return Y.type=="LOUNGE_SCREEN"})},mY=function(U){Uf("conn",U)},gx=function(U,Y){U.publish("proxyStateChange",Y)},uaz=function(U){U.J=g.vn(function(){mY("Connecting timeout"); U.hG(1)},2E4)},KqL=function(U){g.Gw(U.J); U.J=NaN},qiw=function(U){g.Gw(U.ov); U.ov=NaN},Udm=function(U){CVW(U); U.Hw=g.vn(function(){nb(U,"getNowPlaying")},2E4)},CVW=function(U){g.Gw(U.Hw); U.Hw=NaN},nSL=function(U){mY("Channel opened"); U.jX&&(U.jX=!1,qiw(U),U.ov=g.vn(function(){mY("Timing out waiting for a screen.");U.hG(1)},15E3))},AzT=function(U,Y){var A=null; if(Y){var c=IsL(U);c&&(A={clientName:c.clientName,deviceMake:c.brand,deviceModel:c.model,osVersion:c.osVersion})}g.Ic("yt.mdx.remote.remoteClient_",A);Y&&(KqL(U),qiw(U));A=U.T.IA()&&isNaN(U.J);Y==A?Y&&(gx(U,1),nb(U,"getSubtitlesTrack")):Y?(U.Uh()&&U.Y.reset(),gx(U,1),nb(U,"getNowPlaying"),YZf(U)):U.hG(1)},czw=function(U,Y){var A=Y.params.videoId; delete Y.params.videoId;A==U.Y.videoId&&(g.qF(Y.params)?U.Y.trackData=null:U.Y.trackData=Y.params,U.publish("remotePlayerChange"))},ddT=function(U,Y,A){var c=Y.params.videoId||Y.params.video_id,d=parseInt(Y.params.currentIndex,10); U.Y.listId=Y.params.listId||U.Y.listId;fb(U.Y,c,d);U.publish("remoteQueueChange",A)},EsW=function(U,Y){Y.params=Y.params||{}; ddT(U,Y,"NOW_PLAYING_MAY_CHANGE");T8I(U,Y);U.publish("autoplayDismissed")},T8I=function(U,Y){var A=parseInt(Y.params.currentTime||Y.params.current_time,10); x9(U.Y,isNaN(A)?0:A);A=parseInt(Y.params.state,10);A=isNaN(A)?-1:A;A==-1&&U.Y.playerState==-1E3&&(A=-1E3);U.Y.playerState=A;A=Number(Y.params.loadedTime);U.Y.Z=isNaN(A)?0:A;U.Y.sL(Number(Y.params.duration));A=U.Y;var c=Number(Y.params.liveIngestionTime);A.W=c;A.T=isNaN(c)?!1:!0;A=U.Y;c=Number(Y.params.seekableStartTime);Y=Number(Y.params.seekableEndTime);A.j=isNaN(c)?0:c;A.Y=isNaN(Y)?0:Y;U.Y.playerState==1?Udm(U):CVW(U);U.publish("remotePlayerChange")},osq=function(U,Y){if(U.Y.playerState!=-1E3){var A= 1085; switch(parseInt(Y.params.adState,10)){case 1:A=1081;break;case 2:A=1084;break;case 0:A=1083}U.Y.playerState=A;Y=parseInt(Y.params.currentTime,10);x9(U.Y,isNaN(Y)?0:Y);U.publish("remotePlayerChange")}},z7z=function(U,Y){var A=Y.params.muted=="true"; U.Y.volume=parseInt(Y.params.volume,10);U.Y.muted=A;U.publish("remotePlayerChange")},Lfw=function(U,Y){U.G=Y.params.videoId; U.publish("nowAutoplaying",parseInt(Y.params.timeout,10))},rzO=function(U,Y){U.G=Y.params.videoId||null; U.publish("autoplayUpNext",U.G)},lSq=function(U,Y){U.K=Y.params.autoplayMode; U.publish("autoplayModeChange",U.K);U.K=="DISABLED"&&U.publish("autoplayDismissed")},PAo=function(U,Y){var A=Y.params.hasNext=="true"; U.Y.kD=Y.params.hasPrevious=="true";U.Y.pX=A;U.publish("previousNextChange")},DkW=function(U,Y){Y=Y.message; Y.params?mY("Received: action="+Y.action+", params="+g.Zm(Y.params)):mY("Received: action="+Y.action+" {}");switch(Y.action){case "loungeStatus":Y=YY(Y.params.devices);U.W=g.mk(Y,function(c){return new Eo(c)}); Y=!!g.$z(U.W,function(c){return c.type=="LOUNGE_SCREEN"}); AzT(U,Y);Y=U.S_("mlm");U.publish("multiStateLoopEnabled",Y);break;case "loungeScreenDisconnected":g.iw(U.W,function(c){return c.type=="LOUNGE_SCREEN"}); AzT(U,!1);break;case "remoteConnected":var A=new Eo(YY(Y.params.device));g.$z(U.W,function(c){return c.equals(A)})||lDw(U.W,A); break;case "remoteDisconnected":A=new Eo(YY(Y.params.device));g.iw(U.W,function(c){return c.equals(A)}); break;case "gracefulDisconnect":break;case "playlistModified":ddT(U,Y,"QUEUE_MODIFIED");break;case "nowPlaying":EsW(U,Y);break;case "onStateChange":T8I(U,Y);break;case "onAdStateChange":osq(U,Y);break;case "onVolumeChanged":z7z(U,Y);break;case "onSubtitlesTrackChanged":czw(U,Y);break;case "nowAutoplaying":Lfw(U,Y);break;case "autoplayDismissed":U.publish("autoplayDismissed");break;case "autoplayUpNext":rzO(U,Y);break;case "onAutoplayModeChanged":lSq(U,Y);break;case "onHasPreviousNextChanged":PAo(U, Y);break;case "requestAssistedSignIn":U.publish("assistedSignInRequested",Y.params.authCode);break;case "onLoopModeChanged":U.publish("loopModeChange",Y.params.loopMode);break;default:mY("Unrecognized action: "+Y.action)}},YZf=function(U){g.Gw(U.X); U.X=g.vn(function(){U.hG(1)},864E5)},nb=function(U,Y,A){A?mY("Sending: action="+Y+", params="+g.Zm(A)):mY("Sending: action="+Y); U.T.sendMessage(Y,A)},V5I=function(U){TD.call(this,"ScreenServiceProxy"); this.Gz=U;this.Y=[];this.Y.push(this.Gz.$_s("screenChange",(0,g.dL)(this.Mn,this)));this.Y.push(this.Gz.$_s("onlineScreenChange",(0,g.dL)(this.OUT,this)))},WfT=function(U,Y){$Rq(); if(!$Y||!$Y.get("yt-remote-disable-remote-module-for-dev")){Y=g.DQ("MDX_CONFIG")||Y;T3I();LzF();D6||(D6=new Kp(Y?Y.loungeApiHost:void 0),vxw()&&(D6.Y="/api/loungedev"));IT||(IT=g.u8("yt.mdx.remote.deferredProxies_")||[],g.Ic("yt.mdx.remote.deferredProxies_",IT));$dz();var A=uJ();if(!A){var c=new rx(D6,Y?Y.disableAutomaticScreenCache||!1:!1);g.Ic("yt.mdx.remote.screenService_",c);A=uJ();var d={};Y&&(d={appId:Y.appId,disableDial:Y.disableDial,theme:Y.theme,loadCastApiSetupScript:Y.loadCastApiSetupScript, disableCastApi:Y.disableCastApi,enableDialLoungeToken:Y.enableDialLoungeToken,enableCastLoungeToken:Y.enableCastLoungeToken,forceMirroring:Y.forceMirroring});g.Ic("yt.mdx.remote.enableConnectWithInitialState_",Y?Y.enableConnectWithInitialState||!1:!1);xkj(U,c,function(T){T?Kb()&&k9(Kb(),"YouTube TV"):c.subscribe("onlineScreenChange",function(){v6("yt-remote-receiver-availability-change")})},d)}Y&&!g.u8("yt.mdx.remote.initialized_")&&(g.Ic("yt.mdx.remote.initialized_",!0),qt("Initializing: "+g.Zm(Y)), Cb.push(g.oQ("yt-remote-cast2-api-ready",function(){v6("yt-remote-api-ready")})),Cb.push(g.oQ("yt-remote-cast2-availability-change",function(){v6("yt-remote-receiver-availability-change")})),Cb.push(g.oQ("yt-remote-cast2-receiver-selected",function(){UQ(null); v6("yt-remote-auto-connect","cast-selector-receiver")})),Cb.push(g.oQ("yt-remote-cast2-receiver-resumed",function(){v6("yt-remote-receiver-resumed","cast-selector-receiver")})),Cb.push(g.oQ("yt-remote-cast2-session-change",vsY)),Cb.push(g.oQ("yt-remote-connection-change",function(T){T?k9(Kb(),"YouTube TV"):Yf()||(k9(null,null),SiI())})),Cb.push(g.oQ("yt-remote-cast2-session-failed",function(){v6("yt-remote-connection-failed")})),U=H$I(),Y.isAuto&&(U.id+="#dial"),d=Y.capabilities||[],g.ir("desktop_enable_autoplay")&& d.push("atp"),d.length>0&&(U.capabilities=d),U.name=Y.device,U.app=Y.app,(Y=Y.theme)&&(U.theme=Y),qt(" -- with channel params: "+g.Zm(U)),U?(g.fU("yt-remote-session-app",U.app),g.fU("yt-remote-session-name",U.name)):(g.Sh("yt-remote-session-app"),g.Sh("yt-remote-session-name")),g.Ic("yt.mdx.remote.channelParams_",U),A.start(),Kb()||GBo())}},wjo=function(){var U=uJ().Gz.$_gos(); var Y=AO();Y&&cs()&&(dRY(U,Y)||U.push(Y));return cuw(U)},Jzm=function(){var U=i$T(); !U&&Bf()&&hKL()&&(U={key:"cast-selector-receiver",name:hKL()});return U},i$T=function(){var U=wjo(),Y=AO(); Y||(Y=Yf());return g.$z(U,function(A){return Y&&z9(Y,A.key)?!0:!1})},AO=function(){var U=Kb(); if(!U)return null;var Y=uJ().LX();return rm(Y,U)},vsY=function(U){qt("remote.onCastSessionChange_: "+Lp(U)); if(U){var Y=AO();if(Y&&Y.id==U.id){if(k9(Y.id,"YouTube TV"),U.idType=="shortLived"&&(U=U.token))dk&&(dk.token=U),(Y=cs())&&Y.Hr(U)}else Y&&TA(),EQ(U,1)}else cs()&&TA()},TA=function(){X8()?eN().stopSession():tP("stopSession called before API ready."); var U=cs();U&&(U.disconnect(1),Ffm(null))},jBq=function(){var U=cs(); return!!U&&U.getProxyState()!=3},qt=function(U){Uf("remote",U)},uJ=function(){if(!N8W){var U=g.u8("yt.mdx.remote.screenService_"); N8W=U?new V5I(U):null}return N8W},Kb=function(){return g.u8("yt.mdx.remote.currentScreenId_")},t5F=function(U){g.Ic("yt.mdx.remote.currentScreenId_",U)},e7o=function(){return g.u8("yt.mdx.remote.connectData_")},UQ=function(U){g.Ic("yt.mdx.remote.connectData_",U)},cs=function(){return g.u8("yt.mdx.remote.connection_")},Ffm=function(U){var Y=cs(); UQ(null);U||t5F("");g.Ic("yt.mdx.remote.connection_",U);IT&&(g.MF(IT,function(A){A(U)}),IT.length=0); Y&&!U?v6("yt-remote-connection-change",!1):!Y&&U&&v6("yt-remote-connection-change",!0)},Yf=function(){var U=g.MR(); if(!U)return null;var Y=uJ();if(!Y)return null;Y=Y.LX();return rm(Y,U)},EQ=function(U,Y){Kb(); AO()&&AO();if(oa)dk=U;else{t5F(U.id);var A=g.u8("yt.mdx.remote.enableConnectWithInitialState_")||!1;U=new yg(D6,U,H$I(),A);U.connect(Y,e7o());U.subscribe("beforeDisconnect",function(c){v6("yt-remote-before-disconnect",c)}); U.subscribe("beforeDispose",function(){cs()&&(cs(),Ffm(null))}); U.subscribe("browserChannelAuthError",function(){var c=AO();c&&c.idType=="shortLived"&&(X8()?eN().handleBrowserChannelAuthError():tP("refreshLoungeToken called before API ready."))}); Ffm(U)}},GBo=function(){var U=Yf(); U?(qt("Resume connection to: "+Lp(U)),EQ(U,0)):(VD(),SiI(),qt("Skipping connecting because no session screen found."))},$dz=function(){var U=H$I(); if(g.qF(U)){U=P6();var Y=g.hu("yt-remote-session-name")||"",A=g.hu("yt-remote-session-app")||"";U={device:"REMOTE_CONTROL",id:U,name:Y,app:A,mdxVersion:3};U.authuser=String(g.DQ("SESSION_INDEX","0"));(Y=g.DQ("DELEGATED_SESSION_ID"))&&(U.pageId=String(Y));g.Ic("yt.mdx.remote.channelParams_",U)}},H$I=function(){return g.u8("yt.mdx.remote.channelParams_")||{}},kBI=function(U,Y,A){g.p.call(this); var c=this;this.Y=U;this.U=Y;this.u9=A;this.events=new g.Qy(this);this.K=!1;this.J=new g.z3(64);this.T=new g.IM(this.xx,500,this);this.W=new g.IM(this.oE,1E3,this);this.Z=new W6(this.E4n,0,this);this.j={};this.X=new g.IM(this.PF,1E3,this);this.G=new g.Yc(this.seekTo,1E3,this);this.Pw=this.events.N(this.U,"onVolumeChange",function(d){B8F(c,d)}); g.Z(this,this.events);this.events.N(Y,"onCaptionsTrackListChanged",this.Q5W);this.events.N(Y,"captionschanged",this.fmY);this.events.N(Y,"captionssettingschanged",this.FS);this.events.N(Y,"videoplayerreset",this.T6);this.events.N(Y,"mdxautoplaycancel",function(){c.u9.zS()}); Y.S("enable_mdx_video_play_directly")&&this.events.N(Y,"videodatachange",function(){Xjw(c.Y)||zA(c)||LX(c,0)}); U=this.u9;U.Ky();U.subscribe("proxyStateChange",this.QM,this);U.subscribe("remotePlayerChange",this.T3,this);U.subscribe("remoteQueueChange",this.T6,this);U.subscribe("previousNextChange",this.WO,this);U.subscribe("nowAutoplaying",this.PO,this);U.subscribe("autoplayDismissed",this.Z9,this);g.Z(this,this.T);g.Z(this,this.W);g.Z(this,this.Z);g.Z(this,this.X);g.Z(this,this.G);this.FS();this.T6();this.T3()},B8F=function(U,Y){if(zA(U)){U.u9.unsubscribe("remotePlayerChange",U.T3,U); var A=Math.round(Y.volume);Y=!!Y.muted;var c=Mt(U.u9);if(A!==c.volume||Y!==c.muted)U.u9.setVolume(A,Y),U.X.start();U.u9.subscribe("remotePlayerChange",U.T3,U)}},R7z=function(U){U.ya(0); U.T.stop();U.Ab(new g.z3(64))},aSo=function(U,Y){if(zA(U)&&!U.K){var A=null; Y&&(A={style:U.U.getSubtitlesUserSettings()},Object.assign(A,Y));U.u9.AJ(U.U.getVideoData(1).videoId,A);U.j=g.M(Mt(U.u9).trackData)}},LX=function(U,Y){var A=U.U.getPlaylist(); if(A==null?0:A.listId){var c=A.index;var d=A.listId.toString()}A=U.U.getVideoData(1);U.u9.playVideo(A.videoId,Y,c,d,A.playerParams,A.Zf,rfw(A));U.Ab(new g.z3(1))},xdI=function(U,Y){if(Y){var A=U.U.getOption("captions","tracklist",{WY:1}); A&&A.length?(U.U.setOption("captions","track",Y),U.K=!1):(U.U.loadModule("captions"),U.K=!0)}else U.U.setOption("captions","track",{})},zA=function(U){return Mt(U.u9).videoId===U.U.getVideoData(1).videoId},sBw=function(U){this.Y=U},rk=function(){g.n.call(this,{D:"div", B:"ytp-mdx-popup-dialog",V:{role:"dialog"},C:[{D:"div",B:"ytp-mdx-popup-dialog-inner-content",C:[{D:"div",B:"ytp-mdx-popup-title",YE:"No has iniciado sesi\u00f3n"},{D:"div",B:"ytp-mdx-popup-description",YE:"Los v\u00eddeos que veas podr\u00edan aparecer en el historial de reproducciones de la TV e influir en las recomendaciones. Puedes evitarlo si cancelas e inicias sesi\u00f3n en YouTube desde tu ordenador."},{D:"div",B:"ytp-mdx-privacy-popup-buttons",C:[{D:"button",Iv:["ytp-button","ytp-mdx-privacy-popup-cancel"], YE:"Cancelar"},{D:"button",Iv:["ytp-button","ytp-mdx-privacy-popup-confirm"],YE:"Confirmar"}]}]}]});this.fade=new g.d1(this,250);this.cancelButton=this.As("ytp-mdx-privacy-popup-cancel");this.confirmButton=this.As("ytp-mdx-privacy-popup-confirm");g.Z(this,this.fade);this.N(this.cancelButton,"click",this.Y);this.N(this.confirmButton,"click",this.T)},l2=function(U){g.n.call(this,{D:"div", B:"ytp-remote",C:[{D:"div",B:"ytp-remote-display-status",C:[{D:"div",B:"ytp-remote-display-status-icon",C:[g.PWc()]},{D:"div",B:"ytp-remote-display-status-text",YE:"{{statustext}}"}]}]});this.api=U;this.fade=new g.d1(this,250);g.Z(this,this.fade);this.N(U,"presentingplayerstatechange",this.onStateChange);this.l9(U.getPlayerStateObject())},Ps=function(U,Y){g.kI.call(this,"Reproducir en",1,U,Y); this.U=U;this.PU={};this.N(U,"onMdxReceiversChange",this.j);this.N(U,"presentingplayerstatechange",this.j);this.j()},fSf=function(U){g.lj.call(this,U); this.ZH={key:AuT(),name:"Este ordenador"};this.e2=null;this.subscriptions=[];this.o8=this.u9=null;this.PU=[this.ZH];this.ZP=this.ZH;this.g1=new g.z3(64);this.mX=0;this.rV=-1;this.Sz=!1;this.pF=this.ez=this.iU=null;if(!g.bo(this.player.L())&&!g.pV(this.player.L())){U=this.player;var Y=g.WC(U);Y&&(Y=Y.qF())&&(Y=new Ps(U,Y),g.Z(this,Y));Y=new l2(U);g.Z(this,Y);g.S4(U,Y.element,4);this.iU=new rk;g.Z(this,this.iU);g.S4(U,this.iU.element,4);this.Sz=!!Yf()}},Vt=function(U){U.ez&&(U.player.removeEventListener("presentingplayerstatechange", U.ez),U.ez=null)},h7z=function(U,Y,A){U.g1=A; U.player.publish("presentingplayerstatechange",new g.vh(A,Y))},$f=function(U,Y){if(Y.key!==U.ZP.key)if(Y.key===U.ZH.key)TA(); else if(Xjw(U)&&SZO(U),U.ZP=Y,!U.player.L().S("disable_mdx_connection_in_mdx_module_for_music_web")||!g.pV(U.player.L())){var A=U.player.getPlaylistId();var c=U.player.getVideoData(1);var d=c.videoId;if(!A&&!d||(U.player.getAppState()===2||U.player.getAppState()===1)&&U.player.L().S("should_clear_video_data_on_player_cued_unstarted"))c=null;else{var T=U.player.getPlaylist();if(T){var E=[];for(var L=0;L2*this.size&&T9(this),!0):!1}; g.W.get=function(U,Y){return c6(this.T,U)?this.T[U]:Y}; g.W.set=function(U,Y){c6(this.T,U)||(this.size+=1,this.Y.push(U),this.BU++);this.T[U]=Y}; g.W.forEach=function(U,Y){for(var A=this.C2(),c=0;c=c.Y.length)return g.EL;var T=c.Y[Y++];return g.RJ(U?T:c.T[T])}; return d}; var aDz={Arn:"atp",qsX:"ska",oUJ:"que",UkW:"mus",lpE:"sus",CaX:"dsp",kIy:"seq",ASY:"mic",WDv:"dpa",Jrv:"cds",FFI:"mlm",xdT:"dsdtr",GGY:"ntb",g_T:"vsp",KDf:"scn",A1f:"rpe",PaY:"dcn",H5Y:"dcp",qRW:"pas",T9v:"drq",z4v:"opf",J$X:"els",Udv:"isg",c1v:"svq",ITy:"mvp",ujY:"ads",hWn:"stcp",zWf:"sads",YOY:"dloc"},Kmf={Grf:"u",OJE:"cl",ZXT:"k",sXv:"i",RPs:"cr",JSW:"m",b5y:"g",G8:"up"},GPo={Jo:"adPlaying",Dt:"onAdStateChange"},Wwf={ghw:"nowPlaying",t2T:"onStateChange",Jo:"adPlaying",Dt:"onAdStateChange",vt:"nowPlayingShorts", u5:"onShortsStateChange"},w9Y={vt:"nowPlayingShorts",u5:"onShortsStateChange"};Eo.prototype.equals=function(U){return U?this.id==U.id:!1}; var zYq="",$Y=null;HUq.prototype.flush=function(U,Y){U=U===void 0?[]:U;Y=Y===void 0?!1:Y;if(g.ir("enable_client_streamz_web")){U=g.J(U);for(var A=U.next();!A.done;A=U.next())A=g.Cpv(A.value),A={serializedIncrementBatch:g.U_(A.T())},g.r7("streamzIncremented",A,{sendIsolatedPayload:Y})}}; var H6,N3m=Wzo("loadCastFramework")||Wzo("loadCastApplicationFramework"),B3w=["pkedcjkdefgpdelpbcmbmeomcjbeemfm","enhhojjnijigcajfphajepfemndkmdlo"];g.rL(W6,g.p);g.W=W6.prototype;g.W.gR=function(U){this.j=arguments;this.Y=!1;this.Z5?this.W=g.om()+this.Ar:this.Z5=g.M3(this.K,this.Ar)}; g.W.stop=function(){this.Z5&&(g.Dc.clearTimeout(this.Z5),this.Z5=null);this.W=null;this.Y=!1;this.j=[]}; g.W.pause=function(){++this.T}; g.W.resume=function(){this.T&&(--this.T,!this.T&&this.Y&&(this.Y=!1,this.J.apply(null,this.j)))}; g.W.Tn=function(){this.stop();W6.sy.Tn.call(this)}; g.W.OQ=function(){this.Z5&&(g.Dc.clearTimeout(this.Z5),this.Z5=null);this.W?(this.Z5=g.M3(this.K,this.W-g.om()),this.W=null):this.T?this.Y=!0:(this.Y=!1,this.J.apply(null,this.j))};wm.prototype.stringify=function(U){return g.Dc.JSON.stringify(U,void 0)}; wm.prototype.parse=function(U){return g.Dc.JSON.parse(U,void 0)};g.rL(k0Y,g.uY);g.rL(RYO,g.uY);var aoz=null;g.rL(sbL,g.uY);g.rL(foq,g.uY);g.rL(hYW,g.uY);jX.prototype.debug=function(){}; jX.prototype.info=function(){}; jX.prototype.warning=function(){};var mRL={},OUI={};g.W=Nh.prototype;g.W.setTimeout=function(U){this.qI=U}; g.W.z0=function(U){U=U.target;var Y=this.dW;Y&&g.Dm(U)==3?Y.Aq():this.fS(U)}; g.W.fS=function(U){try{if(U==this.Y)a:{var Y=g.Dm(this.Y),A=this.Y.T,c=this.Y.getStatus();if(!(Y<3)&&(Y!=3||this.Y&&(this.T.T||g.u7(this.Y)||g.Ke(this.Y)))){this.eX||Y!=4||A==7||(A==8||c<=0?i4(3):i4(2));nxF(this);var d=this.Y.getStatus();this.ws=d;var T=ZUL(this);if(this.J=d==200){if(this.Tk&&!this.yJ){b:{if(this.Y){var E=g.q3(this.Y,"X-HTTP-Initial-Response");if(E&&!g.HG(E)){var L=E;break b}}L=null}if(U=L)this.yJ=!0,AQq(this,U);else{this.J=!1;this.K=3;Je(12);eX(this);B6(this);break a}}if(this.QJ){U= !0;for(var r;!this.eX&&this.G0&&!this.AP&&(this.AP=!0,this.W.sI(this)):(eX(this),B6(this))}else AQq(this,T);Y==4&&eX(this);this.J&&!this.eX&&(Y==4?DRW(this.W,this):(this.J=!1,te(this)))}else g.F$8(this.Y),d==400&&T.indexOf("Unknown SID")> 0?(this.K=3,Je(12)):(this.K=0,Je(13)),eX(this),B6(this)}}}catch(l){}finally{}}; g.W.cancel=function(){this.eX=!0;eX(this)}; g.W.dR=function(){this.Pw=null;var U=Date.now();U-this.VJ>=0?(this.kE!=2&&(i4(3),Je(17)),eX(this),this.K=2,B6(this)):yuq(this,this.VJ-U)}; g.W.getLastError=function(){return this.K}; g.W.G1=function(){return this.Y};dCm.prototype.cancel=function(){this.W=E6q(this);if(this.T)this.T.cancel(),this.T=null;else if(this.Y&&this.Y.size!==0){for(var U=g.J(this.Y.values()),Y=U.next();!Y.done;Y=U.next())Y.value.cancel();this.Y.clear()}};g.W=lNw.prototype;g.W.Nr=8;g.W.YC=1;g.W.connect=function(U,Y,A,c){Je(0);this.mH=U;this.eX=Y||{};A&&c!==void 0&&(this.eX.OSID=A,this.eX.OAID=c);this.yJ=this.Lr;this.Uv=CHI(this,null,this.mH);ai(this)}; g.W.disconnect=function(){VAT(this);if(this.YC==3){var U=this.Zf++,Y=this.Uv.clone();g.PP(Y,"SID",this.j);g.PP(Y,"RID",U);g.PP(Y,"TYPE","terminate");fp(this,Y);U=new Nh(this,this.j,U);U.kE=2;U.Z=CP(Y.clone());Y=!1;if(g.Dc.navigator&&g.Dc.navigator.sendBeacon)try{Y=g.Dc.navigator.sendBeacon(U.Z.toString(),"")}catch(A){}!Y&&g.Dc.Image&&((new Image).src=U.Z,Y=!0);Y||(U.Y=p5O(U.W,null),U.Y.send(U.Z));U.ov=Date.now();te(U)}wAF(this)}; g.W.oe=function(){return this.YC==0}; g.W.getState=function(){return this.YC}; g.W.l7=function(U){if(this.J)if(this.J=null,this.YC==1){if(!U){this.Zf=Math.floor(Math.random()*1E5);U=this.Zf++;var Y=new Nh(this,"",U),A=this.X;this.ws&&(A?(A=g.YR(A),g.cG(A,this.ws)):A=this.ws);this.G!==null||this.VJ||(Y.Uv=A,A=null);var c;if(this.i$)a:{for(var d=c=0;d4096){c=d;break a}if(c===4096||d===this.W.length-1){c=d+1;break a}}c= 1E3}else c=1E3;c=HgW(this,Y,c);d=this.Uv.clone();g.PP(d,"RID",U);g.PP(d,"CVER",22);this.QJ&&g.PP(d,"X-HTTP-Session-Id",this.QJ);fp(this,d);A&&(this.VJ?c="headers="+g.$n(g.prS(A))+"&"+c:this.G&&g.HP(d,this.G,A));qIO(this.T,Y);this.NU&&g.PP(d,"TYPE","init");this.i$?(g.PP(d,"$req",c),g.PP(d,"SID","null"),Y.Tk=!0,bUz(Y,d,null)):bUz(Y,d,c);this.YC=2}}else this.YC==3&&(U?G1T(this,U):this.W.length==0||T7o(this.T)||G1T(this))}; g.W.Zi=function(){this.Z=null;WvL(this);if(this.qz&&!(this.qI||this.Y==null||this.KU<=0)){var U=2*this.KU;this.jX=F5((0,g.dL)(this.Bsy,this),U)}}; g.W.Bsy=function(){this.jX&&(this.jX=null,this.yJ=!1,this.qI=!0,Je(10),kY(this),WvL(this))}; g.W.sI=function(U){this.Y==U&&this.qz&&!this.qI&&(PWf(this),this.qI=!0,Je(11))}; g.W.mC=function(){this.Pw!=null&&(this.Pw=null,kY(this),uCT(this),Je(19))}; g.W.S9n=function(U){U?Je(2):Je(1)}; g.W.isActive=function(){return!!this.K&&this.K.isActive(this)}; g.W=JQf.prototype;g.W.Ei=function(){}; g.W.aq=function(){}; g.W.qr=function(){}; g.W.LS=function(){}; g.W.isActive=function(){return!0}; g.W.tf=function(){};g.rL(SX,g.PO);SX.prototype.open=function(){this.Y.K=this.W;this.J&&(this.Y.kE=!0);this.Y.connect(this.K,this.T||void 0)}; SX.prototype.close=function(){this.Y.disconnect()}; SX.prototype.send=function(U){var Y=this.Y;if(typeof U==="string"){var A={};A.__data__=U;U=A}else this.j&&(A={},A.__data__=g.Zm(U),U=A);Y.W.push(new cQI(Y.Bu++,U));Y.YC==3&&ai(Y)}; SX.prototype.Tn=function(){this.Y.K=null;delete this.W;this.Y.disconnect();delete this.Y;SX.sy.Tn.call(this)}; g.rL(jEj,k0Y);g.rL(N7T,RYO);g.rL(he,JQf);he.prototype.Ei=function(){this.Y.dispatchEvent("m")}; he.prototype.aq=function(U){this.Y.dispatchEvent(new jEj(U))}; he.prototype.qr=function(U){this.Y.dispatchEvent(new N7T(U))}; he.prototype.LS=function(){this.Y.dispatchEvent("n")};var b4=new g.PO;g.w(B7o,g.uY);g.W=QD.prototype;g.W.Ci=null;g.W.JA=!1;g.W.oD=null;g.W.JL=null;g.W.cW=null;g.W.PB=null;g.W.ra=null;g.W.w_=null;g.W.hv=null;g.W.k5=null;g.W.YM=0;g.W.bR=null;g.W.HB=null;g.W.VX=null;g.W.yA=-1;g.W.mR=!0;g.W.GL=!1;g.W.U0=0;g.W.iM=null;var sEW={},xCw={};g.W=QD.prototype;g.W.setTimeout=function(U){this.T=U}; g.W.Be=function(U){U=U.target;var Y=this.iM;Y&&g.Dm(U)==3?Y.Aq():this.pS(U)}; g.W.pS=function(U){try{if(U==this.k5)a:{var Y=g.Dm(this.k5),A=this.k5.T,c=this.k5.getStatus();if(g.DH&&!g.eF("420+")){if(Y<4)break a}else if(Y<3||Y==3&&!g.u7(this.k5))break a;this.GL||Y!=4||A==7||(A==8||c<=0?this.Y.BK(3):this.Y.BK(2));Suw(this);var d=this.k5.getStatus();this.yA=d;var T=g.u7(this.k5);if(this.JA=d==200){Y==4&&Z2(this);if(this.QJ){for(U=!0;!this.GL&&this.YM0?(this.VX=3,pp(13)):(this.VX=0,pp(14)),Z2(this),MAo(this)}}catch(L){}finally{}}; g.W.cancel=function(){this.GL=!0;Z2(this)}; g.W.b3=function(){this.oD=null;var U=Date.now();U-this.JL>=0?(this.PB!=2&&this.Y.BK(3),Z2(this),this.VX=2,pp(18),MAo(this)):h9z(this,this.JL-U)}; g.W.getLastError=function(){return this.VX};g.W=Zgo.prototype;g.W.eA=null;g.W.IX=null;g.W.mE=!1;g.W.rS=null;g.W.uQ=null;g.W.Cl=-1;g.W.T4=null;g.W.yg=null;g.W.connect=function(U){this.rS=U;U=m_(this.Y,null,this.rS);pp(3);Date.now();var Y=this.Y.X;Y!=null?(this.T4=Y[0],(this.yg=Y[1])?(this.uQ=1,Ogz(this)):(this.uQ=2,mCF(this))):(Uo(U,"MODE","init"),this.IX=new QD(this),this.IX.Ci=this.eA,R9j(this.IX,U,!1,null,!0),this.uQ=0)}; g.W.jY=function(U){if(U)this.uQ=2,mCF(this);else{pp(4);var Y=this.Y;Y.Eb=Y.fI.Cl;D2(Y,9)}U&&this.BK(2)}; g.W.Kq=function(U){return this.Y.Kq(U)}; g.W.abort=function(){this.IX&&(this.IX.cancel(),this.IX=null);this.Cl=-1}; g.W.oe=function(){return!1}; g.W.Rq=function(U,Y){this.Cl=U.yA;if(this.uQ==0)if(Y){try{var A=this.T.parse(Y)}catch(c){U=this.Y;U.Eb=this.Cl;D2(U,2);return}this.T4=A[0];this.yg=A[1]}else U=this.Y,U.Eb=this.Cl,D2(U,2);else this.uQ==2&&(this.mE?(pp(7),Date.now()):Y=="11111"?(pp(6),this.mE=!0,Date.now(),this.Cl=200,this.IX.cancel(),pp(12),gm(this.Y,this,!0)):(pp(8),Date.now(),this.mE=!1))}; g.W.SA=function(){this.Cl=this.IX.yA;if(this.IX.JA)this.uQ==0?this.yg?(this.uQ=1,Ogz(this)):(this.uQ=2,mCF(this)):this.uQ==2&&(this.mE?(pp(12),gm(this.Y,this,!0)):(pp(11),gm(this.Y,this,!1)));else{this.uQ==0?pp(9):this.uQ==2&&pp(10);var U=this.Y;this.IX.getLastError();U.Eb=this.Cl;D2(U,2)}}; g.W.O5=function(){return this.Y.O5()}; g.W.isActive=function(){return this.Y.isActive()}; g.W.BK=function(U){this.Y.BK(U)};g.W=g6z.prototype;g.W.Qe=null;g.W.zL=null;g.W.g9=null;g.W.QG=null;g.W.yf=null;g.W.xM=null;g.W.nS=null;g.W.GZ=null;g.W.tY=0;g.W.NC=0;g.W.Th=null;g.W.KI=null;g.W.VH=null;g.W.M3=null;g.W.fI=null;g.W.Xv=null;g.W.v_=-1;g.W.CS=-1;g.W.Eb=-1;g.W.AG=0;g.W.W_=0;g.W.Xb=8;var M5F={OK:0,uBs:2,PQW:4,cSE:5,rWY:6,STOP:7,An:8,DAf:9,v5I:10,jJw:11,QSY:12};g.rL(n6I,g.uY);g.rL(DCI,g.uY);g.W=g6z.prototype; g.W.connect=function(U,Y,A,c,d){pp(0);this.yf=Y;this.zL=A||{};c&&d!==void 0&&(this.zL.OSID=c,this.zL.OAID=d);this.Z?(Mh((0,g.dL)(this.Qn,this,U),100),u4o(this)):this.Qn(U)}; g.W.disconnect=function(){Kvw(this);if(this.Y==3){var U=this.tY++,Y=this.xM.clone();g.PP(Y,"SID",this.j);g.PP(Y,"RID",U);g.PP(Y,"TYPE","terminate");np(this,Y);U=new QD(this,this.j,U);U.PB=2;U.ra=CP(Y.clone());(new Image).src=U.ra.toString();U.cW=Date.now();aNW(U)}oFW(this)}; g.W.Qn=function(U){this.fI=new Zgo(this);this.fI.eA=this.Qe;this.fI.T=this.K;this.fI.connect(U)}; g.W.oe=function(){return this.Y==0}; g.W.getState=function(){return this.Y}; g.W.hV=function(U){this.KI=null;AbT(this,U)}; g.W.VY=function(){this.VH=null;this.QG=new QD(this,this.j,"rpc",this.G);this.QG.Ci=this.Qe;this.QG.U0=0;var U=this.nS.clone();g.PP(U,"RID","rpc");g.PP(U,"SID",this.j);g.PP(U,"CI",this.Xv?"0":"1");g.PP(U,"AID",this.v_);np(this,U);g.PP(U,"TYPE","xmlhttp");R9j(this.QG,U,!0,this.GZ,!1)}; g.W.Rq=function(U,Y){if(this.Y!=0&&(this.QG==U||this.g9==U))if(this.Eb=U.yA,this.g9==U&&this.Y==3)if(this.Xb>7){try{var A=this.K.parse(Y)}catch(c){A=null}if(Array.isArray(A)&&A.length==3)if(U=A,U[0]==0)a:{if(!this.VH){if(this.QG)if(this.QG.cW+3E30)){if(c=Y==1)this.g9||this.KI||this.Y==1||this.AG>=2?c=!1:(this.KI=Mh((0,g.dL)(this.hV,this,U),dbT(this,this.AG)),this.AG++, c=!0);c=!(c||Y==2&&TUz(this))}if(c)switch(A){case 1:D2(this,5);break;case 4:D2(this,10);break;case 3:D2(this,6);break;case 7:D2(this,12);break;default:D2(this,2)}}}; g.W.fu=function(U){if(!g.Go(arguments,this.Y))throw Error("Unexpected channel state: "+this.Y);}; g.W.e6I=function(U){U?pp(2):(pp(1),EFo(this,8))}; g.W.Kq=function(U){if(U)throw Error("Can't create secondary domain capable XhrIo object.");U=new g.g9;U.G=!1;return U}; g.W.isActive=function(){return!!this.Th&&this.Th.isActive(this)}; g.W.BK=function(U){var Y=b4;Y.dispatchEvent(new DCI(Y,U))}; g.W.O5=function(){return!1}; g.W=zFq.prototype;g.W.wG=function(){}; g.W.M8=function(){}; g.W.Pd=function(){}; g.W.X2=function(){}; g.W.gS=function(){}; g.W.Hd=function(){return{}}; g.W.isActive=function(){return!0};g.W=LwW.prototype;g.W.enqueue=function(U){this.T.push(U)}; g.W.isEmpty=function(){return this.Y.length===0&&this.T.length===0}; g.W.clear=function(){this.Y=[];this.T=[]}; g.W.contains=function(U){return g.Go(this.Y,U)||g.Go(this.T,U)}; g.W.remove=function(U){var Y=this.Y;var A=(0,g.q9f)(Y,U);A>=0?(g.WW(Y,A),Y=!0):Y=!1;return Y||g.wL(this.T,U)}; g.W.Bm=function(){for(var U=[],Y=this.Y.length-1;Y>=0;--Y)U.push(this.Y[Y]);Y=this.T.length;for(var A=0;A=b$m.length?this.publish("pairingFailed",Error("DIAL polling timed out")):(U=b$m[this.T],this.Z5=g.vn((0,g.dL)(this.VM,this),U),this.T++):this.publish("pairingFailed",Error("Server error "+U.status))}; g.W.pu=function(){this.Y=null;this.publish("pairingFailed",Error("Server not responding"))}; var b$m=[2E3,2E3,1E3,1E3,1E3,2E3,2E3,5E3,5E3,1E4];g.rL(oT,TD);g.W=oT.prototype;g.W.start=function(){Ef(this)&&this.publish("screenChange");!g.hu("yt-remote-lounge-token-expiration")&&mbo(this);g.Gw(this.Y);this.Y=g.vn((0,g.dL)(this.start,this),1E4)}; g.W.add=function(U,Y){Ef(this);p9w(this,U);zD(this,!1);this.publish("screenChange");Y(U);U.token||mbo(this)}; g.W.remove=function(U,Y){var A=Ef(this);ZcL(this,U)&&(zD(this,!1),A=!0);Y(U);A&&this.publish("screenChange")}; g.W.Vh=function(U,Y,A,c){var d=Ef(this),T=this.get(U.id);T?(T.name!=Y&&(T.name=Y,zD(this,!1),d=!0),A(U)):c(Error("no such local screen."));d&&this.publish("screenChange")}; g.W.Tn=function(){g.Gw(this.Y);oT.sy.Tn.call(this)}; g.W.N$=function(U){Ef(this);var Y=this.screens.length;U=U&&U.screens||[];for(var A=U.length,c=0;c20)break a;L=Y(T,E)}T=L}d.name=T}A(lJ(this,d))},this), onError:(0,g.dL)(function(d){c(Error("pairing request failed: "+d.status))},this), onTimeout:(0,g.dL)(function(){c(Error("pairing request timed out."))},this)})}; g.W.Tn=function(){g.P7(this.T);g.P7(this.Y);rx.sy.Tn.call(this)}; g.W.Vr=function(){AHT(this);this.publish("screenChange");this.Y.update()}; rx.prototype.dispose=rx.prototype.dispose;g.rL(Pf,g.l6);g.W=Pf.prototype;g.W.RJ=function(U){this.Ky()||(U&&($9(this,""+U),this.publish("sessionFailed")),this.Y=null,this.publish("sessionScreen",null))}; g.W.info=function(U){Uf(this.QJ,U)}; g.W.oB=function(){return null}; g.W.iq=function(U){var Y=this.T;U?(Y.displayStatus=new chrome.cast.ReceiverDisplayStatus(U,[]),Y.displayStatus.showStop=!0):Y.displayStatus=null;chrome.cast.setReceiverDisplayStatus(Y,(0,g.dL)(function(){this.info("Updated receiver status for "+Y.friendlyName+": "+U)},this),(0,g.dL)(function(){$9(this,"Failed to update receiver status for: "+Y.friendlyName)},this))}; g.W.Tn=function(){this.iq("");Pf.sy.Tn.call(this)};g.w(vf,Pf);g.W=vf.prototype;g.W.Xc=function(U){if(this.W){if(this.W==U)return;$9(this,"Overriding cast session with new session object");$ko(this);this.ov=!1;this.X="unknown";this.W.removeUpdateListener(this.Hw);this.W.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.jX)}this.W=U;this.W.addUpdateListener(this.Hw);this.W.addMessageListener("urn:x-cast:com.google.youtube.mdx",this.jX);Lqm(this,"getMdxSessionStatus")}; g.W.xb=function(U){this.info("launchWithParams no-op for Cast: "+g.Zm(U))}; g.W.stop=function(){this.W?this.W.stop((0,g.dL)(function(){this.RJ()},this),(0,g.dL)(function(){this.RJ(Error("Failed to stop receiver app."))},this)):this.RJ(Error("Stopping cast device without session."))}; g.W.iq=function(){}; g.W.Tn=function(){this.info("disposeInternal");$ko(this);this.W&&(this.W.removeUpdateListener(this.Hw),this.W.removeMessageListener("urn:x-cast:com.google.youtube.mdx",this.jX));this.W=null;Pf.prototype.Tn.call(this)}; g.W.UUn=function(U,Y){if(!this.Ky())if(Y)if(Y=YY(Y),g.Yz(Y))switch(U=""+Y.type,Y=Y.data||{},this.info("onYoutubeMessage_: "+U+" "+g.Zm(Y)),U){case "mdxSessionStatus":ESY(this,Y);break;case "loungeToken":rHq(this,Y);break;default:$9(this,"Unknown youtube message: "+U)}else $9(this,"Unable to parse message.");else $9(this,"No data in message.")}; g.W.Gm=function(U,Y,A,c){g.Gw(this.Z);this.Z=0;CzW(this.j,this.T.label,U,this.T.friendlyName,(0,g.dL)(function(d){d?Y(d):c>=0?($9(this,"Screen "+U+" appears to be offline. "+c+" retries left."),this.Z=g.vn((0,g.dL)(this.Gm,this,U,Y,A,c-1),300)):A(Error("Unable to fetch screen."))},this),A)}; g.W.oB=function(){return this.W}; g.W.nu=function(U){this.Ky()||U||($9(this,"Cast session died."),this.RJ())};g.w(Hf,Pf);g.W=Hf.prototype;g.W.Xc=function(U){this.W=U;this.W.addUpdateListener(this.eX)}; g.W.xb=function(U){this.Uv=U;this.Pw()}; g.W.stop=function(){Fqo(this);this.W?this.W.stop((0,g.dL)(this.RJ,this,null),(0,g.dL)(this.RJ,this,"Failed to stop DIAL device.")):this.RJ()}; g.W.Tn=function(){Fqo(this);this.W&&this.W.removeUpdateListener(this.eX);this.W=null;Pf.prototype.Tn.call(this)}; g.W.Cu=function(U){this.Ky()||U||($9(this,"DIAL session died."),this.K(),this.K=function(){},this.RJ())};g.w(wx,Pf);wx.prototype.stop=function(){this.RJ()}; wx.prototype.Xc=function(){}; wx.prototype.xb=function(){g.Gw(this.W);this.W=NaN;var U=rm(this.j.LX(),this.T.label);U?Vg(this,U):this.RJ(Error("No such screen"))}; wx.prototype.Tn=function(){g.Gw(this.W);this.W=NaN;Pf.prototype.Tn.call(this)};g.w(iJ,g.l6);g.W=iJ.prototype; g.W.init=function(U,Y){chrome.cast.timeout.requestSession=3E4;var A=new chrome.cast.SessionRequest(this.Z,[chrome.cast.Capability.AUDIO_OUT]);g.ir("desktop_enable_cast_connect")&&(A.androidReceiverCompatible=!0);this.X||(A.dialRequest=new chrome.cast.DialRequest("YouTube"));var c=chrome.cast.AutoJoinPolicy.TAB_AND_ORIGIN_SCOPED;U=U||this.J?chrome.cast.DefaultActionPolicy.CAST_THIS_TAB:chrome.cast.DefaultActionPolicy.CREATE_SESSION;var d=(0,g.dL)(this.GNT,this);A=new chrome.cast.ApiConfig(A,(0,g.dL)(this.IL, this),d,c,U);A.customDialLaunchCallback=(0,g.dL)(this.hys,this);chrome.cast.initialize(A,(0,g.dL)(function(){this.Ky()||(chrome.cast.addReceiverActionListener(this.K),hFY(),this.T.subscribe("onlineScreenChange",(0,g.dL)(this.Wd,this)),this.W=tHI(this),chrome.cast.setCustomReceivers(this.W,function(){},(0,g.dL)(function(T){this.eI("Failed to set initial custom receivers: "+g.Zm(T))},this)),this.publish("yt-remote-cast2-availability-change",F8(this)),Y(!0))},this),(0,g.dL)(function(T){this.eI("Failed to initialize API: "+ g.Zm(T)); Y(!1)},this))}; g.W.tIy=function(U,Y){JP("Setting connected screen ID: "+U+" -> "+Y);if(this.Y){var A=this.Y.Y;if(!U||A&&A.id!=U)JP("Unsetting old screen status: "+this.Y.T.friendlyName),jN(this,null)}if(U&&Y){if(!this.Y){U=rm(this.T.LX(),U);if(!U){JP("setConnectedScreenStatus: Unknown screen.");return}if(U.idType=="shortLived"){JP("setConnectedScreenStatus: Screen with id type to be short lived.");return}A=jQo(this,U);A||(JP("setConnectedScreenStatus: Connected receiver not custom..."),A=new chrome.cast.Receiver(U.uuid? U.uuid:U.id,U.name),A.receiverType=chrome.cast.ReceiverType.CUSTOM,this.W.push(A),chrome.cast.setCustomReceivers(this.W,function(){},(0,g.dL)(function(c){this.eI("Failed to set initial custom receivers: "+g.Zm(c))},this))); JP("setConnectedScreenStatus: new active receiver: "+A.friendlyName);jN(this,new wx(this.T,A),!0)}this.Y.iq(Y)}else JP("setConnectedScreenStatus: no screen.")}; g.W.Nvf=function(U){this.Ky()?this.eI("Setting connection data on disposed cast v2"):this.Y?this.Y.xb(U):this.eI("Setting connection data without a session")}; g.W.hf=function(){this.Ky()?this.eI("Stopping session on disposed cast v2"):this.Y?(this.Y.stop(),jN(this,null)):JP("Stopping non-existing session")}; g.W.requestSession=function(){chrome.cast.requestSession((0,g.dL)(this.IL,this),(0,g.dL)(this.R_r,this))}; g.W.Tn=function(){this.T.unsubscribe("onlineScreenChange",(0,g.dL)(this.Wd,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.K);var U=xbY,Y=g.u8("yt.mdx.remote.debug.handlers_");g.wL(Y||[],U);g.P7(this.Y);g.l6.prototype.Tn.call(this)}; g.W.eI=function(U){Uf("Controller",U)}; g.W.Jy=function(U,Y){this.Y==U&&(Y||jN(this,null),this.publish("yt-remote-cast2-session-change",Y))}; g.W.SHI=function(U,Y){if(!this.Ky())if(U)switch(U.friendlyName=chrome.cast.unescape(U.friendlyName),JP("onReceiverAction_ "+U.label+" / "+U.friendlyName+"-- "+Y),Y){case chrome.cast.ReceiverAction.CAST:if(this.Y)if(this.Y.T.label!=U.label)JP("onReceiverAction_: Stopping active receiver: "+this.Y.T.friendlyName),this.Y.stop();else{JP("onReceiverAction_: Casting to active receiver.");this.Y.Y&&this.publish("yt-remote-cast2-session-change",this.Y.Y);break}switch(U.receiverType){case chrome.cast.ReceiverType.CUSTOM:jN(this, new wx(this.T,U));break;case chrome.cast.ReceiverType.DIAL:jN(this,new Hf(this.T,U,this.j,this.config_));break;case chrome.cast.ReceiverType.CAST:jN(this,new vf(this.T,U,this.config_));break;default:this.eI("Unknown receiver type: "+U.receiverType)}break;case chrome.cast.ReceiverAction.STOP:this.Y&&this.Y.T.label==U.label?this.Y.stop():this.eI("Stopping receiver w/o session: "+U.friendlyName)}else this.eI("onReceiverAction_ called without receiver.")}; g.W.hys=function(U){if(this.Ky())return Promise.reject(Error("disposed"));var Y=U.receiver;Y.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.eI("Not DIAL receiver: "+Y.friendlyName),Y.receiverType=chrome.cast.ReceiverType.DIAL);var A=this.Y?this.Y.T:null;if(!A||A.label!=Y.label)return this.eI("Receiving DIAL launch request for non-clicked DIAL receiver: "+Y.friendlyName),Promise.reject(Error("illegal DIAL launch"));if(A&&A.label==Y.label&&A.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.Y.Y)return JP("Reselecting dial screen."), this.publish("yt-remote-cast2-session-change",this.Y.Y),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.eI('Changing CAST intent from "'+A.receiverType+'" to "dial" for '+Y.friendlyName);jN(this,new Hf(this.T,Y,this.j,this.config_))}Y=this.Y;Y.Z=U;Y.Z.appState==chrome.cast.DialAppState.RUNNING?(U=Y.Z.extraData||{},A=U.screenId||null,GD(Y)&&U.loungeToken?U.loungeTokenRefreshIntervalMs?U=wxW(Y,{name:Y.T.friendlyName,screenId:U.screenId,loungeToken:U.loungeToken,dialId:Y.Z.receiver.label, screenIdType:"shortLived"},U.loungeTokenRefreshIntervalMs):(g.KF(Error("No loungeTokenRefreshIntervalMs presents in additionalData: "+JSON.stringify(U)+".")),U=iTw(Y,A)):U=iTw(Y,A)):U=G4T(Y);return U}; g.W.IL=function(U){var Y=this;if(!this.Ky()&&!this.J){JP("New cast session ID: "+U.sessionId);var A=U.receiver;if(A.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.Y)if(A.receiverType==chrome.cast.ReceiverType.CAST)JP("Got resumed cast session before resumed mdx connection."),A.friendlyName=chrome.cast.unescape(A.friendlyName),jN(this,new vf(this.T,A,this.config_),!0);else{this.eI("Got non-cast session without previous mdx receiver event, or mdx resume.");return}var c=this.Y.T,d=rm(this.T.LX(), c.label);d&&z9(d,A.label)&&c.receiverType!=chrome.cast.ReceiverType.CAST&&A.receiverType==chrome.cast.ReceiverType.CAST&&(JP("onSessionEstablished_: manual to cast session change "+A.friendlyName),g.P7(this.Y),this.Y=new vf(this.T,A,this.config_),this.Y.subscribe("sessionScreen",(0,g.dL)(this.Jy,this,this.Y)),this.Y.subscribe("sessionFailed",function(){return Nnq(Y,Y.Y)}),this.Y.xb(null)); this.Y.Xc(U)}}}; g.W.V7=function(){return this.Y?this.Y.oB():null}; g.W.R_r=function(U){this.Ky()||(this.eI("Failed to estabilish a session: "+g.Zm(U)),U.code!=chrome.cast.ErrorCode.CANCEL&&jN(this,null),this.publish("yt-remote-cast2-session-failed"))}; g.W.GNT=function(U){JP("Receiver availability updated: "+U);if(!this.Ky()){var Y=F8(this);this.G=U==chrome.cast.ReceiverAvailability.AVAILABLE;F8(this)!=Y&&this.publish("yt-remote-cast2-availability-change",F8(this))}}; g.W.Wd=function(){this.Ky()||(this.W=tHI(this),JP("Updating custom receivers: "+g.Zm(this.W)),chrome.cast.setCustomReceivers(this.W,function(){},(0,g.dL)(function(){this.eI("Failed to set custom receivers.")},this)),this.publish("yt-remote-cast2-availability-change",F8(this)))}; iJ.prototype.setLaunchParams=iJ.prototype.Nvf;iJ.prototype.setConnectedScreenStatus=iJ.prototype.tIy;iJ.prototype.stopSession=iJ.prototype.hf;iJ.prototype.getCastSession=iJ.prototype.V7;iJ.prototype.requestSession=iJ.prototype.requestSession;iJ.prototype.init=iJ.prototype.init;iJ.prototype.dispose=iJ.prototype.dispose;var fsO=[];g.W=RT.prototype; g.W.reset=function(U){this.listId="";this.index=-1;this.videoId="";QQq(this);this.volume=-1;this.muted=!1;U&&(this.index=U.index,this.listId=U.listId,this.videoId=U.videoId,this.playerState=U.playerState,this.volume=U.volume,this.muted=U.muted,this.audioTrackId=U.audioTrackId,this.trackData=U.trackData,this.kD=U.hasPrevious,this.pX=U.hasNext,this.G=U.playerTime,this.J=U.playerTimeAt,this.j=U.seekableStart,this.Y=U.seekableEnd,this.K=U.duration,this.Z=U.loadedTime,this.W=U.liveIngestionTime,this.T= !isNaN(this.W))}; g.W.isPlaying=function(){return this.playerState==1}; g.W.isBuffering=function(){return this.playerState==3}; g.W.sb=function(){return this.playerState==1081}; g.W.sL=function(U){this.K=isNaN(U)?0:U}; g.W.getDuration=function(){return this.T?this.K+aT(this):this.K}; g.W.clone=function(){return new RT(ZTz(this))};g.w(SN,g.l6);g.W=SN.prototype;g.W.getState=function(){return this.W}; g.W.Px=function(){return this.j.getReconnectTimeout()}; g.W.JC=function(){this.j.reconnect()}; g.W.play=function(){bJ(this)?(this.Y?this.Y.play(null,g.Vm,Of(this,"play")):Z6(this,"play"),gSO(this,1,sf(Mt(this))),this.publish("remotePlayerChange")):pb(this,this.play)}; g.W.pause=function(){bJ(this)?(this.Y?this.Y.pause(null,g.Vm,Of(this,"pause")):Z6(this,"pause"),gSO(this,2,sf(Mt(this))),this.publish("remotePlayerChange")):pb(this,this.pause)}; g.W.seekTo=function(U){if(bJ(this)){if(this.Y){var Y=Mt(this),A=new chrome.cast.media.SeekRequest;A.currentTime=U;Y.isPlaying()||Y.isBuffering()?A.resumeState=chrome.cast.media.ResumeState.PLAYBACK_START:A.resumeState=chrome.cast.media.ResumeState.PLAYBACK_PAUSE;this.Y.seek(A,g.Vm,Of(this,"seekTo",{newTime:U}))}else Z6(this,"seekTo",{newTime:U});gSO(this,3,U);this.publish("remotePlayerChange")}else pb(this,g.EO(this.seekTo,U))}; g.W.stop=function(){if(bJ(this)){this.Y?this.Y.stop(null,g.Vm,Of(this,"stopVideo")):Z6(this,"stopVideo");var U=Mt(this);U.index=-1;U.videoId="";QQq(U);Qg(this,U);this.publish("remotePlayerChange")}else pb(this,this.stop)}; g.W.setVolume=function(U,Y){if(bJ(this)){var A=Mt(this);if(this.T){if(A.volume!=U){var c=Math.round(U)/100;this.T.setReceiverVolumeLevel(c,(0,g.dL)(function(){Y9("set receiver volume: "+c)},this),(0,g.dL)(function(){this.eI("failed to set receiver volume.")},this))}A.muted!=Y&&this.T.setReceiverMuted(Y,(0,g.dL)(function(){Y9("set receiver muted: "+Y)},this),(0,g.dL)(function(){this.eI("failed to set receiver muted.")},this))}else{var d={volume:U, muted:Y};A.volume!=-1&&(d.delta=U-A.volume);Z6(this,"setVolume",d)}A.muted=Y;A.volume=U;Qg(this,A)}else pb(this,g.EO(this.setVolume,U,Y))}; g.W.AJ=function(U,Y){if(bJ(this)){var A=Mt(this);U={videoId:U};Y&&(A.trackData={trackName:Y.name,languageCode:Y.languageCode,sourceLanguageCode:Y.translationLanguage?Y.translationLanguage.languageCode:"",languageName:Y.languageName,kind:Y.kind},U.style=g.Zm(Y.style),g.cG(U,A.trackData));Z6(this,"setSubtitlesTrack",U);Qg(this,A)}else pb(this,g.EO(this.AJ,U,Y))}; g.W.setAudioTrack=function(U,Y){bJ(this)?(Y=Y.getLanguageInfo().getId(),Z6(this,"setAudioTrack",{videoId:U,audioTrackId:Y}),U=Mt(this),U.audioTrackId=Y,Qg(this,U)):pb(this,g.EO(this.setAudioTrack,U,Y))}; g.W.playVideo=function(U,Y,A,c,d,T,E){c=c===void 0?null:c;d=d===void 0?null:d;T=T===void 0?null:T;E=E===void 0?null:E;var L=Mt(this),r={videoId:U};A!==void 0&&(r.currentIndex=A);fb(L,U,A||0);Y!==void 0&&(x9(L,Y),r.currentTime=Y);c&&(r.listId=c);d&&(r.playerParams=d);T&&(r.clickTrackingParams=T);E&&(r.locationInfo=g.Zm(E));Z6(this,"setPlaylist",r);c||Qg(this,L)}; g.W.G6=function(U,Y){if(bJ(this)){if(U&&Y){var A=Mt(this);fb(A,U,Y);Qg(this,A)}Z6(this,"previous")}else pb(this,g.EO(this.G6,U,Y))}; g.W.nextVideo=function(U,Y){if(bJ(this)){if(U&&Y){var A=Mt(this);fb(A,U,Y);Qg(this,A)}Z6(this,"next")}else pb(this,g.EO(this.nextVideo,U,Y))}; g.W.Bc=function(){if(bJ(this)){Z6(this,"clearPlaylist");var U=Mt(this);U.reset();Qg(this,U);this.publish("remotePlayerChange")}else pb(this,this.Bc)}; g.W.zS=function(){bJ(this)?Z6(this,"dismissAutoplay"):pb(this,this.zS)}; g.W.dispose=function(){if(this.W!=3){var U=this.W;this.W=3;this.publish("proxyStateChange",U,this.W)}g.l6.prototype.dispose.call(this)}; g.W.Tn=function(){mkI(this);this.j=null;this.K.clear();hP(this,null);g.l6.prototype.Tn.call(this)}; g.W.YS=function(U){if((U!=this.W||U==2)&&this.W!=3&&U!=0){var Y=this.W;this.W=U;this.publish("proxyStateChange",Y,U);if(U==1)for(;!this.K.isEmpty();)Y=U=this.K,Y.Y.length===0&&(Y.Y=Y.T,Y.Y.reverse(),Y.T=[]),U.Y.pop().apply(this);else U==3&&this.dispose()}}; g.W.JBy=function(U,Y){this.publish(U,Y)}; g.W.lmX=function(U){if(!U)this.VW(null),hP(this,null);else if(this.T.receiver.volume){U=this.T.receiver.volume;var Y=Mt(this),A=Math.round(100*U.level||0);if(Y.volume!=A||Y.muted!=U.muted)Y9("Cast volume update: "+U.level+(U.muted?" muted":"")),Y.volume=A,Y.muted=!!U.muted,Qg(this,Y)}}; g.W.VW=function(U){Y9("Cast media: "+!!U);this.Y&&this.Y.removeUpdateListener(this.Z);if(this.Y=U)this.Y.addUpdateListener(this.Z),yHL(this),this.publish("remotePlayerChange")}; g.W.ZrY=function(U){U?(yHL(this),this.publish("remotePlayerChange")):this.VW(null)}; g.W.bq=function(){Z6(this,"sendDebugCommand",{debugCommand:"stats4nerds "})}; g.W.q3w=function(){var U=MHW();U&&hP(this,U)}; g.W.eI=function(U){Uf("CP",U)};g.w(yg,g.l6);g.W=yg.prototype; g.W.connect=function(U,Y){if(Y){var A=Y.listId,c=Y.videoId,d=Y.videoIds,T=Y.playerParams,E=Y.clickTrackingParams,L=Y.index,r={videoId:c},l=Y.currentTime,P=Y.locationInfo;Y=Y.loopMode;l!==void 0&&(r.currentTime=l<=5?0:l);T&&(r.playerParams=T);P&&(r.locationInfo=P);E&&(r.clickTrackingParams=E);A&&(r.listId=A);d&&d.length>0&&(r.videoIds=d.join(","));L!==void 0&&(r.currentIndex=L);this.eX&&(r.loopMode=Y||"LOOP_MODE_OFF");A&&(this.Y.listId=A);this.Y.videoId=c;this.Y.index=L||0;this.Y.state=3;x9(this.Y, l);this.K="UNSUPPORTED";A=this.eX?"setInitialState":"setPlaylist";mY("Connecting with "+A+" and params: "+g.Zm(r));this.T.connect({method:A,params:g.Zm(r)},U,ruF())}else mY("Connecting without params"),this.T.connect({},U,ruF());uaz(this)}; g.W.Hr=function(U){this.T.Hr(U)}; g.W.dispose=function(){this.Ky()||(g.Ic("yt.mdx.remote.remoteClient_",null),this.publish("beforeDispose"),gx(this,3));g.l6.prototype.dispose.call(this)}; g.W.Tn=function(){KqL(this);CVW(this);qiw(this);g.Gw(this.Z);this.Z=NaN;g.Gw(this.X);this.X=NaN;this.j=null;g.NR(this.Pw);this.Pw.length=0;this.T.dispose();g.l6.prototype.Tn.call(this);this.K=this.G=this.W=this.Y=this.T=null}; g.W.S_=function(U){if(!this.W||this.W.length===0)return!1;for(var Y=g.J(this.W),A=Y.next();!A.done;A=Y.next())if(!A.value.capabilities.has(U))return!1;return!0}; g.W.Dj=function(){var U=3;this.Ky()||(U=0,isNaN(this.B1())?this.T.IA()&&isNaN(this.J)&&(U=1):U=2);return U}; g.W.hG=function(U){mY("Disconnecting with "+U);g.Ic("yt.mdx.remote.remoteClient_",null);KqL(this);this.publish("beforeDisconnect",U);U==1&&VD();this.T.disconnect(U);this.dispose()}; g.W.xg=function(){var U=this.Y;this.j&&(U=this.Y.clone(),fb(U,this.j,U.index));return ZTz(U)}; g.W.LiX=function(U){var Y=this,A=new RT(U);A.videoId&&A.videoId!=this.Y.videoId&&(this.j=A.videoId,g.Gw(this.Z),this.Z=g.vn(function(){if(Y.j){var d=Y.j;Y.j=null;Y.Y.videoId!=d&&nb(Y,"getNowPlaying")}},5E3)); var c=[];this.Y.listId==A.listId&&this.Y.videoId==A.videoId&&this.Y.index==A.index||c.push("remoteQueueChange");this.Y.playerState==A.playerState&&this.Y.volume==A.volume&&this.Y.muted==A.muted&&sf(this.Y)==sf(A)&&g.Zm(this.Y.trackData)==g.Zm(A.trackData)||c.push("remotePlayerChange");this.Y.reset(U);g.MF(c,function(d){this.publish(d)},this)}; g.W.Uh=function(){var U=this.T.getDeviceId(),Y=g.$z(this.W,function(A){return A.type=="REMOTE_CONTROL"&&A.id!=U}); return Y?Y.id:""}; g.W.B1=function(){return this.T.Px()}; g.W.lK=function(){return this.K||"UNSUPPORTED"}; g.W.Lb=function(){return this.G||""}; g.W.Xp=function(){!isNaN(this.B1())&&this.T.JC()}; g.W.d1E=function(U,Y){nb(this,U,Y);YZf(this)}; g.W.sE=function(){var U=g.ML("SAPISID","")||g.ML("__Secure-1PAPISID")||"",Y=g.ML("__Secure-3PAPISID","")||"";if(!U&&!Y)return"";U=g.U_(g.CC(U),2);Y=g.U_(g.CC(Y),2);return g.U_(g.CC(","+U+","+Y),2)}; yg.prototype.subscribe=yg.prototype.subscribe;yg.prototype.unsubscribeByKey=yg.prototype.H5;yg.prototype.getProxyState=yg.prototype.Dj;yg.prototype.disconnect=yg.prototype.hG;yg.prototype.getPlayerContextData=yg.prototype.xg;yg.prototype.setPlayerContextData=yg.prototype.LiX;yg.prototype.getOtherConnectedRemoteId=yg.prototype.Uh;yg.prototype.getReconnectTimeout=yg.prototype.B1;yg.prototype.getAutoplayMode=yg.prototype.lK;yg.prototype.getAutoplayVideoId=yg.prototype.Lb;yg.prototype.reconnect=yg.prototype.Xp; yg.prototype.sendMessage=yg.prototype.d1E;yg.prototype.getXsrfToken=yg.prototype.sE;yg.prototype.isCapabilitySupportedOnConnectedDevices=yg.prototype.S_;g.w(V5I,TD);g.W=V5I.prototype;g.W.LX=function(U){return this.Gz.$_gs(U)}; g.W.contains=function(U){return!!this.Gz.$_c(U)}; g.W.get=function(U){return this.Gz.$_g(U)}; g.W.start=function(){this.Gz.$_st()}; g.W.add=function(U,Y,A){this.Gz.$_a(U,Y,A)}; g.W.remove=function(U,Y,A){this.Gz.$_r(U,Y,A)}; g.W.Vh=function(U,Y,A,c){this.Gz.$_un(U,Y,A,c)}; g.W.Tn=function(){for(var U=this.Y.length,Y=0;Y1&&!this.U.getOption("remote","quickCast")?(this.PU=g.bw(U,this.Y,this),this.KX(g.mk(U,this.Y)),U=g.M(this.U.getOption("remote","currentReceiver")),U=this.Y(U),this.options[U]&&this.oS(U),this.enable(!0)):this.enable(!1)}; Ps.prototype.Y=function(U){return U.key}; Ps.prototype.Jw=function(U){return U==="cast-selector-receiver"?"Enviar...":this.PU[U].name}; Ps.prototype.FX=function(U){g.kI.prototype.FX.call(this,U);this.U.setOption("remote","currentReceiver",this.PU[U]);this.o1.Kr()};g.w(fSf,g.lj);g.W=fSf.prototype; g.W.create=function(){var U=this.player.L(),Y=g.M0(U);U={device:"Desktop",app:"youtube-desktop",loadCastApiSetupScript:U.S("mdx_load_cast_api_bootstrap_script"),enableDialLoungeToken:U.S("enable_dial_short_lived_lounge_token"),enableCastLoungeToken:U.S("enable_cast_short_lived_lounge_token")};WfT(Y,U);this.subscriptions.push(g.oQ("yt-remote-before-disconnect",this.brr,this));this.subscriptions.push(g.oQ("yt-remote-connection-change",this.yBJ,this));this.subscriptions.push(g.oQ("yt-remote-receiver-availability-change",this.uy, this));this.subscriptions.push(g.oQ("yt-remote-auto-connect",this.rBW,this));this.subscriptions.push(g.oQ("yt-remote-receiver-resumed",this.kNJ,this));this.subscriptions.push(g.oQ("mdx-privacy-popup-confirm",this.puJ,this));this.subscriptions.push(g.oQ("mdx-privacy-popup-cancel",this.E8n,this));this.uy()}; g.W.load=function(){this.player.cancelPlayback();g.lj.prototype.load.call(this);this.pF=new sBw(this);this.player.Y0(this.pF);this.e2=new kBI(this,this.player,this.u9);var U=(U=e7o())?U.currentTime:0;var Y=jBq()?new SN(g.M(cs()),void 0):null;U==0&&Y&&(U=sf(Mt(Y)));U!==0&&this.ya(U);h7z(this,this.g1,this.g1);this.player.vN(6)}; g.W.unload=function(){this.player.publish("mdxautoplaycanceled");this.player.Bq();this.ZP=this.ZH;g.VM(this.e2,this.u9);this.u9=this.pF=this.e2=null;g.lj.prototype.unload.call(this);this.player.vN(5);Vt(this)}; g.W.Tn=function(){g.z4(this.subscriptions);g.lj.prototype.Tn.call(this)}; g.W.Zz=function(U){var Y=g.SS.apply(1,arguments);this.loaded&&this.e2.zX.apply(this.e2,[U].concat(g.X(Y)))}; g.W.getAdState=function(){return this.rV}; g.W.kD=function(){return this.u9?Mt(this.u9).kD:!1}; g.W.pX=function(){return this.u9?Mt(this.u9).pX:!1}; g.W.ya=function(U,Y){this.mX=U||0;this.player.publish("progresssync",U,Y);this.player.M5("onVideoProgress",U||0)}; g.W.getCurrentTime=function(){return this.mX}; g.W.getProgressState=function(){var U=Mt(this.u9),Y=this.player.getVideoData();return{airingStart:0,airingEnd:0,allowSeeking:!U.sb()&&this.player.O9(),clipEnd:Y.clipEnd,clipStart:Y.clipStart,current:this.getCurrentTime(),displayedStart:-1,duration:U.getDuration(),ingestionTime:U.T?U.W+aT(U):U.W,isAtLiveHead:(U.T?U.Y+aT(U):U.Y)-this.getCurrentTime()<=1,loaded:U.Z,seekableEnd:U.T?U.Y+aT(U):U.Y,seekableStart:U.j>0?U.j+aT(U):U.j,offset:0,viewerLivestreamJoinMediaTime:0}}; g.W.nextVideo=function(){this.u9&&this.u9.nextVideo()}; g.W.G6=function(){this.u9&&this.u9.G6()}; g.W.brr=function(U){U===1&&(this.o8=this.u9?Mt(this.u9):null)}; g.W.yBJ=function(){var U=jBq()?new SN(g.M(cs()),void 0):null;if(U){var Y=this.ZP;this.loaded&&this.unload();this.u9=U;this.o8=null;Y.key!==this.ZH.key&&(this.ZP=Y,this.load())}else g.P7(this.u9),this.u9=null,this.loaded&&(this.unload(),(U=this.o8)&&U.videoId===this.player.getVideoData().videoId&&this.player.cueVideoById(U.videoId,sf(U)));this.player.publish("videodatachange","newdata",this.player.getVideoData(),3)}; g.W.uy=function(){var U=[this.ZH],Y=U.concat,A=wjo();Bf()&&g.hu("yt-remote-cast-available")&&A.push({key:"cast-selector-receiver",name:"Cast..."});this.PU=Y.call(U,A);U=Jzm()||this.ZH;$f(this,U);this.player.M5("onMdxReceiversChange")}; g.W.rBW=function(){var U=g.M(Jzm());$f(this,U)}; g.W.kNJ=function(){this.ZP=g.M(Jzm())}; g.W.puJ=function(){this.Sz=!0;Vt(this);oa=!1;dk&&EQ(dk,1);dk=null}; g.W.E8n=function(){this.Sz=!1;Vt(this);$f(this,this.ZH);this.ZP=this.ZH;oa=!1;dk=null;this.player.playVideo()}; g.W.W5=function(U,Y){switch(U){case "casting":return this.loaded;case "receivers":return this.PU;case "currentReceiver":return Y&&(Y.key==="cast-selector-receiver"?bTO():$f(this,Y)),this.loaded?this.ZP:this.ZH;case "quickCast":return this.PU.length===2&&this.PU[1].key==="cast-selector-receiver"?(Y&&bTO(),!0):!1}}; g.W.bq=function(){this.u9.bq()}; g.W.Hi=function(){return!1}; g.W.getOptions=function(){return["casting","receivers","currentReceiver","quickCast"]}; g.W.isLoggedIn=function(){var U,Y;return((U=g.DQ("PLAYER_CONFIG"))==null?void 0:(Y=U.args)==null?void 0:Y.authuser)!==void 0?!0:!(!g.DQ("SESSION_INDEX")&&!g.DQ("LOGGED_IN"))};g.rH("remote",fSf);})(_yt_player);